summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--ChangeLog1293
-rw-r--r--FUTURES59
-rw-r--r--Makefile.am47
-rw-r--r--Makefile.in197
-rw-r--r--NEWS25
-rw-r--r--README.git307
-rw-r--r--README_d/ChangeLog8
-rw-r--r--README_d/README.hacking11
-rw-r--r--README_d/README.mpfr25
-rw-r--r--TODO41
-rw-r--r--TODO.xgawk148
-rw-r--r--aclocal.m41
-rw-r--r--array.c1462
-rw-r--r--awk.h809
-rw-r--r--awkgram.c3631
-rw-r--r--awkgram.y1944
-rw-r--r--awklib/.gitignore8
-rw-r--r--awklib/Makefile.in15
-rw-r--r--awklib/eg/lib/gettime.awk4
-rw-r--r--awklib/eg/prog/alarm.awk4
-rwxr-xr-xbootstrap.sh2
-rw-r--r--builtin.c649
-rw-r--r--cint_array.c1219
-rw-r--r--cmd.h11
-rw-r--r--command.c159
-rw-r--r--command.y159
-rw-r--r--configh.in3
-rwxr-xr-xconfigure293
-rw-r--r--configure.ac43
-rw-r--r--debug.c905
-rw-r--r--doc/ChangeLog192
-rw-r--r--doc/Makefile.am25
-rw-r--r--doc/Makefile.in75
-rw-r--r--doc/api-figure1.eps536
-rw-r--r--doc/api-figure1.fig40
-rw-r--r--doc/api-figure1.pdfbin0 -> 10707 bytes
-rw-r--r--doc/api-figure1.pngbin0 -> 9183 bytes
-rw-r--r--doc/api-figure1.txt24
-rw-r--r--doc/api-figure2.eps517
-rw-r--r--doc/api-figure2.fig26
-rw-r--r--doc/api-figure2.pdfbin0 -> 12027 bytes
-rw-r--r--doc/api-figure2.pngbin0 -> 8963 bytes
-rw-r--r--doc/api-figure2.txt12
-rw-r--r--doc/api-figure3.eps526
-rw-r--r--doc/api-figure3.fig29
-rw-r--r--doc/api-figure3.pdfbin0 -> 12345 bytes
-rw-r--r--doc/api-figure3.pngbin0 -> 8860 bytes
-rw-r--r--doc/api-figure3.txt13
-rw-r--r--doc/awkcard.in131
-rw-r--r--doc/gawk.1349
-rw-r--r--doc/gawk.info12008
-rw-r--r--doc/gawk.texi11871
-rw-r--r--doc/gawkinet.info72
-rw-r--r--doc/general-program.pdfbin5588 -> 5613 bytes
-rw-r--r--doc/general-program.pngbin0 -> 6078 bytes
-rw-r--r--doc/general-program.txt4
-rw-r--r--doc/process-flow.pdfbin6558 -> 6583 bytes
-rw-r--r--doc/process-flow.pngbin0 -> 7856 bytes
-rw-r--r--doc/process-flow.txt11
-rw-r--r--doc/texinfo.tex36
-rw-r--r--eval.c1645
-rw-r--r--eval_d.c27
-rw-r--r--ext.c249
-rw-r--r--extension/.gitignore3
-rw-r--r--extension/ABOUT-NLS1282
-rw-r--r--extension/AUTHORS13
-rw-r--r--extension/COPYING674
-rw-r--r--extension/ChangeLog506
-rw-r--r--extension/INSTALL370
-rw-r--r--extension/Makefile.am106
-rw-r--r--extension/Makefile.in1171
-rw-r--r--extension/NEWS7
-rw-r--r--extension/README10
-rw-r--r--extension/README.fts68
-rw-r--r--extension/aclocal.m41017
-rw-r--r--extension/arrayparm.c83
-rw-r--r--extension/build-aux/ChangeLog8
-rwxr-xr-xextension/build-aux/ar-lib270
-rwxr-xr-xextension/build-aux/config.guess1534
-rwxr-xr-xextension/build-aux/config.rpath672
-rwxr-xr-xextension/build-aux/config.sub1782
-rwxr-xr-xextension/build-aux/depcomp780
-rwxr-xr-xextension/build-aux/install-sh527
-rw-r--r--extension/build-aux/ltmain.sh9655
-rwxr-xr-xextension/build-aux/missing330
-rw-r--r--extension/configh.in137
-rwxr-xr-xextension/configure16293
-rw-r--r--extension/configure.ac75
-rw-r--r--extension/dl.c92
-rwxr-xr-xextension/doit1
-rw-r--r--extension/filefuncs.3am359
-rw-r--r--extension/filefuncs.c838
-rw-r--r--extension/fnmatch.3am120
-rw-r--r--extension/fnmatch.c186
-rw-r--r--extension/foo.awk9
-rw-r--r--extension/fork.3am97
-rw-r--r--extension/fork.c143
-rw-r--r--extension/fts.3773
-rw-r--r--extension/gawkfts.c1240
-rw-r--r--extension/gawkfts.h157
-rw-r--r--extension/m4/ChangeLog13
-rw-r--r--extension/m4/gettext.m4383
-rw-r--r--extension/m4/iconv.m4214
-rw-r--r--extension/m4/intlmacosx.m451
-rw-r--r--extension/m4/lib-ld.m4110
-rw-r--r--extension/m4/lib-link.m4774
-rw-r--r--extension/m4/lib-prefix.m4224
-rw-r--r--extension/m4/libtool.m47986
-rw-r--r--extension/m4/ltoptions.m4384
-rw-r--r--extension/m4/ltsugar.m4123
-rw-r--r--extension/m4/ltversion.m423
-rw-r--r--extension/m4/lt~obsolete.m498
-rw-r--r--extension/m4/nls.m432
-rw-r--r--extension/m4/po.m4449
-rw-r--r--extension/m4/progtest.m492
-rw-r--r--extension/ordchr.3am77
-rw-r--r--extension/ordchr.c101
-rw-r--r--extension/readdir.3am130
-rw-r--r--extension/readdir.c343
-rw-r--r--extension/readfile.3am70
-rw-r--r--extension/readfile.c85
-rw-r--r--extension/revoutput.3am73
-rw-r--r--extension/revoutput.c139
-rw-r--r--extension/revtwoway.3am63
-rw-r--r--extension/revtwoway.c336
-rw-r--r--extension/rwarray.3am102
-rw-r--r--extension/rwarray.awk28
-rw-r--r--extension/rwarray.c529
-rw-r--r--extension/rwarray0.c475
-rw-r--r--extension/stack.c90
-rw-r--r--extension/stack.h (renamed from eval_p.c)12
-rwxr-xr-xextension/steps23
-rw-r--r--extension/testarg.awk7
-rw-r--r--extension/testarg.c57
-rw-r--r--extension/testarrayparm.awk10
-rw-r--r--extension/testext.c827
-rw-r--r--extension/testff.awk30
-rw-r--r--extension/testfork.awk20
-rw-r--r--extension/testordchr.awk6
-rw-r--r--extension/time.3am88
-rw-r--r--extension/time.c179
-rw-r--r--extension/xreadlink.c95
-rw-r--r--extension/xreadlink.h23
-rw-r--r--field.c217
-rw-r--r--gawkapi.c1177
-rw-r--r--gawkapi.h898
-rw-r--r--int_array.c800
-rw-r--r--interpret.h1273
-rw-r--r--io.c1618
-rw-r--r--m4/ChangeLog14
-rw-r--r--m4/mpfr.m462
-rw-r--r--main.c492
-rw-r--r--mbsupport.h11
-rw-r--r--missing_d/ChangeLog4
-rw-r--r--missing_d/snprintf.c4
-rw-r--r--missing_d/strtoul.c12
-rw-r--r--mpfr.c1620
-rw-r--r--msg.c53
-rw-r--r--node.c267
-rw-r--r--pc/ChangeLog66
-rw-r--r--pc/Makefile99
-rw-r--r--pc/Makefile.tst43
-rw-r--r--pc/config.h9
-rw-r--r--pc/gawkmisc.pc27
-rw-r--r--po/.gitignore4
-rw-r--r--po/ChangeLog4
-rw-r--r--po/POTFILES.in21
-rw-r--r--po/ast.gmobin37068 -> 0 bytes
-rw-r--r--po/ca.gmobin25787 -> 0 bytes
-rw-r--r--po/da.gmobin46773 -> 42480 bytes
-rw-r--r--po/da.po2441
-rw-r--r--po/de.gmobin50150 -> 45571 bytes
-rw-r--r--po/de.po2441
-rw-r--r--po/es.gmobin49444 -> 44930 bytes
-rw-r--r--po/es.po2468
-rw-r--r--po/fi.gmobin49842 -> 45237 bytes
-rw-r--r--po/fi.po2441
-rw-r--r--po/fr.gmobin51175 -> 46424 bytes
-rw-r--r--po/fr.po2443
-rw-r--r--po/ga.gmobin33929 -> 0 bytes
-rw-r--r--po/gawk.pot2197
-rw-r--r--po/he.gmobin24651 -> 0 bytes
-rw-r--r--po/id.gmobin35809 -> 0 bytes
-rw-r--r--po/it.gmobin44825 -> 43572 bytes
-rw-r--r--po/it.po2377
-rw-r--r--po/ja.gmobin53065 -> 48191 bytes
-rw-r--r--po/ja.po2439
-rw-r--r--po/nl.gmobin47408 -> 43081 bytes
-rw-r--r--po/nl.po2441
-rw-r--r--po/pl.gmobin49524 -> 44960 bytes
-rw-r--r--po/pl.po2470
-rw-r--r--po/pt_BR.gmobin29120 -> 0 bytes
-rw-r--r--po/ro.gmobin25383 -> 0 bytes
-rw-r--r--po/rw.gmobin487 -> 0 bytes
-rw-r--r--po/sv.gmobin46852 -> 42504 bytes
-rw-r--r--po/sv.po2438
-rw-r--r--po/tr.gmobin33826 -> 0 bytes
-rw-r--r--po/vi.gmobin56057 -> 50868 bytes
-rw-r--r--po/vi.po2438
-rw-r--r--po/zh_CN.gmobin33717 -> 0 bytes
-rw-r--r--posix/ChangeLog27
-rw-r--r--posix/gawkmisc.c37
-rw-r--r--profile.c159
-rw-r--r--profile_p.c27
-rw-r--r--re.c129
-rw-r--r--str_array.c731
-rw-r--r--symbol.c855
-rw-r--r--test/ChangeLog240
-rwxr-xr-xtest/Gentests19
-rw-r--r--test/Makefile.am311
-rw-r--r--test/Makefile.in922
-rw-r--r--test/Maketests597
-rw-r--r--test/assignconst.awk58
-rw-r--r--test/assignconst.ok42
-rw-r--r--test/badargs.ok5
-rw-r--r--test/delfunc.ok5
-rw-r--r--test/dumpvars.ok2
-rw-r--r--test/filefuncs.awk25
-rw-r--r--test/filefuncs.ok0
-rw-r--r--test/fmtspcl-mpfr.ok0
-rw-r--r--test/fnamedat.ok5
-rw-r--r--test/fnarray.ok2
-rw-r--r--test/fnarray2.in1
-rw-r--r--test/fnarray2.ok4
-rw-r--r--test/fnarydel-mpfr.ok27
-rw-r--r--test/fnarydel.ok10
-rw-r--r--test/fnasgnm.ok5
-rw-r--r--test/fnmatch.awk11
-rw-r--r--test/fnmatch.ok9
-rw-r--r--test/fnparydl-mpfr.ok10
-rw-r--r--test/fnparydl.ok6
-rw-r--r--test/fork.awk33
-rw-r--r--test/fork.ok0
-rw-r--r--test/fork2.awk35
-rw-r--r--test/fork2.ok0
-rw-r--r--test/fts.awk121
-rw-r--r--test/functab1.awk3
-rw-r--r--test/functab1.ok2
-rw-r--r--test/functab2.awk8
-rw-r--r--test/functab2.ok2
-rw-r--r--test/functab3.awk10
-rw-r--r--test/functab3.ok2
-rw-r--r--test/functab4.awk14
-rw-r--r--test/functab4.ok3
-rw-r--r--test/funsmnam.ok2
-rw-r--r--test/gsubasgn.ok8
-rw-r--r--test/hello.awk3
-rw-r--r--test/id.awk11
-rw-r--r--test/id.ok32
-rw-r--r--test/incdupe.ok3
-rw-r--r--test/incdupe2.ok2
-rw-r--r--test/incdupe3.ok2
-rw-r--r--test/incdupe4.ok2
-rw-r--r--test/incdupe5.ok2
-rw-r--r--test/incdupe6.ok3
-rw-r--r--test/incdupe7.ok3
-rw-r--r--test/inchello.awk1
-rw-r--r--test/inclib.awk7
-rw-r--r--test/include.awk5
-rw-r--r--test/include.ok2
-rw-r--r--test/include2.ok2
-rw-r--r--test/lintwarn.ok1
-rw-r--r--test/match2.ok5
-rw-r--r--test/messages.awk2
-rw-r--r--test/mpfrbigint.awk11
-rw-r--r--test/mpfrbigint.ok5
-rw-r--r--test/mpfrexprange.awk7
-rw-r--r--test/mpfrexprange.ok2
-rw-r--r--test/mpfrieee.awk13
-rw-r--r--test/mpfrieee.ok12
-rw-r--r--test/mpfrnr.awk10
-rw-r--r--test/mpfrnr.in3
-rw-r--r--test/mpfrnr.ok1
-rw-r--r--test/mpfrrnd.awk15
-rw-r--r--test/mpfrrnd.ok10
-rw-r--r--test/mpfrsort.awk8
-rw-r--r--test/mpfrsort.ok11
-rw-r--r--test/ordchr.awk10
-rw-r--r--test/ordchr.ok5
-rw-r--r--test/ordchr2.ok1
-rw-r--r--test/rand-mpfr.ok1
-rw-r--r--test/rand-mpfr1.ok1
-rw-r--r--test/readdir.awk7
-rw-r--r--test/readdir0.awk9
-rw-r--r--test/revout.awk6
-rw-r--r--test/revout.ok1
-rw-r--r--test/revtwoway.awk11
-rw-r--r--test/revtwoway.ok2
-rw-r--r--test/rwarray.awk33
-rw-r--r--test/rwarray.in780
-rw-r--r--test/rwarray.ok3
-rw-r--r--test/symtab1.awk21
-rw-r--r--test/symtab1.ok31
-rw-r--r--test/symtab2.awk6
-rw-r--r--test/symtab2.ok2
-rw-r--r--test/symtab3.awk1
-rw-r--r--test/symtab3.ok2
-rw-r--r--test/symtab4.awk1
-rw-r--r--test/symtab4.in2
-rw-r--r--test/symtab4.ok2
-rw-r--r--test/symtab5.awk1
-rw-r--r--test/symtab5.in2
-rw-r--r--test/symtab5.ok2
-rw-r--r--test/symtab6.awk1
-rw-r--r--test/symtab6.ok27
-rw-r--r--test/testext.ok75
-rw-r--r--test/time.awk22
-rw-r--r--test/time.ok3
-rw-r--r--version.c2
-rw-r--r--vms/ChangeLog18
-rw-r--r--vms/gawkmisc.vms26
312 files changed, 117471 insertions, 24458 deletions
diff --git a/.gitignore b/.gitignore
index 533493a3..1d665c4d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,5 +15,6 @@ dgawk
gawk
pgawk
stamp-h1
+libtool
test/fmtspcl.ok
diff --git a/ChangeLog b/ChangeLog
index 6dd4c394..a9c262b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,14 +2,186 @@
* Update to bison 2.6.5. Various files regenerated.
+2012-11-10 John Haque <j.eh@mchsi.com>
+
+ * int_array.c (int_copy): Initialize next pointer of newchain to null.
+ * eval.c (eval_condition): Force string context for an integer used
+ as array index.
+
+2012-11-10 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkapi.c (api_add_ext_func, api_awk_atexit, api_clear_array,
+ api_create_array, api_create_value, api_register_ext_version,
+ api_release_value, api_update_ERRNO_string, node_to_awk_value,
+ remove_element, run_ext_exit_handlers): Add null pointer checks.
+ Everywhere: Add / fixup leading comments.
+
+ * interpret.h (Op_store_sub): If assigning to an unitialized variable
+ through SYMTAB, change it to Node_var. Add explanatory comments.
+ * symbol.c (get_symbol): Rationalized. Skip non-variables in SYMTAB.
+
+2012-11-04 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkapi.h: Minor documentation edit.
+
+2012-10-31 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkgram.y (want_regexp): Use as a bool, not as an int.
+ * field.c: Fix a comment.
+ * gawkapi.h: Add comment to include <errno.h>.
+ * symbol.c (load_symbols): ``No automatic aggregate initialization.''
+ Here too. Sigh again.
+
+ * gawkapi.h: Minor documentation edits.
+
2012-10-28 Arnold D. Robbins <arnold@skeeve.com>
* Update to bison 2.6.4. Various files regenerated.
+2012-10-27 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkapi.h: Continuing the minor formatting / doc cleanups.
+
+2012-10-26 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkapi.h: Continuing the minor formatting / doc cleanups.
+
+2012-10-24 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkapi.h: Still more minor formatting / doc cleanups.
+
+2012-10-23 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkapi.h: More minor formatting / doc cleanups.
+
+2012-10-21 Arnold D. Robbins <arnold@skeeve.com>
+
+ Fixes for z/OS from Dave Pitts.
+
+ * awk.h (assoc_list_flags): No trailing comma on last enum value.
+ * gawkapi.h (awk_valtype_t): Ditto.
+ * symbol.c (lookup): ``No automatic aggregate initialization.'' Sigh.
+
+ Unrelated:
+
+ * gawkapi.h: Minor formatting / doc cleanups.
+
+2012-10-19 Arnold D. Robbins <arnold@skeeve.com>
+
+ If SYMTAB is used, make sure ENVIRON and PROCINFO get loaded too.
+
+ * awkgram.y (process_deferred): New function. Call it when program
+ is completely parsed.
+ (symtab_used): New variable.
+ (variable): Set it to true if SYMTAB is looked up.
+ * main.c (load_environ, load_procinfo): Make sure the routines are
+ only called once.
+
+ Unrelated fixes:
+
+ * awkgram.y (yylex): Check continue_allowed and break_allowed as
+ soon as they are seen in the scanner; the rules that check them
+ can not be reduced until after a token that allows them is seen,
+ leading to errors at execution time.
+ * interpret.h (Op_K_break, Op_K_continue, Op_jmp): Add asssertion
+ that pc->target_jmp is not NULL.
+
+ * symbol.c (lookup): Correct a comment.
+
+2012-10-14 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkapi.h (IOBUF_PUBLIC): Renamed awk_input_buf_t.
+ (struct iobuf_public): Renamed struct awk_input.
+ * awk.h: Adjust.
+
2012-10-13 Arnold D. Robbins <arnold@skeeve.com>
* Update to Automake 1.12.4. Various files regenerated.
+2012-10-11 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (dup_ent): New member for Node_param_list.
+ * symbol.c (install): For parameters, if this is a duplicate, chain
+ it off the original using the dup_ent pointer.
+ (remove_params): If there's a duplicate, remove it from the list.
+
+ * awk.h: Fix flags to have unique numeric values. Oops.
+
+2012-10-10 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkapi.h: Add considerably more documentation. Rearrange order
+ of functions in the struct to make more sense, grouping related
+ functions together in a more logical order.
+ * gawkapi.c: Adjust as needed.
+ * ext.c (make_builtin): Adjust for name change in struct member.
+
+2012-10-05 Arnold D. Robbins <arnold@skeeve.com>
+
+ * mbsupport.h: Add a bunch of undefs for z/OS.
+
+2012-10-04 Arnold D. Robbins <arnold@skeeve.com>
+
+ * TODO.xgawk: Update.
+ * awk.h (make_str_node): Removed macro.
+ (make_string): Modified to call make_str_node.
+ (r_make_str_node): Renamed to make_str_node.
+ * gawkapi.c: Changed r_make_str_node to make_str_node everywhere.
+ * node.c (make_str_node): Renamed from make_str_node.
+
+ Update to automake 1.12.4.
+
+ * Makefile.in, aclocal.m4, awklib/Makefile.in, doc/Makefile.in,
+ extension/Makefile.in, extension/aclocal.m4, test/Makefile.in:
+ Regenerated.
+
+ * interpret.h (Op_Subscript): Added lint warnings for FUNCTAB
+ and SYMTAB.
+
+2012-10-02 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (func_table): Declare.
+ * awkgram.y: If do_posix or do_traditional, then check for
+ delete on SYMTAB. Add check for delete on FUNCTAB, also.
+ * interpret.h (Op_Subscript): For FUNCTAB, return the element name
+ as its value too. Avoids lots of weirdness and allows indirect calls
+ after assignment from FUNCTAB["foo"] to work.
+ (Op_store_sub): Disallow assignment to elements of FUNCTAB.
+ (Op_indirect_func_all): Turn assert into check and fatal error.
+ * symbol.c (func_table): No longer static.
+ (lookup): If do_posix or do_traditional, skip the global table.
+ (release_all_vars): Clear func_table too.
+
+2012-09-25 Arnold D. Robbins <arnold@skeeve.com>
+
+ First cut at SYMTAB and FUNCTAB. This does the following:
+ - Change symbol table handling to use gawk arrays.
+ - Store symbols in SYMTAB array and allow indirect access
+ through SYMTAB to variables, both getting and setting.
+ - List function names in FUNCTAB indexes; Values cannot be
+ used at the moment.
+ - No documentation yet.
+
+ * awk.h (Node_hashnode, hnext, hname, hlength, hcode, hvalue):
+ Removed, not needed any more.
+ (init_symbol_table, symbol_table): Add declarations.
+ * awkgram.y: Disallow delete on SYMTAB, fix warning for tawk
+ extension if traditional.
+ * eval.c (nodetypes): Remove Node_hashnode element.
+ * interpret.h (Op_subscript, Op_store_sub): Handle SYMTAB and go
+ through to the actual value.
+ * main.c (main): Init Nnull_string earlier. Add call to
+ init_symbol_table().
+ * profile.c (pp_str, pp_len): Change definitions.
+ (pp_next): New macro.
+ (pp_push, pp_pop): Adjust uses.
+ * symbol.c (variables): Removed.
+ (global_table, param_table, func_table, symbol_table,
+ installing_specials): New variables.
+ (lookup, make_params, install_params, remove_params, remove_symbol,
+ make_symbol, install, get_symbols, release_all_vars, append_symbol,
+ release_symbols, load_symbols): Rework logic considerably.
+ (init_symbol_table): New function.
+
2012-09-23 Arnold D. Robbins <arnold@skeeve.com>
`delete array' and `nextfile' are now in POSIX.
@@ -20,14 +192,805 @@
and `nextfile'.
(tokentab): Set flags to zero for nextfile.
+2012-09-19 Arnold D. Robbins <arnold@skeeve.com>
+
+ * symbol.c (load_symbols): Zero out the new node. Prevents assertion
+ failure on PPC Mac OS X.
+
+2012-09-14 Arnold D. Robbins <arnold@skeeve.com>
+
+ Allow read-only access to built-in variables from extensions.
+
+ * awk.h (NO_EXT_SET): New flag.
+ * gawkapi.c (api_sym_lookup, api_sym_update_real): Set flag if off
+ limits variable instead of failing. Adjust logic.
+ (api_sym_update_scalar, api_set_array_element, api_del_array_element,
+ api_release_flattened_array): Adjust logic.
+ * gawkapi.h: Adjust documentation.
+
+ Provide PROCINFO["identifiers"]. Undocumented for now.
+
+ * awk.h (load_symbols): Add declaration.
+ * awkgram.y (variable): Adjust comment formatting.
+ * main.c (main): Call load_symbols().
+ * symbol.c (load_symbols): New function.
+
+2012-09-13 Arnold D. Robbins <arnold@skeeve.com>
+
+ * configure.ac: Determination of DYNAMIC adjusted. Hopefully is
+ smarter for z/OS.
+
+2012-09-13 Dave Pitts <dpitts@cozx.com>
+
+ * awk.h: Add defines for z/OS for newer types.
+
+2012-08-31 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkapi.c: Wrap various bits in #ifdef DYNAMIC so that
+ gawk will compile on systems without dynamic loading.
+
+2012-08-24 Arnold D. Robbins <arnold@skeeve.com>
+
+ Add version facility to API. Thanks to Manuel Collado
+ for the idea.
+
+ * awk.h (print_ext_versions): Declare.
+ Rearrange includes and decls to make more sense.
+ * gawkapi.h (register_ext_version): New API.
+ (dl_load_func): Add code for ext_version.
+ * gawkapi.c (api_register_ext_version, print_ext_versions):
+ New functions.
+ * main.c (do_version): New variable.
+ (optab): Set it for -v / --version.
+ (main): Set it in arg parsing switch. Call version() after the
+ extensions have been loaded.
+
+2012-08-22 Arnold D. Robbins <arnold@skeeve.com>
+
+ Add output wrapper and two-way processor to extension API.
+
+ * awk.h (struct redirect): Replace output FILE * with awk_output_buf_t.
+ (register_output_wrapper, register_two_way_processor): Declare.
+ * builtin.c (efwrite): Adjust logic to use rp->output data and
+ functions if rp is not NULL. Remove redundant declaration of function.
+ (do_fflush, do_printf, do_print, do_print_rec): Same adjustment.
+ * ext.c (make_builtin): Adjust error messages.
+ * gawkapi.c (api_register_output_wrapper,
+ api_register_two_way_processor): New functions.
+ (sym_update_real): Adjust code formatting.
+ * gawkapi.h (awk_input_parser_t): Make next pointer awk_const.
+ (awk_output_buf_t, awk_two_way_processor_t): New structs.
+ (api_register_output_wrapper, api_register_two_way_processor): New APIs.
+ (dl_load_func): Allow for empty function table (NULL elements).
+ * io.c (find_output_wrapper, init_output_wrapper, find_two_processor,
+ gawk_fwrite, gawk_ferror, gawk_fflush, gawk_fclose): New functions.
+ (redirect): Call init_output_wrapper, find_output_wrapper as needed.
+ Adjust use of rp->fp to rp->output.fp and also function calls.
+ (close_rp, close_redir, flush_io): Same adjustment.
+ (two_way_open): Same adjustment. Call find_two_way_processor, and
+ find_output_wrapper, as needed.
+
2012-08-17 Arnold D. Robbins <arnold@skeeve.com>
- * Update infrastructure to automake 1.12.3, bison 2.6.3.
+ * Update infrastructure: Automake 1.12.3 and bison 2.6.2.
-2012-08-12 Arnold D. Robbins <arnold@skeeve.com>
+2012-08-15 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c: Sync w/GNU grep.
+2012-08-12 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkapi.h: Make the versions enum constants instead of defines.
+
+2012-08-11 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * awkgram.y (add_srcfile): It is now a fatal error to load the
+ same file with -f and -i (or @include).
+ * TODO.xgawk: Update to reflect this change.
+
+2012-08-10 Arnold D. Robbins <arnold@skeeve.com>
+
+ * FUTURES, TODO.xgawk: Updates.
+
+2012-08-08 Arnold D. Robbins <arnold@skeeve.com>
+
+ * configure.ac: Add -DNDEBUG to remove asserts if not developing.
+
+ * gawkapi.h: Document how to build up arrays.
+ * gawkapi.c (api_sym_update): For an array, pass the new cookie
+ back out to the extension.
+
+ * awk.h (IOBUF): Move struct stat into IOBUF_PUBLIC.
+ (os_isreadable): Change to take an IOBUF_PUBLIC.
+ * gawkapi.h (IOBUF_PUBLIC): Received struct stat.
+ (INVALID_HANDLE): Moves to here.
+ * io.c (iop_alloc): Stat the fd and fill in stat buf.
+ (iop_finish): Use passed in stat info.
+
+2012-08-05 Arnold D. Robbins <arnold@skeeve.com>
+
+ * README.git: More stuff added.
+
+2012-08-01 Arnold D. Robbins <arnold@skeeve.com>
+
+ * io.c (iop_finish): New function.
+ (iop_alloc): Add errno_val parameter. Move code into iop_finish.
+ Add large explanatory leading comment.
+ (after_beginfile): Rework logic. Check for input parser first, then
+ check for invalid iop.
+ (nextfile): Organize code better. Call iop_alloc then iop_finish.
+ (redirect): Call iop_alloc, find_input_parser, iop_finish.
+ (two_way_open): Call iop_alloc, find_input_parser, iop_finish.
+ (gawk_popen): Call iop_alloc, find_input_parser, iop_finish.
+ (find_input_parser): Set iop->valid if input parser takes control.
+ (get_a_record): Rework setting RT to use macros.
+
+2012-07-29 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * awk.h (set_RT_to_null, set_RT): Removed.
+ * gawkapi.h (api_set_RT): Removed.
+ (get_record): Signature changed in input parser struct.
+ * gawkapi.c (api_set_RT): Removed.
+ * io.c (set_RT_to_null, set_RT): Removed.
+ (get_a_record): Adjustments for new API for input parser.
+
+2012-07-29 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (os_isreadable): Adjust declaration.
+ (struct iobuf): Add new member `valid'.
+ * io.c (iop_alloc): Remove do_input_parsers parameter, it's
+ always true. Adjust logic to set things to invalid if could not
+ find an input parser.
+ (after_beginfile): Use valid member to check if iobuf is valid.
+ Don't clear iop->errcode.
+ (nextfile): Adjust logic to clear errcode if valid is true and
+ also to update ERRNO.
+ (redirect): Check iop->valid and cleanup as necessary, including
+ setting ERRNO.
+ (two_way_open): Ditto.
+ (gawk_popen): Ditto.
+ (devopen): Remove check for directory.
+
+2012-07-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * io.c (find_input_parser): Issue a warning if take_control_of fails.
+
+2012-07-27 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (set_RT): Change to take a NODE * parameter.
+ * io.c (set_RT): Change to take a NODE * parameter.
+ * gawkapi.h: Change open hook to input parser in comment.
+ * gawkapi.c (api_set_RT): Adjust call to set_RT.
+
+2012-07-26 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (set_RT_to_null, set_RT): Declare functions.
+ (os_isreadable): Declare function.
+ * io.c (set_RT_to_null, set_RT): New functions.
+ (iop_close): Init ret to zero.
+ * gawkapi.c (api_register_input_parser): Check for null pointer.
+ (api_set_RT): New function.
+ * gawkapi.h (api_set_RT): New function.
+
+2012-07-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawkapi.h (IOBUF_PUBLIC): Document the get_record and close_func
+ API.
+ (awk_input_parser_t) Change can_take_file argument to const, and
+ document the API.
+ * io.c (get_a_record): Document that the caller initializes *errcode
+ to 0, and remote the test for non-NULL errcode.
+
+2012-07-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawkapi.c (api_sym_update_scalar): Fix some minor bugs. Was
+ not updating AWK_NUMBER when valref != 1. And strings were not
+ freeing MPFR values.
+
+2012-07-25 Arnold D. Robbins <arnold@skeeve.com>
+
+ Start refactoring of IOBUF handling and turn "open hooks"
+ into "input parsers".
+
+ * awk.h (IOP_NOFREE_OBJ): Flag removed.
+ (register_input_parser): Renamed from register_open_hook.
+ * ext.c (load_ext): Make sure lib_name is not NULL.
+ * gawk_api.c (api_register_input_parser): Renamed from
+ api_register_open_hook.
+ * gawk_api.h (api_register_input_parser): Renamed from
+ api_register_open_hook. Rework structure to have "do you want it"
+ and "take control of it" functions.
+ * io.c (iop_alloc): Remove third argument which is IOBUF pointer.
+ Always malloc it. Remove use of IOP_NOFREE_OBJ everywhere.
+ (find_input_parser): Renamed from find_open_hook.
+ (nextfile): Don't use static IOBUF.
+ (iop_close): Call close_func first. Then close fd or remap it
+ if it's still not INVALID_HANDLE.
+ (register_input_parser): Renamed from register_open_hook.
+ Use a FIFO list and check if more than one parser will accept the
+ file. If so, fatal error.
+
+2012-07-25 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * configure.ac: Instead of using acl_shlibext for the shared library
+ extension, define our own variable GAWKLIBEXT with a hack to work
+ correctly on Mac OS X.
+ * Makefile.am (SHLIBEXT): Use the value of GAWKLIBEXT instead of
+ acl_shlibext.
+
+2012-07-24 Arnold D. Robbins <arnold@skeeve.com>
+
+ * configure.ac: Add crude but small hack to make plug-ins work
+ on Mac OS X.
+
+2012-07-20 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkapi.h: Rework table to not take up so much space.
+ * gawkapi.c (api_sym_update_scalar): Rework optimization code
+ to clean up the function.
+
+2012-07-17 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawkapi.h: Add comments explaining new api_create_value and
+ api_release_value functions.
+ * gawkapi.c (sym_update_real): Allow updates with AWK_SCALAR and
+ AWK_VALUE_COOKIE types. After creating a regular variable,
+ remove the call to unref(node->var_value), since this is not
+ done elsewhere in the code (see, for example, main.c:init_vars).
+ If the update is for an existing variable, allow any val_type
+ except AWK_ARRAY (was previously disallowing AWK_SCALAR and
+ AWK_VALUE_COOKIE for no apparent reason).
+ (api_sym_update_scalar): The switch should return false for an
+ invalid val_type value, so change the AWK_ARRAY case to default.
+ (valid_subscript_type): Any scalar value is good, so accept any valid
+ type except AWK_ARRAY.
+ (api_create_value): Accept only AWK_NUMBER and AWK_STRING values.
+ Anything else should fail.
+
+2012-07-17 Arnold D. Robbins <arnold@skeeve.com>
+
+ Speedup:
+
+ * awk.h (r_free_wstr): Renamed from free_wstr.
+ (free_wstr): Macro to test the WSTRCUR flag first.
+ * node.c (r_free_wstr): Renamed from free_wstr.
+
+ Support value cookies:
+
+ * gawkapi.h (awk_val_type_t): Add AWK_VALUE_COOKIE.
+ (awk_value_cookie_t): New type.
+ (awk_value_t): Support AWK_VALUE_COOKIE.
+ (api_create_value, api_release_value): New function pointers.
+ * gawkapi.c (awk_value_to_node, api_sym_update_scalar,
+ valid_subscript_type): Handle AWK_VALUE_COOKIE.
+ (api_create_value, api_release_value): New functions.
+
+2012-07-16 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkapi.c (awk_value_to_node): Support AWK_SCALAR.
+ (api_sym_update_scalar): Performance improvements.
+
+2012-07-12 Arnold D. Robbins <arnold@skeeve.com>
+
+ Allow creation of constants. Thanks to John Haque for the
+ implementation concept.
+
+ * gawk_api.h (api_sym_constant): Create a constant.
+ * gawk_api.h (api_sym_update_real): Renamed from api_sym_update.
+ Add is_const paramater and do the right thing if true.
+ (api_sym_update, api_sym_constant): Call api_sym_update_real
+ in the correct way.
+ (set_constant): New function.
+
+2012-07-11 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawkapi.h: Fix typo in comment.
+ (awk_value_t): Type for scalar_cookie should be awk_scalar_t,
+ not awk_array_t.
+ (gawk_api): Add new api_sym_lookup_scalar function.
+ (sym_lookup_scalar): New wrapper macro for api_sym_lookup_scalar hook.
+ * gawkapi.c (api_sym_lookup_scalar): New function for faster scalar
+ lookup.
+ (api_impl): Add entry for api_sym_lookup_scalar.
+
+2012-07-11 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawkapi.c (awk_value_to_node): Change to a switch statement
+ so AWK_SCALAR or other invalid type is handled properly.
+ (valid_subscript_type): Test whether a value type is acceptable
+ for use as an array subscript (any scalar value will do).
+ (api_get_array_element, api_set_array_element, api_del_array_element):
+ Use new valid_subscript_type instead of restricting to string values.
+
+2012-07-11 Arnold D. Robbins <arnold@skeeve.com>
+
+ Lots of API work.
+
+ * gawkapi.h: Function pointer members renamed api_XXXX and
+ macros adjusted. More documentation.
+ (awk_valtype_t): New AWK_SCALAR enum for scalar cookies.
+ (awk_scalar_t): New type.
+ (awk_value_t): New member scalar_cookie.
+ (api_sym_update_scalar): New API function.
+ (erealloc): New macro.
+ (make_const_string): New macro, renamed from dup_string.
+ (make_malloced_string): New macro, renamed from make_string.
+ (make_null_string): New inline function.
+ (dl_load_func): Add call to init routine through pointer if
+ not NULL.
+
+ * gawkapi.c (awk_value_to_node): Assume that string values came
+ from malloc.
+ (node_to_awk_value): Handle AWK_SCALAR.
+ (api_sym_update): Ditto.
+ (api_sym_update_scalar): New routine.
+ (api_get_array_element): Return false if the element doesn't exist.
+ Always unref the subscript.
+ (remove_element): New helper routine.
+ (api_del_array_element): Use it.
+ (api_release_flattened_array): Ditto.
+ (api_impl): Add the new routine.
+
+2012-07-11 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawkapi.c (api_sym_update): Allow val_type to be AWK_UNDEFINED
+ for setting a variable to "", i.e. dupnode(Nnull_string).
+
+2012-07-10 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * awkgram.y (add_srcfile): Lint warning message for a previously loaded
+ shared library should say "already loaded shared library" instead
+ of "already included source file".
+
+2012-07-08 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkapi.h (set_array_element): Use index + value instead
+ of element structure. Matches get_array_element.
+ (set_array_element_by_elem): New macro to use an element.
+ * gawkapi.c (api_set_array_element): Make the necessary adjustments.
+
+2012-07-04 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkgram.y (tokentab): Remove limit on number of arguments
+ for "and", "or", and "xor".
+ * builtin.c (do_and, do_or, do_xor): Modify code to perform the
+ respective operation on any number of arguments. There must be
+ at least two.
+
+2012-06-29 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkapi.h: Improve the documentation of the return values
+ per Andrew Schorr.
+
+2012-06-25 Arnold D. Robbins <arnold@skeeve.com>
+
+ * TODO.xgawk: Updated.
+ * awk.h (track_ext_func): Declared.
+ * awkgram.y (enum defref): Add option for extension function.
+ (struct fdesc): Add member for extension function.
+ (func_use): Handle extension function, mark as extension and defined.
+ (track_ext_func): New function.
+ (check_funcs): Update logic for extension functions.
+ * ext.c (make_builtin): Call track_ext_func.
+
+2012-06-24 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * TODO.xgawk: Most of IOBUF has been hidden.
+ * gawkapi.h (IOBUF): Remove declaration (now back in awk.h).
+ (IOBUF_PUBLIC): Declare new structure defining subset of IOBUF fields
+ that should be exposed to extensions.
+ (gawk_api): Update register_open_hook argument from IOBUF to
+ IOBUF_PUBLIC.
+ * awk.h (IOBUF): Restore declaration with 5 fields moved to new
+ IOBUF_PUBLIC structure.
+ (register_open_hook): Update open_func argument from IOBUF to
+ IOBUF_PUBLIC.
+ * gawkapi.c (api_register_open_hook): Ditto.
+ * io.c (after_beginfile, nextfile, iop_close, gawk_pclose): Some fields
+ such as fd and name are now inside the IOBUF public structure.
+ (struct open_hook): Update open_func argument from IOBUF to
+ (register_open_hook): Ditto.
+ (find_open_hook): opaque now inside IOBUF_PUBLIC.
+ (iop_alloc): fd and name now in IOBUF_PUBLIC.
+ (get_a_record): If the get_record hook returns EOF, set the IOP_AT_EOF
+ flag. Access fd inside IOBUF_PUBLIC.
+ (get_read_timeout): File name now inside IOBUF_PUBLIC.
+ * interpret.h (r_interpret): File name now inside IOBUF_PUBLIC.
+ * ext.c (load_ext): No need to call return at the end of a void
+ function.
+
+2012-06-24 Arnold D. Robbins <arnold@skeeve.com>
+
+ * ext.c (load_ext): Don't retun a value from a void function.
+ * gawkapi.c (api_set_array_element): Set up vname and parent_array.
+
+2012-06-21 Arnold D. Robbins <arnold@skeeve.com>
+
+ More API and cleanup:
+
+ * awk.h (stopme): Make signature match other built-ins.
+ * awkgram.y (stopme): Make signature match other built-ins.
+ (regexp): Minor edit.
+ * gawkapi.c (api_set_argument): Remove unused variable.
+ Set parent_array field of array value.
+ * TODO.xgawk: Update some.
+
+ Remove extension() builtin.
+
+ * awk.h (do_ext): Removed.
+ (load_ext): Signature changed.
+ * awkgram.y (tokentab): Remove do_ext.
+ Change calls to do_ext.
+ * ext.c (load_ext): Make init function a constant.
+ * main.c (main): Change calls to do_ext.
+
+2012-06-20 Arnold D. Robbins <arnold@skeeve.com>
+
+ Restore lost debugging function:
+
+ * awkgram.y (stopme): Restore long lost debugging function.
+ * awk.h (stopme): Add declaration.
+
+ API work:
+
+ * ext.c (get_argument): Make extern.
+ * awk.h (get_argument): Declare it.
+ * gawkapi.c (api_set_argument): Call it. Finish off the logic.
+ (api_get_argument): Refine logic to use get_argument.
+ * gawkapi.h (set_argument): New API.
+
+2012-06-19 Arnold D. Robbins <arnold@skeeve.com>
+
+ Remove code duplication in gawkapi.c from msg.c:
+
+ * awk.h (err): Add `isfatal' first parameter.
+ * awkgram.y (err): Adjust all calls.
+ * msg.c (err): Adjust all calls. Move fatal code to here ...
+ (r_fatal): From here.
+ * gawkapi.c: Remove code duplication and adjust calls to `err'.
+
+ Handle deleting elements of flattened array:
+
+ * awk.h (get_argument): Remove declaration.
+ * ext.c (get_argument): Make static.
+ * gawkapi.h (awk_flat_array_t): Make opaque fields const. Add
+ more descriptive comments.
+ * gawkapi.c (release_flattened_array): Delete elements flagged
+ for deletion. Free the flattened array also.
+
+ Add additional debugging when developing:
+
+ * configure.ac: Add additional debugging flags.
+ * configure: Regenerated.
+
+2012-06-18 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkapi.h (get_array_element): Restore `wanted' paramater.
+ (awk_element_t): Use awk_value_t for index. Add awk_flat_array_t.
+ (flatten_array): Change signature to use awk_flat_array_t;
+ (release_flattened_array): Change signature to use awk_flat_array_t;
+ * gawkapi.c (api_sym_update): Handle case where variable exists already.
+ (api_get_array_element): Restore `wanted' paramater and pass it
+ on to node_to_awk_value.
+ (api_set_array_element): Revisse to match changed element type.
+ (api_flatten_array): Revise signature, implement.
+ (api_release_flattened_array): Revise signature, implement.
+
+2012-06-17 Arnold D. Robbins <arnold@skeeve.com>
+
+ API Work:
+
+ * gawkapi.h (get_array_element): Remove `wanted' parameter.
+ (r_make_string): Comment the need for `api' and `ext_id' parameters.
+ * gawkapi.c (api_sym_update): Move checks to front.
+ Initial code for handling arrays. Still needs work.
+ (api_get_array_element): Implemented.
+ (api_set_array_element): Additional checking code.
+ (api_del_array_element): Implemented.
+ (api_create_array): Implemented.
+ (init_ext_api): Force do_xxx values to be 1 or 0.
+ (update_ext_api): Ditto.
+
+2012-06-12 Arnold D. Robbins <arnold@skeeve.com>
+
+ API Work:
+
+ * gawkapi.h (awk_value_t): Restore union.
+ (get_curfunc_param): Renamed to get_argument. Return type changed
+ to awk_bool_t. Semantics better thought out and documented.
+ (awk_atexit, get_array_element): Return type now void.
+ (sym_lookup): Return type now void. Argument order rationalized.
+ * gawkapi.c (node_to_awk_value): Return type is now awk_bool_t.
+ Semantics now match table in gawkawpi.h.
+ (api_awk_atexit): Return type now void.
+ (api_sym_lookup): Return type is now awk_bool_t. Change parameter
+ order.
+ (api_get_array_element): Return type is now awk_bool_t.
+
+ Further API implementations and fixes for extension/testext.c:
+
+ * awk.h (final_exit): Add declaration.
+ * ext.c (load_ext): Change `func' to install_func.
+ * gawkapi.c: Add casts to void for id param in all functions.
+ (api_sym_update): Finish implementation.
+ (api_get_array_element): Start implementation.
+ (api_set_array_element): Add error checking.
+ (api_get_element_count): Add error checking, return the right value.
+ * main.c (main): Call final_exit instead of exit.
+ (arg_assign): Ditto.
+ * msg.c (final_exit): New routine to run the exit handlers and exit.
+ (gawk_exit): Call it.
+ * profile.c (dump_and_exit): Ditto.
+
+2012-06-10 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * TODO.xgawk: Addition of time extension moved to "done" section.
+
+2012-06-10 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawkapi.c (api_update_ERRNO_string): Treat boolean true as a request
+ for TRANSLATE, and false as DONT_TRANSLATE.
+
+2012-06-06 Arnold D. Robbins <arnold@skeeve.com>
+
+ * cint_array.c (tree_print, leaf_print): Add additional casts
+ for printf warnings.
+
+ * awk.h (update_ext_api): Add declaration.
+ * gawkapi.c (update_ext_api): New function.
+ * eval.c (set_LINT): Call update_ext_api() at the end.
+ * gawkapi.h: Document that do_XXX could change on the fly.
+
+ * awk.h (run_ext_exit_handlers): Add declaration.
+ * msg.c (gawk_exit): Call it.
+
+2012-06-05 Arnold D. Robbins <arnold@skeeve.com>
+
+ * ext.c (load_ext): Remove use of RTLD_GLOBAL. Not needed in new
+ scheme. Clean up error messages.
+
+2012-06-04 Arnold D. Robbins <arnold@skeeve.com>
+
+ * configure.ac: Remove use of -export-dynamic for GCC.
+ * configure: Regenerated.
+
+2012-05-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * main.c (is_off_limits_var): Minor coding style edit.
+ * gawkapi.c (awk_value_to_node): More cleanup.
+ (node_to_awk_value): Use `wanted' for decision making.
+ (api_sym_update): Start implementation. Needs more work.
+ General: More cleanup, comments.
+ * gawkapi.h (api_sym_update): Add additional comments.
+
+2012-05-29 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkapi.c (node_to_awk_value): Add third parameter indicating type
+ of value desired. Based on that, do force_string or force_number
+ to get the "other" type.
+ (awk_value_to_node): Clean up the code a bit.
+ (get_curfunc_param): Move forcing of values into node_to_awk_value.
+ (api_sym_lookup): Add third parameter indicating type of value wanted.
+ (api_get_array_element): Ditto.
+ * gawk_api.h: Additional comments and clarifications. Revise APIs
+ to take third 'wanted' argument as above.
+ (awk_value_t): No longer a union so that both values may be accessed.
+ All macros: Parenthesized the bodies.
+ * bootstrap.sh: Rationalize a bit.
+
+2012-05-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (include_HEADERS): Add so gawkapi.h will be installed.
+ (base_sources): Add gawkapi.h so that it is in dist tarball.
+ * TODO.xgawk: Update.
+ * main.c (is_off_limits_var): Stop returning true for everything
+ except PROCINFO.
+
+2012-05-25 Arnold D. Robbins <arnold@skeeve.com>
+
+ * main.c (is_off_limits_var): New function to check if a variable
+ is one that an extension function may not change.
+ * awk.h (is_off_limits_var): Declare it.
+ * gawkapi.c (api_sym_lookup): Use it.
+
+ * bootstrap.sh: Touch various files in the extension directory also.
+
+2012-05-24 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawkapi.h (awk_param_type_t): Remove (use awk_valtype_t instead).
+ (awk_ext_func_t): Pass a result argument, and return an awk_value_t *.
+ (gawk_api.get_curfunc_param): Add a result argument.
+ (gawk_api.set_return_value): Remove obsolete function.
+ (gawk_api.sym_lookup, gawk_api.get_array_element): Add a result
+ argument.
+ (gawk_api.api_make_string, gawk_api.api_make_number): Remove hooks,
+ since access to gawk internal state is not required to do this.
+ (set_return_value): Remove obsolete macro.
+ (get_curfunc_param, sym_lookup, get_array_element): Add result argument.
+ (r_make_string, make_number): New static inline functions.
+ (make_string, dup_string): Revise macro definitions.
+ (dl_load_func): Remove global_api_p and global_ext_id args,
+ and fix SEGV by setting api prior to checking its version members.
+ (GAWK): Expand ifdef to include more stuff.
+ * gawkapi.c (node_to_awk_value): Add result argument.
+ (api_get_curfunc_param): Add result argument, and use awk_valtype_t.
+ (api_set_return_value): Remove obsolete function.
+ (awk_value_to_node): New global function to convert back into internal
+ format.
+ (api_add_ext_func): Simply call make_builtin.
+ (node_to_awk_value): Add result argument, and handle Node_val case.
+ (api_sym_lookup, api_get_array_element): Add result argument.
+ (api_set_array_element): Implement.
+ (api_make_string, api_make_number): Remove functions that belong on
+ client side.
+ (api_impl): Remove 3 obsolete entries.
+ * TODO.xgawk: Update to reflect progress.
+ * Makefile.am (base_sources): Add gawkapi.c.
+ * awk.h: Include gawkapi.h earlier.
+ (api_impl, init_ext_api, awk_value_to_node): Add declarations
+ so we can hook in new API.
+ (INSTRUCTION): Add new union type efptr for external functions.
+ (extfunc): New define for d.efptr.
+ (load_ext): Remove 3rd obj argument that was never used for anything.
+ (make_builtin): Change signature for new API.
+ * awkgram.y (load_library): Change 2nd argument to load_ext
+ from dlload to dl_load, and remove pointless 3rd argument.
+ * main.c (main): Call init_ext_api() before loading shared libraries.
+ Change 2nd argument to load_ext from dlload to dl_load, and remove
+ pointless 3rd argument.
+ * ext.c (do_ext): Remove pointless 3rd argument to load_ext.
+ (load_ext): Remove 3rd argument. Port to new API (change initialization
+ function signature). If initialization function fails, issue a warning
+ and return -1, else return 0.
+ (make_builtin): Port to new API.
+ * interpret.h (r_interpret): For Op_ext_builtin, call external functions
+ with an awk_value_t result buffer, and convert the returned value
+ to a NODE *. For Node_ext_func, code now in extfunc instead of builtin.
+
+2012-05-21 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * configure.ac: Remove libtool, and call configure in the
+ extension subdirectory. Change pkgextensiondir to remove the
+ version number, since the new API has builtin version checks.
+ * TODO.xgawk: Update.
+ * ltmain.sh: Removed, since libtool no longer used here.
+
+2012-05-19 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * TODO.xgawk: Update to reflect progress and new issues.
+ * main.c (main): Add -i (--include) option.
+ (usage): Ditto.
+ * awkgram.y (add_srcfile): Eliminate duplicates only for SRC_INC
+ and SRC_EXTLIB sources (i.e. -f duplicates should not be removed).
+ * io.c (find_source): Set DEFAULT_FILETYPE to ".awk" if not defined
+ elsewhere.
+
+2012-05-15 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h: Include "gawkapi.h" to get IOBUF.
+ * gawkapi.h: Considerable updates.
+ * gawkapi.c: New file. Start at implementing the APIs.
+
+2012-05-13 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * TODO.xgawk: Update to reflect recent discussions and deletion of
+ extension/xreadlink.[ch].
+
+2012-05-11 Arnold D. Robbins <arnold@skeeve.com>
+
+ Sweeping change: Use `bool', `true', and `false' everywhere.
+
+2012-04-09 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * eval.c (unset_ERRNO): Fix memory management bug -- need to use
+ dupnode with Nnull_string.
+
+2012-04-08 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (valgrind): Define VALGRIND instead of redefining AWK.
+ This allows test/Makefile.am to set up the command environment as
+ desired.
+ (valgrind-noleak): Ditto, plus set --leak-check=no instead of the
+ default summary setting.
+
+2012-04-07 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * TODO.xgawk: Update to reflect progress.
+
+2012-04-01 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * TODO.xgawk: Move valgrind-noleak item into "done" section.
+ * Makefile.am (valgrind-noleak): Add new valgrind rule that omits
+ the "--leak-check=full" option to help spot more serious problems.
+
+2012-04-01 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * TODO.xgawk: Move ERRNO item into "done" section.
+ * awk.h (update_ERRNO, update_ERRNO_saved): Remove declarations.
+ (update_ERRNO_int, enum errno_translate, update_ERRNO_string,
+ unset_ERRNO): Add new declarations.
+ * eval.c (update_ERRNO_saved): Renamed to update_ERRNO_int.
+ (update_ERRNO_string, unset_ERRNO): New functions.
+ * ext.c (do_ext): Use new update_ERRNO_string function.
+ * io.c (ERRNO_node): Remove redundant extern declaration (in awk.h).
+ (after_beginfile, nextfile): Replace update_ERRNO() with
+ update_ERRNO_int(errno).
+ (inrec): Replace update_ERRNO_saved with update_ERRNO_int.
+ (do_close): Use new function update_ERRNO_string.
+ (close_redir, do_getline_redir, do_getline): Replace update_ERRNO_saved
+ with update_ERRNO_int.
+
+2012-03-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * TODO.xgawk: Update to reflect debate about how to support Cygwin
+ and other platforms that cannot link shared libraries with unresolved
+ references.
+ * awkgram.y (add_srcfile): Minor bug fix: reverse sense of test
+ added by Arnold in last patch.
+ * configure.ac: AC_DISABLE_STATIC must come before AC_PROG_LIBTOOL.
+
+2012-03-26 Arnold D. Robbins <arnold@skeeve.com>
+
+ Some cleanups.
+
+ * awkgram.y (add_srcfile): Use whole messages, better for
+ translations.
+ * io.c (init_awkpath): Small style tweak.
+ * main.c (path_environ): Straighten out initial comment, fix
+ compiler warning by making `val' const char *.
+
+2012-03-25 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * configure.ac (AC_DISABLE_STATIC): Add this to avoid building useless
+ static extension libraries.
+
+2012-03-25 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * TODO.xgawk: New file listing completed and pending xgawk enhancements.
+
+2012-03-24 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * io.c (path_info): Fix white space.
+ (pi_awkpath, pi_awklibpath): Avoid structure initializers.
+ (do_find_source): Eliminate pointless parentheses.
+ (find_source): Leave a space after "&".
+ * main.c (load_environ): Fix typo in comment.
+
+2012-03-21 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * awkgram.y (LEX_LOAD): New token to support @load.
+ (grammar): Add rules to support @load.
+ (tokentab): Add "load".
+ (add_srcfile): Improve error message to distinguish between source files
+ and shared libraries.
+ (load_library): New function to load libraries specified with @load.
+ (yylex): Add support for LEX_LOAD (treated the same way as LEX_INCLUDE).
+
+2012-03-20 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (EXTRA_DIST): Remove extension.
+ (SUBDIRS): Add extension so libraries will be built.
+ (DEFS): Define DEFLIBPATH and SHLIBEXT so we can find shared libraries.
+ * awk.h (deflibpath): New extern declaration.
+ * configure.ac: Add support for building shared libraries by adding
+ AC_PROG_LIBTOOL and AC_SUBST for acl_shlibext and pkgextensiondir.
+ (AC_CONFIG_FILES): Add extension/Makefile.
+ * io.c (pi_awkpath, pi_awklibpath): New static structures to contain
+ path information.
+ (awkpath, max_pathlen): Remove static variables now inside pi_awkpath.
+ (init_awkpath): Operate on path_info structure to support both
+ AWKPATH and AWKLIBPATH. No need for max_path to be static, since
+ this should be called only once for each environment variable.
+ (do_find_source): Add a path_info arg to specify which path to search.
+ Check the try_cwd parameter to decide whether to search the current
+ directory (not desirable for AWKLIBPATH).
+ (find_source): Choose appropriate path_info structure based on value
+ of the is_extlib argument. Set EXTLIB_SUFFIX using SHLIBEXT define
+ instead of hardcoding ".so".
+ * main.c (path_environ): New function to add AWKPATH or AWKLIBPATH
+ to the ENVIRON array.
+ (load_environ): Call path_environ for AWKPATH and AWKLIBPATH.
+
2012-06-19 Arnold D. Robbins <arnold@skeeve.com>
* main.c (main): Do setlocale to "C" if --characters-as-bytes.
@@ -88,6 +1051,113 @@
* debug.c: Ditto.
* command.y: Ditto. Some minor whitespace and comments cleanup.
+2012-04-24 Arnold D. Robbins <arnold@skeeve.com>
+
+ io.c cleanup and some speedup for RS as regexp parsing.
+
+ * awk.h (Regexp): New members has_meta and maybe_long.
+ (enum redirval): Add redirect_none as value 0.
+ (remaybelong): Remove function declaration.
+ * awkgram.y: Use redirect_none instead of 0 for no redirect cases.
+ * io.c (go_getline_redir): Second arg now of type enum redirval.
+ Changed intovar into into_variable.
+ (comments and whitespace): Lots of general cleanup.
+ (socket_open): readle changed to read_len.
+ (two_way_open): Add additional calls to os_close_on_exec.
+ (rsrescan): Simplify code a bit and use RS->maybe_long.
+ * re.c (make_regexp): Set up new members in Regexp struct.
+ (remaybelong): Remove function.
+ (reisstring): Simplified code.
+
+2012-04-16 Eli Zaretskii <eliz@gnu.org>
+
+ * io.c (read_with_timeout) [__MINGW32__]: Just call the blocking
+ 'read', as 'select' is only available for sockets.
+ * mpfr.c (set_ROUNDMODE) [!HAVE_MPFR]: Renamed from set_RNDMODE.
+ * main.c (load_procinfo): Declare name[] also when HAVE_MPFR is
+ defined even though HAVE_GETGROUPS etc. are not.
+
+2012-04-12 John Haque <j.eh@mchsi.com>
+
+ * array.c, awk.h, awkgram.y, builtin.c, command.y, debug.c,
+ field.c, mpfr.c, profile.c: Change RND_MODE to ROUND_MODE.
+
+2012-04-11 John Haque <j.eh@mchsi.com>
+
+ * main.c (varinit): Change RNDMODE to ROUNDMODE.
+
+2012-04-11 Arnold D. Robbins <arnold@skeeve.com>
+
+ * main.c: Change --arbitrary-precision to --bignum.
+
+2012-04-02 John Haque <j.eh@mchsi.com>
+
+ Add support for arbitrary-precision arithmetic.
+
+ * mpfr.c: New file.
+ * awk.h (struct exp_node): Add union to handle different number types.
+ (MPFN, MPZN): New flag values.
+ (DO_MPFR, do_mpfr): New defines.
+ (PREC_node, RNDMODE_node): Add declarations.
+ (PRECISION, RND_MODE, MNR, MFNR, mpzval, do_ieee_fmt): Add declarations.
+ (make_number, str2number, format_val, cmp_numbers): Ditto.
+ (force_number): Change definition.
+ (Func_pre_exec, Func_post_exec): New typedefs.
+ (POP_NUMBER, TOP_NUMBER): Change definitions.
+ (get_number_ui, get_number_si, get_number_d, get_number_uj,
+ iszero, IEEE_FMT, mpg_float, mpg_integer, mpg_float,
+ mpg_integer): New defines.
+ * awkgram.y (tokentab): Add alternate function entries for MPFR/GMP.
+ (snode): Choose the appropriate function.
+ (negate_num): New function to negate a number.
+ (grammar): Use it.
+ (yylex): Adjust number handling code.
+ * array.c (value_info, asort_actual, sort_user_func): Adjust for
+ MPFR/GMP numbers.
+ (do_adump, indent): Minor changes.
+ (sort_up_index_number, sort_up_value_number, sort_up_value_type): Use
+ cmp_numbers() for numeric comparisons.
+ * builtin.c (mpz2mpfr): New function.
+ (format_tree): Adjust to handle MPFR and GMP numbers.
+ * eval.c (register_exec_hook): New function to manage interpreter hooks.
+ (num_exec_hook, pre_execute, post_execute): New and adjusted definitions.
+ (h_interpret): Renamed from debug_interpret.
+ (init_interpret): Changed to use the new name.
+ (flags2str): New entries for MPFN and MPZN.
+ (cmp_nodes): Reworked to use seperate routine for numeric comparisons.
+ (set_IGNORECASE, set_BINMODE, set_LINT, update_NR, update_FNR,
+ update_NF): Adjust code and some cleanup.
+ * field.c (rebuild_record): Field copying code reworked to handle
+ MPFR/GMP numbers.
+ (set_NF): Minor adjustment.
+ * io.c (INCREMENT_REC): New macro.
+ (inrec, do_getline): Use the new macro.
+ (nextfile, set_NR, set_FNR, get_read_timeout, pty_vs_pipe): Adjust code
+ to handle MPFR/GMP numbers.
+ * interpret.h (r_interpret): Adjust TOP_NUMBER/POP_NUMBER usage.
+ (EXEC_HOOK): New macro and definition.
+ (DEBUGGING): Removed.
+ * main.c (DEFAULT_PREC, DEFAULT_RNDMODE): New defines.
+ (opttab): New entry for option arbitrary-precision.
+ (main): Handle the new option.
+ (usage): Add to usage message.
+ (varinit): Add PREC and RNDMODE.
+ (load_procinfo): Install MPFR and GMP related items.
+ (version): Append MPFR and GMP versions to message.
+ * msg.c (err) : Adjust FNR handling with MPFR/GMP.
+ * node.c (r_format_val): Renamed from format_val.
+ (r_force_number): Return NODE * instead of AWKNUM.
+ (make_number, str2number, format_val, cmp_numpers: Defined and initialized.
+ (r_unref): Free MPFR/MPZ numbers.
+ (get_numbase): Renamed from isnondecimal and return the base.
+ (cmp_awknums): New function to compare two AWKNUMs.
+ * command.y (yylex): Adjust number handling code.
+ (grammar): Minor adjustments to handle negative numbers.
+ * debug.c (init_debug): New function.
+ (do_info, do_set_var, watchpoint_triggered, serialize,
+ initialize_watch_item, do_watch, print_watch_item): Minor adjustments.
+ (debug_pre_execute): Adjusted to handle MPFR and GMP numbers.
+
2012-04-09 Arnold D. Robbins <arnold@skeeve.com>
* INSTALL, config.guess, config.sub, depcomp, install-sh,
@@ -205,12 +1275,92 @@
* dfa.c: Sync with GNU grep.
+2012-01-02 Arnold D. Robbins <arnold@skeeve.com>
+
+ * io.c (Read_can_timeout, Read_timeout, Read_default_timeout):
+ Renamed to use lower case.
+ Other minor stylistic edits.
+
+2012-01-01 John Haque <j.eh@mchsi.com>
+
+ * awk.h (struct iobuf): New entry read_func.
+ * io.c (Read_can_timeout, Read_timeout, Read_default_timeout):
+ New variables.
+ (init_io): New routine to initialize the variables.
+ (in_PROCINFO): New "clever" routine to parse elements with indices
+ seperated by a SUPSEP.
+ (get_read_timeout): New routine to read timeout value for an IOBUF.
+ (read_with_timeout): New routine to read from a fd with a timeout.
+ (pty_vs_pipe): Use in_PROCINFO().
+ (get_a_record): Set the timeout value and the read routine as necessary.
+ * main.c (main): Call init_io().
+
+2011-12-31 Arnold D. Robbins <arnold@skeeve.com>
+
+ * profile_p.c: Remove the file.
+ * msg.c (err): Remove check for name being dgawk.
+
2011-12-31 Arnold D. Robbins <arnold@skeeve.com>
* awk.h [STREQ, STREQN]: Remove macros.
* awkgram.y, builtin.c, command.y, debug.c, eval.c,
io.c, msg.c: Change all uses to call strcmp, strncmp.
+2011-12-28 Arnold D. Robbins <arnold@skeeve.com>
+
+ * int_array.c, str_array.c: Fix some compiler warnings 32/64
+ bit system differences.
+
+2011-12-26 John Haque <j.eh@mchsi.com>
+
+ Merge gawk, pgawk and dgawk into a single executable gawk.
+
+ * awk.h (DO_PRETTY_PRINT, DO_PROFILE, DO_DEBUG,
+ do_pretty_print, do_debug): New defines.
+ (interpret): New variable, a pointer to an interpreter routine.
+ (enum exe_mode): Nuked.
+ * main.c (opttab): New options --pretty-print and --debug;
+ Remove option --command.
+ (usage): Update usage messages.
+ * interpret.h: New file.
+ * eval.c (r_interpret): Move to the new file.
+ (debug_interpret): New interpreter routine when debugging.
+ (init_interpret): New routine to initialize interpreter related
+ variables.
+ * eval_d.c, eval_p.c: Delete files.
+ * debug.c (interpret): Renamed to debug_prog.
+ (DEFAULT_PROMPT, DEFAULT_HISTFILE, DEFAULT_OPTFILE): Remove prefix 'd'.
+ * profile.c (init_profiling): Nuked.
+ * Makefile.am: Adjusted.
+
+ Add command line option --load for loading extensions.
+
+ * awk.h (srctype): Add new source type SRC_EXTLIB.
+ * ext.c(load_ext): New routine to load extension.
+ (do_ext): Adjust to use load_ext().
+ * main.c (opttab): Add new option --load.
+ (main): Call load_ext() to load extensions.
+ (usage): Add usage message for the new option.
+ * io.c (get_cwd): New routine.
+ (do_find_source): Use the new routine.
+ (find_source): Handle new type SRC_EXTLIB.
+ * awkgram.y (parse_program, next_sourcefile): Skip type SRC_EXTLIB.
+ (add_srcfile): Adjust call to find_source.
+ * debug.c (source_find): Same.
+
+ Unrelated:
+
+ * ext.c (get_argument): Fixed argument parsing.
+ * array.c (null_array_func): Reworked array routines for an empty array.
+ * str_array.c, int_array.c: Make GCC happy, use %u instead of %lu
+ printf formats.
+ * eval.c (node_Boolean): New array for TRUE and FALSE nodes.
+ (init_interpret): Create the new nodes.
+ (eval_condition): Add test for the new nodes.
+ (setup_frame): Disable tail-recursion optimization when profiling.
+ * interpret.h (r_interpret): Use the boolean nodes instead of making
+ new ones when needed.
+
2011-12-26 Arnold D. Robbins <arnold@skeeve.com>
Finish Rational Range Interpretation (!)
@@ -270,6 +1420,14 @@
2011-10-25 Arnold D. Robbins <arnold@skeeve.com>
+ Merge with gawk_performance branch done. Additionally:
+
+ * cint_array.c, int_array.c, str_array.c: Fix compiler complaints
+ about printf formats (signed / unsigned vs. %d / %u).
+ * eval.c (setup_frame): Add a missing return value.
+
+2011-10-25 Arnold D. Robbins <arnold@skeeve.com>
+
* Makefile.am (dist-hook): Use `cd $(srcdir)/pc' so that
`make distcheck' works completely.
* builtin.c (do_strftime): Add cast to long int in check
@@ -341,10 +1499,25 @@
(remap_std_file): Per Eli's suggestion, removed the leading close
of oldfd and will let dup2 do the close for us.
+2011-10-11 John Haque <j.eh@mchsi.com>
+
+ * symbol.c: Add licence notice.
+ * array.c (PREC_NUM, PREC_STR): Define as macros.
+
2011-10-09 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c: Sync with GNU grep.
+2011-10-07 John Haque <j.eh@mchsi.com>
+
+ Tail recursion optimization.
+ * awkgram.y (grammar, mk_function): Recognize tail-recursive
+ calls.
+ * awk.h (tail_call, num_tail_calls): New defines.
+ * eval.c (setup_frame): Reuse function call stack for
+ tail-recursive calls.
+ (dump_fcall_stack): Reworked.
+
2011-10-04 Arnold D. Robbins <arnold@skeeve.com>
* awk.h, main.c (gawk_mb_cur_max): Make it a constant 1 when
@@ -381,10 +1554,113 @@
* dfa.c: Sync with GNU grep.
+2011-09-08 John Haque <j.eh@mchsi.com>
+
+ Optimization for compound assignment, increment and
+ decrement operators; Avoid unref and make_number calls
+ when there is no extra references to the value NODE.
+
2011-09-03 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c: Sync with GNU grep.
+2011-08-31 John Haque <j.eh@mchsi.com>
+
+ Grammar related changes: Simplify grammar for user-defined
+ functions and general cleanups.
+
+ * symbol.c: New file.
+ * awkgram.y: Move symbol table related routines to the
+ new file.
+ (rule, func_name, function_prologue, param_list): Reworked.
+ (install_function, check_params): Do all error checkings
+ for the function name and parameters before installing in
+ the symbol table.
+ (mk_function): Finalize function definition.
+ (func_install, append_param, dup_params): Nuked.
+ * symbol.c (make_params): allocate function parameter nodes
+ for the symbol table. Use the hash node as Node_param_list;
+ Saves a NODE for each parameter.
+ (install_params): Install function parameters into the symbol
+ table.
+ (remove_params): Remove parameters out of the symbol table.
+ * awk.h (parmlist, FUNC): Nuked.
+ (fparms): New define.
+
+
+ Dynamically loaded function parameters are now handled like
+ those for a builtin.
+
+ * awk.h (Node_ext_func, Op_ext_builtin): New types.
+ (Op_ext_func): Nuked.
+ * ext.c (make_builtin): Simplified.
+ (get_curfunc_arg_count): Nuked; Use the argument 'nargs' of
+ the extension function instead.
+ (get_argument, get_actual_argument): Adjust.
+ * eval.c (r_interpret): Update case Op_func_call for a dynamic
+ extension function. Handle the new opcode Op_ext_builtin.
+ * pprint (profile.c): Adjust.
+
+
+ Use a single variable to process gawk options.
+
+ * awk.h (do_flags): New variable.
+ (DO_LINT_INVALID, DO_LINT_ALL, DO_LINT_OLD, DO_TRADITIONAL,
+ DO_POSIX, DO_INTL, DO_NON_DEC_DATA, DO_INTERVALS,
+ DO_PROFILING, DO_DUMP_VARS, DO_TIDY_MEM,
+ DO_SANDBOX): New defines.
+ (do_traditional, do_posix, do_intervals, do_intl,
+ do_non_decimal_data, do_profiling, do_dump_vars,
+ do_tidy_mem, do_sandbox, do_lint,
+ do_lint_old): Defined as macros.
+ * main.c: Remove definitions of the do_XX variables. Add
+ do_flags definition.
+ * debug.c (execute_code, do_eval, parse_condition): Save
+ do_flags before executing/parsing and restore afterwards.
+
+
+ Nuke PERM flag. Always increment/decrement the reference
+ count for a Node_val. Simplifies macros and avoids
+ occassional memory leaks, specially in the debugger.
+
+ * awk.h (UPREF, DEREF, dupnode, unref): Simplified.
+ (mk_number): Nuked.
+ * (*.c): Increment the reference count of Nnull_string before
+ assigning as a value.
+
+
+ Revamped array handling mechanism for more speed and
+ less memory consumption.
+
+ * awk.h (union bucket_item, BUCKET): New definitions. Used as
+ bucket elements for the hash table implementations of arrays;
+ 40% space saving in 32 bit x86.
+ (buckets, nodes, array_funcs, array_base, array_capacity,
+ xarray, alookup, aexists, aclear, aremove, alist,
+ acopy, adump, NUM_AFUNCS): New defines.
+ (array_empty): New macro to test for an empty array.
+ (assoc_lookup, in_array): Defined as macros.
+ (enum assoc_list_flags): New declaration.
+ (Node_ahash, NUMIND): Nuked.
+ * eval.c (r_interpret): Adjust cases Op_subscript,
+ Op_subscript_lhs, Op_store_var and Op_arrayfor_incr.
+ * node.c (dupnode, unref): Removed code related to Node_ahash.
+ * str_array.c: New file to handle array with string indices.
+ * int_array.c: New file to handle array with integer indices.
+ * cint_array.c: New file. Special handling of arrays with
+ (mostly) consecutive integer indices.
+
+
+ Memory pool management reworked to handle NODE and BUCKET.
+
+ * awk.h (struct block_item, BLOCK, block_id): New definitions.
+ (getblock, freeblock): New macros.
+ (getbucket, freebucket): New macros to allocate and deallocate
+ a BUCKET.
+ (getnode, freenode): Adjusted.
+ * node.c (more_nodes): Nuked.
+ (more_blocks): New routine to allocate blocks of memory.
+
2011-08-24 Arnold D. Robbins <arnold@skeeve.com>
Fix pty co-process communication on Ubuntu GNU/Linux.
@@ -517,6 +1793,19 @@
* pprint (profile.c): Add case for the new opcode.
* print_instruction (debug.c): Ditto.
+ Take out translation for errno strings; extensions will
+ need to use their own domain.
+
+ * awk.h (enum errno_translate): Removed.
+ (update_ERRNO_string): Remove second translate paramater.
+ * eval.c (update_ERRNO_string): Remove second translate paramater
+ and code that used it.
+ * gawkapi.h (api_update_ERRNO_string): Remove third translate
+ parameter.
+ * gawkapi.c (api_update_ERRNO_string): Remove third translate
+ paramater and change call to update_ERRNO_string.
+ * io.c (do_close): Fix call to update_ERRNO_string.
+
2011-07-15 Arnold D. Robbins <arnold@skeeve.com>
* awk.h: Typo fix: "loner" --> longer. Thanks to Nelson Beebe.
diff --git a/FUTURES b/FUTURES
index 89c3ce64..861cf503 100644
--- a/FUTURES
+++ b/FUTURES
@@ -1,4 +1,4 @@
- Copyright (C) 2005, 2006, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006, 2010, 2011, 2012 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
@@ -11,36 +11,53 @@ don't bug us too much about schedules or what all this really means.
For 4.1
=======
- Merge gawk/pgawk/dgawk into one executable
+ DONE: Merge gawk/pgawk/dgawk into one executable
- Consider removing use of and/or need for the protos.h file.
+ DONE: Merge xmlgawk -l feature
- Consider moving var_value info into Node_var itself
- to reduce memory usage.
+ DONE: Merge xmlgawk XML extensions (via source forge project that
+ works with new API)
- Merge xmlgawk -l feature
+ DONE: Integrate MPFR to provide high precision arithmetic.
- Merge xmlgawk XML extensions
+ DONE: Implement designed API for loadable modules
- Integrate MPFR to provide high precision arithmetic.
+ DONE: Redo the loadable modules interface from the awk level.
+
+ DONE: Consider really implementing BWK awk SYMTAB for seeing what
+ global variables are defined.
Continue code reviews / code cleanup
+ - Nuking overly deep macros...
- Consider making gawk output +nan for NaN values so that it
- will accept its own output as input.
+ Consider making shadowed variables a warning and not
+ a fatal warning when -lint=fatal
For 4.2
=======
- Implement designed API for loadable modules
+ Think about how to generalize indirect access. Manuel Collado
+ suggests things like
+
+ foo = 5
+ @"foo" += 4
+
+ Also needed:
- Redo the loadable modules interface from the awk level.
+ indirect calls of built-ins
+ indirect calls of extension functions
+ indirect through array elements, not just scalar variables
+
+ Consider relaxing the strictness of --posix.
+
+ Consider removing use of and/or need for the protos.h file.
+
+ Consider moving var_value info into Node_var itself
+ to reduce memory usage.
Rework management of array index storage. (Partially DONE.)
DBM storage of awk arrays. Try to allow multiple dbm packages.
- ? Move the loadable modules interface to libtool.
-
? Add an optional base to strtonum, allowing 2-36.
? Optional third argument for index indicating where to start the
@@ -48,14 +65,12 @@ For 4.2
?? A RECLEN variable for fixed-length record input. PROCINFO["RS"]
would be "RS" or "RECLEN" depending upon what's in use.
+ *** Could be done as an extension.
?? Use a new or improved dfa and/or regex library.
??? Gnulib
- Consider really implementing BWK awk SYMTAB for seeing what
- global variables are defined.
-
Probably never:
===============
Do an optimization pass over parse tree?
@@ -68,3 +83,13 @@ Probably never:
Add a lint check if the return value of a function is used but
the function did not supply a value.
+
+ Consider making gawk output +nan for NaN values so that it
+ will accept its own output as input.
+ NOTE: Investigated this. GLIBC formats NaN as '-nan'
+ and -NaN as 'nan'. Dealing with this is not simple.
+
+ Enhance FIELDWIDTHS with some way to indicate "the rest of the record".
+ E.g., a length of 0 or -1 or something. May be "n"?
+
+ Make FIELDWIDTHS be an array?
diff --git a/Makefile.am b/Makefile.am
index aeff42f5..b73f532f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -48,7 +48,6 @@ EXTRA_DIST = \
config.rpath \
config.sub \
depcomp \
- extension \
m4 \
missing \
missing_d \
@@ -76,35 +75,48 @@ SUBDIRS = \
awklib \
doc \
po \
+ extension \
test
# what to make and install
-bin_PROGRAMS = gawk pgawk dgawk
+bin_PROGRAMS = gawk
+include_HEADERS = gawkapi.h
-# sources for both gawk and pgawk
+# sources for both gawk and dgawk
base_sources = \
array.c \
awk.h \
awkgram.y \
builtin.c \
+ cint_array.c \
+ cmd.h \
+ command.y \
custom.h \
+ debug.c \
dfa.c \
dfa.h \
+ eval.c \
ext.c \
field.c \
floatcomp.c \
floatmagic.h \
+ gawkapi.c \
+ gawkapi.h \
gawkmisc.c \
getopt.c \
getopt.h \
getopt1.c \
getopt_int.h \
gettext.h \
+ int_array.c \
+ interpret.h \
io.c \
mbsupport.h \
main.c \
+ mpfr.c \
msg.c \
node.c \
+ profile.c \
protos.h \
random.c \
random.h \
@@ -112,16 +124,15 @@ base_sources = \
regex.c \
regex.h \
replace.c \
+ str_array.c \
+ symbol.c \
version.c \
xalloc.h
-gawk_SOURCES = $(base_sources) eval.c profile.c
-pgawk_SOURCES = $(base_sources) eval_p.c profile_p.c
-dgawk_SOURCES = $(base_sources) eval_d.c profile.c cmd.h command.y debug.c
+gawk_SOURCES = $(base_sources)
# Get extra libs as needed, Automake will supply LIBINTL and SOCKET_LIBS.
-LDADD = $(LIBSIGSEGV) $(LIBINTL) $(SOCKET_LIBS)
-dgawk_LDADD = $(LDADD) @LIBREADLINE@
+LDADD = $(LIBSIGSEGV) $(LIBINTL) $(SOCKET_LIBS) @LIBREADLINE@ @LIBMPFR@
# Directory for gawk's data files. Automake supplies datadir.
pkgdatadir = $(datadir)/awk
@@ -129,7 +140,11 @@ pkgdatadir = $(datadir)/awk
# stuff for compiling gawk/pgawk
DEFPATH='".$(PATH_SEPARATOR)$(pkgdatadir)"'
-DEFS= -DDEFPATH=$(DEFPATH) -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"$(datadir)/locale"'
+# shared library support:
+SHLIBEXT = "\"$(GAWKLIBEXT)"\"
+DEFLIBPATH="\"$(pkgextensiondir)\""
+
+DEFS= -DDEFPATH=$(DEFPATH) -DDEFLIBPATH=$(DEFLIBPATH) -DSHLIBEXT=$(SHLIBEXT) -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"$(datadir)/locale"'
# Get rid of core files when cleaning
CLEANFILES = core core.*
@@ -140,7 +155,6 @@ MAINTAINERCLEANFILES = version.c
LN= ln
# First, add a link from gawk to gawk-X.Y.Z.
-# Same for pgawk.
#
# For GNU systems where gawk is awk, add a link to awk.
# (This is done universally, which may not always be right, but
@@ -148,7 +162,6 @@ LN= ln
install-exec-hook:
(cd $(DESTDIR)$(bindir); \
$(LN) gawk$(EXEEXT) gawk-$(VERSION)$(EXEEXT) 2>/dev/null ; \
- $(LN) pgawk$(EXEEXT) pgawk-$(VERSION)$(EXEEXT) 2>/dev/null ; \
if [ ! -f awk ]; \
then $(LN_S) gawk$(EXEEXT) awk; \
fi; exit 0)
@@ -157,12 +170,12 @@ install-exec-hook:
uninstall-links:
(cd $(DESTDIR)$(bindir); \
if [ -f awk ] && cmp awk gawk$(EXEEXT) > /dev/null; then rm -f awk; fi ; \
- rm -f gawk-$(VERSION)$(EXEEXT) pgawk-$(VERSION)$(EXEEXT); exit 0)
+ rm -f gawk-$(VERSION)$(EXEEXT); exit 0)
uninstall-recursive: uninstall-links
# force there to be a gawk executable before running tests
-check-local: gawk$(EXEEXT) pgawk$(EXEEXT)
+check-local: gawk$(EXEEXT)
# A little extra clean up when making distributions.
# And additional set up for the pc directory.
@@ -177,6 +190,7 @@ dist-hook:
# Special rules for individual files
# Use of awk instead of $(AWK) is deliberate, in case gawk doesn't build
# or work correctly.
+
awkgram.c: awkgram.y
$(YACC) $(AM_YFLAGS) $(YFLAGS) $<
sed 's/parse error/syntax error/g' < y.tab.c | awk -f $(srcdir)/bisonfix.awk awkgram > $*.c && rm y.tab.c
@@ -200,5 +214,10 @@ diffout valgrind-scan:
valgrind:
cd test; rm -f log.[0-9]*; \
- make check AWK="valgrind --leak-check=full --log-file=log.%p ../gawk"; \
+ make check VALGRIND="valgrind --leak-check=full --log-file=log.%p"; \
+ make valgrind-scan
+
+valgrind-noleak:
+ cd test; rm -f log.[0-9]*; \
+ make check VALGRIND="valgrind --leak-check=no --log-file=log.%p"; \
make valgrind-scan
diff --git a/Makefile.in b/Makefile.in
index 3b41f9a3..f58c58e1 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -37,6 +37,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
+
VPATH = @srcdir@
am__make_dryrun = \
{ \
@@ -72,14 +73,14 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-bin_PROGRAMS = gawk$(EXEEXT) pgawk$(EXEEXT) dgawk$(EXEEXT)
+bin_PROGRAMS = gawk$(EXEEXT)
subdir = .
-DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
- $(srcdir)/Makefile.in $(srcdir)/configh.in \
- $(top_srcdir)/configure ABOUT-NLS AUTHORS COPYING ChangeLog \
- INSTALL NEWS TODO awkgram.c command.c config.guess \
- config.rpath config.sub depcomp install-sh missing \
- mkinstalldirs ylwrap
+DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \
+ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/configh.in $(top_srcdir)/configure ABOUT-NLS AUTHORS \
+ COPYING ChangeLog INSTALL NEWS TODO awkgram.c command.c \
+ config.guess config.rpath config.sub depcomp install-sh \
+ missing mkinstalldirs ylwrap
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
$(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gettext.m4 \
@@ -87,11 +88,11 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
$(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lcmessage.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \
- $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/nls.m4 \
- $(top_srcdir)/m4/noreturn.m4 $(top_srcdir)/m4/po.m4 \
- $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/readline.m4 \
- $(top_srcdir)/m4/socket.m4 $(top_srcdir)/m4/ulonglong.m4 \
- $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/mpfr.m4 \
+ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/noreturn.m4 \
+ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+ $(top_srcdir)/m4/readline.m4 $(top_srcdir)/m4/socket.m4 \
+ $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@@ -100,32 +101,23 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
-am__installdirs = "$(DESTDIR)$(bindir)"
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(includedir)"
PROGRAMS = $(bin_PROGRAMS)
am__objects_1 = array.$(OBJEXT) awkgram.$(OBJEXT) builtin.$(OBJEXT) \
- dfa.$(OBJEXT) ext.$(OBJEXT) field.$(OBJEXT) \
- floatcomp.$(OBJEXT) gawkmisc.$(OBJEXT) getopt.$(OBJEXT) \
- getopt1.$(OBJEXT) io.$(OBJEXT) main.$(OBJEXT) msg.$(OBJEXT) \
- node.$(OBJEXT) random.$(OBJEXT) re.$(OBJEXT) regex.$(OBJEXT) \
- replace.$(OBJEXT) version.$(OBJEXT)
-am_dgawk_OBJECTS = $(am__objects_1) eval_d.$(OBJEXT) profile.$(OBJEXT) \
- command.$(OBJEXT) debug.$(OBJEXT)
-dgawk_OBJECTS = $(am_dgawk_OBJECTS)
-am__DEPENDENCIES_1 =
-am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
-dgawk_DEPENDENCIES = $(am__DEPENDENCIES_2)
-am_gawk_OBJECTS = $(am__objects_1) eval.$(OBJEXT) profile.$(OBJEXT)
+ cint_array.$(OBJEXT) command.$(OBJEXT) debug.$(OBJEXT) \
+ dfa.$(OBJEXT) eval.$(OBJEXT) ext.$(OBJEXT) field.$(OBJEXT) \
+ floatcomp.$(OBJEXT) gawkapi.$(OBJEXT) gawkmisc.$(OBJEXT) \
+ getopt.$(OBJEXT) getopt1.$(OBJEXT) int_array.$(OBJEXT) \
+ io.$(OBJEXT) main.$(OBJEXT) mpfr.$(OBJEXT) msg.$(OBJEXT) \
+ node.$(OBJEXT) profile.$(OBJEXT) random.$(OBJEXT) re.$(OBJEXT) \
+ regex.$(OBJEXT) replace.$(OBJEXT) str_array.$(OBJEXT) \
+ symbol.$(OBJEXT) version.$(OBJEXT)
+am_gawk_OBJECTS = $(am__objects_1)
gawk_OBJECTS = $(am_gawk_OBJECTS)
gawk_LDADD = $(LDADD)
+am__DEPENDENCIES_1 =
gawk_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
-am_pgawk_OBJECTS = $(am__objects_1) eval_p.$(OBJEXT) \
- profile_p.$(OBJEXT)
-pgawk_OBJECTS = $(am_pgawk_OBJECTS)
-pgawk_LDADD = $(LDADD)
-pgawk_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@@ -138,8 +130,8 @@ am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \
-e s/c++$$/h++/ -e s/c$$/h/
YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS)
YLWRAP = $(top_srcdir)/ylwrap
-SOURCES = $(dgawk_SOURCES) $(gawk_SOURCES) $(pgawk_SOURCES)
-DIST_SOURCES = $(dgawk_SOURCES) $(gawk_SOURCES) $(pgawk_SOURCES)
+SOURCES = $(gawk_SOURCES)
+DIST_SOURCES = $(gawk_SOURCES)
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
@@ -152,6 +144,34 @@ am__can_run_installinfo = \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+HEADERS = $(include_HEADERS)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
@@ -217,13 +237,14 @@ CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
-DEFS = -DDEFPATH=$(DEFPATH) -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"$(datadir)/locale"'
+DEFS = -DDEFPATH=$(DEFPATH) -DDEFLIBPATH=$(DEFLIBPATH) -DSHLIBEXT=$(SHLIBEXT) -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"$(datadir)/locale"'
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
+GAWKLIBEXT = @GAWKLIBEXT@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
@@ -239,6 +260,7 @@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
+LIBMPFR = @LIBMPFR@
LIBOBJS = @LIBOBJS@
LIBREADLINE = @LIBREADLINE@
LIBS = @LIBS@
@@ -280,6 +302,7 @@ abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
+acl_shlibext = @acl_shlibext@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -314,12 +337,14 @@ mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
+pkgextensiondir = @pkgextensiondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
+subdirs = @subdirs@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
@@ -351,7 +376,6 @@ EXTRA_DIST = \
config.rpath \
config.sub \
depcomp \
- extension \
m4 \
missing \
missing_d \
@@ -381,33 +405,46 @@ SUBDIRS = \
awklib \
doc \
po \
+ extension \
test
+include_HEADERS = gawkapi.h
-# sources for both gawk and pgawk
+# sources for both gawk and dgawk
base_sources = \
array.c \
awk.h \
awkgram.y \
builtin.c \
+ cint_array.c \
+ cmd.h \
+ command.y \
custom.h \
+ debug.c \
dfa.c \
dfa.h \
+ eval.c \
ext.c \
field.c \
floatcomp.c \
floatmagic.h \
+ gawkapi.c \
+ gawkapi.h \
gawkmisc.c \
getopt.c \
getopt.h \
getopt1.c \
getopt_int.h \
gettext.h \
+ int_array.c \
+ interpret.h \
io.c \
mbsupport.h \
main.c \
+ mpfr.c \
msg.c \
node.c \
+ profile.c \
protos.h \
random.c \
random.h \
@@ -415,20 +452,23 @@ base_sources = \
regex.c \
regex.h \
replace.c \
+ str_array.c \
+ symbol.c \
version.c \
xalloc.h
-gawk_SOURCES = $(base_sources) eval.c profile.c
-pgawk_SOURCES = $(base_sources) eval_p.c profile_p.c
-dgawk_SOURCES = $(base_sources) eval_d.c profile.c cmd.h command.y debug.c
+gawk_SOURCES = $(base_sources)
# Get extra libs as needed, Automake will supply LIBINTL and SOCKET_LIBS.
-LDADD = $(LIBSIGSEGV) $(LIBINTL) $(SOCKET_LIBS)
-dgawk_LDADD = $(LDADD) @LIBREADLINE@
+LDADD = $(LIBSIGSEGV) $(LIBINTL) $(SOCKET_LIBS) @LIBREADLINE@ @LIBMPFR@
# stuff for compiling gawk/pgawk
DEFPATH = '".$(PATH_SEPARATOR)$(pkgdatadir)"'
+# shared library support:
+SHLIBEXT = "\"$(GAWKLIBEXT)"\"
+DEFLIBPATH = "\"$(pkgextensiondir)\""
+
# Get rid of core files when cleaning
CLEANFILES = core core.*
MAINTAINERCLEANFILES = version.c
@@ -529,15 +569,9 @@ uninstall-binPROGRAMS:
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
-dgawk$(EXEEXT): $(dgawk_OBJECTS) $(dgawk_DEPENDENCIES) $(EXTRA_dgawk_DEPENDENCIES)
- @rm -f dgawk$(EXEEXT)
- $(LINK) $(dgawk_OBJECTS) $(dgawk_LDADD) $(LIBS)
gawk$(EXEEXT): $(gawk_OBJECTS) $(gawk_DEPENDENCIES) $(EXTRA_gawk_DEPENDENCIES)
@rm -f gawk$(EXEEXT)
$(LINK) $(gawk_OBJECTS) $(gawk_LDADD) $(LIBS)
-pgawk$(EXEEXT): $(pgawk_OBJECTS) $(pgawk_DEPENDENCIES) $(EXTRA_pgawk_DEPENDENCIES)
- @rm -f pgawk$(EXEEXT)
- $(LINK) $(pgawk_OBJECTS) $(pgawk_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -548,28 +582,31 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/awkgram.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/builtin.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cint_array.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/command.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfa.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eval.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eval_d.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eval_p.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/field.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/floatcomp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gawkapi.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gawkmisc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/int_array.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpfr.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/node.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/profile.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/profile_p.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/random.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/re.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/replace.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_array.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symbol.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version.Po@am__quote@
.c.o:
@@ -588,6 +625,27 @@ distclean-compile:
.y.c:
$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE)
+install-includeHEADERS: $(include_HEADERS)
+ @$(NORMAL_INSTALL)
+ @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
+ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
+ done
+
+uninstall-includeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
@@ -911,10 +969,10 @@ distcleancheck: distclean
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) check-local
check: check-recursive
-all-am: Makefile $(PROGRAMS) config.h
+all-am: Makefile $(PROGRAMS) $(HEADERS) config.h
installdirs: installdirs-recursive
installdirs-am:
- for dir in "$(DESTDIR)$(bindir)"; do \
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(includedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
@@ -974,7 +1032,7 @@ info: info-recursive
info-am:
-install-data-am:
+install-data-am: install-includeHEADERS
install-dvi: install-dvi-recursive
@@ -1022,7 +1080,7 @@ ps: ps-recursive
ps-am:
-uninstall-am: uninstall-binPROGRAMS
+uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check-am \
cscopelist-recursive ctags-recursive install-am \
@@ -1039,17 +1097,17 @@ uninstall-am: uninstall-binPROGRAMS
info-am install install-am install-binPROGRAMS install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-exec-hook install-html install-html-am \
- install-info install-info-am install-man install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs installdirs-am \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
- tags tags-recursive uninstall uninstall-am \
- uninstall-binPROGRAMS
+ install-includeHEADERS install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am uninstall-binPROGRAMS \
+ uninstall-includeHEADERS
# First, add a link from gawk to gawk-X.Y.Z.
-# Same for pgawk.
#
# For GNU systems where gawk is awk, add a link to awk.
# (This is done universally, which may not always be right, but
@@ -1057,7 +1115,6 @@ uninstall-am: uninstall-binPROGRAMS
install-exec-hook:
(cd $(DESTDIR)$(bindir); \
$(LN) gawk$(EXEEXT) gawk-$(VERSION)$(EXEEXT) 2>/dev/null ; \
- $(LN) pgawk$(EXEEXT) pgawk-$(VERSION)$(EXEEXT) 2>/dev/null ; \
if [ ! -f awk ]; \
then $(LN_S) gawk$(EXEEXT) awk; \
fi; exit 0)
@@ -1066,12 +1123,12 @@ install-exec-hook:
uninstall-links:
(cd $(DESTDIR)$(bindir); \
if [ -f awk ] && cmp awk gawk$(EXEEXT) > /dev/null; then rm -f awk; fi ; \
- rm -f gawk-$(VERSION)$(EXEEXT) pgawk-$(VERSION)$(EXEEXT); exit 0)
+ rm -f gawk-$(VERSION)$(EXEEXT); exit 0)
uninstall-recursive: uninstall-links
# force there to be a gawk executable before running tests
-check-local: gawk$(EXEEXT) pgawk$(EXEEXT)
+check-local: gawk$(EXEEXT)
# A little extra clean up when making distributions.
# And additional set up for the pc directory.
@@ -1086,6 +1143,7 @@ dist-hook:
# Special rules for individual files
# Use of awk instead of $(AWK) is deliberate, in case gawk doesn't build
# or work correctly.
+
awkgram.c: awkgram.y
$(YACC) $(AM_YFLAGS) $(YFLAGS) $<
sed 's/parse error/syntax error/g' < y.tab.c | awk -f $(srcdir)/bisonfix.awk awkgram > $*.c && rm y.tab.c
@@ -1109,7 +1167,12 @@ diffout valgrind-scan:
valgrind:
cd test; rm -f log.[0-9]*; \
- make check AWK="valgrind --leak-check=full --log-file=log.%p ../gawk"; \
+ make check VALGRIND="valgrind --leak-check=full --log-file=log.%p"; \
+ make valgrind-scan
+
+valgrind-noleak:
+ cd test; rm -f log.[0-9]*; \
+ make check VALGRIND="valgrind --leak-check=no --log-file=log.%p"; \
make valgrind-scan
# Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/NEWS b/NEWS
index b32c5767..9c98f7a2 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,31 @@
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.
+
+Changes from 4.0.2 to 4.1
+-------------------------
+1. The three executables gawk, pgawk, and dgawk, have been merged into
+ one, named just gawk. As a result:
+ * The -R option is gone
+ * Use -D to run the debugger. An optional file argument is a
+ list of commands to run first.
+ * Use -o to do pretty-printing only.
+ * Use -p to do profiling.
+
+2. The new -l option is used for loading dynamic extensions.
+
+3. The new -i option is used for loading awk library files.
+
+4. Gawk now supports high precision arithmetic with MPFR.
+
+5. A number of facilities from xgawk have been merged in!
+
+6. The dynamic extension interface has been completely redone! See the doc.
+
+7. The and(), or() and xor() functions now take any number of arguments,
+ with a minimum of two.
+
+8. New arrays: SYMTAB, FUNCTAB, and PROCINFO["identifiers"]. See the manual.
Changes from 4.0.1 to 4.0.2
---------------------------
diff --git a/README.git b/README.git
index f14588e1..7dbc24c8 100644
--- a/README.git
+++ b/README.git
@@ -1,4 +1,4 @@
-Mon Oct 24 21:50:18 IST 2011
+Sun Aug 5 16:25:58 IDT 2012
============================
If you are reading this, you have retrieved the gawk code base via
@@ -18,7 +18,312 @@ comp.lang.awk is generally a bad idea, no matter what the purpose, but
especially if you wish to report a gawk bug. Use the above email address.
Really.
+You can find gawk's GIT repository at Savannah
+https://savannah.gnu.org/git/?group=gawk
+
+Detailed instructions on using and contributing to gawk can also be
+found at Savannah, see http://savannah.gnu.org/maintenance/UsingGit
+
Thanks,
Arnold Robbins
Gawk Maintainer
+
+=====================================================================
+Here are some questions and answers related to using git compiled
+by several of the gawk maintainers.
+
+- I don't want to mess with git. Can I just get a tarball of a branch without
+ a lot of hassle?
+
+Yes. Use something like this:
+
+ wget http://git.savannah.gnu.org/cgit/gawk.git/snapshot/gawk-BRANCH-NAME.tar.gz
+
+Put the right thing in place of BRANCH-NAME.
+
+- How can I check out the GIT repository ?
+
+Depending upon your working habits, there are several options.
+1. On the Linux command line use the git command (details see below)
+2. With Microsoft Windows, use TortoiseGIT
+3. On both platforms Eclipse with its EGIT plugin is an excellent choice
+
+On the Linux command line use git to check out the repository.
+With Microsoft Windows, use TortoiseGIT.
+
+
+- Where is TortoiseGIT and how do I install it ?
+
+Follow these instructions for installation:
+ https://github.com/multitheftauto/multitheftauto/wiki/how-to-use-tortoisegit
+
+Begin with installing Putty, then msysgit and finally TortoiseGIT.
+Find Putty at http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
+
+
+- What about the SSH keys needed when Windows is my primary environment ?
+
+On Windows you may use Puttygen for generating keys.
+Save both keys (public and private) in a local .ppk file.
+Notice that this file is highly confidential and even other
+team members are not supposed to see your keys.
+Finally you need to convert Putty's keys (.ppk file) so that they
+can also be used on Linux.
+ http://www.laszlomolnar.name/open-source/tips-and-tutorials/how-to-convert-puttys-private-key-ppk-into-opensshs-private-key-format-in-linux.html
+
+ puttygen my_keys.ppk -O private-openssh -o .ssh/id_rsa
+ puttygen my_keys.ppk -O public-openssh -o .ssh/id_rsa.pub
+
+
+- What about the SSH keys needed when Linux is my primary environment ?
+
+On Linux follow these instructions to generate keys:
+http://www.guyrutenberg.com/2007/10/05/ssh-keygen-tutorial-generating-rsa-and-dsa-keys/
+If you ever need these keys inside a Windows environment, use Puttygen
+to import the already existing keys.
+
+
+- I know Subversion, now what's different with git ?
+
+Read the "Git - SVN Crash Course". It lists the Subversion commands that
+are roughly equivalent to certain git commands:
+ http://www.pronego.com/helpdesk/knowledgebase.php?article=49
+This document is only one of many copies of the document on the Internet.
+You should read the original (which is currently offline and unreachable):
+ https://git.wiki.kernel.org/index.php/GitSvnCrashCourse
+
+
+- How can I check out this repository inside a clean subdirectory ?
+
+ mkdir -p workspace/git
+ cd workspace/git
+ git clone git://git.sv.gnu.org/project.git
+
+ git remote -v
+ origin ssh://jkahrs@git.sv.gnu.org/srv/git/gawk.git (fetch)
+ origin ssh://jkahrs@git.sv.gnu.org/srv/git/gawk.git (push)
+
+
+- How can I check out this repository with Eclipse ?
+
+Use the most recent version of Eclipse, it already comes with the
+EGIT plugin installed.
+ Select File -> Import -> Git -> Git Repository.
+ Press clone and maintain the git repository "ssh://jkahrs@git.sv.gnu.org/srv/git/gawk.git".
+ You only have to paste the URL to the first line of the dialog,
+ the rest will be filled out automatically.
+
+You can find details in the EGIT tutorial.
+ http://www.vogella.de/articles/EGit/article.html#respository_checkoutproject
+
+
+- Can I start adding new files to the repository right now ?
+Yes, you can, but you should not do so.
+Convention with branches.
+
+But first you should make sure some global settings identifying
+you are set. The global settings will be used every time you commit
+something to the repository.
+
+ git config --global user.name "First-Name Last-Name"
+ git config --global user.email email@address.site
+ git config --global color.ui auto
+
+
+- How can I inspect my settings ?
+
+
+ git config --list
+ giggle.main-window-maximized=false
+ giggle.main-window-geometry=1369x753+183+81
+ giggle.main-window-view=HistoryView
+ giggle.history-view-vpane-position=389
+ giggle.file-view-vpane-position=293
+ user.name=First-Name Last-Name
+ user.email=email@address.site
+ color.diff=auto
+ color.status=auto
+ color.branch=auto
+ gui.spellingdictionary=en_US
+ core.repositoryformatversion=0
+ core.filemode=true
+ core.bare=false
+ core.logallrefupdates=true
+ remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
+ remote.origin.url=ssh://jkahrs@git.sv.gnu.org/srv/git/gawk.git
+ branch.master.remote=origin
+ branch.master.merge=refs/heads/master
+ branch.xgawk_load.remote=origin
+ branch.xgawk_load.merge=refs/heads/xgawk_load
+
+
+- How can I get or set a specific variable of the settings ?
+
+ git config --get color.ui
+ git config --set color.ui auto
+
+
+- How can I create new files or directories to the repository ?
+
+ touch README
+ git add README
+ git commit -m "first commit"
+
+
+- What did I change since the last commit ?
+
+ git diff README
+ git diff
+
+
+- I have committed everything to my local repository, now how can I
+ "push" these changes up to gawk.git ?
+
+ git push -u origin master # push up to master branch
+ git push -u origin my_feature_branch # push up to my own branch
+
+
+- How can I inspect the list of branches of my repository ?
+
+ git branch # shows all local branches
+ git branch -r # shows all remote branches
+ git branch -a # shows all local and all remote branches
+
+
+- How can I change to a different branch ?
+
+ git checkout my_stuff # change to branch my_stuff
+ git checkout -b my_stuff # create new branch my_stuff and change to it
+
+- How can I pull patches from a branch ?
+
+ git pull origin feature_branch
+
+The name of the branch can be omitted if your current branch is
+created to track the feature_branch ("git branch -t", see below).
+
+- How can I create a branch ?
+
+For each new feature to be considered for inclusion into future
+releasses, a new branch shall be created. Upon creation, this new
+branch shall be based on the master branch.
+
+ # make master branch the base
+ git checkout master
+ # create new feature branch and connect local to upstream branch
+ git branch -t my_new_feature_branch
+ touch my_new_file.c
+ git add my_new_file.c
+ git status
+ git commit -m "Created new feature branch."
+ git push -u origin my_new_feature_branch
+ git checkout my_new_feature_branch
+
+
+- How can I merge recent patches from the master branch ?
+
+My feature branch has been created as describe above (based on master).
+While I committed and pushed up my changes, the master branch has also changed.
+Now I want to catch up with recent changes in the master branch.
+
+ git diff origin/master # What is in master that I don't have ?
+ git merge origin/master # Merge all master patches into local rep
+ git push -u origin my_new_feature_branch # Push these local changes up
+
+
+- How can I throw away an obsolete branch ?
+
+ git push origin :newfeature # remove remote branch
+ git checkout -f master # switch back from newfeature to master, ignoring changes
+ git branch -D newfeature # remove local branch
+
+
+- I have made stupid changes to a file and want the original back, how ?
+
+ git checkout file_name.ext
+
+ This will only work if the file was not yet committed.
+ If you have already committed the change and want back the
+ last pushed version, use "git reset" instead.
+
+- I have committed stupid changes, how can I undo the "git commit" ?
+
+ http://stackoverflow.com/questions/927358/git-undo-last-commit
+
+
+- Who changed a specific line in my file ?
+
+Sometimes you need to find out whom to blame for a certain line of a change.
+git can tell you for each line who did the most recent change of the line.
+
+ git blame README
+
+
+- Who else has ever changed my file, when and why ?
+
+You can inspect the log history file-wise but also directory-wise.
+
+ git log README
+ git log
+
+
+- How to fix a broken repository ?
+
+ git fsck
+
+- How to clean up my repository (garbage collection) ?
+
+ git gc
+
+- How can I change settings with an editor (without "git xxx" command) ?
+
+This is useful for inspecting the settings of local and remote branches that track each other.
+
+ vi .git/config
+
+- I'm a devoted user of Bazaar, and don't want to switch to git. Is
+ there any way for me to track Gawk development with bzr?
+
+Yes, there is. First, install the latest version of bzr (2.5.0 or
+later is required). If it doesn't come with the bzr-git plugin,
+download and install it from https://launchpad.net/bzr-git. You will
+also need dulwich, which is a Python implementation of the git
+protocol; get it from http://www.samba.org/~jelmer/dulwich/.
+
+(To know whether you have bzr-git, type "bzr plugins".)
+
+Next, clone the Gawk git repository with this command:
+
+ bzr git-import git://git.savannah.gnu.org/gawk.git gawk
+
+This will create a directory called 'gawk' with meta-data of the
+repository, but without any working trees. To checkout the files,
+chdir to that directory and type:
+
+ bzr checkout
+
+This will checkout the files for the default branch. To see the list
+of branches, type
+
+ bzr branches
+
+To switch to another branch, type
+
+ bzr switch --force BRANCH
+
+where BRANCH is the name of the branch, e.g. 'xgawk'. (The --force
+option is a workaround for an annoying misfeature in bzr 2.5.0, which
+will most probably be resolved in the near future.)
+
+To sync the current branch with upstream, type
+
+ bzr pull
+
+If you want to update several branches, "bzr switch" to each one in
+turn, followed by "bzr pull" to sync the branch.
+
+- How do I manage things if I want to undo a commit?
+
+It depends upon if you have pushed the commit or not. Lots of good
+info is at http://stackoverflow.com/questions/927358/git-undo-last-commit .
diff --git a/README_d/ChangeLog b/README_d/ChangeLog
index b29f67a2..0310bd8d 100644
--- a/README_d/ChangeLog
+++ b/README_d/ChangeLog
@@ -1,3 +1,11 @@
+2012-04-11 John Haque <j.eh@mchsi.com>
+
+ * README.hacking: New file.
+
+2012-04-01 John Haque <j.eh@mchsi.com>
+
+ * README.mpfr: New file.
+
2012-03-28 Arnold D. Robbins <arnold@skeeve.com>
* 4.0.1: Release tar ball made.
diff --git a/README_d/README.hacking b/README_d/README.hacking
new file mode 100644
index 00000000..dcb57359
--- /dev/null
+++ b/README_d/README.hacking
@@ -0,0 +1,11 @@
+* Use one of the following macros to access the value of a numeric NODE:
+ Macro Returned C type
+ ---------------------------------------
+ get_number_ui(n) unsigned long
+ get_number_si(n) long
+ get_number_d(n) double
+ get_number_uj(n) uintmax_t
+
+* Use iszero(n) to test if a numeric NODE is zero.
+
+ \ No newline at end of file
diff --git a/README_d/README.mpfr b/README_d/README.mpfr
new file mode 100644
index 00000000..b12c19b6
--- /dev/null
+++ b/README_d/README.mpfr
@@ -0,0 +1,25 @@
+Sat Mar 17 07:32:01 CDT 2012
+=============================
+
+The MPFR and GMP versions known to work for Mac OS X on PPC:
+GNU MPFR 3.1.0, GNU MP 4.3.1
+
+----
+Precompiled binaries for GMP and MPFR in Windows may be available
+from here:
+
+ http://sourceforge.net/projects/ezwinports/files/
+
+or here:
+
+ http://sourceforge.net/projects/mingw/files/MinGW/Base/mpfr/
+ http://sourceforge.net/projects/mingw/files/MinGW/Base/gmp/
+
+You should try to use libraries downloaded from the same site
+to avoid possible incompatibilities.
+
+----
+Gawk has been compiled and tested using the following combinations
+of MPFR and GMP versions on GNU/Linux:
+GNU MPFR 2.4.2, GNU MP 4.3.2
+GNU MPFR 3.1.0, GNU MP 5.0.3
diff --git a/TODO b/TODO
index ab38248c..aaf2331f 100644
--- a/TODO
+++ b/TODO
@@ -1,4 +1,4 @@
-Add debugger commands to reference card
+Add debugger commands to reference card ??
Review all FIXME and TODO comments
FIX regular field splitting to use FPAT algorithm.
@@ -11,13 +11,18 @@ Really make failure to open a socket a non-fatal error (for 4.1).
?? Scope IDs for IPv6 addresses ??
+DONE: Merge the chapter and the appendix on floating-point math (for 4.1).
+
+Look at code coverage tools, like S2E: https://s2e.epfl.ch/
+
+From Andy: Review the following test cases that they work with make diffout.
+These look suspicious: mmap8k, fmtspcl (the mpfr case), clobber, getlnbuf,
+rtlenmb, profile1, rand (mpfr case).
+
------
Code Review:
awkgram.y
-awkprintf.h
-cmd.h
-command.y
debug.c
eval.c
ext.c
@@ -25,33 +30,35 @@ field.c
floatcomp.c
floatmagic.h
gawkmisc.c
-io.c
profile.c
protos.h
DONE:
-awk.h
array.c
+awk.h
builtin.c
-node.c
+cmd.h
+command.y
+custom.h
+hard-locale.h
+io.c
+main.c
mbsupport.h
-xalloc.h
-version.c
+msg.c
+node.c
re.c
replace.c
-msg.c
-hard-locale.h
-custom.h
-main.c
+version.c
+xalloc.h
------
-Add in gawk/mp
+DONE: Add in gawk/mp
-Design and implement I/O plugin API.
+DONE: Design and implement I/O plugin API.
-Implement C function call API per man pages
+DONE: Implement C function call API per man pages
-xgawk features (@load, -l, others)
+DONE: xgawk features (@load, -l, others)
Add tests for patches in emails
diff --git a/TODO.xgawk b/TODO.xgawk
new file mode 100644
index 00000000..164f4f59
--- /dev/null
+++ b/TODO.xgawk
@@ -0,0 +1,148 @@
+To-do list for xgawk enhancements:
+
+- Review macros (force_string etc.)
+
+- In gawkapi.c - review switch statements and use of default.
+
+Low priority:
+
+- Enhance extension/fork.c waitpid to allow the caller to specify the options.
+ And add an optional array argument to wait and waitpid in which to return
+ exit status information.
+
+Possible future changes requiring (further) discussion:
+
+- Change from dlopen to using the libltdl library (i.e. lt_dlopen).
+ This may support more platforms.
+
+- Implement namespaces. Arnold suggested the following in an email:
+ - Extend the definition of an 'identifier' to include "." as a valid character
+ although an identifier can't start with it.
+ - Extension libraries install functions and global variables with names
+ that have a "." in them: XML.parse(), XML.name, whatever.
+ - Awk code can read/write such variables and call such functions, but they
+ cannot define such functions
+ function XML.foo() { .. } # error
+ or create a variable with such a name if it doesn't exist. This would
+ be a run-time error, not a parse-time error.
+ - This last rule may be too restrictive.
+ I don't want to get into fancy rules a la perl and file-scope visibility
+ etc, I'd like to keep things simple. But how we design this is going
+ to be very important.
+
+Unlikely:
+
+- Include a sample rpm spec file in a new packaging subdirectory.
+
+- Patch lexer for @include and @load to make quotes optional.
+
+Done:
+
+- Add AWKLIBPATH with default pointing to ${libexecdir}/$PACKAGE/$VERSION
+
+- Change default shared library extension from ".so" to ".$shlibext"
+
+- Patch build infrastructure so that the current code in the
+ extension subdirectory gets built and installed into the default $AWKLIBPATH
+ location.
+
+- Implement @load
+
+- Patch ERRNO handling to create a simple API for use by extensions:
+ extern void update_ERRNO_int(int)
+ enum errno_translate { TRANSLATE, DONT_TRANSLATE };
+ extern void update_ERRNO_string(const char *string, enum errno_translate);
+ extern void unset_ERRNO(void);
+
+- Add valgrind-noleak target.
+
+- Fix minor bug in fork extension, and add wait function.
+
+- Patch filefuncs extension to read symbolic links more robustly.
+
+- Add shared library tests.
+
+- Delete extension/xreadlink.[ch]
+
+- Add a -i (--include) option.
+
+- Enable default ".awk" search in io.c:find_source(). The simple change
+ is to add this code inline in io.c:
+ #ifndef DEFAULT_FILETYPE
+ #define DEFAULT_FILETYPE ".awk"
+ #endif
+
+- The -f flag should not eliminate duplicates.
+
+- Eliminate libtool from the top-level configure.ac. Create a separate
+ configure.ac in the extensions subdirectory, and hide all the libtool
+ stuff in there.
+
+- Running "make install" should install gawkapi.h in /usr/include.
+
+- Add time extension to the gawk distro. This defines sleep and gettimeofday.
+ Renamed existing gettimeofday to getlocaltime.
+
+- Finish implementing new interface using gawkapi.h
+ - api_get_curfunc_param not honoring requested type in node_to_awk_value
+ - should api_sym_lookup also accept a type request?
+ - must update the API do_lint value when changed by set_LINT
+ - what is the proper return value for load_ext? It does not matter
+ unless called by the "extension" function that nobody uses.
+
+- Hide private parts of IOBUF from extensions.
+
+- Fix extension/rwarray.c.
+
+- Fix lint complaints about shared library functions being called without
+ having been defined. For example, try:
+ gawk --lint -lordchr 'BEGIN {print chr(65)}'
+ gawk: warning: function `chr' called but never defined
+ A
+ In ext.c, make_builtin needs to call awkgram.y:func_use. If done naively,
+ I think this would result in complaints about shared library functions
+ defined but not used. So there should probably be an enhancement to func_use
+ and ftable to indicate if it's a shared library function.
+
+- Develop a libgawk shared library for use by extensions. Should this
+ be hosted in a separate project?
+
+ A few existing extensions use a hash API for mapping string
+ handles to structures. In xgawk, we had this API inside array.c, but it
+ probably belongs in a separate libgawk shared library:
+
+ typedef struct _strhash strhash;
+ extern strhash *strhash_create P((size_t min_table_size));
+ /* Find an entry in the hash table. If it is not found, the insert_if_missing
+ argument indicates whether a new entry should be created. The caller
+ may set the "data" field to any desired value. If it is a new entry,
+ "data" will be initialized to NULL. */
+ extern strhash_entry *strhash_get P((strhash *, const char *s, size_t len,
+ int insert_if_missing));
+ typedef void (*strhash_delete_func)(void *data, void *opaque,
+ strhash *, strhash_entry *);
+ extern int strhash_delete P((strhash *, const char *s, size_t len,
+ strhash_delete_func, void *opaque));
+ extern void strhash_destroy P((strhash *, strhash_delete_func, void *opaque));
+
+- Separate projects for major standalone extensions. We need to set up
+ hosting for these projects:
+
+ - XML
+
+ - PostgreSQL
+
+ - GD
+
+ - MPFR. This is probably not useful now that MPFR support has been
+ integrated into gawk. Are there any users who need this extension?
+
+- Review open hook implementation.
+ * Mostly done.
+ * Still to go: Rework iop_alloc, interaction with open hooks, and
+ skipping command line directories.
+
+- Attempting to load the same file with -f and -i (or @include) should
+ be a fatal error.
+
+- Consider adding a way to access gawk special vars read only.
diff --git a/aclocal.m4 b/aclocal.m4
index bce99e71..fa8a2461 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -954,6 +954,7 @@ m4_include([m4/lib-link.m4])
m4_include([m4/lib-prefix.m4])
m4_include([m4/libsigsegv.m4])
m4_include([m4/longlong.m4])
+m4_include([m4/mpfr.m4])
m4_include([m4/nls.m4])
m4_include([m4/noreturn.m4])
m4_include([m4/po.m4])
diff --git a/array.c b/array.c
index f28a32de..aa204c17 100644
--- a/array.c
+++ b/array.c
@@ -1,5 +1,5 @@
/*
- * array.c - routines for associative arrays.
+ * array.c - routines for awk arrays.
*/
/*
@@ -25,69 +25,194 @@
#include "awk.h"
+extern FILE *output_fp;
+extern NODE **fmt_list; /* declared in eval.c */
+extern array_ptr str_array_func[];
+extern array_ptr cint_array_func[];
+extern array_ptr int_array_func[];
+
+static size_t SUBSEPlen;
+static char *SUBSEP;
+static char indent_char[] = " ";
+
+static NODE **null_lookup(NODE *symbol, NODE *subs);
+static NODE **null_afunc(NODE *symbol, NODE *subs);
+static NODE **null_dump(NODE *symbol, NODE *subs);
+static array_ptr null_array_func[] = {
+ (array_ptr) 0,
+ (array_ptr) 0,
+ null_lookup,
+ null_afunc,
+ null_afunc,
+ null_afunc,
+ null_afunc,
+ null_afunc,
+ null_dump,
+};
+
+#define MAX_ATYPE 10
+
+static array_ptr *atypes[MAX_ATYPE];
+static int num_atypes = 0;
+
/*
- * Tree walks (``for (iggy in foo)'') and array deletions use expensive
- * linear searching. So what we do is start out with small arrays and
- * grow them as needed, so that our arrays are hopefully small enough,
- * most of the time, that they're pretty full and we're not looking at
- * wasted space.
- *
- * The decision is made to grow the array if the average chain length is
- * ``too big''. This is defined as the total number of entries in the table
- * divided by the size of the array being greater than some constant.
+ * register_array_func --- add routines to handle arrays.
*
- * We make the constant a variable, so that it can be tweaked
- * via environment variable.
+ * index 0 : initialization.
+ * index 1 : check if index is compatible.
+ * index 8 : array dump, memory and other statistics (do_adump).
*/
+
-static size_t AVG_CHAIN_MAX = 2; /* Modern machines are bigger, reduce this from 10. */
+int
+register_array_func(array_ptr *afunc)
+{
+ if (afunc && num_atypes < MAX_ATYPE) {
+ if (afunc != str_array_func && ! afunc[1])
+ return false;
+ atypes[num_atypes++] = afunc;
+ if (afunc[0]) /* execute init routine if any */
+ (void) (*afunc[0])(NULL, NULL);
+ return true;
+ }
+ return false;
+}
-static size_t SUBSEPlen;
-static char *SUBSEP;
-static NODE *assoc_find(NODE *symbol, NODE *subs, unsigned long hash1, NODE **last);
-static void grow_table(NODE *symbol);
+/* array_init --- register all builtin array types */
-static unsigned long gst_hash_string(const char *str, size_t len, unsigned long hsize, size_t *code);
-static unsigned long scramble(unsigned long x);
-static unsigned long awk_hash(const char *s, size_t len, unsigned long hsize, size_t *code);
+void
+array_init()
+{
+ (void) register_array_func(str_array_func); /* the default */
+ if (! do_mpfr) {
+ (void) register_array_func(int_array_func);
+ (void) register_array_func(cint_array_func);
+ }
+}
-unsigned long (*hash)(const char *s, size_t len, unsigned long hsize, size_t *code) = awk_hash;
-/* qsort comparison function */
-static int sort_up_index_string(const void *, const void *);
-static int sort_down_index_string(const void *, const void *);
-static int sort_up_index_number(const void *, const void *);
-static int sort_down_index_number(const void *, const void *);
-static int sort_up_value_string(const void *, const void *);
-static int sort_down_value_string(const void *, const void *);
-static int sort_up_value_number(const void *, const void *);
-static int sort_down_value_number(const void *, const void *);
-static int sort_up_value_type(const void *, const void *);
-static int sort_down_value_type(const void *, const void *);
+/* make_array --- create an array node */
-/* array_init --- check relevant environment variables */
+NODE *
+make_array()
+{
+ NODE *array;
+ getnode(array);
+ memset(array, '\0', sizeof(NODE));
+ array->type = Node_var_array;
+ array->array_funcs = null_array_func;
+ /* vname, flags, and parent_array not set here */
+
+ return array;
+}
+
+
+/* init_array --- (re)initialize an array node */
void
-array_init()
+init_array(NODE *symbol)
{
- const char *val;
- char *endptr;
- size_t newval;
-
- if ((val = getenv("AVG_CHAIN_MAX")) != NULL && isdigit((unsigned char) *val)) {
- newval = strtoul(val, & endptr, 10);
- if (endptr != val && newval > 0)
- AVG_CHAIN_MAX = newval;
+ symbol->type = Node_var_array;
+ symbol->array_funcs = null_array_func;
+ symbol->buckets = NULL;
+ symbol->table_size = symbol->array_size = 0;
+ symbol->array_capacity = 0;
+
+ assert(symbol->xarray == NULL);
+ /* symbol->xarray = NULL; */
+
+ /* flags, vname, parent_array not (re)initialized */
+}
+
+
+/* null_lookup: assign type to an empty array. */
+
+static NODE **
+null_lookup(NODE *symbol, NODE *subs)
+{
+ int i;
+ array_ptr *afunc = NULL;
+
+ assert(symbol->table_size == 0);
+
+ /* Check which array type wants to accept this sub; traverse
+ * array type list in reverse order.
+ */
+ for (i = num_atypes - 1; i >= 1; i--) {
+ afunc = atypes[i];
+ if (afunc[1](symbol, subs) != NULL)
+ break;
}
+ if (i == 0 || afunc == NULL)
+ afunc = atypes[0]; /* default is str_array_func */
+ symbol->array_funcs = afunc;
- if ((val = getenv("AWK_HASH")) != NULL && strcmp(val, "gst") == 0)
- hash = gst_hash_string;
+ /* We have the right type of array; install the subscript */
+ return symbol->alookup(symbol, subs);
}
+
+/* null_afunc --- dummy function for an empty array */
+
+static NODE **
+null_afunc(NODE *symbol ATTRIBUTE_UNUSED, NODE *subs ATTRIBUTE_UNUSED)
+{
+ return NULL;
+}
+
+/* null_dump --- dump function for an empty array */
+
+static NODE **
+null_dump(NODE *symbol, NODE *subs ATTRIBUTE_UNUSED)
+{
+ fprintf(output_fp, "array `%s' is empty\n", array_vname(symbol));
+ return NULL;
+}
+
+
+/* r_in_array --- test whether the array element symbol[subs] exists or not,
+ * return pointer to value if it does.
+ */
+
+NODE *
+r_in_array(NODE *symbol, NODE *subs)
+{
+ NODE **ret;
+
+ ret = symbol->aexists(symbol, subs);
+ return (ret ? *ret : NULL);
+}
+
+
+/* assoc_copy --- duplicate input array "symbol" */
+
+NODE *
+assoc_copy(NODE *symbol, NODE *newsymb)
+{
+ assert(newsymb->vname != NULL);
+
+ assoc_clear(newsymb);
+ (void) symbol->acopy(symbol, newsymb);
+ newsymb->array_funcs = symbol->array_funcs;
+ newsymb->flags = symbol->flags;
+ return newsymb;
+}
+
+
+/* assoc_dump --- dump array */
+
+void
+assoc_dump(NODE *symbol, NODE *ndump)
+{
+ if (symbol->adump)
+ (void) symbol->adump(symbol, ndump);
+}
+
+
/* make_aname --- construct a 'vname' for a (sub)array */
-static char *
+const char *
make_aname(const NODE *symbol)
{
static char *aname = NULL;
@@ -115,10 +240,11 @@ make_aname(const NODE *symbol)
erealloc(aname, char *, (max_alen + 1) * sizeof(char *), "make_aname");
}
memcpy(aname, symbol->vname, alen + 1);
- }
+ }
return aname;
-#undef SLEN
}
+#undef SLEN
+
/*
* array_vname --- print the name of the array
@@ -128,7 +254,7 @@ make_aname(const NODE *symbol)
* to save it, they have to make a copy.
*/
-char *
+const char *
array_vname(const NODE *symbol)
{
static char *message = NULL;
@@ -164,7 +290,6 @@ array_vname(const NODE *symbol)
else
aname = make_aname(symbol);
len += strlen(aname);
-
/*
* Each node contributes by strlen(from) minus the length
* of "%s" in the translation (which is at least 2)
@@ -213,49 +338,38 @@ array_vname(const NODE *symbol)
*/
NODE *
-get_array(NODE *symbol, int canfatal)
+get_array(NODE *symbol, bool canfatal)
{
NODE *save_symbol = symbol;
- int isparam = FALSE;
+ bool isparam = false;
- if (symbol->type == Node_param_list && (symbol->flags & FUNC) == 0) {
+ if (symbol->type == Node_param_list) {
save_symbol = symbol = GET_PARAM(symbol->param_cnt);
- isparam = TRUE;
+ isparam = true;
if (symbol->type == Node_array_ref)
symbol = symbol->orig_array;
}
switch (symbol->type) {
case Node_var_new:
- symbol->type = Node_var_array;
- symbol->var_array = NULL;
+ init_array(symbol);
symbol->parent_array = NULL; /* main array has no parent */
/* fall through */
case Node_var_array:
break;
case Node_array_ref:
- case Node_param_list:
- if ((symbol->flags & FUNC) == 0)
- cant_happen();
- /* else
- fall through */
-
default:
- /* notably Node_var but catches also e.g. FS[1] = "x" */
+ /* notably Node_var but catches also e.g. a[1] = "x"; a[1][1] = "y" */
if (canfatal) {
if (symbol->type == Node_val)
fatal(_("attempt to use a scalar value as array"));
-
- if ((symbol->flags & FUNC) != 0)
- fatal(_("attempt to use function `%s' as an array"),
- save_symbol->vname);
- else if (isparam)
+ if (isparam)
fatal(_("attempt to use scalar parameter `%s' as an array"),
- save_symbol->vname);
+ save_symbol->vname);
else
fatal(_("attempt to use scalar `%s' as an array"),
- save_symbol->vname);
+ save_symbol->vname);
} else
break;
}
@@ -269,16 +383,18 @@ get_array(NODE *symbol, int canfatal)
void
set_SUBSEP()
{
- SUBSEP = force_string(SUBSEP_node->var_value)->stptr;
+ SUBSEP_node->var_value = force_string(SUBSEP_node->var_value);
+ SUBSEP = SUBSEP_node->var_value->stptr;
SUBSEPlen = SUBSEP_node->var_value->stlen;
-}
+}
+
/* concat_exp --- concatenate expression list into a single string */
NODE *
-concat_exp(int nargs, int do_subsep)
+concat_exp(int nargs, bool do_subsep)
{
- /* do_subsep is false for Node-concat */
+ /* do_subsep is false for Op_concat */
NODE *r;
char *str;
char *s;
@@ -295,13 +411,14 @@ concat_exp(int nargs, int do_subsep)
len = 0;
for (i = 1; i <= nargs; i++) {
- r = POP();
+ r = TOP();
if (r->type == Node_var_array) {
while (--i > 0)
DEREF(args_array[i]); /* avoid memory leak */
fatal(_("attempt to use array `%s' in a scalar context"), array_vname(r));
- }
- args_array[i] = force_string(r);
+ }
+ r = POP_STRING();
+ args_array[i] = r;
len += r->stlen;
}
len += (nargs - 1) * subseplen;
@@ -329,246 +446,6 @@ concat_exp(int nargs, int do_subsep)
}
-/* assoc_clear --- flush all the values in symbol[] */
-
-void
-assoc_clear(NODE *symbol)
-{
- long i;
- NODE *bucket, *next;
-
- if (symbol->var_array == NULL)
- return;
-
- for (i = 0; i < symbol->array_size; i++) {
- for (bucket = symbol->var_array[i]; bucket != NULL; bucket = next) {
- next = bucket->ahnext;
- if (bucket->ahvalue->type == Node_var_array) {
- NODE *r = bucket->ahvalue;
- assoc_clear(r); /* recursively clear all sub-arrays */
- efree(r->vname);
- freenode(r);
- } else
- unref(bucket->ahvalue);
-
- unref(bucket); /* unref() will free the ahname_str */
- }
- symbol->var_array[i] = NULL;
- }
- efree(symbol->var_array);
- symbol->var_array = NULL;
- symbol->array_size = symbol->table_size = 0;
- symbol->flags &= ~ARRAYMAXED;
-}
-
-/* awk_hash --- calculate the hash function of the string in subs */
-
-static unsigned long
-awk_hash(const char *s, size_t len, unsigned long hsize, size_t *code)
-{
- unsigned long h = 0;
- unsigned long htmp;
-
- /*
- * Ozan Yigit's original sdbm hash, copied from Margo Seltzers
- * db package.
- *
- * This is INCREDIBLY ugly, but fast. We break the string up into
- * 8 byte units. On the first time through the loop we get the
- * "leftover bytes" (strlen % 8). On every other iteration, we
- * perform 8 HASHC's so we handle all 8 bytes. Essentially, this
- * saves us 7 cmp & branch instructions. If this routine is
- * heavily used enough, it's worth the ugly coding.
- */
-
- /*
- * Even more speed:
- * #define HASHC h = *s++ + 65599 * h
- * Because 65599 = pow(2, 6) + pow(2, 16) - 1 we multiply by shifts
- *
- * 4/2011: Force the results to 32 bits, to get the same
- * result on both 32- and 64-bit systems. This may be a
- * bad idea.
- */
-#define HASHC htmp = (h << 6); \
- h = *s++ + htmp + (htmp << 10) - h ; \
- htmp &= 0xFFFFFFFF; \
- h &= 0xFFFFFFFF
-
- h = 0;
-
- /* "Duff's Device" */
- if (len > 0) {
- size_t loop = (len + 8 - 1) >> 3;
-
- switch (len & (8 - 1)) {
- case 0:
- do { /* All fall throughs */
- HASHC;
- case 7: HASHC;
- case 6: HASHC;
- case 5: HASHC;
- case 4: HASHC;
- case 3: HASHC;
- case 2: HASHC;
- case 1: HASHC;
- } while (--loop);
- }
- }
-
- if (code != NULL)
- *code = h;
-
- if (h >= hsize)
- h %= hsize;
- return h;
-}
-
-/* assoc_find --- locate symbol[subs] */
-
-static NODE * /* NULL if not found */
-assoc_find(NODE *symbol, NODE *subs, unsigned long hash1, NODE **last)
-{
- NODE *bucket, *prev;
- const char *s1_str;
- size_t s1_len;
- NODE *s2;
-
- for (prev = NULL, bucket = symbol->var_array[hash1]; bucket != NULL;
- prev = bucket, bucket = bucket->ahnext) {
- /*
- * This used to use cmp_nodes() here. That's wrong.
- * Array indices are strings; compare as such, always!
- */
- s1_str = bucket->ahname_str;
- s1_len = bucket->ahname_len;
- s2 = subs;
-
- if (s1_len == s2->stlen) {
- if (s1_len == 0 /* "" is a valid index */
- || memcmp(s1_str, s2->stptr, s1_len) == 0)
- break;
- }
- }
- if (last != NULL)
- *last = prev;
- return bucket;
-}
-
-/* in_array --- test whether the array element symbol[subs] exists or not,
- * return pointer to value if it does.
- */
-
-NODE *
-in_array(NODE *symbol, NODE *subs)
-{
- unsigned long hash1;
- NODE *ret;
-
- assert(symbol->type == Node_var_array);
-
- if (symbol->var_array == NULL)
- return NULL;
-
- hash1 = hash(subs->stptr, subs->stlen, (unsigned long) symbol->array_size, NULL);
- ret = assoc_find(symbol, subs, hash1, NULL);
- return (ret ? ret->ahvalue : NULL);
-}
-
-/*
- * assoc_lookup:
- * Find SYMBOL[SUBS] in the assoc array. Install it with value "" if it
- * isn't there. Returns a pointer ala get_lhs to where its value is stored.
- *
- * SYMBOL is the address of the node (or other pointer) being dereferenced.
- * SUBS is a number or string used as the subscript.
- */
-
-NODE **
-assoc_lookup(NODE *symbol, NODE *subs, int reference)
-{
- unsigned long hash1;
- NODE *bucket;
- size_t code;
-
- assert(symbol->type == Node_var_array);
-
- (void) force_string(subs);
-
- if (symbol->var_array == NULL) {
- symbol->array_size = symbol->table_size = 0; /* sanity */
- symbol->flags &= ~ARRAYMAXED;
- grow_table(symbol);
- hash1 = hash(subs->stptr, subs->stlen,
- (unsigned long) symbol->array_size, & code);
- } else {
- hash1 = hash(subs->stptr, subs->stlen,
- (unsigned long) symbol->array_size, & code);
- bucket = assoc_find(symbol, subs, hash1, NULL);
- if (bucket != NULL)
- return &(bucket->ahvalue);
- }
-
- if (do_lint && reference) {
- lintwarn(_("reference to uninitialized element `%s[\"%.*s\"]'"),
- array_vname(symbol), (int)subs->stlen, subs->stptr);
- }
-
- /* It's not there, install it. */
- if (do_lint && subs->stlen == 0)
- lintwarn(_("subscript of array `%s' is null string"),
- array_vname(symbol));
-
- /* first see if we would need to grow the array, before installing */
- symbol->table_size++;
- if ((symbol->flags & ARRAYMAXED) == 0
- && (symbol->table_size / symbol->array_size) > AVG_CHAIN_MAX) {
- grow_table(symbol);
- /* have to recompute hash value for new size */
- hash1 = code % (unsigned long) symbol->array_size;
- }
-
- getnode(bucket);
- bucket->type = Node_ahash;
-
- /*
- * Freeze this string value --- it must never
- * change, no matter what happens to the value
- * that created it or to CONVFMT, etc.
- *
- * One day: Use an atom table to track array indices,
- * and avoid the extra memory overhead.
- */
- bucket->flags |= MALLOC;
- bucket->ahname_ref = 1;
-
- emalloc(bucket->ahname_str, char *, subs->stlen + 2, "assoc_lookup");
- bucket->ahname_len = subs->stlen;
- memcpy(bucket->ahname_str, subs->stptr, subs->stlen);
- bucket->ahname_str[bucket->ahname_len] = '\0';
- bucket->ahvalue = Nnull_string;
-
- bucket->ahnext = symbol->var_array[hash1];
- bucket->ahcode = code;
-
- /*
- * Set the numeric value for the index if it's available. Useful
- * for numeric sorting by index. Do this only if the numeric
- * value is available, instead of all the time, since doing it
- * all the time is a big performance hit for something that may
- * never be used.
- */
- if ((subs->flags & NUMCUR) != 0) {
- bucket->ahname_num = subs->numbr;
- bucket->flags |= NUMIND;
- }
-
- /* hook it into the symbol table */
- symbol->var_array[hash1] = bucket;
- return &(bucket->ahvalue);
-}
-
-
/* adjust_fcall_stack: remove subarray(s) of symbol[] from
* function call stack.
*/
@@ -602,7 +479,7 @@ adjust_fcall_stack(NODE *symbol, int nsubs)
func = frame_ptr->func_node;
if (func == NULL) /* in main */
return;
- pcount = func->lnode->param_cnt;
+ pcount = func->param_cnt;
sp = frame_ptr->stack;
for (; pcount > 0; pcount--) {
@@ -627,12 +504,10 @@ adjust_fcall_stack(NODE *symbol, int nsubs)
* function f(c, d) { delete c; ..}
* BEGIN { a[0][0] = 1; f(a[0], a[0]); ...}
*/
- char *save;
-local_array:
- save = r->vname;
- memset(r, '\0', sizeof(NODE));
- r->vname = save;
- r->type = Node_var_array;
+
+ init_array(r);
+ r->parent_array = NULL;
+ r->flags = 0;
continue;
}
@@ -648,8 +523,10 @@ local_array:
* BEGIN { a[0][0][0][0] = 1; f(a[0], a[0][0][0]); .. }
*
*/
-
- goto local_array;
+ init_array(r);
+ r->parent_array = NULL;
+ r->flags = 0;
+ break;
}
}
}
@@ -660,18 +537,17 @@ local_array:
/*
* `symbol' is array
- * `nsubs' is number of subscripts
+ * `nsubs' is no of subscripts
*/
void
do_delete(NODE *symbol, int nsubs)
{
- unsigned long hash1 = 0;
- NODE *subs, *bucket, *last, *r;
+ NODE *val, *subs;
int i;
assert(symbol->type == Node_var_array);
- subs = bucket = last = r = NULL; /* silence the compiler */
+ subs = val = NULL; /* silence the compiler */
/*
* The force_string() call is needed to make sure that
@@ -683,16 +559,17 @@ do_delete(NODE *symbol, int nsubs)
* Without it, the code does not fail.
*/
-#define free_subs(n) \
-do { \
+#define free_subs(n) do { \
NODE *s = PEEK(n - 1); \
if (s->type == Node_val) { \
- (void) force_string(s); /* may have side effects ? */ \
+ (void) force_string(s); /* may have side effects. */ \
DEREF(s); \
} \
} while (--n > 0)
- if (nsubs == 0) { /* delete array */
+ if (nsubs == 0) {
+ /* delete array */
+
adjust_fcall_stack(symbol, 0); /* fix function call stack; See above. */
assoc_clear(symbol);
return;
@@ -706,66 +583,46 @@ do { \
free_subs(i);
fatal(_("attempt to use array `%s' in a scalar context"), array_vname(subs));
}
- (void) force_string(subs);
-
- last = NULL; /* shut up gcc -Wall */
- hash1 = 0; /* ditto */
- bucket = NULL; /* array may be empty */
-
- if (symbol->var_array != NULL) {
- hash1 = hash(subs->stptr, subs->stlen,
- (unsigned long) symbol->array_size, NULL);
- bucket = assoc_find(symbol, subs, hash1, &last);
- }
- if (bucket == NULL) {
- if (do_lint)
+ val = in_array(symbol, subs);
+ if (val == NULL) {
+ if (do_lint) {
+ subs = force_string(subs);
lintwarn(_("delete: index `%s' not in array `%s'"),
subs->stptr, array_vname(symbol));
+ }
/* avoid memory leak, free all subs */
free_subs(i);
return;
}
if (i > 1) {
- if (bucket->ahvalue->type != Node_var_array) {
+ if (val->type != Node_var_array) {
/* e.g.: a[1] = 1; delete a[1][1] */
+
free_subs(i);
+ subs = force_string(subs);
fatal(_("attempt to use scalar `%s[\"%.*s\"]' as an array"),
array_vname(symbol),
- (int) bucket->ahname_len,
- bucket->ahname_str);
+ (int) subs->stlen,
+ subs->stptr);
}
- symbol = bucket->ahvalue;
+ symbol = val;
+ DEREF(subs);
}
- DEREF(subs);
}
- r = bucket->ahvalue;
- if (r->type == Node_var_array) {
- adjust_fcall_stack(r, nsubs); /* fix function call stack; See above. */
- assoc_clear(r);
+ if (val->type == Node_var_array) {
+ adjust_fcall_stack(val, nsubs); /* fix function call stack; See above. */
+ assoc_clear(val);
/* cleared a sub-array, free Node_var_array */
- efree(r->vname);
- freenode(r);
+ efree(val->vname);
+ freenode(val);
} else
- unref(r);
+ unref(val);
- if (last != NULL)
- last->ahnext = bucket->ahnext;
- else
- symbol->var_array[hash1] = bucket->ahnext;
-
- unref(bucket); /* unref() will free the ahname_str */
- symbol->table_size--;
- if (symbol->table_size <= 0) {
- symbol->table_size = symbol->array_size = 0;
- symbol->flags &= ~ARRAYMAXED;
- if (symbol->var_array != NULL) {
- efree(symbol->var_array);
- symbol->var_array = NULL;
- }
- }
+ (void) assoc_remove(symbol, subs);
+ DEREF(subs);
#undef free_subs
}
@@ -782,272 +639,155 @@ do { \
void
do_delete_loop(NODE *symbol, NODE **lhs)
{
- long i;
-
- assert(symbol->type == Node_var_array);
+ NODE **list;
+ NODE fl;
- if (symbol->var_array == NULL)
+ if (array_empty(symbol))
return;
- /* get first index value */
- for (i = 0; i < symbol->array_size; i++) {
- if (symbol->var_array[i] != NULL) {
- unref(*lhs);
- *lhs = make_string(symbol->var_array[i]->ahname_str,
- symbol->var_array[i]->ahname_len);
- break;
- }
- }
+ fl.flags = AINDEX|ADELETE; /* need a single index */
+ list = symbol->alist(symbol, & fl);
+ assert(list != NULL);
+
+ unref(*lhs);
+ *lhs = list[0];
+ efree(list);
/* blast the array in one shot */
- adjust_fcall_stack(symbol, 0);
+ adjust_fcall_stack(symbol, 0);
assoc_clear(symbol);
}
-/* grow_table --- grow a hash table */
+
+/* value_info --- print scalar node info */
static void
-grow_table(NODE *symbol)
+value_info(NODE *n)
{
- NODE **old, **new, *chain, *next;
- int i, j;
- unsigned long hash1;
- unsigned long oldsize, newsize, k;
- /*
- * This is an array of primes. We grow the table by an order of
- * magnitude each time (not just doubling) so that growing is a
- * rare operation. We expect, on average, that it won't happen
- * more than twice. When things are very large (> 8K), we just
- * double more or less, instead of just jumping from 8K to 64K.
- */
- static const long sizes[] = {
- 13, 127, 1021, 8191, 16381, 32749, 65497, 131101, 262147,
- 524309, 1048583, 2097169, 4194319, 8388617, 16777259, 33554467,
- 67108879, 134217757, 268435459, 536870923, 1073741827
- };
-
- /* find next biggest hash size */
- newsize = oldsize = symbol->array_size;
- for (i = 0, j = sizeof(sizes)/sizeof(sizes[0]); i < j; i++) {
- if (oldsize < sizes[i]) {
- newsize = sizes[i];
- break;
- }
- }
- if (newsize == oldsize) { /* table already at max (!) */
- symbol->flags |= ARRAYMAXED;
+#define PREC_NUM -1
+#define PREC_STR -1
+
+ if (n == Nnull_string || n == Null_field) {
+ fprintf(output_fp, "<(null)>");
return;
}
- /* allocate new table */
- emalloc(new, NODE **, newsize * sizeof(NODE *), "grow_table");
- memset(new, '\0', newsize * sizeof(NODE *));
-
- /* brand new hash table, set things up and return */
- if (symbol->var_array == NULL) {
- symbol->table_size = 0;
- goto done;
+ if ((n->flags & (STRING|STRCUR)) != 0) {
+ fprintf(output_fp, "<");
+ fprintf(output_fp, "\"%.*s\"", PREC_STR, n->stptr);
+ if ((n->flags & (NUMBER|NUMCUR)) != 0) {
+#ifdef HAVE_MPFR
+ if (is_mpg_float(n))
+ fprintf(output_fp, ":%s",
+ mpg_fmt("%.*R*g", PREC_NUM, ROUND_MODE, n->mpg_numbr));
+ else if (is_mpg_integer(n))
+ fprintf(output_fp, ":%s", mpg_fmt("%Zd", n->mpg_i));
+ else
+#endif
+ fprintf(output_fp, ":%.*g", PREC_NUM, n->numbr);
+ }
+ fprintf(output_fp, ">");
+ } else {
+#ifdef HAVE_MPFR
+ if (is_mpg_float(n))
+ fprintf(output_fp, "<%s>",
+ mpg_fmt("%.*R*g", PREC_NUM, ROUND_MODE, n->mpg_numbr));
+ else if (is_mpg_integer(n))
+ fprintf(output_fp, "<%s>", mpg_fmt("%Zd", n->mpg_i));
+ else
+#endif
+ fprintf(output_fp, "<%.*g>", PREC_NUM, n->numbr);
}
- /* old hash table there, move stuff to new, free old */
- old = symbol->var_array;
- for (k = 0; k < oldsize; k++) {
- if (old[k] == NULL)
- continue;
+ fprintf(output_fp, ":%s", flags2str(n->flags));
- for (chain = old[k]; chain != NULL; chain = next) {
- next = chain->ahnext;
- hash1 = chain->ahcode % newsize;
+ if ((n->flags & FIELD) == 0)
+ fprintf(output_fp, ":%ld", n->valref);
+ else
+ fprintf(output_fp, ":");
- /* remove from old list, add to new */
- chain->ahnext = new[hash1];
- new[hash1] = chain;
- }
+ if ((n->flags & (STRING|STRCUR)) == STRCUR) {
+ fprintf(output_fp, "][");
+ fprintf(output_fp, "stfmt=%d, ", n->stfmt);
+ fprintf(output_fp, "CONVFMT=\"%s\"", n->stfmt <= -1 ? "%ld"
+ : fmt_list[n->stfmt]->stptr);
}
- efree(old);
-done:
- /*
- * note that symbol->table_size does not change if an old array,
- * and is explicitly set to 0 if a new one.
- */
- symbol->var_array = new;
- symbol->array_size = newsize;
-}
-
-/* pr_node --- print simple node info */
-
-static void
-pr_node(NODE *n)
-{
- if ((n->flags & NUMBER) != 0)
- printf("%s %g p: %p", flags2str(n->flags), n->numbr, (void *) n);
- else
- printf("%s %.*s p: %p", flags2str(n->flags),
- (int) n->stlen, n->stptr, (void *) n);
+#undef PREC_NUM
+#undef PREC_STR
}
-static void
+void
indent(int indent_level)
{
- int k;
- for (k = 0; k < indent_level; k++)
- putchar('\t');
+ int i;
+ for (i = 0; i < indent_level; i++)
+ fprintf(output_fp, "%s", indent_char);
}
-/* assoc_dump --- dump the contents of an array */
+/* assoc_info --- print index, value info */
-NODE *
-assoc_dump(NODE *symbol, int indent_level)
+void
+assoc_info(NODE *subs, NODE *val, NODE *ndump, const char *aname)
{
- long i;
- NODE *bucket;
+ int indent_level = ndump->alevel;
+ indent_level++;
indent(indent_level);
- if (symbol->var_array == NULL) {
- printf(_("%s: empty (null)\n"), symbol->vname);
- return make_number((AWKNUM) 0);
- }
-
- if (symbol->table_size == 0) {
- printf(_("%s: empty (zero)\n"), symbol->vname);
- return make_number((AWKNUM) 0);
- }
+ fprintf(output_fp, "I: [%s:", aname);
+ if ((subs->flags & (MPFN|MPZN|INTIND)) == INTIND)
+ fprintf(output_fp, "<%ld>", (long) subs->numbr);
+ else
+ value_info(subs);
+ fprintf(output_fp, "]\n");
- printf(_("%s: table_size = %d, array_size = %d\n"), symbol->vname,
- (int) symbol->table_size, (int) symbol->array_size);
-
- for (i = 0; i < symbol->array_size; i++) {
- for (bucket = symbol->var_array[i]; bucket != NULL;
- bucket = bucket->ahnext) {
- indent(indent_level);
- printf("%s: I: [len %d <%.*s> p: %p] V: [",
- symbol->vname,
- (int) bucket->ahname_len,
- (int) bucket->ahname_len,
- bucket->ahname_str,
- bucket->ahname_str);
- if (bucket->ahvalue->type == Node_var_array) {
- printf("\n");
- assoc_dump(bucket->ahvalue, indent_level + 1);
- indent(indent_level);
- } else
- pr_node(bucket->ahvalue);
- printf("]\n");
- }
+ indent(indent_level);
+ if (val->type == Node_val) {
+ fprintf(output_fp, "V: [scalar: ");
+ value_info(val);
+ } else {
+ fprintf(output_fp, "V: [");
+ ndump->alevel++;
+ ndump->adepth--;
+ assoc_dump(val, ndump);
+ ndump->adepth++;
+ ndump->alevel--;
+ indent(indent_level);
}
-
- return make_number((AWKNUM) 0);
+ fprintf(output_fp, "]\n");
}
+
/* do_adump --- dump an array: interface to assoc_dump */
NODE *
do_adump(int nargs)
{
- NODE *r, *a;
-
- a = POP();
- if (a->type == Node_param_list) {
- printf(_("%s: is parameter\n"), a->vname);
- a = GET_PARAM(a->param_cnt);
- }
- if (a->type == Node_array_ref) {
- printf(_("%s: array_ref to %s\n"), a->vname,
- a->orig_array->vname);
- a = a->orig_array;
- }
- if (a->type != Node_var_array)
- fatal(_("adump: argument not an array"));
- r = assoc_dump(a, 0);
- return r;
-}
-
-/*
- * The following functions implement the builtin
- * asort function. Initial work by Alan J. Broder,
- * ajb@woti.com.
- */
+ NODE *symbol, *tmp;
+ static NODE ndump;
+ long depth = 0;
-/* dup_table --- recursively duplicate input array "symbol" */
+ /* depth < 0, no index and value info.
+ * = 0, main array index and value info; does not descend into sub-arrays.
+ * > 0, descends into 'depth' sub-arrays, and prints index and value info.
+ */
-static NODE *
-dup_table(NODE *symbol, NODE *newsymb)
-{
- NODE **old, **new, *chain, *bucket;
- long i;
- unsigned long cursize;
-
- /* find the current hash size */
- cursize = symbol->array_size;
-
- new = NULL;
-
- /* input is a brand new hash table, so there's nothing to copy */
- if (symbol->var_array == NULL)
- newsymb->table_size = 0;
- else {
- /* old hash table there, dupnode stuff into a new table */
-
- /* allocate new table */
- emalloc(new, NODE **, cursize * sizeof(NODE *), "dup_table");
- memset(new, '\0', cursize * sizeof(NODE *));
-
- /* do the copying/dupnode'ing */
- old = symbol->var_array;
- for (i = 0; i < cursize; i++) {
- if (old[i] != NULL) {
- for (chain = old[i]; chain != NULL;
- chain = chain->ahnext) {
- /* get a node for the linked list */
- getnode(bucket);
- bucket->type = Node_ahash;
- bucket->flags |= MALLOC;
- bucket->ahname_ref = 1;
- bucket->ahcode = chain->ahcode;
- if ((chain->flags & NUMIND) != 0) {
- bucket->ahname_num = chain->ahname_num;
- bucket->flags |= NUMIND;
- }
-
- /*
- * copy the corresponding name and
- * value from the original input list
- */
- emalloc(bucket->ahname_str, char *, chain->ahname_len + 2, "dup_table");
- bucket->ahname_len = chain->ahname_len;
-
- memcpy(bucket->ahname_str, chain->ahname_str, chain->ahname_len);
- bucket->ahname_str[bucket->ahname_len] = '\0';
-
- if (chain->ahvalue->type == Node_var_array) {
- NODE *r;
- getnode(r);
- r->type = Node_var_array;
- r->vname = estrdup(chain->ahname_str, chain->ahname_len);
- r->parent_array = newsymb;
- bucket->ahvalue = dup_table(chain->ahvalue, r);
- } else
- bucket->ahvalue = dupnode(chain->ahvalue);
-
- /*
- * put the node on the corresponding
- * linked list in the new table
- */
- bucket->ahnext = new[i];
- new[i] = bucket;
- }
- }
- }
- newsymb->table_size = symbol->table_size;
+ if (nargs == 2) {
+ tmp = POP_NUMBER();
+ depth = get_number_si(tmp);
+ DEREF(tmp);
}
-
- newsymb->var_array = new;
- newsymb->array_size = cursize;
- newsymb->flags = symbol->flags; /* ARRAYMAXED */
- return newsymb;
+ symbol = POP_PARAM();
+ if (symbol->type != Node_var_array)
+ fatal(_("adump: first argument not an array"));
+
+ ndump.type = Node_dump_array;
+ ndump.adepth = depth;
+ ndump.alevel = 0;
+ assoc_dump(symbol, & ndump);
+ return make_number((AWKNUM) 0);
}
@@ -1058,16 +798,14 @@ asort_actual(int nargs, SORT_CTXT ctxt)
{
NODE *array, *dest = NULL, *result;
NODE *r, *subs, *s;
- NODE **list, **ptr;
-#define TSIZE 100 /* an arbitrary amount */
- static char buf[TSIZE+2];
+ NODE **list = NULL, **ptr;
unsigned long num_elems, i;
const char *sort_str;
if (nargs == 3) /* 3rd optional arg */
s = POP_STRING();
else
- s = Nnull_string; /* "" => default sorting */
+ s = dupnode(Nnull_string); /* "" => default sorting */
s = force_string(s);
sort_str = s->stptr;
@@ -1078,7 +816,6 @@ asort_actual(int nargs, SORT_CTXT ctxt)
sort_str = "@ind_str_asc";
}
-
if (nargs >= 2) { /* 2nd optional arg */
dest = POP_PARAM();
if (dest->type != Node_var_array) {
@@ -1107,20 +844,21 @@ asort_actual(int nargs, SORT_CTXT ctxt)
fatal(ctxt == ASORT ?
_("asort: cannot use a subarray of second arg for first arg") :
_("asorti: cannot use a subarray of second arg for first arg"));
- }
+ }
}
num_elems = array->table_size;
- if (num_elems == 0 || array->var_array == NULL) { /* source array is empty */
- if (dest != NULL && dest != array)
- assoc_clear(dest);
- return make_number((AWKNUM) 0);
- }
-
- /* sorting happens inside assoc_list */
- list = assoc_list(array, sort_str, ctxt);
+ if (num_elems > 0) /* sorting happens inside assoc_list */
+ list = assoc_list(array, sort_str, ctxt);
DEREF(s);
+ if (num_elems == 0 || list == NULL) {
+ /* source array is empty */
+ if (dest != NULL && dest != array)
+ assoc_clear(dest);
+ return make_number((AWKNUM) 0);
+ }
+
/*
* Must not assoc_clear() the source array before constructing
* the output array. assoc_list() does not duplicate array values
@@ -1132,70 +870,48 @@ asort_actual(int nargs, SORT_CTXT ctxt)
result = dest;
} else {
/* use 'result' as a temporary destination array */
- getnode(result);
- memset(result, '\0', sizeof(NODE));
- result->type = Node_var_array;
+ result = make_array();
result->vname = array->vname;
result->parent_array = array->parent_array;
}
- subs = make_str_node(buf, TSIZE, ALREADY_MALLOCED); /* fake it */
- subs->flags &= ~MALLOC; /* safety */
- for (i = 1, ptr = list; i <= num_elems; i++) {
- sprintf(buf, "%lu", i);
- subs->stlen = strlen(buf);
- /* make number valid in case this array gets sorted later */
- subs->numbr = i;
- subs->flags |= NUMCUR;
- r = *ptr++;
- if (ctxt == ASORTI) {
- /*
- * We want the indices of the source array as values
- * of the 'result' array.
- */
- *assoc_lookup(result, subs, FALSE) =
- make_string(r->ahname_str, r->ahname_len);
- } else {
- NODE *val;
-
- /* We want the values of the source array. */
-
- val = r->ahvalue;
- if (result != dest) {
- /* optimization for dest = NULL or dest = array */
-
- if (val->type == Node_var_array) {
- /* update subarray index in parent array */
- efree(val->vname);
- val->vname = estrdup(subs->stptr, subs->stlen);
- }
- *assoc_lookup(result, subs, FALSE) = val;
- r->ahvalue = Nnull_string;
- } else {
- if (val->type == Node_val)
- *assoc_lookup(result, subs, FALSE) = dupnode(val);
- else {
- NODE *arr;
-
- /*
- * There isn't any reference counting for
- * subarrays, so recursively copy subarrays
- * using dup_table().
- */
- getnode(arr);
- arr->type = Node_var_array;
- arr->var_array = NULL;
- arr->vname = estrdup(subs->stptr, subs->stlen);
- arr->parent_array = array; /* actual parent, not the temporary one. */
- *assoc_lookup(result, subs, FALSE) = dup_table(val, arr);
- }
+ if (ctxt == ASORTI) {
+ /* We want the indices of the source array. */
+
+ for (i = 1, ptr = list; i <= num_elems; i++, ptr += 2) {
+ subs = make_number(i);
+ *assoc_lookup(result, subs) = *ptr;
+ unref(subs);
+ }
+ } else {
+ /* We want the values of the source array. */
+
+ for (i = 1, ptr = list; i <= num_elems; i++) {
+ subs = make_number(i);
+
+ /* free index node */
+ r = *ptr++;
+ unref(r);
+
+ /* value node */
+ r = *ptr++;
+
+ if (r->type == Node_val)
+ *assoc_lookup(result, subs) = dupnode(r);
+ else {
+ NODE *arr;
+ arr = make_array();
+ subs = force_string(subs);
+ arr->vname = subs->stptr;
+ subs->stptr = NULL;
+ subs->flags &= ~STRCUR;
+ arr->parent_array = array; /* actual parent, not the temporary one. */
+ *assoc_lookup(result, subs) = assoc_copy(r, arr);
}
+ unref(subs);
}
+ }
- unref(r);
- }
-
- freenode(subs); /* stptr(buf) not malloc-ed */
efree(list);
if (result != dest) {
@@ -1209,7 +925,6 @@ asort_actual(int nargs, SORT_CTXT ctxt)
return make_number((AWKNUM) num_elems);
}
-#undef TSIZE
/* do_asort --- sort array by value */
@@ -1227,32 +942,25 @@ do_asorti(int nargs)
return asort_actual(nargs, ASORTI);
}
+
/*
- * cmp_string --- compare two strings; logic similar to cmp_nodes() in eval.c
+ * cmp_strings --- compare two strings; logic similar to cmp_nodes() in eval.c
* except the extra case-sensitive comparison when the case-insensitive
* result is a match.
*/
static int
-cmp_string(const NODE *n1, const NODE *n2)
+cmp_strings(const NODE *n1, const NODE *n2)
{
char *s1, *s2;
size_t len1, len2;
int ret;
size_t lmin;
- assert(n1->type == n2->type);
- if (n1->type == Node_ahash) {
- s1 = n1->ahname_str;
- len1 = n1->ahname_len;
- s2 = n2->ahname_str;
- len2 = n2->ahname_len;
- } else {
- s1 = n1->stptr;
- len1 = n1->stlen;
- s2 = n2->stptr;
- len2 = n2->stlen;
- }
+ s1 = n1->stptr;
+ len1 = n1->stlen;
+ s2 = n2->stptr;
+ len2 = n2->stlen;
if (len1 == 0)
return len2 == 0 ? 0 : -1;
@@ -1288,7 +996,6 @@ cmp_string(const NODE *n1, const NODE *n2)
return (len1 < len2) ? -1 : 1;
}
-
/* sort_up_index_string --- qsort comparison function; ascending index strings. */
static int
@@ -1299,11 +1006,11 @@ sort_up_index_string(const void *p1, const void *p2)
/* Array indices are strings */
t1 = *((const NODE *const *) p1);
t2 = *((const NODE *const *) p2);
- return cmp_string(t1, t2);
+ return cmp_strings(t1, t2);
}
-/* sort_down_index_string --- descending index strings */
+/* sort_down_index_str --- qsort comparison function; descending index strings. */
static int
sort_down_index_string(const void *p1, const void *p2)
@@ -1326,24 +1033,22 @@ sort_down_index_string(const void *p1, const void *p2)
static int
sort_up_index_number(const void *p1, const void *p2)
{
- const NODE *n1, *n2;
+ const NODE *t1, *t2;
int ret;
- n1 = *((const NODE *const *) p1);
- n2 = *((const NODE *const *) p2);
+ t1 = *((const NODE *const *) p1);
+ t2 = *((const NODE *const *) p2);
- if (n1->ahname_num < n2->ahname_num)
- ret = -1;
- else
- ret = (n1->ahname_num > n2->ahname_num);
+ ret = cmp_numbers(t1, t2);
+ if (ret != 0)
+ return ret;
/* break a tie with the index string itself */
- if (ret == 0)
- return cmp_string(n1, n2);
- return ret;
+ t1 = force_string((NODE *) t1);
+ t2 = force_string((NODE *) t2);
+ return cmp_strings(t1, t2);
}
-
/* sort_down_index_number --- qsort comparison function; descending index numbers */
static int
@@ -1359,29 +1064,23 @@ static int
sort_up_value_string(const void *p1, const void *p2)
{
const NODE *t1, *t2;
- NODE *n1, *n2;
-
- /* we're passed a pair of index (array subscript) nodes */
- t1 = *(const NODE *const *) p1;
- t2 = *(const NODE *const *) p2;
- /* and we want to compare the element values they refer to */
- n1 = t1->ahvalue;
- n2 = t2->ahvalue;
+ t1 = *((const NODE *const *) p1 + 1);
+ t2 = *((const NODE *const *) p2 + 1);
- if (n1->type == Node_var_array) {
- /* return 0 if n2 is a sub-array too, else return 1 */
- return (n2->type != Node_var_array);
+ if (t1->type == Node_var_array) {
+ /* return 0 if t2 is a sub-array too, else return 1 */
+ return (t2->type != Node_var_array);
}
- if (n2->type == Node_var_array)
- return -1; /* n1 (scalar) < n2 (sub-array) */
+ if (t2->type == Node_var_array)
+ return -1; /* t1 (scalar) < t2 (sub-array) */
- /* n1 and n2 both have string values; See sort_force_value_string(). */
- return cmp_string(n1, n2);
+ /* t1 and t2 both have string values */
+ return cmp_strings(t1, t2);
}
-/* sort_down_value_string --- descending value string */
+/* sort_down_value_string --- qsort comparison function; descending value string */
static int
sort_down_value_string(const void *p1, const void *p2)
@@ -1389,50 +1088,40 @@ sort_down_value_string(const void *p1, const void *p2)
return -sort_up_value_string(p1, p2);
}
+
/* sort_up_value_number --- qsort comparison function; ascending value number */
static int
sort_up_value_number(const void *p1, const void *p2)
{
- const NODE *t1, *t2;
- NODE *n1, *n2;
+ NODE *t1, *t2;
int ret;
- /* we're passed a pair of index (array subscript) nodes */
- t1 = *(const NODE *const *) p1;
- t2 = *(const NODE *const *) p2;
-
- /* and we want to compare the element values they refer to */
- n1 = t1->ahvalue;
- n2 = t2->ahvalue;
+ t1 = *((NODE *const *) p1 + 1);
+ t2 = *((NODE *const *) p2 + 1);
- if (n1->type == Node_var_array) {
- /* return 0 if n2 is a sub-array too, else return 1 */
- return (n2->type != Node_var_array);
+ if (t1->type == Node_var_array) {
+ /* return 0 if t2 is a sub-array too, else return 1 */
+ return (t2->type != Node_var_array);
}
- if (n2->type == Node_var_array)
- return -1; /* n1 (scalar) < n2 (sub-array) */
-
- /* n1 and n2 both Node_val, and force_number'ed */
- if (n1->numbr < n2->numbr)
- ret = -1;
- else
- ret = (n1->numbr > n2->numbr);
+ if (t2->type == Node_var_array)
+ return -1; /* t1 (scalar) < t2 (sub-array) */
- if (ret == 0) {
- /*
- * Use string value to guarantee same sort order on all
- * versions of qsort().
- */
- n1 = force_string(n1);
- n2 = force_string(n2);
- ret = cmp_string(n1, n2);
- }
+ ret = cmp_numbers(t1, t2);
+ if (ret != 0)
+ return ret;
- return ret;
+ /*
+ * Use string value to guarantee same sort order on all
+ * versions of qsort().
+ */
+ t1 = force_string(t1);
+ t2 = force_string(t2);
+ return cmp_strings(t1, t2);
}
-/* sort_down_value_number --- descending value number */
+
+/* sort_down_value_number --- qsort comparison function; descending value number */
static int
sort_down_value_number(const void *p1, const void *p2)
@@ -1440,21 +1129,17 @@ sort_down_value_number(const void *p1, const void *p2)
return -sort_up_value_number(p1, p2);
}
+
/* sort_up_value_type --- qsort comparison function; ascending value type */
static int
sort_up_value_type(const void *p1, const void *p2)
{
- const NODE *t1, *t2;
NODE *n1, *n2;
- /* we're passed a pair of index (array subscript) nodes */
- t1 = *(const NODE *const *) p1;
- t2 = *(const NODE *const *) p2;
-
- /* and we want to compare the element values they refer to */
- n1 = t1->ahvalue;
- n2 = t2->ahvalue;
+ /* we want to compare the element values */
+ n1 = *((NODE *const *) p1 + 1);
+ n2 = *((NODE *const *) p2 + 1);
/* 1. Arrays vs. scalar, scalar is less than array */
if (n1->type == Node_var_array) {
@@ -1472,13 +1157,14 @@ sort_up_value_type(const void *p1, const void *p2)
if ((n2->flags & MAYBE_NUM) != 0)
(void) force_number(n2);
+ /* 2.5. Resolve INTIND, so that is STRING, and not NUMBER */
+ if ((n1->flags & INTIND) != 0)
+ (void) force_string(n1);
+ if ((n2->flags & INTIND) != 0)
+ (void) force_string(n2);
+
if ((n1->flags & NUMBER) != 0 && (n2->flags & NUMBER) != 0) {
- if (n1->numbr < n2->numbr)
- return -1;
- else if (n1->numbr > n2->numbr)
- return 1;
- else
- return 0;
+ return cmp_numbers(n1, n2);
}
/* 3. All numbers are less than all strings. This is aribitrary. */
@@ -1489,10 +1175,10 @@ sort_up_value_type(const void *p1, const void *p2)
}
/* 4. Two strings */
- return cmp_string(n1, n2);
+ return cmp_strings(n1, n2);
}
-/* sort_down_value_type --- descending value type */
+/* sort_down_value_type --- qsort comparison function; descending value type */
static int
sort_down_value_type(const void *p1, const void *p2)
@@ -1505,147 +1191,120 @@ sort_down_value_type(const void *p1, const void *p2)
static int
sort_user_func(const void *p1, const void *p2)
{
- const NODE *t1, *t2;
- NODE *idx1, *idx2, *val1, *val2;
- AWKNUM ret;
+ NODE *idx1, *idx2, *val1, *val2, *r;
+ int ret;
INSTRUCTION *code;
- t1 = *((const NODE *const *) p1);
- t2 = *((const NODE *const *) p2);
-
- idx1 = make_string(t1->ahname_str, t1->ahname_len);
- idx2 = make_string(t2->ahname_str, t2->ahname_len);
- val1 = t1->ahvalue;
- val2 = t2->ahvalue;
+ idx1 = *((NODE *const *) p1);
+ idx2 = *((NODE *const *) p2);
+ val1 = *((NODE *const *) p1 + 1);
+ val2 = *((NODE *const *) p2 + 1);
code = TOP()->code_ptr; /* comparison function call instructions */
/* setup 4 arguments to comp_func() */
+ UPREF(idx1);
PUSH(idx1);
if (val1->type == Node_val)
UPREF(val1);
PUSH(val1);
+
+ UPREF(idx2);
PUSH(idx2);
if (val2->type == Node_val)
UPREF(val2);
PUSH(val2);
/* execute the comparison function */
- (void) interpret(code);
+ (void) (*interpret)(code);
/* return value of the comparison function */
- POP_NUMBER(ret);
-
- return (ret < 0.0) ? -1 : (ret > 0.0);
-}
-
-/* sort_force_index_number -- pre-process list items for sorting indices as numbers */
-
-static void
-sort_force_index_number(NODE **list, size_t num_elems)
-{
- size_t i;
- NODE *r;
- static NODE temp_node;
-
- for (i = 0; i < num_elems; i++) {
- r = list[i];
-
- if ((r->flags & NUMIND) != 0) /* once in a lifetime is plenty */
- continue;
- temp_node.type = Node_val;
- temp_node.stptr = r->ahname_str;
- temp_node.stlen = r->ahname_len;
- temp_node.flags = 0; /* only interested in the return value of r_force_number */
- r->ahname_num = r_force_number(& temp_node);
- r->flags |= NUMIND;
- }
-}
-
-/* sort_force_value_number -- pre-process list items for sorting values as numbers */
-
-static void
-sort_force_value_number(NODE **list, size_t num_elems)
-{
- size_t i;
- NODE *r, *val;
-
- for (i = 0; i < num_elems; i++) {
- r = list[i];
- val = r->ahvalue;
- if (val->type == Node_val)
- (void) force_number(val);
- }
+ r = POP_NUMBER();
+#ifdef HAVE_MPFR
+ /*
+ * mpfr_sgn(mpz_sgn): Returns a positive value if op > 0,
+ * zero if op = 0, and a negative value if op < 0.
+ */
+ if (is_mpg_float(r))
+ ret = mpfr_sgn(r->mpg_numbr);
+ else if (is_mpg_integer(r))
+ ret = mpz_sgn(r->mpg_i);
+ else
+#endif
+ ret = (r->numbr < 0.0) ? -1 : (r->numbr > 0.0);
+ DEREF(r);
+ return ret;
}
-/* sort_force_value_string -- pre-process list items for sorting values as strings */
-
-static void
-sort_force_value_string(NODE **list, size_t num_elems)
-{
- size_t i;
- NODE *r, *val;
-
- for (i = 0; i < num_elems; i++) {
- r = list[i];
- val = r->ahvalue;
- if (val->type == Node_val)
- r->ahvalue = force_string(val);
- }
-}
/* assoc_list -- construct, and optionally sort, a list of array elements */
NODE **
-assoc_list(NODE *array, const char *sort_str, SORT_CTXT sort_ctxt)
+assoc_list(NODE *symbol, const char *sort_str, SORT_CTXT sort_ctxt)
{
- typedef void (*qsort_prefunc)(NODE **, size_t);
typedef int (*qsort_compfunc)(const void *, const void *);
static const struct qsort_funcs {
const char *name;
qsort_compfunc comp_func;
- qsort_prefunc pre_func; /* pre-processing of list items */
+ enum assoc_list_flags flags;
} sort_funcs[] = {
- { "@ind_str_asc", sort_up_index_string, 0 },
- { "@ind_num_asc", sort_up_index_number, sort_force_index_number },
- { "@val_str_asc", sort_up_value_string, sort_force_value_string },
- { "@val_num_asc", sort_up_value_number, sort_force_value_number },
- { "@ind_str_desc", sort_down_index_string, 0 },
- { "@ind_num_desc", sort_down_index_number, sort_force_index_number },
- { "@val_str_desc", sort_down_value_string, sort_force_value_string },
- { "@val_num_desc", sort_down_value_number, sort_force_value_number },
- { "@val_type_asc", sort_up_value_type, 0 },
- { "@val_type_desc", sort_down_value_type, 0 },
- { "@unsorted", 0, 0 },
- };
+{ "@ind_str_asc", sort_up_index_string, AINDEX|AISTR|AASC },
+{ "@ind_num_asc", sort_up_index_number, AINDEX|AINUM|AASC },
+{ "@val_str_asc", sort_up_value_string, AVALUE|AVSTR|AASC },
+{ "@val_num_asc", sort_up_value_number, AVALUE|AVNUM|AASC },
+{ "@ind_str_desc", sort_down_index_string, AINDEX|AISTR|ADESC },
+{ "@ind_num_desc", sort_down_index_number, AINDEX|AINUM|ADESC },
+{ "@val_str_desc", sort_down_value_string, AVALUE|AVSTR|ADESC },
+{ "@val_num_desc", sort_down_value_number, AVALUE|AVNUM|ADESC },
+{ "@val_type_asc", sort_up_value_type, AVALUE|AASC },
+{ "@val_type_desc", sort_down_value_type, AVALUE|ADESC },
+{ "@unsorted", 0, AINDEX },
+};
+
+ /* N.B.: AASC and ADESC are hints to the specific array types.
+ * See cint_list() in cint_array.c.
+ */
+
NODE **list;
- NODE *r;
- size_t num_elems, i, j;
+ NODE fl;
+ unsigned long num_elems, j;
+ int elem_size, qi;
qsort_compfunc cmp_func = 0;
- qsort_prefunc pre_func = 0;
INSTRUCTION *code = NULL;
- int qi;
extern int currule;
+ int save_rule = 0;
- num_elems = array->table_size;
- assert(num_elems > 0);
+ num_elems = symbol->table_size;
+ if (num_elems == 0)
+ return NULL;
+
+ elem_size = 1;
+ fl.flags = 0;
for (qi = 0, j = sizeof(sort_funcs)/sizeof(sort_funcs[0]); qi < j; qi++) {
if (strcmp(sort_funcs[qi].name, sort_str) == 0)
break;
}
- if (qi >= 0 && qi < j) {
+ if (qi < j) {
cmp_func = sort_funcs[qi].comp_func;
- pre_func = sort_funcs[qi].pre_func;
+ fl.flags = sort_funcs[qi].flags;
+
+ if (symbol->array_funcs != cint_array_func)
+ fl.flags &= ~(AASC|ADESC);
+
+ if (sort_ctxt != SORTED_IN || (fl.flags & AVALUE) != 0) {
+ /* need index and value pair in the list */
- } else { /* unrecognized */
+ fl.flags |= (AINDEX|AVALUE);
+ elem_size = 2;
+ }
+
+ } else { /* unrecognized */
NODE *f;
const char *sp;
- assert(sort_str != NULL);
-
for (sp = sort_str; *sp != '\0'
&& ! isspace((unsigned char) *sp); sp++)
continue;
@@ -1659,7 +1318,10 @@ assoc_list(NODE *array, const char *sort_str, SORT_CTXT sort_ctxt)
fatal(_("sort comparison function `%s' is not defined"), sort_str);
cmp_func = sort_user_func;
- /* pre_func is still NULL */
+
+ /* need index and value pair in the list */
+ fl.flags |= (AVALUE|AINDEX);
+ elem_size = 2;
/* make function call instructions */
code = bcalloc(Op_func_call, 2, 0);
@@ -1673,103 +1335,35 @@ assoc_list(NODE *array, const char *sort_str, SORT_CTXT sort_ctxt)
* to undefined (0).
*/
- (code + 1)->inrule = currule; /* save current rule */
+ save_rule = currule; /* save current rule */
currule = 0;
PUSH_CODE(code);
}
- /* allocate space for array; the extra space is used in for(i in a) opcode (eval.c) */
- emalloc(list, NODE **, (num_elems + 1) * sizeof(NODE *), "assoc_list");
-
- /* populate it */
- for (i = j = 0; i < array->array_size; i++)
- for (r = array->var_array[i]; r != NULL; r = r->ahnext)
- list[j++] = dupnode(r);
- list[num_elems] = NULL;
-
- if (! cmp_func) /* unsorted */
- return list;
+ list = symbol->alist(symbol, & fl);
- /* special pre-processing of list items */
- if (pre_func)
- pre_func(list, num_elems);
+ if (list == NULL || ! cmp_func || (fl.flags & (AASC|ADESC)) != 0)
+ return list; /* empty list or unsorted, or list already sorted */
- qsort(list, num_elems, sizeof(NODE *), cmp_func); /* shazzam! */
+ qsort(list, num_elems, elem_size * sizeof(NODE *), cmp_func); /* shazzam! */
if (cmp_func == sort_user_func) {
code = POP_CODE();
- currule = (code + 1)->inrule; /* restore current rule */
+ currule = save_rule; /* restore current rule */
bcfree(code->nexti); /* Op_stop */
bcfree(code); /* Op_func_call */
}
- return list;
-}
-
-
-/*
-From bonzini@gnu.org Mon Oct 28 16:05:26 2002
-Date: Mon, 28 Oct 2002 13:33:03 +0100
-From: Paolo Bonzini <bonzini@gnu.org>
-To: arnold@skeeve.com
-Subject: Hash function
-Message-ID: <20021028123303.GA6832@biancaneve>
-
-Here is the hash function I'm using in GNU Smalltalk. The scrambling is
-needed if you use powers of two as the table sizes. If you use primes it
-is not needed.
-
-To use double-hashing with power-of-two size, you should use the
-_gst_hash_string(str, len) as the primary hash and
-scramble(_gst_hash_string (str, len)) | 1 as the secondary hash.
-
-Paolo
-
-*/
-/*
- * ADR: Slightly modified to work w/in the context of gawk.
- */
-
-static unsigned long
-gst_hash_string(const char *str, size_t len, unsigned long hsize, size_t *code)
-{
- unsigned long hashVal = 1497032417; /* arbitrary value */
- unsigned long ret;
-
- while (len--) {
- hashVal += *str++;
- hashVal += (hashVal << 10);
- hashVal ^= (hashVal >> 6);
- }
-
- ret = scramble(hashVal);
+ if (sort_ctxt == SORTED_IN && (fl.flags & (AINDEX|AVALUE)) == (AINDEX|AVALUE)) {
+ /* relocate all index nodes to the first half of the list. */
+ for (j = 1; j < num_elems; j++)
+ list[j] = list[2 * j];
- if (code != NULL)
- *code = ret;
+ /* give back extra memory */
- if (ret >= hsize)
- ret %= hsize;
-
- return ret;
-}
-
-static unsigned long
-scramble(unsigned long x)
-{
- if (sizeof(long) == 4) {
- int y = ~x;
-
- x += (y << 10) | (y >> 22);
- x += (x << 6) | (x >> 26);
- x -= (x << 16) | (x >> 16);
- } else {
- x ^= (~x) >> 31;
- x += (x << 21) | (x >> 11);
- x += (x << 5) | (x >> 27);
- x += (x << 27) | (x >> 5);
- x += (x << 31);
+ erealloc(list, NODE **, num_elems * sizeof(NODE *), "assoc_list");
}
- return x;
+ return list;
}
diff --git a/awk.h b/awk.h
index 0a0ac136..2aa944c9 100644
--- a/awk.h
+++ b/awk.h
@@ -117,6 +117,16 @@ extern int errno;
#if HAVE_STDINT_H
# include <stdint.h>
#endif
+#else /* ZOS_USS */
+#include <limits.h>
+#include <sys/time.h>
+#define INT32_MAX INT_MAX
+#define INT32_MIN INT_MIN
+#ifndef __uint32_t
+#define __uint32_t 1
+typedef unsigned long uint32_t;
+#endif
+typedef long int32_t;
#endif /* !ZOS_USS */
/* ----------------- System dependencies (with more includes) -----------*/
@@ -210,6 +220,18 @@ typedef void *stackoverflow_context_t;
this is a hack but it gives us the right semantics */
#define lintwarn (*(set_loc(__FILE__, __LINE__),lintfunc))
+#ifdef HAVE_MPFR
+#include <gmp.h>
+#include <mpfr.h>
+#ifndef MPFR_RNDN
+/* for compatibility with MPFR 2.X */
+#define MPFR_RNDN GMP_RNDN
+#define MPFR_RNDZ GMP_RNDZ
+#define MPFR_RNDU GMP_RNDU
+#define MPFR_RNDD GMP_RNDD
+#endif
+#endif
+
#include "regex.h"
#include "dfa.h"
typedef struct Regexp {
@@ -219,6 +241,8 @@ typedef struct Regexp {
short dfa;
short has_anchor; /* speed up of avoid_dfa kludge, temporary */
short non_empty; /* for use in fpat_parse_field */
+ short has_meta; /* re has meta chars so (probably) isn't simple string */
+ short maybe_long; /* re has meta chars that can match long text */
} Regexp;
#define RESTART(rp,s) (rp)->regs.start[0]
#define REEND(rp,s) (rp)->regs.end[0]
@@ -230,6 +254,8 @@ typedef struct Regexp {
#define RE_NEED_START 1 /* need to know start/end of match */
#define RE_NO_BOL 2 /* not allowed to match ^ in regexp */
+#include "gawkapi.h"
+
/* Stuff for losing systems. */
#if !defined(HAVE_STRTOD)
extern double gawk_strtod();
@@ -265,16 +291,9 @@ extern double gawk_strtod();
#define AWKNUM double
-#ifndef TRUE
-/* a bit hackneyed, but what the heck */
-#define TRUE 1
-#define FALSE 0
-#endif
-
-#define LINT_INVALID 1 /* only warn about invalid */
-#define LINT_ALL 2 /* warn about all things */
+#define INT32_BIT 32
-enum defrule {BEGIN = 1, Rule, END, BEGINFILE, ENDFILE,
+enum defrule { BEGIN = 1, Rule, END, BEGINFILE, ENDFILE,
MAXRULE /* sentinel, not legal */ };
extern const char *const ruletab[];
@@ -293,10 +312,12 @@ typedef enum nodevals {
Node_var_new, /* newly created variable, may become an array */
Node_param_list, /* lnode is a variable, rnode is more list */
Node_func, /* lnode is param. list, rnode is body */
+ Node_ext_func, /* extension function, code_ptr is builtin code */
- Node_hashnode, /* an identifier in the symbol table */
- Node_ahash, /* an array element */
Node_array_ref, /* array passed by ref as parameter */
+ Node_array_tree, /* Hashed array tree (HAT) */
+ Node_array_leaf, /* Linear 1-D array */
+ Node_dump_array, /* array info */
/* program execution -- stack item types */
Node_arrayfor,
@@ -306,9 +327,44 @@ typedef enum nodevals {
Node_final /* sentry value, not legal */
} NODETYPE;
+struct exp_node;
+
+typedef union bucket_item {
+ struct {
+ union bucket_item *next;
+ char *str;
+ size_t len;
+ size_t code;
+ struct exp_node *name;
+ struct exp_node *val;
+ } hs;
+ struct {
+ union bucket_item *next;
+ long li[2];
+ struct exp_node *val[2];
+ size_t cnt;
+ } hi;
+} BUCKET;
+
+/* string hash table */
+#define ahnext hs.next
+#define ahname hs.name /* a string index node */
+#define ahname_str hs.str /* shallow copy; = ahname->stptr */
+#define ahname_len hs.len /* = ahname->stlen */
+#define ahvalue hs.val
+#define ahcode hs.code
+
+/* integer hash table */
+#define ainext hi.next
+#define ainum hi.li /* integer indices */
+#define aivalue hi.val
+#define aicount hi.cnt
struct exp_instruction;
+typedef int (*Func_print)(FILE *, const char *, ...);
+typedef struct exp_node **(*array_ptr)(struct exp_node *, struct exp_node *);
+
/*
* NOTE - this struct is a rather kludgey -- it is packed to minimize
* space usage, at the expense of cleanliness. Alter at own risk.
@@ -320,13 +376,15 @@ typedef struct exp_node {
struct exp_node *lptr;
struct exp_instruction *li;
long ll;
+ array_ptr *lp;
} l;
union {
struct exp_node *rptr;
Regexp *preg;
struct exp_node **av;
+ BUCKET **bv;
void (*uptr)(void);
- struct exp_instruction *ri;
+ struct exp_instruction *iptr;
} r;
union {
struct exp_node *extra;
@@ -335,16 +393,27 @@ typedef struct exp_node {
char **param_list;
} x;
char *name;
+ size_t reserved;
struct exp_node *rn;
+ unsigned long cnt;
unsigned long reflags;
# define CASE 1
# define CONSTANT 2
# define FS_DFLT 4
} nodep;
+
struct {
+#ifdef HAVE_MPFR
+ union {
+ AWKNUM fltnum;
+ mpfr_t mpnum;
+ mpz_t mpi;
+ } nm;
+#else
AWKNUM fltnum; /* this is here for optimal packing of
- * the structure on many machines
- */
+ * the structure on many machines
+ */
+#endif
char *sp;
size_t slen;
long sref;
@@ -354,97 +423,126 @@ typedef struct exp_node {
size_t wslen;
#endif
} val;
- struct {
- AWKNUM num;
- struct exp_node *next;
- char *name;
- size_t length;
- struct exp_node *value;
- long ref;
- size_t code;
- } hash;
-#define hnext sub.hash.next
-#define hname sub.hash.name
-#define hlength sub.hash.length
-#define hvalue sub.hash.value
-
-#define ahnext sub.hash.next
-#define ahname_str sub.hash.name
-#define ahname_len sub.hash.length
-#define ahname_num sub.hash.num
-#define ahvalue sub.hash.value
-#define ahname_ref sub.hash.ref
-#define ahcode sub.hash.code
} sub;
NODETYPE type;
- unsigned short flags;
-# define MALLOC 1 /* can be free'd */
-# define PERM 2 /* can't be free'd */
-# define STRING 4 /* assigned as string */
-# define STRCUR 8 /* string value is current */
-# define NUMCUR 16 /* numeric value is current */
-# define NUMBER 32 /* assigned as number */
-# define MAYBE_NUM 64 /* user input: if NUMERIC then
- * a NUMBER */
-# define ARRAYMAXED 128 /* array is at max size */
-# define FUNC 256 /* this parameter is really a
- * function name; see awkgram.y */
-# define FIELD 512 /* this is a field */
-# define INTLSTR 1024 /* use localized version */
-# define NUMIND 2048 /* numeric val of index is current */
-# define WSTRCUR 4096 /* wide str value is current */
+ unsigned int flags;
+
+/* any type */
+# define MALLOC 0x0001 /* can be free'd */
+
+/* type = Node_val */
+# define STRING 0x0002 /* assigned as string */
+# define STRCUR 0x0004 /* string value is current */
+# define NUMCUR 0x0008 /* numeric value is current */
+# define NUMBER 0x0010 /* assigned as number */
+# define MAYBE_NUM 0x0020 /* user input: if NUMERIC then
+ * a NUMBER */
+# define FIELD 0x0040 /* this is a field */
+# define INTLSTR 0x0080 /* use localized version */
+# define NUMINT 0x0100 /* numeric value is an integer */
+# define INTIND 0x0200 /* integral value is array index;
+ * lazy conversion to string.
+ */
+# define WSTRCUR 0x0400 /* wide str value is current */
+# define MPFN 0x0800 /* arbitrary-precision floating-point number */
+# define MPZN 0x1000 /* arbitrary-precision integer */
+# define NO_EXT_SET 0x2000 /* extension cannot set a value for this variable */
+
+/* type = Node_var_array */
+# define ARRAYMAXED 0x4000 /* array is at max size */
+# define HALFHAT 0x8000 /* half-capacity Hashed Array Tree;
+ * See cint_array.c */
+# define XARRAY 0x10000
} NODE;
-
#define vname sub.nodep.name
#define lnode sub.nodep.l.lptr
#define nextp sub.nodep.l.lptr
#define rnode sub.nodep.r.rptr
-#define param_cnt sub.nodep.l.ll
-#define param vname
+/* Node_param_list */
+#define param vname
+#define dup_ent sub.nodep.r.rptr
+
+/* Node_param_list, Node_func */
+#define param_cnt sub.nodep.l.ll
-#define parmlist sub.nodep.x.param_list
-#define code_ptr sub.nodep.r.ri
+/* Node_func */
+#define fparms sub.nodep.rn
+#define code_ptr sub.nodep.r.iptr
+/* Node_regex, Node_dynregex */
#define re_reg sub.nodep.r.preg
#define re_flags sub.nodep.reflags
#define re_text lnode
#define re_exp sub.nodep.x.extra
-#define re_cnt flags
+#define re_cnt flags
+/* Node_val */
#define stptr sub.val.sp
#define stlen sub.val.slen
#define valref sub.val.sref
-#define stfmt sub.val.idx
-
+#define stfmt sub.val.idx
#define wstptr sub.val.wsp
#define wstlen sub.val.wslen
+#ifdef HAVE_MPFR
+#define mpg_numbr sub.val.nm.mpnum
+#define mpg_i sub.val.nm.mpi
+#define numbr sub.val.nm.fltnum
+#else
+#define numbr sub.val.fltnum
+#endif
-#define numbr sub.val.fltnum
+/* Node_arrayfor */
+#define for_list sub.nodep.r.av
+#define for_list_size sub.nodep.reflags
+#define cur_idx sub.nodep.l.ll
+#define for_array sub.nodep.rn
/* Node_frame: */
#define stack sub.nodep.r.av
#define func_node sub.nodep.x.extra
#define prev_frame_size sub.nodep.reflags
#define reti sub.nodep.l.li
+#define num_tail_calls sub.nodep.cnt
/* Node_var: */
-#define var_value lnode
+#define var_value lnode
#define var_update sub.nodep.r.uptr
#define var_assign sub.nodep.x.aptr
/* Node_var_array: */
-#define var_array sub.nodep.r.av
-#define array_size sub.nodep.l.ll
-#define table_size sub.nodep.x.xl
-#define parent_array sub.nodep.rn
+#define buckets sub.nodep.r.bv
+#define nodes sub.nodep.r.av
+#define array_funcs sub.nodep.l.lp
+#define array_base sub.nodep.l.ll
+#define table_size sub.nodep.reflags
+#define array_size sub.nodep.cnt
+#define array_capacity sub.nodep.reserved
+#define xarray sub.nodep.rn
+#define parent_array sub.nodep.x.extra
+
+/* array_funcs[0] is the array initialization function and
+ * array_funcs[1] is the index type checking function
+ */
+#define alookup array_funcs[2]
+#define aexists array_funcs[3]
+#define aclear array_funcs[4]
+#define aremove array_funcs[5]
+#define alist array_funcs[6]
+#define acopy array_funcs[7]
+#define adump array_funcs[8]
+#define NUM_AFUNCS 9 /* # of entries in array_funcs */
/* Node_array_ref: */
#define orig_array lnode
#define prev_array rnode
+/* Node_array_print */
+#define adepth sub.nodep.l.ll
+#define alevel sub.nodep.x.xl
+
/* --------------------------------lint warning types----------------------------*/
typedef enum lintvals {
LINT_illegal,
@@ -542,6 +640,7 @@ typedef enum opcodeval {
Op_builtin,
Op_sub_builtin, /* sub, gsub and gensub */
+ Op_ext_builtin,
Op_in_array, /* boolean test of membership in array */
/* function call instruction */
@@ -549,7 +648,7 @@ typedef enum opcodeval {
Op_indirect_func_call,
Op_push, /* scalar variable */
- Op_push_arg, /* variable type (scalar or array) argument to built-in */
+ Op_push_arg, /* variable type (scalar or array) argument to built-in */
Op_push_i, /* number, string */
Op_push_re, /* regex */
Op_push_array,
@@ -574,7 +673,6 @@ typedef enum opcodeval {
Op_after_beginfile,
Op_after_endfile,
- Op_ext_func,
Op_func,
Op_exec_count,
@@ -603,7 +701,8 @@ typedef enum opcodeval {
enum redirval {
/* I/O redirections */
- redirect_output = 1,
+ redirect_none = 0,
+ redirect_output,
redirect_append,
redirect_pipe,
redirect_pipein,
@@ -619,6 +718,7 @@ typedef struct exp_instruction {
NODE *dn;
struct exp_instruction *di;
NODE *(*fptr)(int);
+ awk_value_t *(*efptr)(int, awk_value_t *);
long dl;
char *name;
} d;
@@ -639,6 +739,7 @@ typedef struct exp_instruction {
#define memory d.dn
#define builtin d.fptr
+#define extfunc d.efptr
#define builtin_idx d.dl
#define expr_count x.xl
@@ -675,6 +776,7 @@ typedef struct exp_instruction {
/* Op_token */
#define lextok d.name
+#define param_count x.xl
/* Op_rule */
#define in_rule x.xl
@@ -683,11 +785,11 @@ typedef struct exp_instruction {
/* Op_K_case, Op_K_default */
#define case_stmt x.xi
#define case_exp d.di
-#define stmt_start case_exp
-#define stmt_end case_stmt
-#define match_exp x.xl
+#define stmt_start case_exp
+#define stmt_end case_stmt
+#define match_exp x.xl
-#define target_stmt x.xi
+#define target_stmt x.xi
/* Op_K_switch */
#define switch_end x.xi
@@ -712,7 +814,7 @@ typedef struct exp_instruction {
#define func_body x.xn
/* Op_func_call */
-#define inrule d.dl
+#define tail_call d.dl
/* Op_subscript */
#define sub_count d.dl
@@ -747,9 +849,9 @@ typedef struct exp_instruction {
#define assign_ctxt d.dl
/* Op_concat */
-#define concat_flag d.dl
-#define CSUBSEP 1
-#define CSVAR 2
+#define concat_flag d.dl
+#define CSUBSEP 1
+#define CSVAR 2
/* Op_breakpoint */
#define break_pt x.bpt
@@ -779,10 +881,11 @@ typedef struct exp_instruction {
#define condpair_left d.di
#define condpair_right x.xi
+/* Op_store_var */
+#define initval x.xn
+
typedef struct iobuf {
- const char *name; /* filename */
- int fd; /* file descriptor */
- struct stat sbuf; /* stat buf */
+ awk_input_buf_t public; /* exposed to extensions */
char *buf; /* start data buffer */
char *off; /* start of current record in buffer */
char *dataend; /* first byte in buffer to hold new data,
@@ -793,19 +896,20 @@ typedef struct iobuf {
ssize_t count; /* amount read last time */
size_t scanoff; /* where we were in the buffer when we had
to regrow/refill */
+ /*
+ * No argument prototype on read_func. See get_src_buf()
+ * in awkgram.y.
+ */
+ ssize_t (*read_func)();
- void *opaque; /* private data for open hooks */
- int (*get_record)(char **out, struct iobuf *, int *errcode);
- void (*close_func)(struct iobuf *); /* open and close hooks */
-
+ bool valid;
int errcode;
int flag;
# define IOP_IS_TTY 1
-# define IOP_NOFREE_OBJ 2
-# define IOP_AT_EOF 4
-# define IOP_CLOSED 8
-# define IOP_AT_START 16
+# define IOP_AT_EOF 2
+# define IOP_CLOSED 4
+# define IOP_AT_START 8
} IOBUF;
typedef void (*Func_ptr)(void);
@@ -826,7 +930,6 @@ struct redirect {
# define RED_SOCKET 1024
# define RED_TCP 2048
char *value;
- FILE *fp;
FILE *ifp; /* input fp, needed for PIPES_SIMULATED */
IOBUF *iop;
int pid;
@@ -834,6 +937,7 @@ struct redirect {
struct redirect *prev;
struct redirect *next;
const char *mode;
+ awk_output_buf_t output;
};
/*
@@ -844,8 +948,8 @@ typedef struct srcfile {
struct srcfile *next;
struct srcfile *prev;
- enum srctype { SRC_CMDLINE = 1, SRC_STDIN, SRC_FILE, SRC_INC } stype;
- char *src; /* name on command line or inclde statement */
+ enum srctype { SRC_CMDLINE = 1, SRC_STDIN, SRC_FILE, SRC_INC, SRC_EXTLIB } stype;
+ char *src; /* name on command line or include statement */
char *fullpath; /* full path after AWKPATH search */
time_t mtime;
struct stat sbuf;
@@ -871,7 +975,7 @@ typedef struct context {
SRCFILE srcfiles;
int sourceline;
char *source;
- void (*install_func)(char *);
+ void (*install_func)(NODE *);
struct context *prev;
} AWK_CONTEXT;
@@ -881,6 +985,20 @@ struct flagtab {
const char *name;
};
+
+typedef struct block_item {
+ size_t size;
+ struct block_item *freep;
+} BLOCK;
+
+enum block_id {
+ BLOCK_INVALID = 0, /* not legal */
+ BLOCK_NODE,
+ BLOCK_BUCKET,
+ BLOCK_MAX /* count */
+};
+
+
#ifndef LONG_MAX
#define LONG_MAX ((long)(~(1L << (sizeof (long) * 8 - 1))))
#endif
@@ -899,7 +1017,7 @@ extern long NR;
extern long FNR;
extern int BINMODE;
extern int IGNORECASE;
-extern int RS_is_null;
+extern bool RS_is_null;
extern char *OFS;
extern int OFSlen;
extern char *ORS;
@@ -914,29 +1032,76 @@ extern NODE *FNR_node, *FS_node, *IGNORECASE_node, *NF_node;
extern NODE *NR_node, *OFMT_node, *OFS_node, *ORS_node, *RLENGTH_node;
extern NODE *RSTART_node, *RS_node, *RT_node, *SUBSEP_node, *PROCINFO_node;
extern NODE *LINT_node, *ERRNO_node, *TEXTDOMAIN_node, *FPAT_node;
+extern NODE *PREC_node, *ROUNDMODE_node;
extern NODE *Nnull_string;
extern NODE *Null_field;
extern NODE **fields_arr;
extern int sourceline;
extern char *source;
+extern int (*interpret)(INSTRUCTION *); /* interpreter routine */
+extern NODE *(*make_number)(double); /* double instead of AWKNUM on purpose */
+extern NODE *(*str2number)(NODE *);
+extern NODE *(*format_val)(const char *, int, NODE *);
+extern int (*cmp_numbers)(const NODE *, const NODE *);
+
+typedef int (*Func_pre_exec)(INSTRUCTION **);
+typedef void (*Func_post_exec)(INSTRUCTION *);
#if __GNUC__ < 2
-extern NODE *_t; /* used as temporary in tree_eval */
+extern NODE *_t; /* used as temporary in macros */
#endif
-extern NODE *_r; /* used as temporary in stack macros */
-
-extern NODE *nextfree;
-extern int field0_valid;
-extern int do_traditional;
-extern int do_posix;
-extern int do_intervals;
-extern int do_intl;
-extern int do_non_decimal_data;
-extern int do_profiling;
-extern int do_dump_vars;
-extern int do_tidy_mem;
-extern int do_sandbox;
-extern int do_optimize;
+extern NODE *_r; /* used as temporary in macros */
+
+extern BLOCK nextfree[];
+extern bool field0_valid;
+
+extern int do_flags;
+
+/* only warn about invalid */
+#define DO_LINT_INVALID 0x0001
+/* warn about all things */
+#define DO_LINT_ALL 0x0002
+/* warn about stuff not in V7 awk */
+#define DO_LINT_OLD 0x0004
+/* no gnu extensions, add traditional weirdnesses */
+#define DO_TRADITIONAL 0x0008
+/* turn off gnu and unix extensions */
+#define DO_POSIX 0x0010
+/* dump locale-izable strings to stdout */
+#define DO_INTL 0x0020
+/* allow octal/hex C style DATA. Use with caution! */
+#define DO_NON_DEC_DATA 0x0040
+/* allow {...,...} in regexps, see resetup() */
+#define DO_INTERVALS 0x0080
+/* pretty print the program */
+#define DO_PRETTY_PRINT 0x0100
+/* dump all global variables at end */
+#define DO_DUMP_VARS 0x0200
+/* release vars when done */
+#define DO_TIDY_MEM 0x0400
+/* sandbox mode - disable 'system' function & redirections */
+#define DO_SANDBOX 0x0800
+/* profile the program */
+#define DO_PROFILE 0x1000
+/* debug the program */
+#define DO_DEBUG 0x2000
+/* arbitrary-precision floating-point math */
+#define DO_MPFR 0x4000
+
+#define do_traditional (do_flags & DO_TRADITIONAL)
+#define do_posix (do_flags & DO_POSIX)
+#define do_intl (do_flags & DO_INTL)
+#define do_non_decimal_data (do_flags & DO_NON_DEC_DATA)
+#define do_intervals (do_flags & DO_INTERVALS)
+#define do_pretty_print (do_flags & DO_PRETTY_PRINT)
+#define do_profile (do_flags & DO_PROFILE)
+#define do_dump_vars (do_flags & DO_DUMP_VARS)
+#define do_tidy_mem (do_flags & DO_TIDY_MEM)
+#define do_sandbox (do_flags & DO_SANDBOX)
+#define do_debug (do_flags & DO_DEBUG)
+#define do_mpfr (do_flags & DO_MPFR)
+
+extern bool do_optimize;
extern int use_lc_numeric;
extern int exit_val;
@@ -944,8 +1109,8 @@ extern int exit_val;
#define do_lint 0
#define do_lint_old 0
#else
-extern int do_lint;
-extern int do_lint_old;
+#define do_lint (do_flags & (DO_LINT_INVALID|DO_LINT_ALL))
+#define do_lint_old (do_flags & DO_LINT_OLD)
#endif
#if MBS_SUPPORT
extern int gawk_mb_cur_max;
@@ -962,27 +1127,31 @@ extern int ngroups;
extern struct lconv loc;
#endif /* HAVE_LOCALE_H */
+#ifdef HAVE_MPFR
+extern mpfr_prec_t PRECISION;
+extern mpfr_rnd_t ROUND_MODE;
+extern mpz_t MNR;
+extern mpz_t MFNR;
+extern mpz_t mpzval;
+extern bool do_ieee_fmt; /* emulate IEEE 754 floating-point format */
+#endif
+
+
extern const char *myname;
extern const char def_strftime_format[];
extern char quote;
extern char *defpath;
+extern char *deflibpath;
extern char envsep;
extern char casetable[]; /* for case-independent regexp matching */
-/*
- * Provide a way for code to know which program is executing:
- * gawk vs dgawk vs pgawk.
- */
-enum exe_mode { exe_normal = 1, exe_debugging, exe_profiling };
-extern enum exe_mode which_gawk; /* (defined in eval.c) */
-
/* ------------------------- Runtime stack -------------------------------- */
typedef union stack_item {
- NODE *rptr; /* variable etc. */
- NODE **lptr; /* address of a variable etc. */
+ NODE *rptr; /* variable etc. */
+ NODE **lptr; /* address of a variable etc. */
} STACK_ITEM;
extern STACK_ITEM *stack_ptr;
@@ -990,83 +1159,109 @@ extern NODE *frame_ptr;
extern STACK_ITEM *stack_bottom;
extern STACK_ITEM *stack_top;
-#define decr_sp() (stack_ptr--)
+#define decr_sp() (stack_ptr--)
#define incr_sp() ((stack_ptr < stack_top) ? ++stack_ptr : grow_stack())
-#define stack_adj(n) (stack_ptr += (n))
-#define stack_empty() (stack_ptr < stack_bottom)
-
-#define POP() decr_sp()->rptr
-#define POP_ADDRESS() decr_sp()->lptr
-#define PEEK(n) (stack_ptr - (n))->rptr
-#define TOP() stack_ptr->rptr /* same as PEEK(0) */
-#define TOP_ADDRESS() stack_ptr->lptr
-#define PUSH(r) (void) (incr_sp()->rptr = (r))
-#define PUSH_ADDRESS(l) (void) (incr_sp()->lptr = (l))
-#define REPLACE(r) (void) (stack_ptr->rptr = (r))
-#define REPLACE_ADDRESS(l) (void) (stack_ptr->lptr = (l))
-
+#define stack_adj(n) (stack_ptr += (n))
+#define stack_empty() (stack_ptr < stack_bottom)
+
+#define POP() decr_sp()->rptr
+#define POP_ADDRESS() decr_sp()->lptr
+#define PEEK(n) (stack_ptr - (n))->rptr
+#define TOP() stack_ptr->rptr /* same as PEEK(0) */
+#define TOP_ADDRESS() stack_ptr->lptr
+#define PUSH(r) (void) (incr_sp()->rptr = (r))
+#define PUSH_ADDRESS(l) (void) (incr_sp()->lptr = (l))
+#define REPLACE(r) (void) (stack_ptr->rptr = (r))
+#define REPLACE_ADDRESS(l) (void) (stack_ptr->lptr = (l))
/* function param */
-#define GET_PARAM(n) frame_ptr->stack[n]
+#define GET_PARAM(n) frame_ptr->stack[n]
/*
- * UPREF and DEREF --- simplified versions of dupnode and unref
- * UPREF does not handle FIELD node. Most appropriate use is
- * for elements on the runtime stack. When in doubt, use dupnode.
- */
+ * UPREF --- simplified versions of dupnode, does not handle FIELD node.
+ * Most appropriate use is for elements on the runtime stack.
+ * When in doubt, use dupnode.
+ */
+
+#define UPREF(r) (void) ((r)->valref++)
-#define DEREF(r) ( _r = (r), (!(_r->flags & PERM) && (--_r->valref == 0)) ? unref(_r) : (void)0 )
+#define DEREF(r) ( _r = (r), (--_r->valref == 0) ? r_unref(_r) : (void)0 )
#if __GNUC__ >= 2
-#define UPREF(r) ({ NODE *_t = (r); !(_t->flags & PERM) && _t->valref++;})
#define POP_ARRAY() ({ NODE *_t = POP(); \
- _t->type == Node_var_array ? \
- _t : get_array(_t, TRUE); })
+ _t->type == Node_var_array ? _t : get_array(_t, true); })
#define POP_PARAM() ({ NODE *_t = POP(); \
- _t->type == Node_var_array ? \
- _t : get_array(_t, FALSE); })
+ _t->type == Node_var_array ? _t : get_array(_t, false); })
-#define POP_NUMBER(x) ({ NODE *_t = POP_SCALAR(); \
- x = force_number(_t); DEREF(_t); })
-#define TOP_NUMBER(x) ({ NODE *_t = TOP_SCALAR(); \
- x = force_number(_t); DEREF(_t); })
+#define POP_SCALAR() ({ NODE *_t = POP(); _t->type != Node_var_array ? _t \
+ : (fatal(_("attempt to use array `%s' in a scalar context"), array_vname(_t)), _t);})
+#define TOP_SCALAR() ({ NODE *_t = TOP(); _t->type != Node_var_array ? _t \
+ : (fatal(_("attempt to use array `%s' in a scalar context"), array_vname(_t)), _t);})
-#define POP_SCALAR() ({ NODE *_t = POP(); _t->type != Node_var_array ? _t \
- : (fatal(_("attempt to use array `%s' in a scalar context"), array_vname(_t)), _t);})
-#define TOP_SCALAR() ({ NODE *_t = TOP(); _t->type != Node_var_array ? _t \
- : (fatal(_("attempt to use array `%s' in a scalar context"), array_vname(_t)), _t);})
+#define POP_STRING() force_string(POP_SCALAR())
+#define TOP_STRING() force_string(TOP_SCALAR())
#else /* not __GNUC__ */
-#define UPREF(r) (_t = (r), !(_t->flags & PERM) && _t->valref++)
-
#define POP_ARRAY() (_t = POP(), \
- _t->type == Node_var_array ? \
- _t : get_array(_t, TRUE))
+ _t->type == Node_var_array ? _t : get_array(_t, true))
#define POP_PARAM() (_t = POP(), \
- _t->type == Node_var_array ? \
- _t : get_array(_t, FALSE))
-
-#define POP_NUMBER(x) (_t = POP_SCALAR(), \
- x = force_number(_t), DEREF(_t))
-#define TOP_NUMBER(x) (_t = TOP_SCALAR(), \
- x = force_number(_t), DEREF(_t))
+ _t->type == Node_var_array ? _t : get_array(_t, false))
#define POP_SCALAR() (_t = POP(), _t->type != Node_var_array ? _t \
- : (fatal(_("attempt to use array `%s' in a scalar context"), array_vname(_t)), _t))
+ : (fatal(_("attempt to use array `%s' in a scalar context"), array_vname(_t)), _t))
#define TOP_SCALAR() (_t = TOP(), _t->type != Node_var_array ? _t \
- : (fatal(_("attempt to use array `%s' in a scalar context"), array_vname(_t)), _t))
+ : (fatal(_("attempt to use array `%s' in a scalar context"), array_vname(_t)), _t))
-#endif /* __GNUC__ */
+#define POP_STRING() (_r = POP_SCALAR(), m_force_string(_r))
+#define TOP_STRING() (_r = TOP_SCALAR(), m_force_string(_r))
+#endif /* __GNUC__ */
-#define POP_STRING() force_string(POP_SCALAR())
-#define TOP_STRING() force_string(TOP_SCALAR())
+#define POP_NUMBER() force_number(POP_SCALAR())
+#define TOP_NUMBER() force_number(TOP_SCALAR())
/* ------------------------- Pseudo-functions ------------------------- */
+#ifdef HAVE_MPFR
+/* conversion to C types */
+#define get_number_ui(n) (((n)->flags & MPFN) ? mpfr_get_ui((n)->mpg_numbr, ROUND_MODE) \
+ : ((n)->flags & MPZN) ? mpz_get_ui((n)->mpg_i) \
+ : (unsigned long) (n)->numbr)
+#define get_number_si(n) (((n)->flags & MPFN) ? mpfr_get_si((n)->mpg_numbr, ROUND_MODE) \
+ : ((n)->flags & MPZN) ? mpz_get_si((n)->mpg_i) \
+ : (long) (n)->numbr)
+#define get_number_d(n) (((n)->flags & MPFN) ? mpfr_get_d((n)->mpg_numbr, ROUND_MODE) \
+ : ((n)->flags & MPZN) ? mpz_get_d((n)->mpg_i) \
+ : (double) (n)->numbr)
+#define get_number_uj(n) (((n)->flags & MPFN) ? mpfr_get_uj((n)->mpg_numbr, ROUND_MODE) \
+ : ((n)->flags & MPZN) ? (uintmax_t) mpz_get_d((n)->mpg_i) \
+ : (uintmax_t) (n)->numbr)
+
+#define iszero(n) (((n)->flags & MPFN) ? mpfr_zero_p((n)->mpg_numbr) \
+ : ((n)->flags & MPZN) ? (mpz_sgn((n)->mpg_i) == 0) \
+ : ((n)->numbr == 0.0))
+
+#define IEEE_FMT(r, t) (void) (do_ieee_fmt && format_ieee(r, t))
+
+#define mpg_float() mpg_node(MPFN)
+#define mpg_integer() mpg_node(MPZN)
+#define is_mpg_float(n) (((n)->flags & MPFN) != 0)
+#define is_mpg_integer(n) (((n)->flags & MPZN) != 0)
+#define is_mpg_number(n) (((n)->flags & (MPZN|MPFN)) != 0)
+#else
+#define get_number_ui(n) (unsigned long) (n)->numbr
+#define get_number_si(n) (long) (n)->numbr
+#define get_number_d(n) (double) (n)->numbr
+#define get_number_uj(n) (uintmax_t) (n)->numbr
+
+#define is_mpg_number(n) 0
+#define is_mpg_float(n) 0
+#define is_mpg_integer(n) 0
+#define iszero(n) ((n)->numbr == 0.0)
+#endif
#define is_identchar(c) (isalnum(c) || (c) == '_')
@@ -1075,21 +1270,19 @@ extern STACK_ITEM *stack_top;
#define get_lhs(n, r) (n)->type == Node_var && ! var_uninitialized(n) ? \
&((n)->var_value) : r_get_lhs((n), (r))
-#ifdef MPROF
-#define getnode(n) emalloc((n), NODE *, sizeof(NODE), "getnode"), \
- (n)->flags = 0
-#define freenode(n) efree(n)
-#else /* not MPROF */
-#define getnode(n) (void) (nextfree ? \
- (n = nextfree, nextfree = nextfree->nextp) \
- : (n = more_nodes()))
-#define freenode(n) ((n)->flags = 0, (n)->nextp = nextfree, nextfree = (n))
-#endif /* not MPROF */
+#define getblock(p, id, ty) (void) ((p = (ty) nextfree[id].freep) ? \
+ (ty) (nextfree[id].freep = ((BLOCK *) p)->freep) \
+ : (p = (ty) more_blocks(id)))
+#define freeblock(p, id) (void) (((BLOCK *) p)->freep = nextfree[id].freep, \
+ nextfree[id].freep = (BLOCK *) p)
+
+#define getnode(n) getblock(n, BLOCK_NODE, NODE *)
+#define freenode(n) freeblock(n, BLOCK_NODE)
-#define make_number(x) mk_number((x), (unsigned int)(MALLOC|NUMCUR|NUMBER))
+#define getbucket(b) getblock(b, BLOCK_BUCKET, BUCKET *)
+#define freebucket(b) freeblock(b, BLOCK_BUCKET)
-#define make_string(s, l) r_make_str_node((s), (size_t) (l), 0)
-#define make_str_node(s, l, f) r_make_str_node((s), (size_t) (l), (f))
+#define make_string(s, l) make_str_node((s), (l), 0)
#define SCAN 1
#define ALREADY_MALLOCED 2
@@ -1108,86 +1301,118 @@ extern STACK_ITEM *stack_top;
#define efree(p) free(p)
#ifdef GAWKDEBUG
-#define force_number r_force_number
-#define force_string r_force_string
+#define force_number str2number
+#define dupnode r_dupnode
+#define unref r_unref
+#define m_force_string r_force_string
+extern NODE *r_force_string(NODE *s);
#else /* not GAWKDEBUG */
+
+#define unref(r) ( _r = (r), (_r == NULL || --_r->valref > 0) ? \
+ (void)0 : r_unref(_r) )
+
+#define m_force_string(_ts) (((_ts->flags & STRCUR) && \
+ (_ts->stfmt == -1 || _ts->stfmt == CONVFMTidx)) ? \
+ _ts : format_val(CONVFMT, CONVFMTidx, _ts))
+
#if __GNUC__ >= 2
-#define force_number(n) __extension__ ({NODE *_tn = (n);\
- (_tn->flags & NUMCUR) ? _tn->numbr : r_force_number(_tn);})
+#define dupnode(n) __extension__ ({ NODE *_tn = (n); \
+ (_tn->flags & MALLOC) ? (_tn->valref++, _tn) : r_dupnode(_tn); })
+
+#define force_number(n) __extension__ ({ NODE *_tn = (n); \
+ (_tn->flags & NUMCUR) ? _tn : str2number(_tn); })
+
+#define force_string(s) __extension__ ({ NODE *_ts = (s); m_force_string(_ts); })
-#define force_string(s) __extension__ ({NODE *_ts = (s);\
- ((_ts->flags & STRCUR) && \
- (_ts->stfmt == -1 || _ts->stfmt == CONVFMTidx)) ?\
- _ts : format_val(CONVFMT, CONVFMTidx, _ts);})
#else /* not __GNUC__ */
-#define force_number r_force_number
-#define force_string r_force_string
+#define dupnode(n) (_t = (n), \
+ (_t->flags & MALLOC) ? (_t->valref++, _t) : r_dupnode(_t))
+
+#define force_number str2number
+#define force_string(s) (_t = (s), m_force_string(_t))
#endif /* __GNUC__ */
#endif /* GAWKDEBUG */
#define fatal set_loc(__FILE__, __LINE__), r_fatal
extern jmp_buf fatal_tag;
-extern int fatal_tag_valid;
+extern bool fatal_tag_valid;
#define PUSH_BINDING(stack, tag, val) \
if (val++) \
memcpy((char *) (stack), (const char *) tag, sizeof(jmp_buf))
#define POP_BINDING(stack, tag, val) \
-if (--val) \
+if (--val) \
memcpy((char *) tag, (const char *) (stack), sizeof(jmp_buf))
-/* ------------- Function prototypes or defs (as appropriate) ------------- */
-typedef int (*Func_print)(FILE *, const char *, ...);
+#define array_empty(a) ((a)->table_size == 0)
+#define assoc_lookup(a, s) (a)->alookup(a, s)
+
+/* assoc_clear --- flush all the values in symbol[] */
+#define assoc_clear(a) (void) ((a)->aclear(a, NULL))
+/* assoc_remove --- remove an index from symbol[] */
+#define assoc_remove(a, s) ((a)->aremove(a, s) != NULL)
+
+
+#if __GNUC__ >= 2
+#define in_array(a, s) ({ NODE **_l; _l = (a)->aexists(a, s); _l ? *_l : NULL; })
+#else /* not __GNUC__ */
+#define in_array(a, s) r_in_array(a, s)
+#endif /* __GNUC__ */
+
+
+/* ------------- Function prototypes or defs (as appropriate) ------------- */
/* array.c */
typedef enum sort_context { SORTED_IN = 1, ASORT, ASORTI } SORT_CTXT;
-extern NODE **assoc_list(NODE *array, const char *sort_str, SORT_CTXT sort_ctxt);
-extern NODE *get_array(NODE *symbol, int canfatal);
-extern char *array_vname(const NODE *symbol);
+enum assoc_list_flags {
+ AINDEX = 0x01, /* list of indices */
+ AVALUE = 0x02, /* list of values */
+ AINUM = 0x04, /* numeric index */
+ AISTR = 0x08, /* string index */
+ AVNUM = 0x10, /* numeric scalar value */
+ AVSTR = 0x20, /* string scalar value */
+ AASC = 0x40, /* ascending order */
+ ADESC = 0x80, /* descending order */
+ ADELETE = 0x100 /* need a single index; for use in do_delete_loop */
+};
+
+extern NODE *make_array(void);
+extern void init_array(NODE *symbol);
+extern NODE *get_array(NODE *symbol, bool canfatal);
+extern const char *make_aname(const NODE *symbol);
+extern const char *array_vname(const NODE *symbol);
extern void array_init(void);
+extern int register_array_func(array_ptr *afunc);
extern void set_SUBSEP(void);
-extern NODE *concat_exp(int nargs, int do_subsep);
-extern void ahash_unref(NODE *tmp);
-extern void assoc_clear(NODE *symbol);
-extern NODE *in_array(NODE *symbol, NODE *subs);
-extern NODE **assoc_lookup(NODE *symbol, NODE *subs, int reference);
+extern NODE *concat_exp(int nargs, bool do_subsep);
+extern NODE *r_in_array(NODE *symbol, NODE *subs);
+extern NODE *assoc_copy(NODE *symbol, NODE *newsymb);
+extern void assoc_dump(NODE *symbol, NODE *p);
+extern NODE **assoc_list(NODE *symbol, const char *sort_str, SORT_CTXT sort_ctxt);
+extern void assoc_info(NODE *subs, NODE *val, NODE *p, const char *aname);
extern void do_delete(NODE *symbol, int nsubs);
extern void do_delete_loop(NODE *symbol, NODE **lhs);
-extern NODE *assoc_dump(NODE *symbol, int indent_level);
extern NODE *do_adump(int nargs);
+extern NODE *do_aoption(int nargs);
extern NODE *do_asort(int nargs);
extern NODE *do_asorti(int nargs);
extern unsigned long (*hash)(const char *s, size_t len, unsigned long hsize, size_t *code);
/* awkgram.c */
-extern NODE *mk_symbol(NODETYPE type, NODE *value);
-extern NODE *install_symbol(char *name, NODE *value);
-extern NODE *remove_symbol(char *name);
-extern NODE *lookup(const char *name);
-extern NODE *variable(char *name, NODETYPE type);
+extern NODE *variable(int location, char *name, NODETYPE type);
extern int parse_program(INSTRUCTION **pcode);
+extern void track_ext_func(const char *name);
extern void dump_funcs(void);
extern void dump_vars(const char *fname);
-extern void release_all_vars(void);
extern const char *getfname(NODE *(*)(int));
extern NODE *stopme(int nargs);
extern void shadow_funcs(void);
extern int check_special(const char *name);
-extern int foreach_func(int (*)(INSTRUCTION *, void *), int, void *);
-extern INSTRUCTION *bcalloc(OPCODE op, int size, int srcline);
-extern void bcfree(INSTRUCTION *);
-extern SRCFILE *add_srcfile(int stype, char *src, SRCFILE *curr, int *already_included, int *errcode);
+extern SRCFILE *add_srcfile(int stype, char *src, SRCFILE *curr, bool *already_included, int *errcode);
extern void register_deferred_variable(const char *name, NODE *(*load_func)(void));
extern int files_are_same(char *path, SRCFILE *src);
extern void valinfo(NODE *n, Func_print print_func, FILE *fp);
-extern void print_vars(Func_print print_func, FILE *fp);
-extern AWK_CONTEXT *new_context(void);
-extern void push_context(AWK_CONTEXT *ctxt);
-extern void pop_context();
-extern int in_main_context();
-extern void free_context(AWK_CONTEXT *ctxt, int );
-extern void append_symbol(char *name);
-
+extern void negate_num(NODE *n);
/* builtin.c */
extern double double_to_int(double d);
extern NODE *do_exp(int nargs);
@@ -1236,8 +1461,9 @@ extern int strncasecmpmbs(const unsigned char *,
/* eval.c */
extern void PUSH_CODE(INSTRUCTION *cp);
extern INSTRUCTION *POP_CODE(void);
-extern int interpret(INSTRUCTION *);
-extern int cmp_nodes(NODE *, NODE *);
+extern void init_interpret(void);
+extern int cmp_nodes(NODE *t1, NODE *t2);
+extern int cmp_awknums(const NODE *t1, const NODE *t2);
extern void set_IGNORECASE(void);
extern void set_OFS(void);
extern void set_ORS(void);
@@ -1246,8 +1472,9 @@ extern void set_CONVFMT(void);
extern void set_BINMODE(void);
extern void set_LINT(void);
extern void set_TEXTDOMAIN(void);
-extern void update_ERRNO(void);
-extern void update_ERRNO_saved(int);
+extern void update_ERRNO_int(int);
+extern void update_ERRNO_string(const char *string);
+extern void unset_ERRNO(void);
extern void update_NR(void);
extern void update_NF(void);
extern void update_FNR(void);
@@ -1256,24 +1483,21 @@ extern const char *flags2str(int);
extern const char *genflags2str(int flagval, const struct flagtab *tab);
extern const char *nodetype2str(NODETYPE type);
extern void load_casetable(void);
-
extern AWKNUM calc_exp(AWKNUM x1, AWKNUM x2);
extern const char *opcode2str(OPCODE type);
extern const char *op2str(OPCODE type);
-extern NODE **r_get_lhs(NODE *n, int reference);
+extern NODE **r_get_lhs(NODE *n, bool reference);
extern STACK_ITEM *grow_stack(void);
-#ifdef PROFILING
extern void dump_fcall_stack(FILE *fp);
-#endif
+extern int register_exec_hook(Func_pre_exec preh, Func_post_exec posth);
/* ext.c */
-NODE *do_ext(int nargs);
+void load_ext(const char *lib_name);
#ifdef DYNAMIC
-void make_builtin(const char *, NODE *(*)(int), int);
-size_t get_curfunc_arg_count(void);
+awk_bool_t make_builtin(const awk_ext_func_t *);
NODE *get_argument(int);
-NODE *get_actual_argument(int, int, int);
-#define get_scalar_argument(i, opt) get_actual_argument((i), (opt), FALSE)
-#define get_array_argument(i, opt) get_actual_argument((i), (opt), TRUE)
+NODE *get_actual_argument(int, bool, bool);
+#define get_scalar_argument(i, opt) get_actual_argument((i), (opt), false)
+#define get_array_argument(i, opt) get_actual_argument((i), (opt), true)
#endif
/* field.c */
extern void init_fields(void);
@@ -1297,6 +1521,14 @@ typedef enum {
} field_sep_type;
extern field_sep_type current_field_sep(void);
+/* gawkapi.c: */
+extern gawk_api_t api_impl;
+extern void init_ext_api(void);
+extern void update_ext_api(void);
+extern NODE *awk_value_to_node(const awk_value_t *);
+extern void run_ext_exit_handlers(int exitval);
+extern void print_ext_versions(void);
+
/* gawkmisc.c */
extern char *gawk_name(const char *filespec);
extern void os_arg_fixup(int *argcp, char ***argvp);
@@ -1304,6 +1536,7 @@ extern int os_devopen(const char *name, int flag);
extern void os_close_on_exec(int fd, const char *name, const char *what, const char *dir);
extern int os_isatty(int fd);
extern int os_isdir(int fd);
+extern int os_isreadable(const awk_input_buf_t *iobuf, bool *isdir);
extern int os_is_setuid(void);
extern int os_setbinmode(int fd, int mode);
extern void os_restore_mode(int fd);
@@ -1312,30 +1545,66 @@ extern int ispath(const char *file);
extern int isdirpunct(int c);
/* io.c */
-extern void register_open_hook(void *(*open_func)(IOBUF *));
+extern void init_io(void);
+extern void register_input_parser(awk_input_parser_t *input_parser);
+extern void register_output_wrapper(awk_output_wrapper_t *wrapper);
+extern void register_two_way_processor(awk_two_way_processor_t *processor);
extern void set_FNR(void);
extern void set_NR(void);
extern struct redirect *redirect(NODE *redir_exp, int redirtype, int *errflg);
extern NODE *do_close(int nargs);
extern int flush_io(void);
-extern int close_io(int *stdio_problem);
+extern int close_io(bool *stdio_problem);
extern int devopen(const char *name, const char *mode);
extern int srcopen(SRCFILE *s);
-extern char *find_source(const char *src, struct stat *stb, int *errcode);
-extern NODE *do_getline_redir(int intovar, int redirtype);
+extern char *find_source(const char *src, struct stat *stb, int *errcode, int is_extlib);
+extern NODE *do_getline_redir(int intovar, enum redirval redirtype);
extern NODE *do_getline(int intovar, IOBUF *iop);
extern struct redirect *getredirect(const char *str, int len);
extern int inrec(IOBUF *iop, int *errcode);
-extern int nextfile(IOBUF **curfile, int skipping);
+extern int nextfile(IOBUF **curfile, bool skipping);
/* main.c */
-extern int arg_assign(char *arg, int initing);
+extern int arg_assign(char *arg, bool initing);
extern int is_std_var(const char *var);
+extern int is_off_limits_var(const char *var);
extern char *estrdup(const char *str, size_t len);
extern void update_global_values();
+extern long getenv_long(const char *name);
+
+/* mpfr.c */
+extern void set_PREC(void);
+extern void set_ROUNDMODE(void);
+#ifdef HAVE_MPFR
+extern int mpg_cmp(const NODE *, const NODE *);
+extern int format_ieee(mpfr_ptr, int);
+extern NODE *mpg_update_var(NODE *);
+extern long mpg_set_var(NODE *);
+extern NODE *do_mpfr_and(int);
+extern NODE *do_mpfr_atan2(int);
+extern NODE *do_mpfr_compl(int);
+extern NODE *do_mpfr_cos(int);
+extern NODE *do_mpfr_exp(int);
+extern NODE *do_mpfr_int(int);
+extern NODE *do_mpfr_log(int);
+extern NODE *do_mpfr_lshift(int);
+extern NODE *do_mpfr_or(int);
+extern NODE *do_mpfr_rand(int);
+extern NODE *do_mpfr_rhift(int);
+extern NODE *do_mpfr_sin(int);
+extern NODE *do_mpfr_sqrt(int);
+extern NODE *do_mpfr_srand(int);
+extern NODE *do_mpfr_strtonum(int);
+extern NODE *do_mpfr_xor(int);
+extern void init_mpfr(mpfr_prec_t, const char *);
+extern NODE *mpg_node(unsigned int);
+extern const char *mpg_fmt(const char *, ...);
+extern int mpg_strtoui(mpz_ptr, char *, size_t, char **, int);
+#endif
/* msg.c */
extern void gawk_exit(int status);
-extern void err(const char *s, const char *emsg, va_list argp) ATTRIBUTE_PRINTF(2, 0);
+extern void final_exit(int status) ATTRIBUTE_NORETURN;
+extern void err(bool isfatal, const char *s, const char *emsg, va_list argp) ATTRIBUTE_PRINTF(3, 0);
extern void msg (const char *mesg, ...) ATTRIBUTE_PRINTF_1;
extern void error (const char *mesg, ...) ATTRIBUTE_PRINTF_1;
extern void warning (const char *mesg, ...) ATTRIBUTE_PRINTF_1;
@@ -1347,25 +1616,22 @@ extern void (*lintfunc) (const char *mesg, ...) ATTRIBUTE_PRINTF_1;
extern void (*lintfunc) (const char *mesg, ...);
#endif
/* profile.c */
-extern void init_profiling(int *flag, const char *def_file);
extern void init_profiling_signals(void);
extern void set_prof_file(const char *filename);
extern void dump_prog(INSTRUCTION *code);
-extern char *pp_number(AWKNUM d);
+extern char *pp_number(NODE *n);
extern char *pp_string(const char *in_str, size_t len, int delim);
extern char *pp_node(NODE *n);
extern int pp_func(INSTRUCTION *pc, void *);
extern void pp_string_fp(Func_print print_func, FILE *fp, const char *str,
- size_t namelen, int delim, int breaklines);
+ size_t namelen, int delim, bool breaklines);
/* node.c */
-extern AWKNUM r_force_number(NODE *n);
-extern NODE *format_val(const char *format, int index, NODE *s);
-extern NODE *r_force_string(NODE *s);
-extern NODE *dupnode(NODE *n);
-extern NODE *mk_number(AWKNUM x, unsigned int flags);
-extern NODE *r_make_str_node(const char *s, unsigned long len, int scan);
-extern NODE *more_nodes(void);
-extern void unref(NODE *tmp);
+extern NODE *r_force_number(NODE *n);
+extern NODE *r_format_val(const char *format, int index, NODE *s);
+extern NODE *r_dupnode(NODE *n);
+extern NODE *make_str_node(const char *s, size_t len, int flags);
+extern void *more_blocks(int id);
+extern void r_unref(NODE *tmp);
extern int parse_escape(const char **string_ptr);
#if MBS_SUPPORT
extern NODE *str2wstr(NODE *n, size_t **ptr);
@@ -1375,7 +1641,8 @@ extern const wchar_t *wstrstr(const wchar_t *haystack, size_t hs_len,
const wchar_t *needle, size_t needle_len);
extern const wchar_t *wcasestrstr(const wchar_t *haystack, size_t hs_len,
const wchar_t *needle, size_t needle_len);
-extern void free_wstr(NODE *n);
+extern void r_free_wstr(NODE *n);
+#define free_wstr(n) do { if ((n)->flags & WSTRCUR) r_free_wstr(n); } while(0)
extern wint_t btowc_cache[];
#define btowc_cache(x) btowc_cache[(x)&0xFF]
extern void init_btowc_cache();
@@ -1384,7 +1651,7 @@ extern void init_btowc_cache();
#define free_wstr(NODE) /* empty */
#endif
/* re.c */
-extern Regexp *make_regexp(const char *s, size_t len, int ignorecase, int dfa, int canfatal);
+extern Regexp *make_regexp(const char *s, size_t len, bool ignorecase, bool dfa, bool canfatal);
extern int research(Regexp *rp, char *str, int start, size_t len, int flags);
extern void refree(Regexp *rp);
extern void reg_error(const char *s);
@@ -1393,8 +1660,34 @@ extern void resyntax(int syntax);
extern void resetup(void);
extern int avoid_dfa(NODE *re, char *str, size_t len);
extern int reisstring(const char *text, size_t len, Regexp *re, const char *buf);
-extern int remaybelong(const char *text, size_t len);
-extern int isnondecimal(const char *str, int use_locale);
+extern int get_numbase(const char *str, bool use_locale);
+
+/* symbol.c */
+extern void load_symbols();
+extern void init_symbol_table();
+extern NODE *symbol_table;
+extern NODE *func_table;
+extern NODE *install_symbol(char *name, NODETYPE type);
+extern NODE *remove_symbol(NODE *r);
+extern void destroy_symbol(NODE *r);
+extern void release_symbols(NODE *symlist, int keep_globals);
+extern void append_symbol(NODE *r);
+extern NODE *lookup(const char *name);
+extern NODE *make_params(char **pnames, int pcount);
+extern void install_params(NODE *func);
+extern void remove_params(NODE *func);
+extern void release_all_vars(void);
+extern int foreach_func(NODE **table, int (*)(INSTRUCTION *, void *), void *);
+extern INSTRUCTION *bcalloc(OPCODE op, int size, int srcline);
+extern void bcfree(INSTRUCTION *);
+extern AWK_CONTEXT *new_context(void);
+extern void push_context(AWK_CONTEXT *ctxt);
+extern void pop_context();
+extern int in_main_context();
+extern void free_context(AWK_CONTEXT *ctxt, bool keep_globals);
+extern NODE **variable_list();
+extern NODE **function_list(int sort);
+extern void print_vars(NODE **table, Func_print print_func, FILE *fp);
/* floatcomp.c */
#ifdef VMS /* VMS linker weirdness? */
@@ -1410,8 +1703,6 @@ extern uintmax_t adjust_uint(uintmax_t n);
#define adjust_uint(n) (n)
#endif
-#define INVALID_HANDLE (-1)
-
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
diff --git a/awkgram.c b/awkgram.c
index ba32abcf..324ba1e3 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -83,20 +83,17 @@ static char *get_src_buf(void);
static int yylex(void);
int yyparse(void);
static INSTRUCTION *snode(INSTRUCTION *subn, INSTRUCTION *op);
-static int func_install(INSTRUCTION *fp, INSTRUCTION *def);
-static void pop_params(NODE *params);
-static NODE *make_param(char *pname);
+static char **check_params(char *fname, int pcount, INSTRUCTION *list);
+static int install_function(char *fname, INSTRUCTION *fi, INSTRUCTION *plist);
static NODE *mk_rexp(INSTRUCTION *exp);
-static void append_param(char *pname);
-static int dup_parms(INSTRUCTION *fp, NODE *func);
static void param_sanity(INSTRUCTION *arglist);
static int parms_shadow(INSTRUCTION *pc, int *shadow);
static int isnoeffect(OPCODE type);
static INSTRUCTION *make_assignable(INSTRUCTION *ip);
static void dumpintlstr(const char *str, size_t len);
static void dumpintlstr2(const char *str1, size_t len1, const char *str2, size_t len2);
-static int isarray(NODE *n);
static int include_source(INSTRUCTION *file);
+static int load_library(INSTRUCTION *file);
static void next_sourcefile(void);
static char *tokexpand(void);
@@ -104,6 +101,7 @@ static char *tokexpand(void);
static INSTRUCTION *mk_program(void);
static INSTRUCTION *append_rule(INSTRUCTION *pattern, INSTRUCTION *action);
+static INSTRUCTION *mk_function(INSTRUCTION *fi, INSTRUCTION *def);
static INSTRUCTION *mk_condition(INSTRUCTION *cond, INSTRUCTION *ifp, INSTRUCTION *true_branch,
INSTRUCTION *elsep, INSTRUCTION *false_branch);
static INSTRUCTION *mk_expression_list(INSTRUCTION *list, INSTRUCTION *s1);
@@ -115,23 +113,23 @@ static INSTRUCTION *mk_boolean(INSTRUCTION *left, INSTRUCTION *right, INSTRUCTIO
static INSTRUCTION *mk_assignment(INSTRUCTION *lhs, INSTRUCTION *rhs, INSTRUCTION *op);
static INSTRUCTION *mk_getline(INSTRUCTION *op, INSTRUCTION *opt_var, INSTRUCTION *redir, int redirtype);
static NODE *make_regnode(int type, NODE *exp);
-static int count_expressions(INSTRUCTION **list, int isarg);
+static int count_expressions(INSTRUCTION **list, bool isarg);
static INSTRUCTION *optimize_assignment(INSTRUCTION *exp);
static void add_lint(INSTRUCTION *list, LINTTYPE linttype);
-enum defref { FUNC_DEFINE, FUNC_USE };
+static void process_deferred();
+
+enum defref { FUNC_DEFINE, FUNC_USE, FUNC_EXT };
static void func_use(const char *name, enum defref how);
static void check_funcs(void);
-static void free_bcpool(INSTRUCTION *pl);
static ssize_t read_one_line(int fd, void *buffer, size_t count);
static int one_line_close(int fd);
-static void (*install_func)(char *) = NULL;
-
-static int want_source = FALSE;
-static int want_regexp; /* lexical scanning kludge */
-static int can_return; /* parsing kludge */
+static bool want_source = false;
+static bool want_regexp = false; /* lexical scanning kludge */
+static char *in_function; /* parsing kludge */
+static bool symtab_used = false; /* program used SYMTAB */
static int rule = 0;
const char *const ruletab[] = {
@@ -143,50 +141,39 @@ const char *const ruletab[] = {
"ENDFILE",
};
-static int in_print = FALSE; /* lexical scanning kludge for print */
+static bool in_print = false; /* lexical scanning kludge for print */
static int in_parens = 0; /* lexical scanning kludge for print */
static int sub_counter = 0; /* array dimension counter for use in delete */
static char *lexptr = NULL; /* pointer to next char during parsing */
static char *lexend;
static char *lexptr_begin; /* keep track of where we were for error msgs */
static char *lexeme; /* beginning of lexeme for debugging */
-static int lexeof; /* seen EOF for current source? */
+static bool lexeof; /* seen EOF for current source? */
static char *thisline = NULL;
static int in_braces = 0; /* count braces for firstline, lastline in an 'action' */
static int lastline = 0;
static int firstline = 0;
static SRCFILE *sourcefile = NULL; /* current program source */
static int lasttok = 0;
-static int eof_warned = FALSE; /* GLOBAL: want warning for each file */
+static bool eof_warned = false; /* GLOBAL: want warning for each file */
static int break_allowed; /* kludge for break */
static int continue_allowed; /* kludge for continue */
-
#define END_FILE -1000
#define END_SRC -2000
#define YYDEBUG_LEXER_TEXT (lexeme)
-static int param_counter;
-static NODE *func_params; /* list of parameters for the current function */
static char *tokstart = NULL;
static char *tok = NULL;
static char *tokend;
static int errcount = 0;
-static NODE *symbol_list;
-extern void destroy_symbol(char *name);
-
-static long func_count; /* total number of functions */
-
-#define HASHSIZE 1021 /* this constant only used here */
-NODE *variables[HASHSIZE];
-static int var_count; /* total number of global variables */
-
extern char *source;
extern int sourceline;
extern SRCFILE *srcfiles;
extern INSTRUCTION *rule_list;
extern int max_args;
+extern NODE **args_array;
static INSTRUCTION *rule_block[sizeof(ruletab)];
@@ -203,21 +190,11 @@ static inline INSTRUCTION *list_prepend(INSTRUCTION *l, INSTRUCTION *x);
static inline INSTRUCTION *list_merge(INSTRUCTION *l1, INSTRUCTION *l2);
extern double fmod(double x, double y);
-/*
- * This string cannot occur as a real awk identifier.
- * Use it as a special token to make function parsing
- * uniform, but if it's seen, don't install the function.
- * e.g.
- * function split(x) { return x }
- * function x(a) { return a }
- * should only produce one error message, and not core dump.
- */
-static char builtin_func[] = "@builtin";
#define YYSTYPE INSTRUCTION *
/* Line 360 of yacc.c */
-#line 221 "awkgram.c"
+#line 198 "awkgram.c"
# ifndef YY_NULL
# if defined __cplusplus && 201103L <= __cplusplus
@@ -297,9 +274,10 @@ extern int yydebug;
LEX_EOF = 302,
LEX_INCLUDE = 303,
LEX_EVAL = 304,
- NEWLINE = 305,
- SLASH_BEFORE_EQUAL = 306,
- UNARY = 307
+ LEX_LOAD = 305,
+ NEWLINE = 306,
+ SLASH_BEFORE_EQUAL = 307,
+ UNARY = 308
};
#endif
/* Tokens. */
@@ -350,9 +328,10 @@ extern int yydebug;
#define LEX_EOF 302
#define LEX_INCLUDE 303
#define LEX_EVAL 304
-#define NEWLINE 305
-#define SLASH_BEFORE_EQUAL 306
-#define UNARY 307
+#define LEX_LOAD 305
+#define NEWLINE 306
+#define SLASH_BEFORE_EQUAL 307
+#define UNARY 308
@@ -384,7 +363,7 @@ int yyparse ();
/* Copy the second part of user declarations. */
/* Line 379 of yacc.c */
-#line 388 "awkgram.c"
+#line 367 "awkgram.c"
#ifdef short
# undef short
@@ -601,20 +580,20 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 2
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 1157
+#define YYLAST 1155
/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 74
+#define YYNTOKENS 75
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 65
/* YYNRULES -- Number of rules. */
-#define YYNRULES 185
+#define YYNRULES 188
/* YYNRULES -- Number of states. */
-#define YYNSTATES 330
+#define YYNSTATES 335
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
-#define YYMAXUTOK 307
+#define YYMAXUTOK 308
#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
@@ -625,16 +604,16 @@ static const yytype_uint8 yytranslate[] =
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 62, 2, 2, 65, 61, 2, 2,
- 66, 67, 59, 57, 54, 58, 2, 60, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 53, 73,
- 55, 2, 56, 52, 68, 2, 2, 2, 2, 2,
+ 2, 2, 2, 63, 2, 2, 66, 62, 2, 2,
+ 67, 68, 60, 58, 55, 59, 2, 61, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 54, 74,
+ 56, 2, 57, 53, 69, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 69, 2, 70, 64, 2, 2, 2, 2, 2,
+ 2, 70, 2, 71, 65, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 71, 2, 72, 2, 2, 2, 2,
+ 2, 2, 2, 72, 2, 73, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -652,7 +631,7 @@ static const yytype_uint8 yytranslate[] =
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
- 45, 46, 47, 48, 49, 50, 51, 63
+ 45, 46, 47, 48, 49, 50, 51, 52, 64
};
#if YYDEBUG
@@ -661,111 +640,112 @@ static const yytype_uint8 yytranslate[] =
static const yytype_uint16 yyprhs[] =
{
0, 0, 3, 4, 7, 10, 13, 16, 19, 22,
- 25, 30, 32, 35, 37, 38, 40, 45, 47, 49,
- 51, 53, 59, 61, 63, 65, 68, 70, 72, 73,
- 81, 82, 86, 88, 90, 91, 94, 97, 99, 102,
- 105, 109, 111, 121, 128, 137, 146, 159, 171, 173,
- 176, 179, 182, 185, 189, 190, 195, 198, 199, 204,
- 205, 210, 215, 217, 218, 220, 221, 224, 227, 233,
- 238, 240, 243, 246, 248, 250, 252, 254, 256, 260,
- 261, 262, 266, 273, 283, 285, 288, 289, 291, 292,
- 295, 296, 298, 300, 304, 306, 309, 313, 314, 316,
- 317, 319, 321, 325, 327, 330, 334, 338, 342, 346,
- 350, 354, 358, 362, 368, 370, 372, 374, 377, 379,
- 381, 383, 385, 387, 389, 392, 394, 398, 402, 406,
- 410, 414, 418, 422, 425, 428, 434, 439, 443, 447,
- 451, 455, 459, 463, 465, 468, 472, 477, 482, 484,
- 486, 488, 491, 494, 496, 498, 501, 504, 506, 509,
- 514, 515, 517, 518, 521, 523, 526, 528, 532, 534,
- 537, 540, 542, 545, 547, 551, 553, 555, 556, 559,
- 562, 564, 565, 567, 569, 571
+ 25, 30, 35, 37, 40, 42, 44, 47, 49, 50,
+ 52, 57, 59, 61, 63, 65, 71, 73, 75, 77,
+ 80, 82, 84, 91, 92, 96, 98, 100, 101, 104,
+ 107, 109, 112, 115, 119, 121, 131, 138, 147, 156,
+ 169, 181, 183, 186, 189, 192, 195, 199, 200, 205,
+ 208, 209, 214, 215, 220, 225, 227, 228, 230, 231,
+ 234, 237, 243, 248, 250, 253, 256, 258, 260, 262,
+ 264, 266, 270, 271, 272, 276, 283, 293, 295, 298,
+ 299, 301, 302, 305, 306, 308, 310, 314, 316, 319,
+ 323, 324, 326, 327, 329, 331, 335, 337, 340, 344,
+ 348, 352, 356, 360, 364, 368, 372, 378, 380, 382,
+ 384, 387, 389, 391, 393, 395, 397, 399, 402, 404,
+ 408, 412, 416, 420, 424, 428, 432, 435, 438, 444,
+ 449, 453, 457, 461, 465, 469, 473, 475, 478, 482,
+ 487, 492, 494, 496, 498, 501, 504, 506, 508, 511,
+ 514, 516, 519, 524, 525, 527, 528, 531, 533, 536,
+ 538, 542, 544, 547, 550, 552, 555, 557, 561, 563,
+ 565, 566, 569, 572, 574, 575, 577, 579, 581
};
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
static const yytype_int16 yyrhs[] =
{
- 75, 0, -1, -1, 75, 76, -1, 75, 104, -1,
- 75, 47, -1, 75, 1, -1, 78, 79, -1, 78,
- 88, -1, 82, 79, -1, 68, 48, 77, 88, -1,
- 6, -1, 6, 1, -1, 1, -1, -1, 112, -1,
- 112, 54, 105, 112, -1, 17, -1, 18, -1, 36,
- -1, 37, -1, 132, 87, 133, 135, 105, -1, 4,
- -1, 3, -1, 81, -1, 68, 49, -1, 45, -1,
- 46, -1, -1, 35, 83, 80, 66, 107, 134, 105,
- -1, -1, 86, 85, 5, -1, 60, -1, 51, -1,
- -1, 87, 89, -1, 87, 1, -1, 104, -1, 136,
- 105, -1, 136, 105, -1, 132, 87, 133, -1, 103,
- -1, 23, 66, 112, 134, 105, 132, 96, 105, 133,
- -1, 26, 66, 112, 134, 105, 89, -1, 27, 105,
- 89, 26, 66, 112, 134, 105, -1, 28, 66, 4,
- 40, 129, 134, 105, 89, -1, 28, 66, 95, 136,
- 105, 112, 136, 105, 95, 134, 105, 89, -1, 28,
- 66, 95, 136, 105, 136, 105, 95, 134, 105, 89,
- -1, 90, -1, 29, 88, -1, 30, 88, -1, 33,
- 88, -1, 39, 88, -1, 34, 109, 88, -1, -1,
- 21, 91, 109, 88, -1, 92, 88, -1, -1, 99,
- 93, 100, 101, -1, -1, 22, 4, 94, 123, -1,
- 22, 66, 4, 67, -1, 112, -1, -1, 92, -1,
- -1, 96, 97, -1, 96, 1, -1, 24, 98, 137,
- 105, 87, -1, 25, 137, 105, 87, -1, 7, -1,
- 58, 7, -1, 57, 7, -1, 8, -1, 84, -1,
- 31, -1, 32, -1, 110, -1, 66, 111, 134, -1,
- -1, -1, 10, 102, 116, -1, 19, 66, 112, 134,
- 105, 89, -1, 19, 66, 112, 134, 105, 89, 20,
- 105, 89, -1, 50, -1, 104, 50, -1, -1, 104,
- -1, -1, 55, 117, -1, -1, 108, -1, 4, -1,
- 108, 138, 4, -1, 1, -1, 108, 1, -1, 108,
- 138, 1, -1, -1, 112, -1, -1, 111, -1, 112,
- -1, 111, 138, 112, -1, 1, -1, 111, 1, -1,
- 111, 1, 112, -1, 111, 138, 1, -1, 130, 113,
- 112, -1, 112, 41, 112, -1, 112, 42, 112, -1,
- 112, 14, 112, -1, 112, 40, 129, -1, 112, 115,
- 112, -1, 112, 52, 112, 53, 112, -1, 116, -1,
- 13, -1, 12, -1, 51, 13, -1, 9, -1, 55,
- -1, 114, -1, 56, -1, 117, -1, 118, -1, 116,
- 117, -1, 119, -1, 117, 64, 117, -1, 117, 59,
- 117, -1, 117, 60, 117, -1, 117, 61, 117, -1,
- 117, 57, 117, -1, 117, 58, 117, -1, 38, 122,
- 106, -1, 130, 43, -1, 130, 44, -1, 66, 111,
- 134, 40, 129, -1, 116, 11, 38, 122, -1, 118,
- 64, 117, -1, 118, 59, 117, -1, 118, 60, 117,
- -1, 118, 61, 117, -1, 118, 57, 117, -1, 118,
- 58, 117, -1, 84, -1, 62, 117, -1, 66, 112,
- 134, -1, 45, 66, 110, 134, -1, 46, 66, 110,
- 134, -1, 46, -1, 120, -1, 130, -1, 43, 130,
- -1, 44, 130, -1, 7, -1, 8, -1, 58, 117,
- -1, 57, 117, -1, 121, -1, 68, 121, -1, 3,
- 66, 110, 134, -1, -1, 130, -1, -1, 124, 16,
- -1, 125, -1, 124, 125, -1, 126, -1, 69, 111,
- 70, -1, 126, -1, 127, 126, -1, 127, 16, -1,
- 4, -1, 4, 128, -1, 129, -1, 65, 119, 131,
- -1, 43, -1, 44, -1, -1, 71, 105, -1, 72,
- 105, -1, 67, -1, -1, 136, -1, 73, -1, 53,
- -1, 54, 105, -1
+ 76, 0, -1, -1, 76, 77, -1, 76, 105, -1,
+ 76, 47, -1, 76, 1, -1, 80, 81, -1, 80,
+ 89, -1, 84, 81, -1, 69, 48, 78, 89, -1,
+ 69, 50, 79, 89, -1, 6, -1, 6, 1, -1,
+ 1, -1, 6, -1, 6, 1, -1, 1, -1, -1,
+ 113, -1, 113, 55, 106, 113, -1, 17, -1, 18,
+ -1, 36, -1, 37, -1, 133, 88, 134, 136, 106,
+ -1, 4, -1, 3, -1, 83, -1, 69, 49, -1,
+ 45, -1, 46, -1, 35, 82, 67, 108, 135, 106,
+ -1, -1, 87, 86, 5, -1, 61, -1, 52, -1,
+ -1, 88, 90, -1, 88, 1, -1, 105, -1, 137,
+ 106, -1, 137, 106, -1, 133, 88, 134, -1, 104,
+ -1, 23, 67, 113, 135, 106, 133, 97, 106, 134,
+ -1, 26, 67, 113, 135, 106, 90, -1, 27, 106,
+ 90, 26, 67, 113, 135, 106, -1, 28, 67, 4,
+ 40, 130, 135, 106, 90, -1, 28, 67, 96, 137,
+ 106, 113, 137, 106, 96, 135, 106, 90, -1, 28,
+ 67, 96, 137, 106, 137, 106, 96, 135, 106, 90,
+ -1, 91, -1, 29, 89, -1, 30, 89, -1, 33,
+ 89, -1, 39, 89, -1, 34, 110, 89, -1, -1,
+ 21, 92, 110, 89, -1, 93, 89, -1, -1, 100,
+ 94, 101, 102, -1, -1, 22, 4, 95, 124, -1,
+ 22, 67, 4, 68, -1, 113, -1, -1, 93, -1,
+ -1, 97, 98, -1, 97, 1, -1, 24, 99, 138,
+ 106, 88, -1, 25, 138, 106, 88, -1, 7, -1,
+ 59, 7, -1, 58, 7, -1, 8, -1, 85, -1,
+ 31, -1, 32, -1, 111, -1, 67, 112, 135, -1,
+ -1, -1, 10, 103, 117, -1, 19, 67, 113, 135,
+ 106, 90, -1, 19, 67, 113, 135, 106, 90, 20,
+ 106, 90, -1, 51, -1, 105, 51, -1, -1, 105,
+ -1, -1, 56, 118, -1, -1, 109, -1, 4, -1,
+ 109, 139, 4, -1, 1, -1, 109, 1, -1, 109,
+ 139, 1, -1, -1, 113, -1, -1, 112, -1, 113,
+ -1, 112, 139, 113, -1, 1, -1, 112, 1, -1,
+ 112, 1, 113, -1, 112, 139, 1, -1, 131, 114,
+ 113, -1, 113, 41, 113, -1, 113, 42, 113, -1,
+ 113, 14, 113, -1, 113, 40, 130, -1, 113, 116,
+ 113, -1, 113, 53, 113, 54, 113, -1, 117, -1,
+ 13, -1, 12, -1, 52, 13, -1, 9, -1, 56,
+ -1, 115, -1, 57, -1, 118, -1, 119, -1, 117,
+ 118, -1, 120, -1, 118, 65, 118, -1, 118, 60,
+ 118, -1, 118, 61, 118, -1, 118, 62, 118, -1,
+ 118, 58, 118, -1, 118, 59, 118, -1, 38, 123,
+ 107, -1, 131, 43, -1, 131, 44, -1, 67, 112,
+ 135, 40, 130, -1, 117, 11, 38, 123, -1, 119,
+ 65, 118, -1, 119, 60, 118, -1, 119, 61, 118,
+ -1, 119, 62, 118, -1, 119, 58, 118, -1, 119,
+ 59, 118, -1, 85, -1, 63, 118, -1, 67, 113,
+ 135, -1, 45, 67, 111, 135, -1, 46, 67, 111,
+ 135, -1, 46, -1, 121, -1, 131, -1, 43, 131,
+ -1, 44, 131, -1, 7, -1, 8, -1, 59, 118,
+ -1, 58, 118, -1, 122, -1, 69, 122, -1, 3,
+ 67, 111, 135, -1, -1, 131, -1, -1, 125, 16,
+ -1, 126, -1, 125, 126, -1, 127, -1, 70, 112,
+ 71, -1, 127, -1, 128, 127, -1, 128, 16, -1,
+ 4, -1, 4, 129, -1, 130, -1, 66, 120, 132,
+ -1, 43, -1, 44, -1, -1, 72, 106, -1, 73,
+ 106, -1, 68, -1, -1, 137, -1, 74, -1, 54,
+ -1, 55, 106, -1
};
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 218, 218, 220, 225, 226, 230, 242, 246, 257,
- 265, 273, 281, 283, 289, 290, 292, 318, 329, 340,
- 346, 355, 365, 367, 369, 380, 385, 386, 391, 390,
- 420, 419, 452, 454, 459, 460, 473, 478, 479, 483,
- 485, 487, 494, 584, 626, 668, 781, 788, 795, 805,
- 814, 823, 832, 843, 859, 858, 870, 882, 882, 978,
- 978, 1004, 1027, 1033, 1034, 1040, 1041, 1048, 1053, 1065,
- 1079, 1081, 1087, 1092, 1094, 1102, 1104, 1113, 1114, 1122,
- 1127, 1127, 1138, 1142, 1150, 1151, 1154, 1156, 1161, 1162,
- 1169, 1171, 1175, 1181, 1188, 1190, 1192, 1199, 1200, 1206,
- 1207, 1212, 1214, 1219, 1221, 1223, 1225, 1231, 1238, 1240,
- 1242, 1258, 1268, 1275, 1277, 1282, 1284, 1286, 1294, 1296,
- 1301, 1303, 1308, 1310, 1312, 1365, 1367, 1369, 1371, 1373,
- 1375, 1377, 1379, 1402, 1407, 1412, 1437, 1443, 1445, 1447,
- 1449, 1451, 1453, 1458, 1462, 1493, 1495, 1501, 1507, 1520,
- 1521, 1522, 1527, 1532, 1536, 1540, 1552, 1565, 1570, 1606,
- 1624, 1625, 1631, 1632, 1637, 1639, 1646, 1663, 1680, 1682,
- 1689, 1694, 1702, 1716, 1728, 1737, 1741, 1745, 1749, 1753,
- 1757, 1760, 1762, 1766, 1770, 1774
+ 0, 195, 195, 197, 202, 203, 209, 221, 225, 236,
+ 242, 247, 255, 263, 265, 270, 278, 280, 286, 287,
+ 289, 315, 326, 337, 343, 352, 362, 364, 366, 372,
+ 377, 378, 382, 401, 400, 434, 436, 441, 442, 455,
+ 460, 461, 465, 467, 469, 476, 566, 608, 650, 763,
+ 770, 777, 787, 796, 805, 814, 825, 841, 840, 864,
+ 876, 876, 974, 974, 1007, 1037, 1043, 1044, 1050, 1051,
+ 1058, 1063, 1075, 1089, 1091, 1099, 1104, 1106, 1114, 1116,
+ 1125, 1126, 1134, 1139, 1139, 1150, 1154, 1162, 1163, 1166,
+ 1168, 1173, 1174, 1183, 1184, 1189, 1194, 1200, 1202, 1204,
+ 1211, 1212, 1218, 1219, 1224, 1226, 1231, 1233, 1235, 1237,
+ 1243, 1250, 1252, 1254, 1270, 1280, 1287, 1289, 1294, 1296,
+ 1298, 1306, 1308, 1313, 1315, 1320, 1322, 1324, 1374, 1376,
+ 1378, 1380, 1382, 1384, 1386, 1388, 1411, 1416, 1421, 1446,
+ 1452, 1454, 1456, 1458, 1460, 1462, 1467, 1471, 1503, 1505,
+ 1511, 1517, 1530, 1531, 1532, 1537, 1542, 1546, 1550, 1565,
+ 1578, 1583, 1619, 1637, 1638, 1644, 1645, 1650, 1652, 1659,
+ 1676, 1693, 1695, 1702, 1707, 1715, 1725, 1737, 1746, 1750,
+ 1754, 1758, 1762, 1766, 1769, 1771, 1775, 1779, 1783
};
#endif
@@ -783,22 +763,22 @@ static const char *const yytname[] =
"LEX_FUNCTION", "LEX_BEGINFILE", "LEX_ENDFILE", "LEX_GETLINE",
"LEX_NEXTFILE", "LEX_IN", "LEX_AND", "LEX_OR", "INCREMENT", "DECREMENT",
"LEX_BUILTIN", "LEX_LENGTH", "LEX_EOF", "LEX_INCLUDE", "LEX_EVAL",
- "NEWLINE", "SLASH_BEFORE_EQUAL", "'?'", "':'", "','", "'<'", "'>'",
- "'+'", "'-'", "'*'", "'/'", "'%'", "'!'", "UNARY", "'^'", "'$'", "'('",
- "')'", "'@'", "'['", "']'", "'{'", "'}'", "';'", "$accept", "program",
- "rule", "source", "pattern", "action", "func_name", "lex_builtin",
- "function_prologue", "$@1", "regexp", "$@2", "a_slash", "statements",
- "statement_term", "statement", "non_compound_stmt", "$@3", "simple_stmt",
- "$@4", "$@5", "opt_simple_stmt", "case_statements", "case_statement",
- "case_value", "print", "print_expression_list", "output_redir", "$@6",
- "if_statement", "nls", "opt_nls", "input_redir", "opt_param_list",
- "param_list", "opt_exp", "opt_expression_list", "expression_list", "exp",
- "assign_operator", "relop_or_less", "a_relop", "common_exp", "simp_exp",
- "simp_exp_nc", "non_post_simp_exp", "func_call", "direct_func_call",
- "opt_variable", "delete_subscript_list", "delete_subscript",
- "delete_exp_list", "bracketed_exp_list", "subscript", "subscript_list",
- "simple_variable", "variable", "opt_incdec", "l_brace", "r_brace",
- "r_paren", "opt_semi", "semi", "colon", "comma", YY_NULL
+ "LEX_LOAD", "NEWLINE", "SLASH_BEFORE_EQUAL", "'?'", "':'", "','", "'<'",
+ "'>'", "'+'", "'-'", "'*'", "'/'", "'%'", "'!'", "UNARY", "'^'", "'$'",
+ "'('", "')'", "'@'", "'['", "']'", "'{'", "'}'", "';'", "$accept",
+ "program", "rule", "source", "library", "pattern", "action", "func_name",
+ "lex_builtin", "function_prologue", "regexp", "$@1", "a_slash",
+ "statements", "statement_term", "statement", "non_compound_stmt", "$@2",
+ "simple_stmt", "$@3", "$@4", "opt_simple_stmt", "case_statements",
+ "case_statement", "case_value", "print", "print_expression_list",
+ "output_redir", "$@5", "if_statement", "nls", "opt_nls", "input_redir",
+ "opt_param_list", "param_list", "opt_exp", "opt_expression_list",
+ "expression_list", "exp", "assign_operator", "relop_or_less", "a_relop",
+ "common_exp", "simp_exp", "simp_exp_nc", "non_post_simp_exp",
+ "func_call", "direct_func_call", "opt_variable", "delete_subscript_list",
+ "delete_subscript", "delete_exp_list", "bracketed_exp_list", "subscript",
+ "subscript_list", "simple_variable", "variable", "opt_incdec", "l_brace",
+ "r_brace", "r_paren", "opt_semi", "semi", "colon", "comma", YY_NULL
};
#endif
@@ -812,58 +792,58 @@ static const yytype_uint16 yytoknum[] =
275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
- 305, 306, 63, 58, 44, 60, 62, 43, 45, 42,
- 47, 37, 33, 307, 94, 36, 40, 41, 64, 91,
- 93, 123, 125, 59
+ 305, 306, 307, 63, 58, 44, 60, 62, 43, 45,
+ 42, 47, 37, 33, 308, 94, 36, 40, 41, 64,
+ 91, 93, 123, 125, 59
};
# endif
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const yytype_uint8 yyr1[] =
{
- 0, 74, 75, 75, 75, 75, 75, 76, 76, 76,
- 76, 77, 77, 77, 78, 78, 78, 78, 78, 78,
- 78, 79, 80, 80, 80, 80, 81, 81, 83, 82,
- 85, 84, 86, 86, 87, 87, 87, 88, 88, 89,
- 89, 89, 89, 89, 89, 89, 89, 89, 89, 90,
- 90, 90, 90, 90, 91, 90, 90, 93, 92, 94,
- 92, 92, 92, 95, 95, 96, 96, 96, 97, 97,
- 98, 98, 98, 98, 98, 99, 99, 100, 100, 101,
- 102, 101, 103, 103, 104, 104, 105, 105, 106, 106,
- 107, 107, 108, 108, 108, 108, 108, 109, 109, 110,
- 110, 111, 111, 111, 111, 111, 111, 112, 112, 112,
- 112, 112, 112, 112, 112, 113, 113, 113, 114, 114,
- 115, 115, 116, 116, 116, 117, 117, 117, 117, 117,
- 117, 117, 117, 117, 117, 117, 118, 118, 118, 118,
- 118, 118, 118, 119, 119, 119, 119, 119, 119, 119,
- 119, 119, 119, 119, 119, 119, 119, 120, 120, 121,
- 122, 122, 123, 123, 124, 124, 125, 126, 127, 127,
- 128, 129, 129, 130, 130, 131, 131, 131, 132, 133,
- 134, 135, 135, 136, 137, 138
+ 0, 75, 76, 76, 76, 76, 76, 77, 77, 77,
+ 77, 77, 78, 78, 78, 79, 79, 79, 80, 80,
+ 80, 80, 80, 80, 80, 81, 82, 82, 82, 82,
+ 83, 83, 84, 86, 85, 87, 87, 88, 88, 88,
+ 89, 89, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 91, 91, 91, 91, 91, 92, 91, 91,
+ 94, 93, 95, 93, 93, 93, 96, 96, 97, 97,
+ 97, 98, 98, 99, 99, 99, 99, 99, 100, 100,
+ 101, 101, 102, 103, 102, 104, 104, 105, 105, 106,
+ 106, 107, 107, 108, 108, 109, 109, 109, 109, 109,
+ 110, 110, 111, 111, 112, 112, 112, 112, 112, 112,
+ 113, 113, 113, 113, 113, 113, 113, 113, 114, 114,
+ 114, 115, 115, 116, 116, 117, 117, 117, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 119,
+ 119, 119, 119, 119, 119, 119, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 121, 121, 122, 123, 123, 124, 124, 125, 125, 126,
+ 127, 128, 128, 129, 130, 130, 131, 131, 132, 132,
+ 132, 133, 134, 135, 136, 136, 137, 138, 139
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
static const yytype_uint8 yyr2[] =
{
0, 2, 0, 2, 2, 2, 2, 2, 2, 2,
- 4, 1, 2, 1, 0, 1, 4, 1, 1, 1,
- 1, 5, 1, 1, 1, 2, 1, 1, 0, 7,
- 0, 3, 1, 1, 0, 2, 2, 1, 2, 2,
- 3, 1, 9, 6, 8, 8, 12, 11, 1, 2,
- 2, 2, 2, 3, 0, 4, 2, 0, 4, 0,
- 4, 4, 1, 0, 1, 0, 2, 2, 5, 4,
- 1, 2, 2, 1, 1, 1, 1, 1, 3, 0,
- 0, 3, 6, 9, 1, 2, 0, 1, 0, 2,
- 0, 1, 1, 3, 1, 2, 3, 0, 1, 0,
- 1, 1, 3, 1, 2, 3, 3, 3, 3, 3,
- 3, 3, 3, 5, 1, 1, 1, 2, 1, 1,
- 1, 1, 1, 1, 2, 1, 3, 3, 3, 3,
- 3, 3, 3, 2, 2, 5, 4, 3, 3, 3,
- 3, 3, 3, 1, 2, 3, 4, 4, 1, 1,
- 1, 2, 2, 1, 1, 2, 2, 1, 2, 4,
- 0, 1, 0, 2, 1, 2, 1, 3, 1, 2,
- 2, 1, 2, 1, 3, 1, 1, 0, 2, 2,
- 1, 0, 1, 1, 1, 2
+ 4, 4, 1, 2, 1, 1, 2, 1, 0, 1,
+ 4, 1, 1, 1, 1, 5, 1, 1, 1, 2,
+ 1, 1, 6, 0, 3, 1, 1, 0, 2, 2,
+ 1, 2, 2, 3, 1, 9, 6, 8, 8, 12,
+ 11, 1, 2, 2, 2, 2, 3, 0, 4, 2,
+ 0, 4, 0, 4, 4, 1, 0, 1, 0, 2,
+ 2, 5, 4, 1, 2, 2, 1, 1, 1, 1,
+ 1, 3, 0, 0, 3, 6, 9, 1, 2, 0,
+ 1, 0, 2, 0, 1, 1, 3, 1, 2, 3,
+ 0, 1, 0, 1, 1, 3, 1, 2, 3, 3,
+ 3, 3, 3, 3, 3, 3, 5, 1, 1, 1,
+ 2, 1, 1, 1, 1, 1, 1, 2, 1, 3,
+ 3, 3, 3, 3, 3, 3, 2, 2, 5, 4,
+ 3, 3, 3, 3, 3, 3, 1, 2, 3, 4,
+ 4, 1, 1, 1, 2, 2, 1, 1, 2, 2,
+ 1, 2, 4, 0, 1, 0, 2, 1, 2, 1,
+ 3, 1, 2, 2, 1, 2, 1, 3, 1, 1,
+ 0, 2, 2, 1, 0, 1, 1, 1, 2
};
/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
@@ -871,392 +851,395 @@ static const yytype_uint8 yyr2[] =
means the default is an error. */
static const yytype_uint8 yydefact[] =
{
- 2, 0, 1, 6, 0, 171, 153, 154, 17, 18,
- 28, 19, 20, 160, 0, 0, 0, 148, 5, 84,
- 33, 0, 0, 32, 0, 0, 0, 0, 3, 0,
- 0, 143, 30, 4, 15, 114, 122, 123, 125, 149,
- 157, 173, 150, 0, 0, 168, 0, 172, 0, 88,
- 161, 151, 152, 0, 0, 0, 156, 150, 155, 144,
- 0, 177, 150, 103, 0, 101, 0, 158, 86, 183,
- 7, 8, 37, 34, 86, 9, 0, 85, 118, 0,
- 0, 0, 0, 0, 86, 119, 121, 120, 0, 0,
- 124, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 116, 115, 133, 134, 0, 0, 0,
- 0, 101, 0, 170, 169, 23, 22, 26, 27, 0,
- 0, 24, 0, 132, 0, 0, 0, 175, 176, 174,
- 104, 86, 180, 0, 0, 145, 13, 0, 0, 87,
- 178, 0, 38, 31, 110, 111, 108, 109, 0, 0,
- 112, 160, 130, 131, 127, 128, 129, 126, 141, 142,
- 138, 139, 140, 137, 117, 107, 159, 167, 25, 0,
- 89, 146, 147, 105, 185, 0, 106, 102, 12, 10,
- 36, 0, 54, 0, 0, 0, 86, 0, 0, 0,
- 75, 76, 0, 97, 0, 86, 35, 48, 0, 57,
- 41, 62, 34, 181, 86, 0, 16, 136, 94, 92,
- 0, 0, 135, 0, 97, 59, 0, 0, 0, 0,
- 63, 49, 50, 51, 0, 98, 52, 179, 56, 0,
- 0, 86, 182, 39, 113, 86, 95, 0, 0, 0,
- 162, 0, 0, 0, 0, 171, 64, 0, 53, 0,
- 79, 77, 40, 21, 29, 96, 93, 86, 55, 60,
- 0, 164, 166, 61, 86, 86, 0, 0, 86, 0,
- 80, 58, 0, 163, 165, 0, 0, 0, 0, 0,
- 78, 0, 82, 65, 43, 0, 86, 0, 86, 81,
- 86, 0, 86, 0, 86, 63, 0, 67, 0, 0,
- 66, 0, 44, 45, 63, 0, 83, 70, 73, 0,
- 0, 74, 0, 184, 86, 42, 0, 86, 72, 71,
- 86, 34, 86, 0, 34, 0, 0, 47, 0, 46
+ 2, 0, 1, 6, 0, 174, 156, 157, 21, 22,
+ 0, 23, 24, 163, 0, 0, 0, 151, 5, 87,
+ 36, 0, 0, 35, 0, 0, 0, 0, 3, 0,
+ 0, 146, 33, 4, 19, 117, 125, 126, 128, 152,
+ 160, 176, 153, 0, 0, 171, 0, 175, 27, 26,
+ 30, 31, 0, 0, 28, 91, 164, 154, 155, 0,
+ 0, 0, 159, 153, 158, 147, 0, 180, 153, 106,
+ 0, 104, 0, 0, 161, 89, 186, 7, 8, 40,
+ 37, 89, 9, 0, 88, 121, 0, 0, 0, 0,
+ 0, 89, 122, 124, 123, 0, 0, 127, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 119, 118, 136, 137, 0, 0, 0, 0, 104, 0,
+ 173, 172, 29, 0, 0, 135, 0, 0, 0, 178,
+ 179, 177, 107, 89, 183, 0, 0, 148, 14, 0,
+ 0, 17, 0, 0, 90, 181, 0, 41, 34, 113,
+ 114, 111, 112, 0, 0, 115, 163, 133, 134, 130,
+ 131, 132, 129, 144, 145, 141, 142, 143, 140, 120,
+ 110, 162, 170, 97, 95, 0, 0, 92, 149, 150,
+ 108, 188, 0, 109, 105, 13, 10, 16, 11, 39,
+ 0, 57, 0, 0, 0, 89, 0, 0, 0, 78,
+ 79, 0, 100, 0, 89, 38, 51, 0, 60, 44,
+ 65, 37, 184, 89, 0, 20, 139, 89, 98, 0,
+ 138, 0, 100, 62, 0, 0, 0, 0, 66, 52,
+ 53, 54, 0, 101, 55, 182, 59, 0, 0, 89,
+ 185, 42, 116, 32, 99, 96, 0, 0, 165, 0,
+ 0, 0, 0, 174, 67, 0, 56, 0, 82, 80,
+ 43, 25, 89, 58, 63, 0, 167, 169, 64, 89,
+ 89, 0, 0, 89, 0, 83, 61, 0, 166, 168,
+ 0, 0, 0, 0, 0, 81, 0, 85, 68, 46,
+ 0, 89, 0, 89, 84, 89, 0, 89, 0, 89,
+ 66, 0, 70, 0, 0, 69, 0, 47, 48, 66,
+ 0, 86, 73, 76, 0, 0, 77, 0, 187, 89,
+ 45, 0, 89, 75, 74, 89, 37, 89, 0, 37,
+ 0, 0, 50, 0, 49
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] =
{
- -1, 1, 28, 138, 29, 70, 120, 121, 30, 48,
- 31, 76, 32, 141, 71, 196, 197, 214, 198, 229,
- 240, 247, 291, 300, 312, 199, 250, 271, 281, 200,
- 139, 140, 123, 210, 211, 224, 109, 110, 201, 108,
- 87, 88, 35, 36, 37, 38, 39, 40, 49, 259,
- 260, 261, 45, 46, 47, 41, 42, 129, 202, 203,
- 135, 231, 204, 314, 134
+ -1, 1, 28, 140, 143, 29, 77, 53, 54, 30,
+ 31, 83, 32, 146, 78, 205, 206, 222, 207, 237,
+ 248, 255, 296, 305, 317, 208, 258, 276, 286, 209,
+ 144, 145, 125, 175, 176, 232, 116, 117, 210, 115,
+ 94, 95, 35, 36, 37, 38, 39, 40, 55, 264,
+ 265, 266, 45, 46, 47, 41, 42, 131, 211, 212,
+ 137, 239, 213, 319, 136
};
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
-#define YYPACT_NINF -269
+#define YYPACT_NINF -273
static const yytype_int16 yypact[] =
{
- -269, 335, -269, -269, -31, -24, -269, -269, -269, -269,
- -269, -269, -269, 12, 12, 12, -19, -12, -269, -269,
- -269, 978, 978, -269, 978, 1023, 804, 21, -269, 115,
- -21, -269, -269, 8, 1062, 952, -20, 330, -269, -269,
- -269, -269, 246, 736, 804, -269, 2, -269, 205, 15,
- -269, -269, -269, 736, 736, 70, 52, 80, 52, 52,
- 978, 147, -269, -269, 50, 308, 174, -269, 64, -269,
- -269, -269, 8, -269, 64, -269, 129, -269, -269, 978,
- 143, 978, 978, 978, 64, -269, -269, -269, 978, 112,
- -20, 978, 978, 978, 978, 978, 978, 978, 978, 978,
- 978, 978, 978, -269, -269, -269, -269, 141, 978, 90,
- 152, 1101, 48, -269, -269, -269, -269, -269, -269, 111,
- 105, -269, 978, -269, 90, 90, 308, -269, -269, -269,
- 978, 64, -269, 134, 830, -269, -269, 13, -16, 8,
- -269, 552, -269, -269, 53, -269, 142, 300, 1081, 978,
- 103, 12, 185, 185, 52, 52, 52, 52, 185, 185,
- 52, 52, 52, 52, -269, 1101, -269, -269, -269, 63,
- -20, -269, -269, 1101, -269, 143, -269, 1101, -269, -269,
- -269, 121, -269, 6, 130, 137, 64, 139, -16, -16,
- -269, -269, -16, 978, -16, 64, -269, -269, -16, -269,
- -269, 1101, -269, 127, 64, 978, 1101, -269, -269, -269,
- 90, 118, -269, 978, 978, -269, 180, 978, 978, 665,
- 875, -269, -269, -269, -16, 1101, -269, -269, -269, 598,
- 552, 64, -269, -269, 1101, 64, -269, 28, 308, -16,
- -24, 140, 308, 308, 189, -14, -269, 127, -269, 804,
- 201, -269, -269, -269, -269, -269, -269, 64, -269, -269,
- 14, -269, -269, -269, 64, 64, 158, 143, 64, 50,
- -269, -269, 665, -269, -269, -21, 665, 978, 90, 710,
- 134, 978, 198, -269, -269, 308, 64, 1056, 64, 952,
- 64, 60, 64, 665, 64, 907, 665, -269, 119, 177,
- -269, 155, -269, -269, 907, 90, -269, -269, -269, 224,
- 228, -269, 177, -269, 64, -269, 90, 64, -269, -269,
- 64, -269, 64, 665, -269, 406, 665, -269, 479, -269
+ -273, 376, -273, -273, -27, -21, -273, -273, -273, -273,
+ 157, -273, -273, 11, 11, 11, -5, -3, -273, -273,
+ -273, 1019, 1019, -273, 1019, 1065, 821, 116, -273, -20,
+ 1, -273, -273, 35, 758, 992, 252, 296, -273, -273,
+ -273, -273, 233, 789, 821, -273, 2, -273, -273, -273,
+ -273, -273, 63, 54, -273, 69, -273, -273, -273, 789,
+ 789, 127, 87, 115, 87, 87, 1019, 131, -273, -273,
+ 55, 295, 40, 47, -273, 83, -273, -273, -273, 35,
+ -273, 83, -273, 151, -273, -273, 1019, 132, 1019, 1019,
+ 1019, 83, -273, -273, -273, 1019, 124, 252, 1019, 1019,
+ 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019,
+ -273, -273, -273, -273, 152, 1019, 100, 16, 1034, 37,
+ -273, -273, -273, 43, 1019, -273, 100, 100, 295, -273,
+ -273, -273, 1019, 83, -273, 137, 867, -273, -273, 75,
+ -19, -273, 77, -19, 35, -273, 596, -273, -273, 123,
+ -273, 141, 175, 1098, 1019, 161, 11, -26, -26, 87,
+ 87, 87, 87, -26, -26, 87, 87, 87, 87, -273,
+ 1034, -273, -273, -273, -273, 100, 65, 252, -273, -273,
+ 1034, -273, 132, -273, 1034, -273, -273, -273, -273, -273,
+ 104, -273, 26, 118, 119, 83, 121, -19, -19, -273,
+ -273, -19, 1019, -19, 83, -273, -273, -19, -273, -273,
+ 1034, -273, 117, 83, 1019, 1034, -273, 83, -273, 112,
+ -273, 1019, 1019, -273, 188, 1019, 1019, 710, 900, -273,
+ -273, -273, -19, 1034, -273, -273, -273, 642, 596, 83,
+ -273, -273, 1034, -273, -273, -273, 295, -19, -21, 126,
+ 295, 295, 169, -13, -273, 117, -273, 821, 186, -273,
+ -273, -273, 83, -273, -273, 13, -273, -273, -273, 83,
+ 83, 139, 132, 83, 55, -273, -273, 710, -273, -273,
+ 1, 710, 1019, 100, 743, 137, 1019, 192, -273, -273,
+ 295, 83, 286, 83, 992, 83, 44, 83, 710, 83,
+ 946, 710, -273, 247, 154, -273, 156, -273, -273, 946,
+ 100, -273, -273, -273, 226, 228, -273, 154, -273, 83,
+ -273, 100, 83, -273, -273, 83, -273, 83, 710, -273,
+ 448, 710, -273, 522, -273
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] =
{
- -269, -269, -269, -269, -269, 208, -269, -269, -269, -269,
- -58, -269, -269, -193, 72, -171, -269, -269, -189, -269,
- -269, -268, -269, -269, -269, -269, -269, -269, -269, -269,
- 45, 37, -269, -269, -269, 38, -48, -23, -1, -269,
- -269, -269, -26, 44, -269, 217, -269, 1, 102, -269,
- -269, -3, -39, -269, -269, -72, -2, -269, -28, -213,
- -49, -269, -25, -47, 66
+ -273, -273, -273, -273, -273, -273, 208, -273, -273, -273,
+ -64, -273, -273, -202, 71, -58, -273, -273, -218, -273,
+ -273, -272, -273, -273, -273, -273, -273, -273, -273, -273,
+ 50, 76, -273, -273, -273, 19, -54, -23, -1, -273,
+ -273, -273, -44, 39, -273, 224, -273, -11, 94, -273,
+ -273, -7, -38, -273, -273, -73, -2, -273, -28, -231,
+ -46, -273, -25, -57, 85
};
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
number is the opposite. If YYTABLE_NINF, syntax error. */
-#define YYTABLE_NINF -101
+#define YYTABLE_NINF -104
static const yytype_int16 yytable[] =
{
- 34, 73, 73, 64, 74, 124, 125, 114, 145, 230,
- 215, 50, 51, 52, 178, 133, 5, 252, 113, 57,
- 57, 112, 57, 62, 4, 65, 267, 305, 67, 255,
- 273, 246, 256, 57, 19, 43, 316, 91, 92, 93,
- 94, 95, 111, 111, 96, 44, 33, 53, 244, 130,
- 68, 130, 111, 111, 54, 44, 67, 69, 77, 126,
- 166, 297, 78, -11, 208, 56, 58, 209, 59, 66,
- 122, 44, 216, 4, 72, 171, 172, 25, 144, 90,
- 146, 147, 148, 44, 298, 299, -11, 150, 315, 57,
- 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
- 57, 282, 131, 212, 131, 284, 246, 165, 85, 86,
- 19, 142, -101, 74, 19, 246, 96, 132, 167, 236,
- 57, 149, 303, 105, 106, 306, 307, 308, 325, 173,
- -90, 328, -86, 177, 143, 152, 153, 154, 155, 156,
- 157, 158, 159, 160, 161, 162, 163, 5, 206, 50,
- 151, 78, 327, 130, 164, 329, 79, 132, -101, -101,
- 168, 235, -100, 74, 74, 19, 170, 74, 174, 74,
- 20, 169, 131, 74, 175, 136, 309, 310, 232, 23,
- 137, 251, 80, 72, 241, -91, 68, 213, 69, 257,
- 127, 128, 225, 264, 265, 278, 217, 85, 86, 74,
- 69, 262, -100, 218, 234, 220, 131, 263, 115, 116,
- 179, 270, 238, 225, 74, 266, 242, 243, 290, -100,
- 280, 262, 268, 219, 277, -100, 269, 195, 111, 286,
- 313, 318, 227, 72, 72, 319, 292, 72, 75, 72,
- 311, 233, 61, 72, 93, 94, 95, 283, 65, 96,
- 117, 118, 239, 207, 288, 289, 317, 274, 103, 104,
- 221, 222, 294, 0, 223, 320, 226, 322, 253, 72,
- 228, 0, 254, 119, 0, 0, 285, 237, 287, 57,
- 0, 0, 0, 0, 72, 0, 0, 57, 0, 105,
- 106, 0, 0, 0, 272, 0, 248, 107, 0, 0,
- 0, 275, 276, 0, 0, 279, 0, 0, 0, 78,
- 0, 258, 0, 0, 79, 0, 0, 78, 0, 0,
- 0, 0, 79, 293, 0, 295, 0, 296, 301, 302,
- 0, 304, 0, 90, 0, 2, 3, 0, 4, 5,
- 80, 81, 6, 7, 0, 0, 0, 0, 80, 81,
- 82, 321, 8, 9, 323, 85, 86, 324, 0, 326,
- 83, 0, 0, 85, 86, 0, 0, 0, 0, 0,
- 10, 11, 12, 13, 0, 132, 0, 0, 14, 15,
- 16, 17, 18, 0, 0, 19, 20, 97, 98, 99,
- 100, 101, 21, 22, 102, 23, 0, 24, 0, 0,
- 25, 26, 0, 27, 0, 0, -14, 180, -14, 4,
+ 34, 80, 80, 70, 81, 126, 127, 260, 121, 238,
+ 254, 56, 57, 58, 150, 5, 74, 132, 120, 63,
+ 63, 119, 63, 68, 135, 71, -103, 272, 310, 278,
+ 223, 19, 19, 63, 100, 101, 102, 321, 132, 103,
+ 43, 138, 118, 118, 173, 302, 139, 174, 141, 44,
+ 74, 33, 75, 142, 76, 76, 132, 44, 118, 118,
+ 62, 64, 59, 65, 60, 128, 218, -103, 303, 304,
+ 171, 133, 44, 75, 97, 320, 185, 25, 187, 79,
+ 178, 179, 254, 44, -103, 149, 84, 151, 152, 153,
+ -103, 254, 133, 224, 155, 19, 63, 63, 63, 63,
+ 63, 63, 63, 63, 63, 63, 63, 63, 172, 220,
+ 133, -93, 122, 244, 170, 81, 245, -89, 81, 4,
+ 133, 123, 63, 134, 330, 124, -12, 333, -15, 217,
+ 4, 180, 85, -94, 19, 184, 5, 157, 158, 159,
+ 160, 161, 162, 163, 164, 165, 166, 167, 168, -12,
+ 85, -15, 103, 215, 56, 86, 148, 147, 112, 113,
+ 48, 49, 156, 177, 72, 169, 73, 154, 134, 252,
+ -104, 221, 81, 81, 129, 130, 81, 182, 81, 92,
+ 93, 87, 81, 259, 85, 225, 226, 240, 228, 86,
+ 79, 76, 249, 79, 268, 271, 275, 92, 93, 283,
+ 262, 233, 50, 51, 269, 270, 282, 81, 318, 181,
+ 267, 186, 295, 242, 188, 87, 88, -104, -104, 287,
+ 246, 233, 81, 289, 250, 251, 52, 267, 285, 204,
+ 273, 92, 93, 323, 274, 324, 118, 291, 82, 316,
+ 308, 247, 294, 311, 297, 110, 111, 79, 79, 67,
+ 216, 79, 288, 79, 312, 313, 71, 79, 279, 293,
+ 325, 219, 0, 0, 322, 0, 0, 299, 229, 230,
+ 332, 227, 231, 334, 234, 327, 112, 113, 236, 0,
+ 235, 290, 79, 292, 63, 114, 0, 0, 0, 241,
+ 0, 0, 63, 243, 0, 85, 0, 79, 0, 20,
+ 86, 0, 0, 256, 85, 314, 315, 0, 23, 86,
+ 98, 99, 100, 101, 102, 261, 0, 103, 263, 0,
+ 0, 0, 0, 0, 0, 0, 87, 88, 89, 0,
+ 0, 0, 0, 97, 0, 87, 88, 89, 277, 90,
+ 0, 0, 92, 93, 0, 280, 281, 0, 90, 284,
+ 0, 92, 93, 0, 104, 105, 106, 107, 108, 0,
+ 76, 109, 0, 134, 0, 0, 0, 298, 0, 300,
+ 0, 301, 306, 307, 0, 309, 2, 3, 0, 4,
5, 0, 0, 6, 7, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 181, 0, 182, 183, 184,
- -69, -69, 185, 186, 187, 188, 189, 190, 191, 192,
- 193, 0, 0, 0, 13, 194, 0, 0, 0, 14,
- 15, 16, 17, 0, 0, 0, -69, 20, 0, 0,
- 0, 0, 0, 21, 22, 0, 23, 0, 24, 0,
- 0, 25, 26, 0, 55, 0, 0, 68, -69, 69,
- 180, 0, 4, 5, 0, 0, 6, 7, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 181, 0,
- 182, 183, 184, -68, -68, 185, 186, 187, 188, 189,
- 190, 191, 192, 193, 0, 0, 0, 13, 194, 0,
- 0, 0, 14, 15, 16, 17, 0, 0, 0, -68,
+ 0, 0, 0, 8, 9, 326, 0, 0, 328, 0,
+ 0, 329, 0, 331, 0, 0, 0, 0, 0, 0,
+ 0, 10, 11, 12, 13, 0, 0, 0, 0, 14,
+ 15, 16, 17, 18, 0, 0, 0, 19, 20, 0,
+ 0, 0, 0, 0, 21, 22, 0, 23, 0, 24,
+ 0, 0, 25, 26, 0, 27, 0, 0, -18, 189,
+ -18, 4, 5, 0, 0, 6, 7, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 190, 0, 191,
+ 192, 193, -72, -72, 194, 195, 196, 197, 198, 199,
+ 200, 201, 202, 0, 0, 0, 13, 203, 0, 0,
+ 0, 14, 15, 16, 17, 0, 0, 0, 0, -72,
20, 0, 0, 0, 0, 0, 21, 22, 0, 23,
- 0, 24, 0, 0, 25, 26, 0, 55, 0, 0,
- 68, -68, 69, 180, 0, 4, 5, 0, 0, 6,
+ 0, 24, 0, 0, 25, 26, 0, 61, 0, 0,
+ 75, -72, 76, 189, 0, 4, 5, 0, 0, 6,
7, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 181, 0, 182, 183, 184, 0, 0, 185, 186,
- 187, 188, 189, 190, 191, 192, 193, 0, 0, 0,
- 13, 194, 0, 0, 0, 14, 15, 16, 17, 63,
- 0, 4, 5, 20, 0, 6, 7, 0, -99, 21,
- 22, 0, 23, 0, 24, 0, 0, 25, 26, 0,
- 55, 0, 0, 68, 195, 69, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 13, 0, 0, 0,
- 0, 14, 15, 16, 17, 0, 0, 0, -99, 20,
- 0, 0, 0, 0, 0, 21, 22, 0, 23, 0,
- 24, 0, 0, 25, 249, -99, 55, 0, 4, 5,
- 0, -99, 6, 7, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 181, 0, 182, 183, 184, 0,
- 0, 185, 186, 187, 188, 189, 190, 191, 192, 193,
- 0, 0, 0, 13, 194, 0, 0, 0, 14, 15,
- 16, 17, 0, 4, 5, 0, 20, 6, 7, 0,
- 0, 0, 21, 22, 0, 23, 0, 24, 0, 0,
- 25, 26, 0, 55, 0, 0, 68, 63, 69, 4,
- 5, 0, 0, 6, 7, 0, 0, 0, 13, 0,
- 0, 0, 0, 14, 15, 16, 17, 0, 0, 0,
+ 0, 190, 0, 191, 192, 193, -71, -71, 194, 195,
+ 196, 197, 198, 199, 200, 201, 202, 0, 0, 0,
+ 13, 203, 0, 0, 0, 14, 15, 16, 17, 0,
+ 0, 0, 0, -71, 20, 0, 0, 0, 0, 0,
+ 21, 22, 0, 23, 0, 24, 0, 0, 25, 26,
+ 0, 61, 0, 0, 75, -71, 76, 189, 0, 4,
+ 5, 0, 0, 6, 7, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 190, 0, 191, 192, 193,
+ 0, 0, 194, 195, 196, 197, 198, 199, 200, 201,
+ 202, 0, 0, 0, 13, 203, 0, 0, 0, 14,
+ 15, 16, 17, 69, 0, 4, 5, 0, 20, 6,
+ 7, 0, -102, 0, 21, 22, 0, 23, 0, 24,
+ 0, 0, 25, 26, 0, 61, 0, 0, 75, 204,
+ 76, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 13, 0, 0, 0, 0, 14, 15, 16, 17, 0,
+ 0, 0, 0, -102, 20, 0, 0, 0, 0, 0,
+ 21, 22, 0, 23, 0, 24, 0, 0, 25, 257,
+ -102, 61, 0, 4, 5, 0, -102, 6, 7, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 190,
+ 0, 191, 192, 193, 0, 0, 194, 195, 196, 197,
+ 198, 199, 200, 201, 202, 0, 4, 5, 13, 203,
+ 6, 7, 0, 14, 15, 16, 17, 0, 0, 0,
+ 0, 0, 20, 0, 0, 0, 0, 85, 21, 22,
+ 0, 23, 86, 24, 0, 0, 25, 26, 0, 61,
+ 0, 13, 75, 0, 76, 0, 14, 15, 16, 17,
+ 69, 0, 4, 5, 0, 20, 6, 7, 87, 88,
+ 89, 21, 22, 0, 23, 0, 24, 0, 0, 25,
+ 26, 90, 61, 91, 92, 93, 0, 76, 0, 0,
+ 0, 0, 69, 0, 4, 5, 0, 13, 6, 7,
+ 0, 0, 14, 15, 16, 17, 0, 0, 0, 0,
0, 20, 0, 0, 0, 0, 0, 21, 22, 0,
- 23, 0, 24, 0, 13, 25, 26, 0, 55, 14,
- 15, 16, 17, 69, 0, 0, 0, 20, 0, 0,
- 0, 0, 0, 21, 22, 0, 23, 0, 24, 0,
- 0, 25, 26, -99, 55, 63, 0, 4, 5, 0,
- 0, 6, 7, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 176, 0, 4, 5, 0, 0, 6, 7, 0,
- 0, 0, 13, 0, 0, 0, 0, 14, 15, 16,
- 17, 0, 0, 0, 0, 20, 0, 0, 0, 0,
- 0, 21, 22, 0, 23, 0, 24, 0, 13, 25,
- 26, 0, 55, 14, 15, 16, 17, 0, 4, 245,
- 0, 20, 6, 7, 0, 0, 0, 21, 22, 0,
- 23, 0, 24, 0, 0, 25, 26, 183, 55, 0,
- 0, 0, 0, 0, 0, 0, 190, 191, 0, 0,
- 4, 5, 0, 13, 6, 7, 0, 0, 14, 15,
- 16, 17, 0, 0, 0, 0, 20, 0, 0, 183,
- 0, 0, 21, 22, 0, 23, 0, 24, 190, 191,
- 25, 26, 0, 55, 0, 13, 0, 0, 0, 0,
- 14, 15, 16, 17, 0, 4, 5, 0, 20, 6,
- 7, 0, 0, 89, 21, 22, 0, 23, 0, 24,
- 0, 0, 25, 26, 0, 55, 0, 0, 0, 0,
- 0, 4, 5, 0, 0, 6, 7, 0, 0, 0,
+ 23, 0, 24, 0, 0, 25, 26, -102, 61, 13,
+ 0, 0, 0, 0, 14, 15, 16, 17, 183, 0,
+ 4, 5, 0, 20, 6, 7, 0, 0, 0, 21,
+ 22, 0, 23, 0, 24, 0, 0, 25, 26, 0,
+ 61, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 4, 253, 13, 0, 6, 7, 0,
+ 14, 15, 16, 17, 0, 0, 0, 0, 0, 20,
+ 0, 0, 192, 0, 0, 21, 22, 0, 23, 0,
+ 24, 199, 200, 25, 26, 0, 61, 0, 13, 0,
+ 0, 0, 0, 14, 15, 16, 17, 0, 0, 4,
+ 5, 0, 20, 6, 7, 0, 0, 0, 21, 22,
+ 0, 23, 0, 24, 0, 0, 25, 26, 192, 61,
+ 0, 0, 0, 0, 0, 0, 0, 199, 200, 0,
+ 0, 0, 0, 0, 13, 0, 0, 0, 0, 14,
+ 15, 16, 17, 0, 0, 4, 5, 0, 20, 6,
+ 7, 0, 0, 96, 21, 22, 0, 23, 0, 24,
+ 0, 0, 25, 26, 0, 61, 0, 0, 0, 0,
+ 0, 0, 4, 5, 0, 0, 6, 7, 0, 0,
13, 0, 0, 0, 0, 14, 15, 16, 17, 0,
- 0, 0, 0, 20, 0, 0, 0, 0, 0, 21,
- 22, 0, 23, 0, 24, 0, 13, 25, 26, 0,
- 55, 14, 15, 16, 17, 0, 4, 5, 0, 20,
- 6, 7, 0, 0, 0, 21, 22, 0, 23, 0,
- 24, 0, 0, 25, 26, 0, 55, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 78, 14, 15, 16, 17,
- 79, 78, 0, 0, 20, 0, 79, 0, 0, 0,
- 21, 22, 0, 23, 0, 24, 0, 0, 25, 60,
- 78, 55, 0, 0, 0, 79, 80, 81, 82, 0,
- 0, 0, 80, 81, 82, 0, 0, 0, 83, 0,
- 78, 85, 86, 0, 83, 79, 84, 85, 86, 0,
- 0, 80, 81, 82, 0, 0, 0, 0, 0, 69,
- 0, 0, 0, 83, 205, 0, 85, 86, 0, 0,
- 0, 80, 81, 82, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 83, 0, 0, 85, 86
+ 0, 0, 0, 85, 20, 0, 0, 0, 86, 0,
+ 21, 22, 0, 23, 0, 24, 0, 13, 25, 26,
+ 0, 61, 14, 15, 16, 17, 0, 0, 4, 5,
+ 0, 20, 6, 7, 87, 88, 89, 21, 22, 0,
+ 23, 0, 24, 0, 0, 25, 26, 90, 61, 0,
+ 92, 93, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 85, 14, 15,
+ 16, 17, 86, 0, 0, 0, 0, 20, 0, 0,
+ 0, 0, 0, 21, 22, 0, 23, 0, 24, 0,
+ 0, 25, 66, 0, 61, 0, 0, 0, 87, 88,
+ 89, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 90, 214, 0, 92, 93
};
#define yypact_value_is_default(Yystate) \
- (!!((Yystate) == (-269)))
+ (!!((Yystate) == (-273)))
#define yytable_value_is_error(Yytable_value) \
- (!!((Yytable_value) == (-101)))
+ (!!((Yytable_value) == (-104)))
static const yytype_int16 yycheck[] =
{
- 1, 29, 30, 26, 29, 53, 54, 46, 80, 202,
- 4, 13, 14, 15, 1, 64, 4, 230, 16, 21,
- 22, 44, 24, 25, 3, 26, 40, 295, 27, 1,
- 16, 220, 4, 35, 50, 66, 304, 57, 58, 59,
- 60, 61, 43, 44, 64, 69, 1, 66, 219, 1,
- 71, 1, 53, 54, 66, 69, 55, 73, 50, 60,
- 109, 1, 9, 50, 1, 21, 22, 4, 24, 48,
- 55, 69, 66, 3, 29, 124, 125, 65, 79, 35,
- 81, 82, 83, 69, 24, 25, 73, 88, 301, 91,
- 92, 93, 94, 95, 96, 97, 98, 99, 100, 101,
- 102, 272, 54, 175, 54, 276, 295, 108, 55, 56,
- 50, 74, 9, 138, 50, 304, 64, 67, 70, 1,
- 122, 84, 293, 43, 44, 296, 7, 8, 321, 130,
- 67, 324, 72, 134, 5, 91, 92, 93, 94, 95,
- 96, 97, 98, 99, 100, 101, 102, 4, 149, 151,
- 38, 9, 323, 1, 13, 326, 14, 67, 55, 56,
- 49, 210, 10, 188, 189, 50, 122, 192, 131, 194,
- 51, 66, 54, 198, 40, 1, 57, 58, 203, 60,
- 6, 229, 40, 138, 4, 67, 71, 66, 73, 238,
- 43, 44, 193, 242, 243, 267, 66, 55, 56, 224,
- 73, 240, 50, 66, 205, 66, 54, 67, 3, 4,
- 138, 10, 213, 214, 239, 26, 217, 218, 20, 67,
- 269, 260, 247, 186, 66, 73, 249, 72, 229, 278,
- 53, 7, 195, 188, 189, 7, 285, 192, 30, 194,
- 298, 204, 25, 198, 59, 60, 61, 275, 249, 64,
- 45, 46, 214, 151, 279, 281, 305, 260, 12, 13,
- 188, 189, 287, -1, 192, 312, 194, 316, 231, 224,
- 198, -1, 235, 68, -1, -1, 277, 211, 279, 281,
- -1, -1, -1, -1, 239, -1, -1, 289, -1, 43,
- 44, -1, -1, -1, 257, -1, 224, 51, -1, -1,
- -1, 264, 265, -1, -1, 268, -1, -1, -1, 9,
- -1, 239, -1, -1, 14, -1, -1, 9, -1, -1,
- -1, -1, 14, 286, -1, 288, -1, 290, 291, 292,
- -1, 294, -1, 289, -1, 0, 1, -1, 3, 4,
- 40, 41, 7, 8, -1, -1, -1, -1, 40, 41,
- 42, 314, 17, 18, 317, 55, 56, 320, -1, 322,
- 52, -1, -1, 55, 56, -1, -1, -1, -1, -1,
- 35, 36, 37, 38, -1, 67, -1, -1, 43, 44,
- 45, 46, 47, -1, -1, 50, 51, 57, 58, 59,
- 60, 61, 57, 58, 64, 60, -1, 62, -1, -1,
- 65, 66, -1, 68, -1, -1, 71, 1, 73, 3,
+ 1, 29, 30, 26, 29, 59, 60, 238, 46, 211,
+ 228, 13, 14, 15, 87, 4, 27, 1, 16, 21,
+ 22, 44, 24, 25, 70, 26, 10, 40, 300, 16,
+ 4, 51, 51, 35, 60, 61, 62, 309, 1, 65,
+ 67, 1, 43, 44, 1, 1, 6, 4, 1, 70,
+ 61, 1, 72, 6, 74, 74, 1, 70, 59, 60,
+ 21, 22, 67, 24, 67, 66, 1, 51, 24, 25,
+ 116, 55, 70, 72, 35, 306, 1, 66, 1, 29,
+ 126, 127, 300, 70, 68, 86, 51, 88, 89, 90,
+ 74, 309, 55, 67, 95, 51, 98, 99, 100, 101,
+ 102, 103, 104, 105, 106, 107, 108, 109, 71, 182,
+ 55, 68, 49, 1, 115, 140, 4, 73, 143, 3,
+ 55, 67, 124, 68, 326, 56, 51, 329, 51, 175,
+ 3, 132, 9, 68, 51, 136, 4, 98, 99, 100,
+ 101, 102, 103, 104, 105, 106, 107, 108, 109, 74,
+ 9, 74, 65, 154, 156, 14, 5, 81, 43, 44,
+ 3, 4, 38, 124, 48, 13, 50, 91, 68, 227,
+ 9, 67, 197, 198, 43, 44, 201, 40, 203, 56,
+ 57, 40, 207, 237, 9, 67, 67, 212, 67, 14,
+ 140, 74, 4, 143, 68, 26, 10, 56, 57, 272,
+ 246, 202, 45, 46, 250, 251, 67, 232, 54, 133,
+ 248, 140, 20, 214, 143, 40, 41, 56, 57, 277,
+ 221, 222, 247, 281, 225, 226, 69, 265, 274, 73,
+ 255, 56, 57, 7, 257, 7, 237, 283, 30, 303,
+ 298, 222, 286, 301, 290, 12, 13, 197, 198, 25,
+ 156, 201, 280, 203, 7, 8, 257, 207, 265, 284,
+ 317, 176, -1, -1, 310, -1, -1, 292, 197, 198,
+ 328, 195, 201, 331, 203, 321, 43, 44, 207, -1,
+ 204, 282, 232, 284, 286, 52, -1, -1, -1, 213,
+ -1, -1, 294, 217, -1, 9, -1, 247, -1, 52,
+ 14, -1, -1, 232, 9, 58, 59, -1, 61, 14,
+ 58, 59, 60, 61, 62, 239, -1, 65, 247, -1,
+ -1, -1, -1, -1, -1, -1, 40, 41, 42, -1,
+ -1, -1, -1, 294, -1, 40, 41, 42, 262, 53,
+ -1, -1, 56, 57, -1, 269, 270, -1, 53, 273,
+ -1, 56, 57, -1, 58, 59, 60, 61, 62, -1,
+ 74, 65, -1, 68, -1, -1, -1, 291, -1, 293,
+ -1, 295, 296, 297, -1, 299, 0, 1, -1, 3,
4, -1, -1, 7, 8, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 19, -1, 21, 22, 23,
- 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
- 34, -1, -1, -1, 38, 39, -1, -1, -1, 43,
- 44, 45, 46, -1, -1, -1, 50, 51, -1, -1,
- -1, -1, -1, 57, 58, -1, 60, -1, 62, -1,
- -1, 65, 66, -1, 68, -1, -1, 71, 72, 73,
- 1, -1, 3, 4, -1, -1, 7, 8, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 19, -1,
- 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
- 31, 32, 33, 34, -1, -1, -1, 38, 39, -1,
- -1, -1, 43, 44, 45, 46, -1, -1, -1, 50,
- 51, -1, -1, -1, -1, -1, 57, 58, -1, 60,
- -1, 62, -1, -1, 65, 66, -1, 68, -1, -1,
- 71, 72, 73, 1, -1, 3, 4, -1, -1, 7,
+ -1, -1, -1, 17, 18, 319, -1, -1, 322, -1,
+ -1, 325, -1, 327, -1, -1, -1, -1, -1, -1,
+ -1, 35, 36, 37, 38, -1, -1, -1, -1, 43,
+ 44, 45, 46, 47, -1, -1, -1, 51, 52, -1,
+ -1, -1, -1, -1, 58, 59, -1, 61, -1, 63,
+ -1, -1, 66, 67, -1, 69, -1, -1, 72, 1,
+ 74, 3, 4, -1, -1, 7, 8, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 19, -1, 21,
+ 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ 32, 33, 34, -1, -1, -1, 38, 39, -1, -1,
+ -1, 43, 44, 45, 46, -1, -1, -1, -1, 51,
+ 52, -1, -1, -1, -1, -1, 58, 59, -1, 61,
+ -1, 63, -1, -1, 66, 67, -1, 69, -1, -1,
+ 72, 73, 74, 1, -1, 3, 4, -1, -1, 7,
8, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 19, -1, 21, 22, 23, -1, -1, 26, 27,
+ -1, 19, -1, 21, 22, 23, 24, 25, 26, 27,
28, 29, 30, 31, 32, 33, 34, -1, -1, -1,
- 38, 39, -1, -1, -1, 43, 44, 45, 46, 1,
- -1, 3, 4, 51, -1, 7, 8, -1, 10, 57,
- 58, -1, 60, -1, 62, -1, -1, 65, 66, -1,
- 68, -1, -1, 71, 72, 73, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 38, -1, -1, -1,
- -1, 43, 44, 45, 46, -1, -1, -1, 50, 51,
- -1, -1, -1, -1, -1, 57, 58, -1, 60, -1,
- 62, -1, -1, 65, 66, 67, 68, -1, 3, 4,
- -1, 73, 7, 8, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 19, -1, 21, 22, 23, -1,
- -1, 26, 27, 28, 29, 30, 31, 32, 33, 34,
- -1, -1, -1, 38, 39, -1, -1, -1, 43, 44,
- 45, 46, -1, 3, 4, -1, 51, 7, 8, -1,
- -1, -1, 57, 58, -1, 60, -1, 62, -1, -1,
- 65, 66, -1, 68, -1, -1, 71, 1, 73, 3,
- 4, -1, -1, 7, 8, -1, -1, -1, 38, -1,
- -1, -1, -1, 43, 44, 45, 46, -1, -1, -1,
- -1, 51, -1, -1, -1, -1, -1, 57, 58, -1,
- 60, -1, 62, -1, 38, 65, 66, -1, 68, 43,
- 44, 45, 46, 73, -1, -1, -1, 51, -1, -1,
- -1, -1, -1, 57, 58, -1, 60, -1, 62, -1,
- -1, 65, 66, 67, 68, 1, -1, 3, 4, -1,
- -1, 7, 8, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 1, -1, 3, 4, -1, -1, 7, 8, -1,
- -1, -1, 38, -1, -1, -1, -1, 43, 44, 45,
- 46, -1, -1, -1, -1, 51, -1, -1, -1, -1,
- -1, 57, 58, -1, 60, -1, 62, -1, 38, 65,
- 66, -1, 68, 43, 44, 45, 46, -1, 3, 4,
- -1, 51, 7, 8, -1, -1, -1, 57, 58, -1,
- 60, -1, 62, -1, -1, 65, 66, 22, 68, -1,
- -1, -1, -1, -1, -1, -1, 31, 32, -1, -1,
- 3, 4, -1, 38, 7, 8, -1, -1, 43, 44,
- 45, 46, -1, -1, -1, -1, 51, -1, -1, 22,
- -1, -1, 57, 58, -1, 60, -1, 62, 31, 32,
- 65, 66, -1, 68, -1, 38, -1, -1, -1, -1,
- 43, 44, 45, 46, -1, 3, 4, -1, 51, 7,
- 8, -1, -1, 11, 57, 58, -1, 60, -1, 62,
- -1, -1, 65, 66, -1, 68, -1, -1, -1, -1,
- -1, 3, 4, -1, -1, 7, 8, -1, -1, -1,
+ 38, 39, -1, -1, -1, 43, 44, 45, 46, -1,
+ -1, -1, -1, 51, 52, -1, -1, -1, -1, -1,
+ 58, 59, -1, 61, -1, 63, -1, -1, 66, 67,
+ -1, 69, -1, -1, 72, 73, 74, 1, -1, 3,
+ 4, -1, -1, 7, 8, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 19, -1, 21, 22, 23,
+ -1, -1, 26, 27, 28, 29, 30, 31, 32, 33,
+ 34, -1, -1, -1, 38, 39, -1, -1, -1, 43,
+ 44, 45, 46, 1, -1, 3, 4, -1, 52, 7,
+ 8, -1, 10, -1, 58, 59, -1, 61, -1, 63,
+ -1, -1, 66, 67, -1, 69, -1, -1, 72, 73,
+ 74, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 38, -1, -1, -1, -1, 43, 44, 45, 46, -1,
+ -1, -1, -1, 51, 52, -1, -1, -1, -1, -1,
+ 58, 59, -1, 61, -1, 63, -1, -1, 66, 67,
+ 68, 69, -1, 3, 4, -1, 74, 7, 8, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 19,
+ -1, 21, 22, 23, -1, -1, 26, 27, 28, 29,
+ 30, 31, 32, 33, 34, -1, 3, 4, 38, 39,
+ 7, 8, -1, 43, 44, 45, 46, -1, -1, -1,
+ -1, -1, 52, -1, -1, -1, -1, 9, 58, 59,
+ -1, 61, 14, 63, -1, -1, 66, 67, -1, 69,
+ -1, 38, 72, -1, 74, -1, 43, 44, 45, 46,
+ 1, -1, 3, 4, -1, 52, 7, 8, 40, 41,
+ 42, 58, 59, -1, 61, -1, 63, -1, -1, 66,
+ 67, 53, 69, 55, 56, 57, -1, 74, -1, -1,
+ -1, -1, 1, -1, 3, 4, -1, 38, 7, 8,
+ -1, -1, 43, 44, 45, 46, -1, -1, -1, -1,
+ -1, 52, -1, -1, -1, -1, -1, 58, 59, -1,
+ 61, -1, 63, -1, -1, 66, 67, 68, 69, 38,
+ -1, -1, -1, -1, 43, 44, 45, 46, 1, -1,
+ 3, 4, -1, 52, 7, 8, -1, -1, -1, 58,
+ 59, -1, 61, -1, 63, -1, -1, 66, 67, -1,
+ 69, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 3, 4, 38, -1, 7, 8, -1,
+ 43, 44, 45, 46, -1, -1, -1, -1, -1, 52,
+ -1, -1, 22, -1, -1, 58, 59, -1, 61, -1,
+ 63, 31, 32, 66, 67, -1, 69, -1, 38, -1,
+ -1, -1, -1, 43, 44, 45, 46, -1, -1, 3,
+ 4, -1, 52, 7, 8, -1, -1, -1, 58, 59,
+ -1, 61, -1, 63, -1, -1, 66, 67, 22, 69,
+ -1, -1, -1, -1, -1, -1, -1, 31, 32, -1,
+ -1, -1, -1, -1, 38, -1, -1, -1, -1, 43,
+ 44, 45, 46, -1, -1, 3, 4, -1, 52, 7,
+ 8, -1, -1, 11, 58, 59, -1, 61, -1, 63,
+ -1, -1, 66, 67, -1, 69, -1, -1, -1, -1,
+ -1, -1, 3, 4, -1, -1, 7, 8, -1, -1,
38, -1, -1, -1, -1, 43, 44, 45, 46, -1,
- -1, -1, -1, 51, -1, -1, -1, -1, -1, 57,
- 58, -1, 60, -1, 62, -1, 38, 65, 66, -1,
- 68, 43, 44, 45, 46, -1, 3, 4, -1, 51,
- 7, 8, -1, -1, -1, 57, 58, -1, 60, -1,
- 62, -1, -1, 65, 66, -1, 68, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 9, 43, 44, 45, 46,
- 14, 9, -1, -1, 51, -1, 14, -1, -1, -1,
- 57, 58, -1, 60, -1, 62, -1, -1, 65, 66,
- 9, 68, -1, -1, -1, 14, 40, 41, 42, -1,
- -1, -1, 40, 41, 42, -1, -1, -1, 52, -1,
- 9, 55, 56, -1, 52, 14, 54, 55, 56, -1,
- -1, 40, 41, 42, -1, -1, -1, -1, -1, 73,
- -1, -1, -1, 52, 53, -1, 55, 56, -1, -1,
- -1, 40, 41, 42, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 52, -1, -1, 55, 56
+ -1, -1, -1, 9, 52, -1, -1, -1, 14, -1,
+ 58, 59, -1, 61, -1, 63, -1, 38, 66, 67,
+ -1, 69, 43, 44, 45, 46, -1, -1, 3, 4,
+ -1, 52, 7, 8, 40, 41, 42, 58, 59, -1,
+ 61, -1, 63, -1, -1, 66, 67, 53, 69, -1,
+ 56, 57, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 9, 43, 44,
+ 45, 46, 14, -1, -1, -1, -1, 52, -1, -1,
+ -1, -1, -1, 58, 59, -1, 61, -1, 63, -1,
+ -1, 66, 67, -1, 69, -1, -1, -1, 40, 41,
+ 42, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 53, 54, -1, 56, 57
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
static const yytype_uint8 yystos[] =
{
- 0, 75, 0, 1, 3, 4, 7, 8, 17, 18,
- 35, 36, 37, 38, 43, 44, 45, 46, 47, 50,
- 51, 57, 58, 60, 62, 65, 66, 68, 76, 78,
- 82, 84, 86, 104, 112, 116, 117, 118, 119, 120,
- 121, 129, 130, 66, 69, 126, 127, 128, 83, 122,
- 130, 130, 130, 66, 66, 68, 117, 130, 117, 117,
- 66, 119, 130, 1, 111, 112, 48, 121, 71, 73,
- 79, 88, 104, 132, 136, 79, 85, 50, 9, 14,
- 40, 41, 42, 52, 54, 55, 56, 114, 115, 11,
- 117, 57, 58, 59, 60, 61, 64, 57, 58, 59,
- 60, 61, 64, 12, 13, 43, 44, 51, 113, 110,
- 111, 112, 111, 16, 126, 3, 4, 45, 46, 68,
- 80, 81, 55, 106, 110, 110, 112, 43, 44, 131,
- 1, 54, 67, 134, 138, 134, 1, 6, 77, 104,
- 105, 87, 105, 5, 112, 129, 112, 112, 112, 105,
- 112, 38, 117, 117, 117, 117, 117, 117, 117, 117,
- 117, 117, 117, 117, 13, 112, 134, 70, 49, 66,
- 117, 134, 134, 112, 105, 40, 1, 112, 1, 88,
- 1, 19, 21, 22, 23, 26, 27, 28, 29, 30,
- 31, 32, 33, 34, 39, 72, 89, 90, 92, 99,
- 103, 112, 132, 133, 136, 53, 112, 122, 1, 4,
- 107, 108, 129, 66, 91, 4, 66, 66, 66, 105,
- 66, 88, 88, 88, 109, 112, 88, 105, 88, 93,
- 87, 135, 136, 105, 112, 134, 1, 138, 112, 109,
- 94, 4, 112, 112, 89, 4, 92, 95, 88, 66,
- 100, 110, 133, 105, 105, 1, 4, 134, 88, 123,
- 124, 125, 126, 67, 134, 134, 26, 40, 136, 111,
- 10, 101, 105, 16, 125, 105, 105, 66, 129, 105,
- 134, 102, 89, 132, 89, 112, 134, 112, 136, 116,
- 20, 96, 134, 105, 136, 105, 105, 1, 24, 25,
- 97, 105, 105, 89, 105, 95, 89, 7, 8, 57,
- 58, 84, 98, 53, 137, 133, 95, 134, 7, 7,
- 137, 105, 134, 105, 105, 87, 105, 89, 87, 89
+ 0, 76, 0, 1, 3, 4, 7, 8, 17, 18,
+ 35, 36, 37, 38, 43, 44, 45, 46, 47, 51,
+ 52, 58, 59, 61, 63, 66, 67, 69, 77, 80,
+ 84, 85, 87, 105, 113, 117, 118, 119, 120, 121,
+ 122, 130, 131, 67, 70, 127, 128, 129, 3, 4,
+ 45, 46, 69, 82, 83, 123, 131, 131, 131, 67,
+ 67, 69, 118, 131, 118, 118, 67, 120, 131, 1,
+ 112, 113, 48, 50, 122, 72, 74, 81, 89, 105,
+ 133, 137, 81, 86, 51, 9, 14, 40, 41, 42,
+ 53, 55, 56, 57, 115, 116, 11, 118, 58, 59,
+ 60, 61, 62, 65, 58, 59, 60, 61, 62, 65,
+ 12, 13, 43, 44, 52, 114, 111, 112, 113, 112,
+ 16, 127, 49, 67, 56, 107, 111, 111, 113, 43,
+ 44, 132, 1, 55, 68, 135, 139, 135, 1, 6,
+ 78, 1, 6, 79, 105, 106, 88, 106, 5, 113,
+ 130, 113, 113, 113, 106, 113, 38, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 13,
+ 113, 135, 71, 1, 4, 108, 109, 118, 135, 135,
+ 113, 106, 40, 1, 113, 1, 89, 1, 89, 1,
+ 19, 21, 22, 23, 26, 27, 28, 29, 30, 31,
+ 32, 33, 34, 39, 73, 90, 91, 93, 100, 104,
+ 113, 133, 134, 137, 54, 113, 123, 135, 1, 139,
+ 130, 67, 92, 4, 67, 67, 67, 106, 67, 89,
+ 89, 89, 110, 113, 89, 106, 89, 94, 88, 136,
+ 137, 106, 113, 106, 1, 4, 113, 110, 95, 4,
+ 113, 113, 90, 4, 93, 96, 89, 67, 101, 111,
+ 134, 106, 135, 89, 124, 125, 126, 127, 68, 135,
+ 135, 26, 40, 137, 112, 10, 102, 106, 16, 126,
+ 106, 106, 67, 130, 106, 135, 103, 90, 133, 90,
+ 113, 135, 113, 137, 117, 20, 97, 135, 106, 137,
+ 106, 106, 1, 24, 25, 98, 106, 106, 90, 106,
+ 96, 90, 7, 8, 58, 59, 85, 99, 54, 138,
+ 134, 96, 135, 7, 7, 138, 106, 135, 106, 106,
+ 88, 106, 90, 88, 90
};
#define yyerrok (yyerrstatus = 0)
@@ -2046,7 +2029,7 @@ yyreduce:
{
case 3:
/* Line 1778 of yacc.c */
-#line 221 "awkgram.y"
+#line 198 "awkgram.y"
{
rule = 0;
yyerrok;
@@ -2055,15 +2038,17 @@ yyreduce:
case 5:
/* Line 1778 of yacc.c */
-#line 227 "awkgram.y"
+#line 204 "awkgram.y"
{
next_sourcefile();
+ if (sourcefile == srcfiles)
+ process_deferred();
}
break;
case 6:
/* Line 1778 of yacc.c */
-#line 231 "awkgram.y"
+#line 210 "awkgram.y"
{
rule = 0;
/*
@@ -2076,7 +2061,7 @@ yyreduce:
case 7:
/* Line 1778 of yacc.c */
-#line 243 "awkgram.y"
+#line 222 "awkgram.y"
{
(void) append_rule((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]));
}
@@ -2084,7 +2069,7 @@ yyreduce:
case 8:
/* Line 1778 of yacc.c */
-#line 247 "awkgram.y"
+#line 226 "awkgram.y"
{
if (rule != Rule) {
msg(_("%s blocks must have an action part"), ruletab[rule]);
@@ -2099,28 +2084,35 @@ yyreduce:
case 9:
/* Line 1778 of yacc.c */
-#line 258 "awkgram.y"
+#line 237 "awkgram.y"
{
- can_return = FALSE;
- if ((yyvsp[(1) - (2)]) && func_install((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])) < 0)
- YYABORT;
- func_params = NULL;
+ in_function = NULL;
+ (void) mk_function((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]));
yyerrok;
}
break;
case 10:
/* Line 1778 of yacc.c */
-#line 266 "awkgram.y"
+#line 243 "awkgram.y"
{
- want_source = FALSE;
+ want_source = false;
yyerrok;
}
break;
case 11:
/* Line 1778 of yacc.c */
-#line 274 "awkgram.y"
+#line 248 "awkgram.y"
+ {
+ want_source = false;
+ yyerrok;
+ }
+ break;
+
+ case 12:
+/* Line 1778 of yacc.c */
+#line 256 "awkgram.y"
{
if (include_source((yyvsp[(1) - (1)])) < 0)
YYABORT;
@@ -2130,33 +2122,57 @@ yyreduce:
}
break;
- case 12:
+ case 13:
/* Line 1778 of yacc.c */
-#line 282 "awkgram.y"
+#line 264 "awkgram.y"
{ (yyval) = NULL; }
break;
- case 13:
+ case 14:
/* Line 1778 of yacc.c */
-#line 284 "awkgram.y"
+#line 266 "awkgram.y"
{ (yyval) = NULL; }
break;
- case 14:
+ case 15:
/* Line 1778 of yacc.c */
-#line 289 "awkgram.y"
+#line 271 "awkgram.y"
+ {
+ if (load_library((yyvsp[(1) - (1)])) < 0)
+ YYABORT;
+ efree((yyvsp[(1) - (1)])->lextok);
+ bcfree((yyvsp[(1) - (1)]));
+ (yyval) = NULL;
+ }
+ break;
+
+ case 16:
+/* Line 1778 of yacc.c */
+#line 279 "awkgram.y"
+ { (yyval) = NULL; }
+ break;
+
+ case 17:
+/* Line 1778 of yacc.c */
+#line 281 "awkgram.y"
+ { (yyval) = NULL; }
+ break;
+
+ case 18:
+/* Line 1778 of yacc.c */
+#line 286 "awkgram.y"
{ (yyval) = NULL; rule = Rule; }
break;
- case 15:
+ case 19:
/* Line 1778 of yacc.c */
-#line 291 "awkgram.y"
+#line 288 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); rule = Rule; }
break;
- case 16:
+ case 20:
/* Line 1778 of yacc.c */
-#line 293 "awkgram.y"
+#line 290 "awkgram.y"
{
INSTRUCTION *tp;
@@ -2164,8 +2180,8 @@ yyreduce:
add_lint((yyvsp[(4) - (4)]), LINT_assign_in_cond);
tp = instruction(Op_no_op);
- list_prepend((yyvsp[(1) - (4)]), bcalloc(Op_line_range, !!do_profiling + 1, 0));
- (yyvsp[(1) - (4)])->nexti->triggered = FALSE;
+ list_prepend((yyvsp[(1) - (4)]), bcalloc(Op_line_range, !!do_pretty_print + 1, 0));
+ (yyvsp[(1) - (4)])->nexti->triggered = false;
(yyvsp[(1) - (4)])->nexti->target_jmp = (yyvsp[(4) - (4)])->nexti;
list_append((yyvsp[(1) - (4)]), instruction(Op_cond_pair));
@@ -2175,7 +2191,7 @@ yyreduce:
list_append((yyvsp[(4) - (4)]), instruction(Op_cond_pair));
(yyvsp[(4) - (4)])->lasti->line_range = (yyvsp[(1) - (4)])->nexti;
(yyvsp[(4) - (4)])->lasti->target_jmp = tp;
- if (do_profiling) {
+ if (do_pretty_print) {
((yyvsp[(1) - (4)])->nexti + 1)->condpair_left = (yyvsp[(1) - (4)])->lasti;
((yyvsp[(1) - (4)])->nexti + 1)->condpair_right = (yyvsp[(4) - (4)])->lasti;
}
@@ -2184,9 +2200,9 @@ yyreduce:
}
break;
- case 17:
+ case 21:
/* Line 1778 of yacc.c */
-#line 319 "awkgram.y"
+#line 316 "awkgram.y"
{
static int begin_seen = 0;
if (do_lint_old && ++begin_seen == 2)
@@ -2199,9 +2215,9 @@ yyreduce:
}
break;
- case 18:
+ case 22:
/* Line 1778 of yacc.c */
-#line 330 "awkgram.y"
+#line 327 "awkgram.y"
{
static int end_seen = 0;
if (do_lint_old && ++end_seen == 2)
@@ -2214,9 +2230,9 @@ yyreduce:
}
break;
- case 19:
+ case 23:
/* Line 1778 of yacc.c */
-#line 341 "awkgram.y"
+#line 338 "awkgram.y"
{
(yyvsp[(1) - (1)])->in_rule = rule = BEGINFILE;
(yyvsp[(1) - (1)])->source_file = source;
@@ -2224,9 +2240,9 @@ yyreduce:
}
break;
- case 20:
+ case 24:
/* Line 1778 of yacc.c */
-#line 347 "awkgram.y"
+#line 344 "awkgram.y"
{
(yyvsp[(1) - (1)])->in_rule = rule = ENDFILE;
(yyvsp[(1) - (1)])->source_file = source;
@@ -2234,9 +2250,9 @@ yyreduce:
}
break;
- case 21:
+ case 25:
/* Line 1778 of yacc.c */
-#line 356 "awkgram.y"
+#line 353 "awkgram.y"
{
if ((yyvsp[(2) - (5)]) == NULL)
(yyval) = list_create(instruction(Op_no_op));
@@ -2245,90 +2261,71 @@ yyreduce:
}
break;
- case 22:
+ case 26:
/* Line 1778 of yacc.c */
-#line 366 "awkgram.y"
+#line 363 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
- case 23:
+ case 27:
/* Line 1778 of yacc.c */
-#line 368 "awkgram.y"
+#line 365 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
- case 24:
+ case 28:
/* Line 1778 of yacc.c */
-#line 370 "awkgram.y"
+#line 367 "awkgram.y"
{
yyerror(_("`%s' is a built-in function, it cannot be redefined"),
- tokstart);
- (yyvsp[(1) - (1)])->opcode = Op_symbol; /* Op_symbol instead of Op_token so that
- * free_bc_internal does not try to free it
- */
- (yyvsp[(1) - (1)])->lextok = builtin_func;
- (yyval) = (yyvsp[(1) - (1)]);
- /* yyerrok; */
+ tokstart);
+ YYABORT;
}
break;
- case 25:
+ case 29:
/* Line 1778 of yacc.c */
-#line 381 "awkgram.y"
+#line 373 "awkgram.y"
{ (yyval) = (yyvsp[(2) - (2)]); }
break;
- case 28:
+ case 32:
/* Line 1778 of yacc.c */
-#line 391 "awkgram.y"
+#line 383 "awkgram.y"
{
- param_counter = 0;
- func_params = NULL;
+ (yyvsp[(1) - (6)])->source_file = source;
+ if (install_function((yyvsp[(2) - (6)])->lextok, (yyvsp[(1) - (6)]), (yyvsp[(4) - (6)])) < 0)
+ YYABORT;
+ in_function = (yyvsp[(2) - (6)])->lextok;
+ (yyvsp[(2) - (6)])->lextok = NULL;
+ bcfree((yyvsp[(2) - (6)]));
+ /* $4 already free'd in install_function */
+ (yyval) = (yyvsp[(1) - (6)]);
}
break;
- case 29:
-/* Line 1778 of yacc.c */
-#line 396 "awkgram.y"
- {
- NODE *t;
-
- (yyvsp[(1) - (7)])->source_file = source;
- t = make_param((yyvsp[(3) - (7)])->lextok);
- (yyvsp[(3) - (7)])->lextok = NULL;
- bcfree((yyvsp[(3) - (7)]));
- t->flags |= FUNC;
- t->rnode = func_params;
- func_params = t;
- (yyval) = (yyvsp[(1) - (7)]);
- can_return = TRUE;
- /* check for duplicate parameter names */
- if (dup_parms((yyvsp[(1) - (7)]), t))
- errcount++;
- }
- break;
-
- case 30:
+ case 33:
/* Line 1778 of yacc.c */
-#line 420 "awkgram.y"
- { ++want_regexp; }
+#line 401 "awkgram.y"
+ { want_regexp = true; }
break;
- case 31:
+ case 34:
/* Line 1778 of yacc.c */
-#line 422 "awkgram.y"
+#line 403 "awkgram.y"
{
NODE *n, *exp;
char *re;
size_t len;
re = (yyvsp[(3) - (3)])->lextok;
+ (yyvsp[(3) - (3)])->lextok = NULL;
len = strlen(re);
if (do_lint) {
if (len == 0)
lintwarn_ln((yyvsp[(3) - (3)])->source_line,
_("regexp constant `//' looks like a C++ comment, but is not"));
- else if ((re)[0] == '*' && (re)[len-1] == '*')
+ else if (re[0] == '*' && re[len-1] == '*')
/* possible C comment */
lintwarn_ln((yyvsp[(3) - (3)])->source_line,
_("regexp constant `/%s/' looks like a C comment, but is not"), re);
@@ -2346,21 +2343,21 @@ yyreduce:
}
break;
- case 32:
+ case 35:
/* Line 1778 of yacc.c */
-#line 453 "awkgram.y"
+#line 435 "awkgram.y"
{ bcfree((yyvsp[(1) - (1)])); }
break;
- case 34:
+ case 37:
/* Line 1778 of yacc.c */
-#line 459 "awkgram.y"
+#line 441 "awkgram.y"
{ (yyval) = NULL; }
break;
- case 35:
+ case 38:
/* Line 1778 of yacc.c */
-#line 461 "awkgram.y"
+#line 443 "awkgram.y"
{
if ((yyvsp[(2) - (2)]) == NULL)
(yyval) = (yyvsp[(1) - (2)]);
@@ -2375,38 +2372,38 @@ yyreduce:
}
break;
- case 36:
+ case 39:
/* Line 1778 of yacc.c */
-#line 474 "awkgram.y"
+#line 456 "awkgram.y"
{ (yyval) = NULL; }
break;
- case 39:
+ case 42:
/* Line 1778 of yacc.c */
-#line 484 "awkgram.y"
+#line 466 "awkgram.y"
{ (yyval) = NULL; }
break;
- case 40:
+ case 43:
/* Line 1778 of yacc.c */
-#line 486 "awkgram.y"
+#line 468 "awkgram.y"
{ (yyval) = (yyvsp[(2) - (3)]); }
break;
- case 41:
+ case 44:
/* Line 1778 of yacc.c */
-#line 488 "awkgram.y"
+#line 470 "awkgram.y"
{
- if (do_profiling)
+ if (do_pretty_print)
(yyval) = list_prepend((yyvsp[(1) - (1)]), instruction(Op_exec_count));
else
(yyval) = (yyvsp[(1) - (1)]);
}
break;
- case 42:
+ case 45:
/* Line 1778 of yacc.c */
-#line 495 "awkgram.y"
+#line 477 "awkgram.y"
{
INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt;
INSTRUCTION *ip, *nextc, *tbreak;
@@ -2452,7 +2449,7 @@ yyreduce:
case_values[case_count++] = caseval;
} else {
/* match a constant regex against switch expression. */
- (curr + 1)->match_exp = TRUE;
+ (curr + 1)->match_exp = true;
}
curr->stmt_start = casestmt->nexti;
curr->stmt_end = casestmt->lasti;
@@ -2465,7 +2462,7 @@ yyreduce:
else
dflt->target_jmp = casestmt->nexti;
- if (do_profiling) {
+ if (do_pretty_print) {
curr->stmt_start = casestmt->nexti;
curr->stmt_end = casestmt->lasti;
(void) list_prepend(cexp, curr);
@@ -2480,7 +2477,7 @@ yyreduce:
efree(case_values);
ip = (yyvsp[(3) - (9)]);
- if (do_profiling) {
+ if (do_pretty_print) {
(void) list_prepend(ip, (yyvsp[(1) - (9)]));
(void) list_prepend(ip, instruction(Op_exec_count));
(yyvsp[(1) - (9)])->target_break = tbreak;
@@ -2498,9 +2495,9 @@ yyreduce:
}
break;
- case 43:
+ case 46:
/* Line 1778 of yacc.c */
-#line 585 "awkgram.y"
+#line 567 "awkgram.y"
{
/*
* -----------------
@@ -2523,7 +2520,7 @@ yyreduce:
ip = list_append((yyvsp[(3) - (6)]), instruction(Op_jmp_false));
ip->lasti->target_jmp = tbreak;
- if (do_profiling) {
+ if (do_pretty_print) {
(void) list_append(ip, instruction(Op_exec_count));
(yyvsp[(1) - (6)])->target_break = tbreak;
(yyvsp[(1) - (6)])->target_continue = tcont;
@@ -2544,9 +2541,9 @@ yyreduce:
}
break;
- case 44:
+ case 47:
/* Line 1778 of yacc.c */
-#line 627 "awkgram.y"
+#line 609 "awkgram.y"
{
/*
* -----------------
@@ -2569,7 +2566,7 @@ yyreduce:
ip = list_merge((yyvsp[(3) - (8)]), (yyvsp[(6) - (8)]));
else
ip = list_prepend((yyvsp[(6) - (8)]), instruction(Op_no_op));
- if (do_profiling)
+ if (do_pretty_print)
(void) list_prepend(ip, instruction(Op_exec_count));
(void) list_append(ip, instruction(Op_jmp_true));
ip->lasti->target_jmp = ip->nexti;
@@ -2579,7 +2576,7 @@ yyreduce:
continue_allowed--;
fix_break_continue(ip, tbreak, tcont);
- if (do_profiling) {
+ if (do_pretty_print) {
(yyvsp[(1) - (8)])->target_break = tbreak;
(yyvsp[(1) - (8)])->target_continue = tcont;
((yyvsp[(1) - (8)]) + 1)->doloop_cond = tcont;
@@ -2590,9 +2587,9 @@ yyreduce:
}
break;
- case 45:
+ case 48:
/* Line 1778 of yacc.c */
-#line 669 "awkgram.y"
+#line 651 "awkgram.y"
{
INSTRUCTION *ip;
char *var_name = (yyvsp[(3) - (8)])->lextok;
@@ -2643,30 +2640,30 @@ yyreduce:
} else {
INSTRUCTION *tbreak, *tcont;
- /* [ Op_push_array a ]
- * [ Op_arrayfor_init | ib ]
- * ic:[ Op_arrayfor_incr | ib ]
- * [ Op_var_assign if any ]
- *
- * body
- *
- * [Op_jmp | ic ]
- * ib:[Op_arrayfor_final ]
- */
+ /* [ Op_push_array a ]
+ * [ Op_arrayfor_init | ib ]
+ * ic:[ Op_arrayfor_incr | ib ]
+ * [ Op_var_assign if any ]
+ *
+ * body
+ *
+ * [Op_jmp | ic ]
+ * ib:[Op_arrayfor_final ]
+ */
regular_loop:
ip = (yyvsp[(5) - (8)]);
ip->nexti->opcode = Op_push_array;
tbreak = instruction(Op_arrayfor_final);
(yyvsp[(4) - (8)])->opcode = Op_arrayfor_incr;
- (yyvsp[(4) - (8)])->array_var = variable(var_name, Node_var);
+ (yyvsp[(4) - (8)])->array_var = variable((yyvsp[(3) - (8)])->source_line, var_name, Node_var);
(yyvsp[(4) - (8)])->target_jmp = tbreak;
tcont = (yyvsp[(4) - (8)]);
(yyvsp[(3) - (8)])->opcode = Op_arrayfor_init;
(yyvsp[(3) - (8)])->target_jmp = tbreak;
(void) list_append(ip, (yyvsp[(3) - (8)]));
- if (do_profiling) {
+ if (do_pretty_print) {
(yyvsp[(1) - (8)])->opcode = Op_K_arrayfor;
(yyvsp[(1) - (8)])->target_continue = tcont;
(yyvsp[(1) - (8)])->target_break = tbreak;
@@ -2687,7 +2684,7 @@ regular_loop:
ip->lasti->assign_var = (yyvsp[(4) - (8)])->array_var->var_assign;
}
- if (do_profiling) {
+ if (do_pretty_print) {
(void) list_append(ip, instruction(Op_exec_count));
((yyvsp[(1) - (8)]) + 1)->forloop_cond = (yyvsp[(4) - (8)]);
((yyvsp[(1) - (8)]) + 1)->forloop_body = ip->lasti;
@@ -2707,9 +2704,9 @@ regular_loop:
}
break;
- case 46:
+ case 49:
/* Line 1778 of yacc.c */
-#line 782 "awkgram.y"
+#line 764 "awkgram.y"
{
(yyval) = mk_for_loop((yyvsp[(1) - (12)]), (yyvsp[(3) - (12)]), (yyvsp[(6) - (12)]), (yyvsp[(9) - (12)]), (yyvsp[(12) - (12)]));
@@ -2718,9 +2715,9 @@ regular_loop:
}
break;
- case 47:
+ case 50:
/* Line 1778 of yacc.c */
-#line 789 "awkgram.y"
+#line 771 "awkgram.y"
{
(yyval) = mk_for_loop((yyvsp[(1) - (11)]), (yyvsp[(3) - (11)]), (INSTRUCTION *) NULL, (yyvsp[(8) - (11)]), (yyvsp[(11) - (11)]));
@@ -2729,20 +2726,20 @@ regular_loop:
}
break;
- case 48:
+ case 51:
/* Line 1778 of yacc.c */
-#line 796 "awkgram.y"
+#line 778 "awkgram.y"
{
- if (do_profiling)
+ if (do_pretty_print)
(yyval) = list_prepend((yyvsp[(1) - (1)]), instruction(Op_exec_count));
else
(yyval) = (yyvsp[(1) - (1)]);
}
break;
- case 49:
+ case 52:
/* Line 1778 of yacc.c */
-#line 806 "awkgram.y"
+#line 788 "awkgram.y"
{
if (! break_allowed)
error_ln((yyvsp[(1) - (2)])->source_line,
@@ -2753,9 +2750,9 @@ regular_loop:
}
break;
- case 50:
+ case 53:
/* Line 1778 of yacc.c */
-#line 815 "awkgram.y"
+#line 797 "awkgram.y"
{
if (! continue_allowed)
error_ln((yyvsp[(1) - (2)])->source_line,
@@ -2766,9 +2763,9 @@ regular_loop:
}
break;
- case 51:
+ case 54:
/* Line 1778 of yacc.c */
-#line 824 "awkgram.y"
+#line 806 "awkgram.y"
{
/* if inside function (rule = 0), resolve context at run-time */
if (rule && rule != Rule)
@@ -2779,9 +2776,9 @@ regular_loop:
}
break;
- case 52:
+ case 55:
/* Line 1778 of yacc.c */
-#line 833 "awkgram.y"
+#line 815 "awkgram.y"
{
/* if inside function (rule = 0), resolve context at run-time */
if (rule == BEGIN || rule == END || rule == ENDFILE)
@@ -2794,9 +2791,9 @@ regular_loop:
}
break;
- case 53:
+ case 56:
/* Line 1778 of yacc.c */
-#line 844 "awkgram.y"
+#line 826 "awkgram.y"
{
/* Initialize the two possible jump targets, the actual target
* is resolved at run-time.
@@ -2807,43 +2804,55 @@ regular_loop:
if ((yyvsp[(2) - (3)]) == NULL) {
(yyval) = list_create((yyvsp[(1) - (3)]));
(void) list_prepend((yyval), instruction(Op_push_i));
- (yyval)->nexti->memory = Nnull_string;
+ (yyval)->nexti->memory = dupnode(Nnull_string);
} else
(yyval) = list_append((yyvsp[(2) - (3)]), (yyvsp[(1) - (3)]));
}
break;
- case 54:
+ case 57:
/* Line 1778 of yacc.c */
-#line 859 "awkgram.y"
+#line 841 "awkgram.y"
{
- if (! can_return)
+ if (! in_function)
yyerror(_("`return' used outside function context"));
}
break;
- case 55:
+ case 58:
/* Line 1778 of yacc.c */
-#line 862 "awkgram.y"
+#line 844 "awkgram.y"
{
if ((yyvsp[(3) - (4)]) == NULL) {
(yyval) = list_create((yyvsp[(1) - (4)]));
(void) list_prepend((yyval), instruction(Op_push_i));
- (yyval)->nexti->memory = Nnull_string;
- } else
+ (yyval)->nexti->memory = dupnode(Nnull_string);
+ } else {
+ if (do_optimize > 1
+ && (yyvsp[(3) - (4)])->lasti->opcode == Op_func_call
+ && strcmp((yyvsp[(3) - (4)])->lasti->func_name, in_function) == 0
+ ) {
+ /* Do tail recursion optimization. Tail
+ * call without a return value is recognized
+ * in mk_function().
+ */
+ ((yyvsp[(3) - (4)])->lasti + 1)->tail_call = true;
+ }
+
(yyval) = list_append((yyvsp[(3) - (4)]), (yyvsp[(1) - (4)]));
+ }
}
break;
- case 57:
+ case 60:
/* Line 1778 of yacc.c */
-#line 882 "awkgram.y"
- { in_print = TRUE; in_parens = 0; }
+#line 876 "awkgram.y"
+ { in_print = true; in_parens = 0; }
break;
- case 58:
+ case 61:
/* Line 1778 of yacc.c */
-#line 883 "awkgram.y"
+#line 877 "awkgram.y"
{
/*
* Optimization: plain `print' has no expression list, so $3 is null.
@@ -2852,15 +2861,14 @@ regular_loop:
*/
if ((yyvsp[(1) - (4)])->opcode == Op_K_print &&
- ((yyvsp[(3) - (4)]) == NULL
- || ((yyvsp[(3) - (4)])->lasti->opcode == Op_field_spec
- && (yyvsp[(3) - (4)])->nexti->nexti->nexti == (yyvsp[(3) - (4)])->lasti
- && (yyvsp[(3) - (4)])->nexti->nexti->opcode == Op_push_i
- && (yyvsp[(3) - (4)])->nexti->nexti->memory->type == Node_val
- && (yyvsp[(3) - (4)])->nexti->nexti->memory->numbr == 0.0)
- )
+ ((yyvsp[(3) - (4)]) == NULL
+ || ((yyvsp[(3) - (4)])->lasti->opcode == Op_field_spec
+ && (yyvsp[(3) - (4)])->nexti->nexti->nexti == (yyvsp[(3) - (4)])->lasti
+ && (yyvsp[(3) - (4)])->nexti->nexti->opcode == Op_push_i
+ && (yyvsp[(3) - (4)])->nexti->nexti->memory->type == Node_val)
+ )
) {
- static short warned = FALSE;
+ static bool warned = false;
/* -----------------
* output_redir
* [ redirect exp ]
@@ -2871,16 +2879,19 @@ regular_loop:
*/
if ((yyvsp[(3) - (4)]) != NULL) {
- bcfree((yyvsp[(3) - (4)])->lasti); /* Op_field_spec */
- (yyvsp[(3) - (4)])->nexti->nexti->memory->flags &= ~PERM;
- (yyvsp[(3) - (4)])->nexti->nexti->memory->flags |= MALLOC;
- unref((yyvsp[(3) - (4)])->nexti->nexti->memory); /* Node_val */
+ NODE *n = (yyvsp[(3) - (4)])->nexti->nexti->memory;
+
+ if (! iszero(n))
+ goto regular_print;
+
+ bcfree((yyvsp[(3) - (4)])->lasti); /* Op_field_spec */
+ unref(n); /* Node_val */
bcfree((yyvsp[(3) - (4)])->nexti->nexti); /* Op_push_i */
- bcfree((yyvsp[(3) - (4)])->nexti); /* Op_list */
- bcfree((yyvsp[(3) - (4)])); /* Op_list */
+ bcfree((yyvsp[(3) - (4)])->nexti); /* Op_list */
+ bcfree((yyvsp[(3) - (4)])); /* Op_list */
} else {
if (do_lint && (rule == BEGIN || rule == END) && ! warned) {
- warned = TRUE;
+ warned = true;
lintwarn_ln((yyvsp[(1) - (4)])->source_line,
_("plain `print' in BEGIN or END rule should probably be `print \"\"'"));
}
@@ -2889,7 +2900,7 @@ regular_loop:
(yyvsp[(1) - (4)])->expr_count = 0;
(yyvsp[(1) - (4)])->opcode = Op_K_print_rec;
if ((yyvsp[(4) - (4)]) == NULL) { /* no redircetion */
- (yyvsp[(1) - (4)])->redir_type = 0;
+ (yyvsp[(1) - (4)])->redir_type = redirect_none;
(yyval) = list_create((yyvsp[(1) - (4)]));
} else {
INSTRUCTION *ip;
@@ -2909,16 +2920,16 @@ regular_loop:
* [$1 | NULL | redir_type | expr_count]
*
*/
-
+regular_print:
if ((yyvsp[(4) - (4)]) == NULL) { /* no redirection */
if ((yyvsp[(3) - (4)]) == NULL) { /* printf without arg */
(yyvsp[(1) - (4)])->expr_count = 0;
- (yyvsp[(1) - (4)])->redir_type = 0;
+ (yyvsp[(1) - (4)])->redir_type = redirect_none;
(yyval) = list_create((yyvsp[(1) - (4)]));
} else {
INSTRUCTION *t = (yyvsp[(3) - (4)]);
- (yyvsp[(1) - (4)])->expr_count = count_expressions(&t, FALSE);
- (yyvsp[(1) - (4)])->redir_type = 0;
+ (yyvsp[(1) - (4)])->expr_count = count_expressions(&t, false);
+ (yyvsp[(1) - (4)])->redir_type = redirect_none;
(yyval) = list_append(t, (yyvsp[(1) - (4)]));
}
} else {
@@ -2932,7 +2943,7 @@ regular_loop:
(yyval) = list_append((yyvsp[(4) - (4)]), (yyvsp[(1) - (4)]));
} else {
INSTRUCTION *t = (yyvsp[(3) - (4)]);
- (yyvsp[(1) - (4)])->expr_count = count_expressions(&t, FALSE);
+ (yyvsp[(1) - (4)])->expr_count = count_expressions(&t, false);
(yyval) = list_append(list_merge((yyvsp[(4) - (4)]), t), (yyvsp[(1) - (4)]));
}
}
@@ -2940,20 +2951,27 @@ regular_loop:
}
break;
- case 59:
+ case 62:
/* Line 1778 of yacc.c */
-#line 978 "awkgram.y"
+#line 974 "awkgram.y"
{ sub_counter = 0; }
break;
- case 60:
+ case 63:
/* Line 1778 of yacc.c */
-#line 979 "awkgram.y"
+#line 975 "awkgram.y"
{
char *arr = (yyvsp[(2) - (4)])->lextok;
(yyvsp[(2) - (4)])->opcode = Op_push_array;
- (yyvsp[(2) - (4)])->memory = variable(arr, Node_var_new);
+ (yyvsp[(2) - (4)])->memory = variable((yyvsp[(2) - (4)])->source_line, arr, Node_var_new);
+
+ if (! do_posix && ! do_traditional) {
+ if ((yyvsp[(2) - (4)])->memory == symbol_table)
+ fatal(_("`delete' is not allowed with SYMTAB"));
+ else if ((yyvsp[(2) - (4)])->memory == func_table)
+ fatal(_("`delete' is not allowed with FUNCTAB"));
+ }
if ((yyvsp[(4) - (4)]) == NULL) {
/*
@@ -2976,15 +2994,15 @@ regular_loop:
}
break;
- case 61:
+ case 64:
/* Line 1778 of yacc.c */
-#line 1009 "awkgram.y"
+#line 1012 "awkgram.y"
{
- static short warned = FALSE;
+ static bool warned = false;
char *arr = (yyvsp[(3) - (4)])->lextok;
if (do_lint && ! warned) {
- warned = TRUE;
+ warned = true;
lintwarn_ln((yyvsp[(1) - (4)])->source_line,
_("`delete(array)' is a non-portable tawk extension"));
}
@@ -2992,40 +3010,47 @@ regular_loop:
error_ln((yyvsp[(1) - (4)])->source_line,
_("`delete(array)' is a non-portable tawk extension"));
}
- (yyvsp[(3) - (4)])->memory = variable(arr, Node_var_new);
+ (yyvsp[(3) - (4)])->memory = variable((yyvsp[(3) - (4)])->source_line, arr, Node_var_new);
(yyvsp[(3) - (4)])->opcode = Op_push_array;
(yyvsp[(1) - (4)])->expr_count = 0;
(yyval) = list_append(list_create((yyvsp[(3) - (4)])), (yyvsp[(1) - (4)]));
+
+ if (! do_posix && ! do_traditional) {
+ if ((yyvsp[(3) - (4)])->memory == symbol_table)
+ fatal(_("`delete' is not allowed with SYMTAB"));
+ else if ((yyvsp[(3) - (4)])->memory == func_table)
+ fatal(_("`delete' is not allowed with FUNCTAB"));
+ }
}
break;
- case 62:
+ case 65:
/* Line 1778 of yacc.c */
-#line 1028 "awkgram.y"
+#line 1038 "awkgram.y"
{ (yyval) = optimize_assignment((yyvsp[(1) - (1)])); }
break;
- case 63:
+ case 66:
/* Line 1778 of yacc.c */
-#line 1033 "awkgram.y"
+#line 1043 "awkgram.y"
{ (yyval) = NULL; }
break;
- case 64:
+ case 67:
/* Line 1778 of yacc.c */
-#line 1035 "awkgram.y"
+#line 1045 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
- case 65:
+ case 68:
/* Line 1778 of yacc.c */
-#line 1040 "awkgram.y"
+#line 1050 "awkgram.y"
{ (yyval) = NULL; }
break;
- case 66:
+ case 69:
/* Line 1778 of yacc.c */
-#line 1042 "awkgram.y"
+#line 1052 "awkgram.y"
{
if ((yyvsp[(1) - (2)]) == NULL)
(yyval) = list_create((yyvsp[(2) - (2)]));
@@ -3034,20 +3059,20 @@ regular_loop:
}
break;
- case 67:
+ case 70:
/* Line 1778 of yacc.c */
-#line 1049 "awkgram.y"
+#line 1059 "awkgram.y"
{ (yyval) = NULL; }
break;
- case 68:
+ case 71:
/* Line 1778 of yacc.c */
-#line 1054 "awkgram.y"
+#line 1064 "awkgram.y"
{
INSTRUCTION *casestmt = (yyvsp[(5) - (5)]);
if ((yyvsp[(5) - (5)]) == NULL)
casestmt = list_create(instruction(Op_no_op));
- if (do_profiling)
+ if (do_pretty_print)
(void) list_prepend(casestmt, instruction(Op_exec_count));
(yyvsp[(1) - (5)])->case_exp = (yyvsp[(2) - (5)]);
(yyvsp[(1) - (5)])->case_stmt = casestmt;
@@ -3056,14 +3081,14 @@ regular_loop:
}
break;
- case 69:
+ case 72:
/* Line 1778 of yacc.c */
-#line 1066 "awkgram.y"
+#line 1076 "awkgram.y"
{
INSTRUCTION *casestmt = (yyvsp[(4) - (4)]);
if ((yyvsp[(4) - (4)]) == NULL)
casestmt = list_create(instruction(Op_no_op));
- if (do_profiling)
+ if (do_pretty_print)
(void) list_prepend(casestmt, instruction(Op_exec_count));
bcfree((yyvsp[(2) - (4)]));
(yyvsp[(1) - (4)])->case_stmt = casestmt;
@@ -3071,85 +3096,87 @@ regular_loop:
}
break;
- case 70:
+ case 73:
/* Line 1778 of yacc.c */
-#line 1080 "awkgram.y"
+#line 1090 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
- case 71:
+ case 74:
/* Line 1778 of yacc.c */
-#line 1082 "awkgram.y"
+#line 1092 "awkgram.y"
{
- (yyvsp[(2) - (2)])->memory->numbr = -(force_number((yyvsp[(2) - (2)])->memory));
+ NODE *n = (yyvsp[(2) - (2)])->memory;
+ (void) force_number(n);
+ negate_num(n);
bcfree((yyvsp[(1) - (2)]));
(yyval) = (yyvsp[(2) - (2)]);
}
break;
- case 72:
+ case 75:
/* Line 1778 of yacc.c */
-#line 1088 "awkgram.y"
+#line 1100 "awkgram.y"
{
bcfree((yyvsp[(1) - (2)]));
(yyval) = (yyvsp[(2) - (2)]);
}
break;
- case 73:
+ case 76:
/* Line 1778 of yacc.c */
-#line 1093 "awkgram.y"
+#line 1105 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
- case 74:
+ case 77:
/* Line 1778 of yacc.c */
-#line 1095 "awkgram.y"
+#line 1107 "awkgram.y"
{
(yyvsp[(1) - (1)])->opcode = Op_push_re;
(yyval) = (yyvsp[(1) - (1)]);
}
break;
- case 75:
+ case 78:
/* Line 1778 of yacc.c */
-#line 1103 "awkgram.y"
+#line 1115 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
- case 76:
+ case 79:
/* Line 1778 of yacc.c */
-#line 1105 "awkgram.y"
+#line 1117 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
- case 78:
+ case 81:
/* Line 1778 of yacc.c */
-#line 1115 "awkgram.y"
+#line 1127 "awkgram.y"
{
(yyval) = (yyvsp[(2) - (3)]);
}
break;
- case 79:
+ case 82:
/* Line 1778 of yacc.c */
-#line 1122 "awkgram.y"
+#line 1134 "awkgram.y"
{
- in_print = FALSE;
+ in_print = false;
in_parens = 0;
(yyval) = NULL;
}
break;
- case 80:
+ case 83:
/* Line 1778 of yacc.c */
-#line 1127 "awkgram.y"
- { in_print = FALSE; in_parens = 0; }
+#line 1139 "awkgram.y"
+ { in_print = false; in_parens = 0; }
break;
- case 81:
+ case 84:
/* Line 1778 of yacc.c */
-#line 1128 "awkgram.y"
+#line 1140 "awkgram.y"
{
if ((yyvsp[(1) - (3)])->redir_type == redirect_twoway
&& (yyvsp[(3) - (3)])->lasti->opcode == Op_K_getline_redir
@@ -3159,142 +3186,152 @@ regular_loop:
}
break;
- case 82:
+ case 85:
/* Line 1778 of yacc.c */
-#line 1139 "awkgram.y"
+#line 1151 "awkgram.y"
{
(yyval) = mk_condition((yyvsp[(3) - (6)]), (yyvsp[(1) - (6)]), (yyvsp[(6) - (6)]), NULL, NULL);
}
break;
- case 83:
+ case 86:
/* Line 1778 of yacc.c */
-#line 1144 "awkgram.y"
+#line 1156 "awkgram.y"
{
(yyval) = mk_condition((yyvsp[(3) - (9)]), (yyvsp[(1) - (9)]), (yyvsp[(6) - (9)]), (yyvsp[(7) - (9)]), (yyvsp[(9) - (9)]));
}
break;
- case 88:
+ case 91:
/* Line 1778 of yacc.c */
-#line 1161 "awkgram.y"
+#line 1173 "awkgram.y"
{ (yyval) = NULL; }
break;
- case 89:
+ case 92:
/* Line 1778 of yacc.c */
-#line 1163 "awkgram.y"
+#line 1175 "awkgram.y"
{
bcfree((yyvsp[(1) - (2)]));
(yyval) = (yyvsp[(2) - (2)]);
}
break;
- case 92:
+ case 93:
+/* Line 1778 of yacc.c */
+#line 1183 "awkgram.y"
+ { (yyval) = NULL; }
+ break;
+
+ case 94:
+/* Line 1778 of yacc.c */
+#line 1185 "awkgram.y"
+ { (yyval) = (yyvsp[(1) - (1)]) ; }
+ break;
+
+ case 95:
/* Line 1778 of yacc.c */
-#line 1176 "awkgram.y"
+#line 1190 "awkgram.y"
{
- append_param((yyvsp[(1) - (1)])->lextok);
- (yyvsp[(1) - (1)])->lextok = NULL;
- bcfree((yyvsp[(1) - (1)]));
+ (yyvsp[(1) - (1)])->param_count = 0;
+ (yyval) = list_create((yyvsp[(1) - (1)]));
}
break;
- case 93:
+ case 96:
/* Line 1778 of yacc.c */
-#line 1182 "awkgram.y"
+#line 1195 "awkgram.y"
{
- append_param((yyvsp[(3) - (3)])->lextok);
- (yyvsp[(3) - (3)])->lextok = NULL;
- bcfree((yyvsp[(3) - (3)]));
+ (yyvsp[(3) - (3)])->param_count = (yyvsp[(1) - (3)])->lasti->param_count + 1;
+ (yyval) = list_append((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]));
yyerrok;
}
break;
- case 94:
+ case 97:
/* Line 1778 of yacc.c */
-#line 1189 "awkgram.y"
- { /* func_params = NULL; */ }
+#line 1201 "awkgram.y"
+ { (yyval) = NULL; }
break;
- case 95:
+ case 98:
/* Line 1778 of yacc.c */
-#line 1191 "awkgram.y"
- { /* func_params = NULL; */ }
+#line 1203 "awkgram.y"
+ { (yyval) = (yyvsp[(1) - (2)]); }
break;
- case 96:
+ case 99:
/* Line 1778 of yacc.c */
-#line 1193 "awkgram.y"
- { /* func_params = NULL; */ }
+#line 1205 "awkgram.y"
+ { (yyval) = (yyvsp[(1) - (3)]); }
break;
- case 97:
+ case 100:
/* Line 1778 of yacc.c */
-#line 1199 "awkgram.y"
+#line 1211 "awkgram.y"
{ (yyval) = NULL; }
break;
- case 98:
+ case 101:
/* Line 1778 of yacc.c */
-#line 1201 "awkgram.y"
+#line 1213 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
- case 99:
+ case 102:
/* Line 1778 of yacc.c */
-#line 1206 "awkgram.y"
+#line 1218 "awkgram.y"
{ (yyval) = NULL; }
break;
- case 100:
+ case 103:
/* Line 1778 of yacc.c */
-#line 1208 "awkgram.y"
+#line 1220 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
- case 101:
+ case 104:
/* Line 1778 of yacc.c */
-#line 1213 "awkgram.y"
+#line 1225 "awkgram.y"
{ (yyval) = mk_expression_list(NULL, (yyvsp[(1) - (1)])); }
break;
- case 102:
+ case 105:
/* Line 1778 of yacc.c */
-#line 1215 "awkgram.y"
+#line 1227 "awkgram.y"
{
(yyval) = mk_expression_list((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]));
yyerrok;
}
break;
- case 103:
+ case 106:
/* Line 1778 of yacc.c */
-#line 1220 "awkgram.y"
+#line 1232 "awkgram.y"
{ (yyval) = NULL; }
break;
- case 104:
+ case 107:
/* Line 1778 of yacc.c */
-#line 1222 "awkgram.y"
+#line 1234 "awkgram.y"
{ (yyval) = NULL; }
break;
- case 105:
+ case 108:
/* Line 1778 of yacc.c */
-#line 1224 "awkgram.y"
+#line 1236 "awkgram.y"
{ (yyval) = NULL; }
break;
- case 106:
+ case 109:
/* Line 1778 of yacc.c */
-#line 1226 "awkgram.y"
+#line 1238 "awkgram.y"
{ (yyval) = NULL; }
break;
- case 107:
+ case 110:
/* Line 1778 of yacc.c */
-#line 1232 "awkgram.y"
+#line 1244 "awkgram.y"
{
if (do_lint && (yyvsp[(3) - (3)])->lasti->opcode == Op_match_rec)
lintwarn_ln((yyvsp[(2) - (3)])->source_line,
@@ -3303,21 +3340,21 @@ regular_loop:
}
break;
- case 108:
+ case 111:
/* Line 1778 of yacc.c */
-#line 1239 "awkgram.y"
+#line 1251 "awkgram.y"
{ (yyval) = mk_boolean((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
- case 109:
+ case 112:
/* Line 1778 of yacc.c */
-#line 1241 "awkgram.y"
+#line 1253 "awkgram.y"
{ (yyval) = mk_boolean((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
- case 110:
+ case 113:
/* Line 1778 of yacc.c */
-#line 1243 "awkgram.y"
+#line 1255 "awkgram.y"
{
if ((yyvsp[(1) - (3)])->lasti->opcode == Op_match_rec)
warning_ln((yyvsp[(2) - (3)])->source_line,
@@ -3335,12 +3372,12 @@ regular_loop:
}
break;
- case 111:
+ case 114:
/* Line 1778 of yacc.c */
-#line 1259 "awkgram.y"
+#line 1271 "awkgram.y"
{
if (do_lint_old)
- warning_ln((yyvsp[(2) - (3)])->source_line,
+ warning_ln((yyvsp[(2) - (3)])->source_line,
_("old awk does not support the keyword `in' except after `for'"));
(yyvsp[(3) - (3)])->nexti->opcode = Op_push_array;
(yyvsp[(2) - (3)])->opcode = Op_in_array;
@@ -3349,9 +3386,9 @@ regular_loop:
}
break;
- case 112:
+ case 115:
/* Line 1778 of yacc.c */
-#line 1269 "awkgram.y"
+#line 1281 "awkgram.y"
{
if (do_lint && (yyvsp[(3) - (3)])->lasti->opcode == Op_match_rec)
lintwarn_ln((yyvsp[(2) - (3)])->source_line,
@@ -3360,81 +3397,81 @@ regular_loop:
}
break;
- case 113:
+ case 116:
/* Line 1778 of yacc.c */
-#line 1276 "awkgram.y"
+#line 1288 "awkgram.y"
{ (yyval) = mk_condition((yyvsp[(1) - (5)]), (yyvsp[(2) - (5)]), (yyvsp[(3) - (5)]), (yyvsp[(4) - (5)]), (yyvsp[(5) - (5)])); }
break;
- case 114:
+ case 117:
/* Line 1778 of yacc.c */
-#line 1278 "awkgram.y"
+#line 1290 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
- case 115:
+ case 118:
/* Line 1778 of yacc.c */
-#line 1283 "awkgram.y"
+#line 1295 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
- case 116:
+ case 119:
/* Line 1778 of yacc.c */
-#line 1285 "awkgram.y"
+#line 1297 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
- case 117:
+ case 120:
/* Line 1778 of yacc.c */
-#line 1287 "awkgram.y"
+#line 1299 "awkgram.y"
{
(yyvsp[(2) - (2)])->opcode = Op_assign_quotient;
(yyval) = (yyvsp[(2) - (2)]);
}
break;
- case 118:
+ case 121:
/* Line 1778 of yacc.c */
-#line 1295 "awkgram.y"
+#line 1307 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
- case 119:
+ case 122:
/* Line 1778 of yacc.c */
-#line 1297 "awkgram.y"
+#line 1309 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
- case 120:
+ case 123:
/* Line 1778 of yacc.c */
-#line 1302 "awkgram.y"
+#line 1314 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
- case 121:
+ case 124:
/* Line 1778 of yacc.c */
-#line 1304 "awkgram.y"
+#line 1316 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
- case 122:
+ case 125:
/* Line 1778 of yacc.c */
-#line 1309 "awkgram.y"
+#line 1321 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
- case 123:
+ case 126:
/* Line 1778 of yacc.c */
-#line 1311 "awkgram.y"
+#line 1323 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
- case 124:
+ case 127:
/* Line 1778 of yacc.c */
-#line 1313 "awkgram.y"
+#line 1325 "awkgram.y"
{
int count = 2;
- int is_simple_var = FALSE;
+ bool is_simple_var = false;
if ((yyvsp[(1) - (2)])->lasti->opcode == Op_concat) {
/* multiple (> 2) adjacent strings optimization */
@@ -3443,32 +3480,29 @@ regular_loop:
(yyvsp[(1) - (2)])->lasti->opcode = Op_no_op;
} else {
is_simple_var = ((yyvsp[(1) - (2)])->nexti->opcode == Op_push
- && (yyvsp[(1) - (2)])->lasti == (yyvsp[(1) - (2)])->nexti); /* first exp. is a simple
- * variable?; kludge for use
- * in Op_assign_concat.
- */
+ && (yyvsp[(1) - (2)])->lasti == (yyvsp[(1) - (2)])->nexti); /* first exp. is a simple
+ * variable?; kludge for use
+ * in Op_assign_concat.
+ */
}
if (do_optimize > 1
- && (yyvsp[(1) - (2)])->nexti == (yyvsp[(1) - (2)])->lasti && (yyvsp[(1) - (2)])->nexti->opcode == Op_push_i
- && (yyvsp[(2) - (2)])->nexti == (yyvsp[(2) - (2)])->lasti && (yyvsp[(2) - (2)])->nexti->opcode == Op_push_i
+ && (yyvsp[(1) - (2)])->nexti == (yyvsp[(1) - (2)])->lasti && (yyvsp[(1) - (2)])->nexti->opcode == Op_push_i
+ && (yyvsp[(2) - (2)])->nexti == (yyvsp[(2) - (2)])->lasti && (yyvsp[(2) - (2)])->nexti->opcode == Op_push_i
) {
NODE *n1 = (yyvsp[(1) - (2)])->nexti->memory;
NODE *n2 = (yyvsp[(2) - (2)])->nexti->memory;
size_t nlen;
- (void) force_string(n1);
- (void) force_string(n2);
+ n1 = force_string(n1);
+ n2 = force_string(n2);
nlen = n1->stlen + n2->stlen;
erealloc(n1->stptr, char *, nlen + 2, "constant fold");
memcpy(n1->stptr + n1->stlen, n2->stptr, n2->stlen);
n1->stlen = nlen;
n1->stptr[nlen] = '\0';
- n1->flags &= ~(NUMCUR|NUMBER);
+ n1->flags &= ~(NUMCUR|NUMBER|NUMINT);
n1->flags |= (STRING|STRCUR);
-
- n2->flags &= ~PERM;
- n2->flags |= MALLOC;
unref(n2);
bcfree((yyvsp[(2) - (2)])->nexti);
bcfree((yyvsp[(2) - (2)]));
@@ -3483,45 +3517,45 @@ regular_loop:
}
break;
- case 126:
+ case 129:
/* Line 1778 of yacc.c */
-#line 1368 "awkgram.y"
+#line 1377 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
- case 127:
+ case 130:
/* Line 1778 of yacc.c */
-#line 1370 "awkgram.y"
+#line 1379 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
- case 128:
+ case 131:
/* Line 1778 of yacc.c */
-#line 1372 "awkgram.y"
+#line 1381 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
- case 129:
+ case 132:
/* Line 1778 of yacc.c */
-#line 1374 "awkgram.y"
+#line 1383 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
- case 130:
+ case 133:
/* Line 1778 of yacc.c */
-#line 1376 "awkgram.y"
+#line 1385 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
- case 131:
+ case 134:
/* Line 1778 of yacc.c */
-#line 1378 "awkgram.y"
+#line 1387 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
- case 132:
+ case 135:
/* Line 1778 of yacc.c */
-#line 1380 "awkgram.y"
+#line 1389 "awkgram.y"
{
/*
* In BEGINFILE/ENDFILE, allow `getline var < file'
@@ -3546,27 +3580,27 @@ regular_loop:
}
break;
- case 133:
+ case 136:
/* Line 1778 of yacc.c */
-#line 1403 "awkgram.y"
+#line 1412 "awkgram.y"
{
(yyvsp[(2) - (2)])->opcode = Op_postincrement;
(yyval) = mk_assignment((yyvsp[(1) - (2)]), NULL, (yyvsp[(2) - (2)]));
}
break;
- case 134:
+ case 137:
/* Line 1778 of yacc.c */
-#line 1408 "awkgram.y"
+#line 1417 "awkgram.y"
{
(yyvsp[(2) - (2)])->opcode = Op_postdecrement;
(yyval) = mk_assignment((yyvsp[(1) - (2)]), NULL, (yyvsp[(2) - (2)]));
}
break;
- case 135:
+ case 138:
/* Line 1778 of yacc.c */
-#line 1413 "awkgram.y"
+#line 1422 "awkgram.y"
{
if (do_lint_old) {
warning_ln((yyvsp[(4) - (5)])->source_line,
@@ -3582,78 +3616,79 @@ regular_loop:
(yyval) = list_merge((yyvsp[(5) - (5)]), (yyvsp[(4) - (5)]));
} else {
INSTRUCTION *t = (yyvsp[(2) - (5)]);
- (yyvsp[(4) - (5)])->expr_count = count_expressions(&t, FALSE);
+ (yyvsp[(4) - (5)])->expr_count = count_expressions(&t, false);
(yyval) = list_append(list_merge(t, (yyvsp[(5) - (5)])), (yyvsp[(4) - (5)]));
}
}
break;
- case 136:
+ case 139:
/* Line 1778 of yacc.c */
-#line 1438 "awkgram.y"
+#line 1447 "awkgram.y"
{
(yyval) = mk_getline((yyvsp[(3) - (4)]), (yyvsp[(4) - (4)]), (yyvsp[(1) - (4)]), (yyvsp[(2) - (4)])->redir_type);
bcfree((yyvsp[(2) - (4)]));
}
break;
- case 137:
+ case 140:
/* Line 1778 of yacc.c */
-#line 1444 "awkgram.y"
+#line 1453 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
- case 138:
+ case 141:
/* Line 1778 of yacc.c */
-#line 1446 "awkgram.y"
+#line 1455 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
- case 139:
+ case 142:
/* Line 1778 of yacc.c */
-#line 1448 "awkgram.y"
+#line 1457 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
- case 140:
+ case 143:
/* Line 1778 of yacc.c */
-#line 1450 "awkgram.y"
+#line 1459 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
- case 141:
+ case 144:
/* Line 1778 of yacc.c */
-#line 1452 "awkgram.y"
+#line 1461 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
- case 142:
+ case 145:
/* Line 1778 of yacc.c */
-#line 1454 "awkgram.y"
+#line 1463 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
- case 143:
+ case 146:
/* Line 1778 of yacc.c */
-#line 1459 "awkgram.y"
+#line 1468 "awkgram.y"
{
(yyval) = list_create((yyvsp[(1) - (1)]));
}
break;
- case 144:
+ case 147:
/* Line 1778 of yacc.c */
-#line 1463 "awkgram.y"
+#line 1472 "awkgram.y"
{
if ((yyvsp[(2) - (2)])->opcode == Op_match_rec) {
(yyvsp[(2) - (2)])->opcode = Op_nomatch;
(yyvsp[(1) - (2)])->opcode = Op_push_i;
- (yyvsp[(1) - (2)])->memory = mk_number(0.0, (PERM|NUMCUR|NUMBER));
+ (yyvsp[(1) - (2)])->memory = make_number(0.0);
(yyval) = list_append(list_append(list_create((yyvsp[(1) - (2)])),
- instruction(Op_field_spec)), (yyvsp[(2) - (2)]));
+ instruction(Op_field_spec)), (yyvsp[(2) - (2)]));
} else {
if (do_optimize > 1 && (yyvsp[(2) - (2)])->nexti == (yyvsp[(2) - (2)])->lasti
- && (yyvsp[(2) - (2)])->nexti->opcode == Op_push_i
+ && (yyvsp[(2) - (2)])->nexti->opcode == Op_push_i
+ && ((yyvsp[(2) - (2)])->nexti->memory->flags & (MPFN|MPZN)) == 0
) {
NODE *n = (yyvsp[(2) - (2)])->nexti->memory;
if ((n->flags & (STRCUR|STRING)) != 0) {
@@ -3676,15 +3711,15 @@ regular_loop:
}
break;
- case 145:
+ case 148:
/* Line 1778 of yacc.c */
-#line 1494 "awkgram.y"
+#line 1504 "awkgram.y"
{ (yyval) = (yyvsp[(2) - (3)]); }
break;
- case 146:
+ case 149:
/* Line 1778 of yacc.c */
-#line 1496 "awkgram.y"
+#line 1506 "awkgram.y"
{
(yyval) = snode((yyvsp[(3) - (4)]), (yyvsp[(1) - (4)]));
if ((yyval) == NULL)
@@ -3692,9 +3727,9 @@ regular_loop:
}
break;
- case 147:
+ case 150:
/* Line 1778 of yacc.c */
-#line 1502 "awkgram.y"
+#line 1512 "awkgram.y"
{
(yyval) = snode((yyvsp[(3) - (4)]), (yyvsp[(1) - (4)]));
if ((yyval) == NULL)
@@ -3702,14 +3737,14 @@ regular_loop:
}
break;
- case 148:
+ case 151:
/* Line 1778 of yacc.c */
-#line 1508 "awkgram.y"
+#line 1518 "awkgram.y"
{
- static short warned1 = FALSE;
+ static bool warned = false;
- if (do_lint && ! warned1) {
- warned1 = TRUE;
+ if (do_lint && ! warned) {
+ warned = true;
lintwarn_ln((yyvsp[(1) - (1)])->source_line,
_("call of `length' without parentheses is not portable"));
}
@@ -3719,47 +3754,50 @@ regular_loop:
}
break;
- case 151:
+ case 154:
/* Line 1778 of yacc.c */
-#line 1523 "awkgram.y"
+#line 1533 "awkgram.y"
{
(yyvsp[(1) - (2)])->opcode = Op_preincrement;
(yyval) = mk_assignment((yyvsp[(2) - (2)]), NULL, (yyvsp[(1) - (2)]));
}
break;
- case 152:
+ case 155:
/* Line 1778 of yacc.c */
-#line 1528 "awkgram.y"
+#line 1538 "awkgram.y"
{
(yyvsp[(1) - (2)])->opcode = Op_predecrement;
(yyval) = mk_assignment((yyvsp[(2) - (2)]), NULL, (yyvsp[(1) - (2)]));
}
break;
- case 153:
+ case 156:
/* Line 1778 of yacc.c */
-#line 1533 "awkgram.y"
+#line 1543 "awkgram.y"
{
(yyval) = list_create((yyvsp[(1) - (1)]));
}
break;
- case 154:
+ case 157:
/* Line 1778 of yacc.c */
-#line 1537 "awkgram.y"
+#line 1547 "awkgram.y"
{
(yyval) = list_create((yyvsp[(1) - (1)]));
}
break;
- case 155:
+ case 158:
/* Line 1778 of yacc.c */
-#line 1541 "awkgram.y"
+#line 1551 "awkgram.y"
{
if ((yyvsp[(2) - (2)])->lasti->opcode == Op_push_i
- && ((yyvsp[(2) - (2)])->lasti->memory->flags & (STRCUR|STRING)) == 0) {
- (yyvsp[(2) - (2)])->lasti->memory->numbr = -(force_number((yyvsp[(2) - (2)])->lasti->memory));
+ && ((yyvsp[(2) - (2)])->lasti->memory->flags & (STRCUR|STRING)) == 0
+ ) {
+ NODE *n = (yyvsp[(2) - (2)])->lasti->memory;
+ (void) force_number(n);
+ negate_num(n);
(yyval) = (yyvsp[(2) - (2)]);
bcfree((yyvsp[(1) - (2)]));
} else {
@@ -3769,44 +3807,44 @@ regular_loop:
}
break;
- case 156:
+ case 159:
/* Line 1778 of yacc.c */
-#line 1553 "awkgram.y"
+#line 1566 "awkgram.y"
{
/*
* was: $$ = $2
* POSIX semantics: force a conversion to numeric type
*/
(yyvsp[(1) - (2)])->opcode = Op_plus_i;
- (yyvsp[(1) - (2)])->memory = mk_number((AWKNUM) 0.0, (PERM|NUMCUR|NUMBER));
+ (yyvsp[(1) - (2)])->memory = make_number(0.0);
(yyval) = list_append((yyvsp[(2) - (2)]), (yyvsp[(1) - (2)]));
}
break;
- case 157:
+ case 160:
/* Line 1778 of yacc.c */
-#line 1566 "awkgram.y"
+#line 1579 "awkgram.y"
{
func_use((yyvsp[(1) - (1)])->lasti->func_name, FUNC_USE);
(yyval) = (yyvsp[(1) - (1)]);
}
break;
- case 158:
+ case 161:
/* Line 1778 of yacc.c */
-#line 1571 "awkgram.y"
+#line 1584 "awkgram.y"
{
/* indirect function call */
INSTRUCTION *f, *t;
char *name;
NODE *indirect_var;
- static short warned = FALSE;
+ static bool warned = false;
const char *msg = _("indirect function calls are a gawk extension");
if (do_traditional || do_posix)
yyerror("%s", msg);
else if (do_lint && ! warned) {
- warned = TRUE;
+ warned = true;
lintwarn("%s", msg);
}
@@ -3815,7 +3853,7 @@ regular_loop:
name = estrdup(f->func_name, strlen(f->func_name));
if (is_std_var(name))
yyerror(_("can not use special variable `%s' for indirect function call"), name);
- indirect_var = variable(name, Node_var_new);
+ indirect_var = variable(f->source_line, name, Node_var_new);
t = instruction(Op_push);
t->memory = indirect_var;
@@ -3829,9 +3867,9 @@ regular_loop:
}
break;
- case 159:
+ case 162:
/* Line 1778 of yacc.c */
-#line 1607 "awkgram.y"
+#line 1620 "awkgram.y"
{
param_sanity((yyvsp[(3) - (4)]));
(yyvsp[(1) - (4)])->opcode = Op_func_call;
@@ -3841,53 +3879,53 @@ regular_loop:
(yyval) = list_create((yyvsp[(1) - (4)]));
} else {
INSTRUCTION *t = (yyvsp[(3) - (4)]);
- ((yyvsp[(1) - (4)]) + 1)->expr_count = count_expressions(&t, TRUE);
+ ((yyvsp[(1) - (4)]) + 1)->expr_count = count_expressions(&t, true);
(yyval) = list_append(t, (yyvsp[(1) - (4)]));
}
}
break;
- case 160:
+ case 163:
/* Line 1778 of yacc.c */
-#line 1624 "awkgram.y"
+#line 1637 "awkgram.y"
{ (yyval) = NULL; }
break;
- case 161:
+ case 164:
/* Line 1778 of yacc.c */
-#line 1626 "awkgram.y"
+#line 1639 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
- case 162:
+ case 165:
/* Line 1778 of yacc.c */
-#line 1631 "awkgram.y"
+#line 1644 "awkgram.y"
{ (yyval) = NULL; }
break;
- case 163:
+ case 166:
/* Line 1778 of yacc.c */
-#line 1633 "awkgram.y"
+#line 1646 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (2)]); }
break;
- case 164:
+ case 167:
/* Line 1778 of yacc.c */
-#line 1638 "awkgram.y"
+#line 1651 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
- case 165:
+ case 168:
/* Line 1778 of yacc.c */
-#line 1640 "awkgram.y"
+#line 1653 "awkgram.y"
{
(yyval) = list_merge((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]));
}
break;
- case 166:
+ case 169:
/* Line 1778 of yacc.c */
-#line 1647 "awkgram.y"
+#line 1660 "awkgram.y"
{
INSTRUCTION *ip = (yyvsp[(1) - (1)])->lasti;
int count = ip->sub_count; /* # of SUBSEP-seperated expressions */
@@ -3903,9 +3941,9 @@ regular_loop:
}
break;
- case 167:
+ case 170:
/* Line 1778 of yacc.c */
-#line 1664 "awkgram.y"
+#line 1677 "awkgram.y"
{
INSTRUCTION *t = (yyvsp[(2) - (3)]);
if ((yyvsp[(2) - (3)]) == NULL) {
@@ -3913,69 +3951,65 @@ regular_loop:
_("invalid subscript expression"));
/* install Null string as subscript. */
t = list_create(instruction(Op_push_i));
- t->nexti->memory = Nnull_string;
+ t->nexti->memory = dupnode(Nnull_string);
(yyvsp[(3) - (3)])->sub_count = 1;
} else
- (yyvsp[(3) - (3)])->sub_count = count_expressions(&t, FALSE);
+ (yyvsp[(3) - (3)])->sub_count = count_expressions(&t, false);
(yyval) = list_append(t, (yyvsp[(3) - (3)]));
}
break;
- case 168:
+ case 171:
/* Line 1778 of yacc.c */
-#line 1681 "awkgram.y"
+#line 1694 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
- case 169:
+ case 172:
/* Line 1778 of yacc.c */
-#line 1683 "awkgram.y"
+#line 1696 "awkgram.y"
{
(yyval) = list_merge((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]));
}
break;
- case 170:
+ case 173:
/* Line 1778 of yacc.c */
-#line 1690 "awkgram.y"
+#line 1703 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (2)]); }
break;
- case 171:
+ case 174:
/* Line 1778 of yacc.c */
-#line 1695 "awkgram.y"
+#line 1708 "awkgram.y"
{
char *var_name = (yyvsp[(1) - (1)])->lextok;
(yyvsp[(1) - (1)])->opcode = Op_push;
- (yyvsp[(1) - (1)])->memory = variable(var_name, Node_var_new);
+ (yyvsp[(1) - (1)])->memory = variable((yyvsp[(1) - (1)])->source_line, var_name, Node_var_new);
(yyval) = list_create((yyvsp[(1) - (1)]));
}
break;
- case 172:
+ case 175:
/* Line 1778 of yacc.c */
-#line 1703 "awkgram.y"
+#line 1716 "awkgram.y"
{
- NODE *n;
-
char *arr = (yyvsp[(1) - (2)])->lextok;
- if ((n = lookup(arr)) != NULL && ! isarray(n))
- yyerror(_("use of non-array as array"));
- (yyvsp[(1) - (2)])->memory = variable(arr, Node_var_new);
+ (yyvsp[(1) - (2)])->memory = variable((yyvsp[(1) - (2)])->source_line, arr, Node_var_new);
(yyvsp[(1) - (2)])->opcode = Op_push_array;
(yyval) = list_prepend((yyvsp[(2) - (2)]), (yyvsp[(1) - (2)]));
}
break;
- case 173:
+ case 176:
/* Line 1778 of yacc.c */
-#line 1717 "awkgram.y"
+#line 1726 "awkgram.y"
{
INSTRUCTION *ip = (yyvsp[(1) - (1)])->nexti;
if (ip->opcode == Op_push
- && ip->memory->type == Node_var
- && ip->memory->var_update
+ && ip->memory->type == Node_var
+ && ip->memory->var_update
) {
(yyval) = list_prepend((yyvsp[(1) - (1)]), instruction(Op_var_update));
(yyval)->nexti->update_var = ip->memory->var_update;
@@ -3984,71 +4018,71 @@ regular_loop:
}
break;
- case 174:
+ case 177:
/* Line 1778 of yacc.c */
-#line 1729 "awkgram.y"
+#line 1738 "awkgram.y"
{
(yyval) = list_append((yyvsp[(2) - (3)]), (yyvsp[(1) - (3)]));
if ((yyvsp[(3) - (3)]) != NULL)
- mk_assignment((yyvsp[(2) - (3)]), NULL, (yyvsp[(3) - (3)]));
+ mk_assignment((yyvsp[(2) - (3)]), NULL, (yyvsp[(3) - (3)]));
}
break;
- case 175:
+ case 178:
/* Line 1778 of yacc.c */
-#line 1738 "awkgram.y"
+#line 1747 "awkgram.y"
{
(yyvsp[(1) - (1)])->opcode = Op_postincrement;
}
break;
- case 176:
+ case 179:
/* Line 1778 of yacc.c */
-#line 1742 "awkgram.y"
+#line 1751 "awkgram.y"
{
(yyvsp[(1) - (1)])->opcode = Op_postdecrement;
}
break;
- case 177:
+ case 180:
/* Line 1778 of yacc.c */
-#line 1745 "awkgram.y"
+#line 1754 "awkgram.y"
{ (yyval) = NULL; }
break;
- case 179:
+ case 182:
/* Line 1778 of yacc.c */
-#line 1753 "awkgram.y"
+#line 1762 "awkgram.y"
{ yyerrok; }
break;
- case 180:
+ case 183:
/* Line 1778 of yacc.c */
-#line 1757 "awkgram.y"
+#line 1766 "awkgram.y"
{ yyerrok; }
break;
- case 183:
+ case 186:
/* Line 1778 of yacc.c */
-#line 1766 "awkgram.y"
+#line 1775 "awkgram.y"
{ yyerrok; }
break;
- case 184:
+ case 187:
/* Line 1778 of yacc.c */
-#line 1770 "awkgram.y"
+#line 1779 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); yyerrok; }
break;
- case 185:
+ case 188:
/* Line 1778 of yacc.c */
-#line 1774 "awkgram.y"
+#line 1783 "awkgram.y"
{ yyerrok; }
break;
/* Line 1778 of yacc.c */
-#line 4064 "awkgram.c"
+#line 4098 "awkgram.c"
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -4280,7 +4314,7 @@ yyreturn:
/* Line 2041 of yacc.c */
-#line 1776 "awkgram.y"
+#line 1785 "awkgram.y"
struct token {
@@ -4299,6 +4333,7 @@ struct token {
# define CONTINUE 0x2000 /* continue allowed inside */
NODE *(*ptr)(int); /* function that implements this keyword */
+ NODE *(*ptr2)(int); /* alternate arbitrary-precision function */
};
#if 'a' == 0x81 /* it's EBCDIC */
@@ -4322,81 +4357,87 @@ tokcompare(const void *l, const void *r)
* Function pointers come from declarations in awk.h.
*/
+#ifdef HAVE_MPFR
+#define MPF(F) do_mpfr_##F
+#else
+#define MPF(F) 0
+#endif
+
static const struct token tokentab[] = {
-{"BEGIN", Op_rule, LEX_BEGIN, 0, 0},
-{"BEGINFILE", Op_rule, LEX_BEGINFILE, GAWKX, 0},
-{"END", Op_rule, LEX_END, 0, 0},
-{"ENDFILE", Op_rule, LEX_ENDFILE, GAWKX, 0},
+{"BEGIN", Op_rule, LEX_BEGIN, 0, 0, 0},
+{"BEGINFILE", Op_rule, LEX_BEGINFILE, GAWKX, 0, 0},
+{"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), do_adump},
+{"adump", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2), do_adump, 0},
#endif
-{"and", Op_builtin, LEX_BUILTIN, GAWKX|A(2), do_and},
-{"asort", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3), do_asort},
-{"asorti", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3), do_asorti},
-{"atan2", Op_builtin, LEX_BUILTIN, NOT_OLD|A(2), do_atan2},
-{"bindtextdomain", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2), do_bindtextdomain},
-{"break", Op_K_break, LEX_BREAK, 0, 0},
-{"case", Op_K_case, LEX_CASE, GAWKX, 0},
-{"close", Op_builtin, LEX_BUILTIN, NOT_OLD|A(1)|A(2), do_close},
-{"compl", Op_builtin, LEX_BUILTIN, GAWKX|A(1), do_compl},
-{"continue", Op_K_continue, LEX_CONTINUE, 0, 0},
-{"cos", Op_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_cos},
-{"dcgettext", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3), do_dcgettext},
-{"dcngettext", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3)|A(4)|A(5), do_dcngettext},
-{"default", Op_K_default, LEX_DEFAULT, GAWKX, 0},
-{"delete", Op_K_delete, LEX_DELETE, NOT_OLD, 0},
-{"do", Op_K_do, LEX_DO, NOT_OLD|BREAK|CONTINUE, 0},
-{"else", Op_K_else, LEX_ELSE, 0, 0},
-{"eval", Op_symbol, LEX_EVAL, 0, 0},
-{"exit", Op_K_exit, LEX_EXIT, 0, 0},
-{"exp", Op_builtin, LEX_BUILTIN, A(1), do_exp},
-{"extension", Op_builtin, LEX_BUILTIN, GAWKX|A(2), do_ext},
-{"fflush", Op_builtin, LEX_BUILTIN, RESX|A(0)|A(1), do_fflush},
-{"for", Op_K_for, LEX_FOR, BREAK|CONTINUE, 0},
-{"func", Op_func, LEX_FUNCTION, NOT_POSIX|NOT_OLD, 0},
-{"function",Op_func, LEX_FUNCTION, NOT_OLD, 0},
-{"gensub", Op_sub_builtin, LEX_BUILTIN, GAWKX|A(3)|A(4), 0},
-{"getline", Op_K_getline_redir, LEX_GETLINE, NOT_OLD, 0},
-{"gsub", Op_sub_builtin, LEX_BUILTIN, NOT_OLD|A(2)|A(3), 0},
-{"if", Op_K_if, LEX_IF, 0, 0},
-{"in", Op_symbol, LEX_IN, 0, 0},
-{"include", Op_symbol, LEX_INCLUDE, GAWKX, 0},
-{"index", Op_builtin, LEX_BUILTIN, A(2), do_index},
-{"int", Op_builtin, LEX_BUILTIN, A(1), do_int},
-{"isarray", Op_builtin, LEX_BUILTIN, GAWKX|A(1), do_isarray},
-{"length", Op_builtin, LEX_LENGTH, A(0)|A(1), do_length},
-{"log", Op_builtin, LEX_BUILTIN, A(1), do_log},
-{"lshift", Op_builtin, LEX_BUILTIN, GAWKX|A(2), do_lshift},
-{"match", Op_builtin, LEX_BUILTIN, NOT_OLD|A(2)|A(3), do_match},
-{"mktime", Op_builtin, LEX_BUILTIN, GAWKX|A(1), do_mktime},
-{"next", Op_K_next, LEX_NEXT, 0, 0},
-{"nextfile", Op_K_nextfile, LEX_NEXTFILE, 0, 0},
-{"or", Op_builtin, LEX_BUILTIN, GAWKX|A(2), do_or},
-{"patsplit", Op_builtin, LEX_BUILTIN, GAWKX|A(2)|A(3)|A(4), do_patsplit},
-{"print", Op_K_print, LEX_PRINT, 0, 0},
-{"printf", Op_K_printf, LEX_PRINTF, 0, 0},
-{"rand", Op_builtin, LEX_BUILTIN, NOT_OLD|A(0), do_rand},
-{"return", Op_K_return, LEX_RETURN, NOT_OLD, 0},
-{"rshift", Op_builtin, LEX_BUILTIN, GAWKX|A(2), do_rshift},
-{"sin", Op_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_sin},
-{"split", Op_builtin, LEX_BUILTIN, A(2)|A(3)|A(4), do_split},
-{"sprintf", Op_builtin, LEX_BUILTIN, 0, do_sprintf},
-{"sqrt", Op_builtin, LEX_BUILTIN, A(1), do_sqrt},
-{"srand", Op_builtin, LEX_BUILTIN, NOT_OLD|A(0)|A(1), do_srand},
+{"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},
+{"asorti", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3), do_asorti, 0},
+{"atan2", Op_builtin, LEX_BUILTIN, NOT_OLD|A(2), do_atan2, MPF(atan2)},
+{"bindtextdomain", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2), do_bindtextdomain, 0},
+{"break", Op_K_break, LEX_BREAK, 0, 0, 0},
+{"case", Op_K_case, LEX_CASE, GAWKX, 0, 0},
+{"close", Op_builtin, LEX_BUILTIN, NOT_OLD|A(1)|A(2), do_close, 0},
+{"compl", Op_builtin, LEX_BUILTIN, GAWKX|A(1), do_compl, MPF(compl)},
+{"continue", Op_K_continue, LEX_CONTINUE, 0, 0, 0},
+{"cos", Op_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_cos, MPF(cos)},
+{"dcgettext", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3), do_dcgettext, 0},
+{"dcngettext", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3)|A(4)|A(5), do_dcngettext, 0},
+{"default", Op_K_default, LEX_DEFAULT, GAWKX, 0, 0},
+{"delete", Op_K_delete, LEX_DELETE, NOT_OLD, 0, 0},
+{"do", Op_K_do, LEX_DO, NOT_OLD|BREAK|CONTINUE, 0, 0},
+{"else", Op_K_else, LEX_ELSE, 0, 0, 0},
+{"eval", Op_symbol, LEX_EVAL, 0, 0, 0},
+{"exit", Op_K_exit, LEX_EXIT, 0, 0, 0},
+{"exp", Op_builtin, LEX_BUILTIN, A(1), do_exp, MPF(exp)},
+{"fflush", Op_builtin, LEX_BUILTIN, RESX|A(0)|A(1), do_fflush, 0},
+{"for", Op_K_for, LEX_FOR, BREAK|CONTINUE, 0, 0},
+{"func", Op_func, LEX_FUNCTION, NOT_POSIX|NOT_OLD, 0, 0},
+{"function",Op_func, LEX_FUNCTION, NOT_OLD, 0, 0},
+{"gensub", Op_sub_builtin, LEX_BUILTIN, GAWKX|A(3)|A(4), 0, 0},
+{"getline", Op_K_getline_redir, LEX_GETLINE, NOT_OLD, 0, 0},
+{"gsub", Op_sub_builtin, LEX_BUILTIN, NOT_OLD|A(2)|A(3), 0, 0},
+{"if", Op_K_if, LEX_IF, 0, 0, 0},
+{"in", Op_symbol, LEX_IN, 0, 0, 0},
+{"include", Op_symbol, LEX_INCLUDE, GAWKX, 0, 0},
+{"index", Op_builtin, LEX_BUILTIN, A(2), do_index, 0},
+{"int", Op_builtin, LEX_BUILTIN, A(1), do_int, MPF(int)},
+{"isarray", Op_builtin, LEX_BUILTIN, GAWKX|A(1), do_isarray, 0},
+{"length", Op_builtin, LEX_LENGTH, A(0)|A(1), do_length, 0},
+{"load", Op_symbol, LEX_LOAD, GAWKX, 0, 0},
+{"log", Op_builtin, LEX_BUILTIN, A(1), do_log, MPF(log)},
+{"lshift", Op_builtin, LEX_BUILTIN, GAWKX|A(2), do_lshift, MPF(lshift)},
+{"match", Op_builtin, LEX_BUILTIN, NOT_OLD|A(2)|A(3), do_match, 0},
+{"mktime", Op_builtin, LEX_BUILTIN, GAWKX|A(1), do_mktime, 0},
+{"next", Op_K_next, LEX_NEXT, 0, 0, 0},
+{"nextfile", Op_K_nextfile, LEX_NEXTFILE, 0, 0, 0},
+{"or", Op_builtin, LEX_BUILTIN, GAWKX, do_or, MPF(or)},
+{"patsplit", Op_builtin, LEX_BUILTIN, GAWKX|A(2)|A(3)|A(4), do_patsplit, 0},
+{"print", Op_K_print, LEX_PRINT, 0, 0, 0},
+{"printf", Op_K_printf, LEX_PRINTF, 0, 0, 0},
+{"rand", Op_builtin, LEX_BUILTIN, NOT_OLD|A(0), do_rand, MPF(rand)},
+{"return", Op_K_return, LEX_RETURN, NOT_OLD, 0, 0},
+{"rshift", Op_builtin, LEX_BUILTIN, GAWKX|A(2), do_rshift, MPF(rhift)},
+{"sin", Op_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_sin, MPF(sin)},
+{"split", Op_builtin, LEX_BUILTIN, A(2)|A(3)|A(4), do_split, 0},
+{"sprintf", Op_builtin, LEX_BUILTIN, 0, do_sprintf, 0},
+{"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},
+{"stopme", Op_builtin, LEX_BUILTIN, GAWKX|A(0), stopme, 0},
#endif
-{"strftime", Op_builtin, LEX_BUILTIN, GAWKX|A(0)|A(1)|A(2)|A(3), do_strftime},
-{"strtonum", Op_builtin, LEX_BUILTIN, GAWKX|A(1), do_strtonum},
-{"sub", Op_sub_builtin, LEX_BUILTIN, NOT_OLD|A(2)|A(3), 0},
-{"substr", Op_builtin, LEX_BUILTIN, A(2)|A(3), do_substr},
-{"switch", Op_K_switch, LEX_SWITCH, GAWKX|BREAK, 0},
-{"system", Op_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_system},
-{"systime", Op_builtin, LEX_BUILTIN, GAWKX|A(0), do_systime},
-{"tolower", Op_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_tolower},
-{"toupper", Op_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_toupper},
-{"while", Op_K_while, LEX_WHILE, BREAK|CONTINUE, 0},
-{"xor", Op_builtin, LEX_BUILTIN, GAWKX|A(2), do_xor},
+{"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)},
+{"sub", Op_sub_builtin, LEX_BUILTIN, NOT_OLD|A(2)|A(3), 0, 0},
+{"substr", Op_builtin, LEX_BUILTIN, A(2)|A(3), do_substr, 0},
+{"switch", Op_K_switch, LEX_SWITCH, GAWKX|BREAK, 0, 0},
+{"system", Op_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_system, 0},
+{"systime", Op_builtin, LEX_BUILTIN, GAWKX|A(0), do_systime, 0},
+{"tolower", Op_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_tolower, 0},
+{"toupper", Op_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_toupper, 0},
+{"while", Op_K_while, LEX_WHILE, BREAK|CONTINUE, 0, 0},
+{"xor", Op_builtin, LEX_BUILTIN, GAWKX, do_xor, MPF(xor)},
};
#if MBS_SUPPORT
@@ -4432,6 +4473,23 @@ getfname(NODE *(*fptr)(int))
return NULL;
}
+/* negate_num --- negate a number in NODE */
+
+void
+negate_num(NODE *n)
+{
+#ifdef HAVE_MPFR
+ if (is_mpg_float(n)) {
+ int tval;
+ tval = mpfr_neg(n->mpg_numbr, n->mpg_numbr, ROUND_MODE);
+ IEEE_FMT(n->mpg_numbr, tval);
+ } else if (is_mpg_integer(n)) {
+ mpz_neg(n->mpg_i, n->mpg_i);
+ } else
+#endif
+ n->numbr = -n->numbr;
+}
+
/* print_included_from --- print `Included from ..' file names and locations */
static void
@@ -4455,7 +4513,7 @@ print_included_from()
line--;
msg("%s %s:%d%c",
s->prev == sourcefile ? "In file included from"
- : " from",
+ : " from",
(s->stype == SRC_INC ||
s->stype == SRC_FILE) ? s->src : "cmd. line",
line,
@@ -4477,7 +4535,7 @@ warning_ln(int line, const char *mesg, ...)
sourceline = line;
print_included_from();
va_start(args, mesg);
- err(_("warning: "), mesg, args);
+ err(false, _("warning: "), mesg, args);
va_end(args);
sourceline = saveline;
}
@@ -4495,9 +4553,9 @@ lintwarn_ln(int line, const char *mesg, ...)
print_included_from();
va_start(args, mesg);
if (lintfunc == r_fatal)
- err(_("fatal: "), mesg, args);
+ err(true, _("fatal: "), mesg, args);
else
- err(_("warning: "), mesg, args);
+ err(false, _("warning: "), mesg, args);
va_end(args);
sourceline = saveline;
if (lintfunc == r_fatal)
@@ -4517,7 +4575,7 @@ error_ln(int line, const char *m, ...)
print_included_from();
errcount++;
va_start(args, m);
- err("error: ", m, args);
+ err(false, "error: ", m, args);
va_end(args);
sourceline = saveline;
}
@@ -4595,7 +4653,7 @@ yyerror(const char *m, ...)
*bp++ = ' ';
}
strcpy(bp, mesg);
- err("", buf, args);
+ err(false, "", buf, args);
va_end(args);
efree(buf);
}
@@ -4636,7 +4694,7 @@ mk_program()
if (endfile_block == NULL)
endfile_block = list_create(ip_endfile);
else {
- ip_rec->has_endfile = TRUE;
+ ip_rec->has_endfile = true;
(void) list_prepend(endfile_block, ip_endfile);
}
@@ -4737,8 +4795,11 @@ parse_program(INSTRUCTION **pcode)
ip_atexit = instruction(Op_atexit); /* target for `exit' in END block */
}
- sourcefile = srcfiles->next;
- lexeof = FALSE;
+ for (sourcefile = srcfiles->next; sourcefile->stype == SRC_EXTLIB;
+ sourcefile = sourcefile->next)
+ ;
+
+ lexeof = false;
lexptr = NULL;
lasttok = 0;
memset(rule_block, 0, sizeof(ruletab) * sizeof(INSTRUCTION *));
@@ -4754,6 +4815,11 @@ parse_program(INSTRUCTION **pcode)
if (ret == 0) /* avoid spurious warning if parser aborted with YYABORT */
check_funcs();
+ if (args_array == NULL)
+ emalloc(args_array, NODE **, (max_args + 2) * sizeof(NODE *), "parse_program");
+ else
+ erealloc(args_array, NODE **, (max_args + 2) * sizeof(NODE *), "parse_program");
+
return (ret || errcount);
}
@@ -4782,7 +4848,7 @@ do_add_srcfile(int stype, char *src, char *path, SRCFILE *thisfile)
*/
SRCFILE *
-add_srcfile(int stype, char *src, SRCFILE *thisfile, int *already_included, int *errcode)
+add_srcfile(int stype, char *src, SRCFILE *thisfile, bool *already_included, int *errcode)
{
SRCFILE *s;
struct stat sbuf;
@@ -4790,41 +4856,61 @@ add_srcfile(int stype, char *src, SRCFILE *thisfile, int *already_included, int
int errno_val = 0;
if (already_included)
- *already_included = FALSE;
+ *already_included = false;
if (errcode)
*errcode = 0;
if (stype == SRC_CMDLINE || stype == SRC_STDIN)
return do_add_srcfile(stype, src, NULL, thisfile);
- path = find_source(src, &sbuf, &errno_val);
+ path = find_source(src, & sbuf, &errno_val, stype == SRC_EXTLIB);
if (path == NULL) {
if (errcode) {
*errcode = errno_val;
return NULL;
}
- fatal(_("can't open source file `%s' for reading (%s)"),
- src, errno_val ? strerror(errno_val) : _("reason unknown"));
+ /* use full messages to ease translation */
+ fatal(stype != SRC_EXTLIB
+ ? _("can't open source file `%s' for reading (%s)")
+ : _("can't open shared library `%s' for reading (%s)"),
+ src,
+ errno_val ? strerror(errno_val) : _("reason unknown"));
}
+ /* N.B. We do not eliminate duplicate SRC_FILE (-f) programs. */
for (s = srcfiles->next; s != srcfiles; s = s->next) {
- if ((s->stype == SRC_FILE || s->stype == SRC_INC)
- && files_are_same(path, s)
- ) {
- if (do_lint) {
- int line = sourceline;
- /* Kludge: the line number may be off for `@include file'.
- * Since, this function is also used for '-f file' in main.c,
- * sourceline > 1 check ensures that the call is at
- * parse time.
- */
- if (sourceline > 1 && lasttok == NEWLINE)
- line--;
- lintwarn_ln(line, _("already included source file `%s'"), src);
+ if ((s->stype == SRC_FILE || s->stype == SRC_INC || s->stype == SRC_EXTLIB) && files_are_same(path, s)) {
+ if (stype == SRC_INC || stype == SRC_EXTLIB) {
+ /* eliminate duplicates */
+ if ((stype == SRC_INC) && (s->stype == SRC_FILE))
+ fatal(_("can't include `%s' and use it as a program file"), src);
+
+ if (do_lint) {
+ int line = sourceline;
+ /* Kludge: the line number may be off for `@include file'.
+ * Since, this function is also used for '-f file' in main.c,
+ * sourceline > 1 check ensures that the call is at
+ * parse time.
+ */
+ if (sourceline > 1 && lasttok == NEWLINE)
+ line--;
+ lintwarn_ln(line,
+ stype != SRC_EXTLIB
+ ? _("already included source file `%s'")
+ : _("already loaded shared library `%s'"),
+ src);
+ }
+ efree(path);
+ if (already_included)
+ *already_included = true;
+ return NULL;
+ } else {
+ /* duplicates are allowed for -f */
+ if (s->stype == SRC_INC)
+ fatal(_("can't include `%s' and use it as a program file"), src);
+ /* no need to scan for further matches, since
+ * they must be of homogeneous type */
+ break;
}
- efree(path);
- if (already_included)
- *already_included = TRUE;
- return NULL;
}
}
@@ -4842,7 +4928,7 @@ include_source(INSTRUCTION *file)
SRCFILE *s;
char *src = file->lextok;
int errcode;
- int already_included;
+ bool already_included;
if (do_traditional || do_posix) {
error_ln(file->source_line, _("@include is a gawk extension"));
@@ -4879,8 +4965,43 @@ include_source(INSTRUCTION *file)
sourceline = 0;
source = NULL;
lasttok = 0;
- lexeof = FALSE;
- eof_warned = FALSE;
+ lexeof = false;
+ eof_warned = false;
+ return 0;
+}
+
+/* load_library --- load a shared library */
+
+static int
+load_library(INSTRUCTION *file)
+{
+ SRCFILE *s;
+ char *src = file->lextok;
+ int errcode;
+ bool already_included;
+
+ if (do_traditional || do_posix) {
+ error_ln(file->source_line, _("@load is a gawk extension"));
+ return -1;
+ }
+
+ if (strlen(src) == 0) {
+ if (do_lint)
+ lintwarn_ln(file->source_line, _("empty filename after @load"));
+ return 0;
+ }
+
+ s = add_srcfile(SRC_EXTLIB, src, sourcefile, &already_included, &errcode);
+ if (s == NULL) {
+ if (already_included)
+ return 0;
+ error_ln(file->source_line,
+ _("can't open shared library `%s' for reading (%s)"),
+ src, errcode ? strerror(errcode) : _("reason unknown"));
+ return -1;
+ }
+
+ load_ext(s->fullpath);
return 0;
}
@@ -4907,10 +5028,11 @@ next_sourcefile()
* Previous versions of gawk did not core dump in such a
* case.
*
- * assert(lexeof == TRUE);
+ * assert(lexeof == true);
*/
- lexeof = FALSE;
- eof_warned = FALSE;
+
+ lexeof = false;
+ eof_warned = false;
sourcefile->srclines = sourceline; /* total no of lines in current file */
if (sourcefile->fd > INVALID_HANDLE) {
if (sourcefile->fd != fileno(stdin)) /* safety */
@@ -4923,9 +5045,12 @@ next_sourcefile()
sourcefile->lexptr_begin = NULL;
}
- sourcefile = sourcefile->next;
- if (sourcefile == srcfiles)
- return;
+ while ((sourcefile = sourcefile->next) != NULL) {
+ if (sourcefile == srcfiles)
+ return;
+ if (sourcefile->stype != SRC_EXTLIB)
+ break;
+ }
if (sourcefile->lexptr_begin != NULL) {
/* resume reading from already opened file (postponed to process '@include') */
@@ -4951,7 +5076,7 @@ get_src_buf()
{
int n;
char *scan;
- int newfile;
+ bool newfile;
int savelen;
struct stat sbuf;
@@ -4976,7 +5101,7 @@ get_src_buf()
readfunc = read_one_line;
}
- newfile = FALSE;
+ newfile = false;
if (sourcefile == srcfiles)
return NULL;
@@ -4992,13 +5117,13 @@ get_src_buf()
* gawk '' /path/name
* Sigh.
*/
- static short warned = FALSE;
+ static bool warned = false;
if (do_lint && ! warned) {
- warned = TRUE;
+ warned = true;
lintwarn(_("empty program text on command line"));
}
- lexeof = TRUE;
+ lexeof = true;
}
} else if (sourcefile->buf == NULL && *(lexptr-1) != '\n') {
/*
@@ -5026,7 +5151,7 @@ get_src_buf()
lexend = lexptr + 1;
sourcefile->buf = buf;
} else
- lexeof = TRUE;
+ lexeof = true;
return lexptr;
}
@@ -5047,7 +5172,7 @@ get_src_buf()
error(_("can't open source file `%s' for reading (%s)"),
in, strerror(errno));
errcount++;
- lexeof = TRUE;
+ lexeof = true;
return sourcefile->src;
}
@@ -5063,7 +5188,7 @@ get_src_buf()
l = A_DECENT_BUFFER_SIZE;
#undef A_DECENT_BUFFER_SIZE
sourcefile->bufsize = l;
- newfile = TRUE;
+ newfile = true;
emalloc(sourcefile->buf, char *, sourcefile->bufsize, "get_src_buf");
lexptr = lexptr_begin = lexeme = sourcefile->buf;
savelen = 0;
@@ -5114,17 +5239,17 @@ get_src_buf()
error(_("can't read sourcefile `%s' (%s)"),
source, strerror(errno));
errcount++;
- lexeof = TRUE;
+ lexeof = true;
} else {
lexend = lexptr + n;
if (n == 0) {
- static short warned = FALSE;
+ static bool warned = false;
if (do_lint && newfile && ! warned){
- warned = TRUE;
+ warned = true;
sourceline = 0;
lintwarn(_("source file `%s' is empty"), source);
}
- lexeof = TRUE;
+ lexeof = true;
}
}
return sourcefile->buf;
@@ -5300,14 +5425,14 @@ static int newline_eof()
pushback();
if (do_lint && ! eof_warned) {
lintwarn(_("source file does not end in newline"));
- eof_warned = TRUE;
+ eof_warned = true;
}
sourceline++;
return NEWLINE;
}
sourceline--;
- eof_warned = FALSE;
+ eof_warned = false;
return LEX_EOF;
}
@@ -5317,14 +5442,16 @@ static int
yylex(void)
{
int c;
- int seen_e = FALSE; /* These are for numbers */
- int seen_point = FALSE;
- int esc_seen; /* for literal strings */
+ bool seen_e = false; /* These are for numbers */
+ bool seen_point = false;
+ bool esc_seen; /* for literal strings */
int mid;
- static int did_newline = FALSE;
+ int base;
+ static bool did_newline = false;
char *tokkey;
- int inhex = FALSE;
- int intlstr = FALSE;
+ bool inhex = false;
+ bool intlstr = false;
+ AWKNUM d;
#define GET_INSTRUCTION(op) bcalloc(op, 1, sourceline)
@@ -5378,7 +5505,7 @@ yylex(void)
* The code for \ handles \[ and \].
*/
- want_regexp = FALSE;
+ want_regexp = false;
tok = tokstart;
for (;;) {
c = nextc();
@@ -5495,10 +5622,10 @@ retry:
while ((c = nextc()) == ' ' || c == '\t' || c == '\r')
continue;
if (c == '#') {
- static short warned = FALSE;
+ static bool warned = false;
if (do_lint && ! warned) {
- warned = TRUE;
+ warned = true;
lintwarn(
_("use of `\\ #...' line continuation is not portable"));
}
@@ -5571,11 +5698,11 @@ retry:
return lasttok = '*';
} else if (c == '*') {
/* make ** and **= aliases for ^ and ^= */
- static int did_warn_op = FALSE, did_warn_assgn = FALSE;
+ static bool did_warn_op = false, did_warn_assgn = false;
if (nextc() == '=') {
if (! did_warn_assgn) {
- did_warn_assgn = TRUE;
+ did_warn_assgn = true;
if (do_lint)
lintwarn(_("POSIX does not allow operator `**='"));
if (do_lint_old)
@@ -5586,7 +5713,7 @@ retry:
} else {
pushback();
if (! did_warn_op) {
- did_warn_op = TRUE;
+ did_warn_op = true;
if (do_lint)
lintwarn(_("POSIX does not allow operator `**'"));
if (do_lint_old)
@@ -5620,11 +5747,11 @@ retry:
case '^':
{
- static int did_warn_op = FALSE, did_warn_assgn = FALSE;
+ static bool did_warn_op = false, did_warn_assgn = false;
if (nextc() == '=') {
if (do_lint_old && ! did_warn_assgn) {
- did_warn_assgn = TRUE;
+ did_warn_assgn = true;
warning(_("operator `^=' is not supported in old awk"));
}
yylval = GET_INSTRUCTION(Op_assign_exp);
@@ -5632,7 +5759,7 @@ retry:
}
pushback();
if (do_lint_old && ! did_warn_op) {
- did_warn_op = TRUE;
+ did_warn_op = true;
warning(_("operator `^' is not supported in old awk"));
}
yylval = GET_INSTRUCTION(Op_exp);
@@ -5711,7 +5838,7 @@ retry:
* hacking the grammar.
*/
if (did_newline) {
- did_newline = FALSE;
+ did_newline = false;
if (--in_braces == 0)
lastline = sourceline;
return lasttok = c;
@@ -5722,7 +5849,7 @@ retry:
case '"':
string:
- esc_seen = FALSE;
+ esc_seen = false;
while ((c = nextc()) != '"') {
if (c == '\n') {
pushback();
@@ -5736,7 +5863,7 @@ retry:
sourceline++;
continue;
}
- esc_seen = TRUE;
+ esc_seen = true;
if (! want_source || c != '"')
tokadd('\\');
}
@@ -5755,12 +5882,10 @@ retry:
yylval->opcode = Op_push_i;
yylval->memory = make_str_node(tokstart,
- tok - tokstart, esc_seen ? SCAN : 0);
- yylval->memory->flags &= ~MALLOC;
- yylval->memory->flags |= PERM;
+ tok - tokstart, esc_seen ? SCAN : 0);
if (intlstr) {
yylval->memory->flags |= INTLSTR;
- intlstr = FALSE;
+ intlstr = false;
if (do_intl)
dumpintlstr(yylval->memory->stptr, yylval->memory->stlen);
}
@@ -5799,7 +5924,7 @@ retry:
case '9':
/* It's a number */
for (;;) {
- int gotnumber = FALSE;
+ bool gotnumber = false;
tokadd(c);
switch (c) {
@@ -5811,7 +5936,7 @@ retry:
int peek = nextc();
if (isxdigit(peek)) {
- inhex = TRUE;
+ inhex = true;
pushback(); /* following digit */
} else {
pushback(); /* x or X */
@@ -5822,20 +5947,20 @@ retry:
case '.':
/* period ends exponent part of floating point number */
if (seen_point || seen_e) {
- gotnumber = TRUE;
+ gotnumber = true;
break;
}
- seen_point = TRUE;
+ seen_point = true;
break;
case 'e':
case 'E':
if (inhex)
break;
if (seen_e) {
- gotnumber = TRUE;
+ gotnumber = true;
break;
}
- seen_e = TRUE;
+ seen_e = true;
if ((c = nextc()) == '-' || c == '+') {
int c2 = nextc();
@@ -5880,7 +6005,7 @@ retry:
break;
default:
done:
- gotnumber = TRUE;
+ gotnumber = true;
}
if (gotnumber)
break;
@@ -5890,19 +6015,46 @@ retry:
tokadd('\0');
yylval = GET_INSTRUCTION(Op_push_i);
- if (! do_traditional && isnondecimal(tokstart, FALSE)) {
+
+ base = 10;
+ if (! do_traditional) {
+ base = get_numbase(tokstart, false);
if (do_lint) {
- if (isdigit((unsigned char) tokstart[1])) /* not an 'x' or 'X' */
+ if (base == 8)
lintwarn("numeric constant `%.*s' treated as octal",
(int) strlen(tokstart)-1, tokstart);
- else if (tokstart[1] == 'x' || tokstart[1] == 'X')
+ else if (base == 16)
lintwarn("numeric constant `%.*s' treated as hexadecimal",
(int) strlen(tokstart)-1, tokstart);
}
- yylval->memory = mk_number(nondec2awknum(tokstart, strlen(tokstart)),
- PERM|NUMCUR|NUMBER);
- } else
- yylval->memory = mk_number(atof(tokstart), PERM|NUMCUR|NUMBER);
+ }
+
+#ifdef HAVE_MPFR
+ if (do_mpfr) {
+ NODE *r;
+
+ if (! seen_point && ! seen_e) {
+ r = mpg_integer();
+ mpg_strtoui(r->mpg_i, tokstart, strlen(tokstart), NULL, base);
+ errno = 0;
+ } else {
+ int tval;
+ r = mpg_float();
+ tval = mpfr_strtofr(r->mpg_numbr, tokstart, NULL, base, ROUND_MODE);
+ errno = 0;
+ IEEE_FMT(r->mpg_numbr, tval);
+ }
+ yylval->memory = r;
+ return lasttok = YNUMBER;
+ }
+#endif
+ if (base != 10)
+ d = nondec2awknum(tokstart, strlen(tokstart));
+ else
+ d = atof(tokstart);
+ yylval->memory = make_number(d);
+ if (d <= INT32_MAX && d >= INT32_MIN && d == (int32_t) d)
+ yylval->memory->flags |= NUMINT;
return lasttok = YNUMBER;
case '&':
@@ -5958,7 +6110,7 @@ retry:
*/
if (! do_traditional && c == '_' && lasttok != '$') {
if ((c = nextc()) == '"') {
- intlstr = TRUE;
+ intlstr = true;
goto string;
}
pushback();
@@ -5979,7 +6131,7 @@ retry:
static int warntab[sizeof(tokentab) / sizeof(tokentab[0])];
int class = tokentab[mid].class;
- if ((class == LEX_INCLUDE || class == LEX_EVAL)
+ if ((class == LEX_INCLUDE || class == LEX_LOAD || class == LEX_EVAL)
&& lasttok != '@')
goto out;
@@ -6015,7 +6167,8 @@ retry:
switch (class) {
case LEX_INCLUDE:
- want_source = TRUE;
+ case LEX_LOAD:
+ want_source = true;
break;
case LEX_EVAL:
if (in_main_context())
@@ -6039,14 +6192,36 @@ retry:
case LEX_WHILE:
case LEX_DO:
case LEX_SWITCH:
- if (! do_profiling)
+ if (! do_pretty_print)
return lasttok = class;
/* fall through */
case LEX_CASE:
yylval = bcalloc(tokentab[mid].value, 2, sourceline);
break;
+ /*
+ * These must be checked here, due to the LALR nature of the parser,
+ * the rules for continue and break may not be reduced until after
+ * a token that increments the xxx_allowed varibles is seen. Bleah.
+ */
+ case LEX_CONTINUE:
+ if (! continue_allowed) {
+ error_ln(sourceline,
+ _("`continue' is not allowed outside a loop"));
+ errcount++;
+ }
+ goto make_instruction;
+
+ case LEX_BREAK:
+ if (! break_allowed) {
+ error_ln(sourceline,
+ _("`break' is not allowed outside a loop or switch"));
+ errcount++;
+ }
+ goto make_instruction;
+
default:
+make_instruction:
yylval = GET_INSTRUCTION(tokentab[mid].value);
if (class == LEX_BUILTIN || class == LEX_LENGTH)
yylval->builtin_idx = mid;
@@ -6061,7 +6236,7 @@ out:
yylval->lextok = tokkey;
return lasttok = FUNC_CALL;
} else {
- static short goto_warned = FALSE;
+ static bool goto_warned = false;
yylval = GET_INSTRUCTION(Op_token);
yylval->lextok = tokkey;
@@ -6069,7 +6244,7 @@ out:
#define SMART_ALECK 1
if (SMART_ALECK && do_lint
&& ! goto_warned && strcasecmp(tokkey, "goto") == 0) {
- goto_warned = TRUE;
+ goto_warned = true;
lintwarn(_("`goto' considered harmful!\n"));
}
return lasttok = NAME;
@@ -6079,23 +6254,6 @@ out:
#undef NEWLINE_EOF
}
-/* mk_symbol --- allocates a symbol for the symbol table. */
-
-NODE *
-mk_symbol(NODETYPE type, NODE *value)
-{
- NODE *r;
-
- getnode(r);
- r->type = type;
- r->flags = MALLOC;
- r->lnode = value;
- r->rnode = NULL;
- r->parent_array = NULL;
- r->var_assign = (Func_ptr) 0;
- return r;
-}
-
/* snode --- instructions for builtin functions. Checks for arg. count
and supplies defaults where possible. */
@@ -6147,7 +6305,7 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
INSTRUCTION *expr;
expr = list_create(instruction(Op_push_i));
- expr->nexti->memory = mk_number((AWKNUM) 0.0, (PERM|NUMCUR|NUMBER));
+ expr->nexti->memory = make_number(0.0);
(void) mk_expression_list(subn,
list_append(expr, instruction(Op_field_spec)));
}
@@ -6164,10 +6322,10 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
yyerror(_("%s third parameter is not a changeable object"),
operator);
else
- ip->do_reference = TRUE;
+ ip->do_reference = true;
}
- r->expr_count = count_expressions(&subn, FALSE);
+ r->expr_count = count_expressions(&subn, false);
ip = subn->lasti;
(void) list_append(subn, r);
@@ -6191,17 +6349,23 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
r->sub_flags |= GENSUB;
if (nexp == 3) {
ip = instruction(Op_push_i);
- ip->memory = mk_number((AWKNUM) 0.0, (PERM|NUMCUR|NUMBER));
+ ip->memory = make_number(0.0);
(void) mk_expression_list(subn,
list_append(list_create(ip), instruction(Op_field_spec)));
}
- r->expr_count = count_expressions(&subn, FALSE);
+ r->expr_count = count_expressions(&subn, false);
return list_append(subn, r);
}
}
- r->builtin = tokentab[idx].ptr;
+#ifdef HAVE_MPFR
+ /* N.B.: There isn't any special processing for an alternate function below */
+ if (do_mpfr && tokentab[idx].ptr2)
+ r->builtin = tokentab[idx].ptr2;
+ else
+#endif
+ r->builtin = tokentab[idx].ptr;
/* special case processing for a few builtins */
@@ -6214,7 +6378,7 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
list = list_create(r);
(void) list_prepend(list, instruction(Op_field_spec));
(void) list_prepend(list, instruction(Op_push_i));
- list->nexti->memory = mk_number((AWKNUM) 0.0, (PERM|NUMCUR|NUMBER));
+ list->nexti->memory = make_number(0.0);
return list;
} else {
arg = subn->nexti;
@@ -6226,14 +6390,14 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
if (arg->nexti == arg->lasti && arg->nexti->opcode == Op_push)
arg->nexti->opcode = Op_push_arg; /* argument may be array */
} else if (r->builtin == do_match) {
- static short warned = FALSE;
+ static bool warned = false;
arg = subn->nexti->lasti->nexti; /* 2nd arg list */
(void) mk_rexp(arg);
if (nexp == 3) { /* 3rd argument there */
if (do_lint && ! warned) {
- warned = TRUE;
+ warned = true;
lintwarn(_("match: third argument is a gawk extension"));
}
if (do_traditional) {
@@ -6287,10 +6451,10 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
ip->opcode = Op_push_array;
}
} else if (r->builtin == do_close) {
- static short warned = FALSE;
+ static bool warned = false;
if (nexp == 2) {
if (do_lint && ! warned) {
- warned = TRUE;
+ warned = true;
lintwarn(_("close: second argument is a gawk extension"));
}
if (do_traditional) {
@@ -6342,10 +6506,10 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
if (ip->opcode == Op_push)
ip->opcode = Op_push_array;
}
-#endif
+#endif
if (subn != NULL) {
- r->expr_count = count_expressions(&subn, FALSE);
+ r->expr_count = count_expressions(&subn, false);
return list_append(subn, r);
}
@@ -6353,75 +6517,6 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
return list_create(r);
}
-/* append_param --- append PNAME to the list of parameters
- * for the current function.
- */
-
-static void
-append_param(char *pname)
-{
- static NODE *savetail = NULL;
- NODE *p;
-
- p = make_param(pname);
- if (func_params == NULL) {
- func_params = p;
- savetail = p;
- } else if (savetail != NULL) {
- savetail->rnode = p;
- savetail = p;
- }
-}
-
-/* dup_parms --- return TRUE if there are duplicate parameters */
-
-static int
-dup_parms(INSTRUCTION *fp, NODE *func)
-{
- NODE *np;
- const char *fname, **names;
- int count, i, j, dups;
- NODE *params;
-
- if (func == NULL) /* error earlier */
- return TRUE;
-
- fname = func->param;
- count = func->param_cnt;
- params = func->rnode;
-
- if (count == 0) /* no args, no problem */
- return FALSE;
-
- if (params == NULL) /* error earlier */
- return TRUE;
-
- emalloc(names, const char **, count * sizeof(char *), "dup_parms");
-
- i = 0;
- for (np = params; np != NULL; np = np->rnode) {
- if (np->param == NULL) { /* error earlier, give up, go home */
- efree(names);
- return TRUE;
- }
- names[i++] = np->param;
- }
-
- dups = 0;
- for (i = 1; i < count; i++) {
- for (j = 0; j < i; j++) {
- if (strcmp(names[i], names[j]) == 0) {
- dups++;
- error_ln(fp->source_line,
- _("function `%s': parameter #%d, `%s', duplicates parameter #%d"),
- fname, i + 1, names[j], j+1);
- }
- }
- }
-
- efree(names);
- return (dups > 0 ? TRUE : FALSE);
-}
/* parms_shadow --- check if parameters shadow globals */
@@ -6429,19 +6524,20 @@ static int
parms_shadow(INSTRUCTION *pc, int *shadow)
{
int pcount, i;
- int ret = FALSE;
- NODE *func;
+ bool ret = false;
+ NODE *func, *fp;
char *fname;
func = pc->func_body;
- fname = func->lnode->param;
-
+ fname = func->vname;
+ fp = func->fparms;
+
#if 0 /* can't happen, already exited if error ? */
if (fname == NULL || func == NULL) /* error earlier */
- return FALSE;
+ return false;
#endif
- pcount = func->lnode->param_cnt;
+ pcount = func->param_cnt;
if (pcount == 0) /* no args, no problem */
return 0;
@@ -6453,11 +6549,11 @@ parms_shadow(INSTRUCTION *pc, int *shadow)
* about all shadowed parameters.
*/
for (i = 0; i < pcount; i++) {
- if (lookup(func->parmlist[i]) != NULL) {
+ if (lookup(fp[i].param) != NULL) {
warning(
_("function `%s': parameter `%s' shadows global variable"),
- fname, func->parmlist[i]);
- ret = TRUE;
+ fname, fp[i].param);
+ ret = true;
}
}
@@ -6465,143 +6561,41 @@ parms_shadow(INSTRUCTION *pc, int *shadow)
return 0;
}
-
-/*
- * install_symbol:
- * Install a name in the symbol table, even if it is already there.
- * Caller must check against redefinition if that is desired.
- */
-
-
-NODE *
-install_symbol(char *name, NODE *value)
-{
- NODE *hp;
- size_t len;
- int bucket;
-
- if (install_func)
- (*install_func)(name);
-
- var_count++;
- len = strlen(name);
- bucket = hash(name, len, (unsigned long) HASHSIZE, NULL);
- getnode(hp);
- hp->type = Node_hashnode;
- hp->hnext = variables[bucket];
- variables[bucket] = hp;
- hp->hlength = len;
- hp->hvalue = value;
- hp->hname = name;
- hp->hvalue->vname = name;
- return hp->hvalue;
-}
-
-/* lookup --- find the most recent hash node for name installed by install_symbol */
-
-NODE *
-lookup(const char *name)
-{
- NODE *bucket;
- size_t len;
-
- len = strlen(name);
- for (bucket = variables[hash(name, len, (unsigned long) HASHSIZE, NULL)];
- bucket != NULL; bucket = bucket->hnext)
- if (bucket->hlength == len && strncmp(bucket->hname, name, len) == 0)
- return bucket->hvalue;
- return NULL;
-}
-
-/* sym_comp --- compare two symbol (variable or function) names */
-
-static int
-sym_comp(const void *v1, const void *v2)
-{
- const NODE *const *npp1, *const *npp2;
- const NODE *n1, *n2;
- int minlen;
-
- npp1 = (const NODE *const *) v1;
- npp2 = (const NODE *const *) v2;
- n1 = *npp1;
- n2 = *npp2;
-
- if (n1->hlength > n2->hlength)
- minlen = n1->hlength;
- else
- minlen = n2->hlength;
-
- return strncmp(n1->hname, n2->hname, minlen);
-}
-
/* valinfo --- dump var info */
void
-valinfo(NODE *n, int (*print_func)(FILE *, const char *, ...), FILE *fp)
+valinfo(NODE *n, Func_print print_func, FILE *fp)
{
if (n == Nnull_string)
print_func(fp, "uninitialized scalar\n");
else if (n->flags & STRING) {
- pp_string_fp(print_func, fp, n->stptr, n->stlen, '"', FALSE);
+ pp_string_fp(print_func, fp, n->stptr, n->stlen, '"', false);
print_func(fp, "\n");
- } else if (n->flags & NUMBER)
+ } else if (n->flags & NUMBER) {
+#ifdef HAVE_MPFR
+ if (is_mpg_float(n))
+ print_func(fp, "%s\n", mpg_fmt("%.17R*g", ROUND_MODE, n->mpg_numbr));
+ else if (is_mpg_integer(n))
+ print_func(fp, "%s\n", mpg_fmt("%Zd", n->mpg_i));
+ else
+#endif
print_func(fp, "%.17g\n", n->numbr);
- else if (n->flags & STRCUR) {
- pp_string_fp(print_func, fp, n->stptr, n->stlen, '"', FALSE);
+ } else if (n->flags & STRCUR) {
+ pp_string_fp(print_func, fp, n->stptr, n->stlen, '"', false);
print_func(fp, "\n");
- } else if (n->flags & NUMCUR)
+ } else if (n->flags & NUMCUR) {
+#ifdef HAVE_MPFR
+ if (is_mpg_float(n))
+ print_func(fp, "%s\n", mpg_fmt("%.17R*g", ROUND_MODE, n->mpg_numbr));
+ else if (is_mpg_integer(n))
+ print_func(fp, "%s\n", mpg_fmt("%Zd", n->mpg_i));
+ else
+#endif
print_func(fp, "%.17g\n", n->numbr);
- else
+ } else
print_func(fp, "?? flags %s\n", flags2str(n->flags));
}
-/* get_varlist --- list of global variables */
-
-NODE **
-get_varlist()
-{
- int i, j;
- NODE **table;
- NODE *p;
-
- emalloc(table, NODE **, (var_count + 1) * sizeof(NODE *), "get_varlist");
- update_global_values();
- for (i = j = 0; i < HASHSIZE; i++)
- for (p = variables[i]; p != NULL; p = p->hnext)
- table[j++] = p;
- assert(j == var_count);
-
- /* Shazzam! */
- qsort(table, j, sizeof(NODE *), sym_comp);
-
- table[j] = NULL;
- return table;
-}
-
-/* print_vars --- print names and values of global variables */
-
-void
-print_vars(int (*print_func)(FILE *, const char *, ...), FILE *fp)
-{
- int i;
- NODE **table;
- NODE *p;
-
- table = get_varlist();
- for (i = 0; (p = table[i]) != NULL; i++) {
- if (p->hvalue->type == Node_func)
- continue;
- print_func(fp, "%.*s: ", (int) p->hlength, p->hname);
- if (p->hvalue->type == Node_var_array)
- print_func(fp, "array, %ld elements\n", p->hvalue->table_size);
- else if (p->hvalue->type == Node_var_new)
- print_func(fp, "untyped variable\n");
- else if (p->hvalue->type == Node_var)
- valinfo(p->hvalue->var_value, print_func, fp);
- }
- efree(table);
-}
/* dump_vars --- dump the symbol table */
@@ -6609,6 +6603,7 @@ void
dump_vars(const char *fname)
{
FILE *fp;
+ NODE **vars;
if (fname == NULL)
fp = stderr;
@@ -6618,228 +6613,195 @@ dump_vars(const char *fname)
fp = stderr;
}
- print_vars(fprintf, fp);
+ vars = variable_list();
+ print_vars(vars, fprintf, fp);
+ efree(vars);
if (fp != stderr && fclose(fp) != 0)
warning(_("%s: close failed (%s)"), fname, strerror(errno));
}
-/* release_all_vars --- free all variable memory */
-
-void
-release_all_vars()
-{
- int i;
- NODE *p, *next;
-
- for (i = 0; i < HASHSIZE; i++) {
- for (p = variables[i]; p != NULL; p = next) {
- next = p->hnext;
-
- if (p->hvalue->type == Node_func)
- continue;
- else if (p->hvalue->type == Node_var_array)
- assoc_clear(p->hvalue);
- else if (p->hvalue->type != Node_var_new)
- unref(p->hvalue->var_value);
-
- efree(p->hname);
- freenode(p->hvalue);
- freenode(p);
- }
- }
-}
-
/* dump_funcs --- print all functions */
void
dump_funcs()
{
- if (func_count <= 0)
- return;
-
- (void) foreach_func((int (*)(INSTRUCTION *, void *)) pp_func, TRUE, (void *) 0);
+ NODE **funcs;
+ funcs = function_list(true);
+ (void) foreach_func(funcs, (int (*)(INSTRUCTION *, void *)) pp_func, (void *) 0);
+ efree(funcs);
}
+
/* shadow_funcs --- check all functions for parameters that shadow globals */
void
shadow_funcs()
{
static int calls = 0;
- int shadow = FALSE;
-
- if (func_count <= 0)
- return;
+ bool shadow = false;
+ NODE **funcs;
if (calls++ != 0)
fatal(_("shadow_funcs() called twice!"));
- (void) foreach_func((int (*)(INSTRUCTION *, void *)) parms_shadow, TRUE, &shadow);
+ funcs = function_list(true);
+ (void) foreach_func(funcs, (int (*)(INSTRUCTION *, void *)) parms_shadow, & shadow);
+ efree(funcs);
/* End with fatal if the user requested it. */
if (shadow && lintfunc != warning)
lintwarn(_("there were shadowed variables."));
}
-/*
- * func_install:
- * check if name is already installed; if so, it had better have Null value,
- * in which case def is added as the value. Otherwise, install name with def
- * as value.
- *
- * Extra work, build up and save a list of the parameter names in a table
- * and hang it off params->parmlist. This is used to set the `vname' field
- * of each function parameter during a function call. See eval.c.
+
+/* mk_function --- finalize function definition node; remove parameters
+ * out of the symbol table.
*/
-static int
-func_install(INSTRUCTION *func, INSTRUCTION *def)
+static INSTRUCTION *
+mk_function(INSTRUCTION *fi, INSTRUCTION *def)
{
- NODE *params;
- NODE *r, *n, *thisfunc, *hp;
- char **pnames = NULL;
- char *fname;
- int pcount = 0;
- int i;
+ NODE *thisfunc;
- params = func_params;
+ thisfunc = fi->func_body;
+ assert(thisfunc != NULL);
- /* check for function foo(foo) { ... }. bleah. */
- for (n = params->rnode; n != NULL; n = n->rnode) {
- if (strcmp(n->param, params->param) == 0) {
- error_ln(func->source_line,
- _("function `%s': can't use function name as parameter name"), params->param);
- return -1;
- } else if (is_std_var(n->param)) {
- error_ln(func->source_line,
- _("function `%s': can't use special variable `%s' as a function parameter"),
- params->param, n->param);
- return -1;
- }
- }
+ if (do_optimize > 1 && def->lasti->opcode == Op_pop) {
+ /* tail call which does not return any value. */
- thisfunc = NULL; /* turn off warnings */
+ INSTRUCTION *t;
- fname = params->param;
- /* symbol table management */
- hp = remove_symbol(params->param); /* remove function name out of symbol table */
- if (hp != NULL)
- freenode(hp);
- r = lookup(fname);
- if (r != NULL) {
- error_ln(func->source_line,
- _("function name `%s' previously defined"), fname);
- return -1;
- } else if (fname == builtin_func) /* not a valid function name */
- goto remove_params;
+ for (t = def->nexti; t->nexti != def->lasti; t = t->nexti)
+ ;
+ if (t->opcode == Op_func_call
+ && strcmp(t->func_name, thisfunc->vname) == 0)
+ (t + 1)->tail_call = true;
+ }
/* add an implicit return at end;
* also used by 'return' command in debugger
*/
-
+
(void) list_append(def, instruction(Op_push_i));
- def->lasti->memory = Nnull_string;
+ def->lasti->memory = dupnode(Nnull_string);
(void) list_append(def, instruction(Op_K_return));
- if (do_profiling)
+ if (do_pretty_print)
(void) list_prepend(def, instruction(Op_exec_count));
- /* func->opcode is Op_func */
- (func + 1)->firsti = def->nexti;
- (func + 1)->lasti = def->lasti;
- (func + 2)->first_line = func->source_line;
- (func + 2)->last_line = lastline;
-
- func->nexti = def->nexti;
+ /* fi->opcode = Op_func */
+ (fi + 1)->firsti = def->nexti;
+ (fi + 1)->lasti = def->lasti;
+ (fi + 2)->first_line = fi->source_line;
+ (fi + 2)->last_line = lastline;
+ fi->nexti = def->nexti;
bcfree(def);
- (void) list_append(rule_list, func + 1); /* debugging */
-
- /* install the function */
- thisfunc = mk_symbol(Node_func, params);
- (void) install_symbol(fname, thisfunc);
- thisfunc->code_ptr = func;
- func->func_body = thisfunc;
-
- for (n = params->rnode; n != NULL; n = n->rnode)
- pcount++;
-
- if (pcount != 0) {
- emalloc(pnames, char **, (pcount + 1) * sizeof(char *), "func_install");
- for (i = 0, n = params->rnode; i < pcount; i++, n = n->rnode)
- pnames[i] = n->param;
- pnames[pcount] = NULL;
- }
- thisfunc->parmlist = pnames;
+ (void) list_append(rule_list, fi + 1); /* debugging */
/* update lint table info */
- func_use(fname, FUNC_DEFINE);
-
- func_count++; /* used in profiler / pretty printer */
+ func_use(thisfunc->vname, FUNC_DEFINE);
-remove_params:
/* remove params from symbol table */
- pop_params(params->rnode);
- return 0;
+ remove_params(thisfunc);
+ return fi;
}
-/* remove_symbol --- remove a variable from the symbol table */
+/*
+ * install_function:
+ * install function name in the symbol table.
+ * Extra work, build up and install a list of the parameter names.
+ */
-NODE *
-remove_symbol(char *name)
+static int
+install_function(char *fname, INSTRUCTION *fi, INSTRUCTION *plist)
{
- NODE *bucket, **save;
- size_t len;
+ NODE *r, *f;
+ int pcount = 0;
- len = strlen(name);
- save = &(variables[hash(name, len, (unsigned long) HASHSIZE, NULL)]);
- for (bucket = *save; bucket != NULL; bucket = bucket->hnext) {
- if (len == bucket->hlength && strncmp(bucket->hname, name, len) == 0) {
- var_count--;
- *save = bucket->hnext;
- return bucket;
- }
- save = &(bucket->hnext);
+ r = lookup(fname);
+ if (r != NULL) {
+ error_ln(fi->source_line, _("function name `%s' previously defined"), fname);
+ return -1;
}
- return NULL;
+
+ if (plist != NULL)
+ pcount = plist->lasti->param_count + 1;
+ f = install_symbol(fname, Node_func);
+ fi->func_body = f;
+ f->param_cnt = pcount;
+ f->code_ptr = fi;
+ f->fparms = NULL;
+ if (pcount > 0) {
+ char **pnames;
+ pnames = check_params(fname, pcount, plist); /* frees plist */
+ f->fparms = make_params(pnames, pcount);
+ efree(pnames);
+ install_params(f);
+ }
+ return 0;
}
-/* pop_params --- remove list of function parameters from symbol table */
-/*
- * pop parameters out of the symbol table. do this in reverse order to
- * avoid reading freed memory if there were duplicated parameters.
+/* check_params --- build a list of function parameter names after
+ * making sure that the names are valid and there are no duplicates.
*/
-static void
-pop_params(NODE *params)
+
+static char **
+check_params(char *fname, int pcount, INSTRUCTION *list)
{
- NODE *hp;
- if (params == NULL)
- return;
- pop_params(params->rnode);
- hp = remove_symbol(params->param);
- if (hp != NULL)
- freenode(hp);
-}
+ INSTRUCTION *p, *np;
+ int i, j;
+ char *name;
+ char **pnames;
-/* make_param --- make NAME into a function parameter */
+ assert(pcount > 0);
-static NODE *
-make_param(char *name)
-{
- NODE *r;
+ emalloc(pnames, char **, pcount * sizeof(char *), "check_params");
- getnode(r);
- r->type = Node_param_list;
- r->rnode = NULL;
- r->param_cnt = param_counter++;
- return (install_symbol(name, r));
+ for (i = 0, p = list->nexti; p != NULL; i++, p = np) {
+ np = p->nexti;
+ name = p->lextok;
+ p->lextok = NULL;
+
+ if (strcmp(name, fname) == 0) {
+ /* check for function foo(foo) { ... }. bleah. */
+ error_ln(p->source_line,
+ _("function `%s': can't use function name as parameter name"), fname);
+ } else if (is_std_var(name)) {
+ error_ln(p->source_line,
+ _("function `%s': can't use special variable `%s' as a function parameter"),
+ fname, name);
+ }
+
+ /* check for duplicate parameters */
+ for (j = 0; j < i; j++) {
+ if (strcmp(name, pnames[j]) == 0) {
+ error_ln(p->source_line,
+ _("function `%s': parameter #%d, `%s', duplicates parameter #%d"),
+ fname, i + 1, name, j + 1);
+ }
+ }
+
+ pnames[i] = name;
+ bcfree(p);
+ }
+ bcfree(list);
+
+ return pnames;
}
+
+#ifdef HASHSIZE
+undef HASHSIZE
+#endif
+#define HASHSIZE 1021
+
static struct fdesc {
char *name;
short used;
short defined;
+ short extension;
struct fdesc *next;
} *ftable[HASHSIZE];
@@ -6859,7 +6821,10 @@ func_use(const char *name, enum defref how)
if (strcmp(fp->name, name) == 0) {
if (how == FUNC_DEFINE)
fp->defined++;
- else
+ else if (how == FUNC_EXT) {
+ fp->defined++;
+ fp->extension++;
+ } else
fp->used++;
return;
}
@@ -6873,12 +6838,23 @@ func_use(const char *name, enum defref how)
strcpy(fp->name, name);
if (how == FUNC_DEFINE)
fp->defined++;
- else
+ else if (how == FUNC_EXT) {
+ fp->defined++;
+ fp->extension++;
+ } else
fp->used++;
fp->next = ftable[ind];
ftable[ind] = fp;
}
+/* track_ext_func --- add an extension function to the table */
+
+void
+track_ext_func(const char *name)
+{
+ func_use(name, FUNC_EXT);
+}
+
/* check_funcs --- verify functions that are called but not defined */
static void
@@ -6892,19 +6868,19 @@ check_funcs()
for (i = 0; i < HASHSIZE; i++) {
for (fp = ftable[i]; fp != NULL; fp = fp->next) {
+ if (fp->defined == 0 && ! fp->extension) {
#ifdef REALLYMEAN
- /* making this the default breaks old code. sigh. */
- if (fp->defined == 0) {
+ /* making this the default breaks old code. sigh. */
error(
_("function `%s' called but never defined"), fp->name);
errcount++;
- }
#else
- if (do_lint && fp->defined == 0)
lintwarn(
_("function `%s' called but never defined"), fp->name);
#endif
- if (do_lint && fp->used == 0) {
+ }
+
+ if (do_lint && fp->used == 0 && ! fp->extension) {
lintwarn(_("function `%s' defined but never called directly"),
fp->name);
}
@@ -6943,69 +6919,6 @@ param_sanity(INSTRUCTION *arglist)
}
}
-/* foreach_func --- execute given function for each awk function in symbol table. */
-
-int
-foreach_func(int (*pfunc)(INSTRUCTION *, void *), int sort, void *data)
-{
- int i, j;
- NODE *p;
- int ret = 0;
-
- if (sort) {
- NODE **tab;
-
- /*
- * Walk through symbol table counting functions.
- * Could be more than func_count if there are
- * extension functions.
- */
- for (i = j = 0; i < HASHSIZE; i++) {
- for (p = variables[i]; p != NULL; p = p->hnext) {
- if (p->hvalue->type == Node_func) {
- j++;
- }
- }
- }
-
- if (j == 0)
- return 0;
-
- emalloc(tab, NODE **, j * sizeof(NODE *), "foreach_func");
-
- /* now walk again, copying info */
- for (i = j = 0; i < HASHSIZE; i++) {
- for (p = variables[i]; p != NULL; p = p->hnext) {
- if (p->hvalue->type == Node_func) {
- tab[j] = p;
- j++;
- }
- }
- }
-
- /* Shazzam! */
- qsort(tab, j, sizeof(NODE *), sym_comp);
-
- for (i = 0; i < j; i++) {
- if ((ret = pfunc(tab[i]->hvalue->code_ptr, data)) != 0)
- break;
- }
-
- efree(tab);
- return ret;
- }
-
- /* unsorted */
- for (i = 0; i < HASHSIZE; i++) {
- for (p = variables[i]; p != NULL; p = p->hnext) {
- if (p->hvalue->type == Node_func
- && (ret = pfunc(p->hvalue->code_ptr, data)) != 0)
- return ret;
- }
- }
- return 0;
-}
-
/* deferred variables --- those that are only defined if needed. */
/*
@@ -7040,31 +6953,26 @@ register_deferred_variable(const char *name, NODE *(*load_func)(void))
/* variable --- make sure NAME is in the symbol table */
NODE *
-variable(char *name, NODETYPE type)
+variable(int location, char *name, NODETYPE type)
{
NODE *r;
if ((r = lookup(name)) != NULL) {
- if (r->type == Node_func) {
- error(_("function `%s' called with space between name and `(',\nor used as a variable or an array"),
+ if (r->type == Node_func || r->type == Node_ext_func )
+ error_ln(location, _("function `%s' called with space between name and `(',\nor used as a variable or an array"),
r->vname);
- errcount++;
- r->type = Node_var_new; /* continue parsing instead of exiting */
- }
+ if (r == symbol_table)
+ symtab_used = true;
} else {
/* not found */
struct deferred_variable *dv;
- for (dv = deferred_variables; TRUE; dv = dv->next) {
+ for (dv = deferred_variables; true; dv = dv->next) {
if (dv == NULL) {
- /*
- * This is the only case in which we may not free the string.
- */
- if (type == Node_var)
- r = mk_symbol(type, Nnull_string);
- else
- r = mk_symbol(type, (NODE *) NULL);
- return install_symbol(name, r);
+ /*
+ * This is the only case in which we may not free the string.
+ */
+ return install_symbol(name, type);
}
if (strcmp(name, dv->name) == 0) {
r = (*dv->load_func)();
@@ -7076,6 +6984,21 @@ variable(char *name, NODETYPE type)
return r;
}
+/* process_deferred --- if the program uses SYMTAB, load deferred variables */
+
+static void
+process_deferred()
+{
+ struct deferred_variable *dv;
+
+ if (! symtab_used)
+ return;
+
+ for (dv = deferred_variables; dv != NULL; dv = dv->next) {
+ (void) dv->load_func();
+ }
+}
+
/* make_regnode --- make a regular expression node */
static NODE *
@@ -7089,7 +7012,7 @@ make_regnode(int type, NODE *exp)
n->re_cnt = 1;
if (type == Node_regex) {
- n->re_reg = make_regexp(exp->stptr, exp->stlen, FALSE, TRUE, FALSE);
+ n->re_reg = make_regexp(exp->stptr, exp->stlen, false, true, false);
if (n->re_reg == NULL) {
freenode(n);
return NULL;
@@ -7156,12 +7079,12 @@ isnoeffect(OPCODE type)
case Op_match_rec:
case Op_not:
case Op_in_array:
- return TRUE;
+ return true;
default:
break; /* keeps gcc -Wall happy */
}
- return FALSE;
+ return false;
}
/* make_assignable --- make this operand an assignable one if posiible */
@@ -7171,9 +7094,6 @@ make_assignable(INSTRUCTION *ip)
{
switch (ip->opcode) {
case Op_push:
- if (ip->memory->type == Node_param_list
- && (ip->memory->flags & FUNC) != 0)
- return NULL;
ip->opcode = Op_push_lhs;
return ip;
case Op_field_spec:
@@ -7193,7 +7113,7 @@ make_assignable(INSTRUCTION *ip)
NODE *
stopme(int nargs ATTRIBUTE_UNUSED)
{
- return (NODE *) 0;
+ return make_number(0.0);
}
/* dumpintlstr --- write out an initial .po file entry for the string */
@@ -7213,7 +7133,7 @@ dumpintlstr(const char *str, size_t len)
}
printf("msgid ");
- pp_string_fp(fprintf, stdout, str, len, '"', TRUE);
+ pp_string_fp(fprintf, stdout, str, len, '"', true);
putchar('\n');
printf("msgstr \"\"\n\n");
fflush(stdout);
@@ -7236,36 +7156,15 @@ dumpintlstr2(const char *str1, size_t len1, const char *str2, size_t len2)
}
printf("msgid ");
- pp_string_fp(fprintf, stdout, str1, len1, '"', TRUE);
+ pp_string_fp(fprintf, stdout, str1, len1, '"', true);
putchar('\n');
printf("msgid_plural ");
- pp_string_fp(fprintf, stdout, str2, len2, '"', TRUE);
+ pp_string_fp(fprintf, stdout, str2, len2, '"', true);
putchar('\n');
printf("msgstr[0] \"\"\nmsgstr[1] \"\"\n\n");
fflush(stdout);
}
-/* isarray --- can this type be subscripted? */
-
-static int
-isarray(NODE *n)
-{
- switch (n->type) {
- case Node_var_new:
- case Node_var_array:
- return TRUE;
- case Node_param_list:
- return (n->flags & FUNC) == 0;
- case Node_array_ref:
- cant_happen();
- break;
- default:
- break; /* keeps gcc -Wall happy */
- }
-
- return FALSE;
-}
-
/* mk_binary --- instructions for binary operators */
static INSTRUCTION *
@@ -7280,11 +7179,11 @@ mk_binary(INSTRUCTION *s1, INSTRUCTION *s2, INSTRUCTION *op)
ip1 = s1->nexti;
if (do_optimize > 1
&& ip1 == s1->lasti && ip1->opcode == Op_push_i
- && (ip1->memory->flags & (STRCUR|STRING)) == 0
- && (ip2->memory->flags & (STRCUR|STRING)) == 0
+ && (ip1->memory->flags & (MPFN|MPZN|STRCUR|STRING)) == 0
+ && (ip2->memory->flags & (MPFN|MPZN|STRCUR|STRING)) == 0
) {
NODE *n1 = ip1->memory, *n2 = ip2->memory;
- res = force_number(n1);
+ res = force_number(n1)->numbr;
(void) force_number(n2);
switch (op->opcode) {
case Op_times:
@@ -7326,11 +7225,7 @@ mk_binary(INSTRUCTION *s1, INSTRUCTION *s2, INSTRUCTION *op)
}
op->opcode = Op_push_i;
- op->memory = mk_number(res, (PERM|NUMCUR|NUMBER));
- n1->flags &= ~PERM;
- n1->flags |= MALLOC;
- n2->flags &= ~PERM;
- n2->flags |= MALLOC;
+ op->memory = make_number(res);
unref(n1);
unref(n2);
bcfree(ip1);
@@ -7456,7 +7351,7 @@ mk_condition(INSTRUCTION *cond, INSTRUCTION *ifp, INSTRUCTION *true_branch,
if (false_branch == NULL) {
false_branch = list_create(instruction(Op_no_op));
if (elsep != NULL) { /* else { } */
- if (do_profiling)
+ if (do_pretty_print)
(void) list_prepend(false_branch, elsep);
else
bcfree(elsep);
@@ -7467,7 +7362,7 @@ mk_condition(INSTRUCTION *cond, INSTRUCTION *ifp, INSTRUCTION *true_branch,
/* avoid a series of no_op's: if .. else if .. else if .. */
if (false_branch->lasti->opcode != Op_no_op)
(void) list_append(false_branch, instruction(Op_no_op));
- if (do_profiling) {
+ if (do_pretty_print) {
(void) list_prepend(false_branch, elsep);
false_branch->nexti->branch_end = false_branch->lasti;
(void) list_prepend(false_branch, instruction(Op_exec_count));
@@ -7482,7 +7377,7 @@ mk_condition(INSTRUCTION *cond, INSTRUCTION *ifp, INSTRUCTION *true_branch,
ip = list_append(cond, instruction(Op_jmp_false));
ip->lasti->target_jmp = false_branch->nexti->nexti;
- if (do_profiling) {
+ if (do_pretty_print) {
(void) list_prepend(ip, ifp);
(void) list_append(ip, instruction(Op_exec_count));
ip->nexti->branch_if = ip->lasti;
@@ -7544,7 +7439,7 @@ append_rule(INSTRUCTION *pattern, INSTRUCTION *action)
if (rule != Rule) {
rp = pattern;
- if (do_profiling)
+ if (do_pretty_print)
(void) list_append(action, instruction(Op_no_op));
(rp + 1)->firsti = action->nexti;
(rp + 1)->lasti = action->lasti;
@@ -7560,7 +7455,7 @@ append_rule(INSTRUCTION *pattern, INSTRUCTION *action)
if (pattern == NULL) {
/* assert(action != NULL); */
- if (do_profiling)
+ if (do_pretty_print)
(void) list_prepend(action, instruction(Op_exec_count));
(rp + 1)->firsti = action->nexti;
(rp + 1)->lasti = tp;
@@ -7576,12 +7471,12 @@ append_rule(INSTRUCTION *pattern, INSTRUCTION *action)
if (action == NULL) {
(rp + 2)->last_line = find_line(pattern, LAST_LINE);
action = list_create(instruction(Op_K_print_rec));
- if (do_profiling)
+ if (do_pretty_print)
(void) list_prepend(action, instruction(Op_exec_count));
} else
(rp + 2)->last_line = lastline;
- if (do_profiling) {
+ if (do_pretty_print) {
(void) list_prepend(pattern, instruction(Op_exec_count));
(void) list_prepend(action, instruction(Op_exec_count));
}
@@ -7642,7 +7537,7 @@ mk_assignment(INSTRUCTION *lhs, INSTRUCTION *rhs, INSTRUCTION *op)
&& tp->memory->type == Node_var
&& tp->memory->var_assign
) {
- tp->do_reference = FALSE; /* no uninitialized reference checking
+ tp->do_reference = false; /* no uninitialized reference checking
* for a special variable.
*/
(void) list_append(ip, instruction(Op_var_assign));
@@ -7661,9 +7556,7 @@ mk_assignment(INSTRUCTION *lhs, INSTRUCTION *rhs, INSTRUCTION *op)
static INSTRUCTION *
optimize_assignment(INSTRUCTION *exp)
{
- INSTRUCTION *i1;
- INSTRUCTION *i2;
- INSTRUCTION *i3;
+ INSTRUCTION *i1, *i2, *i3;
/*
* Optimize assignment statements array[subs] = x; var = x; $n = x;
@@ -7699,7 +7592,7 @@ optimize_assignment(INSTRUCTION *exp)
if ( ! do_optimize
|| ( i1->opcode != Op_assign
&& i1->opcode != Op_field_assign)
- )
+ )
return list_append(exp, instruction(Op_pop));
for (i2 = exp->nexti; i2 != i1; i2 = i2->nexti) {
@@ -7784,13 +7677,26 @@ optimize_assignment(INSTRUCTION *exp)
case Op_push_lhs:
if (i2->nexti == i1
- && i1->opcode == Op_assign
+ && i1->opcode == Op_assign
) {
/* var = .. */
i2->opcode = Op_store_var;
i2->nexti = NULL;
bcfree(i1); /* Op_assign */
exp->lasti = i2; /* update Op_list */
+
+ i3 = exp->nexti;
+ if (i3->opcode == Op_push_i
+ && (i3->memory->flags & INTLSTR) == 0
+ && i3->nexti == i2
+ ) {
+ /* constant initializer */
+ i2->initval = i3->memory;
+ bcfree(i3);
+ exp->nexti = i2;
+ } else
+ i2->initval = NULL;
+
return exp;
}
break;
@@ -7860,7 +7766,7 @@ mk_getline(INSTRUCTION *op, INSTRUCTION *var, INSTRUCTION *redir, int redirtype)
else
ip = list_create(op);
op->into_var = (var != NULL);
- op->redir_type = (redir != NULL) ? redirtype : 0;
+ op->redir_type = (redir != NULL) ? redirtype : redirect_none;
return (asgn == NULL ? ip : list_append(ip, asgn));
}
@@ -7911,7 +7817,7 @@ mk_for_loop(INSTRUCTION *forp, INSTRUCTION *init, INSTRUCTION *cond,
if (init != NULL)
ip = list_merge(init, ip);
- if (do_profiling) {
+ if (do_pretty_print) {
(void) list_append(ip, instruction(Op_exec_count));
(forp + 1)->forloop_cond = pp_cond;
(forp + 1)->forloop_body = ip->lasti;
@@ -7933,7 +7839,7 @@ mk_for_loop(INSTRUCTION *forp, INSTRUCTION *init, INSTRUCTION *cond,
ret = list_append(ip, tbreak);
fix_break_continue(ret, tbreak, tcont);
- if (do_profiling) {
+ if (do_pretty_print) {
forp->target_break = tbreak;
forp->target_continue = tcont;
ret = list_prepend(ret, forp);
@@ -8034,7 +7940,7 @@ mk_expression_list(INSTRUCTION *list, INSTRUCTION *s1)
*/
static int
-count_expressions(INSTRUCTION **list, int isarg)
+count_expressions(INSTRUCTION **list, bool isarg)
{
INSTRUCTION *expr;
INSTRUCTION *r = NULL;
@@ -8092,320 +7998,6 @@ fix_break_continue(INSTRUCTION *list, INSTRUCTION *b_target, INSTRUCTION *c_targ
}
}
-
-/* append_symbol --- append symbol to the list of symbols
- * installed in the symbol table.
- */
-
-void
-append_symbol(char *name)
-{
- NODE *hp;
-
- /* N.B.: func_install removes func name and reinstalls it;
- * and we get two entries for it here!. destroy_symbol()
- * will find and destroy the Node_func which is what we want.
- */
-
- getnode(hp);
- hp->hname = name; /* shallow copy */
- hp->hnext = symbol_list->hnext;
- symbol_list->hnext = hp;
-}
-
-/* release_symbol --- free symbol list and optionally remove symbol from symbol table */
-
-void
-release_symbols(NODE *symlist, int keep_globals)
-{
- NODE *hp, *n;
-
- for (hp = symlist->hnext; hp != NULL; hp = n) {
- if (! keep_globals) {
- /* destroys globals, function, and params
- * if still in symbol table and not removed by func_install
- * due to syntax error.
- */
- destroy_symbol(hp->hname);
- }
- n = hp->hnext;
- freenode(hp);
- }
- symlist->hnext = NULL;
-}
-
-/* destroy_symbol --- remove a symbol from symbol table
-* and free all associated memory.
-*/
-
-void
-destroy_symbol(char *name)
-{
- NODE *symbol, *hp;
-
- symbol = lookup(name);
- if (symbol == NULL)
- return;
-
- if (symbol->type == Node_func) {
- char **varnames;
- NODE *func, *n;
-
- func = symbol;
- varnames = func->parmlist;
- if (varnames != NULL)
- efree(varnames);
-
- /* function parameters of type Node_param_list */
- for (n = func->lnode->rnode; n != NULL; ) {
- NODE *np;
- np = n->rnode;
- efree(n->param);
- freenode(n);
- n = np;
- }
- freenode(func->lnode);
- func_count--;
-
- } else if (symbol->type == Node_var_array)
- assoc_clear(symbol);
- else if (symbol->type == Node_var)
- unref(symbol->var_value);
-
- /* remove from symbol table */
- hp = remove_symbol(name);
- efree(hp->hname);
- freenode(hp->hvalue);
- freenode(hp);
-}
-
-#define pool_size d.dl
-#define freei x.xi
-static INSTRUCTION *pool_list;
-static AWK_CONTEXT *curr_ctxt = NULL;
-
-/* new_context --- create a new execution context. */
-
-AWK_CONTEXT *
-new_context()
-{
- AWK_CONTEXT *ctxt;
-
- emalloc(ctxt, AWK_CONTEXT *, sizeof(AWK_CONTEXT), "new_context");
- memset(ctxt, 0, sizeof(AWK_CONTEXT));
- ctxt->srcfiles.next = ctxt->srcfiles.prev = &ctxt->srcfiles;
- ctxt->rule_list.opcode = Op_list;
- ctxt->rule_list.lasti = &ctxt->rule_list;
- return ctxt;
-}
-
-/* set_context --- change current execution context. */
-
-static void
-set_context(AWK_CONTEXT *ctxt)
-{
- pool_list = &ctxt->pools;
- symbol_list = &ctxt->symbols;
- srcfiles = &ctxt->srcfiles;
- rule_list = &ctxt->rule_list;
- install_func = ctxt->install_func;
- curr_ctxt = ctxt;
-}
-
-/*
- * push_context:
- *
- * Switch to the given context after saving the current one. The set
- * of active execution contexts forms a stack; the global or main context
- * is at the bottom of the stack.
- */
-
-void
-push_context(AWK_CONTEXT *ctxt)
-{
- ctxt->prev = curr_ctxt;
- /* save current source and sourceline */
- if (curr_ctxt != NULL) {
- curr_ctxt->sourceline = sourceline;
- curr_ctxt->source = source;
- }
- sourceline = 0;
- source = NULL;
- set_context(ctxt);
-}
-
-/* pop_context --- switch to previous execution context. */
-
-void
-pop_context()
-{
- AWK_CONTEXT *ctxt;
-
- assert(curr_ctxt != NULL);
- ctxt = curr_ctxt->prev;
- /* restore source and sourceline */
- sourceline = ctxt->sourceline;
- source = ctxt->source;
- set_context(ctxt);
-}
-
-/* in_main_context --- are we in the main context ? */
-
-int
-in_main_context()
-{
- assert(curr_ctxt != NULL);
- return (curr_ctxt->prev == NULL);
-}
-
-/* free_context --- free context structure and related data. */
-
-void
-free_context(AWK_CONTEXT *ctxt, int keep_globals)
-{
- SRCFILE *s, *sn;
-
- if (ctxt == NULL)
- return;
-
- assert(curr_ctxt != ctxt);
-
- /* free all code including function codes */
- free_bcpool(&ctxt->pools);
- /* free symbols */
- release_symbols(&ctxt->symbols, keep_globals);
- /* free srcfiles */
- for (s = &ctxt->srcfiles; s != &ctxt->srcfiles; s = sn) {
- sn = s->next;
- if (s->stype != SRC_CMDLINE && s->stype != SRC_STDIN)
- efree(s->fullpath);
- efree(s->src);
- efree(s);
- }
- efree(ctxt);
-}
-
-/* free_bc_internal --- free internal memory of an instruction. */
-
-static void
-free_bc_internal(INSTRUCTION *cp)
-{
- NODE *m;
-
- switch(cp->opcode) {
- case Op_func_call:
- if (cp->func_name != NULL
- && cp->func_name != builtin_func
- )
- efree(cp->func_name);
- break;
- case Op_push_re:
- case Op_match_rec:
- case Op_match:
- case Op_nomatch:
- m = cp->memory;
- if (m->re_reg != NULL)
- refree(m->re_reg);
- if (m->re_exp != NULL)
- unref(m->re_exp);
- if (m->re_text != NULL)
- unref(m->re_text);
- freenode(m);
- break;
- case Op_token: /* token lost during error recovery in yyparse */
- if (cp->lextok != NULL)
- efree(cp->lextok);
- break;
- case Op_illegal:
- cant_happen();
- default:
- break;
- }
-}
-
-
-/* INSTR_CHUNK must be > largest code size (3) */
-#define INSTR_CHUNK 127
-
-/* bcfree --- deallocate instruction */
-
-void
-bcfree(INSTRUCTION *cp)
-{
- cp->opcode = 0;
- cp->nexti = pool_list->freei;
- pool_list->freei = cp;
-}
-
-/* bcalloc --- allocate a new instruction */
-
-INSTRUCTION *
-bcalloc(OPCODE op, int size, int srcline)
-{
- INSTRUCTION *cp;
-
- if (size > 1) {
- /* wide instructions Op_rule, Op_func_call .. */
- emalloc(cp, INSTRUCTION *, (size + 1) * sizeof(INSTRUCTION), "bcalloc");
- cp->pool_size = size;
- cp->nexti = pool_list->nexti;
- pool_list->nexti = cp++;
- } else {
- INSTRUCTION *pool;
-
- pool = pool_list->freei;
- if (pool == NULL) {
- INSTRUCTION *last;
- emalloc(cp, INSTRUCTION *, (INSTR_CHUNK + 1) * sizeof(INSTRUCTION), "bcalloc");
-
- cp->pool_size = INSTR_CHUNK;
- cp->nexti = pool_list->nexti;
- pool_list->nexti = cp;
- pool = ++cp;
- last = &pool[INSTR_CHUNK - 1];
- for (; cp <= last; cp++) {
- cp->opcode = 0;
- cp->nexti = cp + 1;
- }
- --cp;
- cp->nexti = NULL;
- }
- cp = pool;
- pool_list->freei = cp->nexti;
- }
-
- memset(cp, 0, size * sizeof(INSTRUCTION));
- cp->opcode = op;
- cp->source_line = srcline;
- return cp;
-}
-
-/* free_bcpool --- free list of instruction memory pools */
-
-static void
-free_bcpool(INSTRUCTION *pl)
-{
- INSTRUCTION *pool, *tmp;
-
- for (pool = pl->nexti; pool != NULL; pool = tmp) {
- INSTRUCTION *cp, *last;
- long psiz;
- psiz = pool->pool_size;
- if (psiz == INSTR_CHUNK)
- last = pool + psiz;
- else
- last = pool + 1;
- for (cp = pool + 1; cp <= last ; cp++) {
- if (cp->opcode != 0)
- free_bc_internal(cp);
- }
- tmp = pool->nexti;
- efree(pool);
- }
- memset(pl, 0, sizeof(INSTRUCTION));
-}
-
-
static inline INSTRUCTION *
list_create(INSTRUCTION *x)
{
@@ -8464,13 +8056,13 @@ check_special(const char *name)
int low, high, mid;
int i;
#if 'a' == 0x81 /* it's EBCDIC */
- static int did_sort = FALSE;
+ static bool did_sort = false;
if (! did_sort) {
qsort((void *) tokentab,
sizeof(tokentab) / sizeof(tokentab[0]),
sizeof(tokentab[0]), tokcompare);
- did_sort = TRUE;
+ did_sort = true;
}
#endif
@@ -8542,3 +8134,4 @@ one_line_close(int fd)
return ret;
}
+
diff --git a/awkgram.y b/awkgram.y
index a3ee2787..e7d44b83 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -42,20 +42,17 @@ static char *get_src_buf(void);
static int yylex(void);
int yyparse(void);
static INSTRUCTION *snode(INSTRUCTION *subn, INSTRUCTION *op);
-static int func_install(INSTRUCTION *fp, INSTRUCTION *def);
-static void pop_params(NODE *params);
-static NODE *make_param(char *pname);
+static char **check_params(char *fname, int pcount, INSTRUCTION *list);
+static int install_function(char *fname, INSTRUCTION *fi, INSTRUCTION *plist);
static NODE *mk_rexp(INSTRUCTION *exp);
-static void append_param(char *pname);
-static int dup_parms(INSTRUCTION *fp, NODE *func);
static void param_sanity(INSTRUCTION *arglist);
static int parms_shadow(INSTRUCTION *pc, int *shadow);
static int isnoeffect(OPCODE type);
static INSTRUCTION *make_assignable(INSTRUCTION *ip);
static void dumpintlstr(const char *str, size_t len);
static void dumpintlstr2(const char *str1, size_t len1, const char *str2, size_t len2);
-static int isarray(NODE *n);
static int include_source(INSTRUCTION *file);
+static int load_library(INSTRUCTION *file);
static void next_sourcefile(void);
static char *tokexpand(void);
@@ -63,6 +60,7 @@ static char *tokexpand(void);
static INSTRUCTION *mk_program(void);
static INSTRUCTION *append_rule(INSTRUCTION *pattern, INSTRUCTION *action);
+static INSTRUCTION *mk_function(INSTRUCTION *fi, INSTRUCTION *def);
static INSTRUCTION *mk_condition(INSTRUCTION *cond, INSTRUCTION *ifp, INSTRUCTION *true_branch,
INSTRUCTION *elsep, INSTRUCTION *false_branch);
static INSTRUCTION *mk_expression_list(INSTRUCTION *list, INSTRUCTION *s1);
@@ -74,23 +72,23 @@ static INSTRUCTION *mk_boolean(INSTRUCTION *left, INSTRUCTION *right, INSTRUCTIO
static INSTRUCTION *mk_assignment(INSTRUCTION *lhs, INSTRUCTION *rhs, INSTRUCTION *op);
static INSTRUCTION *mk_getline(INSTRUCTION *op, INSTRUCTION *opt_var, INSTRUCTION *redir, int redirtype);
static NODE *make_regnode(int type, NODE *exp);
-static int count_expressions(INSTRUCTION **list, int isarg);
+static int count_expressions(INSTRUCTION **list, bool isarg);
static INSTRUCTION *optimize_assignment(INSTRUCTION *exp);
static void add_lint(INSTRUCTION *list, LINTTYPE linttype);
-enum defref { FUNC_DEFINE, FUNC_USE };
+static void process_deferred();
+
+enum defref { FUNC_DEFINE, FUNC_USE, FUNC_EXT };
static void func_use(const char *name, enum defref how);
static void check_funcs(void);
-static void free_bcpool(INSTRUCTION *pl);
static ssize_t read_one_line(int fd, void *buffer, size_t count);
static int one_line_close(int fd);
-static void (*install_func)(char *) = NULL;
-
-static int want_source = FALSE;
-static int want_regexp; /* lexical scanning kludge */
-static int can_return; /* parsing kludge */
+static bool want_source = false;
+static bool want_regexp = false; /* lexical scanning kludge */
+static char *in_function; /* parsing kludge */
+static bool symtab_used = false; /* program used SYMTAB */
static int rule = 0;
const char *const ruletab[] = {
@@ -102,50 +100,39 @@ const char *const ruletab[] = {
"ENDFILE",
};
-static int in_print = FALSE; /* lexical scanning kludge for print */
+static bool in_print = false; /* lexical scanning kludge for print */
static int in_parens = 0; /* lexical scanning kludge for print */
static int sub_counter = 0; /* array dimension counter for use in delete */
static char *lexptr = NULL; /* pointer to next char during parsing */
static char *lexend;
static char *lexptr_begin; /* keep track of where we were for error msgs */
static char *lexeme; /* beginning of lexeme for debugging */
-static int lexeof; /* seen EOF for current source? */
+static bool lexeof; /* seen EOF for current source? */
static char *thisline = NULL;
static int in_braces = 0; /* count braces for firstline, lastline in an 'action' */
static int lastline = 0;
static int firstline = 0;
static SRCFILE *sourcefile = NULL; /* current program source */
static int lasttok = 0;
-static int eof_warned = FALSE; /* GLOBAL: want warning for each file */
+static bool eof_warned = false; /* GLOBAL: want warning for each file */
static int break_allowed; /* kludge for break */
static int continue_allowed; /* kludge for continue */
-
#define END_FILE -1000
#define END_SRC -2000
#define YYDEBUG_LEXER_TEXT (lexeme)
-static int param_counter;
-static NODE *func_params; /* list of parameters for the current function */
static char *tokstart = NULL;
static char *tok = NULL;
static char *tokend;
static int errcount = 0;
-static NODE *symbol_list;
-extern void destroy_symbol(char *name);
-
-static long func_count; /* total number of functions */
-
-#define HASHSIZE 1021 /* this constant only used here */
-NODE *variables[HASHSIZE];
-static int var_count; /* total number of global variables */
-
extern char *source;
extern int sourceline;
extern SRCFILE *srcfiles;
extern INSTRUCTION *rule_list;
extern int max_args;
+extern NODE **args_array;
static INSTRUCTION *rule_block[sizeof(ruletab)];
@@ -162,16 +149,6 @@ static inline INSTRUCTION *list_prepend(INSTRUCTION *l, INSTRUCTION *x);
static inline INSTRUCTION *list_merge(INSTRUCTION *l1, INSTRUCTION *l2);
extern double fmod(double x, double y);
-/*
- * This string cannot occur as a real awk identifier.
- * Use it as a special token to make function parsing
- * uniform, but if it's seen, don't install the function.
- * e.g.
- * function split(x) { return x }
- * function x(a) { return a }
- * should only produce one error message, and not core dump.
- */
-static char builtin_func[] = "@builtin";
#define YYSTYPE INSTRUCTION *
%}
@@ -190,7 +167,7 @@ static char builtin_func[] = "@builtin";
%token LEX_AND LEX_OR INCREMENT DECREMENT
%token LEX_BUILTIN LEX_LENGTH
%token LEX_EOF
-%token LEX_INCLUDE LEX_EVAL
+%token LEX_INCLUDE LEX_EVAL LEX_LOAD
%token NEWLINE
/* Lowest to highest */
@@ -226,6 +203,8 @@ program
| program LEX_EOF
{
next_sourcefile();
+ if (sourcefile == srcfiles)
+ process_deferred();
}
| program error
{
@@ -256,15 +235,18 @@ rule
}
| function_prologue action
{
- can_return = FALSE;
- if ($1 && func_install($1, $2) < 0)
- YYABORT;
- func_params = NULL;
+ in_function = NULL;
+ (void) mk_function($1, $2);
yyerrok;
}
| '@' LEX_INCLUDE source statement_term
{
- want_source = FALSE;
+ want_source = false;
+ yyerrok;
+ }
+ | '@' LEX_LOAD library statement_term
+ {
+ want_source = false;
yyerrok;
}
;
@@ -284,6 +266,21 @@ source
{ $$ = NULL; }
;
+library
+ : FILENAME
+ {
+ if (load_library($1) < 0)
+ YYABORT;
+ efree($1->lextok);
+ bcfree($1);
+ $$ = NULL;
+ }
+ | FILENAME error
+ { $$ = NULL; }
+ | error
+ { $$ = NULL; }
+ ;
+
pattern
: /* empty */
{ $$ = NULL; rule = Rule; }
@@ -297,8 +294,8 @@ pattern
add_lint($4, LINT_assign_in_cond);
tp = instruction(Op_no_op);
- list_prepend($1, bcalloc(Op_line_range, !!do_profiling + 1, 0));
- $1->nexti->triggered = FALSE;
+ list_prepend($1, bcalloc(Op_line_range, !!do_pretty_print + 1, 0));
+ $1->nexti->triggered = false;
$1->nexti->target_jmp = $4->nexti;
list_append($1, instruction(Op_cond_pair));
@@ -308,7 +305,7 @@ pattern
list_append($4, instruction(Op_cond_pair));
$4->lasti->line_range = $1->nexti;
$4->lasti->target_jmp = tp;
- if (do_profiling) {
+ if (do_pretty_print) {
($1->nexti + 1)->condpair_left = $1->lasti;
($1->nexti + 1)->condpair_right = $4->lasti;
}
@@ -369,13 +366,8 @@ func_name
| lex_builtin
{
yyerror(_("`%s' is a built-in function, it cannot be redefined"),
- tokstart);
- $1->opcode = Op_symbol; /* Op_symbol instead of Op_token so that
- * free_bc_internal does not try to free it
- */
- $1->lextok = builtin_func;
- $$ = $1;
- /* yyerrok; */
+ tokstart);
+ YYABORT;
}
| '@' LEX_EVAL
{ $$ = $2; }
@@ -387,28 +379,17 @@ lex_builtin
;
function_prologue
- : LEX_FUNCTION
+ : LEX_FUNCTION func_name '(' opt_param_list r_paren opt_nls
{
- param_counter = 0;
- func_params = NULL;
+ $1->source_file = source;
+ if (install_function($2->lextok, $1, $4) < 0)
+ YYABORT;
+ in_function = $2->lextok;
+ $2->lextok = NULL;
+ bcfree($2);
+ /* $4 already free'd in install_function */
+ $$ = $1;
}
- func_name '(' opt_param_list r_paren opt_nls
- {
- NODE *t;
-
- $1->source_file = source;
- t = make_param($3->lextok);
- $3->lextok = NULL;
- bcfree($3);
- t->flags |= FUNC;
- t->rnode = func_params;
- func_params = t;
- $$ = $1;
- can_return = TRUE;
- /* check for duplicate parameter names */
- if (dup_parms($1, t))
- errcount++;
- }
;
regexp
@@ -417,7 +398,7 @@ regexp
* is a regexp so it should read up to the closing slash.
*/
: a_slash
- { ++want_regexp; }
+ { want_regexp = true; }
REGEXP /* The terminating '/' is consumed by yylex(). */
{
NODE *n, *exp;
@@ -425,12 +406,13 @@ regexp
size_t len;
re = $3->lextok;
+ $3->lextok = NULL;
len = strlen(re);
if (do_lint) {
if (len == 0)
lintwarn_ln($3->source_line,
_("regexp constant `//' looks like a C++ comment, but is not"));
- else if ((re)[0] == '*' && (re)[len-1] == '*')
+ else if (re[0] == '*' && re[len-1] == '*')
/* possible C comment */
lintwarn_ln($3->source_line,
_("regexp constant `/%s/' looks like a C comment, but is not"), re);
@@ -486,7 +468,7 @@ statement
{ $$ = $2; }
| if_statement
{
- if (do_profiling)
+ if (do_pretty_print)
$$ = list_prepend($1, instruction(Op_exec_count));
else
$$ = $1;
@@ -537,7 +519,7 @@ statement
case_values[case_count++] = caseval;
} else {
/* match a constant regex against switch expression. */
- (curr + 1)->match_exp = TRUE;
+ (curr + 1)->match_exp = true;
}
curr->stmt_start = casestmt->nexti;
curr->stmt_end = casestmt->lasti;
@@ -550,7 +532,7 @@ statement
else
dflt->target_jmp = casestmt->nexti;
- if (do_profiling) {
+ if (do_pretty_print) {
curr->stmt_start = casestmt->nexti;
curr->stmt_end = casestmt->lasti;
(void) list_prepend(cexp, curr);
@@ -565,7 +547,7 @@ statement
efree(case_values);
ip = $3;
- if (do_profiling) {
+ if (do_pretty_print) {
(void) list_prepend(ip, $1);
(void) list_prepend(ip, instruction(Op_exec_count));
$1->target_break = tbreak;
@@ -604,7 +586,7 @@ statement
ip = list_append($3, instruction(Op_jmp_false));
ip->lasti->target_jmp = tbreak;
- if (do_profiling) {
+ if (do_pretty_print) {
(void) list_append(ip, instruction(Op_exec_count));
$1->target_break = tbreak;
$1->target_continue = tcont;
@@ -646,7 +628,7 @@ statement
ip = list_merge($3, $6);
else
ip = list_prepend($6, instruction(Op_no_op));
- if (do_profiling)
+ if (do_pretty_print)
(void) list_prepend(ip, instruction(Op_exec_count));
(void) list_append(ip, instruction(Op_jmp_true));
ip->lasti->target_jmp = ip->nexti;
@@ -656,7 +638,7 @@ statement
continue_allowed--;
fix_break_continue(ip, tbreak, tcont);
- if (do_profiling) {
+ if (do_pretty_print) {
$1->target_break = tbreak;
$1->target_continue = tcont;
($1 + 1)->doloop_cond = tcont;
@@ -716,30 +698,30 @@ statement
} else {
INSTRUCTION *tbreak, *tcont;
- /* [ Op_push_array a ]
- * [ Op_arrayfor_init | ib ]
- * ic:[ Op_arrayfor_incr | ib ]
- * [ Op_var_assign if any ]
- *
- * body
- *
- * [Op_jmp | ic ]
- * ib:[Op_arrayfor_final ]
- */
+ /* [ Op_push_array a ]
+ * [ Op_arrayfor_init | ib ]
+ * ic:[ Op_arrayfor_incr | ib ]
+ * [ Op_var_assign if any ]
+ *
+ * body
+ *
+ * [Op_jmp | ic ]
+ * ib:[Op_arrayfor_final ]
+ */
regular_loop:
ip = $5;
ip->nexti->opcode = Op_push_array;
tbreak = instruction(Op_arrayfor_final);
$4->opcode = Op_arrayfor_incr;
- $4->array_var = variable(var_name, Node_var);
+ $4->array_var = variable($3->source_line, var_name, Node_var);
$4->target_jmp = tbreak;
tcont = $4;
$3->opcode = Op_arrayfor_init;
$3->target_jmp = tbreak;
(void) list_append(ip, $3);
- if (do_profiling) {
+ if (do_pretty_print) {
$1->opcode = Op_K_arrayfor;
$1->target_continue = tcont;
$1->target_break = tbreak;
@@ -760,7 +742,7 @@ regular_loop:
ip->lasti->assign_var = $4->array_var->var_assign;
}
- if (do_profiling) {
+ if (do_pretty_print) {
(void) list_append(ip, instruction(Op_exec_count));
($1 + 1)->forloop_cond = $4;
($1 + 1)->forloop_body = ip->lasti;
@@ -794,7 +776,7 @@ regular_loop:
}
| non_compound_stmt
{
- if (do_profiling)
+ if (do_pretty_print)
$$ = list_prepend($1, instruction(Op_exec_count));
else
$$ = $1;
@@ -851,21 +833,33 @@ non_compound_stmt
if ($2 == NULL) {
$$ = list_create($1);
(void) list_prepend($$, instruction(Op_push_i));
- $$->nexti->memory = Nnull_string;
+ $$->nexti->memory = dupnode(Nnull_string);
} else
$$ = list_append($2, $1);
}
| LEX_RETURN
{
- if (! can_return)
+ if (! in_function)
yyerror(_("`return' used outside function context"));
} opt_exp statement_term {
if ($3 == NULL) {
$$ = list_create($1);
(void) list_prepend($$, instruction(Op_push_i));
- $$->nexti->memory = Nnull_string;
- } else
+ $$->nexti->memory = dupnode(Nnull_string);
+ } else {
+ if (do_optimize > 1
+ && $3->lasti->opcode == Op_func_call
+ && strcmp($3->lasti->func_name, in_function) == 0
+ ) {
+ /* Do tail recursion optimization. Tail
+ * call without a return value is recognized
+ * in mk_function().
+ */
+ ($3->lasti + 1)->tail_call = true;
+ }
+
$$ = list_append($3, $1);
+ }
}
| simple_stmt statement_term
;
@@ -879,7 +873,7 @@ non_compound_stmt
* We don't bother to document it though. So there.
*/
simple_stmt
- : print { in_print = TRUE; in_parens = 0; } print_expression_list output_redir
+ : print { in_print = true; in_parens = 0; } print_expression_list output_redir
{
/*
* Optimization: plain `print' has no expression list, so $3 is null.
@@ -888,15 +882,14 @@ simple_stmt
*/
if ($1->opcode == Op_K_print &&
- ($3 == NULL
- || ($3->lasti->opcode == Op_field_spec
- && $3->nexti->nexti->nexti == $3->lasti
- && $3->nexti->nexti->opcode == Op_push_i
- && $3->nexti->nexti->memory->type == Node_val
- && $3->nexti->nexti->memory->numbr == 0.0)
- )
+ ($3 == NULL
+ || ($3->lasti->opcode == Op_field_spec
+ && $3->nexti->nexti->nexti == $3->lasti
+ && $3->nexti->nexti->opcode == Op_push_i
+ && $3->nexti->nexti->memory->type == Node_val)
+ )
) {
- static short warned = FALSE;
+ static bool warned = false;
/* -----------------
* output_redir
* [ redirect exp ]
@@ -907,16 +900,19 @@ simple_stmt
*/
if ($3 != NULL) {
- bcfree($3->lasti); /* Op_field_spec */
- $3->nexti->nexti->memory->flags &= ~PERM;
- $3->nexti->nexti->memory->flags |= MALLOC;
- unref($3->nexti->nexti->memory); /* Node_val */
+ NODE *n = $3->nexti->nexti->memory;
+
+ if (! iszero(n))
+ goto regular_print;
+
+ bcfree($3->lasti); /* Op_field_spec */
+ unref(n); /* Node_val */
bcfree($3->nexti->nexti); /* Op_push_i */
- bcfree($3->nexti); /* Op_list */
- bcfree($3); /* Op_list */
+ bcfree($3->nexti); /* Op_list */
+ bcfree($3); /* Op_list */
} else {
if (do_lint && (rule == BEGIN || rule == END) && ! warned) {
- warned = TRUE;
+ warned = true;
lintwarn_ln($1->source_line,
_("plain `print' in BEGIN or END rule should probably be `print \"\"'"));
}
@@ -925,7 +921,7 @@ simple_stmt
$1->expr_count = 0;
$1->opcode = Op_K_print_rec;
if ($4 == NULL) { /* no redircetion */
- $1->redir_type = 0;
+ $1->redir_type = redirect_none;
$$ = list_create($1);
} else {
INSTRUCTION *ip;
@@ -945,16 +941,16 @@ simple_stmt
* [$1 | NULL | redir_type | expr_count]
*
*/
-
+regular_print:
if ($4 == NULL) { /* no redirection */
if ($3 == NULL) { /* printf without arg */
$1->expr_count = 0;
- $1->redir_type = 0;
+ $1->redir_type = redirect_none;
$$ = list_create($1);
} else {
INSTRUCTION *t = $3;
- $1->expr_count = count_expressions(&t, FALSE);
- $1->redir_type = 0;
+ $1->expr_count = count_expressions(&t, false);
+ $1->redir_type = redirect_none;
$$ = list_append(t, $1);
}
} else {
@@ -968,7 +964,7 @@ simple_stmt
$$ = list_append($4, $1);
} else {
INSTRUCTION *t = $3;
- $1->expr_count = count_expressions(&t, FALSE);
+ $1->expr_count = count_expressions(&t, false);
$$ = list_append(list_merge($4, t), $1);
}
}
@@ -980,7 +976,14 @@ simple_stmt
char *arr = $2->lextok;
$2->opcode = Op_push_array;
- $2->memory = variable(arr, Node_var_new);
+ $2->memory = variable($2->source_line, arr, Node_var_new);
+
+ if (! do_posix && ! do_traditional) {
+ if ($2->memory == symbol_table)
+ fatal(_("`delete' is not allowed with SYMTAB"));
+ else if ($2->memory == func_table)
+ fatal(_("`delete' is not allowed with FUNCTAB"));
+ }
if ($4 == NULL) {
/*
@@ -1007,11 +1010,11 @@ simple_stmt
* should always be done.
*/
{
- static short warned = FALSE;
+ static bool warned = false;
char *arr = $3->lextok;
if (do_lint && ! warned) {
- warned = TRUE;
+ warned = true;
lintwarn_ln($1->source_line,
_("`delete(array)' is a non-portable tawk extension"));
}
@@ -1019,10 +1022,17 @@ simple_stmt
error_ln($1->source_line,
_("`delete(array)' is a non-portable tawk extension"));
}
- $3->memory = variable(arr, Node_var_new);
+ $3->memory = variable($3->source_line, arr, Node_var_new);
$3->opcode = Op_push_array;
$1->expr_count = 0;
$$ = list_append(list_create($3), $1);
+
+ if (! do_posix && ! do_traditional) {
+ if ($3->memory == symbol_table)
+ fatal(_("`delete' is not allowed with SYMTAB"));
+ else if ($3->memory == func_table)
+ fatal(_("`delete' is not allowed with FUNCTAB"));
+ }
}
| exp
{ $$ = optimize_assignment($1); }
@@ -1055,7 +1065,7 @@ case_statement
INSTRUCTION *casestmt = $5;
if ($5 == NULL)
casestmt = list_create(instruction(Op_no_op));
- if (do_profiling)
+ if (do_pretty_print)
(void) list_prepend(casestmt, instruction(Op_exec_count));
$1->case_exp = $2;
$1->case_stmt = casestmt;
@@ -1067,7 +1077,7 @@ case_statement
INSTRUCTION *casestmt = $4;
if ($4 == NULL)
casestmt = list_create(instruction(Op_no_op));
- if (do_profiling)
+ if (do_pretty_print)
(void) list_prepend(casestmt, instruction(Op_exec_count));
bcfree($2);
$1->case_stmt = casestmt;
@@ -1080,7 +1090,9 @@ case_value
{ $$ = $1; }
| '-' YNUMBER %prec UNARY
{
- $2->memory->numbr = -(force_number($2->memory));
+ NODE *n = $2->memory;
+ (void) force_number(n);
+ negate_num(n);
bcfree($1);
$$ = $2;
}
@@ -1120,11 +1132,11 @@ print_expression_list
output_redir
: /* empty */
{
- in_print = FALSE;
+ in_print = false;
in_parens = 0;
$$ = NULL;
}
- | IO_OUT { in_print = FALSE; in_parens = 0; } common_exp
+ | IO_OUT { in_print = false; in_parens = 0; } common_exp
{
if ($1->redir_type == redirect_twoway
&& $3->lasti->opcode == Op_K_getline_redir
@@ -1168,29 +1180,29 @@ input_redir
opt_param_list
: /* empty */
+ { $$ = NULL; }
| param_list
+ { $$ = $1 ; }
;
param_list
: NAME
{
- append_param($1->lextok);
- $1->lextok = NULL;
- bcfree($1);
+ $1->param_count = 0;
+ $$ = list_create($1);
}
| param_list comma NAME
{
- append_param($3->lextok);
- $3->lextok = NULL;
- bcfree($3);
+ $3->param_count = $1->lasti->param_count + 1;
+ $$ = list_append($1, $3);
yyerrok;
}
| error
- { /* func_params = NULL; */ }
+ { $$ = NULL; }
| param_list error
- { /* func_params = NULL; */ }
+ { $$ = $1; }
| param_list comma error
- { /* func_params = NULL; */ }
+ { $$ = $1; }
;
/* optional expression, as in for loop */
@@ -1258,7 +1270,7 @@ exp
| exp LEX_IN simple_variable
{
if (do_lint_old)
- warning_ln($2->source_line,
+ warning_ln($2->source_line,
_("old awk does not support the keyword `in' except after `for'"));
$3->nexti->opcode = Op_push_array;
$2->opcode = Op_in_array;
@@ -1312,7 +1324,7 @@ common_exp
| common_exp simp_exp %prec CONCAT_OP
{
int count = 2;
- int is_simple_var = FALSE;
+ bool is_simple_var = false;
if ($1->lasti->opcode == Op_concat) {
/* multiple (> 2) adjacent strings optimization */
@@ -1321,32 +1333,29 @@ common_exp
$1->lasti->opcode = Op_no_op;
} else {
is_simple_var = ($1->nexti->opcode == Op_push
- && $1->lasti == $1->nexti); /* first exp. is a simple
- * variable?; kludge for use
- * in Op_assign_concat.
- */
+ && $1->lasti == $1->nexti); /* first exp. is a simple
+ * variable?; kludge for use
+ * in Op_assign_concat.
+ */
}
if (do_optimize > 1
- && $1->nexti == $1->lasti && $1->nexti->opcode == Op_push_i
- && $2->nexti == $2->lasti && $2->nexti->opcode == Op_push_i
+ && $1->nexti == $1->lasti && $1->nexti->opcode == Op_push_i
+ && $2->nexti == $2->lasti && $2->nexti->opcode == Op_push_i
) {
NODE *n1 = $1->nexti->memory;
NODE *n2 = $2->nexti->memory;
size_t nlen;
- (void) force_string(n1);
- (void) force_string(n2);
+ n1 = force_string(n1);
+ n2 = force_string(n2);
nlen = n1->stlen + n2->stlen;
erealloc(n1->stptr, char *, nlen + 2, "constant fold");
memcpy(n1->stptr + n1->stlen, n2->stptr, n2->stlen);
n1->stlen = nlen;
n1->stptr[nlen] = '\0';
- n1->flags &= ~(NUMCUR|NUMBER);
+ n1->flags &= ~(NUMCUR|NUMBER|NUMINT);
n1->flags |= (STRING|STRCUR);
-
- n2->flags &= ~PERM;
- n2->flags |= MALLOC;
unref(n2);
bcfree($2->nexti);
bcfree($2);
@@ -1425,7 +1434,7 @@ simp_exp
$$ = list_merge($5, $4);
} else {
INSTRUCTION *t = $2;
- $4->expr_count = count_expressions(&t, FALSE);
+ $4->expr_count = count_expressions(&t, false);
$$ = list_append(list_merge(t, $5), $4);
}
}
@@ -1464,12 +1473,13 @@ non_post_simp_exp
if ($2->opcode == Op_match_rec) {
$2->opcode = Op_nomatch;
$1->opcode = Op_push_i;
- $1->memory = mk_number(0.0, (PERM|NUMCUR|NUMBER));
+ $1->memory = make_number(0.0);
$$ = list_append(list_append(list_create($1),
- instruction(Op_field_spec)), $2);
+ instruction(Op_field_spec)), $2);
} else {
if (do_optimize > 1 && $2->nexti == $2->lasti
- && $2->nexti->opcode == Op_push_i
+ && $2->nexti->opcode == Op_push_i
+ && ($2->nexti->memory->flags & (MPFN|MPZN)) == 0
) {
NODE *n = $2->nexti->memory;
if ((n->flags & (STRCUR|STRING)) != 0) {
@@ -1506,10 +1516,10 @@ non_post_simp_exp
}
| LEX_LENGTH
{
- static short warned1 = FALSE;
+ static bool warned = false;
- if (do_lint && ! warned1) {
- warned1 = TRUE;
+ if (do_lint && ! warned) {
+ warned = true;
lintwarn_ln($1->source_line,
_("call of `length' without parentheses is not portable"));
}
@@ -1540,8 +1550,11 @@ non_post_simp_exp
| '-' simp_exp %prec UNARY
{
if ($2->lasti->opcode == Op_push_i
- && ($2->lasti->memory->flags & (STRCUR|STRING)) == 0) {
- $2->lasti->memory->numbr = -(force_number($2->lasti->memory));
+ && ($2->lasti->memory->flags & (STRCUR|STRING)) == 0
+ ) {
+ NODE *n = $2->lasti->memory;
+ (void) force_number(n);
+ negate_num(n);
$$ = $2;
bcfree($1);
} else {
@@ -1556,7 +1569,7 @@ non_post_simp_exp
* POSIX semantics: force a conversion to numeric type
*/
$1->opcode = Op_plus_i;
- $1->memory = mk_number((AWKNUM) 0.0, (PERM|NUMCUR|NUMBER));
+ $1->memory = make_number(0.0);
$$ = list_append($2, $1);
}
;
@@ -1573,13 +1586,13 @@ func_call
INSTRUCTION *f, *t;
char *name;
NODE *indirect_var;
- static short warned = FALSE;
+ static bool warned = false;
const char *msg = _("indirect function calls are a gawk extension");
if (do_traditional || do_posix)
yyerror("%s", msg);
else if (do_lint && ! warned) {
- warned = TRUE;
+ warned = true;
lintwarn("%s", msg);
}
@@ -1588,7 +1601,7 @@ func_call
name = estrdup(f->func_name, strlen(f->func_name));
if (is_std_var(name))
yyerror(_("can not use special variable `%s' for indirect function call"), name);
- indirect_var = variable(name, Node_var_new);
+ indirect_var = variable(f->source_line, name, Node_var_new);
t = instruction(Op_push);
t->memory = indirect_var;
@@ -1613,7 +1626,7 @@ direct_func_call
$$ = list_create($1);
} else {
INSTRUCTION *t = $3;
- ($1 + 1)->expr_count = count_expressions(&t, TRUE);
+ ($1 + 1)->expr_count = count_expressions(&t, true);
$$ = list_append(t, $1);
}
}
@@ -1668,10 +1681,10 @@ bracketed_exp_list
_("invalid subscript expression"));
/* install Null string as subscript. */
t = list_create(instruction(Op_push_i));
- t->nexti->memory = Nnull_string;
+ t->nexti->memory = dupnode(Nnull_string);
$3->sub_count = 1;
} else
- $3->sub_count = count_expressions(&t, FALSE);
+ $3->sub_count = count_expressions(&t, false);
$$ = list_append(t, $3);
}
;
@@ -1696,17 +1709,13 @@ simple_variable
char *var_name = $1->lextok;
$1->opcode = Op_push;
- $1->memory = variable(var_name, Node_var_new);
+ $1->memory = variable($1->source_line, var_name, Node_var_new);
$$ = list_create($1);
}
| NAME subscript_list
{
- NODE *n;
-
char *arr = $1->lextok;
- if ((n = lookup(arr)) != NULL && ! isarray(n))
- yyerror(_("use of non-array as array"));
- $1->memory = variable(arr, Node_var_new);
+ $1->memory = variable($1->source_line, arr, Node_var_new);
$1->opcode = Op_push_array;
$$ = list_prepend($2, $1);
}
@@ -1717,8 +1726,8 @@ variable
{
INSTRUCTION *ip = $1->nexti;
if (ip->opcode == Op_push
- && ip->memory->type == Node_var
- && ip->memory->var_update
+ && ip->memory->type == Node_var
+ && ip->memory->var_update
) {
$$ = list_prepend($1, instruction(Op_var_update));
$$->nexti->update_var = ip->memory->var_update;
@@ -1729,7 +1738,7 @@ variable
{
$$ = list_append($2, $1);
if ($3 != NULL)
- mk_assignment($2, NULL, $3);
+ mk_assignment($2, NULL, $3);
}
;
@@ -1791,6 +1800,7 @@ struct token {
# define CONTINUE 0x2000 /* continue allowed inside */
NODE *(*ptr)(int); /* function that implements this keyword */
+ NODE *(*ptr2)(int); /* alternate arbitrary-precision function */
};
#if 'a' == 0x81 /* it's EBCDIC */
@@ -1814,81 +1824,87 @@ tokcompare(const void *l, const void *r)
* Function pointers come from declarations in awk.h.
*/
+#ifdef HAVE_MPFR
+#define MPF(F) do_mpfr_##F
+#else
+#define MPF(F) 0
+#endif
+
static const struct token tokentab[] = {
-{"BEGIN", Op_rule, LEX_BEGIN, 0, 0},
-{"BEGINFILE", Op_rule, LEX_BEGINFILE, GAWKX, 0},
-{"END", Op_rule, LEX_END, 0, 0},
-{"ENDFILE", Op_rule, LEX_ENDFILE, GAWKX, 0},
+{"BEGIN", Op_rule, LEX_BEGIN, 0, 0, 0},
+{"BEGINFILE", Op_rule, LEX_BEGINFILE, GAWKX, 0, 0},
+{"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), do_adump},
+{"adump", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2), do_adump, 0},
#endif
-{"and", Op_builtin, LEX_BUILTIN, GAWKX|A(2), do_and},
-{"asort", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3), do_asort},
-{"asorti", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3), do_asorti},
-{"atan2", Op_builtin, LEX_BUILTIN, NOT_OLD|A(2), do_atan2},
-{"bindtextdomain", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2), do_bindtextdomain},
-{"break", Op_K_break, LEX_BREAK, 0, 0},
-{"case", Op_K_case, LEX_CASE, GAWKX, 0},
-{"close", Op_builtin, LEX_BUILTIN, NOT_OLD|A(1)|A(2), do_close},
-{"compl", Op_builtin, LEX_BUILTIN, GAWKX|A(1), do_compl},
-{"continue", Op_K_continue, LEX_CONTINUE, 0, 0},
-{"cos", Op_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_cos},
-{"dcgettext", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3), do_dcgettext},
-{"dcngettext", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3)|A(4)|A(5), do_dcngettext},
-{"default", Op_K_default, LEX_DEFAULT, GAWKX, 0},
-{"delete", Op_K_delete, LEX_DELETE, NOT_OLD, 0},
-{"do", Op_K_do, LEX_DO, NOT_OLD|BREAK|CONTINUE, 0},
-{"else", Op_K_else, LEX_ELSE, 0, 0},
-{"eval", Op_symbol, LEX_EVAL, 0, 0},
-{"exit", Op_K_exit, LEX_EXIT, 0, 0},
-{"exp", Op_builtin, LEX_BUILTIN, A(1), do_exp},
-{"extension", Op_builtin, LEX_BUILTIN, GAWKX|A(2), do_ext},
-{"fflush", Op_builtin, LEX_BUILTIN, RESX|A(0)|A(1), do_fflush},
-{"for", Op_K_for, LEX_FOR, BREAK|CONTINUE, 0},
-{"func", Op_func, LEX_FUNCTION, NOT_POSIX|NOT_OLD, 0},
-{"function",Op_func, LEX_FUNCTION, NOT_OLD, 0},
-{"gensub", Op_sub_builtin, LEX_BUILTIN, GAWKX|A(3)|A(4), 0},
-{"getline", Op_K_getline_redir, LEX_GETLINE, NOT_OLD, 0},
-{"gsub", Op_sub_builtin, LEX_BUILTIN, NOT_OLD|A(2)|A(3), 0},
-{"if", Op_K_if, LEX_IF, 0, 0},
-{"in", Op_symbol, LEX_IN, 0, 0},
-{"include", Op_symbol, LEX_INCLUDE, GAWKX, 0},
-{"index", Op_builtin, LEX_BUILTIN, A(2), do_index},
-{"int", Op_builtin, LEX_BUILTIN, A(1), do_int},
-{"isarray", Op_builtin, LEX_BUILTIN, GAWKX|A(1), do_isarray},
-{"length", Op_builtin, LEX_LENGTH, A(0)|A(1), do_length},
-{"log", Op_builtin, LEX_BUILTIN, A(1), do_log},
-{"lshift", Op_builtin, LEX_BUILTIN, GAWKX|A(2), do_lshift},
-{"match", Op_builtin, LEX_BUILTIN, NOT_OLD|A(2)|A(3), do_match},
-{"mktime", Op_builtin, LEX_BUILTIN, GAWKX|A(1), do_mktime},
-{"next", Op_K_next, LEX_NEXT, 0, 0},
-{"nextfile", Op_K_nextfile, LEX_NEXTFILE, 0, 0},
-{"or", Op_builtin, LEX_BUILTIN, GAWKX|A(2), do_or},
-{"patsplit", Op_builtin, LEX_BUILTIN, GAWKX|A(2)|A(3)|A(4), do_patsplit},
-{"print", Op_K_print, LEX_PRINT, 0, 0},
-{"printf", Op_K_printf, LEX_PRINTF, 0, 0},
-{"rand", Op_builtin, LEX_BUILTIN, NOT_OLD|A(0), do_rand},
-{"return", Op_K_return, LEX_RETURN, NOT_OLD, 0},
-{"rshift", Op_builtin, LEX_BUILTIN, GAWKX|A(2), do_rshift},
-{"sin", Op_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_sin},
-{"split", Op_builtin, LEX_BUILTIN, A(2)|A(3)|A(4), do_split},
-{"sprintf", Op_builtin, LEX_BUILTIN, 0, do_sprintf},
-{"sqrt", Op_builtin, LEX_BUILTIN, A(1), do_sqrt},
-{"srand", Op_builtin, LEX_BUILTIN, NOT_OLD|A(0)|A(1), do_srand},
+{"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},
+{"asorti", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3), do_asorti, 0},
+{"atan2", Op_builtin, LEX_BUILTIN, NOT_OLD|A(2), do_atan2, MPF(atan2)},
+{"bindtextdomain", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2), do_bindtextdomain, 0},
+{"break", Op_K_break, LEX_BREAK, 0, 0, 0},
+{"case", Op_K_case, LEX_CASE, GAWKX, 0, 0},
+{"close", Op_builtin, LEX_BUILTIN, NOT_OLD|A(1)|A(2), do_close, 0},
+{"compl", Op_builtin, LEX_BUILTIN, GAWKX|A(1), do_compl, MPF(compl)},
+{"continue", Op_K_continue, LEX_CONTINUE, 0, 0, 0},
+{"cos", Op_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_cos, MPF(cos)},
+{"dcgettext", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3), do_dcgettext, 0},
+{"dcngettext", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3)|A(4)|A(5), do_dcngettext, 0},
+{"default", Op_K_default, LEX_DEFAULT, GAWKX, 0, 0},
+{"delete", Op_K_delete, LEX_DELETE, NOT_OLD, 0, 0},
+{"do", Op_K_do, LEX_DO, NOT_OLD|BREAK|CONTINUE, 0, 0},
+{"else", Op_K_else, LEX_ELSE, 0, 0, 0},
+{"eval", Op_symbol, LEX_EVAL, 0, 0, 0},
+{"exit", Op_K_exit, LEX_EXIT, 0, 0, 0},
+{"exp", Op_builtin, LEX_BUILTIN, A(1), do_exp, MPF(exp)},
+{"fflush", Op_builtin, LEX_BUILTIN, RESX|A(0)|A(1), do_fflush, 0},
+{"for", Op_K_for, LEX_FOR, BREAK|CONTINUE, 0, 0},
+{"func", Op_func, LEX_FUNCTION, NOT_POSIX|NOT_OLD, 0, 0},
+{"function",Op_func, LEX_FUNCTION, NOT_OLD, 0, 0},
+{"gensub", Op_sub_builtin, LEX_BUILTIN, GAWKX|A(3)|A(4), 0, 0},
+{"getline", Op_K_getline_redir, LEX_GETLINE, NOT_OLD, 0, 0},
+{"gsub", Op_sub_builtin, LEX_BUILTIN, NOT_OLD|A(2)|A(3), 0, 0},
+{"if", Op_K_if, LEX_IF, 0, 0, 0},
+{"in", Op_symbol, LEX_IN, 0, 0, 0},
+{"include", Op_symbol, LEX_INCLUDE, GAWKX, 0, 0},
+{"index", Op_builtin, LEX_BUILTIN, A(2), do_index, 0},
+{"int", Op_builtin, LEX_BUILTIN, A(1), do_int, MPF(int)},
+{"isarray", Op_builtin, LEX_BUILTIN, GAWKX|A(1), do_isarray, 0},
+{"length", Op_builtin, LEX_LENGTH, A(0)|A(1), do_length, 0},
+{"load", Op_symbol, LEX_LOAD, GAWKX, 0, 0},
+{"log", Op_builtin, LEX_BUILTIN, A(1), do_log, MPF(log)},
+{"lshift", Op_builtin, LEX_BUILTIN, GAWKX|A(2), do_lshift, MPF(lshift)},
+{"match", Op_builtin, LEX_BUILTIN, NOT_OLD|A(2)|A(3), do_match, 0},
+{"mktime", Op_builtin, LEX_BUILTIN, GAWKX|A(1), do_mktime, 0},
+{"next", Op_K_next, LEX_NEXT, 0, 0, 0},
+{"nextfile", Op_K_nextfile, LEX_NEXTFILE, 0, 0, 0},
+{"or", Op_builtin, LEX_BUILTIN, GAWKX, do_or, MPF(or)},
+{"patsplit", Op_builtin, LEX_BUILTIN, GAWKX|A(2)|A(3)|A(4), do_patsplit, 0},
+{"print", Op_K_print, LEX_PRINT, 0, 0, 0},
+{"printf", Op_K_printf, LEX_PRINTF, 0, 0, 0},
+{"rand", Op_builtin, LEX_BUILTIN, NOT_OLD|A(0), do_rand, MPF(rand)},
+{"return", Op_K_return, LEX_RETURN, NOT_OLD, 0, 0},
+{"rshift", Op_builtin, LEX_BUILTIN, GAWKX|A(2), do_rshift, MPF(rhift)},
+{"sin", Op_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_sin, MPF(sin)},
+{"split", Op_builtin, LEX_BUILTIN, A(2)|A(3)|A(4), do_split, 0},
+{"sprintf", Op_builtin, LEX_BUILTIN, 0, do_sprintf, 0},
+{"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},
+{"stopme", Op_builtin, LEX_BUILTIN, GAWKX|A(0), stopme, 0},
#endif
-{"strftime", Op_builtin, LEX_BUILTIN, GAWKX|A(0)|A(1)|A(2)|A(3), do_strftime},
-{"strtonum", Op_builtin, LEX_BUILTIN, GAWKX|A(1), do_strtonum},
-{"sub", Op_sub_builtin, LEX_BUILTIN, NOT_OLD|A(2)|A(3), 0},
-{"substr", Op_builtin, LEX_BUILTIN, A(2)|A(3), do_substr},
-{"switch", Op_K_switch, LEX_SWITCH, GAWKX|BREAK, 0},
-{"system", Op_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_system},
-{"systime", Op_builtin, LEX_BUILTIN, GAWKX|A(0), do_systime},
-{"tolower", Op_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_tolower},
-{"toupper", Op_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_toupper},
-{"while", Op_K_while, LEX_WHILE, BREAK|CONTINUE, 0},
-{"xor", Op_builtin, LEX_BUILTIN, GAWKX|A(2), do_xor},
+{"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)},
+{"sub", Op_sub_builtin, LEX_BUILTIN, NOT_OLD|A(2)|A(3), 0, 0},
+{"substr", Op_builtin, LEX_BUILTIN, A(2)|A(3), do_substr, 0},
+{"switch", Op_K_switch, LEX_SWITCH, GAWKX|BREAK, 0, 0},
+{"system", Op_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_system, 0},
+{"systime", Op_builtin, LEX_BUILTIN, GAWKX|A(0), do_systime, 0},
+{"tolower", Op_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_tolower, 0},
+{"toupper", Op_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_toupper, 0},
+{"while", Op_K_while, LEX_WHILE, BREAK|CONTINUE, 0, 0},
+{"xor", Op_builtin, LEX_BUILTIN, GAWKX, do_xor, MPF(xor)},
};
#if MBS_SUPPORT
@@ -1924,6 +1940,23 @@ getfname(NODE *(*fptr)(int))
return NULL;
}
+/* negate_num --- negate a number in NODE */
+
+void
+negate_num(NODE *n)
+{
+#ifdef HAVE_MPFR
+ if (is_mpg_float(n)) {
+ int tval;
+ tval = mpfr_neg(n->mpg_numbr, n->mpg_numbr, ROUND_MODE);
+ IEEE_FMT(n->mpg_numbr, tval);
+ } else if (is_mpg_integer(n)) {
+ mpz_neg(n->mpg_i, n->mpg_i);
+ } else
+#endif
+ n->numbr = -n->numbr;
+}
+
/* print_included_from --- print `Included from ..' file names and locations */
static void
@@ -1947,7 +1980,7 @@ print_included_from()
line--;
msg("%s %s:%d%c",
s->prev == sourcefile ? "In file included from"
- : " from",
+ : " from",
(s->stype == SRC_INC ||
s->stype == SRC_FILE) ? s->src : "cmd. line",
line,
@@ -1969,7 +2002,7 @@ warning_ln(int line, const char *mesg, ...)
sourceline = line;
print_included_from();
va_start(args, mesg);
- err(_("warning: "), mesg, args);
+ err(false, _("warning: "), mesg, args);
va_end(args);
sourceline = saveline;
}
@@ -1987,9 +2020,9 @@ lintwarn_ln(int line, const char *mesg, ...)
print_included_from();
va_start(args, mesg);
if (lintfunc == r_fatal)
- err(_("fatal: "), mesg, args);
+ err(true, _("fatal: "), mesg, args);
else
- err(_("warning: "), mesg, args);
+ err(false, _("warning: "), mesg, args);
va_end(args);
sourceline = saveline;
if (lintfunc == r_fatal)
@@ -2009,7 +2042,7 @@ error_ln(int line, const char *m, ...)
print_included_from();
errcount++;
va_start(args, m);
- err("error: ", m, args);
+ err(false, "error: ", m, args);
va_end(args);
sourceline = saveline;
}
@@ -2087,7 +2120,7 @@ yyerror(const char *m, ...)
*bp++ = ' ';
}
strcpy(bp, mesg);
- err("", buf, args);
+ err(false, "", buf, args);
va_end(args);
efree(buf);
}
@@ -2128,7 +2161,7 @@ mk_program()
if (endfile_block == NULL)
endfile_block = list_create(ip_endfile);
else {
- ip_rec->has_endfile = TRUE;
+ ip_rec->has_endfile = true;
(void) list_prepend(endfile_block, ip_endfile);
}
@@ -2229,8 +2262,11 @@ parse_program(INSTRUCTION **pcode)
ip_atexit = instruction(Op_atexit); /* target for `exit' in END block */
}
- sourcefile = srcfiles->next;
- lexeof = FALSE;
+ for (sourcefile = srcfiles->next; sourcefile->stype == SRC_EXTLIB;
+ sourcefile = sourcefile->next)
+ ;
+
+ lexeof = false;
lexptr = NULL;
lasttok = 0;
memset(rule_block, 0, sizeof(ruletab) * sizeof(INSTRUCTION *));
@@ -2246,6 +2282,11 @@ parse_program(INSTRUCTION **pcode)
if (ret == 0) /* avoid spurious warning if parser aborted with YYABORT */
check_funcs();
+ if (args_array == NULL)
+ emalloc(args_array, NODE **, (max_args + 2) * sizeof(NODE *), "parse_program");
+ else
+ erealloc(args_array, NODE **, (max_args + 2) * sizeof(NODE *), "parse_program");
+
return (ret || errcount);
}
@@ -2274,7 +2315,7 @@ do_add_srcfile(int stype, char *src, char *path, SRCFILE *thisfile)
*/
SRCFILE *
-add_srcfile(int stype, char *src, SRCFILE *thisfile, int *already_included, int *errcode)
+add_srcfile(int stype, char *src, SRCFILE *thisfile, bool *already_included, int *errcode)
{
SRCFILE *s;
struct stat sbuf;
@@ -2282,41 +2323,61 @@ add_srcfile(int stype, char *src, SRCFILE *thisfile, int *already_included, int
int errno_val = 0;
if (already_included)
- *already_included = FALSE;
+ *already_included = false;
if (errcode)
*errcode = 0;
if (stype == SRC_CMDLINE || stype == SRC_STDIN)
return do_add_srcfile(stype, src, NULL, thisfile);
- path = find_source(src, &sbuf, &errno_val);
+ path = find_source(src, & sbuf, &errno_val, stype == SRC_EXTLIB);
if (path == NULL) {
if (errcode) {
*errcode = errno_val;
return NULL;
}
- fatal(_("can't open source file `%s' for reading (%s)"),
- src, errno_val ? strerror(errno_val) : _("reason unknown"));
+ /* use full messages to ease translation */
+ fatal(stype != SRC_EXTLIB
+ ? _("can't open source file `%s' for reading (%s)")
+ : _("can't open shared library `%s' for reading (%s)"),
+ src,
+ errno_val ? strerror(errno_val) : _("reason unknown"));
}
+ /* N.B. We do not eliminate duplicate SRC_FILE (-f) programs. */
for (s = srcfiles->next; s != srcfiles; s = s->next) {
- if ((s->stype == SRC_FILE || s->stype == SRC_INC)
- && files_are_same(path, s)
- ) {
- if (do_lint) {
- int line = sourceline;
- /* Kludge: the line number may be off for `@include file'.
- * Since, this function is also used for '-f file' in main.c,
- * sourceline > 1 check ensures that the call is at
- * parse time.
- */
- if (sourceline > 1 && lasttok == NEWLINE)
- line--;
- lintwarn_ln(line, _("already included source file `%s'"), src);
+ if ((s->stype == SRC_FILE || s->stype == SRC_INC || s->stype == SRC_EXTLIB) && files_are_same(path, s)) {
+ if (stype == SRC_INC || stype == SRC_EXTLIB) {
+ /* eliminate duplicates */
+ if ((stype == SRC_INC) && (s->stype == SRC_FILE))
+ fatal(_("can't include `%s' and use it as a program file"), src);
+
+ if (do_lint) {
+ int line = sourceline;
+ /* Kludge: the line number may be off for `@include file'.
+ * Since, this function is also used for '-f file' in main.c,
+ * sourceline > 1 check ensures that the call is at
+ * parse time.
+ */
+ if (sourceline > 1 && lasttok == NEWLINE)
+ line--;
+ lintwarn_ln(line,
+ stype != SRC_EXTLIB
+ ? _("already included source file `%s'")
+ : _("already loaded shared library `%s'"),
+ src);
+ }
+ efree(path);
+ if (already_included)
+ *already_included = true;
+ return NULL;
+ } else {
+ /* duplicates are allowed for -f */
+ if (s->stype == SRC_INC)
+ fatal(_("can't include `%s' and use it as a program file"), src);
+ /* no need to scan for further matches, since
+ * they must be of homogeneous type */
+ break;
}
- efree(path);
- if (already_included)
- *already_included = TRUE;
- return NULL;
}
}
@@ -2334,7 +2395,7 @@ include_source(INSTRUCTION *file)
SRCFILE *s;
char *src = file->lextok;
int errcode;
- int already_included;
+ bool already_included;
if (do_traditional || do_posix) {
error_ln(file->source_line, _("@include is a gawk extension"));
@@ -2371,8 +2432,43 @@ include_source(INSTRUCTION *file)
sourceline = 0;
source = NULL;
lasttok = 0;
- lexeof = FALSE;
- eof_warned = FALSE;
+ lexeof = false;
+ eof_warned = false;
+ return 0;
+}
+
+/* load_library --- load a shared library */
+
+static int
+load_library(INSTRUCTION *file)
+{
+ SRCFILE *s;
+ char *src = file->lextok;
+ int errcode;
+ bool already_included;
+
+ if (do_traditional || do_posix) {
+ error_ln(file->source_line, _("@load is a gawk extension"));
+ return -1;
+ }
+
+ if (strlen(src) == 0) {
+ if (do_lint)
+ lintwarn_ln(file->source_line, _("empty filename after @load"));
+ return 0;
+ }
+
+ s = add_srcfile(SRC_EXTLIB, src, sourcefile, &already_included, &errcode);
+ if (s == NULL) {
+ if (already_included)
+ return 0;
+ error_ln(file->source_line,
+ _("can't open shared library `%s' for reading (%s)"),
+ src, errcode ? strerror(errcode) : _("reason unknown"));
+ return -1;
+ }
+
+ load_ext(s->fullpath);
return 0;
}
@@ -2399,10 +2495,11 @@ next_sourcefile()
* Previous versions of gawk did not core dump in such a
* case.
*
- * assert(lexeof == TRUE);
+ * assert(lexeof == true);
*/
- lexeof = FALSE;
- eof_warned = FALSE;
+
+ lexeof = false;
+ eof_warned = false;
sourcefile->srclines = sourceline; /* total no of lines in current file */
if (sourcefile->fd > INVALID_HANDLE) {
if (sourcefile->fd != fileno(stdin)) /* safety */
@@ -2415,9 +2512,12 @@ next_sourcefile()
sourcefile->lexptr_begin = NULL;
}
- sourcefile = sourcefile->next;
- if (sourcefile == srcfiles)
- return;
+ while ((sourcefile = sourcefile->next) != NULL) {
+ if (sourcefile == srcfiles)
+ return;
+ if (sourcefile->stype != SRC_EXTLIB)
+ break;
+ }
if (sourcefile->lexptr_begin != NULL) {
/* resume reading from already opened file (postponed to process '@include') */
@@ -2443,7 +2543,7 @@ get_src_buf()
{
int n;
char *scan;
- int newfile;
+ bool newfile;
int savelen;
struct stat sbuf;
@@ -2468,7 +2568,7 @@ get_src_buf()
readfunc = read_one_line;
}
- newfile = FALSE;
+ newfile = false;
if (sourcefile == srcfiles)
return NULL;
@@ -2484,13 +2584,13 @@ get_src_buf()
* gawk '' /path/name
* Sigh.
*/
- static short warned = FALSE;
+ static bool warned = false;
if (do_lint && ! warned) {
- warned = TRUE;
+ warned = true;
lintwarn(_("empty program text on command line"));
}
- lexeof = TRUE;
+ lexeof = true;
}
} else if (sourcefile->buf == NULL && *(lexptr-1) != '\n') {
/*
@@ -2518,7 +2618,7 @@ get_src_buf()
lexend = lexptr + 1;
sourcefile->buf = buf;
} else
- lexeof = TRUE;
+ lexeof = true;
return lexptr;
}
@@ -2539,7 +2639,7 @@ get_src_buf()
error(_("can't open source file `%s' for reading (%s)"),
in, strerror(errno));
errcount++;
- lexeof = TRUE;
+ lexeof = true;
return sourcefile->src;
}
@@ -2555,7 +2655,7 @@ get_src_buf()
l = A_DECENT_BUFFER_SIZE;
#undef A_DECENT_BUFFER_SIZE
sourcefile->bufsize = l;
- newfile = TRUE;
+ newfile = true;
emalloc(sourcefile->buf, char *, sourcefile->bufsize, "get_src_buf");
lexptr = lexptr_begin = lexeme = sourcefile->buf;
savelen = 0;
@@ -2606,17 +2706,17 @@ get_src_buf()
error(_("can't read sourcefile `%s' (%s)"),
source, strerror(errno));
errcount++;
- lexeof = TRUE;
+ lexeof = true;
} else {
lexend = lexptr + n;
if (n == 0) {
- static short warned = FALSE;
+ static bool warned = false;
if (do_lint && newfile && ! warned){
- warned = TRUE;
+ warned = true;
sourceline = 0;
lintwarn(_("source file `%s' is empty"), source);
}
- lexeof = TRUE;
+ lexeof = true;
}
}
return sourcefile->buf;
@@ -2792,14 +2892,14 @@ static int newline_eof()
pushback();
if (do_lint && ! eof_warned) {
lintwarn(_("source file does not end in newline"));
- eof_warned = TRUE;
+ eof_warned = true;
}
sourceline++;
return NEWLINE;
}
sourceline--;
- eof_warned = FALSE;
+ eof_warned = false;
return LEX_EOF;
}
@@ -2809,14 +2909,16 @@ static int
yylex(void)
{
int c;
- int seen_e = FALSE; /* These are for numbers */
- int seen_point = FALSE;
- int esc_seen; /* for literal strings */
+ bool seen_e = false; /* These are for numbers */
+ bool seen_point = false;
+ bool esc_seen; /* for literal strings */
int mid;
- static int did_newline = FALSE;
+ int base;
+ static bool did_newline = false;
char *tokkey;
- int inhex = FALSE;
- int intlstr = FALSE;
+ bool inhex = false;
+ bool intlstr = false;
+ AWKNUM d;
#define GET_INSTRUCTION(op) bcalloc(op, 1, sourceline)
@@ -2870,7 +2972,7 @@ yylex(void)
* The code for \ handles \[ and \].
*/
- want_regexp = FALSE;
+ want_regexp = false;
tok = tokstart;
for (;;) {
c = nextc();
@@ -2987,10 +3089,10 @@ retry:
while ((c = nextc()) == ' ' || c == '\t' || c == '\r')
continue;
if (c == '#') {
- static short warned = FALSE;
+ static bool warned = false;
if (do_lint && ! warned) {
- warned = TRUE;
+ warned = true;
lintwarn(
_("use of `\\ #...' line continuation is not portable"));
}
@@ -3063,11 +3165,11 @@ retry:
return lasttok = '*';
} else if (c == '*') {
/* make ** and **= aliases for ^ and ^= */
- static int did_warn_op = FALSE, did_warn_assgn = FALSE;
+ static bool did_warn_op = false, did_warn_assgn = false;
if (nextc() == '=') {
if (! did_warn_assgn) {
- did_warn_assgn = TRUE;
+ did_warn_assgn = true;
if (do_lint)
lintwarn(_("POSIX does not allow operator `**='"));
if (do_lint_old)
@@ -3078,7 +3180,7 @@ retry:
} else {
pushback();
if (! did_warn_op) {
- did_warn_op = TRUE;
+ did_warn_op = true;
if (do_lint)
lintwarn(_("POSIX does not allow operator `**'"));
if (do_lint_old)
@@ -3112,11 +3214,11 @@ retry:
case '^':
{
- static int did_warn_op = FALSE, did_warn_assgn = FALSE;
+ static bool did_warn_op = false, did_warn_assgn = false;
if (nextc() == '=') {
if (do_lint_old && ! did_warn_assgn) {
- did_warn_assgn = TRUE;
+ did_warn_assgn = true;
warning(_("operator `^=' is not supported in old awk"));
}
yylval = GET_INSTRUCTION(Op_assign_exp);
@@ -3124,7 +3226,7 @@ retry:
}
pushback();
if (do_lint_old && ! did_warn_op) {
- did_warn_op = TRUE;
+ did_warn_op = true;
warning(_("operator `^' is not supported in old awk"));
}
yylval = GET_INSTRUCTION(Op_exp);
@@ -3203,7 +3305,7 @@ retry:
* hacking the grammar.
*/
if (did_newline) {
- did_newline = FALSE;
+ did_newline = false;
if (--in_braces == 0)
lastline = sourceline;
return lasttok = c;
@@ -3214,7 +3316,7 @@ retry:
case '"':
string:
- esc_seen = FALSE;
+ esc_seen = false;
while ((c = nextc()) != '"') {
if (c == '\n') {
pushback();
@@ -3228,7 +3330,7 @@ retry:
sourceline++;
continue;
}
- esc_seen = TRUE;
+ esc_seen = true;
if (! want_source || c != '"')
tokadd('\\');
}
@@ -3247,12 +3349,10 @@ retry:
yylval->opcode = Op_push_i;
yylval->memory = make_str_node(tokstart,
- tok - tokstart, esc_seen ? SCAN : 0);
- yylval->memory->flags &= ~MALLOC;
- yylval->memory->flags |= PERM;
+ tok - tokstart, esc_seen ? SCAN : 0);
if (intlstr) {
yylval->memory->flags |= INTLSTR;
- intlstr = FALSE;
+ intlstr = false;
if (do_intl)
dumpintlstr(yylval->memory->stptr, yylval->memory->stlen);
}
@@ -3291,7 +3391,7 @@ retry:
case '9':
/* It's a number */
for (;;) {
- int gotnumber = FALSE;
+ bool gotnumber = false;
tokadd(c);
switch (c) {
@@ -3303,7 +3403,7 @@ retry:
int peek = nextc();
if (isxdigit(peek)) {
- inhex = TRUE;
+ inhex = true;
pushback(); /* following digit */
} else {
pushback(); /* x or X */
@@ -3314,20 +3414,20 @@ retry:
case '.':
/* period ends exponent part of floating point number */
if (seen_point || seen_e) {
- gotnumber = TRUE;
+ gotnumber = true;
break;
}
- seen_point = TRUE;
+ seen_point = true;
break;
case 'e':
case 'E':
if (inhex)
break;
if (seen_e) {
- gotnumber = TRUE;
+ gotnumber = true;
break;
}
- seen_e = TRUE;
+ seen_e = true;
if ((c = nextc()) == '-' || c == '+') {
int c2 = nextc();
@@ -3372,7 +3472,7 @@ retry:
break;
default:
done:
- gotnumber = TRUE;
+ gotnumber = true;
}
if (gotnumber)
break;
@@ -3382,19 +3482,46 @@ retry:
tokadd('\0');
yylval = GET_INSTRUCTION(Op_push_i);
- if (! do_traditional && isnondecimal(tokstart, FALSE)) {
+
+ base = 10;
+ if (! do_traditional) {
+ base = get_numbase(tokstart, false);
if (do_lint) {
- if (isdigit((unsigned char) tokstart[1])) /* not an 'x' or 'X' */
+ if (base == 8)
lintwarn("numeric constant `%.*s' treated as octal",
(int) strlen(tokstart)-1, tokstart);
- else if (tokstart[1] == 'x' || tokstart[1] == 'X')
+ else if (base == 16)
lintwarn("numeric constant `%.*s' treated as hexadecimal",
(int) strlen(tokstart)-1, tokstart);
}
- yylval->memory = mk_number(nondec2awknum(tokstart, strlen(tokstart)),
- PERM|NUMCUR|NUMBER);
- } else
- yylval->memory = mk_number(atof(tokstart), PERM|NUMCUR|NUMBER);
+ }
+
+#ifdef HAVE_MPFR
+ if (do_mpfr) {
+ NODE *r;
+
+ if (! seen_point && ! seen_e) {
+ r = mpg_integer();
+ mpg_strtoui(r->mpg_i, tokstart, strlen(tokstart), NULL, base);
+ errno = 0;
+ } else {
+ int tval;
+ r = mpg_float();
+ tval = mpfr_strtofr(r->mpg_numbr, tokstart, NULL, base, ROUND_MODE);
+ errno = 0;
+ IEEE_FMT(r->mpg_numbr, tval);
+ }
+ yylval->memory = r;
+ return lasttok = YNUMBER;
+ }
+#endif
+ if (base != 10)
+ d = nondec2awknum(tokstart, strlen(tokstart));
+ else
+ d = atof(tokstart);
+ yylval->memory = make_number(d);
+ if (d <= INT32_MAX && d >= INT32_MIN && d == (int32_t) d)
+ yylval->memory->flags |= NUMINT;
return lasttok = YNUMBER;
case '&':
@@ -3450,7 +3577,7 @@ retry:
*/
if (! do_traditional && c == '_' && lasttok != '$') {
if ((c = nextc()) == '"') {
- intlstr = TRUE;
+ intlstr = true;
goto string;
}
pushback();
@@ -3471,7 +3598,7 @@ retry:
static int warntab[sizeof(tokentab) / sizeof(tokentab[0])];
int class = tokentab[mid].class;
- if ((class == LEX_INCLUDE || class == LEX_EVAL)
+ if ((class == LEX_INCLUDE || class == LEX_LOAD || class == LEX_EVAL)
&& lasttok != '@')
goto out;
@@ -3507,7 +3634,8 @@ retry:
switch (class) {
case LEX_INCLUDE:
- want_source = TRUE;
+ case LEX_LOAD:
+ want_source = true;
break;
case LEX_EVAL:
if (in_main_context())
@@ -3531,14 +3659,36 @@ retry:
case LEX_WHILE:
case LEX_DO:
case LEX_SWITCH:
- if (! do_profiling)
+ if (! do_pretty_print)
return lasttok = class;
/* fall through */
case LEX_CASE:
yylval = bcalloc(tokentab[mid].value, 2, sourceline);
break;
+ /*
+ * These must be checked here, due to the LALR nature of the parser,
+ * the rules for continue and break may not be reduced until after
+ * a token that increments the xxx_allowed varibles is seen. Bleah.
+ */
+ case LEX_CONTINUE:
+ if (! continue_allowed) {
+ error_ln(sourceline,
+ _("`continue' is not allowed outside a loop"));
+ errcount++;
+ }
+ goto make_instruction;
+
+ case LEX_BREAK:
+ if (! break_allowed) {
+ error_ln(sourceline,
+ _("`break' is not allowed outside a loop or switch"));
+ errcount++;
+ }
+ goto make_instruction;
+
default:
+make_instruction:
yylval = GET_INSTRUCTION(tokentab[mid].value);
if (class == LEX_BUILTIN || class == LEX_LENGTH)
yylval->builtin_idx = mid;
@@ -3553,7 +3703,7 @@ out:
yylval->lextok = tokkey;
return lasttok = FUNC_CALL;
} else {
- static short goto_warned = FALSE;
+ static bool goto_warned = false;
yylval = GET_INSTRUCTION(Op_token);
yylval->lextok = tokkey;
@@ -3561,7 +3711,7 @@ out:
#define SMART_ALECK 1
if (SMART_ALECK && do_lint
&& ! goto_warned && strcasecmp(tokkey, "goto") == 0) {
- goto_warned = TRUE;
+ goto_warned = true;
lintwarn(_("`goto' considered harmful!\n"));
}
return lasttok = NAME;
@@ -3571,23 +3721,6 @@ out:
#undef NEWLINE_EOF
}
-/* mk_symbol --- allocates a symbol for the symbol table. */
-
-NODE *
-mk_symbol(NODETYPE type, NODE *value)
-{
- NODE *r;
-
- getnode(r);
- r->type = type;
- r->flags = MALLOC;
- r->lnode = value;
- r->rnode = NULL;
- r->parent_array = NULL;
- r->var_assign = (Func_ptr) 0;
- return r;
-}
-
/* snode --- instructions for builtin functions. Checks for arg. count
and supplies defaults where possible. */
@@ -3639,7 +3772,7 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
INSTRUCTION *expr;
expr = list_create(instruction(Op_push_i));
- expr->nexti->memory = mk_number((AWKNUM) 0.0, (PERM|NUMCUR|NUMBER));
+ expr->nexti->memory = make_number(0.0);
(void) mk_expression_list(subn,
list_append(expr, instruction(Op_field_spec)));
}
@@ -3656,10 +3789,10 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
yyerror(_("%s third parameter is not a changeable object"),
operator);
else
- ip->do_reference = TRUE;
+ ip->do_reference = true;
}
- r->expr_count = count_expressions(&subn, FALSE);
+ r->expr_count = count_expressions(&subn, false);
ip = subn->lasti;
(void) list_append(subn, r);
@@ -3683,17 +3816,23 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
r->sub_flags |= GENSUB;
if (nexp == 3) {
ip = instruction(Op_push_i);
- ip->memory = mk_number((AWKNUM) 0.0, (PERM|NUMCUR|NUMBER));
+ ip->memory = make_number(0.0);
(void) mk_expression_list(subn,
list_append(list_create(ip), instruction(Op_field_spec)));
}
- r->expr_count = count_expressions(&subn, FALSE);
+ r->expr_count = count_expressions(&subn, false);
return list_append(subn, r);
}
}
- r->builtin = tokentab[idx].ptr;
+#ifdef HAVE_MPFR
+ /* N.B.: There isn't any special processing for an alternate function below */
+ if (do_mpfr && tokentab[idx].ptr2)
+ r->builtin = tokentab[idx].ptr2;
+ else
+#endif
+ r->builtin = tokentab[idx].ptr;
/* special case processing for a few builtins */
@@ -3706,7 +3845,7 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
list = list_create(r);
(void) list_prepend(list, instruction(Op_field_spec));
(void) list_prepend(list, instruction(Op_push_i));
- list->nexti->memory = mk_number((AWKNUM) 0.0, (PERM|NUMCUR|NUMBER));
+ list->nexti->memory = make_number(0.0);
return list;
} else {
arg = subn->nexti;
@@ -3718,14 +3857,14 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
if (arg->nexti == arg->lasti && arg->nexti->opcode == Op_push)
arg->nexti->opcode = Op_push_arg; /* argument may be array */
} else if (r->builtin == do_match) {
- static short warned = FALSE;
+ static bool warned = false;
arg = subn->nexti->lasti->nexti; /* 2nd arg list */
(void) mk_rexp(arg);
if (nexp == 3) { /* 3rd argument there */
if (do_lint && ! warned) {
- warned = TRUE;
+ warned = true;
lintwarn(_("match: third argument is a gawk extension"));
}
if (do_traditional) {
@@ -3779,10 +3918,10 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
ip->opcode = Op_push_array;
}
} else if (r->builtin == do_close) {
- static short warned = FALSE;
+ static bool warned = false;
if (nexp == 2) {
if (do_lint && ! warned) {
- warned = TRUE;
+ warned = true;
lintwarn(_("close: second argument is a gawk extension"));
}
if (do_traditional) {
@@ -3834,10 +3973,10 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
if (ip->opcode == Op_push)
ip->opcode = Op_push_array;
}
-#endif
+#endif
if (subn != NULL) {
- r->expr_count = count_expressions(&subn, FALSE);
+ r->expr_count = count_expressions(&subn, false);
return list_append(subn, r);
}
@@ -3845,75 +3984,6 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
return list_create(r);
}
-/* append_param --- append PNAME to the list of parameters
- * for the current function.
- */
-
-static void
-append_param(char *pname)
-{
- static NODE *savetail = NULL;
- NODE *p;
-
- p = make_param(pname);
- if (func_params == NULL) {
- func_params = p;
- savetail = p;
- } else if (savetail != NULL) {
- savetail->rnode = p;
- savetail = p;
- }
-}
-
-/* dup_parms --- return TRUE if there are duplicate parameters */
-
-static int
-dup_parms(INSTRUCTION *fp, NODE *func)
-{
- NODE *np;
- const char *fname, **names;
- int count, i, j, dups;
- NODE *params;
-
- if (func == NULL) /* error earlier */
- return TRUE;
-
- fname = func->param;
- count = func->param_cnt;
- params = func->rnode;
-
- if (count == 0) /* no args, no problem */
- return FALSE;
-
- if (params == NULL) /* error earlier */
- return TRUE;
-
- emalloc(names, const char **, count * sizeof(char *), "dup_parms");
-
- i = 0;
- for (np = params; np != NULL; np = np->rnode) {
- if (np->param == NULL) { /* error earlier, give up, go home */
- efree(names);
- return TRUE;
- }
- names[i++] = np->param;
- }
-
- dups = 0;
- for (i = 1; i < count; i++) {
- for (j = 0; j < i; j++) {
- if (strcmp(names[i], names[j]) == 0) {
- dups++;
- error_ln(fp->source_line,
- _("function `%s': parameter #%d, `%s', duplicates parameter #%d"),
- fname, i + 1, names[j], j+1);
- }
- }
- }
-
- efree(names);
- return (dups > 0 ? TRUE : FALSE);
-}
/* parms_shadow --- check if parameters shadow globals */
@@ -3921,19 +3991,20 @@ static int
parms_shadow(INSTRUCTION *pc, int *shadow)
{
int pcount, i;
- int ret = FALSE;
- NODE *func;
+ bool ret = false;
+ NODE *func, *fp;
char *fname;
func = pc->func_body;
- fname = func->lnode->param;
-
+ fname = func->vname;
+ fp = func->fparms;
+
#if 0 /* can't happen, already exited if error ? */
if (fname == NULL || func == NULL) /* error earlier */
- return FALSE;
+ return false;
#endif
- pcount = func->lnode->param_cnt;
+ pcount = func->param_cnt;
if (pcount == 0) /* no args, no problem */
return 0;
@@ -3945,11 +4016,11 @@ parms_shadow(INSTRUCTION *pc, int *shadow)
* about all shadowed parameters.
*/
for (i = 0; i < pcount; i++) {
- if (lookup(func->parmlist[i]) != NULL) {
+ if (lookup(fp[i].param) != NULL) {
warning(
_("function `%s': parameter `%s' shadows global variable"),
- fname, func->parmlist[i]);
- ret = TRUE;
+ fname, fp[i].param);
+ ret = true;
}
}
@@ -3957,143 +4028,41 @@ parms_shadow(INSTRUCTION *pc, int *shadow)
return 0;
}
-
-/*
- * install_symbol:
- * Install a name in the symbol table, even if it is already there.
- * Caller must check against redefinition if that is desired.
- */
-
-
-NODE *
-install_symbol(char *name, NODE *value)
-{
- NODE *hp;
- size_t len;
- int bucket;
-
- if (install_func)
- (*install_func)(name);
-
- var_count++;
- len = strlen(name);
- bucket = hash(name, len, (unsigned long) HASHSIZE, NULL);
- getnode(hp);
- hp->type = Node_hashnode;
- hp->hnext = variables[bucket];
- variables[bucket] = hp;
- hp->hlength = len;
- hp->hvalue = value;
- hp->hname = name;
- hp->hvalue->vname = name;
- return hp->hvalue;
-}
-
-/* lookup --- find the most recent hash node for name installed by install_symbol */
-
-NODE *
-lookup(const char *name)
-{
- NODE *bucket;
- size_t len;
-
- len = strlen(name);
- for (bucket = variables[hash(name, len, (unsigned long) HASHSIZE, NULL)];
- bucket != NULL; bucket = bucket->hnext)
- if (bucket->hlength == len && strncmp(bucket->hname, name, len) == 0)
- return bucket->hvalue;
- return NULL;
-}
-
-/* sym_comp --- compare two symbol (variable or function) names */
-
-static int
-sym_comp(const void *v1, const void *v2)
-{
- const NODE *const *npp1, *const *npp2;
- const NODE *n1, *n2;
- int minlen;
-
- npp1 = (const NODE *const *) v1;
- npp2 = (const NODE *const *) v2;
- n1 = *npp1;
- n2 = *npp2;
-
- if (n1->hlength > n2->hlength)
- minlen = n1->hlength;
- else
- minlen = n2->hlength;
-
- return strncmp(n1->hname, n2->hname, minlen);
-}
-
/* valinfo --- dump var info */
void
-valinfo(NODE *n, int (*print_func)(FILE *, const char *, ...), FILE *fp)
+valinfo(NODE *n, Func_print print_func, FILE *fp)
{
if (n == Nnull_string)
print_func(fp, "uninitialized scalar\n");
else if (n->flags & STRING) {
- pp_string_fp(print_func, fp, n->stptr, n->stlen, '"', FALSE);
+ pp_string_fp(print_func, fp, n->stptr, n->stlen, '"', false);
print_func(fp, "\n");
- } else if (n->flags & NUMBER)
+ } else if (n->flags & NUMBER) {
+#ifdef HAVE_MPFR
+ if (is_mpg_float(n))
+ print_func(fp, "%s\n", mpg_fmt("%.17R*g", ROUND_MODE, n->mpg_numbr));
+ else if (is_mpg_integer(n))
+ print_func(fp, "%s\n", mpg_fmt("%Zd", n->mpg_i));
+ else
+#endif
print_func(fp, "%.17g\n", n->numbr);
- else if (n->flags & STRCUR) {
- pp_string_fp(print_func, fp, n->stptr, n->stlen, '"', FALSE);
+ } else if (n->flags & STRCUR) {
+ pp_string_fp(print_func, fp, n->stptr, n->stlen, '"', false);
print_func(fp, "\n");
- } else if (n->flags & NUMCUR)
+ } else if (n->flags & NUMCUR) {
+#ifdef HAVE_MPFR
+ if (is_mpg_float(n))
+ print_func(fp, "%s\n", mpg_fmt("%.17R*g", ROUND_MODE, n->mpg_numbr));
+ else if (is_mpg_integer(n))
+ print_func(fp, "%s\n", mpg_fmt("%Zd", n->mpg_i));
+ else
+#endif
print_func(fp, "%.17g\n", n->numbr);
- else
+ } else
print_func(fp, "?? flags %s\n", flags2str(n->flags));
}
-/* get_varlist --- list of global variables */
-
-NODE **
-get_varlist()
-{
- int i, j;
- NODE **table;
- NODE *p;
-
- emalloc(table, NODE **, (var_count + 1) * sizeof(NODE *), "get_varlist");
- update_global_values();
- for (i = j = 0; i < HASHSIZE; i++)
- for (p = variables[i]; p != NULL; p = p->hnext)
- table[j++] = p;
- assert(j == var_count);
-
- /* Shazzam! */
- qsort(table, j, sizeof(NODE *), sym_comp);
-
- table[j] = NULL;
- return table;
-}
-
-/* print_vars --- print names and values of global variables */
-
-void
-print_vars(int (*print_func)(FILE *, const char *, ...), FILE *fp)
-{
- int i;
- NODE **table;
- NODE *p;
-
- table = get_varlist();
- for (i = 0; (p = table[i]) != NULL; i++) {
- if (p->hvalue->type == Node_func)
- continue;
- print_func(fp, "%.*s: ", (int) p->hlength, p->hname);
- if (p->hvalue->type == Node_var_array)
- print_func(fp, "array, %ld elements\n", p->hvalue->table_size);
- else if (p->hvalue->type == Node_var_new)
- print_func(fp, "untyped variable\n");
- else if (p->hvalue->type == Node_var)
- valinfo(p->hvalue->var_value, print_func, fp);
- }
- efree(table);
-}
/* dump_vars --- dump the symbol table */
@@ -4101,6 +4070,7 @@ void
dump_vars(const char *fname)
{
FILE *fp;
+ NODE **vars;
if (fname == NULL)
fp = stderr;
@@ -4110,228 +4080,195 @@ dump_vars(const char *fname)
fp = stderr;
}
- print_vars(fprintf, fp);
+ vars = variable_list();
+ print_vars(vars, fprintf, fp);
+ efree(vars);
if (fp != stderr && fclose(fp) != 0)
warning(_("%s: close failed (%s)"), fname, strerror(errno));
}
-/* release_all_vars --- free all variable memory */
-
-void
-release_all_vars()
-{
- int i;
- NODE *p, *next;
-
- for (i = 0; i < HASHSIZE; i++) {
- for (p = variables[i]; p != NULL; p = next) {
- next = p->hnext;
-
- if (p->hvalue->type == Node_func)
- continue;
- else if (p->hvalue->type == Node_var_array)
- assoc_clear(p->hvalue);
- else if (p->hvalue->type != Node_var_new)
- unref(p->hvalue->var_value);
-
- efree(p->hname);
- freenode(p->hvalue);
- freenode(p);
- }
- }
-}
-
/* dump_funcs --- print all functions */
void
dump_funcs()
{
- if (func_count <= 0)
- return;
-
- (void) foreach_func((int (*)(INSTRUCTION *, void *)) pp_func, TRUE, (void *) 0);
+ NODE **funcs;
+ funcs = function_list(true);
+ (void) foreach_func(funcs, (int (*)(INSTRUCTION *, void *)) pp_func, (void *) 0);
+ efree(funcs);
}
+
/* shadow_funcs --- check all functions for parameters that shadow globals */
void
shadow_funcs()
{
static int calls = 0;
- int shadow = FALSE;
-
- if (func_count <= 0)
- return;
+ bool shadow = false;
+ NODE **funcs;
if (calls++ != 0)
fatal(_("shadow_funcs() called twice!"));
- (void) foreach_func((int (*)(INSTRUCTION *, void *)) parms_shadow, TRUE, &shadow);
+ funcs = function_list(true);
+ (void) foreach_func(funcs, (int (*)(INSTRUCTION *, void *)) parms_shadow, & shadow);
+ efree(funcs);
/* End with fatal if the user requested it. */
if (shadow && lintfunc != warning)
lintwarn(_("there were shadowed variables."));
}
-/*
- * func_install:
- * check if name is already installed; if so, it had better have Null value,
- * in which case def is added as the value. Otherwise, install name with def
- * as value.
- *
- * Extra work, build up and save a list of the parameter names in a table
- * and hang it off params->parmlist. This is used to set the `vname' field
- * of each function parameter during a function call. See eval.c.
+
+/* mk_function --- finalize function definition node; remove parameters
+ * out of the symbol table.
*/
-static int
-func_install(INSTRUCTION *func, INSTRUCTION *def)
+static INSTRUCTION *
+mk_function(INSTRUCTION *fi, INSTRUCTION *def)
{
- NODE *params;
- NODE *r, *n, *thisfunc, *hp;
- char **pnames = NULL;
- char *fname;
- int pcount = 0;
- int i;
+ NODE *thisfunc;
- params = func_params;
+ thisfunc = fi->func_body;
+ assert(thisfunc != NULL);
- /* check for function foo(foo) { ... }. bleah. */
- for (n = params->rnode; n != NULL; n = n->rnode) {
- if (strcmp(n->param, params->param) == 0) {
- error_ln(func->source_line,
- _("function `%s': can't use function name as parameter name"), params->param);
- return -1;
- } else if (is_std_var(n->param)) {
- error_ln(func->source_line,
- _("function `%s': can't use special variable `%s' as a function parameter"),
- params->param, n->param);
- return -1;
- }
- }
+ if (do_optimize > 1 && def->lasti->opcode == Op_pop) {
+ /* tail call which does not return any value. */
- thisfunc = NULL; /* turn off warnings */
+ INSTRUCTION *t;
- fname = params->param;
- /* symbol table management */
- hp = remove_symbol(params->param); /* remove function name out of symbol table */
- if (hp != NULL)
- freenode(hp);
- r = lookup(fname);
- if (r != NULL) {
- error_ln(func->source_line,
- _("function name `%s' previously defined"), fname);
- return -1;
- } else if (fname == builtin_func) /* not a valid function name */
- goto remove_params;
+ for (t = def->nexti; t->nexti != def->lasti; t = t->nexti)
+ ;
+ if (t->opcode == Op_func_call
+ && strcmp(t->func_name, thisfunc->vname) == 0)
+ (t + 1)->tail_call = true;
+ }
/* add an implicit return at end;
* also used by 'return' command in debugger
*/
-
+
(void) list_append(def, instruction(Op_push_i));
- def->lasti->memory = Nnull_string;
+ def->lasti->memory = dupnode(Nnull_string);
(void) list_append(def, instruction(Op_K_return));
- if (do_profiling)
+ if (do_pretty_print)
(void) list_prepend(def, instruction(Op_exec_count));
- /* func->opcode is Op_func */
- (func + 1)->firsti = def->nexti;
- (func + 1)->lasti = def->lasti;
- (func + 2)->first_line = func->source_line;
- (func + 2)->last_line = lastline;
-
- func->nexti = def->nexti;
+ /* fi->opcode = Op_func */
+ (fi + 1)->firsti = def->nexti;
+ (fi + 1)->lasti = def->lasti;
+ (fi + 2)->first_line = fi->source_line;
+ (fi + 2)->last_line = lastline;
+ fi->nexti = def->nexti;
bcfree(def);
- (void) list_append(rule_list, func + 1); /* debugging */
-
- /* install the function */
- thisfunc = mk_symbol(Node_func, params);
- (void) install_symbol(fname, thisfunc);
- thisfunc->code_ptr = func;
- func->func_body = thisfunc;
-
- for (n = params->rnode; n != NULL; n = n->rnode)
- pcount++;
-
- if (pcount != 0) {
- emalloc(pnames, char **, (pcount + 1) * sizeof(char *), "func_install");
- for (i = 0, n = params->rnode; i < pcount; i++, n = n->rnode)
- pnames[i] = n->param;
- pnames[pcount] = NULL;
- }
- thisfunc->parmlist = pnames;
+ (void) list_append(rule_list, fi + 1); /* debugging */
/* update lint table info */
- func_use(fname, FUNC_DEFINE);
+ func_use(thisfunc->vname, FUNC_DEFINE);
- func_count++; /* used in profiler / pretty printer */
-
-remove_params:
/* remove params from symbol table */
- pop_params(params->rnode);
- return 0;
+ remove_params(thisfunc);
+ return fi;
}
-/* remove_symbol --- remove a variable from the symbol table */
+/*
+ * install_function:
+ * install function name in the symbol table.
+ * Extra work, build up and install a list of the parameter names.
+ */
-NODE *
-remove_symbol(char *name)
+static int
+install_function(char *fname, INSTRUCTION *fi, INSTRUCTION *plist)
{
- NODE *bucket, **save;
- size_t len;
+ NODE *r, *f;
+ int pcount = 0;
- len = strlen(name);
- save = &(variables[hash(name, len, (unsigned long) HASHSIZE, NULL)]);
- for (bucket = *save; bucket != NULL; bucket = bucket->hnext) {
- if (len == bucket->hlength && strncmp(bucket->hname, name, len) == 0) {
- var_count--;
- *save = bucket->hnext;
- return bucket;
- }
- save = &(bucket->hnext);
+ r = lookup(fname);
+ if (r != NULL) {
+ error_ln(fi->source_line, _("function name `%s' previously defined"), fname);
+ return -1;
}
- return NULL;
+
+ if (plist != NULL)
+ pcount = plist->lasti->param_count + 1;
+ f = install_symbol(fname, Node_func);
+ fi->func_body = f;
+ f->param_cnt = pcount;
+ f->code_ptr = fi;
+ f->fparms = NULL;
+ if (pcount > 0) {
+ char **pnames;
+ pnames = check_params(fname, pcount, plist); /* frees plist */
+ f->fparms = make_params(pnames, pcount);
+ efree(pnames);
+ install_params(f);
+ }
+ return 0;
}
-/* pop_params --- remove list of function parameters from symbol table */
-/*
- * pop parameters out of the symbol table. do this in reverse order to
- * avoid reading freed memory if there were duplicated parameters.
+/* check_params --- build a list of function parameter names after
+ * making sure that the names are valid and there are no duplicates.
*/
-static void
-pop_params(NODE *params)
+
+static char **
+check_params(char *fname, int pcount, INSTRUCTION *list)
{
- NODE *hp;
- if (params == NULL)
- return;
- pop_params(params->rnode);
- hp = remove_symbol(params->param);
- if (hp != NULL)
- freenode(hp);
-}
+ INSTRUCTION *p, *np;
+ int i, j;
+ char *name;
+ char **pnames;
-/* make_param --- make NAME into a function parameter */
+ assert(pcount > 0);
-static NODE *
-make_param(char *name)
-{
- NODE *r;
+ emalloc(pnames, char **, pcount * sizeof(char *), "check_params");
+
+ for (i = 0, p = list->nexti; p != NULL; i++, p = np) {
+ np = p->nexti;
+ name = p->lextok;
+ p->lextok = NULL;
+
+ if (strcmp(name, fname) == 0) {
+ /* check for function foo(foo) { ... }. bleah. */
+ error_ln(p->source_line,
+ _("function `%s': can't use function name as parameter name"), fname);
+ } else if (is_std_var(name)) {
+ error_ln(p->source_line,
+ _("function `%s': can't use special variable `%s' as a function parameter"),
+ fname, name);
+ }
+
+ /* check for duplicate parameters */
+ for (j = 0; j < i; j++) {
+ if (strcmp(name, pnames[j]) == 0) {
+ error_ln(p->source_line,
+ _("function `%s': parameter #%d, `%s', duplicates parameter #%d"),
+ fname, i + 1, name, j + 1);
+ }
+ }
+
+ pnames[i] = name;
+ bcfree(p);
+ }
+ bcfree(list);
- getnode(r);
- r->type = Node_param_list;
- r->rnode = NULL;
- r->param_cnt = param_counter++;
- return (install_symbol(name, r));
+ return pnames;
}
+
+#ifdef HASHSIZE
+undef HASHSIZE
+#endif
+#define HASHSIZE 1021
+
static struct fdesc {
char *name;
short used;
short defined;
+ short extension;
struct fdesc *next;
} *ftable[HASHSIZE];
@@ -4351,7 +4288,10 @@ func_use(const char *name, enum defref how)
if (strcmp(fp->name, name) == 0) {
if (how == FUNC_DEFINE)
fp->defined++;
- else
+ else if (how == FUNC_EXT) {
+ fp->defined++;
+ fp->extension++;
+ } else
fp->used++;
return;
}
@@ -4365,12 +4305,23 @@ func_use(const char *name, enum defref how)
strcpy(fp->name, name);
if (how == FUNC_DEFINE)
fp->defined++;
- else
+ else if (how == FUNC_EXT) {
+ fp->defined++;
+ fp->extension++;
+ } else
fp->used++;
fp->next = ftable[ind];
ftable[ind] = fp;
}
+/* track_ext_func --- add an extension function to the table */
+
+void
+track_ext_func(const char *name)
+{
+ func_use(name, FUNC_EXT);
+}
+
/* check_funcs --- verify functions that are called but not defined */
static void
@@ -4384,19 +4335,19 @@ check_funcs()
for (i = 0; i < HASHSIZE; i++) {
for (fp = ftable[i]; fp != NULL; fp = fp->next) {
+ if (fp->defined == 0 && ! fp->extension) {
#ifdef REALLYMEAN
- /* making this the default breaks old code. sigh. */
- if (fp->defined == 0) {
+ /* making this the default breaks old code. sigh. */
error(
_("function `%s' called but never defined"), fp->name);
errcount++;
- }
#else
- if (do_lint && fp->defined == 0)
lintwarn(
_("function `%s' called but never defined"), fp->name);
#endif
- if (do_lint && fp->used == 0) {
+ }
+
+ if (do_lint && fp->used == 0 && ! fp->extension) {
lintwarn(_("function `%s' defined but never called directly"),
fp->name);
}
@@ -4435,69 +4386,6 @@ param_sanity(INSTRUCTION *arglist)
}
}
-/* foreach_func --- execute given function for each awk function in symbol table. */
-
-int
-foreach_func(int (*pfunc)(INSTRUCTION *, void *), int sort, void *data)
-{
- int i, j;
- NODE *p;
- int ret = 0;
-
- if (sort) {
- NODE **tab;
-
- /*
- * Walk through symbol table counting functions.
- * Could be more than func_count if there are
- * extension functions.
- */
- for (i = j = 0; i < HASHSIZE; i++) {
- for (p = variables[i]; p != NULL; p = p->hnext) {
- if (p->hvalue->type == Node_func) {
- j++;
- }
- }
- }
-
- if (j == 0)
- return 0;
-
- emalloc(tab, NODE **, j * sizeof(NODE *), "foreach_func");
-
- /* now walk again, copying info */
- for (i = j = 0; i < HASHSIZE; i++) {
- for (p = variables[i]; p != NULL; p = p->hnext) {
- if (p->hvalue->type == Node_func) {
- tab[j] = p;
- j++;
- }
- }
- }
-
- /* Shazzam! */
- qsort(tab, j, sizeof(NODE *), sym_comp);
-
- for (i = 0; i < j; i++) {
- if ((ret = pfunc(tab[i]->hvalue->code_ptr, data)) != 0)
- break;
- }
-
- efree(tab);
- return ret;
- }
-
- /* unsorted */
- for (i = 0; i < HASHSIZE; i++) {
- for (p = variables[i]; p != NULL; p = p->hnext) {
- if (p->hvalue->type == Node_func
- && (ret = pfunc(p->hvalue->code_ptr, data)) != 0)
- return ret;
- }
- }
- return 0;
-}
-
/* deferred variables --- those that are only defined if needed. */
/*
@@ -4532,31 +4420,26 @@ register_deferred_variable(const char *name, NODE *(*load_func)(void))
/* variable --- make sure NAME is in the symbol table */
NODE *
-variable(char *name, NODETYPE type)
+variable(int location, char *name, NODETYPE type)
{
NODE *r;
if ((r = lookup(name)) != NULL) {
- if (r->type == Node_func) {
- error(_("function `%s' called with space between name and `(',\nor used as a variable or an array"),
+ if (r->type == Node_func || r->type == Node_ext_func )
+ error_ln(location, _("function `%s' called with space between name and `(',\nor used as a variable or an array"),
r->vname);
- errcount++;
- r->type = Node_var_new; /* continue parsing instead of exiting */
- }
+ if (r == symbol_table)
+ symtab_used = true;
} else {
/* not found */
struct deferred_variable *dv;
- for (dv = deferred_variables; TRUE; dv = dv->next) {
+ for (dv = deferred_variables; true; dv = dv->next) {
if (dv == NULL) {
- /*
- * This is the only case in which we may not free the string.
- */
- if (type == Node_var)
- r = mk_symbol(type, Nnull_string);
- else
- r = mk_symbol(type, (NODE *) NULL);
- return install_symbol(name, r);
+ /*
+ * This is the only case in which we may not free the string.
+ */
+ return install_symbol(name, type);
}
if (strcmp(name, dv->name) == 0) {
r = (*dv->load_func)();
@@ -4568,6 +4451,21 @@ variable(char *name, NODETYPE type)
return r;
}
+/* process_deferred --- if the program uses SYMTAB, load deferred variables */
+
+static void
+process_deferred()
+{
+ struct deferred_variable *dv;
+
+ if (! symtab_used)
+ return;
+
+ for (dv = deferred_variables; dv != NULL; dv = dv->next) {
+ (void) dv->load_func();
+ }
+}
+
/* make_regnode --- make a regular expression node */
static NODE *
@@ -4581,7 +4479,7 @@ make_regnode(int type, NODE *exp)
n->re_cnt = 1;
if (type == Node_regex) {
- n->re_reg = make_regexp(exp->stptr, exp->stlen, FALSE, TRUE, FALSE);
+ n->re_reg = make_regexp(exp->stptr, exp->stlen, false, true, false);
if (n->re_reg == NULL) {
freenode(n);
return NULL;
@@ -4648,12 +4546,12 @@ isnoeffect(OPCODE type)
case Op_match_rec:
case Op_not:
case Op_in_array:
- return TRUE;
+ return true;
default:
break; /* keeps gcc -Wall happy */
}
- return FALSE;
+ return false;
}
/* make_assignable --- make this operand an assignable one if posiible */
@@ -4663,9 +4561,6 @@ make_assignable(INSTRUCTION *ip)
{
switch (ip->opcode) {
case Op_push:
- if (ip->memory->type == Node_param_list
- && (ip->memory->flags & FUNC) != 0)
- return NULL;
ip->opcode = Op_push_lhs;
return ip;
case Op_field_spec:
@@ -4685,7 +4580,7 @@ make_assignable(INSTRUCTION *ip)
NODE *
stopme(int nargs ATTRIBUTE_UNUSED)
{
- return (NODE *) 0;
+ return make_number(0.0);
}
/* dumpintlstr --- write out an initial .po file entry for the string */
@@ -4705,7 +4600,7 @@ dumpintlstr(const char *str, size_t len)
}
printf("msgid ");
- pp_string_fp(fprintf, stdout, str, len, '"', TRUE);
+ pp_string_fp(fprintf, stdout, str, len, '"', true);
putchar('\n');
printf("msgstr \"\"\n\n");
fflush(stdout);
@@ -4728,36 +4623,15 @@ dumpintlstr2(const char *str1, size_t len1, const char *str2, size_t len2)
}
printf("msgid ");
- pp_string_fp(fprintf, stdout, str1, len1, '"', TRUE);
+ pp_string_fp(fprintf, stdout, str1, len1, '"', true);
putchar('\n');
printf("msgid_plural ");
- pp_string_fp(fprintf, stdout, str2, len2, '"', TRUE);
+ pp_string_fp(fprintf, stdout, str2, len2, '"', true);
putchar('\n');
printf("msgstr[0] \"\"\nmsgstr[1] \"\"\n\n");
fflush(stdout);
}
-/* isarray --- can this type be subscripted? */
-
-static int
-isarray(NODE *n)
-{
- switch (n->type) {
- case Node_var_new:
- case Node_var_array:
- return TRUE;
- case Node_param_list:
- return (n->flags & FUNC) == 0;
- case Node_array_ref:
- cant_happen();
- break;
- default:
- break; /* keeps gcc -Wall happy */
- }
-
- return FALSE;
-}
-
/* mk_binary --- instructions for binary operators */
static INSTRUCTION *
@@ -4772,11 +4646,11 @@ mk_binary(INSTRUCTION *s1, INSTRUCTION *s2, INSTRUCTION *op)
ip1 = s1->nexti;
if (do_optimize > 1
&& ip1 == s1->lasti && ip1->opcode == Op_push_i
- && (ip1->memory->flags & (STRCUR|STRING)) == 0
- && (ip2->memory->flags & (STRCUR|STRING)) == 0
+ && (ip1->memory->flags & (MPFN|MPZN|STRCUR|STRING)) == 0
+ && (ip2->memory->flags & (MPFN|MPZN|STRCUR|STRING)) == 0
) {
NODE *n1 = ip1->memory, *n2 = ip2->memory;
- res = force_number(n1);
+ res = force_number(n1)->numbr;
(void) force_number(n2);
switch (op->opcode) {
case Op_times:
@@ -4818,11 +4692,7 @@ mk_binary(INSTRUCTION *s1, INSTRUCTION *s2, INSTRUCTION *op)
}
op->opcode = Op_push_i;
- op->memory = mk_number(res, (PERM|NUMCUR|NUMBER));
- n1->flags &= ~PERM;
- n1->flags |= MALLOC;
- n2->flags &= ~PERM;
- n2->flags |= MALLOC;
+ op->memory = make_number(res);
unref(n1);
unref(n2);
bcfree(ip1);
@@ -4948,7 +4818,7 @@ mk_condition(INSTRUCTION *cond, INSTRUCTION *ifp, INSTRUCTION *true_branch,
if (false_branch == NULL) {
false_branch = list_create(instruction(Op_no_op));
if (elsep != NULL) { /* else { } */
- if (do_profiling)
+ if (do_pretty_print)
(void) list_prepend(false_branch, elsep);
else
bcfree(elsep);
@@ -4959,7 +4829,7 @@ mk_condition(INSTRUCTION *cond, INSTRUCTION *ifp, INSTRUCTION *true_branch,
/* avoid a series of no_op's: if .. else if .. else if .. */
if (false_branch->lasti->opcode != Op_no_op)
(void) list_append(false_branch, instruction(Op_no_op));
- if (do_profiling) {
+ if (do_pretty_print) {
(void) list_prepend(false_branch, elsep);
false_branch->nexti->branch_end = false_branch->lasti;
(void) list_prepend(false_branch, instruction(Op_exec_count));
@@ -4974,7 +4844,7 @@ mk_condition(INSTRUCTION *cond, INSTRUCTION *ifp, INSTRUCTION *true_branch,
ip = list_append(cond, instruction(Op_jmp_false));
ip->lasti->target_jmp = false_branch->nexti->nexti;
- if (do_profiling) {
+ if (do_pretty_print) {
(void) list_prepend(ip, ifp);
(void) list_append(ip, instruction(Op_exec_count));
ip->nexti->branch_if = ip->lasti;
@@ -5036,7 +4906,7 @@ append_rule(INSTRUCTION *pattern, INSTRUCTION *action)
if (rule != Rule) {
rp = pattern;
- if (do_profiling)
+ if (do_pretty_print)
(void) list_append(action, instruction(Op_no_op));
(rp + 1)->firsti = action->nexti;
(rp + 1)->lasti = action->lasti;
@@ -5052,7 +4922,7 @@ append_rule(INSTRUCTION *pattern, INSTRUCTION *action)
if (pattern == NULL) {
/* assert(action != NULL); */
- if (do_profiling)
+ if (do_pretty_print)
(void) list_prepend(action, instruction(Op_exec_count));
(rp + 1)->firsti = action->nexti;
(rp + 1)->lasti = tp;
@@ -5068,12 +4938,12 @@ append_rule(INSTRUCTION *pattern, INSTRUCTION *action)
if (action == NULL) {
(rp + 2)->last_line = find_line(pattern, LAST_LINE);
action = list_create(instruction(Op_K_print_rec));
- if (do_profiling)
+ if (do_pretty_print)
(void) list_prepend(action, instruction(Op_exec_count));
} else
(rp + 2)->last_line = lastline;
- if (do_profiling) {
+ if (do_pretty_print) {
(void) list_prepend(pattern, instruction(Op_exec_count));
(void) list_prepend(action, instruction(Op_exec_count));
}
@@ -5134,7 +5004,7 @@ mk_assignment(INSTRUCTION *lhs, INSTRUCTION *rhs, INSTRUCTION *op)
&& tp->memory->type == Node_var
&& tp->memory->var_assign
) {
- tp->do_reference = FALSE; /* no uninitialized reference checking
+ tp->do_reference = false; /* no uninitialized reference checking
* for a special variable.
*/
(void) list_append(ip, instruction(Op_var_assign));
@@ -5153,9 +5023,7 @@ mk_assignment(INSTRUCTION *lhs, INSTRUCTION *rhs, INSTRUCTION *op)
static INSTRUCTION *
optimize_assignment(INSTRUCTION *exp)
{
- INSTRUCTION *i1;
- INSTRUCTION *i2;
- INSTRUCTION *i3;
+ INSTRUCTION *i1, *i2, *i3;
/*
* Optimize assignment statements array[subs] = x; var = x; $n = x;
@@ -5191,7 +5059,7 @@ optimize_assignment(INSTRUCTION *exp)
if ( ! do_optimize
|| ( i1->opcode != Op_assign
&& i1->opcode != Op_field_assign)
- )
+ )
return list_append(exp, instruction(Op_pop));
for (i2 = exp->nexti; i2 != i1; i2 = i2->nexti) {
@@ -5276,13 +5144,26 @@ optimize_assignment(INSTRUCTION *exp)
case Op_push_lhs:
if (i2->nexti == i1
- && i1->opcode == Op_assign
+ && i1->opcode == Op_assign
) {
/* var = .. */
i2->opcode = Op_store_var;
i2->nexti = NULL;
bcfree(i1); /* Op_assign */
exp->lasti = i2; /* update Op_list */
+
+ i3 = exp->nexti;
+ if (i3->opcode == Op_push_i
+ && (i3->memory->flags & INTLSTR) == 0
+ && i3->nexti == i2
+ ) {
+ /* constant initializer */
+ i2->initval = i3->memory;
+ bcfree(i3);
+ exp->nexti = i2;
+ } else
+ i2->initval = NULL;
+
return exp;
}
break;
@@ -5352,7 +5233,7 @@ mk_getline(INSTRUCTION *op, INSTRUCTION *var, INSTRUCTION *redir, int redirtype)
else
ip = list_create(op);
op->into_var = (var != NULL);
- op->redir_type = (redir != NULL) ? redirtype : 0;
+ op->redir_type = (redir != NULL) ? redirtype : redirect_none;
return (asgn == NULL ? ip : list_append(ip, asgn));
}
@@ -5403,7 +5284,7 @@ mk_for_loop(INSTRUCTION *forp, INSTRUCTION *init, INSTRUCTION *cond,
if (init != NULL)
ip = list_merge(init, ip);
- if (do_profiling) {
+ if (do_pretty_print) {
(void) list_append(ip, instruction(Op_exec_count));
(forp + 1)->forloop_cond = pp_cond;
(forp + 1)->forloop_body = ip->lasti;
@@ -5425,7 +5306,7 @@ mk_for_loop(INSTRUCTION *forp, INSTRUCTION *init, INSTRUCTION *cond,
ret = list_append(ip, tbreak);
fix_break_continue(ret, tbreak, tcont);
- if (do_profiling) {
+ if (do_pretty_print) {
forp->target_break = tbreak;
forp->target_continue = tcont;
ret = list_prepend(ret, forp);
@@ -5526,7 +5407,7 @@ mk_expression_list(INSTRUCTION *list, INSTRUCTION *s1)
*/
static int
-count_expressions(INSTRUCTION **list, int isarg)
+count_expressions(INSTRUCTION **list, bool isarg)
{
INSTRUCTION *expr;
INSTRUCTION *r = NULL;
@@ -5584,320 +5465,6 @@ fix_break_continue(INSTRUCTION *list, INSTRUCTION *b_target, INSTRUCTION *c_targ
}
}
-
-/* append_symbol --- append symbol to the list of symbols
- * installed in the symbol table.
- */
-
-void
-append_symbol(char *name)
-{
- NODE *hp;
-
- /* N.B.: func_install removes func name and reinstalls it;
- * and we get two entries for it here!. destroy_symbol()
- * will find and destroy the Node_func which is what we want.
- */
-
- getnode(hp);
- hp->hname = name; /* shallow copy */
- hp->hnext = symbol_list->hnext;
- symbol_list->hnext = hp;
-}
-
-/* release_symbol --- free symbol list and optionally remove symbol from symbol table */
-
-void
-release_symbols(NODE *symlist, int keep_globals)
-{
- NODE *hp, *n;
-
- for (hp = symlist->hnext; hp != NULL; hp = n) {
- if (! keep_globals) {
- /* destroys globals, function, and params
- * if still in symbol table and not removed by func_install
- * due to parse error.
- */
- destroy_symbol(hp->hname);
- }
- n = hp->hnext;
- freenode(hp);
- }
- symlist->hnext = NULL;
-}
-
-/* destroy_symbol --- remove a symbol from symbol table
-* and free all associated memory.
-*/
-
-void
-destroy_symbol(char *name)
-{
- NODE *symbol, *hp;
-
- symbol = lookup(name);
- if (symbol == NULL)
- return;
-
- if (symbol->type == Node_func) {
- char **varnames;
- NODE *func, *n;
-
- func = symbol;
- varnames = func->parmlist;
- if (varnames != NULL)
- efree(varnames);
-
- /* function parameters of type Node_param_list */
- for (n = func->lnode->rnode; n != NULL; ) {
- NODE *np;
- np = n->rnode;
- efree(n->param);
- freenode(n);
- n = np;
- }
- freenode(func->lnode);
- func_count--;
-
- } else if (symbol->type == Node_var_array)
- assoc_clear(symbol);
- else if (symbol->type == Node_var)
- unref(symbol->var_value);
-
- /* remove from symbol table */
- hp = remove_symbol(name);
- efree(hp->hname);
- freenode(hp->hvalue);
- freenode(hp);
-}
-
-#define pool_size d.dl
-#define freei x.xi
-static INSTRUCTION *pool_list;
-static AWK_CONTEXT *curr_ctxt = NULL;
-
-/* new_context --- create a new execution context. */
-
-AWK_CONTEXT *
-new_context()
-{
- AWK_CONTEXT *ctxt;
-
- emalloc(ctxt, AWK_CONTEXT *, sizeof(AWK_CONTEXT), "new_context");
- memset(ctxt, 0, sizeof(AWK_CONTEXT));
- ctxt->srcfiles.next = ctxt->srcfiles.prev = &ctxt->srcfiles;
- ctxt->rule_list.opcode = Op_list;
- ctxt->rule_list.lasti = &ctxt->rule_list;
- return ctxt;
-}
-
-/* set_context --- change current execution context. */
-
-static void
-set_context(AWK_CONTEXT *ctxt)
-{
- pool_list = &ctxt->pools;
- symbol_list = &ctxt->symbols;
- srcfiles = &ctxt->srcfiles;
- rule_list = &ctxt->rule_list;
- install_func = ctxt->install_func;
- curr_ctxt = ctxt;
-}
-
-/*
- * push_context:
- *
- * Switch to the given context after saving the current one. The set
- * of active execution contexts forms a stack; the global or main context
- * is at the bottom of the stack.
- */
-
-void
-push_context(AWK_CONTEXT *ctxt)
-{
- ctxt->prev = curr_ctxt;
- /* save current source and sourceline */
- if (curr_ctxt != NULL) {
- curr_ctxt->sourceline = sourceline;
- curr_ctxt->source = source;
- }
- sourceline = 0;
- source = NULL;
- set_context(ctxt);
-}
-
-/* pop_context --- switch to previous execution context. */
-
-void
-pop_context()
-{
- AWK_CONTEXT *ctxt;
-
- assert(curr_ctxt != NULL);
- ctxt = curr_ctxt->prev;
- /* restore source and sourceline */
- sourceline = ctxt->sourceline;
- source = ctxt->source;
- set_context(ctxt);
-}
-
-/* in_main_context --- are we in the main context ? */
-
-int
-in_main_context()
-{
- assert(curr_ctxt != NULL);
- return (curr_ctxt->prev == NULL);
-}
-
-/* free_context --- free context structure and related data. */
-
-void
-free_context(AWK_CONTEXT *ctxt, int keep_globals)
-{
- SRCFILE *s, *sn;
-
- if (ctxt == NULL)
- return;
-
- assert(curr_ctxt != ctxt);
-
- /* free all code including function codes */
- free_bcpool(&ctxt->pools);
- /* free symbols */
- release_symbols(&ctxt->symbols, keep_globals);
- /* free srcfiles */
- for (s = &ctxt->srcfiles; s != &ctxt->srcfiles; s = sn) {
- sn = s->next;
- if (s->stype != SRC_CMDLINE && s->stype != SRC_STDIN)
- efree(s->fullpath);
- efree(s->src);
- efree(s);
- }
- efree(ctxt);
-}
-
-/* free_bc_internal --- free internal memory of an instruction. */
-
-static void
-free_bc_internal(INSTRUCTION *cp)
-{
- NODE *m;
-
- switch(cp->opcode) {
- case Op_func_call:
- if (cp->func_name != NULL
- && cp->func_name != builtin_func
- )
- efree(cp->func_name);
- break;
- case Op_push_re:
- case Op_match_rec:
- case Op_match:
- case Op_nomatch:
- m = cp->memory;
- if (m->re_reg != NULL)
- refree(m->re_reg);
- if (m->re_exp != NULL)
- unref(m->re_exp);
- if (m->re_text != NULL)
- unref(m->re_text);
- freenode(m);
- break;
- case Op_token: /* token lost during error recovery in yyparse */
- if (cp->lextok != NULL)
- efree(cp->lextok);
- break;
- case Op_illegal:
- cant_happen();
- default:
- break;
- }
-}
-
-
-/* INSTR_CHUNK must be > largest code size (3) */
-#define INSTR_CHUNK 127
-
-/* bcfree --- deallocate instruction */
-
-void
-bcfree(INSTRUCTION *cp)
-{
- cp->opcode = 0;
- cp->nexti = pool_list->freei;
- pool_list->freei = cp;
-}
-
-/* bcalloc --- allocate a new instruction */
-
-INSTRUCTION *
-bcalloc(OPCODE op, int size, int srcline)
-{
- INSTRUCTION *cp;
-
- if (size > 1) {
- /* wide instructions Op_rule, Op_func_call .. */
- emalloc(cp, INSTRUCTION *, (size + 1) * sizeof(INSTRUCTION), "bcalloc");
- cp->pool_size = size;
- cp->nexti = pool_list->nexti;
- pool_list->nexti = cp++;
- } else {
- INSTRUCTION *pool;
-
- pool = pool_list->freei;
- if (pool == NULL) {
- INSTRUCTION *last;
- emalloc(cp, INSTRUCTION *, (INSTR_CHUNK + 1) * sizeof(INSTRUCTION), "bcalloc");
-
- cp->pool_size = INSTR_CHUNK;
- cp->nexti = pool_list->nexti;
- pool_list->nexti = cp;
- pool = ++cp;
- last = &pool[INSTR_CHUNK - 1];
- for (; cp <= last; cp++) {
- cp->opcode = 0;
- cp->nexti = cp + 1;
- }
- --cp;
- cp->nexti = NULL;
- }
- cp = pool;
- pool_list->freei = cp->nexti;
- }
-
- memset(cp, 0, size * sizeof(INSTRUCTION));
- cp->opcode = op;
- cp->source_line = srcline;
- return cp;
-}
-
-/* free_bcpool --- free list of instruction memory pools */
-
-static void
-free_bcpool(INSTRUCTION *pl)
-{
- INSTRUCTION *pool, *tmp;
-
- for (pool = pl->nexti; pool != NULL; pool = tmp) {
- INSTRUCTION *cp, *last;
- long psiz;
- psiz = pool->pool_size;
- if (psiz == INSTR_CHUNK)
- last = pool + psiz;
- else
- last = pool + 1;
- for (cp = pool + 1; cp <= last ; cp++) {
- if (cp->opcode != 0)
- free_bc_internal(cp);
- }
- tmp = pool->nexti;
- efree(pool);
- }
- memset(pl, 0, sizeof(INSTRUCTION));
-}
-
-
static inline INSTRUCTION *
list_create(INSTRUCTION *x)
{
@@ -5956,13 +5523,13 @@ check_special(const char *name)
int low, high, mid;
int i;
#if 'a' == 0x81 /* it's EBCDIC */
- static int did_sort = FALSE;
+ static bool did_sort = false;
if (! did_sort) {
qsort((void *) tokentab,
sizeof(tokentab) / sizeof(tokentab[0]),
sizeof(tokentab[0]), tokcompare);
- did_sort = TRUE;
+ did_sort = true;
}
#endif
@@ -6034,3 +5601,4 @@ one_line_close(int fd)
return ret;
}
+
diff --git a/awklib/.gitignore b/awklib/.gitignore
new file mode 100644
index 00000000..b46084d4
--- /dev/null
+++ b/awklib/.gitignore
@@ -0,0 +1,8 @@
+# Ignore files that are created by a build.
+# For example objects and archives.
+grcat
+group.awk
+igawk
+passwd.awk
+pwcat
+
diff --git a/awklib/Makefile.in b/awklib/Makefile.in
index 45e6b2b7..6a89d053 100644
--- a/awklib/Makefile.in
+++ b/awklib/Makefile.in
@@ -83,11 +83,11 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
$(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lcmessage.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \
- $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/nls.m4 \
- $(top_srcdir)/m4/noreturn.m4 $(top_srcdir)/m4/po.m4 \
- $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/readline.m4 \
- $(top_srcdir)/m4/socket.m4 $(top_srcdir)/m4/ulonglong.m4 \
- $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/mpfr.m4 \
+ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/noreturn.m4 \
+ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+ $(top_srcdir)/m4/readline.m4 $(top_srcdir)/m4/socket.m4 \
+ $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -169,6 +169,7 @@ ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
+GAWKLIBEXT = @GAWKLIBEXT@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
@@ -184,6 +185,7 @@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
+LIBMPFR = @LIBMPFR@
LIBOBJS = @LIBOBJS@
LIBREADLINE = @LIBREADLINE@
LIBS = @LIBS@
@@ -225,6 +227,7 @@ abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
+acl_shlibext = @acl_shlibext@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -259,12 +262,14 @@ mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
+pkgextensiondir = @pkgextensiondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
+subdirs = @subdirs@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
diff --git a/awklib/eg/lib/gettime.awk b/awklib/eg/lib/gettime.awk
index 95f9c329..4cb56330 100644
--- a/awklib/eg/lib/gettime.awk
+++ b/awklib/eg/lib/gettime.awk
@@ -1,4 +1,4 @@
-# gettimeofday.awk --- get the time of day in a usable format
+# getlocaltime.awk --- get the time of day in a usable format
#
# Arnold Robbins, arnold@skeeve.com, Public Domain, May 1993
#
@@ -25,7 +25,7 @@
# time["weeknum"] -- week number, Sunday first day
# time["altweeknum"] -- week number, Monday first day
-function gettimeofday(time, ret, now, i)
+function getlocaltime(time, ret, now, i)
{
# get time once, avoids unnecessary system calls
now = systime()
diff --git a/awklib/eg/prog/alarm.awk b/awklib/eg/prog/alarm.awk
index 53563d15..9bb1633c 100644
--- a/awklib/eg/prog/alarm.awk
+++ b/awklib/eg/prog/alarm.awk
@@ -1,6 +1,6 @@
# alarm.awk --- set an alarm
#
-# Requires gettimeofday() library function
+# Requires getlocaltime() library function
#
# Arnold Robbins, arnold@skeeve.com, Public Domain
# May 1993
@@ -53,7 +53,7 @@ BEGIN \
minute = atime[2] + 0 # force numeric
# get current broken down time
- gettimeofday(now)
+ getlocaltime(now)
# if time given is 12-hour hours and it's after that
# hour, e.g., `alarm 5:30' at 9 a.m. means 5:30 p.m.,
diff --git a/bootstrap.sh b/bootstrap.sh
index 54a97108..535ae8fb 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -26,8 +26,10 @@ touch aclocal.m4
find awklib -type f -print | xargs touch
sleep 1
touch configure
+touch extension/configure
sleep 2
touch configh.in
+touch extension/configh.in
sleep 1
touch test/Maketests
find . -name Makefile.in -print | xargs touch
diff --git a/builtin.c b/builtin.c
index c4082126..6a2d9d6b 100644
--- a/builtin.c
+++ b/builtin.c
@@ -73,15 +73,17 @@ extern void srandom(unsigned long seed);
extern NODE **args_array;
extern int max_args;
extern NODE **fields_arr;
-extern int output_is_tty;
+extern bool output_is_tty;
extern FILE *output_fp;
#define POP_TWO_SCALARS(s1, s2) \
s2 = POP_SCALAR(); \
s1 = POP(); \
-if ((s1)->type == Node_var_array) \
- DEREF(s2), fatal(_("attempt to use array `%s' in a scalar context"), array_vname(s1)), 0
+do { if (s1->type == Node_var_array) { \
+DEREF(s2); \
+fatal(_("attempt to use array `%s' in a scalar context"), array_vname(s1)); \
+}} while (false)
/*
@@ -90,9 +92,6 @@ if ((s1)->type == Node_var_array) \
*/
#define GAWK_RANDOM_MAX 0x7fffffffL
-static void efwrite(const void *ptr, size_t size, size_t count, FILE *fp,
- const char *from, struct redirect *rp, int flush);
-
/* efwrite --- like fwrite, but with error checking */
static void
@@ -102,17 +101,26 @@ efwrite(const void *ptr,
FILE *fp,
const char *from,
struct redirect *rp,
- int flush)
+ bool flush)
{
errno = 0;
- if (fwrite(ptr, size, count, fp) != count)
+ if (rp != NULL) {
+ if (rp->output.gawk_fwrite(ptr, size, count, fp, rp->output.opaque) != count)
+ goto wrerror;
+ } else if (fwrite(ptr, size, count, fp) != count)
goto wrerror;
if (flush
&& ((fp == stdout && output_is_tty)
|| (rp != NULL && (rp->flag & RED_NOBUF)))) {
- fflush(fp);
- if (ferror(fp))
- goto wrerror;
+ if (rp != NULL) {
+ rp->output.gawk_fflush(fp, rp->output.opaque);
+ if (rp->output.gawk_ferror(fp, rp->output.opaque))
+ goto wrerror;
+ } else {
+ fflush(fp);
+ if (ferror(fp))
+ goto wrerror;
+ }
}
return;
@@ -133,7 +141,7 @@ do_exp(int nargs)
tmp = POP_SCALAR();
if (do_lint && (tmp->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("exp: received non-numeric argument"));
- d = force_number(tmp);
+ d = force_number(tmp)->numbr;
DEREF(tmp);
errno = 0;
res = exp(d);
@@ -205,9 +213,9 @@ do_fflush(int nargs)
DEREF(tmp);
return make_number((AWKNUM) status);
}
- fp = rp->fp;
+ fp = rp->output.fp;
if (fp != NULL)
- status = fflush(fp);
+ status = rp->output.gawk_fflush(fp, rp->output.opaque);
} else if ((fp = stdfile(tmp->stptr, tmp->stlen)) != NULL) {
status = fflush(fp);
} else {
@@ -317,7 +325,7 @@ do_index(int nargs)
size_t l1, l2;
long ret;
#if MBS_SUPPORT
- int do_single_byte = FALSE;
+ bool do_single_byte = false;
mbstate_t mbs1, mbs2;
if (gawk_mb_cur_max > 1) {
@@ -334,8 +342,10 @@ do_index(int nargs)
if ((s2->flags & (STRING|STRCUR)) == 0)
lintwarn(_("index: received non-string second argument"));
}
- force_string(s1);
- force_string(s2);
+
+ s1 = force_string(s1);
+ s2 = force_string(s2);
+
p1 = s1->stptr;
p2 = s2->stptr;
l1 = s1->stlen;
@@ -455,7 +465,7 @@ do_int(int nargs)
tmp = POP_SCALAR();
if (do_lint && (tmp->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("int: received non-numeric argument"));
- d = force_number(tmp);
+ d = force_number(tmp)->numbr;
d = double_to_int(d);
DEREF(tmp);
return make_number((AWKNUM) d);
@@ -487,12 +497,12 @@ do_length(int nargs)
tmp = POP();
if (tmp->type == Node_var_array) {
- static short warned = FALSE;
+ static bool warned = false;
if (do_posix)
fatal(_("length: received array argument"));
if (do_lint && ! warned) {
- warned = TRUE;
+ warned = true;
lintwarn(_("`length(array)' is a gawk extension"));
}
return make_number((AWKNUM) tmp->table_size);
@@ -502,7 +512,7 @@ do_length(int nargs)
if (do_lint && (tmp->flags & (STRING|STRCUR)) == 0)
lintwarn(_("length: received non-string argument"));
- (void) force_string(tmp);
+ tmp = force_string(tmp);
#if MBS_SUPPORT
if (gawk_mb_cur_max > 1) {
@@ -533,7 +543,7 @@ do_log(int nargs)
tmp = POP_SCALAR();
if (do_lint && (tmp->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("log: received non-numeric argument"));
- arg = (double) force_number(tmp);
+ arg = force_number(tmp)->numbr;
if (arg < 0.0)
warning(_("log: received negative argument %g"), arg);
d = log(arg);
@@ -542,6 +552,42 @@ do_log(int nargs)
}
+#ifdef HAVE_MPFR
+
+/*
+ * mpz2mpfr --- convert an arbitrary-precision integer to a float
+ * without any loss of precision. The returned value is only
+ * good for temporary use.
+ */
+
+
+static mpfr_ptr
+mpz2mpfr(mpz_ptr zi)
+{
+ size_t prec;
+ static mpfr_t mpfrval;
+ static bool inited = false;
+ int tval;
+
+ /* estimate minimum precision for exact conversion */
+ prec = mpz_sizeinbase(zi, 2); /* most significant 1 bit position starting at 1 */
+ prec -= (size_t) mpz_scan1(zi, 0); /* least significant 1 bit index starting at 0 */
+ if (prec < MPFR_PREC_MIN)
+ prec = MPFR_PREC_MIN;
+ else if (prec > MPFR_PREC_MAX)
+ prec = MPFR_PREC_MAX;
+
+ if (! inited) {
+ mpfr_init2(mpfrval, prec);
+ inited = true;
+ } else
+ mpfr_set_prec(mpfrval, prec);
+ tval = mpfr_set_z(mpfrval, zi, ROUND_MODE);
+ IEEE_FMT(mpfrval, tval);
+ return mpfrval;
+}
+#endif
+
/*
* format_tree() formats arguments of sprintf,
* and accordingly to a fmt_string providing a format like in
@@ -599,8 +645,8 @@ format_tree(
size_t cur_arg = 0;
NODE *r = NULL;
- int i;
- int toofew = FALSE;
+ int i, nc;
+ bool toofew = false;
char *obuf, *obufout;
size_t osiz, ofre;
const char *chbuf;
@@ -608,11 +654,11 @@ format_tree(
int cs1;
NODE *arg;
long fw, prec, argnum;
- int used_dollar;
- int lj, alt, big_flag, bigbig_flag, small_flag, have_prec, need_format;
+ bool used_dollar;
+ bool lj, alt, big_flag, bigbig_flag, small_flag, have_prec, need_format;
long *cur = NULL;
uintmax_t uval;
- int sgn;
+ bool sgn;
int base;
/*
* Although this is an array, the elements serve two different
@@ -631,14 +677,20 @@ format_tree(
char *cend = &cpbufs[0].stackbuf[sizeof(cpbufs[0].stackbuf)];
char *cp;
const char *fill;
- AWKNUM tmpval;
- char signchar = FALSE;
+ AWKNUM tmpval = 0.0;
+ char signchar = '\0';
size_t len;
- int zero_flag = FALSE;
- int quote_flag = FALSE;
+ bool zero_flag = false;
+ bool quote_flag = false;
int ii, jj;
char *chp;
size_t copy_count, char_count;
+#ifdef HAVE_MPFR
+ mpz_ptr zi;
+ mpfr_ptr mf;
+#endif
+ enum { MP_INT_WITH_PREC = 1, MP_INT_WITHOUT_PREC, MP_FLOAT } fmt_type;
+
static const char sp[] = " ";
static const char zero_string[] = "0";
static const char lchbuf[] = "0123456789abcdef";
@@ -701,7 +753,7 @@ format_tree(
goto out; \
} else if (cur_arg >= num_args) { \
arg = 0; /* shutup the compiler */ \
- toofew = TRUE; \
+ toofew = true; \
break; \
} else { \
arg = the_args[cur_arg]; \
@@ -709,8 +761,8 @@ format_tree(
} \
}
- need_format = FALSE;
- used_dollar = FALSE;
+ need_format = false;
+ used_dollar = false;
s0 = s1 = fmt_string;
while (n0-- > 0) {
@@ -718,7 +770,7 @@ format_tree(
s1++;
continue;
}
- need_format = TRUE;
+ need_format = true;
bchunk(s0, s1 - s0);
s0 = s1;
cur = &fw;
@@ -726,11 +778,18 @@ format_tree(
prec = 0;
base = 0;
argnum = 0;
- have_prec = FALSE;
- signchar = FALSE;
- zero_flag = FALSE;
- quote_flag = FALSE;
- lj = alt = big_flag = bigbig_flag = small_flag = FALSE;
+ base = 0;
+ have_prec = false;
+ signchar = '\0';
+ zero_flag = false;
+ quote_flag = false;
+#ifdef HAVE_MPFR
+ mf = NULL;
+ zi = NULL;
+#endif
+ fmt_type = 0;
+
+ lj = alt = big_flag = bigbig_flag = small_flag = false;
fill = sp;
cp = cend;
chbuf = lchbuf;
@@ -747,7 +806,7 @@ check_pos:
break; /* reject as a valid format */
goto retry;
case '%':
- need_format = FALSE;
+ need_format = false;
/*
* 29 Oct. 2002:
* The C99 standard pages 274 and 279 seem to imply that
@@ -779,7 +838,7 @@ check_pos:
* screws up floating point formatting.
*/
if (cur == & fw)
- zero_flag = TRUE;
+ zero_flag = true;
if (lj)
goto retry;
/* FALL through */
@@ -806,7 +865,7 @@ check_pos:
*cur = *cur * 10 + *s1++ - '0';
}
if (prec < 0) /* negative precision is discarded */
- have_prec = FALSE;
+ have_prec = false;
if (cur == &prec)
cur = NULL;
if (n0 == 0) /* badly formatted control string */
@@ -821,7 +880,7 @@ check_pos:
if (cur == &fw) {
argnum = fw;
fw = 0;
- used_dollar = TRUE;
+ used_dollar = true;
if (argnum <= 0) {
msg(_("fatal: arg count with `$' must be > 0"));
goto out;
@@ -854,30 +913,31 @@ check_pos:
n0--;
}
if (val >= num_args) {
- toofew = TRUE;
+ toofew = true;
break;
}
arg = the_args[val];
} else {
parse_next_arg();
}
- *cur = force_number(arg);
+ (void) force_number(arg);
+ *cur = get_number_si(arg);
if (*cur < 0 && cur == &fw) {
*cur = -*cur;
lj++;
}
if (cur == &prec) {
if (*cur >= 0)
- have_prec = TRUE;
+ have_prec = true;
else
- have_prec = FALSE;
+ have_prec = false;
cur = NULL;
}
goto retry;
case ' ': /* print ' ' or '-' */
/* 'space' flag is ignored */
/* if '+' already present */
- if (signchar != FALSE)
+ if (signchar != false)
goto check_pos;
/* FALL THROUGH */
case '+': /* print '+' or '-' */
@@ -897,16 +957,16 @@ check_pos:
if (cur != &fw)
break;
cur = &prec;
- have_prec = TRUE;
+ have_prec = true;
goto retry;
case '#':
- alt = TRUE;
+ alt = true;
goto check_pos;
case '\'':
#if defined(HAVE_LOCALE_H)
/* allow quote_flag if there is a thousands separator. */
if (loc.thousands_sep[0] != '\0')
- quote_flag = TRUE;
+ quote_flag = true;
goto check_pos;
#else
goto retry;
@@ -915,61 +975,61 @@ check_pos:
if (big_flag)
break;
else {
- static short warned = FALSE;
+ static bool warned = false;
if (do_lint && ! warned) {
lintwarn(_("`l' is meaningless in awk formats; ignored"));
- warned = TRUE;
+ warned = true;
}
if (do_posix) {
msg(_("fatal: `l' is not permitted in POSIX awk formats"));
goto out;
}
}
- big_flag = TRUE;
+ big_flag = true;
goto retry;
case 'L':
if (bigbig_flag)
break;
else {
- static short warned = FALSE;
+ static bool warned = false;
if (do_lint && ! warned) {
lintwarn(_("`L' is meaningless in awk formats; ignored"));
- warned = TRUE;
+ warned = true;
}
if (do_posix) {
msg(_("fatal: `L' is not permitted in POSIX awk formats"));
goto out;
}
}
- bigbig_flag = TRUE;
+ bigbig_flag = true;
goto retry;
case 'h':
if (small_flag)
break;
else {
- static short warned = FALSE;
+ static bool warned = false;
if (do_lint && ! warned) {
lintwarn(_("`h' is meaningless in awk formats; ignored"));
- warned = TRUE;
+ warned = true;
}
if (do_posix) {
msg(_("fatal: `h' is not permitted in POSIX awk formats"));
goto out;
}
}
- small_flag = TRUE;
+ small_flag = true;
goto retry;
case 'c':
- need_format = FALSE;
+ need_format = false;
parse_next_arg();
/* user input that looks numeric is numeric */
if ((arg->flags & (MAYBE_NUM|NUMBER)) == MAYBE_NUM)
(void) force_number(arg);
if (arg->flags & NUMBER) {
- uval = (uintmax_t) arg->numbr;
+ uval = get_number_uj(arg);
#if MBS_SUPPORT
if (gawk_mb_cur_max > 1) {
char buf[100];
@@ -1036,7 +1096,7 @@ out2:
prec = 1;
goto pr_tail;
case 's':
- need_format = FALSE;
+ need_format = false;
parse_next_arg();
arg = force_string(arg);
if (fw == 0 && ! have_prec)
@@ -1050,9 +1110,18 @@ out2:
goto pr_tail;
case 'd':
case 'i':
- need_format = FALSE;
+ need_format = false;
parse_next_arg();
- tmpval = force_number(arg);
+ (void) force_number(arg);
+#ifdef HAVE_MPFR
+ if (is_mpg_float(arg))
+ goto mpf0;
+ else if (is_mpg_integer(arg))
+ goto mpz0;
+ else
+#endif
+ tmpval = arg->numbr;
+
/*
* Check for Nan or Inf.
*/
@@ -1070,12 +1139,12 @@ out2:
if (tmpval < 0) {
tmpval = -tmpval;
- sgn = TRUE;
+ sgn = true;
} else {
if (tmpval == -0.0)
/* avoid printing -0 */
tmpval = 0.0;
- sgn = FALSE;
+ sgn = false;
}
/*
* Use snprintf return value to tell if there
@@ -1111,7 +1180,7 @@ out2:
if (loc.grouping[ii+1] == 0)
jj = 0; /* keep using current val in loc.grouping[ii] */
else if (loc.grouping[ii+1] == CHAR_MAX)
- quote_flag = FALSE;
+ quote_flag = false;
else {
ii++;
jj = 0;
@@ -1161,9 +1230,80 @@ out2:
base += 2; /* FALL THROUGH */
case 'o':
base += 8;
- need_format = FALSE;
+ need_format = false;
parse_next_arg();
- tmpval = force_number(arg);
+ (void) force_number(arg);
+#ifdef HAVE_MPFR
+ if (is_mpg_integer(arg)) {
+mpz0:
+ zi = arg->mpg_i;
+
+ if (cs1 != 'd' && cs1 != 'i') {
+ if (mpz_sgn(zi) <= 0) {
+ /*
+ * Negative value or 0 requires special handling.
+ * Unlike MPFR, GMP does not allow conversion
+ * to (u)intmax_t. So we first convert GMP type to
+ * a MPFR type.
+ */
+ mf = mpz2mpfr(zi);
+ goto mpf1;
+ }
+ signchar = '\0'; /* Don't print '+' */
+ }
+
+ /* See comments above about when to fill with zeros */
+ zero_flag = (! lj
+ && ((zero_flag && ! have_prec)
+ || (fw == 0 && have_prec)));
+
+ fmt_type = have_prec ? MP_INT_WITH_PREC : MP_INT_WITHOUT_PREC;
+ goto fmt0;
+
+ } else if (is_mpg_float(arg)) {
+mpf0:
+ mf = arg->mpg_numbr;
+ if (! mpfr_number_p(mf)) {
+ /* inf or NaN */
+ cs1 = 'g';
+ fmt_type = MP_FLOAT;
+ goto fmt1;
+ }
+
+ if (cs1 != 'd' && cs1 != 'i') {
+mpf1:
+ /*
+ * The output of printf("%#.0x", 0) is 0 instead of 0x, hence <= in
+ * the comparison below.
+ */
+ if (mpfr_sgn(mf) <= 0) {
+ if (! mpfr_fits_intmax_p(mf, ROUND_MODE)) {
+ /* -ve number is too large */
+ cs1 = 'g';
+ fmt_type = MP_FLOAT;
+ goto fmt1;
+ }
+
+ tmpval = uval = (uintmax_t) mpfr_get_sj(mf, ROUND_MODE);
+ if (! alt && have_prec && prec == 0 && tmpval == 0)
+ goto pr_tail; /* printf("%.0x", 0) is no characters */
+ goto int0;
+ }
+ signchar = '\0'; /* Don't print '+' */
+ }
+
+ /* See comments above about when to fill with zeros */
+ zero_flag = (! lj
+ && ((zero_flag && ! have_prec)
+ || (fw == 0 && have_prec)));
+
+ (void) mpfr_get_z(mpzval, mf, MPFR_RNDZ); /* convert to GMP integer */
+ fmt_type = have_prec ? MP_INT_WITH_PREC : MP_INT_WITHOUT_PREC;
+ zi = mpzval;
+ goto fmt0;
+ } else
+#endif
+ tmpval = arg->numbr;
/*
* ``The result of converting a zero value with a
@@ -1182,14 +1322,16 @@ out2:
if (tmpval < 0) {
uval = (uintmax_t) (intmax_t) tmpval;
- if ((AWKNUM)(intmax_t)uval !=
- double_to_int(tmpval))
+ if ((AWKNUM)(intmax_t)uval != double_to_int(tmpval))
goto out_of_range;
} else {
uval = (uintmax_t) tmpval;
if ((AWKNUM)uval != double_to_int(tmpval))
goto out_of_range;
}
+#ifdef HAVE_MPFR
+ int0:
+#endif
/*
* When to fill with zeroes is of course not simple.
* First: No zero fill if left-justifying.
@@ -1213,7 +1355,7 @@ out2:
if (loc.grouping[ii+1] == 0)
jj = 0; /* keep using current val in loc.grouping[ii] */
else if (loc.grouping[ii+1] == CHAR_MAX)
- quote_flag = FALSE;
+ quote_flag = false;
else {
ii++;
jj = 0;
@@ -1272,7 +1414,7 @@ out2:
lintwarn(_("[s]printf: value %g is out of range for `%%%c' format"),
(double) tmpval, cs1);
cs1 = 'g';
- goto format_float;
+ goto fmt1;
case 'F':
#if ! defined(PRINTF_HAS_F_FORMAT) || PRINTF_HAS_F_FORMAT != 1
@@ -1284,13 +1426,30 @@ out2:
case 'e':
case 'f':
case 'E':
- need_format = FALSE;
+ need_format = false;
parse_next_arg();
- tmpval = force_number(arg);
- format_float:
+ (void) force_number(arg);
+
+ if (! is_mpg_number(arg))
+ tmpval = arg->numbr;
+#ifdef HAVE_MPFR
+ else if (is_mpg_float(arg)) {
+ mf = arg->mpg_numbr;
+ fmt_type = MP_FLOAT;
+ } else {
+ /* arbitrary-precision integer, convert to MPFR float */
+ assert(mf == NULL);
+ mf = mpz2mpfr(arg->mpg_i);
+ fmt_type = MP_FLOAT;
+ }
+#endif
+ fmt1:
if (! have_prec)
prec = DEFAULT_G_PRECISION;
- chksize(fw + prec + 9); /* 9 == slop */
+#ifdef HAVE_MPFR
+ fmt0:
+#endif
+ chksize(fw + prec + 11); /* 11 == slop */
cp = cpbuf;
*cp++ = '%';
if (lj)
@@ -1303,25 +1462,46 @@ out2:
*cp++ = '0';
if (quote_flag)
*cp++ = '\'';
- strcpy(cp, "*.*");
- cp += 3;
- *cp++ = cs1;
- *cp = '\0';
+
#if defined(LC_NUMERIC)
if (quote_flag && ! use_lc_numeric)
setlocale(LC_NUMERIC, "");
#endif
- {
- int n;
- while ((n = snprintf(obufout, ofre, cpbuf,
- (int) fw, (int) prec,
- (double) tmpval)) >= ofre)
- chksize(n)
+
+ switch (fmt_type) {
+#ifdef HAVE_MPFR
+ case MP_INT_WITH_PREC:
+ sprintf(cp, "*.*Z%c", cs1);
+ while ((nc = mpfr_snprintf(obufout, ofre, cpbuf,
+ (int) fw, (int) prec, zi)) >= ofre)
+ chksize(nc)
+ break;
+ case MP_INT_WITHOUT_PREC:
+ sprintf(cp, "*Z%c", cs1);
+ while ((nc = mpfr_snprintf(obufout, ofre, cpbuf,
+ (int) fw, zi)) >= ofre)
+ chksize(nc)
+ break;
+ case MP_FLOAT:
+ sprintf(cp, "*.*R*%c", cs1);
+ while ((nc = mpfr_snprintf(obufout, ofre, cpbuf,
+ (int) fw, (int) prec, ROUND_MODE, mf)) >= ofre)
+ chksize(nc)
+ break;
+#endif
+ default:
+ sprintf(cp, "*.*%c", cs1);
+ while ((nc = snprintf(obufout, ofre, cpbuf,
+ (int) fw, (int) prec,
+ (double) tmpval)) >= ofre)
+ chksize(nc)
}
+
#if defined(LC_NUMERIC)
if (quote_flag && ! use_lc_numeric)
setlocale(LC_NUMERIC, "C");
#endif
+
len = strlen(obufout);
ofre -= len;
obufout += len;
@@ -1362,6 +1542,7 @@ out:
if (obuf != NULL)
efree(obuf);
}
+
if (r == NULL)
gawk_exit(EXIT_FATAL);
return r;
@@ -1386,7 +1567,7 @@ printf_common(int nargs)
}
}
- force_string(args_array[0]);
+ args_array[0] = force_string(args_array[0]);
r = format_tree(args_array[0]->stptr, args_array[0]->stlen, args_array, nargs);
for (i = 0; i < nargs; i++)
DEREF(args_array[i]);
@@ -1440,7 +1621,7 @@ do_printf(int nargs, int redirtype)
fatal(_("attempt to use array `%s' in a scalar context"), array_vname(redir_exp));
rp = redirect(redir_exp, redirtype, & errflg);
if (rp != NULL)
- fp = rp->fp;
+ fp = rp->output.fp;
} else
fp = output_fp;
@@ -1454,9 +1635,9 @@ do_printf(int nargs, int redirtype)
DEREF(tmp);
return;
}
- efwrite(tmp->stptr, sizeof(char), tmp->stlen, fp, "printf", rp, TRUE);
+ efwrite(tmp->stptr, sizeof(char), tmp->stlen, fp, "printf", rp, true);
if (rp != NULL && (rp->flag & RED_TWOWAY) != 0)
- fflush(rp->fp);
+ rp->output.gawk_fflush(rp->output.fp, rp->output.opaque);
DEREF(tmp);
} else
gawk_exit(EXIT_FATAL);
@@ -1473,7 +1654,7 @@ do_sqrt(int nargs)
tmp = POP_SCALAR();
if (do_lint && (tmp->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("sqrt: received non-numeric argument"));
- arg = (double) force_number(tmp);
+ arg = (double) force_number(tmp)->numbr;
DEREF(tmp);
if (arg < 0.0)
warning(_("sqrt: called with negative argument %g"), arg);
@@ -1492,19 +1673,26 @@ do_substr(int nargs)
double d_index = 0, d_length = 0;
size_t src_len;
- if (nargs == 3)
- POP_NUMBER(d_length);
- POP_NUMBER(d_index);
+ if (nargs == 3) {
+ t1 = POP_NUMBER();
+ d_length = get_number_d(t1);
+ DEREF(t1);
+ }
+
+ t1 = POP_NUMBER();
+ d_index = get_number_d(t1);
+ DEREF(t1);
+
t1 = POP_STRING();
if (nargs == 3) {
if (! (d_length >= 1)) {
- if (do_lint == LINT_ALL)
+ if (do_lint == DO_LINT_ALL)
lintwarn(_("substr: length %g is not >= 1"), d_length);
- else if (do_lint == LINT_INVALID && ! (d_length >= 0))
+ else if (do_lint == DO_LINT_INVALID && ! (d_length >= 0))
lintwarn(_("substr: length %g is not >= 0"), d_length);
DEREF(t1);
- return Nnull_string;
+ return dupnode(Nnull_string);
}
if (do_lint) {
if (double_to_int(d_length) != d_length)
@@ -1555,10 +1743,10 @@ do_substr(int nargs)
if (t1->stlen == 0) {
/* substr("", 1, 0) produces a warning only if LINT_ALL */
- if (do_lint && (do_lint == LINT_ALL || ((indx | length) != 0)))
+ if (do_lint && (do_lint == DO_LINT_ALL || ((indx | length) != 0)))
lintwarn(_("substr: source string is zero length"));
DEREF(t1);
- return Nnull_string;
+ return dupnode(Nnull_string);
}
/* get total len of input string, for following checks */
@@ -1575,7 +1763,7 @@ do_substr(int nargs)
lintwarn(_("substr: start index %g is past end of string"),
d_index);
DEREF(t1);
- return Nnull_string;
+ return dupnode(Nnull_string);
}
if (length > src_len - indx) {
if (do_lint)
@@ -1645,7 +1833,7 @@ do_strftime(int nargs)
format = def_strftime_format; /* traditional date format */
formatlen = strlen(format);
(void) time(& fclock); /* current time of day */
- do_gmt = FALSE;
+ do_gmt = false;
if (PROCINFO_node != NULL) {
sub = make_string("strftime", 8);
@@ -1673,12 +1861,13 @@ do_strftime(int nargs)
do_gmt = (t3->stlen > 0);
DEREF(t3);
}
-
+
if (nargs >= 2) {
t2 = POP_SCALAR();
if (do_lint && (t2->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("strftime: received non-numeric second argument"));
- clock_val = (long) force_number(t2);
+ (void) force_number(t2);
+ clock_val = get_number_si(t2);
if (clock_val < 0)
fatal(_("strftime: second argument less than 0 or too big for time_t"));
fclock = (time_t) clock_val;
@@ -1688,6 +1877,7 @@ do_strftime(int nargs)
tmp = POP_SCALAR();
if (do_lint && (tmp->flags & (STRING|STRCUR)) == 0)
lintwarn(_("strftime: received non-string first argument"));
+
t1 = force_string(tmp);
format = t1->stptr;
formatlen = t1->stlen;
@@ -1770,13 +1960,13 @@ do_mktime(int nargs)
& hour, & minute, & second,
& dst);
- if (do_lint /* Ready? Set! Go: */
- && ( (second < 0 || second > 60)
- || (minute < 0 || minute > 60)
- || (hour < 0 || hour > 23)
- || (day < 1 || day > 31)
- || (month < 1 || month > 12) ))
- lintwarn(_("mktime: at least one of the values is out of the default range"));
+ if (do_lint /* Ready? Set! Go: */
+ && ( (second < 0 || second > 60)
+ || (minute < 0 || minute > 60)
+ || (hour < 0 || hour > 23)
+ || (day < 1 || day > 31)
+ || (month < 1 || month > 12) ))
+ lintwarn(_("mktime: at least one of the values is out of the default range"));
t1->stptr[t1->stlen] = save;
DEREF(t1);
@@ -1837,11 +2027,9 @@ do_system(int nargs)
return make_number((AWKNUM) ret);
}
-extern NODE **fmt_list; /* declared in eval.c */
-
/* do_print --- print items, separated by OFS, terminated with ORS */
-void
+void
do_print(int nargs, int redirtype)
{
struct redirect *rp = NULL;
@@ -1849,7 +2037,7 @@ do_print(int nargs, int redirtype)
FILE *fp = NULL;
int i;
NODE *redir_exp = NULL;
- NODE *tmp;
+ NODE *tmp = NULL;
assert(nargs <= max_args);
@@ -1859,7 +2047,7 @@ do_print(int nargs, int redirtype)
fatal(_("attempt to use array `%s' in a scalar context"), array_vname(redir_exp));
rp = redirect(redir_exp, redirtype, & errflg);
if (rp != NULL)
- fp = rp->fp;
+ fp = rp->output.fp;
} else
fp = output_fp;
@@ -1870,12 +2058,10 @@ do_print(int nargs, int redirtype)
DEREF(args_array[i]);
fatal(_("attempt to use array `%s' in a scalar context"), array_vname(tmp));
}
- if (do_lint && tmp->type == Node_var_new)
- lintwarn(_("reference to uninitialized variable `%s'"),
- tmp->vname);
+
if ((tmp->flags & (NUMBER|STRING)) == NUMBER) {
if (OFMTidx == CONVFMTidx)
- (void) force_string(tmp);
+ args_array[i] = force_string(tmp);
else
args_array[i] = format_val(OFMT, OFMTidx, tmp);
}
@@ -1893,18 +2079,18 @@ do_print(int nargs, int redirtype)
}
for (i = nargs; i > 0; i--) {
- efwrite(args_array[i]->stptr, sizeof(char), args_array[i]->stlen, fp, "print", rp, FALSE);
+ efwrite(args_array[i]->stptr, sizeof(char), args_array[i]->stlen, fp, "print", rp, false);
DEREF(args_array[i]);
if (i != 1 && OFSlen > 0)
efwrite(OFS, sizeof(char), (size_t) OFSlen,
- fp, "print", rp, FALSE);
+ fp, "print", rp, false);
}
if (ORSlen > 0)
- efwrite(ORS, sizeof(char), (size_t) ORSlen, fp, "print", rp, TRUE);
+ efwrite(ORS, sizeof(char), (size_t) ORSlen, fp, "print", rp, true);
if (rp != NULL && (rp->flag & RED_TWOWAY) != 0)
- fflush(rp->fp);
+ rp->output.gawk_fflush(rp->output.fp, rp->output.opaque);
}
/* do_print_rec --- special case printing of $0, for speed */
@@ -1923,7 +2109,7 @@ do_print_rec(int nargs, int redirtype)
redir_exp = TOP();
rp = redirect(redir_exp, redirtype, & errflg);
if (rp != NULL)
- fp = rp->fp;
+ fp = rp->output.fp;
DEREF(redir_exp);
decr_sp();
} else
@@ -1940,13 +2126,13 @@ do_print_rec(int nargs, int redirtype)
if (do_lint && f0 == Nnull_string)
lintwarn(_("reference to uninitialized field `$%d'"), 0);
- efwrite(f0->stptr, sizeof(char), f0->stlen, fp, "print", rp, FALSE);
+ efwrite(f0->stptr, sizeof(char), f0->stlen, fp, "print", rp, false);
if (ORSlen > 0)
- efwrite(ORS, sizeof(char), (size_t) ORSlen, fp, "print", rp, TRUE);
+ efwrite(ORS, sizeof(char), (size_t) ORSlen, fp, "print", rp, true);
if (rp != NULL && (rp->flag & RED_TWOWAY) != 0)
- fflush(rp->fp);
+ rp->output.gawk_fflush(rp->output.fp, rp->output.opaque);
}
#if MBS_SUPPORT
@@ -2099,8 +2285,8 @@ do_atan2(int nargs)
if ((t2->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("atan2: received non-numeric second argument"));
}
- d1 = force_number(t1);
- d2 = force_number(t2);
+ d1 = force_number(t1)->numbr;
+ d2 = force_number(t2)->numbr;
DEREF(t1);
DEREF(t2);
return make_number((AWKNUM) atan2(d1, d2));
@@ -2117,7 +2303,7 @@ do_sin(int nargs)
tmp = POP_SCALAR();
if (do_lint && (tmp->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("sin: received non-numeric argument"));
- d = sin((double) force_number(tmp));
+ d = sin((double) force_number(tmp)->numbr);
DEREF(tmp);
return make_number((AWKNUM) d);
}
@@ -2133,14 +2319,14 @@ do_cos(int nargs)
tmp = POP_SCALAR();
if (do_lint && (tmp->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("cos: received non-numeric argument"));
- d = cos((double) force_number(tmp));
+ d = cos((double) force_number(tmp)->numbr);
DEREF(tmp);
return make_number((AWKNUM) d);
}
/* do_rand --- do the rand function */
-static int firstrand = TRUE;
+static bool firstrand = true;
/* Some systems require this array to be integer aligned. Sigh. */
#define SIZEOF_STATE 256
static uint32_t istate[SIZEOF_STATE/sizeof(uint32_t)];
@@ -2153,7 +2339,7 @@ do_rand(int nargs ATTRIBUTE_UNUSED)
if (firstrand) {
(void) initstate((unsigned) 1, state, SIZEOF_STATE);
/* don't need to srandom(1), initstate() does it for us. */
- firstrand = FALSE;
+ firstrand = false;
setstate(state);
}
/*
@@ -2176,7 +2362,7 @@ do_srand(int nargs)
if (firstrand) {
(void) initstate((unsigned) 1, state, SIZEOF_STATE);
/* don't need to srandom(1), we're changing the seed below */
- firstrand = FALSE;
+ firstrand = false;
(void) setstate(state);
}
@@ -2186,7 +2372,7 @@ do_srand(int nargs)
tmp = POP_SCALAR();
if (do_lint && (tmp->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("srand: received non-numeric argument"));
- srandom((unsigned int) (save_seed = (long) force_number(tmp)));
+ srandom((unsigned int) (save_seed = (long) force_number(tmp)->numbr));
DEREF(tmp);
}
return make_number((AWKNUM) ret);
@@ -2267,7 +2453,7 @@ do_match(int nargs)
it->flags |= MAYBE_NUM; /* user input */
sub = make_number((AWKNUM) (ii));
- lhs = assoc_lookup(dest, sub, FALSE);
+ lhs = assoc_lookup(dest, sub);
unref(*lhs);
*lhs = it;
unref(sub);
@@ -2290,7 +2476,7 @@ do_match(int nargs)
it = make_number((AWKNUM) subpat_start + 1);
sub = make_string(buf, slen);
- lhs = assoc_lookup(dest, sub, FALSE);
+ lhs = assoc_lookup(dest, sub);
unref(*lhs);
*lhs = it;
unref(sub);
@@ -2303,7 +2489,7 @@ do_match(int nargs)
it = make_number((AWKNUM) subpat_len);
sub = make_string(buf, slen);
- lhs = assoc_lookup(dest, sub, FALSE);
+ lhs = assoc_lookup(dest, sub);
unref(*lhs);
*lhs = it;
unref(sub);
@@ -2337,7 +2523,7 @@ do_match(int nargs)
* #! /usr/local/bin/mawk -f
*
* BEGIN {
- * TRUE = 1; FALSE = 0
+ * true = 1; false = 0
* print "--->", mygsub("abc", "b+", "FOO")
* print "--->", mygsub("abc", "x*", "X")
* print "--->", mygsub("abc", "b*", "X")
@@ -2349,10 +2535,10 @@ do_match(int nargs)
* function mygsub(str, regex, replace, origstr, newstr, eosflag, nonzeroflag)
* {
* origstr = str;
- * eosflag = nonzeroflag = FALSE
+ * eosflag = nonzeroflag = false
* while (match(str, regex)) {
* if (RLENGTH > 0) { # easy case
- * nonzeroflag = TRUE
+ * nonzeroflag = true
* if (RSTART == 1) { # match at front of string
* newstr = newstr replace
* } else {
@@ -2365,7 +2551,7 @@ do_match(int nargs)
* # which we don't really want, so skip over it
* newstr = newstr substr(str, 1, 1)
* str = substr(str, 2)
- * nonzeroflag = FALSE
+ * nonzeroflag = false
* } else {
* # 0-length match
* if (RSTART == 1) {
@@ -2379,7 +2565,7 @@ do_match(int nargs)
* if (eosflag)
* break
* else
- * eosflag = TRUE
+ * eosflag = true
* }
* if (length(str) > 0)
* newstr = newstr str # rest of string
@@ -2446,7 +2632,7 @@ do_sub(int nargs, unsigned int flags)
long how_many = 1; /* one substitution for sub, also gensub default */
int global;
long current;
- int lastmatchnonzero;
+ bool lastmatchnonzero;
char *mb_indices = NULL;
if ((flags & GENSUB) != 0) {
@@ -2463,15 +2649,16 @@ do_sub(int nargs, unsigned int flags)
if (t1->stlen > 0 && (t1->stptr[0] == 'g' || t1->stptr[0] == 'G'))
how_many = -1;
else {
- d = force_number(t1);
-
+ (void) force_number(t1);
+ d = get_number_d(t1);
if ((t1->flags & NUMCUR) != 0)
goto set_how_many;
how_many = 1;
}
} else {
- d = force_number(t1);
+ (void) force_number(t1);
+ d = get_number_d(t1);
set_how_many:
if (d < 1)
how_many = 1;
@@ -2583,7 +2770,7 @@ set_how_many:
}
}
- lastmatchnonzero = FALSE;
+ lastmatchnonzero = false;
bp = buf;
for (current = 1;; current++) {
matches++;
@@ -2615,7 +2802,7 @@ set_how_many:
if (matchstart == matchend
&& lastmatchnonzero
&& matchstart == text) {
- lastmatchnonzero = FALSE;
+ lastmatchnonzero = false;
matches--;
goto empty;
}
@@ -2684,7 +2871,7 @@ set_how_many:
} else
*bp++ = *scan;
if (matchstart != matchend)
- lastmatchnonzero = TRUE;
+ lastmatchnonzero = true;
} else {
/*
* don't want this match, skip over it by copying
@@ -2777,8 +2964,8 @@ do_lshift(int nargs)
if ((s2->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("lshift: received non-numeric second argument"));
}
- val = force_number(s1);
- shift = force_number(s2);
+ val = force_number(s1)->numbr;
+ shift = force_number(s2)->numbr;
if (do_lint) {
if (val < 0 || shift < 0)
lintwarn(_("lshift(%f, %f): negative values will give strange results"), val, shift);
@@ -2814,8 +3001,8 @@ do_rshift(int nargs)
if ((s2->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("rshift: received non-numeric second argument"));
}
- val = force_number(s1);
- shift = force_number(s2);
+ val = force_number(s1)->numbr;
+ shift = force_number(s2)->numbr;
if (do_lint) {
if (val < 0 || shift < 0)
lintwarn(_("rshift(%f, %f): negative values will give strange results"), val, shift);
@@ -2840,33 +3027,30 @@ do_rshift(int nargs)
NODE *
do_and(int nargs)
{
- NODE *s1, *s2;
- uintmax_t uleft, uright, res;
- AWKNUM left, right;
+ NODE *s1;
+ uintmax_t res, uval;
+ AWKNUM val;
+ int i;
- POP_TWO_SCALARS(s1, s2);
- if (do_lint) {
- if ((s1->flags & (NUMCUR|NUMBER)) == 0)
- lintwarn(_("and: received non-numeric first argument"));
- if ((s2->flags & (NUMCUR|NUMBER)) == 0)
- lintwarn(_("and: received non-numeric second argument"));
- }
- left = force_number(s1);
- right = force_number(s2);
- if (do_lint) {
- if (left < 0 || right < 0)
- lintwarn(_("and(%f, %f): negative values will give strange results"), left, right);
- if (double_to_int(left) != left || double_to_int(right) != right)
- lintwarn(_("and(%f, %f): fractional values will be truncated"), left, right);
- }
+ res = ~0; /* start off with all ones */
+ if (nargs < 2)
+ fatal(_("and: called with less than two arguments"));
- DEREF(s1);
- DEREF(s2);
+ for (i = 1; nargs > 0; nargs--, i++) {
+ s1 = POP_SCALAR();
+ if (do_lint && (s1->flags & (NUMCUR|NUMBER)) == 0)
+ lintwarn(_("and: argument %d is non-numeric"), i);
- uleft = (uintmax_t) left;
- uright = (uintmax_t) right;
+ val = force_number(s1)->numbr;
+ if (do_lint && val < 0)
+ lintwarn(_("and: argument %d negative value %g will give strange results"), i, val);
+
+ uval = (uintmax_t) val;
+ res &= uval;
+
+ DEREF(s1);
+ }
- res = uleft & uright;
return make_integer(res);
}
@@ -2875,33 +3059,30 @@ do_and(int nargs)
NODE *
do_or(int nargs)
{
- NODE *s1, *s2;
- uintmax_t uleft, uright, res;
- AWKNUM left, right;
+ NODE *s1;
+ uintmax_t res, uval;
+ AWKNUM val;
+ int i;
- POP_TWO_SCALARS(s1, s2);
- if (do_lint) {
- if ((s1->flags & (NUMCUR|NUMBER)) == 0)
- lintwarn(_("or: received non-numeric first argument"));
- if ((s2->flags & (NUMCUR|NUMBER)) == 0)
- lintwarn(_("or: received non-numeric second argument"));
- }
- left = force_number(s1);
- right = force_number(s2);
- if (do_lint) {
- if (left < 0 || right < 0)
- lintwarn(_("or(%f, %f): negative values will give strange results"), left, right);
- if (double_to_int(left) != left || double_to_int(right) != right)
- lintwarn(_("or(%f, %f): fractional values will be truncated"), left, right);
- }
+ res = 0;
+ if (nargs < 2)
+ fatal(_("or: called with less than two arguments"));
- DEREF(s1);
- DEREF(s2);
+ for (i = 1; nargs > 0; nargs--, i++) {
+ s1 = POP_SCALAR();
+ if (do_lint && (s1->flags & (NUMCUR|NUMBER)) == 0)
+ lintwarn(_("or: argument %d is non-numeric"), i);
- uleft = (uintmax_t) left;
- uright = (uintmax_t) right;
+ val = force_number(s1)->numbr;
+ if (do_lint && val < 0)
+ lintwarn(_("or: argument %d negative value %g will give strange results"), i, val);
+
+ uval = (uintmax_t) val;
+ res |= uval;
+
+ DEREF(s1);
+ }
- res = uleft | uright;
return make_integer(res);
}
@@ -2910,36 +3091,33 @@ do_or(int nargs)
NODE *
do_xor(int nargs)
{
- NODE *s1, *s2;
- uintmax_t uleft, uright, res;
- AWKNUM left, right;
+ NODE *s1;
+ uintmax_t res, uval;
+ AWKNUM val;
+ int i;
- POP_TWO_SCALARS(s1, s2);
- left = force_number(s1);
- right = force_number(s2);
+ if (nargs < 2)
+ fatal(_("xor: called with less than two arguments"));
- if (do_lint) {
- if ((s1->flags & (NUMCUR|NUMBER)) == 0)
- lintwarn(_("xor: received non-numeric first argument"));
- if ((s2->flags & (NUMCUR|NUMBER)) == 0)
- lintwarn(_("xor: received non-numeric second argument"));
- }
- left = force_number(s1);
- right = force_number(s2);
- if (do_lint) {
- if (left < 0 || right < 0)
- lintwarn(_("xor(%f, %f): negative values will give strange results"), left, right);
- if (double_to_int(left) != left || double_to_int(right) != right)
- lintwarn(_("xor(%f, %f): fractional values will be truncated"), left, right);
- }
+ res = 0; /* silence compiler warning */
+ for (i = 1; nargs > 0; nargs--, i++) {
+ s1 = POP_SCALAR();
+ if (do_lint && (s1->flags & (NUMCUR|NUMBER)) == 0)
+ lintwarn(_("xor: argument %d is non-numeric"), i);
- DEREF(s1);
- DEREF(s2);
+ val = force_number(s1)->numbr;
+ if (do_lint && val < 0)
+ lintwarn(_("xor: argument %d negative value %g will give strange results"), i, val);
- uleft = (uintmax_t) left;
- uright = (uintmax_t) right;
+ uval = (uintmax_t) val;
+ if (i == 1)
+ res = uval;
+ else
+ res ^= uval;
+
+ DEREF(s1);
+ }
- res = uleft ^ uright;
return make_integer(res);
}
@@ -2955,12 +3133,10 @@ do_compl(int nargs)
tmp = POP_SCALAR();
if (do_lint && (tmp->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("compl: received non-numeric argument"));
- d = force_number(tmp);
+ d = force_number(tmp)->numbr;
DEREF(tmp);
if (do_lint) {
- if ((tmp->flags & (NUMCUR|NUMBER)) == 0)
- lintwarn(_("compl: received non-numeric argument"));
if (d < 0)
lintwarn(_("compl(%f): negative value will give strange results"), d);
if (double_to_int(d) != d)
@@ -2982,11 +3158,11 @@ do_strtonum(int nargs)
tmp = POP_SCALAR();
if ((tmp->flags & (NUMBER|NUMCUR)) != 0)
- d = (AWKNUM) force_number(tmp);
- else if (isnondecimal(tmp->stptr, use_lc_numeric))
+ d = (AWKNUM) force_number(tmp)->numbr;
+ else if (get_numbase(tmp->stptr, use_lc_numeric) != 10)
d = nondec2awknum(tmp->stptr, tmp->stlen);
else
- d = (AWKNUM) force_number(tmp);
+ d = (AWKNUM) force_number(tmp)->numbr;
DEREF(tmp);
return make_number((AWKNUM) d);
@@ -3236,7 +3412,10 @@ do_dcngettext(int nargs)
}
#endif
- POP_NUMBER(d); /* third argument */
+ t2 = POP_NUMBER(); /* third argument */
+ d = get_number_d(t2);
+ DEREF(t2);
+
number = (unsigned long) double_to_int(d);
t2 = POP_STRING(); /* second argument */
string2 = t2->stptr;
diff --git a/cint_array.c b/cint_array.c
new file mode 100644
index 00000000..cafd1bbc
--- /dev/null
+++ b/cint_array.c
@@ -0,0 +1,1219 @@
+/*
+ * cint_array.c - routines for arrays of (mostly) consecutive positive integer indices.
+ */
+
+/*
+ * Copyright (C) 1986, 1988, 1989, 1991-2011 the Free Software Foundation, Inc.
+ *
+ * This file is part of GAWK, the GNU implementation of the
+ * AWK Programming Language.
+ *
+ * GAWK is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GAWK is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "awk.h"
+
+extern FILE *output_fp;
+extern void indent(int indent_level);
+extern NODE **is_integer(NODE *symbol, NODE *subs);
+
+/*
+ * NHAT --- maximum size of a leaf array (2^NHAT).
+ * THRESHOLD --- Maximum capacity waste; THRESHOLD >= 2^(NHAT + 1).
+ */
+
+static int NHAT = 10;
+static long THRESHOLD;
+
+/* What is the optimium NHAT ? timing results suggest that 10 is a good choice,
+ * although differences aren't that significant for > 10.
+ */
+
+
+static NODE **cint_array_init(NODE *symbol, NODE *subs);
+static NODE **is_uinteger(NODE *symbol, NODE *subs);
+static NODE **cint_lookup(NODE *symbol, NODE *subs);
+static NODE **cint_exists(NODE *symbol, NODE *subs);
+static NODE **cint_clear(NODE *symbol, NODE *subs);
+static NODE **cint_remove(NODE *symbol, NODE *subs);
+static NODE **cint_list(NODE *symbol, NODE *t);
+static NODE **cint_copy(NODE *symbol, NODE *newsymb);
+static NODE **cint_dump(NODE *symbol, NODE *ndump);
+#ifdef ARRAYDEBUG
+static void cint_print(NODE *symbol);
+#endif
+
+array_ptr cint_array_func[] = {
+ cint_array_init,
+ is_uinteger,
+ cint_lookup,
+ cint_exists,
+ cint_clear,
+ cint_remove,
+ cint_list,
+ cint_copy,
+ cint_dump,
+};
+
+static inline int cint_hash(long k);
+static inline NODE **cint_find(NODE *symbol, long k, int h1);
+
+static inline NODE *make_node(NODETYPE type);
+
+static NODE **tree_lookup(NODE *symbol, NODE *tree, long k, int m, long base);
+static NODE **tree_exists(NODE *tree, long k);
+static void tree_clear(NODE *tree);
+static int tree_remove(NODE *symbol, NODE *tree, long k);
+static void tree_copy(NODE *newsymb, NODE *tree, NODE *newtree);
+static long tree_list(NODE *tree, NODE **list, unsigned int flags);
+static inline NODE **tree_find(NODE *tree, long k, int i);
+static void tree_info(NODE *tree, NODE *ndump, const char *aname);
+static size_t tree_kilobytes(NODE *tree);
+#ifdef ARRAYDEBUG
+static void tree_print(NODE *tree, size_t bi, int indent_level);
+#endif
+
+static inline NODE **leaf_lookup(NODE *symbol, NODE *array, long k, long size, long base);
+static inline NODE **leaf_exists(NODE *array, long k);
+static void leaf_clear(NODE *array);
+static int leaf_remove(NODE *symbol, NODE *array, long k);
+static void leaf_copy(NODE *newsymb, NODE *array, NODE *newarray);
+static long leaf_list(NODE *array, NODE **list, unsigned int flags);
+static void leaf_info(NODE *array, NODE *ndump, const char *aname);
+#ifdef ARRAYDEBUG
+static void leaf_print(NODE *array, size_t bi, int indent_level);
+#endif
+
+/* powers of 2 table upto 2^30 */
+static const long power_two_table[] = {
+ 1, 2, 4, 8, 16, 32, 64,
+ 128, 256, 512, 1024, 2048, 4096,
+ 8192, 16384, 32768, 65536, 131072, 262144,
+ 524288, 1048576, 2097152, 4194304, 8388608, 16777216,
+ 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824
+};
+
+
+#define ISUINT(a, s) ((((s)->flags & NUMINT) != 0 || is_integer(a, s) != NULL) \
+ && (s)->numbr >= 0)
+
+/*
+ * To store 2^n integers, allocate top-level array of size n, elements
+ * of which are 1-Dimensional (leaf-array) of geometrically increasing
+ * size (power of 2).
+ *
+ * [0] --> [ 0 ]
+ * [1] --> [ 1 ]
+ * |2| --> [ 2 | 3 ]
+ * |3| --> [ 4 | 5 | 6 | 7 ]
+ * |.|
+ * |k| --> [ 2^(k - 1)| ... | 2^k - 1 ]
+ * ...
+ *
+ * For a given integer n (> 0), the leaf-array is at 1 + floor(log2(n)).
+ *
+ * The idea for the geometrically increasing array sizes is from:
+ * Fast Functional Lists, Hash-Lists, Deques and Variable Length Arrays.
+ * Bagwell, Phil (2002).
+ * http://infoscience.epfl.ch/record/64410/files/techlists.pdf
+ *
+ * Disadvantage:
+ * Worst case memory waste > 99% and will happen when each of the
+ * leaf arrays contains only a single element. Even with consecutive
+ * integers, memory waste can be as high as 50%.
+ *
+ * Solution: Hashed Array Trees (HATs).
+ *
+ */
+
+/* cint_array_init --- check relevant environment variables */
+
+static NODE **
+cint_array_init(NODE *symbol ATTRIBUTE_UNUSED, NODE *subs ATTRIBUTE_UNUSED)
+{
+ long newval;
+
+ if ((newval = getenv_long("NHAT")) > 1 && newval < INT32_BIT)
+ NHAT = newval;
+ THRESHOLD = power_two_table[NHAT + 1];
+ return (NODE **) ! NULL;
+}
+
+
+/* is_uinteger --- test if the subscript is an integer >= 0 */
+
+NODE **
+is_uinteger(NODE *symbol, NODE *subs)
+{
+ if (is_integer(symbol, subs) != NULL && subs->numbr >= 0)
+ return (NODE **) ! NULL;
+ return NULL;
+}
+
+
+/* cint_lookup --- Find the subscript in the array; Install it if it isn't there. */
+
+static NODE **
+cint_lookup(NODE *symbol, NODE *subs)
+{
+ NODE **lhs;
+ long k;
+ int h1 = -1, m, li;
+ NODE *tn, *xn;
+ long cint_size, capacity;
+
+ k = -1;
+ if (ISUINT(symbol, subs)) {
+ k = subs->numbr; /* k >= 0 */
+ h1 = cint_hash(k); /* h1 >= NHAT */
+ if ((lhs = cint_find(symbol, k, h1)) != NULL)
+ return lhs;
+ }
+ xn = symbol->xarray;
+ if (xn != NULL && (lhs = xn->aexists(xn, subs)) != NULL)
+ return lhs;
+
+ /* It's not there, install it */
+
+ if (k < 0)
+ goto xinstall;
+
+ m = h1 - 1; /* m >= (NHAT- 1) */
+
+ /* Estimate capacity upper bound.
+ * capacity upper bound = current capacity + leaf array size.
+ */
+ li = m > NHAT ? m : NHAT;
+ while (li >= NHAT) {
+ /* leaf-array of a HAT */
+ li = (li + 1) / 2;
+ }
+ capacity = symbol->array_capacity + power_two_table[li];
+
+ cint_size = (xn == NULL) ? symbol->table_size
+ : (symbol->table_size - xn->table_size);
+ assert(cint_size >= 0);
+ if ((capacity - cint_size) > THRESHOLD)
+ goto xinstall;
+
+ if (symbol->nodes == NULL) {
+ symbol->array_capacity = 0;
+ assert(symbol->table_size == 0);
+
+ /* nodes[0] .. nodes[NHAT- 1] not used */
+ emalloc(symbol->nodes, NODE **, INT32_BIT * sizeof(NODE *), "cint_lookup");
+ memset(symbol->nodes, '\0', INT32_BIT * sizeof(NODE *));
+ }
+
+ symbol->table_size++; /* one more element in array */
+
+ tn = symbol->nodes[h1];
+ if (tn == NULL) {
+ tn = make_node(Node_array_tree);
+ symbol->nodes[h1] = tn;
+ }
+
+ if (m < NHAT)
+ return tree_lookup(symbol, tn, k, NHAT, 0);
+ return tree_lookup(symbol, tn, k, m, power_two_table[m]);
+
+xinstall:
+
+ symbol->table_size++;
+ if (xn == NULL) {
+ extern array_ptr int_array_func[];
+ extern array_ptr str_array_func[];
+
+ xn = symbol->xarray = make_array();
+ xn->vname = symbol->vname; /* shallow copy */
+
+ /* Avoid using assoc_lookup(xn, subs) which may lead
+ * to infinite recursion.
+ */
+
+ if (is_integer(xn, subs))
+ xn->array_funcs = int_array_func;
+ else
+ xn->array_funcs = str_array_func;
+ xn->flags |= XARRAY;
+ }
+ return xn->alookup(xn, subs);
+}
+
+
+/* cint_exists --- test whether an index is in the array or not. */
+
+static NODE **
+cint_exists(NODE *symbol, NODE *subs)
+{
+ NODE *xn;
+
+ if (ISUINT(symbol, subs)) {
+ long k = subs->numbr;
+ NODE **lhs;
+ if ((lhs = cint_find(symbol, k, cint_hash(k))) != NULL)
+ return lhs;
+ }
+ if ((xn = symbol->xarray) == NULL)
+ return NULL;
+ return xn->aexists(xn, subs);
+}
+
+
+/* cint_clear --- flush all the values in symbol[] */
+
+static NODE **
+cint_clear(NODE *symbol, NODE *subs ATTRIBUTE_UNUSED)
+{
+ size_t i;
+ NODE *tn;
+
+ assert(symbol->nodes != NULL);
+
+ if (symbol->xarray != NULL) {
+ NODE *xn = symbol->xarray;
+ assoc_clear(xn);
+ freenode(xn);
+ symbol->xarray = NULL;
+ }
+
+ for (i = NHAT; i < INT32_BIT; i++) {
+ tn = symbol->nodes[i];
+ if (tn != NULL) {
+ tree_clear(tn);
+ freenode(tn);
+ }
+ }
+
+ efree(symbol->nodes);
+ init_array(symbol); /* re-initialize symbol */
+ return NULL;
+}
+
+
+/* cint_remove --- remove an index from the array */
+
+static NODE **
+cint_remove(NODE *symbol, NODE *subs)
+{
+ long k;
+ int h1;
+ NODE *tn, *xn = symbol->xarray;
+
+ if (symbol->table_size == 0)
+ return NULL;
+
+ if (! ISUINT(symbol, subs))
+ goto xremove;
+
+ assert(symbol->nodes != NULL);
+
+ k = subs->numbr;
+ h1 = cint_hash(k);
+ tn = symbol->nodes[h1];
+ if (tn == NULL || ! tree_remove(symbol, tn, k))
+ goto xremove;
+
+ if (tn->table_size == 0) {
+ freenode(tn);
+ symbol->nodes[h1] = NULL;
+ }
+
+ symbol->table_size--;
+
+ if (xn == NULL && symbol->table_size == 0) {
+ efree(symbol->nodes);
+ init_array(symbol); /* re-initialize array 'symbol' */
+ } else if(xn != NULL && symbol->table_size == xn->table_size) {
+ /* promote xn to symbol */
+
+ xn->flags &= ~XARRAY;
+ xn->parent_array = symbol->parent_array;
+ efree(symbol->nodes);
+ *symbol = *xn;
+ freenode(xn);
+ }
+
+ return (NODE **) ! NULL;
+
+xremove:
+ xn = symbol->xarray;
+ if (xn == NULL || xn->aremove(xn, subs) == NULL)
+ return NULL;
+ if (xn->table_size == 0) {
+ freenode(xn);
+ symbol->xarray = NULL;
+ }
+ symbol->table_size--;
+ assert(symbol->table_size > 0);
+
+ return (NODE **) ! NULL;
+}
+
+
+/* cint_copy --- duplicate input array "symbol" */
+
+static NODE **
+cint_copy(NODE *symbol, NODE *newsymb)
+{
+ NODE **old, **new;
+ size_t i;
+
+ assert(symbol->nodes != NULL);
+
+ /* allocate new table */
+ emalloc(new, NODE **, INT32_BIT * sizeof(NODE *), "cint_copy");
+ memset(new, '\0', INT32_BIT * sizeof(NODE *));
+
+ old = symbol->nodes;
+ for (i = NHAT; i < INT32_BIT; i++) {
+ if (old[i] == NULL)
+ continue;
+ new[i] = make_node(Node_array_tree);
+ tree_copy(newsymb, old[i], new[i]);
+ }
+
+ if (symbol->xarray != NULL) {
+ NODE *xn, *n;
+ xn = symbol->xarray;
+ n = make_array();
+ n->vname = newsymb->vname;
+ (void) xn->acopy(xn, n);
+ newsymb->xarray = n;
+ } else
+ newsymb->xarray = NULL;
+
+ newsymb->nodes = new;
+ newsymb->table_size = symbol->table_size;
+ newsymb->array_capacity = symbol->array_capacity;
+ newsymb->flags = symbol->flags;
+
+ return NULL;
+}
+
+
+/* cint_list --- return a list of items */
+
+static NODE**
+cint_list(NODE *symbol, NODE *t)
+{
+ NODE **list = NULL;
+ NODE *tn, *xn;
+ unsigned long k = 0, num_elems, list_size;
+ size_t j, ja, jd;
+ int elem_size = 1;
+
+ num_elems = symbol->table_size;
+ if (num_elems == 0)
+ return NULL;
+
+ if ((t->flags & (AINDEX|AVALUE|ADELETE)) == (AINDEX|ADELETE))
+ num_elems = 1;
+
+ if ((t->flags & (AINDEX|AVALUE)) == (AINDEX|AVALUE))
+ elem_size = 2;
+ list_size = num_elems * elem_size;
+
+ if (symbol->xarray != NULL) {
+ xn = symbol->xarray;
+ list = xn->alist(xn, t);
+ assert(list != NULL);
+ t->flags &= ~(AASC|ADESC);
+ if (num_elems == 1 || num_elems == xn->table_size)
+ return list;
+ erealloc(list, NODE **, list_size * sizeof(NODE *), "cint_list");
+ k = elem_size * xn->table_size;
+ } else
+ emalloc(list, NODE **, list_size * sizeof(NODE *), "cint_list");
+
+
+ if ((t->flags & AINUM) == 0) /* not sorting by "index num" */
+ t->flags &= ~(AASC|ADESC);
+
+ /* populate it with index in ascending or descending order */
+
+ for (ja = NHAT, jd = INT32_BIT - 1; ja < INT32_BIT && jd >= NHAT; ) {
+ j = (t->flags & ADESC) ? jd-- : ja++;
+ tn = symbol->nodes[j];
+ if (tn == NULL)
+ continue;
+ k += tree_list(tn, list + k, t->flags);
+ if (k >= list_size)
+ return list;
+ }
+ return list;
+}
+
+
+/* cint_dump --- dump array info */
+
+static NODE **
+cint_dump(NODE *symbol, NODE *ndump)
+{
+ NODE *tn, *xn = NULL;
+ int indent_level;
+ size_t i;
+ long cint_size = 0, xsize = 0;
+ AWKNUM kb = 0;
+ extern AWKNUM int_kilobytes(NODE *symbol);
+ extern AWKNUM str_kilobytes(NODE *symbol);
+ extern array_ptr int_array_func[];
+
+ indent_level = ndump->alevel;
+
+ if (symbol->xarray != NULL) {
+ xn = symbol->xarray;
+ xsize = xn->table_size;
+ }
+ cint_size = symbol->table_size - xsize;
+
+ if ((symbol->flags & XARRAY) == 0)
+ fprintf(output_fp, "%s `%s'\n",
+ (symbol->parent_array == NULL) ? "array" : "sub-array",
+ array_vname(symbol));
+ indent_level++;
+ indent(indent_level);
+ fprintf(output_fp, "array_func: cint_array_func\n");
+ if (symbol->flags != 0) {
+ indent(indent_level);
+ fprintf(output_fp, "flags: %s\n", flags2str(symbol->flags));
+ }
+ indent(indent_level);
+ fprintf(output_fp, "NHAT: %d\n", NHAT);
+ indent(indent_level);
+ fprintf(output_fp, "THRESHOLD: %ld\n", THRESHOLD);
+ indent(indent_level);
+ fprintf(output_fp, "table_size: %ld (total), %ld (cint), %ld (int + str)\n",
+ symbol->table_size, cint_size, xsize);
+ indent(indent_level);
+ fprintf(output_fp, "array_capacity: %lu\n", (unsigned long) symbol->array_capacity);
+ indent(indent_level);
+ fprintf(output_fp, "Load Factor: %.2g\n", (AWKNUM) cint_size / symbol->array_capacity);
+
+ for (i = NHAT; i < INT32_BIT; i++) {
+ tn = symbol->nodes[i];
+ if (tn == NULL)
+ continue;
+ /* Node_array_tree + HAT */
+ kb += (sizeof(NODE) + tree_kilobytes(tn)) / 1024.0;
+ }
+ kb += (INT32_BIT * sizeof(NODE *)) / 1024.0; /* symbol->nodes */
+ kb += (symbol->array_capacity * sizeof(NODE *)) / 1024.0; /* value nodes in Node_array_leaf(s) */
+ if (xn != NULL) {
+ if (xn->array_funcs == int_array_func)
+ kb += int_kilobytes(xn);
+ else
+ kb += str_kilobytes(xn);
+ }
+
+ indent(indent_level);
+ fprintf(output_fp, "memory: %.2g kB (total)\n", kb);
+
+ /* dump elements */
+
+ if (ndump->adepth >= 0) {
+ const char *aname;
+
+ fprintf(output_fp, "\n");
+ aname = make_aname(symbol);
+ for (i = NHAT; i < INT32_BIT; i++) {
+ tn = symbol->nodes[i];
+ if (tn != NULL)
+ tree_info(tn, ndump, aname);
+ }
+ }
+
+ if (xn != NULL) {
+ fprintf(output_fp, "\n");
+ xn->adump(xn, ndump);
+ }
+
+#ifdef ARRAYDEBUG
+ if (ndump->adepth < -999)
+ cint_print(symbol);
+#endif
+
+ return NULL;
+}
+
+
+/* cint_hash --- locate the HAT for a given number 'k' */
+
+static inline int
+cint_hash(long k)
+{
+ uint32_t num, r, shift;
+
+ assert(k >= 0);
+ if (k == 0)
+ return NHAT;
+ num = k;
+
+ /* Find the Floor(log base 2 of 32-bit integer) */
+
+ /* Warren Jr., Henry S. (2002). Hacker's Delight.
+ * Addison Wesley. pp. pp. 215. ISBN 978-0201914658.
+ *
+ * r = 0;
+ * if (num >= 1<<16) { num >>= 16; r += 16; }
+ * if (num >= 1<< 8) { num >>= 8; r += 8; }
+ * if (num >= 1<< 4) { num >>= 4; r += 4; }
+ * if (num >= 1<< 2) { num >>= 2; r += 2; }
+ * if (num >= 1<< 1) { r += 1; }
+ */
+
+
+ /* Slightly different code copied from:
+ *
+ * http://www-graphics.stanford.edu/~seander/bithacks.html
+ * Bit Twiddling Hacks
+ * By Sean Eron Anderson
+ * seander@cs.stanford.edu
+ * Individually, the code snippets here are in the public domain
+ * (unless otherwise noted) — feel free to use them however you please.
+ * The aggregate collection and descriptions are © 1997-2005
+ * Sean Eron Anderson. The code and descriptions are distributed in the
+ * hope that they will be useful, but WITHOUT ANY WARRANTY and without
+ * even the implied warranty of merchantability or fitness for a particular
+ * purpose.
+ *
+ */
+
+ r = (num > 0xFFFF) << 4; num >>= r;
+ shift = (num > 0xFF) << 3; num >>= shift; r |= shift;
+ shift = (num > 0x0F) << 2; num >>= shift; r |= shift;
+ shift = (num > 0x03) << 1; num >>= shift; r |= shift;
+ r |= (num >> 1);
+
+ /* We use a single HAT for 0 <= num < 2^NHAT */
+ if (r < NHAT)
+ return NHAT;
+
+ return (1 + r);
+}
+
+
+/* cint_find --- locate the integer subscript */
+
+static inline NODE **
+cint_find(NODE *symbol, long k, int h1)
+{
+ NODE *tn;
+
+ if (symbol->nodes == NULL || (tn = symbol->nodes[h1]) == NULL)
+ return NULL;
+ return tree_exists(tn, k);
+}
+
+
+#ifdef ARRAYDEBUG
+
+/* cint_print --- print structural info */
+
+static void
+cint_print(NODE *symbol)
+{
+ NODE *tn;
+ size_t i;
+
+ fprintf(output_fp, "I[%4lu:%-4lu]\n", (unsigned long) INT32_BIT,
+ (unsigned long) symbol->table_size);
+ for (i = NHAT; i < INT32_BIT; i++) {
+ tn = symbol->nodes[i];
+ if (tn == NULL)
+ continue;
+ tree_print(tn, i, 1);
+ }
+}
+
+#endif
+
+
+/*------------------------ Hashed Array Trees -----------------------------*/
+
+/*
+ * HATs: Hashed Array Trees
+ * Fast variable-length arrays
+ * Edward Sitarski
+ * http://www.drdobbs.com/architecture-and-design/184409965
+ *
+ * HAT has a top-level array containing a power of two
+ * number of leaf arrays. All leaf arrays are the same size as the
+ * top-level array. A full HAT can hold n^2 elements,
+ * where n (some power of 2) is the size of each leaf array.
+ * [i/n][i & (n - 1)] locates the `i th' element in a HAT.
+ *
+ */
+
+/*
+ * A half HAT is defined here as a HAT with a top-level array of size n^2/2
+ * and holds the first n^2/2 elements.
+ *
+ * 1. 2^8 elements can be stored in a full HAT of size 2^4.
+ * 2. 2^9 elements can be stored in a half HAT of size 2^5.
+ * 3. When the number of elements is some power of 2, it
+ * can be stored in a full or a half HAT.
+ * 4. When the number of elements is some power of 2, it
+ * can be stored in a HAT (full or half) with HATs as leaf elements
+ * (full or half), and so on (e.g. 2^8 elements in a HAT of size 2^4 (top-level
+ * array dimension) with each leaf array being a HAT of size 2^2).
+ *
+ * IMPLEMENTATION DETAILS:
+ * 1. A HAT of 2^12 elements needs 2^6 house-keeping NODEs
+ * of Node_array_leaf.
+ *
+ * 2. A HAT of HATS of 2^12 elements needs
+ * 2^6 * (1 Node_array_tree + 2^3 Node_array_leaf)
+ * ~ 2^9 house-keeping NODEs.
+ *
+ * 3. When a leaf array (or leaf HAT) becomes empty, the memory
+ * is deallocated, and when there is no leaf array (or leaf HAT) left,
+ * the HAT is deleted.
+ *
+ * 4. A HAT stores the base (first) element, and locates the leaf array/HAT
+ * for the `i th' element using integer division
+ * (i - base)/n where n is the size of the top-level array.
+ *
+ */
+
+/* make_node --- initialize a NODE */
+
+static inline NODE *
+make_node(NODETYPE type)
+{
+ NODE *n;
+ getnode(n);
+ memset(n, '\0', sizeof(NODE));
+ n->type = type;
+ return n;
+}
+
+
+/* tree_lookup --- Find an integer subscript in a HAT; Install it if it isn't there */
+
+static NODE **
+tree_lookup(NODE *symbol, NODE *tree, long k, int m, long base)
+{
+ NODE **lhs;
+ NODE *tn;
+ int i, n;
+ size_t size;
+ long num = k;
+
+ /*
+ * HAT size (size of Top & Leaf array) = 2^n
+ * where n = Floor ((m + 1)/2). For an odd value of m,
+ * only the first half of the HAT is needed.
+ */
+
+ n = (m + 1) / 2;
+
+ if (tree->table_size == 0) {
+ size_t actual_size;
+ NODE **table;
+
+ assert(tree->nodes == NULL);
+
+ /* initialize top-level array */
+ size = actual_size = power_two_table[n];
+ tree->array_base = base;
+ tree->array_size = size;
+ tree->table_size = 0; /* # of elements in the array */
+ if (n > m/2) {
+ /* only first half of the array used */
+ actual_size /= 2;
+ tree->flags |= HALFHAT;
+ }
+ emalloc(table, NODE **, actual_size * sizeof(NODE *), "tree_lookup");
+ memset(table, '\0', actual_size * sizeof(NODE *));
+ tree->nodes = table;
+ } else
+ size = tree->array_size;
+
+ num -= tree->array_base;
+ i = num / size; /* top-level array index */
+ assert(i >= 0);
+
+ if ((lhs = tree_find(tree, k, i)) != NULL)
+ return lhs;
+
+ /* It's not there, install it */
+
+ tree->table_size++;
+ base += (size * i);
+ tn = tree->nodes[i];
+ if (n > NHAT) {
+ if (tn == NULL)
+ tn = tree->nodes[i] = make_node(Node_array_tree);
+ return tree_lookup(symbol, tn, k, n, base);
+ } else {
+ if (tn == NULL)
+ tn = tree->nodes[i] = make_node(Node_array_leaf);
+ return leaf_lookup(symbol, tn, k, size, base);
+ }
+}
+
+
+/* tree_exists --- test whether integer subscript `k' exists or not */
+
+static NODE **
+tree_exists(NODE *tree, long k)
+{
+ int i;
+ NODE *tn;
+
+ i = (k - tree->array_base) / tree->array_size;
+ assert(i >= 0);
+ tn = tree->nodes[i];
+ if (tn == NULL)
+ return NULL;
+ if (tn->type == Node_array_tree)
+ return tree_exists(tn, k);
+ return leaf_exists(tn, k);
+}
+
+/* tree_clear --- flush all the values */
+
+static void
+tree_clear(NODE *tree)
+{
+ NODE *tn;
+ size_t j, hsize;
+
+ hsize = tree->array_size;
+ if ((tree->flags & HALFHAT) != 0)
+ hsize /= 2;
+
+ for (j = 0; j < hsize; j++) {
+ tn = tree->nodes[j];
+ if (tn == NULL)
+ continue;
+ if (tn->type == Node_array_tree)
+ tree_clear(tn);
+ else
+ leaf_clear(tn);
+ freenode(tn);
+ }
+
+ efree(tree->nodes);
+ memset(tree, '\0', sizeof(NODE));
+ tree->type = Node_array_tree;
+}
+
+
+/* tree_remove --- If the integer subscript is in the HAT, remove it */
+
+static int
+tree_remove(NODE *symbol, NODE *tree, long k)
+{
+ int i;
+ NODE *tn;
+
+ i = (k - tree->array_base) / tree->array_size;
+ assert(i >= 0);
+ tn = tree->nodes[i];
+ if (tn == NULL)
+ return false;
+
+ if (tn->type == Node_array_tree
+ && ! tree_remove(symbol, tn, k))
+ return false;
+ else if (tn->type == Node_array_leaf
+ && ! leaf_remove(symbol, tn, k))
+ return false;
+
+ if (tn->table_size == 0) {
+ freenode(tn);
+ tree->nodes[i] = NULL;
+ }
+
+ /* one less item in array */
+ if (--tree->table_size == 0) {
+ efree(tree->nodes);
+ memset(tree, '\0', sizeof(NODE));
+ tree->type = Node_array_tree;
+ }
+ return true;
+}
+
+
+/* tree_find --- locate an interger subscript in the HAT */
+
+static inline NODE **
+tree_find(NODE *tree, long k, int i)
+{
+ NODE *tn;
+
+ assert(tree->nodes != NULL);
+ tn = tree->nodes[i];
+ if (tn != NULL) {
+ if (tn->type == Node_array_tree)
+ return tree_exists(tn, k);
+ return leaf_exists(tn, k);
+ }
+ return NULL;
+}
+
+
+/* tree_list --- return a list of items in the HAT */
+
+static long
+tree_list(NODE *tree, NODE **list, unsigned int flags)
+{
+ NODE *tn;
+ size_t j, cj, hsize;
+ long k = 0;
+
+ assert(list != NULL);
+
+ hsize = tree->array_size;
+ if ((tree->flags & HALFHAT) != 0)
+ hsize /= 2;
+
+ for (j = 0; j < hsize; j++) {
+ cj = (flags & ADESC) ? (hsize - 1 - j) : j;
+ tn = tree->nodes[cj];
+ if (tn == NULL)
+ continue;
+ if (tn->type == Node_array_tree)
+ k += tree_list(tn, list + k, flags);
+ else
+ k += leaf_list(tn, list + k, flags);
+ if ((flags & ADELETE) != 0 && k >= 1)
+ return k;
+ }
+ return k;
+}
+
+
+/* tree_copy --- duplicate a HAT */
+
+static void
+tree_copy(NODE *newsymb, NODE *tree, NODE *newtree)
+{
+ NODE **old, **new;
+ size_t j, hsize;
+
+ hsize = tree->array_size;
+ if ((tree->flags & HALFHAT) != 0)
+ hsize /= 2;
+
+ emalloc(new, NODE **, hsize * sizeof(NODE *), "tree_copy");
+ memset(new, '\0', hsize * sizeof(NODE *));
+ newtree->nodes = new;
+ newtree->array_base = tree->array_base;
+ newtree->array_size = tree->array_size;
+ newtree->table_size = tree->table_size;
+ newtree->flags = tree->flags;
+
+ old = tree->nodes;
+ for (j = 0; j < hsize; j++) {
+ if (old[j] == NULL)
+ continue;
+ if (old[j]->type == Node_array_tree) {
+ new[j] = make_node(Node_array_tree);
+ tree_copy(newsymb, old[j], new[j]);
+ } else {
+ new[j] = make_node(Node_array_leaf);
+ leaf_copy(newsymb, old[j], new[j]);
+ }
+ }
+}
+
+
+/* tree_info --- print index, value info */
+
+static void
+tree_info(NODE *tree, NODE *ndump, const char *aname)
+{
+ NODE *tn;
+ size_t j, hsize;
+
+ hsize = tree->array_size;
+ if ((tree->flags & HALFHAT) != 0)
+ hsize /= 2;
+
+ for (j = 0; j < hsize; j++) {
+ tn = tree->nodes[j];
+ if (tn == NULL)
+ continue;
+ if (tn->type == Node_array_tree)
+ tree_info(tn, ndump, aname);
+ else
+ leaf_info(tn, ndump, aname);
+ }
+}
+
+
+/* tree_kilobytes --- calculate memory consumption of a HAT */
+
+static size_t
+tree_kilobytes(NODE *tree)
+{
+ NODE *tn;
+ size_t j, hsize;
+ size_t sz = 0;
+
+ hsize = tree->array_size;
+ if ((tree->flags & HALFHAT) != 0)
+ hsize /= 2;
+ for (j = 0; j < hsize; j++) {
+ tn = tree->nodes[j];
+ if (tn == NULL)
+ continue;
+ sz += sizeof(NODE); /* Node_array_tree or Node_array_leaf */
+ if (tn->type == Node_array_tree)
+ sz += tree_kilobytes(tn);
+ }
+ sz += hsize * sizeof(NODE *); /* tree->nodes */
+ return sz;
+}
+
+#ifdef ARRAYDEBUG
+
+/* tree_print --- print the HAT structures */
+
+static void
+tree_print(NODE *tree, size_t bi, int indent_level)
+{
+ NODE *tn;
+ size_t j, hsize;
+
+ indent(indent_level);
+
+ hsize = tree->array_size;
+ if ((tree->flags & HALFHAT) != 0)
+ hsize /= 2;
+ fprintf(output_fp, "%4lu:%s[%4lu:%-4lu]\n",
+ (unsigned long) bi,
+ (tree->flags & HALFHAT) ? "HH" : "H",
+ (unsigned long) hsize, (unsigned long) tree->table_size);
+
+ for (j = 0; j < hsize; j++) {
+ tn = tree->nodes[j];
+ if (tn == NULL)
+ continue;
+ if (tn->type == Node_array_tree)
+ tree_print(tn, j, indent_level + 1);
+ else
+ leaf_print(tn, j, indent_level + 1);
+ }
+}
+#endif
+
+/*--------------------- leaf (linear 1-D) array --------------------*/
+
+/* leaf_lookup --- find an integer subscript in the array; Install it if
+ it isn't there.
+*/
+
+static inline NODE **
+leaf_lookup(NODE *symbol, NODE *array, long k, long size, long base)
+{
+ NODE **lhs;
+
+ if (array->nodes == NULL) {
+ array->table_size = 0; /* sanity */
+ array->array_size = size;
+ array->array_base = base;
+ emalloc(array->nodes, NODE **, size * sizeof(NODE *), "leaf_lookup");
+ memset(array->nodes, '\0', size * sizeof(NODE *));
+ symbol->array_capacity += size;
+ }
+
+ lhs = array->nodes + (k - base); /* leaf element */
+ if (*lhs == NULL) {
+ array->table_size++; /* one more element in leaf array */
+ *lhs = dupnode(Nnull_string);
+ }
+ return lhs;
+}
+
+
+/* leaf_exists --- check if the array contains an integer subscript */
+
+static inline NODE **
+leaf_exists(NODE *array, long k)
+{
+ NODE **lhs;
+ lhs = array->nodes + (k - array->array_base);
+ return (*lhs != NULL) ? lhs : NULL;
+}
+
+
+/* leaf_clear --- flush all values in the array */
+
+static void
+leaf_clear(NODE *array)
+{
+ long i, size = array->array_size;
+ NODE *r;
+
+ for (i = 0; i < size; i++) {
+ r = array->nodes[i];
+ if (r == NULL)
+ continue;
+ if (r->type == Node_var_array) {
+ assoc_clear(r); /* recursively clear all sub-arrays */
+ efree(r->vname);
+ freenode(r);
+ } else
+ unref(r);
+ }
+ efree(array->nodes);
+ array->nodes = NULL;
+ array->array_size = array->table_size = 0;
+}
+
+
+/* leaf_remove --- remove an integer subscript from the array */
+
+static int
+leaf_remove(NODE *symbol, NODE *array, long k)
+{
+ NODE **lhs;
+
+ lhs = array->nodes + (k - array->array_base);
+ if (*lhs == NULL)
+ return false;
+ *lhs = NULL;
+ if (--array->table_size == 0) {
+ efree(array->nodes);
+ array->nodes = NULL;
+ symbol->array_capacity -= array->array_size;
+ array->array_size = 0; /* sanity */
+ }
+ return true;
+}
+
+
+/* leaf_copy --- duplicate a leaf array */
+
+static void
+leaf_copy(NODE *newsymb, NODE *array, NODE *newarray)
+{
+ NODE **old, **new;
+ long size, i;
+
+ size = array->array_size;
+ emalloc(new, NODE **, size * sizeof(NODE *), "leaf_copy");
+ memset(new, '\0', size * sizeof(NODE *));
+ newarray->nodes = new;
+ newarray->array_size = size;
+ newarray->array_base = array->array_base;
+ newarray->flags = array->flags;
+ newarray->table_size = array->table_size;
+
+ old = array->nodes;
+ for (i = 0; i < size; i++) {
+ if (old[i] == NULL)
+ continue;
+ if (old[i]->type == Node_val)
+ new[i] = dupnode(old[i]);
+ else {
+ NODE *r;
+ r = make_array();
+ r->vname = estrdup(old[i]->vname, strlen(old[i]->vname));
+ r->parent_array = newsymb;
+ new[i] = assoc_copy(old[i], r);
+ }
+ }
+}
+
+
+/* leaf_list --- return a list of items */
+
+static long
+leaf_list(NODE *array, NODE **list, unsigned int flags)
+{
+ NODE *r, *subs;
+ long num, i, ci, k = 0;
+ long size = array->array_size;
+ static char buf[100];
+
+ for (i = 0; i < size; i++) {
+ ci = (flags & ADESC) ? (size - 1 - i) : i;
+ r = array->nodes[ci];
+ if (r == NULL)
+ continue;
+
+ /* index */
+ num = array->array_base + ci;
+ if (flags & AISTR) {
+ sprintf(buf, "%ld", num);
+ subs = make_string(buf, strlen(buf));
+ subs->numbr = num;
+ subs->flags |= (NUMCUR|NUMINT);
+ } else {
+ subs = make_number((AWKNUM) num);
+ subs->flags |= (INTIND|NUMINT);
+ }
+ list[k++] = subs;
+
+ /* value */
+ if (flags & AVALUE) {
+ if (r->type == Node_val) {
+ if ((flags & AVNUM) != 0)
+ (void) force_number(r);
+ else if ((flags & AVSTR) != 0)
+ r = force_string(r);
+ }
+ list[k++] = r;
+ }
+ if ((flags & ADELETE) != 0 && k >= 1)
+ return k;
+ }
+
+ return k;
+}
+
+
+/* leaf_info --- print index, value info */
+
+static void
+leaf_info(NODE *array, NODE *ndump, const char *aname)
+{
+ NODE *subs, *val;
+ size_t i, size;
+
+ size = array->array_size;
+
+ subs = make_number((AWKNUM) 0.0);
+ subs->flags |= (INTIND|NUMINT);
+ for (i = 0; i < size; i++) {
+ val = array->nodes[i];
+ if (val == NULL)
+ continue;
+ subs->numbr = array->array_base + i;
+ assoc_info(subs, val, ndump, aname);
+ }
+ unref(subs);
+}
+
+#ifdef ARRAYDEBUG
+
+/* leaf_print --- print the leaf-array structure */
+
+
+static void
+leaf_print(NODE *array, size_t bi, int indent_level)
+{
+ indent(indent_level);
+ fprintf(output_fp, "%4lu:L[%4lu:%-4lu]\n",
+ (unsigned long) bi,
+ (unsigned long) array->array_size,
+ (unsigned long) array->table_size);
+}
+#endif
diff --git a/cmd.h b/cmd.h
index b5f4abfe..382f1bd4 100644
--- a/cmd.h
+++ b/cmd.h
@@ -28,8 +28,7 @@
#include <readline/history.h>
extern char **command_completion(const char *text, int start, int end);
extern void initialize_pager(FILE *fp); /* debug.c */
-extern NODE **get_varlist(void);
-extern char **get_parmlist(void);
+extern NODE *get_function(void);
#else
#define initialize_pager(x) /* nothing */
#define add_history(x) /* nothing */
@@ -37,11 +36,11 @@ extern char **get_parmlist(void);
extern int gprintf(FILE *fp, const char *format, ...);
extern jmp_buf pager_quit_tag;
-extern int pager_quit_tag_valid;
+extern bool pager_quit_tag_valid;
extern int output_is_tty;
extern int input_fd;
-extern int input_from_tty;
+extern bool input_from_tty;
extern FILE *out_fp;
extern char *dbg_prompt;
extern char *commands_prompt;
@@ -169,10 +168,10 @@ extern char *(*read_a_line)(const char *prompt);
extern char *read_commands_string(const char *prompt);
extern int in_cmd_src(const char *);
extern int get_eof_status(void);
-extern void push_cmd_src(int fd, int istty, char * (*readfunc)(const char *),
+extern void push_cmd_src(int fd, bool istty, char * (*readfunc)(const char *),
int (*closefunc)(int), int cmd, int eofstatus);
extern int pop_cmd_src(void);
-extern int has_break_or_watch_point(int *pnum, int any);
+extern int has_break_or_watch_point(int *pnum, bool any);
extern int do_list(CMDARG *arg, int cmd);
extern int do_info(CMDARG *arg, int cmd);
extern int do_print_var(CMDARG *arg, int cmd);
diff --git a/command.c b/command.c
index 4476273f..e977929b 100644
--- a/command.c
+++ b/command.c
@@ -85,20 +85,20 @@ static void yyerror(const char *mesg, ...);
static int find_command(const char *token, size_t toklen);
-static int want_nodeval = FALSE;
+static bool want_nodeval = false;
static int cmd_idx = -1; /* index of current command in cmd table */
static int repeat_idx = -1; /* index of last repeatable command in command table */
static CMDARG *arg_list = NULL; /* list of arguments */
static long errcount = 0;
static char *lexptr_begin = NULL;
-static int in_commands = FALSE;
+static bool in_commands = false;
static int num_dim;
-static int in_eval = FALSE;
+static bool in_eval = false;
static const char start_EVAL[] = "function @eval(){";
static const char end_EVAL[] = "}";
-static CMDARG *append_statement(CMDARG *alist, char *stmt);
+static CMDARG *append_statement(CMDARG *stmt_list, char *stmt);
static char *next_word(char *p, int len, char **endp);
static NODE *concat_args(CMDARG *a, int count);
@@ -1696,7 +1696,7 @@ yyreduce:
#line 109 "command.y"
{
cmd_idx = -1;
- want_nodeval = FALSE;
+ want_nodeval = false;
if (lexptr_begin != NULL) {
if (input_from_tty && lexptr_begin[0] != '\0')
add_history(lexptr_begin);
@@ -1716,7 +1716,7 @@ yyreduce:
{
if (errcount == 0 && cmd_idx >= 0) {
Func_cmd cmdfunc;
- int terminate = FALSE;
+ bool terminate = false;
CMDARG *args;
int ctype = 0;
@@ -1750,7 +1750,7 @@ yyreduce:
if (in_commands)
cmdfunc = do_commands;
cmd_idx = -1;
- want_nodeval = FALSE;
+ want_nodeval = false;
args = arg_list;
arg_list = NULL;
@@ -1775,7 +1775,7 @@ yyreduce:
case 22:
/* Line 1778 of yacc.c */
#line 212 "command.y"
- { want_nodeval = TRUE; }
+ { want_nodeval = true; }
break;
case 23:
@@ -1793,7 +1793,7 @@ yyreduce:
rl_inhibit_completion = 1;
}
cmd_idx = -1;
- in_eval = TRUE;
+ in_eval = true;
}
}
break;
@@ -1840,7 +1840,7 @@ yyreduce:
rl_inhibit_completion = 0;
}
cmd_idx = find_command("eval", 4);
- in_eval = FALSE;
+ in_eval = false;
}
break;
@@ -1888,37 +1888,37 @@ yyreduce:
case 38:
/* Line 1778 of yacc.c */
#line 305 "command.y"
- { want_nodeval = TRUE; }
+ { want_nodeval = true; }
break;
case 40:
/* Line 1778 of yacc.c */
#line 306 "command.y"
- { want_nodeval = TRUE; }
+ { want_nodeval = true; }
break;
case 46:
/* Line 1778 of yacc.c */
#line 311 "command.y"
- { want_nodeval = TRUE; }
+ { want_nodeval = true; }
break;
case 49:
/* Line 1778 of yacc.c */
#line 313 "command.y"
- { want_nodeval = TRUE; }
+ { want_nodeval = true; }
break;
case 51:
/* Line 1778 of yacc.c */
#line 314 "command.y"
- { want_nodeval = TRUE; }
+ { want_nodeval = true; }
break;
case 53:
/* Line 1778 of yacc.c */
#line 315 "command.y"
- { want_nodeval = TRUE; }
+ { want_nodeval = true; }
break;
case 57:
@@ -1953,12 +1953,12 @@ yyreduce:
;
else if (in_commands)
yyerror(_("Can't use command `commands' for breakpoint/watchpoint commands"));
- else if ((yyvsp[(2) - (2)]) == NULL && ! (type = has_break_or_watch_point(&num, TRUE)))
+ else if ((yyvsp[(2) - (2)]) == NULL && ! (type = has_break_or_watch_point(&num, true)))
yyerror(_("no breakpoint/watchpoint has been set yet"));
- else if ((yyvsp[(2) - (2)]) != NULL && ! (type = has_break_or_watch_point(&num, FALSE)))
+ else if ((yyvsp[(2) - (2)]) != NULL && ! (type = has_break_or_watch_point(&num, false)))
yyerror(_("invalid breakpoint/watchpoint number"));
if (type) {
- in_commands = TRUE;
+ in_commands = true;
if (input_from_tty) {
dbg_prompt = commands_prompt;
fprintf(out_fp, _("Type commands for when %s %d is hit, one per line.\n"),
@@ -1978,7 +1978,7 @@ yyreduce:
else {
if (input_from_tty)
dbg_prompt = dgawk_prompt;
- in_commands = FALSE;
+ in_commands = false;
}
}
break;
@@ -2011,7 +2011,7 @@ yyreduce:
case 63:
/* Line 1778 of yacc.c */
#line 381 "command.y"
- { want_nodeval = TRUE; }
+ { want_nodeval = true; }
break;
case 64:
@@ -2020,7 +2020,7 @@ yyreduce:
{
int type;
int num = (yyvsp[(2) - (4)])->a_int;
- type = has_break_or_watch_point(&num, FALSE);
+ type = has_break_or_watch_point(&num, false);
if (! type)
yyerror(_("condition: invalid breakpoint/watchpoint number"));
}
@@ -2152,13 +2152,13 @@ yyreduce:
case 89:
/* Line 1778 of yacc.c */
#line 496 "command.y"
- { want_nodeval = TRUE; }
+ { want_nodeval = true; }
break;
case 92:
/* Line 1778 of yacc.c */
#line 498 "command.y"
- { want_nodeval = TRUE; }
+ { want_nodeval = true; }
break;
case 95:
@@ -2347,7 +2347,7 @@ yyreduce:
if ((n->flags & NUMBER) == 0)
yyerror(_("non-numeric value found, numeric expected"));
else
- (yyvsp[(2) - (2)])->a_node->numbr = - n->numbr;
+ negate_num(n);
(yyval) = (yyvsp[(2) - (2)]);
}
break;
@@ -2671,7 +2671,7 @@ yyreturn:
/* append_statement --- append 'stmt' to the list of eval awk statements */
static CMDARG *
-append_statement(CMDARG *alist, char *stmt)
+append_statement(CMDARG *stmt_list, char *stmt)
{
CMDARG *a, *arg;
char *s;
@@ -2681,7 +2681,7 @@ append_statement(CMDARG *alist, char *stmt)
if (stmt == start_EVAL) {
len = sizeof(start_EVAL);
- for (a = alist; a != NULL; a = a->next)
+ for (a = stmt_list; a != NULL; a = a->next)
len += strlen(a->a_string) + 1; /* 1 for ',' */
len += EVALSIZE;
@@ -2693,7 +2693,7 @@ append_statement(CMDARG *alist, char *stmt)
slen = sizeof("function @eval(") - 1;
memcpy(s, start_EVAL, slen);
- for (a = alist; a != NULL; a = a->next) {
+ for (a = stmt_list; a != NULL; a = a->next) {
len = strlen(a->a_string);
memcpy(s + slen, a->a_string, len);
slen += len;
@@ -2707,14 +2707,14 @@ append_statement(CMDARG *alist, char *stmt)
}
len = strlen(stmt) + 1; /* 1 for newline */
- s = alist->a_string;
+ s = stmt_list->a_string;
slen = strlen(s);
- ssize = alist->a_count;
+ ssize = stmt_list->a_count;
if (len > ssize - slen) {
ssize = slen + len + EVALSIZE;
erealloc(s, char *, (ssize + 2) * sizeof(char), "append_statement");
- alist->a_string = s;
- alist->a_count = ssize;
+ stmt_list->a_string = s;
+ stmt_list->a_count = ssize;
}
memcpy(s + slen, stmt, len);
slen += len;
@@ -2724,8 +2724,8 @@ append_statement(CMDARG *alist, char *stmt)
}
if (stmt == end_EVAL)
- erealloc(alist->a_string, char *, slen + 2, "append_statement");
- return alist;
+ erealloc(stmt_list->a_string, char *, slen + 2, "append_statement");
+ return stmt_list;
#undef EVALSIZE
}
@@ -3086,7 +3086,7 @@ again:
if (c == '"') {
char *str, *p;
int flags = ALREADY_MALLOCED;
- int esc_seen = FALSE;
+ bool esc_seen = false;
toklen = lexend - lexptr;
emalloc(str, char *, toklen + 2, "yylex");
@@ -3101,7 +3101,7 @@ err:
}
if (c == '\\') {
c = *++lexptr;
- esc_seen = TRUE;
+ esc_seen = true;
if (want_nodeval || c != '"')
*p++ = '\\';
}
@@ -3114,7 +3114,7 @@ err:
if (! want_nodeval) {
yylval = mk_cmdarg(D_string);
- yylval->a_string = estrdup(str, p - str);
+ yylval->a_string = str;
append_cmdarg(yylval);
return D_STRING;
} else { /* awk string */
@@ -3160,22 +3160,37 @@ err:
return D_STRING;
}
- /* assert(want_nodval == TRUE); */
-
/* look for awk number */
if (isdigit((unsigned char) tokstart[0])) {
- double d;
+ NODE *r = NULL;
errno = 0;
- d = strtod(tokstart, &lexptr);
+#ifdef HAVE_MPFR
+ if (do_mpfr) {
+ int tval;
+ r = mpg_float();
+ tval = mpfr_strtofr(r->mpg_numbr, tokstart, & lexptr, 0, ROUND_MODE);
+ IEEE_FMT(r->mpg_numbr, tval);
+ if (mpfr_integer_p(r->mpg_numbr)) {
+ /* integral value, convert to a GMP type. */
+ NODE *tmp = r;
+ r = mpg_integer();
+ mpfr_get_z(r->mpg_i, tmp->mpg_numbr, MPFR_RNDZ);
+ unref(tmp);
+ }
+ } else
+#endif
+ r = make_number(strtod(tokstart, & lexptr));
+
if (errno != 0) {
yyerror(strerror(errno));
+ unref(r);
errno = 0;
return '\n';
}
yylval = mk_cmdarg(D_node);
- yylval->a_node = make_number(d);
+ yylval->a_node = r;
append_cmdarg(yylval);
return D_NODE;
}
@@ -3283,7 +3298,7 @@ find_command(const char *token, size_t toklen)
{
char *name, *abrv;
int i, k;
- int try_exact = TRUE;
+ bool try_exact = true;
int abrv_match = -1;
int partial_match = -1;
@@ -3305,8 +3320,10 @@ find_command(const char *token, size_t toklen)
&& strncmp(name, token, toklen) == 0
)
return i;
- if (*name > *token)
- try_exact = FALSE;
+
+ if (*name > *token || i == (k - 1))
+ try_exact = false;
+
if (abrv_match < 0) {
abrv = cmdtab[i].abbrvn;
if (abrv[0] == token[0]) {
@@ -3359,7 +3376,7 @@ do_help(CMDARG *arg, int cmd)
fprintf(out_fp, _("undefined command: %s\n"), name);
}
- return FALSE;
+ return false;
}
@@ -3408,7 +3425,7 @@ command_completion(const char *text, int start, int end)
int idx;
int len;
- rl_attempted_completion_over = TRUE; /* no default filename completion please */
+ rl_attempted_completion_over = true; /* no default filename completion please */
this_cmd = D_illegal;
len = start;
@@ -3446,6 +3463,7 @@ command_completion(const char *text, int start, int end)
return NULL;
}
}
+
if (this_cmd == D_print || this_cmd == D_printf)
return rl_completion_matches(text, variable_generator);
return NULL;
@@ -3506,7 +3524,7 @@ argument_generator(const char *text, int state)
{
static size_t textlen;
static int idx;
- char *name;
+ const char *name;
if (! state) { /* first time */
textlen = strlen(text);
@@ -3514,12 +3532,12 @@ argument_generator(const char *text, int state)
}
if (this_cmd == D_help) {
- while ((name = (char *) cmdtab[idx++].name) != NULL) {
+ while ((name = cmdtab[idx++].name) != NULL) {
if (strncmp(name, text, textlen) == 0)
return estrdup(name, strlen(name));
}
} else {
- while ((name = (char *) argtab[idx].name) != NULL) {
+ while ((name = argtab[idx].name) != NULL) {
if (this_cmd != argtab[idx++].cmd)
continue;
if (strncmp(name, text, textlen) == 0)
@@ -3536,45 +3554,39 @@ variable_generator(const char *text, int state)
{
static size_t textlen;
static int idx = 0;
- static char **pnames = NULL;
- static NODE **var_table = NULL;
- char *name;
- NODE *hp;
+ static NODE *func = NULL;
+ static NODE **vars = NULL;
+ const char *name;
+ NODE *r;
if (! state) { /* first time */
textlen = strlen(text);
- if (var_table != NULL)
- efree(var_table);
- var_table = get_varlist();
+ if (vars != NULL)
+ efree(vars);
+ vars = variable_list();
idx = 0;
- pnames = get_parmlist(); /* names of function params in
- * current context; the array
- * is NULL terminated in
- * awkgram.y (func_install).
- */
+ func = get_function(); /* function in current context */
}
/* function params */
- while (pnames != NULL) {
- name = pnames[idx];
- if (name == NULL) {
- pnames = NULL; /* don't try to match params again */
+ while (func != NULL) {
+ if (idx >= func->param_cnt) {
+ func = NULL; /* don't try to match params again */
idx = 0;
break;
}
- idx++;
+ name = func->fparms[idx++].param;
if (strncmp(name, text, textlen) == 0)
return estrdup(name, strlen(name));
}
/* globals */
- while ((hp = var_table[idx]) != NULL) {
- idx++;
- if (hp->hvalue->type == Node_func)
- continue;
- if (strncmp(hp->hname, text, textlen) == 0)
- return estrdup(hp->hname, hp->hlength);
+ while ((r = vars[idx++]) != NULL) {
+ name = r->vname;
+ if (strncmp(name, text, textlen) == 0)
+ return estrdup(name, strlen(name));
}
+
return NULL;
}
@@ -3599,4 +3611,3 @@ history_expand_line(char **line)
}
#endif
-
diff --git a/command.y b/command.y
index f2044bc9..f6c79812 100644
--- a/command.y
+++ b/command.y
@@ -37,20 +37,20 @@ static void yyerror(const char *mesg, ...);
static int find_command(const char *token, size_t toklen);
-static int want_nodeval = FALSE;
+static bool want_nodeval = false;
static int cmd_idx = -1; /* index of current command in cmd table */
static int repeat_idx = -1; /* index of last repeatable command in command table */
static CMDARG *arg_list = NULL; /* list of arguments */
static long errcount = 0;
static char *lexptr_begin = NULL;
-static int in_commands = FALSE;
+static bool in_commands = false;
static int num_dim;
-static int in_eval = FALSE;
+static bool in_eval = false;
static const char start_EVAL[] = "function @eval(){";
static const char end_EVAL[] = "}";
-static CMDARG *append_statement(CMDARG *alist, char *stmt);
+static CMDARG *append_statement(CMDARG *stmt_list, char *stmt);
static char *next_word(char *p, int len, char **endp);
static NODE *concat_args(CMDARG *a, int count);
@@ -108,7 +108,7 @@ input
| input line
{
cmd_idx = -1;
- want_nodeval = FALSE;
+ want_nodeval = false;
if (lexptr_begin != NULL) {
if (input_from_tty && lexptr_begin[0] != '\0')
add_history(lexptr_begin);
@@ -128,7 +128,7 @@ line
{
if (errcount == 0 && cmd_idx >= 0) {
Func_cmd cmdfunc;
- int terminate = FALSE;
+ bool terminate = false;
CMDARG *args;
int ctype = 0;
@@ -162,7 +162,7 @@ line
if (in_commands)
cmdfunc = do_commands;
cmd_idx = -1;
- want_nodeval = FALSE;
+ want_nodeval = false;
args = arg_list;
arg_list = NULL;
@@ -209,7 +209,7 @@ break_cmd
/* mid-rule action buried in non-terminal to avoid conflict */
set_want_nodeval
- : { want_nodeval = TRUE; }
+ : { want_nodeval = true; }
;
eval_prologue
@@ -226,7 +226,7 @@ eval_prologue
rl_inhibit_completion = 1;
}
cmd_idx = -1;
- in_eval = TRUE;
+ in_eval = true;
}
}
;
@@ -261,7 +261,7 @@ eval_cmd
rl_inhibit_completion = 0;
}
cmd_idx = find_command("eval", 4);
- in_eval = FALSE;
+ in_eval = false;
}
| D_EVAL set_want_nodeval string_node
{
@@ -302,17 +302,17 @@ command
}
| D_IGNORE plus_integer D_INT
| D_ENABLE enable_args
- | D_PRINT { want_nodeval = TRUE; } print_args
- | D_PRINTF { want_nodeval = TRUE; } printf_args
+ | D_PRINT { want_nodeval = true; } print_args
+ | D_PRINTF { want_nodeval = true; } printf_args
| D_LIST list_args
| D_UNTIL location
| D_CLEAR location
| break_cmd break_args
- | D_SET { want_nodeval = TRUE; } variable '=' node
+ | D_SET { want_nodeval = true; } variable '=' node
| D_OPTION option_args
- | D_RETURN { want_nodeval = TRUE; } opt_node
- | D_DISPLAY { want_nodeval = TRUE; } opt_variable
- | D_WATCH { want_nodeval = TRUE; } variable condition_exp
+ | D_RETURN { want_nodeval = true; } opt_node
+ | D_DISPLAY { want_nodeval = true; } opt_variable
+ | D_WATCH { want_nodeval = true; } variable condition_exp
| d_cmd opt_integer_list
| D_DUMP opt_string
| D_SOURCE D_STRING
@@ -337,12 +337,12 @@ command
;
else if (in_commands)
yyerror(_("Can't use command `commands' for breakpoint/watchpoint commands"));
- else if ($2 == NULL && ! (type = has_break_or_watch_point(&num, TRUE)))
+ else if ($2 == NULL && ! (type = has_break_or_watch_point(&num, true)))
yyerror(_("no breakpoint/watchpoint has been set yet"));
- else if ($2 != NULL && ! (type = has_break_or_watch_point(&num, FALSE)))
+ else if ($2 != NULL && ! (type = has_break_or_watch_point(&num, false)))
yyerror(_("invalid breakpoint/watchpoint number"));
if (type) {
- in_commands = TRUE;
+ in_commands = true;
if (input_from_tty) {
dbg_prompt = commands_prompt;
fprintf(out_fp, _("Type commands for when %s %d is hit, one per line.\n"),
@@ -358,7 +358,7 @@ command
else {
if (input_from_tty)
dbg_prompt = dgawk_prompt;
- in_commands = FALSE;
+ in_commands = false;
}
}
| D_SILENT
@@ -378,11 +378,11 @@ command
$2->a_argument = argtab[idx].value;
}
}
- | D_CONDITION plus_integer { want_nodeval = TRUE; } condition_exp
+ | D_CONDITION plus_integer { want_nodeval = true; } condition_exp
{
int type;
int num = $2->a_int;
- type = has_break_or_watch_point(&num, FALSE);
+ type = has_break_or_watch_point(&num, false);
if (! type)
yyerror(_("condition: invalid breakpoint/watchpoint number"));
}
@@ -493,9 +493,9 @@ location
break_args
: /* empty */
{ $$ = NULL; }
- | plus_integer { want_nodeval = TRUE; } condition_exp
+ | plus_integer { want_nodeval = true; } condition_exp
| func_name
- | D_STRING ':' plus_integer { want_nodeval = TRUE; } condition_exp
+ | D_STRING ':' plus_integer { want_nodeval = true; } condition_exp
| D_STRING ':' func_name
;
@@ -686,7 +686,7 @@ node
if ((n->flags & NUMBER) == 0)
yyerror(_("non-numeric value found, numeric expected"));
else
- $2->a_node->numbr = - n->numbr;
+ negate_num(n);
$$ = $2;
}
;
@@ -750,7 +750,7 @@ nls
/* append_statement --- append 'stmt' to the list of eval awk statements */
static CMDARG *
-append_statement(CMDARG *alist, char *stmt)
+append_statement(CMDARG *stmt_list, char *stmt)
{
CMDARG *a, *arg;
char *s;
@@ -760,7 +760,7 @@ append_statement(CMDARG *alist, char *stmt)
if (stmt == start_EVAL) {
len = sizeof(start_EVAL);
- for (a = alist; a != NULL; a = a->next)
+ for (a = stmt_list; a != NULL; a = a->next)
len += strlen(a->a_string) + 1; /* 1 for ',' */
len += EVALSIZE;
@@ -772,7 +772,7 @@ append_statement(CMDARG *alist, char *stmt)
slen = sizeof("function @eval(") - 1;
memcpy(s, start_EVAL, slen);
- for (a = alist; a != NULL; a = a->next) {
+ for (a = stmt_list; a != NULL; a = a->next) {
len = strlen(a->a_string);
memcpy(s + slen, a->a_string, len);
slen += len;
@@ -786,14 +786,14 @@ append_statement(CMDARG *alist, char *stmt)
}
len = strlen(stmt) + 1; /* 1 for newline */
- s = alist->a_string;
+ s = stmt_list->a_string;
slen = strlen(s);
- ssize = alist->a_count;
+ ssize = stmt_list->a_count;
if (len > ssize - slen) {
ssize = slen + len + EVALSIZE;
erealloc(s, char *, (ssize + 2) * sizeof(char), "append_statement");
- alist->a_string = s;
- alist->a_count = ssize;
+ stmt_list->a_string = s;
+ stmt_list->a_count = ssize;
}
memcpy(s + slen, stmt, len);
slen += len;
@@ -803,8 +803,8 @@ append_statement(CMDARG *alist, char *stmt)
}
if (stmt == end_EVAL)
- erealloc(alist->a_string, char *, slen + 2, "append_statement");
- return alist;
+ erealloc(stmt_list->a_string, char *, slen + 2, "append_statement");
+ return stmt_list;
#undef EVALSIZE
}
@@ -1165,7 +1165,7 @@ again:
if (c == '"') {
char *str, *p;
int flags = ALREADY_MALLOCED;
- int esc_seen = FALSE;
+ bool esc_seen = false;
toklen = lexend - lexptr;
emalloc(str, char *, toklen + 2, "yylex");
@@ -1180,7 +1180,7 @@ err:
}
if (c == '\\') {
c = *++lexptr;
- esc_seen = TRUE;
+ esc_seen = true;
if (want_nodeval || c != '"')
*p++ = '\\';
}
@@ -1193,7 +1193,7 @@ err:
if (! want_nodeval) {
yylval = mk_cmdarg(D_string);
- yylval->a_string = estrdup(str, p - str);
+ yylval->a_string = str;
append_cmdarg(yylval);
return D_STRING;
} else { /* awk string */
@@ -1239,22 +1239,37 @@ err:
return D_STRING;
}
- /* assert(want_nodval == TRUE); */
-
/* look for awk number */
if (isdigit((unsigned char) tokstart[0])) {
- double d;
+ NODE *r = NULL;
errno = 0;
- d = strtod(tokstart, &lexptr);
+#ifdef HAVE_MPFR
+ if (do_mpfr) {
+ int tval;
+ r = mpg_float();
+ tval = mpfr_strtofr(r->mpg_numbr, tokstart, & lexptr, 0, ROUND_MODE);
+ IEEE_FMT(r->mpg_numbr, tval);
+ if (mpfr_integer_p(r->mpg_numbr)) {
+ /* integral value, convert to a GMP type. */
+ NODE *tmp = r;
+ r = mpg_integer();
+ mpfr_get_z(r->mpg_i, tmp->mpg_numbr, MPFR_RNDZ);
+ unref(tmp);
+ }
+ } else
+#endif
+ r = make_number(strtod(tokstart, & lexptr));
+
if (errno != 0) {
yyerror(strerror(errno));
+ unref(r);
errno = 0;
return '\n';
}
yylval = mk_cmdarg(D_node);
- yylval->a_node = make_number(d);
+ yylval->a_node = r;
append_cmdarg(yylval);
return D_NODE;
}
@@ -1362,7 +1377,7 @@ find_command(const char *token, size_t toklen)
{
char *name, *abrv;
int i, k;
- int try_exact = TRUE;
+ bool try_exact = true;
int abrv_match = -1;
int partial_match = -1;
@@ -1384,8 +1399,10 @@ find_command(const char *token, size_t toklen)
&& strncmp(name, token, toklen) == 0
)
return i;
- if (*name > *token)
- try_exact = FALSE;
+
+ if (*name > *token || i == (k - 1))
+ try_exact = false;
+
if (abrv_match < 0) {
abrv = cmdtab[i].abbrvn;
if (abrv[0] == token[0]) {
@@ -1438,7 +1455,7 @@ do_help(CMDARG *arg, int cmd)
fprintf(out_fp, _("undefined command: %s\n"), name);
}
- return FALSE;
+ return false;
}
@@ -1487,7 +1504,7 @@ command_completion(const char *text, int start, int end)
int idx;
int len;
- rl_attempted_completion_over = TRUE; /* no default filename completion please */
+ rl_attempted_completion_over = true; /* no default filename completion please */
this_cmd = D_illegal;
len = start;
@@ -1525,6 +1542,7 @@ command_completion(const char *text, int start, int end)
return NULL;
}
}
+
if (this_cmd == D_print || this_cmd == D_printf)
return rl_completion_matches(text, variable_generator);
return NULL;
@@ -1585,7 +1603,7 @@ argument_generator(const char *text, int state)
{
static size_t textlen;
static int idx;
- char *name;
+ const char *name;
if (! state) { /* first time */
textlen = strlen(text);
@@ -1593,12 +1611,12 @@ argument_generator(const char *text, int state)
}
if (this_cmd == D_help) {
- while ((name = (char *) cmdtab[idx++].name) != NULL) {
+ while ((name = cmdtab[idx++].name) != NULL) {
if (strncmp(name, text, textlen) == 0)
return estrdup(name, strlen(name));
}
} else {
- while ((name = (char *) argtab[idx].name) != NULL) {
+ while ((name = argtab[idx].name) != NULL) {
if (this_cmd != argtab[idx++].cmd)
continue;
if (strncmp(name, text, textlen) == 0)
@@ -1615,45 +1633,39 @@ variable_generator(const char *text, int state)
{
static size_t textlen;
static int idx = 0;
- static char **pnames = NULL;
- static NODE **var_table = NULL;
- char *name;
- NODE *hp;
+ static NODE *func = NULL;
+ static NODE **vars = NULL;
+ const char *name;
+ NODE *r;
if (! state) { /* first time */
textlen = strlen(text);
- if (var_table != NULL)
- efree(var_table);
- var_table = get_varlist();
+ if (vars != NULL)
+ efree(vars);
+ vars = variable_list();
idx = 0;
- pnames = get_parmlist(); /* names of function params in
- * current context; the array
- * is NULL terminated in
- * awkgram.y (func_install).
- */
+ func = get_function(); /* function in current context */
}
/* function params */
- while (pnames != NULL) {
- name = pnames[idx];
- if (name == NULL) {
- pnames = NULL; /* don't try to match params again */
+ while (func != NULL) {
+ if (idx >= func->param_cnt) {
+ func = NULL; /* don't try to match params again */
idx = 0;
break;
}
- idx++;
+ name = func->fparms[idx++].param;
if (strncmp(name, text, textlen) == 0)
return estrdup(name, strlen(name));
}
/* globals */
- while ((hp = var_table[idx]) != NULL) {
- idx++;
- if (hp->hvalue->type == Node_func)
- continue;
- if (strncmp(hp->hname, text, textlen) == 0)
- return estrdup(hp->hname, hp->hlength);
+ while ((r = vars[idx++]) != NULL) {
+ name = r->vname;
+ if (strncmp(name, text, textlen) == 0)
+ return estrdup(name, strlen(name));
}
+
return NULL;
}
@@ -1678,4 +1690,3 @@ history_expand_line(char **line)
}
#endif
-
diff --git a/configh.in b/configh.in
index 8cb9826e..4a16adf4 100644
--- a/configh.in
+++ b/configh.in
@@ -150,6 +150,9 @@
/* we have the mktime function */
#undef HAVE_MKTIME
+/* Define to 1 if you have fully functional mpfr and gmp libraries. */
+#undef HAVE_MPFR
+
/* Define to 1 if you have the <netdb.h> header file. */
#undef HAVE_NETDB_H
diff --git a/configure b/configure
index d286a8ab..fd9b1527 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for GNU Awk 4.0.1a.
+# Generated by GNU Autoconf 2.69 for GNU Awk 4.0.70.
#
# Report bugs to <bug-gawk@gnu.org>.
#
@@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='GNU Awk'
PACKAGE_TARNAME='gawk'
-PACKAGE_VERSION='4.0.1a'
-PACKAGE_STRING='GNU Awk 4.0.1a'
+PACKAGE_VERSION='4.0.70'
+PACKAGE_STRING='GNU Awk 4.0.70'
PACKAGE_BUGREPORT='bug-gawk@gnu.org'
PACKAGE_URL='http://www.gnu.org/software/gawk/'
@@ -624,9 +624,13 @@ ac_includes_default="\
gt_needs=
ac_header_list=
ac_func_list=
+enable_option_checking=no
ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
+subdirs
+GAWKLIBEXT
+LIBMPFR
LIBREADLINE
SOCKET_LIBS
LIBSIGSEGV_PREFIX
@@ -659,6 +663,8 @@ GMSGFMT
MSGFMT
GETTEXT_MACRO_VERSION
USE_NLS
+pkgextensiondir
+acl_shlibext
LN_S
YFLAGS
YACC
@@ -757,6 +763,7 @@ with_libiconv_prefix
with_libintl_prefix
with_libsigsegv_prefix
with_readline
+with_mpfr
'
ac_precious_vars='build_alias
host_alias
@@ -769,7 +776,7 @@ CPPFLAGS
CPP
YACC
YFLAGS'
-
+ac_subdirs_all='extension'
# Initialize some variables set by options.
ac_init_help=
@@ -1309,7 +1316,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures GNU Awk 4.0.1a to adapt to many kinds of systems.
+\`configure' configures GNU Awk 4.0.70 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1379,7 +1386,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of GNU Awk 4.0.1a:";;
+ short | recursive ) echo "Configuration of GNU Awk 4.0.70:";;
esac
cat <<\_ACEOF
@@ -1408,6 +1415,7 @@ Optional Packages:
--with-libsigsegv-prefix[=DIR] search for libsigsegv in DIR/include and DIR/lib
--without-libsigsegv-prefix don't search for libsigsegv in includedir and libdir
--with-readline=DIR look for the readline library in DIR
+ --with-mpfr=DIR look for the mpfr and gmp libraries in DIR
Some influential environment variables:
CC C compiler command
@@ -1493,7 +1501,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-GNU Awk configure 4.0.1a
+GNU Awk configure 4.0.70
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2202,7 +2210,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by GNU Awk $as_me 4.0.1a, which was
+It was created by GNU Awk $as_me 4.0.70, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3046,7 +3054,7 @@ fi
# Define the identity of the package.
PACKAGE='gawk'
- VERSION='4.0.1a'
+ VERSION='4.0.70'
cat >>confdefs.h <<_ACEOF
@@ -5545,10 +5553,17 @@ $as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
+ CFLAGS="$CFLAGS -DNDEBUG" # turn off assertions
fi
+# shared library suffix for dynamic loading:
+
+# default shared library location
+pkgextensiondir='${pkglibdir}'
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for z/OS USS compilation" >&5
$as_echo_n "checking for z/OS USS compilation... " >&6; }
@@ -10003,20 +10018,6 @@ $as_echo "#define HAVE_MBRTOWC 1" >>confdefs.h
ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default"
if test "x$ac_cv_header_dlfcn_h" = xyes; then :
-$as_echo "#define DYNAMIC 1" >>confdefs.h
-
- if test "$GCC" = yes
- then
- # Add others here as appropriate,
- # one day use GNU libtool.
- # 3/2010: Used to have cygwin here but removed since
- # we get complaints that -export-dynamic doesn't work.
- if uname | $EGREP -i 'linux|freebsd' > /dev/null
- then
- LDFLAGS="$LDFLAGS -export-dynamic"
- fi
- fi
-
# Check this separately. Some systems have dlopen
# in libc. Notably freebsd and cygwin.
# HP-NSK has it in zrldsrl
@@ -10073,9 +10074,19 @@ $as_echo "$ac_cv_search_dlopen" >&6; }
ac_res=$ac_cv_search_dlopen
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
+ gawk_have_dlopen=yes
+else
+ gawk_have_dlopen=no
fi
+ # Only do DYNAMIC if we have the lip. z/OS (some versions) have
+ # the header but not the lib, apparently
+ if test "$gawk_have_dlopen" = yes
+ then
+
+$as_echo "#define DYNAMIC 1" >>confdefs.h
+
+ fi
fi
@@ -10390,6 +10401,81 @@ $as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h
fi
+
+
+# Check whether --with-mpfr was given.
+if test "${with_mpfr+set}" = set; then :
+ withval=$with_mpfr; _do_mpfr=$withval
+else
+ _do_mpfr=yes
+fi
+
+
+ if test "$_do_mpfr" != "no" ; then
+ if test -d "$withval" ; then
+ CPPFLAGS="${CPPFLAGS} -I$withval/include"
+ LDFLAGS="${LDFLAGS} -L$withval/lib"
+ fi
+
+ _mpfr_save_libs=$LIBS
+ _combo="-lmpfr -lgmp"
+ LIBS="$LIBS $_combo"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mpfr via \"$_combo\" is present and usable" >&5
+$as_echo_n "checking whether mpfr via \"$_combo\" is present and usable... " >&6; }
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+#include <stdio.h>
+#include <mpfr.h>
+#include <gmp.h>
+
+int
+main ()
+{
+
+mpfr_t p;
+mpz_t z;
+mpfr_init(p);
+mpz_init(z);
+mpfr_printf("%Rf%Zd", p, z);
+mpfr_clear(p);
+mpz_clear(z);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ _found_mpfr=yes
+else
+ _found_mpfr=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_found_mpfr" >&5
+$as_echo "$_found_mpfr" >&6; }
+
+ LIBS=$_mpfr_save_libs
+
+ if test $_found_mpfr = yes ; then
+
+$as_echo "#define HAVE_MPFR 1" >>confdefs.h
+
+ LIBMPFR=$_combo
+
+ break
+ fi
+
+ unset _mpfr_save_libs
+ unset _combo
+ unset _found_mpfr
+ fi
+
+
ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default"
if test "x$ac_cv_member_struct_stat_st_blksize" = xyes; then :
@@ -10776,8 +10862,18 @@ ac_config_headers="$ac_config_headers config.h:configh.in"
+case $acl_shlibext in
+dylib) GAWKLIBEXT=so ;; # MacOS uses .dylib for shared libraries, but libtool uses .so for modules
+*) GAWKLIBEXT=$acl_shlibext ;;
+esac
+
+
ac_config_files="$ac_config_files Makefile awklib/Makefile doc/Makefile po/Makefile.in test/Makefile"
+
+
+subdirs="$subdirs extension"
+
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
@@ -11312,7 +11408,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by GNU Awk $as_me 4.0.1a, which was
+This file was extended by GNU Awk $as_me 4.0.70, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -11380,7 +11476,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-GNU Awk config.status 4.0.1a
+GNU Awk config.status 4.0.70
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
@@ -12358,6 +12454,151 @@ if test "$no_create" != yes; then
# would make configure fail if this is the last instruction.
$ac_cs_success || as_fn_exit 1
fi
+
+#
+# CONFIG_SUBDIRS section.
+#
+if test "$no_recursion" != yes; then
+
+ # Remove --cache-file, --srcdir, and --disable-option-checking arguments
+ # so they do not pile up.
+ ac_sub_configure_args=
+ ac_prev=
+ eval "set x $ac_configure_args"
+ shift
+ for ac_arg
+ do
+ if test -n "$ac_prev"; then
+ ac_prev=
+ continue
+ fi
+ case $ac_arg in
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
+ | --c=*)
+ ;;
+ --config-cache | -C)
+ ;;
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ ;;
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ ;;
+ --disable-option-checking)
+ ;;
+ *)
+ case $ac_arg in
+ *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append ac_sub_configure_args " '$ac_arg'" ;;
+ esac
+ done
+
+ # Always prepend --prefix to ensure using the same prefix
+ # in subdir configurations.
+ ac_arg="--prefix=$prefix"
+ case $ac_arg in
+ *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args"
+
+ # Pass --silent
+ if test "$silent" = yes; then
+ ac_sub_configure_args="--silent $ac_sub_configure_args"
+ fi
+
+ # Always prepend --disable-option-checking to silence warnings, since
+ # different subdirs can have different --enable and --with options.
+ ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args"
+
+ ac_popdir=`pwd`
+ for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue
+
+ # Do not complain, so a configure script can configure whichever
+ # parts of a large source tree are present.
+ test -d "$srcdir/$ac_dir" || continue
+
+ ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)"
+ $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5
+ $as_echo "$ac_msg" >&6
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ cd "$ac_dir"
+
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ ac_sub_configure=$ac_srcdir/configure.gnu
+ elif test -f "$ac_srcdir/configure"; then
+ ac_sub_configure=$ac_srcdir/configure
+ elif test -f "$ac_srcdir/configure.in"; then
+ # This should be Cygnus configure.
+ ac_sub_configure=$ac_aux_dir/configure
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5
+$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;}
+ ac_sub_configure=
+ fi
+
+ # The recursion is here.
+ if test -n "$ac_sub_configure"; then
+ # Make the cache file name correct relative to the subdirectory.
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;;
+ *) # Relative name.
+ ac_sub_cache_file=$ac_top_build_prefix$cache_file ;;
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5
+$as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;}
+ # The eval makes quoting arguments work.
+ eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \
+ --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" ||
+ as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5
+ fi
+
+ cd "$ac_popdir"
+ done
+fi
if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
diff --git a/configure.ac b/configure.ac
index ac257f98..575b3da3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@ dnl
dnl Process this file with autoconf to produce a configure script.
-AC_INIT([GNU Awk], 4.0.1a, bug-gawk@gnu.org, gawk)
+AC_INIT([GNU Awk], 4.0.70, bug-gawk@gnu.org, gawk)
# This is a hack. Different versions of install on different systems
# are just too different. Chuck it and use install-sh.
@@ -95,10 +95,16 @@ then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
+ CFLAGS="$CFLAGS -DNDEBUG" # turn off assertions
fi
AC_SUBST(CFLAGS)
+# shared library suffix for dynamic loading:
+AC_SUBST(acl_shlibext)
+# default shared library location
+AC_SUBST([pkgextensiondir], ['${pkglibdir}'])
+
dnl checks for systems
AC_ZOS_USS
AC_ISC_POSIX
@@ -279,23 +285,17 @@ AC_FUNC_MBRTOWC
dnl check for dynamic linking
dnl This is known to be very primitive
AC_CHECK_HEADER(dlfcn.h,
- [AC_DEFINE([DYNAMIC], 1, [dynamic loading is possible])
- if test "$GCC" = yes
- then
- # Add others here as appropriate,
- # one day use GNU libtool.
- # 3/2010: Used to have cygwin here but removed since
- # we get complaints that -export-dynamic doesn't work.
- if uname | $EGREP -i 'linux|freebsd' > /dev/null
- then
- LDFLAGS="$LDFLAGS -export-dynamic"
- fi
- fi
-
+ [
# Check this separately. Some systems have dlopen
# in libc. Notably freebsd and cygwin.
# HP-NSK has it in zrldsrl
- AC_SEARCH_LIBS(dlopen, dl zrldsrl)
+ AC_SEARCH_LIBS(dlopen, dl zrldsrl, gawk_have_dlopen=yes, gawk_have_dlopen=no)
+ # Only do DYNAMIC if we have the lip. z/OS (some versions) have
+ # the header but not the lib, apparently
+ if test "$gawk_have_dlopen" = yes
+ then
+ AC_DEFINE([DYNAMIC], 1, [dynamic loading is possible])
+ fi
])
dnl check for how to use getpgrp
@@ -343,6 +343,9 @@ GAWK_AC_LIB_SOCKETS
dnl check for readline support
GNUPG_CHECK_READLINE
+dnl check for mpfr support
+GNUPG_CHECK_MPFR
+
dnl checks for structure members
AC_STRUCT_ST_BLKSIZE
AC_HEADER_TIME
@@ -359,9 +362,19 @@ AC_C_STRINGIZE
AC_CONFIG_HEADERS([config.h:configh.in])
AH_BOTTOM([#include "custom.h"])
+dnl Crude but small hack to make plug-ins work on Mac OS X
+dnl We should really use the libtool value for shrext_cmds, but that
+dnl is not available here, since we do not use libtool at the top level.
+case $acl_shlibext in
+dylib) GAWKLIBEXT=so ;; # MacOS uses .dylib for shared libraries, but libtool uses .so for modules
+*) GAWKLIBEXT=$acl_shlibext ;;
+esac
+AC_SUBST(GAWKLIBEXT)
+
AC_CONFIG_FILES(Makefile
awklib/Makefile
doc/Makefile
po/Makefile.in
test/Makefile)
+AC_CONFIG_SUBDIRS(extension)
AC_OUTPUT
diff --git a/debug.c b/debug.c
index d8f5d5ee..6dda3a46 100644
--- a/debug.c
+++ b/debug.c
@@ -30,7 +30,7 @@
#include <fcntl.h> /* open() */
#endif
-extern int exiting;
+extern bool exiting;
extern SRCFILE *srcfiles;
extern INSTRUCTION *rule_list;
extern INSTRUCTION *code_block;
@@ -40,12 +40,9 @@ extern FILE *output_fp;
extern IOBUF *curfile;
extern const char *command_file;
extern const char *get_spec_varname(Func_ptr fptr);
-extern int r_interpret(INSTRUCTION *);
extern int zzparse(void);
#define read_command() (void) zzparse()
-extern int free_instruction(INSTRUCTION *, int *);
-extern void destroy_symbol(char *name);
extern const char *redir2str(int redirtype);
static char *linebuf = NULL; /* used to print a single line of source */
@@ -54,9 +51,9 @@ static size_t linebuf_len;
FILE *out_fp;
char *dbg_prompt;
char *commands_prompt = "> "; /* breakpoint or watchpoint commands list */
-char *eval_prompt = "@> "; /* awk statement(s) */
+char *eval_prompt = "@> "; /* awk statement(s) */
-int input_from_tty = FALSE;
+bool input_from_tty = false;
int input_fd;
static SRCFILE *cur_srcfile;
@@ -64,7 +61,7 @@ static long cur_frame = 0;
static INSTRUCTION *cur_pc;
int cur_rule = 0;
-static int prog_running = FALSE;
+static bool prog_running = false;
struct condition {
INSTRUCTION *code;
@@ -92,7 +89,7 @@ typedef struct break_point {
INSTRUCTION *bpi; /* Op_breakpoint */
struct commands_item commands; /* list of commands to run */
- int silent;
+ bool silent;
struct condition cndn;
@@ -171,12 +168,12 @@ static struct {
INSTRUCTION *pc; /* 'until' and 'return' commands */
int repeat_count; /* 'step', 'next', 'stepi', 'nexti' commands */
- int print_frame; /* print frame info, 'finish' and 'until' */
- int print_ret; /* print returned value, 'finish' */
+ bool print_frame; /* print frame info, 'finish' and 'until' */
+ bool print_ret; /* print returned value, 'finish' */
int break_point; /* non-zero (breakpoint number) if stopped at break point */
int watch_point; /* non-zero (watchpoint number) if stopped at watch point */
- int (*check_func)(INSTRUCTION **); /* function to decide when to suspend
+ int (*check_func)(INSTRUCTION **); /* function to decide when to suspend
* awk interpreter and return control
* to debugger command interpreter.
*/
@@ -187,7 +184,7 @@ static struct {
/* restart related stuff */
extern char **d_argv; /* copy of argv array */
-static int need_restart = FALSE;
+static bool need_restart = false;
enum { BREAK=1, WATCH, DISPLAY, HISTORY, OPTION };
static const char *const env_variable[] = {
"",
@@ -216,9 +213,9 @@ struct dbg_option {
const char *help_txt;
};
-#define DEFAULT_HISTFILE "./.dgawk_history"
-#define DEFAULT_OPTFILE "./.dgawkrc"
-#define DEFAULT_PROMPT "dgawk> "
+#define DEFAULT_HISTFILE "./.gawk_history"
+#define DEFAULT_OPTFILE "./.gawkrc"
+#define DEFAULT_PROMPT "gawk> "
#define DEFAULT_LISTSIZE 15
#define DEFAULT_HISTSIZE 100
@@ -234,14 +231,14 @@ static const char *options_file = DEFAULT_OPTFILE;
static const char *history_file = DEFAULT_HISTFILE;
#endif
-/* keep all option variables in one place */
+/* debugger option related variables */
static char *output_file = "/dev/stdout"; /* gawk output redirection */
-char *dgawk_prompt = NULL; /* initialized in interpret */
+char *dgawk_prompt = NULL; /* initialized in interpret */
static int list_size = DEFAULT_LISTSIZE; /* # of lines that 'list' prints */
-static int do_trace = FALSE;
-static int do_save_history = TRUE;
-static int do_save_options = TRUE;
+static int do_trace = false;
+static int do_save_history = true;
+static int do_save_options = true;
static int history_size = DEFAULT_HISTSIZE; /* max # of lines in history file */
static const struct dbg_option option_list[] = {
@@ -267,18 +264,18 @@ static void save_options(const char *file);
/* pager */
jmp_buf pager_quit_tag;
-int pager_quit_tag_valid;
+bool pager_quit_tag_valid = false;
static int screen_width = INT_MAX; /* no of columns */
static int screen_height = INT_MAX; /* no of rows */
static int pager_lines_printed = 0; /* no of lines printed so far */
-static void restart(int run) ATTRIBUTE_NORETURN;
+static void restart(bool run) ATTRIBUTE_NORETURN;
static void close_all(void);
static int open_readfd(const char *file);
static int find_lines(SRCFILE *s);
static SRCFILE *source_find(char *src);
static int print_lines(char *src, int start_line, int nlines);
-static void print_symbol(NODE *r, int isparam);
+static void print_symbol(NODE *r, bool isparam);
static NODE *find_frame(long num);
static NODE *find_param(const char *name, long num, char **pname);
static NODE *find_symbol(const char *name, char **pname);
@@ -295,10 +292,9 @@ static void delete_commands_item(struct commands_item *c);
static NODE *execute_code(volatile INSTRUCTION *code);
static int pre_execute_code(INSTRUCTION **pi);
static int parse_condition(int type, int num, char *expr);
-static BREAKPOINT *add_breakpoint(INSTRUCTION *, INSTRUCTION *, char *, int);
+static BREAKPOINT *add_breakpoint(INSTRUCTION *prevp, INSTRUCTION *ip, char *src, bool silent);
static BREAKPOINT *set_breakpoint_next(INSTRUCTION *rp, INSTRUCTION *ip);
-static BREAKPOINT *set_breakpoint_at(INSTRUCTION *, int, int);
-static int set_breakpoint(CMDARG *arg, int temporary);
+static BREAKPOINT *set_breakpoint_at(INSTRUCTION *rp, int lineno, bool silent);
static void delete_breakpoint(BREAKPOINT *b);
static BREAKPOINT *find_breakpoint(long num);
static void display(struct list_item *d);
@@ -307,15 +303,16 @@ static struct list_item *add_item(struct list_item *list, int type, NODE *symbol
static void delete_item(struct list_item *d);
static int breakpoint_triggered(BREAKPOINT *b);
static int watchpoint_triggered(struct list_item *w);
-
static void print_instruction(INSTRUCTION *pc, Func_print print_func, FILE *fp, int in_dump);
+static int print_code(INSTRUCTION *pc, void *x);
static void next_command();
+static void debug_post_execute(INSTRUCTION *pc);
+static int debug_pre_execute(INSTRUCTION **pi);
static char *g_readline(const char *prompt);
static int prompt_yes_no(const char *, char , int , FILE *);
-
static struct pf_data {
Func_print print_func;
- int defn;
+ bool defn;
FILE *fp;
} pf_data;
@@ -328,24 +325,21 @@ struct command_source
char * (*read_func)(const char *);
int (*close_func)(int);
int eof_status; /* see push_cmd_src */
- int cmd; /* D_source or 0 */
- char *str; /* sourced file */
+ int cmd; /* D_source or 0 */
+ char *str; /* sourced file */
struct command_source *next;
};
static struct command_source *cmd_src = NULL;
-#define get_param_count(f) (f)->lnode->param_cnt
-#define get_params(f) (f)->parmlist
-
#define CHECK_PROG_RUNNING() \
do { \
if (! prog_running) { \
d_error(_("program not running.")); \
- return FALSE; \
+ return false; \
} \
- } while (FALSE)
+ } while (false)
/* g_readline -- read a line of text; the interface is like 'readline' but
@@ -490,11 +484,11 @@ source_find(char *src)
return s;
}
- path = find_source(src, &sbuf, &errno_val);
+ path = find_source(src, & sbuf, & errno_val, false);
if (path != NULL) {
for (s = srcfiles->next; s != srcfiles; s = s->next) {
if ((s->stype == SRC_FILE || s->stype == SRC_INC)
- && files_are_same(path, s)) {
+ && files_are_same(path, s)) {
efree(path);
return s;
}
@@ -579,10 +573,10 @@ print_lines(char *src, int start_line, int nlines)
*/
if (nlines > 1) {
BREAKPOINT *b;
- int has_bpt = FALSE;
+ bool has_bpt = false;
for (b = breakpoints.prev; b != &breakpoints; b = b->prev) {
if (src == b->src && i == b->bpi->source_line) {
- has_bpt = TRUE;
+ has_bpt = true;
break;
}
}
@@ -657,7 +651,7 @@ do_list(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
if (last_printed_line != last_print_count)
line_first = 1;
else
- return FALSE;
+ return false;
}
} else {
line:
@@ -711,7 +705,7 @@ list:
last_printed_line = line_last;
last_print_count = line_last - line_first + 1;
}
- return FALSE;
+ return false;
}
/* do_info --- info command */
@@ -719,8 +713,10 @@ list:
int
do_info(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
{
+ NODE **table;
+
if (arg == NULL || arg->type != D_argument)
- return FALSE;
+ return false;
switch (arg->a_argument) {
case A_SOURCE:
@@ -804,7 +800,6 @@ do_info(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
INSTRUCTION *pc;
int arg_count, pcount;
int i, from, to;
- char **pnames;
CHECK_PROG_RUNNING();
f = find_frame(cur_frame);
@@ -812,11 +807,10 @@ do_info(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
if (func == NULL) {
/* print ARGV ? */
fprintf(out_fp, _("None in main().\n"));
- return FALSE;
+ return false;
}
- pcount = get_param_count(func); /* # of defined params */
- pnames = get_params(func); /* param names */
+ pcount = func->param_cnt; /* # of defined params */
pc = (INSTRUCTION *) f->reti; /* Op_func_call instruction */
arg_count = (pc + 1)->expr_count; /* # of arguments supplied */
@@ -836,8 +830,8 @@ do_info(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
r = f->stack[i];
if (r->type == Node_array_ref)
r = r->orig_array;
- fprintf(out_fp, "%s = ", pnames[i]);
- print_symbol(r, TRUE);
+ fprintf(out_fp, "%s = ", func->fparms[i].param);
+ print_symbol(r, true);
}
if (to < from)
fprintf(out_fp, "%s",
@@ -848,25 +842,28 @@ do_info(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
break;
case A_VARIABLES:
+ table = variable_list();
initialize_pager(out_fp);
if (setjmp(pager_quit_tag) == 0) {
gprintf(out_fp, _("All defined variables:\n\n"));
- print_vars(gprintf, out_fp);
+ print_vars(table, gprintf, out_fp);
}
+ efree(table);
break;
case A_FUNCTIONS:
+ table = function_list(true);
initialize_pager(out_fp);
if (setjmp(pager_quit_tag) == 0) {
gprintf(out_fp, _("All defined functions:\n\n"));
pf_data.print_func = gprintf;
pf_data.fp = out_fp;
- pf_data.defn = TRUE;
- (void) foreach_func((int (*)(INSTRUCTION *, void *)) print_function,
- FALSE, /* sort */
- &pf_data /* data */
- );
+ pf_data.defn = true;
+ (void) foreach_func(table,
+ (int (*)(INSTRUCTION *, void *)) print_function,
+ &pf_data);
}
+ efree(table);
break;
case A_DISPLAY:
@@ -896,7 +893,7 @@ do_info(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
}
gprintf(out_fp, "\n");
} else if (IS_FIELD(d))
- gprintf(out_fp, "%d:\t$%ld\n", d->number, (long) symbol->numbr);
+ gprintf(out_fp, "%d:\t$%ld\n", d->number, get_number_si(symbol));
else
gprintf(out_fp, "%d:\t%s\n", d->number, d->sname);
if (d->cndn.code != NULL)
@@ -927,13 +924,13 @@ do_info(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
break;
}
- return FALSE;
+ return false;
}
/* print_symbol --- print a symbol table entry */
static void
-print_symbol(NODE *r, int isparam)
+print_symbol(NODE *r, bool isparam)
{
switch (r->type) {
case Node_var_new:
@@ -964,7 +961,7 @@ find_frame(long num)
if (num == 0)
return frame_ptr;
- assert(prog_running == TRUE);
+ assert(prog_running == true);
assert(num <= fcall_count);
assert(fcall_list[num] != NULL);
return fcall_list[num];
@@ -977,6 +974,7 @@ find_param(const char *name, long num, char **pname)
{
NODE *r = NULL;
NODE *f;
+ char *fparam;
if (pname)
*pname = NULL;
@@ -986,20 +984,18 @@ find_param(const char *name, long num, char **pname)
f = find_frame(num);
if (f->func_node != NULL) { /* in function */
NODE *func;
- char **pnames;
int i, pcount;
func = f->func_node;
- pnames = get_params(func);
- pcount = get_param_count(func);
-
+ pcount = func->param_cnt;
for (i = 0; i < pcount; i++) {
- if (strcmp(name, pnames[i]) == 0) {
+ fparam = func->fparms[i].param;
+ if (strcmp(name, fparam) == 0) {
r = f->stack[i];
if (r->type == Node_array_ref)
r = r->orig_array;
if (pname)
- *pname = pnames[i];
+ *pname = fparam;
break;
}
}
@@ -1059,7 +1055,7 @@ print_field(long field_num)
static int
print_array(volatile NODE *arr, char *arr_name)
{
- NODE *bucket;
+ NODE *subs;
NODE **list;
int i;
size_t num_elems = 0;
@@ -1067,7 +1063,7 @@ print_array(volatile NODE *arr, char *arr_name)
volatile int ret = 0;
volatile jmp_buf pager_quit_tag_stack;
- if (arr->var_array == NULL || arr->table_size == 0) {
+ if (array_empty(arr)) {
gprintf(out_fp, _("array `%s' is empty\n"), arr_name);
return 0;
}
@@ -1080,12 +1076,12 @@ print_array(volatile NODE *arr, char *arr_name)
PUSH_BINDING(pager_quit_tag_stack, pager_quit_tag, pager_quit_tag_valid);
if (setjmp(pager_quit_tag) == 0) {
for (i = 0; ret == 0 && i < num_elems; i++) {
- bucket = list[i];
- r = bucket->ahvalue;
+ subs = list[i];
+ r = *assoc_lookup((NODE *) arr, subs);
if (r->type == Node_var_array)
ret = print_array(r, r->vname);
else {
- gprintf(out_fp, "%s[\"%s\"] = ", arr_name, bucket->ahname_str);
+ gprintf(out_fp, "%s[\"%s\"] = ", arr_name, subs->stptr);
valinfo((NODE *) r, gprintf, out_fp);
}
}
@@ -1118,7 +1114,7 @@ print_subscript(NODE *arr, char *arr_name, CMDARG *a, int count)
else {
/* print # of elements in array */
fprintf(out_fp, "%s = ", r->vname);
- print_symbol(r, FALSE);
+ print_symbol(r, false);
}
} else {
fprintf(out_fp, "%s[\"%s\"] = ", arr_name, subs->stptr);
@@ -1183,7 +1179,7 @@ do_print_var(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
break;
case D_field:
- print_field(a->a_node->numbr);
+ print_field(get_number_si(a->a_node));
break;
default:
@@ -1191,7 +1187,7 @@ do_print_var(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
break;
}
}
- return FALSE;
+ return false;
}
/* do_set_var --- set command */
@@ -1215,7 +1211,7 @@ do_set_var(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
switch (r->type) {
case Node_var_new:
r->type = Node_var;
- r->var_value = Nnull_string;
+ r->var_value = dupnode(Nnull_string);
/* fall through */
case Node_var:
lhs = &r->var_value;
@@ -1255,7 +1251,7 @@ do_set_var(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
else {
arg = arg->next;
val = arg->a_node;
- lhs = assoc_lookup(r, subs, FALSE);
+ lhs = assoc_lookup(r, subs);
unref(*lhs);
*lhs = dupnode(val);
fprintf(out_fp, "%s[\"%s\"] = ", name, subs->stptr);
@@ -1264,12 +1260,10 @@ do_set_var(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
} else {
if (value == NULL) {
NODE *array;
-
- getnode(array);
- array->type = Node_var_array;
- array->var_array = NULL;
+ array = make_array();
array->vname = estrdup(subs->stptr, subs->stlen);
- *assoc_lookup(r, subs, FALSE) = array;
+ array->parent_array = r;
+ *assoc_lookup(r, subs) = array;
r = array;
} else if (value->type != Node_var_array) {
d_error(_("attempt to use scalar `%s[\"%s\"]' as array"),
@@ -1289,7 +1283,7 @@ do_set_var(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
long field_num;
Func_ptr assign = NULL;
- field_num = (long) arg->a_node->numbr;
+ field_num = get_number_si(arg->a_node);
assert(field_num >= 0);
arg = arg->next;
val = arg->a_node;
@@ -1305,8 +1299,8 @@ do_set_var(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
default:
break;
}
- return FALSE;
-}
+ return false;
+}
/* find_item --- find an item in the watch/display list */
@@ -1350,7 +1344,7 @@ delete_item(struct list_item *d)
delete_commands_item(c->next);
}
- free_context(d->cndn.ctxt, FALSE);
+ free_context(d->cndn.ctxt, false);
if (d->cndn.expr != NULL)
efree(d->cndn.expr);
@@ -1378,14 +1372,18 @@ add_item(struct list_item *list, int type, NODE *symbol, char *pname)
d->fcall_count = fcall_count - cur_frame;
}
- if (type == D_field) { /* field number */
+ if (type == D_field) {
+ /* field number */
d->symbol = symbol;
d->flags |= FIELD_NUM;
- } else if (type == D_subscript) { /* subscript */
+ } else if (type == D_subscript) {
+ /* subscript */
d->symbol = symbol;
d->flags |= SUBSCRIPT;
- } else /* array or variable */
+ } else {
+ /* array or variable */
d->symbol = symbol;
+ }
/* add to list */
d->next = list->next;
@@ -1430,7 +1428,7 @@ do_add_item(struct list_item *list, CMDARG *arg)
for (i = 0; i < count; i++) {
arg = arg->next;
subs[i] = dupnode(arg->a_node);
- (void) force_string(subs[i]);
+ subs[i] = force_string(subs[i]);
}
item->subs = subs;
item->num_subs = count;
@@ -1535,7 +1533,7 @@ display(struct list_item *d)
} else if (IS_FIELD(d)) {
NODE *r = d->symbol;
fprintf(out_fp, "%d: ", d->number);
- print_field(r->numbr);
+ print_field(get_number_si(r));
} else {
print_sym:
fprintf(out_fp, "%d: %s = ", d->number, d->sname);
@@ -1555,13 +1553,13 @@ do_display(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
/* display all items */
for (d = display_list.prev; d != &display_list; d = d->prev)
display(d);
- return FALSE;
+ return false;
}
if ((d = do_add_item(&display_list, arg)) != NULL)
display(d);
- return FALSE;
+ return false;
}
/* do_undisplay --- undisplay command */
@@ -1570,7 +1568,7 @@ int
do_undisplay(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
{
do_delete_item(&display_list, arg);
- return FALSE;
+ return false;
}
/* condition_triggered --- test if a condition expression is true */
@@ -1583,22 +1581,21 @@ condition_triggered(struct condition *cndn)
assert(cndn != NULL);
if (cndn->code == NULL)
- return TRUE;
+ return true;
push_context(cndn->ctxt);
r = execute_code((volatile INSTRUCTION *) cndn->code);
pop_context(); /* switch to prev context */
if (r == NULL) /* fatal error */
- return FALSE; /* not triggered */
+ return false; /* not triggered */
force_number(r);
- di = (r->numbr != 0.0);
+ di = ! iszero(r);
DEREF(r);
return di;
}
-
static int
find_subscript(struct list_item *item, NODE **ptr)
{
@@ -1617,11 +1614,12 @@ find_subscript(struct list_item *item, NODE **ptr)
else if (i < count - 1)
return -1;
}
- *ptr = r;
+ if (r != NULL)
+ *ptr = r;
return 0;
}
-/* cmp_val --- compare values of watched item, returns TRUE if different; */
+/* cmp_val --- compare values of watched item, returns true if different; */
static int
cmp_val(struct list_item *w, NODE *old, NODE *new)
@@ -1629,39 +1627,38 @@ cmp_val(struct list_item *w, NODE *old, NODE *new)
/*
* case old new result
* ------------------------------
- * 1: NULL ARRAY TRUE
- * 2: NULL SCALAR TRUE
- * 3: NULL NULL FALSE
+ * 1: NULL ARRAY true
+ * 2: NULL SCALAR true
+ * 3: NULL NULL false
* 4: SCALAR SCALAR cmp_node
- * 5: SCALAR ARRAY TRUE
- * 6: SCALAR NULL TRUE
- * 7: ARRAY SCALAR TRUE
+ * 5: SCALAR ARRAY true
+ * 6: SCALAR NULL true
+ * 7: ARRAY SCALAR true
* 8: ARRAY ARRAY compare size
- * 9: ARRAY NULL TRUE
+ * 9: ARRAY NULL true
*/
if (WATCHING_ARRAY(w)) {
long size = 0;
if (! new) /* 9 */
- return TRUE;
+ return true;
if (new->type == Node_val) /* 7 */
- return TRUE;
+ return true;
/* new->type == Node_var_array */ /* 8 */
- if (new->var_array != NULL)
- size = new->table_size;
+ size = new->table_size;
if (w->cur_size == size)
- return FALSE;
- return TRUE;
+ return false;
+ return true;
}
if (! old && ! new) /* 3 */
- return FALSE;
+ return false;
if ((! old && new) /* 1, 2 */
|| (old && ! new)) /* 6 */
- return TRUE;
+ return true;
if (new->type == Node_var_array) /* 5 */
- return TRUE;
+ return true;
return cmp_nodes(old, new); /* 4 */
}
@@ -1687,7 +1684,7 @@ watchpoint_triggered(struct list_item *w)
(void) find_subscript(w, &t2);
else if (IS_FIELD(w)) {
long field_num;
- field_num = (long) w->symbol->numbr;
+ field_num = get_number_si(w->symbol);
t2 = *get_field(field_num, NULL);
} else {
switch (symbol->type) {
@@ -1722,7 +1719,7 @@ watchpoint_triggered(struct list_item *w)
w->flags &= ~CUR_IS_ARRAY;
w->cur_value = dupnode(t2);
} else
- w->cur_size = (t2->var_array != NULL) ? t2->table_size : 0;
+ w->cur_size = (t2->type == Node_var_array) ? t2->table_size : 0;
} else if (! t1) { /* 1, 2 */
w->old_value = 0;
/* new != NULL */
@@ -1730,7 +1727,7 @@ watchpoint_triggered(struct list_item *w)
w->cur_value = dupnode(t2);
else {
w->flags |= CUR_IS_ARRAY;
- w->cur_size = (t2->var_array != NULL) ? t2->table_size : 0;
+ w->cur_size = (t2->type == Node_var_array) ? t2->table_size : 0;
}
} else /* if (t1->type == Node_val) */ { /* 4, 5, 6 */
w->old_value = w->cur_value;
@@ -1738,7 +1735,7 @@ watchpoint_triggered(struct list_item *w)
w->cur_value = 0;
else if (t2->type == Node_var_array) {
w->flags |= CUR_IS_ARRAY;
- w->cur_size = (t2->var_array != NULL) ? t2->table_size : 0;
+ w->cur_size = t2->table_size;
} else
w->cur_value = dupnode(t2);
}
@@ -1764,13 +1761,13 @@ initialize_watch_item(struct list_item *w)
w->cur_value = (NODE *) 0;
else if (r->type == Node_var_array) { /* it's a sub-array */
w->flags |= CUR_IS_ARRAY;
- w->cur_size = (r->var_array != NULL) ? r->table_size : 0;
+ w->cur_size = r->table_size;
} else
w->cur_value = dupnode(r);
} else if (IS_FIELD(w)) {
long field_num;
t = w->symbol;
- field_num = (long) t->numbr;
+ field_num = get_number_si(t);
r = *get_field(field_num, NULL);
w->cur_value = dupnode(r);
} else {
@@ -1781,7 +1778,7 @@ initialize_watch_item(struct list_item *w)
w->cur_value = dupnode(r);
} else if (symbol->type == Node_var_array) {
w->flags |= CUR_IS_ARRAY;
- w->cur_size = (symbol->var_array != NULL) ? symbol->table_size : 0;
+ w->cur_size = symbol->table_size;
} /* else
can't happen */
}
@@ -1799,17 +1796,17 @@ do_watch(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
w = do_add_item(&watch_list, arg);
if (w == NULL)
- return FALSE;
+ return false;
if (initialize_watch_item(w) == -1) {
delete_item(w);
- return FALSE;
+ return false;
}
fprintf(out_fp, "Watchpoint %d: ", w->number);
symbol = w->symbol;
-/* FIXME: common code also in print_watch_item */
+ /* FIXME: common code also in print_watch_item */
if (IS_SUBSCRIPT(w)) {
fprintf(out_fp, "%s", w->sname);
for (i = 0; i < w->num_subs; i++) {
@@ -1818,11 +1815,11 @@ do_watch(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
}
fprintf(out_fp, "\n");
} else if (IS_FIELD(w))
- fprintf(out_fp, "$%ld\n", (long) symbol->numbr);
+ fprintf(out_fp, "$%ld\n", get_number_si(symbol));
else
fprintf(out_fp, "%s\n", w->sname);
- return FALSE;
+ return false;
}
/* do_unwatch --- unwatch command */
@@ -1831,7 +1828,7 @@ int
do_unwatch(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
{
do_delete_item(&watch_list, arg);
- return FALSE;
+ return false;
}
/* callback from pop_frame in eval.c */
@@ -1873,19 +1870,17 @@ print_function(INSTRUCTION *pc, void *x)
{
NODE *func;
int i, pcount;
- char **pnames;
struct pf_data *data = (struct pf_data *) x;
int defn = data->defn;
Func_print print_func = data->print_func;
FILE *fp = data->fp;
func = pc->func_body;
- pcount = get_param_count(func);
- pnames = get_params(func);
+ pcount = func->param_cnt;
- print_func(fp, "%s(", func->lnode->param);
+ print_func(fp, "%s(", func->vname);
for (i = 0; i < pcount; i++) {
- print_func(fp, "%s", pnames[i]);
+ print_func(fp, "%s", func->fparms[i].param);
if (i < pcount - 1)
print_func(fp, ", ");
}
@@ -1909,7 +1904,7 @@ print_frame(NODE *func, char *src, int srcline)
else {
pf_data.print_func = fprintf;
pf_data.fp = out_fp;
- pf_data.defn = FALSE;
+ pf_data.defn = false;
(void) print_function(func->code_ptr, &pf_data);
}
fprintf(out_fp, _(" at `%s':%d"), src, srcline);
@@ -1922,7 +1917,7 @@ print_numbered_frame(long num)
{
NODE *f;
- assert(prog_running == TRUE);
+ assert(prog_running == true);
f = find_frame(num);
if (num == 0) {
fprintf(out_fp, "#%ld\t ", num);
@@ -1966,7 +1961,7 @@ do_backtrace(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
}
if (cur <= fcall_count)
fprintf(out_fp, _("More stack frames follow ...\n"));
- return FALSE;
+ return false;
}
/* print_cur_frame_and_sourceline --- print current frame, and
@@ -1980,7 +1975,7 @@ print_cur_frame_and_sourceline()
int srcline;
char *src;
- assert(prog_running == TRUE);
+ assert(prog_running == true);
f = find_frame(cur_frame);
if (cur_frame == 0) {
src = source;
@@ -2009,12 +2004,12 @@ do_frame(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
if (arg && arg->type == D_int) {
if (arg->a_int < 0 || arg->a_int > fcall_count) {
d_error(_("invalid frame number"));
- return FALSE;
+ return false;
}
cur_frame = arg->a_int;
}
print_cur_frame_and_sourceline();
- return FALSE;
+ return false;
}
/* do_up --- up command */
@@ -2032,7 +2027,7 @@ do_up(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
else if (cur_frame > fcall_count)
cur_frame = fcall_count;
print_cur_frame_and_sourceline();
- return FALSE;
+ return false;
}
/* do_down --- down command */
@@ -2050,7 +2045,7 @@ do_down(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
else if (cur_frame > fcall_count)
cur_frame = fcall_count;
print_cur_frame_and_sourceline();
- return FALSE;
+ return false;
}
/* find_rule --- find a rule or function in file 'src' containing
@@ -2086,7 +2081,7 @@ mk_breakpoint(char *src, int srcline)
emalloc(b, BREAKPOINT *, sizeof(BREAKPOINT), "mk_breakpoint");
memset(&b->cndn, 0, sizeof(struct condition));
b->commands.next = b->commands.prev = &b->commands;
- b->silent = FALSE;
+ b->silent = false;
b->number = ++watch_list.number; /* breakpoints and watchpoints use same counter */
@@ -2130,7 +2125,7 @@ delete_breakpoint(BREAKPOINT *b)
delete_commands_item(c->next);
}
- free_context(b->cndn.ctxt, FALSE);
+ free_context(b->cndn.ctxt, false);
if (b->cndn.expr != NULL)
efree(b->cndn.expr);
@@ -2160,7 +2155,7 @@ find_breakpoint(long num)
/* add_breakpoint --- add a breakpoint instruction between PREVP and IP */
static BREAKPOINT *
-add_breakpoint(INSTRUCTION *prevp, INSTRUCTION *ip, char *src, int silent)
+add_breakpoint(INSTRUCTION *prevp, INSTRUCTION *ip, char *src, bool silent)
{
BREAKPOINT *b;
INSTRUCTION *bp;
@@ -2226,7 +2221,7 @@ add_breakpoint(INSTRUCTION *prevp, INSTRUCTION *ip, char *src, int silent)
/* set_breakpoint_at --- set a breakpoint at given line number*/
static BREAKPOINT *
-set_breakpoint_at(INSTRUCTION *rp, int lineno, int silent)
+set_breakpoint_at(INSTRUCTION *rp, int lineno, bool silent)
{
INSTRUCTION *ip, *prevp;
@@ -2270,7 +2265,7 @@ set_breakpoint_next(INSTRUCTION *rp, INSTRUCTION *ip)
ip = ip->nexti;
for (; ip; prevp = ip, ip = ip->nexti) {
if (ip->source_line > 0)
- return add_breakpoint(prevp, ip, rp->source_file, FALSE);
+ return add_breakpoint(prevp, ip, rp->source_file, false);
if (ip == (rp + 1)->lasti)
break;
}
@@ -2280,7 +2275,7 @@ set_breakpoint_next(INSTRUCTION *rp, INSTRUCTION *ip)
/* set_breakpoint --- set a breakpoint */
static int
-set_breakpoint(CMDARG *arg, int temporary)
+set_breakpoint(CMDARG *arg, bool temporary)
{
int lineno;
BREAKPOINT *b = NULL;
@@ -2329,7 +2324,7 @@ set_breakpoint(CMDARG *arg, int temporary)
if (temporary)
b->flags |= BP_TEMP;
}
- return FALSE;
+ return false;
}
/* arg != NULL */
@@ -2340,7 +2335,7 @@ set_breakpoint(CMDARG *arg, int temporary)
arg = arg->next;
if (s == NULL || arg == NULL
|| (arg->type != D_int && arg->type != D_func))
- return FALSE;
+ return false;
src = s->src;
if (arg->type == D_func) /* break filename:function */
goto func;
@@ -2354,7 +2349,7 @@ set_breakpoint(CMDARG *arg, int temporary)
rp = find_rule(src, lineno);
if (rp == NULL)
fprintf(out_fp, _("Can't find rule!!!\n"));
- if (rp == NULL || (b = set_breakpoint_at(rp, lineno, FALSE)) == NULL)
+ if (rp == NULL || (b = set_breakpoint_at(rp, lineno, false)) == NULL)
fprintf(out_fp, _("Can't set breakpoint at `%s':%d\n"),
src, lineno);
if (b != NULL && temporary)
@@ -2366,16 +2361,16 @@ set_breakpoint(CMDARG *arg, int temporary)
func:
func = arg->a_node;
rp = func->code_ptr;
- if ((b = set_breakpoint_at(rp, rp->source_line, FALSE)) == NULL)
+ if ((b = set_breakpoint_at(rp, rp->source_line, false)) == NULL)
fprintf(out_fp, _("Can't set breakpoint in function `%s'\n"),
- func->lnode->param);
+ func->vname);
else if (temporary)
b->flags |= BP_TEMP;
lineno = b->bpi->source_line;
break;
default:
- return FALSE;
+ return false;
}
/* condition if any */
arg = arg->next;
@@ -2386,7 +2381,7 @@ func:
fprintf(out_fp, _("breakpoint %d set at file `%s', line %d is unconditional\n"),
b->number, src, lineno);
}
- return FALSE;
+ return false;
}
@@ -2419,7 +2414,7 @@ breakpoint_triggered(BREAKPOINT *b)
int
do_breakpoint(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
{
- return set_breakpoint(arg, FALSE);
+ return set_breakpoint(arg, false);
}
/* do_tmp_breakpoint --- tbreak command */
@@ -2427,7 +2422,7 @@ do_breakpoint(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
int
do_tmp_breakpoint(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
{
- return set_breakpoint(arg, TRUE);
+ return set_breakpoint(arg, true);
}
/* do_clear --- clear command */
@@ -2441,7 +2436,7 @@ do_clear(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
NODE *func;
SRCFILE *s = cur_srcfile;
char *src = cur_srcfile->src;
- int bp_found = FALSE;
+ bool bp_found = false;
if (arg == NULL) { /* clear */
CHECK_PROG_RUNNING();
@@ -2463,7 +2458,7 @@ do_clear(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
arg = arg->next;
if (s == NULL || arg == NULL ||
(arg->type != D_int && arg->type != D_func))
- return FALSE;
+ return false;
src = s->src;
if (arg->type == D_func)
goto func;
@@ -2473,7 +2468,7 @@ do_clear(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
lineno = (int) arg->a_int;
if (lineno <= 0 || lineno > s->srclines) {
d_error(_("line number %d in file `%s' out of range"), lineno, src);
- return FALSE;
+ return false;
}
break;
@@ -2495,12 +2490,12 @@ func:
}
if (! bp_found)
fprintf(out_fp, _("No breakpoint(s) at entry to function `%s'\n"),
- func->lnode->param);
+ func->vname);
else
fprintf(out_fp, "\n");
/* fall through */
default:
- return FALSE;
+ return false;
}
delete_bp:
@@ -2525,7 +2520,7 @@ delete_bp:
src, (int) lineno);
else
fprintf(out_fp, "\n");
- return FALSE;
+ return false;
}
/* enable_breakpoint --- enable a breakpoint and set its disposition */
@@ -2581,7 +2576,7 @@ do_enable_breakpoint(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
enable_breakpoint(b, disp);
}
}
- return FALSE;
+ return false;
}
/* do_delete_breakpoint --- delete command */
@@ -2590,10 +2585,10 @@ int
do_delete_breakpoint(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
{
if (arg == NULL) {
- int delete_all = TRUE;
+ bool delete_all = true;
delete_all = prompt_yes_no(
_("Delete all breakpoints? (y or n) "),
- _("y")[0], TRUE, out_fp);
+ _("y")[0], true, out_fp);
if (delete_all) {
while (breakpoints.next != &breakpoints)
@@ -2622,7 +2617,7 @@ do_delete_breakpoint(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
delete_breakpoint(b);
}
}
- return FALSE;
+ return false;
}
/* do_ignore_breakpoint --- ignore command */
@@ -2634,7 +2629,7 @@ do_ignore_breakpoint(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
if (arg == NULL || arg->type != D_int
|| arg->next == NULL || arg->next->type != D_int)
- return FALSE;
+ return false;
if ((b = find_breakpoint(arg->a_int)) == NULL)
d_error(_("invalid breakpoint number"));
@@ -2650,7 +2645,7 @@ do_ignore_breakpoint(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
b->number);
}
}
- return FALSE;
+ return false;
}
/* do_disable_breakpoint --- disable command */
@@ -2685,24 +2680,22 @@ do_disable_breakpoint(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
b->flags &= ~BP_ENABLE;
}
}
- return FALSE;
+ return false;
}
#ifdef HAVE_LIBREADLINE
-/* get_parmlist --- list of function params in current context */
+/* get_function --- function definition in current context */
-char **
-get_parmlist()
+NODE *
+get_function()
{
NODE *func;
if (! prog_running)
return NULL;
func = find_frame(cur_frame)->func_node;
- if (func == NULL) /* in main */
- return NULL;
- return func->parmlist;
+ return func;
}
/* initialize_readline --- initialize readline */
@@ -2728,17 +2721,26 @@ initialize_readline()
#endif
-/* interpret --- debugger entry point */
+/* init_debug --- register debugger exec hooks */
+
+void
+init_debug()
+{
+ register_exec_hook(debug_pre_execute, debug_post_execute);
+}
+
+
+/* debug_prog --- debugger entry point */
int
-interpret(INSTRUCTION *pc)
+debug_prog(INSTRUCTION *pc)
{
char *run;
input_fd = fileno(stdin);
out_fp = stdout;
if (os_isatty(input_fd))
- input_from_tty = TRUE;
+ input_from_tty = true;
if (input_fd == 0 && input_from_tty)
initialize_readline();
@@ -2781,7 +2783,7 @@ interpret(INSTRUCTION *pc)
(void) do_run(NULL, 0);
} else if (command_file != NULL) {
- /* run commands from a file (--command=file or -R file) */
+ /* run commands from a file (--debug=file or -D file) */
int fd;
fd = open_readfd(command_file);
if (fd == INVALID_HANDLE) {
@@ -2789,7 +2791,7 @@ interpret(INSTRUCTION *pc)
command_file, strerror(errno));
exit(EXIT_FAILURE);
}
- push_cmd_src(fd, FALSE, g_readline, close, 0, EXIT_FAILURE);
+ push_cmd_src(fd, false, g_readline, close, 0, EXIT_FAILURE);
cmd_src->str = estrdup(command_file, strlen(command_file));
} else {
@@ -2803,7 +2805,7 @@ interpret(INSTRUCTION *pc)
/* read saved options */
fd = open_readfd(options_file);
if (fd > INVALID_HANDLE)
- push_cmd_src(fd, FALSE, g_readline, close, 0, EXIT_SUCCESS);
+ push_cmd_src(fd, false, g_readline, close, 0, EXIT_SUCCESS);
}
/* start the command interpreter */
@@ -2822,16 +2824,16 @@ check_watchpoint()
struct list_item *w;
if (stop.command == D_return)
- return FALSE;
+ return false;
for (w = watch_list.prev; w != &watch_list; w = w->prev) {
int wnum = watchpoint_triggered(w);
if (wnum > 0) {
stop.watch_point = wnum;
- stop.print_frame = TRUE;
- return TRUE;
+ stop.print_frame = true;
+ return true;
}
}
- return FALSE;
+ return false;
}
/* check_breakpoint --- check if breakpoint triggered */
@@ -2843,7 +2845,7 @@ check_breakpoint(INSTRUCTION **pi)
pc = *pi;
if (stop.command == D_return)
- return FALSE;
+ return false;
if (pc->opcode == Op_breakpoint) {
int bnum;
*pi = pc->nexti; /* skip past the breakpoint instruction;
@@ -2852,17 +2854,17 @@ check_breakpoint(INSTRUCTION **pi)
bnum = breakpoint_triggered(pc->break_pt);
if (bnum > 0) {
stop.break_point = bnum;
- stop.print_frame = TRUE;
- return TRUE;
+ stop.print_frame = true;
+ return true;
}
}
- return FALSE;
+ return false;
}
/* restart --- restart the debugger */
static void
-restart(int run)
+restart(bool run)
{
/* save state in the environment after serialization */
serialize(BREAK);
@@ -2872,7 +2874,7 @@ restart(int run)
serialize(OPTION);
/* tell the new process to restore state from the environment */
- setenv("DGAWK_RESTART", (run ? "TRUE" : "FALSE"), 1);
+ setenv("DGAWK_RESTART", (run ? "true" : "false"), 1);
/* close all open files */
close_all();
@@ -2892,15 +2894,15 @@ do_run(CMDARG *arg ATTRIBUTE_UNUSED, int cmd ATTRIBUTE_UNUSED)
{
if (prog_running) {
if (! input_from_tty)
- need_restart = TRUE; /* handled later */
+ need_restart = true; /* handled later */
else {
need_restart = prompt_yes_no(
_("Program already running. Restart from beginning (y/n)? "),
- _("y")[0], FALSE, out_fp);
+ _("y")[0], false, out_fp);
if (! need_restart) {
fprintf(out_fp, _("Program not restarted\n"));
- return FALSE;
+ return false;
}
}
}
@@ -2908,36 +2910,36 @@ do_run(CMDARG *arg ATTRIBUTE_UNUSED, int cmd ATTRIBUTE_UNUSED)
if (need_restart) {
/* avoid endless cycles of restarting */
if (command_file != NULL) {
- /* input_from_tty = FALSE */
+ /* input_from_tty = false */
fprintf(stderr, _("error: cannot restart, operation not allowed\n"));
exit(EXIT_FAILURE);
}
if (cmd_src->cmd == D_source) {
- /* input_from_tty = FALSE */
+ /* input_from_tty = false */
fprintf(out_fp, _("error (%s): cannot restart, ignoring rest of the commands\n"), cmd_src->str);
pop_cmd_src();
- return FALSE;
+ return false;
}
- restart(TRUE); /* does not return */
+ restart(true); /* does not return */
}
fprintf(out_fp, _("Starting program: \n"));
- prog_running = TRUE;
- fatal_tag_valid = TRUE;
+ prog_running = true;
+ fatal_tag_valid = true;
if (setjmp(fatal_tag) == 0)
- (void) r_interpret(code_block);
+ (void) interpret(code_block);
- fatal_tag_valid = FALSE;
- prog_running = FALSE;
+ fatal_tag_valid = false;
+ prog_running = false;
fprintf(out_fp, _("Program exited %s with exit value: %d\n"),
- (! exiting && exit_val != EXIT_SUCCESS) ? "abnormally"
- : "normally",
- exit_val);
- need_restart = TRUE;
- return FALSE;
+ (! exiting && exit_val != EXIT_SUCCESS) ? "abnormally"
+ : "normally",
+ exit_val);
+ need_restart = true;
+ return false;
}
/* do_quit --- quit command */
@@ -2945,14 +2947,14 @@ do_run(CMDARG *arg ATTRIBUTE_UNUSED, int cmd ATTRIBUTE_UNUSED)
int
do_quit(CMDARG *arg ATTRIBUTE_UNUSED, int cmd ATTRIBUTE_UNUSED)
{
- int terminate = TRUE;
+ bool terminate = true;
if (prog_running)
terminate = prompt_yes_no(
_("The program is running. Exit anyway (y/n)? "),
- _("y")[0], TRUE, out_fp);
+ _("y")[0], true, out_fp);
if (terminate) {
close_all();
- do_trace = FALSE; /* don't save 'trace on' */
+ do_trace = false; /* don't save 'trace on' */
#ifdef HAVE_LIBREADLINE
if (do_save_history && input_from_tty) {
@@ -2967,7 +2969,7 @@ do_quit(CMDARG *arg ATTRIBUTE_UNUSED, int cmd ATTRIBUTE_UNUSED)
exit(exit_val);
}
- return FALSE;
+ return false;
}
/* do_continue --- continue command */
@@ -2979,23 +2981,23 @@ do_continue(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
CHECK_PROG_RUNNING();
if (! arg || arg->type != D_int)
- return TRUE;
+ return true;
/* arg is breakpoint ignore count if stopped at a breakpoint */
if (! stop.break_point) {
fprintf(out_fp, _("Not stopped at any breakpoint; argument ignored.\n"));
- return TRUE;
+ return true;
}
b = find_breakpoint(stop.break_point);
if (b == NULL) {
d_error(_("invalid breakpoint number %d."), stop.break_point);
- return FALSE;
+ return false;
}
b->flags |= BP_IGNORE;
b->ignore_count = arg->a_int;
fprintf(out_fp, _("Will ignore next %ld crossings of breakpoint %d.\n"),
b->ignore_count, stop.break_point);
- return TRUE;
+ return true;
}
/* next_step --- common code for next and step commands */
@@ -3009,10 +3011,10 @@ next_step(CMDARG *arg, int cmd)
else
stop.repeat_count = 1;
stop.command = cmd;
- return TRUE;
+ return true;
}
-/* check_step --- process step command, return TRUE if stopping */
+/* check_step --- process step command, return true if stopping */
static int
check_step(INSTRUCTION **pi)
@@ -3021,7 +3023,7 @@ check_step(INSTRUCTION **pi)
stop.fcall_count = fcall_count;
stop.sourceline = sourceline;
stop.source = source;
- stop.print_frame = TRUE;
+ stop.print_frame = true;
return (--stop.repeat_count == 0);
}
@@ -3035,10 +3037,10 @@ check_step(INSTRUCTION **pi)
stop.sourceline = sourceline;
return (--stop.repeat_count == 0);
}
- return FALSE;
+ return false;
}
-/* do_step -- process step command, return TRUE if stopping */
+/* do_step -- process step command, return true if stopping */
int
do_step(CMDARG *arg, int cmd)
@@ -3054,7 +3056,7 @@ do_step(CMDARG *arg, int cmd)
return ret;
}
-/* do_stepi -- process stepi command, return TRUE if stopping */
+/* do_stepi -- process stepi command, return true if stopping */
static int
check_stepi(INSTRUCTION **pi)
@@ -3075,7 +3077,7 @@ do_stepi(CMDARG *arg, int cmd)
}
-/* check_next -- process next command returning TRUE if stopping */
+/* check_next -- process next command returning true if stopping */
static int
check_next(INSTRUCTION **pi)
@@ -3086,7 +3088,7 @@ check_next(INSTRUCTION **pi)
stop.fcall_count = fcall_count;
stop.sourceline = sourceline;
stop.source = source;
- stop.print_frame = TRUE;
+ stop.print_frame = true;
return (--stop.repeat_count == 0);
}
@@ -3110,7 +3112,7 @@ check_next(INSTRUCTION **pi)
}
#endif
- return FALSE;
+ return false;
}
/* do_next -- next command */
@@ -3130,16 +3132,15 @@ do_next(CMDARG *arg, int cmd)
return ret;
}
-/* check_nexti --- process nexti command, returns TRUE if stopping */
+/* check_nexti --- process nexti command, returns true if stopping */
static int
check_nexti(INSTRUCTION **pi)
{
-
/* make sure not to step inside function calls */
if (fcall_count < stop.fcall_count) {
- stop.print_frame = TRUE;
+ stop.print_frame = true;
stop.fcall_count = fcall_count;
}
return (fcall_count == stop.fcall_count
@@ -3161,16 +3162,16 @@ do_nexti(CMDARG *arg, int cmd)
return ret;
}
-/* check_finish --- process finish command, returns TRUE if stopping */
+/* check_finish --- process finish command, returns true if stopping */
static int
check_finish(INSTRUCTION **pi)
{
if (fcall_count == stop.fcall_count) {
- stop.print_frame = TRUE;
- return TRUE;
+ stop.print_frame = true;
+ return true;
}
- return FALSE;
+ return false;
}
/* do_finish --- finish command */
@@ -3182,7 +3183,7 @@ do_finish(CMDARG *arg ATTRIBUTE_UNUSED, int cmd)
if (cur_frame == fcall_count) {
fprintf(out_fp,
_("'finish' not meaningful in the outermost frame main()\n"));
- return FALSE;
+ return false;
}
stop.fcall_count = fcall_count - cur_frame - 1;
assert(stop.fcall_count >= 0);
@@ -3190,11 +3191,11 @@ do_finish(CMDARG *arg ATTRIBUTE_UNUSED, int cmd)
print_numbered_frame(cur_frame);
stop.check_func = check_finish;
stop.command = cmd;
- stop.print_ret = TRUE;
- return TRUE;
+ stop.print_ret = true;
+ return true;
}
-/* check_return --- process return, returns TRUE if stopping */
+/* check_return --- process return, returns true if stopping */
static int
check_return(INSTRUCTION **pi)
@@ -3202,8 +3203,8 @@ check_return(INSTRUCTION **pi)
assert(fcall_count >= stop.fcall_count);
if (fcall_count == stop.fcall_count) {
- stop.print_frame = TRUE;
- return TRUE;
+ stop.print_frame = true;
+ return true;
}
if (fcall_count > stop.fcall_count) { /* innermost frame just returned */
@@ -3216,7 +3217,7 @@ check_return(INSTRUCTION **pi)
/* assert((*pi)->opcode == Op_K_return); */
}
- return FALSE;
+ return false;
}
/* do_return --- return command */
@@ -3224,13 +3225,13 @@ check_return(INSTRUCTION **pi)
int
do_return(CMDARG *arg, int cmd)
{
- NODE *func;
+ NODE *func, *n;
CHECK_PROG_RUNNING();
func = find_frame(cur_frame)->func_node;
if (func == NULL) {
fprintf(out_fp, _("'return' not meaningful in the outermost frame main()\n"));
- return FALSE;
+ return false;
}
stop.fcall_count = fcall_count - cur_frame - 1;
@@ -3241,33 +3242,32 @@ do_return(CMDARG *arg, int cmd)
stop.check_func = check_return;
- if (arg != NULL && arg->type == D_node) { /* optional return value */
- NODE *n;
+ if (arg != NULL && arg->type == D_node) /* optional return value */
n = dupnode(arg->a_node);
- PUSH(n);
- } else
- PUSH(Nnull_string);
+ else
+ n = dupnode(Nnull_string);
+ PUSH(n);
- return TRUE;
+ return true;
}
-/* check_until --- process until, returns TRUE if stopping */
+/* check_until --- process until, returns true if stopping */
int
check_until(INSTRUCTION **pi)
{
if (fcall_count < stop.fcall_count) { /* current stack frame returned */
- stop.print_frame = TRUE;
- return TRUE;
+ stop.print_frame = true;
+ return true;
} else if (fcall_count == stop.fcall_count) {
if (stop.pc && *pi == stop.pc) /* until location */
- return TRUE;
+ return true;
if (stop.sourceline > 0 /* until */
&& source == stop.source
&& sourceline > stop.sourceline)
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
/* do_until --- until command */
@@ -3302,7 +3302,7 @@ do_until(CMDARG *arg, int cmd)
stop.fcall_count = fcall_count - cur_frame;
stop.check_func = check_until;
stop.command = cmd;
- return TRUE;
+ return true;
}
/* GDB: until location - continue running program until
@@ -3315,8 +3315,8 @@ do_until(CMDARG *arg, int cmd)
s = source_find(arg->a_string);
arg = arg->next;
if (s == NULL || arg == NULL
- || (arg->type != D_int && arg->type != D_func))
- return FALSE;
+ || (arg->type != D_int && arg->type != D_func))
+ return false;
src = s->src;
if (arg->type == D_func)
goto func;
@@ -3327,7 +3327,7 @@ do_until(CMDARG *arg, int cmd)
if (lineno <= 0 || lineno > s->srclines) {
d_error(_("line number %d in file `%s' out of range"),
lineno, src);
- return FALSE;
+ return false;
}
break;
@@ -3341,19 +3341,19 @@ func:
stop.fcall_count = fcall_count - cur_frame;
stop.check_func = check_until;
stop.command = cmd;
- return TRUE;
+ return true;
}
}
fprintf(out_fp, _("Can't find specified location in function `%s'\n"),
- func->lnode->param);
+ func->vname);
/* fall through */
default:
- return FALSE;
+ return false;
}
if ((rp = find_rule(src, lineno)) == NULL) {
d_error(_("invalid source line %d in file `%s'"), lineno, src);
- return FALSE;
+ return false;
}
for (ip = rp->nexti; ip; ip = ip->nexti) {
@@ -3362,14 +3362,14 @@ func:
stop.fcall_count = fcall_count - cur_frame;
stop.check_func = check_until;
stop.command = cmd;
- return TRUE;
+ return true;
}
if (ip == (rp + 1)->lasti)
break;
}
fprintf(out_fp, _("Can't find specified location %d in file `%s'\n"),
lineno, src);
- return FALSE;
+ return false;
}
/* print_watch_item --- print watched item name, old and current values */
@@ -3389,7 +3389,7 @@ print_watch_item(struct list_item *w)
}
fprintf(out_fp, "\n");
} else if (IS_FIELD(w))
- fprintf(out_fp, "$%ld\n", (long) symbol->numbr);
+ fprintf(out_fp, "$%ld\n", get_number_si(symbol));
else
fprintf(out_fp, "%s\n", w->sname);
@@ -3456,7 +3456,7 @@ next_command()
if (stop.print_frame) {
print_frame(frame_ptr->func_node, source, sourceline);
fprintf(out_fp, "\n");
- stop.print_frame = FALSE;
+ stop.print_frame = false;
}
(void) print_lines(source, sourceline, 1);
@@ -3500,10 +3500,10 @@ no_output:
read_command(); /* zzparse */
}
-/* post_execute --- post_hook in the interpreter */
+/* debug_post_execute --- post_hook in the interpreter */
-void
-post_execute(INSTRUCTION *pc)
+static void
+debug_post_execute(INSTRUCTION *pc)
{
if (! in_main_context())
return;
@@ -3514,15 +3514,15 @@ post_execute(INSTRUCTION *pc)
case Op_K_exit:
if (stop.command == D_finish) {
/* cancel finish command */
- stop.print_ret = FALSE;
- stop.print_frame = FALSE;
+ stop.print_ret = false;
+ stop.print_frame = false;
stop.command = D_illegal;
stop.check_func = NULL;
fprintf(out_fp, _("'finish' not meaningful with non-local jump '%s'\n"),
op2str(pc->opcode));
} else if (stop.command == D_until) {
/* cancel until command */
- stop.print_frame = FALSE;
+ stop.print_frame = false;
stop.command = D_illegal;
stop.check_func = NULL;
fprintf(out_fp, _("'until' not meaningful with non-local jump '%s'\n"),
@@ -3540,7 +3540,7 @@ post_execute(INSTRUCTION *pc)
r = TOP();
fprintf(out_fp, "Returned value = ");
valinfo(r, fprintf, out_fp);
- stop.print_ret = FALSE;
+ stop.print_ret = false;
}
break;
@@ -3553,15 +3553,15 @@ post_execute(INSTRUCTION *pc)
}
}
-/* pre_execute --- pre_hook, called by the interpreter before execution;
+/* debug_pre_execute --- pre_hook, called by the interpreter before execution;
* checks if execution needs to be suspended and control
* transferred to the debugger.
*/
-int
-pre_execute(INSTRUCTION **pi)
+static int
+debug_pre_execute(INSTRUCTION **pi)
{
- static int cant_stop = FALSE;
+ static bool cant_stop = false;
NODE *m;
if (! in_main_context())
@@ -3576,7 +3576,7 @@ pre_execute(INSTRUCTION **pi)
&& cur_pc->opcode != Op_breakpoint
&& stop.command != D_return
)
- print_instruction(cur_pc, fprintf, out_fp, FALSE);
+ print_instruction(cur_pc, fprintf, out_fp, false);
/* N.B.: For Op_field_spec_lhs must execute instructions upto Op_field_assign
* as a group before stopping. Otherwise, watch/print of field variables
@@ -3586,49 +3586,48 @@ pre_execute(INSTRUCTION **pi)
switch (cur_pc->opcode) {
case Op_field_spec_lhs:
- cant_stop = TRUE;
+ cant_stop = true;
break;
case Op_field_assign:
- cant_stop = FALSE;
- return TRUE; /* may stop at next instruction */
+ cant_stop = false;
+ return true; /* may stop at next instruction */
case Op_push_lhs:
m = cur_pc->memory;
if (m->type == Node_var && m->var_assign)
- cant_stop = TRUE;
+ cant_stop = true;
break;
case Op_arrayfor_incr: /* can have special var as array variable !!! */
m = cur_pc->array_var;
if (m->type == Node_var && m->var_assign)
- cant_stop = TRUE;
+ cant_stop = true;
break;
case Op_var_assign:
- cant_stop = FALSE;
- return TRUE; /* may stop at next instruction */
+ cant_stop = false;
+ return true; /* may stop at next instruction */
case Op_rule:
cur_rule = cur_pc->in_rule;
- return TRUE;
+ return true;
case Op_func:
- case Op_ext_func:
case Op_var_update:
- return TRUE;
+ return true;
case Op_breakpoint:
break; /* processed later in check_breakpoint() */
default:
if (cur_pc->source_line <= 0)
- return TRUE;
+ return true;
break;
}
if (cant_stop)
- return TRUE;
+ return true;
assert(sourceline > 0);
@@ -3649,35 +3648,49 @@ pre_execute(INSTRUCTION **pi)
/* print_memory --- print a scalar value */
static void
-print_memory(NODE *m, char **fparms, Func_print print_func, FILE *fp)
+print_memory(NODE *m, NODE *func, Func_print print_func, FILE *fp)
{
switch (m->type) {
case Node_val:
if (m == Nnull_string)
print_func(fp, "Nnull_string");
- else if ((m->flags & NUMBER) != 0)
- print_func(fp, "%g", m->numbr);
- else if ((m->flags & STRING) != 0)
- pp_string_fp(print_func, fp, m->stptr, m->stlen, '"', FALSE);
- else if ((m->flags & NUMCUR) != 0)
- print_func(fp, "%g", m->numbr);
- else if ((m->flags & STRCUR) != 0)
- pp_string_fp(print_func, fp, m->stptr, m->stlen, '"', FALSE);
+ else if ((m->flags & NUMBER) != 0) {
+#ifdef HAVE_MPFR
+ if (m->flags & MPFN)
+ print_func(fp, "%s", mpg_fmt("%R*g", ROUND_MODE, m->mpg_numbr));
+ else if (m->flags & MPZN)
+ print_func(fp, "%s", mpg_fmt("%Zd", m->mpg_i));
+ else
+#endif
+ print_func(fp, "%g", m->numbr);
+ } else if ((m->flags & STRING) != 0)
+ pp_string_fp(print_func, fp, m->stptr, m->stlen, '"', false);
+ else if ((m->flags & NUMCUR) != 0) {
+#ifdef HAVE_MPFR
+ if (m->flags & MPFN)
+ print_func(fp, "%s", mpg_fmt("%R*g", ROUND_MODE, m->mpg_numbr));
+ else if (m->flags & MPZN)
+ print_func(fp, "%s", mpg_fmt("%Zd", m->mpg_i));
+ else
+#endif
+ print_func(fp, "%g", m->numbr);
+ } else if ((m->flags & STRCUR) != 0)
+ pp_string_fp(print_func, fp, m->stptr, m->stlen, '"', false);
else
print_func(fp, "-?-");
print_func(fp, " [%s]", flags2str(m->flags));
break;
case Node_regex:
- pp_string_fp(print_func, fp, m->re_exp->stptr, m->re_exp->stlen, '/', FALSE);
+ pp_string_fp(print_func, fp, m->re_exp->stptr, m->re_exp->stlen, '/', false);
break;
case Node_dynregex:
break;
case Node_param_list:
- assert(fparms != NULL);
- print_func(fp, "%s", fparms[m->param_cnt]);
+ assert(func != NULL);
+ print_func(fp, "%s", func->fparms[m->param_cnt].param);
break;
case Node_var:
@@ -3696,9 +3709,8 @@ print_memory(NODE *m, char **fparms, Func_print print_func, FILE *fp)
static void
print_instruction(INSTRUCTION *pc, Func_print print_func, FILE *fp, int in_dump)
{
- static char **fparms = NULL;
int pcount = 0;
- NODE *func = NULL;
+ static NODE *func = NULL;
static int noffset = 0;
if (noffset == 0) {
@@ -3710,25 +3722,17 @@ print_instruction(INSTRUCTION *pc, Func_print print_func, FILE *fp, int in_dump)
if (pc->opcode == Op_func) {
func = pc->func_body;
- fparms = get_params(func);
- pcount = get_param_count(func);
+ pcount = func->param_cnt;
if (in_dump) {
int j;
- print_func(fp, "\n\t# Function: %s (", func->lnode->param);
+ print_func(fp, "\n\t# Function: %s (", func->vname);
for (j = 0; j < pcount; j++) {
- print_func(fp, "%s", fparms[j]);
+ print_func(fp, "%s", func->fparms[j].param);
if (j < pcount - 1)
print_func(fp, ", ");
}
print_func(fp, ")\n\n");
}
- } else if (pc->opcode == Op_ext_func) {
- func = pc->func_body;
- fparms = get_params(func);
- pcount = get_param_count(func);
- if (in_dump)
- print_func(fp, "\n\t# Extension function: %s (... %d params ...)\n\n",
- func->lnode->param, pcount);
} else if (pc->opcode == Op_rule) {
if (in_dump)
print_func(fp, "\n\t# %s\n\n", ruletab[pc->in_rule]);
@@ -3744,12 +3748,8 @@ print_instruction(INSTRUCTION *pc, Func_print print_func, FILE *fp, int in_dump)
pc->source_line, pc, opcode2str(pc->opcode));
if (prog_running && ! in_dump) {
- /* find params in the current frame */
+ /* find Node_func if in function */
func = find_frame(0)->func_node;
- if (func != NULL)
- fparms = get_params(func);
- /* else
- fparms = NULL; */
}
@@ -3772,13 +3772,9 @@ print_instruction(INSTRUCTION *pc, Func_print print_func, FILE *fp, int in_dump)
case Op_field_spec_lhs:
print_func(fp, "[target_assign = %p] [do_reference = %s]\n",
- pc->target_assign, pc->do_reference ? "TRUE" : "FALSE");
+ pc->target_assign, pc->do_reference ? "true" : "false");
break;
- case Op_ext_func:
- print_func(fp, "[param_cnt = %d]\n", pcount);
- break;
-
case Op_func:
print_func(fp, "[param_cnt = %d] [source_file = %s]\n", pcount,
pc->source_file ? pc->source_file : "cmd. line");
@@ -3786,12 +3782,12 @@ print_instruction(INSTRUCTION *pc, Func_print print_func, FILE *fp, int in_dump)
case Op_K_getline_redir:
print_func(fp, "[into_var = %s] [redir_type = \"%s\"]\n",
- pc->into_var ? "TRUE" : "FALSE",
+ pc->into_var ? "true" : "false",
redir2str(pc->redir_type));
break;
case Op_K_getline:
- print_func(fp, "[into_var = %s]\n", pc->into_var ? "TRUE" : "FALSE");
+ print_func(fp, "[into_var = %s]\n", pc->into_var ? "true" : "false");
print_func(fp, "%*s[target_beginfile = %p] [target_endfile = %p]\n",
noffset, "",
(pc + 1)->target_beginfile, (pc + 1)->target_endfile);
@@ -3847,13 +3843,13 @@ print_instruction(INSTRUCTION *pc, Func_print print_func, FILE *fp, int in_dump)
case Op_K_case:
print_func(fp, "[target_jmp = %p] [match_exp = %s]\n",
- pc->target_jmp, (pc + 1)->match_exp ? "TRUE" : "FALSE");
+ pc->target_jmp, (pc + 1)->match_exp ? "true" : "false");
break;
case Op_arrayfor_incr:
print_func(fp, "[array_var = %s] [target_jmp = %p]\n",
pc->array_var->type == Node_param_list ?
- fparms[pc->array_var->param_cnt] : pc->array_var->vname,
+ func->fparms[pc->array_var->param_cnt].param : pc->array_var->vname,
pc->target_jmp);
break;
@@ -3888,13 +3884,13 @@ print_instruction(INSTRUCTION *pc, Func_print print_func, FILE *fp, int in_dump)
break;
case Op_builtin:
- {
- const char *fname = getfname(pc->builtin);
- if (fname == NULL)
- print_func(fp, "(extension func) [arg_count = %ld]\n", pc->expr_count);
- else
- print_func(fp, "%s [arg_count = %ld]\n", fname, pc->expr_count);
- }
+ print_func(fp, "%s [arg_count = %ld]\n", getfname(pc->builtin),
+ pc->expr_count);
+ break;
+
+ case Op_ext_builtin:
+ print_func(fp, "%s [arg_count = %ld]\n", (pc + 1)->func_name,
+ pc->expr_count);
break;
case Op_subscript:
@@ -3903,14 +3899,14 @@ print_instruction(INSTRUCTION *pc, Func_print print_func, FILE *fp, int in_dump)
break;
case Op_store_sub:
- print_memory(pc->memory, fparms, print_func, fp);
+ print_memory(pc->memory, func, print_func, fp);
print_func(fp, " [sub_count = %ld]\n", pc->expr_count);
break;
case Op_subscript_lhs:
print_func(fp, "[sub_count = %ld] [do_reference = %s]\n",
pc->sub_count,
- pc->do_reference ? "TRUE" : "FALSE");
+ pc->do_reference ? "true" : "false");
break;
case Op_K_delete:
@@ -3946,11 +3942,19 @@ print_instruction(INSTRUCTION *pc, Func_print print_func, FILE *fp, int in_dump)
print_func(fp, "[exec_count = %ld]\n", pc->exec_count);
break;
- case Op_store_var:
+ case Op_store_var:
+ print_memory(pc->memory, func, print_func, fp);
+ if (pc->initval != NULL) {
+ print_func(fp, " = ");
+ print_memory(pc->initval, func, print_func, fp);
+ }
+ print_func(fp, "\n");
+ break;
+
case Op_push_lhs:
- print_memory(pc->memory, fparms, print_func, fp);
+ print_memory(pc->memory, func, print_func, fp);
print_func(fp, " [do_reference = %s]\n",
- pc->do_reference ? "TRUE" : "FALSE");
+ pc->do_reference ? "true" : "false");
break;
case Op_push_i:
@@ -3969,7 +3973,7 @@ print_instruction(INSTRUCTION *pc, Func_print print_func, FILE *fp, int in_dump)
case Op_quotient_i:
case Op_mod_i:
case Op_assign_concat:
- print_memory(pc->memory, fparms, print_func, fp);
+ print_memory(pc->memory, func, print_func, fp);
/* fall through */
default:
print_func(fp, "\n");
@@ -3984,10 +3988,10 @@ do_trace_instruction(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
{
if (arg != NULL && arg->type == D_argument
&& arg->a_argument == A_TRACE_ON)
- do_trace = TRUE;
+ do_trace = true;
else
- do_trace = FALSE;
- return FALSE;
+ do_trace = false;
+ return false;
}
/* print_code --- print a list of instructions */
@@ -4007,38 +4011,41 @@ int
do_dump_instructions(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
{
FILE *fp;
-
+ NODE **funcs;
+
if (arg != NULL && arg->type == D_string) {
/* dump to a file */
if ((fp = fopen(arg->a_string, "w")) == NULL) {
d_error(_("could not open `%s' for writing (%s)"),
arg->a_string, strerror(errno));
- return FALSE;
+ return false;
}
pf_data.print_func = fprintf;
pf_data.fp = fp;
- pf_data.defn = TRUE; /* in_dump = TRUE */
+ pf_data.defn = true; /* in_dump = true */
(void) print_code(code_block, &pf_data);
- (void) foreach_func((int (*)(INSTRUCTION *, void *)) print_code,
- FALSE, /* sort */
- &pf_data /* data */
- );
+ funcs = function_list(true);
+ (void) foreach_func(funcs,
+ (int (*)(INSTRUCTION *, void *)) print_code,
+ &pf_data);
+ efree(funcs);
fclose(fp);
- return FALSE;
+ return false;
}
+ funcs = function_list(true);
initialize_pager(out_fp);
if (setjmp(pager_quit_tag) == 0) {
pf_data.print_func = gprintf;
pf_data.fp = out_fp;
- pf_data.defn = TRUE; /* in_dump = TRUE */
+ pf_data.defn = true; /* in_dump = true */
(void) print_code(code_block, &pf_data);
- (void) foreach_func((int (*)(INSTRUCTION *, void *)) print_code,
- FALSE, /* sort */
- &pf_data /* data */
- );
+ (void) foreach_func(funcs,
+ (int (*)(INSTRUCTION *, void *)) print_code,
+ &pf_data);
}
- return FALSE;
+ efree(funcs);
+ return false;
}
/* do_save --- save command */
@@ -4054,7 +4061,7 @@ do_save(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
if ((fp = fopen(arg->a_string, "w")) == NULL) {
d_error(_("could not open `%s' for writing (%s)"),
arg->a_string, strerror(errno));
- return FALSE;
+ return false;
}
hist_list = history_list();
@@ -4077,7 +4084,7 @@ do_save(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
}
fclose(fp);
#endif
- return FALSE;
+ return false;
}
/* do_option --- option command */
@@ -4095,7 +4102,7 @@ do_option(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
else
fprintf(out_fp, "%s = %d\n", opt->name, *(opt->num_val));
}
- return FALSE;
+ return false;
}
name = arg->a_string;
@@ -4107,7 +4114,7 @@ do_option(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
break;
}
if (! opt->name)
- return FALSE;
+ return false;
if (value == NULL) { /* display current setting */
if (opt->str_val != NULL)
@@ -4116,7 +4123,7 @@ do_option(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
fprintf(out_fp, "%s = %d\n", opt->name, *(opt->num_val));
} else
(*(opt->assign))(value);
- return FALSE;
+ return false;
}
@@ -4149,12 +4156,12 @@ initialize_pager(FILE *fp)
static void
prompt_continue(FILE *fp)
{
- int quit_pager = FALSE;
+ bool quit_pager = false;
if (os_isatty(fileno(fp)) && input_fd == 0)
quit_pager = prompt_yes_no(
_("\t------[Enter] to continue or q [Enter] to quit------"),
- _("q")[0], FALSE, fp);
+ _("q")[0], false, fp);
if (quit_pager)
longjmp(pager_quit_tag, 1);
pager_lines_printed = 0;
@@ -4182,7 +4189,7 @@ gprintf(FILE *fp, const char *format, ...)
}
#undef GPRINTF_BUFSIZ
- while (TRUE) {
+ while (true) {
va_start(args, format);
nchar = vsnprintf(buf + bl, buflen - bl, format, args);
va_end(args);
@@ -4379,7 +4386,7 @@ enlarge_buffer:
nchar = serialize_subscript(buf + bl, buflen - bl, wd);
else if (IS_FIELD(wd))
nchar = snprintf(buf + bl, buflen - bl, "%d%c%d%c%d%c",
- wd->number, FSEP, D_field, FSEP, (int) wd->symbol->numbr, FSEP);
+ wd->number, FSEP, D_field, FSEP, (int) get_number_si(wd->symbol), FSEP);
else
nchar = snprintf(buf + bl, buflen - bl, "%d%c%d%c%s%c",
wd->number, FSEP, D_variable, FSEP, wd->sname, FSEP);
@@ -4518,7 +4525,7 @@ unserialize_commands(char *str, int str_len)
return;
commands_string = str;
commands_string_len = str_len;
- push_cmd_src(INVALID_HANDLE, FALSE, read_commands_string, 0, 0, EXIT_FATAL);
+ push_cmd_src(INVALID_HANDLE, false, read_commands_string, 0, 0, EXIT_FATAL);
line_sep = CSEP;
read_command(); /* forced to return in do_commands */
pop_cmd_src();
@@ -4620,7 +4627,7 @@ unserialize_breakpoint(char **pstr, int *pstr_len, int field_cnt)
return NULL;
rp = find_rule(src, lineno);
if (rp == NULL
- || (b = set_breakpoint_at(rp, lineno, TRUE)) == NULL
+ || (b = set_breakpoint_at(rp, lineno, true)) == NULL
)
return NULL;
@@ -4752,14 +4759,14 @@ prompt_yes_no(const char *mesg, char res_true, int res_default, FILE *fp)
}
/* has_break_or_watch_point --- check if given breakpoint or watchpoint
- * number exists. When flag any is TRUE,
+ * number exists. When flag any is true,
* check if any breakpoint/watchpoint
* has been set (ignores num). Returns
* type (breakpoint or watchpoint) or 0.
*/
int
-has_break_or_watch_point(int *pnum, int any)
+has_break_or_watch_point(int *pnum, bool any)
{
BREAKPOINT *b = NULL;
struct list_item *w = NULL;
@@ -4829,10 +4836,10 @@ do_commands(CMDARG *arg, int cmd)
if (cmd == D_commands) {
int num, type;
if (arg == NULL)
- type = has_break_or_watch_point(&num, TRUE);
+ type = has_break_or_watch_point(&num, true);
else {
num = arg->a_int;
- type = has_break_or_watch_point(&num, FALSE);
+ type = has_break_or_watch_point(&num, false);
}
b = NULL;
w = NULL;
@@ -4848,19 +4855,19 @@ do_commands(CMDARG *arg, int cmd)
c = c->prev;
delete_commands_item(c->next);
}
- return FALSE;
+ return false;
} else if (cmd == D_end) {
commands = NULL;
if (read_a_line == read_commands_string) /* unserializig commands */
- return TRUE; /* done unserializing, terminate zzparse() */
- return FALSE;
+ return true; /* done unserializing, terminate zzparse() */
+ return false;
} else if (cmd == D_silent) {
if (b != NULL)
- b->silent = TRUE;
+ b->silent = true;
else if (w != NULL)
- w->silent = TRUE;
+ w->silent = true;
/* we also append silent command to the list for use
* in `info break(watch)', and to simplify
* serialization/unserialization of commands.
@@ -4883,7 +4890,7 @@ do_commands(CMDARG *arg, int cmd)
c->next = commands;
commands->prev = c;
c->prev->next = c;
- return FALSE;
+ return false;
}
/* execute_commands --- execute breakpoint/watchpoint commands, the first
@@ -4896,7 +4903,7 @@ execute_commands(struct commands_item *commands)
{
struct commands_item *c;
Func_cmd cmd_ptr;
- int ret = FALSE;
+ bool ret = false;
for (c = commands->next; c != commands; c = c->next) {
if (c->cmd == D_silent)
@@ -4946,7 +4953,7 @@ do_print_f(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
{
long field_num;
r = a->a_node;
- field_num = (long) r->numbr;
+ field_num = get_number_si(r);
tmp[i] = *get_field(field_num, NULL);
}
break;
@@ -4959,7 +4966,7 @@ do_print_f(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
goto done;
for (; cnt > 0; cnt--) {
- NODE *value, *subs;
+ NODE *value, *subs;
a = a->next;
subs = a->a_node;
value = in_array(r, subs);
@@ -4997,7 +5004,7 @@ do_print_f(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
}
}
- force_string(tmp[0]);
+ tmp[0] = force_string(tmp[0]);
PUSH_BINDING(fatal_tag_stack, fatal_tag, fatal_tag_valid);
if (setjmp(fatal_tag) == 0)
@@ -5015,7 +5022,7 @@ do_print_f(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
}
done:
efree(tmp);
- return FALSE;
+ return false;
}
/* do_source --- source command */
@@ -5030,12 +5037,12 @@ do_source(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
if (fd <= INVALID_HANDLE) {
d_error(_("can't open source file `%s' for reading (%s)"),
file, strerror(errno));
- return FALSE;
+ return false;
}
- push_cmd_src(fd, FALSE, g_readline, close, D_source, EXIT_SUCCESS);
+ push_cmd_src(fd, false, g_readline, close, D_source, EXIT_SUCCESS);
cmd_src->str = estrdup(file, strlen(file));
- return FALSE;
+ return false;
}
/* open_readfd --- open a file for reading */
@@ -5201,9 +5208,9 @@ set_option_flag(const char *value)
{
long n;
if (strcmp(value, "on") == 0)
- return TRUE;
+ return true;
if (strcmp(value, "off") == 0)
- return FALSE;
+ return false;
errno = 0;
n = strtol(value, NULL, 0);
return (errno == 0 && n != 0);
@@ -5321,11 +5328,11 @@ save_options(const char *file)
static void
close_all()
{
- int stdio_problem;
+ bool stdio_problem;
struct command_source *cs;
- (void) nextfile(&curfile, TRUE); /* close input data file */
- (void) close_io(&stdio_problem);
+ (void) nextfile(& curfile, true); /* close input data file */
+ (void) close_io(& stdio_problem);
if (cur_srcfile->fd != INVALID_HANDLE) {
close(cur_srcfile->fd);
cur_srcfile->fd = INVALID_HANDLE;
@@ -5340,35 +5347,6 @@ close_all()
set_gawk_output(NULL); /* closes output_fp if not stdout */
}
-/* install_params --- install function parameters into the symbol table */
-
-static void
-install_params(NODE *func)
-{
- NODE *np;
-
- if (func == NULL)
- return;
- /* function parameters of type Node_param_list */
- np = func->lnode;
- for (np = np->rnode; np != NULL; np = np->rnode)
- install_symbol(np->param, np);
-}
-
-/* remove_params --- remove function parameters out of the symbol table */
-
-static void
-remove_params(NODE *func)
-{
- NODE *np;
-
- if (func == NULL)
- return;
- np = func->lnode;
- for (np = np->rnode; np != NULL; np = np->rnode)
- remove_symbol(np->param);
-}
-
/* pre_execute_code --- pre_hook for execute_code, called by pre_execute */
static int
@@ -5411,22 +5389,25 @@ execute_code(volatile INSTRUCTION *code)
volatile NODE *r = NULL;
volatile jmp_buf fatal_tag_stack;
long save_stack_size;
+ int save_flags = do_flags;
/* We use one global stack for all contexts.
* Save # of items in stack; in case of
* a fatal error, pop stack until it has that many items.
*/
+
save_stack_size = (stack_ptr - stack_bottom) + 1;
+ do_flags = false;
PUSH_BINDING(fatal_tag_stack, fatal_tag, fatal_tag_valid);
if (setjmp(fatal_tag) == 0) {
- (void) r_interpret((INSTRUCTION *) code);
+ (void) interpret((INSTRUCTION *) code);
r = POP_SCALAR();
} else /* fatal error */
(void) unwind_stack(save_stack_size);
POP_BINDING(fatal_tag_stack, fatal_tag, fatal_tag_valid);
-
+ do_flags = save_flags;
if (exit_val != EXIT_SUCCESS) { /* must be EXIT_FATAL? */
exit_val = EXIT_SUCCESS;
return NULL;
@@ -5445,9 +5426,9 @@ do_eval(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
NODE **sp;
INSTRUCTION *eval, *code = NULL;
AWK_CONTEXT *ctxt;
- char **save_parmlist = NULL;
int ecount = 0, pcount = 0;
int ret;
+ int save_flags = do_flags;
if (prog_running) {
this_frame = find_frame(0);
@@ -5459,12 +5440,14 @@ do_eval(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
ctxt->install_func = append_symbol; /* keep track of newly installed globals */
push_context(ctxt);
(void) add_srcfile(SRC_CMDLINE, arg->a_string, srcfiles, NULL, NULL);
+ do_flags = false;
ret = parse_program(&code);
+ do_flags = save_flags;
remove_params(this_func);
if (ret != 0) {
pop_context(); /* switch to prev context */
- free_context(ctxt, FALSE /* keep_globals */);
- return FALSE;
+ free_context(ctxt, false /* keep_globals */);
+ return false;
}
f = lookup("@eval");
@@ -5481,9 +5464,7 @@ do_eval(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
} else {
/* execute as a part of the current function */
int i;
- char **varnames;
INSTRUCTION *t;
- NODE *np;
eval = f->code_ptr; /* Op_func */
eval->source_file = cur_srcfile->src;
@@ -5492,9 +5473,8 @@ do_eval(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
t->opcode = Op_stop;
/* add or append eval locals to the current frame stack */
- ecount = f->lnode->param_cnt; /* eval local count */
- pcount = this_func->lnode->param_cnt;
- save_parmlist = this_func->parmlist;
+ ecount = f->param_cnt; /* eval local count */
+ pcount = this_func->param_cnt;
if (ecount > 0) {
if (pcount == 0)
@@ -5502,33 +5482,29 @@ do_eval(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
else
erealloc(this_frame->stack, NODE **, (pcount + ecount) * sizeof(NODE *), "do_eval");
- emalloc(varnames, char **, (pcount + ecount + 1) * sizeof(char *), "do_eval");
- if (pcount > 0)
- memcpy(varnames, save_parmlist, pcount * sizeof(char *));
- for (np = f->lnode->rnode, i = 0; np != NULL; np = np->rnode, i++) {
- varnames[pcount + i] = np->param;
- np->param_cnt += pcount; /* appending eval locals: fixup param_cnt */
- }
- varnames[pcount + ecount] = NULL;
sp = this_frame->stack + pcount;
for (i = 0; i < ecount; i++) {
+ NODE *np;
+
+ np = f->fparms + i;
+ np->param_cnt += pcount; /* appending eval locals: fixup param_cnt */
+
getnode(r);
memset(r, 0, sizeof(NODE));
*sp++ = r;
/* local variable */
r->type = Node_var_new;
- r->vname = varnames[pcount + i];
+ r->vname = np->param;
}
- this_func->parmlist = varnames;
- this_func->lnode->param_cnt += ecount;
+ this_func->param_cnt += ecount;
}
}
#if 0
pf_data.print_func = fprintf;
pf_data.fp = out_fp;
- pf_data.defn = FALSE; /* in_dump = FALSE */
+ pf_data.defn = false; /* in_dump = false */
(void) print_code(f->code_ptr, &pf_data);
#endif
@@ -5561,20 +5537,18 @@ do_eval(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
} /* else
restore_frame() will free it */
- efree(this_func->parmlist);
- this_func->parmlist = save_parmlist;
- this_func->lnode->param_cnt -= ecount;
+ this_func->param_cnt -= ecount;
}
/* always destroy symbol "@eval", however destroy all newly installed
- * globals only if fatal error in r_interpret (r == NULL).
+ * globals only if fatal error (execute_code() returing NULL).
*/
pop_context(); /* switch to prev context */
free_context(ctxt, (ret_val != NULL)); /* free all instructions and optionally symbols */
if (ret_val != NULL)
- destroy_symbol("@eval"); /* destroy "@eval" */
- return FALSE;
+ destroy_symbol(f); /* destroy "@eval" */
+ return false;
}
/*
@@ -5590,13 +5564,13 @@ an error message:
static int invalid_symbol = 0;
-void
-check_symbol(char *name)
+static void
+check_symbol(NODE *r)
{
invalid_symbol++;
- d_error(_("No symbol `%s' in current context"), name);
+ d_error(_("No symbol `%s' in current context"), r->vname);
/* install anyway, but keep track of it */
- append_symbol(name);
+ append_symbol(r);
}
/* parse_condition --- compile a condition expression */
@@ -5612,6 +5586,7 @@ parse_condition(int type, int num, char *expr)
NODE *this_func = NULL;
INSTRUCTION *it, *stop, *rule;
struct condition *cndn = NULL;
+ int save_flags = do_flags;
if (type == D_break && (b = find_breakpoint(num)) != NULL) {
INSTRUCTION *rp;
@@ -5635,12 +5610,14 @@ parse_condition(int type, int num, char *expr)
ctxt->install_func = check_symbol;
push_context(ctxt);
(void) add_srcfile(SRC_CMDLINE, expr, srcfiles, NULL, NULL);
+ do_flags = false;
ret = parse_program(&code);
+ do_flags = save_flags;
remove_params(this_func);
pop_context();
if (ret != 0 || invalid_symbol) {
- free_context(ctxt, FALSE /* keep_globals */);
+ free_context(ctxt, false /* keep_globals */);
return -1;
}
@@ -5655,8 +5632,8 @@ parse_condition(int type, int num, char *expr)
it = rule->firsti; /* Op_K_print_rec */
assert(it->opcode == Op_K_print_rec);
- it->opcode = Op_push_i;
- it->memory = mk_number((AWKNUM) 1.0, PERM|NUMBER|NUMCUR);
+ it->opcode = Op_push_i;
+ it->memory = make_number(1.0);
it->nexti = bcalloc(Op_jmp, 1, 0);
it->nexti->target_jmp = stop;
it->nexti->nexti = rule->lasti;
@@ -5664,13 +5641,13 @@ parse_condition(int type, int num, char *expr)
it = rule->lasti; /* Op_no_op, target for Op_jmp_false */
assert(it->opcode == Op_no_op);
it->opcode = Op_push_i;
- it->memory = mk_number((AWKNUM) 0.0, PERM|NUMBER|NUMCUR);
+ it->memory = make_number(0.0);
it->nexti = stop;
out:
if (cndn->expr != NULL)
efree(cndn->expr);
- free_context(cndn->ctxt, FALSE);
+ free_context(cndn->ctxt, false);
cndn->code = code;
cndn->expr = expr;
cndn->ctxt = ctxt;
@@ -5687,15 +5664,15 @@ do_condition(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
char *expr = NULL;
num = arg->a_int;
- type = has_break_or_watch_point(&num, FALSE);
+ type = has_break_or_watch_point(&num, false);
if (! type)
- return FALSE;
+ return false;
arg = arg->next; /* condition expression */
if (arg != NULL)
expr = arg->a_string;
if (parse_condition(type, num, expr) == 0 && arg != NULL)
arg->a_string = NULL; /* don't let free_cmdarg free it */
- return FALSE;
+ return false;
}
/* in_cmd_src --- check if filename already in cmd_src */
@@ -5706,9 +5683,9 @@ in_cmd_src(const char *filename)
struct command_source *cs;
for (cs = cmd_src; cs != NULL; cs = cs->next) {
if (cs->str != NULL && strcmp(cs->str, filename) == 0)
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
int
@@ -5722,7 +5699,7 @@ get_eof_status()
void
push_cmd_src(
int fd,
- int istty,
+ bool istty,
char * (*readfunc)(const char *),
int (*closefunc)(int),
int ctype,
@@ -5744,7 +5721,7 @@ push_cmd_src(
cs->str = NULL;
cs->next = cmd_src;
cmd_src = cs;
-
+
input_fd = fd;
input_from_tty = istty;
read_a_line = readfunc;
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 00185def..cee8a270 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,7 +1,60 @@
+2012-11-06 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi: Rearrange chapter order and separate into parts
+ using @part for TeX. Fix capitalization in @caption text.
+ (Variable Scope): Document that arrays can be local also.
+ Thanks to Denis Shirokov <cosmogen@gmail.com>, for pointing out
+ the lack.
+
+2012-11-05 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi: Semi-rationalize invocations of @image.
+
+2012-11-04 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi: New chapter on extension API.
+ * api-figure1.pdf, api-figure2.pdf, api-figure3.pdf,
+ general-program.pdf, process-flow.pdf: New files. Again.
+ * Makefile.am (EXTRA_DIST): Update. Again.
+
+2012-11-03 Arnold D. Robbins <arnold@skeeve.com>
+
+ * api-figure1.pdf, api-figure2.pdf, api-figure3.pdf: Removed.
+ * api-figure1.txt, api-figure2.txt, api-figure3.txt,
+ api-figure1.png, api-figure2.png, api-figure3.png: New files.
+ * Makefile.am (EXTRA_DIST): Update.
+
+ * gawk.texi: Fix up images.
+ * general-program.pdf, process-flow.pdf: Removed.
+ * general-program.png, process-flow.png,
+ general-program.txt, process-flow.txt: New files.
+ * Makefile.am (EXTRA_DIST): Update.
+
+2012-10-31 Arnold D. Robbins <arnold@skeeve.com>
+
+ * api-figure1.eps, api-figure1.fig, api-figure1.pdf,
+ api-figure2.eps, api-figure2.fig, api-figure2.pdf,
+ api-figure3.eps, api-figure3.fig, api-figure3.pdf: New files.
+ * Makefile.am (EXTRA_DIST): Add the above.
+
+2012-10-28 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi (Glossary): Document cookie, some cleanup of
+ notes at the end.
+
+2012-10-19 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi: More doc on SYMTAB.
+
+2012-10-05 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (LN, install-data-hook, uninstall-hook): Removed. No
+ longer needed since dgawk and pgawk are gone.
+
2012-10-13 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am: Add dgawk.1 to man page links created / removed
- on install / uninstall.
+ on install / uninstall. (On stable branch.)
2012-10-02 Arnold D. Robbins <arnold@skeeve.com>
@@ -9,6 +62,10 @@
bug report from William Bresler <wbresler@acm.org>. Add a link
to the ISO website.
+ * gawk.texi, gawk.1, awkcard.in: Document FUNCTAB, SYMTAB, and
+ PROCINFO["identifiers"]. Including that delete does not work
+ on FUNCTAB and SYMTAB.
+
2012-09-23 Arnold D. Robbins <arnold@skeeve.com>
* gawk.texi (Nextfile Statement): Document that it's now part of POSIX
@@ -16,6 +73,95 @@
(Delete): Document that `delete array' is now part of POSIX.
* awkcard.in: Adjust coloring for nextfile and delete array.
+2012-09-07 Arnold D. Robbins <arnold@skeeve.com>
+
+ * texinfo.tex: Updated to version 2012-09-05.06.
+
+2012-08-27 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi: Minor edits, fix some spelling mistakes.
+
+2012-08-26 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi: More edits to chapter on arithmetic.
+ Primarily English changes.
+
+2012-08-24 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi: Emphasize more that floating point behavior is
+ not a language issue. Add a pointer to POSIX bc.
+ Move arithmetic chapter to later in the book, before chapter
+ on dynamic extensions.
+
+2012-08-17 Arnold D. Robbins <arnold@skeeve.com>
+
+ * texinfo.tex: Update infrastructure to Automake 1.12.3.
+
+2012-08-14 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi: Fixed a math bug in the chapter on multiple
+ precision floating point. Thanks to John Haque.
+
+2012-08-12 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi: Merged discussion of numbers from Appendix C into
+ the chapter on arbitrary precision arithmetic. Did some surgery
+ on that chapter to organize it a little better.
+
+2012-08-10 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkcard.in, gawk.1, gawk.texi: Updated. Mostly for new API stuff
+ but also some other things.
+ * gawk.texi (Derived Files): New node.
+
+2012-08-01 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (install-data-hook): Install a dgawk.1 link to the
+ man page also. Remove it on uninstall.
+
+2012-07-29 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawk.texi: Document that RT is set by getline.
+
+2012-07-04 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi, gawk.1, awkcard.in: Document that and(), or(), and
+ xor() can all take any number of arguments, with a minimum of two.
+
+2012-06-10 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawk.texi: Rename gettimeofday function to getlocaltime, since
+ the new time extension will provide gettimeofday.
+
+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
+ .awk suffix behavior.
+
+2012-04-01 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawk.texi: Replace documentation of removed functions update_ERRNO and
+ update_ERRNO_saved with descriptions new functions update_ERRNO_int,
+ update_ERRNO_string and unset_ERRNO. And fix a couple of examples
+ to use update_ERRNO_int instead of update_ERRNO.
+
+2012-03-26 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi: Minor style edits.
+
+2012-03-21 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawk.texi, gawk.1: Document new @load keyword.
+
+2012-03-20 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawk.texi, gawk.1: Add AWKLIBPATH.
+
2012-08-12 Arnold D. Robbins <arnold@skeeve.com>
* gawk.texi (Ranges and Locales): Clarified ranges and
@@ -54,6 +200,46 @@
* texinfo.tex: Update to latest from automake 1.11.4.
+2012-04-11 John Haque <j.eh@mchsi.com>
+
+ * gawk.texi: Change RNDMODE to ROUNDMODE.
+ * gawk.1, awkcard.in: Ditto.
+
+2012-04-11 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi: Change --arbitrary-precision to --bignum.
+ * gawk.1: Ditto.
+ * awkcard.in: Add --bignum, RNDMODE, PREC.
+
+2012-04-08 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi: Editing on new chapter on arbitrary precision numbers.
+
+2012-03-31 John Haque <j.eh@mchsi.com>
+
+ * gawk.texi, gawk.1: Add text on support for arbitrary precision
+ numbers.
+
+2012-02-06 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi, gawk.1: And some minor edits thereunto.
+
+2012-02-03 John Haque <j.eh@mchsi.com>
+
+ * gawk.texi, gawk.1: Add text on read timeout.
+
+2011-12-28 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkcard.in, gawk.1: Minor edits after merge of executables.
+
+2011-12-21 John Haque <j.eh@mchsi.com>
+
+ * gawk.texi: Updated sections on profiling and debugging
+ after merging the exes. Document new options --debug and
+ --load, and add a sub-section on loading extension library.
+ * gawk.1: Same.
+ * awkcard.in: Same.
+
2012-03-28 Arnold D. Robbins <arnold@skeeve.com>
* 4.0.1: Release tar ball made.
@@ -87,6 +273,10 @@
Jeroen Schot <schot@A-Eskwadraat.nl>.
* gawk.texi: Some minor fixes.
+2011-08-31 John Haque <j.eh@mchsi.com>
+
+ * gawk.texi: Updated gawk dynamic extension doc.
+
2011-07-28 Arnold D. Robbins <arnold@skeeve.com>
* gawk.texi (Gory Details): Restore text on historical behavior
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 7d683f2b..dfdec722 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -30,8 +30,16 @@ man_MANS = gawk.1 igawk.1
EXTRA_DIST = ChangeLog ChangeLog.0 README.card ad.block setter.outline \
awkcard.in awkforai.txt texinfo.tex cardfonts \
+ api-figure1.eps api-figure1.fig api-figure1.pdf \
+ api-figure1.png api-figure1.txt \
+ api-figure2.eps api-figure2.fig api-figure2.pdf \
+ api-figure2.png api-figure2.txt \
+ api-figure3.eps api-figure3.fig api-figure3.pdf \
+ api-figure3.png api-figure3.txt \
general-program.eps general-program.fig general-program.pdf \
+ general-program.png general-program.txt \
process-flow.eps process-flow.fig process-flow.pdf \
+ process-flow.png process-flow.txt \
macros colors no.colors $(man_MANS) \
lflashlight-small.xpic lflashlight.eps lflashlight.pdf \
rflashlight-small.xpic rflashlight.eps rflashlight.pdf \
@@ -61,23 +69,6 @@ AWKCARD = awkcard.ps
# to ensure that awkcard.tr is processed by tbl.
#AWKCARD = awkcard.nc
-# The following is patterned after the main Makefile.am. The point is to
-# make pgawk.1 a link to gawk.1 in the installed man directory.
-
-# We want hard links for install-data-hook, below
-LN= ln -f
-
-# Link gawk.1 to pgawk.1 and to dgawk.1
-install-data-hook:
- (cd $(DESTDIR)$(man1dir); \
- $(LN) gawk.1 pgawk.1 2>/dev/null ; \
- $(LN) gawk.1 dgawk.1 2>/dev/null ; \
- exit 0)
-
-# Undo the above when uninstalling
-uninstall-hook:
- cd $(DESTDIR)$(man1dir); rm -f pgawk.1 dgawk.1 ; exit 0
-
postscript: gawk.ps gawkinet.ps gawk.1.ps igawk.1.ps $(AWKCARD)
pdf: postscript gawk.pdf gawkinet.pdf awkcard.pdf gawk.1.pdf igawk.1.pdf
diff --git a/doc/Makefile.in b/doc/Makefile.in
index d84cb7d9..5e3ac4fe 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -83,11 +83,11 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
$(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lcmessage.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \
- $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/nls.m4 \
- $(top_srcdir)/m4/noreturn.m4 $(top_srcdir)/m4/po.m4 \
- $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/readline.m4 \
- $(top_srcdir)/m4/socket.m4 $(top_srcdir)/m4/ulonglong.m4 \
- $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/mpfr.m4 \
+ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/noreturn.m4 \
+ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+ $(top_srcdir)/m4/readline.m4 $(top_srcdir)/m4/socket.m4 \
+ $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -164,6 +164,7 @@ ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
+GAWKLIBEXT = @GAWKLIBEXT@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
@@ -179,6 +180,7 @@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
+LIBMPFR = @LIBMPFR@
LIBOBJS = @LIBOBJS@
LIBREADLINE = @LIBREADLINE@
LIBS = @LIBS@
@@ -220,6 +222,7 @@ abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
+acl_shlibext = @acl_shlibext@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -254,12 +257,14 @@ mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
+pkgextensiondir = @pkgextensiondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
+subdirs = @subdirs@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
@@ -269,8 +274,16 @@ info_TEXINFOS = gawk.texi gawkinet.texi
man_MANS = gawk.1 igawk.1
EXTRA_DIST = ChangeLog ChangeLog.0 README.card ad.block setter.outline \
awkcard.in awkforai.txt texinfo.tex cardfonts \
+ api-figure1.eps api-figure1.fig api-figure1.pdf \
+ api-figure1.png api-figure1.txt \
+ api-figure2.eps api-figure2.fig api-figure2.pdf \
+ api-figure2.png api-figure2.txt \
+ api-figure3.eps api-figure3.fig api-figure3.pdf \
+ api-figure3.png api-figure3.txt \
general-program.eps general-program.fig general-program.pdf \
+ general-program.png general-program.txt \
process-flow.eps process-flow.fig process-flow.pdf \
+ process-flow.png process-flow.txt \
macros colors no.colors $(man_MANS) \
lflashlight-small.xpic lflashlight.eps lflashlight.pdf \
rflashlight-small.xpic rflashlight.eps rflashlight.pdf \
@@ -291,18 +304,6 @@ CARDFILES = $(CARDSRC) ad.block awkcard.in setter.outline
# Use this if your troff can correctly handle macros from 'colors' file
AWKCARD = awkcard.ps
-
-# Uncomment the following definition of AWKCARD if your troff can produce
-# Postscript but still has troubles with macros from 'colors'. As this
-# is not groff you will have to change TROFF macro as well. Do not forget
-# to ensure that awkcard.tr is processed by tbl.
-#AWKCARD = awkcard.nc
-
-# The following is patterned after the main Makefile.am. The point is to
-# make pgawk.1 a link to gawk.1 in the installed man directory.
-
-# We want hard links for install-data-hook, below
-LN = ln -f
all: all-am
.SUFFIXES:
@@ -648,8 +649,7 @@ info: info-am
info-am: $(INFO_DEPS)
install-data-am: install-info-am install-man
- @$(NORMAL_INSTALL)
- $(MAKE) $(AM_MAKEFLAGS) install-data-hook
+
install-dvi: install-dvi-am
install-dvi-am: $(DVIS)
@@ -784,38 +784,31 @@ ps-am: $(PSS)
uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \
uninstall-man uninstall-pdf-am uninstall-ps-am
- @$(NORMAL_INSTALL)
- $(MAKE) $(AM_MAKEFLAGS) uninstall-hook
+
uninstall-man: uninstall-man1
-.MAKE: install-am install-data-am install-strip uninstall-am
+.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-aminfo clean-generic \
dist-info distclean distclean-generic distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
- install-data-am install-data-hook install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-man install-man1 \
- install-pdf install-pdf-am install-ps install-ps-am \
- install-strip installcheck installcheck-am installdirs \
- maintainer-clean maintainer-clean-aminfo \
- maintainer-clean-generic mostlyclean mostlyclean-aminfo \
- mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \
- uninstall-dvi-am uninstall-hook uninstall-html-am \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-man1 install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-aminfo maintainer-clean-generic mostlyclean \
+ mostlyclean-aminfo mostlyclean-generic pdf pdf-am ps ps-am \
+ uninstall uninstall-am uninstall-dvi-am uninstall-html-am \
uninstall-info-am uninstall-man uninstall-man1 \
uninstall-pdf-am uninstall-ps-am
-# Link gawk.1 to pgawk.1 and to dgawk.1
-install-data-hook:
- (cd $(DESTDIR)$(man1dir); \
- $(LN) gawk.1 pgawk.1 2>/dev/null ; \
- $(LN) gawk.1 dgawk.1 2>/dev/null ; \
- exit 0)
-
-# Undo the above when uninstalling
-uninstall-hook:
- cd $(DESTDIR)$(man1dir); rm -f pgawk.1 dgawk.1 ; exit 0
+# Uncomment the following definition of AWKCARD if your troff can produce
+# Postscript but still has troubles with macros from 'colors'. As this
+# is not groff you will have to change TROFF macro as well. Do not forget
+# to ensure that awkcard.tr is processed by tbl.
+#AWKCARD = awkcard.nc
postscript: gawk.ps gawkinet.ps gawk.1.ps igawk.1.ps $(AWKCARD)
diff --git a/doc/api-figure1.eps b/doc/api-figure1.eps
new file mode 100644
index 00000000..7af094c9
--- /dev/null
+++ b/doc/api-figure1.eps
@@ -0,0 +1,536 @@
+%!PS-Adobe-3.0 EPSF-3.0
+%%Title: api-figure1.fig
+%%Creator: fig2dev Version 3.2 Patchlevel 5d
+%%CreationDate: Wed Oct 31 20:16:08 2012
+%%BoundingBox: 0 0 399 227
+%Magnification: 1.0000
+%%EndComments
+%%BeginProlog
+/MyAppDict 100 dict dup begin def
+/$F2psDict 200 dict def
+$F2psDict begin
+$F2psDict /mtrx matrix put
+/col-1 {0 setgray} bind def
+/col0 {0.000 0.000 0.000 srgb} bind def
+/col1 {0.000 0.000 1.000 srgb} bind def
+/col2 {0.000 1.000 0.000 srgb} bind def
+/col3 {0.000 1.000 1.000 srgb} bind def
+/col4 {1.000 0.000 0.000 srgb} bind def
+/col5 {1.000 0.000 1.000 srgb} bind def
+/col6 {1.000 1.000 0.000 srgb} bind def
+/col7 {1.000 1.000 1.000 srgb} bind def
+/col8 {0.000 0.000 0.560 srgb} bind def
+/col9 {0.000 0.000 0.690 srgb} bind def
+/col10 {0.000 0.000 0.820 srgb} bind def
+/col11 {0.530 0.810 1.000 srgb} bind def
+/col12 {0.000 0.560 0.000 srgb} bind def
+/col13 {0.000 0.690 0.000 srgb} bind def
+/col14 {0.000 0.820 0.000 srgb} bind def
+/col15 {0.000 0.560 0.560 srgb} bind def
+/col16 {0.000 0.690 0.690 srgb} bind def
+/col17 {0.000 0.820 0.820 srgb} bind def
+/col18 {0.560 0.000 0.000 srgb} bind def
+/col19 {0.690 0.000 0.000 srgb} bind def
+/col20 {0.820 0.000 0.000 srgb} bind def
+/col21 {0.560 0.000 0.560 srgb} bind def
+/col22 {0.690 0.000 0.690 srgb} bind def
+/col23 {0.820 0.000 0.820 srgb} bind def
+/col24 {0.500 0.190 0.000 srgb} bind def
+/col25 {0.630 0.250 0.000 srgb} bind def
+/col26 {0.750 0.380 0.000 srgb} bind def
+/col27 {1.000 0.500 0.500 srgb} bind def
+/col28 {1.000 0.630 0.630 srgb} bind def
+/col29 {1.000 0.750 0.750 srgb} bind def
+/col30 {1.000 0.880 0.880 srgb} bind def
+/col31 {1.000 0.840 0.000 srgb} bind def
+
+end
+
+% This junk string is used by the show operators
+/PATsstr 1 string def
+/PATawidthshow { % cx cy cchar rx ry string
+ % Loop over each character in the string
+ { % cx cy cchar rx ry char
+ % Show the character
+ dup % cx cy cchar rx ry char char
+ PATsstr dup 0 4 -1 roll put % cx cy cchar rx ry char (char)
+ false charpath % cx cy cchar rx ry char
+ /clip load PATdraw
+ % Move past the character (charpath modified the
+ % current point)
+ currentpoint % cx cy cchar rx ry char x y
+ newpath
+ moveto % cx cy cchar rx ry char
+ % Reposition by cx,cy if the character in the string is cchar
+ 3 index eq { % cx cy cchar rx ry
+ 4 index 4 index rmoveto
+ } if
+ % Reposition all characters by rx ry
+ 2 copy rmoveto % cx cy cchar rx ry
+ } forall
+ pop pop pop pop pop % -
+ currentpoint
+ newpath
+ moveto
+} bind def
+/PATcg {
+ 7 dict dup begin
+ /lw currentlinewidth def
+ /lc currentlinecap def
+ /lj currentlinejoin def
+ /ml currentmiterlimit def
+ /ds [ currentdash ] def
+ /cc [ currentrgbcolor ] def
+ /cm matrix currentmatrix def
+ end
+} bind def
+% PATdraw - calculates the boundaries of the object and
+% fills it with the current pattern
+/PATdraw { % proc
+ save exch
+ PATpcalc % proc nw nh px py
+ 5 -1 roll exec % nw nh px py
+ newpath
+ PATfill % -
+ restore
+} bind def
+% PATfill - performs the tiling for the shape
+/PATfill { % nw nh px py PATfill -
+ PATDict /CurrentPattern get dup begin
+ setfont
+ % Set the coordinate system to Pattern Space
+ PatternGState PATsg
+ % Set the color for uncolored pattezns
+ PaintType 2 eq { PATDict /PColor get PATsc } if
+ % Create the string for showing
+ 3 index string % nw nh px py str
+ % Loop for each of the pattern sources
+ 0 1 Multi 1 sub { % nw nh px py str source
+ % Move to the starting location
+ 3 index 3 index % nw nh px py str source px py
+ moveto % nw nh px py str source
+ % For multiple sources, set the appropriate color
+ Multi 1 ne { dup PC exch get PATsc } if
+ % Set the appropriate string for the source
+ 0 1 7 index 1 sub { 2 index exch 2 index put } for pop
+ % Loop over the number of vertical cells
+ 3 index % nw nh px py str nh
+ { % nw nh px py str
+ currentpoint % nw nh px py str cx cy
+ 2 index oldshow % nw nh px py str cx cy
+ YStep add moveto % nw nh px py str
+ } repeat % nw nh px py str
+ } for
+ 5 { pop } repeat
+ end
+} bind def
+
+% PATkshow - kshow with the current pattezn
+/PATkshow { % proc string
+ exch bind % string proc
+ 1 index 0 get % string proc char
+ % Loop over all but the last character in the string
+ 0 1 4 index length 2 sub {
+ % string proc char idx
+ % Find the n+1th character in the string
+ 3 index exch 1 add get % string proc char char+1
+ exch 2 copy % strinq proc char+1 char char+1 char
+ % Now show the nth character
+ PATsstr dup 0 4 -1 roll put % string proc chr+1 chr chr+1 (chr)
+ false charpath % string proc char+1 char char+1
+ /clip load PATdraw
+ % Move past the character (charpath modified the current point)
+ currentpoint newpath moveto
+ % Execute the user proc (should consume char and char+1)
+ mark 3 1 roll % string proc char+1 mark char char+1
+ 4 index exec % string proc char+1 mark...
+ cleartomark % string proc char+1
+ } for
+ % Now display the last character
+ PATsstr dup 0 4 -1 roll put % string proc (char+1)
+ false charpath % string proc
+ /clip load PATdraw
+ neewath
+ pop pop % -
+} bind def
+% PATmp - the makepattern equivalent
+/PATmp { % patdict patmtx PATmp patinstance
+ exch dup length 7 add % We will add 6 new entries plus 1 FID
+ dict copy % Create a new dictionary
+ begin
+ % Matrix to install when painting the pattern
+ TilingType PATtcalc
+ /PatternGState PATcg def
+ PatternGState /cm 3 -1 roll put
+ % Check for multi pattern sources (Level 1 fast color patterns)
+ currentdict /Multi known not { /Multi 1 def } if
+ % Font dictionary definitions
+ /FontType 3 def
+ % Create a dummy encoding vector
+ /Encoding 256 array def
+ 3 string 0 1 255 {
+ Encoding exch dup 3 index cvs cvn put } for pop
+ /FontMatrix matrix def
+ /FontBBox BBox def
+ /BuildChar {
+ mark 3 1 roll % mark dict char
+ exch begin
+ Multi 1 ne {PaintData exch get}{pop} ifelse % mark [paintdata]
+ PaintType 2 eq Multi 1 ne or
+ { XStep 0 FontBBox aload pop setcachedevice }
+ { XStep 0 setcharwidth } ifelse
+ currentdict % mark [paintdata] dict
+ /PaintProc load % mark [paintdata] dict paintproc
+ end
+ gsave
+ false PATredef exec true PATredef
+ grestore
+ cleartomark % -
+ } bind def
+ currentdict
+ end % newdict
+ /foo exch % /foo newlict
+ definefont % newfont
+} bind def
+% PATpcalc - calculates the starting point and width/height
+% of the tile fill for the shape
+/PATpcalc { % - PATpcalc nw nh px py
+ PATDict /CurrentPattern get begin
+ gsave
+ % Set up the coordinate system to Pattern Space
+ % and lock down pattern
+ PatternGState /cm get setmatrix
+ BBox aload pop pop pop translate
+ % Determine the bounding box of the shape
+ pathbbox % llx lly urx ury
+ grestore
+ % Determine (nw, nh) the # of cells to paint width and height
+ PatHeight div ceiling % llx lly urx qh
+ 4 1 roll % qh llx lly urx
+ PatWidth div ceiling % qh llx lly qw
+ 4 1 roll % qw qh llx lly
+ PatHeight div floor % qw qh llx ph
+ 4 1 roll % ph qw qh llx
+ PatWidth div floor % ph qw qh pw
+ 4 1 roll % pw ph qw qh
+ 2 index sub cvi abs % pw ph qs qh-ph
+ exch 3 index sub cvi abs exch % pw ph nw=qw-pw nh=qh-ph
+ % Determine the starting point of the pattern fill
+ %(px, py)
+ 4 2 roll % nw nh pw ph
+ PatHeight mul % nw nh pw py
+ exch % nw nh py pw
+ PatWidth mul exch % nw nh px py
+ end
+} bind def
+
+% Save the original routines so that we can use them later on
+/oldfill /fill load def
+/oldeofill /eofill load def
+/oldstroke /stroke load def
+/oldshow /show load def
+/oldashow /ashow load def
+/oldwidthshow /widthshow load def
+/oldawidthshow /awidthshow load def
+/oldkshow /kshow load def
+
+% These defs are necessary so that subsequent procs don't bind in
+% the originals
+/fill { oldfill } bind def
+/eofill { oldeofill } bind def
+/stroke { oldstroke } bind def
+/show { oldshow } bind def
+/ashow { oldashow } bind def
+/widthshow { oldwidthshow } bind def
+/awidthshow { oldawidthshow } bind def
+/kshow { oldkshow } bind def
+/PATredef {
+ MyAppDict begin
+ {
+ /fill { /clip load PATdraw newpath } bind def
+ /eofill { /eoclip load PATdraw newpath } bind def
+ /stroke { PATstroke } bind def
+ /show { 0 0 null 0 0 6 -1 roll PATawidthshow } bind def
+ /ashow { 0 0 null 6 3 roll PATawidthshow }
+ bind def
+ /widthshow { 0 0 3 -1 roll PATawidthshow }
+ bind def
+ /awidthshow { PATawidthshow } bind def
+ /kshow { PATkshow } bind def
+ } {
+ /fill { oldfill } bind def
+ /eofill { oldeofill } bind def
+ /stroke { oldstroke } bind def
+ /show { oldshow } bind def
+ /ashow { oldashow } bind def
+ /widthshow { oldwidthshow } bind def
+ /awidthshow { oldawidthshow } bind def
+ /kshow { oldkshow } bind def
+ } ifelse
+ end
+} bind def
+false PATredef
+% Conditionally define setcmykcolor if not available
+/setcmykcolor where { pop } {
+ /setcmykcolor {
+ 1 sub 4 1 roll
+ 3 {
+ 3 index add neg dup 0 lt { pop 0 } if 3 1 roll
+ } repeat
+ setrgbcolor - pop
+ } bind def
+} ifelse
+/PATsc { % colorarray
+ aload length % c1 ... cn length
+ dup 1 eq { pop setgray } { 3 eq { setrgbcolor } { setcmykcolor
+ } ifelse } ifelse
+} bind def
+/PATsg { % dict
+ begin
+ lw setlinewidth
+ lc setlinecap
+ lj setlinejoin
+ ml setmiterlimit
+ ds aload pop setdash
+ cc aload pop setrgbcolor
+ cm setmatrix
+ end
+} bind def
+
+/PATDict 3 dict def
+/PATsp {
+ true PATredef
+ PATDict begin
+ /CurrentPattern exch def
+ % If it's an uncolored pattern, save the color
+ CurrentPattern /PaintType get 2 eq {
+ /PColor exch def
+ } if
+ /CColor [ currentrgbcolor ] def
+ end
+} bind def
+% PATstroke - stroke with the current pattern
+/PATstroke {
+ countdictstack
+ save
+ mark
+ {
+ currentpoint strokepath moveto
+ PATpcalc % proc nw nh px py
+ clip newpath PATfill
+ } stopped {
+ (*** PATstroke Warning: Path is too complex, stroking
+ with gray) =
+ cleartomark
+ restore
+ countdictstack exch sub dup 0 gt
+ { { end } repeat } { pop } ifelse
+ gsave 0.5 setgray oldstroke grestore
+ } { pop restore pop } ifelse
+ newpath
+} bind def
+/PATtcalc { % modmtx tilingtype PATtcalc tilematrix
+ % Note: tiling types 2 and 3 are not supported
+ gsave
+ exch concat % tilingtype
+ matrix currentmatrix exch % cmtx tilingtype
+ % Tiling type 1 and 3: constant spacing
+ 2 ne {
+ % Distort the pattern so that it occupies
+ % an integral number of device pixels
+ dup 4 get exch dup 5 get exch % tx ty cmtx
+ XStep 0 dtransform
+ round exch round exch % tx ty cmtx dx.x dx.y
+ XStep div exch XStep div exch % tx ty cmtx a b
+ 0 YStep dtransform
+ round exch round exch % tx ty cmtx a b dy.x dy.y
+ YStep div exch YStep div exch % tx ty cmtx a b c d
+ 7 -3 roll astore % { a b c d tx ty }
+ } if
+ grestore
+} bind def
+/PATusp {
+ false PATredef
+ PATDict begin
+ CColor PATsc
+ end
+} bind def
+
+% right30
+11 dict begin
+/PaintType 1 def
+/PatternType 1 def
+/TilingType 1 def
+/BBox [0 0 1 1] def
+/XStep 1 def
+/YStep 1 def
+/PatWidth 1 def
+/PatHeight 1 def
+/Multi 2 def
+/PaintData [
+ { clippath } bind
+ { 32 16 true [ 32 0 0 -16 0 16 ]
+ {<00030003000c000c0030003000c000c0030003000c000c00
+ 30003000c000c00000030003000c000c0030003000c000c0
+ 030003000c000c0030003000c000c000>}
+ imagemask } bind
+] def
+/PaintProc {
+ pop
+ exec fill
+} def
+currentdict
+end
+/P2 exch def
+
+/cp {closepath} bind def
+/ef {eofill} bind def
+/gr {grestore} bind def
+/gs {gsave} bind def
+/sa {save} bind def
+/rs {restore} bind def
+/l {lineto} bind def
+/m {moveto} bind def
+/rm {rmoveto} bind def
+/n {newpath} bind def
+/s {stroke} bind def
+/sh {show} bind def
+/slc {setlinecap} bind def
+/slj {setlinejoin} bind def
+/slw {setlinewidth} bind def
+/srgb {setrgbcolor} bind def
+/rot {rotate} bind def
+/sc {scale} bind def
+/sd {setdash} bind def
+/ff {findfont} bind def
+/sf {setfont} bind def
+/scf {scalefont} bind def
+/sw {stringwidth} bind def
+/tr {translate} bind def
+/tnt {dup dup currentrgbcolor
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
+ bind def
+/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
+ 4 -2 roll mul srgb} bind def
+/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
+/$F2psEnd {$F2psEnteredState restore end} def
+
+/pageheader {
+save
+newpath 0 227 moveto 0 0 lineto 399 0 lineto 399 227 lineto closepath clip newpath
+-194.8 350.2 translate
+1 -1 scale
+$F2psBegin
+10 setmiterlimit
+0 slj 0 slc
+ 0.06299 0.06299 sc
+} bind def
+/pagefooter {
+$F2psEnd
+restore
+} bind def
+%%EndProlog
+pageheader
+%
+% Fig objects follow
+%
+%
+% here starts figure with depth 50
+% Arc
+7.500 slw
+0 slc
+gs clippath
+3599 4000 m 3567 4148 l 3626 4161 l 3658 4013 l 3658 4013 l 3603 4124 l 3599 4000 l cp
+eoclip
+n 5449.3 4471.5 1878.7 -70.5453 -169.8379 arcn
+gs col0 s gr
+ gr
+
+% arrowhead
+0 slj
+n 3599 4000 m 3603 4124 l 3658 4013 l 3599 4000 l cp gs 0.00 setgray ef gr col0 s
+% Arc
+gs clippath
+4422 4004 m 4425 4155 l 4485 4154 l 4482 4003 l 4482 4003 l 4455 4124 l 4422 4004 l cp
+eoclip
+n 5539.0 4051.3 1087.6 -60.4713 175.3232 arcn
+gs col0 s gr
+ gr
+
+% arrowhead
+n 4422 4004 m 4455 4124 l 4482 4003 l 4422 4004 l cp gs 0.00 setgray ef gr col0 s
+% Arc
+gs clippath
+4986 4010 m 5012 4159 l 5072 4149 l 5046 4000 l 5046 4000 l 5037 4124 l 4986 4010 l cp
+eoclip
+n 5628.8 3967.5 613.5 -36.7999 163.6698 arcn
+gs col0 s gr
+ gr
+
+% arrowhead
+n 4986 4010 m 5037 4124 l 5046 4000 l 4986 4010 l cp gs 0.00 setgray ef gr col0 s
+% Arc
+135.000 slw
+gs clippath
+7736 3835 m 7756 3984 l 7907 3964 l 7887 3814 l 7841 3821 l 7828 3944 l 7782 3829 l cp
+eoclip
+n 6609.1 4056.9 1224.8 -93.9364 -4.5364 arc
+gs col0 s gr
+ gr
+
+% arrowhead
+7.500 slw
+n 7782 3829 m 7828 3944 l 7841 3821 l col0 s
+% Polyline
+n 3105 4140 m 6660 4140 l 6660 5085 l 3105 5085 l
+ cp gs col0 s gr
+% Polyline
+n 6660 4140 m 8730 4140 l 8730 5085 l 6660 5085 l
+ cp gs col7 0.50 shd ef gr gs col0 s gr
+% Polyline
+n 5805 2610 m 6345 2610 l 6345 3690 l 5805 3690 l
+ cp gs col0 s gr
+% Polyline
+n 5805 2835 m 6345 2835 l 6345 3015 l 5805 3015 l
+ cp gs col0 s gr
+% Polyline
+n 5805 3195 m 6345 3195 l 6345 3375 l 5805 3375 l
+ cp gs col0 s gr
+% Polyline
+n 5805 3510 m 6345 3510 l 6345 3690 l 5805 3690 l
+ cp gs col0 s gr
+% Polyline
+n 3510 4140 m 3780 4140 l 3780 5085 l 3510 5085 l
+ cp gs /PC [[1.00 1.00 1.00] [0.00 0.00 0.00]] def
+15.00 15.00 sc P2 [16 0 0 -8 234.00 276.00] PATmp PATsp ef gr PATusp gs col0 s gr
+% Polyline
+n 4365 4140 m 4635 4140 l 4635 5085 l 4365 5085 l
+ cp gs /PC [[1.00 1.00 1.00] [0.00 0.00 0.00]] def
+15.00 15.00 sc P2 [16 0 0 -8 291.00 276.00] PATmp PATsp ef gr PATusp gs col0 s gr
+% Polyline
+n 4905 4140 m 5265 4140 l 5265 5085 l 4905 5085 l
+ cp gs /PC [[1.00 1.00 1.00] [0.00 0.00 0.00]] def
+15.00 15.00 sc P2 [16 0 0 -8 327.00 276.00] PATmp PATsp ef gr PATusp gs col0 s gr
+/Times-Roman ff 180.00 scf sf
+3510 5490 m
+gs 1 -1 sc (gawk Main Program Address Space) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+7290 5490 m
+gs 1 -1 sc (Extension) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+5985 2115 m
+gs 1 -1 sc (API) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+5895 2340 m
+gs 1 -1 sc (Struct) col0 sh gr
+/Courier-Bold ff 180.00 scf sf
+7065 2655 m
+gs 1 -1 sc (dl_load\(api_p, id\);) col0 sh gr
+% here ends figure;
+pagefooter
+showpage
+%%Trailer
+end
+%EOF
diff --git a/doc/api-figure1.fig b/doc/api-figure1.fig
new file mode 100644
index 00000000..7bc47846
--- /dev/null
+++ b/doc/api-figure1.fig
@@ -0,0 +1,40 @@
+#FIG 3.2 Produced by xfig version 3.2.5b
+Landscape
+Center
+Metric
+A4
+100.00
+Single
+-2
+1200 2
+5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 5449.265 4471.471 6075 2700 4320 2970 3600 4140
+ 1 1 1.00 60.00 120.00
+5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 5538.971 4051.323 6075 3105 4725 3330 4455 4140
+ 1 1 1.00 60.00 120.00
+5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 5628.750 3967.500 6120 3600 5220 3510 5040 4140
+ 1 1 1.00 60.00 120.00
+5 1 0 10 0 7 50 -1 -1 0.000 0 0 1 0 6609.079 4056.868 6525 2835 7560 3285 7830 3960
+ 0 0 1.00 60.00 120.00
+2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
+ 3105 4140 6660 4140 6660 5085 3105 5085 3105 4140
+2 2 0 1 0 7 50 -1 10 0.000 0 0 -1 0 0 5
+ 6660 4140 8730 4140 8730 5085 6660 5085 6660 4140
+2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
+ 5805 2610 6345 2610 6345 3690 5805 3690 5805 2610
+2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
+ 5805 2835 6345 2835 6345 3015 5805 3015 5805 2835
+2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
+ 5805 3195 6345 3195 6345 3375 5805 3375 5805 3195
+2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
+ 5805 3510 6345 3510 6345 3690 5805 3690 5805 3510
+2 2 0 1 0 7 50 -1 42 0.000 0 0 -1 0 0 5
+ 3510 4140 3780 4140 3780 5085 3510 5085 3510 4140
+2 2 0 1 0 7 50 -1 42 0.000 0 0 -1 0 0 5
+ 4365 4140 4635 4140 4635 5085 4365 5085 4365 4140
+2 2 0 1 0 7 50 -1 42 0.000 0 0 -1 0 0 5
+ 4905 4140 5265 4140 5265 5085 4905 5085 4905 4140
+4 0 0 50 -1 0 12 0.0000 4 180 2850 3510 5490 gawk Main Program Address Space\001
+4 0 0 50 -1 0 12 0.0000 4 135 825 7290 5490 Extension\001
+4 0 0 50 -1 0 12 0.0000 4 135 300 5985 2115 API\001
+4 0 0 50 -1 0 12 0.0000 4 135 480 5895 2340 Struct\001
+4 0 0 50 -1 14 12 0.0000 4 165 2280 7065 2655 dl_load(api_p, id);\001
diff --git a/doc/api-figure1.pdf b/doc/api-figure1.pdf
new file mode 100644
index 00000000..0c24b67d
--- /dev/null
+++ b/doc/api-figure1.pdf
Binary files differ
diff --git a/doc/api-figure1.png b/doc/api-figure1.png
new file mode 100644
index 00000000..72d552cd
--- /dev/null
+++ b/doc/api-figure1.png
Binary files differ
diff --git a/doc/api-figure1.txt b/doc/api-figure1.txt
new file mode 100644
index 00000000..686b853b
--- /dev/null
+++ b/doc/api-figure1.txt
@@ -0,0 +1,24 @@
+ API
+ Struct
+ +---+
+ | |
+ +---+
+ +---------------| |
+ | +---+ dl_load(api_p, id);
+ | | | ___________________
+ | +---+ |
+ | +---------| | __________________ |
+ | | +---+ ||
+ | | | | ||
+ | | +---+ ||
+ | | +---| | ||
+ | | | +---+ \ || /
+ | | | \ /
+ v v v \/
++-------+-+---+-+---+-+------------------+--------------------+
+| |x| |x| |x| |OOOOOOOOOOOOOOOOOOOO|
+| |x| |x| |x| |OOOOOOOOOOOOOOOOOOOO|
+| |x| |x| |x| |OOOOOOOOOOOOOOOOOOOO|
++-------+-+---+-+---+-+------------------+--------------------+
+
+ gawk Main Program Address Space Extension
diff --git a/doc/api-figure2.eps b/doc/api-figure2.eps
new file mode 100644
index 00000000..4ca9e321
--- /dev/null
+++ b/doc/api-figure2.eps
@@ -0,0 +1,517 @@
+%!PS-Adobe-3.0 EPSF-3.0
+%%Title: api-figure2.fig
+%%Creator: fig2dev Version 3.2 Patchlevel 5d
+%%CreationDate: Wed Oct 31 20:16:08 2012
+%%BoundingBox: 0 0 363 179
+%Magnification: 1.0000
+%%EndComments
+%%BeginProlog
+/MyAppDict 100 dict dup begin def
+/$F2psDict 200 dict def
+$F2psDict begin
+$F2psDict /mtrx matrix put
+/col-1 {0 setgray} bind def
+/col0 {0.000 0.000 0.000 srgb} bind def
+/col1 {0.000 0.000 1.000 srgb} bind def
+/col2 {0.000 1.000 0.000 srgb} bind def
+/col3 {0.000 1.000 1.000 srgb} bind def
+/col4 {1.000 0.000 0.000 srgb} bind def
+/col5 {1.000 0.000 1.000 srgb} bind def
+/col6 {1.000 1.000 0.000 srgb} bind def
+/col7 {1.000 1.000 1.000 srgb} bind def
+/col8 {0.000 0.000 0.560 srgb} bind def
+/col9 {0.000 0.000 0.690 srgb} bind def
+/col10 {0.000 0.000 0.820 srgb} bind def
+/col11 {0.530 0.810 1.000 srgb} bind def
+/col12 {0.000 0.560 0.000 srgb} bind def
+/col13 {0.000 0.690 0.000 srgb} bind def
+/col14 {0.000 0.820 0.000 srgb} bind def
+/col15 {0.000 0.560 0.560 srgb} bind def
+/col16 {0.000 0.690 0.690 srgb} bind def
+/col17 {0.000 0.820 0.820 srgb} bind def
+/col18 {0.560 0.000 0.000 srgb} bind def
+/col19 {0.690 0.000 0.000 srgb} bind def
+/col20 {0.820 0.000 0.000 srgb} bind def
+/col21 {0.560 0.000 0.560 srgb} bind def
+/col22 {0.690 0.000 0.690 srgb} bind def
+/col23 {0.820 0.000 0.820 srgb} bind def
+/col24 {0.500 0.190 0.000 srgb} bind def
+/col25 {0.630 0.250 0.000 srgb} bind def
+/col26 {0.750 0.380 0.000 srgb} bind def
+/col27 {1.000 0.500 0.500 srgb} bind def
+/col28 {1.000 0.630 0.630 srgb} bind def
+/col29 {1.000 0.750 0.750 srgb} bind def
+/col30 {1.000 0.880 0.880 srgb} bind def
+/col31 {1.000 0.840 0.000 srgb} bind def
+
+end
+
+% This junk string is used by the show operators
+/PATsstr 1 string def
+/PATawidthshow { % cx cy cchar rx ry string
+ % Loop over each character in the string
+ { % cx cy cchar rx ry char
+ % Show the character
+ dup % cx cy cchar rx ry char char
+ PATsstr dup 0 4 -1 roll put % cx cy cchar rx ry char (char)
+ false charpath % cx cy cchar rx ry char
+ /clip load PATdraw
+ % Move past the character (charpath modified the
+ % current point)
+ currentpoint % cx cy cchar rx ry char x y
+ newpath
+ moveto % cx cy cchar rx ry char
+ % Reposition by cx,cy if the character in the string is cchar
+ 3 index eq { % cx cy cchar rx ry
+ 4 index 4 index rmoveto
+ } if
+ % Reposition all characters by rx ry
+ 2 copy rmoveto % cx cy cchar rx ry
+ } forall
+ pop pop pop pop pop % -
+ currentpoint
+ newpath
+ moveto
+} bind def
+/PATcg {
+ 7 dict dup begin
+ /lw currentlinewidth def
+ /lc currentlinecap def
+ /lj currentlinejoin def
+ /ml currentmiterlimit def
+ /ds [ currentdash ] def
+ /cc [ currentrgbcolor ] def
+ /cm matrix currentmatrix def
+ end
+} bind def
+% PATdraw - calculates the boundaries of the object and
+% fills it with the current pattern
+/PATdraw { % proc
+ save exch
+ PATpcalc % proc nw nh px py
+ 5 -1 roll exec % nw nh px py
+ newpath
+ PATfill % -
+ restore
+} bind def
+% PATfill - performs the tiling for the shape
+/PATfill { % nw nh px py PATfill -
+ PATDict /CurrentPattern get dup begin
+ setfont
+ % Set the coordinate system to Pattern Space
+ PatternGState PATsg
+ % Set the color for uncolored pattezns
+ PaintType 2 eq { PATDict /PColor get PATsc } if
+ % Create the string for showing
+ 3 index string % nw nh px py str
+ % Loop for each of the pattern sources
+ 0 1 Multi 1 sub { % nw nh px py str source
+ % Move to the starting location
+ 3 index 3 index % nw nh px py str source px py
+ moveto % nw nh px py str source
+ % For multiple sources, set the appropriate color
+ Multi 1 ne { dup PC exch get PATsc } if
+ % Set the appropriate string for the source
+ 0 1 7 index 1 sub { 2 index exch 2 index put } for pop
+ % Loop over the number of vertical cells
+ 3 index % nw nh px py str nh
+ { % nw nh px py str
+ currentpoint % nw nh px py str cx cy
+ 2 index oldshow % nw nh px py str cx cy
+ YStep add moveto % nw nh px py str
+ } repeat % nw nh px py str
+ } for
+ 5 { pop } repeat
+ end
+} bind def
+
+% PATkshow - kshow with the current pattezn
+/PATkshow { % proc string
+ exch bind % string proc
+ 1 index 0 get % string proc char
+ % Loop over all but the last character in the string
+ 0 1 4 index length 2 sub {
+ % string proc char idx
+ % Find the n+1th character in the string
+ 3 index exch 1 add get % string proc char char+1
+ exch 2 copy % strinq proc char+1 char char+1 char
+ % Now show the nth character
+ PATsstr dup 0 4 -1 roll put % string proc chr+1 chr chr+1 (chr)
+ false charpath % string proc char+1 char char+1
+ /clip load PATdraw
+ % Move past the character (charpath modified the current point)
+ currentpoint newpath moveto
+ % Execute the user proc (should consume char and char+1)
+ mark 3 1 roll % string proc char+1 mark char char+1
+ 4 index exec % string proc char+1 mark...
+ cleartomark % string proc char+1
+ } for
+ % Now display the last character
+ PATsstr dup 0 4 -1 roll put % string proc (char+1)
+ false charpath % string proc
+ /clip load PATdraw
+ neewath
+ pop pop % -
+} bind def
+% PATmp - the makepattern equivalent
+/PATmp { % patdict patmtx PATmp patinstance
+ exch dup length 7 add % We will add 6 new entries plus 1 FID
+ dict copy % Create a new dictionary
+ begin
+ % Matrix to install when painting the pattern
+ TilingType PATtcalc
+ /PatternGState PATcg def
+ PatternGState /cm 3 -1 roll put
+ % Check for multi pattern sources (Level 1 fast color patterns)
+ currentdict /Multi known not { /Multi 1 def } if
+ % Font dictionary definitions
+ /FontType 3 def
+ % Create a dummy encoding vector
+ /Encoding 256 array def
+ 3 string 0 1 255 {
+ Encoding exch dup 3 index cvs cvn put } for pop
+ /FontMatrix matrix def
+ /FontBBox BBox def
+ /BuildChar {
+ mark 3 1 roll % mark dict char
+ exch begin
+ Multi 1 ne {PaintData exch get}{pop} ifelse % mark [paintdata]
+ PaintType 2 eq Multi 1 ne or
+ { XStep 0 FontBBox aload pop setcachedevice }
+ { XStep 0 setcharwidth } ifelse
+ currentdict % mark [paintdata] dict
+ /PaintProc load % mark [paintdata] dict paintproc
+ end
+ gsave
+ false PATredef exec true PATredef
+ grestore
+ cleartomark % -
+ } bind def
+ currentdict
+ end % newdict
+ /foo exch % /foo newlict
+ definefont % newfont
+} bind def
+% PATpcalc - calculates the starting point and width/height
+% of the tile fill for the shape
+/PATpcalc { % - PATpcalc nw nh px py
+ PATDict /CurrentPattern get begin
+ gsave
+ % Set up the coordinate system to Pattern Space
+ % and lock down pattern
+ PatternGState /cm get setmatrix
+ BBox aload pop pop pop translate
+ % Determine the bounding box of the shape
+ pathbbox % llx lly urx ury
+ grestore
+ % Determine (nw, nh) the # of cells to paint width and height
+ PatHeight div ceiling % llx lly urx qh
+ 4 1 roll % qh llx lly urx
+ PatWidth div ceiling % qh llx lly qw
+ 4 1 roll % qw qh llx lly
+ PatHeight div floor % qw qh llx ph
+ 4 1 roll % ph qw qh llx
+ PatWidth div floor % ph qw qh pw
+ 4 1 roll % pw ph qw qh
+ 2 index sub cvi abs % pw ph qs qh-ph
+ exch 3 index sub cvi abs exch % pw ph nw=qw-pw nh=qh-ph
+ % Determine the starting point of the pattern fill
+ %(px, py)
+ 4 2 roll % nw nh pw ph
+ PatHeight mul % nw nh pw py
+ exch % nw nh py pw
+ PatWidth mul exch % nw nh px py
+ end
+} bind def
+
+% Save the original routines so that we can use them later on
+/oldfill /fill load def
+/oldeofill /eofill load def
+/oldstroke /stroke load def
+/oldshow /show load def
+/oldashow /ashow load def
+/oldwidthshow /widthshow load def
+/oldawidthshow /awidthshow load def
+/oldkshow /kshow load def
+
+% These defs are necessary so that subsequent procs don't bind in
+% the originals
+/fill { oldfill } bind def
+/eofill { oldeofill } bind def
+/stroke { oldstroke } bind def
+/show { oldshow } bind def
+/ashow { oldashow } bind def
+/widthshow { oldwidthshow } bind def
+/awidthshow { oldawidthshow } bind def
+/kshow { oldkshow } bind def
+/PATredef {
+ MyAppDict begin
+ {
+ /fill { /clip load PATdraw newpath } bind def
+ /eofill { /eoclip load PATdraw newpath } bind def
+ /stroke { PATstroke } bind def
+ /show { 0 0 null 0 0 6 -1 roll PATawidthshow } bind def
+ /ashow { 0 0 null 6 3 roll PATawidthshow }
+ bind def
+ /widthshow { 0 0 3 -1 roll PATawidthshow }
+ bind def
+ /awidthshow { PATawidthshow } bind def
+ /kshow { PATkshow } bind def
+ } {
+ /fill { oldfill } bind def
+ /eofill { oldeofill } bind def
+ /stroke { oldstroke } bind def
+ /show { oldshow } bind def
+ /ashow { oldashow } bind def
+ /widthshow { oldwidthshow } bind def
+ /awidthshow { oldawidthshow } bind def
+ /kshow { oldkshow } bind def
+ } ifelse
+ end
+} bind def
+false PATredef
+% Conditionally define setcmykcolor if not available
+/setcmykcolor where { pop } {
+ /setcmykcolor {
+ 1 sub 4 1 roll
+ 3 {
+ 3 index add neg dup 0 lt { pop 0 } if 3 1 roll
+ } repeat
+ setrgbcolor - pop
+ } bind def
+} ifelse
+/PATsc { % colorarray
+ aload length % c1 ... cn length
+ dup 1 eq { pop setgray } { 3 eq { setrgbcolor } { setcmykcolor
+ } ifelse } ifelse
+} bind def
+/PATsg { % dict
+ begin
+ lw setlinewidth
+ lc setlinecap
+ lj setlinejoin
+ ml setmiterlimit
+ ds aload pop setdash
+ cc aload pop setrgbcolor
+ cm setmatrix
+ end
+} bind def
+
+/PATDict 3 dict def
+/PATsp {
+ true PATredef
+ PATDict begin
+ /CurrentPattern exch def
+ % If it's an uncolored pattern, save the color
+ CurrentPattern /PaintType get 2 eq {
+ /PColor exch def
+ } if
+ /CColor [ currentrgbcolor ] def
+ end
+} bind def
+% PATstroke - stroke with the current pattern
+/PATstroke {
+ countdictstack
+ save
+ mark
+ {
+ currentpoint strokepath moveto
+ PATpcalc % proc nw nh px py
+ clip newpath PATfill
+ } stopped {
+ (*** PATstroke Warning: Path is too complex, stroking
+ with gray) =
+ cleartomark
+ restore
+ countdictstack exch sub dup 0 gt
+ { { end } repeat } { pop } ifelse
+ gsave 0.5 setgray oldstroke grestore
+ } { pop restore pop } ifelse
+ newpath
+} bind def
+/PATtcalc { % modmtx tilingtype PATtcalc tilematrix
+ % Note: tiling types 2 and 3 are not supported
+ gsave
+ exch concat % tilingtype
+ matrix currentmatrix exch % cmtx tilingtype
+ % Tiling type 1 and 3: constant spacing
+ 2 ne {
+ % Distort the pattern so that it occupies
+ % an integral number of device pixels
+ dup 4 get exch dup 5 get exch % tx ty cmtx
+ XStep 0 dtransform
+ round exch round exch % tx ty cmtx dx.x dx.y
+ XStep div exch XStep div exch % tx ty cmtx a b
+ 0 YStep dtransform
+ round exch round exch % tx ty cmtx a b dy.x dy.y
+ YStep div exch YStep div exch % tx ty cmtx a b c d
+ 7 -3 roll astore % { a b c d tx ty }
+ } if
+ grestore
+} bind def
+/PATusp {
+ false PATredef
+ PATDict begin
+ CColor PATsc
+ end
+} bind def
+
+% right30
+11 dict begin
+/PaintType 1 def
+/PatternType 1 def
+/TilingType 1 def
+/BBox [0 0 1 1] def
+/XStep 1 def
+/YStep 1 def
+/PatWidth 1 def
+/PatHeight 1 def
+/Multi 2 def
+/PaintData [
+ { clippath } bind
+ { 32 16 true [ 32 0 0 -16 0 16 ]
+ {<00030003000c000c0030003000c000c0030003000c000c00
+ 30003000c000c00000030003000c000c0030003000c000c0
+ 030003000c000c0030003000c000c000>}
+ imagemask } bind
+] def
+/PaintProc {
+ pop
+ exec fill
+} def
+currentdict
+end
+/P2 exch def
+
+% crosshatch45
+11 dict begin
+/PaintType 1 def
+/PatternType 1 def
+/TilingType 1 def
+/BBox [0 0 1 1] def
+/XStep 1 def
+/YStep 1 def
+/PatWidth 1 def
+/PatHeight 1 def
+/Multi 2 def
+/PaintData [
+ { clippath } bind
+ { 20 20 true [ 20 0 0 -20 0 20 ]
+ {<8020004050102088201104400a02800401000a02
+ 8011044020882040501080200040501020882011
+ 04400a02800401000a0280110440208820405010>}
+ imagemask } bind
+] def
+/PaintProc {
+ pop
+ exec fill
+} def
+currentdict
+end
+/P6 exch def
+
+/cp {closepath} bind def
+/ef {eofill} bind def
+/gr {grestore} bind def
+/gs {gsave} bind def
+/sa {save} bind def
+/rs {restore} bind def
+/l {lineto} bind def
+/m {moveto} bind def
+/rm {rmoveto} bind def
+/n {newpath} bind def
+/s {stroke} bind def
+/sh {show} bind def
+/slc {setlinecap} bind def
+/slj {setlinejoin} bind def
+/slw {setlinewidth} bind def
+/srgb {setrgbcolor} bind def
+/rot {rotate} bind def
+/sc {scale} bind def
+/sd {setdash} bind def
+/ff {findfont} bind def
+/sf {setfont} bind def
+/scf {scalefont} bind def
+/sw {stringwidth} bind def
+/tr {translate} bind def
+/tnt {dup dup currentrgbcolor
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
+ bind def
+/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
+ 4 -2 roll mul srgb} bind def
+/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
+/$F2psEnd {$F2psEnteredState restore end} def
+
+/pageheader {
+save
+newpath 0 179 moveto 0 0 lineto 363 0 lineto 363 179 lineto closepath clip newpath
+-194.8 350.2 translate
+1 -1 scale
+$F2psBegin
+10 setmiterlimit
+0 slj 0 slc
+ 0.06299 0.06299 sc
+} bind def
+/pagefooter {
+$F2psEnd
+restore
+} bind def
+%%EndProlog
+pageheader
+%
+% Fig objects follow
+%
+%
+% here starts figure with depth 50
+% Arc
+7.500 slw
+0 slc
+gs clippath
+4057 4011 m 3971 4135 l 4021 4169 l 4107 4045 l 4107 4045 l 4014 4127 l 4057 4011 l cp
+eoclip
+n 6097.5 5512.5 2502.5 -33.2614 -146.7386 arcn
+gs col0 s gr
+ gr
+
+% arrowhead
+0 slj
+n 4057 4011 m 4014 4127 l 4107 4045 l 4057 4011 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+n 3105 4140 m 6660 4140 l 6660 5085 l 3105 5085 l
+ cp gs col0 s gr
+% Polyline
+n 6660 4140 m 8730 4140 l 8730 5085 l 6660 5085 l
+ cp gs col7 0.50 shd ef gr gs col0 s gr
+% Polyline
+n 3510 4140 m 3780 4140 l 3780 5085 l 3510 5085 l
+ cp gs /PC [[1.00 1.00 1.00] [0.00 0.00 0.00]] def
+15.00 15.00 sc P2 [16 0 0 -8 234.00 276.00] PATmp PATsp ef gr PATusp gs col0 s gr
+% Polyline
+n 4365 4140 m 4635 4140 l 4635 5085 l 4365 5085 l
+ cp gs /PC [[1.00 1.00 1.00] [0.00 0.00 0.00]] def
+15.00 15.00 sc P2 [16 0 0 -8 291.00 276.00] PATmp PATsp ef gr PATusp gs col0 s gr
+% Polyline
+n 4905 4140 m 5265 4140 l 5265 5085 l 4905 5085 l
+ cp gs /PC [[1.00 1.00 1.00] [0.00 0.00 0.00]] def
+15.00 15.00 sc P2 [16 0 0 -8 327.00 276.00] PATmp PATsp ef gr PATusp gs col0 s gr
+% Polyline
+n 7965 4140 m 8370 4140 l 8370 5085 l 7965 5085 l
+ cp gs /PC [[1.00 1.00 1.00] [0.00 0.00 0.00]] def
+15.00 15.00 sc P6 [16 0 0 -16 531.00 276.00] PATmp PATsp ef gr PATusp gs col0 s gr
+/Times-Roman ff 180.00 scf sf
+3510 5490 m
+gs 1 -1 sc (gawk Main Program Address Space) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+7290 5490 m
+gs 1 -1 sc (Extension) col0 sh gr
+/Courier-Bold ff 180.00 scf sf
+3420 2880 m
+gs 1 -1 sc (register_ext_func\({ "chdir", do_chdir, 1 }\);) col0 sh gr
+% here ends figure;
+pagefooter
+showpage
+%%Trailer
+end
+%EOF
diff --git a/doc/api-figure2.fig b/doc/api-figure2.fig
new file mode 100644
index 00000000..4b0e0103
--- /dev/null
+++ b/doc/api-figure2.fig
@@ -0,0 +1,26 @@
+#FIG 3.2 Produced by xfig version 3.2.5b
+Landscape
+Center
+Metric
+A4
+100.00
+Single
+-2
+1200 2
+5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 6097.500 5512.500 8190 4140 5940 3015 4005 4140
+ 1 1 1.00 60.00 120.00
+2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
+ 3105 4140 6660 4140 6660 5085 3105 5085 3105 4140
+2 2 0 1 0 7 50 -1 10 0.000 0 0 -1 0 0 5
+ 6660 4140 8730 4140 8730 5085 6660 5085 6660 4140
+2 2 0 1 0 7 50 -1 42 0.000 0 0 -1 0 0 5
+ 3510 4140 3780 4140 3780 5085 3510 5085 3510 4140
+2 2 0 1 0 7 50 -1 42 0.000 0 0 -1 0 0 5
+ 4365 4140 4635 4140 4635 5085 4365 5085 4365 4140
+2 2 0 1 0 7 50 -1 42 0.000 0 0 -1 0 0 5
+ 4905 4140 5265 4140 5265 5085 4905 5085 4905 4140
+2 2 0 1 0 7 50 -1 46 0.000 0 0 -1 0 0 5
+ 7965 4140 8370 4140 8370 5085 7965 5085 7965 4140
+4 0 0 50 -1 0 12 0.0000 4 180 2850 3510 5490 gawk Main Program Address Space\001
+4 0 0 50 -1 0 12 0.0000 4 135 825 7290 5490 Extension\001
+4 0 0 50 -1 14 12 0.0000 4 165 5280 3420 2880 register_ext_func({ "chdir", do_chdir, 1 });\001
diff --git a/doc/api-figure2.pdf b/doc/api-figure2.pdf
new file mode 100644
index 00000000..5727d7e0
--- /dev/null
+++ b/doc/api-figure2.pdf
Binary files differ
diff --git a/doc/api-figure2.png b/doc/api-figure2.png
new file mode 100644
index 00000000..7ce913aa
--- /dev/null
+++ b/doc/api-figure2.png
Binary files differ
diff --git a/doc/api-figure2.txt b/doc/api-figure2.txt
new file mode 100644
index 00000000..691bfde9
--- /dev/null
+++ b/doc/api-figure2.txt
@@ -0,0 +1,12 @@
+ register_ext_func({ "chdir", do_chdir, 1 });
+
+ +--------------------------------------------+
+ | |
+ V |
++-------+-+---+-+---+-+------------------+--------------+-+---+
+| |x| |x| |x| |OOOOOOOOOOOOOO|X|OOO|
+| |x| |x| |x| |OOOOOOOOOOOOOO|X|OOO|
+| |x| |x| |x| |OOOOOOOOOOOOOO|X|OOO|
++-------+-+---+-+---+-+------------------+--------------+-+---+
+
+ gawk Main Program Address Space Extension
diff --git a/doc/api-figure3.eps b/doc/api-figure3.eps
new file mode 100644
index 00000000..d713575f
--- /dev/null
+++ b/doc/api-figure3.eps
@@ -0,0 +1,526 @@
+%!PS-Adobe-3.0 EPSF-3.0
+%%Title: api-figure3.fig
+%%Creator: fig2dev Version 3.2 Patchlevel 5d
+%%CreationDate: Wed Oct 31 20:16:08 2012
+%%BoundingBox: 0 0 356 175
+%Magnification: 1.0000
+%%EndComments
+%%BeginProlog
+/MyAppDict 100 dict dup begin def
+/$F2psDict 200 dict def
+$F2psDict begin
+$F2psDict /mtrx matrix put
+/col-1 {0 setgray} bind def
+/col0 {0.000 0.000 0.000 srgb} bind def
+/col1 {0.000 0.000 1.000 srgb} bind def
+/col2 {0.000 1.000 0.000 srgb} bind def
+/col3 {0.000 1.000 1.000 srgb} bind def
+/col4 {1.000 0.000 0.000 srgb} bind def
+/col5 {1.000 0.000 1.000 srgb} bind def
+/col6 {1.000 1.000 0.000 srgb} bind def
+/col7 {1.000 1.000 1.000 srgb} bind def
+/col8 {0.000 0.000 0.560 srgb} bind def
+/col9 {0.000 0.000 0.690 srgb} bind def
+/col10 {0.000 0.000 0.820 srgb} bind def
+/col11 {0.530 0.810 1.000 srgb} bind def
+/col12 {0.000 0.560 0.000 srgb} bind def
+/col13 {0.000 0.690 0.000 srgb} bind def
+/col14 {0.000 0.820 0.000 srgb} bind def
+/col15 {0.000 0.560 0.560 srgb} bind def
+/col16 {0.000 0.690 0.690 srgb} bind def
+/col17 {0.000 0.820 0.820 srgb} bind def
+/col18 {0.560 0.000 0.000 srgb} bind def
+/col19 {0.690 0.000 0.000 srgb} bind def
+/col20 {0.820 0.000 0.000 srgb} bind def
+/col21 {0.560 0.000 0.560 srgb} bind def
+/col22 {0.690 0.000 0.690 srgb} bind def
+/col23 {0.820 0.000 0.820 srgb} bind def
+/col24 {0.500 0.190 0.000 srgb} bind def
+/col25 {0.630 0.250 0.000 srgb} bind def
+/col26 {0.750 0.380 0.000 srgb} bind def
+/col27 {1.000 0.500 0.500 srgb} bind def
+/col28 {1.000 0.630 0.630 srgb} bind def
+/col29 {1.000 0.750 0.750 srgb} bind def
+/col30 {1.000 0.880 0.880 srgb} bind def
+/col31 {1.000 0.840 0.000 srgb} bind def
+
+end
+
+% This junk string is used by the show operators
+/PATsstr 1 string def
+/PATawidthshow { % cx cy cchar rx ry string
+ % Loop over each character in the string
+ { % cx cy cchar rx ry char
+ % Show the character
+ dup % cx cy cchar rx ry char char
+ PATsstr dup 0 4 -1 roll put % cx cy cchar rx ry char (char)
+ false charpath % cx cy cchar rx ry char
+ /clip load PATdraw
+ % Move past the character (charpath modified the
+ % current point)
+ currentpoint % cx cy cchar rx ry char x y
+ newpath
+ moveto % cx cy cchar rx ry char
+ % Reposition by cx,cy if the character in the string is cchar
+ 3 index eq { % cx cy cchar rx ry
+ 4 index 4 index rmoveto
+ } if
+ % Reposition all characters by rx ry
+ 2 copy rmoveto % cx cy cchar rx ry
+ } forall
+ pop pop pop pop pop % -
+ currentpoint
+ newpath
+ moveto
+} bind def
+/PATcg {
+ 7 dict dup begin
+ /lw currentlinewidth def
+ /lc currentlinecap def
+ /lj currentlinejoin def
+ /ml currentmiterlimit def
+ /ds [ currentdash ] def
+ /cc [ currentrgbcolor ] def
+ /cm matrix currentmatrix def
+ end
+} bind def
+% PATdraw - calculates the boundaries of the object and
+% fills it with the current pattern
+/PATdraw { % proc
+ save exch
+ PATpcalc % proc nw nh px py
+ 5 -1 roll exec % nw nh px py
+ newpath
+ PATfill % -
+ restore
+} bind def
+% PATfill - performs the tiling for the shape
+/PATfill { % nw nh px py PATfill -
+ PATDict /CurrentPattern get dup begin
+ setfont
+ % Set the coordinate system to Pattern Space
+ PatternGState PATsg
+ % Set the color for uncolored pattezns
+ PaintType 2 eq { PATDict /PColor get PATsc } if
+ % Create the string for showing
+ 3 index string % nw nh px py str
+ % Loop for each of the pattern sources
+ 0 1 Multi 1 sub { % nw nh px py str source
+ % Move to the starting location
+ 3 index 3 index % nw nh px py str source px py
+ moveto % nw nh px py str source
+ % For multiple sources, set the appropriate color
+ Multi 1 ne { dup PC exch get PATsc } if
+ % Set the appropriate string for the source
+ 0 1 7 index 1 sub { 2 index exch 2 index put } for pop
+ % Loop over the number of vertical cells
+ 3 index % nw nh px py str nh
+ { % nw nh px py str
+ currentpoint % nw nh px py str cx cy
+ 2 index oldshow % nw nh px py str cx cy
+ YStep add moveto % nw nh px py str
+ } repeat % nw nh px py str
+ } for
+ 5 { pop } repeat
+ end
+} bind def
+
+% PATkshow - kshow with the current pattezn
+/PATkshow { % proc string
+ exch bind % string proc
+ 1 index 0 get % string proc char
+ % Loop over all but the last character in the string
+ 0 1 4 index length 2 sub {
+ % string proc char idx
+ % Find the n+1th character in the string
+ 3 index exch 1 add get % string proc char char+1
+ exch 2 copy % strinq proc char+1 char char+1 char
+ % Now show the nth character
+ PATsstr dup 0 4 -1 roll put % string proc chr+1 chr chr+1 (chr)
+ false charpath % string proc char+1 char char+1
+ /clip load PATdraw
+ % Move past the character (charpath modified the current point)
+ currentpoint newpath moveto
+ % Execute the user proc (should consume char and char+1)
+ mark 3 1 roll % string proc char+1 mark char char+1
+ 4 index exec % string proc char+1 mark...
+ cleartomark % string proc char+1
+ } for
+ % Now display the last character
+ PATsstr dup 0 4 -1 roll put % string proc (char+1)
+ false charpath % string proc
+ /clip load PATdraw
+ neewath
+ pop pop % -
+} bind def
+% PATmp - the makepattern equivalent
+/PATmp { % patdict patmtx PATmp patinstance
+ exch dup length 7 add % We will add 6 new entries plus 1 FID
+ dict copy % Create a new dictionary
+ begin
+ % Matrix to install when painting the pattern
+ TilingType PATtcalc
+ /PatternGState PATcg def
+ PatternGState /cm 3 -1 roll put
+ % Check for multi pattern sources (Level 1 fast color patterns)
+ currentdict /Multi known not { /Multi 1 def } if
+ % Font dictionary definitions
+ /FontType 3 def
+ % Create a dummy encoding vector
+ /Encoding 256 array def
+ 3 string 0 1 255 {
+ Encoding exch dup 3 index cvs cvn put } for pop
+ /FontMatrix matrix def
+ /FontBBox BBox def
+ /BuildChar {
+ mark 3 1 roll % mark dict char
+ exch begin
+ Multi 1 ne {PaintData exch get}{pop} ifelse % mark [paintdata]
+ PaintType 2 eq Multi 1 ne or
+ { XStep 0 FontBBox aload pop setcachedevice }
+ { XStep 0 setcharwidth } ifelse
+ currentdict % mark [paintdata] dict
+ /PaintProc load % mark [paintdata] dict paintproc
+ end
+ gsave
+ false PATredef exec true PATredef
+ grestore
+ cleartomark % -
+ } bind def
+ currentdict
+ end % newdict
+ /foo exch % /foo newlict
+ definefont % newfont
+} bind def
+% PATpcalc - calculates the starting point and width/height
+% of the tile fill for the shape
+/PATpcalc { % - PATpcalc nw nh px py
+ PATDict /CurrentPattern get begin
+ gsave
+ % Set up the coordinate system to Pattern Space
+ % and lock down pattern
+ PatternGState /cm get setmatrix
+ BBox aload pop pop pop translate
+ % Determine the bounding box of the shape
+ pathbbox % llx lly urx ury
+ grestore
+ % Determine (nw, nh) the # of cells to paint width and height
+ PatHeight div ceiling % llx lly urx qh
+ 4 1 roll % qh llx lly urx
+ PatWidth div ceiling % qh llx lly qw
+ 4 1 roll % qw qh llx lly
+ PatHeight div floor % qw qh llx ph
+ 4 1 roll % ph qw qh llx
+ PatWidth div floor % ph qw qh pw
+ 4 1 roll % pw ph qw qh
+ 2 index sub cvi abs % pw ph qs qh-ph
+ exch 3 index sub cvi abs exch % pw ph nw=qw-pw nh=qh-ph
+ % Determine the starting point of the pattern fill
+ %(px, py)
+ 4 2 roll % nw nh pw ph
+ PatHeight mul % nw nh pw py
+ exch % nw nh py pw
+ PatWidth mul exch % nw nh px py
+ end
+} bind def
+
+% Save the original routines so that we can use them later on
+/oldfill /fill load def
+/oldeofill /eofill load def
+/oldstroke /stroke load def
+/oldshow /show load def
+/oldashow /ashow load def
+/oldwidthshow /widthshow load def
+/oldawidthshow /awidthshow load def
+/oldkshow /kshow load def
+
+% These defs are necessary so that subsequent procs don't bind in
+% the originals
+/fill { oldfill } bind def
+/eofill { oldeofill } bind def
+/stroke { oldstroke } bind def
+/show { oldshow } bind def
+/ashow { oldashow } bind def
+/widthshow { oldwidthshow } bind def
+/awidthshow { oldawidthshow } bind def
+/kshow { oldkshow } bind def
+/PATredef {
+ MyAppDict begin
+ {
+ /fill { /clip load PATdraw newpath } bind def
+ /eofill { /eoclip load PATdraw newpath } bind def
+ /stroke { PATstroke } bind def
+ /show { 0 0 null 0 0 6 -1 roll PATawidthshow } bind def
+ /ashow { 0 0 null 6 3 roll PATawidthshow }
+ bind def
+ /widthshow { 0 0 3 -1 roll PATawidthshow }
+ bind def
+ /awidthshow { PATawidthshow } bind def
+ /kshow { PATkshow } bind def
+ } {
+ /fill { oldfill } bind def
+ /eofill { oldeofill } bind def
+ /stroke { oldstroke } bind def
+ /show { oldshow } bind def
+ /ashow { oldashow } bind def
+ /widthshow { oldwidthshow } bind def
+ /awidthshow { oldawidthshow } bind def
+ /kshow { oldkshow } bind def
+ } ifelse
+ end
+} bind def
+false PATredef
+% Conditionally define setcmykcolor if not available
+/setcmykcolor where { pop } {
+ /setcmykcolor {
+ 1 sub 4 1 roll
+ 3 {
+ 3 index add neg dup 0 lt { pop 0 } if 3 1 roll
+ } repeat
+ setrgbcolor - pop
+ } bind def
+} ifelse
+/PATsc { % colorarray
+ aload length % c1 ... cn length
+ dup 1 eq { pop setgray } { 3 eq { setrgbcolor } { setcmykcolor
+ } ifelse } ifelse
+} bind def
+/PATsg { % dict
+ begin
+ lw setlinewidth
+ lc setlinecap
+ lj setlinejoin
+ ml setmiterlimit
+ ds aload pop setdash
+ cc aload pop setrgbcolor
+ cm setmatrix
+ end
+} bind def
+
+/PATDict 3 dict def
+/PATsp {
+ true PATredef
+ PATDict begin
+ /CurrentPattern exch def
+ % If it's an uncolored pattern, save the color
+ CurrentPattern /PaintType get 2 eq {
+ /PColor exch def
+ } if
+ /CColor [ currentrgbcolor ] def
+ end
+} bind def
+% PATstroke - stroke with the current pattern
+/PATstroke {
+ countdictstack
+ save
+ mark
+ {
+ currentpoint strokepath moveto
+ PATpcalc % proc nw nh px py
+ clip newpath PATfill
+ } stopped {
+ (*** PATstroke Warning: Path is too complex, stroking
+ with gray) =
+ cleartomark
+ restore
+ countdictstack exch sub dup 0 gt
+ { { end } repeat } { pop } ifelse
+ gsave 0.5 setgray oldstroke grestore
+ } { pop restore pop } ifelse
+ newpath
+} bind def
+/PATtcalc { % modmtx tilingtype PATtcalc tilematrix
+ % Note: tiling types 2 and 3 are not supported
+ gsave
+ exch concat % tilingtype
+ matrix currentmatrix exch % cmtx tilingtype
+ % Tiling type 1 and 3: constant spacing
+ 2 ne {
+ % Distort the pattern so that it occupies
+ % an integral number of device pixels
+ dup 4 get exch dup 5 get exch % tx ty cmtx
+ XStep 0 dtransform
+ round exch round exch % tx ty cmtx dx.x dx.y
+ XStep div exch XStep div exch % tx ty cmtx a b
+ 0 YStep dtransform
+ round exch round exch % tx ty cmtx a b dy.x dy.y
+ YStep div exch YStep div exch % tx ty cmtx a b c d
+ 7 -3 roll astore % { a b c d tx ty }
+ } if
+ grestore
+} bind def
+/PATusp {
+ false PATredef
+ PATDict begin
+ CColor PATsc
+ end
+} bind def
+
+% right30
+11 dict begin
+/PaintType 1 def
+/PatternType 1 def
+/TilingType 1 def
+/BBox [0 0 1 1] def
+/XStep 1 def
+/YStep 1 def
+/PatWidth 1 def
+/PatHeight 1 def
+/Multi 2 def
+/PaintData [
+ { clippath } bind
+ { 32 16 true [ 32 0 0 -16 0 16 ]
+ {<00030003000c000c0030003000c000c0030003000c000c00
+ 30003000c000c00000030003000c000c0030003000c000c0
+ 030003000c000c0030003000c000c000>}
+ imagemask } bind
+] def
+/PaintProc {
+ pop
+ exec fill
+} def
+currentdict
+end
+/P2 exch def
+
+% crosshatch45
+11 dict begin
+/PaintType 1 def
+/PatternType 1 def
+/TilingType 1 def
+/BBox [0 0 1 1] def
+/XStep 1 def
+/YStep 1 def
+/PatWidth 1 def
+/PatHeight 1 def
+/Multi 2 def
+/PaintData [
+ { clippath } bind
+ { 20 20 true [ 20 0 0 -20 0 20 ]
+ {<8020004050102088201104400a02800401000a02
+ 8011044020882040501080200040501020882011
+ 04400a02800401000a0280110440208820405010>}
+ imagemask } bind
+] def
+/PaintProc {
+ pop
+ exec fill
+} def
+currentdict
+end
+/P6 exch def
+
+/cp {closepath} bind def
+/ef {eofill} bind def
+/gr {grestore} bind def
+/gs {gsave} bind def
+/sa {save} bind def
+/rs {restore} bind def
+/l {lineto} bind def
+/m {moveto} bind def
+/rm {rmoveto} bind def
+/n {newpath} bind def
+/s {stroke} bind def
+/sh {show} bind def
+/slc {setlinecap} bind def
+/slj {setlinejoin} bind def
+/slw {setlinewidth} bind def
+/srgb {setrgbcolor} bind def
+/rot {rotate} bind def
+/sc {scale} bind def
+/sd {setdash} bind def
+/ff {findfont} bind def
+/sf {setfont} bind def
+/scf {scalefont} bind def
+/sw {stringwidth} bind def
+/tr {translate} bind def
+/tnt {dup dup currentrgbcolor
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
+ bind def
+/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
+ 4 -2 roll mul srgb} bind def
+/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
+/$F2psEnd {$F2psEnteredState restore end} def
+
+/pageheader {
+save
+newpath 0 175 moveto 0 0 lineto 356 0 lineto 356 175 lineto closepath clip newpath
+-194.8 350.2 translate
+1 -1 scale
+$F2psBegin
+10 setmiterlimit
+0 slj 0 slc
+ 0.06299 0.06299 sc
+} bind def
+/pagefooter {
+$F2psEnd
+restore
+} bind def
+%%EndProlog
+pageheader
+%
+% Fig objects follow
+%
+%
+% here starts figure with depth 50
+% Arc
+7.500 slw
+0 slc
+gs clippath
+8019 4079 m 8138 4172 l 8175 4125 l 8056 4032 l 8056 4032 l 8132 4130 l 8019 4079 l cp
+eoclip
+n 6120.0 6627.7 3207.7 -129.1463 -50.8537 arc
+gs col0 s gr
+ gr
+
+% arrowhead
+0 slj
+n 8019 4079 m 8132 4130 l 8056 4032 l 8019 4079 l cp gs 0.00 setgray ef gr col0 s
+% Polyline
+n 3105 4140 m 6660 4140 l 6660 5085 l 3105 5085 l
+ cp gs col0 s gr
+% Polyline
+n 6660 4140 m 8730 4140 l 8730 5085 l 6660 5085 l
+ cp gs col7 0.50 shd ef gr gs col0 s gr
+% Polyline
+n 3510 4140 m 3780 4140 l 3780 5085 l 3510 5085 l
+ cp gs /PC [[1.00 1.00 1.00] [0.00 0.00 0.00]] def
+15.00 15.00 sc P2 [16 0 0 -8 234.00 276.00] PATmp PATsp ef gr PATusp gs col0 s gr
+% Polyline
+n 4365 4140 m 4635 4140 l 4635 5085 l 4365 5085 l
+ cp gs /PC [[1.00 1.00 1.00] [0.00 0.00 0.00]] def
+15.00 15.00 sc P2 [16 0 0 -8 291.00 276.00] PATmp PATsp ef gr PATusp gs col0 s gr
+% Polyline
+n 4905 4140 m 5265 4140 l 5265 5085 l 4905 5085 l
+ cp gs /PC [[1.00 1.00 1.00] [0.00 0.00 0.00]] def
+15.00 15.00 sc P2 [16 0 0 -8 327.00 276.00] PATmp PATsp ef gr PATusp gs col0 s gr
+% Polyline
+n 7965 4140 m 8370 4140 l 8370 5085 l 7965 5085 l
+ cp gs /PC [[1.00 1.00 1.00] [0.00 0.00 0.00]] def
+15.00 15.00 sc P6 [16 0 0 -16 531.00 276.00] PATmp PATsp ef gr PATusp gs col0 s gr
+/Times-Roman ff 180.00 scf sf
+3510 5490 m
+gs 1 -1 sc (gawk Main Program Address Space) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+7290 5490 m
+gs 1 -1 sc (Extension) col0 sh gr
+/Courier-Bold ff 180.00 scf sf
+3240 3150 m
+gs 1 -1 sc ( chdir\("/path"\)) col0 sh gr
+/Courier-Bold ff 180.00 scf sf
+3330 3375 m
+gs 1 -1 sc (}) col0 sh gr
+/Courier-Bold ff 180.00 scf sf
+3375 2925 m
+gs 1 -1 sc (BEGIN {) col0 sh gr
+/Courier-Bold ff 180.00 scf sf
+6660 3150 m
+gs 1 -1 sc (\(*fnptr\)\(1\);) col0 sh gr
+% here ends figure;
+pagefooter
+showpage
+%%Trailer
+end
+%EOF
diff --git a/doc/api-figure3.fig b/doc/api-figure3.fig
new file mode 100644
index 00000000..5c7fdd97
--- /dev/null
+++ b/doc/api-figure3.fig
@@ -0,0 +1,29 @@
+#FIG 3.2 Produced by xfig version 3.2.5b
+Landscape
+Center
+Metric
+A4
+100.00
+Single
+-2
+1200 2
+5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 6120.000 6627.656 4095 4140 6120 3420 8145 4140
+ 1 1 1.00 60.00 120.00
+2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
+ 3105 4140 6660 4140 6660 5085 3105 5085 3105 4140
+2 2 0 1 0 7 50 -1 10 0.000 0 0 -1 0 0 5
+ 6660 4140 8730 4140 8730 5085 6660 5085 6660 4140
+2 2 0 1 0 7 50 -1 42 0.000 0 0 -1 0 0 5
+ 3510 4140 3780 4140 3780 5085 3510 5085 3510 4140
+2 2 0 1 0 7 50 -1 42 0.000 0 0 -1 0 0 5
+ 4365 4140 4635 4140 4635 5085 4365 5085 4365 4140
+2 2 0 1 0 7 50 -1 42 0.000 0 0 -1 0 0 5
+ 4905 4140 5265 4140 5265 5085 4905 5085 4905 4140
+2 2 0 1 0 7 50 -1 46 0.000 0 0 -1 0 0 5
+ 7965 4140 8370 4140 8370 5085 7965 5085 7965 4140
+4 0 0 50 -1 0 12 0.0000 4 180 2850 3510 5490 gawk Main Program Address Space\001
+4 0 0 50 -1 0 12 0.0000 4 135 825 7290 5490 Extension\001
+4 0 0 50 -1 14 12 0.0000 4 180 2160 3240 3150 chdir("/path")\001
+4 0 0 50 -1 14 12 0.0000 4 150 120 3330 3375 }\001
+4 0 0 50 -1 14 12 0.0000 4 150 840 3375 2925 BEGIN {\001
+4 0 0 50 -1 14 12 0.0000 4 165 1440 6660 3150 (*fnptr)(1);\001
diff --git a/doc/api-figure3.pdf b/doc/api-figure3.pdf
new file mode 100644
index 00000000..517b2ecc
--- /dev/null
+++ b/doc/api-figure3.pdf
Binary files differ
diff --git a/doc/api-figure3.png b/doc/api-figure3.png
new file mode 100644
index 00000000..f7db0794
--- /dev/null
+++ b/doc/api-figure3.png
Binary files differ
diff --git a/doc/api-figure3.txt b/doc/api-figure3.txt
new file mode 100644
index 00000000..c4d222f0
--- /dev/null
+++ b/doc/api-figure3.txt
@@ -0,0 +1,13 @@
+ BEGIN {
+ chdir("/path") (*fnptr)(1);
+ }
+ +--------------------------------------------+
+ | |
+ | V
++-------+-+---+-+---+-+------------------+--------------+-+---+
+| |x| |x| |x| |OOOOOOOOOOOOOO|X|OOO|
+| |x| |x| |x| |OOOOOOOOOOOOOO|X|OOO|
+| |x| |x| |x| |OOOOOOOOOOOOOO|X|OOO|
++-------+-+---+-+---+-+------------------+--------------+-+---+
+
+ gawk Main Program Address Space Extension
diff --git a/doc/awkcard.in b/doc/awkcard.in
index 65f36b4e..9fae7cce 100644
--- a/doc/awkcard.in
+++ b/doc/awkcard.in
@@ -26,7 +26,6 @@
.\" Strings to save typing
.ds AK \*(FCawk\*(FR
.ds GK \*(FCgawk\*(FR
-.ds PK \*(FCpgawk\*(FR
.ds NK Bell Labs \*(FCawk\*(FR
.ds MK \*(FCmawk\*(FR
.\"
@@ -77,7 +76,7 @@ Pattern Elements 8
Printf Formats 14
Records 10
Regular Expressions 11
-Signals (\*(PK) 4
+Signals (\*(GK \*(FC\-\^\-profile\*(FR) 4
Special Filenames 12
String Functions 16
Time Functions (\*(GK) 17
@@ -254,6 +253,9 @@ their types and final values to
If no \*(FIfile\*(FR
is provided, \*(FCgawk\*(FR
uses \*(FCawkvars.out\*(FR.
+.TI "\*(FC\-D\*(FR[\*(FC\*(FIfile\*(FR], \*(FC\-\^\-debug\*(FR[\*(FC=\*(FIfile\*(FR]
+Enable debugging of program. Optionally read stored commands
+from \*(FIfile\*(FR.
.TI "\*(FC-e '\*(FItext\*(FC'\*(FR, \*(FC\-\^\-source '\*(FItext\*(FC'\*(FR
Use \*(FItext\*(FR as AWK program source code.
.TI "\*(FC\-E \*(FIfile\*(FR, \*(FC\-\^\-exec \*(FIfile\*(FR
@@ -269,6 +271,10 @@ for localization.
.TI "\*(FC\-h\*(FR, \*(FC\-\^\-help\*(FR
Print a short summary of the available
options on \*(FCstdout\*(FR, then exit zero.
+.TI "\*(FC\-i \*(FIfile\*(FR, \*(FC\-\^\-include \*(FIfile\*(FR
+Include library AWK code in \*(FIfile\*(FR.
+.TI "\*(FC\-l \*(FIlib\*(FR, \*(FC\-\^\-load \*(FIlib\*(FR
+Load dynamic extension \*(FIlib\fP.
.TI "\*(FC\-L \*(FR[\*(FC\*(FIvalue\*(FR], \*(FC\-\^\-lint\*(FR[\*(FC=\*(FIvalue\*(FR]
Warn about dubious or non-portable constructs.
If \*(FIvalue\*(FR is
@@ -278,36 +284,25 @@ If \*(FIvalue\*(FR is
\*(FCinvalid\*(FR,
only issue warnings about things that are
actually invalid (not fully implemented yet).
+.TI "\*(FC\-M\*(FR, \*(FC\-\^\-bignum\*(FR
+Enable arbitrary-precision arithmetic.
.TI "\*(FC\-n\*(FR, \*(FC\-\^\-non\-decimal\-data\*(FR
Recognize octal and hexadecimal values in input data.
\*(FIUse this option with great caution!\*(FR
.TI "\*(FC\-N\*(FR, \*(FC\-\^\-use\-lc\-numeric\*(FR
Force use of the locale's decimal point character when parsing input data.
+.TI "\*(FC\-o\*(FR[\*(FC\*(FIfile\*(FR], \*(FC\-\^\-pretty-print\*(FR[\*(FC=\*(FIfile\*(FR]
+Output a pretty printed version of the program to \*(FIfile\*(FR
+(default: \*(FCawkprof.out\*(FR).
.TI "\*(FC\-O\*(FR, \*(FC\-\^\-optimize\*(FR
Enable some internal optimizations.
.TI "\*(FC\-p\*(FR[\*(FC\*(FIfile\*(FR], \*(FC\-\^\-profile\*(FR[\*(FC=\*(FIfile\*(FR]
Send profiling data to \*(FIfile\*(FR
(default: \*(FCawkprof.out\*(FR).
-With \*(GK,
-the profile is just a ``pretty printed'' version of the program.
-With \*(PK,
-the profile contains execution counts in the left margin
+The profile contains execution counts in the left margin
of each statement in the program.
.TI "\*(FC\-P\*(FR, \*(FC\-\^\-posix\*(FR
-Disable common and GNU extensions.
-.TI "\*(FC\-R \*(FIfile\*(FR, \*(FC\-\^\-command \*(FIfile\*(FR"
-\*(FCdgawk\*(FR only.
-Read stored debugger commands from \*(FIfile\*(FR.
-.TI "\*(FC\-r\*(FR, \*(FC\-\^\-re\-interval\*(FR
-Enable \*(FIinterval expressions\*(FR in regular
-expression matching (see \fHRegular
-Expressions\fP below). Useful if
-\*(FC\-\^\-traditional\*(FR is specified.
-.TI "\*(FC\-S\*(FR, \*(FC\-\^\-sandbox\*(FR
-Disable the \*(FCsystem()\*(FR function,
-input redirection with \*(FCgetline\*(FR,
-output redirection with \*(FCprint\*(FR and \*(FCprintf\*(FR,
-and dynamic extensions loading.\*(CB
+Disable common and GNU extensions.\*(CB
.in -4n
.EB "\s+2\f(HBCOMMAND LINE ARGUMENTS (\*(GK\f(HB)\*(FR\s0"
@@ -319,6 +314,17 @@ and dynamic extensions loading.\*(CB
.ES
.fi
.in +4n
+.TI "\*(FC\-r\*(FR, \*(FC\-\^\-re\-interval\*(FR
+Enable \*(FIinterval expressions\*(FR.
+... in regular
+... expression matching (see \fHRegular
+... Expressions\fP below). Useful if
+... \*(FC\-\^\-traditional\*(FR is specified
+.TI "\*(FC\-S\*(FR, \*(FC\-\^\-sandbox\*(FR
+Disable the \*(FCsystem()\*(FR function,
+input redirection with \*(FCgetline\*(FR,
+output redirection with \*(FCprint\*(FR and \*(FCprintf\*(FR,
+and dynamic extensions loading.
.TI "\*(FC-t\*(FR, \*(FC\-\^\-lint\-old\*(FR
Warn about constructs that are not
portable to the original version of
@@ -338,7 +344,7 @@ options are passed on to the AWK program in
\*(FCARGV\*(FR
for processing.\*(CB
.EB "\s+2\f(HBCOMMAND LINE ARGUMENTS (\*(GK\f(HB)\*(FR\s0"
-
+.sp .4
.\"
.\"
.\" --- Command Line Arguments (mawk)
@@ -383,14 +389,14 @@ The options may be abbreviated using just the first letter, e.g.,
and so on.\*(CB
.EB "\s+2\f(HBCOMMAND LINE ARGUMENTS (\*(MK\f(HB)\*(FR\s0"
.sp .7
-.\" --- Signals (pgawk)
+.\" --- Signals (gawk --profile)
.ES
.fi
-\*(CD\*(PK accepts two signals.
+\*(CD\*(GK accepts two signals while profiling.
\*(FCSIGUSR1\fP dumps a profile and function call stack to the
profile file. It then continues to run.
\*(FCSIGHUP\fP is similar, but exits.\*(CB
-.EB "\s+2\f(HBSIGNALS (\*(PK\f(HB)\*(FR\s0"
+.EB "\s+2\f(HBSIGNALS (\*(GK \f(HB\-\^\-profile)\*(FR\s0"
.\" --- Lines And Statements
.ES
@@ -450,7 +456,7 @@ The program text is read as if all the \*(FIprog-file\*(FR(s)
\*(CBand command line
source texts\*(CD had been concatenated.
.sp
-\*(GK includes files named on \*(FC@include\*(FR lines.
+\*(CB\*(GK includes files named on \*(FC@include\*(FR lines.
Nested includes are allowed.\*(CD
.sp .5
AWK programs execute in the following order.
@@ -545,7 +551,8 @@ variables, each element being the value of
that variable.
T}
\*(CB\*(FCERRNO\fP T{
-String describing the error if a
+... String describing the error if a
+String error value if a
\*(FCgetline\*(FR
redirection or read
fails, or if
@@ -574,6 +581,10 @@ T}
Input field separator, a space by default
(see \fHFields\fP above).
T}
+\*(CB\*(FCFUNCTAB\fP T{
+An array indexed by the names of all user-defined
+and extension functions.\*(CD
+T}
\*(CB\*(FCIGNORECASE\fP T{
If non-zero, all regular expression and string
operations ignore case.
@@ -588,13 +599,13 @@ T}
\*(CB\*(FCLINT\fP T{
Provides dynamic control of the \*(FC\-\^\-lint\fP
option from within an AWK program.
-When true, \*(GK
-prints lint warnings.
-When assigned the string value \*(FC"fatal"\*(FR,
-lint warnings become fatal errors.
-Any other true value just prints warnings.\*(CD
+... When true, \*(GK
+... prints lint warnings.
+... When assigned the string value \*(FC"fatal"\*(FR,
+... lint warnings become fatal errors.
+... Any other true value just prints warnings.
T}
-\*(FCNF\fP T{
+\*(CD\*(FCNF\fP T{
Number of fields in the current input record.
T}
\*(FCNR\fP T{
@@ -609,7 +620,11 @@ T}
\*(FCORS\fP T{
Output record separator, a newline by default.
T}
-\*(CB\*(FCPROCINFO\fP T{
+\*(CB\*(FCPREC\fP T{
+The working precision of arbitrary precision floating-point
+numbers, 53 by default.
+T}
+\*(FCPROCINFO\fP T{
Elements of this array provide access to information
about the running AWK program. See
\*(AM for details.\*(CD
@@ -618,6 +633,10 @@ T}
Length of the string matched by \*(FCmatch()\*(FR;
\-1 if no match.
T}
+\*(CB\*(FCROUNDMODE\fP T{
+The rounding mode to use for arbitrary precision arithmetic,
+by default \*(FC"N"\fP.\*(CD
+T}
\*(FCRS\fP T{
Input record separator, a newline by default
(see \fHRecords\fP above).
@@ -636,6 +655,11 @@ Character(s) used to separate multiple subscripts
in array elements, by default \*(FC"\e034"\*(FR. (See
\fHArrays\fP below).
T}
+\*(CB\*(FCSYMTAB\fP T{
+An array indexed by the names of all global
+variables and arrays. May be used to indirectly
+set variable and array values.\*(CD
+T}
\*(CB\*(FCTEXTDOMAIN\fP T{
The internationalization text domain,
for finding the localized
@@ -1129,7 +1153,10 @@ The default path is
If a file name given to the \*(FC\-f\fP option contains a ``/'' character,
no path search is performed.
.sp .5
-.PP
+The variable \*(FCAWKLIBPATH\fP
+specifies the search path for dynamic extensions to use
+with \*(FC@load\fP and the \*(FC\-l\fP option.
+.sp .5
For socket communication,
\*(FCGAWK_SOCK_RETRIES\fP
controls the number of retries, and
@@ -1139,6 +1166,10 @@ The interval is in milliseconds. On systems that do not support
\*(FIusleep\fP(3),
the value is rounded up to an integral number of seconds.
.sp .5
+The value of \*(FCGAWK_READ_TIMEOUT\fP specifies the time, in milliseconds,
+for \*(GK to
+wait for input before returning with an error.
+.sp .5
If \*(FCPOSIXLY_CORRECT\fP exists
.\" in the environment,
then \*(GK
@@ -1799,10 +1830,9 @@ provides the following functions for doing bitwise operations.
.fi
.in +.2i
.ti -.2i
-\*(FCand(\*(FIv1\*(FC, \*(FIv2\*(FC)\*(FR
+\*(FCand(\*(FIv1\*(FC, \*(FIv2\*(FR [\*(FC,\*(FR ... ]\*(FC)\*(FR
.br
-Return the bitwise AND of the values provided by
-\*(FIv1\*(FR and \*(FIv2\*(FR.
+Return the bitwise AND of the arguments.
.ti -.2i
\*(FCcompl(\*(FIval\*(FC)\*(FR
.br
@@ -1814,20 +1844,18 @@ Return the bitwise complement of
Return the value of \*(FIval\*(FR,
shifted left by \*(FIcount\*(FR bits.
.ti -.2i
-\*(FCor(\*(FIv1\*(FC, \*(FIv2\*(FC)\*(FR
+\*(FCor(\*(FIv1\*(FC, \*(FIv2\*(FR [\*(FC,\*(FR ... ]\*(FC)\*(FR
.br
-Return the bitwise OR of the values provided by
-\*(FIv1\*(FR and \*(FIv2\*(FR.
+Return the bitwise OR of the arguments.
.ti -.2i
\*(FCrshift(\*(FIval\*(FC, \*(FIcount\*(FC)\*(FR
.br
Return the value of \*(FIval\*(FR,
shifted right by \*(FIcount\*(FR bits.
.ti -.2i
-\*(FCxor(\*(FIv1\*(FC, \*(FIv2\*(FC)\*(FR
+\*(FCxor(\*(FIv1\*(FC, \*(FIv2\*(FR [\*(FC,\*(FR ... ]\*(FC)\*(FR
.br
-Return the bitwise XOR of the values provided by
-\*(FIv1\*(FR and \*(FIv2\*(FR.\*(CB
+Return the bitwise XOR of the arguments.\*(CB
.in -.2i
.EB "\s+2\f(HBBIT MANIPULATION FUNCTIONS (\*(GK\f(HB)\*(FR\s0"
.sp .6
@@ -1836,16 +1864,15 @@ Return the bitwise XOR of the values provided by
.fi
.in +.2i
.ti -.2i
-\*(CD\*(FCextension(\*(FIlib\*(FC, \*(FIfunc\*(FC)\*(FR
+\*(CD\*(FC@load "\*(FIextension\*(FC"\*(FR
.br
-Dynamically load the shared library
-\*(FIlib\*(FR
-and call
-\*(FIfunc\*(FR
-in it to initialize the library.
+Dynamically load the named \*(FIextension\*(FR.
This adds new built-in functions to \*(GK.
-It returns the value returned by
-\*(FIfunc\*(FR.\*(CB
+.\" The extension should use the API defined by the
+.\" \*(FCgawkapi.h\*(FR header file, as documented in
+.\" the full manual.
+The extension is loaded during the parsing of the program.
+See the manual for details.\*(CB
.in -.2i
.EB "\s+2\f(HBDYNAMIC EXTENSIONS (\*(GK\f(HB)\*(FR\s0"
.BT
@@ -1946,7 +1973,7 @@ maintains it.\*(CX
.ES
.fi
\*(CDCopyright \(co 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+2007, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
.sp .5
Permission is granted to make and distribute verbatim copies of this
reference card provided the copyright notice and this permission notice
diff --git a/doc/gawk.1 b/doc/gawk.1
index e26f9a2e..31fcef1f 100644
--- a/doc/gawk.1
+++ b/doc/gawk.1
@@ -14,7 +14,7 @@
. if \w'\(rq' .ds rq "\(rq
. \}
.\}
-.TH GAWK 1 "Nov 10 2011" "Free Software Foundation" "Utility Commands"
+.TH GAWK 1 "Oct 02 2012" "Free Software Foundation" "Utility Commands"
.SH NAME
gawk \- pattern scanning and processing language
.SH SYNOPSIS
@@ -33,30 +33,6 @@ gawk \- pattern scanning and processing language
]
.I program-text
file .\|.\|.
-.sp
-.B pgawk
-[ \*(PX or \*(GN style options ]
-.B \-f
-.I program-file
-[
-.B \-\^\-
-] file .\|.\|.
-.br
-.B pgawk
-[ \*(PX or \*(GN style options ]
-[
-.B \-\^\-
-]
-.I program-text
-file .\|.\|.
-.sp
-.B dgawk
-[ \*(PX or \*(GN style options ]
-.B \-f
-.I program-file
-[
-.B \-\^\-
-] file .\|.\|.
.SH DESCRIPTION
.I Gawk
is the \*(GN Project's implementation of the \*(AK programming language.
@@ -84,27 +60,31 @@ and
.B ARGV
pre-defined \*(AK variables.
.PP
-.I Pgawk
-is the profiling version of
-.IR gawk .
-It is identical in every way to
-.IR gawk ,
-except that programs run more slowly,
-and it automatically produces an execution profile in the file
+When
+.I gawk
+is invoked with the
+.B \-\^\-profile
+option, it starts gathering profiling statistics
+from the execution of the program.
+.I Gawk
+runs more slowly in this mode, and automatically produces an execution
+profile in the file
.B awkprof.out
when done.
See the
.B \-\^\-profile
option, below.
.PP
-.I Dgawk
-is an
-.I awk
-debugger. Instead of running the program directly, it loads the
+.I Gawk
+also has an integrated debugger. An interactive debugging session can
+be started by supplying the
+.B \-\^\-debug
+option to the command line. In this mode of execution,
+.I gawk
+loads the
AWK source code and then prompts for debugging commands.
-Unlike
-.IR gawk " and " pgawk ", " dgawk
-only processes AWK program source provided with the
+.I Gawk
+can only debug AWK program source provided with the
.B \-f
option.
The debugger is documented in \*(EP.
@@ -117,8 +97,8 @@ while long options start with \*(lq\-\^\-\*(rq.
Long options are provided for both \*(GN-specific features and
for \*(PX-mandated features.
.PP
-.IR Gawk -
-specific options are typically used in long-option form.
+.IR Gawk -specific
+options are typically used in long-option form.
Arguments to long options are either joined with the option
by an
.B =
@@ -273,6 +253,18 @@ names like
and so on.)
.TP
.PD 0
+\fB\-D\fR[\fIfile\fR]
+.TP
+.PD
+\fB\-\^\-debug\fR[\fB=\fIfile\fR]
+Enable debugging of \*(AK programs.
+By default, the debugger reads commands interactively from the terminal.
+The optional
+.IR file
+argument can be used to specify a file with a list
+of commands for the debugger to execute non-interactively.
+.TP
+.PD 0
.BI "\-e " program-text
.TP
.PD
@@ -331,6 +323,33 @@ the standard output.
these options cause an immediate, successful exit.)
.TP
.PD 0
+.BI "\-i " include-file
+.TP
+.PD
+.BI \-\^\-include " include-file"
+Load an awk source library.
+This searches for the library using the
+.B AWKPATH
+environment variable. If the initial search fails, another attempt will
+be made after appending the ".awk" suffix. The file will be loaded only
+once (i.e. duplicates are eliminated), and the code does not constitute
+the main program source.
+.TP
+.PD 0
+.BI "\-l " lib
+.TP
+.PD
+.BI \-\^\-load " lib"
+Load a shared library
+.IR lib .
+This searches for the library using the
+.B AWKLIBPATH
+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 dl_load() .
+.TP
+.PD 0
.BR "\-L " [ \fIvalue\fR ]
.TP
.PD
@@ -348,6 +367,16 @@ only warnings about things that are
actually invalid are issued. (This is not fully implemented yet.)
.TP
.PD 0
+.B \-M
+.TP
+.PD
+.B \-\^\-bignum
+Force arbitrary precision arithmetic on numbers. This option has
+no effect if
+.I gawk
+is not compiled to use the GNU MPFR and MP libraries.
+.TP
+.PD 0
.B \-n
.TP
.PD
@@ -387,12 +416,28 @@ users.
..
.TP
.PD 0
+\fB\-o\fR[\fIfile\fR]
+.TP
+.PD
+\fB\-\^\-pretty-print\fR[\fB=\fIfile\fR]
+Output a pretty printed version of the program to
+.IR file .
+If no
+.I file
+is provided,
+.I gawk
+uses a file named
+.B awkprof.out
+in the current directory.
+.TP
+.PD 0
.B \-O
.TP
.PD
.B \-\^\-optimize
Enable optimizations upon the internal representation of the program.
-Currently, this includes just simple constant-folding. The
+Currently, this includes simple constant-folding, and tail call
+elimination for recursive functions. The
.I gawk
maintainer hopes to add additional optimizations over time.
.TP
@@ -401,16 +446,11 @@ maintainer hopes to add additional optimizations over time.
.TP
.PD
\fB\-\^\-profile\fR[\fB=\fIprof_file\fR]
-Send profiling data to
+Start a profiling session, and send the profiling data to
.IR prof_file .
The default is
.BR awkprof.out .
-When run with
-.IR gawk ,
-the profile is just a \*(lqpretty printed\*(rq version of the program.
-When run with
-.IR pgawk ,
-the profile contains execution counts of each statement in the program
+The profile contains execution counts of each statement in the program
in the left margin and function call counts for each user-defined function.
.TP
.PD 0
@@ -482,15 +522,6 @@ They are enabled by default, but this option remains for use with
.BR \-\^-traditional .
.TP
.PD 0
-.B \-R
-.TP
-.PD
-.BI \-\^\-command " file"
-.I Dgawk
-only. Read stored debugger commands from
-.IR file .
-.TP
-.PD 0
.BI \-S
.TP
.PD
@@ -555,6 +586,9 @@ and optional function definitions.
.RS
.PP
\fB@include "\fIfilename\fB"
+.br
+\fB@load "\fIfilename\fB"
+.br
\fIpattern\fB { \fIaction statements\fB }\fR
.br
\fBfunction \fIname\fB(\fIparameter list\fB) { \fIstatements\fB }\fR
@@ -586,12 +620,21 @@ In addition, lines beginning with
may be used to include other source files into your program,
making library use even easier.
.PP
+Lines beginning with
+.B @load
+may be used to load shared libraries into your program. This is equivalent
+to using the
+.B \-l
+option.
+.PP
The environment variable
.B AWKPATH
specifies a search path to use when finding source files named with
the
.B \-f
-option. If this variable does not exist, the default path is
+and
+.B \-i
+options. If this variable does not exist, the default path is
\fB".:/usr/local/share/awk"\fR.
(The actual directory may vary, depending upon how
.I gawk
@@ -946,6 +989,17 @@ The input field separator, a space by default. See
.BR Fields ,
above.
.TP
+.B FUNCTAB
+An array whose indices are the names of all the user-defined
+or extension functions in the program.
+.BR NOTE :
+The array values cannot currently be used.
+Also, you may not use the
+.B delete
+statment with the
+.B FUNCTAB
+array.
+.TP
.B IGNORECASE
Controls the case-sensitivity of all regular expression
and string operations. If
@@ -1022,6 +1076,10 @@ The output field separator, a space by default.
.B ORS
The output record separator, by default a newline.
.TP
+.B PREC
+The working precision of arbitrary precision floating-point
+numbers, 53 by default.
+.TP
.B PROCINFO
The elements of this array provide access to information about the
running \*(AK program.
@@ -1061,6 +1119,35 @@ or \fB"FIELDWIDTHS"\fP if field splitting with
.B FIELDWIDTHS
is in effect.
.TP
+\fBPROCINFO["identifiers"]\fP
+A subarray, indexed by the names of all identifiers used in the
+text of the AWK program. For each identifier, the value of the element is one of the following:
+.RS
+.TP
+\fB"array"\fR
+The identifier is an array.
+.TP
+\fB"extension"\fR
+The identifier is an extension function loaded via
+.BR @load .
+.TP
+\fB"scalar"\fR
+The identifier is a scalar.
+.TP
+\fB"untyped"\fR
+The identifier is untyped (could be used as a scalar or array,
+.I gawk
+doesn't know yet).
+.TP
+\fB"user"\fR
+The identifier is a user-defined function.
+.RE
+The values indicate what
+.I gawk
+knows about the identifiers after it has finished parsing the program; they are
+.I not
+updated while the program runs.
+.TP
\fBPROCINFO["gid"]\fP
the value of the
.IR getgid (2)
@@ -1120,11 +1207,48 @@ corresponding values of the two elements being compared.
It should return a number less than, equal to, or greater than 0,
depending on how the elements of the array are to be ordered.
.TP
+\fBPROCINFO["input", "READ_TIMEOUT"]\fP
+specifies the timeout in milliseconds for reading data from
+.IR input ,
+where
+.I input
+is a redirection string or a filename. A value of zero or
+less than zero means no timeout.
+.TP
+\fBPROCINFO["mpfr_version"]\fP
+the version of the GNU MPFR library used for arbitrary precision
+number support in
+.IR gawk .
+.TP
+\fBPROCINFO["gmp_version"]\fP
+the version of the GNU MP library used for arbitrary precision
+number support in
+.IR gawk .
+.TP
+\fBPROCINFO["prec_max"]\fP
+the maximum precision supported by the GNU MPFR library for
+arbitrary precision floating-point numbers.
+.TP
+\fBPROCINFO["prec_min"]\fP
+the minimum precision allowed by the GNU MPFR library for
+arbitrary precision floating-point numbers.
+.TP
\fBPROCINFO["version"]\fP
the version of
.IR gawk .
.RE
.TP
+.B ROUNDMODE
+The rounding mode to use for arbitrary precision arithmetic on
+numbers, by default \fB"N"\fR (IEEE-754 roundTiesToEven mode).
+The accepted values are
+\fB"N"\fR or \fB"n"\fR for roundTiesToEven,
+\fB"U"\fR or \fB"u"\fR for roundTowardPositive,
+\fB"D"\fR or \fB"d"\fR for roundTowardNegative,
+\fB"Z"\fR or \fB"z"\fR for roundTowardZero,
+and if your version of GNU MPFR library supports it,
+\fB"A"\fR or \fB"a"\fR for roundTiesToAway.
+.TP
.B RS
The input record separator, by default a newline.
.TP
@@ -1152,6 +1276,30 @@ The length of the string matched by
The character used to separate multiple subscripts in array
elements, by default \fB"\e034"\fR.
.TP
+.B SYMTAB
+An array whose indices are the names of all currently defined
+global variables and arrays in the program. The array may be used
+for indirect access to read or write the value of a variable:
+.PP
+.RS
+.ft B
+foo = 5
+SYMTAB["foo"] = 4
+print foo # prints 4
+.ft R
+.RE
+.PP
+The
+.B isarray()
+function may be used to test if an element in
+.B SYMTAB
+is an array.
+You may not use the
+.B delete
+statment with the
+.B SYMTAB
+array.
+.TP
.B TEXTDOMAIN
The text domain of the \*(AK program; used to find the localized
translations for the program's strings.
@@ -2893,11 +3041,9 @@ integers, doing the operation, and then converting the
result back to floating point.
The functions are:
.TP "\w'\fBrshift(\fIval\fB, \fIcount\fB)\fR'u+2n"
-\fBand(\fIv1\fB, \fIv2\fB)\fR
-Return the bitwise AND of the values provided by
-.I v1
-and
-.IR v2 .
+\fBand(\fIv1\fB, \fIv2 \fR[, ...]\fB)\fR
+Return the bitwise AND of the values provided in the argument list.
+There must be at least two.
.TP
\fBcompl(\fIval\fB)\fR
Return the bitwise complement of
@@ -2910,11 +3056,9 @@ shifted left by
.I count
bits.
.TP
-\fBor(\fIv1\fB, \fIv2\fB)\fR
-Return the bitwise OR of the values provided by
-.I v1
-and
-.IR v2 .
+\fBor(\fIv1\fB, \fIv2 \fR[, ...]\fB)\fR
+Return the bitwise OR of the values provided in the argument list.
+There must be at least two.
.TP
\fBrshift(\fIval\fB, \fIcount\fB)\fR
Return the value of
@@ -2923,11 +3067,9 @@ shifted right by
.I count
bits.
.TP
-\fBxor(\fIv1\fB, \fIv2\fB)\fR
-Return the bitwise XOR of the values provided by
-.I v1
-and
-.IR v2 .
+\fBxor(\fIv1\fB, \fIv2 \fR[, ...]\fB)\fR
+Return the bitwise XOR of the values provided in the argument list.
+There must be at least two.
.PP
.SS Type Function
The following function is for use with multidimensional arrays.
@@ -3103,27 +3245,15 @@ may be used in place of
.SH DYNAMICALLY LOADING NEW FUNCTIONS
You can dynamically add new built-in functions to the running
.I gawk
-interpreter.
+interpreter with the
+.B @load
+statement.
The full details are beyond the scope of this manual page;
-see \*(EP for the details.
-.PP
-.TP 8
-\fBextension(\fIobject\fB, \fIfunction\fB)\fR
-Dynamically link the shared object file named by
-.IR object ,
-and invoke
-.I function
-in that object, to perform initialization.
-These should both be provided as strings.
-Return the value returned by
-.IR function .
-.PP
-Using this feature at the C level is not pretty, but
-it is unlikely to go away. Additional mechanisms may
-be added at some point.
+see \*(EP.
.SH SIGNALS
-.I pgawk
-accepts two signals.
+The
+.I gawk
+profiler accepts two signals.
.B SIGUSR1
causes it to dump a profile and function call stack to the
profile file, which is either
@@ -3133,7 +3263,7 @@ or whatever file was named with the
option. It then continues to run.
.B SIGHUP
causes
-.I pgawk
+.I gawk
to dump the profile and function call stack and then exit.
.SH INTERNATIONALIZATION
.PP
@@ -3573,10 +3703,31 @@ environment variable can be used to provide a list of directories that
.I gawk
searches when looking for files named via the
.B \-f
-and
+,
.B \-\^\-file
+,
+.B \-i
+and
+.B \-\^\-include
+options. If the initial search fails, the path is searched again after
+appending ".awk" to the filename.
+.PP
+The
+.B AWKLIBPATH
+environment variable can be used to provide a list of directories that
+.I gawk
+searches when looking for files named via the
+.B \-l
+and
+.B \-\^\-load
options.
.PP
+The
+.B GAWK_READ_TIMEOUT
+environment variable can be used to specify a timeout
+in milliseconds for reading input from a terminal, pipe
+or two-way communication including sockets.
+.PP
For socket communication, two special environment variables can be used to control the number of retries
.RB ( GAWK_SOCK_RETRIES ),
and the interval between retries
@@ -3627,7 +3778,7 @@ status is 2. On non-POSIX systems, this value may be mapped to
.SH VERSION INFORMATION
This man page documents
.IR gawk ,
-version 4.0.
+version 4.1.
.SH AUTHORS
The original version of \*(UX
.I awk
@@ -3705,6 +3856,7 @@ While the
developers occasionally read this newsgroup, posting bug reports there
is an unreliable way to report bugs. Instead, please use the electronic mail
addresses given above.
+Really.
.PP
If you're using a GNU/Linux or BSD-based system,
you may wish to submit a bug report to the vendor of your distribution.
@@ -3724,6 +3876,7 @@ are surprisingly difficult to diagnose in the completely general case,
and the effort to do so really is not worth it.
.SH SEE ALSO
.IR egrep (1),
+.IR sed (1),
.IR getpid (2),
.IR getppid (2),
.IR getpgrp (2),
@@ -3739,7 +3892,7 @@ Alfred V. Aho, Brian W. Kernighan, Peter J. Weinberger,
Addison-Wesley, 1988. ISBN 0-201-07981-X.
.PP
\*(EP,
-Edition 4.0, shipped with the
+Edition 4.1, shipped with the
.I gawk
source.
The current version of this document is available online at
@@ -3786,7 +3939,7 @@ We thank him.
.SH COPYING PERMISSIONS
Copyright \(co 1989, 1991, 1992, 1993, 1994, 1995, 1996,
1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005, 2007, 2009,
-2010, 2011
+2010, 2011, 2012
Free Software Foundation, Inc.
.PP
Permission is granted to make and distribute verbatim copies of
diff --git a/doc/gawk.info b/doc/gawk.info
index 878a03fc..ee83333e 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -87,20 +87,24 @@ texts being (a) (see below), and with the Back-Cover Texts being (b)
* Arrays:: The description and use of arrays. Also
includes array-oriented control statements.
* Functions:: Built-in and user-defined functions.
+* Library Functions:: A Library of `awk' Functions.
+* Sample Programs:: Many `awk' programs with complete
+ explanations.
* Internationalization:: Getting `gawk' to speak your
language.
* Advanced Features:: Stuff for advanced users, specific to
`gawk'.
-* Library Functions:: A Library of `awk' Functions.
-* Sample Programs:: Many `awk' programs with complete
- explanations.
-* Debugger:: The `dgawk' debugger.
+* Debugger:: The `gawk' debugger.
+* Arbitrary Precision Arithmetic:: Arbitrary precision arithmetic with
+ `gawk'.
+* Dynamic Extensions:: Adding new built-in functions to
+ `gawk'.
* Language History:: The evolution of the `awk'
language.
* Installation:: Installing `gawk' under various
operating systems.
-* Notes:: Notes about `gawk' extensions and
- possible future work.
+* Notes:: Notes about adding things to `gawk'
+ and possible future work.
* Basic Concepts:: A very quick introduction to programming
concepts.
* Glossary:: An explanation of some unfamiliar terms.
@@ -109,399 +113,531 @@ texts being (a) (see below), and with the Back-Cover Texts being (b)
* GNU Free Documentation License:: The license for this Info file.
* Index:: Concept and Variable Index.
-* History:: The history of `gawk' and
- `awk'.
-* Names:: What name to use to find `awk'.
-* This Manual:: Using this Info file. Includes
- sample input files that you can use.
-* Conventions:: Typographical Conventions.
-* Manual History:: Brief history of the GNU project and this
- Info file.
-* How To Contribute:: Helping to save the world.
-* Acknowledgments:: Acknowledgments.
-* Running gawk:: How to run `gawk' programs;
- includes command-line syntax.
-* One-shot:: Running a short throwaway `awk'
- program.
-* Read Terminal:: Using no input files (input from terminal
- instead).
-* Long:: Putting permanent `awk' programs in
- files.
-* Executable Scripts:: Making self-contained `awk'
- programs.
-* Comments:: Adding documentation to `gawk'
- programs.
-* Quoting:: More discussion of shell quoting issues.
-* DOS Quoting:: Quoting in Windows Batch Files.
-* Sample Data Files:: Sample data files for use in the
- `awk' programs illustrated in this
- Info file.
-* Very Simple:: A very simple example.
-* Two Rules:: A less simple one-line example using two
- rules.
-* More Complex:: A more complex example.
-* Statements/Lines:: Subdividing or combining statements into
- lines.
-* Other Features:: Other Features of `awk'.
-* When:: When to use `gawk' and when to use
- other things.
-* Command Line:: How to run `awk'.
-* Options:: Command-line options and their meanings.
-* Other Arguments:: Input file names and variable assignments.
-* Naming Standard Input:: How to specify standard input with other
- files.
-* Environment Variables:: The environment variables `gawk'
- uses.
-* AWKPATH Variable:: Searching directories for `awk'
- programs.
-* Other Environment Variables:: The environment variables.
-* Exit Status:: `gawk''s exit status.
-* Include Files:: Including other files into your program.
-* Obsolete:: Obsolete Options and/or features.
-* Undocumented:: Undocumented Options and Features.
-* Regexp Usage:: How to Use Regular Expressions.
-* Escape Sequences:: How to write nonprinting characters.
-* Regexp Operators:: Regular Expression Operators.
-* Bracket Expressions:: What can go between `[...]'.
-* GNU Regexp Operators:: Operators specific to GNU software.
-* Case-sensitivity:: How to do case-insensitive matching.
-* Leftmost Longest:: How much text matches.
-* Computed Regexps:: Using Dynamic Regexps.
-* Records:: Controlling how data is split into records.
-* Fields:: An introduction to fields.
-* Nonconstant Fields:: Nonconstant Field Numbers.
-* Changing Fields:: Changing the Contents of a Field.
-* Field Separators:: The field separator and how to change it.
-* Default Field Splitting:: How fields are normally separated.
-* Regexp Field Splitting:: Using regexps as the field separator.
-* Single Character Fields:: Making each character a separate field.
-* Command Line Field Separator:: Setting `FS' from the command-line.
-* Field Splitting Summary:: Some final points and a summary table.
-* Constant Size:: Reading constant width data.
-* Splitting By Content:: Defining Fields By Content
-* Multiple Line:: Reading multi-line records.
-* Getline:: Reading files under explicit program
- control using the `getline' function.
-* Plain Getline:: Using `getline' with no arguments.
-* Getline/Variable:: Using `getline' into a variable.
-* Getline/File:: Using `getline' from a file.
-* Getline/Variable/File:: Using `getline' into a variable from a
- file.
-* Getline/Pipe:: Using `getline' from a pipe.
-* Getline/Variable/Pipe:: Using `getline' into a variable from a
- pipe.
-* Getline/Coprocess:: Using `getline' from a coprocess.
-* Getline/Variable/Coprocess:: Using `getline' into a variable from a
- coprocess.
-* Getline Notes:: Important things to know about
- `getline'.
-* Getline Summary:: Summary of `getline' Variants.
-* Command line directories:: What happens if you put a directory on the
- command line.
-* Print:: The `print' statement.
-* Print Examples:: Simple examples of `print' statements.
-* Output Separators:: The output separators and how to change
- them.
-* OFMT:: Controlling Numeric Output With
- `print'.
-* Printf:: The `printf' statement.
-* Basic Printf:: Syntax of the `printf' statement.
-* Control Letters:: Format-control letters.
-* Format Modifiers:: Format-specification modifiers.
-* Printf Examples:: Several examples.
-* Redirection:: How to redirect output to multiple files
- and pipes.
-* Special Files:: File name interpretation in `gawk'.
- `gawk' allows access to inherited
- file descriptors.
-* Special FD:: Special files for I/O.
-* Special Network:: Special files for network communications.
-* Special Caveats:: Things to watch out for.
-* Close Files And Pipes:: Closing Input and Output Files and Pipes.
-* Values:: Constants, Variables, and Regular
- Expressions.
-* Constants:: String, numeric and regexp constants.
-* Scalar Constants:: Numeric and string constants.
-* Nondecimal-numbers:: What are octal and hex numbers.
-* Regexp Constants:: Regular Expression constants.
-* Using Constant Regexps:: When and how to use a regexp constant.
-* Variables:: Variables give names to values for later
- use.
-* Using Variables:: Using variables in your programs.
-* Assignment Options:: Setting variables on the command-line and a
- summary of command-line syntax. This is an
- advanced method of input.
-* Conversion:: The conversion of strings to numbers and
- vice versa.
-* All Operators:: `gawk''s operators.
-* Arithmetic Ops:: Arithmetic operations (`+', `-',
- etc.)
-* Concatenation:: Concatenating strings.
-* Assignment Ops:: Changing the value of a variable or a
- field.
-* Increment Ops:: Incrementing the numeric value of a
- variable.
-* Truth Values and Conditions:: Testing for true and false.
-* Truth Values:: What is ``true'' and what is ``false''.
-* Typing and Comparison:: How variables acquire types and how this
- affects comparison of numbers and strings
- with `<', etc.
-* Variable Typing:: String type versus numeric type.
-* Comparison Operators:: The comparison operators.
-* POSIX String Comparison:: String comparison with POSIX rules.
-* Boolean Ops:: Combining comparison expressions using
- boolean operators `||' (``or''),
- `&&' (``and'') and `!' (``not'').
-* Conditional Exp:: Conditional expressions select between two
- subexpressions under control of a third
- subexpression.
-* Function Calls:: A function call is an expression.
-* Precedence:: How various operators nest.
-* Locales:: How the locale affects things.
-* Pattern Overview:: What goes into a pattern.
-* Regexp Patterns:: Using regexps as patterns.
-* Expression Patterns:: Any expression can be used as a pattern.
-* Ranges:: Pairs of patterns specify record ranges.
-* BEGIN/END:: Specifying initialization and cleanup
- rules.
-* Using BEGIN/END:: How and why to use BEGIN/END rules.
-* I/O And BEGIN/END:: I/O issues in BEGIN/END rules.
-* BEGINFILE/ENDFILE:: Two special patterns for advanced control.
-* Empty:: The empty pattern, which matches every
- record.
-* Using Shell Variables:: How to use shell variables with
- `awk'.
-* Action Overview:: What goes into an action.
-* Statements:: Describes the various control statements in
- detail.
-* If Statement:: Conditionally execute some `awk'
- statements.
-* While Statement:: Loop until some condition is satisfied.
-* Do Statement:: Do specified action while looping until
- some condition is satisfied.
-* For Statement:: Another looping statement, that provides
- initialization and increment clauses.
-* Switch Statement:: Switch/case evaluation for conditional
- execution of statements based on a value.
-* Break Statement:: Immediately exit the innermost enclosing
- loop.
-* Continue Statement:: Skip to the end of the innermost enclosing
- loop.
-* Next Statement:: Stop processing the current input record.
-* Nextfile Statement:: Stop processing the current file.
-* Exit Statement:: Stop execution of `awk'.
-* Built-in Variables:: Summarizes the built-in variables.
-* User-modified:: Built-in variables that you change to
- control `awk'.
-* Auto-set:: Built-in variables where `awk'
- gives you information.
-* ARGC and ARGV:: Ways to use `ARGC' and `ARGV'.
-* Array Basics:: The basics of arrays.
-* Array Intro:: Introduction to Arrays
-* Reference to Elements:: How to examine one element of an array.
-* Assigning Elements:: How to change an element of an array.
-* Array Example:: Basic Example of an Array
-* Scanning an Array:: A variation of the `for' statement. It
- loops through the indices of an array's
- existing elements.
-* Controlling Scanning:: Controlling the order in which arrays are
- scanned.
-* Delete:: The `delete' statement removes an
- element from an array.
-* Numeric Array Subscripts:: How to use numbers as subscripts in
- `awk'.
-* Uninitialized Subscripts:: Using Uninitialized variables as
- subscripts.
-* Multi-dimensional:: Emulating multidimensional arrays in
- `awk'.
-* Multi-scanning:: Scanning multidimensional arrays.
-* Arrays of Arrays:: True multidimensional arrays.
-* Built-in:: Summarizes the built-in functions.
-* Calling Built-in:: How to call built-in functions.
-* Numeric Functions:: Functions that work with numbers, including
- `int()', `sin()' and
- `rand()'.
-* String Functions:: Functions for string manipulation, such as
- `split()', `match()' and
- `sprintf()'.
-* Gory Details:: More than you want to know about `\'
- and `&' with `sub()',
- `gsub()', and `gensub()'.
-* I/O Functions:: Functions for files and shell commands.
-* Time Functions:: Functions for dealing with timestamps.
-* Bitwise Functions:: Functions for bitwise operations.
-* Type Functions:: Functions for type information.
-* I18N Functions:: Functions for string translation.
-* User-defined:: Describes User-defined functions in detail.
-* Definition Syntax:: How to write definitions and what they
- mean.
-* Function Example:: An example function definition and what it
- does.
-* Function Caveats:: Things to watch out for.
-* Calling A Function:: Don't use spaces.
-* Variable Scope:: Controlling variable scope.
-* Pass By Value/Reference:: Passing parameters.
-* Return Statement:: Specifying the value a function returns.
-* Dynamic Typing:: How variable types can change at runtime.
-* Indirect Calls:: Choosing the function to call at runtime.
-* I18N and L10N:: Internationalization and Localization.
-* Explaining gettext:: How GNU `gettext' works.
-* Programmer i18n:: Features for the programmer.
-* Translator i18n:: Features for the translator.
-* String Extraction:: Extracting marked strings.
-* Printf Ordering:: Rearranging `printf' arguments.
-* I18N Portability:: `awk'-level portability issues.
-* I18N Example:: A simple i18n example.
-* Gawk I18N:: `gawk' is also internationalized.
-* Nondecimal Data:: Allowing nondecimal input data.
-* Array Sorting:: Facilities for controlling array traversal
- and sorting arrays.
-* Controlling Array Traversal:: How to use PROCINFO["sorted_in"].
-* Array Sorting Functions:: How to use `asort()' and
- `asorti()'.
-* Two-way I/O:: Two-way communications with another
- process.
-* TCP/IP Networking:: Using `gawk' for network
- programming.
-* Profiling:: Profiling your `awk' programs.
-* Library Names:: How to best name private global variables
- in library functions.
-* General Functions:: Functions that are of general use.
-* Strtonum Function:: A replacement for the built-in
- `strtonum()' function.
-* Assert Function:: A function for assertions in `awk'
- programs.
-* Round Function:: A function for rounding if `sprintf()'
- does not do it correctly.
-* Cliff Random Function:: The Cliff Random Number Generator.
-* Ordinal Functions:: Functions for using characters as numbers
- and vice versa.
-* Join Function:: A function to join an array into a string.
-* Gettimeofday Function:: A function to get formatted times.
-* Data File Management:: Functions for managing command-line data
- files.
-* Filetrans Function:: A function for handling data file
- transitions.
-* Rewind Function:: A function for rereading the current file.
-* File Checking:: Checking that data files are readable.
-* Empty Files:: Checking for zero-length files.
-* Ignoring Assigns:: Treating assignments as file names.
-* Getopt Function:: A function for processing command-line
- arguments.
-* Passwd Functions:: Functions for getting user information.
-* Group Functions:: Functions for getting group information.
-* Walking Arrays:: A function to walk arrays of arrays.
-* Running Examples:: How to run these examples.
-* Clones:: Clones of common utilities.
-* Cut Program:: The `cut' utility.
-* Egrep Program:: The `egrep' utility.
-* Id Program:: The `id' utility.
-* Split Program:: The `split' utility.
-* Tee Program:: The `tee' utility.
-* Uniq Program:: The `uniq' utility.
-* Wc Program:: The `wc' utility.
-* Miscellaneous Programs:: Some interesting `awk' programs.
-* Dupword Program:: Finding duplicated words in a document.
-* Alarm Program:: An alarm clock.
-* Translate Program:: A program similar to the `tr'
- utility.
-* Labels Program:: Printing mailing labels.
-* Word Sorting:: A program to produce a word usage count.
-* History Sorting:: Eliminating duplicate entries from a
- history file.
-* Extract Program:: Pulling out programs from Texinfo source
- files.
-* Simple Sed:: A Simple Stream Editor.
-* Igawk Program:: A wrapper for `awk' that includes
- files.
-* Anagram Program:: Finding anagrams from a dictionary.
-* Signature Program:: People do amazing things with too much time
- on their hands.
-* Debugging:: Introduction to `dgawk'.
-* Debugging Concepts:: Debugging In General.
-* Debugging Terms:: Additional Debugging Concepts.
-* Awk Debugging:: Awk Debugging.
-* Sample dgawk session:: Sample `dgawk' session.
-* dgawk invocation:: `dgawk' Invocation.
-* Finding The Bug:: Finding The Bug.
-* List of Debugger Commands:: Main `dgawk' Commands.
-* Breakpoint Control:: Control of breakpoints.
-* Dgawk Execution Control:: Control of execution.
-* Viewing And Changing Data:: Viewing and changing data.
-* Dgawk Stack:: Dealing with the stack.
-* Dgawk Info:: Obtaining information about the program and
- the debugger state.
-* Miscellaneous Dgawk Commands:: Miscellaneous Commands.
-* Readline Support:: Readline Support.
-* Dgawk Limitations:: Limitations and future plans.
-* V7/SVR3.1:: The major changes between V7 and System V
- Release 3.1.
-* SVR4:: Minor changes between System V Releases 3.1
- and 4.
-* POSIX:: New features from the POSIX standard.
-* BTL:: New features from Brian Kernighan's version
- of `awk'.
-* POSIX/GNU:: The extensions in `gawk' not in
- POSIX `awk'.
-* Common Extensions:: Common Extensions Summary.
-* Ranges and Locales:: How locales used to affect regexp ranges.
-* Contributors:: The major contributors to `gawk'.
-* Gawk Distribution:: What is in the `gawk' distribution.
-* Getting:: How to get the distribution.
-* Extracting:: How to extract the distribution.
-* Distribution contents:: What is in the distribution.
-* Unix Installation:: Installing `gawk' under various
- versions of Unix.
-* Quick Installation:: Compiling `gawk' under Unix.
-* Additional Configuration Options:: Other compile-time options.
-* Configuration Philosophy:: How it's all supposed to work.
-* Non-Unix Installation:: Installation on Other Operating Systems.
-* PC Installation:: Installing and Compiling `gawk' on
- MS-DOS and OS/2.
-* PC Binary Installation:: Installing a prepared distribution.
-* PC Compiling:: Compiling `gawk' for MS-DOS,
- Windows32, and OS/2.
-* PC Testing:: Testing `gawk' on PC systems.
-* PC Using:: Running `gawk' on MS-DOS, Windows32
- and OS/2.
-* Cygwin:: Building and running `gawk' for
- Cygwin.
-* MSYS:: Using `gawk' In The MSYS
- Environment.
-* VMS Installation:: Installing `gawk' on VMS.
-* VMS Compilation:: How to compile `gawk' under VMS.
-* VMS Installation Details:: How to install `gawk' under VMS.
-* VMS Running:: How to run `gawk' under VMS.
-* VMS Old Gawk:: An old version comes with some VMS systems.
-* Bugs:: Reporting Problems and Bugs.
-* Other Versions:: Other freely available `awk'
- implementations.
-* Compatibility Mode:: How to disable certain `gawk'
- extensions.
-* Additions:: Making Additions To `gawk'.
-* Accessing The Source:: Accessing the Git repository.
-* Adding Code:: Adding code to the main body of
- `gawk'.
-* New Ports:: Porting `gawk' to a new operating
- system.
-* Dynamic Extensions:: Adding new built-in functions to
- `gawk'.
-* Internals:: A brief look at some `gawk'
- internals.
-* Plugin License:: A note about licensing.
-* Sample Library:: A example of new functions.
-* Internal File Description:: What the new functions will do.
-* Internal File Ops:: The code for internal file operations.
-* Using Internal File Ops:: How to use an external extension.
-* Future Extensions:: New features that may be implemented one
- day.
-* Basic High Level:: The high level view.
-* Basic Data Typing:: A very quick intro to data types.
-* Floating Point Issues:: Stuff to know about floating-point numbers.
-* String Conversion Precision:: The String Value Can Lie.
-* Unexpected Results:: Floating Point Numbers Are Not Abstract
- Numbers.
-* POSIX Floating Point Problems:: Standards Versus Existing Practice.
+* History:: The history of `gawk' and
+ `awk'.
+* Names:: What name to use to find
+ `awk'.
+* This Manual:: Using this Info file. Includes
+ sample input files that you can use.
+* Conventions:: Typographical Conventions.
+* Manual History:: Brief history of the GNU project and
+ this Info file.
+* How To Contribute:: Helping to save the world.
+* Acknowledgments:: Acknowledgments.
+* Running gawk:: How to run `gawk' programs;
+ includes command-line syntax.
+* One-shot:: Running a short throwaway
+ `awk' program.
+* Read Terminal:: Using no input files (input from
+ terminal instead).
+* Long:: Putting permanent `awk'
+ programs in files.
+* Executable Scripts:: Making self-contained `awk'
+ programs.
+* Comments:: Adding documentation to `gawk'
+ programs.
+* Quoting:: More discussion of shell quoting
+ issues.
+* DOS Quoting:: Quoting in Windows Batch Files.
+* Sample Data Files:: Sample data files for use in the
+ `awk' programs illustrated in
+ this Info file.
+* Very Simple:: A very simple example.
+* Two Rules:: A less simple one-line example using
+ two rules.
+* More Complex:: A more complex example.
+* Statements/Lines:: Subdividing or combining statements
+ into lines.
+* Other Features:: Other Features of `awk'.
+* When:: When to use `gawk' and when to
+ use other things.
+* Command Line:: How to run `awk'.
+* Options:: Command-line options and their
+ meanings.
+* Other Arguments:: Input file names and variable
+ assignments.
+* Naming Standard Input:: How to specify standard input with
+ other files.
+* Environment Variables:: The environment variables
+ `gawk' uses.
+* AWKPATH Variable:: Searching directories for
+ `awk' programs.
+* AWKLIBPATH Variable:: Searching directories for
+ `awk' shared libraries.
+* Other Environment Variables:: The environment variables.
+* Exit Status:: `gawk''s exit status.
+* Include Files:: Including other files into your
+ program.
+* Loading Shared Libraries:: Loading shared libraries into your
+ program.
+* Obsolete:: Obsolete Options and/or features.
+* Undocumented:: Undocumented Options and Features.
+* Regexp Usage:: How to Use Regular Expressions.
+* Escape Sequences:: How to write nonprinting characters.
+* Regexp Operators:: Regular Expression Operators.
+* Bracket Expressions:: What can go between `[...]'.
+* GNU Regexp Operators:: Operators specific to GNU software.
+* Case-sensitivity:: How to do case-insensitive matching.
+* Leftmost Longest:: How much text matches.
+* Computed Regexps:: Using Dynamic Regexps.
+* Records:: Controlling how data is split into
+ records.
+* Fields:: An introduction to fields.
+* Nonconstant Fields:: Nonconstant Field Numbers.
+* Changing Fields:: Changing the Contents of a Field.
+* Field Separators:: The field separator and how to change
+ it.
+* Default Field Splitting:: How fields are normally separated.
+* Regexp Field Splitting:: Using regexps as the field separator.
+* Single Character Fields:: Making each character a separate
+ field.
+* Command Line Field Separator:: Setting `FS' from the
+ command-line.
+* Field Splitting Summary:: Some final points and a summary table.
+* Constant Size:: Reading constant width data.
+* Splitting By Content:: Defining Fields By Content
+* Multiple Line:: Reading multi-line records.
+* Getline:: Reading files under explicit program
+ control using the `getline'
+ function.
+* Plain Getline:: Using `getline' with no
+ arguments.
+* Getline/Variable:: Using `getline' into a variable.
+* Getline/File:: Using `getline' from a file.
+* Getline/Variable/File:: Using `getline' into a variable
+ from a file.
+* Getline/Pipe:: Using `getline' from a pipe.
+* Getline/Variable/Pipe:: Using `getline' into a variable
+ from a pipe.
+* Getline/Coprocess:: Using `getline' from a coprocess.
+* Getline/Variable/Coprocess:: Using `getline' into a variable
+ from a coprocess.
+* Getline Notes:: Important things to know about
+ `getline'.
+* Getline Summary:: Summary of `getline' Variants.
+* Read Timeout:: Reading input with a timeout.
+* Command line directories:: What happens if you put a directory on
+ the command line.
+* Print:: The `print' statement.
+* Print Examples:: Simple examples of `print'
+ statements.
+* Output Separators:: The output separators and how to
+ change them.
+* OFMT:: Controlling Numeric Output With
+ `print'.
+* Printf:: The `printf' statement.
+* Basic Printf:: Syntax of the `printf' statement.
+* Control Letters:: Format-control letters.
+* Format Modifiers:: Format-specification modifiers.
+* Printf Examples:: Several examples.
+* Redirection:: How to redirect output to multiple
+ files and pipes.
+* Special Files:: File name interpretation in
+ `gawk'. `gawk' allows
+ access to inherited file descriptors.
+* Special FD:: Special files for I/O.
+* Special Network:: Special files for network
+ communications.
+* Special Caveats:: Things to watch out for.
+* Close Files And Pipes:: Closing Input and Output Files and
+ Pipes.
+* Values:: Constants, Variables, and Regular
+ Expressions.
+* Constants:: String, numeric and regexp constants.
+* Scalar Constants:: Numeric and string constants.
+* Nondecimal-numbers:: What are octal and hex numbers.
+* Regexp Constants:: Regular Expression constants.
+* Using Constant Regexps:: When and how to use a regexp constant.
+* Variables:: Variables give names to values for
+ later use.
+* Using Variables:: Using variables in your programs.
+* Assignment Options:: Setting variables on the command-line
+ and a summary of command-line syntax.
+ This is an advanced method of input.
+* Conversion:: The conversion of strings to numbers
+ and vice versa.
+* All Operators:: `gawk''s operators.
+* Arithmetic Ops:: Arithmetic operations (`+',
+ `-', etc.)
+* Concatenation:: Concatenating strings.
+* Assignment Ops:: Changing the value of a variable or a
+ field.
+* Increment Ops:: Incrementing the numeric value of a
+ variable.
+* Truth Values and Conditions:: Testing for true and false.
+* Truth Values:: What is ``true'' and what is
+ ``false''.
+* Typing and Comparison:: How variables acquire types and how
+ this affects comparison of numbers and
+ strings with `<', etc.
+* Variable Typing:: String type versus numeric type.
+* Comparison Operators:: The comparison operators.
+* POSIX String Comparison:: String comparison with POSIX rules.
+* Boolean Ops:: Combining comparison expressions using
+ boolean operators `||' (``or''),
+ `&&' (``and'') and `!'
+ (``not'').
+* Conditional Exp:: Conditional expressions select between
+ two subexpressions under control of a
+ third subexpression.
+* Function Calls:: A function call is an expression.
+* Precedence:: How various operators nest.
+* Locales:: How the locale affects things.
+* Pattern Overview:: What goes into a pattern.
+* Regexp Patterns:: Using regexps as patterns.
+* Expression Patterns:: Any expression can be used as a
+ pattern.
+* Ranges:: Pairs of patterns specify record
+ ranges.
+* BEGIN/END:: Specifying initialization and cleanup
+ rules.
+* Using BEGIN/END:: How and why to use BEGIN/END rules.
+* I/O And BEGIN/END:: I/O issues in BEGIN/END rules.
+* BEGINFILE/ENDFILE:: Two special patterns for advanced
+ control.
+* Empty:: The empty pattern, which matches every
+ record.
+* Using Shell Variables:: How to use shell variables with
+ `awk'.
+* Action Overview:: What goes into an action.
+* Statements:: Describes the various control
+ statements in detail.
+* If Statement:: Conditionally execute some
+ `awk' statements.
+* While Statement:: Loop until some condition is
+ satisfied.
+* Do Statement:: Do specified action while looping
+ until some condition is satisfied.
+* For Statement:: Another looping statement, that
+ provides initialization and increment
+ clauses.
+* Switch Statement:: Switch/case evaluation for conditional
+ execution of statements based on a
+ value.
+* Break Statement:: Immediately exit the innermost
+ enclosing loop.
+* Continue Statement:: Skip to the end of the innermost
+ enclosing loop.
+* Next Statement:: Stop processing the current input
+ record.
+* Nextfile Statement:: Stop processing the current file.
+* Exit Statement:: Stop execution of `awk'.
+* Built-in Variables:: Summarizes the built-in variables.
+* User-modified:: Built-in variables that you change to
+ control `awk'.
+* Auto-set:: Built-in variables where `awk'
+ gives you information.
+* ARGC and ARGV:: Ways to use `ARGC' and
+ `ARGV'.
+* Array Basics:: The basics of arrays.
+* Array Intro:: Introduction to Arrays
+* Reference to Elements:: How to examine one element of an
+ array.
+* Assigning Elements:: How to change an element of an array.
+* Array Example:: Basic Example of an Array
+* Scanning an Array:: A variation of the `for'
+ statement. It loops through the
+ indices of an array's existing
+ elements.
+* Controlling Scanning:: Controlling the order in which arrays
+ are scanned.
+* Delete:: The `delete' statement removes an
+ element from an array.
+* Numeric Array Subscripts:: How to use numbers as subscripts in
+ `awk'.
+* Uninitialized Subscripts:: Using Uninitialized variables as
+ subscripts.
+* Multi-dimensional:: Emulating multidimensional arrays in
+ `awk'.
+* Multi-scanning:: Scanning multidimensional arrays.
+* Arrays of Arrays:: True multidimensional arrays.
+* Built-in:: Summarizes the built-in functions.
+* Calling Built-in:: How to call built-in functions.
+* Numeric Functions:: Functions that work with numbers,
+ including `int()', `sin()'
+ and `rand()'.
+* String Functions:: Functions for string manipulation,
+ such as `split()', `match()'
+ and `sprintf()'.
+* Gory Details:: More than you want to know about
+ `\' and `&' with
+ `sub()', `gsub()', and
+ `gensub()'.
+* I/O Functions:: Functions for files and shell
+ commands.
+* Time Functions:: Functions for dealing with timestamps.
+* Bitwise Functions:: Functions for bitwise operations.
+* Type Functions:: Functions for type information.
+* I18N Functions:: Functions for string translation.
+* User-defined:: Describes User-defined functions in
+ detail.
+* Definition Syntax:: How to write definitions and what they
+ mean.
+* Function Example:: An example function definition and
+ what it does.
+* Function Caveats:: Things to watch out for.
+* Calling A Function:: Don't use spaces.
+* Variable Scope:: Controlling variable scope.
+* Pass By Value/Reference:: Passing parameters.
+* Return Statement:: Specifying the value a function
+ returns.
+* Dynamic Typing:: How variable types can change at
+ runtime.
+* Indirect Calls:: Choosing the function to call at
+ runtime.
+* Library Names:: How to best name private global
+ variables in library functions.
+* General Functions:: Functions that are of general use.
+* Strtonum Function:: A replacement for the built-in
+ `strtonum()' function.
+* Assert Function:: A function for assertions in
+ `awk' programs.
+* Round Function:: A function for rounding if
+ `sprintf()' does not do it
+ correctly.
+* Cliff Random Function:: The Cliff Random Number Generator.
+* Ordinal Functions:: Functions for using characters as
+ numbers and vice versa.
+* Join Function:: A function to join an array into a
+ string.
+* Getlocaltime Function:: A function to get formatted times.
+* Data File Management:: Functions for managing command-line
+ data files.
+* Filetrans Function:: A function for handling data file
+ transitions.
+* Rewind Function:: A function for rereading the current
+ file.
+* File Checking:: Checking that data files are readable.
+* Empty Files:: Checking for zero-length files.
+* Ignoring Assigns:: Treating assignments as file names.
+* Getopt Function:: A function for processing command-line
+ arguments.
+* Passwd Functions:: Functions for getting user
+ information.
+* Group Functions:: Functions for getting group
+ information.
+* Walking Arrays:: A function to walk arrays of arrays.
+* Running Examples:: How to run these examples.
+* Clones:: Clones of common utilities.
+* Cut Program:: The `cut' utility.
+* Egrep Program:: The `egrep' utility.
+* Id Program:: The `id' utility.
+* Split Program:: The `split' utility.
+* Tee Program:: The `tee' utility.
+* Uniq Program:: The `uniq' utility.
+* Wc Program:: The `wc' utility.
+* Miscellaneous Programs:: Some interesting `awk'
+ programs.
+* Dupword Program:: Finding duplicated words in a
+ document.
+* Alarm Program:: An alarm clock.
+* Translate Program:: A program similar to the `tr'
+ utility.
+* Labels Program:: Printing mailing labels.
+* Word Sorting:: A program to produce a word usage
+ count.
+* History Sorting:: Eliminating duplicate entries from a
+ history file.
+* Extract Program:: Pulling out programs from Texinfo
+ source files.
+* Simple Sed:: A Simple Stream Editor.
+* Igawk Program:: A wrapper for `awk' that
+ includes files.
+* Anagram Program:: Finding anagrams from a dictionary.
+* Signature Program:: People do amazing things with too much
+ time on their hands.
+* I18N and L10N:: Internationalization and Localization.
+* Explaining gettext:: How GNU `gettext' works.
+* Programmer i18n:: Features for the programmer.
+* Translator i18n:: Features for the translator.
+* String Extraction:: Extracting marked strings.
+* Printf Ordering:: Rearranging `printf' arguments.
+* I18N Portability:: `awk'-level portability
+ issues.
+* I18N Example:: A simple i18n example.
+* Gawk I18N:: `gawk' is also
+ internationalized.
+* Nondecimal Data:: Allowing nondecimal input data.
+* Array Sorting:: Facilities for controlling array
+ traversal and sorting arrays.
+* Controlling Array Traversal:: How to use PROCINFO["sorted_in"].
+* Array Sorting Functions:: How to use `asort()' and
+ `asorti()'.
+* Two-way I/O:: Two-way communications with another
+ process.
+* TCP/IP Networking:: Using `gawk' for network
+ programming.
+* Profiling:: Profiling your `awk' programs.
+* Debugging:: Introduction to `gawk'
+ debugger.
+* Debugging Concepts:: Debugging in General.
+* Debugging Terms:: Additional Debugging Concepts.
+* Awk Debugging:: Awk Debugging.
+* Sample Debugging Session:: Sample debugging session.
+* Debugger Invocation:: How to Start the Debugger.
+* Finding The Bug:: Finding the Bug.
+* List of Debugger Commands:: Main debugger commands.
+* Breakpoint Control:: Control of Breakpoints.
+* Debugger Execution Control:: Control of Execution.
+* Viewing And Changing Data:: Viewing and Changing Data.
+* Execution Stack:: Dealing with the Stack.
+* Debugger Info:: Obtaining Information about the
+ Program and the Debugger State.
+* Miscellaneous Debugger Commands:: Miscellaneous Commands.
+* Readline Support:: Readline support.
+* Limitations:: Limitations and future plans.
+* General Arithmetic:: An introduction to computer
+ arithmetic.
+* Floating Point Issues:: Stuff to know about floating-point
+ numbers.
+* String Conversion Precision:: The String Value Can Lie.
+* Unexpected Results:: Floating Point Numbers Are Not
+ Abstract Numbers.
+* POSIX Floating Point Problems:: Standards Versus Existing Practice.
+* Integer Programming:: Effective integer programming.
+* Floating-point Programming:: Effective Floating-point Programming.
+* Floating-point Representation:: Binary floating-point representation.
+* Floating-point Context:: Floating-point context.
+* Rounding Mode:: Floating-point rounding mode.
+* Gawk and MPFR:: How `gawk' provides
+ arbitrary-precision arithmetic.
+* Arbitrary Precision Floats:: Arbitrary Precision Floating-point
+ Arithmetic with `gawk'.
+* Setting Precision:: Setting the working precision.
+* Setting Rounding Mode:: Setting the rounding mode.
+* Floating-point Constants:: Representing floating-point constants.
+* Changing Precision:: Changing the precision of a number.
+* Exact Arithmetic:: Exact arithmetic with floating-point
+ numbers.
+* Arbitrary Precision Integers:: Arbitrary Precision Integer Arithmetic
+ with `gawk'.
+* Extension Intro:: What is an extension.
+* Plugin License:: A note about licensing.
+* Extension Design:: Design notes about the extension API.
+* Old Extension Problems:: Problems with the old mechanism.
+* Extension New Mechanism Goals:: Goals for the new mechanism.
+* Extension Other Design Decisions:: Some other design decisions.
+* Extension Mechanism Outline:: An outline of how it works.
+* Extension Future Growth:: Some room for future growth.
+* Extension API Description:: A full description of the API.
+* Extension API Functions Introduction:: Introduction to the API functions.
+* General Data Types:: The data types.
+* Requesting Values:: How to get a value.
+* Constructor Functions:: Functions for creating values.
+* Registration Functions:: Functions to register things with
+ `gawk'.
+* Extension Functions:: Registering extension functions.
+* Exit Callback Functions:: Registering an exit callback.
+* Extension Version String:: Registering a version string.
+* Input Parsers:: Registering an input parser.
+* Output Wrappers:: Registering an output wrapper.
+* Two-way processors:: Registering a two-way processor.
+* Printing Messages:: Functions for printing messages.
+* Updating `ERRNO':: Functions for updating `ERRNO'.
+* Accessing Parameters:: Functions for accessing parameters.
+* Symbol Table Access:: Functions for accessing global
+ variables.
+* Symbol table by name:: Accessing variables by name.
+* Symbol table by cookie:: Accessing variables by ``cookie''.
+* Cached values:: Creating and using cached values.
+* Array Manipulation:: Functions for working with arrays.
+* Array Data Types:: Data types for working with arrays.
+* Array Functions:: Functions for working with arrays.
+* Flattening Arrays:: How to flatten arrays.
+* Creating Arrays:: How to create and populate arrays.
+* Extension API Variables:: Variables provided by the API.
+* Extension Versioning:: API Version information.
+* Extension API Informational Variables:: Variables providing information about
+ `gawk''s invocation.
+* Extension API Boilerplate:: Boilerplate code for using the API.
+* Finding Extensions:: How `gawk' finds compiled
+ extensions.
+* Extension Example:: Example C code for an extension.
+* Internal File Description:: What the new functions will do.
+* Internal File Ops:: The code for internal file operations.
+* Using Internal File Ops:: How to use an external extension.
+* Extension Samples:: The sample extensions that ship with
+ `gawk'.
+* Extension Sample File Functions:: The file functions sample.
+* Extension Sample Fnmatch:: An interface to `fnmatch()'.
+* Extension Sample Fork:: An interface to `fork()' and
+ other process functions.
+* Extension Sample Ord:: Character to value to character
+ conversions.
+* Extension Sample Readdir:: An interface to `readdir()'.
+* Extension Sample Revout:: Reversing output sample output
+ wrapper.
+* Extension Sample Rev2way:: Reversing data sample two-way
+ processor.
+* Extension Sample Read write array:: Serializing an array to a file.
+* Extension Sample Readfile:: Reading an entire file into a string.
+* Extension Sample API Tests:: Tests for the API.
+* Extension Sample Time:: An interface to `gettimeofday()'
+ and `sleep()'.
+* gawkextlib:: The `gawkextlib' project.
+* V7/SVR3.1:: The major changes between V7 and
+ System V Release 3.1.
+* SVR4:: Minor changes between System V
+ Releases 3.1 and 4.
+* POSIX:: New features from the POSIX standard.
+* BTL:: New features from Brian Kernighan's
+ version of `awk'.
+* POSIX/GNU:: The extensions in `gawk' not
+ in POSIX `awk'.
+* Common Extensions:: Common Extensions Summary.
+* Ranges and Locales:: How locales used to affect regexp
+ ranges.
+* Contributors:: The major contributors to
+ `gawk'.
+* Gawk Distribution:: What is in the `gawk'
+ distribution.
+* Getting:: How to get the distribution.
+* Extracting:: How to extract the distribution.
+* Distribution contents:: What is in the distribution.
+* Unix Installation:: Installing `gawk' under
+ various versions of Unix.
+* Quick Installation:: Compiling `gawk' under Unix.
+* Additional Configuration Options:: Other compile-time options.
+* Configuration Philosophy:: How it's all supposed to work.
+* Non-Unix Installation:: Installation on Other Operating
+ Systems.
+* PC Installation:: Installing and Compiling
+ `gawk' on MS-DOS and OS/2.
+* PC Binary Installation:: Installing a prepared distribution.
+* PC Compiling:: Compiling `gawk' for MS-DOS,
+ Windows32, and OS/2.
+* PC Testing:: Testing `gawk' on PC systems.
+* PC Using:: Running `gawk' on MS-DOS,
+ Windows32 and OS/2.
+* Cygwin:: Building and running `gawk'
+ for Cygwin.
+* MSYS:: Using `gawk' In The MSYS
+ Environment.
+* VMS Installation:: Installing `gawk' on VMS.
+* VMS Compilation:: How to compile `gawk' under
+ VMS.
+* VMS Installation Details:: How to install `gawk' under
+ VMS.
+* VMS Running:: How to run `gawk' under VMS.
+* VMS Old Gawk:: An old version comes with some VMS
+ systems.
+* Bugs:: Reporting Problems and Bugs.
+* Other Versions:: Other freely available `awk'
+ implementations.
+* Compatibility Mode:: How to disable certain `gawk'
+ extensions.
+* Additions:: Making Additions To `gawk'.
+* Accessing The Source:: Accessing the Git repository.
+* Adding Code:: Adding code to the main body of
+ `gawk'.
+* New Ports:: Porting `gawk' to a new
+ operating system.
+* Derived Files:: Why derived files are kept in the
+ `git' repository.
+* Future Extensions:: New features that may be implemented
+ one day.
+* Basic High Level:: The high level view.
+* Basic Data Typing:: A very quick intro to data types.
To Miriam, for making me complete.
@@ -805,6 +941,12 @@ expert should find useful. In particular, the description of POSIX
`awk' and the example programs in *note Library Functions::, and in
*note Sample Programs::, should be of interest.
+ This Info file is split into several parts, as follows:
+
+ Part I describes the `awk' language and `gawk' program in detail.
+It starts with the basics, and continues through all of the features of
+`awk'. It contains the following chapters:
+
*note Getting Started::, provides the essentials you need to know to
begin using `awk'.
@@ -837,6 +979,21 @@ described, as well as sorting arrays in `gawk'. It also describes how
*note Functions::, describes the built-in functions `awk' and `gawk'
provide, as well as how to define your own functions.
+ Part II shows how to use `awk' and `gawk' for problem solving.
+There is lots of code here for you to read and learn from. It contains
+the following chapters:
+
+ *note Library Functions::, which provides a number of functions
+meant to be used from main `awk' programs.
+
+ *note Sample Programs::, which provides many sample `awk' programs.
+
+ Reading these two chapters allows you to see `awk' solving real
+problems.
+
+ Part III focuses on features specific to `gawk'. It contains the
+following chapters:
+
*note Internationalization::, describes special features in `gawk'
for translating program messages into different languages at runtime.
@@ -845,11 +1002,17 @@ advanced features. Of particular note are the abilities to have
two-way communications with another process, perform TCP/IP networking,
and profile your `awk' programs.
- *note Library Functions::, and *note Sample Programs::, provide many
-sample `awk' programs. Reading them allows you to see `awk' solving
-real problems.
+ *note Debugger::, describes the `awk' debugger.
+
+ *note Arbitrary Precision Arithmetic::, describes advanced
+arithmetic facilities provided by `gawk'.
+
+ *note Dynamic Extensions::, describes how to add new variables and
+functions to `gawk' by writing extensions in C.
- *note Debugger::, describes the `awk' debugger, `dgawk'.
+ Part IV provides the appendices, the Glossary, and two licenses that
+cover the `gawk' source code and this Info file, respectively. It
+contains the following appendices:
*note Language History::, describes how the `awk' language has
evolved since its first release to present. It also describes how
@@ -861,8 +1024,8 @@ non-POSIX systems. It also describes how to report bugs in `gawk' and
where to get other freely available `awk' implementations.
*note Notes::, describes how to disable `gawk''s extensions, as well
-as how to contribute new code to `gawk', how to write extension
-libraries, and some possible future directions for `gawk' development.
+as how to contribute new code to `gawk', and some possible future
+directions for `gawk' development.
*note Basic Concepts::, provides some very cursory background
material for those who are completely unfamiliar with computer
@@ -1100,10 +1263,12 @@ it is today. It has been and continues to be a pleasure working with
this team of fine people.
John Haque contributed the modifications to convert `gawk' into a
-byte-code interpreter, including the debugger. Stephen Davies
-contributed to the effort to bring the byte-code changes into the
-mainstream code base. Efraim Yawitz contributed the initial text of
-*note Debugger::.
+byte-code interpreter, including the debugger, and the additional
+modifications for support of arbitrary precision arithmetic. Stephen
+Davies contributed to the effort to bring the byte-code changes into
+the mainstream code base. Efraim Yawitz contributed the initial text
+of *note Debugger::. John Haque contributed the initial text of *note
+Arbitrary Precision Arithmetic::.
I would like to thank Brian Kernighan for invaluable assistance
during the testing and debugging of `gawk', and for ongoing help and
@@ -2086,6 +2251,7 @@ this major node that don't interest you right now.
* Environment Variables:: The environment variables `gawk' uses.
* Exit Status:: `gawk''s exit status.
* Include Files:: Including other files into your program.
+* Loading Shared Libraries:: Loading shared libraries into your program.
* Obsolete:: Obsolete Options and/or features.
* Undocumented:: Undocumented Options and Features.
@@ -2143,6 +2309,20 @@ The following list describes options mandated by the POSIX standard:
`awk' program consists of the concatenation the contents of each
specified SOURCE-FILE.
+`-i SOURCE-FILE'
+`--include SOURCE-FILE'
+ Read `awk' source library from SOURCE-FILE. This option is
+ completely equivalent to using the `@include' directive inside
+ your program. This option is very similar to the `-f' option, but
+ there are two important differences. First, when `-i' is used,
+ the program source will not be loaded if it has been previously
+ loaded, whereas the `-f' will always load the file. Second,
+ because this option is intended to be used with code libraries, the
+ `awk' command does not recognize such files as constituting main
+ program input. Thus, after processing an `-i' argument, we still
+ expect to find the main source code via the `-f' option or on the
+ command-line.
+
`-v VAR=VAL'
`--assign VAR=VAL'
Set the variable VAR to the value VAL _before_ execution of the
@@ -2219,6 +2399,15 @@ The following list describes options mandated by the POSIX standard:
particularly easy mistake to make with simple variable names like
`i', `j', etc.)
+`-D[FILE]'
+`--debug=[FILE]'
+ Enable debugging of `awk' programs (*note Debugging::). By
+ default, the debugger reads commands interactively from the
+ terminal. The optional FILE argument allows you to specify a file
+ with a list of commands for the debugger to execute
+ non-interactively. No space is allowed between the `-D' and FILE,
+ if FILE is supplied.
+
`-e PROGRAM-TEXT'
`--source PROGRAM-TEXT'
Provide program source code in the PROGRAM-TEXT. This option
@@ -2261,6 +2450,15 @@ The following list describes options mandated by the POSIX standard:
Print a "usage" message summarizing the short and long style
options that `gawk' accepts and then exit.
+`-l LIB'
+`--load LIB'
+ Load a shared library LIB. This searches for the library using the
+ `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 `dl_load()'. An alternative is to use the `@load'
+ keyword inside the program to load a shared library.
+
`-L [value]'
`--lint[=value]'
Warn about constructs that are dubious or nonportable to other
@@ -2280,6 +2478,12 @@ The following list describes options mandated by the POSIX standard:
inappropriate construct. As `awk' programs are usually short,
doing so is not burdensome.
+`-M'
+`--bignum'
+ Force arbitrary precision arithmetic on numbers. This option has
+ no effect if `gawk' is not compiled to use the GNU MPFR and MP
+ libraries (*note Arbitrary Precision Arithmetic::).
+
`-n'
`--non-decimal-data'
Enable automatic interpretation of octal and hexadecimal values in
@@ -2293,6 +2497,14 @@ The following list describes options mandated by the POSIX standard:
Force the use of the locale's decimal point character when parsing
numeric input data (*note Locales::).
+`-o[FILE]'
+`--pretty-print[=FILE]'
+ Enable pretty-printing of `awk' programs. By default, output
+ program is created in a file named `awkprof.out'. The optional
+ FILE argument allows you to specify a different file name for the
+ output. No space is allowed between the `-o' and FILE, if FILE is
+ supplied.
+
`-O'
`--optimize'
Enable some optimizations on the internal representation of the
@@ -2308,10 +2520,9 @@ The following list describes options mandated by the POSIX standard:
for the profile file. No space is allowed between the `-p' and
FILE, if FILE is supplied.
- When run with `gawk', the profile is just a "pretty printed"
- version of the program. When run with `pgawk', the profile
- contains execution counts for each statement in the program in the
- left margin, and function call counts for each function.
+ The profile contains execution counts for each statement in the
+ program in the left margin, and function call counts for each
+ function.
`-P'
`--posix'
@@ -2345,11 +2556,6 @@ The following list describes options mandated by the POSIX standard:
remains both for backward compatibility, and for use in
combination with the `--traditional' option.
-`-R FILE'
-`--command=FILE'
- `dgawk' only. Read `dgawk' debugger options and commands from
- FILE. *Note Dgawk Info::, for more information.
-
`-S'
`--sandbox'
Disable the `system()' function, input redirections with `getline',
@@ -2529,10 +2735,12 @@ A number of environment variables influence how `gawk' behaves.
* AWKPATH Variable:: Searching directories for `awk'
programs.
+* AWKLIBPATH Variable:: Searching directories for `awk' shared
+ libraries.
* Other Environment Variables:: The environment variables.

-File: gawk.info, Node: AWKPATH Variable, Next: Other Environment Variables, Up: Environment Variables
+File: gawk.info, Node: AWKPATH Variable, Next: AWKLIBPATH Variable, Up: Environment Variables
2.5.1 The `AWKPATH' Environment Variable
----------------------------------------
@@ -2541,9 +2749,9 @@ The previous minor node described how `awk' program files can be named
on the command-line with the `-f' option. In most `awk'
implementations, you must supply a precise path name for each program
file, unless the file is in the current directory. But in `gawk', if
-the file name supplied to the `-f' option does not contain a `/', then
-`gawk' searches a list of directories (called the "search path"), one
-by one, looking for a file with the specified name.
+the file name supplied to the `-f' or `-i' options does not contain a
+`/', then `gawk' searches a list of directories (called the "search
+path"), one by one, looking for a file with the specified name.
The search path is a string consisting of directory names separated by
colons. `gawk' gets its search path from the `AWKPATH' environment
@@ -2556,11 +2764,15 @@ standard directory in the default path and then specified on the
command line with a short file name. Otherwise, the full file name
would have to be typed for each file.
- By using both the `--source' and `-f' options, your command-line
-`awk' programs can use facilities in `awk' library files (*note Library
-Functions::). Path searching is not done if `gawk' is in compatibility
-mode. This is true for both `--traditional' and `--posix'. *Note
-Options::.
+ By using the `-i' option, or the `--source' and `-f' options, your
+command-line `awk' programs can use facilities in `awk' library files
+(*note Library Functions::). Path searching is not done if `gawk' is
+in compatibility mode. This is true for both `--traditional' and
+`--posix'. *Note Options::.
+
+ If the source code is not found after the initial search, the path
+is searched again after adding the default `.awk' suffix to the
+filename.
NOTE: To include the current directory in the path, either place
`.' explicitly in the path or write a null entry in the path. (A
@@ -2591,9 +2803,22 @@ the value of `$(datadir)' generated when `gawk' was configured. You
probably don't need to worry about this, though.

-File: gawk.info, Node: Other Environment Variables, Prev: AWKPATH Variable, Up: Environment Variables
+File: gawk.info, Node: AWKLIBPATH Variable, Next: Other Environment Variables, Prev: AWKPATH Variable, Up: Environment Variables
+
+2.5.2 The `AWKLIBPATH' Environment Variable
+-------------------------------------------
+
+The `AWKLIBPATH' environment variable is similar to the `AWKPATH'
+variable, but it is used to search for shared libraries specified with
+the `-l' option rather than for source files. If the library is not
+found, the path is searched again after adding the appropriate shared
+library suffix for the platform. For example, on GNU/Linux systems,
+the suffix `.so' is used.
-2.5.2 Other Environment Variables
+
+File: gawk.info, Node: Other Environment Variables, Prev: AWKLIBPATH Variable, Up: Environment Variables
+
+2.5.3 Other Environment Variables
---------------------------------
A number of other environment variables affect `gawk''s behavior, but
@@ -2614,6 +2839,10 @@ used by regular users.
milliseconds. On systems that do not support the `usleep()' system
call, the value is rounded up to an integral number of seconds.
+`GAWK_READ_TIMEOUT'
+ Specifies the time, in milliseconds, for `gawk' to wait for input
+ before returning with an error. *Note Read Timeout::.
+
The environment variables in the following list are meant for use by
the `gawk' developers for testing and tuning. They are subject to
change. The variables are:
@@ -2668,7 +2897,7 @@ with the value of the C constant `EXIT_SUCCESS'. This is usually zero.
non-POSIX systems, this value may be mapped to `EXIT_FAILURE'.

-File: gawk.info, Node: Include Files, Next: Obsolete, Prev: Exit Status, Up: Invoking Gawk
+File: gawk.info, Node: Include Files, Next: Loading Shared Libraries, Prev: Exit Status, Up: Invoking Gawk
2.7 Including Other Files Into Your Program
===========================================
@@ -2682,7 +2911,8 @@ into smaller, more manageable pieces, and also lets you reuse common
together `awk' functions, used to carry out specific tasks, into
external files. These files can be used just like function libraries,
using the `@include' keyword in conjunction with the `AWKPATH'
-environment variable.
+environment variable. Note that source files may also be included
+using the `-i' option.
Let's see an example. We'll start with two (trivial) `awk' scripts,
namely `test1' and `test2'. Here is the `test1' script:
@@ -2764,9 +2994,41 @@ always searched first for source files, before searching in `AWKPATH',
and this also applies to files named with `@include'.

-File: gawk.info, Node: Obsolete, Next: Undocumented, Prev: Include Files, Up: Invoking Gawk
+File: gawk.info, Node: Loading Shared Libraries, Next: Obsolete, Prev: Include Files, Up: Invoking Gawk
-2.8 Obsolete Options and/or Features
+2.8 Loading Shared Libraries Into Your Program
+==============================================
+
+This minor node describes a feature that is specific to `gawk'.
+
+ The `@load' keyword can be used to read external `awk' shared
+libraries. This allows you to link in compiled code that may offer
+superior performance and/or give you access to extended capabilities
+not supported by the `awk' language. The `AWKLIBPATH' variable is used
+to search for the shared library. Using `@load' is completely
+equivalent to using the `-l' command-line option.
+
+ If the shared library is not initially found in `AWKLIBPATH', another
+search is conducted after appending the platform's default shared
+library suffix to the filename. For example, on GNU/Linux systems, the
+suffix `.so' is used.
+
+ $ gawk '@load "ordchr"; BEGIN {print chr(65)}'
+ -| A
+
+This is equivalent to the following example:
+
+ $ gawk -lordchr 'BEGIN {print chr(65)}'
+ -| A
+
+For command-line usage, the `-l' option is more convenient, but `@load'
+is useful for embedding inside an `awk' source file that requires
+access to a shared library.
+
+
+File: gawk.info, Node: Obsolete, Next: Undocumented, Prev: Loading Shared Libraries, Up: Invoking Gawk
+
+2.9 Obsolete Options and/or Features
====================================
This minor node describes features and/or command-line options from
@@ -2782,8 +3044,8 @@ worked. As of version 4.0, they are no longer interpreted specially by

File: gawk.info, Node: Undocumented, Prev: Obsolete, Up: Invoking Gawk
-2.9 Undocumented Options and Features
-=====================================
+2.10 Undocumented Options and Features
+======================================
Use the Source, Luke!
Obi-Wan
@@ -3615,6 +3877,7 @@ have to be named on the `awk' command line (*note Getline::).
* Multiple Line:: Reading multi-line records.
* Getline:: Reading files under explicit program control
using the `getline' function.
+* Read Timeout:: Reading input with a timeout.
* Command line directories:: What happens if you put a directory on the
command line.
@@ -4807,7 +5070,7 @@ feature of `RS' does not apply. It does apply to the default field
separator of a single space: `FS = " "'.

-File: gawk.info, Node: Getline, Next: Command line directories, Prev: Multiple Line, Up: Reading Files
+File: gawk.info, Node: Getline, Next: Read Timeout, Prev: Multiple Line, Up: Reading Files
4.9 Explicit Input with `getline'
=================================
@@ -5233,7 +5496,8 @@ File: gawk.info, Node: Getline Summary, Prev: Getline Notes, Up: Getline
*note table-getline-variants:: summarizes the eight variants of
`getline', listing which built-in variables are set by each one, and
-whether the variant is standard or a `gawk' extension.
+whether the variant is standard or a `gawk' extension. Note: for each
+variant, `gawk' sets the `RT' built-in variable.
Variant Effect Standard /
Extension
@@ -5249,12 +5513,104 @@ COMMAND `|& getline' Sets `$0' and `NF' Extension
COMMAND `|& getline' Sets VAR Extension
VAR
-Table 4.1: getline Variants and What They Set
+Table 4.1: `getline' Variants and What They Set
+
+
+File: gawk.info, Node: Read Timeout, Next: Command line directories, Prev: Getline, Up: Reading Files
+
+4.10 Reading Input With A Timeout
+=================================
+
+You may specify a timeout in milliseconds for reading input from a
+terminal, pipe or two-way communication including, TCP/IP sockets. This
+can be done on a per input, command or connection basis, by setting a
+special element in the `PROCINFO' array:
+
+ PROCINFO["input_name", "READ_TIMEOUT"] = TIMEOUT IN MILLISECONDS
+
+ When set, this will cause `gawk' to time out and return failure if
+no data is available to read within the specified timeout period. For
+example, a TCP client can decide to give up on receiving any response
+from the server after a certain amount of time:
+
+ Service = "/inet/tcp/0/localhost/daytime"
+ PROCINFO[Service, "READ_TIMEOUT"] = 100
+ if ((Service |& getline) > 0)
+ print $0
+ else if (ERRNO != "")
+ print ERRNO
+
+ Here is how to read interactively from the terminal(1) without
+waiting for more than five seconds:
+
+ PROCINFO["/dev/stdin", "READ_TIMEOUT"] = 5000
+ while ((getline < "/dev/stdin") > 0)
+ print $0
+
+ `gawk' will terminate the read operation if input does not arrive
+after waiting for the timeout period, return failure and set the
+`ERRNO' variable to an appropriate string value. A negative or zero
+value for the timeout is the same as specifying no timeout at all.
+
+ A timeout can also be set for reading from the terminal in the
+implicit loop that reads input records and matches them against
+patterns, like so:
+
+ $ gawk 'BEGIN { PROCINFO["-", "READ_TIMEOUT"] = 5000 }
+ > { print "You entered: " $0 }'
+ gawk
+ -| You entered: gawk
+
+ In this case, failure to respond within five seconds results in the
+following error message:
+
+ error--> gawk: cmd. line:2: (FILENAME=- FNR=1) fatal: error reading input file `-': Connection timed out
+
+ The timeout can be set or changed at any time, and will take effect
+on the next attempt to read from the input device. In the following
+example, we start with a timeout value of one second, and progressively
+reduce it by one-tenth of a second until we wait indefinitely for the
+input to arrive:
+
+ PROCINFO[Service, "READ_TIMEOUT"] = 1000
+ while ((Service |& getline) > 0) {
+ print $0
+ PROCINFO[S, "READ_TIMEOUT"] -= 100
+ }
+
+ NOTE: You should not assume that the read operation will block
+ exactly after the tenth record has been printed. It is possible
+ that `gawk' will read and buffer more than one record's worth of
+ data the first time. Because of this, changing the value of
+ timeout like in the above example is not very useful.
+
+ If the `PROCINFO' element is not present and the environment
+variable `GAWK_READ_TIMEOUT' exists, `gawk' uses its value to
+initialize the timeout value. The exclusive use of the environment
+variable to specify timeout has the disadvantage of not being able to
+control it on a per command or connection basis.
+
+ `gawk' considers a timeout event to be an error even though the
+attempt to read from the underlying device may succeed in a later
+attempt. This is a limitation, and it also means that you cannot use
+this to multiplex input from two or more sources.
+
+ Assigning a timeout value prevents read operations from blocking
+indefinitely. But bear in mind that there are other ways `gawk' can
+stall waiting for an input device to be ready. A network client can
+sometimes take a long time to establish a connection before it can
+start reading any data, or the attempt to open a FIFO special file for
+reading can block indefinitely until some other process opens it for
+writing.
+
+ ---------- Footnotes ----------
+
+ (1) This assumes that standard input is the keyboard

-File: gawk.info, Node: Command line directories, Prev: Getline, Up: Reading Files
+File: gawk.info, Node: Command line directories, Prev: Read Timeout, Up: Reading Files
-4.10 Directories On The Command Line
+4.11 Directories On The Command Line
====================================
According to the POSIX standard, files named on the `awk' command line
@@ -8329,10 +8685,10 @@ would otherwise be difficult or impossible to perform:
entirely. Otherwise, `gawk' exits with the usual fatal error.
* If you have written extensions that modify the record handling (by
- inserting an "open hook"), you can invoke them at this point,
+ inserting an "input parser"), you can invoke them at this point,
before `gawk' has started processing the file. (This is a _very_
- advanced feature, currently used only by the XMLgawk project
- (http://xmlgawk.sourceforge.net).)
+ advanced feature, currently used only by the `gawkextlib' project
+ (http://gawkextlib.sourceforge.net).)
The `ENDFILE' rule is called when `gawk' has finished processing the
last record in an input file. For the last input file, it will be
@@ -9216,6 +9572,15 @@ specific to `gawk' are marked with a pound sign (`#').
every `print' statement. Its default value is `"\n"', the newline
character. (*Note Output Separators::.)
+`PREC #'
+ The working precision of arbitrary precision floating-point
+ numbers, 53 by default (*note Setting Precision::).
+
+`ROUNDMODE #'
+ The rounding mode to use for arbitrary precision arithmetic on
+ numbers, by default `"N"' (`roundTiesToEven' in the IEEE-754
+ standard) (*note Setting Rounding Mode::).
+
`RS'
This is `awk''s input record separator. Its default value is a
string containing a single newline character, which means that an
@@ -9321,7 +9686,8 @@ with a pound sign (`#').
Some operating systems may not have environment variables. On
such systems, the `ENVIRON' array is empty (except for
- `ENVIRON["AWKPATH"]', *note AWKPATH Variable::).
+ `ENVIRON["AWKPATH"]', *note AWKPATH Variable:: and
+ `ENVIRON["AWKLIBPATH"]', *note AWKLIBPATH Variable::).
`ERRNO #'
If a system error occurs during a redirection for `getline',
@@ -9369,6 +9735,12 @@ with a pound sign (`#').
create or remove fields from the current record. *Note Changing
Fields::.
+`FUNCTAB #'
+ An array whose indices are the names of all the user-defined or
+ extension functions in the program. *NOTE*: The array values
+ cannot currently be used. Also, you may not use the `delete'
+ statement with the `FUNCTAB' array.
+
`NR'
The number of input records `awk' has processed since the
beginning of the program's execution (*note Records::). `NR' is
@@ -9391,6 +9763,32 @@ with a pound sign (`#').
effect, or `"FPAT"' if field matching with `FPAT' is in
effect.
+ `PROCINFO["identifiers"]'
+ A subarray, indexed by the names of all identifiers used in
+ the text of the AWK program. For each identifier, the value
+ of the element is one of the following:
+
+ `"array"'
+ The identifier is an array.
+
+ `"extension"'
+ The identifier is an extension function loaded via
+ `@load'.
+
+ `"scalar"'
+ The identifier is a scalar.
+
+ `"untyped"'
+ The identifier is untyped (could be used as a scalar or
+ array, `gawk' doesn't know yet).
+
+ `"user"'
+ The identifier is a user-defined function.
+
+ The values indicate what `gawk' knows about the identifiers
+ after it has finished parsing the program; they are _not_
+ updated while the program runs.
+
`PROCINFO["gid"]'
The value of the `getgid()' system call.
@@ -9421,6 +9819,23 @@ with a pound sign (`#').
`PROCINFO["version"]'
The version of `gawk'.
+ The following additional elements in the array are available to
+ provide information about the MPFR and GMP libraries if your
+ version of `gawk' supports arbitrary precision numbers (*note
+ Arbitrary Precision Arithmetic::):
+
+ `PROCINFO["mpfr_version"]'
+ The version of the GNU MPFR library.
+
+ `PROCINFO["gmp_version"]'
+ The version of the GNU MP library.
+
+ `PROCINFO["prec_max"]'
+ The maximum precision supported by MPFR.
+
+ `PROCINFO["prec_min"]'
+ The minimum precision required by MPFR.
+
On some systems, there may be elements in the array, `"group1"'
through `"groupN"' for some N. N is the number of supplementary
groups that the process has. Use the `in' operator to test for
@@ -9455,6 +9870,44 @@ with a pound sign (`#').
implementations, or if `gawk' is in compatibility mode (*note
Options::), it is not special.
+`SYMTAB #'
+ An array whose indices are the names of all currently defined
+ global variables and arrays in the program. The array may be used
+ for indirect access to read or write the value of a variable:
+
+ foo = 5
+ SYMTAB["foo"] = 4
+ print foo # prints 4
+
+ The `isarray()' function (*note Type Functions::) may be used to
+ test if an element in `SYMTAB' is an array. Also, you may not use
+ the `delete' statement with the `SYMTAB' array.
+
+ You may use an index for `SYMTAB' that is not a predefined
+ identifer:
+
+ SYMTAB["xxx"] = 5
+ print SYMTAB["xxx"]
+
+ This works as expected: in this case `SYMTAB' acts just like a
+ regular array. The only difference is that you can't then delete
+ `SYMTAB["xxx"]'.
+
+ The `SYMTAB' array is more interesting than it looks. Andrew Schorr
+ points out that it effectively gives `awk' data pointers. Consider
+ his example:
+
+ # Indirect multiply of any variable by amount, return result
+
+ function multiply(variable, amount)
+ {
+ return SYMTAB[variable] *= amount
+ }
+
+ NOTE: In order to avoid severe time-travel paradoxes(2),
+ neither `FUNCTAB' nor `SYMTAB' are available as elements
+ within the `SYMTAB' array.
+
Advanced Notes: Changing `NR' and `FNR'
---------------------------------------
@@ -9484,6 +9937,8 @@ file by resetting `NR' to zero when `FILENAME' changed.
to `"-"', even if there were data files to be processed. This behavior
was incorrect and should not be relied upon in your programs.
+ (2) Not to mention difficult implementation issues.
+

File: gawk.info, Node: ARGC and ARGV, Prev: Auto-set, Up: Built-in Variables
@@ -10494,7 +10949,7 @@ by creating an arbitrary index:
-| a

-File: gawk.info, Node: Functions, Next: Internationalization, Prev: Arrays, Up: Top
+File: gawk.info, Node: Functions, Next: Library Functions, Prev: Arrays, Up: Top
9 Functions
***********
@@ -11315,7 +11770,8 @@ literally. The interpretation of `\' and `&' then becomes as shown in
`\\\\&' `\\&' a literal `\', then the matched text
`\\\\\\&' `\\\&' a literal `\&'
-Table 9.2: 1992 POSIX Rules for sub and gsub Escape Sequence Processing
+Table 9.2: 1992 POSIX Rules for `sub()' and `gsub()' Escape Sequence
+Processing
This appears to solve the problem. Unfortunately, the phrasing of the
standard is unusual. It says, in effect, that `\' turns off the special
@@ -11344,7 +11800,7 @@ table-sub-proposed::.
`\\q' `\q' a literal `\q'
`\\\\' `\\' `\\'
-Table 9.3: Proposed rules for sub and backslash
+Table 9.3: Proposed Rules For `sub()' And Backslash
In a nutshell, at the runtime level, there are now three special
sequences of characters (`\\\&', `\\&' and `\&') whereas historically
@@ -11371,7 +11827,7 @@ rules are presented in *note table-posix-sub::.
`\\q' `\q' a literal `\q'
`\\\\' `\\' `\'
-Table 9.4: POSIX rules for `sub()' and `gsub()'
+Table 9.4: POSIX Rules For `sub()' And `gsub()'
The only case where the difference is noticeable is the last one:
`\\\\' is seen as `\\' and produces `\' instead of `\\'.
@@ -11403,7 +11859,7 @@ the `\' does not, as shown in *note table-gensub-escapes::.
`\\\\\\&' `\\\&' a literal `\&'
`\\q' `\q' a literal `q'
-Table 9.5: Escape Sequence Processing for `gensub()'
+Table 9.5: Escape Sequence Processing For `gensub()'
Because of the complexity of the lexical and runtime level processing
and the special cases for `sub()' and `gsub()', we recommend the use of
@@ -11968,8 +12424,9 @@ again with `10111001' and shift it left by three bits, you end up with
`11001000'. `gawk' provides built-in functions that implement the
bitwise operations just described. They are:
-`and(V1, V2)'
- Return the bitwise AND of the values provided by V1 and V2.
+`and(V1, V2 [, ...])'
+ Return the bitwise AND of the arguments. There must be at least
+ two.
`compl(VAL)'
Return the bitwise complement of VAL.
@@ -11977,14 +12434,15 @@ bitwise operations just described. They are:
`lshift(VAL, COUNT)'
Return the value of VAL, shifted left by COUNT bits.
-`or(V1, V2)'
- Return the bitwise OR of the values provided by V1 and V2.
+`or(V1, V2 [, ...])'
+ Return the bitwise OR of the arguments. There must be at least two.
`rshift(VAL, COUNT)'
Return the value of VAL, shifted right by COUNT bits.
-`xor(V1, V2)'
- Return the bitwise XOR of the values provided by V1 and V2.
+`xor(V1, V2 [, ...])'
+ Return the bitwise XOR of the arguments. There must be at least
+ two.
For all of these functions, first the double precision
floating-point value is converted to the widest C unsigned integer
@@ -12442,6 +12900,42 @@ that `i' is a local variable, not an argument):
foo's i=1
top's i=10
+ Besides scalar values (strings and numbers), you may also have local
+arrays. By using a parameter name as an array, `awk' treats it as an
+array, and it is local to the function. In addition, recursive calls
+create new arrays. Consider this example:
+
+ function some_func(p1, a)
+ {
+ if (p1++ > 3)
+ return
+
+ a[p1] = p1
+
+ some_func(p1)
+
+ printf("At level %d, index %d %s found in a\n",
+ p1, (p1 - 1), (p1 - 1) in a ? "is" : "is not")
+ printf("At level %d, index %d %s found in a\n",
+ p1, p1, p1 in a ? "is" : "is not")
+ print ""
+ }
+
+ BEGIN {
+ some_func(1)
+ }
+
+ When run, this program produces the following output:
+
+ At level 4, index 3 is not found in a
+ At level 4, index 4 is found in a
+
+ At level 3, index 2 is not found in a
+ At level 3, index 3 is found in a
+
+ At level 2, index 1 is not found in a
+ At level 2, index 2 is found in a
+

File: gawk.info, Node: Pass By Value/Reference, Prev: Variable Scope, Up: Function Caveats
@@ -12938,1440 +13432,9 @@ example, in the following case:
`gawk' will look up the actual function to call only once.

-File: gawk.info, Node: Internationalization, Next: Advanced Features, Prev: Functions, Up: Top
-
-10 Internationalization with `gawk'
-***********************************
-
-Once upon a time, computer makers wrote software that worked only in
-English. Eventually, hardware and software vendors noticed that if
-their systems worked in the native languages of non-English-speaking
-countries, they were able to sell more systems. As a result,
-internationalization and localization of programs and software systems
-became a common practice.
-
- For many years, the ability to provide internationalization was
-largely restricted to programs written in C and C++. This major node
-describes the underlying library `gawk' uses for internationalization,
-as well as how `gawk' makes internationalization features available at
-the `awk' program level. Having internationalization available at the
-`awk' level gives software developers additional flexibility--they are
-no longer forced to write in C or C++ when internationalization is a
-requirement.
-
-* Menu:
-
-* I18N and L10N:: Internationalization and Localization.
-* Explaining gettext:: How GNU `gettext' works.
-* Programmer i18n:: Features for the programmer.
-* Translator i18n:: Features for the translator.
-* I18N Example:: A simple i18n example.
-* Gawk I18N:: `gawk' is also internationalized.
-
-
-File: gawk.info, Node: I18N and L10N, Next: Explaining gettext, Up: Internationalization
-
-10.1 Internationalization and Localization
-==========================================
-
-"Internationalization" means writing (or modifying) a program once, in
-such a way that it can use multiple languages without requiring further
-source-code changes. "Localization" means providing the data necessary
-for an internationalized program to work in a particular language.
-Most typically, these terms refer to features such as the language used
-for printing error messages, the language used to read responses, and
-information related to how numerical and monetary values are printed
-and read.
-
-
-File: gawk.info, Node: Explaining gettext, Next: Programmer i18n, Prev: I18N and L10N, Up: Internationalization
-
-10.2 GNU `gettext'
-==================
-
-The facilities in GNU `gettext' focus on messages; strings printed by a
-program, either directly or via formatting with `printf' or
-`sprintf()'.(1)
-
- When using GNU `gettext', each application has its own "text
-domain". This is a unique name, such as `kpilot' or `gawk', that
-identifies the application. A complete application may have multiple
-components--programs written in C or C++, as well as scripts written in
-`sh' or `awk'. All of the components use the same text domain.
-
- To make the discussion concrete, assume we're writing an application
-named `guide'. Internationalization consists of the following steps,
-in this order:
-
- 1. The programmer goes through the source for all of `guide''s
- components and marks each string that is a candidate for
- translation. For example, `"`-F': option required"' is a good
- candidate for translation. A table with strings of option names
- is not (e.g., `gawk''s `--profile' option should remain the same,
- no matter what the local language).
-
- 2. The programmer indicates the application's text domain (`"guide"')
- to the `gettext' library, by calling the `textdomain()' function.
-
- 3. Messages from the application are extracted from the source code
- and collected into a portable object template file (`guide.pot'),
- which lists the strings and their translations. The translations
- are initially empty. The original (usually English) messages
- serve as the key for lookup of the translations.
-
- 4. For each language with a translator, `guide.pot' is copied to a
- portable object file (`.po') and translations are created and
- shipped with the application. For example, there might be a
- `fr.po' for a French translation.
-
- 5. Each language's `.po' file is converted into a binary message
- object (`.mo') file. A message object file contains the original
- messages and their translations in a binary format that allows
- fast lookup of translations at runtime.
-
- 6. When `guide' is built and installed, the binary translation files
- are installed in a standard place.
-
- 7. For testing and development, it is possible to tell `gettext' to
- use `.mo' files in a different directory than the standard one by
- using the `bindtextdomain()' function.
-
- 8. At runtime, `guide' looks up each string via a call to
- `gettext()'. The returned string is the translated string if
- available, or the original string if not.
-
- 9. If necessary, it is possible to access messages from a different
- text domain than the one belonging to the application, without
- having to switch the application's default text domain back and
- forth.
-
- In C (or C++), the string marking and dynamic translation lookup are
-accomplished by wrapping each string in a call to `gettext()':
-
- printf("%s", gettext("Don't Panic!\n"));
-
- The tools that extract messages from source code pull out all
-strings enclosed in calls to `gettext()'.
-
- The GNU `gettext' developers, recognizing that typing `gettext(...)'
-over and over again is both painful and ugly to look at, use the macro
-`_' (an underscore) to make things easier:
-
- /* In the standard header file: */
- #define _(str) gettext(str)
-
- /* In the program text: */
- printf("%s", _("Don't Panic!\n"));
-
-This reduces the typing overhead to just three extra characters per
-string and is considerably easier to read as well.
-
- There are locale "categories" for different types of locale-related
-information. The defined locale categories that `gettext' knows about
-are:
-
-`LC_MESSAGES'
- Text messages. This is the default category for `gettext'
- operations, but it is possible to supply a different one
- explicitly, if necessary. (It is almost never necessary to supply
- a different category.)
-
-`LC_COLLATE'
- Text-collation information; i.e., how different characters and/or
- groups of characters sort in a given language.
-
-`LC_CTYPE'
- Character-type information (alphabetic, digit, upper- or
- lowercase, and so on). This information is accessed via the POSIX
- character classes in regular expressions, such as `/[[:alnum:]]/'
- (*note Regexp Operators::).
-
-`LC_MONETARY'
- Monetary information, such as the currency symbol, and whether the
- symbol goes before or after a number.
-
-`LC_NUMERIC'
- Numeric information, such as which characters to use for the
- decimal point and the thousands separator.(2)
-
-`LC_RESPONSE'
- Response information, such as how "yes" and "no" appear in the
- local language, and possibly other information as well.
-
-`LC_TIME'
- Time- and date-related information, such as 12- or 24-hour clock,
- month printed before or after the day in a date, local month
- abbreviations, and so on.
-
-`LC_ALL'
- All of the above. (Not too useful in the context of `gettext'.)
-
- ---------- Footnotes ----------
-
- (1) For some operating systems, the `gawk' port doesn't support GNU
-`gettext'. Therefore, these features are not available if you are
-using one of those operating systems. Sorry.
-
- (2) Americans use a comma every three decimal places and a period
-for the decimal point, while many Europeans do exactly the opposite:
-1,234.56 versus 1.234,56.
-
-
-File: gawk.info, Node: Programmer i18n, Next: Translator i18n, Prev: Explaining gettext, Up: Internationalization
-
-10.3 Internationalizing `awk' Programs
-======================================
-
-`gawk' provides the following variables and functions for
-internationalization:
-
-`TEXTDOMAIN'
- This variable indicates the application's text domain. For
- compatibility with GNU `gettext', the default value is
- `"messages"'.
-
-`_"your message here"'
- String constants marked with a leading underscore are candidates
- for translation at runtime. String constants without a leading
- underscore are not translated.
-
-`dcgettext(STRING [, DOMAIN [, CATEGORY]])'
- Return the translation of STRING in text domain DOMAIN for locale
- category CATEGORY. The default value for DOMAIN is the current
- value of `TEXTDOMAIN'. The default value for CATEGORY is
- `"LC_MESSAGES"'.
-
- If you supply a value for CATEGORY, it must be a string equal to
- one of the known locale categories described in *note Explaining
- gettext::. You must also supply a text domain. Use `TEXTDOMAIN'
- if you want to use the current domain.
-
- CAUTION: The order of arguments to the `awk' version of the
- `dcgettext()' function is purposely different from the order
- for the C version. The `awk' version's order was chosen to
- be simple and to allow for reasonable `awk'-style default
- arguments.
-
-`dcngettext(STRING1, STRING2, NUMBER [, DOMAIN [, CATEGORY]])'
- Return the plural form used for NUMBER of the translation of
- STRING1 and STRING2 in text domain DOMAIN for locale category
- CATEGORY. STRING1 is the English singular variant of a message,
- and STRING2 the English plural variant of the same message. The
- default value for DOMAIN is the current value of `TEXTDOMAIN'.
- The default value for CATEGORY is `"LC_MESSAGES"'.
-
- The same remarks about argument order as for the `dcgettext()'
- function apply.
-
-`bindtextdomain(DIRECTORY [, DOMAIN])'
- Change the directory in which `gettext' looks for `.mo' files, in
- case they will not or cannot be placed in the standard locations
- (e.g., during testing). Return the directory in which DOMAIN is
- "bound."
-
- The default DOMAIN is the value of `TEXTDOMAIN'. If DIRECTORY is
- the null string (`""'), then `bindtextdomain()' returns the
- current binding for the given DOMAIN.
-
- To use these facilities in your `awk' program, follow the steps
-outlined in *note Explaining gettext::, like so:
-
- 1. Set the variable `TEXTDOMAIN' to the text domain of your program.
- This is best done in a `BEGIN' rule (*note BEGIN/END::), or it can
- also be done via the `-v' command-line option (*note Options::):
-
- BEGIN {
- TEXTDOMAIN = "guide"
- ...
- }
-
- 2. Mark all translatable strings with a leading underscore (`_')
- character. It _must_ be adjacent to the opening quote of the
- string. For example:
-
- print _"hello, world"
- x = _"you goofed"
- printf(_"Number of users is %d\n", nusers)
-
- 3. If you are creating strings dynamically, you can still translate
- them, using the `dcgettext()' built-in function:
-
- message = nusers " users logged in"
- message = dcgettext(message, "adminprog")
- print message
-
- Here, the call to `dcgettext()' supplies a different text domain
- (`"adminprog"') in which to find the message, but it uses the
- default `"LC_MESSAGES"' category.
-
- 4. During development, you might want to put the `.mo' file in a
- private directory for testing. This is done with the
- `bindtextdomain()' built-in function:
-
- BEGIN {
- TEXTDOMAIN = "guide" # our text domain
- if (Testing) {
- # where to find our files
- bindtextdomain("testdir")
- # joe is in charge of adminprog
- bindtextdomain("../joe/testdir", "adminprog")
- }
- ...
- }
-
-
- *Note I18N Example::, for an example program showing the steps to
-create and use translations from `awk'.
-
-
-File: gawk.info, Node: Translator i18n, Next: I18N Example, Prev: Programmer i18n, Up: Internationalization
+File: gawk.info, Node: Library Functions, Next: Sample Programs, Prev: Functions, Up: Top
-10.4 Translating `awk' Programs
-===============================
-
-Once a program's translatable strings have been marked, they must be
-extracted to create the initial `.po' file. As part of translation, it
-is often helpful to rearrange the order in which arguments to `printf'
-are output.
-
- `gawk''s `--gen-pot' command-line option extracts the messages and
-is discussed next. After that, `printf''s ability to rearrange the
-order for `printf' arguments at runtime is covered.
-
-* Menu:
-
-* String Extraction:: Extracting marked strings.
-* Printf Ordering:: Rearranging `printf' arguments.
-* I18N Portability:: `awk'-level portability issues.
-
-
-File: gawk.info, Node: String Extraction, Next: Printf Ordering, Up: Translator i18n
-
-10.4.1 Extracting Marked Strings
---------------------------------
-
-Once your `awk' program is working, and all the strings have been
-marked and you've set (and perhaps bound) the text domain, it is time
-to produce translations. First, use the `--gen-pot' command-line
-option to create the initial `.pot' file:
-
- $ gawk --gen-pot -f guide.awk > guide.pot
-
- When run with `--gen-pot', `gawk' does not execute your program.
-Instead, it parses it as usual and prints all marked strings to
-standard output in the format of a GNU `gettext' Portable Object file.
-Also included in the output are any constant strings that appear as the
-first argument to `dcgettext()' or as the first and second argument to
-`dcngettext()'.(1) *Note I18N Example::, for the full list of steps to
-go through to create and test translations for `guide'.
-
- ---------- Footnotes ----------
-
- (1) The `xgettext' utility that comes with GNU `gettext' can handle
-`.awk' files.
-
-
-File: gawk.info, Node: Printf Ordering, Next: I18N Portability, Prev: String Extraction, Up: Translator i18n
-
-10.4.2 Rearranging `printf' Arguments
--------------------------------------
-
-Format strings for `printf' and `sprintf()' (*note Printf::) present a
-special problem for translation. Consider the following:(1)
-
- printf(_"String `%s' has %d characters\n",
- string, length(string)))
-
- A possible German translation for this might be:
-
- "%d Zeichen lang ist die Zeichenkette `%s'\n"
-
- The problem should be obvious: the order of the format
-specifications is different from the original! Even though `gettext()'
-can return the translated string at runtime, it cannot change the
-argument order in the call to `printf'.
-
- To solve this problem, `printf' format specifiers may have an
-additional optional element, which we call a "positional specifier".
-For example:
-
- "%2$d Zeichen lang ist die Zeichenkette `%1$s'\n"
-
- Here, the positional specifier consists of an integer count, which
-indicates which argument to use, and a `$'. Counts are one-based, and
-the format string itself is _not_ included. Thus, in the following
-example, `string' is the first argument and `length(string)' is the
-second:
-
- $ gawk 'BEGIN {
- > string = "Dont Panic"
- > printf _"%2$d characters live in \"%1$s\"\n",
- > string, length(string)
- > }'
- -| 10 characters live in "Dont Panic"
-
- If present, positional specifiers come first in the format
-specification, before the flags, the field width, and/or the precision.
-
- Positional specifiers can be used with the dynamic field width and
-precision capability:
-
- $ gawk 'BEGIN {
- > printf("%*.*s\n", 10, 20, "hello")
- > printf("%3$*2$.*1$s\n", 20, 10, "hello")
- > }'
- -| hello
- -| hello
-
- NOTE: When using `*' with a positional specifier, the `*' comes
- first, then the integer position, and then the `$'. This is
- somewhat counterintuitive.
-
- `gawk' does not allow you to mix regular format specifiers and those
-with positional specifiers in the same string:
-
- $ gawk 'BEGIN { printf _"%d %3$s\n", 1, 2, "hi" }'
- error--> gawk: cmd. line:1: fatal: must use `count$' on all formats or none
-
- NOTE: There are some pathological cases that `gawk' may fail to
- diagnose. In such cases, the output may not be what you expect.
- It's still a bad idea to try mixing them, even if `gawk' doesn't
- detect it.
-
- Although positional specifiers can be used directly in `awk'
-programs, their primary purpose is to help in producing correct
-translations of format strings into languages different from the one in
-which the program is first written.
-
- ---------- Footnotes ----------
-
- (1) This example is borrowed from the GNU `gettext' manual.
-
-
-File: gawk.info, Node: I18N Portability, Prev: Printf Ordering, Up: Translator i18n
-
-10.4.3 `awk' Portability Issues
--------------------------------
-
-`gawk''s internationalization features were purposely chosen to have as
-little impact as possible on the portability of `awk' programs that use
-them to other versions of `awk'. Consider this program:
-
- BEGIN {
- TEXTDOMAIN = "guide"
- if (Test_Guide) # set with -v
- bindtextdomain("/test/guide/messages")
- print _"don't panic!"
- }
-
-As written, it won't work on other versions of `awk'. However, it is
-actually almost portable, requiring very little change:
-
- * Assignments to `TEXTDOMAIN' won't have any effect, since
- `TEXTDOMAIN' is not special in other `awk' implementations.
-
- * Non-GNU versions of `awk' treat marked strings as the
- concatenation of a variable named `_' with the string following
- it.(1) Typically, the variable `_' has the null string (`""') as
- its value, leaving the original string constant as the result.
-
- * By defining "dummy" functions to replace `dcgettext()',
- `dcngettext()' and `bindtextdomain()', the `awk' program can be
- made to run, but all the messages are output in the original
- language. For example:
-
- function bindtextdomain(dir, domain)
- {
- return dir
- }
-
- function dcgettext(string, domain, category)
- {
- return string
- }
-
- function dcngettext(string1, string2, number, domain, category)
- {
- return (number == 1 ? string1 : string2)
- }
-
- * The use of positional specifications in `printf' or `sprintf()' is
- _not_ portable. To support `gettext()' at the C level, many
- systems' C versions of `sprintf()' do support positional
- specifiers. But it works only if enough arguments are supplied in
- the function call. Many versions of `awk' pass `printf' formats
- and arguments unchanged to the underlying C library version of
- `sprintf()', but only one format and argument at a time. What
- happens if a positional specification is used is anybody's guess.
- However, since the positional specifications are primarily for use
- in _translated_ format strings, and since non-GNU `awk's never
- retrieve the translated string, this should not be a problem in
- practice.
-
- ---------- Footnotes ----------
-
- (1) This is good fodder for an "Obfuscated `awk'" contest.
-
-
-File: gawk.info, Node: I18N Example, Next: Gawk I18N, Prev: Translator i18n, Up: Internationalization
-
-10.5 A Simple Internationalization Example
-==========================================
-
-Now let's look at a step-by-step example of how to internationalize and
-localize a simple `awk' program, using `guide.awk' as our original
-source:
-
- BEGIN {
- TEXTDOMAIN = "guide"
- bindtextdomain(".") # for testing
- print _"Don't Panic"
- print _"The Answer Is", 42
- print "Pardon me, Zaphod who?"
- }
-
-Run `gawk --gen-pot' to create the `.pot' file:
-
- $ gawk --gen-pot -f guide.awk > guide.pot
-
-This produces:
-
- #: guide.awk:4
- msgid "Don't Panic"
- msgstr ""
-
- #: guide.awk:5
- msgid "The Answer Is"
- msgstr ""
-
- This original portable object template file is saved and reused for
-each language into which the application is translated. The `msgid' is
-the original string and the `msgstr' is the translation.
-
- NOTE: Strings not marked with a leading underscore do not appear
- in the `guide.pot' file.
-
- Next, the messages must be translated. Here is a translation to a
-hypothetical dialect of English, called "Mellow":(1)
-
- $ cp guide.pot guide-mellow.po
- ADD TRANSLATIONS TO guide-mellow.po ...
-
-Following are the translations:
-
- #: guide.awk:4
- msgid "Don't Panic"
- msgstr "Hey man, relax!"
-
- #: guide.awk:5
- msgid "The Answer Is"
- msgstr "Like, the scoop is"
-
- The next step is to make the directory to hold the binary message
-object file and then to create the `guide.mo' file. The directory
-layout shown here is standard for GNU `gettext' on GNU/Linux systems.
-Other versions of `gettext' may use a different layout:
-
- $ mkdir en_US en_US/LC_MESSAGES
-
- The `msgfmt' utility does the conversion from human-readable `.po'
-file to machine-readable `.mo' file. By default, `msgfmt' creates a
-file named `messages'. This file must be renamed and placed in the
-proper directory so that `gawk' can find it:
-
- $ msgfmt guide-mellow.po
- $ mv messages en_US/LC_MESSAGES/guide.mo
-
- Finally, we run the program to test it:
-
- $ gawk -f guide.awk
- -| Hey man, relax!
- -| Like, the scoop is 42
- -| Pardon me, Zaphod who?
-
- If the three replacement functions for `dcgettext()', `dcngettext()'
-and `bindtextdomain()' (*note I18N Portability::) are in a file named
-`libintl.awk', then we can run `guide.awk' unchanged as follows:
-
- $ gawk --posix -f guide.awk -f libintl.awk
- -| Don't Panic
- -| The Answer Is 42
- -| Pardon me, Zaphod who?
-
- ---------- Footnotes ----------
-
- (1) Perhaps it would be better if it were called "Hippy." Ah, well.
-
-
-File: gawk.info, Node: Gawk I18N, Prev: I18N Example, Up: Internationalization
-
-10.6 `gawk' Can Speak Your Language
-===================================
-
-`gawk' itself has been internationalized using the GNU `gettext'
-package. (GNU `gettext' is described in complete detail in *note (GNU
-`gettext' utilities)Top:: gettext, GNU gettext tools.) As of this
-writing, the latest version of GNU `gettext' is version 0.18.1
-(ftp://ftp.gnu.org/gnu/gettext/gettext-0.18.1.tar.gz).
-
- If a translation of `gawk''s messages exists, then `gawk' produces
-usage messages, warnings, and fatal errors in the local language.
-
-
-File: gawk.info, Node: Advanced Features, Next: Library Functions, Prev: Internationalization, Up: Top
-
-11 Advanced Features of `gawk'
-******************************
-
- Write documentation as if whoever reads it is a violent psychopath
- who knows where you live.
- Steve English, as quoted by Peter Langston
-
- This major node discusses advanced features in `gawk'. It's a bit
-of a "grab bag" of items that are otherwise unrelated to each other.
-First, a command-line option allows `gawk' to recognize nondecimal
-numbers in input data, not just in `awk' programs. Then, `gawk''s
-special features for sorting arrays are presented. Next, two-way I/O,
-discussed briefly in earlier parts of this Info file, is described in
-full detail, along with the basics of TCP/IP networking. Finally,
-`gawk' can "profile" an `awk' program, making it possible to tune it
-for performance.
-
- *note Dynamic Extensions::, discusses the ability to dynamically add
-new built-in functions to `gawk'. As this feature is still immature
-and likely to change, its description is relegated to an appendix.
-
-* Menu:
-
-* Nondecimal Data:: Allowing nondecimal input data.
-* Array Sorting:: Facilities for controlling array traversal and
- sorting arrays.
-* Two-way I/O:: Two-way communications with another process.
-* TCP/IP Networking:: Using `gawk' for network programming.
-* Profiling:: Profiling your `awk' programs.
-
-
-File: gawk.info, Node: Nondecimal Data, Next: Array Sorting, Up: Advanced Features
-
-11.1 Allowing Nondecimal Input Data
-===================================
-
-If you run `gawk' with the `--non-decimal-data' option, you can have
-nondecimal constants in your input data:
-
- $ echo 0123 123 0x123 |
- > gawk --non-decimal-data '{ printf "%d, %d, %d\n",
- > $1, $2, $3 }'
- -| 83, 123, 291
-
- For this feature to work, write your program so that `gawk' treats
-your data as numeric:
-
- $ echo 0123 123 0x123 | gawk '{ print $1, $2, $3 }'
- -| 0123 123 0x123
-
-The `print' statement treats its expressions as strings. Although the
-fields can act as numbers when necessary, they are still strings, so
-`print' does not try to treat them numerically. You may need to add
-zero to a field to force it to be treated as a number. For example:
-
- $ echo 0123 123 0x123 | gawk --non-decimal-data '
- > { print $1, $2, $3
- > print $1 + 0, $2 + 0, $3 + 0 }'
- -| 0123 123 0x123
- -| 83 123 291
-
- Because it is common to have decimal data with leading zeros, and
-because using this facility could lead to surprising results, the
-default is to leave it disabled. If you want it, you must explicitly
-request it.
-
- CAUTION: _Use of this option is not recommended._ It can break old
- programs very badly. Instead, use the `strtonum()' function to
- convert your data (*note Nondecimal-numbers::). This makes your
- programs easier to write and easier to read, and leads to less
- surprising results.
-
-
-File: gawk.info, Node: Array Sorting, Next: Two-way I/O, Prev: Nondecimal Data, Up: Advanced Features
-
-11.2 Controlling Array Traversal and Array Sorting
-==================================================
-
-`gawk' lets you control the order in which a `for (i in array)' loop
-traverses an array.
-
- In addition, two built-in functions, `asort()' and `asorti()', let
-you sort arrays based on the array values and indices, respectively.
-These two functions also provide control over the sorting criteria used
-to order the elements during sorting.
-
-* Menu:
-
-* Controlling Array Traversal:: How to use PROCINFO["sorted_in"].
-* Array Sorting Functions:: How to use `asort()' and `asorti()'.
-
-
-File: gawk.info, Node: Controlling Array Traversal, Next: Array Sorting Functions, Up: Array Sorting
-
-11.2.1 Controlling Array Traversal
-----------------------------------
-
-By default, the order in which a `for (i in array)' loop scans an array
-is not defined; it is generally based upon the internal implementation
-of arrays inside `awk'.
-
- Often, though, it is desirable to be able to loop over the elements
-in a particular order that you, the programmer, choose. `gawk' lets
-you do this.
-
- *note Controlling Scanning::, describes how you can assign special,
-pre-defined values to `PROCINFO["sorted_in"]' in order to control the
-order in which `gawk' will traverse an array during a `for' loop.
-
- In addition, the value of `PROCINFO["sorted_in"]' can be a function
-name. This lets you traverse an array based on any custom criterion.
-The array elements are ordered according to the return value of this
-function. The comparison function should be defined with at least four
-arguments:
-
- function comp_func(i1, v1, i2, v2)
- {
- COMPARE ELEMENTS 1 AND 2 IN SOME FASHION
- RETURN < 0; 0; OR > 0
- }
-
- Here, I1 and I2 are the indices, and V1 and V2 are the corresponding
-values of the two elements being compared. Either V1 or V2, or both,
-can be arrays if the array being traversed contains subarrays as values.
-(*Note Arrays of Arrays::, for more information about subarrays.) The
-three possible return values are interpreted as follows:
-
-`comp_func(i1, v1, i2, v2) < 0'
- Index I1 comes before index I2 during loop traversal.
-
-`comp_func(i1, v1, i2, v2) == 0'
- Indices I1 and I2 come together but the relative order with
- respect to each other is undefined.
-
-`comp_func(i1, v1, i2, v2) > 0'
- Index I1 comes after index I2 during loop traversal.
-
- Our first comparison function can be used to scan an array in
-numerical order of the indices:
-
- function cmp_num_idx(i1, v1, i2, v2)
- {
- # numerical index comparison, ascending order
- return (i1 - i2)
- }
-
- Our second function traverses an array based on the string order of
-the element values rather than by indices:
-
- function cmp_str_val(i1, v1, i2, v2)
- {
- # string value comparison, ascending order
- v1 = v1 ""
- v2 = v2 ""
- if (v1 < v2)
- return -1
- return (v1 != v2)
- }
-
- The third comparison function makes all numbers, and numeric strings
-without any leading or trailing spaces, come out first during loop
-traversal:
-
- function cmp_num_str_val(i1, v1, i2, v2, n1, n2)
- {
- # numbers before string value comparison, ascending order
- n1 = v1 + 0
- n2 = v2 + 0
- if (n1 == v1)
- return (n2 == v2) ? (n1 - n2) : -1
- else if (n2 == v2)
- return 1
- return (v1 < v2) ? -1 : (v1 != v2)
- }
-
- Here is a main program to demonstrate how `gawk' behaves using each
-of the previous functions:
-
- BEGIN {
- data["one"] = 10
- data["two"] = 20
- data[10] = "one"
- data[100] = 100
- data[20] = "two"
-
- f[1] = "cmp_num_idx"
- f[2] = "cmp_str_val"
- f[3] = "cmp_num_str_val"
- for (i = 1; i <= 3; i++) {
- printf("Sort function: %s\n", f[i])
- PROCINFO["sorted_in"] = f[i]
- for (j in data)
- printf("\tdata[%s] = %s\n", j, data[j])
- print ""
- }
- }
-
- Here are the results when the program is run:
-
- $ gawk -f compdemo.awk
- -| Sort function: cmp_num_idx Sort by numeric index
- -| data[two] = 20
- -| data[one] = 10 Both strings are numerically zero
- -| data[10] = one
- -| data[20] = two
- -| data[100] = 100
- -|
- -| Sort function: cmp_str_val Sort by element values as strings
- -| data[one] = 10
- -| data[100] = 100 String 100 is less than string 20
- -| data[two] = 20
- -| data[10] = one
- -| data[20] = two
- -|
- -| Sort function: cmp_num_str_val Sort all numeric values before all strings
- -| data[one] = 10
- -| data[two] = 20
- -| data[100] = 100
- -| data[10] = one
- -| data[20] = two
-
- Consider sorting the entries of a GNU/Linux system password file
-according to login name. The following program sorts records by a
-specific field position and can be used for this purpose:
-
- # sort.awk --- simple program to sort by field position
- # field position is specified by the global variable POS
-
- function cmp_field(i1, v1, i2, v2)
- {
- # comparison by value, as string, and ascending order
- return v1[POS] < v2[POS] ? -1 : (v1[POS] != v2[POS])
- }
-
- {
- for (i = 1; i <= NF; i++)
- a[NR][i] = $i
- }
-
- END {
- PROCINFO["sorted_in"] = "cmp_field"
- if (POS < 1 || POS > NF)
- POS = 1
- for (i in a) {
- for (j = 1; j <= NF; j++)
- printf("%s%c", a[i][j], j < NF ? ":" : "")
- print ""
- }
- }
-
- The first field in each entry of the password file is the user's
-login name, and the fields are separated by colons. Each record
-defines a subarray, with each field as an element in the subarray.
-Running the program produces the following output:
-
- $ gawk -vPOS=1 -F: -f sort.awk /etc/passwd
- -| adm:x:3:4:adm:/var/adm:/sbin/nologin
- -| apache:x:48:48:Apache:/var/www:/sbin/nologin
- -| avahi:x:70:70:Avahi daemon:/:/sbin/nologin
- ...
-
- The comparison should normally always return the same value when
-given a specific pair of array elements as its arguments. If
-inconsistent results are returned then the order is undefined. This
-behavior can be exploited to introduce random order into otherwise
-seemingly ordered data:
-
- function cmp_randomize(i1, v1, i2, v2)
- {
- # random order
- return (2 - 4 * rand())
- }
-
- As mentioned above, the order of the indices is arbitrary if two
-elements compare equal. This is usually not a problem, but letting the
-tied elements come out in arbitrary order can be an issue, especially
-when comparing item values. The partial ordering of the equal elements
-may change during the next loop traversal, if other elements are added
-or removed from the array. One way to resolve ties when comparing
-elements with otherwise equal values is to include the indices in the
-comparison rules. Note that doing this may make the loop traversal
-less efficient, so consider it only if necessary. The following
-comparison functions force a deterministic order, and are based on the
-fact that the indices of two elements are never equal:
-
- function cmp_numeric(i1, v1, i2, v2)
- {
- # numerical value (and index) comparison, descending order
- return (v1 != v2) ? (v2 - v1) : (i2 - i1)
- }
-
- function cmp_string(i1, v1, i2, v2)
- {
- # string value (and index) comparison, descending order
- v1 = v1 i1
- v2 = v2 i2
- return (v1 > v2) ? -1 : (v1 != v2)
- }
-
- A custom comparison function can often simplify ordered loop
-traversal, and the sky is really the limit when it comes to designing
-such a function.
-
- When string comparisons are made during a sort, either for element
-values where one or both aren't numbers, or for element indices handled
-as strings, the value of `IGNORECASE' (*note Built-in Variables::)
-controls whether the comparisons treat corresponding uppercase and
-lowercase letters as equivalent or distinct.
-
- Another point to keep in mind is that in the case of subarrays the
-element values can themselves be arrays; a production comparison
-function should use the `isarray()' function (*note Type Functions::),
-to check for this, and choose a defined sorting order for subarrays.
-
- All sorting based on `PROCINFO["sorted_in"]' is disabled in POSIX
-mode, since the `PROCINFO' array is not special in that case.
-
- As a side note, sorting the array indices before traversing the
-array has been reported to add 15% to 20% overhead to the execution
-time of `awk' programs. For this reason, sorted array traversal is not
-the default.
-
-
-File: gawk.info, Node: Array Sorting Functions, Prev: Controlling Array Traversal, Up: Array Sorting
-
-11.2.2 Sorting Array Values and Indices with `gawk'
----------------------------------------------------
-
-In most `awk' implementations, sorting an array requires writing a
-`sort()' function. While this can be educational for exploring
-different sorting algorithms, usually that's not the point of the
-program. `gawk' provides the built-in `asort()' and `asorti()'
-functions (*note String Functions::) for sorting arrays. For example:
-
- POPULATE THE ARRAY data
- n = asort(data)
- for (i = 1; i <= n; i++)
- DO SOMETHING WITH data[i]
-
- After the call to `asort()', the array `data' is indexed from 1 to
-some number N, the total number of elements in `data'. (This count is
-`asort()''s return value.) `data[1]' <= `data[2]' <= `data[3]', and so
-on. The comparison is based on the type of the elements (*note Typing
-and Comparison::). All numeric values come before all string values,
-which in turn come before all subarrays.
-
- An important side effect of calling `asort()' is that _the array's
-original indices are irrevocably lost_. As this isn't always
-desirable, `asort()' accepts a second argument:
-
- POPULATE THE ARRAY source
- n = asort(source, dest)
- for (i = 1; i <= n; i++)
- DO SOMETHING WITH dest[i]
-
- In this case, `gawk' copies the `source' array into the `dest' array
-and then sorts `dest', destroying its indices. However, the `source'
-array is not affected.
-
- `asort()' accepts a third string argument to control comparison of
-array elements. As with `PROCINFO["sorted_in"]', this argument may be
-one of the predefined names that `gawk' provides (*note Controlling
-Scanning::), or the name of a user-defined function (*note Controlling
-Array Traversal::).
-
- NOTE: In all cases, the sorted element values consist of the
- original array's element values. The ability to control
- comparison merely affects the way in which they are sorted.
-
- Often, what's needed is to sort on the values of the _indices_
-instead of the values of the elements. To do that, use the `asorti()'
-function. The interface is identical to that of `asort()', except that
-the index values are used for sorting, and become the values of the
-result array:
-
- { source[$0] = some_func($0) }
-
- END {
- n = asorti(source, dest)
- for (i = 1; i <= n; i++) {
- Work with sorted indices directly:
- DO SOMETHING WITH dest[i]
- ...
- Access original array via sorted indices:
- DO SOMETHING WITH source[dest[i]]
- }
- }
-
- Similar to `asort()', in all cases, the sorted element values
-consist of the original array's indices. The ability to control
-comparison merely affects the way in which they are sorted.
-
- Sorting the array by replacing the indices provides maximal
-flexibility. To traverse the elements in decreasing order, use a loop
-that goes from N down to 1, either over the elements or over the
-indices.(1)
-
- Copying array indices and elements isn't expensive in terms of
-memory. Internally, `gawk' maintains "reference counts" to data. For
-example, when `asort()' copies the first array to the second one, there
-is only one copy of the original array elements' data, even though both
-arrays use the values.
-
- Because `IGNORECASE' affects string comparisons, the value of
-`IGNORECASE' also affects sorting for both `asort()' and `asorti()'.
-Note also that the locale's sorting order does _not_ come into play;
-comparisons are based on character values only.(2) Caveat Emptor.
-
- ---------- Footnotes ----------
-
- (1) You may also use one of the predefined sorting names that sorts
-in decreasing order.
-
- (2) This is true because locale-based comparison occurs only when in
-POSIX compatibility mode, and since `asort()' and `asorti()' are `gawk'
-extensions, they are not available in that case.
-
-
-File: gawk.info, Node: Two-way I/O, Next: TCP/IP Networking, Prev: Array Sorting, Up: Advanced Features
-
-11.3 Two-Way Communications with Another Process
-================================================
-
- From: brennan@whidbey.com (Mike Brennan)
- Newsgroups: comp.lang.awk
- Subject: Re: Learn the SECRET to Attract Women Easily
- Date: 4 Aug 1997 17:34:46 GMT
- Message-ID: <5s53rm$eca@news.whidbey.com>
-
- On 3 Aug 1997 13:17:43 GMT, Want More Dates???
- <tracy78@kilgrona.com> wrote:
- >Learn the SECRET to Attract Women Easily
- >
- >The SCENT(tm) Pheromone Sex Attractant For Men to Attract Women
-
- The scent of awk programmers is a lot more attractive to women than
- the scent of perl programmers.
- --
- Mike Brennan
-
- It is often useful to be able to send data to a separate program for
-processing and then read the result. This can always be done with
-temporary files:
-
- # Write the data for processing
- tempfile = ("mydata." PROCINFO["pid"])
- while (NOT DONE WITH DATA)
- print DATA | ("subprogram > " tempfile)
- close("subprogram > " tempfile)
-
- # Read the results, remove tempfile when done
- while ((getline newdata < tempfile) > 0)
- PROCESS newdata APPROPRIATELY
- close(tempfile)
- system("rm " tempfile)
-
-This works, but not elegantly. Among other things, it requires that
-the program be run in a directory that cannot be shared among users;
-for example, `/tmp' will not do, as another user might happen to be
-using a temporary file with the same name.
-
- However, with `gawk', it is possible to open a _two-way_ pipe to
-another process. The second process is termed a "coprocess", since it
-runs in parallel with `gawk'. The two-way connection is created using
-the `|&' operator (borrowed from the Korn shell, `ksh'):(1)
-
- do {
- print DATA |& "subprogram"
- "subprogram" |& getline results
- } while (DATA LEFT TO PROCESS)
- close("subprogram")
-
- The first time an I/O operation is executed using the `|&' operator,
-`gawk' creates a two-way pipeline to a child process that runs the
-other program. Output created with `print' or `printf' is written to
-the program's standard input, and output from the program's standard
-output can be read by the `gawk' program using `getline'. As is the
-case with processes started by `|', the subprogram can be any program,
-or pipeline of programs, that can be started by the shell.
-
- There are some cautionary items to be aware of:
-
- * As the code inside `gawk' currently stands, the coprocess's
- standard error goes to the same place that the parent `gawk''s
- standard error goes. It is not possible to read the child's
- standard error separately.
-
- * I/O buffering may be a problem. `gawk' automatically flushes all
- output down the pipe to the coprocess. However, if the coprocess
- does not flush its output, `gawk' may hang when doing a `getline'
- in order to read the coprocess's results. This could lead to a
- situation known as "deadlock", where each process is waiting for
- the other one to do something.
-
- It is possible to close just one end of the two-way pipe to a
-coprocess, by supplying a second argument to the `close()' function of
-either `"to"' or `"from"' (*note Close Files And Pipes::). These
-strings tell `gawk' to close the end of the pipe that sends data to the
-coprocess or the end that reads from it, respectively.
-
- This is particularly necessary in order to use the system `sort'
-utility as part of a coprocess; `sort' must read _all_ of its input
-data before it can produce any output. The `sort' program does not
-receive an end-of-file indication until `gawk' closes the write end of
-the pipe.
-
- When you have finished writing data to the `sort' utility, you can
-close the `"to"' end of the pipe, and then start reading sorted data
-via `getline'. For example:
-
- BEGIN {
- command = "LC_ALL=C sort"
- n = split("abcdefghijklmnopqrstuvwxyz", a, "")
-
- for (i = n; i > 0; i--)
- print a[i] |& command
- close(command, "to")
-
- while ((command |& getline line) > 0)
- print "got", line
- close(command)
- }
-
- This program writes the letters of the alphabet in reverse order, one
-per line, down the two-way pipe to `sort'. It then closes the write
-end of the pipe, so that `sort' receives an end-of-file indication.
-This causes `sort' to sort the data and write the sorted data back to
-the `gawk' program. Once all of the data has been read, `gawk'
-terminates the coprocess and exits.
-
- As a side note, the assignment `LC_ALL=C' in the `sort' command
-ensures traditional Unix (ASCII) sorting from `sort'.
-
- You may also use pseudo-ttys (ptys) for two-way communication
-instead of pipes, if your system supports them. This is done on a
-per-command basis, by setting a special element in the `PROCINFO' array
-(*note Auto-set::), like so:
-
- command = "sort -nr" # command, save in convenience variable
- PROCINFO[command, "pty"] = 1 # update PROCINFO
- print ... |& command # start two-way pipe
- ...
-
-Using ptys avoids the buffer deadlock issues described earlier, at some
-loss in performance. If your system does not have ptys, or if all the
-system's ptys are in use, `gawk' automatically falls back to using
-regular pipes.
-
- ---------- Footnotes ----------
-
- (1) This is very different from the same operator in the C shell.
-
-
-File: gawk.info, Node: TCP/IP Networking, Next: Profiling, Prev: Two-way I/O, Up: Advanced Features
-
-11.4 Using `gawk' for Network Programming
-=========================================
-
- `EMISTERED':
- A host is a host from coast to coast,
- and no-one can talk to host that's close,
- unless the host that isn't close
- is busy hung or dead.
-
- In addition to being able to open a two-way pipeline to a coprocess
-on the same system (*note Two-way I/O::), it is possible to make a
-two-way connection to another process on another system across an IP
-network connection.
-
- You can think of this as just a _very long_ two-way pipeline to a
-coprocess. The way `gawk' decides that you want to use TCP/IP
-networking is by recognizing special file names that begin with one of
-`/inet/', `/inet4/' or `/inet6'.
-
- The full syntax of the special file name is
-`/NET-TYPE/PROTOCOL/LOCAL-PORT/REMOTE-HOST/REMOTE-PORT'. The
-components are:
-
-NET-TYPE
- Specifies the kind of Internet connection to make. Use `/inet4/'
- to force IPv4, and `/inet6/' to force IPv6. Plain `/inet/' (which
- used to be the only option) uses the system default, most likely
- IPv4.
-
-PROTOCOL
- The protocol to use over IP. This must be either `tcp', or `udp',
- for a TCP or UDP IP connection, respectively. The use of TCP is
- recommended for most applications.
-
-LOCAL-PORT
- The local TCP or UDP port number to use. Use a port number of `0'
- when you want the system to pick a port. This is what you should do
- when writing a TCP or UDP client. You may also use a well-known
- service name, such as `smtp' or `http', in which case `gawk'
- attempts to determine the predefined port number using the C
- `getaddrinfo()' function.
-
-REMOTE-HOST
- The IP address or fully-qualified domain name of the Internet host
- to which you want to connect.
-
-REMOTE-PORT
- The TCP or UDP port number to use on the given REMOTE-HOST.
- Again, use `0' if you don't care, or else a well-known service
- name.
-
- NOTE: Failure in opening a two-way socket will result in a
- non-fatal error being returned to the calling code. The value of
- `ERRNO' indicates the error (*note Auto-set::).
-
- Consider the following very simple example:
-
- BEGIN {
- Service = "/inet/tcp/0/localhost/daytime"
- Service |& getline
- print $0
- close(Service)
- }
-
- This program reads the current date and time from the local system's
-TCP `daytime' server. It then prints the results and closes the
-connection.
-
- Because this topic is extensive, the use of `gawk' for TCP/IP
-programming is documented separately. See *note (General
-Introduction)Top:: gawkinet, TCP/IP Internetworking with `gawk', for a
-much more complete introduction and discussion, as well as extensive
-examples.
-
-
-File: gawk.info, Node: Profiling, Prev: TCP/IP Networking, Up: Advanced Features
-
-11.5 Profiling Your `awk' Programs
-==================================
-
-You may produce execution traces of your `awk' programs. This is done
-with a specially compiled version of `gawk', called `pgawk' ("profiling
-`gawk'").
-
- `pgawk' is identical in every way to `gawk', except that when it has
-finished running, it creates a profile of your program in a file named
-`awkprof.out'. Because it is profiling, it also executes up to 45%
-slower than `gawk' normally does.
-
- As shown in the following example, the `--profile' option can be
-used to change the name of the file where `pgawk' will write the
-profile:
-
- pgawk --profile=myprog.prof -f myprog.awk data1 data2
-
-In the above example, `pgawk' places the profile in `myprog.prof'
-instead of in `awkprof.out'.
-
- Here is a sample session showing a simple `awk' program, its input
-data, and the results from running `pgawk'. First, the `awk' program:
-
- BEGIN { print "First BEGIN rule" }
-
- END { print "First END rule" }
-
- /foo/ {
- print "matched /foo/, gosh"
- for (i = 1; i <= 3; i++)
- sing()
- }
-
- {
- if (/foo/)
- print "if is true"
- else
- print "else is true"
- }
-
- BEGIN { print "Second BEGIN rule" }
-
- END { print "Second END rule" }
-
- function sing( dummy)
- {
- print "I gotta be me!"
- }
-
- Following is the input data:
-
- foo
- bar
- baz
- foo
- junk
-
- Here is the `awkprof.out' that results from running `pgawk' on this
-program and data (this example also illustrates that `awk' programmers
-sometimes have to work late):
-
- # gawk profile, created Sun Aug 13 00:00:15 2000
-
- # BEGIN block(s)
-
- BEGIN {
- 1 print "First BEGIN rule"
- 1 print "Second BEGIN rule"
- }
-
- # Rule(s)
-
- 5 /foo/ { # 2
- 2 print "matched /foo/, gosh"
- 6 for (i = 1; i <= 3; i++) {
- 6 sing()
- }
- }
-
- 5 {
- 5 if (/foo/) { # 2
- 2 print "if is true"
- 3 } else {
- 3 print "else is true"
- }
- }
-
- # END block(s)
-
- END {
- 1 print "First END rule"
- 1 print "Second END rule"
- }
-
- # Functions, listed alphabetically
-
- 6 function sing(dummy)
- {
- 6 print "I gotta be me!"
- }
-
- This example illustrates many of the basic features of profiling
-output. They are as follows:
-
- * The program is printed in the order `BEGIN' rule, `BEGINFILE' rule,
- pattern/action rules, `ENDFILE' rule, `END' rule and functions,
- listed alphabetically. Multiple `BEGIN' and `END' rules are
- merged together, as are multiple `BEGINFILE' and `ENDFILE' rules.
-
- * Pattern-action rules have two counts. The first count, to the
- left of the rule, shows how many times the rule's pattern was
- _tested_. The second count, to the right of the rule's opening
- left brace in a comment, shows how many times the rule's action
- was _executed_. The difference between the two indicates how many
- times the rule's pattern evaluated to false.
-
- * Similarly, the count for an `if'-`else' statement shows how many
- times the condition was tested. To the right of the opening left
- brace for the `if''s body is a count showing how many times the
- condition was true. The count for the `else' indicates how many
- times the test failed.
-
- * The count for a loop header (such as `for' or `while') shows how
- many times the loop test was executed. (Because of this, you
- can't just look at the count on the first statement in a rule to
- determine how many times the rule was executed. If the first
- statement is a loop, the count is misleading.)
-
- * For user-defined functions, the count next to the `function'
- keyword indicates how many times the function was called. The
- counts next to the statements in the body show how many times
- those statements were executed.
-
- * The layout uses "K&R" style with TABs. Braces are used
- everywhere, even when the body of an `if', `else', or loop is only
- a single statement.
-
- * Parentheses are used only where needed, as indicated by the
- structure of the program and the precedence rules. For example,
- `(3 + 5) * 4' means add three plus five, then multiply the total
- by four. However, `3 + 5 * 4' has no parentheses, and means `3 +
- (5 * 4)'.
-
- * Parentheses are used around the arguments to `print' and `printf'
- only when the `print' or `printf' statement is followed by a
- redirection. Similarly, if the target of a redirection isn't a
- scalar, it gets parenthesized.
-
- * `pgawk' supplies leading comments in front of the `BEGIN' and
- `END' rules, the pattern/action rules, and the functions.
-
-
- The profiled version of your program may not look exactly like what
-you typed when you wrote it. This is because `pgawk' creates the
-profiled version by "pretty printing" its internal representation of
-the program. The advantage to this is that `pgawk' can produce a
-standard representation. The disadvantage is that all source-code
-comments are lost, as are the distinctions among multiple `BEGIN',
-`END', `BEGINFILE', and `ENDFILE' rules. Also, things such as:
-
- /foo/
-
-come out as:
-
- /foo/ {
- print $0
- }
-
-which is correct, but possibly surprising.
-
- Besides creating profiles when a program has completed, `pgawk' can
-produce a profile while it is running. This is useful if your `awk'
-program goes into an infinite loop and you want to see what has been
-executed. To use this feature, run `pgawk' in the background:
-
- $ pgawk -f myprog &
- [1] 13992
-
-The shell prints a job number and process ID number; in this case,
-13992. Use the `kill' command to send the `USR1' signal to `pgawk':
-
- $ kill -USR1 13992
-
-As usual, the profiled version of the program is written to
-`awkprof.out', or to a different file if you use the `--profile' option.
-
- Along with the regular profile, as shown earlier, the profile
-includes a trace of any active functions:
-
- # Function Call Stack:
-
- # 3. baz
- # 2. bar
- # 1. foo
- # -- main --
-
- You may send `pgawk' the `USR1' signal as many times as you like.
-Each time, the profile and function call trace are appended to the
-output profile file.
-
- If you use the `HUP' signal instead of the `USR1' signal, `pgawk'
-produces the profile and the function call trace and then exits.
-
- When `pgawk' runs on MS-Windows systems, it uses the `INT' and
-`QUIT' signals for producing the profile and, in the case of the `INT'
-signal, `pgawk' exits. This is because these systems don't support the
-`kill' command, so the only signals you can deliver to a program are
-those generated by the keyboard. The `INT' signal is generated by the
-`Ctrl-<C>' or `Ctrl-<BREAK>' key, while the `QUIT' signal is generated
-by the `Ctrl-<\>' key.
-
- Finally, regular `gawk' also accepts the `--profile' option. When
-called this way, `gawk' "pretty prints" the program into `awkprof.out',
-without any execution counts.
-
-
-File: gawk.info, Node: Library Functions, Next: Sample Programs, Prev: Advanced Features, Up: Top
-
-12 A Library of `awk' Functions
+10 A Library of `awk' Functions
*******************************
*note User-defined::, describes how to write your own `awk' functions.
@@ -14443,7 +13506,7 @@ contents of the input record.

File: gawk.info, Node: Library Names, Next: General Functions, Up: Library Functions
-12.1 Naming Library Function Global Variables
+10.1 Naming Library Function Global Variables
=============================================
Due to the way the `awk' language evolved, variables are either
@@ -14523,7 +13586,7 @@ verifying this.

File: gawk.info, Node: General Functions, Next: Data File Management, Prev: Library Names, Up: Library Functions
-12.2 General Programming
+10.2 General Programming
========================
This minor node presents a number of functions that are of general
@@ -14541,12 +13604,12 @@ programming use.
* Ordinal Functions:: Functions for using characters as numbers and
vice versa.
* Join Function:: A function to join an array into a string.
-* Gettimeofday Function:: A function to get formatted times.
+* Getlocaltime Function:: A function to get formatted times.

File: gawk.info, Node: Strtonum Function, Next: Assert Function, Up: General Functions
-12.2.1 Converting Strings To Numbers
+10.2.1 Converting Strings To Numbers
------------------------------------
The `strtonum()' function (*note String Functions::) is a `gawk'
@@ -14630,7 +13693,7 @@ be tested with `gawk' and the results compared to the built-in

File: gawk.info, Node: Assert Function, Next: Round Function, Prev: Strtonum Function, Up: General Functions
-12.2.2 Assertions
+10.2.2 Assertions
-----------------
When writing large programs, it is often useful to know that a
@@ -14716,7 +13779,7 @@ rule always ends with an `exit' statement.

File: gawk.info, Node: Round Function, Next: Cliff Random Function, Prev: Assert Function, Up: General Functions
-12.2.3 Rounding Numbers
+10.2.3 Rounding Numbers
-----------------------
The way `printf' and `sprintf()' (*note Printf::) perform rounding
@@ -14762,7 +13825,7 @@ might be useful if your `awk''s `printf' does unbiased rounding:

File: gawk.info, Node: Cliff Random Function, Next: Ordinal Functions, Prev: Round Function, Up: General Functions
-12.2.4 The Cliff Random Number Generator
+10.2.4 The Cliff Random Number Generator
----------------------------------------
The Cliff random number generator
@@ -14791,7 +13854,7 @@ might try using this function instead.

File: gawk.info, Node: Ordinal Functions, Next: Join Function, Prev: Cliff Random Function, Up: General Functions
-12.2.5 Translating Between Characters and Numbers
+10.2.5 Translating Between Characters and Numbers
-------------------------------------------------
One commercial implementation of `awk' supplies a built-in function,
@@ -14887,9 +13950,9 @@ tests such as used here prohibitively expensive.
extensions, you can simplify `_ord_init' to loop from 0 to 255.

-File: gawk.info, Node: Join Function, Next: Gettimeofday Function, Prev: Ordinal Functions, Up: General Functions
+File: gawk.info, Node: Join Function, Next: Getlocaltime Function, Prev: Ordinal Functions, Up: General Functions
-12.2.6 Merging an Array into a String
+10.2.6 Merging an Array into a String
-------------------------------------
When doing string processing, it is often useful to be able to join all
@@ -14934,9 +13997,9 @@ concatenation. The lack of an explicit operator for concatenation
makes string operations more difficult than they really need to be.

-File: gawk.info, Node: Gettimeofday Function, Prev: Join Function, Up: General Functions
+File: gawk.info, Node: Getlocaltime Function, Prev: Join Function, Up: General Functions
-12.2.7 Managing the Time of Day
+10.2.7 Managing the Time of Day
-------------------------------
The `systime()' and `strftime()' functions described in *note Time
@@ -14945,11 +14008,11 @@ with the time of day in human readable form. While `strftime()' is
extensive, the control formats are not necessarily easy to remember or
intuitively obvious when reading a program.
- The following function, `gettimeofday()', populates a user-supplied
+ The following function, `getlocaltime()', populates a user-supplied
array with preformatted time information. It returns a string with the
current time formatted in the same way as the `date' utility:
- # gettimeofday.awk --- get the time of day in a usable format
+ # getlocaltime.awk --- get the time of day in a usable format
# Returns a string in the format of output of date(1)
# Populates the array argument time with individual values:
@@ -14973,7 +14036,7 @@ current time formatted in the same way as the `date' utility:
# time["weeknum"] -- week number, Sunday first day
# time["altweeknum"] -- week number, Monday first day
- function gettimeofday(time, ret, now, i)
+ function getlocaltime(time, ret, now, i)
{
# get time once, avoids unnecessary system calls
now = systime()
@@ -15012,13 +14075,13 @@ current time formatted in the same way as the `date' utility:
The string indices are easier to use and read than the various
formats required by `strftime()'. The `alarm' program presented in
*note Alarm Program::, uses this function. A more general design for
-the `gettimeofday()' function would have allowed the user to supply an
+the `getlocaltime()' function would have allowed the user to supply an
optional timestamp value to use instead of the current time.

File: gawk.info, Node: Data File Management, Next: Getopt Function, Prev: General Functions, Up: Library Functions
-12.3 Data File Management
+10.3 Data File Management
=========================
This minor node presents functions that are useful for managing
@@ -15035,7 +14098,7 @@ command-line data files.

File: gawk.info, Node: Filetrans Function, Next: Rewind Function, Up: Data File Management
-12.3.1 Noting Data File Boundaries
+10.3.1 Noting Data File Boundaries
----------------------------------
The `BEGIN' and `END' rules are each executed exactly once at the
@@ -15133,7 +14196,7 @@ it provides an easy way to do per-file cleanup processing.

File: gawk.info, Node: Rewind Function, Next: File Checking, Prev: Filetrans Function, Up: Data File Management
-12.3.2 Rereading the Current File
+10.3.2 Rereading the Current File
---------------------------------
Another request for a new built-in function was for a `rewind()'
@@ -15175,7 +14238,7 @@ Nextfile Statement::).

File: gawk.info, Node: File Checking, Next: Empty Files, Prev: Rewind Function, Up: Data File Management
-12.3.3 Checking for Readable Data Files
+10.3.3 Checking for Readable Data Files
---------------------------------------
Normally, if you give `awk' a data file that isn't readable, it stops
@@ -15204,7 +14267,7 @@ in the list). See also *note ARGC and ARGV::.

File: gawk.info, Node: Empty Files, Next: Ignoring Assigns, Prev: File Checking, Up: Data File Management
-12.3.4 Checking For Zero-length Files
+10.3.4 Checking For Zero-length Files
-------------------------------------
All known `awk' implementations silently skip over zero-length files.
@@ -15261,7 +14324,7 @@ intervening value in `ARGV' is a variable assignment.

File: gawk.info, Node: Ignoring Assigns, Prev: Empty Files, Up: Data File Management
-12.3.5 Treating Assignments as File Names
+10.3.5 Treating Assignments as File Names
-----------------------------------------
Occasionally, you might not want `awk' to process command-line variable
@@ -15304,7 +14367,7 @@ arguments are left alone.

File: gawk.info, Node: Getopt Function, Next: Passwd Functions, Prev: Data File Management, Up: Library Functions
-12.4 Processing Command-Line Options
+10.4 Processing Command-Line Options
====================================
Most utilities on POSIX compatible systems take options on the command
@@ -15597,7 +14660,7 @@ have left it alone, since using `substr()' is more portable.

File: gawk.info, Node: Passwd Functions, Next: Group Functions, Prev: Getopt Function, Up: Library Functions
-12.5 Reading the User Database
+10.5 Reading the User Database
==============================
The `PROCINFO' array (*note Built-in Variables::) provides access to
@@ -15840,7 +14903,7 @@ network database.

File: gawk.info, Node: Group Functions, Next: Walking Arrays, Prev: Passwd Functions, Up: Library Functions
-12.6 Reading the Group Database
+10.6 Reading the Group Database
===============================
Much of the discussion presented in *note Passwd Functions::, applies
@@ -16074,7 +15137,7 @@ very simple, relying on `awk''s associative arrays to do work.

File: gawk.info, Node: Walking Arrays, Prev: Group Functions, Up: Library Functions
-12.7 Traversing Arrays of Arrays
+10.7 Traversing Arrays of Arrays
================================
*note Arrays of Arrays::, described how `gawk' provides arrays of
@@ -16123,9 +15186,9 @@ value. Here is a main program to demonstrate:
-| a[3] = 3

-File: gawk.info, Node: Sample Programs, Next: Debugger, Prev: Library Functions, Up: Top
+File: gawk.info, Node: Sample Programs, Next: Internationalization, Prev: Library Functions, Up: Top
-13 Practical `awk' Programs
+11 Practical `awk' Programs
***************************
*note Library Functions::, presents the idea that reading programs in a
@@ -16145,7 +15208,7 @@ Library Functions::.

File: gawk.info, Node: Running Examples, Next: Clones, Up: Sample Programs
-13.1 Running the Example Programs
+11.1 Running the Example Programs
=================================
To run a given program, you would typically do something like this:
@@ -16168,7 +15231,7 @@ OPTIONS are any command-line options for the program that start with a

File: gawk.info, Node: Clones, Next: Miscellaneous Programs, Prev: Running Examples, Up: Sample Programs
-13.2 Reinventing Wheels for Fun and Profit
+11.2 Reinventing Wheels for Fun and Profit
==========================================
This minor node presents a number of POSIX utilities implemented in
@@ -16198,7 +15261,7 @@ programming for "real world" tasks.

File: gawk.info, Node: Cut Program, Next: Egrep Program, Up: Clones
-13.2.1 Cutting out Fields and Columns
+11.2.1 Cutting out Fields and Columns
-------------------------------------
The `cut' utility selects, or "cuts," characters or fields from its
@@ -16457,7 +15520,7 @@ solution to the problem of picking the input line apart by characters.

File: gawk.info, Node: Egrep Program, Next: Id Program, Prev: Cut Program, Up: Clones
-13.2.2 Searching for Regular Expressions in Files
+11.2.2 Searching for Regular Expressions in Files
-------------------------------------------------
The `egrep' utility searches files for patterns. It uses regular
@@ -16689,7 +15752,7 @@ the translated line, not the original.

File: gawk.info, Node: Id Program, Next: Split Program, Prev: Egrep Program, Up: Clones
-13.2.3 Printing out User Information
+11.2.3 Printing out User Information
------------------------------------
The `id' utility lists a user's real and effective user ID numbers,
@@ -16796,7 +15859,7 @@ body never executes.

File: gawk.info, Node: Split Program, Next: Tee Program, Prev: Id Program, Up: Clones
-13.2.4 Splitting a Large File into Pieces
+11.2.4 Splitting a Large File into Pieces
-----------------------------------------
The `split' program splits large text files into smaller pieces. Usage
@@ -16904,7 +15967,7 @@ not relevant for what the program aims to demonstrate.

File: gawk.info, Node: Tee Program, Next: Uniq Program, Prev: Split Program, Up: Clones
-13.2.5 Duplicating Output into Multiple Files
+11.2.5 Duplicating Output into Multiple Files
---------------------------------------------
The `tee' program is known as a "pipe fitting." `tee' copies its
@@ -16992,7 +16055,7 @@ N input records and M output files, the first method only executes N

File: gawk.info, Node: Uniq Program, Next: Wc Program, Prev: Tee Program, Up: Clones
-13.2.6 Printing Nonduplicated Lines of Text
+11.2.6 Printing Nonduplicated Lines of Text
-------------------------------------------
The `uniq' utility reads sorted lines of data on its standard input,
@@ -17211,7 +16274,7 @@ line of input data:

File: gawk.info, Node: Wc Program, Prev: Uniq Program, Up: Clones
-13.2.7 Counting Things
+11.2.7 Counting Things
----------------------
The `wc' (word count) utility counts lines, words, and characters in
@@ -17356,7 +16419,7 @@ characters, not bytes.

File: gawk.info, Node: Miscellaneous Programs, Prev: Clones, Up: Sample Programs
-13.3 A Grab Bag of `awk' Programs
+11.3 A Grab Bag of `awk' Programs
=================================
This minor node is a large "grab bag" of miscellaneous programs. We
@@ -17383,7 +16446,7 @@ hope you find them both interesting and enjoyable.

File: gawk.info, Node: Dupword Program, Next: Alarm Program, Up: Miscellaneous Programs
-13.3.1 Finding Duplicated Words in a Document
+11.3.1 Finding Duplicated Words in a Document
---------------------------------------------
A common error when writing large amounts of prose is to accidentally
@@ -17431,7 +16494,7 @@ word, comparing it to the previous one:

File: gawk.info, Node: Alarm Program, Next: Translate Program, Prev: Dupword Program, Up: Miscellaneous Programs
-13.3.2 An Alarm Clock Program
+11.3.2 An Alarm Clock Program
-----------------------------
Nothing cures insomnia like a ringing alarm clock.
@@ -17443,8 +16506,8 @@ prints the message on the standard output. In addition, you can give it
the number of times to repeat the message as well as a delay between
repetitions.
- This program uses the `gettimeofday()' function from *note
-Gettimeofday Function::.
+ This program uses the `getlocaltime()' function from *note
+Getlocaltime Function::.
All the work is done in the `BEGIN' rule. The first part is argument
checking and setting of defaults: the delay, the count, and the message
@@ -17459,7 +16522,7 @@ Statement::), but the processing could be done with a series of
# alarm.awk --- set an alarm
#
- # Requires gettimeofday() library function
+ # Requires getlocaltime() library function
# usage: alarm time [ "message" [ count [ delay ] ] ]
BEGIN \
@@ -17515,7 +16578,7 @@ alarm:
minute = atime[2] + 0 # force numeric
# get current broken down time
- gettimeofday(now)
+ getlocaltime(now)
# if time given is 12-hour hours and it's after that
# hour, e.g., `alarm 5:30' at 9 a.m. means 5:30 p.m.,
@@ -17564,7 +16627,7 @@ necessary:

File: gawk.info, Node: Translate Program, Next: Labels Program, Prev: Alarm Program, Up: Miscellaneous Programs
-13.3.3 Transliterating Characters
+11.3.3 Transliterating Characters
---------------------------------
The system `tr' utility transliterates characters. For example, it is
@@ -17690,7 +16753,7 @@ split each character in a string into separate array elements.

File: gawk.info, Node: Labels Program, Next: Word Sorting, Prev: Translate Program, Up: Miscellaneous Programs
-13.3.4 Printing Mailing Labels
+11.3.4 Printing Mailing Labels
------------------------------
Here is a "real world"(1) program. This script reads lists of names and
@@ -17797,7 +16860,7 @@ something done."

File: gawk.info, Node: Word Sorting, Next: History Sorting, Prev: Labels Program, Up: Miscellaneous Programs
-13.3.5 Generating Word-Usage Counts
+11.3.5 Generating Word-Usage Counts
-----------------------------------
When working with large amounts of text, it can be interesting to know
@@ -17901,7 +16964,7 @@ operating system documentation for more information on how to use the

File: gawk.info, Node: History Sorting, Next: Extract Program, Prev: Word Sorting, Up: Miscellaneous Programs
-13.3.6 Removing Duplicates from Unsorted Text
+11.3.6 Removing Duplicates from Unsorted Text
---------------------------------------------
The `uniq' program (*note Uniq Program::), removes duplicate lines from
@@ -17948,7 +17011,7 @@ seen.

File: gawk.info, Node: Extract Program, Next: Simple Sed, Prev: History Sorting, Up: Miscellaneous Programs
-13.3.7 Extracting Programs from Texinfo Source Files
+11.3.7 Extracting Programs from Texinfo Source Files
----------------------------------------------------
The nodes *note Library Functions::, and *note Sample Programs::, are
@@ -18148,7 +17211,7 @@ function. Consider how you might use it to simplify the code.

File: gawk.info, Node: Simple Sed, Next: Igawk Program, Prev: Extract Program, Up: Miscellaneous Programs
-13.3.8 A Simple Stream Editor
+11.3.8 A Simple Stream Editor
-----------------------------
The `sed' utility is a stream editor, a program that reads a stream of
@@ -18229,7 +17292,7 @@ the single rule handles the printing scheme outlined above, using

File: gawk.info, Node: Igawk Program, Next: Anagram Program, Prev: Simple Sed, Up: Miscellaneous Programs
-13.3.9 An Easy Way to Use Library Functions
+11.3.9 An Easy Way to Use Library Functions
-------------------------------------------
In *note Include Files::, we saw how `gawk' provides a built-in
@@ -18626,7 +17689,7 @@ can loop forever if the file exists but is empty. Caveat emptor.

File: gawk.info, Node: Anagram Program, Next: Signature Program, Prev: Igawk Program, Up: Miscellaneous Programs
-13.3.10 Finding Anagrams From A Dictionary
+11.3.10 Finding Anagrams From A Dictionary
------------------------------------------
An interesting programming challenge is to search for "anagrams" in a
@@ -18716,7 +17779,7 @@ otherwise the anagrams would appear in arbitrary order:

File: gawk.info, Node: Signature Program, Prev: Anagram Program, Up: Miscellaneous Programs
-13.3.11 And Now For Something Completely Different
+11.3.11 And Now For Something Completely Different
--------------------------------------------------
The following program was written by Davide Brini and is published on
@@ -18741,47 +17804,1478 @@ supplies the following copyright terms:
We leave it to you to determine what the program does.

-File: gawk.info, Node: Debugger, Next: Language History, Prev: Sample Programs, Up: Top
+File: gawk.info, Node: Internationalization, Next: Advanced Features, Prev: Sample Programs, Up: Top
+
+12 Internationalization with `gawk'
+***********************************
+
+Once upon a time, computer makers wrote software that worked only in
+English. Eventually, hardware and software vendors noticed that if
+their systems worked in the native languages of non-English-speaking
+countries, they were able to sell more systems. As a result,
+internationalization and localization of programs and software systems
+became a common practice.
+
+ For many years, the ability to provide internationalization was
+largely restricted to programs written in C and C++. This major node
+describes the underlying library `gawk' uses for internationalization,
+as well as how `gawk' makes internationalization features available at
+the `awk' program level. Having internationalization available at the
+`awk' level gives software developers additional flexibility--they are
+no longer forced to write in C or C++ when internationalization is a
+requirement.
+
+* Menu:
+
+* I18N and L10N:: Internationalization and Localization.
+* Explaining gettext:: How GNU `gettext' works.
+* Programmer i18n:: Features for the programmer.
+* Translator i18n:: Features for the translator.
+* I18N Example:: A simple i18n example.
+* Gawk I18N:: `gawk' is also internationalized.
+
+
+File: gawk.info, Node: I18N and L10N, Next: Explaining gettext, Up: Internationalization
+
+12.1 Internationalization and Localization
+==========================================
+
+"Internationalization" means writing (or modifying) a program once, in
+such a way that it can use multiple languages without requiring further
+source-code changes. "Localization" means providing the data necessary
+for an internationalized program to work in a particular language.
+Most typically, these terms refer to features such as the language used
+for printing error messages, the language used to read responses, and
+information related to how numerical and monetary values are printed
+and read.
+
+
+File: gawk.info, Node: Explaining gettext, Next: Programmer i18n, Prev: I18N and L10N, Up: Internationalization
+
+12.2 GNU `gettext'
+==================
+
+The facilities in GNU `gettext' focus on messages; strings printed by a
+program, either directly or via formatting with `printf' or
+`sprintf()'.(1)
+
+ When using GNU `gettext', each application has its own "text
+domain". This is a unique name, such as `kpilot' or `gawk', that
+identifies the application. A complete application may have multiple
+components--programs written in C or C++, as well as scripts written in
+`sh' or `awk'. All of the components use the same text domain.
+
+ To make the discussion concrete, assume we're writing an application
+named `guide'. Internationalization consists of the following steps,
+in this order:
+
+ 1. The programmer goes through the source for all of `guide''s
+ components and marks each string that is a candidate for
+ translation. For example, `"`-F': option required"' is a good
+ candidate for translation. A table with strings of option names
+ is not (e.g., `gawk''s `--profile' option should remain the same,
+ no matter what the local language).
+
+ 2. The programmer indicates the application's text domain (`"guide"')
+ to the `gettext' library, by calling the `textdomain()' function.
+
+ 3. Messages from the application are extracted from the source code
+ and collected into a portable object template file (`guide.pot'),
+ which lists the strings and their translations. The translations
+ are initially empty. The original (usually English) messages
+ serve as the key for lookup of the translations.
+
+ 4. For each language with a translator, `guide.pot' is copied to a
+ portable object file (`.po') and translations are created and
+ shipped with the application. For example, there might be a
+ `fr.po' for a French translation.
+
+ 5. Each language's `.po' file is converted into a binary message
+ object (`.mo') file. A message object file contains the original
+ messages and their translations in a binary format that allows
+ fast lookup of translations at runtime.
+
+ 6. When `guide' is built and installed, the binary translation files
+ are installed in a standard place.
+
+ 7. For testing and development, it is possible to tell `gettext' to
+ use `.mo' files in a different directory than the standard one by
+ using the `bindtextdomain()' function.
+
+ 8. At runtime, `guide' looks up each string via a call to
+ `gettext()'. The returned string is the translated string if
+ available, or the original string if not.
+
+ 9. If necessary, it is possible to access messages from a different
+ text domain than the one belonging to the application, without
+ having to switch the application's default text domain back and
+ forth.
+
+ In C (or C++), the string marking and dynamic translation lookup are
+accomplished by wrapping each string in a call to `gettext()':
+
+ printf("%s", gettext("Don't Panic!\n"));
+
+ The tools that extract messages from source code pull out all
+strings enclosed in calls to `gettext()'.
+
+ The GNU `gettext' developers, recognizing that typing `gettext(...)'
+over and over again is both painful and ugly to look at, use the macro
+`_' (an underscore) to make things easier:
+
+ /* In the standard header file: */
+ #define _(str) gettext(str)
+
+ /* In the program text: */
+ printf("%s", _("Don't Panic!\n"));
+
+This reduces the typing overhead to just three extra characters per
+string and is considerably easier to read as well.
+
+ There are locale "categories" for different types of locale-related
+information. The defined locale categories that `gettext' knows about
+are:
+
+`LC_MESSAGES'
+ Text messages. This is the default category for `gettext'
+ operations, but it is possible to supply a different one
+ explicitly, if necessary. (It is almost never necessary to supply
+ a different category.)
+
+`LC_COLLATE'
+ Text-collation information; i.e., how different characters and/or
+ groups of characters sort in a given language.
+
+`LC_CTYPE'
+ Character-type information (alphabetic, digit, upper- or
+ lowercase, and so on). This information is accessed via the POSIX
+ character classes in regular expressions, such as `/[[:alnum:]]/'
+ (*note Regexp Operators::).
+
+`LC_MONETARY'
+ Monetary information, such as the currency symbol, and whether the
+ symbol goes before or after a number.
+
+`LC_NUMERIC'
+ Numeric information, such as which characters to use for the
+ decimal point and the thousands separator.(2)
+
+`LC_RESPONSE'
+ Response information, such as how "yes" and "no" appear in the
+ local language, and possibly other information as well.
+
+`LC_TIME'
+ Time- and date-related information, such as 12- or 24-hour clock,
+ month printed before or after the day in a date, local month
+ abbreviations, and so on.
+
+`LC_ALL'
+ All of the above. (Not too useful in the context of `gettext'.)
+
+ ---------- Footnotes ----------
+
+ (1) For some operating systems, the `gawk' port doesn't support GNU
+`gettext'. Therefore, these features are not available if you are
+using one of those operating systems. Sorry.
+
+ (2) Americans use a comma every three decimal places and a period
+for the decimal point, while many Europeans do exactly the opposite:
+1,234.56 versus 1.234,56.
+
+
+File: gawk.info, Node: Programmer i18n, Next: Translator i18n, Prev: Explaining gettext, Up: Internationalization
+
+12.3 Internationalizing `awk' Programs
+======================================
+
+`gawk' provides the following variables and functions for
+internationalization:
+
+`TEXTDOMAIN'
+ This variable indicates the application's text domain. For
+ compatibility with GNU `gettext', the default value is
+ `"messages"'.
+
+`_"your message here"'
+ String constants marked with a leading underscore are candidates
+ for translation at runtime. String constants without a leading
+ underscore are not translated.
+
+`dcgettext(STRING [, DOMAIN [, CATEGORY]])'
+ Return the translation of STRING in text domain DOMAIN for locale
+ category CATEGORY. The default value for DOMAIN is the current
+ value of `TEXTDOMAIN'. The default value for CATEGORY is
+ `"LC_MESSAGES"'.
+
+ If you supply a value for CATEGORY, it must be a string equal to
+ one of the known locale categories described in *note Explaining
+ gettext::. You must also supply a text domain. Use `TEXTDOMAIN'
+ if you want to use the current domain.
+
+ CAUTION: The order of arguments to the `awk' version of the
+ `dcgettext()' function is purposely different from the order
+ for the C version. The `awk' version's order was chosen to
+ be simple and to allow for reasonable `awk'-style default
+ arguments.
+
+`dcngettext(STRING1, STRING2, NUMBER [, DOMAIN [, CATEGORY]])'
+ Return the plural form used for NUMBER of the translation of
+ STRING1 and STRING2 in text domain DOMAIN for locale category
+ CATEGORY. STRING1 is the English singular variant of a message,
+ and STRING2 the English plural variant of the same message. The
+ default value for DOMAIN is the current value of `TEXTDOMAIN'.
+ The default value for CATEGORY is `"LC_MESSAGES"'.
+
+ The same remarks about argument order as for the `dcgettext()'
+ function apply.
+
+`bindtextdomain(DIRECTORY [, DOMAIN])'
+ Change the directory in which `gettext' looks for `.mo' files, in
+ case they will not or cannot be placed in the standard locations
+ (e.g., during testing). Return the directory in which DOMAIN is
+ "bound."
+
+ The default DOMAIN is the value of `TEXTDOMAIN'. If DIRECTORY is
+ the null string (`""'), then `bindtextdomain()' returns the
+ current binding for the given DOMAIN.
+
+ To use these facilities in your `awk' program, follow the steps
+outlined in *note Explaining gettext::, like so:
+
+ 1. Set the variable `TEXTDOMAIN' to the text domain of your program.
+ This is best done in a `BEGIN' rule (*note BEGIN/END::), or it can
+ also be done via the `-v' command-line option (*note Options::):
+
+ BEGIN {
+ TEXTDOMAIN = "guide"
+ ...
+ }
+
+ 2. Mark all translatable strings with a leading underscore (`_')
+ character. It _must_ be adjacent to the opening quote of the
+ string. For example:
+
+ print _"hello, world"
+ x = _"you goofed"
+ printf(_"Number of users is %d\n", nusers)
+
+ 3. If you are creating strings dynamically, you can still translate
+ them, using the `dcgettext()' built-in function:
+
+ message = nusers " users logged in"
+ message = dcgettext(message, "adminprog")
+ print message
+
+ Here, the call to `dcgettext()' supplies a different text domain
+ (`"adminprog"') in which to find the message, but it uses the
+ default `"LC_MESSAGES"' category.
+
+ 4. During development, you might want to put the `.mo' file in a
+ private directory for testing. This is done with the
+ `bindtextdomain()' built-in function:
+
+ BEGIN {
+ TEXTDOMAIN = "guide" # our text domain
+ if (Testing) {
+ # where to find our files
+ bindtextdomain("testdir")
+ # joe is in charge of adminprog
+ bindtextdomain("../joe/testdir", "adminprog")
+ }
+ ...
+ }
+
+
+ *Note I18N Example::, for an example program showing the steps to
+create and use translations from `awk'.
+
+
+File: gawk.info, Node: Translator i18n, Next: I18N Example, Prev: Programmer i18n, Up: Internationalization
+
+12.4 Translating `awk' Programs
+===============================
+
+Once a program's translatable strings have been marked, they must be
+extracted to create the initial `.po' file. As part of translation, it
+is often helpful to rearrange the order in which arguments to `printf'
+are output.
+
+ `gawk''s `--gen-pot' command-line option extracts the messages and
+is discussed next. After that, `printf''s ability to rearrange the
+order for `printf' arguments at runtime is covered.
+
+* Menu:
+
+* String Extraction:: Extracting marked strings.
+* Printf Ordering:: Rearranging `printf' arguments.
+* I18N Portability:: `awk'-level portability issues.
+
+
+File: gawk.info, Node: String Extraction, Next: Printf Ordering, Up: Translator i18n
+
+12.4.1 Extracting Marked Strings
+--------------------------------
+
+Once your `awk' program is working, and all the strings have been
+marked and you've set (and perhaps bound) the text domain, it is time
+to produce translations. First, use the `--gen-pot' command-line
+option to create the initial `.pot' file:
+
+ $ gawk --gen-pot -f guide.awk > guide.pot
+
+ When run with `--gen-pot', `gawk' does not execute your program.
+Instead, it parses it as usual and prints all marked strings to
+standard output in the format of a GNU `gettext' Portable Object file.
+Also included in the output are any constant strings that appear as the
+first argument to `dcgettext()' or as the first and second argument to
+`dcngettext()'.(1) *Note I18N Example::, for the full list of steps to
+go through to create and test translations for `guide'.
+
+ ---------- Footnotes ----------
+
+ (1) The `xgettext' utility that comes with GNU `gettext' can handle
+`.awk' files.
+
+
+File: gawk.info, Node: Printf Ordering, Next: I18N Portability, Prev: String Extraction, Up: Translator i18n
+
+12.4.2 Rearranging `printf' Arguments
+-------------------------------------
+
+Format strings for `printf' and `sprintf()' (*note Printf::) present a
+special problem for translation. Consider the following:(1)
+
+ printf(_"String `%s' has %d characters\n",
+ string, length(string)))
+
+ A possible German translation for this might be:
+
+ "%d Zeichen lang ist die Zeichenkette `%s'\n"
+
+ The problem should be obvious: the order of the format
+specifications is different from the original! Even though `gettext()'
+can return the translated string at runtime, it cannot change the
+argument order in the call to `printf'.
+
+ To solve this problem, `printf' format specifiers may have an
+additional optional element, which we call a "positional specifier".
+For example:
+
+ "%2$d Zeichen lang ist die Zeichenkette `%1$s'\n"
+
+ Here, the positional specifier consists of an integer count, which
+indicates which argument to use, and a `$'. Counts are one-based, and
+the format string itself is _not_ included. Thus, in the following
+example, `string' is the first argument and `length(string)' is the
+second:
+
+ $ gawk 'BEGIN {
+ > string = "Dont Panic"
+ > printf _"%2$d characters live in \"%1$s\"\n",
+ > string, length(string)
+ > }'
+ -| 10 characters live in "Dont Panic"
+
+ If present, positional specifiers come first in the format
+specification, before the flags, the field width, and/or the precision.
+
+ Positional specifiers can be used with the dynamic field width and
+precision capability:
+
+ $ gawk 'BEGIN {
+ > printf("%*.*s\n", 10, 20, "hello")
+ > printf("%3$*2$.*1$s\n", 20, 10, "hello")
+ > }'
+ -| hello
+ -| hello
+
+ NOTE: When using `*' with a positional specifier, the `*' comes
+ first, then the integer position, and then the `$'. This is
+ somewhat counterintuitive.
+
+ `gawk' does not allow you to mix regular format specifiers and those
+with positional specifiers in the same string:
+
+ $ gawk 'BEGIN { printf _"%d %3$s\n", 1, 2, "hi" }'
+ error--> gawk: cmd. line:1: fatal: must use `count$' on all formats or none
+
+ NOTE: There are some pathological cases that `gawk' may fail to
+ diagnose. In such cases, the output may not be what you expect.
+ It's still a bad idea to try mixing them, even if `gawk' doesn't
+ detect it.
+
+ Although positional specifiers can be used directly in `awk'
+programs, their primary purpose is to help in producing correct
+translations of format strings into languages different from the one in
+which the program is first written.
+
+ ---------- Footnotes ----------
+
+ (1) This example is borrowed from the GNU `gettext' manual.
+
+
+File: gawk.info, Node: I18N Portability, Prev: Printf Ordering, Up: Translator i18n
-14 `dgawk': The `awk' Debugger
+12.4.3 `awk' Portability Issues
+-------------------------------
+
+`gawk''s internationalization features were purposely chosen to have as
+little impact as possible on the portability of `awk' programs that use
+them to other versions of `awk'. Consider this program:
+
+ BEGIN {
+ TEXTDOMAIN = "guide"
+ if (Test_Guide) # set with -v
+ bindtextdomain("/test/guide/messages")
+ print _"don't panic!"
+ }
+
+As written, it won't work on other versions of `awk'. However, it is
+actually almost portable, requiring very little change:
+
+ * Assignments to `TEXTDOMAIN' won't have any effect, since
+ `TEXTDOMAIN' is not special in other `awk' implementations.
+
+ * Non-GNU versions of `awk' treat marked strings as the
+ concatenation of a variable named `_' with the string following
+ it.(1) Typically, the variable `_' has the null string (`""') as
+ its value, leaving the original string constant as the result.
+
+ * By defining "dummy" functions to replace `dcgettext()',
+ `dcngettext()' and `bindtextdomain()', the `awk' program can be
+ made to run, but all the messages are output in the original
+ language. For example:
+
+ function bindtextdomain(dir, domain)
+ {
+ return dir
+ }
+
+ function dcgettext(string, domain, category)
+ {
+ return string
+ }
+
+ function dcngettext(string1, string2, number, domain, category)
+ {
+ return (number == 1 ? string1 : string2)
+ }
+
+ * The use of positional specifications in `printf' or `sprintf()' is
+ _not_ portable. To support `gettext()' at the C level, many
+ systems' C versions of `sprintf()' do support positional
+ specifiers. But it works only if enough arguments are supplied in
+ the function call. Many versions of `awk' pass `printf' formats
+ and arguments unchanged to the underlying C library version of
+ `sprintf()', but only one format and argument at a time. What
+ happens if a positional specification is used is anybody's guess.
+ However, since the positional specifications are primarily for use
+ in _translated_ format strings, and since non-GNU `awk's never
+ retrieve the translated string, this should not be a problem in
+ practice.
+
+ ---------- Footnotes ----------
+
+ (1) This is good fodder for an "Obfuscated `awk'" contest.
+
+
+File: gawk.info, Node: I18N Example, Next: Gawk I18N, Prev: Translator i18n, Up: Internationalization
+
+12.5 A Simple Internationalization Example
+==========================================
+
+Now let's look at a step-by-step example of how to internationalize and
+localize a simple `awk' program, using `guide.awk' as our original
+source:
+
+ BEGIN {
+ TEXTDOMAIN = "guide"
+ bindtextdomain(".") # for testing
+ print _"Don't Panic"
+ print _"The Answer Is", 42
+ print "Pardon me, Zaphod who?"
+ }
+
+Run `gawk --gen-pot' to create the `.pot' file:
+
+ $ gawk --gen-pot -f guide.awk > guide.pot
+
+This produces:
+
+ #: guide.awk:4
+ msgid "Don't Panic"
+ msgstr ""
+
+ #: guide.awk:5
+ msgid "The Answer Is"
+ msgstr ""
+
+ This original portable object template file is saved and reused for
+each language into which the application is translated. The `msgid' is
+the original string and the `msgstr' is the translation.
+
+ NOTE: Strings not marked with a leading underscore do not appear
+ in the `guide.pot' file.
+
+ Next, the messages must be translated. Here is a translation to a
+hypothetical dialect of English, called "Mellow":(1)
+
+ $ cp guide.pot guide-mellow.po
+ ADD TRANSLATIONS TO guide-mellow.po ...
+
+Following are the translations:
+
+ #: guide.awk:4
+ msgid "Don't Panic"
+ msgstr "Hey man, relax!"
+
+ #: guide.awk:5
+ msgid "The Answer Is"
+ msgstr "Like, the scoop is"
+
+ The next step is to make the directory to hold the binary message
+object file and then to create the `guide.mo' file. The directory
+layout shown here is standard for GNU `gettext' on GNU/Linux systems.
+Other versions of `gettext' may use a different layout:
+
+ $ mkdir en_US en_US/LC_MESSAGES
+
+ The `msgfmt' utility does the conversion from human-readable `.po'
+file to machine-readable `.mo' file. By default, `msgfmt' creates a
+file named `messages'. This file must be renamed and placed in the
+proper directory so that `gawk' can find it:
+
+ $ msgfmt guide-mellow.po
+ $ mv messages en_US/LC_MESSAGES/guide.mo
+
+ Finally, we run the program to test it:
+
+ $ gawk -f guide.awk
+ -| Hey man, relax!
+ -| Like, the scoop is 42
+ -| Pardon me, Zaphod who?
+
+ If the three replacement functions for `dcgettext()', `dcngettext()'
+and `bindtextdomain()' (*note I18N Portability::) are in a file named
+`libintl.awk', then we can run `guide.awk' unchanged as follows:
+
+ $ gawk --posix -f guide.awk -f libintl.awk
+ -| Don't Panic
+ -| The Answer Is 42
+ -| Pardon me, Zaphod who?
+
+ ---------- Footnotes ----------
+
+ (1) Perhaps it would be better if it were called "Hippy." Ah, well.
+
+
+File: gawk.info, Node: Gawk I18N, Prev: I18N Example, Up: Internationalization
+
+12.6 `gawk' Can Speak Your Language
+===================================
+
+`gawk' itself has been internationalized using the GNU `gettext'
+package. (GNU `gettext' is described in complete detail in *note (GNU
+`gettext' utilities)Top:: gettext, GNU gettext tools.) As of this
+writing, the latest version of GNU `gettext' is version 0.18.1
+(ftp://ftp.gnu.org/gnu/gettext/gettext-0.18.1.tar.gz).
+
+ If a translation of `gawk''s messages exists, then `gawk' produces
+usage messages, warnings, and fatal errors in the local language.
+
+
+File: gawk.info, Node: Advanced Features, Next: Debugger, Prev: Internationalization, Up: Top
+
+13 Advanced Features of `gawk'
******************************
+ Write documentation as if whoever reads it is a violent psychopath
+ who knows where you live.
+ Steve English, as quoted by Peter Langston
+
+ This major node discusses advanced features in `gawk'. It's a bit
+of a "grab bag" of items that are otherwise unrelated to each other.
+First, a command-line option allows `gawk' to recognize nondecimal
+numbers in input data, not just in `awk' programs. Then, `gawk''s
+special features for sorting arrays are presented. Next, two-way I/O,
+discussed briefly in earlier parts of this Info file, is described in
+full detail, along with the basics of TCP/IP networking. Finally,
+`gawk' can "profile" an `awk' program, making it possible to tune it
+for performance.
+
+ *note Dynamic Extensions::, discusses the ability to dynamically add
+new built-in functions to `gawk'. As this feature is still immature
+and likely to change, its description is relegated to an appendix.
+
+* Menu:
+
+* Nondecimal Data:: Allowing nondecimal input data.
+* Array Sorting:: Facilities for controlling array traversal and
+ sorting arrays.
+* Two-way I/O:: Two-way communications with another process.
+* TCP/IP Networking:: Using `gawk' for network programming.
+* Profiling:: Profiling your `awk' programs.
+
+
+File: gawk.info, Node: Nondecimal Data, Next: Array Sorting, Up: Advanced Features
+
+13.1 Allowing Nondecimal Input Data
+===================================
+
+If you run `gawk' with the `--non-decimal-data' option, you can have
+nondecimal constants in your input data:
+
+ $ echo 0123 123 0x123 |
+ > gawk --non-decimal-data '{ printf "%d, %d, %d\n",
+ > $1, $2, $3 }'
+ -| 83, 123, 291
+
+ For this feature to work, write your program so that `gawk' treats
+your data as numeric:
+
+ $ echo 0123 123 0x123 | gawk '{ print $1, $2, $3 }'
+ -| 0123 123 0x123
+
+The `print' statement treats its expressions as strings. Although the
+fields can act as numbers when necessary, they are still strings, so
+`print' does not try to treat them numerically. You may need to add
+zero to a field to force it to be treated as a number. For example:
+
+ $ echo 0123 123 0x123 | gawk --non-decimal-data '
+ > { print $1, $2, $3
+ > print $1 + 0, $2 + 0, $3 + 0 }'
+ -| 0123 123 0x123
+ -| 83 123 291
+
+ Because it is common to have decimal data with leading zeros, and
+because using this facility could lead to surprising results, the
+default is to leave it disabled. If you want it, you must explicitly
+request it.
+
+ CAUTION: _Use of this option is not recommended._ It can break old
+ programs very badly. Instead, use the `strtonum()' function to
+ convert your data (*note Nondecimal-numbers::). This makes your
+ programs easier to write and easier to read, and leads to less
+ surprising results.
+
+
+File: gawk.info, Node: Array Sorting, Next: Two-way I/O, Prev: Nondecimal Data, Up: Advanced Features
+
+13.2 Controlling Array Traversal and Array Sorting
+==================================================
+
+`gawk' lets you control the order in which a `for (i in array)' loop
+traverses an array.
+
+ In addition, two built-in functions, `asort()' and `asorti()', let
+you sort arrays based on the array values and indices, respectively.
+These two functions also provide control over the sorting criteria used
+to order the elements during sorting.
+
+* Menu:
+
+* Controlling Array Traversal:: How to use PROCINFO["sorted_in"].
+* Array Sorting Functions:: How to use `asort()' and `asorti()'.
+
+
+File: gawk.info, Node: Controlling Array Traversal, Next: Array Sorting Functions, Up: Array Sorting
+
+13.2.1 Controlling Array Traversal
+----------------------------------
+
+By default, the order in which a `for (i in array)' loop scans an array
+is not defined; it is generally based upon the internal implementation
+of arrays inside `awk'.
+
+ Often, though, it is desirable to be able to loop over the elements
+in a particular order that you, the programmer, choose. `gawk' lets
+you do this.
+
+ *note Controlling Scanning::, describes how you can assign special,
+pre-defined values to `PROCINFO["sorted_in"]' in order to control the
+order in which `gawk' will traverse an array during a `for' loop.
+
+ In addition, the value of `PROCINFO["sorted_in"]' can be a function
+name. This lets you traverse an array based on any custom criterion.
+The array elements are ordered according to the return value of this
+function. The comparison function should be defined with at least four
+arguments:
+
+ function comp_func(i1, v1, i2, v2)
+ {
+ COMPARE ELEMENTS 1 AND 2 IN SOME FASHION
+ RETURN < 0; 0; OR > 0
+ }
+
+ Here, I1 and I2 are the indices, and V1 and V2 are the corresponding
+values of the two elements being compared. Either V1 or V2, or both,
+can be arrays if the array being traversed contains subarrays as values.
+(*Note Arrays of Arrays::, for more information about subarrays.) The
+three possible return values are interpreted as follows:
+
+`comp_func(i1, v1, i2, v2) < 0'
+ Index I1 comes before index I2 during loop traversal.
+
+`comp_func(i1, v1, i2, v2) == 0'
+ Indices I1 and I2 come together but the relative order with
+ respect to each other is undefined.
+
+`comp_func(i1, v1, i2, v2) > 0'
+ Index I1 comes after index I2 during loop traversal.
+
+ Our first comparison function can be used to scan an array in
+numerical order of the indices:
+
+ function cmp_num_idx(i1, v1, i2, v2)
+ {
+ # numerical index comparison, ascending order
+ return (i1 - i2)
+ }
+
+ Our second function traverses an array based on the string order of
+the element values rather than by indices:
+
+ function cmp_str_val(i1, v1, i2, v2)
+ {
+ # string value comparison, ascending order
+ v1 = v1 ""
+ v2 = v2 ""
+ if (v1 < v2)
+ return -1
+ return (v1 != v2)
+ }
+
+ The third comparison function makes all numbers, and numeric strings
+without any leading or trailing spaces, come out first during loop
+traversal:
+
+ function cmp_num_str_val(i1, v1, i2, v2, n1, n2)
+ {
+ # numbers before string value comparison, ascending order
+ n1 = v1 + 0
+ n2 = v2 + 0
+ if (n1 == v1)
+ return (n2 == v2) ? (n1 - n2) : -1
+ else if (n2 == v2)
+ return 1
+ return (v1 < v2) ? -1 : (v1 != v2)
+ }
+
+ Here is a main program to demonstrate how `gawk' behaves using each
+of the previous functions:
+
+ BEGIN {
+ data["one"] = 10
+ data["two"] = 20
+ data[10] = "one"
+ data[100] = 100
+ data[20] = "two"
+
+ f[1] = "cmp_num_idx"
+ f[2] = "cmp_str_val"
+ f[3] = "cmp_num_str_val"
+ for (i = 1; i <= 3; i++) {
+ printf("Sort function: %s\n", f[i])
+ PROCINFO["sorted_in"] = f[i]
+ for (j in data)
+ printf("\tdata[%s] = %s\n", j, data[j])
+ print ""
+ }
+ }
+
+ Here are the results when the program is run:
+
+ $ gawk -f compdemo.awk
+ -| Sort function: cmp_num_idx Sort by numeric index
+ -| data[two] = 20
+ -| data[one] = 10 Both strings are numerically zero
+ -| data[10] = one
+ -| data[20] = two
+ -| data[100] = 100
+ -|
+ -| Sort function: cmp_str_val Sort by element values as strings
+ -| data[one] = 10
+ -| data[100] = 100 String 100 is less than string 20
+ -| data[two] = 20
+ -| data[10] = one
+ -| data[20] = two
+ -|
+ -| Sort function: cmp_num_str_val Sort all numeric values before all strings
+ -| data[one] = 10
+ -| data[two] = 20
+ -| data[100] = 100
+ -| data[10] = one
+ -| data[20] = two
+
+ Consider sorting the entries of a GNU/Linux system password file
+according to login name. The following program sorts records by a
+specific field position and can be used for this purpose:
+
+ # sort.awk --- simple program to sort by field position
+ # field position is specified by the global variable POS
+
+ function cmp_field(i1, v1, i2, v2)
+ {
+ # comparison by value, as string, and ascending order
+ return v1[POS] < v2[POS] ? -1 : (v1[POS] != v2[POS])
+ }
+
+ {
+ for (i = 1; i <= NF; i++)
+ a[NR][i] = $i
+ }
+
+ END {
+ PROCINFO["sorted_in"] = "cmp_field"
+ if (POS < 1 || POS > NF)
+ POS = 1
+ for (i in a) {
+ for (j = 1; j <= NF; j++)
+ printf("%s%c", a[i][j], j < NF ? ":" : "")
+ print ""
+ }
+ }
+
+ The first field in each entry of the password file is the user's
+login name, and the fields are separated by colons. Each record
+defines a subarray, with each field as an element in the subarray.
+Running the program produces the following output:
+
+ $ gawk -v POS=1 -F: -f sort.awk /etc/passwd
+ -| adm:x:3:4:adm:/var/adm:/sbin/nologin
+ -| apache:x:48:48:Apache:/var/www:/sbin/nologin
+ -| avahi:x:70:70:Avahi daemon:/:/sbin/nologin
+ ...
+
+ The comparison should normally always return the same value when
+given a specific pair of array elements as its arguments. If
+inconsistent results are returned then the order is undefined. This
+behavior can be exploited to introduce random order into otherwise
+seemingly ordered data:
+
+ function cmp_randomize(i1, v1, i2, v2)
+ {
+ # random order
+ return (2 - 4 * rand())
+ }
+
+ As mentioned above, the order of the indices is arbitrary if two
+elements compare equal. This is usually not a problem, but letting the
+tied elements come out in arbitrary order can be an issue, especially
+when comparing item values. The partial ordering of the equal elements
+may change during the next loop traversal, if other elements are added
+or removed from the array. One way to resolve ties when comparing
+elements with otherwise equal values is to include the indices in the
+comparison rules. Note that doing this may make the loop traversal
+less efficient, so consider it only if necessary. The following
+comparison functions force a deterministic order, and are based on the
+fact that the indices of two elements are never equal:
+
+ function cmp_numeric(i1, v1, i2, v2)
+ {
+ # numerical value (and index) comparison, descending order
+ return (v1 != v2) ? (v2 - v1) : (i2 - i1)
+ }
+
+ function cmp_string(i1, v1, i2, v2)
+ {
+ # string value (and index) comparison, descending order
+ v1 = v1 i1
+ v2 = v2 i2
+ return (v1 > v2) ? -1 : (v1 != v2)
+ }
+
+ A custom comparison function can often simplify ordered loop
+traversal, and the sky is really the limit when it comes to designing
+such a function.
+
+ When string comparisons are made during a sort, either for element
+values where one or both aren't numbers, or for element indices handled
+as strings, the value of `IGNORECASE' (*note Built-in Variables::)
+controls whether the comparisons treat corresponding uppercase and
+lowercase letters as equivalent or distinct.
+
+ Another point to keep in mind is that in the case of subarrays the
+element values can themselves be arrays; a production comparison
+function should use the `isarray()' function (*note Type Functions::),
+to check for this, and choose a defined sorting order for subarrays.
+
+ All sorting based on `PROCINFO["sorted_in"]' is disabled in POSIX
+mode, since the `PROCINFO' array is not special in that case.
+
+ As a side note, sorting the array indices before traversing the
+array has been reported to add 15% to 20% overhead to the execution
+time of `awk' programs. For this reason, sorted array traversal is not
+the default.
+
+
+File: gawk.info, Node: Array Sorting Functions, Prev: Controlling Array Traversal, Up: Array Sorting
+
+13.2.2 Sorting Array Values and Indices with `gawk'
+---------------------------------------------------
+
+In most `awk' implementations, sorting an array requires writing a
+`sort()' function. While this can be educational for exploring
+different sorting algorithms, usually that's not the point of the
+program. `gawk' provides the built-in `asort()' and `asorti()'
+functions (*note String Functions::) for sorting arrays. For example:
+
+ POPULATE THE ARRAY data
+ n = asort(data)
+ for (i = 1; i <= n; i++)
+ DO SOMETHING WITH data[i]
+
+ After the call to `asort()', the array `data' is indexed from 1 to
+some number N, the total number of elements in `data'. (This count is
+`asort()''s return value.) `data[1]' <= `data[2]' <= `data[3]', and so
+on. The comparison is based on the type of the elements (*note Typing
+and Comparison::). All numeric values come before all string values,
+which in turn come before all subarrays.
+
+ An important side effect of calling `asort()' is that _the array's
+original indices are irrevocably lost_. As this isn't always
+desirable, `asort()' accepts a second argument:
+
+ POPULATE THE ARRAY source
+ n = asort(source, dest)
+ for (i = 1; i <= n; i++)
+ DO SOMETHING WITH dest[i]
+
+ In this case, `gawk' copies the `source' array into the `dest' array
+and then sorts `dest', destroying its indices. However, the `source'
+array is not affected.
+
+ `asort()' accepts a third string argument to control comparison of
+array elements. As with `PROCINFO["sorted_in"]', this argument may be
+one of the predefined names that `gawk' provides (*note Controlling
+Scanning::), or the name of a user-defined function (*note Controlling
+Array Traversal::).
+
+ NOTE: In all cases, the sorted element values consist of the
+ original array's element values. The ability to control
+ comparison merely affects the way in which they are sorted.
+
+ Often, what's needed is to sort on the values of the _indices_
+instead of the values of the elements. To do that, use the `asorti()'
+function. The interface is identical to that of `asort()', except that
+the index values are used for sorting, and become the values of the
+result array:
+
+ { source[$0] = some_func($0) }
+
+ END {
+ n = asorti(source, dest)
+ for (i = 1; i <= n; i++) {
+ Work with sorted indices directly:
+ DO SOMETHING WITH dest[i]
+ ...
+ Access original array via sorted indices:
+ DO SOMETHING WITH source[dest[i]]
+ }
+ }
+
+ Similar to `asort()', in all cases, the sorted element values
+consist of the original array's indices. The ability to control
+comparison merely affects the way in which they are sorted.
+
+ Sorting the array by replacing the indices provides maximal
+flexibility. To traverse the elements in decreasing order, use a loop
+that goes from N down to 1, either over the elements or over the
+indices.(1)
+
+ Copying array indices and elements isn't expensive in terms of
+memory. Internally, `gawk' maintains "reference counts" to data. For
+example, when `asort()' copies the first array to the second one, there
+is only one copy of the original array elements' data, even though both
+arrays use the values.
+
+ Because `IGNORECASE' affects string comparisons, the value of
+`IGNORECASE' also affects sorting for both `asort()' and `asorti()'.
+Note also that the locale's sorting order does _not_ come into play;
+comparisons are based on character values only.(2) Caveat Emptor.
+
+ ---------- Footnotes ----------
+
+ (1) You may also use one of the predefined sorting names that sorts
+in decreasing order.
+
+ (2) This is true because locale-based comparison occurs only when in
+POSIX compatibility mode, and since `asort()' and `asorti()' are `gawk'
+extensions, they are not available in that case.
+
+
+File: gawk.info, Node: Two-way I/O, Next: TCP/IP Networking, Prev: Array Sorting, Up: Advanced Features
+
+13.3 Two-Way Communications with Another Process
+================================================
+
+ From: brennan@whidbey.com (Mike Brennan)
+ Newsgroups: comp.lang.awk
+ Subject: Re: Learn the SECRET to Attract Women Easily
+ Date: 4 Aug 1997 17:34:46 GMT
+ Message-ID: <5s53rm$eca@news.whidbey.com>
+
+ On 3 Aug 1997 13:17:43 GMT, Want More Dates???
+ <tracy78@kilgrona.com> wrote:
+ >Learn the SECRET to Attract Women Easily
+ >
+ >The SCENT(tm) Pheromone Sex Attractant For Men to Attract Women
+
+ The scent of awk programmers is a lot more attractive to women than
+ the scent of perl programmers.
+ --
+ Mike Brennan
+
+ It is often useful to be able to send data to a separate program for
+processing and then read the result. This can always be done with
+temporary files:
+
+ # Write the data for processing
+ tempfile = ("mydata." PROCINFO["pid"])
+ while (NOT DONE WITH DATA)
+ print DATA | ("subprogram > " tempfile)
+ close("subprogram > " tempfile)
+
+ # Read the results, remove tempfile when done
+ while ((getline newdata < tempfile) > 0)
+ PROCESS newdata APPROPRIATELY
+ close(tempfile)
+ system("rm " tempfile)
+
+This works, but not elegantly. Among other things, it requires that
+the program be run in a directory that cannot be shared among users;
+for example, `/tmp' will not do, as another user might happen to be
+using a temporary file with the same name.
+
+ However, with `gawk', it is possible to open a _two-way_ pipe to
+another process. The second process is termed a "coprocess", since it
+runs in parallel with `gawk'. The two-way connection is created using
+the `|&' operator (borrowed from the Korn shell, `ksh'):(1)
+
+ do {
+ print DATA |& "subprogram"
+ "subprogram" |& getline results
+ } while (DATA LEFT TO PROCESS)
+ close("subprogram")
+
+ The first time an I/O operation is executed using the `|&' operator,
+`gawk' creates a two-way pipeline to a child process that runs the
+other program. Output created with `print' or `printf' is written to
+the program's standard input, and output from the program's standard
+output can be read by the `gawk' program using `getline'. As is the
+case with processes started by `|', the subprogram can be any program,
+or pipeline of programs, that can be started by the shell.
+
+ There are some cautionary items to be aware of:
+
+ * As the code inside `gawk' currently stands, the coprocess's
+ standard error goes to the same place that the parent `gawk''s
+ standard error goes. It is not possible to read the child's
+ standard error separately.
+
+ * I/O buffering may be a problem. `gawk' automatically flushes all
+ output down the pipe to the coprocess. However, if the coprocess
+ does not flush its output, `gawk' may hang when doing a `getline'
+ in order to read the coprocess's results. This could lead to a
+ situation known as "deadlock", where each process is waiting for
+ the other one to do something.
+
+ It is possible to close just one end of the two-way pipe to a
+coprocess, by supplying a second argument to the `close()' function of
+either `"to"' or `"from"' (*note Close Files And Pipes::). These
+strings tell `gawk' to close the end of the pipe that sends data to the
+coprocess or the end that reads from it, respectively.
+
+ This is particularly necessary in order to use the system `sort'
+utility as part of a coprocess; `sort' must read _all_ of its input
+data before it can produce any output. The `sort' program does not
+receive an end-of-file indication until `gawk' closes the write end of
+the pipe.
+
+ When you have finished writing data to the `sort' utility, you can
+close the `"to"' end of the pipe, and then start reading sorted data
+via `getline'. For example:
+
+ BEGIN {
+ command = "LC_ALL=C sort"
+ n = split("abcdefghijklmnopqrstuvwxyz", a, "")
+
+ for (i = n; i > 0; i--)
+ print a[i] |& command
+ close(command, "to")
+
+ while ((command |& getline line) > 0)
+ print "got", line
+ close(command)
+ }
+
+ This program writes the letters of the alphabet in reverse order, one
+per line, down the two-way pipe to `sort'. It then closes the write
+end of the pipe, so that `sort' receives an end-of-file indication.
+This causes `sort' to sort the data and write the sorted data back to
+the `gawk' program. Once all of the data has been read, `gawk'
+terminates the coprocess and exits.
+
+ As a side note, the assignment `LC_ALL=C' in the `sort' command
+ensures traditional Unix (ASCII) sorting from `sort'.
+
+ You may also use pseudo-ttys (ptys) for two-way communication
+instead of pipes, if your system supports them. This is done on a
+per-command basis, by setting a special element in the `PROCINFO' array
+(*note Auto-set::), like so:
+
+ command = "sort -nr" # command, save in convenience variable
+ PROCINFO[command, "pty"] = 1 # update PROCINFO
+ print ... |& command # start two-way pipe
+ ...
+
+Using ptys avoids the buffer deadlock issues described earlier, at some
+loss in performance. If your system does not have ptys, or if all the
+system's ptys are in use, `gawk' automatically falls back to using
+regular pipes.
+
+ ---------- Footnotes ----------
+
+ (1) This is very different from the same operator in the C shell.
+
+
+File: gawk.info, Node: TCP/IP Networking, Next: Profiling, Prev: Two-way I/O, Up: Advanced Features
+
+13.4 Using `gawk' for Network Programming
+=========================================
+
+ `EMISTERED':
+ A host is a host from coast to coast,
+ and no-one can talk to host that's close,
+ unless the host that isn't close
+ is busy hung or dead.
+
+ In addition to being able to open a two-way pipeline to a coprocess
+on the same system (*note Two-way I/O::), it is possible to make a
+two-way connection to another process on another system across an IP
+network connection.
+
+ You can think of this as just a _very long_ two-way pipeline to a
+coprocess. The way `gawk' decides that you want to use TCP/IP
+networking is by recognizing special file names that begin with one of
+`/inet/', `/inet4/' or `/inet6'.
+
+ The full syntax of the special file name is
+`/NET-TYPE/PROTOCOL/LOCAL-PORT/REMOTE-HOST/REMOTE-PORT'. The
+components are:
+
+NET-TYPE
+ Specifies the kind of Internet connection to make. Use `/inet4/'
+ to force IPv4, and `/inet6/' to force IPv6. Plain `/inet/' (which
+ used to be the only option) uses the system default, most likely
+ IPv4.
+
+PROTOCOL
+ The protocol to use over IP. This must be either `tcp', or `udp',
+ for a TCP or UDP IP connection, respectively. The use of TCP is
+ recommended for most applications.
+
+LOCAL-PORT
+ The local TCP or UDP port number to use. Use a port number of `0'
+ when you want the system to pick a port. This is what you should do
+ when writing a TCP or UDP client. You may also use a well-known
+ service name, such as `smtp' or `http', in which case `gawk'
+ attempts to determine the predefined port number using the C
+ `getaddrinfo()' function.
+
+REMOTE-HOST
+ The IP address or fully-qualified domain name of the Internet host
+ to which you want to connect.
+
+REMOTE-PORT
+ The TCP or UDP port number to use on the given REMOTE-HOST.
+ Again, use `0' if you don't care, or else a well-known service
+ name.
+
+ NOTE: Failure in opening a two-way socket will result in a
+ non-fatal error being returned to the calling code. The value of
+ `ERRNO' indicates the error (*note Auto-set::).
+
+ Consider the following very simple example:
+
+ BEGIN {
+ Service = "/inet/tcp/0/localhost/daytime"
+ Service |& getline
+ print $0
+ close(Service)
+ }
+
+ This program reads the current date and time from the local system's
+TCP `daytime' server. It then prints the results and closes the
+connection.
+
+ Because this topic is extensive, the use of `gawk' for TCP/IP
+programming is documented separately. See *note (General
+Introduction)Top:: gawkinet, TCP/IP Internetworking with `gawk', for a
+much more complete introduction and discussion, as well as extensive
+examples.
+
+
+File: gawk.info, Node: Profiling, Prev: TCP/IP Networking, Up: Advanced Features
+
+13.5 Profiling Your `awk' Programs
+==================================
+
+You may produce execution traces of your `awk' programs. This is done
+by passing the option `--profile' to `gawk'. When `gawk' has finished
+running, it creates a profile of your program in a file named
+`awkprof.out'. Because it is profiling, it also executes up to 45%
+slower than `gawk' normally does.
+
+ As shown in the following example, the `--profile' option can be
+used to change the name of the file where `gawk' will write the profile:
+
+ gawk --profile=myprog.prof -f myprog.awk data1 data2
+
+In the above example, `gawk' places the profile in `myprog.prof'
+instead of in `awkprof.out'.
+
+ Here is a sample session showing a simple `awk' program, its input
+data, and the results from running `gawk' with the `--profile' option.
+First, the `awk' program:
+
+ BEGIN { print "First BEGIN rule" }
+
+ END { print "First END rule" }
+
+ /foo/ {
+ print "matched /foo/, gosh"
+ for (i = 1; i <= 3; i++)
+ sing()
+ }
+
+ {
+ if (/foo/)
+ print "if is true"
+ else
+ print "else is true"
+ }
+
+ BEGIN { print "Second BEGIN rule" }
+
+ END { print "Second END rule" }
+
+ function sing( dummy)
+ {
+ print "I gotta be me!"
+ }
+
+ Following is the input data:
+
+ foo
+ bar
+ baz
+ foo
+ junk
+
+ Here is the `awkprof.out' that results from running the `gawk'
+profiler on this program and data (this example also illustrates that
+`awk' programmers sometimes have to work late):
+
+ # gawk profile, created Sun Aug 13 00:00:15 2000
+
+ # BEGIN block(s)
+
+ BEGIN {
+ 1 print "First BEGIN rule"
+ 1 print "Second BEGIN rule"
+ }
+
+ # Rule(s)
+
+ 5 /foo/ { # 2
+ 2 print "matched /foo/, gosh"
+ 6 for (i = 1; i <= 3; i++) {
+ 6 sing()
+ }
+ }
+
+ 5 {
+ 5 if (/foo/) { # 2
+ 2 print "if is true"
+ 3 } else {
+ 3 print "else is true"
+ }
+ }
+
+ # END block(s)
+
+ END {
+ 1 print "First END rule"
+ 1 print "Second END rule"
+ }
+
+ # Functions, listed alphabetically
+
+ 6 function sing(dummy)
+ {
+ 6 print "I gotta be me!"
+ }
+
+ This example illustrates many of the basic features of profiling
+output. They are as follows:
+
+ * The program is printed in the order `BEGIN' rule, `BEGINFILE' rule,
+ pattern/action rules, `ENDFILE' rule, `END' rule and functions,
+ listed alphabetically. Multiple `BEGIN' and `END' rules are
+ merged together, as are multiple `BEGINFILE' and `ENDFILE' rules.
+
+ * Pattern-action rules have two counts. The first count, to the
+ left of the rule, shows how many times the rule's pattern was
+ _tested_. The second count, to the right of the rule's opening
+ left brace in a comment, shows how many times the rule's action
+ was _executed_. The difference between the two indicates how many
+ times the rule's pattern evaluated to false.
+
+ * Similarly, the count for an `if'-`else' statement shows how many
+ times the condition was tested. To the right of the opening left
+ brace for the `if''s body is a count showing how many times the
+ condition was true. The count for the `else' indicates how many
+ times the test failed.
+
+ * The count for a loop header (such as `for' or `while') shows how
+ many times the loop test was executed. (Because of this, you
+ can't just look at the count on the first statement in a rule to
+ determine how many times the rule was executed. If the first
+ statement is a loop, the count is misleading.)
+
+ * For user-defined functions, the count next to the `function'
+ keyword indicates how many times the function was called. The
+ counts next to the statements in the body show how many times
+ those statements were executed.
+
+ * The layout uses "K&R" style with TABs. Braces are used
+ everywhere, even when the body of an `if', `else', or loop is only
+ a single statement.
+
+ * Parentheses are used only where needed, as indicated by the
+ structure of the program and the precedence rules. For example,
+ `(3 + 5) * 4' means add three plus five, then multiply the total
+ by four. However, `3 + 5 * 4' has no parentheses, and means `3 +
+ (5 * 4)'.
+
+ * Parentheses are used around the arguments to `print' and `printf'
+ only when the `print' or `printf' statement is followed by a
+ redirection. Similarly, if the target of a redirection isn't a
+ scalar, it gets parenthesized.
+
+ * `gawk' supplies leading comments in front of the `BEGIN' and `END'
+ rules, the pattern/action rules, and the functions.
+
+
+ The profiled version of your program may not look exactly like what
+you typed when you wrote it. This is because `gawk' creates the
+profiled version by "pretty printing" its internal representation of
+the program. The advantage to this is that `gawk' can produce a
+standard representation. The disadvantage is that all source-code
+comments are lost, as are the distinctions among multiple `BEGIN',
+`END', `BEGINFILE', and `ENDFILE' rules. Also, things such as:
+
+ /foo/
+
+come out as:
+
+ /foo/ {
+ print $0
+ }
+
+which is correct, but possibly surprising.
+
+ Besides creating profiles when a program has completed, `gawk' can
+produce a profile while it is running. This is useful if your `awk'
+program goes into an infinite loop and you want to see what has been
+executed. To use this feature, run `gawk' with the `--profile' option
+in the background:
+
+ $ gawk --profile -f myprog &
+ [1] 13992
+
+The shell prints a job number and process ID number; in this case,
+13992. Use the `kill' command to send the `USR1' signal to `gawk':
+
+ $ kill -USR1 13992
+
+As usual, the profiled version of the program is written to
+`awkprof.out', or to a different file if one specified with the
+`--profile' option.
+
+ Along with the regular profile, as shown earlier, the profile
+includes a trace of any active functions:
+
+ # Function Call Stack:
+
+ # 3. baz
+ # 2. bar
+ # 1. foo
+ # -- main --
+
+ You may send `gawk' the `USR1' signal as many times as you like.
+Each time, the profile and function call trace are appended to the
+output profile file.
+
+ If you use the `HUP' signal instead of the `USR1' signal, `gawk'
+produces the profile and the function call trace and then exits.
+
+ When `gawk' runs on MS-Windows systems, it uses the `INT' and `QUIT'
+signals for producing the profile and, in the case of the `INT' signal,
+`gawk' exits. This is because these systems don't support the `kill'
+command, so the only signals you can deliver to a program are those
+generated by the keyboard. The `INT' signal is generated by the
+`Ctrl-<C>' or `Ctrl-<BREAK>' key, while the `QUIT' signal is generated
+by the `Ctrl-<\>' key.
+
+ Finally, `gawk' also accepts another option `--pretty-print'. When
+called this way, `gawk' "pretty prints" the program into `awkprof.out',
+without any execution counts.
+
+
+File: gawk.info, Node: Debugger, Next: Arbitrary Precision Arithmetic, Prev: Advanced Features, Up: Top
+
+14 Debugging `awk' Programs
+***************************
+
It would be nice if computer programs worked perfectly the first time
they were run, but in real life, this rarely happens for programs of
any complexity. Thus, most programming languages have facilities
available for "debugging" programs, and now `awk' is no exception.
- The `dgawk' debugger is purposely modeled after the GNU Debugger
+ The `gawk' debugger is purposely modeled after the GNU Debugger
(GDB) (http://www.gnu.org/software/gdb/) command-line debugger. If you
-are familiar with GDB, learning `dgawk' is easy.
+are familiar with GDB, learning how to use `gawk' for debugging your
+program is easy.
* Menu:
-* Debugging:: Introduction to `dgawk'.
-* Sample dgawk session:: Sample `dgawk' session.
-* List of Debugger Commands:: Main `dgawk' Commands.
-* Readline Support:: Readline Support.
-* Dgawk Limitations:: Limitations and future plans.
+* Debugging:: Introduction to `gawk' debugger.
+* Sample Debugging Session:: Sample debugging session.
+* List of Debugger Commands:: Main debugger commands.
+* Readline Support:: Readline support.
+* Limitations:: Limitations and future plans.

-File: gawk.info, Node: Debugging, Next: Sample dgawk session, Up: Debugger
+File: gawk.info, Node: Debugging, Next: Sample Debugging Session, Up: Debugger
-14.1 Introduction to `dgawk'
-============================
+14.1 Introduction to `gawk' Debugger
+====================================
This minor node introduces debugging in general and begins the
discussion of debugging in `gawk'.
* Menu:
-* Debugging Concepts:: Debugging In General.
+* Debugging Concepts:: Debugging in General.
* Debugging Terms:: Additional Debugging Concepts.
* Awk Debugging:: Awk Debugging.

File: gawk.info, Node: Debugging Concepts, Next: Debugging Terms, Up: Debugging
-14.1.1 Debugging In General
+14.1.1 Debugging in General
---------------------------
(If you have used debuggers in other languages, you may want to skip
@@ -18825,9 +19319,8 @@ File: gawk.info, Node: Debugging Terms, Next: Awk Debugging, Prev: Debugging
------------------------------------
Before diving in to the details, we need to introduce several important
-concepts that apply to just about all debuggers, including `dgawk'.
-The following list defines terms used throughout the rest of this
-major node.
+concepts that apply to just about all debuggers. The following list
+defines terms used throughout the rest of this major node.
"Stack Frame"
Programs generally call functions during the course of their
@@ -18845,11 +19338,11 @@ major node.
needed to manage the call stack. This data area is termed a
"stack frame".
- `gawk' also follows this model, and `dgawk' gives you access to
- the call stack and to each stack frame. You can see the call
- stack, as well as from where each function on the stack was
- invoked. Commands that print the call stack print information about
- each stack frame (as detailed later on).
+ `gawk' also follows this model, and gives you access to the call
+ stack and to each stack frame. You can see the call stack, as well
+ as from where each function on the stack was invoked. Commands
+ that print the call stack print information about each stack frame
+ (as detailed later on).
"Breakpoint"
During debugging, you often wish to let the program run until it
@@ -18894,54 +19387,57 @@ individual primitive instructions carried out by the higher-level `awk'
commands.

-File: gawk.info, Node: Sample dgawk session, Next: List of Debugger Commands, Prev: Debugging, Up: Debugger
+File: gawk.info, Node: Sample Debugging Session, Next: List of Debugger Commands, Prev: Debugging, Up: Debugger
-14.2 Sample `dgawk' session
-===========================
+14.2 Sample Debugging Session
+=============================
-In order to illustrate the use of `dgawk', let's look at a sample
-debugging session. We will use the `awk' implementation of the POSIX
-`uniq' command described earlier (*note Uniq Program::) as our example.
+In order to illustrate the use of `gawk' as a debugger, let's look at a
+sample debugging session. We will use the `awk' implementation of the
+POSIX `uniq' command described earlier (*note Uniq Program::) as our
+example.
* Menu:
-* dgawk invocation:: `dgawk' Invocation.
-* Finding The Bug:: Finding The Bug.
+* Debugger Invocation:: How to Start the Debugger.
+* Finding The Bug:: Finding the Bug.

-File: gawk.info, Node: dgawk invocation, Next: Finding The Bug, Up: Sample dgawk session
+File: gawk.info, Node: Debugger Invocation, Next: Finding The Bug, Up: Sample Debugging Session
-14.2.1 `dgawk' Invocation
--------------------------
+14.2.1 How to Start the Debugger
+--------------------------------
-Starting `dgawk' is exactly like running `awk'. The file(s) containing
-the program and any supporting code are given on the command line as
-arguments to one or more `-f' options. (`dgawk' is not designed to
-debug command-line programs, only programs contained in files.) In our
-case, we call `dgawk' like this:
+Starting the debugger is almost exactly like running `awk', except you
+have to pass an additional option `--debug' or the corresponding short
+option `-D'. The file(s) containing the program and any supporting
+code are given on the command line as arguments to one or more `-f'
+options. (`gawk' is not designed to debug command-line programs, only
+programs contained in files.) In our case, we invoke the debugger like
+this:
- $ dgawk -f getopt.awk -f join.awk -f uniq.awk inputfile
+ $ gawk -D -f getopt.awk -f join.awk -f uniq.awk inputfile
where both `getopt.awk' and `uniq.awk' are in `$AWKPATH'. (Experienced
users of GDB or similar debuggers should note that this syntax is
-slightly different from what they are used to. With `dgawk', the
-arguments for running the program are given in the command line to the
-debugger rather than as part of the `run' command at the debugger
+slightly different from what they are used to. With `gawk' debugger,
+the arguments for running the program are given in the command line to
+the debugger rather than as part of the `run' command at the debugger
prompt.)
Instead of immediately running the program on `inputfile', as `gawk'
-would ordinarily do, `dgawk' merely loads all the program source files,
-compiles them internally, and then gives us a prompt:
+would ordinarily do, the debugger merely loads all the program source
+files, compiles them internally, and then gives us a prompt:
- dgawk>
+ gawk>
from which we can issue commands to the debugger. At this point, no
code has been executed.

-File: gawk.info, Node: Finding The Bug, Prev: dgawk invocation, Up: Sample dgawk session
+File: gawk.info, Node: Finding The Bug, Prev: Debugger Invocation, Up: Sample Debugging Session
-14.2.2 Finding The Bug
+14.2.2 Finding the Bug
----------------------
Let's say that we are having a problem using (a faulty version of)
@@ -18971,27 +19467,27 @@ for a breakpoint in `uniq.awk' is at the beginning of the function
`are_equal()', which compares the current line with the previous one.
To set the breakpoint, use the `b' (breakpoint) command:
- dgawk> b are_equal
+ gawk> b are_equal
-| Breakpoint 1 set at file `awklib/eg/prog/uniq.awk', line 64
The debugger tells us the file and line number where the breakpoint
is. Now type `r' or `run' and the program runs until it hits the
breakpoint for the first time:
- dgawk> r
+ gawk> r
-| Starting program:
-| Stopping in Rule ...
-| Breakpoint 1, are_equal(n, m, clast, cline, alast, aline)
at `awklib/eg/prog/uniq.awk':64
-| 64 if (fcount == 0 && charcount == 0)
- dgawk>
+ gawk>
Now we can look at what's going on inside our program. First of all,
let's see how we got to where we are. At the prompt, we type `bt'
-(short for "backtrace"), and `dgawk' responds with a listing of the
-current stack frames:
+(short for "backtrace"), and the debugger responds with a listing of
+the current stack frames:
- dgawk> bt
+ gawk> bt
-| #0 are_equal(n, m, clast, cline, alast, aline)
at `awklib/eg/prog/uniq.awk':69
-| #1 in main() at `awklib/eg/prog/uniq.awk':89
@@ -19005,9 +19501,9 @@ the key to finding the source of the problem.)
Now that we're in `are_equal()', we can start looking at the values
of some variables. Let's say we type `p n' (`p' is short for "print").
We would expect to see the value of `n', a parameter to `are_equal()'.
-Actually, `dgawk' gives us:
+Actually, the debugger gives us:
- dgawk> p n
+ gawk> p n
-| n = untyped variable
In this case, `n' is an uninitialized local variable, since the
@@ -19015,13 +19511,13 @@ function was called without arguments (*note Function Calls::).
A more useful variable to display might be the current record:
- dgawk> p $0
+ gawk> p $0
-| $0 = string ("gawk is a wonderful program!")
This might be a bit puzzling at first since this is the second line of
our test input above. Let's look at `NR':
- dgawk> p NR
+ gawk> p NR
-| NR = number (2)
So we can see that `are_equal()' was only called for the second record
@@ -19035,7 +19531,7 @@ for `NR == 1':
OK, let's just check that that rule worked correctly:
- dgawk> p last
+ gawk> p last
-| last = string ("awk is a wonderful program!")
Everything we have done so far has verified that the program has
@@ -19044,7 +19540,7 @@ the problem must be inside this function. To investigate further, we
must begin "stepping through" the lines of `are_equal()'. We start by
typing `n' (for "next"):
- dgawk> n
+ gawk> n
-| 67 if (fcount > 0) {
This tells us that `gawk' is now ready to execute line 67, which
@@ -19060,15 +19556,15 @@ was false.)
Continuing to step, we now get to the splitting of the current and
last records:
- dgawk> n
+ gawk> n
-| 68 n = split(last, alast)
- dgawk> n
+ gawk> n
-| 69 m = split($0, aline)
At this point, we should be curious to see what our records were
split into, so we try to look:
- dgawk> p n m alast aline
+ gawk> p n m alast aline
-| n = number (5)
-| m = number (5)
-| alast = array, 5 elements
@@ -19084,19 +19580,19 @@ want to see inside the array?
The first choice would be to use subscripts:
- dgawk> p alast[0]
+ gawk> p alast[0]
-| "0" not in array `alast'
Oops!
- dgawk> p alast[1]
+ gawk> p alast[1]
-| alast["1"] = string ("awk")
- This would be kind of slow for a 100-member array, though, so
-`dgawk' provides a shortcut (reminiscent of another language not to be
+ This would be kind of slow for a 100-member array, though, so `gawk'
+provides a shortcut (reminiscent of another language not to be
mentioned):
- dgawk> p @alast
+ gawk> p @alast
-| alast["1"] = string ("awk")
-| alast["2"] = string ("is")
-| alast["3"] = string ("a")
@@ -19105,9 +19601,9 @@ mentioned):
It looks like we got this far OK. Let's take another step or two:
- dgawk> n
+ gawk> n
-| 70 clast = join(alast, fcount, n)
- dgawk> n
+ gawk> n
-| 71 cline = join(aline, fcount, m)
Well, here we are at our error (sorry to spoil the suspense). What
@@ -19115,7 +19611,7 @@ we had in mind was to join the fields starting from the second one to
make the virtual record to compare, and if the first field was numbered
zero, this would work. Let's look at what we've got:
- dgawk> p cline clast
+ gawk> p cline clast
-| cline = string ("gawk is a wonderful program!")
-| clast = string ("awk is a wonderful program!")
@@ -19123,9 +19619,9 @@ zero, this would work. Let's look at what we've got:
unaltered, input records. A little thinking (the human brain is still
the best debugging tool), and we realize that we were off by one!
- We get out of `dgawk':
+ We get out of the debugger:
- dgawk> q
+ gawk> q
-| The program is running. Exit anyway (y/n)? y
Then we get into an editor:
@@ -19136,12 +19632,13 @@ Then we get into an editor:
and problem solved!

-File: gawk.info, Node: List of Debugger Commands, Next: Readline Support, Prev: Sample dgawk session, Up: Debugger
+File: gawk.info, Node: List of Debugger Commands, Next: Readline Support, Prev: Sample Debugging Session, Up: Debugger
-14.3 Main `dgawk' Commands
-==========================
+14.3 Main Debugger Commands
+===========================
-The `dgawk' command set can be divided into the following categories:
+The `gawk' debugger command set can be divided into the following
+categories:
* Breakpoint control
@@ -19157,26 +19654,26 @@ The `dgawk' command set can be divided into the following categories:
Each of these are discussed in the following subsections. In the
following descriptions, commands which may be abbreviated show the
-abbreviation on a second description line. A `dgawk' command name may
-also be truncated if that partial name is unambiguous. `dgawk' has the
-built-in capability to automatically repeat the previous command when
-just hitting <Enter>. This works for the commands `list', `next',
+abbreviation on a second description line. A debugger command name may
+also be truncated if that partial name is unambiguous. The debugger has
+the built-in capability to automatically repeat the previous command
+when just hitting <Enter>. This works for the commands `list', `next',
`nexti', `step', `stepi' and `continue' executed without any argument.
* Menu:
-* Breakpoint Control:: Control of breakpoints.
-* Dgawk Execution Control:: Control of execution.
-* Viewing And Changing Data:: Viewing and changing data.
-* Dgawk Stack:: Dealing with the stack.
-* Dgawk Info:: Obtaining information about the program and
- the debugger state.
-* Miscellaneous Dgawk Commands:: Miscellaneous Commands.
+* Breakpoint Control:: Control of Breakpoints.
+* Debugger Execution Control:: Control of Execution.
+* Viewing And Changing Data:: Viewing and Changing Data.
+* Execution Stack:: Dealing with the Stack.
+* Debugger Info:: Obtaining Information about the Program and
+ the Debugger State.
+* Miscellaneous Debugger Commands:: Miscellaneous Commands.

-File: gawk.info, Node: Breakpoint Control, Next: Dgawk Execution Control, Up: List of Debugger Commands
+File: gawk.info, Node: Breakpoint Control, Next: Debugger Execution Control, Up: List of Debugger Commands
-14.3.1 Control Of Breakpoints
+14.3.1 Control of Breakpoints
-----------------------------
As we saw above, the first thing you probably want to do in a debugging
@@ -19204,10 +19701,10 @@ controlling breakpoints are:
it from the breakpoint list using the `delete' command.
With a breakpoint, you may also supply a condition. This is an
- `awk' expression (enclosed in double quotes) that `dgawk'
+ `awk' expression (enclosed in double quotes) that the debugger
evaluates whenever the breakpoint is reached. If the condition is
- true, then `dgawk' stops execution and prompts for a command.
- Otherwise, `dgawk' continues executing the program.
+ true, then the debugger stops execution and prompts for a command.
+ Otherwise, it continues executing the program.
`clear' [[FILENAME`:']N | FUNCTION]
Without any argument, delete any breakpoint at the next instruction
@@ -19229,12 +19726,13 @@ controlling breakpoints are:
`condition' N `"EXPRESSION"'
Add a condition to existing breakpoint or watchpoint N. The
- condition is an `awk' expression that `dgawk' evaluates whenever
- the breakpoint or watchpoint is reached. If the condition is true,
- then `dgawk' stops execution and prompts for a command. Otherwise,
- `dgawk' continues executing the program. If the condition
- expression is not specified, any existing condition is removed;
- i.e., the breakpoint or watchpoint is made unconditional.
+ condition is an `awk' expression that the debugger evaluates
+ whenever the breakpoint or watchpoint is reached. If the condition
+ is true, then the debugger stops execution and prompts for a
+ command. Otherwise, the debugger continues executing the program.
+ If the condition expression is not specified, any existing
+ condition is removed; i.e., the breakpoint or watchpoint is made
+ unconditional.
`delete' [N1 N2 ...] [N-M]
`d' [N1 N2 ...] [N-M]
@@ -19268,7 +19766,7 @@ controlling breakpoints are:
arguments are the same as for `break'.

-File: gawk.info, Node: Dgawk Execution Control, Next: Viewing And Changing Data, Prev: Breakpoint Control, Up: List of Debugger Commands
+File: gawk.info, Node: Debugger Execution Control, Next: Viewing And Changing Data, Prev: Breakpoint Control, Up: List of Debugger Commands
14.3.2 Control of Execution
---------------------------
@@ -19291,14 +19789,14 @@ execution of the program than we saw in our earlier example:
`continue') terminates the list (an implicit `end'), and
subsequent commands are ignored. For example:
- dgawk> commands
+ gawk> commands
> silent
> printf "A silent breakpoint; i = %d\n", i
> info locals
> set i = 10
> continue
> end
- dgawk>
+ gawk>
`continue' [COUNT]
`c' [COUNT]
@@ -19331,9 +19829,9 @@ execution of the program than we saw in our earlier example:
`run'
`r'
- Start/restart execution of the program. When restarting, `dgawk'
- retains the current breakpoints, watchpoints, command history,
- automatic display variables, and debugger options.
+ Start/restart execution of the program. When restarting, the
+ debugger retains the current breakpoints, watchpoints, command
+ history, automatic display variables, and debugger options.
`step' [COUNT]
`s' [COUNT]
@@ -19348,7 +19846,7 @@ execution of the program than we saw in our earlier example:
Execute one (or COUNT) instruction(s), stepping inside function
calls. (For illustration of what is meant by an "instruction" in
`gawk', see the output shown under `dump' in *note Miscellaneous
- Dgawk Commands::.)
+ Debugger Commands::.)
`until' [[FILENAME`:']N | FUNCTION]
`u' [[FILENAME`:']N | FUNCTION]
@@ -19358,7 +19856,7 @@ execution of the program than we saw in our earlier example:
current stack frame returns.

-File: gawk.info, Node: Viewing And Changing Data, Next: Dgawk Stack, Prev: Dgawk Execution Control, Up: List of Debugger Commands
+File: gawk.info, Node: Viewing And Changing Data, Next: Execution Stack, Prev: Debugger Execution Control, Up: List of Debugger Commands
14.3.3 Viewing and Changing Data
--------------------------------
@@ -19370,7 +19868,7 @@ The commands for viewing and changing variables inside of `gawk' are:
of the variable or field is displayed each time the program stops.
Each variable added to the list is identified by a unique number:
- dgawk> display x
+ gawk> display x
-| 10: x = 1
displays the assigned item number, the variable name and its
@@ -19398,7 +19896,7 @@ AWK STATEMENTS
Print the value of a `gawk' variable or field. Fields must be
referenced by constants:
- dgawk> print $3
+ gawk> print $3
This prints the third field in the input record (if the specified
field does not exist, it prints `Null field'). A variable can be
@@ -19426,16 +19924,16 @@ AWK STATEMENTS
`watch' VAR | `$'N [`"EXPRESSION"']
`w' VAR | `$'N [`"EXPRESSION"']
- Add variable VAR (or field `$N') to the watch list. `dgawk' then
- stops whenever the value of the variable or field changes. Each
- watched item is assigned a number which can be used to delete it
- from the watch list using the `unwatch' command.
+ Add variable VAR (or field `$N') to the watch list. The debugger
+ then stops whenever the value of the variable or field changes.
+ Each watched item is assigned a number which can be used to delete
+ it from the watch list using the `unwatch' command.
With a watchpoint, you may also supply a condition. This is an
- `awk' expression (enclosed in double quotes) that `dgawk'
+ `awk' expression (enclosed in double quotes) that the debugger
evaluates whenever the watchpoint is reached. If the condition is
- true, then `dgawk' stops execution and prompts for a command.
- Otherwise, `dgawk' continues executing the program.
+ true, then the debugger stops execution and prompts for a command.
+ Otherwise, `gawk' continues executing the program.
`undisplay' [N]
Remove item number N (or all items, if no argument) from the
@@ -19447,9 +19945,9 @@ AWK STATEMENTS

-File: gawk.info, Node: Dgawk Stack, Next: Dgawk Info, Prev: Viewing And Changing Data, Up: List of Debugger Commands
+File: gawk.info, Node: Execution Stack, Next: Debugger Info, Prev: Viewing And Changing Data, Up: List of Debugger Commands
-14.3.4 Dealing With The Stack
+14.3.4 Dealing with the Stack
-----------------------------
Whenever you run a program which contains any function calls, `gawk'
@@ -19484,16 +19982,17 @@ are:
frame. Then select and print the frame.

-File: gawk.info, Node: Dgawk Info, Next: Miscellaneous Dgawk Commands, Prev: Dgawk Stack, Up: List of Debugger Commands
+File: gawk.info, Node: Debugger Info, Next: Miscellaneous Debugger Commands, Prev: Execution Stack, Up: List of Debugger Commands
-14.3.5 Obtaining Information About The Program and The Debugger State
+14.3.5 Obtaining Information about the Program and the Debugger State
---------------------------------------------------------------------
Besides looking at the values of variables, there is often a need to get
other sorts of information about the state of your program and of the
-debugging environment itself. `dgawk' has one command which provides
-this information, appropriately called `info'. `info' is used with one
-of a number of arguments that tell it exactly what you want to know:
+debugging environment itself. The `gawk' debugger has one command which
+provides this information, appropriately called `info'. `info' is used
+with one of a number of arguments that tell it exactly what you want to
+know:
`info' WHAT
`i' WHAT
@@ -19521,10 +20020,10 @@ of a number of arguments that tell it exactly what you want to know:
`source'
The name of the current source file. Each time the program
stops, the current source file is the file containing the
- current instruction. When `dgawk' first starts, the current
- source file is the first file included via the `-f' option.
- The `list FILENAME:LINENO' command can be used at any time to
- change the current source.
+ current instruction. When the debugger first starts, the
+ current source file is the first file included via the `-f'
+ option. The `list FILENAME:LINENO' command can be used at any
+ time to change the current source.
`sources'
List all program sources.
@@ -19548,7 +20047,7 @@ from a file. The commands are:
`history_size'
The maximum number of lines to keep in the history file
- `./.dgawk_history'. The default is 100.
+ `./.gawk_history'. The default is 100.
`listsize'
The number of lines that `list' prints. The default is 15.
@@ -19559,14 +20058,14 @@ from a file. The commands are:
standard output.
`prompt'
- The debugger prompt. The default is `dgawk> '.
+ The debugger prompt. The default is `gawk> '.
`save_history [on | off]'
- Save command history to file `./.dgawk_history'. The default
+ Save command history to file `./.gawk_history'. The default
is `on'.
`save_options [on | off]'
- Save current options to file `./.dgawkrc' upon exit. The
+ Save current options to file `./.gawkrc' upon exit. The
default is `on'. Options are read back in to the next
session upon startup.
@@ -19584,15 +20083,15 @@ from a file. The commands are:
ignored; they do _not_ repeat the last command. You can't restart
the program by having more than one `run' command in the file.
Also, the list of commands may include additional `source'
- commands; however, `dgawk' will not source the same file more than
- once in order to avoid infinite recursion.
+ commands; however, the `gawk' debugger will not source the same
+ file more than once in order to avoid infinite recursion.
In addition to, or instead of the `source' command, you can use
- the `-R FILE' or `--command=FILE' command-line options to execute
+ the `-D FILE' or `--debug=FILE' command-line options to execute
commands from a file non-interactively (*note Options::.

-File: gawk.info, Node: Miscellaneous Dgawk Commands, Prev: Dgawk Info, Up: List of Debugger Commands
+File: gawk.info, Node: Miscellaneous Debugger Commands, Prev: Debugger Info, Up: List of Debugger Commands
14.3.6 Miscellaneous Commands
-----------------------------
@@ -19608,7 +20107,7 @@ categories, as follows:
partial dump of Davide Brini's obfuscated code (*note Signature
Program::) demonstrates:
- dgawk> dump
+ gawk> dump
-| # BEGIN
-|
-| [ 2:0x89faef4] Op_rule : [in_rule = BEGIN] [source_file = brini.awk]
@@ -19657,13 +20156,13 @@ categories, as follows:
-| [ :0x89fa3b0] Op_after_beginfile :
-| [ :0x89fa388] Op_no_op :
-| [ :0x89fa3c4] Op_after_endfile :
- dgawk>
+ gawk>
`help'
`h'
- Print a list of all of the `dgawk' commands with a short summary
- of their usage. `help COMMAND' prints the information about the
- command COMMAND.
+ Print a list of all of the `gawk' debugger commands with a short
+ summary of their usage. `help COMMAND' prints the information
+ about the command COMMAND.
`list' [`-' | `+' | N | FILENAME`:'N | N-M | FUNCTION]
`l' [`-' | `+' | N | FILENAME`:'N | N-M | FUNCTION]
@@ -19697,7 +20196,7 @@ categories, as follows:
Exit the debugger. Debugging is great fun, but sometimes we all
have to tend to other obligations in life, and sometimes we find
the bug, and are free to go on to the next one! As we saw above,
- if you are running a program, `dgawk' warns you if you
+ if you are running a program, the debugger warns you if you
accidentally type `q' or `quit', to make sure you really want to
quit.
@@ -19712,12 +20211,12 @@ categories, as follows:

-File: gawk.info, Node: Readline Support, Next: Dgawk Limitations, Prev: List of Debugger Commands, Up: Debugger
+File: gawk.info, Node: Readline Support, Next: Limitations, Prev: List of Debugger Commands, Up: Debugger
14.4 Readline Support
=====================
-If `dgawk' is compiled with the `readline' library, you can take
+If `gawk' is compiled with the `readline' library, you can take
advantage of that library's command completion and history expansion
features. The following types of completion are available:
@@ -19739,27 +20238,27 @@ Variable name completion

-File: gawk.info, Node: Dgawk Limitations, Prev: Readline Support, Up: Debugger
+File: gawk.info, Node: Limitations, Prev: Readline Support, Up: Debugger
14.5 Limitations and Future Plans
=================================
-We hope you find `dgawk' useful and enjoyable to work with, but as with
-any program, especially in its early releases, it still has some
-limitations. A few which are worth being aware of are:
+We hope you find the `gawk' debugger useful and enjoyable to work with,
+but as with any program, especially in its early releases, it still has
+some limitations. A few which are worth being aware of are:
- * At this point, `dgawk' does not give a detailed explanation of
+ * At this point, the debugger does not give a detailed explanation of
what you did wrong when you type in something it doesn't like.
Rather, it just responds `syntax error'. When you do figure out
what your mistake was, though, you'll feel like a real guru.
- * If you perused the dump of opcodes in *note Miscellaneous Dgawk
+ * If you perused the dump of opcodes in *note Miscellaneous Debugger
Commands::, (or if you are already familiar with `gawk' internals),
you will realize that much of the internal manipulation of data in
`gawk', as in many interpreters, is done on a stack. `Op_push',
`Op_pop', etc., are the "bread and butter" of most `gawk' code.
- Unfortunately, as of now, `dgawk' does not allow you to examine
- the stack's contents.
+ Unfortunately, as of now, the `gawk' debugger does not allow you
+ to examine the stack's contents.
That is, the intermediate results of expression evaluation are on
the stack, but cannot be printed. Rather, only variables which
@@ -19772,20 +20271,4510 @@ limitations. A few which are worth being aware of are:
expressions to see if you got it right. As an `awk' programmer,
you are expected to know what `/[^[:alnum:][:blank:]]/' means.
- * `dgawk' is designed to be used by running a program (with all its
- parameters) on the command line, as described in *note dgawk
- invocation::. There is no way (as of now) to attach or "break in"
- to a running program. This seems reasonable for a language which
- is used mainly for quickly executing, short programs.
+ * The `gawk' debugger is designed to be used by running a program
+ (with all its parameters) on the command line, as described in
+ *note Debugger Invocation::. There is no way (as of now) to
+ attach or "break in" to a running program. This seems reasonable
+ for a language which is used mainly for quickly executing, short
+ programs.
- * `dgawk' only accepts source supplied with the `-f' option.
+ * The `gawk' debugger only accepts source supplied with the `-f'
+ option.
Look forward to a future release when these and other missing
features may be added, and of course feel free to try to add them
yourself!

-File: gawk.info, Node: Language History, Next: Installation, Prev: Debugger, Up: Top
+File: gawk.info, Node: Arbitrary Precision Arithmetic, Next: Dynamic Extensions, Prev: Debugger, Up: Top
+
+15 Arithmetic and Arbitrary Precision Arithmetic with `gawk'
+************************************************************
+
+ There's a credibility gap: We don't know how much of the
+ computer's answers to believe. Novice computer users solve this
+ problem by implicitly trusting in the computer as an infallible
+ authority; they tend to believe that all digits of a printed
+ answer are significant. Disillusioned computer users have just the
+ opposite approach; they are constantly afraid that their answers
+ are almost meaningless.
+ Donald Knuth(1)
+
+ This major node discusses issues that you may encounter when
+performing arithmetic. It begins by discussing some of the general
+attributes of computer arithmetic, along with how this can influence
+what you see when running `awk' programs. This discussion applies to
+all versions of `awk'.
+
+ Then the major node moves on to "arbitrary precision arithmetic", a
+feature which is specific to `gawk'.
+
+* Menu:
+
+* General Arithmetic:: An introduction to computer arithmetic.
+* Floating-point Programming:: Effective Floating-point Programming.
+* Gawk and MPFR:: How `gawk' provides
+ arbitrary-precision arithmetic.
+* Arbitrary Precision Floats:: Arbitrary Precision Floating-point Arithmetic
+ with `gawk'.
+* Arbitrary Precision Integers:: Arbitrary Precision Integer Arithmetic with
+ `gawk'.
+
+ ---------- Footnotes ----------
+
+ (1) Donald E. Knuth. `The Art of Computer Programming'. Volume 2,
+`Seminumerical Algorithms', third edition, 1998, ISBN 0-201-89683-4, p.
+229.
+
+
+File: gawk.info, Node: General Arithmetic, Next: Floating-point Programming, Up: Arbitrary Precision Arithmetic
+
+15.1 A General Description of Computer Arithmetic
+=================================================
+
+Within computers, there are two kinds of numeric values: "integers" and
+"floating-point". In school, integer values were referred to as
+"whole" numbers--that is, numbers without any fractional part, such as
+1, 42, or -17. The advantage to integer numbers is that they represent
+values exactly. The disadvantage is that their range is limited. On
+most systems, this range is -2,147,483,648 to 2,147,483,647. However,
+many systems now support a range from -9,223,372,036,854,775,808 to
+9,223,372,036,854,775,807.
+
+ Integer values come in two flavors: "signed" and "unsigned". Signed
+values may be negative or positive, with the range of values just
+described. Unsigned values are always positive. On most systems, the
+range is from 0 to 4,294,967,295. However, many systems now support a
+range from 0 to 18,446,744,073,709,551,615.
+
+ Floating-point numbers represent what are called "real" numbers;
+i.e., those that do have a fractional part, such as 3.1415927. The
+advantage to floating-point numbers is that they can represent a much
+larger range of values. The disadvantage is that there are numbers
+that they cannot represent exactly. `awk' uses "double precision"
+floating-point numbers, which can hold more digits than "single
+precision" floating-point numbers.
+
+ There a several important issues to be aware of, described next.
+
+* Menu:
+
+* Floating Point Issues:: Stuff to know about floating-point numbers.
+* Integer Programming:: Effective integer programming.
+
+
+File: gawk.info, Node: Floating Point Issues, Next: Integer Programming, Up: General Arithmetic
+
+15.1.1 Floating-Point Number Caveats
+------------------------------------
+
+This minor node describes some of the issues involved in using
+floating-point numbers.
+
+ There is a very nice paper on floating-point arithmetic
+(http://www.validlab.com/goldberg/paper.pdf) by David Goldberg, "What
+Every Computer Scientist Should Know About Floating-point Arithmetic,"
+`ACM Computing Surveys' *23*, 1 (1991-03), 5-48. This is worth reading
+if you are interested in the details, but it does require a background
+in computer science.
+
+* Menu:
+
+* String Conversion Precision:: The String Value Can Lie.
+* Unexpected Results:: Floating Point Numbers Are Not Abstract
+ Numbers.
+* POSIX Floating Point Problems:: Standards Versus Existing Practice.
+
+
+File: gawk.info, Node: String Conversion Precision, Next: Unexpected Results, Up: Floating Point Issues
+
+15.1.1.1 The String Value Can Lie
+.................................
+
+Internally, `awk' keeps both the numeric value (double precision
+floating-point) and the string value for a variable. Separately, `awk'
+keeps track of what type the variable has (*note Typing and
+Comparison::), which plays a role in how variables are used in
+comparisons.
+
+ It is important to note that the string value for a number may not
+reflect the full value (all the digits) that the numeric value actually
+contains. The following program (`values.awk') illustrates this:
+
+ {
+ sum = $1 + $2
+ # see it for what it is
+ printf("sum = %.12g\n", sum)
+ # use CONVFMT
+ a = "<" sum ">"
+ print "a =", a
+ # use OFMT
+ print "sum =", sum
+ }
+
+This program shows the full value of the sum of `$1' and `$2' using
+`printf', and then prints the string values obtained from both
+automatic conversion (via `CONVFMT') and from printing (via `OFMT').
+
+ Here is what happens when the program is run:
+
+ $ echo 3.654321 1.2345678 | awk -f values.awk
+ -| sum = 4.8888888
+ -| a = <4.88889>
+ -| sum = 4.88889
+
+ This makes it clear that the full numeric value is different from
+what the default string representations show.
+
+ `CONVFMT''s default value is `"%.6g"', which yields a value with at
+least six significant digits. For some applications, you might want to
+change it to specify more precision. On most modern machines, most of
+the time, 17 digits is enough to capture a floating-point number's
+value exactly.(1)
+
+ ---------- Footnotes ----------
+
+ (1) Pathological cases can require up to 752 digits (!), but we
+doubt that you need to worry about this.
+
+
+File: gawk.info, Node: Unexpected Results, Next: POSIX Floating Point Problems, Prev: String Conversion Precision, Up: Floating Point Issues
+
+15.1.1.2 Floating Point Numbers Are Not Abstract Numbers
+........................................................
+
+Unlike numbers in the abstract sense (such as what you studied in high
+school or college arithmetic), numbers stored in computers are limited
+in certain ways. They cannot represent an infinite number of digits,
+nor can they always represent things exactly. In particular,
+floating-point numbers cannot always represent values exactly. Here is
+an example:
+
+ $ awk '{ printf("%010d\n", $1 * 100) }'
+ 515.79
+ -| 0000051579
+ 515.80
+ -| 0000051579
+ 515.81
+ -| 0000051580
+ 515.82
+ -| 0000051582
+ Ctrl-d
+
+This shows that some values can be represented exactly, whereas others
+are only approximated. This is not a "bug" in `awk', but simply an
+artifact of how computers represent numbers.
+
+ NOTE: It cannot be emphasized enough that the behavior just
+ described is fundamental to modern computers. You will see this
+ kind of thing happen in _any_ programming language using hardware
+ floating-point numbers. It is _not_ a bug in `gawk', nor is it
+ something that can be "just fixed."
+
+ Another peculiarity of floating-point numbers on modern systems is
+that they often have more than one representation for the number zero!
+In particular, it is possible to represent "minus zero" as well as
+regular, or "positive" zero.
+
+ This example shows that negative and positive zero are distinct
+values when stored internally, but that they are in fact equal to each
+other, as well as to "regular" zero:
+
+ $ gawk 'BEGIN { mz = -0 ; pz = 0
+ > printf "-0 = %g, +0 = %g, (-0 == +0) -> %d\n", mz, pz, mz == pz
+ > printf "mz == 0 -> %d, pz == 0 -> %d\n", mz == 0, pz == 0
+ > }'
+ -| -0 = -0, +0 = 0, (-0 == +0) -> 1
+ -| mz == 0 -> 1, pz == 0 -> 1
+
+ It helps to keep this in mind should you process numeric data that
+contains negative zero values; the fact that the zero is negative is
+noted and can affect comparisons.
+
+
+File: gawk.info, Node: POSIX Floating Point Problems, Prev: Unexpected Results, Up: Floating Point Issues
+
+15.1.1.3 Standards Versus Existing Practice
+...........................................
+
+Historically, `awk' has converted any non-numeric looking string to the
+numeric value zero, when required. Furthermore, the original
+definition of the language and the original POSIX standards specified
+that `awk' only understands decimal numbers (base 10), and not octal
+(base 8) or hexadecimal numbers (base 16).
+
+ Changes in the language of the 2001 and 2004 POSIX standards can be
+interpreted to imply that `awk' should support additional features.
+These features are:
+
+ * Interpretation of floating point data values specified in
+ hexadecimal notation (`0xDEADBEEF'). (Note: data values, _not_
+ source code constants.)
+
+ * Support for the special IEEE 754 floating point values "Not A
+ Number" (NaN), positive Infinity ("inf") and negative Infinity
+ ("-inf"). In particular, the format for these values is as
+ specified by the ISO 1999 C standard, which ignores case and can
+ allow machine-dependent additional characters after the `nan' and
+ allow either `inf' or `infinity'.
+
+ The first problem is that both of these are clear changes to
+historical practice:
+
+ * The `gawk' maintainer feels that supporting hexadecimal floating
+ point values, in particular, is ugly, and was never intended by the
+ original designers to be part of the language.
+
+ * Allowing completely alphabetic strings to have valid numeric
+ values is also a very severe departure from historical practice.
+
+ The second problem is that the `gawk' maintainer feels that this
+interpretation of the standard, which requires a certain amount of
+"language lawyering" to arrive at in the first place, was not even
+intended by the standard developers. In other words, "we see how you
+got where you are, but we don't think that that's where you want to be."
+
+ Recognizing the above issues, but attempting to provide compatibility
+with the earlier versions of the standard, the 2008 POSIX standard
+added explicit wording to allow, but not require, that `awk' support
+hexadecimal floating point values and special values for "Not A Number"
+and infinity.
+
+ Although the `gawk' maintainer continues to feel that providing
+those features is inadvisable, nevertheless, on systems that support
+IEEE floating point, it seems reasonable to provide _some_ way to
+support NaN and Infinity values. The solution implemented in `gawk' is
+as follows:
+
+ * With the `--posix' command-line option, `gawk' becomes "hands
+ off." String values are passed directly to the system library's
+ `strtod()' function, and if it successfully returns a numeric
+ value, that is what's used.(1) By definition, the results are not
+ portable across different systems. They are also a little
+ surprising:
+
+ $ echo nanny | gawk --posix '{ print $1 + 0 }'
+ -| nan
+ $ echo 0xDeadBeef | gawk --posix '{ print $1 + 0 }'
+ -| 3735928559
+
+ * Without `--posix', `gawk' interprets the four strings `+inf',
+ `-inf', `+nan', and `-nan' specially, producing the corresponding
+ special numeric values. The leading sign acts a signal to `gawk'
+ (and the user) that the value is really numeric. Hexadecimal
+ floating point is not supported (unless you also use
+ `--non-decimal-data', which is _not_ recommended). For example:
+
+ $ echo nanny | gawk '{ print $1 + 0 }'
+ -| 0
+ $ echo +nan | gawk '{ print $1 + 0 }'
+ -| nan
+ $ echo 0xDeadBeef | gawk '{ print $1 + 0 }'
+ -| 0
+
+ `gawk' does ignore case in the four special values. Thus `+nan'
+ and `+NaN' are the same.
+
+ ---------- Footnotes ----------
+
+ (1) You asked for it, you got it.
+
+
+File: gawk.info, Node: Integer Programming, Prev: Floating Point Issues, Up: General Arithmetic
+
+15.1.2 Mixing Integers And Floating-point
+-----------------------------------------
+
+As has been mentioned already, `gawk' ordinarily uses hardware double
+precision with 64-bit IEEE binary floating-point representation for
+numbers on most systems. A large integer like 9,007,199,254,740,997 has
+a binary representation that, although finite, is more than 53 bits
+long; it must also be rounded to 53 bits. The biggest integer that can
+be stored in a C `double' is usually the same as the largest possible
+value of a `double'. If your system `double' is an IEEE 64-bit
+`double', this largest possible value is an integer and can be
+represented precisely. What more should one know about integers?
+
+ If you want to know what is the largest integer, such that it and
+all smaller integers can be stored in 64-bit doubles without losing
+precision, then the answer is 2^53. The next representable number is
+the even number 2^53 + 2, meaning it is unlikely that you will be able
+to make `gawk' print 2^53 + 1 in integer format. The range of integers
+exactly representable by a 64-bit double is [-2^53, 2^53]. If you ever
+see an integer outside this range in `gawk' using 64-bit doubles, you
+have reason to be very suspicious about the accuracy of the output.
+Here is a simple program with erroneous output:
+
+ $ gawk 'BEGIN { i = 2^53 - 1; for (j = 0; j < 4; j++) print i + j }'
+ -| 9007199254740991
+ -| 9007199254740992
+ -| 9007199254740992
+ -| 9007199254740994
+
+ The lesson is to not assume that any large integer printed by `gawk'
+represents an exact result from your computation, especially if it wraps
+around on your screen.
+
+
+File: gawk.info, Node: Floating-point Programming, Next: Gawk and MPFR, Prev: General Arithmetic, Up: Arbitrary Precision Arithmetic
+
+15.2 Understanding Floating-point Programming
+=============================================
+
+Numerical programming is an extensive area; if you need to develop
+sophisticated numerical algorithms then `gawk' may not be the ideal
+tool, and this documentation may not be sufficient. It might require
+digesting a book or two to really internalize how to compute with ideal
+accuracy and precision, and the result often depends on the particular
+application.
+
+ NOTE: A floating-point calculation's "accuracy" is how close it
+ comes to the real value. This is as opposed to the "precision",
+ which usually refers to the number of bits used to represent the
+ number (see the Wikipedia article
+ (http://en.wikipedia.org/wiki/Accuracy_and_precision) for more
+ information).
+
+ There are two options for doing floating-point calculations:
+hardware floating-point (as used by standard `awk' and the default for
+`gawk'), and "arbitrary-precision" floating-point, which is software
+based. From this point forward, this major node aims to provide enough
+information to understand both, and then will focus on `gawk''s
+facilities for the latter.(1)
+
+ Binary floating-point representations and arithmetic are inexact.
+Simple values like 0.1 cannot be precisely represented using binary
+floating-point numbers, and the limited precision of floating-point
+numbers means that slight changes in the order of operations or the
+precision of intermediate storage can change the result. To make
+matters worse, with arbitrary precision floating-point, you can set the
+precision before starting a computation, but then you cannot be sure of
+the number of significant decimal places in the final result.
+
+ Sometimes, before you start to write any code, you should think more
+about what you really want and what's really happening. Consider the
+two numbers in the following example:
+
+ x = 0.875 # 1/2 + 1/4 + 1/8
+ y = 0.425
+
+ Unlike the number in `y', the number stored in `x' is exactly
+representable in binary since it can be written as a finite sum of one
+or more fractions whose denominators are all powers of two. When
+`gawk' reads a floating-point number from program source, it
+automatically rounds that number to whatever precision your machine
+supports. If you try to print the numeric content of a variable using
+an output format string of `"%.17g"', it may not produce the same
+number as you assigned to it:
+
+ $ gawk 'BEGIN { x = 0.875; y = 0.425
+ > printf("%0.17g, %0.17g\n", x, y) }'
+ -| 0.875, 0.42499999999999999
+
+ Often the error is so small you do not even notice it, and if you do,
+you can always specify how much precision you would like in your output.
+Usually this is a format string like `"%.15g"', which when used in the
+previous example, produces an output identical to the input.
+
+ Because the underlying representation can be a little bit off from
+the exact value, comparing floating-point values to see if they are
+equal is generally not a good idea. Here is an example where it does
+not work like you expect:
+
+ $ gawk 'BEGIN { print (0.1 + 12.2 == 12.3) }'
+ -| 0
+
+ The loss of accuracy during a single computation with floating-point
+numbers usually isn't enough to worry about. However, if you compute a
+value which is the result of a sequence of floating point operations,
+the error can accumulate and greatly affect the computation itself.
+Here is an attempt to compute the value of the constant pi using one of
+its many series representations:
+
+ BEGIN {
+ x = 1.0 / sqrt(3.0)
+ n = 6
+ for (i = 1; i < 30; i++) {
+ n = n * 2.0
+ x = (sqrt(x * x + 1) - 1) / x
+ printf("%.15f\n", n * x)
+ }
+ }
+
+ When run, the early errors propagating through later computations
+cause the loop to terminate prematurely after an attempt to divide by
+zero.
+
+ $ gawk -f pi.awk
+ -| 3.215390309173475
+ -| 3.159659942097510
+ -| 3.146086215131467
+ -| 3.142714599645573
+ ...
+ -| 3.224515243534819
+ -| 2.791117213058638
+ -| 0.000000000000000
+ error--> gawk: pi.awk:6: fatal: division by zero attempted
+
+ Here is an additional example where the inaccuracies in internal
+representations yield an unexpected result:
+
+ $ gawk 'BEGIN {
+ > for (d = 1.1; d <= 1.5; d += 0.1)
+ > i++
+ > print i
+ > }'
+ -| 4
+
+ Can computation using arbitrary precision help with the previous
+examples? If you are impatient to know, see *note Exact Arithmetic::.
+
+ Instead of arbitrary precision floating-point arithmetic, often all
+you need is an adjustment of your logic or a different order for the
+operations in your calculation. The stability and the accuracy of the
+computation of the constant pi in the previous example can be enhanced
+by using the following simple algebraic transformation:
+
+ (sqrt(x * x + 1) - 1) / x = x / (sqrt(x * x + 1) + 1)
+
+After making this, change the program does converge to pi in under 30
+iterations:
+
+ $ gawk -f /tmp/pi2.awk
+ -| 3.215390309173473
+ -| 3.159659942097501
+ -| 3.146086215131436
+ -| 3.142714599645370
+ -| 3.141873049979825
+ ...
+ -| 3.141592653589797
+ -| 3.141592653589797
+
+ There is no need to be unduly suspicious about the results from
+floating-point arithmetic. The lesson to remember is that
+floating-point arithmetic is always more complex than arithmetic using
+pencil and paper. In order to take advantage of the power of computer
+floating-point, you need to know its limitations and work within them.
+For most casual use of floating-point arithmetic, you will often get
+the expected result in the end if you simply round the display of your
+final results to the correct number of significant decimal digits.
+
+ As general advice, avoid presenting numerical data in a manner that
+implies better precision than is actually the case.
+
+* Menu:
+
+* Floating-point Representation:: Binary floating-point representation.
+* Floating-point Context:: Floating-point context.
+* Rounding Mode:: Floating-point rounding mode.
+
+ ---------- Footnotes ----------
+
+ (1) If you are interested in other tools that perform arbitrary
+precision arithmetic, you may want to investigate the POSIX `bc' tool.
+See the POSIX specification for it
+(http://pubs.opengroup.org/onlinepubs/009695399/utilities/bc.html), for
+more information.
+
+
+File: gawk.info, Node: Floating-point Representation, Next: Floating-point Context, Up: Floating-point Programming
+
+15.2.1 Binary Floating-point Representation
+-------------------------------------------
+
+Although floating-point representations vary from machine to machine,
+the most commonly encountered representation is that defined by the
+IEEE 754 Standard. An IEEE-754 format value has three components:
+
+ * A sign bit telling whether the number is positive or negative.
+
+ * An "exponent", E, giving its order of magnitude.
+
+ * A "significand", S, specifying the actual digits of the number.
+
+ The value of the number is then S * 2^E. The first bit of a
+non-zero binary significand is always one, so the significand in an
+IEEE-754 format only includes the fractional part, leaving the leading
+one implicit. The significand is stored in "normalized" format, which
+means that the first bit is always a one.
+
+ Three of the standard IEEE-754 types are 32-bit single precision,
+64-bit double precision and 128-bit quadruple precision. The standard
+also specifies extended precision formats to allow greater precisions
+and larger exponent ranges.
+
+
+File: gawk.info, Node: Floating-point Context, Next: Rounding Mode, Prev: Floating-point Representation, Up: Floating-point Programming
+
+15.2.2 Floating-point Context
+-----------------------------
+
+A floating-point "context" defines the environment for arithmetic
+operations. It governs precision, sets rules for rounding, and limits
+the range for exponents. The context has the following primary
+components:
+
+"Precision"
+ Precision of the floating-point format in bits.
+
+"emax"
+ Maximum exponent allowed for this format.
+
+"emin"
+ Minimum exponent allowed for this format.
+
+"Underflow behavior"
+ The format may or may not support gradual underflow.
+
+"Rounding"
+ The rounding mode of this context.
+
+ *note table-ieee-formats:: lists the precision and exponent field
+values for the basic IEEE-754 binary formats:
+
+Name Total bits Precision emin emax
+---------------------------------------------------------------------------
+Single 32 24 -126 +127
+Double 64 53 -1022 +1023
+Quadruple 128 113 -16382 +16383
+
+Table 15.1: Basic IEEE Format Context Values
+
+ NOTE: The precision numbers include the implied leading one that
+ gives them one extra bit of significand.
+
+ A floating-point context can also determine which signals are treated
+as exceptions, and can set rules for arithmetic with special values.
+Please consult the IEEE-754 standard or other resources for details.
+
+ `gawk' ordinarily uses the hardware double precision representation
+for numbers. On most systems, this is IEEE-754 floating-point format,
+corresponding to 64-bit binary with 53 bits of precision.
+
+ NOTE: In case an underflow occurs, the standard allows, but does
+ not require, the result from an arithmetic operation to be a
+ number smaller than the smallest nonzero normalized number. Such
+ numbers do not have as many significant digits as normal numbers,
+ and are called "denormals" or "subnormals". The alternative,
+ simply returning a zero, is called "flush to zero". The basic
+ IEEE-754 binary formats support subnormal numbers.
+
+
+File: gawk.info, Node: Rounding Mode, Prev: Floating-point Context, Up: Floating-point Programming
+
+15.2.3 Floating-point Rounding Mode
+-----------------------------------
+
+The "rounding mode" specifies the behavior for the results of numerical
+operations when discarding extra precision. Each rounding mode indicates
+how the least significant returned digit of a rounded result is to be
+calculated. *note table-rounding-modes:: lists the IEEE-754 defined
+rounding modes:
+
+Rounding Mode IEEE Name
+--------------------------------------------------------------------------
+Round to nearest, ties to even `roundTiesToEven'
+Round toward plus Infinity `roundTowardPositive'
+Round toward negative Infinity `roundTowardNegative'
+Round toward zero `roundTowardZero'
+Round to nearest, ties away `roundTiesToAway'
+from zero
+
+Table 15.2: IEEE 754 Rounding Modes
+
+ The default mode `roundTiesToEven' is the most preferred, but the
+least intuitive. This method does the obvious thing for most values, by
+rounding them up or down to the nearest digit. For example, rounding
+1.132 to two digits yields 1.13, and rounding 1.157 yields 1.16.
+
+ However, when it comes to rounding a value that is exactly halfway
+between, things do not work the way you probably learned in school. In
+this case, the number is rounded to the nearest even digit. So
+rounding 0.125 to two digits rounds down to 0.12, but rounding 0.6875
+to three digits rounds up to 0.688. You probably have already
+encountered this rounding mode when using the `printf' routine to
+format floating-point numbers. For example:
+
+ BEGIN {
+ x = -4.5
+ for (i = 1; i < 10; i++) {
+ x += 1.0
+ printf("%4.1f => %2.0f\n", x, x)
+ }
+ }
+
+produces the following output when run:(1)
+
+ -3.5 => -4
+ -2.5 => -2
+ -1.5 => -2
+ -0.5 => 0
+ 0.5 => 0
+ 1.5 => 2
+ 2.5 => 2
+ 3.5 => 4
+ 4.5 => 4
+
+ The theory behind the rounding mode `roundTiesToEven' is that it
+more or less evenly distributes upward and downward rounds of exact
+halves, which might cause the round-off error to cancel itself out.
+This is the default rounding mode used in IEEE-754 computing functions
+and operators.
+
+ The other rounding modes are rarely used. Round toward positive
+infinity (`roundTowardPositive') and round toward negative infinity
+(`roundTowardNegative') are often used to implement interval arithmetic,
+where you adjust the rounding mode to calculate upper and lower bounds
+for the range of output. The `roundTowardZero' mode can be used for
+converting floating-point numbers to integers. The rounding mode
+`roundTiesToAway' rounds the result to the nearest number and selects
+the number with the larger magnitude if a tie occurs.
+
+ Some numerical analysts will tell you that your choice of rounding
+style has tremendous impact on the final outcome, and advise you to
+wait until final output for any rounding. Instead, you can often avoid
+round-off error problems by setting the precision initially to some
+value sufficiently larger than the final desired precision, so that the
+accumulation of round-off error does not influence the outcome. If you
+suspect that results from your computation are sensitive to
+accumulation of round-off error, one way to be sure is to look for a
+significant difference in output when you change the rounding mode.
+
+ ---------- Footnotes ----------
+
+ (1) It is possible for the output to be completely different if the
+C library in your system does not use the IEEE-754 even-rounding rule
+to round halfway cases for `printf()'.
+
+
+File: gawk.info, Node: Gawk and MPFR, Next: Arbitrary Precision Floats, Prev: Floating-point Programming, Up: Arbitrary Precision Arithmetic
+
+15.3 `gawk' + MPFR = Powerful Arithmetic
+========================================
+
+The rest of this major node describes how to use the arbitrary precision
+(also known as "multiple precision" or "infinite precision") numeric
+capabilities in `gawk' to produce maximally accurate results when you
+need it.
+
+ But first you should check if your version of `gawk' supports
+arbitrary precision arithmetic. The easiest way to find out is to look
+at the output of the following command:
+
+ $ gawk --version
+ -| GNU Awk 4.1.0 (GNU MPFR 3.1.0, GNU MP 5.0.3)
+ -| Copyright (C) 1989, 1991-2012 Free Software Foundation.
+ ...
+
+ `gawk' uses the GNU MPFR (http://www.mpfr.org) and GNU MP
+(http://gmplib.org) (GMP) libraries for arbitrary precision arithmetic
+on numbers. So if you do not see the names of these libraries in the
+output, then your version of `gawk' does not support arbitrary
+precision arithmetic.
+
+ Additionally, there are a few elements available in the `PROCINFO'
+array to provide information about the MPFR and GMP libraries. *Note
+Auto-set::, for more information.
+
+
+File: gawk.info, Node: Arbitrary Precision Floats, Next: Arbitrary Precision Integers, Prev: Gawk and MPFR, Up: Arbitrary Precision Arithmetic
+
+15.4 Arbitrary Precision Floating-point Arithmetic with `gawk'
+==============================================================
+
+`gawk' uses the GNU MPFR library for arbitrary precision floating-point
+arithmetic. The MPFR library provides precise control over precisions
+and rounding modes, and gives correctly rounded, reproducible,
+platform-independent results. With the command-line option `--bignum'
+or `-M', all floating-point arithmetic operators and numeric functions
+can yield results to any desired precision level supported by MPFR.
+Two built-in variables, `PREC' and `ROUNDMODE', provide control over
+the working precision and the rounding mode (*note Setting Precision::,
+and *note Setting Rounding Mode::). The precision and the rounding
+mode are set globally for every operation to follow.
+
+ The default working precision for arbitrary precision floating-point
+values is 53, and the default value for `ROUNDMODE' is `"N"', which
+selects the IEEE-754 `roundTiesToEven' rounding mode (*note Rounding
+Mode::).(1) `gawk' uses the default exponent range in MPFR (EMAX = 2^30
+- 1, EMIN = -EMAX) for all floating-point contexts. There is no
+explicit mechanism to adjust the exponent range. MPFR does not
+implement subnormal numbers by default, and this behavior cannot be
+changed in `gawk'.
+
+ NOTE: When emulating an IEEE-754 format (*note Setting
+ Precision::), `gawk' internally adjusts the exponent range to the
+ value defined for the format and also performs computations needed
+ for gradual underflow (subnormal numbers).
+
+ NOTE: MPFR numbers are variable-size entities, consuming only as
+ much space as needed to store the significant digits. Since the
+ performance using MPFR numbers pales in comparison to doing
+ arithmetic using the underlying machine types, you should consider
+ using only as much precision as needed by your program.
+
+* Menu:
+
+* Setting Precision:: Setting the working precision.
+* Setting Rounding Mode:: Setting the rounding mode.
+* Floating-point Constants:: Representing floating-point constants.
+* Changing Precision:: Changing the precision of a number.
+* Exact Arithmetic:: Exact arithmetic with floating-point numbers.
+
+ ---------- Footnotes ----------
+
+ (1) The default precision is 53, since according to the MPFR
+documentation, the library should be able to exactly reproduce all
+computations with double-precision machine floating-point numbers
+(`double' type in C), except the default exponent range is much wider
+and subnormal numbers are not implemented.
+
+
+File: gawk.info, Node: Setting Precision, Next: Setting Rounding Mode, Up: Arbitrary Precision Floats
+
+15.4.1 Setting the Working Precision
+------------------------------------
+
+`gawk' uses a global working precision; it does not keep track of the
+precision or accuracy of individual numbers. Performing an arithmetic
+operation or calling a built-in function rounds the result to the
+current working precision. The default working precision is 53, which
+can be modified using the built-in variable `PREC'. You can also set the
+value to one of the following pre-defined case-insensitive strings to
+emulate an IEEE-754 binary format:
+
+`PREC' IEEE-754 Binary Format
+---------------------------------------------------
+`"half"' 16-bit half-precision.
+`"single"' Basic 32-bit single precision.
+`"double"' Basic 64-bit double precision.
+`"quad"' Basic 128-bit quadruple precision.
+`"oct"' 256-bit octuple precision.
+
+ The following example illustrates the effects of changing precision
+on arithmetic operations:
+
+ $ gawk -M -v PREC=100 'BEGIN { x = 1.0e-400; print x + 0; \
+ > PREC = "double"; print x + 0 }'
+ -| 1e-400
+ -| 0
+
+ Binary and decimal precisions are related approximately, according
+to the formula:
+
+ PREC = 3.322 * DPS
+
+Here, PREC denotes the binary precision (measured in bits) and DPS
+(short for decimal places) is the decimal digits. We can easily
+calculate how many decimal digits the 53-bit significand of an IEEE
+double is equivalent to: 53 / 3.332 which is equal to about 15.95. But
+what does 15.95 digits actually mean? It depends whether you are
+concerned about how many digits you can rely on, or how many digits you
+need.
+
+ It is important to know how many bits it takes to uniquely identify
+a double-precision value (the C type `double'). If you want to convert
+from `double' to decimal and back to `double' (e.g., saving a `double'
+representing an intermediate result to a file, and later reading it
+back to restart the computation), then a few more decimal digits are
+required. 17 digits is generally enough for a `double'.
+
+ It can also be important to know what decimal numbers can be uniquely
+represented with a `double'. If you want to convert from decimal to
+`double' and back again, 15 digits is the most that you can get. Stated
+differently, you should not present the numbers from your
+floating-point computations with more than 15 significant digits in
+them.
+
+ Conversely, it takes a precision of 332 bits to hold an approximation
+of the constant pi that is accurate to 100 decimal places.
+
+ You should always add some extra bits in order to avoid the
+confusing round-off issues that occur because numbers are stored
+internally in binary.
+
+
+File: gawk.info, Node: Setting Rounding Mode, Next: Floating-point Constants, Prev: Setting Precision, Up: Arbitrary Precision Floats
+
+15.4.2 Setting the Rounding Mode
+--------------------------------
+
+The `ROUNDMODE' variable provides program level control over the
+rounding mode. The correspondence between `ROUNDMODE' and the IEEE
+rounding modes is shown in *note table-gawk-rounding-modes::.
+
+Rounding Mode IEEE Name `ROUNDMODE'
+---------------------------------------------------------------------------
+Round to nearest, ties to even `roundTiesToEven' `"N"' or `"n"'
+Round toward plus Infinity `roundTowardPositive' `"U"' or `"u"'
+Round toward negative Infinity `roundTowardNegative' `"D"' or `"d"'
+Round toward zero `roundTowardZero' `"Z"' or `"z"'
+Round to nearest, ties away `roundTiesToAway' `"A"' or `"a"'
+from zero
+
+Table 15.3: `gawk' Rounding Modes
+
+ `ROUNDMODE' has the default value `"N"', which selects the IEEE-754
+rounding mode `roundTiesToEven'. *note Table 15.3:
+table-gawk-rounding-modes, lists `"A"' to select the IEEE-754 mode
+`roundTiesToAway'. This is only available if your version of the MPFR
+library supports it; otherwise setting `ROUNDMODE' to this value has no
+effect. *Note Rounding Mode::, for the meanings of the various rounding
+modes.
+
+ Here is an example of how to change the default rounding behavior of
+`printf''s output:
+
+ $ gawk -M -v ROUNDMODE="Z" 'BEGIN { printf("%.2f\n", 1.378) }'
+ -| 1.37
+
+
+File: gawk.info, Node: Floating-point Constants, Next: Changing Precision, Prev: Setting Rounding Mode, Up: Arbitrary Precision Floats
+
+15.4.3 Representing Floating-point Constants
+--------------------------------------------
+
+Be wary of floating-point constants! When reading a floating-point
+constant from program source code, `gawk' uses the default precision,
+unless overridden by an assignment to the special variable `PREC' on
+the command line, to store it internally as a MPFR number. Changing
+the precision using `PREC' in the program text does _not_ change the
+precision of a constant. If you need to represent a floating-point
+constant at a higher precision than the default and cannot use a
+command line assignment to `PREC', you should either specify the
+constant as a string, or as a rational number, whenever possible. The
+following example illustrates the differences among various ways to
+print a floating-point constant:
+
+ $ gawk -M 'BEGIN { PREC = 113; printf("%0.25f\n", 0.1) }'
+ -| 0.1000000000000000055511151
+ $ gawk -M -v PREC=113 'BEGIN { printf("%0.25f\n", 0.1) }'
+ -| 0.1000000000000000000000000
+ $ gawk -M 'BEGIN { PREC = 113; printf("%0.25f\n", "0.1") }'
+ -| 0.1000000000000000000000000
+ $ gawk -M 'BEGIN { PREC = 113; printf("%0.25f\n", 1/10) }'
+ -| 0.1000000000000000000000000
+
+ In the first case, the number is stored with the default precision
+of 53.
+
+
+File: gawk.info, Node: Changing Precision, Next: Exact Arithmetic, Prev: Floating-point Constants, Up: Arbitrary Precision Floats
+
+15.4.4 Changing the Precision of a Number
+-----------------------------------------
+
+ The point is that in any variable-precision package, a decision is
+ made on how to treat numbers given as data, or arising in
+ intermediate results, which are represented in floating-point
+ format to a precision lower than working precision. Do we promote
+ them to full membership of the high-precision club, or do we treat
+ them and all their associates as second-class citizens? Sometimes
+ the first course is proper, sometimes the second, and it takes
+ careful analysis to tell which.
+
+ Dirk Laurie(1)
+
+ `gawk' does not implicitly modify the precision of any previously
+computed results when the working precision is changed with an
+assignment to `PREC'. The precision of a number is always the one that
+was used at the time of its creation, and there is no way for the user
+to explicitly change it afterwards. However, since the result of a
+floating-point arithmetic operation is always an arbitrary precision
+floating-point value--with a precision set by the value of `PREC'--one
+of the following workarounds effectively accomplishes the desired
+behavior:
+
+ x = x + 0.0
+
+or:
+
+ x += 0.0
+
+ ---------- Footnotes ----------
+
+ (1) Dirk Laurie. `Variable-precision Arithmetic Considered Perilous
+-- A Detective Story'. Electronic Transactions on Numerical Analysis.
+Volume 28, pp. 168-173, 2008.
+
+
+File: gawk.info, Node: Exact Arithmetic, Prev: Changing Precision, Up: Arbitrary Precision Floats
+
+15.4.5 Exact Arithmetic with Floating-point Numbers
+---------------------------------------------------
+
+ CAUTION: Never depend on the exactness of floating-point
+ arithmetic, even for apparently simple expressions!
+
+ Can arbitrary precision arithmetic give exact results? There are no
+easy answers. The standard rules of algebra often do not apply when
+using floating-point arithmetic. Among other things, the distributive
+and associative laws do not hold completely, and order of operation may
+be important for your computation. Rounding error, cumulative precision
+loss and underflow are often troublesome.
+
+ When `gawk' tests the expressions `0.1 + 12.2' and `12.3' for
+equality using the machine double precision arithmetic, it decides that
+they are not equal! (*Note Floating-point Programming::.) You can get
+the result you want by increasing the precision; 56 in this case will
+get the job done:
+
+ $ gawk -M -v PREC=56 'BEGIN { print (0.1 + 12.2 == 12.3) }'
+ -| 1
+
+ If adding more bits is good, perhaps adding even more bits of
+precision is better? Here is what happens if we use an even larger
+value of `PREC':
+
+ $ gawk -M -v PREC=201 'BEGIN { print (0.1 + 12.2 == 12.3) }'
+ -| 0
+
+ This is not a bug in `gawk' or in the MPFR library. It is easy to
+forget that the finite number of bits used to store the value is often
+just an approximation after proper rounding. The test for equality
+succeeds if and only if _all_ bits in the two operands are exactly the
+same. Since this is not necessarily true after floating-point
+computations with a particular precision and effective rounding rule, a
+straight test for equality may not work.
+
+ So, don't assume that floating-point values can be compared for
+equality. You should also exercise caution when using other forms of
+comparisons. The standard way to compare between floating-point
+numbers is to determine how much error (or "tolerance") you will allow
+in a comparison and check to see if one value is within this error
+range of the other.
+
+ In applications where 15 or fewer decimal places suffice, hardware
+double precision arithmetic can be adequate, and is usually much faster.
+But you do need to keep in mind that every floating-point operation can
+suffer a new rounding error with catastrophic consequences as
+illustrated by our earlier attempt to compute the value of the constant
+pi (*note Floating-point Programming::). Extra precision can greatly
+enhance the stability and the accuracy of your computation in such
+cases.
+
+ Repeated addition is not necessarily equivalent to multiplication in
+floating-point arithmetic. In the example in *note Floating-point
+Programming:::
+
+ $ gawk 'BEGIN {
+ > for (d = 1.1; d <= 1.5; d += 0.1)
+ > i++
+ > print i
+ > }'
+ -| 4
+
+you may or may not succeed in getting the correct result by choosing an
+arbitrarily large value for `PREC'. Reformulation of the problem at
+hand is often the correct approach in such situations.
+
+
+File: gawk.info, Node: Arbitrary Precision Integers, Prev: Arbitrary Precision Floats, Up: Arbitrary Precision Arithmetic
+
+15.5 Arbitrary Precision Integer Arithmetic with `gawk'
+=======================================================
+
+If the option `--bignum' or `-M' is specified, `gawk' performs all
+integer arithmetic using GMP arbitrary precision integers. Any number
+that looks like an integer in a program source or data file is stored
+as an arbitrary precision integer. The size of the integer is limited
+only by your computer's memory. The current floating-point context has
+no effect on operations involving integers. For example, the following
+computes 5^4^3^2, the result of which is beyond the limits of ordinary
+`gawk' numbers:
+
+ $ gawk -M 'BEGIN {
+ > x = 5^4^3^2
+ > print "# of digits =", length(x)
+ > print substr(x, 1, 20), "...", substr(x, length(x) - 19, 20)
+ > }'
+ -| # of digits = 183231
+ -| 62060698786608744707 ... 92256259918212890625
+
+ If you were to compute the same value using arbitrary precision
+floating-point values instead, the precision needed for correct output
+(using the formula `prec = 3.322 * dps'), would be 3.322 x 183231, or
+608693.
+
+ The result from an arithmetic operation with an integer and a
+floating-point value is a floating-point value with a precision equal
+to the working precision. The following program calculates the eighth
+term in Sylvester's sequence(1) using a recurrence:
+
+ $ gawk -M 'BEGIN {
+ > s = 2.0
+ > for (i = 1; i <= 7; i++)
+ > s = s * (s - 1) + 1
+ > print s
+ > }'
+ -| 113423713055421845118910464
+
+ The output differs from the actual number,
+113,423,713,055,421,844,361,000,443, because the default precision of
+53 is not enough to represent the floating-point results exactly. You
+can either increase the precision (100 is enough in this case), or
+replace the floating-point constant `2.0' with an integer, to perform
+all computations using integer arithmetic to get the correct output.
+
+ It will sometimes be necessary for `gawk' to implicitly convert an
+arbitrary precision integer into an arbitrary precision floating-point
+value. This is primarily because the MPFR library does not always
+provide the relevant interface to process arbitrary precision integers
+or mixed-mode numbers as needed by an operation or function. In such a
+case, the precision is set to the minimum value necessary for exact
+conversion, and the working precision is not used for this purpose. If
+this is not what you need or want, you can employ a subterfuge like
+this:
+
+ gawk -M 'BEGIN { n = 13; print (n + 0.0) % 2.0 }'
+
+ You can avoid this issue altogether by specifying the number as a
+floating-point value to begin with:
+
+ gawk -M 'BEGIN { n = 13.0; print n % 2.0 }'
+
+ Note that for the particular example above, there is likely best to
+just use the following:
+
+ gawk -M 'BEGIN { n = 13; print n % 2 }'
+
+ ---------- Footnotes ----------
+
+ (1) Weisstein, Eric W. `Sylvester's Sequence'. From MathWorld--A
+Wolfram Web Resource.
+`http://mathworld.wolfram.com/SylvestersSequence.html'
+
+
+File: gawk.info, Node: Dynamic Extensions, Next: Language History, Prev: Arbitrary Precision Arithmetic, Up: Top
+
+16 Writing Extensions for `gawk'
+********************************
+
+It is possible to add new built-in functions to `gawk' using
+dynamically loaded libraries. This facility is available on systems
+(such as GNU/Linux) that support the C `dlopen()' and `dlsym()'
+functions. This major node describes how to create extensions using
+code written in C or C++. If you don't know anything about C
+programming, you can safely skip this major node, although you may wish
+to review the documentation on the extensions that come with `gawk'
+(*note Extension Samples::), and the section on the `gawkextlib'
+project (*note gawkextlib::).
+
+ NOTE: When `--sandbox' is specified, extensions are disabled
+ (*note Options::).
+
+* Menu:
+
+* Extension Intro:: What is an extension.
+* Plugin License:: A note about licensing.
+* Extension Design:: Design notes about the extension API.
+* Extension API Description:: A full description of the API.
+* Extension Example:: Example C code for an extension.
+* Extension Samples:: The sample extensions that ship with
+ `gawk'.
+* gawkextlib:: The `gawkextlib' project.
+
+
+File: gawk.info, Node: Extension Intro, Next: Plugin License, Up: Dynamic Extensions
+
+16.1 Introduction
+=================
+
+An "extension" (sometimes called a "plug-in") is a piece of external
+compiled code that `gawk' can load at runtime to provide additional
+functionality, over and above the built-in capabilities described in
+the rest of this Info file.
+
+ Extensions are useful because they allow you (of course) to extend
+`gawk''s functionality. For example, they can provide access to system
+calls (such as `chdir()' to change directory) and to other C library
+routines that could be of use. As with most software, "the sky is the
+limit;" if you can imagine something that you might want to do and can
+write in C or C++, you can write an extension to do it!
+
+ Extensions are written in C or C++, using the "Application
+Programming Interface" (API) defined for this purpose by the `gawk'
+developers. The rest of this major node explains the design decisions
+behind the API, the facilities it provides and how to use them, and
+presents a small sample extension. In addition, it documents the
+sample extensions included in the `gawk' distribution, and describes
+the `gawkextlib' project.
+
+
+File: gawk.info, Node: Plugin License, Next: Extension Design, Prev: Extension Intro, Up: Dynamic Extensions
+
+16.2 Extension Licensing
+========================
+
+Every dynamic extension should define the global symbol
+`plugin_is_GPL_compatible' to assert that it has been licensed under a
+GPL-compatible license. If this symbol does not exist, `gawk' emits a
+fatal error and exits when it tries to load your extension.
+
+ The declared type of the symbol should be `int'. It does not need
+to be in any allocated section, though. The code merely asserts that
+the symbol exists in the global scope. Something like this is enough:
+
+ int plugin_is_GPL_compatible;
+
+
+File: gawk.info, Node: Extension Design, Next: Extension API Description, Prev: Plugin License, Up: Dynamic Extensions
+
+16.3 Extension API Design
+=========================
+
+The first version of extensions for `gawk' was developed in the
+mid-1990s and released with `gawk' 3.1 in the late 1990s. The basic
+mechanisms and design remained unchanged for close to 15 years, until
+2012.
+
+ The old extension mechanism used data types and functions from
+`gawk' itself, with a "clever hack" to install extension functions.
+
+ `gawk' included some sample extensions, of which a few were really
+useful. However, it was clear from the outset that the extension
+mechanism was bolted onto the side and was not really thought out.
+
+* Menu:
+
+* Old Extension Problems:: Problems with the old mechanism.
+* Extension New Mechanism Goals:: Goals for the new mechanism.
+* Extension Other Design Decisions:: Some other design decisions.
+* Extension Mechanism Outline:: An outline of how it works.
+* Extension Future Growth:: Some room for future growth.
+
+
+File: gawk.info, Node: Old Extension Problems, Next: Extension New Mechanism Goals, Up: Extension Design
+
+16.3.1 Problems With The Old Mechanism
+--------------------------------------
+
+The old extension mechanism had several problems:
+
+ * It depended heavily upon `gawk' internals. Any time the `NODE'
+ structure(1) changed, an extension would have to be recompiled.
+ Furthermore, to really write extensions required understanding
+ something about `gawk''s internal functions. There was some
+ documentation in this Info file, but it was quite minimal.
+
+ * Being able to call into `gawk' from an extension required linker
+ facilities that are common on Unix-derived systems but that did
+ not work on Windows systems; users wanting extensions on Windows
+ had to statically link them into `gawk', even though Windows
+ supports dynamic loading of shared objects.
+
+ * The API would change occasionally as `gawk' changed; no
+ compatibility between versions was ever offered or planned for.
+
+ Despite the drawbacks, the `xgawk' project developers forked `gawk'
+and developed several significant extensions. They also enhanced
+`gawk''s facilities relating to file inclusion and shared object access.
+
+ A new API was desired for a long time, but only in 2012 did the
+`gawk' maintainer and the `xgawk' developers finally start working on
+it together. More information about the `xgawk' project is provided in
+*note gawkextlib::.
+
+ ---------- Footnotes ----------
+
+ (1) A critical central data structure inside `gawk'.
+
+
+File: gawk.info, Node: Extension New Mechanism Goals, Next: Extension Other Design Decisions, Prev: Old Extension Problems, Up: Extension Design
+
+16.3.2 Goals For A New Mechanism
+--------------------------------
+
+Some goals for the new API were:
+
+ * The API should be independent of `gawk' internals. Changes in
+ `gawk' internals should not be visible to the writer of an
+ extension function.
+
+ * The API should provide _binary_ compatibility across `gawk'
+ releases as long as the API itself does not change.
+
+ * The API should enable extensions written in C to have roughly the
+ same "appearance" to `awk'-level code as `awk' functions do. This
+ means that extensions should have:
+
+ - The ability to access function parameters.
+
+ - The ability to turn an undefined parameter into an array
+ (call by reference).
+
+ - The ability to create, access and update global variables.
+
+ - Easy access to all the elements of an array at once ("array
+ flattening") in order to loop over all the element in an easy
+ fashion for C code.
+
+ - The ability to create arrays (including `gawk''s true
+ multi-dimensional arrays).
+
+ Some additional important goals were:
+
+ * The API should use only features in ISO C 90, so that extensions
+ can be written using the widest range of C and C++ compilers. The
+ header should include the appropriate `#ifdef __cplusplus' and
+ `extern "C"' magic so that a C++ compiler could be used. (If
+ using C++, the runtime system has to be smart enough to call any
+ constructors and destructors, as `gawk' is a C program. As of this
+ writing, this has not been tested.)
+
+ * The API mechanism should not require access to `gawk''s symbols(1)
+ by the compile-time or dynamic linker, in order to enable creation
+ of extensions that also work on Windows.
+
+ During development, it became clear that there were other features
+that should be available to extensions, which were also subsequently
+provided:
+
+ * Extensions should have the ability to hook into `gawk''s I/O
+ redirection mechanism. In particular, the `xgawk' developers
+ provided a so-called "open hook" to take over reading records.
+ During development, this was generalized to allow extensions to
+ hook into input processing, output processing, and two-way I/O.
+
+ * An extension should be able to provide a "call back" function to
+ perform clean up actions when `gawk' exits.
+
+ * An extension should be able to provide a version string so that
+ `gawk''s `--version' option can provide information about
+ extensions as well.
+
+ ---------- Footnotes ----------
+
+ (1) The "symbols" are the variables and functions defined inside
+`gawk'. Access to these symbols by code external to `gawk' loaded
+dynamically at runtime is problematic on Windows.
+
+
+File: gawk.info, Node: Extension Other Design Decisions, Next: Extension Mechanism Outline, Prev: Extension New Mechanism Goals, Up: Extension Design
+
+16.3.3 Other Design Decisions
+-----------------------------
+
+As an "arbitrary" design decision, extensions can read the values of
+built-in variables and arrays (such as `ARGV' and `FS'), but cannot
+change them, with the exception of `PROCINFO'.
+
+ The reason for this is to prevent an extension function from
+affecting the flow of an `awk' program outside its control. While a
+real `awk' function can do what it likes, that is at the discretion of
+the programmer. An extension function should provide a service or make
+a C API available for use within `awk', and not mess with `FS' or
+`ARGC' and `ARGV'.
+
+ In addition, it becomes easy to start down a slippery slope. How
+much access to `gawk' facilities do extensions need? Do they need
+`getline'? What about calling `gsub()' or compiling regular
+expressions? What about calling into `awk' functions? (_That_ would be
+messy.)
+
+ In order to avoid these issues, the `gawk' developers chose to start
+with the simplest, most basic features that are still truly useful.
+
+ Another decision is that although `gawk' provides nice things like
+MPFR, and arrays indexed internally by integers, these features are not
+being brought out to the API in order to keep things simple and close to
+traditional `awk' semantics. (In fact, arrays indexed internally by
+integers are so transparent that they aren't even documented!)
+
+ With time, the API will undoubtedly evolve; the `gawk' developers
+expect this to be driven by user needs. For now, the current API seems
+to provide a minimal yet powerful set of features for creating
+extensions.
+
+
+File: gawk.info, Node: Extension Mechanism Outline, Next: Extension Future Growth, Prev: Extension Other Design Decisions, Up: Extension Design
+
+16.3.4 At A High Level How It Works
+-----------------------------------
+
+The requirement to avoid access to `gawk''s symbols is, at first
+glance, a difficult one to meet.
+
+ One design, apparently used by Perl and Ruby and maybe others, would
+be to make the mainline `gawk' code into a library, with the `gawk'
+utility a small C `main()' function linked against the library.
+
+ This seemed like the tail wagging the dog, complicating build and
+installation and making a simple copy of the `gawk' executable from one
+system to another (or one place to another on the same system!) into a
+chancy operation.
+
+ Pat Rankin suggested the solution that was adopted. Communication
+between `gawk' and an extension is two-way. First, when an extension
+is loaded, it is passed a pointer to a `struct' whose fields are
+function pointers. This is shown in *note load-extension::.
+
+ API
+ Struct
+ +---+
+ | |
+ +---+
+ +---------------| |
+ | +---+ dl_load(api_p, id);
+ | | | ___________________
+ | +---+ |
+ | +---------| | __________________ |
+ | | +---+ ||
+ | | | | ||
+ | | +---+ ||
+ | | +---| | ||
+ | | | +---+ \ || /
+ | | | \ /
+ v v v \/
++-------+-+---+-+---+-+------------------+--------------------+
+| |x| |x| |x| |OOOOOOOOOOOOOOOOOOOO|
+| |x| |x| |x| |OOOOOOOOOOOOOOOOOOOO|
+| |x| |x| |x| |OOOOOOOOOOOOOOOOOOOO|
++-------+-+---+-+---+-+------------------+--------------------+
+
+ gawk Main Program Address Space Extension
+Figure 16.1: Loading The Extension
+
+ The extension can call functions inside `gawk' through these
+function pointers, at runtime, without needing (link-time) access to
+`gawk''s symbols. One of these function pointers is to a function for
+"registering" new built-in functions. This is shown in *note
+load-new-function::.
+
+ register_ext_func({ "chdir", do_chdir, 1 });
+
+ +--------------------------------------------+
+ | |
+ V |
++-------+-+---+-+---+-+------------------+--------------+-+---+
+| |x| |x| |x| |OOOOOOOOOOOOOO|X|OOO|
+| |x| |x| |x| |OOOOOOOOOOOOOO|X|OOO|
+| |x| |x| |x| |OOOOOOOOOOOOOO|X|OOO|
++-------+-+---+-+---+-+------------------+--------------+-+---+
+
+ gawk Main Program Address Space Extension
+Figure 16.2: Loading The New Function
+
+ In the other direction, the extension registers its new functions
+with `gawk' by passing function pointers to the functions that provide
+the new feature (`do_chdir()', for example). `gawk' associates the
+function pointer with a name and can then call it, using a defined
+calling convention. This is shown in *note call-new-function::.
+
+ BEGIN {
+ chdir("/path") (*fnptr)(1);
+ }
+ +--------------------------------------------+
+ | |
+ | V
++-------+-+---+-+---+-+------------------+--------------+-+---+
+| |x| |x| |x| |OOOOOOOOOOOOOO|X|OOO|
+| |x| |x| |x| |OOOOOOOOOOOOOO|X|OOO|
+| |x| |x| |x| |OOOOOOOOOOOOOO|X|OOO|
++-------+-+---+-+---+-+------------------+--------------+-+---+
+
+ gawk Main Program Address Space Extension
+Figure 16.3: Calling The New Function
+
+ The `do_XXX()' function, in turn, then uses the function pointers in
+the API `struct' to do its work, such as updating variables or arrays,
+printing messages, setting `ERRNO', and so on.
+
+ Convenience macros in the `gawkapi.h' header file make calling
+through the function pointers look like regular function calls so that
+extension code is quite readable and understandable.
+
+ Although all of this sounds medium complicated, the result is that
+extension code is quite clean and straightforward. This can be seen in
+the sample extensions `filefuncs.c' (*note Extension Example::) and
+also the `testext.c' code for testing the APIs.
+
+ Some other bits and pieces:
+
+ * The API provides access to `gawk''s `do_XXX' values, reflecting
+ command line options, like `do_lint', `do_profiling' and so on
+ (*note Extension API Variables::). These are informational: an
+ extension cannot affect these inside `gawk'. In addition,
+ attempting to assign to them produces a compile-time error.
+
+ * The API also provides major and minor version numbers, so that an
+ extension can check if the `gawk' it is loaded with supports the
+ facilities it was compiled with. (Version mismatches "shouldn't"
+ happen, but we all know how _that_ goes.) *Note Extension
+ Versioning::, for details.
+
+
+File: gawk.info, Node: Extension Future Growth, Prev: Extension Mechanism Outline, Up: Extension Design
+
+16.3.5 Room For Future Growth
+-----------------------------
+
+The API provides room for future growth, in two ways.
+
+ An "extension id" is passed into the extension when its loaded. This
+extension id is then passed back to `gawk' with each function call.
+This allows `gawk' to identify the extension calling into it, should it
+need to know.
+
+ A "name space" is passed into `gawk' when an extension function is
+registered. This provides for a future mechanism for grouping
+extension functions and possibly avoiding name conflicts.
+
+ Of course, as of this writing, no decisions have been made with
+respect to any of the above.
+
+
+File: gawk.info, Node: Extension API Description, Next: Extension Example, Prev: Extension Design, Up: Dynamic Extensions
+
+16.4 API Description
+====================
+
+This (rather large) minor node describes the API in detail.
+
+* Menu:
+
+* Extension API Functions Introduction:: Introduction to the API functions.
+* General Data Types:: The data types.
+* Requesting Values:: How to get a value.
+* Constructor Functions:: Functions for creating values.
+* Registration Functions:: Functions to register things with
+ `gawk'.
+* Printing Messages:: Functions for printing messages.
+* Updating `ERRNO':: Functions for updating `ERRNO'.
+* Accessing Parameters:: Functions for accessing parameters.
+* Symbol Table Access:: Functions for accessing global
+ variables.
+* Array Manipulation:: Functions for working with arrays.
+* Extension API Variables:: Variables provided by the API.
+* Extension API Boilerplate:: Boilerplate code for using the API.
+* Finding Extensions:: How `gawk' finds compiled
+ extensions.
+
+
+File: gawk.info, Node: Extension API Functions Introduction, Next: General Data Types, Up: Extension API Description
+
+16.4.1 Introduction
+-------------------
+
+Access to facilities within `gawk' are made available by calling
+through function pointers passed into your extension.
+
+ API function pointers are provided for the following kinds of
+operations:
+
+ * Registrations functions. You may register:
+ - extension functions,
+
+ - exit callbacks,
+
+ - a version string,
+
+ - input parsers,
+
+ - output wrappers,
+
+ - and two-way processors.
+ All of these are discussed in detail, later in this major node.
+
+ * Printing fatal, warning, and "lint" warning messages.
+
+ * Updating `ERRNO', or unsetting it.
+
+ * Accessing parameters, including converting an undefined parameter
+ into an array.
+
+ * Symbol table access: retrieving a global variable, creating one,
+ or changing one. This also includes the ability to create a scalar
+ variable that will be _constant_ within `awk' code.
+
+ * Creating and releasing cached values; this provides an efficient
+ way to use values for multiple variables and can be a big
+ performance win.
+
+ * Manipulating arrays:
+ - Retrieving, adding, deleting, and modifying elements
+
+ - Getting the count of elements in an array
+
+ - Creating a new array
+
+ - Clearing an array
+
+ - Flattening an array for easy C style looping over all its
+ indices and elements
+
+ Some points about using the API:
+
+ * You must include `<sys/types.h>' and `<sys/stat.h>' before
+ including the `gawkapi.h' header file. In addition, you must
+ include either `<stddef.h>' or `<stdlib.h>' to get the definition
+ of `size_t'. If you wish to use the boilerplate `dl_load_func()'
+ macro, you will need to include `<stdio.h>' as well. Finally, to
+ pass reasonable integer values for `ERRNO', you will need to
+ include `<errno.h>'.
+
+ * Although the API only uses ISO C 90 features, there is an
+ exception; the "constructor" functions use the `inline' keyword.
+ If your compiler does not support this keyword, you should either
+ place `-Dinline=''' on your command line, or use the GNU Autotools
+ and include a `config.h' file in your extensions.
+
+ * All pointers filled in by `gawk' are to memory managed by `gawk'
+ and should be treated by the extension as read-only. Memory for
+ _all_ strings passed into `gawk' from the extension _must_ come
+ from `malloc()' and is managed by `gawk' from then on.
+
+ * The API defines several simple structs that map values as seen
+ from `awk'. A value can be a `double', a string, or an array (as
+ in multidimensional arrays, or when creating a new array).
+ Strings maintain both pointer and length since embedded `NUL'
+ characters are allowed.
+
+ By intent, strings are maintained using the current multibyte
+ encoding (as defined by `LC_XXX' environment variables) and not
+ using wide characters. This matches how `gawk' stores strings
+ internally and also how characters are likely to be input and
+ output from files.
+
+ * When retrieving a value (such as a parameter or that of a global
+ variable or array element), the extension requests a specific type
+ (number, string, scalars, value cookie, array, or "undefined").
+ When the request is "undefined," the returned value will have the
+ real underlying type.
+
+ However, if the request and actual type don't match, the access
+ function returns "false" and fills in the type of the actual value
+ that is there, so that the extension can, e.g., print an error
+ message ("scalar passed where array expected").
+
+
+ While you may call the API functions by using the function pointers
+directly, the interface is not so pretty. To make extension code look
+more like regular code, the `gawkapi.h' header file defines a number of
+macros which you should use in your code. This minor node presents the
+macros as if they were functions.
+
+
+File: gawk.info, Node: General Data Types, Next: Requesting Values, Prev: Extension API Functions Introduction, Up: Extension API Description
+
+16.4.2 General Purpose Data Types
+---------------------------------
+
+ I have a true love/hate relationship with unions.
+ Arnold Robbins
+
+ That's the thing about unions: the compiler will arrange things so
+ they can accommodate both love and hate.
+ Chet Ramey
+
+ The extension API defines a number of simple types and structures
+for general purpose use. Additional, more specialized, data structures,
+are introduced in subsequent minor nodes, together with the functions
+that use them.
+
+`typedef void *awk_ext_id_t;'
+ A value of this type is received from `gawk' when an extension is
+ loaded. That value must then be passed back to `gawk' as the
+ first parameter of each API function.
+
+`#define awk_const ...'
+ This macro expands to `const' when compiling an extension, and to
+ nothing when compiling `gawk' itself. This makes certain fields
+ in the API data structures unwritable from extension code, while
+ allowing `gawk' to use them as it needs to.
+
+`typedef int awk_bool_t;'
+ A simple boolean type. At the moment, the API does not define
+ special "true" and "false" values, although perhaps it should.
+
+`typedef struct {'
+` char *str; /* data */'
+` size_t len; /* length thereof, in chars */'
+`} awk_string_t;'
+ This represents a mutable string. `gawk' owns the memory pointed
+ to if it supplied the value. Otherwise, it takes ownership of the
+ memory pointed to. *Such memory must come from `malloc()'!*
+
+ As mentioned earlier, strings are maintained using the current
+ multibyte encoding.
+
+`typedef enum {'
+` AWK_UNDEFINED,'
+` AWK_NUMBER,'
+` AWK_STRING,'
+` AWK_ARRAY,'
+` AWK_SCALAR, /* opaque access to a variable */'
+` AWK_VALUE_COOKIE /* for updating a previously created value */'
+`} awk_valtype_t;'
+ This `enum' indicates the type of a value. It is used in the
+ following `struct'.
+
+`typedef struct {'
+` awk_valtype_t val_type;'
+` union {'
+` awk_string_t s;'
+` double d;'
+` awk_array_t a;'
+` awk_scalar_t scl;'
+` awk_value_cookie_t vc;'
+` } u;'
+`} awk_value_t;'
+ An "`awk' value." The `val_type' member indicates what kind of
+ value the `union' holds, and each member is of the appropriate
+ type.
+
+`#define str_value u.s'
+`#define num_value u.d'
+`#define array_cookie u.a'
+`#define scalar_cookie u.scl'
+`#define value_cookie u.vc'
+ These macros make accessing the fields of the `awk_value_t' more
+ readable.
+
+`typedef void *awk_scalar_t;'
+ Scalars can be represented as an opaque type. These values are
+ obtained from `gawk' and then passed back into it. This is
+ discussed in a general fashion below, and in more detail in *note
+ Symbol table by cookie::.
+
+`typedef void *awk_value_cookie_t;'
+ A "value cookie" is an opaque type representing a cached value.
+ This is also discussed in a general fashion below, and in more
+ detail in *note Cached values::.
+
+
+ Scalar values in `awk' are either numbers or strings. The
+`awk_value_t' struct represents values. The `val_type' member
+indicates what is in the `union'.
+
+ Representing numbers is easy--the API uses a C `double'. Strings
+require more work. Since `gawk' allows embedded `NUL' bytes in string
+values, a string must be represented as a pair containing a
+data-pointer and length. This is the `awk_string_t' type.
+
+ Identifiers (i.e., the names of global variables) can be associated
+with either scalar values or with arrays. In addition, `gawk' provides
+true arrays of arrays, where any given array element can itself be an
+array. Discussion of arrays is delayed until *note Array
+Manipulation::.
+
+ The various macros listed earlier make it easier to use the elements
+of the `union' as if they were fields in a `struct'; this is a common
+coding practice in C. Such code is easier to write and to read,
+however it remains _your_ responsibility to make sure that the
+`val_type' member correctly reflects the type of the value in the
+`awk_value_t'.
+
+ Conceptually, the first three members of the `union' (number, string,
+and array) are all that is needed for working with `awk' values.
+However, since the API provides routines for accessing and changing the
+value of global scalar variables only by using the variable's name,
+there is a performance penalty: `gawk' must find the variable each time
+it is accessed and changed. This turns out to be a real issue, not
+just a theoretical one.
+
+ Thus, if you know that your extension will spend considerable time
+reading and/or changing the value of one or more scalar variables, you
+can obtain a "scalar cookie"(1) object for that variable, and then use
+the cookie for getting the variable's value or for changing the
+variable's value. This is the `awk_scalar_t' type and `scalar_cookie'
+macro. Given a scalar cookie, `gawk' can directly retrieve or modify
+the value, as required, without having to first find it.
+
+ The `awk_value_cookie_t' type and `value_cookie' macro are similar.
+If you know that you wish to use the same numeric or string _value_ for
+one or more variables, you can create the value once, retaining a
+"value cookie" for it, and then pass in that value cookie whenever you
+wish to set the value of a variable. This saves both storage space
+within the running `gawk' process as well as the time needed to create
+the value.
+
+ ---------- Footnotes ----------
+
+ (1) See the "cookie" entry in the Jargon file
+(http://catb.org/jargon/html/C/cookie.html) for a definition of
+"cookie", and the "magic cookie" entry in the Jargon file
+(http://catb.org/jargon/html/M/magic-cookie.html) for a nice example.
+See also the entry for "Cookie" in the *note Glossary::.
+
+
+File: gawk.info, Node: Requesting Values, Next: Constructor Functions, Prev: General Data Types, Up: Extension API Description
+
+16.4.3 Requesting Values
+------------------------
+
+All of the functions that return values from `gawk' work in the same
+way. You pass in an `awk_valtype_t' value to indicate what kind of
+value you expect. If the actual value matches what you requested, the
+function returns true and fills in the `awk_value_t' result.
+Otherwise, the function returns false, and the `val_type' member
+indicates the type of the actual value. You may then print an error
+message, or reissue the request for the actual value type, as
+appropriate. This behavior is summarized in *note
+table-value-types-returned::.
+
+ Type of Actual Value:
+--------------------------------------------------------------------------
+
+ String Number Array Undefined
+------------------------------------------------------------------------------
+ String String String false false
+ Number Number if can Number false false
+ be converted,
+ else false
+Type Array false false Array false
+Requested: Scalar Scalar Scalar false false
+ Undefined String Number Array Undefined
+ Value false false false false
+ Cookie
+
+Table 16.1: Value Types Returned
+
+
+File: gawk.info, Node: Constructor Functions, Next: Registration Functions, Prev: Requesting Values, Up: Extension API Description
+
+16.4.4 Constructor Functions and Convenience Macros
+---------------------------------------------------
+
+The API provides a number of "constructor" functions for creating
+string and numeric values, as well as a number of convenience macros.
+This node presents them all as function prototypes, in the way that
+extension code would use them.
+
+`static inline awk_value_t *'
+`make_const_string(const char *string, size_t length, awk_value_t *result)'
+ This function creates a string value in the `awk_value_t' variable
+ pointed to by `result'. It expects `string' to be a C string
+ constant (or other string data), and automatically creates a
+ _copy_ of the data for storage in `result'. It returns `result'.
+
+`static inline awk_value_t *'
+`make_malloced_string(const char *string, size_t length, awk_value_t *result)'
+ This function creates a string value in the `awk_value_t' variable
+ pointed to by `result'. It expects `string' to be a `char *' value
+ pointing to data previously obtained from `malloc()'. The idea here
+ is that the data is passed directly to `gawk', which assumes
+ responsibility for it. It returns `result'.
+
+`static inline awk_value_t *'
+`make_null_string(awk_value_t *result)'
+ This specialized function creates a null string (the "undefined"
+ value) in the `awk_value_t' variable pointed to by `result'. It
+ returns `result'.
+
+`static inline awk_value_t *'
+`make_number(double num, awk_value_t *result)'
+ This function simply creates a numeric value in the `awk_value_t'
+ variable pointed to by `result'.
+
+ Two convenience macros may be used for allocating storage from
+`malloc()' and `realloc()'. If the allocation fails, they cause `gawk'
+to exit with a fatal error message. They should be used as if they were
+procedure calls that do not return a value.
+
+`emalloc(pointer, type, size, message)'
+ The arguments to this macro are as follows:
+ `pointer'
+ The pointer variable to point at the allocated storage.
+
+ `type'
+ The type of the pointer variable, used to create a cast for
+ the call to `malloc()'.
+
+ `size'
+ The total number of bytes to be allocated.
+
+ `message'
+ A message to be prefixed to the fatal error message.
+ Typically this is the name of the function using the macro.
+
+ For example, you might allocate a string value like so:
+
+ awk_value_t result;
+ char *message;
+ const char greet[] = "Don't Panic!";
+
+ emalloc(message, char *, sizeof(greet), "myfunc");
+ strcpy(message, greet);
+ make_malloced_string(message, strlen(message), & result);
+
+`erealloc(pointer, type, size, message)'
+ This is like `emalloc()', but it calls `realloc()', instead of
+ `malloc()'. The arguments are the same as for the `emalloc()'
+ macro.
+
+
+File: gawk.info, Node: Registration Functions, Next: Printing Messages, Prev: Constructor Functions, Up: Extension API Description
+
+16.4.5 Registration Functions
+-----------------------------
+
+This minor node describes the API functions for registering parts of
+your extension with `gawk'.
+
+* Menu:
+
+* Extension Functions:: Registering extension functions.
+* Exit Callback Functions:: Registering an exit callback.
+* Extension Version String:: Registering a version string.
+* Input Parsers:: Registering an input parser.
+* Output Wrappers:: Registering an output wrapper.
+* Two-way processors:: Registering a two-way processor.
+
+
+File: gawk.info, Node: Extension Functions, Next: Exit Callback Functions, Up: Registration Functions
+
+16.4.5.1 Registering An Extension Function
+..........................................
+
+Extension functions are described by the following record:
+
+ typedef struct {
+ const char *name;
+ awk_value_t *(*function)(int num_actual_args, awk_value_t *result);
+ size_t num_expected_args;
+ } awk_ext_func_t;
+
+ The fields are:
+
+`const char *name;'
+ The name of the new function. `awk' level code calls the function
+ by this name. This is a regular C string.
+
+`awk_value_t *(*function)(int num_actual_args, awk_value_t *result);'
+ This is a pointer to the C function that provides the desired
+ functionality. The function must fill in the result with either a
+ number or a string. `awk' takes ownership of any string memory.
+ As mentioned earlier, string memory *must* come from `malloc()'.
+
+ The function must return the value of `result'. This is for the
+ convenience of the calling code inside `gawk'.
+
+`size_t num_expected_args;'
+ This is the number of arguments the function expects to receive.
+ Each extension function may decide what to do if the number of
+ arguments isn't what it expected. Following `awk' functions, it
+ is likely OK to ignore extra arguments.
+
+ Once you have a record representing your extension function, you
+register it with `gawk' using this API function:
+
+`awk_bool_t add_ext_func(const char *namespace, const awk_ext_func_t *func);'
+ This function returns true upon success, false otherwise. The
+ `namespace' parameter is currently not used; you should pass in an
+ empty string (`""'). The `func' pointer is the address of a
+ `struct' representing your function, as just described.
+
+
+File: gawk.info, Node: Exit Callback Functions, Next: Extension Version String, Prev: Extension Functions, Up: Registration Functions
+
+16.4.5.2 Registering An Exit Callback Function
+..............................................
+
+An "exit callback" function is a function that `gawk' calls before it
+exits. Such functions are useful if you have general "clean up" tasks
+that should be performed in your extension (such as closing data base
+connections or other resource deallocations). You can register such a
+function with `gawk' using the following function.
+
+`void awk_atexit(void (*funcp)(void *data, int exit_status),'
+` void *arg0);'
+ The parameters are:
+ `funcp'
+ A pointer to the function to be called before `gawk' exits.
+ The `data' parameter will be the original value of `arg0'.
+ The `exit_status' parameter is the exit status value that
+ `gawk' will pass to the `exit()' system call.
+
+ `arg0'
+ A pointer to private data which `gawk' saves in order to pass
+ to the function pointed to by `funcp'.
+
+ Exit callback functions are called in Last-In-First-Out (LIFO)
+order--that is, in the reverse order in which they are registered with
+`gawk'.
+
+
+File: gawk.info, Node: Extension Version String, Next: Input Parsers, Prev: Exit Callback Functions, Up: Registration Functions
+
+16.4.5.3 Registering An Extension Version String
+................................................
+
+You can register a version string which indicates the name and version
+of your extension, with `gawk', as follows:
+
+`void register_ext_version(const char *version);'
+ Register the string pointed to by `version' with `gawk'. `gawk'
+ does _not_ copy the `version' string, so it should not be changed.
+
+ `gawk' prints all registered extension version strings when it is
+invoked with the `--version' option.
+
+
+File: gawk.info, Node: Input Parsers, Next: Output Wrappers, Prev: Extension Version String, Up: Registration Functions
+
+16.4.5.4 Customized Input Parsers
+.................................
+
+By default, `gawk' reads text files as its input. It uses the value of
+`RS' to find the end of the record, and then uses `FS' (or
+`FIELDWIDTHS') to split it into fields (*note Reading Files::).
+Additionally, it sets the value of `RT' (*note Built-in Variables::).
+
+ If you want, you can provide your own, custom, input parser. An
+input parser's job is to return a record to the `gawk' record processing
+code, along with indicators for the value and length of the data to be
+used for `RT', if any.
+
+ To provide an input parser, you must first provide two functions
+(where XXX is a prefix name for your extension):
+
+`awk_bool_t XXX_can_take_file(const awk_input_buf_t *iobuf)'
+ This function examines the information available in `iobuf' (which
+ we discuss shortly). Based on the information there, it decides
+ if the input parser should be used for this file. If so, it
+ should return true. Otherwise, it should return false. It should
+ not change any state (variable values, etc.) within `gawk'.
+
+`awk_bool_t XXX_take_control_of(awk_input_buf_t *iobuf)'
+ When `gawk' decides to hand control of the file over to the input
+ parser, it calls this function. This function in turn must fill
+ in certain fields in the `awk_input_buf_t' structure, and ensure
+ that certain conditions are true. It should then return true. If
+ an error of some kind occurs, it should not fill in any fields,
+ and should return false; then `gawk' will not use the input parser.
+ The details are presented shortly.
+
+ Your extension should package these functions inside an
+`awk_input_parser_t', which looks like this:
+
+ typedef struct input_parser {
+ const char *name; /* name of parser */
+ awk_bool_t (*can_take_file)(const awk_input_buf_t *iobuf);
+ awk_bool_t (*take_control_of)(awk_input_buf_t *iobuf);
+ awk_const struct input_parser *awk_const next; /* for use by gawk */
+ } awk_input_parser_t;
+
+ The fields are:
+
+`const char *name;'
+ The name of the input parser. This is a regular C string.
+
+`awk_bool_t (*can_take_file)(const awk_input_buf_t *iobuf);'
+ A pointer to your `XXX_can_take_file()' function.
+
+`awk_bool_t (*take_control_of)(awk_input_buf_t *iobuf);'
+ A pointer to your `XXX_take_control_of()' function.
+
+`awk_const struct input_parser *awk_const next;'
+ This pointer is used by `gawk'. The extension cannot modify it.
+
+ The steps are as follows:
+
+ 1. Create a `static awk_input_parser_t' variable and initialize it
+ appropriately.
+
+ 2. When your extension is loaded, register your input parser with
+ `gawk' using the `register_input_parser()' API function (described
+ below).
+
+ An `awk_input_buf_t' looks like this:
+
+ typedef struct awk_input {
+ const char *name; /* filename */
+ int fd; /* file descriptor */
+ #define INVALID_HANDLE (-1)
+ void *opaque; /* private data for input parsers */
+ int (*get_record)(char **out, struct awk_input *iobuf,
+ int *errcode, char **rt_start, size_t *rt_len);
+ void (*close_func)(struct awk_input *iobuf);
+ struct stat sbuf; /* stat buf */
+ } awk_input_buf_t;
+
+ The fields can be divided into two categories: those for use
+(initially, at least) by `XXX_can_take_file()', and those for use by
+`XXX_take_control_of()'. The first group of fields and their uses are
+as follows:
+
+`const char *name;'
+ The name of the file.
+
+`int fd;'
+ A file descriptor for the file. If `gawk' was able to open the
+ file, then `fd' will _not_ be equal to `INVALID_HANDLE'.
+ Otherwise, it will.
+
+`struct stat sbuf;'
+ If file descriptor is valid, then `gawk' will have filled in this
+ structure via a call to the `fstat()' system call.
+
+ The `XXX_can_take_file()' function should examine these fields and
+decide if the input parser should be used for the file. The decision
+can be made based upon `gawk' state (the value of a variable defined
+previously by the extension and set by `awk' code), the name of the
+file, whether or not the file descriptor is valid, the information in
+the `struct stat', or any combination of the above.
+
+ Once `XXX_can_take_file()' has returned true, and `gawk' has decided
+to use your input parser, it calls `XXX_take_control_of()'. That
+function then fills in at least the `get_record' field of the
+`awk_input_buf_t'. It must also ensure that `fd' is not set to
+`INVALID_HANDLE'. All of the fields that may be filled by
+`XXX_take_control_of()' are as follows:
+
+`void *opaque;'
+ This is used to hold any state information needed by the input
+ parser for this file. It is "opaque" to `gawk'. The input parser
+ is not required to use this pointer.
+
+`int (*get_record)(char **out,'
+` struct awk_input *iobuf,'
+` int *errcode,'
+` char **rt_start,'
+` size_t *rt_len);'
+ This function pointer should point to a function that creates the
+ input records. Said function is the core of the input parser.
+ Its behavior is described below.
+
+`void (*close_func)(struct awk_input *iobuf);'
+ This function pointer should point to a function that does the
+ "tear down." It should release any resources allocated by
+ `XXX_take_control_of()'. It may also close the file. If it does
+ so, it should set the `fd' field to `INVALID_HANDLE'.
+
+ If `fd' is still not `INVALID_HANDLE' after the call to this
+ function, `gawk' calls the regular `close()' system call.
+
+ Having a "tear down" function is optional. If your input parser
+ does not need it, do not set this field. Then, `gawk' calls the
+ regular `close()' system call on the file descriptor, so it should
+ be valid.
+
+ The `XXX_get_record()' function does the work of creating input
+records. The parameters are as follows:
+
+`char **out'
+ This is a pointer to a `char *' variable which is set to point to
+ the record. `gawk' makes its own copy of the data, so the
+ extension must manage this storage.
+
+`struct awk_input *iobuf'
+ This is the `awk_input_buf_t' for the file. The fields should be
+ used for reading data (`fd') and for managing private state
+ (`opaque'), if any.
+
+`int *errcode'
+ If an error occurs, `*errcode' should be set to an appropriate
+ code from `<errno.h>'.
+
+`char **rt_start'
+`size_t *rt_len'
+ If the concept of a "record terminator" makes sense, then
+ `*rt_start' should be set to point to the data to be used for
+ `RT', and `*rt_len' should be set to the length of the data.
+ Otherwise, `*rt_len' should be set to zero. `gawk' makes its own
+ copy of this data, so the extension must manage the storage.
+
+ The return value is the length of the buffer pointed to by `*out',
+or `EOF' if end-of-file was reached or an error occurred.
+
+ It is guaranteed that `errcode' is a valid pointer, so there is no
+need to test for a `NULL' value. `gawk' sets `*errcode' to zero, so
+there is no need to set it unless an error occurs.
+
+ If an error does occur, the function should return `EOF' and set
+`*errcode' to a non-zero value. In that case, if `*errcode' does not
+equal -1, `gawk' automatically updates the `ERRNO' variable based on
+the value of `*errcode' (e.g., setting `*errcode = errno' should do the
+right thing).
+
+ `gawk' ships with a sample extension that reads directories,
+returning records for each entry in the directory (*note Extension
+Sample Readdir::). You may wish to use that code as a guide for writing
+your own input parser.
+
+ When writing an input parser, you should think about (and document)
+how it is expected to interact with `awk' code. You may want it to
+always be called, and take effect as appropriate (as the `readdir'
+extension does). Or you may want it to take effect based upon the
+value of an `awk' variable, as the XML extension from the `gawkextlib'
+project does (*note gawkextlib::). In the latter case, code in a
+`BEGINFILE' section can look at `FILENAME' and `ERRNO' to decide
+whether or not to activate an input parser (*note BEGINFILE/ENDFILE::).
+
+ You register your input parser with the following function:
+
+`void register_input_parser(awk_input_parser_t *input_parser);'
+ Register the input parser pointed to by `input_parser' with `gawk'.
+
+
+File: gawk.info, Node: Output Wrappers, Next: Two-way processors, Prev: Input Parsers, Up: Registration Functions
+
+16.4.5.5 Customized Output Wrappers
+...................................
+
+An "output wrapper" is the mirror image of an input parser. It allows
+an extension to take over the output to a file opened with the `>' or
+`>>' operators (*note Redirection::).
+
+ The output wrapper is very similar to the input parser structure:
+
+ typedef struct output_wrapper {
+ const char *name; /* name of the wrapper */
+ awk_bool_t (*can_take_file)(const awk_output_buf_t *outbuf);
+ awk_bool_t (*take_control_of)(awk_output_buf_t *outbuf);
+ awk_const struct output_wrapper *awk_const next; /* for use by gawk */
+ } awk_output_wrapper_t;
+
+ The members are as follows:
+
+`const char *name;'
+ This is the name of the output wrapper.
+
+`awk_bool_t (*can_take_file)(const awk_output_buf_t *outbuf);'
+ This points to a function that examines the information in the
+ `awk_output_buf_t' structure pointed to by `outbuf'. It should
+ return true if the output wrapper wants to take over the file, and
+ false otherwise. It should not change any state (variable values,
+ etc.) within `gawk'.
+
+`awk_bool_t (*take_control_of)(awk_output_buf_t *outbuf);'
+ The function pointed to by this field is called when `gawk'
+ decides to let the output wrapper take control of the file. It
+ should fill in appropriate members of the `awk_output_buf_t'
+ structure, as described below, and return true if successful,
+ false otherwise.
+
+`awk_const struct output_wrapper *awk_const next;'
+ This is for use by `gawk'.
+
+ The `awk_output_buf_t' structure looks like this:
+
+ typedef struct {
+ const char *name; /* name of output file */
+ const char *mode; /* mode argument to fopen */
+ FILE *fp; /* stdio file pointer */
+ awk_bool_t redirected; /* true if a wrapper is active */
+ void *opaque; /* for use by output wrapper */
+ size_t (*gawk_fwrite)(const void *buf, size_t size, size_t count,
+ FILE *fp, void *opaque);
+ int (*gawk_fflush)(FILE *fp, void *opaque);
+ int (*gawk_ferror)(FILE *fp, void *opaque);
+ int (*gawk_fclose)(FILE *fp, void *opaque);
+ } awk_output_buf_t;
+
+ Here too, your extension will define `XXX_can_take_file()' and
+`XXX_take_control_of()' functions that examine and update data members
+in the `awk_output_buf_t'. The data members are as follows:
+
+`const char *name;'
+ The name of the output file.
+
+`const char *mode;'
+ The mode string (as would be used in the second argument to
+ `fopen()') with which the file was opened.
+
+`FILE *fp;'
+ The `FILE' pointer from `<stdio.h>'. `gawk' opens the file before
+ attempting to find an output wrapper.
+
+`awk_bool_t redirected;'
+ This field must be set to true by the `XXX_take_control_of()'
+ function.
+
+`void *opaque;'
+ This pointer is opaque to `gawk'. The extension should use it to
+ store a pointer to any private data associated with the file.
+
+`size_t (*gawk_fwrite)(const void *buf, size_t size, size_t count,'
+` FILE *fp, void *opaque);'
+`int (*gawk_fflush)(FILE *fp, void *opaque);'
+`int (*gawk_ferror)(FILE *fp, void *opaque);'
+`int (*gawk_fclose)(FILE *fp, void *opaque);'
+ These pointers should be set to point to functions that perform
+ the equivalent function as the `<stdio.h>' functions do, if
+ appropriate. `gawk' uses these function pointers for all output.
+ `gawk' initializes the pointers to point to internal, "pass
+ through" functions that just call the regular `<stdio.h>'
+ functions, so an extension only needs to redefine those functions
+ that are appropriate for what it does.
+
+ The `XXX_can_take_file()' function should make a decision based upon
+the `name' and `mode' fields, and any additional state (such as `awk'
+variable values) that is appropriate.
+
+ When `gawk' calls `XXX_take_control_of()', it should fill in the
+other fields, as appropriate, except for `fp', which it should just use
+normally.
+
+ You register your output wrapper with the following function:
+
+`void register_output_wrapper(awk_output_wrapper_t *output_wrapper);'
+ Register the output wrapper pointed to by `output_wrapper' with
+ `gawk'.
+
+
+File: gawk.info, Node: Two-way processors, Prev: Output Wrappers, Up: Registration Functions
+
+16.4.5.6 Customized Two-way Processors
+......................................
+
+A "two-way processor" combines an input parser and an output wrapper for
+two-way I/O with the `|&' operator (*note Redirection::). It makes
+identical use of the `awk_input_parser_t' and `awk_output_buf_t'
+structures as described earlier.
+
+ A two-way processor is represented by the following structure:
+
+ typedef struct two_way_processor {
+ const char *name; /* name of the two-way processor */
+ awk_bool_t (*can_take_two_way)(const char *name);
+ awk_bool_t (*take_control_of)(const char *name,
+ awk_input_buf_t *inbuf,
+ awk_output_buf_t *outbuf);
+ awk_const struct two_way_processor *awk_const next; /* for use by gawk */
+ } awk_two_way_processor_t;
+
+ The fields are as follows:
+
+`const char *name;'
+ The name of the two-way processor.
+
+`awk_bool_t (*can_take_two_way)(const char *name);'
+ This function returns true if it wants to take over two-way I/O
+ for this filename. It should not change any state (variable
+ values, etc.) within `gawk'.
+
+`awk_bool_t (*take_control_of)(const char *name,'
+` awk_input_buf_t *inbuf,'
+` awk_output_buf_t *outbuf);'
+ This function should fill in the `awk_input_buf_t' and
+ `awk_outut_buf_t' structures pointed to by `inbuf' and `outbuf',
+ respectively. These structures were described earlier.
+
+`awk_const struct two_way_processor *awk_const next;'
+ This is for use by `gawk'.
+
+ As with the input parser and output processor, you provide "yes I
+can take this" and "take over for this" functions,
+`XXX_can_take_two_way()' and `XXX_take_control_of()'.
+
+ You register your two-way processor with the following function:
+
+`void register_two_way_processor(awk_two_way_processor_t *two_way_processor);'
+ Register the two-way processor pointed to by `two_way_processor'
+ with `gawk'.
+
+
+File: gawk.info, Node: Printing Messages, Next: Updating `ERRNO', Prev: Registration Functions, Up: Extension API Description
+
+16.4.6 Printing Messages
+------------------------
+
+You can print different kinds of warning messages from your extension,
+as described below. Note that for these functions, you must pass in
+the extension id received from `gawk' when the extension was loaded.(1)
+
+`void fatal(awk_ext_id_t id, const char *format, ...);'
+ Print a message and then cause `gawk' to exit immediately.
+
+`void warning(awk_ext_id_t id, const char *format, ...);'
+ Print a warning message.
+
+`void lintwarn(awk_ext_id_t id, const char *format, ...);'
+ Print a "lint warning." Normally this is the same as printing a
+ warning message, but if `gawk' was invoked with `--lint=fatal',
+ then lint warnings become fatal error messages.
+
+ All of these functions are otherwise like the C `printf()' family of
+functions, where the `format' parameter is a string with literal
+characters and formatting codes intermixed.
+
+ ---------- Footnotes ----------
+
+ (1) Because the API uses only ISO C 90 features, it cannot make use
+of the ISO C 99 variadic macro feature to hide that parameter. More's
+the pity.
+
+
+File: gawk.info, Node: Updating `ERRNO', Next: Accessing Parameters, Prev: Printing Messages, Up: Extension API Description
+
+16.4.7 Updating `ERRNO'
+-----------------------
+
+The following functions allow you to update the `ERRNO' variable:
+
+`void update_ERRNO_int(int errno_val);'
+ Set `ERRNO' to the string equivalent of the error code in
+ `errno_val'. The value should be one of the defined error codes in
+ `<errno.h>', and `gawk' turns it into a (possibly translated)
+ string using the C `strerror()' function.
+
+`void update_ERRNO_string(const char *string);'
+ Set `ERRNO' directly to the string value of `ERRNO'. `gawk' makes
+ a copy of the value of `string'.
+
+`void unset_ERRNO();'
+ Unset `ERRNO'.
+
+
+File: gawk.info, Node: Accessing Parameters, Next: Symbol Table Access, Prev: Updating `ERRNO', Up: Extension API Description
+
+16.4.8 Accessing and Updating Parameters
+----------------------------------------
+
+Two functions give you access to the arguments (parameters) passed to
+your extension function. They are:
+
+`awk_bool_t get_argument(size_t count,'
+` awk_valtype_t wanted,'
+` awk_value_t *result);'
+ Fill in the `awk_value_t' structure pointed to by `result' with
+ the `count''th argument. Return true if the actual type matches
+ `wanted', false otherwise. In the latter case, `result->val_type'
+ indicates the actual type (*note Table 16.1:
+ table-value-types-returned.). Counts are zero based--the first
+ argument is numbered zero, the second one, and so on. `wanted'
+ indicates the type of value expected.
+
+`awk_bool_t set_argument(size_t count, awk_array_t array);'
+ Convert a parameter that was undefined into an array; this provides
+ call-by-reference for arrays. Return false if `count' is too big,
+ or if the argument's type is not undefined. *Note Array
+ Manipulation::, for more information on creating arrays.
+
+
+File: gawk.info, Node: Symbol Table Access, Next: Array Manipulation, Prev: Accessing Parameters, Up: Extension API Description
+
+16.4.9 Symbol Table Access
+--------------------------
+
+Two sets of routines provide access to global variables, and one set
+allows you to create and release cached values.
+
+* Menu:
+
+* Symbol table by name:: Accessing variables by name.
+* Symbol table by cookie:: Accessing variables by ``cookie''.
+* Cached values:: Creating and using cached values.
+
+
+File: gawk.info, Node: Symbol table by name, Next: Symbol table by cookie, Up: Symbol Table Access
+
+16.4.9.1 Variable Access and Update by Name
+...........................................
+
+The following routines provide the ability to access and update global
+`awk'-level variables by name. In compiler terminology, identifiers of
+different kinds are termed "symbols", thus the "sym" in the routines'
+names. The data structure which stores information about symbols is
+termed a "symbol table".
+
+`awk_bool_t sym_lookup(const char *name,'
+` awk_valtype_t wanted,'
+` awk_value_t *result);'
+ Fill in the `awk_value_t' structure pointed to by `result' with
+ the value of the variable named by the string `name', which is a
+ regular C string. `wanted' indicates the type of value expected.
+ Return true if the actual type matches `wanted', false otherwise
+ In the latter case, `result->val_type' indicates the actual type
+ (*note Table 16.1: table-value-types-returned.).
+
+`awk_bool_t sym_update(const char *name, awk_value_t *value);'
+ Update the variable named by the string `name', which is a regular
+ C string. The variable is added to `gawk''s symbol table if it is
+ not there. Return true if everything worked, false otherwise.
+
+ Changing types (scalar to array or vice versa) of an existing
+ variable is _not_ allowed, nor may this routine be used to update
+ an array. This routine cannot be be used to update any of the
+ predefined variables (such as `ARGC' or `NF').
+
+`awk_bool_t sym_constant(const char *name, awk_value_t *value);'
+ Create a variable named by the string `name', which is a regular C
+ string, that has the constant value as given by `value'.
+ `awk'-level code cannot change the value of this variable.(1) The
+ extension may change the value of `name''s variable with
+ subsequent calls to this routine, and may also convert a variable
+ created by `sym_update()' into a constant. However, once a
+ variable becomes a constant it cannot later be reverted into a
+ mutable variable.
+
+ ---------- Footnotes ----------
+
+ (1) There (currently) is no `awk'-level feature that provides this
+ability.
+
+
+File: gawk.info, Node: Symbol table by cookie, Next: Cached values, Prev: Symbol table by name, Up: Symbol Table Access
+
+16.4.9.2 Variable Access and Update by Cookie
+.............................................
+
+A "scalar cookie" is an opaque handle that provide access to a global
+variable or array. It is an optimization that avoids looking up
+variables in `gawk''s symbol table every time access is needed. This
+was discussed earlier, in *note General Data Types::.
+
+ The following functions let you work with scalar cookies.
+
+`awk_bool_t sym_lookup_scalar(awk_scalar_t cookie,'
+` awk_valtype_t wanted,'
+` awk_value_t *result);'
+ Retrieve the current value of a scalar cookie. Once you have
+ obtained a scalar_cookie using `sym_lookup()', you can use this
+ function to get its value more efficiently. Return false if the
+ value cannot be retrieved.
+
+`awk_bool_t sym_update_scalar(awk_scalar_t cookie, awk_value_t *value);'
+ Update the value associated with a scalar cookie. Return false if
+ the new value is not one of `AWK_STRING' or `AWK_NUMBER'. Here
+ too, the built-in variables may not be updated.
+
+ It is not obvious at first glance how to work with scalar cookies or
+what their raison d'etre really is. In theory, the `sym_lookup()' and
+`sym_update()' routines are all you really need to work with variables.
+For example, you might have code that looked up the value of a
+variable, evaluated a condition, and then possibly changed the value of
+the variable based on the result of that evaluation, like so:
+
+ /* do_magic --- do something really great */
+
+ static awk_value_t *
+ do_magic(int nargs, awk_value_t *result)
+ {
+ awk_value_t value;
+
+ if ( sym_lookup("MAGIC_VAR", AWK_NUMBER, & value)
+ && some_condition(value.num_value)) {
+ value.num_value += 42;
+ sym_update("MAGIC_VAR", & value);
+ }
+
+ return make_number(0.0, result);
+ }
+
+This code looks (and is) simple and straightforward. So what's the
+problem?
+
+ Consider what happens if `awk'-level code associated with your
+extension calls the `magic()' function (implemented in C by
+`do_magic()'), once per record, while processing hundreds of thousands
+or millions of records. The `MAGIC_VAR' variable is looked up in the
+symbol table once or twice per function call!
+
+ The symbol table lookup is really pure overhead; it is considerably
+more efficient to get a cookie that represents the variable, and use
+that to get the variable's value and update it as needed.(1)
+
+ Thus, the way to use cookies is as follows. First, install your
+extension's variable in `gawk''s symbol table using `sym_update()', as
+usual. Then get a scalar cookie for the variable using `sym_lookup()':
+
+ static awk_scalar_t magic_var_cookie; /* cookie for MAGIC_VAR */
+
+ static void
+ my_extension_init()
+ {
+ awk_value_t value;
+
+ /* install initial value */
+ sym_update("MAGIC_VAR", make_number(42.0, & value));
+
+ /* get cookie */
+ sym_lookup("MAGIC_VAR", AWK_SCALAR, & value);
+
+ /* save the cookie */
+ magic_var_cookie = value.scalar_cookie;
+ ...
+ }
+
+ Next, use the routines in this section for retrieving and updating
+the value through the cookie. Thus, `do_magic()' now becomes something
+like this:
+
+ /* do_magic --- do something really great */
+
+ static awk_value_t *
+ do_magic(int nargs, awk_value_t *result)
+ {
+ awk_value_t value;
+
+ if ( sym_lookup_scalar(magic_var_cookie, AWK_NUMBER, & value)
+ && some_condition(value.num_value)) {
+ value.num_value += 42;
+ sym_update_scalar(magic_var_cookie, & value);
+ }
+ ...
+
+ return make_number(0.0, result);
+ }
+
+ NOTE: The previous code omitted error checking for presentation
+ purposes. Your extension code should be more robust and carefully
+ check the return values from the API functions.
+
+ ---------- Footnotes ----------
+
+ (1) The difference is measurable and quite real. Trust us.
+
+
+File: gawk.info, Node: Cached values, Prev: Symbol table by cookie, Up: Symbol Table Access
+
+16.4.9.3 Creating and Using Cached Values
+.........................................
+
+The routines in this section allow you to create and release cached
+values. As with scalar cookies, in theory, cached values are not
+necessary. You can create numbers and strings using the functions in
+*note Constructor Functions::. You can then assign those values to
+variables using `sym_update()' or `sym_update_scalar()', as you like.
+
+ However, you can understand the point of cached values if you
+remember that _every_ string value's storage _must_ come from
+`malloc()'. If you have 20 variables, all of which have the same
+string value, you must create 20 identical copies of the string.(1)
+
+ It is clearly more efficient, if possible, to create a value once,
+and then tell `gawk' to reuse the value for multiple variables. That is
+what the routines in this section let you do. The functions are as
+follows:
+
+`awk_bool_t create_value(awk_value_t *value, awk_value_cookie_t *result);'
+ Create a cached string or numeric value from `value' for efficient
+ later assignment. Only `AWK_NUMBER' and `AWK_STRING' values are
+ allowed. Any other type is rejected. While `AWK_UNDEFINED' could
+ be allowed, doing so would result in inferior performance.
+
+`awk_bool_t release_value(awk_value_cookie_t vc);'
+ Release the memory associated with a value cookie obtained from
+ `create_value()'.
+
+ You use value cookies in a fashion similar to the way you use scalar
+cookies. In the extension initialization routine, you create the value
+cookie:
+
+ static awk_value_cookie_t answer_cookie; /* static value cookie */
+
+ static void
+ my_extension_init()
+ {
+ awk_value_t value;
+ char *long_string;
+ size_t long_string_len;
+
+ /* code from earlier */
+ ...
+ /* ... fill in long_string and long_string_len ... */
+ make_malloced_string(long_string, long_string_len, & value);
+ create_value(& value, & answer_cookie); /* create cookie */
+ ...
+ }
+
+ Once the value is created, you can use it as the value of any number
+of variables:
+
+ static awk_value_t *
+ do_magic(int nargs, awk_value_t *result)
+ {
+ awk_value_t new_value;
+
+ ... /* as earlier */
+
+ value.val_type = AWK_VALUE_COOKIE;
+ value.value_cookie = answer_cookie;
+ sym_update("VAR1", & value);
+ sym_update("VAR2", & value);
+ ...
+ sym_update("VAR100", & value);
+ ...
+ }
+
+Using value cookies in this way saves considerable storage, since all of
+`VAR1' through `VAR100' share the same value.
+
+ You might be wondering, "Is this sharing problematic? What happens
+if `awk' code assigns a new value to `VAR1', are all the others be
+changed too?"
+
+ That's a great question. The answer is that no, it's not a problem.
+`gawk' is smart enough to avoid such problems.
+
+ Finally, as part of your clean up action (*note Exit Callback
+Functions::) you should release any cached values that you created,
+using `release_value()'.
+
+ ---------- Footnotes ----------
+
+ (1) Numeric values are clearly less problematic, requiring only a C
+`double' to store.
+
+
+File: gawk.info, Node: Array Manipulation, Next: Extension API Variables, Prev: Symbol Table Access, Up: Extension API Description
+
+16.4.10 Array Manipulation
+--------------------------
+
+The primary data structure(1) in `awk' is the associative array (*note
+Arrays::). Extensions need to be able to manipulate `awk' arrays. The
+API provides a number of data structures for working with arrays,
+functions for working with individual elements, and functions for
+working with arrays as a whole. This includes the ability to "flatten"
+an array so that it is easy for C code to traverse every element in an
+array. The array data structures integrate nicely with the data
+structures for values to make it easy to both work with and create true
+arrays of arrays (*note General Data Types::).
+
+* Menu:
+
+* Array Data Types:: Data types for working with arrays.
+* Array Functions:: Functions for working with arrays.
+* Flattening Arrays:: How to flatten arrays.
+* Creating Arrays:: How to create and populate arrays.
+
+ ---------- Footnotes ----------
+
+ (1) Okay, the only data structure.
+
+
+File: gawk.info, Node: Array Data Types, Next: Array Functions, Up: Array Manipulation
+
+16.4.10.1 Array Data Types
+..........................
+
+The data types associated with arrays are listed below.
+
+`typedef void *awk_array_t;'
+ If you request the value of an array variable, you get back an
+ `awk_array_t' value. This value is opaque(1) to the extension; it
+ uniquely identifies the array but can only be used by passing it
+ into API functions or receiving it from API functions. This is
+ very similar to way `FILE *' values are used with the `<stdio.h>'
+ library routines.
+
+`typedef struct awk_element {'
+` /* convenience linked list pointer, not used by gawk */'
+` struct awk_element *next;'
+` enum {'
+` AWK_ELEMENT_DEFAULT = 0, /* set by gawk */'
+` AWK_ELEMENT_DELETE = 1 /* set by extension if should be deleted */'
+` } flags;'
+` awk_value_t index;'
+` awk_value_t value;'
+`} awk_element_t;'
+ The `awk_element_t' is a "flattened" array element. `awk' produces
+ an array of these inside the `awk_flat_array_t' (see the next
+ item). Individual elements may be marked for deletion. New
+ elements must be added individually, one at a time, using the
+ separate API for that purpose. The fields are as follows:
+
+ `struct awk_element *next;'
+ This pointer is for the convenience of extension writers. It
+ allows an extension to create a linked list of new elements
+ which can then be added to an array in a loop that traverses
+ the list.
+
+ `enum { ... } flags;'
+ A set of flag values that convey information between `gawk'
+ and the extension. Currently there is only one:
+ `AWK_ELEMENT_DELETE', which the extension can set to cause
+ `gawk' to delete the element from the original array upon
+ release of the flattened array.
+
+ `index'
+ `value'
+ The index and value of the element, respectively. _All_
+ memory pointed to by `index' and `value' belongs to `gawk'.
+
+`typedef struct awk_flat_array {'
+` awk_const void *awk_const opaque1; /* private data for use by gawk */'
+` awk_const void *awk_const opaque2; /* private data for use by gawk */'
+` awk_const size_t count; /* how many elements */'
+` awk_element_t elements[1]; /* will be extended */'
+`} awk_flat_array_t;'
+ This is a flattened array. When an extension gets one of these
+ from `gawk', the `elements' array is of actual size `count'. The
+ `opaque1' and `opaque2' pointers are for use by `gawk'; therefore
+ they are marked `awk_const' so that the extension cannot modify
+ them.
+
+ ---------- Footnotes ----------
+
+ (1) It is also a "cookie," but the `gawk' developers did not wish to
+overuse this term.
+
+
+File: gawk.info, Node: Array Functions, Next: Flattening Arrays, Prev: Array Data Types, Up: Array Manipulation
+
+16.4.10.2 Array Functions
+.........................
+
+The following functions relate to individual array elements.
+
+`awk_bool_t get_element_count(awk_array_t a_cookie, size_t *count);'
+ For the array represented by `a_cookie', return in `*count' the
+ number of elements it contains. A subarray counts as a single
+ element. Return false if there is an error.
+
+`awk_bool_t get_array_element(awk_array_t a_cookie,'
+` const awk_value_t *const index,'
+` awk_valtype_t wanted,'
+` awk_value_t *result);'
+ For the array represented by `a_cookie', return in `*result' the
+ value of the element whose index is `index'. `wanted' specifies
+ the type of value you wish to retrieve. Return false if `wanted'
+ does not match the actual type or if `index' is not in the array
+ (*note Table 16.1: table-value-types-returned.).
+
+ The value for `index' can be numeric, in which case `gawk'
+ converts it to a string. Using non-integral values is possible, but
+ requires that you understand how such values are converted to
+ strings (*note Conversion::); thus using integral values is safest.
+
+ As with _all_ strings passed into `gawk' from an extension, the
+ string value of `index' must come from `malloc()', and `gawk'
+ releases the storage.
+
+`awk_bool_t set_array_element(awk_array_t a_cookie,'
+` const awk_value_t *const index,'
+` const awk_value_t *const value);'
+ In the array represented by `a_cookie', create or modify the
+ element whose index is given by `index'. The `ARGV' and `ENVIRON'
+ arrays may not be changed.
+
+`awk_bool_t set_array_element_by_elem(awk_array_t a_cookie,'
+` awk_element_t element);'
+ Like `set_array_element()', but take the `index' and `value' from
+ `element'. This is a convenience macro.
+
+`awk_bool_t del_array_element(awk_array_t a_cookie,'
+` const awk_value_t* const index);'
+ Remove the element with the given index from the array represented
+ by `a_cookie'. Return true if the element was removed, or false
+ if the element did not exist in the array.
+
+ The following functions relate to arrays as a whole:
+
+`awk_array_t create_array();'
+ Create a new array to which elements may be added. *Note Creating
+ Arrays::, for a discussion of how to create a new array and add
+ elements to it.
+
+`awk_bool_t clear_array(awk_array_t a_cookie);'
+ Clear the array represented by `a_cookie'. Return false if there
+ was some kind of problem, true otherwise. The array remains an
+ array, but after calling this function, it has no elements. This
+ is equivalent to using the `delete' statement (*note Delete::).
+
+`awk_bool_t flatten_array(awk_array_t a_cookie, awk_flat_array_t **data);'
+ For the array represented by `a_cookie', create an
+ `awk_flat_array_t' structure and fill it in. Set the pointer whose
+ address is passed as `data' to point to this structure. Return
+ true upon success, or false otherwise. *Note Flattening Arrays::,
+ for a discussion of how to flatten an array and work with it.
+
+`awk_bool_t release_flattened_array(awk_array_t a_cookie,'
+` awk_flat_array_t *data);'
+ When done with a flattened array, release the storage using this
+ function. You must pass in both the original array cookie, and
+ the address of the created `awk_flat_array_t' structure. The
+ function returns true upon success, false otherwise.
+
+
+File: gawk.info, Node: Flattening Arrays, Next: Creating Arrays, Prev: Array Functions, Up: Array Manipulation
+
+16.4.10.3 Working With All The Elements of an Array
+...................................................
+
+To "flatten" an array is create a structure that represents the full
+array in a fashion that makes it easy for C code to traverse the entire
+array. Test code in `extension/testext.c' does this, and also serves
+as a nice example to show how to use the APIs.
+
+ First, the `gawk' script that drives the test extension:
+
+ @load "testext"
+ BEGIN {
+ n = split("blacky rusty sophie raincloud lucky", pets)
+ printf "pets has %d elements\n", length(pets)
+ ret = dump_array_and_delete("pets", "3")
+ printf "dump_array_and_delete(pets) returned %d\n", ret
+ if ("3" in pets)
+ printf("dump_array_and_delete() did NOT remove index \"3\"!\n")
+ else
+ printf("dump_array_and_delete() did remove index \"3\"!\n")
+ print ""
+ }
+
+This code creates an array with `split()' (*note String Functions::)
+and then calls `dump_and_delete()'. That function looks up the array
+whose name is passed as the first argument, and deletes the element at
+the index passed in the second argument. It then prints the return
+value and checks if the element was indeed deleted. Here is the C code
+that implements `dump_array_and_delete()'. It has been edited slightly
+for presentation.
+
+ The first part declares variables, sets up the default return value
+in `result', and checks that the function was called with the correct
+number of arguments:
+
+ static awk_value_t *
+ dump_array_and_delete(int nargs, awk_value_t *result)
+ {
+ awk_value_t value, value2, value3;
+ awk_flat_array_t *flat_array;
+ size_t count;
+ char *name;
+ int i;
+
+ assert(result != NULL);
+ make_number(0.0, result);
+
+ if (nargs != 2) {
+ printf("dump_array_and_delete: nargs not right "
+ "(%d should be 2)\n", nargs);
+ goto out;
+ }
+
+ The function then proceeds in steps, as follows. First, retrieve the
+name of the array, passed as the first argument. Then retrieve the
+array itself. If either operation fails, print error messages and
+return:
+
+ /* get argument named array as flat array and print it */
+ if (get_argument(0, AWK_STRING, & value)) {
+ name = value.str_value.str;
+ if (sym_lookup(name, AWK_ARRAY, & value2))
+ printf("dump_array_and_delete: sym_lookup of %s passed\n",
+ name);
+ else {
+ printf("dump_array_and_delete: sym_lookup of %s failed\n",
+ name);
+ goto out;
+ }
+ } else {
+ printf("dump_array_and_delete: get_argument(0) failed\n");
+ goto out;
+ }
+
+ For testing purposes and to make sure that the C code sees the same
+number of elements as the `awk' code, the second step is to get the
+count of elements in the array and print it:
+
+ if (! get_element_count(value2.array_cookie, & count)) {
+ printf("dump_array_and_delete: get_element_count failed\n");
+ goto out;
+ }
+
+ printf("dump_array_and_delete: incoming size is %lu\n",
+ (unsigned long) count);
+
+ The third step is to actually flatten the array, and then to double
+check that the count in the `awk_flat_array_t' is the same as the count
+just retrieved:
+
+ if (! flatten_array(value2.array_cookie, & flat_array)) {
+ printf("dump_array_and_delete: could not flatten array\n");
+ goto out;
+ }
+
+ if (flat_array->count != count) {
+ printf("dump_array_and_delete: flat_array->count (%lu)"
+ " != count (%lu)\n",
+ (unsigned long) flat_array->count,
+ (unsigned long) count);
+ goto out;
+ }
+
+ The fourth step is to retrieve the index of the element to be
+deleted, which was passed as the second argument. Remember that
+argument counts passed to `get_argument()' are zero-based, thus the
+second argument is numbered one:
+
+ if (! get_argument(1, AWK_STRING, & value3)) {
+ printf("dump_array_and_delete: get_argument(1) failed\n");
+ goto out;
+ }
+
+ The fifth step is where the "real work" is done. The function loops
+over every element in the array, printing the index and element values.
+In addition, upon finding the element with the index that is supposed
+to be deleted, the function sets the `AWK_ELEMENT_DELETE' bit in the
+`flags' field of the element. When the array is released, `gawk'
+traverses the flattened array, and deletes any element which have this
+flag bit set:
+
+ for (i = 0; i < flat_array->count; i++) {
+ printf("\t%s[\"%.*s\"] = %s\n",
+ name,
+ (int) flat_array->elements[i].index.str_value.len,
+ flat_array->elements[i].index.str_value.str,
+ valrep2str(& flat_array->elements[i].value));
+
+ if (strcmp(value3.str_value.str,
+ flat_array->elements[i].index.str_value.str)
+ == 0) {
+ flat_array->elements[i].flags |= AWK_ELEMENT_DELETE;
+ printf("dump_array_and_delete: marking element \"%s\" "
+ "for deletion\n",
+ flat_array->elements[i].index.str_value.str);
+ }
+ }
+
+ The sixth step is to release the flattened array. This tells `gawk'
+that the extension is no longer using the array, and that it should
+delete any elements marked for deletion. `gawk' also frees any storage
+that was allocated, so you should not use the pointer (`flat_array' in
+this code) once you have called `release_flattened_array()':
+
+ if (! release_flattened_array(value2.array_cookie, flat_array)) {
+ printf("dump_array_and_delete: could not release flattened array\n");
+ goto out;
+ }
+
+ Finally, since everything was successful, the function sets the
+return value to success, and returns:
+
+ make_number(1.0, result);
+ out:
+ return result;
+ }
+
+ Here is the output from running this part of the test:
+
+ pets has 5 elements
+ dump_array_and_delete: sym_lookup of pets passed
+ dump_array_and_delete: incoming size is 5
+ pets["1"] = "blacky"
+ pets["2"] = "rusty"
+ pets["3"] = "sophie"
+ dump_array_and_delete: marking element "3" for deletion
+ pets["4"] = "raincloud"
+ pets["5"] = "lucky"
+ dump_array_and_delete(pets) returned 1
+ dump_array_and_delete() did remove index "3"!
+
+
+File: gawk.info, Node: Creating Arrays, Prev: Flattening Arrays, Up: Array Manipulation
+
+16.4.10.4 How To Create and Populate Arrays
+...........................................
+
+Besides working with arrays created by `awk' code, you can create
+arrays and populate them as you see fit, and then `awk' code can access
+them and manipulate them.
+
+ There are two important points about creating arrays from extension
+code:
+
+ 1. You must install a new array into `gawk''s symbol table
+ immediately upon creating it. Once you have done so, you can then
+ populate the array.
+
+ Similarly, if installing a new array as a subarray of an existing
+ array, you must add the new array to its parent before adding any
+ elements to it.
+
+ Thus, the correct way to build an array is to work "top down."
+ Create the array, and immediately install it in `gawk''s symbol
+ table using `sym_update()', or install it as an element in a
+ previously existing array using `set_element()'. Example code is
+ coming shortly.
+
+ 2. Due to gawk internals, after using `sym_update()' to install an
+ array into `gawk', you have to retrieve the array cookie from the
+ value passed in to `sym_update()' before doing anything else with
+ it, like so:
+
+ awk_value_t index, value;
+ awk_array_t new_array;
+
+ make_const_string("an index", 8, & index);
+
+ new_array = create_array();
+ val.val_type = AWK_ARRAY;
+ val.array_cookie = new_array;
+
+ /* install array in the symbol table */
+ sym_update("array", & index, & val);
+
+ new_array = val.array_cookie; /* YOU MUST DO THIS */
+
+ If installing an array as a subarray, you must also retrieve the
+ value of the array cookie after the call to `set_element()'.
+
+ The following C code is a simple test extension to create an array
+with two regular elements and with a subarray. The leading `#include'
+directives and boilerplate variable declarations are omitted for
+brevity. The first step is to create a new array and then install it
+in the symbol table:
+
+ /* create_new_array --- create a named array */
+
+ static void
+ create_new_array()
+ {
+ awk_array_t a_cookie;
+ awk_array_t subarray;
+ awk_value_t index, value;
+
+ a_cookie = create_array();
+ value.val_type = AWK_ARRAY;
+ value.array_cookie = a_cookie;
+
+ if (! sym_update("new_array", & value))
+ printf("create_new_array: sym_update(\"new_array\") failed!\n");
+ a_cookie = value.array_cookie;
+
+Note how `a_cookie' is reset from the `array_cookie' field in the
+`value' structure.
+
+ The second step is to install two regular values into `new_array':
+
+ (void) make_const_string("hello", 5, & index);
+ (void) make_const_string("world", 5, & value);
+ if (! set_array_element(a_cookie, & index, & value)) {
+ printf("fill_in_array: set_array_element failed\n");
+ return;
+ }
+
+ (void) make_const_string("answer", 6, & index);
+ (void) make_number(42.0, & value);
+ if (! set_array_element(a_cookie, & index, & value)) {
+ printf("fill_in_array: set_array_element failed\n");
+ return;
+ }
+
+ The third step is to create the subarray and install it:
+
+ (void) make_const_string("subarray", 8, & index);
+ subarray = create_array();
+ value.val_type = AWK_ARRAY;
+ value.array_cookie = subarray;
+ if (! set_array_element(a_cookie, & index, & value)) {
+ printf("fill_in_array: set_array_element failed\n");
+ return;
+ }
+ subarray = value.array_cookie;
+
+ The final step is to populate the subarray with its own element:
+
+ (void) make_const_string("foo", 3, & index);
+ (void) make_const_string("bar", 3, & value);
+ if (! set_array_element(subarray, & index, & value)) {
+ printf("fill_in_array: set_array_element failed\n");
+ return;
+ }
+ }
+
+ Here is sample script that loads the extension and then dumps the
+array:
+
+ @load "subarray"
+
+ function dumparray(name, array, i)
+ {
+ for (i in array)
+ if (isarray(array[i]))
+ dumparray(name "[\"" i "\"]", array[i])
+ else
+ printf("%s[\"%s\"] = %s\n", name, i, array[i])
+ }
+
+ BEGIN {
+ dumparray("new_array", new_array);
+ }
+
+ Here is the result of running the script:
+
+ $ AWKLIBPATH=$PWD ./gawk -f subarray.awk
+ -| new_array["subarray"]["foo"] = bar
+ -| new_array["hello"] = world
+ -| new_array["answer"] = 42
+
+(*Note Finding Extensions::, for more information on the `AWKLIBPATH'
+environment variable.)
+
+
+File: gawk.info, Node: Extension API Variables, Next: Extension API Boilerplate, Prev: Array Manipulation, Up: Extension API Description
+
+16.4.11 API Variables
+---------------------
+
+The API provides two sets of variables. The first provides information
+about the version of the API (both with which the extension was
+compiled, and with which `gawk' was compiled). The second provides
+information about how `gawk' was invoked.
+
+* Menu:
+
+* Extension Versioning:: API Version information.
+* Extension API Informational Variables:: Variables providing information about
+ `gawk''s invocation.
+
+
+File: gawk.info, Node: Extension Versioning, Next: Extension API Informational Variables, Up: Extension API Variables
+
+16.4.11.1 API Version Constants and Variables
+.............................................
+
+The API provides both a "major" and a "minor" version number. The API
+versions are available at compile time as constants:
+
+`GAWK_API_MAJOR_VERSION'
+ The major version of the API.
+
+`GAWK_API_MINOR_VERSION'
+ The minor version of the API.
+
+ The minor version increases when new functions are added to the API.
+Such new functions are always added to the end of the API `struct'.
+
+ The major version increases (and the minor version is reset to zero)
+if any of the data types change size or member order, or if any of the
+existing functions change signature.
+
+ It could happen that an extension may be compiled against one version
+of the API but loaded by a version of `gawk' using a different version.
+For this reason, the major and minor API versions of the running `gawk'
+are included in the API `struct' as read-only constant integers:
+
+`api->major_version'
+ The major version of the running `gawk'.
+
+`api->minor_version'
+ The minor version of the running `gawk'.
+
+ It is up to the extension to decide if there are API
+incompatibilities. Typically a check like this is enough:
+
+ if (api->major_version != GAWK_API_MAJOR_VERSION
+ || api->minor_version < GAWK_API_MINOR_VERSION) {
+ fprintf(stderr, "foo_extension: version mismatch with gawk!\n");
+ fprintf(stderr, "\tmy version (%d, %d), gawk version (%d, %d)\n",
+ GAWK_API_MAJOR_VERSION, GAWK_API_MINOR_VERSION,
+ api->major_version, api->minor_version);
+ exit(1);
+ }
+
+ Such code is included in the boilerplate `dl_load_func()' macro
+provided in `gawkapi.h' (discussed later, in *note Extension API
+Boilerplate::).
+
+
+File: gawk.info, Node: Extension API Informational Variables, Prev: Extension Versioning, Up: Extension API Variables
+
+16.4.11.2 Informational Variables
+.................................
+
+The API provides access to several variables that describe whether the
+corresponding command-line options were enabled when `gawk' was
+invoked. The variables are:
+
+`do_lint'
+ This variable is true if `gawk' was invoked with `--lint' option
+ (*note Options::).
+
+`do_traditional'
+ This variable is true if `gawk' was invoked with `--traditional'
+ option.
+
+`do_profile'
+ This variable is true if `gawk' was invoked with `--profile'
+ option.
+
+`do_sandbox'
+ This variable is true if `gawk' was invoked with `--sandbox'
+ option.
+
+`do_debug'
+ This variable is true if `gawk' was invoked with `--debug' option.
+
+`do_mpfr'
+ This variable is true if `gawk' was invoked with `--bignum' option.
+
+ The value of `do_lint' can change if `awk' code modifies the `LINT'
+built-in variable (*note Built-in Variables::). The others should not
+change during execution.
+
+
+File: gawk.info, Node: Extension API Boilerplate, Next: Finding Extensions, Prev: Extension API Variables, Up: Extension API Description
+
+16.4.12 Boilerplate Code
+------------------------
+
+As mentioned earlier (*note Extension Mechanism Outline::), the function
+definitions as presented are really macros. To use these macros, your
+extension must provide a small amount of boilerplate code (variables and
+functions) towards the top of your source file, using pre-defined names
+as described below. The boilerplate needed is also provided in comments
+in the `gawkapi.h' header file:
+
+ /* Boiler plate code: */
+ int plugin_is_GPL_compatible;
+
+ static gawk_api_t *const api;
+ static awk_ext_id_t ext_id;
+ static const char *ext_version = NULL; /* or ... = "some string" */
+
+ static awk_ext_func_t func_table[] = {
+ { "name", do_name, 1 },
+ /* ... */
+ };
+
+ /* EITHER: */
+
+ static awk_bool_t (*init_func)(void) = NULL;
+
+ /* OR: */
+
+ static awk_bool_t
+ init_my_module(void)
+ {
+ ...
+ }
+
+ static awk_bool_t (*init_func)(void) = init_my_module;
+
+ dl_load_func(func_table, some_name, "name_space_in_quotes")
+
+ These variables and functions are as follows:
+
+`int plugin_is_GPL_compatible;'
+ This asserts that the extension is compatible with the GNU GPL
+ (*note Copying::). If your extension does not have this, `gawk'
+ will not load it (*note Plugin License::).
+
+`static gawk_api_t *const api;'
+ This global `static' variable should be set to point to the
+ `gawk_api_t' pointer that `gawk' passes to your `dl_load()'
+ function. This variable is used by all of the macros.
+
+`static awk_ext_id_t ext_id;'
+ This global static variable should be set to the `awk_ext_id_t'
+ value that `gawk' passes to your `dl_load()' function. This
+ variable is used by all of the macros.
+
+`static const char *ext_version = NULL; /* or ... = "some string" */'
+ This global `static' variable should be set either to `NULL', or
+ to point to a string giving the name and version of your extension.
+
+`static awk_ext_func_t func_table[] = { ... };'
+ This is an array of one or more `awk_ext_func_t' structures as
+ described earlier (*note Extension Functions::). It can then be
+ looped over for multiple calls to `add_ext_func()'.
+
+`static awk_bool_t (*init_func)(void) = NULL;'
+` OR'
+`static awk_bool_t init_my_module(void) { ... }'
+`static awk_bool_t (*init_func)(void) = init_my_module;'
+ If you need to do some initialization work, you should define a
+ function that does it (creates variables, opens files, etc.) and
+ then define the `init_func' pointer to point to your function.
+ The function should return zero (false) upon failure, non-zero
+ (success) if everything goes well.
+
+ If you don't need to do any initialization, define the pointer and
+ initialize it to `NULL'.
+
+`dl_load_func(func_table, some_name, "name_space_in_quotes")'
+ This macro expands to a `dl_load()' function that performs all the
+ necessary initializations.
+
+ The point of the all the variables and arrays is to let the
+`dl_load()' function (from the `dl_load_func()' macro) do all the
+standard work. It does the following:
+
+ 1. Check the API versions. If the extension major version does not
+ match `gawk''s, or if the extension minor version is greater than
+ `gawk''s, it prints a fatal error message and exits.
+
+ 2. Load the functions defined in `func_table'. If any of them fails
+ to load, it prints a warning message but continues on.
+
+ 3. If the `init_func' pointer is not `NULL', call the function it
+ points to. If it returns non-zero, print a warning message.
+
+ 4. If `ext_version' is not `NULL', register the version string with
+ `gawk'.
+
+
+File: gawk.info, Node: Finding Extensions, Prev: Extension API Boilerplate, Up: Extension API Description
+
+16.4.13 How `gawk' Finds Extensions
+-----------------------------------
+
+Compiled extensions have to be installed in a directory where `gawk'
+can find them. If `gawk' is configured and built in the default
+fashion, the directory in which to find extensions is
+`/usr/local/lib/gawk'. You can also specify a search path with a list
+of directories to search for compiled extensions. *Note AWKLIBPATH
+Variable::, for more information.
+
+
+File: gawk.info, Node: Extension Example, Next: Extension Samples, Prev: Extension API Description, Up: Dynamic Extensions
+
+16.5 Example: Some File Functions
+=================================
+
+ No matter where you go, there you are.
+ Buckaroo Bonzai
+
+ Two useful functions that are not in `awk' are `chdir()' (so that an
+`awk' program can change its directory) and `stat()' (so that an `awk'
+program can gather information about a file). This minor node
+implements these functions for `gawk' in an extension.
+
+* Menu:
+
+* Internal File Description:: What the new functions will do.
+* Internal File Ops:: The code for internal file operations.
+* Using Internal File Ops:: How to use an external extension.
+
+
+File: gawk.info, Node: Internal File Description, Next: Internal File Ops, Up: Extension Example
+
+16.5.1 Using `chdir()' and `stat()'
+-----------------------------------
+
+This minor node shows how to use the new functions at the `awk' level
+once they've been integrated into the running `gawk' interpreter.
+Using `chdir()' is very straightforward. It takes one argument, the new
+directory to change to:
+
+ @load "filefuncs"
+ ...
+ newdir = "/home/arnold/funstuff"
+ ret = chdir(newdir)
+ if (ret < 0) {
+ printf("could not change to %s: %s\n",
+ newdir, ERRNO) > "/dev/stderr"
+ exit 1
+ }
+ ...
+
+ The return value is negative if the `chdir()' failed, and `ERRNO'
+(*note Built-in Variables::) is set to a string indicating the error.
+
+ Using `stat()' is a bit more complicated. The C `stat()' function
+fills in a structure that has a fair amount of information. The right
+way to model this in `awk' is to fill in an associative array with the
+appropriate information:
+
+ file = "/home/arnold/.profile"
+ ret = stat(file, fdata)
+ if (ret < 0) {
+ printf("could not stat %s: %s\n",
+ file, ERRNO) > "/dev/stderr"
+ exit 1
+ }
+ printf("size of %s is %d bytes\n", file, fdata["size"])
+
+ The `stat()' function always clears the data array, even if the
+`stat()' fails. It fills in the following elements:
+
+`"name"'
+ The name of the file that was `stat()''ed.
+
+`"dev"'
+`"ino"'
+ The file's device and inode numbers, respectively.
+
+`"mode"'
+ The file's mode, as a numeric value. This includes both the file's
+ type and its permissions.
+
+`"nlink"'
+ The number of hard links (directory entries) the file has.
+
+`"uid"'
+`"gid"'
+ The numeric user and group ID numbers of the file's owner.
+
+`"size"'
+ The size in bytes of the file.
+
+`"blocks"'
+ The number of disk blocks the file actually occupies. This may not
+ be a function of the file's size if the file has holes.
+
+`"atime"'
+`"mtime"'
+`"ctime"'
+ The file's last access, modification, and inode update times,
+ respectively. These are numeric timestamps, suitable for
+ formatting with `strftime()' (*note Time Functions::).
+
+`"pmode"'
+ The file's "printable mode." This is a string representation of
+ the file's type and permissions, such as is produced by `ls
+ -l'--for example, `"drwxr-xr-x"'.
+
+`"type"'
+ A printable string representation of the file's type. The value
+ is one of the following:
+
+ `"blockdev"'
+ `"chardev"'
+ The file is a block or character device ("special file").
+
+ `"directory"'
+ The file is a directory.
+
+ `"fifo"'
+ The file is a named-pipe (also known as a FIFO).
+
+ `"file"'
+ The file is just a regular file.
+
+ `"socket"'
+ The file is an `AF_UNIX' ("Unix domain") socket in the
+ filesystem.
+
+ `"symlink"'
+ The file is a symbolic link.
+
+ Several additional elements may be present depending upon the
+operating system and the type of the file. You can test for them in
+your `awk' program by using the `in' operator (*note Reference to
+Elements::):
+
+`"blksize"'
+ The preferred block size for I/O to the file. This field is not
+ present on all POSIX-like systems in the C `stat' structure.
+
+`"linkval"'
+ If the file is a symbolic link, this element is the name of the
+ file the link points to (i.e., the value of the link).
+
+`"rdev"'
+`"major"'
+`"minor"'
+ If the file is a block or character device file, then these values
+ represent the numeric device number and the major and minor
+ components of that number, respectively.
+
+
+File: gawk.info, Node: Internal File Ops, Next: Using Internal File Ops, Prev: Internal File Description, Up: Extension Example
+
+16.5.2 C Code for `chdir()' and `stat()'
+----------------------------------------
+
+Here is the C code for these extensions.(1)
+
+ The file includes a number of standard header files, and then
+includes the `gawkapi.h' header file which provides the API definitions.
+Those are followed by the necessary variable declarations to make use
+of the API macros and boilerplate code (*note Extension API
+Boilerplate::).
+
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+ #endif
+
+ #include <stdio.h>
+ #include <assert.h>
+ #include <errno.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
+
+ #include <sys/types.h>
+ #include <sys/stat.h>
+
+ #include "gawkapi.h"
+
+ #include "gettext.h"
+ #define _(msgid) gettext(msgid)
+ #define N_(msgid) msgid
+
+ #include "gawkfts.h"
+ #include "stack.h"
+
+ static const gawk_api_t *api; /* for convenience macros to work */
+ static awk_ext_id_t *ext_id;
+ static awk_bool_t init_filefuncs(void);
+ static awk_bool_t (*init_func)(void) = init_filefuncs;
+ static const char *ext_version = "filefuncs extension: version 1.0";
+
+ int plugin_is_GPL_compatible;
+
+ By convention, for an `awk' function `foo()', the C function that
+implements it is called `do_foo()'. The function should have two
+arguments: the first is an `int' usually called `nargs', that
+represents the number of actual arguments for the function. The second
+is a pointer to an `awk_value_t', usually named `result'.
+
+ /* do_chdir --- provide dynamically loaded chdir() builtin for gawk */
+
+ static awk_value_t *
+ do_chdir(int nargs, awk_value_t *result)
+ {
+ awk_value_t newdir;
+ int ret = -1;
+
+ assert(result != NULL);
+
+ if (do_lint && nargs != 1)
+ lintwarn(ext_id,
+ _("chdir: called with incorrect number of arguments, "
+ "expecting 1"));
+
+ The `newdir' variable represents the new directory to change to,
+retrieved with `get_argument()'. Note that the first argument is
+numbered zero.
+
+ If the argument is retrieved successfully, the function calls the
+`chdir()' system call. If the `chdir()' fails, `ERRNO' is updated.
+
+ if (get_argument(0, AWK_STRING, & newdir)) {
+ ret = chdir(newdir.str_value.str);
+ if (ret < 0)
+ update_ERRNO_int(errno);
+ }
+
+ Finally, the function returns the return value to the `awk' level:
+
+ return make_number(ret, result);
+ }
+
+ The `stat()' built-in is more involved. First comes a function that
+turns a numeric mode into a printable representation (e.g., 644 becomes
+`-rw-r--r--'). This is omitted here for brevity:
+
+ /* format_mode --- turn a stat mode field into something readable */
+
+ static char *
+ format_mode(unsigned long fmode)
+ {
+ ...
+ }
+
+ Next comes a function for reading symbolic links, which is also
+omitted here for brevity:
+
+ /* read_symlink --- read a symbolic link into an allocated buffer.
+ ... */
+
+ static char *
+ read_symlink(const char *fname, size_t bufsize, ssize_t *linksize)
+ {
+ ...
+ }
+
+ Two helper functions simplify entering values in the array that will
+contain the result of the `stat()':
+
+ /* array_set --- set an array element */
+
+ static void
+ array_set(awk_array_t array, const char *sub, awk_value_t *value)
+ {
+ awk_value_t index;
+
+ set_array_element(array,
+ make_const_string(sub, strlen(sub), & index),
+ value);
+
+ }
+
+ /* array_set_numeric --- set an array element with a number */
+
+ static void
+ array_set_numeric(awk_array_t array, const char *sub, double num)
+ {
+ awk_value_t tmp;
+
+ array_set(array, sub, make_number(num, & tmp));
+ }
+
+ The following function does most of the work to fill in the
+`awk_array_t' result array with values obtained from a valid `struct
+stat'. It is done in a separate function to support the `stat()'
+function for `gawk' and also to support the `fts()' extension which is
+included in the same file but whose code is not shown here (*note
+Extension Sample File Functions::).
+
+ The first part of the function is variable declarations, including a
+table to map file types to strings:
+
+ /* fill_stat_array --- do the work to fill an array with stat info */
+
+ static int
+ fill_stat_array(const char *name, awk_array_t array, struct stat *sbuf)
+ {
+ char *pmode; /* printable mode */
+ const char *type = "unknown";
+ awk_value_t tmp;
+ static struct ftype_map {
+ unsigned int mask;
+ const char *type;
+ } ftype_map[] = {
+ { S_IFREG, "file" },
+ { S_IFBLK, "blockdev" },
+ { S_IFCHR, "chardev" },
+ { S_IFDIR, "directory" },
+ #ifdef S_IFSOCK
+ { S_IFSOCK, "socket" },
+ #endif
+ #ifdef S_IFIFO
+ { S_IFIFO, "fifo" },
+ #endif
+ #ifdef S_IFLNK
+ { S_IFLNK, "symlink" },
+ #endif
+ #ifdef S_IFDOOR /* Solaris weirdness */
+ { S_IFDOOR, "door" },
+ #endif /* S_IFDOOR */
+ };
+ int j, k;
+
+ The destination array is cleared, and then code fills in various
+elements based on values in the `struct stat':
+
+ /* empty out the array */
+ clear_array(array);
+
+ /* fill in the array */
+ array_set(array, "name", make_const_string(name, strlen(name),
+ & tmp));
+ array_set_numeric(array, "dev", sbuf->st_dev);
+ array_set_numeric(array, "ino", sbuf->st_ino);
+ array_set_numeric(array, "mode", sbuf->st_mode);
+ array_set_numeric(array, "nlink", sbuf->st_nlink);
+ array_set_numeric(array, "uid", sbuf->st_uid);
+ array_set_numeric(array, "gid", sbuf->st_gid);
+ array_set_numeric(array, "size", sbuf->st_size);
+ array_set_numeric(array, "blocks", sbuf->st_blocks);
+ array_set_numeric(array, "atime", sbuf->st_atime);
+ array_set_numeric(array, "mtime", sbuf->st_mtime);
+ array_set_numeric(array, "ctime", sbuf->st_ctime);
+
+ /* for block and character devices, add rdev,
+ major and minor numbers */
+ if (S_ISBLK(sbuf->st_mode) || S_ISCHR(sbuf->st_mode)) {
+ array_set_numeric(array, "rdev", sbuf->st_rdev);
+ array_set_numeric(array, "major", major(sbuf->st_rdev));
+ array_set_numeric(array, "minor", minor(sbuf->st_rdev));
+ }
+
+The latter part of the function makes selective additions to the
+destination array, depending upon the availability of certain members
+and/or the type of the file. It then returns zero, for success:
+
+ #ifdef HAVE_ST_BLKSIZE
+ array_set_numeric(array, "blksize", sbuf->st_blksize);
+ #endif /* HAVE_ST_BLKSIZE */
+
+ pmode = format_mode(sbuf->st_mode);
+ array_set(array, "pmode", make_const_string(pmode, strlen(pmode),
+ & tmp));
+
+ /* for symbolic links, add a linkval field */
+ if (S_ISLNK(sbuf->st_mode)) {
+ char *buf;
+ ssize_t linksize;
+
+ if ((buf = read_symlink(name, sbuf->st_size,
+ & linksize)) != NULL)
+ array_set(array, "linkval",
+ make_malloced_string(buf, linksize, & tmp));
+ else
+ warning(ext_id, _("stat: unable to read symbolic link `%s'"),
+ name);
+ }
+
+ /* add a type field */
+ type = "unknown"; /* shouldn't happen */
+ for (j = 0, k = sizeof(ftype_map)/sizeof(ftype_map[0]); j < k; j++) {
+ if ((sbuf->st_mode & S_IFMT) == ftype_map[j].mask) {
+ type = ftype_map[j].type;
+ break;
+ }
+ }
+
+ array_set(array, "type", make_const_string(type, strlen(type), &tmp));
+
+ return 0;
+ }
+
+ Finally, here is the `do_stat()' function. It starts with variable
+declarations and argument checking:
+
+ /* do_stat --- provide a stat() function for gawk */
+
+ static awk_value_t *
+ do_stat(int nargs, awk_value_t *result)
+ {
+ awk_value_t file_param, array_param;
+ char *name;
+ awk_array_t array;
+ int ret;
+ struct stat sbuf;
+
+ assert(result != NULL);
+
+ if (do_lint && nargs != 2) {
+ lintwarn(ext_id,
+ _("stat: called with wrong number of arguments"));
+ return make_number(-1, result);
+ }
+
+ Then comes the actual work. First, the function gets the arguments.
+Next, it gets the information for the file. The code use `lstat()'
+(instead of `stat()') to get the file information, in case the file is
+a symbolic link. If there's an error, it sets `ERRNO' and returns:
+
+ /* file is first arg, array to hold results is second */
+ if ( ! get_argument(0, AWK_STRING, & file_param)
+ || ! get_argument(1, AWK_ARRAY, & array_param)) {
+ warning(ext_id, _("stat: bad parameters"));
+ return make_number(-1, result);
+ }
+
+ name = file_param.str_value.str;
+ array = array_param.array_cookie;
+
+ /* always empty out the array */
+ clear_array(array);
+
+ /* lstat the file, if error, set ERRNO and return */
+ ret = lstat(name, & sbuf);
+ if (ret < 0) {
+ update_ERRNO_int(errno);
+ return make_number(ret, result);
+ }
+
+ The tedious work is done by `fill_stat_array()', shown earlier.
+When done, return the result from `fill_stat_array()':
+
+ ret = fill_stat_array(name, array, & sbuf);
+
+ return make_number(ret, result);
+ }
+
+ Finally, it's necessary to provide the "glue" that loads the new
+function(s) into `gawk'.
+
+ The `filefuncs' extension also provides an `fts()' function, which
+we omit here. For its sake there is an initialization function:
+
+ /* init_filefuncs --- initialization routine */
+
+ static awk_bool_t
+ init_filefuncs(void)
+ {
+ ...
+ }
+
+ We are almost done. We need an array of `awk_ext_func_t' structures
+for loading each function into `gawk':
+
+ static awk_ext_func_t func_table[] = {
+ { "chdir", do_chdir, 1 },
+ { "stat", do_stat, 2 },
+ { "fts", do_fts, 3 },
+ };
+
+ Each extension must have a routine named `dl_load()' to load
+everything that needs to be loaded. It is simplest to use the
+`dl_load_func()' macro in `gawkapi.h':
+
+ /* define the dl_load() function using the boilerplate macro */
+
+ dl_load_func(func_table, filefuncs, "")
+
+ And that's it! As an exercise, consider adding functions to
+implement system calls such as `chown()', `chmod()', and `umask()'.
+
+ ---------- Footnotes ----------
+
+ (1) This version is edited slightly for presentation. See
+`extension/filefuncs.c' in the `gawk' distribution for the complete
+version.
+
+
+File: gawk.info, Node: Using Internal File Ops, Prev: Internal File Ops, Up: Extension Example
+
+16.5.3 Integrating The Extensions
+---------------------------------
+
+Now that the code is written, it must be possible to add it at runtime
+to the running `gawk' interpreter. First, the code must be compiled.
+Assuming that the functions are in a file named `filefuncs.c', and IDIR
+is the location of the `gawkapi.h' header file, the following steps(1)
+create a GNU/Linux shared library:
+
+ $ gcc -fPIC -shared -DHAVE_CONFIG_H -c -O -g -IIDIR filefuncs.c
+ $ ld -o filefuncs.so -shared filefuncs.o -lc
+
+ Once the library exists, it is loaded by using the `@load' keyword.
+
+ # file testff.awk
+ @load "filefuncs"
+
+ BEGIN {
+ "pwd" | getline curdir # save current directory
+ close("pwd")
+
+ chdir("/tmp")
+ system("pwd") # test it
+ chdir(curdir) # go back
+
+ print "Info for testff.awk"
+ ret = stat("testff.awk", data)
+ print "ret =", ret
+ for (i in data)
+ printf "data[\"%s\"] = %s\n", i, data[i]
+ print "testff.awk modified:",
+ strftime("%m %d %y %H:%M:%S", data["mtime"])
+
+ print "\nInfo for JUNK"
+ ret = stat("JUNK", data)
+ print "ret =", ret
+ for (i in data)
+ printf "data[\"%s\"] = %s\n", i, data[i]
+ print "JUNK modified:", strftime("%m %d %y %H:%M:%S", data["mtime"])
+ }
+
+ The `AWKLIBPATH' environment variable tells `gawk' where to find
+shared libraries (*note Finding Extensions::). We set it to the
+current directory and run the program:
+
+ $ AWKLIBPATH=$PWD gawk -f testff.awk
+ -| /tmp
+ -| Info for testff.awk
+ -| ret = 0
+ -| data["blksize"] = 4096
+ -| data["mtime"] = 1350838628
+ -| data["mode"] = 33204
+ -| data["type"] = file
+ -| data["dev"] = 2053
+ -| data["gid"] = 1000
+ -| data["ino"] = 1719496
+ -| data["ctime"] = 1350838628
+ -| data["blocks"] = 8
+ -| data["nlink"] = 1
+ -| data["name"] = testff.awk
+ -| data["atime"] = 1350838632
+ -| data["pmode"] = -rw-rw-r--
+ -| data["size"] = 662
+ -| data["uid"] = 1000
+ -| testff.awk modified: 10 21 12 18:57:08
+ -|
+ -| Info for JUNK
+ -| ret = -1
+ -| JUNK modified: 01 01 70 02:00:00
+
+ ---------- Footnotes ----------
+
+ (1) In practice, you would probably want to use the GNU
+Autotools--Automake, Autoconf, Libtool, and Gettext--to configure and
+build your libraries. Instructions for doing so are beyond the scope of
+this Info file. *Note gawkextlib::, for WWW links to the tools.
+
+
+File: gawk.info, Node: Extension Samples, Next: gawkextlib, Prev: Extension Example, Up: Dynamic Extensions
+
+16.6 The Sample Extensions In The `gawk' Distribution
+=====================================================
+
+This minor node provides brief overviews of the sample extensions that
+come in the `gawk' distribution. Some of them are intended for
+production use, such the `filefuncs' and `readdir' extensions. Others
+mainly provide example code that shows how to use the extension API.
+
+* Menu:
+
+* Extension Sample File Functions:: The file functions sample.
+* Extension Sample Fnmatch:: An interface to `fnmatch()'.
+* Extension Sample Fork:: An interface to `fork()' and other
+ process functions.
+* Extension Sample Ord:: Character to value to character
+ conversions.
+* Extension Sample Readdir:: An interface to `readdir()'.
+* Extension Sample Revout:: Reversing output sample output wrapper.
+* Extension Sample Rev2way:: Reversing data sample two-way processor.
+* Extension Sample Read write array:: Serializing an array to a file.
+* Extension Sample Readfile:: Reading an entire file into a string.
+* Extension Sample API Tests:: Tests for the API.
+* Extension Sample Time:: An interface to `gettimeofday()'
+ and `sleep()'.
+
+
+File: gawk.info, Node: Extension Sample File Functions, Next: Extension Sample Fnmatch, Up: Extension Samples
+
+16.6.1 File Related Functions
+-----------------------------
+
+The `filefuncs' extension provides three different functions, as
+follows: The usage is:
+
+`@load "filefuncs"'
+ This is how you load the extension.
+
+`result = chdir("/some/directory")'
+ The `chdir()' function is a direct hook to the `chdir()' system
+ call to change the current directory. It returns zero upon
+ success or less than zero upon error. In the latter case it
+ updates `ERRNO'.
+
+`result = stat("/some/path", statdata)'
+ The `stat()' function provides a hook into the `stat()' system
+ call. In fact, it uses `lstat()'. It returns zero upon success or
+ less than zero upon error. In the latter case it updates `ERRNO'.
+
+ In all cases, it clears the `statdata' array. When the call is
+ successful, `stat()' fills the `statdata' array with information
+ retrieved from the filesystem, as follows:
+
+ `statdata["name"]' The name of the file.
+ `statdata["dev"]' Corresponds to the `st_dev' field in
+ the `struct stat'.
+ `statdata["ino"]' Corresponds to the `st_ino' field in
+ the `struct stat'.
+ `statdata["mode"]' Corresponds to the `st_mode' field in
+ the `struct stat'.
+ `statdata["nlink"]' Corresponds to the `st_nlink' field in
+ the `struct stat'.
+ `statdata["uid"]' Corresponds to the `st_uid' field in
+ the `struct stat'.
+ `statdata["gid"]' Corresponds to the `st_gid' field in
+ the `struct stat'.
+ `statdata["size"]' Corresponds to the `st_size' field in
+ the `struct stat'.
+ `statdata["atime"]' Corresponds to the `st_atime' field in
+ the `struct stat'.
+ `statdata["mtime"]' Corresponds to the `st_mtime' field in
+ the `struct stat'.
+ `statdata["ctime"]' Corresponds to the `st_ctime' field in
+ the `struct stat'.
+ `statdata["rdev"]' Corresponds to the `st_rdev' field in
+ the `struct stat'. This element is
+ only present for device files.
+ `statdata["major"]' Corresponds to the `st_major' field in
+ the `struct stat'. This element is
+ only present for device files.
+ `statdata["minor"]' Corresponds to the `st_minor' field in
+ the `struct stat'. This element is
+ only present for device files.
+ `statdata["blksize"]' Corresponds to the `st_blksize' field
+ in the `struct stat'. if this field is
+ present on your system. (It is present
+ on all modern systems that we know of.)
+ `statdata["pmode"]' A human-readable version of the mode
+ value, such as printed by `ls'. For
+ example, `"-rwxr-xr-x"'.
+ `statdata["linkval"]' If the named file is a symbolic link,
+ this element will exist and its value
+ is the value of the symbolic link
+ (where the symbolic link points to).
+ `statdata["type"]' The type of the file as a string. One
+ of `"file"', `"blockdev"', `"chardev"',
+ `"directory"', `"socket"', `"fifo"',
+ `"symlink"', `"door"', or `"unknown"'.
+ Not all systems support all file types.
+
+`flags = or(FTS_PHYSICAL, ...)'
+`result = fts(pathlist, flags, filedata)'
+ Walk the file trees provided in `pathlist' and fill in the
+ `filedata' array as described below. `flags' is the bitwise OR of
+ several predefined constant values, also as described below.
+ Return zero if there were no errors, otherwise return -1.
+
+ The `fts()' function provides a hook to the C library `fts()'
+routines for traversing file hierarchies. Instead of returning data
+about one file at a time in a stream, it fills in a multi-dimensional
+array with data about each file and directory encountered in the
+requested hierarchies.
+
+ The arguments are as follows:
+
+`pathlist'
+ An array of filenames. The element values are used; the index
+ values are ignored.
+
+`flags'
+ This should be the bitwise OR of one or more of the following
+ predefined constant flag values. At least one of `FTS_LOGICAL' or
+ `FTS_PHYSICAL' must be provided; otherwise `fts()' returns an
+ error value and sets `ERRNO'. The flags are:
+
+ `FTS_LOGICAL'
+ Do a "logical" file traversal, where the information returned
+ for a symbolic link refers to the linked-to file, and not to
+ the symbolic link itself. This flag is mutually exclusive
+ with `FTS_PHYSICAL'.
+
+ `FTS_PHYSICAL'
+ Do a "physical" file traversal, where the information
+ returned for a symbolic link refers to the symbolic link
+ itself. This flag is mutually exclusive with `FTS_LOGICAL'.
+
+ `FTS_NOCHDIR'
+ As a performance optimization, the C library `fts()' routines
+ change directory as they traverse a file hierarchy. This
+ flag disables that optimization.
+
+ `FTS_COMFOLLOW'
+ Immediately follow a symbolic link named in `pathlist',
+ whether or not `FTS_LOGICAL' is set.
+
+ `FTS_SEEDOT'
+ By default, the `fts()' routines do not return entries for `.'
+ and `..'. This option causes entries for `..' to also be
+ included. (The extension always includes an entry for `.',
+ see below.)
+
+ `FTS_XDEV'
+ During a traversal, do not cross onto a different mounted
+ filesystem.
+
+`filedata'
+ The `filedata' array is first cleared. Then, `fts()' creates an
+ element in `filedata' for every element in `pathlist'. The index
+ is the name of the directory or file given in `pathlist'. The
+ element for this index is itself an array. There are two cases.
+
+ _The path is a file._
+ In this case, the array contains two or three elements:
+
+ `"path"'
+ The full path to this file, starting from the "root"
+ that was given in the `pathlist' array.
+
+ `"stat"'
+ This element is itself an array, containing the same
+ information as provided by the `stat()' function
+ described earlier for its `statdata' argument. The
+ element may not be present if the `stat()' system call
+ for the file failed.
+
+ `"error"'
+ If some kind of error was encountered, the array will
+ also contain an element named `"error"', which is a
+ string describing the error.
+
+ _The path is a directory._
+ In this case, the array contains one element for each entry
+ in the directory. If an entry is a file, that element is as
+ for files, just described. If the entry is a directory, that
+ element is (recursively), an array describing the
+ subdirectory. If `FTS_SEEDOT' was provided in the flags,
+ then there will also be an element named `".."'. This
+ element will be an array containing the data as provided by
+ `stat()'.
+
+ In addition, there will be an element whose index is `"."'.
+ This element is an array containing the same two or three
+ elements as for a file: `"path"', `"stat"', and `"error"'.
+
+ The `fts()' function returns zero if there were no errors.
+Otherwise it returns -1.
+
+ NOTE: The `fts()' extension does not exactly mimic the interface
+ of the C library `fts()' routines, choosing instead to provide an
+ interface that is based on associative arrays, which should be
+ more comfortable to use from an `awk' program. This includes the
+ lack of a comparison function, since `gawk' already provides
+ powerful array sorting facilities. While an `fts_read()'-like
+ interface could have been provided, this felt less natural than
+ simply creating a multi-dimensional array to represent the file
+ hierarchy and its information.
+
+ See `test/fts.awk' in the `gawk' distribution for an example.
+
+
+File: gawk.info, Node: Extension Sample Fnmatch, Next: Extension Sample Fork, Prev: Extension Sample File Functions, Up: Extension Samples
+
+16.6.2 Interface To `fnmatch()'
+-------------------------------
+
+This extension provides an interface to the C library `fnmatch()'
+function. The usage is:
+
+ @load "fnmatch"
+
+ result = fnmatch(pattern, string, flags)
+
+ The `fnmatch' extension adds a single function named `fnmatch()',
+one constant (`FNM_NOMATCH'), and an array of flag values named `FNM'.
+
+ The arguments to `fnmatch()' are:
+
+`pattern'
+ The filename wildcard to match.
+
+`string'
+ The filename string,
+
+`flag'
+ Either zero, or the bitwise OR of one or more of the flags in the
+ `FNM' array.
+
+ The return value is zero on success, `FNM_NOMATCH' if the string did
+not match the pattern, or a different non-zero value if an error
+occurred.
+
+ The flags are follows:
+
+`FNM["CASEFOLD"]' Corresponds to the `FNM_CASEFOLD' flag as defined in
+ `fnmatch()'.
+`FNM["FILE_NAME"]' Corresponds to the `FNM_FILE_NAME' flag as defined
+ in `fnmatch()'.
+`FNM["LEADING_DIR"]' Corresponds to the `FNM_LEADING_DIR' flag as defined
+ in `fnmatch()'.
+`FNM["NOESCAPE"]' Corresponds to the `FNM_NOESCAPE' flag as defined in
+ `fnmatch()'.
+`FNM["PATHNAME"]' Corresponds to the `FNM_PATHNAME' flag as defined in
+ `fnmatch()'.
+`FNM["PERIOD"]' Corresponds to the `FNM_PERIOD' flag as defined in
+ `fnmatch()'.
+
+ Here is an example:
+
+ @load "fnmatch"
+ ...
+ flags = or(FNM["PERIOD"], FNM["NOESCAPE"])
+ if (fnmatch("*.a", "foo.c", flags) == FNM_NOMATCH)
+ print "no match"
+
+
+File: gawk.info, Node: Extension Sample Fork, Next: Extension Sample Ord, Prev: Extension Sample Fnmatch, Up: Extension Samples
+
+16.6.3 Interface To `fork()', `wait()' and `waitpid()'
+------------------------------------------------------
+
+The `fork' extension adds three functions, as follows.
+
+`@load "fork"'
+ This is how you load the extension.
+
+`pid = fork()'
+ This function creates a new process. The return value is the zero
+ in the child and the process-id number of the child in the parent,
+ or -1 upon error. In the latter case, `ERRNO' indicates the
+ problem. In the child, `PROCINFO["pid"]' and `PROCINFO["ppid"]'
+ are updated to reflect the correct values.
+
+`ret = waitpid(pid)'
+ This function takes a numeric argument, which is the process-id to
+ wait for. The return value is that of the `waitpid()' system call.
+
+`ret = wait()'
+ This function waits for the first child to die. The return value
+ is that of the `wait()' system call.
+
+ There is no corresponding `exec()' function.
+
+ Here is an example:
+
+ @load "fork"
+ ...
+ if ((pid = fork()) == 0)
+ print "hello from the child"
+ else
+ print "hello from the parent"
+
+
+File: gawk.info, Node: Extension Sample Ord, Next: Extension Sample Readdir, Prev: Extension Sample Fork, Up: Extension Samples
+
+16.6.4 Character and Numeric values: `ord()' and `chr()'
+--------------------------------------------------------
+
+The `ordchr' extension adds two functions, named `ord()' and `chr()',
+as follows.
+
+`number = ord(string)'
+ Return the numeric value of the first character in `string'.
+
+`char = chr(number)'
+ Return the string whose first character is that represented by
+ `number'.
+
+ These functions are inspired by the Pascal language functions of the
+same name. Here is an example:
+
+ @load "ordchr"
+ ...
+ printf("The numeric value of 'A' is %d\n", ord("A"))
+ printf("The string value of 65 is %s\n", chr(65))
+
+
+File: gawk.info, Node: Extension Sample Readdir, Next: Extension Sample Revout, Prev: Extension Sample Ord, Up: Extension Samples
+
+16.6.5 Reading Directories
+--------------------------
+
+The `readdir' extension adds an input parser for directories, and adds
+a single function named `readdir_do_ftype()'. The usage is as follows:
+
+ @load "readdir"
+
+ readdir_do_ftype("stat") # or "dirent" or "never"
+
+ When this extension is in use, instead of skipping directories named
+on the command line (or with `getline'), they are read, with each entry
+returned as a record.
+
+ The record consists of at least two fields: the inode number and the
+filename, separated by a forward slash character. On systems where the
+directory entry contains the file type, the record has a third field
+which is a single letter indicating the type of the file:
+
+Letter File Type
+--------------------------------------------------------------------------
+`b' Block device
+`c' Character device
+`d' Directory
+`f' Regular file
+`l' Symbolic link
+`p' Named pipe (FIFO)
+`s' Socket
+`u' Anything else (unknown)
+
+ On systems without the file type information, calling
+`readdir_do_ftype("stat")' causes the extension to use the `lstat()'
+system call to retrieve the appropriate information. This is not the
+default, since `lstat()' is a potentially expensive operation. By
+calling `readdir_do_ftype("never")' one can ensure that the file type
+information is never displayed, even when readily available in the
+directory entry.
+
+ The third option, `readdir_do_ftype("dirent")', takes file type
+information from the directory entry, if it is available. This is the
+default on systems that supply this information.
+
+ The `readdir_do_ftype()' function sets `ERRNO' if called without
+arguments or with invalid arguments.
+
+ NOTE: On GNU/Linux systems, there are filesystems that don't
+ support the `d_type' entry (see the readdir(3) manual page), and
+ so the file type is always `u'. Therefore, using
+ `readdir_do_ftype("stat")' is advisable even on GNU/Linux systems.
+ In this case, the `readdir' extension falls back to using
+ `lstat()' when it encounters an unknown file type.
+
+ Here is an example:
+
+ @load "readdir"
+ ...
+ BEGIN { FS = "/" }
+ { print "file name is", $2 }
+
+
+File: gawk.info, Node: Extension Sample Revout, Next: Extension Sample Rev2way, Prev: Extension Sample Readdir, Up: Extension Samples
+
+16.6.6 Reversing Output
+-----------------------
+
+The `revoutput' extension adds a simple output wrapper that reverses
+the characters in each output line. It's main purpose is to show how to
+write an output wrapper, although it may be mildly amusing for the
+unwary. Here is an example:
+
+ @load "revoutput"
+
+ BEGIN {
+ REVOUT = 1
+ print "hello, world" > "/dev/stdout"
+ }
+
+ The output from this program is: `dlrow ,olleh'.
+
+
+File: gawk.info, Node: Extension Sample Rev2way, Next: Extension Sample Read write array, Prev: Extension Sample Revout, Up: Extension Samples
+
+16.6.7 Two-Way I/O Example
+--------------------------
+
+The `revtwoway' extension adds a simple two-way processor that reverses
+the characters in each line sent to it for reading back by the `awk'
+program. It's main purpose is to show how to write a two-way
+processor, although it may also be mildly amusing. The following
+example shows how to use it:
+
+ @load "revtwoway"
+
+ BEGIN {
+ cmd = "/magic/mirror"
+ print "hello, world" |& cmd
+ cmd |& getline result
+ print result
+ close(cmd)
+ }
+
+
+File: gawk.info, Node: Extension Sample Read write array, Next: Extension Sample Readfile, Prev: Extension Sample Rev2way, Up: Extension Samples
+
+16.6.8 Dumping and Restoring An Array
+-------------------------------------
+
+The `rwarray' extension adds two functions, named `writea()' and
+`reada()', as follows:
+
+`ret = writea(file, array)'
+ This function takes a string argument, which is the name of the
+ file to which dump the array, and the array itself as the second
+ argument. `writea()' understands multidimensional arrays. It
+ returns one on success, or zero upon failure.
+
+`ret = reada(file, array)'
+ `reada()' is the inverse of `writea()'; it reads the file named as
+ its first argument, filling in the array named as the second
+ argument. It clears the array first. Here too, the return value
+ is one on success and zero upon failure.
+
+ The array created by `reada()' is identical to that written by
+`writea()' in the sense that the contents are the same. However, due to
+implementation issues, the array traversal order of the recreated array
+is likely to be different from that of the original array. As array
+traversal order in `awk' is by default undefined, this is not
+(technically) a problem. If you need to guarantee a particular
+traversal order, use the array sorting features in `gawk' to do so
+(*note Array Sorting::).
+
+ The file contains binary data. All integral values are written in
+network byte order. However, double precision floating-point values
+are written as native binary data. Thus, arrays containing only string
+data can theoretically be dumped on systems with one byte order and
+restored on systems with a different one, but this has not been tried.
+
+ Here is an example:
+
+ @load "rwarray"
+ ...
+ ret = writea("arraydump.bin", array)
+ ...
+ ret = reada("arraydump.bin", array)
+
+
+File: gawk.info, Node: Extension Sample Readfile, Next: Extension Sample API Tests, Prev: Extension Sample Read write array, Up: Extension Samples
+
+16.6.9 Reading An Entire File
+-----------------------------
+
+The `readfile' extension adds a single function named `readfile()':
+
+`result = readfile("/some/path")'
+ The argument is the name of the file to read. The return value is
+ a string containing the entire contents of the requested file.
+ Upon error, the function returns the empty string and sets `ERRNO'.
+
+ Here is an example:
+
+ @load "readfile"
+ ...
+ contents = readfile("/path/to/file");
+ if (contents == "" && ERRNO != "") {
+ print("problem reading file", ERRNO) > "/dev/stderr"
+ ...
+ }
+
+
+File: gawk.info, Node: Extension Sample API Tests, Next: Extension Sample Time, Prev: Extension Sample Readfile, Up: Extension Samples
+
+16.6.10 API Tests
+-----------------
+
+The `testext' extension exercises parts of the extension API that are
+not tested by the other samples. The `extension/testext.c' file
+contains both the C code for the extension and `awk' test code inside C
+comments that run the tests. The testing framework extracts the `awk'
+code and runs the tests. See the source file for more information.
+
+
+File: gawk.info, Node: Extension Sample Time, Prev: Extension Sample API Tests, Up: Extension Samples
+
+16.6.11 Extension Time Functions
+--------------------------------
+
+These functions can be used by either invoking `gawk' with a
+command-line argument of `-l time' or by inserting `@load "time"' in
+your script.
+
+`the_time = gettimeofday()'
+ Return the time in seconds that has elapsed since 1970-01-01 UTC
+ as a floating point value. If the time is unavailable on this
+ platform, return -1 and set `ERRNO'. The returned time should
+ have sub-second precision, but the actual precision will vary
+ based on the platform. If the standard C `gettimeofday()' system
+ call is available on this platform, then it simply returns the
+ value. Otherwise, if on Windows, it tries to use
+ `GetSystemTimeAsFileTime()'.
+
+`result = sleep(SECONDS)'
+ Attempt to sleep for SECONDS seconds. If SECONDS is negative, or
+ the attempt to sleep fails, return -1 and set `ERRNO'. Otherwise,
+ return zero after sleeping for the indicated amount of time. Note
+ that SECONDS may be a floating-point (non-integral) value.
+ Implementation details: depending on platform availability, this
+ function tries to use `nanosleep()' or `select()' to implement the
+ delay.
+
+
+File: gawk.info, Node: gawkextlib, Prev: Extension Samples, Up: Dynamic Extensions
+
+16.7 The `gawkextlib' Project
+=============================
+
+The `gawkextlib' (http://sourceforge.net/projects/gawkextlib/) project
+provides a number of `gawk' extensions, including one for processing
+XML files. This is the evolution of the original `xgawk' (XML `gawk')
+project.
+
+ As of this writing, there are four extensions:
+
+ * XML parser extension, using the Expat
+ (http://expat.sourceforge.net) XML parsing library.
+
+ * Postgres SQL extension.
+
+ * GD graphics library extension.
+
+ * MPFR library extension. This provides access to a number of MPFR
+ functions which `gawk''s native MPFR support does not.
+
+ The `time' extension described earlier (*note Extension Sample
+Time::) was originally from this project but has been moved in to the
+main `gawk' distribution.
+
+ You can check out the code for the `gawkextlib' project using the
+GIT (http://git-scm.com) distributed source code control system. The
+command is as follows:
+
+ git clone git://git.code.sf.net/p/gawkextlib/code gawkextlib-code
+
+ You will need to have the Expat (http://expat.sourceforge.net) XML
+parser library installed in order to build and use the XML extension.
+
+ In addition, you must have the GNU Autotools installed (Autoconf
+(http://www.gnu.org/software/autoconf), Automake
+(http://www.gnu.org/software/automake), Libtool
+(http://www.gnu.org/software/libtool), and Gettext
+(http://www.gnu.org/software/gettext)).
+
+ The simple recipe for building and testing `gawkextlib' is as
+follows. First, build and install `gawk':
+
+ cd .../path/to/gawk/code
+ ./configure --prefix=/tmp/newgawk Install in /tmp/newgawk for now
+ make && make check Build and check that all is OK
+ make install Install gawk
+
+ Next, build `gawkextlib' and test it:
+
+ cd .../path/to/gawkextlib-code
+ ./update-autotools Generate configure, etc.
+ You may have to run this command twice
+ ./configure --with-gawk=/tmp/newgawk Configure, point at "installed" gawk
+ make && make check Build and check that all is OK
+
+ If you write an extension that you wish to share with other `gawk'
+users, please consider doing so through the `gawkextlib' project.
+
+
+File: gawk.info, Node: Language History, Next: Installation, Prev: Dynamic Extensions, Up: Top
Appendix A The Evolution of the `awk' Language
**********************************************
@@ -20074,9 +25063,6 @@ the current version of `gawk'.
- The `bindtextdomain()', `dcgettext()' and `dcngettext()'
functions for internationalization (*note Programmer i18n::).
- - The `extension()' built-in function and the ability to add
- new functions dynamically (*note Dynamic Extensions::).
-
- The `fflush()' function from Brian Kernighan's version of
`awk' (*note I/O Functions::).
@@ -20091,12 +25077,21 @@ the current version of `gawk'.
- The `AWKPATH' environment variable for specifying a path
search for the `-f' command-line option (*note Options::).
- - The ability to use GNU-style long-named options that start
- with `--' and the `--characters-as-bytes', `--compat',
- `--dump-variables', `--exec', `--gen-pot', `--lint',
- `--lint-old', `--non-decimal-data', `--posix', `--profile',
- `--re-interval', `--sandbox', `--source', `--traditional', and
- `--use-lc-numeric' options (*note Options::).
+ - The `AWKLIBPATH' environment variable for specifying a path
+ search for the `-l' command-line option (*note Options::).
+
+ - The `-b', `-c', `-C', `-d', `-D', `-e', `-E', `-g', `-h',
+ `-i', `-l', `-L', `-M', `-n', `-N', `-o', `-O', `-p', `-P',
+ `-r', `-S', `-t', and `-V' short options. Also, the ability
+ to use GNU-style long-named options that start with `--' and
+ the `--assign', `--bignum', `--characters-as-bytes',
+ `--copyright', `--debug', `--dump-variables', `--execle',
+ `--field-separator', `--file', `--gen-pot', `--help',
+ `--include', `--lint', `--lint-old', `--load',
+ `--non-decimal-data', `--optimize', `--posix',
+ `--pretty-print', `--profile', `--re-interval', `--sandbox',
+ `--source', `--traditional', `--use-lc-numeric', and
+ `--version' long options (*note Options::).
* Support for the following obsolete systems was removed from the
code and the documentation for `gawk' version 4.0:
@@ -20140,7 +25135,7 @@ Feature BWK Awk Mawk GNU Awk
`\x' Escape sequence X X X
`RS' as regexp X X
`FS' as null string X X X
-`/dev/stdin' special file X X X
+`/dev/stdin' special file X X
`/dev/stdout' special file X X X
`/dev/stderr' special file X X X
`**' and `**=' operators X X
@@ -20325,7 +25320,7 @@ Info file, in approximate chronological order:
various PC platforms.
* Christos Zoulas provided the `extension()' built-in function for
- dynamically adding new modules.
+ dynamically adding new modules. (This was removed at `gawk' 4.1.)
* Ju"rgen Kahrs contributed the initial version of the TCP/IP
networking code and documentation, and motivated the inclusion of
@@ -20361,7 +25356,7 @@ Info file, in approximate chronological order:
Windows32 environments. (This is no longer supported)
* John Haque reworked the `gawk' internals to use a byte-code engine,
- providing the `dgawk' debugger for `awk' programs.
+ providing the `gawk' debugger for `awk' programs.
* Efraim Yawitz contributed the original text for *note Debugger::.
@@ -20856,10 +25851,6 @@ not overwrite it!_ Instead enter the following commands at your prompt
The binary distribution may contain a separate file containing
additional or more detailed installation instructions.
- As of April, 2012, up to date `gawk' binaries for MS Windows are
-available from Eli Zaretskii's ports project
-(http://sourceforge.net/projects/ezwinports/files/).
-

File: gawk.info, Node: PC Compiling, Next: PC Testing, Prev: PC Binary Installation, Up: PC Installation
@@ -21382,9 +26373,10 @@ Unix `awk'
`pawk'
Nelson H.F. Beebe at the University of Utah has modified Brian
Kernighan's `awk' to provide timing and profiling information. It
- is different from `pgawk' (*note Profiling::), in that it uses
- CPU-based profiling, not line-count profiling. You may find it at
- either `ftp://ftp.math.utah.edu/pub/pawk/pawk-20030606.tar.gz' or
+ is different from `gawk' with the `--profile' option. (*note
+ Profiling::), in that it uses CPU-based profiling, not line-count
+ profiling. You may find it at either
+ `ftp://ftp.math.utah.edu/pub/pawk/pawk-20030606.tar.gz' or
`http://www.math.utah.edu/pub/pawk/pawk-20030606.tar.gz'.
Busybox Awk
@@ -21451,8 +26443,6 @@ and maintainers of `gawk'. Everything in it applies specifically to
* Compatibility Mode:: How to disable certain `gawk'
extensions.
* Additions:: Making Additions To `gawk'.
-* Dynamic Extensions:: Adding new built-in functions to
- `gawk'.
* Future Extensions:: New features that may be implemented one day.

@@ -21479,7 +26469,7 @@ for the casual user. It probably has not even been compiled into your
version of `gawk', since it slows down execution.

-File: gawk.info, Node: Additions, Next: Dynamic Extensions, Prev: Compatibility Mode, Up: Notes
+File: gawk.info, Node: Additions, Next: Future Extensions, Prev: Compatibility Mode, Up: Notes
C.2 Making Additions to `gawk'
==============================
@@ -21499,6 +26489,8 @@ as well as any considerations you should bear in mind.
`gawk'.
* New Ports:: Porting `gawk' to a new operating
system.
+* Derived Files:: Why derived files are kept in the
+ `git' repository.

File: gawk.info, Node: Accessing The Source, Next: Adding Code, Up: Additions
@@ -21526,8 +26518,8 @@ access the repository using:
git clone http://git.savannah.gnu.org/r/gawk.git
Once you have made changes, you can use `git diff' to produce a
-patch, and send that to the `gawk' maintainer; see *note Bugs:: for how
-to do that.
+patch, and send that to the `gawk' maintainer; see *note Bugs::, for
+how to do that.
Finally, if you cannot install Git (e.g., if it hasn't been ported
yet to your operating system), you can use the Git-CVS gateway to check
@@ -21610,9 +26602,9 @@ possible to include your changes:
of `switch' statements, instead of just the plain pointer or
character value.
- * Use the `TRUE', `FALSE' and `NULL' symbolic constants and the
- character constant `'\0'' where appropriate, instead of `1'
- and `0'.
+ * Use `true', `false' for `bool' values, the `NULL' symbolic
+ constant for pointer values, and the character constant
+ `'\0'' where appropriate, instead of `1' and `0'.
* Provide one-line descriptive comments for each function.
@@ -21648,9 +26640,10 @@ possible to include your changes:
7. Submit changes as unified diffs. Use `diff -u -r -N' to compare
the original `gawk' source tree with your version. I recommend
- using the GNU version of `diff'. Send the output produced by
- either run of `diff' to me when you submit your changes. (*Note
- Bugs::, for the electronic mail information.)
+ using the GNU version of `diff', or best of all, `git diff' or
+ `git format-patch'. Send the output produced by `diff' to me when
+ you submit your changes. (*Note Bugs::, for the electronic mail
+ information.)
Using this format makes it easy for me to apply your changes to the
master version of the `gawk' source code (using `patch'). If I
@@ -21667,7 +26660,7 @@ isn't possible for me to do that with a minimum of extra work, then I
probably will not.

-File: gawk.info, Node: New Ports, Prev: Adding Code, Up: Additions
+File: gawk.info, Node: New Ports, Next: Derived Files, Prev: Adding Code, Up: Additions
C.2.3 Porting `gawk' to a New Operating System
----------------------------------------------
@@ -21749,627 +26742,152 @@ code that is already there.
style and brace layout that suits your taste.

-File: gawk.info, Node: Dynamic Extensions, Next: Future Extensions, Prev: Additions, Up: Notes
-
-C.3 Adding New Built-in Functions to `gawk'
-===========================================
-
- Danger Will Robinson! Danger!!
- Warning! Warning!
- The Robot
-
- It is possible to add new built-in functions to `gawk' using
-dynamically loaded libraries. This facility is available on systems
-(such as GNU/Linux) that support the C `dlopen()' and `dlsym()'
-functions. This minor node describes how to write and use dynamically
-loaded extensions for `gawk'. Experience with programming in C or C++
-is necessary when reading this minor node.
-
- CAUTION: The facilities described in this minor node are very much
- subject to change in a future `gawk' release. Be aware that you
- may have to re-do everything, at some future time.
-
- If you have written your own dynamic extensions, be sure to
- recompile them for each new `gawk' release. There is no guarantee
- of binary compatibility between different releases, nor will there
- ever be such a guarantee.
-
- NOTE: When `--sandbox' is specified, extensions are disabled
- (*note Options::.
-
-* Menu:
-
-* Internals:: A brief look at some `gawk' internals.
-* Plugin License:: A note about licensing.
-* Sample Library:: A example of new functions.
-
-
-File: gawk.info, Node: Internals, Next: Plugin License, Up: Dynamic Extensions
+File: gawk.info, Node: Derived Files, Prev: New Ports, Up: Additions
-C.3.1 A Minimal Introduction to `gawk' Internals
-------------------------------------------------
-
-The truth is that `gawk' was not designed for simple extensibility.
-The facilities for adding functions using shared libraries work, but
-are something of a "bag on the side." Thus, this tour is brief and
-simplistic; would-be `gawk' hackers are encouraged to spend some time
-reading the source code before trying to write extensions based on the
-material presented here. Of particular note are the files `awk.h',
-`builtin.c', and `eval.c'. Reading `awkgram.y' in order to see how the
-parse tree is built would also be of use.
-
- With the disclaimers out of the way, the following types, structure
-members, functions, and macros are declared in `awk.h' and are of use
-when writing extensions. The next minor node shows how they are used:
-
-`AWKNUM'
- An `AWKNUM' is the internal type of `awk' floating-point numbers.
- Typically, it is a C `double'.
-
-`NODE'
- Just about everything is done using objects of type `NODE'. These
- contain both strings and numbers, as well as variables and arrays.
-
-`AWKNUM force_number(NODE *n)'
- This macro forces a value to be numeric. It returns the actual
- numeric value contained in the node. It may end up calling an
- internal `gawk' function.
-
-`void force_string(NODE *n)'
- This macro guarantees that a `NODE''s string value is current. It
- may end up calling an internal `gawk' function. It also
- guarantees that the string is zero-terminated.
-
-`void force_wstring(NODE *n)'
- Similarly, this macro guarantees that a `NODE''s wide-string value
- 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.
-
-`n->stptr'
-`n->stlen'
- The data and length of a `NODE''s string value, respectively. The
- string is _not_ guaranteed to be zero-terminated. If you need to
- pass the string value to a C library function, save the value in
- `n->stptr[n->stlen]', assign `'\0'' to it, call the routine, and
- then restore the value.
-
-`n->wstptr'
-`n->wstlen'
- The data and length of a `NODE''s wide-string value, respectively.
- Use `force_wstring()' to make sure these values are current.
-
-`n->type'
- The type of the `NODE'. This is a C `enum'. Values should be one
- of `Node_var', `Node_var_new', or `Node_var_array' for function
- parameters.
-
-`n->vname'
- The "variable name" of a node. This is not of much use inside
- externally written extensions.
-
-`void assoc_clear(NODE *n)'
- 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)'
- 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.
-
-`NODE *make_string(char *s, size_t len)'
- Take a C string and turn it into a pointer to a `NODE' that can be
- stored appropriately. This is permanent storage; understanding of
- `gawk' memory management is helpful.
-
-`NODE *make_number(AWKNUM val)'
- Take an `AWKNUM' and turn it into a pointer to a `NODE' that can
- be stored appropriately. This is permanent storage; understanding
- of `gawk' memory management is helpful.
-
-`NODE *dupnode(NODE *n)'
- Duplicate a node. In most cases, this increments an internal
- reference count instead of actually duplicating the entire `NODE';
- understanding of `gawk' memory management is helpful.
-
-`void unref(NODE *n)'
- This macro releases the memory associated with a `NODE' allocated
- with `make_string()' or `make_number()'. Understanding of `gawk'
- memory management is helpful.
-
-`void make_builtin(const char *name, NODE *(*func)(NODE *), int count)'
- Register a C function pointed to by `func' as new built-in
- function `name'. `name' is a regular C string. `count' is the
- maximum number of arguments that the function takes. The function
- should be written in the following manner:
-
- /* do_xxx --- do xxx function for gawk */
-
- NODE *
- do_xxx(int nargs)
- {
- ...
- }
-
-`NODE *get_argument(int i)'
- This function is called from within a C extension function to get
- the `i'-th argument from the function call. The first argument is
- argument zero.
-
-`NODE *get_actual_argument(int i,'
-` int optional, int wantarray);'
- This function retrieves a particular argument `i'. `wantarray' is
- `TRUE' if the argument should be an array, `FALSE' otherwise. If
- `optional' is `TRUE', the argument need not have been supplied.
- If it wasn't, the return value is `NULL'. It is a fatal error if
- `optional' is `TRUE' but the argument was not provided.
-
-`get_scalar_argument(i, opt)'
- This is a convenience macro that calls `get_actual_argument()'.
-
-`get_array_argument(i, opt)'
- This is a convenience macro that calls `get_actual_argument()'.
-
-`void update_ERRNO(void)'
- This function is called from within a C extension function to set
- the value of `gawk''s `ERRNO' variable, based on the current value
- of the C `errno' global variable. It is provided as a convenience.
-
-`void update_ERRNO_saved(int errno_saved)'
- This function is called from within a C extension function to set
- the value of `gawk''s `ERRNO' variable, based on the error value
- provided as the argument. It is provided as a convenience.
-
-`void register_deferred_variable(const char *name, NODE *(*load_func)(void))'
- This function is called to register a function to be called when a
- reference to an undefined variable with the given name is
- encountered. The callback function will never be called if the
- variable exists already, so, unless the calling code is running at
- program startup, it should first check whether a variable of the
- given name already exists. The argument function must return a
- pointer to a `NODE' containing the newly created variable. This
- function is used to implement the builtin `ENVIRON' and `PROCINFO'
- arrays, so you can refer to them for examples.
-
-`void register_open_hook(void *(*open_func)(IOBUF *))'
- This function is called to register a function to be called
- whenever a new data file is opened, leading to the creation of an
- `IOBUF' structure in `iop_alloc()'. After creating the new
- `IOBUF', `iop_alloc()' will call (in reverse order of
- registration, so the last function registered is called first)
- each open hook until one returns non-`NULL'. If any hook returns
- a non-`NULL' value, that value is assigned to the `IOBUF''s
- `opaque' field (which will presumably point to a structure
- containing additional state associated with the input processing),
- and no further open hooks are called.
-
- The function called will most likely want to set the `IOBUF''s
- `get_record' method to indicate that future input records should
- be retrieved by calling that method instead of using the standard
- `gawk' input processing.
-
- And the function will also probably want to set the `IOBUF''s
- `close_func' method to be called when the file is closed to clean
- up any state associated with the input.
-
- Finally, hook functions should be prepared to receive an `IOBUF'
- structure where the `fd' field is set to `INVALID_HANDLE', meaning
- that `gawk' was not able to open the file itself. In this case,
- the hook function must be able to successfully open the file and
- place a valid file descriptor there.
-
- Currently, for example, the hook function facility is used to
- implement the XML parser shared library extension. For more info,
- please look in `awk.h' and in `io.c'.
-
- An argument that is supposed to be an array needs to be handled with
-some extra code, in case the array being passed in is actually from a
-function parameter.
-
- The following boilerplate code shows how to do this:
-
- NODE *the_arg;
-
- /* assume need 3rd arg, 0-based */
- the_arg = get_array_argument(2, FALSE);
-
- Again, you should spend time studying the `gawk' internals; don't
-just blindly copy this code.
-
-
-File: gawk.info, Node: Plugin License, Next: Sample Library, Prev: Internals, Up: Dynamic Extensions
-
-C.3.2 Extension Licensing
--------------------------
-
-Every dynamic extension should define the global symbol
-`plugin_is_GPL_compatible' to assert that it has been licensed under a
-GPL-compatible license. If this symbol does not exist, `gawk' will
-emit a fatal error and exit.
-
- The declared type of the symbol should be `int'. It does not need
-to be in any allocated section, though. The code merely asserts that
-the symbol exists in the global scope. Something like this is enough:
-
- int plugin_is_GPL_compatible;
-
-
-File: gawk.info, Node: Sample Library, Prev: Plugin License, Up: Dynamic Extensions
-
-C.3.3 Example: Directory and File Operation Built-ins
------------------------------------------------------
-
-Two useful functions that are not in `awk' are `chdir()' (so that an
-`awk' program can change its directory) and `stat()' (so that an `awk'
-program can gather information about a file). This minor node
-implements these functions for `gawk' in an external extension library.
-
-* Menu:
-
-* Internal File Description:: What the new functions will do.
-* Internal File Ops:: The code for internal file operations.
-* Using Internal File Ops:: How to use an external extension.
-
-
-File: gawk.info, Node: Internal File Description, Next: Internal File Ops, Up: Sample Library
-
-C.3.3.1 Using `chdir()' and `stat()'
-....................................
-
-This minor node shows how to use the new functions at the `awk' level
-once they've been integrated into the running `gawk' interpreter.
-Using `chdir()' is very straightforward. It takes one argument, the new
-directory to change to:
-
- ...
- newdir = "/home/arnold/funstuff"
- ret = chdir(newdir)
- if (ret < 0) {
- printf("could not change to %s: %s\n",
- newdir, ERRNO) > "/dev/stderr"
- exit 1
- }
- ...
-
- The return value is negative if the `chdir' failed, and `ERRNO'
-(*note Built-in Variables::) is set to a string indicating the error.
-
- Using `stat()' is a bit more complicated. The C `stat()' function
-fills in a structure that has a fair amount of information. The right
-way to model this in `awk' is to fill in an associative array with the
-appropriate information:
-
- file = "/home/arnold/.profile"
- fdata[1] = "x" # force `fdata' to be an array
- ret = stat(file, fdata)
- if (ret < 0) {
- printf("could not stat %s: %s\n",
- file, ERRNO) > "/dev/stderr"
- exit 1
- }
- printf("size of %s is %d bytes\n", file, fdata["size"])
-
- The `stat()' function always clears the data array, even if the
-`stat()' fails. It fills in the following elements:
-
-`"name"'
- The name of the file that was `stat()''ed.
-
-`"dev"'
-`"ino"'
- The file's device and inode numbers, respectively.
-
-`"mode"'
- The file's mode, as a numeric value. This includes both the file's
- type and its permissions.
-
-`"nlink"'
- The number of hard links (directory entries) the file has.
-
-`"uid"'
-`"gid"'
- The numeric user and group ID numbers of the file's owner.
-
-`"size"'
- The size in bytes of the file.
-
-`"blocks"'
- The number of disk blocks the file actually occupies. This may not
- be a function of the file's size if the file has holes.
-
-`"atime"'
-`"mtime"'
-`"ctime"'
- The file's last access, modification, and inode update times,
- respectively. These are numeric timestamps, suitable for
- formatting with `strftime()' (*note Built-in::).
-
-`"pmode"'
- The file's "printable mode." This is a string representation of
- the file's type and permissions, such as what is produced by `ls
- -l'--for example, `"drwxr-xr-x"'.
-
-`"type"'
- A printable string representation of the file's type. The value
- is one of the following:
-
- `"blockdev"'
- `"chardev"'
- The file is a block or character device ("special file").
-
- `"directory"'
- The file is a directory.
-
- `"fifo"'
- The file is a named-pipe (also known as a FIFO).
-
- `"file"'
- The file is just a regular file.
-
- `"socket"'
- The file is an `AF_UNIX' ("Unix domain") socket in the
- filesystem.
-
- `"symlink"'
- The file is a symbolic link.
-
- Several additional elements may be present depending upon the
-operating system and the type of the file. You can test for them in
-your `awk' program by using the `in' operator (*note Reference to
-Elements::):
-
-`"blksize"'
- The preferred block size for I/O to the file. This field is not
- present on all POSIX-like systems in the C `stat' structure.
-
-`"linkval"'
- If the file is a symbolic link, this element is the name of the
- file the link points to (i.e., the value of the link).
-
-`"rdev"'
-`"major"'
-`"minor"'
- If the file is a block or character device file, then these values
- represent the numeric device number and the major and minor
- components of that number, respectively.
-
-
-File: gawk.info, Node: Internal File Ops, Next: Using Internal File Ops, Prev: Internal File Description, Up: Sample Library
-
-C.3.3.2 C Code for `chdir()' and `stat()'
-.........................................
-
-Here is the C code for these extensions. They were written for
-GNU/Linux. The code needs some more work for complete portability to
-other POSIX-compliant systems:(1)
-
- #include "awk.h"
-
- #include <sys/sysmacros.h>
-
- int plugin_is_GPL_compatible;
+C.2.4 Why Generated Files Are Kept In `git'
+-------------------------------------------
- /* do_chdir --- provide dynamically loaded chdir() builtin for gawk */
+If you look at the `gawk' source in the `git' repository, you will
+notice that it includes files that are automatically generated by GNU
+infrastructure tools, such as `Makefile.in' from `automake' and even
+`configure' from `autoconf'.
- static NODE *
- do_chdir(int nargs)
- {
- NODE *newdir;
- int ret = -1;
+ This is different from many Free Software projects that do not store
+the derived files, because that keeps the repository less cluttered,
+and it is easier to see the substantive changes when comparing versions
+and trying to understand what changed between commits.
- if (do_lint && get_curfunc_arg_count() != 1)
- lintwarn("chdir: called with incorrect number of arguments");
+ However, there are two reasons why the `gawk' maintainer likes to
+have everything in the repository.
- newdir = get_scalar_argument(0, FALSE);
+ First, because it is then easy to reproduce any given version
+completely, without relying upon the availability of (older, likely
+obsolete, and maybe even impossible to find) other tools.
- The file includes the `"awk.h"' header file for definitions for the
-`gawk' internals. It includes `<sys/sysmacros.h>' for access to the
-`major()' and `minor'() macros.
+ As an extreme example, if you ever even think about trying to
+compile, oh, say, the V7 `awk', you will discover that not only do you
+have to bootstrap the V7 `yacc' to do so, but you also need the V7
+`lex'. And the latter is pretty much impossible to bring up on a
+modern GNU/Linux system.(1)
- By convention, for an `awk' function `foo', the function that
-implements it is called `do_foo'. The function should take a `int'
-argument, usually called `nargs', that represents the number of defined
-arguments for the function. The `newdir' variable represents the new
-directory to change to, retrieved with `get_scalar_argument()'. Note
-that the first argument is numbered zero.
+ (Or, let's say `gawk' 1.2 required `bison' whatever-it-was in 1989
+and that there was no `awkgram.c' file in the repository. Is there a
+guarantee that we could find that `bison' version? Or that _it_ would
+build?)
- This code actually accomplishes the `chdir()'. It first forces the
-argument to be a string and passes the string value to the `chdir()'
-system call. If the `chdir()' fails, `ERRNO' is updated.
+ If the repository has all the generated files, then it's easy to
+just check them out and build. (Or _easier_, depending upon how far
+back we go. `:-)')
- (void) force_string(newdir);
- ret = chdir(newdir->stptr);
- if (ret < 0)
- update_ERRNO();
+ And that brings us to the second (and stronger) reason why all the
+files really need to be in `git'. It boils down to who do you cater
+to--the `gawk' developer(s), or the user who just wants to check out a
+version and try it out?
- Finally, the function returns the return value to the `awk' level:
+ The `gawk' maintainer wants it to be possible for any interested
+`awk' user in the world to just clone the repository, check out the
+branch of interest and build it. Without their having to have the
+correct version(s) of the autotools.(2) That is the point of the
+`bootstrap.sh' file. It touches the various other files in the right
+order such that
- return make_number((AWKNUM) ret);
- }
+ # The canonical incantation for building GNU software:
+ ./bootstrap.sh && ./configure && make
- The `stat()' built-in is more involved. First comes a function that
-turns a numeric mode into a printable representation (e.g., 644 becomes
-`-rw-r--r--'). This is omitted here for brevity:
+will _just work_.
- /* format_mode --- turn a stat mode field into something readable */
+ This is extremely important for the `master' and `gawk-X.Y-stable'
+branches.
- static char *
- format_mode(unsigned long fmode)
- {
- ...
- }
+ Further, the `gawk' maintainer would argue that it's also important
+for the `gawk' developers. When he tried to check out the `xgawk'
+branch(3) to build it, he couldn't. (No `ltmain.sh' file, and he had no
+idea how to create it, and that was not the only problem.)
- Next comes the `do_stat()' function. It starts with variable
-declarations and argument checking:
+ He felt _extremely_ frustrated. With respect to that branch, the
+maintainer is no different than Jane User who wants to try to build
+`gawk-4.0-stable' or `master' from the repository.
- /* do_stat --- provide a stat() function for gawk */
+ Thus, the maintainer thinks that it's not just important, but
+critical, that for any given branch, the above incantation _just works_.
- static NODE *
- do_stat(int nargs)
- {
- NODE *file, *array, *tmp;
- struct stat sbuf;
- int ret;
- NODE **aptr;
- char *pmode; /* printable mode */
- char *type = "unknown";
+ What are some of the consequences and/or actions to take?
- if (do_lint && get_curfunc_arg_count() > 2)
- lintwarn("stat: called with too many arguments");
+ 1. We don't mind that there are differing files in the different
+ branches as a result of different versions of the autotools.
- Then comes the actual work. First, the function gets the arguments.
-Then, it always clears the array. The code use `lstat()' (instead of
-`stat()') to get the file information, in case the file is a symbolic
-link. If there's an error, it sets `ERRNO' and returns:
+ A. It's the maintainer's job to merge them and he will deal with
+ it.
- /* file is first arg, array to hold results is second */
- file = get_scalar_argument(0, FALSE);
- array = get_array_argument(1, FALSE);
+ B. He is really good at `git diff x y > /tmp/diff1 ; gvim
+ /tmp/diff1' to remove the diffs that aren't of interest in
+ order to review code. `:-)'
- /* empty out the array */
- assoc_clear(array);
-
- /* lstat the file, if error, set ERRNO and return */
- (void) force_string(file);
- ret = lstat(file->stptr, & sbuf);
- if (ret < 0) {
- update_ERRNO();
- return make_number((AWKNUM) ret);
- }
+ 2. It would certainly help if everyone used the same versions of the
+ GNU tools as he does, which in general are the latest released
+ versions of `automake', `autoconf', `bison', and `gettext'.
- Now comes the tedious part: filling in the array. Only a few of the
-calls are shown here, since they all follow the same pattern:
+ A. Installing from source is quite easy. It's how the maintainer
+ worked for years under Fedora. He had `/usr/local/bin' at
+ the front of hs `PATH' and just did:
- /* fill in the array */
- aptr = assoc_lookup(array, tmp = make_string("name", 4), FALSE);
- *aptr = dupnode(file);
- unref(tmp);
+ wget http://ftp.gnu.org/gnu/PACKAGE/PACKAGE-X.Y.Z.tar.gz
+ tar -xpzvf PACKAGE-X.Y.Z.tar.gz
+ cd PACKAGE-X.Y.Z
+ ./configure && make && make check
+ make install # as root
- aptr = assoc_lookup(array, tmp = make_string("mode", 4), FALSE);
- *aptr = make_number((AWKNUM) sbuf.st_mode);
- unref(tmp);
+ B. These days the maintainer uses Ubuntu 10.11 which is medium
+ current, but he is already doing the above for `autoconf' and
+ `bison'.
- aptr = assoc_lookup(array, tmp = make_string("pmode", 5), FALSE);
- pmode = format_mode(sbuf.st_mode);
- *aptr = make_string(pmode, strlen(pmode));
- unref(tmp);
- When done, return the `lstat()' return value:
+ Most of the above was originally written by the maintainer to other
+`gawk' developers. It raised the objection from one of the developers
+"... that anybody pulling down the source from `git' is not an end
+user."
- return make_number((AWKNUM) ret);
- }
+ However, this is not true. There are "power `awk' users" who can
+build `gawk' (using the magic incantation shown previously) but who
+can't program in C. Thus, the major branches should be kept buildable
+all the time.
- 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:
+ It was then suggested that there be a `cron' job to create nightly
+tarballs of "the source." Here, the problem is that there are source
+trees, corresponding to the various branches! So, nightly tar balls
+aren't the answer, especially as the repository can go for weeks
+without significant change being introduced.
- /* dlload --- load new builtins in this library */
+ Fortunately, the `git' server can meet this need. For any given
+branch named BRANCHNAME, use:
- NODE *
- dlload(NODE *tree, void *dl)
- {
- make_builtin("chdir", do_chdir, 1);
- make_builtin("stat", do_stat, 2);
- return make_number((AWKNUM) 0);
- }
+ wget http://git.savannah.gnu.org/cgit/gawk.git/snapshot/gawk-BRANCHNAME.tar.gz
- And that's it! As an exercise, consider adding functions to
-implement system calls such as `chown()', `chmod()', and `umask()'.
+to retrieve a snapshot of the given branch.
---------- Footnotes ----------
- (1) This version is edited slightly for presentation. See
-`extension/filefuncs.c' in the `gawk' distribution for the complete
-version.
-
-
-File: gawk.info, Node: Using Internal File Ops, Prev: Internal File Ops, Up: Sample Library
-
-C.3.3.3 Integrating the Extensions
-..................................
+ (1) We tried. It was painful.
-Now that the code is written, it must be possible to add it at runtime
-to the running `gawk' interpreter. First, the code must be compiled.
-Assuming that the functions are in a file named `filefuncs.c', and IDIR
-is the location of the `gawk' include files, the following steps create
-a GNU/Linux shared library:
-
- $ gcc -fPIC -shared -DHAVE_CONFIG_H -c -O -g -IIDIR filefuncs.c
- $ ld -o filefuncs.so -shared filefuncs.o
-
- Once the library exists, it is loaded by calling the `extension()'
-built-in function. This function takes two arguments: the name of the
-library to load and the name of a function to call when the library is
-first loaded. This function adds the new functions to `gawk'. It
-returns the value returned by the initialization function within the
-shared library:
-
- # file testff.awk
- BEGIN {
- extension("./filefuncs.so", "dlload")
-
- chdir(".") # no-op
-
- data[1] = 1 # force `data' to be an array
- print "Info for testff.awk"
- ret = stat("testff.awk", data)
- print "ret =", ret
- for (i in data)
- printf "data[\"%s\"] = %s\n", i, data[i]
- print "testff.awk modified:",
- strftime("%m %d %y %H:%M:%S", data["mtime"])
+ (2) There is one GNU program that is (in our opinion) severely
+difficult to bootstrap from the `git' repository. For example, on the
+author's old (but still working) PowerPC macintosh with Mac OS X 10.5,
+it was necessary to bootstrap a ton of software, starting with `git'
+itself, in order to try to work with the latest code. It's not
+pleasant, and especially on older systems, it's a big waste of time.
- print "\nInfo for JUNK"
- ret = stat("JUNK", data)
- print "ret =", ret
- for (i in data)
- printf "data[\"%s\"] = %s\n", i, data[i]
- print "JUNK modified:", strftime("%m %d %y %H:%M:%S", data["mtime"])
- }
+ Starting with the latest tarball was no picnic either. The
+maintainers had dropped `.gz' and `.bz2' files and only distribute
+`.tar.xz' files. It was necessary to bootstrap `xz' first!
- Here are the results of running the program:
-
- $ gawk -f testff.awk
- -| Info for testff.awk
- -| ret = 0
- -| data["size"] = 607
- -| data["ino"] = 14945891
- -| data["name"] = testff.awk
- -| data["pmode"] = -rw-rw-r--
- -| data["nlink"] = 1
- -| data["atime"] = 1293993369
- -| data["mtime"] = 1288520752
- -| data["mode"] = 33204
- -| data["blksize"] = 4096
- -| data["dev"] = 2054
- -| data["type"] = file
- -| data["gid"] = 500
- -| data["uid"] = 500
- -| data["blocks"] = 8
- -| data["ctime"] = 1290113572
- -| testff.awk modified: 10 31 10 12:25:52
- -|
- -| Info for JUNK
- -| ret = -1
- -| JUNK modified: 01 01 70 02:00:00
+ (3) A branch created by one of the other developers that did not
+include the generated files.

-File: gawk.info, Node: Future Extensions, Prev: Dynamic Extensions, Up: Notes
+File: gawk.info, Node: Future Extensions, Prev: Additions, Up: Notes
-C.4 Probable Future Extensions
+C.3 Probable Future Extensions
==============================
AWK is a language similar to PERL, only considerably more elegant.
@@ -22386,12 +26904,9 @@ well.
Following is a list of probable future changes visible at the `awk'
language level:
-Loadable module interface
- It is not clear that the `awk'-level interface to the modules
- facility is as good as it should be. The interface needs to be
- redesigned, particularly taking namespace issues into account, as
- well as possibly including issues such as library search path order
- and versioning.
+Databases
+ It may be possible to map a GDBM/NDBM/SDBM file into an `awk'
+ array.
`RECLEN' variable for fixed-length records
Along with `FIELDWIDTHS', this would speed up the processing of
@@ -22399,30 +26914,12 @@ Loadable module interface
`"RECLEN"', depending upon which kind of record processing is in
effect.
-Databases
- It may be possible to map a GDBM/NDBM/SDBM file into an `awk'
- array.
-
More `lint' warnings
There are more things that could be checked for portability.
Following is a list of probable improvements that will make `gawk''s
source code easier to work with:
-Loadable module mechanics
- The current extension mechanism works (*note Dynamic Extensions::),
- but is rather primitive. It requires a fair amount of manual work
- to create and integrate a loadable module. Nor is the current
- mechanism as portable as might be desired. The GNU `libtool'
- package provides a number of features that would make using
- loadable modules much easier. `gawk' should be changed to use
- `libtool'.
-
-Loadable module internals
- The API to its internals that `gawk' "exports" should be revised.
- Too many things are needlessly exposed. A new API should be
- designed and implemented to make module writing easier.
-
Better array subscript management
`gawk''s management of array subscript storage could use revamping,
so that using the same value to index multiple arrays only stores
@@ -22451,7 +26948,6 @@ introductory texts that you should refer to instead.)
* Basic High Level:: The high level view.
* Basic Data Typing:: A very quick intro to data types.
-* Floating Point Issues:: Stuff to know about floating-point numbers.

File: gawk.info, Node: Basic High Level, Next: Basic Data Typing, Up: Basic Concepts
@@ -22460,12 +26956,13 @@ D.1 What a Program Does
=======================
At the most basic level, the job of a program is to process some input
-data and produce results.
+data and produce results. See *note figure-general-flow::.
- _______
- +------+ / \ +---------+
- | Data | -----> < Program > -----> | Results |
- +------+ \_______/ +---------+
+ _______
++------+ / \ +---------+
+| Data | -----> < Program > -----> | Results |
++------+ \_______/ +---------+
+Figure D.1: General Program Flow
The "program" in the figure can be either a compiled program(1)
(such as `ls'), or it may be "interpreted". In the latter case, a
@@ -22473,19 +26970,20 @@ machine-executable program such as `awk' reads your program, and then
uses the instructions in your program to process the data.
When you write a program, it usually consists of the following, very
-basic set of steps:
-
- ______
- +----------------+ / More \ No +----------+
- | Initialization | -------> < Data > -------> | Clean Up |
- +----------------+ ^ \ ? / +----------+
- | +--+-+
- | | Yes
- | |
- | V
- | +---------+
- +-----+ Process |
- +---------+
+basic set of steps, as shown in *note figure-process-flow:::
+
+ ______
++----------------+ / More \ No +----------+
+| Initialization | -------> < Data > -------> | Clean Up |
++----------------+ ^ \ ? / +----------+
+ | +--+-+
+ | | Yes
+ | |
+ | V
+ | +---------+
+ +-----+ Process |
+ +---------+
+Figure D.2: Basic Program Steps
Initialization
These are the things you do before actually starting to process
@@ -22550,7 +27048,7 @@ such as C, C++, or Ada, and then translated, or "compiled", into a form
that the computer can execute directly.

-File: gawk.info, Node: Basic Data Typing, Next: Floating Point Issues, Prev: Basic High Level, Up: Basic Concepts
+File: gawk.info, Node: Basic Data Typing, Prev: Basic High Level, Up: Basic Concepts
D.2 Data Values in a Computer
=============================
@@ -22570,34 +27068,10 @@ characters that comprise them. Individual variables, as well as
numeric and string variables, are referred to as "scalar" values.
Groups of values, such as arrays, are not scalars.
- Within computers, there are two kinds of numeric values: "integers"
-and "floating-point". In school, integer values were referred to as
-"whole" numbers--that is, numbers without any fractional part, such as
-1, 42, or -17. The advantage to integer numbers is that they represent
-values exactly. The disadvantage is that their range is limited. On
-most systems, this range is -2,147,483,648 to 2,147,483,647. However,
-many systems now support a range from -9,223,372,036,854,775,808 to
-9,223,372,036,854,775,807.
-
- Integer values come in two flavors: "signed" and "unsigned". Signed
-values may be negative or positive, with the range of values just
-described. Unsigned values are always positive. On most systems, the
-range is from 0 to 4,294,967,295. However, many systems now support a
-range from 0 to 18,446,744,073,709,551,615.
-
- Floating-point numbers represent what are called "real" numbers;
-i.e., those that do have a fractional part, such as 3.1415927. The
-advantage to floating-point numbers is that they can represent a much
-larger range of values. The disadvantage is that there are numbers
-that they cannot represent exactly. `awk' uses "double precision"
-floating-point numbers, which can hold more digits than "single
-precision" floating-point numbers. Floating-point issues are discussed
-more fully in *note Floating Point Issues::.
-
- At the very lowest level, computers store values as groups of binary
-digits, or "bits". Modern computers group bits into groups of eight,
-called "bytes". Advanced applications sometimes have to manipulate
-bits directly, and `gawk' provides functions for doing so.
+ *note General Arithmetic::, provided a basic introduction to numeric
+types (integer and floating-point) and how they are used in a computer.
+Please review that information, including a number of caveats that were
+presented.
While you are probably used to the idea of a number without a value
(i.e., zero), it takes a bit more getting used to the idea of
@@ -22618,6 +27092,11 @@ represents 1 times 8, plus 0 times 4, plus 1 times 2, plus 0 times 1,
or decimal 10. Octal and hexadecimal are discussed more in *note
Nondecimal-numbers::.
+ At the very lowest level, computers store values as groups of binary
+digits, or "bits". Modern computers group bits into groups of eight,
+called "bytes". Advanced applications sometimes have to manipulate
+bits directly, and `gawk' provides functions for doing so.
+
Programs are written in programming languages. Hundreds, if not
thousands, of programming languages exist. One of the most popular is
the C programming language. The C language had a very strong influence
@@ -22635,218 +27114,6 @@ In 1999, a revised ISO C standard was approved and released. Where it
makes sense, POSIX `awk' is compatible with 1999 ISO C.

-File: gawk.info, Node: Floating Point Issues, Prev: Basic Data Typing, Up: Basic Concepts
-
-D.3 Floating-Point Number Caveats
-=================================
-
-As mentioned earlier, floating-point numbers represent what are called
-"real" numbers, i.e., those that have a fractional part. `awk' uses
-double precision floating-point numbers to represent all numeric
-values. This minor node describes some of the issues involved in using
-floating-point numbers.
-
- There is a very nice paper on floating-point arithmetic
-(http://www.validlab.com/goldberg/paper.pdf) by David Goldberg, "What
-Every Computer Scientist Should Know About Floating-point Arithmetic,"
-`ACM Computing Surveys' *23*, 1 (1991-03), 5-48. This is worth reading
-if you are interested in the details, but it does require a background
-in computer science.
-
-* Menu:
-
-* String Conversion Precision:: The String Value Can Lie.
-* Unexpected Results:: Floating Point Numbers Are Not Abstract
- Numbers.
-* POSIX Floating Point Problems:: Standards Versus Existing Practice.
-
-
-File: gawk.info, Node: String Conversion Precision, Next: Unexpected Results, Up: Floating Point Issues
-
-D.3.1 The String Value Can Lie
-------------------------------
-
-Internally, `awk' keeps both the numeric value (double precision
-floating-point) and the string value for a variable. Separately, `awk'
-keeps track of what type the variable has (*note Typing and
-Comparison::), which plays a role in how variables are used in
-comparisons.
-
- It is important to note that the string value for a number may not
-reflect the full value (all the digits) that the numeric value actually
-contains. The following program (`values.awk') illustrates this:
-
- {
- sum = $1 + $2
- # see it for what it is
- printf("sum = %.12g\n", sum)
- # use CONVFMT
- a = "<" sum ">"
- print "a =", a
- # use OFMT
- print "sum =", sum
- }
-
-This program shows the full value of the sum of `$1' and `$2' using
-`printf', and then prints the string values obtained from both
-automatic conversion (via `CONVFMT') and from printing (via `OFMT').
-
- Here is what happens when the program is run:
-
- $ echo 3.654321 1.2345678 | awk -f values.awk
- -| sum = 4.8888888
- -| a = <4.88889>
- -| sum = 4.88889
-
- This makes it clear that the full numeric value is different from
-what the default string representations show.
-
- `CONVFMT''s default value is `"%.6g"', which yields a value with at
-least six significant digits. For some applications, you might want to
-change it to specify more precision. On most modern machines, most of
-the time, 17 digits is enough to capture a floating-point number's
-value exactly.(1)
-
- ---------- Footnotes ----------
-
- (1) Pathological cases can require up to 752 digits (!), but we
-doubt that you need to worry about this.
-
-
-File: gawk.info, Node: Unexpected Results, Next: POSIX Floating Point Problems, Prev: String Conversion Precision, Up: Floating Point Issues
-
-D.3.2 Floating Point Numbers Are Not Abstract Numbers
------------------------------------------------------
-
-Unlike numbers in the abstract sense (such as what you studied in high
-school or college math), numbers stored in computers are limited in
-certain ways. They cannot represent an infinite number of digits, nor
-can they always represent things exactly. In particular,
-floating-point numbers cannot always represent values exactly. Here is
-an example:
-
- $ awk '{ printf("%010d\n", $1 * 100) }'
- 515.79
- -| 0000051579
- 515.80
- -| 0000051579
- 515.81
- -| 0000051580
- 515.82
- -| 0000051582
- Ctrl-d
-
-This shows that some values can be represented exactly, whereas others
-are only approximated. This is not a "bug" in `awk', but simply an
-artifact of how computers represent numbers.
-
- Another peculiarity of floating-point numbers on modern systems is
-that they often have more than one representation for the number zero!
-In particular, it is possible to represent "minus zero" as well as
-regular, or "positive" zero.
-
- This example shows that negative and positive zero are distinct
-values when stored internally, but that they are in fact equal to each
-other, as well as to "regular" zero:
-
- $ gawk 'BEGIN { mz = -0 ; pz = 0
- > printf "-0 = %g, +0 = %g, (-0 == +0) -> %d\n", mz, pz, mz == pz
- > printf "mz == 0 -> %d, pz == 0 -> %d\n", mz == 0, pz == 0
- > }'
- -| -0 = -0, +0 = 0, (-0 == +0) -> 1
- -| mz == 0 -> 1, pz == 0 -> 1
-
- It helps to keep this in mind should you process numeric data that
-contains negative zero values; the fact that the zero is negative is
-noted and can affect comparisons.
-
-
-File: gawk.info, Node: POSIX Floating Point Problems, Prev: Unexpected Results, Up: Floating Point Issues
-
-D.3.3 Standards Versus Existing Practice
-----------------------------------------
-
-Historically, `awk' has converted any non-numeric looking string to the
-numeric value zero, when required. Furthermore, the original
-definition of the language and the original POSIX standards specified
-that `awk' only understands decimal numbers (base 10), and not octal
-(base 8) or hexadecimal numbers (base 16).
-
- Changes in the language of the 2001 and 2004 POSIX standard can be
-interpreted to imply that `awk' should support additional features.
-These features are:
-
- * Interpretation of floating point data values specified in
- hexadecimal notation (`0xDEADBEEF'). (Note: data values, _not_
- source code constants.)
-
- * Support for the special IEEE 754 floating point values "Not A
- Number" (NaN), positive Infinity ("inf") and negative Infinity
- ("-inf"). In particular, the format for these values is as
- specified by the ISO 1999 C standard, which ignores case and can
- allow machine-dependent additional characters after the `nan' and
- allow either `inf' or `infinity'.
-
- The first problem is that both of these are clear changes to
-historical practice:
-
- * The `gawk' maintainer feels that supporting hexadecimal floating
- point values, in particular, is ugly, and was never intended by the
- original designers to be part of the language.
-
- * Allowing completely alphabetic strings to have valid numeric
- values is also a very severe departure from historical practice.
-
- The second problem is that the `gawk' maintainer feels that this
-interpretation of the standard, which requires a certain amount of
-"language lawyering" to arrive at in the first place, was not even
-intended by the standard developers. In other words, "we see how you
-got where you are, but we don't think that that's where you want to be."
-
- The 2008 POSIX standard added explicit wording to allow, but not
-require, that `awk' support hexadecimal floating point values and
-special values for "Not A Number" and infinity.
-
- Although the `gawk' maintainer continues to feel that providing
-those features is inadvisable, nevertheless, on systems that support
-IEEE floating point, it seems reasonable to provide _some_ way to
-support NaN and Infinity values. The solution implemented in `gawk' is
-as follows:
-
- * With the `--posix' command-line option, `gawk' becomes "hands
- off." String values are passed directly to the system library's
- `strtod()' function, and if it successfully returns a numeric
- value, that is what's used.(1) By definition, the results are not
- portable across different systems. They are also a little
- surprising:
-
- $ echo nanny | gawk --posix '{ print $1 + 0 }'
- -| nan
- $ echo 0xDeadBeef | gawk --posix '{ print $1 + 0 }'
- -| 3735928559
-
- * Without `--posix', `gawk' interprets the four strings `+inf',
- `-inf', `+nan', and `-nan' specially, producing the corresponding
- special numeric values. The leading sign acts a signal to `gawk'
- (and the user) that the value is really numeric. Hexadecimal
- floating point is not supported (unless you also use
- `--non-decimal-data', which is _not_ recommended). For example:
-
- $ echo nanny | gawk '{ print $1 + 0 }'
- -| 0
- $ echo +nan | gawk '{ print $1 + 0 }'
- -| nan
- $ echo 0xDeadBeef | gawk '{ print $1 + 0 }'
- -| 0
-
- `gawk' does ignore case in the four special values. Thus `+nan'
- and `+NaN' are the same.
-
- ---------- Footnotes ----------
-
- (1) You asked for it, you got it.
-
-
File: gawk.info, Node: Glossary, Next: Copying, Prev: Basic Concepts, Up: Top
Glossary
@@ -23003,6 +27270,10 @@ CHEM
Brian Kernighan and Jon Bentley, and is available from
`http://netlib.sandia.gov/netlib/typesetting/chem.gz'.
+Cookie
+ A peculiar goodie, token, saying or remembrance produced by or
+ presented to a program. (With thanks to Doug McIlroy.)
+
Coprocess
A subordinate program with which two-way communications is
possible.
@@ -24740,14 +29011,14 @@ Index
* ' (single quote): One-shot. (line 15)
* ' (single quote), vs. apostrophe: Comments. (line 27)
* ' (single quote), with double quotes: Quoting. (line 53)
+* () (parentheses) <1>: Profiling. (line 138)
* () (parentheses): Regexp Operators. (line 79)
-* () (parentheses), pgawk program: Profiling. (line 141)
* * (asterisk), * operator, as multiplication operator: Precedence.
(line 55)
* * (asterisk), * operator, as regexp operator: Regexp Operators.
(line 87)
* * (asterisk), * operator, null strings, matching: Gory Details.
- (line 164)
+ (line 165)
* * (asterisk), ** operator <1>: Precedence. (line 49)
* * (asterisk), ** operator: Arithmetic Ops. (line 81)
* * (asterisk), **= operator <1>: Precedence. (line 95)
@@ -24768,79 +29039,86 @@ Index
* - (hyphen), -- operator: Increment Ops. (line 48)
* - (hyphen), -= operator <1>: Precedence. (line 95)
* - (hyphen), -= operator: Assignment Ops. (line 129)
-* - (hyphen), filenames beginning with: Options. (line 59)
+* - (hyphen), filenames beginning with: Options. (line 73)
* - (hyphen), in bracket expressions: Bracket Expressions. (line 17)
-* --assign option: Options. (line 32)
-* --c option: Options. (line 81)
-* --characters-as-bytes option: Options. (line 68)
-* --command option: Options. (line 234)
-* --copyright option: Options. (line 88)
+* --assign option: Options. (line 46)
+* --bignum option: Options. (line 201)
+* --c option: Options. (line 95)
+* --characters-as-bytes option: Options. (line 82)
+* --copyright option: Options. (line 102)
+* --debug option: Options. (line 122)
* --disable-lint configuration option: Additional Configuration Options.
(line 9)
* --disable-nls configuration option: Additional Configuration Options.
(line 24)
* --dump-variables option <1>: Library Names. (line 45)
-* --dump-variables option: Options. (line 93)
-* --exec option: Options. (line 116)
+* --dump-variables option: Options. (line 107)
+* --exec option: Options. (line 139)
* --field-separator option: Options. (line 21)
* --file option: Options. (line 25)
* --gen-pot option <1>: String Extraction. (line 6)
-* --gen-pot option: Options. (line 138)
-* --help option: Options. (line 145)
-* --L option: Options. (line 248)
-* --lint option <1>: Options. (line 150)
+* --gen-pot option: Options. (line 161)
+* --help option: Options. (line 168)
+* --include option: Options. (line 32)
+* --L option: Options. (line 288)
+* --lint option <1>: Options. (line 182)
* --lint option: Command Line. (line 20)
-* --lint-old option: Options. (line 248)
+* --lint-old option: Options. (line 288)
+* --load option: Options. (line 173)
* --non-decimal-data option <1>: Nondecimal Data. (line 6)
-* --non-decimal-data option: Options. (line 169)
+* --non-decimal-data option: Options. (line 207)
* --non-decimal-data option, strtonum() function and: Nondecimal Data.
(line 36)
-* --optimize option: Options. (line 182)
-* --posix option: Options. (line 202)
-* --posix option, --traditional option and: Options. (line 221)
-* --profile option <1>: Profiling. (line 15)
-* --profile option: Options. (line 189)
-* --re-interval option: Options. (line 227)
-* --sandbox option: Options. (line 239)
+* --optimize option: Options. (line 228)
+* --posix option: Options. (line 247)
+* --posix option, --traditional option and: Options. (line 266)
+* --pretty-print option: Options. (line 220)
+* --profile option <1>: Profiling. (line 12)
+* --profile option: Options. (line 235)
+* --re-interval option: Options. (line 272)
+* --sandbox option: Options. (line 279)
* --sandbox option, disabling system() function: I/O Functions.
(line 85)
* --sandbox option, input redirection with getline: Getline. (line 19)
* --sandbox option, output redirection with print, printf: Redirection.
(line 6)
-* --source option: Options. (line 108)
-* --traditional option: Options. (line 81)
-* --traditional option, --posix option and: Options. (line 221)
-* --use-lc-numeric option: Options. (line 177)
-* --version option: Options. (line 253)
+* --source option: Options. (line 131)
+* --traditional option: Options. (line 95)
+* --traditional option, --posix option and: Options. (line 266)
+* --use-lc-numeric option: Options. (line 215)
+* --version option: Options. (line 293)
* --with-whiny-user-strftime configuration option: Additional Configuration Options.
(line 29)
-* -b option: Options. (line 68)
-* -C option: Options. (line 88)
-* -d option: Options. (line 93)
-* -E option: Options. (line 116)
-* -e option: Options. (line 108)
+* -b option: Options. (line 82)
+* -C option: Options. (line 102)
+* -D option: Options. (line 122)
+* -d option: Options. (line 107)
+* -E option: Options. (line 139)
+* -e option: Options. (line 131)
* -F option: Command Line Field Separator.
(line 6)
* -f option: Options. (line 25)
* -F option: Options. (line 21)
* -f option: Long. (line 12)
-* -F option, -Ft sets FS to TAB: Options. (line 261)
-* -f option, on command line: Options. (line 266)
-* -g option: Options. (line 138)
-* -h option: Options. (line 145)
-* -l option: Options. (line 150)
-* -N option: Options. (line 177)
-* -n option: Options. (line 169)
-* -O option: Options. (line 182)
-* -P option: Options. (line 202)
-* -p option: Options. (line 189)
-* -R option: Options. (line 234)
-* -r option: Options. (line 227)
-* -S option: Options. (line 239)
-* -V option: Options. (line 253)
-* -v option: Options. (line 32)
+* -F option, -Ft sets FS to TAB: Options. (line 301)
+* -f option, on command line: Options. (line 306)
+* -g option: Options. (line 161)
+* -h option: Options. (line 168)
+* -i option: Options. (line 32)
+* -l option: Options. (line 173)
+* -M option: Options. (line 201)
+* -N option: Options. (line 215)
+* -n option: Options. (line 207)
+* -O option: Options. (line 228)
+* -o option: Options. (line 220)
+* -P option: Options. (line 247)
+* -p option: Options. (line 235)
+* -r option: Options. (line 272)
+* -S option: Options. (line 279)
+* -V option: Options. (line 293)
+* -v option: Options. (line 46)
* -v option, variables, assigning: Assignment Options. (line 12)
-* -W option: Options. (line 46)
+* -W option: Options. (line 60)
* . (period): Regexp Operators. (line 43)
* .mo files: Explaining gettext. (line 41)
* .mo files, converting from .po: I18N Example. (line 62)
@@ -24969,7 +29247,6 @@ Index
* Ada programming language: Glossary. (line 20)
* adding, features to gawk: Adding Code. (line 6)
* adding, fields: Changing Fields. (line 53)
-* adding, functions to gawk: Dynamic Extensions. (line 10)
* advanced features, buffering: I/O Functions. (line 98)
* advanced features, close() function: Close Files And Pipes.
(line 131)
@@ -24977,7 +29254,7 @@ Index
(line 67)
* advanced features, data files as single record: Records. (line 180)
* advanced features, fixed-width data: Constant Size. (line 9)
-* advanced features, FNR/NR variables: Auto-set. (line 207)
+* advanced features, FNR/NR variables: Auto-set. (line 295)
* advanced features, gawk: Advanced Features. (line 6)
* advanced features, gawk, network programming: TCP/IP Networking.
(line 6)
@@ -24987,7 +29264,7 @@ Index
(line 23)
* advanced features, network connections, See Also networks, connections: Advanced Features.
(line 6)
-* advanced features, null strings, matching: Gory Details. (line 164)
+* advanced features, null strings, matching: Gory Details. (line 165)
* advanced features, operators, precedence: Increment Ops. (line 61)
* advanced features, piping into sh: Redirection. (line 143)
* advanced features, regexp constants: Assignment Ops. (line 148)
@@ -24997,7 +29274,7 @@ Index
* Aho, Alfred: History. (line 17)
* alarm clock example program: Alarm Program. (line 9)
* alarm.awk program: Alarm Program. (line 29)
-* algorithms: Basic High Level. (line 66)
+* algorithms: Basic High Level. (line 68)
* Alpha (DEC): Manual History. (line 28)
* amazing awk assembler (aaa): Glossary. (line 12)
* amazingly workable formatter (awf): Glossary. (line 25)
@@ -25012,6 +29289,8 @@ Index
* and Boolean-logic operator: Boolean Ops. (line 6)
* and() function (gawk): Bitwise Functions. (line 39)
* ANSI: Glossary. (line 35)
+* arbitrary precision: Arbitrary Precision Arithmetic.
+ (line 6)
* archeologists: Bugs. (line 6)
* ARGC/ARGV variables <1>: ARGC and ARGV. (line 6)
* ARGC/ARGV variables: Auto-set. (line 11)
@@ -25026,18 +29305,15 @@ 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)
* 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, 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, order of: Scanning an Array. (line 48)
* arrays, elements, referencing: Reference to Elements.
(line 6)
@@ -25076,15 +29352,13 @@ 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)
* associative arrays: Array Intro. (line 50)
* asterisk (*), * operator, as multiplication operator: Precedence.
(line 55)
* asterisk (*), * operator, as regexp operator: Regexp Operators.
(line 87)
* asterisk (*), * operator, null strings, matching: Gory Details.
- (line 164)
+ (line 165)
* asterisk (*), ** operator <1>: Precedence. (line 49)
* asterisk (*), ** operator: Arithmetic Ops. (line 81)
* asterisk (*), **= operator <1>: Precedence. (line 95)
@@ -25093,7 +29367,10 @@ Index
* asterisk (*), *= operator: Assignment Ops. (line 129)
* atan2() function: Numeric Functions. (line 11)
* awf (amazingly workable formatter) program: Glossary. (line 25)
+* awk debugging, enabling: Options. (line 122)
+* awk enabling: Options. (line 220)
* awk language, POSIX version: Assignment Ops. (line 136)
+* awk profiling, enabling: Options. (line 235)
* awk programs <1>: Two Rules. (line 6)
* awk programs <2>: Executable Scripts. (line 6)
* awk programs: Getting Started. (line 12)
@@ -25109,7 +29386,6 @@ Index
* awk programs, location of: Options. (line 25)
* awk programs, one-line examples: Very Simple. (line 45)
* awk programs, profiling: Profiling. (line 6)
-* awk programs, profiling, enabling: Options. (line 189)
* awk programs, running <1>: Long. (line 6)
* awk programs, running: Running gawk. (line 6)
* awk programs, running, from shell scripts: One-shot. (line 22)
@@ -25144,14 +29420,13 @@ Index
* awk, versions of, See Also Brian Kernighan's awk <1>: Other Versions.
(line 13)
* awk, versions of, See Also Brian Kernighan's awk: BTL. (line 6)
-* awk.h file (internal): Internals. (line 15)
* awka compiler for awk: Other Versions. (line 55)
-* AWKNUM internal type: Internals. (line 19)
+* AWKLIBPATH environment variable: AWKLIBPATH Variable. (line 6)
* AWKPATH environment variable <1>: PC Using. (line 11)
* AWKPATH environment variable: AWKPATH Variable. (line 6)
-* awkprof.out file: Profiling. (line 10)
+* awkprof.out file: Profiling. (line 6)
* awksed.awk program: Simple Sed. (line 25)
-* awkvars.out file: Options. (line 93)
+* awkvars.out file: Options. (line 107)
* b debugger command (alias for break): Breakpoint Control. (line 11)
* backslash (\) <1>: Regexp Operators. (line 18)
* backslash (\) <2>: Quoting. (line 31)
@@ -25203,12 +29478,13 @@ Index
* backslash (\), in escape sequences, POSIX and: Escape Sequences.
(line 113)
* backslash (\), regexp constants: Computed Regexps. (line 28)
-* backtrace debugger command: Dgawk Stack. (line 13)
+* backtrace debugger command: Execution Stack. (line 13)
* BBS-list file: Sample Data Files. (line 6)
* Beebe, Nelson <1>: Other Versions. (line 69)
* Beebe, Nelson: Acknowledgments. (line 60)
-* BEGIN pattern <1>: BEGIN/END. (line 6)
-* BEGIN pattern <2>: Field Separators. (line 44)
+* BEGIN pattern <1>: Profiling. (line 62)
+* BEGIN pattern <2>: BEGIN/END. (line 6)
+* BEGIN pattern <3>: Field Separators. (line 44)
* BEGIN pattern: Records. (line 29)
* BEGIN pattern, assert() user-defined function and: Assert Function.
(line 83)
@@ -25223,7 +29499,6 @@ Index
* BEGIN pattern, OFS/ORS variables, assigning values to: Output Separators.
(line 20)
* BEGIN pattern, operators and: Using BEGIN/END. (line 17)
-* BEGIN pattern, pgawk program: Profiling. (line 65)
* BEGIN pattern, print statement and: I/O And BEGIN/END. (line 16)
* BEGIN pattern, pwcat program: Passwd Functions. (line 143)
* BEGIN pattern, running awk programs and: Cut Program. (line 68)
@@ -25242,7 +29517,7 @@ Index
(line 33)
* BINMODE variable <1>: PC Using. (line 34)
* BINMODE variable: User-modified. (line 10)
-* bits2str() user-defined function: Bitwise Functions. (line 68)
+* bits2str() user-defined function: Bitwise Functions. (line 70)
* bitwise, complement: Bitwise Functions. (line 25)
* bitwise, operations: Bitwise Functions. (line 6)
* bitwise, shift: Bitwise Functions. (line 32)
@@ -25252,8 +29527,8 @@ Index
* Boolean expressions, as patterns: Expression Patterns. (line 41)
* Boolean operators, See Boolean expressions: Boolean Ops. (line 6)
* Bourne shell, quoting rules for: Quoting. (line 18)
+* braces ({}): Profiling. (line 134)
* braces ({}), actions and: Action Overview. (line 19)
-* braces ({}), pgawk program: Profiling. (line 137)
* braces ({}), statements, grouping: Statements. (line 10)
* bracket expressions <1>: Bracket Expressions. (line 6)
* bracket expressions: Regexp Operators. (line 55)
@@ -25272,15 +29547,15 @@ Index
* break debugger command: Breakpoint Control. (line 11)
* break statement: Break Statement. (line 6)
* Brennan, Michael <1>: Other Versions. (line 6)
-* Brennan, Michael <2>: Simple Sed. (line 25)
-* Brennan, Michael <3>: Two-way I/O. (line 6)
+* Brennan, Michael <2>: Two-way I/O. (line 6)
+* Brennan, Michael <3>: Simple Sed. (line 25)
* Brennan, Michael: Delete. (line 56)
* Brian Kernighan's awk, extensions <1>: Other Versions. (line 13)
* Brian Kernighan's awk, extensions: BTL. (line 6)
* Broder, Alan J.: Contributors. (line 88)
* Brown, Martin: Contributors. (line 82)
-* BSD-based operating systems: Glossary. (line 615)
-* bt debugger command (alias for backtrace): Dgawk Stack. (line 13)
+* BSD-based operating systems: Glossary. (line 619)
+* bt debugger command (alias for backtrace): Execution Stack. (line 13)
* Buening, Andreas <1>: Bugs. (line 71)
* Buening, Andreas <2>: Contributors. (line 92)
* Buening, Andreas: Acknowledgments. (line 60)
@@ -25295,10 +29570,10 @@ Index
* built-in functions: Functions. (line 6)
* built-in functions, evaluation order: Calling Built-in. (line 30)
* built-in variables: Built-in Variables. (line 6)
-* built-in variables, -v option, setting with: Options. (line 40)
+* built-in variables, -v option, setting with: Options. (line 54)
* built-in variables, conveying information: Auto-set. (line 6)
* built-in variables, user-modifiable: User-modified. (line 6)
-* Busybox Awk: Other Versions. (line 78)
+* Busybox Awk: Other Versions. (line 79)
* call by reference: Pass By Value/Reference.
(line 47)
* call by value: Pass By Value/Reference.
@@ -25318,7 +29593,7 @@ Index
* case sensitivity, regexps and <1>: User-modified. (line 82)
* case sensitivity, regexps and: Case-sensitivity. (line 6)
* case sensitivity, string comparisons and: User-modified. (line 82)
-* CGI, awk scripts for: Options. (line 116)
+* CGI, awk scripts for: Options. (line 139)
* character lists, See bracket expressions: Regexp Operators. (line 55)
* character sets (machine character encodings) <1>: Glossary. (line 141)
* character sets (machine character encodings): Ordinal Functions.
@@ -25329,7 +29604,6 @@ Index
* characters, transliterating: Translate Program. (line 6)
* characters, values of as numbers: Ordinal Functions. (line 6)
* Chassell, Robert J.: Acknowledgments. (line 33)
-* chdir() function, implementing in gawk: Sample Library. (line 6)
* chem utility: Glossary. (line 151)
* chr() user-defined function: Ordinal Functions. (line 16)
* clear debugger command: Breakpoint Control. (line 36)
@@ -25348,7 +29622,6 @@ 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)
* collating elements: Bracket Expressions. (line 69)
* collating symbols: Bracket Expressions. (line 76)
* Colombo, Antonio: Acknowledgments. (line 60)
@@ -25368,11 +29641,11 @@ Index
(line 6)
* command line, options <2>: Options. (line 6)
* command line, options: Long. (line 12)
-* command line, options, end of: Options. (line 54)
+* command line, options, end of: Options. (line 68)
* command line, variables, assigning on: Assignment Options. (line 6)
* command-line options, processing: Getopt Function. (line 6)
* command-line options, string extraction: String Extraction. (line 6)
-* commands debugger command: Dgawk Execution Control.
+* commands debugger command: Debugger Execution Control.
(line 10)
* commenting: Comments. (line 6)
* commenting, backslash continuation and: Statements/Lines. (line 76)
@@ -25404,14 +29677,14 @@ Index
(line 60)
* compatibility mode (gawk), octal numbers: Nondecimal-numbers.
(line 60)
-* compatibility mode (gawk), specifying: Options. (line 81)
-* compiled programs <1>: Glossary. (line 161)
-* compiled programs: Basic High Level. (line 14)
+* compatibility mode (gawk), specifying: Options. (line 95)
+* compiled programs <1>: Glossary. (line 165)
+* compiled programs: Basic High Level. (line 15)
* compiling gawk for Cygwin: Cygwin. (line 6)
* compiling gawk for MS-DOS and MS-Windows: PC Compiling. (line 13)
* compiling gawk for VMS: VMS Compilation. (line 6)
* compiling gawk with EMX for OS/2: PC Compiling. (line 28)
-* compl() function (gawk): Bitwise Functions. (line 42)
+* compl() function (gawk): Bitwise Functions. (line 43)
* complement, bitwise: Bitwise Functions. (line 25)
* compound statements, control statements and: Statements. (line 10)
* concatenating: Concatenation. (line 9)
@@ -25425,22 +29698,27 @@ Index
(line 29)
* configuration options, gawk: Additional Configuration Options.
(line 6)
+* constants, floating-point: Floating-point Constants.
+ (line 6)
* constants, nondecimal: Nondecimal Data. (line 6)
* constants, types of: Constants. (line 6)
+* context, floating-point: Floating-point Context.
+ (line 6)
* continue statement: Continue Statement. (line 6)
* control statements: Statements. (line 6)
* converting, case: String Functions. (line 522)
* converting, dates to timestamps: Time Functions. (line 74)
* converting, during subscripting: Numeric Array Subscripts.
(line 31)
-* converting, numbers to strings <1>: Bitwise Functions. (line 107)
+* converting, numbers to strings <1>: Bitwise Functions. (line 109)
* converting, numbers to strings: Conversion. (line 6)
-* converting, strings to numbers <1>: Bitwise Functions. (line 107)
+* converting, strings to numbers <1>: Bitwise Functions. (line 109)
* converting, strings to numbers: Conversion. (line 6)
* CONVFMT variable <1>: User-modified. (line 28)
* CONVFMT variable: Conversion. (line 29)
* CONVFMT variable, array subscripts and: Numeric Array Subscripts.
(line 6)
+* cookie: Glossary. (line 157)
* coprocesses <1>: Two-way I/O. (line 44)
* coprocesses: Redirection. (line 102)
* coprocesses, closing: Close Files And Pipes.
@@ -25449,7 +29727,7 @@ Index
* cos() function: Numeric Functions. (line 15)
* counting: Wc Program. (line 6)
* csh utility: Statements/Lines. (line 44)
-* csh utility, POSIXLY_CORRECT environment variable: Options. (line 308)
+* csh utility, POSIXLY_CORRECT environment variable: Options. (line 348)
* csh utility, |& operator, comparison with: Two-way I/O. (line 44)
* ctime() user-defined function: Function Example. (line 72)
* currency symbols, localization: Explaining gettext. (line 103)
@@ -25457,9 +29735,9 @@ Index
(line 30)
* cut utility: Cut Program. (line 6)
* cut.awk program: Cut Program. (line 45)
-* d debugger command (alias for delete): Breakpoint Control. (line 63)
+* d debugger command (alias for delete): Breakpoint Control. (line 64)
* d.c., See dark corner: Conventions. (line 38)
-* dark corner <1>: Glossary. (line 193)
+* dark corner <1>: Glossary. (line 197)
* dark corner <2>: Truth Values. (line 24)
* dark corner <3>: Assignment Ops. (line 148)
* dark corner: Conventions. (line 38)
@@ -25479,9 +29757,9 @@ Index
* dark corner, exit statement: Exit Statement. (line 30)
* dark corner, field separators: Field Splitting Summary.
(line 47)
-* dark corner, FILENAME variable <1>: Auto-set. (line 92)
+* dark corner, FILENAME variable <1>: Auto-set. (line 93)
* dark corner, FILENAME variable: Getline Notes. (line 19)
-* dark corner, FNR/NR variables: Auto-set. (line 207)
+* dark corner, FNR/NR variables: Auto-set. (line 295)
* dark corner, format-control characters: Control Letters. (line 18)
* dark corner, FS as null string: Single Character Fields.
(line 20)
@@ -25501,7 +29779,7 @@ Index
* dark corner, strings, storing: Records. (line 196)
* dark corner, value of ARGV[0]: Auto-set. (line 35)
* data, fixed-width: Constant Size. (line 9)
-* data-driven languages: Basic High Level. (line 83)
+* data-driven languages: Basic High Level. (line 85)
* database, group, reading: Group Functions. (line 6)
* database, users, reading: Passwd Functions. (line 6)
* date utility, GNU: Time Functions. (line 17)
@@ -25521,119 +29799,121 @@ Index
(line 33)
* deadlocks: Two-way I/O. (line 70)
* debugger commands, b (break): Breakpoint Control. (line 11)
-* debugger commands, backtrace: Dgawk Stack. (line 13)
+* debugger commands, backtrace: Execution Stack. (line 13)
* debugger commands, break: Breakpoint Control. (line 11)
-* debugger commands, bt (backtrace): Dgawk Stack. (line 13)
-* debugger commands, c (continue): Dgawk Execution Control.
+* debugger commands, bt (backtrace): Execution Stack. (line 13)
+* debugger commands, c (continue): Debugger Execution Control.
(line 33)
* debugger commands, clear: Breakpoint Control. (line 36)
-* debugger commands, commands: Dgawk Execution Control.
+* debugger commands, commands: Debugger Execution Control.
(line 10)
* debugger commands, condition: Breakpoint Control. (line 54)
-* debugger commands, continue: Dgawk Execution Control.
+* debugger commands, continue: Debugger Execution Control.
(line 33)
-* debugger commands, d (delete): Breakpoint Control. (line 63)
-* debugger commands, delete: Breakpoint Control. (line 63)
-* debugger commands, disable: Breakpoint Control. (line 68)
+* debugger commands, d (delete): Breakpoint Control. (line 64)
+* debugger commands, delete: Breakpoint Control. (line 64)
+* debugger commands, disable: Breakpoint Control. (line 69)
* debugger commands, display: Viewing And Changing Data.
(line 8)
-* debugger commands, down: Dgawk Stack. (line 21)
-* debugger commands, dump: Miscellaneous Dgawk Commands.
+* debugger commands, down: Execution Stack. (line 21)
+* debugger commands, dump: Miscellaneous Debugger Commands.
(line 9)
-* debugger commands, e (enable): Breakpoint Control. (line 72)
-* debugger commands, enable: Breakpoint Control. (line 72)
-* debugger commands, end: Dgawk Execution Control.
+* debugger commands, e (enable): Breakpoint Control. (line 73)
+* debugger commands, enable: Breakpoint Control. (line 73)
+* debugger commands, end: Debugger Execution Control.
(line 10)
* debugger commands, eval: Viewing And Changing Data.
(line 23)
-* debugger commands, f (frame): Dgawk Stack. (line 25)
-* debugger commands, finish: Dgawk Execution Control.
+* debugger commands, f (frame): Execution Stack. (line 25)
+* debugger commands, finish: Debugger Execution Control.
(line 39)
-* debugger commands, frame: Dgawk Stack. (line 25)
-* debugger commands, h (help): Miscellaneous Dgawk Commands.
+* debugger commands, frame: Execution Stack. (line 25)
+* debugger commands, h (help): Miscellaneous Debugger Commands.
(line 68)
-* debugger commands, help: Miscellaneous Dgawk Commands.
+* debugger commands, help: Miscellaneous Debugger Commands.
(line 68)
-* debugger commands, i (info): Dgawk Info. (line 12)
-* debugger commands, ignore: Breakpoint Control. (line 86)
-* debugger commands, info: Dgawk Info. (line 12)
-* debugger commands, l (list): Miscellaneous Dgawk Commands.
+* debugger commands, i (info): Debugger Info. (line 13)
+* debugger commands, ignore: Breakpoint Control. (line 87)
+* debugger commands, info: Debugger Info. (line 13)
+* debugger commands, l (list): Miscellaneous Debugger Commands.
(line 74)
-* debugger commands, list: Miscellaneous Dgawk Commands.
+* debugger commands, list: Miscellaneous Debugger Commands.
(line 74)
-* debugger commands, n (next): Dgawk Execution Control.
+* debugger commands, n (next): Debugger Execution Control.
(line 43)
-* debugger commands, next: Dgawk Execution Control.
+* debugger commands, next: Debugger Execution Control.
(line 43)
-* debugger commands, nexti: Dgawk Execution Control.
+* debugger commands, nexti: Debugger Execution Control.
(line 49)
-* debugger commands, ni (nexti): Dgawk Execution Control.
+* debugger commands, ni (nexti): Debugger Execution Control.
(line 49)
-* debugger commands, o (option): Dgawk Info. (line 56)
-* debugger commands, option: Dgawk Info. (line 56)
+* debugger commands, o (option): Debugger Info. (line 57)
+* debugger commands, option: Debugger Info. (line 57)
* debugger commands, p (print): Viewing And Changing Data.
(line 36)
* debugger commands, print: Viewing And Changing Data.
(line 36)
* debugger commands, printf: Viewing And Changing Data.
(line 54)
-* debugger commands, q (quit): Miscellaneous Dgawk Commands.
+* debugger commands, q (quit): Miscellaneous Debugger Commands.
(line 101)
-* debugger commands, quit: Miscellaneous Dgawk Commands.
+* debugger commands, quit: Miscellaneous Debugger Commands.
(line 101)
-* debugger commands, r (run): Dgawk Execution Control.
+* debugger commands, r (run): Debugger Execution Control.
(line 62)
-* debugger commands, return: Dgawk Execution Control.
+* debugger commands, return: Debugger Execution Control.
(line 54)
-* debugger commands, run: Dgawk Execution Control.
+* debugger commands, run: Debugger Execution Control.
(line 62)
-* debugger commands, s (step): Dgawk Execution Control.
+* debugger commands, s (step): Debugger Execution Control.
(line 68)
* debugger commands, set: Viewing And Changing Data.
(line 59)
-* debugger commands, si (stepi): Dgawk Execution Control.
+* debugger commands, si (stepi): Debugger Execution Control.
(line 76)
-* debugger commands, silent: Dgawk Execution Control.
+* debugger commands, silent: Debugger Execution Control.
(line 10)
-* debugger commands, step: Dgawk Execution Control.
+* debugger commands, step: Debugger Execution Control.
(line 68)
-* debugger commands, stepi: Dgawk Execution Control.
+* debugger commands, stepi: Debugger Execution Control.
(line 76)
-* debugger commands, t (tbreak): Breakpoint Control. (line 89)
-* debugger commands, tbreak: Breakpoint Control. (line 89)
-* debugger commands, trace: Miscellaneous Dgawk Commands.
+* debugger commands, t (tbreak): Breakpoint Control. (line 90)
+* debugger commands, tbreak: Breakpoint Control. (line 90)
+* debugger commands, trace: Miscellaneous Debugger Commands.
(line 110)
-* debugger commands, u (until): Dgawk Execution Control.
+* debugger commands, u (until): Debugger Execution Control.
(line 83)
* debugger commands, undisplay: Viewing And Changing Data.
(line 80)
-* debugger commands, until: Dgawk Execution Control.
+* debugger commands, until: Debugger Execution Control.
(line 83)
* debugger commands, unwatch: Viewing And Changing Data.
(line 84)
-* debugger commands, up: Dgawk Stack. (line 33)
+* debugger commands, up: Execution Stack. (line 33)
* debugger commands, w (watch): Viewing And Changing Data.
(line 67)
* debugger commands, watch: Viewing And Changing Data.
(line 67)
+* debugging awk programs: Debugger. (line 6)
* debugging gawk, bug reports: Bugs. (line 9)
-* decimal point character, locale specific: Options. (line 218)
+* decimal point character, locale specific: Options. (line 263)
* decrement operators: Increment Ops. (line 35)
* default keyword: Switch Statement. (line 6)
* Deifik, Scott <1>: Bugs. (line 70)
* Deifik, Scott <2>: Contributors. (line 54)
* Deifik, Scott: Acknowledgments. (line 60)
-* delete debugger command: Breakpoint Control. (line 63)
+* delete debugger command: Breakpoint Control. (line 64)
* delete statement: Delete. (line 6)
* deleting elements in arrays: Delete. (line 6)
* deleting entire arrays: Delete. (line 39)
-* dgawk: Debugger. (line 6)
* differences between gawk and awk: String Functions. (line 196)
* differences in awk and gawk, ARGC/ARGV variables: ARGC and ARGV.
(line 88)
* differences in awk and gawk, ARGIND variable: Auto-set. (line 40)
* differences in awk and gawk, array elements, deleting: Delete.
(line 39)
+* differences in awk and gawk, AWKLIBPATH environment variable: AWKLIBPATH Variable.
+ (line 6)
* differences in awk and gawk, AWKPATH environment variable: AWKPATH Variable.
(line 6)
* differences in awk and gawk, BEGIN/END patterns: I/O And BEGIN/END.
@@ -25644,11 +29924,12 @@ Index
(line 23)
* differences in awk and gawk, close() function: Close Files And Pipes.
(line 81)
-* differences in awk and gawk, ERRNO variable: Auto-set. (line 72)
+* differences in awk and gawk, ERRNO variable: Auto-set. (line 73)
* differences in awk and gawk, error messages: Special FD. (line 16)
* differences in awk and gawk, FIELDWIDTHS variable: User-modified.
(line 35)
* differences in awk and gawk, FPAT variable: User-modified. (line 45)
+* differences in awk and gawk, FUNCTAB variable: Auto-set. (line 119)
* differences in awk and gawk, function arguments (gawk): Calling Built-in.
(line 16)
* differences in awk and gawk, getline command: Getline. (line 19)
@@ -25673,14 +29954,14 @@ Index
(line 6)
* differences in awk and gawk, print/printf statements: Format Modifiers.
(line 13)
-* differences in awk and gawk, PROCINFO array: Auto-set. (line 123)
+* differences in awk and gawk, PROCINFO array: Auto-set. (line 130)
* differences in awk and gawk, record separators: Records. (line 117)
* differences in awk and gawk, regexp constants: Using Constant Regexps.
(line 43)
* differences in awk and gawk, regular expressions: Case-sensitivity.
(line 26)
* differences in awk and gawk, RS/RT variables: Records. (line 172)
-* differences in awk and gawk, RT variable: Auto-set. (line 196)
+* differences in awk and gawk, RT variable: Auto-set. (line 246)
* differences in awk and gawk, single-character fields: Single Character Fields.
(line 6)
* differences in awk and gawk, split() function: String Functions.
@@ -25689,16 +29970,17 @@ Index
* differences in awk and gawk, strings, storing: Records. (line 192)
* differences in awk and gawk, strtonum() function (gawk): String Functions.
(line 404)
+* differences in awk and gawk, SYMTAB variable: Auto-set. (line 254)
* differences in awk and gawk, TEXTDOMAIN variable: User-modified.
- (line 153)
+ (line 162)
* differences in awk and gawk, trunc-mod operation: Arithmetic Ops.
(line 66)
-* directories, changing: Sample Library. (line 6)
* directories, command line: Command line directories.
(line 6)
* directories, searching <1>: Igawk Program. (line 368)
+* directories, searching <2>: AWKLIBPATH Variable. (line 6)
* directories, searching: AWKPATH Variable. (line 6)
-* disable debugger command: Breakpoint Control. (line 68)
+* disable debugger command: Breakpoint Control. (line 69)
* display debugger command: Viewing And Changing Data.
(line 8)
* division: Arithmetic Ops. (line 44)
@@ -25712,18 +29994,17 @@ Index
* dollar sign ($), $ field operator: Fields. (line 19)
* dollar sign ($), incrementing fields and arrays: Increment Ops.
(line 30)
-* double precision floating-point: Basic Data Typing. (line 36)
+* double precision floating-point: General Arithmetic. (line 21)
* double quote (") <1>: Quoting. (line 37)
* double quote ("): Read Terminal. (line 25)
* double quote ("), regexp constants: Computed Regexps. (line 28)
-* down debugger command: Dgawk Stack. (line 21)
+* down debugger command: Execution Stack. (line 21)
* Drepper, Ulrich: Acknowledgments. (line 52)
* DuBois, John: Acknowledgments. (line 60)
-* dump debugger command: Miscellaneous Dgawk Commands.
+* dump debugger command: Miscellaneous Debugger Commands.
(line 9)
-* dupnode() internal function: Internals. (line 96)
* dupword.awk program: Dupword Program. (line 31)
-* e debugger command (alias for enable): Breakpoint Control. (line 72)
+* e debugger command (alias for enable): Breakpoint Control. (line 73)
* EBCDIC: Ordinal Functions. (line 45)
* egrep utility <1>: Egrep Program. (line 6)
* egrep utility: Bracket Expressions. (line 24)
@@ -25739,9 +30020,10 @@ Index
* empty pattern: Empty. (line 6)
* empty strings, See null strings: Regexp Field Splitting.
(line 43)
-* enable debugger command: Breakpoint Control. (line 72)
-* end debugger command: Dgawk Execution Control.
+* enable debugger command: Breakpoint Control. (line 73)
+* end debugger command: Debugger Execution Control.
(line 10)
+* END pattern <1>: Profiling. (line 62)
* END pattern: BEGIN/END. (line 6)
* END pattern, assert() user-defined function and: Assert Function.
(line 75)
@@ -25753,7 +30035,6 @@ Index
* END pattern, next/nextfile statements and: I/O And BEGIN/END.
(line 37)
* END pattern, operators and: Using BEGIN/END. (line 17)
-* END pattern, pgawk program: Profiling. (line 65)
* END pattern, print statement and: I/O And BEGIN/END. (line 16)
* ENDFILE pattern: BEGINFILE/ENDFILE. (line 6)
* ENDFILE pattern, Boolean patterns and: Expression Patterns. (line 73)
@@ -25762,24 +30043,22 @@ 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: Auto-set. (line 60)
* environment variables: Auto-set. (line 60)
-* epoch, definition of: Glossary. (line 239)
+* epoch, definition of: Glossary. (line 243)
* equals sign (=), = operator: Assignment Ops. (line 6)
* equals sign (=), == operator <1>: Precedence. (line 65)
* equals sign (=), == operator: Comparison Operators.
(line 11)
* EREs (Extended Regular Expressions): Bracket Expressions. (line 24)
-* ERRNO variable <1>: Internals. (line 139)
-* ERRNO variable <2>: TCP/IP Networking. (line 54)
-* ERRNO variable <3>: Auto-set. (line 72)
-* ERRNO variable <4>: BEGINFILE/ENDFILE. (line 26)
-* ERRNO variable <5>: Close Files And Pipes.
+* ERRNO variable <1>: TCP/IP Networking. (line 54)
+* ERRNO variable <2>: Auto-set. (line 73)
+* ERRNO variable <3>: BEGINFILE/ENDFILE. (line 26)
+* ERRNO variable <4>: Close Files And Pipes.
(line 139)
* ERRNO variable: Getline. (line 19)
* error handling: Special FD. (line 16)
-* error handling, ERRNO variable and: Auto-set. (line 72)
+* error handling, ERRNO variable and: Auto-set. (line 73)
* error output: Special FD. (line 6)
* escape processing, gsub()/gensub()/sub() functions: Gory Details.
(line 6)
@@ -25820,9 +30099,6 @@ Index
(line 9)
* expressions, selecting: Conditional Exp. (line 6)
* Extended Regular Expressions (EREs): Bracket Expressions. (line 24)
-* eXtensible Markup Language (XML): Internals. (line 160)
-* extension() function (gawk): Using Internal File Ops.
- (line 15)
* extensions, Brian Kernighan's awk <1>: Other Versions. (line 13)
* extensions, Brian Kernighan's awk: BTL. (line 6)
* extensions, common, ** operator: Arithmetic Ops. (line 36)
@@ -25845,7 +30121,7 @@ Index
* extract.awk program: Extract Program. (line 78)
* extraction, of marked strings (internationalization): String Extraction.
(line 6)
-* f debugger command (alias for frame): Dgawk Stack. (line 25)
+* f debugger command (alias for frame): Execution Stack. (line 25)
* false, logical: Truth Values. (line 6)
* FDL (Free Documentation License): GNU Free Documentation License.
(line 6)
@@ -25875,7 +30151,7 @@ Index
* field separators, regular expressions as: Field Separators. (line 50)
* field separators, See Also OFS: Changing Fields. (line 64)
* field separators, spaces as: Cut Program. (line 109)
-* fields <1>: Basic High Level. (line 71)
+* fields <1>: Basic High Level. (line 73)
* fields <2>: Fields. (line 6)
* fields: Reading Files. (line 14)
* fields, adding: Changing Fields. (line 53)
@@ -25894,7 +30170,7 @@ Index
* file names, distinguishing: Auto-set. (line 52)
* file names, in compatibility mode: Special Caveats. (line 9)
* file names, standard streams in gawk: Special FD. (line 46)
-* FILENAME variable <1>: Auto-set. (line 92)
+* FILENAME variable <1>: Auto-set. (line 93)
* FILENAME variable: Reading Files. (line 6)
* FILENAME variable, getline, setting with: Getline Notes. (line 19)
* filenames, assignments as: Ignoring Assigns. (line 6)
@@ -25912,12 +30188,11 @@ Index
* files, /inet6/... (gawk): TCP/IP Networking. (line 6)
* files, as single records: Records. (line 201)
* files, awk programs in: Long. (line 6)
-* files, awkprof.out: Profiling. (line 10)
-* files, awkvars.out: Options. (line 93)
+* files, awkprof.out: Profiling. (line 6)
+* files, awkvars.out: Options. (line 107)
* files, closing: I/O Functions. (line 10)
* files, descriptors, See file descriptors: Special FD. (line 6)
* files, group: Group Functions. (line 6)
-* files, information about, retrieving: Sample Library. (line 6)
* files, initialization and cleanup: Filetrans Function. (line 6)
* files, input, See input files: Read Terminal. (line 17)
* files, log, timestamps in: Time Functions. (line 6)
@@ -25941,7 +30216,7 @@ Index
* files, portable object template: Explaining gettext. (line 30)
* files, portable object, converting to message object files: I18N Example.
(line 62)
-* files, portable object, generating: Options. (line 138)
+* files, portable object, generating: Options. (line 161)
* files, processing, ARGIND variable and: Auto-set. (line 47)
* files, reading: Rewind Function. (line 6)
* files, reading, multiline records: Multiple Line. (line 6)
@@ -25950,23 +30225,21 @@ Index
* files, source, search path for: Igawk Program. (line 368)
* files, splitting: Split Program. (line 6)
* files, Texinfo, extracting programs from: Extract Program. (line 6)
-* finish debugger command: Dgawk Execution Control.
+* finish debugger command: Debugger Execution Control.
(line 39)
* Fish, Fred: Contributors. (line 51)
* fixed-width data: Constant Size. (line 9)
* flag variables <1>: Tee Program. (line 20)
* flag variables: Boolean Ops. (line 67)
+* floating-point numbers, arbitrary precision: Arbitrary Precision Arithmetic.
+ (line 6)
* floating-point, numbers <1>: Unexpected Results. (line 6)
-* floating-point, numbers: Basic Data Typing. (line 21)
-* floating-point, numbers, AWKNUM internal type: Internals. (line 19)
-* FNR variable <1>: Auto-set. (line 102)
+* floating-point, numbers: General Arithmetic. (line 6)
+* FNR variable <1>: Auto-set. (line 103)
* FNR variable: Records. (line 6)
-* FNR variable, changing: Auto-set. (line 207)
+* FNR variable, changing: Auto-set. (line 295)
* for statement: For Statement. (line 6)
* for statement, in arrays: Scanning an Array. (line 20)
-* force_number() internal function: Internals. (line 27)
-* force_string() internal function: Internals. (line 32)
-* force_wstring() internal function: Internals. (line 37)
* format specifiers, mixing regular with positional specifiers: Printf Ordering.
(line 57)
* format specifiers, printf statement: Control Letters. (line 6)
@@ -25985,28 +30258,29 @@ Index
* FPAT variable <1>: User-modified. (line 45)
* FPAT variable: Splitting By Content.
(line 26)
-* frame debugger command: Dgawk Stack. (line 25)
+* frame debugger command: Execution Stack. (line 25)
* Free Documentation License (FDL): GNU Free Documentation License.
(line 6)
-* Free Software Foundation (FSF) <1>: Glossary. (line 301)
+* Free Software Foundation (FSF) <1>: Glossary. (line 305)
* Free Software Foundation (FSF) <2>: Getting. (line 10)
* Free Software Foundation (FSF): Manual History. (line 6)
-* FreeBSD: Glossary. (line 615)
+* FreeBSD: Glossary. (line 619)
* FS variable <1>: User-modified. (line 56)
* FS variable: Field Separators. (line 14)
* FS variable, --field-separator option and: Options. (line 21)
* FS variable, as null string: Single Character Fields.
(line 20)
-* FS variable, as TAB character: Options. (line 214)
+* FS variable, as TAB character: Options. (line 259)
* FS variable, changing value of: Field Separators. (line 34)
* FS variable, running awk programs and: Cut Program. (line 68)
* FS variable, setting from command line: Command Line Field Separator.
(line 6)
* FS, containing ^: Regexp Field Splitting.
(line 59)
-* FSF (Free Software Foundation) <1>: Glossary. (line 301)
+* FSF (Free Software Foundation) <1>: Glossary. (line 305)
* FSF (Free Software Foundation) <2>: Getting. (line 10)
* FSF (Free Software Foundation): Manual History. (line 6)
+* FUNCTAB array: Auto-set. (line 119)
* function calls: Function Calls. (line 6)
* function calls, indirect: Indirect Calls. (line 6)
* function pointers: Indirect Calls. (line 6)
@@ -26014,7 +30288,6 @@ Index
(line 47)
* functions, built-in <1>: Functions. (line 6)
* functions, built-in: Function Calls. (line 10)
-* functions, built-in, adding to gawk: Dynamic Extensions. (line 10)
* functions, built-in, evaluation order: Calling Built-in. (line 30)
* functions, defining: Definition Syntax. (line 6)
* functions, library: Library Functions. (line 6)
@@ -26032,7 +30305,7 @@ Index
(line 6)
* functions, library, managing data files: Data File Management.
(line 6)
-* functions, library, managing time: Gettimeofday Function.
+* functions, library, managing time: Getlocaltime Function.
(line 6)
* functions, library, merging arrays into strings: Join Function.
(line 6)
@@ -26042,20 +30315,20 @@ 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, string-translation: I18N Functions. (line 6)
* functions, undefined: Pass By Value/Reference.
(line 71)
* functions, user-defined: User-defined. (line 6)
* functions, user-defined, calling: Calling A Function. (line 6)
-* functions, user-defined, counts: Profiling. (line 132)
+* functions, user-defined, counts: Profiling. (line 129)
* functions, user-defined, library of: Library Functions. (line 6)
* functions, user-defined, next/nextfile statements and <1>: Nextfile Statement.
(line 47)
* functions, user-defined, next/nextfile statements and: Next Statement.
(line 45)
-* G-d: Acknowledgments. (line 81)
+* G-d: Acknowledgments. (line 83)
* Garfinkle, Scott: Contributors. (line 35)
+* gawk program, dynamic profiling: Profiling. (line 171)
* gawk, ARGIND variable in: Other Arguments. (line 12)
* gawk, awk and <1>: This Manual. (line 14)
* gawk, awk and: Preface. (line 23)
@@ -26076,13 +30349,13 @@ Index
* gawk, distribution: Distribution contents.
(line 6)
* gawk, ERRNO variable in <1>: TCP/IP Networking. (line 54)
-* gawk, ERRNO variable in <2>: Auto-set. (line 72)
+* gawk, ERRNO variable in <2>: Auto-set. (line 73)
* gawk, ERRNO variable in <3>: BEGINFILE/ENDFILE. (line 26)
* gawk, ERRNO variable in <4>: Close Files And Pipes.
(line 139)
* gawk, ERRNO variable in: Getline. (line 19)
* gawk, escape sequences: Escape Sequences. (line 125)
-* gawk, extensions, disabling: Options. (line 202)
+* gawk, extensions, disabling: Options. (line 247)
* gawk, features, adding: Adding Code. (line 6)
* gawk, features, advanced: Advanced Features. (line 6)
* gawk, fflush() function in: I/O Functions. (line 44)
@@ -26094,8 +30367,8 @@ Index
* gawk, FPAT variable in <1>: User-modified. (line 45)
* gawk, FPAT variable in: Splitting By Content.
(line 26)
+* gawk, FUNCTAB array in: Auto-set. (line 119)
* gawk, function arguments and: Calling Built-in. (line 16)
-* gawk, functions, adding: Dynamic Extensions. (line 10)
* gawk, hexadecimal numbers and: Nondecimal-numbers. (line 42)
* gawk, IGNORECASE variable in <1>: Array Sorting Functions.
(line 81)
@@ -26110,7 +30383,6 @@ Index
* gawk, implementation issues, limits: Getline Notes. (line 14)
* gawk, implementation issues, pipes: Redirection. (line 135)
* gawk, installing: Installation. (line 6)
-* gawk, internals: Internals. (line 6)
* gawk, internationalization and, See internationalization: Internationalization.
(line 13)
* gawk, interpreter, adding code to: Using Internal File Ops.
@@ -26126,7 +30398,7 @@ Index
* gawk, OS/2 version of: PC Using. (line 11)
* gawk, PROCINFO array in <1>: Two-way I/O. (line 116)
* gawk, PROCINFO array in <2>: Time Functions. (line 46)
-* gawk, PROCINFO array in: Auto-set. (line 123)
+* gawk, PROCINFO array in: Auto-set. (line 130)
* gawk, regexp constants and: Using Constant Regexps.
(line 28)
* gawk, regular expressions, case sensitivity: Case-sensitivity.
@@ -26134,7 +30406,7 @@ 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 196)
+* gawk, RT variable in <1>: Auto-set. (line 246)
* gawk, RT variable in <2>: Getline/Variable/File.
(line 10)
* gawk, RT variable in <3>: Multiple Line. (line 129)
@@ -26143,25 +30415,20 @@ Index
* gawk, source code, obtaining: Getting. (line 6)
* gawk, splitting fields and: Constant Size. (line 87)
* gawk, string-translation functions: I18N Functions. (line 6)
-* gawk, TEXTDOMAIN variable in: User-modified. (line 153)
+* gawk, SYMTAB array in: Auto-set. (line 254)
+* gawk, TEXTDOMAIN variable in: User-modified. (line 162)
* gawk, timestamps: Time Functions. (line 6)
* gawk, uses for: Preface. (line 36)
-* gawk, versions of, information about, printing: Options. (line 253)
+* gawk, versions of, information about, printing: Options. (line 293)
* gawk, VMS version of: VMS Installation. (line 6)
* gawk, word-boundary operator: GNU Regexp Operators.
(line 63)
-* General Public License (GPL): Glossary. (line 310)
+* General Public License (GPL): Glossary. (line 314)
* General Public License, See GPL: Manual History. (line 11)
* gensub() function (gawk) <1>: String Functions. (line 86)
* 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)
* 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)
@@ -26186,6 +30453,8 @@ Index
* getline command, variants: Getline Summary. (line 6)
* getline statement, BEGINFILE/ENDFILE patterns and: BEGINFILE/ENDFILE.
(line 54)
+* getlocaltime() user-defined function: Getlocaltime Function.
+ (line 16)
* getopt() function (C library): Getopt Function. (line 15)
* getopt() user-defined function: Getopt Function. (line 108)
* getpwent() function (C library): Passwd Functions. (line 16)
@@ -26197,25 +30466,27 @@ Index
* gettext library: Explaining gettext. (line 6)
* gettext library, locale categories: Explaining gettext. (line 80)
* gettext() function (C library): Explaining gettext. (line 62)
-* gettimeofday() user-defined function: Gettimeofday Function.
- (line 16)
+* gettimeofday time extension function: Extension Sample Time.
+ (line 10)
+* GMP: Arbitrary Precision Arithmetic.
+ (line 6)
* GNITS mailing list: Acknowledgments. (line 52)
* GNU awk, See gawk: Preface. (line 49)
* GNU Free Documentation License: GNU Free Documentation License.
(line 6)
-* GNU General Public License: Glossary. (line 310)
-* GNU Lesser General Public License: Glossary. (line 401)
+* GNU General Public License: Glossary. (line 314)
+* GNU Lesser General Public License: Glossary. (line 405)
* GNU long options <1>: Options. (line 6)
* GNU long options: Command Line. (line 13)
-* GNU long options, printing list of: Options. (line 145)
-* GNU Project <1>: Glossary. (line 319)
+* GNU long options, printing list of: Options. (line 168)
+* GNU Project <1>: Glossary. (line 323)
* GNU Project: Manual History. (line 11)
-* GNU/Linux <1>: Glossary. (line 615)
+* GNU/Linux <1>: Glossary. (line 619)
* GNU/Linux <2>: I18N Example. (line 55)
* GNU/Linux: Manual History. (line 28)
-* GPL (General Public License) <1>: Glossary. (line 310)
+* GPL (General Public License) <1>: Glossary. (line 314)
* GPL (General Public License): Manual History. (line 11)
-* GPL (General Public License), printing: Options. (line 88)
+* GPL (General Public License), printing: Options. (line 102)
* grcat program: Group Functions. (line 16)
* Grigera, Juan: Contributors. (line 58)
* group database, reading: Group Functions. (line 6)
@@ -26226,7 +30497,7 @@ Index
(line 43)
* gsub() function, arguments of: String Functions. (line 462)
* gsub() function, escape processing: Gory Details. (line 6)
-* h debugger command (alias for help): Miscellaneous Dgawk Commands.
+* h debugger command (alias for help): Miscellaneous Debugger Commands.
(line 68)
* Hankerson, Darrel <1>: Contributors. (line 61)
* Hankerson, Darrel: Acknowledgments. (line 60)
@@ -26235,28 +30506,30 @@ Index
* Hartholz, Elaine: Acknowledgments. (line 38)
* Hartholz, Marshall: Acknowledgments. (line 38)
* Hasegawa, Isamu: Contributors. (line 94)
-* help debugger command: Miscellaneous Dgawk Commands.
+* help debugger command: Miscellaneous Debugger Commands.
(line 68)
* hexadecimal numbers: Nondecimal-numbers. (line 6)
-* hexadecimal values, enabling interpretation of: Options. (line 169)
+* hexadecimal values, enabling interpretation of: Options. (line 207)
* histsort.awk program: History Sorting. (line 25)
* Hughes, Phil: Acknowledgments. (line 43)
-* HUP signal: Profiling. (line 204)
+* HUP signal: Profiling. (line 203)
* hyphen (-), - operator: Precedence. (line 52)
* hyphen (-), -- (decrement/increment) operators: Precedence. (line 46)
* hyphen (-), -- operator: Increment Ops. (line 48)
* hyphen (-), -= operator <1>: Precedence. (line 95)
* hyphen (-), -= operator: Assignment Ops. (line 129)
-* hyphen (-), filenames beginning with: Options. (line 59)
+* hyphen (-), filenames beginning with: Options. (line 73)
* hyphen (-), in bracket expressions: Bracket Expressions. (line 17)
-* i debugger command (alias for info): Dgawk Info. (line 12)
+* i debugger command (alias for info): Debugger Info. (line 13)
* id utility: Id Program. (line 6)
* id.awk program: Id Program. (line 30)
+* IEEE-754 format: Floating-point Representation.
+ (line 6)
* if statement <1>: If Statement. (line 6)
* if statement: Regexp Usage. (line 19)
* if statement, actions, changing: Ranges. (line 25)
* igawk.sh program: Igawk Program. (line 124)
-* ignore debugger command: Breakpoint Control. (line 86)
+* ignore debugger command: Breakpoint Control. (line 87)
* IGNORECASE variable <1>: Array Sorting Functions.
(line 81)
* IGNORECASE variable <2>: String Functions. (line 29)
@@ -26284,7 +30557,9 @@ Index
* index() function: String Functions. (line 155)
* indexing arrays: Array Intro. (line 50)
* indirect function calls: Indirect Calls. (line 6)
-* info debugger command: Dgawk Info. (line 12)
+* infinite precision: Arbitrary Precision Arithmetic.
+ (line 6)
+* info debugger command: Debugger Info. (line 13)
* initialization, automatic: More Complex. (line 38)
* input files: Reading Files. (line 6)
* input files, closing: Close Files And Pipes.
@@ -26309,47 +30584,18 @@ Index
* insomnia, cure for: Alarm Program. (line 6)
* installation, VMS: VMS Installation. (line 6)
* installing gawk: Installation. (line 6)
-* INT signal (MS-Windows): Profiling. (line 207)
+* INT signal (MS-Windows): Profiling. (line 206)
* int() function: Numeric Functions. (line 23)
-* integers: Basic Data Typing. (line 21)
-* integers, unsigned: Basic Data Typing. (line 30)
+* integer, arbitrary precision: Arbitrary Precision Integers.
+ (line 6)
+* integers: General Arithmetic. (line 6)
+* integers, unsigned: General Arithmetic. (line 15)
* 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 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 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)
* internationalization <1>: I18N and L10N. (line 6)
* internationalization: I18N Functions. (line 6)
* internationalization, localization <1>: Internationalization.
(line 13)
-* internationalization, localization: User-modified. (line 153)
+* internationalization, localization: User-modified. (line 162)
* internationalization, localization, character classes: Bracket Expressions.
(line 90)
* internationalization, localization, gawk and: Internationalization.
@@ -26361,44 +30607,44 @@ Index
* internationalization, localization, portability and: I18N Portability.
(line 6)
* internationalizing a program: Explaining gettext. (line 6)
-* interpreted programs <1>: Glossary. (line 361)
-* interpreted programs: Basic High Level. (line 14)
+* interpreted programs <1>: Glossary. (line 365)
+* interpreted programs: Basic High Level. (line 15)
* interval expressions: Regexp Operators. (line 116)
-* INVALID_HANDLE internal constant: Internals. (line 160)
* inventory-shipped file: Sample Data Files. (line 32)
-* IOBUF internal structure: Internals. (line 160)
-* iop_alloc() internal function: Internals. (line 160)
* isarray() function (gawk): Type Functions. (line 11)
-* ISO: Glossary. (line 372)
+* ISO: Glossary. (line 376)
* ISO 8859-1: Glossary. (line 141)
* ISO Latin-1: Glossary. (line 141)
* Jacobs, Andrew: Passwd Functions. (line 90)
* Jaegermann, Michal <1>: Contributors. (line 46)
* Jaegermann, Michal: Acknowledgments. (line 60)
-* Java implementation of awk: Other Versions. (line 96)
-* Java programming language: Glossary. (line 384)
-* jawk: Other Versions. (line 96)
+* Java implementation of awk: Other Versions. (line 97)
+* Java programming language: Glossary. (line 388)
+* jawk: Other Versions. (line 97)
* Jedi knights: Undocumented. (line 6)
* join() user-defined function: Join Function. (line 18)
* Kahrs, Ju"rgen <1>: Contributors. (line 70)
* Kahrs, Ju"rgen: Acknowledgments. (line 60)
* Kasal, Stepan: Acknowledgments. (line 60)
* Kenobi, Obi-Wan: Undocumented. (line 6)
-* Kernighan, Brian <1>: Basic Data Typing. (line 74)
+* Kernighan, Brian <1>: Basic Data Typing. (line 55)
* Kernighan, Brian <2>: Other Versions. (line 13)
* Kernighan, Brian <3>: Contributors. (line 12)
* Kernighan, Brian <4>: BTL. (line 6)
* Kernighan, Brian <5>: Concatenation. (line 6)
-* Kernighan, Brian <6>: Acknowledgments. (line 75)
+* Kernighan, Brian <6>: Acknowledgments. (line 77)
* Kernighan, Brian <7>: Conventions. (line 34)
* Kernighan, Brian: History. (line 17)
-* kill command, dynamic profiling: Profiling. (line 182)
+* kill command, dynamic profiling: Profiling. (line 180)
* Knights, jedi: Undocumented. (line 6)
+* Knuth, Donald: Arbitrary Precision Arithmetic.
+ (line 6)
* Kwok, Conrad: Contributors. (line 35)
-* l debugger command (alias for list): Miscellaneous Dgawk Commands.
+* l debugger command (alias for list): Miscellaneous Debugger Commands.
(line 74)
* labels.awk program: Labels Program. (line 51)
-* languages, data-driven: Basic High Level. (line 83)
+* languages, data-driven: Basic High Level. (line 85)
+* Laurie, Dirk: Changing Precision. (line 6)
* LC_ALL locale category: Explaining gettext. (line 120)
* LC_COLLATE locale category: Explaining gettext. (line 93)
* LC_CTYPE locale category: Explaining gettext. (line 97)
@@ -26419,9 +30665,9 @@ Index
* left shift, bitwise: Bitwise Functions. (line 32)
* leftmost longest match: Multiple Line. (line 26)
* length() function: String Functions. (line 166)
-* Lesser General Public License (LGPL): Glossary. (line 401)
-* LGPL (Lesser General Public License): Glossary. (line 401)
-* libmawk: Other Versions. (line 104)
+* Lesser General Public License (LGPL): Glossary. (line 405)
+* LGPL (Lesser General Public License): Glossary. (line 405)
+* libmawk: Other Versions. (line 105)
* libraries of awk functions: Library Functions. (line 6)
* libraries of awk functions, assertions: Assert Function. (line 6)
* libraries of awk functions, associative arrays and: Library Names.
@@ -26436,7 +30682,7 @@ Index
(line 6)
* libraries of awk functions, managing, data files: Data File Management.
(line 6)
-* libraries of awk functions, managing, time: Gettimeofday Function.
+* libraries of awk functions, managing, time: Getlocaltime Function.
(line 6)
* libraries of awk functions, merging arrays into strings: Join Function.
(line 6)
@@ -26459,20 +30705,21 @@ Index
* lint checking, array subscripts: Uninitialized Subscripts.
(line 43)
* lint checking, empty programs: Command Line. (line 16)
-* lint checking, issuing warnings: Options. (line 150)
+* lint checking, issuing warnings: Options. (line 182)
* lint checking, POSIXLY_CORRECT environment variable: Options.
- (line 292)
+ (line 332)
* lint checking, undefined functions: Pass By Value/Reference.
(line 88)
* LINT variable: User-modified. (line 98)
-* Linux <1>: Glossary. (line 615)
+* Linux <1>: Glossary. (line 619)
* Linux <2>: I18N Example. (line 55)
* Linux: Manual History. (line 28)
-* list debugger command: Miscellaneous Dgawk Commands.
+* list debugger command: Miscellaneous Debugger Commands.
(line 74)
+* loading, library: Options. (line 173)
* local variables: Variable Scope. (line 6)
* locale categories: Explaining gettext. (line 80)
-* locale decimal point character: Options. (line 218)
+* locale decimal point character: Options. (line 263)
* locale, definition of: Locales. (line 6)
* localization: I18N and L10N. (line 6)
* localization, See internationalization, localization: I18N and L10N.
@@ -26485,18 +30732,14 @@ Index
* long options: Command Line. (line 13)
* loops: While Statement. (line 6)
* loops, continue statements and: For Statement. (line 64)
-* loops, count for header: Profiling. (line 126)
+* loops, count for header: Profiling. (line 123)
* loops, exiting: Break Statement. (line 6)
* loops, See Also while statement: While Statement. (line 6)
-* Lost In Space: Dynamic Extensions. (line 6)
* ls utility: More Complex. (line 15)
-* lshift() function (gawk): Bitwise Functions. (line 45)
+* lshift() function (gawk): Bitwise Functions. (line 46)
* 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)
* mark parity: Ordinal Functions. (line 45)
* marked string extraction (internationalization): String Extraction.
(line 6)
@@ -26508,10 +30751,9 @@ Index
* matching, expressions, See comparison expressions: Typing and Comparison.
(line 9)
* matching, leftmost longest: Multiple Line. (line 26)
-* matching, null strings: Gory Details. (line 164)
+* matching, null strings: Gory Details. (line 165)
* mawk program: Other Versions. (line 35)
* McPhee, Patrick: Contributors. (line 100)
-* memory, releasing: Internals. (line 101)
* message object files: Explaining gettext. (line 41)
* message object files, converting from portable object files: I18N Example.
(line 62)
@@ -26523,8 +30765,12 @@ Index
* mktime() function (gawk): Time Functions. (line 24)
* modifiers, in format specifiers: Format Modifiers. (line 6)
* monetary information, localization: Explaining gettext. (line 103)
+* MPFR: Arbitrary Precision Arithmetic.
+ (line 6)
* msgfmt utility: I18N Example. (line 62)
-* n debugger command (alias for next): Dgawk Execution Control.
+* multiple precision: Arbitrary Precision Arithmetic.
+ (line 6)
+* n debugger command (alias for next): Debugger Execution Control.
(line 43)
* names, arrays/variables <1>: Library Names. (line 6)
* names, arrays/variables: Arrays. (line 18)
@@ -26533,14 +30779,13 @@ 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)
* nawk utility: Names. (line 17)
-* negative zero: Unexpected Results. (line 28)
-* NetBSD: Glossary. (line 615)
+* negative zero: Unexpected Results. (line 34)
+* NetBSD: Glossary. (line 619)
* networks, programming: TCP/IP Networking. (line 6)
* networks, support for: Special Network. (line 6)
* newlines <1>: Boolean Ops. (line 67)
-* newlines <2>: Options. (line 208)
+* newlines <2>: Options. (line 253)
* newlines: Statements/Lines. (line 6)
* newlines, as field separators: Default Field Splitting.
(line 6)
@@ -26551,7 +30796,7 @@ Index
* newlines, separating statements in actions <1>: Statements. (line 10)
* newlines, separating statements in actions: Action Overview.
(line 19)
-* next debugger command: Dgawk Execution Control.
+* next debugger command: Debugger Execution Control.
(line 43)
* next statement <1>: Next Statement. (line 6)
* next statement: Boolean Ops. (line 85)
@@ -26566,21 +30811,19 @@ Index
(line 26)
* nextfile statement, user-defined functions and: Nextfile Statement.
(line 47)
-* nexti debugger command: Dgawk Execution Control.
+* nexti debugger command: Debugger Execution Control.
(line 49)
-* NF variable <1>: Auto-set. (line 107)
+* NF variable <1>: Auto-set. (line 108)
* NF variable: Fields. (line 33)
* NF variable, decrementing: Changing Fields. (line 107)
-* ni debugger command (alias for nexti): Dgawk Execution Control.
+* ni debugger command (alias for nexti): Debugger Execution Control.
(line 49)
* noassign.awk program: Ignoring Assigns. (line 15)
-* NODE internal type: Internals. (line 23)
-* nodes, duplicating: Internals. (line 96)
* not Boolean-logic operator: Boolean Ops. (line 6)
-* NR variable <1>: Auto-set. (line 118)
+* NR variable <1>: Auto-set. (line 125)
* NR variable: Records. (line 6)
-* NR variable, changing: Auto-set. (line 207)
-* null strings <1>: Basic Data Typing. (line 50)
+* NR variable, changing: Auto-set. (line 295)
+* null strings <1>: Basic Data Typing. (line 26)
* null strings <2>: Truth Values. (line 6)
* null strings <3>: Regexp Field Splitting.
(line 43)
@@ -26589,38 +30832,34 @@ Index
* null strings, as array subscripts: Uninitialized Subscripts.
(line 43)
* null strings, converting numbers to strings: Conversion. (line 21)
-* null strings, matching: Gory Details. (line 164)
+* null strings, matching: Gory Details. (line 165)
* null strings, quoting and: Quoting. (line 62)
* number sign (#), #! (executable scripts): Executable Scripts.
(line 6)
* number sign (#), #! (executable scripts), portability issues with: Executable Scripts.
(line 6)
* number sign (#), commenting: Comments. (line 6)
-* numbers: Internals. (line 91)
* numbers, as array subscripts: Numeric Array Subscripts.
(line 6)
* numbers, as values of characters: Ordinal Functions. (line 6)
* numbers, Cliff random: Cliff Random Function.
(line 6)
-* numbers, converting <1>: Bitwise Functions. (line 107)
+* numbers, converting <1>: Bitwise Functions. (line 109)
* numbers, converting: Conversion. (line 6)
* numbers, converting, to strings: User-modified. (line 28)
-* numbers, floating-point: Basic Data Typing. (line 21)
-* numbers, floating-point, AWKNUM internal type: Internals. (line 19)
+* numbers, floating-point: General Arithmetic. (line 6)
* numbers, hexadecimal: Nondecimal-numbers. (line 6)
-* numbers, NODE internal type: Internals. (line 23)
* numbers, octal: Nondecimal-numbers. (line 6)
* numbers, random: Numeric Functions. (line 64)
* numbers, rounding: Round Function. (line 6)
* numeric, constants: Scalar Constants. (line 6)
* numeric, output format: OFMT. (line 6)
* numeric, strings: Variable Typing. (line 6)
-* numeric, values: Internals. (line 27)
-* o debugger command (alias for option): Dgawk Info. (line 56)
+* o debugger command (alias for option): Debugger Info. (line 57)
* oawk utility: Names. (line 17)
* obsolete features: Obsolete. (line 6)
* octal numbers: Nondecimal-numbers. (line 6)
-* octal values, enabling interpretation of: Options. (line 169)
+* octal values, enabling interpretation of: Options. (line 207)
* OFMT variable <1>: User-modified. (line 115)
* OFMT variable <2>: Conversion. (line 55)
* OFMT variable: OFMT. (line 15)
@@ -26628,8 +30867,8 @@ Index
* OFS variable <1>: User-modified. (line 124)
* OFS variable <2>: Output Separators. (line 6)
* OFS variable: Changing Fields. (line 64)
-* OpenBSD: Glossary. (line 615)
-* OpenSolaris: Other Versions. (line 86)
+* OpenBSD: Glossary. (line 619)
+* OpenSolaris: Other Versions. (line 87)
* operating systems, BSD-based: Manual History. (line 28)
* operating systems, PC, gawk on: PC Using. (line 6)
* operating systems, PC, gawk on, installing: PC Installation.
@@ -26662,21 +30901,21 @@ Index
(line 48)
* operators, word-boundary (gawk): GNU Regexp Operators.
(line 63)
-* option debugger command: Dgawk Info. (line 56)
+* option debugger command: Debugger Info. (line 57)
* options, command-line <1>: Command Line Field Separator.
(line 6)
* options, command-line <2>: Options. (line 6)
* options, command-line: Long. (line 12)
-* options, command-line, end of: Options. (line 54)
+* options, command-line, end of: Options. (line 68)
* options, command-line, invoking awk: Command Line. (line 6)
* options, command-line, processing: Getopt Function. (line 6)
* options, deprecated: Obsolete. (line 6)
* options, long <1>: Options. (line 6)
* options, long: Command Line. (line 13)
-* options, printing list of: Options. (line 145)
+* options, printing list of: Options. (line 168)
* OR bitwise operation: Bitwise Functions. (line 6)
* or Boolean-logic operator: Boolean Ops. (line 6)
-* or() function (gawk): Bitwise Functions. (line 48)
+* or() function (gawk): Bitwise Functions. (line 49)
* ord() user-defined function: Ordinal Functions. (line 16)
* order of evaluation, concatenation: Concatenation. (line 42)
* ORS variable <1>: User-modified. (line 129)
@@ -26697,17 +30936,16 @@ Index
* output, standard: Special FD. (line 6)
* p debugger command (alias for print): Viewing And Changing Data.
(line 36)
-* P1003.1 POSIX standard: Glossary. (line 458)
-* P1003.2 POSIX standard: Glossary. (line 458)
-* parameters, number of: Internals. (line 49)
+* P1003.1 POSIX standard: Glossary. (line 462)
+* P1003.2 POSIX standard: Glossary. (line 462)
+* parentheses () <1>: Profiling. (line 138)
* parentheses (): Regexp Operators. (line 79)
-* parentheses (), pgawk program: Profiling. (line 141)
* password file: Passwd Functions. (line 16)
* patsplit() function: String Functions. (line 293)
* patterns: Patterns and Actions.
(line 6)
* patterns, comparison expressions as: Expression Patterns. (line 14)
-* patterns, counts: Profiling. (line 113)
+* patterns, counts: Profiling. (line 110)
* patterns, default: Very Simple. (line 34)
* patterns, empty: Empty. (line 6)
* patterns, expressions as: Regexp Patterns. (line 6)
@@ -26725,9 +30963,6 @@ Index
* Perl: Future Extensions. (line 6)
* Peters, Arno: Contributors. (line 85)
* Peterson, Hal: Contributors. (line 40)
-* pgawk program: Profiling. (line 6)
-* pgawk program, awkprof.out file: Profiling. (line 10)
-* pgawk program, dynamic profiling: Profiling. (line 174)
* pipes, closing: Close Files And Pipes.
(line 6)
* pipes, input: Getline/Pipe. (line 6)
@@ -26768,13 +31003,13 @@ Index
* portability, NF variable, decrementing: Changing Fields. (line 115)
* portability, operators: Increment Ops. (line 61)
* portability, operators, not in POSIX awk: Precedence. (line 98)
-* portability, POSIXLY_CORRECT environment variable: Options. (line 313)
+* portability, POSIXLY_CORRECT environment variable: Options. (line 353)
* portability, substr() function: String Functions. (line 512)
* portable object files <1>: Translator i18n. (line 6)
* portable object files: Explaining gettext. (line 36)
* portable object files, converting to message object files: I18N Example.
(line 62)
-* portable object files, generating: Options. (line 138)
+* portable object files, generating: Options. (line 161)
* portable object template files: Explaining gettext. (line 30)
* porting gawk: New Ports. (line 6)
* positional specifiers, printf statement <1>: Printf Ordering.
@@ -26782,7 +31017,7 @@ Index
* positional specifiers, printf statement: Format Modifiers. (line 13)
* positional specifiers, printf statement, mixing with regular formats: Printf Ordering.
(line 57)
-* positive zero: Unexpected Results. (line 28)
+* positive zero: Unexpected Results. (line 34)
* POSIX awk <1>: Assignment Ops. (line 136)
* POSIX awk: This Manual. (line 14)
* POSIX awk, ** operator and: Precedence. (line 98)
@@ -26818,11 +31053,13 @@ Index
* POSIX awk, regular expressions and: Regexp Operators. (line 161)
* POSIX awk, timestamps and: Time Functions. (line 6)
* POSIX awk, | I/O operator and: Getline/Pipe. (line 52)
-* POSIX mode: Options. (line 202)
+* POSIX mode: Options. (line 247)
* POSIX, awk and: Preface. (line 23)
* POSIX, gawk extensions not included in: POSIX/GNU. (line 6)
* POSIX, programs, implementing in awk: Clones. (line 6)
-* POSIXLY_CORRECT environment variable: Options. (line 292)
+* POSIXLY_CORRECT environment variable: Options. (line 332)
+* PREC variable <1>: Setting Precision. (line 6)
+* PREC variable: User-modified. (line 134)
* precedence <1>: Precedence. (line 6)
* precedence: Increment Ops. (line 61)
* precedence, regexp operators: Regexp Operators. (line 156)
@@ -26856,24 +31093,23 @@ Index
* printf statement, sprintf() function and: Round Function. (line 6)
* printf statement, syntax of: Basic Printf. (line 6)
* printing: Printing. (line 6)
-* printing, list of options: Options. (line 145)
+* printing, list of options: Options. (line 168)
* printing, mailing labels: Labels Program. (line 6)
* printing, unduplicated lines of text: Uniq Program. (line 6)
* printing, user information: Id Program. (line 6)
* 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>: Two-way I/O. (line 116)
* PROCINFO array <2>: Id Program. (line 15)
* PROCINFO array <3>: Group Functions. (line 6)
* PROCINFO array <4>: Passwd Functions. (line 6)
-* PROCINFO array <5>: Two-way I/O. (line 116)
-* PROCINFO array <6>: Time Functions. (line 46)
-* PROCINFO array <7>: Auto-set. (line 123)
+* PROCINFO array <5>: Time Functions. (line 46)
+* PROCINFO array <6>: Auto-set. (line 130)
* PROCINFO array: Obsolete. (line 11)
* profiling awk programs: Profiling. (line 6)
-* profiling awk programs, dynamically: Profiling. (line 174)
-* profiling gawk, See pgawk program: Profiling. (line 6)
+* profiling awk programs, dynamically: Profiling. (line 171)
+* profiling gawk: Profiling. (line 6)
* program, definition of: Getting Started. (line 21)
* programmers, attractiveness of: Two-way I/O. (line 6)
* programming conventions, --non-decimal-data option: Nondecimal Data.
@@ -26886,34 +31122,34 @@ Index
(line 10)
* programming conventions, functions, writing: Definition Syntax.
(line 55)
-* programming conventions, gawk internals: Internal File Ops. (line 33)
+* programming conventions, gawk internals: Internal File Ops. (line 45)
* programming conventions, private variable names: Library Names.
(line 23)
* programming language, recipe for: History. (line 6)
* Programming languages, Ada: Glossary. (line 20)
* programming languages, data-driven vs. procedural: Getting Started.
(line 12)
-* Programming languages, Java: Glossary. (line 384)
-* programming, basic steps: Basic High Level. (line 19)
+* Programming languages, Java: Glossary. (line 388)
+* programming, basic steps: Basic High Level. (line 20)
* programming, concepts: Basic Concepts. (line 6)
* pwcat program: Passwd Functions. (line 23)
-* q debugger command (alias for quit): Miscellaneous Dgawk Commands.
+* q debugger command (alias for quit): Miscellaneous Debugger Commands.
(line 101)
-* QSE Awk: Other Versions. (line 108)
+* QSE Awk: Other Versions. (line 109)
* question mark (?) regexp operator <1>: GNU Regexp Operators.
(line 59)
* question mark (?) regexp operator: Regexp Operators. (line 111)
* question mark (?), ?: operator: Precedence. (line 92)
-* QuikTrim Awk: Other Versions. (line 112)
-* quit debugger command: Miscellaneous Dgawk Commands.
+* QuikTrim Awk: Other Versions. (line 113)
+* quit debugger command: Miscellaneous Debugger Commands.
(line 101)
-* QUIT signal (MS-Windows): Profiling. (line 207)
+* QUIT signal (MS-Windows): Profiling. (line 206)
* quoting <1>: Comments. (line 27)
* quoting <2>: Long. (line 26)
* quoting: Read Terminal. (line 25)
* quoting, rules for: Quoting. (line 6)
* quoting, tricks for: Quoting. (line 71)
-* r debugger command (alias for run): Dgawk Execution Control.
+* r debugger command (alias for run): Debugger Execution Control.
(line 62)
* Rakitzis, Byron: History Sorting. (line 25)
* rand() function: Numeric Functions. (line 34)
@@ -26931,12 +31167,12 @@ Index
* readable data files, checking: File Checking. (line 6)
* readable.awk program: File Checking. (line 11)
* recipe for a programming language: History. (line 6)
-* record separators <1>: User-modified. (line 134)
+* record separators <1>: User-modified. (line 143)
* record separators: Records. (line 14)
* record separators, changing: Records. (line 81)
* record separators, regular expressions as: Records. (line 117)
* record separators, with multiline records: Multiple Line. (line 10)
-* records <1>: Basic High Level. (line 71)
+* records <1>: Basic High Level. (line 73)
* records: Reading Files. (line 14)
* records, multiline: Multiple Line. (line 6)
* records, printing: Print. (line 22)
@@ -26959,8 +31195,6 @@ 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)
* regular expressions: Regexp. (line 6)
* regular expressions as field separators: Field Separators. (line 50)
* regular expressions, anchors in: Regexp Operators. (line 22)
@@ -26979,7 +31213,7 @@ Index
(line 59)
* regular expressions, gawk, command-line options: GNU Regexp Operators.
(line 70)
-* regular expressions, interval expressions and: Options. (line 227)
+* regular expressions, interval expressions and: Options. (line 272)
* regular expressions, leftmost longest match: Leftmost Longest.
(line 6)
* regular expressions, operators <1>: Regexp Operators. (line 6)
@@ -26995,7 +31229,7 @@ Index
* regular expressions, searching for: Egrep Program. (line 6)
* relational operators, See comparison operators: Typing and Comparison.
(line 9)
-* return debugger command: Dgawk Execution Control.
+* return debugger command: Debugger Execution Control.
(line 54)
* return statement, user-defined functions: Return Statement. (line 6)
* return values, close() function: Close Files And Pipes.
@@ -27012,8 +31246,8 @@ Index
* right angle bracket (>), >> operator (I/O) <1>: Precedence. (line 65)
* right angle bracket (>), >> operator (I/O): Redirection. (line 50)
* right shift, bitwise: Bitwise Functions. (line 32)
-* Ritchie, Dennis: Basic Data Typing. (line 74)
-* RLENGTH variable: Auto-set. (line 183)
+* Ritchie, Dennis: Basic Data Typing. (line 55)
+* RLENGTH variable: Auto-set. (line 233)
* RLENGTH variable, match() function and: String Functions. (line 223)
* Robbins, Arnold <1>: Future Extensions. (line 6)
* Robbins, Arnold <2>: Bugs. (line 32)
@@ -27024,23 +31258,25 @@ Index
* Robbins, Arnold: Command Line Field Separator.
(line 80)
* Robbins, Bill: Getline/Pipe. (line 36)
-* Robbins, Harry: Acknowledgments. (line 81)
-* Robbins, Jean: Acknowledgments. (line 81)
+* Robbins, Harry: Acknowledgments. (line 83)
+* Robbins, Jean: Acknowledgments. (line 83)
* Robbins, Miriam <1>: Passwd Functions. (line 90)
* Robbins, Miriam <2>: Getline/Pipe. (line 36)
-* Robbins, Miriam: Acknowledgments. (line 81)
-* Robinson, Will: Dynamic Extensions. (line 6)
-* robot, the: Dynamic Extensions. (line 6)
+* Robbins, Miriam: Acknowledgments. (line 83)
* Rommel, Kai Uwe: Contributors. (line 43)
* round() user-defined function: Round Function. (line 16)
+* rounding mode, floating-point: Rounding Mode. (line 6)
* rounding numbers: Round Function. (line 6)
-* RS variable <1>: User-modified. (line 134)
+* ROUNDMODE variable <1>: Setting Rounding Mode.
+ (line 6)
+* ROUNDMODE variable: User-modified. (line 138)
+* RS variable <1>: User-modified. (line 143)
* RS variable: Records. (line 20)
* RS variable, multiline records and: Multiple Line. (line 17)
-* rshift() function (gawk): Bitwise Functions. (line 51)
-* RSTART variable: Auto-set. (line 189)
+* rshift() function (gawk): Bitwise Functions. (line 52)
+* RSTART variable: Auto-set. (line 239)
* RSTART variable, match() function and: String Functions. (line 223)
-* RT variable <1>: Auto-set. (line 196)
+* RT variable <1>: Auto-set. (line 246)
* RT variable <2>: Getline/Variable/File.
(line 10)
* RT variable <3>: Multiple Line. (line 129)
@@ -27048,12 +31284,12 @@ Index
* Rubin, Paul <1>: Contributors. (line 16)
* Rubin, Paul: History. (line 30)
* rule, definition of: Getting Started. (line 21)
-* run debugger command: Dgawk Execution Control.
+* run debugger command: Debugger Execution Control.
(line 62)
* rvalues/lvalues: Assignment Ops. (line 32)
-* s debugger command (alias for step): Dgawk Execution Control.
+* s debugger command (alias for step): Debugger Execution Control.
(line 68)
-* sandbox mode: Options. (line 239)
+* sandbox mode: Options. (line 279)
* scalar values: Basic Data Typing. (line 13)
* Schorr, Andrew: Acknowledgments. (line 60)
* Schreiber, Bert: Acknowledgments. (line 38)
@@ -27061,7 +31297,9 @@ Index
* search paths <1>: VMS Running. (line 29)
* search paths <2>: PC Using. (line 11)
* search paths <3>: Igawk Program. (line 368)
+* search paths <4>: AWKLIBPATH Variable. (line 6)
* search paths: AWKPATH Variable. (line 6)
+* search paths, for shared libraries: AWKLIBPATH Variable. (line 6)
* search paths, for source files <1>: VMS Running. (line 29)
* search paths, for source files <2>: PC Using. (line 11)
* search paths, for source files <3>: Igawk Program. (line 368)
@@ -27083,11 +31321,11 @@ Index
* separators, field, FIELDWIDTHS variable and: User-modified. (line 35)
* separators, field, FPAT variable and: User-modified. (line 45)
* separators, field, POSIX and: Fields. (line 6)
-* separators, for records <1>: User-modified. (line 134)
+* separators, for records <1>: User-modified. (line 143)
* separators, for records: Records. (line 14)
* separators, for records, regular expressions as: Records. (line 117)
* separators, for statements in actions: Action Overview. (line 19)
-* separators, subscript: User-modified. (line 147)
+* separators, subscript: User-modified. (line 156)
* set debugger command: Viewing And Changing Data.
(line 59)
* shells, piping commands into: Redirection. (line 143)
@@ -27099,7 +31337,7 @@ Index
(line 6)
* shift, bitwise: Bitwise Functions. (line 32)
* short-circuit operators: Boolean Ops. (line 57)
-* si debugger command (alias for stepi): Dgawk Execution Control.
+* si debugger command (alias for stepi): Debugger Execution Control.
(line 76)
* side effects <1>: Increment Ops. (line 11)
* side effects: Concatenation. (line 42)
@@ -27114,18 +31352,18 @@ Index
* side effects, FILENAME variable: Getline Notes. (line 19)
* side effects, function calls: Function Calls. (line 54)
* side effects, statements: Action Overview. (line 32)
-* SIGHUP signal: Profiling. (line 204)
-* SIGINT signal (MS-Windows): Profiling. (line 207)
-* signals, HUP/SIGHUP: Profiling. (line 204)
-* signals, INT/SIGINT (MS-Windows): Profiling. (line 207)
-* signals, QUIT/SIGQUIT (MS-Windows): Profiling. (line 207)
-* signals, USR1/SIGUSR1: Profiling. (line 182)
-* SIGQUIT signal (MS-Windows): Profiling. (line 207)
-* SIGUSR1 signal: Profiling. (line 182)
-* silent debugger command: Dgawk Execution Control.
+* SIGHUP signal: Profiling. (line 203)
+* SIGINT signal (MS-Windows): Profiling. (line 206)
+* signals, HUP/SIGHUP: Profiling. (line 203)
+* signals, INT/SIGINT (MS-Windows): Profiling. (line 206)
+* signals, QUIT/SIGQUIT (MS-Windows): Profiling. (line 206)
+* signals, USR1/SIGUSR1: Profiling. (line 180)
+* SIGQUIT signal (MS-Windows): Profiling. (line 206)
+* SIGUSR1 signal: Profiling. (line 180)
+* silent debugger command: Debugger Execution Control.
(line 10)
* sin() function: Numeric Functions. (line 75)
-* single precision floating-point: Basic Data Typing. (line 36)
+* single precision floating-point: General Arithmetic. (line 21)
* single quote (') <1>: Quoting. (line 31)
* single quote (') <2>: Long. (line 33)
* single quote ('): One-shot. (line 15)
@@ -27134,8 +31372,12 @@ Index
* single-character fields: Single Character Fields.
(line 6)
* Skywalker, Luke: Undocumented. (line 6)
+* sleep: Extension Sample Time.
+ (line 6)
+* sleep time extension function: Extension Sample Time.
+ (line 20)
* sleep utility: Alarm Program. (line 109)
-* Solaris, POSIX-compliant awk: Other Versions. (line 86)
+* Solaris, POSIX-compliant awk: Other Versions. (line 87)
* sort function, arrays, sorting: Array Sorting Functions.
(line 6)
* sort utility: Word Sorting. (line 50)
@@ -27144,17 +31386,17 @@ Index
(line 93)
* source code, awka: Other Versions. (line 55)
* source code, Brian Kernighan's awk: Other Versions. (line 13)
-* source code, Busybox Awk: Other Versions. (line 78)
+* source code, Busybox Awk: Other Versions. (line 79)
* source code, gawk: Gawk Distribution. (line 6)
-* source code, jawk: Other Versions. (line 96)
-* source code, libmawk: Other Versions. (line 104)
+* source code, jawk: Other Versions. (line 97)
+* source code, libmawk: Other Versions. (line 105)
* source code, mawk: Other Versions. (line 35)
-* source code, mixing: Options. (line 108)
+* source code, mixing: Options. (line 131)
* source code, pawk: Other Versions. (line 69)
-* source code, QSE Awk: Other Versions. (line 108)
-* source code, QuikTrim Awk: Other Versions. (line 112)
-* source code, Solaris awk: Other Versions. (line 86)
-* source code, xgawk: Other Versions. (line 119)
+* source code, QSE Awk: Other Versions. (line 109)
+* source code, QuikTrim Awk: Other Versions. (line 113)
+* source code, Solaris awk: Other Versions. (line 87)
+* source code, xgawk: Other Versions. (line 120)
* source files, search path for: Igawk Program. (line 368)
* sparse arrays: Array Intro. (line 71)
* Spencer, Henry: Glossary. (line 12)
@@ -27170,7 +31412,7 @@ Index
* sqrt() function: Numeric Functions. (line 78)
* square brackets ([]): Regexp Operators. (line 55)
* srand() function: Numeric Functions. (line 82)
-* Stallman, Richard <1>: Glossary. (line 301)
+* Stallman, Richard <1>: Glossary. (line 305)
* Stallman, Richard <2>: Contributors. (line 24)
* Stallman, Richard <3>: Acknowledgments. (line 18)
* Stallman, Richard: Manual History. (line 6)
@@ -27178,16 +31420,13 @@ Index
* standard input <1>: Special FD. (line 6)
* standard input: Read Terminal. (line 6)
* standard output: Special FD. (line 6)
-* stat() function, implementing in gawk: Sample Library. (line 6)
* statements, compound, control statements and: Statements. (line 10)
* statements, control, in actions: Statements. (line 6)
* statements, multiple: Statements/Lines. (line 91)
-* step debugger command: Dgawk Execution Control.
+* step debugger command: Debugger Execution Control.
(line 68)
-* stepi debugger command: Dgawk Execution Control.
+* stepi debugger command: Debugger Execution Control.
(line 76)
-* stlen internal variable: Internals. (line 53)
-* stptr internal variable: Internals. (line 53)
* stream editors <1>: Simple Sed. (line 6)
* stream editors: Field Splitting Summary.
(line 47)
@@ -27198,8 +31437,7 @@ Index
(line 6)
* string operators: Concatenation. (line 9)
* string-matching operators: Regexp Usage. (line 19)
-* strings: Internals. (line 86)
-* strings, converting <1>: Bitwise Functions. (line 107)
+* strings, converting <1>: Bitwise Functions. (line 109)
* strings, converting: Conversion. (line 6)
* strings, converting, numbers to: User-modified. (line 28)
* strings, empty, See null strings: Records. (line 107)
@@ -27207,7 +31445,6 @@ Index
* strings, for localization: Programmer i18n. (line 14)
* strings, length of: Scalar Constants. (line 20)
* strings, merging arrays into: Join Function. (line 6)
-* strings, NODE internal type: Internals. (line 23)
* strings, null: Regexp Field Splitting.
(line 43)
* strings, numeric: Variable Typing. (line 6)
@@ -27220,7 +31457,7 @@ Index
(line 43)
* sub() function, arguments of: String Functions. (line 462)
* sub() function, escape processing: Gory Details. (line 6)
-* subscript separators: User-modified. (line 147)
+* subscript separators: User-modified. (line 156)
* subscripts in arrays, multidimensional: Multi-dimensional. (line 10)
* subscripts in arrays, multidimensional, scanning: Multi-scanning.
(line 11)
@@ -27228,25 +31465,26 @@ Index
(line 6)
* subscripts in arrays, uninitialized variables as: Uninitialized Subscripts.
(line 6)
-* SUBSEP variable: User-modified. (line 147)
+* SUBSEP variable: User-modified. (line 156)
* SUBSEP variable, multidimensional arrays: Multi-dimensional.
(line 16)
* substr() function: String Functions. (line 481)
* Sumner, Andrew: Other Versions. (line 55)
* switch statement: Switch Statement. (line 6)
+* SYMTAB array: Auto-set. (line 254)
* syntactic ambiguity: /= operator vs. /=.../ regexp constant: Assignment Ops.
(line 148)
* system() function: I/O Functions. (line 63)
* systime() function (gawk): Time Functions. (line 64)
-* t debugger command (alias for tbreak): Breakpoint Control. (line 89)
-* tbreak debugger command: Breakpoint Control. (line 89)
+* t debugger command (alias for tbreak): Breakpoint Control. (line 90)
+* tbreak debugger command: Breakpoint Control. (line 90)
* Tcl: Library Names. (line 57)
* TCP/IP: TCP/IP Networking. (line 6)
* TCP/IP, support for: Special Network. (line 6)
* tee utility: Tee Program. (line 6)
* tee.awk program: Tee Program. (line 26)
* terminating records: Records. (line 117)
-* testbits.awk program: Bitwise Functions. (line 68)
+* testbits.awk program: Bitwise Functions. (line 70)
* Texinfo <1>: Adding Code. (line 99)
* Texinfo <2>: Distribution contents.
(line 79)
@@ -27261,7 +31499,7 @@ Index
* text, printing: Print. (line 22)
* text, printing, unduplicated lines of: Uniq Program. (line 6)
* TEXTDOMAIN variable <1>: Programmer i18n. (line 9)
-* TEXTDOMAIN variable: User-modified. (line 153)
+* TEXTDOMAIN variable: User-modified. (line 162)
* TEXTDOMAIN variable, BEGIN pattern and: Programmer i18n. (line 60)
* TEXTDOMAIN variable, portability and: I18N Portability. (line 20)
* textdomain() function (C library): Explaining gettext. (line 27)
@@ -27273,22 +31511,25 @@ Index
* tilde (~), ~ operator <5>: Computed Regexps. (line 6)
* tilde (~), ~ operator <6>: Case-sensitivity. (line 26)
* tilde (~), ~ operator: Regexp Usage. (line 19)
+* time: Extension Sample Time.
+ (line 6)
* time, alarm clock example program: Alarm Program. (line 9)
* time, localization and: Explaining gettext. (line 115)
-* time, managing: Gettimeofday Function.
+* time, managing: Getlocaltime Function.
(line 6)
* time, retrieving: Time Functions. (line 17)
+* timeout, reading input: Read Timeout. (line 6)
* timestamps: Time Functions. (line 6)
* timestamps, converting dates to: Time Functions. (line 74)
-* timestamps, formatted: Gettimeofday Function.
+* timestamps, formatted: Getlocaltime Function.
(line 6)
* tolower() function: String Functions. (line 523)
* toupper() function: String Functions. (line 529)
* tr utility: Translate Program. (line 6)
-* trace debugger command: Miscellaneous Dgawk Commands.
+* trace debugger command: Miscellaneous Debugger Commands.
(line 110)
* translate.awk program: Translate Program. (line 55)
-* troubleshooting, --non-decimal-data option: Options. (line 169)
+* troubleshooting, --non-decimal-data option: Options. (line 207)
* troubleshooting, == operator: Comparison Operators.
(line 37)
* troubleshooting, awk uses FS not IFS: Field Separators. (line 29)
@@ -27320,7 +31561,7 @@ Index
* troubleshooting, substr() function: String Functions. (line 499)
* troubleshooting, system() function: I/O Functions. (line 85)
* troubleshooting, typographical errors, global variables: Options.
- (line 98)
+ (line 112)
* true, logical: Truth Values. (line 6)
* Trueman, David <1>: Contributors. (line 31)
* Trueman, David <2>: Acknowledgments. (line 47)
@@ -27328,8 +31569,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)
-* u debugger command (alias for until): Dgawk Execution Control.
+* u debugger command (alias for until): Debugger Execution Control.
(line 83)
* undefined functions: Pass By Value/Reference.
(line 71)
@@ -27345,7 +31585,7 @@ Index
(line 6)
* uniq utility: Uniq Program. (line 6)
* uniq.awk program: Uniq Program. (line 65)
-* Unix: Glossary. (line 615)
+* Unix: Glossary. (line 619)
* Unix awk, backslashes in escape sequences: Escape Sequences.
(line 125)
* Unix awk, close() function and: Close Files And Pipes.
@@ -27354,23 +31594,20 @@ 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)
-* unsigned integers: Basic Data Typing. (line 30)
-* until debugger command: Dgawk Execution Control.
+* unsigned integers: General Arithmetic. (line 15)
+* until debugger command: Debugger 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)
+* up debugger command: Execution Stack. (line 33)
* user database, reading: Passwd Functions. (line 6)
* user-defined, functions: User-defined. (line 6)
-* user-defined, functions, counts: Profiling. (line 132)
+* user-defined, functions, counts: Profiling. (line 129)
* user-defined, variables: Variables. (line 6)
* user-modifiable variables: User-modified. (line 6)
* users, information about, printing: Id Program. (line 6)
* users, information about, retrieving: Passwd Functions. (line 16)
-* USR1 signal: Profiling. (line 182)
+* USR1 signal: Profiling. (line 180)
* values, numeric: Basic Data Typing. (line 13)
* values, string: Basic Data Typing. (line 13)
* variable typing: Typing and Comparison.
@@ -27380,7 +31617,7 @@ Index
* variables, assigning on command line: Assignment Options. (line 6)
* variables, built-in <1>: Built-in Variables. (line 6)
* variables, built-in: Using Variables. (line 20)
-* variables, built-in, -v option, setting with: Options. (line 40)
+* variables, built-in, -v option, setting with: Options. (line 54)
* variables, built-in, conveying information: Auto-set. (line 6)
* variables, flag: Boolean Ops. (line 67)
* variables, getline command into, using <1>: Getline/Variable/Coprocess.
@@ -27391,12 +31628,12 @@ Index
(line 6)
* variables, getline command into, using: Getline/Variable. (line 6)
* variables, global, for library functions: Library Names. (line 11)
-* variables, global, printing list of: Options. (line 93)
+* variables, global, printing list of: Options. (line 107)
* variables, initializing: Using Variables. (line 20)
* variables, local: Variable Scope. (line 6)
* variables, names of: Arrays. (line 18)
* variables, private: Library Names. (line 11)
-* variables, setting: Options. (line 32)
+* variables, setting: Options. (line 46)
* variables, shadowing: Definition Syntax. (line 61)
* variables, types of: Assignment Ops. (line 40)
* variables, types of, comparison expressions and: Typing and Comparison.
@@ -27413,7 +31650,6 @@ 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)
* w debugger command (alias for watch): Viewing And Changing Data.
(line 67)
* w utility: Constant Size. (line 22)
@@ -27421,7 +31657,7 @@ Index
* Wall, Larry <1>: Future Extensions. (line 6)
* Wall, Larry: Array Intro. (line 6)
* Wallin, Anders: Acknowledgments. (line 60)
-* warnings, issuing: Options. (line 150)
+* warnings, issuing: Options. (line 182)
* watch debugger command: Viewing And Changing Data.
(line 67)
* wc utility: Wc Program. (line 6)
@@ -27433,7 +31669,7 @@ Index
* whitespace, as field separators: Default Field Splitting.
(line 6)
* whitespace, functions, calling: Calling Built-in. (line 10)
-* whitespace, newlines as: Options. (line 208)
+* whitespace, newlines as: Options. (line 253)
* Williams, Kent: Contributors. (line 35)
* Woehlke, Matthew: Contributors. (line 79)
* Woods, John: Contributors. (line 28)
@@ -27447,22 +31683,19 @@ 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)
-* xgawk: Other Versions. (line 119)
+* xgawk: Other Versions. (line 120)
* xgettext utility: String Extraction. (line 13)
-* XML (eXtensible Markup Language): Internals. (line 160)
* XOR bitwise operation: Bitwise Functions. (line 6)
-* xor() function (gawk): Bitwise Functions. (line 54)
+* xor() function (gawk): Bitwise Functions. (line 55)
* Yawitz, Efraim: Contributors. (line 106)
* Zaretskii, Eli <1>: Bugs. (line 70)
* Zaretskii, Eli <2>: Contributors. (line 56)
* Zaretskii, Eli: Acknowledgments. (line 60)
-* zero, negative vs. positive: Unexpected Results. (line 28)
+* zero, negative vs. positive: Unexpected Results. (line 34)
* zerofile.awk program: Empty Files. (line 21)
* Zoulas, Christos: Contributors. (line 67)
+* {} (braces): Profiling. (line 134)
* {} (braces), actions and: Action Overview. (line 19)
-* {} (braces), pgawk program: Profiling. (line 137)
* {} (braces), statements, grouping: Statements. (line 10)
* | (vertical bar): Regexp Operators. (line 69)
* | (vertical bar), | operator (I/O) <1>: Precedence. (line 65)
@@ -27489,418 +31722,515 @@ Index

Tag Table:
Node: Top1352
-Node: Foreword30282
-Node: Preface34627
-Ref: Preface-Footnote-137680
-Ref: Preface-Footnote-237786
-Node: History38018
-Node: Names40409
-Ref: Names-Footnote-141886
-Node: This Manual41958
-Ref: This Manual-Footnote-146905
-Node: Conventions47005
-Node: Manual History49139
-Ref: Manual History-Footnote-152409
-Ref: Manual History-Footnote-252450
-Node: How To Contribute52524
-Node: Acknowledgments53668
-Node: Getting Started57999
-Node: Running gawk60378
-Node: One-shot61564
-Node: Read Terminal62789
-Ref: Read Terminal-Footnote-164439
-Ref: Read Terminal-Footnote-264715
-Node: Long64886
-Node: Executable Scripts66262
-Ref: Executable Scripts-Footnote-168131
-Ref: Executable Scripts-Footnote-268233
-Node: Comments68780
-Node: Quoting71247
-Node: DOS Quoting75870
-Node: Sample Data Files76545
-Node: Very Simple79577
-Node: Two Rules84176
-Node: More Complex86323
-Ref: More Complex-Footnote-189253
-Node: Statements/Lines89338
-Ref: Statements/Lines-Footnote-193800
-Node: Other Features94065
-Node: When94993
-Node: Invoking Gawk97140
-Node: Command Line98525
-Node: Options99308
-Ref: Options-Footnote-1112852
-Node: Other Arguments112877
-Node: Naming Standard Input115535
-Node: Environment Variables116629
-Node: AWKPATH Variable117073
-Ref: AWKPATH Variable-Footnote-1119670
-Node: Other Environment Variables119930
-Node: Exit Status122270
-Node: Include Files122945
-Node: Obsolete126430
-Node: Undocumented127116
-Node: Regexp127357
-Node: Regexp Usage128746
-Node: Escape Sequences130772
-Node: Regexp Operators136535
-Ref: Regexp Operators-Footnote-1143915
-Ref: Regexp Operators-Footnote-2144062
-Node: Bracket Expressions144160
-Ref: table-char-classes146050
-Node: GNU Regexp Operators148573
-Node: Case-sensitivity152296
-Ref: Case-sensitivity-Footnote-1155264
-Ref: Case-sensitivity-Footnote-2155499
-Node: Leftmost Longest155607
-Node: Computed Regexps156808
-Node: Reading Files160218
-Node: Records162159
-Ref: Records-Footnote-1171083
-Node: Fields171120
-Ref: Fields-Footnote-1174153
-Node: Nonconstant Fields174239
-Node: Changing Fields176441
-Node: Field Separators182422
-Node: Default Field Splitting185051
-Node: Regexp Field Splitting186168
-Node: Single Character Fields189510
-Node: Command Line Field Separator190569
-Node: Field Splitting Summary194010
-Ref: Field Splitting Summary-Footnote-1197202
-Node: Constant Size197303
-Node: Splitting By Content201887
-Ref: Splitting By Content-Footnote-1205613
-Node: Multiple Line205653
-Ref: Multiple Line-Footnote-1211500
-Node: Getline211679
-Node: Plain Getline213907
-Node: Getline/Variable215996
-Node: Getline/File217137
-Node: Getline/Variable/File218459
-Ref: Getline/Variable/File-Footnote-1220058
-Node: Getline/Pipe220145
-Node: Getline/Variable/Pipe222705
-Node: Getline/Coprocess223812
-Node: Getline/Variable/Coprocess225055
-Node: Getline Notes225769
-Node: Getline Summary228556
-Ref: table-getline-variants228899
-Node: Command line directories229755
-Node: Printing230380
-Node: Print232011
-Node: Print Examples233348
-Node: Output Separators236132
-Node: OFMT237892
-Node: Printf239250
-Node: Basic Printf240156
-Node: Control Letters241695
-Node: Format Modifiers245507
-Node: Printf Examples251516
-Node: Redirection254231
-Node: Special Files261215
-Node: Special FD261748
-Ref: Special FD-Footnote-1265373
-Node: Special Network265447
-Node: Special Caveats266297
-Node: Close Files And Pipes267093
-Ref: Close Files And Pipes-Footnote-1274116
-Ref: Close Files And Pipes-Footnote-2274264
-Node: Expressions274414
-Node: Values275546
-Node: Constants276222
-Node: Scalar Constants276902
-Ref: Scalar Constants-Footnote-1277761
-Node: Nondecimal-numbers277943
-Node: Regexp Constants281002
-Node: Using Constant Regexps281477
-Node: Variables284532
-Node: Using Variables285187
-Node: Assignment Options286911
-Node: Conversion288783
-Ref: table-locale-affects294159
-Ref: Conversion-Footnote-1294783
-Node: All Operators294892
-Node: Arithmetic Ops295522
-Node: Concatenation298027
-Ref: Concatenation-Footnote-1300820
-Node: Assignment Ops300940
-Ref: table-assign-ops305928
-Node: Increment Ops307336
-Node: Truth Values and Conditions310806
-Node: Truth Values311889
-Node: Typing and Comparison312938
-Node: Variable Typing313727
-Ref: Variable Typing-Footnote-1317624
-Node: Comparison Operators317746
-Ref: table-relational-ops318156
-Node: POSIX String Comparison321705
-Ref: POSIX String Comparison-Footnote-1322661
-Node: Boolean Ops322799
-Ref: Boolean Ops-Footnote-1326877
-Node: Conditional Exp326968
-Node: Function Calls328700
-Node: Precedence332294
-Node: Locales335963
-Node: Patterns and Actions337052
-Node: Pattern Overview338106
-Node: Regexp Patterns339775
-Node: Expression Patterns340318
-Node: Ranges344003
-Node: BEGIN/END346969
-Node: Using BEGIN/END347731
-Ref: Using BEGIN/END-Footnote-1350462
-Node: I/O And BEGIN/END350568
-Node: BEGINFILE/ENDFILE352850
-Node: Empty355743
-Node: Using Shell Variables356059
-Node: Action Overview358344
-Node: Statements360701
-Node: If Statement362555
-Node: While Statement364054
-Node: Do Statement366098
-Node: For Statement367254
-Node: Switch Statement370406
-Node: Break Statement372503
-Node: Continue Statement374493
-Node: Next Statement376286
-Node: Nextfile Statement378676
-Node: Exit Statement381317
-Node: Built-in Variables383733
-Node: User-modified384828
-Ref: User-modified-Footnote-1392854
-Node: Auto-set392916
-Ref: Auto-set-Footnote-1402207
-Node: ARGC and ARGV402412
-Node: Arrays406263
-Node: Array Basics407768
-Node: Array Intro408594
-Node: Reference to Elements412912
-Node: Assigning Elements415182
-Node: Array Example415673
-Node: Scanning an Array417405
-Node: Controlling Scanning419719
-Ref: Controlling Scanning-Footnote-1424652
-Node: Delete424968
-Ref: Delete-Footnote-1427733
-Node: Numeric Array Subscripts427790
-Node: Uninitialized Subscripts429973
-Node: Multi-dimensional431601
-Node: Multi-scanning434695
-Node: Arrays of Arrays436286
-Node: Functions440931
-Node: Built-in441753
-Node: Calling Built-in442831
-Node: Numeric Functions444819
-Ref: Numeric Functions-Footnote-1448651
-Ref: Numeric Functions-Footnote-2449008
-Ref: Numeric Functions-Footnote-3449056
-Node: String Functions449325
-Ref: String Functions-Footnote-1472822
-Ref: String Functions-Footnote-2472951
-Ref: String Functions-Footnote-3473199
-Node: Gory Details473286
-Ref: table-sub-escapes474965
-Ref: table-sub-posix-92476319
-Ref: table-sub-proposed477662
-Ref: table-posix-sub479012
-Ref: table-gensub-escapes480558
-Ref: Gory Details-Footnote-1481765
-Ref: Gory Details-Footnote-2481816
-Node: I/O Functions481967
-Ref: I/O Functions-Footnote-1488622
-Node: Time Functions488769
-Ref: Time Functions-Footnote-1499661
-Ref: Time Functions-Footnote-2499729
-Ref: Time Functions-Footnote-3499887
-Ref: Time Functions-Footnote-4499998
-Ref: Time Functions-Footnote-5500110
-Ref: Time Functions-Footnote-6500337
-Node: Bitwise Functions500603
-Ref: table-bitwise-ops501161
-Ref: Bitwise Functions-Footnote-1505321
-Node: Type Functions505505
-Node: I18N Functions505975
-Node: User-defined507602
-Node: Definition Syntax508406
-Ref: Definition Syntax-Footnote-1513316
-Node: Function Example513385
-Node: Function Caveats515979
-Node: Calling A Function516400
-Node: Variable Scope517515
-Node: Pass By Value/Reference519490
-Node: Return Statement522930
-Node: Dynamic Typing525911
-Node: Indirect Calls526646
-Node: Internationalization536331
-Node: I18N and L10N537757
-Node: Explaining gettext538443
-Ref: Explaining gettext-Footnote-1543509
-Ref: Explaining gettext-Footnote-2543693
-Node: Programmer i18n543858
-Node: Translator i18n548058
-Node: String Extraction548851
-Ref: String Extraction-Footnote-1549812
-Node: Printf Ordering549898
-Ref: Printf Ordering-Footnote-1552682
-Node: I18N Portability552746
-Ref: I18N Portability-Footnote-1555195
-Node: I18N Example555258
-Ref: I18N Example-Footnote-1557893
-Node: Gawk I18N557965
-Node: Advanced Features558582
-Node: Nondecimal Data560095
-Node: Array Sorting561678
-Node: Controlling Array Traversal562375
-Node: Array Sorting Functions570612
-Ref: Array Sorting Functions-Footnote-1574286
-Ref: Array Sorting Functions-Footnote-2574379
-Node: Two-way I/O574573
-Ref: Two-way I/O-Footnote-1580005
-Node: TCP/IP Networking580075
-Node: Profiling582919
-Node: Library Functions590393
-Ref: Library Functions-Footnote-1593400
-Node: Library Names593571
-Ref: Library Names-Footnote-1597042
-Ref: Library Names-Footnote-2597262
-Node: General Functions597348
-Node: Strtonum Function598301
-Node: Assert Function601231
-Node: Round Function604557
-Node: Cliff Random Function606100
-Node: Ordinal Functions607116
-Ref: Ordinal Functions-Footnote-1610186
-Ref: Ordinal Functions-Footnote-2610438
-Node: Join Function610647
-Ref: Join Function-Footnote-1612418
-Node: Gettimeofday Function612618
-Node: Data File Management616333
-Node: Filetrans Function616965
-Node: Rewind Function621104
-Node: File Checking622491
-Node: Empty Files623585
-Node: Ignoring Assigns625815
-Node: Getopt Function627368
-Ref: Getopt Function-Footnote-1638672
-Node: Passwd Functions638875
-Ref: Passwd Functions-Footnote-1647850
-Node: Group Functions647938
-Node: Walking Arrays656022
-Node: Sample Programs657591
-Node: Running Examples658256
-Node: Clones658984
-Node: Cut Program660208
-Node: Egrep Program670053
-Ref: Egrep Program-Footnote-1677826
-Node: Id Program677936
-Node: Split Program681552
-Ref: Split Program-Footnote-1685071
-Node: Tee Program685199
-Node: Uniq Program688002
-Node: Wc Program695431
-Ref: Wc Program-Footnote-1699697
-Ref: Wc Program-Footnote-2699897
-Node: Miscellaneous Programs699989
-Node: Dupword Program701177
-Node: Alarm Program703208
-Node: Translate Program707957
-Ref: Translate Program-Footnote-1712344
-Ref: Translate Program-Footnote-2712572
-Node: Labels Program712706
-Ref: Labels Program-Footnote-1716077
-Node: Word Sorting716161
-Node: History Sorting720045
-Node: Extract Program721884
-Ref: Extract Program-Footnote-1729367
-Node: Simple Sed729495
-Node: Igawk Program732557
-Ref: Igawk Program-Footnote-1747714
-Ref: Igawk Program-Footnote-2747915
-Node: Anagram Program748053
-Node: Signature Program751121
-Node: Debugger752221
-Node: Debugging753132
-Node: Debugging Concepts753545
-Node: Debugging Terms755401
-Node: Awk Debugging758024
-Node: Sample dgawk session758916
-Node: dgawk invocation759408
-Node: Finding The Bug760590
-Node: List of Debugger Commands767076
-Node: Breakpoint Control768387
-Node: Dgawk Execution Control772023
-Node: Viewing And Changing Data775374
-Node: Dgawk Stack778711
-Node: Dgawk Info780171
-Node: Miscellaneous Dgawk Commands784119
-Node: Readline Support789547
-Node: Dgawk Limitations790385
-Node: Language History792574
-Node: V7/SVR3.1794086
-Node: SVR4796407
-Node: POSIX797849
-Node: BTL798857
-Node: POSIX/GNU799591
-Node: Common Extensions804742
-Node: Ranges and Locales805849
-Ref: Ranges and Locales-Footnote-1810467
-Ref: Ranges and Locales-Footnote-2810494
-Ref: Ranges and Locales-Footnote-3810754
-Node: Contributors810975
-Node: Installation815237
-Node: Gawk Distribution816131
-Node: Getting816615
-Node: Extracting817441
-Node: Distribution contents819133
-Node: Unix Installation824355
-Node: Quick Installation824972
-Node: Additional Configuration Options826934
-Node: Configuration Philosophy828411
-Node: Non-Unix Installation830753
-Node: PC Installation831211
-Node: PC Binary Installation832510
-Node: PC Compiling834525
-Node: PC Testing837469
-Node: PC Using838645
-Node: Cygwin842830
-Node: MSYS843830
-Node: VMS Installation844344
-Node: VMS Compilation844947
-Ref: VMS Compilation-Footnote-1845954
-Node: VMS Installation Details846012
-Node: VMS Running847647
-Node: VMS Old Gawk849254
-Node: Bugs849728
-Node: Other Versions853580
-Node: Notes858861
-Node: Compatibility Mode859553
-Node: Additions860336
-Node: Accessing The Source861148
-Node: Adding Code862573
-Node: New Ports868540
-Node: Dynamic Extensions872653
-Node: Internals874029
-Node: Plugin License883132
-Node: Sample Library883766
-Node: Internal File Description884452
-Node: Internal File Ops888167
-Ref: Internal File Ops-Footnote-1892948
-Node: Using Internal File Ops893088
-Node: Future Extensions895465
-Node: Basic Concepts897969
-Node: Basic High Level898726
-Ref: Basic High Level-Footnote-1902761
-Node: Basic Data Typing902946
-Node: Floating Point Issues907471
-Node: String Conversion Precision908554
-Ref: String Conversion Precision-Footnote-1910254
-Node: Unexpected Results910363
-Node: POSIX Floating Point Problems912189
-Ref: POSIX Floating Point Problems-Footnote-1915894
-Node: Glossary915932
-Node: Copying941107
-Node: GNU Free Documentation License978664
-Node: Index1003801
+Node: Foreword40058
+Node: Preface44403
+Ref: Preface-Footnote-147456
+Ref: Preface-Footnote-247562
+Node: History47794
+Node: Names50185
+Ref: Names-Footnote-151662
+Node: This Manual51734
+Ref: This Manual-Footnote-157640
+Node: Conventions57740
+Node: Manual History59874
+Ref: Manual History-Footnote-163144
+Ref: Manual History-Footnote-263185
+Node: How To Contribute63259
+Node: Acknowledgments64403
+Node: Getting Started68899
+Node: Running gawk71278
+Node: One-shot72464
+Node: Read Terminal73689
+Ref: Read Terminal-Footnote-175339
+Ref: Read Terminal-Footnote-275615
+Node: Long75786
+Node: Executable Scripts77162
+Ref: Executable Scripts-Footnote-179031
+Ref: Executable Scripts-Footnote-279133
+Node: Comments79680
+Node: Quoting82147
+Node: DOS Quoting86770
+Node: Sample Data Files87445
+Node: Very Simple90477
+Node: Two Rules95076
+Node: More Complex97223
+Ref: More Complex-Footnote-1100153
+Node: Statements/Lines100238
+Ref: Statements/Lines-Footnote-1104700
+Node: Other Features104965
+Node: When105893
+Node: Invoking Gawk108040
+Node: Command Line109501
+Node: Options110284
+Ref: Options-Footnote-1125682
+Node: Other Arguments125707
+Node: Naming Standard Input128365
+Node: Environment Variables129459
+Node: AWKPATH Variable130017
+Ref: AWKPATH Variable-Footnote-1132775
+Node: AWKLIBPATH Variable133035
+Node: Other Environment Variables133632
+Node: Exit Status136127
+Node: Include Files136802
+Node: Loading Shared Libraries140371
+Node: Obsolete141596
+Node: Undocumented142293
+Node: Regexp142536
+Node: Regexp Usage143925
+Node: Escape Sequences145951
+Node: Regexp Operators151714
+Ref: Regexp Operators-Footnote-1159094
+Ref: Regexp Operators-Footnote-2159241
+Node: Bracket Expressions159339
+Ref: table-char-classes161229
+Node: GNU Regexp Operators163752
+Node: Case-sensitivity167475
+Ref: Case-sensitivity-Footnote-1170443
+Ref: Case-sensitivity-Footnote-2170678
+Node: Leftmost Longest170786
+Node: Computed Regexps171987
+Node: Reading Files175397
+Node: Records177400
+Ref: Records-Footnote-1186324
+Node: Fields186361
+Ref: Fields-Footnote-1189394
+Node: Nonconstant Fields189480
+Node: Changing Fields191682
+Node: Field Separators197663
+Node: Default Field Splitting200292
+Node: Regexp Field Splitting201409
+Node: Single Character Fields204751
+Node: Command Line Field Separator205810
+Node: Field Splitting Summary209251
+Ref: Field Splitting Summary-Footnote-1212443
+Node: Constant Size212544
+Node: Splitting By Content217128
+Ref: Splitting By Content-Footnote-1220854
+Node: Multiple Line220894
+Ref: Multiple Line-Footnote-1226741
+Node: Getline226920
+Node: Plain Getline229136
+Node: Getline/Variable231225
+Node: Getline/File232366
+Node: Getline/Variable/File233688
+Ref: Getline/Variable/File-Footnote-1235287
+Node: Getline/Pipe235374
+Node: Getline/Variable/Pipe237934
+Node: Getline/Coprocess239041
+Node: Getline/Variable/Coprocess240284
+Node: Getline Notes240998
+Node: Getline Summary243785
+Ref: table-getline-variants244193
+Node: Read Timeout245051
+Ref: Read Timeout-Footnote-1248796
+Node: Command line directories248853
+Node: Printing249483
+Node: Print251114
+Node: Print Examples252451
+Node: Output Separators255235
+Node: OFMT256995
+Node: Printf258353
+Node: Basic Printf259259
+Node: Control Letters260798
+Node: Format Modifiers264610
+Node: Printf Examples270619
+Node: Redirection273334
+Node: Special Files280318
+Node: Special FD280851
+Ref: Special FD-Footnote-1284476
+Node: Special Network284550
+Node: Special Caveats285400
+Node: Close Files And Pipes286196
+Ref: Close Files And Pipes-Footnote-1293219
+Ref: Close Files And Pipes-Footnote-2293367
+Node: Expressions293517
+Node: Values294649
+Node: Constants295325
+Node: Scalar Constants296005
+Ref: Scalar Constants-Footnote-1296864
+Node: Nondecimal-numbers297046
+Node: Regexp Constants300105
+Node: Using Constant Regexps300580
+Node: Variables303635
+Node: Using Variables304290
+Node: Assignment Options306014
+Node: Conversion307886
+Ref: table-locale-affects313262
+Ref: Conversion-Footnote-1313886
+Node: All Operators313995
+Node: Arithmetic Ops314625
+Node: Concatenation317130
+Ref: Concatenation-Footnote-1319923
+Node: Assignment Ops320043
+Ref: table-assign-ops325031
+Node: Increment Ops326439
+Node: Truth Values and Conditions329909
+Node: Truth Values330992
+Node: Typing and Comparison332041
+Node: Variable Typing332830
+Ref: Variable Typing-Footnote-1336727
+Node: Comparison Operators336849
+Ref: table-relational-ops337259
+Node: POSIX String Comparison340808
+Ref: POSIX String Comparison-Footnote-1341764
+Node: Boolean Ops341902
+Ref: Boolean Ops-Footnote-1345980
+Node: Conditional Exp346071
+Node: Function Calls347803
+Node: Precedence351397
+Node: Locales355066
+Node: Patterns and Actions356155
+Node: Pattern Overview357209
+Node: Regexp Patterns358878
+Node: Expression Patterns359421
+Node: Ranges363106
+Node: BEGIN/END366072
+Node: Using BEGIN/END366834
+Ref: Using BEGIN/END-Footnote-1369565
+Node: I/O And BEGIN/END369671
+Node: BEGINFILE/ENDFILE371953
+Node: Empty374857
+Node: Using Shell Variables375173
+Node: Action Overview377458
+Node: Statements379815
+Node: If Statement381669
+Node: While Statement383168
+Node: Do Statement385212
+Node: For Statement386368
+Node: Switch Statement389520
+Node: Break Statement391617
+Node: Continue Statement393607
+Node: Next Statement395400
+Node: Nextfile Statement397790
+Node: Exit Statement400431
+Node: Built-in Variables402847
+Node: User-modified403942
+Ref: User-modified-Footnote-1412297
+Node: Auto-set412359
+Ref: Auto-set-Footnote-1424710
+Ref: Auto-set-Footnote-2424915
+Node: ARGC and ARGV424971
+Node: Arrays428822
+Node: Array Basics430327
+Node: Array Intro431153
+Node: Reference to Elements435471
+Node: Assigning Elements437741
+Node: Array Example438232
+Node: Scanning an Array439964
+Node: Controlling Scanning442278
+Ref: Controlling Scanning-Footnote-1447211
+Node: Delete447527
+Ref: Delete-Footnote-1450292
+Node: Numeric Array Subscripts450349
+Node: Uninitialized Subscripts452532
+Node: Multi-dimensional454160
+Node: Multi-scanning457254
+Node: Arrays of Arrays458845
+Node: Functions463490
+Node: Built-in464309
+Node: Calling Built-in465387
+Node: Numeric Functions467375
+Ref: Numeric Functions-Footnote-1471207
+Ref: Numeric Functions-Footnote-2471564
+Ref: Numeric Functions-Footnote-3471612
+Node: String Functions471881
+Ref: String Functions-Footnote-1495378
+Ref: String Functions-Footnote-2495507
+Ref: String Functions-Footnote-3495755
+Node: Gory Details495842
+Ref: table-sub-escapes497521
+Ref: table-sub-posix-92498875
+Ref: table-sub-proposed500226
+Ref: table-posix-sub501580
+Ref: table-gensub-escapes503126
+Ref: Gory Details-Footnote-1504333
+Ref: Gory Details-Footnote-2504384
+Node: I/O Functions504535
+Ref: I/O Functions-Footnote-1511190
+Node: Time Functions511337
+Ref: Time Functions-Footnote-1522229
+Ref: Time Functions-Footnote-2522297
+Ref: Time Functions-Footnote-3522455
+Ref: Time Functions-Footnote-4522566
+Ref: Time Functions-Footnote-5522678
+Ref: Time Functions-Footnote-6522905
+Node: Bitwise Functions523171
+Ref: table-bitwise-ops523729
+Ref: Bitwise Functions-Footnote-1527950
+Node: Type Functions528134
+Node: I18N Functions528604
+Node: User-defined530231
+Node: Definition Syntax531035
+Ref: Definition Syntax-Footnote-1535945
+Node: Function Example536014
+Node: Function Caveats538608
+Node: Calling A Function539029
+Node: Variable Scope540144
+Node: Pass By Value/Reference543107
+Node: Return Statement546547
+Node: Dynamic Typing549528
+Node: Indirect Calls550263
+Node: Library Functions559948
+Ref: Library Functions-Footnote-1562947
+Node: Library Names563118
+Ref: Library Names-Footnote-1566589
+Ref: Library Names-Footnote-2566809
+Node: General Functions566895
+Node: Strtonum Function567848
+Node: Assert Function570778
+Node: Round Function574104
+Node: Cliff Random Function575647
+Node: Ordinal Functions576663
+Ref: Ordinal Functions-Footnote-1579733
+Ref: Ordinal Functions-Footnote-2579985
+Node: Join Function580194
+Ref: Join Function-Footnote-1581965
+Node: Getlocaltime Function582165
+Node: Data File Management585880
+Node: Filetrans Function586512
+Node: Rewind Function590651
+Node: File Checking592038
+Node: Empty Files593132
+Node: Ignoring Assigns595362
+Node: Getopt Function596915
+Ref: Getopt Function-Footnote-1608219
+Node: Passwd Functions608422
+Ref: Passwd Functions-Footnote-1617397
+Node: Group Functions617485
+Node: Walking Arrays625569
+Node: Sample Programs627138
+Node: Running Examples627815
+Node: Clones628543
+Node: Cut Program629767
+Node: Egrep Program639612
+Ref: Egrep Program-Footnote-1647385
+Node: Id Program647495
+Node: Split Program651111
+Ref: Split Program-Footnote-1654630
+Node: Tee Program654758
+Node: Uniq Program657561
+Node: Wc Program664990
+Ref: Wc Program-Footnote-1669256
+Ref: Wc Program-Footnote-2669456
+Node: Miscellaneous Programs669548
+Node: Dupword Program670736
+Node: Alarm Program672767
+Node: Translate Program677516
+Ref: Translate Program-Footnote-1681903
+Ref: Translate Program-Footnote-2682131
+Node: Labels Program682265
+Ref: Labels Program-Footnote-1685636
+Node: Word Sorting685720
+Node: History Sorting689604
+Node: Extract Program691443
+Ref: Extract Program-Footnote-1698926
+Node: Simple Sed699054
+Node: Igawk Program702116
+Ref: Igawk Program-Footnote-1717273
+Ref: Igawk Program-Footnote-2717474
+Node: Anagram Program717612
+Node: Signature Program720680
+Node: Internationalization721780
+Node: I18N and L10N723212
+Node: Explaining gettext723898
+Ref: Explaining gettext-Footnote-1728964
+Ref: Explaining gettext-Footnote-2729148
+Node: Programmer i18n729313
+Node: Translator i18n733513
+Node: String Extraction734306
+Ref: String Extraction-Footnote-1735267
+Node: Printf Ordering735353
+Ref: Printf Ordering-Footnote-1738137
+Node: I18N Portability738201
+Ref: I18N Portability-Footnote-1740650
+Node: I18N Example740713
+Ref: I18N Example-Footnote-1743348
+Node: Gawk I18N743420
+Node: Advanced Features744037
+Node: Nondecimal Data745541
+Node: Array Sorting747124
+Node: Controlling Array Traversal747821
+Node: Array Sorting Functions756059
+Ref: Array Sorting Functions-Footnote-1759733
+Ref: Array Sorting Functions-Footnote-2759826
+Node: Two-way I/O760020
+Ref: Two-way I/O-Footnote-1765452
+Node: TCP/IP Networking765522
+Node: Profiling768366
+Node: Debugger775820
+Node: Debugging776788
+Node: Debugging Concepts777221
+Node: Debugging Terms779077
+Node: Awk Debugging781674
+Node: Sample Debugging Session782566
+Node: Debugger Invocation783086
+Node: Finding The Bug784415
+Node: List of Debugger Commands790903
+Node: Breakpoint Control792237
+Node: Debugger Execution Control795901
+Node: Viewing And Changing Data799261
+Node: Execution Stack802617
+Node: Debugger Info804084
+Node: Miscellaneous Debugger Commands808065
+Node: Readline Support813510
+Node: Limitations814341
+Node: Arbitrary Precision Arithmetic816593
+Ref: Arbitrary Precision Arithmetic-Footnote-1818235
+Node: General Arithmetic818383
+Node: Floating Point Issues820103
+Node: String Conversion Precision820984
+Ref: String Conversion Precision-Footnote-1822690
+Node: Unexpected Results822799
+Node: POSIX Floating Point Problems824952
+Ref: POSIX Floating Point Problems-Footnote-1828777
+Node: Integer Programming828815
+Node: Floating-point Programming830568
+Ref: Floating-point Programming-Footnote-1836877
+Node: Floating-point Representation837141
+Node: Floating-point Context838306
+Ref: table-ieee-formats839148
+Node: Rounding Mode840532
+Ref: table-rounding-modes841011
+Ref: Rounding Mode-Footnote-1844015
+Node: Gawk and MPFR844196
+Node: Arbitrary Precision Floats845438
+Ref: Arbitrary Precision Floats-Footnote-1847867
+Node: Setting Precision848178
+Node: Setting Rounding Mode850911
+Ref: table-gawk-rounding-modes851315
+Node: Floating-point Constants852495
+Node: Changing Precision853919
+Ref: Changing Precision-Footnote-1855319
+Node: Exact Arithmetic855493
+Node: Arbitrary Precision Integers858601
+Ref: Arbitrary Precision Integers-Footnote-1861601
+Node: Dynamic Extensions861748
+Node: Extension Intro863071
+Node: Plugin License864274
+Node: Extension Design864948
+Node: Old Extension Problems866019
+Ref: Old Extension Problems-Footnote-1867529
+Node: Extension New Mechanism Goals867586
+Ref: Extension New Mechanism Goals-Footnote-1870298
+Node: Extension Other Design Decisions870484
+Node: Extension Mechanism Outline872231
+Ref: load-extension873256
+Ref: load-new-function874734
+Ref: call-new-function875715
+Node: Extension Future Growth877696
+Node: Extension API Description878438
+Node: Extension API Functions Introduction879766
+Node: General Data Types883841
+Ref: General Data Types-Footnote-1889474
+Node: Requesting Values889773
+Ref: table-value-types-returned890504
+Node: Constructor Functions891458
+Node: Registration Functions894454
+Node: Extension Functions895139
+Node: Exit Callback Functions896958
+Node: Extension Version String898201
+Node: Input Parsers898851
+Node: Output Wrappers907432
+Node: Two-way processors911825
+Node: Printing Messages913947
+Ref: Printing Messages-Footnote-1915024
+Node: Updating `ERRNO'915176
+Node: Accessing Parameters915915
+Node: Symbol Table Access917145
+Node: Symbol table by name917657
+Ref: Symbol table by name-Footnote-1919829
+Node: Symbol table by cookie919909
+Ref: Symbol table by cookie-Footnote-1924038
+Node: Cached values924101
+Ref: Cached values-Footnote-1927302
+Node: Array Manipulation927393
+Ref: Array Manipulation-Footnote-1928491
+Node: Array Data Types928530
+Ref: Array Data Types-Footnote-1931252
+Node: Array Functions931344
+Node: Flattening Arrays935110
+Node: Creating Arrays941941
+Node: Extension API Variables946737
+Node: Extension Versioning947373
+Node: Extension API Informational Variables949274
+Node: Extension API Boilerplate950360
+Node: Finding Extensions954194
+Node: Extension Example954741
+Node: Internal File Description955479
+Node: Internal File Ops959167
+Ref: Internal File Ops-Footnote-1970251
+Node: Using Internal File Ops970391
+Ref: Using Internal File Ops-Footnote-1972747
+Node: Extension Samples973013
+Node: Extension Sample File Functions974456
+Node: Extension Sample Fnmatch982825
+Node: Extension Sample Fork984551
+Node: Extension Sample Ord985765
+Node: Extension Sample Readdir986541
+Node: Extension Sample Revout988879
+Node: Extension Sample Rev2way989472
+Node: Extension Sample Read write array990162
+Node: Extension Sample Readfile992045
+Node: Extension Sample API Tests992800
+Node: Extension Sample Time993325
+Node: gawkextlib994634
+Node: Language History997017
+Node: V7/SVR3.1998539
+Node: SVR41000860
+Node: POSIX1002302
+Node: BTL1003310
+Node: POSIX/GNU1004044
+Node: Common Extensions1009579
+Node: Ranges and Locales1010686
+Ref: Ranges and Locales-Footnote-11015304
+Ref: Ranges and Locales-Footnote-21015331
+Ref: Ranges and Locales-Footnote-31015591
+Node: Contributors1015812
+Node: Installation1020108
+Node: Gawk Distribution1021002
+Node: Getting1021486
+Node: Extracting1022312
+Node: Distribution contents1024004
+Node: Unix Installation1029226
+Node: Quick Installation1029843
+Node: Additional Configuration Options1031805
+Node: Configuration Philosophy1033282
+Node: Non-Unix Installation1035624
+Node: PC Installation1036082
+Node: PC Binary Installation1037381
+Node: PC Compiling1039229
+Node: PC Testing1042173
+Node: PC Using1043349
+Node: Cygwin1047534
+Node: MSYS1048534
+Node: VMS Installation1049048
+Node: VMS Compilation1049651
+Ref: VMS Compilation-Footnote-11050658
+Node: VMS Installation Details1050716
+Node: VMS Running1052351
+Node: VMS Old Gawk1053958
+Node: Bugs1054432
+Node: Other Versions1058284
+Node: Notes1063599
+Node: Compatibility Mode1064186
+Node: Additions1064969
+Node: Accessing The Source1065896
+Node: Adding Code1067322
+Node: New Ports1073364
+Node: Derived Files1077499
+Ref: Derived Files-Footnote-11082807
+Ref: Derived Files-Footnote-21082841
+Ref: Derived Files-Footnote-31083441
+Node: Future Extensions1083539
+Node: Basic Concepts1085026
+Node: Basic High Level1085707
+Ref: figure-general-flow1085978
+Ref: figure-process-flow1086577
+Ref: Basic High Level-Footnote-11089806
+Node: Basic Data Typing1089991
+Node: Glossary1093346
+Node: Copying1118657
+Node: GNU Free Documentation License1156214
+Node: Index1181351

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index f0f74fef..3cf3af5d 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -20,7 +20,7 @@
@c applies to and all the info about who's publishing this edition
@c These apply across the board.
-@set UPDATE-MONTH February, 2012
+@set UPDATE-MONTH November, 2012
@set VERSION 4.0
@set PATCHLEVEL 1
@@ -88,9 +88,11 @@
@c some special symbols
@iftex
@set LEQ @math{@leq}
+@set PI @math{@pi}
@end iftex
@ifnottex
@set LEQ <=
+@set PI @i{pi}
@end ifnottex
@ifnottex
@@ -292,20 +294,24 @@ particular records in a file and perform operations upon them.
* Arrays:: The description and use of arrays. Also
includes array-oriented control statements.
* Functions:: Built-in and user-defined functions.
+* Library Functions:: A Library of @command{awk} Functions.
+* Sample Programs:: Many @command{awk} programs with complete
+ explanations.
* Internationalization:: Getting @command{gawk} to speak your
language.
* Advanced Features:: Stuff for advanced users, specific to
@command{gawk}.
-* Library Functions:: A Library of @command{awk} Functions.
-* Sample Programs:: Many @command{awk} programs with complete
- explanations.
-* Debugger:: The @code{dgawk} debugger.
+* Debugger:: The @code{gawk} debugger.
+* Arbitrary Precision Arithmetic:: Arbitrary precision arithmetic with
+ @command{gawk}.
+* Dynamic Extensions:: Adding new built-in functions to
+ @command{gawk}.
* Language History:: The evolution of the @command{awk}
language.
* Installation:: Installing @command{gawk} under various
operating systems.
-* Notes:: Notes about @command{gawk} extensions and
- possible future work.
+* Notes:: Notes about adding things to @command{gawk}
+ and possible future work.
* Basic Concepts:: A very quick introduction to programming
concepts.
* Glossary:: An explanation of some unfamiliar terms.
@@ -315,399 +321,531 @@ particular records in a file and perform operations upon them.
* Index:: Concept and Variable Index.
@detailmenu
-* History:: The history of @command{gawk} and
- @command{awk}.
-* Names:: What name to use to find @command{awk}.
-* This Manual:: Using this @value{DOCUMENT}. Includes
- sample input files that you can use.
-* Conventions:: Typographical Conventions.
-* Manual History:: Brief history of the GNU project and this
- @value{DOCUMENT}.
-* How To Contribute:: Helping to save the world.
-* Acknowledgments:: Acknowledgments.
-* Running gawk:: How to run @command{gawk} programs;
- includes command-line syntax.
-* One-shot:: Running a short throwaway @command{awk}
- program.
-* Read Terminal:: Using no input files (input from terminal
- instead).
-* Long:: Putting permanent @command{awk} programs in
- files.
-* Executable Scripts:: Making self-contained @command{awk}
- programs.
-* Comments:: Adding documentation to @command{gawk}
- programs.
-* Quoting:: More discussion of shell quoting issues.
-* DOS Quoting:: Quoting in Windows Batch Files.
-* Sample Data Files:: Sample data files for use in the
- @command{awk} programs illustrated in this
- @value{DOCUMENT}.
-* Very Simple:: A very simple example.
-* Two Rules:: A less simple one-line example using two
- rules.
-* More Complex:: A more complex example.
-* Statements/Lines:: Subdividing or combining statements into
- lines.
-* Other Features:: Other Features of @command{awk}.
-* When:: When to use @command{gawk} and when to use
- other things.
-* Command Line:: How to run @command{awk}.
-* Options:: Command-line options and their meanings.
-* Other Arguments:: Input file names and variable assignments.
-* Naming Standard Input:: How to specify standard input with other
- files.
-* Environment Variables:: The environment variables @command{gawk}
- uses.
-* AWKPATH Variable:: Searching directories for @command{awk}
- programs.
-* Other Environment Variables:: The environment variables.
-* Exit Status:: @command{gawk}'s exit status.
-* Include Files:: Including other files into your program.
-* Obsolete:: Obsolete Options and/or features.
-* Undocumented:: Undocumented Options and Features.
-* Regexp Usage:: How to Use Regular Expressions.
-* Escape Sequences:: How to write nonprinting characters.
-* Regexp Operators:: Regular Expression Operators.
-* Bracket Expressions:: What can go between @samp{[...]}.
-* GNU Regexp Operators:: Operators specific to GNU software.
-* Case-sensitivity:: How to do case-insensitive matching.
-* Leftmost Longest:: How much text matches.
-* Computed Regexps:: Using Dynamic Regexps.
-* Records:: Controlling how data is split into records.
-* Fields:: An introduction to fields.
-* Nonconstant Fields:: Nonconstant Field Numbers.
-* Changing Fields:: Changing the Contents of a Field.
-* Field Separators:: The field separator and how to change it.
-* Default Field Splitting:: How fields are normally separated.
-* Regexp Field Splitting:: Using regexps as the field separator.
-* Single Character Fields:: Making each character a separate field.
-* Command Line Field Separator:: Setting @code{FS} from the command-line.
-* Field Splitting Summary:: Some final points and a summary table.
-* Constant Size:: Reading constant width data.
-* Splitting By Content:: Defining Fields By Content
-* Multiple Line:: Reading multi-line records.
-* Getline:: Reading files under explicit program
- control using the @code{getline} function.
-* Plain Getline:: Using @code{getline} with no arguments.
-* Getline/Variable:: Using @code{getline} into a variable.
-* Getline/File:: Using @code{getline} from a file.
-* Getline/Variable/File:: Using @code{getline} into a variable from a
- file.
-* Getline/Pipe:: Using @code{getline} from a pipe.
-* Getline/Variable/Pipe:: Using @code{getline} into a variable from a
- pipe.
-* Getline/Coprocess:: Using @code{getline} from a coprocess.
-* Getline/Variable/Coprocess:: Using @code{getline} into a variable from a
- coprocess.
-* Getline Notes:: Important things to know about
- @code{getline}.
-* Getline Summary:: Summary of @code{getline} Variants.
-* Command line directories:: What happens if you put a directory on the
- command line.
-* Print:: The @code{print} statement.
-* Print Examples:: Simple examples of @code{print} statements.
-* Output Separators:: The output separators and how to change
- them.
-* OFMT:: Controlling Numeric Output With
- @code{print}.
-* Printf:: The @code{printf} statement.
-* Basic Printf:: Syntax of the @code{printf} statement.
-* Control Letters:: Format-control letters.
-* Format Modifiers:: Format-specification modifiers.
-* Printf Examples:: Several examples.
-* Redirection:: How to redirect output to multiple files
- and pipes.
-* Special Files:: File name interpretation in @command{gawk}.
- @command{gawk} allows access to inherited
- file descriptors.
-* Special FD:: Special files for I/O.
-* Special Network:: Special files for network communications.
-* Special Caveats:: Things to watch out for.
-* Close Files And Pipes:: Closing Input and Output Files and Pipes.
-* Values:: Constants, Variables, and Regular
- Expressions.
-* Constants:: String, numeric and regexp constants.
-* Scalar Constants:: Numeric and string constants.
-* Nondecimal-numbers:: What are octal and hex numbers.
-* Regexp Constants:: Regular Expression constants.
-* Using Constant Regexps:: When and how to use a regexp constant.
-* Variables:: Variables give names to values for later
- use.
-* Using Variables:: Using variables in your programs.
-* Assignment Options:: Setting variables on the command-line and a
- summary of command-line syntax. This is an
- advanced method of input.
-* Conversion:: The conversion of strings to numbers and
- vice versa.
-* All Operators:: @command{gawk}'s operators.
-* Arithmetic Ops:: Arithmetic operations (@samp{+}, @samp{-},
- etc.)
-* Concatenation:: Concatenating strings.
-* Assignment Ops:: Changing the value of a variable or a
- field.
-* Increment Ops:: Incrementing the numeric value of a
- variable.
-* Truth Values and Conditions:: Testing for true and false.
-* Truth Values:: What is ``true'' and what is ``false''.
-* Typing and Comparison:: How variables acquire types and how this
- affects comparison of numbers and strings
- with @samp{<}, etc.
-* Variable Typing:: String type versus numeric type.
-* Comparison Operators:: The comparison operators.
-* POSIX String Comparison:: String comparison with POSIX rules.
-* Boolean Ops:: Combining comparison expressions using
- boolean operators @samp{||} (``or''),
- @samp{&&} (``and'') and @samp{!} (``not'').
-* Conditional Exp:: Conditional expressions select between two
- subexpressions under control of a third
- subexpression.
-* Function Calls:: A function call is an expression.
-* Precedence:: How various operators nest.
-* Locales:: How the locale affects things.
-* Pattern Overview:: What goes into a pattern.
-* Regexp Patterns:: Using regexps as patterns.
-* Expression Patterns:: Any expression can be used as a pattern.
-* Ranges:: Pairs of patterns specify record ranges.
-* BEGIN/END:: Specifying initialization and cleanup
- rules.
-* Using BEGIN/END:: How and why to use BEGIN/END rules.
-* I/O And BEGIN/END:: I/O issues in BEGIN/END rules.
-* BEGINFILE/ENDFILE:: Two special patterns for advanced control.
-* Empty:: The empty pattern, which matches every
- record.
-* Using Shell Variables:: How to use shell variables with
- @command{awk}.
-* Action Overview:: What goes into an action.
-* Statements:: Describes the various control statements in
- detail.
-* If Statement:: Conditionally execute some @command{awk}
- statements.
-* While Statement:: Loop until some condition is satisfied.
-* Do Statement:: Do specified action while looping until
- some condition is satisfied.
-* For Statement:: Another looping statement, that provides
- initialization and increment clauses.
-* Switch Statement:: Switch/case evaluation for conditional
- execution of statements based on a value.
-* Break Statement:: Immediately exit the innermost enclosing
- loop.
-* Continue Statement:: Skip to the end of the innermost enclosing
- loop.
-* Next Statement:: Stop processing the current input record.
-* Nextfile Statement:: Stop processing the current file.
-* Exit Statement:: Stop execution of @command{awk}.
-* Built-in Variables:: Summarizes the built-in variables.
-* User-modified:: Built-in variables that you change to
- control @command{awk}.
-* Auto-set:: Built-in variables where @command{awk}
- gives you information.
-* ARGC and ARGV:: Ways to use @code{ARGC} and @code{ARGV}.
-* Array Basics:: The basics of arrays.
-* Array Intro:: Introduction to Arrays
-* Reference to Elements:: How to examine one element of an array.
-* Assigning Elements:: How to change an element of an array.
-* Array Example:: Basic Example of an Array
-* Scanning an Array:: A variation of the @code{for} statement. It
- loops through the indices of an array's
- existing elements.
-* Controlling Scanning:: Controlling the order in which arrays are
- scanned.
-* Delete:: The @code{delete} statement removes an
- element from an array.
-* Numeric Array Subscripts:: How to use numbers as subscripts in
- @command{awk}.
-* Uninitialized Subscripts:: Using Uninitialized variables as
- subscripts.
-* Multi-dimensional:: Emulating multidimensional arrays in
- @command{awk}.
-* Multi-scanning:: Scanning multidimensional arrays.
-* Arrays of Arrays:: True multidimensional arrays.
-* Built-in:: Summarizes the built-in functions.
-* Calling Built-in:: How to call built-in functions.
-* Numeric Functions:: Functions that work with numbers, including
- @code{int()}, @code{sin()} and
- @code{rand()}.
-* String Functions:: Functions for string manipulation, such as
- @code{split()}, @code{match()} and
- @code{sprintf()}.
-* Gory Details:: More than you want to know about @samp{\}
- and @samp{&} with @code{sub()},
- @code{gsub()}, and @code{gensub()}.
-* I/O Functions:: Functions for files and shell commands.
-* Time Functions:: Functions for dealing with timestamps.
-* Bitwise Functions:: Functions for bitwise operations.
-* Type Functions:: Functions for type information.
-* I18N Functions:: Functions for string translation.
-* User-defined:: Describes User-defined functions in detail.
-* Definition Syntax:: How to write definitions and what they
- mean.
-* Function Example:: An example function definition and what it
- does.
-* Function Caveats:: Things to watch out for.
-* Calling A Function:: Don't use spaces.
-* Variable Scope:: Controlling variable scope.
-* Pass By Value/Reference:: Passing parameters.
-* Return Statement:: Specifying the value a function returns.
-* Dynamic Typing:: How variable types can change at runtime.
-* Indirect Calls:: Choosing the function to call at runtime.
-* I18N and L10N:: Internationalization and Localization.
-* Explaining gettext:: How GNU @code{gettext} works.
-* Programmer i18n:: Features for the programmer.
-* Translator i18n:: Features for the translator.
-* String Extraction:: Extracting marked strings.
-* Printf Ordering:: Rearranging @code{printf} arguments.
-* I18N Portability:: @command{awk}-level portability issues.
-* I18N Example:: A simple i18n example.
-* Gawk I18N:: @command{gawk} is also internationalized.
-* Nondecimal Data:: Allowing nondecimal input data.
-* Array Sorting:: Facilities for controlling array traversal
- and sorting arrays.
-* Controlling Array Traversal:: How to use PROCINFO["sorted_in"].
-* Array Sorting Functions:: How to use @code{asort()} and
- @code{asorti()}.
-* Two-way I/O:: Two-way communications with another
- process.
-* TCP/IP Networking:: Using @command{gawk} for network
- programming.
-* Profiling:: Profiling your @command{awk} programs.
-* Library Names:: How to best name private global variables
- in library functions.
-* General Functions:: Functions that are of general use.
-* Strtonum Function:: A replacement for the built-in
- @code{strtonum()} function.
-* Assert Function:: A function for assertions in @command{awk}
- programs.
-* Round Function:: A function for rounding if @code{sprintf()}
- does not do it correctly.
-* Cliff Random Function:: The Cliff Random Number Generator.
-* Ordinal Functions:: Functions for using characters as numbers
- and vice versa.
-* Join Function:: A function to join an array into a string.
-* Gettimeofday Function:: A function to get formatted times.
-* Data File Management:: Functions for managing command-line data
- files.
-* Filetrans Function:: A function for handling data file
- transitions.
-* Rewind Function:: A function for rereading the current file.
-* File Checking:: Checking that data files are readable.
-* Empty Files:: Checking for zero-length files.
-* Ignoring Assigns:: Treating assignments as file names.
-* Getopt Function:: A function for processing command-line
- arguments.
-* Passwd Functions:: Functions for getting user information.
-* Group Functions:: Functions for getting group information.
-* Walking Arrays:: A function to walk arrays of arrays.
-* Running Examples:: How to run these examples.
-* Clones:: Clones of common utilities.
-* Cut Program:: The @command{cut} utility.
-* Egrep Program:: The @command{egrep} utility.
-* Id Program:: The @command{id} utility.
-* Split Program:: The @command{split} utility.
-* Tee Program:: The @command{tee} utility.
-* Uniq Program:: The @command{uniq} utility.
-* Wc Program:: The @command{wc} utility.
-* Miscellaneous Programs:: Some interesting @command{awk} programs.
-* Dupword Program:: Finding duplicated words in a document.
-* Alarm Program:: An alarm clock.
-* Translate Program:: A program similar to the @command{tr}
- utility.
-* Labels Program:: Printing mailing labels.
-* Word Sorting:: A program to produce a word usage count.
-* History Sorting:: Eliminating duplicate entries from a
- history file.
-* Extract Program:: Pulling out programs from Texinfo source
- files.
-* Simple Sed:: A Simple Stream Editor.
-* Igawk Program:: A wrapper for @command{awk} that includes
- files.
-* Anagram Program:: Finding anagrams from a dictionary.
-* Signature Program:: People do amazing things with too much time
- on their hands.
-* Debugging:: Introduction to @command{dgawk}.
-* Debugging Concepts:: Debugging In General.
-* Debugging Terms:: Additional Debugging Concepts.
-* Awk Debugging:: Awk Debugging.
-* Sample dgawk session:: Sample @command{dgawk} session.
-* dgawk invocation:: @command{dgawk} Invocation.
-* Finding The Bug:: Finding The Bug.
-* List of Debugger Commands:: Main @command{dgawk} Commands.
-* Breakpoint Control:: Control of breakpoints.
-* Dgawk Execution Control:: Control of execution.
-* Viewing And Changing Data:: Viewing and changing data.
-* Dgawk Stack:: Dealing with the stack.
-* Dgawk Info:: Obtaining information about the program and
- the debugger state.
-* Miscellaneous Dgawk Commands:: Miscellaneous Commands.
-* Readline Support:: Readline Support.
-* Dgawk Limitations:: Limitations and future plans.
-* V7/SVR3.1:: The major changes between V7 and System V
- Release 3.1.
-* SVR4:: Minor changes between System V Releases 3.1
- and 4.
-* POSIX:: New features from the POSIX standard.
-* BTL:: New features from Brian Kernighan's version
- of @command{awk}.
-* POSIX/GNU:: The extensions in @command{gawk} not in
- POSIX @command{awk}.
-* Common Extensions:: Common Extensions Summary.
-* Ranges and Locales:: How locales used to affect regexp ranges.
-* Contributors:: The major contributors to @command{gawk}.
-* Gawk Distribution:: What is in the @command{gawk} distribution.
-* Getting:: How to get the distribution.
-* Extracting:: How to extract the distribution.
-* Distribution contents:: What is in the distribution.
-* Unix Installation:: Installing @command{gawk} under various
- versions of Unix.
-* Quick Installation:: Compiling @command{gawk} under Unix.
-* Additional Configuration Options:: Other compile-time options.
-* Configuration Philosophy:: How it's all supposed to work.
-* Non-Unix Installation:: Installation on Other Operating Systems.
-* PC Installation:: Installing and Compiling @command{gawk} on
- MS-DOS and OS/2.
-* PC Binary Installation:: Installing a prepared distribution.
-* PC Compiling:: Compiling @command{gawk} for MS-DOS,
- Windows32, and OS/2.
-* PC Testing:: Testing @command{gawk} on PC systems.
-* PC Using:: Running @command{gawk} on MS-DOS, Windows32
- and OS/2.
-* Cygwin:: Building and running @command{gawk} for
- Cygwin.
-* MSYS:: Using @command{gawk} In The MSYS
- Environment.
-* VMS Installation:: Installing @command{gawk} on VMS.
-* VMS Compilation:: How to compile @command{gawk} under VMS.
-* VMS Installation Details:: How to install @command{gawk} under VMS.
-* VMS Running:: How to run @command{gawk} under VMS.
-* VMS Old Gawk:: An old version comes with some VMS systems.
-* Bugs:: Reporting Problems and Bugs.
-* Other Versions:: Other freely available @command{awk}
- implementations.
-* Compatibility Mode:: How to disable certain @command{gawk}
- extensions.
-* Additions:: Making Additions To @command{gawk}.
-* Accessing The Source:: Accessing the Git repository.
-* Adding Code:: Adding code to the main body of
- @command{gawk}.
-* New Ports:: Porting @command{gawk} to a new operating
- system.
-* Dynamic Extensions:: Adding new built-in functions to
- @command{gawk}.
-* Internals:: A brief look at some @command{gawk}
- internals.
-* Plugin License:: A note about licensing.
-* Sample Library:: A example of new functions.
-* Internal File Description:: What the new functions will do.
-* Internal File Ops:: The code for internal file operations.
-* Using Internal File Ops:: How to use an external extension.
-* Future Extensions:: New features that may be implemented one
- day.
-* Basic High Level:: The high level view.
-* Basic Data Typing:: A very quick intro to data types.
-* Floating Point Issues:: Stuff to know about floating-point numbers.
-* String Conversion Precision:: The String Value Can Lie.
-* Unexpected Results:: Floating Point Numbers Are Not Abstract
- Numbers.
-* POSIX Floating Point Problems:: Standards Versus Existing Practice.
+* History:: The history of @command{gawk} and
+ @command{awk}.
+* Names:: What name to use to find
+ @command{awk}.
+* This Manual:: Using this @value{DOCUMENT}. Includes
+ sample input files that you can use.
+* Conventions:: Typographical Conventions.
+* Manual History:: Brief history of the GNU project and
+ this @value{DOCUMENT}.
+* How To Contribute:: Helping to save the world.
+* Acknowledgments:: Acknowledgments.
+* Running gawk:: How to run @command{gawk} programs;
+ includes command-line syntax.
+* One-shot:: Running a short throwaway
+ @command{awk} program.
+* Read Terminal:: Using no input files (input from
+ terminal instead).
+* Long:: Putting permanent @command{awk}
+ programs in files.
+* Executable Scripts:: Making self-contained @command{awk}
+ programs.
+* Comments:: Adding documentation to @command{gawk}
+ programs.
+* Quoting:: More discussion of shell quoting
+ issues.
+* DOS Quoting:: Quoting in Windows Batch Files.
+* Sample Data Files:: Sample data files for use in the
+ @command{awk} programs illustrated in
+ this @value{DOCUMENT}.
+* Very Simple:: A very simple example.
+* Two Rules:: A less simple one-line example using
+ two rules.
+* More Complex:: A more complex example.
+* Statements/Lines:: Subdividing or combining statements
+ into lines.
+* Other Features:: Other Features of @command{awk}.
+* When:: When to use @command{gawk} and when to
+ use other things.
+* Command Line:: How to run @command{awk}.
+* Options:: Command-line options and their
+ meanings.
+* Other Arguments:: Input file names and variable
+ assignments.
+* Naming Standard Input:: How to specify standard input with
+ other files.
+* Environment Variables:: The environment variables
+ @command{gawk} uses.
+* AWKPATH Variable:: Searching directories for
+ @command{awk} programs.
+* AWKLIBPATH Variable:: Searching directories for
+ @command{awk} shared libraries.
+* Other Environment Variables:: The environment variables.
+* Exit Status:: @command{gawk}'s exit status.
+* Include Files:: Including other files into your
+ program.
+* Loading Shared Libraries:: Loading shared libraries into your
+ program.
+* Obsolete:: Obsolete Options and/or features.
+* Undocumented:: Undocumented Options and Features.
+* Regexp Usage:: How to Use Regular Expressions.
+* Escape Sequences:: How to write nonprinting characters.
+* Regexp Operators:: Regular Expression Operators.
+* Bracket Expressions:: What can go between @samp{[...]}.
+* GNU Regexp Operators:: Operators specific to GNU software.
+* Case-sensitivity:: How to do case-insensitive matching.
+* Leftmost Longest:: How much text matches.
+* Computed Regexps:: Using Dynamic Regexps.
+* Records:: Controlling how data is split into
+ records.
+* Fields:: An introduction to fields.
+* Nonconstant Fields:: Nonconstant Field Numbers.
+* Changing Fields:: Changing the Contents of a Field.
+* Field Separators:: The field separator and how to change
+ it.
+* Default Field Splitting:: How fields are normally separated.
+* Regexp Field Splitting:: Using regexps as the field separator.
+* Single Character Fields:: Making each character a separate
+ field.
+* Command Line Field Separator:: Setting @code{FS} from the
+ command-line.
+* Field Splitting Summary:: Some final points and a summary table.
+* Constant Size:: Reading constant width data.
+* Splitting By Content:: Defining Fields By Content
+* Multiple Line:: Reading multi-line records.
+* Getline:: Reading files under explicit program
+ control using the @code{getline}
+ function.
+* Plain Getline:: Using @code{getline} with no
+ arguments.
+* Getline/Variable:: Using @code{getline} into a variable.
+* Getline/File:: Using @code{getline} from a file.
+* Getline/Variable/File:: Using @code{getline} into a variable
+ from a file.
+* Getline/Pipe:: Using @code{getline} from a pipe.
+* Getline/Variable/Pipe:: Using @code{getline} into a variable
+ from a pipe.
+* Getline/Coprocess:: Using @code{getline} from a coprocess.
+* Getline/Variable/Coprocess:: Using @code{getline} into a variable
+ from a coprocess.
+* Getline Notes:: Important things to know about
+ @code{getline}.
+* Getline Summary:: Summary of @code{getline} Variants.
+* Read Timeout:: Reading input with a timeout.
+* Command line directories:: What happens if you put a directory on
+ the command line.
+* Print:: The @code{print} statement.
+* Print Examples:: Simple examples of @code{print}
+ statements.
+* Output Separators:: The output separators and how to
+ change them.
+* OFMT:: Controlling Numeric Output With
+ @code{print}.
+* Printf:: The @code{printf} statement.
+* Basic Printf:: Syntax of the @code{printf} statement.
+* Control Letters:: Format-control letters.
+* Format Modifiers:: Format-specification modifiers.
+* Printf Examples:: Several examples.
+* Redirection:: How to redirect output to multiple
+ files and pipes.
+* Special Files:: File name interpretation in
+ @command{gawk}. @command{gawk} allows
+ access to inherited file descriptors.
+* Special FD:: Special files for I/O.
+* Special Network:: Special files for network
+ communications.
+* Special Caveats:: Things to watch out for.
+* Close Files And Pipes:: Closing Input and Output Files and
+ Pipes.
+* Values:: Constants, Variables, and Regular
+ Expressions.
+* Constants:: String, numeric and regexp constants.
+* Scalar Constants:: Numeric and string constants.
+* Nondecimal-numbers:: What are octal and hex numbers.
+* Regexp Constants:: Regular Expression constants.
+* Using Constant Regexps:: When and how to use a regexp constant.
+* Variables:: Variables give names to values for
+ later use.
+* Using Variables:: Using variables in your programs.
+* Assignment Options:: Setting variables on the command-line
+ and a summary of command-line syntax.
+ This is an advanced method of input.
+* Conversion:: The conversion of strings to numbers
+ and vice versa.
+* All Operators:: @command{gawk}'s operators.
+* Arithmetic Ops:: Arithmetic operations (@samp{+},
+ @samp{-}, etc.)
+* Concatenation:: Concatenating strings.
+* Assignment Ops:: Changing the value of a variable or a
+ field.
+* Increment Ops:: Incrementing the numeric value of a
+ variable.
+* Truth Values and Conditions:: Testing for true and false.
+* Truth Values:: What is ``true'' and what is
+ ``false''.
+* Typing and Comparison:: How variables acquire types and how
+ this affects comparison of numbers and
+ strings with @samp{<}, etc.
+* Variable Typing:: String type versus numeric type.
+* Comparison Operators:: The comparison operators.
+* POSIX String Comparison:: String comparison with POSIX rules.
+* Boolean Ops:: Combining comparison expressions using
+ boolean operators @samp{||} (``or''),
+ @samp{&&} (``and'') and @samp{!}
+ (``not'').
+* Conditional Exp:: Conditional expressions select between
+ two subexpressions under control of a
+ third subexpression.
+* Function Calls:: A function call is an expression.
+* Precedence:: How various operators nest.
+* Locales:: How the locale affects things.
+* Pattern Overview:: What goes into a pattern.
+* Regexp Patterns:: Using regexps as patterns.
+* Expression Patterns:: Any expression can be used as a
+ pattern.
+* Ranges:: Pairs of patterns specify record
+ ranges.
+* BEGIN/END:: Specifying initialization and cleanup
+ rules.
+* Using BEGIN/END:: How and why to use BEGIN/END rules.
+* I/O And BEGIN/END:: I/O issues in BEGIN/END rules.
+* BEGINFILE/ENDFILE:: Two special patterns for advanced
+ control.
+* Empty:: The empty pattern, which matches every
+ record.
+* Using Shell Variables:: How to use shell variables with
+ @command{awk}.
+* Action Overview:: What goes into an action.
+* Statements:: Describes the various control
+ statements in detail.
+* If Statement:: Conditionally execute some
+ @command{awk} statements.
+* While Statement:: Loop until some condition is
+ satisfied.
+* Do Statement:: Do specified action while looping
+ until some condition is satisfied.
+* For Statement:: Another looping statement, that
+ provides initialization and increment
+ clauses.
+* Switch Statement:: Switch/case evaluation for conditional
+ execution of statements based on a
+ value.
+* Break Statement:: Immediately exit the innermost
+ enclosing loop.
+* Continue Statement:: Skip to the end of the innermost
+ enclosing loop.
+* Next Statement:: Stop processing the current input
+ record.
+* Nextfile Statement:: Stop processing the current file.
+* Exit Statement:: Stop execution of @command{awk}.
+* Built-in Variables:: Summarizes the built-in variables.
+* User-modified:: Built-in variables that you change to
+ control @command{awk}.
+* Auto-set:: Built-in variables where @command{awk}
+ gives you information.
+* ARGC and ARGV:: Ways to use @code{ARGC} and
+ @code{ARGV}.
+* Array Basics:: The basics of arrays.
+* Array Intro:: Introduction to Arrays
+* Reference to Elements:: How to examine one element of an
+ array.
+* Assigning Elements:: How to change an element of an array.
+* Array Example:: Basic Example of an Array
+* Scanning an Array:: A variation of the @code{for}
+ statement. It loops through the
+ indices of an array's existing
+ elements.
+* Controlling Scanning:: Controlling the order in which arrays
+ are scanned.
+* Delete:: The @code{delete} statement removes an
+ element from an array.
+* Numeric Array Subscripts:: How to use numbers as subscripts in
+ @command{awk}.
+* Uninitialized Subscripts:: Using Uninitialized variables as
+ subscripts.
+* Multi-dimensional:: Emulating multidimensional arrays in
+ @command{awk}.
+* Multi-scanning:: Scanning multidimensional arrays.
+* Arrays of Arrays:: True multidimensional arrays.
+* Built-in:: Summarizes the built-in functions.
+* Calling Built-in:: How to call built-in functions.
+* Numeric Functions:: Functions that work with numbers,
+ including @code{int()}, @code{sin()}
+ and @code{rand()}.
+* String Functions:: Functions for string manipulation,
+ such as @code{split()}, @code{match()}
+ and @code{sprintf()}.
+* Gory Details:: More than you want to know about
+ @samp{\} and @samp{&} with
+ @code{sub()}, @code{gsub()}, and
+ @code{gensub()}.
+* I/O Functions:: Functions for files and shell
+ commands.
+* Time Functions:: Functions for dealing with timestamps.
+* Bitwise Functions:: Functions for bitwise operations.
+* Type Functions:: Functions for type information.
+* I18N Functions:: Functions for string translation.
+* User-defined:: Describes User-defined functions in
+ detail.
+* Definition Syntax:: How to write definitions and what they
+ mean.
+* Function Example:: An example function definition and
+ what it does.
+* Function Caveats:: Things to watch out for.
+* Calling A Function:: Don't use spaces.
+* Variable Scope:: Controlling variable scope.
+* Pass By Value/Reference:: Passing parameters.
+* Return Statement:: Specifying the value a function
+ returns.
+* Dynamic Typing:: How variable types can change at
+ runtime.
+* Indirect Calls:: Choosing the function to call at
+ runtime.
+* Library Names:: How to best name private global
+ variables in library functions.
+* General Functions:: Functions that are of general use.
+* Strtonum Function:: A replacement for the built-in
+ @code{strtonum()} function.
+* Assert Function:: A function for assertions in
+ @command{awk} programs.
+* Round Function:: A function for rounding if
+ @code{sprintf()} does not do it
+ correctly.
+* Cliff Random Function:: The Cliff Random Number Generator.
+* Ordinal Functions:: Functions for using characters as
+ numbers and vice versa.
+* Join Function:: A function to join an array into a
+ string.
+* Getlocaltime Function:: A function to get formatted times.
+* Data File Management:: Functions for managing command-line
+ data files.
+* Filetrans Function:: A function for handling data file
+ transitions.
+* Rewind Function:: A function for rereading the current
+ file.
+* File Checking:: Checking that data files are readable.
+* Empty Files:: Checking for zero-length files.
+* Ignoring Assigns:: Treating assignments as file names.
+* Getopt Function:: A function for processing command-line
+ arguments.
+* Passwd Functions:: Functions for getting user
+ information.
+* Group Functions:: Functions for getting group
+ information.
+* Walking Arrays:: A function to walk arrays of arrays.
+* Running Examples:: How to run these examples.
+* Clones:: Clones of common utilities.
+* Cut Program:: The @command{cut} utility.
+* Egrep Program:: The @command{egrep} utility.
+* Id Program:: The @command{id} utility.
+* Split Program:: The @command{split} utility.
+* Tee Program:: The @command{tee} utility.
+* Uniq Program:: The @command{uniq} utility.
+* Wc Program:: The @command{wc} utility.
+* Miscellaneous Programs:: Some interesting @command{awk}
+ programs.
+* Dupword Program:: Finding duplicated words in a
+ document.
+* Alarm Program:: An alarm clock.
+* Translate Program:: A program similar to the @command{tr}
+ utility.
+* Labels Program:: Printing mailing labels.
+* Word Sorting:: A program to produce a word usage
+ count.
+* History Sorting:: Eliminating duplicate entries from a
+ history file.
+* Extract Program:: Pulling out programs from Texinfo
+ source files.
+* Simple Sed:: A Simple Stream Editor.
+* Igawk Program:: A wrapper for @command{awk} that
+ includes files.
+* Anagram Program:: Finding anagrams from a dictionary.
+* Signature Program:: People do amazing things with too much
+ time on their hands.
+* I18N and L10N:: Internationalization and Localization.
+* Explaining gettext:: How GNU @code{gettext} works.
+* Programmer i18n:: Features for the programmer.
+* Translator i18n:: Features for the translator.
+* String Extraction:: Extracting marked strings.
+* Printf Ordering:: Rearranging @code{printf} arguments.
+* I18N Portability:: @command{awk}-level portability
+ issues.
+* I18N Example:: A simple i18n example.
+* Gawk I18N:: @command{gawk} is also
+ internationalized.
+* Nondecimal Data:: Allowing nondecimal input data.
+* Array Sorting:: Facilities for controlling array
+ traversal and sorting arrays.
+* Controlling Array Traversal:: How to use PROCINFO["sorted_in"].
+* Array Sorting Functions:: How to use @code{asort()} and
+ @code{asorti()}.
+* Two-way I/O:: Two-way communications with another
+ process.
+* TCP/IP Networking:: Using @command{gawk} for network
+ programming.
+* Profiling:: Profiling your @command{awk} programs.
+* Debugging:: Introduction to @command{gawk}
+ debugger.
+* Debugging Concepts:: Debugging in General.
+* Debugging Terms:: Additional Debugging Concepts.
+* Awk Debugging:: Awk Debugging.
+* Sample Debugging Session:: Sample debugging session.
+* Debugger Invocation:: How to Start the Debugger.
+* Finding The Bug:: Finding the Bug.
+* List of Debugger Commands:: Main debugger commands.
+* Breakpoint Control:: Control of Breakpoints.
+* Debugger Execution Control:: Control of Execution.
+* Viewing And Changing Data:: Viewing and Changing Data.
+* Execution Stack:: Dealing with the Stack.
+* Debugger Info:: Obtaining Information about the
+ Program and the Debugger State.
+* Miscellaneous Debugger Commands:: Miscellaneous Commands.
+* Readline Support:: Readline support.
+* Limitations:: Limitations and future plans.
+* General Arithmetic:: An introduction to computer
+ arithmetic.
+* Floating Point Issues:: Stuff to know about floating-point
+ numbers.
+* String Conversion Precision:: The String Value Can Lie.
+* Unexpected Results:: Floating Point Numbers Are Not
+ Abstract Numbers.
+* POSIX Floating Point Problems:: Standards Versus Existing Practice.
+* Integer Programming:: Effective integer programming.
+* Floating-point Programming:: Effective Floating-point Programming.
+* Floating-point Representation:: Binary floating-point representation.
+* Floating-point Context:: Floating-point context.
+* Rounding Mode:: Floating-point rounding mode.
+* Gawk and MPFR:: How @command{gawk} provides
+ arbitrary-precision arithmetic.
+* Arbitrary Precision Floats:: Arbitrary Precision Floating-point
+ Arithmetic with @command{gawk}.
+* Setting Precision:: Setting the working precision.
+* Setting Rounding Mode:: Setting the rounding mode.
+* Floating-point Constants:: Representing floating-point constants.
+* Changing Precision:: Changing the precision of a number.
+* Exact Arithmetic:: Exact arithmetic with floating-point
+ numbers.
+* Arbitrary Precision Integers:: Arbitrary Precision Integer Arithmetic
+ with @command{gawk}.
+* Extension Intro:: What is an extension.
+* Plugin License:: A note about licensing.
+* Extension Design:: Design notes about the extension API.
+* Old Extension Problems:: Problems with the old mechanism.
+* Extension New Mechanism Goals:: Goals for the new mechanism.
+* Extension Other Design Decisions:: Some other design decisions.
+* Extension Mechanism Outline:: An outline of how it works.
+* Extension Future Growth:: Some room for future growth.
+* Extension API Description:: A full description of the API.
+* Extension API Functions Introduction:: Introduction to the API functions.
+* General Data Types:: The data types.
+* Requesting Values:: How to get a value.
+* Constructor Functions:: Functions for creating values.
+* Registration Functions:: Functions to register things with
+ @command{gawk}.
+* Extension Functions:: Registering extension functions.
+* Exit Callback Functions:: Registering an exit callback.
+* Extension Version String:: Registering a version string.
+* Input Parsers:: Registering an input parser.
+* Output Wrappers:: Registering an output wrapper.
+* Two-way processors:: Registering a two-way processor.
+* Printing Messages:: Functions for printing messages.
+* Updating @code{ERRNO}:: Functions for updating @code{ERRNO}.
+* Accessing Parameters:: Functions for accessing parameters.
+* Symbol Table Access:: Functions for accessing global
+ variables.
+* Symbol table by name:: Accessing variables by name.
+* Symbol table by cookie:: Accessing variables by ``cookie''.
+* Cached values:: Creating and using cached values.
+* Array Manipulation:: Functions for working with arrays.
+* Array Data Types:: Data types for working with arrays.
+* Array Functions:: Functions for working with arrays.
+* Flattening Arrays:: How to flatten arrays.
+* Creating Arrays:: How to create and populate arrays.
+* Extension API Variables:: Variables provided by the API.
+* Extension Versioning:: API Version information.
+* Extension API Informational Variables:: Variables providing information about
+ @command{gawk}'s invocation.
+* Extension API Boilerplate:: Boilerplate code for using the API.
+* Finding Extensions:: How @command{gawk} finds compiled
+ extensions.
+* Extension Example:: Example C code for an extension.
+* Internal File Description:: What the new functions will do.
+* Internal File Ops:: The code for internal file operations.
+* Using Internal File Ops:: How to use an external extension.
+* Extension Samples:: The sample extensions that ship with
+ @code{gawk}.
+* Extension Sample File Functions:: The file functions sample.
+* Extension Sample Fnmatch:: An interface to @code{fnmatch()}.
+* Extension Sample Fork:: An interface to @code{fork()} and
+ other process functions.
+* Extension Sample Ord:: Character to value to character
+ conversions.
+* Extension Sample Readdir:: An interface to @code{readdir()}.
+* Extension Sample Revout:: Reversing output sample output
+ wrapper.
+* Extension Sample Rev2way:: Reversing data sample two-way
+ processor.
+* Extension Sample Read write array:: Serializing an array to a file.
+* Extension Sample Readfile:: Reading an entire file into a string.
+* Extension Sample API Tests:: Tests for the API.
+* Extension Sample Time:: An interface to @code{gettimeofday()}
+ and @code{sleep()}.
+* gawkextlib:: The @code{gawkextlib} project.
+* V7/SVR3.1:: The major changes between V7 and
+ System V Release 3.1.
+* SVR4:: Minor changes between System V
+ Releases 3.1 and 4.
+* POSIX:: New features from the POSIX standard.
+* BTL:: New features from Brian Kernighan's
+ version of @command{awk}.
+* POSIX/GNU:: The extensions in @command{gawk} not
+ in POSIX @command{awk}.
+* Common Extensions:: Common Extensions Summary.
+* Ranges and Locales:: How locales used to affect regexp
+ ranges.
+* Contributors:: The major contributors to
+ @command{gawk}.
+* Gawk Distribution:: What is in the @command{gawk}
+ distribution.
+* Getting:: How to get the distribution.
+* Extracting:: How to extract the distribution.
+* Distribution contents:: What is in the distribution.
+* Unix Installation:: Installing @command{gawk} under
+ various versions of Unix.
+* Quick Installation:: Compiling @command{gawk} under Unix.
+* Additional Configuration Options:: Other compile-time options.
+* Configuration Philosophy:: How it's all supposed to work.
+* Non-Unix Installation:: Installation on Other Operating
+ Systems.
+* PC Installation:: Installing and Compiling
+ @command{gawk} on MS-DOS and OS/2.
+* PC Binary Installation:: Installing a prepared distribution.
+* PC Compiling:: Compiling @command{gawk} for MS-DOS,
+ Windows32, and OS/2.
+* PC Testing:: Testing @command{gawk} on PC systems.
+* PC Using:: Running @command{gawk} on MS-DOS,
+ Windows32 and OS/2.
+* Cygwin:: Building and running @command{gawk}
+ for Cygwin.
+* MSYS:: Using @command{gawk} In The MSYS
+ Environment.
+* VMS Installation:: Installing @command{gawk} on VMS.
+* VMS Compilation:: How to compile @command{gawk} under
+ VMS.
+* VMS Installation Details:: How to install @command{gawk} under
+ VMS.
+* VMS Running:: How to run @command{gawk} under VMS.
+* VMS Old Gawk:: An old version comes with some VMS
+ systems.
+* Bugs:: Reporting Problems and Bugs.
+* Other Versions:: Other freely available @command{awk}
+ implementations.
+* Compatibility Mode:: How to disable certain @command{gawk}
+ extensions.
+* Additions:: Making Additions To @command{gawk}.
+* Accessing The Source:: Accessing the Git repository.
+* Adding Code:: Adding code to the main body of
+ @command{gawk}.
+* New Ports:: Porting @command{gawk} to a new
+ operating system.
+* Derived Files:: Why derived files are kept in the
+ @command{git} repository.
+* Future Extensions:: New features that may be implemented
+ one day.
+* Basic High Level:: The high level view.
+* Basic Data Typing:: A very quick intro to data types.
@end detailmenu
@end menu
@@ -1113,6 +1251,12 @@ expert should find useful. In particular, the description of POSIX
@ref{Sample Programs},
should be of interest.
+This @value{DOCUMENT} is split into several parts, as follows:
+
+Part I describes the @command{awk} language and @command{gawk} program in detail.
+It starts with the basics, and continues through all of the features of @command{awk}.
+It contains the following chapters:
+
@ref{Getting Started},
provides the essentials you need to know to begin using @command{awk}.
@@ -1156,6 +1300,22 @@ describes the built-in functions @command{awk} and
@command{gawk} provide, as well as how to define
your own functions.
+Part II shows how to use @command{awk} and @command{gawk} for problem solving.
+There is lots of code here for you to read and learn from.
+It contains the following chapters:
+
+@ref{Library Functions}, which provides a number of functions meant to
+be used from main @command{awk} programs.
+
+@ref{Sample Programs},
+which provides many sample @command{awk} programs.
+
+Reading these two chapters allows you to see @command{awk}
+solving real problems.
+
+Part III focuses on features specific to @command{gawk}.
+It contains the following chapters:
+
@ref{Internationalization},
describes special features in @command{gawk} for translating program
messages into different languages at runtime.
@@ -1167,14 +1327,18 @@ are the abilities to have two-way communications with another process,
perform TCP/IP networking, and
profile your @command{awk} programs.
-@ref{Library Functions}, and
-@ref{Sample Programs},
-provide many sample @command{awk} programs.
-Reading them allows you to see @command{awk}
-solving real problems.
+@ref{Debugger}, describes the @command{awk} debugger.
-@ref{Debugger}, describes the @command{awk} debugger,
-@command{dgawk}.
+@ref{Arbitrary Precision Arithmetic},
+describes advanced arithmetic facilities provided by
+@command{gawk}.
+
+@ref{Dynamic Extensions}, describes how to add new variables and
+functions to @command{gawk} by writing extensions in C.
+
+Part IV provides the appendices, the Glossary, and two licenses that cover
+the @command{gawk} source code and this @value{DOCUMENT}, respectively.
+It contains the following appendices:
@ref{Language History},
describes how the @command{awk} language has evolved since
@@ -1192,8 +1356,7 @@ available @command{awk} implementations.
@ref{Notes},
describes how to disable @command{gawk}'s extensions, as
well as how to contribute new code to @command{gawk},
-how to write extension libraries, and some possible
-future directions for @command{gawk} development.
+and some possible future directions for @command{gawk} development.
@ref{Basic Concepts},
provides some very cursory background material for those who
@@ -1603,10 +1766,13 @@ has been and continues to be a pleasure working with this team of fine
people.
John Haque contributed the modifications to convert @command{gawk}
-into a byte-code interpreter, including the debugger. Stephen Davies
+into a byte-code interpreter, including the debugger, and the
+additional modifications for support of arbitrary precision arithmetic.
+Stephen Davies
contributed to the effort to bring the byte-code changes into the mainstream
code base.
Efraim Yawitz contributed the initial text of @ref{Debugger}.
+John Haque contributed the initial text of @ref{Arbitrary Precision Arithmetic}.
@cindex Kernighan, Brian
I would like to thank Brian Kernighan for invaluable assistance during the
@@ -1634,12 +1800,14 @@ Nof Ayalon @*
ISRAEL @*
March, 2011
-@ignore
-@c Try this
@iftex
-@page
-@headings off
-@majorheading I@ @ @ @ The @command{awk} Language and @command{gawk}
+@part Part I:@* The @command{awk} Language
+@end iftex
+
+@ignore
+@ifdocbook
+@part Part I:@* The @command{awk} Language
+
Part I describes the @command{awk} language and @command{gawk} program in detail.
It starts with the basics, and continues through all of the features of @command{awk}
and @command{gawk}. It contains the following chapters:
@@ -1649,6 +1817,9 @@ and @command{gawk}. It contains the following chapters:
@ref{Getting Started}.
@item
+@ref{Invoking Gawk}.
+
+@item
@ref{Regexp}.
@item
@@ -1668,21 +1839,8 @@ and @command{gawk}. It contains the following chapters:
@item
@ref{Functions}.
-
-@item
-@ref{Internationalization}.
-
-@item
-@ref{Advanced Features}.
-
-@item
-@ref{Invoking Gawk}.
@end itemize
-
-@page
-@evenheading @thispage@ @ @ @strong{@value{TITLE}} @| @|
-@oddheading @| @| @strong{@thischapter}@ @ @ @thispage
-@end iftex
+@end ifdocbook
@end ignore
@node Getting Started
@@ -2913,6 +3071,7 @@ things in this @value{CHAPTER} that don't interest you right now.
* Environment Variables:: The environment variables @command{gawk} uses.
* Exit Status:: @command{gawk}'s exit status.
* Include Files:: Including other files into your program.
+* Loading Shared Libraries:: Loading shared libraries into your program.
* Obsolete:: Obsolete Options and/or features.
* Undocumented:: Undocumented Options and Features.
@end menu
@@ -3004,6 +3163,22 @@ This option may be given multiple times; the @command{awk}
program consists of the concatenation the contents of
each specified @var{source-file}.
+@item -i @var{source-file}
+@itemx --include @var{source-file}
+@cindex @code{-i} option
+@cindex @code{--include} option
+@cindex @command{awk} programs, location of
+Read @command{awk} source library from @var{source-file}. This option is
+completely equivalent to using the @samp{@@include} directive inside
+your program. This option is very
+similar to the @option{-f} option, but there are two important differences.
+First, when @option{-i} is used, the program source will not be loaded if it has
+been previously loaded, whereas the @option{-f} will always load the file.
+Second, because this option is intended to be used with code libraries, the
+@command{awk} command does not recognize such files as constituting main program
+input. Thus, after processing an @option{-i} argument, we still expect to
+find the main source code via the @option{-f} option or on the command-line.
+
@item -v @var{var}=@var{val}
@itemx --assign @var{var}=@var{val}
@cindex @code{-v} option
@@ -3115,6 +3290,19 @@ inadvertently use global variables that you meant to be local.
(This is a particularly easy mistake to make with simple variable
names like @code{i}, @code{j}, etc.)
+@item -D@r{[}@var{file}@r{]}
+@itemx --debug=@r{[}@var{file}@r{]}
+@cindex @code{-D} option
+@cindex @code{--debug} option
+@cindex @command{awk} debugging, enabling
+Enable debugging of @command{awk} programs
+(@pxref{Debugging}).
+By default, the debugger reads commands interactively from the terminal.
+The optional @var{file} argument allows you to specify a file with a list
+of commands for the debugger to execute non-interactively.
+No space is allowed between the @option{-D} and @var{file}, if
+@var{file} is supplied.
+
@item -e @var{program-text}
@itemx --source @var{program-text}
@cindex @code{-e} option
@@ -3180,6 +3368,18 @@ for information about this option.
Print a ``usage'' message summarizing the short and long style options
that @command{gawk} accepts and then exit.
+@item -l @var{lib}
+@itemx --load @var{lib}
+@cindex @code{-l} option
+@cindex @code{--load} option
+@cindex loading, library
+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{dl_load()}.
+An alternative is to use the @samp{@@load} keyword inside the program to load
+a shared library.
+
@item -L @r{[}value@r{]}
@itemx --lint@r{[}=value@r{]}
@cindex @code{-l} option
@@ -3203,6 +3403,14 @@ when eliminating problems pointed out by @option{--lint}, you should take
care to search for all occurrences of each inappropriate construct. As
@command{awk} programs are usually short, doing so is not burdensome.
+@item -M
+@itemx --bignum
+@cindex @code{-M} option
+@cindex @code{--bignum} option
+Force arbitrary precision arithmetic on numbers. This option has no effect
+if @command{gawk} is not compiled to use the GNU MPFR and MP libraries
+(@pxref{Arbitrary Precision Arithmetic}).
+
@item -n
@itemx --non-decimal-data
@cindex @code{-n} option
@@ -3226,6 +3434,18 @@ Use with care.
Force the use of the locale's decimal point character
when parsing numeric input data (@pxref{Locales}).
+@item -o@r{[}@var{file}@r{]}
+@itemx --pretty-print@r{[}=@var{file}@r{]}
+@cindex @code{-o} option
+@cindex @code{--pretty-print} option
+@cindex @command{awk} enabling
+Enable pretty-printing of @command{awk} programs.
+By default, output program is created in a file named @file{awkprof.out}.
+The optional @var{file} argument allows you to specify a different
+@value{FN} for the output.
+No space is allowed between the @option{-o} and @var{file}, if
+@var{file} is supplied.
+
@item -O
@itemx --optimize
@cindex @code{--optimize} option
@@ -3238,7 +3458,7 @@ maintainer hopes to add more optimizations over time.
@itemx --profile@r{[}=@var{file}@r{]}
@cindex @code{-p} option
@cindex @code{--profile} option
-@cindex @command{awk} programs, profiling, enabling
+@cindex @command{awk} profiling, enabling
Enable profiling of @command{awk} programs
(@pxref{Profiling}).
By default, profiles are created in a file named @file{awkprof.out}.
@@ -3247,10 +3467,8 @@ The optional @var{file} argument allows you to specify a different
No space is allowed between the @option{-p} and @var{file}, if
@var{file} is supplied.
-When run with @command{gawk}, the profile is just a ``pretty printed'' version
-of the program. When run with @command{pgawk}, the profile contains execution
-counts for each statement in the program in the left margin, and function
-call counts for each function.
+The profile contains execution counts for each statement in the program
+in the left margin, and function call counts for each function.
@item -P
@itemx --posix
@@ -3314,14 +3532,6 @@ This is now @command{gawk}'s default behavior.
Nevertheless, this option remains both for backward compatibility,
and for use in combination with the @option{--traditional} option.
-@item -R @var{file}
-@itemx --command=@var{file}
-@cindex @code{-R} option
-@cindex @code{--command} option
-@command{dgawk} only.
-Read @command{dgawk} debugger options and commands from @var{file}.
-@xref{Dgawk Info}, for more information.
-
@item -S
@itemx --sandbox
@cindex @code{-S} option
@@ -3547,6 +3757,8 @@ behaves.
@menu
* AWKPATH Variable:: Searching directories for @command{awk}
programs.
+* AWKLIBPATH Variable:: Searching directories for @command{awk} shared
+ libraries.
* Other Environment Variables:: The environment variables.
@end menu
@@ -3564,7 +3776,8 @@ on the command-line with the @option{-f} option.
In most @command{awk}
implementations, you must supply a precise path name for each program
file, unless the file is in the current directory.
-But in @command{gawk}, if the @value{FN} supplied to the @option{-f} option
+But in @command{gawk}, if the @value{FN} supplied to the @option{-f}
+or @option{-i} options
does not contain a @samp{/}, then @command{gawk} searches a list of
directories (called the @dfn{search path}), one by one, looking for a
file with the specified name.
@@ -3586,13 +3799,16 @@ standard directory in the default path and then specified on
the command line with a short @value{FN}. Otherwise, the full @value{FN}
would have to be typed for each file.
-By using both the @option{--source} and @option{-f} options, your command-line
+By using the @option{-i} option, or the @option{--source} and @option{-f} options, your command-line
@command{awk} programs can use facilities in @command{awk} library files
(@pxref{Library Functions}).
Path searching is not done if @command{gawk} is in compatibility mode.
This is true for both @option{--traditional} and @option{--posix}.
@xref{Options}.
+If the source code is not found after the initial search, the path is searched
+again after adding the default @samp{.awk} suffix to the filename.
+
@quotation NOTE
To include
the current directory in the path, either place
@@ -3622,6 +3838,21 @@ sense: the @env{AWKPATH} environment variable is used to find the program
source files. Once your program is running, all the files have been
found, and @command{gawk} no longer needs to use @env{AWKPATH}.
+@node AWKLIBPATH Variable
+@subsection The @env{AWKLIBPATH} Environment Variable
+@cindex @env{AWKLIBPATH} environment variable
+@cindex directories, searching
+@cindex search paths
+@cindex search paths, for shared libraries
+@cindex differences in @command{awk} and @command{gawk}, @code{AWKLIBPATH} environment variable
+
+The @env{AWKLIBPATH} environment variable is similar to the @env{AWKPATH}
+variable, but it is used to search for shared libraries specified
+with the @option{-l} option rather than for source files. If the library
+is not found, the path is searched again after adding the appropriate
+shared library suffix for the platform. For example, on GNU/Linux systems,
+the suffix @samp{.so} is used.
+
@node Other Environment Variables
@subsection Other Environment Variables
@@ -3645,6 +3876,11 @@ Specifies the interval between connection retries,
in milliseconds. On systems that do not support
the @code{usleep()} system call,
the value is rounded up to an integral number of seconds.
+
+@item GAWK_READ_TIMEOUT
+Specifies the time, in milliseconds, for @command{gawk} to
+wait for input before returning with an error.
+@xref{Read Timeout}.
@end table
The environment variables in the following list are meant
@@ -3718,8 +3954,9 @@ into smaller, more manageable pieces, and also lets you reuse common @command{aw
code from various @command{awk} scripts. In other words, you can group
together @command{awk} functions, used to carry out specific tasks,
into external files. These files can be used just like function libraries,
-using the @samp{@@include} keyword in conjunction with the @code{AWKPATH}
-environment variable.
+using the @samp{@@include} keyword in conjunction with the @env{AWKPATH}
+environment variable. Note that source files may also be included
+using the @option{-i} option.
Let's see an example.
We'll start with two (trivial) @command{awk} scripts, namely
@@ -3825,6 +4062,41 @@ As mentioned in @ref{AWKPATH Variable}, the current directory is always
searched first for source files, before searching in @env{AWKPATH},
and this also applies to files named with @samp{@@include}.
+@node Loading Shared Libraries
+@section Loading Shared Libraries Into Your Program
+
+This @value{SECTION} describes a feature that is specific to @command{gawk}.
+
+The @samp{@@load} keyword can be used to read external @command{awk} shared
+libraries. This allows you to link in compiled code that may offer superior
+performance and/or give you access to extended capabilities not supported
+by the @command{awk} language. The @env{AWKLIBPATH} variable is used to
+search for the shared library. Using @samp{@@load} is completely equivalent
+to using the @option{-l} command-line option.
+
+If the shared library is not initially found in @env{AWKLIBPATH}, another
+search is conducted after appending the platform's default shared library
+suffix to the filename. For example, on GNU/Linux systems, the suffix
+@samp{.so} is used.
+
+@example
+$ @kbd{gawk '@@load "ordchr"; BEGIN @{print chr(65)@}'}
+@print{} A
+@end example
+
+@noindent
+This is equivalent to the following example:
+
+@example
+$ @kbd{gawk -lordchr 'BEGIN @{print chr(65)@}'}
+@print{} A
+@end example
+
+@noindent
+For command-line usage, the @option{-l} option is more convenient,
+but @samp{@@load} is useful for embedding inside an @command{awk} source file
+that requires access to a shared library.
+
@node Obsolete
@section Obsolete Options and/or Features
@@ -3921,31 +4193,6 @@ long-undocumented ``feature'' of Unix @code{awk}.
@end ignore
-@ignore
-@c Try this
-@iftex
-@page
-@headings off
-@majorheading II@ @ @ Using @command{awk} and @command{gawk}
-Part II shows how to use @command{awk} and @command{gawk} for problem solving.
-There is lots of code here for you to read and learn from.
-It contains the following chapters:
-
-@itemize @bullet
-@item
-@ref{Library Functions}.
-
-@item
-@ref{Sample Programs}.
-
-@end itemize
-
-@page
-@evenheading @thispage@ @ @ @strong{@value{TITLE}} @| @|
-@oddheading @| @| @strong{@thischapter}@ @ @ @thispage
-@end iftex
-@end ignore
-
@node Regexp
@chapter Regular Expressions
@cindex regexp, See regular expressions
@@ -5131,6 +5378,7 @@ used with it do not have to be named on the @command{awk} command line
* Multiple Line:: Reading multi-line records.
* Getline:: Reading files under explicit program control
using the @code{getline} function.
+* Read Timeout:: Reading input with a timeout.
* Command line directories:: What happens if you put a directory on the
command line.
@end menu
@@ -7224,9 +7472,10 @@ know that there is a string value to be assigned. Caveat Emptor.
summarizes the eight variants of @code{getline},
listing which built-in variables are set by each one,
and whether the variant is standard or a @command{gawk} extension.
+Note: for each variant, @command{gawk} sets the @code{RT} built-in variable.
@float Table,table-getline-variants
-@caption{getline Variants and What They Set}
+@caption{@code{getline} Variants and What They Set}
@multitable @columnfractions .33 .38 .27
@headitem Variant @tab Effect @tab Standard / Extension
@item @code{getline} @tab Sets @code{$0}, @code{NF}, @code{FNR}, and @code{NR} @tab Standard
@@ -7243,6 +7492,110 @@ and whether the variant is standard or a @command{gawk} extension.
@c ENDOFRANGE inex
@c ENDOFRANGE infir
+@node Read Timeout
+@section Reading Input With A Timeout
+@cindex timeout, reading input
+
+You may specify a timeout in milliseconds for reading input from a terminal,
+pipe or two-way communication including, TCP/IP sockets. This can be done
+on a per input, command or connection basis, by setting a special element
+in the @code{PROCINFO} array:
+
+@example
+PROCINFO["input_name", "READ_TIMEOUT"] = @var{timeout in milliseconds}
+@end example
+
+When set, this will cause @command{gawk} to time out and return failure
+if no data is available to read within the specified timeout period.
+For example, a TCP client can decide to give up on receiving
+any response from the server after a certain amount of time:
+
+@example
+Service = "/inet/tcp/0/localhost/daytime"
+PROCINFO[Service, "READ_TIMEOUT"] = 100
+if ((Service |& getline) > 0)
+ print $0
+else if (ERRNO != "")
+ print ERRNO
+@end example
+
+Here is how to read interactively from the terminal@footnote{This assumes
+that standard input is the keyboard} without waiting
+for more than five seconds:
+
+@example
+PROCINFO["/dev/stdin", "READ_TIMEOUT"] = 5000
+while ((getline < "/dev/stdin") > 0)
+ print $0
+@end example
+
+@command{gawk} will terminate the read operation if input does not
+arrive after waiting for the timeout period, return failure
+and set the @code{ERRNO} variable to an appropriate string value.
+A negative or zero value for the timeout is the same as specifying
+no timeout at all.
+
+A timeout can also be set for reading from the terminal in the implicit
+loop that reads input records and matches them against patterns,
+like so:
+
+@example
+$ @kbd{ gawk 'BEGIN @{ PROCINFO["-", "READ_TIMEOUT"] = 5000 @}}
+> @kbd{@{ print "You entered: " $0 @}'}
+@kbd{gawk}
+@print{} You entered: gawk
+@end example
+
+In this case, failure to respond within five seconds results in the following
+error message:
+
+@example
+@error{} gawk: cmd. line:2: (FILENAME=- FNR=1) fatal: error reading input file `-': Connection timed out
+@end example
+
+The timeout can be set or changed at any time, and will take effect on the
+next attempt to read from the input device. In the following example,
+we start with a timeout value of one second, and progressively
+reduce it by one-tenth of a second until we wait indefinitely
+for the input to arrive:
+
+@example
+PROCINFO[Service, "READ_TIMEOUT"] = 1000
+while ((Service |& getline) > 0) @{
+ print $0
+ PROCINFO[S, "READ_TIMEOUT"] -= 100
+@}
+@end example
+
+@quotation NOTE
+You should not assume that the read operation will block
+exactly after the tenth record has been printed. It is possible that
+@command{gawk} will read and buffer more than one record's
+worth of data the first time. Because of this, changing the value
+of timeout like in the above example is not very useful.
+@end quotation
+
+If the @code{PROCINFO} element is not present and the environment
+variable @env{GAWK_READ_TIMEOUT} exists,
+@command{gawk} uses its value to initialize the timeout value.
+The exclusive use of the environment variable to specify timeout
+has the disadvantage of not being able to control it
+on a per command or connection basis.
+
+@command{gawk} considers a timeout event to be an error even though
+the attempt to read from the underlying device may
+succeed in a later attempt. This is a limitation, and it also
+means that you cannot use this to multiplex input from
+two or more sources.
+
+Assigning a timeout value prevents read operations from
+blocking indefinitely. But bear in mind that there are other ways
+@command{gawk} can stall waiting for an input device to be ready.
+A network client can sometimes take a long time to establish
+a connection before it can start reading any data,
+or the attempt to open a FIFO special file for reading can block
+indefinitely until some other process opens it for writing.
+
@node Command line directories
@section Directories On The Command Line
@cindex directories, command line
@@ -11361,9 +11714,9 @@ fatal error.
@item
If you have written extensions that modify the record handling (by inserting
-an ``open hook''), you can invoke them at this point, before @command{gawk}
+an ``input parser''), you can invoke them at this point, before @command{gawk}
has started processing the file. (This is a @emph{very} advanced feature,
-currently used only by the @uref{http://xmlgawk.sourceforge.net, XMLgawk project}.)
+currently used only by the @uref{http://gawkextlib.sourceforge.net, @code{gawkextlib} project}.)
@end itemize
The @code{ENDFILE} rule is called when @command{gawk} has finished processing
@@ -12525,6 +12878,18 @@ This is the output record separator. It is output at the end of every
@code{print} statement. Its default value is @code{"\n"}, the newline
character. (@xref{Output Separators}.)
+@cindex @code{PREC} variable
+@item PREC #
+The working precision of arbitrary precision floating-point numbers,
+53 by default (@pxref{Setting Precision}).
+
+@cindex @code{ROUNDMODE} variable
+@item ROUNDMODE #
+The rounding mode to use for arbitrary precision arithmetic on
+numbers, by default @code{"N"} (@samp{roundTiesToEven} in
+the IEEE-754 standard)
+(@pxref{Setting Rounding Mode}).
+
@cindex @code{RS} variable
@cindex separators, for records
@cindex record separators
@@ -12671,7 +13036,9 @@ does not affect the environment passed on to any programs that
Some operating systems may not have environment variables.
On such systems, the @code{ENVIRON} array is empty (except for
@w{@code{ENVIRON["AWKPATH"]}},
-@pxref{AWKPATH Variable}).
+@pxref{AWKPATH Variable} and
+@w{@code{ENVIRON["AWKLIBPATH"]}},
+@pxref{AWKLIBPATH Variable}).
@cindex @command{gawk}, @code{ERRNO} variable in
@cindex @code{ERRNO} variable
@@ -12747,6 +13114,16 @@ assigning a value to @code{NF} has the potential to affect
to @code{NF} can be used to create or remove fields from the
current record. @xref{Changing Fields}.
+@cindex @code{FUNCTAB} array
+@cindex @command{gawk}, @code{FUNCTAB} array in
+@cindex differences in @command{awk} and @command{gawk}, @code{FUNCTAB} variable
+@item FUNCTAB #
+An array whose indices are the names of all the user-defined
+or extension functions in the program.
+@strong{NOTE}: The array values cannot currently be used.
+Also, you may not use the @code{delete} statement with the
+@code{FUNCTAB} array.
+
@cindex @code{NR} variable
@item NR
The number of input records @command{awk} has processed since
@@ -12776,6 +13153,34 @@ This is
@code{"FIELDWIDTHS"} if field splitting with @code{FIELDWIDTHS} is in effect,
or @code{"FPAT"} if field matching with @code{FPAT} is in effect.
+@item PROCINFO["identifiers"]
+A subarray, indexed by the names of all identifiers used in the
+text of the AWK program. For each identifier, the value of the element is one of the following:
+
+@table @code
+@item "array"
+The identifier is an array.
+
+@item "extension"
+The identifier is an extension function loaded via
+@code{@@load}.
+
+@item "scalar"
+The identifier is a scalar.
+
+@item "untyped"
+The identifier is untyped (could be used as a scalar or array,
+@command{gawk} doesn't know yet).
+
+@item "user"
+The identifier is a user-defined function.
+@end table
+
+@noindent
+The values indicate what @command{gawk} knows about the identifiers
+after it has finished parsing the program; they are @emph{not} updated
+while the program runs.
+
@item PROCINFO["gid"]
The value of the @code{getgid()} system call.
@@ -12808,6 +13213,25 @@ The value of the @code{getuid()} system call.
The version of @command{gawk}.
@end table
+The following additional elements in the array
+are available to provide information about the MPFR and GMP libraries
+if your version of @command{gawk} supports arbitrary precision numbers
+(@pxref{Arbitrary Precision Arithmetic}):
+
+@table @code
+@item PROCINFO["mpfr_version"]
+The version of the GNU MPFR library.
+
+@item PROCINFO["gmp_version"]
+The version of the GNU MP library.
+
+@item PROCINFO["prec_max"]
+The maximum precision supported by MPFR.
+
+@item PROCINFO["prec_min"]
+The minimum precision required by MPFR.
+@end table
+
On some systems, there may be elements in the array, @code{"group1"}
through @code{"group@var{N}"} for some @var{N}. @var{N} is the number of
supplementary groups that the process has. Use the @code{in} operator
@@ -12855,6 +13279,57 @@ In other @command{awk} implementations,
or if @command{gawk} is in compatibility mode
(@pxref{Options}),
it is not special.
+
+@cindex @command{gawk}, @code{SYMTAB} array in
+@cindex @code{SYMTAB} array
+@cindex differences in @command{awk} and @command{gawk}, @code{SYMTAB} variable
+@item SYMTAB #
+An array whose indices are the names of all currently defined
+global variables and arrays in the program. The array may be used
+for indirect access to read or write the value of a variable:
+
+@example
+foo = 5
+SYMTAB["foo"] = 4
+print foo # prints 4
+@end example
+
+@noindent
+The @code{isarray()} function (@pxref{Type Functions}) may be used to test
+if an element in @code{SYMTAB} is an array.
+Also, you may not use the @code{delete} statement with the
+@code{SYMTAB} array.
+
+You may use an index for @code{SYMTAB} that is not a predefined identifer:
+
+@example
+SYMTAB["xxx"] = 5
+print SYMTAB["xxx"]
+@end example
+
+@noindent
+This works as expected: in this case @code{SYMTAB} acts just like
+a regular array. The only difference is that you can't then delete
+@code{SYMTAB["xxx"]}.
+
+The @code{SYMTAB} array is more interesting than it looks. Andrew Schorr
+points out that it effectively gives @command{awk} data pointers. Consider his
+example:
+
+@example
+# Indirect multiply of any variable by amount, return result
+
+function multiply(variable, amount)
+@{
+ return SYMTAB[variable] *= amount
+@}
+@end example
+
+@quotation NOTE
+In order to avoid severe time-travel paradoxes@footnote{Not to mention difficult
+implementation issues.}, neither @code{FUNCTAB} nor @code{SYMTAB}
+are available as elements within the @code{SYMTAB} array.
+@end quotation
@end table
@c ENDOFRANGE bvconi
@c ENDOFRANGE vbconi
@@ -15214,7 +15689,7 @@ output literally. The interpretation of @samp{\} and @samp{&} then becomes
as shown in @ref{table-sub-posix-92}.
@float Table,table-sub-posix-92
-@caption{1992 POSIX Rules for sub and gsub Escape Sequence Processing}
+@caption{1992 POSIX Rules for @code{sub()} and @code{gsub()} Escape Sequence Processing}
@c thanks to Karl Berry for formatting this table
@tex
\vbox{\bigskip
@@ -15283,7 +15758,7 @@ to produce a @samp{\} preceding the matched text. This is shown in
@ref{table-sub-proposed}.
@float Table,table-sub-proposed
-@caption{Proposed rules for sub and backslash}
+@caption{Proposed Rules For @code{sub()} And Backslash}
@tex
\vbox{\bigskip
% This table has lots of &'s and \'s, so unspecialize them.
@@ -15345,7 +15820,7 @@ by anything else is not special; the @samp{\} is placed straight into the output
These rules are presented in @ref{table-posix-sub}.
@float Table,table-posix-sub
-@caption{POSIX rules for @code{sub()} and @code{gsub()}}
+@caption{POSIX Rules For @code{sub()} And @code{gsub()}}
@tex
\vbox{\bigskip
% This table has lots of &'s and \'s, so unspecialize them.
@@ -15413,7 +15888,7 @@ appears in the generated text and the @samp{\} does not,
as shown in @ref{table-gensub-escapes}.
@float Table,table-gensub-escapes
-@caption{Escape Sequence Processing for @code{gensub()}}
+@caption{Escape Sequence Processing For @code{gensub()}}
@tex
\vbox{\bigskip
% This table has lots of &'s and \'s, so unspecialize them.
@@ -16253,8 +16728,8 @@ bitwise operations just described. They are:
@cindex @command{gawk}, bitwise operations in
@table @code
@cindex @code{and()} function (@command{gawk})
-@item and(@var{v1}, @var{v2})
-Return the bitwise AND of the values provided by @var{v1} and @var{v2}.
+@item and(@var{v1}, @var{v2} @r{[}, @r{@dots{}]})
+Return the bitwise AND of the arguments. There must be at least two.
@cindex @code{compl()} function (@command{gawk})
@item compl(@var{val})
@@ -16265,16 +16740,16 @@ Return the bitwise complement of @var{val}.
Return the value of @var{val}, shifted left by @var{count} bits.
@cindex @code{or()} function (@command{gawk})
-@item or(@var{v1}, @var{v2})
-Return the bitwise OR of the values provided by @var{v1} and @var{v2}.
+@item or(@var{v1}, @var{v2} @r{[}, @r{@dots{}]})
+Return the bitwise OR of the arguments. There must be at least two.
@cindex @code{rshift()} function (@command{gawk})
@item rshift(@var{val}, @var{count})
Return the value of @var{val}, shifted right by @var{count} bits.
@cindex @code{xor()} function (@command{gawk})
-@item xor(@var{v1}, @var{v2})
-Return the bitwise XOR of the values provided by @var{v1} and @var{v2}.
+@item xor(@var{v1}, @var{v2} @r{[}, @r{@dots{}]})
+Return the bitwise XOR of the arguments. There must be at least two.
@end table
For all of these functions, first the double precision floating-point value is
@@ -16839,6 +17314,47 @@ foo's i=1
top's i=10
@end example
+Besides scalar values (strings and numbers), you may also have
+local arrays. By using a parameter name as an array, @command{awk}
+treats it as an array, and it is local to the function.
+In addition, recursive calls create new arrays.
+Consider this example:
+
+@example
+function some_func(p1, a)
+@{
+ if (p1++ > 3)
+ return
+
+ a[p1] = p1
+
+ some_func(p1)
+
+ printf("At level %d, index %d %s found in a\n",
+ p1, (p1 - 1), (p1 - 1) in a ? "is" : "is not")
+ printf("At level %d, index %d %s found in a\n",
+ p1, p1, p1 in a ? "is" : "is not")
+ print ""
+@}
+
+BEGIN @{
+ some_func(1)
+@}
+@end example
+
+When run, this program produces the following output:
+
+@example
+At level 4, index 3 is not found in a
+At level 4, index 4 is found in a
+
+At level 3, index 2 is not found in a
+At level 3, index 3 is found in a
+
+At level 2, index 1 is not found in a
+At level 2, index 2 is found in a
+@end example
+
@node Pass By Value/Reference
@subsubsection Passing Function Arguments By Value Or By Reference
@@ -17444,1899 +17960,28 @@ for (i = 1; i <= n; i++)
@c ENDOFRANGE funcud
-@node Internationalization
-@chapter Internationalization with @command{gawk}
-
-Once upon a time, computer makers
-wrote software that worked only in English.
-Eventually, hardware and software vendors noticed that if their
-systems worked in the native languages of non-English-speaking
-countries, they were able to sell more systems.
-As a result, internationalization and localization
-of programs and software systems became a common practice.
-
-@c STARTOFRANGE inloc
-@cindex internationalization, localization
-@cindex @command{gawk}, internationalization and, See internationalization
-@cindex internationalization, localization, @command{gawk} and
-For many years, the ability to provide internationalization
-was largely restricted to programs written in C and C++.
-This @value{CHAPTER} describes the underlying library @command{gawk}
-uses for internationalization, as well as how
-@command{gawk} makes internationalization
-features available at the @command{awk} program level.
-Having internationalization available at the @command{awk} level
-gives software developers additional flexibility---they are no
-longer forced to write in C or C++ when internationalization is
-a requirement.
-
-@menu
-* I18N and L10N:: Internationalization and Localization.
-* Explaining gettext:: How GNU @code{gettext} works.
-* Programmer i18n:: Features for the programmer.
-* Translator i18n:: Features for the translator.
-* I18N Example:: A simple i18n example.
-* Gawk I18N:: @command{gawk} is also internationalized.
-@end menu
-
-@node I18N and L10N
-@section Internationalization and Localization
-
-@cindex internationalization
-@cindex localization, See internationalization@comma{} localization
-@cindex localization
-@dfn{Internationalization} means writing (or modifying) a program once,
-in such a way that it can use multiple languages without requiring
-further source-code changes.
-@dfn{Localization} means providing the data necessary for an
-internationalized program to work in a particular language.
-Most typically, these terms refer to features such as the language
-used for printing error messages, the language used to read
-responses, and information related to how numerical and
-monetary values are printed and read.
-
-@node Explaining gettext
-@section GNU @code{gettext}
-
-@cindex internationalizing a program
-@c STARTOFRANGE gettex
-@cindex @code{gettext} library
-The facilities in GNU @code{gettext} focus on messages; strings printed
-by a program, either directly or via formatting with @code{printf} or
-@code{sprintf()}.@footnote{For some operating systems, the @command{gawk}
-port doesn't support GNU @code{gettext}.
-Therefore, these features are not available
-if you are using one of those operating systems. Sorry.}
-
-@cindex portability, @code{gettext} library and
-When using GNU @code{gettext}, each application has its own
-@dfn{text domain}. This is a unique name, such as @samp{kpilot} or @samp{gawk},
-that identifies the application.
-A complete application may have multiple components---programs written
-in C or C++, as well as scripts written in @command{sh} or @command{awk}.
-All of the components use the same text domain.
-
-To make the discussion concrete, assume we're writing an application
-named @command{guide}. Internationalization consists of the
-following steps, in this order:
-
-@enumerate
-@item
-The programmer goes
-through the source for all of @command{guide}'s components
-and marks each string that is a candidate for translation.
-For example, @code{"`-F': option required"} is a good candidate for translation.
-A table with strings of option names is not (e.g., @command{gawk}'s
-@option{--profile} option should remain the same, no matter what the local
-language).
-
-@cindex @code{textdomain()} function (C library)
-@item
-The programmer indicates the application's text domain
-(@code{"guide"}) to the @code{gettext} library,
-by calling the @code{textdomain()} function.
-
-@cindex @code{.pot} files
-@cindex files, @code{.pot}
-@cindex portable object template files
-@cindex files, portable object template
-@item
-Messages from the application are extracted from the source code and
-collected into a portable object template file (@file{guide.pot}),
-which lists the strings and their translations.
-The translations are initially empty.
-The original (usually English) messages serve as the key for
-lookup of the translations.
-
-@cindex @code{.po} files
-@cindex files, @code{.po}
-@cindex portable object files
-@cindex files, portable object
-@item
-For each language with a translator, @file{guide.pot}
-is copied to a portable object file (@code{.po})
-and translations are created and shipped with the application.
-For example, there might be a @file{fr.po} for a French translation.
-
-@cindex @code{.mo} files
-@cindex files, @code{.mo}
-@cindex message object files
-@cindex files, message object
-@item
-Each language's @file{.po} file is converted into a binary
-message object (@file{.mo}) file.
-A message object file contains the original messages and their
-translations in a binary format that allows fast lookup of translations
-at runtime.
-
-@item
-When @command{guide} is built and installed, the binary translation files
-are installed in a standard place.
-
-@cindex @code{bindtextdomain()} function (C library)
-@item
-For testing and development, it is possible to tell @code{gettext}
-to use @file{.mo} files in a different directory than the standard
-one by using the @code{bindtextdomain()} function.
-
-@cindex @code{.mo} files, specifying directory of
-@cindex files, @code{.mo}, specifying directory of
-@cindex message object files, specifying directory of
-@cindex files, message object, specifying directory of
-@item
-At runtime, @command{guide} looks up each string via a call
-to @code{gettext()}. The returned string is the translated string
-if available, or the original string if not.
-
-@item
-If necessary, it is possible to access messages from a different
-text domain than the one belonging to the application, without
-having to switch the application's default text domain back
-and forth.
-@end enumerate
-
-@cindex @code{gettext()} function (C library)
-In C (or C++), the string marking and dynamic translation lookup
-are accomplished by wrapping each string in a call to @code{gettext()}:
-
-@example
-printf("%s", gettext("Don't Panic!\n"));
-@end example
-
-The tools that extract messages from source code pull out all
-strings enclosed in calls to @code{gettext()}.
-
-@cindex @code{_} (underscore), @code{_} C macro
-@cindex underscore (@code{_}), @code{_} C macro
-The GNU @code{gettext} developers, recognizing that typing
-@samp{gettext(@dots{})} over and over again is both painful and ugly to look
-at, use the macro @samp{_} (an underscore) to make things easier:
-
-@example
-/* In the standard header file: */
-#define _(str) gettext(str)
-
-/* In the program text: */
-printf("%s", _("Don't Panic!\n"));
-@end example
-
-@cindex internationalization, localization, locale categories
-@cindex @code{gettext} library, locale categories
-@cindex locale categories
-@noindent
-This reduces the typing overhead to just three extra characters per string
-and is considerably easier to read as well.
-
-There are locale @dfn{categories}
-for different types of locale-related information.
-The defined locale categories that @code{gettext} knows about are:
-
-@table @code
-@cindex @code{LC_MESSAGES} locale category
-@item LC_MESSAGES
-Text messages. This is the default category for @code{gettext}
-operations, but it is possible to supply a different one explicitly,
-if necessary. (It is almost never necessary to supply a different category.)
-
-@cindex sorting characters in different languages
-@cindex @code{LC_COLLATE} locale category
-@item LC_COLLATE
-Text-collation information; i.e., how different characters
-and/or groups of characters sort in a given language.
-
-@cindex @code{LC_CTYPE} locale category
-@item LC_CTYPE
-Character-type information (alphabetic, digit, upper- or lowercase, and
-so on).
-This information is accessed via the
-POSIX character classes in regular expressions,
-such as @code{/[[:alnum:]]/}
-(@pxref{Regexp Operators}).
-
-@cindex monetary information, localization
-@cindex currency symbols, localization
-@cindex @code{LC_MONETARY} locale category
-@item LC_MONETARY
-Monetary information, such as the currency symbol, and whether the
-symbol goes before or after a number.
-
-@cindex @code{LC_NUMERIC} locale category
-@item LC_NUMERIC
-Numeric information, such as which characters to use for the decimal
-point and the thousands separator.@footnote{Americans
-use a comma every three decimal places and a period for the decimal
-point, while many Europeans do exactly the opposite:
-1,234.56 versus 1.234,56.}
-
-@cindex @code{LC_RESPONSE} locale category
-@item LC_RESPONSE
-Response information, such as how ``yes'' and ``no'' appear in the
-local language, and possibly other information as well.
-
-@cindex time, localization and
-@cindex dates, information related to@comma{} localization
-@cindex @code{LC_TIME} locale category
-@item LC_TIME
-Time- and date-related information, such as 12- or 24-hour clock, month printed
-before or after the day in a date, local month abbreviations, and so on.
-
-@cindex @code{LC_ALL} locale category
-@item LC_ALL
-All of the above. (Not too useful in the context of @code{gettext}.)
-@end table
-@c ENDOFRANGE gettex
-
-@node Programmer i18n
-@section Internationalizing @command{awk} Programs
-@c STARTOFRANGE inap
-@cindex @command{awk} programs, internationalizing
-
-@command{gawk} provides the following variables and functions for
-internationalization:
-
-@table @code
-@cindex @code{TEXTDOMAIN} variable
-@item TEXTDOMAIN
-This variable indicates the application's text domain.
-For compatibility with GNU @code{gettext}, the default
-value is @code{"messages"}.
-
-@cindex internationalization, localization, marked strings
-@cindex strings, for localization
-@item _"your message here"
-String constants marked with a leading underscore
-are candidates for translation at runtime.
-String constants without a leading underscore are not translated.
-
-@cindex @code{dcgettext()} function (@command{gawk})
-@item dcgettext(@var{string} @r{[}, @var{domain} @r{[}, @var{category}@r{]]})
-Return the translation of @var{string} in
-text domain @var{domain} for locale category @var{category}.
-The default value for @var{domain} is the current value of @code{TEXTDOMAIN}.
-The default value for @var{category} is @code{"LC_MESSAGES"}.
-
-If you supply a value for @var{category}, it must be a string equal to
-one of the known locale categories described in
-@ifnotinfo
-the previous @value{SECTION}.
-@end ifnotinfo
-@ifinfo
-@ref{Explaining gettext}.
-@end ifinfo
-You must also supply a text domain. Use @code{TEXTDOMAIN} if
-you want to use the current domain.
-
-@quotation CAUTION
-The order of arguments to the @command{awk} version
-of the @code{dcgettext()} function is purposely different from the order for
-the C version. The @command{awk} version's order was
-chosen to be simple and to allow for reasonable @command{awk}-style
-default arguments.
-@end quotation
-
-@cindex @code{dcngettext()} function (@command{gawk})
-@item dcngettext(@var{string1}, @var{string2}, @var{number} @r{[}, @var{domain} @r{[}, @var{category}@r{]]})
-Return the plural form used for @var{number} of the
-translation of @var{string1} and @var{string2} in text domain
-@var{domain} for locale category @var{category}. @var{string1} is the
-English singular variant of a message, and @var{string2} the English plural
-variant of the same message.
-The default value for @var{domain} is the current value of @code{TEXTDOMAIN}.
-The default value for @var{category} is @code{"LC_MESSAGES"}.
-
-The same remarks about argument order as for the @code{dcgettext()} function apply.
-
-@cindex @code{.mo} files, specifying directory of
-@cindex files, @code{.mo}, specifying directory of
-@cindex message object files, specifying directory of
-@cindex files, message object, specifying directory of
-@cindex @code{bindtextdomain()} function (@command{gawk})
-@item bindtextdomain(@var{directory} @r{[}, @var{domain}@r{]})
-Change the directory in which
-@code{gettext} looks for @file{.mo} files, in case they
-will not or cannot be placed in the standard locations
-(e.g., during testing).
-Return the directory in which @var{domain} is ``bound.''
-
-The default @var{domain} is the value of @code{TEXTDOMAIN}.
-If @var{directory} is the null string (@code{""}), then
-@code{bindtextdomain()} returns the current binding for the
-given @var{domain}.
-@end table
-
-To use these facilities in your @command{awk} program, follow the steps
-outlined in
-@ifnotinfo
-the previous @value{SECTION},
-@end ifnotinfo
-@ifinfo
-@ref{Explaining gettext},
-@end ifinfo
-like so:
-
-@enumerate
-@cindex @code{BEGIN} pattern, @code{TEXTDOMAIN} variable and
-@cindex @code{TEXTDOMAIN} variable, @code{BEGIN} pattern and
-@item
-Set the variable @code{TEXTDOMAIN} to the text domain of
-your program. This is best done in a @code{BEGIN} rule
-(@pxref{BEGIN/END}),
-or it can also be done via the @option{-v} command-line
-option (@pxref{Options}):
-
-@example
-BEGIN @{
- TEXTDOMAIN = "guide"
- @dots{}
-@}
-@end example
-
-@cindex @code{_} (underscore), translatable string
-@cindex underscore (@code{_}), translatable string
-@item
-Mark all translatable strings with a leading underscore (@samp{_})
-character. It @emph{must} be adjacent to the opening
-quote of the string. For example:
-
-@example
-print _"hello, world"
-x = _"you goofed"
-printf(_"Number of users is %d\n", nusers)
-@end example
-
-@item
-If you are creating strings dynamically, you can
-still translate them, using the @code{dcgettext()}
-built-in function:
-
-@example
-message = nusers " users logged in"
-message = dcgettext(message, "adminprog")
-print message
-@end example
-
-Here, the call to @code{dcgettext()} supplies a different
-text domain (@code{"adminprog"}) in which to find the
-message, but it uses the default @code{"LC_MESSAGES"} category.
-
-@cindex @code{LC_MESSAGES} locale category, @code{bindtextdomain()} function (@command{gawk})
-@item
-During development, you might want to put the @file{.mo}
-file in a private directory for testing. This is done
-with the @code{bindtextdomain()} built-in function:
-
-@example
-BEGIN @{
- TEXTDOMAIN = "guide" # our text domain
- if (Testing) @{
- # where to find our files
- bindtextdomain("testdir")
- # joe is in charge of adminprog
- bindtextdomain("../joe/testdir", "adminprog")
- @}
- @dots{}
-@}
-@end example
-
-@end enumerate
-
-@xref{I18N Example},
-for an example program showing the steps to create
-and use translations from @command{awk}.
-
-@node Translator i18n
-@section Translating @command{awk} Programs
-
-@cindex @code{.po} files
-@cindex files, @code{.po}
-@cindex portable object files
-@cindex files, portable object
-Once a program's translatable strings have been marked, they must
-be extracted to create the initial @file{.po} file.
-As part of translation, it is often helpful to rearrange the order
-in which arguments to @code{printf} are output.
-
-@command{gawk}'s @option{--gen-pot} command-line option extracts
-the messages and is discussed next.
-After that, @code{printf}'s ability to
-rearrange the order for @code{printf} arguments at runtime
-is covered.
-
-@menu
-* String Extraction:: Extracting marked strings.
-* Printf Ordering:: Rearranging @code{printf} arguments.
-* I18N Portability:: @command{awk}-level portability issues.
-@end menu
-
-@node String Extraction
-@subsection Extracting Marked Strings
-@cindex strings, extracting
-@cindex marked strings@comma{} extracting
-@cindex @code{--gen-pot} option
-@cindex command-line options, string extraction
-@cindex string extraction (internationalization)
-@cindex marked string extraction (internationalization)
-@cindex extraction, of marked strings (internationalization)
-
-@cindex @code{--gen-pot} option
-Once your @command{awk} program is working, and all the strings have
-been marked and you've set (and perhaps bound) the text domain,
-it is time to produce translations.
-First, use the @option{--gen-pot} command-line option to create
-the initial @file{.pot} file:
-
-@example
-$ @kbd{gawk --gen-pot -f guide.awk > guide.pot}
-@end example
-
-@cindex @code{xgettext} utility
-When run with @option{--gen-pot}, @command{gawk} does not execute your
-program. Instead, it parses it as usual and prints all marked strings
-to standard output in the format of a GNU @code{gettext} Portable Object
-file. Also included in the output are any constant strings that
-appear as the first argument to @code{dcgettext()} or as the first and
-second argument to @code{dcngettext()}.@footnote{The
-@command{xgettext} utility that comes with GNU
-@code{gettext} can handle @file{.awk} files.}
-@xref{I18N Example},
-for the full list of steps to go through to create and test
-translations for @command{guide}.
-
-@node Printf Ordering
-@subsection Rearranging @code{printf} Arguments
-
-@cindex @code{printf} statement, positional specifiers
-@cindex positional specifiers, @code{printf} statement
-Format strings for @code{printf} and @code{sprintf()}
-(@pxref{Printf})
-present a special problem for translation.
-Consider the following:@footnote{This example is borrowed
-from the GNU @code{gettext} manual.}
-
-@c line broken here only for smallbook format
-@example
-printf(_"String `%s' has %d characters\n",
- string, length(string)))
-@end example
-
-A possible German translation for this might be:
-
-@example
-"%d Zeichen lang ist die Zeichenkette `%s'\n"
-@end example
-
-The problem should be obvious: the order of the format
-specifications is different from the original!
-Even though @code{gettext()} can return the translated string
-at runtime,
-it cannot change the argument order in the call to @code{printf}.
-
-To solve this problem, @code{printf} format specifiers may have
-an additional optional element, which we call a @dfn{positional specifier}.
-For example:
-
-@example
-"%2$d Zeichen lang ist die Zeichenkette `%1$s'\n"
-@end example
-
-Here, the positional specifier consists of an integer count, which indicates which
-argument to use, and a @samp{$}. Counts are one-based, and the
-format string itself is @emph{not} included. Thus, in the following
-example, @samp{string} is the first argument and @samp{length(string)} is the second:
-
-@example
-$ @kbd{gawk 'BEGIN @{}
-> @kbd{string = "Dont Panic"}
-> @kbd{printf _"%2$d characters live in \"%1$s\"\n",}
-> @kbd{string, length(string)}
-> @kbd{@}'}
-@print{} 10 characters live in "Dont Panic"
-@end example
-
-If present, positional specifiers come first in the format specification,
-before the flags, the field width, and/or the precision.
-
-Positional specifiers can be used with the dynamic field width and
-precision capability:
-
-@example
-$ @kbd{gawk 'BEGIN @{}
-> @kbd{printf("%*.*s\n", 10, 20, "hello")}
-> @kbd{printf("%3$*2$.*1$s\n", 20, 10, "hello")}
-> @kbd{@}'}
-@print{} hello
-@print{} hello
-@end example
-
-@quotation NOTE
-When using @samp{*} with a positional specifier, the @samp{*}
-comes first, then the integer position, and then the @samp{$}.
-This is somewhat counterintuitive.
-@end quotation
-
-@cindex @code{printf} statement, positional specifiers, mixing with regular formats
-@cindex positional specifiers, @code{printf} statement, mixing with regular formats
-@cindex format specifiers, mixing regular with positional specifiers
-@command{gawk} does not allow you to mix regular format specifiers
-and those with positional specifiers in the same string:
-
-@example
-$ @kbd{gawk 'BEGIN @{ printf _"%d %3$s\n", 1, 2, "hi" @}'}
-@error{} gawk: cmd. line:1: fatal: must use `count$' on all formats or none
-@end example
-
-@quotation NOTE
-There are some pathological cases that @command{gawk} may fail to
-diagnose. In such cases, the output may not be what you expect.
-It's still a bad idea to try mixing them, even if @command{gawk}
-doesn't detect it.
-@end quotation
-
-Although positional specifiers can be used directly in @command{awk} programs,
-their primary purpose is to help in producing correct translations of
-format strings into languages different from the one in which the program
-is first written.
-
-@node I18N Portability
-@subsection @command{awk} Portability Issues
-
-@cindex portability, internationalization and
-@cindex internationalization, localization, portability and
-@command{gawk}'s internationalization features were purposely chosen to
-have as little impact as possible on the portability of @command{awk}
-programs that use them to other versions of @command{awk}.
-Consider this program:
-
-@example
-BEGIN @{
- TEXTDOMAIN = "guide"
- if (Test_Guide) # set with -v
- bindtextdomain("/test/guide/messages")
- print _"don't panic!"
-@}
-@end example
-
-@noindent
-As written, it won't work on other versions of @command{awk}.
-However, it is actually almost portable, requiring very little
-change:
-
-@itemize @bullet
-@cindex @code{TEXTDOMAIN} variable, portability and
-@item
-Assignments to @code{TEXTDOMAIN} won't have any effect,
-since @code{TEXTDOMAIN} is not special in other @command{awk} implementations.
-
-@item
-Non-GNU versions of @command{awk} treat marked strings
-as the concatenation of a variable named @code{_} with the string
-following it.@footnote{This is good fodder for an ``Obfuscated
-@command{awk}'' contest.} Typically, the variable @code{_} has
-the null string (@code{""}) as its value, leaving the original string constant as
-the result.
-
-@item
-By defining ``dummy'' functions to replace @code{dcgettext()}, @code{dcngettext()}
-and @code{bindtextdomain()}, the @command{awk} program can be made to run, but
-all the messages are output in the original language.
-For example:
-
-@cindex @code{bindtextdomain()} function (@command{gawk}), portability and
-@cindex @code{dcgettext()} function (@command{gawk}), portability and
-@cindex @code{dcngettext()} function (@command{gawk}), portability and
-@example
-@c file eg/lib/libintl.awk
-function bindtextdomain(dir, domain)
-@{
- return dir
-@}
-
-function dcgettext(string, domain, category)
-@{
- return string
-@}
-
-function dcngettext(string1, string2, number, domain, category)
-@{
- return (number == 1 ? string1 : string2)
-@}
-@c endfile
-@end example
-
-@item
-The use of positional specifications in @code{printf} or
-@code{sprintf()} is @emph{not} portable.
-To support @code{gettext()} at the C level, many systems' C versions of
-@code{sprintf()} do support positional specifiers. But it works only if
-enough arguments are supplied in the function call. Many versions of
-@command{awk} pass @code{printf} formats and arguments unchanged to the
-underlying C library version of @code{sprintf()}, but only one format and
-argument at a time. What happens if a positional specification is
-used is anybody's guess.
-However, since the positional specifications are primarily for use in
-@emph{translated} format strings, and since non-GNU @command{awk}s never
-retrieve the translated string, this should not be a problem in practice.
-@end itemize
-@c ENDOFRANGE inap
-
-@node I18N Example
-@section A Simple Internationalization Example
-
-Now let's look at a step-by-step example of how to internationalize and
-localize a simple @command{awk} program, using @file{guide.awk} as our
-original source:
-
-@example
-@c file eg/prog/guide.awk
-BEGIN @{
- TEXTDOMAIN = "guide"
- bindtextdomain(".") # for testing
- print _"Don't Panic"
- print _"The Answer Is", 42
- print "Pardon me, Zaphod who?"
-@}
-@c endfile
-@end example
-
-@noindent
-Run @samp{gawk --gen-pot} to create the @file{.pot} file:
-
-@example
-$ @kbd{gawk --gen-pot -f guide.awk > guide.pot}
-@end example
-
-@noindent
-This produces:
-
-@example
-@c file eg/data/guide.po
-#: guide.awk:4
-msgid "Don't Panic"
-msgstr ""
-
-#: guide.awk:5
-msgid "The Answer Is"
-msgstr ""
-
-@c endfile
-@end example
-
-This original portable object template file is saved and reused for each language
-into which the application is translated. The @code{msgid}
-is the original string and the @code{msgstr} is the translation.
-
-@quotation NOTE
-Strings not marked with a leading underscore do not
-appear in the @file{guide.pot} file.
-@end quotation
-
-Next, the messages must be translated.
-Here is a translation to a hypothetical dialect of English,
-called ``Mellow'':@footnote{Perhaps it would be better if it were
-called ``Hippy.'' Ah, well.}
-
-@example
-@group
-$ cp guide.pot guide-mellow.po
-@var{Add translations to} guide-mellow.po @dots{}
-@end group
-@end example
-
-@noindent
-Following are the translations:
-
-@example
-@c file eg/data/guide-mellow.po
-#: guide.awk:4
-msgid "Don't Panic"
-msgstr "Hey man, relax!"
-
-#: guide.awk:5
-msgid "The Answer Is"
-msgstr "Like, the scoop is"
-
-@c endfile
-@end example
-
-@cindex Linux
-@cindex GNU/Linux
-The next step is to make the directory to hold the binary message object
-file and then to create the @file{guide.mo} file.
-The directory layout shown here is standard for GNU @code{gettext} on
-GNU/Linux systems. Other versions of @code{gettext} may use a different
-layout:
-
-@example
-$ @kbd{mkdir en_US en_US/LC_MESSAGES}
-@end example
-
-@cindex @code{.po} files, converting to @code{.mo}
-@cindex files, @code{.po}, converting to @code{.mo}
-@cindex @code{.mo} files, converting from @code{.po}
-@cindex files, @code{.mo}, converting from @code{.po}
-@cindex portable object files, converting to message object files
-@cindex files, portable object, converting to message object files
-@cindex message object files, converting from portable object files
-@cindex files, message object, converting from portable object files
-@cindex @command{msgfmt} utility
-The @command{msgfmt} utility does the conversion from human-readable
-@file{.po} file to machine-readable @file{.mo} file.
-By default, @command{msgfmt} creates a file named @file{messages}.
-This file must be renamed and placed in the proper directory so that
-@command{gawk} can find it:
-
-@example
-$ @kbd{msgfmt guide-mellow.po}
-$ @kbd{mv messages en_US/LC_MESSAGES/guide.mo}
-@end example
-
-Finally, we run the program to test it:
-
-@example
-$ @kbd{gawk -f guide.awk}
-@print{} Hey man, relax!
-@print{} Like, the scoop is 42
-@print{} Pardon me, Zaphod who?
-@end example
-
-If the three replacement functions for @code{dcgettext()}, @code{dcngettext()}
-and @code{bindtextdomain()}
-(@pxref{I18N Portability})
-are in a file named @file{libintl.awk},
-then we can run @file{guide.awk} unchanged as follows:
-
-@example
-$ @kbd{gawk --posix -f guide.awk -f libintl.awk}
-@print{} Don't Panic
-@print{} The Answer Is 42
-@print{} Pardon me, Zaphod who?
-@end example
-
-@node Gawk I18N
-@section @command{gawk} Can Speak Your Language
-
-@command{gawk} itself has been internationalized
-using the GNU @code{gettext} package.
-(GNU @code{gettext} is described in
-complete detail in
-@ifinfo
-@inforef{Top, , GNU @code{gettext} utilities, gettext, GNU gettext tools}.)
-@end ifinfo
-@ifnotinfo
-@cite{GNU gettext tools}.)
-@end ifnotinfo
-As of this writing, the latest version of GNU @code{gettext} is
-@uref{ftp://ftp.gnu.org/gnu/gettext/gettext-0.18.1.tar.gz, @value{PVERSION} 0.18.1}.
-
-If a translation of @command{gawk}'s messages exists,
-then @command{gawk} produces usage messages, warnings,
-and fatal errors in the local language.
-@c ENDOFRANGE inloc
+@iftex
+@part Part II:@* Problem Solving With @command{awk}
+@end iftex
-@node Advanced Features
-@chapter Advanced Features of @command{gawk}
-@cindex advanced features, network connections, See Also networks, connections
-@c STARTOFRANGE gawadv
-@cindex @command{gawk}, features, advanced
-@c STARTOFRANGE advgaw
-@cindex advanced features, @command{gawk}
@ignore
-Contributed by: Peter Langston <pud!psl@bellcore.bellcore.com>
-
- Found in Steve English's "signature" line:
-
-"Write documentation as if whoever reads it is a violent psychopath
-who knows where you live."
-@end ignore
-@quotation
-@i{Write documentation as if whoever reads it is
-a violent psychopath who knows where you live.}@*
-Steve English, as quoted by Peter Langston
-@end quotation
-
-This @value{CHAPTER} discusses advanced features in @command{gawk}.
-It's a bit of a ``grab bag'' of items that are otherwise unrelated
-to each other.
-First, a command-line option allows @command{gawk} to recognize
-nondecimal numbers in input data, not just in @command{awk}
-programs.
-Then, @command{gawk}'s special features for sorting arrays are presented.
-Next, two-way I/O, discussed briefly in earlier parts of this
-@value{DOCUMENT}, is described in full detail, along with the basics
-of TCP/IP networking. Finally, @command{gawk}
-can @dfn{profile} an @command{awk} program, making it possible to tune
-it for performance.
-
-@ref{Dynamic Extensions},
-discusses the ability to dynamically add new built-in functions to
-@command{gawk}. As this feature is still immature and likely to change,
-its description is relegated to an appendix.
-
-@menu
-* Nondecimal Data:: Allowing nondecimal input data.
-* Array Sorting:: Facilities for controlling array traversal and
- sorting arrays.
-* Two-way I/O:: Two-way communications with another process.
-* TCP/IP Networking:: Using @command{gawk} for network programming.
-* Profiling:: Profiling your @command{awk} programs.
-@end menu
-
-@node Nondecimal Data
-@section Allowing Nondecimal Input Data
-@cindex @code{--non-decimal-data} option
-@cindex advanced features, @command{gawk}, nondecimal input data
-@cindex input, data@comma{} nondecimal
-@cindex constants, nondecimal
-
-If you run @command{gawk} with the @option{--non-decimal-data} option,
-you can have nondecimal constants in your input data:
-
-@c line break here for small book format
-@example
-$ @kbd{echo 0123 123 0x123 |}
-> @kbd{gawk --non-decimal-data '@{ printf "%d, %d, %d\n",}
-> @kbd{$1, $2, $3 @}'}
-@print{} 83, 123, 291
-@end example
-
-For this feature to work, write your program so that
-@command{gawk} treats your data as numeric:
-
-@example
-$ @kbd{echo 0123 123 0x123 | gawk '@{ print $1, $2, $3 @}'}
-@print{} 0123 123 0x123
-@end example
-
-@noindent
-The @code{print} statement treats its expressions as strings.
-Although the fields can act as numbers when necessary,
-they are still strings, so @code{print} does not try to treat them
-numerically. You may need to add zero to a field to force it to
-be treated as a number. For example:
-
-@example
-$ @kbd{echo 0123 123 0x123 | gawk --non-decimal-data '}
-> @kbd{@{ print $1, $2, $3}
-> @kbd{print $1 + 0, $2 + 0, $3 + 0 @}'}
-@print{} 0123 123 0x123
-@print{} 83 123 291
-@end example
-
-Because it is common to have decimal data with leading zeros, and because
-using this facility could lead to surprising results, the default is to leave it
-disabled. If you want it, you must explicitly request it.
-
-@cindex programming conventions, @code{--non-decimal-data} option
-@cindex @code{--non-decimal-data} option, @code{strtonum()} function and
-@cindex @code{strtonum()} function (@command{gawk}), @code{--non-decimal-data} option and
-@quotation CAUTION
-@emph{Use of this option is not recommended.}
-It can break old programs very badly.
-Instead, use the @code{strtonum()} function to convert your data
-(@pxref{Nondecimal-numbers}).
-This makes your programs easier to write and easier to read, and
-leads to less surprising results.
-@end quotation
-
-@node Array Sorting
-@section Controlling Array Traversal and Array Sorting
-
-@command{gawk} lets you control the order in which a @samp{for (i in array)}
-loop traverses an array.
-
-In addition, two built-in functions, @code{asort()} and @code{asorti()},
-let you sort arrays based on the array values and indices, respectively.
-These two functions also provide control over the sorting criteria used
-to order the elements during sorting.
-
-@menu
-* Controlling Array Traversal:: How to use PROCINFO["sorted_in"].
-* Array Sorting Functions:: How to use @code{asort()} and @code{asorti()}.
-@end menu
-
-@node Controlling Array Traversal
-@subsection Controlling Array Traversal
-
-By default, the order in which a @samp{for (i in array)} loop
-scans an array is not defined; it is generally based upon
-the internal implementation of arrays inside @command{awk}.
-
-Often, though, it is desirable to be able to loop over the elements
-in a particular order that you, the programmer, choose. @command{gawk}
-lets you do this.
-
-@ref{Controlling Scanning}, describes how you can assign special,
-pre-defined values to @code{PROCINFO["sorted_in"]} in order to
-control the order in which @command{gawk} will traverse an array
-during a @code{for} loop.
-
-In addition, the value of @code{PROCINFO["sorted_in"]} can be a function name.
-This lets you traverse an array based on any custom criterion.
-The array elements are ordered according to the return value of this
-function. The comparison function should be defined with at least
-four arguments:
-
-@example
-function comp_func(i1, v1, i2, v2)
-@{
- @var{compare elements 1 and 2 in some fashion}
- @var{return < 0; 0; or > 0}
-@}
-@end example
-
-Here, @var{i1} and @var{i2} are the indices, and @var{v1} and @var{v2}
-are the corresponding values of the two elements being compared.
-Either @var{v1} or @var{v2}, or both, can be arrays if the array being
-traversed contains subarrays as values.
-(@xref{Arrays of Arrays}, for more information about subarrays.)
-The three possible return values are interpreted as follows:
-
-@table @code
-@item comp_func(i1, v1, i2, v2) < 0
-Index @var{i1} comes before index @var{i2} during loop traversal.
-
-@item comp_func(i1, v1, i2, v2) == 0
-Indices @var{i1} and @var{i2}
-come together but the relative order with respect to each other is undefined.
-
-@item comp_func(i1, v1, i2, v2) > 0
-Index @var{i1} comes after index @var{i2} during loop traversal.
-@end table
-
-Our first comparison function can be used to scan an array in
-numerical order of the indices:
-
-@example
-function cmp_num_idx(i1, v1, i2, v2)
-@{
- # numerical index comparison, ascending order
- return (i1 - i2)
-@}
-@end example
-
-Our second function traverses an array based on the string order of
-the element values rather than by indices:
-
-@example
-function cmp_str_val(i1, v1, i2, v2)
-@{
- # string value comparison, ascending order
- v1 = v1 ""
- v2 = v2 ""
- if (v1 < v2)
- return -1
- return (v1 != v2)
-@}
-@end example
-
-The third
-comparison function makes all numbers, and numeric strings without
-any leading or trailing spaces, come out first during loop traversal:
-
-@example
-function cmp_num_str_val(i1, v1, i2, v2, n1, n2)
-@{
- # numbers before string value comparison, ascending order
- n1 = v1 + 0
- n2 = v2 + 0
- if (n1 == v1)
- return (n2 == v2) ? (n1 - n2) : -1
- else if (n2 == v2)
- return 1
- return (v1 < v2) ? -1 : (v1 != v2)
-@}
-@end example
-
-Here is a main program to demonstrate how @command{gawk}
-behaves using each of the previous functions:
-
-@example
-BEGIN @{
- data["one"] = 10
- data["two"] = 20
- data[10] = "one"
- data[100] = 100
- data[20] = "two"
-
- f[1] = "cmp_num_idx"
- f[2] = "cmp_str_val"
- f[3] = "cmp_num_str_val"
- for (i = 1; i <= 3; i++) @{
- printf("Sort function: %s\n", f[i])
- PROCINFO["sorted_in"] = f[i]
- for (j in data)
- printf("\tdata[%s] = %s\n", j, data[j])
- print ""
- @}
-@}
-@end example
-
-Here are the results when the program is run:
-@page
-
-@example
-$ @kbd{gawk -f compdemo.awk}
-@print{} Sort function: cmp_num_idx @ii{Sort by numeric index}
-@print{} data[two] = 20
-@print{} data[one] = 10 @ii{Both strings are numerically zero}
-@print{} data[10] = one
-@print{} data[20] = two
-@print{} data[100] = 100
-@print{}
-@print{} Sort function: cmp_str_val @ii{Sort by element values as strings}
-@print{} data[one] = 10
-@print{} data[100] = 100 @ii{String 100 is less than string 20}
-@print{} data[two] = 20
-@print{} data[10] = one
-@print{} data[20] = two
-@print{}
-@print{} Sort function: cmp_num_str_val @ii{Sort all numeric values before all strings}
-@print{} data[one] = 10
-@print{} data[two] = 20
-@print{} data[100] = 100
-@print{} data[10] = one
-@print{} data[20] = two
-@end example
-
-Consider sorting the entries of a GNU/Linux system password file
-according to login name. The following program sorts records
-by a specific field position and can be used for this purpose:
-
-@example
-# sort.awk --- simple program to sort by field position
-# field position is specified by the global variable POS
-
-function cmp_field(i1, v1, i2, v2)
-@{
- # comparison by value, as string, and ascending order
- return v1[POS] < v2[POS] ? -1 : (v1[POS] != v2[POS])
-@}
-
-@{
- for (i = 1; i <= NF; i++)
- a[NR][i] = $i
-@}
-
-END @{
- PROCINFO["sorted_in"] = "cmp_field"
- if (POS < 1 || POS > NF)
- POS = 1
- for (i in a) @{
- for (j = 1; j <= NF; j++)
- printf("%s%c", a[i][j], j < NF ? ":" : "")
- print ""
- @}
-@}
-@end example
-
-The first field in each entry of the password file is the user's login name,
-and the fields are separated by colons.
-Each record defines a subarray,
-with each field as an element in the subarray.
-Running the program produces the
-following output:
-
-@example
-$ @kbd{gawk -vPOS=1 -F: -f sort.awk /etc/passwd}
-@print{} adm:x:3:4:adm:/var/adm:/sbin/nologin
-@print{} apache:x:48:48:Apache:/var/www:/sbin/nologin
-@print{} avahi:x:70:70:Avahi daemon:/:/sbin/nologin
-@dots{}
-@end example
-
-The comparison should normally always return the same value when given a
-specific pair of array elements as its arguments. If inconsistent
-results are returned then the order is undefined. This behavior can be
-exploited to introduce random order into otherwise seemingly
-ordered data:
-
-@example
-function cmp_randomize(i1, v1, i2, v2)
-@{
- # random order
- return (2 - 4 * rand())
-@}
-@end example
-
-As mentioned above, the order of the indices is arbitrary if two
-elements compare equal. This is usually not a problem, but letting
-the tied elements come out in arbitrary order can be an issue, especially
-when comparing item values. The partial ordering of the equal elements
-may change during the next loop traversal, if other elements are added or
-removed from the array. One way to resolve ties when comparing elements
-with otherwise equal values is to include the indices in the comparison
-rules. Note that doing this may make the loop traversal less efficient,
-so consider it only if necessary. The following comparison functions
-force a deterministic order, and are based on the fact that the
-indices of two elements are never equal:
-
-@example
-function cmp_numeric(i1, v1, i2, v2)
-@{
- # numerical value (and index) comparison, descending order
- return (v1 != v2) ? (v2 - v1) : (i2 - i1)
-@}
-
-function cmp_string(i1, v1, i2, v2)
-@{
- # string value (and index) comparison, descending order
- v1 = v1 i1
- v2 = v2 i2
- return (v1 > v2) ? -1 : (v1 != v2)
-@}
-@end example
-
-@c Avoid using the term ``stable'' when describing the unpredictable behavior
-@c if two items compare equal. Usually, the goal of a "stable algorithm"
-@c is to maintain the original order of the items, which is a meaningless
-@c concept for a list constructed from a hash.
-
-A custom comparison function can often simplify ordered loop
-traversal, and the sky is really the limit when it comes to
-designing such a function.
-
-When string comparisons are made during a sort, either for element
-values where one or both aren't numbers, or for element indices
-handled as strings, the value of @code{IGNORECASE}
-(@pxref{Built-in Variables}) controls whether
-the comparisons treat corresponding uppercase and lowercase letters as
-equivalent or distinct.
-
-Another point to keep in mind is that in the case of subarrays
-the element values can themselves be arrays; a production comparison
-function should use the @code{isarray()} function
-(@pxref{Type Functions}),
-to check for this, and choose a defined sorting order for subarrays.
-
-All sorting based on @code{PROCINFO["sorted_in"]}
-is disabled in POSIX mode,
-since the @code{PROCINFO} array is not special in that case.
-
-As a side note, sorting the array indices before traversing
-the array has been reported to add 15% to 20% overhead to the
-execution time of @command{awk} programs. For this reason,
-sorted array traversal is not the default.
-
-@c The @command{gawk}
-@c maintainers believe that only the people who wish to use a
-@c feature should have to pay for it.
-
-@node Array Sorting Functions
-@subsection Sorting Array Values and Indices with @command{gawk}
-
-@cindex arrays, sorting
-@cindex @code{asort()} function (@command{gawk})
-@cindex @code{asort()} function (@command{gawk}), arrays@comma{} sorting
-@cindex sort function, arrays, sorting
-In most @command{awk} implementations, sorting an array requires
-writing a @code{sort()} function.
-While this can be educational for exploring different sorting algorithms,
-usually that's not the point of the program.
-@command{gawk} provides the built-in @code{asort()}
-and @code{asorti()} functions
-(@pxref{String Functions})
-for sorting arrays. For example:
-
-@example
-@var{populate the array} data
-n = asort(data)
-for (i = 1; i <= n; i++)
- @var{do something with} data[i]
-@end example
-
-After the call to @code{asort()}, the array @code{data} is indexed from 1
-to some number @var{n}, the total number of elements in @code{data}.
-(This count is @code{asort()}'s return value.)
-@code{data[1]} @value{LEQ} @code{data[2]} @value{LEQ} @code{data[3]}, and so on.
-The comparison is based on the type of the elements
-(@pxref{Typing and Comparison}).
-All numeric values come before all string values,
-which in turn come before all subarrays.
-
-@cindex side effects, @code{asort()} function
-An important side effect of calling @code{asort()} is that
-@emph{the array's original indices are irrevocably lost}.
-As this isn't always desirable, @code{asort()} accepts a
-second argument:
-
-@example
-@var{populate the array} source
-n = asort(source, dest)
-for (i = 1; i <= n; i++)
- @var{do something with} dest[i]
-@end example
-
-In this case, @command{gawk} copies the @code{source} array into the
-@code{dest} array and then sorts @code{dest}, destroying its indices.
-However, the @code{source} array is not affected.
-
-@code{asort()} accepts a third string argument to control comparison of
-array elements. As with @code{PROCINFO["sorted_in"]}, this argument
-may be one of the predefined names that @command{gawk} provides
-(@pxref{Controlling Scanning}), or the name of a user-defined function
-(@pxref{Controlling Array Traversal}).
-
-@quotation NOTE
-In all cases, the sorted element values consist of the original
-array's element values. The ability to control comparison merely
-affects the way in which they are sorted.
-@end quotation
-
-Often, what's needed is to sort on the values of the @emph{indices}
-instead of the values of the elements.
-To do that, use the
-@code{asorti()} function. The interface is identical to that of
-@code{asort()}, except that the index values are used for sorting, and
-become the values of the result array:
-
-@example
-@{ source[$0] = some_func($0) @}
-
-END @{
- n = asorti(source, dest)
- for (i = 1; i <= n; i++) @{
- @ii{Work with sorted indices directly:}
- @var{do something with} dest[i]
- @dots{}
- @ii{Access original array via sorted indices:}
- @var{do something with} source[dest[i]]
- @}
-@}
-@end example
-
-Similar to @code{asort()},
-in all cases, the sorted element values consist of the original
-array's indices. The ability to control comparison merely
-affects the way in which they are sorted.
-
-Sorting the array by replacing the indices provides maximal flexibility.
-To traverse the elements in decreasing order, use a loop that goes from
-@var{n} down to 1, either over the elements or over the indices.@footnote{You
-may also use one of the predefined sorting names that sorts in
-decreasing order.}
-
-@cindex reference counting, sorting arrays
-Copying array indices and elements isn't expensive in terms of memory.
-Internally, @command{gawk} maintains @dfn{reference counts} to data.
-For example, when @code{asort()} copies the first array to the second one,
-there is only one copy of the original array elements' data, even though
-both arrays use the values.
-
-@c Document It And Call It A Feature. Sigh.
-@cindex @command{gawk}, @code{IGNORECASE} variable in
-@cindex @code{IGNORECASE} variable
-@cindex arrays, sorting, @code{IGNORECASE} variable and
-@cindex @code{IGNORECASE} variable, array sorting and
-Because @code{IGNORECASE} affects string comparisons, the value
-of @code{IGNORECASE} also affects sorting for both @code{asort()} and @code{asorti()}.
-Note also that the locale's sorting order does @emph{not}
-come into play; comparisons are based on character values only.@footnote{This
-is true because locale-based comparison occurs only when in POSIX
-compatibility mode, and since @code{asort()} and @code{asorti()} are
-@command{gawk} extensions, they are not available in that case.}
-Caveat Emptor.
-
-@node Two-way I/O
-@section Two-Way Communications with Another Process
-@cindex Brennan, Michael
-@cindex programmers, attractiveness of
-@smallexample
-@c Path: cssun.mathcs.emory.edu!gatech!newsxfer3.itd.umich.edu!news-peer.sprintlink.net!news-sea-19.sprintlink.net!news-in-west.sprintlink.net!news.sprintlink.net!Sprint!204.94.52.5!news.whidbey.com!brennan
-From: brennan@@whidbey.com (Mike Brennan)
-Newsgroups: comp.lang.awk
-Subject: Re: Learn the SECRET to Attract Women Easily
-Date: 4 Aug 1997 17:34:46 GMT
-@c Organization: WhidbeyNet
-@c Lines: 12
-Message-ID: <5s53rm$eca@@news.whidbey.com>
-@c References: <5s20dn$2e1@chronicle.concentric.net>
-@c Reply-To: brennan@whidbey.com
-@c NNTP-Posting-Host: asn202.whidbey.com
-@c X-Newsreader: slrn (0.9.4.1 UNIX)
-@c Xref: cssun.mathcs.emory.edu comp.lang.awk:5403
-
-On 3 Aug 1997 13:17:43 GMT, Want More Dates???
-<tracy78@@kilgrona.com> wrote:
->Learn the SECRET to Attract Women Easily
->
->The SCENT(tm) Pheromone Sex Attractant For Men to Attract Women
-
-The scent of awk programmers is a lot more attractive to women than
-the scent of perl programmers.
---
-Mike Brennan
-@c brennan@@whidbey.com
-@end smallexample
-
-@cindex advanced features, @command{gawk}, processes@comma{} communicating with
-@cindex processes, two-way communications with
-It is often useful to be able to
-send data to a separate program for
-processing and then read the result. This can always be
-done with temporary files:
-
-@example
-# Write the data for processing
-tempfile = ("mydata." PROCINFO["pid"])
-while (@var{not done with data})
- print @var{data} | ("subprogram > " tempfile)
-close("subprogram > " tempfile)
-
-# Read the results, remove tempfile when done
-while ((getline newdata < tempfile) > 0)
- @var{process} newdata @var{appropriately}
-close(tempfile)
-system("rm " tempfile)
-@end example
-
-@noindent
-This works, but not elegantly. Among other things, it requires that
-the program be run in a directory that cannot be shared among users;
-for example, @file{/tmp} will not do, as another user might happen
-to be using a temporary file with the same name.
-
-@cindex coprocesses
-@cindex input/output, two-way
-@cindex @code{|} (vertical bar), @code{|&} operator (I/O)
-@cindex vertical bar (@code{|}), @code{|&} operator (I/O)
-@cindex @command{csh} utility, @code{|&} operator, comparison with
-However, with @command{gawk}, it is possible to
-open a @emph{two-way} pipe to another process. The second process is
-termed a @dfn{coprocess}, since it runs in parallel with @command{gawk}.
-The two-way connection is created using the @samp{|&} operator
-(borrowed from the Korn shell, @command{ksh}):@footnote{This is very
-different from the same operator in the C shell.}
-
-@example
-do @{
- print @var{data} |& "subprogram"
- "subprogram" |& getline results
-@} while (@var{data left to process})
-close("subprogram")
-@end example
-
-The first time an I/O operation is executed using the @samp{|&}
-operator, @command{gawk} creates a two-way pipeline to a child process
-that runs the other program. Output created with @code{print}
-or @code{printf} is written to the program's standard input, and
-output from the program's standard output can be read by the @command{gawk}
-program using @code{getline}.
-As is the case with processes started by @samp{|}, the subprogram
-can be any program, or pipeline of programs, that can be started by
-the shell.
+@ifdocbook
+@part Part II:@* Problem Solving With @command{awk}
-There are some cautionary items to be aware of:
+Part II shows how to use @command{awk} and @command{gawk} for problem solving.
+There is lots of code here for you to read and learn from.
+It contains the following chapters:
@itemize @bullet
@item
-As the code inside @command{gawk} currently stands, the coprocess's
-standard error goes to the same place that the parent @command{gawk}'s
-standard error goes. It is not possible to read the child's
-standard error separately.
+@ref{Library Functions}.
-@cindex deadlocks
-@cindex buffering, input/output
-@cindex @code{getline} command, deadlock and
@item
-I/O buffering may be a problem. @command{gawk} automatically
-flushes all output down the pipe to the coprocess.
-However, if the coprocess does not flush its output,
-@command{gawk} may hang when doing a @code{getline} in order to read
-the coprocess's results. This could lead to a situation
-known as @dfn{deadlock}, where each process is waiting for the
-other one to do something.
+@ref{Sample Programs}.
@end itemize
-
-@cindex @code{close()} function, two-way pipes and
-It is possible to close just one end of the two-way pipe to
-a coprocess, by supplying a second argument to the @code{close()}
-function of either @code{"to"} or @code{"from"}
-(@pxref{Close Files And Pipes}).
-These strings tell @command{gawk} to close the end of the pipe
-that sends data to the coprocess or the end that reads from it,
-respectively.
-
-@cindex @command{sort} utility, coprocesses and
-This is particularly necessary in order to use
-the system @command{sort} utility as part of a coprocess;
-@command{sort} must read @emph{all} of its input
-data before it can produce any output.
-The @command{sort} program does not receive an end-of-file indication
-until @command{gawk} closes the write end of the pipe.
-
-When you have finished writing data to the @command{sort}
-utility, you can close the @code{"to"} end of the pipe, and
-then start reading sorted data via @code{getline}.
-For example:
-
-@example
-BEGIN @{
- command = "LC_ALL=C sort"
- n = split("abcdefghijklmnopqrstuvwxyz", a, "")
-
- for (i = n; i > 0; i--)
- print a[i] |& command
- close(command, "to")
-
- while ((command |& getline line) > 0)
- print "got", line
- close(command)
-@}
-@end example
-
-This program writes the letters of the alphabet in reverse order, one
-per line, down the two-way pipe to @command{sort}. It then closes the
-write end of the pipe, so that @command{sort} receives an end-of-file
-indication. This causes @command{sort} to sort the data and write the
-sorted data back to the @command{gawk} program. Once all of the data
-has been read, @command{gawk} terminates the coprocess and exits.
-
-As a side note, the assignment @samp{LC_ALL=C} in the @command{sort}
-command ensures traditional Unix (ASCII) sorting from @command{sort}.
-
-@cindex @command{gawk}, @code{PROCINFO} array in
-@cindex @code{PROCINFO} array
-You may also use pseudo-ttys (ptys) for
-two-way communication instead of pipes, if your system supports them.
-This is done on a per-command basis, by setting a special element
-in the @code{PROCINFO} array
-(@pxref{Auto-set}),
-like so:
-
-@example
-command = "sort -nr" # command, save in convenience variable
-PROCINFO[command, "pty"] = 1 # update PROCINFO
-print @dots{} |& command # start two-way pipe
-@dots{}
-@end example
-
-@noindent
-Using ptys avoids the buffer deadlock issues described earlier, at some
-loss in performance. If your system does not have ptys, or if all the
-system's ptys are in use, @command{gawk} automatically falls back to
-using regular pipes.
-
-@node TCP/IP Networking
-@section Using @command{gawk} for Network Programming
-@cindex advanced features, @command{gawk}, network programming
-@cindex networks, programming
-@c STARTOFRANGE tcpip
-@cindex TCP/IP
-@cindex @code{/inet/@dots{}} special files (@command{gawk})
-@cindex files, @code{/inet/@dots{}} (@command{gawk})
-@cindex @code{/inet4/@dots{}} special files (@command{gawk})
-@cindex files, @code{/inet4/@dots{}} (@command{gawk})
-@cindex @code{/inet6/@dots{}} special files (@command{gawk})
-@cindex files, @code{/inet6/@dots{}} (@command{gawk})
-@cindex @code{EMISTERED}
-@quotation
-@code{EMISTERED}:@*
-@ @ @ @ @i{A host is a host from coast to coast,@*
-@ @ @ @ and no-one can talk to host that's close,@*
-@ @ @ @ unless the host that isn't close@*
-@ @ @ @ is busy hung or dead.}
-@end quotation
-
-In addition to being able to open a two-way pipeline to a coprocess
-on the same system
-(@pxref{Two-way I/O}),
-it is possible to make a two-way connection to
-another process on another system across an IP network connection.
-
-You can think of this as just a @emph{very long} two-way pipeline to
-a coprocess.
-The way @command{gawk} decides that you want to use TCP/IP networking is
-by recognizing special @value{FN}s that begin with one of @samp{/inet/},
-@samp{/inet4/} or @samp{/inet6}.
-
-The full syntax of the special @value{FN} is
-@file{/@var{net-type}/@var{protocol}/@var{local-port}/@var{remote-host}/@var{remote-port}}.
-The components are:
-
-@table @var
-@item net-type
-Specifies the kind of Internet connection to make.
-Use @samp{/inet4/} to force IPv4, and
-@samp{/inet6/} to force IPv6.
-Plain @samp{/inet/} (which used to be the only option) uses
-the system default, most likely IPv4.
-
-@item protocol
-The protocol to use over IP. This must be either @samp{tcp}, or
-@samp{udp}, for a TCP or UDP IP connection,
-respectively. The use of TCP is recommended for most applications.
-
-@item local-port
-@cindex @code{getaddrinfo()} function (C library)
-The local TCP or UDP port number to use. Use a port number of @samp{0}
-when you want the system to pick a port. This is what you should do
-when writing a TCP or UDP client.
-You may also use a well-known service name, such as @samp{smtp}
-or @samp{http}, in which case @command{gawk} attempts to determine
-the predefined port number using the C @code{getaddrinfo()} function.
-
-@item remote-host
-The IP address or fully-qualified domain name of the Internet
-host to which you want to connect.
-
-@item remote-port
-The TCP or UDP port number to use on the given @var{remote-host}.
-Again, use @samp{0} if you don't care, or else a well-known
-service name.
-@end table
-
-@cindex @command{gawk}, @code{ERRNO} variable in
-@cindex @code{ERRNO} variable
-@quotation NOTE
-Failure in opening a two-way socket will result in a non-fatal error
-being returned to the calling code. The value of @code{ERRNO} indicates
-the error (@pxref{Auto-set}).
-@end quotation
-
-Consider the following very simple example:
-
-@example
-BEGIN @{
- Service = "/inet/tcp/0/localhost/daytime"
- Service |& getline
- print $0
- close(Service)
-@}
-@end example
-
-This program reads the current date and time from the local system's
-TCP @samp{daytime} server.
-It then prints the results and closes the connection.
-
-Because this topic is extensive, the use of @command{gawk} for
-TCP/IP programming is documented separately.
-@ifinfo
-See
-@inforef{Top, , General Introduction, gawkinet, TCP/IP Internetworking with @command{gawk}},
-@end ifinfo
-@ifnotinfo
-See @cite{TCP/IP Internetworking with @command{gawk}},
-which comes as part of the @command{gawk} distribution,
-@end ifnotinfo
-for a much more complete introduction and discussion, as well as
-extensive examples.
-
-@c ENDOFRANGE tcpip
-
-@node Profiling
-@section Profiling Your @command{awk} Programs
-@c STARTOFRANGE awkp
-@cindex @command{awk} programs, profiling
-@c STARTOFRANGE proawk
-@cindex profiling @command{awk} programs
-@c STARTOFRANGE pgawk
-@cindex @command{pgawk} program
-@cindex profiling @command{gawk}, See @command{pgawk} program
-
-You may produce execution
-traces of your @command{awk} programs.
-This is done with a specially compiled version of @command{gawk},
-called @command{pgawk} (``profiling @command{gawk}'').
-
-@cindex @code{awkprof.out} file
-@cindex files, @code{awkprof.out}
-@cindex @command{pgawk} program, @code{awkprof.out} file
-@command{pgawk} is identical in every way to @command{gawk}, except that when
-it has finished running, it creates a profile of your program in a file
-named @file{awkprof.out}.
-Because it is profiling, it also executes up to 45% slower than
-@command{gawk} normally does.
-
-@cindex @code{--profile} option
-As shown in the following example,
-the @option{--profile} option can be used to change the name of the file
-where @command{pgawk} will write the profile:
-
-@example
-pgawk --profile=myprog.prof -f myprog.awk data1 data2
-@end example
-
-@noindent
-In the above example, @command{pgawk} places the profile in
-@file{myprog.prof} instead of in @file{awkprof.out}.
-
-Here is a sample
-session showing a simple @command{awk} program, its input data, and the
-results from running @command{pgawk}. First, the @command{awk} program:
-
-@example
-BEGIN @{ print "First BEGIN rule" @}
-
-END @{ print "First END rule" @}
-
-/foo/ @{
- print "matched /foo/, gosh"
- for (i = 1; i <= 3; i++)
- sing()
-@}
-
-@{
- if (/foo/)
- print "if is true"
- else
- print "else is true"
-@}
-
-BEGIN @{ print "Second BEGIN rule" @}
-
-END @{ print "Second END rule" @}
-
-function sing( dummy)
-@{
- print "I gotta be me!"
-@}
-@end example
-
-Following is the input data:
-
-@example
-foo
-bar
-baz
-foo
-junk
-@end example
-
-Here is the @file{awkprof.out} that results from running @command{pgawk}
-on this program and data (this example also illustrates that @command{awk}
-programmers sometimes have to work late):
-
-@cindex @code{BEGIN} pattern, @command{pgawk} program
-@cindex @code{END} pattern, @command{pgawk} program
-@example
- # gawk profile, created Sun Aug 13 00:00:15 2000
-
- # BEGIN block(s)
-
- BEGIN @{
- 1 print "First BEGIN rule"
- 1 print "Second BEGIN rule"
- @}
-
- # Rule(s)
-
- 5 /foo/ @{ # 2
- 2 print "matched /foo/, gosh"
- 6 for (i = 1; i <= 3; i++) @{
- 6 sing()
- @}
- @}
-
- 5 @{
- 5 if (/foo/) @{ # 2
- 2 print "if is true"
- 3 @} else @{
- 3 print "else is true"
- @}
- @}
-
- # END block(s)
-
- END @{
- 1 print "First END rule"
- 1 print "Second END rule"
- @}
-
- # Functions, listed alphabetically
-
- 6 function sing(dummy)
- @{
- 6 print "I gotta be me!"
- @}
-@end example
-
-This example illustrates many of the basic features of profiling output.
-They are as follows:
-
-@itemize @bullet
-@item
-The program is printed in the order @code{BEGIN} rule,
-@code{BEGINFILE} rule,
-pattern/action rules,
-@code{ENDFILE} rule, @code{END} rule and functions, listed
-alphabetically.
-Multiple @code{BEGIN} and @code{END} rules are merged together,
-as are multiple @code{BEGINFILE} and @code{ENDFILE} rules.
-
-@cindex patterns, counts
-@item
-Pattern-action rules have two counts.
-The first count, to the left of the rule, shows how many times
-the rule's pattern was @emph{tested}.
-The second count, to the right of the rule's opening left brace
-in a comment,
-shows how many times the rule's action was @emph{executed}.
-The difference between the two indicates how many times the rule's
-pattern evaluated to false.
-
-@item
-Similarly,
-the count for an @code{if}-@code{else} statement shows how many times
-the condition was tested.
-To the right of the opening left brace for the @code{if}'s body
-is a count showing how many times the condition was true.
-The count for the @code{else}
-indicates how many times the test failed.
-
-@cindex loops, count for header
-@item
-The count for a loop header (such as @code{for}
-or @code{while}) shows how many times the loop test was executed.
-(Because of this, you can't just look at the count on the first
-statement in a rule to determine how many times the rule was executed.
-If the first statement is a loop, the count is misleading.)
-
-@cindex functions, user-defined, counts
-@cindex user-defined, functions, counts
-@item
-For user-defined functions, the count next to the @code{function}
-keyword indicates how many times the function was called.
-The counts next to the statements in the body show how many times
-those statements were executed.
-
-@cindex @code{@{@}} (braces), @command{pgawk} program
-@cindex braces (@code{@{@}}), @command{pgawk} program
-@item
-The layout uses ``K&R'' style with TABs.
-Braces are used everywhere, even when
-the body of an @code{if}, @code{else}, or loop is only a single statement.
-
-@cindex @code{()} (parentheses), @command{pgawk} program
-@cindex parentheses @code{()}, @command{pgawk} program
-@item
-Parentheses are used only where needed, as indicated by the structure
-of the program and the precedence rules.
-@c extra verbiage here satisfies the copyeditor. ugh.
-For example, @samp{(3 + 5) * 4} means add three plus five, then multiply
-the total by four. However, @samp{3 + 5 * 4} has no parentheses, and
-means @samp{3 + (5 * 4)}.
-
-@ignore
-@item
-All string concatenations are parenthesized too.
-(This could be made a bit smarter.)
+@end ifdocbook
@end ignore
-@item
-Parentheses are used around the arguments to @code{print}
-and @code{printf} only when
-the @code{print} or @code{printf} statement is followed by a redirection.
-Similarly, if
-the target of a redirection isn't a scalar, it gets parenthesized.
-
-@item
-@command{pgawk} supplies leading comments in
-front of the @code{BEGIN} and @code{END} rules,
-the pattern/action rules, and the functions.
-
-@end itemize
-
-The profiled version of your program may not look exactly like what you
-typed when you wrote it. This is because @command{pgawk} creates the
-profiled version by ``pretty printing'' its internal representation of
-the program. The advantage to this is that @command{pgawk} can produce
-a standard representation. The disadvantage is that all source-code
-comments are lost, as are the distinctions among multiple @code{BEGIN},
-@code{END}, @code{BEGINFILE}, and @code{ENDFILE} rules. Also, things such as:
-
-@example
-/foo/
-@end example
-
-@noindent
-come out as:
-
-@example
-/foo/ @{
- print $0
-@}
-@end example
-
-@noindent
-which is correct, but possibly surprising.
-
-@cindex profiling @command{awk} programs, dynamically
-@cindex @command{pgawk} program, dynamic profiling
-Besides creating profiles when a program has completed,
-@command{pgawk} can produce a profile while it is running.
-This is useful if your @command{awk} program goes into an
-infinite loop and you want to see what has been executed.
-To use this feature, run @command{pgawk} in the background:
-
-@example
-$ @kbd{pgawk -f myprog &}
-[1] 13992
-@end example
-
-@cindex @command{kill} command@comma{} dynamic profiling
-@cindex @code{USR1} signal
-@cindex @code{SIGUSR1} signal
-@cindex signals, @code{USR1}/@code{SIGUSR1}
-@noindent
-The shell prints a job number and process ID number; in this case, 13992.
-Use the @command{kill} command to send the @code{USR1} signal
-to @command{pgawk}:
-
-@example
-$ @kbd{kill -USR1 13992}
-@end example
-
-@noindent
-As usual, the profiled version of the program is written to
-@file{awkprof.out}, or to a different file if you use the @option{--profile}
-option.
-
-Along with the regular profile, as shown earlier, the profile
-includes a trace of any active functions:
-
-@example
-# Function Call Stack:
-
-# 3. baz
-# 2. bar
-# 1. foo
-# -- main --
-@end example
-
-You may send @command{pgawk} the @code{USR1} signal as many times as you like.
-Each time, the profile and function call trace are appended to the output
-profile file.
-
-@cindex @code{HUP} signal
-@cindex @code{SIGHUP} signal
-@cindex signals, @code{HUP}/@code{SIGHUP}
-If you use the @code{HUP} signal instead of the @code{USR1} signal,
-@command{pgawk} produces the profile and the function call trace and then exits.
-
-@cindex @code{INT} signal (MS-Windows)
-@cindex @code{SIGINT} signal (MS-Windows)
-@cindex signals, @code{INT}/@code{SIGINT} (MS-Windows)
-@cindex @code{QUIT} signal (MS-Windows)
-@cindex @code{SIGQUIT} signal (MS-Windows)
-@cindex signals, @code{QUIT}/@code{SIGQUIT} (MS-Windows)
-When @command{pgawk} runs on MS-Windows systems, it uses the
-@code{INT} and @code{QUIT} signals for producing the profile and, in
-the case of the @code{INT} signal, @command{pgawk} exits. This is
-because these systems don't support the @command{kill} command, so the
-only signals you can deliver to a program are those generated by the
-keyboard. The @code{INT} signal is generated by the
-@kbd{@value{CTL}-@key{C}} or @kbd{@value{CTL}-@key{BREAK}} key, while the
-@code{QUIT} signal is generated by the @kbd{@value{CTL}-@key{\}} key.
-
-Finally, regular @command{gawk} also accepts the @option{--profile} option.
-When called this way, @command{gawk} ``pretty prints'' the program into
-@file{awkprof.out}, without any execution counts.
-@c ENDOFRANGE advgaw
-@c ENDOFRANGE gawadv
-@c ENDOFRANGE pgawk
-@c ENDOFRANGE awkp
-@c ENDOFRANGE proawk
-
@node Library Functions
@chapter A Library of @command{awk} Functions
@c STARTOFRANGE libf
@@ -19539,7 +18184,7 @@ programming use.
* Ordinal Functions:: Functions for using characters as numbers and
vice versa.
* Join Function:: A function to join an array into a string.
-* Gettimeofday Function:: A function to get formatted times.
+* Getlocaltime Function:: A function to get formatted times.
@end menu
@node Strtonum Function
@@ -20064,7 +18709,7 @@ be nice if @command{awk} had an assignment operator for concatenation.
The lack of an explicit operator for concatenation makes string operations
more difficult than they really need to be.}
-@node Gettimeofday Function
+@node Getlocaltime Function
@subsection Managing the Time of Day
@cindex libraries of @command{awk} functions, managing, time
@@ -20078,14 +18723,14 @@ in human readable form. While @code{strftime()} is extensive, the control
formats are not necessarily easy to remember or intuitively obvious when
reading a program.
-The following function, @code{gettimeofday()}, populates a user-supplied array
+The following function, @code{getlocaltime()}, populates a user-supplied array
with preformatted time information. It returns a string with the current
time formatted in the same way as the @command{date} utility:
-@cindex @code{gettimeofday()} user-defined function
+@cindex @code{getlocaltime()} user-defined function
@example
@c file eg/lib/gettime.awk
-# gettimeofday.awk --- get the time of day in a usable format
+# getlocaltime.awk --- get the time of day in a usable format
@c endfile
@ignore
@c file eg/lib/gettime.awk
@@ -20118,7 +18763,7 @@ time formatted in the same way as the @command{date} utility:
# time["weeknum"] -- week number, Sunday first day
# time["altweeknum"] -- week number, Monday first day
-function gettimeofday(time, ret, now, i)
+function getlocaltime(time, ret, now, i)
@{
# get time once, avoids unnecessary system calls
now = systime()
@@ -20160,7 +18805,7 @@ The string indices are easier to use and read than the various formats
required by @code{strftime()}. The @code{alarm} program presented in
@ref{Alarm Program},
uses this function.
-A more general design for the @code{gettimeofday()} function would have
+A more general design for the @code{getlocaltime()} function would have
allowed the user to supply an optional timestamp value to use instead
of the current time.
@@ -23452,8 +22097,8 @@ it prints the message on the standard output. In addition, you can give it
the number of times to repeat the message as well as a delay between
repetitions.
-This program uses the @code{gettimeofday()} function from
-@ref{Gettimeofday Function}.
+This program uses the @code{getlocaltime()} function from
+@ref{Getlocaltime Function}.
All the work is done in the @code{BEGIN} rule. The first part is argument
checking and setting of defaults: the delay, the count, and the message to
@@ -23472,7 +22117,7 @@ Here is the program:
@c file eg/prog/alarm.awk
# alarm.awk --- set an alarm
#
-# Requires gettimeofday() library function
+# Requires getlocaltime() library function
@c endfile
@ignore
@c file eg/prog/alarm.awk
@@ -23544,7 +22189,7 @@ is how long to wait before setting off the alarm:
minute = atime[2] + 0 # force numeric
# get current broken down time
- gettimeofday(now)
+ getlocaltime(now)
# if time given is 12-hour hours and it's after that
# hour, e.g., `alarm 5:30' at 9 a.m. means 5:30 p.m.,
@@ -25211,45 +23856,1960 @@ BEGIN {
}
@end ignore
+@iftex
+@part Part III:@* Moving Beyond Standard @command{awk} With @command{gawk}
+@end iftex
+
+@ignore
+@ifdocbook
+
+@part Part III:@* Moving Beyond Standard @command{awk} With @command{gawk}
+
+Part III focuses on features specific to @command{gawk}.
+It contains the following chapters:
+
+@itemize @bullet
+@item
+@ref{Internationalization}.
+
+@item
+@ref{Advanced Features}.
+
+@item
+@ref{Debugger}.
+
+@item
+@ref{Arbitrary Precision Arithmetic}.
+
+@item
+@ref{Dynamic Extensions}.
+@end ifdocbook
+@end ignore
+
+@node Internationalization
+@chapter Internationalization with @command{gawk}
+
+Once upon a time, computer makers
+wrote software that worked only in English.
+Eventually, hardware and software vendors noticed that if their
+systems worked in the native languages of non-English-speaking
+countries, they were able to sell more systems.
+As a result, internationalization and localization
+of programs and software systems became a common practice.
+
+@c STARTOFRANGE inloc
+@cindex internationalization, localization
+@cindex @command{gawk}, internationalization and, See internationalization
+@cindex internationalization, localization, @command{gawk} and
+For many years, the ability to provide internationalization
+was largely restricted to programs written in C and C++.
+This @value{CHAPTER} describes the underlying library @command{gawk}
+uses for internationalization, as well as how
+@command{gawk} makes internationalization
+features available at the @command{awk} program level.
+Having internationalization available at the @command{awk} level
+gives software developers additional flexibility---they are no
+longer forced to write in C or C++ when internationalization is
+a requirement.
+
+@menu
+* I18N and L10N:: Internationalization and Localization.
+* Explaining gettext:: How GNU @code{gettext} works.
+* Programmer i18n:: Features for the programmer.
+* Translator i18n:: Features for the translator.
+* I18N Example:: A simple i18n example.
+* Gawk I18N:: @command{gawk} is also internationalized.
+@end menu
+
+@node I18N and L10N
+@section Internationalization and Localization
+
+@cindex internationalization
+@cindex localization, See internationalization@comma{} localization
+@cindex localization
+@dfn{Internationalization} means writing (or modifying) a program once,
+in such a way that it can use multiple languages without requiring
+further source-code changes.
+@dfn{Localization} means providing the data necessary for an
+internationalized program to work in a particular language.
+Most typically, these terms refer to features such as the language
+used for printing error messages, the language used to read
+responses, and information related to how numerical and
+monetary values are printed and read.
+
+@node Explaining gettext
+@section GNU @code{gettext}
+
+@cindex internationalizing a program
+@c STARTOFRANGE gettex
+@cindex @code{gettext} library
+The facilities in GNU @code{gettext} focus on messages; strings printed
+by a program, either directly or via formatting with @code{printf} or
+@code{sprintf()}.@footnote{For some operating systems, the @command{gawk}
+port doesn't support GNU @code{gettext}.
+Therefore, these features are not available
+if you are using one of those operating systems. Sorry.}
+
+@cindex portability, @code{gettext} library and
+When using GNU @code{gettext}, each application has its own
+@dfn{text domain}. This is a unique name, such as @samp{kpilot} or @samp{gawk},
+that identifies the application.
+A complete application may have multiple components---programs written
+in C or C++, as well as scripts written in @command{sh} or @command{awk}.
+All of the components use the same text domain.
+
+To make the discussion concrete, assume we're writing an application
+named @command{guide}. Internationalization consists of the
+following steps, in this order:
+
+@enumerate
+@item
+The programmer goes
+through the source for all of @command{guide}'s components
+and marks each string that is a candidate for translation.
+For example, @code{"`-F': option required"} is a good candidate for translation.
+A table with strings of option names is not (e.g., @command{gawk}'s
+@option{--profile} option should remain the same, no matter what the local
+language).
+
+@cindex @code{textdomain()} function (C library)
+@item
+The programmer indicates the application's text domain
+(@code{"guide"}) to the @code{gettext} library,
+by calling the @code{textdomain()} function.
+
+@cindex @code{.pot} files
+@cindex files, @code{.pot}
+@cindex portable object template files
+@cindex files, portable object template
+@item
+Messages from the application are extracted from the source code and
+collected into a portable object template file (@file{guide.pot}),
+which lists the strings and their translations.
+The translations are initially empty.
+The original (usually English) messages serve as the key for
+lookup of the translations.
+
+@cindex @code{.po} files
+@cindex files, @code{.po}
+@cindex portable object files
+@cindex files, portable object
+@item
+For each language with a translator, @file{guide.pot}
+is copied to a portable object file (@code{.po})
+and translations are created and shipped with the application.
+For example, there might be a @file{fr.po} for a French translation.
+
+@cindex @code{.mo} files
+@cindex files, @code{.mo}
+@cindex message object files
+@cindex files, message object
+@item
+Each language's @file{.po} file is converted into a binary
+message object (@file{.mo}) file.
+A message object file contains the original messages and their
+translations in a binary format that allows fast lookup of translations
+at runtime.
+
+@item
+When @command{guide} is built and installed, the binary translation files
+are installed in a standard place.
+
+@cindex @code{bindtextdomain()} function (C library)
+@item
+For testing and development, it is possible to tell @code{gettext}
+to use @file{.mo} files in a different directory than the standard
+one by using the @code{bindtextdomain()} function.
+
+@cindex @code{.mo} files, specifying directory of
+@cindex files, @code{.mo}, specifying directory of
+@cindex message object files, specifying directory of
+@cindex files, message object, specifying directory of
+@item
+At runtime, @command{guide} looks up each string via a call
+to @code{gettext()}. The returned string is the translated string
+if available, or the original string if not.
+
+@item
+If necessary, it is possible to access messages from a different
+text domain than the one belonging to the application, without
+having to switch the application's default text domain back
+and forth.
+@end enumerate
+
+@cindex @code{gettext()} function (C library)
+In C (or C++), the string marking and dynamic translation lookup
+are accomplished by wrapping each string in a call to @code{gettext()}:
+
+@example
+printf("%s", gettext("Don't Panic!\n"));
+@end example
+
+The tools that extract messages from source code pull out all
+strings enclosed in calls to @code{gettext()}.
+
+@cindex @code{_} (underscore), @code{_} C macro
+@cindex underscore (@code{_}), @code{_} C macro
+The GNU @code{gettext} developers, recognizing that typing
+@samp{gettext(@dots{})} over and over again is both painful and ugly to look
+at, use the macro @samp{_} (an underscore) to make things easier:
+
+@example
+/* In the standard header file: */
+#define _(str) gettext(str)
+
+/* In the program text: */
+printf("%s", _("Don't Panic!\n"));
+@end example
+
+@cindex internationalization, localization, locale categories
+@cindex @code{gettext} library, locale categories
+@cindex locale categories
+@noindent
+This reduces the typing overhead to just three extra characters per string
+and is considerably easier to read as well.
+
+There are locale @dfn{categories}
+for different types of locale-related information.
+The defined locale categories that @code{gettext} knows about are:
+
+@table @code
+@cindex @code{LC_MESSAGES} locale category
+@item LC_MESSAGES
+Text messages. This is the default category for @code{gettext}
+operations, but it is possible to supply a different one explicitly,
+if necessary. (It is almost never necessary to supply a different category.)
+
+@cindex sorting characters in different languages
+@cindex @code{LC_COLLATE} locale category
+@item LC_COLLATE
+Text-collation information; i.e., how different characters
+and/or groups of characters sort in a given language.
+
+@cindex @code{LC_CTYPE} locale category
+@item LC_CTYPE
+Character-type information (alphabetic, digit, upper- or lowercase, and
+so on).
+This information is accessed via the
+POSIX character classes in regular expressions,
+such as @code{/[[:alnum:]]/}
+(@pxref{Regexp Operators}).
+
+@cindex monetary information, localization
+@cindex currency symbols, localization
+@cindex @code{LC_MONETARY} locale category
+@item LC_MONETARY
+Monetary information, such as the currency symbol, and whether the
+symbol goes before or after a number.
+
+@cindex @code{LC_NUMERIC} locale category
+@item LC_NUMERIC
+Numeric information, such as which characters to use for the decimal
+point and the thousands separator.@footnote{Americans
+use a comma every three decimal places and a period for the decimal
+point, while many Europeans do exactly the opposite:
+1,234.56 versus 1.234,56.}
+
+@cindex @code{LC_RESPONSE} locale category
+@item LC_RESPONSE
+Response information, such as how ``yes'' and ``no'' appear in the
+local language, and possibly other information as well.
+
+@cindex time, localization and
+@cindex dates, information related to@comma{} localization
+@cindex @code{LC_TIME} locale category
+@item LC_TIME
+Time- and date-related information, such as 12- or 24-hour clock, month printed
+before or after the day in a date, local month abbreviations, and so on.
+
+@cindex @code{LC_ALL} locale category
+@item LC_ALL
+All of the above. (Not too useful in the context of @code{gettext}.)
+@end table
+@c ENDOFRANGE gettex
+
+@node Programmer i18n
+@section Internationalizing @command{awk} Programs
+@c STARTOFRANGE inap
+@cindex @command{awk} programs, internationalizing
+
+@command{gawk} provides the following variables and functions for
+internationalization:
+
+@table @code
+@cindex @code{TEXTDOMAIN} variable
+@item TEXTDOMAIN
+This variable indicates the application's text domain.
+For compatibility with GNU @code{gettext}, the default
+value is @code{"messages"}.
+
+@cindex internationalization, localization, marked strings
+@cindex strings, for localization
+@item _"your message here"
+String constants marked with a leading underscore
+are candidates for translation at runtime.
+String constants without a leading underscore are not translated.
+
+@cindex @code{dcgettext()} function (@command{gawk})
+@item dcgettext(@var{string} @r{[}, @var{domain} @r{[}, @var{category}@r{]]})
+Return the translation of @var{string} in
+text domain @var{domain} for locale category @var{category}.
+The default value for @var{domain} is the current value of @code{TEXTDOMAIN}.
+The default value for @var{category} is @code{"LC_MESSAGES"}.
+
+If you supply a value for @var{category}, it must be a string equal to
+one of the known locale categories described in
+@ifnotinfo
+the previous @value{SECTION}.
+@end ifnotinfo
+@ifinfo
+@ref{Explaining gettext}.
+@end ifinfo
+You must also supply a text domain. Use @code{TEXTDOMAIN} if
+you want to use the current domain.
+
+@quotation CAUTION
+The order of arguments to the @command{awk} version
+of the @code{dcgettext()} function is purposely different from the order for
+the C version. The @command{awk} version's order was
+chosen to be simple and to allow for reasonable @command{awk}-style
+default arguments.
+@end quotation
+
+@cindex @code{dcngettext()} function (@command{gawk})
+@item dcngettext(@var{string1}, @var{string2}, @var{number} @r{[}, @var{domain} @r{[}, @var{category}@r{]]})
+Return the plural form used for @var{number} of the
+translation of @var{string1} and @var{string2} in text domain
+@var{domain} for locale category @var{category}. @var{string1} is the
+English singular variant of a message, and @var{string2} the English plural
+variant of the same message.
+The default value for @var{domain} is the current value of @code{TEXTDOMAIN}.
+The default value for @var{category} is @code{"LC_MESSAGES"}.
+
+The same remarks about argument order as for the @code{dcgettext()} function apply.
+
+@cindex @code{.mo} files, specifying directory of
+@cindex files, @code{.mo}, specifying directory of
+@cindex message object files, specifying directory of
+@cindex files, message object, specifying directory of
+@cindex @code{bindtextdomain()} function (@command{gawk})
+@item bindtextdomain(@var{directory} @r{[}, @var{domain}@r{]})
+Change the directory in which
+@code{gettext} looks for @file{.mo} files, in case they
+will not or cannot be placed in the standard locations
+(e.g., during testing).
+Return the directory in which @var{domain} is ``bound.''
+
+The default @var{domain} is the value of @code{TEXTDOMAIN}.
+If @var{directory} is the null string (@code{""}), then
+@code{bindtextdomain()} returns the current binding for the
+given @var{domain}.
+@end table
+
+To use these facilities in your @command{awk} program, follow the steps
+outlined in
+@ifnotinfo
+the previous @value{SECTION},
+@end ifnotinfo
+@ifinfo
+@ref{Explaining gettext},
+@end ifinfo
+like so:
+
+@enumerate
+@cindex @code{BEGIN} pattern, @code{TEXTDOMAIN} variable and
+@cindex @code{TEXTDOMAIN} variable, @code{BEGIN} pattern and
+@item
+Set the variable @code{TEXTDOMAIN} to the text domain of
+your program. This is best done in a @code{BEGIN} rule
+(@pxref{BEGIN/END}),
+or it can also be done via the @option{-v} command-line
+option (@pxref{Options}):
+
+@example
+BEGIN @{
+ TEXTDOMAIN = "guide"
+ @dots{}
+@}
+@end example
+
+@cindex @code{_} (underscore), translatable string
+@cindex underscore (@code{_}), translatable string
+@item
+Mark all translatable strings with a leading underscore (@samp{_})
+character. It @emph{must} be adjacent to the opening
+quote of the string. For example:
+
+@example
+print _"hello, world"
+x = _"you goofed"
+printf(_"Number of users is %d\n", nusers)
+@end example
+
+@item
+If you are creating strings dynamically, you can
+still translate them, using the @code{dcgettext()}
+built-in function:
+
+@example
+message = nusers " users logged in"
+message = dcgettext(message, "adminprog")
+print message
+@end example
+
+Here, the call to @code{dcgettext()} supplies a different
+text domain (@code{"adminprog"}) in which to find the
+message, but it uses the default @code{"LC_MESSAGES"} category.
+
+@cindex @code{LC_MESSAGES} locale category, @code{bindtextdomain()} function (@command{gawk})
+@item
+During development, you might want to put the @file{.mo}
+file in a private directory for testing. This is done
+with the @code{bindtextdomain()} built-in function:
+
+@example
+BEGIN @{
+ TEXTDOMAIN = "guide" # our text domain
+ if (Testing) @{
+ # where to find our files
+ bindtextdomain("testdir")
+ # joe is in charge of adminprog
+ bindtextdomain("../joe/testdir", "adminprog")
+ @}
+ @dots{}
+@}
+@end example
+
+@end enumerate
+
+@xref{I18N Example},
+for an example program showing the steps to create
+and use translations from @command{awk}.
+
+@node Translator i18n
+@section Translating @command{awk} Programs
+
+@cindex @code{.po} files
+@cindex files, @code{.po}
+@cindex portable object files
+@cindex files, portable object
+Once a program's translatable strings have been marked, they must
+be extracted to create the initial @file{.po} file.
+As part of translation, it is often helpful to rearrange the order
+in which arguments to @code{printf} are output.
+
+@command{gawk}'s @option{--gen-pot} command-line option extracts
+the messages and is discussed next.
+After that, @code{printf}'s ability to
+rearrange the order for @code{printf} arguments at runtime
+is covered.
+
+@menu
+* String Extraction:: Extracting marked strings.
+* Printf Ordering:: Rearranging @code{printf} arguments.
+* I18N Portability:: @command{awk}-level portability issues.
+@end menu
+
+@node String Extraction
+@subsection Extracting Marked Strings
+@cindex strings, extracting
+@cindex marked strings@comma{} extracting
+@cindex @code{--gen-pot} option
+@cindex command-line options, string extraction
+@cindex string extraction (internationalization)
+@cindex marked string extraction (internationalization)
+@cindex extraction, of marked strings (internationalization)
+
+@cindex @code{--gen-pot} option
+Once your @command{awk} program is working, and all the strings have
+been marked and you've set (and perhaps bound) the text domain,
+it is time to produce translations.
+First, use the @option{--gen-pot} command-line option to create
+the initial @file{.pot} file:
+
+@example
+$ @kbd{gawk --gen-pot -f guide.awk > guide.pot}
+@end example
+
+@cindex @code{xgettext} utility
+When run with @option{--gen-pot}, @command{gawk} does not execute your
+program. Instead, it parses it as usual and prints all marked strings
+to standard output in the format of a GNU @code{gettext} Portable Object
+file. Also included in the output are any constant strings that
+appear as the first argument to @code{dcgettext()} or as the first and
+second argument to @code{dcngettext()}.@footnote{The
+@command{xgettext} utility that comes with GNU
+@code{gettext} can handle @file{.awk} files.}
+@xref{I18N Example},
+for the full list of steps to go through to create and test
+translations for @command{guide}.
+
+@node Printf Ordering
+@subsection Rearranging @code{printf} Arguments
+
+@cindex @code{printf} statement, positional specifiers
+@cindex positional specifiers, @code{printf} statement
+Format strings for @code{printf} and @code{sprintf()}
+(@pxref{Printf})
+present a special problem for translation.
+Consider the following:@footnote{This example is borrowed
+from the GNU @code{gettext} manual.}
+
+@c line broken here only for smallbook format
+@example
+printf(_"String `%s' has %d characters\n",
+ string, length(string)))
+@end example
+
+A possible German translation for this might be:
+
+@example
+"%d Zeichen lang ist die Zeichenkette `%s'\n"
+@end example
+
+The problem should be obvious: the order of the format
+specifications is different from the original!
+Even though @code{gettext()} can return the translated string
+at runtime,
+it cannot change the argument order in the call to @code{printf}.
+
+To solve this problem, @code{printf} format specifiers may have
+an additional optional element, which we call a @dfn{positional specifier}.
+For example:
+
+@example
+"%2$d Zeichen lang ist die Zeichenkette `%1$s'\n"
+@end example
+
+Here, the positional specifier consists of an integer count, which indicates which
+argument to use, and a @samp{$}. Counts are one-based, and the
+format string itself is @emph{not} included. Thus, in the following
+example, @samp{string} is the first argument and @samp{length(string)} is the second:
+
+@example
+$ @kbd{gawk 'BEGIN @{}
+> @kbd{string = "Dont Panic"}
+> @kbd{printf _"%2$d characters live in \"%1$s\"\n",}
+> @kbd{string, length(string)}
+> @kbd{@}'}
+@print{} 10 characters live in "Dont Panic"
+@end example
+
+If present, positional specifiers come first in the format specification,
+before the flags, the field width, and/or the precision.
+
+Positional specifiers can be used with the dynamic field width and
+precision capability:
+
+@example
+$ @kbd{gawk 'BEGIN @{}
+> @kbd{printf("%*.*s\n", 10, 20, "hello")}
+> @kbd{printf("%3$*2$.*1$s\n", 20, 10, "hello")}
+> @kbd{@}'}
+@print{} hello
+@print{} hello
+@end example
+
+@quotation NOTE
+When using @samp{*} with a positional specifier, the @samp{*}
+comes first, then the integer position, and then the @samp{$}.
+This is somewhat counterintuitive.
+@end quotation
+
+@cindex @code{printf} statement, positional specifiers, mixing with regular formats
+@cindex positional specifiers, @code{printf} statement, mixing with regular formats
+@cindex format specifiers, mixing regular with positional specifiers
+@command{gawk} does not allow you to mix regular format specifiers
+and those with positional specifiers in the same string:
+
+@example
+$ @kbd{gawk 'BEGIN @{ printf _"%d %3$s\n", 1, 2, "hi" @}'}
+@error{} gawk: cmd. line:1: fatal: must use `count$' on all formats or none
+@end example
+
+@quotation NOTE
+There are some pathological cases that @command{gawk} may fail to
+diagnose. In such cases, the output may not be what you expect.
+It's still a bad idea to try mixing them, even if @command{gawk}
+doesn't detect it.
+@end quotation
+
+Although positional specifiers can be used directly in @command{awk} programs,
+their primary purpose is to help in producing correct translations of
+format strings into languages different from the one in which the program
+is first written.
+
+@node I18N Portability
+@subsection @command{awk} Portability Issues
+
+@cindex portability, internationalization and
+@cindex internationalization, localization, portability and
+@command{gawk}'s internationalization features were purposely chosen to
+have as little impact as possible on the portability of @command{awk}
+programs that use them to other versions of @command{awk}.
+Consider this program:
+
+@example
+BEGIN @{
+ TEXTDOMAIN = "guide"
+ if (Test_Guide) # set with -v
+ bindtextdomain("/test/guide/messages")
+ print _"don't panic!"
+@}
+@end example
+
+@noindent
+As written, it won't work on other versions of @command{awk}.
+However, it is actually almost portable, requiring very little
+change:
+
+@itemize @bullet
+@cindex @code{TEXTDOMAIN} variable, portability and
+@item
+Assignments to @code{TEXTDOMAIN} won't have any effect,
+since @code{TEXTDOMAIN} is not special in other @command{awk} implementations.
+
+@item
+Non-GNU versions of @command{awk} treat marked strings
+as the concatenation of a variable named @code{_} with the string
+following it.@footnote{This is good fodder for an ``Obfuscated
+@command{awk}'' contest.} Typically, the variable @code{_} has
+the null string (@code{""}) as its value, leaving the original string constant as
+the result.
+
+@item
+By defining ``dummy'' functions to replace @code{dcgettext()}, @code{dcngettext()}
+and @code{bindtextdomain()}, the @command{awk} program can be made to run, but
+all the messages are output in the original language.
+For example:
+
+@cindex @code{bindtextdomain()} function (@command{gawk}), portability and
+@cindex @code{dcgettext()} function (@command{gawk}), portability and
+@cindex @code{dcngettext()} function (@command{gawk}), portability and
+@example
+@c file eg/lib/libintl.awk
+function bindtextdomain(dir, domain)
+@{
+ return dir
+@}
+
+function dcgettext(string, domain, category)
+@{
+ return string
+@}
+
+function dcngettext(string1, string2, number, domain, category)
+@{
+ return (number == 1 ? string1 : string2)
+@}
+@c endfile
+@end example
+
+@item
+The use of positional specifications in @code{printf} or
+@code{sprintf()} is @emph{not} portable.
+To support @code{gettext()} at the C level, many systems' C versions of
+@code{sprintf()} do support positional specifiers. But it works only if
+enough arguments are supplied in the function call. Many versions of
+@command{awk} pass @code{printf} formats and arguments unchanged to the
+underlying C library version of @code{sprintf()}, but only one format and
+argument at a time. What happens if a positional specification is
+used is anybody's guess.
+However, since the positional specifications are primarily for use in
+@emph{translated} format strings, and since non-GNU @command{awk}s never
+retrieve the translated string, this should not be a problem in practice.
+@end itemize
+@c ENDOFRANGE inap
+
+@node I18N Example
+@section A Simple Internationalization Example
+
+Now let's look at a step-by-step example of how to internationalize and
+localize a simple @command{awk} program, using @file{guide.awk} as our
+original source:
+
+@example
+@c file eg/prog/guide.awk
+BEGIN @{
+ TEXTDOMAIN = "guide"
+ bindtextdomain(".") # for testing
+ print _"Don't Panic"
+ print _"The Answer Is", 42
+ print "Pardon me, Zaphod who?"
+@}
+@c endfile
+@end example
+
+@noindent
+Run @samp{gawk --gen-pot} to create the @file{.pot} file:
+
+@example
+$ @kbd{gawk --gen-pot -f guide.awk > guide.pot}
+@end example
+
+@noindent
+This produces:
+
+@example
+@c file eg/data/guide.po
+#: guide.awk:4
+msgid "Don't Panic"
+msgstr ""
+
+#: guide.awk:5
+msgid "The Answer Is"
+msgstr ""
+
+@c endfile
+@end example
+
+This original portable object template file is saved and reused for each language
+into which the application is translated. The @code{msgid}
+is the original string and the @code{msgstr} is the translation.
+
+@quotation NOTE
+Strings not marked with a leading underscore do not
+appear in the @file{guide.pot} file.
+@end quotation
+
+Next, the messages must be translated.
+Here is a translation to a hypothetical dialect of English,
+called ``Mellow'':@footnote{Perhaps it would be better if it were
+called ``Hippy.'' Ah, well.}
+
+@example
+@group
+$ cp guide.pot guide-mellow.po
+@var{Add translations to} guide-mellow.po @dots{}
+@end group
+@end example
+
+@noindent
+Following are the translations:
+
+@example
+@c file eg/data/guide-mellow.po
+#: guide.awk:4
+msgid "Don't Panic"
+msgstr "Hey man, relax!"
+
+#: guide.awk:5
+msgid "The Answer Is"
+msgstr "Like, the scoop is"
+
+@c endfile
+@end example
+
+@cindex Linux
+@cindex GNU/Linux
+The next step is to make the directory to hold the binary message object
+file and then to create the @file{guide.mo} file.
+The directory layout shown here is standard for GNU @code{gettext} on
+GNU/Linux systems. Other versions of @code{gettext} may use a different
+layout:
+
+@example
+$ @kbd{mkdir en_US en_US/LC_MESSAGES}
+@end example
+
+@cindex @code{.po} files, converting to @code{.mo}
+@cindex files, @code{.po}, converting to @code{.mo}
+@cindex @code{.mo} files, converting from @code{.po}
+@cindex files, @code{.mo}, converting from @code{.po}
+@cindex portable object files, converting to message object files
+@cindex files, portable object, converting to message object files
+@cindex message object files, converting from portable object files
+@cindex files, message object, converting from portable object files
+@cindex @command{msgfmt} utility
+The @command{msgfmt} utility does the conversion from human-readable
+@file{.po} file to machine-readable @file{.mo} file.
+By default, @command{msgfmt} creates a file named @file{messages}.
+This file must be renamed and placed in the proper directory so that
+@command{gawk} can find it:
+
+@example
+$ @kbd{msgfmt guide-mellow.po}
+$ @kbd{mv messages en_US/LC_MESSAGES/guide.mo}
+@end example
+
+Finally, we run the program to test it:
+
+@example
+$ @kbd{gawk -f guide.awk}
+@print{} Hey man, relax!
+@print{} Like, the scoop is 42
+@print{} Pardon me, Zaphod who?
+@end example
+
+If the three replacement functions for @code{dcgettext()}, @code{dcngettext()}
+and @code{bindtextdomain()}
+(@pxref{I18N Portability})
+are in a file named @file{libintl.awk},
+then we can run @file{guide.awk} unchanged as follows:
+
+@example
+$ @kbd{gawk --posix -f guide.awk -f libintl.awk}
+@print{} Don't Panic
+@print{} The Answer Is 42
+@print{} Pardon me, Zaphod who?
+@end example
+
+@node Gawk I18N
+@section @command{gawk} Can Speak Your Language
+
+@command{gawk} itself has been internationalized
+using the GNU @code{gettext} package.
+(GNU @code{gettext} is described in
+complete detail in
+@ifinfo
+@inforef{Top, , GNU @code{gettext} utilities, gettext, GNU gettext tools}.)
+@end ifinfo
+@ifnotinfo
+@cite{GNU gettext tools}.)
+@end ifnotinfo
+As of this writing, the latest version of GNU @code{gettext} is
+@uref{ftp://ftp.gnu.org/gnu/gettext/gettext-0.18.1.tar.gz, @value{PVERSION} 0.18.1}.
+
+If a translation of @command{gawk}'s messages exists,
+then @command{gawk} produces usage messages, warnings,
+and fatal errors in the local language.
+@c ENDOFRANGE inloc
+
+@node Advanced Features
+@chapter Advanced Features of @command{gawk}
+@cindex advanced features, network connections, See Also networks, connections
+@c STARTOFRANGE gawadv
+@cindex @command{gawk}, features, advanced
+@c STARTOFRANGE advgaw
+@cindex advanced features, @command{gawk}
+@ignore
+Contributed by: Peter Langston <pud!psl@bellcore.bellcore.com>
+
+ Found in Steve English's "signature" line:
+
+"Write documentation as if whoever reads it is a violent psychopath
+who knows where you live."
+@end ignore
+@quotation
+@i{Write documentation as if whoever reads it is
+a violent psychopath who knows where you live.}@*
+Steve English, as quoted by Peter Langston
+@end quotation
+
+This @value{CHAPTER} discusses advanced features in @command{gawk}.
+It's a bit of a ``grab bag'' of items that are otherwise unrelated
+to each other.
+First, a command-line option allows @command{gawk} to recognize
+nondecimal numbers in input data, not just in @command{awk}
+programs.
+Then, @command{gawk}'s special features for sorting arrays are presented.
+Next, two-way I/O, discussed briefly in earlier parts of this
+@value{DOCUMENT}, is described in full detail, along with the basics
+of TCP/IP networking. Finally, @command{gawk}
+can @dfn{profile} an @command{awk} program, making it possible to tune
+it for performance.
+
+@ref{Dynamic Extensions},
+discusses the ability to dynamically add new built-in functions to
+@command{gawk}. As this feature is still immature and likely to change,
+its description is relegated to an appendix.
+
+@menu
+* Nondecimal Data:: Allowing nondecimal input data.
+* Array Sorting:: Facilities for controlling array traversal and
+ sorting arrays.
+* Two-way I/O:: Two-way communications with another process.
+* TCP/IP Networking:: Using @command{gawk} for network programming.
+* Profiling:: Profiling your @command{awk} programs.
+@end menu
+
+@node Nondecimal Data
+@section Allowing Nondecimal Input Data
+@cindex @code{--non-decimal-data} option
+@cindex advanced features, @command{gawk}, nondecimal input data
+@cindex input, data@comma{} nondecimal
+@cindex constants, nondecimal
+
+If you run @command{gawk} with the @option{--non-decimal-data} option,
+you can have nondecimal constants in your input data:
+
+@c line break here for small book format
+@example
+$ @kbd{echo 0123 123 0x123 |}
+> @kbd{gawk --non-decimal-data '@{ printf "%d, %d, %d\n",}
+> @kbd{$1, $2, $3 @}'}
+@print{} 83, 123, 291
+@end example
+
+For this feature to work, write your program so that
+@command{gawk} treats your data as numeric:
+
+@example
+$ @kbd{echo 0123 123 0x123 | gawk '@{ print $1, $2, $3 @}'}
+@print{} 0123 123 0x123
+@end example
+
+@noindent
+The @code{print} statement treats its expressions as strings.
+Although the fields can act as numbers when necessary,
+they are still strings, so @code{print} does not try to treat them
+numerically. You may need to add zero to a field to force it to
+be treated as a number. For example:
+
+@example
+$ @kbd{echo 0123 123 0x123 | gawk --non-decimal-data '}
+> @kbd{@{ print $1, $2, $3}
+> @kbd{print $1 + 0, $2 + 0, $3 + 0 @}'}
+@print{} 0123 123 0x123
+@print{} 83 123 291
+@end example
+
+Because it is common to have decimal data with leading zeros, and because
+using this facility could lead to surprising results, the default is to leave it
+disabled. If you want it, you must explicitly request it.
+
+@cindex programming conventions, @code{--non-decimal-data} option
+@cindex @code{--non-decimal-data} option, @code{strtonum()} function and
+@cindex @code{strtonum()} function (@command{gawk}), @code{--non-decimal-data} option and
+@quotation CAUTION
+@emph{Use of this option is not recommended.}
+It can break old programs very badly.
+Instead, use the @code{strtonum()} function to convert your data
+(@pxref{Nondecimal-numbers}).
+This makes your programs easier to write and easier to read, and
+leads to less surprising results.
+@end quotation
+
+@node Array Sorting
+@section Controlling Array Traversal and Array Sorting
+
+@command{gawk} lets you control the order in which a @samp{for (i in array)}
+loop traverses an array.
+
+In addition, two built-in functions, @code{asort()} and @code{asorti()},
+let you sort arrays based on the array values and indices, respectively.
+These two functions also provide control over the sorting criteria used
+to order the elements during sorting.
+
+@menu
+* Controlling Array Traversal:: How to use PROCINFO["sorted_in"].
+* Array Sorting Functions:: How to use @code{asort()} and @code{asorti()}.
+@end menu
+
+@node Controlling Array Traversal
+@subsection Controlling Array Traversal
+
+By default, the order in which a @samp{for (i in array)} loop
+scans an array is not defined; it is generally based upon
+the internal implementation of arrays inside @command{awk}.
+
+Often, though, it is desirable to be able to loop over the elements
+in a particular order that you, the programmer, choose. @command{gawk}
+lets you do this.
+
+@ref{Controlling Scanning}, describes how you can assign special,
+pre-defined values to @code{PROCINFO["sorted_in"]} in order to
+control the order in which @command{gawk} will traverse an array
+during a @code{for} loop.
+
+In addition, the value of @code{PROCINFO["sorted_in"]} can be a function name.
+This lets you traverse an array based on any custom criterion.
+The array elements are ordered according to the return value of this
+function. The comparison function should be defined with at least
+four arguments:
+
+@example
+function comp_func(i1, v1, i2, v2)
+@{
+ @var{compare elements 1 and 2 in some fashion}
+ @var{return < 0; 0; or > 0}
+@}
+@end example
+
+Here, @var{i1} and @var{i2} are the indices, and @var{v1} and @var{v2}
+are the corresponding values of the two elements being compared.
+Either @var{v1} or @var{v2}, or both, can be arrays if the array being
+traversed contains subarrays as values.
+(@xref{Arrays of Arrays}, for more information about subarrays.)
+The three possible return values are interpreted as follows:
+
+@table @code
+@item comp_func(i1, v1, i2, v2) < 0
+Index @var{i1} comes before index @var{i2} during loop traversal.
+
+@item comp_func(i1, v1, i2, v2) == 0
+Indices @var{i1} and @var{i2}
+come together but the relative order with respect to each other is undefined.
+
+@item comp_func(i1, v1, i2, v2) > 0
+Index @var{i1} comes after index @var{i2} during loop traversal.
+@end table
+
+Our first comparison function can be used to scan an array in
+numerical order of the indices:
+
+@example
+function cmp_num_idx(i1, v1, i2, v2)
+@{
+ # numerical index comparison, ascending order
+ return (i1 - i2)
+@}
+@end example
+
+Our second function traverses an array based on the string order of
+the element values rather than by indices:
+
+@example
+function cmp_str_val(i1, v1, i2, v2)
+@{
+ # string value comparison, ascending order
+ v1 = v1 ""
+ v2 = v2 ""
+ if (v1 < v2)
+ return -1
+ return (v1 != v2)
+@}
+@end example
+
+The third
+comparison function makes all numbers, and numeric strings without
+any leading or trailing spaces, come out first during loop traversal:
+
+@example
+function cmp_num_str_val(i1, v1, i2, v2, n1, n2)
+@{
+ # numbers before string value comparison, ascending order
+ n1 = v1 + 0
+ n2 = v2 + 0
+ if (n1 == v1)
+ return (n2 == v2) ? (n1 - n2) : -1
+ else if (n2 == v2)
+ return 1
+ return (v1 < v2) ? -1 : (v1 != v2)
+@}
+@end example
+
+Here is a main program to demonstrate how @command{gawk}
+behaves using each of the previous functions:
+
+@example
+BEGIN @{
+ data["one"] = 10
+ data["two"] = 20
+ data[10] = "one"
+ data[100] = 100
+ data[20] = "two"
+
+ f[1] = "cmp_num_idx"
+ f[2] = "cmp_str_val"
+ f[3] = "cmp_num_str_val"
+ for (i = 1; i <= 3; i++) @{
+ printf("Sort function: %s\n", f[i])
+ PROCINFO["sorted_in"] = f[i]
+ for (j in data)
+ printf("\tdata[%s] = %s\n", j, data[j])
+ print ""
+ @}
+@}
+@end example
+
+Here are the results when the program is run:
+@page
+
+@example
+$ @kbd{gawk -f compdemo.awk}
+@print{} Sort function: cmp_num_idx @ii{Sort by numeric index}
+@print{} data[two] = 20
+@print{} data[one] = 10 @ii{Both strings are numerically zero}
+@print{} data[10] = one
+@print{} data[20] = two
+@print{} data[100] = 100
+@print{}
+@print{} Sort function: cmp_str_val @ii{Sort by element values as strings}
+@print{} data[one] = 10
+@print{} data[100] = 100 @ii{String 100 is less than string 20}
+@print{} data[two] = 20
+@print{} data[10] = one
+@print{} data[20] = two
+@print{}
+@print{} Sort function: cmp_num_str_val @ii{Sort all numeric values before all strings}
+@print{} data[one] = 10
+@print{} data[two] = 20
+@print{} data[100] = 100
+@print{} data[10] = one
+@print{} data[20] = two
+@end example
+
+Consider sorting the entries of a GNU/Linux system password file
+according to login name. The following program sorts records
+by a specific field position and can be used for this purpose:
+
+@example
+# sort.awk --- simple program to sort by field position
+# field position is specified by the global variable POS
+
+function cmp_field(i1, v1, i2, v2)
+@{
+ # comparison by value, as string, and ascending order
+ return v1[POS] < v2[POS] ? -1 : (v1[POS] != v2[POS])
+@}
+
+@{
+ for (i = 1; i <= NF; i++)
+ a[NR][i] = $i
+@}
+
+END @{
+ PROCINFO["sorted_in"] = "cmp_field"
+ if (POS < 1 || POS > NF)
+ POS = 1
+ for (i in a) @{
+ for (j = 1; j <= NF; j++)
+ printf("%s%c", a[i][j], j < NF ? ":" : "")
+ print ""
+ @}
+@}
+@end example
+
+The first field in each entry of the password file is the user's login name,
+and the fields are separated by colons.
+Each record defines a subarray,
+with each field as an element in the subarray.
+Running the program produces the
+following output:
+
+@example
+$ @kbd{gawk -v POS=1 -F: -f sort.awk /etc/passwd}
+@print{} adm:x:3:4:adm:/var/adm:/sbin/nologin
+@print{} apache:x:48:48:Apache:/var/www:/sbin/nologin
+@print{} avahi:x:70:70:Avahi daemon:/:/sbin/nologin
+@dots{}
+@end example
+
+The comparison should normally always return the same value when given a
+specific pair of array elements as its arguments. If inconsistent
+results are returned then the order is undefined. This behavior can be
+exploited to introduce random order into otherwise seemingly
+ordered data:
+
+@example
+function cmp_randomize(i1, v1, i2, v2)
+@{
+ # random order
+ return (2 - 4 * rand())
+@}
+@end example
+
+As mentioned above, the order of the indices is arbitrary if two
+elements compare equal. This is usually not a problem, but letting
+the tied elements come out in arbitrary order can be an issue, especially
+when comparing item values. The partial ordering of the equal elements
+may change during the next loop traversal, if other elements are added or
+removed from the array. One way to resolve ties when comparing elements
+with otherwise equal values is to include the indices in the comparison
+rules. Note that doing this may make the loop traversal less efficient,
+so consider it only if necessary. The following comparison functions
+force a deterministic order, and are based on the fact that the
+indices of two elements are never equal:
+
+@example
+function cmp_numeric(i1, v1, i2, v2)
+@{
+ # numerical value (and index) comparison, descending order
+ return (v1 != v2) ? (v2 - v1) : (i2 - i1)
+@}
+
+function cmp_string(i1, v1, i2, v2)
+@{
+ # string value (and index) comparison, descending order
+ v1 = v1 i1
+ v2 = v2 i2
+ return (v1 > v2) ? -1 : (v1 != v2)
+@}
+@end example
+
+@c Avoid using the term ``stable'' when describing the unpredictable behavior
+@c if two items compare equal. Usually, the goal of a "stable algorithm"
+@c is to maintain the original order of the items, which is a meaningless
+@c concept for a list constructed from a hash.
+
+A custom comparison function can often simplify ordered loop
+traversal, and the sky is really the limit when it comes to
+designing such a function.
+
+When string comparisons are made during a sort, either for element
+values where one or both aren't numbers, or for element indices
+handled as strings, the value of @code{IGNORECASE}
+(@pxref{Built-in Variables}) controls whether
+the comparisons treat corresponding uppercase and lowercase letters as
+equivalent or distinct.
+
+Another point to keep in mind is that in the case of subarrays
+the element values can themselves be arrays; a production comparison
+function should use the @code{isarray()} function
+(@pxref{Type Functions}),
+to check for this, and choose a defined sorting order for subarrays.
+
+All sorting based on @code{PROCINFO["sorted_in"]}
+is disabled in POSIX mode,
+since the @code{PROCINFO} array is not special in that case.
+
+As a side note, sorting the array indices before traversing
+the array has been reported to add 15% to 20% overhead to the
+execution time of @command{awk} programs. For this reason,
+sorted array traversal is not the default.
+
+@c The @command{gawk}
+@c maintainers believe that only the people who wish to use a
+@c feature should have to pay for it.
+
+@node Array Sorting Functions
+@subsection Sorting Array Values and Indices with @command{gawk}
+
+@cindex arrays, sorting
+@cindex @code{asort()} function (@command{gawk})
+@cindex @code{asort()} function (@command{gawk}), arrays@comma{} sorting
+@cindex sort function, arrays, sorting
+In most @command{awk} implementations, sorting an array requires
+writing a @code{sort()} function.
+While this can be educational for exploring different sorting algorithms,
+usually that's not the point of the program.
+@command{gawk} provides the built-in @code{asort()}
+and @code{asorti()} functions
+(@pxref{String Functions})
+for sorting arrays. For example:
+
+@example
+@var{populate the array} data
+n = asort(data)
+for (i = 1; i <= n; i++)
+ @var{do something with} data[i]
+@end example
+
+After the call to @code{asort()}, the array @code{data} is indexed from 1
+to some number @var{n}, the total number of elements in @code{data}.
+(This count is @code{asort()}'s return value.)
+@code{data[1]} @value{LEQ} @code{data[2]} @value{LEQ} @code{data[3]}, and so on.
+The comparison is based on the type of the elements
+(@pxref{Typing and Comparison}).
+All numeric values come before all string values,
+which in turn come before all subarrays.
+
+@cindex side effects, @code{asort()} function
+An important side effect of calling @code{asort()} is that
+@emph{the array's original indices are irrevocably lost}.
+As this isn't always desirable, @code{asort()} accepts a
+second argument:
+
+@example
+@var{populate the array} source
+n = asort(source, dest)
+for (i = 1; i <= n; i++)
+ @var{do something with} dest[i]
+@end example
+
+In this case, @command{gawk} copies the @code{source} array into the
+@code{dest} array and then sorts @code{dest}, destroying its indices.
+However, the @code{source} array is not affected.
+
+@code{asort()} accepts a third string argument to control comparison of
+array elements. As with @code{PROCINFO["sorted_in"]}, this argument
+may be one of the predefined names that @command{gawk} provides
+(@pxref{Controlling Scanning}), or the name of a user-defined function
+(@pxref{Controlling Array Traversal}).
+
+@quotation NOTE
+In all cases, the sorted element values consist of the original
+array's element values. The ability to control comparison merely
+affects the way in which they are sorted.
+@end quotation
+
+Often, what's needed is to sort on the values of the @emph{indices}
+instead of the values of the elements.
+To do that, use the
+@code{asorti()} function. The interface is identical to that of
+@code{asort()}, except that the index values are used for sorting, and
+become the values of the result array:
+
+@example
+@{ source[$0] = some_func($0) @}
+
+END @{
+ n = asorti(source, dest)
+ for (i = 1; i <= n; i++) @{
+ @ii{Work with sorted indices directly:}
+ @var{do something with} dest[i]
+ @dots{}
+ @ii{Access original array via sorted indices:}
+ @var{do something with} source[dest[i]]
+ @}
+@}
+@end example
+
+Similar to @code{asort()},
+in all cases, the sorted element values consist of the original
+array's indices. The ability to control comparison merely
+affects the way in which they are sorted.
+
+Sorting the array by replacing the indices provides maximal flexibility.
+To traverse the elements in decreasing order, use a loop that goes from
+@var{n} down to 1, either over the elements or over the indices.@footnote{You
+may also use one of the predefined sorting names that sorts in
+decreasing order.}
+
+@cindex reference counting, sorting arrays
+Copying array indices and elements isn't expensive in terms of memory.
+Internally, @command{gawk} maintains @dfn{reference counts} to data.
+For example, when @code{asort()} copies the first array to the second one,
+there is only one copy of the original array elements' data, even though
+both arrays use the values.
+
+@c Document It And Call It A Feature. Sigh.
+@cindex @command{gawk}, @code{IGNORECASE} variable in
+@cindex @code{IGNORECASE} variable
+@cindex arrays, sorting, @code{IGNORECASE} variable and
+@cindex @code{IGNORECASE} variable, array sorting and
+Because @code{IGNORECASE} affects string comparisons, the value
+of @code{IGNORECASE} also affects sorting for both @code{asort()} and @code{asorti()}.
+Note also that the locale's sorting order does @emph{not}
+come into play; comparisons are based on character values only.@footnote{This
+is true because locale-based comparison occurs only when in POSIX
+compatibility mode, and since @code{asort()} and @code{asorti()} are
+@command{gawk} extensions, they are not available in that case.}
+Caveat Emptor.
+
+@node Two-way I/O
+@section Two-Way Communications with Another Process
+@cindex Brennan, Michael
+@cindex programmers, attractiveness of
+@smallexample
+@c Path: cssun.mathcs.emory.edu!gatech!newsxfer3.itd.umich.edu!news-peer.sprintlink.net!news-sea-19.sprintlink.net!news-in-west.sprintlink.net!news.sprintlink.net!Sprint!204.94.52.5!news.whidbey.com!brennan
+From: brennan@@whidbey.com (Mike Brennan)
+Newsgroups: comp.lang.awk
+Subject: Re: Learn the SECRET to Attract Women Easily
+Date: 4 Aug 1997 17:34:46 GMT
+@c Organization: WhidbeyNet
+@c Lines: 12
+Message-ID: <5s53rm$eca@@news.whidbey.com>
+@c References: <5s20dn$2e1@chronicle.concentric.net>
+@c Reply-To: brennan@whidbey.com
+@c NNTP-Posting-Host: asn202.whidbey.com
+@c X-Newsreader: slrn (0.9.4.1 UNIX)
+@c Xref: cssun.mathcs.emory.edu comp.lang.awk:5403
+
+On 3 Aug 1997 13:17:43 GMT, Want More Dates???
+<tracy78@@kilgrona.com> wrote:
+>Learn the SECRET to Attract Women Easily
+>
+>The SCENT(tm) Pheromone Sex Attractant For Men to Attract Women
+
+The scent of awk programmers is a lot more attractive to women than
+the scent of perl programmers.
+--
+Mike Brennan
+@c brennan@@whidbey.com
+@end smallexample
+
+@cindex advanced features, @command{gawk}, processes@comma{} communicating with
+@cindex processes, two-way communications with
+It is often useful to be able to
+send data to a separate program for
+processing and then read the result. This can always be
+done with temporary files:
+
+@example
+# Write the data for processing
+tempfile = ("mydata." PROCINFO["pid"])
+while (@var{not done with data})
+ print @var{data} | ("subprogram > " tempfile)
+close("subprogram > " tempfile)
+
+# Read the results, remove tempfile when done
+while ((getline newdata < tempfile) > 0)
+ @var{process} newdata @var{appropriately}
+close(tempfile)
+system("rm " tempfile)
+@end example
+
+@noindent
+This works, but not elegantly. Among other things, it requires that
+the program be run in a directory that cannot be shared among users;
+for example, @file{/tmp} will not do, as another user might happen
+to be using a temporary file with the same name.
+
+@cindex coprocesses
+@cindex input/output, two-way
+@cindex @code{|} (vertical bar), @code{|&} operator (I/O)
+@cindex vertical bar (@code{|}), @code{|&} operator (I/O)
+@cindex @command{csh} utility, @code{|&} operator, comparison with
+However, with @command{gawk}, it is possible to
+open a @emph{two-way} pipe to another process. The second process is
+termed a @dfn{coprocess}, since it runs in parallel with @command{gawk}.
+The two-way connection is created using the @samp{|&} operator
+(borrowed from the Korn shell, @command{ksh}):@footnote{This is very
+different from the same operator in the C shell.}
+
+@example
+do @{
+ print @var{data} |& "subprogram"
+ "subprogram" |& getline results
+@} while (@var{data left to process})
+close("subprogram")
+@end example
+
+The first time an I/O operation is executed using the @samp{|&}
+operator, @command{gawk} creates a two-way pipeline to a child process
+that runs the other program. Output created with @code{print}
+or @code{printf} is written to the program's standard input, and
+output from the program's standard output can be read by the @command{gawk}
+program using @code{getline}.
+As is the case with processes started by @samp{|}, the subprogram
+can be any program, or pipeline of programs, that can be started by
+the shell.
+
+There are some cautionary items to be aware of:
+
+@itemize @bullet
+@item
+As the code inside @command{gawk} currently stands, the coprocess's
+standard error goes to the same place that the parent @command{gawk}'s
+standard error goes. It is not possible to read the child's
+standard error separately.
+
+@cindex deadlocks
+@cindex buffering, input/output
+@cindex @code{getline} command, deadlock and
+@item
+I/O buffering may be a problem. @command{gawk} automatically
+flushes all output down the pipe to the coprocess.
+However, if the coprocess does not flush its output,
+@command{gawk} may hang when doing a @code{getline} in order to read
+the coprocess's results. This could lead to a situation
+known as @dfn{deadlock}, where each process is waiting for the
+other one to do something.
+@end itemize
+
+@cindex @code{close()} function, two-way pipes and
+It is possible to close just one end of the two-way pipe to
+a coprocess, by supplying a second argument to the @code{close()}
+function of either @code{"to"} or @code{"from"}
+(@pxref{Close Files And Pipes}).
+These strings tell @command{gawk} to close the end of the pipe
+that sends data to the coprocess or the end that reads from it,
+respectively.
+
+@cindex @command{sort} utility, coprocesses and
+This is particularly necessary in order to use
+the system @command{sort} utility as part of a coprocess;
+@command{sort} must read @emph{all} of its input
+data before it can produce any output.
+The @command{sort} program does not receive an end-of-file indication
+until @command{gawk} closes the write end of the pipe.
+
+When you have finished writing data to the @command{sort}
+utility, you can close the @code{"to"} end of the pipe, and
+then start reading sorted data via @code{getline}.
+For example:
+
+@example
+BEGIN @{
+ command = "LC_ALL=C sort"
+ n = split("abcdefghijklmnopqrstuvwxyz", a, "")
+
+ for (i = n; i > 0; i--)
+ print a[i] |& command
+ close(command, "to")
+
+ while ((command |& getline line) > 0)
+ print "got", line
+ close(command)
+@}
+@end example
+
+This program writes the letters of the alphabet in reverse order, one
+per line, down the two-way pipe to @command{sort}. It then closes the
+write end of the pipe, so that @command{sort} receives an end-of-file
+indication. This causes @command{sort} to sort the data and write the
+sorted data back to the @command{gawk} program. Once all of the data
+has been read, @command{gawk} terminates the coprocess and exits.
+
+As a side note, the assignment @samp{LC_ALL=C} in the @command{sort}
+command ensures traditional Unix (ASCII) sorting from @command{sort}.
+
+@cindex @command{gawk}, @code{PROCINFO} array in
+@cindex @code{PROCINFO} array
+You may also use pseudo-ttys (ptys) for
+two-way communication instead of pipes, if your system supports them.
+This is done on a per-command basis, by setting a special element
+in the @code{PROCINFO} array
+(@pxref{Auto-set}),
+like so:
+
+@example
+command = "sort -nr" # command, save in convenience variable
+PROCINFO[command, "pty"] = 1 # update PROCINFO
+print @dots{} |& command # start two-way pipe
+@dots{}
+@end example
+
+@noindent
+Using ptys avoids the buffer deadlock issues described earlier, at some
+loss in performance. If your system does not have ptys, or if all the
+system's ptys are in use, @command{gawk} automatically falls back to
+using regular pipes.
+
+@node TCP/IP Networking
+@section Using @command{gawk} for Network Programming
+@cindex advanced features, @command{gawk}, network programming
+@cindex networks, programming
+@c STARTOFRANGE tcpip
+@cindex TCP/IP
+@cindex @code{/inet/@dots{}} special files (@command{gawk})
+@cindex files, @code{/inet/@dots{}} (@command{gawk})
+@cindex @code{/inet4/@dots{}} special files (@command{gawk})
+@cindex files, @code{/inet4/@dots{}} (@command{gawk})
+@cindex @code{/inet6/@dots{}} special files (@command{gawk})
+@cindex files, @code{/inet6/@dots{}} (@command{gawk})
+@cindex @code{EMISTERED}
+@quotation
+@code{EMISTERED}:@*
+@ @ @ @ @i{A host is a host from coast to coast,@*
+@ @ @ @ and no-one can talk to host that's close,@*
+@ @ @ @ unless the host that isn't close@*
+@ @ @ @ is busy hung or dead.}
+@end quotation
+
+In addition to being able to open a two-way pipeline to a coprocess
+on the same system
+(@pxref{Two-way I/O}),
+it is possible to make a two-way connection to
+another process on another system across an IP network connection.
+
+You can think of this as just a @emph{very long} two-way pipeline to
+a coprocess.
+The way @command{gawk} decides that you want to use TCP/IP networking is
+by recognizing special @value{FN}s that begin with one of @samp{/inet/},
+@samp{/inet4/} or @samp{/inet6}.
+
+The full syntax of the special @value{FN} is
+@file{/@var{net-type}/@var{protocol}/@var{local-port}/@var{remote-host}/@var{remote-port}}.
+The components are:
+
+@table @var
+@item net-type
+Specifies the kind of Internet connection to make.
+Use @samp{/inet4/} to force IPv4, and
+@samp{/inet6/} to force IPv6.
+Plain @samp{/inet/} (which used to be the only option) uses
+the system default, most likely IPv4.
+
+@item protocol
+The protocol to use over IP. This must be either @samp{tcp}, or
+@samp{udp}, for a TCP or UDP IP connection,
+respectively. The use of TCP is recommended for most applications.
+
+@item local-port
+@cindex @code{getaddrinfo()} function (C library)
+The local TCP or UDP port number to use. Use a port number of @samp{0}
+when you want the system to pick a port. This is what you should do
+when writing a TCP or UDP client.
+You may also use a well-known service name, such as @samp{smtp}
+or @samp{http}, in which case @command{gawk} attempts to determine
+the predefined port number using the C @code{getaddrinfo()} function.
+
+@item remote-host
+The IP address or fully-qualified domain name of the Internet
+host to which you want to connect.
+
+@item remote-port
+The TCP or UDP port number to use on the given @var{remote-host}.
+Again, use @samp{0} if you don't care, or else a well-known
+service name.
+@end table
+
+@cindex @command{gawk}, @code{ERRNO} variable in
+@cindex @code{ERRNO} variable
+@quotation NOTE
+Failure in opening a two-way socket will result in a non-fatal error
+being returned to the calling code. The value of @code{ERRNO} indicates
+the error (@pxref{Auto-set}).
+@end quotation
+
+Consider the following very simple example:
+
+@example
+BEGIN @{
+ Service = "/inet/tcp/0/localhost/daytime"
+ Service |& getline
+ print $0
+ close(Service)
+@}
+@end example
+
+This program reads the current date and time from the local system's
+TCP @samp{daytime} server.
+It then prints the results and closes the connection.
+
+Because this topic is extensive, the use of @command{gawk} for
+TCP/IP programming is documented separately.
+@ifinfo
+See
+@inforef{Top, , General Introduction, gawkinet, TCP/IP Internetworking with @command{gawk}},
+@end ifinfo
+@ifnotinfo
+See @cite{TCP/IP Internetworking with @command{gawk}},
+which comes as part of the @command{gawk} distribution,
+@end ifnotinfo
+for a much more complete introduction and discussion, as well as
+extensive examples.
+
+@c ENDOFRANGE tcpip
+
+@node Profiling
+@section Profiling Your @command{awk} Programs
+@c STARTOFRANGE awkp
+@cindex @command{awk} programs, profiling
+@c STARTOFRANGE proawk
+@cindex profiling @command{awk} programs
+@cindex profiling @command{gawk}
+@cindex @code{awkprof.out} file
+@cindex files, @code{awkprof.out}
+
+You may produce execution traces of your @command{awk} programs.
+This is done by passing the option @option{--profile} to @command{gawk}.
+When @command{gawk} has finished running, it creates a profile of your program in a file
+named @file{awkprof.out}. Because it is profiling, it also executes up to 45% slower than
+@command{gawk} normally does.
+
+@cindex @code{--profile} option
+As shown in the following example,
+the @option{--profile} option can be used to change the name of the file
+where @command{gawk} will write the profile:
+
+@example
+gawk --profile=myprog.prof -f myprog.awk data1 data2
+@end example
+
+@noindent
+In the above example, @command{gawk} places the profile in
+@file{myprog.prof} instead of in @file{awkprof.out}.
+
+Here is a sample session showing a simple @command{awk} program, its input data, and the
+results from running @command{gawk} with the @option{--profile} option.
+First, the @command{awk} program:
+
+@example
+BEGIN @{ print "First BEGIN rule" @}
+
+END @{ print "First END rule" @}
+
+/foo/ @{
+ print "matched /foo/, gosh"
+ for (i = 1; i <= 3; i++)
+ sing()
+@}
+
+@{
+ if (/foo/)
+ print "if is true"
+ else
+ print "else is true"
+@}
+
+BEGIN @{ print "Second BEGIN rule" @}
+
+END @{ print "Second END rule" @}
+
+function sing( dummy)
+@{
+ print "I gotta be me!"
+@}
+@end example
+
+Following is the input data:
+
+@example
+foo
+bar
+baz
+foo
+junk
+@end example
+
+Here is the @file{awkprof.out} that results from running the @command{gawk}
+profiler on this program and data (this example also illustrates that @command{awk}
+programmers sometimes have to work late):
+
+@cindex @code{BEGIN} pattern
+@cindex @code{END} pattern
+@example
+ # gawk profile, created Sun Aug 13 00:00:15 2000
+
+ # BEGIN block(s)
+
+ BEGIN @{
+ 1 print "First BEGIN rule"
+ 1 print "Second BEGIN rule"
+ @}
+
+ # Rule(s)
+
+ 5 /foo/ @{ # 2
+ 2 print "matched /foo/, gosh"
+ 6 for (i = 1; i <= 3; i++) @{
+ 6 sing()
+ @}
+ @}
+
+ 5 @{
+ 5 if (/foo/) @{ # 2
+ 2 print "if is true"
+ 3 @} else @{
+ 3 print "else is true"
+ @}
+ @}
+
+ # END block(s)
+
+ END @{
+ 1 print "First END rule"
+ 1 print "Second END rule"
+ @}
+
+ # Functions, listed alphabetically
+
+ 6 function sing(dummy)
+ @{
+ 6 print "I gotta be me!"
+ @}
+@end example
+
+This example illustrates many of the basic features of profiling output.
+They are as follows:
+
+@itemize @bullet
+@item
+The program is printed in the order @code{BEGIN} rule,
+@code{BEGINFILE} rule,
+pattern/action rules,
+@code{ENDFILE} rule, @code{END} rule and functions, listed
+alphabetically.
+Multiple @code{BEGIN} and @code{END} rules are merged together,
+as are multiple @code{BEGINFILE} and @code{ENDFILE} rules.
+
+@cindex patterns, counts
+@item
+Pattern-action rules have two counts.
+The first count, to the left of the rule, shows how many times
+the rule's pattern was @emph{tested}.
+The second count, to the right of the rule's opening left brace
+in a comment,
+shows how many times the rule's action was @emph{executed}.
+The difference between the two indicates how many times the rule's
+pattern evaluated to false.
+
+@item
+Similarly,
+the count for an @code{if}-@code{else} statement shows how many times
+the condition was tested.
+To the right of the opening left brace for the @code{if}'s body
+is a count showing how many times the condition was true.
+The count for the @code{else}
+indicates how many times the test failed.
+
+@cindex loops, count for header
+@item
+The count for a loop header (such as @code{for}
+or @code{while}) shows how many times the loop test was executed.
+(Because of this, you can't just look at the count on the first
+statement in a rule to determine how many times the rule was executed.
+If the first statement is a loop, the count is misleading.)
+
+@cindex functions, user-defined, counts
+@cindex user-defined, functions, counts
+@item
+For user-defined functions, the count next to the @code{function}
+keyword indicates how many times the function was called.
+The counts next to the statements in the body show how many times
+those statements were executed.
+
+@cindex @code{@{@}} (braces)
+@cindex braces (@code{@{@}})
+@item
+The layout uses ``K&R'' style with TABs.
+Braces are used everywhere, even when
+the body of an @code{if}, @code{else}, or loop is only a single statement.
+
+@cindex @code{()} (parentheses)
+@cindex parentheses @code{()}
+@item
+Parentheses are used only where needed, as indicated by the structure
+of the program and the precedence rules.
+@c extra verbiage here satisfies the copyeditor. ugh.
+For example, @samp{(3 + 5) * 4} means add three plus five, then multiply
+the total by four. However, @samp{3 + 5 * 4} has no parentheses, and
+means @samp{3 + (5 * 4)}.
+
+@ignore
+@item
+All string concatenations are parenthesized too.
+(This could be made a bit smarter.)
+@end ignore
+
+@item
+Parentheses are used around the arguments to @code{print}
+and @code{printf} only when
+the @code{print} or @code{printf} statement is followed by a redirection.
+Similarly, if
+the target of a redirection isn't a scalar, it gets parenthesized.
+
+@item
+@command{gawk} supplies leading comments in
+front of the @code{BEGIN} and @code{END} rules,
+the pattern/action rules, and the functions.
+
+@end itemize
+
+The profiled version of your program may not look exactly like what you
+typed when you wrote it. This is because @command{gawk} creates the
+profiled version by ``pretty printing'' its internal representation of
+the program. The advantage to this is that @command{gawk} can produce
+a standard representation. The disadvantage is that all source-code
+comments are lost, as are the distinctions among multiple @code{BEGIN},
+@code{END}, @code{BEGINFILE}, and @code{ENDFILE} rules. Also, things such as:
+
+@example
+/foo/
+@end example
+
+@noindent
+come out as:
+
+@example
+/foo/ @{
+ print $0
+@}
+@end example
+
+@noindent
+which is correct, but possibly surprising.
+
+@cindex profiling @command{awk} programs, dynamically
+@cindex @command{gawk} program, dynamic profiling
+Besides creating profiles when a program has completed,
+@command{gawk} can produce a profile while it is running.
+This is useful if your @command{awk} program goes into an
+infinite loop and you want to see what has been executed.
+To use this feature, run @command{gawk} with the @option{--profile}
+option in the background:
+
+@example
+$ @kbd{gawk --profile -f myprog &}
+[1] 13992
+@end example
+
+@cindex @command{kill} command@comma{} dynamic profiling
+@cindex @code{USR1} signal
+@cindex @code{SIGUSR1} signal
+@cindex signals, @code{USR1}/@code{SIGUSR1}
+@noindent
+The shell prints a job number and process ID number; in this case, 13992.
+Use the @command{kill} command to send the @code{USR1} signal
+to @command{gawk}:
+
+@example
+$ @kbd{kill -USR1 13992}
+@end example
+
+@noindent
+As usual, the profiled version of the program is written to
+@file{awkprof.out}, or to a different file if one specified with
+the @option{--profile} option.
+
+Along with the regular profile, as shown earlier, the profile
+includes a trace of any active functions:
+
+@example
+# Function Call Stack:
+
+# 3. baz
+# 2. bar
+# 1. foo
+# -- main --
+@end example
+
+You may send @command{gawk} the @code{USR1} signal as many times as you like.
+Each time, the profile and function call trace are appended to the output
+profile file.
+
+@cindex @code{HUP} signal
+@cindex @code{SIGHUP} signal
+@cindex signals, @code{HUP}/@code{SIGHUP}
+If you use the @code{HUP} signal instead of the @code{USR1} signal,
+@command{gawk} produces the profile and the function call trace and then exits.
+
+@cindex @code{INT} signal (MS-Windows)
+@cindex @code{SIGINT} signal (MS-Windows)
+@cindex signals, @code{INT}/@code{SIGINT} (MS-Windows)
+@cindex @code{QUIT} signal (MS-Windows)
+@cindex @code{SIGQUIT} signal (MS-Windows)
+@cindex signals, @code{QUIT}/@code{SIGQUIT} (MS-Windows)
+When @command{gawk} runs on MS-Windows systems, it uses the
+@code{INT} and @code{QUIT} signals for producing the profile and, in
+the case of the @code{INT} signal, @command{gawk} exits. This is
+because these systems don't support the @command{kill} command, so the
+only signals you can deliver to a program are those generated by the
+keyboard. The @code{INT} signal is generated by the
+@kbd{@value{CTL}-@key{C}} or @kbd{@value{CTL}-@key{BREAK}} key, while the
+@code{QUIT} signal is generated by the @kbd{@value{CTL}-@key{\}} key.
+
+Finally, @command{gawk} also accepts another option @option{--pretty-print}.
+When called this way, @command{gawk} ``pretty prints'' the program into
+@file{awkprof.out}, without any execution counts.
+@c ENDOFRANGE advgaw
+@c ENDOFRANGE gawadv
+@c ENDOFRANGE awkp
+@c ENDOFRANGE proawk
+
@c The original text for this chapter was contributed by Efraim Yawitz.
@c FIXME: Add more indexing.
@node Debugger
-@chapter @command{dgawk}: The @command{awk} Debugger
-@cindex @command{dgawk}
+@chapter Debugging @command{awk} Programs
+@cindex debugging @command{awk} programs
It would be nice if computer programs worked perfectly the first time they
were run, but in real life, this rarely happens for programs of
any complexity. Thus, most programming languages have facilities available
for ``debugging'' programs, and now @command{awk} is no exception.
-The @command{dgawk} debugger is purposely modeled after
+The @command{gawk} debugger is purposely modeled after
@uref{http://www.gnu.org/software/gdb/, the GNU Debugger (GDB)}
command-line debugger. If you are familiar with GDB, learning
-@command{dgawk} is easy.
+how to use @command{gawk} for debugging your program is easy.
@menu
-* Debugging:: Introduction to @command{dgawk}.
-* Sample dgawk session:: Sample @command{dgawk} session.
-* List of Debugger Commands:: Main @command{dgawk} Commands.
-* Readline Support:: Readline Support.
-* Dgawk Limitations:: Limitations and future plans.
+* Debugging:: Introduction to @command{gawk} debugger.
+* Sample Debugging Session:: Sample debugging session.
+* List of Debugger Commands:: Main debugger commands.
+* Readline Support:: Readline support.
+* Limitations:: Limitations and future plans.
@end menu
@node Debugging
-@section Introduction to @command{dgawk}
+@section Introduction to @command{gawk} Debugger
This @value{SECTION} introduces debugging in general and begins
the discussion of debugging in @command{gawk}.
@menu
-* Debugging Concepts:: Debugging In General.
+* Debugging Concepts:: Debugging in General.
* Debugging Terms:: Additional Debugging Concepts.
* Awk Debugging:: Awk Debugging.
@end menu
@node Debugging Concepts
-@subsection Debugging In General
+@subsection Debugging in General
(If you have used debuggers in other languages, you may want to skip
ahead to the next section on the specific features of the @command{awk}
@@ -25295,8 +25855,7 @@ functional program that you or someone else wrote).
@subsection Additional Debugging Concepts
Before diving in to the details, we need to introduce several
-important concepts that apply to just about all debuggers, including
-@command{dgawk}.
+important concepts that apply to just about all debuggers.
The following list defines terms used throughout the rest of
this @value{CHAPTER}.
@@ -25315,7 +25874,7 @@ that contains the function's parameters, local variables, and return value,
as well as any other ``bookkeeping'' information needed to manage the
call stack. This data area is termed a @dfn{stack frame}.
-@command{gawk} also follows this model, and @command{dgawk} gives you
+@command{gawk} also follows this model, and gives you
access to the call stack and to each stack frame. You can see the
call stack, as well as from where each function on the stack was
invoked. Commands that print the call stack print information about
@@ -25360,48 +25919,48 @@ each line of @command{awk} code. The debugger provides the opportunity
to look at the individual primitive instructions carried out
by the higher-level @command{awk} commands.
-@node Sample dgawk session
-@section Sample @command{dgawk} session
+@node Sample Debugging Session
+@section Sample Debugging Session
-In order to illustrate the use of @command{dgawk}, let's look at a sample
+In order to illustrate the use of @command{gawk} as a debugger, let's look at a sample
debugging session. We will use the @command{awk} implementation of the
POSIX @command{uniq} command described earlier (@pxref{Uniq Program})
as our example.
@menu
-* dgawk invocation:: @command{dgawk} Invocation.
-* Finding The Bug:: Finding The Bug.
+* Debugger Invocation:: How to Start the Debugger.
+* Finding The Bug:: Finding the Bug.
@end menu
-@node dgawk invocation
-@subsection @command{dgawk} Invocation
+@node Debugger Invocation
+@subsection How to Start the Debugger
-Starting @command{dgawk} is exactly like running @command{awk}. The
-file(s) containing the program and any supporting code are given on the
-command line as arguments to one or more @option{-f} options.
-(@command{dgawk} is not designed to debug command-line
-programs, only programs contained in files.) In our case,
-we call @command{dgawk} like this:
+Starting the debugger is almost exactly like running @command{awk}, except you have to
+pass an additional option @option{--debug} or the corresponding short option @option{-D}.
+The file(s) containing the program and any supporting code are given on the command
+line as arguments to one or more @option{-f} options. (@command{gawk} is not designed
+to debug command-line programs, only programs contained in files.) In our case,
+we invoke the debugger like this:
@example
-$ @kbd{dgawk -f getopt.awk -f join.awk -f uniq.awk inputfile}
+$ @kbd{gawk -D -f getopt.awk -f join.awk -f uniq.awk inputfile}
@end example
@noindent
where both @file{getopt.awk} and @file{uniq.awk} are in @env{$AWKPATH}.
(Experienced users of GDB or similar debuggers should note that
this syntax is slightly different from what they are used to.
-With @command{dgawk}, the arguments for running the program are given
+With @command{gawk} debugger, the arguments for running the program are given
in the command line to the debugger rather than as part of the @code{run}
command at the debugger prompt.)
Instead of immediately running the program on @file{inputfile}, as
-@command{gawk} would ordinarily do, @command{dgawk} merely loads all
+@command{gawk} would ordinarily do, the debugger merely loads all
the program source files, compiles them internally, and then gives
us a prompt:
@example
-dgawk>
+gawk>
@end example
@noindent
@@ -25409,7 +25968,7 @@ from which we can issue commands to the debugger. At this point, no
code has been executed.
@node Finding The Bug
-@subsection Finding The Bug
+@subsection Finding the Bug
Let's say that we are having a problem using (a faulty version of)
@file{uniq.awk} in the ``field-skipping'' mode, and it doesn't seem to be
@@ -25445,7 +26004,7 @@ a breakpoint in @file{uniq.awk} is at the beginning of the function
the breakpoint, use the @code{b} (breakpoint) command:
@example
-dgawk> @kbd{b are_equal}
+gawk> @kbd{b are_equal}
@print{} Breakpoint 1 set at file `awklib/eg/prog/uniq.awk', line 64
@end example
@@ -25454,22 +26013,22 @@ Now type @samp{r} or @samp{run} and the program runs until it hits
the breakpoint for the first time:
@example
-dgawk> @kbd{r}
+gawk> @kbd{r}
@print{} Starting program:
@print{} Stopping in Rule ...
@print{} Breakpoint 1, are_equal(n, m, clast, cline, alast, aline)
at `awklib/eg/prog/uniq.awk':64
@print{} 64 if (fcount == 0 && charcount == 0)
-dgawk>
+gawk>
@end example
Now we can look at what's going on inside our program. First of all,
let's see how we got to where we are. At the prompt, we type @samp{bt}
-(short for ``backtrace''), and @command{dgawk} responds with a
+(short for ``backtrace''), and the debugger responds with a
listing of the current stack frames:
@example
-dgawk> @kbd{bt}
+gawk> @kbd{bt}
@print{} #0 are_equal(n, m, clast, cline, alast, aline)
at `awklib/eg/prog/uniq.awk':69
@print{} #1 in main() at `awklib/eg/prog/uniq.awk':89
@@ -25484,11 +26043,11 @@ the key to finding the source of the problem.)
Now that we're in @code{are_equal()}, we can start looking at the values
of some variables. Let's say we type @samp{p n}
(@code{p} is short for ``print''). We would expect to see the value of
-@code{n}, a parameter to @code{are_equal()}. Actually, @command{dgawk}
+@code{n}, a parameter to @code{are_equal()}. Actually, the debugger
gives us:
@example
-dgawk> @kbd{p n}
+gawk> @kbd{p n}
@print{} n = untyped variable
@end example
@@ -25499,7 +26058,7 @@ function was called without arguments (@pxref{Function Calls}).
A more useful variable to display might be the current record:
@example
-dgawk> @kbd{p $0}
+gawk> @kbd{p $0}
@print{} $0 = string ("gawk is a wonderful program!")
@end example
@@ -25508,7 +26067,7 @@ This might be a bit puzzling at first since this is the second line of
our test input above. Let's look at @code{NR}:
@example
-dgawk> @kbd{p NR}
+gawk> @kbd{p NR}
@print{} NR = number (2)
@end example
@@ -25527,7 +26086,7 @@ NR == 1 @{
OK, let's just check that that rule worked correctly:
@example
-dgawk> @kbd{p last}
+gawk> @kbd{p last}
@print{} last = string ("awk is a wonderful program!")
@end example
@@ -25538,7 +26097,7 @@ be inside this function. To investigate further, we must begin
@samp{n} (for ``next''):
@example
-dgawk> @kbd{n}
+gawk> @kbd{n}
@print{} 67 if (fcount > 0) @{
@end example
@@ -25558,9 +26117,9 @@ Continuing to step, we now get to the splitting of the current and
last records:
@example
-dgawk> @kbd{n}
+gawk> @kbd{n}
@print{} 68 n = split(last, alast)
-dgawk> @kbd{n}
+gawk> @kbd{n}
@print{} 69 m = split($0, aline)
@end example
@@ -25568,7 +26127,7 @@ At this point, we should be curious to see what our records were split
into, so we try to look:
@example
-dgawk> @kbd{p n m alast aline}
+gawk> @kbd{p n m alast aline}
@print{} n = number (5)
@print{} m = number (5)
@print{} alast = array, 5 elements
@@ -25587,7 +26146,7 @@ inside the array?
The first choice would be to use subscripts:
@example
-dgawk> @kbd{p alast[0]}
+gawk> @kbd{p alast[0]}
@print{} "0" not in array `alast'
@end example
@@ -25595,16 +26154,16 @@ dgawk> @kbd{p alast[0]}
Oops!
@example
-dgawk> @kbd{p alast[1]}
+gawk> @kbd{p alast[1]}
@print{} alast["1"] = string ("awk")
@end example
This would be kind of slow for a 100-member array, though, so
-@command{dgawk} provides a shortcut (reminiscent of another language
+@command{gawk} provides a shortcut (reminiscent of another language
not to be mentioned):
@example
-dgawk> @kbd{p @@alast}
+gawk> @kbd{p @@alast}
@print{} alast["1"] = string ("awk")
@print{} alast["2"] = string ("is")
@print{} alast["3"] = string ("a")
@@ -25616,9 +26175,9 @@ It looks like we got this far OK. Let's take another step
or two:
@example
-dgawk> @kbd{n}
+gawk> @kbd{n}
@print{} 70 clast = join(alast, fcount, n)
-dgawk> @kbd{n}
+gawk> @kbd{n}
@print{} 71 cline = join(aline, fcount, m)
@end example
@@ -25628,7 +26187,7 @@ the virtual record to compare, and if the first field was numbered zero,
this would work. Let's look at what we've got:
@example
-dgawk> @kbd{p cline clast}
+gawk> @kbd{p cline clast}
@print{} cline = string ("gawk is a wonderful program!")
@print{} clast = string ("awk is a wonderful program!")
@end example
@@ -25637,10 +26196,10 @@ Hey, those look pretty familiar! They're just our original, unaltered,
input records. A little thinking (the human brain is still the best
debugging tool), and we realize that we were off by one!
-We get out of @command{dgawk}:
+We get out of the debugger:
@example
-dgawk> @kbd{q}
+gawk> @kbd{q}
@print{} The program is running. Exit anyway (y/n)? @kbd{y}
@end example
@@ -25656,9 +26215,9 @@ cline = join(aline, fcount+1, m)
and problem solved!
@node List of Debugger Commands
-@section Main @command{dgawk} Commands
+@section Main Debugger Commands
-The @command{dgawk} command set can be divided into the
+The @command{gawk} debugger command set can be divided into the
following categories:
@itemize @bullet{}
@@ -25685,24 +26244,24 @@ Miscellaneous
Each of these are discussed in the following subsections.
In the following descriptions, commands which may be abbreviated
show the abbreviation on a second description line.
-A @command{dgawk} command name may also be truncated if that partial
-name is unambiguous. @command{dgawk} has the built-in capability to
+A debugger command name may also be truncated if that partial
+name is unambiguous. The debugger has the built-in capability to
automatically repeat the previous command when just hitting @key{Enter}.
This works for the commands @code{list}, @code{next}, @code{nexti}, @code{step}, @code{stepi}
and @code{continue} executed without any argument.
@menu
-* Breakpoint Control:: Control of breakpoints.
-* Dgawk Execution Control:: Control of execution.
-* Viewing And Changing Data:: Viewing and changing data.
-* Dgawk Stack:: Dealing with the stack.
-* Dgawk Info:: Obtaining information about the program and
- the debugger state.
-* Miscellaneous Dgawk Commands:: Miscellaneous Commands.
+* Breakpoint Control:: Control of Breakpoints.
+* Debugger Execution Control:: Control of Execution.
+* Viewing And Changing Data:: Viewing and Changing Data.
+* Execution Stack:: Dealing with the Stack.
+* Debugger Info:: Obtaining Information about the Program and
+ the Debugger State.
+* Miscellaneous Debugger Commands:: Miscellaneous Commands.
@end menu
@node Breakpoint Control
-@subsection Control Of Breakpoints
+@subsection Control of Breakpoints
As we saw above, the first thing you probably want to do in a debugging
session is to get your breakpoints set up, since otherwise your program
@@ -25737,10 +26296,10 @@ Each breakpoint is assigned a number which can be used to delete it from
the breakpoint list using the @code{delete} command.
With a breakpoint, you may also supply a condition. This is an
-@command{awk} expression (enclosed in double quotes) that @command{dgawk}
+@command{awk} expression (enclosed in double quotes) that the debugger
evaluates whenever the breakpoint is reached. If the condition is true,
-then @command{dgawk} stops execution and prompts for a command. Otherwise,
-@command{dgawk} continues executing the program.
+then the debugger stops execution and prompts for a command. Otherwise,
+it continues executing the program.
@cindex debugger commands, @code{clear}
@cindex @code{clear} debugger command
@@ -25766,10 +26325,10 @@ Delete breakpoint(s) set at entry to function @var{function}.
@cindex @code{condition} debugger command
@item @code{condition} @var{n} @code{"@var{expression}"}
Add a condition to existing breakpoint or watchpoint @var{n}. The
-condition is an @command{awk} expression that @command{dgawk} evaluates
+condition is an @command{awk} expression that the debugger evaluates
whenever the breakpoint or watchpoint is reached. If the condition is true, then
-@command{dgawk} stops execution and prompts for a command. Otherwise,
-@command{dgawk} continues executing the program. If the condition expression is
+the debugger stops execution and prompts for a command. Otherwise,
+the debugger continues executing the program. If the condition expression is
not specified, any existing condition is removed; i.e., the breakpoint or
watchpoint is made unconditional.
@@ -25825,7 +26384,7 @@ Set a temporary breakpoint (enabled for only one stop).
The arguments are the same as for @code{break}.
@end table
-@node Dgawk Execution Control
+@node Debugger Execution Control
@subsection Control of Execution
Now that your breakpoints are ready, you can start running the program
@@ -25854,14 +26413,14 @@ in the list that resumes execution (e.g., @code{continue}) terminates the list
For example:
@example
-dgawk> @kbd{commands}
+gawk> @kbd{commands}
> @kbd{silent}
> @kbd{printf "A silent breakpoint; i = %d\n", i}
> @kbd{info locals}
> @kbd{set i = 10}
> @kbd{continue}
> @kbd{end}
-dgawk>
+gawk>
@end example
@cindex debugger commands, @code{c} (@code{continue})
@@ -25911,7 +26470,7 @@ and the caller of that frame becomes the innermost frame.
@cindex @code{r} debugger command (alias for @code{run})
@item @code{run}
@itemx @code{r}
-Start/restart execution of the program. When restarting, @command{dgawk}
+Start/restart execution of the program. When restarting, the debugger
retains the current breakpoints, watchpoints, command history,
automatic display variables, and debugger options.
@@ -25934,7 +26493,7 @@ stopping, unless it encounters a breakpoint or watchpoint.
@itemx @code{si} [@var{count}]
Execute one (or @var{count}) instruction(s), stepping inside function calls.
(For illustration of what is meant by an ``instruction'' in @command{gawk},
-see the output shown under @code{dump} in @ref{Miscellaneous Dgawk Commands}.)
+see the output shown under @code{dump} in @ref{Miscellaneous Debugger Commands}.)
@cindex debugger commands, @code{u} (@code{until})
@cindex debugger commands, @code{until}
@@ -25962,7 +26521,7 @@ The value of the variable or field is displayed each time the program stops.
Each variable added to the list is identified by a unique number:
@example
-dgawk> @kbd{display x}
+gawk> @kbd{display x}
@print{} 10: x = 1
@end example
@@ -25999,7 +26558,7 @@ Print the value of a @command{gawk} variable or field.
Fields must be referenced by constants:
@example
-dgawk> @kbd{print $3}
+gawk> @kbd{print $3}
@end example
@noindent
@@ -26041,16 +26600,16 @@ You can also set special @command{awk} variables, such as @code{FS},
@item @code{watch} @var{var} | @code{$}@var{n} [@code{"@var{expression}"}]
@itemx @code{w} @var{var} | @code{$}@var{n} [@code{"@var{expression}"}]
Add variable @var{var} (or field @code{$@var{n}}) to the watch list.
-@command{dgawk} then stops whenever
+The debugger then stops whenever
the value of the variable or field changes. Each watched item is assigned a
number which can be used to delete it from the watch list using the
@code{unwatch} command.
With a watchpoint, you may also supply a condition. This is an
-@command{awk} expression (enclosed in double quotes) that @command{dgawk}
+@command{awk} expression (enclosed in double quotes) that the debugger
evaluates whenever the watchpoint is reached. If the condition is true,
-then @command{dgawk} stops execution and prompts for a command. Otherwise,
-@command{dgawk} continues executing the program.
+then the debugger stops execution and prompts for a command. Otherwise,
+@command{gawk} continues executing the program.
@cindex debugger commands, @code{undisplay}
@cindex @code{undisplay} debugger command
@@ -26066,8 +26625,8 @@ watch list.
@end table
-@node Dgawk Stack
-@subsection Dealing With The Stack
+@node Execution Stack
+@subsection Dealing with the Stack
Whenever you run a program which contains any function calls,
@command{gawk} maintains a stack of all of the function calls leading up
@@ -26111,12 +26670,12 @@ Move @var{count} (default 1) frames up the stack toward the outermost frame.
Then select and print the frame.
@end table
-@node Dgawk Info
-@subsection Obtaining Information About The Program and The Debugger State
+@node Debugger Info
+@subsection Obtaining Information about the Program and the Debugger State
Besides looking at the values of variables, there is often a need to get
other sorts of information about the state of your program and of the
-debugging environment itself. @command{dgawk} has one command which
+debugging environment itself. The @command{gawk} debugger has one command which
provides this information, appropriately called @code{info}. @code{info}
is used with one of a number of arguments that tell it exactly what
you want to know:
@@ -26154,7 +26713,7 @@ Local variables of the selected frame.
@item source
The name of the current source file. Each time the program stops, the
current source file is the file containing the current instruction.
-When @command{dgawk} first starts, the current source file is the first file
+When the debugger first starts, the current source file is the first file
included via the @option{-f} option. The
@samp{list @var{filename}:@var{lineno}} command can
be used at any time to change the current source.
@@ -26190,7 +26749,7 @@ The available options are:
@c nested table
@table @code
@item history_size
-The maximum number of lines to keep in the history file @file{./.dgawk_history}.
+The maximum number of lines to keep in the history file @file{./.gawk_history}.
The default is 100.
@item listsize
@@ -26202,14 +26761,14 @@ to standard output. An empty string (@code{""}) resets output to
standard output.
@item prompt
-The debugger prompt. The default is @samp{@w{dgawk> }}.
+The debugger prompt. The default is @samp{@w{gawk> }}.
@item save_history @r{[}on @r{|} off@r{]}
-Save command history to file @file{./.dgawk_history}.
+Save command history to file @file{./.gawk_history}.
The default is @code{on}.
@item save_options @r{[}on @r{|} off@r{]}
-Save current options to file @file{./.dgawkrc} upon exit.
+Save current options to file @file{./.gawkrc} upon exit.
The default is @code{on}.
Options are read back in to the next session upon startup.
@@ -26229,16 +26788,16 @@ Empty lines are ignored; they do @emph{not}
repeat the last command.
You can't restart the program by having more than one @code{run}
command in the file. Also, the list of commands may include additional
-@code{source} commands; however, @command{dgawk} will not source the
+@code{source} commands; however, the @command{gawk} debugger will not source the
same file more than once in order to avoid infinite recursion.
In addition to, or instead of the @code{source} command, you can use
-the @option{-R @var{file}} or @option{--command=@var{file}} command-line
+the @option{-D @var{file}} or @option{--debug=@var{file}} command-line
options to execute commands from a file non-interactively
(@pxref{Options}.
@end table
-@node Miscellaneous Dgawk Commands
+@node Miscellaneous Debugger Commands
@subsection Miscellaneous Commands
There are a few more commands which do not fit into the
@@ -26256,7 +26815,7 @@ partial dump of Davide Brini's obfuscated code
(@pxref{Signature Program}) demonstrates:
@smallexample
-dgawk> @kbd{dump}
+gawk> @kbd{dump}
@print{} # BEGIN
@print{}
@print{} [ 2:0x89faef4] Op_rule : [in_rule = BEGIN] [source_file = brini.awk]
@@ -26305,7 +26864,7 @@ dgawk> @kbd{dump}
@print{} [ :0x89fa3b0] Op_after_beginfile :
@print{} [ :0x89fa388] Op_no_op :
@print{} [ :0x89fa3c4] Op_after_endfile :
-dgawk>
+gawk>
@end smallexample
@cindex debugger commands, @code{h} (@code{help})
@@ -26314,7 +26873,7 @@ dgawk>
@cindex @code{h} debugger command (alias for @code{help})
@item @code{help}
@itemx @code{h}
-Print a list of all of the @command{dgawk} commands with a short
+Print a list of all of the @command{gawk} debugger commands with a short
summary of their usage. @samp{help @var{command}} prints the information
about the command @var{command}.
@@ -26361,7 +26920,7 @@ function @var{function}. This command may change the current source file.
Exit the debugger. Debugging is great fun, but sometimes we all have
to tend to other obligations in life, and sometimes we find the bug,
and are free to go on to the next one! As we saw above, if you are
-running a program, @command{dgawk} warns you if you accidentally type
+running a program, the debugger warns you if you accidentally type
@samp{q} or @samp{quit}, to make sure you really want to quit.
@cindex debugger commands, @code{trace}
@@ -26380,7 +26939,7 @@ fairly self-explanatory, and using @code{stepi} and @code{nexti} while
@node Readline Support
@section Readline Support
-If @command{dgawk} is compiled with the @code{readline} library, you
+If @command{gawk} is compiled with the @code{readline} library, you
can take advantage of that library's command completion and history expansion
features. The following types of completion are available:
@@ -26412,28 +26971,28 @@ and
@end table
-@node Dgawk Limitations
+@node Limitations
@section Limitations and Future Plans
-We hope you find @command{dgawk} useful and enjoyable to work with,
+We hope you find the @command{gawk} debugger useful and enjoyable to work with,
but as with any program, especially in its early releases, it still has
some limitations. A few which are worth being aware of are:
@itemize @bullet{}
@item
-At this point, @command{dgawk} does not give a detailed explanation of
+At this point, the debugger does not give a detailed explanation of
what you did wrong when you type in something it doesn't like. Rather, it just
responds @samp{syntax error}. When you do figure out what your mistake was,
though, you'll feel like a real guru.
@item
-If you perused the dump of opcodes in @ref{Miscellaneous Dgawk Commands},
+If you perused the dump of opcodes in @ref{Miscellaneous Debugger Commands},
(or if you are already familiar with @command{gawk} internals),
you will realize that much of the internal manipulation of data
in @command{gawk}, as in many interpreters, is done on a stack.
@code{Op_push}, @code{Op_pop}, etc., are the ``bread and butter'' of
-most @command{gawk} code. Unfortunately, as of now, @command{dgawk}
-does not allow you to examine the stack's contents.
+most @command{gawk} code. Unfortunately, as of now, the @command{gawk}
+debugger does not allow you to examine the stack's contents.
That is, the intermediate results of expression evaluation are on the
stack, but cannot be printed. Rather, only variables which are defined
@@ -26448,28 +27007,4949 @@ programmer, you are expected to know what @code{/[^[:alnum:][:blank:]]/}
means.
@item
-@command{dgawk} is designed to be used by running a program (with all its
-parameters) on the command line, as described in @ref{dgawk invocation}.
+The @command{gawk} debugger is designed to be used by running a program (with all its
+parameters) on the command line, as described in @ref{Debugger Invocation}.
There is no way (as of now) to attach or ``break in'' to a running program.
This seems reasonable for a language which is used mainly for quickly
executing, short programs.
@item
-@command{dgawk} only accepts source supplied with the @option{-f} option.
+The @command{gawk} debugger only accepts source supplied with the @option{-f} option.
@end itemize
Look forward to a future release when these and other missing features may
be added, and of course feel free to try to add them yourself!
+@node Arbitrary Precision Arithmetic
+@chapter Arithmetic and Arbitrary Precision Arithmetic with @command{gawk}
+@cindex arbitrary precision
+@cindex multiple precision
+@cindex infinite precision
+@cindex floating-point numbers, arbitrary precision
+@cindex MPFR
+@cindex GMP
+
+@cindex Knuth, Donald
+@quotation
+@i{There's a credibility gap: We don't know how much of the computer's answers
+to believe. Novice computer users solve this problem by implicitly trusting
+in the computer as an infallible authority; they tend to believe that all
+digits of a printed answer are significant. Disillusioned computer users have
+just the opposite approach; they are constantly afraid that their answers
+are almost meaningless.}@*
+Donald Knuth@footnote{Donald E.@: Knuth.
+@cite{The Art of Computer Programming}. Volume 2,
+@cite{Seminumerical Algorithms}, third edition,
+1998, ISBN 0-201-89683-4, p.@: 229.}
+@end quotation
+
+This @value{CHAPTER} discusses issues that you may encounter
+when performing arithmetic. It begins by discussing some of
+the general attributes of computer arithmetic, along with how
+this can influence what you see when running @command{awk} programs.
+This discussion applies to all versions of @command{awk}.
+
+Then the @value{CHAPTER} moves on to @dfn{arbitrary precision
+arithmetic}, a feature which is specific to @command{gawk}.
+
+@menu
+* General Arithmetic:: An introduction to computer arithmetic.
+* Floating-point Programming:: Effective Floating-point Programming.
+* Gawk and MPFR:: How @command{gawk} provides
+ arbitrary-precision arithmetic.
+* Arbitrary Precision Floats:: Arbitrary Precision Floating-point Arithmetic
+ with @command{gawk}.
+* Arbitrary Precision Integers:: Arbitrary Precision Integer Arithmetic with
+ @command{gawk}.
+@end menu
+
+@node General Arithmetic
+@section A General Description of Computer Arithmetic
+
+@cindex integers
+@cindex floating-point, numbers
+@cindex numbers, floating-point
+Within computers, there are two kinds of numeric values: @dfn{integers}
+and @dfn{floating-point}.
+In school, integer values were referred to as ``whole'' numbers---that is,
+numbers without any fractional part, such as 1, 42, or @minus{}17.
+The advantage to integer numbers is that they represent values exactly.
+The disadvantage is that their range is limited. On most systems,
+this range is @minus{}2,147,483,648 to 2,147,483,647.
+However, many systems now support a range from
+@minus{}9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.
+
+@cindex unsigned integers
+@cindex integers, unsigned
+Integer values come in two flavors: @dfn{signed} and @dfn{unsigned}.
+Signed values may be negative or positive, with the range of values just
+described.
+Unsigned values are always positive. On most systems,
+the range is from 0 to 4,294,967,295.
+However, many systems now support a range from
+0 to 18,446,744,073,709,551,615.
+
+@cindex double precision floating-point
+@cindex single precision floating-point
+Floating-point numbers represent what are called ``real'' numbers; i.e.,
+those that do have a fractional part, such as 3.1415927.
+The advantage to floating-point numbers is that they
+can represent a much larger range of values.
+The disadvantage is that there are numbers that they cannot represent
+exactly.
+@command{awk} uses @dfn{double precision} floating-point numbers, which
+can hold more digits than @dfn{single precision}
+floating-point numbers.
+@c Floating-point issues are discussed more fully in
+@c @ref{Floating Point Issues}.
+
+There a several important issues to be aware of, described next.
+
+@menu
+* Floating Point Issues:: Stuff to know about floating-point numbers.
+* Integer Programming:: Effective integer programming.
+@end menu
+
+@node Floating Point Issues
+@subsection Floating-Point Number Caveats
+
+This @value{SECTION} describes some of the issues
+involved in using floating-point numbers.
+
+There is a very nice
+@uref{http://www.validlab.com/goldberg/paper.pdf, paper on floating-point arithmetic}
+by David Goldberg,
+``What Every Computer Scientist Should Know About Floating-point Arithmetic,''
+@cite{ACM Computing Surveys} @strong{23}, 1 (1991-03), 5-48.
+This is worth reading if you are interested in the details,
+but it does require a background in computer science.
+
+@menu
+* String Conversion Precision:: The String Value Can Lie.
+* Unexpected Results:: Floating Point Numbers Are Not Abstract
+ Numbers.
+* POSIX Floating Point Problems:: Standards Versus Existing Practice.
+@end menu
+
+@node String Conversion Precision
+@subsubsection The String Value Can Lie
+
+Internally, @command{awk} keeps both the numeric value
+(double precision floating-point) and the string value for a variable.
+Separately, @command{awk} keeps
+track of what type the variable has
+(@pxref{Typing and Comparison}),
+which plays a role in how variables are used in comparisons.
+
+It is important to note that the string value for a number may not
+reflect the full value (all the digits) that the numeric value
+actually contains.
+The following program (@file{values.awk}) illustrates this:
+
+@example
+@{
+ sum = $1 + $2
+ # see it for what it is
+ printf("sum = %.12g\n", sum)
+ # use CONVFMT
+ a = "<" sum ">"
+ print "a =", a
+ # use OFMT
+ print "sum =", sum
+@}
+@end example
+
+@noindent
+This program shows the full value of the sum of @code{$1} and @code{$2}
+using @code{printf}, and then prints the string values obtained
+from both automatic conversion (via @code{CONVFMT}) and
+from printing (via @code{OFMT}).
+
+Here is what happens when the program is run:
+
+@example
+$ @kbd{echo 3.654321 1.2345678 | awk -f values.awk}
+@print{} sum = 4.8888888
+@print{} a = <4.88889>
+@print{} sum = 4.88889
+@end example
+
+This makes it clear that the full numeric value is different from
+what the default string representations show.
+
+@code{CONVFMT}'s default value is @code{"%.6g"}, which yields a value with
+at least six significant digits. For some applications, you might want to
+change it to specify more precision.
+On most modern machines, most of the time,
+17 digits is enough to capture a floating-point number's
+value exactly.@footnote{Pathological cases can require up to
+752 digits (!), but we doubt that you need to worry about this.}
+
+@node Unexpected Results
+@subsubsection Floating Point Numbers Are Not Abstract Numbers
+
+@cindex floating-point, numbers
+Unlike numbers in the abstract sense (such as what you studied in high school
+or college arithmetic), numbers stored in computers are limited in certain ways.
+They cannot represent an infinite number of digits, nor can they always
+represent things exactly.
+In particular,
+floating-point numbers cannot
+always represent values exactly. Here is an example:
+
+@example
+$ @kbd{awk '@{ printf("%010d\n", $1 * 100) @}'}
+515.79
+@print{} 0000051579
+515.80
+@print{} 0000051579
+515.81
+@print{} 0000051580
+515.82
+@print{} 0000051582
+@kbd{@value{CTL}-d}
+@end example
+
+@noindent
+This shows that some values can be represented exactly,
+whereas others are only approximated. This is not a ``bug''
+in @command{awk}, but simply an artifact of how computers
+represent numbers.
+
+@quotation NOTE
+It cannot be emphasized enough that the behavior just
+described is fundamental to modern computers. You will
+see this kind of thing happen in @emph{any} programming
+language using hardware floating-point numbers. It is @emph{not}
+a bug in @command{gawk}, nor is it something that can be ``just
+fixed.''
+@end quotation
+
+@cindex negative zero
+@cindex positive zero
+@cindex zero@comma{} negative vs.@: positive
+Another peculiarity of floating-point numbers on modern systems
+is that they often have more than one representation for the number zero!
+In particular, it is possible to represent ``minus zero'' as well as
+regular, or ``positive'' zero.
+
+This example shows that negative and positive zero are distinct values
+when stored internally, but that they are in fact equal to each other,
+as well as to ``regular'' zero:
+
+@example
+$ @kbd{gawk 'BEGIN @{ mz = -0 ; pz = 0}
+> @kbd{printf "-0 = %g, +0 = %g, (-0 == +0) -> %d\n", mz, pz, mz == pz}
+> @kbd{printf "mz == 0 -> %d, pz == 0 -> %d\n", mz == 0, pz == 0}
+> @kbd{@}'}
+@print{} -0 = -0, +0 = 0, (-0 == +0) -> 1
+@print{} mz == 0 -> 1, pz == 0 -> 1
+@end example
+
+It helps to keep this in mind should you process numeric data
+that contains negative zero values; the fact that the zero is negative
+is noted and can affect comparisons.
+
+@node POSIX Floating Point Problems
+@subsubsection Standards Versus Existing Practice
+
+Historically, @command{awk} has converted any non-numeric looking string
+to the numeric value zero, when required. Furthermore, the original
+definition of the language and the original POSIX standards specified that
+@command{awk} only understands decimal numbers (base 10), and not octal
+(base 8) or hexadecimal numbers (base 16).
+
+Changes in the language of the
+2001 and 2004 POSIX standards can be interpreted to imply that @command{awk}
+should support additional features. These features are:
+
+@itemize @bullet
+@item
+Interpretation of floating point data values specified in hexadecimal
+notation (@samp{0xDEADBEEF}). (Note: data values, @emph{not}
+source code constants.)
+
+@item
+Support for the special IEEE 754 floating point values ``Not A Number''
+(NaN), positive Infinity (``inf'') and negative Infinity (``@minus{}inf'').
+In particular, the format for these values is as specified by the ISO 1999
+C standard, which ignores case and can allow machine-dependent additional
+characters after the @samp{nan} and allow either @samp{inf} or @samp{infinity}.
+@end itemize
+
+The first problem is that both of these are clear changes to historical
+practice:
+
+@itemize @bullet
+@item
+The @command{gawk} maintainer feels that supporting hexadecimal floating
+point values, in particular, is ugly, and was never intended by the
+original designers to be part of the language.
+
+@item
+Allowing completely alphabetic strings to have valid numeric
+values is also a very severe departure from historical practice.
+@end itemize
+
+The second problem is that the @code{gawk} maintainer feels that this
+interpretation of the standard, which requires a certain amount of
+``language lawyering'' to arrive at in the first place, was not even
+intended by the standard developers. In other words, ``we see how you
+got where you are, but we don't think that that's where you want to be.''
+
+Recognizing the above issues, but attempting to provide compatibility
+with the earlier versions of the standard,
+the 2008 POSIX standard added explicit wording to allow, but not require,
+that @command{awk} support hexadecimal floating point values and
+special values for ``Not A Number'' and infinity.
+
+Although the @command{gawk} maintainer continues to feel that
+providing those features is inadvisable,
+nevertheless, on systems that support IEEE floating point, it seems
+reasonable to provide @emph{some} way to support NaN and Infinity values.
+The solution implemented in @command{gawk} is as follows:
+
+@itemize @bullet
+@item
+With the @option{--posix} command-line option, @command{gawk} becomes
+``hands off.'' String values are passed directly to the system library's
+@code{strtod()} function, and if it successfully returns a numeric value,
+that is what's used.@footnote{You asked for it, you got it.}
+By definition, the results are not portable across
+different systems. They are also a little surprising:
+
+@example
+$ @kbd{echo nanny | gawk --posix '@{ print $1 + 0 @}'}
+@print{} nan
+$ @kbd{echo 0xDeadBeef | gawk --posix '@{ print $1 + 0 @}'}
+@print{} 3735928559
+@end example
+
+@item
+Without @option{--posix}, @command{gawk} interprets the four strings
+@samp{+inf},
+@samp{-inf},
+@samp{+nan},
+and
+@samp{-nan}
+specially, producing the corresponding special numeric values.
+The leading sign acts a signal to @command{gawk} (and the user)
+that the value is really numeric. Hexadecimal floating point is
+not supported (unless you also use @option{--non-decimal-data},
+which is @emph{not} recommended). For example:
+
+@example
+$ @kbd{echo nanny | gawk '@{ print $1 + 0 @}'}
+@print{} 0
+$ @kbd{echo +nan | gawk '@{ print $1 + 0 @}'}
+@print{} nan
+$ @kbd{echo 0xDeadBeef | gawk '@{ print $1 + 0 @}'}
+@print{} 0
+@end example
+
+@command{gawk} does ignore case in the four special values.
+Thus @samp{+nan} and @samp{+NaN} are the same.
+@end itemize
+
+@node Integer Programming
+@subsection Mixing Integers And Floating-point
+
+As has been mentioned already, @command{gawk} ordinarily uses hardware double
+precision with 64-bit IEEE binary floating-point representation
+for numbers on most systems. A large integer like 9,007,199,254,740,997
+has a binary representation that, although finite, is more than 53 bits long;
+it must also be rounded to 53 bits.
+The biggest integer that can be stored in a C @code{double} is usually the same
+as the largest possible value of a @code{double}. If your system @code{double}
+is an IEEE 64-bit @code{double}, this largest possible value is an integer and
+can be represented precisely. What more should one know about integers?
+
+If you want to know what is the largest integer, such that it and
+all smaller integers can be stored in 64-bit doubles without losing precision,
+then the answer is
+@iftex
+@math{2^{53}}.
+@end iftex
+@ifnottex
+2^53.
+@end ifnottex
+The next representable number is the even number
+@iftex
+@math{2^{53} + 2},
+@end iftex
+@ifnottex
+2^53 + 2,
+@end ifnottex
+meaning it is unlikely that you will be able to make
+@command{gawk} print
+@iftex
+@math{2^{53} + 1}
+@end iftex
+@ifnottex
+2^53 + 1
+@end ifnottex
+in integer format.
+The range of integers exactly representable by a 64-bit double
+is
+@iftex
+@math{[-2^{53}, 2^{53}]}.
+@end iftex
+@ifnottex
+[@minus{}2^53, 2^53].
+@end ifnottex
+If you ever see an integer outside this range in @command{gawk}
+using 64-bit doubles, you have reason to be very suspicious about
+the accuracy of the output. Here is a simple program with erroneous output:
+
+@example
+$ @kbd{gawk 'BEGIN @{ i = 2^53 - 1; for (j = 0; j < 4; j++) print i + j @}'}
+@print{} 9007199254740991
+@print{} 9007199254740992
+@print{} 9007199254740992
+@print{} 9007199254740994
+@end example
+
+The lesson is to not assume that any large integer printed by @command{gawk}
+represents an exact result from your computation, especially if it wraps
+around on your screen.
+
+@node Floating-point Programming
+@section Understanding Floating-point Programming
+
+Numerical programming is an extensive area; if you need to develop
+sophisticated numerical algorithms then @command{gawk} may not be
+the ideal tool, and this documentation may not be sufficient.
+@c FIXME: JOHN: Do you want to cite some actual books?
+It might require digesting a book or two to really internalize how to compute
+with ideal accuracy and precision,
+and the result often depends on the particular application.
+
+@quotation NOTE
+A floating-point calculation's @dfn{accuracy} is how close it comes
+to the real value. This is as opposed to the @dfn{precision}, which
+usually refers to the number of bits used to represent the number
+(see @uref{http://en.wikipedia.org/wiki/Accuracy_and_precision,
+the Wikipedia article} for more information).
+@end quotation
+
+There are two options for doing floating-point calculations:
+hardware floating-point (as used by standard @command{awk} and
+the default for @command{gawk}), and @dfn{arbitrary-precision}
+floating-point, which is software based.
+From this point forward, this @value{CHAPTER}
+aims to provide enough information to understand both, and then
+will focus on @command{gawk}'s facilities for the latter.@footnote{If you
+are interested in other tools that perform arbitrary precision arithmetic,
+you may want to investigate the POSIX @command{bc} tool. See
+@uref{http://pubs.opengroup.org/onlinepubs/009695399/utilities/bc.html,
+the POSIX specification for it}, for more information.}
+
+Binary floating-point representations and arithmetic are inexact.
+Simple values like 0.1 cannot be precisely represented using
+binary floating-point numbers, and the limited precision of
+floating-point numbers means that slight changes in
+the order of operations or the precision of intermediate storage
+can change the result. To make matters worse, with arbitrary precision
+floating-point, you can set the precision before starting a computation,
+but then you cannot be sure of the number of significant decimal places
+in the final result.
+
+Sometimes, before you start to write any code, you should think more
+about what you really want and what's really happening. Consider the
+two numbers in the following example:
+
+@example
+x = 0.875 # 1/2 + 1/4 + 1/8
+y = 0.425
+@end example
+
+Unlike the number in @code{y}, the number stored in @code{x}
+is exactly representable
+in binary since it can be written as a finite sum of one or
+more fractions whose denominators are all powers of two.
+When @command{gawk} reads a floating-point number from
+program source, it automatically rounds that number to whatever
+precision your machine supports. If you try to print the numeric
+content of a variable using an output format string of @code{"%.17g"},
+it may not produce the same number as you assigned to it:
+
+@example
+$ @kbd{gawk 'BEGIN @{ x = 0.875; y = 0.425}
+> @kbd{ printf("%0.17g, %0.17g\n", x, y) @}'}
+@print{} 0.875, 0.42499999999999999
+@end example
+
+Often the error is so small you do not even notice it, and if you do,
+you can always specify how much precision you would like in your output.
+Usually this is a format string like @code{"%.15g"}, which when
+used in the previous example, produces an output identical to the input.
+
+Because the underlying representation can be a little bit off from the exact value,
+comparing floating-point values to see if they are equal is generally not a good idea.
+Here is an example where it does not work like you expect:
+
+@example
+$ @kbd{gawk 'BEGIN @{ print (0.1 + 12.2 == 12.3) @}'}
+@print{} 0
+@end example
+
+The loss of accuracy during a single computation with floating-point numbers
+usually isn't enough to worry about. However, if you compute a value
+which is the result of a sequence of floating point operations,
+the error can accumulate and greatly affect the computation itself.
+Here is an attempt to compute the value of the constant
+@value{PI} using one of its many series representations:
+
+@example
+BEGIN @{
+ x = 1.0 / sqrt(3.0)
+ n = 6
+ for (i = 1; i < 30; i++) @{
+ n = n * 2.0
+ x = (sqrt(x * x + 1) - 1) / x
+ printf("%.15f\n", n * x)
+ @}
+@}
+@end example
+
+When run, the early errors propagating through later computations
+cause the loop to terminate prematurely after an attempt to divide by zero.
+
+@example
+$ @kbd{gawk -f pi.awk}
+@print{} 3.215390309173475
+@print{} 3.159659942097510
+@print{} 3.146086215131467
+@print{} 3.142714599645573
+@dots{}
+@print{} 3.224515243534819
+@print{} 2.791117213058638
+@print{} 0.000000000000000
+@error{} gawk: pi.awk:6: fatal: division by zero attempted
+@end example
+
+Here is an additional example where the inaccuracies in internal representations
+yield an unexpected result:
+
+@example
+$ @kbd{gawk 'BEGIN @{}
+> @kbd{for (d = 1.1; d <= 1.5; d += 0.1)}
+> @kbd{i++}
+> @kbd{print i}
+> @kbd{@}'}
+@print{} 4
+@end example
+
+Can computation using arbitrary precision help with the previous examples?
+If you are impatient to know, see
+@ref{Exact Arithmetic}.
+
+Instead of arbitrary precision floating-point arithmetic,
+often all you need is an adjustment of your logic
+or a different order for the operations in your calculation.
+The stability and the accuracy of the computation of the constant @value{PI}
+in the previous example can be enhanced by using the following
+simple algebraic transformation:
+
+@example
+(sqrt(x * x + 1) - 1) / x = x / (sqrt(x * x + 1) + 1)
+@end example
+
+@noindent
+After making this, change the program does converge to
+@value{PI} in under 30 iterations:
+
+@example
+$ @kbd{gawk -f /tmp/pi2.awk}
+@print{} 3.215390309173473
+@print{} 3.159659942097501
+@print{} 3.146086215131436
+@print{} 3.142714599645370
+@print{} 3.141873049979825
+@dots{}
+@print{} 3.141592653589797
+@print{} 3.141592653589797
+@end example
+
+There is no need to be unduly suspicious about the results from
+floating-point arithmetic. The lesson to remember is that
+floating-point arithmetic is always more complex than arithmetic using
+pencil and paper. In order to take advantage of the power
+of computer floating-point, you need to know its limitations
+and work within them. For most casual use of floating-point arithmetic,
+you will often get the expected result in the end if you simply round
+the display of your final results to the correct number of significant
+decimal digits.
+
+As general advice, avoid presenting numerical data in a manner that
+implies better precision than is actually the case.
+
+@menu
+* Floating-point Representation:: Binary floating-point representation.
+* Floating-point Context:: Floating-point context.
+* Rounding Mode:: Floating-point rounding mode.
+@end menu
+
+@node Floating-point Representation
+@subsection Binary Floating-point Representation
+@cindex IEEE-754 format
+
+Although floating-point representations vary from machine to machine,
+the most commonly encountered representation is that defined by the
+IEEE 754 Standard. An IEEE-754 format value has three components:
+
+@itemize @bullet
+@item
+A sign bit telling whether the number is positive or negative.
+
+@item
+An @dfn{exponent}, @var{e}, giving its order of magnitude.
+
+@item
+A @dfn{significand}, @var{s},
+specifying the actual digits of the number.
+@end itemize
+
+The value of the
+number is then
+@iftex
+@math{s @cdot 2^e}.
+@end iftex
+@ifnottex
+@var{s * 2^e}.
+@end ifnottex
+The first bit of a non-zero binary significand
+is always one, so the significand in an IEEE-754 format only includes the
+fractional part, leaving the leading one implicit.
+The significand is stored in @dfn{normalized} format,
+which means that the first bit is always a one.
+
+Three of the standard IEEE-754 types are 32-bit single precision,
+64-bit double precision and 128-bit quadruple precision.
+The standard also specifies extended precision formats
+to allow greater precisions and larger exponent ranges.
+
+@node Floating-point Context
+@subsection Floating-point Context
+@cindex context, floating-point
+
+A floating-point @dfn{context} defines the environment for arithmetic operations.
+It governs precision, sets rules for rounding, and limits the range for exponents.
+The context has the following primary components:
+
+@table @dfn
+@item Precision
+Precision of the floating-point format in bits.
+@item emax
+Maximum exponent allowed for this format.
+@item emin
+Minimum exponent allowed for this format.
+@item Underflow behavior
+The format may or may not support gradual underflow.
+@item Rounding
+The rounding mode of this context.
+@end table
+
+@ref{table-ieee-formats} lists the precision and exponent
+field values for the basic IEEE-754 binary formats:
+
+@float Table,table-ieee-formats
+@caption{Basic IEEE Format Context Values}
+@multitable @columnfractions .20 .20 .20 .20 .20
+@headitem Name @tab Total bits @tab Precision @tab emin @tab emax
+@item Single @tab 32 @tab 24 @tab @minus{}126 @tab +127
+@item Double @tab 64 @tab 53 @tab @minus{}1022 @tab +1023
+@item Quadruple @tab 128 @tab 113 @tab @minus{}16382 @tab +16383
+@end multitable
+@end float
+
+@quotation NOTE
+The precision numbers include the implied leading one that gives them
+one extra bit of significand.
+@end quotation
+
+A floating-point context can also determine which signals are treated
+as exceptions, and can set rules for arithmetic with special values.
+Please consult the IEEE-754 standard or other resources for details.
+
+@command{gawk} ordinarily uses the hardware double precision
+representation for numbers. On most systems, this is IEEE-754
+floating-point format, corresponding to 64-bit binary with 53 bits
+of precision.
+
+@quotation NOTE
+In case an underflow occurs, the standard allows, but does not require,
+the result from an arithmetic operation to be a number smaller than
+the smallest nonzero normalized number. Such numbers do
+not have as many significant digits as normal numbers, and are called
+@dfn{denormals} or @dfn{subnormals}. The alternative, simply returning a zero,
+is called @dfn{flush to zero}. The basic IEEE-754 binary formats
+support subnormal numbers.
+@end quotation
+
+@node Rounding Mode
+@subsection Floating-point Rounding Mode
+@cindex rounding mode, floating-point
+
+The @dfn{rounding mode} specifies the behavior for the results of numerical
+operations when discarding extra precision. Each rounding mode indicates
+how the least significant returned digit of a rounded result is to
+be calculated.
+@ref{table-rounding-modes} lists the IEEE-754 defined
+rounding modes:
+
+@float Table,table-rounding-modes
+@caption{IEEE 754 Rounding Modes}
+@multitable @columnfractions .45 .55
+@headitem Rounding Mode @tab IEEE Name
+@item Round to nearest, ties to even @tab @code{roundTiesToEven}
+@item Round toward plus Infinity @tab @code{roundTowardPositive}
+@item Round toward negative Infinity @tab @code{roundTowardNegative}
+@item Round toward zero @tab @code{roundTowardZero}
+@item Round to nearest, ties away from zero @tab @code{roundTiesToAway}
+@end multitable
+@end float
+
+The default mode @code{roundTiesToEven} is the most preferred,
+but the least intuitive. This method does the obvious thing for most values,
+by rounding them up or down to the nearest digit.
+For example, rounding 1.132 to two digits yields 1.13,
+and rounding 1.157 yields 1.16.
+
+However, when it comes to rounding a value that is exactly halfway between,
+things do not work the way you probably learned in school.
+In this case, the number is rounded to the nearest even digit.
+So rounding 0.125 to two digits rounds down to 0.12,
+but rounding 0.6875 to three digits rounds up to 0.688.
+You probably have already encountered this rounding mode when
+using the @code{printf} routine to format floating-point numbers.
+For example:
+
+@example
+BEGIN @{
+ x = -4.5
+ for (i = 1; i < 10; i++) @{
+ x += 1.0
+ printf("%4.1f => %2.0f\n", x, x)
+ @}
+@}
+@end example
+
+@noindent
+produces the following output when run:@footnote{It
+is possible for the output to be completely different if the
+C library in your system does not use the IEEE-754 even-rounding
+rule to round halfway cases for @code{printf()}.}
+
+@example
+-3.5 => -4
+-2.5 => -2
+-1.5 => -2
+-0.5 => 0
+ 0.5 => 0
+ 1.5 => 2
+ 2.5 => 2
+ 3.5 => 4
+ 4.5 => 4
+@end example
+
+The theory behind the rounding mode @code{roundTiesToEven} is that
+it more or less evenly distributes upward and downward rounds
+of exact halves, which might cause the round-off error
+to cancel itself out. This is the default rounding mode used
+in IEEE-754 computing functions and operators.
+
+The other rounding modes are rarely used.
+Round toward positive infinity (@code{roundTowardPositive})
+and round toward negative infinity (@code{roundTowardNegative})
+are often used to implement interval arithmetic,
+where you adjust the rounding mode to calculate upper and lower bounds
+for the range of output. The @code{roundTowardZero}
+mode can be used for converting floating-point numbers to integers.
+The rounding mode @code{roundTiesToAway} rounds the result to the
+nearest number and selects the number with the larger magnitude
+if a tie occurs.
+
+Some numerical analysts will tell you that your choice of rounding style
+has tremendous impact on the final outcome, and advise you to wait until
+final output for any rounding. Instead, you can often avoid round-off error problems by
+setting the precision initially to some value sufficiently larger than
+the final desired precision, so that the accumulation of round-off error
+does not influence the outcome.
+If you suspect that results from your computation are
+sensitive to accumulation of round-off error,
+one way to be sure is to look for a significant difference in output
+when you change the rounding mode.
+
+@node Gawk and MPFR
+@section @command{gawk} + MPFR = Powerful Arithmetic
+
+The rest of this @value{CHAPTER} describes how to use the arbitrary precision
+(also known as @dfn{multiple precision} or @dfn{infinite precision}) numeric
+capabilities in @command{gawk} to produce maximally accurate results
+when you need it.
+
+But first you should check if your version of
+@command{gawk} supports arbitrary precision arithmetic.
+The easiest way to find out is to look at the output of
+the following command:
+
+@example
+$ @kbd{gawk --version}
+@print{} GNU Awk 4.1.0 (GNU MPFR 3.1.0, GNU MP 5.0.3)
+@print{} Copyright (C) 1989, 1991-2012 Free Software Foundation.
+@dots{}
+@end example
+
+@command{gawk} uses the
+@uref{http://www.mpfr.org, GNU MPFR}
+and
+@uref{http://gmplib.org, GNU MP} (GMP)
+libraries for arbitrary precision
+arithmetic on numbers. So if you do not see the names of these libraries
+in the output, then your version of @command{gawk} does not support
+arbitrary precision arithmetic.
+
+Additionally,
+there are a few elements available in the @code{PROCINFO} array
+to provide information about the MPFR and GMP libraries.
+@xref{Auto-set}, for more information.
+
@ignore
-@c Try this
+Even if you aren't interested in arbitrary precision arithmetic, you
+may still benefit from knowing about how @command{gawk} handles numbers
+in general, and the limitations of doing arithmetic with ordinary
+@command{gawk} numbers.
+@end ignore
+
+
+@node Arbitrary Precision Floats
+@section Arbitrary Precision Floating-point Arithmetic with @command{gawk}
+
+@command{gawk} uses the GNU MPFR library
+for arbitrary precision floating-point arithmetic. The MPFR library
+provides precise control over precisions and rounding modes, and gives
+correctly rounded, reproducible, platform-independent results. With the
+command-line option @option{--bignum} or @option{-M},
+all floating-point arithmetic operators and numeric functions can yield
+results to any desired precision level supported by MPFR.
+Two built-in variables, @code{PREC} and @code{ROUNDMODE},
+provide control over the working precision and the rounding mode
+(@pxref{Setting Precision}, and
+@pxref{Setting Rounding Mode}).
+The precision and the rounding mode are set globally for every operation
+to follow.
+
+The default working precision for arbitrary precision floating-point values is 53,
+and the default value for @code{ROUNDMODE} is @code{"N"},
+which selects the IEEE-754 @code{roundTiesToEven} rounding mode
+(@pxref{Rounding Mode}).@footnote{The
+default precision is 53, since according to the MPFR documentation,
+the library should be able to exactly reproduce all computations with
+double-precision machine floating-point numbers (@code{double} type
+in C), except the default exponent range is much wider and subnormal
+numbers are not implemented.}
+@command{gawk} uses the default exponent range in MPFR
@iftex
-@page
-@headings off
-@majorheading III@ @ @ Appendixes
-Part III provides the appendixes, the Glossary, and two licenses that cover
+(@math{emax = 2^{30} - 1, emin = -emax})
+@end iftex
+@ifnottex
+(@var{emax} = 2^30 @minus{} 1, @var{emin} = @minus{}@var{emax})
+@end ifnottex
+for all floating-point contexts.
+There is no explicit mechanism to adjust the exponent range.
+MPFR does not implement subnormal numbers by default,
+and this behavior cannot be changed in @command{gawk}.
+
+@quotation NOTE
+When emulating an IEEE-754 format (@pxref{Setting Precision}),
+@command{gawk} internally adjusts the exponent range
+to the value defined for the format and also performs computations needed for
+gradual underflow (subnormal numbers).
+@end quotation
+
+@quotation NOTE
+MPFR numbers are variable-size entities, consuming only as much space as
+needed to store the significant digits. Since the performance using MPFR
+numbers pales in comparison to doing arithmetic using the underlying machine
+types, you should consider using only as much precision as needed by
+your program.
+@end quotation
+
+@menu
+* Setting Precision:: Setting the working precision.
+* Setting Rounding Mode:: Setting the rounding mode.
+* Floating-point Constants:: Representing floating-point constants.
+* Changing Precision:: Changing the precision of a number.
+* Exact Arithmetic:: Exact arithmetic with floating-point numbers.
+@end menu
+
+@node Setting Precision
+@subsection Setting the Working Precision
+@cindex @code{PREC} variable
+
+@command{gawk} uses a global working precision; it does not keep track of
+the precision or accuracy of individual numbers. Performing an arithmetic
+operation or calling a built-in function rounds the result to the current
+working precision. The default working precision is 53, which can be
+modified using the built-in variable @code{PREC}. You can also set the
+value to one of the following pre-defined case-insensitive strings
+to emulate an IEEE-754 binary format:
+
+@multitable {@code{"double"}} {12345678901234567890123456789012345}
+@headitem @code{PREC} @tab IEEE-754 Binary Format
+@item @code{"half"} @tab 16-bit half-precision.
+@item @code{"single"} @tab Basic 32-bit single precision.
+@item @code{"double"} @tab Basic 64-bit double precision.
+@item @code{"quad"} @tab Basic 128-bit quadruple precision.
+@item @code{"oct"} @tab 256-bit octuple precision.
+@end multitable
+
+The following example illustrates the effects of changing precision
+on arithmetic operations:
+
+@example
+$ @kbd{gawk -M -v PREC=100 'BEGIN @{ x = 1.0e-400; print x + 0; \}
+> @kbd{PREC = "double"; print x + 0 @}'}
+@print{} 1e-400
+@print{} 0
+@end example
+
+Binary and decimal precisions are related approximately, according to the
+formula:
+
+@iftex
+@math{prec = 3.322 @cdot dps}
+@end iftex
+@ifnottex
+@var{prec} = 3.322 * @var{dps}
+@end ifnottex
+
+@noindent
+Here, @var{prec} denotes the binary precision
+(measured in bits) and @var{dps} (short for decimal places)
+is the decimal digits. We can easily calculate how many decimal
+digits the 53-bit significand of an IEEE double is equivalent to:
+53 / 3.332 which is equal to about 15.95.
+But what does 15.95 digits actually mean? It depends whether you are
+concerned about how many digits you can rely on, or how many digits
+you need.
+
+It is important to know how many bits it takes to uniquely identify
+a double-precision value (the C type @code{double}). If you want to
+convert from @code{double} to decimal and back to @code{double} (e.g.,
+saving a @code{double} representing an intermediate result to a file, and
+later reading it back to restart the computation), then a few more decimal
+digits are required. 17 digits is generally enough for a @code{double}.
+
+It can also be important to know what decimal numbers can be uniquely
+represented with a @code{double}. If you want to convert
+from decimal to @code{double} and back again, 15 digits is the most that
+you can get. Stated differently, you should not present
+the numbers from your floating-point computations with more than 15
+significant digits in them.
+
+Conversely, it takes a precision of 332 bits to hold an approximation
+of the constant @value{PI} that is accurate to 100 decimal places.
+
+You should always add some extra bits in order to avoid the confusing round-off
+issues that occur because numbers are stored internally in binary.
+
+@node Setting Rounding Mode
+@subsection Setting the Rounding Mode
+@cindex @code{ROUNDMODE} variable
+
+The @code{ROUNDMODE} variable provides
+program level control over the rounding mode.
+The correspondence between @code{ROUNDMODE} and the IEEE
+rounding modes is shown in @ref{table-gawk-rounding-modes}.
+
+@float Table,table-gawk-rounding-modes
+@caption{@command{gawk} Rounding Modes}
+@multitable @columnfractions .45 .30 .25
+@headitem Rounding Mode @tab IEEE Name @tab @code{ROUNDMODE}
+@item Round to nearest, ties to even @tab @code{roundTiesToEven} @tab @code{"N"} or @code{"n"}
+@item Round toward plus Infinity @tab @code{roundTowardPositive} @tab @code{"U"} or @code{"u"}
+@item Round toward negative Infinity @tab @code{roundTowardNegative} @tab @code{"D"} or @code{"d"}
+@item Round toward zero @tab @code{roundTowardZero} @tab @code{"Z"} or @code{"z"}
+@item Round to nearest, ties away from zero @tab @code{roundTiesToAway} @tab @code{"A"} or @code{"a"}
+@end multitable
+@end float
+
+@code{ROUNDMODE} has the default value @code{"N"},
+which selects the IEEE-754 rounding mode @code{roundTiesToEven}.
+@ref{table-gawk-rounding-modes}, lists @code{"A"} to select the IEEE-754 mode
+@code{roundTiesToAway}. This is only available
+if your version of the MPFR library supports it; otherwise setting
+@code{ROUNDMODE} to this value has no effect. @xref{Rounding Mode},
+for the meanings of the various rounding modes.
+
+Here is an example of how to change the default rounding behavior of
+@code{printf}'s output:
+
+@example
+$ @kbd{gawk -M -v ROUNDMODE="Z" 'BEGIN @{ printf("%.2f\n", 1.378) @}'}
+@print{} 1.37
+@end example
+
+@node Floating-point Constants
+@subsection Representing Floating-point Constants
+@cindex constants, floating-point
+
+Be wary of floating-point constants! When reading a floating-point constant
+from program source code, @command{gawk} uses the default precision,
+unless overridden
+by an assignment to the special variable @code{PREC} on the command
+line, to store it internally as a MPFR number.
+Changing the precision using @code{PREC} in the program text does
+@emph{not} change the precision of a constant. If you need to
+represent a floating-point constant at a higher precision than the
+default and cannot use a command line assignment to @code{PREC},
+you should either specify the constant as a string, or
+as a rational number, whenever possible. The following example
+illustrates the differences among various ways to
+print a floating-point constant:
+
+@example
+$ @kbd{gawk -M 'BEGIN @{ PREC = 113; printf("%0.25f\n", 0.1) @}'}
+@print{} 0.1000000000000000055511151
+$ @kbd{gawk -M -v PREC=113 'BEGIN @{ printf("%0.25f\n", 0.1) @}'}
+@print{} 0.1000000000000000000000000
+$ @kbd{gawk -M 'BEGIN @{ PREC = 113; printf("%0.25f\n", "0.1") @}'}
+@print{} 0.1000000000000000000000000
+$ @kbd{gawk -M 'BEGIN @{ PREC = 113; printf("%0.25f\n", 1/10) @}'}
+@print{} 0.1000000000000000000000000
+@end example
+
+In the first case, the number is stored with the default precision of 53.
+
+@node Changing Precision
+@subsection Changing the Precision of a Number
+
+@cindex Laurie, Dirk
+@quotation
+@i{The point is that in any variable-precision package,
+a decision is made on how to treat numbers given as data,
+or arising in intermediate results, which are represented in
+floating-point format to a precision lower than working precision.
+Do we promote them to full membership of the high-precision club,
+or do we treat them and all their associates as second-class citizens?
+Sometimes the first course is proper, sometimes the second, and it takes
+careful analysis to tell which.}
+
+Dirk Laurie@footnote{Dirk Laurie.
+@cite{Variable-precision Arithmetic Considered Perilous --- A Detective Story}.
+Electronic Transactions on Numerical Analysis. Volume 28, pp. 168-173, 2008.}
+@end quotation
+
+@command{gawk} does not implicitly modify the precision of any previously
+computed results when the working precision is changed with an assignment
+to @code{PREC}. The precision of a number is always the one that was
+used at the time of its creation, and there is no way for the user
+to explicitly change it afterwards. However, since the result of a
+floating-point arithmetic operation is always an arbitrary precision
+floating-point value---with a precision set by the value of @code{PREC}---one of the
+following workarounds effectively accomplishes the desired behavior:
+
+@example
+x = x + 0.0
+@end example
+
+@noindent
+or:
+
+@example
+x += 0.0
+@end example
+
+@node Exact Arithmetic
+@subsection Exact Arithmetic with Floating-point Numbers
+
+@quotation CAUTION
+Never depend on the exactness of floating-point arithmetic,
+even for apparently simple expressions!
+@end quotation
+
+Can arbitrary precision arithmetic give exact results? There are
+no easy answers. The standard rules of algebra often do not apply
+when using floating-point arithmetic.
+Among other things, the distributive and associative laws
+do not hold completely, and order of operation may be important
+for your computation. Rounding error, cumulative precision loss
+and underflow are often troublesome.
+
+When @command{gawk} tests the expressions @samp{0.1 + 12.2} and @samp{12.3}
+for equality
+using the machine double precision arithmetic, it decides that they
+are not equal!
+(@xref{Floating-point Programming}.)
+You can get the result you want by increasing the precision;
+56 in this case will get the job done:
+
+@example
+$ @kbd{gawk -M -v PREC=56 'BEGIN @{ print (0.1 + 12.2 == 12.3) @}'}
+@print{} 1
+@end example
+
+If adding more bits is good, perhaps adding even more bits of
+precision is better?
+Here is what happens if we use an even larger value of @code{PREC}:
+
+@example
+$ @kbd{gawk -M -v PREC=201 'BEGIN @{ print (0.1 + 12.2 == 12.3) @}'}
+@print{} 0
+@end example
+
+This is not a bug in @command{gawk} or in the MPFR library.
+It is easy to forget that the finite number of bits used to store the value
+is often just an approximation after proper rounding.
+The test for equality succeeds if and only if @emph{all} bits in the two operands
+are exactly the same. Since this is not necessarily true after floating-point
+computations with a particular precision and effective rounding rule,
+a straight test for equality may not work.
+
+So, don't assume that floating-point values can be compared for equality.
+You should also exercise caution when using other forms of comparisons.
+The standard way to compare between floating-point numbers is to determine
+how much error (or @dfn{tolerance}) you will allow in a comparison and
+check to see if one value is within this error range of the other.
+
+In applications where 15 or fewer decimal places suffice,
+hardware double precision arithmetic can be adequate, and is usually much faster.
+But you do need to keep in mind that every floating-point operation
+can suffer a new rounding error with catastrophic consequences as illustrated
+by our earlier attempt to compute the value of the constant @value{PI}
+(@pxref{Floating-point Programming}).
+Extra precision can greatly enhance the stability and the accuracy
+of your computation in such cases.
+
+Repeated addition is not necessarily equivalent to multiplication
+in floating-point arithmetic. In the example in
+@ref{Floating-point Programming}:
+
+@example
+$ @kbd{gawk 'BEGIN @{}
+> @kbd{for (d = 1.1; d <= 1.5; d += 0.1)}
+> @kbd{i++}
+> @kbd{print i}
+> @kbd{@}'}
+@print{} 4
+@end example
+
+@noindent
+you may or may not succeed in getting the correct result by choosing
+an arbitrarily large value for @code{PREC}. Reformulation of
+the problem at hand is often the correct approach in such situations.
+
+@node Arbitrary Precision Integers
+@section Arbitrary Precision Integer Arithmetic with @command{gawk}
+@cindex integer, arbitrary precision
+
+If the option @option{--bignum} or @option{-M} is specified,
+@command{gawk} performs all
+integer arithmetic using GMP arbitrary precision integers.
+Any number that looks like an integer in a program source or data file
+is stored as an arbitrary precision integer.
+The size of the integer is limited only by your computer's memory.
+The current floating-point context has no effect on operations involving integers.
+For example, the following computes
+@iftex
+@math{5^{4^{3^{2}}}},
+@end iftex
+@ifnottex
+5^4^3^2,
+@end ifnottex
+the result of which is beyond the
+limits of ordinary @command{gawk} numbers:
+
+@example
+$ @kbd{gawk -M 'BEGIN @{}
+> @kbd{x = 5^4^3^2}
+> @kbd{print "# of digits =", length(x)}
+> @kbd{print substr(x, 1, 20), "...", substr(x, length(x) - 19, 20)}
+> @kbd{@}'}
+@print{} # of digits = 183231
+@print{} 62060698786608744707 ... 92256259918212890625
+@end example
+
+If you were to compute the same value using arbitrary precision
+floating-point values instead, the precision needed for correct output
+(using the formula
+@iftex
+@math{prec = 3.322 @cdot dps}),
+would be @math{3.322 @cdot 183231},
+@end iftex
+@ifnottex
+@samp{prec = 3.322 * dps}),
+would be 3.322 x 183231,
+@end ifnottex
+or 608693.
+
+The result from an arithmetic operation with an integer and a floating-point value
+is a floating-point value with a precision equal to the working precision.
+The following program calculates the eighth term in
+Sylvester's sequence@footnote{Weisstein, Eric W.
+@cite{Sylvester's Sequence}. From MathWorld---A Wolfram Web Resource.
+@url{http://mathworld.wolfram.com/SylvestersSequence.html}}
+using a recurrence:
+
+@example
+$ @kbd{gawk -M 'BEGIN @{}
+> @kbd{s = 2.0}
+> @kbd{for (i = 1; i <= 7; i++)}
+> @kbd{s = s * (s - 1) + 1}
+> @kbd{print s}
+> @kbd{@}'}
+@print{} 113423713055421845118910464
+@end example
+
+The output differs from the actual number, 113,423,713,055,421,844,361,000,443,
+because the default precision of 53 is not enough to represent the
+floating-point results exactly. You can either increase the precision
+(100 is enough in this case), or replace the floating-point constant
+@samp{2.0} with an integer, to perform all computations using integer
+arithmetic to get the correct output.
+
+It will sometimes be necessary for @command{gawk} to implicitly convert an
+arbitrary precision integer into an arbitrary precision floating-point value.
+This is primarily because the MPFR library does not always provide the
+relevant interface to process arbitrary precision integers or mixed-mode
+numbers as needed by an operation or function.
+In such a case, the precision is set to the minimum value necessary
+for exact conversion, and the working precision is not used for this purpose.
+If this is not what you need or want, you can employ a subterfuge
+like this:
+
+@example
+gawk -M 'BEGIN @{ n = 13; print (n + 0.0) % 2.0 @}'
+@end example
+
+You can avoid this issue altogether by specifying the number as a floating-point value
+to begin with:
+
+@example
+gawk -M 'BEGIN @{ n = 13.0; print n % 2.0 @}'
+@end example
+
+Note that for the particular example above, there is likely best
+to just use the following:
+
+@example
+gawk -M 'BEGIN @{ n = 13; print n % 2 @}'
+@end example
+
+@node Dynamic Extensions
+@chapter Writing Extensions for @command{gawk}
+
+It is possible to add new built-in functions to @command{gawk} using
+dynamically loaded libraries. This facility is available on systems (such
+as GNU/Linux) that support the C @code{dlopen()} and @code{dlsym()}
+functions. This @value{CHAPTER} describes how to create extensions
+using code written in C or C++. If you don't know anything about C
+programming, you can safely skip this @value{CHAPTER}, although you
+may wish to review the documentation on the extensions that come with
+@command{gawk} (@pxref{Extension Samples}), and the section on the
+@code{gawkextlib} project (@pxref{gawkextlib}).
+
+@quotation NOTE
+When @option{--sandbox} is specified, extensions are disabled
+(@pxref{Options}).
+@end quotation
+
+@menu
+* Extension Intro:: What is an extension.
+* Plugin License:: A note about licensing.
+* Extension Design:: Design notes about the extension API.
+* Extension API Description:: A full description of the API.
+* Extension Example:: Example C code for an extension.
+* Extension Samples:: The sample extensions that ship with
+ @code{gawk}.
+* gawkextlib:: The @code{gawkextlib} project.
+@end menu
+
+@node Extension Intro
+@section Introduction
+
+An @dfn{extension} (sometimes called a @dfn{plug-in}) is a piece of
+external compiled code that @command{gawk} can load at runtime to
+provide additional functionality, over and above the built-in capabilities
+described in the rest of this @value{DOCUMENT}.
+
+Extensions are useful because they allow you (of course) to extend
+@command{gawk}'s functionality. For example, they can provide access to
+system calls (such as @code{chdir()} to change directory) and to other
+C library routines that could be of use. As with most software,
+``the sky is the limit;'' if you can imagine something that you might
+want to do and can write in C or C++, you can write an extension to do it!
+
+Extensions are written in C or C++, using the @dfn{Application Programming
+Interface} (API) defined for this purpose by the @command{gawk}
+developers. The rest of this @value{CHAPTER} explains the design
+decisions behind the API, the facilities it provides and how to use
+them, and presents a small sample extension. In addition, it documents
+the sample extensions included in the @command{gawk} distribution,
+and describes the @code{gawkextlib} project.
+
+@node Plugin License
+@section Extension Licensing
+
+Every dynamic extension should define the global symbol
+@code{plugin_is_GPL_compatible} to assert that it has been licensed under
+a GPL-compatible license. If this symbol does not exist, @command{gawk}
+emits a fatal error and exits when it tries to load your extension.
+
+The declared type of the symbol should be @code{int}. It does not need
+to be in any allocated section, though. The code merely asserts that
+the symbol exists in the global scope. Something like this is enough:
+
+@example
+int plugin_is_GPL_compatible;
+@end example
+
+@node Extension Design
+@section Extension API Design
+
+The first version of extensions for @command{gawk} was developed in
+the mid-1990s and released with @command{gawk} 3.1 in the late 1990s.
+The basic mechanisms and design remained unchanged for close to 15 years,
+until 2012.
+
+The old extension mechanism used data types and functions from
+@command{gawk} itself, with a ``clever hack'' to install extension
+functions.
+
+@command{gawk} included some sample extensions, of which a few were
+really useful. However, it was clear from the outset that the extension
+mechanism was bolted onto the side and was not really thought out.
+
+@menu
+* Old Extension Problems:: Problems with the old mechanism.
+* Extension New Mechanism Goals:: Goals for the new mechanism.
+* Extension Other Design Decisions:: Some other design decisions.
+* Extension Mechanism Outline:: An outline of how it works.
+* Extension Future Growth:: Some room for future growth.
+@end menu
+
+@node Old Extension Problems
+@subsection Problems With The Old Mechanism
+
+The old extension mechanism had several problems:
+
+@itemize @bullet
+@item
+It depended heavily upon @command{gawk} internals. Any time the
+@code{NODE} structure@footnote{A critical central data structure
+inside @command{gawk}.} changed, an extension would have to be
+recompiled. Furthermore, to really write extensions required understanding
+something about @command{gawk}'s internal functions. There was some
+documentation in this @value{DOCUMENT}, but it was quite minimal.
+
+@item
+Being able to call into @command{gawk} from an extension required linker
+facilities that are common on Unix-derived systems but that did
+not work on Windows systems; users wanting extensions on Windows
+had to statically link them into @command{gawk}, even though Windows supports
+dynamic loading of shared objects.
+
+@item
+The API would change occasionally as @command{gawk} changed; no compatibility
+between versions was ever offered or planned for.
+@end itemize
+
+Despite the drawbacks, the @command{xgawk} project developers forked
+@command{gawk} and developed several significant extensions. They also
+enhanced @command{gawk}'s facilities relating to file inclusion and
+shared object access.
+
+A new API was desired for a long time, but only in 2012 did the
+@command{gawk} maintainer and the @command{xgawk} developers finally
+start working on it together. More information about the @command{xgawk}
+project is provided in @ref{gawkextlib}.
+
+@node Extension New Mechanism Goals
+@subsection Goals For A New Mechanism
+
+Some goals for the new API were:
+
+@itemize @bullet
+@item
+The API should be independent of @command{gawk} internals. Changes in
+@command{gawk} internals should not be visible to the writer of an
+extension function.
+
+@item
+The API should provide @emph{binary} compatibility across @command{gawk}
+releases as long as the API itself does not change.
+
+@item
+The API should enable extensions written in C to have roughly the
+same ``appearance'' to @command{awk}-level code as @command{awk}
+functions do. This means that extensions should have:
+
+@itemize @minus
+@item
+The ability to access function parameters.
+
+@item
+The ability to turn an undefined parameter into an array (call by reference).
+
+@item
+The ability to create, access and update global variables.
+
+@item
+Easy access to all the elements of an array at once (``array flattening'')
+in order to loop over all the element in an easy fashion for C code.
+
+@item
+The ability to create arrays (including @command{gawk}'s true
+multi-dimensional arrays).
+@end itemize
+@end itemize
+
+Some additional important goals were:
+
+@itemize @bullet
+@item
+The API should use only features in ISO C 90, so that extensions
+can be written using the widest range of C and C++ compilers. The header
+should include the appropriate @samp{#ifdef __cplusplus} and @samp{extern "C"}
+magic so that a C++ compiler could be used. (If using C++, the runtime
+system has to be smart enough to call any constructors and destructors,
+as @command{gawk} is a C program. As of this writing, this has not been
+tested.)
+
+@item
+The API mechanism should not require access to @command{gawk}'s
+symbols@footnote{The @dfn{symbols} are the variables and functions
+defined inside @command{gawk}. Access to these symbols by code
+external to @command{gawk} loaded dynamically at runtime is
+problematic on Windows.} by the compile-time or dynamic linker,
+in order to enable creation of extensions that also work on Windows.
+@end itemize
+
+During development, it became clear that there were other features
+that should be available to extensions, which were also subsequently
+provided:
+
+@itemize @bullet
+@item
+Extensions should have the ability to hook into @command{gawk}'s
+I/O redirection mechanism. In particular, the @command{xgawk}
+developers provided a so-called ``open hook'' to take over reading
+records. During development, this was generalized to allow
+extensions to hook into input processing, output processing, and
+two-way I/O.
+
+@item
+An extension should be able to provide a ``call back'' function
+to perform clean up actions when @command{gawk} exits.
+
+@item
+An extension should be able to provide a version string so that
+@command{gawk}'s @option{--version} option can provide information
+about extensions as well.
+@end itemize
+
+@node Extension Other Design Decisions
+@subsection Other Design Decisions
+
+As an ``arbitrary'' design decision, extensions can read the values of
+built-in variables and arrays (such as @code{ARGV} and @code{FS}), but cannot
+change them, with the exception of @code{PROCINFO}.
+
+The reason for this is to prevent an extension function from affecting
+the flow of an @command{awk} program outside its control. While a real
+@command{awk} function can do what it likes, that is at the discretion
+of the programmer. An extension function should provide a service or
+make a C API available for use within @command{awk}, and not mess with
+@code{FS} or @code{ARGC} and @code{ARGV}.
+
+In addition, it becomes easy to start down a slippery slope. How
+much access to @command{gawk} facilities do extensions need?
+Do they need @code{getline}? What about calling @code{gsub()} or
+compiling regular expressions? What about calling into @command{awk}
+functions? (@emph{That} would be messy.)
+
+In order to avoid these issues, the @command{gawk} developers chose
+to start with the simplest, most basic features that are still truly useful.
+
+Another decision is that although @command{gawk} provides nice things like
+MPFR, and arrays indexed internally by integers, these features are not
+being brought out to the API in order to keep things simple and close to
+traditional @command{awk} semantics. (In fact, arrays indexed internally
+by integers are so transparent that they aren't even documented!)
+
+With time, the API will undoubtedly evolve; the @command{gawk} developers
+expect this to be driven by user needs. For now, the current API seems
+to provide a minimal yet powerful set of features for creating extensions.
+
+@node Extension Mechanism Outline
+@subsection At A High Level How It Works
+
+The requirement to avoid access to @command{gawk}'s symbols is, at first
+glance, a difficult one to meet.
+
+One design, apparently used by Perl and Ruby and maybe others, would
+be to make the mainline @command{gawk} code into a library, with the
+@command{gawk} utility a small C @code{main()} function linked against
+the library.
+
+This seemed like the tail wagging the dog, complicating build and
+installation and making a simple copy of the @command{gawk} executable
+from one system to another (or one place to another on the same
+system!) into a chancy operation.
+
+Pat Rankin suggested the solution that was adopted. Communication between
+@command{gawk} and an extension is two-way. First, when an extension
+is loaded, it is passed a pointer to a @code{struct} whose fields are
+function pointers.
+This is shown in @ref{load-extension}.
+
+@float Figure,load-extension
+@caption{Loading The Extension}
+@ifinfo
+@center @image{api-figure1, , , Loading the extension, txt}
+@end ifinfo
+@ifnotinfo
+@center @image{api-figure1, , , Loading the extension}
+@end ifnotinfo
+@end float
+
+The extension can call functions inside @command{gawk} through these
+function pointers, at runtime, without needing (link-time) access
+to @command{gawk}'s symbols. One of these function pointers is to a
+function for ``registering'' new built-in functions.
+This is shown in @ref{load-new-function}.
+
+@float Figure,load-new-function
+@caption{Loading The New Function}
+@ifinfo
+@center @image{api-figure2, , , Loading the new function, txt}
+@end ifinfo
+@ifnotinfo
+@center @image{api-figure2, , , Loading the new function}
+@end ifnotinfo
+@end float
+
+In the other direction, the extension registers its new functions
+with @command{gawk} by passing function pointers to the functions that
+provide the new feature (@code{do_chdir()}, for example). @command{gawk}
+associates the function pointer with a name and can then call it, using a
+defined calling convention.
+This is shown in @ref{call-new-function}.
+
+@float Figure,call-new-function
+@caption{Calling The New Function}
+@ifinfo
+@center @image{api-figure3, , , Calling the new function, txt}
+@end ifinfo
+@ifnotinfo
+@center @image{api-figure3, , , Calling the new function}
+@end ifnotinfo
+@end float
+
+The @code{do_@var{xxx}()} function, in turn, then uses the function
+pointers in the API @code{struct} to do its work, such as updating
+variables or arrays, printing messages, setting @code{ERRNO}, and so on.
+
+Convenience macros in the @file{gawkapi.h} header file make calling
+through the function pointers look like regular function calls so that
+extension code is quite readable and understandable.
+
+Although all of this sounds medium complicated, the result is that
+extension code is quite clean and straightforward. This can be seen in
+the sample extensions @file{filefuncs.c} (@pxref{Extension Example})
+and also the @file{testext.c} code for testing the APIs.
+
+Some other bits and pieces:
+
+@itemize @bullet
+@item
+The API provides access to @command{gawk}'s @code{do_@var{xxx}} values,
+reflecting command line options, like @code{do_lint}, @code{do_profiling}
+and so on (@pxref{Extension API Variables}).
+These are informational: an extension cannot affect these
+inside @command{gawk}. In addition, attempting to assign to them
+produces a compile-time error.
+
+@item
+The API also provides major and minor version numbers, so that an
+extension can check if the @command{gawk} it is loaded with supports the
+facilities it was compiled with. (Version mismatches ``shouldn't''
+happen, but we all know how @emph{that} goes.)
+@xref{Extension Versioning}, for details.
+@end itemize
+
+@node Extension Future Growth
+@subsection Room For Future Growth
+
+The API provides room for future growth, in two ways.
+
+An ``extension id'' is passed into the extension when its loaded. This
+extension id is then passed back to @command{gawk} with each function
+call. This allows @command{gawk} to identify the extension calling into it,
+should it need to know.
+
+A ``name space'' is passed into @command{gawk} when an extension function
+is registered. This provides for a future mechanism for grouping
+extension functions and possibly avoiding name conflicts.
+
+Of course, as of this writing, no decisions have been made with respect
+to any of the above.
+
+@node Extension API Description
+@section API Description
+
+This (rather large) @value{SECTION} describes the API in detail.
+
+@menu
+* Extension API Functions Introduction:: Introduction to the API functions.
+* General Data Types:: The data types.
+* Requesting Values:: How to get a value.
+* Constructor Functions:: Functions for creating values.
+* Registration Functions:: Functions to register things with
+ @command{gawk}.
+* Printing Messages:: Functions for printing messages.
+* Updating @code{ERRNO}:: Functions for updating @code{ERRNO}.
+* Accessing Parameters:: Functions for accessing parameters.
+* Symbol Table Access:: Functions for accessing global
+ variables.
+* Array Manipulation:: Functions for working with arrays.
+* Extension API Variables:: Variables provided by the API.
+* Extension API Boilerplate:: Boilerplate code for using the API.
+* Finding Extensions:: How @command{gawk} finds compiled
+ extensions.
+@end menu
+
+@node Extension API Functions Introduction
+@subsection Introduction
+
+Access to facilities within @command{gawk} are made available
+by calling through function pointers passed into your extension.
+
+API function pointers are provided for the following kinds of operations:
+
+@itemize @bullet
+@item
+Registrations functions. You may register:
+@itemize @minus
+@item
+extension functions,
+@item
+exit callbacks,
+@item
+a version string,
+@item
+input parsers,
+@item
+output wrappers,
+@item
+and two-way processors.
+@end itemize
+All of these are discussed in detail, later in this @value{CHAPTER}.
+
+@item
+Printing fatal, warning, and ``lint'' warning messages.
+
+@item
+Updating @code{ERRNO}, or unsetting it.
+
+@item
+Accessing parameters, including converting an undefined parameter into
+an array.
+
+@item
+Symbol table access: retrieving a global variable, creating one,
+or changing one. This also includes the ability to create a scalar
+variable that will be @emph{constant} within @command{awk} code.
+
+@item
+Creating and releasing cached values; this provides an
+efficient way to use values for multiple variables and
+can be a big performance win.
+
+@item
+Manipulating arrays:
+@itemize @minus
+@item
+Retrieving, adding, deleting, and modifying elements
+@item
+Getting the count of elements in an array
+@item
+Creating a new array
+@item
+Clearing an array
+@item
+Flattening an array for easy C style looping over all its indices and elements
+@end itemize
+@end itemize
+
+Some points about using the API:
+
+@itemize @bullet
+@item
+You must include @code{<sys/types.h>} and @code{<sys/stat.h>} before including
+the @file{gawkapi.h} header file. In addition, you must include either
+@code{<stddef.h>} or @code{<stdlib.h>} to get the definition of @code{size_t}.
+If you wish to use the boilerplate @code{dl_load_func()} macro, you will
+need to include @code{<stdio.h>} as well.
+Finally, to pass reasonable integer values for @code{ERRNO}, you
+will need to include @code{<errno.h>}.
+
+@item
+Although the API only uses ISO C 90 features, there is an exception; the
+``constructor'' functions use the @code{inline} keyword. If your compiler
+does not support this keyword, you should either place
+@samp{-Dinline=''} on your command line, or use the GNU Autotools and include a
+@file{config.h} file in your extensions.
+
+@item
+All pointers filled in by @command{gawk} are to memory
+managed by @command{gawk} and should be treated by the extension as
+read-only. Memory for @emph{all} strings passed into @command{gawk}
+from the extension @emph{must} come from @code{malloc()} and is managed
+by @command{gawk} from then on.
+
+@item
+The API defines several simple structs that map values as seen
+from @command{awk}. A value can be a @code{double}, a string, or an
+array (as in multidimensional arrays, or when creating a new array).
+Strings maintain both pointer and length since embedded @code{NUL}
+characters are allowed.
+
+By intent, strings are maintained using the current multibyte encoding (as
+defined by @env{LC_@var{xxx}} environment variables) and not using wide
+characters. This matches how @command{gawk} stores strings internally
+and also how characters are likely to be input and output from files.
+
+@item
+When retrieving a value (such as a parameter or that of a global variable
+or array element), the extension requests a specific type (number, string,
+scalars, value cookie, array, or ``undefined''). When the request is
+``undefined,'' the returned value will have the real underlying type.
+
+However, if the request and actual type don't match, the access function
+returns ``false'' and fills in the type of the actual value that is there,
+so that the extension can, e.g., print an error message
+(``scalar passed where array expected'').
+
+@c This is documented in the header file and needs some expanding upon.
+@c The table there should be presented here
+@end itemize
+
+While you may call the API functions by using the function pointers
+directly, the interface is not so pretty. To make extension code look
+more like regular code, the @file{gawkapi.h} header file defines a number
+of macros which you should use in your code. This @value{SECTION} presents
+the macros as if they were functions.
+
+@node General Data Types
+@subsection General Purpose Data Types
+
+@quotation
+@i{I have a true love/hate relationship with unions.}@*
+Arnold Robbins
+
+@i{That's the thing about unions: the compiler will arrange things so they
+can accommodate both love and hate.}@*
+Chet Ramey
+@end quotation
+
+The extension API defines a number of simple types and structures for general
+purpose use. Additional, more specialized, data structures, are introduced
+in subsequent @value{SECTION}s, together with the functions that use them.
+
+@table @code
+@item typedef void *awk_ext_id_t;
+A value of this type is received from @command{gawk} when an extension is loaded.
+That value must then be passed back to @command{gawk} as the first parameter of
+each API function.
+
+@item #define awk_const @dots{}
+This macro expands to @samp{const} when compiling an extension,
+and to nothing when compiling @command{gawk} itself. This makes
+certain fields in the API data structures unwritable from extension code,
+while allowing @command{gawk} to use them as it needs to.
+
+@item typedef int awk_bool_t;
+A simple boolean type. At the moment, the API does not define special
+``true'' and ``false'' values, although perhaps it should.
+
+@item typedef struct @{
+@itemx @ @ @ @ char *str;@ @ @ @ @ @ /* data */
+@itemx @ @ @ @ size_t len;@ @ @ @ @ /* length thereof, in chars */
+@itemx @} awk_string_t;
+This represents a mutable string. @command{gawk}
+owns the memory pointed to if it supplied
+the value. Otherwise, it takes ownership of the memory pointed to.
+@strong{Such memory must come from @code{malloc()}!}
+
+As mentioned earlier, strings are maintained using the current
+multibyte encoding.
+
+@item typedef enum @{
+@itemx @ @ @ @ AWK_UNDEFINED,
+@itemx @ @ @ @ AWK_NUMBER,
+@itemx @ @ @ @ AWK_STRING,
+@itemx @ @ @ @ AWK_ARRAY,
+@itemx @ @ @ @ AWK_SCALAR,@ @ @ @ @ @ @ @ @ /* opaque access to a variable */
+@itemx @ @ @ @ AWK_VALUE_COOKIE@ @ @ /* for updating a previously created value */
+@itemx @} awk_valtype_t;
+This @code{enum} indicates the type of a value.
+It is used in the following @code{struct}.
+
+@item typedef struct @{
+@itemx @ @ @ @ awk_valtype_t val_type;
+@itemx @ @ @ @ union @{
+@itemx @ @ @ @ @ @ @ @ awk_string_t@ @ @ @ @ @ @ s;
+@itemx @ @ @ @ @ @ @ @ double@ @ @ @ @ @ @ @ @ @ @ @ @ d;
+@itemx @ @ @ @ @ @ @ @ awk_array_t@ @ @ @ @ @ @ @ a;
+@itemx @ @ @ @ @ @ @ @ awk_scalar_t@ @ @ @ @ @ @ scl;
+@itemx @ @ @ @ @ @ @ @ awk_value_cookie_t@ vc;
+@itemx @ @ @ @ @} u;
+@itemx @} awk_value_t;
+An ``@command{awk} value.''
+The @code{val_type} member indicates what kind of value the
+@code{union} holds, and each member is of the appropriate type.
+
+@item #define str_value@ @ @ @ @ @ u.s
+@itemx #define num_value@ @ @ @ @ @ u.d
+@itemx #define array_cookie@ @ @ u.a
+@itemx #define scalar_cookie@ @ u.scl
+@itemx #define value_cookie@ @ @ u.vc
+These macros make accessing the fields of the @code{awk_value_t} more
+readable.
+
+@item typedef void *awk_scalar_t;
+Scalars can be represented as an opaque type. These values are obtained from
+@command{gawk} and then passed back into it. This is discussed in a general fashion below,
+and in more detail in @ref{Symbol table by cookie}.
+
+@item typedef void *awk_value_cookie_t;
+A ``value cookie'' is an opaque type representing a cached value.
+This is also discussed in a general fashion below,
+and in more detail in @ref{Cached values}.
+
+@end table
+
+Scalar values in @command{awk} are either numbers or strings. The
+@code{awk_value_t} struct represents values. The @code{val_type} member
+indicates what is in the @code{union}.
+
+Representing numbers is easy---the API uses a C @code{double}. Strings
+require more work. Since @command{gawk} allows embedded @code{NUL} bytes
+in string values, a string must be represented as a pair containing a
+data-pointer and length. This is the @code{awk_string_t} type.
+
+Identifiers (i.e., the names of global variables) can be associated
+with either scalar values or with arrays. In addition, @command{gawk}
+provides true arrays of arrays, where any given array element can
+itself be an array. Discussion of arrays is delayed until
+@ref{Array Manipulation}.
+
+The various macros listed earlier make it easier to use the elements
+of the @code{union} as if they were fields in a @code{struct}; this
+is a common coding practice in C. Such code is easier to write and to
+read, however it remains @emph{your} responsibility to make sure that
+the @code{val_type} member correctly reflects the type of the value in
+the @code{awk_value_t}.
+
+Conceptually, the first three members of the @code{union} (number, string,
+and array) are all that is needed for working with @command{awk} values.
+However, since the API provides routines for accessing and changing
+the value of global scalar variables only by using the variable's name,
+there is a performance penalty: @command{gawk} must find the variable
+each time it is accessed and changed. This turns out to be a real issue,
+not just a theoretical one.
+
+Thus, if you know that your extension will spend considerable time
+reading and/or changing the value of one or more scalar variables, you
+can obtain a @dfn{scalar cookie}@footnote{See
+@uref{http://catb.org/jargon/html/C/cookie.html, the ``cookie'' entry in the Jargon file} for a
+definition of @dfn{cookie}, and @uref{http://catb.org/jargon/html/M/magic-cookie.html,
+the ``magic cookie'' entry in the Jargon file} for a nice example. See
+also the entry for ``Cookie'' in the @ref{Glossary}.}
+object for that variable, and then use
+the cookie for getting the variable's value or for changing the variable's
+value.
+This is the @code{awk_scalar_t} type and @code{scalar_cookie} macro.
+Given a scalar cookie, @command{gawk} can directly retrieve or
+modify the value, as required, without having to first find it.
+
+The @code{awk_value_cookie_t} type and @code{value_cookie} macro are similar.
+If you know that you wish to
+use the same numeric or string @emph{value} for one or more variables,
+you can create the value once, retaining a @dfn{value cookie} for it,
+and then pass in that value cookie whenever you wish to set the value of a
+variable. This saves both storage space within the running @command{gawk}
+process as well as the time needed to create the value.
+
+@node Requesting Values
+@subsection Requesting Values
+
+All of the functions that return values from @command{gawk}
+work in the same way. You pass in an @code{awk_valtype_t} value
+to indicate what kind of value you expect. If the actual value
+matches what you requested, the function returns true and fills
+in the @code{awk_value_t} result.
+Otherwise, the function returns false, and the @code{val_type}
+member indicates the type of the actual value. You may then
+print an error message, or reissue the request for the actual
+value type, as appropriate. This behavior is summarized in
+@ref{table-value-types-returned}.
+
+@ifnotplaintext
+@float Table,table-value-types-returned
+@caption{Value Types Returned}
+@multitable @columnfractions .50 .50
+@headitem @tab Type of Actual Value:
+@end multitable
+@multitable @columnfractions .166 .166 .198 .15 .15 .166
+@headitem @tab @tab String @tab Number @tab Array @tab Undefined
+@item @tab @b{String} @tab String @tab String @tab false @tab false
+@item @tab @b{Number} @tab Number if can be converted, else false @tab Number @tab false @tab false
+@item @b{Type} @tab @b{Array} @tab false @tab false @tab Array @tab false
+@item @b{Requested:} @tab @b{Scalar} @tab Scalar @tab Scalar @tab false @tab false
+@item @tab @b{Undefined} @tab String @tab Number @tab Array @tab Undefined
+@item @tab @b{Value Cookie} @tab false @tab false @tab false @tab false
+@end multitable
+@end float
+@end ifnotplaintext
+@ifplaintext
+@float Table,table-value-types-returned
+@caption{Value Types Returned}
+@example
+ +-------------------------------------------------+
+ | Type of Actual Value: |
+ +------------+------------+-----------+-----------+
+ | String | Number | Array | Undefined |
++-----------+-----------+------------+------------+-----------+-----------+
+| | String | String | String | false | false |
+| |-----------+------------+------------+-----------+-----------+
+| | Number | Number if | Number | false | false |
+| | | can be | | | |
+| | | converted, | | | |
+| | | else false | | | |
+| |-----------+------------+------------+-----------+-----------+
+| Type | Array | false | false | Array | false |
+| Requested |-----------+------------+------------+-----------+-----------+
+| | Scalar | Scalar | Scalar | false | false |
+| |-----------+------------+------------+-----------+-----------+
+| | Undefined | String | Number | Array | Undefined |
+| |-----------+------------+------------+-----------+-----------+
+| | Value | false | false | false | false |
+| | Cookie | | | | |
++-----------+-----------+------------+------------+-----------+-----------+
+@end example
+@end float
+@end ifplaintext
+
+@node Constructor Functions
+@subsection Constructor Functions and Convenience Macros
+
+The API provides a number of @dfn{constructor} functions for creating
+string and numeric values, as well as a number of convenience macros.
+This @value{SUBSECTION} presents them all as function prototypes, in
+the way that extension code would use them.
+
+@table @code
+@item static inline awk_value_t *
+@itemx make_const_string(const char *string, size_t length, awk_value_t *result)
+This function creates a string value in the @code{awk_value_t} variable
+pointed to by @code{result}. It expects @code{string} to be a C string constant
+(or other string data), and automatically creates a @emph{copy} of the data
+for storage in @code{result}. It returns @code{result}.
+
+@item static inline awk_value_t *
+@itemx make_malloced_string(const char *string, size_t length, awk_value_t *result)
+This function creates a string value in the @code{awk_value_t} variable
+pointed to by @code{result}. It expects @code{string} to be a @samp{char *}
+value pointing to data previously obtained from @code{malloc()}. The idea here
+is that the data is passed directly to @command{gawk}, which assumes
+responsibility for it. It returns @code{result}.
+
+@item static inline awk_value_t *
+@itemx make_null_string(awk_value_t *result)
+This specialized function creates a null string (the ``undefined'' value)
+in the @code{awk_value_t} variable pointed to by @code{result}.
+It returns @code{result}.
+
+@item static inline awk_value_t *
+@itemx make_number(double num, awk_value_t *result)
+This function simply creates a numeric value in the @code{awk_value_t} variable
+pointed to by @code{result}.
+@end table
+
+Two convenience macros may be used for allocating storage from @code{malloc()}
+and @code{realloc()}. If the allocation fails, they cause @command{gawk} to
+exit with a fatal error message. They should be used as if they were
+procedure calls that do not return a value.
+
+@table @code
+@item emalloc(pointer, type, size, message)
+The arguments to this macro are as follows:
+@c nested table
+@table @code
+@item pointer
+The pointer variable to point at the allocated storage.
+
+@item type
+The type of the pointer variable, used to create a cast for the call to @code{malloc()}.
+
+@item size
+The total number of bytes to be allocated.
+
+@item message
+A message to be prefixed to the fatal error message. Typically this is the name
+of the function using the macro.
+@end table
+
+@noindent
+For example, you might allocate a string value like so:
+
+@example
+awk_value_t result;
+char *message;
+const char greet[] = "Don't Panic!";
+
+emalloc(message, char *, sizeof(greet), "myfunc");
+strcpy(message, greet);
+make_malloced_string(message, strlen(message), & result);
+@end example
+
+@item erealloc(pointer, type, size, message)
+This is like @code{emalloc()}, but it calls @code{realloc()},
+instead of @code{malloc()}.
+The arguments are the same as for the @code{emalloc()} macro.
+@end table
+
+@node Registration Functions
+@subsection Registration Functions
+
+This @value{SECTION} describes the API functions for
+registering parts of your extension with @command{gawk}.
+
+@menu
+* Extension Functions:: Registering extension functions.
+* Exit Callback Functions:: Registering an exit callback.
+* Extension Version String:: Registering a version string.
+* Input Parsers:: Registering an input parser.
+* Output Wrappers:: Registering an output wrapper.
+* Two-way processors:: Registering a two-way processor.
+@end menu
+
+@node Extension Functions
+@subsubsection Registering An Extension Function
+
+Extension functions are described by the following record:
+
+@example
+typedef struct @{
+@ @ @ @ const char *name;
+@ @ @ @ awk_value_t *(*function)(int num_actual_args, awk_value_t *result);
+@ @ @ @ size_t num_expected_args;
+@} awk_ext_func_t;
+@end example
+
+The fields are:
+
+@table @code
+@item const char *name;
+The name of the new function.
+@command{awk} level code calls the function by this name.
+This is a regular C string.
+
+@item awk_value_t *(*function)(int num_actual_args, awk_value_t *result);
+This is a pointer to the C function that provides the desired
+functionality.
+The function must fill in the result with either a number
+or a string. @command{awk} takes ownership of any string memory.
+As mentioned earlier, string memory @strong{must} come from @code{malloc()}.
+
+The function must return the value of @code{result}.
+This is for the convenience of the calling code inside @command{gawk}.
+
+@item size_t num_expected_args;
+This is the number of arguments the function expects to receive.
+Each extension function may decide what to do if the number of
+arguments isn't what it expected. Following @command{awk} functions, it
+is likely OK to ignore extra arguments.
+@end table
+
+Once you have a record representing your extension function, you register
+it with @command{gawk} using this API function:
+
+@table @code
+@item awk_bool_t add_ext_func(const char *namespace, const awk_ext_func_t *func);
+This function returns true upon success, false otherwise.
+The @code{namespace} parameter is currently not used; you should pass in an
+empty string (@code{""}). The @code{func} pointer is the address of a
+@code{struct} representing your function, as just described.
+@end table
+
+@node Exit Callback Functions
+@subsubsection Registering An Exit Callback Function
+
+An @dfn{exit callback} function is a function that
+@command{gawk} calls before it exits.
+Such functions are useful if you have general ``clean up'' tasks
+that should be performed in your extension (such as closing data
+base connections or other resource deallocations).
+You can register such
+a function with @command{gawk} using the following function.
+
+@table @code
+@item void awk_atexit(void (*funcp)(void *data, int exit_status),
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ void *arg0);
+The parameters are:
+@c nested table
+@table @code
+@item funcp
+A pointer to the function to be called before @command{gawk} exits. The @code{data}
+parameter will be the original value of @code{arg0}.
+The @code{exit_status} parameter is
+the exit status value that @command{gawk} will pass to the @code{exit()} system call.
+
+@item arg0
+A pointer to private data which @command{gawk} saves in order to pass to
+the function pointed to by @code{funcp}.
+@end table
+@end table
+
+Exit callback functions are called in Last-In-First-Out (LIFO) order---that is, in
+the reverse order in which they are registered with @command{gawk}.
+
+@node Extension Version String
+@subsubsection Registering An Extension Version String
+
+You can register a version string which indicates the name and
+version of your extension, with @command{gawk}, as follows:
+
+@table @code
+@item void register_ext_version(const char *version);
+Register the string pointed to by @code{version} with @command{gawk}.
+@command{gawk} does @emph{not} copy the @code{version} string, so
+it should not be changed.
+@end table
+
+@command{gawk} prints all registered extension version strings when it
+is invoked with the @option{--version} option.
+
+@node Input Parsers
+@subsubsection Customized Input Parsers
+
+By default, @command{gawk} reads text files as its input. It uses the value
+of @code{RS} to find the end of the record, and then uses @code{FS}
+(or @code{FIELDWIDTHS}) to split it into fields (@pxref{Reading Files}).
+Additionally, it sets the value of @code{RT} (@pxref{Built-in Variables}).
+
+If you want, you can provide your own, custom, input parser. An input
+parser's job is to return a record to the @command{gawk} record processing
+code, along with indicators for the value and length of the data to be
+used for @code{RT}, if any.
+
+To provide an input parser, you must first provide two functions
+(where @var{XXX} is a prefix name for your extension):
+
+@table @code
+@item awk_bool_t @var{XXX}_can_take_file(const awk_input_buf_t *iobuf)
+This function examines the information available in @code{iobuf}
+(which we discuss shortly). Based on the information there, it
+decides if the input parser should be used for this file.
+If so, it should return true. Otherwise, it should return false.
+It should not change any state (variable values, etc.) within @command{gawk}.
+
+@item awk_bool_t @var{XXX}_take_control_of(awk_input_buf_t *iobuf)
+When @command{gawk} decides to hand control of the file over to the
+input parser, it calls this function. This function in turn must fill
+in certain fields in the @code{awk_input_buf_t} structure, and ensure
+that certain conditions are true. It should then return true. If an
+error of some kind occurs, it should not fill in any fields, and should
+return false; then @command{gawk} will not use the input parser.
+The details are presented shortly.
+@end table
+
+Your extension should package these functions inside an
+@code{awk_input_parser_t}, which looks like this:
+
+@example
+typedef struct input_parser @{
+ const char *name; /* name of parser */
+ awk_bool_t (*can_take_file)(const awk_input_buf_t *iobuf);
+ awk_bool_t (*take_control_of)(awk_input_buf_t *iobuf);
+ awk_const struct input_parser *awk_const next; /* for use by gawk */
+@} awk_input_parser_t;
+@end example
+
+The fields are:
+
+@table @code
+@item const char *name;
+The name of the input parser. This is a regular C string.
+
+@item awk_bool_t (*can_take_file)(const awk_input_buf_t *iobuf);
+A pointer to your @code{@var{XXX}_can_take_file()} function.
+
+@item awk_bool_t (*take_control_of)(awk_input_buf_t *iobuf);
+A pointer to your @code{@var{XXX}_take_control_of()} function.
+
+@item awk_const struct input_parser *awk_const next;
+This pointer is used by @command{gawk}.
+The extension cannot modify it.
+@end table
+
+The steps are as follows:
+
+@enumerate
+@item
+Create a @code{static awk_input_parser_t} variable and initialize it
+appropriately.
+
+@item
+When your extension is loaded, register your input parser with
+@command{gawk} using the @code{register_input_parser()} API function
+(described below).
+@end enumerate
+
+An @code{awk_input_buf_t} looks like this:
+
+@example
+typedef struct awk_input @{
+ const char *name; /* filename */
+ int fd; /* file descriptor */
+#define INVALID_HANDLE (-1)
+ void *opaque; /* private data for input parsers */
+ int (*get_record)(char **out, struct awk_input *iobuf,
+ int *errcode, char **rt_start, size_t *rt_len);
+ void (*close_func)(struct awk_input *iobuf);
+ struct stat sbuf; /* stat buf */
+@} awk_input_buf_t;
+@end example
+
+The fields can be divided into two categories: those for use (initially,
+at least) by @code{@var{XXX}_can_take_file()}, and those for use by
+@code{@var{XXX}_take_control_of()}. The first group of fields and their uses
+are as follows:
+
+@table @code
+@item const char *name;
+The name of the file.
+
+@item int fd;
+A file descriptor for the file. If @command{gawk} was able to
+open the file, then @code{fd} will @emph{not} be equal to
+@code{INVALID_HANDLE}. Otherwise, it will.
+
+@item struct stat sbuf;
+If file descriptor is valid, then @command{gawk} will have filled
+in this structure via a call to the @code{fstat()} system call.
+@end table
+
+The @code{@var{XXX}_can_take_file()} function should examine these
+fields and decide if the input parser should be used for the file.
+The decision can be made based upon @command{gawk} state (the value
+of a variable defined previously by the extension and set by
+@command{awk} code), the name of the
+file, whether or not the file descriptor is valid, the information
+in the @code{struct stat}, or any combination of the above.
+
+Once @code{@var{XXX}_can_take_file()} has returned true, and
+@command{gawk} has decided to use your input parser, it calls
+@code{@var{XXX}_take_control_of()}. That function then fills in at
+least the @code{get_record} field of the @code{awk_input_buf_t}. It must
+also ensure that @code{fd} is not set to @code{INVALID_HANDLE}. All of
+the fields that may be filled by @code{@var{XXX}_take_control_of()}
+are as follows:
+
+@table @code
+@item void *opaque;
+This is used to hold any state information needed by the input parser
+for this file. It is ``opaque'' to @command{gawk}. The input parser
+is not required to use this pointer.
+
+@item int@ (*get_record)(char@ **out,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ struct@ awk_input *iobuf,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ int *errcode,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ char **rt_start,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ size_t *rt_len);
+This function pointer should point to a function that creates the input
+records. Said function is the core of the input parser. Its behavior
+is described below.
+
+@item void (*close_func)(struct awk_input *iobuf);
+This function pointer should point to a function that does
+the ``tear down.'' It should release any resources allocated by
+@code{@var{XXX}_take_control_of()}. It may also close the file. If it
+does so, it should set the @code{fd} field to @code{INVALID_HANDLE}.
+
+If @code{fd} is still not @code{INVALID_HANDLE} after the call to this
+function, @command{gawk} calls the regular @code{close()} system call.
+
+Having a ``tear down'' function is optional. If your input parser does
+not need it, do not set this field. Then, @command{gawk} calls the
+regular @code{close()} system call on the file descriptor, so it should
+be valid.
+@end table
+
+The @code{@var{XXX}_get_record()} function does the work of creating
+input records. The parameters are as follows:
+
+@table @code
+@item char **out
+This is a pointer to a @code{char *} variable which is set to point
+to the record. @command{gawk} makes its own copy of the data, so
+the extension must manage this storage.
+
+@item struct awk_input *iobuf
+This is the @code{awk_input_buf_t} for the file. The fields should be
+used for reading data (@code{fd}) and for managing private state
+(@code{opaque}), if any.
+
+@item int *errcode
+If an error occurs, @code{*errcode} should be set to an appropriate
+code from @code{<errno.h>}.
+
+@item char **rt_start
+@itemx size_t *rt_len
+If the concept of a ``record terminator'' makes sense, then
+@code{*rt_start} should be set to point to the data to be used for
+@code{RT}, and @code{*rt_len} should be set to the length of the
+data. Otherwise, @code{*rt_len} should be set to zero.
+@code{gawk} makes its own copy of this data, so the
+extension must manage the storage.
+@end table
+
+The return value is the length of the buffer pointed to by
+@code{*out}, or @code{EOF} if end-of-file was reached or an
+error occurred.
+
+It is guaranteed that @code{errcode} is a valid pointer, so there is no
+need to test for a @code{NULL} value. @command{gawk} sets @code{*errcode}
+to zero, so there is no need to set it unless an error occurs.
+
+If an error does occur, the function should return @code{EOF} and set
+@code{*errcode} to a non-zero value. In that case, if @code{*errcode}
+does not equal @minus{}1, @command{gawk} automatically updates
+the @code{ERRNO} variable based on the value of @code{*errcode} (e.g.,
+setting @samp{*errcode = errno} should do the right thing).
+
+@command{gawk} ships with a sample extension that reads directories,
+returning records for each entry in the directory (@pxref{Extension
+Sample Readdir}). You may wish to use that code as a guide for writing
+your own input parser.
+
+When writing an input parser, you should think about (and document)
+how it is expected to interact with @command{awk} code. You may want
+it to always be called, and take effect as appropriate (as the
+@code{readdir} extension does). Or you may want it to take effect
+based upon the value of an @code{awk} variable, as the XML extension
+from the @code{gawkextlib} project does (@pxref{gawkextlib}).
+In the latter case, code in a @code{BEGINFILE} section
+can look at @code{FILENAME} and @code{ERRNO} to decide whether or
+not to activate an input parser (@pxref{BEGINFILE/ENDFILE}).
+
+You register your input parser with the following function:
+
+@table @code
+@item void register_input_parser(awk_input_parser_t *input_parser);
+Register the input parser pointed to by @code{input_parser} with
+@command{gawk}.
+@end table
+
+@node Output Wrappers
+@subsubsection Customized Output Wrappers
+
+An @dfn{output wrapper} is the mirror image of an input parser.
+It allows an extension to take over the output to a file opened
+with the @samp{>} or @samp{>>} operators (@pxref{Redirection}).
+
+The output wrapper is very similar to the input parser structure:
+
+@example
+typedef struct output_wrapper @{
+ const char *name; /* name of the wrapper */
+ awk_bool_t (*can_take_file)(const awk_output_buf_t *outbuf);
+ awk_bool_t (*take_control_of)(awk_output_buf_t *outbuf);
+ awk_const struct output_wrapper *awk_const next; /* for use by gawk */
+@} awk_output_wrapper_t;
+@end example
+
+The members are as follows:
+
+@table @code
+@item const char *name;
+This is the name of the output wrapper.
+
+@item awk_bool_t (*can_take_file)(const awk_output_buf_t *outbuf);
+This points to a function that examines the information in
+the @code{awk_output_buf_t} structure pointed to by @code{outbuf}.
+It should return true if the output wrapper wants to take over the
+file, and false otherwise. It should not change any state (variable
+values, etc.) within @command{gawk}.
+
+@item awk_bool_t (*take_control_of)(awk_output_buf_t *outbuf);
+The function pointed to by this field is called when @command{gawk}
+decides to let the output wrapper take control of the file. It should
+fill in appropriate members of the @code{awk_output_buf_t} structure,
+as described below, and return true if successful, false otherwise.
+
+@item awk_const struct output_wrapper *awk_const next;
+This is for use by @command{gawk}.
+@end table
+
+The @code{awk_output_buf_t} structure looks like this:
+
+@example
+typedef struct @{
+ const char *name; /* name of output file */
+ const char *mode; /* mode argument to fopen */
+ FILE *fp; /* stdio file pointer */
+ awk_bool_t redirected; /* true if a wrapper is active */
+ void *opaque; /* for use by output wrapper */
+ size_t (*gawk_fwrite)(const void *buf, size_t size, size_t count,
+ FILE *fp, void *opaque);
+ int (*gawk_fflush)(FILE *fp, void *opaque);
+ int (*gawk_ferror)(FILE *fp, void *opaque);
+ int (*gawk_fclose)(FILE *fp, void *opaque);
+@} awk_output_buf_t;
+@end example
+
+Here too, your extension will define @code{@var{XXX}_can_take_file()}
+and @code{@var{XXX}_take_control_of()} functions that examine and update
+data members in the @code{awk_output_buf_t}.
+The data members are as follows:
+
+@table @code
+@item const char *name;
+The name of the output file.
+
+@item const char *mode;
+The mode string (as would be used in the second argument to @code{fopen()})
+with which the file was opened.
+
+@item FILE *fp;
+The @code{FILE} pointer from @code{<stdio.h>}. @command{gawk} opens the file
+before attempting to find an output wrapper.
+
+@item awk_bool_t redirected;
+This field must be set to true by the @code{@var{XXX}_take_control_of()} function.
+
+@item void *opaque;
+This pointer is opaque to @command{gawk}. The extension should use it to store
+a pointer to any private data associated with the file.
+
+@item size_t (*gawk_fwrite)(const void *buf, size_t size, size_t count,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ FILE *fp, void *opaque);
+@itemx int (*gawk_fflush)(FILE *fp, void *opaque);
+@itemx int (*gawk_ferror)(FILE *fp, void *opaque);
+@itemx int (*gawk_fclose)(FILE *fp, void *opaque);
+These pointers should be set to point to functions that perform
+the equivalent function as the @code{<stdio.h>} functions do, if appropriate.
+@command{gawk} uses these function pointers for all output.
+@command{gawk} initializes the pointers to point to internal, ``pass through''
+functions that just call the regular @code{<stdio.h>} functions, so an
+extension only needs to redefine those functions that are appropriate for
+what it does.
+@end table
+
+The @code{@var{XXX}_can_take_file()} function should make a decision based
+upon the @code{name} and @code{mode} fields, and any additional state
+(such as @command{awk} variable values) that is appropriate.
+
+When @command{gawk} calls @code{@var{XXX}_take_control_of()}, it should fill
+in the other fields, as appropriate, except for @code{fp}, which it should just
+use normally.
+
+You register your output wrapper with the following function:
+
+@table @code
+@item void register_output_wrapper(awk_output_wrapper_t *output_wrapper);
+Register the output wrapper pointed to by @code{output_wrapper} with
+@command{gawk}.
+@end table
+
+@node Two-way processors
+@subsubsection Customized Two-way Processors
+
+A @dfn{two-way processor} combines an input parser and an output wrapper for
+two-way I/O with the @samp{|&} operator (@pxref{Redirection}). It makes identical
+use of the @code{awk_input_parser_t} and @code{awk_output_buf_t} structures
+as described earlier.
+
+A two-way processor is represented by the following structure:
+
+@example
+typedef struct two_way_processor @{
+ const char *name; /* name of the two-way processor */
+ awk_bool_t (*can_take_two_way)(const char *name);
+ awk_bool_t (*take_control_of)(const char *name,
+ awk_input_buf_t *inbuf,
+ awk_output_buf_t *outbuf);
+ awk_const struct two_way_processor *awk_const next; /* for use by gawk */
+@} awk_two_way_processor_t;
+@end example
+
+The fields are as follows:
+
+@table @code
+@item const char *name;
+The name of the two-way processor.
+
+@item awk_bool_t (*can_take_two_way)(const char *name);
+This function returns true if it wants to take over two-way I/O for this filename.
+It should not change any state (variable
+values, etc.) within @command{gawk}.
+
+@item awk_bool_t (*take_control_of)(const char *name,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_input_buf_t *inbuf,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_output_buf_t *outbuf);
+This function should fill in the @code{awk_input_buf_t} and
+@code{awk_outut_buf_t} structures pointed to by @code{inbuf} and
+@code{outbuf}, respectively. These structures were described earlier.
+
+@item awk_const struct two_way_processor *awk_const next;
+This is for use by @command{gawk}.
+@end table
+
+As with the input parser and output processor, you provide
+``yes I can take this'' and ``take over for this'' functions,
+@code{@var{XXX}_can_take_two_way()} and @code{@var{XXX}_take_control_of()}.
+
+You register your two-way processor with the following function:
+
+@table @code
+@item void register_two_way_processor(awk_two_way_processor_t *two_way_processor);
+Register the two-way processor pointed to by @code{two_way_processor} with
+@command{gawk}.
+@end table
+
+@node Printing Messages
+@subsection Printing Messages
+
+You can print different kinds of warning messages from your
+extension, as described below. Note that for these functions,
+you must pass in the extension id received from @command{gawk}
+when the extension was loaded.@footnote{Because the API uses only ISO C 90
+features, it cannot make use of the ISO C 99 variadic macro feature to hide
+that parameter. More's the pity.}
+
+@table @code
+@item void fatal(awk_ext_id_t id, const char *format, ...);
+Print a message and then cause @command{gawk} to exit immediately.
+
+@item void warning(awk_ext_id_t id, const char *format, ...);
+Print a warning message.
+
+@item void lintwarn(awk_ext_id_t id, const char *format, ...);
+Print a ``lint warning.'' Normally this is the same as printing a
+warning message, but if @command{gawk} was invoked with @samp{--lint=fatal},
+then lint warnings become fatal error messages.
+@end table
+
+All of these functions are otherwise like the C @code{printf()}
+family of functions, where the @code{format} parameter is a string
+with literal characters and formatting codes intermixed.
+
+@node Updating @code{ERRNO}
+@subsection Updating @code{ERRNO}
+
+The following functions allow you to update the @code{ERRNO}
+variable:
+
+@table @code
+@item void update_ERRNO_int(int errno_val);
+Set @code{ERRNO} to the string equivalent of the error code
+in @code{errno_val}. The value should be one of the defined
+error codes in @code{<errno.h>}, and @command{gawk} turns it
+into a (possibly translated) string using the C @code{strerror()} function.
+
+@item void update_ERRNO_string(const char *string);
+Set @code{ERRNO} directly to the string value of @code{ERRNO}.
+@command{gawk} makes a copy of the value of @code{string}.
+
+@item void unset_ERRNO();
+Unset @code{ERRNO}.
+@end table
+
+@node Accessing Parameters
+@subsection Accessing and Updating Parameters
+
+Two functions give you access to the arguments (parameters)
+passed to your extension function. They are:
+
+@table @code
+@item awk_bool_t get_argument(size_t count,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_valtype_t wanted,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_value_t *result);
+Fill in the @code{awk_value_t} structure pointed to by @code{result}
+with the @code{count}'th argument. Return true if the actual
+type matches @code{wanted}, false otherwise. In the latter
+case, @code{result@w{->}val_type} indicates the actual type
+(@pxref{table-value-types-returned}). Counts are zero based---the first
+argument is numbered zero, the second one, and so on. @code{wanted}
+indicates the type of value expected.
+
+@item awk_bool_t set_argument(size_t count, awk_array_t array);
+Convert a parameter that was undefined into an array; this provides
+call-by-reference for arrays. Return false if @code{count} is too big,
+or if the argument's type is not undefined. @xref{Array Manipulation},
+for more information on creating arrays.
+@end table
+
+@node Symbol Table Access
+@subsection Symbol Table Access
+
+Two sets of routines provide access to global variables, and one set
+allows you to create and release cached values.
+
+@menu
+* Symbol table by name:: Accessing variables by name.
+* Symbol table by cookie:: Accessing variables by ``cookie''.
+* Cached values:: Creating and using cached values.
+@end menu
+
+@node Symbol table by name
+@subsubsection Variable Access and Update by Name
+
+The following routines provide the ability to access and update
+global @command{awk}-level variables by name. In compiler terminology,
+identifiers of different kinds are termed @dfn{symbols}, thus the ``sym''
+in the routines' names. The data structure which stores information
+about symbols is termed a @dfn{symbol table}.
+
+@table @code
+@item awk_bool_t sym_lookup(const char *name,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_valtype_t wanted,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_value_t *result);
+Fill in the @code{awk_value_t} structure pointed to by @code{result}
+with the value of the variable named by the string @code{name}, which is
+a regular C string. @code{wanted} indicates the type of value expected.
+Return true if the actual type matches @code{wanted}, false otherwise
+In the latter case, @code{result->val_type} indicates the actual type
+(@pxref{table-value-types-returned}).
+
+@item awk_bool_t sym_update(const char *name, awk_value_t *value);
+Update the variable named by the string @code{name}, which is a regular
+C string. The variable is added to @command{gawk}'s symbol table
+if it is not there. Return true if everything worked, false otherwise.
+
+Changing types (scalar to array or vice versa) of an existing variable
+is @emph{not} allowed, nor may this routine be used to update an array.
+This routine cannot be be used to update any of the predefined
+variables (such as @code{ARGC} or @code{NF}).
+
+@item awk_bool_t sym_constant(const char *name, awk_value_t *value);
+Create a variable named by the string @code{name}, which is
+a regular C string, that has the constant value as given by
+@code{value}. @command{awk}-level code cannot change the value of this
+variable.@footnote{There (currently) is no @code{awk}-level feature that
+provides this ability.} The extension may change the value of @code{name}'s
+variable with subsequent calls to this routine, and may also convert
+a variable created by @code{sym_update()} into a constant. However,
+once a variable becomes a constant it cannot later be reverted into a
+mutable variable.
+@end table
+
+@node Symbol table by cookie
+@subsubsection Variable Access and Update by Cookie
+
+A @dfn{scalar cookie} is an opaque handle that provide access
+to a global variable or array. It is an optimization that
+avoids looking up variables in @command{gawk}'s symbol table every time
+access is needed. This was discussed earlier, in @ref{General Data Types}.
+
+The following functions let you work with scalar cookies.
+
+@table @code
+@item awk_bool_t sym_lookup_scalar(awk_scalar_t cookie,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_valtype_t wanted,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_value_t *result);
+Retrieve the current value of a scalar cookie.
+Once you have obtained a scalar_cookie using @code{sym_lookup()}, you can
+use this function to get its value more efficiently.
+Return false if the value cannot be retrieved.
+
+@item awk_bool_t sym_update_scalar(awk_scalar_t cookie, awk_value_t *value);
+Update the value associated with a scalar cookie. Return false if
+the new value is not one of @code{AWK_STRING} or @code{AWK_NUMBER}.
+Here too, the built-in variables may not be updated.
+@end table
+
+It is not obvious at first glance how to work with scalar cookies or
+what their @i{raison d'etre} really is. In theory, the @code{sym_lookup()}
+and @code{sym_update()} routines are all you really need to work with
+variables. For example, you might have code that looked up the value of
+a variable, evaluated a condition, and then possibly changed the value
+of the variable based on the result of that evaluation, like so:
+
+@example
+/* do_magic --- do something really great */
+
+static awk_value_t *
+do_magic(int nargs, awk_value_t *result)
+@{
+ awk_value_t value;
+
+ if ( sym_lookup("MAGIC_VAR", AWK_NUMBER, & value)
+ && some_condition(value.num_value)) @{
+ value.num_value += 42;
+ sym_update("MAGIC_VAR", & value);
+ @}
+
+ return make_number(0.0, result);
+@}
+@end example
+
+@noindent
+This code looks (and is) simple and straightforward. So what's the problem?
+
+Consider what happens if @command{awk}-level code associated with your
+extension calls the @code{magic()} function (implemented in C by @code{do_magic()}),
+once per record, while processing hundreds of thousands or millions of records.
+The @code{MAGIC_VAR} variable is looked up in the symbol table once or twice per function call!
+
+The symbol table lookup is really pure overhead; it is considerably more efficient
+to get a cookie that represents the variable, and use that to get the variable's
+value and update it as needed.@footnote{The difference is measurable and quite real. Trust us.}
+
+Thus, the way to use cookies is as follows. First, install your extension's variable
+in @command{gawk}'s symbol table using @code{sym_update()}, as usual. Then get a
+scalar cookie for the variable using @code{sym_lookup()}:
+
+@example
+static awk_scalar_t magic_var_cookie; /* cookie for MAGIC_VAR */
+
+static void
+my_extension_init()
+@{
+ awk_value_t value;
+
+ /* install initial value */
+ sym_update("MAGIC_VAR", make_number(42.0, & value));
+
+ /* get cookie */
+ sym_lookup("MAGIC_VAR", AWK_SCALAR, & value);
+
+ /* save the cookie */
+ magic_var_cookie = value.scalar_cookie;
+ @dots{}
+@}
+@end example
+
+Next, use the routines in this section for retrieving and updating
+the value through the cookie. Thus, @code{do_magic()} now becomes
+something like this:
+
+@example
+/* do_magic --- do something really great */
+
+static awk_value_t *
+do_magic(int nargs, awk_value_t *result)
+@{
+ awk_value_t value;
+
+ if ( sym_lookup_scalar(magic_var_cookie, AWK_NUMBER, & value)
+ && some_condition(value.num_value)) @{
+ value.num_value += 42;
+ sym_update_scalar(magic_var_cookie, & value);
+ @}
+ @dots{}
+
+ return make_number(0.0, result);
+@}
+@end example
+
+@quotation NOTE
+The previous code omitted error checking for
+presentation purposes. Your extension code should be more robust
+and carefully check the return values from the API functions.
+@end quotation
+
+@node Cached values
+@subsubsection Creating and Using Cached Values
+
+The routines in this section allow you to create and release
+cached values. As with scalar cookies, in theory, cached values
+are not necessary. You can create numbers and strings using
+the functions in @ref{Constructor Functions}. You can then
+assign those values to variables using @code{sym_update()}
+or @code{sym_update_scalar()}, as you like.
+
+However, you can understand the point of cached values if you remember that
+@emph{every} string value's storage @emph{must} come from @code{malloc()}.
+If you have 20 variables, all of which have the same string value, you
+must create 20 identical copies of the string.@footnote{Numeric values
+are clearly less problematic, requiring only a C @code{double} to store.}
+
+It is clearly more efficient, if possible, to create a value once, and
+then tell @command{gawk} to reuse the value for multiple variables. That
+is what the routines in this section let you do. The functions are as follows:
+
+@table @code
+@item awk_bool_t create_value(awk_value_t *value, awk_value_cookie_t *result);
+Create a cached string or numeric value from @code{value} for efficient later
+assignment.
+Only @code{AWK_NUMBER} and @code{AWK_STRING} values are allowed. Any other type
+is rejected. While @code{AWK_UNDEFINED} could be allowed, doing so would
+result in inferior performance.
+
+@item awk_bool_t release_value(awk_value_cookie_t vc);
+Release the memory associated with a value cookie obtained
+from @code{create_value()}.
+@end table
+
+You use value cookies in a fashion similar to the way you use scalar cookies.
+In the extension initialization routine, you create the value cookie:
+
+@example
+static awk_value_cookie_t answer_cookie; /* static value cookie */
+
+static void
+my_extension_init()
+@{
+ awk_value_t value;
+ char *long_string;
+ size_t long_string_len;
+
+ /* code from earlier */
+ @dots{}
+ /* @dots{} fill in long_string and long_string_len @dots{} */
+ make_malloced_string(long_string, long_string_len, & value);
+ create_value(& value, & answer_cookie); /* create cookie */
+ @dots{}
+@}
+@end example
+
+Once the value is created, you can use it as the value of any number
+of variables:
+
+@example
+static awk_value_t *
+do_magic(int nargs, awk_value_t *result)
+@{
+ awk_value_t new_value;
+
+ @dots{} /* as earlier */
+
+ value.val_type = AWK_VALUE_COOKIE;
+ value.value_cookie = answer_cookie;
+ sym_update("VAR1", & value);
+ sym_update("VAR2", & value);
+ @dots{}
+ sym_update("VAR100", & value);
+ @dots{}
+@}
+@end example
+
+@noindent
+Using value cookies in this way saves considerable storage, since all of
+@code{VAR1} through @code{VAR100} share the same value.
+
+You might be wondering, ``Is this sharing problematic?
+What happens if @command{awk} code assigns a new value to @code{VAR1},
+are all the others be changed too?''
+
+That's a great question. The answer is that no, it's not a problem.
+@command{gawk} is smart enough to avoid such problems.
+
+Finally, as part of your clean up action (@pxref{Exit Callback Functions})
+you should release any cached values that you created, using
+@code{release_value()}.
+
+@node Array Manipulation
+@subsection Array Manipulation
+
+The primary data structure@footnote{Okay, the only data structure.} in @command{awk}
+is the associative array (@pxref{Arrays}).
+Extensions need to be able to manipulate @command{awk} arrays.
+The API provides a number of data structures for working with arrays,
+functions for working with individual elements, and functions for
+working with arrays as a whole. This includes the ability to
+``flatten'' an array so that it is easy for C code to traverse
+every element in an array. The array data structures integrate
+nicely with the data structures for values to make it easy to
+both work with and create true arrays of arrays (@pxref{General Data Types}).
+
+@menu
+* Array Data Types:: Data types for working with arrays.
+* Array Functions:: Functions for working with arrays.
+* Flattening Arrays:: How to flatten arrays.
+* Creating Arrays:: How to create and populate arrays.
+@end menu
+
+@node Array Data Types
+@subsubsection Array Data Types
+
+The data types associated with arrays are listed below.
+
+@table @code
+@item typedef void *awk_array_t;
+If you request the value of an array variable, you get back an
+@code{awk_array_t} value. This value is opaque@footnote{It is also
+a ``cookie,'' but the @command{gawk} developers did not wish to overuse this
+term.} to the extension; it uniquely identifies the array but can
+only be used by passing it into API functions or receiving it from API
+functions. This is very similar to way @samp{FILE *} values are used
+with the @code{<stdio.h>} library routines.
+
+@item typedef struct awk_element @{
+@itemx @ @ @ @ /* convenience linked list pointer, not used by gawk */
+@itemx @ @ @ @ struct awk_element *next;
+@itemx @ @ @ @ enum @{
+@itemx @ @ @ @ @ @ @ @ AWK_ELEMENT_DEFAULT = 0,@ @ /* set by gawk */
+@itemx @ @ @ @ @ @ @ @ AWK_ELEMENT_DELETE = 1@ @ @ @ /* set by extension if should be deleted */
+@itemx @ @ @ @ @} flags;
+@itemx @ @ @ @ awk_value_t index;
+@itemx @ @ @ @ awk_value_t value;
+@itemx @} awk_element_t;
+The @code{awk_element_t} is a ``flattened''
+array element. @command{awk} produces an array of these
+inside the @code{awk_flat_array_t} (see the next item).
+Individual elements may be marked for deletion. New elements must be added
+individually, one at a time, using the separate API for that purpose.
+The fields are as follows:
+
+@c nested table
+@table @code
+@item struct awk_element *next;
+This pointer is for the convenience of extension writers. It allows
+an extension to create a linked list of new elements which can then be
+added to an array in a loop that traverses the list.
+
+@item enum @{ @dots{} @} flags;
+A set of flag values that convey information between @command{gawk}
+and the extension. Currently there is only one: @code{AWK_ELEMENT_DELETE},
+which the extension can set to cause @command{gawk} to delete the
+element from the original array upon release of the flattened array.
+
+@item index
+@itemx value
+The index and value of the element, respectively.
+@emph{All} memory pointed to by @code{index} and @code{value} belongs to @command{gawk}.
+@end table
+
+@item typedef struct awk_flat_array @{
+@itemx @ @ @ @ awk_const void *awk_const opaque1;@ @ @ @ /* private data for use by gawk */
+@itemx @ @ @ @ awk_const void *awk_const opaque2;@ @ @ @ /* private data for use by gawk */
+@itemx @ @ @ @ awk_const size_t count;@ @ @ @ @ /* how many elements */
+@itemx @ @ @ @ awk_element_t elements[1];@ @ /* will be extended */
+@itemx @} awk_flat_array_t;
+This is a flattened array. When an extension gets one of these
+from @command{gawk}, the @code{elements} array is of actual
+size @code{count}.
+The @code{opaque1} and @code{opaque2} pointers are for use by @command{gawk};
+therefore they are marked @code{awk_const} so that the extension cannot
+modify them.
+@end table
+
+@node Array Functions
+@subsubsection Array Functions
+
+The following functions relate to individual array elements.
+
+@table @code
+@item awk_bool_t get_element_count(awk_array_t a_cookie, size_t *count);
+For the array represented by @code{a_cookie}, return in @code{*count}
+the number of elements it contains. A subarray counts as a single element.
+Return false if there is an error.
+
+@item awk_bool_t get_array_element(awk_array_t a_cookie,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ const awk_value_t *const index,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_valtype_t wanted,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_value_t *result);
+For the array represented by @code{a_cookie}, return in @code{*result}
+the value of the element whose index is @code{index}.
+@code{wanted} specifies the type of value you wish to retrieve.
+Return false if @code{wanted} does not match the actual type or if
+@code{index} is not in the array (@pxref{table-value-types-returned}).
+
+The value for @code{index} can be numeric, in which case @command{gawk}
+converts it to a string. Using non-integral values is possible, but
+requires that you understand how such values are converted to strings
+(@pxref{Conversion}); thus using integral values is safest.
+
+As with @emph{all} strings passed into @code{gawk} from an extension,
+the string value of @code{index} must come from @code{malloc()}, and
+@command{gawk} releases the storage.
+
+@item awk_bool_t set_array_element(awk_array_t a_cookie,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ const@ awk_value_t *const index,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ const@ awk_value_t *const value);
+In the array represented by @code{a_cookie}, create or modify
+the element whose index is given by @code{index}.
+The @code{ARGV} and @code{ENVIRON} arrays may not be changed.
+
+@item awk_bool_t set_array_element_by_elem(awk_array_t a_cookie,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_element_t element);
+Like @code{set_array_element()}, but take the @code{index} and @code{value}
+from @code{element}. This is a convenience macro.
+
+@item awk_bool_t del_array_element(awk_array_t a_cookie,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ const awk_value_t* const index);
+Remove the element with the given index from the array
+represented by @code{a_cookie}.
+Return true if the element was removed, or false if the element did
+not exist in the array.
+@end table
+
+The following functions relate to arrays as a whole:
+
+@table @code
+@item awk_array_t create_array();
+Create a new array to which elements may be added.
+@xref{Creating Arrays}, for a discussion of how to
+create a new array and add elements to it.
+
+@item awk_bool_t clear_array(awk_array_t a_cookie);
+Clear the array represented by @code{a_cookie}.
+Return false if there was some kind of problem, true otherwise.
+The array remains an array, but after calling this function, it
+has no elements. This is equivalent to using the @code{delete}
+statement (@pxref{Delete}).
+
+@item awk_bool_t flatten_array(awk_array_t a_cookie, awk_flat_array_t **data);
+For the array represented by @code{a_cookie}, create an @code{awk_flat_array_t}
+structure and fill it in. Set the pointer whose address is passed as @code{data}
+to point to this structure.
+Return true upon success, or false otherwise.
+@xref{Flattening Arrays}, for a discussion of how to
+flatten an array and work with it.
+
+@item awk_bool_t release_flattened_array(awk_array_t a_cookie,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_flat_array_t *data);
+When done with a flattened array, release the storage using this function.
+You must pass in both the original array cookie, and the address of
+the created @code{awk_flat_array_t} structure.
+The function returns true upon success, false otherwise.
+@end table
+
+@node Flattening Arrays
+@subsubsection Working With All The Elements of an Array
+
+To @dfn{flatten} an array is create a structure that
+represents the full array in a fashion that makes it easy
+for C code to traverse the entire array. Test code
+in @file{extension/testext.c} does this, and also serves
+as a nice example to show how to use the APIs.
+
+First, the @command{gawk} script that drives the test extension:
+
+@example
+@@load "testext"
+BEGIN @{
+ n = split("blacky rusty sophie raincloud lucky", pets)
+ printf "pets has %d elements\n", length(pets)
+ ret = dump_array_and_delete("pets", "3")
+ printf "dump_array_and_delete(pets) returned %d\n", ret
+ if ("3" in pets)
+ printf("dump_array_and_delete() did NOT remove index \"3\"!\n")
+ else
+ printf("dump_array_and_delete() did remove index \"3\"!\n")
+ print ""
+@}
+@end example
+
+@noindent
+This code creates an array with @code{split()} (@pxref{String Functions})
+and then calls @code{dump_and_delete()}. That function looks up
+the array whose name is passed as the first argument, and
+deletes the element at the index passed in the second argument.
+It then prints the return value and checks if the element
+was indeed deleted. Here is the C code that implements
+@code{dump_array_and_delete()}. It has been edited slightly for
+presentation.
+
+The first part declares variables, sets up the default
+return value in @code{result}, and checks that the function
+was called with the correct number of arguments:
+
+@example
+static awk_value_t *
+dump_array_and_delete(int nargs, awk_value_t *result)
+@{
+ awk_value_t value, value2, value3;
+ awk_flat_array_t *flat_array;
+ size_t count;
+ char *name;
+ int i;
+
+ assert(result != NULL);
+ make_number(0.0, result);
+
+ if (nargs != 2) @{
+ printf("dump_array_and_delete: nargs not right "
+ "(%d should be 2)\n", nargs);
+ goto out;
+ @}
+@end example
+
+The function then proceeds in steps, as follows. First, retrieve
+the name of the array, passed as the first argument. Then
+retrieve the array itself. If either operation fails, print
+error messages and return:
+
+@example
+ /* get argument named array as flat array and print it */
+ if (get_argument(0, AWK_STRING, & value)) @{
+ name = value.str_value.str;
+ if (sym_lookup(name, AWK_ARRAY, & value2))
+ printf("dump_array_and_delete: sym_lookup of %s passed\n",
+ name);
+ else @{
+ printf("dump_array_and_delete: sym_lookup of %s failed\n",
+ name);
+ goto out;
+ @}
+ @} else @{
+ printf("dump_array_and_delete: get_argument(0) failed\n");
+ goto out;
+ @}
+@end example
+
+For testing purposes and to make sure that the C code sees
+the same number of elements as the @command{awk} code,
+the second step is to get the count of elements in the array
+and print it:
+
+@example
+ if (! get_element_count(value2.array_cookie, & count)) @{
+ printf("dump_array_and_delete: get_element_count failed\n");
+ goto out;
+ @}
+
+ printf("dump_array_and_delete: incoming size is %lu\n",
+ (unsigned long) count);
+@end example
+
+The third step is to actually flatten the array, and then
+to double check that the count in the @code{awk_flat_array_t}
+is the same as the count just retrieved:
+
+@example
+ if (! flatten_array(value2.array_cookie, & flat_array)) @{
+ printf("dump_array_and_delete: could not flatten array\n");
+ goto out;
+ @}
+
+ if (flat_array->count != count) @{
+ printf("dump_array_and_delete: flat_array->count (%lu)"
+ " != count (%lu)\n",
+ (unsigned long) flat_array->count,
+ (unsigned long) count);
+ goto out;
+ @}
+@end example
+
+The fourth step is to retrieve the index of the element
+to be deleted, which was passed as the second argument.
+Remember that argument counts passed to @code{get_argument()}
+are zero-based, thus the second argument is numbered one:
+
+@example
+ if (! get_argument(1, AWK_STRING, & value3)) @{
+ printf("dump_array_and_delete: get_argument(1) failed\n");
+ goto out;
+ @}
+@end example
+
+The fifth step is where the ``real work'' is done. The function
+loops over every element in the array, printing the index and
+element values. In addition, upon finding the element with the
+index that is supposed to be deleted, the function sets the
+@code{AWK_ELEMENT_DELETE} bit in the @code{flags} field
+of the element. When the array is released, @command{gawk}
+traverses the flattened array, and deletes any element which
+have this flag bit set:
+
+@example
+ for (i = 0; i < flat_array->count; i++) @{
+ printf("\t%s[\"%.*s\"] = %s\n",
+ name,
+ (int) flat_array->elements[i].index.str_value.len,
+ flat_array->elements[i].index.str_value.str,
+ valrep2str(& flat_array->elements[i].value));
+
+ if (strcmp(value3.str_value.str,
+ flat_array->elements[i].index.str_value.str)
+ == 0) @{
+ flat_array->elements[i].flags |= AWK_ELEMENT_DELETE;
+ printf("dump_array_and_delete: marking element \"%s\" "
+ "for deletion\n",
+ flat_array->elements[i].index.str_value.str);
+ @}
+ @}
+@end example
+
+The sixth step is to release the flattened array. This tells
+@command{gawk} that the extension is no longer using the array,
+and that it should delete any elements marked for deletion.
+@command{gawk} also frees any storage that was allocated,
+so you should not use the pointer (@code{flat_array} in this
+code) once you have called @code{release_flattened_array()}:
+
+@example
+ if (! release_flattened_array(value2.array_cookie, flat_array)) @{
+ printf("dump_array_and_delete: could not release flattened array\n");
+ goto out;
+ @}
+@end example
+
+Finally, since everything was successful, the function sets the
+return value to success, and returns:
+
+@example
+ make_number(1.0, result);
+out:
+ return result;
+@}
+@end example
+
+Here is the output from running this part of the test:
+
+@example
+pets has 5 elements
+dump_array_and_delete: sym_lookup of pets passed
+dump_array_and_delete: incoming size is 5
+ pets["1"] = "blacky"
+ pets["2"] = "rusty"
+ pets["3"] = "sophie"
+dump_array_and_delete: marking element "3" for deletion
+ pets["4"] = "raincloud"
+ pets["5"] = "lucky"
+dump_array_and_delete(pets) returned 1
+dump_array_and_delete() did remove index "3"!
+@end example
+
+@node Creating Arrays
+@subsubsection How To Create and Populate Arrays
+
+Besides working with arrays created by @command{awk} code, you can
+create arrays and populate them as you see fit, and then @command{awk}
+code can access them and manipulate them.
+
+There are two important points about creating arrays from extension code:
+
+@enumerate 1
+@item
+You must install a new array into @command{gawk}'s symbol
+table immediately upon creating it. Once you have done so,
+you can then populate the array.
+
+@ignore
+Strictly speaking, this is required only
+for arrays that will have subarrays as elements; however it is
+a good idea to always do this. This restriction may be relaxed
+in a subsequent revision of the API.
+@end ignore
+
+Similarly, if installing a new array as a subarray of an existing array,
+you must add the new array to its parent before adding any elements to it.
+
+Thus, the correct way to build an array is to work ``top down.'' Create
+the array, and immediately install it in @command{gawk}'s symbol table
+using @code{sym_update()}, or install it as an element in a previously
+existing array using @code{set_element()}. Example code is coming shortly.
+
+@item
+Due to gawk internals, after using @code{sym_update()} to install an array
+into @command{gawk}, you have to retrieve the array cookie from the value
+passed in to @command{sym_update()} before doing anything else with it, like so:
+
+@example
+awk_value_t index, value;
+awk_array_t new_array;
+
+make_const_string("an index", 8, & index);
+
+new_array = create_array();
+val.val_type = AWK_ARRAY;
+val.array_cookie = new_array;
+
+/* install array in the symbol table */
+sym_update("array", & index, & val);
+
+new_array = val.array_cookie; /* YOU MUST DO THIS */
+@end example
+
+If installing an array as a subarray, you must also retrieve the value
+of the array cookie after the call to @code{set_element()}.
+@end enumerate
+
+The following C code is a simple test extension to create an array
+with two regular elements and with a subarray. The leading @samp{#include}
+directives and boilerplate variable declarations are omitted for brevity.
+The first step is to create a new array and then install it
+in the symbol table:
+
+@example
+@ignore
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <assert.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "gawkapi.h"
+
+static const gawk_api_t *api; /* for convenience macros to work */
+static awk_ext_id_t *ext_id;
+static const char *ext_version = "testarray extension: version 1.0";
+
+int plugin_is_GPL_compatible;
+
+@end ignore
+/* create_new_array --- create a named array */
+
+static void
+create_new_array()
+@{
+ awk_array_t a_cookie;
+ awk_array_t subarray;
+ awk_value_t index, value;
+
+ a_cookie = create_array();
+ value.val_type = AWK_ARRAY;
+ value.array_cookie = a_cookie;
+
+ if (! sym_update("new_array", & value))
+ printf("create_new_array: sym_update(\"new_array\") failed!\n");
+ a_cookie = value.array_cookie;
+@end example
+
+@noindent
+Note how @code{a_cookie} is reset from the @code{array_cookie} field in
+the @code{value} structure.
+
+The second step is to install two regular values into @code{new_array}:
+
+@example
+ (void) make_const_string("hello", 5, & index);
+ (void) make_const_string("world", 5, & value);
+ if (! set_array_element(a_cookie, & index, & value)) @{
+ printf("fill_in_array: set_array_element failed\n");
+ return;
+ @}
+
+ (void) make_const_string("answer", 6, & index);
+ (void) make_number(42.0, & value);
+ if (! set_array_element(a_cookie, & index, & value)) @{
+ printf("fill_in_array: set_array_element failed\n");
+ return;
+ @}
+@end example
+
+The third step is to create the subarray and install it:
+
+@example
+ (void) make_const_string("subarray", 8, & index);
+ subarray = create_array();
+ value.val_type = AWK_ARRAY;
+ value.array_cookie = subarray;
+ if (! set_array_element(a_cookie, & index, & value)) @{
+ printf("fill_in_array: set_array_element failed\n");
+ return;
+ @}
+ subarray = value.array_cookie;
+@end example
+
+The final step is to populate the subarray with its own element:
+
+@example
+ (void) make_const_string("foo", 3, & index);
+ (void) make_const_string("bar", 3, & value);
+ if (! set_array_element(subarray, & index, & value)) @{
+ printf("fill_in_array: set_array_element failed\n");
+ return;
+ @}
+@}
+@ignore
+static awk_ext_func_t func_table[] = @{
+ @{ NULL, NULL, 0 @}
+@};
+
+/* init_testarray --- additional initialization function */
+
+static awk_bool_t init_testarray(void)
+@{
+ create_new_array();
+
+ return 1;
+@}
+
+static awk_bool_t (*init_func)(void) = init_testarray;
+
+dl_load_func(func_table, testarray, "")
+@end ignore
+@end example
+
+Here is sample script that loads the extension
+and then dumps the array:
+
+@example
+@@load "subarray"
+
+function dumparray(name, array, i)
+@{
+ for (i in array)
+ if (isarray(array[i]))
+ dumparray(name "[\"" i "\"]", array[i])
+ else
+ printf("%s[\"%s\"] = %s\n", name, i, array[i])
+@}
+
+BEGIN @{
+ dumparray("new_array", new_array);
+@}
+@end example
+
+Here is the result of running the script:
+
+@example
+$ @kbd{AWKLIBPATH=$PWD ./gawk -f subarray.awk}
+@print{} new_array["subarray"]["foo"] = bar
+@print{} new_array["hello"] = world
+@print{} new_array["answer"] = 42
+@end example
+
+@noindent
+(@xref{Finding Extensions}, for more information on the
+@env{AWKLIBPATH} environment variable.)
+
+@node Extension API Variables
+@subsection API Variables
+
+The API provides two sets of variables. The first provides information
+about the version of the API (both with which the extension was compiled,
+and with which @command{gawk} was compiled). The second provides
+information about how @command{gawk} was invoked.
+
+@menu
+* Extension Versioning:: API Version information.
+* Extension API Informational Variables:: Variables providing information about
+ @command{gawk}'s invocation.
+@end menu
+
+@node Extension Versioning
+@subsubsection API Version Constants and Variables
+
+The API provides both a ``major'' and a ``minor'' version number.
+The API versions are available at compile time as constants:
+
+@table @code
+@item GAWK_API_MAJOR_VERSION
+The major version of the API.
+
+@item GAWK_API_MINOR_VERSION
+The minor version of the API.
+@end table
+
+The minor version increases when new functions are added to the API. Such
+new functions are always added to the end of the API @code{struct}.
+
+The major version increases (and the minor version is reset to zero) if any
+of the data types change size or member order, or if any of the existing
+functions change signature.
+
+It could happen that an extension may be compiled against one version
+of the API but loaded by a version of @command{gawk} using a different
+version. For this reason, the major and minor API versions of the
+running @command{gawk} are included in the API @code{struct} as read-only
+constant integers:
+
+@table @code
+@item api->major_version
+The major version of the running @command{gawk}.
+
+@item api->minor_version
+The minor version of the running @command{gawk}.
+@end table
+
+It is up to the extension to decide if there are API incompatibilities.
+Typically a check like this is enough:
+
+@example
+if (api->major_version != GAWK_API_MAJOR_VERSION
+ || api->minor_version < GAWK_API_MINOR_VERSION) @{
+ fprintf(stderr, "foo_extension: version mismatch with gawk!\n");
+ fprintf(stderr, "\tmy version (%d, %d), gawk version (%d, %d)\n",
+ GAWK_API_MAJOR_VERSION, GAWK_API_MINOR_VERSION,
+ api->major_version, api->minor_version);
+ exit(1);
+@}
+@end example
+
+Such code is included in the boilerplate @code{dl_load_func()} macro
+provided in @file{gawkapi.h} (discussed later, in
+@ref{Extension API Boilerplate}).
+
+@node Extension API Informational Variables
+@subsubsection Informational Variables
+
+The API provides access to several variables that describe
+whether the corresponding command-line options were enabled when
+@command{gawk} was invoked. The variables are:
+
+@table @code
+@item do_lint
+This variable is true if @command{gawk} was invoked with @option{--lint} option
+(@pxref{Options}).
+
+@item do_traditional
+This variable is true if @command{gawk} was invoked with @option{--traditional} option.
+
+@item do_profile
+This variable is true if @command{gawk} was invoked with @option{--profile} option.
+
+@item do_sandbox
+This variable is true if @command{gawk} was invoked with @option{--sandbox} option.
+
+@item do_debug
+This variable is true if @command{gawk} was invoked with @option{--debug} option.
+
+@item do_mpfr
+This variable is true if @command{gawk} was invoked with @option{--bignum} option.
+@end table
+
+The value of @code{do_lint} can change if @command{awk} code
+modifies the @code{LINT} built-in variable (@pxref{Built-in Variables}).
+The others should not change during execution.
+
+@node Extension API Boilerplate
+@subsection Boilerplate Code
+
+As mentioned earlier (@pxref{Extension Mechanism Outline}), the function
+definitions as presented are really macros. To use these macros, your
+extension must provide a small amount of boilerplate code (variables and
+functions) towards the top of your source file, using pre-defined names
+as described below. The boilerplate needed is also provided in comments
+in the @file{gawkapi.h} header file:
+
+@example
+/* Boiler plate code: */
+int plugin_is_GPL_compatible;
+
+static gawk_api_t *const api;
+static awk_ext_id_t ext_id;
+static const char *ext_version = NULL; /* or @dots{} = "some string" */
+
+static awk_ext_func_t func_table[] = @{
+ @{ "name", do_name, 1 @},
+ /* @dots{} */
+@};
+
+/* EITHER: */
+
+static awk_bool_t (*init_func)(void) = NULL;
+
+/* OR: */
+
+static awk_bool_t
+init_my_module(void)
+@{
+ @dots{}
+@}
+
+static awk_bool_t (*init_func)(void) = init_my_module;
+
+dl_load_func(func_table, some_name, "name_space_in_quotes")
+@end example
+
+These variables and functions are as follows:
+
+@table @code
+@item int plugin_is_GPL_compatible;
+This asserts that the extension is compatible with the GNU GPL
+(@pxref{Copying}). If your extension does not have this, @command{gawk}
+will not load it (@pxref{Plugin License}).
+
+@item static gawk_api_t *const api;
+This global @code{static} variable should be set to point to
+the @code{gawk_api_t} pointer that @command{gawk} passes to your
+@code{dl_load()} function. This variable is used by all of the macros.
+
+@item static awk_ext_id_t ext_id;
+This global static variable should be set to the @code{awk_ext_id_t}
+value that @command{gawk} passes to your @code{dl_load()} function.
+This variable is used by all of the macros.
+
+@item static const char *ext_version = NULL; /* or @dots{} = "some string" */
+This global @code{static} variable should be set either
+to @code{NULL}, or to point to a string giving the name and version of
+your extension.
+
+@item static awk_ext_func_t func_table[] = @{ @dots{} @};
+This is an array of one or more @code{awk_ext_func_t} structures
+as described earlier (@pxref{Extension Functions}).
+It can then be looped over for multiple calls to
+@code{add_ext_func()}.
+
+@item static awk_bool_t (*init_func)(void) = NULL;
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @r{OR}
+@itemx static awk_bool_t init_my_module(void) @{ @dots{} @}
+@itemx static awk_bool_t (*init_func)(void) = init_my_module;
+If you need to do some initialization work, you should define a
+function that does it (creates variables, opens files, etc.)
+and then define the @code{init_func} pointer to point to your
+function.
+The function should return zero (false) upon failure, non-zero
+(success) if everything goes well.
+
+If you don't need to do any initialization, define the pointer and
+initialize it to @code{NULL}.
+
+@item dl_load_func(func_table, some_name, "name_space_in_quotes")
+This macro expands to a @code{dl_load()} function that performs
+all the necessary initializations.
+@end table
+
+The point of the all the variables and arrays is to let the
+@code{dl_load()} function (from the @code{dl_load_func()}
+macro) do all the standard work. It does the following:
+
+@enumerate 1
+@item
+Check the API versions. If the extension major version does not match
+@command{gawk}'s, or if the extension minor version is greater than
+@command{gawk}'s, it prints a fatal error message and exits.
+
+@item
+Load the functions defined in @code{func_table}.
+If any of them fails to load, it prints a warning message but
+continues on.
+
+@item
+If the @code{init_func} pointer is not @code{NULL}, call the
+function it points to. If it returns non-zero, print a
+warning message.
+
+@item
+If @code{ext_version} is not @code{NULL}, register
+the version string with @command{gawk}.
+@end enumerate
+
+@node Finding Extensions
+@subsection How @command{gawk} Finds Extensions
+
+Compiled extensions have to be installed in a directory where
+@command{gawk} can find them. If @command{gawk} is configured and
+built in the default fashion, the directory in which to find
+extensions is @file{/usr/local/lib/gawk}. You can also specify a search
+path with a list of directories to search for compiled extensions.
+@xref{AWKLIBPATH Variable}, for more information.
+
+@node Extension Example
+@section Example: Some File Functions
+
+@quotation
+@i{No matter where you go, there you are.} @*
+Buckaroo Bonzai
+@end quotation
+
+@c It's enough to show chdir and stat, no need for fts
+
+Two useful functions that are not in @command{awk} are @code{chdir()} (so
+that an @command{awk} program can change its directory) and @code{stat()}
+(so that an @command{awk} program can gather information about a file).
+This @value{SECTION} implements these functions for @command{gawk}
+in an extension.
+
+@menu
+* Internal File Description:: What the new functions will do.
+* Internal File Ops:: The code for internal file operations.
+* Using Internal File Ops:: How to use an external extension.
+@end menu
+
+@node Internal File Description
+@subsection Using @code{chdir()} and @code{stat()}
+
+This @value{SECTION} shows how to use the new functions at
+the @command{awk} level once they've been integrated into the
+running @command{gawk} interpreter. Using @code{chdir()} is very
+straightforward. It takes one argument, the new directory to change to:
+
+@example
+@@load "filefuncs"
+@dots{}
+newdir = "/home/arnold/funstuff"
+ret = chdir(newdir)
+if (ret < 0) @{
+ printf("could not change to %s: %s\n",
+ newdir, ERRNO) > "/dev/stderr"
+ exit 1
+@}
+@dots{}
+@end example
+
+The return value is negative if the @code{chdir()} failed, and
+@code{ERRNO} (@pxref{Built-in Variables}) is set to a string indicating
+the error.
+
+Using @code{stat()} is a bit more complicated. The C @code{stat()}
+function fills in a structure that has a fair amount of information.
+The right way to model this in @command{awk} is to fill in an associative
+array with the appropriate information:
+
+@c broke printf for page breaking
+@example
+file = "/home/arnold/.profile"
+ret = stat(file, fdata)
+if (ret < 0) @{
+ printf("could not stat %s: %s\n",
+ file, ERRNO) > "/dev/stderr"
+ exit 1
+@}
+printf("size of %s is %d bytes\n", file, fdata["size"])
+@end example
+
+The @code{stat()} function always clears the data array, even if
+the @code{stat()} fails. It fills in the following elements:
+
+@table @code
+@item "name"
+The name of the file that was @code{stat()}'ed.
+
+@item "dev"
+@itemx "ino"
+The file's device and inode numbers, respectively.
+
+@item "mode"
+The file's mode, as a numeric value. This includes both the file's
+type and its permissions.
+
+@item "nlink"
+The number of hard links (directory entries) the file has.
+
+@item "uid"
+@itemx "gid"
+The numeric user and group ID numbers of the file's owner.
+
+@item "size"
+The size in bytes of the file.
+
+@item "blocks"
+The number of disk blocks the file actually occupies. This may not
+be a function of the file's size if the file has holes.
+
+@item "atime"
+@itemx "mtime"
+@itemx "ctime"
+The file's last access, modification, and inode update times,
+respectively. These are numeric timestamps, suitable for formatting
+with @code{strftime()}
+(@pxref{Time Functions}).
+
+@item "pmode"
+The file's ``printable mode.'' This is a string representation of
+the file's type and permissions, such as is produced by
+@samp{ls -l}---for example, @code{"drwxr-xr-x"}.
+
+@item "type"
+A printable string representation of the file's type. The value
+is one of the following:
+
+@table @code
+@item "blockdev"
+@itemx "chardev"
+The file is a block or character device (``special file'').
+
+@ignore
+@item "door"
+The file is a Solaris ``door'' (special file used for
+interprocess communications).
+@end ignore
+
+@item "directory"
+The file is a directory.
+
+@item "fifo"
+The file is a named-pipe (also known as a FIFO).
+
+@item "file"
+The file is just a regular file.
+
+@item "socket"
+The file is an @code{AF_UNIX} (``Unix domain'') socket in the
+filesystem.
+
+@item "symlink"
+The file is a symbolic link.
+@end table
+@end table
+
+Several additional elements may be present depending upon the operating
+system and the type of the file. You can test for them in your @command{awk}
+program by using the @code{in} operator
+(@pxref{Reference to Elements}):
+
+@table @code
+@item "blksize"
+The preferred block size for I/O to the file. This field is not
+present on all POSIX-like systems in the C @code{stat} structure.
+
+@item "linkval"
+If the file is a symbolic link, this element is the name of the
+file the link points to (i.e., the value of the link).
+
+@item "rdev"
+@itemx "major"
+@itemx "minor"
+If the file is a block or character device file, then these values
+represent the numeric device number and the major and minor components
+of that number, respectively.
+@end table
+
+@node Internal File Ops
+@subsection C Code for @code{chdir()} and @code{stat()}
+
+Here is the C code for these extensions.@footnote{This version is
+edited slightly for presentation. See @file{extension/filefuncs.c}
+in the @command{gawk} distribution for the complete version.}
+
+The file includes a number of standard header files, and then includes
+the @file{gawkapi.h} header file which provides the API definitions.
+Those are followed by the necessary variable declarations
+to make use of the API macros and boilerplate code
+(@pxref{Extension API Boilerplate}).
+
+@c break line for page breaking
+@example
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <assert.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "gawkapi.h"
+
+#include "gettext.h"
+#define _(msgid) gettext(msgid)
+#define N_(msgid) msgid
+
+#include "gawkfts.h"
+#include "stack.h"
+
+static const gawk_api_t *api; /* for convenience macros to work */
+static awk_ext_id_t *ext_id;
+static awk_bool_t init_filefuncs(void);
+static awk_bool_t (*init_func)(void) = init_filefuncs;
+static const char *ext_version = "filefuncs extension: version 1.0";
+
+int plugin_is_GPL_compatible;
+@end example
+
+@cindex programming conventions, @command{gawk} internals
+By convention, for an @command{awk} function @code{foo()}, the C function
+that implements it is called @code{do_foo()}. The function should have
+two arguments: the first is an @code{int} usually called @code{nargs},
+that represents the number of actual arguments for the function.
+The second is a pointer to an @code{awk_value_t}, usually named
+@code{result}.
+
+@example
+/* do_chdir --- provide dynamically loaded chdir() builtin for gawk */
+
+static awk_value_t *
+do_chdir(int nargs, awk_value_t *result)
+@{
+ awk_value_t newdir;
+ int ret = -1;
+
+ assert(result != NULL);
+
+ if (do_lint && nargs != 1)
+ lintwarn(ext_id,
+ _("chdir: called with incorrect number of arguments, "
+ "expecting 1"));
+@end example
+
+The @code{newdir}
+variable represents the new directory to change to, retrieved
+with @code{get_argument()}. Note that the first argument is
+numbered zero.
+
+If the argument is retrieved successfully, the function calls the
+@code{chdir()} system call. If the @code{chdir()} fails, @code{ERRNO}
+is updated.
+
+@example
+ if (get_argument(0, AWK_STRING, & newdir)) @{
+ ret = chdir(newdir.str_value.str);
+ if (ret < 0)
+ update_ERRNO_int(errno);
+ @}
+@end example
+
+Finally, the function returns the return value to the @command{awk} level:
+
+@example
+ return make_number(ret, result);
+@}
+@end example
+
+The @code{stat()} built-in is more involved. First comes a function
+that turns a numeric mode into a printable representation
+(e.g., 644 becomes @samp{-rw-r--r--}). This is omitted here for brevity:
+
+@c break line for page breaking
+@example
+/* format_mode --- turn a stat mode field into something readable */
+
+static char *
+format_mode(unsigned long fmode)
+@{
+ @dots{}
+@}
+@end example
+
+Next comes a function for reading symbolic links, which is also
+omitted here for brevity:
+
+@example
+/* read_symlink --- read a symbolic link into an allocated buffer.
+ @dots{} */
+
+static char *
+read_symlink(const char *fname, size_t bufsize, ssize_t *linksize)
+@{
+ @dots{}
+@}
+@end example
+
+Two helper functions simplify entering values in the
+array that will contain the result of the @code{stat()}:
+
+@example
+/* array_set --- set an array element */
+
+static void
+array_set(awk_array_t array, const char *sub, awk_value_t *value)
+@{
+ awk_value_t index;
+
+ set_array_element(array,
+ make_const_string(sub, strlen(sub), & index),
+ value);
+
+@}
+
+/* array_set_numeric --- set an array element with a number */
+
+static void
+array_set_numeric(awk_array_t array, const char *sub, double num)
+@{
+ awk_value_t tmp;
+
+ array_set(array, sub, make_number(num, & tmp));
+@}
+@end example
+
+The following function does most of the work to fill in
+the @code{awk_array_t} result array with values obtained
+from a valid @code{struct stat}. It is done in a separate function
+to support the @code{stat()} function for @command{gawk} and also
+to support the @code{fts()} extension which is included in
+the same file but whose code is not shown here
+(@pxref{Extension Sample File Functions}).
+
+The first part of the function is variable declarations,
+including a table to map file types to strings:
+
+@example
+/* fill_stat_array --- do the work to fill an array with stat info */
+
+static int
+fill_stat_array(const char *name, awk_array_t array, struct stat *sbuf)
+@{
+ char *pmode; /* printable mode */
+ const char *type = "unknown";
+ awk_value_t tmp;
+ static struct ftype_map @{
+ unsigned int mask;
+ const char *type;
+ @} ftype_map[] = @{
+ @{ S_IFREG, "file" @},
+ @{ S_IFBLK, "blockdev" @},
+ @{ S_IFCHR, "chardev" @},
+ @{ S_IFDIR, "directory" @},
+#ifdef S_IFSOCK
+ @{ S_IFSOCK, "socket" @},
+#endif
+#ifdef S_IFIFO
+ @{ S_IFIFO, "fifo" @},
+#endif
+#ifdef S_IFLNK
+ @{ S_IFLNK, "symlink" @},
+#endif
+#ifdef S_IFDOOR /* Solaris weirdness */
+ @{ S_IFDOOR, "door" @},
+#endif /* S_IFDOOR */
+ @};
+ int j, k;
+@end example
+
+The destination array is cleared, and then code fills in
+various elements based on values in the @code{struct stat}:
+
+@example
+ /* empty out the array */
+ clear_array(array);
+
+ /* fill in the array */
+ array_set(array, "name", make_const_string(name, strlen(name),
+ & tmp));
+ array_set_numeric(array, "dev", sbuf->st_dev);
+ array_set_numeric(array, "ino", sbuf->st_ino);
+ array_set_numeric(array, "mode", sbuf->st_mode);
+ array_set_numeric(array, "nlink", sbuf->st_nlink);
+ array_set_numeric(array, "uid", sbuf->st_uid);
+ array_set_numeric(array, "gid", sbuf->st_gid);
+ array_set_numeric(array, "size", sbuf->st_size);
+ array_set_numeric(array, "blocks", sbuf->st_blocks);
+ array_set_numeric(array, "atime", sbuf->st_atime);
+ array_set_numeric(array, "mtime", sbuf->st_mtime);
+ array_set_numeric(array, "ctime", sbuf->st_ctime);
+
+ /* for block and character devices, add rdev,
+ major and minor numbers */
+ if (S_ISBLK(sbuf->st_mode) || S_ISCHR(sbuf->st_mode)) @{
+ array_set_numeric(array, "rdev", sbuf->st_rdev);
+ array_set_numeric(array, "major", major(sbuf->st_rdev));
+ array_set_numeric(array, "minor", minor(sbuf->st_rdev));
+ @}
+@end example
+
+@noindent
+The latter part of the function makes selective additions
+to the destination array, depending upon the availability of
+certain members and/or the type of the file. It then returns zero,
+for success:
+
+@example
+#ifdef HAVE_ST_BLKSIZE
+ array_set_numeric(array, "blksize", sbuf->st_blksize);
+#endif /* HAVE_ST_BLKSIZE */
+
+ pmode = format_mode(sbuf->st_mode);
+ array_set(array, "pmode", make_const_string(pmode, strlen(pmode),
+ & tmp));
+
+ /* for symbolic links, add a linkval field */
+ if (S_ISLNK(sbuf->st_mode)) @{
+ char *buf;
+ ssize_t linksize;
+
+ if ((buf = read_symlink(name, sbuf->st_size,
+ & linksize)) != NULL)
+ array_set(array, "linkval",
+ make_malloced_string(buf, linksize, & tmp));
+ else
+ warning(ext_id, _("stat: unable to read symbolic link `%s'"),
+ name);
+ @}
+
+ /* add a type field */
+ type = "unknown"; /* shouldn't happen */
+ for (j = 0, k = sizeof(ftype_map)/sizeof(ftype_map[0]); j < k; j++) @{
+ if ((sbuf->st_mode & S_IFMT) == ftype_map[j].mask) @{
+ type = ftype_map[j].type;
+ break;
+ @}
+ @}
+
+ array_set(array, "type", make_const_string(type, strlen(type), &tmp));
+
+ return 0;
+@}
+@end example
+
+Finally, here is the @code{do_stat()} function. It starts with
+variable declarations and argument checking:
+
+@ignore
+Changed message for page breaking. Used to be:
+ "stat: called with incorrect number of arguments (%d), should be 2",
+@end ignore
+@example
+/* do_stat --- provide a stat() function for gawk */
+
+static awk_value_t *
+do_stat(int nargs, awk_value_t *result)
+@{
+ awk_value_t file_param, array_param;
+ char *name;
+ awk_array_t array;
+ int ret;
+ struct stat sbuf;
+
+ assert(result != NULL);
+
+ if (do_lint && nargs != 2) @{
+ lintwarn(ext_id,
+ _("stat: called with wrong number of arguments"));
+ return make_number(-1, result);
+ @}
+@end example
+
+Then comes the actual work. First, the function gets the arguments.
+Next, it gets the information for the file.
+The code use @code{lstat()} (instead of @code{stat()})
+to get the file information,
+in case the file is a symbolic link.
+If there's an error, it sets @code{ERRNO} and returns:
+
+@example
+ /* file is first arg, array to hold results is second */
+ if ( ! get_argument(0, AWK_STRING, & file_param)
+ || ! get_argument(1, AWK_ARRAY, & array_param)) @{
+ warning(ext_id, _("stat: bad parameters"));
+ return make_number(-1, result);
+ @}
+
+ name = file_param.str_value.str;
+ array = array_param.array_cookie;
+
+ /* always empty out the array */
+ clear_array(array);
+
+ /* lstat the file, if error, set ERRNO and return */
+ ret = lstat(name, & sbuf);
+ if (ret < 0) @{
+ update_ERRNO_int(errno);
+ return make_number(ret, result);
+ @}
+@end example
+
+The tedious work is done by @code{fill_stat_array()}, shown
+earlier. When done, return the result from @code{fill_stat_array()}:
+
+@example
+ ret = fill_stat_array(name, array, & sbuf);
+
+ return make_number(ret, result);
+@}
+@end example
+
+@cindex programming conventions, @command{gawk} internals
+Finally, it's necessary to provide the ``glue'' that loads the
+new function(s) into @command{gawk}.
+
+The @code{filefuncs} extension also provides an @code{fts()}
+function, which we omit here. For its sake there is an initialization
+function:
+
+@example
+/* init_filefuncs --- initialization routine */
+
+static awk_bool_t
+init_filefuncs(void)
+@{
+ @dots{}
+@}
+@end example
+
+We are almost done. We need an array of @code{awk_ext_func_t}
+structures for loading each function into @command{gawk}:
+
+@example
+static awk_ext_func_t func_table[] = @{
+ @{ "chdir", do_chdir, 1 @},
+ @{ "stat", do_stat, 2 @},
+ @{ "fts", do_fts, 3 @},
+@};
+@end example
+
+Each extension must have a routine named @code{dl_load()} to load
+everything that needs to be loaded. It is simplest to use the
+@code{dl_load_func()} macro in @code{gawkapi.h}:
+
+@example
+/* define the dl_load() function using the boilerplate macro */
+
+dl_load_func(func_table, filefuncs, "")
+@end example
+
+And that's it! As an exercise, consider adding functions to
+implement system calls such as @code{chown()}, @code{chmod()},
+and @code{umask()}.
+
+@node Using Internal File Ops
+@subsection Integrating The Extensions
+
+@cindex @command{gawk}, interpreter@comma{} adding code to
+Now that the code is written, it must be possible to add it at
+runtime to the running @command{gawk} interpreter. First, the
+code must be compiled. Assuming that the functions are in
+a file named @file{filefuncs.c}, and @var{idir} is the location
+of the @file{gawkapi.h} header file,
+the following steps@footnote{In practice, you would probably want to
+use the GNU Autotools---Automake, Autoconf, Libtool, and Gettext---to
+configure and build your libraries. Instructions for doing so are beyond
+the scope of this @value{DOCUMENT}. @xref{gawkextlib}, for WWW links to
+the tools.} create a GNU/Linux shared library:
+
+@example
+$ @kbd{gcc -fPIC -shared -DHAVE_CONFIG_H -c -O -g -I@var{idir} filefuncs.c}
+$ @kbd{ld -o filefuncs.so -shared filefuncs.o -lc}
+@end example
+
+Once the library exists, it is loaded by using the @code{@@load} keyword.
+
+@example
+# file testff.awk
+@@load "filefuncs"
+
+BEGIN @{
+ "pwd" | getline curdir # save current directory
+ close("pwd")
+
+ chdir("/tmp")
+ system("pwd") # test it
+ chdir(curdir) # go back
+
+ print "Info for testff.awk"
+ ret = stat("testff.awk", data)
+ print "ret =", ret
+ for (i in data)
+ printf "data[\"%s\"] = %s\n", i, data[i]
+ print "testff.awk modified:",
+ strftime("%m %d %y %H:%M:%S", data["mtime"])
+
+ print "\nInfo for JUNK"
+ ret = stat("JUNK", data)
+ print "ret =", ret
+ for (i in data)
+ printf "data[\"%s\"] = %s\n", i, data[i]
+ print "JUNK modified:", strftime("%m %d %y %H:%M:%S", data["mtime"])
+@}
+@end example
+
+The @env{AWKLIBPATH} environment variable tells
+@command{gawk} where to find shared libraries (@pxref{Finding Extensions}).
+We set it to the current directory and run the program:
+
+@example
+$ @kbd{AWKLIBPATH=$PWD gawk -f testff.awk}
+@print{} /tmp
+@print{} Info for testff.awk
+@print{} ret = 0
+@print{} data["blksize"] = 4096
+@print{} data["mtime"] = 1350838628
+@print{} data["mode"] = 33204
+@print{} data["type"] = file
+@print{} data["dev"] = 2053
+@print{} data["gid"] = 1000
+@print{} data["ino"] = 1719496
+@print{} data["ctime"] = 1350838628
+@print{} data["blocks"] = 8
+@print{} data["nlink"] = 1
+@print{} data["name"] = testff.awk
+@print{} data["atime"] = 1350838632
+@print{} data["pmode"] = -rw-rw-r--
+@print{} data["size"] = 662
+@print{} data["uid"] = 1000
+@print{} testff.awk modified: 10 21 12 18:57:08
+@print{}
+@print{} Info for JUNK
+@print{} ret = -1
+@print{} JUNK modified: 01 01 70 02:00:00
+@end example
+
+@node Extension Samples
+@section The Sample Extensions In The @command{gawk} Distribution
+
+This @value{SECTION} provides brief overviews of the sample extensions
+that come in the @command{gawk} distribution. Some of them are intended
+for production use, such the @code{filefuncs} and @code{readdir} extensions.
+Others mainly provide example code that shows how to use the extension API.
+
+@menu
+* Extension Sample File Functions:: The file functions sample.
+* Extension Sample Fnmatch:: An interface to @code{fnmatch()}.
+* Extension Sample Fork:: An interface to @code{fork()} and other
+ process functions.
+* Extension Sample Ord:: Character to value to character
+ conversions.
+* Extension Sample Readdir:: An interface to @code{readdir()}.
+* Extension Sample Revout:: Reversing output sample output wrapper.
+* Extension Sample Rev2way:: Reversing data sample two-way processor.
+* Extension Sample Read write array:: Serializing an array to a file.
+* Extension Sample Readfile:: Reading an entire file into a string.
+* Extension Sample API Tests:: Tests for the API.
+* Extension Sample Time:: An interface to @code{gettimeofday()}
+ and @code{sleep()}.
+@end menu
+
+@node Extension Sample File Functions
+@subsection File Related Functions
+
+The @code{filefuncs} extension provides three different functions, as follows:
+The usage is:
+
+@table @code
+@item @@load "filefuncs"
+This is how you load the extension.
+
+@item result = chdir("/some/directory")
+The @code{chdir()} function is a direct hook to the @code{chdir()}
+system call to change the current directory. It returns zero
+upon success or less than zero upon error. In the latter case it updates
+@code{ERRNO}.
+
+@item result = stat("/some/path", statdata)
+The @code{stat()} function provides a hook into the
+@code{stat()} system call. In fact, it uses @code{lstat()}.
+It returns zero upon success or less than zero upon error.
+In the latter case it updates @code{ERRNO}.
+
+In all cases, it clears the @code{statdata} array.
+When the call is successful, @code{stat()} fills the @code{statdata}
+array with information retrieved from the filesystem, as follows:
+
+@c nested table
+@multitable @columnfractions .25 .60
+@item @code{statdata["name"]} @tab
+The name of the file.
+
+@item @code{statdata["dev"]} @tab
+Corresponds to the @code{st_dev} field in the @code{struct stat}.
+
+@item @code{statdata["ino"]} @tab
+Corresponds to the @code{st_ino} field in the @code{struct stat}.
+
+@item @code{statdata["mode"]} @tab
+Corresponds to the @code{st_mode} field in the @code{struct stat}.
+
+@item @code{statdata["nlink"]} @tab
+Corresponds to the @code{st_nlink} field in the @code{struct stat}.
+
+@item @code{statdata["uid"]} @tab
+Corresponds to the @code{st_uid} field in the @code{struct stat}.
+
+@item @code{statdata["gid"]} @tab
+Corresponds to the @code{st_gid} field in the @code{struct stat}.
+
+@item @code{statdata["size"]} @tab
+Corresponds to the @code{st_size} field in the @code{struct stat}.
+
+@item @code{statdata["atime"]} @tab
+Corresponds to the @code{st_atime} field in the @code{struct stat}.
+
+@item @code{statdata["mtime"]} @tab
+Corresponds to the @code{st_mtime} field in the @code{struct stat}.
+
+@item @code{statdata["ctime"]} @tab
+Corresponds to the @code{st_ctime} field in the @code{struct stat}.
+
+@item @code{statdata["rdev"]} @tab
+Corresponds to the @code{st_rdev} field in the @code{struct stat}.
+This element is only present for device files.
+
+@item @code{statdata["major"]} @tab
+Corresponds to the @code{st_major} field in the @code{struct stat}.
+This element is only present for device files.
+
+@item @code{statdata["minor"]} @tab
+Corresponds to the @code{st_minor} field in the @code{struct stat}.
+This element is only present for device files.
+
+@item @code{statdata["blksize"]} @tab
+Corresponds to the @code{st_blksize} field in the @code{struct stat}.
+if this field is present on your system.
+(It is present on all modern systems that we know of.)
+
+@item @code{statdata["pmode"]} @tab
+A human-readable version of the mode value, such as printed by
+@command{ls}. For example, @code{"-rwxr-xr-x"}.
+
+@item @code{statdata["linkval"]} @tab
+If the named file is a symbolic link, this element will exist
+and its value is the value of the symbolic link (where the
+symbolic link points to).
+
+@item @code{statdata["type"]} @tab
+The type of the file as a string. One of
+@code{"file"},
+@code{"blockdev"},
+@code{"chardev"},
+@code{"directory"},
+@code{"socket"},
+@code{"fifo"},
+@code{"symlink"},
+@code{"door"},
+or
+@code{"unknown"}.
+Not all systems support all file types.
+@end multitable
+
+@item flags = or(FTS_PHYSICAL, ...)
+@itemx result = fts(pathlist, flags, filedata)
+Walk the file trees provided in @code{pathlist} and fill in the
+@code{filedata} array as described below. @code{flags} is the bitwise
+OR of several predefined constant values, also as described below.
+Return zero if there were no errors, otherwise return @minus{}1.
+@end table
+
+The @code{fts()} function provides a hook to the C library @code{fts()}
+routines for traversing file hierarchies. Instead of returning data
+about one file at a time in a stream, it fills in a multi-dimensional
+array with data about each file and directory encountered in the requested
+hierarchies.
+
+The arguments are as follows:
+
+@table @code
+@item pathlist
+An array of filenames. The element values are used; the index values are ignored.
+
+@item flags
+This should be the bitwise OR of one or more of the following
+predefined constant flag values. At least one of
+@code{FTS_LOGICAL} or @code{FTS_PHYSICAL} must be provided; otherwise
+@code{fts()} returns an error value and sets @code{ERRNO}.
+The flags are:
+
+@c nested table
+@table @code
+@item FTS_LOGICAL
+Do a ``logical'' file traversal, where the information returned for
+a symbolic link refers to the linked-to file, and not to the symbolic
+link itself. This flag is mutually exclusive with @code{FTS_PHYSICAL}.
+
+@item FTS_PHYSICAL
+Do a ``physical'' file traversal, where the information returned for a
+symbolic link refers to the symbolic link itself. This flag is mutually
+exclusive with @code{FTS_LOGICAL}.
+
+@item FTS_NOCHDIR
+As a performance optimization, the C library @code{fts()} routines
+change directory as they traverse a file hierarchy. This flag disables
+that optimization.
+
+@item FTS_COMFOLLOW
+Immediately follow a symbolic link named in @code{pathlist},
+whether or not @code{FTS_LOGICAL} is set.
+
+@item FTS_SEEDOT
+By default, the @code{fts()} routines do not return entries for @file{.}
+and @file{..}. This option causes entries for @file{..} to also
+be included. (The extension always includes an entry for @file{.},
+see below.)
+
+@item FTS_XDEV
+During a traversal, do not cross onto a different mounted filesystem.
+@end table
+
+@item filedata
+The @code{filedata} array is first cleared. Then, @code{fts()} creates
+an element in @code{filedata} for every element in @code{pathlist}.
+The index is the name of the directory or file given in @code{pathlist}.
+The element for this index is itself an array. There are two cases.
+
+@c nested table
+@table @emph
+@item The path is a file.
+In this case, the array contains two or three elements:
+
+@c doubly nested table
+@table @code
+@item "path"
+The full path to this file, starting from the ``root'' that was given
+in the @code{pathlist} array.
+
+@item "stat"
+This element is itself an array, containing the same information as provided
+by the @code{stat()} function described earlier for its
+@code{statdata} argument. The element may not be present if
+the @code{stat()} system call for the file failed.
+
+@item "error"
+If some kind of error was encountered, the array will also
+contain an element named @code{"error"}, which is a string describing the error.
+@end table
+
+@item The path is a directory.
+In this case, the array contains one element for each entry in the
+directory. If an entry is a file, that element is as for files, just
+described. If the entry is a directory, that element is (recursively),
+an array describing the subdirectory. If @code{FTS_SEEDOT} was provided
+in the flags, then there will also be an element named @code{".."}. This
+element will be an array containing the data as provided by @code{stat()}.
+
+In addition, there will be an element whose index is @code{"."}.
+This element is an array containing the same two or three elements as
+for a file: @code{"path"}, @code{"stat"}, and @code{"error"}.
+@end table
+@end table
+
+The @code{fts()} function returns zero if there were no errors.
+Otherwise it returns @minus{}1.
+
+@quotation NOTE
+The @code{fts()} extension does not exactly mimic the
+interface of the C library @code{fts()} routines, choosing instead to
+provide an interface that is based on associative arrays, which should
+be more comfortable to use from an @command{awk} program. This includes the
+lack of a comparison function, since @command{gawk} already provides
+powerful array sorting facilities. While an @code{fts_read()}-like
+interface could have been provided, this felt less natural than simply
+creating a multi-dimensional array to represent the file hierarchy and
+its information.
+@end quotation
+
+See @file{test/fts.awk} in the @command{gawk} distribution for an example.
+
+@node Extension Sample Fnmatch
+@subsection Interface To @code{fnmatch()}
+
+This extension provides an interface to the C library
+@code{fnmatch()} function. The usage is:
+
+@example
+@@load "fnmatch"
+
+result = fnmatch(pattern, string, flags)
+@end example
+
+The @code{fnmatch} extension adds a single function named
+@code{fnmatch()}, one constant (@code{FNM_NOMATCH}), and an array of
+flag values named @code{FNM}.
+
+The arguments to @code{fnmatch()} are:
+
+@table @code
+@item pattern
+The filename wildcard to match.
+
+@item string
+The filename string,
+
+@item flag
+Either zero, or the bitwise OR of one or more of the
+flags in the @code{FNM} array.
+@end table
+
+The return value is zero on success, @code{FNM_NOMATCH}
+if the string did not match the pattern, or
+a different non-zero value if an error occurred.
+
+The flags are follows:
+
+@multitable @columnfractions .25 .75
+@item @code{FNM["CASEFOLD"]} @tab
+Corresponds to the @code{FNM_CASEFOLD} flag as defined in @code{fnmatch()}.
+
+@item @code{FNM["FILE_NAME"]} @tab
+Corresponds to the @code{FNM_FILE_NAME} flag as defined in @code{fnmatch()}.
+
+@item @code{FNM["LEADING_DIR"]} @tab
+Corresponds to the @code{FNM_LEADING_DIR} flag as defined in @code{fnmatch()}.
+
+@item @code{FNM["NOESCAPE"]} @tab
+Corresponds to the @code{FNM_NOESCAPE} flag as defined in @code{fnmatch()}.
+
+@item @code{FNM["PATHNAME"]} @tab
+Corresponds to the @code{FNM_PATHNAME} flag as defined in @code{fnmatch()}.
+
+@item @code{FNM["PERIOD"]} @tab
+Corresponds to the @code{FNM_PERIOD} flag as defined in @code{fnmatch()}.
+@end multitable
+
+Here is an example:
+
+@example
+@@load "fnmatch"
+@dots{}
+flags = or(FNM["PERIOD"], FNM["NOESCAPE"])
+if (fnmatch("*.a", "foo.c", flags) == FNM_NOMATCH)
+ print "no match"
+@end example
+
+@node Extension Sample Fork
+@subsection Interface To @code{fork()}, @code{wait()} and @code{waitpid()}
+
+The @code{fork} extension adds three functions, as follows.
+
+@table @code
+@item @@load "fork"
+This is how you load the extension.
+
+@item pid = fork()
+This function creates a new process. The return value is the zero in the
+child and the process-id number of the child in the parent, or @minus{}1
+upon error. In the latter case, @code{ERRNO} indicates the problem.
+In the child, @code{PROCINFO["pid"]} and @code{PROCINFO["ppid"]} are
+updated to reflect the correct values.
+
+@item ret = waitpid(pid)
+This function takes a numeric argument, which is the process-id to
+wait for. The return value is that of the
+@code{waitpid()} system call.
+
+@item ret = wait()
+This function waits for the first child to die.
+The return value is that of the
+@code{wait()} system call.
+@end table
+
+There is no corresponding @code{exec()} function.
+
+Here is an example:
+
+@example
+@@load "fork"
+@dots{}
+if ((pid = fork()) == 0)
+ print "hello from the child"
+else
+ print "hello from the parent"
+@end example
+
+@node Extension Sample Ord
+@subsection Character and Numeric values: @code{ord()} and @code{chr()}
+
+The @code{ordchr} extension adds two functions, named
+@code{ord()} and @code{chr()}, as follows.
+
+@table @code
+@item number = ord(string)
+Return the numeric value of the first character in @code{string}.
+
+@item char = chr(number)
+Return the string whose first character is that represented by @code{number}.
+@end table
+
+These functions are inspired by the Pascal language functions
+of the same name. Here is an example:
+
+@example
+@@load "ordchr"
+@dots{}
+printf("The numeric value of 'A' is %d\n", ord("A"))
+printf("The string value of 65 is %s\n", chr(65))
+@end example
+
+@node Extension Sample Readdir
+@subsection Reading Directories
+
+The @code{readdir} extension adds an input parser for directories, and
+adds a single function named @code{readdir_do_ftype()}.
+The usage is as follows:
+
+@example
+@@load "readdir"
+
+readdir_do_ftype("stat") # or "dirent" or "never"
+@end example
+
+When this extension is in use, instead of skipping directories named
+on the command line (or with @code{getline}),
+they are read, with each entry returned as a record.
+
+The record consists of at least two fields: the inode number and the
+filename, separated by a forward slash character.
+On systems where the directory entry contains the file type, the record
+has a third field which is a single letter indicating the type of the
+file:
+
+@multitable @columnfractions .1 .9
+@headitem Letter @tab File Type
+@item @code{b} @tab Block device
+@item @code{c} @tab Character device
+@item @code{d} @tab Directory
+@item @code{f} @tab Regular file
+@item @code{l} @tab Symbolic link
+@item @code{p} @tab Named pipe (FIFO)
+@item @code{s} @tab Socket
+@item @code{u} @tab Anything else (unknown)
+@end multitable
+
+On systems without the file type information, calling
+@samp{readdir_do_ftype("stat")} causes the extension to use the
+@code{lstat()} system call to retrieve the appropriate information. This
+is not the default, since @code{lstat()} is a potentially expensive
+operation. By calling @samp{readdir_do_ftype("never")} one can ensure
+that the file type information is never displayed, even when readily
+available in the directory entry.
+
+The third option, @samp{readdir_do_ftype("dirent")}, takes file type
+information from the directory entry, if it is available. This is the
+default on systems that supply this information.
+
+The @code{readdir_do_ftype()} function sets @code{ERRNO} if called
+without arguments or with invalid arguments.
+
+@quotation NOTE
+On GNU/Linux systems, there are filesystems that don't support the
+@code{d_type} entry (see the @i{readdir}(3) manual page), and so the file
+type is always @samp{u}. Therefore, using @samp{readdir_do_ftype("stat")}
+is advisable even on GNU/Linux systems. In this case, the @code{readdir}
+extension falls back to using @code{lstat()} when it encounters an
+unknown file type.
+@end quotation
+
+Here is an example:
+
+@example
+@@load "readdir"
+@dots{}
+BEGIN @{ FS = "/" @}
+@{ print "file name is", $2 @}
+@end example
+
+@node Extension Sample Revout
+@subsection Reversing Output
+
+The @code{revoutput} extension adds a simple output wrapper that reverses
+the characters in each output line. It's main purpose is to show how to
+write an output wrapper, although it may be mildly amusing for the unwary.
+Here is an example:
+
+@example
+@@load "revoutput"
+
+BEGIN @{
+ REVOUT = 1
+ print "hello, world" > "/dev/stdout"
+@}
+@end example
+
+The output from this program is:
+@samp{dlrow ,olleh}.
+
+@node Extension Sample Rev2way
+@subsection Two-Way I/O Example
+
+The @code{revtwoway} extension adds a simple two-way processor that
+reverses the characters in each line sent to it for reading back by
+the @command{awk} program. It's main purpose is to show how to write
+a two-way processor, although it may also be mildly amusing.
+The following example shows how to use it:
+
+@example
+@@load "revtwoway"
+
+BEGIN @{
+ cmd = "/magic/mirror"
+ print "hello, world" |& cmd
+ cmd |& getline result
+ print result
+ close(cmd)
+@}
+@end example
+
+@node Extension Sample Read write array
+@subsection Dumping and Restoring An Array
+
+The @code{rwarray} extension adds two functions,
+named @code{writea()} and @code{reada()}, as follows:
+
+@table @code
+@item ret = writea(file, array)
+This function takes a string argument, which is the name of the file
+to which dump the array, and the array itself as the second argument.
+@code{writea()} understands multidimensional arrays. It returns one on
+success, or zero upon failure.
+
+@item ret = reada(file, array)
+@code{reada()} is the inverse of @code{writea()};
+it reads the file named as its first argument, filling in
+the array named as the second argument. It clears the array first.
+Here too, the return value is one on success and zero upon failure.
+@end table
+
+The array created by @code{reada()} is identical to that written by
+@code{writea()} in the sense that the contents are the same. However,
+due to implementation issues, the array traversal order of the recreated
+array is likely to be different from that of the original array. As array
+traversal order in @command{awk} is by default undefined, this is not
+(technically) a problem. If you need to guarantee a particular traversal
+order, use the array sorting features in @command{gawk} to do so
+(@pxref{Array Sorting}).
+
+The file contains binary data. All integral values are written in network
+byte order. However, double precision floating-point values are written
+as native binary data. Thus, arrays containing only string data can
+theoretically be dumped on systems with one byte order and restored on
+systems with a different one, but this has not been tried.
+
+Here is an example:
+
+@example
+@@load "rwarray"
+@dots{}
+ret = writea("arraydump.bin", array)
+@dots{}
+ret = reada("arraydump.bin", array)
+@end example
+
+@node Extension Sample Readfile
+@subsection Reading An Entire File
+
+The @code{readfile} extension adds a single function
+named @code{readfile()}:
+
+@table @code
+@item result = readfile("/some/path")
+The argument is the name of the file to read. The return value is a
+string containing the entire contents of the requested file. Upon error,
+the function returns the empty string and sets @code{ERRNO}.
+@end table
+
+Here is an example:
+
+@example
+@@load "readfile"
+@dots{}
+contents = readfile("/path/to/file");
+if (contents == "" && ERRNO != "") @{
+ print("problem reading file", ERRNO) > "/dev/stderr"
+ ...
+@}
+@end example
+
+@node Extension Sample API Tests
+@subsection API Tests
+
+The @code{testext} extension exercises parts of the extension API that
+are not tested by the other samples. The @file{extension/testext.c}
+file contains both the C code for the extension and @command{awk}
+test code inside C comments that run the tests. The testing framework
+extracts the @command{awk} code and runs the tests. See the source file
+for more information.
+
+@node Extension Sample Time
+@subsection Extension Time Functions
+
+@cindex time
+@cindex sleep
+
+These functions can be used by either invoking @command{gawk}
+with a command-line argument of @samp{-l time} or by
+inserting @samp{@@load "time"} in your script.
+
+@table @code
+
+@cindex @code{gettimeofday} time extension function
+@item the_time = gettimeofday()
+Return the time in seconds that has elapsed since 1970-01-01 UTC as a
+floating point value. If the time is unavailable on this platform, return
+@minus{}1 and set @code{ERRNO}. The returned time should have sub-second
+precision, but the actual precision will vary based on the platform.
+If the standard C @code{gettimeofday()} system call is available on this
+platform, then it simply returns the value. Otherwise, if on Windows,
+it tries to use @code{GetSystemTimeAsFileTime()}.
+
+@cindex @code{sleep} time extension function
+@item result = sleep(@var{seconds})
+Attempt to sleep for @var{seconds} seconds. If @var{seconds} is negative,
+or the attempt to sleep fails, return @minus{}1 and set @code{ERRNO}.
+Otherwise, return zero after sleeping for the indicated amount of time.
+Note that @var{seconds} may be a floating-point (non-integral) value.
+Implementation details: depending on platform availability, this function
+tries to use @code{nanosleep()} or @code{select()} to implement the delay.
+@end table
+
+@node gawkextlib
+@section The @code{gawkextlib} Project
+
+The @uref{http://sourceforge.net/projects/gawkextlib/, @code{gawkextlib}}
+project provides a number of @command{gawk} extensions, including one for
+processing XML files. This is the evolution of the original @command{xgawk}
+(XML @command{gawk}) project.
+
+As of this writing, there are four extensions:
+
+@itemize @bullet
+@item
+XML parser extension, using the @uref{http://expat.sourceforge.net, Expat}
+XML parsing library.
+
+@item
+Postgres SQL extension.
+
+@item
+GD graphics library extension.
+
+@item
+MPFR library extension.
+This provides access to a number of MPFR functions which @command{gawk}'s
+native MPFR support does not.
+@end itemize
+
+The @code{time} extension described earlier (@pxref{Extension Sample
+Time}) was originally from this project but has been moved in to the
+main @command{gawk} distribution.
+
+You can check out the code for the @code{gawkextlib} project
+using the @uref{http://git-scm.com, GIT} distributed source
+code control system. The command is as follows:
+
+@example
+git clone git://git.code.sf.net/p/gawkextlib/code gawkextlib-code
+@end example
+
+You will need to have the @uref{http://expat.sourceforge.net, Expat}
+XML parser library installed in order to build and use the XML extension.
+
+In addition, you must have the GNU Autotools installed
+(@uref{http://www.gnu.org/software/autoconf, Autoconf},
+@uref{http://www.gnu.org/software/automake, Automake},
+@uref{http://www.gnu.org/software/libtool, Libtool},
+and
+@uref{http://www.gnu.org/software/gettext, Gettext}).
+
+The simple recipe for building and testing @code{gawkextlib} is as follows.
+First, build and install @command{gawk}:
+
+@example
+cd .../path/to/gawk/code
+./configure --prefix=/tmp/newgawk @ii{Install in /tmp/newgawk for now}
+make && make check @ii{Build and check that all is OK}
+make install @ii{Install gawk}
+@end example
+
+Next, build @code{gawkextlib} and test it:
+
+@example
+cd .../path/to/gawkextlib-code
+./update-autotools @ii{Generate configure, etc.}
+ @ii{You may have to run this command twice}
+./configure --with-gawk=/tmp/newgawk @ii{Configure, point at ``installed'' gawk}
+make && make check @ii{Build and check that all is OK}
+@end example
+
+If you write an extension that you wish to share with other
+@command{gawk} users, please consider doing so through the
+@code{gawkextlib} project.
+
+@iftex
+@part Part IV:@* Appendices
+@end iftex
+
+@ignore
+@ifdocbook
+
+@part Part IV:@* Appendices
+
+Part IV provides the appendices, the Glossary, and two licenses that cover
the @command{gawk} source code and this @value{DOCUMENT}, respectively.
-It contains the following appendixes:
+It contains the following appendices:
@itemize @bullet
@item
@@ -26493,11 +31973,7 @@ It contains the following appendixes:
@item
@ref{GNU Free Documentation License}.
@end itemize
-
-@page
-@evenheading @thispage@ @ @ @strong{@value{TITLE}} @| @|
-@oddheading @| @| @strong{@thischapter}@ @ @ @thispage
-@end iftex
+@end ifdocbook
@end ignore
@node Language History
@@ -26515,8 +31991,6 @@ This @value{CHAPTER} briefly describes the
evolution of the @command{awk} language, with cross-references to other parts
of the @value{DOCUMENT} where you can find more information.
-@c FIXME: Try to determine whether it was 3.1 or 3.2 that had new awk.
-
@menu
* V7/SVR3.1:: The major changes between V7 and System V
Release 3.1.
@@ -26931,6 +32405,7 @@ and
@code{xor()}
functions for bit manipulation
(@pxref{Bitwise Functions}).
+@c In 4.1, and(), or() and xor() grew the ability to take > 2 arguments
@item
The @code{asort()} and @code{asorti()} functions for sorting arrays
@@ -26942,11 +32417,6 @@ functions for internationalization
(@pxref{Programmer i18n}).
@item
-The @code{extension()} built-in function and the ability to add
-new functions dynamically
-(@pxref{Dynamic Extensions}).
-
-@item
The @code{fflush()} function from Brian Kernighan's
version of @command{awk}
(@pxref{I/O Functions}).
@@ -26973,29 +32443,70 @@ the @option{-f} command-line option
(@pxref{Options}).
@item
-The ability to use GNU-style long-named options that start with @option{--}
+The @env{AWKLIBPATH} environment variable for specifying a path search for
+the @option{-l} command-line option
+(@pxref{Options}).
+
+@item
+The
+@option{-b},
+@option{-c},
+@option{-C},
+@option{-d},
+@option{-D},
+@option{-e},
+@option{-E},
+@option{-g},
+@option{-h},
+@option{-i},
+@option{-l},
+@option{-L},
+@option{-M},
+@option{-n},
+@option{-N},
+@option{-o},
+@option{-O},
+@option{-p},
+@option{-P},
+@option{-r},
+@option{-S},
+@option{-t},
+and
+@option{-V}
+short options. Also, the
+ability to use GNU-style long-named options that start with @option{--}
and the
+@option{--assign},
+@option{--bignum},
@option{--characters-as-bytes},
-@option{--compat},
+@option{--copyright},
+@option{--debug},
@option{--dump-variables},
-@option{--exec},
+@option{--execle},
+@option{--field-separator},
+@option{--file},
@option{--gen-pot},
+@option{--help},
+@option{--include},
@option{--lint},
@option{--lint-old},
+@option{--load},
@option{--non-decimal-data},
+@option{--optimize},
@option{--posix},
+@option{--pretty-print},
@option{--profile},
@option{--re-interval},
@option{--sandbox},
@option{--source},
@option{--traditional},
+@option{--use-lc-numeric},
and
-@option{--use-lc-numeric}
-options
+@option{--version}
+long options
(@pxref{Options}).
@end itemize
-
@c new ports
@item
@@ -27060,7 +32571,7 @@ the three most widely-used freely available versions of @command{awk}
@item @samp{\x} Escape sequence @tab X @tab X @tab X
@item @code{RS} as regexp @tab @tab X @tab X
@item @code{FS} as null string @tab X @tab X @tab X
-@item @file{/dev/stdin} special file @tab X @tab X @tab X
+@item @file{/dev/stdin} special file @tab X @tab @tab X
@item @file{/dev/stdout} special file @tab X @tab X @tab X
@item @file{/dev/stderr} special file @tab X @tab X @tab X
@item @code{**} and @code{**=} operators @tab X @tab @tab X
@@ -27171,7 +32682,6 @@ to implementors to implement ranges in whatever way they choose.
The @command{gawk} maintainer chose to apply the pre-POSIX meaning in all
cases: the default regexp matching; with @option{--traditional}, and with
@option{--posix}; in all cases, @command{gawk} remains POSIX compliant.
-
@node Contributors
@appendixsec Major Contributors to @command{gawk}
@cindex @command{gawk}, list of contributors to
@@ -27304,6 +32814,7 @@ the various PC platforms.
Christos Zoulas
provided the @code{extension()}
built-in function for dynamically adding new modules.
+(This was removed at @command{gawk} 4.1.)
@item
@cindex Kahrs, J@"urgen
@@ -27367,7 +32878,7 @@ environments.
@cindex Haque, John
John Haque
reworked the @command{gawk} internals to use a byte-code engine,
-providing the @command{dgawk} debugger for @command{awk} programs.
+providing the @command{gawk} debugger for @command{awk} programs.
@item
@cindex Yawitz, Efraim
@@ -27933,10 +33444,6 @@ install-info --info-dir=x:/usr/info x:/usr/info/gawkinet.info
The binary distribution may contain a separate file containing additional
or more detailed installation instructions.
-As of April, 2012, up to date @command{gawk} binaries for MS Windows
-are available from @uref{http://sourceforge.net/projects/ezwinports/files/,
-Eli Zaretskii's ports project}.
-
@node PC Compiling
@appendixsubsubsec Compiling @command{gawk} for PC Operating Systems
@@ -28641,7 +34148,7 @@ since approximately 2003.
@item @command{pawk}
Nelson H.F.@: Beebe at the University of Utah has modified
Brian Kernighan's @command{awk} to provide timing and profiling information.
-It is different from @command{pgawk}
+It is different from @command{gawk} with the @option{--profile} option.
(@pxref{Profiling}),
in that it uses CPU-based profiling, not line-count
profiling. You may find it at either
@@ -28736,8 +34243,6 @@ maintainers of @command{gawk}. Everything in it applies specifically to
* Compatibility Mode:: How to disable certain @command{gawk}
extensions.
* Additions:: Making Additions To @command{gawk}.
-* Dynamic Extensions:: Adding new built-in functions to
- @command{gawk}.
* Future Extensions:: New features that may be implemented one day.
@end menu
@@ -28783,6 +34288,8 @@ as well as any considerations you should bear in mind.
@command{gawk}.
* New Ports:: Porting @command{gawk} to a new operating
system.
+* Derived Files:: Why derived files are kept in the
+ @command{git} repository.
@end menu
@node Accessing The Source
@@ -28814,7 +34321,7 @@ git clone http://git.savannah.gnu.org/r/gawk.git
@end example
Once you have made changes, you can use @samp{git diff} to produce a
-patch, and send that to the @command{gawk} maintainer; see @ref{Bugs}
+patch, and send that to the @command{gawk} maintainer; see @ref{Bugs},
for how to do that.
Finally, if you cannot install Git (e.g., if it hasn't been ported
@@ -28926,7 +34433,8 @@ of @code{switch} statements, instead of just the
plain pointer or character value.
@item
-Use the @code{TRUE}, @code{FALSE} and @code{NULL} symbolic constants
+Use @code{true}, @code{false} for @code{bool} values,
+the @code{NULL} symbolic constant for pointer values,
and the character constant @code{'\0'} where appropriate, instead of @code{1}
and @code{0}.
@@ -28973,8 +34481,9 @@ You will also have to sign paperwork for your documentation changes.
Submit changes as unified diffs.
Use @samp{diff -u -r -N} to compare
the original @command{gawk} source tree with your version.
-I recommend using the GNU version of @command{diff}.
-Send the output produced by either run of @command{diff} to me when you
+I recommend using the GNU version of @command{diff}, or best of all,
+@samp{git diff} or @samp{git format-patch}.
+Send the output produced by @command{diff} to me when you
submit your changes.
(@xref{Bugs}, for the electronic mail
information.)
@@ -29100,802 +34609,188 @@ operating systems' code that is already there.
In the code that you supply and maintain, feel free to use a
coding style and brace layout that suits your taste.
-@node Dynamic Extensions
-@appendixsec Adding New Built-in Functions to @command{gawk}
-@cindex Robinson, Will
-@cindex robot, the
-@cindex Lost In Space
-@quotation
-@i{Danger Will Robinson! Danger!!@*
-Warning! Warning!}@*
-The Robot
-@end quotation
+@node Derived Files
+@appendixsubsec Why Generated Files Are Kept In @command{git}
-@c STARTOFRANGE gladfgaw
-@cindex @command{gawk}, functions, adding
-@c STARTOFRANGE adfugaw
-@cindex adding, functions to @command{gawk}
-@c STARTOFRANGE fubadgaw
-@cindex functions, built-in, adding to @command{gawk}
-It is possible to add new built-in
-functions to @command{gawk} using dynamically loaded libraries. This
-facility is available on systems (such as GNU/Linux) that support
-the C @code{dlopen()} and @code{dlsym()} functions.
-This @value{SECTION} describes how to write and use dynamically
-loaded extensions for @command{gawk}.
-Experience with programming in
-C or C++ is necessary when reading this @value{SECTION}.
-
-@quotation CAUTION
-The facilities described in this @value{SECTION}
-are very much subject to change in a future @command{gawk} release.
-Be aware that you may have to re-do everything,
-at some future time.
-
-If you have written your own dynamic extensions,
-be sure to recompile them for each new @command{gawk} release.
-There is no guarantee of binary compatibility between different
-releases, nor will there ever be such a guarantee.
-@end quotation
+@c From emails written March 22, 2012, to the gawk developers list.
-@quotation NOTE
-When @option{--sandbox} is specified, extensions are disabled
-(@pxref{Options}.
-@end quotation
+If you look at the @command{gawk} source in the @command{git}
+repository, you will notice that it includes files that are automatically
+generated by GNU infrastructure tools, such as @file{Makefile.in} from
+@command{automake} and even @file{configure} from @command{autoconf}.
-@menu
-* Internals:: A brief look at some @command{gawk} internals.
-* Plugin License:: A note about licensing.
-* Sample Library:: A example of new functions.
-@end menu
+This is different from many Free Software projects that do not store
+the derived files, because that keeps the repository less cluttered,
+and it is easier to see the substantive changes when comparing versions
+and trying to understand what changed between commits.
-@node Internals
-@appendixsubsec A Minimal Introduction to @command{gawk} Internals
-@c STARTOFRANGE gawint
-@cindex @command{gawk}, internals
-
-The truth is that @command{gawk} was not designed for simple extensibility.
-The facilities for adding functions using shared libraries work, but
-are something of a ``bag on the side.'' Thus, this tour is
-brief and simplistic; would-be @command{gawk} hackers are encouraged to
-spend some time reading the source code before trying to write
-extensions based on the material presented here. Of particular note
-are the files @file{awk.h}, @file{builtin.c}, and @file{eval.c}.
-Reading @file{awkgram.y} in order to see how the parse tree is built
-would also be of use.
-
-@cindex @code{awk.h} file (internal)
-With the disclaimers out of the way, the following types, structure
-members, functions, and macros are declared in @file{awk.h} and are of
-use when writing extensions. The next @value{SECTION}
-shows how they are used:
+However, there are two reasons why the @command{gawk} maintainer
+likes to have everything in the repository.
-@table @code
-@cindex floating-point, numbers, @code{AWKNUM} internal type
-@cindex numbers, floating-point, @code{AWKNUM} internal type
-@cindex @code{AWKNUM} internal type
-@cindex internal type, @code{AWKNUM}
-@item AWKNUM
-An @code{AWKNUM} is the internal type of @command{awk}
-floating-point numbers. Typically, it is a C @code{double}.
-
-@cindex @code{NODE} internal type
-@cindex internal type, @code{NODE}
-@cindex strings, @code{NODE} internal type
-@cindex numbers, @code{NODE} internal type
-@item NODE
-Just about everything is done using objects of type @code{NODE}.
-These contain both strings and numbers, as well as variables and arrays.
-
-@cindex @code{force_number()} internal function
-@cindex internal function, @code{force_number()}
-@cindex numeric, values
-@item AWKNUM force_number(NODE *n)
-This macro forces a value to be numeric. It returns the actual
-numeric value contained in the node.
-It may end up calling an internal @command{gawk} function.
-
-@cindex @code{force_string()} internal function
-@cindex internal function, @code{force_string()}
-@item void force_string(NODE *n)
-This macro guarantees that a @code{NODE}'s string value is current.
-It may end up calling an internal @command{gawk} function.
-It also guarantees that the string is zero-terminated.
-
-@cindex @code{force_wstring()} internal function
-@cindex internal function, @code{force_wstring()}
-@item void force_wstring(NODE *n)
-Similarly, this
-macro guarantees that a @code{NODE}'s wide-string value is current.
-It may end up calling an internal @command{gawk} function.
-It also guarantees that the wide string is zero-terminated.
-
-@cindex @code{get_curfunc_arg_count()} internal function
-@cindex internal function, @code{get_curfunc_arg_count()}
-@item 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 @code{get_actual_argument}. If this value is
-greater than @code{nargs}, the function was
-called incorrectly from the @command{awk} program.
-
-@cindex parameters@comma{} number of
-@cindex @code{nargs} internal variable
-@cindex internal variable, @code{nargs}
-@item nargs
-Inside an extension function, this is the maximum number of
-expected parameters, as set by the @code{make_builtin()} function.
-
-@cindex @code{stptr} internal variable
-@cindex internal variable, @code{stptr}
-@cindex @code{stlen} internal variable
-@cindex internal variable, @code{stlen}
-@item n->stptr
-@itemx n->stlen
-The data and length of a @code{NODE}'s string value, respectively.
-The string is @emph{not} guaranteed to be zero-terminated.
-If you need to pass the string value to a C library function, save
-the value in @code{n->stptr[n->stlen]}, assign @code{'\0'} to it,
-call the routine, and then restore the value.
-
-@cindex @code{wstptr} internal variable
-@cindex internal variable, @code{wstptr}
-@cindex @code{wstlen} internal variable
-@cindex internal variable, @code{wstlen}
-@item n->wstptr
-@itemx n->wstlen
-The data and length of a @code{NODE}'s wide-string value, respectively.
-Use @code{force_wstring()} to make sure these values are current.
-
-@cindex @code{type} internal variable
-@cindex internal variable, @code{type}
-@item n->type
-The type of the @code{NODE}. This is a C @code{enum}. Values should
-be one of @code{Node_var}, @code{Node_var_new}, or @code{Node_var_array}
-for function parameters.
-
-@cindex @code{vname} internal variable
-@cindex internal variable, @code{vname}
-@item n->vname
-The ``variable name'' of a node. This is not of much use inside
-externally written extensions.
-
-@cindex arrays, associative, clearing
-@cindex @code{assoc_clear()} internal function
-@cindex internal function, @code{assoc_clear()}
-@item void assoc_clear(NODE *n)
-Clears the associative array pointed to by @code{n}.
-Make sure that @samp{n->type == Node_var_array} first.
-
-@cindex arrays, elements, installing
-@cindex @code{assoc_lookup()} internal function
-@cindex internal function, @code{assoc_lookup()}
-@item NODE **assoc_lookup(NODE *symbol, NODE *subs, int reference)
-Finds, and installs if necessary, array elements.
-@code{symbol} is the array, @code{subs} is the subscript.
-This is usually a value created with @code{make_string()} (see below).
-@code{reference} should be @code{TRUE} if it is an error to use the
-value before it is created. Typically, @code{FALSE} is the
-correct value to use from extension functions.
-
-@cindex strings
-@cindex @code{make_string()} internal function
-@cindex internal function, @code{make_string()}
-@item NODE *make_string(char *s, size_t len)
-Take a C string and turn it into a pointer to a @code{NODE} that
-can be stored appropriately. This is permanent storage; understanding
-of @command{gawk} memory management is helpful.
-
-@cindex numbers
-@cindex @code{make_number()} internal function
-@cindex internal function, @code{make_number()}
-@item NODE *make_number(AWKNUM val)
-Take an @code{AWKNUM} and turn it into a pointer to a @code{NODE} that
-can be stored appropriately. This is permanent storage; understanding
-of @command{gawk} memory management is helpful.
-
-
-@cindex nodes@comma{} duplicating
-@cindex @code{dupnode()} internal function
-@cindex internal function, @code{dupnode()}
-@item NODE *dupnode(NODE *n)
-Duplicate a node. In most cases, this increments an internal
-reference count instead of actually duplicating the entire @code{NODE};
-understanding of @command{gawk} memory management is helpful.
-
-@cindex memory, releasing
-@cindex @code{unref()} internal function
-@cindex internal function, @code{unref()}
-@item void unref(NODE *n)
-This macro releases the memory associated with a @code{NODE}
-allocated with @code{make_string()} or @code{make_number()}.
-Understanding of @command{gawk} memory management is helpful.
-
-@cindex @code{make_builtin()} internal function
-@cindex internal function, @code{make_builtin()}
-@item void make_builtin(const char *name, NODE *(*func)(NODE *), int count)
-Register a C function pointed to by @code{func} as new built-in
-function @code{name}. @code{name} is a regular C string. @code{count}
-is the maximum number of arguments that the function takes.
-The function should be written in the following manner:
-
-@example
-/* do_xxx --- do xxx function for gawk */
-
-NODE *
-do_xxx(int nargs)
-@{
- @dots{}
-@}
-@end example
+First, because it is then easy to reproduce any given version completely,
+without relying upon the availability of (older, likely obsolete, and
+maybe even impossible to find) other tools.
-@cindex arguments, retrieving
-@cindex @code{get_argument()} internal function
-@cindex internal function, @code{get_argument()}
-@item NODE *get_argument(int i)
-This function is called from within a C extension function to get
-the @code{i}-th argument from the function call.
-The first argument is argument zero.
-
-@cindex @code{get_actual_argument()} internal function
-@cindex internal function, @code{get_actual_argument()}
-@item NODE *get_actual_argument(int i,
-@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ int@ optional,@ int@ wantarray);
-This function retrieves a particular argument @code{i}. @code{wantarray} is @code{TRUE}
-if the argument should be an array, @code{FALSE} otherwise. If @code{optional} is
-@code{TRUE}, the argument need not have been supplied. If it wasn't, the return
-value is @code{NULL}. It is a fatal error if @code{optional} is @code{TRUE} but
-the argument was not provided.
-
-@cindex @code{get_scalar_argument()} internal macro
-@cindex internal macro, @code{get_scalar_argument()}
-@item get_scalar_argument(i, opt)
-This is a convenience macro that calls @code{get_actual_argument()}.
-
-@cindex @code{get_array_argument()} internal macro
-@cindex internal macro, @code{get_array_argument()}
-@item get_array_argument(i, opt)
-This is a convenience macro that calls @code{get_actual_argument()}.
-
-@cindex functions, return values@comma{} setting
+As an extreme example, if you ever even think about trying to compile,
+oh, say, the V7 @command{awk}, you will discover that not only do you
+have to bootstrap the V7 @command{yacc} to do so, but you also need the
+V7 @command{lex}. And the latter is pretty much impossible to bring up
+on a modern GNU/Linux system.@footnote{We tried. It was painful.}
-@cindex @code{ERRNO} variable
-@cindex @code{update_ERRNO()} internal function
-@cindex internal function, @code{update_ERRNO()}
-@item void update_ERRNO(void)
-This function is called from within a C extension function to set
-the value of @command{gawk}'s @code{ERRNO} variable, based on the current
-value of the C @code{errno} global variable.
-It is provided as a convenience.
+(Or, let's say @command{gawk} 1.2 required @command{bison} whatever-it-was
+in 1989 and that there was no @file{awkgram.c} file in the repository. Is
+there a guarantee that we could find that @command{bison} version? Or that
+@emph{it} would build?)
-@cindex @code{ERRNO} variable
-@cindex @code{update_ERRNO_saved()} internal function
-@cindex internal function, @code{update_ERRNO_saved()}
-@item void update_ERRNO_saved(int errno_saved)
-This function is called from within a C extension function to set
-the value of @command{gawk}'s @code{ERRNO} variable, based on the error
-value provided as the argument.
-It is provided as a convenience.
+If the repository has all the generated files, then it's easy to just check
+them out and build. (Or @emph{easier}, depending upon how far back we go.
+@code{:-)})
-@cindex @code{ENVIRON} array
-@cindex @code{PROCINFO} array
-@cindex @code{register_deferred_variable()} internal function
-@cindex internal function, @code{register_deferred_variable()}
-@item void register_deferred_variable(const char *name, NODE *(*load_func)(void))
-This function is called to register a function to be called when a
-reference to an undefined variable with the given name is encountered.
-The callback function will never be called if the variable exists already,
-so, unless the calling code is running at program startup, it should first
-check whether a variable of the given name already exists.
-The argument function must return a pointer to a @code{NODE} containing the
-newly created variable. This function is used to implement the builtin
-@code{ENVIRON} and @code{PROCINFO} arrays, so you can refer to them
-for examples.
-
-@cindex @code{IOBUF} internal structure
-@cindex internal structure, @code{IOBUF}
-@cindex @code{iop_alloc()} internal function
-@cindex internal function, @code{iop_alloc()}
-@cindex @code{get_record()} input method
-@cindex @code{close_func}() input method
-@cindex @code{INVALID_HANDLE} internal constant
-@cindex internal constant, @code{INVALID_HANDLE}
-@cindex XML (eXtensible Markup Language)
-@cindex eXtensible Markup Language (XML)
-@cindex @code{register_open_hook()} internal function
-@cindex internal function, @code{register_open_hook()}
-@item void register_open_hook(void *(*open_func)(IOBUF *))
-This function is called to register a function to be called whenever
-a new data file is opened, leading to the creation of an @code{IOBUF}
-structure in @code{iop_alloc()}. After creating the new @code{IOBUF},
-@code{iop_alloc()} will call (in reverse order of registration, so the last
-function registered is called first) each open hook until one returns
-non-@code{NULL}. If any hook returns a non-@code{NULL} value, that value is assigned
-to the @code{IOBUF}'s @code{opaque} field (which will presumably point
-to a structure containing additional state associated with the input
-processing), and no further open hooks are called.
-
-The function called will most likely want to set the @code{IOBUF}'s
-@code{get_record} method to indicate that future input records should
-be retrieved by calling that method instead of using the standard
-@command{gawk} input processing.
-
-And the function will also probably want to set the @code{IOBUF}'s
-@code{close_func} method to be called when the file is closed to clean
-up any state associated with the input.
-
-Finally, hook functions should be prepared to receive an @code{IOBUF}
-structure where the @code{fd} field is set to @code{INVALID_HANDLE},
-meaning that @command{gawk} was not able to open the file itself. In
-this case, the hook function must be able to successfully open the file
-and place a valid file descriptor there.
-
-Currently, for example, the hook function facility is used to implement
-the XML parser shared library extension. For more info, please look in
-@file{awk.h} and in @file{io.c}.
-@end table
+And that brings us to the second (and stronger) reason why all the files
+really need to be in @command{git}. It boils down to who do you cater
+to---the @command{gawk} developer(s), or the user who just wants to check
+out a version and try it out?
-An argument that is supposed to be an array needs to be handled with
-some extra code, in case the array being passed in is actually
-from a function parameter.
+The @command{gawk} maintainer
+wants it to be possible for any interested @command{awk} user in the
+world to just clone the repository, check out the branch of interest and
+build it. Without their having to have the correct version(s) of the
+autotools.@footnote{There is one GNU program that is (in our opinion)
+severely difficult to bootstrap from the @command{git} repository. For
+example, on the author's old (but still working) PowerPC macintosh with
+Mac OS X 10.5, it was necessary to bootstrap a ton of software, starting
+with @command{git} itself, in order to try to work with the latest code.
+It's not pleasant, and especially on older systems, it's a big waste
+of time.
-The following boilerplate code shows how to do this:
+Starting with the latest tarball was no picnic either. The maintainers
+had dropped @file{.gz} and @file{.bz2} files and only distribute
+@file{.tar.xz} files. It was necessary to bootstrap @command{xz} first!}
+That is the point of the @file{bootstrap.sh} file. It touches the
+various other files in the right order such that
@example
-NODE *the_arg;
-
-/* assume need 3rd arg, 0-based */
-the_arg = get_array_argument(2, FALSE);
+# The canonical incantation for building GNU software:
+./bootstrap.sh && ./configure && make
@end example
-Again, you should spend time studying the @command{gawk} internals;
-don't just blindly copy this code.
-@c ENDOFRANGE gawint
-
-@node Plugin License
-@appendixsubsec Extension Licensing
-
-Every dynamic extension should define the global symbol
-@code{plugin_is_GPL_compatible} to assert that it has been licensed under
-a GPL-compatible license. If this symbol does not exist, @command{gawk}
-will emit a fatal error and exit.
-
-The declared type of the symbol should be @code{int}. It does not need
-to be in any allocated section, though. The code merely asserts that
-the symbol exists in the global scope. Something like this is enough:
-
-@example
-int plugin_is_GPL_compatible;
-@end example
-
-@node Sample Library
-@appendixsubsec Example: Directory and File Operation Built-ins
-@c STARTOFRANGE chdirg
-@cindex @code{chdir()} function@comma{} implementing in @command{gawk}
-@c STARTOFRANGE statg
-@cindex @code{stat()} function@comma{} implementing in @command{gawk}
-@c STARTOFRANGE filre
-@cindex files, information about@comma{} retrieving
-@c STARTOFRANGE dirch
-@cindex directories, changing
-
-Two useful functions that are not in @command{awk} are @code{chdir()}
-(so that an @command{awk} program can change its directory) and
-@code{stat()} (so that an @command{awk} program can gather information about
-a file).
-This @value{SECTION} implements these functions for @command{gawk} in an
-external extension library.
-
-@menu
-* Internal File Description:: What the new functions will do.
-* Internal File Ops:: The code for internal file operations.
-* Using Internal File Ops:: How to use an external extension.
-@end menu
-
-@node Internal File Description
-@appendixsubsubsec Using @code{chdir()} and @code{stat()}
-
-This @value{SECTION} shows how to use the new functions at the @command{awk}
-level once they've been integrated into the running @command{gawk}
-interpreter.
-Using @code{chdir()} is very straightforward. It takes one argument,
-the new directory to change to:
-
-@example
-@dots{}
-newdir = "/home/arnold/funstuff"
-ret = chdir(newdir)
-if (ret < 0) @{
- printf("could not change to %s: %s\n",
- newdir, ERRNO) > "/dev/stderr"
- exit 1
-@}
-@dots{}
-@end example
-
-The return value is negative if the @code{chdir} failed,
-and @code{ERRNO}
-(@pxref{Built-in Variables})
-is set to a string indicating the error.
-
-Using @code{stat()} is a bit more complicated.
-The C @code{stat()} function fills in a structure that has a fair
-amount of information.
-The right way to model this in @command{awk} is to fill in an associative
-array with the appropriate information:
-
-@c broke printf for page breaking
-@example
-file = "/home/arnold/.profile"
-fdata[1] = "x" # force `fdata' to be an array
-ret = stat(file, fdata)
-if (ret < 0) @{
- printf("could not stat %s: %s\n",
- file, ERRNO) > "/dev/stderr"
- exit 1
-@}
-printf("size of %s is %d bytes\n", file, fdata["size"])
-@end example
-
-The @code{stat()} function always clears the data array, even if
-the @code{stat()} fails. It fills in the following elements:
-
-@table @code
-@item "name"
-The name of the file that was @code{stat()}'ed.
+@noindent
+will @emph{just work}.
-@item "dev"
-@itemx "ino"
-The file's device and inode numbers, respectively.
+This is extremely important for the @code{master} and
+@code{gawk-@var{X}.@var{Y}-stable} branches.
-@item "mode"
-The file's mode, as a numeric value. This includes both the file's
-type and its permissions.
+Further, the @command{gawk} maintainer would argue that it's also
+important for the @command{gawk} developers. When he tried to check out
+the @code{xgawk} branch@footnote{A branch created by one of the other
+developers that did not include the generated files.} to build it, he
+couldn't. (No @file{ltmain.sh} file, and he had no idea how to create it,
+and that was not the only problem.)
-@item "nlink"
-The number of hard links (directory entries) the file has.
+He felt @emph{extremely} frustrated. With respect to that branch,
+the maintainer is no different than Jane User who wants to try to build
+@code{gawk-4.0-stable} or @code{master} from the repository.
-@item "uid"
-@itemx "gid"
-The numeric user and group ID numbers of the file's owner.
+Thus, the maintainer thinks that it's not just important, but critical,
+that for any given branch, the above incantation @emph{just works}.
-@item "size"
-The size in bytes of the file.
+@c So - that's my reasoning and philosophy.
-@item "blocks"
-The number of disk blocks the file actually occupies. This may not
-be a function of the file's size if the file has holes.
+What are some of the consequences and/or actions to take?
-@item "atime"
-@itemx "mtime"
-@itemx "ctime"
-The file's last access, modification, and inode update times,
-respectively. These are numeric timestamps, suitable for formatting
-with @code{strftime()}
-(@pxref{Built-in}).
+@enumerate 1
+@item
+We don't mind that there are differing files in the different branches
+as a result of different versions of the autotools.
-@item "pmode"
-The file's ``printable mode.'' This is a string representation of
-the file's type and permissions, such as what is produced by
-@samp{ls -l}---for example, @code{"drwxr-xr-x"}.
+@enumerate A
+@item
+It's the maintainer's job to merge them and he will deal with it.
-@item "type"
-A printable string representation of the file's type. The value
-is one of the following:
+@item
+He is really good at @samp{git diff x y > /tmp/diff1 ; gvim /tmp/diff1} to
+remove the diffs that aren't of interest in order to review code. @code{:-)}
+@end enumerate
-@table @code
-@item "blockdev"
-@itemx "chardev"
-The file is a block or character device (``special file'').
+@item
+It would certainly help if everyone used the same versions of the GNU tools
+as he does, which in general are the latest released versions of
+@command{automake},
+@command{autoconf},
+@command{bison},
+and
+@command{gettext}.
@ignore
-@item "door"
-The file is a Solaris ``door'' (special file used for
-interprocess communications).
+If it would help if I sent out an "I just upgraded to version x.y
+of tool Z" kind of message to this list, I can do that. Up until
+now it hasn't been a real issue since I'm the only one who's been
+dorking with the configuration machinery.
@end ignore
-@item "directory"
-The file is a directory.
-
-@item "fifo"
-The file is a named-pipe (also known as a FIFO).
-
-@item "file"
-The file is just a regular file.
-
-@item "socket"
-The file is an @code{AF_UNIX} (``Unix domain'') socket in the
-filesystem.
-
-@item "symlink"
-The file is a symbolic link.
-@end table
-@end table
-
-Several additional elements may be present depending upon the operating
-system and the type of the file. You can test for them in your @command{awk}
-program by using the @code{in} operator
-(@pxref{Reference to Elements}):
-
-@table @code
-@item "blksize"
-The preferred block size for I/O to the file. This field is not
-present on all POSIX-like systems in the C @code{stat} structure.
-
-@item "linkval"
-If the file is a symbolic link, this element is the name of the
-file the link points to (i.e., the value of the link).
-
-@item "rdev"
-@itemx "major"
-@itemx "minor"
-If the file is a block or character device file, then these values
-represent the numeric device number and the major and minor components
-of that number, respectively.
-@end table
-
-@node Internal File Ops
-@appendixsubsubsec C Code for @code{chdir()} and @code{stat()}
-
-Here is the C code for these extensions. They were written for
-GNU/Linux. The code needs some more work for complete portability
-to other POSIX-compliant systems:@footnote{This version is edited
-slightly for presentation. See
-@file{extension/filefuncs.c} in the @command{gawk} distribution
-for the complete version.}
-
-@c break line for page breaking
-@example
-#include "awk.h"
-
-#include <sys/sysmacros.h>
-
-int plugin_is_GPL_compatible;
-
-/* do_chdir --- provide dynamically loaded chdir() builtin for gawk */
-
-static NODE *
-do_chdir(int nargs)
-@{
- NODE *newdir;
- int ret = -1;
-
- if (do_lint && get_curfunc_arg_count() != 1)
- lintwarn("chdir: called with incorrect number of arguments");
-
- newdir = get_scalar_argument(0, FALSE);
-@end example
-
-The file includes the @code{"awk.h"} header file for definitions
-for the @command{gawk} internals. It includes @code{<sys/sysmacros.h>}
-for access to the @code{major()} and @code{minor}() macros.
-
-@cindex programming conventions, @command{gawk} internals
-By convention, for an @command{awk} function @code{foo}, the function that
-implements it is called @samp{do_foo}. The function should take
-a @samp{int} argument, usually called @code{nargs}, that
-represents the number of defined arguments for the function. The @code{newdir}
-variable represents the new directory to change to, retrieved
-with @code{get_scalar_argument()}. Note that the first argument is
-numbered zero.
-
-This code actually accomplishes the @code{chdir()}. It first forces
-the argument to be a string and passes the string value to the
-@code{chdir()} system call. If the @code{chdir()} fails, @code{ERRNO}
-is updated.
-
-@example
- (void) force_string(newdir);
- ret = chdir(newdir->stptr);
- if (ret < 0)
- update_ERRNO();
-@end example
-
-Finally, the function returns the return value to the @command{awk} level:
-
-@example
- return make_number((AWKNUM) ret);
-@}
-@end example
-
-The @code{stat()} built-in is more involved. First comes a function
-that turns a numeric mode into a printable representation
-(e.g., 644 becomes @samp{-rw-r--r--}). This is omitted here for brevity:
+@enumerate A
+@item
+Installing from source is quite easy. It's how the maintainer worked for years
+under Fedora.
+He had @file{/usr/local/bin} at the front of hs @env{PATH} and just did:
-@c break line for page breaking
@example
-/* format_mode --- turn a stat mode field into something readable */
-
-static char *
-format_mode(unsigned long fmode)
-@{
- @dots{}
-@}
+wget http://ftp.gnu.org/gnu/@var{package}/@var{package}-@var{x}.@var{y}.@var{z}.tar.gz
+tar -xpzvf @var{package}-@var{x}.@var{y}.@var{z}.tar.gz
+cd @var{package}-@var{x}.@var{y}.@var{z}
+./configure && make && make check
+make install # as root
@end example
-Next comes the @code{do_stat()} function. It starts with
-variable declarations and argument checking:
+@item
+These days the maintainer uses Ubuntu 10.11 which is medium current, but
+he is already doing the above for @command{autoconf} and @command{bison}.
@ignore
-Changed message for page breaking. Used to be:
- "stat: called with incorrect number of arguments (%d), should be 2",
+(C. Rant: Recent Linux versions with GNOME 3 really suck. What
+ are all those people thinking? Fedora 15 was such a bust it drove
+ me to Ubuntu, but Ubuntu 11.04 and 11.10 are totally unusable from
+ a UI perspective. Bleah.)
@end ignore
-@example
-/* do_stat --- provide a stat() function for gawk */
-
-static NODE *
-do_stat(int nargs)
-@{
- NODE *file, *array, *tmp;
- struct stat sbuf;
- int ret;
- NODE **aptr;
- char *pmode; /* printable mode */
- char *type = "unknown";
-
- if (do_lint && get_curfunc_arg_count() > 2)
- lintwarn("stat: called with too many arguments");
-@end example
-
-Then comes the actual work. First, the function gets the arguments.
-Then, it always clears the array.
-The code use @code{lstat()} (instead of @code{stat()})
-to get the file information,
-in case the file is a symbolic link.
-If there's an error, it sets @code{ERRNO} and returns:
-
-@c comment made multiline for page breaking
-@example
- /* file is first arg, array to hold results is second */
- file = get_scalar_argument(0, FALSE);
- array = get_array_argument(1, FALSE);
-
- /* empty out the array */
- assoc_clear(array);
-
- /* lstat the file, if error, set ERRNO and return */
- (void) force_string(file);
- ret = lstat(file->stptr, & sbuf);
- if (ret < 0) @{
- update_ERRNO();
- return make_number((AWKNUM) ret);
- @}
-@end example
-
-Now comes the tedious part: filling in the array. Only a few of the
-calls are shown here, since they all follow the same pattern:
-
-@example
- /* fill in the array */
- aptr = assoc_lookup(array, tmp = make_string("name", 4), FALSE);
- *aptr = dupnode(file);
- unref(tmp);
-
- aptr = assoc_lookup(array, tmp = make_string("mode", 4), FALSE);
- *aptr = make_number((AWKNUM) sbuf.st_mode);
- unref(tmp);
-
- aptr = assoc_lookup(array, tmp = make_string("pmode", 5), FALSE);
- pmode = format_mode(sbuf.st_mode);
- *aptr = make_string(pmode, strlen(pmode));
- unref(tmp);
-@end example
-
-When done, return the @code{lstat()} return value:
-
-@example
-
- return make_number((AWKNUM) ret);
-@}
-@end example
-
-@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
+@end enumerate
-And that's it! As an exercise, consider adding functions to
-implement system calls such as @code{chown()}, @code{chmod()},
-and @code{umask()}.
+@ignore
+@item
+If someone still feels really strongly about all this, then perhaps they
+can have two branches, one for their development with just the clean
+changes, and one that is buildable (xgawk and xgawk-buildable, maybe).
+Or, as I suggested in another mail, make commits in pairs, the first with
+the "real" changes and the second with "everything else needed for
+ building".
+@end ignore
+@end enumerate
-@node Using Internal File Ops
-@appendixsubsubsec Integrating the Extensions
+Most of the above was originally written by the maintainer to other
+@command{gawk} developers. It raised the objection from one of
+the developers ``@dots{} that anybody pulling down the source from
+@command{git} is not an end user.''
-@cindex @command{gawk}, interpreter@comma{} adding code to
-Now that the code is written, it must be possible to add it at
-runtime to the running @command{gawk} interpreter. First, the
-code must be compiled. Assuming that the functions are in
-a file named @file{filefuncs.c}, and @var{idir} is the location
-of the @command{gawk} include files,
-the following steps create
-a GNU/Linux shared library:
+However, this is not true. There are ``power @command{awk} users''
+who can build @command{gawk} (using the magic incantation shown previously)
+but who can't program in C. Thus, the major branches should be
+kept buildable all the time.
-@example
-$ @kbd{gcc -fPIC -shared -DHAVE_CONFIG_H -c -O -g -I@var{idir} filefuncs.c}
-$ @kbd{ld -o filefuncs.so -shared filefuncs.o}
-@end example
+It was then suggested that there be a @command{cron} job to create
+nightly tarballs of ``the source.'' Here, the problem is that there
+are source trees, corresponding to the various branches! So,
+nightly tar balls aren't the answer, especially as the repository can go
+for weeks without significant change being introduced.
-@cindex @code{extension()} function (@command{gawk})
-Once the library exists, it is loaded by calling the @code{extension()}
-built-in function.
-This function takes two arguments: the name of the
-library to load and the name of a function to call when the library
-is first loaded. This function adds the new functions to @command{gawk}.
-It returns the value returned by the initialization function
-within the shared library:
+Fortunately, the @command{git} server can meet this need. For any given
+branch named @var{branchname}, use:
@example
-# file testff.awk
-BEGIN @{
- extension("./filefuncs.so", "dlload")
-
- chdir(".") # no-op
-
- data[1] = 1 # force `data' to be an array
- print "Info for testff.awk"
- ret = stat("testff.awk", data)
- print "ret =", ret
- for (i in data)
- printf "data[\"%s\"] = %s\n", i, data[i]
- print "testff.awk modified:",
- strftime("%m %d %y %H:%M:%S", data["mtime"])
-
- print "\nInfo for JUNK"
- ret = stat("JUNK", data)
- print "ret =", ret
- for (i in data)
- printf "data[\"%s\"] = %s\n", i, data[i]
- print "JUNK modified:", strftime("%m %d %y %H:%M:%S", data["mtime"])
-@}
+wget http://git.savannah.gnu.org/cgit/gawk.git/snapshot/gawk-@var{branchname}.tar.gz
@end example
-Here are the results of running the program:
+@noindent
+to retrieve a snapshot of the given branch.
-@example
-$ @kbd{gawk -f testff.awk}
-@print{} Info for testff.awk
-@print{} ret = 0
-@print{} data["size"] = 607
-@print{} data["ino"] = 14945891
-@print{} data["name"] = testff.awk
-@print{} data["pmode"] = -rw-rw-r--
-@print{} data["nlink"] = 1
-@print{} data["atime"] = 1293993369
-@print{} data["mtime"] = 1288520752
-@print{} data["mode"] = 33204
-@print{} data["blksize"] = 4096
-@print{} data["dev"] = 2054
-@print{} data["type"] = file
-@print{} data["gid"] = 500
-@print{} data["uid"] = 500
-@print{} data["blocks"] = 8
-@print{} data["ctime"] = 1290113572
-@print{} testff.awk modified: 10 31 10 12:25:52
-@print{}
-@print{} Info for JUNK
-@print{} ret = -1
-@print{} JUNK modified: 01 01 70 02:00:00
-@end example
-@c ENDOFRANGE filre
-@c ENDOFRANGE dirch
-@c ENDOFRANGE statg
-@c ENDOFRANGE chdirg
-@c ENDOFRANGE gladfgaw
-@c ENDOFRANGE adfugaw
-@c ENDOFRANGE fubadgaw
@node Future Extensions
@appendixsec Probable Future Extensions
@@ -29954,12 +34849,8 @@ Following is a list of probable future changes visible at the
@c these are ordered by likelihood
@table @asis
-@item Loadable module interface
-It is not clear that the @command{awk}-level interface to the
-modules facility is as good as it should be. The interface needs to be
-redesigned, particularly taking namespace issues into account, as
-well as possibly including issues such as library search path order
-and versioning.
+@item Databases
+It may be possible to map a GDBM/NDBM/SDBM file into an @command{awk} array.
@item @code{RECLEN} variable for fixed-length records
Along with @code{FIELDWIDTHS}, this would speed up the processing of
@@ -29967,9 +34858,6 @@ fixed-length records.
@code{PROCINFO["RS"]} would be @code{"RS"} or @code{"RECLEN"},
depending upon which kind of record processing is in effect.
-@item Databases
-It may be possible to map a GDBM/NDBM/SDBM file into an @command{awk} array.
-
@item More @code{lint} warnings
There are more things that could be checked for portability.
@end table
@@ -29978,21 +34866,6 @@ Following is a list of probable improvements that will make @command{gawk}'s
source code easier to work with:
@table @asis
-@item Loadable module mechanics
-The current extension mechanism works
-(@pxref{Dynamic Extensions}),
-but is rather primitive. It requires a fair amount of manual work
-to create and integrate a loadable module.
-Nor is the current mechanism as portable as might be desired.
-The GNU @command{libtool} package provides a number of features that
-would make using loadable modules much easier.
-@command{gawk} should be changed to use @command{libtool}.
-
-@item Loadable module internals
-The API to its internals that @command{gawk} ``exports'' should be revised.
-Too many things are needlessly exposed. A new API should be designed
-and implemented to make module writing easier.
-
@item Better array subscript management
@command{gawk}'s management of array subscript storage could use revamping,
so that using the same value to index multiple arrays only
@@ -30024,7 +34897,6 @@ other introductory texts that you should refer to instead.)
@menu
* Basic High Level:: The high level view.
* Basic Data Typing:: A very quick intro to data types.
-* Floating Point Issues:: Stuff to know about floating-point numbers.
@end menu
@node Basic High Level
@@ -30032,19 +34904,17 @@ other introductory texts that you should refer to instead.)
@cindex processing data
At the most basic level, the job of a program is to process
-some input data and produce results.
+some input data and produce results. See @ref{figure-general-flow}.
-@iftex
-@image{general-program}
-@end iftex
-@ifnottex
-@example
- _______
-+------+ / \ +---------+
-| Data | -----> < Program > -----> | Results |
-+------+ \_______/ +---------+
-@end example
-@end ifnottex
+@float Figure,figure-general-flow
+@caption{General Program Flow}
+@ifinfo
+@center @image{general-program, , , General program flow, txt}
+@end ifinfo
+@ifnotinfo
+@center @image{general-program, , , General program flow}
+@end ifnotinfo
+@end float
@cindex compiled programs
@cindex interpreted programs
@@ -30060,26 +34930,18 @@ instructions in your program to process the data.
@cindex programming, basic steps
When you write a program, it usually consists
-of the following, very basic set of steps:
+of the following, very basic set of steps, as shown
+in @ref{figure-process-flow}:
-@iftex
-@image{process-flow}
-@end iftex
-@ifnottex
-@example
- ______
-+----------------+ / More \ No +----------+
-| Initialization | -------> < Data > -------> | Clean Up |
-+----------------+ ^ \ ? / +----------+
- | +--+-+
- | | Yes
- | |
- | V
- | +---------+
- +-----+ Process |
- +---------+
-@end example
-@end ifnottex
+@float Figure,figure-process-flow
+@caption{Basic Program Steps}
+@ifinfo
+@center @image{process-flow, , , Basic Program Stages, txt}
+@end ifinfo
+@ifnotinfo
+@center @image{process-flow, , , Basic Program Stages}
+@end ifnotinfo
+@end float
@table @asis
@item Initialization
@@ -30175,47 +35037,10 @@ Individual variables, as well as numeric and string variables, are
referred to as @dfn{scalar} values.
Groups of values, such as arrays, are not scalars.
-@cindex integers
-@cindex floating-point, numbers
-@cindex numbers, floating-point
-Within computers, there are two kinds of numeric values: @dfn{integers}
-and @dfn{floating-point}.
-In school, integer values were referred to as ``whole'' numbers---that is,
-numbers without any fractional part, such as 1, 42, or @minus{}17.
-The advantage to integer numbers is that they represent values exactly.
-The disadvantage is that their range is limited. On most systems,
-this range is @minus{}2,147,483,648 to 2,147,483,647.
-However, many systems now support a range from
-@minus{}9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.
-
-@cindex unsigned integers
-@cindex integers, unsigned
-Integer values come in two flavors: @dfn{signed} and @dfn{unsigned}.
-Signed values may be negative or positive, with the range of values just
-described.
-Unsigned values are always positive. On most systems,
-the range is from 0 to 4,294,967,295.
-However, many systems now support a range from
-0 to 18,446,744,073,709,551,615.
-
-@cindex double precision floating-point
-@cindex single precision floating-point
-Floating-point numbers represent what are called ``real'' numbers; i.e.,
-those that do have a fractional part, such as 3.1415927.
-The advantage to floating-point numbers is that they
-can represent a much larger range of values.
-The disadvantage is that there are numbers that they cannot represent
-exactly.
-@command{awk} uses @dfn{double precision} floating-point numbers, which
-can hold more digits than @dfn{single precision}
-floating-point numbers.
-Floating-point issues are discussed more fully in
-@ref{Floating Point Issues}.
-
-At the very lowest level, computers store values as groups of binary digits,
-or @dfn{bits}. Modern computers group bits into groups of eight, called @dfn{bytes}.
-Advanced applications sometimes have to manipulate bits directly,
-and @command{gawk} provides functions for doing so.
+@ref{General Arithmetic}, provided a basic introduction to numeric
+types (integer and floating-point) and how they are used in a computer.
+Please review that information, including a number of caveats that
+were presented.
@cindex null strings
While you are probably used to the idea of a number without a value (i.e., zero),
@@ -30239,6 +35064,11 @@ plus 0 times 1, or decimal 10.
Octal and hexadecimal are discussed more in
@ref{Nondecimal-numbers}.
+At the very lowest level, computers store values as groups of binary digits,
+or @dfn{bits}. Modern computers group bits into groups of eight, called @dfn{bytes}.
+Advanced applications sometimes have to manipulate bits directly,
+and @command{gawk} provides functions for doing so.
+
Programs are written in programming languages.
Hundreds, if not thousands, of programming languages exist.
One of the most popular is the C programming language.
@@ -30258,239 +35088,6 @@ standard for C. This standard became an ISO standard in 1990.
In 1999, a revised ISO C standard was approved and released.
Where it makes sense, POSIX @command{awk} is compatible with 1999 ISO C.
-@node Floating Point Issues
-@appendixsec Floating-Point Number Caveats
-
-As mentioned earlier, floating-point numbers represent what are called
-``real'' numbers, i.e., those that have a fractional part. @command{awk}
-uses double precision floating-point numbers to represent all
-numeric values. This @value{SECTION} describes some of the issues
-involved in using floating-point numbers.
-
-There is a very nice
-@uref{http://www.validlab.com/goldberg/paper.pdf, paper on floating-point arithmetic}
-by David Goldberg,
-``What Every Computer Scientist Should Know About Floating-point Arithmetic,''
-@cite{ACM Computing Surveys} @strong{23}, 1 (1991-03), 5-48.
-This is worth reading if you are interested in the details,
-but it does require a background in computer science.
-
-@menu
-* String Conversion Precision:: The String Value Can Lie.
-* Unexpected Results:: Floating Point Numbers Are Not Abstract
- Numbers.
-* POSIX Floating Point Problems:: Standards Versus Existing Practice.
-@end menu
-
-@node String Conversion Precision
-@appendixsubsec The String Value Can Lie
-
-Internally, @command{awk} keeps both the numeric value
-(double precision floating-point) and the string value for a variable.
-Separately, @command{awk} keeps
-track of what type the variable has
-(@pxref{Typing and Comparison}),
-which plays a role in how variables are used in comparisons.
-
-It is important to note that the string value for a number may not
-reflect the full value (all the digits) that the numeric value
-actually contains.
-The following program (@file{values.awk}) illustrates this:
-
-@example
-@{
- sum = $1 + $2
- # see it for what it is
- printf("sum = %.12g\n", sum)
- # use CONVFMT
- a = "<" sum ">"
- print "a =", a
- # use OFMT
- print "sum =", sum
-@}
-@end example
-
-@noindent
-This program shows the full value of the sum of @code{$1} and @code{$2}
-using @code{printf}, and then prints the string values obtained
-from both automatic conversion (via @code{CONVFMT}) and
-from printing (via @code{OFMT}).
-
-Here is what happens when the program is run:
-
-@example
-$ @kbd{echo 3.654321 1.2345678 | awk -f values.awk}
-@print{} sum = 4.8888888
-@print{} a = <4.88889>
-@print{} sum = 4.88889
-@end example
-
-This makes it clear that the full numeric value is different from
-what the default string representations show.
-
-@code{CONVFMT}'s default value is @code{"%.6g"}, which yields a value with
-at least six significant digits. For some applications, you might want to
-change it to specify more precision.
-On most modern machines, most of the time,
-17 digits is enough to capture a floating-point number's
-value exactly.@footnote{Pathological cases can require up to
-752 digits (!), but we doubt that you need to worry about this.}
-
-@node Unexpected Results
-@appendixsubsec Floating Point Numbers Are Not Abstract Numbers
-
-@cindex floating-point, numbers
-Unlike numbers in the abstract sense (such as what you studied in high school
-or college math), numbers stored in computers are limited in certain ways.
-They cannot represent an infinite number of digits, nor can they always
-represent things exactly.
-In particular,
-floating-point numbers cannot
-always represent values exactly. Here is an example:
-
-@example
-$ @kbd{awk '@{ printf("%010d\n", $1 * 100) @}'}
-515.79
-@print{} 0000051579
-515.80
-@print{} 0000051579
-515.81
-@print{} 0000051580
-515.82
-@print{} 0000051582
-@kbd{@value{CTL}-d}
-@end example
-
-@noindent
-This shows that some values can be represented exactly,
-whereas others are only approximated. This is not a ``bug''
-in @command{awk}, but simply an artifact of how computers
-represent numbers.
-
-@cindex negative zero
-@cindex positive zero
-@cindex zero@comma{} negative vs.@: positive
-Another peculiarity of floating-point numbers on modern systems
-is that they often have more than one representation for the number zero!
-In particular, it is possible to represent ``minus zero'' as well as
-regular, or ``positive'' zero.
-
-This example shows that negative and positive zero are distinct values
-when stored internally, but that they are in fact equal to each other,
-as well as to ``regular'' zero:
-
-@example
-$ @kbd{gawk 'BEGIN @{ mz = -0 ; pz = 0}
-> @kbd{printf "-0 = %g, +0 = %g, (-0 == +0) -> %d\n", mz, pz, mz == pz}
-> @kbd{printf "mz == 0 -> %d, pz == 0 -> %d\n", mz == 0, pz == 0}
-> @kbd{@}'}
-@print{} -0 = -0, +0 = 0, (-0 == +0) -> 1
-@print{} mz == 0 -> 1, pz == 0 -> 1
-@end example
-
-It helps to keep this in mind should you process numeric data
-that contains negative zero values; the fact that the zero is negative
-is noted and can affect comparisons.
-
-@node POSIX Floating Point Problems
-@appendixsubsec Standards Versus Existing Practice
-
-Historically, @command{awk} has converted any non-numeric looking string
-to the numeric value zero, when required. Furthermore, the original
-definition of the language and the original POSIX standards specified that
-@command{awk} only understands decimal numbers (base 10), and not octal
-(base 8) or hexadecimal numbers (base 16).
-
-Changes in the language of the
-2001 and 2004 POSIX standard can be interpreted to imply that @command{awk}
-should support additional features. These features are:
-
-@itemize @bullet
-@item
-Interpretation of floating point data values specified in hexadecimal
-notation (@samp{0xDEADBEEF}). (Note: data values, @emph{not}
-source code constants.)
-
-@item
-Support for the special IEEE 754 floating point values ``Not A Number''
-(NaN), positive Infinity (``inf'') and negative Infinity (``@minus{}inf'').
-In particular, the format for these values is as specified by the ISO 1999
-C standard, which ignores case and can allow machine-dependent additional
-characters after the @samp{nan} and allow either @samp{inf} or @samp{infinity}.
-@end itemize
-
-The first problem is that both of these are clear changes to historical
-practice:
-
-@itemize @bullet
-@item
-The @command{gawk} maintainer feels that supporting hexadecimal floating
-point values, in particular, is ugly, and was never intended by the
-original designers to be part of the language.
-
-@item
-Allowing completely alphabetic strings to have valid numeric
-values is also a very severe departure from historical practice.
-@end itemize
-
-The second problem is that the @code{gawk} maintainer feels that this
-interpretation of the standard, which requires a certain amount of
-``language lawyering'' to arrive at in the first place, was not even
-intended by the standard developers. In other words, ``we see how you
-got where you are, but we don't think that that's where you want to be.''
-
-The 2008 POSIX standard added explicit wording to allow, but not require,
-that @command{awk} support hexadecimal floating point values and
-special values for ``Not A Number'' and infinity.
-
-Although the @command{gawk} maintainer continues to feel that
-providing those features is inadvisable,
-nevertheless, on systems that support IEEE floating point, it seems
-reasonable to provide @emph{some} way to support NaN and Infinity values.
-The solution implemented in @command{gawk} is as follows:
-
-@itemize @bullet
-@item
-With the @option{--posix} command-line option, @command{gawk} becomes
-``hands off.'' String values are passed directly to the system library's
-@code{strtod()} function, and if it successfully returns a numeric value,
-that is what's used.@footnote{You asked for it, you got it.}
-By definition, the results are not portable across
-different systems. They are also a little surprising:
-
-@example
-$ @kbd{echo nanny | gawk --posix '@{ print $1 + 0 @}'}
-@print{} nan
-$ @kbd{echo 0xDeadBeef | gawk --posix '@{ print $1 + 0 @}'}
-@print{} 3735928559
-@end example
-
-@item
-Without @option{--posix}, @command{gawk} interprets the four strings
-@samp{+inf},
-@samp{-inf},
-@samp{+nan},
-and
-@samp{-nan}
-specially, producing the corresponding special numeric values.
-The leading sign acts a signal to @command{gawk} (and the user)
-that the value is really numeric. Hexadecimal floating point is
-not supported (unless you also use @option{--non-decimal-data},
-which is @emph{not} recommended). For example:
-
-@example
-$ @kbd{echo nanny | gawk '@{ print $1 + 0 @}'}
-@print{} 0
-$ @kbd{echo +nan | gawk '@{ print $1 + 0 @}'}
-@print{} nan
-$ @kbd{echo 0xDeadBeef | gawk '@{ print $1 + 0 @}'}
-@print{} 0
-@end example
-
-@command{gawk} does ignore case in the four special values.
-Thus @samp{+nan} and @samp{+NaN} are the same.
-@end itemize
-
@c ENDOFRANGE procon
@node Glossary
@@ -30699,6 +35296,50 @@ It was written in @command{awk}
by Brian Kernighan and Jon Bentley, and is available from
@uref{http://netlib.sandia.gov/netlib/typesetting/chem.gz}.
+@cindex cookie
+@item Cookie
+A peculiar goodie, token, saying or remembrance
+produced by or presented to a program. (With thanks to Doug McIlroy.)
+@ignore
+From: Doug McIlroy <doug@cs.dartmouth.edu>
+Date: Sat, 13 Oct 2012 19:55:25 -0400
+To: arnold@skeeve.com
+Subject: Re: origin of the term "cookie"?
+
+I believe the term "cookie", for a more or less inscrutable
+saying or crumb of information, was injected into Unix
+jargon by Bob Morris, who used the word quite frequently.
+It had no fixed meaning as it now does in browsers.
+
+The word had been around long before it was recognized in
+the 8th edition glossary (earlier editions had no glossary):
+
+cookie a peculiar goodie, token, saying or remembrance
+returned by or presented to a program. [I would say that
+"returned by" would better read "produced by", and assume
+responsibility for the inexactitude.]
+
+Doug McIlroy
+
+From: Doug McIlroy <doug@cs.dartmouth.edu>
+Date: Sun, 14 Oct 2012 10:08:43 -0400
+To: arnold@skeeve.com
+Subject: Re: origin of the term "cookie"?
+
+> Can I forward your email to Eric Raymond, for possible addition to the
+> Jargon File?
+
+Sure. I might add that I don't know how "cookie" entered Morris's
+vocabulary. Certainly "values of beta give rise to dom!" (see google)
+was an early, if not the earliest Unix cookie. The fact that it was
+found lying around on a model 37 teletype (which had Greek beta in
+its type box) suggests that maybe it was seen to be like milk and
+cookies laid out for Santa Claus. Morris was wont to make such
+connections.
+
+Doug
+@end ignore
+
@item Coprocess
A subordinate program with which two-way communications is possible.
@@ -32483,9 +37124,6 @@ Unresolved Issues:
of how to use them. It would be useful to perhaps have a "programming
style" section of the manual that would include this and other tips.
-2. The default AWKPATH search path should be configurable via `configure'
- The default and how this changes needs to be documented.
-
Consistency issues:
/.../ regexps are in @code, not @samp
".." strings are in @code, not @samp
@@ -32580,14 +37218,7 @@ ORA uses filename, thus the macro.
Suggestions:
------------
-Enhance FIELDWIDTHS with some way to indicate "the rest of the record".
-E.g., a length of 0 or -1 or something. May be "n"?
-
-Make FIELDWIDTHS be an array?
-
% Next edition:
-% 1. Talk about common extensions, those in nawk, gawk, mawk
-% 2. Use @code{foo} for variables and @code{foo()} for functions
-% 3. Standardize the error messages from the functions and programs
+% 1. Standardize the error messages from the functions and programs
% in Chapters 12 and 13.
-% 4. Nuke the BBS stuff and use something that won't be obsolete
+% 2. Nuke the BBS stuff and use something that won't be obsolete
diff --git a/doc/gawkinet.info b/doc/gawkinet.info
index 0a0d69d8..c8ce6b8d 100644
--- a/doc/gawkinet.info
+++ b/doc/gawkinet.info
@@ -613,7 +613,7 @@ tcp, udp x 0 x Invalid
tcp, udp 0 0 0 Invalid
tcp, udp 0 x 0 Invalid
-Table 2.1: /inet Special File Components
+Table 2.1: /inet Special File Components
In general, TCP is the preferred mechanism to use. It is the
simplest protocol to understand and to use. Use UDP only if
@@ -4358,40 +4358,40 @@ Node: Using Networking17966
Node: Gawk Special Files20284
Node: Special File Fields22094
Ref: table-inet-components25967
-Node: Comparing Protocols27287
-Node: File /inet/tcp27820
-Node: File /inet/udp28846
-Node: TCP Connecting29944
-Node: Troubleshooting32282
-Ref: Troubleshooting-Footnote-135334
-Node: Interacting35903
-Node: Setting Up38633
-Node: Email42127
-Node: Web page44453
-Ref: Web page-Footnote-147258
-Node: Primitive Service47455
-Node: Interacting Service50189
-Ref: Interacting Service-Footnote-159318
-Node: CGI Lib59350
-Node: Simple Server66311
-Ref: Simple Server-Footnote-174034
-Node: Caveats74135
-Node: Challenges75278
-Node: Some Applications and Techniques83957
-Node: PANIC86414
-Node: GETURL88132
-Node: REMCONF90755
-Node: URLCHK96231
-Node: WEBGRAB100066
-Node: STATIST104516
-Ref: STATIST-Footnote-1116224
-Node: MAZE116669
-Node: MOBAGWHO122853
-Ref: MOBAGWHO-Footnote-1136797
-Node: STOXPRED136852
-Node: PROTBASE151107
-Node: Links164188
-Node: GNU Free Documentation License167622
-Node: Index192761
+Node: Comparing Protocols27290
+Node: File /inet/tcp27823
+Node: File /inet/udp28849
+Node: TCP Connecting29947
+Node: Troubleshooting32285
+Ref: Troubleshooting-Footnote-135337
+Node: Interacting35906
+Node: Setting Up38636
+Node: Email42130
+Node: Web page44456
+Ref: Web page-Footnote-147261
+Node: Primitive Service47458
+Node: Interacting Service50192
+Ref: Interacting Service-Footnote-159321
+Node: CGI Lib59353
+Node: Simple Server66314
+Ref: Simple Server-Footnote-174037
+Node: Caveats74138
+Node: Challenges75281
+Node: Some Applications and Techniques83960
+Node: PANIC86417
+Node: GETURL88135
+Node: REMCONF90758
+Node: URLCHK96234
+Node: WEBGRAB100069
+Node: STATIST104519
+Ref: STATIST-Footnote-1116227
+Node: MAZE116672
+Node: MOBAGWHO122856
+Ref: MOBAGWHO-Footnote-1136800
+Node: STOXPRED136855
+Node: PROTBASE151110
+Node: Links164191
+Node: GNU Free Documentation License167625
+Node: Index192764

End Tag Table
diff --git a/doc/general-program.pdf b/doc/general-program.pdf
index c79b9efa..f4f7572c 100644
--- a/doc/general-program.pdf
+++ b/doc/general-program.pdf
Binary files differ
diff --git a/doc/general-program.png b/doc/general-program.png
new file mode 100644
index 00000000..7737261f
--- /dev/null
+++ b/doc/general-program.png
Binary files differ
diff --git a/doc/general-program.txt b/doc/general-program.txt
new file mode 100644
index 00000000..cb85c294
--- /dev/null
+++ b/doc/general-program.txt
@@ -0,0 +1,4 @@
+ _______
++------+ / \ +---------+
+| Data | -----> < Program > -----> | Results |
++------+ \_______/ +---------+
diff --git a/doc/process-flow.pdf b/doc/process-flow.pdf
index 23d567d2..3ff5f9e8 100644
--- a/doc/process-flow.pdf
+++ b/doc/process-flow.pdf
Binary files differ
diff --git a/doc/process-flow.png b/doc/process-flow.png
new file mode 100644
index 00000000..97f467f4
--- /dev/null
+++ b/doc/process-flow.png
Binary files differ
diff --git a/doc/process-flow.txt b/doc/process-flow.txt
new file mode 100644
index 00000000..d7296385
--- /dev/null
+++ b/doc/process-flow.txt
@@ -0,0 +1,11 @@
+ ______
++----------------+ / More \ No +----------+
+| Initialization | -------> < Data > -------> | Clean Up |
++----------------+ ^ \ ? / +----------+
+ | +--+-+
+ | | Yes
+ | |
+ | V
+ | +---------+
+ +-----+ Process |
+ +---------+
diff --git a/doc/texinfo.tex b/doc/texinfo.tex
index f458ba72..9a2439c8 100644
--- a/doc/texinfo.tex
+++ b/doc/texinfo.tex
@@ -3,7 +3,7 @@
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
-\def\texinfoversion{2012-09-04.17}
+\def\texinfoversion{2012-09-05.06}
%
% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
@@ -3272,7 +3272,8 @@ end
% Settings used for typesetting titles: no hyphenation, no indentation,
% don't worry much about spacing, ragged right. This should be used
% inside a \vbox, and fonts need to be set appropriately first. Because
-% it is always used for titles, nothing else, we call \rmisbold.
+% it is always used for titles, nothing else, we call \rmisbold. \par
+% should be specified before the end of the \vbox, since a vbox is a group.
%
\def\raggedtitlesettings{%
\rmisbold
@@ -3289,7 +3290,7 @@ end
\parseargdef\title{%
\checkenv\titlepage
- \vbox{\titlefonts \raggedtitlesettings #1}
+ \vbox{\titlefonts \raggedtitlesettings #1\par}%
% print a rule at the page bottom also.
\finishedtitlepagefalse
\vskip4pt \hrule height 4pt width \hsize \vskip4pt
@@ -5592,14 +5593,6 @@ end
% Define @majorheading, @heading and @subheading
-% NOTE on use of \vbox for chapter headings, section headings, and such:
-% 1) We use \vbox rather than the earlier \line to permit
-% overlong headings to fold.
-% 2) \hyphenpenalty is set to 10000 because hyphenation in a
-% heading is obnoxious; this forbids it.
-% 3) Likewise, headings look best if no \parindent is used, and
-% if justification is not attempted. Hence \raggedright.
-
\def\majorheading{%
{\advance\chapheadingskip by 10pt \chapbreak }%
\parsearg\chapheadingzzz
@@ -5607,10 +5600,8 @@ end
\def\chapheading{\chapbreak \parsearg\chapheadingzzz}
\def\chapheadingzzz#1{%
- {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt\ptexraggedright
- \rmisbold #1\hfill}}%
- \bigskip \par\penalty 200\relax
+ \vbox{\chapfonts \raggedtitlesettings #1\par}%
+ \nobreak\bigskip \nobreak
\suppressfirstparagraphindent
}
@@ -5769,8 +5760,7 @@ end
%
% Typeset the actual heading.
\nobreak % Avoid page breaks at the interline glue.
- \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
- \hangindent=\wd0 \centerparametersmaybe
+ \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe
\unhbox0 #1\par}%
}%
\nobreak\bigskip % no page break after a chapter title
@@ -5792,18 +5782,18 @@ end
\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
%
\def\unnchfopen #1{%
-\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt\ptexraggedright
- \rmisbold #1\hfill}}\bigskip \par\nobreak
+ \chapoddpage
+ \vbox{\chapfonts \raggedtitlesettings #1\par}%
+ \nobreak\bigskip\nobreak
}
\def\chfopen #1#2{\chapoddpage {\chapfonts
\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
\par\penalty 5000 %
}
\def\centerchfopen #1{%
-\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt
- \hfill {\rmisbold #1}\hfill}}\bigskip \par\nobreak
+ \chapoddpage
+ \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}%
+ \nobreak\bigskip \nobreak
}
\def\CHAPFopen{%
\global\let\chapmacro=\chfopen
diff --git a/eval.c b/eval.c
index 2421aea1..36a81493 100644
--- a/eval.c
+++ b/eval.c
@@ -29,34 +29,19 @@ extern void after_beginfile(IOBUF **curfile);
extern double pow(double x, double y);
extern double modf(double x, double *yp);
extern double fmod(double x, double y);
-NODE **fcall_list;
+NODE **fcall_list = NULL;
long fcall_count = 0;
int currule = 0;
IOBUF *curfile = NULL; /* current data file */
-int exiting = FALSE;
+bool exiting = false;
-#ifdef DEBUGGING
-extern int pre_execute(INSTRUCTION **);
-extern void post_execute(INSTRUCTION *);
-#else
-#define r_interpret interpret
-#endif
+int (*interpret)(INSTRUCTION *);
+#define MAX_EXEC_HOOKS 10
+static int num_exec_hook = 0;
+static Func_pre_exec pre_execute[MAX_EXEC_HOOKS];
+static Func_post_exec post_execute = NULL;
-/*
- * Flag which executable this is; done here because eval.c is compiled
- * differently for each of them.
- */
-enum exe_mode which_gawk =
-#ifdef PROFILING
- exe_profiling /* pgawk */
-#else
-# ifdef DEBUGGING
- exe_debugging /* dgawk */
-# else
- exe_normal /* normal gawk */
-# endif
-#endif
- ; /* which_gawk */
+extern void frame_popped();
#if __GNUC__ < 2
NODE *_t; /* used as a temporary in macros */
@@ -66,12 +51,7 @@ int ORSlen;
int OFMTidx;
int CONVFMTidx;
-/* Profiling stuff */
-#ifdef PROFILING
-#define INCREMENT(n) n++
-#else
-#define INCREMENT(n) /* nothing */
-#endif
+static NODE *node_Boolean[2];
/* This rather ugly macro is for VMS C */
#ifdef C
@@ -226,12 +206,12 @@ load_casetable(void)
#if defined(LC_CTYPE)
int i;
char *cp;
- static int loaded = FALSE;
+ static bool loaded = false;
if (loaded || do_traditional)
return;
- loaded = TRUE;
+ loaded = true;
cp = setlocale(LC_CTYPE, NULL);
/* this is not per standard, but it's pretty safe */
@@ -262,9 +242,11 @@ static const char *const nodetypes[] = {
"Node_var_new",
"Node_param_list",
"Node_func",
- "Node_hashnode",
- "Node_ahash",
+ "Node_ext_func",
"Node_array_ref",
+ "Node_array_tree",
+ "Node_array_leaf",
+ "Node_dump_array",
"Node_arrayfor",
"Node_frame",
"Node_instruction",
@@ -349,6 +331,7 @@ static struct optypetab {
{ "Op_K_nextfile", "nextfile" },
{ "Op_builtin", NULL },
{ "Op_sub_builtin", NULL },
+ { "Op_ext_builtin", NULL },
{ "Op_in_array", " in " },
{ "Op_func_call", NULL },
{ "Op_indirect_func_call", NULL },
@@ -376,7 +359,6 @@ static struct optypetab {
{ "Op_field_assign", NULL },
{ "Op_after_beginfile", NULL },
{ "Op_after_endfile", NULL },
- { "Op_ext_func", NULL },
{ "Op_func", NULL },
{ "Op_exec_count", NULL },
{ "Op_breakpoint", NULL },
@@ -446,20 +428,21 @@ flags2str(int flagval)
{
static const struct flagtab values[] = {
{ MALLOC, "MALLOC" },
- { PERM, "PERM" },
{ STRING, "STRING" },
{ STRCUR, "STRCUR" },
{ NUMCUR, "NUMCUR" },
{ NUMBER, "NUMBER" },
{ MAYBE_NUM, "MAYBE_NUM" },
- { ARRAYMAXED, "ARRAYMAXED" },
- { FUNC, "FUNC" },
{ FIELD, "FIELD" },
{ INTLSTR, "INTLSTR" },
- { NUMIND, "NUMIND" },
-#ifdef WSTRCUR
+ { NUMINT, "NUMINT" },
+ { INTIND, "INTIND" },
{ WSTRCUR, "WSTRCUR" },
-#endif
+ { MPFN, "MPFN" },
+ { MPZN, "MPZN" },
+ { ARRAYMAXED, "ARRAYMAXED" },
+ { HALFHAT, "HALFHAT" },
+ { XARRAY, "XARRAY" },
{ 0, NULL },
};
@@ -484,7 +467,7 @@ genflags2str(int flagval, const struct flagtab *tab)
* the '|' character.
*/
space_needed = (strlen(tab[i].name) + (sp != buffer));
- if (space_left < space_needed)
+ if (space_left <= space_needed)
fatal(_("buffer overflow in genflags2str"));
if (sp != buffer) {
@@ -498,6 +481,7 @@ genflags2str(int flagval, const struct flagtab *tab)
}
}
+ *sp = '\0';
return buffer;
}
@@ -599,16 +583,13 @@ cmp_nodes(NODE *t1, NODE *t2)
(void) force_number(t1);
if (t2->flags & MAYBE_NUM)
(void) force_number(t2);
- if ((t1->flags & NUMBER) && (t2->flags & NUMBER)) {
- if (t1->numbr == t2->numbr)
- ret = 0;
- /* don't subtract, in case one or both are infinite */
- else if (t1->numbr < t2->numbr)
- ret = -1;
- else
- ret = 1;
- return ret;
- }
+ if (t1->flags & INTIND)
+ t1 = force_string(t1);
+ if (t2->flags & INTIND)
+ t2 = force_string(t2);
+
+ if ((t1->flags & NUMBER) && (t2->flags & NUMBER))
+ return cmp_numbers(t1, t2);
(void) force_string(t1);
(void) force_string(t2);
@@ -637,11 +618,13 @@ cmp_nodes(NODE *t1, NODE *t2)
ret = casetable[*cp1] - casetable[*cp2];
} else
ret = memcmp(t1->stptr, t2->stptr, l);
- return (ret == 0 ? ldiff : ret);
+
+ ret = ret == 0 ? ldiff : ret;
+ return ret;
}
+/* push_frame --- push a frame NODE onto stack */
-#if defined(PROFILING) || defined(DEBUGGING)
static void
push_frame(NODE *f)
{
@@ -663,27 +646,20 @@ push_frame(NODE *f)
fcall_list[1] = f;
}
+
+/* pop_frame --- pop off a frame NODE*/
+
static void
pop_frame()
{
-#ifdef DEBUGGING
- extern void frame_popped();
-#endif
if (fcall_count > 1)
memmove(fcall_list + 1, fcall_list + 2, (fcall_count - 1) * sizeof(NODE *));
fcall_count--;
assert(fcall_count >= 0);
-#ifdef DEBUGGING
- frame_popped();
-#endif
+ if (do_debug)
+ frame_popped();
}
-#else /* not PROFILING or DEBUGGING */
-#define push_frame(p) /* nothing */
-#define pop_frame() /* nothing */
-#endif
-
-#ifdef PROFILING
/* dump_fcall_stack --- print a backtrace of the awk function calls */
@@ -691,7 +667,7 @@ void
dump_fcall_stack(FILE *fp)
{
NODE *f, *func;
- long i = 0;
+ long i = 0, j, k = 0;
if (fcall_count == 0)
return;
@@ -699,44 +675,49 @@ dump_fcall_stack(FILE *fp)
/* current frame */
func = frame_ptr->func_node;
- fprintf(fp, "\t# %3ld. %s\n", i, func->lnode->param);
+ for (j = 0; j <= frame_ptr->num_tail_calls; j++)
+ fprintf(fp, "\t# %3ld. %s\n", k++, func->vname);
/* outer frames except main */
for (i = 1; i < fcall_count; i++) {
f = fcall_list[i];
func = f->func_node;
- fprintf(fp, "\t# %3ld. %s\n", i, func->lnode->param);
+ for (j = 0; j <= f->num_tail_calls; j++)
+ fprintf(fp, "\t# %3ld. %s\n", k++, func->vname);
}
- fprintf(fp, "\t# %3ld. -- main --\n", fcall_count);
+ fprintf(fp, "\t# %3ld. -- main --\n", k);
}
-#endif /* PROFILING */
/* set_IGNORECASE --- update IGNORECASE as appropriate */
void
set_IGNORECASE()
{
- static short warned = FALSE;
+ static bool warned = false;
+ NODE *n = IGNORECASE_node->var_value;
if ((do_lint || do_traditional) && ! warned) {
- warned = TRUE;
+ warned = true;
lintwarn(_("`IGNORECASE' is a gawk extension"));
}
load_casetable();
if (do_traditional)
- IGNORECASE = FALSE;
- else if ((IGNORECASE_node->var_value->flags & (STRING|STRCUR)) != 0) {
- if ((IGNORECASE_node->var_value->flags & MAYBE_NUM) == 0)
- IGNORECASE = (force_string(IGNORECASE_node->var_value)->stlen > 0);
- else
- IGNORECASE = (force_number(IGNORECASE_node->var_value) != 0.0);
- } else if ((IGNORECASE_node->var_value->flags & (NUMCUR|NUMBER)) != 0)
- IGNORECASE = (force_number(IGNORECASE_node->var_value) != 0.0);
+ IGNORECASE = false;
+ else if ((n->flags & (STRING|STRCUR)) != 0) {
+ if ((n->flags & MAYBE_NUM) == 0) {
+ (void) force_string(n);
+ IGNORECASE = (n->stlen > 0);
+ } else {
+ (void) force_number(n);
+ IGNORECASE = ! iszero(n);
+ }
+ } else if ((n->flags & (NUMCUR|NUMBER)) != 0)
+ IGNORECASE = ! iszero(n);
else
- IGNORECASE = FALSE; /* shouldn't happen */
-
+ IGNORECASE = false; /* shouldn't happen */
+
set_RS(); /* set_RS() calls set_FS() if need be, for us */
}
@@ -745,26 +726,25 @@ set_IGNORECASE()
void
set_BINMODE()
{
- static short warned = FALSE;
+ static bool warned = false;
char *p;
- NODE *v;
+ NODE *v = BINMODE_node->var_value;
if ((do_lint || do_traditional) && ! warned) {
- warned = TRUE;
+ warned = true;
lintwarn(_("`BINMODE' is a gawk extension"));
}
if (do_traditional)
BINMODE = 0;
- else if ((BINMODE_node->var_value->flags & NUMBER) != 0) {
- BINMODE = (int) force_number(BINMODE_node->var_value);
+ else if ((v->flags & NUMBER) != 0) {
+ (void) force_number(v);
+ BINMODE = get_number_si(v);
/* Make sure the value is rational. */
if (BINMODE < 0)
BINMODE = 0;
else if (BINMODE > 3)
BINMODE = 3;
- }
- else if ((BINMODE_node->var_value->flags & STRING) != 0) {
- v = BINMODE_node->var_value;
+ } else if ((v->flags & STRING) != 0) {
p = v->stptr;
/*
@@ -813,8 +793,7 @@ set_BINMODE()
break;
}
}
- }
- else
+ } else
BINMODE = 3; /* shouldn't happen */
}
@@ -823,7 +802,8 @@ set_BINMODE()
void
set_OFS()
{
- OFS = force_string(OFS_node->var_value)->stptr;
+ OFS_node->var_value = force_string(OFS_node->var_value);
+ OFS = OFS_node->var_value->stptr;
OFSlen = OFS_node->var_value->stlen;
OFS[OFSlen] = '\0';
}
@@ -833,7 +813,8 @@ set_OFS()
void
set_ORS()
{
- ORS = force_string(ORS_node->var_value)->stptr;
+ ORS_node->var_value = force_string(ORS_node->var_value);
+ ORS = ORS_node->var_value->stptr;
ORSlen = ORS_node->var_value->stlen;
ORS[ORSlen] = '\0';
}
@@ -849,6 +830,7 @@ fmt_ok(NODE *n)
{
NODE *tmp = force_string(n);
const char *p = tmp->stptr;
+
#if ! defined(PRINTF_HAS_F_FORMAT) || PRINTF_HAS_F_FORMAT != 1
static const char float_formats[] = "efgEG";
#else
@@ -890,7 +872,7 @@ fmt_index(NODE *n)
if (fmt_list == NULL)
emalloc(fmt_list, NODE **, fmt_num*sizeof(*fmt_list), "fmt_index");
- (void) force_string(n);
+ n = force_string(n);
while (ix < fmt_hiwater) {
if (cmp_nodes(fmt_list[ix], n) == 0)
return ix;
@@ -937,47 +919,56 @@ set_LINT()
{
#ifndef NO_LINT
int old_lint = do_lint;
+ NODE *n = LINT_node->var_value;
- if ((LINT_node->var_value->flags & (STRING|STRCUR)) != 0) {
- if ((LINT_node->var_value->flags & MAYBE_NUM) == 0) {
+ if ((n->flags & (STRING|STRCUR)) != 0) {
+ if ((n->flags & MAYBE_NUM) == 0) {
const char *lintval;
size_t lintlen;
- do_lint = (force_string(LINT_node->var_value)->stlen > 0);
- lintval = LINT_node->var_value->stptr;
- lintlen = LINT_node->var_value->stlen;
- if (do_lint) {
- do_lint = LINT_ALL;
+ n = force_string(LINT_node->var_value);
+ lintval = n->stptr;
+ lintlen = n->stlen;
+ if (lintlen > 0) {
+ do_flags |= DO_LINT_ALL;
if (lintlen == 5 && strncmp(lintval, "fatal", 5) == 0)
lintfunc = r_fatal;
- else if (lintlen == 7 && strncmp(lintval, "invalid", 7) == 0)
- do_lint = LINT_INVALID;
- else
+ else if (lintlen == 7 && strncmp(lintval, "invalid", 7) == 0) {
+ do_flags &= ~ DO_LINT_ALL;
+ do_flags |= DO_LINT_INVALID;
+ } else
lintfunc = warning;
- } else
+ } else {
+ do_flags &= ~(DO_LINT_ALL|DO_LINT_INVALID);
lintfunc = warning;
+ }
} else {
- if (force_number(LINT_node->var_value) != 0.0)
- do_lint = LINT_ALL;
+ (void) force_number(n);
+ if (! iszero(n))
+ do_flags |= DO_LINT_ALL;
else
- do_lint = FALSE;
+ do_flags &= ~(DO_LINT_ALL|DO_LINT_INVALID);
lintfunc = warning;
}
- } else if ((LINT_node->var_value->flags & (NUMCUR|NUMBER)) != 0) {
- if (force_number(LINT_node->var_value) != 0.0)
- do_lint = LINT_ALL;
+ } else if ((n->flags & (NUMCUR|NUMBER)) != 0) {
+ (void) force_number(n);
+ if (! iszero(n))
+ do_flags |= DO_LINT_ALL;
else
- do_lint = FALSE;
+ do_flags &= ~(DO_LINT_ALL|DO_LINT_INVALID);
lintfunc = warning;
} else
- do_lint = FALSE; /* shouldn't happen */
+ do_flags &= ~(DO_LINT_ALL|DO_LINT_INVALID); /* shouldn't happen */
if (! do_lint)
lintfunc = warning;
/* explicitly use warning() here, in case lintfunc == r_fatal */
- if (old_lint != do_lint && old_lint && do_lint == FALSE)
+ if (old_lint != do_lint && old_lint && ! do_lint)
warning(_("turning off `--lint' due to assignment to `LINT'"));
+
+ /* inform plug-in api of change */
+ update_ext_api();
#endif /* ! NO_LINT */
}
@@ -987,9 +978,11 @@ void
set_TEXTDOMAIN()
{
int len;
+ NODE *tmp;
- TEXTDOMAIN = force_string(TEXTDOMAIN_node->var_value)->stptr;
- len = TEXTDOMAIN_node->var_value->stlen;
+ tmp = TEXTDOMAIN_node->var_value = force_string(TEXTDOMAIN_node->var_value);
+ TEXTDOMAIN = tmp->stptr;
+ len = tmp->stlen;
TEXTDOMAIN[len] = '\0';
/*
* Note: don't call textdomain(); this value is for
@@ -997,10 +990,10 @@ set_TEXTDOMAIN()
*/
}
-/* update_ERRNO_saved --- update the value of ERRNO based on argument */
+/* update_ERRNO_int --- update the value of ERRNO based on argument */
void
-update_ERRNO_saved(int errcode)
+update_ERRNO_int(int errcode)
{
char *cp;
@@ -1013,12 +1006,22 @@ update_ERRNO_saved(int errcode)
ERRNO_node->var_value = make_string(cp, strlen(cp));
}
-/* update_ERRNO --- update the value of ERRNO based on errno */
+/* update_ERRNO_string --- update ERRNO */
+
+void
+update_ERRNO_string(const char *string)
+{
+ unref(ERRNO_node->var_value);
+ ERRNO_node->var_value = make_string(string, strlen(string));
+}
+
+/* unset_ERRNO --- eliminate the value of ERRNO */
void
-update_ERRNO()
+unset_ERRNO(void)
{
- update_ERRNO_saved(errno);
+ unref(ERRNO_node->var_value);
+ ERRNO_node->var_value = dupnode(Nnull_string);
}
/* update_NR --- update the value of NR */
@@ -1026,9 +1029,14 @@ update_ERRNO()
void
update_NR()
{
+#ifdef HAVE_MPFR
+ if (is_mpg_number(NR_node->var_value))
+ (void) mpg_update_var(NR_node);
+ else
+#endif
if (NR_node->var_value->numbr != NR) {
unref(NR_node->var_value);
- NR_node->var_value = make_number((AWKNUM) NR);
+ NR_node->var_value = make_number(NR);
}
}
@@ -1037,11 +1045,14 @@ update_NR()
void
update_NF()
{
- if (NF == -1 || NF_node->var_value->numbr != NF) {
+ long l;
+
+ l = get_number_si(NF_node->var_value);
+ if (NF == -1 || l != NF) {
if (NF == -1)
(void) get_field(UNLIMITED - 1, NULL); /* parse record */
unref(NF_node->var_value);
- NF_node->var_value = make_number((AWKNUM) NF);
+ NF_node->var_value = make_number(NF);
}
}
@@ -1050,14 +1061,18 @@ update_NF()
void
update_FNR()
{
+#ifdef HAVE_MPFR
+ if (is_mpg_number(FNR_node->var_value))
+ (void) mpg_update_var(FNR_node);
+ else
+#endif
if (FNR_node->var_value->numbr != FNR) {
unref(FNR_node->var_value);
- FNR_node->var_value = make_number((AWKNUM) FNR);
+ FNR_node->var_value = make_number(FNR);
}
}
-
NODE *frame_ptr; /* current frame */
STACK_ITEM *stack_ptr = NULL;
STACK_ITEM *stack_bottom;
@@ -1078,32 +1093,6 @@ NODE **args_array = NULL;
STACK_ITEM *
grow_stack()
{
- if (stack_ptr == NULL) {
- char *val;
-
- if ((val = getenv("GAWK_STACKSIZE")) != NULL) {
- if (isdigit((unsigned char) *val)) {
- unsigned long n = 0;
- for (; *val && isdigit((unsigned char) *val); val++)
- n = (n * 10) + *val - '0';
- if (n >= 1)
- STACK_SIZE = n;
- }
- }
-
- emalloc(stack_bottom, STACK_ITEM *, STACK_SIZE * sizeof(STACK_ITEM), "grow_stack");
- stack_ptr = stack_bottom - 1;
- stack_top = stack_bottom + STACK_SIZE - 1;
-
- /* initialize frame pointer */
- getnode(frame_ptr);
- frame_ptr->type = Node_frame;
- frame_ptr->stack = NULL;
- frame_ptr->func_node = NULL; /* in main */
- frame_ptr->vname = NULL;
- return stack_ptr;
- }
-
STACK_SIZE *= 2;
erealloc(stack_bottom, STACK_ITEM *, STACK_SIZE * sizeof(STACK_ITEM), "grow_stack");
stack_top = stack_bottom + STACK_SIZE - 1;
@@ -1118,15 +1107,12 @@ grow_stack()
*/
NODE **
-r_get_lhs(NODE *n, int reference)
+r_get_lhs(NODE *n, bool reference)
{
- int isparam = FALSE;
+ bool isparam = false;
if (n->type == Node_param_list) {
- if ((n->flags & FUNC) != 0)
- fatal(_("can't use function name `%s' as variable or array"),
- n->vname);
- isparam = TRUE;
+ isparam = true;
n = GET_PARAM(n->param_cnt);
}
@@ -1139,11 +1125,11 @@ r_get_lhs(NODE *n, int reference)
fatal(_("attempt to use array `%s' in a scalar context"),
array_vname(n));
n->orig_array->type = Node_var;
- n->orig_array->var_value = Nnull_string;
+ n->orig_array->var_value = dupnode(Nnull_string);
/* fall through */
case Node_var_new:
n->type = Node_var;
- n->var_value = Nnull_string;
+ n->var_value = dupnode(Nnull_string);
break;
case Node_var:
@@ -1158,14 +1144,14 @@ r_get_lhs(NODE *n, int reference)
_("reference to uninitialized argument `%s'") :
_("reference to uninitialized variable `%s'")),
n->vname);
- return &n->var_value;
+ return & n->var_value;
}
/* r_get_field --- get the address of a field node */
static inline NODE **
-r_get_field(NODE *n, Func_ptr *assign, int reference)
+r_get_field(NODE *n, Func_ptr *assign, bool reference)
{
long field_num;
NODE **lhs;
@@ -1180,7 +1166,9 @@ r_get_field(NODE *n, Func_ptr *assign, int reference)
}
}
- field_num = (long) force_number(n);
+ (void) force_number(n);
+ field_num = get_number_si(n);
+
if (field_num < 0)
fatal(_("attempt to access field %ld"), field_num);
@@ -1239,17 +1227,42 @@ static INSTRUCTION *
setup_frame(INSTRUCTION *pc)
{
NODE *r = NULL;
- NODE *m;
- NODE *f;
+ NODE *m, *f, *fp;
NODE **sp = NULL;
- char **varnames;
- int pcount, arg_count, i;
+ int pcount, arg_count, i, j;
+ bool tail_optimize = false;
f = pc->func_body;
- pcount = f->lnode->param_cnt;
- varnames = f->parmlist;
+ pcount = f->param_cnt;
+ fp = f->fparms;
arg_count = (pc + 1)->expr_count;
+ /* tail recursion optimization */
+ tail_optimize = ((pc + 1)->tail_call && do_optimize > 1
+ && ! do_debug && ! do_profile);
+
+ if (tail_optimize) {
+ /* free local vars of calling frame */
+
+ NODE *func;
+ int n;
+
+ func = frame_ptr->func_node;
+ for (n = func->param_cnt, sp = frame_ptr->stack; n > 0; n--) {
+ r = *sp++;
+ if (r->type == Node_var) /* local variable */
+ DEREF(r->var_value);
+ else if (r->type == Node_var_array) /* local array */
+ assoc_clear(r);
+ }
+ sp = frame_ptr->stack;
+
+ } else if (pcount > 0) {
+ emalloc(sp, NODE **, pcount * sizeof(NODE *), "setup_frame");
+ memset(sp, 0, pcount * sizeof(NODE *));
+ }
+
+
/* check for extra args */
if (arg_count > pcount) {
warning(
@@ -1262,23 +1275,23 @@ setup_frame(INSTRUCTION *pc)
} while (--arg_count > pcount);
}
- if (pcount > 0) {
- emalloc(sp, NODE **, pcount * sizeof(NODE *), "setup_frame");
- memset(sp, 0, pcount * sizeof(NODE *));
- }
+ for (i = 0, j = arg_count - 1; i < pcount; i++, j--) {
+ if (tail_optimize)
+ r = sp[i];
+ else {
+ getnode(r);
+ memset(r, 0, sizeof(NODE));
+ sp[i] = r;
+ }
- for (i = 0; i < pcount; i++) {
- getnode(r);
- memset(r, 0, sizeof(NODE));
- sp[i] = r;
if (i >= arg_count) {
/* local variable */
r->type = Node_var_new;
- r->vname = varnames[i];
+ r->vname = fp[i].param;
continue;
}
- m = PEEK(arg_count - i - 1); /* arguments in reverse order on runtime stack */
+ m = PEEK(j); /* arguments in reverse order on runtime stack */
if (m->type == Node_param_list)
m = GET_PARAM(m->param_cnt);
@@ -1302,7 +1315,7 @@ setup_frame(INSTRUCTION *pc)
* subsequent param.
*/
r->type = Node_var;
- r->var_value = Nnull_string;
+ r->var_value = dupnode(Nnull_string);
break;
case Node_val:
@@ -1313,10 +1326,16 @@ setup_frame(INSTRUCTION *pc)
default:
cant_happen();
}
- r->vname = varnames[i];
+ r->vname = fp[i].param;
}
+
stack_adj(-arg_count); /* adjust stack pointer */
+ if (tail_optimize) {
+ frame_ptr->num_tail_calls++;
+ return f->code_ptr;
+ }
+
if (pc->opcode == Op_indirect_func_call) {
r = POP(); /* indirect var */
DEREF(r);
@@ -1324,7 +1343,8 @@ setup_frame(INSTRUCTION *pc)
frame_ptr->vname = source; /* save current source */
- push_frame(frame_ptr);
+ if (do_profile || do_debug)
+ push_frame(frame_ptr);
/* save current frame in stack */
PUSH(frame_ptr);
@@ -1335,6 +1355,7 @@ setup_frame(INSTRUCTION *pc)
frame_ptr->stack = sp;
frame_ptr->prev_frame_size = (stack_ptr - stack_bottom); /* size of the previous stack frame */
frame_ptr->func_node = f;
+ frame_ptr->num_tail_calls = 0;
frame_ptr->vname = NULL;
frame_ptr->reti = pc; /* on return execute pc->nexti */
@@ -1354,7 +1375,7 @@ restore_frame(NODE *fp)
INSTRUCTION *ri;
func = frame_ptr->func_node;
- n = func->lnode->param_cnt;
+ n = func->param_cnt;
sp = frame_ptr->stack;
for (; n > 0; n--) {
@@ -1365,13 +1386,15 @@ restore_frame(NODE *fp)
assoc_clear(r);
freenode(r);
}
+
if (frame_ptr->stack != NULL)
efree(frame_ptr->stack);
ri = frame_ptr->reti; /* execution in calling frame
* resumes from ri->nexti.
*/
freenode(frame_ptr);
- pop_frame();
+ if (do_profile || do_debug)
+ pop_frame();
/* restore frame */
frame_ptr = fp;
@@ -1388,18 +1411,22 @@ restore_frame(NODE *fp)
static inline void
free_arrayfor(NODE *r)
{
- if (r->var_array != NULL) {
- size_t num_elems = r->table_size;
- NODE **list = r->var_array;
- while (num_elems > 0)
- unref(list[--num_elems]);
+ if (r->for_list != NULL) {
+ NODE *n;
+ size_t num_elems = r->for_list_size;
+ NODE **list = r->for_list;
+ while (num_elems > 0) {
+ n = list[--num_elems];
+ unref(n);
+ }
efree(list);
}
freenode(r);
}
-/* unwind_stack --- pop items off the run-time stack;
+/*
+ * unwind_stack --- pop items off the run-time stack;
* 'n' is the # of items left in the stack.
*/
@@ -1460,30 +1487,30 @@ unwind_stack(long n)
#define pop_stack() (void) unwind_stack(0)
-/*
- * This generated compiler warnings from GCC 4.4. Who knows why.
- *
-#define eval_condition(t) (((t)->flags & MAYBE_NUM) && force_number(t), \
- ((t)->flags & NUMBER) ? ((t)->numbr != 0.0) : ((t)->stlen != 0))
-*/
-
-
static inline int
eval_condition(NODE *t)
{
+ if (t == node_Boolean[false])
+ return false;
+
+ if (t == node_Boolean[true])
+ return true;
+
if ((t->flags & MAYBE_NUM) != 0)
force_number(t);
+ else if ((t->flags & INTIND) != 0)
+ force_string(t);
if ((t->flags & NUMBER) != 0)
- return (t->numbr != 0.0);
+ return ! iszero(t);
return (t->stlen != 0);
}
-/* cmp_scalar -- compare two nodes on the stack */
+/* cmp_scalars -- compare two nodes on the stack */
static inline int
-cmp_scalar()
+cmp_scalars()
{
NODE *t1, *t2;
int di;
@@ -1506,32 +1533,33 @@ static void
op_assign(OPCODE op)
{
NODE **lhs;
- NODE *r = NULL;
- AWKNUM x1, x2;
-#ifndef HAVE_FMOD
- AWKNUM x;
-#endif
+ NODE *t1, *t2;
+ AWKNUM x = 0.0, x1, x2;
lhs = POP_ADDRESS();
- x1 = force_number(*lhs);
- TOP_NUMBER(x2);
- unref(*lhs);
+ t1 = *lhs;
+ x1 = force_number(t1)->numbr;
+
+ t2 = TOP_SCALAR();
+ x2 = force_number(t2)->numbr;
+ DEREF(t2);
+
switch (op) {
case Op_assign_plus:
- r = *lhs = make_number(x1 + x2);
+ x = x1 + x2;
break;
case Op_assign_minus:
- r = *lhs = make_number(x1 - x2);
+ x = x1 - x2;
break;
case Op_assign_times:
- r = *lhs = make_number(x1 * x2);
+ x = x1 * x2;
break;
case Op_assign_quotient:
if (x2 == (AWKNUM) 0) {
decr_sp();
fatal(_("division by zero attempted in `/='"));
}
- r = *lhs = make_number(x1 / x2);
+ x = x1 / x2;
break;
case Op_assign_mod:
if (x2 == (AWKNUM) 0) {
@@ -1539,24 +1567,30 @@ op_assign(OPCODE op)
fatal(_("division by zero attempted in `%%='"));
}
#ifdef HAVE_FMOD
- r = *lhs = make_number(fmod(x1, x2));
+ x = fmod(x1, x2);
#else /* ! HAVE_FMOD */
(void) modf(x1 / x2, &x);
x = x1 - x2 * x;
- r = *lhs = make_number(x);
#endif /* ! HAVE_FMOD */
break;
case Op_assign_exp:
- r = *lhs = make_number((AWKNUM) calc_exp((double) x1, (double) x2));
+ x = calc_exp((double) x1, (double) x2);
break;
default:
break;
}
- UPREF(r);
- REPLACE(r);
-}
+ if (t1->valref == 1 && t1->flags == (MALLOC|NUMCUR|NUMBER)) {
+ /* optimization */
+ t1->numbr = x;
+ } else {
+ unref(t1);
+ t1 = *lhs = make_number(x);
+ }
+ UPREF(t1);
+ REPLACE(t1);
+}
/* PUSH_CODE --- push a code onto the runtime stack */
@@ -1584,7 +1618,8 @@ POP_CODE()
}
-/* Implementation of BEGINFILE and ENDFILE requires saving an execution
+/*
+ * Implementation of BEGINFILE and ENDFILE requires saving an execution
* state and the ability to return to that state. The state is
* defined by the instruction triggering the BEGINFILE/ENDFILE rule, the
* run-time stack, the rule and the source file. The source line is available in
@@ -1653,1126 +1688,92 @@ pop_exec_state(int *rule, char **src, long *sz)
}
-/*
- * r_interpret:
- * code is a list of instructions to run. returns the exit value
- * from the awk code.
- */
-
- /* N.B.:
- * 1) reference counting done for both number and string values.
- * 2) TEMP flag no longer needed (consequence of the above; valref = 0
- * is the replacement).
- * 3) Stack operations:
- * Use REPLACE[_XX] if last stack operation was TOP[_XX],
- * PUSH[_XX] if last operation was POP[_XX] instead.
- * 4) UPREF and DREF -- see awk.h
- */
-
+/* register_exec_hook --- add exec hooks in the interpreter. */
int
-r_interpret(INSTRUCTION *code)
+register_exec_hook(Func_pre_exec preh, Func_post_exec posth)
{
- INSTRUCTION *pc; /* current instruction */
- NODE *r = NULL;
- NODE *m;
- INSTRUCTION *ni;
- NODE *t1, *t2;
- NODE *f; /* function definition */
- NODE **lhs;
- AWKNUM x, x1, x2;
- int di, pre = FALSE;
- Regexp *rp;
-#if defined(GAWKDEBUG) || defined(ARRAYDEBUG)
- int last_was_stopme = FALSE; /* builtin stopme() called ? */
-#endif
- int stdio_problem = FALSE;
-
+ int pos = 0;
- if (args_array == NULL)
- emalloc(args_array, NODE **, (max_args + 2)*sizeof(NODE *), "r_interpret");
- else
- erealloc(args_array, NODE **, (max_args + 2)*sizeof(NODE *), "r_interpret");
-
-/* array subscript */
-#define mk_sub(n) (n == 1 ? POP_STRING() : concat_exp(n, TRUE))
+ /*
+ * multiple post-exec hooks aren't supported. post-exec hook is mainly
+ * for use by the debugger.
+ */
-#ifdef DEBUGGING
-#define JUMPTO(x) do { post_execute(pc); pc = (x); goto top; } while(FALSE)
-#else
-#define JUMPTO(x) do { pc = (x); goto top; } while(FALSE)
-#endif
+ if (! preh || (post_execute && posth))
+ return false;
- pc = code;
+ if (num_exec_hook == MAX_EXEC_HOOKS)
+ return false;
- /* N.B.: always use JUMPTO for next instruction, otherwise bad things
- * may happen. DO NOT add a real loop (for/while) below to
- * replace ' forever {'; this catches failure to use JUMPTO to execute
- * next instruction (e.g. continue statement).
+ /*
+ * Add to the beginning of the array but do not displace the
+ * debugger hook if it exists.
*/
+ if (num_exec_hook > 0) {
+ pos = !! do_debug;
+ if (num_exec_hook > pos)
+ memmove(pre_execute + pos + 1, pre_execute + pos,
+ (num_exec_hook - pos) * sizeof (preh));
+ }
+ pre_execute[pos] = preh;
+ num_exec_hook++;
- /* loop until hit Op_stop instruction */
-
- /* forever { */
-top:
- if (pc->source_line > 0)
- sourceline = pc->source_line;
-
-#ifdef DEBUGGING
- if (! pre_execute(&pc))
- goto top;
-#endif
-
- switch (pc->opcode) {
- case Op_rule:
- currule = pc->in_rule; /* for sole use in Op_K_next, Op_K_nextfile, Op_K_getline* */
- /* fall through */
- case Op_func:
- case Op_ext_func:
- source = pc->source_file;
- break;
-
- case Op_atexit:
- /* avoid false source indications */
- source = NULL;
- sourceline = 0;
- (void) nextfile(&curfile, TRUE); /* close input data file */
- /*
- * This used to be:
- *
- * if (close_io() != 0 && ! exiting && exit_val == 0)
- * exit_val = 1;
- *
- * Other awks don't care about problems closing open files
- * and pipes, in that it doesn't affect their exit status.
- * So we no longer do either.
- */
- (void) close_io(& stdio_problem);
- /*
- * However, we do want to exit non-zero if there was a problem
- * with stdout/stderr, so we reinstate a slightly different
- * version of the above:
- */
- if (stdio_problem && ! exiting && exit_val == 0)
- exit_val = 1;
- break;
-
- case Op_stop:
- return 0;
-
- case Op_push_i:
- m = pc->memory;
- PUSH((m->flags & INTLSTR) != 0 ? format_val(CONVFMT, CONVFMTidx, m): m);
- break;
-
- case Op_push:
- case Op_push_arg:
- {
- NODE *save_symbol;
- int isparam = FALSE;
-
- save_symbol = m = pc->memory;
- if (m->type == Node_param_list) {
- if ((m->flags & FUNC) != 0)
- fatal(_("can't use function name `%s' as variable or array"),
- m->vname);
- isparam = TRUE;
- save_symbol = m = GET_PARAM(m->param_cnt);
- if (m->type == Node_array_ref)
- m = m->orig_array;
- }
-
- switch (m->type) {
- case Node_var:
- if (do_lint && var_uninitialized(m))
- lintwarn(isparam ?
- _("reference to uninitialized argument `%s'") :
- _("reference to uninitialized variable `%s'"),
- save_symbol->vname);
- m = m->var_value;
- UPREF(m);
- PUSH(m);
- break;
-
- case Node_var_new:
- m->type = Node_var;
- m->var_value = Nnull_string;
- if (do_lint)
- lintwarn(isparam ?
- _("reference to uninitialized argument `%s'") :
- _("reference to uninitialized variable `%s'"),
- save_symbol->vname);
- PUSH(Nnull_string);
- break;
-
- case Node_var_array:
- if (pc->opcode == Op_push_arg)
- PUSH(m);
- else
- fatal(_("attempt to use array `%s' in a scalar context"),
- array_vname(save_symbol));
- break;
-
- default:
- cant_happen();
- }
- }
- break;
-
- case Op_push_param: /* function argument */
- m = pc->memory;
- if (m->type == Node_param_list)
- m = GET_PARAM(m->param_cnt);
- if (m->type == Node_var) {
- m = m->var_value;
- UPREF(m);
- PUSH(m);
- break;
- }
- /* else
- fall through */
- case Op_push_array:
- PUSH(pc->memory);
- break;
-
- case Op_push_lhs:
- lhs = get_lhs(pc->memory, pc->do_reference);
- PUSH_ADDRESS(lhs);
- break;
-
- case Op_subscript:
- t2 = mk_sub(pc->sub_count);
- t1 = POP_ARRAY();
- r = *assoc_lookup(t1, t2, TRUE);
- DEREF(t2);
- if (r->type == Node_val)
- UPREF(r);
- PUSH(r);
- break;
-
- case Op_sub_array:
- t2 = mk_sub(pc->sub_count);
- t1 = POP_ARRAY();
- r = in_array(t1, t2);
- if (r == NULL) {
- getnode(r);
- r->type = Node_var_array;
- r->var_array = NULL;
- r->vname = estrdup(t2->stptr, t2->stlen); /* the subscript in parent array */
- r->parent_array = t1;
- *assoc_lookup(t1, t2, FALSE) = r;
- } else if (r->type != Node_var_array)
- fatal(_("attempt to use scalar `%s[\"%.*s\"]' as an array"),
- array_vname(t1), (int) t2->stlen, t2->stptr);
- DEREF(t2);
- PUSH(r);
- break;
-
- case Op_subscript_lhs:
- t2 = mk_sub(pc->sub_count);
- t1 = POP_ARRAY();
- lhs = assoc_lookup(t1, t2, pc->do_reference);
- if ((*lhs)->type == Node_var_array)
- fatal(_("attempt to use array `%s[\"%.*s\"]' in a scalar context"),
- array_vname(t1), (int) t2->stlen, t2->stptr);
- DEREF(t2);
- PUSH_ADDRESS(lhs);
- break;
-
- case Op_field_spec:
- t1 = TOP_SCALAR();
- lhs = r_get_field(t1, (Func_ptr *) 0, TRUE);
- decr_sp();
- DEREF(t1);
- /* This used to look like this:
- PUSH(dupnode(*lhs));
- but was changed to bypass an apparent bug in the z/OS C compiler.
- Please do not remerge. */
- r = dupnode(*lhs); /* can't use UPREF here */
- PUSH(r);
- break;
-
- case Op_field_spec_lhs:
- t1 = TOP_SCALAR();
- lhs = r_get_field(t1, &pc->target_assign->field_assign, pc->do_reference);
- decr_sp();
- DEREF(t1);
- PUSH_ADDRESS(lhs);
- break;
-
- case Op_lint:
- if (do_lint) {
- switch (pc->lint_type) {
- case LINT_assign_in_cond:
- lintwarn(_("assignment used in conditional context"));
- break;
-
- case LINT_no_effect:
- lintwarn(_("statement has no effect"));
- break;
-
- default:
- cant_happen();
- }
- }
- break;
-
- case Op_K_break:
- case Op_K_continue:
- case Op_jmp:
- JUMPTO(pc->target_jmp);
-
- case Op_jmp_false:
- r = POP_SCALAR();
- di = eval_condition(r);
- DEREF(r);
- if (! di)
- JUMPTO(pc->target_jmp);
- break;
-
- case Op_jmp_true:
- r = POP_SCALAR();
- di = eval_condition(r);
- DEREF(r);
- if (di)
- JUMPTO(pc->target_jmp);
- break;
-
- case Op_and:
- case Op_or:
- t1 = POP_SCALAR();
- di = eval_condition(t1);
- DEREF(t1);
- if ((pc->opcode == Op_and && di)
- || (pc->opcode == Op_or && ! di))
- break;
- r = make_number((AWKNUM) di);
- PUSH(r);
- ni = pc->target_jmp;
- JUMPTO(ni->nexti);
-
- case Op_and_final:
- case Op_or_final:
- t1 = TOP_SCALAR();
- r = make_number((AWKNUM) eval_condition(t1));
- DEREF(t1);
- REPLACE(r);
- break;
-
- case Op_not:
- t1 = TOP_SCALAR();
- r = make_number((AWKNUM) ! eval_condition(t1));
- DEREF(t1);
- REPLACE(r);
- break;
-
- case Op_equal:
- r = make_number((AWKNUM) (cmp_scalar() == 0));
- REPLACE(r);
- break;
-
- case Op_notequal:
- r = make_number((AWKNUM) (cmp_scalar() != 0));
- REPLACE(r);
- break;
-
- case Op_less:
- r = make_number((AWKNUM) (cmp_scalar() < 0));
- REPLACE(r);
- break;
-
- case Op_greater:
- r = make_number((AWKNUM) (cmp_scalar() > 0));
- REPLACE(r);
- break;
-
- case Op_leq:
- r = make_number((AWKNUM) (cmp_scalar() <= 0));
- REPLACE(r);
- break;
-
- case Op_geq:
- r = make_number((AWKNUM) (cmp_scalar() >= 0));
- REPLACE(r);
- break;
-
- case Op_plus_i:
- x2 = force_number(pc->memory);
- goto plus;
-
- case Op_plus:
- POP_NUMBER(x2);
-plus:
- TOP_NUMBER(x1);
- r = make_number(x1 + x2);
- REPLACE(r);
- break;
-
- case Op_minus_i:
- x2 = force_number(pc->memory);
- goto minus;
-
- case Op_minus:
- POP_NUMBER(x2);
-minus:
- TOP_NUMBER(x1);
- r = make_number(x1 - x2);
- REPLACE(r);
- break;
-
- case Op_times_i:
- x2 = force_number(pc->memory);
- goto times;
-
- case Op_times:
- POP_NUMBER(x2);
-times:
- TOP_NUMBER(x1);
- r = make_number(x1 * x2);
- REPLACE(r);
- break;
-
- case Op_exp_i:
- x2 = force_number(pc->memory);
- goto exponent;
-
- case Op_exp:
- POP_NUMBER(x2);
-exponent:
- TOP_NUMBER(x1);
- x = calc_exp(x1, x2);
- r = make_number(x);
- REPLACE(r);
- break;
-
- case Op_quotient_i:
- x2 = force_number(pc->memory);
- goto quotient;
-
- case Op_quotient:
- POP_NUMBER(x2);
-quotient:
- if (x2 == 0)
- fatal(_("division by zero attempted"));
-
- TOP_NUMBER(x1);
- x = x1 / x2;
- r = make_number(x);
- REPLACE(r);
- break;
-
- case Op_mod_i:
- x2 = force_number(pc->memory);
- goto mod;
-
- case Op_mod:
- POP_NUMBER(x2);
-mod:
- if (x2 == 0)
- fatal(_("division by zero attempted in `%%'"));
-
- TOP_NUMBER(x1);
-#ifdef HAVE_FMOD
- x = fmod(x1, x2);
-#else /* ! HAVE_FMOD */
- (void) modf(x1 / x2, &x);
- x = x1 - x * x2;
-#endif /* ! HAVE_FMOD */
- r = make_number(x);
- REPLACE(r);
- break;
-
- case Op_preincrement:
- pre = TRUE;
- case Op_postincrement:
- x2 = 1.0;
-post:
- lhs = TOP_ADDRESS();
- x1 = force_number(*lhs);
- unref(*lhs);
- r = *lhs = make_number(x1 + x2);
- if (pre)
- UPREF(r);
- else
- r = make_number(x1);
- REPLACE(r);
- pre = FALSE;
- break;
-
- case Op_predecrement:
- pre = TRUE;
- case Op_postdecrement:
- x2 = -1.0;
- goto post;
-
- case Op_unary_minus:
- TOP_NUMBER(x1);
- r = make_number(-x1);
- REPLACE(r);
- break;
-
- case Op_store_sub:
- /* array[sub] assignment optimization,
- * see awkgram.y (optimize_assignment)
- */
- t1 = get_array(pc->memory, TRUE); /* array */
- t2 = mk_sub(pc->expr_count); /* subscript */
- lhs = assoc_lookup(t1, t2, FALSE);
- if ((*lhs)->type == Node_var_array)
- fatal(_("attempt to use array `%s[\"%.*s\"]' in a scalar context"),
- array_vname(t1), (int) t2->stlen, t2->stptr);
- DEREF(t2);
- unref(*lhs);
- *lhs = POP_SCALAR();
- break;
-
- case Op_store_var:
- /* simple variable assignment optimization,
- * see awkgram.y (optimize_assignment)
- */
-
- lhs = get_lhs(pc->memory, FALSE);
- unref(*lhs);
- *lhs = POP_SCALAR();
- break;
-
- case Op_store_field:
- {
- /* field assignment optimization,
- * see awkgram.y (optimize_assignment)
- */
-
- Func_ptr assign;
- t1 = TOP_SCALAR();
- lhs = r_get_field(t1, &assign, FALSE);
- decr_sp();
- DEREF(t1);
- unref(*lhs);
- *lhs = POP_SCALAR();
- assert(assign != NULL);
- assign();
- }
- break;
-
- case Op_assign_concat:
- /* x = x ... string concatenation optimization */
- lhs = get_lhs(pc->memory, FALSE);
- t1 = force_string(*lhs);
- t2 = POP_STRING();
-
- free_wstr(*lhs);
-
- if (t1 != t2 && t1->valref == 1 && (t1->flags & PERM) == 0) {
- size_t nlen = t1->stlen + t2->stlen;
- erealloc(t1->stptr, char *, nlen + 2, "r_interpret");
- memcpy(t1->stptr + t1->stlen, t2->stptr, t2->stlen);
- t1->stlen = nlen;
- t1->stptr[nlen] = '\0';
- } else {
- size_t nlen = t1->stlen + t2->stlen;
- char *p;
-
- emalloc(p, char *, nlen + 2, "r_interpret");
- memcpy(p, t1->stptr, t1->stlen);
- memcpy(p + t1->stlen, t2->stptr, t2->stlen);
- unref(*lhs);
- t1 = *lhs = make_str_node(p, nlen, ALREADY_MALLOCED);
- }
- t1->flags &= ~(NUMCUR|NUMBER);
- DEREF(t2);
- break;
-
- case Op_assign:
- lhs = POP_ADDRESS();
- r = TOP_SCALAR();
- unref(*lhs);
- *lhs = r;
- UPREF(r);
- REPLACE(r);
- break;
-
- /* numeric assignments */
- case Op_assign_plus:
- case Op_assign_minus:
- case Op_assign_times:
- case Op_assign_quotient:
- case Op_assign_mod:
- case Op_assign_exp:
- op_assign(pc->opcode);
- break;
-
- case Op_var_update: /* update value of NR, FNR or NF */
- pc->update_var();
- break;
-
- case Op_var_assign:
- case Op_field_assign:
- if (pc->assign_ctxt == Op_sub_builtin
- && TOP()->numbr == 0.0 /* top of stack has a number == 0 */
- ) {
- /* There wasn't any substitutions. If the target is a FIELD,
- * this means no field re-splitting or $0 reconstruction.
- * Skip the set_FOO routine if the target is a special variable.
- */
-
- break;
- } else if ((pc->assign_ctxt == Op_K_getline
- || pc->assign_ctxt == Op_K_getline_redir)
- && TOP()->numbr <= 0.0 /* top of stack has a number <= 0 */
- ) {
- /* getline returned EOF or error */
-
- break;
- }
-
- if (pc->opcode == Op_var_assign)
- pc->assign_var();
- else
- pc->field_assign();
- break;
-
- case Op_concat:
- r = concat_exp(pc->expr_count, pc->concat_flag & CSUBSEP);
- PUSH(r);
- break;
-
- case Op_K_case:
- if ((pc + 1)->match_exp) {
- /* match a constant regex against switch expression instead of $0. */
- m = POP(); /* regex */
- t2 = TOP_SCALAR(); /* switch expression */
- (void) force_string(t2);
- rp = re_update(m);
- di = (research(rp, t2->stptr, 0, t2->stlen,
- avoid_dfa(m, t2->stptr, t2->stlen)) >= 0);
- } else {
- t1 = POP_SCALAR(); /* case value */
- t2 = TOP_SCALAR(); /* switch expression */
- di = (cmp_nodes(t2, t1) == 0);
- DEREF(t1);
- }
-
- if (di) { /* match found */
- decr_sp();
- DEREF(t2);
- JUMPTO(pc->target_jmp);
- }
- break;
-
- case Op_K_delete:
- t1 = POP_ARRAY();
- do_delete(t1, pc->expr_count);
- stack_adj(-pc->expr_count);
- break;
-
- case Op_K_delete_loop:
- t1 = POP_ARRAY();
- lhs = POP_ADDRESS(); /* item */
- do_delete_loop(t1, lhs);
- break;
-
- case Op_in_array:
- t1 = POP_ARRAY();
- t2 = mk_sub(pc->expr_count);
- di = (in_array(t1, t2) != NULL);
- DEREF(t2);
- PUSH(make_number((AWKNUM) di));
- break;
-
- case Op_arrayfor_init:
- {
- NODE **list = NULL;
- NODE *array, *sort_str;
- size_t num_elems = 0;
- static NODE *sorted_in = NULL;
- const char *how_to_sort = "@unsorted";
-
- /* get the array */
- array = POP_ARRAY();
-
- /* sanity: check if empty */
- if (array->var_array == NULL || array->table_size == 0)
- goto arrayfor;
-
- num_elems = array->table_size;
-
- if (sorted_in == NULL) /* do this once */
- sorted_in = make_string("sorted_in", 9);
-
- sort_str = NULL;
- /*
- * If posix, or if there's no PROCINFO[],
- * there's no ["sorted_in"], so no sorting
- */
- if (! do_posix && PROCINFO_node != NULL)
- sort_str = in_array(PROCINFO_node, sorted_in);
-
- if (sort_str != NULL) {
- sort_str = force_string(sort_str);
- if (sort_str->stlen > 0)
- how_to_sort = sort_str->stptr;
- }
-
- list = assoc_list(array, how_to_sort, SORTED_IN);
-
- /*
- * Actual array for use in lint warning
- * in Op_arrayfor_incr
- */
- list[num_elems] = array;
-
-arrayfor:
- getnode(r);
- r->type = Node_arrayfor;
- r->var_array = list;
- r->table_size = num_elems; /* # of elements in list */
- r->array_size = -1; /* current index */
- PUSH(r);
-
- if (num_elems == 0)
- JUMPTO(pc->target_jmp); /* Op_arrayfor_final */
- }
- break;
-
- case Op_arrayfor_incr:
- r = TOP(); /* Node_arrayfor */
- if (++r->array_size == r->table_size) {
- NODE *array;
- array = r->var_array[r->table_size]; /* actual array */
- if (do_lint && array->table_size != r->table_size)
- lintwarn(_("for loop: array `%s' changed size from %ld to %ld during loop execution"),
- array_vname(array), (long) r->table_size, (long) array->table_size);
- JUMPTO(pc->target_jmp); /* Op_arrayfor_final */
- }
-
- t1 = r->var_array[r->array_size];
- lhs = get_lhs(pc->array_var, FALSE);
- unref(*lhs);
- *lhs = make_string(t1->ahname_str, t1->ahname_len);
- break;
-
- case Op_arrayfor_final:
- r = POP();
- assert(r->type == Node_arrayfor);
- free_arrayfor(r);
- break;
-
- case Op_builtin:
- r = pc->builtin(pc->expr_count);
-#if defined(GAWKDEBUG) || defined(ARRAYDEBUG)
- if (! r)
- last_was_stopme = TRUE;
- else
-#endif
- PUSH(r);
- break;
-
- case Op_sub_builtin: /* sub, gsub and gensub */
- r = do_sub(pc->expr_count, pc->sub_flags);
- PUSH(r);
- break;
-
- case Op_K_print:
- do_print(pc->expr_count, pc->redir_type);
- break;
-
- case Op_K_printf:
- do_printf(pc->expr_count, pc->redir_type);
- break;
-
- case Op_K_print_rec:
- do_print_rec(pc->expr_count, pc->redir_type);
- break;
-
- case Op_push_re:
- m = pc->memory;
- if (m->type == Node_dynregex) {
- r = POP_STRING();
- unref(m->re_exp);
- m->re_exp = r;
- }
- PUSH(m);
- break;
-
- case Op_match_rec:
- m = pc->memory;
- t1 = *get_field(0, (Func_ptr *) 0);
-match_re:
- rp = re_update(m);
- /*
- * Any place where research() is called with a last parameter of
- * zero, we need to use the avoid_dfa test. This appears here and
- * in the code for Op_K_case.
- *
- * A new or improved dfa that distinguishes beginning/end of
- * string from beginning/end of line will allow us to get rid of
- * this hack.
- *
- * The avoid_dfa() function is in re.c; it is not very smart.
- */
-
- di = research(rp, t1->stptr, 0, t1->stlen,
- avoid_dfa(m, t1->stptr, t1->stlen));
- di = (di == -1) ^ (pc->opcode != Op_nomatch);
- if(pc->opcode != Op_match_rec) {
- decr_sp();
- DEREF(t1);
- }
- r = make_number((AWKNUM) di);
- PUSH(r);
- break;
-
- case Op_nomatch:
- /* fall through */
- case Op_match:
- m = pc->memory;
- t1 = TOP_STRING();
- if (m->type == Node_dynregex) {
- unref(m->re_exp);
- m->re_exp = t1;
- decr_sp();
- t1 = TOP_STRING();
- }
- goto match_re;
- break;
-
- case Op_indirect_func_call:
- {
- int arg_count;
-
- f = NULL;
- arg_count = (pc + 1)->expr_count;
- t1 = PEEK(arg_count); /* indirect var */
- assert(t1->type == Node_val); /* @a[1](p) not allowed in grammar */
- (void) force_string(t1);
- if (t1->stlen > 0) {
- /* retrieve function definition node */
- f = pc->func_body;
- if (f != NULL && strcmp(f->vname, t1->stptr) == 0)
- /* indirect var hasn't been reassigned */
- goto func_call;
- f = lookup(t1->stptr);
- }
-
- if (f == NULL || f->type != Node_func)
- fatal(_("function called indirectly through `%s' does not exist"), pc->func_name);
- pc->func_body = f; /* save for next call */
-
- goto func_call;
- }
-
- case Op_func_call:
- /* retrieve function definition node */
- f = pc->func_body;
- if (f == NULL) {
- f = lookup(pc->func_name);
- if (f == NULL || f->type != Node_func)
- fatal(_("function `%s' not defined"), pc->func_name);
- pc->func_body = f; /* save for next call */
- }
-
- /* save current frame along with source */
-
-func_call:
- ni = setup_frame(pc);
-
- if (ni->opcode == Op_ext_func) {
- /* dynamically set source and line numbers for an extension builtin. */
- ni->source_file = source;
- ni->source_line = sourceline;
- ni->nexti->source_line = sourceline; /* Op_builtin */
- ni->nexti->nexti->source_line = sourceline; /* Op_K_return */
- }
-
- /* run the function instructions */
- JUMPTO(ni); /* Op_func or Op_ext_func */
-
- case Op_K_return:
- m = POP_SCALAR(); /* return value */
-
- ni = pop_fcall();
-
- /* put the return value back on stack */
- PUSH(m);
-
- JUMPTO(ni);
-
- case Op_K_getline_redir:
- if ((currule == BEGINFILE || currule == ENDFILE)
- && pc->into_var == FALSE
- && pc->redir_type == redirect_input)
- fatal(_("`getline' invalid inside `%s' rule"), ruletab[currule]);
- r = do_getline_redir(pc->into_var, pc->redir_type);
- PUSH(r);
- break;
-
- case Op_K_getline: /* no redirection */
- if (! currule || currule == BEGINFILE || currule == ENDFILE)
- fatal(_("non-redirected `getline' invalid inside `%s' rule"),
- ruletab[currule]);
-
- do {
- int ret;
- ret = nextfile(& curfile, FALSE);
- if (ret <= 0)
- r = do_getline(pc->into_var, curfile);
- else {
-
- /* Save execution state so that we can return to it
- * from Op_after_beginfile or Op_after_endfile.
- */
-
- push_exec_state(pc, currule, source, stack_ptr);
-
- if (curfile == NULL)
- JUMPTO((pc + 1)->target_endfile);
- else
- JUMPTO((pc + 1)->target_beginfile);
- }
- } while (r == NULL); /* EOF */
-
- PUSH(r);
- break;
-
- case Op_after_endfile:
- /* Find the execution state to return to */
- ni = pop_exec_state(& currule, & source, NULL);
-
- assert(ni->opcode == Op_newfile || ni->opcode == Op_K_getline);
- JUMPTO(ni);
-
- case Op_after_beginfile:
- after_beginfile(& curfile);
-
- /* Find the execution state to return to */
- ni = pop_exec_state(& currule, & source, NULL);
-
- assert(ni->opcode == Op_newfile || ni->opcode == Op_K_getline);
- if (ni->opcode == Op_K_getline
- || curfile == NULL /* skipping directory argument */
- )
- JUMPTO(ni);
-
- break; /* read a record, Op_get_record */
-
- case Op_newfile:
- {
- int ret;
-
- ret = nextfile(& curfile, FALSE);
-
- if (ret < 0) /* end of input */
- JUMPTO(pc->target_jmp); /* end block or Op_atexit */
-
- if (ret == 0) /* read a record */
- JUMPTO((pc + 1)->target_get_record);
-
- /* ret > 0 */
- /* Save execution state for use in Op_after_beginfile or Op_after_endfile. */
-
- push_exec_state(pc, currule, source, stack_ptr);
-
- if (curfile == NULL) /* EOF */
- JUMPTO(pc->target_endfile);
- /* else
- execute beginfile block */
- }
- break;
-
- case Op_get_record:
- {
- int errcode = 0;
-
- ni = pc->target_newfile;
- if (curfile == NULL) {
- /* from non-redirected getline, e.g.:
- * {
- * while (getline > 0) ;
- * }
- */
-
- ni = ni->target_jmp; /* end_block or Op_atexit */
- JUMPTO(ni);
- }
-
- if (inrec(curfile, & errcode) != 0) {
- if (errcode > 0 && (do_traditional || ! pc->has_endfile))
- fatal(_("error reading input file `%s': %s"),
- curfile->name, strerror(errcode));
-
- JUMPTO(ni);
- } /* else
- prog (rule) block */
- }
- break;
-
- case Op_K_nextfile:
- {
- int ret;
-
- if (currule != Rule && currule != BEGINFILE)
- fatal(_("`nextfile' cannot be called from a `%s' rule"),
- ruletab[currule]);
-
- ret = nextfile(& curfile, TRUE); /* skip current file */
-
- if (currule == BEGINFILE) {
- long stack_size;
-
- ni = pop_exec_state(& currule, & source, & stack_size);
-
- assert(ni->opcode == Op_K_getline || ni->opcode == Op_newfile);
-
- /* pop stack returning to the state of Op_K_getline or Op_newfile. */
- unwind_stack(stack_size);
-
- if (ret == 0) {
- /* There was an error opening the file;
- * don't run ENDFILE block(s).
- */
-
- JUMPTO(ni);
- } else {
- /* do run ENDFILE block(s) first. */
-
- /* Execution state to return to in Op_after_endfile. */
- push_exec_state(ni, currule, source, stack_ptr);
-
- JUMPTO(pc->target_endfile);
- }
- } /* else
- Start over with the first rule. */
-
- /* empty the run-time stack to avoid memory leak */
- pop_stack();
-
- /* Push an execution state for Op_after_endfile to return to */
- push_exec_state(pc->target_newfile, currule, source, stack_ptr);
-
- JUMPTO(pc->target_endfile);
- }
- break;
-
- case Op_K_exit:
- /* exit not allowed in user-defined comparison functions for "sorted_in";
- * This is done so that END blocks aren't executed more than once.
- */
- if (! currule)
- fatal(_("`exit' cannot be called in the current context"));
-
- exiting = TRUE;
- POP_NUMBER(x1);
- exit_val = (int) x1;
-#ifdef VMS
- if (exit_val == 0)
- exit_val = EXIT_SUCCESS;
- else if (exit_val == 1)
- exit_val = EXIT_FAILURE;
- /* else
- just pass anything else on through */
-#endif
-
- if (currule == BEGINFILE || currule == ENDFILE) {
-
- /* Find the rule of the saved execution state (Op_K_getline/Op_newfile).
- * This is needed to prevent multiple execution of any END rules:
- * gawk 'BEGINFILE { exit(1) } \
- * END { while (getline > 0); }' in1 in2
- */
-
- (void) pop_exec_state(& currule, & source, NULL);
- }
-
- pop_stack(); /* empty stack, don't leak memory */
-
- /* Jump to either the first END block instruction
- * or to Op_atexit.
- */
-
- if (currule == END)
- ni = pc->target_atexit;
- else
- ni = pc->target_end;
- JUMPTO(ni);
-
- case Op_K_next:
- if (currule != Rule)
- fatal(_("`next' cannot be called from a `%s' rule"), ruletab[currule]);
-
- pop_stack();
- JUMPTO(pc->target_jmp); /* Op_get_record, read next record */
-
- case Op_pop:
-#if defined(GAWKDEBUG) || defined(ARRAYDEBUG)
- if (last_was_stopme)
- last_was_stopme = FALSE;
- else
-#endif
- {
- r = POP_SCALAR();
- DEREF(r);
- }
- break;
-
- case Op_line_range:
- if (pc->triggered) /* evaluate right expression */
- JUMPTO(pc->target_jmp);
- /* else
- evaluate left expression */
- break;
+ if (posth)
+ post_execute = posth;
- case Op_cond_pair:
- {
- int result;
- INSTRUCTION *ip;
+ return true;
+}
- t1 = TOP_SCALAR(); /* from right hand side expression */
- di = (eval_condition(t1) != 0);
- DEREF(t1);
- ip = pc->line_range; /* Op_line_range */
+/* interpreter routine when not debugging */
+#include "interpret.h"
- if (! ip->triggered && di) {
- /* not already triggered and left expression is TRUE */
- decr_sp();
- ip->triggered = TRUE;
- JUMPTO(ip->target_jmp); /* evaluate right expression */
- }
+/* interpreter routine with exec hook(s). Used when debugging and/or with MPFR. */
+#define r_interpret h_interpret
+#define EXEC_HOOK 1
+#include "interpret.h"
+#undef EXEC_HOOK
+#undef r_interpret
- result = ip->triggered || di;
- ip->triggered ^= di; /* update triggered flag */
- r = make_number((AWKNUM) result); /* final value of condition pair */
- REPLACE(r);
- JUMPTO(pc->target_jmp);
- }
- case Op_exec_count:
- INCREMENT(pc->exec_count);
- break;
+void
+init_interpret()
+{
+ long newval;
- case Op_no_op:
- case Op_K_do:
- case Op_K_while:
- case Op_K_for:
- case Op_K_arrayfor:
- case Op_K_switch:
- case Op_K_default:
- case Op_K_if:
- case Op_K_else:
- case Op_cond_exp:
- break;
+ if ((newval = getenv_long("GAWK_STACKSIZE")) > 0)
+ STACK_SIZE = newval;
- default:
- fatal(_("Sorry, don't know how to interpret `%s'"), opcode2str(pc->opcode));
- }
+ emalloc(stack_bottom, STACK_ITEM *, STACK_SIZE * sizeof(STACK_ITEM), "grow_stack");
+ stack_ptr = stack_bottom - 1;
+ stack_top = stack_bottom + STACK_SIZE - 1;
- JUMPTO(pc->nexti);
+ /* initialize frame pointer */
+ getnode(frame_ptr);
+ frame_ptr->type = Node_frame;
+ frame_ptr->stack = NULL;
+ frame_ptr->func_node = NULL; /* in main */
+ frame_ptr->num_tail_calls = 0;
+ frame_ptr->vname = NULL;
-/* } forever */
+ /* initialize true and false nodes */
+ node_Boolean[false] = make_number(0.0);
+ node_Boolean[true] = make_number(1.0);
+ if (! is_mpg_number(node_Boolean[false])) {
+ node_Boolean[false]->flags |= NUMINT;
+ node_Boolean[true]->flags |= NUMINT;
+ }
- /* not reached */
- return 0;
+ /*
+ * Select the interpreter routine. The version without
+ * any exec hook support (r_interpret) is faster by about
+ * 5%, or more depending on the opcodes.
+ */
-#undef mk_sub
-#undef JUMPTO
+ if (num_exec_hook > 0)
+ interpret = h_interpret;
+ else
+ interpret = r_interpret;
}
+
diff --git a/eval_d.c b/eval_d.c
deleted file mode 100644
index 64a8e55a..00000000
--- a/eval_d.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * eval_p.c - compile eval.c with debugging turned on.
- */
-
-/*
- * Copyright (C) 2001 the Free Software Foundation, Inc.
- *
- * This file is part of GAWK, the GNU implementation of the
- * AWK Programming Language.
- *
- * GAWK is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GAWK is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- */
-
-#define DEBUGGING 1
-#include "eval.c"
diff --git a/ext.c b/ext.c
index f3e783da..5fc16afe 100644
--- a/ext.c
+++ b/ext.c
@@ -33,229 +33,153 @@
#include <dlfcn.h>
-/* do_ext --- load an extension */
+#define INIT_FUNC "dl_load"
-NODE *
-do_ext(int nargs)
+/* load_ext --- load an external library */
+
+void
+load_ext(const char *lib_name)
{
- NODE *obj;
- NODE *fun;
- NODE *tmp = NULL;
- NODE *(*func)(NODE *, void *);
+ int (*install_func)(const gawk_api_t *const, awk_ext_id_t);
void *dl;
int flags = RTLD_LAZY;
- int fatal_error = FALSE;
int *gpl_compat;
-#if 0
- static short warned = FALSE;
-#endif
if (do_sandbox)
fatal(_("extensions are not allowed in sandbox mode"));
-#if 0
- /* already done in parser */
- if (do_lint && ! warned) {
- warned = TRUE;
- lintwarn(_("`extension' is a gawk extension"));
- }
-#endif
-
if (do_traditional || do_posix)
- error(_("`extension' is a gawk extension"));
+ fatal(_("-l / @load are gawk extensions"));
- fun = POP_STRING();
- obj = POP_STRING();
+ if (lib_name == NULL)
+ fatal(_("load_ext: received NULL lib_name"));
-#ifdef RTLD_GLOBAL
- flags |= RTLD_GLOBAL;
-#endif
- if ((dl = dlopen(obj->stptr, flags)) == NULL) {
- /* fatal needs `obj', and we need to deallocate it! */
- msg(_("fatal: extension: cannot open `%s' (%s)\n"), obj->stptr,
+ if ((dl = dlopen(lib_name, flags)) == NULL)
+ fatal(_("load_ext: cannot open library `%s' (%s)\n"), lib_name,
dlerror());
- fatal_error = TRUE;
- goto done;
- }
/* Per the GNU Coding standards */
gpl_compat = (int *) dlsym(dl, "plugin_is_GPL_compatible");
- if (gpl_compat == NULL) {
- msg(_("fatal: extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n"),
- obj->stptr, dlerror());
- fatal_error = TRUE;
- goto done;
- }
-
-
- func = (NODE *(*)(NODE *, void *)) dlsym(dl, fun->stptr);
- if (func == NULL) {
- msg(_("fatal: extension: library `%s': cannot call function `%s' (%s)\n"),
- obj->stptr, fun->stptr, dlerror());
- fatal_error = TRUE;
- goto done;
- }
-
- tmp = (*func)(obj, dl);
- if (tmp == NULL)
- tmp = Nnull_string;
-done:
- DEREF(obj);
- DEREF(fun);
- if (fatal_error)
- gawk_exit(EXIT_FATAL);
- return tmp;
+ if (gpl_compat == NULL)
+ fatal(_("load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n"),
+ lib_name, dlerror());
+
+ install_func = (int (*)(const gawk_api_t *const, awk_ext_id_t))
+ dlsym(dl, INIT_FUNC);
+ if (install_func == NULL)
+ fatal(_("load_ext: library `%s': cannot call function `%s' (%s)\n"),
+ lib_name, INIT_FUNC, dlerror());
+
+ if (install_func(& api_impl, NULL /* ext_id */) == 0)
+ warning(_("load_ext: library `%s' initialization routine `%s' failed\n"),
+ lib_name, INIT_FUNC);
}
/* make_builtin --- register name to be called as func with a builtin body */
-void
-make_builtin(const char *name, NODE *(*func)(int), int count)
+awk_bool_t
+make_builtin(const awk_ext_func_t *funcinfo)
{
- NODE *p, *symbol, *f;
- INSTRUCTION *b, *r;
+ NODE *symbol, *f;
+ INSTRUCTION *b;
const char *sp;
- char *pname;
- char **vnames = NULL;
- char c, buf[200];
- size_t space_needed;
- int i;
+ char c;
+ const char *name = funcinfo->name;
+ int count = funcinfo->num_expected_args;
sp = name;
if (sp == NULL || *sp == '\0')
- fatal(_("extension: missing function name"));
+ fatal(_("make_builtin: missing function name"));
while ((c = *sp++) != '\0') {
if ((sp == &name[1] && c != '_' && ! isalpha((unsigned char) c))
|| (sp > &name[1] && ! is_identchar((unsigned char) c)))
- fatal(_("extension: illegal character `%c' in function name `%s'"), c, name);
+ fatal(_("make_builtin: illegal character `%c' in function name `%s'"), c, name);
}
f = lookup(name);
if (f != NULL) {
if (f->type == Node_func) {
- INSTRUCTION *pc = f->code_ptr;
- if (pc->opcode != Op_ext_func) /* user-defined function */
- fatal(_("extension: can't redefine function `%s'"), name);
- else {
- /* multiple extension() calls etc. */
- if (do_lint)
- lintwarn(_("extension: function `%s' already defined"), name);
- return;
- }
+ /* user-defined function */
+ fatal(_("make_builtin: can't redefine function `%s'"), name);
+ } else if (f->type == Node_ext_func) {
+ /* multiple extension() calls etc. */
+ if (do_lint)
+ lintwarn(_("make_builtin: function `%s' already defined"), name);
+ return false;
} else
/* variable name etc. */
- fatal(_("extension: function name `%s' previously defined"), name);
+ fatal(_("make_builtin: function name `%s' previously defined"), name);
} else if (check_special(name) >= 0)
- fatal(_("extension: can't use gawk built-in `%s' as function name"), name);
- /* count parameters, create artificial list of param names */
+ fatal(_("make_builtin: can't use gawk built-in `%s' as function name"), name);
if (count < 0)
fatal(_("make_builtin: negative argument count for function `%s'"),
- name);
-
- if (count > 0) {
- sprintf(buf, "p%d", count);
- space_needed = strlen(buf) + 1;
- emalloc(vnames, char **, count * sizeof(char *), "make_builtin");
- for (i = 0; i < count; i++) {
- emalloc(pname, char *, space_needed, "make_builtin");
- sprintf(pname, "p%d", i);
- vnames[i] = pname;
- }
- }
-
+ name);
- getnode(p);
- p->type = Node_param_list;
- p->flags |= FUNC;
- /* get our own copy for name */
- p->param = estrdup(name, strlen(name));
- p->param_cnt = count;
-
- /* actual source and line numbers set at runtime for these instructions */
- b = bcalloc(Op_builtin, 1, __LINE__);
- b->builtin = func;
+ b = bcalloc(Op_symbol, 1, 0);
+ b->extfunc = funcinfo->function;
b->expr_count = count;
- b->nexti = bcalloc(Op_K_return, 1, __LINE__);
- r = bcalloc(Op_ext_func, 1, __LINE__);
- r->source_file = __FILE__;
- r->nexti = b;
/* NB: extension sub must return something */
- symbol = mk_symbol(Node_func, p);
- symbol->parmlist = vnames;
- symbol->code_ptr = r;
- r->func_body = symbol;
- (void) install_symbol(p->param, symbol);
+ symbol = install_symbol(estrdup(name, strlen(name)), Node_ext_func);
+ symbol->code_ptr = b;
+ track_ext_func(name);
+ return true;
}
-/* get_curfunc_arg_count --- return number actual parameters */
-
-size_t
-get_curfunc_arg_count()
-{
- size_t argc;
- INSTRUCTION *pc;
-
- pc = (INSTRUCTION *) frame_ptr->reti; /* Op_func_call instruction */
- argc = (pc + 1)->expr_count; /* # of arguments supplied */
- return argc;
-}
-
-
-/* get_argument --- get the n'th argument of a dynamically linked function */
+/* get_argument --- get the i'th argument of a dynamically linked function */
NODE *
get_argument(int i)
{
- int pcount;
- NODE *t, *f;
- int actual_args;
+ NODE *t;
+ int arg_count, pcount;
INSTRUCTION *pc;
- f = frame_ptr->func_node;
- pcount = f->lnode->param_cnt;
+ pc = TOP()->code_ptr; /* Op_ext_builtin instruction */
+ pcount = (pc + 1)->expr_count; /* max # of arguments */
+ arg_count = pc->expr_count; /* # of arguments supplied */
- pc = (INSTRUCTION *) frame_ptr->reti; /* Op_func_call instruction */
- actual_args = (pc + 1)->expr_count; /* # of arguments supplied */
-
- if (i < 0 || i >= pcount || i >= actual_args)
+ if (i < 0 || i >= pcount || i >= arg_count)
return NULL;
- t = GET_PARAM(i);
+ t = PEEK(arg_count - i);
+ if (t->type == Node_param_list)
+ t = GET_PARAM(t->param_cnt);
if (t->type == Node_array_ref)
- return t->orig_array; /* Node_var_new or Node_var_array */
- if (t->type == Node_var_new || t->type == Node_var_array)
- return t;
- return t->var_value;
+ t = t->orig_array;
+ if (t->type == Node_var) /* See Case Node_var in setup_frame(), eval.c */
+ return Nnull_string;
+ /* Node_var_new, Node_var_array or Node_val */
+ return t;
}
-/* get_actual_argument --- get a scalar or array, allowed to be optional */
+/* get_actual_argument --- get the i'th scalar or array argument of a
+ dynamically linked function, allowed to be optional.
+*/
NODE *
-get_actual_argument(int i, int optional, int want_array)
+get_actual_argument(int i, bool optional, bool want_array)
{
- /* optional : if TRUE and i th argument not present return NULL, else fatal. */
-
- NODE *t, *f;
- int pcount;
+ NODE *t;
char *fname;
-
+ int pcount;
+ INSTRUCTION *pc;
+
+ pc = TOP()->code_ptr; /* Op_ext_builtin instruction */
+ fname = (pc + 1)->func_name;
+ pcount = (pc + 1)->expr_count;
+
t = get_argument(i);
-
- f = frame_ptr->func_node;
- pcount = f->lnode->param_cnt;
- fname = f->lnode->param;
-
if (t == NULL) {
- if (i >= pcount) /* must be fatal */
+ if (i >= pcount) /* must be fatal */
fatal(_("function `%s' defined to take no more than %d argument(s)"),
fname, pcount);
if (! optional)
@@ -266,11 +190,11 @@ get_actual_argument(int i, int optional, int want_array)
if (t->type == Node_var_new) {
if (want_array)
- return get_array(t, FALSE);
+ return get_array(t, false);
else {
t->type = Node_var;
- t->var_value = Nnull_string;
- return Nnull_string;
+ t->var_value = dupnode(Nnull_string);
+ return t->var_value;
}
}
@@ -283,20 +207,17 @@ get_actual_argument(int i, int optional, int want_array)
fatal(_("function `%s': argument #%d: attempt to use array as a scalar"),
fname, i + 1);
}
+ assert(t->type == Node_var_array || t->type == Node_val);
return t;
}
#else
-/* do_ext --- dummy version if extensions not available */
+/* load_ext --- dummy version if extensions not available */
-NODE *
-do_ext(int nargs)
+void
+load_ext(const char *lib_name)
{
- const char *emsg = _("Operation Not Supported");
-
- unref(ERRNO_node->var_value);
- ERRNO_node->var_value = make_string(emsg, strlen(emsg));
- return make_number((AWKNUM) -1);
+ fatal(_("dynamic loading of library not supported"));
}
#endif
diff --git a/extension/.gitignore b/extension/.gitignore
new file mode 100644
index 00000000..ee95901f
--- /dev/null
+++ b/extension/.gitignore
@@ -0,0 +1,3 @@
+# ignore files created by libtool
+*.l[oa]
+.libs
diff --git a/extension/ABOUT-NLS b/extension/ABOUT-NLS
new file mode 100644
index 00000000..b1de1b68
--- /dev/null
+++ b/extension/ABOUT-NLS
@@ -0,0 +1,1282 @@
+1 Notes on the Free Translation Project
+***************************************
+
+Free software is going international! The Free Translation Project is
+a way to get maintainers of free software, translators, and users all
+together, so that free software will gradually become able to speak many
+languages. A few packages already provide translations for their
+messages.
+
+ If you found this `ABOUT-NLS' file inside a distribution, you may
+assume that the distributed package does use GNU `gettext' internally,
+itself available at your nearest GNU archive site. But you do _not_
+need to install GNU `gettext' prior to configuring, installing or using
+this package with messages translated.
+
+ Installers will find here some useful hints. These notes also
+explain how users should proceed for getting the programs to use the
+available translations. They tell how people wanting to contribute and
+work on translations can contact the appropriate team.
+
+1.1 INSTALL Matters
+===================
+
+Some packages are "localizable" when properly installed; the programs
+they contain can be made to speak your own native language. Most such
+packages use GNU `gettext'. Other packages have their own ways to
+internationalization, predating GNU `gettext'.
+
+ By default, this package will be installed to allow translation of
+messages. It will automatically detect whether the system already
+provides the GNU `gettext' functions. Installers may use special
+options at configuration time for changing the default behaviour. The
+command:
+
+ ./configure --disable-nls
+
+will _totally_ disable translation of messages.
+
+ When you already have GNU `gettext' installed on your system and run
+configure without an option for your new package, `configure' will
+probably detect the previously built and installed `libintl' library
+and will decide to use it. If not, you may have to to use the
+`--with-libintl-prefix' option to tell `configure' where to look for it.
+
+ Internationalized packages usually have many `po/LL.po' files, where
+LL gives an ISO 639 two-letter code identifying the language. Unless
+translations have been forbidden at `configure' time by using the
+`--disable-nls' switch, all available translations are installed
+together with the package. However, the environment variable `LINGUAS'
+may be set, prior to configuration, to limit the installed set.
+`LINGUAS' should then contain a space separated list of two-letter
+codes, stating which languages are allowed.
+
+1.2 Using This Package
+======================
+
+As a user, if your language has been installed for this package, you
+only have to set the `LANG' environment variable to the appropriate
+`LL_CC' combination. If you happen to have the `LC_ALL' or some other
+`LC_xxx' environment variables set, you should unset them before
+setting `LANG', otherwise the setting of `LANG' will not have the
+desired effect. Here `LL' is an ISO 639 two-letter language code, and
+`CC' is an ISO 3166 two-letter country code. For example, let's
+suppose that you speak German and live in Germany. At the shell
+prompt, merely execute `setenv LANG de_DE' (in `csh'),
+`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
+This can be done from your `.login' or `.profile' file, once and for
+all.
+
+ You might think that the country code specification is redundant.
+But in fact, some languages have dialects in different countries. For
+example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The
+country code serves to distinguish the dialects.
+
+ The locale naming convention of `LL_CC', with `LL' denoting the
+language and `CC' denoting the country, is the one use on systems based
+on GNU libc. On other systems, some variations of this scheme are
+used, such as `LL' or `LL_CC.ENCODING'. You can get the list of
+locales supported by your system for your language by running the
+command `locale -a | grep '^LL''.
+
+ Not all programs have translations for all languages. By default, an
+English message is shown in place of a nonexistent translation. If you
+understand other languages, you can set up a priority list of languages.
+This is done through a different environment variable, called
+`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG'
+for the purpose of message handling, but you still need to have `LANG'
+set to the primary language; this is required by other parts of the
+system libraries. For example, some Swedish users who would rather
+read translations in German than English for when Swedish is not
+available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
+
+ Special advice for Norwegian users: The language code for Norwegian
+bokma*l changed from `no' to `nb' recently (in 2003). During the
+transition period, while some message catalogs for this language are
+installed under `nb' and some older ones under `no', it's recommended
+for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and
+older translations are used.
+
+ In the `LANGUAGE' environment variable, but not in the `LANG'
+environment variable, `LL_CC' combinations can be abbreviated as `LL'
+to denote the language's main dialect. For example, `de' is equivalent
+to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
+(Portuguese as spoken in Portugal) in this context.
+
+1.3 Translating Teams
+=====================
+
+For the Free Translation Project to be a success, we need interested
+people who like their own language and write it well, and who are also
+able to synergize with other translators speaking the same language.
+Each translation team has its own mailing list. The up-to-date list of
+teams can be found at the Free Translation Project's homepage,
+`http://translationproject.org/', in the "Teams" area.
+
+ If you'd like to volunteer to _work_ at translating messages, you
+should become a member of the translating team for your own language.
+The subscribing address is _not_ the same as the list itself, it has
+`-request' appended. For example, speakers of Swedish can send a
+message to `sv-request@li.org', having this message body:
+
+ subscribe
+
+ Keep in mind that team members are expected to participate
+_actively_ in translations, or at solving translational difficulties,
+rather than merely lurking around. If your team does not exist yet and
+you want to start one, or if you are unsure about what to do or how to
+get started, please write to `coordinator@translationproject.org' to
+reach the coordinator for all translator teams.
+
+ The English team is special. It works at improving and uniformizing
+the terminology in use. Proven linguistic skills are praised more than
+programming skills, here.
+
+1.4 Available Packages
+======================
+
+Languages are not equally supported in all packages. The following
+matrix shows the current state of internationalization, as of June
+2010. The matrix shows, in regard of each package, for which languages
+PO files have been submitted to translation coordination, with a
+translation percentage of at least 50%.
+
+ Ready PO files af am an ar as ast az be be@latin bg bn_IN bs ca
+ +--------------------------------------------------+
+ a2ps | [] [] |
+ aegis | |
+ ant-phone | |
+ anubis | |
+ aspell | [] [] |
+ bash | |
+ bfd | |
+ bibshelf | [] |
+ binutils | |
+ bison | |
+ bison-runtime | [] |
+ bluez-pin | [] [] |
+ bombono-dvd | |
+ buzztard | |
+ cflow | |
+ clisp | |
+ coreutils | [] [] |
+ cpio | |
+ cppi | |
+ cpplib | [] |
+ cryptsetup | |
+ dfarc | |
+ dialog | [] [] |
+ dico | |
+ diffutils | [] |
+ dink | |
+ doodle | |
+ e2fsprogs | [] |
+ enscript | [] |
+ exif | |
+ fetchmail | [] |
+ findutils | [] |
+ flex | [] |
+ freedink | |
+ gas | |
+ gawk | [] [] |
+ gcal | [] |
+ gcc | |
+ gettext-examples | [] [] [] [] |
+ gettext-runtime | [] [] |
+ gettext-tools | [] [] |
+ gip | [] |
+ gjay | |
+ gliv | [] |
+ glunarclock | [] [] |
+ gnubiff | |
+ gnucash | [] |
+ gnuedu | |
+ gnulib | |
+ gnunet | |
+ gnunet-gtk | |
+ gnutls | |
+ gold | |
+ gpe-aerial | |
+ gpe-beam | |
+ gpe-bluetooth | |
+ gpe-calendar | |
+ gpe-clock | [] |
+ gpe-conf | |
+ gpe-contacts | |
+ gpe-edit | |
+ gpe-filemanager | |
+ gpe-go | |
+ gpe-login | |
+ gpe-ownerinfo | [] |
+ gpe-package | |
+ gpe-sketchbook | |
+ gpe-su | [] |
+ gpe-taskmanager | [] |
+ gpe-timesheet | [] |
+ gpe-today | [] |
+ gpe-todo | |
+ gphoto2 | |
+ gprof | [] |
+ gpsdrive | |
+ gramadoir | |
+ grep | |
+ grub | [] [] |
+ gsasl | |
+ gss | |
+ gst-plugins-bad | [] |
+ gst-plugins-base | [] |
+ gst-plugins-good | [] |
+ gst-plugins-ugly | [] |
+ gstreamer | [] [] [] |
+ gtick | |
+ gtkam | [] |
+ gtkorphan | [] |
+ gtkspell | [] [] [] |
+ gutenprint | |
+ hello | [] |
+ help2man | |
+ hylafax | |
+ idutils | |
+ indent | [] [] |
+ iso_15924 | |
+ iso_3166 | [] [] [] [] [] [] [] |
+ iso_3166_2 | |
+ iso_4217 | |
+ iso_639 | [] [] [] [] |
+ iso_639_3 | |
+ jwhois | |
+ kbd | |
+ keytouch | [] |
+ keytouch-editor | |
+ keytouch-keyboa... | [] |
+ klavaro | [] |
+ latrine | |
+ ld | [] |
+ leafpad | [] [] |
+ libc | [] [] |
+ libexif | () |
+ libextractor | |
+ libgnutls | |
+ libgpewidget | |
+ libgpg-error | |
+ libgphoto2 | |
+ libgphoto2_port | |
+ libgsasl | |
+ libiconv | [] |
+ libidn | |
+ lifelines | |
+ liferea | [] [] |
+ lilypond | |
+ linkdr | [] |
+ lordsawar | |
+ lprng | |
+ lynx | [] |
+ m4 | |
+ mailfromd | |
+ mailutils | |
+ make | |
+ man-db | |
+ man-db-manpages | |
+ minicom | |
+ mkisofs | |
+ myserver | |
+ nano | [] [] |
+ opcodes | |
+ parted | |
+ pies | |
+ popt | |
+ psmisc | |
+ pspp | [] |
+ pwdutils | |
+ radius | [] |
+ recode | [] [] |
+ rosegarden | |
+ rpm | |
+ rush | |
+ sarg | |
+ screem | |
+ scrollkeeper | [] [] [] |
+ sed | [] [] |
+ sharutils | [] [] |
+ shishi | |
+ skencil | |
+ solfege | |
+ solfege-manual | |
+ soundtracker | |
+ sp | |
+ sysstat | |
+ tar | [] |
+ texinfo | |
+ tin | |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux-ng | [] |
+ vice | |
+ vmm | |
+ vorbis-tools | |
+ wastesedge | |
+ wdiff | |
+ wget | [] [] |
+ wyslij-po | |
+ xchat | [] [] [] [] |
+ xdg-user-dirs | [] [] [] [] [] [] [] [] [] |
+ xkeyboard-config | [] [] |
+ +--------------------------------------------------+
+ af am an ar as ast az be be@latin bg bn_IN bs ca
+ 6 0 1 2 3 19 1 10 3 28 3 1 38
+
+ crh cs da de el en en_GB en_ZA eo es et eu fa
+ +-------------------------------------------------+
+ a2ps | [] [] [] [] [] [] [] |
+ aegis | [] [] [] |
+ ant-phone | [] () |
+ anubis | [] [] |
+ aspell | [] [] [] [] [] |
+ bash | [] [] [] |
+ bfd | [] |
+ bibshelf | [] [] [] |
+ binutils | [] |
+ bison | [] [] |
+ bison-runtime | [] [] [] [] |
+ bluez-pin | [] [] [] [] [] [] |
+ bombono-dvd | [] |
+ buzztard | [] [] [] |
+ cflow | [] [] |
+ clisp | [] [] [] [] |
+ coreutils | [] [] [] [] |
+ cpio | |
+ cppi | |
+ cpplib | [] [] [] |
+ cryptsetup | [] |
+ dfarc | [] [] [] |
+ dialog | [] [] [] [] [] |
+ dico | |
+ diffutils | [] [] [] [] [] [] |
+ dink | [] [] [] |
+ doodle | [] |
+ e2fsprogs | [] [] [] |
+ enscript | [] [] [] |
+ exif | () [] [] |
+ fetchmail | [] [] () [] [] [] |
+ findutils | [] [] [] |
+ flex | [] [] |
+ freedink | [] [] [] |
+ gas | [] |
+ gawk | [] [] [] |
+ gcal | [] |
+ gcc | [] [] |
+ gettext-examples | [] [] [] [] |
+ gettext-runtime | [] [] [] [] |
+ gettext-tools | [] [] [] |
+ gip | [] [] [] [] |
+ gjay | [] |
+ gliv | [] [] [] |
+ glunarclock | [] [] |
+ gnubiff | () |
+ gnucash | [] () () () () |
+ gnuedu | [] [] |
+ gnulib | [] [] |
+ gnunet | |
+ gnunet-gtk | [] |
+ gnutls | [] [] |
+ gold | [] |
+ gpe-aerial | [] [] [] [] |
+ gpe-beam | [] [] [] [] |
+ gpe-bluetooth | [] [] |
+ gpe-calendar | [] |
+ gpe-clock | [] [] [] [] |
+ gpe-conf | [] [] [] |
+ gpe-contacts | [] [] [] |
+ gpe-edit | [] [] |
+ gpe-filemanager | [] [] [] |
+ gpe-go | [] [] [] [] |
+ gpe-login | [] [] |
+ gpe-ownerinfo | [] [] [] [] |
+ gpe-package | [] [] [] |
+ gpe-sketchbook | [] [] [] [] |
+ gpe-su | [] [] [] [] |
+ gpe-taskmanager | [] [] [] [] |
+ gpe-timesheet | [] [] [] [] |
+ gpe-today | [] [] [] [] |
+ gpe-todo | [] [] [] |
+ gphoto2 | [] [] () [] [] [] |
+ gprof | [] [] [] |
+ gpsdrive | [] [] [] |
+ gramadoir | [] [] [] |
+ grep | [] |
+ grub | [] [] |
+ gsasl | [] |
+ gss | |
+ gst-plugins-bad | [] [] [] [] [] |
+ gst-plugins-base | [] [] [] [] [] |
+ gst-plugins-good | [] [] [] [] [] [] |
+ gst-plugins-ugly | [] [] [] [] [] [] |
+ gstreamer | [] [] [] [] [] |
+ gtick | [] () [] |
+ gtkam | [] [] () [] [] |
+ gtkorphan | [] [] [] [] |
+ gtkspell | [] [] [] [] [] [] [] |
+ gutenprint | [] [] [] |
+ hello | [] [] [] [] |
+ help2man | [] |
+ hylafax | [] [] |
+ idutils | [] [] |
+ indent | [] [] [] [] [] [] [] |
+ iso_15924 | [] () [] [] |
+ iso_3166 | [] [] [] [] () [] [] [] () |
+ iso_3166_2 | () |
+ iso_4217 | [] [] [] () [] [] |
+ iso_639 | [] [] [] [] () [] [] |
+ iso_639_3 | [] |
+ jwhois | [] |
+ kbd | [] [] [] [] [] |
+ keytouch | [] [] |
+ keytouch-editor | [] [] |
+ keytouch-keyboa... | [] |
+ klavaro | [] [] [] [] |
+ latrine | [] () |
+ ld | [] [] |
+ leafpad | [] [] [] [] [] [] |
+ libc | [] [] [] [] |
+ libexif | [] [] () |
+ libextractor | |
+ libgnutls | [] |
+ libgpewidget | [] [] |
+ libgpg-error | [] [] |
+ libgphoto2 | [] () |
+ libgphoto2_port | [] () [] |
+ libgsasl | |
+ libiconv | [] [] [] [] [] |
+ libidn | [] [] [] |
+ lifelines | [] () |
+ liferea | [] [] [] [] [] |
+ lilypond | [] [] [] |
+ linkdr | [] [] [] |
+ lordsawar | [] |
+ lprng | |
+ lynx | [] [] [] [] |
+ m4 | [] [] [] [] |
+ mailfromd | |
+ mailutils | [] |
+ make | [] [] [] |
+ man-db | |
+ man-db-manpages | |
+ minicom | [] [] [] [] |
+ mkisofs | |
+ myserver | |
+ nano | [] [] [] |
+ opcodes | [] [] |
+ parted | [] [] |
+ pies | |
+ popt | [] [] [] [] [] |
+ psmisc | [] [] [] |
+ pspp | [] |
+ pwdutils | [] |
+ radius | [] |
+ recode | [] [] [] [] [] [] |
+ rosegarden | () () () |
+ rpm | [] [] [] |
+ rush | |
+ sarg | |
+ screem | |
+ scrollkeeper | [] [] [] [] [] |
+ sed | [] [] [] [] [] [] |
+ sharutils | [] [] [] [] |
+ shishi | |
+ skencil | [] () [] |
+ solfege | [] [] [] |
+ solfege-manual | [] [] |
+ soundtracker | [] [] [] |
+ sp | [] |
+ sysstat | [] [] [] |
+ tar | [] [] [] [] |
+ texinfo | [] [] [] |
+ tin | [] [] |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux-ng | [] [] [] [] |
+ vice | () () |
+ vmm | [] |
+ vorbis-tools | [] [] |
+ wastesedge | [] |
+ wdiff | [] [] |
+ wget | [] [] [] |
+ wyslij-po | |
+ xchat | [] [] [] [] [] |
+ xdg-user-dirs | [] [] [] [] [] [] [] [] [] |
+ xkeyboard-config | [] [] [] [] [] [] |
+ +-------------------------------------------------+
+ crh cs da de el en en_GB en_ZA eo es et eu fa
+ 5 64 105 117 18 1 8 0 28 89 18 19 0
+
+ fi fr ga gl gu he hi hr hu hy id is it ja ka kn
+ +----------------------------------------------------+
+ a2ps | [] [] [] [] |
+ aegis | [] [] |
+ ant-phone | [] [] |
+ anubis | [] [] [] [] |
+ aspell | [] [] [] [] |
+ bash | [] [] [] [] |
+ bfd | [] [] [] |
+ bibshelf | [] [] [] [] [] |
+ binutils | [] [] [] |
+ bison | [] [] [] [] |
+ bison-runtime | [] [] [] [] [] [] |
+ bluez-pin | [] [] [] [] [] [] [] [] |
+ bombono-dvd | [] |
+ buzztard | [] |
+ cflow | [] [] [] |
+ clisp | [] |
+ coreutils | [] [] [] [] [] |
+ cpio | [] [] [] [] |
+ cppi | [] [] |
+ cpplib | [] [] [] |
+ cryptsetup | [] [] [] |
+ dfarc | [] [] [] |
+ dialog | [] [] [] [] [] [] [] |
+ dico | |
+ diffutils | [] [] [] [] [] [] [] [] [] |
+ dink | [] |
+ doodle | [] [] |
+ e2fsprogs | [] [] |
+ enscript | [] [] [] [] |
+ exif | [] [] [] [] [] [] |
+ fetchmail | [] [] [] [] |
+ findutils | [] [] [] [] [] [] |
+ flex | [] [] [] |
+ freedink | [] [] [] |
+ gas | [] [] |
+ gawk | [] [] [] [] () [] |
+ gcal | [] |
+ gcc | [] |
+ gettext-examples | [] [] [] [] [] [] [] |
+ gettext-runtime | [] [] [] [] [] [] |
+ gettext-tools | [] [] [] [] |
+ gip | [] [] [] [] [] [] |
+ gjay | [] |
+ gliv | [] () |
+ glunarclock | [] [] [] [] |
+ gnubiff | () [] () |
+ gnucash | () () () () () [] |
+ gnuedu | [] [] |
+ gnulib | [] [] [] [] [] [] |
+ gnunet | |
+ gnunet-gtk | [] |
+ gnutls | [] [] |
+ gold | [] [] |
+ gpe-aerial | [] [] [] |
+ gpe-beam | [] [] [] [] |
+ gpe-bluetooth | [] [] [] [] |
+ gpe-calendar | [] [] |
+ gpe-clock | [] [] [] [] [] |
+ gpe-conf | [] [] [] [] |
+ gpe-contacts | [] [] [] [] |
+ gpe-edit | [] [] [] |
+ gpe-filemanager | [] [] [] [] |
+ gpe-go | [] [] [] [] [] |
+ gpe-login | [] [] [] |
+ gpe-ownerinfo | [] [] [] [] [] |
+ gpe-package | [] [] [] |
+ gpe-sketchbook | [] [] [] [] |
+ gpe-su | [] [] [] [] [] [] |
+ gpe-taskmanager | [] [] [] [] [] |
+ gpe-timesheet | [] [] [] [] [] |
+ gpe-today | [] [] [] [] [] [] [] |
+ gpe-todo | [] [] [] |
+ gphoto2 | [] [] [] [] [] [] |
+ gprof | [] [] [] [] |
+ gpsdrive | [] [] [] |
+ gramadoir | [] [] [] |
+ grep | [] [] |
+ grub | [] [] [] [] |
+ gsasl | [] [] [] [] [] |
+ gss | [] [] [] [] [] |
+ gst-plugins-bad | [] [] [] [] [] [] |
+ gst-plugins-base | [] [] [] [] [] [] |
+ gst-plugins-good | [] [] [] [] [] [] |
+ gst-plugins-ugly | [] [] [] [] [] [] |
+ gstreamer | [] [] [] [] [] |
+ gtick | [] [] [] [] [] |
+ gtkam | [] [] [] [] [] |
+ gtkorphan | [] [] [] |
+ gtkspell | [] [] [] [] [] [] [] [] [] |
+ gutenprint | [] [] [] [] |
+ hello | [] [] [] |
+ help2man | [] [] |
+ hylafax | [] |
+ idutils | [] [] [] [] [] [] |
+ indent | [] [] [] [] [] [] [] [] |
+ iso_15924 | [] () [] [] |
+ iso_3166 | [] () [] [] [] [] [] [] [] [] [] [] |
+ iso_3166_2 | () [] [] [] |
+ iso_4217 | [] () [] [] [] [] |
+ iso_639 | [] () [] [] [] [] [] [] [] |
+ iso_639_3 | () [] [] |
+ jwhois | [] [] [] [] [] |
+ kbd | [] [] |
+ keytouch | [] [] [] [] [] [] |
+ keytouch-editor | [] [] [] [] [] |
+ keytouch-keyboa... | [] [] [] [] [] |
+ klavaro | [] [] |
+ latrine | [] [] [] |
+ ld | [] [] [] [] |
+ leafpad | [] [] [] [] [] [] [] () |
+ libc | [] [] [] [] [] |
+ libexif | [] |
+ libextractor | |
+ libgnutls | [] [] |
+ libgpewidget | [] [] [] [] |
+ libgpg-error | [] [] |
+ libgphoto2 | [] [] [] |
+ libgphoto2_port | [] [] [] |
+ libgsasl | [] [] [] [] [] |
+ libiconv | [] [] [] [] [] [] |
+ libidn | [] [] [] [] |
+ lifelines | () |
+ liferea | [] [] [] [] |
+ lilypond | [] [] |
+ linkdr | [] [] [] [] [] |
+ lordsawar | |
+ lprng | [] |
+ lynx | [] [] [] [] [] |
+ m4 | [] [] [] [] [] [] |
+ mailfromd | |
+ mailutils | [] [] |
+ make | [] [] [] [] [] [] [] [] [] |
+ man-db | [] [] |
+ man-db-manpages | [] |
+ minicom | [] [] [] [] [] |
+ mkisofs | [] [] [] [] |
+ myserver | |
+ nano | [] [] [] [] [] [] |
+ opcodes | [] [] [] [] |
+ parted | [] [] [] [] |
+ pies | |
+ popt | [] [] [] [] [] [] [] [] [] |
+ psmisc | [] [] [] |
+ pspp | |
+ pwdutils | [] [] |
+ radius | [] [] |
+ recode | [] [] [] [] [] [] [] [] |
+ rosegarden | () () () () () |
+ rpm | [] [] |
+ rush | |
+ sarg | [] |
+ screem | [] [] |
+ scrollkeeper | [] [] [] [] |
+ sed | [] [] [] [] [] [] [] [] |
+ sharutils | [] [] [] [] [] [] [] |
+ shishi | [] |
+ skencil | [] |
+ solfege | [] [] [] [] |
+ solfege-manual | [] [] |
+ soundtracker | [] [] |
+ sp | [] () |
+ sysstat | [] [] [] [] [] |
+ tar | [] [] [] [] [] [] [] |
+ texinfo | [] [] [] [] |
+ tin | [] |
+ unicode-han-tra... | |
+ unicode-transla... | [] [] |
+ util-linux-ng | [] [] [] [] [] [] |
+ vice | () () () |
+ vmm | [] |
+ vorbis-tools | [] |
+ wastesedge | () () |
+ wdiff | [] |
+ wget | [] [] [] [] [] [] [] [] |
+ wyslij-po | [] [] [] |
+ xchat | [] [] [] [] [] [] [] [] [] |
+ xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] |
+ xkeyboard-config | [] [] [] [] [] |
+ +----------------------------------------------------+
+ fi fr ga gl gu he hi hr hu hy id is it ja ka kn
+ 105 121 53 20 4 8 3 5 53 2 120 5 84 67 0 4
+
+ ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne
+ +-----------------------------------------------+
+ a2ps | [] |
+ aegis | |
+ ant-phone | |
+ anubis | [] [] |
+ aspell | [] |
+ bash | |
+ bfd | |
+ bibshelf | [] [] |
+ binutils | |
+ bison | [] |
+ bison-runtime | [] [] [] [] [] |
+ bluez-pin | [] [] [] [] [] |
+ bombono-dvd | |
+ buzztard | |
+ cflow | |
+ clisp | |
+ coreutils | [] |
+ cpio | |
+ cppi | |
+ cpplib | |
+ cryptsetup | |
+ dfarc | [] |
+ dialog | [] [] [] [] [] |
+ dico | |
+ diffutils | [] [] |
+ dink | |
+ doodle | |
+ e2fsprogs | |
+ enscript | |
+ exif | [] |
+ fetchmail | |
+ findutils | |
+ flex | |
+ freedink | [] |
+ gas | |
+ gawk | |
+ gcal | |
+ gcc | |
+ gettext-examples | [] [] [] [] |
+ gettext-runtime | [] |
+ gettext-tools | [] |
+ gip | [] [] |
+ gjay | |
+ gliv | |
+ glunarclock | [] |
+ gnubiff | |
+ gnucash | () () () () |
+ gnuedu | |
+ gnulib | |
+ gnunet | |
+ gnunet-gtk | |
+ gnutls | [] |
+ gold | |
+ gpe-aerial | [] |
+ gpe-beam | [] |
+ gpe-bluetooth | [] [] |
+ gpe-calendar | [] |
+ gpe-clock | [] [] [] [] [] |
+ gpe-conf | [] [] |
+ gpe-contacts | [] [] |
+ gpe-edit | [] |
+ gpe-filemanager | [] [] |
+ gpe-go | [] [] [] |
+ gpe-login | [] |
+ gpe-ownerinfo | [] [] |
+ gpe-package | [] [] |
+ gpe-sketchbook | [] [] |
+ gpe-su | [] [] [] [] [] [] |
+ gpe-taskmanager | [] [] [] [] [] [] |
+ gpe-timesheet | [] [] |
+ gpe-today | [] [] [] [] |
+ gpe-todo | [] [] |
+ gphoto2 | |
+ gprof | [] |
+ gpsdrive | |
+ gramadoir | |
+ grep | |
+ grub | |
+ gsasl | |
+ gss | |
+ gst-plugins-bad | [] [] [] [] |
+ gst-plugins-base | [] [] |
+ gst-plugins-good | [] [] |
+ gst-plugins-ugly | [] [] [] [] [] |
+ gstreamer | |
+ gtick | |
+ gtkam | [] |
+ gtkorphan | [] [] |
+ gtkspell | [] [] [] [] [] [] [] |
+ gutenprint | |
+ hello | [] [] [] |
+ help2man | |
+ hylafax | |
+ idutils | |
+ indent | |
+ iso_15924 | [] [] |
+ iso_3166 | [] [] () [] [] [] [] [] |
+ iso_3166_2 | |
+ iso_4217 | [] [] |
+ iso_639 | [] [] |
+ iso_639_3 | [] |
+ jwhois | [] |
+ kbd | |
+ keytouch | [] |
+ keytouch-editor | [] |
+ keytouch-keyboa... | [] |
+ klavaro | [] |
+ latrine | [] |
+ ld | |
+ leafpad | [] [] [] |
+ libc | [] |
+ libexif | |
+ libextractor | |
+ libgnutls | [] |
+ libgpewidget | [] [] |
+ libgpg-error | |
+ libgphoto2 | |
+ libgphoto2_port | |
+ libgsasl | |
+ libiconv | |
+ libidn | |
+ lifelines | |
+ liferea | |
+ lilypond | |
+ linkdr | |
+ lordsawar | |
+ lprng | |
+ lynx | |
+ m4 | |
+ mailfromd | |
+ mailutils | |
+ make | [] |
+ man-db | |
+ man-db-manpages | |
+ minicom | [] |
+ mkisofs | |
+ myserver | |
+ nano | [] [] |
+ opcodes | |
+ parted | |
+ pies | |
+ popt | [] [] [] |
+ psmisc | |
+ pspp | |
+ pwdutils | |
+ radius | |
+ recode | |
+ rosegarden | |
+ rpm | |
+ rush | |
+ sarg | |
+ screem | |
+ scrollkeeper | [] [] |
+ sed | |
+ sharutils | |
+ shishi | |
+ skencil | |
+ solfege | [] |
+ solfege-manual | |
+ soundtracker | |
+ sp | |
+ sysstat | [] |
+ tar | [] |
+ texinfo | [] |
+ tin | |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux-ng | |
+ vice | |
+ vmm | |
+ vorbis-tools | |
+ wastesedge | |
+ wdiff | |
+ wget | [] |
+ wyslij-po | |
+ xchat | [] [] [] |
+ xdg-user-dirs | [] [] [] [] [] [] [] [] |
+ xkeyboard-config | [] [] [] |
+ +-----------------------------------------------+
+ ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne
+ 20 5 10 1 13 48 4 2 2 4 24 10 20 3 1
+
+ nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr
+ +---------------------------------------------------+
+ a2ps | [] [] [] [] [] [] [] [] |
+ aegis | [] [] [] |
+ ant-phone | [] [] |
+ anubis | [] [] [] |
+ aspell | [] [] [] [] [] |
+ bash | [] [] |
+ bfd | [] |
+ bibshelf | [] [] |
+ binutils | [] [] |
+ bison | [] [] [] |
+ bison-runtime | [] [] [] [] [] [] [] |
+ bluez-pin | [] [] [] [] [] [] [] [] |
+ bombono-dvd | [] () |
+ buzztard | [] [] |
+ cflow | [] |
+ clisp | [] [] |
+ coreutils | [] [] [] [] [] [] |
+ cpio | [] [] [] |
+ cppi | [] |
+ cpplib | [] |
+ cryptsetup | [] |
+ dfarc | [] |
+ dialog | [] [] [] [] |
+ dico | [] |
+ diffutils | [] [] [] [] [] [] |
+ dink | () |
+ doodle | [] [] |
+ e2fsprogs | [] [] |
+ enscript | [] [] [] [] [] |
+ exif | [] [] [] () [] |
+ fetchmail | [] [] [] [] |
+ findutils | [] [] [] [] [] |
+ flex | [] [] [] [] [] |
+ freedink | [] [] |
+ gas | |
+ gawk | [] [] [] [] |
+ gcal | |
+ gcc | [] |
+ gettext-examples | [] [] [] [] [] [] [] [] |
+ gettext-runtime | [] [] [] [] [] [] [] [] [] |
+ gettext-tools | [] [] [] [] [] [] |
+ gip | [] [] [] [] [] |
+ gjay | |
+ gliv | [] [] [] [] [] [] |
+ glunarclock | [] [] [] [] [] |
+ gnubiff | [] () |
+ gnucash | [] () () () |
+ gnuedu | [] |
+ gnulib | [] [] [] [] |
+ gnunet | |
+ gnunet-gtk | |
+ gnutls | [] [] |
+ gold | |
+ gpe-aerial | [] [] [] [] [] [] [] |
+ gpe-beam | [] [] [] [] [] [] [] |
+ gpe-bluetooth | [] [] |
+ gpe-calendar | [] [] [] [] |
+ gpe-clock | [] [] [] [] [] [] [] [] |
+ gpe-conf | [] [] [] [] [] [] [] |
+ gpe-contacts | [] [] [] [] [] |
+ gpe-edit | [] [] [] |
+ gpe-filemanager | [] [] [] |
+ gpe-go | [] [] [] [] [] [] [] [] |
+ gpe-login | [] [] |
+ gpe-ownerinfo | [] [] [] [] [] [] [] [] |
+ gpe-package | [] [] |
+ gpe-sketchbook | [] [] [] [] [] [] [] |
+ gpe-su | [] [] [] [] [] [] [] [] |
+ gpe-taskmanager | [] [] [] [] [] [] [] [] |
+ gpe-timesheet | [] [] [] [] [] [] [] [] |
+ gpe-today | [] [] [] [] [] [] [] [] |
+ gpe-todo | [] [] [] [] [] |
+ gphoto2 | [] [] [] [] [] [] [] [] |
+ gprof | [] [] [] |
+ gpsdrive | [] [] |
+ gramadoir | [] [] |
+ grep | [] [] [] [] |
+ grub | [] [] [] |
+ gsasl | [] [] [] [] |
+ gss | [] [] [] |
+ gst-plugins-bad | [] [] [] [] [] [] |
+ gst-plugins-base | [] [] [] [] [] |
+ gst-plugins-good | [] [] [] [] [] |
+ gst-plugins-ugly | [] [] [] [] [] [] |
+ gstreamer | [] [] [] [] [] |
+ gtick | [] [] [] |
+ gtkam | [] [] [] [] [] [] |
+ gtkorphan | [] |
+ gtkspell | [] [] [] [] [] [] [] [] [] [] |
+ gutenprint | [] [] |
+ hello | [] [] [] [] |
+ help2man | [] [] |
+ hylafax | [] |
+ idutils | [] [] [] [] [] |
+ indent | [] [] [] [] [] [] [] |
+ iso_15924 | [] [] [] [] |
+ iso_3166 | [] [] [] [] [] () [] [] [] [] [] [] [] [] |
+ iso_3166_2 | [] [] [] |
+ iso_4217 | [] [] [] [] [] [] [] [] |
+ iso_639 | [] [] [] [] [] [] [] [] [] |
+ iso_639_3 | [] [] |
+ jwhois | [] [] [] [] |
+ kbd | [] [] [] |
+ keytouch | [] [] [] |
+ keytouch-editor | [] [] [] |
+ keytouch-keyboa... | [] [] [] |
+ klavaro | [] [] |
+ latrine | [] [] |
+ ld | |
+ leafpad | [] [] [] [] [] [] [] [] [] |
+ libc | [] [] [] [] |
+ libexif | [] [] () [] |
+ libextractor | |
+ libgnutls | [] [] |
+ libgpewidget | [] [] [] |
+ libgpg-error | [] [] |
+ libgphoto2 | [] [] |
+ libgphoto2_port | [] [] [] [] [] |
+ libgsasl | [] [] [] [] [] |
+ libiconv | [] [] [] [] [] |
+ libidn | [] [] |
+ lifelines | [] [] |
+ liferea | [] [] [] [] [] () () [] |
+ lilypond | [] |
+ linkdr | [] [] [] |
+ lordsawar | |
+ lprng | [] |
+ lynx | [] [] [] |
+ m4 | [] [] [] [] [] |
+ mailfromd | [] |
+ mailutils | [] |
+ make | [] [] [] [] |
+ man-db | [] [] [] |
+ man-db-manpages | [] [] [] |
+ minicom | [] [] [] [] |
+ mkisofs | [] [] [] |
+ myserver | |
+ nano | [] [] [] [] |
+ opcodes | [] [] |
+ parted | [] [] [] [] |
+ pies | [] |
+ popt | [] [] [] [] |
+ psmisc | [] [] [] |
+ pspp | [] [] |
+ pwdutils | [] |
+ radius | [] [] [] |
+ recode | [] [] [] [] [] [] [] [] |
+ rosegarden | () () |
+ rpm | [] [] [] |
+ rush | [] [] |
+ sarg | |
+ screem | |
+ scrollkeeper | [] [] [] [] [] [] [] [] |
+ sed | [] [] [] [] [] [] [] [] [] |
+ sharutils | [] [] [] [] |
+ shishi | [] |
+ skencil | [] [] |
+ solfege | [] [] [] [] |
+ solfege-manual | [] [] [] |
+ soundtracker | [] |
+ sp | |
+ sysstat | [] [] [] [] |
+ tar | [] [] [] [] |
+ texinfo | [] [] [] [] |
+ tin | [] |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux-ng | [] [] [] [] [] |
+ vice | [] |
+ vmm | [] |
+ vorbis-tools | [] [] |
+ wastesedge | [] |
+ wdiff | [] [] |
+ wget | [] [] [] [] [] [] [] |
+ wyslij-po | [] [] [] |
+ xchat | [] [] [] [] [] [] [] [] [] |
+ xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] |
+ xkeyboard-config | [] [] [] |
+ +---------------------------------------------------+
+ nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr
+ 135 10 4 7 105 1 29 62 47 91 3 54 46 9 37
+
+ sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW
+ +---------------------------------------------------+
+ a2ps | [] [] [] [] [] | 27
+ aegis | [] | 9
+ ant-phone | [] [] [] [] | 9
+ anubis | [] [] [] [] | 15
+ aspell | [] [] [] | 20
+ bash | [] [] [] | 12
+ bfd | [] | 6
+ bibshelf | [] [] [] | 16
+ binutils | [] [] | 8
+ bison | [] [] | 12
+ bison-runtime | [] [] [] [] [] [] | 29
+ bluez-pin | [] [] [] [] [] [] [] [] | 37
+ bombono-dvd | [] | 4
+ buzztard | [] | 7
+ cflow | [] [] [] | 9
+ clisp | | 10
+ coreutils | [] [] [] [] | 22
+ cpio | [] [] [] [] [] [] | 13
+ cppi | [] [] | 5
+ cpplib | [] [] [] [] [] [] | 14
+ cryptsetup | [] [] | 7
+ dfarc | [] | 9
+ dialog | [] [] [] [] [] [] [] | 30
+ dico | [] | 2
+ diffutils | [] [] [] [] [] [] | 30
+ dink | | 4
+ doodle | [] [] | 7
+ e2fsprogs | [] [] [] | 11
+ enscript | [] [] [] [] | 17
+ exif | [] [] [] | 16
+ fetchmail | [] [] [] | 17
+ findutils | [] [] [] [] [] | 20
+ flex | [] [] [] [] | 15
+ freedink | [] | 10
+ gas | [] | 4
+ gawk | [] [] [] [] | 18
+ gcal | [] [] | 5
+ gcc | [] [] [] | 7
+ gettext-examples | [] [] [] [] [] [] [] | 34
+ gettext-runtime | [] [] [] [] [] [] [] | 29
+ gettext-tools | [] [] [] [] [] [] | 22
+ gip | [] [] [] [] | 22
+ gjay | [] | 3
+ gliv | [] [] [] | 14
+ glunarclock | [] [] [] [] [] | 19
+ gnubiff | [] [] | 4
+ gnucash | () [] () [] () | 10
+ gnuedu | [] [] | 7
+ gnulib | [] [] [] [] | 16
+ gnunet | [] | 1
+ gnunet-gtk | [] [] [] | 5
+ gnutls | [] [] [] | 10
+ gold | [] | 4
+ gpe-aerial | [] [] [] | 18
+ gpe-beam | [] [] [] | 19
+ gpe-bluetooth | [] [] [] | 13
+ gpe-calendar | [] [] [] [] | 12
+ gpe-clock | [] [] [] [] [] | 28
+ gpe-conf | [] [] [] [] | 20
+ gpe-contacts | [] [] [] | 17
+ gpe-edit | [] [] [] | 12
+ gpe-filemanager | [] [] [] [] | 16
+ gpe-go | [] [] [] [] [] | 25
+ gpe-login | [] [] [] | 11
+ gpe-ownerinfo | [] [] [] [] [] | 25
+ gpe-package | [] [] [] | 13
+ gpe-sketchbook | [] [] [] | 20
+ gpe-su | [] [] [] [] [] | 30
+ gpe-taskmanager | [] [] [] [] [] | 29
+ gpe-timesheet | [] [] [] [] [] | 25
+ gpe-today | [] [] [] [] [] [] | 30
+ gpe-todo | [] [] [] [] | 17
+ gphoto2 | [] [] [] [] [] | 24
+ gprof | [] [] [] | 15
+ gpsdrive | [] [] [] | 11
+ gramadoir | [] [] [] | 11
+ grep | [] [] [] | 10
+ grub | [] [] [] | 14
+ gsasl | [] [] [] [] | 14
+ gss | [] [] [] | 11
+ gst-plugins-bad | [] [] [] [] | 26
+ gst-plugins-base | [] [] [] [] [] | 24
+ gst-plugins-good | [] [] [] [] | 24
+ gst-plugins-ugly | [] [] [] [] [] | 29
+ gstreamer | [] [] [] [] | 22
+ gtick | [] [] [] | 13
+ gtkam | [] [] [] | 20
+ gtkorphan | [] [] [] | 14
+ gtkspell | [] [] [] [] [] [] [] [] [] | 45
+ gutenprint | [] | 10
+ hello | [] [] [] [] [] [] | 21
+ help2man | [] [] | 7
+ hylafax | [] | 5
+ idutils | [] [] [] [] | 17
+ indent | [] [] [] [] [] [] | 30
+ iso_15924 | () [] () [] [] | 16
+ iso_3166 | [] [] () [] [] () [] [] [] () | 53
+ iso_3166_2 | () [] () [] | 9
+ iso_4217 | [] () [] [] () [] [] | 26
+ iso_639 | [] [] [] () [] () [] [] [] [] | 38
+ iso_639_3 | [] () | 8
+ jwhois | [] [] [] [] [] | 16
+ kbd | [] [] [] [] [] | 15
+ keytouch | [] [] [] | 16
+ keytouch-editor | [] [] [] | 14
+ keytouch-keyboa... | [] [] [] | 14
+ klavaro | [] | 11
+ latrine | [] [] [] | 10
+ ld | [] [] [] [] | 11
+ leafpad | [] [] [] [] [] [] | 33
+ libc | [] [] [] [] [] | 21
+ libexif | [] () | 7
+ libextractor | [] | 1
+ libgnutls | [] [] [] | 9
+ libgpewidget | [] [] [] | 14
+ libgpg-error | [] [] [] | 9
+ libgphoto2 | [] [] | 8
+ libgphoto2_port | [] [] [] [] | 14
+ libgsasl | [] [] [] | 13
+ libiconv | [] [] [] [] | 21
+ libidn | () [] [] | 11
+ lifelines | [] | 4
+ liferea | [] [] [] | 21
+ lilypond | [] | 7
+ linkdr | [] [] [] [] [] | 17
+ lordsawar | | 1
+ lprng | [] | 3
+ lynx | [] [] [] [] | 17
+ m4 | [] [] [] [] | 19
+ mailfromd | [] [] | 3
+ mailutils | [] | 5
+ make | [] [] [] [] | 21
+ man-db | [] [] [] | 8
+ man-db-manpages | | 4
+ minicom | [] [] | 16
+ mkisofs | [] [] | 9
+ myserver | | 0
+ nano | [] [] [] [] | 21
+ opcodes | [] [] [] | 11
+ parted | [] [] [] [] [] | 15
+ pies | [] [] | 3
+ popt | [] [] [] [] [] [] | 27
+ psmisc | [] [] | 11
+ pspp | | 4
+ pwdutils | [] [] | 6
+ radius | [] [] | 9
+ recode | [] [] [] [] | 28
+ rosegarden | () | 0
+ rpm | [] [] [] | 11
+ rush | [] [] | 4
+ sarg | | 1
+ screem | [] | 3
+ scrollkeeper | [] [] [] [] [] | 27
+ sed | [] [] [] [] [] | 30
+ sharutils | [] [] [] [] [] | 22
+ shishi | [] | 3
+ skencil | [] [] | 7
+ solfege | [] [] [] [] | 16
+ solfege-manual | [] | 8
+ soundtracker | [] [] [] | 9
+ sp | [] | 3
+ sysstat | [] [] | 15
+ tar | [] [] [] [] [] [] | 23
+ texinfo | [] [] [] [] [] | 17
+ tin | | 4
+ unicode-han-tra... | | 0
+ unicode-transla... | | 2
+ util-linux-ng | [] [] [] [] | 20
+ vice | () () | 1
+ vmm | [] | 4
+ vorbis-tools | [] | 6
+ wastesedge | | 2
+ wdiff | [] [] | 7
+ wget | [] [] [] [] [] | 26
+ wyslij-po | [] [] | 8
+ xchat | [] [] [] [] [] [] | 36
+ xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] | 63
+ xkeyboard-config | [] [] [] | 22
+ +---------------------------------------------------+
+ 85 teams sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW
+ 178 domains 119 1 3 3 0 10 65 51 155 17 98 7 41 2618
+
+ Some counters in the preceding matrix are higher than the number of
+visible blocks let us expect. This is because a few extra PO files are
+used for implementing regional variants of languages, or language
+dialects.
+
+ For a PO file in the matrix above to be effective, the package to
+which it applies should also have been internationalized and
+distributed as such by its maintainer. There might be an observable
+lag between the mere existence a PO file and its wide availability in a
+distribution.
+
+ If June 2010 seems to be old, you may fetch a more recent copy of
+this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date
+matrix with full percentage details can be found at
+`http://translationproject.org/extra/matrix.html'.
+
+1.5 Using `gettext' in new packages
+===================================
+
+If you are writing a freely available program and want to
+internationalize it you are welcome to use GNU `gettext' in your
+package. Of course you have to respect the GNU Library General Public
+License which covers the use of the GNU `gettext' library. This means
+in particular that even non-free programs can use `libintl' as a shared
+library, whereas only free software can use `libintl' as a static
+library or use modified versions of `libintl'.
+
+ Once the sources are changed appropriately and the setup can handle
+the use of `gettext' the only thing missing are the translations. The
+Free Translation Project is also available for packages which are not
+developed inside the GNU project. Therefore the information given above
+applies also for every other Free Software Project. Contact
+`coordinator@translationproject.org' to make the `.pot' files available
+to the translation teams.
+
diff --git a/extension/AUTHORS b/extension/AUTHORS
new file mode 100644
index 00000000..fa9e7fe1
--- /dev/null
+++ b/extension/AUTHORS
@@ -0,0 +1,13 @@
+ Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+
+ Copying and distribution of this file, with or without modification,
+ are permitted in any medium without royalty provided the copyright
+ notice and this notice are preserved.
+
+Gawk was written by Paul Rubin, and finished by Paul Finlason and
+Richard Stallman.
+
+David Trueman and Arnold Robbins took it over, with David doing most
+of the work to make it compatible with new awk.
+
+Circa 1994, Arnold Robbins took over maintenance.
diff --git a/extension/COPYING b/extension/COPYING
new file mode 100644
index 00000000..94a9ed02
--- /dev/null
+++ b/extension/COPYING
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/extension/ChangeLog b/extension/ChangeLog
index d684afe9..793cf455 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,3 +1,509 @@
+2012-11-06 Arnold D. Robbins <arnold@skeeve.com>
+
+ * configure.ac: Add check for $srcdir/.developing as in
+ the main directory's configure.ac.
+
+2012-11-04 Arnold D. Robbins <arnold@skeeve.com>
+
+ * rwarray.3am: Minor edits.
+
+2012-10-28 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (dist_man_MANS): Update the list.
+
+2012-10-26 Arnold D. Robbins <arnold@skeeve.com>
+
+ * revtwoway.3am: Clean up example.
+ * revtwoway.c: Minor cleanup (add translation calls).
+
+2012-10-24 Arnold D. Robbins <arnold@skeeve.com>
+
+ * revtwoway.3am: New file.
+
+2012-10-21 Arnold D. Robbins <arnold@skeeve.com>
+
+ * filefuncs.c (do_stat): Always clear the array.
+
+2012-10-14 Arnold D. Robbins <arnold@skeeve.com>
+
+ * readdir.c, revoutput.c, revtwoway.c: Adjust for name change
+ of IOBUF_PUBLIC to awk_input_buf_t. Additional sanitizing in
+ revoutput.c to use `revoutput' everywhere instead of `revout'.
+ * revoutput.3am: New file.
+ * filefuncs.3am, fnmatch.3am, fork.3am, ordchr.3am, readdir.3am,
+ readfile.3am, rwarray.3am, time.3am: Add ref to revoutput(3am).
+
+2012-10-11 Arnold D. Robbins <arnold@skeeve.com>
+
+ * textext.c (try_modify_environ): Save array cookie in a separate
+ variable so it isn't clobbered. Thanks to Andrew Schorr, by way
+ of valgrind, for finding the bug.
+
+2012-09-14 Arnold D. Robbins <arnold@skeeve.com>
+
+ * testext.c (try_modify_environ): New function and test.
+ (var_test): Modified ARGC test, added additional.
+ (test_scalar_reserved): New function and test.
+ (try_modify_environ): Don't print count of ENVIRON elements.
+
+2012-09-13 Dave Pitts <dpitts@cozx.com>
+
+ * gawkfts.c: Add defines and ifdefs for z/OS.
+ * gawkfts.h: Add defines and ifdefs for z/OS. Fix // comments.
+ * readdir.c (dir_get_record): Adjust sprintf format for z/OS.
+ * rwarray.c: Add defines and ifdefs for z/OS. Fix // comments.
+
+2012-09-11 Arnold D. Robbins <arnold@skeeve.com>
+
+ * readdir.c (do_readdir_do_ftype): Set ERRNO for bad arguments.
+ * readdir.3a: Document same, minor fixes.
+
+2012-09-07 Akim Demaille <akim@lrde.epita.fr>
+
+ * extension/gawkfts.h (__THROW): Define if it is not.
+ Copied from getopt.h.
+ * extension/gawkfts.c (fts_alloc): Since FTSENT.fts_statp is
+ defined as a struct stat*, use that type for casts instead of
+ the undefined __fts_stat_t type.
+
+2012-09-07 Arnold D. Robbins <arnold@skeeve.com>
+
+ * readdir.c, readdir.3am: Change argument to readdir_do_ftype()
+ to be a string. Update the doc accordingly.
+ * gawkfts.h: Add explanatory comment before defines of API
+ names towards the end. Thanks to Eli Zaretskii for the suggestion.
+
+2012-08-28 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * readdir.c: Have three states, 0, 1, 2 for never, fallback, and
+ always.
+ * readdir.3am: Adjust appropriately.
+
+2012-08-29 Arnold D. Robbins <arnold@skeeve.com>
+
+ Make fts work everywhere by using our own source.
+
+ * README.fts, gawkfts.c, gawkfts.h, fts.3: New files.
+ * Makefile.am (filefuncs_la_SOURCES, EXTRA_DIST): Adjust.
+ * configure.ac: Remove check for fts.h and fts_XXX functions.
+ * filefuncs.c: Remove various ifdefs, change includes around.
+
+2012-08-28 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am: Rename man_MANS to dist_man_MANS to include the man
+ pages in the distribution tarball.
+
+2012-08-26 Arnold D. Robbins <arnold@skeeve.com>
+
+ * configure.ac (AC_SYS_LARGEFILE): Added. Needed for consistency
+ with gawk, to get the same size struct stat everywhere.
+ * filefuncs.c, fnmatch.c, fork.c, ordchr.c, readdir.c, readfile.c,
+ revoutput.c, revtwoway.c, rwarray.c, rwarray0.c, testext.c,
+ time.c: Move include of config.h to top (or add it!)
+
+2012-08-24 Arnold D. Robbins <arnold@skeeve.com>
+
+ * filefuncs.c, fnmatch.c, fork.c, ordchr.c, readdir.c, readfile.c,
+ revoutput.c, revtwoway.c, rwarray.c, rwarray0.c, testext.c,
+ time.c: Add ext_version string.
+
+2012-08-23 Arnold D. Robbins <arnold@skeeve.com>
+
+ * revoutwoway.c: New testing extension for two way processor.
+ * Makefile.am: Build revtwoway extension.
+ * readdir.c: Fix to fall back to stat if d_type is 'u' and
+ do_ftype is one.
+ * readdir.3am: Revise doc that some GNU/Linux filesystems
+ don't support d_type.
+
+2012-08-22 Arnold D. Robbins <arnold@skeeve.com>
+
+ * revoutput.c: New testing extension for output wrapper.
+ * Makefile.am: Build revoutput extension.
+
+2012-08-08 Arnold D. Robbins <arnold@skeeve.com>
+
+ Add fts() to filefuncs.
+
+ * filefuncs.3am: Update doc.
+ * filefuncs.c: Lots of new code.
+ * configure.ac: Add checks for appropriate headers and functions.
+ * stack.h, stack.c: New files.
+ * Makefile.am: Update list of files.
+
+ * readdir.c (dir_can_take_file): Use members in iobuf.
+ * rwarray.c (do_writea): Initialize fp to NULL.
+
+ * filefuncs.3am, fnmatch.3am, fork.3am, ordchr.3am, readdir.3am,
+ readfile.3am, rwarray.3am, time.3am: Updated.
+
+2012-08-03 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * readdir.c (dir_get_record): Fix for systems where ino_t is
+ 64 bit even on 32 bit systems (cygwin).
+
+2012-08-01 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (man_MANS): Add man page files so that they
+ get installed.
+ * rwarray.3am: New file.
+ * fnmatch.3am, fork.3am, time.3am: Revised.
+
+2012-07-31 Arnold D. Robbins <arnold@skeeve.com>
+
+ * rwarray0.c: Renamed from rwarray.c.
+ * rwarray.c: New file using stdio instead of system calls,
+ works on cygwin.
+
+2012-07-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * ABOUT-NLS: New file.
+ * Makefile.am, configure.ac: Revised for gettext.
+
+ * fork.3am, readdir.3am, time.3am: New files.
+ * filefuncs.3am, fnmatch.3am, ordchr.3am, readfile.3am: Revised.
+
+2012-07-29 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * readdir.c (dir_get_record): Adjust to new interface for RT.
+
+2012-07-29 Arnold D. Robbins <arnold@skeeve.com>
+
+ * readdir.c (dir_take_control_of): Print error message and
+ set ERRNO if failure. Adjust count of max digits.
+
+2012-07-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (*_la_LIBADD): Need to link with $(LIBINTL) for
+ gettext to work on platforms where it is not included in libc.
+
+2012-07-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * readdir.c (dir_get_record): Need to set errno to 0 before calling
+ readdir, since readdir sets errno only on failure, not on EOF.
+
+2012-07-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * readdir.c (dir_get_record): If readdir fails, set errcode. Otherwise,
+ don't bother to set errcode.
+
+2012-07-27 Arnold D. Robbins <arnold@skeeve.com>
+
+ * readdir.c (dir_take_control_of): Fix typo for case where
+ we don't have fopendir (e.g., Mac OS X 10.5).
+
+2012-07-26 Arnold D. Robbins <arnold@skeeve.com>
+
+ * configure.ac: Extremely crude hack to get the value of
+ ENABLE_NLS so that gettext will work in extensions.
+
+ * readdir.c (dir_get_record): Call set_RT.
+ (dir_can_take_file): Make parameter const.
+
+ * testext.c (valrep2str): Add AWK_VALUE_COOKIE.
+
+ * readdir.c: Add readdir_do_ftype function for systems without
+ dirent->d_type. Clean up buffer handling.
+
+2012-07-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * readdir.c (dir_get_record): No need to set *errcode to 0.
+ (dir_take_control_of): Remove some paranoia -- no need to test for
+ NULL iobuf, and no need to check dir_can_take_file again.
+
+2012-07-25 Arnold D. Robbins <arnold@skeeve.com>
+
+ * readdir.c: New file.
+ * Makefile.am (readdir): New extension.
+
+ * time.c: Fix all calls to update_ERRNO_string.
+
+ * filefuncs.c, fnmatch.c, fork.c, ordchr.c, readfile.c, rwarray.c,
+ time.c: Translate strings.
+
+2012-07-20 Arnold D. Robbins <arnold@skeeve.com>
+
+ * filefuncs.3am, fnmatch.3am, ordchr.3am, readfile.3am:
+ new files.
+
+2012-07-16 Arnold D. Robbins <arnold@skeeve.com>
+
+ * fnmatch.c: Simplify flag table.
+
+2012-07-15 Arnold D. Robbins <arnold@skeeve.com>
+
+ * testext.c (test_scalar): New function and new tests.
+ (init_testext): Add a new variable.
+
+2012-07-13 Arnold D. Robbins <arnold@skeeve.com>
+
+ * filefuncs.c (fill_stat_array): New function to do the work
+ for stat.
+ (do_stat): Call it.
+
+2012-07-12 Arnold D. Robbins <arnold@skeeve.com>
+
+ * fnmatch.c: New file.
+ * Makefile.am: Build fnmatch extension.
+ * configure.ac: Look for fnmatch.h and fnmatch function.
+
+ * fnmatch.c (init_fnmatch): Use sym_constant for FNM_NOMATCH.
+ * testext.c (dl_load): Use sym_constant for answer_num.
+
+ * testext.c (init_testext): Move extra code to here.
+ (init_func): Change to point to init_testext.
+ (dl_load): Deleted.
+ (dl_load_func): Use the macro.
+
+2012-07-11 Arnold D. Robbins <arnold@skeeve.com>
+
+ * filefuncs.c (array_set, do_stat): Use make_const_string.
+ * fork.c (array_set_numeric): Ditto.
+ * ordchr.c (do_chr): Ditto.
+ * readfile.c (do_readfile): Use make_null_string, make_malloced_string.
+ * rwarray.c (read_elem): Ditto.
+ * testext.c (valrep2str): Add case for AWK_SCALAR.
+ (test_array_elem): Duplicate strings coming from gawk before passing
+ them back in.
+
+ All files: Add null 'init_func' file pointer for dl_load_func
+ to work.
+
+2012-07-09 Arnold D. Robbins <arnold@skeeve.com>
+
+ * filefuncs.c (do_readfile): Return "" and set ERRNO on error
+ instead of returning -1. Per suggestion from Andrew Schorr.
+
+2012-07-08 Arnold D. Robbins <arnold@skeeve.com>
+
+ * filefuncs.c (array_set): Adjust for change in set_array_element API.
+ * fork.c (array_set_numeric): Ditto.
+ * rwarray.c (read_array): Use set_array_element_by_elem.
+ (read_value): Add a cast to silence a compiler warning.
+ * testext.c (test_array_elem): Adjust for change in set_array_element
+ API.
+ (fill_in_array): Ditto. Change parameter name to new_array.
+
+2012-06-29 Arnold D. Robbins <arnold@skeeve.com>
+
+ * ordchr.c (do_ord, do_chr): Improve argument checking and
+ lint messages.
+
+2012-06-25 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (EXTRA_DIST): Remove *.awk.
+ * rwarray.awk: Moved to test directory.
+
+2012-06-24 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am: Enable rwarray extension.
+ * rwarray.c: Redone to use new API.
+ * rwarray.awk: Revamped for new version.
+
+2012-06-21 Arnold D. Robbins <arnold@skeeve.com>
+
+ * testext.c (test_array_elem): Add a subarray.
+ (test_array_flatten): Removed: Tests done elsewhere.
+
+2012-06-20 Arnold D. Robbins <arnold@skeeve.com>
+
+ * testext.c (fill_in_array): New function.
+ (create_new_array): Most code moved into fill_in_array.
+ (test_array_param): New function.
+
+2012-06-19 Arnold D. Robbins <arnold@skeeve.com>
+
+ * testext.c (dump_array_and_delete): Renamed from dump_array.
+ Get second parameter which is index to delete. Update awk test.
+
+2012-06-18 Arnold D. Robbins <arnold@skeeve.com>
+
+ * filefuncs.c (do_chdir): Change element use to match change types.
+ * fork.c (array_set_numeric): Ditto.
+ * testext.c (valrep2str): New function.
+ (test_array_elem): Add AWK_UNDEFINED for `wanted'. Use valrep2str.
+ Adjust use of element index.
+ (dump_array): Renamed from `dump_procinfo' and implemented.
+ (func_table): Updated.
+
+2012-06-17 Arnold D. Robbins <arnold@skeeve.com>
+
+ * filefuncs.c (do_chdir, do_stat): Add assert(result != NULL).
+ * fork.c (do_fork, do_waitpid, do_wait): Ditto.
+ * ordchr.c (do_ord, do_chr): Ditto.
+ * readfile.c (do_readfile): Ditto.
+ * time.c (do_gettimeofday, do_sleep): Ditto.
+ * testext.c (All functions): Ditto. Clean up initial testing and use
+ make_number to make default return value up front.
+ (create_new_array, test_array_flatten): New functions.
+ (test_array_elem): Implemented.
+ (at_exit1): Don't printa actual pointer value: not portable.
+ (dl_load): Load up an array also.
+
+2012-06-14 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * time.c (RETURN): Remove obsolete define.
+ (do_sleep): Change update_ERRNO_str argument to request translation.
+
+2012-06-12 Arnold D. Robbins <arnold@skeeve.com>
+
+ Revise API:
+
+ * filefuncs.c (do_chdir): Replace get_curfunc_param with get_argument.
+ (format_mode): Use unsigned masks.
+ (do_stat): Replace get_curfunc_param with get_argument.
+ * fork.c (do_fork): Rearrange arg order in call to sym_lookup
+ (do_waitpid): Replace get_curfunc_param with get_argument.
+ * ordchr.c (do_ord, do_chr): Replace get_curfunc_param with get_argument.
+ * readfile.c (do_readfile): Replace get_curfunc_param with get_argument.
+ * time.c (do_sleep): Replace get_curfunc_param with get_argument.
+ Replace set_ERRNO with update_ERRNO_str for no way to sleep case.
+
+ Work on testext.c:
+
+ * Makefile.am: Add stuff to make testext. Remove doit and steps
+ from EXTRA_DIST.
+ * testext.c: Fill in many of the test routines. Still more to do.
+ Fix up test scripts for each routine.
+ * time.c (do_sleep): Fix use of get_argument to be boolean.
+
+2012-06-10 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am: Add time extension.
+ * configure.ac: To support time extension, check for some headers
+ and functions that are needed.
+ * time.c: New file implementing sleep and gettimeofday.
+
+2012-06-10 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am: Remove comment referring to deleted test extensions
+ arrayparm, dl (zaxxon) and testarg.
+
+2012-06-10 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * arrayparm.c, dl.c, doit, foo.awk, steps, testarg.awk, testarg.c,
+ testarrayparm.awk, testff.awk, testfork.awk, testordchr.awk: Remove
+ unused (obsolete) files.
+
+2012-06-06 Arnold D. Robbins <arnold@skeeve.com>
+
+ * filefuncs.c (do_stat): Make `type' const char *.
+
+ * testext.c: Functions renamed, some of them filled in. Corresponding
+ awk code for each test added inline.
+
+2012-05-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * testext.c: New file. Outline of tests for extension API.
+
+2012-05-29 Arnold D. Robbins <arnold@skeeve.com>
+
+ * filefuncs.c: Further cleanup and condensation of code into tables.
+ * fork.c, ordchr.c, readfile.c: Update copyright, general cleanup.
+
+2012-05-25 Arnold D. Robbins <arnold@skeeve.com>
+
+ * filefuncs.c (array_set_numeric): Don't return a value from
+ a void function.
+
+2012-05-24 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (AM_CPPFLAGS): Use $(srcdir) to work properly when
+ built outside the source directory.
+ * configure.ac (INSTALL): Set location manually since autoconf was
+ not specifying the proper path for install-sh.
+ * filefuncs2.c, ordchr2.c, readfile2.c: Deleted.
+ * filefuncs.c: Install filefuncs2.c and patch for recent API changes.
+ * ordchr.c: Install ordchr2.c and patch for recent API changes.
+ * readfile.c: Install readfile2.c and patch for recent API changes.
+ * fork.c: Port to new API.
+
+2012-05-21 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * configure.ac: New file to run configure with libtool support
+ in this subdirectory.
+ * Makefile.am: Some changes related to running automake in this
+ directory.
+ * AUTHORS, COPYING, INSTALL, NEWS, README: Added files to make automake
+ happy.
+ * aclocal.m4, configure, configh.in: Added autoconf files.
+ * build-aux, m4: New subdirectories for autoconf stuff.
+
+2012-05-15 Arnold D. Robbins <arnold@skeeve.com>
+
+ * filefuncs2.c: New file implementing chdir and stat using the
+ new interface.
+
+ Everything else is temporarily broken.
+
+2012-05-13 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * filefuncs.c (array_set): Add a comment discussing the use of unref
+ on the value returned by assoc_lookup.
+
+2012-05-13 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * xreadlink.[ch]: Remove unused files.
+
+2012-05-11 Arnold D. Robbins <arnold@skeeve.com>
+
+ Sweeping change: Use `bool', `true', and `false' everywhere.
+
+2012-04-11 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * filefuncs.c (array_set): New function to set an array element.
+ (do_set): Use new array_set function to reduce code duplication and
+ to make sure the memory management is handled properly.
+
+2012-04-07 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * filefuncs.c: Remove unnecessary #include <sys/sysmacros.h>.
+ (read_symlink): New function to read symbolic links more robustly.
+ (do_stat): Use read_symlink instead of readlink.
+ * fork.c (do_wait): new function.
+ (dlload): Call make_builtin to add "wait" function.
+
+2012-04-02 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * fork.c (do_fork): Test whether PROCINFO_node exists before updating
+ the pid values. And do so properly using make_number.
+ * readfile.c (do_readfile): Function should be static.
+
+2012-04-01 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * filefuncs.c (do_chdir, do_stat): Replace update_ERRNO() with
+ update_ERRNO_int(errno).
+ * fork.c (do_fork, do_waitpid): Ditto.
+ * readfile.c (do_readfile): Ditto.
+ * rwarray.c (do_writea, do_reada): Ditto.
+
+2012-03-25 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am: Major cleanup. Use libtool options -module and
+ -avoid-version to create the modules properly without my local hack
+ to override the default behavior.
+
+2012-03-25 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * .gitignore: New file to ignore files created by libtool (including
+ binaries and associated metadata).
+
+2012-03-21 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (INCLUDES): Remove -I$(top_srcdir)/intl.
+
+2012-03-20 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am: New file to build and install shared libraries.
+ * arrayparm.c (do_mkarray): Get it to compile by removing 2nd arg
+ to assoc_clear.
+ * filefuncs.c (do_stat): Ditto.
+
+2011-08-31 John Haque <j.eh@mchsi.com>
+
+ * arrayparm.c, filefuncs.c, fork.c, ordchr.c, readfile.c,
+ rwarray.c, testarg.c: Updated.
+
2012-03-28 Arnold D. Robbins <arnold@skeeve.com>
* 4.0.1: Release tar ball made.
diff --git a/extension/INSTALL b/extension/INSTALL
new file mode 100644
index 00000000..6e90e07d
--- /dev/null
+++ b/extension/INSTALL
@@ -0,0 +1,370 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994-1996, 1999-2002, 2004-2012 Free Software Foundation,
+Inc.
+
+ Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved. This file is offered as-is,
+without warranty of any kind.
+
+Basic Installation
+==================
+
+ Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package. The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package. Some packages provide this
+`INSTALL' file but do not implement all of the features documented
+below. The lack of an optional feature in a given package is not
+necessarily a bug. More recommendations for GNU packages can be found
+in *note Makefile Conventions: (standards)Makefile Conventions.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+ It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring. Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+ The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'. You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
+
+ The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system.
+
+ Running `configure' might take a while. While running, it prints
+ some messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package, generally using the just-built uninstalled binaries.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation. When installing into a prefix owned by root, it is
+ recommended that the package be configured and built as a regular
+ user, and only the `make install' phase executed with root
+ privileges.
+
+ 5. Optionally, type `make installcheck' to repeat any self-tests, but
+ this time using the binaries in their final installed location.
+ This target does not install anything. Running this target as a
+ regular user, particularly if the prior `make install' required
+ root privileges, verifies that the installation completed
+ correctly.
+
+ 6. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+ 7. Often, you can also type `make uninstall' to remove the installed
+ files again. In practice, not all packages have tested that
+ uninstallation works correctly, even though it is required by the
+ GNU Coding Standards.
+
+ 8. Some packages, particularly those that use Automake, provide `make
+ distcheck', which can by used by developers to test that all other
+ targets like `make install' and `make uninstall' work correctly.
+ This target is generally not run by end users.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+ You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment. Here
+is an example:
+
+ ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+ *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you can use GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'. This
+is known as a "VPATH" build.
+
+ With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory. After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+ On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor. Like
+this:
+
+ ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+ CPP="gcc -E" CXXCPP="g++ -E"
+
+ This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
+
+Installation Names
+==================
+
+ By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc. You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX', where PREFIX must be an
+absolute file name.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files. Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them. In general, the
+default for these options is expressed in terms of `${prefix}', so that
+specifying just `--prefix' will affect all of the other directory
+specifications that were not explicitly provided.
+
+ The most portable way to affect installation locations is to pass the
+correct locations to `configure'; however, many packages provide one or
+both of the following shortcuts of passing variable assignments to the
+`make install' command line to change installation locations without
+having to reconfigure or recompile.
+
+ The first method involves providing an override variable for each
+affected directory. For example, `make install
+prefix=/alternate/directory' will choose an alternate location for all
+directory configuration variables that were expressed in terms of
+`${prefix}'. Any directories that were specified during `configure',
+but not in terms of `${prefix}', must each be overridden at install
+time for the entire installation to be relocated. The approach of
+makefile variable overrides for each directory variable is required by
+the GNU Coding Standards, and ideally causes no recompilation.
+However, some platforms have known limitations with the semantics of
+shared libraries that end up requiring recompilation when using this
+method, particularly noticeable in packages that use GNU Libtool.
+
+ The second method involves providing the `DESTDIR' variable. For
+example, `make install DESTDIR=/alternate/directory' will prepend
+`/alternate/directory' before all installation names. The approach of
+`DESTDIR' overrides is not required by the GNU Coding Standards, and
+does not work on platforms that have drive letters. On the other hand,
+it does better at avoiding recompilation issues, and works well even
+when some directory options were not specified in terms of `${prefix}'
+at `configure' time.
+
+Optional Features
+=================
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+ Some packages offer the ability to configure how verbose the
+execution of `make' will be. For these packages, running `./configure
+--enable-silent-rules' sets the default to minimal output, which can be
+overridden with `make V=1'; while running `./configure
+--disable-silent-rules' sets the default to verbose, which can be
+overridden with `make V=0'.
+
+Particular systems
+==================
+
+ On HP-UX, the default C compiler is not ANSI C compatible. If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+ ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+ HP-UX `make' updates targets which have the same time stamps as
+their prerequisites, which makes it generally unusable when shipped
+generated files such as `configure' are involved. Use GNU `make'
+instead.
+
+ On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file. The option `-nodtk' can be used as
+a workaround. If GNU CC is not installed, it is therefore recommended
+to try
+
+ ./configure CC="cc"
+
+and if that doesn't work, try
+
+ ./configure CC="cc -nodtk"
+
+ On Solaris, don't put `/usr/ucb' early in your `PATH'. This
+directory contains several dysfunctional programs; working variants of
+these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
+in your `PATH', put it _after_ `/usr/bin'.
+
+ On Haiku, software installed for all users goes in `/boot/common',
+not `/usr/local'. It is recommended to use the following options:
+
+ ./configure --prefix=/boot/common
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on. Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+`--build=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+ CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+ OS
+ KERNEL-OS
+
+ See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+ If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+ If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+ Variables not defined in a site shell script can be set in the
+environment passed to `configure'. However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost. In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'. For example:
+
+ ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf limitation. Until the limitation is lifted, you can use
+this workaround:
+
+ CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--help'
+`-h'
+ Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+ Print a summary of the options unique to this package's
+ `configure', and exit. The `short' variant lists options used
+ only in the top level, while the `recursive' variant lists options
+ also present in any nested packages.
+
+`--version'
+`-V'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`--cache-file=FILE'
+ Enable the cache: use and save the results of the tests in FILE,
+ traditionally `config.cache'. FILE defaults to `/dev/null' to
+ disable caching.
+
+`--config-cache'
+`-C'
+ Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made. To
+ suppress all normal output, redirect it to `/dev/null' (any error
+ messages will still be shown).
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`--prefix=DIR'
+ Use DIR as the installation prefix. *note Installation Names::
+ for more details, including other options available for fine-tuning
+ the installation locations.
+
+`--no-create'
+`-n'
+ Run the configure checks, but stop before creating any output
+ files.
+
+`configure' also accepts some other, not widely useful, options. Run
+`configure --help' for more details.
diff --git a/extension/Makefile.am b/extension/Makefile.am
new file mode 100644
index 00000000..3bdc5df8
--- /dev/null
+++ b/extension/Makefile.am
@@ -0,0 +1,106 @@
+#
+# extension/Makefile.am --- automake input file for gawk
+#
+# Copyright (C) 1995-2006, 2012 the Free Software Foundation, Inc.
+#
+# This file is part of GAWK, the GNU implementation of the
+# AWK Programming Language.
+#
+# GAWK is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# GAWK is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+
+## Process this file with automake to produce Makefile.in.
+
+AM_CPPFLAGS = -I$(srcdir)/..
+
+# This variable insures that aclocal runs
+# correctly after changing configure.ac
+ACLOCAL_AMFLAGS = -I m4
+
+# Note: rwarray does not currently compile.
+
+pkgextension_LTLIBRARIES = \
+ filefuncs.la \
+ fnmatch.la \
+ fork.la \
+ ordchr.la \
+ readdir.la \
+ readfile.la \
+ revoutput.la \
+ revtwoway.la \
+ rwarray.la \
+ testext.la \
+ time.la
+
+MY_MODULE_FLAGS = -module -avoid-version -no-undefined
+# on Cygwin, gettext requires that we link with -lintl
+MY_LIBS = $(LIBINTL)
+
+filefuncs_la_SOURCES = filefuncs.c stack.h stack.c gawkfts.h gawkfts.c
+filefuncs_la_LDFLAGS = $(MY_MODULE_FLAGS)
+filefuncs_la_LIBADD = $(MY_LIBS)
+
+fnmatch_la_SOURCES = fnmatch.c
+fnmatch_la_LDFLAGS = $(MY_MODULE_FLAGS)
+fnmatch_la_LIBADD = $(MY_LIBS)
+
+fork_la_SOURCES = fork.c
+fork_la_LDFLAGS = $(MY_MODULE_FLAGS)
+fork_la_LIBADD = $(MY_LIBS)
+
+ordchr_la_SOURCES = ordchr.c
+ordchr_la_LDFLAGS = $(MY_MODULE_FLAGS)
+ordchr_la_LIBADD = $(MY_LIBS)
+
+readdir_la_SOURCES = readdir.c
+readdir_la_LDFLAGS = $(MY_MODULE_FLAGS)
+readdir_la_LIBADD = $(MY_LIBS)
+
+readfile_la_SOURCES = readfile.c
+readfile_la_LDFLAGS = $(MY_MODULE_FLAGS)
+readfile_la_LIBADD = $(MY_LIBS)
+
+revoutput_la_SOURCES = revoutput.c
+revoutput_la_LDFLAGS = $(MY_MODULE_FLAGS)
+revoutput_la_LIBADD = $(MY_LIBS)
+
+revtwoway_la_SOURCES = revtwoway.c
+revtwoway_la_LDFLAGS = $(MY_MODULE_FLAGS)
+revtwoway_la_LIBADD = $(MY_LIBS)
+
+rwarray_la_SOURCES = rwarray.c
+rwarray_la_LDFLAGS = $(MY_MODULE_FLAGS)
+rwarray_la_LIBADD = $(MY_LIBS)
+
+time_la_SOURCES = time.c
+time_la_LDFLAGS = $(MY_MODULE_FLAGS)
+time_la_LIBADD = $(MY_LIBS)
+
+testext_la_SOURCES = testext.c
+testext_la_LDFLAGS = $(MY_MODULE_FLAGS)
+testext_la_LIBADD = $(MY_LIBS)
+
+EXTRA_DIST = build-aux/config.rpath \
+ ChangeLog \
+ ChangeLog.0 \
+ fts.3
+
+dist_man_MANS = \
+ filefuncs.3am fnmatch.3am fork.3am ordchr.3am \
+ readdir.3am readfile.3am revoutput.3am \
+ revtwoway.3am rwarray.3am time.3am
+
+# gettext requires this
+SUBDIRS =
diff --git a/extension/Makefile.in b/extension/Makefile.in
new file mode 100644
index 00000000..a8262cbc
--- /dev/null
+++ b/extension/Makefile.in
@@ -0,0 +1,1171 @@
+# Makefile.in generated by automake 1.12.4 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+#
+# extension/Makefile.am --- automake input file for gawk
+#
+# Copyright (C) 1995-2006, 2012 the Free Software Foundation, Inc.
+#
+# This file is part of GAWK, the GNU implementation of the
+# AWK Programming Language.
+#
+# GAWK is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# GAWK is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+
+VPATH = @srcdir@
+am__make_dryrun = \
+ { \
+ am__dry=no; \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
+ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+ *) \
+ for am__flg in $$MAKEFLAGS; do \
+ case $$am__flg in \
+ *=*|--*) ;; \
+ *n*) am__dry=yes; break;; \
+ esac; \
+ done;; \
+ esac; \
+ test $$am__dry = yes; \
+ }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(dist_man_MANS) \
+ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/configh.in $(top_srcdir)/build-aux/ar-lib \
+ $(top_srcdir)/build-aux/config.guess \
+ $(top_srcdir)/build-aux/config.rpath \
+ $(top_srcdir)/build-aux/config.sub \
+ $(top_srcdir)/build-aux/depcomp \
+ $(top_srcdir)/build-aux/install-sh \
+ $(top_srcdir)/build-aux/ltmain.sh \
+ $(top_srcdir)/build-aux/missing $(top_srcdir)/configure \
+ ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL NEWS \
+ build-aux/ChangeLog build-aux/ar-lib build-aux/config.guess \
+ build-aux/config.rpath build-aux/config.sub build-aux/depcomp \
+ build-aux/install-sh build-aux/ltmain.sh build-aux/missing
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
+ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
+ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__installdirs = "$(DESTDIR)$(pkgextensiondir)" \
+ "$(DESTDIR)$(man3dir)"
+LTLIBRARIES = $(pkgextension_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1)
+filefuncs_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
+am_filefuncs_la_OBJECTS = filefuncs.lo stack.lo gawkfts.lo
+filefuncs_la_OBJECTS = $(am_filefuncs_la_OBJECTS)
+filefuncs_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(filefuncs_la_LDFLAGS) $(LDFLAGS) -o $@
+fnmatch_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
+am_fnmatch_la_OBJECTS = fnmatch.lo
+fnmatch_la_OBJECTS = $(am_fnmatch_la_OBJECTS)
+fnmatch_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(fnmatch_la_LDFLAGS) $(LDFLAGS) -o $@
+fork_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
+am_fork_la_OBJECTS = fork.lo
+fork_la_OBJECTS = $(am_fork_la_OBJECTS)
+fork_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(fork_la_LDFLAGS) \
+ $(LDFLAGS) -o $@
+ordchr_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
+am_ordchr_la_OBJECTS = ordchr.lo
+ordchr_la_OBJECTS = $(am_ordchr_la_OBJECTS)
+ordchr_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(ordchr_la_LDFLAGS) $(LDFLAGS) -o $@
+readdir_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
+am_readdir_la_OBJECTS = readdir.lo
+readdir_la_OBJECTS = $(am_readdir_la_OBJECTS)
+readdir_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(readdir_la_LDFLAGS) $(LDFLAGS) -o $@
+readfile_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
+am_readfile_la_OBJECTS = readfile.lo
+readfile_la_OBJECTS = $(am_readfile_la_OBJECTS)
+readfile_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(readfile_la_LDFLAGS) $(LDFLAGS) -o $@
+revoutput_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
+am_revoutput_la_OBJECTS = revoutput.lo
+revoutput_la_OBJECTS = $(am_revoutput_la_OBJECTS)
+revoutput_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(revoutput_la_LDFLAGS) $(LDFLAGS) -o $@
+revtwoway_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
+am_revtwoway_la_OBJECTS = revtwoway.lo
+revtwoway_la_OBJECTS = $(am_revtwoway_la_OBJECTS)
+revtwoway_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(revtwoway_la_LDFLAGS) $(LDFLAGS) -o $@
+rwarray_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
+am_rwarray_la_OBJECTS = rwarray.lo
+rwarray_la_OBJECTS = $(am_rwarray_la_OBJECTS)
+rwarray_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(rwarray_la_LDFLAGS) $(LDFLAGS) -o $@
+testext_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
+am_testext_la_OBJECTS = testext.lo
+testext_la_OBJECTS = $(am_testext_la_OBJECTS)
+testext_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(testext_la_LDFLAGS) $(LDFLAGS) -o $@
+time_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
+am_time_la_OBJECTS = time.lo
+time_la_OBJECTS = $(am_time_la_OBJECTS)
+time_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(time_la_LDFLAGS) \
+ $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(filefuncs_la_SOURCES) $(fnmatch_la_SOURCES) \
+ $(fork_la_SOURCES) $(ordchr_la_SOURCES) $(readdir_la_SOURCES) \
+ $(readfile_la_SOURCES) $(revoutput_la_SOURCES) \
+ $(revtwoway_la_SOURCES) $(rwarray_la_SOURCES) \
+ $(testext_la_SOURCES) $(time_la_SOURCES)
+DIST_SOURCES = $(filefuncs_la_SOURCES) $(fnmatch_la_SOURCES) \
+ $(fork_la_SOURCES) $(ordchr_la_SOURCES) $(readdir_la_SOURCES) \
+ $(readfile_la_SOURCES) $(revoutput_la_SOURCES) \
+ $(revtwoway_la_SOURCES) $(rwarray_la_SOURCES) \
+ $(testext_la_SOURCES) $(time_la_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+man3dir = $(mandir)/man3
+NROFF = nroff
+MANS = $(dist_man_MANS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+ cscope distdir dist dist-all distcheck
+ETAGS = etags
+CTAGS = ctags
+CSCOPE = cscope
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ if test -d "$(distdir)"; then \
+ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -rf "$(distdir)" \
+ || { sleep 5 && rm -rf "$(distdir)"; }; \
+ else :; fi
+am__post_remove_distdir = $(am__remove_distdir)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+DIST_TARGETS = dist-gzip
+distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgextensiondir = @pkgextensiondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CPPFLAGS = -I$(srcdir)/..
+
+# This variable insures that aclocal runs
+# correctly after changing configure.ac
+ACLOCAL_AMFLAGS = -I m4
+
+# Note: rwarray does not currently compile.
+pkgextension_LTLIBRARIES = \
+ filefuncs.la \
+ fnmatch.la \
+ fork.la \
+ ordchr.la \
+ readdir.la \
+ readfile.la \
+ revoutput.la \
+ revtwoway.la \
+ rwarray.la \
+ testext.la \
+ time.la
+
+MY_MODULE_FLAGS = -module -avoid-version -no-undefined
+# on Cygwin, gettext requires that we link with -lintl
+MY_LIBS = $(LIBINTL)
+filefuncs_la_SOURCES = filefuncs.c stack.h stack.c gawkfts.h gawkfts.c
+filefuncs_la_LDFLAGS = $(MY_MODULE_FLAGS)
+filefuncs_la_LIBADD = $(MY_LIBS)
+fnmatch_la_SOURCES = fnmatch.c
+fnmatch_la_LDFLAGS = $(MY_MODULE_FLAGS)
+fnmatch_la_LIBADD = $(MY_LIBS)
+fork_la_SOURCES = fork.c
+fork_la_LDFLAGS = $(MY_MODULE_FLAGS)
+fork_la_LIBADD = $(MY_LIBS)
+ordchr_la_SOURCES = ordchr.c
+ordchr_la_LDFLAGS = $(MY_MODULE_FLAGS)
+ordchr_la_LIBADD = $(MY_LIBS)
+readdir_la_SOURCES = readdir.c
+readdir_la_LDFLAGS = $(MY_MODULE_FLAGS)
+readdir_la_LIBADD = $(MY_LIBS)
+readfile_la_SOURCES = readfile.c
+readfile_la_LDFLAGS = $(MY_MODULE_FLAGS)
+readfile_la_LIBADD = $(MY_LIBS)
+revoutput_la_SOURCES = revoutput.c
+revoutput_la_LDFLAGS = $(MY_MODULE_FLAGS)
+revoutput_la_LIBADD = $(MY_LIBS)
+revtwoway_la_SOURCES = revtwoway.c
+revtwoway_la_LDFLAGS = $(MY_MODULE_FLAGS)
+revtwoway_la_LIBADD = $(MY_LIBS)
+rwarray_la_SOURCES = rwarray.c
+rwarray_la_LDFLAGS = $(MY_MODULE_FLAGS)
+rwarray_la_LIBADD = $(MY_LIBS)
+time_la_SOURCES = time.c
+time_la_LDFLAGS = $(MY_MODULE_FLAGS)
+time_la_LIBADD = $(MY_LIBS)
+testext_la_SOURCES = testext.c
+testext_la_LDFLAGS = $(MY_MODULE_FLAGS)
+testext_la_LIBADD = $(MY_LIBS)
+EXTRA_DIST = build-aux/config.rpath \
+ ChangeLog \
+ ChangeLog.0 \
+ fts.3
+
+dist_man_MANS = \
+ filefuncs.3am fnmatch.3am fork.3am ordchr.3am \
+ readdir.3am readfile.3am revoutput.3am \
+ revtwoway.3am rwarray.3am time.3am
+
+
+# gettext requires this
+SUBDIRS =
+all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+am--refresh: Makefile
+ @:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
+ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+ @if test ! -f $@; then rm -f stamp-h1; else :; fi
+ @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
+
+stamp-h1: $(srcdir)/configh.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/configh.in: $(am__configure_deps)
+ ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+ rm -f stamp-h1
+ touch $@
+
+distclean-hdr:
+ -rm -f config.h stamp-h1
+install-pkgextensionLTLIBRARIES: $(pkgextension_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ @list='$(pkgextension_LTLIBRARIES)'; test -n "$(pkgextensiondir)" || list=; \
+ list2=; for p in $$list; do \
+ if test -f $$p; then \
+ list2="$$list2 $$p"; \
+ else :; fi; \
+ done; \
+ test -z "$$list2" || { \
+ echo " $(MKDIR_P) '$(DESTDIR)$(pkgextensiondir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(pkgextensiondir)" || exit 1; \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkgextensiondir)'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkgextensiondir)"; \
+ }
+
+uninstall-pkgextensionLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(pkgextension_LTLIBRARIES)'; test -n "$(pkgextensiondir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkgextensiondir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkgextensiondir)/$$f"; \
+ done
+
+clean-pkgextensionLTLIBRARIES:
+ -test -z "$(pkgextension_LTLIBRARIES)" || rm -f $(pkgextension_LTLIBRARIES)
+ @list='$(pkgextension_LTLIBRARIES)'; \
+ locs=`for p in $$list; do echo $$p; done | \
+ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+ sort -u`; \
+ test -z "$$locs" || { \
+ echo rm -f $${locs}; \
+ rm -f $${locs}; \
+ }
+filefuncs.la: $(filefuncs_la_OBJECTS) $(filefuncs_la_DEPENDENCIES) $(EXTRA_filefuncs_la_DEPENDENCIES)
+ $(filefuncs_la_LINK) -rpath $(pkgextensiondir) $(filefuncs_la_OBJECTS) $(filefuncs_la_LIBADD) $(LIBS)
+fnmatch.la: $(fnmatch_la_OBJECTS) $(fnmatch_la_DEPENDENCIES) $(EXTRA_fnmatch_la_DEPENDENCIES)
+ $(fnmatch_la_LINK) -rpath $(pkgextensiondir) $(fnmatch_la_OBJECTS) $(fnmatch_la_LIBADD) $(LIBS)
+fork.la: $(fork_la_OBJECTS) $(fork_la_DEPENDENCIES) $(EXTRA_fork_la_DEPENDENCIES)
+ $(fork_la_LINK) -rpath $(pkgextensiondir) $(fork_la_OBJECTS) $(fork_la_LIBADD) $(LIBS)
+ordchr.la: $(ordchr_la_OBJECTS) $(ordchr_la_DEPENDENCIES) $(EXTRA_ordchr_la_DEPENDENCIES)
+ $(ordchr_la_LINK) -rpath $(pkgextensiondir) $(ordchr_la_OBJECTS) $(ordchr_la_LIBADD) $(LIBS)
+readdir.la: $(readdir_la_OBJECTS) $(readdir_la_DEPENDENCIES) $(EXTRA_readdir_la_DEPENDENCIES)
+ $(readdir_la_LINK) -rpath $(pkgextensiondir) $(readdir_la_OBJECTS) $(readdir_la_LIBADD) $(LIBS)
+readfile.la: $(readfile_la_OBJECTS) $(readfile_la_DEPENDENCIES) $(EXTRA_readfile_la_DEPENDENCIES)
+ $(readfile_la_LINK) -rpath $(pkgextensiondir) $(readfile_la_OBJECTS) $(readfile_la_LIBADD) $(LIBS)
+revoutput.la: $(revoutput_la_OBJECTS) $(revoutput_la_DEPENDENCIES) $(EXTRA_revoutput_la_DEPENDENCIES)
+ $(revoutput_la_LINK) -rpath $(pkgextensiondir) $(revoutput_la_OBJECTS) $(revoutput_la_LIBADD) $(LIBS)
+revtwoway.la: $(revtwoway_la_OBJECTS) $(revtwoway_la_DEPENDENCIES) $(EXTRA_revtwoway_la_DEPENDENCIES)
+ $(revtwoway_la_LINK) -rpath $(pkgextensiondir) $(revtwoway_la_OBJECTS) $(revtwoway_la_LIBADD) $(LIBS)
+rwarray.la: $(rwarray_la_OBJECTS) $(rwarray_la_DEPENDENCIES) $(EXTRA_rwarray_la_DEPENDENCIES)
+ $(rwarray_la_LINK) -rpath $(pkgextensiondir) $(rwarray_la_OBJECTS) $(rwarray_la_LIBADD) $(LIBS)
+testext.la: $(testext_la_OBJECTS) $(testext_la_DEPENDENCIES) $(EXTRA_testext_la_DEPENDENCIES)
+ $(testext_la_LINK) -rpath $(pkgextensiondir) $(testext_la_OBJECTS) $(testext_la_LIBADD) $(LIBS)
+time.la: $(time_la_OBJECTS) $(time_la_DEPENDENCIES) $(EXTRA_time_la_DEPENDENCIES)
+ $(time_la_LINK) -rpath $(pkgextensiondir) $(time_la_OBJECTS) $(time_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filefuncs.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fnmatch.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fork.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gawkfts.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ordchr.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readdir.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readfile.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/revoutput.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/revtwoway.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rwarray.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testext.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool config.lt
+install-man3: $(dist_man_MANS)
+ @$(NORMAL_INSTALL)
+ @list1=''; \
+ list2='$(dist_man_MANS)'; \
+ test -n "$(man3dir)" \
+ && test -n "`echo $$list1$$list2`" \
+ || exit 0; \
+ echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \
+ { for i in $$list1; do echo "$$i"; done; \
+ if test -n "$$list2"; then \
+ for i in $$list2; do echo "$$i"; done \
+ | sed -n '/\.3[a-z]*$$/p'; \
+ fi; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man3:
+ @$(NORMAL_UNINSTALL)
+ @list=''; test -n "$(man3dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.3[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir)
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+# (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+cscopelist-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) configh.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) configh.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) configh.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) configh.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscope: cscope.files
+ test ! -s cscope.files \
+ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+
+clean-cscope:
+ -rm -f cscope.files
+
+cscope.files: clean-cscope cscopelist-recursive cscopelist
+
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+ -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
+
+distdir: $(DISTFILES)
+ @list='$(MANS)'; if test -n "$$list"; then \
+ list=`for p in $$list; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+ if test -n "$$list" && \
+ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+ echo "error: found man pages containing the 'missing help2man' replacement text:" >&2; \
+ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
+ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+ echo " typically 'make maintainer-clean' will remove them" >&2; \
+ exit 1; \
+ else :; fi; \
+ else :; fi
+ $(am__remove_distdir)
+ test -d "$(distdir)" || mkdir "$(distdir)"
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ $(am__make_dryrun) \
+ || test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+ -test -n "$(am__skip_mode_fix)" \
+ || find "$(distdir)" -type d ! -perm -755 \
+ -exec chmod u+rwx,go+rx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__post_remove_distdir)
+
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+ $(am__post_remove_distdir)
+
+dist-lzip: distdir
+ tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+ $(am__post_remove_distdir)
+
+dist-xz: distdir
+ tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+ $(am__post_remove_distdir)
+
+dist-tarZ: distdir
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__post_remove_distdir)
+
+dist-shar: distdir
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__post_remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__post_remove_distdir)
+
+dist dist-all:
+ $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+ $(am__post_remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lz*) \
+ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
+ *.tar.xz*) \
+ xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir)
+ chmod u+w $(distdir)
+ mkdir $(distdir)/_build $(distdir)/_inst
+ chmod a-w $(distdir)
+ test -d $(distdir)/_build || exit 0; \
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && am__cwd=`pwd` \
+ && $(am__cd) $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(AM_DISTCHECK_CONFIGURE_FLAGS) \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+ && cd "$$am__cwd" \
+ || exit 1
+ $(am__post_remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+ @test -n '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: trying to run $@ with an empty' \
+ '$$(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ $(am__cd) '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(LTLIBRARIES) $(MANS) config.h
+installdirs: installdirs-recursive
+installdirs-am:
+ for dir in "$(DESTDIR)$(pkgextensiondir)" "$(DESTDIR)$(man3dir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool clean-pkgextensionLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-hdr distclean-libtool distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-man install-pkgextensionLTLIBRARIES
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man: install-man3
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-man uninstall-pkgextensionLTLIBRARIES
+
+uninstall-man: uninstall-man3
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
+ cscopelist-recursive ctags-recursive install-am install-strip \
+ tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am am--refresh check check-am clean clean-cscope \
+ clean-generic clean-libtool clean-pkgextensionLTLIBRARIES \
+ cscope cscopelist cscopelist-recursive ctags ctags-recursive \
+ dist dist-all dist-bzip2 dist-gzip dist-lzip dist-shar \
+ dist-tarZ dist-xz dist-zip distcheck distclean \
+ distclean-compile distclean-generic distclean-hdr \
+ distclean-libtool distclean-tags distcleancheck distdir \
+ distuninstallcheck dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-man3 install-pdf install-pdf-am \
+ install-pkgextensionLTLIBRARIES install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am uninstall-man uninstall-man3 \
+ uninstall-pkgextensionLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/extension/NEWS b/extension/NEWS
new file mode 100644
index 00000000..b3b2e56f
--- /dev/null
+++ b/extension/NEWS
@@ -0,0 +1,7 @@
+ Copyright (C) 2012 Free Software Foundation, Inc.
+
+ Copying and distribution of this file, with or without modification,
+ are permitted in any medium without royalty provided the copyright
+ notice and this notice are preserved.
+
+Extensions now build separately.
diff --git a/extension/README b/extension/README
new file mode 100644
index 00000000..aa404700
--- /dev/null
+++ b/extension/README
@@ -0,0 +1,10 @@
+ Copyright (C) 2005, 2006, 2007, 2009, 2010, 2011, 2012
+ Free Software Foundation, Inc.
+
+ Copying and distribution of this file, with or without modification,
+ are permitted in any medium without royalty provided the copyright
+ notice and this notice are preserved.
+
+README:
+
+This directory contain the standard bundled extensions for GNU Awk.
diff --git a/extension/README.fts b/extension/README.fts
new file mode 100644
index 00000000..b8b948c4
--- /dev/null
+++ b/extension/README.fts
@@ -0,0 +1,68 @@
+Wed Aug 29 22:34:24 IDT 2012
+============================
+
+Portability is a myth, a chimera. Like the pot of gold at the end of
+the rainbow, it's always looks like it is just within your reach, but
+in fact, it is seldom, if ever, truly acheivable.
+
+It all started when trying to get the extensions to work on my aged
+PowerPC Macbook G4 running Mac OS X 10.5. That machine is wonderful,
+since it is neither an Intel architecture machine nor is it GNU/Linux;
+two criteria that are becoming increasingly harder to meet over 10%
+into the 21st century.
+
+The readdir extension didn't work. Furthermore, GDB showed that in gawk
+itself, struct stat had one size and layout, while inside the readdir
+code, it had another.
+
+This turned out to be due to the large file nonsense foisted off upon
+us by POSIX. The main gawk configure.ac had AC_SYS_LARGEFILE but the
+extensions' configure.ac did not. OK - a one line fix, rebuild, and
+everything is OK. Right?
+
+Of course not.
+
+Everything was OK on my 64-bit GNU/Linux Intel system, but lo and behold,
+I compiled on a 32-bit GNU/Linux system and suddenly the fts tests
+stopped working. A look at the config.log reveals:
+
+ <fts.h> cannot be used with -D_FILE_OFFSET_BITS==64
+
+Why? Who knows. The comment in the file itself is cryptic:
+
+ /* The fts interface is incompatible with the LFS interface which
+ transparently uses the 64-bit file access functions. */
+ #ifdef __USE_FILE_OFFSET64
+ # error "<fts.h> cannot be used with -D_FILE_OFFSET_BITS==64"
+ #endif
+
+It purports to be English, but says nothing intelligible, and the man
+page sheds no light, either.
+
+Fortunately, the source for fts from NetBSD is reasonably legible,
+freely available, and has a usable license.
+
+So, I try to just plug it in directly. Everything compiles, nothing
+works. There is shared library / weird linker dark voodoo crap going on.
+
+*I* am not a powerful enough Jedi to get around it, and I think it has
+more to do with the Dark Side of the Force than with the Light Side. So
+gawkfts.h now has:
+
+ #define fts_children gawk_fts_children
+ #define fts_close gawk_fts_close
+ #define fts_open gawk_fts_open
+ #define fts_read gawk_fts_read
+ #define fts_set gawk_fts_set
+
+to rename things, and it all compiles and works.
+
+The Plan 9 guys got it right when they threw eveything out and started
+over again. I sure wish I could.
+
+On the bright side, this is stuff that would have had to be done anyway
+for at least MinGW, and maybe for some other systems. So it's not wasted
+effort. But it sure is sad that it's necessary.
+
+Arnold Robbins
+arnold@skeeve.com
diff --git a/extension/aclocal.m4 b/extension/aclocal.m4
new file mode 100644
index 00000000..4358745f
--- /dev/null
+++ b/extension/aclocal.m4
@@ -0,0 +1,1017 @@
+# generated automatically by aclocal 1.12.4 -*- Autoconf -*-
+
+# Copyright (C) 1996-2012 Free Software Foundation, Inc.
+
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
+
+# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.12'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.12.4], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.12.4])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# Copyright (C) 2011-2012 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_AR([ACT-IF-FAIL])
+# -------------------------
+# Try to determine the archiver interface, and trigger the ar-lib wrapper
+# if it is needed. If the detection of archiver interface fails, run
+# ACT-IF-FAIL (default is to abort configure with a proper error message).
+AC_DEFUN([AM_PROG_AR],
+[AC_BEFORE([$0], [LT_INIT])dnl
+AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([ar-lib])dnl
+AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false])
+: ${AR=ar}
+
+AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface],
+ [am_cv_ar_interface=ar
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])],
+ [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
+ AC_TRY_EVAL([am_ar_try])
+ if test "$ac_status" -eq 0; then
+ am_cv_ar_interface=ar
+ else
+ am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
+ AC_TRY_EVAL([am_ar_try])
+ if test "$ac_status" -eq 0; then
+ am_cv_ar_interface=lib
+ else
+ am_cv_ar_interface=unknown
+ fi
+ fi
+ rm -f conftest.lib libconftest.a
+ ])
+ ])
+
+case $am_cv_ar_interface in
+ar)
+ ;;
+lib)
+ # Microsoft lib, so override with the ar-lib wrapper script.
+ # FIXME: It is wrong to rewrite AR.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__AR in this case,
+ # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
+ # similar.
+ AR="$am_aux_dir/ar-lib $AR"
+ ;;
+unknown)
+ m4_default([$1],
+ [AC_MSG_ERROR([could not determine $AR interface])])
+ ;;
+esac
+AC_SUBST([AR])dnl
+])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
+# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is '.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997-2012 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ([2.52])dnl
+ m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999-2012 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+
+# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
+ [$1], [CXX], [depcc="$CXX" am_compiler_list=],
+ [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
+ [$1], [UPC], [depcc="$UPC" am_compiler_list=],
+ [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ am__universal=false
+ m4_case([$1], [CC],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac],
+ [CXX],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac])
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE([dependency-tracking], [dnl
+AS_HELP_STRING(
+ [--enable-dependency-tracking],
+ [do not reject slow dependency extractors])
+AS_HELP_STRING(
+ [--disable-dependency-tracking],
+ [speeds up one-time build])])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ am__nodep='_no'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999-2012 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+ # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named 'Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running 'make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each '.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996-2012 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.62])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[AC_DIAGNOSE([obsolete],
+[$0: two- and three-arguments forms are deprecated. For more info, see:
+http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation])
+m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(
+ m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+ [ok:ok],,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
+ AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+AM_MISSING_PROG([AUTOCONF], [autoconf])
+AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+AM_MISSING_PROG([AUTOHEADER], [autoheader])
+AM_MISSING_PROG([MAKEINFO], [makeinfo])
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES([CC])],
+ [m4_define([AC_PROG_CC],
+ m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES([CXX])],
+ [m4_define([AC_PROG_CXX],
+ m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES([OBJC])],
+ [m4_define([AC_PROG_OBJC],
+ m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
+dnl Support for Objective C++ was only introduced in Autoconf 2.65,
+dnl but we still cater to Autoconf 2.62.
+m4_ifdef([AC_PROG_OBJCXX],
+[AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+ [_AM_DEPENDENCIES([OBJCXX])],
+ [m4_define([AC_PROG_OBJCXX],
+ m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+ [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+AC_SUBST([install_sh])])
+
+# Copyright (C) 2003-2012 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997-2012 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ AC_MSG_WARN(['missing' script is too old or missing])
+fi
+])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# --------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996-2012 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[[\\\"\#\$\&\'\`$am_lf]]*)
+ AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+ *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
+ AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+ alias in your environment])
+ fi
+ if test "$[2]" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT([yes])
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+AC_CONFIG_COMMANDS_PRE(
+ [AC_MSG_CHECKING([that generated files are newer than configure])
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ AC_MSG_RESULT([done])])
+rm -f conftest.file
+])
+
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor 'install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in "make install-strip", and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip". However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006-2012 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# --------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004-2012 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of 'v7', 'ustar', or 'pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
+m4_if([$1], [v7],
+ [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+ [m4_case([$1], [ustar],, [pax],,
+ [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of '-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([m4/gettext.m4])
+m4_include([m4/iconv.m4])
+m4_include([m4/intlmacosx.m4])
+m4_include([m4/lib-ld.m4])
+m4_include([m4/lib-link.m4])
+m4_include([m4/lib-prefix.m4])
+m4_include([m4/libtool.m4])
+m4_include([m4/ltoptions.m4])
+m4_include([m4/ltsugar.m4])
+m4_include([m4/ltversion.m4])
+m4_include([m4/lt~obsolete.m4])
+m4_include([m4/nls.m4])
+m4_include([m4/po.m4])
+m4_include([m4/progtest.m4])
diff --git a/extension/arrayparm.c b/extension/arrayparm.c
deleted file mode 100644
index 8a550ace..00000000
--- a/extension/arrayparm.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * arrayparm.c --- figure out how to make a parameter be an array
- *
- * Arnold Robbins
- * arnold@skeeve.com
- * 10/2001
- *
- * Revised 7/2003
- * Revised 6/2004
- */
-
-/*
- * Copyright (C) 2001, 2003, 2004, 2011 the Free Software Foundation, Inc.
- *
- * This file is part of GAWK, the GNU implementation of the
- * AWK Programming Language.
- *
- * GAWK is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * GAWK is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "awk.h"
-
-int plugin_is_GPL_compatible;
-
-/* do_mkarray --- turn a variable into an array */
-
-/*
- * From awk, call
- *
- * mkarray(var, sub, val)
- */
-
-static NODE *
-do_mkarray(int args)
-{
- int ret = -1;
- NODE *var, *sub, *val;
- NODE **elemval;
-
- if (do_lint && get_curfunc_arg_count() > 3)
- lintwarn("mkarray: called with too many arguments");
-
- var = get_array_argument(0, FALSE);
- sub = get_scalar_argument(1, FALSE);
- val = get_scalar_argument(2, FALSE);
-
- printf("var->type = %s\n", nodetype2str(var->type));
- printf("sub->type = %s\n", nodetype2str(sub->type));
- printf("val->type = %s\n", nodetype2str(val->type));
-
- assoc_clear(var);
-
- elemval = assoc_lookup(var, sub, 0);
- *elemval = dupnode(val);
- ret = 0;
-
- /* Set the return value */
- return make_number((AWKNUM) ret);
-}
-
-/* dlload --- load new builtins in this library */
-
-NODE *
-dlload(tree, dl)
-NODE *tree;
-void *dl;
-{
- make_builtin("mkarray", do_mkarray, 3);
-
- return make_number((AWKNUM) 0);
-}
diff --git a/extension/build-aux/ChangeLog b/extension/build-aux/ChangeLog
new file mode 100644
index 00000000..550af973
--- /dev/null
+++ b/extension/build-aux/ChangeLog
@@ -0,0 +1,8 @@
+2012-07-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * config.rpath: New file.
+
+2012-05-21 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * ar-lib, config.guess, config.sub, depcomp, install-sh, ltmain.sh,
+ missing: New files related to autoconf and libtool.
diff --git a/extension/build-aux/ar-lib b/extension/build-aux/ar-lib
new file mode 100755
index 00000000..67f5f36f
--- /dev/null
+++ b/extension/build-aux/ar-lib
@@ -0,0 +1,270 @@
+#! /bin/sh
+# Wrapper for Microsoft lib.exe
+
+me=ar-lib
+scriptversion=2012-03-01.08; # UTC
+
+# Copyright (C) 2010-2012 Free Software Foundation, Inc.
+# Written by Peter Rosin <peda@lysator.liu.se>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+
+# func_error message
+func_error ()
+{
+ echo "$me: $1" 1>&2
+ exit 1
+}
+
+file_conv=
+
+# func_file_conv build_file
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts.
+func_file_conv ()
+{
+ file=$1
+ case $file in
+ / | /[!/]*) # absolute file, and not a UNC file
+ if test -z "$file_conv"; then
+ # lazily determine how to convert abs files
+ case `uname -s` in
+ MINGW*)
+ file_conv=mingw
+ ;;
+ CYGWIN*)
+ file_conv=cygwin
+ ;;
+ *)
+ file_conv=wine
+ ;;
+ esac
+ fi
+ case $file_conv in
+ mingw)
+ file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+ ;;
+ cygwin)
+ file=`cygpath -m "$file" || echo "$file"`
+ ;;
+ wine)
+ file=`winepath -w "$file" || echo "$file"`
+ ;;
+ esac
+ ;;
+ esac
+}
+
+# func_at_file at_file operation archive
+# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE
+# for each of them.
+# When interpreting the content of the @FILE, do NOT use func_file_conv,
+# since the user would need to supply preconverted file names to
+# binutils ar, at least for MinGW.
+func_at_file ()
+{
+ operation=$2
+ archive=$3
+ at_file_contents=`cat "$1"`
+ eval set x "$at_file_contents"
+ shift
+
+ for member
+ do
+ $AR -NOLOGO $operation:"$member" "$archive" || exit $?
+ done
+}
+
+case $1 in
+ '')
+ func_error "no command. Try '$0 --help' for more information."
+ ;;
+ -h | --h*)
+ cat <<EOF
+Usage: $me [--help] [--version] PROGRAM ACTION ARCHIVE [MEMBER...]
+
+Members may be specified in a file named with @FILE.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "$me, version $scriptversion"
+ exit $?
+ ;;
+esac
+
+if test $# -lt 3; then
+ func_error "you must specify a program, an action and an archive"
+fi
+
+AR=$1
+shift
+while :
+do
+ if test $# -lt 2; then
+ func_error "you must specify a program, an action and an archive"
+ fi
+ case $1 in
+ -lib | -LIB \
+ | -ltcg | -LTCG \
+ | -machine* | -MACHINE* \
+ | -subsystem* | -SUBSYSTEM* \
+ | -verbose | -VERBOSE \
+ | -wx* | -WX* )
+ AR="$AR $1"
+ shift
+ ;;
+ *)
+ action=$1
+ shift
+ break
+ ;;
+ esac
+done
+orig_archive=$1
+shift
+func_file_conv "$orig_archive"
+archive=$file
+
+# strip leading dash in $action
+action=${action#-}
+
+delete=
+extract=
+list=
+quick=
+replace=
+index=
+create=
+
+while test -n "$action"
+do
+ case $action in
+ d*) delete=yes ;;
+ x*) extract=yes ;;
+ t*) list=yes ;;
+ q*) quick=yes ;;
+ r*) replace=yes ;;
+ s*) index=yes ;;
+ S*) ;; # the index is always updated implicitly
+ c*) create=yes ;;
+ u*) ;; # TODO: don't ignore the update modifier
+ v*) ;; # TODO: don't ignore the verbose modifier
+ *)
+ func_error "unknown action specified"
+ ;;
+ esac
+ action=${action#?}
+done
+
+case $delete$extract$list$quick$replace,$index in
+ yes,* | ,yes)
+ ;;
+ yesyes*)
+ func_error "more than one action specified"
+ ;;
+ *)
+ func_error "no action specified"
+ ;;
+esac
+
+if test -n "$delete"; then
+ if test ! -f "$orig_archive"; then
+ func_error "archive not found"
+ fi
+ for member
+ do
+ case $1 in
+ @*)
+ func_at_file "${1#@}" -REMOVE "$archive"
+ ;;
+ *)
+ func_file_conv "$1"
+ $AR -NOLOGO -REMOVE:"$file" "$archive" || exit $?
+ ;;
+ esac
+ done
+
+elif test -n "$extract"; then
+ if test ! -f "$orig_archive"; then
+ func_error "archive not found"
+ fi
+ if test $# -gt 0; then
+ for member
+ do
+ case $1 in
+ @*)
+ func_at_file "${1#@}" -EXTRACT "$archive"
+ ;;
+ *)
+ func_file_conv "$1"
+ $AR -NOLOGO -EXTRACT:"$file" "$archive" || exit $?
+ ;;
+ esac
+ done
+ else
+ $AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member
+ do
+ $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
+ done
+ fi
+
+elif test -n "$quick$replace"; then
+ if test ! -f "$orig_archive"; then
+ if test -z "$create"; then
+ echo "$me: creating $orig_archive"
+ fi
+ orig_archive=
+ else
+ orig_archive=$archive
+ fi
+
+ for member
+ do
+ case $1 in
+ @*)
+ func_file_conv "${1#@}"
+ set x "$@" "@$file"
+ ;;
+ *)
+ func_file_conv "$1"
+ set x "$@" "$file"
+ ;;
+ esac
+ shift
+ shift
+ done
+
+ if test -n "$orig_archive"; then
+ $AR -NOLOGO -OUT:"$archive" "$orig_archive" "$@" || exit $?
+ else
+ $AR -NOLOGO -OUT:"$archive" "$@" || exit $?
+ fi
+
+elif test -n "$list"; then
+ if test ! -f "$orig_archive"; then
+ func_error "archive not found"
+ fi
+ $AR -NOLOGO -LIST "$archive" || exit $?
+fi
diff --git a/extension/build-aux/config.guess b/extension/build-aux/config.guess
new file mode 100755
index 00000000..aa04f04b
--- /dev/null
+++ b/extension/build-aux/config.guess
@@ -0,0 +1,1534 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+# 2011, 2012 Free Software Foundation, Inc.
+
+timestamp='2012-06-17'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Originally written by Per Bothner. Please send patches (context
+# diff format) to <config-patches@gnu.org> and include a ChangeLog
+# entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# exits with 0. Otherwise, it exits with 1.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ sh5el) machine=sh5le-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ELF__
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit ;;
+ *:Bitrig:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+ exit ;;
+ *:OpenBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ exit ;;
+ *:ekkoBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ exit ;;
+ *:SolidBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ exit ;;
+ macppc:MirBSD:*:*)
+ echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ *:MirBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ alpha:OSF1:*:*)
+ case $UNAME_RELEASE in
+ *4.0)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE="alpha" ;;
+ "EV5 (21164)")
+ UNAME_MACHINE="alphaev5" ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE="alphaev56" ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE="alphapca56" ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE="alphapca57" ;;
+ "EV6 (21264)")
+ UNAME_MACHINE="alphaev6" ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE="alphaev67" ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE="alphaev69" ;;
+ "EV7 (21364)")
+ UNAME_MACHINE="alphaev7" ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
+ # A Pn.n version is a patched version.
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+ exitcode=$?
+ trap '' 0
+ exit $exitcode ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
+ exit ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit ;;
+ arm:riscos:*:*|arm:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit ;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7; exit ;;
+ esac ;;
+ s390x:SunOS:*:*)
+ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+ echo i386-pc-auroraux${UNAME_RELEASE}
+ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ eval $set_cc_for_build
+ SUN_ARCH="i386"
+ # If there is a compiler, see if it is configured for 64-bit objects.
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ SUN_ARCH="x86_64"
+ fi
+ fi
+ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c &&
+ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`$dummy $dummyarg` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+ then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ then
+ echo "$SYSTEM_NAME"
+ else
+ echo rs6000-ibm-aix3.2.5
+ fi
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit ;;
+ *:AIX:*:[4567])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+ eval $set_cc_for_build
+
+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
+ # generating 64-bit code. GNU and HP use different nomenclature:
+ #
+ # $ CC_FOR_BUILD=cc ./config.guess
+ # => hppa2.0w-hp-hpux11.23
+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ grep -q __LP64__
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit ;;
+ 3050*:HI-UX:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo unknown-hitachi-hiuxwe2
+ exit ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ *:UNICOS/mp:*:*)
+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ 5000:UNIX_System_V:4.*:*)
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:FreeBSD:*:*)
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ case ${UNAME_PROCESSOR} in
+ amd64)
+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ *)
+ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ esac
+ exit ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit ;;
+ *:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit ;;
+ i*:MSYS*:*)
+ echo ${UNAME_MACHINE}-pc-msys
+ exit ;;
+ i*:windows32*:*)
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit ;;
+ *:Interix*:*)
+ case ${UNAME_MACHINE} in
+ x86)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+ authenticamd | genuineintel | EM64T)
+ echo x86_64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ IA64)
+ echo ia64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ esac ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit ;;
+ 8664:Windows_NT:*)
+ echo x86_64-pc-mks
+ exit ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i586-pc-interix
+ exit ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit ;;
+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+ echo x86_64-unknown-cygwin
+ exit ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+ exit ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ *:GNU:*:*)
+ # the GNU system
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ exit ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit ;;
+ aarch64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ aarch64_be:Linux:*:*)
+ UNAME_MACHINE=aarch64_be
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep -q ld.so.1
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit ;;
+ arm*:Linux:*:*)
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ else
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
+ fi
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ cris:Linux:*:*)
+ echo ${UNAME_MACHINE}-axis-linux-gnu
+ exit ;;
+ crisv32:Linux:*:*)
+ echo ${UNAME_MACHINE}-axis-linux-gnu
+ exit ;;
+ frv:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ hexagon:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ i*86:Linux:*:*)
+ LIBC=gnu
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ exit ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ m32r*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ mips:Linux:*:* | mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef ${UNAME_MACHINE}
+ #undef ${UNAME_MACHINE}el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=${UNAME_MACHINE}el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=${UNAME_MACHINE}
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ ;;
+ or32:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ padre:Linux:*:*)
+ echo sparc-unknown-linux-gnu
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
+ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-gnu ;;
+ PA8*) echo hppa2.0-unknown-linux-gnu ;;
+ *) echo hppa-unknown-linux-gnu ;;
+ esac
+ exit ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-gnu
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-gnu
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ tile*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ vax:Linux:*:*)
+ echo ${UNAME_MACHINE}-dec-linux-gnu
+ exit ;;
+ x86_64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ xtensa*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit ;;
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit ;;
+ i*86:*:5:[678]*)
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i586.
+ # Note: whatever this is, it MUST be the same as what config.sub
+ # prints for the "djgpp" host, or else GDB configury will decide that
+ # this is a cross-build.
+ echo i586-pc-msdosdjgpp
+ exit ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit ;;
+ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+ OS_REL='.3'
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit ;;
+ i*86:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo ${UNAME_MACHINE}-stratus-vos
+ exit ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit ;;
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
+ echo i586-pc-haiku
+ exit ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-7:SUPER-UX:*:*)
+ echo sx7-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8:SUPER-UX:*:*)
+ echo sx8-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8R:SUPER-UX:*:*)
+ echo sx8r-nec-superux${UNAME_RELEASE}
+ exit ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Darwin:*:*)
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ case $UNAME_PROCESSOR in
+ i386)
+ eval $set_cc_for_build
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ UNAME_PROCESSOR="x86_64"
+ fi
+ fi ;;
+ unknown) UNAME_PROCESSOR=powerpc ;;
+ esac
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ exit ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = "x86"; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ exit ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit ;;
+ NEO-?:NONSTOP_KERNEL:*:*)
+ echo neo-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSE-*:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSR-?:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = "386"; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
+ exit ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit ;;
+ i*86:skyos:*:*)
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ exit ;;
+ i*86:rdos:*:*)
+ echo ${UNAME_MACHINE}-pc-rdos
+ exit ;;
+ i*86:AROS:*:*)
+ echo ${UNAME_MACHINE}-pc-aros
+ exit ;;
+ x86_64:VMkernel:*:*)
+ echo ${UNAME_MACHINE}-unknown-esx
+ exit ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+# include <sys/param.h>
+# if defined (BSD)
+# if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+# else
+# if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# endif
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# else
+ printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ c34*)
+ echo c34-convex-bsd
+ exit ;;
+ c38*)
+ echo c38-convex-bsd
+ exit ;;
+ c4*)
+ echo c4-convex-bsd
+ exit ;;
+ esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/extension/build-aux/config.rpath b/extension/build-aux/config.rpath
new file mode 100755
index 00000000..17298f23
--- /dev/null
+++ b/extension/build-aux/config.rpath
@@ -0,0 +1,672 @@
+#! /bin/sh
+# Output a system dependent set of variables, describing how to set the
+# run time search path of shared libraries in an executable.
+#
+# Copyright 1996-2010 Free Software Foundation, Inc.
+# Taken from GNU libtool, 2001
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# The first argument passed to this file is the canonical host specification,
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
+# should be set by the caller.
+#
+# The set of defined variables is at the end of this script.
+
+# Known limitations:
+# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
+# than 256 bytes, otherwise the compiler driver will dump core. The only
+# known workaround is to choose shorter directory names for the build
+# directory and/or the installation directory.
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+shrext=.so
+
+host="$1"
+host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+# Code taken from libtool.m4's _LT_CC_BASENAME.
+
+for cc_temp in $CC""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
+
+# Code taken from libtool.m4's _LT_COMPILER_PIC.
+
+wl=
+if test "$GCC" = yes; then
+ wl='-Wl,'
+else
+ case "$host_os" in
+ aix*)
+ wl='-Wl,'
+ ;;
+ darwin*)
+ case $cc_basename in
+ xlc*)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ wl='-Wl,'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ wl='-Wl,'
+ ;;
+ newsos6)
+ ;;
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ ecc*)
+ wl='-Wl,'
+ ;;
+ icc* | ifort*)
+ wl='-Wl,'
+ ;;
+ lf95*)
+ wl='-Wl,'
+ ;;
+ pgcc | pgf77 | pgf90)
+ wl='-Wl,'
+ ;;
+ ccc*)
+ wl='-Wl,'
+ ;;
+ como)
+ wl='-lopt='
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ osf3* | osf4* | osf5*)
+ wl='-Wl,'
+ ;;
+ rdos*)
+ ;;
+ solaris*)
+ wl='-Wl,'
+ ;;
+ sunos4*)
+ wl='-Qoption ld '
+ ;;
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ wl='-Wl,'
+ ;;
+ sysv4*MP*)
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ wl='-Wl,'
+ ;;
+ unicos*)
+ wl='-Wl,'
+ ;;
+ uts4*)
+ ;;
+ esac
+fi
+
+# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
+
+hardcode_libdir_flag_spec=
+hardcode_libdir_separator=
+hardcode_direct=no
+hardcode_minus_L=no
+
+case "$host_os" in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+esac
+
+ld_shlibs=yes
+if test "$with_gnu_ld" = yes; then
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ # Unlike libtool, we use -rpath here, not --rpath, since the documented
+ # option of GNU ld is called -rpath, not --rpath.
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ case "$host_os" in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ fi
+ ;;
+ amigaos*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we cannot use
+ # them.
+ ld_shlibs=no
+ ;;
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ cygwin* | mingw* | pw32* | cegcc*)
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ interix[3-9]*)
+ hardcode_direct=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ gnu* | linux* | k*bsd*-gnu)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ netbsd*)
+ ;;
+ solaris*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+ sunos4*)
+ hardcode_direct=yes
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ if test "$ld_shlibs" = no; then
+ hardcode_libdir_flag_spec=
+ fi
+else
+ case "$host_os" in
+ aix3*)
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ else
+ aix_use_runtimelinking=no
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+ fi
+ hardcode_direct=yes
+ hardcode_libdir_separator=':'
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ fi
+ # Begin _LT_AC_SYS_LIBPATH_AIX.
+ echo 'int main () { return 0; }' > conftest.c
+ ${CC} ${LDFLAGS} conftest.c -o conftest
+ aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ fi
+ if test -z "$aix_libpath"; then
+ aix_libpath="/usr/lib:/lib"
+ fi
+ rm -f conftest.c conftest
+ # End _LT_AC_SYS_LIBPATH_AIX.
+ if test "$aix_use_runtimelinking" = yes; then
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ else
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ fi
+ fi
+ ;;
+ amigaos*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ # see comment about different semantics on the GNU ld section
+ ld_shlibs=no
+ ;;
+ bsdi[45]*)
+ ;;
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec=' '
+ libext=lib
+ ;;
+ darwin* | rhapsody*)
+ hardcode_direct=no
+ if test "$GCC" = yes ; then
+ :
+ else
+ case $cc_basename in
+ xlc*)
+ ;;
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+ fi
+ ;;
+ dgux*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ freebsd1*)
+ ld_shlibs=no
+ ;;
+ freebsd2.2*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ freebsd2*)
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ freebsd* | dragonfly*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ hpux9*)
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ hpux10*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+ hpux11*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ ;;
+ *)
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+ irix5* | irix6* | nonstopux*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ netbsd*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ newsos6)
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct=yes
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ else
+ case "$host_os" in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ osf3*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ osf4* | osf5*)
+ if test "$GCC" = yes; then
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ # Both cc and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ hardcode_libdir_separator=:
+ ;;
+ solaris*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ sunos4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ sysv4)
+ case $host_vendor in
+ sni)
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ hardcode_direct=no
+ ;;
+ motorola)
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ ;;
+ sysv4.3*)
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ ld_shlibs=yes
+ fi
+ ;;
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ ;;
+ sysv5* | sco3.2v5* | sco5v6*)
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ hardcode_libdir_separator=':'
+ ;;
+ uts4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+fi
+
+# Check dynamic linker characteristics
+# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
+# Unlike libtool.m4, here we don't care about _all_ names of the library, but
+# only about the one the linker finds when passed -lNAME. This is the last
+# element of library_names_spec in libtool.m4, or possibly two of them if the
+# linker has special search rules.
+library_names_spec= # the last element of library_names_spec in libtool.m4
+libname_spec='lib$name'
+case "$host_os" in
+ aix3*)
+ library_names_spec='$libname.a'
+ ;;
+ aix[4-9]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ amigaos*)
+ library_names_spec='$libname.a'
+ ;;
+ beos*)
+ library_names_spec='$libname$shrext'
+ ;;
+ bsdi[45]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ cygwin* | mingw* | pw32* | cegcc*)
+ shrext=.dll
+ library_names_spec='$libname.dll.a $libname.lib'
+ ;;
+ darwin* | rhapsody*)
+ shrext=.dylib
+ library_names_spec='$libname$shrext'
+ ;;
+ dgux*)
+ library_names_spec='$libname$shrext'
+ ;;
+ freebsd1*)
+ ;;
+ freebsd* | dragonfly*)
+ case "$host_os" in
+ freebsd[123]*)
+ library_names_spec='$libname$shrext$versuffix' ;;
+ *)
+ library_names_spec='$libname$shrext' ;;
+ esac
+ ;;
+ gnu*)
+ library_names_spec='$libname$shrext'
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $host_cpu in
+ ia64*)
+ shrext=.so
+ ;;
+ hppa*64*)
+ shrext=.sl
+ ;;
+ *)
+ shrext=.sl
+ ;;
+ esac
+ library_names_spec='$libname$shrext'
+ ;;
+ interix[3-9]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ library_names_spec='$libname$shrext'
+ case "$host_os" in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
+ *) libsuff= shlibsuff= ;;
+ esac
+ ;;
+ esac
+ ;;
+ linux*oldld* | linux*aout* | linux*coff*)
+ ;;
+ linux* | k*bsd*-gnu)
+ library_names_spec='$libname$shrext'
+ ;;
+ knetbsd*-gnu)
+ library_names_spec='$libname$shrext'
+ ;;
+ netbsd*)
+ library_names_spec='$libname$shrext'
+ ;;
+ newsos6)
+ library_names_spec='$libname$shrext'
+ ;;
+ nto-qnx*)
+ library_names_spec='$libname$shrext'
+ ;;
+ openbsd*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ os2*)
+ libname_spec='$name'
+ shrext=.dll
+ library_names_spec='$libname.a'
+ ;;
+ osf3* | osf4* | osf5*)
+ library_names_spec='$libname$shrext'
+ ;;
+ rdos*)
+ ;;
+ solaris*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sunos4*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ sysv4 | sysv4.3*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sysv4*MP*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ library_names_spec='$libname$shrext'
+ ;;
+ uts4*)
+ library_names_spec='$libname$shrext'
+ ;;
+esac
+
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
+shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
+escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+
+LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
+
+# How to pass a linker flag through the compiler.
+wl="$escaped_wl"
+
+# Static library suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally "so").
+shlibext="$shlibext"
+
+# Format of library name prefix.
+libname_spec="$escaped_libname_spec"
+
+# Library names that the linker finds when passed -lNAME.
+library_names_spec="$escaped_library_names_spec"
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator="$hardcode_libdir_separator"
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct="$hardcode_direct"
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L="$hardcode_minus_L"
+
+EOF
diff --git a/extension/build-aux/config.sub b/extension/build-aux/config.sub
new file mode 100755
index 00000000..aa2cf19b
--- /dev/null
+++ b/extension/build-aux/config.sub
@@ -0,0 +1,1782 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+# 2011, 2012 Free Software Foundation, Inc.
+
+timestamp='2012-06-17'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine. It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted GNU ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit ;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ android-linux)
+ os=-linux-android
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis | -knuth | -cray | -microblaze)
+ os=
+ basic_machine=$1
+ ;;
+ -bluegene*)
+ os=-cnk
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco6)
+ os=-sco5v6
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*178)
+ os=-lynxos178
+ ;;
+ -lynx*5)
+ os=-lynxos5
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | aarch64 | aarch64_be \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+ | be32 | be64 \
+ | bfin \
+ | c4x | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | epiphany \
+ | fido | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | hexagon \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k | iq2000 \
+ | le32 | le64 \
+ | lm32 \
+ | m32c | m32r | m32rle | m68000 | m68k | m88k \
+ | maxq | mb | microblaze | mcore | mep | metag \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64octeon | mips64octeonel \
+ | mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | moxie \
+ | mt \
+ | msp430 \
+ | nds32 | nds32le | nds32be \
+ | nios | nios2 \
+ | ns16k | ns32k \
+ | open8 \
+ | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle \
+ | pyramid \
+ | rl78 | rx \
+ | score \
+ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+ | spu \
+ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+ | ubicom32 \
+ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+ | we32k \
+ | x86 | xc16x | xstormy16 | xtensa \
+ | z8k | z80)
+ basic_machine=$basic_machine-unknown
+ ;;
+ c54x)
+ basic_machine=tic54x-unknown
+ ;;
+ c55x)
+ basic_machine=tic55x-unknown
+ ;;
+ c6x)
+ basic_machine=tic6x-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+ ms1)
+ basic_machine=mt-unknown
+ ;;
+
+ strongarm | thumb | xscale)
+ basic_machine=arm-unknown
+ ;;
+ xgate)
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ xscaleeb)
+ basic_machine=armeb-unknown
+ ;;
+
+ xscaleel)
+ basic_machine=armel-unknown
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | aarch64-* | aarch64_be-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* | avr32-* \
+ | be32-* | be64-* \
+ | bfin-* | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* \
+ | clipper-* | craynv-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | hexagon-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* | iq2000-* \
+ | le32-* | le64-* \
+ | lm32-* \
+ | m32c-* | m32r-* | m32rle-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64octeon-* | mips64octeonel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64r5900-* | mips64r5900el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mips64vr5900-* | mips64vr5900el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
+ | mmix-* \
+ | mt-* \
+ | msp430-* \
+ | nds32-* | nds32le-* | nds32be-* \
+ | nios-* | nios2-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+ | open8-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+ | pyramid-* \
+ | rl78-* | romp-* | rs6000-* | rx-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+ | tahoe-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tile*-* \
+ | tron-* \
+ | ubicom32-* \
+ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+ | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* \
+ | xstormy16-* | xtensa*-* \
+ | ymp-* \
+ | z8k-* | z80-*)
+ ;;
+ # Recognize the basic CPU types without company name, with glob match.
+ xtensa*)
+ basic_machine=$basic_machine-unknown
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ abacus)
+ basic_machine=abacus-unknown
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amd64-*)
+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aros)
+ basic_machine=i386-pc
+ os=-aros
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ os=-linux
+ ;;
+ blackfin-*)
+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ bluegene*)
+ basic_machine=powerpc-ibm
+ os=-cnk
+ ;;
+ c54x-*)
+ basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c55x-*)
+ basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c6x-*)
+ basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ cegcc)
+ basic_machine=arm-unknown
+ os=-cegcc
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+ cr16 | cr16-*)
+ basic_machine=cr16-unknown
+ os=-elf
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ crisv32 | crisv32-* | etraxfs*)
+ basic_machine=crisv32-axis
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ crx)
+ basic_machine=crx-unknown
+ os=-elf
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+ os=-dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=-linux
+ ;;
+ m68knommu-*)
+ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ microblaze)
+ basic_machine=microblaze-xilinx
+ ;;
+ mingw32)
+ basic_machine=i386-pc
+ os=-mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ os=-mingw32ce
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ ms1-*)
+ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+ ;;
+ msys)
+ basic_machine=i386-pc
+ os=-msys
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ nacl)
+ basic_machine=le32-unknown
+ os=-nacl
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ neo-tandem)
+ basic_machine=neo-tandem
+ ;;
+ nse-tandem)
+ basic_machine=nse-tandem
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ openrisc | openrisc-*)
+ basic_machine=or32-unknown
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=-os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ os=-linux
+ ;;
+ parisc-*)
+ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pc98)
+ basic_machine=i386-pc
+ ;;
+ pc98-*)
+ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc | ppcbe) basic_machine=powerpc-unknown
+ ;;
+ ppc-* | ppcbe-*)
+ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rdos)
+ basic_machine=i386-pc
+ os=-rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sde)
+ basic_machine=mipsisa32-sde
+ os=-elf
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sh5el)
+ basic_machine=sh5le-unknown
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ strongarm-* | thumb-*)
+ basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tile*)
+ basic_machine=$basic_machine-unknown
+ os=-linux-gnu
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ xscale-* | xscalee[bl]-*)
+ basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ z80-*-coff)
+ basic_machine=z80-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -auroraux)
+ os=-auroraux
+ ;;
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+ | -sym* | -kopensolaris* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* | -aros* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -bitrig* | -openbsd* | -solidbsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
+ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -linux-android* \
+ | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+ -linux-dietlibc)
+ os=-linux-dietlibc
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -os400*)
+ os=-os400
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -syllable*)
+ os=-syllable
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -tpf*)
+ os=-tpf
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -kaos*)
+ os=-kaos
+ ;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
+ -dicos*)
+ os=-dicos
+ ;;
+ -nacl*)
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ score-*)
+ os=-elf
+ ;;
+ spu-*)
+ os=-elf
+ ;;
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ hexagon-*)
+ os=-elf
+ ;;
+ tic54x-*)
+ os=-coff
+ ;;
+ tic55x-*)
+ os=-coff
+ ;;
+ tic6x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mep-*)
+ os=-elf
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-haiku)
+ os=-haiku
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-knuth)
+ os=-mmixware
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -cnk*|-aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -os400*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -tpf*)
+ vendor=ibm
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/extension/build-aux/depcomp b/extension/build-aux/depcomp
new file mode 100755
index 00000000..0544c683
--- /dev/null
+++ b/extension/build-aux/depcomp
@@ -0,0 +1,780 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2012-07-12.20; # UTC
+
+# Copyright (C) 1999-2012 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+ '')
+ echo "$0: No command. Try '$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+ depmode Dependency tracking mode.
+ source Source file read by 'PROGRAMS ARGS'.
+ object Object file output by 'PROGRAMS ARGS'.
+ DEPDIR directory where to store dependencies.
+ depfile Dependency file to output.
+ tmpdepfile Temporary file to use when outputting dependencies.
+ libtool Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "depcomp $scriptversion"
+ exit $?
+ ;;
+esac
+
+# A tabulation character.
+tab=' '
+# A newline character.
+nl='
+'
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
+ exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+ sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+ # This is just like msvisualcpp but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u='sed s,\\\\,/,g'
+ depmode=msvisualcpp
+fi
+
+if test "$depmode" = msvc7msys; then
+ # This is just like msvc7 but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u='sed s,\\\\,/,g'
+ depmode=msvc7
+fi
+
+if test "$depmode" = xlc; then
+ # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations.
+ gccflag=-qmakedep=gcc,-MF
+ depmode=gcc
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff. Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am. Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+ for arg
+ do
+ case $arg in
+ -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+ *) set fnord "$@" "$arg" ;;
+ esac
+ shift # fnord
+ shift # $arg
+ done
+ "$@"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the "deleted header file" problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+ tr ' ' "$nl" < "$tmpdepfile" |
+## Some versions of gcc put a space before the ':'. On the theory
+## that the space means something, we add a space to the output as
+## well. hp depmode also adds that space, but also prefixes the VPATH
+## to the object. Take care to not repeat it in the output.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ echo "$object : \\" > "$depfile"
+
+ # Clip off the initial element (the dependent). Don't try to be
+ # clever and replace this with sed code, as IRIX sed won't handle
+ # lines with more than a fixed number of characters (4096 in
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like '#:fec' to the end of the
+ # dependency line.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+ tr "$nl" ' ' >> "$depfile"
+ echo >> "$depfile"
+
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+xlc)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. In older versions, this file always lives in the
+ # current directory. Also, the AIX compiler puts '$object:' at the
+ # start of each line; $object doesn't have directory information.
+ # Version 6 uses the directory in both cases.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$base.u
+ tmpdepfile3=$dir.libs/$base.u
+ "$@" -Wc,-M
+ else
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$dir$base.u
+ tmpdepfile3=$dir$base.u
+ "$@" -M
+ fi
+ stat=$?
+
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ # Each line is of the form 'foo.o: dependent.h'.
+ # Do two passes, one to just change these to
+ # '$object: dependent.h' and one to simply 'dependent.h:'.
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+icc)
+ # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
+ # However on
+ # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+ # ICC 7.0 will fill foo.d with something like
+ # foo.o: sub/foo.c
+ # foo.o: sub/foo.h
+ # which is wrong. We want
+ # sub/foo.o: sub/foo.c
+ # sub/foo.o: sub/foo.h
+ # sub/foo.c:
+ # sub/foo.h:
+ # ICC 7.1 will output
+ # foo.o: sub/foo.c sub/foo.h
+ # and will wrap long lines using '\':
+ # foo.o: sub/foo.c ... \
+ # sub/foo.h ... \
+ # ...
+ # tcc 0.9.26 (FIXME still under development at the moment of writing)
+ # will emit a similar output, but also prepend the continuation lines
+ # with horizontal tabulation characters.
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form 'foo.o: dependent.h',
+ # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
+ # Do two passes, one to just change these to
+ # '$object: dependent.h' and one to simply 'dependent.h:'.
+ sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \
+ < "$tmpdepfile" > "$depfile"
+ sed '
+ s/[ '"$tab"'][ '"$tab"']*/ /g
+ s/^ *//
+ s/ *\\*$//
+ s/^[^:]*: *//
+ /^$/d
+ /:$/d
+ s/$/ :/
+ ' < "$tmpdepfile" >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+## The order of this option in the case statement is important, since the
+## shell code in configure will try each of these formats in the order
+## listed in this file. A plain '-MD' option would be understood by many
+## compilers, so we must ensure this comes after the gcc and icc options.
+pgcc)
+ # Portland's C compiler understands '-MD'.
+ # Will always output deps to 'file.d' where file is the root name of the
+ # source file under compilation, even if file resides in a subdirectory.
+ # The object file name does not affect the name of the '.d' file.
+ # pgcc 10.2 will output
+ # foo.o: sub/foo.c sub/foo.h
+ # and will wrap long lines using '\' :
+ # foo.o: sub/foo.c ... \
+ # sub/foo.h ... \
+ # ...
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ # Use the source, not the object, to determine the base name, since
+ # that's sadly what pgcc will do too.
+ base=`echo "$source" | sed -e 's|^.*/||' -e 's/\.[-_a-zA-Z0-9]*$//'`
+ tmpdepfile="$base.d"
+
+ # For projects that build the same source file twice into different object
+ # files, the pgcc approach of using the *source* file root name can cause
+ # problems in parallel builds. Use a locking strategy to avoid stomping on
+ # the same $tmpdepfile.
+ lockdir="$base.d-lock"
+ trap "echo '$0: caught signal, cleaning up...' >&2; rm -rf $lockdir" 1 2 13 15
+ numtries=100
+ i=$numtries
+ while test $i -gt 0 ; do
+ # mkdir is a portable test-and-set.
+ if mkdir $lockdir 2>/dev/null; then
+ # This process acquired the lock.
+ "$@" -MD
+ stat=$?
+ # Release the lock.
+ rm -rf $lockdir
+ break
+ else
+ ## the lock is being held by a different process,
+ ## wait until the winning process is done or we timeout
+ while test -d $lockdir && test $i -gt 0; do
+ sleep 1
+ i=`expr $i - 1`
+ done
+ fi
+ i=`expr $i - 1`
+ done
+ trap - 1 2 13 15
+ if test $i -le 0; then
+ echo "$0: failed to acquire lock after $numtries attempts" >&2
+ echo "$0: check lockdir '$lockdir'" >&2
+ exit 1
+ fi
+
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form `foo.o: dependent.h',
+ # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+ sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp2)
+ # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+ # compilers, which have integrated preprocessors. The correct option
+ # to use with these is +Maked; it writes dependencies to a file named
+ # 'foo.d', which lands next to the object file, wherever that
+ # happens to be.
+ # Much of this is similar to the tru64 case; see comments there.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir.libs/$base.d
+ "$@" -Wc,+Maked
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ "$@" +Maked
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+ # Add 'dependent.h:' lines.
+ sed -ne '2,${
+ s/^ *//
+ s/ \\*$//
+ s/$/:/
+ p
+ }' "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile" "$tmpdepfile2"
+ ;;
+
+tru64)
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in 'foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+ if test "$libtool" = yes; then
+ # With Tru64 cc, shared objects can also be used to make a
+ # static library. This mechanism is used in libtool 1.4 series to
+ # handle both shared and static libraries in a single compilation.
+ # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+ #
+ # With libtool 1.5 this exception was removed, and libtool now
+ # generates 2 separate objects for the 2 libraries. These two
+ # compilations output dependencies in $dir.libs/$base.o.d and
+ # in $dir$base.o.d. We have to check for both files, because
+ # one of the two compilations can be disabled. We should prefer
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+ # automatically cleaned when .libs/ is deleted, while ignoring
+ # the former would cause a distcleancheck panic.
+ tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
+ tmpdepfile2=$dir$base.o.d # libtool 1.5
+ tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
+ tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
+ "$@" -Wc,-MD
+ else
+ tmpdepfile1=$dir$base.o.d
+ tmpdepfile2=$dir$base.d
+ tmpdepfile3=$dir$base.d
+ tmpdepfile4=$dir$base.d
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+msvc7)
+ if test "$libtool" = yes; then
+ showIncludes=-Wc,-showIncludes
+ else
+ showIncludes=-showIncludes
+ fi
+ "$@" $showIncludes > "$tmpdepfile"
+ stat=$?
+ grep -v '^Note: including file: ' "$tmpdepfile"
+ if test "$stat" = 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ # The first sed program below extracts the file names and escapes
+ # backslashes for cygpath. The second sed program outputs the file
+ # name when reading, but also accumulates all include files in the
+ # hold buffer in order to output them again at the end. This only
+ # works with sed implementations that can handle large buffers.
+ sed < "$tmpdepfile" -n '
+/^Note: including file: *\(.*\)/ {
+ s//\1/
+ s/\\/\\\\/g
+ p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/'"$tab"'\1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+ s/.*/'"$tab"'/
+ G
+ p
+}' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvc7msys)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove '-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ test -z "$dashmflag" && dashmflag=-M
+ # Require at least two characters before searching for ':'
+ # in the target name. This is to cope with DOS-style filenames:
+ # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
+ "$@" $dashmflag |
+ sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ tr ' ' "$nl" < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ "$@" || exit $?
+ # Remove any Libtool call
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+ # X makedepend
+ shift
+ cleared=no eat=no
+ for arg
+ do
+ case $cleared in
+ no)
+ set ""; shift
+ cleared=yes ;;
+ esac
+ if test $eat = yes; then
+ eat=no
+ continue
+ fi
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift ;;
+ # Strip any option that makedepend may not understand. Remove
+ # the object too, otherwise makedepend will parse it as a source file.
+ -arch)
+ eat=yes ;;
+ -*|$object)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift ;;
+ esac
+ done
+ obj_suffix=`echo "$object" | sed 's/^.*\././'`
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ rm -f "$depfile"
+ # makedepend may prepend the VPATH from the source file name to the object.
+ # No need to regex-escape $object, excess matching of '.' is harmless.
+ sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
+ sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove '-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ "$@" -E |
+ sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+ sed '$ s: \\$::' > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ cat < "$tmpdepfile" >> "$depfile"
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvisualcpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ IFS=" "
+ for arg
+ do
+ case "$arg" in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+ set fnord "$@"
+ shift
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
+ esac
+ done
+ "$@" -E 2>/dev/null |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
+ echo "$tab" >> "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvcmsys)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/extension/build-aux/install-sh b/extension/build-aux/install-sh
new file mode 100755
index 00000000..377bb868
--- /dev/null
+++ b/extension/build-aux/install-sh
@@ -0,0 +1,527 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2011-11-20.07; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# 'make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=" "" $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+ doit_exec=exec
+else
+ doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+ test "$posix_glob" != "?" || {
+ if (set -f) 2>/dev/null; then
+ posix_glob=
+ else
+ posix_glob=:
+ fi
+ }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+no_target_directory=
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve the last data modification time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -s $stripprog installed files.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+ case $1 in
+ -c) ;;
+
+ -C) copy_on_change=true;;
+
+ -d) dir_arg=true;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+ case $mode in
+ *' '* | *' '* | *'
+'* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
+
+ -o) chowncmd="$chownprog $2"
+ shift;;
+
+ -s) stripcmd=$stripprog;;
+
+ -t) dst_arg=$2
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ shift;;
+
+ -T) no_target_directory=true;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ --) shift
+ break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
+ esac
+ shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dst_arg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dst_arg"
+ shift # fnord
+ fi
+ shift # arg
+ dst_arg=$arg
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ done
+fi
+
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call 'install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+if test -z "$dir_arg"; then
+ do_exit='(exit $ret); exit $ret'
+ trap "ret=129; $do_exit" 1
+ trap "ret=130; $do_exit" 2
+ trap "ret=141; $do_exit" 13
+ trap "ret=143; $do_exit" 15
+
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
+
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
+fi
+
+for src
+do
+ # Protect names problematic for 'test' and other utilities.
+ case $src in
+ -* | [=\(\)!]) src=./$src;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
+ else
+
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst_arg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+ dst=$dst_arg
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+ dst=$dstdir/`basename "$src"`
+ dstdir_status=0
+ else
+ # Prefer dirname, but fall back on a substitute if dirname fails.
+ dstdir=`
+ (dirname "$dst") 2>/dev/null ||
+ expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$dst" : 'X\(//\)[^/]' \| \
+ X"$dst" : 'X\(//\)$' \| \
+ X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+ echo X"$dst" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'
+ `
+
+ test -d "$dstdir"
+ dstdir_status=$?
+ fi
+ fi
+
+ obsolete_mkdir_used=false
+
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ if (umask $mkdir_umask &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
+ esac
+
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
+
+ # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+ /*) prefix='/';;
+ [-=\(\)!]*) prefix='./';;
+ *) prefix='';;
+ esac
+
+ eval "$initialize_posix_glob"
+
+ oIFS=$IFS
+ IFS=/
+ $posix_glob set -f
+ set fnord $dstdir
+ shift
+ $posix_glob set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test X"$d" = X && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ done
+
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
+ fi
+ fi
+ fi
+
+ if test -n "$dir_arg"; then
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+ eval "$initialize_posix_glob" &&
+ $posix_glob set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ $posix_glob set +f &&
+
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # Rename the file to the real destination.
+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
+
+ trap '' 0
+ fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/extension/build-aux/ltmain.sh b/extension/build-aux/ltmain.sh
new file mode 100644
index 00000000..63ae69dc
--- /dev/null
+++ b/extension/build-aux/ltmain.sh
@@ -0,0 +1,9655 @@
+
+# libtool (GNU libtool) 2.4.2
+# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions. There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# Usage: $progname [OPTION]... [MODE-ARG]...
+#
+# Provide generalized library-building support services.
+#
+# --config show all configuration variables
+# --debug enable verbose shell tracing
+# -n, --dry-run display commands without modifying any files
+# --features display basic configuration information and exit
+# --mode=MODE use operation mode MODE
+# --preserve-dup-deps don't remove duplicate dependency libraries
+# --quiet, --silent don't print informational messages
+# --no-quiet, --no-silent
+# print informational messages (default)
+# --no-warn don't display warning messages
+# --tag=TAG use configuration variables from tag TAG
+# -v, --verbose print more informational messages than default
+# --no-verbose don't print the extra informational messages
+# --version print version information
+# -h, --help, --help-all print short, long, or detailed help message
+#
+# MODE must be one of the following:
+#
+# clean remove files from the build directory
+# compile compile a source file into a libtool object
+# execute automatically set library path, then run a program
+# finish complete the installation of libtool libraries
+# install install libraries or executables
+# link create a library or an executable
+# uninstall remove libraries from an installed directory
+#
+# MODE-ARGS vary depending on the MODE. When passed as first option,
+# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
+# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
+#
+# When reporting a bug, please describe a test case to reproduce it and
+# include the following information:
+#
+# host-triplet: $host
+# shell: $SHELL
+# compiler: $LTCC
+# compiler flags: $LTCFLAGS
+# linker: $LD (gnu? $with_gnu_ld)
+# $progname: (GNU libtool) 2.4.2
+# automake: $automake_version
+# autoconf: $autoconf_version
+#
+# Report bugs to <bug-libtool@gnu.org>.
+# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
+# General help using GNU software: <http://www.gnu.org/gethelp/>.
+
+PROGRAM=libtool
+PACKAGE=libtool
+VERSION=2.4.2
+TIMESTAMP=""
+package_revision=1.3337
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
+# NLS nuisances: We save the old values to restore during execute mode.
+lt_user_locale=
+lt_safe_locale=
+for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+ eval "if test \"\${$lt_var+set}\" = set; then
+ save_$lt_var=\$$lt_var
+ $lt_var=C
+ export $lt_var
+ lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
+ lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+ fi"
+done
+LC_ALL=C
+LANGUAGE=C
+export LANGUAGE LC_ALL
+
+$lt_unset CDPATH
+
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+
+
+: ${CP="cp -f"}
+test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+: ${Xsed="$SED -e 1s/^X//"}
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
+
+exit_status=$EXIT_SUCCESS
+
+# Make sure IFS has a sensible default
+lt_nl='
+'
+IFS=" $lt_nl"
+
+dirname="s,/[^/]*$,,"
+basename="s,^.*/,,"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+} # func_dirname may be replaced by extended shell implementation
+
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+} # func_basename may be replaced by extended shell implementation
+
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+# dirname: Compute the dirname of FILE. If nonempty,
+# add APPEND to the result, otherwise set result
+# to NONDIR_REPLACEMENT.
+# value returned in "$func_dirname_result"
+# basename: Compute filename of FILE.
+# value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+ # Extract subdirectory from the argument.
+ func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+ func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
+} # func_dirname_and_basename may be replaced by extended shell implementation
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ esac
+} # func_stripname may be replaced by extended shell implementation
+
+
+# These SED scripts presuppose an absolute path with a trailing slash.
+pathcar='s,^/\([^/]*\).*$,\1,'
+pathcdr='s,^/[^/]*,,'
+removedotparts=':dotsl
+ s@/\./@/@g
+ t dotsl
+ s,/\.$,/,'
+collapseslashes='s@/\{1,\}@/@g'
+finalslash='s,/*$,/,'
+
+# func_normal_abspath PATH
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+# value returned in "$func_normal_abspath_result"
+func_normal_abspath ()
+{
+ # Start from root dir and reassemble the path.
+ func_normal_abspath_result=
+ func_normal_abspath_tpath=$1
+ func_normal_abspath_altnamespace=
+ case $func_normal_abspath_tpath in
+ "")
+ # Empty path, that just means $cwd.
+ func_stripname '' '/' "`pwd`"
+ func_normal_abspath_result=$func_stripname_result
+ return
+ ;;
+ # The next three entries are used to spot a run of precisely
+ # two leading slashes without using negated character classes;
+ # we take advantage of case's first-match behaviour.
+ ///*)
+ # Unusual form of absolute path, do nothing.
+ ;;
+ //*)
+ # Not necessarily an ordinary path; POSIX reserves leading '//'
+ # and for example Cygwin uses it to access remote file shares
+ # over CIFS/SMB, so we conserve a leading double slash if found.
+ func_normal_abspath_altnamespace=/
+ ;;
+ /*)
+ # Absolute path, do nothing.
+ ;;
+ *)
+ # Relative path, prepend $cwd.
+ func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+ ;;
+ esac
+ # Cancel out all the simple stuff to save iterations. We also want
+ # the path to end with a slash for ease of parsing, so make sure
+ # there is one (and only one) here.
+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
+ while :; do
+ # Processed it all yet?
+ if test "$func_normal_abspath_tpath" = / ; then
+ # If we ascended to the root using ".." the result may be empty now.
+ if test -z "$func_normal_abspath_result" ; then
+ func_normal_abspath_result=/
+ fi
+ break
+ fi
+ func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$pathcar"`
+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$pathcdr"`
+ # Figure out what to do with it
+ case $func_normal_abspath_tcomponent in
+ "")
+ # Trailing empty path component, ignore it.
+ ;;
+ ..)
+ # Parent dir; strip last assembled component from result.
+ func_dirname "$func_normal_abspath_result"
+ func_normal_abspath_result=$func_dirname_result
+ ;;
+ *)
+ # Actual path component, append it.
+ func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
+ ;;
+ esac
+ done
+ # Restore leading double-slash if one was found on entry.
+ func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
+}
+
+# func_relative_path SRCDIR DSTDIR
+# generates a relative path from SRCDIR to DSTDIR, with a trailing
+# slash if non-empty, suitable for immediately appending a filename
+# without needing to append a separator.
+# value returned in "$func_relative_path_result"
+func_relative_path ()
+{
+ func_relative_path_result=
+ func_normal_abspath "$1"
+ func_relative_path_tlibdir=$func_normal_abspath_result
+ func_normal_abspath "$2"
+ func_relative_path_tbindir=$func_normal_abspath_result
+
+ # Ascend the tree starting from libdir
+ while :; do
+ # check if we have found a prefix of bindir
+ case $func_relative_path_tbindir in
+ $func_relative_path_tlibdir)
+ # found an exact match
+ func_relative_path_tcancelled=
+ break
+ ;;
+ $func_relative_path_tlibdir*)
+ # found a matching prefix
+ func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+ func_relative_path_tcancelled=$func_stripname_result
+ if test -z "$func_relative_path_result"; then
+ func_relative_path_result=.
+ fi
+ break
+ ;;
+ *)
+ func_dirname $func_relative_path_tlibdir
+ func_relative_path_tlibdir=${func_dirname_result}
+ if test "x$func_relative_path_tlibdir" = x ; then
+ # Have to descend all the way to the root!
+ func_relative_path_result=../$func_relative_path_result
+ func_relative_path_tcancelled=$func_relative_path_tbindir
+ break
+ fi
+ func_relative_path_result=../$func_relative_path_result
+ ;;
+ esac
+ done
+
+ # Now calculate path; take care to avoid doubling-up slashes.
+ func_stripname '' '/' "$func_relative_path_result"
+ func_relative_path_result=$func_stripname_result
+ func_stripname '/' '/' "$func_relative_path_tcancelled"
+ if test "x$func_stripname_result" != x ; then
+ func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
+ fi
+
+ # Normalisation. If bindir is libdir, return empty string,
+ # else relative path ending with a slash; either way, target
+ # file name can be directly appended.
+ if test ! -z "$func_relative_path_result"; then
+ func_stripname './' '' "$func_relative_path_result/"
+ func_relative_path_result=$func_stripname_result
+ fi
+}
+
+# The name of this program:
+func_dirname_and_basename "$progpath"
+progname=$func_basename_result
+
+# Make sure we have an absolute path for reexecution:
+case $progpath in
+ [\\/]*|[A-Za-z]:\\*) ;;
+ *[\\/]*)
+ progdir=$func_dirname_result
+ progdir=`cd "$progdir" && pwd`
+ progpath="$progdir/$progname"
+ ;;
+ *)
+ save_IFS="$IFS"
+ IFS=${PATH_SEPARATOR-:}
+ for progdir in $PATH; do
+ IFS="$save_IFS"
+ test -x "$progdir/$progname" && break
+ done
+ IFS="$save_IFS"
+ test -n "$progdir" || progdir=`pwd`
+ progpath="$progdir/$progname"
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
+
+# Sed substitution that converts a w32 file name or path
+# which contains forward slashes, into one that contains
+# (escaped) backslashes. A very naive implementation.
+lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
+# Re-`\' parameter expansions in output of double_quote_subst that were
+# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
+# in input to double_quote_subst, that '$' was protected from expansion.
+# Since each input `\' is now two `\'s, look for any number of runs of
+# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
+bs='\\'
+bs2='\\\\'
+bs4='\\\\\\\\'
+dollar='\$'
+sed_double_backslash="\
+ s/$bs4/&\\
+/g
+ s/^$bs2$dollar/$bs&/
+ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
+ s/\n//g"
+
+# Standard options:
+opt_dry_run=false
+opt_help=false
+opt_quiet=false
+opt_verbose=false
+opt_warning=:
+
+# func_echo arg...
+# Echo program name prefixed message, along with the current mode
+# name if it has been set yet.
+func_echo ()
+{
+ $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
+}
+
+# func_verbose arg...
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+ $opt_verbose && func_echo ${1+"$@"}
+
+ # A bug in bash halts the script if the last line of a function
+ # fails when set -e is in force, so we need another command to
+ # work around that:
+ :
+}
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO "$*"
+}
+
+# func_error arg...
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+ $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
+}
+
+# func_warning arg...
+# Echo program name prefixed warning message to standard error.
+func_warning ()
+{
+ $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
+
+ # bash bug again:
+ :
+}
+
+# func_fatal_error arg...
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+ func_error ${1+"$@"}
+ exit $EXIT_FAILURE
+}
+
+# func_fatal_help arg...
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+ func_error ${1+"$@"}
+ func_fatal_error "$help"
+}
+help="Try \`$progname --help' for more information." ## default
+
+
+# func_grep expression filename
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+ $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+
+# func_mkdir_p directory-path
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+ my_directory_path="$1"
+ my_dir_list=
+
+ if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+
+ # Protect directory names starting with `-'
+ case $my_directory_path in
+ -*) my_directory_path="./$my_directory_path" ;;
+ esac
+
+ # While some portion of DIR does not yet exist...
+ while test ! -d "$my_directory_path"; do
+ # ...make a list in topmost first order. Use a colon delimited
+ # list incase some portion of path contains whitespace.
+ my_dir_list="$my_directory_path:$my_dir_list"
+
+ # If the last portion added has no slash in it, the list is done
+ case $my_directory_path in */*) ;; *) break ;; esac
+
+ # ...otherwise throw away the child directory and loop
+ my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
+ done
+ my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
+
+ save_mkdir_p_IFS="$IFS"; IFS=':'
+ for my_dir in $my_dir_list; do
+ IFS="$save_mkdir_p_IFS"
+ # mkdir can fail with a `File exist' error if two processes
+ # try to create one of the directories concurrently. Don't
+ # stop in that case!
+ $MKDIR "$my_dir" 2>/dev/null || :
+ done
+ IFS="$save_mkdir_p_IFS"
+
+ # Bail out if we (or some other process) failed to create a directory.
+ test -d "$my_directory_path" || \
+ func_fatal_error "Failed to create \`$1'"
+ fi
+}
+
+
+# func_mktempdir [string]
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible. If
+# given, STRING is the basename for that directory.
+func_mktempdir ()
+{
+ my_template="${TMPDIR-/tmp}/${1-$progname}"
+
+ if test "$opt_dry_run" = ":"; then
+ # Return a directory name, but don't create it in dry-run mode
+ my_tmpdir="${my_template}-$$"
+ else
+
+ # If mktemp works, use that first and foremost
+ my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+
+ if test ! -d "$my_tmpdir"; then
+ # Failing that, at least try and use $RANDOM to avoid a race
+ my_tmpdir="${my_template}-${RANDOM-0}$$"
+
+ save_mktempdir_umask=`umask`
+ umask 0077
+ $MKDIR "$my_tmpdir"
+ umask $save_mktempdir_umask
+ fi
+
+ # If we're not in dry-run mode, bomb out on failure
+ test -d "$my_tmpdir" || \
+ func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
+ fi
+
+ $ECHO "$my_tmpdir"
+}
+
+
+# func_quote_for_eval arg
+# Aesthetically quote ARG to be evaled later.
+# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
+# is double-quoted, suitable for a subsequent eval, whereas
+# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
+# which are still active within double quotes backslashified.
+func_quote_for_eval ()
+{
+ case $1 in
+ *[\\\`\"\$]*)
+ func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
+ *)
+ func_quote_for_eval_unquoted_result="$1" ;;
+ esac
+
+ case $func_quote_for_eval_unquoted_result in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting, command substitution and and variable
+ # expansion for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
+ ;;
+ *)
+ func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
+ esac
+}
+
+
+# func_quote_for_expand arg
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
+{
+ case $1 in
+ *[\\\`\"]*)
+ my_arg=`$ECHO "$1" | $SED \
+ -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
+ *)
+ my_arg="$1" ;;
+ esac
+
+ case $my_arg in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting and command substitution for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ my_arg="\"$my_arg\""
+ ;;
+ esac
+
+ func_quote_for_expand_result="$my_arg"
+}
+
+
+# func_show_eval cmd [fail_exp]
+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
+{
+ my_cmd="$1"
+ my_fail_exp="${2-:}"
+
+ ${opt_silent-false} || {
+ func_quote_for_expand "$my_cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+
+ if ${opt_dry_run-false}; then :; else
+ eval "$my_cmd"
+ my_status=$?
+ if test "$my_status" -eq 0; then :; else
+ eval "(exit $my_status); $my_fail_exp"
+ fi
+ fi
+}
+
+
+# func_show_eval_locale cmd [fail_exp]
+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it. Use the saved locale for evaluation.
+func_show_eval_locale ()
+{
+ my_cmd="$1"
+ my_fail_exp="${2-:}"
+
+ ${opt_silent-false} || {
+ func_quote_for_expand "$my_cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+
+ if ${opt_dry_run-false}; then :; else
+ eval "$lt_user_locale
+ $my_cmd"
+ my_status=$?
+ eval "$lt_safe_locale"
+ if test "$my_status" -eq 0; then :; else
+ eval "(exit $my_status); $my_fail_exp"
+ fi
+ fi
+}
+
+# func_tr_sh
+# Turn $1 into a string suitable for a shell variable name.
+# Result is stored in $func_tr_sh_result. All characters
+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
+# if $1 begins with a digit, a '_' is prepended as well.
+func_tr_sh ()
+{
+ case $1 in
+ [0-9]* | *[!a-zA-Z0-9_]*)
+ func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
+ ;;
+ * )
+ func_tr_sh_result=$1
+ ;;
+ esac
+}
+
+
+# func_version
+# Echo version message to standard output and exit.
+func_version ()
+{
+ $opt_debug
+
+ $SED -n '/(C)/!b go
+ :more
+ /\./!{
+ N
+ s/\n# / /
+ b more
+ }
+ :go
+ /^# '$PROGRAM' (GNU /,/# warranty; / {
+ s/^# //
+ s/^# *$//
+ s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
+ p
+ }' < "$progpath"
+ exit $?
+}
+
+# func_usage
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+ $opt_debug
+
+ $SED -n '/^# Usage:/,/^# *.*--help/ {
+ s/^# //
+ s/^# *$//
+ s/\$progname/'$progname'/
+ p
+ }' < "$progpath"
+ echo
+ $ECHO "run \`$progname --help | more' for full usage"
+ exit $?
+}
+
+# func_help [NOEXIT]
+# Echo long help message to standard output and exit,
+# unless 'noexit' is passed as argument.
+func_help ()
+{
+ $opt_debug
+
+ $SED -n '/^# Usage:/,/# Report bugs to/ {
+ :print
+ s/^# //
+ s/^# *$//
+ s*\$progname*'$progname'*
+ s*\$host*'"$host"'*
+ s*\$SHELL*'"$SHELL"'*
+ s*\$LTCC*'"$LTCC"'*
+ s*\$LTCFLAGS*'"$LTCFLAGS"'*
+ s*\$LD*'"$LD"'*
+ s/\$with_gnu_ld/'"$with_gnu_ld"'/
+ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
+ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
+ p
+ d
+ }
+ /^# .* home page:/b print
+ /^# General help using/b print
+ ' < "$progpath"
+ ret=$?
+ if test -z "$1"; then
+ exit $ret
+ fi
+}
+
+# func_missing_arg argname
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+ $opt_debug
+
+ func_error "missing argument for $1."
+ exit_cmd=exit
+}
+
+
+# func_split_short_opt shortopt
+# Set func_split_short_opt_name and func_split_short_opt_arg shell
+# variables after splitting SHORTOPT after the 2nd character.
+func_split_short_opt ()
+{
+ my_sed_short_opt='1s/^\(..\).*$/\1/;q'
+ my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
+
+ func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
+ func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
+} # func_split_short_opt may be replaced by extended shell implementation
+
+
+# func_split_long_opt longopt
+# Set func_split_long_opt_name and func_split_long_opt_arg shell
+# variables after splitting LONGOPT at the `=' sign.
+func_split_long_opt ()
+{
+ my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
+ my_sed_long_arg='1s/^--[^=]*=//'
+
+ func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
+ func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
+} # func_split_long_opt may be replaced by extended shell implementation
+
+exit_cmd=:
+
+
+
+
+
+magic="%%%MAGIC variable%%%"
+magic_exe="%%%MAGIC EXE variable%%%"
+
+# Global variables.
+nonopt=
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end. This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "${1}=\$${1}\${2}"
+} # func_append may be replaced by extended shell implementation
+
+# func_append_quoted var value
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+func_append_quoted ()
+{
+ func_quote_for_eval "${2}"
+ eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
+} # func_append_quoted may be replaced by extended shell implementation
+
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=`expr "${@}"`
+} # func_arith may be replaced by extended shell implementation
+
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
+} # func_len may be replaced by extended shell implementation
+
+
+# func_lo2o object
+func_lo2o ()
+{
+ func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+} # func_lo2o may be replaced by extended shell implementation
+
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+} # func_xform may be replaced by extended shell implementation
+
+
+# func_fatal_configuration arg...
+# Echo program name prefixed message to standard error, followed by
+# a configuration failure hint, and exit.
+func_fatal_configuration ()
+{
+ func_error ${1+"$@"}
+ func_error "See the $PACKAGE documentation for more information."
+ func_fatal_error "Fatal configuration error."
+}
+
+
+# func_config
+# Display the configuration for all the tags in this script.
+func_config ()
+{
+ re_begincf='^# ### BEGIN LIBTOOL'
+ re_endcf='^# ### END LIBTOOL'
+
+ # Default configuration.
+ $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
+
+ # Now print the configurations for the tags.
+ for tagname in $taglist; do
+ $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
+ done
+
+ exit $?
+}
+
+# func_features
+# Display the features supported by this script.
+func_features ()
+{
+ echo "host: $host"
+ if test "$build_libtool_libs" = yes; then
+ echo "enable shared libraries"
+ else
+ echo "disable shared libraries"
+ fi
+ if test "$build_old_libs" = yes; then
+ echo "enable static libraries"
+ else
+ echo "disable static libraries"
+ fi
+
+ exit $?
+}
+
+# func_enable_tag tagname
+# Verify that TAGNAME is valid, and either flag an error and exit, or
+# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
+# variable here.
+func_enable_tag ()
+{
+ # Global variable:
+ tagname="$1"
+
+ re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+ re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+ sed_extractcf="/$re_begincf/,/$re_endcf/p"
+
+ # Validate tagname.
+ case $tagname in
+ *[!-_A-Za-z0-9,/]*)
+ func_fatal_error "invalid tag name: $tagname"
+ ;;
+ esac
+
+ # Don't test for the "default" C tag, as we know it's
+ # there but not specially marked.
+ case $tagname in
+ CC) ;;
+ *)
+ if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+ taglist="$taglist $tagname"
+
+ # Evaluate the configuration. Be careful to quote the path
+ # and the sed script, to avoid splitting on whitespace, but
+ # also don't use non-portable quotes within backquotes within
+ # quotes we have to do it in 2 steps:
+ extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+ eval "$extractedcf"
+ else
+ func_error "ignoring unknown tag $tagname"
+ fi
+ ;;
+ esac
+}
+
+# func_check_version_match
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
+{
+ if test "$package_revision" != "$macro_revision"; then
+ if test "$VERSION" != "$macro_version"; then
+ if test -z "$macro_version"; then
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ fi
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+ fi
+
+ exit $EXIT_MISMATCH
+ fi
+}
+
+
+# Shorthand for --mode=foo, only valid as the first argument
+case $1 in
+clean|clea|cle|cl)
+ shift; set dummy --mode clean ${1+"$@"}; shift
+ ;;
+compile|compil|compi|comp|com|co|c)
+ shift; set dummy --mode compile ${1+"$@"}; shift
+ ;;
+execute|execut|execu|exec|exe|ex|e)
+ shift; set dummy --mode execute ${1+"$@"}; shift
+ ;;
+finish|finis|fini|fin|fi|f)
+ shift; set dummy --mode finish ${1+"$@"}; shift
+ ;;
+install|instal|insta|inst|ins|in|i)
+ shift; set dummy --mode install ${1+"$@"}; shift
+ ;;
+link|lin|li|l)
+ shift; set dummy --mode link ${1+"$@"}; shift
+ ;;
+uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+ shift; set dummy --mode uninstall ${1+"$@"}; shift
+ ;;
+esac
+
+
+
+# Option defaults:
+opt_debug=:
+opt_dry_run=false
+opt_config=false
+opt_preserve_dup_deps=false
+opt_features=false
+opt_finish=false
+opt_help=false
+opt_help_all=false
+opt_silent=:
+opt_warning=:
+opt_verbose=:
+opt_silent=false
+opt_verbose=false
+
+
+# Parse options once, thoroughly. This comes as soon as possible in the
+# script to make things like `--version' happen as quickly as we can.
+{
+ # this just eases exit handling
+ while test $# -gt 0; do
+ opt="$1"
+ shift
+ case $opt in
+ --debug|-x) opt_debug='set -x'
+ func_echo "enabling shell trace mode"
+ $opt_debug
+ ;;
+ --dry-run|--dryrun|-n)
+ opt_dry_run=:
+ ;;
+ --config)
+ opt_config=:
+func_config
+ ;;
+ --dlopen|-dlopen)
+ optarg="$1"
+ opt_dlopen="${opt_dlopen+$opt_dlopen
+}$optarg"
+ shift
+ ;;
+ --preserve-dup-deps)
+ opt_preserve_dup_deps=:
+ ;;
+ --features)
+ opt_features=:
+func_features
+ ;;
+ --finish)
+ opt_finish=:
+set dummy --mode finish ${1+"$@"}; shift
+ ;;
+ --help)
+ opt_help=:
+ ;;
+ --help-all)
+ opt_help_all=:
+opt_help=': help-all'
+ ;;
+ --mode)
+ test $# = 0 && func_missing_arg $opt && break
+ optarg="$1"
+ opt_mode="$optarg"
+case $optarg in
+ # Valid mode arguments:
+ clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+ # Catch anything else as an error
+ *) func_error "invalid argument for $opt"
+ exit_cmd=exit
+ break
+ ;;
+esac
+ shift
+ ;;
+ --no-silent|--no-quiet)
+ opt_silent=false
+func_append preserve_args " $opt"
+ ;;
+ --no-warning|--no-warn)
+ opt_warning=false
+func_append preserve_args " $opt"
+ ;;
+ --no-verbose)
+ opt_verbose=false
+func_append preserve_args " $opt"
+ ;;
+ --silent|--quiet)
+ opt_silent=:
+func_append preserve_args " $opt"
+ opt_verbose=false
+ ;;
+ --verbose|-v)
+ opt_verbose=:
+func_append preserve_args " $opt"
+opt_silent=false
+ ;;
+ --tag)
+ test $# = 0 && func_missing_arg $opt && break
+ optarg="$1"
+ opt_tag="$optarg"
+func_append preserve_args " $opt $optarg"
+func_enable_tag "$optarg"
+ shift
+ ;;
+
+ -\?|-h) func_usage ;;
+ --help) func_help ;;
+ --version) func_version ;;
+
+ # Separate optargs to long options:
+ --*=*)
+ func_split_long_opt "$opt"
+ set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
+ shift
+ ;;
+
+ # Separate non-argument short options:
+ -\?*|-h*|-n*|-v*)
+ func_split_short_opt "$opt"
+ set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
+ shift
+ ;;
+
+ --) break ;;
+ -*) func_fatal_help "unrecognized option \`$opt'" ;;
+ *) set dummy "$opt" ${1+"$@"}; shift; break ;;
+ esac
+ done
+
+ # Validate options:
+
+ # save first non-option argument
+ if test "$#" -gt 0; then
+ nonopt="$opt"
+ shift
+ fi
+
+ # preserve --debug
+ test "$opt_debug" = : || func_append preserve_args " --debug"
+
+ case $host in
+ *cygwin* | *mingw* | *pw32* | *cegcc*)
+ # don't eliminate duplications in $postdeps and $predeps
+ opt_duplicate_compiler_generated_deps=:
+ ;;
+ *)
+ opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+ ;;
+ esac
+
+ $opt_help || {
+ # Sanity checks first:
+ func_check_version_match
+
+ if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+ func_fatal_configuration "not configured to build any kind of library"
+ fi
+
+ # Darwin sucks
+ eval std_shrext=\"$shrext_cmds\"
+
+ # Only execute mode is allowed to have -dlopen flags.
+ if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
+ func_error "unrecognized option \`-dlopen'"
+ $ECHO "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Change the help message to a mode-specific one.
+ generic_help="$help"
+ help="Try \`$progname --help --mode=$opt_mode' for more information."
+ }
+
+
+ # Bail if the options were screwed
+ $exit_cmd $EXIT_FAILURE
+}
+
+
+
+
+## ----------- ##
+## Main. ##
+## ----------- ##
+
+# func_lalib_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_lalib_p ()
+{
+ test -f "$1" &&
+ $SED -e 4q "$1" 2>/dev/null \
+ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
+# func_lalib_unsafe_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function implements the same check as func_lalib_p without
+# resorting to external programs. To this end, it redirects stdin and
+# closes it afterwards, without saving the original file descriptor.
+# As a safety measure, use it only where a negative result would be
+# fatal anyway. Works if `file' does not exist.
+func_lalib_unsafe_p ()
+{
+ lalib_p=no
+ if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
+ for lalib_p_l in 1 2 3 4
+ do
+ read lalib_p_line
+ case "$lalib_p_line" in
+ \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
+ esac
+ done
+ exec 0<&5 5<&-
+ fi
+ test "$lalib_p" = yes
+}
+
+# func_ltwrapper_script_p file
+# True iff FILE is a libtool wrapper script
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_script_p ()
+{
+ func_lalib_p "$1"
+}
+
+# func_ltwrapper_executable_p file
+# True iff FILE is a libtool wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_executable_p ()
+{
+ func_ltwrapper_exec_suffix=
+ case $1 in
+ *.exe) ;;
+ *) func_ltwrapper_exec_suffix=.exe ;;
+ esac
+ $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
+}
+
+# func_ltwrapper_scriptname file
+# Assumes file is an ltwrapper_executable
+# uses $file to determine the appropriate filename for a
+# temporary ltwrapper_script.
+func_ltwrapper_scriptname ()
+{
+ func_dirname_and_basename "$1" "" "."
+ func_stripname '' '.exe' "$func_basename_result"
+ func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+}
+
+# func_ltwrapper_p file
+# True iff FILE is a libtool wrapper script or wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_p ()
+{
+ func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
+}
+
+
+# func_execute_cmds commands fail_cmd
+# Execute tilde-delimited COMMANDS.
+# If FAIL_CMD is given, eval that upon failure.
+# FAIL_CMD may read-access the current command in variable CMD!
+func_execute_cmds ()
+{
+ $opt_debug
+ save_ifs=$IFS; IFS='~'
+ for cmd in $1; do
+ IFS=$save_ifs
+ eval cmd=\"$cmd\"
+ func_show_eval "$cmd" "${2-:}"
+ done
+ IFS=$save_ifs
+}
+
+
+# func_source file
+# Source FILE, adding directory component if necessary.
+# Note that it is not necessary on cygwin/mingw to append a dot to
+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
+# behavior happens only for exec(3), not for open(2)! Also, sourcing
+# `FILE.' does not work on cygwin managed mounts.
+func_source ()
+{
+ $opt_debug
+ case $1 in
+ */* | *\\*) . "$1" ;;
+ *) . "./$1" ;;
+ esac
+}
+
+
+# func_resolve_sysroot PATH
+# Replace a leading = in PATH with a sysroot. Store the result into
+# func_resolve_sysroot_result
+func_resolve_sysroot ()
+{
+ func_resolve_sysroot_result=$1
+ case $func_resolve_sysroot_result in
+ =*)
+ func_stripname '=' '' "$func_resolve_sysroot_result"
+ func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
+ ;;
+ esac
+}
+
+# func_replace_sysroot PATH
+# If PATH begins with the sysroot, replace it with = and
+# store the result into func_replace_sysroot_result.
+func_replace_sysroot ()
+{
+ case "$lt_sysroot:$1" in
+ ?*:"$lt_sysroot"*)
+ func_stripname "$lt_sysroot" '' "$1"
+ func_replace_sysroot_result="=$func_stripname_result"
+ ;;
+ *)
+ # Including no sysroot.
+ func_replace_sysroot_result=$1
+ ;;
+ esac
+}
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+ $opt_debug
+ if test -n "$available_tags" && test -z "$tagname"; then
+ CC_quoted=
+ for arg in $CC; do
+ func_append_quoted CC_quoted "$arg"
+ done
+ CC_expanded=`func_echo_all $CC`
+ CC_quoted_expanded=`func_echo_all $CC_quoted`
+ case $@ in
+ # Blanks in the command may have been stripped by the calling shell,
+ # but not from the CC environment variable when configure was run.
+ " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
+ # Blanks at the start of $base_compile will cause this to fail
+ # if we don't check for them as well.
+ *)
+ for z in $available_tags; do
+ if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+ # Evaluate the configuration.
+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+ CC_quoted=
+ for arg in $CC; do
+ # Double-quote args containing other shell metacharacters.
+ func_append_quoted CC_quoted "$arg"
+ done
+ CC_expanded=`func_echo_all $CC`
+ CC_quoted_expanded=`func_echo_all $CC_quoted`
+ case "$@ " in
+ " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
+ # The compiler in the base compile command matches
+ # the one in the tagged configuration.
+ # Assume this is the tagged configuration we want.
+ tagname=$z
+ break
+ ;;
+ esac
+ fi
+ done
+ # If $tagname still isn't set, then no tagged configuration
+ # was found and let the user know that the "--tag" command
+ # line option must be used.
+ if test -z "$tagname"; then
+ func_echo "unable to infer tagged configuration"
+ func_fatal_error "specify a tag with \`--tag'"
+# else
+# func_verbose "using $tagname tagged configuration"
+ fi
+ ;;
+ esac
+ fi
+}
+
+
+
+# func_write_libtool_object output_name pic_name nonpic_name
+# Create a libtool object file (analogous to a ".la" file),
+# but don't create it if we're doing a dry run.
+func_write_libtool_object ()
+{
+ write_libobj=${1}
+ if test "$build_libtool_libs" = yes; then
+ write_lobj=\'${2}\'
+ else
+ write_lobj=none
+ fi
+
+ if test "$build_old_libs" = yes; then
+ write_oldobj=\'${3}\'
+ else
+ write_oldobj=none
+ fi
+
+ $opt_dry_run || {
+ cat >${write_libobj}T <<EOF
+# $write_libobj - a libtool object file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object=$write_lobj
+
+# Name of the non-PIC object
+non_pic_object=$write_oldobj
+
+EOF
+ $MV "${write_libobj}T" "${write_libobj}"
+ }
+}
+
+
+##################################################
+# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
+##################################################
+
+# func_convert_core_file_wine_to_w32 ARG
+# Helper function used by file name conversion functions when $build is *nix,
+# and $host is mingw, cygwin, or some other w32 environment. Relies on a
+# correctly configured wine environment available, with the winepath program
+# in $build's $PATH.
+#
+# ARG is the $build file name to be converted to w32 format.
+# Result is available in $func_convert_core_file_wine_to_w32_result, and will
+# be empty on error (or when ARG is empty)
+func_convert_core_file_wine_to_w32 ()
+{
+ $opt_debug
+ func_convert_core_file_wine_to_w32_result="$1"
+ if test -n "$1"; then
+ # Unfortunately, winepath does not exit with a non-zero error code, so we
+ # are forced to check the contents of stdout. On the other hand, if the
+ # command is not found, the shell will set an exit code of 127 and print
+ # *an error message* to stdout. So we must check for both error code of
+ # zero AND non-empty stdout, which explains the odd construction:
+ func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
+ if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
+ func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
+ $SED -e "$lt_sed_naive_backslashify"`
+ else
+ func_convert_core_file_wine_to_w32_result=
+ fi
+ fi
+}
+# end: func_convert_core_file_wine_to_w32
+
+
+# func_convert_core_path_wine_to_w32 ARG
+# Helper function used by path conversion functions when $build is *nix, and
+# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
+# configured wine environment available, with the winepath program in $build's
+# $PATH. Assumes ARG has no leading or trailing path separator characters.
+#
+# ARG is path to be converted from $build format to win32.
+# Result is available in $func_convert_core_path_wine_to_w32_result.
+# Unconvertible file (directory) names in ARG are skipped; if no directory names
+# are convertible, then the result may be empty.
+func_convert_core_path_wine_to_w32 ()
+{
+ $opt_debug
+ # unfortunately, winepath doesn't convert paths, only file names
+ func_convert_core_path_wine_to_w32_result=""
+ if test -n "$1"; then
+ oldIFS=$IFS
+ IFS=:
+ for func_convert_core_path_wine_to_w32_f in $1; do
+ IFS=$oldIFS
+ func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
+ if test -n "$func_convert_core_file_wine_to_w32_result" ; then
+ if test -z "$func_convert_core_path_wine_to_w32_result"; then
+ func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
+ else
+ func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
+ fi
+ fi
+ done
+ IFS=$oldIFS
+ fi
+}
+# end: func_convert_core_path_wine_to_w32
+
+
+# func_cygpath ARGS...
+# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
+# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
+# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
+# (2), returns the Cygwin file name or path in func_cygpath_result (input
+# file name or path is assumed to be in w32 format, as previously converted
+# from $build's *nix or MSYS format). In case (3), returns the w32 file name
+# or path in func_cygpath_result (input file name or path is assumed to be in
+# Cygwin format). Returns an empty string on error.
+#
+# ARGS are passed to cygpath, with the last one being the file name or path to
+# be converted.
+#
+# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
+# environment variable; do not put it in $PATH.
+func_cygpath ()
+{
+ $opt_debug
+ if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
+ func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
+ if test "$?" -ne 0; then
+ # on failure, ensure result is empty
+ func_cygpath_result=
+ fi
+ else
+ func_cygpath_result=
+ func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
+ fi
+}
+#end: func_cygpath
+
+
+# func_convert_core_msys_to_w32 ARG
+# Convert file name or path ARG from MSYS format to w32 format. Return
+# result in func_convert_core_msys_to_w32_result.
+func_convert_core_msys_to_w32 ()
+{
+ $opt_debug
+ # awkward: cmd appends spaces to result
+ func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
+ $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+}
+#end: func_convert_core_msys_to_w32
+
+
+# func_convert_file_check ARG1 ARG2
+# Verify that ARG1 (a file name in $build format) was converted to $host
+# format in ARG2. Otherwise, emit an error message, but continue (resetting
+# func_to_host_file_result to ARG1).
+func_convert_file_check ()
+{
+ $opt_debug
+ if test -z "$2" && test -n "$1" ; then
+ func_error "Could not determine host file name corresponding to"
+ func_error " \`$1'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback:
+ func_to_host_file_result="$1"
+ fi
+}
+# end func_convert_file_check
+
+
+# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
+# Verify that FROM_PATH (a path in $build format) was converted to $host
+# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
+# func_to_host_file_result to a simplistic fallback value (see below).
+func_convert_path_check ()
+{
+ $opt_debug
+ if test -z "$4" && test -n "$3"; then
+ func_error "Could not determine the host path corresponding to"
+ func_error " \`$3'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback. This is a deliberately simplistic "conversion" and
+ # should not be "improved". See libtool.info.
+ if test "x$1" != "x$2"; then
+ lt_replace_pathsep_chars="s|$1|$2|g"
+ func_to_host_path_result=`echo "$3" |
+ $SED -e "$lt_replace_pathsep_chars"`
+ else
+ func_to_host_path_result="$3"
+ fi
+ fi
+}
+# end func_convert_path_check
+
+
+# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
+# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
+# and appending REPL if ORIG matches BACKPAT.
+func_convert_path_front_back_pathsep ()
+{
+ $opt_debug
+ case $4 in
+ $1 ) func_to_host_path_result="$3$func_to_host_path_result"
+ ;;
+ esac
+ case $4 in
+ $2 ) func_append func_to_host_path_result "$3"
+ ;;
+ esac
+}
+# end func_convert_path_front_back_pathsep
+
+
+##################################################
+# $build to $host FILE NAME CONVERSION FUNCTIONS #
+##################################################
+# invoked via `$to_host_file_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# Result will be available in $func_to_host_file_result.
+
+
+# func_to_host_file ARG
+# Converts the file name ARG from $build format to $host format. Return result
+# in func_to_host_file_result.
+func_to_host_file ()
+{
+ $opt_debug
+ $to_host_file_cmd "$1"
+}
+# end func_to_host_file
+
+
+# func_to_tool_file ARG LAZY
+# converts the file name ARG from $build format to toolchain format. Return
+# result in func_to_tool_file_result. If the conversion in use is listed
+# in (the comma separated) LAZY, no conversion takes place.
+func_to_tool_file ()
+{
+ $opt_debug
+ case ,$2, in
+ *,"$to_tool_file_cmd",*)
+ func_to_tool_file_result=$1
+ ;;
+ *)
+ $to_tool_file_cmd "$1"
+ func_to_tool_file_result=$func_to_host_file_result
+ ;;
+ esac
+}
+# end func_to_tool_file
+
+
+# func_convert_file_noop ARG
+# Copy ARG to func_to_host_file_result.
+func_convert_file_noop ()
+{
+ func_to_host_file_result="$1"
+}
+# end func_convert_file_noop
+
+
+# func_convert_file_msys_to_w32 ARG
+# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper. Returns result in
+# func_to_host_file_result.
+func_convert_file_msys_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_msys_to_w32 "$1"
+ func_to_host_file_result="$func_convert_core_msys_to_w32_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_w32
+
+
+# func_convert_file_cygwin_to_w32 ARG
+# Convert file name ARG from Cygwin to w32 format. Returns result in
+# func_to_host_file_result.
+func_convert_file_cygwin_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
+ # LT_CYGPATH in this case.
+ func_to_host_file_result=`cygpath -m "$1"`
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_cygwin_to_w32
+
+
+# func_convert_file_nix_to_w32 ARG
+# Convert file name ARG from *nix to w32 format. Requires a wine environment
+# and a working winepath. Returns result in func_to_host_file_result.
+func_convert_file_nix_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_file_wine_to_w32 "$1"
+ func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_w32
+
+
+# func_convert_file_msys_to_cygwin ARG
+# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_file_msys_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_msys_to_w32 "$1"
+ func_cygpath -u "$func_convert_core_msys_to_w32_result"
+ func_to_host_file_result="$func_cygpath_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_cygwin
+
+
+# func_convert_file_nix_to_cygwin ARG
+# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
+# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
+# in func_to_host_file_result.
+func_convert_file_nix_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
+ func_convert_core_file_wine_to_w32 "$1"
+ func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
+ func_to_host_file_result="$func_cygpath_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_cygwin
+
+
+#############################################
+# $build to $host PATH CONVERSION FUNCTIONS #
+#############################################
+# invoked via `$to_host_path_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# The result will be available in $func_to_host_path_result.
+#
+# Path separators are also converted from $build format to $host format. If
+# ARG begins or ends with a path separator character, it is preserved (but
+# converted to $host format) on output.
+#
+# All path conversion functions are named using the following convention:
+# file name conversion function : func_convert_file_X_to_Y ()
+# path conversion function : func_convert_path_X_to_Y ()
+# where, for any given $build/$host combination the 'X_to_Y' value is the
+# same. If conversion functions are added for new $build/$host combinations,
+# the two new functions must follow this pattern, or func_init_to_host_path_cmd
+# will break.
+
+
+# func_init_to_host_path_cmd
+# Ensures that function "pointer" variable $to_host_path_cmd is set to the
+# appropriate value, based on the value of $to_host_file_cmd.
+to_host_path_cmd=
+func_init_to_host_path_cmd ()
+{
+ $opt_debug
+ if test -z "$to_host_path_cmd"; then
+ func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
+ to_host_path_cmd="func_convert_path_${func_stripname_result}"
+ fi
+}
+
+
+# func_to_host_path ARG
+# Converts the path ARG from $build format to $host format. Return result
+# in func_to_host_path_result.
+func_to_host_path ()
+{
+ $opt_debug
+ func_init_to_host_path_cmd
+ $to_host_path_cmd "$1"
+}
+# end func_to_host_path
+
+
+# func_convert_path_noop ARG
+# Copy ARG to func_to_host_path_result.
+func_convert_path_noop ()
+{
+ func_to_host_path_result="$1"
+}
+# end func_convert_path_noop
+
+
+# func_convert_path_msys_to_w32 ARG
+# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper. Returns result in
+# func_to_host_path_result.
+func_convert_path_msys_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # Remove leading and trailing path separator characters from ARG. MSYS
+ # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
+ # and winepath ignores them completely.
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+ func_to_host_path_result="$func_convert_core_msys_to_w32_result"
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_msys_to_w32
+
+
+# func_convert_path_cygwin_to_w32 ARG
+# Convert path ARG from Cygwin to w32 format. Returns result in
+# func_to_host_file_result.
+func_convert_path_cygwin_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_cygwin_to_w32
+
+
+# func_convert_path_nix_to_w32 ARG
+# Convert path ARG from *nix to w32 format. Requires a wine environment and
+# a working winepath. Returns result in func_to_host_file_result.
+func_convert_path_nix_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+ func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_nix_to_w32
+
+
+# func_convert_path_msys_to_cygwin ARG
+# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_path_msys_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+ func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
+ func_to_host_path_result="$func_cygpath_result"
+ func_convert_path_check : : \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ fi
+}
+# end func_convert_path_msys_to_cygwin
+
+
+# func_convert_path_nix_to_cygwin ARG
+# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
+# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
+# func_to_host_file_result.
+func_convert_path_nix_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # Remove leading and trailing path separator characters from
+ # ARG. msys behavior is inconsistent here, cygpath turns them
+ # into '.;' and ';.', and winepath ignores them completely.
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+ func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
+ func_to_host_path_result="$func_cygpath_result"
+ func_convert_path_check : : \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ fi
+}
+# end func_convert_path_nix_to_cygwin
+
+
+# func_mode_compile arg...
+func_mode_compile ()
+{
+ $opt_debug
+ # Get the compilation command and the source file.
+ base_compile=
+ srcfile="$nonopt" # always keep a non-empty value in "srcfile"
+ suppress_opt=yes
+ suppress_output=
+ arg_mode=normal
+ libobj=
+ later=
+ pie_flag=
+
+ for arg
+ do
+ case $arg_mode in
+ arg )
+ # do not "continue". Instead, add this to base_compile
+ lastarg="$arg"
+ arg_mode=normal
+ ;;
+
+ target )
+ libobj="$arg"
+ arg_mode=normal
+ continue
+ ;;
+
+ normal )
+ # Accept any command-line options.
+ case $arg in
+ -o)
+ test -n "$libobj" && \
+ func_fatal_error "you cannot specify \`-o' more than once"
+ arg_mode=target
+ continue
+ ;;
+
+ -pie | -fpie | -fPIE)
+ func_append pie_flag " $arg"
+ continue
+ ;;
+
+ -shared | -static | -prefer-pic | -prefer-non-pic)
+ func_append later " $arg"
+ continue
+ ;;
+
+ -no-suppress)
+ suppress_opt=no
+ continue
+ ;;
+
+ -Xcompiler)
+ arg_mode=arg # the next one goes into the "base_compile" arg list
+ continue # The current "srcfile" will either be retained or
+ ;; # replaced later. I would guess that would be a bug.
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ lastarg=
+ save_ifs="$IFS"; IFS=','
+ for arg in $args; do
+ IFS="$save_ifs"
+ func_append_quoted lastarg "$arg"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$lastarg"
+ lastarg=$func_stripname_result
+
+ # Add the arguments to base_compile.
+ func_append base_compile " $lastarg"
+ continue
+ ;;
+
+ *)
+ # Accept the current argument as the source file.
+ # The previous "srcfile" becomes the current argument.
+ #
+ lastarg="$srcfile"
+ srcfile="$arg"
+ ;;
+ esac # case $arg
+ ;;
+ esac # case $arg_mode
+
+ # Aesthetically quote the previous argument.
+ func_append_quoted base_compile "$lastarg"
+ done # for arg
+
+ case $arg_mode in
+ arg)
+ func_fatal_error "you must specify an argument for -Xcompile"
+ ;;
+ target)
+ func_fatal_error "you must specify a target with \`-o'"
+ ;;
+ *)
+ # Get the name of the library object.
+ test -z "$libobj" && {
+ func_basename "$srcfile"
+ libobj="$func_basename_result"
+ }
+ ;;
+ esac
+
+ # Recognize several different file suffixes.
+ # If the user specifies -o file.o, it is replaced with file.lo
+ case $libobj in
+ *.[cCFSifmso] | \
+ *.ada | *.adb | *.ads | *.asm | \
+ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
+ func_xform "$libobj"
+ libobj=$func_xform_result
+ ;;
+ esac
+
+ case $libobj in
+ *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+ *)
+ func_fatal_error "cannot determine name of library object from \`$libobj'"
+ ;;
+ esac
+
+ func_infer_tag $base_compile
+
+ for arg in $later; do
+ case $arg in
+ -shared)
+ test "$build_libtool_libs" != yes && \
+ func_fatal_configuration "can not build a shared library"
+ build_old_libs=no
+ continue
+ ;;
+
+ -static)
+ build_libtool_libs=no
+ build_old_libs=yes
+ continue
+ ;;
+
+ -prefer-pic)
+ pic_mode=yes
+ continue
+ ;;
+
+ -prefer-non-pic)
+ pic_mode=no
+ continue
+ ;;
+ esac
+ done
+
+ func_quote_for_eval "$libobj"
+ test "X$libobj" != "X$func_quote_for_eval_result" \
+ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
+ && func_warning "libobj name \`$libobj' may not contain shell special characters."
+ func_dirname_and_basename "$obj" "/" ""
+ objname="$func_basename_result"
+ xdir="$func_dirname_result"
+ lobj=${xdir}$objdir/$objname
+
+ test -z "$base_compile" && \
+ func_fatal_help "you must specify a compilation command"
+
+ # Delete any leftover library objects.
+ if test "$build_old_libs" = yes; then
+ removelist="$obj $lobj $libobj ${libobj}T"
+ else
+ removelist="$lobj $libobj ${libobj}T"
+ fi
+
+ # On Cygwin there's no "real" PIC flag so we must build both object types
+ case $host_os in
+ cygwin* | mingw* | pw32* | os2* | cegcc*)
+ pic_mode=default
+ ;;
+ esac
+ if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+ # non-PIC code in shared libraries is not supported
+ pic_mode=default
+ fi
+
+ # Calculate the filename of the output object if compiler does
+ # not support -o with -c
+ if test "$compiler_c_o" = no; then
+ output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
+ lockfile="$output_obj.lock"
+ else
+ output_obj=
+ need_locks=no
+ lockfile=
+ fi
+
+ # Lock this critical section if it is needed
+ # We use this script file to make the link, it avoids creating a new file
+ if test "$need_locks" = yes; then
+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+ func_echo "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ elif test "$need_locks" = warn; then
+ if test -f "$lockfile"; then
+ $ECHO "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+ func_append removelist " $output_obj"
+ $ECHO "$srcfile" > "$lockfile"
+ fi
+
+ $opt_dry_run || $RM $removelist
+ func_append removelist " $lockfile"
+ trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+
+ func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
+ srcfile=$func_to_tool_file_result
+ func_quote_for_eval "$srcfile"
+ qsrcfile=$func_quote_for_eval_result
+
+ # Only build a PIC object if we are building libtool libraries.
+ if test "$build_libtool_libs" = yes; then
+ # Without this assignment, base_compile gets emptied.
+ fbsd_hideous_sh_bug=$base_compile
+
+ if test "$pic_mode" != no; then
+ command="$base_compile $qsrcfile $pic_flag"
+ else
+ # Don't build PIC code
+ command="$base_compile $qsrcfile"
+ fi
+
+ func_mkdir_p "$xdir$objdir"
+
+ if test -z "$output_obj"; then
+ # Place PIC objects in $objdir
+ func_append command " -o $lobj"
+ fi
+
+ func_show_eval_locale "$command" \
+ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed, then go on to compile the next one
+ if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+ func_show_eval '$MV "$output_obj" "$lobj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+
+ # Allow error messages only from the first compilation.
+ if test "$suppress_opt" = yes; then
+ suppress_output=' >/dev/null 2>&1'
+ fi
+ fi
+
+ # Only build a position-dependent object if we build old libraries.
+ if test "$build_old_libs" = yes; then
+ if test "$pic_mode" != yes; then
+ # Don't build PIC code
+ command="$base_compile $qsrcfile$pie_flag"
+ else
+ command="$base_compile $qsrcfile $pic_flag"
+ fi
+ if test "$compiler_c_o" = yes; then
+ func_append command " -o $obj"
+ fi
+
+ # Suppress compiler output if we already did a PIC compilation.
+ func_append command "$suppress_output"
+ func_show_eval_locale "$command" \
+ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed
+ if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+ func_show_eval '$MV "$output_obj" "$obj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+ fi
+
+ $opt_dry_run || {
+ func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
+
+ # Unlock the critical section if it was locked
+ if test "$need_locks" != no; then
+ removelist=$lockfile
+ $RM "$lockfile"
+ fi
+ }
+
+ exit $EXIT_SUCCESS
+}
+
+$opt_help || {
+ test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
+}
+
+func_mode_help ()
+{
+ # We need to display help for each of the modes.
+ case $opt_mode in
+ "")
+ # Generic help is extracted from the usage comments
+ # at the start of this file.
+ func_help
+ ;;
+
+ clean)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+ compile)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+ -o OUTPUT-FILE set the output file name to OUTPUT-FILE
+ -no-suppress do not suppress compiler output for multiple passes
+ -prefer-pic try to build PIC objects only
+ -prefer-non-pic try to build non-PIC objects only
+ -shared do not build a \`.o' file suitable for static linking
+ -static only build a \`.o' file suitable for static linking
+ -Wc,FLAG pass FLAG directly to the compiler
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+ ;;
+
+ execute)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+ -dlopen FILE add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+ ;;
+
+ finish)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges. Use
+the \`--dry-run' option if you just want to see what would be executed."
+ ;;
+
+ install)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command. The first component should be
+either the \`install' or \`cp' program.
+
+The following components of INSTALL-COMMAND are treated specially:
+
+ -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+ ;;
+
+ link)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+ -all-static do not do any dynamic linking at all
+ -avoid-version do not add a version suffix if possible
+ -bindir BINDIR specify path to binaries directory (for systems where
+ libraries must be found in the PATH setting at runtime)
+ -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
+ -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
+ -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+ -export-symbols SYMFILE
+ try to export only the symbols listed in SYMFILE
+ -export-symbols-regex REGEX
+ try to export only the symbols matching REGEX
+ -LLIBDIR search LIBDIR for required installed libraries
+ -lNAME OUTPUT-FILE requires the installed library libNAME
+ -module build a library that can dlopened
+ -no-fast-install disable the fast-install mode
+ -no-install link a not-installable executable
+ -no-undefined declare that a library does not refer to external symbols
+ -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
+ -objectlist FILE Use a list of object files found in FILE to specify objects
+ -precious-files-regex REGEX
+ don't remove output files matching REGEX
+ -release RELEASE specify package release information
+ -rpath LIBDIR the created library will eventually be installed in LIBDIR
+ -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
+ -shared only do dynamic linking of libtool libraries
+ -shrext SUFFIX override the standard shared library file extension
+ -static do not do any dynamic linking of uninstalled libtool libraries
+ -static-libtool-libs
+ do not do any dynamic linking of libtool libraries
+ -version-info CURRENT[:REVISION[:AGE]]
+ specify library version info [each variable defaults to 0]
+ -weak LIBNAME declare that the target provides the LIBNAME interface
+ -Wc,FLAG
+ -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
+ -Wl,FLAG
+ -Xlinker FLAG pass linker-specific FLAG directly to the linker
+ -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename. Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+ ;;
+
+ uninstall)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+ *)
+ func_fatal_help "invalid operation mode \`$opt_mode'"
+ ;;
+ esac
+
+ echo
+ $ECHO "Try \`$progname --help' for more information about other modes."
+}
+
+# Now that we've collected a possible --mode arg, show help if necessary
+if $opt_help; then
+ if test "$opt_help" = :; then
+ func_mode_help
+ else
+ {
+ func_help noexit
+ for opt_mode in compile link execute install finish uninstall clean; do
+ func_mode_help
+ done
+ } | sed -n '1p; 2,$s/^Usage:/ or: /p'
+ {
+ func_help noexit
+ for opt_mode in compile link execute install finish uninstall clean; do
+ echo
+ func_mode_help
+ done
+ } |
+ sed '1d
+ /^When reporting/,/^Report/{
+ H
+ d
+ }
+ $x
+ /information about other modes/d
+ /more detailed .*MODE/d
+ s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
+ fi
+ exit $?
+fi
+
+
+# func_mode_execute arg...
+func_mode_execute ()
+{
+ $opt_debug
+ # The first argument is the command name.
+ cmd="$nonopt"
+ test -z "$cmd" && \
+ func_fatal_help "you must specify a COMMAND"
+
+ # Handle -dlopen flags immediately.
+ for file in $opt_dlopen; do
+ test -f "$file" \
+ || func_fatal_help "\`$file' is not a file"
+
+ dir=
+ case $file in
+ *.la)
+ func_resolve_sysroot "$file"
+ file=$func_resolve_sysroot_result
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "\`$lib' is not a valid libtool archive"
+
+ # Read the libtool library.
+ dlname=
+ library_names=
+ func_source "$file"
+
+ # Skip this library if it cannot be dlopened.
+ if test -z "$dlname"; then
+ # Warn if it was a shared library.
+ test -n "$library_names" && \
+ func_warning "\`$file' was not linked with \`-export-dynamic'"
+ continue
+ fi
+
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+
+ if test -f "$dir/$objdir/$dlname"; then
+ func_append dir "/$objdir"
+ else
+ if test ! -f "$dir/$dlname"; then
+ func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+ fi
+ fi
+ ;;
+
+ *.lo)
+ # Just add the directory containing the .lo file.
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+ ;;
+
+ *)
+ func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+ continue
+ ;;
+ esac
+
+ # Get the absolute pathname.
+ absdir=`cd "$dir" && pwd`
+ test -n "$absdir" && dir="$absdir"
+
+ # Now add the directory to shlibpath_var.
+ if eval "test -z \"\$$shlibpath_var\""; then
+ eval "$shlibpath_var=\"\$dir\""
+ else
+ eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+ fi
+ done
+
+ # This variable tells wrapper scripts just to set shlibpath_var
+ # rather than running their programs.
+ libtool_execute_magic="$magic"
+
+ # Check if any of the arguments is a wrapper script.
+ args=
+ for file
+ do
+ case $file in
+ -* | *.la | *.lo ) ;;
+ *)
+ # Do a test to see if this is really a libtool program.
+ if func_ltwrapper_script_p "$file"; then
+ func_source "$file"
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ elif func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ func_source "$func_ltwrapper_scriptname_result"
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ fi
+ ;;
+ esac
+ # Quote arguments (to preserve shell metacharacters).
+ func_append_quoted args "$file"
+ done
+
+ if test "X$opt_dry_run" = Xfalse; then
+ if test -n "$shlibpath_var"; then
+ # Export the shlibpath_var.
+ eval "export $shlibpath_var"
+ fi
+
+ # Restore saved environment variables
+ for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+ do
+ eval "if test \"\${save_$lt_var+set}\" = set; then
+ $lt_var=\$save_$lt_var; export $lt_var
+ else
+ $lt_unset $lt_var
+ fi"
+ done
+
+ # Now prepare to actually exec the command.
+ exec_cmd="\$cmd$args"
+ else
+ # Display what would be done.
+ if test -n "$shlibpath_var"; then
+ eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+ echo "export $shlibpath_var"
+ fi
+ $ECHO "$cmd$args"
+ exit $EXIT_SUCCESS
+ fi
+}
+
+test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+ $opt_debug
+ libs=
+ libdirs=
+ admincmds=
+
+ for opt in "$nonopt" ${1+"$@"}
+ do
+ if test -d "$opt"; then
+ func_append libdirs " $opt"
+
+ elif test -f "$opt"; then
+ if func_lalib_unsafe_p "$opt"; then
+ func_append libs " $opt"
+ else
+ func_warning "\`$opt' is not a valid libtool archive"
+ fi
+
+ else
+ func_fatal_error "invalid argument \`$opt'"
+ fi
+ done
+
+ if test -n "$libs"; then
+ if test -n "$lt_sysroot"; then
+ sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
+ sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
+ else
+ sysroot_cmd=
+ fi
+
+ # Remove sysroot references
+ if $opt_dry_run; then
+ for lib in $libs; do
+ echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
+ done
+ else
+ tmpdir=`func_mktempdir`
+ for lib in $libs; do
+ sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+ > $tmpdir/tmp-la
+ mv -f $tmpdir/tmp-la $lib
+ done
+ ${RM}r "$tmpdir"
+ fi
+ fi
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ for libdir in $libdirs; do
+ if test -n "$finish_cmds"; then
+ # Do each command in the finish commands.
+ func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
+'"$cmd"'"'
+ fi
+ if test -n "$finish_eval"; then
+ # Do the single finish_eval.
+ eval cmds=\"$finish_eval\"
+ $opt_dry_run || eval "$cmds" || func_append admincmds "
+ $cmds"
+ fi
+ done
+ fi
+
+ # Exit here if they wanted silent mode.
+ $opt_silent && exit $EXIT_SUCCESS
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ echo "----------------------------------------------------------------------"
+ echo "Libraries have been installed in:"
+ for libdir in $libdirs; do
+ $ECHO " $libdir"
+ done
+ echo
+ echo "If you ever happen to want to link against installed libraries"
+ echo "in a given directory, LIBDIR, you must either use libtool, and"
+ echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+ echo "flag during linking and do at least one of the following:"
+ if test -n "$shlibpath_var"; then
+ echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
+ echo " during execution"
+ fi
+ if test -n "$runpath_var"; then
+ echo " - add LIBDIR to the \`$runpath_var' environment variable"
+ echo " during linking"
+ fi
+ if test -n "$hardcode_libdir_flag_spec"; then
+ libdir=LIBDIR
+ eval flag=\"$hardcode_libdir_flag_spec\"
+
+ $ECHO " - use the \`$flag' linker flag"
+ fi
+ if test -n "$admincmds"; then
+ $ECHO " - have your system administrator run these commands:$admincmds"
+ fi
+ if test -f /etc/ld.so.conf; then
+ echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+ fi
+ echo
+
+ echo "See any operating system documentation about shared libraries for"
+ case $host in
+ solaris2.[6789]|solaris2.1[0-9])
+ echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+ echo "pages."
+ ;;
+ *)
+ echo "more information, such as the ld(1) and ld.so(8) manual pages."
+ ;;
+ esac
+ echo "----------------------------------------------------------------------"
+ fi
+ exit $EXIT_SUCCESS
+}
+
+test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
+
+
+# func_mode_install arg...
+func_mode_install ()
+{
+ $opt_debug
+ # There may be an optional sh(1) argument at the beginning of
+ # install_prog (especially on Windows NT).
+ if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+ # Allow the use of GNU shtool's install command.
+ case $nonopt in *shtool*) :;; *) false;; esac; then
+ # Aesthetically quote it.
+ func_quote_for_eval "$nonopt"
+ install_prog="$func_quote_for_eval_result "
+ arg=$1
+ shift
+ else
+ install_prog=
+ arg=$nonopt
+ fi
+
+ # The real first argument should be the name of the installation program.
+ # Aesthetically quote it.
+ func_quote_for_eval "$arg"
+ func_append install_prog "$func_quote_for_eval_result"
+ install_shared_prog=$install_prog
+ case " $install_prog " in
+ *[\\\ /]cp\ *) install_cp=: ;;
+ *) install_cp=false ;;
+ esac
+
+ # We need to accept at least all the BSD install flags.
+ dest=
+ files=
+ opts=
+ prev=
+ install_type=
+ isdir=no
+ stripme=
+ no_mode=:
+ for arg
+ do
+ arg2=
+ if test -n "$dest"; then
+ func_append files " $dest"
+ dest=$arg
+ continue
+ fi
+
+ case $arg in
+ -d) isdir=yes ;;
+ -f)
+ if $install_cp; then :; else
+ prev=$arg
+ fi
+ ;;
+ -g | -m | -o)
+ prev=$arg
+ ;;
+ -s)
+ stripme=" -s"
+ continue
+ ;;
+ -*)
+ ;;
+ *)
+ # If the previous option needed an argument, then skip it.
+ if test -n "$prev"; then
+ if test "x$prev" = x-m && test -n "$install_override_mode"; then
+ arg2=$install_override_mode
+ no_mode=false
+ fi
+ prev=
+ else
+ dest=$arg
+ continue
+ fi
+ ;;
+ esac
+
+ # Aesthetically quote the argument.
+ func_quote_for_eval "$arg"
+ func_append install_prog " $func_quote_for_eval_result"
+ if test -n "$arg2"; then
+ func_quote_for_eval "$arg2"
+ fi
+ func_append install_shared_prog " $func_quote_for_eval_result"
+ done
+
+ test -z "$install_prog" && \
+ func_fatal_help "you must specify an install program"
+
+ test -n "$prev" && \
+ func_fatal_help "the \`$prev' option requires an argument"
+
+ if test -n "$install_override_mode" && $no_mode; then
+ if $install_cp; then :; else
+ func_quote_for_eval "$install_override_mode"
+ func_append install_shared_prog " -m $func_quote_for_eval_result"
+ fi
+ fi
+
+ if test -z "$files"; then
+ if test -z "$dest"; then
+ func_fatal_help "no file or destination specified"
+ else
+ func_fatal_help "you must specify a destination"
+ fi
+ fi
+
+ # Strip any trailing slash from the destination.
+ func_stripname '' '/' "$dest"
+ dest=$func_stripname_result
+
+ # Check to see that the destination is a directory.
+ test -d "$dest" && isdir=yes
+ if test "$isdir" = yes; then
+ destdir="$dest"
+ destname=
+ else
+ func_dirname_and_basename "$dest" "" "."
+ destdir="$func_dirname_result"
+ destname="$func_basename_result"
+
+ # Not a directory, so check to see that there is only one file specified.
+ set dummy $files; shift
+ test "$#" -gt 1 && \
+ func_fatal_help "\`$dest' is not a directory"
+ fi
+ case $destdir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ for file in $files; do
+ case $file in
+ *.lo) ;;
+ *)
+ func_fatal_help "\`$destdir' must be an absolute directory name"
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ staticlibs=
+ future_libdirs=
+ current_libdirs=
+ for file in $files; do
+
+ # Do each installation.
+ case $file in
+ *.$libext)
+ # Do the static libraries later.
+ func_append staticlibs " $file"
+ ;;
+
+ *.la)
+ func_resolve_sysroot "$file"
+ file=$func_resolve_sysroot_result
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "\`$file' is not a valid libtool archive"
+
+ library_names=
+ old_library=
+ relink_command=
+ func_source "$file"
+
+ # Add the libdir to current_libdirs if it is the destination.
+ if test "X$destdir" = "X$libdir"; then
+ case "$current_libdirs " in
+ *" $libdir "*) ;;
+ *) func_append current_libdirs " $libdir" ;;
+ esac
+ else
+ # Note the libdir as a future libdir.
+ case "$future_libdirs " in
+ *" $libdir "*) ;;
+ *) func_append future_libdirs " $libdir" ;;
+ esac
+ fi
+
+ func_dirname "$file" "/" ""
+ dir="$func_dirname_result"
+ func_append dir "$objdir"
+
+ if test -n "$relink_command"; then
+ # Determine the prefix the user has applied to our future dir.
+ inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
+
+ # Don't allow the user to place us outside of our expected
+ # location b/c this prevents finding dependent libraries that
+ # are installed to the same prefix.
+ # At present, this check doesn't affect windows .dll's that
+ # are installed into $libdir/../bin (currently, that works fine)
+ # but it's something to keep an eye on.
+ test "$inst_prefix_dir" = "$destdir" && \
+ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+
+ if test -n "$inst_prefix_dir"; then
+ # Stick the inst_prefix_dir data into the link command.
+ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+ else
+ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+ fi
+
+ func_warning "relinking \`$file'"
+ func_show_eval "$relink_command" \
+ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+ fi
+
+ # See the names of the shared library.
+ set dummy $library_names; shift
+ if test -n "$1"; then
+ realname="$1"
+ shift
+
+ srcname="$realname"
+ test -n "$relink_command" && srcname="$realname"T
+
+ # Install the shared library and build the symlinks.
+ func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
+ 'exit $?'
+ tstripme="$stripme"
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $realname in
+ *.dll.a)
+ tstripme=""
+ ;;
+ esac
+ ;;
+ esac
+ if test -n "$tstripme" && test -n "$striplib"; then
+ func_show_eval "$striplib $destdir/$realname" 'exit $?'
+ fi
+
+ if test "$#" -gt 0; then
+ # Delete the old symlinks, and create new ones.
+ # Try `ln -sf' first, because the `ln' binary might depend on
+ # the symlink we replace! Solaris /bin/ln does not understand -f,
+ # so we also need to try rm && ln -s.
+ for linkname
+ do
+ test "$linkname" != "$realname" \
+ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
+ done
+ fi
+
+ # Do each command in the postinstall commands.
+ lib="$destdir/$realname"
+ func_execute_cmds "$postinstall_cmds" 'exit $?'
+ fi
+
+ # Install the pseudo-library for information purposes.
+ func_basename "$file"
+ name="$func_basename_result"
+ instname="$dir/$name"i
+ func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+
+ # Maybe install the static library, too.
+ test -n "$old_library" && func_append staticlibs " $dir/$old_library"
+ ;;
+
+ *.lo)
+ # Install (i.e. copy) a libtool object.
+
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ func_basename "$file"
+ destfile="$func_basename_result"
+ destfile="$destdir/$destfile"
+ fi
+
+ # Deduce the name of the destination old-style object file.
+ case $destfile in
+ *.lo)
+ func_lo2o "$destfile"
+ staticdest=$func_lo2o_result
+ ;;
+ *.$objext)
+ staticdest="$destfile"
+ destfile=
+ ;;
+ *)
+ func_fatal_help "cannot copy a libtool object to \`$destfile'"
+ ;;
+ esac
+
+ # Install the libtool object if requested.
+ test -n "$destfile" && \
+ func_show_eval "$install_prog $file $destfile" 'exit $?'
+
+ # Install the old object if enabled.
+ if test "$build_old_libs" = yes; then
+ # Deduce the name of the old-style object file.
+ func_lo2o "$file"
+ staticobj=$func_lo2o_result
+ func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
+ fi
+ exit $EXIT_SUCCESS
+ ;;
+
+ *)
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ func_basename "$file"
+ destfile="$func_basename_result"
+ destfile="$destdir/$destfile"
+ fi
+
+ # If the file is missing, and there is a .exe on the end, strip it
+ # because it is most likely a libtool script we actually want to
+ # install
+ stripped_ext=""
+ case $file in
+ *.exe)
+ if test ! -f "$file"; then
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ stripped_ext=".exe"
+ fi
+ ;;
+ esac
+
+ # Do a test to see if this is really a libtool program.
+ case $host in
+ *cygwin* | *mingw*)
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ wrapper=$func_ltwrapper_scriptname_result
+ else
+ func_stripname '' '.exe' "$file"
+ wrapper=$func_stripname_result
+ fi
+ ;;
+ *)
+ wrapper=$file
+ ;;
+ esac
+ if func_ltwrapper_script_p "$wrapper"; then
+ notinst_deplibs=
+ relink_command=
+
+ func_source "$wrapper"
+
+ # Check the variables that should have been set.
+ test -z "$generated_by_libtool_version" && \
+ func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+
+ finalize=yes
+ for lib in $notinst_deplibs; do
+ # Check to see that each library is installed.
+ libdir=
+ if test -f "$lib"; then
+ func_source "$lib"
+ fi
+ libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
+ if test -n "$libdir" && test ! -f "$libfile"; then
+ func_warning "\`$lib' has not been installed in \`$libdir'"
+ finalize=no
+ fi
+ done
+
+ relink_command=
+ func_source "$wrapper"
+
+ outputname=
+ if test "$fast_install" = no && test -n "$relink_command"; then
+ $opt_dry_run || {
+ if test "$finalize" = yes; then
+ tmpdir=`func_mktempdir`
+ func_basename "$file$stripped_ext"
+ file="$func_basename_result"
+ outputname="$tmpdir/$file"
+ # Replace the output file specification.
+ relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
+
+ $opt_silent || {
+ func_quote_for_expand "$relink_command"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ if eval "$relink_command"; then :
+ else
+ func_error "error: relink \`$file' with the above command before installing it"
+ $opt_dry_run || ${RM}r "$tmpdir"
+ continue
+ fi
+ file="$outputname"
+ else
+ func_warning "cannot relink \`$file'"
+ fi
+ }
+ else
+ # Install the binary that we compiled earlier.
+ file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
+ fi
+ fi
+
+ # remove .exe since cygwin /usr/bin/install will append another
+ # one anyway
+ case $install_prog,$host in
+ */usr/bin/install*,*cygwin*)
+ case $file:$destfile in
+ *.exe:*.exe)
+ # this is ok
+ ;;
+ *.exe:*)
+ destfile=$destfile.exe
+ ;;
+ *:*.exe)
+ func_stripname '' '.exe' "$destfile"
+ destfile=$func_stripname_result
+ ;;
+ esac
+ ;;
+ esac
+ func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+ $opt_dry_run || if test -n "$outputname"; then
+ ${RM}r "$tmpdir"
+ fi
+ ;;
+ esac
+ done
+
+ for file in $staticlibs; do
+ func_basename "$file"
+ name="$func_basename_result"
+
+ # Set up the ranlib parameters.
+ oldlib="$destdir/$name"
+ func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+ tool_oldlib=$func_to_tool_file_result
+
+ func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
+
+ if test -n "$stripme" && test -n "$old_striplib"; then
+ func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
+ fi
+
+ # Do each command in the postinstall commands.
+ func_execute_cmds "$old_postinstall_cmds" 'exit $?'
+ done
+
+ test -n "$future_libdirs" && \
+ func_warning "remember to run \`$progname --finish$future_libdirs'"
+
+ if test -n "$current_libdirs"; then
+ # Maybe just do a dry run.
+ $opt_dry_run && current_libdirs=" -n$current_libdirs"
+ exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+ else
+ exit $EXIT_SUCCESS
+ fi
+}
+
+test "$opt_mode" = install && func_mode_install ${1+"$@"}
+
+
+# func_generate_dlsyms outputname originator pic_p
+# Extract symbols from dlprefiles and create ${outputname}S.o with
+# a dlpreopen symbol table.
+func_generate_dlsyms ()
+{
+ $opt_debug
+ my_outputname="$1"
+ my_originator="$2"
+ my_pic_p="${3-no}"
+ my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+ my_dlsyms=
+
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ if test -n "$NM" && test -n "$global_symbol_pipe"; then
+ my_dlsyms="${my_outputname}S.c"
+ else
+ func_error "not configured to extract global symbols from dlpreopened files"
+ fi
+ fi
+
+ if test -n "$my_dlsyms"; then
+ case $my_dlsyms in
+ "") ;;
+ *.c)
+ # Discover the nlist of each of the dlfiles.
+ nlist="$output_objdir/${my_outputname}.nm"
+
+ func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
+
+ # Parse the name list into a source file.
+ func_verbose "creating $output_objdir/$my_dlsyms"
+
+ $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
+/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
+#endif
+
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+/* External symbol declarations for the compiler. */\
+"
+
+ if test "$dlself" = yes; then
+ func_verbose "generating symbol list for \`$output'"
+
+ $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
+
+ # Add our own program objects to the symbol list.
+ progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ for progfile in $progfiles; do
+ func_to_tool_file "$progfile" func_convert_file_msys_to_w32
+ func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
+ $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -n "$exclude_expsyms"; then
+ $opt_dry_run || {
+ eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ if test -n "$export_symbols_regex"; then
+ $opt_dry_run || {
+ eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ export_symbols="$output_objdir/$outputname.exp"
+ $opt_dry_run || {
+ $RM $export_symbols
+ eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ else
+ $opt_dry_run || {
+ eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+ eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ fi
+ fi
+
+ for dlprefile in $dlprefiles; do
+ func_verbose "extracting global C symbols from \`$dlprefile'"
+ func_basename "$dlprefile"
+ name="$func_basename_result"
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ # if an import library, we need to obtain dlname
+ if func_win32_import_lib_p "$dlprefile"; then
+ func_tr_sh "$dlprefile"
+ eval "curr_lafile=\$libfile_$func_tr_sh_result"
+ dlprefile_dlbasename=""
+ if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
+ # Use subshell, to avoid clobbering current variable values
+ dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
+ if test -n "$dlprefile_dlname" ; then
+ func_basename "$dlprefile_dlname"
+ dlprefile_dlbasename="$func_basename_result"
+ else
+ # no lafile. user explicitly requested -dlpreopen <import library>.
+ $sharedlib_from_linklib_cmd "$dlprefile"
+ dlprefile_dlbasename=$sharedlib_from_linklib_result
+ fi
+ fi
+ $opt_dry_run || {
+ if test -n "$dlprefile_dlbasename" ; then
+ eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
+ else
+ func_warning "Could not compute DLL name from $name"
+ eval '$ECHO ": $name " >> "$nlist"'
+ fi
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
+ $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
+ }
+ else # not an import lib
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ fi
+ ;;
+ *)
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ ;;
+ esac
+ done
+
+ $opt_dry_run || {
+ # Make sure we have at least an empty file.
+ test -f "$nlist" || : > "$nlist"
+
+ if test -n "$exclude_expsyms"; then
+ $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+ $MV "$nlist"T "$nlist"
+ fi
+
+ # Try sorting and uniquifying the output.
+ if $GREP -v "^: " < "$nlist" |
+ if sort -k 3 </dev/null >/dev/null 2>&1; then
+ sort -k 3
+ else
+ sort +2
+ fi |
+ uniq > "$nlist"S; then
+ :
+ else
+ $GREP -v "^: " < "$nlist" > "$nlist"S
+ fi
+
+ if test -f "$nlist"S; then
+ eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
+ else
+ echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
+ fi
+
+ echo >> "$output_objdir/$my_dlsyms" "\
+
+/* The mapping between symbol names and symbols. */
+typedef struct {
+ const char *name;
+ void *address;
+} lt_dlsymlist;
+extern LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[];
+LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[] =
+{\
+ { \"$my_originator\", (void *) 0 },"
+
+ case $need_lib_prefix in
+ no)
+ eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ *)
+ eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ esac
+ echo >> "$output_objdir/$my_dlsyms" "\
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt_${my_prefix}_LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+ } # !$opt_dry_run
+
+ pic_flag_for_symtable=
+ case "$compile_command " in
+ *" -static "*) ;;
+ *)
+ case $host in
+ # compiling the symbol table file with pic_flag works around
+ # a FreeBSD bug that causes programs to crash when -lm is
+ # linked before any other PIC object. But we must not use
+ # pic_flag when linking with -static. The problem exists in
+ # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+ *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+ pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
+ *-*-hpux*)
+ pic_flag_for_symtable=" $pic_flag" ;;
+ *)
+ if test "X$my_pic_p" != Xno; then
+ pic_flag_for_symtable=" $pic_flag"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ symtab_cflags=
+ for arg in $LTCFLAGS; do
+ case $arg in
+ -pie | -fpie | -fPIE) ;;
+ *) func_append symtab_cflags " $arg" ;;
+ esac
+ done
+
+ # Now compile the dynamic symbol file.
+ func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
+
+ # Clean up the generated files.
+ func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+
+ # Transform the symbol file into the correct name.
+ symfileobj="$output_objdir/${my_outputname}S.$objext"
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ if test -f "$output_objdir/$my_outputname.def"; then
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ else
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ fi
+ ;;
+ *)
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ ;;
+ esac
+ ;;
+ *)
+ func_fatal_error "unknown suffix for \`$my_dlsyms'"
+ ;;
+ esac
+ else
+ # We keep going just in case the user didn't refer to
+ # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
+ # really was required.
+
+ # Nullify the symbol file.
+ compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
+ fi
+}
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+# Despite the name, also deal with 64 bit binaries.
+func_win32_libid ()
+{
+ $opt_debug
+ win32_libid_type="unknown"
+ win32_fileres=`file -L $1 2>/dev/null`
+ case $win32_fileres in
+ *ar\ archive\ import\ library*) # definitely import
+ win32_libid_type="x86 archive import"
+ ;;
+ *ar\ archive*) # could be an import, or static
+ # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
+ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
+ $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+ $SED -n -e '
+ 1,100{
+ / I /{
+ s,.*,import,
+ p
+ q
+ }
+ }'`
+ case $win32_nmres in
+ import*) win32_libid_type="x86 archive import";;
+ *) win32_libid_type="x86 archive static";;
+ esac
+ fi
+ ;;
+ *DLL*)
+ win32_libid_type="x86 DLL"
+ ;;
+ *executable*) # but shell scripts are "executable" too...
+ case $win32_fileres in
+ *MS\ Windows\ PE\ Intel*)
+ win32_libid_type="x86 DLL"
+ ;;
+ esac
+ ;;
+ esac
+ $ECHO "$win32_libid_type"
+}
+
+# func_cygming_dll_for_implib ARG
+#
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+# Invoked by eval'ing the libtool variable
+# $sharedlib_from_linklib_cmd
+# Result is available in the variable
+# $sharedlib_from_linklib_result
+func_cygming_dll_for_implib ()
+{
+ $opt_debug
+ sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
+}
+
+# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
+#
+# The is the core of a fallback implementation of a
+# platform-specific function to extract the name of the
+# DLL associated with the specified import library LIBNAME.
+#
+# SECTION_NAME is either .idata$6 or .idata$7, depending
+# on the platform and compiler that created the implib.
+#
+# Echos the name of the DLL associated with the
+# specified import library.
+func_cygming_dll_for_implib_fallback_core ()
+{
+ $opt_debug
+ match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
+ $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
+ $SED '/^Contents of section '"$match_literal"':/{
+ # Place marker at beginning of archive member dllname section
+ s/.*/====MARK====/
+ p
+ d
+ }
+ # These lines can sometimes be longer than 43 characters, but
+ # are always uninteresting
+ /:[ ]*file format pe[i]\{,1\}-/d
+ /^In archive [^:]*:/d
+ # Ensure marker is printed
+ /^====MARK====/p
+ # Remove all lines with less than 43 characters
+ /^.\{43\}/!d
+ # From remaining lines, remove first 43 characters
+ s/^.\{43\}//' |
+ $SED -n '
+ # Join marker and all lines until next marker into a single line
+ /^====MARK====/ b para
+ H
+ $ b para
+ b
+ :para
+ x
+ s/\n//g
+ # Remove the marker
+ s/^====MARK====//
+ # Remove trailing dots and whitespace
+ s/[\. \t]*$//
+ # Print
+ /./p' |
+ # we now have a list, one entry per line, of the stringified
+ # contents of the appropriate section of all members of the
+ # archive which possess that section. Heuristic: eliminate
+ # all those which have a first or second character that is
+ # a '.' (that is, objdump's representation of an unprintable
+ # character.) This should work for all archives with less than
+ # 0x302f exports -- but will fail for DLLs whose name actually
+ # begins with a literal '.' or a single character followed by
+ # a '.'.
+ #
+ # Of those that remain, print the first one.
+ $SED -e '/^\./d;/^.\./d;q'
+}
+
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+ $opt_debug
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+ test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+ $opt_debug
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+ test -n "$func_cygming_ms_implib_tmp"
+}
+
+# func_cygming_dll_for_implib_fallback ARG
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+#
+# This fallback implementation is for use when $DLLTOOL
+# does not support the --identify-strict option.
+# Invoked by eval'ing the libtool variable
+# $sharedlib_from_linklib_cmd
+# Result is available in the variable
+# $sharedlib_from_linklib_result
+func_cygming_dll_for_implib_fallback ()
+{
+ $opt_debug
+ if func_cygming_gnu_implib_p "$1" ; then
+ # binutils import library
+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
+ elif func_cygming_ms_implib_p "$1" ; then
+ # ms-generated import library
+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
+ else
+ # unknown
+ sharedlib_from_linklib_result=""
+ fi
+}
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+ $opt_debug
+ f_ex_an_ar_dir="$1"; shift
+ f_ex_an_ar_oldlib="$1"
+ if test "$lock_old_archive_extraction" = yes; then
+ lockfile=$f_ex_an_ar_oldlib.lock
+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+ func_echo "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ fi
+ func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
+ 'stat=$?; rm -f "$lockfile"; exit $stat'
+ if test "$lock_old_archive_extraction" = yes; then
+ $opt_dry_run || rm -f "$lockfile"
+ fi
+ if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
+ fi
+}
+
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+ $opt_debug
+ my_gentop="$1"; shift
+ my_oldlibs=${1+"$@"}
+ my_oldobjs=""
+ my_xlib=""
+ my_xabs=""
+ my_xdir=""
+
+ for my_xlib in $my_oldlibs; do
+ # Extract the objects.
+ case $my_xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+ *) my_xabs=`pwd`"/$my_xlib" ;;
+ esac
+ func_basename "$my_xlib"
+ my_xlib="$func_basename_result"
+ my_xlib_u=$my_xlib
+ while :; do
+ case " $extracted_archives " in
+ *" $my_xlib_u "*)
+ func_arith $extracted_serial + 1
+ extracted_serial=$func_arith_result
+ my_xlib_u=lt$extracted_serial-$my_xlib ;;
+ *) break ;;
+ esac
+ done
+ extracted_archives="$extracted_archives $my_xlib_u"
+ my_xdir="$my_gentop/$my_xlib_u"
+
+ func_mkdir_p "$my_xdir"
+
+ case $host in
+ *-darwin*)
+ func_verbose "Extracting $my_xabs"
+ # Do not bother doing anything if just a dry run
+ $opt_dry_run || {
+ darwin_orig_dir=`pwd`
+ cd $my_xdir || exit $?
+ darwin_archive=$my_xabs
+ darwin_curdir=`pwd`
+ darwin_base_archive=`basename "$darwin_archive"`
+ darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
+ if test -n "$darwin_arches"; then
+ darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
+ darwin_arch=
+ func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
+ for darwin_arch in $darwin_arches ; do
+ func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+ cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+ cd "$darwin_curdir"
+ $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+ done # $darwin_arches
+ ## Okay now we've a bunch of thin objects, gotta fatten them up :)
+ darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+ darwin_file=
+ darwin_files=
+ for darwin_file in $darwin_filelist; do
+ darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
+ $LIPO -create -output "$darwin_file" $darwin_files
+ done # $darwin_filelist
+ $RM -rf unfat-$$
+ cd "$darwin_orig_dir"
+ else
+ cd $darwin_orig_dir
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ fi # $darwin_arches
+ } # !$opt_dry_run
+ ;;
+ *)
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ ;;
+ esac
+ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
+ done
+
+ func_extract_archives_result="$my_oldobjs"
+}
+
+
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable. Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
+#
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take. If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the $objdir directory. This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
+{
+ func_emit_wrapper_arg1=${1-no}
+
+ $ECHO "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='$sed_quote_subst'
+
+# Be Bourne compatible
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+ # install mode needs the following variables:
+ generated_by_libtool_version='$macro_version'
+ notinst_deplibs='$notinst_deplibs'
+else
+ # When we are sourced in execute mode, \$file and \$ECHO are already set.
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ file=\"\$0\""
+
+ qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
+ $ECHO "\
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+ ECHO=\"$qECHO\"
+ fi
+
+# Very basic option parsing. These options are (a) specific to
+# the libtool wrapper, (b) are identical between the wrapper
+# /script/ and the wrapper /executable/ which is used only on
+# windows platforms, and (c) all begin with the string "--lt-"
+# (application programs are unlikely to have options which match
+# this pattern).
+#
+# There are only two supported options: --lt-debug and
+# --lt-dump-script. There is, deliberately, no --lt-help.
+#
+# The first argument to this parsing function should be the
+# script's $0 value, followed by "$@".
+lt_option_debug=
+func_parse_lt_options ()
+{
+ lt_script_arg0=\$0
+ shift
+ for lt_opt
+ do
+ case \"\$lt_opt\" in
+ --lt-debug) lt_option_debug=1 ;;
+ --lt-dump-script)
+ lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
+ test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
+ lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
+ cat \"\$lt_dump_D/\$lt_dump_F\"
+ exit 0
+ ;;
+ --lt-*)
+ \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
+ exit 1
+ ;;
+ esac
+ done
+
+ # Print the debug banner immediately:
+ if test -n \"\$lt_option_debug\"; then
+ echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
+ fi
+}
+
+# Used when --lt-debug. Prints its arguments to stdout
+# (redirection is the responsibility of the caller)
+func_lt_dump_args ()
+{
+ lt_dump_args_N=1;
+ for lt_arg
+ do
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
+ lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
+ done
+}
+
+# Core function for launching the target application
+func_exec_program_core ()
+{
+"
+ case $host in
+ # Backslashes separate directories on plain windows
+ *-*-mingw | *-*-os2* | *-cegcc*)
+ $ECHO "\
+ if test -n \"\$lt_option_debug\"; then
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
+ func_lt_dump_args \${1+\"\$@\"} 1>&2
+ fi
+ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+ ;;
+
+ *)
+ $ECHO "\
+ if test -n \"\$lt_option_debug\"; then
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
+ func_lt_dump_args \${1+\"\$@\"} 1>&2
+ fi
+ exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+ ;;
+ esac
+ $ECHO "\
+ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+ exit 1
+}
+
+# A function to encapsulate launching the target application
+# Strips options in the --lt-* namespace from \$@ and
+# launches target application with the remaining arguments.
+func_exec_program ()
+{
+ case \" \$* \" in
+ *\\ --lt-*)
+ for lt_wr_arg
+ do
+ case \$lt_wr_arg in
+ --lt-*) ;;
+ *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+ esac
+ shift
+ done ;;
+ esac
+ func_exec_program_core \${1+\"\$@\"}
+}
+
+ # Parse options
+ func_parse_lt_options \"\$0\" \${1+\"\$@\"}
+
+ # Find the directory that this script lives in.
+ thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
+ while test -n \"\$file\"; do
+ destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
+
+ # If there was a directory component, then change thisdir.
+ if test \"x\$destdir\" != \"x\$file\"; then
+ case \"\$destdir\" in
+ [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+ *) thisdir=\"\$thisdir/\$destdir\" ;;
+ esac
+ fi
+
+ file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
+ file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
+ done
+
+ # Usually 'no', except on cygwin/mingw when embedded into
+ # the cwrapper.
+ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
+ if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+ # special case for '.'
+ if test \"\$thisdir\" = \".\"; then
+ thisdir=\`pwd\`
+ fi
+ # remove .libs from thisdir
+ case \"\$thisdir\" in
+ *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
+ $objdir ) thisdir=. ;;
+ esac
+ fi
+
+ # Try to get the absolute directory name.
+ absdir=\`cd \"\$thisdir\" && pwd\`
+ test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+ if test "$fast_install" = yes; then
+ $ECHO "\
+ program=lt-'$outputname'$exeext
+ progdir=\"\$thisdir/$objdir\"
+
+ if test ! -f \"\$progdir/\$program\" ||
+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+ file=\"\$\$-\$program\"
+
+ if test ! -d \"\$progdir\"; then
+ $MKDIR \"\$progdir\"
+ else
+ $RM \"\$progdir/\$file\"
+ fi"
+
+ $ECHO "\
+
+ # relink executable if necessary
+ if test -n \"\$relink_command\"; then
+ if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+ else
+ $ECHO \"\$relink_command_output\" >&2
+ $RM \"\$progdir/\$file\"
+ exit 1
+ fi
+ fi
+
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+ { $RM \"\$progdir/\$program\";
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+ $RM \"\$progdir/\$file\"
+ fi"
+ else
+ $ECHO "\
+ program='$outputname'
+ progdir=\"\$thisdir/$objdir\"
+"
+ fi
+
+ $ECHO "\
+
+ if test -f \"\$progdir/\$program\"; then"
+
+ # fixup the dll searchpath if we need to.
+ #
+ # Fix the DLL searchpath if we need to. Do this before prepending
+ # to shlibpath, because on Windows, both are PATH and uninstalled
+ # libraries must come first.
+ if test -n "$dllsearchpath"; then
+ $ECHO "\
+ # Add the dll search path components to the executable PATH
+ PATH=$dllsearchpath:\$PATH
+"
+ fi
+
+ # Export our shlibpath_var if we have one.
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ $ECHO "\
+ # Add our own library path to $shlibpath_var
+ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+ # Some systems cannot cope with colon-terminated $shlibpath_var
+ # The second colon is a workaround for a bug in BeOS R4 sed
+ $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
+
+ export $shlibpath_var
+"
+ fi
+
+ $ECHO "\
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ # Run the actual program with our arguments.
+ func_exec_program \${1+\"\$@\"}
+ fi
+ else
+ # The program doesn't exist.
+ \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+ \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
+ \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+ exit 1
+ fi
+fi\
+"
+}
+
+
+# func_emit_cwrapperexe_src
+# emit the source code for a wrapper executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_cwrapperexe_src ()
+{
+ cat <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+ Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+
+ The $output program cannot be directly executed until all the libtool
+ libraries that it depends on are installed.
+
+ This wrapper executable should never be moved out of the build directory.
+ If it is, it will not operate correctly.
+*/
+EOF
+ cat <<"EOF"
+#ifdef _MSC_VER
+# define _CRT_SECURE_NO_DEPRECATE 1
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+# include <io.h>
+#else
+# include <unistd.h>
+# include <stdint.h>
+# ifdef __CYGWIN__
+# include <io.h>
+# endif
+#endif
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+/* declarations of non-ANSI functions */
+#if defined(__MINGW32__)
+# ifdef __STRICT_ANSI__
+int _putenv (const char *);
+# endif
+#elif defined(__CYGWIN__)
+# ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+# endif
+/* #elif defined (other platforms) ... */
+#endif
+
+/* portability defines, excluding path handling macros */
+#if defined(_MSC_VER)
+# define setmode _setmode
+# define stat _stat
+# define chmod _chmod
+# define getcwd _getcwd
+# define putenv _putenv
+# define S_IXUSR _S_IEXEC
+# ifndef _INTPTR_T_DEFINED
+# define _INTPTR_T_DEFINED
+# define intptr_t int
+# endif
+#elif defined(__MINGW32__)
+# define setmode _setmode
+# define stat _stat
+# define chmod _chmod
+# define getcwd _getcwd
+# define putenv _putenv
+#elif defined(__CYGWIN__)
+# define HAVE_SETENV
+# define FOPEN_WB "wb"
+/* #elif defined (other platforms) ... */
+#endif
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef S_IXOTH
+# define S_IXOTH 0
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0
+#endif
+
+/* path handling portability macros */
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+ defined (__OS2__)
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# define FOPEN_WB "wb"
+# ifndef DIR_SEPARATOR_2
+# define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+# define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#ifndef FOPEN_WB
+# define FOPEN_WB "w"
+#endif
+#ifndef _O_BINARY
+# define _O_BINARY 0
+#endif
+
+#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+ if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+#if defined(LT_DEBUGWRAPPER)
+static int lt_debug = 1;
+#else
+static int lt_debug = 0;
+#endif
+
+const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
+
+void *xmalloc (size_t num);
+char *xstrdup (const char *string);
+const char *base_name (const char *name);
+char *find_executable (const char *wrapper);
+char *chase_symlinks (const char *pathspec);
+int make_executable (const char *path);
+int check_executable (const char *path);
+char *strendzap (char *str, const char *pat);
+void lt_debugprintf (const char *file, int line, const char *fmt, ...);
+void lt_fatal (const char *file, int line, const char *message, ...);
+static const char *nonnull (const char *s);
+static const char *nonempty (const char *s);
+void lt_setenv (const char *name, const char *value);
+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+void lt_update_exe_path (const char *name, const char *value);
+void lt_update_lib_path (const char *name, const char *value);
+char **prepare_spawn (char **argv);
+void lt_dump_script (FILE *f);
+EOF
+
+ cat <<EOF
+volatile const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ func_to_host_path "$temp_rpath"
+ cat <<EOF
+const char * LIB_PATH_VALUE = "$func_to_host_path_result";
+EOF
+ else
+ cat <<"EOF"
+const char * LIB_PATH_VALUE = "";
+EOF
+ fi
+
+ if test -n "$dllsearchpath"; then
+ func_to_host_path "$dllsearchpath:"
+ cat <<EOF
+const char * EXE_PATH_VARNAME = "PATH";
+const char * EXE_PATH_VALUE = "$func_to_host_path_result";
+EOF
+ else
+ cat <<"EOF"
+const char * EXE_PATH_VARNAME = "";
+const char * EXE_PATH_VALUE = "";
+EOF
+ fi
+
+ if test "$fast_install" = yes; then
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
+EOF
+ else
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
+EOF
+ fi
+
+
+ cat <<"EOF"
+
+#define LTWRAPPER_OPTION_PREFIX "--lt-"
+
+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
+static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
+
+int
+main (int argc, char *argv[])
+{
+ char **newargz;
+ int newargc;
+ char *tmp_pathspec;
+ char *actual_cwrapper_path;
+ char *actual_cwrapper_name;
+ char *target_name;
+ char *lt_argv_zero;
+ intptr_t rval = 127;
+
+ int i;
+
+ program_name = (char *) xstrdup (base_name (argv[0]));
+ newargz = XMALLOC (char *, argc + 1);
+
+ /* very simple arg parsing; don't want to rely on getopt
+ * also, copy all non cwrapper options to newargz, except
+ * argz[0], which is handled differently
+ */
+ newargc=0;
+ for (i = 1; i < argc; i++)
+ {
+ if (strcmp (argv[i], dumpscript_opt) == 0)
+ {
+EOF
+ case "$host" in
+ *mingw* | *cygwin* )
+ # make stdout use "unix" line endings
+ echo " setmode(1,_O_BINARY);"
+ ;;
+ esac
+
+ cat <<"EOF"
+ lt_dump_script (stdout);
+ return 0;
+ }
+ if (strcmp (argv[i], debug_opt) == 0)
+ {
+ lt_debug = 1;
+ continue;
+ }
+ if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+ {
+ /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+ namespace, but it is not one of the ones we know about and
+ have already dealt with, above (inluding dump-script), then
+ report an error. Otherwise, targets might begin to believe
+ they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+ namespace. The first time any user complains about this, we'll
+ need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+ or a configure.ac-settable value.
+ */
+ lt_fatal (__FILE__, __LINE__,
+ "unrecognized %s option: '%s'",
+ ltwrapper_option_prefix, argv[i]);
+ }
+ /* otherwise ... */
+ newargz[++newargc] = xstrdup (argv[i]);
+ }
+ newargz[++newargc] = NULL;
+
+EOF
+ cat <<EOF
+ /* The GNU banner must be the first non-error debug message */
+ lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
+EOF
+ cat <<"EOF"
+ lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
+ lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
+
+ tmp_pathspec = find_executable (argv[0]);
+ if (tmp_pathspec == NULL)
+ lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) found exe (before symlink chase) at: %s\n",
+ tmp_pathspec);
+
+ actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) found exe (after symlink chase) at: %s\n",
+ actual_cwrapper_path);
+ XFREE (tmp_pathspec);
+
+ actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
+ strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+ /* wrapper name transforms */
+ strendzap (actual_cwrapper_name, ".exe");
+ tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
+ XFREE (actual_cwrapper_name);
+ actual_cwrapper_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ /* target_name transforms -- use actual target program name; might have lt- prefix */
+ target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
+ strendzap (target_name, ".exe");
+ tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
+ XFREE (target_name);
+ target_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) libtool target name: %s\n",
+ target_name);
+EOF
+
+ cat <<EOF
+ newargz[0] =
+ XMALLOC (char, (strlen (actual_cwrapper_path) +
+ strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
+ strcpy (newargz[0], actual_cwrapper_path);
+ strcat (newargz[0], "$objdir");
+ strcat (newargz[0], "/");
+EOF
+
+ cat <<"EOF"
+ /* stop here, and copy so we don't have to do this twice */
+ tmp_pathspec = xstrdup (newargz[0]);
+
+ /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
+ strcat (newargz[0], actual_cwrapper_name);
+
+ /* DO want the lt- prefix here if it exists, so use target_name */
+ lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
+ XFREE (tmp_pathspec);
+ tmp_pathspec = NULL;
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ {
+ char* p;
+ while ((p = strchr (newargz[0], '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ while ((p = strchr (lt_argv_zero, '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ }
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+ XFREE (target_name);
+ XFREE (actual_cwrapper_path);
+ XFREE (actual_cwrapper_name);
+
+ lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+ lt_setenv ("DUALCASE", "1"); /* for MSK sh */
+ /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
+ be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
+ because on Windows, both *_VARNAMEs are PATH but uninstalled
+ libraries must come first. */
+ lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+ lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+
+ lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
+ nonnull (lt_argv_zero));
+ for (i = 0; i < newargc; i++)
+ {
+ lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
+ i, nonnull (newargz[i]));
+ }
+
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ /* execv doesn't actually work on mingw as expected on unix */
+ newargz = prepare_spawn (newargz);
+ rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+ if (rval == -1)
+ {
+ /* failed to start process */
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) failed to launch target \"%s\": %s\n",
+ lt_argv_zero, nonnull (strerror (errno)));
+ return 127;
+ }
+ return rval;
+EOF
+ ;;
+ *)
+ cat <<"EOF"
+ execv (lt_argv_zero, newargz);
+ return rval; /* =127, but avoids unused variable warning */
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+ void *p = (void *) malloc (num);
+ if (!p)
+ lt_fatal (__FILE__, __LINE__, "memory exhausted");
+
+ return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+ return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
+ string) : NULL;
+}
+
+const char *
+base_name (const char *name)
+{
+ const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ /* Skip over the disk name in MSDOS pathnames. */
+ if (isalpha ((unsigned char) name[0]) && name[1] == ':')
+ name += 2;
+#endif
+
+ for (base = name; *name; name++)
+ if (IS_DIR_SEPARATOR (*name))
+ base = name + 1;
+ return base;
+}
+
+int
+check_executable (const char *path)
+{
+ struct stat st;
+
+ lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
+ nonempty (path));
+ if ((!path) || (!*path))
+ return 0;
+
+ if ((stat (path, &st) >= 0)
+ && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
+ return 1;
+ else
+ return 0;
+}
+
+int
+make_executable (const char *path)
+{
+ int rval = 0;
+ struct stat st;
+
+ lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
+ nonempty (path));
+ if ((!path) || (!*path))
+ return 0;
+
+ if (stat (path, &st) >= 0)
+ {
+ rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
+ }
+ return rval;
+}
+
+/* Searches for the full path of the wrapper. Returns
+ newly allocated full path name if found, NULL otherwise
+ Does not chase symlinks, even on platforms that support them.
+*/
+char *
+find_executable (const char *wrapper)
+{
+ int has_slash = 0;
+ const char *p;
+ const char *p_next;
+ /* static buffer for getcwd */
+ char tmp[LT_PATHMAX + 1];
+ int tmp_len;
+ char *concat_name;
+
+ lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
+ nonempty (wrapper));
+
+ if ((wrapper == NULL) || (*wrapper == '\0'))
+ return NULL;
+
+ /* Absolute path? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+ else
+ {
+#endif
+ if (IS_DIR_SEPARATOR (wrapper[0]))
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ }
+#endif
+
+ for (p = wrapper; *p; p++)
+ if (*p == '/')
+ {
+ has_slash = 1;
+ break;
+ }
+ if (!has_slash)
+ {
+ /* no slashes; search PATH */
+ const char *path = getenv ("PATH");
+ if (path != NULL)
+ {
+ for (p = path; *p; p = p_next)
+ {
+ const char *q;
+ size_t p_len;
+ for (q = p; *q; q++)
+ if (IS_PATH_SEPARATOR (*q))
+ break;
+ p_len = q - p;
+ p_next = (*q == '\0' ? q : q + 1);
+ if (p_len == 0)
+ {
+ /* empty path: current directory */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+ nonnull (strerror (errno)));
+ tmp_len = strlen (tmp);
+ concat_name =
+ XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+ }
+ else
+ {
+ concat_name =
+ XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, p, p_len);
+ concat_name[p_len] = '/';
+ strcpy (concat_name + p_len + 1, wrapper);
+ }
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+ }
+ /* not found in PATH; assume curdir */
+ }
+ /* Relative path | not found in path: prepend cwd */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+ nonnull (strerror (errno)));
+ tmp_len = strlen (tmp);
+ concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ return NULL;
+}
+
+char *
+chase_symlinks (const char *pathspec)
+{
+#ifndef S_ISLNK
+ return xstrdup (pathspec);
+#else
+ char buf[LT_PATHMAX];
+ struct stat s;
+ char *tmp_pathspec = xstrdup (pathspec);
+ char *p;
+ int has_symlinks = 0;
+ while (strlen (tmp_pathspec) && !has_symlinks)
+ {
+ lt_debugprintf (__FILE__, __LINE__,
+ "checking path component for symlinks: %s\n",
+ tmp_pathspec);
+ if (lstat (tmp_pathspec, &s) == 0)
+ {
+ if (S_ISLNK (s.st_mode) != 0)
+ {
+ has_symlinks = 1;
+ break;
+ }
+
+ /* search backwards for last DIR_SEPARATOR */
+ p = tmp_pathspec + strlen (tmp_pathspec) - 1;
+ while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ p--;
+ if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ {
+ /* no more DIR_SEPARATORS left */
+ break;
+ }
+ *p = '\0';
+ }
+ else
+ {
+ lt_fatal (__FILE__, __LINE__,
+ "error accessing file \"%s\": %s",
+ tmp_pathspec, nonnull (strerror (errno)));
+ }
+ }
+ XFREE (tmp_pathspec);
+
+ if (!has_symlinks)
+ {
+ return xstrdup (pathspec);
+ }
+
+ tmp_pathspec = realpath (pathspec, buf);
+ if (tmp_pathspec == 0)
+ {
+ lt_fatal (__FILE__, __LINE__,
+ "could not follow symlinks for %s", pathspec);
+ }
+ return xstrdup (tmp_pathspec);
+#endif
+}
+
+char *
+strendzap (char *str, const char *pat)
+{
+ size_t len, patlen;
+
+ assert (str != NULL);
+ assert (pat != NULL);
+
+ len = strlen (str);
+ patlen = strlen (pat);
+
+ if (patlen <= len)
+ {
+ str += len - patlen;
+ if (strcmp (str, pat) == 0)
+ *str = '\0';
+ }
+ return str;
+}
+
+void
+lt_debugprintf (const char *file, int line, const char *fmt, ...)
+{
+ va_list args;
+ if (lt_debug)
+ {
+ (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
+ va_start (args, fmt);
+ (void) vfprintf (stderr, fmt, args);
+ va_end (args);
+ }
+}
+
+static void
+lt_error_core (int exit_status, const char *file,
+ int line, const char *mode,
+ const char *message, va_list ap)
+{
+ fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
+ vfprintf (stderr, message, ap);
+ fprintf (stderr, ".\n");
+
+ if (exit_status >= 0)
+ exit (exit_status);
+}
+
+void
+lt_fatal (const char *file, int line, const char *message, ...)
+{
+ va_list ap;
+ va_start (ap, message);
+ lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
+ va_end (ap);
+}
+
+static const char *
+nonnull (const char *s)
+{
+ return s ? s : "(null)";
+}
+
+static const char *
+nonempty (const char *s)
+{
+ return (s && !*s) ? "(empty)" : nonnull (s);
+}
+
+void
+lt_setenv (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_setenv) setting '%s' to '%s'\n",
+ nonnull (name), nonnull (value));
+ {
+#ifdef HAVE_SETENV
+ /* always make a copy, for consistency with !HAVE_SETENV */
+ char *str = xstrdup (value);
+ setenv (name, str, 1);
+#else
+ int len = strlen (name) + 1 + strlen (value) + 1;
+ char *str = XMALLOC (char, len);
+ sprintf (str, "%s=%s", name, value);
+ if (putenv (str) != EXIT_SUCCESS)
+ {
+ XFREE (str);
+ }
+#endif
+ }
+}
+
+char *
+lt_extend_str (const char *orig_value, const char *add, int to_end)
+{
+ char *new_value;
+ if (orig_value && *orig_value)
+ {
+ int orig_value_len = strlen (orig_value);
+ int add_len = strlen (add);
+ new_value = XMALLOC (char, add_len + orig_value_len + 1);
+ if (to_end)
+ {
+ strcpy (new_value, orig_value);
+ strcpy (new_value + orig_value_len, add);
+ }
+ else
+ {
+ strcpy (new_value, add);
+ strcpy (new_value + add_len, orig_value);
+ }
+ }
+ else
+ {
+ new_value = xstrdup (add);
+ }
+ return new_value;
+}
+
+void
+lt_update_exe_path (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+ nonnull (name), nonnull (value));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ /* some systems can't cope with a ':'-terminated path #' */
+ int len = strlen (new_value);
+ while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+ {
+ new_value[len-1] = '\0';
+ }
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+void
+lt_update_lib_path (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+ nonnull (name), nonnull (value));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+EOF
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+
+/* Prepares an argument vector before calling spawn().
+ Note that spawn() does not by itself call the command interpreter
+ (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
+ ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&v);
+ v.dwPlatformId == VER_PLATFORM_WIN32_NT;
+ }) ? "cmd.exe" : "command.com").
+ Instead it simply concatenates the arguments, separated by ' ', and calls
+ CreateProcess(). We must quote the arguments since Win32 CreateProcess()
+ interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
+ special way:
+ - Space and tab are interpreted as delimiters. They are not treated as
+ delimiters if they are surrounded by double quotes: "...".
+ - Unescaped double quotes are removed from the input. Their only effect is
+ that within double quotes, space and tab are treated like normal
+ characters.
+ - Backslashes not followed by double quotes are not special.
+ - But 2*n+1 backslashes followed by a double quote become
+ n backslashes followed by a double quote (n >= 0):
+ \" -> "
+ \\\" -> \"
+ \\\\\" -> \\"
+ */
+#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+char **
+prepare_spawn (char **argv)
+{
+ size_t argc;
+ char **new_argv;
+ size_t i;
+
+ /* Count number of arguments. */
+ for (argc = 0; argv[argc] != NULL; argc++)
+ ;
+
+ /* Allocate new argument vector. */
+ new_argv = XMALLOC (char *, argc + 1);
+
+ /* Put quoted arguments into the new argument vector. */
+ for (i = 0; i < argc; i++)
+ {
+ const char *string = argv[i];
+
+ if (string[0] == '\0')
+ new_argv[i] = xstrdup ("\"\"");
+ else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
+ {
+ int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
+ size_t length;
+ unsigned int backslashes;
+ const char *s;
+ char *quoted_string;
+ char *p;
+
+ length = 0;
+ backslashes = 0;
+ if (quote_around)
+ length++;
+ for (s = string; *s != '\0'; s++)
+ {
+ char c = *s;
+ if (c == '"')
+ length += backslashes + 1;
+ length++;
+ if (c == '\\')
+ backslashes++;
+ else
+ backslashes = 0;
+ }
+ if (quote_around)
+ length += backslashes + 1;
+
+ quoted_string = XMALLOC (char, length + 1);
+
+ p = quoted_string;
+ backslashes = 0;
+ if (quote_around)
+ *p++ = '"';
+ for (s = string; *s != '\0'; s++)
+ {
+ char c = *s;
+ if (c == '"')
+ {
+ unsigned int j;
+ for (j = backslashes + 1; j > 0; j--)
+ *p++ = '\\';
+ }
+ *p++ = c;
+ if (c == '\\')
+ backslashes++;
+ else
+ backslashes = 0;
+ }
+ if (quote_around)
+ {
+ unsigned int j;
+ for (j = backslashes; j > 0; j--)
+ *p++ = '\\';
+ *p++ = '"';
+ }
+ *p = '\0';
+
+ new_argv[i] = quoted_string;
+ }
+ else
+ new_argv[i] = (char *) string;
+ }
+ new_argv[argc] = NULL;
+
+ return new_argv;
+}
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+void lt_dump_script (FILE* f)
+{
+EOF
+ func_emit_wrapper yes |
+ $SED -n -e '
+s/^\(.\{79\}\)\(..*\)/\1\
+\2/
+h
+s/\([\\"]\)/\\\1/g
+s/$/\\n/
+s/\([^\n]*\).*/ fputs ("\1", f);/p
+g
+D'
+ cat <<"EOF"
+}
+EOF
+}
+# end: func_emit_cwrapperexe_src
+
+# func_win32_import_lib_p ARG
+# True if ARG is an import lib, as indicated by $file_magic_cmd
+func_win32_import_lib_p ()
+{
+ $opt_debug
+ case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
+ *import*) : ;;
+ *) false ;;
+ esac
+}
+
+# func_mode_link arg...
+func_mode_link ()
+{
+ $opt_debug
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ # It is impossible to link a dll without this setting, and
+ # we shouldn't force the makefile maintainer to figure out
+ # which system we are compiling for in order to pass an extra
+ # flag for every libtool invocation.
+ # allow_undefined=no
+
+ # FIXME: Unfortunately, there are problems with the above when trying
+ # to make a dll which has undefined symbols, in which case not
+ # even a static library is built. For now, we need to specify
+ # -no-undefined on the libtool link line when we can be certain
+ # that all symbols are satisfied, otherwise we get a static library.
+ allow_undefined=yes
+ ;;
+ *)
+ allow_undefined=yes
+ ;;
+ esac
+ libtool_args=$nonopt
+ base_compile="$nonopt $@"
+ compile_command=$nonopt
+ finalize_command=$nonopt
+
+ compile_rpath=
+ finalize_rpath=
+ compile_shlibpath=
+ finalize_shlibpath=
+ convenience=
+ old_convenience=
+ deplibs=
+ old_deplibs=
+ compiler_flags=
+ linker_flags=
+ dllsearchpath=
+ lib_search_path=`pwd`
+ inst_prefix_dir=
+ new_inherited_linker_flags=
+
+ avoid_version=no
+ bindir=
+ dlfiles=
+ dlprefiles=
+ dlself=no
+ export_dynamic=no
+ export_symbols=
+ export_symbols_regex=
+ generated=
+ libobjs=
+ ltlibs=
+ module=no
+ no_install=no
+ objs=
+ non_pic_objects=
+ precious_files_regex=
+ prefer_static_libs=no
+ preload=no
+ prev=
+ prevarg=
+ release=
+ rpath=
+ xrpath=
+ perm_rpath=
+ temp_rpath=
+ thread_safe=no
+ vinfo=
+ vinfo_number=no
+ weak_libs=
+ single_module="${wl}-single_module"
+ func_infer_tag $base_compile
+
+ # We need to know -static, to get the right output filenames.
+ for arg
+ do
+ case $arg in
+ -shared)
+ test "$build_libtool_libs" != yes && \
+ func_fatal_configuration "can not build a shared library"
+ build_old_libs=no
+ break
+ ;;
+ -all-static | -static | -static-libtool-libs)
+ case $arg in
+ -all-static)
+ if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+ func_warning "complete static linking is impossible in this configuration"
+ fi
+ if test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ -static)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=built
+ ;;
+ -static-libtool-libs)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ esac
+ build_libtool_libs=no
+ build_old_libs=yes
+ break
+ ;;
+ esac
+ done
+
+ # See if our shared archives depend on static archives.
+ test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+ # Go through the arguments, transforming them on the way.
+ while test "$#" -gt 0; do
+ arg="$1"
+ shift
+ func_quote_for_eval "$arg"
+ qarg=$func_quote_for_eval_unquoted_result
+ func_append libtool_args " $func_quote_for_eval_result"
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case $prev in
+ output)
+ func_append compile_command " @OUTPUT@"
+ func_append finalize_command " @OUTPUT@"
+ ;;
+ esac
+
+ case $prev in
+ bindir)
+ bindir="$arg"
+ prev=
+ continue
+ ;;
+ dlfiles|dlprefiles)
+ if test "$preload" = no; then
+ # Add the symbol object into the linking commands.
+ func_append compile_command " @SYMFILE@"
+ func_append finalize_command " @SYMFILE@"
+ preload=yes
+ fi
+ case $arg in
+ *.la | *.lo) ;; # We handle these cases below.
+ force)
+ if test "$dlself" = no; then
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ self)
+ if test "$prev" = dlprefiles; then
+ dlself=yes
+ elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+ dlself=yes
+ else
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ *)
+ if test "$prev" = dlfiles; then
+ func_append dlfiles " $arg"
+ else
+ func_append dlprefiles " $arg"
+ fi
+ prev=
+ continue
+ ;;
+ esac
+ ;;
+ expsyms)
+ export_symbols="$arg"
+ test -f "$arg" \
+ || func_fatal_error "symbol file \`$arg' does not exist"
+ prev=
+ continue
+ ;;
+ expsyms_regex)
+ export_symbols_regex="$arg"
+ prev=
+ continue
+ ;;
+ framework)
+ case $host in
+ *-*-darwin*)
+ case "$deplibs " in
+ *" $qarg.ltframework "*) ;;
+ *) func_append deplibs " $qarg.ltframework" # this is fixed later
+ ;;
+ esac
+ ;;
+ esac
+ prev=
+ continue
+ ;;
+ inst_prefix)
+ inst_prefix_dir="$arg"
+ prev=
+ continue
+ ;;
+ objectlist)
+ if test -f "$arg"; then
+ save_arg=$arg
+ moreargs=
+ for fil in `cat "$save_arg"`
+ do
+# func_append moreargs " $fil"
+ arg=$fil
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none &&
+ test "$non_pic_object" = none; then
+ func_fatal_error "cannot find name of object for \`$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ func_append dlfiles " $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ func_append dlprefiles " $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append libobjs " $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ func_append non_pic_objects " $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "\`$arg' is not a valid libtool object"
+ fi
+ fi
+ done
+ else
+ func_fatal_error "link input file \`$arg' does not exist"
+ fi
+ arg=$save_arg
+ prev=
+ continue
+ ;;
+ precious_regex)
+ precious_files_regex="$arg"
+ prev=
+ continue
+ ;;
+ release)
+ release="-$arg"
+ prev=
+ continue
+ ;;
+ rpath | xrpath)
+ # We need an absolute path.
+ case $arg in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ if test "$prev" = rpath; then
+ case "$rpath " in
+ *" $arg "*) ;;
+ *) func_append rpath " $arg" ;;
+ esac
+ else
+ case "$xrpath " in
+ *" $arg "*) ;;
+ *) func_append xrpath " $arg" ;;
+ esac
+ fi
+ prev=
+ continue
+ ;;
+ shrext)
+ shrext_cmds="$arg"
+ prev=
+ continue
+ ;;
+ weak)
+ func_append weak_libs " $arg"
+ prev=
+ continue
+ ;;
+ xcclinker)
+ func_append linker_flags " $qarg"
+ func_append compiler_flags " $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xcompiler)
+ func_append compiler_flags " $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xlinker)
+ func_append linker_flags " $qarg"
+ func_append compiler_flags " $wl$qarg"
+ prev=
+ func_append compile_command " $wl$qarg"
+ func_append finalize_command " $wl$qarg"
+ continue
+ ;;
+ *)
+ eval "$prev=\"\$arg\""
+ prev=
+ continue
+ ;;
+ esac
+ fi # test -n "$prev"
+
+ prevarg="$arg"
+
+ case $arg in
+ -all-static)
+ if test -n "$link_static_flag"; then
+ # See comment for -static flag below, for more details.
+ func_append compile_command " $link_static_flag"
+ func_append finalize_command " $link_static_flag"
+ fi
+ continue
+ ;;
+
+ -allow-undefined)
+ # FIXME: remove this flag sometime in the future.
+ func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+ ;;
+
+ -avoid-version)
+ avoid_version=yes
+ continue
+ ;;
+
+ -bindir)
+ prev=bindir
+ continue
+ ;;
+
+ -dlopen)
+ prev=dlfiles
+ continue
+ ;;
+
+ -dlpreopen)
+ prev=dlprefiles
+ continue
+ ;;
+
+ -export-dynamic)
+ export_dynamic=yes
+ continue
+ ;;
+
+ -export-symbols | -export-symbols-regex)
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+ func_fatal_error "more than one -exported-symbols argument is not allowed"
+ fi
+ if test "X$arg" = "X-export-symbols"; then
+ prev=expsyms
+ else
+ prev=expsyms_regex
+ fi
+ continue
+ ;;
+
+ -framework)
+ prev=framework
+ continue
+ ;;
+
+ -inst-prefix-dir)
+ prev=inst_prefix
+ continue
+ ;;
+
+ # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+ # so, if we see these flags be careful not to treat them like -L
+ -L[A-Z][A-Z]*:*)
+ case $with_gcc/$host in
+ no/*-*-irix* | /*-*-irix*)
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ ;;
+ esac
+ continue
+ ;;
+
+ -L*)
+ func_stripname "-L" '' "$arg"
+ if test -z "$func_stripname_result"; then
+ if test "$#" -gt 0; then
+ func_fatal_error "require no space between \`-L' and \`$1'"
+ else
+ func_fatal_error "need path for \`-L' option"
+ fi
+ fi
+ func_resolve_sysroot "$func_stripname_result"
+ dir=$func_resolve_sysroot_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ test -z "$absdir" && \
+ func_fatal_error "cannot determine absolute directory name of \`$dir'"
+ dir="$absdir"
+ ;;
+ esac
+ case "$deplibs " in
+ *" -L$dir "* | *" $arg "*)
+ # Will only happen for absolute or sysroot arguments
+ ;;
+ *)
+ # Preserve sysroot, but never include relative directories
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
+ *) func_append deplibs " -L$dir" ;;
+ esac
+ func_append lib_search_path " $dir"
+ ;;
+ esac
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$dir:"*) ;;
+ ::) dllsearchpath=$dir;;
+ *) func_append dllsearchpath ":$dir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) func_append dllsearchpath ":$testbindir";;
+ esac
+ ;;
+ esac
+ continue
+ ;;
+
+ -l*)
+ if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ # These systems don't actually have a C or math library (as such)
+ continue
+ ;;
+ *-*-os2*)
+ # These systems don't actually have a C library (as such)
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C and math libraries are in the System framework
+ func_append deplibs " System.ltframework"
+ continue
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ test "X$arg" = "X-lc" && continue
+ ;;
+ esac
+ elif test "X$arg" = "X-lc_r"; then
+ case $host in
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc_r directly, use -pthread flag.
+ continue
+ ;;
+ esac
+ fi
+ func_append deplibs " $arg"
+ continue
+ ;;
+
+ -module)
+ module=yes
+ continue
+ ;;
+
+ # Tru64 UNIX uses -model [arg] to determine the layout of C++
+ # classes, name mangling, and exception handling.
+ # Darwin uses the -arch flag to determine output architecture.
+ -model|-arch|-isysroot|--sysroot)
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ prev=xcompiler
+ continue
+ ;;
+
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ case "$new_inherited_linker_flags " in
+ *" $arg "*) ;;
+ * ) func_append new_inherited_linker_flags " $arg" ;;
+ esac
+ continue
+ ;;
+
+ -multi_module)
+ single_module="${wl}-multi_module"
+ continue
+ ;;
+
+ -no-fast-install)
+ fast_install=no
+ continue
+ ;;
+
+ -no-install)
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+ # The PATH hackery in wrapper scripts is required on Windows
+ # and Darwin in order for the loader to find any dlls it needs.
+ func_warning "\`-no-install' is ignored for $host"
+ func_warning "assuming \`-no-fast-install' instead"
+ fast_install=no
+ ;;
+ *) no_install=yes ;;
+ esac
+ continue
+ ;;
+
+ -no-undefined)
+ allow_undefined=no
+ continue
+ ;;
+
+ -objectlist)
+ prev=objectlist
+ continue
+ ;;
+
+ -o) prev=output ;;
+
+ -precious-files-regex)
+ prev=precious_regex
+ continue
+ ;;
+
+ -release)
+ prev=release
+ continue
+ ;;
+
+ -rpath)
+ prev=rpath
+ continue
+ ;;
+
+ -R)
+ prev=xrpath
+ continue
+ ;;
+
+ -R*)
+ func_stripname '-R' '' "$arg"
+ dir=$func_stripname_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ =*)
+ func_stripname '=' '' "$dir"
+ dir=$lt_sysroot$func_stripname_result
+ ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+ continue
+ ;;
+
+ -shared)
+ # The effects of -shared are defined in a previous loop.
+ continue
+ ;;
+
+ -shrext)
+ prev=shrext
+ continue
+ ;;
+
+ -static | -static-libtool-libs)
+ # The effects of -static are defined in a previous loop.
+ # We used to do the same as -all-static on platforms that
+ # didn't have a PIC flag, but the assumption that the effects
+ # would be equivalent was wrong. It would break on at least
+ # Digital Unix and AIX.
+ continue
+ ;;
+
+ -thread-safe)
+ thread_safe=yes
+ continue
+ ;;
+
+ -version-info)
+ prev=vinfo
+ continue
+ ;;
+
+ -version-number)
+ prev=vinfo
+ vinfo_number=yes
+ continue
+ ;;
+
+ -weak)
+ prev=weak
+ continue
+ ;;
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$flag"
+ func_append arg " $func_quote_for_eval_result"
+ func_append compiler_flags " $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Wl,*)
+ func_stripname '-Wl,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$flag"
+ func_append arg " $wl$func_quote_for_eval_result"
+ func_append compiler_flags " $wl$func_quote_for_eval_result"
+ func_append linker_flags " $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Xcompiler)
+ prev=xcompiler
+ continue
+ ;;
+
+ -Xlinker)
+ prev=xlinker
+ continue
+ ;;
+
+ -XCClinker)
+ prev=xcclinker
+ continue
+ ;;
+
+ # -msg_* for osf cc
+ -msg_*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+
+ # Flags to be passed through unchanged, with rationale:
+ # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
+ # -r[0-9][0-9]* specify processor for the SGI compiler
+ # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
+ # +DA*, +DD* enable 64-bit mode for the HP compiler
+ # -q* compiler args for the IBM compiler
+ # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
+ # -F/path path to uninstalled frameworks, gcc on darwin
+ # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
+ # @file GCC response files
+ # -tp=* Portland pgcc target processor selection
+ # --sysroot=* for sysroot support
+ # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+ -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ func_append compiler_flags " $arg"
+ continue
+ ;;
+
+ # Some other compiler flag.
+ -* | +*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+
+ *.$objext)
+ # A standard object.
+ func_append objs " $arg"
+ ;;
+
+ *.lo)
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none &&
+ test "$non_pic_object" = none; then
+ func_fatal_error "cannot find name of object for \`$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ func_append dlfiles " $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ func_append dlprefiles " $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append libobjs " $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ func_append non_pic_objects " $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "\`$arg' is not a valid libtool object"
+ fi
+ fi
+ ;;
+
+ *.$libext)
+ # An archive.
+ func_append deplibs " $arg"
+ func_append old_deplibs " $arg"
+ continue
+ ;;
+
+ *.la)
+ # A libtool-controlled library.
+
+ func_resolve_sysroot "$arg"
+ if test "$prev" = dlfiles; then
+ # This library was specified with -dlopen.
+ func_append dlfiles " $func_resolve_sysroot_result"
+ prev=
+ elif test "$prev" = dlprefiles; then
+ # The library was specified with -dlpreopen.
+ func_append dlprefiles " $func_resolve_sysroot_result"
+ prev=
+ else
+ func_append deplibs " $func_resolve_sysroot_result"
+ fi
+ continue
+ ;;
+
+ # Some other compiler argument.
+ *)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+ esac # arg
+
+ # Now actually substitute the argument into the commands.
+ if test -n "$arg"; then
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+ done # argument parsing loop
+
+ test -n "$prev" && \
+ func_fatal_help "the \`$prevarg' option requires an argument"
+
+ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+ eval arg=\"$export_dynamic_flag_spec\"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+
+ oldlibs=
+ # calculate the name of the file, without its directory
+ func_basename "$output"
+ outputname="$func_basename_result"
+ libobjs_save="$libobjs"
+
+ if test -n "$shlibpath_var"; then
+ # get the directories listed in $shlibpath_var
+ eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
+ else
+ shlib_search_path=
+ fi
+ eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+ func_dirname "$output" "/" ""
+ output_objdir="$func_dirname_result$objdir"
+ func_to_tool_file "$output_objdir/"
+ tool_output_objdir=$func_to_tool_file_result
+ # Create the object directory.
+ func_mkdir_p "$output_objdir"
+
+ # Determine the type of output
+ case $output in
+ "")
+ func_fatal_help "you must specify an output file"
+ ;;
+ *.$libext) linkmode=oldlib ;;
+ *.lo | *.$objext) linkmode=obj ;;
+ *.la) linkmode=lib ;;
+ *) linkmode=prog ;; # Anything else should be a program.
+ esac
+
+ specialdeplibs=
+
+ libs=
+ # Find all interdependent deplibs by searching for libraries
+ # that are linked more than once (e.g. -la -lb -la)
+ for deplib in $deplibs; do
+ if $opt_preserve_dup_deps ; then
+ case "$libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append libs " $deplib"
+ done
+
+ if test "$linkmode" = lib; then
+ libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+ # Compute libraries that are listed more than once in $predeps
+ # $postdeps and mark them as special (i.e., whose duplicates are
+ # not to be eliminated).
+ pre_post_deps=
+ if $opt_duplicate_compiler_generated_deps; then
+ for pre_post_dep in $predeps $postdeps; do
+ case "$pre_post_deps " in
+ *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
+ esac
+ func_append pre_post_deps " $pre_post_dep"
+ done
+ fi
+ pre_post_deps=
+ fi
+
+ deplibs=
+ newdependency_libs=
+ newlib_search_path=
+ need_relink=no # whether we're linking any uninstalled libtool libraries
+ notinst_deplibs= # not-installed libtool libraries
+ notinst_path= # paths that contain not-installed libtool libraries
+
+ case $linkmode in
+ lib)
+ passes="conv dlpreopen link"
+ for file in $dlfiles $dlprefiles; do
+ case $file in
+ *.la) ;;
+ *)
+ func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+ ;;
+ esac
+ done
+ ;;
+ prog)
+ compile_deplibs=
+ finalize_deplibs=
+ alldeplibs=no
+ newdlfiles=
+ newdlprefiles=
+ passes="conv scan dlopen dlpreopen link"
+ ;;
+ *) passes="conv"
+ ;;
+ esac
+
+ for pass in $passes; do
+ # The preopen pass in lib mode reverses $deplibs; put it back here
+ # so that -L comes before libs that need it for instance...
+ if test "$linkmode,$pass" = "lib,link"; then
+ ## FIXME: Find the place where the list is rebuilt in the wrong
+ ## order, and fix it there properly
+ tmp_deplibs=
+ for deplib in $deplibs; do
+ tmp_deplibs="$deplib $tmp_deplibs"
+ done
+ deplibs="$tmp_deplibs"
+ fi
+
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan"; then
+ libs="$deplibs"
+ deplibs=
+ fi
+ if test "$linkmode" = prog; then
+ case $pass in
+ dlopen) libs="$dlfiles" ;;
+ dlpreopen) libs="$dlprefiles" ;;
+ link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+ esac
+ fi
+ if test "$linkmode,$pass" = "lib,dlpreopen"; then
+ # Collect and forward deplibs of preopened libtool libs
+ for lib in $dlprefiles; do
+ # Ignore non-libtool-libs
+ dependency_libs=
+ func_resolve_sysroot "$lib"
+ case $lib in
+ *.la) func_source "$func_resolve_sysroot_result" ;;
+ esac
+
+ # Collect preopened libtool deplibs, except any this library
+ # has declared as weak libs
+ for deplib in $dependency_libs; do
+ func_basename "$deplib"
+ deplib_base=$func_basename_result
+ case " $weak_libs " in
+ *" $deplib_base "*) ;;
+ *) func_append deplibs " $deplib" ;;
+ esac
+ done
+ done
+ libs="$dlprefiles"
+ fi
+ if test "$pass" = dlopen; then
+ # Collect dlpreopened libraries
+ save_deplibs="$deplibs"
+ deplibs=
+ fi
+
+ for deplib in $libs; do
+ lib=
+ found=no
+ case $deplib in
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ func_append compiler_flags " $deplib"
+ if test "$linkmode" = lib ; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) func_append new_inherited_linker_flags " $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -l*)
+ if test "$linkmode" != lib && test "$linkmode" != prog; then
+ func_warning "\`-l' is ignored for archives/objects"
+ continue
+ fi
+ func_stripname '-l' '' "$deplib"
+ name=$func_stripname_result
+ if test "$linkmode" = lib; then
+ searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+ else
+ searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+ fi
+ for searchdir in $searchdirs; do
+ for search_ext in .la $std_shrext .so .a; do
+ # Search the libtool library
+ lib="$searchdir/lib${name}${search_ext}"
+ if test -f "$lib"; then
+ if test "$search_ext" = ".la"; then
+ found=yes
+ else
+ found=no
+ fi
+ break 2
+ fi
+ done
+ done
+ if test "$found" != yes; then
+ # deplib doesn't seem to be a libtool library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ else # deplib is a libtool library
+ # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+ # We need to do some special things here, and not later.
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $deplib "*)
+ if func_lalib_p "$lib"; then
+ library_names=
+ old_library=
+ func_source "$lib"
+ for l in $old_library $library_names; do
+ ll="$l"
+ done
+ if test "X$ll" = "X$old_library" ; then # only static version available
+ found=no
+ func_dirname "$lib" "" "."
+ ladir="$func_dirname_result"
+ lib=$ladir/$old_library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ fi
+ fi
+ ;;
+ *) ;;
+ esac
+ fi
+ fi
+ ;; # -l
+ *.ltframework)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ if test "$linkmode" = lib ; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) func_append new_inherited_linker_flags " $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -L*)
+ case $linkmode in
+ lib)
+ deplibs="$deplib $deplibs"
+ test "$pass" = conv && continue
+ newdependency_libs="$deplib $newdependency_libs"
+ func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ prog)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ if test "$pass" = scan; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ *)
+ func_warning "\`-L' is ignored for archives/objects"
+ ;;
+ esac # linkmode
+ continue
+ ;; # -L
+ -R*)
+ if test "$pass" = link; then
+ func_stripname '-R' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ dir=$func_resolve_sysroot_result
+ # Make sure the xrpath contains only unique directories.
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+ fi
+ deplibs="$deplib $deplibs"
+ continue
+ ;;
+ *.la)
+ func_resolve_sysroot "$deplib"
+ lib=$func_resolve_sysroot_result
+ ;;
+ *.$libext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ case $linkmode in
+ lib)
+ # Linking convenience modules into shared libraries is allowed,
+ # but linking other static libraries is non-portable.
+ case " $dlpreconveniencelibs " in
+ *" $deplib "*) ;;
+ *)
+ valid_a_lib=no
+ case $deplibs_check_method in
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
+ | $EGREP "$match_pattern_regex" > /dev/null; then
+ valid_a_lib=yes
+ fi
+ ;;
+ pass_all)
+ valid_a_lib=yes
+ ;;
+ esac
+ if test "$valid_a_lib" != yes; then
+ echo
+ $ECHO "*** Warning: Trying to link with static lib archive $deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because the file extensions .$libext of this argument makes me believe"
+ echo "*** that it is just a static archive that I should not use here."
+ else
+ echo
+ $ECHO "*** Warning: Linking the shared library $output against the"
+ $ECHO "*** static library $deplib is not portable!"
+ deplibs="$deplib $deplibs"
+ fi
+ ;;
+ esac
+ continue
+ ;;
+ prog)
+ if test "$pass" != link; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ continue
+ ;;
+ esac # linkmode
+ ;; # *.$libext
+ *.lo | *.$objext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ elif test "$linkmode" = prog; then
+ if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlopen support or we're linking statically,
+ # we need to preload.
+ func_append newdlprefiles " $deplib"
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ func_append newdlfiles " $deplib"
+ fi
+ fi
+ continue
+ ;;
+ %DEPLIBS%)
+ alldeplibs=yes
+ continue
+ ;;
+ esac # case $deplib
+
+ if test "$found" = yes || test -f "$lib"; then :
+ else
+ func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
+ fi
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$lib" \
+ || func_fatal_error "\`$lib' is not a valid libtool archive"
+
+ func_dirname "$lib" "" "."
+ ladir="$func_dirname_result"
+
+ dlname=
+ dlopen=
+ dlpreopen=
+ libdir=
+ library_names=
+ old_library=
+ inherited_linker_flags=
+ # If the library was installed with an old release of libtool,
+ # it will not redefine variables installed, or shouldnotlink
+ installed=yes
+ shouldnotlink=no
+ avoidtemprpath=
+
+
+ # Read the .la file
+ func_source "$lib"
+
+ # Convert "-framework foo" to "foo.ltframework"
+ if test -n "$inherited_linker_flags"; then
+ tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+ for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+ case " $new_inherited_linker_flags " in
+ *" $tmp_inherited_linker_flag "*) ;;
+ *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
+ esac
+ done
+ fi
+ dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan" ||
+ { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+ test -n "$dlopen" && func_append dlfiles " $dlopen"
+ test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
+ fi
+
+ if test "$pass" = conv; then
+ # Only check for convenience libraries
+ deplibs="$lib $deplibs"
+ if test -z "$libdir"; then
+ if test -z "$old_library"; then
+ func_fatal_error "cannot find name of link library for \`$lib'"
+ fi
+ # It is a libtool convenience library, so add in its objects.
+ func_append convenience " $ladir/$objdir/$old_library"
+ func_append old_convenience " $ladir/$objdir/$old_library"
+ elif test "$linkmode" != prog && test "$linkmode" != lib; then
+ func_fatal_error "\`$lib' is not a convenience library"
+ fi
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ deplibs="$deplib $deplibs"
+ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append tmp_libs " $deplib"
+ done
+ continue
+ fi # $pass = conv
+
+
+ # Get the name of the library we link against.
+ linklib=
+ if test -n "$old_library" &&
+ { test "$prefer_static_libs" = yes ||
+ test "$prefer_static_libs,$installed" = "built,no"; }; then
+ linklib=$old_library
+ else
+ for l in $old_library $library_names; do
+ linklib="$l"
+ done
+ fi
+ if test -z "$linklib"; then
+ func_fatal_error "cannot find name of link library for \`$lib'"
+ fi
+
+ # This library was specified with -dlopen.
+ if test "$pass" = dlopen; then
+ if test -z "$libdir"; then
+ func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
+ fi
+ if test -z "$dlname" ||
+ test "$dlopen_support" != yes ||
+ test "$build_libtool_libs" = no; then
+ # If there is no dlname, no dlopen support or we're linking
+ # statically, we need to preload. We also need to preload any
+ # dependent libraries so libltdl's deplib preloader doesn't
+ # bomb out in the load deplibs phase.
+ func_append dlprefiles " $lib $dependency_libs"
+ else
+ func_append newdlfiles " $lib"
+ fi
+ continue
+ fi # $pass = dlopen
+
+ # We need an absolute path.
+ case $ladir in
+ [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+ *)
+ abs_ladir=`cd "$ladir" && pwd`
+ if test -z "$abs_ladir"; then
+ func_warning "cannot determine absolute directory name of \`$ladir'"
+ func_warning "passing it literally to the linker, although it might fail"
+ abs_ladir="$ladir"
+ fi
+ ;;
+ esac
+ func_basename "$lib"
+ laname="$func_basename_result"
+
+ # Find the relevant object directory and library name.
+ if test "X$installed" = Xyes; then
+ if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ func_warning "library \`$lib' was moved."
+ dir="$ladir"
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
+ else
+ dir="$lt_sysroot$libdir"
+ absdir="$lt_sysroot$libdir"
+ fi
+ test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+ else
+ if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ dir="$ladir"
+ absdir="$abs_ladir"
+ # Remove this search path later
+ func_append notinst_path " $abs_ladir"
+ else
+ dir="$ladir/$objdir"
+ absdir="$abs_ladir/$objdir"
+ # Remove this search path later
+ func_append notinst_path " $abs_ladir"
+ fi
+ fi # $installed = yes
+ func_stripname 'lib' '.la' "$laname"
+ name=$func_stripname_result
+
+ # This library was specified with -dlpreopen.
+ if test "$pass" = dlpreopen; then
+ if test -z "$libdir" && test "$linkmode" = prog; then
+ func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+ fi
+ case "$host" in
+ # special handling for platforms with PE-DLLs.
+ *cygwin* | *mingw* | *cegcc* )
+ # Linker will automatically link against shared library if both
+ # static and shared are present. Therefore, ensure we extract
+ # symbols from the import library if a shared library is present
+ # (otherwise, the dlopen module name will be incorrect). We do
+ # this by putting the import library name into $newdlprefiles.
+ # We recover the dlopen module name by 'saving' the la file
+ # name in a special purpose variable, and (later) extracting the
+ # dlname from the la file.
+ if test -n "$dlname"; then
+ func_tr_sh "$dir/$linklib"
+ eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
+ func_append newdlprefiles " $dir/$linklib"
+ else
+ func_append newdlprefiles " $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ func_append dlpreconveniencelibs " $dir/$old_library"
+ fi
+ ;;
+ * )
+ # Prefer using a static library (so that no silly _DYNAMIC symbols
+ # are required to link).
+ if test -n "$old_library"; then
+ func_append newdlprefiles " $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ func_append dlpreconveniencelibs " $dir/$old_library"
+ # Otherwise, use the dlname, so that lt_dlopen finds it.
+ elif test -n "$dlname"; then
+ func_append newdlprefiles " $dir/$dlname"
+ else
+ func_append newdlprefiles " $dir/$linklib"
+ fi
+ ;;
+ esac
+ fi # $pass = dlpreopen
+
+ if test -z "$libdir"; then
+ # Link the convenience library
+ if test "$linkmode" = lib; then
+ deplibs="$dir/$old_library $deplibs"
+ elif test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$dir/$old_library $compile_deplibs"
+ finalize_deplibs="$dir/$old_library $finalize_deplibs"
+ else
+ deplibs="$lib $deplibs" # used for prog,scan pass
+ fi
+ continue
+ fi
+
+
+ if test "$linkmode" = prog && test "$pass" != link; then
+ func_append newlib_search_path " $ladir"
+ deplibs="$lib $deplibs"
+
+ linkalldeplibs=no
+ if test "$link_all_deplibs" != no || test -z "$library_names" ||
+ test "$build_libtool_libs" = no; then
+ linkalldeplibs=yes
+ fi
+
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ esac
+ # Need to link against all dependency_libs?
+ if test "$linkalldeplibs" = yes; then
+ deplibs="$deplib $deplibs"
+ else
+ # Need to hardcode shared library paths
+ # or/and link against static libraries
+ newdependency_libs="$deplib $newdependency_libs"
+ fi
+ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append tmp_libs " $deplib"
+ done # for deplib
+ continue
+ fi # $linkmode = prog...
+
+ if test "$linkmode,$pass" = "prog,link"; then
+ if test -n "$library_names" &&
+ { { test "$prefer_static_libs" = no ||
+ test "$prefer_static_libs,$installed" = "built,yes"; } ||
+ test -z "$old_library"; }; then
+ # We need to hardcode the library path
+ if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+ # Make sure the rpath contains only unique directories.
+ case "$temp_rpath:" in
+ *"$absdir:"*) ;;
+ *) func_append temp_rpath "$absdir:" ;;
+ esac
+ fi
+
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) func_append compile_rpath " $absdir" ;;
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ ;;
+ esac
+ fi # $linkmode,$pass = prog,link...
+
+ if test "$alldeplibs" = yes &&
+ { test "$deplibs_check_method" = pass_all ||
+ { test "$build_libtool_libs" = yes &&
+ test -n "$library_names"; }; }; then
+ # We only need to search for static libraries
+ continue
+ fi
+ fi
+
+ link_static=no # Whether the deplib will be linked statically
+ use_static_libs=$prefer_static_libs
+ if test "$use_static_libs" = built && test "$installed" = yes; then
+ use_static_libs=no
+ fi
+ if test -n "$library_names" &&
+ { test "$use_static_libs" = no || test -z "$old_library"; }; then
+ case $host in
+ *cygwin* | *mingw* | *cegcc*)
+ # No point in relinking DLLs because paths are not encoded
+ func_append notinst_deplibs " $lib"
+ need_relink=no
+ ;;
+ *)
+ if test "$installed" = no; then
+ func_append notinst_deplibs " $lib"
+ need_relink=yes
+ fi
+ ;;
+ esac
+ # This is a shared library
+
+ # Warn about portability, can't link against -module's on some
+ # systems (darwin). Don't bleat about dlopened modules though!
+ dlopenmodule=""
+ for dlpremoduletest in $dlprefiles; do
+ if test "X$dlpremoduletest" = "X$lib"; then
+ dlopenmodule="$dlpremoduletest"
+ break
+ fi
+ done
+ if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+ echo
+ if test "$linkmode" = prog; then
+ $ECHO "*** Warning: Linking the executable $output against the loadable module"
+ else
+ $ECHO "*** Warning: Linking the shared library $output against the loadable module"
+ fi
+ $ECHO "*** $linklib is not portable!"
+ fi
+ if test "$linkmode" = lib &&
+ test "$hardcode_into_libs" = yes; then
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) func_append compile_rpath " $absdir" ;;
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ ;;
+ esac
+ fi
+
+ if test -n "$old_archive_from_expsyms_cmds"; then
+ # figure out the soname
+ set dummy $library_names
+ shift
+ realname="$1"
+ shift
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ # use dlname if we got it. it's perfectly good, no?
+ if test -n "$dlname"; then
+ soname="$dlname"
+ elif test -n "$soname_spec"; then
+ # bleh windows
+ case $host in
+ *cygwin* | mingw* | *cegcc*)
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix="-$major"
+ ;;
+ esac
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+
+ # Make a new name for the extract_expsyms_cmds to use
+ soroot="$soname"
+ func_basename "$soroot"
+ soname="$func_basename_result"
+ func_stripname 'lib' '.dll' "$soname"
+ newlib=libimp-$func_stripname_result.a
+
+ # If the library has no export list, then create one now
+ if test -f "$output_objdir/$soname-def"; then :
+ else
+ func_verbose "extracting exported symbol list from \`$soname'"
+ func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
+ fi
+
+ # Create $newlib
+ if test -f "$output_objdir/$newlib"; then :; else
+ func_verbose "generating import library for \`$soname'"
+ func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
+ fi
+ # make sure the library variables are pointing to the new library
+ dir=$output_objdir
+ linklib=$newlib
+ fi # test -n "$old_archive_from_expsyms_cmds"
+
+ if test "$linkmode" = prog || test "$opt_mode" != relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ lib_linked=yes
+ case $hardcode_action in
+ immediate | unsupported)
+ if test "$hardcode_direct" = no; then
+ add="$dir/$linklib"
+ case $host in
+ *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+ *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+ *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+ *-*-unixware7*) add_dir="-L$dir" ;;
+ *-*-darwin* )
+ # if the lib is a (non-dlopened) module then we can not
+ # link against it, someone is ignoring the earlier warnings
+ if /usr/bin/file -L $add 2> /dev/null |
+ $GREP ": [^:]* bundle" >/dev/null ; then
+ if test "X$dlopenmodule" != "X$lib"; then
+ $ECHO "*** Warning: lib $linklib is a module, not a shared library"
+ if test -z "$old_library" ; then
+ echo
+ echo "*** And there doesn't seem to be a static archive available"
+ echo "*** The link will probably fail, sorry"
+ else
+ add="$dir/$old_library"
+ fi
+ elif test -n "$old_library"; then
+ add="$dir/$old_library"
+ fi
+ fi
+ esac
+ elif test "$hardcode_minus_L" = no; then
+ case $host in
+ *-*-sunos*) add_shlibpath="$dir" ;;
+ esac
+ add_dir="-L$dir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = no; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ relink)
+ if test "$hardcode_direct" = yes &&
+ test "$hardcode_direct_absolute" = no; then
+ add="$dir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$absdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ func_append add_dir " -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ *) lib_linked=no ;;
+ esac
+
+ if test "$lib_linked" != yes; then
+ func_fatal_configuration "unsupported hardcode properties"
+ fi
+
+ if test -n "$add_shlibpath"; then
+ case :$compile_shlibpath: in
+ *":$add_shlibpath:"*) ;;
+ *) func_append compile_shlibpath "$add_shlibpath:" ;;
+ esac
+ fi
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+ test -n "$add" && compile_deplibs="$add $compile_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ if test "$hardcode_direct" != yes &&
+ test "$hardcode_minus_L" != yes &&
+ test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) func_append finalize_shlibpath "$libdir:" ;;
+ esac
+ fi
+ fi
+ fi
+
+ if test "$linkmode" = prog || test "$opt_mode" = relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ # Finalize command for both is simple: just hardcode it.
+ if test "$hardcode_direct" = yes &&
+ test "$hardcode_direct_absolute" = no; then
+ add="$libdir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$libdir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) func_append finalize_shlibpath "$libdir:" ;;
+ esac
+ add="-l$name"
+ elif test "$hardcode_automatic" = yes; then
+ if test -n "$inst_prefix_dir" &&
+ test -f "$inst_prefix_dir$libdir/$linklib" ; then
+ add="$inst_prefix_dir$libdir/$linklib"
+ else
+ add="$libdir/$linklib"
+ fi
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
+ add_dir="-L$libdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ func_append add_dir " -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ fi
+
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+ test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ fi
+ fi
+ elif test "$linkmode" = prog; then
+ # Here we assume that one of hardcode_direct or hardcode_minus_L
+ # is not unsupported. This is valid on all known static and
+ # shared platforms.
+ if test "$hardcode_direct" != unsupported; then
+ test -n "$old_library" && linklib="$old_library"
+ compile_deplibs="$dir/$linklib $compile_deplibs"
+ finalize_deplibs="$dir/$linklib $finalize_deplibs"
+ else
+ compile_deplibs="-l$name -L$dir $compile_deplibs"
+ finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+ fi
+ elif test "$build_libtool_libs" = yes; then
+ # Not a shared library
+ if test "$deplibs_check_method" != pass_all; then
+ # We're trying link a shared library against a static one
+ # but the system doesn't support it.
+
+ # Just print a warning and add the library to dependency_libs so
+ # that the program can be linked against the static library.
+ echo
+ $ECHO "*** Warning: This system can not link to static lib archive $lib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have."
+ if test "$module" = yes; then
+ echo "*** But as you try to build a module library, libtool will still create "
+ echo "*** a static module, that should work as long as the dlopening application"
+ echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+ if test -z "$global_symbol_pipe"; then
+ echo
+ echo "*** However, this would only work if libtool was able to extract symbol"
+ echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ echo "*** not find such a program. So, this module is probably useless."
+ echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ else
+ deplibs="$dir/$old_library $deplibs"
+ link_static=yes
+ fi
+ fi # link shared/static library?
+
+ if test "$linkmode" = lib; then
+ if test -n "$dependency_libs" &&
+ { test "$hardcode_into_libs" != yes ||
+ test "$build_old_libs" = yes ||
+ test "$link_static" = yes; }; then
+ # Extract -R from dependency_libs
+ temp_deplibs=
+ for libdir in $dependency_libs; do
+ case $libdir in
+ -R*) func_stripname '-R' '' "$libdir"
+ temp_xrpath=$func_stripname_result
+ case " $xrpath " in
+ *" $temp_xrpath "*) ;;
+ *) func_append xrpath " $temp_xrpath";;
+ esac;;
+ *) func_append temp_deplibs " $libdir";;
+ esac
+ done
+ dependency_libs="$temp_deplibs"
+ fi
+
+ func_append newlib_search_path " $absdir"
+ # Link against this library
+ test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+ # ... and its dependency_libs
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ newdependency_libs="$deplib $newdependency_libs"
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result";;
+ *) func_resolve_sysroot "$deplib" ;;
+ esac
+ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+ *" $func_resolve_sysroot_result "*)
+ func_append specialdeplibs " $func_resolve_sysroot_result" ;;
+ esac
+ fi
+ func_append tmp_libs " $func_resolve_sysroot_result"
+ done
+
+ if test "$link_all_deplibs" != no; then
+ # Add the search paths of all dependency libraries
+ for deplib in $dependency_libs; do
+ path=
+ case $deplib in
+ -L*) path="$deplib" ;;
+ *.la)
+ func_resolve_sysroot "$deplib"
+ deplib=$func_resolve_sysroot_result
+ func_dirname "$deplib" "" "."
+ dir=$func_dirname_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ func_warning "cannot determine absolute directory name of \`$dir'"
+ absdir="$dir"
+ fi
+ ;;
+ esac
+ if $GREP "^installed=no" $deplib > /dev/null; then
+ case $host in
+ *-*-darwin*)
+ depdepl=
+ eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+ if test -n "$deplibrary_names" ; then
+ for tmp in $deplibrary_names ; do
+ depdepl=$tmp
+ done
+ if test -f "$absdir/$objdir/$depdepl" ; then
+ depdepl="$absdir/$objdir/$depdepl"
+ darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ if test -z "$darwin_install_name"; then
+ darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ fi
+ func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+ func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
+ path=
+ fi
+ fi
+ ;;
+ *)
+ path="-L$absdir/$objdir"
+ ;;
+ esac
+ else
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$deplib' is not a valid libtool archive"
+ test "$absdir" != "$libdir" && \
+ func_warning "\`$deplib' seems to be moved"
+
+ path="-L$absdir"
+ fi
+ ;;
+ esac
+ case " $deplibs " in
+ *" $path "*) ;;
+ *) deplibs="$path $deplibs" ;;
+ esac
+ done
+ fi # link_all_deplibs != no
+ fi # linkmode = lib
+ done # for deplib in $libs
+ if test "$pass" = link; then
+ if test "$linkmode" = "prog"; then
+ compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
+ finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
+ else
+ compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ fi
+ fi
+ dependency_libs="$newdependency_libs"
+ if test "$pass" = dlpreopen; then
+ # Link the dlpreopened libraries before other libraries
+ for deplib in $save_deplibs; do
+ deplibs="$deplib $deplibs"
+ done
+ fi
+ if test "$pass" != dlopen; then
+ if test "$pass" != conv; then
+ # Make sure lib_search_path contains only unique directories.
+ lib_search_path=
+ for dir in $newlib_search_path; do
+ case "$lib_search_path " in
+ *" $dir "*) ;;
+ *) func_append lib_search_path " $dir" ;;
+ esac
+ done
+ newlib_search_path=
+ fi
+
+ if test "$linkmode,$pass" != "prog,link"; then
+ vars="deplibs"
+ else
+ vars="compile_deplibs finalize_deplibs"
+ fi
+ for var in $vars dependency_libs; do
+ # Add libraries to $var in reverse order
+ eval tmp_libs=\"\$$var\"
+ new_libs=
+ for deplib in $tmp_libs; do
+ # FIXME: Pedantically, this is the right thing to do, so
+ # that some nasty dependency loop isn't accidentally
+ # broken:
+ #new_libs="$deplib $new_libs"
+ # Pragmatically, this seems to cause very few problems in
+ # practice:
+ case $deplib in
+ -L*) new_libs="$deplib $new_libs" ;;
+ -R*) ;;
+ *)
+ # And here is the reason: when a library appears more
+ # than once as an explicit dependence of a library, or
+ # is implicitly linked in more than once by the
+ # compiler, it is considered special, and multiple
+ # occurrences thereof are not removed. Compare this
+ # with having the same library being listed as a
+ # dependency of multiple other libraries: in this case,
+ # we know (pedantically, we assume) the library does not
+ # need to be listed more than once, so we keep only the
+ # last copy. This is not always right, but it is rare
+ # enough that we require users that really mean to play
+ # such unportable linking tricks to link the library
+ # using -Wl,-lname, so that libtool does not consider it
+ # for duplicate removal.
+ case " $specialdeplibs " in
+ *" $deplib "*) new_libs="$deplib $new_libs" ;;
+ *)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$deplib $new_libs" ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ done
+ tmp_libs=
+ for deplib in $new_libs; do
+ case $deplib in
+ -L*)
+ case " $tmp_libs " in
+ *" $deplib "*) ;;
+ *) func_append tmp_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append tmp_libs " $deplib" ;;
+ esac
+ done
+ eval $var=\"$tmp_libs\"
+ done # for var
+ fi
+ # Last step: remove runtime libs from dependency_libs
+ # (they stay in deplibs)
+ tmp_libs=
+ for i in $dependency_libs ; do
+ case " $predeps $postdeps $compiler_lib_search_path " in
+ *" $i "*)
+ i=""
+ ;;
+ esac
+ if test -n "$i" ; then
+ func_append tmp_libs " $i"
+ fi
+ done
+ dependency_libs=$tmp_libs
+ done # for pass
+ if test "$linkmode" = prog; then
+ dlfiles="$newdlfiles"
+ fi
+ if test "$linkmode" = prog || test "$linkmode" = lib; then
+ dlprefiles="$newdlprefiles"
+ fi
+
+ case $linkmode in
+ oldlib)
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ func_warning "\`-dlopen' is ignored for archives"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "\`-l' and \`-L' are ignored for archives" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "\`-rpath' is ignored for archives"
+
+ test -n "$xrpath" && \
+ func_warning "\`-R' is ignored for archives"
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info/-version-number' is ignored for archives"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for archives"
+
+ test -n "$export_symbols$export_symbols_regex" && \
+ func_warning "\`-export-symbols' is ignored for archives"
+
+ # Now set the variables for building old libraries.
+ build_libtool_libs=no
+ oldlibs="$output"
+ func_append objs "$old_deplibs"
+ ;;
+
+ lib)
+ # Make sure we only generate libraries of the form `libNAME.la'.
+ case $outputname in
+ lib*)
+ func_stripname 'lib' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ ;;
+ *)
+ test "$module" = no && \
+ func_fatal_help "libtool library \`$output' must begin with \`lib'"
+
+ if test "$need_lib_prefix" != no; then
+ # Add the "lib" prefix for modules if required
+ func_stripname '' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ else
+ func_stripname '' '.la' "$outputname"
+ libname=$func_stripname_result
+ fi
+ ;;
+ esac
+
+ if test -n "$objs"; then
+ if test "$deplibs_check_method" != pass_all; then
+ func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+ else
+ echo
+ $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+ $ECHO "*** objects $objs is not portable!"
+ func_append libobjs " $objs"
+ fi
+ fi
+
+ test "$dlself" != no && \
+ func_warning "\`-dlopen self' is ignored for libtool libraries"
+
+ set dummy $rpath
+ shift
+ test "$#" -gt 1 && \
+ func_warning "ignoring multiple \`-rpath's for a libtool library"
+
+ install_libdir="$1"
+
+ oldlibs=
+ if test -z "$rpath"; then
+ if test "$build_libtool_libs" = yes; then
+ # Building a libtool convenience library.
+ # Some compilers have problems with a `.al' extension so
+ # convenience libraries should have the same extension an
+ # archive normally would.
+ oldlibs="$output_objdir/$libname.$libext $oldlibs"
+ build_libtool_libs=convenience
+ build_old_libs=yes
+ fi
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for convenience libraries"
+ else
+
+ # Parse the version information argument.
+ save_ifs="$IFS"; IFS=':'
+ set dummy $vinfo 0 0 0
+ shift
+ IFS="$save_ifs"
+
+ test -n "$7" && \
+ func_fatal_help "too many parameters to \`-version-info'"
+
+ # convert absolute version numbers to libtool ages
+ # this retains compatibility with .la files and attempts
+ # to make the code below a bit more comprehensible
+
+ case $vinfo_number in
+ yes)
+ number_major="$1"
+ number_minor="$2"
+ number_revision="$3"
+ #
+ # There are really only two kinds -- those that
+ # use the current revision as the major version
+ # and those that subtract age and use age as
+ # a minor version. But, then there is irix
+ # which has an extra 1 added just for fun
+ #
+ case $version_type in
+ # correct linux to gnu/linux during the next big refactor
+ darwin|linux|osf|windows|none)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age="$number_minor"
+ revision="$number_revision"
+ ;;
+ freebsd-aout|freebsd-elf|qnx|sunos)
+ current="$number_major"
+ revision="$number_minor"
+ age="0"
+ ;;
+ irix|nonstopux)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age="$number_minor"
+ revision="$number_minor"
+ lt_irix_increment=no
+ ;;
+ esac
+ ;;
+ no)
+ current="$1"
+ revision="$2"
+ age="$3"
+ ;;
+ esac
+
+ # Check that each of the things are valid numbers.
+ case $current in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "CURRENT \`$current' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ case $revision in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "REVISION \`$revision' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ case $age in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "AGE \`$age' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ if test "$age" -gt "$current"; then
+ func_error "AGE \`$age' is greater than the current interface number \`$current'"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ fi
+
+ # Calculate the version variables.
+ major=
+ versuffix=
+ verstring=
+ case $version_type in
+ none) ;;
+
+ darwin)
+ # Like Linux, but with the current version available in
+ # verstring for coding it into the library header
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix="$major.$age.$revision"
+ # Darwin ld doesn't like 0 for these options...
+ func_arith $current + 1
+ minor_current=$func_arith_result
+ xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+ ;;
+
+ freebsd-aout)
+ major=".$current"
+ versuffix=".$current.$revision";
+ ;;
+
+ freebsd-elf)
+ major=".$current"
+ versuffix=".$current"
+ ;;
+
+ irix | nonstopux)
+ if test "X$lt_irix_increment" = "Xno"; then
+ func_arith $current - $age
+ else
+ func_arith $current - $age + 1
+ fi
+ major=$func_arith_result
+
+ case $version_type in
+ nonstopux) verstring_prefix=nonstopux ;;
+ *) verstring_prefix=sgi ;;
+ esac
+ verstring="$verstring_prefix$major.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$revision
+ while test "$loop" -ne 0; do
+ func_arith $revision - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring="$verstring_prefix$major.$iface:$verstring"
+ done
+
+ # Before this point, $major must not contain `.'.
+ major=.$major
+ versuffix="$major.$revision"
+ ;;
+
+ linux) # correct to gnu/linux during the next big refactor
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix="$major.$age.$revision"
+ ;;
+
+ osf)
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix=".$current.$age.$revision"
+ verstring="$current.$age.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$age
+ while test "$loop" -ne 0; do
+ func_arith $current - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring="$verstring:${iface}.0"
+ done
+
+ # Make executables depend on our current version.
+ func_append verstring ":${current}.0"
+ ;;
+
+ qnx)
+ major=".$current"
+ versuffix=".$current"
+ ;;
+
+ sunos)
+ major=".$current"
+ versuffix=".$current.$revision"
+ ;;
+
+ windows)
+ # Use '-' rather than '.', since we only want one
+ # extension on DOS 8.3 filesystems.
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix="-$major"
+ ;;
+
+ *)
+ func_fatal_configuration "unknown library version type \`$version_type'"
+ ;;
+ esac
+
+ # Clear the version info if we defaulted, and they specified a release.
+ if test -z "$vinfo" && test -n "$release"; then
+ major=
+ case $version_type in
+ darwin)
+ # we can't check for "0.0" in archive_cmds due to quoting
+ # problems, so we reset it completely
+ verstring=
+ ;;
+ *)
+ verstring="0.0"
+ ;;
+ esac
+ if test "$need_version" = no; then
+ versuffix=
+ else
+ versuffix=".0.0"
+ fi
+ fi
+
+ # Remove version info from name if versioning should be avoided
+ if test "$avoid_version" = yes && test "$need_version" = no; then
+ major=
+ versuffix=
+ verstring=""
+ fi
+
+ # Check to see if the archive will have undefined symbols.
+ if test "$allow_undefined" = yes; then
+ if test "$allow_undefined_flag" = unsupported; then
+ func_warning "undefined symbols not allowed in $host shared libraries"
+ build_libtool_libs=no
+ build_old_libs=yes
+ fi
+ else
+ # Don't allow undefined symbols.
+ allow_undefined_flag="$no_undefined_flag"
+ fi
+
+ fi
+
+ func_generate_dlsyms "$libname" "$libname" "yes"
+ func_append libobjs " $symfileobj"
+ test "X$libobjs" = "X " && libobjs=
+
+ if test "$opt_mode" != relink; then
+ # Remove our outputs, but don't remove object files since they
+ # may have been created when compiling PIC objects.
+ removelist=
+ tempremovelist=`$ECHO "$output_objdir/*"`
+ for p in $tempremovelist; do
+ case $p in
+ *.$objext | *.gcno)
+ ;;
+ $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+ if test "X$precious_files_regex" != "X"; then
+ if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+ then
+ continue
+ fi
+ fi
+ func_append removelist " $p"
+ ;;
+ *) ;;
+ esac
+ done
+ test -n "$removelist" && \
+ func_show_eval "${RM}r \$removelist"
+ fi
+
+ # Now set the variables for building old libraries.
+ if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+ func_append oldlibs " $output_objdir/$libname.$libext"
+
+ # Transform .lo files to .o files.
+ oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
+ fi
+
+ # Eliminate all temporary directories.
+ #for path in $notinst_path; do
+ # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
+ # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
+ # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
+ #done
+
+ if test -n "$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ temp_xrpath=
+ for libdir in $xrpath; do
+ func_replace_sysroot "$libdir"
+ func_append temp_xrpath " -R$func_replace_sysroot_result"
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ done
+ if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+ dependency_libs="$temp_xrpath $dependency_libs"
+ fi
+ fi
+
+ # Make sure dlfiles contains only unique files that won't be dlpreopened
+ old_dlfiles="$dlfiles"
+ dlfiles=
+ for lib in $old_dlfiles; do
+ case " $dlprefiles $dlfiles " in
+ *" $lib "*) ;;
+ *) func_append dlfiles " $lib" ;;
+ esac
+ done
+
+ # Make sure dlprefiles contains only unique files
+ old_dlprefiles="$dlprefiles"
+ dlprefiles=
+ for lib in $old_dlprefiles; do
+ case "$dlprefiles " in
+ *" $lib "*) ;;
+ *) func_append dlprefiles " $lib" ;;
+ esac
+ done
+
+ if test "$build_libtool_libs" = yes; then
+ if test -n "$rpath"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ # these systems don't actually have a c library (as such)!
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C library is in the System framework
+ func_append deplibs " System.ltframework"
+ ;;
+ *-*-netbsd*)
+ # Don't link with libc until the a.out ld.so is fixed.
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ ;;
+ *)
+ # Add libc to deplibs on all other systems if necessary.
+ if test "$build_libtool_need_lc" = "yes"; then
+ func_append deplibs " -lc"
+ fi
+ ;;
+ esac
+ fi
+
+ # Transform deplibs into only deplibs that can be linked in shared.
+ name_save=$name
+ libname_save=$libname
+ release_save=$release
+ versuffix_save=$versuffix
+ major_save=$major
+ # I'm not sure if I'm treating the release correctly. I think
+ # release should show up in the -l (ie -lgmp5) so we don't want to
+ # add it in twice. Is that correct?
+ release=""
+ versuffix=""
+ major=""
+ newdeplibs=
+ droppeddeps=no
+ case $deplibs_check_method in
+ pass_all)
+ # Don't check for shared/static. Everything works.
+ # This might be a little naive. We might want to check
+ # whether the library exists or not. But this is on
+ # osf3 & osf4 and I'm not really sure... Just
+ # implementing what was already the behavior.
+ newdeplibs=$deplibs
+ ;;
+ test_compile)
+ # This code stresses the "libraries are programs" paradigm to its
+ # limits. Maybe even breaks it. We compile a program, linking it
+ # against the deplibs as a proxy for the library. Then we can check
+ # whether they linked in statically or dynamically with ldd.
+ $opt_dry_run || $RM conftest.c
+ cat > conftest.c <<EOF
+ int main() { return 0; }
+EOF
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+ ldd_output=`ldd conftest`
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ func_append newdeplibs " $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ func_append newdeplibs " $i"
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which I believe you do not have"
+ echo "*** because a test_compile did reveal that the linker did not use it for"
+ echo "*** its dynamic dependency list that programs get resolved with at runtime."
+ fi
+ fi
+ ;;
+ *)
+ func_append newdeplibs " $i"
+ ;;
+ esac
+ done
+ else
+ # Error occurred in the first compile. Let's try to salvage
+ # the situation: Compile a separate program for each library.
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+ ldd_output=`ldd conftest`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ func_append newdeplibs " $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ func_append newdeplibs " $i"
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because a test_compile did reveal that the linker did not use this one"
+ echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+ fi
+ fi
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
+ echo "*** make it link in! You will probably need to install it or some"
+ echo "*** library that it depends on before this library will be fully"
+ echo "*** functional. Installing it before continuing would be even better."
+ fi
+ ;;
+ *)
+ func_append newdeplibs " $i"
+ ;;
+ esac
+ done
+ fi
+ ;;
+ file_magic*)
+ set dummy $deplibs_check_method; shift
+ file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ if test -n "$file_magic_glob"; then
+ libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
+ else
+ libnameglob=$libname
+ fi
+ test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ if test "$want_nocaseglob" = yes; then
+ shopt -s nocaseglob
+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+ $nocaseglob
+ else
+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+ fi
+ for potent_lib in $potential_libs; do
+ # Follow soft links.
+ if ls -lLd "$potent_lib" 2>/dev/null |
+ $GREP " -> " >/dev/null; then
+ continue
+ fi
+ # The statement above tries to avoid entering an
+ # endless loop below, in case of cyclic links.
+ # We might still enter an endless loop, since a link
+ # loop can be closed while we follow links,
+ # but so what?
+ potlib="$potent_lib"
+ while test -h "$potlib" 2>/dev/null; do
+ potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+ case $potliblink in
+ [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+ *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
+ esac
+ done
+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+ $SED -e 10q |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
+ else
+ $ECHO "*** with $libname and none of the candidates passed a file format test"
+ $ECHO "*** using a file magic. Last file checked: $potlib"
+ fi
+ fi
+ ;;
+ *)
+ # Add a -L argument.
+ func_append newdeplibs " $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ potlib="$potent_lib" # see symlink-check above in file_magic test
+ if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
+ $EGREP "$match_pattern_regex" > /dev/null; then
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
+ else
+ $ECHO "*** with $libname and none of the candidates passed a file format test"
+ $ECHO "*** using a regex pattern. Last file checked: $potlib"
+ fi
+ fi
+ ;;
+ *)
+ # Add a -L argument.
+ func_append newdeplibs " $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ none | unknown | *)
+ newdeplibs=""
+ tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ for i in $predeps $postdeps ; do
+ # can't use Xsed below, because $i might contain '/'
+ tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
+ done
+ fi
+ case $tmp_deplibs in
+ *[!\ \ ]*)
+ echo
+ if test "X$deplibs_check_method" = "Xnone"; then
+ echo "*** Warning: inter-library dependencies are not supported in this platform."
+ else
+ echo "*** Warning: inter-library dependencies are not known to be supported."
+ fi
+ echo "*** All declared inter-library dependencies are being dropped."
+ droppeddeps=yes
+ ;;
+ esac
+ ;;
+ esac
+ versuffix=$versuffix_save
+ major=$major_save
+ release=$release_save
+ libname=$libname_save
+ name=$name_save
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library with the System framework
+ newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ if test "$droppeddeps" = yes; then
+ if test "$module" = yes; then
+ echo
+ echo "*** Warning: libtool could not satisfy all declared inter-library"
+ $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
+ echo "*** a static module, that should work as long as the dlopening"
+ echo "*** application is linked with the -dlopen flag."
+ if test -z "$global_symbol_pipe"; then
+ echo
+ echo "*** However, this would only work if libtool was able to extract symbol"
+ echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ echo "*** not find such a program. So, this module is probably useless."
+ echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ else
+ echo "*** The inter-library dependencies that have been dropped here will be"
+ echo "*** automatically added whenever a program is linked with this library"
+ echo "*** or is declared to -dlopen it."
+
+ if test "$allow_undefined" = no; then
+ echo
+ echo "*** Since this library must not contain undefined symbols,"
+ echo "*** because either the platform does not support them or"
+ echo "*** it was explicitly requested with -no-undefined,"
+ echo "*** libtool will only create a static version of it."
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ fi
+ fi
+ # Done checking deplibs!
+ deplibs=$newdeplibs
+ fi
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ case $host in
+ *-*-darwin*)
+ newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ esac
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $deplibs " in
+ *" -L$path/$objdir "*)
+ func_append new_libs " -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ done
+ deplibs="$new_libs"
+
+ # All the library-specific variables (install_libdir is set above).
+ library_names=
+ old_library=
+ dlname=
+
+ # Test again, we may have decided not to build it any more
+ if test "$build_libtool_libs" = yes; then
+ # Remove ${wl} instances when linking with ld.
+ # FIXME: should test the right _cmds variable.
+ case $archive_cmds in
+ *\$LD\ *) wl= ;;
+ esac
+ if test "$hardcode_into_libs" = yes; then
+ # Hardcode the library paths
+ hardcode_libdirs=
+ dep_rpath=
+ rpath="$finalize_rpath"
+ test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
+ for libdir in $rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ func_replace_sysroot "$libdir"
+ libdir=$func_replace_sysroot_result
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append dep_rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append perm_rpath " $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
+ fi
+ if test -n "$runpath_var" && test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ func_append rpath "$dir:"
+ done
+ eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+ fi
+ test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+ fi
+
+ shlibpath="$finalize_shlibpath"
+ test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+ if test -n "$shlibpath"; then
+ eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+ fi
+
+ # Get the real and link names of the library.
+ eval shared_ext=\"$shrext_cmds\"
+ eval library_names=\"$library_names_spec\"
+ set dummy $library_names
+ shift
+ realname="$1"
+ shift
+
+ if test -n "$soname_spec"; then
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+ if test -z "$dlname"; then
+ dlname=$soname
+ fi
+
+ lib="$output_objdir/$realname"
+ linknames=
+ for link
+ do
+ func_append linknames " $link"
+ done
+
+ # Use standard objects if they are pic
+ test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ test "X$libobjs" = "X " && libobjs=
+
+ delfiles=
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+ export_symbols="$output_objdir/$libname.uexp"
+ func_append delfiles " $export_symbols"
+ fi
+
+ orig_export_symbols=
+ case $host_os in
+ cygwin* | mingw* | cegcc*)
+ if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+ # exporting using user supplied symfile
+ if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+ # and it's NOT already a .def file. Must figure out
+ # which of the given symbols are data symbols and tag
+ # them as such. So, trigger use of export_symbols_cmds.
+ # export_symbols gets reassigned inside the "prepare
+ # the list of exported symbols" if statement, so the
+ # include_expsyms logic still works.
+ orig_export_symbols="$export_symbols"
+ export_symbols=
+ always_export_symbols=yes
+ fi
+ fi
+ ;;
+ esac
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+ func_verbose "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $opt_dry_run || $RM $export_symbols
+ cmds=$export_symbols_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd1 in $cmds; do
+ IFS="$save_ifs"
+ # Take the normal branch if the nm_file_list_spec branch
+ # doesn't work or if tool conversion is not needed.
+ case $nm_file_list_spec~$to_tool_file_cmd in
+ *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
+ try_normal_branch=yes
+ eval cmd=\"$cmd1\"
+ func_len " $cmd"
+ len=$func_len_result
+ ;;
+ *)
+ try_normal_branch=no
+ ;;
+ esac
+ if test "$try_normal_branch" = yes \
+ && { test "$len" -lt "$max_cmd_len" \
+ || test "$max_cmd_len" -le -1; }
+ then
+ func_show_eval "$cmd" 'exit $?'
+ skipped_export=false
+ elif test -n "$nm_file_list_spec"; then
+ func_basename "$output"
+ output_la=$func_basename_result
+ save_libobjs=$libobjs
+ save_output=$output
+ output=${output_objdir}/${output_la}.nm
+ func_to_tool_file "$output"
+ libobjs=$nm_file_list_spec$func_to_tool_file_result
+ func_append delfiles " $output"
+ func_verbose "creating $NM input file list: $output"
+ for obj in $save_libobjs; do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result"
+ done > "$output"
+ eval cmd=\"$cmd1\"
+ func_show_eval "$cmd" 'exit $?'
+ output=$save_output
+ libobjs=$save_libobjs
+ skipped_export=false
+ else
+ # The command line is too long to execute in one step.
+ func_verbose "using reloadable object file for export list..."
+ skipped_export=:
+ # Break out early, otherwise skipped_export may be
+ # set to false by a later but shorter cmd.
+ break
+ fi
+ done
+ IFS="$save_ifs"
+ if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+ fi
+
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols="$export_symbols"
+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+
+ tmp_deplibs=
+ for test_deplib in $deplibs; do
+ case " $convenience " in
+ *" $test_deplib "*) ;;
+ *)
+ func_append tmp_deplibs " $test_deplib"
+ ;;
+ esac
+ done
+ deplibs="$tmp_deplibs"
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec" &&
+ test "$compiler_needs_object" = yes &&
+ test -z "$libobjs"; then
+ # extract the archives, so we have objects to list.
+ # TODO: could optimize this to just extract one archive.
+ whole_archive_flag_spec=
+ fi
+ if test -n "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ else
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $convenience
+ func_append libobjs " $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ fi
+
+ if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+ eval flag=\"$thread_safe_flag_spec\"
+ func_append linker_flags " $flag"
+ fi
+
+ # Make a backup of the uninstalled library when relinking
+ if test "$opt_mode" = relink; then
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+ fi
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ eval test_cmds=\"$module_expsym_cmds\"
+ cmds=$module_expsym_cmds
+ else
+ eval test_cmds=\"$module_cmds\"
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval test_cmds=\"$archive_expsym_cmds\"
+ cmds=$archive_expsym_cmds
+ else
+ eval test_cmds=\"$archive_cmds\"
+ cmds=$archive_cmds
+ fi
+ fi
+
+ if test "X$skipped_export" != "X:" &&
+ func_len " $test_cmds" &&
+ len=$func_len_result &&
+ test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ :
+ else
+ # The command line is too long to link in one step, link piecewise
+ # or, if using GNU ld and skipped_export is not :, use a linker
+ # script.
+
+ # Save the value of $output and $libobjs because we want to
+ # use them later. If we have whole_archive_flag_spec, we
+ # want to use save_libobjs as it was before
+ # whole_archive_flag_spec was expanded, because we can't
+ # assume the linker understands whole_archive_flag_spec.
+ # This may have to be revisited, in case too many
+ # convenience libraries get linked in and end up exceeding
+ # the spec.
+ if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ fi
+ save_output=$output
+ func_basename "$output"
+ output_la=$func_basename_result
+
+ # Clear the reloadable object creation command queue and
+ # initialize k to one.
+ test_cmds=
+ concat_cmds=
+ objlist=
+ last_robj=
+ k=1
+
+ if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
+ output=${output_objdir}/${output_la}.lnkscript
+ func_verbose "creating GNU ld script: $output"
+ echo 'INPUT (' > $output
+ for obj in $save_libobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
+ done
+ echo ')' >> $output
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$func_to_tool_file_result
+ elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
+ output=${output_objdir}/${output_la}.lnk
+ func_verbose "creating linker input file list: $output"
+ : > $output
+ set x $save_libobjs
+ shift
+ firstobj=
+ if test "$compiler_needs_object" = yes; then
+ firstobj="$1 "
+ shift
+ fi
+ for obj
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
+ done
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
+ else
+ if test -n "$save_libobjs"; then
+ func_verbose "creating reloadable object files..."
+ output=$output_objdir/$output_la-${k}.$objext
+ eval test_cmds=\"$reload_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+
+ # Loop over the list of objects to be linked.
+ for obj in $save_libobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ if test "X$objlist" = X ||
+ test "$len" -lt "$max_cmd_len"; then
+ func_append objlist " $obj"
+ else
+ # The command $test_cmds is almost too long, add a
+ # command to the queue.
+ if test "$k" -eq 1 ; then
+ # The first file doesn't have a previous command to add.
+ reload_objs=$objlist
+ eval concat_cmds=\"$reload_cmds\"
+ else
+ # All subsequent reloadable object files will link in
+ # the last one created.
+ reload_objs="$objlist $last_robj"
+ eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
+ fi
+ last_robj=$output_objdir/$output_la-${k}.$objext
+ func_arith $k + 1
+ k=$func_arith_result
+ output=$output_objdir/$output_la-${k}.$objext
+ objlist=" $obj"
+ func_len " $last_robj"
+ func_arith $len0 + $func_len_result
+ len=$func_arith_result
+ fi
+ done
+ # Handle the remaining objects by creating one last
+ # reloadable object file. All subsequent reloadable object
+ # files will link in the last one created.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ reload_objs="$objlist $last_robj"
+ eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+ fi
+ func_append delfiles " $output"
+
+ else
+ output=
+ fi
+
+ if ${skipped_export-false}; then
+ func_verbose "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $opt_dry_run || $RM $export_symbols
+ libobjs=$output
+ # Append the command to create the export file.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+ fi
+ fi
+
+ test -n "$save_libobjs" &&
+ func_verbose "creating a temporary reloadable object file: $output"
+
+ # Loop through the commands generated above and execute them.
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $concat_cmds; do
+ IFS="$save_ifs"
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$opt_mode" = relink; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+
+ if test -n "$export_symbols_regex" && ${skipped_export-false}; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+
+ if ${skipped_export-false}; then
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols="$export_symbols"
+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+ fi
+
+ libobjs=$output
+ # Restore the value of output.
+ output=$save_output
+
+ if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ # Expand the library linking commands again to reset the
+ # value of $libobjs for piecewise linking.
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ cmds=$module_expsym_cmds
+ else
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ cmds=$archive_expsym_cmds
+ else
+ cmds=$archive_cmds
+ fi
+ fi
+ fi
+
+ if test -n "$delfiles"; then
+ # Append the command to remove temporary files to $cmds.
+ eval cmds=\"\$cmds~\$RM $delfiles\"
+ fi
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ func_append libobjs " $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$opt_mode" = relink; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+
+ # Restore the uninstalled library and exit
+ if test "$opt_mode" = relink; then
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
+
+ if test -n "$convenience"; then
+ if test -z "$whole_archive_flag_spec"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ # Create links to the real library.
+ for linkname in $linknames; do
+ if test "$realname" != "$linkname"; then
+ func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
+ fi
+ done
+
+ # If -module or -export-dynamic was specified, set the dlname.
+ if test "$module" = yes || test "$export_dynamic" = yes; then
+ # On all known operating systems, these are identical.
+ dlname="$soname"
+ fi
+ fi
+ ;;
+
+ obj)
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ func_warning "\`-dlopen' is ignored for objects"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "\`-l' and \`-L' are ignored for objects" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "\`-rpath' is ignored for objects"
+
+ test -n "$xrpath" && \
+ func_warning "\`-R' is ignored for objects"
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info' is ignored for objects"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for objects"
+
+ case $output in
+ *.lo)
+ test -n "$objs$old_deplibs" && \
+ func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+
+ libobj=$output
+ func_lo2o "$libobj"
+ obj=$func_lo2o_result
+ ;;
+ *)
+ libobj=
+ obj="$output"
+ ;;
+ esac
+
+ # Delete the old objects.
+ $opt_dry_run || $RM $obj $libobj
+
+ # Objects from convenience libraries. This assumes
+ # single-version convenience libraries. Whenever we create
+ # different ones for PIC/non-PIC, this we'll have to duplicate
+ # the extraction.
+ reload_conv_objs=
+ gentop=
+ # reload_cmds runs $LD directly, so let us get rid of
+ # -Wl from whole_archive_flag_spec and hope we can get by with
+ # turning comma into space..
+ wl=
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+ reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+ else
+ gentop="$output_objdir/${obj}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $convenience
+ reload_conv_objs="$reload_objs $func_extract_archives_result"
+ fi
+ fi
+
+ # If we're not building shared, we need to use non_pic_objs
+ test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
+
+ # Create the old-style object.
+ reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+ output="$obj"
+ func_execute_cmds "$reload_cmds" 'exit $?'
+
+ # Exit if we aren't doing a library object file.
+ if test -z "$libobj"; then
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$build_libtool_libs" != yes; then
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ # Create an invalid libtool object if no PIC, so that we don't
+ # accidentally link it into a program.
+ # $show "echo timestamp > $libobj"
+ # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
+ exit $EXIT_SUCCESS
+ fi
+
+ if test -n "$pic_flag" || test "$pic_mode" != default; then
+ # Only do commands if we really have different PIC objects.
+ reload_objs="$libobjs $reload_conv_objs"
+ output="$libobj"
+ func_execute_cmds "$reload_cmds" 'exit $?'
+ fi
+
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ ;;
+
+ prog)
+ case $host in
+ *cygwin*) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result.exe;;
+ esac
+ test -n "$vinfo" && \
+ func_warning "\`-version-info' is ignored for programs"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for programs"
+
+ test "$preload" = yes \
+ && test "$dlopen_support" = unknown \
+ && test "$dlopen_self" = unknown \
+ && test "$dlopen_self_static" = unknown && \
+ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library is the System framework
+ compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
+ finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ case $host in
+ *-*-darwin*)
+ # Don't allow lazy linking, it breaks C++ global constructors
+ # But is supposedly fixed on 10.4 or later (yay!).
+ if test "$tagname" = CXX ; then
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+ 10.[0123])
+ func_append compile_command " ${wl}-bind_at_load"
+ func_append finalize_command " ${wl}-bind_at_load"
+ ;;
+ esac
+ fi
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ esac
+
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $compile_deplibs " in
+ *" -L$path/$objdir "*)
+ func_append new_libs " -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $compile_deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ done
+ compile_deplibs="$new_libs"
+
+
+ func_append compile_command " $compile_deplibs"
+ func_append finalize_command " $finalize_deplibs"
+
+ if test -n "$rpath$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ for libdir in $rpath $xrpath; do
+ # This is the magic to use -rpath.
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ done
+ fi
+
+ # Now hardcode the library paths
+ rpath=
+ hardcode_libdirs=
+ for libdir in $compile_rpath $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append perm_rpath " $libdir" ;;
+ esac
+ fi
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$libdir:"*) ;;
+ ::) dllsearchpath=$libdir;;
+ *) func_append dllsearchpath ":$libdir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) func_append dllsearchpath ":$testbindir";;
+ esac
+ ;;
+ esac
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ compile_rpath="$rpath"
+
+ rpath=
+ hardcode_libdirs=
+ for libdir in $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$finalize_perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_perm_rpath " $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ finalize_rpath="$rpath"
+
+ if test -n "$libobjs" && test "$build_old_libs" = yes; then
+ # Transform all the library objects into standard objects.
+ compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ fi
+
+ func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+
+ # template prelinking step
+ if test -n "$prelink_cmds"; then
+ func_execute_cmds "$prelink_cmds" 'exit $?'
+ fi
+
+ wrappers_required=yes
+ case $host in
+ *cegcc* | *mingw32ce*)
+ # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
+ wrappers_required=no
+ ;;
+ *cygwin* | *mingw* )
+ if test "$build_libtool_libs" != yes; then
+ wrappers_required=no
+ fi
+ ;;
+ *)
+ if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+ wrappers_required=no
+ fi
+ ;;
+ esac
+ if test "$wrappers_required" = no; then
+ # Replace the output file specification.
+ compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+ link_command="$compile_command$compile_rpath"
+
+ # We have no uninstalled library dependencies, so finalize right now.
+ exit_status=0
+ func_show_eval "$link_command" 'exit_status=$?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ # Delete the generated files.
+ if test -f "$output_objdir/${outputname}S.${objext}"; then
+ func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+ fi
+
+ exit $exit_status
+ fi
+
+ if test -n "$compile_shlibpath$finalize_shlibpath"; then
+ compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+ fi
+ if test -n "$finalize_shlibpath"; then
+ finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+ fi
+
+ compile_var=
+ finalize_var=
+ if test -n "$runpath_var"; then
+ if test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ func_append rpath "$dir:"
+ done
+ compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ if test -n "$finalize_perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $finalize_perm_rpath; do
+ func_append rpath "$dir:"
+ done
+ finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ fi
+
+ if test "$no_install" = yes; then
+ # We don't need to create a wrapper script.
+ link_command="$compile_var$compile_command$compile_rpath"
+ # Replace the output file specification.
+ link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+ # Delete the old output file.
+ $opt_dry_run || $RM $output
+ # Link the executable and exit
+ func_show_eval "$link_command" 'exit $?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+ func_warning "this platform does not like uninstalled shared libraries"
+ func_warning "\`$output' will be relinked during installation"
+ else
+ if test "$fast_install" != no; then
+ link_command="$finalize_var$compile_command$finalize_rpath"
+ if test "$fast_install" = yes; then
+ relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+ else
+ # fast_install is set to needless
+ relink_command=
+ fi
+ else
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+ fi
+ fi
+
+ # Replace the output file specification.
+ link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+ # Delete the old output files.
+ $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+ func_show_eval "$link_command" 'exit $?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output_objdir/$outputname"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ # Now create the wrapper script.
+ func_verbose "creating $output"
+
+ # Quote the relink command for shipping.
+ if test -n "$relink_command"; then
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ relink_command="(cd `pwd`; $relink_command)"
+ relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+ fi
+
+ # Only actually do things if not in dry run mode.
+ $opt_dry_run || {
+ # win32 will think the script is a binary if it has
+ # a .exe suffix, so we strip it off here.
+ case $output in
+ *.exe) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result ;;
+ esac
+ # test for cygwin because mv fails w/o .exe extensions
+ case $host in
+ *cygwin*)
+ exeext=.exe
+ func_stripname '' '.exe' "$outputname"
+ outputname=$func_stripname_result ;;
+ *) exeext= ;;
+ esac
+ case $host in
+ *cygwin* | *mingw* )
+ func_dirname_and_basename "$output" "" "."
+ output_name=$func_basename_result
+ output_path=$func_dirname_result
+ cwrappersource="$output_path/$objdir/lt-$output_name.c"
+ cwrapper="$output_path/$output_name.exe"
+ $RM $cwrappersource $cwrapper
+ trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_cwrapperexe_src > $cwrappersource
+
+ # The wrapper executable is built using the $host compiler,
+ # because it contains $host paths and files. If cross-
+ # compiling, it, like the target executable, must be
+ # executed on the $host or under an emulation environment.
+ $opt_dry_run || {
+ $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
+ $STRIP $cwrapper
+ }
+
+ # Now, create the wrapper script for func_source use:
+ func_ltwrapper_scriptname $cwrapper
+ $RM $func_ltwrapper_scriptname_result
+ trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
+ $opt_dry_run || {
+ # note: this script will not be executed, so do not chmod.
+ if test "x$build" = "x$host" ; then
+ $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
+ else
+ func_emit_wrapper no > $func_ltwrapper_scriptname_result
+ fi
+ }
+ ;;
+ * )
+ $RM $output
+ trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_wrapper no > $output
+ chmod +x $output
+ ;;
+ esac
+ }
+ exit $EXIT_SUCCESS
+ ;;
+ esac
+
+ # See if we need to build an old-fashioned archive.
+ for oldlib in $oldlibs; do
+
+ if test "$build_libtool_libs" = convenience; then
+ oldobjs="$libobjs_save $symfileobj"
+ addlibs="$convenience"
+ build_libtool_libs=no
+ else
+ if test "$build_libtool_libs" = module; then
+ oldobjs="$libobjs_save"
+ build_libtool_libs=no
+ else
+ oldobjs="$old_deplibs $non_pic_objects"
+ if test "$preload" = yes && test -f "$symfileobj"; then
+ func_append oldobjs " $symfileobj"
+ fi
+ fi
+ addlibs="$old_convenience"
+ fi
+
+ if test -n "$addlibs"; then
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $addlibs
+ func_append oldobjs " $func_extract_archives_result"
+ fi
+
+ # Do each command in the archive commands.
+ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+ cmds=$old_archive_from_new_cmds
+ else
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ func_append oldobjs " $func_extract_archives_result"
+ fi
+
+ # POSIX demands no paths to be encoded in archives. We have
+ # to avoid creating archives with duplicate basenames if we
+ # might have to extract them afterwards, e.g., when creating a
+ # static archive out of a convenience library, or when linking
+ # the entirety of a libtool archive into another (currently
+ # not supported by libtool).
+ if (for obj in $oldobjs
+ do
+ func_basename "$obj"
+ $ECHO "$func_basename_result"
+ done | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ echo "copying selected object files to avoid basename conflicts..."
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+ func_mkdir_p "$gentop"
+ save_oldobjs=$oldobjs
+ oldobjs=
+ counter=1
+ for obj in $save_oldobjs
+ do
+ func_basename "$obj"
+ objbase="$func_basename_result"
+ case " $oldobjs " in
+ " ") oldobjs=$obj ;;
+ *[\ /]"$objbase "*)
+ while :; do
+ # Make sure we don't pick an alternate name that also
+ # overlaps.
+ newobj=lt$counter-$objbase
+ func_arith $counter + 1
+ counter=$func_arith_result
+ case " $oldobjs " in
+ *[\ /]"$newobj "*) ;;
+ *) if test ! -f "$gentop/$newobj"; then break; fi ;;
+ esac
+ done
+ func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+ func_append oldobjs " $gentop/$newobj"
+ ;;
+ *) func_append oldobjs " $obj" ;;
+ esac
+ done
+ fi
+ func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+ tool_oldlib=$func_to_tool_file_result
+ eval cmds=\"$old_archive_cmds\"
+
+ func_len " $cmds"
+ len=$func_len_result
+ if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ cmds=$old_archive_cmds
+ elif test -n "$archiver_list_spec"; then
+ func_verbose "using command file archive linking..."
+ for obj in $oldobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result"
+ done > $output_objdir/$libname.libcmd
+ func_to_tool_file "$output_objdir/$libname.libcmd"
+ oldobjs=" $archiver_list_spec$func_to_tool_file_result"
+ cmds=$old_archive_cmds
+ else
+ # the command line is too long to link in one step, link in parts
+ func_verbose "using piecewise archive linking..."
+ save_RANLIB=$RANLIB
+ RANLIB=:
+ objlist=
+ concat_cmds=
+ save_oldobjs=$oldobjs
+ oldobjs=
+ # Is there a better way of finding the last object in the list?
+ for obj in $save_oldobjs
+ do
+ last_oldobj=$obj
+ done
+ eval test_cmds=\"$old_archive_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+ for obj in $save_oldobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ func_append objlist " $obj"
+ if test "$len" -lt "$max_cmd_len"; then
+ :
+ else
+ # the above command should be used before it gets too long
+ oldobjs=$objlist
+ if test "$obj" = "$last_oldobj" ; then
+ RANLIB=$save_RANLIB
+ fi
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+ objlist=
+ len=$len0
+ fi
+ done
+ RANLIB=$save_RANLIB
+ oldobjs=$objlist
+ if test "X$oldobjs" = "X" ; then
+ eval cmds=\"\$concat_cmds\"
+ else
+ eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+ fi
+ fi
+ fi
+ func_execute_cmds "$cmds" 'exit $?'
+ done
+
+ test -n "$generated" && \
+ func_show_eval "${RM}r$generated"
+
+ # Now create the libtool archive.
+ case $output in
+ *.la)
+ old_library=
+ test "$build_old_libs" = yes && old_library="$libname.$libext"
+ func_verbose "creating $output"
+
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ # Quote the link command for shipping.
+ relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+ relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+ if test "$hardcode_automatic" = yes ; then
+ relink_command=
+ fi
+
+ # Only create the output if not a dry run.
+ $opt_dry_run || {
+ for installed in no yes; do
+ if test "$installed" = yes; then
+ if test -z "$install_libdir"; then
+ break
+ fi
+ output="$output_objdir/$outputname"i
+ # Replace all uninstalled libtool libraries with the installed ones
+ newdependency_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ *.la)
+ func_basename "$deplib"
+ name="$func_basename_result"
+ func_resolve_sysroot "$deplib"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
+ test -z "$libdir" && \
+ func_fatal_error "\`$deplib' is not a valid libtool archive"
+ func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ -L*)
+ func_stripname -L '' "$deplib"
+ func_replace_sysroot "$func_stripname_result"
+ func_append newdependency_libs " -L$func_replace_sysroot_result"
+ ;;
+ -R*)
+ func_stripname -R '' "$deplib"
+ func_replace_sysroot "$func_stripname_result"
+ func_append newdependency_libs " -R$func_replace_sysroot_result"
+ ;;
+ *) func_append newdependency_libs " $deplib" ;;
+ esac
+ done
+ dependency_libs="$newdependency_libs"
+ newdlfiles=
+
+ for lib in $dlfiles; do
+ case $lib in
+ *.la)
+ func_basename "$lib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$lib' is not a valid libtool archive"
+ func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ *) func_append newdlfiles " $lib" ;;
+ esac
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ *.la)
+ # Only pass preopened files to the pseudo-archive (for
+ # eventual linking with the app. that links it) if we
+ # didn't already link the preopened objects directly into
+ # the library:
+ func_basename "$lib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$lib' is not a valid libtool archive"
+ func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ esac
+ done
+ dlprefiles="$newdlprefiles"
+ else
+ newdlfiles=
+ for lib in $dlfiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ func_append newdlfiles " $abs"
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ func_append newdlprefiles " $abs"
+ done
+ dlprefiles="$newdlprefiles"
+ fi
+ $RM $output
+ # place dlname in correct position for cygwin
+ # In fact, it would be nice if we could use this code for all target
+ # systems that can't hard-code library paths into their executables
+ # and that have no shared library path variable independent of PATH,
+ # but it turns out we can't easily determine that from inspecting
+ # libtool variables, so we have to hard-code the OSs to which it
+ # applies here; at the moment, that means platforms that use the PE
+ # object format with DLL files. See the long comment at the top of
+ # tests/bindir.at for full details.
+ tdlname=$dlname
+ case $host,$output,$installed,$module,$dlname in
+ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
+ # If a -bindir argument was supplied, place the dll there.
+ if test "x$bindir" != x ;
+ then
+ func_relative_path "$install_libdir" "$bindir"
+ tdlname=$func_relative_path_result$dlname
+ else
+ # Otherwise fall back on heuristic.
+ tdlname=../bin/$dlname
+ fi
+ ;;
+ esac
+ $ECHO > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags='$new_inherited_linker_flags'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Names of additional weak libraries provided by this library
+weak_library_names='$weak_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+ if test "$installed" = no && test "$need_relink" = yes; then
+ $ECHO >> $output "\
+relink_command=\"$relink_command\""
+ fi
+ done
+ }
+
+ # Do a symbolic link so that the libtool archive can be found in
+ # LD_LIBRARY_PATH before the program is installed.
+ func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
+ ;;
+ esac
+ exit $EXIT_SUCCESS
+}
+
+{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
+ func_mode_link ${1+"$@"}
+
+
+# func_mode_uninstall arg...
+func_mode_uninstall ()
+{
+ $opt_debug
+ RM="$nonopt"
+ files=
+ rmforce=
+ exit_status=0
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ for arg
+ do
+ case $arg in
+ -f) func_append RM " $arg"; rmforce=yes ;;
+ -*) func_append RM " $arg" ;;
+ *) func_append files " $arg" ;;
+ esac
+ done
+
+ test -z "$RM" && \
+ func_fatal_help "you must specify an RM program"
+
+ rmdirs=
+
+ for file in $files; do
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+ if test "X$dir" = X.; then
+ odir="$objdir"
+ else
+ odir="$dir/$objdir"
+ fi
+ func_basename "$file"
+ name="$func_basename_result"
+ test "$opt_mode" = uninstall && odir="$dir"
+
+ # Remember odir for removal later, being careful to avoid duplicates
+ if test "$opt_mode" = clean; then
+ case " $rmdirs " in
+ *" $odir "*) ;;
+ *) func_append rmdirs " $odir" ;;
+ esac
+ fi
+
+ # Don't error if the file doesn't exist and rm -f was used.
+ if { test -L "$file"; } >/dev/null 2>&1 ||
+ { test -h "$file"; } >/dev/null 2>&1 ||
+ test -f "$file"; then
+ :
+ elif test -d "$file"; then
+ exit_status=1
+ continue
+ elif test "$rmforce" = yes; then
+ continue
+ fi
+
+ rmfiles="$file"
+
+ case $name in
+ *.la)
+ # Possibly a libtool archive, so verify it.
+ if func_lalib_p "$file"; then
+ func_source $dir/$name
+
+ # Delete the libtool libraries and symlinks.
+ for n in $library_names; do
+ func_append rmfiles " $odir/$n"
+ done
+ test -n "$old_library" && func_append rmfiles " $odir/$old_library"
+
+ case "$opt_mode" in
+ clean)
+ case " $library_names " in
+ *" $dlname "*) ;;
+ *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
+ esac
+ test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
+ ;;
+ uninstall)
+ if test -n "$library_names"; then
+ # Do each command in the postuninstall commands.
+ func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ fi
+
+ if test -n "$old_library"; then
+ # Do each command in the old_postuninstall commands.
+ func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ fi
+ # FIXME: should reinstall the best remaining shared library.
+ ;;
+ esac
+ fi
+ ;;
+
+ *.lo)
+ # Possibly a libtool object, so verify it.
+ if func_lalib_p "$file"; then
+
+ # Read the .lo file
+ func_source $dir/$name
+
+ # Add PIC object to the list of files to remove.
+ if test -n "$pic_object" &&
+ test "$pic_object" != none; then
+ func_append rmfiles " $dir/$pic_object"
+ fi
+
+ # Add non-PIC object to the list of files to remove.
+ if test -n "$non_pic_object" &&
+ test "$non_pic_object" != none; then
+ func_append rmfiles " $dir/$non_pic_object"
+ fi
+ fi
+ ;;
+
+ *)
+ if test "$opt_mode" = clean ; then
+ noexename=$name
+ case $file in
+ *.exe)
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ func_stripname '' '.exe' "$name"
+ noexename=$func_stripname_result
+ # $file with .exe has already been added to rmfiles,
+ # add $file without .exe
+ func_append rmfiles " $file"
+ ;;
+ esac
+ # Do a test to see if this is a libtool program.
+ if func_ltwrapper_p "$file"; then
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ relink_command=
+ func_source $func_ltwrapper_scriptname_result
+ func_append rmfiles " $func_ltwrapper_scriptname_result"
+ else
+ relink_command=
+ func_source $dir/$noexename
+ fi
+
+ # note $name still contains .exe if it was in $file originally
+ # as does the version of $file that was added into $rmfiles
+ func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
+ if test "$fast_install" = yes && test -n "$relink_command"; then
+ func_append rmfiles " $odir/lt-$name"
+ fi
+ if test "X$noexename" != "X$name" ; then
+ func_append rmfiles " $odir/lt-${noexename}.c"
+ fi
+ fi
+ fi
+ ;;
+ esac
+ func_show_eval "$RM $rmfiles" 'exit_status=1'
+ done
+
+ # Try to remove the ${objdir}s in the directories where we deleted files
+ for dir in $rmdirs; do
+ if test -d "$dir"; then
+ func_show_eval "rmdir $dir >/dev/null 2>&1"
+ fi
+ done
+
+ exit $exit_status
+}
+
+{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
+ func_mode_uninstall ${1+"$@"}
+
+test -z "$opt_mode" && {
+ help="$generic_help"
+ func_fatal_help "you must specify a MODE"
+}
+
+test -z "$exec_cmd" && \
+ func_fatal_help "invalid operation mode \`$opt_mode'"
+
+if test -n "$exec_cmd"; then
+ eval exec "$exec_cmd"
+ exit $EXIT_FAILURE
+fi
+
+exit $exit_status
+
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries. Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them. This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration. But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
+# vi:sw=2
+
diff --git a/extension/build-aux/missing b/extension/build-aux/missing
new file mode 100755
index 00000000..9a556482
--- /dev/null
+++ b/extension/build-aux/missing
@@ -0,0 +1,330 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2012-01-06.18; # UTC
+
+# Copyright (C) 1996-2012 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try '$0 --help' for more information"
+ exit 1
+fi
+
+run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, 'missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+ configure_ac=configure.ac
+else
+ configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case $1 in
+--run)
+ # Try to run requested program, and just exit if it succeeds.
+ run=
+ shift
+ "$@" && exit 0
+ # Exit code 63 means version mismatch. This often happens
+ # when the user try to use an ancient version of a tool on
+ # a file that requires a minimum version. In this case we
+ # we should proceed has if the program had been absent, or
+ # if --run hadn't been passed.
+ if test $? = 63; then
+ run=:
+ msg="probably too old"
+ fi
+ ;;
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle 'PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+ --run try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+ aclocal touch file 'aclocal.m4'
+ autoconf touch file 'configure'
+ autoheader touch file 'config.h.in'
+ autom4te touch the output file, or create a stub one
+ automake touch all 'Makefile.in' files
+ bison create 'y.tab.[ch]', if possible, from existing .[ch]
+ flex create 'lex.yy.c', if possible, from existing .c
+ help2man touch the output file
+ lex create 'lex.yy.c', if possible, from existing .c
+ makeinfo touch the output file
+ yacc create 'y.tab.[ch]', if possible, from existing .[ch]
+
+Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
+'g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+ exit $?
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing $scriptversion (GNU Automake)"
+ exit $?
+ ;;
+
+ -*)
+ echo 1>&2 "$0: Unknown '$1' option"
+ echo 1>&2 "Try '$0 --help' for more information"
+ exit 1
+ ;;
+
+esac
+
+# normalize program name to check for.
+program=`echo "$1" | sed '
+ s/^gnu-//; t
+ s/^gnu//; t
+ s/^g//; t'`
+
+# Now exit if we have it, but it failed. Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program). This is about non-GNU programs, so use $1 not
+# $program.
+case $1 in
+ lex*|yacc*)
+ # Not GNU programs, they don't have --version.
+ ;;
+
+ *)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ # Could not run --version or --help. This is probably someone
+ # running '$TOOL --version' or '$TOOL --help' to check whether
+ # $TOOL exists and not knowing $TOOL uses missing.
+ exit 1
+ fi
+ ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case $program in
+ aclocal*)
+ echo 1>&2 "\
+WARNING: '$1' is $msg. You should only need it if
+ you modified 'acinclude.m4' or '${configure_ac}'. You might want
+ to install the Automake and Perl packages. Grab them from
+ any GNU archive site."
+ touch aclocal.m4
+ ;;
+
+ autoconf*)
+ echo 1>&2 "\
+WARNING: '$1' is $msg. You should only need it if
+ you modified '${configure_ac}'. You might want to install the
+ Autoconf and GNU m4 packages. Grab them from any GNU
+ archive site."
+ touch configure
+ ;;
+
+ autoheader*)
+ echo 1>&2 "\
+WARNING: '$1' is $msg. You should only need it if
+ you modified 'acconfig.h' or '${configure_ac}'. You might want
+ to install the Autoconf and GNU m4 packages. Grab them
+ from any GNU archive site."
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+ test -z "$files" && files="config.h"
+ touch_files=
+ for f in $files; do
+ case $f in
+ *:*) touch_files="$touch_files "`echo "$f" |
+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+ *) touch_files="$touch_files $f.in";;
+ esac
+ done
+ touch $touch_files
+ ;;
+
+ automake*)
+ echo 1>&2 "\
+WARNING: '$1' is $msg. You should only need it if
+ you modified 'Makefile.am', 'acinclude.m4' or '${configure_ac}'.
+ You might want to install the Automake and Perl packages.
+ Grab them from any GNU archive site."
+ find . -type f -name Makefile.am -print |
+ sed 's/\.am$/.in/' |
+ while read f; do touch "$f"; done
+ ;;
+
+ autom4te*)
+ echo 1>&2 "\
+WARNING: '$1' is needed, but is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them.
+ You can get '$1' as part of Autoconf from any GNU
+ archive site."
+
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo "#! /bin/sh"
+ echo "# Created by GNU Automake missing as a replacement of"
+ echo "# $ $@"
+ echo "exit 0"
+ chmod +x $file
+ exit 1
+ fi
+ ;;
+
+ bison*|yacc*)
+ echo 1>&2 "\
+WARNING: '$1' $msg. You should only need it if
+ you modified a '.y' file. You may need the Bison package
+ in order for those modifications to take effect. You can get
+ Bison from any GNU archive site."
+ rm -f y.tab.c y.tab.h
+ if test $# -ne 1; then
+ eval LASTARG=\${$#}
+ case $LASTARG in
+ *.y)
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" y.tab.c
+ fi
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" y.tab.h
+ fi
+ ;;
+ esac
+ fi
+ if test ! -f y.tab.h; then
+ echo >y.tab.h
+ fi
+ if test ! -f y.tab.c; then
+ echo 'main() { return 0; }' >y.tab.c
+ fi
+ ;;
+
+ lex*|flex*)
+ echo 1>&2 "\
+WARNING: '$1' is $msg. You should only need it if
+ you modified a '.l' file. You may need the Flex package
+ in order for those modifications to take effect. You can get
+ Flex from any GNU archive site."
+ rm -f lex.yy.c
+ if test $# -ne 1; then
+ eval LASTARG=\${$#}
+ case $LASTARG in
+ *.l)
+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" lex.yy.c
+ fi
+ ;;
+ esac
+ fi
+ if test ! -f lex.yy.c; then
+ echo 'main() { return 0; }' >lex.yy.c
+ fi
+ ;;
+
+ help2man*)
+ echo 1>&2 "\
+WARNING: '$1' is $msg. You should only need it if
+ you modified a dependency of a manual page. You may need the
+ Help2man package in order for those modifications to take
+ effect. You can get Help2man from any GNU archive site."
+
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo ".ab help2man is required to generate this page"
+ exit $?
+ fi
+ ;;
+
+ makeinfo*)
+ echo 1>&2 "\
+WARNING: '$1' is $msg. You should only need it if
+ you modified a '.texi' or '.texinfo' file, or any other file
+ indirectly affecting the aspect of the manual. The spurious
+ call might also be the consequence of using a buggy 'make' (AIX,
+ DU, IRIX). You might want to install the Texinfo package or
+ the GNU make package. Grab either from any GNU archive site."
+ # The file to touch is that specified with -o ...
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -z "$file"; then
+ # ... or it is the one specified with @setfilename ...
+ infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '
+ /^@setfilename/{
+ s/.* \([^ ]*\) *$/\1/
+ p
+ q
+ }' $infile`
+ # ... or it is derived from the source name (dir/f.texi becomes f.info)
+ test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+ fi
+ # If the file does not exist, the user really needs makeinfo;
+ # let's fail without touching anything.
+ test -f $file || exit 1
+ touch $file
+ ;;
+
+ *)
+ echo 1>&2 "\
+WARNING: '$1' is needed, and is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them. Check the 'README' file,
+ it often tells you about the needed prerequisites for installing
+ this package. You may also peek at any GNU archive site, in case
+ some other package would contain this missing '$1' program."
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/extension/configh.in b/extension/configh.in
new file mode 100644
index 00000000..ee00ae6b
--- /dev/null
+++ b/extension/configh.in
@@ -0,0 +1,137 @@
+/* configh.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if translation of program messages to the user's native
+ language is requested. */
+#undef ENABLE_NLS
+
+/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
+ CoreFoundation framework. */
+#undef HAVE_CFLOCALECOPYCURRENT
+
+/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
+ the CoreFoundation framework. */
+#undef HAVE_CFPREFERENCESCOPYAPPVALUE
+
+/* Define if the GNU dcgettext() function is already present or preinstalled.
+ */
+#undef HAVE_DCGETTEXT
+
+/* Define to 1 if you have the <dirent.h> header file. */
+#undef HAVE_DIRENT_H
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the `fdopendir' function. */
+#undef HAVE_FDOPENDIR
+
+/* Define to 1 if you have the `fnmatch' function. */
+#undef HAVE_FNMATCH
+
+/* Define to 1 if you have the <fnmatch.h> header file. */
+#undef HAVE_FNMATCH_H
+
+/* Define to 1 if you have the `getdtablesize' function. */
+#undef HAVE_GETDTABLESIZE
+
+/* Define to 1 if you have the `GetSystemTimeAsFileTime' function. */
+#undef HAVE_GETSYSTEMTIMEASFILETIME
+
+/* Define if the GNU gettext() function is already present or preinstalled. */
+#undef HAVE_GETTEXT
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#undef HAVE_GETTIMEOFDAY
+
+/* Define if you have the iconv() function and it works. */
+#undef HAVE_ICONV
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `nanosleep' function. */
+#undef HAVE_NANOSLEEP
+
+/* Define to 1 if you have the `select' function. */
+#undef HAVE_SELECT
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#undef HAVE_SYS_SELECT_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <time.h> header file. */
+#undef HAVE_TIME_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#undef LT_OBJDIR
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
+
+/* Enable large inode numbers on Mac OS X 10.5. */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+#undef inline
+#endif
diff --git a/extension/configure b/extension/configure
new file mode 100755
index 00000000..0b26dff1
--- /dev/null
+++ b/extension/configure
@@ -0,0 +1,16293 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.69 for GNU Awk Bundled Extensions 4.0.70.
+#
+# Report bugs to <bug-gawk@gnu.org>.
+#
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+ # into an infinite loop, continuously re-executing ourselves.
+ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+ _as_can_reexec=no; export _as_can_reexec;
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+ fi
+ # We don't want this to propagate to other subprocesses.
+ { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1
+
+ test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+ PATH=/empty FPATH=/empty; export PATH FPATH
+ test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
+ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ as_found=:
+ case $as_dir in #(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+ if test "x$CONFIG_SHELL" != x; then :
+ export CONFIG_SHELL
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ $as_echo "$0: Please tell bug-autoconf@gnu.org and bug-gawk@gnu.org
+$0: about your system, including any error possibly output
+$0: before this message. Then install a modern shell, or
+$0: manually run the script under such a shell if you do
+$0: have one."
+ fi
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+ # already done that, so ensure we don't try to do so again and fall
+ # in an infinite loop. This has already happened in practice.
+ _as_can_reexec=no; export _as_can_reexec
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='GNU Awk Bundled Extensions'
+PACKAGE_TARNAME='gawk-extensions'
+PACKAGE_VERSION='4.0.70'
+PACKAGE_STRING='GNU Awk Bundled Extensions 4.0.70'
+PACKAGE_BUGREPORT='bug-gawk@gnu.org'
+PACKAGE_URL='http://www.gnu.org/software/gawk-extensions/'
+
+gt_needs=
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+pkgextensiondir
+OTOOL64
+OTOOL
+LIPO
+NMEDIT
+DSYMUTIL
+MANIFEST_TOOL
+RANLIB
+DLLTOOL
+OBJDUMP
+LN_S
+NM
+ac_ct_DUMPBIN
+DUMPBIN
+LD
+FGREP
+SED
+LIBTOOL
+ac_ct_AR
+AR
+POSUB
+LTLIBINTL
+LIBINTL
+INTLLIBS
+LTLIBICONV
+LIBICONV
+INTL_MACOSX_LIBS
+EGREP
+GREP
+CPP
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+am__nodep
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+XGETTEXT_EXTRA_OPTIONS
+MSGMERGE
+XGETTEXT_015
+XGETTEXT
+GMSGFMT_015
+MSGFMT_015
+GMSGFMT
+MSGFMT
+GETTEXT_MACRO_VERSION
+USE_NLS
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_nls
+enable_dependency_tracking
+with_gnu_ld
+enable_rpath
+with_libiconv_prefix
+with_libintl_prefix
+enable_largefile
+enable_static
+enable_shared
+with_pic
+enable_fast_install
+with_sysroot
+enable_libtool_lock
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *=) ac_optarg= ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ esac
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures GNU Awk Bundled Extensions 4.0.70 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking ...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/gawk-extensions]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of GNU Awk Bundled Extensions 4.0.70:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --disable-nls do not use Native Language Support
+ --enable-dependency-tracking
+ do not reject slow dependency extractors
+ --disable-dependency-tracking
+ speeds up one-time build
+ --disable-rpath do not hardcode runtime library paths
+ --disable-largefile omit support for large files
+ --enable-static[=PKGS] build static libraries [default=no]
+ --enable-shared[=PKGS] build shared libraries [default=yes]
+ --enable-fast-install[=PKGS]
+ optimize for fast installation [default=yes]
+ --disable-libtool-lock avoid locking (might break parallel builds)
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-gnu-ld assume the C compiler uses GNU ld default=no
+ --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib
+ --without-libiconv-prefix don't search for libiconv in includedir and libdir
+ --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib
+ --without-libintl-prefix don't search for libintl in includedir and libdir
+ --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+ --with-sysroot=DIR Search for dependent libraries within DIR
+ (or the compiler's sysroot if not specified).
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <bug-gawk@gnu.org>.
+GNU Awk Bundled Extensions home page: <http://www.gnu.org/software/gawk-extensions/>.
+General help using GNU software: <http://www.gnu.org/gethelp/>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+GNU Awk Bundled Extensions configure 4.0.70
+generated by GNU Autoconf 2.69
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } > conftest.i && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ test -x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if eval \${$3+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_header_compiler=yes
+else
+ ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ac_header_preproc=yes
+else
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+ yes:no: )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+( $as_echo "## ------------------------------- ##
+## Report this to bug-gawk@gnu.org ##
+## ------------------------------- ##"
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by GNU Awk Bundled Extensions $as_me 4.0.70, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+ done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 2)
+ as_fn_append ac_configure_args1 " '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ as_fn_append ac_configure_args " '$ac_arg'"
+ ;;
+ esac
+ done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file" \
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+gt_needs="$gt_needs "
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+ac_aux_dir=
+for ac_dir in build-aux "$srcdir"/build-aux; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+
+INSTALL="$ac_aux_dir/install-sh -c"
+export INSTALL
+
+am__api_version='1.12'
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+ ./ | .// | /[cC]/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+
+ done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[\\\"\#\$\&\'\`$am_lf]*)
+ as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+ *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
+ as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
+ alias in your environment" "$LINENO" 5
+ fi
+ if test "$2" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
+test "$program_prefix" != NONE &&
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip". However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+ if ${ac_cv_path_mkdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in mkdir gmkdir; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir (GNU coreutils) '* | \
+ 'mkdir (coreutils) '* | \
+ 'mkdir (fileutils) '4.1*)
+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ break 3;;
+ esac
+ done
+ done
+ done
+IFS=$as_save_IFS
+
+fi
+
+ test -d ./--version && rmdir ./--version
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ MKDIR_P="$ac_cv_path_mkdir -p"
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for MKDIR_P within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ MKDIR_P="$ac_install_sh -d"
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='gawk-extensions'
+ VERSION='4.0.70'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+mkdir_p='$(MKDIR_P)'
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
+
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5
+$as_echo_n "checking whether NLS is requested... " >&6; }
+ # Check whether --enable-nls was given.
+if test "${enable_nls+set}" = set; then :
+ enableval=$enable_nls; USE_NLS=$enableval
+else
+ USE_NLS=yes
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5
+$as_echo "$USE_NLS" >&6; }
+
+
+
+
+ GETTEXT_MACRO_VERSION=0.18
+
+
+
+
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+ ac_executable_p="test -x"
+else
+ ac_executable_p="test -f"
+fi
+rm -f conf$$.file
+
+# Extract the first word of "msgfmt", so it can be a program name with args.
+set dummy msgfmt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_MSGFMT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case "$MSGFMT" in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
+ ;;
+ *)
+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$ac_save_IFS"
+ test -z "$ac_dir" && ac_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+ echo "$as_me: trying $ac_dir/$ac_word..." >&5
+ if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 &&
+ (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
+ ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext"
+ break 2
+ fi
+ fi
+ done
+ done
+ IFS="$ac_save_IFS"
+ test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":"
+ ;;
+esac
+fi
+MSGFMT="$ac_cv_path_MSGFMT"
+if test "$MSGFMT" != ":"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5
+$as_echo "$MSGFMT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ # Extract the first word of "gmsgfmt", so it can be a program name with args.
+set dummy gmsgfmt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GMSGFMT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $GMSGFMT in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
+ ;;
+esac
+fi
+GMSGFMT=$ac_cv_path_GMSGFMT
+if test -n "$GMSGFMT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5
+$as_echo "$GMSGFMT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+ case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
+ *) MSGFMT_015=$MSGFMT ;;
+ esac
+
+ case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
+ *) GMSGFMT_015=$GMSGFMT ;;
+ esac
+
+
+
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+ ac_executable_p="test -x"
+else
+ ac_executable_p="test -f"
+fi
+rm -f conf$$.file
+
+# Extract the first word of "xgettext", so it can be a program name with args.
+set dummy xgettext; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_XGETTEXT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case "$XGETTEXT" in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
+ ;;
+ *)
+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$ac_save_IFS"
+ test -z "$ac_dir" && ac_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+ echo "$as_me: trying $ac_dir/$ac_word..." >&5
+ if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 &&
+ (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
+ ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext"
+ break 2
+ fi
+ fi
+ done
+ done
+ IFS="$ac_save_IFS"
+ test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
+ ;;
+esac
+fi
+XGETTEXT="$ac_cv_path_XGETTEXT"
+if test "$XGETTEXT" != ":"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5
+$as_echo "$XGETTEXT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ rm -f messages.po
+
+ case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
+ *) XGETTEXT_015=$XGETTEXT ;;
+ esac
+
+
+
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+ ac_executable_p="test -x"
+else
+ ac_executable_p="test -f"
+fi
+rm -f conf$$.file
+
+# Extract the first word of "msgmerge", so it can be a program name with args.
+set dummy msgmerge; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_MSGMERGE+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case "$MSGMERGE" in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path.
+ ;;
+ *)
+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$ac_save_IFS"
+ test -z "$ac_dir" && ac_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+ echo "$as_me: trying $ac_dir/$ac_word..." >&5
+ if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then
+ ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext"
+ break 2
+ fi
+ fi
+ done
+ done
+ IFS="$ac_save_IFS"
+ test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":"
+ ;;
+esac
+fi
+MSGMERGE="$ac_cv_path_MSGMERGE"
+if test "$MSGMERGE" != ":"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5
+$as_echo "$MSGMERGE" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$localedir" || localedir='${datadir}/locale'
+
+
+ test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
+
+
+ ac_config_commands="$ac_config_commands po-directories"
+
+
+
+ if test "X$prefix" = "XNONE"; then
+ acl_final_prefix="$ac_default_prefix"
+ else
+ acl_final_prefix="$prefix"
+ fi
+ if test "X$exec_prefix" = "XNONE"; then
+ acl_final_exec_prefix='${prefix}'
+ else
+ acl_final_exec_prefix="$exec_prefix"
+ fi
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
+ prefix="$acl_save_prefix"
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+ enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ am__nodep='_no'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+if test -z "$ac_file"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CC" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
+else
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+ withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5
+$as_echo_n "checking for ld used by GCC... " >&6; }
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | [A-Za-z]:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the path of ld
+ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${acl_cv_path_LD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$LD"; then
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ acl_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break ;;
+ *)
+ test "$with_gnu_ld" != yes && break ;;
+ esac
+ fi
+ done
+ IFS="$ac_save_ifs"
+else
+ acl_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$acl_cv_path_LD"
+if test -n "$LD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${acl_cv_prog_gnu_ld+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ acl_cv_prog_gnu_ld=yes ;;
+*)
+ acl_cv_prog_gnu_ld=no ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_prog_gnu_ld" >&5
+$as_echo "$acl_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$acl_cv_prog_gnu_ld
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5
+$as_echo_n "checking for shared library run path origin... " >&6; }
+if ${acl_cv_rpath+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
+ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
+ . ./conftest.sh
+ rm -f ./conftest.sh
+ acl_cv_rpath=done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5
+$as_echo "$acl_cv_rpath" >&6; }
+ wl="$acl_cv_wl"
+ acl_libext="$acl_cv_libext"
+ acl_shlibext="$acl_cv_shlibext"
+ acl_libname_spec="$acl_cv_libname_spec"
+ acl_library_names_spec="$acl_cv_library_names_spec"
+ acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
+ acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
+ acl_hardcode_direct="$acl_cv_hardcode_direct"
+ acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
+ # Check whether --enable-rpath was given.
+if test "${enable_rpath+set}" = set; then :
+ enableval=$enable_rpath; :
+else
+ enable_rpath=yes
+fi
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if ${ac_cv_prog_CPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+
+
+ acl_libdirstem=lib
+ acl_libdirstem2=
+ case "$host_os" in
+ solaris*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5
+$as_echo_n "checking for 64-bit host... " >&6; }
+if ${gl_cv_solaris_64bit+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef _LP64
+sixtyfour bits
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "sixtyfour bits" >/dev/null 2>&1; then :
+ gl_cv_solaris_64bit=yes
+else
+ gl_cv_solaris_64bit=no
+fi
+rm -f conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5
+$as_echo "$gl_cv_solaris_64bit" >&6; }
+ if test $gl_cv_solaris_64bit = yes; then
+ acl_libdirstem=lib/64
+ case "$host_cpu" in
+ sparc*) acl_libdirstem2=lib/sparcv9 ;;
+ i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
+ esac
+ fi
+ ;;
+ *)
+ searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+ if test -n "$searchpath"; then
+ acl_save_IFS="${IFS= }"; IFS=":"
+ for searchdir in $searchpath; do
+ if test -d "$searchdir"; then
+ case "$searchdir" in
+ */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
+ */../ | */.. )
+ # Better ignore directories of this form. They are misleading.
+ ;;
+ *) searchdir=`cd "$searchdir" && pwd`
+ case "$searchdir" in
+ */lib64 ) acl_libdirstem=lib64 ;;
+ esac ;;
+ esac
+ fi
+ done
+ IFS="$acl_save_IFS"
+ fi
+ ;;
+ esac
+ test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
+
+
+
+
+
+
+
+
+
+
+
+
+ use_additional=yes
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+
+# Check whether --with-libiconv-prefix was given.
+if test "${with_libiconv_prefix+set}" = set; then :
+ withval=$with_libiconv_prefix;
+ if test "X$withval" = "Xno"; then
+ use_additional=no
+ else
+ if test "X$withval" = "X"; then
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/$acl_libdirstem"
+ if test "$acl_libdirstem2" != "$acl_libdirstem" \
+ && ! test -d "$withval/$acl_libdirstem"; then
+ additional_libdir="$withval/$acl_libdirstem2"
+ fi
+ fi
+ fi
+
+fi
+
+ LIBICONV=
+ LTLIBICONV=
+ INCICONV=
+ LIBICONV_PREFIX=
+ HAVE_LIBICONV=
+ rpathdirs=
+ ltrpathdirs=
+ names_already_handled=
+ names_next_round='iconv '
+ while test -n "$names_next_round"; do
+ names_this_round="$names_next_round"
+ names_next_round=
+ for name in $names_this_round; do
+ already_handled=
+ for n in $names_already_handled; do
+ if test "$n" = "$name"; then
+ already_handled=yes
+ break
+ fi
+ done
+ if test -z "$already_handled"; then
+ names_already_handled="$names_already_handled $name"
+ uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+ eval value=\"\$HAVE_LIB$uppername\"
+ if test -n "$value"; then
+ if test "$value" = yes; then
+ eval value=\"\$LIB$uppername\"
+ test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value"
+ eval value=\"\$LTLIB$uppername\"
+ test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value"
+ else
+ :
+ fi
+ else
+ found_dir=
+ found_la=
+ found_so=
+ found_a=
+ eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
+ if test -n "$acl_shlibext"; then
+ shrext=".$acl_shlibext" # typically: shrext=.so
+ else
+ shrext=
+ fi
+ if test $use_additional = yes; then
+ dir="$additional_libdir"
+ if test -n "$acl_shlibext"; then
+ if test -f "$dir/$libname$shrext"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext"
+ else
+ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+ ver=`(cd "$dir" && \
+ for f in "$libname$shrext".*; do echo "$f"; done \
+ | sed -e "s,^$libname$shrext\\\\.,," \
+ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+ | sed 1q ) 2>/dev/null`
+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext.$ver"
+ fi
+ else
+ eval library_names=\"$acl_library_names_spec\"
+ for f in $library_names; do
+ if test -f "$dir/$f"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext"; then
+ found_dir="$dir"
+ found_a="$dir/$libname.$acl_libext"
+ fi
+ fi
+ if test "X$found_dir" != "X"; then
+ if test -f "$dir/$libname.la"; then
+ found_la="$dir/$libname.la"
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ for x in $LDFLAGS $LTLIBICONV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ case "$x" in
+ -L*)
+ dir=`echo "X$x" | sed -e 's/^X-L//'`
+ if test -n "$acl_shlibext"; then
+ if test -f "$dir/$libname$shrext"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext"
+ else
+ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+ ver=`(cd "$dir" && \
+ for f in "$libname$shrext".*; do echo "$f"; done \
+ | sed -e "s,^$libname$shrext\\\\.,," \
+ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+ | sed 1q ) 2>/dev/null`
+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext.$ver"
+ fi
+ else
+ eval library_names=\"$acl_library_names_spec\"
+ for f in $library_names; do
+ if test -f "$dir/$f"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext"; then
+ found_dir="$dir"
+ found_a="$dir/$libname.$acl_libext"
+ fi
+ fi
+ if test "X$found_dir" != "X"; then
+ if test -f "$dir/$libname.la"; then
+ found_la="$dir/$libname.la"
+ fi
+ fi
+ ;;
+ esac
+ if test "X$found_dir" != "X"; then
+ break
+ fi
+ done
+ fi
+ if test "X$found_dir" != "X"; then
+ LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name"
+ if test "X$found_so" != "X"; then
+ if test "$enable_rpath" = no \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem" \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
+ else
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $found_dir"
+ fi
+ if test "$acl_hardcode_direct" = yes; then
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
+ else
+ if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $found_dir"
+ fi
+ else
+ haveit=
+ for x in $LDFLAGS $LIBICONV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir"
+ fi
+ if test "$acl_hardcode_minus_L" != no; then
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
+ else
+ LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name"
+ fi
+ fi
+ fi
+ fi
+ else
+ if test "X$found_a" != "X"; then
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a"
+ else
+ LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name"
+ fi
+ fi
+ additional_includedir=
+ case "$found_dir" in
+ */$acl_libdirstem | */$acl_libdirstem/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
+ if test "$name" = 'iconv'; then
+ LIBICONV_PREFIX="$basedir"
+ fi
+ additional_includedir="$basedir/include"
+ ;;
+ */$acl_libdirstem2 | */$acl_libdirstem2/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
+ if test "$name" = 'iconv'; then
+ LIBICONV_PREFIX="$basedir"
+ fi
+ additional_includedir="$basedir/include"
+ ;;
+ esac
+ if test "X$additional_includedir" != "X"; then
+ if test "X$additional_includedir" != "X/usr/include"; then
+ haveit=
+ if test "X$additional_includedir" = "X/usr/local/include"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ for x in $CPPFLAGS $INCICONV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-I$additional_includedir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_includedir"; then
+ INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir"
+ fi
+ fi
+ fi
+ fi
+ fi
+ if test -n "$found_la"; then
+ save_libdir="$libdir"
+ case "$found_la" in
+ */* | *\\*) . "$found_la" ;;
+ *) . "./$found_la" ;;
+ esac
+ libdir="$save_libdir"
+ for dep in $dependency_libs; do
+ case "$dep" in
+ -L*)
+ additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+ if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
+ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
+ haveit=
+ if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
+ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ haveit=
+ for x in $LDFLAGS $LIBICONV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir"
+ fi
+ fi
+ haveit=
+ for x in $LDFLAGS $LTLIBICONV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir"
+ fi
+ fi
+ fi
+ fi
+ ;;
+ -R*)
+ dir=`echo "X$dep" | sed -e 's/^X-R//'`
+ if test "$enable_rpath" != no; then
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $dir"
+ fi
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $dir"
+ fi
+ fi
+ ;;
+ -l*)
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+ ;;
+ *.la)
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+ ;;
+ *)
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$dep"
+ LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep"
+ ;;
+ esac
+ done
+ fi
+ else
+ LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name"
+ LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name"
+ fi
+ fi
+ fi
+ done
+ done
+ if test "X$rpathdirs" != "X"; then
+ if test -n "$acl_hardcode_libdir_separator"; then
+ alldirs=
+ for found_dir in $rpathdirs; do
+ alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
+ done
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$flag"
+ else
+ for found_dir in $rpathdirs; do
+ acl_save_libdir="$libdir"
+ libdir="$found_dir"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$flag"
+ done
+ fi
+ fi
+ if test "X$ltrpathdirs" != "X"; then
+ for found_dir in $ltrpathdirs; do
+ LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir"
+ done
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5
+$as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; }
+if ${gt_cv_func_CFPreferencesCopyAppValue+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gt_save_LIBS="$LIBS"
+ LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <CoreFoundation/CFPreferences.h>
+int
+main ()
+{
+CFPreferencesCopyAppValue(NULL, NULL)
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gt_cv_func_CFPreferencesCopyAppValue=yes
+else
+ gt_cv_func_CFPreferencesCopyAppValue=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$gt_save_LIBS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5
+$as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; }
+ if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
+
+$as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h
+
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5
+$as_echo_n "checking for CFLocaleCopyCurrent... " >&6; }
+if ${gt_cv_func_CFLocaleCopyCurrent+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gt_save_LIBS="$LIBS"
+ LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <CoreFoundation/CFLocale.h>
+int
+main ()
+{
+CFLocaleCopyCurrent();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gt_cv_func_CFLocaleCopyCurrent=yes
+else
+ gt_cv_func_CFLocaleCopyCurrent=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$gt_save_LIBS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5
+$as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; }
+ if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
+
+$as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h
+
+ fi
+ INTL_MACOSX_LIBS=
+ if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
+ INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
+ fi
+
+
+
+
+
+
+ LIBINTL=
+ LTLIBINTL=
+ POSUB=
+
+ case " $gt_needs " in
+ *" need-formatstring-macros "*) gt_api_version=3 ;;
+ *" need-ngettext "*) gt_api_version=2 ;;
+ *) gt_api_version=1 ;;
+ esac
+ gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
+ gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
+
+ if test "$USE_NLS" = "yes"; then
+ gt_use_preinstalled_gnugettext=no
+
+
+ if test $gt_api_version -ge 3; then
+ gt_revision_test_code='
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+'
+ else
+ gt_revision_test_code=
+ fi
+ if test $gt_api_version -ge 2; then
+ gt_expression_test_code=' + * ngettext ("", "", 0)'
+ else
+ gt_expression_test_code=
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5
+$as_echo_n "checking for GNU gettext in libc... " >&6; }
+if eval \${$gt_func_gnugettext_libc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <libintl.h>
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
+extern int *_nl_domain_bindings;
+int
+main ()
+{
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$gt_func_gnugettext_libc=yes"
+else
+ eval "$gt_func_gnugettext_libc=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$gt_func_gnugettext_libc
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+ if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
+
+
+
+
+
+ am_save_CPPFLAGS="$CPPFLAGS"
+
+ for element in $INCICONV; do
+ haveit=
+ for x in $CPPFLAGS; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X$element"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
+ fi
+ done
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5
+$as_echo_n "checking for iconv... " >&6; }
+if ${am_cv_func_iconv+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ am_cv_func_iconv="no, consider installing GNU libiconv"
+ am_cv_lib_iconv=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <iconv.h>
+int
+main ()
+{
+iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ am_cv_func_iconv=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test "$am_cv_func_iconv" != yes; then
+ am_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBICONV"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <iconv.h>
+int
+main ()
+{
+iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ am_cv_lib_iconv=yes
+ am_cv_func_iconv=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$am_save_LIBS"
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5
+$as_echo "$am_cv_func_iconv" >&6; }
+ if test "$am_cv_func_iconv" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5
+$as_echo_n "checking for working iconv... " >&6; }
+if ${am_cv_func_iconv_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ am_save_LIBS="$LIBS"
+ if test $am_cv_lib_iconv = yes; then
+ LIBS="$LIBS $LIBICONV"
+ fi
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
+ *) am_cv_func_iconv_works="guessing yes" ;;
+ esac
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <iconv.h>
+#include <string.h>
+int main ()
+{
+ /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
+ returns. */
+ {
+ iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
+ if (cd_utf8_to_88591 != (iconv_t)(-1))
+ {
+ static const char input[] = "\342\202\254"; /* EURO SIGN */
+ char buf[10];
+ const char *inptr = input;
+ size_t inbytesleft = strlen (input);
+ char *outptr = buf;
+ size_t outbytesleft = sizeof (buf);
+ size_t res = iconv (cd_utf8_to_88591,
+ (char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if (res == 0)
+ return 1;
+ }
+ }
+ /* Test against Solaris 10 bug: Failures are not distinguishable from
+ successful returns. */
+ {
+ iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
+ if (cd_ascii_to_88591 != (iconv_t)(-1))
+ {
+ static const char input[] = "\263";
+ char buf[10];
+ const char *inptr = input;
+ size_t inbytesleft = strlen (input);
+ char *outptr = buf;
+ size_t outbytesleft = sizeof (buf);
+ size_t res = iconv (cd_ascii_to_88591,
+ (char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if (res == 0)
+ return 1;
+ }
+ }
+#if 0 /* This bug could be worked around by the caller. */
+ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
+ {
+ iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
+ if (cd_88591_to_utf8 != (iconv_t)(-1))
+ {
+ static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+ char buf[50];
+ const char *inptr = input;
+ size_t inbytesleft = strlen (input);
+ char *outptr = buf;
+ size_t outbytesleft = sizeof (buf);
+ size_t res = iconv (cd_88591_to_utf8,
+ (char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if ((int)res > 0)
+ return 1;
+ }
+ }
+#endif
+ /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
+ provided. */
+ if (/* Try standardized names. */
+ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
+ /* Try IRIX, OSF/1 names. */
+ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
+ /* Try AIX names. */
+ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
+ /* Try HP-UX names. */
+ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
+ return 1;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ am_cv_func_iconv_works=yes
+else
+ am_cv_func_iconv_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ LIBS="$am_save_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5
+$as_echo "$am_cv_func_iconv_works" >&6; }
+ case "$am_cv_func_iconv_works" in
+ *no) am_func_iconv=no am_cv_lib_iconv=no ;;
+ *) am_func_iconv=yes ;;
+ esac
+ else
+ am_func_iconv=no am_cv_lib_iconv=no
+ fi
+ if test "$am_func_iconv" = yes; then
+
+$as_echo "#define HAVE_ICONV 1" >>confdefs.h
+
+ fi
+ if test "$am_cv_lib_iconv" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5
+$as_echo_n "checking how to link with libiconv... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5
+$as_echo "$LIBICONV" >&6; }
+ else
+ CPPFLAGS="$am_save_CPPFLAGS"
+ LIBICONV=
+ LTLIBICONV=
+ fi
+
+
+
+
+
+
+
+
+
+
+
+ use_additional=yes
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+
+# Check whether --with-libintl-prefix was given.
+if test "${with_libintl_prefix+set}" = set; then :
+ withval=$with_libintl_prefix;
+ if test "X$withval" = "Xno"; then
+ use_additional=no
+ else
+ if test "X$withval" = "X"; then
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/$acl_libdirstem"
+ if test "$acl_libdirstem2" != "$acl_libdirstem" \
+ && ! test -d "$withval/$acl_libdirstem"; then
+ additional_libdir="$withval/$acl_libdirstem2"
+ fi
+ fi
+ fi
+
+fi
+
+ LIBINTL=
+ LTLIBINTL=
+ INCINTL=
+ LIBINTL_PREFIX=
+ HAVE_LIBINTL=
+ rpathdirs=
+ ltrpathdirs=
+ names_already_handled=
+ names_next_round='intl '
+ while test -n "$names_next_round"; do
+ names_this_round="$names_next_round"
+ names_next_round=
+ for name in $names_this_round; do
+ already_handled=
+ for n in $names_already_handled; do
+ if test "$n" = "$name"; then
+ already_handled=yes
+ break
+ fi
+ done
+ if test -z "$already_handled"; then
+ names_already_handled="$names_already_handled $name"
+ uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+ eval value=\"\$HAVE_LIB$uppername\"
+ if test -n "$value"; then
+ if test "$value" = yes; then
+ eval value=\"\$LIB$uppername\"
+ test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value"
+ eval value=\"\$LTLIB$uppername\"
+ test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value"
+ else
+ :
+ fi
+ else
+ found_dir=
+ found_la=
+ found_so=
+ found_a=
+ eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
+ if test -n "$acl_shlibext"; then
+ shrext=".$acl_shlibext" # typically: shrext=.so
+ else
+ shrext=
+ fi
+ if test $use_additional = yes; then
+ dir="$additional_libdir"
+ if test -n "$acl_shlibext"; then
+ if test -f "$dir/$libname$shrext"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext"
+ else
+ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+ ver=`(cd "$dir" && \
+ for f in "$libname$shrext".*; do echo "$f"; done \
+ | sed -e "s,^$libname$shrext\\\\.,," \
+ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+ | sed 1q ) 2>/dev/null`
+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext.$ver"
+ fi
+ else
+ eval library_names=\"$acl_library_names_spec\"
+ for f in $library_names; do
+ if test -f "$dir/$f"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext"; then
+ found_dir="$dir"
+ found_a="$dir/$libname.$acl_libext"
+ fi
+ fi
+ if test "X$found_dir" != "X"; then
+ if test -f "$dir/$libname.la"; then
+ found_la="$dir/$libname.la"
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ for x in $LDFLAGS $LTLIBINTL; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ case "$x" in
+ -L*)
+ dir=`echo "X$x" | sed -e 's/^X-L//'`
+ if test -n "$acl_shlibext"; then
+ if test -f "$dir/$libname$shrext"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext"
+ else
+ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+ ver=`(cd "$dir" && \
+ for f in "$libname$shrext".*; do echo "$f"; done \
+ | sed -e "s,^$libname$shrext\\\\.,," \
+ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+ | sed 1q ) 2>/dev/null`
+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext.$ver"
+ fi
+ else
+ eval library_names=\"$acl_library_names_spec\"
+ for f in $library_names; do
+ if test -f "$dir/$f"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext"; then
+ found_dir="$dir"
+ found_a="$dir/$libname.$acl_libext"
+ fi
+ fi
+ if test "X$found_dir" != "X"; then
+ if test -f "$dir/$libname.la"; then
+ found_la="$dir/$libname.la"
+ fi
+ fi
+ ;;
+ esac
+ if test "X$found_dir" != "X"; then
+ break
+ fi
+ done
+ fi
+ if test "X$found_dir" != "X"; then
+ LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name"
+ if test "X$found_so" != "X"; then
+ if test "$enable_rpath" = no \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem" \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
+ else
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $found_dir"
+ fi
+ if test "$acl_hardcode_direct" = yes; then
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
+ else
+ if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $found_dir"
+ fi
+ else
+ haveit=
+ for x in $LDFLAGS $LIBINTL; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir"
+ fi
+ if test "$acl_hardcode_minus_L" != no; then
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
+ else
+ LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name"
+ fi
+ fi
+ fi
+ fi
+ else
+ if test "X$found_a" != "X"; then
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a"
+ else
+ LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name"
+ fi
+ fi
+ additional_includedir=
+ case "$found_dir" in
+ */$acl_libdirstem | */$acl_libdirstem/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
+ if test "$name" = 'intl'; then
+ LIBINTL_PREFIX="$basedir"
+ fi
+ additional_includedir="$basedir/include"
+ ;;
+ */$acl_libdirstem2 | */$acl_libdirstem2/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
+ if test "$name" = 'intl'; then
+ LIBINTL_PREFIX="$basedir"
+ fi
+ additional_includedir="$basedir/include"
+ ;;
+ esac
+ if test "X$additional_includedir" != "X"; then
+ if test "X$additional_includedir" != "X/usr/include"; then
+ haveit=
+ if test "X$additional_includedir" = "X/usr/local/include"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ for x in $CPPFLAGS $INCINTL; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-I$additional_includedir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_includedir"; then
+ INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir"
+ fi
+ fi
+ fi
+ fi
+ fi
+ if test -n "$found_la"; then
+ save_libdir="$libdir"
+ case "$found_la" in
+ */* | *\\*) . "$found_la" ;;
+ *) . "./$found_la" ;;
+ esac
+ libdir="$save_libdir"
+ for dep in $dependency_libs; do
+ case "$dep" in
+ -L*)
+ additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+ if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
+ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
+ haveit=
+ if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
+ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ haveit=
+ for x in $LDFLAGS $LIBINTL; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir"
+ fi
+ fi
+ haveit=
+ for x in $LDFLAGS $LTLIBINTL; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir"
+ fi
+ fi
+ fi
+ fi
+ ;;
+ -R*)
+ dir=`echo "X$dep" | sed -e 's/^X-R//'`
+ if test "$enable_rpath" != no; then
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $dir"
+ fi
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $dir"
+ fi
+ fi
+ ;;
+ -l*)
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+ ;;
+ *.la)
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+ ;;
+ *)
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$dep"
+ LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep"
+ ;;
+ esac
+ done
+ fi
+ else
+ LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name"
+ LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name"
+ fi
+ fi
+ fi
+ done
+ done
+ if test "X$rpathdirs" != "X"; then
+ if test -n "$acl_hardcode_libdir_separator"; then
+ alldirs=
+ for found_dir in $rpathdirs; do
+ alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
+ done
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$flag"
+ else
+ for found_dir in $rpathdirs; do
+ acl_save_libdir="$libdir"
+ libdir="$found_dir"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$flag"
+ done
+ fi
+ fi
+ if test "X$ltrpathdirs" != "X"; then
+ for found_dir in $ltrpathdirs; do
+ LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir"
+ done
+ fi
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5
+$as_echo_n "checking for GNU gettext in libintl... " >&6; }
+if eval \${$gt_func_gnugettext_libintl+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gt_save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $INCINTL"
+ gt_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBINTL"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <libintl.h>
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias (const char *);
+int
+main ()
+{
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$gt_func_gnugettext_libintl=yes"
+else
+ eval "$gt_func_gnugettext_libintl=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
+ LIBS="$LIBS $LIBICONV"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <libintl.h>
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias (const char *);
+int
+main ()
+{
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ LIBINTL="$LIBINTL $LIBICONV"
+ LTLIBINTL="$LTLIBINTL $LTLIBICONV"
+ eval "$gt_func_gnugettext_libintl=yes"
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ fi
+ CPPFLAGS="$gt_save_CPPFLAGS"
+ LIBS="$gt_save_LIBS"
+fi
+eval ac_res=\$$gt_func_gnugettext_libintl
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ fi
+
+ if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
+ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
+ && test "$PACKAGE" != gettext-runtime \
+ && test "$PACKAGE" != gettext-tools; }; then
+ gt_use_preinstalled_gnugettext=yes
+ else
+ LIBINTL=
+ LTLIBINTL=
+ INCINTL=
+ fi
+
+
+
+ if test -n "$INTL_MACOSX_LIBS"; then
+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
+ LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
+ LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
+ fi
+ fi
+
+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
+
+$as_echo "#define ENABLE_NLS 1" >>confdefs.h
+
+ else
+ USE_NLS=no
+ fi
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5
+$as_echo_n "checking whether to use NLS... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5
+$as_echo "$USE_NLS" >&6; }
+ if test "$USE_NLS" = "yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5
+$as_echo_n "checking where the gettext function comes from... " >&6; }
+ if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
+ gt_source="external libintl"
+ else
+ gt_source="libc"
+ fi
+ else
+ gt_source="included intl directory"
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5
+$as_echo "$gt_source" >&6; }
+ fi
+
+ if test "$USE_NLS" = "yes"; then
+
+ if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5
+$as_echo_n "checking how to link with libintl... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5
+$as_echo "$LIBINTL" >&6; }
+
+ for element in $INCINTL; do
+ haveit=
+ for x in $CPPFLAGS; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X$element"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
+ fi
+ done
+
+ fi
+
+
+$as_echo "#define HAVE_GETTEXT 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_DCGETTEXT 1" >>confdefs.h
+
+ fi
+
+ POSUB=po
+ fi
+
+
+
+ INTLLIBS="$LIBINTL"
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in ar lib "link -lib"
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AR" && break
+ done
+fi
+if test -z "$AR"; then
+ ac_ct_AR=$AR
+ for ac_prog in ar lib "link -lib"
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_AR="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_AR" && break
+done
+
+ if test "x$ac_ct_AR" = x; then
+ AR="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ AR=$ac_ct_AR
+ fi
+fi
+
+: ${AR=ar}
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5
+$as_echo_n "checking the archiver ($AR) interface... " >&6; }
+if ${am_cv_ar_interface+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ am_cv_ar_interface=ar
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int some_variable = 0;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5
+ (eval $am_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test "$ac_status" -eq 0; then
+ am_cv_ar_interface=ar
+ else
+ am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5
+ (eval $am_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test "$ac_status" -eq 0; then
+ am_cv_ar_interface=lib
+ else
+ am_cv_ar_interface=unknown
+ fi
+ fi
+ rm -f conftest.lib libconftest.a
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5
+$as_echo "$am_cv_ar_interface" >&6; }
+
+case $am_cv_ar_interface in
+ar)
+ ;;
+lib)
+ # Microsoft lib, so override with the ar-lib wrapper script.
+ # FIXME: It is wrong to rewrite AR.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__AR in this case,
+ # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
+ # similar.
+ AR="$am_aux_dir/ar-lib $AR"
+ ;;
+unknown)
+ as_fn_error $? "could not determine $AR interface" "$LINENO" 5
+ ;;
+esac
+
+# Check whether --enable-largefile was given.
+if test "${enable_largefile+set}" = set; then :
+ enableval=$enable_largefile;
+fi
+
+if test "$enable_largefile" != no; then
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
+$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
+if ${ac_cv_sys_largefile_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_sys_largefile_CC=no
+ if test "$GCC" != yes; then
+ ac_save_CC=$CC
+ while :; do
+ # IRIX 6.2 and later do not support large files by default,
+ # so use the C compiler's -n32 option if that helps.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ if ac_fn_c_try_compile "$LINENO"; then :
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext
+ CC="$CC -n32"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_largefile_CC=' -n32'; break
+fi
+rm -f core conftest.err conftest.$ac_objext
+ break
+ done
+ CC=$ac_save_CC
+ rm -f conftest.$ac_ext
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
+$as_echo "$ac_cv_sys_largefile_CC" >&6; }
+ if test "$ac_cv_sys_largefile_CC" != no; then
+ CC=$CC$ac_cv_sys_largefile_CC
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
+if ${ac_cv_sys_file_offset_bits+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_file_offset_bits=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_file_offset_bits=64; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_sys_file_offset_bits=unknown
+ break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
+$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
+case $ac_cv_sys_file_offset_bits in #(
+ no | unknown) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+_ACEOF
+;;
+esac
+rm -rf conftest*
+ if test $ac_cv_sys_file_offset_bits = unknown; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
+$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
+if ${ac_cv_sys_large_files+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_large_files=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _LARGE_FILES 1
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_large_files=1; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_sys_large_files=unknown
+ break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
+$as_echo "$ac_cv_sys_large_files" >&6; }
+case $ac_cv_sys_large_files in #(
+ no | unknown) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+_ACEOF
+;;
+esac
+rm -rf conftest*
+ fi
+
+
+fi
+
+# Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+ enableval=$enable_static; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_static=no
+fi
+
+
+
+
+
+
+
+
+
+case `pwd` in
+ *\ * | *\ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
+
+
+
+macro_version='2.4.2'
+macro_revision='1.3337'
+
+
+
+
+
+
+
+
+
+
+
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+$as_echo_n "checking how to print strings... " >&6; }
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='printf %s\n'
+else
+ # Use this function as a fallback that always works.
+ func_fallback_echo ()
+ {
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+ }
+ ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO ""
+}
+
+case "$ECHO" in
+ printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
+$as_echo "printf" >&6; } ;;
+ print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
+$as_echo "print -r" >&6; } ;;
+ *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
+$as_echo "cat" >&6; } ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for ac_i in 1 2 3 4 5 6 7; do
+ ac_script="$ac_script$as_nl$ac_script"
+ done
+ echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+ { ac_script=; unset ac_script;}
+ if test -z "$SED"; then
+ ac_path_SED_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_SED" || continue
+# Check for GNU ac_path_SED and select it if it is found.
+ # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo '' >> "conftest.nl"
+ "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_SED_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_SED="$ac_path_SED"
+ ac_path_SED_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_SED_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_SED"; then
+ as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+ fi
+else
+ ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+ rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if ${ac_cv_path_FGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+ then ac_cv_path_FGREP="$GREP -F"
+ else
+ if test -z "$FGREP"; then
+ ac_path_FGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in fgrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_FGREP" || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+ # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'FGREP' >> "conftest.nl"
+ "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_FGREP="$ac_path_FGREP"
+ ac_path_FGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_FGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_FGREP"; then
+ as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_FGREP=$FGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+ withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if ${lt_cv_path_NM+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$DUMPBIN"; then :
+ # Let the user override the test.
+ else
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in dumpbin "link -dump"
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DUMPBIN+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DUMPBIN"; then
+ ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$DUMPBIN" && break
+ done
+fi
+if test -z "$DUMPBIN"; then
+ ac_ct_DUMPBIN=$DUMPBIN
+ for ac_prog in dumpbin "link -dump"
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DUMPBIN"; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_DUMPBIN" && break
+done
+
+ if test "x$ac_ct_DUMPBIN" = x; then
+ DUMPBIN=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DUMPBIN=$ac_ct_DUMPBIN
+ fi
+fi
+
+ case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+ *COFF*)
+ DUMPBIN="$DUMPBIN -symbols"
+ ;;
+ *)
+ DUMPBIN=:
+ ;;
+ esac
+ fi
+
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
+fi
+test -z "$NM" && NM=nm
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if ${lt_cv_nm_interface+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:$LINENO: output\"" >&5)
+ cat conftest.out >&5
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if ${lt_cv_sys_max_cmd_len+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ mint*)
+ # On MiNT this can take a long time and run out of memory.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ os2*)
+ # The test takes a long time on OS/2.
+ lt_cv_sys_max_cmd_len=8192
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8 ; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+
+
+
+
+
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
+$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
+$as_echo "$xsi_shell" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
+$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
+$as_echo "$lt_shell_append" >&6; }
+
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+
+
+
+
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
+if ${lt_cv_to_host_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+
+fi
+
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
+if ${lt_cv_to_tool_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ #assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+
+fi
+
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if ${lt_cv_ld_reload_flag+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test "$GCC" != yes; then
+ reload_cmds=false
+ fi
+ ;;
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OBJDUMP"; then
+ ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+ ac_ct_OBJDUMP=$OBJDUMP
+ # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OBJDUMP"; then
+ ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_OBJDUMP="objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OBJDUMP" = x; then
+ OBJDUMP="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OBJDUMP=$ac_ct_OBJDUMP
+ fi
+else
+ OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if ${lt_cv_deplibs_check_method+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[4-9]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[45]*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+ if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ # Keep this pattern in sync with the one in func_win32_libid.
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc*)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+haiku*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[3-9]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DLLTOOL"; then
+ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+ ac_ct_DLLTOOL=$DLLTOOL
+ # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DLLTOOL"; then
+ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DLLTOOL" = x; then
+ DLLTOOL="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DLLTOOL=$ac_ct_DLLTOOL
+ fi
+else
+ DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
+if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh
+ # decide which to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in ar
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AR" && break
+ done
+fi
+if test -z "$AR"; then
+ ac_ct_AR=$AR
+ for ac_prog in ar
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_AR="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_AR" && break
+done
+
+ if test "x$ac_ct_AR" = x; then
+ AR="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ AR=$ac_ct_AR
+ fi
+fi
+
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
+$as_echo_n "checking for archiver @FILE support... " >&6; }
+if ${lt_cv_ar_at_file+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ar_at_file=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test "$ac_status" -eq 0; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test "$ac_status" -ne 0; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
+$as_echo "$lt_cv_ar_at_file" >&6; }
+
+if test "x$lt_cv_ar_at_file" = xno; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+test -z "$STRIP" && STRIP=:
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+test -z "$RANLIB" && RANLIB=:
+
+
+
+
+
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+fi
+
+case $host_os in
+ darwin*)
+ lock_old_archive_extraction=yes ;;
+ *)
+ lock_old_archive_extraction=no ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if ${lt_cv_sys_global_symbol_pipe+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[BCDT]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[ABCDGISTW]'
+ ;;
+hpux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[ABCDEGRST]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[BCDEGRST]'
+ ;;
+osf*)
+ symcode='[BCDEGQRST]'
+ ;;
+solaris*)
+ symcode='[BDRT]'
+ ;;
+sco3.2v5*)
+ symcode='[DT]'
+ ;;
+sysv4.2uw2*)
+ symcode='[DT]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[ABDT]'
+ ;;
+sysv4)
+ symcode='[DFNSTU]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK '"\
+" {last_section=section; section=\$ 3};"\
+" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
+ (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+LT_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&5
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+ fi
+ else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
+$as_echo_n "checking for sysroot... " >&6; }
+
+# Check whether --with-sysroot was given.
+if test "${with_sysroot+set}" = set; then :
+ withval=$with_sysroot;
+else
+ with_sysroot=no
+fi
+
+
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+ if test "$GCC" = yes; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
+$as_echo "${with_sysroot}" >&6; }
+ as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
+ ;;
+esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
+$as_echo "${lt_sysroot:-no}" >&6; }
+
+
+
+
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then :
+ enableval=$enable_libtool_lock;
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if ${lt_cv_cc_needs_belf+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_cc_needs_belf=yes
+else
+ lt_cv_cc_needs_belf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*)
+ case $host in
+ i?86-*-solaris*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ sparc*-*-solaris*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
+ if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+ LD="${LD-ld}_sol2"
+ fi
+ ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks="$enable_libtool_lock"
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$MANIFEST_TOOL"; then
+ ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
+if test -n "$MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
+$as_echo "$MANIFEST_TOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
+ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
+ # Extract the first word of "mt", so it can be a program name with args.
+set dummy mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_MANIFEST_TOOL"; then
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
+if test -n "$ac_ct_MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_MANIFEST_TOOL" = x; then
+ MANIFEST_TOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
+ fi
+else
+ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
+fi
+
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
+if ${lt_cv_path_mainfest_tool+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&5
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+ MANIFEST_TOOL=:
+fi
+
+
+
+
+
+
+ case $host_os in
+ rhapsody* | darwin*)
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DSYMUTIL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DSYMUTIL"; then
+ ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+ ac_ct_DSYMUTIL=$DSYMUTIL
+ # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DSYMUTIL"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DSYMUTIL" = x; then
+ DSYMUTIL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DSYMUTIL=$ac_ct_DSYMUTIL
+ fi
+else
+ DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_NMEDIT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NMEDIT"; then
+ ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+ ac_ct_NMEDIT=$NMEDIT
+ # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_NMEDIT"; then
+ ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_NMEDIT="nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_NMEDIT" = x; then
+ NMEDIT=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ NMEDIT=$ac_ct_NMEDIT
+ fi
+else
+ NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_LIPO+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$LIPO"; then
+ ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LIPO"; then
+ ac_ct_LIPO=$LIPO
+ # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_LIPO"; then
+ ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_LIPO="lipo"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_LIPO" = x; then
+ LIPO=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ LIPO=$ac_ct_LIPO
+ fi
+else
+ LIPO="$ac_cv_prog_LIPO"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL"; then
+ ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL"; then
+ ac_ct_OTOOL=$OTOOL
+ # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL"; then
+ ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_OTOOL="otool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL" = x; then
+ OTOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL=$ac_ct_OTOOL
+ fi
+else
+ OTOOL="$ac_cv_prog_OTOOL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL64"; then
+ ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL64"; then
+ ac_ct_OTOOL64=$OTOOL64
+ # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL64"; then
+ ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_OTOOL64="otool64"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL64" = x; then
+ OTOOL64=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL64=$ac_ct_OTOOL64
+ fi
+else
+ OTOOL64="$ac_cv_prog_OTOOL64"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if ${lt_cv_apple_cc_single_mod+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ # If there is a non-empty error log, and "single_module"
+ # appears in it, assume the flag caused a linker warning
+ if test -s conftest.err && $GREP single_module conftest.err; then
+ cat conftest.err >&5
+ # Otherwise, if the output was created with a 0 exit code from
+ # the compiler, it worked.
+ elif test -f libconftest.dylib && test $_lt_result -eq 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
+if ${lt_cv_ld_exported_symbols_list+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_ld_exported_symbols_list=yes
+else
+ lt_cv_ld_exported_symbols_list=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
+$as_echo_n "checking for -force_load linker flag... " >&6; }
+if ${lt_cv_ld_force_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_force_load=no
+ cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+ echo "$AR cru libconftest.a conftest.o" >&5
+ $AR cru libconftest.a conftest.o 2>&5
+ echo "$RANLIB libconftest.a" >&5
+ $RANLIB libconftest.a 2>&5
+ cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+ _lt_result=$?
+ if test -s conftest.err && $GREP force_load conftest.err; then
+ cat conftest.err >&5
+ elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+ lt_cv_ld_force_load=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -f conftest.err libconftest.a conftest conftest.c
+ rm -rf conftest.dSYM
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
+$as_echo "$lt_cv_ld_force_load" >&6; }
+ case $host_os in
+ rhapsody* | darwin1.[012])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[012]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in dlfcn.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_dlfcn_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DLFCN_H 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+# Set options
+
+
+
+ enable_dlopen=no
+
+
+ enable_win32_dll=no
+
+
+ # Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+ enableval=$enable_shared; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_shared=yes
+fi
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then :
+ withval=$with_pic; lt_p=${PACKAGE-default}
+ case $withval in
+ yes|no) pic_mode=$withval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for lt_pkg in $withval; do
+ IFS="$lt_save_ifs"
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ pic_mode=default
+fi
+
+
+test -z "$pic_mode" && pic_mode=default
+
+
+
+
+
+
+
+ # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then :
+ enableval=$enable_fast_install; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_fast_install=yes
+fi
+
+
+
+
+
+
+
+
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test -z "$LN_S" && LN_S="ln -s"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if ${lt_cv_objdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
+
+
+
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/${ac_tool_prefix}file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ else
+ MAGIC_CMD=:
+ fi
+fi
+
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+ case $cc_basename in
+ nvcc*)
+ lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
+ *)
+ lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_rtti_exceptions=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="-fno-rtti -fno-exceptions"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_rtti_exceptions=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+ lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+ :
+fi
+
+fi
+
+
+
+
+
+
+ lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_static='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ ;;
+
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ lt_prog_compiler_static=
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ lt_prog_compiler_wl='-Xlinker '
+ if test -n "$lt_prog_compiler_pic"; then
+ lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
+ fi
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ else
+ lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='--shared'
+ lt_prog_compiler_static='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ lt_prog_compiler_wl='-Wl,-Wl,,'
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-qpic'
+ lt_prog_compiler_static='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl=''
+ ;;
+ *Sun\ F* | *Sun*Fortran*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Qoption ld '
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Wl,'
+ ;;
+ *Intel*\ [CF]*Compiler*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ *Portland\ Group*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ rdos*)
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ lt_prog_compiler_wl='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl='-Qoption ld '
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_prog_compiler_pic='-Kconform_pic'
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ unicos*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_can_build_shared=no
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic='-pic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared=no
+ ;;
+ esac
+ fi
+
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic=
+ ;;
+ *)
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_works=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+ case $lt_prog_compiler_pic in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+ esac
+else
+ lt_prog_compiler_pic=
+ lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_static_works=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+ :
+else
+ lt_prog_compiler_static=
+fi
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ runpath_var=
+ allow_undefined_flag=
+ always_export_symbols=no
+ archive_cmds=
+ archive_expsym_cmds=
+ compiler_needs_object=no
+ enable_shared_with_static_runtimes=no
+ export_dynamic_flag_spec=
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ hardcode_automatic=no
+ hardcode_direct=no
+ hardcode_direct_absolute=no
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_separator=
+ hardcode_minus_L=no
+ hardcode_shlibpath_var=unsupported
+ inherit_rpath=no
+ link_all_deplibs=unknown
+ module_cmds=
+ module_expsym_cmds=
+ old_archive_from_new_cmds=
+ old_archive_from_expsyms_cmds=
+ thread_safe_flag_spec=
+ whole_archive_flag_spec=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
+ if test "$with_gnu_ld" = yes; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+ *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test "$lt_use_gnu_ld_interface" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ export_dynamic_flag_spec='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ export_dynamic_flag_spec='${wl}--export-all-symbols'
+ allow_undefined_flag=unsupported
+ always_export_symbols=no
+ enable_shared_with_static_runtimes=yes
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ haiku*)
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ link_all_deplibs=yes
+ ;;
+
+ interix[3-9]*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=' $pic_flag'
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group f77 and f90 compilers
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ whole_archive_flag_spec=
+ tmp_sharedflag='--shared' ;;
+ xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ nvcc*) # Cuda Compiler Driver 2.2
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object=yes
+ ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf* | bgf* | bgxlf* | mpixlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+
+ if test "$ld_shlibs" = no; then
+ runpath_var=
+ hardcode_libdir_flag_spec=
+ export_dynamic_flag_spec=
+ whole_archive_flag_spec=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global
+ # defined symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds=''
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ file_list_spec='${wl}-f,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ export_dynamic_flag_spec='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_="/usr/lib:/lib"
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath_
+fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag="-z nodefs"
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_="/usr/lib:/lib"
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath_
+fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag=' ${wl}-bernotok'
+ allow_undefined_flag=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec='$convenience'
+ fi
+ archive_cmds_need_lc=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[45]*)
+ export_dynamic_flag_spec=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ file_list_spec='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
+ enable_shared_with_static_runtimes=yes
+ exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ old_postinstall_cmds='chmod 644 $oldlib'
+ postlink_cmds='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_from_new_cmds='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ enable_shared_with_static_runtimes=yes
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+
+
+ archive_cmds_need_lc=no
+ hardcode_direct=no
+ hardcode_automatic=yes
+ hardcode_shlibpath_var=unsupported
+ if test "$lt_cv_ld_force_load" = "yes"; then
+ whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+
+ else
+ whole_archive_flag_spec=''
+ fi
+ link_all_deplibs=yes
+ allow_undefined_flag="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=func_echo_all
+ archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+ else
+ ld_shlibs=no
+ fi
+
+ ;;
+
+ dgux*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2.*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ export_dynamic_flag_spec='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ export_dynamic_flag_spec='${wl}-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+
+ # Older versions of the 11.00 compiler do not understand -b yet
+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
+$as_echo_n "checking if $CC understands -b... " >&6; }
+if ${lt_cv_prog_compiler__b+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler__b=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -b"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler__b=yes
+ fi
+ else
+ lt_cv_prog_compiler__b=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
+$as_echo "$lt_cv_prog_compiler__b" >&6; }
+
+if test x"$lt_cv_prog_compiler__b" = xyes; then
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+fi
+
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ ;;
+ *)
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ export_dynamic_flag_spec='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ # This should be the same for all languages, so no per-tag cache variable.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if ${lt_cv_irix_exported_symbol+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int foo (void) { return 0; }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_irix_exported_symbol=yes
+else
+ lt_cv_irix_exported_symbol=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+ if test "$lt_cv_irix_exported_symbol" = yes; then
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ fi
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ inherit_rpath=yes
+ link_all_deplibs=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ newsos6)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_shlibpath_var=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ hardcode_direct_absolute=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ allow_undefined_flag=unsupported
+ archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_separator=:
+ ;;
+
+ solaris*)
+ no_undefined_flag=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_shlibpath_var=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ link_all_deplibs=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds='$CC -r -o $output$reload_objs'
+ hardcode_direct=no
+ ;;
+ motorola)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ export_dynamic_flag_spec='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ no_undefined_flag='${wl}-z,text'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag='${wl}-z,text'
+ allow_undefined_flag='${wl}-z,nodefs'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='${wl}-R,$libdir'
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ export_dynamic_flag_spec='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
+test "$ld_shlibs" = no && can_build_shared=no
+
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl
+ pic_flag=$lt_prog_compiler_pic
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag
+ allow_undefined_flag=
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+ (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ then
+ lt_cv_archive_cmds_need_lc=no
+ else
+ lt_cv_archive_cmds_need_lc=yes
+ fi
+ allow_undefined_flag=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
+ archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
+ *) lt_sed_strip_eq="s,=/,/,g" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+ case $lt_search_path_spec in
+ *\;*)
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+ ;;
+ *)
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[lt_foo]++; }
+ if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's,/\([A-Za-z]:\),\1,g'` ;;
+ esac
+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[4-9]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='${libname}.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec="$LIB"
+ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
+ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[23].*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2.*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+haiku*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[3-9]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+ lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
+fi
+
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Add ABI-specific directories to the system library path.
+ sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
+
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+ test -n "$runpath_var" ||
+ test "X$hardcode_automatic" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$hardcode_direct" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
+ test "$hardcode_minus_L" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
+
+if test "$hardcode_action" = relink ||
+ test "$inherit_rpath" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+
+
+
+
+ if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_dlopen=yes
+else
+ ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+
+fi
+
+ ;;
+
+ *)
+ ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
+if test "x$ac_cv_func_shl_load" = xyes; then :
+ lt_cv_dlopen="shl_load"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if ${ac_cv_lib_dld_shl_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_shl_load=yes
+else
+ ac_cv_lib_dld_shl_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+else
+ ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
+if test "x$ac_cv_func_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_dlopen=yes
+else
+ ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if ${ac_cv_lib_svld_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_svld_dlopen=yes
+else
+ ac_cv_lib_svld_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if ${ac_cv_lib_dld_dld_link+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_dld_link=yes
+else
+ ac_cv_lib_dld_dld_link=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}
+_LT_EOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self_static+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self_static=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}
+_LT_EOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self_static=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ ;;
+ esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+ # Report which library types will actually be built
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+
+
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ac_config_commands="$ac_config_commands libtool"
+
+
+
+
+# Only expand once:
+
+
+
+pkgextensiondir='${libdir}/gawk'
+
+
+if test "$GCC" = yes
+then
+ CFLAGS="$CFLAGS -Wall -Wextra"
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for special development options" >&5
+$as_echo_n "checking for special development options... " >&6; }
+if test -f $srcdir/.developing
+then
+ if test "$GCC" = yes
+ then
+ CFLAGS="$CFLAGS -Wall -fno-builtin -g3 -gdwarf-2"
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+for ac_header in dirent.h fnmatch.h time.h sys/time.h sys/select.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_func in fdopendir fnmatch gettimeofday \
+ getdtablesize nanosleep select GetSystemTimeAsFileTime
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
+$as_echo_n "checking for inline... " >&6; }
+if ${ac_cv_c_inline+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_inline=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$ac_cv_c_inline" != no && break
+done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
+$as_echo "$ac_cv_c_inline" >&6; }
+
+case $ac_cv_c_inline in
+ inline | yes) ;;
+ *)
+ case $ac_cv_c_inline in
+ no) ac_val=;;
+ *) ac_val=$ac_cv_c_inline;;
+ esac
+ cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+ ;;
+esac
+
+
+ac_config_headers="$ac_config_headers config.h:configh.in"
+
+
+ac_config_files="$ac_config_files Makefile"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
+ if test -n "$EXEEXT"; then
+ am__EXEEXT_TRUE=
+ am__EXEEXT_FALSE='#'
+else
+ am__EXEEXT_TRUE='#'
+ am__EXEEXT_FALSE=
+fi
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by GNU Awk Bundled Extensions $as_me 4.0.70, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-gawk@gnu.org>.
+GNU Awk Bundled Extensions home page: <http://www.gnu.org/software/gawk-extensions/>.
+General help using GNU software: <http://www.gnu.org/gethelp/>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+GNU Awk Bundled Extensions config.status 4.0.70
+configured by $0, generated by GNU Autoconf 2.69,
+ with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=?*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ --*=)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h)
+ # Conflict between --help and --header
+ as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+ --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+ *) as_fn_append ac_config_targets " $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+# Capture the value of obsolete ALL_LINGUAS because we need it to compute
+ # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
+ # from automake < 1.5.
+ eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
+ # Capture the value of LINGUAS because we need it to compute CATALOGS.
+ LINGUAS="${LINGUAS-%UNSET%}"
+
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
+macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
+ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
+host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
+host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
+host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
+lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
+CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
+compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
+GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in SHELL \
+ECHO \
+PATH_SEPARATOR \
+SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+OBJDUMP \
+deplibs_check_method \
+file_magic_cmd \
+file_magic_glob \
+want_nocaseglob \
+DLLTOOL \
+sharedlib_from_linklib_cmd \
+AR \
+AR_FLAGS \
+archiver_list_spec \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+nm_file_list_spec \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_pic \
+lt_prog_compiler_wl \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+MANIFEST_TOOL \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_separator \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+install_override_mode \
+finish_eval \
+old_striplib \
+striplib; do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postlink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+sys_lib_dlsearch_path_spec; do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+ac_aux_dir='$ac_aux_dir'
+xsi_shell='$xsi_shell'
+lt_shell_append='$lt_shell_append'
+
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'
+
+
+
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;;
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
+ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:configh.in" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp= ac_tmp=
+ trap 'exit_status=$?
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+ trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_tt"; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any. Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[ ]*#[ ]*define[ ][ ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ for (key in D) D_is_set[key] = 1
+ FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+ line = \$ 0
+ split(line, arg, " ")
+ if (arg[1] == "#") {
+ defundef = arg[2]
+ mac1 = arg[3]
+ } else {
+ defundef = substr(arg[1], 2)
+ mac1 = arg[2]
+ }
+ split(mac1, mac2, "(") #)
+ macro = mac2[1]
+ prefix = substr(line, 1, index(line, defundef) - 1)
+ if (D_is_set[macro]) {
+ # Preserve the white space surrounding the "#".
+ print prefix "define", macro P[macro] D[macro]
+ next
+ } else {
+ # Replace #undef with comments. This is necessary, for example,
+ # in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ if (defundef == "undef") {
+ print "/*", prefix defundef, macro, "*/"
+ next
+ }
+ }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$ac_tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+ ac_MKDIR_P=$MKDIR_P
+ case $MKDIR_P in
+ [\\/$]* | ?:[\\/]* ) ;;
+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&2;}
+
+ rm -f "$ac_tmp/stdin"
+ case $ac_file in
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
+ if test x"$ac_file" != x-; then
+ {
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+ } >"$ac_tmp/config.h" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f "$ac_file"
+ mv "$ac_tmp/config.h" "$ac_file" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ fi
+ else
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+ || as_fn_error $? "could not create -" "$LINENO" 5
+ fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$_am_arg" : 'X\(//\)[^/]' \| \
+ X"$_am_arg" : 'X\(//\)$' \| \
+ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+ :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
+
+
+ case $ac_file$ac_mode in
+ "po-directories":C)
+ for ac_file in $CONFIG_FILES; do
+ # Support "outfile[:infile[:infile...]]"
+ case "$ac_file" in
+ *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ esac
+ # PO directories have a Makefile.in generated from Makefile.in.in.
+ case "$ac_file" in */Makefile.in)
+ # Adjust a relative srcdir.
+ ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
+ ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
+ ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+ # In autoconf-2.13 it is called $ac_given_srcdir.
+ # In autoconf-2.50 it is called $srcdir.
+ test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
+ case "$ac_given_srcdir" in
+ .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
+ /*) top_srcdir="$ac_given_srcdir" ;;
+ *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+ # Treat a directory as a PO directory if and only if it has a
+ # POTFILES.in file. This allows packages to have multiple PO
+ # directories under different names or in different locations.
+ if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
+ rm -f "$ac_dir/POTFILES"
+ test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
+ cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
+ POMAKEFILEDEPS="POTFILES.in"
+ # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
+ # on $ac_dir but don't depend on user-specified configuration
+ # parameters.
+ if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
+ # The LINGUAS file contains the set of available languages.
+ if test -n "$OBSOLETE_ALL_LINGUAS"; then
+ test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
+ fi
+ ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+ # Hide the ALL_LINGUAS assigment from automake < 1.5.
+ eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+ POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+ else
+ # The set of available languages was given in configure.in.
+ # Hide the ALL_LINGUAS assigment from automake < 1.5.
+ eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
+ fi
+ # Compute POFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
+ # Compute UPDATEPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
+ # Compute DUMMYPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
+ # Compute GMOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
+ case "$ac_given_srcdir" in
+ .) srcdirpre= ;;
+ *) srcdirpre='$(srcdir)/' ;;
+ esac
+ POFILES=
+ UPDATEPOFILES=
+ DUMMYPOFILES=
+ GMOFILES=
+ for lang in $ALL_LINGUAS; do
+ POFILES="$POFILES $srcdirpre$lang.po"
+ UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
+ DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
+ GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
+ done
+ # CATALOGS depends on both $ac_dir and the user's LINGUAS
+ # environment variable.
+ INST_LINGUAS=
+ if test -n "$ALL_LINGUAS"; then
+ for presentlang in $ALL_LINGUAS; do
+ useit=no
+ if test "%UNSET%" != "$LINGUAS"; then
+ desiredlanguages="$LINGUAS"
+ else
+ desiredlanguages="$ALL_LINGUAS"
+ fi
+ for desiredlang in $desiredlanguages; do
+ # Use the presentlang catalog if desiredlang is
+ # a. equal to presentlang, or
+ # b. a variant of presentlang (because in this case,
+ # presentlang can be used as a fallback for messages
+ # which are not translated in the desiredlang catalog).
+ case "$desiredlang" in
+ "$presentlang"*) useit=yes;;
+ esac
+ done
+ if test $useit = yes; then
+ INST_LINGUAS="$INST_LINGUAS $presentlang"
+ fi
+ done
+ fi
+ CATALOGS=
+ if test -n "$INST_LINGUAS"; then
+ for lang in $INST_LINGUAS; do
+ CATALOGS="$CATALOGS $lang.gmo"
+ done
+ fi
+ test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
+ sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
+ for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
+ if test -f "$f"; then
+ case "$f" in
+ *.orig | *.bak | *~) ;;
+ *) cat "$f" >> "$ac_dir/Makefile" ;;
+ esac
+ fi
+ done
+ fi
+ ;;
+ esac
+ done ;;
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+ # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named 'Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running 'make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir=$dirpart/$fdir; as_fn_mkdir_p
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+ ;;
+ "libtool":C)
+
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags=""
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that protects backslashes.
+ECHO=$lt_ECHO
+
+# The PATH separator for the build system.
+PATH_SEPARATOR=$lt_PATH_SEPARATOR
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# convert \$build file names to \$host format.
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+
+# convert \$build files to toolchain format.
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+
+# An object symbol dumper.
+OBJDUMP=$lt_OBJDUMP
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method = "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# How to find potential files when deplibs_check_method = "file_magic".
+file_magic_glob=$lt_file_magic_glob
+
+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
+want_nocaseglob=$lt_want_nocaseglob
+
+# DLL creation program.
+DLLTOOL=$lt_DLLTOOL
+
+# Command to associate shared and link libraries.
+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
+
+# The archiver.
+AR=$lt_AR
+
+# Flags to create an archive.
+AR_FLAGS=$lt_AR_FLAGS
+
+# How to feed a file listing to the archiver.
+archiver_list_spec=$lt_archiver_list_spec
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Whether to use a lock for old archive extraction.
+lock_old_archive_extraction=$lock_old_archive_extraction
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# Specify filename containing input files for \$NM.
+nm_file_list_spec=$lt_nm_file_list_spec
+
+# The root where to search for dependent libraries,and in which our libraries should be installed.
+lt_sysroot=$lt_sysroot
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Manifest tool.
+MANIFEST_TOOL=$lt_MANIFEST_TOOL
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Permission mode override for installation of shared libraries.
+install_override_mode=$lt_install_override_mode
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ if test x"$xsi_shell" = xyes; then
+ sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
+func_dirname ()\
+{\
+\ case ${1} in\
+\ */*) func_dirname_result="${1%/*}${2}" ;;\
+\ * ) func_dirname_result="${3}" ;;\
+\ esac\
+} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_basename ()$/,/^} # func_basename /c\
+func_basename ()\
+{\
+\ func_basename_result="${1##*/}"\
+} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
+func_dirname_and_basename ()\
+{\
+\ case ${1} in\
+\ */*) func_dirname_result="${1%/*}${2}" ;;\
+\ * ) func_dirname_result="${3}" ;;\
+\ esac\
+\ func_basename_result="${1##*/}"\
+} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
+func_stripname ()\
+{\
+\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
+\ # positional parameters, so assign one to ordinary parameter first.\
+\ func_stripname_result=${3}\
+\ func_stripname_result=${func_stripname_result#"${1}"}\
+\ func_stripname_result=${func_stripname_result%"${2}"}\
+} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
+func_split_long_opt ()\
+{\
+\ func_split_long_opt_name=${1%%=*}\
+\ func_split_long_opt_arg=${1#*=}\
+} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
+func_split_short_opt ()\
+{\
+\ func_split_short_opt_arg=${1#??}\
+\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
+} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
+func_lo2o ()\
+{\
+\ case ${1} in\
+\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
+\ *) func_lo2o_result=${1} ;;\
+\ esac\
+} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_xform ()$/,/^} # func_xform /c\
+func_xform ()\
+{\
+ func_xform_result=${1%.*}.lo\
+} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_arith ()$/,/^} # func_arith /c\
+func_arith ()\
+{\
+ func_arith_result=$(( $* ))\
+} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_len ()$/,/^} # func_len /c\
+func_len ()\
+{\
+ func_len_result=${#1}\
+} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+fi
+
+if test x"$lt_shell_append" = xyes; then
+ sed -e '/^func_append ()$/,/^} # func_append /c\
+func_append ()\
+{\
+ eval "${1}+=\\${2}"\
+} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
+func_append_quoted ()\
+{\
+\ func_quote_for_eval "${2}"\
+\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
+} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ # Save a `func_append' function call where possible by direct use of '+='
+ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+else
+ # Save a `func_append' function call even when '+=' is not available
+ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
+$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
+fi
+
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+ ;;
+
+ esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/extension/configure.ac b/extension/configure.ac
new file mode 100644
index 00000000..92ac10d8
--- /dev/null
+++ b/extension/configure.ac
@@ -0,0 +1,75 @@
+dnl
+dnl configure.ac --- autoconf input file for gawk
+dnl
+dnl Copyright (C) 2012 the Free Software Foundation, Inc.
+dnl
+dnl This file is part of GAWK, the GNU implementation of the
+dnl AWK Programming Language.
+dnl
+dnl GAWK is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 3 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl GAWK is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+dnl
+
+dnl Process this file with autoconf to produce a configure script.
+
+AC_INIT([GNU Awk Bundled Extensions], 4.0.70, bug-gawk@gnu.org, gawk-extensions)
+
+AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_AUX_DIR([build-aux])
+
+INSTALL="$ac_aux_dir/install-sh -c"
+export INSTALL
+
+AM_INIT_AUTOMAKE([-Wall -Werror])
+
+AM_GNU_GETTEXT([external])
+AM_GNU_GETTEXT_VERSION([0.18.1])
+
+AM_PROG_AR
+AC_SYS_LARGEFILE
+AC_DISABLE_STATIC
+AC_PROG_LIBTOOL
+dnl AC_PROG_INSTALL
+
+AC_SUBST([pkgextensiondir], ['${libdir}/gawk'])
+
+if test "$GCC" = yes
+then
+ CFLAGS="$CFLAGS -Wall -Wextra"
+fi
+
+AC_MSG_CHECKING([for special development options])
+if test -f $srcdir/.developing
+then
+ if test "$GCC" = yes
+ then
+ CFLAGS="$CFLAGS -Wall -fno-builtin -g3 -gdwarf-2"
+ fi
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_RESULT([no])
+fi
+
+AC_CHECK_HEADERS(dirent.h fnmatch.h time.h sys/time.h sys/select.h)
+
+AC_CHECK_FUNCS(fdopendir fnmatch gettimeofday \
+ getdtablesize nanosleep select GetSystemTimeAsFileTime)
+
+dnl checks for compiler characteristics
+AC_C_INLINE
+
+AC_CONFIG_HEADERS([config.h:configh.in])
+
+AC_CONFIG_FILES(Makefile)
+AC_OUTPUT
diff --git a/extension/dl.c b/extension/dl.c
deleted file mode 100644
index afc16af5..00000000
--- a/extension/dl.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * dl.c - Example of adding a new builtin function to gawk.
- *
- * Christos Zoulas, Thu Jun 29 17:40:41 EDT 1995
- * Arnold Robbins, update for 3.1, Wed Sep 13 09:38:56 2000
- */
-
-/*
- * Copyright (C) 1995 - 2001, 2011 the Free Software Foundation, Inc.
- *
- * This file is part of GAWK, the GNU implementation of the
- * AWK Programming Language.
- *
- * GAWK is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * GAWK is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "awk.h"
-#include <dlfcn.h>
-
-int plugin_is_GPL_compatible;
-
-static void *sdl = NULL;
-
-static NODE *
-zaxxon(int nargs)
-{
- NODE *obj;
- int i;
- int comma = 0;
-
- /*
- * Print the arguments
- */
- printf("External linkage zaxxon(");
-
- for (i = 0; i < nargs; i++) {
-
- obj = get_scalar_argument(i, TRUE);
-
- if (obj == NULL)
- break;
-
- force_string(obj);
-
- printf(comma ? ", %s" : "%s", obj->stptr);
- comma = 1;
- }
-
- printf(");\n");
-
- /*
- * Do something useful
- */
- obj = get_scalar_argument(0, FALSE);
-
- if (obj != NULL) {
- force_string(obj);
- if (strcmp(obj->stptr, "unload") == 0 && sdl) {
- /*
- * XXX: How to clean up the function?
- * I would like the ability to remove a function...
- */
- dlclose(sdl);
- sdl = NULL;
- }
- }
-
- /* Set the return value */
- return make_number((AWKNUM) 3.14);
-}
-
-NODE *
-dlload(tree, dl)
-NODE *tree;
-void *dl;
-{
- sdl = dl;
- make_builtin("zaxxon", zaxxon, 4);
- return make_number((AWKNUM) 0);
-}
diff --git a/extension/doit b/extension/doit
deleted file mode 100755
index 29dff7d8..00000000
--- a/extension/doit
+++ /dev/null
@@ -1 +0,0 @@
-../gawk -f foo.awk
diff --git a/extension/filefuncs.3am b/extension/filefuncs.3am
new file mode 100644
index 00000000..e0caba05
--- /dev/null
+++ b/extension/filefuncs.3am
@@ -0,0 +1,359 @@
+.TH FILEFUNCS 3am "Aug 08 2012" "Free Software Foundation" "GNU Awk Extension Modules"
+.SH NAME
+filefuncs \- provide some file related functionality to gawk
+.SH SYNOPSIS
+.ft CW
+@load "filefuncs"
+.sp
+result = chdir("/some/directory")
+.sp
+result = stat("/some/path", statdata)
+.sp
+flags = or(FTS_PHYSICAL, ...)
+.br
+result = fts(pathlist, flags, filedata)
+.ft R
+.SH DESCRIPTION
+The
+.I filefuncs
+extension adds several functions that provide access to
+file-related facilities.
+.SS chdir()
+The
+.B chdir()
+function is a direct hook to the
+.IR chdir (2)
+system call to change the current directory.
+It returns zero
+upon success or less than zero upon error.
+In the latter case it updates
+.BR ERRNO .
+.SS stat()
+The
+.B stat()
+function provides a hook into the
+.IR stat (2)
+system call. In fact, it uses
+.IR lstat (2).
+It returns zero
+upon success or less than zero upon error.
+In the latter case it updates
+.BR ERRNO .
+.PP
+In all cases, it clears the
+.B statdata
+array.
+When the call is successful,
+.B stat()
+fills the
+.B statdata
+array with information retrieved from the filesystem, as follows:
+.TP
+\fBstatdata["name"]\fP
+The name of the file.
+.TP
+\fBstatdata["dev"]\fP
+Corresponds to the
+.I st_dev
+field in the
+.IR "struct stat" .
+.TP
+\fBstatdata["ino"]\fP
+Corresponds to the
+.I st_ino
+field in the
+.IR "struct stat" .
+.TP
+\fBstatdata["mode"]\fP
+Corresponds to the
+.I st_mode
+field in the
+.IR "struct stat" .
+.TP
+\fBstatdata["nlink"]\fP
+Corresponds to the
+.I st_nlink
+field in the
+.IR "struct stat" .
+.TP
+\fBstatdata["uid"]\fP
+Corresponds to the
+.I st_uid
+field in the
+.IR "struct stat" .
+.TP
+\fBstatdata["gid"]\fP
+Corresponds to the
+.I st_gid
+field in the
+.IR "struct stat" .
+.TP
+\fBstatdata["size"]\fP
+Corresponds to the
+.I st_size
+field in the
+.IR "struct stat" .
+.TP
+\fBstatdata["atime"]\fP
+Corresponds to the
+.I st_atime
+field in the
+.IR "struct stat" .
+.TP
+\fBstatdata["mtime"]\fP
+Corresponds to the
+.I st_mtime
+field in the
+.IR "struct stat" .
+.TP
+\fBstatdata["ctime"]\fP
+Corresponds to the
+.I st_ctime
+field in the
+.IR "struct stat" .
+.TP
+\fBstatdata["rdev"]\fP
+Corresponds to the
+.I st_rdev
+field in the
+.IR "struct stat" .
+This element is only present for device files.
+.TP
+\fBstatdata["major"]\fP
+Corresponds to the
+.I st_major
+field in the
+.IR "struct stat" .
+This element is only present for device files.
+.TP
+\fBstatdata["minor"]\fP
+Corresponds to the
+.I st_minor
+field in the
+.IR "struct stat" .
+This element is only present for device files.
+.TP
+\fBstatdata["blksize"]\fP
+Corresponds to the
+.I st_blksize
+field in the
+.IR "struct stat" ,
+if this field is present on your system.
+(It is present on all modern systems that we know of.)
+.TP
+\fBstatdata["pmode"]\fP
+A human-readable version of the mode value, such as printed by
+.IR ls (1).
+For example, \fB"-rwxr-xr-x"\fP.
+.TP
+\fBstatdata["linkval"]\fP
+If the named file is a symbolic link, this element will exist
+and its value is the value of the symbolic link (where the
+symbolic link points to).
+.TP
+\fBstatdata["type"]\fP
+The type of the file as a string. One of
+\fB"file"\fP,
+\fB"blockdev"\fP,
+\fB"chardev"\fP,
+\fB"directory"\fP,
+\fB"socket"\fP,
+\fB"fifo"\fP,
+\fB"symlink"\fP,
+\fB"door"\fP,
+or
+\fB"unknown"\fP.
+Not all systems support all file types.
+.SS fts()
+The
+.B fts()
+function provides a hook to the
+.IR fts (3)
+set of routines for traversing file heirarchies.
+Instead of returning data about one file at a time in a stream,
+it fills in a multi-dimensional array with data about each file and
+directory encountered in the requested heirarchies.
+.PP
+The arguments are as follows:
+.TP
+.B pathlist
+An array of filenames. The element values are used; the index values are ignored.
+.TP
+.B flags
+This should be the bitwise OR of one or more of the following
+predefined constant flag values. At least one of
+.B FTS_LOGICAL
+or
+.B FTS_PHYSICAL
+must be provided; otherwise
+.B fts()
+returns an error value and sets
+.BR ERRNO .
+.RS
+.TP
+.B FTS_LOGICAL
+Do a ``logical'' file traversal, where the information returned for
+a symbolic link refers to the linked-to file, and not to the
+symbolic link itself.
+This flag is mutually exclusive with
+.BR FTS_PHYSICAL .
+.TP
+.B FTS_PHYSICAL
+Do a ``physical'' file traversal, where the information returned for
+a symbolic link refers to the symbolic link itself.
+This flag is mutually exclusive with
+.BR FTS_LOGICAL .
+.TP
+.B FTS_NOCHDIR
+As a performance optimization, the
+.IR fts (3)
+routines change directory as they traverse a file heirarchy.
+This flag disables that optimization.
+.TP
+.B FTS_COMFOLLOW
+Immediatly follow a symbolic link named in
+.BR pathlist ,
+whether or not
+.B FTS_LOGICAL
+is set.
+.TP
+.B FTS_SEEDOT
+By default, the
+.IR fts (3)
+routines do not return entries for ``.'' and ``..''.
+This option causes entries for ``..'' to also be included.
+(The AWK extension always includes an entry for ``.'', see below.)
+.TP
+.B FTS_XDEV
+During a traversal, do not cross onto a different mounted filesystem.
+.RE
+.TP
+.B filedata
+The
+.B filedata
+array is first cleared.
+Then,
+.B fts()
+creates an element in
+.B filedata
+for every element in
+.BR pathlist .
+The index is the name of the directory or file given in
+.BR pathlist .
+The element for this index is itself an array.
+There are two cases.
+.RS
+.TP
+The path is a file.
+In this case, the array contains two or three elements:
+.RS
+.TP
+\fB"path"\fP
+The full path to this file, starting from the ``root'' that was given
+in the
+.B pathlist
+array.
+.TP
+\fB"stat"\fP
+This element is itself an array, containing the same information as provided
+by the
+.B stat()
+function described earlier for its
+.B statdata
+argument.
+The element may not be present if
+.IR stat (2)
+for the file failed.
+.TP
+\fB"error"\fP
+If some kind of error was encountered, the array will also
+contain an element named \fB"error"\fP, which is a string describing the error.
+.RE
+.TP
+The path is a directory.
+In this case, the array contains one element for each entry in the directory.
+If an entry is a file, that element is as for files, just described.
+If the entry is a directory, that element is (recursively), an array describing
+the subdirectory.
+If
+.B FTS_SEEDOT
+was provided in the flags, then there will also be an element named
+\fB".."\fP. This element will be an array containing the data
+as provided by
+.BR stat() .
+.sp
+In addition, there will be an element whose index is \fB"."\fP.
+This element is an array containing the same two or three elements
+as for a file:
+\fB"path"\fP,
+\fB"stat"\fP,
+and
+\fB"error"\fP.
+.RE
+.PP
+The
+.B fts()
+function returns 0 if there were no errors. Otherwise it returns \-1.
+.SH NOTES
+The AWK
+.B fts()
+extension does not exactly mimic the interface of the
+.IR fts (3)
+routines, choosing instead to provide an interface that is based
+on associative arrays, which should be more comfortable to use from
+an AWK program. This includes the lack of a comparison function, since
+.I gawk
+already provides powerful array sorting facilities. While an
+.IR fts_read() \-like
+interface could have been provided, this felt less natural than
+simply creating a multi-dimensional array to represent the file
+heirarchy and its information.
+.SH BUGS
+There are many more file-related functions for which AWK
+interfaces would be desirable.
+.SH EXAMPLE
+See
+.B test/fts.awk
+in the
+.I gawk
+distribution for an example.
+.SH "SEE ALSO"
+.IR "GAWK: Effective AWK Programming" ,
+.IR fnmatch (3am),
+.IR fork (3am),
+.IR ordchr (3am),
+.IR readdir (3am),
+.IR readfile (3am),
+.IR revoutput (3am),
+.IR rwarray (3am),
+.IR time (3am).
+.PP
+.IR chdir (2),
+.IR fts (3),
+.IR stat (2).
+.SH AUTHOR
+Arnold Robbins,
+.BR arnold@skeeve.com .
+.SH COPYING PERMISSIONS
+Copyright \(co 2012
+Free Software Foundation, Inc.
+.PP
+Permission is granted to make and distribute verbatim copies of
+this manual page provided the copyright notice and this permission
+notice are preserved on all copies.
+.ig
+Permission is granted to process this file through troff and print the
+results, provided the printed document carries copying permission
+notice identical to this one except for the removal of this paragraph
+(this paragraph not being relevant to the printed manual page).
+..
+.PP
+Permission is granted to copy and distribute modified versions of this
+manual page under the conditions for verbatim copying, provided that
+the entire resulting derived work is distributed under the terms of a
+permission notice identical to this one.
+.PP
+Permission is granted to copy and distribute translations of this
+manual page into another language, under the above conditions for
+modified versions, except that this permission notice may be stated in
+a translation approved by the Foundation.
diff --git a/extension/filefuncs.c b/extension/filefuncs.c
index ad7828f3..391ed11a 100644
--- a/extension/filefuncs.c
+++ b/extension/filefuncs.c
@@ -4,10 +4,13 @@
*
* Arnold Robbins, update for 3.1, Mon Nov 23 12:53:39 EST 1998
* Arnold Robbins and John Haque, update for 3.1.4, applied Mon Jun 14 13:55:30 IDT 2004
+ * Arnold Robbins and Andrew Schorr, revised for new extension API, May 2012.
+ * Arnold Robbins, add fts(), August 2012
*/
/*
- * Copyright (C) 2001, 2004, 2005, 2010, 2011 the Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2004, 2005, 2010, 2011, 2012
+ * the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -27,30 +30,57 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include "awk.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <assert.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "gawkapi.h"
+
+#include "gettext.h"
+#define _(msgid) gettext(msgid)
+#define N_(msgid) msgid
+
+#include "gawkfts.h"
+#include "stack.h"
-#include <sys/sysmacros.h>
+static const gawk_api_t *api; /* for convenience macros to work */
+static awk_ext_id_t *ext_id;
+static awk_bool_t init_filefuncs(void);
+static awk_bool_t (*init_func)(void) = init_filefuncs;
+static const char *ext_version = "filefuncs extension: version 1.0";
int plugin_is_GPL_compatible;
/* do_chdir --- provide dynamically loaded chdir() builtin for gawk */
-static NODE *
-do_chdir(int nargs)
+static awk_value_t *
+do_chdir(int nargs, awk_value_t *result)
{
- NODE *newdir;
+ awk_value_t newdir;
int ret = -1;
- if (do_lint && get_curfunc_arg_count() != 1)
- lintwarn("chdir: called with incorrect number of arguments");
+ assert(result != NULL);
- newdir = get_scalar_argument(0, FALSE);
- (void) force_string(newdir);
- ret = chdir(newdir->stptr);
- if (ret < 0)
- update_ERRNO();
+ if (do_lint && nargs != 1)
+ lintwarn(ext_id, _("chdir: called with incorrect number of arguments, expecting 1"));
- return make_number((AWKNUM) ret);
+ if (get_argument(0, AWK_STRING, & newdir)) {
+ ret = chdir(newdir.str_value.str);
+ if (ret < 0)
+ update_ERRNO_int(errno);
+ }
+
+ return make_number(ret, result);
}
/* format_mode --- turn a stat mode field into something readable */
@@ -59,280 +89,636 @@ static char *
format_mode(unsigned long fmode)
{
static char outbuf[12];
- int i;
-
- strcpy(outbuf, "----------");
- /* first, get the file type */
- i = 0;
- switch (fmode & S_IFMT) {
+ static struct ftype_map {
+ unsigned int mask;
+ int charval;
+ } ftype_map[] = {
+ { S_IFREG, '-' }, /* redundant */
+ { S_IFBLK, 'b' },
+ { S_IFCHR, 'c' },
+ { S_IFDIR, 'd' },
#ifdef S_IFSOCK
- case S_IFSOCK:
- outbuf[i] = 's';
- break;
+ { S_IFSOCK, 's' },
+#endif
+#ifdef S_IFIFO
+ { S_IFIFO, 'p' },
#endif
#ifdef S_IFLNK
- case S_IFLNK:
- outbuf[i] = 'l';
- break;
+ { S_IFLNK, 'l' },
#endif
- case S_IFREG:
- outbuf[i] = '-'; /* redundant */
- break;
- case S_IFBLK:
- outbuf[i] = 'b';
- break;
- case S_IFDIR:
- outbuf[i] = 'd';
- break;
#ifdef S_IFDOOR /* Solaris weirdness */
- case S_IFDOOR:
- outbuf[i] = 'D';
- break;
+ { S_IFDOOR, 'D' },
#endif /* S_IFDOOR */
- case S_IFCHR:
- outbuf[i] = 'c';
- break;
-#ifdef S_IFIFO
- case S_IFIFO:
- outbuf[i] = 'p';
- break;
-#endif
+ };
+ static struct mode_map {
+ unsigned int mask;
+ int rep;
+ } map[] = {
+ { S_IRUSR, 'r' }, { S_IWUSR, 'w' }, { S_IXUSR, 'x' },
+ { S_IRGRP, 'r' }, { S_IWGRP, 'w' }, { S_IXGRP, 'x' },
+ { S_IROTH, 'r' }, { S_IWOTH, 'w' }, { S_IXOTH, 'x' },
+ };
+ static struct setuid_map {
+ unsigned int mask;
+ int index;
+ int small_rep;
+ int big_rep;
+ } setuid_map[] = {
+ { S_ISUID, 3, 's', 'S' }, /* setuid bit */
+ { S_ISGID, 6, 's', 'l' }, /* setgid without execute == locking */
+ { S_ISVTX, 9, 't', 'T' }, /* the so-called "sticky" bit */
+ };
+ int i, j, k;
+
+ strcpy(outbuf, "----------");
+
+ /* first, get the file type */
+ i = 0;
+ for (j = 0, k = sizeof(ftype_map)/sizeof(ftype_map[0]); j < k; j++) {
+ if ((fmode & S_IFMT) == ftype_map[j].mask) {
+ outbuf[i] = ftype_map[j].charval;
+ break;
+ }
}
- i++;
- if ((fmode & S_IRUSR) != 0)
- outbuf[i] = 'r';
- i++;
- if ((fmode & S_IWUSR) != 0)
- outbuf[i] = 'w';
- i++;
- if ((fmode & S_IXUSR) != 0)
- outbuf[i] = 'x';
- i++;
+ /* now the permissions */
+ for (j = 0, k = sizeof(map)/sizeof(map[0]); j < k; j++) {
+ i++;
+ if ((fmode & map[j].mask) != 0)
+ outbuf[i] = map[j].rep;
+ }
- if ((fmode & S_IRGRP) != 0)
- outbuf[i] = 'r';
- i++;
- if ((fmode & S_IWGRP) != 0)
- outbuf[i] = 'w';
- i++;
- if ((fmode & S_IXGRP) != 0)
- outbuf[i] = 'x';
i++;
+ outbuf[i] = '\0';
- if ((fmode & S_IROTH) != 0)
- outbuf[i] = 'r';
- i++;
- if ((fmode & S_IWOTH) != 0)
- outbuf[i] = 'w';
- i++;
- if ((fmode & S_IXOTH) != 0)
- outbuf[i] = 'x';
- i++;
+ /* tweaks for the setuid / setgid / sticky bits */
+ for (j = 0, k = sizeof(setuid_map)/sizeof(setuid_map[0]); j < k; j++) {
+ if (fmode & setuid_map[j].mask) {
+ if (outbuf[setuid_map[j].index] == 'x')
+ outbuf[setuid_map[j].index] = setuid_map[j].small_rep;
+ else
+ outbuf[setuid_map[j].index] = setuid_map[j].big_rep;
+ }
+ }
- outbuf[i] = '\0';
+ return outbuf;
+}
+
+/* read_symlink --- read a symbolic link into an allocated buffer.
+ This is based on xreadlink; the basic problem is that lstat cannot be relied
+ upon to return the proper size for a symbolic link. This happens,
+ for example, on GNU/Linux in the /proc filesystem, where the symbolic link
+ sizes are often 0. */
+
+#ifndef SIZE_MAX
+# define SIZE_MAX ((size_t) -1)
+#endif
+#ifndef SSIZE_MAX
+# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2))
+#endif
- if ((fmode & S_ISUID) != 0) {
- if (outbuf[3] == 'x')
- outbuf[3] = 's';
+#define MAXSIZE (SIZE_MAX < SSIZE_MAX ? SIZE_MAX : SSIZE_MAX)
+
+static char *
+read_symlink(const char *fname, size_t bufsize, ssize_t *linksize)
+{
+ if (bufsize)
+ bufsize += 2;
+ else
+ bufsize = BUFSIZ * 2;
+
+ /* Make sure that bufsize >= 2 and within range */
+ if (bufsize > MAXSIZE || bufsize < 2)
+ bufsize = MAXSIZE;
+
+ while (1) {
+ char *buf;
+
+ emalloc(buf, char *, bufsize, "read_symlink");
+ if ((*linksize = readlink(fname, buf, bufsize)) < 0) {
+ /* On AIX 5L v5.3 and HP-UX 11i v2 04/09, readlink
+ returns -1 with errno == ERANGE if the buffer is
+ too small. */
+ if (errno != ERANGE) {
+ free(buf);
+ return NULL;
+ }
+ }
+ /* N.B. This test is safe because bufsize must be >= 2 */
+ else if ((size_t)*linksize <= bufsize-2) {
+ buf[*linksize] = '\0';
+ return buf;
+ }
+ free(buf);
+ if (bufsize <= MAXSIZE/2)
+ bufsize *= 2;
+ else if (bufsize < MAXSIZE)
+ bufsize = MAXSIZE;
else
- outbuf[3] = 'S';
+ return NULL;
}
+ return NULL;
+}
- /* setgid without execute == locking */
- if ((fmode & S_ISGID) != 0) {
- if (outbuf[6] == 'x')
- outbuf[6] = 's';
- else
- outbuf[6] = 'l';
+/* array_set --- set an array element */
+
+static void
+array_set(awk_array_t array, const char *sub, awk_value_t *value)
+{
+ awk_value_t index;
+
+ set_array_element(array,
+ make_const_string(sub, strlen(sub), & index),
+ value);
+
+}
+
+/* array_set_numeric --- set an array element with a number */
+
+static void
+array_set_numeric(awk_array_t array, const char *sub, double num)
+{
+ awk_value_t tmp;
+
+ array_set(array, sub, make_number(num, & tmp));
+}
+
+/* fill_stat_array --- do the work to fill an array with stat info */
+
+static int
+fill_stat_array(const char *name, awk_array_t array, struct stat *sbuf)
+{
+ char *pmode; /* printable mode */
+ const char *type = "unknown";
+ awk_value_t tmp;
+ static struct ftype_map {
+ unsigned int mask;
+ const char *type;
+ } ftype_map[] = {
+ { S_IFREG, "file" },
+ { S_IFBLK, "blockdev" },
+ { S_IFCHR, "chardev" },
+ { S_IFDIR, "directory" },
+#ifdef S_IFSOCK
+ { S_IFSOCK, "socket" },
+#endif
+#ifdef S_IFIFO
+ { S_IFIFO, "fifo" },
+#endif
+#ifdef S_IFLNK
+ { S_IFLNK, "symlink" },
+#endif
+#ifdef S_IFDOOR /* Solaris weirdness */
+ { S_IFDOOR, "door" },
+#endif /* S_IFDOOR */
+ };
+ int j, k;
+
+ /* empty out the array */
+ clear_array(array);
+
+ /* fill in the array */
+ array_set(array, "name", make_const_string(name, strlen(name), & tmp));
+ array_set_numeric(array, "dev", sbuf->st_dev);
+ array_set_numeric(array, "ino", sbuf->st_ino);
+ array_set_numeric(array, "mode", sbuf->st_mode);
+ array_set_numeric(array, "nlink", sbuf->st_nlink);
+ array_set_numeric(array, "uid", sbuf->st_uid);
+ array_set_numeric(array, "gid", sbuf->st_gid);
+ array_set_numeric(array, "size", sbuf->st_size);
+ array_set_numeric(array, "blocks", sbuf->st_blocks);
+ array_set_numeric(array, "atime", sbuf->st_atime);
+ array_set_numeric(array, "mtime", sbuf->st_mtime);
+ array_set_numeric(array, "ctime", sbuf->st_ctime);
+
+ /* for block and character devices, add rdev, major and minor numbers */
+ if (S_ISBLK(sbuf->st_mode) || S_ISCHR(sbuf->st_mode)) {
+ array_set_numeric(array, "rdev", sbuf->st_rdev);
+ array_set_numeric(array, "major", major(sbuf->st_rdev));
+ array_set_numeric(array, "minor", minor(sbuf->st_rdev));
}
- if ((fmode & S_ISVTX) != 0) {
- if (outbuf[9] == 'x')
- outbuf[9] = 't';
+#ifdef HAVE_ST_BLKSIZE
+ array_set_numeric(array, "blksize", sbuf->st_blksize);
+#endif /* HAVE_ST_BLKSIZE */
+
+ pmode = format_mode(sbuf->st_mode);
+ array_set(array, "pmode", make_const_string(pmode, strlen(pmode), & tmp));
+
+ /* for symbolic links, add a linkval field */
+ if (S_ISLNK(sbuf->st_mode)) {
+ char *buf;
+ ssize_t linksize;
+
+ if ((buf = read_symlink(name, sbuf->st_size,
+ & linksize)) != NULL)
+ array_set(array, "linkval", make_malloced_string(buf, linksize, & tmp));
else
- outbuf[9] = 'T';
+ warning(ext_id, _("stat: unable to read symbolic link `%s'"), name);
}
- return outbuf;
+ /* add a type field */
+ type = "unknown"; /* shouldn't happen */
+ for (j = 0, k = sizeof(ftype_map)/sizeof(ftype_map[0]); j < k; j++) {
+ if ((sbuf->st_mode & S_IFMT) == ftype_map[j].mask) {
+ type = ftype_map[j].type;
+ break;
+ }
+ }
+
+ array_set(array, "type", make_const_string(type, strlen(type), &tmp));
+
+ return 0;
}
/* do_stat --- provide a stat() function for gawk */
-static NODE *
-do_stat(int nargs)
+static awk_value_t *
+do_stat(int nargs, awk_value_t *result)
{
- NODE *file, *array, *tmp;
- struct stat sbuf;
+ awk_value_t file_param, array_param;
+ char *name;
+ awk_array_t array;
int ret;
- NODE **aptr;
- char *pmode; /* printable mode */
- char *type = "unknown";
+ struct stat sbuf;
+
+ assert(result != NULL);
- if (do_lint && get_curfunc_arg_count() > 2)
- lintwarn("stat: called with too many arguments");
+ if (do_lint && nargs != 2) {
+ lintwarn(ext_id, _("stat: called with wrong number of arguments"));
+ return make_number(-1, result);
+ }
/* file is first arg, array to hold results is second */
- file = get_scalar_argument(0, FALSE);
- array = get_array_argument(1, FALSE);
+ if ( ! get_argument(0, AWK_STRING, & file_param)
+ || ! get_argument(1, AWK_ARRAY, & array_param)) {
+ warning(ext_id, _("stat: bad parameters"));
+ return make_number(-1, result);
+ }
- /* empty out the array */
- assoc_clear(array);
+ name = file_param.str_value.str;
+ array = array_param.array_cookie;
+
+ /* always empty out the array */
+ clear_array(array);
/* lstat the file, if error, set ERRNO and return */
- (void) force_string(file);
- ret = lstat(file->stptr, & sbuf);
+ ret = lstat(name, & sbuf);
if (ret < 0) {
- update_ERRNO();
- return make_number((AWKNUM) ret);
+ update_ERRNO_int(errno);
+ return make_number(ret, result);
}
- /* fill in the array */
- aptr = assoc_lookup(array, tmp = make_string("name", 4), FALSE);
- *aptr = dupnode(file);
- unref(tmp);
+ ret = fill_stat_array(name, array, & sbuf);
- aptr = assoc_lookup(array, tmp = make_string("dev", 3), FALSE);
- *aptr = make_number((AWKNUM) sbuf.st_dev);
- unref(tmp);
+ return make_number(ret, result);
+}
- aptr = assoc_lookup(array, tmp = make_string("ino", 3), FALSE);
- *aptr = make_number((AWKNUM) sbuf.st_ino);
- unref(tmp);
+/* init_filefuncs --- initialization routine */
- aptr = assoc_lookup(array, tmp = make_string("mode", 4), FALSE);
- *aptr = make_number((AWKNUM) sbuf.st_mode);
- unref(tmp);
+static awk_bool_t
+init_filefuncs(void)
+{
+ int errors = 0;
+ int i;
+ awk_value_t value;
+
+ /* at least right now, only FTS needs initializing */
+ static struct flagtab {
+ const char *name;
+ int value;
+ } opentab[] = {
+#define ENTRY(x) { #x, x }
+ ENTRY(FTS_COMFOLLOW),
+ ENTRY(FTS_LOGICAL),
+ ENTRY(FTS_NOCHDIR),
+ ENTRY(FTS_PHYSICAL),
+ ENTRY(FTS_SEEDOT),
+ ENTRY(FTS_XDEV),
+ { NULL, 0 }
+ };
+
+ for (i = 0; opentab[i].name != NULL; i++) {
+ (void) make_number(opentab[i].value, & value);
+ if (! sym_constant(opentab[i].name, & value)) {
+ warning(ext_id, _("fts init: could not create constant %s"),
+ opentab[i].name);
+ errors++;
+ }
+ }
+ return errors == 0;
+}
- aptr = assoc_lookup(array, tmp = make_string("nlink", 5), FALSE);
- *aptr = make_number((AWKNUM) sbuf.st_nlink);
- unref(tmp);
+static int fts_errors = 0;
- aptr = assoc_lookup(array, tmp = make_string("uid", 3), FALSE);
- *aptr = make_number((AWKNUM) sbuf.st_uid);
- unref(tmp);
+/* fill_stat_element --- fill in stat element of array */
- aptr = assoc_lookup(array, tmp = make_string("gid", 3), FALSE);
- *aptr = make_number((AWKNUM) sbuf.st_gid);
- unref(tmp);
+static void
+fill_stat_element(awk_array_t element_array, const char *name, struct stat *sbuf)
+{
+ awk_value_t index, value;
+ awk_array_t stat_array;
+
+ stat_array = create_array();
+ if (stat_array == NULL) {
+ warning(ext_id, _("fill_stat_element: could not create array"));
+ fts_errors++;
+ return;
+ }
+ fill_stat_array(name, stat_array, sbuf);
+ (void) make_const_string("stat", 4, & index);
+ value.val_type = AWK_ARRAY;
+ value.array_cookie = stat_array;
+ if (! set_array_element(element_array, & index, & value)) {
+ warning(ext_id, _("fill_stat_element: could not set element"));
+ fts_errors++;
+ }
+}
- aptr = assoc_lookup(array, tmp = make_string("size", 4), FALSE);
- *aptr = make_number((AWKNUM) sbuf.st_size);
- unref(tmp);
+/* fill_path_element --- fill in path element of array */
- aptr = assoc_lookup(array, tmp = make_string("blocks", 6), FALSE);
- *aptr = make_number((AWKNUM) sbuf.st_blocks);
- unref(tmp);
+static void
+fill_path_element(awk_array_t element_array, const char *path)
+{
+ awk_value_t index, value;
- aptr = assoc_lookup(array, tmp = make_string("atime", 5), FALSE);
- *aptr = make_number((AWKNUM) sbuf.st_atime);
- unref(tmp);
+ (void) make_const_string("path", 4, & index);
+ (void) make_const_string(path, strlen(path), & value);
+ if (! set_array_element(element_array, & index, & value)) {
+ warning(ext_id, _("fill_path_element: could not set element"));
+ fts_errors++;
+ }
+}
- aptr = assoc_lookup(array, tmp = make_string("mtime", 5), FALSE);
- *aptr = make_number((AWKNUM) sbuf.st_mtime);
- unref(tmp);
+/* fill_error_element --- fill in error element of array */
- aptr = assoc_lookup(array, tmp = make_string("ctime", 5), FALSE);
- *aptr = make_number((AWKNUM) sbuf.st_ctime);
- unref(tmp);
+static void
+fill_error_element(awk_array_t element_array, const int errcode)
+{
+ awk_value_t index, value;
+ const char *err = strerror(errcode);
+
+ (void) make_const_string("error", 5, & index);
+ (void) make_const_string(err, strlen(err), & value);
+ if (! set_array_element(element_array, & index, & value)) {
+ warning(ext_id, _("fill_error_element: could not set element"));
+ fts_errors++;
+ }
+}
- /* for block and character devices, add rdev, major and minor numbers */
- if (S_ISBLK(sbuf.st_mode) || S_ISCHR(sbuf.st_mode)) {
- aptr = assoc_lookup(array, tmp = make_string("rdev", 4), FALSE);
- *aptr = make_number((AWKNUM) sbuf.st_rdev);
- unref(tmp);
-
- aptr = assoc_lookup(array, tmp = make_string("major", 5), FALSE);
- *aptr = make_number((AWKNUM) major(sbuf.st_rdev));
- unref(tmp);
-
- aptr = assoc_lookup(array, tmp = make_string("minor", 5), FALSE);
- *aptr = make_number((AWKNUM) minor(sbuf.st_rdev));
- unref(tmp);
+/* fill_default_elements --- fill in stat and path elements */
+
+static void
+fill_default_elements(awk_array_t element_array, const FTSENT *const fentry, int bad_ret)
+{
+ /* full path */
+ fill_path_element(element_array, fentry->fts_path);
+
+ /* stat info */
+ if (! bad_ret) {
+ fill_stat_element(element_array,
+ fentry->fts_name,
+ fentry->fts_statp);
}
-#ifdef HAVE_ST_BLKSIZE
- aptr = assoc_lookup(array, tmp = make_string("blksize", 7), FALSE);
- *aptr = make_number((AWKNUM) sbuf.st_blksize);
- unref(tmp);
-#endif /* HAVE_ST_BLKSIZE */
+ /* error info */
+ if (bad_ret || fentry->fts_errno != 0) {
+ fill_error_element(element_array, fentry->fts_errno);
+ }
+}
- aptr = assoc_lookup(array, tmp = make_string("pmode", 5), FALSE);
- pmode = format_mode(sbuf.st_mode);
- *aptr = make_string(pmode, strlen(pmode));
- unref(tmp);
+/* process --- process the heirarchy */
- /* for symbolic links, add a linkval field */
- if (S_ISLNK(sbuf.st_mode)) {
- char *buf;
- int linksize;
+static void
+process(FTS *heirarchy, awk_array_t destarray, int seedot)
+{
+ FTSENT *fentry;
+ awk_value_t index, value;
+ awk_array_t element_array, newdir_array, dot_array;
+ int bad_ret = 0;
+
+ /* path is full path, pathlen is length thereof */
+ /* name is name in directory, namelen is length thereof */
+ while ((fentry = fts_read(heirarchy)) != NULL) {
+ bad_ret = 0;
+
+ switch (fentry->fts_info) {
+ case FTS_D:
+ /* directory */
+ /* create array to hold entries */
+ newdir_array = create_array();
+ if (newdir_array == NULL) {
+ warning(ext_id, _("fts-process: could not create array"));
+ fts_errors++;
+ break;
+ }
+
+ /* store new directory in its parent directory */
+ (void) make_const_string(fentry->fts_name, fentry->fts_namelen, & index);
+ value.val_type = AWK_ARRAY;
+ value.array_cookie = newdir_array;
+ if (! set_array_element(destarray, & index, & value)) {
+ warning(ext_id, _("fts-process: could not set element"));
+ fts_errors++;
+ break;
+ }
+ newdir_array = value.array_cookie;
+
+ /* push current directory */
+ stack_push(destarray);
+
+ /* new directory becomes current */
+ destarray = newdir_array;
+ break;
+
+ case FTS_DNR:
+ case FTS_DC:
+ case FTS_ERR:
+ case FTS_NS:
+ /* error */
+ bad_ret = 1;
+ /* fall through */
+
+ case FTS_NSOK:
+ case FTS_SL:
+ case FTS_SLNONE:
+ case FTS_F:
+ case FTS_DOT:
+ /* if see dot, skip "." */
+ if (seedot && strcmp(fentry->fts_name, ".") == 0)
+ break;
- emalloc(buf, char *, sbuf.st_size + 2, "do_stat");
- if (((linksize = readlink(file->stptr, buf,
- sbuf.st_size + 2)) >= 0) &&
- (linksize <= sbuf.st_size)) {
/*
- * set the linkval field only if we are able to
- * retrieve the entire link value successfully.
+ * File case.
+ * destarray is the directory we're reading.
+ * step 1: create new empty array
*/
- buf[linksize] = '\0';
-
- aptr = assoc_lookup(array, tmp = make_string("linkval", 7), FALSE);
- *aptr = make_str_node(buf, linksize, ALREADY_MALLOCED);
- unref(tmp);
+ element_array = create_array();
+ if (element_array == NULL) {
+ warning(ext_id, _("fts-process: could not create array"));
+ fts_errors++;
+ break;
+ }
+
+ /* step 2: add element array to parent array */
+ (void) make_const_string(fentry->fts_name, fentry->fts_namelen, & index);
+ value.val_type = AWK_ARRAY;
+ value.array_cookie = element_array;
+ if (! set_array_element(destarray, & index, & value)) {
+ warning(ext_id, _("fts-process: could not set element"));
+ fts_errors++;
+ break;
+ }
+
+ /* step 3: fill in path, stat, error elements */
+ fill_default_elements(element_array, fentry, bad_ret);
+ break;
+
+ case FTS_DP:
+ /* create "." subarray */
+ dot_array = create_array();
+
+ /* add it to parent */
+ (void) make_const_string(".", 1, & index);
+ value.val_type = AWK_ARRAY;
+ value.array_cookie = dot_array;
+ if (! set_array_element(destarray, & index, & value)) {
+ warning(ext_id, _("fts-process: could not set element"));
+ fts_errors++;
+ break;
+ }
+
+ /* fill it in with path, stat, error elements */
+ fill_default_elements(dot_array, fentry, bad_ret);
+
+ /* now pop the parent directory off the stack */
+ if (! stack_empty()) {
+ /* pop stack */
+ destarray = stack_pop();
+ }
+
+ break;
+
+ case FTS_DEFAULT:
+ /* nothing to do */
+ break;
}
}
+}
- /* add a type field */
- switch (sbuf.st_mode & S_IFMT) {
-#ifdef S_IFSOCK
- case S_IFSOCK:
- type = "socket";
- break;
-#endif
-#ifdef S_IFLNK
- case S_IFLNK:
- type = "symlink";
- break;
-#endif
- case S_IFREG:
- type = "file";
- break;
- case S_IFBLK:
- type = "blockdev";
- break;
- case S_IFDIR:
- type = "directory";
- break;
-#ifdef S_IFDOOR
- case S_IFDOOR:
- type = "door";
- break;
-#endif
- case S_IFCHR:
- type = "chardev";
- break;
-#ifdef S_IFIFO
- case S_IFIFO:
- type = "fifo";
- break;
-#endif
+/* do_fts --- walk a heirarchy and fill in an array */
+
+/*
+ * Usage from awk:
+ * flags = or(FTS_PHYSICAL, ...)
+ * result = fts(pathlist, flags, filedata)
+ */
+
+static awk_value_t *
+do_fts(int nargs, awk_value_t *result)
+{
+ awk_value_t pathlist, flagval, dest;
+ awk_flat_array_t *path_array = NULL;
+ char **pathvector = NULL;
+ FTS *heirarchy;
+ int flags;
+ size_t i, count;
+ int ret = -1;
+ static const int mask = (
+ FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOCHDIR | FTS_PHYSICAL
+ | FTS_SEEDOT | FTS_XDEV);
+
+ assert(result != NULL);
+ fts_errors = 0; /* ensure a fresh start */
+
+ if (do_lint && nargs != 3)
+ lintwarn(ext_id, _("fts: called with incorrect number of arguments, expecting 3"));
+
+ if (! get_argument(0, AWK_ARRAY, & pathlist)) {
+ warning(ext_id, _("fts: bad first parameter"));
+ update_ERRNO_int(EINVAL);
+ goto out;
}
- aptr = assoc_lookup(array, tmp = make_string("type", 4), FALSE);
- *aptr = make_string(type, strlen(type));
- unref(tmp);
+ if (! get_argument(1, AWK_NUMBER, & flagval)) {
+ warning(ext_id, _("fts: bad second parameter"));
+ update_ERRNO_int(EINVAL);
+ goto out;
+ }
- return make_number((AWKNUM) ret);
-}
+ if (! get_argument(2, AWK_ARRAY, & dest)) {
+ warning(ext_id, _("fts: bad third parameter"));
+ update_ERRNO_int(EINVAL);
+ goto out;
+ }
-/* dlload --- load new builtins in this library */
+ /* flatten pathlist */
+ if (! flatten_array(pathlist.array_cookie, & path_array)) {
+ warning(ext_id, _("fts: could not flatten array\n"));
+ goto out;
+ }
-NODE *
-dlload(NODE *tree, void *dl)
-{
- make_builtin("chdir", do_chdir, 1);
- make_builtin("stat", do_stat, 2);
+ /* check the flags first, before the array flattening */
+
+ /* get flags */
+ flags = flagval.num_value;
+
+ /* enforce physical or logical but not both, and not no_stat */
+ if ((flags & (FTS_PHYSICAL|FTS_LOGICAL)) == 0
+ || (flags & (FTS_PHYSICAL|FTS_LOGICAL)) == (FTS_PHYSICAL|FTS_LOGICAL)) {
+ update_ERRNO_int(EINVAL);
+ goto out;
+ }
+ if ((flags & FTS_NOSTAT) != 0) {
+ flags &= ~FTS_NOSTAT;
+ if (do_lint)
+ lintwarn(ext_id, _("fts: ignoring sneaky FTS_NOSTAT flag. nyah, nyah, nyah."));
+ }
+ flags &= mask; /* turn off anything else */
+
+ /* make pathvector */
+ count = path_array->count + 1;
+ emalloc(pathvector, char **, count * sizeof(char *), "do_fts");
+ memset(pathvector, 0, count * sizeof(char *));
+
+ /* fill it in */
+ count--; /* ignore final NULL at end of vector */
+ for (i = 0; i < count; i++)
+ pathvector[i] = path_array->elements[i].value.str_value.str;
- return make_number((AWKNUM) 0);
+
+ /* clear dest array */
+ if (! clear_array(dest.array_cookie)) {
+ warning(ext_id, _("fts: clear_array() failed\n"));
+ goto out;
+ }
+
+ /* let's do it! */
+ if ((heirarchy = fts_open(pathvector, flags, NULL)) != NULL) {
+ process(heirarchy, dest.array_cookie, (flags & FTS_SEEDOT) != 0);
+ fts_close(heirarchy);
+
+ if (fts_errors == 0)
+ ret = 0;
+ } else
+ update_ERRNO_int(errno);
+
+out:
+ if (pathvector != NULL)
+ free(pathvector);
+ if (path_array != NULL)
+ (void) release_flattened_array(pathlist.array_cookie, path_array);
+
+ return make_number(ret, result);
}
+
+static awk_ext_func_t func_table[] = {
+ { "chdir", do_chdir, 1 },
+ { "stat", do_stat, 2 },
+ { "fts", do_fts, 3 },
+};
+
+
+/* define the dl_load function using the boilerplate macro */
+
+dl_load_func(func_table, filefuncs, "")
diff --git a/extension/fnmatch.3am b/extension/fnmatch.3am
new file mode 100644
index 00000000..c84e9ae1
--- /dev/null
+++ b/extension/fnmatch.3am
@@ -0,0 +1,120 @@
+.TH FNMATCH 3am "Aug 08 2012" "Free Software Foundation" "GNU Awk Extension Modules"
+.SH NAME
+fnmatch \- compare a string against a filename wildcard
+.SH SYNOPSIS
+.ft CW
+@load "fnmatch"
+.sp
+result = fnmatch(pattern, string, flags)
+.ft R
+.SH DESCRIPTION
+The
+.I fnmatch
+extension provides an AWK interface to the
+.IR fnmatch (3)
+routine. It adds a single function named
+.BR fnmatch() ,
+one constant
+.RB ( FNM_NOMATCH ),
+and an array of flag values named
+.BR FNM .
+.PP
+The first argument is the filename wildcard to match, the second
+is the filename string, and the third is either zero,
+or the bitwise OR of one or more of the flags in the
+.B FNM
+array.
+.PP
+The return value is zero on success,
+.B FNM_NOMATCH
+if the string did not match the pattern, or
+a different non-zero value if an error occurred.
+.PP
+The flags are follows:
+.TP
+\fBFNM["CASEFOLD"]\fP
+Corresponds to the
+.B FNM_CASEFOLD
+flag as defined in
+.IR fnmatch (3).
+.TP
+\fBFNM["FILE_NAME"]\fP
+Corresponds to the
+.B FNM_FILE_NAME
+flag as defined in
+.IR fnmatch (3).
+.TP
+\fBFNM["LEADING_DIR"]\fP
+Corresponds to the
+.B FNM_LEADING_DIR
+flag as defined in
+.IR fnmatch (3).
+.TP
+\fBFNM["NOESCAPE"]\fP
+Corresponds to the
+.B FNM_NOESCAPE
+flag as defined in
+.IR fnmatch (3).
+.TP
+\fBFNM["PATHNAME"]\fP
+Corresponds to the
+.B FNM_PATHNAME
+flag as defined in
+.IR fnmatch (3).
+.TP
+\fBFNM["PERIOD"]\fP
+Corresponds to the
+.B FNM_PERIOD
+flag as defined in
+.IR fnmatch (3).
+.PP
+... .SH NOTES
+... .SH BUGS
+.SH EXAMPLE
+.ft CW
+.nf
+@load "fnmatch"
+\&...
+flags = or(FNM["PERIOD"], FNM["NOESCAPE"])
+if (fnmatch("*.a", "foo.c", flags) == FNM_NOMATCH)
+ print "no match"
+.fi
+.ft R
+.SH "SEE ALSO"
+.IR "GAWK: Effective AWK Programming" ,
+.IR filefuncs (3am),
+.IR fork (3am),
+.IR ordchr (3am),
+.IR readdir (3am),
+.IR readfile (3am),
+.IR revoutput (3am),
+.IR rwarray (3am),
+.IR time (3am).
+.PP
+.IR fnmatch (3).
+.SH AUTHOR
+Arnold Robbins,
+.BR arnold@skeeve.com .
+.SH COPYING PERMISSIONS
+Copyright \(co 2012
+Free Software Foundation, Inc.
+.PP
+Permission is granted to make and distribute verbatim copies of
+this manual page provided the copyright notice and this permission
+notice are preserved on all copies.
+.ig
+Permission is granted to process this file through troff and print the
+results, provided the printed document carries copying permission
+notice identical to this one except for the removal of this paragraph
+(this paragraph not being relevant to the printed manual page).
+..
+.PP
+Permission is granted to copy and distribute modified versions of this
+manual page under the conditions for verbatim copying, provided that
+the entire resulting derived work is distributed under the terms of a
+permission notice identical to this one.
+.PP
+Permission is granted to copy and distribute translations of this
+manual page into another language, under the above conditions for
+modified versions, except that this permission notice may be stated in
+a translation approved by the Foundation.
diff --git a/extension/fnmatch.c b/extension/fnmatch.c
new file mode 100644
index 00000000..727c9daf
--- /dev/null
+++ b/extension/fnmatch.c
@@ -0,0 +1,186 @@
+/*
+ * fnmatch.c - Provide an interface to fnmatch(3) routine
+ *
+ * Arnold Robbins
+ * arnold@skeeve.com
+ * Written 7/2012
+ */
+
+/*
+ * Copyright (C) 2012 the Free Software Foundation, Inc.
+ *
+ * This file is part of GAWK, the GNU implementation of the
+ * AWK Programming Language.
+ *
+ * GAWK is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GAWK is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "gawkapi.h"
+
+#include "gettext.h"
+#define _(msgid) gettext(msgid)
+#define N_(msgid) msgid
+
+#ifdef HAVE_FNMATCH_H
+#define _GNU_SOURCE 1 /* use GNU extensions if they're there */
+#include <fnmatch.h>
+#endif
+
+/* Provide GNU extensions as no-ops if not defined */
+#ifndef FNM_CASEFOLD
+#define FNM_CASEFOLD 0
+#endif
+#ifndef FNM_LEADING_DIR
+#define FNM_LEADING_DIR 0
+#endif
+#ifndef FNM_FILE_NAME
+#define FNM_FILE_NAME 0
+#endif
+
+static const gawk_api_t *api; /* for convenience macros to work */
+static awk_ext_id_t *ext_id;
+static const char *ext_version = "fnmatch extension: version 1.0";
+
+static awk_bool_t init_fnmatch(void);
+static awk_bool_t (*init_func)(void) = init_fnmatch;
+
+int plugin_is_GPL_compatible;
+
+
+/* do_fnmatch --- implement the fnmatch interface */
+
+static awk_value_t *
+do_fnmatch(int nargs, awk_value_t *result)
+{
+#ifdef HAVE_FNMATCH_H
+ static int flags_mask =
+ FNM_CASEFOLD | FNM_FILE_NAME |
+ FNM_LEADING_DIR | FNM_NOESCAPE |
+ FNM_PATHNAME | FNM_PERIOD ;
+#endif
+ awk_value_t pattern, string, flags;
+ int int_flags, retval;
+
+ make_number(-1.0, result); /* default return */
+#ifdef HAVE_FNMATCH
+ if (nargs < 3) {
+ warning(ext_id, _("fnmatch: called with less than three arguments"));
+ goto out;
+ } else if (do_lint && nargs > 3)
+ lintwarn(ext_id, _("fnmatch: called with more than three arguments"));
+
+ if (! get_argument(0, AWK_STRING, & pattern)) {
+ warning(ext_id, _("fnmatch: could not get first argument"));
+ goto out;
+ }
+
+ if (! get_argument(1, AWK_STRING, & string)) {
+ warning(ext_id, _("fnmatch: could not get second argument"));
+ goto out;
+ }
+
+ if (! get_argument(2, AWK_NUMBER, & flags)) {
+ warning(ext_id, _("fnmatch: could not get third argument"));
+ goto out;
+ }
+
+ int_flags = flags.num_value;
+ int_flags &= flags_mask;
+
+ retval = fnmatch(pattern.str_value.str,
+ string.str_value.str, int_flags);
+ make_number((double) retval, result);
+
+out:
+#else
+ fatal(ext_id, _("fnmatch is not implemented on this system\n"));
+#endif
+ return result;
+}
+
+#define ENTRY(x) { #x, FNM_##x }
+
+static struct fnmflags {
+ const char *name;
+ int value;
+} flagtable[] = {
+ ENTRY(CASEFOLD),
+ ENTRY(FILE_NAME),
+ ENTRY(LEADING_DIR),
+ ENTRY(NOESCAPE),
+ ENTRY(PATHNAME),
+ ENTRY(PERIOD),
+ { NULL, 0 }
+};
+
+/* init_fnmatch --- load array with flags */
+
+static awk_bool_t
+init_fnmatch(void)
+{
+ int errors = 0;
+#ifdef HAVE_FNMATCH
+ awk_value_t index, value, the_array;
+ awk_array_t new_array;
+ int i;
+
+ if (! sym_constant("FNM_NOMATCH", make_number(FNM_NOMATCH, & value))) {
+ warning(ext_id, _("fnmatch init: could not add FNM_NOMATCH variable"));
+ errors++;
+ }
+
+ new_array = create_array();
+ for (i = 0; flagtable[i].name != NULL; i++) {
+ (void) make_const_string(flagtable[i].name,
+ strlen(flagtable[i].name), & index);
+ (void) make_number(flagtable[i].value, & value);
+ if (! set_array_element(new_array, & index, & value)) {
+ warning(ext_id, _("fnmatch init: could not set array element %s"),
+ flagtable[i].name);
+ errors++;
+ }
+ }
+
+ the_array.val_type = AWK_ARRAY;
+ the_array.array_cookie = new_array;
+
+ if (! sym_update("FNM", & the_array)) {
+ warning(ext_id, _("fnmatch init: could not install FNM array"));
+ errors++;
+ }
+
+#endif
+ return errors == 0;
+}
+
+static awk_ext_func_t func_table[] = {
+ { "fnmatch", do_fnmatch, 3 },
+};
+
+/* define the dl_load function using the boilerplate macro */
+
+dl_load_func(func_table, fnmatch, "")
diff --git a/extension/foo.awk b/extension/foo.awk
deleted file mode 100644
index 00a89e5b..00000000
--- a/extension/foo.awk
+++ /dev/null
@@ -1,9 +0,0 @@
-BEGIN {
- extension("./dl.so","dlload")
- zaxxon("hi there", "this is", "a test", "of argument passing")
- zaxxon(1)
- zaxxon(1,2)
- z = zaxxon(1,2,3,4)
- z = zaxxon(1,zaxxon(zaxxon("foo")),3,4)
- print z
-}
diff --git a/extension/fork.3am b/extension/fork.3am
new file mode 100644
index 00000000..9d89aa56
--- /dev/null
+++ b/extension/fork.3am
@@ -0,0 +1,97 @@
+.TH FORK 3am "Aug 08 2012" "Free Software Foundation" "GNU Awk Extension Modules"
+.SH NAME
+fork, wait, waitpid \- basic process management
+.SH SYNOPSIS
+.ft CW
+@load "fork"
+.sp
+pid = fork()
+.sp
+ret = waitpid(pid)
+.sp
+ret = wait();
+.ft R
+.SH DESCRIPTION
+The
+.I fork
+extension adds three functions, as follows.
+.TP
+.B fork()
+This function creates a new process. The return value is the zero
+in the child and the process-id number of the child in the parent,
+or \-1 upon error. In the latter case,
+.B ERRNO
+indicates the problem.
+In the child, \fBPROCINFO["pid"]\fP and \fBPROCINFO["ppid"]\fP
+are updated to reflect the correct values.
+.TP
+.B waitpid()
+This function takes a numeric argument, which is the process-id to
+wait for. The return value is that of the
+.IR waitpid (2)
+system call.
+.TP
+.B wait()
+This function waits for the first child to die.
+The return value is that of the
+.IR wait (2)
+system call.
+... .SH NOTES
+.SH BUGS
+There is no corresponding
+.B exec()
+function.
+.PP
+The interfaces could be enhanced to provide more facilities,
+including pulling out the various bits of the return status.
+.SH EXAMPLE
+.ft CW
+.nf
+@load "fork"
+\&...
+if ((pid = fork()) == 0)
+ print "hello from the child"
+else
+ print "hello from the parent"
+.fi
+.ft R
+.SH "SEE ALSO"
+.IR "GAWK: Effective AWK Programming" ,
+.IR filefuncs (3am),
+.IR fnmatch (3am),
+.IR ordchr (3am),
+.IR readdir (3am),
+.IR readfile (3am),
+.IR revoutput (3am),
+.IR rwarray (3am),
+.IR time (3am).
+.PP
+.IR fork (2),
+.IR wait (2),
+.IR waitpid (2).
+.SH AUTHOR
+Arnold Robbins,
+.BR arnold@skeeve.com .
+.SH COPYING PERMISSIONS
+Copyright \(co 2012
+Free Software Foundation, Inc.
+.PP
+Permission is granted to make and distribute verbatim copies of
+this manual page provided the copyright notice and this permission
+notice are preserved on all copies.
+.ig
+Permission is granted to process this file through troff and print the
+results, provided the printed document carries copying permission
+notice identical to this one except for the removal of this paragraph
+(this paragraph not being relevant to the printed manual page).
+..
+.PP
+Permission is granted to copy and distribute modified versions of this
+manual page under the conditions for verbatim copying, provided that
+the entire resulting derived work is distributed under the terms of a
+permission notice identical to this one.
+.PP
+Permission is granted to copy and distribute translations of this
+manual page into another language, under the above conditions for
+modified versions, except that this permission notice may be stated in
+a translation approved by the Foundation.
diff --git a/extension/fork.c b/extension/fork.c
index aff9b568..6f96e4ba 100644
--- a/extension/fork.c
+++ b/extension/fork.c
@@ -2,10 +2,11 @@
* fork.c - Provide fork and waitpid functions for gawk.
*
* Revised 6/2004
+ * Revised 5/2012 for new extension API.
*/
/*
- * Copyright (C) 2001, 2004, 2011 the Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2004, 2011, 2012 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -25,80 +26,136 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include "awk.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <assert.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/wait.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "gawkapi.h"
+
+#include "gettext.h"
+#define _(msgid) gettext(msgid)
+#define N_(msgid) msgid
+
+static const gawk_api_t *api; /* for convenience macros to work */
+static awk_ext_id_t *ext_id;
+static const char *ext_version = "fork extension: version 1.0";
+static awk_bool_t (*init_func)(void) = NULL;
int plugin_is_GPL_compatible;
+
+/* array_set --- set an array element */
+
+static void
+array_set_numeric(awk_array_t array, const char *sub, double num)
+{
+ awk_value_t index, value;
+
+ set_array_element(array,
+ make_const_string(sub, strlen(sub), & index),
+ make_number(num, & value));
+
+}
+
/* do_fork --- provide dynamically loaded fork() builtin for gawk */
-static NODE *
-do_fork(int nargs)
+static awk_value_t *
+do_fork(int nargs, awk_value_t *result)
{
int ret = -1;
- NODE **aptr;
- NODE *tmp;
- if (do_lint && get_curfunc_arg_count() > 0)
- lintwarn("fork: called with too many arguments");
+ assert(result != NULL);
+
+ if (do_lint && nargs > 0)
+ lintwarn(ext_id, _("fork: called with too many arguments"));
ret = fork();
if (ret < 0)
- update_ERRNO();
+ update_ERRNO_int(errno);
else if (ret == 0) {
- /* update PROCINFO in the child */
-
- aptr = assoc_lookup(PROCINFO_node, tmp = make_string("pid", 3), FALSE);
- (*aptr)->numbr = (AWKNUM) getpid();
- unref(tmp);
-
- aptr = assoc_lookup(PROCINFO_node, tmp = make_string("ppid", 4), FALSE);
- (*aptr)->numbr = (AWKNUM) getppid();
- unref(tmp);
+ /* update PROCINFO in the child, if the array exists */
+ awk_value_t procinfo;
+
+ if (sym_lookup("PROCINFO", AWK_ARRAY, & procinfo)) {
+ if (procinfo.val_type != AWK_ARRAY) {
+ if (do_lint)
+ lintwarn(ext_id, _("fork: PROCINFO is not an array!"));
+ } else {
+ array_set_numeric(procinfo.array_cookie, "pid", getpid());
+ array_set_numeric(procinfo.array_cookie, "ppid", getppid());
+ }
+ }
}
/* Set the return value */
- return make_number((AWKNUM) ret);
+ return make_number(ret, result);
}
-
/* do_waitpid --- provide dynamically loaded waitpid() builtin for gawk */
-static NODE *
-do_waitpid(int nargs)
+static awk_value_t *
+do_waitpid(int nargs, awk_value_t *result)
{
- NODE *pidnode;
+ awk_value_t pid;
int ret = -1;
- double pidval;
- pid_t pid;
int options = 0;
- if (do_lint && get_curfunc_arg_count() > 1)
- lintwarn("waitpid: called with too many arguments");
+ assert(result != NULL);
- pidnode = get_scalar_argument(0, FALSE);
- if (pidnode != NULL) {
- pidval = force_number(pidnode);
- pid = (int) pidval;
+ if (do_lint && nargs > 1)
+ lintwarn(ext_id, _("waitpid: called with too many arguments"));
+
+ if (get_argument(0, AWK_NUMBER, &pid)) {
options = WNOHANG|WUNTRACED;
- ret = waitpid(pid, NULL, options);
+ ret = waitpid(pid.num_value, NULL, options);
if (ret < 0)
- update_ERRNO();
+ update_ERRNO_int(errno);
} else if (do_lint)
- lintwarn("wait: called with no arguments");
+ lintwarn(ext_id, _("wait: called with no arguments"));
/* Set the return value */
- return make_number((AWKNUM) ret);
+ return make_number(ret, result);
}
-/* dlload --- load new builtins in this library */
-NODE *
-dlload(tree, dl)
-NODE *tree;
-void *dl;
+/* do_wait --- provide dynamically loaded wait() builtin for gawk */
+
+static awk_value_t *
+do_wait(int nargs, awk_value_t *result)
{
- make_builtin("fork", do_fork, 0);
- make_builtin("waitpid", do_waitpid, 1);
- return make_number((AWKNUM) 0);
+ int ret;
+
+ assert(result != NULL);
+
+ if (do_lint && nargs > 0)
+ lintwarn(ext_id, _("wait: called with too many arguments"));
+
+ ret = wait(NULL);
+ if (ret < 0)
+ update_ERRNO_int(errno);
+
+ /* Set the return value */
+ return make_number(ret, result);
}
+
+static awk_ext_func_t func_table[] = {
+ { "fork", do_fork, 0 },
+ { "waitpid", do_waitpid, 1 },
+ { "wait", do_wait, 0 },
+};
+
+/* define the dl_load function using the boilerplate macro */
+
+dl_load_func(func_table, fork, "")
diff --git a/extension/fts.3 b/extension/fts.3
new file mode 100644
index 00000000..9131d04f
--- /dev/null
+++ b/extension/fts.3
@@ -0,0 +1,773 @@
+.\" $NetBSD: fts.3,v 1.30 2011/03/30 16:29:26 jruoho Exp $
+.\"
+.\" Copyright (c) 1989, 1991, 1993, 1994
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)fts.3 8.5 (Berkeley) 4/16/94
+.\"
+.Dd March 30, 2011
+.Dt FTS 3
+.Os
+.Sh NAME
+.Nm fts ,
+.Nm fts_open ,
+.Nm fts_read ,
+.Nm fts_children ,
+.Nm fts_set ,
+.Nm fts_close
+.Nd traverse a file hierarchy
+.Sh LIBRARY
+.Lb libc
+.Sh SYNOPSIS
+.In sys/types.h
+.In sys/stat.h
+.In fts.h
+.Ft FTS *
+.Fo fts_open
+.Fa "char * const *path_argv"
+.Fa "int options"
+.Fa "int (*compar)(const FTSENT **, const FTSENT **)"
+.Fc
+.Ft FTSENT *
+.Fn fts_read "FTS *ftsp"
+.Ft FTSENT *
+.Fn fts_children "FTS *ftsp" "int options"
+.Ft int
+.Fn fts_set "FTS *ftsp" "FTSENT *f" "int options"
+.Ft int
+.Fn fts_close "FTS *ftsp"
+.Sh DESCRIPTION
+The
+.Nm
+functions are provided for traversing
+.Ux
+file hierarchies.
+A simple overview is that the
+.Fn fts_open
+function returns a
+.Dq handle
+on a file hierarchy, which is then supplied to
+the other
+.Nm
+functions.
+The function
+.Fn fts_read
+returns a pointer to a structure describing one of the files in the file
+hierarchy.
+The function
+.Fn fts_children
+returns a pointer to a linked list of structures, each of which describes
+one of the files contained in a directory in the hierarchy.
+In general, directories are visited two distinguishable times; in pre-order
+(before any of their descendants are visited) and in post-order (after all
+of their descendants have been visited).
+Files are visited once.
+It is possible to walk the hierarchy
+.Dq logically
+(ignoring symbolic links)
+or physically (visiting symbolic links), order the walk of the hierarchy or
+prune and/or re-visit portions of the hierarchy.
+.Pp
+Two structures are defined (and typedef'd) in the include file
+.In fts.h .
+The first is
+.Fa FTS ,
+the structure that represents the file hierarchy itself.
+The second is
+.Fa FTSENT ,
+the structure that represents a file in the file
+hierarchy.
+Normally, an
+.Fa FTSENT
+structure is returned for every file in the file
+hierarchy.
+In this manual page,
+.Dq file
+and
+.Dq Fa FTSENT No structure
+are generally
+interchangeable.
+The
+.Fa FTSENT
+structure contains at least the following fields, which are
+described in greater detail below:
+.Bd -literal -offset 2n
+typedef struct _ftsent {
+ u_short fts_info; /* flags for FTSENT structure */
+ char *fts_accpath; /* access path */
+ char *fts_path; /* root path */
+ short fts_pathlen; /* strlen(fts_path) */
+ char *fts_name; /* file name */
+ short fts_namelen; /* strlen(fts_name) */
+ short fts_level; /* depth (\-1 to N) */
+ int fts_errno; /* file errno */
+ long fts_number; /* local numeric value */
+ void *fts_pointer; /* local address value */
+ struct ftsent *fts_parent; /* parent directory */
+ struct ftsent *fts_link; /* next file structure */
+ struct ftsent *fts_cycle; /* cycle structure */
+ struct stat *fts_statp; /* stat(2) information */
+} FTSENT;
+.Ed
+.Pp
+These fields are defined as follows:
+.Bl -tag -width "fts_namelen"
+.It Fa fts_info
+One of the following flags describing the returned
+.Fa FTSENT
+structure and
+the file it represents.
+With the exception of directories without errors
+.Pq Dv FTS_D ,
+all of these
+entries are terminal, that is, they will not be revisited, nor will any
+of their descendants be visited.
+.Bl -tag -width FTS_DEFAULT
+.It Dv FTS_D
+A directory being visited in pre-order.
+.It Dv FTS_DC
+A directory that causes a cycle in the tree.
+(The
+.Fa fts_cycle
+field of the
+.Fa FTSENT
+structure will be filled in as well).
+.It Dv FTS_DEFAULT
+Any
+.Fa FTSENT
+structure that represents a file type not explicitly described
+by one of the other
+.Fa fts_info
+values.
+.It Dv FTS_DNR
+A directory which cannot be read.
+This is an error return, and the
+.Fa fts_errno
+field will be set to indicate what caused the error.
+.It Dv FTS_DOT
+A file named
+.Ql \&.
+or
+.Ql ..
+which was not specified as a file name to
+.Fn fts_open
+(see
+.Dv FTS_SEEDOT ) .
+.It Dv FTS_DP
+A directory being visited in post-order.
+The contents of the
+.Fa FTSENT
+structure will be unchanged from when
+it was returned in pre-order, i.e., with the
+.Fa fts_info
+field set to
+.Dv FTS_D .
+.It Dv FTS_ERR
+This is an error return, and the
+.Fa fts_errno
+field will be set to indicate what caused the error.
+.It Dv FTS_F
+A regular file.
+.It Dv FTS_NS
+A file for which no
+.Xr stat 2
+information was available.
+The contents of the
+.Fa fts_statp
+field are undefined.
+This is an error return, and the
+.Fa fts_errno
+field will be set to indicate what caused the error.
+.It Dv FTS_NSOK
+A file for which no
+.Xr stat 2
+information was requested.
+The contents of the
+.Fa fts_statp
+field are undefined.
+.It Dv FTS_SL
+A symbolic link.
+.It Dv FTS_SLNONE
+A symbolic link with a non-existent target.
+The contents of the
+.Fa fts_statp
+field reference the file characteristic information for the symbolic link
+itself.
+.It Dv FTS_W
+A whiteout object.
+.El
+.It Fa fts_accpath
+A path for accessing the file from the current directory.
+.It Fa fts_path
+The path for the file relative to the root of the traversal.
+This path contains the path specified to
+.Fn fts_open
+as a prefix.
+.It Fa fts_pathlen
+The length of the string referenced by
+.Fa fts_path .
+.It Fa fts_name
+The name of the file.
+.It Fa fts_namelen
+The length of the string referenced by
+.Fa fts_name .
+.It Fa fts_level
+The depth of the traversal, numbered from \-1 to N, where this file
+was found.
+The
+.Fa FTSENT
+structure representing the parent of the starting point (or root)
+of the traversal is numbered \-1, and the
+.Fa FTSENT
+structure for the root
+itself is numbered 0.
+.It Fa fts_errno
+Upon return of a
+.Fa FTSENT
+structure from the
+.Fn fts_children
+or
+.Fn fts_read
+functions, with its
+.Fa fts_info
+field set to
+.Dv FTS_DNR ,
+.Dv FTS_ERR
+or
+.Dv FTS_NS ,
+the
+.Fa fts_errno
+field contains the value of the external variable
+.Va errno
+specifying the cause of the error.
+Otherwise, the contents of the
+.Fa fts_errno
+field are undefined.
+.It Fa fts_number
+This field is provided for the use of the application program and is
+not modified by the
+.Nm
+functions.
+It is initialized to 0.
+.It Fa fts_pointer
+This field is provided for the use of the application program and is
+not modified by the
+.Nm
+functions.
+It is initialized to
+.Dv NULL .
+.It Fa fts_parent
+A pointer to the
+.Fa FTSENT
+structure referencing the file in the hierarchy
+immediately above the current file, i.e., the directory of which this
+file is a member.
+A parent structure for the initial entry point is provided as well,
+however, only the
+.Fa fts_level ,
+.Fa fts_number
+and
+.Fa fts_pointer
+fields are guaranteed to be initialized.
+.It Fa fts_link
+Upon return from the
+.Fn fts_children
+function, the
+.Fa fts_link
+field points to the next structure in the
+.Dv NULL Ns -terminated
+linked list of directory members.
+Otherwise, the contents of the
+.Fa fts_link
+field are undefined.
+.It Fa fts_cycle
+If a directory causes a cycle in the hierarchy (see
+.Dv FTS_DC ) ,
+either because
+of a hard link between two directories, or a symbolic link pointing to a
+directory, the
+.Fa fts_cycle
+field of the structure will point to the
+.Fa FTSENT
+structure in the hierarchy that references the same file as the current
+.Fa FTSENT
+structure.
+Otherwise, the contents of the
+.Fa fts_cycle
+field are undefined.
+.It Fa fts_statp
+A pointer to
+.Xr stat 2
+information for the file.
+.El
+.Pp
+A single buffer is used for all of the paths of all of the files in the
+file hierarchy.
+Therefore, the
+.Fa fts_path
+and
+.Fa fts_accpath
+fields are guaranteed to be
+.Dv NULL Ns -terminated
+.Em only
+for the file most recently returned by
+.Fn fts_read .
+To use these fields to reference any files represented by other
+.Fa FTSENT
+structures will require that the path buffer be modified using the
+information contained in that
+.Fa FTSENT
+structure's
+.Fa fts_pathlen
+field.
+Any such modifications should be undone before further calls to
+.Fn fts_read
+are attempted.
+The
+.Fa fts_name
+field is always
+.Dv NULL Ns -terminated .
+.Sh FTS_OPEN
+The
+.Fn fts_open
+function takes a pointer to an array of character pointers naming one
+or more paths which make up a logical file hierarchy to be traversed.
+The array must be terminated by a
+.Dv NULL
+pointer.
+.Pp
+There are
+a number of options, at least one of which (either
+.Dv FTS_LOGICAL
+or
+.Dv FTS_PHYSICAL )
+must be specified.
+The options are selected by
+.Em or Ns 'ing
+the following values:
+.Bl -tag -width "FTS_COMFOLLOW "
+.It Dv FTS_COMFOLLOW
+This option causes any symbolic link specified as a root path to be
+followed immediately whether or not
+.Dv FTS_LOGICAL
+is also specified.
+.It Dv FTS_LOGICAL
+This option causes the
+.Nm
+routines to return
+.Fa FTSENT
+structures for the targets of symbolic links
+instead of the symbolic links themselves.
+If this option is set, the only symbolic links for which
+.Fa FTSENT
+structures
+are returned to the application are those referencing non-existent files.
+Either
+.Dv FTS_LOGICAL
+or
+.Dv FTS_PHYSICAL
+.Em must
+be provided to the
+.Fn fts_open
+function.
+.It Dv FTS_NOCHDIR
+As a performance optimization, the
+.Nm
+functions change directories as they walk the file hierarchy.
+This has the side-effect that an application cannot rely on being
+in any particular directory during the traversal.
+The
+.Dv FTS_NOCHDIR
+option turns off this optimization, and the
+.Nm
+functions will not change the current directory.
+Note that applications should not themselves change their current directory
+and try to access files unless
+.Dv FTS_NOCHDIR
+is specified and absolute
+pathnames were provided as arguments to
+.Fn fts_open .
+.It Dv FTS_NOSTAT
+By default, returned
+.Fa FTSENT
+structures reference file characteristic information (the
+.Fa statp
+field) for each file visited.
+This option relaxes that requirement as a performance optimization,
+allowing the
+.Nm
+functions to set the
+.Fa fts_info
+field to
+.Dv FTS_NSOK
+and leave the contents of the
+.Fa statp
+field undefined.
+.It Dv FTS_PHYSICAL
+This option causes the
+.Nm
+routines to return
+.Fa FTSENT
+structures for symbolic links themselves instead
+of the target files they point to.
+If this option is set,
+.Fa FTSENT
+structures for all symbolic links in the
+hierarchy are returned to the application.
+Either
+.Dv FTS_LOGICAL
+or
+.Dv FTS_PHYSICAL
+.Em must
+be provided to the
+.Fn fts_open
+function.
+.It Dv FTS_SEEDOT
+By default, unless they are specified as path arguments to
+.Fn fts_open ,
+any files named
+.Ql \&.
+or
+.Ql ..
+encountered in the file hierarchy are ignored.
+This option causes the
+.Nm
+routines to return
+.Fa FTSENT
+structures for them.
+.It Dv FTS_WHITEOUT
+Return whiteout entries, which are normally hidden.
+.It Dv FTS_XDEV
+This option prevents
+.Nm
+from descending into directories that have a different device number
+than the file from which the descent began.
+.El
+.Pp
+The argument
+.Fn compar
+specifies a user-defined function which may be used to order the traversal
+of the hierarchy.
+It
+takes two pointers to pointers to
+.Fa FTSENT
+structures as arguments and
+should return a negative value, zero, or a positive value to indicate
+if the file referenced by its first argument comes before, in any order
+with respect to, or after, the file referenced by its second argument.
+The
+.Fa fts_accpath ,
+.Fa fts_path
+and
+.Fa fts_pathlen
+fields of the
+.Fa FTSENT
+structures may
+.Em never
+be used in this comparison.
+If the
+.Fa fts_info
+field is set to
+.Dv FTS_NS
+or
+.Dv FTS_NSOK ,
+the
+.Fa fts_statp
+field may not either.
+If the
+.Fn compar
+argument is
+.Dv NULL ,
+the directory traversal order is in the order listed in
+.Fa path_argv
+for the root paths, and in the order listed in the directory for
+everything else.
+.Sh FTS_READ
+The
+.Fn fts_read
+function returns a pointer to an
+.Fa FTSENT
+structure describing a file in
+the hierarchy.
+Directories (that are readable and do not cause cycles) are visited at
+least twice, once in pre-order and once in post-order.
+All other files are visited at least once.
+(Hard links between directories that do not cause cycles or symbolic
+links to symbolic links may cause files to be visited more than once,
+or directories more than twice.)
+.Pp
+If all the members of the hierarchy have been returned,
+.Fn fts_read
+returns
+.Dv NULL
+and sets the external variable
+.Va errno
+to 0.
+If an error unrelated to a file in the hierarchy occurs,
+.Fn fts_read
+returns
+.Dv NULL
+and sets
+.Va errno
+appropriately.
+If an error related to a returned file occurs, a pointer to an
+.Fa FTSENT
+structure is returned, and
+.Va errno
+may or may not have been set (see
+.Fa fts_info ) .
+.Pp
+The
+.Fa FTSENT
+structures returned by
+.Fn fts_read
+may be overwritten after a call to
+.Fn fts_close
+on the same file hierarchy stream, or, after a call to
+.Fn fts_read
+on the same file hierarchy stream unless they represent a file of type
+directory, in which case they will not be overwritten until after a call to
+.Fn fts_read
+after the
+.Fa FTSENT
+structure has been returned by the function
+.Fn fts_read
+in post-order.
+.Sh FTS_CHILDREN
+The
+.Fn fts_children
+function returns a pointer to an
+.Fa FTSENT
+structure describing the first entry in a
+.Dv NULL Ns -terminated
+linked list of the files in the directory represented by the
+.Fa FTSENT
+structure most recently returned by
+.Fn fts_read .
+The list is linked through the
+.Fa fts_link
+field of the
+.Fa FTSENT
+structure, and is ordered by the user-specified comparison function, if any.
+Repeated calls to
+.Fn fts_children
+will recreate this linked list.
+.Pp
+As a special case, if
+.Fn fts_read
+has not yet been called for a hierarchy,
+.Fn fts_children
+will return a pointer to the files in the logical directory specified to
+.Fn fts_open ,
+i.e., the arguments specified to
+.Fn fts_open .
+Otherwise, if the
+.Fa FTSENT
+structure most recently returned by
+.Fn fts_read
+is not a directory being visited in pre-order,
+or the directory does not contain any files,
+.Fn fts_children
+returns
+.Dv NULL
+and sets
+.Va errno
+to zero.
+If an error occurs,
+.Fn fts_children
+returns
+.Dv NULL
+and sets
+.Va errno
+appropriately.
+.Pp
+The
+.Fa FTSENT
+structures returned by
+.Fn fts_children
+may be overwritten after a call to
+.Fn fts_children ,
+.Fn fts_close
+or
+.Fn fts_read
+on the same file hierarchy stream.
+.Pp
+.Em Option
+may be set to the following value:
+.Bl -tag -width "FTS_COMFOLLOW "
+.It Dv FTS_NAMEONLY
+Only the names of the files are needed.
+The contents of all the fields in the returned linked list of structures
+are undefined with the exception of the
+.Fa fts_name
+and
+.Fa fts_namelen
+fields.
+.El
+.Sh FTS_SET
+The function
+.Fn fts_set
+allows the user application to determine further processing for the
+file
+.Fa f
+of the stream
+.Fa ftsp .
+The
+.Fn fts_set
+function
+returns 0 on success, and \-1 if an error occurs.
+.Em Option
+must be set to one of the following values:
+.Bl -tag -width "FTS_COMFOLLOW "
+.It Dv FTS_AGAIN
+Re-visit the file; any file type may be re-visited.
+The next call to
+.Fn fts_read
+will return the referenced file.
+The
+.Fa fts_stat
+and
+.Fa fts_info
+fields of the structure will be reinitialized at that time,
+but no other fields will have been changed.
+This option is meaningful only for the most recently returned
+file from
+.Fn fts_read .
+Normal use is for post-order directory visits, where it causes the
+directory to be re-visited (in both pre and post-order) as well as all
+of its descendants.
+.It Dv FTS_FOLLOW
+The referenced file must be a symbolic link.
+If the referenced file is the one most recently returned by
+.Fn fts_read ,
+the next call to
+.Fn fts_read
+returns the file with the
+.Fa fts_info
+and
+.Fa fts_statp
+fields reinitialized to reflect the target of the symbolic link instead
+of the symbolic link itself.
+If the file is one of those most recently returned by
+.Fn fts_children ,
+the
+.Fa fts_info
+and
+.Fa fts_statp
+fields of the structure, when returned by
+.Fn fts_read ,
+will reflect the target of the symbolic link instead of the symbolic link
+itself.
+In either case, if the target of the symbolic link does not exist the
+fields of the returned structure will be unchanged and the
+.Fa fts_info
+field will be set to
+.Dv FTS_SLNONE .
+.Pp
+If the target of the link is a directory, the pre-order return, followed
+by the return of all of its descendants, followed by a post-order return,
+is done.
+.It Dv FTS_SKIP
+No descendants of this file are visited.
+The file may be one of those most recently returned by either
+.Fn fts_children
+or
+.Fn fts_read .
+.El
+.Sh FTS_CLOSE
+The
+.Fn fts_close
+function closes a file hierarchy stream
+.Fa ftsp
+and restores the current directory to the directory from which
+.Fn fts_open
+was called to open
+.Fa ftsp .
+The
+.Fn fts_close
+function
+returns 0 on success, and \-1 if an error occurs.
+.Sh ERRORS
+The function
+.Fn fts_open
+may fail and set
+.Va errno
+for any of the errors specified for the library functions
+.Xr open 2
+and
+.Xr malloc 3 .
+.Pp
+The function
+.Fn fts_close
+may fail and set
+.Va errno
+for any of the errors specified for the library functions
+.Xr chdir 2
+and
+.Xr close 2 .
+.Pp
+The functions
+.Fn fts_read
+and
+.Fn fts_children
+may fail and set
+.Va errno
+for any of the errors specified for the library functions
+.Xr chdir 2 ,
+.Xr malloc 3 ,
+.Xr opendir 3 ,
+.Xr readdir 3
+and
+.Xr stat 2 .
+.Pp
+In addition,
+.Fn fts_children ,
+.Fn fts_open
+and
+.Fn fts_set
+may fail and set
+.Va errno
+as follows:
+.Bl -tag -width Er
+.It Bq Er EINVAL
+The options were invalid.
+.El
+.Sh SEE ALSO
+.Xr find 1 ,
+.Xr chdir 2 ,
+.Xr stat 2 ,
+.Xr qsort 3 ,
+.Xr symlink 7
+.Sh STANDARDS
+The
+.Nm
+utility was expected to be included in the
+.St -p1003.1-88
+revision.
+But twenty years later, it still was not included in the
+.St -p1003.1-2008
+revision.
diff --git a/extension/gawkfts.c b/extension/gawkfts.c
new file mode 100644
index 00000000..2b47275b
--- /dev/null
+++ b/extension/gawkfts.c
@@ -0,0 +1,1240 @@
+/* $NetBSD: fts.c,v 1.44 2012/03/14 00:25:19 christos Exp $ */
+
+/*-
+ * Copyright (c) 1990, 1993, 1994
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if 0
+static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94";
+#else
+/* __RCSID("$NetBSD: fts.c,v 1.44 2012/03/14 00:25:19 christos Exp $"); */
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/* #include "namespace.h" */
+#ifndef ZOS_USS
+#include <sys/param.h>
+#else
+#include <stdio.h>
+#include <limits.h>
+#endif /* ZOS_USS */
+#include <sys/stat.h>
+
+#include <assert.h>
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include "gawkfts.h"
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+/*
+#if ! HAVE_NBTOOL_CONFIG_H
+#define HAVE_STRUCT_DIRENT_D_NAMLEN
+#endif
+*/
+
+static FTSENT *fts_alloc(FTS *, const char *, size_t);
+static FTSENT *fts_build(FTS *, int);
+static void fts_free(FTSENT *);
+static void fts_lfree(FTSENT *);
+static void fts_load(FTS *, FTSENT *);
+static size_t fts_maxarglen(char * const *);
+static size_t fts_pow2(size_t);
+static int fts_palloc(FTS *, size_t);
+static void fts_padjust(FTS *, FTSENT *);
+static FTSENT *fts_sort(FTS *, FTSENT *, size_t);
+static unsigned short fts_stat(FTS *, FTSENT *, int);
+static int fts_safe_changedir(const FTS *, const FTSENT *, int,
+ const char *);
+
+#if defined(ALIGNBYTES) && defined(ALIGN)
+#define FTS_ALLOC_ALIGNED 1
+#else
+#undef FTS_ALLOC_ALIGNED
+#endif
+
+#ifndef ftsent_namelen_truncate
+#define ftsent_namelen_truncate(a) \
+ ((a) > UINT_MAX ? UINT_MAX : (unsigned int)(a))
+#endif
+#ifndef ftsent_pathlen_truncate
+#define ftsent_pathlen_truncate(a) \
+ ((a) > UINT_MAX ? UINT_MAX : (unsigned int)(a))
+#endif
+#ifndef fts_pathlen_truncate
+#define fts_pathlen_truncate(a) \
+ ((a) > UINT_MAX ? UINT_MAX : (unsigned int)(a))
+#endif
+#ifndef fts_nitems_truncate
+#define fts_nitems_truncate(a) \
+ ((a) > UINT_MAX ? UINT_MAX : (unsigned int)(a))
+#endif
+
+#define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2])))
+
+#define CLR(opt) (sp->fts_options &= ~(opt))
+#define ISSET(opt) (sp->fts_options & (opt))
+#define SET(opt) (sp->fts_options |= (opt))
+
+#define CHDIR(sp, path) (!ISSET(FTS_NOCHDIR) && chdir(path))
+#define FCHDIR(sp, fd) (!ISSET(FTS_NOCHDIR) && fchdir(fd))
+
+/* fts_build flags */
+#define BCHILD 1 /* fts_children */
+#define BNAMES 2 /* fts_children, names only */
+#define BREAD 3 /* fts_read */
+
+#ifndef DTF_HIDEW
+#undef FTS_WHITEOUT
+#endif
+
+#define _DIAGASSERT(expression)
+
+FTS *
+fts_open(char * const *argv, int options,
+ int (*compar)(const FTSENT **, const FTSENT **))
+{
+ FTS *sp;
+ FTSENT *p, *root;
+ size_t nitems;
+ FTSENT *parent, *tmp = NULL; /* pacify gcc */
+ size_t len;
+
+ _DIAGASSERT(argv != NULL);
+
+ /* Options check. */
+ if (options & ~FTS_OPTIONMASK) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ /* Allocate/initialize the stream */
+ if ((sp = malloc((unsigned int)sizeof(FTS))) == NULL)
+ return (NULL);
+ memset(sp, 0, sizeof(FTS));
+ sp->fts_compar = compar;
+ sp->fts_options = options;
+
+ /* Logical walks turn on NOCHDIR; symbolic links are too hard. */
+ if (ISSET(FTS_LOGICAL))
+ SET(FTS_NOCHDIR);
+
+ /*
+ * Start out with 1K of path space, and enough, in any case,
+ * to hold the user's paths.
+ */
+ if (fts_palloc(sp, MAX(fts_maxarglen(argv), MAXPATHLEN)))
+ goto mem1;
+
+ /* Allocate/initialize root's parent. */
+ if ((parent = fts_alloc(sp, "", 0)) == NULL)
+ goto mem2;
+ parent->fts_level = FTS_ROOTPARENTLEVEL;
+
+ /* Allocate/initialize root(s). */
+ for (root = NULL, nitems = 0; *argv; ++argv, ++nitems) {
+ /* Don't allow zero-length paths. */
+ if ((len = strlen(*argv)) == 0) {
+ errno = ENOENT;
+ goto mem3;
+ }
+
+ if ((p = fts_alloc(sp, *argv, len)) == NULL)
+ goto mem3;
+ p->fts_level = FTS_ROOTLEVEL;
+ p->fts_parent = parent;
+ p->fts_accpath = p->fts_name;
+ p->fts_info = fts_stat(sp, p, ISSET(FTS_COMFOLLOW));
+
+ /* Command-line "." and ".." are real directories. */
+ if (p->fts_info == FTS_DOT)
+ p->fts_info = FTS_D;
+
+ /*
+ * If comparison routine supplied, traverse in sorted
+ * order; otherwise traverse in the order specified.
+ */
+ if (compar) {
+ p->fts_link = root;
+ root = p;
+ } else {
+ p->fts_link = NULL;
+ if (root == NULL)
+ tmp = root = p;
+ else {
+ tmp->fts_link = p;
+ tmp = p;
+ }
+ }
+ }
+ if (compar && nitems > 1)
+ root = fts_sort(sp, root, nitems);
+
+ /*
+ * Allocate a dummy pointer and make fts_read think that we've just
+ * finished the node before the root(s); set p->fts_info to FTS_INIT
+ * so that everything about the "current" node is ignored.
+ */
+ if ((sp->fts_cur = fts_alloc(sp, "", 0)) == NULL)
+ goto mem3;
+ sp->fts_cur->fts_link = root;
+ sp->fts_cur->fts_info = FTS_INIT;
+
+ /*
+ * If using chdir(2), grab a file descriptor pointing to dot to insure
+ * that we can get back here; this could be avoided for some paths,
+ * but almost certainly not worth the effort. Slashes, symbolic links,
+ * and ".." are all fairly nasty problems. Note, if we can't get the
+ * descriptor we run anyway, just more slowly.
+ */
+#ifndef O_CLOEXEC
+#define O_CLOEXEC 0
+#endif
+ if (!ISSET(FTS_NOCHDIR)) {
+ if ((sp->fts_rfd = open(".", O_RDONLY | O_CLOEXEC, 0)) == -1)
+ SET(FTS_NOCHDIR);
+ }
+
+ if (nitems == 0)
+ fts_free(parent);
+
+ return (sp);
+
+mem3: fts_lfree(root);
+ fts_free(parent);
+mem2: free(sp->fts_path);
+mem1: free(sp);
+ return (NULL);
+}
+
+static void
+fts_load(FTS *sp, FTSENT *p)
+{
+ size_t len;
+ char *cp;
+
+ _DIAGASSERT(sp != NULL);
+ _DIAGASSERT(p != NULL);
+
+ /*
+ * Load the stream structure for the next traversal. Since we don't
+ * actually enter the directory until after the preorder visit, set
+ * the fts_accpath field specially so the chdir gets done to the right
+ * place and the user can access the first node. From fts_open it's
+ * known that the path will fit.
+ */
+ len = p->fts_pathlen = p->fts_namelen;
+ memmove(sp->fts_path, p->fts_name, len + 1);
+ if ((cp = strrchr(p->fts_name, '/')) && (cp != p->fts_name || cp[1])) {
+ len = strlen(++cp);
+ memmove(p->fts_name, cp, len + 1);
+ p->fts_namelen = ftsent_namelen_truncate(len);
+ }
+ p->fts_accpath = p->fts_path = sp->fts_path;
+ sp->fts_dev = p->fts_dev;
+}
+
+int
+fts_close(FTS *sp)
+{
+ FTSENT *freep, *p;
+ int saved_errno = 0;
+
+ _DIAGASSERT(sp != NULL);
+
+ /*
+ * This still works if we haven't read anything -- the dummy structure
+ * points to the root list, so we step through to the end of the root
+ * list which has a valid parent pointer.
+ */
+ if (sp->fts_cur) {
+ if (sp->fts_cur->fts_flags & FTS_SYMFOLLOW)
+ (void)close(sp->fts_cur->fts_symfd);
+ for (p = sp->fts_cur; p->fts_level >= FTS_ROOTLEVEL;) {
+ freep = p;
+ p = p->fts_link ? p->fts_link : p->fts_parent;
+ fts_free(freep);
+ }
+ fts_free(p);
+ }
+
+ /* Free up child linked list, sort array, path buffer. */
+ if (sp->fts_child)
+ fts_lfree(sp->fts_child);
+ if (sp->fts_array)
+ free(sp->fts_array);
+ free(sp->fts_path);
+
+ /* Return to original directory, save errno if necessary. */
+ if (!ISSET(FTS_NOCHDIR)) {
+ if (fchdir(sp->fts_rfd) == -1)
+ saved_errno = errno;
+ (void)close(sp->fts_rfd);
+ }
+
+ /* Free up the stream pointer. */
+ free(sp);
+ if (saved_errno) {
+ errno = saved_errno;
+ return -1;
+ }
+
+ return 0;
+}
+
+#if !defined(__FTS_COMPAT_TAILINGSLASH)
+
+/*
+ * Special case of "/" at the end of the path so that slashes aren't
+ * appended which would cause paths to be written as "....//foo".
+ */
+#define NAPPEND(p) \
+ (p->fts_path[p->fts_pathlen - 1] == '/' \
+ ? p->fts_pathlen - 1 : p->fts_pathlen)
+
+#else /* !defined(__FTS_COMPAT_TAILINGSLASH) */
+
+/*
+ * compatibility with the old behaviour.
+ *
+ * Special case a root of "/" so that slashes aren't appended which would
+ * cause paths to be written as "//foo".
+ */
+
+#define NAPPEND(p) \
+ (p->fts_level == FTS_ROOTLEVEL && p->fts_pathlen == 1 && \
+ p->fts_path[0] == '/' ? 0 : p->fts_pathlen)
+
+#endif /* !defined(__FTS_COMPAT_TAILINGSLASH) */
+
+FTSENT *
+fts_read(FTS *sp)
+{
+ FTSENT *p, *tmp;
+ int instr;
+ char *t;
+ int saved_errno;
+
+ _DIAGASSERT(sp != NULL);
+
+ /* If finished or unrecoverable error, return NULL. */
+ if (sp->fts_cur == NULL || ISSET(FTS_STOP))
+ return (NULL);
+
+ /* Set current node pointer. */
+ p = sp->fts_cur;
+
+ /* Save and zero out user instructions. */
+ instr = p->fts_instr;
+ p->fts_instr = FTS_NOINSTR;
+
+ /* Any type of file may be re-visited; re-stat and re-turn. */
+ if (instr == FTS_AGAIN) {
+ p->fts_info = fts_stat(sp, p, 0);
+ return (p);
+ }
+
+ /*
+ * Following a symlink -- SLNONE test allows application to see
+ * SLNONE and recover. If indirecting through a symlink, have
+ * keep a pointer to current location. If unable to get that
+ * pointer, follow fails.
+ */
+ if (instr == FTS_FOLLOW &&
+ (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) {
+ p->fts_info = fts_stat(sp, p, 1);
+ if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) {
+ if ((p->fts_symfd = open(".", O_RDONLY | O_CLOEXEC, 0))
+ == -1) {
+ p->fts_errno = errno;
+ p->fts_info = FTS_ERR;
+ } else
+ p->fts_flags |= FTS_SYMFOLLOW;
+ }
+ return (p);
+ }
+
+ /* Directory in pre-order. */
+ if (p->fts_info == FTS_D) {
+ /* If skipped or crossed mount point, do post-order visit. */
+ if (instr == FTS_SKIP ||
+ (ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev)) {
+ if (p->fts_flags & FTS_SYMFOLLOW)
+ (void)close(p->fts_symfd);
+ if (sp->fts_child) {
+ fts_lfree(sp->fts_child);
+ sp->fts_child = NULL;
+ }
+ p->fts_info = FTS_DP;
+ return (p);
+ }
+
+ /* Rebuild if only read the names and now traversing. */
+ if (sp->fts_child && ISSET(FTS_NAMEONLY)) {
+ CLR(FTS_NAMEONLY);
+ fts_lfree(sp->fts_child);
+ sp->fts_child = NULL;
+ }
+
+ /*
+ * Cd to the subdirectory.
+ *
+ * If have already read and now fail to chdir, whack the list
+ * to make the names come out right, and set the parent errno
+ * so the application will eventually get an error condition.
+ * Set the FTS_DONTCHDIR flag so that when we logically change
+ * directories back to the parent we don't do a chdir.
+ *
+ * If haven't read do so. If the read fails, fts_build sets
+ * FTS_STOP or the fts_info field of the node.
+ */
+ if (sp->fts_child) {
+ if (fts_safe_changedir(sp, p, -1, p->fts_accpath)) {
+ p->fts_errno = errno;
+ p->fts_flags |= FTS_DONTCHDIR;
+ for (p = sp->fts_child; p; p = p->fts_link)
+ p->fts_accpath =
+ p->fts_parent->fts_accpath;
+ }
+ } else if ((sp->fts_child = fts_build(sp, BREAD)) == NULL) {
+ if (ISSET(FTS_STOP))
+ return (NULL);
+ return (p);
+ }
+ p = sp->fts_child;
+ sp->fts_child = NULL;
+ goto name;
+ }
+
+ /* Move to the next node on this level. */
+next: tmp = p;
+ if ((p = p->fts_link) != NULL) {
+ fts_free(tmp);
+
+ /*
+ * If reached the top, return to the original directory, and
+ * load the paths for the next root.
+ */
+ if (p->fts_level == FTS_ROOTLEVEL) {
+ if (FCHDIR(sp, sp->fts_rfd)) {
+ SET(FTS_STOP);
+ return (NULL);
+ }
+ fts_load(sp, p);
+ return (sp->fts_cur = p);
+ }
+
+ /*
+ * User may have called fts_set on the node. If skipped,
+ * ignore. If followed, get a file descriptor so we can
+ * get back if necessary.
+ */
+ if (p->fts_instr == FTS_SKIP)
+ goto next;
+ if (p->fts_instr == FTS_FOLLOW) {
+ p->fts_info = fts_stat(sp, p, 1);
+ if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) {
+ if ((p->fts_symfd =
+ open(".", O_RDONLY | O_CLOEXEC, 0)) == -1) {
+ p->fts_errno = errno;
+ p->fts_info = FTS_ERR;
+ } else
+ p->fts_flags |= FTS_SYMFOLLOW;
+ }
+ p->fts_instr = FTS_NOINSTR;
+ }
+
+name: t = sp->fts_path + NAPPEND(p->fts_parent);
+ *t++ = '/';
+ memmove(t, p->fts_name, (size_t)(p->fts_namelen + 1));
+ return (sp->fts_cur = p);
+ }
+
+ /* Move up to the parent node. */
+ p = tmp->fts_parent;
+ fts_free(tmp);
+
+ if (p->fts_level == FTS_ROOTPARENTLEVEL) {
+ /*
+ * Done; free everything up and set errno to 0 so the user
+ * can distinguish between error and EOF.
+ */
+ fts_free(p);
+ errno = 0;
+ return (sp->fts_cur = NULL);
+ }
+
+ /* Nul terminate the pathname. */
+ sp->fts_path[p->fts_pathlen] = '\0';
+
+ /*
+ * Return to the parent directory. If at a root node or came through
+ * a symlink, go back through the file descriptor. Otherwise, cd up
+ * one directory.
+ */
+ if (p->fts_level == FTS_ROOTLEVEL) {
+ if (FCHDIR(sp, sp->fts_rfd)) {
+ SET(FTS_STOP);
+ return (NULL);
+ }
+ } else if (p->fts_flags & FTS_SYMFOLLOW) {
+ if (FCHDIR(sp, p->fts_symfd)) {
+ saved_errno = errno;
+ (void)close(p->fts_symfd);
+ errno = saved_errno;
+ SET(FTS_STOP);
+ return (NULL);
+ }
+ (void)close(p->fts_symfd);
+ } else if (!(p->fts_flags & FTS_DONTCHDIR) &&
+ fts_safe_changedir(sp, p->fts_parent, -1, "..")) {
+ SET(FTS_STOP);
+ return (NULL);
+ }
+ p->fts_info = p->fts_errno ? FTS_ERR : FTS_DP;
+ return (sp->fts_cur = p);
+}
+
+/*
+ * Fts_set takes the stream as an argument although it's not used in this
+ * implementation; it would be necessary if anyone wanted to add global
+ * semantics to fts using fts_set. An error return is allowed for similar
+ * reasons.
+ */
+/* ARGSUSED */
+int
+fts_set(FTS *sp, FTSENT *p, int instr)
+{
+
+ _DIAGASSERT(sp != NULL);
+ _DIAGASSERT(p != NULL);
+
+ if (instr && instr != FTS_AGAIN && instr != FTS_FOLLOW &&
+ instr != FTS_NOINSTR && instr != FTS_SKIP) {
+ errno = EINVAL;
+ return (1);
+ }
+ p->fts_instr = instr;
+ return (0);
+}
+
+FTSENT *
+fts_children(FTS *sp, int instr)
+{
+ FTSENT *p;
+ int fd;
+
+ _DIAGASSERT(sp != NULL);
+
+ if (instr && instr != FTS_NAMEONLY) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ /* Set current node pointer. */
+ p = sp->fts_cur;
+
+ /*
+ * Errno set to 0 so user can distinguish empty directory from
+ * an error.
+ */
+ errno = 0;
+
+ /* Fatal errors stop here. */
+ if (ISSET(FTS_STOP))
+ return (NULL);
+
+ /* Return logical hierarchy of user's arguments. */
+ if (p->fts_info == FTS_INIT)
+ return (p->fts_link);
+
+ /*
+ * If not a directory being visited in pre-order, stop here. Could
+ * allow FTS_DNR, assuming the user has fixed the problem, but the
+ * same effect is available with FTS_AGAIN.
+ */
+ if (p->fts_info != FTS_D /* && p->fts_info != FTS_DNR */)
+ return (NULL);
+
+ /* Free up any previous child list. */
+ if (sp->fts_child)
+ fts_lfree(sp->fts_child);
+
+ if (instr == FTS_NAMEONLY) {
+ SET(FTS_NAMEONLY);
+ instr = BNAMES;
+ } else
+ instr = BCHILD;
+
+ /*
+ * If using chdir on a relative path and called BEFORE fts_read does
+ * its chdir to the root of a traversal, we can lose -- we need to
+ * chdir into the subdirectory, and we don't know where the current
+ * directory is, so we can't get back so that the upcoming chdir by
+ * fts_read will work.
+ */
+ if (p->fts_level != FTS_ROOTLEVEL || p->fts_accpath[0] == '/' ||
+ ISSET(FTS_NOCHDIR))
+ return (sp->fts_child = fts_build(sp, instr));
+
+ if ((fd = open(".", O_RDONLY, 0)) == -1)
+ return (sp->fts_child = NULL);
+ sp->fts_child = fts_build(sp, instr);
+ if (fchdir(fd)) {
+ (void)close(fd);
+ return (NULL);
+ }
+ (void)close(fd);
+ return (sp->fts_child);
+}
+
+/*
+ * This is the tricky part -- do not casually change *anything* in here. The
+ * idea is to build the linked list of entries that are used by fts_children
+ * and fts_read. There are lots of special cases.
+ *
+ * The real slowdown in walking the tree is the stat calls. If FTS_NOSTAT is
+ * set and it's a physical walk (so that symbolic links can't be directories),
+ * we can do things quickly. First, if it's a 4.4BSD file system, the type
+ * of the file is in the directory entry. Otherwise, we assume that the number
+ * of subdirectories in a node is equal to the number of links to the parent.
+ * The former skips all stat calls. The latter skips stat calls in any leaf
+ * directories and for any files after the subdirectories in the directory have
+ * been found, cutting the stat calls by about 2/3.
+ */
+static FTSENT *
+fts_build(FTS *sp, int type)
+{
+ struct dirent *dp;
+ FTSENT *p, *head;
+ size_t nitems;
+ FTSENT *cur, *tail;
+ DIR *dirp;
+ void *oldaddr;
+ size_t dnamlen;
+ int cderrno, descend, level, nlinks, saved_errno, nostat, doadjust;
+ size_t len, maxlen;
+#ifdef FTS_WHITEOUT
+ int oflag;
+#endif
+ char *cp = NULL; /* pacify gcc */
+
+ _DIAGASSERT(sp != NULL);
+
+ /* Set current node pointer. */
+ cur = sp->fts_cur;
+
+ /*
+ * Open the directory for reading. If this fails, we're done.
+ * If being called from fts_read, set the fts_info field.
+ */
+#if 0 /* def FTS_WHITEOUT */
+ if (ISSET(FTS_WHITEOUT))
+ oflag = DTF_NODUP|DTF_REWIND;
+ else
+ oflag = DTF_HIDEW|DTF_NODUP|DTF_REWIND;
+#else
+#define __opendir2(path, flag) opendir(path)
+#endif
+ if ((dirp = __opendir2(cur->fts_accpath, oflag)) == NULL) {
+ if (type == BREAD) {
+ cur->fts_info = FTS_DNR;
+ cur->fts_errno = errno;
+ }
+ return (NULL);
+ }
+
+ /*
+ * Nlinks is the number of possible entries of type directory in the
+ * directory if we're cheating on stat calls, 0 if we're not doing
+ * any stat calls at all, -1 if we're doing stats on everything.
+ */
+ if (type == BNAMES) {
+ nlinks = 0;
+ nostat = 1;
+ } else if (ISSET(FTS_NOSTAT) && ISSET(FTS_PHYSICAL)) {
+ nlinks = cur->fts_nlink - (ISSET(FTS_SEEDOT) ? 0 : 2);
+ nostat = 1;
+ } else {
+ nlinks = -1;
+ nostat = 0;
+ }
+
+#ifdef notdef
+ (void)printf("nlinks == %d (cur: %d)\n", nlinks, cur->fts_nlink);
+ (void)printf("NOSTAT %d PHYSICAL %d SEEDOT %d\n",
+ ISSET(FTS_NOSTAT), ISSET(FTS_PHYSICAL), ISSET(FTS_SEEDOT));
+#endif
+ /*
+ * If we're going to need to stat anything or we want to descend
+ * and stay in the directory, chdir. If this fails we keep going,
+ * but set a flag so we don't chdir after the post-order visit.
+ * We won't be able to stat anything, but we can still return the
+ * names themselves. Note, that since fts_read won't be able to
+ * chdir into the directory, it will have to return different path
+ * names than before, i.e. "a/b" instead of "b". Since the node
+ * has already been visited in pre-order, have to wait until the
+ * post-order visit to return the error. There is a special case
+ * here, if there was nothing to stat then it's not an error to
+ * not be able to stat. This is all fairly nasty. If a program
+ * needed sorted entries or stat information, they had better be
+ * checking FTS_NS on the returned nodes.
+ */
+ cderrno = 0;
+ if (nlinks || type == BREAD) {
+ if (fts_safe_changedir(sp, cur, dirfd(dirp), NULL)) {
+ if (nlinks && type == BREAD)
+ cur->fts_errno = errno;
+ cur->fts_flags |= FTS_DONTCHDIR;
+ descend = 0;
+ cderrno = errno;
+ } else
+ descend = 1;
+ } else
+ descend = 0;
+
+ /*
+ * Figure out the max file name length that can be stored in the
+ * current path -- the inner loop allocates more path as necessary.
+ * We really wouldn't have to do the maxlen calculations here, we
+ * could do them in fts_read before returning the path, but it's a
+ * lot easier here since the length is part of the dirent structure.
+ *
+ * If not changing directories set a pointer so that can just append
+ * each new name into the path.
+ */
+ len = NAPPEND(cur);
+ if (ISSET(FTS_NOCHDIR)) {
+ cp = sp->fts_path + len;
+ *cp++ = '/';
+ }
+ len++;
+ maxlen = sp->fts_pathlen - len;
+
+#if defined(__FTS_COMPAT_LEVEL)
+ if (cur->fts_level == SHRT_MAX) {
+ (void)closedir(dirp);
+ cur->fts_info = FTS_ERR;
+ SET(FTS_STOP);
+ errno = ENAMETOOLONG;
+ return (NULL);
+ }
+#endif
+
+ level = cur->fts_level + 1;
+
+ /* Read the directory, attaching each entry to the `link' pointer. */
+ doadjust = 0;
+ for (head = tail = NULL, nitems = 0; (dp = readdir(dirp)) != NULL;) {
+
+ if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name))
+ continue;
+
+#if defined(HAVE_STRUCT_DIRENT_D_NAMLEN)
+ dnamlen = dp->d_namlen;
+#else
+ dnamlen = strlen(dp->d_name);
+#endif
+ if ((p = fts_alloc(sp, dp->d_name, dnamlen)) == NULL)
+ goto mem1;
+ if (dnamlen >= maxlen) { /* include space for NUL */
+ oldaddr = sp->fts_path;
+ if (fts_palloc(sp, dnamlen + len + 1)) {
+ /*
+ * No more memory for path or structures. Save
+ * errno, free up the current structure and the
+ * structures already allocated.
+ */
+mem1: saved_errno = errno;
+ if (p)
+ fts_free(p);
+ fts_lfree(head);
+ (void)closedir(dirp);
+ errno = saved_errno;
+ cur->fts_info = FTS_ERR;
+ SET(FTS_STOP);
+ return (NULL);
+ }
+ /* Did realloc() change the pointer? */
+ if (oldaddr != sp->fts_path) {
+ doadjust = 1;
+ if (ISSET(FTS_NOCHDIR))
+ cp = sp->fts_path + len;
+ }
+ maxlen = sp->fts_pathlen - len;
+ }
+
+#if defined(__FTS_COMPAT_LENGTH)
+ if (len + dnamlen >= USHRT_MAX) {
+ /*
+ * In an FTSENT, fts_pathlen is an unsigned short
+ * so it is possible to wraparound here.
+ * If we do, free up the current structure and the
+ * structures already allocated, then error out
+ * with ENAMETOOLONG.
+ */
+ fts_free(p);
+ fts_lfree(head);
+ (void)closedir(dirp);
+ cur->fts_info = FTS_ERR;
+ SET(FTS_STOP);
+ errno = ENAMETOOLONG;
+ return (NULL);
+ }
+#endif
+ p->fts_level = level;
+ p->fts_pathlen = ftsent_pathlen_truncate(len + dnamlen);
+ p->fts_parent = sp->fts_cur;
+
+#ifdef FTS_WHITEOUT
+ if (dp->d_type == DT_WHT)
+ p->fts_flags |= FTS_ISW;
+#endif
+
+ if (cderrno) {
+ if (nlinks) {
+ p->fts_info = FTS_NS;
+ p->fts_errno = cderrno;
+ } else
+ p->fts_info = FTS_NSOK;
+ p->fts_accpath = cur->fts_accpath;
+ } else if (nlinks == 0
+#ifdef DT_DIR
+ || (nostat &&
+ dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN)
+#endif
+ ) {
+ p->fts_accpath =
+ ISSET(FTS_NOCHDIR) ? p->fts_path : p->fts_name;
+ p->fts_info = FTS_NSOK;
+ } else {
+ /* Build a file name for fts_stat to stat. */
+ if (ISSET(FTS_NOCHDIR)) {
+ p->fts_accpath = p->fts_path;
+ memmove(cp, p->fts_name,
+ (size_t)(p->fts_namelen + 1));
+ } else
+ p->fts_accpath = p->fts_name;
+ /* Stat it. */
+ p->fts_info = fts_stat(sp, p, 0);
+
+ /* Decrement link count if applicable. */
+ if (nlinks > 0 && (p->fts_info == FTS_D ||
+ p->fts_info == FTS_DC || p->fts_info == FTS_DOT))
+ --nlinks;
+ }
+
+ /* We walk in directory order so "ls -f" doesn't get upset. */
+ p->fts_link = NULL;
+ if (head == NULL)
+ head = tail = p;
+ else {
+ tail->fts_link = p;
+ tail = p;
+ }
+ ++nitems;
+ }
+ (void)closedir(dirp);
+
+ /*
+ * If had to realloc the path, adjust the addresses for the rest
+ * of the tree.
+ */
+ if (doadjust)
+ fts_padjust(sp, head);
+
+ /*
+ * If not changing directories, reset the path back to original
+ * state.
+ */
+ if (ISSET(FTS_NOCHDIR)) {
+ if (len == sp->fts_pathlen || nitems == 0)
+ --cp;
+ *cp = '\0';
+ }
+
+ /*
+ * If descended after called from fts_children or after called from
+ * fts_read and nothing found, get back. At the root level we use
+ * the saved fd; if one of fts_open()'s arguments is a relative path
+ * to an empty directory, we wind up here with no other way back. If
+ * can't get back, we're done.
+ */
+ if (descend && (type == BCHILD || !nitems) &&
+ (cur->fts_level == FTS_ROOTLEVEL ?
+ FCHDIR(sp, sp->fts_rfd) :
+ fts_safe_changedir(sp, cur->fts_parent, -1, ".."))) {
+ cur->fts_info = FTS_ERR;
+ SET(FTS_STOP);
+ return (NULL);
+ }
+
+ /* If didn't find anything, return NULL. */
+ if (!nitems) {
+ if (type == BREAD)
+ cur->fts_info = FTS_DP;
+ return (NULL);
+ }
+
+ /* Sort the entries. */
+ if (sp->fts_compar && nitems > 1)
+ head = fts_sort(sp, head, nitems);
+ return (head);
+}
+
+static unsigned short
+fts_stat(FTS *sp, FTSENT *p, int follow)
+{
+ FTSENT *t;
+ dev_t dev;
+ ino_t ino;
+ struct stat *sbp, sb;
+ int saved_errno;
+
+ _DIAGASSERT(sp != NULL);
+ _DIAGASSERT(p != NULL);
+
+ /* If user needs stat info, stat buffer already allocated. */
+ sbp = ISSET(FTS_NOSTAT) ? &sb : p->fts_statp;
+
+#ifdef FTS_WHITEOUT
+ /* check for whiteout */
+ if (p->fts_flags & FTS_ISW) {
+ if (sbp != &sb) {
+ memset(sbp, '\0', sizeof (*sbp));
+ sbp->st_mode = S_IFWHT;
+ }
+ return (FTS_W);
+ }
+#endif
+
+ /*
+ * If doing a logical walk, or application requested FTS_FOLLOW, do
+ * a stat(2). If that fails, check for a non-existent symlink. If
+ * fail, set the errno from the stat call.
+ */
+ if (ISSET(FTS_LOGICAL) || follow) {
+ if (stat(p->fts_accpath, sbp)) {
+ saved_errno = errno;
+ if (!lstat(p->fts_accpath, sbp)) {
+ errno = 0;
+ return (FTS_SLNONE);
+ }
+ p->fts_errno = saved_errno;
+ goto err;
+ }
+ } else if (lstat(p->fts_accpath, sbp)) {
+ p->fts_errno = errno;
+err: memset(sbp, 0, sizeof(*sbp));
+ return (FTS_NS);
+ }
+
+ if (S_ISDIR(sbp->st_mode)) {
+ /*
+ * Set the device/inode. Used to find cycles and check for
+ * crossing mount points. Also remember the link count, used
+ * in fts_build to limit the number of stat calls. It is
+ * understood that these fields are only referenced if fts_info
+ * is set to FTS_D.
+ */
+ dev = p->fts_dev = sbp->st_dev;
+ ino = p->fts_ino = sbp->st_ino;
+ p->fts_nlink = sbp->st_nlink;
+
+ if (ISDOT(p->fts_name))
+ return (FTS_DOT);
+
+ /*
+ * Cycle detection is done by brute force when the directory
+ * is first encountered. If the tree gets deep enough or the
+ * number of symbolic links to directories is high enough,
+ * something faster might be worthwhile.
+ */
+ for (t = p->fts_parent;
+ t->fts_level >= FTS_ROOTLEVEL; t = t->fts_parent)
+ if (ino == t->fts_ino && dev == t->fts_dev) {
+ p->fts_cycle = t;
+ return (FTS_DC);
+ }
+ return (FTS_D);
+ }
+ if (S_ISLNK(sbp->st_mode))
+ return (FTS_SL);
+ if (S_ISREG(sbp->st_mode))
+ return (FTS_F);
+ return (FTS_DEFAULT);
+}
+
+static FTSENT *
+fts_sort(FTS *sp, FTSENT *head, size_t nitems)
+{
+ FTSENT **ap, *p;
+
+ _DIAGASSERT(sp != NULL);
+ _DIAGASSERT(head != NULL);
+
+ /*
+ * Construct an array of pointers to the structures and call qsort(3).
+ * Reassemble the array in the order returned by qsort. If unable to
+ * sort for memory reasons, return the directory entries in their
+ * current order. Allocate enough space for the current needs plus
+ * 40 so don't realloc one entry at a time.
+ */
+ if (nitems > sp->fts_nitems) {
+ FTSENT **new;
+
+ new = realloc(sp->fts_array, sizeof(FTSENT *) * (nitems + 40));
+ if (new == 0)
+ return (head);
+ sp->fts_array = new;
+ sp->fts_nitems = fts_nitems_truncate(nitems + 40);
+ }
+ for (ap = sp->fts_array, p = head; p; p = p->fts_link)
+ *ap++ = p;
+ qsort((void *)sp->fts_array, nitems, sizeof(FTSENT *),
+ (int (*)(const void *, const void *))sp->fts_compar);
+ for (head = *(ap = sp->fts_array); --nitems; ++ap)
+ ap[0]->fts_link = ap[1];
+ ap[0]->fts_link = NULL;
+ return (head);
+}
+
+static FTSENT *
+fts_alloc(FTS *sp, const char *name, size_t namelen)
+{
+ FTSENT *p;
+#if defined(FTS_ALLOC_ALIGNED)
+ size_t len;
+#endif
+
+ _DIAGASSERT(sp != NULL);
+ _DIAGASSERT(name != NULL);
+
+#if defined(FTS_ALLOC_ALIGNED)
+ /*
+ * The file name is a variable length array and no stat structure is
+ * necessary if the user has set the nostat bit. Allocate the FTSENT
+ * structure, the file name and the stat structure in one chunk, but
+ * be careful that the stat structure is reasonably aligned. Since the
+ * fts_name field is declared to be of size 1, the fts_name pointer is
+ * namelen + 2 before the first possible address of the stat structure.
+ */
+ len = sizeof(FTSENT) + namelen;
+ if (!ISSET(FTS_NOSTAT))
+ len += sizeof(*(p->fts_statp)) + ALIGNBYTES;
+ if ((p = malloc(len)) == NULL)
+ return (NULL);
+
+ if (!ISSET(FTS_NOSTAT))
+ p->fts_statp = (struct stat *)ALIGN(
+ (unsigned long)(p->fts_name + namelen + 2));
+#else
+ if ((p = malloc(sizeof(FTSENT) + namelen)) == NULL)
+ return (NULL);
+
+ if (!ISSET(FTS_NOSTAT))
+ if ((p->fts_statp = malloc(sizeof(*(p->fts_statp)))) == NULL) {
+ free(p);
+ return (NULL);
+ }
+#endif
+
+ if (ISSET(FTS_NOSTAT))
+ p->fts_statp = NULL;
+
+ /* Copy the name plus the trailing NULL. */
+ memmove(p->fts_name, name, namelen + 1);
+
+ p->fts_namelen = ftsent_namelen_truncate(namelen);
+ p->fts_path = sp->fts_path;
+ p->fts_errno = 0;
+ p->fts_flags = 0;
+ p->fts_instr = FTS_NOINSTR;
+ p->fts_number = 0;
+ p->fts_pointer = NULL;
+ return (p);
+}
+
+static void
+fts_free(FTSENT *p)
+{
+#if !defined(FTS_ALLOC_ALIGNED)
+ if (p->fts_statp)
+ free(p->fts_statp);
+#endif
+ free(p);
+}
+
+static void
+fts_lfree(FTSENT *head)
+{
+ FTSENT *p;
+
+ /* XXX: head may be NULL ? */
+
+ /* Free a linked list of structures. */
+ while ((p = head) != NULL) {
+ head = head->fts_link;
+ fts_free(p);
+ }
+}
+
+static size_t
+fts_pow2(size_t x)
+{
+
+ x--;
+ x |= x>>1;
+ x |= x>>2;
+ x |= x>>4;
+ x |= x>>8;
+ x |= x>>16;
+#if LONG_BIT > 32
+ x |= x>>32;
+#endif
+#if LONG_BIT > 64
+ x |= x>>64;
+#endif
+ x++;
+ return (x);
+}
+
+/*
+ * Allow essentially unlimited paths; find, rm, ls should all work on any tree.
+ * Most systems will allow creation of paths much longer than MAXPATHLEN, even
+ * though the kernel won't resolve them. Round up the new size to a power of 2,
+ * so we don't realloc the path 2 bytes at a time.
+ */
+static int
+fts_palloc(FTS *sp, size_t size)
+{
+ char *new;
+
+ _DIAGASSERT(sp != NULL);
+
+#ifdef __FTS_COMPAT_LENGTH
+ /* Protect against fts_pathlen overflow. */
+ if (size > USHRT_MAX + 1) {
+ errno = ENAMETOOLONG;
+ return (1);
+ }
+#endif
+ size = fts_pow2(size);
+ new = realloc(sp->fts_path, size);
+ if (new == 0)
+ return (1);
+ sp->fts_path = new;
+ sp->fts_pathlen = fts_pathlen_truncate(size);
+ return (0);
+}
+
+/*
+ * When the path is realloc'd, have to fix all of the pointers in structures
+ * already returned.
+ */
+static void
+fts_padjust(FTS *sp, FTSENT *head)
+{
+ FTSENT *p;
+ char *addr;
+
+ _DIAGASSERT(sp != NULL);
+
+#define ADJUST(p) do { \
+ if ((p)->fts_accpath != (p)->fts_name) \
+ (p)->fts_accpath = \
+ addr + ((p)->fts_accpath - (p)->fts_path); \
+ (p)->fts_path = addr; \
+} while (/*CONSTCOND*/0)
+
+ addr = sp->fts_path;
+
+ /* Adjust the current set of children. */
+ for (p = sp->fts_child; p; p = p->fts_link)
+ ADJUST(p);
+
+ /* Adjust the rest of the tree, including the current level. */
+ for (p = head; p->fts_level >= FTS_ROOTLEVEL;) {
+ ADJUST(p);
+ p = p->fts_link ? p->fts_link : p->fts_parent;
+ }
+}
+
+static size_t
+fts_maxarglen(char * const *argv)
+{
+ size_t len, max;
+
+ _DIAGASSERT(argv != NULL);
+
+ for (max = 0; *argv; ++argv)
+ if ((len = strlen(*argv)) > max)
+ max = len;
+ return (max + 1);
+}
+
+/*
+ * Change to dir specified by fd or p->fts_accpath without getting
+ * tricked by someone changing the world out from underneath us.
+ * Assumes p->fts_dev and p->fts_ino are filled in.
+ */
+static int
+fts_safe_changedir(const FTS *sp, const FTSENT *p, int fd, const char *path)
+{
+ int oldfd = fd, ret = -1;
+ struct stat sb;
+
+ if (ISSET(FTS_NOCHDIR))
+ return 0;
+
+ if (oldfd < 0 && (fd = open(path, O_RDONLY)) == -1)
+ return -1;
+
+ if (fstat(fd, &sb) == -1)
+ goto bail;
+
+ if (sb.st_ino != p->fts_ino || sb.st_dev != p->fts_dev) {
+ errno = ENOENT;
+ goto bail;
+ }
+
+ ret = fchdir(fd);
+
+bail:
+ if (oldfd < 0) {
+ int save_errno = errno;
+ (void)close(fd);
+ errno = save_errno;
+ }
+ return ret;
+}
diff --git a/extension/gawkfts.h b/extension/gawkfts.h
new file mode 100644
index 00000000..f1ca26f5
--- /dev/null
+++ b/extension/gawkfts.h
@@ -0,0 +1,157 @@
+/* $NetBSD: fts.h,v 1.19 2009/08/16 19:33:38 christos Exp $ */
+
+/*
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)fts.h 8.3 (Berkeley) 8/14/94
+ */
+
+#ifndef _FTS_H_
+#define _FTS_H_
+
+#ifndef __THROW
+# ifndef __GNUC_PREREQ
+# define __GNUC_PREREQ(maj, min) (0)
+# endif
+# if defined __cplusplus && __GNUC_PREREQ (2,8)
+# define __THROW throw ()
+# else
+# define __THROW
+# endif
+#endif
+
+#ifdef ZOS_USS
+#include <limits.h>
+#define MAXPATHLEN FILENAME_MAX
+#endif
+
+typedef struct {
+ struct _ftsent *fts_cur; /* current node */
+ struct _ftsent *fts_child; /* linked list of children */
+ struct _ftsent **fts_array; /* sort array */
+ dev_t fts_dev; /* starting device # */
+ char *fts_path; /* path for this descent */
+ int fts_rfd; /* fd for root */
+ unsigned int fts_pathlen; /* sizeof(path) */
+ unsigned int fts_nitems; /* elements in the sort array */
+ int (*fts_compar) /* compare function */
+ (const struct _ftsent **, const struct _ftsent **);
+
+#define FTS_COMFOLLOW 0x001 /* follow command line symlinks */
+#define FTS_LOGICAL 0x002 /* logical walk */
+#define FTS_NOCHDIR 0x004 /* don't change directories */
+#define FTS_NOSTAT 0x008 /* don't get stat info */
+#define FTS_PHYSICAL 0x010 /* physical walk */
+#define FTS_SEEDOT 0x020 /* return dot and dot-dot */
+#define FTS_XDEV 0x040 /* don't cross devices */
+/* #define FTS_WHITEOUT 0x080 */ /* return whiteout information */
+#define FTS_OPTIONMASK 0x0ff /* valid user option mask */
+
+#define FTS_NAMEONLY 0x100 /* (private) child names only */
+#define FTS_STOP 0x200 /* (private) unrecoverable error */
+ int fts_options; /* fts_open options, global flags */
+} FTS;
+
+typedef struct _ftsent {
+ struct _ftsent *fts_cycle; /* cycle node */
+ struct _ftsent *fts_parent; /* parent directory */
+ struct _ftsent *fts_link; /* next file in directory */
+#ifdef ZOS_USS
+ long fts_number; /* local numeric value */
+#else
+ long long fts_number; /* local numeric value */
+#endif
+ void *fts_pointer; /* local address value */
+ char *fts_accpath; /* access path */
+ char *fts_path; /* root path */
+ int fts_errno; /* errno for this node */
+ int fts_symfd; /* fd for symlink */
+ unsigned int fts_pathlen; /* strlen(fts_path) */
+ unsigned int fts_namelen; /* strlen(fts_name) */
+
+ ino_t fts_ino; /* inode */
+ dev_t fts_dev; /* device */
+ unsigned int fts_nlink; /* link count */
+
+#define FTS_ROOTPARENTLEVEL -1
+#define FTS_ROOTLEVEL 0
+ int fts_level; /* depth (-1 to N) */
+
+#define FTS_D 1 /* preorder directory */
+#define FTS_DC 2 /* directory that causes cycles */
+#define FTS_DEFAULT 3 /* none of the above */
+#define FTS_DNR 4 /* unreadable directory */
+#define FTS_DOT 5 /* dot or dot-dot */
+#define FTS_DP 6 /* postorder directory */
+#define FTS_ERR 7 /* error; errno is set */
+#define FTS_F 8 /* regular file */
+#define FTS_INIT 9 /* initialized only */
+#define FTS_NS 10 /* stat(2) failed */
+#define FTS_NSOK 11 /* no stat(2) requested */
+#define FTS_SL 12 /* symbolic link */
+#define FTS_SLNONE 13 /* symbolic link without target */
+#define FTS_W 14 /* whiteout object */
+ unsigned short fts_info; /* user flags for FTSENT structure */
+
+#define FTS_DONTCHDIR 0x01 /* don't chdir .. to the parent */
+#define FTS_SYMFOLLOW 0x02 /* followed a symlink to get here */
+#define FTS_ISW 0x04 /* this is a whiteout object */
+ unsigned short fts_flags; /* private flags for FTSENT structure */
+
+#define FTS_AGAIN 1 /* read node again */
+#define FTS_FOLLOW 2 /* follow symbolic link */
+#define FTS_NOINSTR 3 /* no instructions */
+#define FTS_SKIP 4 /* discard node */
+ unsigned short fts_instr; /* fts_set() instructions */
+
+ struct stat *fts_statp; /* stat(2) information */
+ char fts_name[1]; /* file name */
+} FTSENT;
+
+/*
+ * Due to the wonders of modern linkers, shared libraries,
+ * compilers and other deep, dark, black magic voodoo, we
+ * redefined the identifiers so our code will use our version
+ * of these routines. See README.fts for a little bit more
+ * information and a lot more ranting.
+ */
+
+#define fts_children gawk_fts_children
+#define fts_close gawk_fts_close
+#define fts_open gawk_fts_open
+#define fts_read gawk_fts_read
+#define fts_set gawk_fts_set
+
+FTSENT *fts_children (FTS *, int);
+int fts_close (FTS *);
+FTS *fts_open (char * const *, int,
+ int (*)(const FTSENT **, const FTSENT **));
+FTSENT *fts_read (FTS *);
+int fts_set (FTS *, FTSENT *, int) __THROW;
+
+#endif /* !_FTS_H_ */
diff --git a/extension/m4/ChangeLog b/extension/m4/ChangeLog
new file mode 100644
index 00000000..c1223391
--- /dev/null
+++ b/extension/m4/ChangeLog
@@ -0,0 +1,13 @@
+2012-08-24 Arnold D. Robbins <arnold@skeeve.com>
+
+ * intlmacosx.m4: New file.
+
+2012-07-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gettext.m4, iconv.m4, lib-ld.m4, lib-link.m4, lib-prefix.m4,
+ nls.m4, po.m4, progtest.m4: New files for gettext support.
+
+2012-05-21 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * libtool.m4, ltoptions.m4, ltsugar.m4, ltversion.m4, lt~obsolete.m4:
+ New files to support libtool.
diff --git a/extension/m4/gettext.m4 b/extension/m4/gettext.m4
new file mode 100644
index 00000000..f84e6a5d
--- /dev/null
+++ b/extension/m4/gettext.m4
@@ -0,0 +1,383 @@
+# gettext.m4 serial 63 (gettext-0.18)
+dnl Copyright (C) 1995-2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010.
+
+dnl Macro to add for using GNU gettext.
+
+dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
+dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
+dnl default (if it is not specified or empty) is 'no-libtool'.
+dnl INTLSYMBOL should be 'external' for packages with no intl directory,
+dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
+dnl If INTLSYMBOL is 'use-libtool', then a libtool library
+dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
+dnl depending on --{enable,disable}-{shared,static} and on the presence of
+dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
+dnl $(top_builddir)/intl/libintl.a will be created.
+dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
+dnl implementations (in libc or libintl) without the ngettext() function
+dnl will be ignored. If NEEDSYMBOL is specified and is
+dnl 'need-formatstring-macros', then GNU gettext implementations that don't
+dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
+dnl INTLDIR is used to find the intl libraries. If empty,
+dnl the value `$(top_builddir)/intl/' is used.
+dnl
+dnl The result of the configuration is one of three cases:
+dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
+dnl and used.
+dnl Catalog format: GNU --> install in $(datadir)
+dnl Catalog extension: .mo after installation, .gmo in source tree
+dnl 2) GNU gettext has been found in the system's C library.
+dnl Catalog format: GNU --> install in $(datadir)
+dnl Catalog extension: .mo after installation, .gmo in source tree
+dnl 3) No internationalization, always use English msgid.
+dnl Catalog format: none
+dnl Catalog extension: none
+dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
+dnl The use of .gmo is historical (it was needed to avoid overwriting the
+dnl GNU format catalogs when building on a platform with an X/Open gettext),
+dnl but we keep it in order not to force irrelevant filename changes on the
+dnl maintainers.
+dnl
+AC_DEFUN([AM_GNU_GETTEXT],
+[
+ dnl Argument checking.
+ ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
+ [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
+])])])])])
+ ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old],
+ [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])])
+ ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
+ [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
+])])])])
+ define([gt_included_intl],
+ ifelse([$1], [external],
+ ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
+ [yes]))
+ define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
+ gt_NEEDS_INIT
+ AM_GNU_GETTEXT_NEED([$2])
+
+ AC_REQUIRE([AM_PO_SUBDIRS])dnl
+ ifelse(gt_included_intl, yes, [
+ AC_REQUIRE([AM_INTL_SUBDIR])dnl
+ ])
+
+ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+
+ dnl Sometimes libintl requires libiconv, so first search for libiconv.
+ dnl Ideally we would do this search only after the
+ dnl if test "$USE_NLS" = "yes"; then
+ dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
+ dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
+ dnl the configure script would need to contain the same shell code
+ dnl again, outside any 'if'. There are two solutions:
+ dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
+ dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
+ dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
+ dnl documented, we avoid it.
+ ifelse(gt_included_intl, yes, , [
+ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
+ ])
+
+ dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
+ gt_INTL_MACOSX
+
+ dnl Set USE_NLS.
+ AC_REQUIRE([AM_NLS])
+
+ ifelse(gt_included_intl, yes, [
+ BUILD_INCLUDED_LIBINTL=no
+ USE_INCLUDED_LIBINTL=no
+ ])
+ LIBINTL=
+ LTLIBINTL=
+ POSUB=
+
+ dnl Add a version number to the cache macros.
+ case " $gt_needs " in
+ *" need-formatstring-macros "*) gt_api_version=3 ;;
+ *" need-ngettext "*) gt_api_version=2 ;;
+ *) gt_api_version=1 ;;
+ esac
+ gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
+ gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
+
+ dnl If we use NLS figure out what method
+ if test "$USE_NLS" = "yes"; then
+ gt_use_preinstalled_gnugettext=no
+ ifelse(gt_included_intl, yes, [
+ AC_MSG_CHECKING([whether included gettext is requested])
+ AC_ARG_WITH([included-gettext],
+ [ --with-included-gettext use the GNU gettext library included here],
+ nls_cv_force_use_gnu_gettext=$withval,
+ nls_cv_force_use_gnu_gettext=no)
+ AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext])
+
+ nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
+ if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
+ ])
+ dnl User does not insist on using GNU NLS library. Figure out what
+ dnl to use. If GNU gettext is available we use this. Else we have
+ dnl to fall back to GNU NLS library.
+
+ if test $gt_api_version -ge 3; then
+ gt_revision_test_code='
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+changequote(,)dnl
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+changequote([,])dnl
+'
+ else
+ gt_revision_test_code=
+ fi
+ if test $gt_api_version -ge 2; then
+ gt_expression_test_code=' + * ngettext ("", "", 0)'
+ else
+ gt_expression_test_code=
+ fi
+
+ AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
+ [AC_TRY_LINK([#include <libintl.h>
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
+extern int *_nl_domain_bindings;],
+ [bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings],
+ [eval "$gt_func_gnugettext_libc=yes"],
+ [eval "$gt_func_gnugettext_libc=no"])])
+
+ if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
+ dnl Sometimes libintl requires libiconv, so first search for libiconv.
+ ifelse(gt_included_intl, yes, , [
+ AM_ICONV_LINK
+ ])
+ dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
+ dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
+ dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
+ dnl even if libiconv doesn't exist.
+ AC_LIB_LINKFLAGS_BODY([intl])
+ AC_CACHE_CHECK([for GNU gettext in libintl],
+ [$gt_func_gnugettext_libintl],
+ [gt_save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $INCINTL"
+ gt_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBINTL"
+ dnl Now see whether libintl exists and does not depend on libiconv.
+ AC_TRY_LINK([#include <libintl.h>
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias (const char *);],
+ [bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
+ [eval "$gt_func_gnugettext_libintl=yes"],
+ [eval "$gt_func_gnugettext_libintl=no"])
+ dnl Now see whether libintl exists and depends on libiconv.
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
+ LIBS="$LIBS $LIBICONV"
+ AC_TRY_LINK([#include <libintl.h>
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias (const char *);],
+ [bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
+ [LIBINTL="$LIBINTL $LIBICONV"
+ LTLIBINTL="$LTLIBINTL $LTLIBICONV"
+ eval "$gt_func_gnugettext_libintl=yes"
+ ])
+ fi
+ CPPFLAGS="$gt_save_CPPFLAGS"
+ LIBS="$gt_save_LIBS"])
+ fi
+
+ dnl If an already present or preinstalled GNU gettext() is found,
+ dnl use it. But if this macro is used in GNU gettext, and GNU
+ dnl gettext is already preinstalled in libintl, we update this
+ dnl libintl. (Cf. the install rule in intl/Makefile.in.)
+ if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
+ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
+ && test "$PACKAGE" != gettext-runtime \
+ && test "$PACKAGE" != gettext-tools; }; then
+ gt_use_preinstalled_gnugettext=yes
+ else
+ dnl Reset the values set by searching for libintl.
+ LIBINTL=
+ LTLIBINTL=
+ INCINTL=
+ fi
+
+ ifelse(gt_included_intl, yes, [
+ if test "$gt_use_preinstalled_gnugettext" != "yes"; then
+ dnl GNU gettext is not found in the C library.
+ dnl Fall back on included GNU gettext library.
+ nls_cv_use_gnu_gettext=yes
+ fi
+ fi
+
+ if test "$nls_cv_use_gnu_gettext" = "yes"; then
+ dnl Mark actions used to generate GNU NLS library.
+ BUILD_INCLUDED_LIBINTL=yes
+ USE_INCLUDED_LIBINTL=yes
+ LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
+ LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
+ LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
+ fi
+
+ CATOBJEXT=
+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
+ dnl Mark actions to use GNU gettext tools.
+ CATOBJEXT=.gmo
+ fi
+ ])
+
+ if test -n "$INTL_MACOSX_LIBS"; then
+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
+ dnl Some extra flags are needed during linking.
+ LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
+ LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
+ fi
+ fi
+
+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
+ AC_DEFINE([ENABLE_NLS], [1],
+ [Define to 1 if translation of program messages to the user's native language
+ is requested.])
+ else
+ USE_NLS=no
+ fi
+ fi
+
+ AC_MSG_CHECKING([whether to use NLS])
+ AC_MSG_RESULT([$USE_NLS])
+ if test "$USE_NLS" = "yes"; then
+ AC_MSG_CHECKING([where the gettext function comes from])
+ if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
+ gt_source="external libintl"
+ else
+ gt_source="libc"
+ fi
+ else
+ gt_source="included intl directory"
+ fi
+ AC_MSG_RESULT([$gt_source])
+ fi
+
+ if test "$USE_NLS" = "yes"; then
+
+ if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
+ AC_MSG_CHECKING([how to link with libintl])
+ AC_MSG_RESULT([$LIBINTL])
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
+ fi
+
+ dnl For backward compatibility. Some packages may be using this.
+ AC_DEFINE([HAVE_GETTEXT], [1],
+ [Define if the GNU gettext() function is already present or preinstalled.])
+ AC_DEFINE([HAVE_DCGETTEXT], [1],
+ [Define if the GNU dcgettext() function is already present or preinstalled.])
+ fi
+
+ dnl We need to process the po/ directory.
+ POSUB=po
+ fi
+
+ ifelse(gt_included_intl, yes, [
+ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
+ dnl to 'yes' because some of the testsuite requires it.
+ if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
+ BUILD_INCLUDED_LIBINTL=yes
+ fi
+
+ dnl Make all variables we use known to autoconf.
+ AC_SUBST([BUILD_INCLUDED_LIBINTL])
+ AC_SUBST([USE_INCLUDED_LIBINTL])
+ AC_SUBST([CATOBJEXT])
+
+ dnl For backward compatibility. Some configure.ins may be using this.
+ nls_cv_header_intl=
+ nls_cv_header_libgt=
+
+ dnl For backward compatibility. Some Makefiles may be using this.
+ DATADIRNAME=share
+ AC_SUBST([DATADIRNAME])
+
+ dnl For backward compatibility. Some Makefiles may be using this.
+ INSTOBJEXT=.mo
+ AC_SUBST([INSTOBJEXT])
+
+ dnl For backward compatibility. Some Makefiles may be using this.
+ GENCAT=gencat
+ AC_SUBST([GENCAT])
+
+ dnl For backward compatibility. Some Makefiles may be using this.
+ INTLOBJS=
+ if test "$USE_INCLUDED_LIBINTL" = yes; then
+ INTLOBJS="\$(GETTOBJS)"
+ fi
+ AC_SUBST([INTLOBJS])
+
+ dnl Enable libtool support if the surrounding package wishes it.
+ INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
+ AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX])
+ ])
+
+ dnl For backward compatibility. Some Makefiles may be using this.
+ INTLLIBS="$LIBINTL"
+ AC_SUBST([INTLLIBS])
+
+ dnl Make all documented variables known to autoconf.
+ AC_SUBST([LIBINTL])
+ AC_SUBST([LTLIBINTL])
+ AC_SUBST([POSUB])
+])
+
+
+dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
+m4_define([gt_NEEDS_INIT],
+[
+ m4_divert_text([DEFAULTS], [gt_needs=])
+ m4_define([gt_NEEDS_INIT], [])
+])
+
+
+dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
+AC_DEFUN([AM_GNU_GETTEXT_NEED],
+[
+ m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
+])
+
+
+dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
+AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
diff --git a/extension/m4/iconv.m4 b/extension/m4/iconv.m4
new file mode 100644
index 00000000..e2041b9b
--- /dev/null
+++ b/extension/m4/iconv.m4
@@ -0,0 +1,214 @@
+# iconv.m4 serial 11 (gettext-0.18.1)
+dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
+[
+ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+
+ dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
+ dnl accordingly.
+ AC_LIB_LINKFLAGS_BODY([iconv])
+])
+
+AC_DEFUN([AM_ICONV_LINK],
+[
+ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
+ dnl those with the standalone portable GNU libiconv installed).
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
+ dnl accordingly.
+ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
+
+ dnl Add $INCICONV to CPPFLAGS before performing the following checks,
+ dnl because if the user has installed libiconv and not disabled its use
+ dnl via --without-libiconv-prefix, he wants to use it. The first
+ dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
+ am_save_CPPFLAGS="$CPPFLAGS"
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
+
+ AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
+ am_cv_func_iconv="no, consider installing GNU libiconv"
+ am_cv_lib_iconv=no
+ AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+ [iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);],
+ [am_cv_func_iconv=yes])
+ if test "$am_cv_func_iconv" != yes; then
+ am_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBICONV"
+ AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+ [iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);],
+ [am_cv_lib_iconv=yes]
+ [am_cv_func_iconv=yes])
+ LIBS="$am_save_LIBS"
+ fi
+ ])
+ if test "$am_cv_func_iconv" = yes; then
+ AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
+ dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10.
+ am_save_LIBS="$LIBS"
+ if test $am_cv_lib_iconv = yes; then
+ LIBS="$LIBS $LIBICONV"
+ fi
+ AC_TRY_RUN([
+#include <iconv.h>
+#include <string.h>
+int main ()
+{
+ /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
+ returns. */
+ {
+ iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
+ if (cd_utf8_to_88591 != (iconv_t)(-1))
+ {
+ static const char input[] = "\342\202\254"; /* EURO SIGN */
+ char buf[10];
+ const char *inptr = input;
+ size_t inbytesleft = strlen (input);
+ char *outptr = buf;
+ size_t outbytesleft = sizeof (buf);
+ size_t res = iconv (cd_utf8_to_88591,
+ (char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if (res == 0)
+ return 1;
+ }
+ }
+ /* Test against Solaris 10 bug: Failures are not distinguishable from
+ successful returns. */
+ {
+ iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
+ if (cd_ascii_to_88591 != (iconv_t)(-1))
+ {
+ static const char input[] = "\263";
+ char buf[10];
+ const char *inptr = input;
+ size_t inbytesleft = strlen (input);
+ char *outptr = buf;
+ size_t outbytesleft = sizeof (buf);
+ size_t res = iconv (cd_ascii_to_88591,
+ (char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if (res == 0)
+ return 1;
+ }
+ }
+#if 0 /* This bug could be worked around by the caller. */
+ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
+ {
+ iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
+ if (cd_88591_to_utf8 != (iconv_t)(-1))
+ {
+ static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+ char buf[50];
+ const char *inptr = input;
+ size_t inbytesleft = strlen (input);
+ char *outptr = buf;
+ size_t outbytesleft = sizeof (buf);
+ size_t res = iconv (cd_88591_to_utf8,
+ (char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if ((int)res > 0)
+ return 1;
+ }
+ }
+#endif
+ /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
+ provided. */
+ if (/* Try standardized names. */
+ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
+ /* Try IRIX, OSF/1 names. */
+ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
+ /* Try AIX names. */
+ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
+ /* Try HP-UX names. */
+ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
+ return 1;
+ return 0;
+}], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no],
+ [case "$host_os" in
+ aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
+ *) am_cv_func_iconv_works="guessing yes" ;;
+ esac])
+ LIBS="$am_save_LIBS"
+ ])
+ case "$am_cv_func_iconv_works" in
+ *no) am_func_iconv=no am_cv_lib_iconv=no ;;
+ *) am_func_iconv=yes ;;
+ esac
+ else
+ am_func_iconv=no am_cv_lib_iconv=no
+ fi
+ if test "$am_func_iconv" = yes; then
+ AC_DEFINE([HAVE_ICONV], [1],
+ [Define if you have the iconv() function and it works.])
+ fi
+ if test "$am_cv_lib_iconv" = yes; then
+ AC_MSG_CHECKING([how to link with libiconv])
+ AC_MSG_RESULT([$LIBICONV])
+ else
+ dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
+ dnl either.
+ CPPFLAGS="$am_save_CPPFLAGS"
+ LIBICONV=
+ LTLIBICONV=
+ fi
+ AC_SUBST([LIBICONV])
+ AC_SUBST([LTLIBICONV])
+])
+
+dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
+dnl avoid warnings like
+dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
+dnl This is tricky because of the way 'aclocal' is implemented:
+dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
+dnl Otherwise aclocal's initial scan pass would miss the macro definition.
+dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
+dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
+dnl warnings.
+m4_define([gl_iconv_AC_DEFUN],
+ m4_version_prereq([2.64],
+ [[AC_DEFUN_ONCE(
+ [$1], [$2])]],
+ [[AC_DEFUN(
+ [$1], [$2])]]))
+gl_iconv_AC_DEFUN([AM_ICONV],
+[
+ AM_ICONV_LINK
+ if test "$am_cv_func_iconv" = yes; then
+ AC_MSG_CHECKING([for iconv declaration])
+ AC_CACHE_VAL([am_cv_proto_iconv], [
+ AC_TRY_COMPILE([
+#include <stdlib.h>
+#include <iconv.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+#if defined(__STDC__) || defined(__cplusplus)
+size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
+#else
+size_t iconv();
+#endif
+], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"])
+ am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
+ am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
+ AC_MSG_RESULT([
+ $am_cv_proto_iconv])
+ AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
+ [Define as const if the declaration of iconv() needs const.])
+ fi
+])
diff --git a/extension/m4/intlmacosx.m4 b/extension/m4/intlmacosx.m4
new file mode 100644
index 00000000..dd910259
--- /dev/null
+++ b/extension/m4/intlmacosx.m4
@@ -0,0 +1,51 @@
+# intlmacosx.m4 serial 3 (gettext-0.18)
+dnl Copyright (C) 2004-2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Checks for special options needed on MacOS X.
+dnl Defines INTL_MACOSX_LIBS.
+AC_DEFUN([gt_INTL_MACOSX],
+[
+ dnl Check for API introduced in MacOS X 10.2.
+ AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
+ [gt_cv_func_CFPreferencesCopyAppValue],
+ [gt_save_LIBS="$LIBS"
+ LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+ AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
+ [CFPreferencesCopyAppValue(NULL, NULL)],
+ [gt_cv_func_CFPreferencesCopyAppValue=yes],
+ [gt_cv_func_CFPreferencesCopyAppValue=no])
+ LIBS="$gt_save_LIBS"])
+ if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
+ AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
+ [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
+ fi
+ dnl Check for API introduced in MacOS X 10.3.
+ AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
+ [gt_save_LIBS="$LIBS"
+ LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+ AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
+ [gt_cv_func_CFLocaleCopyCurrent=yes],
+ [gt_cv_func_CFLocaleCopyCurrent=no])
+ LIBS="$gt_save_LIBS"])
+ if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
+ AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
+ [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
+ fi
+ INTL_MACOSX_LIBS=
+ if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
+ INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
+ fi
+ AC_SUBST([INTL_MACOSX_LIBS])
+])
diff --git a/extension/m4/lib-ld.m4 b/extension/m4/lib-ld.m4
new file mode 100644
index 00000000..ebb30528
--- /dev/null
+++ b/extension/m4/lib-ld.m4
@@ -0,0 +1,110 @@
+# lib-ld.m4 serial 4 (gettext-0.18)
+dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Subroutines of libtool.m4,
+dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
+dnl with libtool.m4.
+
+dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
+AC_DEFUN([AC_LIB_PROG_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ acl_cv_prog_gnu_ld=yes ;;
+*)
+ acl_cv_prog_gnu_ld=no ;;
+esac])
+with_gnu_ld=$acl_cv_prog_gnu_ld
+])
+
+dnl From libtool-1.4. Sets the variable LD.
+AC_DEFUN([AC_LIB_PROG_LD],
+[AC_ARG_WITH([gnu-ld],
+[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
+test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by GCC])
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [[\\/]* | [A-Za-z]:[\\/]*)]
+ [re_direlt='/[^/][^/]*/\.\./']
+ # Canonicalize the path of ld
+ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL([acl_cv_path_LD],
+[if test -z "$LD"; then
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ acl_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break ;;
+ *)
+ test "$with_gnu_ld" != yes && break ;;
+ esac
+ fi
+ done
+ IFS="$ac_save_ifs"
+else
+ acl_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$acl_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT([$LD])
+else
+ AC_MSG_RESULT([no])
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_LIB_PROG_LD_GNU
+])
diff --git a/extension/m4/lib-link.m4 b/extension/m4/lib-link.m4
new file mode 100644
index 00000000..c73bd8e3
--- /dev/null
+++ b/extension/m4/lib-link.m4
@@ -0,0 +1,774 @@
+# lib-link.m4 serial 21 (gettext-0.18)
+dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_PREREQ([2.54])
+
+dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
+dnl the libraries corresponding to explicit and implicit dependencies.
+dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
+dnl augments the CPPFLAGS variable.
+dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
+dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
+AC_DEFUN([AC_LIB_LINKFLAGS],
+[
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+ pushdef([Name],[translit([$1],[./-], [___])])
+ pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+ AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
+ AC_LIB_LINKFLAGS_BODY([$1], [$2])
+ ac_cv_lib[]Name[]_libs="$LIB[]NAME"
+ ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
+ ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
+ ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
+ ])
+ LIB[]NAME="$ac_cv_lib[]Name[]_libs"
+ LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
+ INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
+ LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+ AC_SUBST([LIB]NAME)
+ AC_SUBST([LTLIB]NAME)
+ AC_SUBST([LIB]NAME[_PREFIX])
+ dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
+ dnl results of this search when this library appears as a dependency.
+ HAVE_LIB[]NAME=yes
+ popdef([NAME])
+ popdef([Name])
+])
+
+dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
+dnl searches for libname and the libraries corresponding to explicit and
+dnl implicit dependencies, together with the specified include files and
+dnl the ability to compile and link the specified testcode. The missing-message
+dnl defaults to 'no' and may contain additional hints for the user.
+dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
+dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
+dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
+dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
+dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
+dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
+AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
+[
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+ pushdef([Name],[translit([$1],[./-], [___])])
+ pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+
+ dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
+ dnl accordingly.
+ AC_LIB_LINKFLAGS_BODY([$1], [$2])
+
+ dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
+ dnl because if the user has installed lib[]Name and not disabled its use
+ dnl via --without-lib[]Name-prefix, he wants to use it.
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+
+ AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
+ ac_save_LIBS="$LIBS"
+ dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
+ dnl because these -l options might require -L options that are present in
+ dnl LIBS. -l options benefit only from the -L options listed before it.
+ dnl Otherwise, add it to the front of LIBS, because it may be a static
+ dnl library that depends on another static library that is present in LIBS.
+ dnl Static libraries benefit only from the static libraries listed after
+ dnl it.
+ case " $LIB[]NAME" in
+ *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
+ *) LIBS="$LIB[]NAME $LIBS" ;;
+ esac
+ AC_TRY_LINK([$3], [$4],
+ [ac_cv_lib[]Name=yes],
+ [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
+ LIBS="$ac_save_LIBS"
+ ])
+ if test "$ac_cv_lib[]Name" = yes; then
+ HAVE_LIB[]NAME=yes
+ AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
+ AC_MSG_CHECKING([how to link with lib[]$1])
+ AC_MSG_RESULT([$LIB[]NAME])
+ else
+ HAVE_LIB[]NAME=no
+ dnl If $LIB[]NAME didn't lead to a usable library, we don't need
+ dnl $INC[]NAME either.
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LIB[]NAME=
+ LTLIB[]NAME=
+ LIB[]NAME[]_PREFIX=
+ fi
+ AC_SUBST([HAVE_LIB]NAME)
+ AC_SUBST([LIB]NAME)
+ AC_SUBST([LTLIB]NAME)
+ AC_SUBST([LIB]NAME[_PREFIX])
+ popdef([NAME])
+ popdef([Name])
+])
+
+dnl Determine the platform dependent parameters needed to use rpath:
+dnl acl_libext,
+dnl acl_shlibext,
+dnl acl_hardcode_libdir_flag_spec,
+dnl acl_hardcode_libdir_separator,
+dnl acl_hardcode_direct,
+dnl acl_hardcode_minus_L.
+AC_DEFUN([AC_LIB_RPATH],
+[
+ dnl Tell automake >= 1.10 to complain if config.rpath is missing.
+ m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
+ AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
+ AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
+ AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
+ AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
+ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
+ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
+ . ./conftest.sh
+ rm -f ./conftest.sh
+ acl_cv_rpath=done
+ ])
+ wl="$acl_cv_wl"
+ acl_libext="$acl_cv_libext"
+ acl_shlibext="$acl_cv_shlibext"
+ acl_libname_spec="$acl_cv_libname_spec"
+ acl_library_names_spec="$acl_cv_library_names_spec"
+ acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
+ acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
+ acl_hardcode_direct="$acl_cv_hardcode_direct"
+ acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
+ dnl Determine whether the user wants rpath handling at all.
+ AC_ARG_ENABLE([rpath],
+ [ --disable-rpath do not hardcode runtime library paths],
+ :, enable_rpath=yes)
+])
+
+dnl AC_LIB_FROMPACKAGE(name, package)
+dnl declares that libname comes from the given package. The configure file
+dnl will then not have a --with-libname-prefix option but a
+dnl --with-package-prefix option. Several libraries can come from the same
+dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
+dnl macro call that searches for libname.
+AC_DEFUN([AC_LIB_FROMPACKAGE],
+[
+ pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+ define([acl_frompackage_]NAME, [$2])
+ popdef([NAME])
+ pushdef([PACK],[$2])
+ pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+ define([acl_libsinpackage_]PACKUP,
+ m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1])
+ popdef([PACKUP])
+ popdef([PACK])
+])
+
+dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
+dnl the libraries corresponding to explicit and implicit dependencies.
+dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
+dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
+dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
+AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
+[
+ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+ pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+ pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
+ pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+ pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
+ dnl Autoconf >= 2.61 supports dots in --with options.
+ pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)])
+ dnl By default, look in $includedir and $libdir.
+ use_additional=yes
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ ])
+ AC_ARG_WITH(P_A_C_K[-prefix],
+[[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
+ --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
+[
+ if test "X$withval" = "Xno"; then
+ use_additional=no
+ else
+ if test "X$withval" = "X"; then
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ ])
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/$acl_libdirstem"
+ if test "$acl_libdirstem2" != "$acl_libdirstem" \
+ && ! test -d "$withval/$acl_libdirstem"; then
+ additional_libdir="$withval/$acl_libdirstem2"
+ fi
+ fi
+ fi
+])
+ dnl Search the library and its dependencies in $additional_libdir and
+ dnl $LDFLAGS. Using breadth-first-seach.
+ LIB[]NAME=
+ LTLIB[]NAME=
+ INC[]NAME=
+ LIB[]NAME[]_PREFIX=
+ dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
+ dnl computed. So it has to be reset here.
+ HAVE_LIB[]NAME=
+ rpathdirs=
+ ltrpathdirs=
+ names_already_handled=
+ names_next_round='$1 $2'
+ while test -n "$names_next_round"; do
+ names_this_round="$names_next_round"
+ names_next_round=
+ for name in $names_this_round; do
+ already_handled=
+ for n in $names_already_handled; do
+ if test "$n" = "$name"; then
+ already_handled=yes
+ break
+ fi
+ done
+ if test -z "$already_handled"; then
+ names_already_handled="$names_already_handled $name"
+ dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
+ dnl or AC_LIB_HAVE_LINKFLAGS call.
+ uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+ eval value=\"\$HAVE_LIB$uppername\"
+ if test -n "$value"; then
+ if test "$value" = yes; then
+ eval value=\"\$LIB$uppername\"
+ test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
+ eval value=\"\$LTLIB$uppername\"
+ test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
+ else
+ dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
+ dnl that this library doesn't exist. So just drop it.
+ :
+ fi
+ else
+ dnl Search the library lib$name in $additional_libdir and $LDFLAGS
+ dnl and the already constructed $LIBNAME/$LTLIBNAME.
+ found_dir=
+ found_la=
+ found_so=
+ found_a=
+ eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
+ if test -n "$acl_shlibext"; then
+ shrext=".$acl_shlibext" # typically: shrext=.so
+ else
+ shrext=
+ fi
+ if test $use_additional = yes; then
+ dir="$additional_libdir"
+ dnl The same code as in the loop below:
+ dnl First look for a shared library.
+ if test -n "$acl_shlibext"; then
+ if test -f "$dir/$libname$shrext"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext"
+ else
+ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+ ver=`(cd "$dir" && \
+ for f in "$libname$shrext".*; do echo "$f"; done \
+ | sed -e "s,^$libname$shrext\\\\.,," \
+ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+ | sed 1q ) 2>/dev/null`
+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext.$ver"
+ fi
+ else
+ eval library_names=\"$acl_library_names_spec\"
+ for f in $library_names; do
+ if test -f "$dir/$f"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ dnl Then look for a static library.
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext"; then
+ found_dir="$dir"
+ found_a="$dir/$libname.$acl_libext"
+ fi
+ fi
+ if test "X$found_dir" != "X"; then
+ if test -f "$dir/$libname.la"; then
+ found_la="$dir/$libname.la"
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ for x in $LDFLAGS $LTLIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ case "$x" in
+ -L*)
+ dir=`echo "X$x" | sed -e 's/^X-L//'`
+ dnl First look for a shared library.
+ if test -n "$acl_shlibext"; then
+ if test -f "$dir/$libname$shrext"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext"
+ else
+ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+ ver=`(cd "$dir" && \
+ for f in "$libname$shrext".*; do echo "$f"; done \
+ | sed -e "s,^$libname$shrext\\\\.,," \
+ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+ | sed 1q ) 2>/dev/null`
+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext.$ver"
+ fi
+ else
+ eval library_names=\"$acl_library_names_spec\"
+ for f in $library_names; do
+ if test -f "$dir/$f"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ dnl Then look for a static library.
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext"; then
+ found_dir="$dir"
+ found_a="$dir/$libname.$acl_libext"
+ fi
+ fi
+ if test "X$found_dir" != "X"; then
+ if test -f "$dir/$libname.la"; then
+ found_la="$dir/$libname.la"
+ fi
+ fi
+ ;;
+ esac
+ if test "X$found_dir" != "X"; then
+ break
+ fi
+ done
+ fi
+ if test "X$found_dir" != "X"; then
+ dnl Found the library.
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
+ if test "X$found_so" != "X"; then
+ dnl Linking with a shared library. We attempt to hardcode its
+ dnl directory into the executable's runpath, unless it's the
+ dnl standard /usr/lib.
+ if test "$enable_rpath" = no \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem" \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
+ dnl No hardcoding is needed.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ else
+ dnl Use an explicit option to hardcode DIR into the resulting
+ dnl binary.
+ dnl Potentially add DIR to ltrpathdirs.
+ dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $found_dir"
+ fi
+ dnl The hardcoding into $LIBNAME is system dependent.
+ if test "$acl_hardcode_direct" = yes; then
+ dnl Using DIR/libNAME.so during linking hardcodes DIR into the
+ dnl resulting binary.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ else
+ if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+ dnl Use an explicit option to hardcode DIR into the resulting
+ dnl binary.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ dnl Potentially add DIR to rpathdirs.
+ dnl The rpathdirs will be appended to $LIBNAME at the end.
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $found_dir"
+ fi
+ else
+ dnl Rely on "-L$found_dir".
+ dnl But don't add it if it's already contained in the LDFLAGS
+ dnl or the already constructed $LIBNAME
+ haveit=
+ for x in $LDFLAGS $LIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
+ fi
+ if test "$acl_hardcode_minus_L" != no; then
+ dnl FIXME: Not sure whether we should use
+ dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+ dnl here.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ else
+ dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
+ dnl here, because this doesn't fit in flags passed to the
+ dnl compiler. So give up. No hardcoding. This affects only
+ dnl very old systems.
+ dnl FIXME: Not sure whether we should use
+ dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+ dnl here.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
+ fi
+ fi
+ fi
+ fi
+ else
+ if test "X$found_a" != "X"; then
+ dnl Linking with a static library.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
+ else
+ dnl We shouldn't come here, but anyway it's good to have a
+ dnl fallback.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
+ fi
+ fi
+ dnl Assume the include files are nearby.
+ additional_includedir=
+ case "$found_dir" in
+ */$acl_libdirstem | */$acl_libdirstem/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
+ if test "$name" = '$1'; then
+ LIB[]NAME[]_PREFIX="$basedir"
+ fi
+ additional_includedir="$basedir/include"
+ ;;
+ */$acl_libdirstem2 | */$acl_libdirstem2/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
+ if test "$name" = '$1'; then
+ LIB[]NAME[]_PREFIX="$basedir"
+ fi
+ additional_includedir="$basedir/include"
+ ;;
+ esac
+ if test "X$additional_includedir" != "X"; then
+ dnl Potentially add $additional_includedir to $INCNAME.
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/include,
+ dnl 2. if it's /usr/local/include and we are using GCC on Linux,
+ dnl 3. if it's already present in $CPPFLAGS or the already
+ dnl constructed $INCNAME,
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$additional_includedir" != "X/usr/include"; then
+ haveit=
+ if test "X$additional_includedir" = "X/usr/local/include"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ for x in $CPPFLAGS $INC[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-I$additional_includedir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_includedir"; then
+ dnl Really add $additional_includedir to $INCNAME.
+ INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
+ fi
+ fi
+ fi
+ fi
+ fi
+ dnl Look for dependencies.
+ if test -n "$found_la"; then
+ dnl Read the .la file. It defines the variables
+ dnl dlname, library_names, old_library, dependency_libs, current,
+ dnl age, revision, installed, dlopen, dlpreopen, libdir.
+ save_libdir="$libdir"
+ case "$found_la" in
+ */* | *\\*) . "$found_la" ;;
+ *) . "./$found_la" ;;
+ esac
+ libdir="$save_libdir"
+ dnl We use only dependency_libs.
+ for dep in $dependency_libs; do
+ case "$dep" in
+ -L*)
+ additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+ dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/lib,
+ dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
+ dnl 3. if it's already present in $LDFLAGS or the already
+ dnl constructed $LIBNAME,
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
+ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
+ haveit=
+ if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
+ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ haveit=
+ for x in $LDFLAGS $LIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ dnl Really add $additional_libdir to $LIBNAME.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
+ fi
+ fi
+ haveit=
+ for x in $LDFLAGS $LTLIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ dnl Really add $additional_libdir to $LTLIBNAME.
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
+ fi
+ fi
+ fi
+ fi
+ ;;
+ -R*)
+ dir=`echo "X$dep" | sed -e 's/^X-R//'`
+ if test "$enable_rpath" != no; then
+ dnl Potentially add DIR to rpathdirs.
+ dnl The rpathdirs will be appended to $LIBNAME at the end.
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $dir"
+ fi
+ dnl Potentially add DIR to ltrpathdirs.
+ dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $dir"
+ fi
+ fi
+ ;;
+ -l*)
+ dnl Handle this in the next round.
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+ ;;
+ *.la)
+ dnl Handle this in the next round. Throw away the .la's
+ dnl directory; it is already contained in a preceding -L
+ dnl option.
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+ ;;
+ *)
+ dnl Most likely an immediate library name.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
+ ;;
+ esac
+ done
+ fi
+ else
+ dnl Didn't find the library; assume it is in the system directories
+ dnl known to the linker and runtime loader. (All the system
+ dnl directories known to the linker should also be known to the
+ dnl runtime loader, otherwise the system is severely misconfigured.)
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
+ fi
+ fi
+ fi
+ done
+ done
+ if test "X$rpathdirs" != "X"; then
+ if test -n "$acl_hardcode_libdir_separator"; then
+ dnl Weird platform: only the last -rpath option counts, the user must
+ dnl pass all path elements in one option. We can arrange that for a
+ dnl single library, but not when more than one $LIBNAMEs are used.
+ alldirs=
+ for found_dir in $rpathdirs; do
+ alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
+ done
+ dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+ else
+ dnl The -rpath options are cumulative.
+ for found_dir in $rpathdirs; do
+ acl_save_libdir="$libdir"
+ libdir="$found_dir"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+ done
+ fi
+ fi
+ if test "X$ltrpathdirs" != "X"; then
+ dnl When using libtool, the option that works for both libraries and
+ dnl executables is -R. The -R options are cumulative.
+ for found_dir in $ltrpathdirs; do
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
+ done
+ fi
+ popdef([P_A_C_K])
+ popdef([PACKLIBS])
+ popdef([PACKUP])
+ popdef([PACK])
+ popdef([NAME])
+])
+
+dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
+dnl unless already present in VAR.
+dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
+dnl contains two or three consecutive elements that belong together.
+AC_DEFUN([AC_LIB_APPENDTOVAR],
+[
+ for element in [$2]; do
+ haveit=
+ for x in $[$1]; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X$element"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ [$1]="${[$1]}${[$1]:+ }$element"
+ fi
+ done
+])
+
+dnl For those cases where a variable contains several -L and -l options
+dnl referring to unknown libraries and directories, this macro determines the
+dnl necessary additional linker options for the runtime path.
+dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
+dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
+dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
+dnl otherwise linking without libtool is assumed.
+AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
+[
+ AC_REQUIRE([AC_LIB_RPATH])
+ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+ $1=
+ if test "$enable_rpath" != no; then
+ if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+ dnl Use an explicit option to hardcode directories into the resulting
+ dnl binary.
+ rpathdirs=
+ next=
+ for opt in $2; do
+ if test -n "$next"; then
+ dir="$next"
+ dnl No need to hardcode the standard /usr/lib.
+ if test "X$dir" != "X/usr/$acl_libdirstem" \
+ && test "X$dir" != "X/usr/$acl_libdirstem2"; then
+ rpathdirs="$rpathdirs $dir"
+ fi
+ next=
+ else
+ case $opt in
+ -L) next=yes ;;
+ -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
+ dnl No need to hardcode the standard /usr/lib.
+ if test "X$dir" != "X/usr/$acl_libdirstem" \
+ && test "X$dir" != "X/usr/$acl_libdirstem2"; then
+ rpathdirs="$rpathdirs $dir"
+ fi
+ next= ;;
+ *) next= ;;
+ esac
+ fi
+ done
+ if test "X$rpathdirs" != "X"; then
+ if test -n ""$3""; then
+ dnl libtool is used for linking. Use -R options.
+ for dir in $rpathdirs; do
+ $1="${$1}${$1:+ }-R$dir"
+ done
+ else
+ dnl The linker is used for linking directly.
+ if test -n "$acl_hardcode_libdir_separator"; then
+ dnl Weird platform: only the last -rpath option counts, the user
+ dnl must pass all path elements in one option.
+ alldirs=
+ for dir in $rpathdirs; do
+ alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
+ done
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ $1="$flag"
+ else
+ dnl The -rpath options are cumulative.
+ for dir in $rpathdirs; do
+ acl_save_libdir="$libdir"
+ libdir="$dir"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ $1="${$1}${$1:+ }$flag"
+ done
+ fi
+ fi
+ fi
+ fi
+ fi
+ AC_SUBST([$1])
+])
diff --git a/extension/m4/lib-prefix.m4 b/extension/m4/lib-prefix.m4
new file mode 100644
index 00000000..1601ceae
--- /dev/null
+++ b/extension/m4/lib-prefix.m4
@@ -0,0 +1,224 @@
+# lib-prefix.m4 serial 7 (gettext-0.18)
+dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
+dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
+dnl require excessive bracketing.
+ifdef([AC_HELP_STRING],
+[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
+[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
+
+dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
+dnl to access previously installed libraries. The basic assumption is that
+dnl a user will want packages to use other packages he previously installed
+dnl with the same --prefix option.
+dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
+dnl libraries, but is otherwise very convenient.
+AC_DEFUN([AC_LIB_PREFIX],
+[
+ AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ dnl By default, look in $includedir and $libdir.
+ use_additional=yes
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ ])
+ AC_LIB_ARG_WITH([lib-prefix],
+[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
+ --without-lib-prefix don't search for libraries in includedir and libdir],
+[
+ if test "X$withval" = "Xno"; then
+ use_additional=no
+ else
+ if test "X$withval" = "X"; then
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ ])
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/$acl_libdirstem"
+ fi
+ fi
+])
+ if test $use_additional = yes; then
+ dnl Potentially add $additional_includedir to $CPPFLAGS.
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/include,
+ dnl 2. if it's already present in $CPPFLAGS,
+ dnl 3. if it's /usr/local/include and we are using GCC on Linux,
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$additional_includedir" != "X/usr/include"; then
+ haveit=
+ for x in $CPPFLAGS; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-I$additional_includedir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test "X$additional_includedir" = "X/usr/local/include"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ if test -d "$additional_includedir"; then
+ dnl Really add $additional_includedir to $CPPFLAGS.
+ CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
+ fi
+ fi
+ fi
+ fi
+ dnl Potentially add $additional_libdir to $LDFLAGS.
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/lib,
+ dnl 2. if it's already present in $LDFLAGS,
+ dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
+ haveit=
+ for x in $LDFLAGS; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux*) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ dnl Really add $additional_libdir to $LDFLAGS.
+ LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
+ fi
+ fi
+ fi
+ fi
+ fi
+])
+
+dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
+dnl acl_final_exec_prefix, containing the values to which $prefix and
+dnl $exec_prefix will expand at the end of the configure script.
+AC_DEFUN([AC_LIB_PREPARE_PREFIX],
+[
+ dnl Unfortunately, prefix and exec_prefix get only finally determined
+ dnl at the end of configure.
+ if test "X$prefix" = "XNONE"; then
+ acl_final_prefix="$ac_default_prefix"
+ else
+ acl_final_prefix="$prefix"
+ fi
+ if test "X$exec_prefix" = "XNONE"; then
+ acl_final_exec_prefix='${prefix}'
+ else
+ acl_final_exec_prefix="$exec_prefix"
+ fi
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
+ prefix="$acl_save_prefix"
+])
+
+dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
+dnl variables prefix and exec_prefix bound to the values they will have
+dnl at the end of the configure script.
+AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
+[
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ $1
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+])
+
+dnl AC_LIB_PREPARE_MULTILIB creates
+dnl - a variable acl_libdirstem, containing the basename of the libdir, either
+dnl "lib" or "lib64" or "lib/64",
+dnl - a variable acl_libdirstem2, as a secondary possible value for
+dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
+dnl "lib/amd64".
+AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
+[
+ dnl There is no formal standard regarding lib and lib64.
+ dnl On glibc systems, the current practice is that on a system supporting
+ dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
+ dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
+ dnl the compiler's default mode by looking at the compiler's library search
+ dnl path. If at least one of its elements ends in /lib64 or points to a
+ dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
+ dnl Otherwise we use the default, namely "lib".
+ dnl On Solaris systems, the current practice is that on a system supporting
+ dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
+ dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
+ dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ acl_libdirstem=lib
+ acl_libdirstem2=
+ case "$host_os" in
+ solaris*)
+ dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
+ dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
+ dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
+ dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
+ dnl symlink is missing, so we set acl_libdirstem2 too.
+ AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
+ [AC_EGREP_CPP([sixtyfour bits], [
+#ifdef _LP64
+sixtyfour bits
+#endif
+ ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
+ ])
+ if test $gl_cv_solaris_64bit = yes; then
+ acl_libdirstem=lib/64
+ case "$host_cpu" in
+ sparc*) acl_libdirstem2=lib/sparcv9 ;;
+ i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
+ esac
+ fi
+ ;;
+ *)
+ searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+ if test -n "$searchpath"; then
+ acl_save_IFS="${IFS= }"; IFS=":"
+ for searchdir in $searchpath; do
+ if test -d "$searchdir"; then
+ case "$searchdir" in
+ */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
+ */../ | */.. )
+ # Better ignore directories of this form. They are misleading.
+ ;;
+ *) searchdir=`cd "$searchdir" && pwd`
+ case "$searchdir" in
+ */lib64 ) acl_libdirstem=lib64 ;;
+ esac ;;
+ esac
+ fi
+ done
+ IFS="$acl_save_IFS"
+ fi
+ ;;
+ esac
+ test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
+])
diff --git a/extension/m4/libtool.m4 b/extension/m4/libtool.m4
new file mode 100644
index 00000000..56666f0e
--- /dev/null
+++ b/extension/m4/libtool.m4
@@ -0,0 +1,7986 @@
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
+
+# serial 57 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+ [m4_default([$3],
+ [m4_fatal([Libtool version $1 or higher is required],
+ 63)])],
+ [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+ *\ * | *\ *)
+ AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+m4_defun([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+ case $cc_temp in
+ compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+ distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+
+_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
+dnl
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_WITH_SYSROOT])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ _LT_PATH_MAGIC
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PREPARE_SED_QUOTE_VARS
+# --------------------------
+# Define a few sed substitution that help us do robust quoting.
+m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
+[# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+])
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
+
+
+## ------------------------------------- ##
+## Accumulate code for creating libtool. ##
+## ------------------------------------- ##
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+ [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+## ------------------------ ##
+## FIXME: Eliminate VARNAME ##
+## ------------------------ ##
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME. Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+ [m4_ifval([$1], [$1], [$2])])
+ lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+ m4_ifval([$4],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+ lt_dict_add_subkey([lt_decl_dict], [$2],
+ [tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+ [0], [m4_fatal([$0: too few arguments: $#])],
+ [1], [m4_fatal([$0: too few arguments: $#: $1])],
+ [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+ [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+ [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+ m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_if([$2], [],
+ m4_quote(lt_decl_varnames),
+ m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+ lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'. VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly. In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+# <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+ [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags="_LT_TAGS"dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+# # Some comment about what VAR is for.
+# visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+ [description])))[]dnl
+m4_pushdef([_libtool_name],
+ m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+ [0], [_libtool_name=[$]$1],
+ [1], [_libtool_name=$lt_[]$1],
+ [2], [_libtool_name=$lt_[]$1],
+ [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+ m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'. Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+ dnl If the libtool generation code has been placed in $CONFIG_LT,
+ dnl instead of duplicating it all over again into config.status,
+ dnl then we will have config.status run $CONFIG_LT later, so it
+ dnl needs to know what name is stored there:
+ [AC_CONFIG_COMMANDS([libtool],
+ [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+ dnl If the libtool generation code is destined for config.status,
+ dnl expand the accumulated commands and init code now:
+ [AC_CONFIG_COMMANDS([libtool],
+ [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$[]1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
+# ------------------------------------
+# Generate a child script FILE with all initialization necessary to
+# reuse the environment learned by the parent script, and make the
+# file executable. If COMMENT is supplied, it is inserted after the
+# `#!' sequence but before initialization text begins. After this
+# macro, additional text can be appended to FILE to form the body of
+# the child script. The macro ends with non-zero status if the
+# file could not be fully written (such as if the disk is full).
+m4_ifdef([AS_INIT_GENERATED],
+[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
+[m4_defun([_LT_GENERATED_FILE_INIT],
+[m4_require([AS_PREPARE])]dnl
+[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+[lt_write_fail=0
+cat >$1 <<_ASEOF || lt_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+$2
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$1 <<\_ASEOF || lt_write_fail=1
+AS_SHELL_SANITIZE
+_AS_PREPARE
+exec AS_MESSAGE_FD>&1
+_ASEOF
+test $lt_write_fail = 0 && chmod +x $1[]dnl
+m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
+[# Run this file to recreate a libtool stub with the current configuration.])
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+lt_cl_silent=false
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+ echo
+ AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+\`$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+
+Report bugs to <bug-libtool@gnu.org>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2011 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test $[#] != 0
+do
+ case $[1] in
+ --version | --v* | -V )
+ echo "$lt_cl_version"; exit 0 ;;
+ --help | --h* | -h )
+ echo "$lt_cl_help"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --quiet | --q* | --silent | --s* | -q )
+ lt_cl_silent=: ;;
+
+ -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try \`$[0] --help' for more information.]) ;;
+
+ *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try \`$[0] --help' for more information.]) ;;
+ esac
+ shift
+done
+
+if $lt_cl_silent; then
+ exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure. Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+lt_cl_success=:
+test "$silent" = yes &&
+ lt_config_lt_args="$lt_config_lt_args --quiet"
+exec AS_MESSAGE_LOG_FD>/dev/null
+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+exec AS_MESSAGE_LOG_FD>>config.log
+$lt_cl_success || AS_EXIT(1)
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars. Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+ m4_if(_LT_TAG, [C], [
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+ _LT_PROG_LTMAIN
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ _LT_PROG_REPLACE_SHELLFNS
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+# autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+ [C], [_LT_LANG(C)],
+ [C++], [_LT_LANG(CXX)],
+ [Go], [_LT_LANG(GO)],
+ [Java], [_LT_LANG(GCJ)],
+ [Fortran 77], [_LT_LANG(F77)],
+ [Fortran], [_LT_LANG(FC)],
+ [Windows Resource], [_LT_LANG(RC)],
+ [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+ [_LT_LANG($1)],
+ [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+ [LT_SUPPORTED_TAG([$1])dnl
+ m4_append([_LT_TAGS], [$1 ])dnl
+ m4_define([_LT_LANG_]$1[_enabled], [])dnl
+ _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+m4_ifndef([AC_PROG_GO], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_GO. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+m4_defun([AC_PROG_GO],
+[AC_LANG_PUSH(Go)dnl
+AC_ARG_VAR([GOC], [Go compiler command])dnl
+AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
+_AC_ARG_VAR_LDFLAGS()dnl
+AC_CHECK_TOOL(GOC, gccgo)
+if test -z "$GOC"; then
+ if test -n "$ac_tool_prefix"; then
+ AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
+ fi
+fi
+if test -z "$GOC"; then
+ AC_CHECK_PROG(GOC, gccgo, gccgo, false)
+fi
+])#m4_defun
+])#m4_ifndef
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [LT_LANG(CXX)],
+ [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+ [LT_LANG(F77)],
+ [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+ [LT_LANG(FC)],
+ [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [m4_ifdef([AC_PROG_GCJ],
+ [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([A][M_PROG_GCJ],
+ [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([LT_PROG_GCJ],
+ [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([AC_PROG_GO],
+ [LT_LANG(GO)],
+ [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+ [LT_LANG(RC)],
+ [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+dnl AC_DEFUN([AC_LIBTOOL_RC], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+ case $host_os in
+ rhapsody* | darwin*)
+ AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+ AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+ AC_CHECK_TOOL([LIPO], [lipo], [:])
+ AC_CHECK_TOOL([OTOOL], [otool], [:])
+ AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+ _LT_DECL([], [DSYMUTIL], [1],
+ [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+ _LT_DECL([], [NMEDIT], [1],
+ [Tool to change global to local symbols on Mac OS X])
+ _LT_DECL([], [LIPO], [1],
+ [Tool to manipulate fat objects and archives on Mac OS X])
+ _LT_DECL([], [OTOOL], [1],
+ [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+ _LT_DECL([], [OTOOL64], [1],
+ [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+ [lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ # If there is a non-empty error log, and "single_module"
+ # appears in it, assume the flag caused a linker warning
+ if test -s conftest.err && $GREP single_module conftest.err; then
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ # Otherwise, if the output was created with a 0 exit code from
+ # the compiler, it worked.
+ elif test -f libconftest.dylib && test $_lt_result -eq 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi])
+
+ AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+ [lt_cv_ld_exported_symbols_list],
+ [lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [lt_cv_ld_exported_symbols_list=yes],
+ [lt_cv_ld_exported_symbols_list=no])
+ LDFLAGS="$save_LDFLAGS"
+ ])
+
+ AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
+ [lt_cv_ld_force_load=no
+ cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+ echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+ $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+ echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
+ $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+ cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+ _lt_result=$?
+ if test -s conftest.err && $GREP force_load conftest.err; then
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+ lt_cv_ld_force_load=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -f conftest.err libconftest.a conftest conftest.c
+ rm -rf conftest.dSYM
+ ])
+ case $host_os in
+ rhapsody* | darwin1.[[012]])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[[012]]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES([TAG])
+# ---------------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+ m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ if test "$lt_cv_ld_force_load" = "yes"; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
+ [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes])
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=func_echo_all
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ m4_if([$1], [CXX],
+[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+ fi
+],[])
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
+# ----------------------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+# Store the results from the different compilers for each TAGNAME.
+# Allow to override them for all tags through lt_cv_aix_libpath.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
+ lt_aix_libpath_sed='[
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }]'
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi],[])
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
+ fi
+ ])
+ aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
+fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[m4_divert_text([M4SH-INIT], [$1
+])])# _LT_SHELL_INIT
+
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Find how we can fake an echo command that does not interpret backslash.
+# In particular, with Autoconf 2.60 or later we add some code to the start
+# of the generated configure script which will find a shell with a builtin
+# printf (which we can use as an echo command).
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+AC_MSG_CHECKING([how to print strings])
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='printf %s\n'
+else
+ # Use this function as a fallback that always works.
+ func_fallback_echo ()
+ {
+ eval 'cat <<_LTECHO_EOF
+$[]1
+_LTECHO_EOF'
+ }
+ ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO "$*"
+}
+
+case "$ECHO" in
+ printf*) AC_MSG_RESULT([printf]) ;;
+ print*) AC_MSG_RESULT([print -r]) ;;
+ *) AC_MSG_RESULT([cat]) ;;
+esac
+
+m4_ifdef([_AS_DETECT_SUGGESTED],
+[_AS_DETECT_SUGGESTED([
+ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ PATH=/empty FPATH=/empty; export PATH FPATH
+ test "X`printf %s $ECHO`" = "X$ECHO" \
+ || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
+
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_WITH_SYSROOT
+# ----------------
+AC_DEFUN([_LT_WITH_SYSROOT],
+[AC_MSG_CHECKING([for sysroot])
+AC_ARG_WITH([sysroot],
+[ --with-sysroot[=DIR] Search for dependent libraries within DIR
+ (or the compiler's sysroot if not specified).],
+[], [with_sysroot=no])
+
+dnl lt_sysroot will always be passed unquoted. We quote it here
+dnl in case the user passed a directory name.
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+ if test "$GCC" = yes; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ AC_MSG_RESULT([${with_sysroot}])
+ AC_MSG_ERROR([The sysroot must be an absolute path.])
+ ;;
+esac
+
+ AC_MSG_RESULT([${lt_sysroot:-no}])
+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
+[dependent libraries, and in which our libraries should be installed.])])
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+ [AS_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+ [AC_LANG_PUSH(C)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+ AC_LANG_POP])
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*)
+ case $host in
+ i?86-*-solaris*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ sparc*-*-solaris*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
+ if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+ LD="${LD-ld}_sol2"
+ fi
+ ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks="$enable_libtool_lock"
+])# _LT_ENABLE_LOCK
+
+
+# _LT_PROG_AR
+# -----------
+m4_defun([_LT_PROG_AR],
+[AC_CHECK_TOOLS(AR, [ar], false)
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
+ [lt_cv_ar_at_file=no
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+ [echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
+ AC_TRY_EVAL([lt_ar_try])
+ if test "$ac_status" -eq 0; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ AC_TRY_EVAL([lt_ar_try])
+ if test "$ac_status" -ne 0; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+ ])
+ ])
+
+if test "x$lt_cv_ar_at_file" = xno; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+_LT_DECL([], [archiver_list_spec], [1],
+ [How to feed a file listing to the archiver])
+])# _LT_PROG_AR
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[_LT_PROG_AR
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+ [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+fi
+
+case $host_os in
+ darwin*)
+ lock_old_archive_extraction=yes ;;
+ *)
+ lock_old_archive_extraction=no ;;
+esac
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+ [Commands used to build an old-style archive])
+_LT_DECL([], [lock_old_archive_extraction], [0],
+ [Whether to use a lock for old archive extraction])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$3"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ fi
+ $RM conftest*
+])
+
+if test x"[$]$2" = xyes; then
+ m4_if([$5], , :, [$5])
+else
+ m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $3"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&AS_MESSAGE_LOG_FD
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ else
+ $2=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+ m4_if([$4], , :, [$4])
+else
+ m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ mint*)
+ # On MiNT this can take a long time and run out of memory.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ os2*)
+ # The test takes a long time on OS/2.
+ lt_cv_sys_max_cmd_len=8192
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8 ; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+ AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+ AC_MSG_RESULT(none)
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+ [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+ [$4]
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+[#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}]
+_LT_EOF
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) $1 ;;
+ x$lt_dlneed_uscore) $2 ;;
+ x$lt_dlunknown|x*) $3 ;;
+ esac
+ else :
+ # compilation failed
+ $3
+ fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ])
+ ;;
+
+ *)
+ AC_CHECK_FUNC([shl_load],
+ [lt_cv_dlopen="shl_load"],
+ [AC_CHECK_LIB([dld], [shl_load],
+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+ [AC_CHECK_FUNC([dlopen],
+ [lt_cv_dlopen="dlopen"],
+ [AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+ [AC_CHECK_LIB([svld], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+ [AC_CHECK_LIB([dld], [dld_link],
+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+ ])
+ ])
+ ])
+ ])
+ ])
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ AC_CACHE_CHECK([whether a program can dlopen itself],
+ lt_cv_dlopen_self, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+ ])
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+ lt_cv_dlopen_self_static, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
+ ])
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+ [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+ [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+ [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+ fi
+ fi
+ chmod u+w . 2>&AS_MESSAGE_LOG_FD
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+ [Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links="nottested"
+if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ AC_MSG_CHECKING([if we can lock with hard links])
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ AC_MSG_RESULT([$hard_links])
+ if test "$hard_links" = no; then
+ AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+_LT_DECL([], [objdir], [0],
+ [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+ [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+ test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+ test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+ test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+ # Linking always hardcodes the temporary library directory.
+ _LT_TAGVAR(hardcode_action, $1)=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ _LT_TAGVAR(hardcode_action, $1)=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+ test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+ [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ ;;
+ *)
+ AC_MSG_RESULT([no])
+ ;;
+ esac
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+ [], [
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
+ *) lt_sed_strip_eq="s,=/,/,g" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+ case $lt_search_path_spec in
+ *\;*)
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+ ;;
+ *)
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+ if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+ esac
+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[[4-9]]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[[01]] | aix4.[[01]].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[[45]]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='${libname}.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec="$LIB"
+ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
+ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[[23]].*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2.*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+haiku*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[[3-9]]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
+ [lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+ [lt_cv_shlibpath_overrides_runpath=yes])])
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+ ])
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Add ABI-specific directories to the system library path.
+ sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
+
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[[89]] | openbsd2.[[89]].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+ [Variables whose values should be saved in libtool wrapper scripts and
+ restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+ [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+ [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+ [[List of archive names. First name is the real one, the rest are links.
+ The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+ [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [install_override_mode], [1],
+ [Permission mode override for installation of shared libraries])
+_LT_DECL([], [postinstall_cmds], [2],
+ [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+ [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+ [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+ [[As "finish_cmds", except a single script fragment to be evaled but
+ not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+ [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+ [Compile-time system search path for libraries])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+ [Run-time system search path for libraries])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program which can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] | ?:[\\/]*])
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word. This closes a longstanding sh security hole.
+ ac_dummy="m4_if([$2], , $PATH, [$2])"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$1; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ AC_MSG_RESULT($MAGIC_CMD)
+else
+ AC_MSG_RESULT(no)
+fi
+_LT_DECL([], [MAGIC_CMD], [0],
+ [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program which can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+ else
+ MAGIC_CMD=:
+ fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
+
+AC_ARG_WITH([gnu-ld],
+ [AS_HELP_STRING([--with-gnu-ld],
+ [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+ [test "$withval" = no || with_gnu_ld=yes],
+ [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by $CC])
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+ lt_cv_ld_reload_flag,
+ [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test "$GCC" != yes; then
+ reload_cmds=false
+ fi
+ ;;
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_TAGDECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[[45]]*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+ if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ # Keep this pattern in sync with the one in func_win32_libid.
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc*)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+haiku*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[[3-9]]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+])
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+ [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+ [Command to use when deplibs_check_method = "file_magic"])
+_LT_DECL([], [file_magic_glob], [1],
+ [How to find potential files when deplibs_check_method = "file_magic"])
+_LT_DECL([], [want_nocaseglob], [1],
+ [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
+fi])
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$DUMPBIN"; then :
+ # Let the user override the test.
+ else
+ AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
+ case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+ *COFF*)
+ DUMPBIN="$DUMPBIN -symbols"
+ ;;
+ *)
+ DUMPBIN=:
+ ;;
+ esac
+ fi
+ AC_SUBST([DUMPBIN])
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+ [lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
+ cat conftest.out >&AS_MESSAGE_LOG_FD
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+# --------------------------------
+# how to determine the name of the shared library
+# associated with a specific link library.
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+m4_require([_LT_DECL_DLLTOOL])
+AC_CACHE_CHECK([how to associate runtime and link libraries],
+lt_cv_sharedlib_from_linklib_cmd,
+[lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh
+ # decide which to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+ ;;
+esac
+])
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
+ [Command to associate shared and link libraries])
+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+
+
+# _LT_PATH_MANIFEST_TOOL
+# ----------------------
+# locate the manifest tool
+m4_defun([_LT_PATH_MANIFEST_TOOL],
+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
+ [lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*])
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+ MANIFEST_TOOL=:
+fi
+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
+])# _LT_PATH_MANIFEST_TOOL
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+ # These system don't have libm, or don't need it
+ ;;
+*-ncr-sysv4.3*)
+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+ ;;
+*)
+ AC_CHECK_LIB(m, cos, LIBM="-lm")
+ ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+ case $cc_basename in
+ nvcc*)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
+ esac
+
+ _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+ lt_cv_prog_compiler_rtti_exceptions,
+ [-fno-rtti -fno-exceptions], [],
+ [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+ [Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[[BCDT]]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[[ABCDGISTW]]'
+ ;;
+hpux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[[ABCDEGRST]]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[[BCDEGRST]]'
+ ;;
+osf*)
+ symcode='[[BCDEGQRST]]'
+ ;;
+solaris*)
+ symcode='[[BDRT]]'
+ ;;
+sco3.2v5*)
+ symcode='[[DT]]'
+ ;;
+sysv4.2uw2*)
+ symcode='[[DT]]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[[ABDT]]'
+ ;;
+sysv4)
+ symcode='[[DFNSTU]]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK ['"\
+" {last_section=section; section=\$ 3};"\
+" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx]"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT@&t@_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT@&t@_DLSYM_CONST
+#else
+# define LT@&t@_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+LT@&t@_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ AC_MSG_RESULT(failed)
+else
+ AC_MSG_RESULT(ok)
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+ [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+ [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_c_name_address],
+ [lt_cv_sys_global_symbol_to_c_name_address], [1],
+ [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+ [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+ [Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([], [nm_file_list_spec], [1],
+ [Specify filename containing input files for $NM])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+m4_if([$1], [CXX], [
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix[[4-9]]*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ fi
+ ;;
+ aCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ ecpc* )
+ # old Intel C++ for x86_64 which still supported -KPIC.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ icpc* )
+ # Intel C++, used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
+ # IBM XL 8.0, 9.0 on PPC and BlueGene
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+],
+[
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
+ if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
+ fi
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC (with -KPIC) is the default.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ ccc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All Alpha code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+ ;;
+ *Sun\ F* | *Sun*Fortran*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ *Intel*\ [[CF]]*Compiler*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ *Portland\ Group*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All OSF/1 code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ rdos*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ unicos*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+])
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+ ;;
+esac
+
+AC_CACHE_CHECK([for $compiler option to produce PIC],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+ [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+ [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+ "" | " "*) ;;
+ *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+ esac],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+ [Additional compiler flags for building library objects])
+
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+ [How to pass a linker flag through the compiler])
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+ _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+ $lt_tmp_static_flag,
+ [],
+ [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+ [Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ case $host_os in
+ aix[[4-9]]*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global defined
+ # symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+ ;;
+ cygwin* | mingw* | cegcc*)
+ case $cc_basename in
+ cl*)
+ _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+ ;;
+ esac
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+], [
+ runpath_var=
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(archive_cmds, $1)=
+ _LT_TAGVAR(archive_expsym_cmds, $1)=
+ _LT_TAGVAR(compiler_needs_object, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(hardcode_automatic, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_TAGVAR(inherit_rpath, $1)=no
+ _LT_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_TAGVAR(module_cmds, $1)=
+ _LT_TAGVAR(module_expsym_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+ _LT_TAGVAR(thread_safe_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ _LT_TAGVAR(include_expsyms, $1)=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
+ if test "$with_gnu_ld" = yes; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
+ *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test "$lt_use_gnu_ld_interface" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[[3-9]]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=' $pic_flag'
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group f77 and f90 compilers
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ tmp_sharedflag='--shared' ;;
+ xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf* | bgf* | bgxlf* | mpixlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+
+ if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+ runpath_var=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global
+ # defined symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[[45]]*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ # FIXME: Should let the user specify the lib program.
+ _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2.*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ m4_if($1, [], [
+ # Older versions of the 11.00 compiler do not understand -b yet
+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+ _LT_LINKER_OPTION([if $CC understands -b],
+ _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+ [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ # This should be the same for all languages, so no per-tag cache variable.
+ AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
+ [lt_cv_irix_exported_symbol],
+ [save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ AC_LINK_IFELSE(
+ [AC_LANG_SOURCE(
+ [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
+ [C++], [[int foo (void) { return 0; }]],
+ [Fortran 77], [[
+ subroutine foo
+ end]],
+ [Fortran], [[
+ subroutine foo
+ end]])])],
+ [lt_cv_irix_exported_symbol=yes],
+ [lt_cv_irix_exported_symbol=no])
+ LDFLAGS="$save_LDFLAGS"])
+ if test "$lt_cv_irix_exported_symbol" = yes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ fi
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ else
+ case $host_os in
+ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ os2*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ ;;
+ motorola)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4.3*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+ [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+ # Assume -lc should be added
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $_LT_TAGVAR(archive_cmds, $1) in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ AC_CACHE_CHECK([whether -lc should be explicitly linked in],
+ [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
+ [$RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+ pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+ then
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ else
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ fi
+ _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+ ])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+ [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+ [enable_shared_with_static_runtimes], [0],
+ [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+ [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+ [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+ [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+ [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+ [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+ [Commands used to build a loadable module if different from building
+ a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+ [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+ [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+ [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+ [Flag to hardcode $libdir into a binary during linking.
+ This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+ [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary and the resulting library dependency is
+ "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+ library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+ [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+ [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+ [Set to "yes" if building a shared library automatically hardcodes DIR
+ into the library and all subsequent libraries and executables linked
+ against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+ [Set to yes if linker adds runtime paths of dependent libraries
+ to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+ [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [always_export_symbols], [0],
+ [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+ [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+ [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+ [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+ [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [postlink_cmds], [2],
+ [Commands necessary for finishing linking programs])
+_LT_TAGDECL([], [file_list_spec], [1],
+ [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+ LT_SYS_DLOPEN_SELF
+ _LT_CMD_STRIPLIB
+
+ # Report which library types will actually be built
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC="$lt_save_CC"
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ AC_PROG_CXXCPP
+else
+ _lt_caught_CXX_error=yes
+fi
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="int some_variable = 0;"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_CFLAGS=$CFLAGS
+ lt_save_LD=$LD
+ lt_save_GCC=$GCC
+ GCC=$GXX
+ lt_save_with_gnu_ld=$with_gnu_ld
+ lt_save_path_LD=$lt_cv_path_LD
+ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+ else
+ $as_unset lt_cv_prog_gnu_ld
+ fi
+ if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+ else
+ $as_unset lt_cv_path_LD
+ fi
+ test -z "${LDCXX+set}" || LD=$LDCXX
+ CC=${CXX-"c++"}
+ CFLAGS=$CXXFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ # We don't want -fno-exception when compiling C++ code, so set the
+ # no_builtin_flag separately
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+ else
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+ fi
+
+ if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+ LT_PATH_LD
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+ $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+ fi
+
+ # PORTME: fill in a description of your system's C++ link characteristics
+ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to
+ # export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty
+ # executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared
+ # libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $GXX,$cc_basename in
+ ,cl* | no,cl*)
+ # Native MSVC
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ func_to_tool_file "$lt_outputfile"~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # g++
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ freebsd2.*)
+ # C++ shared libraries reported to be fairly broken before
+ # switch to ELF
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ freebsd-elf*)
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+
+ freebsd* | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ gnu*)
+ ;;
+
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ hpux9*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+ fi
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+ esac
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc* | ecpc* )
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ case `$CC -V` in
+ *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
+ _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ $RANLIB $oldlib'
+ _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ *) # Version 6 and above use weak symbols
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+ ;;
+ xl* | mpixl* | bgxl*)
+ # IBM XL 8.0 on PPC, with GNU ld
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ m88k*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+
+ *nto* | *qnx*)
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ openbsd2*)
+ # C++ shared libraries are fairly broken
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ fi
+ output_verbose_link_cmd=func_echo_all
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ case $host in
+ osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+ *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+ esac
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx*)
+ case $host in
+ osf3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+ $RM $lib.exp'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ case $host in
+ osf3*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ psos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ fi
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
+ '"$_LT_TAGVAR(old_archive_cmds, $1)"
+ _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
+ '"$_LT_TAGVAR(reload_cmds, $1)"
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+ test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+ _LT_TAGVAR(GCC, $1)="$GXX"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+ with_gnu_ld=$lt_save_with_gnu_ld
+ lt_cv_path_LDCXX=$lt_cv_path_LD
+ lt_cv_path_LD=$lt_save_path_LD
+ lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_FUNC_STRIPNAME_CNF
+# ----------------------
+# func_stripname_cnf prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+#
+# This function is identical to the (non-XSI) version of func_stripname,
+# except this one can be used by m4 code that may be executed by configure,
+# rather than the libtool script.
+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
+AC_REQUIRE([_LT_DECL_SED])
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
+func_stripname_cnf ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ esac
+} # func_stripname_cnf
+])# _LT_FUNC_STRIPNAME_CNF
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library. It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer*4 a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+ private int a;
+ public void bar (void) {
+ a = 0;
+ }
+};
+_LT_EOF
+], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
+package foo
+func foo() {
+}
+_LT_EOF
+])
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
+esac
+
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ for p in `eval "$output_verbose_link_cmd"`; do
+ case ${prev}${p} in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" ||
+ test $p = "-R"; then
+ prev=$p
+ continue
+ fi
+
+ # Expand the sysroot to ease extracting the directories later.
+ if test -z "$prev"; then
+ case $p in
+ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+ esac
+ fi
+ case $p in
+ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+ esac
+ if test "$pre_test_object_deps_done" = no; then
+ case ${prev} in
+ -L | -R)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+ _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+ fi
+ fi
+ prev=
+ ;;
+
+ *.lto.$objext) ;; # Ignore GCC LTO objects
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+ _LT_TAGVAR(predep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+ fi
+ else
+ if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+ _LT_TAGVAR(postdep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ _LT_TAGVAR(predep_objects,$1)=
+ _LT_TAGVAR(postdep_objects,$1)=
+ _LT_TAGVAR(postdeps,$1)=
+ ;;
+
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
+solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ # Adding this requires a known-good setup of shared libraries for
+ # Sun compiler versions before 5.6, else PIC objects from an old
+ # archive will be linked into the output, leading to subtle bugs.
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+ [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+ [Dependencies to place before and after the objects being linked to
+ create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+ [The library search path used internally by the compiler when linking
+ a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_LANG_PUSH(Fortran 77)
+if test -z "$F77" || test "X$F77" = "Xno"; then
+ _lt_disable_F77=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
+ CC=${F77-"f77"}
+ CFLAGS=$FFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+ GCC=$G77
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$G77"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC="$lt_save_CC"
+ CFLAGS="$lt_save_CFLAGS"
+fi # test "$_lt_disable_F77" != yes
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_LANG_PUSH(Fortran)
+
+if test -z "$FC" || test "X$FC" = "Xno"; then
+ _lt_disable_FC=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
+ CC=${FC-"f95"}
+ CFLAGS=$FCFLAGS
+ compiler=$CC
+ GCC=$ac_cv_fc_compiler_gnu
+
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+fi # test "$_lt_disable_FC" != yes
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+CFLAGS=$GCJFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_GO_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Go compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GO_CONFIG],
+[AC_REQUIRE([LT_PROG_GO])dnl
+AC_LANG_SAVE
+
+# Source file extension for Go test sources.
+ac_ext=go
+
+# Object file extension for compiled Go test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="package main; func main() { }"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='package main; func main() { }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GOC-"gccgo"}
+CFLAGS=$GOFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# Go did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GO_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+CFLAGS=
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+ :
+ _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+ [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+ [AC_CHECK_TOOL(GCJ, gcj,)
+ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_GO
+# ----------
+AC_DEFUN([LT_PROG_GO],
+[AC_CHECK_TOOL(GOC, gccgo,)
+])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+# _LT_DECL_DLLTOOL
+# ----------------
+# Ensure DLLTOOL variable is set.
+m4_defun([_LT_DECL_DLLTOOL],
+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
+AC_SUBST([DLLTOOL])
+])
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+ [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && continue
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+AC_MSG_RESULT([$xsi_shell])
+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+
+AC_MSG_CHECKING([whether the shell understands "+="])
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+AC_MSG_RESULT([$lt_shell_append])
+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
+# ------------------------------------------------------
+# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
+# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
+m4_defun([_LT_PROG_FUNCTION_REPLACE],
+[dnl {
+sed -e '/^$1 ()$/,/^} # $1 /c\
+$1 ()\
+{\
+m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1])
+} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+])
+
+
+# _LT_PROG_REPLACE_SHELLFNS
+# -------------------------
+# Replace existing portable implementations of several shell functions with
+# equivalent extended shell implementations where those features are available..
+m4_defun([_LT_PROG_REPLACE_SHELLFNS],
+[if test x"$xsi_shell" = xyes; then
+ _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac])
+
+ _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
+ func_basename_result="${1##*/}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+ func_basename_result="${1##*/}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+ # positional parameters, so assign one to ordinary parameter first.
+ func_stripname_result=${3}
+ func_stripname_result=${func_stripname_result#"${1}"}
+ func_stripname_result=${func_stripname_result%"${2}"}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
+ func_split_long_opt_name=${1%%=*}
+ func_split_long_opt_arg=${1#*=}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
+ func_split_short_opt_arg=${1#??}
+ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
+ case ${1} in
+ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+ *) func_lo2o_result=${1} ;;
+ esac])
+
+ _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo])
+
+ _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))])
+
+ _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}])
+fi
+
+if test x"$lt_shell_append" = xyes; then
+ _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
+ func_quote_for_eval "${2}"
+dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
+ eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
+
+ # Save a `func_append' function call where possible by direct use of '+='
+ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+else
+ # Save a `func_append' function call even when '+=' is not available
+ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+ AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
+fi
+])
+
+# _LT_PATH_CONVERSION_FUNCTIONS
+# -----------------------------
+# Determine which file name conversion functions should be used by
+# func_to_host_file (and, implicitly, by func_to_host_path). These are needed
+# for certain cross-compile configurations and native mingw.
+m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_MSG_CHECKING([how to convert $build file names to $host format])
+AC_CACHE_VAL(lt_cv_to_host_file_cmd,
+[case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+])
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
+_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
+ [0], [convert $build file names to $host format])dnl
+
+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
+[#assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+])
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
+ [0], [convert $build files to toolchain format])dnl
+])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/extension/m4/ltoptions.m4 b/extension/m4/ltoptions.m4
new file mode 100644
index 00000000..5d9acd8e
--- /dev/null
+++ b/extension/m4/ltoptions.m4
@@ -0,0 +1,384 @@
+# Helper functions for option handling. -*- Autoconf -*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 7 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it. Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+ _LT_MANGLE_DEFUN([$1], [$2]),
+ [m4_warning([Unknown $1 option `$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+ [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME. If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+ dnl
+ dnl Simply set some default values (i.e off) if boolean options were not
+ dnl specified:
+ _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+ ])
+ _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+ ])
+ dnl
+ dnl If no reference was made to various pairs of opposing options, then
+ dnl we run the default mode handler for the pair. For example, if neither
+ dnl `shared' nor `disable-shared' was passed, we enable building of shared
+ dnl archives by default:
+ _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+ _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+ [_LT_ENABLE_FAST_INSTALL])
+ ])
+])# _LT_SET_OPTIONS
+
+
+## --------------------------------- ##
+## Macros to handle LT_INIT options. ##
+## --------------------------------- ##
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+ AC_CHECK_TOOL(AS, as, false)
+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS], [1], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+ [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+ [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+ _LT_DECL([build_libtool_libs], [enable_shared], [0],
+ [Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+ [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+ [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+ _LT_DECL([build_old_libs], [enable_static], [0],
+ [Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+ [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+ [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+ [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+ [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+ [lt_p=${PACKAGE-default}
+ case $withval in
+ yes|no) pic_mode=$withval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for lt_pkg in $withval; do
+ IFS="$lt_save_ifs"
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [pic_mode=default])
+
+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+## ----------------- ##
+## LTDL_INIT Options ##
+## ----------------- ##
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+ [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+ [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+ [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+ [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+ [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/extension/m4/ltsugar.m4 b/extension/m4/ltsugar.m4
new file mode 100644
index 00000000..9000a057
--- /dev/null
+++ b/extension/m4/ltsugar.m4
@@ -0,0 +1,123 @@
+# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+ [$#], [2], [[$2]],
+ [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+ [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59 which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+ [$#], 1, [],
+ [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+ m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+ [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+ [m4_foreach([_Lt_suffix],
+ ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+ [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+ [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+ [lt_append([$1], [$2], [$3])$4],
+ [$5])],
+ [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+ m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+ m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+ [$5],
+ [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+ [lt_join(m4_quote(m4_default([$4], [[, ]])),
+ lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+ [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
diff --git a/extension/m4/ltversion.m4 b/extension/m4/ltversion.m4
new file mode 100644
index 00000000..07a8602d
--- /dev/null
+++ b/extension/m4/ltversion.m4
@@ -0,0 +1,23 @@
+# ltversion.m4 -- version numbers -*- Autoconf -*-
+#
+# Copyright (C) 2004 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# @configure_input@
+
+# serial 3337 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.4.2])
+m4_define([LT_PACKAGE_REVISION], [1.3337])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.4.2'
+macro_revision='1.3337'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
diff --git a/extension/m4/lt~obsolete.m4 b/extension/m4/lt~obsolete.m4
new file mode 100644
index 00000000..c573da90
--- /dev/null
+++ b/extension/m4/lt~obsolete.m4
@@ -0,0 +1,98 @@
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 5 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else. This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
+m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
+m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
+m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
+m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
+m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
diff --git a/extension/m4/nls.m4 b/extension/m4/nls.m4
new file mode 100644
index 00000000..003704c4
--- /dev/null
+++ b/extension/m4/nls.m4
@@ -0,0 +1,32 @@
+# nls.m4 serial 5 (gettext-0.18)
+dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
+
+AC_PREREQ([2.50])
+
+AC_DEFUN([AM_NLS],
+[
+ AC_MSG_CHECKING([whether NLS is requested])
+ dnl Default is enabled NLS
+ AC_ARG_ENABLE([nls],
+ [ --disable-nls do not use Native Language Support],
+ USE_NLS=$enableval, USE_NLS=yes)
+ AC_MSG_RESULT([$USE_NLS])
+ AC_SUBST([USE_NLS])
+])
diff --git a/extension/m4/po.m4 b/extension/m4/po.m4
new file mode 100644
index 00000000..3c9884ba
--- /dev/null
+++ b/extension/m4/po.m4
@@ -0,0 +1,449 @@
+# po.m4 serial 17 (gettext-0.18)
+dnl Copyright (C) 1995-2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
+
+AC_PREREQ([2.50])
+
+dnl Checks for all prerequisites of the po subdirectory.
+AC_DEFUN([AM_PO_SUBDIRS],
+[
+ AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+ AC_REQUIRE([AC_PROG_INSTALL])dnl
+ AC_REQUIRE([AC_PROG_MKDIR_P])dnl defined by automake
+ AC_REQUIRE([AM_NLS])dnl
+
+ dnl Release version of the gettext macros. This is used to ensure that
+ dnl the gettext macros and po/Makefile.in.in are in sync.
+ AC_SUBST([GETTEXT_MACRO_VERSION], [0.18])
+
+ dnl Perform the following tests also if --disable-nls has been given,
+ dnl because they are needed for "make dist" to work.
+
+ dnl Search for GNU msgfmt in the PATH.
+ dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
+ dnl The second test excludes FreeBSD msgfmt.
+ AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+ [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
+ (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
+ :)
+ AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT])
+
+ dnl Test whether it is GNU msgfmt >= 0.15.
+changequote(,)dnl
+ case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
+ *) MSGFMT_015=$MSGFMT ;;
+ esac
+changequote([,])dnl
+ AC_SUBST([MSGFMT_015])
+changequote(,)dnl
+ case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
+ *) GMSGFMT_015=$GMSGFMT ;;
+ esac
+changequote([,])dnl
+ AC_SUBST([GMSGFMT_015])
+
+ dnl Search for GNU xgettext 0.12 or newer in the PATH.
+ dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
+ dnl The second test excludes FreeBSD xgettext.
+ AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+ [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
+ (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
+ :)
+ dnl Remove leftover from FreeBSD xgettext call.
+ rm -f messages.po
+
+ dnl Test whether it is GNU xgettext >= 0.15.
+changequote(,)dnl
+ case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
+ *) XGETTEXT_015=$XGETTEXT ;;
+ esac
+changequote([,])dnl
+ AC_SUBST([XGETTEXT_015])
+
+ dnl Search for GNU msgmerge 0.11 or newer in the PATH.
+ AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
+ [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
+
+ dnl Installation directories.
+ dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
+ dnl have to define it here, so that it can be used in po/Makefile.
+ test -n "$localedir" || localedir='${datadir}/locale'
+ AC_SUBST([localedir])
+
+ dnl Support for AM_XGETTEXT_OPTION.
+ test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
+ AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
+
+ AC_CONFIG_COMMANDS([po-directories], [[
+ for ac_file in $CONFIG_FILES; do
+ # Support "outfile[:infile[:infile...]]"
+ case "$ac_file" in
+ *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ esac
+ # PO directories have a Makefile.in generated from Makefile.in.in.
+ case "$ac_file" in */Makefile.in)
+ # Adjust a relative srcdir.
+ ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
+ ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
+ ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+ # In autoconf-2.13 it is called $ac_given_srcdir.
+ # In autoconf-2.50 it is called $srcdir.
+ test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
+ case "$ac_given_srcdir" in
+ .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
+ /*) top_srcdir="$ac_given_srcdir" ;;
+ *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+ # Treat a directory as a PO directory if and only if it has a
+ # POTFILES.in file. This allows packages to have multiple PO
+ # directories under different names or in different locations.
+ if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
+ rm -f "$ac_dir/POTFILES"
+ test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
+ cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
+ POMAKEFILEDEPS="POTFILES.in"
+ # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
+ # on $ac_dir but don't depend on user-specified configuration
+ # parameters.
+ if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
+ # The LINGUAS file contains the set of available languages.
+ if test -n "$OBSOLETE_ALL_LINGUAS"; then
+ test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
+ fi
+ ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+ # Hide the ALL_LINGUAS assigment from automake < 1.5.
+ eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+ POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+ else
+ # The set of available languages was given in configure.in.
+ # Hide the ALL_LINGUAS assigment from automake < 1.5.
+ eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
+ fi
+ # Compute POFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
+ # Compute UPDATEPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
+ # Compute DUMMYPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
+ # Compute GMOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
+ case "$ac_given_srcdir" in
+ .) srcdirpre= ;;
+ *) srcdirpre='$(srcdir)/' ;;
+ esac
+ POFILES=
+ UPDATEPOFILES=
+ DUMMYPOFILES=
+ GMOFILES=
+ for lang in $ALL_LINGUAS; do
+ POFILES="$POFILES $srcdirpre$lang.po"
+ UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
+ DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
+ GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
+ done
+ # CATALOGS depends on both $ac_dir and the user's LINGUAS
+ # environment variable.
+ INST_LINGUAS=
+ if test -n "$ALL_LINGUAS"; then
+ for presentlang in $ALL_LINGUAS; do
+ useit=no
+ if test "%UNSET%" != "$LINGUAS"; then
+ desiredlanguages="$LINGUAS"
+ else
+ desiredlanguages="$ALL_LINGUAS"
+ fi
+ for desiredlang in $desiredlanguages; do
+ # Use the presentlang catalog if desiredlang is
+ # a. equal to presentlang, or
+ # b. a variant of presentlang (because in this case,
+ # presentlang can be used as a fallback for messages
+ # which are not translated in the desiredlang catalog).
+ case "$desiredlang" in
+ "$presentlang"*) useit=yes;;
+ esac
+ done
+ if test $useit = yes; then
+ INST_LINGUAS="$INST_LINGUAS $presentlang"
+ fi
+ done
+ fi
+ CATALOGS=
+ if test -n "$INST_LINGUAS"; then
+ for lang in $INST_LINGUAS; do
+ CATALOGS="$CATALOGS $lang.gmo"
+ done
+ fi
+ test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
+ sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
+ for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
+ if test -f "$f"; then
+ case "$f" in
+ *.orig | *.bak | *~) ;;
+ *) cat "$f" >> "$ac_dir/Makefile" ;;
+ esac
+ fi
+ done
+ fi
+ ;;
+ esac
+ done]],
+ [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
+ # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
+ # from automake < 1.5.
+ eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
+ # Capture the value of LINGUAS because we need it to compute CATALOGS.
+ LINGUAS="${LINGUAS-%UNSET%}"
+ ])
+])
+
+dnl Postprocesses a Makefile in a directory containing PO files.
+AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
+[
+ # When this code is run, in config.status, two variables have already been
+ # set:
+ # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
+ # - LINGUAS is the value of the environment variable LINGUAS at configure
+ # time.
+
+changequote(,)dnl
+ # Adjust a relative srcdir.
+ ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
+ ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
+ ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+ # In autoconf-2.13 it is called $ac_given_srcdir.
+ # In autoconf-2.50 it is called $srcdir.
+ test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
+ case "$ac_given_srcdir" in
+ .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
+ /*) top_srcdir="$ac_given_srcdir" ;;
+ *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+ # Find a way to echo strings without interpreting backslash.
+ if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
+ gt_echo='echo'
+ else
+ if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
+ gt_echo='printf %s\n'
+ else
+ echo_func () {
+ cat <<EOT
+$*
+EOT
+ }
+ gt_echo='echo_func'
+ fi
+ fi
+
+ # A sed script that extracts the value of VARIABLE from a Makefile.
+ sed_x_variable='
+# Test if the hold space is empty.
+x
+s/P/P/
+x
+ta
+# Yes it was empty. Look if we have the expected variable definition.
+/^[ ]*VARIABLE[ ]*=/{
+ # Seen the first line of the variable definition.
+ s/^[ ]*VARIABLE[ ]*=//
+ ba
+}
+bd
+:a
+# Here we are processing a line from the variable definition.
+# Remove comment, more precisely replace it with a space.
+s/#.*$/ /
+# See if the line ends in a backslash.
+tb
+:b
+s/\\$//
+# Print the line, without the trailing backslash.
+p
+tc
+# There was no trailing backslash. The end of the variable definition is
+# reached. Clear the hold space.
+s/^.*$//
+x
+bd
+:c
+# A trailing backslash means that the variable definition continues in the
+# next line. Put a nonempty string into the hold space to indicate this.
+s/^.*$/P/
+x
+:d
+'
+changequote([,])dnl
+
+ # Set POTFILES to the value of the Makefile variable POTFILES.
+ sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
+ POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
+ # Compute POTFILES_DEPS as
+ # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
+ POTFILES_DEPS=
+ for file in $POTFILES; do
+ POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
+ done
+ POMAKEFILEDEPS=""
+
+ if test -n "$OBSOLETE_ALL_LINGUAS"; then
+ test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
+ fi
+ if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
+ # The LINGUAS file contains the set of available languages.
+ ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+ POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+ else
+ # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
+ sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
+ ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
+ fi
+ # Hide the ALL_LINGUAS assigment from automake < 1.5.
+ eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+ # Compute POFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
+ # Compute UPDATEPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
+ # Compute DUMMYPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
+ # Compute GMOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
+ # Compute PROPERTIESFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
+ # Compute CLASSFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
+ # Compute QMFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
+ # Compute MSGFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
+ # Compute RESOURCESDLLFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
+ case "$ac_given_srcdir" in
+ .) srcdirpre= ;;
+ *) srcdirpre='$(srcdir)/' ;;
+ esac
+ POFILES=
+ UPDATEPOFILES=
+ DUMMYPOFILES=
+ GMOFILES=
+ PROPERTIESFILES=
+ CLASSFILES=
+ QMFILES=
+ MSGFILES=
+ RESOURCESDLLFILES=
+ for lang in $ALL_LINGUAS; do
+ POFILES="$POFILES $srcdirpre$lang.po"
+ UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
+ DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
+ GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
+ PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
+ CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
+ QMFILES="$QMFILES $srcdirpre$lang.qm"
+ frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+ MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
+ frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
+ RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
+ done
+ # CATALOGS depends on both $ac_dir and the user's LINGUAS
+ # environment variable.
+ INST_LINGUAS=
+ if test -n "$ALL_LINGUAS"; then
+ for presentlang in $ALL_LINGUAS; do
+ useit=no
+ if test "%UNSET%" != "$LINGUAS"; then
+ desiredlanguages="$LINGUAS"
+ else
+ desiredlanguages="$ALL_LINGUAS"
+ fi
+ for desiredlang in $desiredlanguages; do
+ # Use the presentlang catalog if desiredlang is
+ # a. equal to presentlang, or
+ # b. a variant of presentlang (because in this case,
+ # presentlang can be used as a fallback for messages
+ # which are not translated in the desiredlang catalog).
+ case "$desiredlang" in
+ "$presentlang"*) useit=yes;;
+ esac
+ done
+ if test $useit = yes; then
+ INST_LINGUAS="$INST_LINGUAS $presentlang"
+ fi
+ done
+ fi
+ CATALOGS=
+ JAVACATALOGS=
+ QTCATALOGS=
+ TCLCATALOGS=
+ CSHARPCATALOGS=
+ if test -n "$INST_LINGUAS"; then
+ for lang in $INST_LINGUAS; do
+ CATALOGS="$CATALOGS $lang.gmo"
+ JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
+ QTCATALOGS="$QTCATALOGS $lang.qm"
+ frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+ TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
+ frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
+ CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
+ done
+ fi
+
+ sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
+ if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
+ # Add dependencies that cannot be formulated as a simple suffix rule.
+ for lang in $ALL_LINGUAS; do
+ frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+ cat >> "$ac_file.tmp" <<EOF
+$frobbedlang.msg: $lang.po
+ @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
+ \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
+EOF
+ done
+ fi
+ if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
+ # Add dependencies that cannot be formulated as a simple suffix rule.
+ for lang in $ALL_LINGUAS; do
+ frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
+ cat >> "$ac_file.tmp" <<EOF
+$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
+ @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
+ \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
+EOF
+ done
+ fi
+ if test -n "$POMAKEFILEDEPS"; then
+ cat >> "$ac_file.tmp" <<EOF
+Makefile: $POMAKEFILEDEPS
+EOF
+ fi
+ mv "$ac_file.tmp" "$ac_file"
+])
+
+dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
+AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
+[
+ XGETTEXT_EXTRA_OPTIONS=
+])
+
+dnl Registers an option to be passed to xgettext in the po subdirectory.
+AC_DEFUN([AM_XGETTEXT_OPTION],
+[
+ AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
+ XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
+])
diff --git a/extension/m4/progtest.m4 b/extension/m4/progtest.m4
new file mode 100644
index 00000000..2d804ac9
--- /dev/null
+++ b/extension/m4/progtest.m4
@@ -0,0 +1,92 @@
+# progtest.m4 serial 6 (gettext-0.18)
+dnl Copyright (C) 1996-2003, 2005, 2008-2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+AC_PREREQ([2.50])
+
+# Search path for a program which passes the given test.
+
+dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
+dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
+AC_DEFUN([AM_PATH_PROG_WITH_TEST],
+[
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+ ac_executable_p="test -x"
+else
+ ac_executable_p="test -f"
+fi
+rm -f conf$$.file
+
+# Extract the first word of "$2", so it can be a program name with args.
+set dummy $2; ac_word=[$]2
+AC_MSG_CHECKING([for $ac_word])
+AC_CACHE_VAL([ac_cv_path_$1],
+[case "[$]$1" in
+ [[\\/]]* | ?:[[\\/]]*)
+ ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
+ ;;
+ *)
+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in ifelse([$5], , $PATH, [$5]); do
+ IFS="$ac_save_IFS"
+ test -z "$ac_dir" && ac_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+ echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
+ if [$3]; then
+ ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
+ break 2
+ fi
+ fi
+ done
+ done
+ IFS="$ac_save_IFS"
+dnl If no 4th arg is given, leave the cache variable unset,
+dnl so AC_PATH_PROGS will keep looking.
+ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
+])dnl
+ ;;
+esac])dnl
+$1="$ac_cv_path_$1"
+if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
+ AC_MSG_RESULT([$][$1])
+else
+ AC_MSG_RESULT([no])
+fi
+AC_SUBST([$1])dnl
+])
diff --git a/extension/ordchr.3am b/extension/ordchr.3am
new file mode 100644
index 00000000..86312a3a
--- /dev/null
+++ b/extension/ordchr.3am
@@ -0,0 +1,77 @@
+.TH ORDCHR 3am "Aug 08 2012" "Free Software Foundation" "GNU Awk Extension Modules"
+.SH NAME
+ordchr \- convert characters to strings and vice versa
+.SH SYNOPSIS
+.ft CW
+@load "ordchr"
+.sp
+number = ord("A")
+.br
+string = chr(65)
+.ft R
+.SH DESCRIPTION
+The
+.I ordchr
+extension adds two functions named
+.BR ord() .
+and
+.BR chr() ,
+as follows.
+.TP
+.B ord()
+This function takes a string argument, and returns the
+numeric value of the first character in the string.
+.TP
+.B chr()
+This function takes a numeric argument and returns a string
+whose first character is that represented by the number.
+.PP
+These functions are inspired by the Pascal language functions
+of the same name.
+... .SH NOTES
+... .SH BUGS
+.SH EXAMPLE
+.ft CW
+.nf
+@load "ordchr"
+\&...
+printf("The numeric value of 'A' is %d\en", ord("A"))
+printf("The string value of 65 is %s\en", chr(65))
+.fi
+.ft R
+.SH "SEE ALSO"
+.IR "GAWK: Effective AWK Programming" ,
+.IR filefuncs (3am),
+.IR fnmatch (3am),
+.IR fork (3am),
+.IR readdir (3am),
+.IR readfile (3am),
+.IR revoutput (3am),
+.IR rwarray (3am),
+.IR time (3am).
+.SH AUTHOR
+Arnold Robbins,
+.BR arnold@skeeve.com .
+.SH COPYING PERMISSIONS
+Copyright \(co 2012
+Free Software Foundation, Inc.
+.PP
+Permission is granted to make and distribute verbatim copies of
+this manual page provided the copyright notice and this permission
+notice are preserved on all copies.
+.ig
+Permission is granted to process this file through troff and print the
+results, provided the printed document carries copying permission
+notice identical to this one except for the removal of this paragraph
+(this paragraph not being relevant to the printed manual page).
+..
+.PP
+Permission is granted to copy and distribute modified versions of this
+manual page under the conditions for verbatim copying, provided that
+the entire resulting derived work is distributed under the terms of a
+permission notice identical to this one.
+.PP
+Permission is granted to copy and distribute translations of this
+manual page into another language, under the above conditions for
+modified versions, except that this permission notice may be stated in
+a translation approved by the Foundation.
diff --git a/extension/ordchr.c b/extension/ordchr.c
index efbc6d56..7e3eda5e 100644
--- a/extension/ordchr.c
+++ b/extension/ordchr.c
@@ -5,10 +5,11 @@
* arnold@skeeve.com
* 8/2001
* Revised 6/2004
+ * Revised 5/2012
*/
/*
- * Copyright (C) 2001, 2004, 2011 the Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2004, 2011, 2012 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -28,71 +29,97 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include "awk.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "gawkapi.h"
+
+#include "gettext.h"
+#define _(msgid) gettext(msgid)
+#define N_(msgid) msgid
+
+static const gawk_api_t *api; /* for convenience macros to work */
+static awk_ext_id_t *ext_id;
+static const char *ext_version = "ordchr extension: version 1.0";
+static awk_bool_t (*init_func)(void) = NULL;
int plugin_is_GPL_compatible;
/* do_ord --- return numeric value of first char of string */
-static NODE *
-do_ord(int nargs)
+static awk_value_t *
+do_ord(int nargs, awk_value_t *result)
{
- NODE *str;
- int ret = -1;
+ awk_value_t str;
+ double ret = -1;
- if (do_lint && get_curfunc_arg_count() > 1)
- lintwarn("ord: called with too many arguments");
+ assert(result != NULL);
- str = get_scalar_argument(0, FALSE);
- if (str != NULL) {
- (void) force_string(str);
- ret = str->stptr[0];
- } else if (do_lint)
- lintwarn("ord: called with no arguments");
+ if (do_lint && nargs > 1)
+ lintwarn(ext_id, _("ord: called with too many arguments"));
+ if (get_argument(0, AWK_STRING, & str)) {
+ ret = str.str_value.str[0];
+ } else if (do_lint) {
+ if (nargs == 0)
+ lintwarn(ext_id, _("ord: called with no arguments"));
+ else
+ lintwarn(ext_id, _("ord: called with inappropriate argument(s)"));
+ }
/* Set the return value */
- return make_number((AWKNUM) ret);
+ return make_number(ret, result);
}
/* do_chr --- turn numeric value into a string */
-static NODE *
-do_chr(int nargs)
+static awk_value_t *
+do_chr(int nargs, awk_value_t *result)
{
- NODE *num;
+ awk_value_t num;
unsigned int ret = 0;
- AWKNUM val = 0.0;
+ double val = 0.0;
char str[2];
str[0] = str[1] = '\0';
- if (do_lint && get_curfunc_arg_count() > 1)
- lintwarn("chr: called with too many arguments");
+ assert(result != NULL);
+
+ if (do_lint && nargs > 1)
+ lintwarn(ext_id, _("chr: called with too many arguments"));
- num = get_scalar_argument(0, FALSE);
- if (num != NULL) {
- val = force_number(num);
+ if (get_argument(0, AWK_NUMBER, & num)) {
+ val = num.num_value;
ret = val; /* convert to int */
ret &= 0xff;
str[0] = ret;
str[1] = '\0';
- } else if (do_lint)
- lintwarn("chr: called with no arguments");
+ } else if (do_lint) {
+ if (nargs == 0)
+ lintwarn(ext_id, _("chr: called with no arguments"));
+ else
+ lintwarn(ext_id, _("chr: called with inappropriate argument(s)"));
+ }
/* Set the return value */
- return make_string(str, 1);
+ return make_const_string(str, 1, result);
}
-/* dlload --- load new builtins in this library */
+static awk_ext_func_t func_table[] = {
+ { "ord", do_ord, 1 },
+ { "chr", do_chr, 1 },
+};
-NODE *
-dlload(tree, dl)
-NODE *tree;
-void *dl;
-{
- make_builtin("ord", do_ord, 1);
- make_builtin("chr", do_chr, 1);
+/* define the dl_load function using the boilerplate macro */
- return make_number((AWKNUM) 0);
-}
+dl_load_func(func_table, ord_chr, "")
diff --git a/extension/readdir.3am b/extension/readdir.3am
new file mode 100644
index 00000000..9d60b054
--- /dev/null
+++ b/extension/readdir.3am
@@ -0,0 +1,130 @@
+.TH READDIR 3am "Sep 11 2012" "Free Software Foundation" "GNU Awk Extension Modules"
+.SH NAME
+readdir \- directory input parser for gawk
+.SH SYNOPSIS
+.ft CW
+@load "readdir"
+.sp
+readdir_do_ftype("stat") # or "dirent" or "never"
+.ft R
+.SH DESCRIPTION
+The
+.I readdir
+extension
+adds an input parser for directories, and
+adds a single function named
+.BR readdir_do_ftype() .
+.PP
+When this extension is in use, instead of skipping directories named
+on the command line (or with
+.BR getline ),
+they are read, with each entry returned as a record.
+.PP
+The record consists of at least two fields: the inode number and the
+filename, separated by a forward slash character.
+On systems where the directory entry contains the file type, the record
+has a third field which is a single letter indicating the type of the
+file:
+.B f
+for file,
+.B d
+for directory,
+.B b
+for a block device,
+.B c
+for a character device,
+.B p
+for a FIFO,
+.B l
+for a symbolic link,
+.B s
+for a socket, and
+.B u
+(unknown) for anything else.
+.PP
+On systems without the file type information, calling
+.B readdir_do_ftype("stat")
+causes the extension to use
+.IR lstat (2)
+to retrieve the appropriate information. This is not the default, since
+.IR lstat (2)
+is a potentially expensive operation. By calling
+.B readdir_do_ftype("never")
+one can ensure that the file type
+information is never displayed, even when readily available in the
+directory entry.
+.PP
+The third option,
+.BR readdir_do_ftype("dirent") ,
+takes file type information from the directory entry, if it is available.
+This is the default on systems that supply this information.
+.PP
+The
+.B readdir_do_ftype()
+function will set
+.B ERRNO
+if called without arguments or with invalid arguments.
+.SH NOTES
+On GNU/Linux systems, there are filesystems that don't support the
+.B d_type
+entry (see
+.IR readdir (3)),
+and so the file type is always
+.BR u .
+Therefore, using
+.B readdir_do_ftype("stat")
+is advisable even on GNU/Linux systems. In this case, the
+.I readdir
+extension will fall back to using
+.IR lstat (2)
+when it encounters an unknown file type.
+... .SH BUGS
+.SH EXAMPLE
+.ft CW
+.nf
+@load "readdir"
+\&...
+BEGIN { FS = "/" }
+{ print "file name is", $2 }
+.fi
+.ft R
+.SH "SEE ALSO"
+.IR "GAWK: Effective AWK Programming" ,
+.IR filefuncs (3am),
+.IR fnmatch (3am),
+.IR fork (3am),
+.IR ordchr (3am),
+.IR readfile (3am),
+.IR revoutput (3am),
+.IR rwarray (3am),
+.IR time (3am).
+.PP
+.IR opendir (3),
+.IR readdir (3),
+.IR stat (2).
+.SH AUTHOR
+Arnold Robbins,
+.BR arnold@skeeve.com .
+.SH COPYING PERMISSIONS
+Copyright \(co 2012
+Free Software Foundation, Inc.
+.PP
+Permission is granted to make and distribute verbatim copies of
+this manual page provided the copyright notice and this permission
+notice are preserved on all copies.
+.ig
+Permission is granted to process this file through troff and print the
+results, provided the printed document carries copying permission
+notice identical to this one except for the removal of this paragraph
+(this paragraph not being relevant to the printed manual page).
+..
+.PP
+Permission is granted to copy and distribute modified versions of this
+manual page under the conditions for verbatim copying, provided that
+the entire resulting derived work is distributed under the terms of a
+permission notice identical to this one.
+.PP
+Permission is granted to copy and distribute translations of this
+manual page into another language, under the above conditions for
+modified versions, except that this permission notice may be stated in
+a translation approved by the Foundation.
diff --git a/extension/readdir.c b/extension/readdir.c
new file mode 100644
index 00000000..7d126d03
--- /dev/null
+++ b/extension/readdir.c
@@ -0,0 +1,343 @@
+/*
+ * readdir.c --- Provide an input parser to read directories
+ *
+ * Arnold Robbins
+ * arnold@skeeve.com
+ * Written 7/2012
+ *
+ * Andrew Schorr and Arnold Robbins: further fixes 8/2012.
+ */
+
+/*
+ * Copyright (C) 2012 the Free Software Foundation, Inc.
+ *
+ * This file is part of GAWK, the GNU implementation of the
+ * AWK Programming Language.
+ *
+ * GAWK is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GAWK is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#define _BSD_SOURCE
+#include <stdio.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#ifdef HAVE_DIRENT_H
+#include <dirent.h>
+#else
+#error Cannot compile the dirent extension on this system!
+#endif
+
+#include "gawkapi.h"
+
+#include "gettext.h"
+#define _(msgid) gettext(msgid)
+#define N_(msgid) msgid
+
+static const gawk_api_t *api; /* for convenience macros to work */
+static awk_ext_id_t *ext_id;
+static const char *ext_version = "readdir extension: version 1.0";
+
+static awk_bool_t init_readdir(void);
+static awk_bool_t (*init_func)(void) = init_readdir;
+
+int plugin_is_GPL_compatible;
+
+enum {
+ NEVER_DO_INFO,
+ USE_DIRENT_INFO,
+ USE_STAT_INFO
+} do_ftype =
+#ifdef DT_BLK
+ USE_DIRENT_INFO
+#else
+ NEVER_DO_INFO
+#endif
+ ;
+
+/* ftype --- return type of file as a single character string */
+
+static const char *
+ftype(struct dirent *entry)
+{
+ struct stat sbuf;
+
+#ifdef DT_BLK
+ switch (entry->d_type) {
+ case DT_BLK: return "b";
+ case DT_CHR: return "c";
+ case DT_DIR: return "d";
+ case DT_FIFO: return "p";
+ case DT_LNK: return "l";
+ case DT_REG: return "f";
+ case DT_SOCK: return "s";
+ default:
+ case DT_UNKNOWN:
+ /*
+ * Could be that filesystem doesn't support d_type,
+ * even if the OS does. (E.g., XFS on GNU/Linux).
+ * So let lstat() do it.
+ */
+ break;
+ }
+#endif
+
+ if (do_ftype < USE_STAT_INFO)
+ /*
+ * Avoid "/u" since user did not insist on file type info,
+ * and it does not seem to be supported by dirent on this
+ * filesystem.
+ */
+ return NULL;
+
+ /* Should we set ERRNO here? */
+ if (lstat(entry->d_name, & sbuf) < 0)
+ return "u";
+
+ switch (sbuf.st_mode & S_IFMT) {
+ case S_IFREG: return "f";
+ case S_IFBLK: return "b";
+ case S_IFCHR: return "c";
+ case S_IFDIR: return "d";
+#ifdef S_IFSOCK
+ case S_IFSOCK: return "s";
+#endif
+#ifdef S_IFIFO
+ case S_IFIFO: return "p";
+#endif
+#ifdef S_IFLNK
+ case S_IFLNK: return "l";
+#endif
+#ifdef S_IFDOOR /* Solaris weirdness */
+ case S_IFDOOR: return "D";
+#endif /* S_IFDOOR */
+ }
+ return "u";
+}
+
+/* data type for the opaque pointer: */
+
+typedef struct open_directory {
+ DIR *dp;
+ char *buf;
+} open_directory_t;
+
+/* dir_get_record --- get one record at a time out of a directory */
+
+static int
+dir_get_record(char **out, awk_input_buf_t *iobuf, int *errcode,
+ char **rt_start, size_t *rt_len)
+{
+ DIR *dp;
+ struct dirent *dirent;
+ int len;
+ open_directory_t *the_dir;
+
+ /*
+ * The caller sets *errcode to 0, so we should set it only if an
+ * error occurs.
+ */
+
+ if (out == NULL || iobuf == NULL || iobuf->opaque == NULL)
+ return EOF;
+
+ the_dir = (open_directory_t *) iobuf->opaque;
+ dp = the_dir->dp;
+
+ /*
+ * Initialize errno, since readdir does not set it to zero on EOF.
+ */
+ errno = 0;
+ dirent = readdir(dp);
+ if (dirent == NULL) {
+ *errcode = errno; /* in case there was an error */
+ return EOF;
+ }
+
+#ifdef ZOS_USS
+ len = sprintf(the_dir->buf, "%lu/%s",
+ (unsigned long) dirent->d_ino,
+ dirent->d_name);
+#else
+ len = sprintf(the_dir->buf, "%llu/%s",
+ (unsigned long long) dirent->d_ino,
+ dirent->d_name);
+#endif
+
+ if (do_ftype != NEVER_DO_INFO) {
+ const char *ftstr = ftype(dirent);
+ if (ftstr)
+ len += sprintf(the_dir->buf + len, "/%s", ftstr);
+ }
+
+ *out = the_dir->buf;
+
+ *rt_len = 0; /* set RT to "" */
+ return len;
+}
+
+/* dir_close --- close up when done */
+
+static void
+dir_close(awk_input_buf_t *iobuf)
+{
+ open_directory_t *the_dir;
+
+ if (iobuf == NULL || iobuf->opaque == NULL)
+ return;
+
+ the_dir = (open_directory_t *) iobuf->opaque;
+
+ closedir(the_dir->dp);
+ free(the_dir->buf);
+ free(the_dir);
+
+ iobuf->fd = -1;
+}
+
+/* dir_can_take_file --- return true if we want the file */
+
+static awk_bool_t
+dir_can_take_file(const awk_input_buf_t *iobuf)
+{
+ if (iobuf == NULL)
+ return 0;
+
+ return (iobuf->fd != INVALID_HANDLE && S_ISDIR(iobuf->sbuf.st_mode));
+}
+
+/*
+ * dir_take_control_of --- set up input parser.
+ * We can assume that dir_can_take_file just returned true,
+ * and no state has changed since then.
+ */
+
+static awk_bool_t
+dir_take_control_of(awk_input_buf_t *iobuf)
+{
+ DIR *dp;
+ open_directory_t *the_dir;
+ size_t size;
+
+ errno = 0;
+#ifdef HAVE_FDOPENDIR
+ dp = fdopendir(iobuf->fd);
+#else
+ dp = opendir(iobuf->name);
+ if (dp != NULL)
+ iobuf->fd = dirfd(dp);
+#endif
+ if (dp == NULL) {
+ warning(ext_id, _("dir_take_control_of: opendir/fdopendir failed: %s"),
+ strerror(errno));
+ update_ERRNO_int(errno);
+ return 0;
+ }
+
+ emalloc(the_dir, open_directory_t *, sizeof(open_directory_t), "dir_take_control_of");
+ the_dir->dp = dp;
+ size = sizeof(struct dirent) + 21 /* max digits in inode */ + 2 /* slashes */;
+ emalloc(the_dir->buf, char *, size, "dir_take_control_of");
+
+ iobuf->opaque = the_dir;
+ iobuf->get_record = dir_get_record;
+ iobuf->close_func = dir_close;
+
+ return 1;
+}
+
+static awk_input_parser_t readdir_parser = {
+ "readdir",
+ dir_can_take_file,
+ dir_take_control_of,
+ NULL
+};
+
+#ifdef TEST_DUPLICATE
+static awk_input_parser_t readdir_parser2 = {
+ "readdir2",
+ dir_can_take_file,
+ dir_take_control_of,
+ NULL
+};
+#endif
+
+/* init_readdir --- set things ups */
+
+static awk_bool_t
+init_readdir()
+{
+ register_input_parser(& readdir_parser);
+#ifdef TEST_DUPLICATE
+ register_input_parser(& readdir_parser2);
+#endif
+
+ return 1;
+}
+
+/* do_readdir_do_ftype --- enable / disable ftype where need to do stat */
+
+static awk_value_t *
+do_readdir_do_ftype(int nargs, awk_value_t *result)
+{
+ awk_value_t flag;
+
+ make_number(1.0, result);
+ if (nargs < 1) {
+ warning(ext_id, _("readdir_do_ftype: called with no arguments"));
+ update_ERRNO_int(EINVAL);
+ make_number(0.0, result);
+ goto out;
+ } else if (do_lint && nargs > 3)
+ lintwarn(ext_id, _("readdir_do_ftype: called with more than one argument"));
+
+ if (! get_argument(0, AWK_STRING, & flag)) {
+ warning(ext_id, _("readdir_do_ftype: could not get argument"));
+ update_ERRNO_int(EINVAL);
+ make_number(0.0, result);
+ goto out;
+ }
+
+ if (strcmp(flag.str_value.str, "never") == 0)
+ do_ftype = NEVER_DO_INFO;
+ else if (strcmp(flag.str_value.str, "dirent") == 0)
+ do_ftype = USE_DIRENT_INFO;
+ else if (strcmp(flag.str_value.str, "stat") == 0)
+ do_ftype = USE_STAT_INFO;
+ else {
+ update_ERRNO_int(EINVAL);
+ make_number(0.0, result);
+ }
+
+out:
+ return result;
+}
+
+static awk_ext_func_t func_table[] = {
+ { "readdir_do_ftype", do_readdir_do_ftype, 1 },
+};
+
+/* define the dl_load function using the boilerplate macro */
+
+dl_load_func(func_table, readdir, "")
diff --git a/extension/readfile.3am b/extension/readfile.3am
new file mode 100644
index 00000000..8daec423
--- /dev/null
+++ b/extension/readfile.3am
@@ -0,0 +1,70 @@
+.TH READFILE 3am "Aug 08 2012" "Free Software Foundation" "GNU Awk Extension Modules"
+.SH NAME
+readfile \- return the entire contents of a file as a string
+.SH SYNOPSIS
+.ft CW
+@load "readfile"
+.sp
+result = readfile("/some/path")
+.ft R
+.SH DESCRIPTION
+The
+.I readfile
+extension adds a single function named
+.BR readfile() .
+The argument is the name of the file to read.
+The return value is a string containing the entire contents of
+the requested file.
+.PP
+Upon error, the function returns the empty string and sets
+.BR ERRNO .
+... .SH NOTES
+... .SH BUGS
+.SH EXAMPLE
+.ft CW
+.nf
+@load "readfile"
+\&...
+contents = readfile("/path/to/file");
+if (contents == "" && ERRNO != "") {
+ print("problem reading file", ERRNO) > "/dev/stderr"
+ ...
+}
+.fi
+.ft R
+.SH "SEE ALSO"
+.IR "GAWK: Effective AWK Programming" ,
+.IR filefuncs (3am),
+.IR fnmatch (3am),
+.IR fork (3am),
+.IR ordchr (3am),
+.IR readdir (3am),
+.IR revoutput (3am),
+.IR rwarray (3am),
+.IR time (3am).
+.SH AUTHOR
+Arnold Robbins,
+.BR arnold@skeeve.com .
+.SH COPYING PERMISSIONS
+Copyright \(co 2012
+Free Software Foundation, Inc.
+.PP
+Permission is granted to make and distribute verbatim copies of
+this manual page provided the copyright notice and this permission
+notice are preserved on all copies.
+.ig
+Permission is granted to process this file through troff and print the
+results, provided the printed document carries copying permission
+notice identical to this one except for the removal of this paragraph
+(this paragraph not being relevant to the printed manual page).
+..
+.PP
+Permission is granted to copy and distribute modified versions of this
+manual page under the conditions for verbatim copying, provided that
+the entire resulting derived work is distributed under the terms of a
+permission notice identical to this one.
+.PP
+Permission is granted to copy and distribute translations of this
+manual page into another language, under the above conditions for
+modified versions, except that this permission notice may be stated in
+a translation approved by the Foundation.
diff --git a/extension/readfile.c b/extension/readfile.c
index e6ee0f22..7d5f78af 100644
--- a/extension/readfile.c
+++ b/extension/readfile.c
@@ -7,10 +7,11 @@
* Mon Jun 9 17:05:11 IDT 2003
* Revised for new dynamic function facilities
* Mon Jun 14 14:53:07 IDT 2004
+ * Revised for formal API May 2012
*/
/*
- * Copyright (C) 2002, 2003, 2004, 2011 the Free Software Foundation, Inc.
+ * Copyright (C) 2002, 2003, 2004, 2011, 2012 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -30,47 +31,70 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include "awk.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <assert.h>
+#include <errno.h>
#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "gawkapi.h"
+
+#include "gettext.h"
+#define _(msgid) gettext(msgid)
+#define N_(msgid) msgid
#ifndef O_BINARY
#define O_BINARY 0
#endif
+static const gawk_api_t *api; /* for convenience macros to work */
+static awk_ext_id_t *ext_id;
+static const char *ext_version = "readfile extension: version 1.0";
+static awk_bool_t (*init_func)(void) = NULL;
+
int plugin_is_GPL_compatible;
/* do_readfile --- read a file into memory */
-NODE *
-do_readfile(int nargs)
+static awk_value_t *
+do_readfile(int nargs, awk_value_t *result)
{
- NODE *filename;
- int ret = -1;
+ awk_value_t filename;
+ int ret;
struct stat sbuf;
char *text;
int fd;
- if (do_lint && get_curfunc_arg_count() > 1)
- lintwarn("readfile: called with too many arguments");
+ assert(result != NULL);
+ make_null_string(result); /* default return value */
+
+ if (do_lint && nargs > 1)
+ lintwarn(ext_id, _("readfile: called with too many arguments"));
- filename = get_scalar_argument(0, FALSE);
- if (filename != NULL) {
- (void) force_string(filename);
+ unset_ERRNO();
- ret = stat(filename->stptr, & sbuf);
+ if (get_argument(0, AWK_STRING, &filename)) {
+ ret = stat(filename.str_value.str, & sbuf);
if (ret < 0) {
- update_ERRNO();
+ update_ERRNO_int(errno);
goto done;
} else if ((sbuf.st_mode & S_IFMT) != S_IFREG) {
errno = EINVAL;
- ret = -1;
- update_ERRNO();
+ update_ERRNO_int(errno);
goto done;
}
- if ((fd = open(filename->stptr, O_RDONLY|O_BINARY)) < 0) {
- ret = -1;
- update_ERRNO();
+ if ((fd = open(filename.str_value.str, O_RDONLY|O_BINARY)) < 0) {
+ update_ERRNO_int(errno);
goto done;
}
@@ -79,31 +103,26 @@ do_readfile(int nargs)
if ((ret = read(fd, text, sbuf.st_size)) != sbuf.st_size) {
(void) close(fd);
- ret = -1;
- update_ERRNO();
+ update_ERRNO_int(errno);
goto done;
}
close(fd);
- return make_string(text, sbuf.st_size);
+ make_malloced_string(text, sbuf.st_size, result);
+ goto done;
} else if (do_lint)
- lintwarn("filename: called with no arguments");
+ lintwarn(ext_id, _("readfile: called with no arguments"));
done:
/* Set the return value */
- return make_number((AWKNUM) ret);
+ return result;
}
+static awk_ext_func_t func_table[] = {
+ { "readfile", do_readfile, 1 },
+};
-/* dlload --- load new builtins in this library */
+/* define the dl_load function using the boilerplate macro */
-NODE *
-dlload(tree, dl)
-NODE *tree;
-void *dl;
-{
- make_builtin("readfile", do_readfile, 1);
-
- return make_number((AWKNUM) 0);
-}
+dl_load_func(func_table, readfile, "")
diff --git a/extension/revoutput.3am b/extension/revoutput.3am
new file mode 100644
index 00000000..61e34124
--- /dev/null
+++ b/extension/revoutput.3am
@@ -0,0 +1,73 @@
+.TH REVOUTPUT 3am "Oct 14 2012" "Free Software Foundation" "GNU Awk Extension Modules"
+.SH NAME
+revoutput \- Reverse output strings sample extension
+.SH SYNOPSIS
+.ft CW
+@load "revoutput"
+.sp
+BEGIN { REVOUT = 1 } # Reverse all output strings
+.ft R
+.SH DESCRIPTION
+The
+.I revoutput
+extension
+adds a simple output wrapper that reverses the characters in each output
+line.
+It's main purpose is to show how to write an output wrapper, although
+it may be mildy amusing for the unwary.
+... .SH BUGS
+.SH EXAMPLE
+.ft CW
+.nf
+@load "revoutput"
+
+BEGIN {
+ REVOUT = 1
+ print "hello, world" > "/dev/stdout"
+}
+.fi
+.ft R
+.PP
+The output from this program is:
+.PP
+.ft CW
+.nf
+dlrow ,olleh
+.fi
+.ft R
+.SH "SEE ALSO"
+.IR "GAWK: Effective AWK Programming" ,
+.IR filefuncs (3am),
+.IR fnmatch (3am),
+.IR fork (3am),
+.IR ordchr (3am),
+.IR readdir (3am),
+.IR readfile (3am),
+.IR rwarray (3am),
+.IR time (3am).
+.SH AUTHOR
+Arnold Robbins,
+.BR arnold@skeeve.com .
+.SH COPYING PERMISSIONS
+Copyright \(co 2012
+Free Software Foundation, Inc.
+.PP
+Permission is granted to make and distribute verbatim copies of
+this manual page provided the copyright notice and this permission
+notice are preserved on all copies.
+.ig
+Permission is granted to process this file through troff and print the
+results, provided the printed document carries copying permission
+notice identical to this one except for the removal of this paragraph
+(this paragraph not being relevant to the printed manual page).
+..
+.PP
+Permission is granted to copy and distribute modified versions of this
+manual page under the conditions for verbatim copying, provided that
+the entire resulting derived work is distributed under the terms of a
+permission notice identical to this one.
+.PP
+Permission is granted to copy and distribute translations of this
+manual page into another language, under the above conditions for
+modified versions, except that this permission notice may be stated in
+a translation approved by the Foundation.
diff --git a/extension/revoutput.c b/extension/revoutput.c
new file mode 100644
index 00000000..0366672b
--- /dev/null
+++ b/extension/revoutput.c
@@ -0,0 +1,139 @@
+/*
+ * revoutput.c --- Provide an output wrapper that reverses lines.
+ *
+ * Arnold Robbins
+ * arnold@skeeve.com
+ * Written 8/2012
+ */
+
+/*
+ * Copyright (C) 2012 the Free Software Foundation, Inc.
+ *
+ * This file is part of GAWK, the GNU implementation of the
+ * AWK Programming Language.
+ *
+ * GAWK is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GAWK is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "gawkapi.h"
+
+#include "gettext.h"
+#define _(msgid) gettext(msgid)
+#define N_(msgid) msgid
+
+static const gawk_api_t *api; /* for convenience macros to work */
+static awk_ext_id_t *ext_id;
+static const char *ext_version = "revoutput extension: version 1.0";
+
+static awk_bool_t init_revoutput(void);
+static awk_bool_t (*init_func)(void) = init_revoutput;
+
+int plugin_is_GPL_compatible;
+
+/* rev_fwrite --- write out characters in reverse order */
+
+static size_t
+rev_fwrite(const void *buf, size_t size, size_t count, FILE *fp, void *opaque)
+{
+ const char *cp = buf;
+ int nbytes = size * count;
+
+ (void) opaque;
+
+ for (; nbytes >= 1; nbytes--)
+ putc(cp[nbytes-1], fp);
+
+ return (size * count);
+}
+
+
+/* revoutput_can_take_file --- return true if we want the file */
+
+static awk_bool_t
+revoutput_can_take_file(const awk_output_buf_t *outbuf)
+{
+ awk_value_t value;
+
+ if (outbuf == NULL)
+ return 0;
+
+ if (! sym_lookup("REVOUT", AWK_NUMBER, & value))
+ return 0;
+
+ return (value.num_value != 0);
+}
+
+/*
+ * revoutput_take_control_of --- set up output wrapper.
+ * We can assume that revoutput_can_take_file just returned true,
+ * and no state has changed since then.
+ */
+
+static awk_bool_t
+revoutput_take_control_of(awk_output_buf_t *outbuf)
+{
+ if (outbuf == NULL)
+ return 0;
+
+ outbuf->gawk_fwrite = rev_fwrite;
+ outbuf->redirected = 1;
+ return 1;
+}
+
+static awk_output_wrapper_t output_wrapper = {
+ "revoutput",
+ revoutput_can_take_file,
+ revoutput_take_control_of,
+ NULL
+};
+
+/* init_revoutput --- set things ups */
+
+static awk_bool_t
+init_revoutput()
+{
+ awk_value_t value;
+
+ register_output_wrapper(& output_wrapper);
+
+ make_number(0.0, & value); /* init to false */
+ if (! sym_update("REVOUT", & value)) {
+ warning(ext_id, _("revoutput: could not initialize REVOUT variable"));
+
+ return 0;
+ }
+
+ return 1;
+}
+
+static awk_ext_func_t func_table[] = {
+ { NULL, NULL, 0 }
+};
+
+/* define the dl_load function using the boilerplate macro */
+
+dl_load_func(func_table, revoutput, "")
diff --git a/extension/revtwoway.3am b/extension/revtwoway.3am
new file mode 100644
index 00000000..9f2f040a
--- /dev/null
+++ b/extension/revtwoway.3am
@@ -0,0 +1,63 @@
+.TH REVTWOWAY 3am "Oct 24 2012" "Free Software Foundation" "GNU Awk Extension Modules"
+.SH NAME
+revtwoway \- Reverse strings sample two-way processor extension
+.SH SYNOPSIS
+.ft CW
+@load "revtwoway"
+.sp
+.nf
+BEGIN {
+ cmd = "/magic/mirror"
+ print "hello, world" |& cmd
+ cmd |& getline result
+ print result
+ close(cmd)
+}
+.fi
+.ft R
+.SH DESCRIPTION
+The
+.I revtwoway
+extension
+adds a simple two-way processor that reverses the characters
+in each line sent to it for reading back by the AWK program.
+It's main purpose is to show how to write a two-way extension, although
+it may also be mildy amusing.
+... .SH BUGS
+.SH "SEE ALSO"
+.IR "GAWK: Effective AWK Programming" ,
+.IR filefuncs (3am),
+.IR fnmatch (3am),
+.IR fork (3am),
+.IR ordchr (3am),
+.IR readdir (3am),
+.IR readfile (3am),
+.IR revoutput (3am),
+.IR rwarray (3am),
+.IR time (3am).
+.SH AUTHOR
+Arnold Robbins,
+.BR arnold@skeeve.com .
+.SH COPYING PERMISSIONS
+Copyright \(co 2012
+Free Software Foundation, Inc.
+.PP
+Permission is granted to make and distribute verbatim copies of
+this manual page provided the copyright notice and this permission
+notice are preserved on all copies.
+.ig
+Permission is granted to process this file through troff and print the
+results, provided the printed document carries copying permission
+notice identical to this one except for the removal of this paragraph
+(this paragraph not being relevant to the printed manual page).
+..
+.PP
+Permission is granted to copy and distribute modified versions of this
+manual page under the conditions for verbatim copying, provided that
+the entire resulting derived work is distributed under the terms of a
+permission notice identical to this one.
+.PP
+Permission is granted to copy and distribute translations of this
+manual page into another language, under the above conditions for
+modified versions, except that this permission notice may be stated in
+a translation approved by the Foundation.
diff --git a/extension/revtwoway.c b/extension/revtwoway.c
new file mode 100644
index 00000000..0008d634
--- /dev/null
+++ b/extension/revtwoway.c
@@ -0,0 +1,336 @@
+/*
+ * revtwoway.c --- Provide a two-way processor that reverses lines.
+ *
+ * Arnold Robbins
+ * arnold@skeeve.com
+ * Written 8/2012
+ */
+
+/*
+ * Copyright (C) 2012 the Free Software Foundation, Inc.
+ *
+ * This file is part of GAWK, the GNU implementation of the
+ * AWK Programming Language.
+ *
+ * GAWK is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GAWK is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "gawkapi.h"
+
+#include "gettext.h"
+#define _(msgid) gettext(msgid)
+#define N_(msgid) msgid
+
+static const gawk_api_t *api; /* for convenience macros to work */
+static awk_ext_id_t *ext_id;
+static const char *ext_version = "revtwoway extension: version 1.0";
+
+static awk_bool_t init_revtwoway(void);
+static awk_bool_t (*init_func)(void) = init_revtwoway;
+
+int plugin_is_GPL_compatible;
+
+/*
+ * Use this variable to provide a value != INVALID_HANDLE in the awk_input_buf_t
+ * and != NULL in the awk_output_buf_t. The idea is to have a value that
+ * is greater than the largest allowable file descriptor.
+ */
+static size_t max_fds;
+
+#ifndef HAVE_GETDTABLESIZE
+/* getdtablesize --- replacement version that should be good enough */
+
+static inline int
+getdtablesize()
+{
+ /*
+ * Algorithm for the GNULIB folks:
+ *
+ * Set up a bitmap of 2048 elements.
+ * Initialize it to zero.
+ * In a loop, do
+ * fd = open("/dev/null", O_RDONLY)
+ * set the bit corresponding to fd in the bit map
+ * until it fails.
+ * Get the highest value that succeeded and increment it by one
+ * --> that is how many descriptors we have.
+ * Loop over the bitmap to close all the file descriptors we opened.
+ *
+ * Do all this upon the first call and return static values upon
+ * subsequent calls.
+ */
+
+ /* In the meantime, this is good enough for us: */
+ return 1024;
+}
+#endif
+
+/*
+ * IMPORTANT NOTE: This is a NOT a true general purpose
+ * extension. It is intended to demonstrate how to set up
+ * all the "plumbing" and to work one record at a time, ONLY.
+ *
+ * While it would be possible to set up buffering and manage it,
+ * that would duplicate a large chunk of the code in gawk's
+ * get_a_record() function, and there's no real point in doing that.
+ */
+
+/* the data in the opaque pointer */
+typedef struct two_way_proc_data {
+ size_t size; /* size of allocated buffer */
+ size_t len; /* how much is actually in use */
+ char *data;
+ size_t in_use; /* use count, must hit zero to be freed */
+} two_way_proc_data_t;
+
+/* close_two_proc_data --- release the data */
+
+static void
+close_two_proc_data(two_way_proc_data_t *proc_data)
+{
+ if (proc_data->in_use > 1) {
+ proc_data->in_use--;
+ return;
+ }
+
+ free(proc_data->data);
+ free(proc_data);
+}
+
+/*
+ * Input side of the two-way processor (input TO gawk)
+ */
+
+/* rev2way_get_record --- get one record at a time out of a directory */
+
+static int
+rev2way_get_record(char **out, awk_input_buf_t *iobuf, int *errcode,
+ char **rt_start, size_t *rt_len)
+{
+ int len = 0; /* for now */
+ two_way_proc_data_t *proc_data;
+
+ /*
+ * The caller sets *errcode to 0, so we should set it only if an
+ * error occurs.
+ */
+
+ if (out == NULL || iobuf == NULL || iobuf->opaque == NULL)
+ return EOF;
+
+ proc_data = (two_way_proc_data_t *) iobuf->opaque;
+ if (proc_data->len == 0)
+ return 0;
+
+ *out = proc_data->data;
+
+ len = proc_data->len;
+ proc_data->len = 0;
+
+ *rt_len = 0; /* default: set RT to "" */
+ if (proc_data->data[len-1] == '\n') {
+ while (proc_data->data[len-1] == '\n') {
+ len--;
+ (*rt_len)++;
+ }
+ *rt_start = proc_data->data + len;
+ }
+
+ return len;
+}
+
+/* rev2way_close --- close up input side when done */
+
+static void
+rev2way_close(awk_input_buf_t *iobuf)
+{
+ two_way_proc_data_t *proc_data;
+
+ if (iobuf == NULL || iobuf->opaque == NULL)
+ return;
+
+ proc_data = (two_way_proc_data_t *) iobuf->opaque;
+ close_two_proc_data(proc_data);
+
+ iobuf->fd = INVALID_HANDLE;
+}
+
+
+/*
+ * Output side of the two-way processor (output FROM gawk)
+ */
+
+/* rev2way_fwrite --- write out characters in reverse order */
+
+static size_t
+rev2way_fwrite(const void *buf, size_t size, size_t count, FILE *fp, void *opaque)
+{
+ two_way_proc_data_t *proc_data;
+ size_t amount, char_count;
+ char *src, *dest;
+
+ if (opaque == NULL)
+ return 0; /* error */
+
+ proc_data = (two_way_proc_data_t *) opaque;
+ amount = size * count;
+
+ /* do the dance */
+ if (amount > proc_data->size || proc_data->len > 0) {
+ if (proc_data->data == NULL)
+ emalloc(proc_data->data, char *, amount, "rev2way_fwrite");
+ else
+ erealloc(proc_data->data, char *, proc_data->size + amount, "rev2way_fwrite");
+ proc_data->size += amount;
+ }
+
+ src = (char *) buf + amount -1;
+ dest = proc_data->data + proc_data->len;
+ for (char_count = amount; char_count > 0; char_count--) {
+ /* copy in backwards */
+ *dest++ = *src--;
+ }
+ proc_data->len += amount;
+
+ return amount;
+}
+
+/* rev2way_fflush --- do nothing hook for fflush */
+
+static int
+rev2way_fflush(FILE *fp, void *opaque)
+{
+ (void) fp;
+ (void) opaque;
+
+ return 0;
+}
+
+/* rev2way_ferror --- do nothing hook for ferror */
+
+static int
+rev2way_ferror(FILE *fp, void *opaque)
+{
+ (void) fp;
+ (void) opaque;
+
+ return 0;
+}
+
+/* rev2way_fclose --- close output side of two-way processor */
+
+static int
+rev2way_fclose(FILE *fp, void *opaque)
+{
+ two_way_proc_data_t *proc_data;
+
+ if (opaque == NULL)
+ return EOF; /* error */
+
+ (void) fp;
+
+ proc_data = (two_way_proc_data_t *) opaque;
+ close_two_proc_data(proc_data);
+
+ return 0;
+}
+
+
+/* revtwoway_can_two_way --- return true if we want the file */
+
+static awk_bool_t
+revtwoway_can_take_two_way(const char *name)
+{
+ return (name != NULL && strcmp(name, "/magic/mirror") == 0);
+}
+
+/*
+ * revtwoway_take_control_of --- set up two way processor
+ * We can assume that revtwoway_can_take_two_way just returned true,
+ * and no state has changed since then.
+ */
+
+static awk_bool_t
+revtwoway_take_control_of(const char *name, awk_input_buf_t *inbuf, awk_output_buf_t *outbuf)
+{
+ two_way_proc_data_t *proc_data;
+
+ if (inbuf == NULL || outbuf == NULL)
+ return 0;
+
+ emalloc(proc_data, two_way_proc_data_t *, sizeof(two_way_proc_data_t), "revtwoway_take_control_of");
+ proc_data->in_use = 2;
+ proc_data->size = 0;
+ proc_data->len = 0;
+ proc_data->data = NULL;
+
+ if (max_fds + 1 == 0) /* wrapped. ha! */
+ max_fds = getdtablesize();
+
+ /* input side: */
+ inbuf->get_record = rev2way_get_record;
+ inbuf->close_func = rev2way_close;
+ inbuf->fd = max_fds;
+ inbuf->opaque = proc_data;
+
+ /* output side: */
+ outbuf->fp = (FILE *) max_fds++;
+ outbuf->opaque = proc_data;
+ outbuf->gawk_fwrite = rev2way_fwrite;
+ outbuf->gawk_fflush = rev2way_fflush;
+ outbuf->gawk_ferror = rev2way_ferror;
+ outbuf->gawk_fclose = rev2way_fclose;
+ outbuf->redirected = 1;
+ return 1;
+}
+
+static awk_two_way_processor_t two_way_processor = {
+ "revtwoway",
+ revtwoway_can_take_two_way,
+ revtwoway_take_control_of,
+ NULL
+};
+
+/* init_revtwoway --- set things ups */
+
+static awk_bool_t
+init_revtwoway()
+{
+ register_two_way_processor(& two_way_processor);
+
+ max_fds = getdtablesize();
+
+ return 1;
+}
+
+static awk_ext_func_t func_table[] = {
+ { NULL, NULL, 0 }
+};
+
+/* define the dl_load function using the boilerplate macro */
+
+dl_load_func(func_table, revtwoway, "")
diff --git a/extension/rwarray.3am b/extension/rwarray.3am
new file mode 100644
index 00000000..02373973
--- /dev/null
+++ b/extension/rwarray.3am
@@ -0,0 +1,102 @@
+.TH RWARRAY 3am "Nov 04 2012" "Free Software Foundation" "GNU Awk Extension Modules"
+.SH NAME
+writea, reada \- write and read gawk arrays to/from files
+.SH SYNOPSIS
+.ft CW
+@load "rwarray"
+.sp
+ret = writea(file, array)
+.br
+ret = reada(file, array)
+.ft R
+.SH DESCRIPTION
+The
+.I rwarray
+extension adds two functions named
+.BR writea() .
+and
+.BR reada() ,
+as follows.
+.TP
+.B writea()
+This function takes a string argument, which is the name of the
+file to which dump the array, and the array itself as the second
+argument.
+.B writea()
+understands multidimensional arrays.
+It returns one on success, or zero upon failure.
+.TP
+.B reada()
+is the inverse of
+.BR writea() ;
+it reads the file named as its first argument, filling in
+the array named as the second argument. It clears the array
+first.
+Here too, the return value is one on success and zero upon failure.
+.SH NOTES
+The array created by
+.B reada()
+is identical to that written by
+.B writea()
+in the sense that the contents are the same. However, due
+to implementation issues, the array traversal order of the recreated
+array will likely be different from that of the original array.
+As array traversal order in AWK is by default undefined, this is
+not (technically) a problem. If you need to guarantee a particular
+traversal order, use the array sorting features in
+.I gawk
+to do so.
+.PP
+The file contains binary data. All integral values are written
+in network byte order.
+However, double precision floating-point values are written as
+native binary data. Thus, arrays containing only string data
+can theoretically be dumped on systems with one byte order and
+restored on systems with a different one, but this has not been tried.
+... .SH BUGS
+.SH EXAMPLE
+.ft CW
+.nf
+@load "rwarray"
+\&...
+ret = writea("arraydump.bin", array)
+\&...
+ret = reada("arraydump.bin", array)
+.fi
+.ft R
+.SH "SEE ALSO"
+.IR "GAWK: Effective AWK Programming" ,
+.IR filefuncs (3am),
+.IR fnmatch (3am),
+.IR fork (3am),
+.IR ordchr (3am),
+.IR readdir (3am),
+.IR readfile (3am),
+.IR revoutput (3am),
+.IR time (3am).
+.SH AUTHOR
+Arnold Robbins,
+.BR arnold@skeeve.com .
+.SH COPYING PERMISSIONS
+Copyright \(co 2012
+Free Software Foundation, Inc.
+.PP
+Permission is granted to make and distribute verbatim copies of
+this manual page provided the copyright notice and this permission
+notice are preserved on all copies.
+.ig
+Permission is granted to process this file through troff and print the
+results, provided the printed document carries copying permission
+notice identical to this one except for the removal of this paragraph
+(this paragraph not being relevant to the printed manual page).
+..
+.PP
+Permission is granted to copy and distribute modified versions of this
+manual page under the conditions for verbatim copying, provided that
+the entire resulting derived work is distributed under the terms of a
+permission notice identical to this one.
+.PP
+Permission is granted to copy and distribute translations of this
+manual page into another language, under the above conditions for
+modified versions, except that this permission notice may be stated in
+a translation approved by the Foundation.
diff --git a/extension/rwarray.awk b/extension/rwarray.awk
deleted file mode 100644
index 1057b396..00000000
--- a/extension/rwarray.awk
+++ /dev/null
@@ -1,28 +0,0 @@
-BEGIN {
- extension("./rwarray.so","dlload")
-
- while ((getline word < "/usr/share/dict/words") > 0)
- dict[word] = word word
-
- for (i in dict)
- printf("dict[%s] = %s\n", i, dict[i]) > "orig.out"
- close("orig.out");
-
- writea("orig.bin", dict)
-
- reada("orig.bin", dict)
-
- for (i in dict)
- printf("dict[%s] = %s\n", i, dict[i]) > "new.out"
- close("new.out");
-
- ret = system("cmp orig.out new.out")
-
- if (ret == 0)
- print "old and new are equal - GOOD"
- else
- print "old and new are not equal - BAD"
-
- if (ret == 0 && !("keepit" in ENVIRON))
- system("rm orig.bin orig.out new.out")
-}
diff --git a/extension/rwarray.c b/extension/rwarray.c
index 3c629579..43118282 100644
--- a/extension/rwarray.c
+++ b/extension/rwarray.c
@@ -3,10 +3,11 @@
*
* Arnold Robbins
* May 2009
+ * Redone June 2012
*/
/*
- * Copyright (C) 2009, 2010, 2011 the Free Software Foundation, Inc.
+ * Copyright (C) 2009, 2010, 2011, 2012 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -26,437 +27,461 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include "awk.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <assert.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
#include <arpa/inet.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <fcntl.h>
+#include "gawkapi.h"
+
+#include "gettext.h"
+#define _(msgid) gettext(msgid)
+#define N_(msgid) msgid
+
+#if defined(ZOS_USS)
+#include <limits.h>
+#define INT32_MAX INT_MAX
+#define INT32_MIN INT_MIN
+#ifndef __uint32_t
+#define __uint32_t 1
+typedef unsigned long uint32_t;
+#endif
+typedef long int32_t;
+#endif /* ZOS_USS */
#define MAGIC "awkrulz\n"
-#define MAJOR 1
+#define MAJOR 3
#define MINOR 0
+static const gawk_api_t *api; /* for convenience macros to work */
+static awk_ext_id_t *ext_id;
+static const char *ext_version = "rwarray extension: version 1.0";
+static awk_bool_t (*init_func)(void) = NULL;
+
int plugin_is_GPL_compatible;
-static int write_array(int fd, NODE *array);
-static int write_elem(int fd, int index, NODE *item);
-static int write_chain(int fd, int index, NODE *item);
-static int write_value(int fd, NODE *val);
+static awk_bool_t write_array(FILE *fp, awk_array_t array);
+static awk_bool_t write_elem(FILE *fp, awk_element_t *element);
+static awk_bool_t write_value(FILE *fp, awk_value_t *val);
-static int read_array(int fd, NODE *array);
-static NODE *read_elem(int fd, int *index, NODE *array);
-static NODE *read_value(int fd);
+static awk_bool_t read_array(FILE *fp, awk_array_t array);
+static awk_bool_t read_elem(FILE *fp, awk_element_t *element);
+static awk_bool_t read_value(FILE *fp, awk_value_t *value);
/*
* Format of array info:
*
- * MAGIC 8 bytes
+ * MAGIC 8 bytes
* Major version 4 bytes - network order
* Minor version 4 bytes - network order
* Element count 4 bytes - network order
- * Array size 4 bytes - network order
* Elements
*
* For each element:
- * Bucket number: 4 bytes - network order
- * Hash of index val: 4 bytes - network order
* Length of index val: 4 bytes - network order
* Index val as characters (N bytes)
- * Value type 1 byte (0 = string, 1 = number, 2 = array)
+ * Value type 4 bytes (0 = string, 1 = number, 2 = array)
* IF string:
* Length of value 4 bytes
* Value as characters (N bytes)
- * ELSE
+ * ELSE IF number:
* 8 bytes as native double
+ * ELSE
+ * Element count
+ * Elements
+ * END IF
*/
/* do_writea --- write an array */
-static NODE *
-do_writea(int nargs)
+static awk_value_t *
+do_writea(int nargs, awk_value_t *result)
{
- NODE *file, *array;
- int ret;
- int fd;
+ awk_value_t filename, array;
+ FILE *fp = NULL;
uint32_t major = MAJOR;
uint32_t minor = MINOR;
- if (do_lint && get_curfunc_arg_count() > 2)
- lintwarn("writea: called with too many arguments");
+ assert(result != NULL);
+ make_number(0.0, result);
+
+ if (do_lint && nargs > 2)
+ lintwarn(ext_id, _("writea: called with too many arguments"));
+
+ if (nargs < 2)
+ goto out;
/* directory is first arg, array to dump is second */
- file = get_scalar_argument(0, FALSE);
- array = get_array_argument(1, FALSE);
+ if (! get_argument(0, AWK_STRING, & filename)) {
+ fprintf(stderr, _("do_writea: argument 0 is not a string\n"));
+ errno = EINVAL;
+ goto done1;
+ }
- /* open the file, if error, set ERRNO and return */
- (void) force_string(file);
- fd = creat(file->stptr, 0600);
- if (fd < 0) {
+ if (! get_argument(1, AWK_ARRAY, & array)) {
+ fprintf(stderr, _("do_writea: argument 1 is not an array\n"));
+ errno = EINVAL;
goto done1;
}
- if (write(fd, MAGIC, strlen(MAGIC)) != strlen(MAGIC))
+ /* open the file, if error, set ERRNO and return */
+ fp = fopen(filename.str_value.str, "wb");
+ if (fp == NULL)
+ goto done1;
+
+ if (fwrite(MAGIC, 1, strlen(MAGIC), fp) != strlen(MAGIC))
goto done1;
major = htonl(major);
- if (write(fd, & major, sizeof(major)) != sizeof(major))
+ if (fwrite(& major, 1, sizeof(major), fp) != sizeof(major))
goto done1;
minor = htonl(minor);
- if (write(fd, & minor, sizeof(minor)) != sizeof(minor))
+ if (fwrite(& minor, 1, sizeof(minor), fp) != sizeof(minor))
goto done1;
- ret = write_array(fd, array);
- if (ret != 0)
- goto done1;
- ret = 0;
- goto done0;
+ if (write_array(fp, array.array_cookie)) {
+ make_number(1.0, result);
+ goto done0;
+ }
done1:
- ret = -1;
- update_ERRNO();
- unlink(file->stptr);
+ update_ERRNO_int(errno);
+ unlink(filename.str_value.str);
done0:
- close(fd);
-
- /* Set the return value */
- return make_number((AWKNUM) ret);
+ fclose(fp);
+out:
+ return result;
}
/* write_array --- write out an array or a sub-array */
-static int
-write_array(int fd, NODE *array)
+static awk_bool_t
+write_array(FILE *fp, awk_array_t array)
{
- int ret;
+ uint32_t i;
uint32_t count;
- uint32_t array_sz;
- int i;
+ awk_flat_array_t *flat_array;
- count = htonl(array->table_size);
- if (write(fd, & count, sizeof(count)) != sizeof(count))
- return -1;
-
- array_sz = htonl(array->array_size);
- if (write(fd, & array_sz, sizeof(array_sz)) != sizeof(array_sz))
- return -1;
-
- for (i = 0; i < array->array_size; i++) {
- ret = write_chain(fd, i, array->var_array[i]);
- if (ret != 0)
- return ret;
+ if (! flatten_array(array, & flat_array)) {
+ fprintf(stderr, _("write_array: could not flatten array\n"));
+ return 0;
}
- return 0;
-}
-
-
-/* write_chain --- write out a whole hash chain */
-/*
- * Write elements in the chain in reverse order so that
- * when we read the elements back in we can just push them
- * onto the front and thus recreate the array as it was.
- */
+ count = htonl(flat_array->count);
+ if (fwrite(& count, 1, sizeof(count), fp) != sizeof(count))
+ return 0;
-static int
-write_chain(int fd, int index, NODE *bucket)
-{
- int ret;
+ for (i = 0; i < flat_array->count; i++) {
+ if (! write_elem(fp, & flat_array->elements[i]))
+ return 0;
+ }
- if (bucket == NULL)
+ if (! release_flattened_array(array, flat_array)) {
+ fprintf(stderr, _("write_array: could not release flattened array\n"));
return 0;
+ }
- ret = write_chain(fd, index, bucket->ahnext);
- if (ret != 0)
- return ret;
-
- return write_elem(fd, index, bucket);
+ return 1;
}
/* write_elem --- write out a single element */
-static int
-write_elem(int fd, int index, NODE *item)
+static awk_bool_t
+write_elem(FILE *fp, awk_element_t *element)
{
- uint32_t hashval, indexval_len;
-
- index = htonl(index);
- if (write(fd, & index, sizeof(index)) != sizeof(index))
- return -1;
+ uint32_t indexval_len;
+ ssize_t write_count;
- hashval = htonl(item->ahcode);
- if (write(fd, & hashval, sizeof(hashval)) != sizeof(hashval))
- return -1;
-
- indexval_len = htonl(item->ahname_len);
- if (write(fd, & indexval_len, sizeof(indexval_len)) != sizeof(indexval_len))
- return -1;
+ indexval_len = htonl(element->index.str_value.len);
+ if (fwrite(& indexval_len, 1, sizeof(indexval_len), fp) != sizeof(indexval_len))
+ return 0;
- if (write(fd, item->ahname_str, item->ahname_len) != item->ahname_len)
- return -1;
+ if (element->index.str_value.len > 0) {
+ write_count = fwrite(element->index.str_value.str,
+ 1, element->index.str_value.len, fp);
+ if (write_count != (ssize_t) element->index.str_value.len)
+ return 0;
+ }
- return write_value(fd, item->ahvalue);
+ return write_value(fp, & element->value);
}
/* write_value --- write a number or a string or a array */
static int
-write_value(int fd, NODE *val)
+write_value(FILE *fp, awk_value_t *val)
{
- int code, len;
+ uint32_t code, len;
- if (val->type == Node_var_array) {
+ if (val->val_type == AWK_ARRAY) {
code = htonl(2);
- if (write(fd, & code, sizeof(code)) != sizeof(code))
- return -1;
- return write_array(fd, val);
+ if (fwrite(& code, 1, sizeof(code), fp) != sizeof(code))
+ return 0;
+ return write_array(fp, val->array_cookie);
}
- if ((val->flags & NUMBER) != 0) {
+ if (val->val_type == AWK_NUMBER) {
code = htonl(1);
- if (write(fd, & code, sizeof(code)) != sizeof(code))
- return -1;
+ if (fwrite(& code, 1, sizeof(code), fp) != sizeof(code))
+ return 0;
- if (write(fd, & val->numbr, sizeof(val->numbr)) != sizeof(val->numbr))
- return -1;
+ if (fwrite(& val->num_value, 1, sizeof(val->num_value), fp) != sizeof(val->num_value))
+ return 0;
} else {
code = 0;
- if (write(fd, & code, sizeof(code)) != sizeof(code))
- return -1;
+ if (fwrite(& code, 1, sizeof(code), fp) != sizeof(code))
+ return 0;
- len = htonl(val->stlen);
- if (write(fd, & len, sizeof(len)) != sizeof(len))
- return -1;
+ len = htonl(val->str_value.len);
+ if (fwrite(& len, 1, sizeof(len), fp) != sizeof(len))
+ return 0;
- if (write(fd, val->stptr, val->stlen) != val->stlen)
- return -1;
+ if (fwrite(val->str_value.str, 1, val->str_value.len, fp)
+ != (ssize_t) val->str_value.len)
+ return 0;
}
- return 0;
+ return 1;
}
/* do_reada --- read an array */
-static NODE *
-do_reada(int nargs)
+static awk_value_t *
+do_reada(int nargs, awk_value_t *result)
{
- NODE *file, *array;
- int ret;
- int fd;
+ awk_value_t filename, array;
+ FILE *fp = NULL;
uint32_t major;
uint32_t minor;
char magic_buf[30];
- if (do_lint && get_curfunc_arg_count() > 2)
- lintwarn("reada: called with too many arguments");
+ assert(result != NULL);
+ make_number(0.0, result);
- /* directory is first arg, array to dump is second */
- file = get_scalar_argument(0, FALSE);
- array = get_array_argument(1, FALSE);
+ if (do_lint && nargs > 2)
+ lintwarn(ext_id, _("reada: called with too many arguments"));
+
+ if (nargs < 2)
+ goto out;
- (void) force_string(file);
- fd = open(file->stptr, O_RDONLY);
- if (fd < 0) {
+ /* directory is first arg, array to read is second */
+ if (! get_argument(0, AWK_STRING, & filename)) {
+ fprintf(stderr, _("do_reada: argument 0 is not a string\n"));
+ errno = EINVAL;
goto done1;
}
+ if (! get_argument(1, AWK_ARRAY, & array)) {
+ fprintf(stderr, _("do_reada: argument 1 is not an array\n"));
+ errno = EINVAL;
+ goto done1;
+ }
+
+ fp = fopen(filename.str_value.str, "rb");
+ if (fp == NULL)
+ goto done1;
+
memset(magic_buf, '\0', sizeof(magic_buf));
- if (read(fd, magic_buf, strlen(MAGIC)) != strlen(MAGIC)) {
+ if (fread(magic_buf, 1, strlen(MAGIC), fp) != strlen(MAGIC)) {
+ errno = EBADF;
goto done1;
}
if (strcmp(magic_buf, MAGIC) != 0) {
+ errno = EBADF;
goto done1;
}
- if (read(fd, & major, sizeof(major)) != sizeof(major)) {
+ if (fread(& major, 1, sizeof(major), fp) != sizeof(major)) {
+ errno = EBADF;
goto done1;
}
major = ntohl(major);
if (major != MAJOR) {
+ errno = EBADF;
goto done1;
}
- if (read(fd, & minor, sizeof(minor)) != sizeof(minor)) {
+ if (fread(& minor, 1, sizeof(minor), fp) != sizeof(minor)) {
+ /* read() sets errno */
goto done1;
}
+
minor = ntohl(minor);
if (minor != MINOR) {
+ errno = EBADF;
goto done1;
}
- assoc_clear(array);
+ if (! clear_array(array.array_cookie)) {
+ errno = ENOMEM;
+ fprintf(stderr, _("do_reada: clear_array failed\n"));
+ goto done1;
+ }
- ret = read_array(fd, array);
- if (ret == 0)
+ if (read_array(fp, array.array_cookie)) {
+ make_number(1.0, result);
goto done0;
+ }
done1:
- ret = -1;
- update_ERRNO();
-
+ update_ERRNO_int(errno);
done0:
- close(fd);
-
- /* Set the return value */
- return make_number((AWKNUM) ret);
+ if (fp != NULL)
+ fclose(fp);
+out:
+ return result;
}
/* read_array --- read in an array or sub-array */
-static int
-read_array(int fd, NODE *array)
+static awk_bool_t
+read_array(FILE *fp, awk_array_t array)
{
- int i;
+ uint32_t i;
uint32_t count;
- uint32_t array_sz;
- int index;
- NODE *new_elem;
-
- if (read(fd, & count, sizeof(count)) != sizeof(count)) {
- return -1;
- }
- array->table_size = ntohl(count);
+ awk_element_t new_elem;
- if (read(fd, & array_sz, sizeof(array_sz)) != sizeof(array_sz)) {
- return -1;
+ if (fread(& count, 1, sizeof(count), fp) != sizeof(count)) {
+ return 0;
}
- array->array_size = ntohl(array_sz);
-
- /* malloc var_array */
- array->var_array = (NODE **) malloc(array->array_size * sizeof(NODE *));
- memset(array->var_array, '\0', array->array_size * sizeof(NODE *));
-
- for (i = 0; i < array->table_size; i++) {
- if ((new_elem = read_elem(fd, & index, array)) != NULL) {
- new_elem->ahnext = array->var_array[index];
- array->var_array[index] = new_elem;
+ count = ntohl(count);
+
+ for (i = 0; i < count; i++) {
+ if (read_elem(fp, & new_elem)) {
+ /* add to array */
+ if (! set_array_element_by_elem(array, & new_elem)) {
+ fprintf(stderr, _("read_array: set_array_element failed\n"));
+ return 0;
+ }
} else
break;
}
- if (i != array->table_size)
- return -1;
- return 0;
-}
+ if (i != count)
+ return 0;
+
+ return 1;
+}
/* read_elem --- read in a single element */
-static NODE *
-read_elem(int fd, int *the_index, NODE *array)
+static awk_bool_t
+read_elem(FILE *fp, awk_element_t *element)
{
- uint32_t hashval, indexval_len, index;
- NODE *item;
- NODE *val;
- int ret;
+ uint32_t index_len;
+ static char *buffer;
+ static uint32_t buflen;
+ ssize_t ret;
- *the_index = 0;
-
- if ((ret = read(fd, & index, sizeof(index))) != sizeof(index)) {
- return NULL;
+ if ((ret = fread(& index_len, 1, sizeof(index_len), fp)) != sizeof(index_len)) {
+ return 0;
}
- *the_index = index = ntohl(index);
+ index_len = ntohl(index_len);
- getnode(item);
- memset(item, 0, sizeof(*item));
- item->type = Node_ahash;
- item->flags = MALLOC;
+ memset(element, 0, sizeof(*element));
- if (read(fd, & hashval, sizeof(hashval)) != sizeof(hashval)) {
- return NULL;
- }
+ if (index_len > 0) {
+ if (buffer == NULL) {
+ /* allocate buffer */
+ emalloc(buffer, char *, index_len, "read_elem");
+ buflen = index_len;
+ } else if (buflen < index_len) {
+ /* reallocate buffer */
+ char *cp = realloc(buffer, index_len);
- item->ahcode = ntohl(hashval);
+ if (cp == NULL)
+ return 0;
- if (read(fd, & indexval_len, sizeof(indexval_len)) != sizeof(indexval_len)) {
- return NULL;
- }
- item->ahname_len = ntohl(indexval_len);
+ buffer = cp;
+ buflen = index_len;
+ }
- item->ahname_str = malloc(item->ahname_len + 2);
- if (read(fd, item->ahname_str, item->ahname_len) != item->ahname_len) {
- return NULL;
+ if (fread(buffer, 1, index_len, fp) != (ssize_t) index_len) {
+ return 0;
+ }
+ make_const_string(buffer, index_len, & element->index);
+ } else {
+ make_null_string(& element->index);
}
- item->ahname_str[item->ahname_len] = '\0';
- item->ahname_ref = 1;
- item->ahvalue = val = read_value(fd);
- if (val == NULL) {
- return NULL;
- }
- if (val->type == Node_var_array) {
- char *aname;
- size_t aname_len;
-
- /* construct the sub-array name */
- aname_len = strlen(array->vname) + item->ahname_len + 4;
- emalloc(aname, char *, aname_len + 2, "read_elem");
- sprintf(aname, "%s[\"%.*s\"]", array->vname, (int) item->ahname_len, item->ahname_str);
- val->vname = aname;
- }
+ if (! read_value(fp, & element->value))
+ return 0;
- return item;
+ return 1;
}
/* read_value --- read a number or a string */
-static NODE *
-read_value(int fd)
+static awk_bool_t
+read_value(FILE *fp, awk_value_t *value)
{
- NODE *val;
- int code, len;
+ uint32_t code, len;
- getnode(val);
- memset(val, 0, sizeof(*val));
- val->type = Node_val;
+ if (fread(& code, 1, sizeof(code), fp) != sizeof(code))
+ return 0;
- if (read(fd, & code, sizeof(code)) != sizeof(code)) {
- return NULL;
- }
code = ntohl(code);
if (code == 2) {
- val->type = Node_var_array;
- if (read_array(fd, val) != 0)
- return NULL;
+ awk_array_t array = create_array();
+
+ if (read_array(fp, array) != 0)
+ return 0;
+
+ /* hook into value */
+ value->val_type = AWK_ARRAY;
+ value->array_cookie = array;
} else if (code == 1) {
- if (read(fd, & val->numbr, sizeof(val->numbr)) != sizeof(val->numbr)) {
- return NULL;
- }
+ double d;
+
+ if (fread(& d, 1, sizeof(d), fp) != sizeof(d))
+ return 0;
- val->flags = NUMBER|NUMCUR|MALLOC;
+ /* hook into value */
+ value->val_type = AWK_NUMBER;
+ value->num_value = d;
} else {
- if (read(fd, & len, sizeof(len)) != sizeof(len)) {
- return NULL;
+ if (fread(& len, 1, sizeof(len), fp) != sizeof(len)) {
+ return 0;
}
- val->stlen = ntohl(len);
- val->stptr = malloc(val->stlen + 2);
- memset(val->stptr, '\0', val->stlen + 2);
-
- if (read(fd, val->stptr, val->stlen) != val->stlen) {
- return NULL;
+ len = ntohl(len);
+ value->val_type = AWK_STRING;
+ value->str_value.len = len;
+ value->str_value.str = malloc(len + 2);
+ memset(value->str_value.str, '\0', len + 2);
+
+ if (fread(value->str_value.str, 1, len, fp) != (ssize_t) len) {
+ free(value->str_value.str);
+ return 0;
}
-
- val->flags = STRING|STRCUR|MALLOC;
}
- return val;
+ return 1;
}
-/* dlload --- load new builtins in this library */
+static awk_ext_func_t func_table[] = {
+ { "writea", do_writea, 2 },
+ { "reada", do_reada, 2 },
+};
-NODE *
-dlload(tree, dl)
-NODE *tree;
-void *dl;
-{
- make_builtin("writea", do_writea, 2);
- make_builtin("reada", do_reada, 2);
- return make_number((AWKNUM) 0);
-}
+/* define the dl_load function using the boilerplate macro */
+
+dl_load_func(func_table, rwarray, "")
diff --git a/extension/rwarray0.c b/extension/rwarray0.c
new file mode 100644
index 00000000..c50c6a38
--- /dev/null
+++ b/extension/rwarray0.c
@@ -0,0 +1,475 @@
+/*
+ * rwarray.c - Builtin functions to binary read / write arrays to a file.
+ *
+ * Arnold Robbins
+ * May 2009
+ * Redone June 2012
+ */
+
+/*
+ * Copyright (C) 2009, 2010, 2011, 2012 the Free Software Foundation, Inc.
+ *
+ * This file is part of GAWK, the GNU implementation of the
+ * AWK Programming Language.
+ *
+ * GAWK is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GAWK is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <assert.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <arpa/inet.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "gawkapi.h"
+
+#include "gettext.h"
+#define _(msgid) gettext(msgid)
+#define N_(msgid) msgid
+
+#define MAGIC "awkrulz\n"
+#define MAJOR 3
+#define MINOR 0
+
+static const gawk_api_t *api; /* for convenience macros to work */
+static awk_ext_id_t *ext_id;
+static const char *ext_version = "rwarray0 extension: version 1.0";
+static awk_bool_t (*init_func)(void) = NULL;
+
+int plugin_is_GPL_compatible;
+
+static awk_bool_t write_array(int fd, awk_array_t array);
+static awk_bool_t write_elem(int fd, awk_element_t *element);
+static awk_bool_t write_value(int fd, awk_value_t *val);
+
+static awk_bool_t read_array(int fd, awk_array_t array);
+static awk_bool_t read_elem(int fd, awk_element_t *element);
+static awk_bool_t read_value(int fd, awk_value_t *value);
+
+/*
+ * Format of array info:
+ *
+ * MAGIC 8 bytes
+ * Major version 4 bytes - network order
+ * Minor version 4 bytes - network order
+ * Element count 4 bytes - network order
+ * Elements
+ *
+ * For each element:
+ * Length of index val: 4 bytes - network order
+ * Index val as characters (N bytes)
+ * Value type 4 bytes (0 = string, 1 = number, 2 = array)
+ * IF string:
+ * Length of value 4 bytes
+ * Value as characters (N bytes)
+ * ELSE IF number:
+ * 8 bytes as native double
+ * ELSE
+ * Element count
+ * Elements
+ * END IF
+ */
+
+/* do_writea --- write an array */
+
+static awk_value_t *
+do_writea(int nargs, awk_value_t *result)
+{
+ awk_value_t filename, array;
+ int fd = -1;
+ uint32_t major = MAJOR;
+ uint32_t minor = MINOR;
+
+ assert(result != NULL);
+ make_number(0.0, result);
+
+ if (do_lint && nargs > 2)
+ lintwarn(ext_id, _("writea: called with too many arguments"));
+
+ if (nargs < 2)
+ goto out;
+
+ /* directory is first arg, array to dump is second */
+ if (! get_argument(0, AWK_STRING, & filename)) {
+ fprintf(stderr, _("do_writea: argument 0 is not a string\n"));
+ errno = EINVAL;
+ goto done1;
+ }
+
+ if (! get_argument(1, AWK_ARRAY, & array)) {
+ fprintf(stderr, _("do_writea: argument 1 is not an array\n"));
+ errno = EINVAL;
+ goto done1;
+ }
+
+ /* open the file, if error, set ERRNO and return */
+ fd = creat(filename.str_value.str, 0600);
+ if (fd < 0)
+ goto done1;
+
+ if (write(fd, MAGIC, strlen(MAGIC)) != strlen(MAGIC))
+ goto done1;
+
+ major = htonl(major);
+ if (write(fd, & major, sizeof(major)) != sizeof(major))
+ goto done1;
+
+ minor = htonl(minor);
+ if (write(fd, & minor, sizeof(minor)) != sizeof(minor))
+ goto done1;
+
+ if (write_array(fd, array.array_cookie)) {
+ make_number(1.0, result);
+ goto done0;
+ }
+
+done1:
+ update_ERRNO_int(errno);
+ unlink(filename.str_value.str);
+
+done0:
+ close(fd);
+out:
+ return result;
+}
+
+
+/* write_array --- write out an array or a sub-array */
+
+static awk_bool_t
+write_array(int fd, awk_array_t array)
+{
+ uint32_t i;
+ uint32_t count;
+ awk_flat_array_t *flat_array;
+
+ if (! flatten_array(array, & flat_array)) {
+ fprintf(stderr, _("write_array: could not flatten array\n"));
+ return 0;
+ }
+
+ count = htonl(flat_array->count);
+ if (write(fd, & count, sizeof(count)) != sizeof(count))
+ return 0;
+
+ for (i = 0; i < flat_array->count; i++) {
+ if (! write_elem(fd, & flat_array->elements[i]))
+ return 0;
+ }
+
+ if (! release_flattened_array(array, flat_array)) {
+ fprintf(stderr, _("write_array: could not release flattened array\n"));
+ return 0;
+ }
+
+ return 1;
+}
+
+/* write_elem --- write out a single element */
+
+static awk_bool_t
+write_elem(int fd, awk_element_t *element)
+{
+ uint32_t indexval_len;
+ ssize_t write_count;
+
+ indexval_len = htonl(element->index.str_value.len);
+ if (write(fd, & indexval_len, sizeof(indexval_len)) != sizeof(indexval_len))
+ return 0;
+
+ if (element->index.str_value.len > 0) {
+ write_count = write(fd, element->index.str_value.str,
+ element->index.str_value.len);
+ if (write_count != (ssize_t) element->index.str_value.len)
+ return 0;
+ }
+
+ return write_value(fd, & element->value);
+}
+
+/* write_value --- write a number or a string or a array */
+
+static int
+write_value(int fd, awk_value_t *val)
+{
+ uint32_t code, len;
+
+ if (val->val_type == AWK_ARRAY) {
+ code = htonl(2);
+ if (write(fd, & code, sizeof(code)) != sizeof(code))
+ return 0;
+ return write_array(fd, val->array_cookie);
+ }
+
+ if (val->val_type == AWK_NUMBER) {
+ code = htonl(1);
+ if (write(fd, & code, sizeof(code)) != sizeof(code))
+ return 0;
+
+ if (write(fd, & val->num_value, sizeof(val->num_value)) != sizeof(val->num_value))
+ return 0;
+ } else {
+ code = 0;
+ if (write(fd, & code, sizeof(code)) != sizeof(code))
+ return 0;
+
+ len = htonl(val->str_value.len);
+ if (write(fd, & len, sizeof(len)) != sizeof(len))
+ return 0;
+
+ if (write(fd, val->str_value.str, val->str_value.len)
+ != (ssize_t) val->str_value.len)
+ return 0;
+ }
+
+ return 1;
+}
+
+/* do_reada --- read an array */
+
+static awk_value_t *
+do_reada(int nargs, awk_value_t *result)
+{
+ awk_value_t filename, array;
+ int fd = -1;
+ uint32_t major;
+ uint32_t minor;
+ char magic_buf[30];
+
+ assert(result != NULL);
+ make_number(0.0, result);
+
+ if (do_lint && nargs > 2)
+ lintwarn(ext_id, _("reada: called with too many arguments"));
+
+ if (nargs < 2)
+ goto out;
+
+ /* directory is first arg, array to read is second */
+ if (! get_argument(0, AWK_STRING, & filename)) {
+ fprintf(stderr, _("do_reada: argument 0 is not a string\n"));
+ errno = EINVAL;
+ goto done1;
+ }
+
+ if (! get_argument(1, AWK_ARRAY, & array)) {
+ fprintf(stderr, _("do_reada: argument 1 is not an array\n"));
+ errno = EINVAL;
+ goto done1;
+ }
+
+ fd = open(filename.str_value.str, O_RDONLY);
+ if (fd < 0)
+ goto done1;
+
+ memset(magic_buf, '\0', sizeof(magic_buf));
+ if (read(fd, magic_buf, strlen(MAGIC)) != strlen(MAGIC)) {
+ errno = EBADF;
+ goto done1;
+ }
+
+ if (strcmp(magic_buf, MAGIC) != 0) {
+ errno = EBADF;
+ goto done1;
+ }
+
+ if (read(fd, & major, sizeof(major)) != sizeof(major)) {
+ errno = EBADF;
+ goto done1;
+ }
+ major = ntohl(major);
+
+ if (major != MAJOR) {
+ errno = EBADF;
+ goto done1;
+ }
+
+ if (read(fd, & minor, sizeof(minor)) != sizeof(minor)) {
+ /* read() sets errno */
+ goto done1;
+ }
+
+ minor = ntohl(minor);
+ if (minor != MINOR) {
+ errno = EBADF;
+ goto done1;
+ }
+
+ if (! clear_array(array.array_cookie)) {
+ errno = ENOMEM;
+ fprintf(stderr, _("do_reada: clear_array failed\n"));
+ goto done1;
+ }
+
+ if (read_array(fd, array.array_cookie)) {
+ make_number(1.0, result);
+ goto done0;
+ }
+
+done1:
+ update_ERRNO_int(errno);
+done0:
+ close(fd);
+out:
+ return result;
+}
+
+
+/* read_array --- read in an array or sub-array */
+
+static awk_bool_t
+read_array(int fd, awk_array_t array)
+{
+ uint32_t i;
+ uint32_t count;
+ awk_element_t new_elem;
+
+ if (read(fd, & count, sizeof(count)) != sizeof(count)) {
+ return 0;
+ }
+ count = ntohl(count);
+
+ for (i = 0; i < count; i++) {
+ if (read_elem(fd, & new_elem)) {
+ /* add to array */
+ if (! set_array_element_by_elem(array, & new_elem)) {
+ fprintf(stderr, _("read_array: set_array_element failed\n"));
+ return 0;
+ }
+ } else
+ break;
+ }
+
+ if (i != count)
+ return 0;
+
+ return 1;
+}
+
+/* read_elem --- read in a single element */
+
+static awk_bool_t
+read_elem(int fd, awk_element_t *element)
+{
+ uint32_t index_len;
+ static char *buffer;
+ static uint32_t buflen;
+ ssize_t ret;
+
+ if ((ret = read(fd, & index_len, sizeof(index_len))) != sizeof(index_len)) {
+ return 0;
+ }
+ index_len = ntohl(index_len);
+
+ memset(element, 0, sizeof(*element));
+
+ if (index_len > 0) {
+ if (buffer == NULL) {
+ // allocate buffer
+ emalloc(buffer, char *, index_len, "read_elem");
+ buflen = index_len;
+ } else if (buflen < index_len) {
+ // reallocate buffer
+ char *cp = realloc(buffer, index_len);
+
+ if (cp == NULL)
+ return 0;
+
+ buffer = cp;
+ buflen = index_len;
+ }
+
+ if (read(fd, buffer, index_len) != (ssize_t) index_len) {
+ return 0;
+ }
+ make_const_string(buffer, index_len, & element->index);
+ } else {
+ make_null_string(& element->index);
+ }
+
+ if (! read_value(fd, & element->value))
+ return 0;
+
+ return 1;
+}
+
+/* read_value --- read a number or a string */
+
+static awk_bool_t
+read_value(int fd, awk_value_t *value)
+{
+ uint32_t code, len;
+
+ if (read(fd, & code, sizeof(code)) != sizeof(code))
+ return 0;
+
+ code = ntohl(code);
+
+ if (code == 2) {
+ awk_array_t array = create_array();
+
+ if (read_array(fd, array) != 0)
+ return 0;
+
+ /* hook into value */
+ value->val_type = AWK_ARRAY;
+ value->array_cookie = array;
+ } else if (code == 1) {
+ double d;
+
+ if (read(fd, & d, sizeof(d)) != sizeof(d))
+ return 0;
+
+ /* hook into value */
+ value->val_type = AWK_NUMBER;
+ value->num_value = d;
+ } else {
+ if (read(fd, & len, sizeof(len)) != sizeof(len)) {
+ return 0;
+ }
+ len = ntohl(len);
+ value->val_type = AWK_STRING;
+ value->str_value.len = len;
+ value->str_value.str = malloc(len + 2);
+ memset(value->str_value.str, '\0', len + 2);
+
+ if (read(fd, value->str_value.str, len) != (ssize_t) len) {
+ free(value->str_value.str);
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+static awk_ext_func_t func_table[] = {
+ { "writea", do_writea, 2 },
+ { "reada", do_reada, 2 },
+};
+
+
+/* define the dl_load function using the boilerplate macro */
+
+dl_load_func(func_table, rwarray, "")
diff --git a/extension/stack.c b/extension/stack.c
new file mode 100644
index 00000000..ec994c61
--- /dev/null
+++ b/extension/stack.c
@@ -0,0 +1,90 @@
+/*
+ * stack.c -- Implementation for stack functions for use by extensions.
+ */
+
+/*
+ * Copyright (C) 2012 the Free Software Foundation, Inc.
+ *
+ * This file is part of GAWK, the GNU implementation of the
+ * AWK Programming Language.
+ *
+ * GAWK is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GAWK is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdlib.h>
+
+#include "stack.h"
+
+#define INITIAL_STACK 20
+
+static size_t size;
+static void **stack;
+static int index = -1;
+
+/* stack_empty --- return true if stack is empty */
+
+int
+stack_empty()
+{
+ return index < 0;
+}
+
+/* stack_top --- return top object on the stack */
+
+void *
+stack_top()
+{
+ if (stack_empty() || stack == NULL)
+ return NULL;
+
+ return stack[index];
+}
+
+/* stack_pop --- pop top object and return it */
+
+void *
+stack_pop()
+{
+ if (stack_empty() || stack == NULL)
+ return NULL;
+
+ return stack[index--];
+}
+
+/* stack_push --- push an object onto the stack */
+
+int stack_push(void *object)
+{
+ void **new_stack;
+ size_t new_size = 2 * size;
+
+ if (stack == NULL) {
+ stack = (void **) malloc(INITIAL_STACK * sizeof(void *));
+ if (stack == NULL)
+ return 0;
+ size = INITIAL_STACK;
+ } else if (index + 1 >= size) {
+ if (new_size < size)
+ return 0;
+ new_stack = realloc(stack, new_size * sizeof(void *));
+ if (new_stack == NULL)
+ return 0;
+ size = new_size;
+ stack = new_stack;
+ }
+
+ stack[++index] = object;
+ return 1;
+}
diff --git a/eval_p.c b/extension/stack.h
index c8afe666..8fc06e78 100644
--- a/eval_p.c
+++ b/extension/stack.h
@@ -1,9 +1,9 @@
/*
- * eval_p.c - compile eval.c with profiling turned on.
+ * stack.h -- Definitions for stack functions for use by extensions.
*/
/*
- * Copyright (C) 2001 the Free Software Foundation, Inc.
+ * Copyright (C) 2012 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -23,5 +23,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#define PROFILING 1
-#include "eval.c"
+extern int stack_empty(); /* return true if stack is empty */
+extern void *stack_top(); /* return top object on the stack */
+extern void *stack_pop(); /* pop top object and return it */
+extern int stack_push(void *); /* push an object onto the stack,
+ * return 0 if failed, 1 if success
+ */
diff --git a/extension/steps b/extension/steps
deleted file mode 100755
index a6696ddc..00000000
--- a/extension/steps
+++ /dev/null
@@ -1,23 +0,0 @@
-# what to do under linux to make dl.so
-# Tue Nov 24 15:04:14 EST 1998
-# Sun Aug 26 16:03:58 IDT 2001
-# Sun Apr 28 15:59:57 IDT 2002
-# Mon Jun 21 17:03:37 IDT 2004
-# Fri May 15 15:48:45 IDT 2009
-
-gcc -fPIC -shared -Wall -DHAVE_CONFIG_H -c -O -g -I.. dl.c
-gcc -fPIC -shared -Wall -DHAVE_CONFIG_H -c -O -g -I.. filefuncs.c
-gcc -fPIC -shared -Wall -DHAVE_CONFIG_H -c -O -g -I.. fork.c
-gcc -fPIC -shared -Wall -DHAVE_CONFIG_H -c -O -g -I.. ordchr.c
-gcc -fPIC -shared -Wall -DHAVE_CONFIG_H -c -O -g -I.. arrayparm.c
-gcc -fPIC -shared -Wall -DHAVE_CONFIG_H -c -O -g -I.. readfile.c
-gcc -fPIC -shared -Wall -DHAVE_CONFIG_H -c -O -g -I.. testarg.c
-gcc -fPIC -shared -Wall -DHAVE_CONFIG_H -c -O -g -I.. rwarray.c
-ld -o dl.so -shared dl.o
-ld -o filefuncs.so -shared filefuncs.o
-ld -o fork.so -shared fork.o
-ld -o ordchr.so -shared ordchr.o
-ld -o arrayparm.so -shared arrayparm.o
-ld -o readfile.so -shared readfile.o
-ld -o testarg.so -shared testarg.o
-ld -o rwarray.so -shared rwarray.o
diff --git a/extension/testarg.awk b/extension/testarg.awk
deleted file mode 100644
index a91df1a9..00000000
--- a/extension/testarg.awk
+++ /dev/null
@@ -1,7 +0,0 @@
-BEGIN {
- extension("./testarg.so", "dlload")
- check_arg(x, a);
- check_arg(y, b, z);
- check_arg(u, v, u=1);
- check_arg(p, q, r, s);
-}
diff --git a/extension/testarg.c b/extension/testarg.c
deleted file mode 100644
index ba4d56ff..00000000
--- a/extension/testarg.c
+++ /dev/null
@@ -1,57 +0,0 @@
-#include "awk.h"
-
-int plugin_is_GPL_compatible;
-
-static NODE *
-do_check_arg(int nargs)
-{
- int ret = 0, argc;
- NODE *arg1, *arg2, *arg3;
-
- argc = get_curfunc_arg_count();
- printf("arg count: defined = %d, supplied = %d\n",
- nargs, argc);
-
- arg1 = get_scalar_argument(0, FALSE);
- arg2 = get_array_argument(1, FALSE);
- arg3 = get_scalar_argument(2, TRUE); /* optional */
- if (argc > 3) {
- /* try to use an extra arg */
- NODE *arg4;
- arg4 = get_array_argument(3, TRUE);
- printf("Shouldn't see this line\n");
- }
- if (arg3 != NULL) {
- printf("3rd arg present\n");
- if (arg3->type != Node_val)
- printf("3nd arg type = %s (*** NOT OK ***)\n", nodetype2str(arg3->type));
- } else
- printf("no 3rd arg\n");
-
- if (arg2 != NULL) {
- if (arg2->type != Node_var_array)
- printf("2nd arg type = %s (*** NOT OK ***)\n", nodetype2str(arg2->type));
- } else
- printf("2nd arg missing (NULL) (*** NOT OK ***)\n");
-
- if (arg1 != NULL) {
- if (arg1->type != Node_val)
- printf("1st arg type = %s (*** NOT OK ***)\n", nodetype2str(arg1->type));
- } else
- printf("1st arg missing (NULL) (*** NOT OK ***)\n");
- printf("\n");
-
- /* Set the return value */
- return make_number((AWKNUM) ret);
-}
-
-/* dlload --- load new builtins in this library */
-
-NODE *
-dlload(tree, dl)
-NODE *tree;
-void *dl;
-{
- make_builtin("check_arg", do_check_arg, 3);
- return make_number((AWKNUM) 0);
-}
diff --git a/extension/testarrayparm.awk b/extension/testarrayparm.awk
deleted file mode 100644
index 08178f3e..00000000
--- a/extension/testarrayparm.awk
+++ /dev/null
@@ -1,10 +0,0 @@
-#! /bin/awk -f
-
-BEGIN {
- extension("./arrayparm.so", "dlload")
-
- mkarray(newvar, "hi", "hello")
-
- for (i in newvar)
- printf ("newvar[\"%s\"] = \"%s\"\n", i, newvar[i])
-}
diff --git a/extension/testext.c b/extension/testext.c
new file mode 100644
index 00000000..06564b1e
--- /dev/null
+++ b/extension/testext.c
@@ -0,0 +1,827 @@
+/*
+ * testext.c - tests for the extension API.
+ */
+
+/*
+ * Copyright (C) 2012
+ * the Free Software Foundation, Inc.
+ *
+ * This file is part of GAWK, the GNU implementation of the
+ * AWK Programming Language.
+ *
+ * GAWK is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GAWK is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <assert.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "gawkapi.h"
+
+static const gawk_api_t *api; /* for convenience macros to work */
+static awk_ext_id_t *ext_id;
+static const char *ext_version = "testext extension: version 1.0";
+
+int plugin_is_GPL_compatible;
+
+static void fill_in_array(awk_value_t *value);
+
+/* valrep2str --- turn a value into a string */
+
+static const char *
+valrep2str(const awk_value_t *value)
+{
+ static char buf[BUFSIZ];
+ int size = BUFSIZ - 3;
+
+ switch (value->val_type) {
+ case AWK_UNDEFINED:
+ strcpy(buf, "<undefined>");
+ break;
+ case AWK_ARRAY:
+ strcpy(buf, "<array>");
+ break;
+ case AWK_SCALAR:
+ strcpy(buf, "<scalar>");
+ break;
+ case AWK_VALUE_COOKIE:
+ strcpy(buf, "<value-cookie>");
+ break;
+ case AWK_STRING:
+ if (value->str_value.len < size)
+ size = value->str_value.len;
+ sprintf(buf, "\"%.*s\"",
+ size,
+ value->str_value.str);
+ break;
+ case AWK_NUMBER:
+ sprintf(buf, "%g", value->num_value);
+ break;
+ }
+ return buf;
+}
+
+/*
+ * The awk code for these tests is embedded in this file and then extracted
+ * dynamically to create the script that is run together with this extension.
+ * Extraction requires the format for awk code where test code is enclosed
+ * in a BEGIN block, with the BEGIN and close brace on lines by themselves
+ * and at the front of the lines.
+ */
+
+/*
+@load "testext"
+BEGIN {
+ n = split("blacky rusty sophie raincloud lucky", pets)
+ printf "pets has %d elements\n", length(pets)
+ ret = dump_array_and_delete("pets", "3")
+ printf "dump_array_and_delete(pets) returned %d\n", ret
+ if ("3" in pets)
+ printf("dump_array_and_delete() did NOT remove index \"3\"!\n")
+ else
+ printf("dump_array_and_delete() did remove index \"3\"!\n")
+ print ""
+}
+*/
+static awk_value_t *
+dump_array_and_delete(int nargs, awk_value_t *result)
+{
+ awk_value_t value, value2, value3;
+ awk_flat_array_t *flat_array;
+ size_t count;
+ char *name;
+ int i;
+
+ assert(result != NULL);
+ make_number(0.0, result);
+
+ if (nargs != 2) {
+ printf("dump_array_and_delete: nargs not right (%d should be 2)\n", nargs);
+ goto out;
+ }
+
+ /* get argument named array as flat array and print it */
+ if (get_argument(0, AWK_STRING, & value)) {
+ name = value.str_value.str;
+ if (sym_lookup(name, AWK_ARRAY, & value2))
+ printf("dump_array_and_delete: sym_lookup of %s passed\n", name);
+ else {
+ printf("dump_array_and_delete: sym_lookup of %s failed\n", name);
+ goto out;
+ }
+ } else {
+ printf("dump_array_and_delete: get_argument(0) failed\n");
+ goto out;
+ }
+
+ if (! get_element_count(value2.array_cookie, & count)) {
+ printf("dump_array_and_delete: get_element_count failed\n");
+ goto out;
+ }
+
+ printf("dump_array_and_delete: incoming size is %lu\n", (unsigned long) count);
+
+ if (! flatten_array(value2.array_cookie, & flat_array)) {
+ printf("dump_array_and_delete: could not flatten array\n");
+ goto out;
+ }
+
+ if (flat_array->count != count) {
+ printf("dump_array_and_delete: flat_array->count (%lu) != count (%lu)\n",
+ (unsigned long) flat_array->count,
+ (unsigned long) count);
+ goto out;
+ }
+
+ if (! get_argument(1, AWK_STRING, & value3)) {
+ printf("dump_array_and_delete: get_argument(1) failed\n");
+ goto out;
+ }
+
+ for (i = 0; i < flat_array->count; i++) {
+ printf("\t%s[\"%.*s\"] = %s\n",
+ name,
+ (int) flat_array->elements[i].index.str_value.len,
+ flat_array->elements[i].index.str_value.str,
+ valrep2str(& flat_array->elements[i].value));
+
+ if (strcmp(value3.str_value.str, flat_array->elements[i].index.str_value.str) == 0) {
+ flat_array->elements[i].flags |= AWK_ELEMENT_DELETE;
+ printf("dump_array_and_delete: marking element \"%s\" for deletion\n",
+ flat_array->elements[i].index.str_value.str);
+ }
+ }
+
+ if (! release_flattened_array(value2.array_cookie, flat_array)) {
+ printf("dump_array_and_delete: could not release flattened array\n");
+ goto out;
+ }
+
+ make_number(1.0, result);
+out:
+ return result;
+}
+
+/*
+BEGIN {
+ ENVIRON["testext"]++
+ try_modify_environ()
+ if ("testext" in ENVIRON)
+ print "try_del_environ() could not delete element - pass"
+ else
+ print "try_del_environ() deleted element! - fail"
+ if ("testext2" in ENVIRON)
+ print "try_del_environ() added an element - fail"
+ else
+ print "try_del_environ() could not add an element - pass"
+}
+*/
+
+static awk_value_t *
+try_modify_environ(int nargs, awk_value_t *result)
+{
+ awk_value_t value, index, newvalue;
+ awk_flat_array_t *flat_array;
+ awk_array_t environ_array;
+ size_t count;
+ int i;
+
+ assert(result != NULL);
+ make_number(0.0, result);
+
+ if (nargs != 0) {
+ printf("try_modify_environ: nargs not right (%d should be 0)\n", nargs);
+ goto out;
+ }
+
+ /* get ENVIRON array */
+ if (sym_lookup("ENVIRON", AWK_ARRAY, & value))
+ printf("try_modify_environ: sym_lookup of ENVIRON passed\n");
+ else {
+ printf("try_modify_environ: sym_lookup of ENVIRON failed\n");
+ goto out;
+ }
+
+ environ_array = value.array_cookie;
+ if (! get_element_count(environ_array, & count)) {
+ printf("try_modify_environ: get_element_count failed\n");
+ goto out;
+ }
+
+ /* setting an array element should fail */
+ (void) make_const_string("testext2", 8, & index);
+ (void) make_const_string("a value", 7, & value);
+ if (set_array_element(environ_array, & index, & newvalue)) {
+ printf("try_modify_environ: set_array_element of ENVIRON passed\n");
+ } else {
+ printf("try_modify_environ: set_array_element of ENVIRON failed\n");
+ free(index.str_value.str);
+ free(value.str_value.str);
+ }
+
+ if (! flatten_array(environ_array, & flat_array)) {
+ printf("try_modify_environ: could not flatten array\n");
+ goto out;
+ }
+
+ if (flat_array->count != count) {
+ printf("try_modify_environ: flat_array->count (%lu) != count (%lu)\n",
+ (unsigned long) flat_array->count,
+ (unsigned long) count);
+ goto out;
+ }
+
+ for (i = 0; i < flat_array->count; i++) {
+ /* don't print */
+ /*
+ printf("\t%s[\"%.*s\"] = %s\n",
+ name,
+ (int) flat_array->elements[i].index.str_value.len,
+ flat_array->elements[i].index.str_value.str,
+ valrep2str(& flat_array->elements[i].value));
+ */
+ if (strcmp("testext", flat_array->elements[i].index.str_value.str) == 0) {
+ flat_array->elements[i].flags |= AWK_ELEMENT_DELETE;
+ printf("try_modify_environ: marking element \"%s\" for deletion\n",
+ flat_array->elements[i].index.str_value.str);
+ }
+ }
+
+ if (! release_flattened_array(environ_array, flat_array)) {
+ printf("try_modify_environ: could not release flattened array\n");
+ goto out;
+ }
+
+ make_number(1.0, result);
+out:
+ return result;
+}
+
+/*
+BEGIN {
+ testvar = "One Adam Twelve"
+ ret = var_test("testvar")
+ printf "var_test() returned %d, test_var = %s\n", ret, testvar
+ print ""
+}
+*/
+
+static awk_value_t *
+var_test(int nargs, awk_value_t *result)
+{
+ awk_value_t value, value2;
+ awk_value_t *valp;
+
+ assert(result != NULL);
+ make_number(0.0, result);
+
+ if (nargs != 1) {
+ printf("var_test: nargs not right (%d should be 1)\n", nargs);
+ goto out;
+ }
+
+ /* look up a reserved variable - should pass */
+ if (sym_lookup("ARGC", AWK_NUMBER, & value))
+ printf("var_test: sym_lookup of ARGC passed - got a value!\n");
+ else
+ printf("var_test: sym_lookup of ARGC failed - did not get a value\n");
+
+ /* now try to set it - should fail */
+ value.num_value++;
+ if (sym_update("ARGC", & value))
+ printf("var_test: sym_update of ARGC passed and should not have!\n");
+ else
+ printf("var_test: sym_update of ARGC failed - correctly\n");
+
+ /* look up variable whose name is passed in, should pass */
+ if (get_argument(0, AWK_STRING, & value)) {
+ if (sym_lookup(value.str_value.str, AWK_STRING, & value2)) {
+ /* change the value, should be reflected in awk script */
+ valp = make_number(42.0, & value2);
+
+ if (sym_update(value.str_value.str, valp)) {
+ printf("var_test: sym_update(\"%s\") succeeded\n", value.str_value.str);
+ } else {
+ printf("var_test: sym_update(\"%s\") failed\n", value.str_value.str);
+ goto out;
+ }
+ } else {
+ printf("var_test: sym_lookup(\"%s\") failed\n", value.str_value.str);
+ goto out;
+ }
+ } else {
+ printf("var_test: get_argument() failed\n");
+ goto out;
+ }
+
+ make_number(1.0, result);
+out:
+ return result;
+}
+
+/*
+BEGIN {
+ ERRNO = ""
+ ret = test_errno()
+ printf "test_errno() returned %d, ERRNO = %s\n", ret, ERRNO
+ print ""
+}
+*/
+static awk_value_t *
+test_errno(int nargs, awk_value_t *result)
+{
+ assert(result != NULL);
+ make_number(0.0, result);
+
+ if (nargs != 0) {
+ printf("test_errno: nargs not right (%d should be 0)\n", nargs);
+ goto out;
+ }
+
+ update_ERRNO_int(ECHILD);
+
+ make_number(1.0, result);
+out:
+ return result;
+}
+
+/*
+BEGIN {
+ for (i = 1; i <= 10; i++)
+ test_array[i] = i + 2
+
+ printf ("length of test_array is %d, should be 10\n", length(test_array))
+ ret = test_array_size(test_array);
+ printf "test_array_size() returned %d, length is now %d\n", ret, length(test_array)
+ print ""
+}
+*/
+
+static awk_value_t *
+test_array_size(int nargs, awk_value_t *result)
+{
+ awk_value_t value;
+ size_t count = 0;
+
+ assert(result != NULL);
+ make_number(0.0, result);
+
+ if (nargs != 1) {
+ printf("test_array_size: nargs not right (%d should be 1)\n", nargs);
+ goto out;
+ }
+
+ /* get element count and print it; should match length(array) from awk script */
+ if (! get_argument(0, AWK_ARRAY, & value)) {
+ printf("test_array_size: get_argument failed\n");
+ goto out;
+ }
+
+ if (! get_element_count(value.array_cookie, & count)) {
+ printf("test_array_size: get_element_count failed\n");
+ goto out;
+ }
+
+ printf("test_array_size: incoming size is %lu\n", (unsigned long) count);
+
+ /* clear array - length(array) should then go to zero in script */
+ if (! clear_array(value.array_cookie)) {
+ printf("test_array_size: clear_array failed\n");
+ goto out;
+ }
+
+ make_number(1.0, result);
+
+out:
+ return result;
+}
+
+/*
+BEGIN {
+ n = split("one two three four five six", test_array2)
+ ret = test_array_elem(test_array2, "3")
+ printf "test_array_elem() returned %d, test_array2[3] = %g\n", ret, test_array2[3]
+ if ("5" in test_array2)
+ printf "error: test_array_elem() did not remove element \"5\"\n"
+ else
+ printf "test_array_elem() did remove element \"5\"\n"
+ if ("7" in test_array2)
+ printf "test_array_elem() added element \"7\" --> %s\n", test_array2[7]
+ else
+ printf "test_array_elem() did not add element \"7\"\n"
+ if ("subarray" in test_array2) {
+ if (isarray(test_array2["subarray"])) {
+ for (i in test_array2["subarray"])
+ printf("test_array2[\"subarray\"][\"%s\"] = %s\n",
+ i, test_array2["subarray"][i])
+ } else
+ printf "test_array_elem() added element \"subarray\" as scalar\n"
+ } else
+ printf "test_array_elem() did not add element \"subarray\"\n"
+ print ""
+}
+*/
+static awk_value_t *
+test_array_elem(int nargs, awk_value_t *result)
+{
+ awk_value_t array, index, index2, value;
+
+ make_number(0.0, result); /* default return until full success */
+
+ assert(result != NULL);
+
+ if (nargs != 2) {
+ printf("test_array_elem: nargs not right (%d should be 2)\n", nargs);
+ goto out;
+ }
+
+ /* look up an array element and print the value */
+ if (! get_argument(0, AWK_ARRAY, & array)) {
+ printf("test_array_elem: get_argument 0 (array) failed\n");
+ goto out;
+ }
+ if (! get_argument(1, AWK_STRING, & index)) {
+ printf("test_array_elem: get_argument 1 (index) failed\n");
+ goto out;
+ }
+ (void) make_const_string(index.str_value.str, index.str_value.len, & index2);
+ if (! get_array_element(array.array_cookie, & index2, AWK_UNDEFINED, & value)) {
+ printf("test_array_elem: get_array_element failed\n");
+ goto out;
+ }
+ printf("test_array_elem: a[\"%.*s\"] = %s\n",
+ (int) index.str_value.len,
+ index.str_value.str,
+ valrep2str(& value));
+
+ /* change the element - "3" */
+ (void) make_number(42.0, & value);
+ (void) make_const_string(index.str_value.str, index.str_value.len, & index2);
+ if (! set_array_element(array.array_cookie, & index2, & value)) {
+ printf("test_array_elem: set_array_element failed\n");
+ goto out;
+ }
+
+ /* delete another element - "5" */
+ (void) make_const_string("5", 1, & index);
+ if (! del_array_element(array.array_cookie, & index)) {
+ printf("test_array_elem: del_array_element failed\n");
+ goto out;
+ }
+
+ /* add a new element - "7" */
+ (void) make_const_string("7", 1, & index);
+ (void) make_const_string("seven", 5, & value);
+ if (! set_array_element(array.array_cookie, & index, & value)) {
+ printf("test_array_elem: set_array_element failed\n");
+ goto out;
+ }
+
+ /* add a subarray */
+ (void) make_const_string("subarray", 8, & index);
+ fill_in_array(& value);
+ if (! set_array_element(array.array_cookie, & index, & value)) {
+ printf("test_array_elem: set_array_element (subarray) failed\n");
+ goto out;
+ }
+
+ /* change and deletion should be reflected in awk script */
+ make_number(1.0, result);
+out:
+ return result;
+}
+
+/*
+BEGIN {
+ ret = test_array_param(a_new_array)
+ printf "test_array_param() returned %d\n", ret
+ printf "isarray(a_new_array) = %d\n", isarray(a_new_array)
+ if (isarray(a_new_array))
+ for (i in a_new_array)
+ printf("a_new_array[\"%s\"] = %s\n",
+ i, a_new_array[i])
+
+ a_scalar = 42
+ ret = test_array_param(a_scalar)
+ printf "test_array_param() returned %d\n", ret
+ printf "isarray(a_scalar) = %d\n", isarray(a_scalar)
+ print ""
+}
+*/
+
+static awk_value_t *
+test_array_param(int nargs, awk_value_t *result)
+{
+ awk_value_t new_array;
+ awk_value_t arg0;
+
+ make_number(0.0, result);
+
+ if (! get_argument(0, AWK_UNDEFINED, & arg0)) {
+ printf("test_array_param: could not get argument\n");
+ goto out;
+ }
+
+ if (arg0.val_type != AWK_UNDEFINED) {
+ printf("test_array_param: argument is not undefined (%d)\n",
+ arg0.val_type);
+ goto out;
+ }
+
+ fill_in_array(& new_array);
+ if (! set_argument(0, new_array.array_cookie)) {
+ printf("test_array_param: could not change type of argument\n");
+ goto out;
+ }
+
+ make_number(1.0, result);
+out:
+ return result; /* for now */
+}
+
+/*
+BEGIN {
+ printf "Initial value of LINT is %d\n", LINT
+ ret = print_do_lint();
+ printf "print_do_lint() returned %d\n", ret
+ LINT = ! LINT
+ printf "Changed value of LINT is %d\n", LINT
+ ret = print_do_lint();
+ printf "print_do_lint() returned %d\n", ret
+ print ""
+}
+*/
+static awk_value_t *
+print_do_lint(int nargs, awk_value_t *result)
+{
+ assert(result != NULL);
+ make_number(0.0, result);
+
+ if (nargs != 0) {
+ printf("print_do_lint: nargs not right (%d should be 0)\n", nargs);
+ goto out;
+ }
+
+ printf("print_do_lint: lint = %d\n", do_lint);
+
+ make_number(1.0, result);
+
+out:
+ return result;
+}
+
+/*
+BEGIN {
+ n = split("1 3 5 7 9 11", nums)
+ m = split("the quick brown fox jumps over the lazy dog", strings)
+ for (i in nums) {
+ ret = test_scalar(nums[i] + 0)
+ printf("test_scalar(%d) returned %d, the_scalar is %d\n", nums[i], ret, the_scalar)
+ }
+ for (i in strings) {
+ ret = test_scalar(strings[i])
+ printf("test_scalar(%s) returned %d, the_scalar is %s\n", strings[i], ret, the_scalar)
+ }
+}
+*/
+
+/* test_scalar --- test scalar cookie */
+
+static awk_value_t *
+test_scalar(int nargs, awk_value_t *result)
+{
+ awk_value_t new_value, new_value2;
+ awk_value_t the_scalar;
+
+ make_number(0.0, result);
+
+ if (! sym_lookup("the_scalar", AWK_SCALAR, & the_scalar)) {
+ printf("test_scalar: could not get scalar cookie\n");
+ goto out;
+ }
+
+ if (! get_argument(0, AWK_UNDEFINED, & new_value)) {
+ printf("test_scalar: could not get argument\n");
+ goto out;
+ } else if (new_value.val_type != AWK_STRING && new_value.val_type != AWK_NUMBER) {
+ printf("test_scalar: argument is not a scalar\n");
+ goto out;
+ }
+
+ if (new_value.val_type == AWK_STRING) {
+ make_const_string(new_value.str_value.str, new_value.str_value.len, & new_value2);
+ } else {
+ new_value2 = new_value;
+ }
+
+ if (! sym_update_scalar(the_scalar.scalar_cookie, & new_value2)) {
+ printf("test_scalar: could not update new_value2!\n");
+ goto out;
+ }
+
+ make_number(1.0, result);
+
+out:
+ return result;
+}
+
+/*
+BEGIN {
+ test_scalar_reserved()
+}
+*/
+
+/* test_scalar_reserved --- test scalar cookie on special variable */
+
+static awk_value_t *
+test_scalar_reserved(int nargs, awk_value_t *result)
+{
+ awk_value_t new_value;
+ awk_value_t the_scalar;
+
+ make_number(0.0, result);
+
+ /* look up a reserved variable - should pass */
+ if (sym_lookup("ARGC", AWK_SCALAR, & the_scalar)) {
+ printf("test_scalar_reserved: sym_lookup of ARGC passed - got a value!\n");
+ } else {
+ printf("test_scalar_reserved: sym_lookup of ARGC failed - did not get a value\n");
+ goto out;
+ }
+
+ /* updating it should fail */
+ make_number(42.0, & new_value);
+ if (! sym_update_scalar(the_scalar.scalar_cookie, & new_value)) {
+ printf("test_scalar_reserved: could not update new_value2 for ARGC - pass\n");
+ } else {
+ printf("test_scalar_reserved: was able to update new_value2 for ARGC - fail\n");
+ goto out;
+ }
+
+ make_number(1.0, result);
+
+out:
+ return result;
+}
+
+/* fill_in_array --- fill in a new array */
+
+static void
+fill_in_array(awk_value_t *new_array)
+{
+ awk_array_t a_cookie;
+ awk_value_t index, value;
+
+ a_cookie = create_array();
+
+ (void) make_const_string("hello", 5, & index);
+ (void) make_const_string("world", 5, & value);
+ if (! set_array_element(a_cookie, & index, & value)) {
+ printf("fill_in_array:%d: set_array_element failed\n", __LINE__);
+ return;
+ }
+
+ (void) make_const_string("answer", 6, & index);
+ (void) make_number(42.0, & value);
+ if (! set_array_element(a_cookie, & index, & value)) {
+ printf("fill_in_array:%d: set_array_element failed\n", __LINE__);
+ return;
+ }
+
+ new_array->val_type = AWK_ARRAY;
+ new_array->array_cookie = a_cookie;
+}
+
+/* create_new_array --- create a named array */
+
+static void
+create_new_array()
+{
+ awk_value_t value;
+
+ fill_in_array(& value);
+ if (! sym_update("new_array", & value))
+ printf("create_new_array: sym_update(\"new_array\") failed!\n");
+}
+
+/* at_exit0 --- first at_exit program, runs last */
+
+static void at_exit0(void *data, int exit_status)
+{
+ printf("at_exit0 called (should be third):");
+ if (data)
+ printf(" data = %p,", data);
+ else
+ printf(" data = NULL,");
+ printf(" exit_status = %d\n", exit_status);
+}
+
+/* at_exit1 --- second at_exit program, runs second */
+
+static int data_for_1 = 0xDeadBeef;
+static void at_exit1(void *data, int exit_status)
+{
+ int *data_p = (int *) data;
+
+ printf("at_exit1 called (should be second):");
+ if (data) {
+ if (data == & data_for_1)
+ printf(" (data is & data_for_1),");
+ else
+ printf(" (data is NOT & data_for_1),");
+ printf(" data value = %#x,", *data_p);
+ } else
+ printf(" data = NULL,");
+ printf(" exit_status = %d\n", exit_status);
+}
+
+/* at_exit2 --- third at_exit program, runs first */
+
+static void at_exit2(void *data, int exit_status)
+{
+ printf("at_exit2 called (should be first):");
+ if (data)
+ printf(" data = %p,", data);
+ else
+ printf(" data = NULL,");
+ printf(" exit_status = %d\n", exit_status);
+}
+
+static awk_ext_func_t func_table[] = {
+ { "dump_array_and_delete", dump_array_and_delete, 2 },
+ { "try_modify_environ", try_modify_environ, 0 },
+ { "var_test", var_test, 1 },
+ { "test_errno", test_errno, 0 },
+ { "test_array_size", test_array_size, 1 },
+ { "test_array_elem", test_array_elem, 2 },
+ { "test_array_param", test_array_param, 1 },
+ { "print_do_lint", print_do_lint, 0 },
+ { "test_scalar", test_scalar, 1 },
+ { "test_scalar_reserved", test_scalar_reserved, 0 },
+};
+
+/* init_testext --- additional initialization function */
+
+static awk_bool_t init_testext(void)
+{
+ awk_value_t value;
+ static const char message[] = "hello, world"; /* of course */
+ static const char message2[] = "i am a scalar";
+
+ /* add at_exit functions */
+ awk_atexit(at_exit0, NULL);
+ awk_atexit(at_exit1, & data_for_1);
+ awk_atexit(at_exit2, NULL);
+
+/*
+BEGIN {
+ printf("answer_num = %g\n", answer_num);
+ printf("message_string = %s\n", message_string);
+ for (i in new_array)
+ printf("new_array[\"%s\"] = \"%s\"\n", i, new_array[i])
+ print ""
+}
+*/
+
+ /* install some variables */
+ if (! sym_constant("answer_num", make_number(42, & value)))
+ printf("testext: sym_constant(\"answer_num\") failed!\n");
+
+ if (! sym_update("message_string",
+ make_const_string(message, strlen(message), & value)))
+ printf("testext: sym_update(\"answer_num\") failed!\n");
+
+ if (! sym_update("the_scalar",
+ make_const_string(message2, strlen(message2), & value)))
+ printf("testext: sym_update(\"the_scalar\") failed!\n");
+
+ create_new_array();
+
+ return 1;
+}
+
+static awk_bool_t (*init_func)(void) = init_testext;
+
+dl_load_func(func_table, testext, "")
diff --git a/extension/testff.awk b/extension/testff.awk
deleted file mode 100644
index 0a0a9b2f..00000000
--- a/extension/testff.awk
+++ /dev/null
@@ -1,30 +0,0 @@
-BEGIN {
- extension("./filefuncs.so", "dlload")
-
-# printf "before: "
-# fflush()
-# system("pwd")
-#
-# chdir("..")
-#
-# printf "after: "
-# fflush()
-# system("pwd")
-
- chdir(".")
-
- data[1] = 1
- print "Info for testff.awk"
- ret = stat("testff.awk", data)
- print "ret =", ret
- for (i in data)
- printf "data[\"%s\"] = %s\n", i, data[i]
- print "testff.awk modified:", strftime("%m %d %y %H:%M:%S", data["mtime"])
-
- print "\nInfo for JUNK"
- ret = stat("JUNK", data)
- print "ret =", ret
- for (i in data)
- printf "data[\"%s\"] = %s\n", i, data[i]
- print "JUNK modified:", strftime("%m %d %y %H:%M:%S", data["mtime"])
-}
diff --git a/extension/testfork.awk b/extension/testfork.awk
deleted file mode 100644
index ca00dca8..00000000
--- a/extension/testfork.awk
+++ /dev/null
@@ -1,20 +0,0 @@
-BEGIN {
- extension("./fork.so", "dlload")
-
- printf "before fork, pid = %d, ppid = %d\n", PROCINFO["pid"],
- PROCINFO["ppid"]
-
- fflush()
- ret = fork()
- if (ret < 0)
- printf("ret = %d, ERRNO = %s\n", ret, ERRNO)
- else if (ret == 0)
- printf "child, pid = %d, ppid = %d\n", PROCINFO["pid"],
- PROCINFO["ppid"]
- else {
- system("sleep 3")
- printf "parent, ret = %d\n", ret
- printf "parent, pid = %d, ppid = %d\n", PROCINFO["pid"],
- PROCINFO["ppid"]
- }
-}
diff --git a/extension/testordchr.awk b/extension/testordchr.awk
deleted file mode 100644
index 64e53d16..00000000
--- a/extension/testordchr.awk
+++ /dev/null
@@ -1,6 +0,0 @@
-BEGIN {
- extension("./ordchr.so", "dlload")
-
- print "ord(\"a\") is", ord("a")
- print "chr(65) is", chr(65)
-}
diff --git a/extension/time.3am b/extension/time.3am
new file mode 100644
index 00000000..42d9bf35
--- /dev/null
+++ b/extension/time.3am
@@ -0,0 +1,88 @@
+.TH TIME 3am "Aug 08 2012" "Free Software Foundation" "GNU Awk Extension Modules"
+.SH NAME
+time \- time functions for gawk
+.SH SYNOPSIS
+.ft CW
+@load "time"
+.sp
+time = gettimeofday()
+.br
+ret = sleep(amount)
+.ft R
+.SH DESCRIPTION
+The
+.I time
+extension adds two functions named
+.BR gettimeofday() .
+and
+.BR sleep() ,
+as follows.
+.TP
+.B gettimeofday()
+This function returns the number of seconds since the Epoch
+as a floating-point value. It should have subsecond precision.
+It returns \-1 upon error and sets
+.B ERRNO
+to indicate the problem.
+.TP
+.BI sleep( seconds )
+This function attempts to sleep for the given amount of seconds, which
+may include a fractional portion.
+If
+.I seconds
+is negative, or the attempt to sleep fails,
+then it returns \-1 and sets
+.BR ERRNO .
+Otherwise, the function should return 0 after sleeping
+for the indicated amount of time.
+... .SH NOTES
+... .SH BUGS
+.SH EXAMPLE
+.ft CW
+.nf
+@load "time"
+\&...
+printf "It is now %g seconds since the Epoch\en", gettimeofday()
+printf "Pausing for a while... " ; sleep(2.5) ; print "done"
+.fi
+.ft R
+.SH "SEE ALSO"
+.IR "GAWK: Effective AWK Programming" ,
+.IR filefuncs (3am),
+.IR fnmatch (3am),
+.IR fork (3am),
+.IR ordchr (3am),
+.IR readdir (3am),
+.IR readfile (3am),
+.IR revoutput (3am),
+.IR rwarray (3am).
+.PP
+.IR gettimeofday (2),
+.IR nanosleep (2),
+.IR select (2).
+.SH AUTHOR
+Arnold Robbins,
+.BR arnold@skeeve.com .
+.SH COPYING PERMISSIONS
+Copyright \(co 2012
+Free Software Foundation, Inc.
+.PP
+Permission is granted to make and distribute verbatim copies of
+this manual page provided the copyright notice and this permission
+notice are preserved on all copies.
+.ig
+Permission is granted to process this file through troff and print the
+results, provided the printed document carries copying permission
+notice identical to this one except for the removal of this paragraph
+(this paragraph not being relevant to the printed manual page).
+..
+.PP
+Permission is granted to copy and distribute modified versions of this
+manual page under the conditions for verbatim copying, provided that
+the entire resulting derived work is distributed under the terms of a
+permission notice identical to this one.
+.PP
+Permission is granted to copy and distribute translations of this
+manual page into another language, under the above conditions for
+modified versions, except that this permission notice may be stated in
+a translation approved by the Foundation.
diff --git a/extension/time.c b/extension/time.c
new file mode 100644
index 00000000..89811c41
--- /dev/null
+++ b/extension/time.c
@@ -0,0 +1,179 @@
+/*
+ * time.c - Builtin functions that provide time-related functions.
+ *
+ */
+
+/*
+ * Copyright (C) 2012
+ * the Free Software Foundation, Inc.
+ *
+ * This file is part of GAWK, the GNU implementation of the
+ * AWK Programming Language.
+ *
+ * GAWK is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GAWK is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <assert.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "gawkapi.h"
+
+#include "gettext.h"
+#define _(msgid) gettext(msgid)
+#define N_(msgid) msgid
+
+static const gawk_api_t *api; /* for convenience macros to work */
+static awk_ext_id_t *ext_id;
+static const char *ext_version = "time extension: version 1.0";
+static awk_bool_t (*init_func)(void) = NULL;
+
+int plugin_is_GPL_compatible;
+
+#if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
+#include <sys/time.h>
+#endif
+#if defined(HAVE_SELECT) && defined(HAVE_SYS_SELECT_H)
+#include <sys/select.h>
+#endif
+#if defined(HAVE_NANOSLEEP) && defined(HAVE_TIME_H)
+#include <time.h>
+#endif
+
+/*
+ * Returns time since 1/1/1970 UTC as a floating point value; should
+ * have sub-second precision, but the actual precision will vary based
+ * on the platform
+ */
+static awk_value_t *
+do_gettimeofday(int nargs, awk_value_t *result)
+{
+ double curtime;
+
+ assert(result != NULL);
+
+ if (do_lint && nargs > 0)
+ lintwarn(ext_id, _("gettimeofday: ignoring arguments"));
+
+#if defined(HAVE_GETTIMEOFDAY)
+ {
+ struct timeval tv;
+ gettimeofday(&tv,NULL);
+ curtime = tv.tv_sec+(tv.tv_usec/1000000.0);
+ }
+#elif defined(HAVE_GETSYSTEMTIMEASFILETIME)
+ /* based on perl win32/win32.c:win32_gettimeofday() implementation */
+ {
+ union {
+ unsigned __int64 ft_i64;
+ FILETIME ft_val;
+ } ft;
+
+ /* # of 100-nanosecond intervals since January 1, 1601 (UTC) */
+ GetSystemTimeAsFileTime(&ft.ft_val);
+#ifdef __GNUC__
+#define Const64(x) x##LL
+#else
+#define Const64(x) x##i64
+#endif
+/* Number of 100 nanosecond units from 1/1/1601 to 1/1/1970 */
+#define EPOCH_BIAS Const64(116444736000000000)
+ curtime = (ft.ft_i64 - EPOCH_BIAS)/10000000.0;
+#undef Const64
+ }
+#else
+ /* no way to retrieve system time on this platform */
+ curtime = -1;
+ update_ERRNO_string(_("gettimeofday: not supported on this platform"));
+#endif
+
+ return make_number(curtime, result);
+}
+
+/*
+ * Returns 0 if successful in sleeping the requested time;
+ * returns -1 if there is no platform support, or if the sleep request
+ * did not complete successfully (perhaps interrupted)
+ */
+static awk_value_t *
+do_sleep(int nargs, awk_value_t *result)
+{
+ awk_value_t num;
+ double secs;
+ int rc;
+
+ assert(result != NULL);
+
+ if (do_lint && nargs > 1)
+ lintwarn(ext_id, _("sleep: called with too many arguments"));
+
+ if (! get_argument(0, AWK_NUMBER, &num)) {
+ update_ERRNO_string(_("sleep: missing required numeric argument"));
+ return make_number(-1, result);
+ }
+ secs = num.num_value;
+
+ if (secs < 0) {
+ update_ERRNO_string(_("sleep: argument is negative"));
+ return make_number(-1, result);
+ }
+
+#if defined(HAVE_NANOSLEEP)
+ {
+ struct timespec req;
+
+ req.tv_sec = secs;
+ req.tv_nsec = (secs-(double)req.tv_sec)*1000000000.0;
+ if ((rc = nanosleep(&req,NULL)) < 0)
+ /* probably interrupted */
+ update_ERRNO_int(errno);
+ }
+#elif defined(HAVE_SELECT)
+ {
+ struct timeval timeout;
+
+ timeout.tv_sec = secs;
+ timeout.tv_usec = (secs-(double)timeout.tv_sec)*1000000.0;
+ if ((rc = select(0,NULL,NULL,NULL,&timeout)) < 0)
+ /* probably interrupted */
+ update_ERRNO_int(errno);
+ }
+#else
+ /* no way to sleep on this platform */
+ rc = -1;
+ update_ERRNO_str(_("sleep: not supported on this platform"));
+#endif
+
+ return make_number(rc, result);
+}
+
+static awk_ext_func_t func_table[] = {
+ { "gettimeofday", do_gettimeofday, 0 },
+ { "sleep", do_sleep, 1 },
+};
+
+/* define the dl_load function using the boilerplate macro */
+
+dl_load_func(func_table, time, "")
diff --git a/extension/xreadlink.c b/extension/xreadlink.c
deleted file mode 100644
index 91e46d9d..00000000
--- a/extension/xreadlink.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/* xreadlink.c -- readlink wrapper to return the link name in malloc'd storage
-
- Copyright (C) 2001, 2003, 2004, 2005, 2011 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; see the file COPYING.
- If not, write to the Free Software Foundation,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-/* Written by Jim Meyering <jim@meyering.net> */
-
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include "xreadlink.h"
-
-#include <stdio.h>
-#include <errno.h>
-#include <limits.h>
-#include <sys/types.h>
-#include <stdlib.h>
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-#ifndef SIZE_MAX
-# define SIZE_MAX ((size_t) -1)
-#endif
-#ifndef SSIZE_MAX
-# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2))
-#endif
-
-#define MAXSIZE (SIZE_MAX < SSIZE_MAX ? SIZE_MAX : SSIZE_MAX)
-
-#include "xalloc.h"
-
-int plugin_is_GPL_compatible;
-
-/* Call readlink to get the symbolic link value of FILE.
- SIZE is a hint as to how long the link is expected to be;
- typically it is taken from st_size. It need not be correct.
- Return a pointer to that NUL-terminated string in malloc'd storage.
- If readlink fails, return NULL (caller may use errno to diagnose).
- If malloc fails, or if the link value is longer than SSIZE_MAX :-),
- give a diagnostic and exit. */
-
-char *
-xreadlink (char const *file, size_t size)
-{
- /* The initial buffer size for the link value. A power of 2
- detects arithmetic overflow earlier, but is not required. */
- size_t buf_size = size < MAXSIZE ? size + 1 : MAXSIZE;
-
- while (1)
- {
- char *buffer = xmalloc (buf_size);
- ssize_t r = readlink (file, buffer, buf_size);
- size_t link_length = r;
-
- /* On AIX 5L v5.3 and HP-UX 11i v2 04/09, readlink returns -1
- with errno == ERANGE if the buffer is too small. */
- if (r < 0 && errno != ERANGE)
- {
- int saved_errno = errno;
- free (buffer);
- errno = saved_errno;
- return NULL;
- }
-
- if (link_length < buf_size)
- {
- buffer[link_length] = 0;
- return buffer;
- }
-
- free (buffer);
- if (buf_size <= MAXSIZE / 2)
- buf_size *= 2;
- else if (buf_size < MAXSIZE)
- buf_size = MAXSIZE;
- else
- xalloc_die ();
- }
-}
diff --git a/extension/xreadlink.h b/extension/xreadlink.h
deleted file mode 100644
index 0c16610d..00000000
--- a/extension/xreadlink.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* readlink wrapper to return the link name in malloc'd storage
-
- Copyright (C) 2001, 2003, 2004, 2011 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; see the file COPYING.
- If not, write to the Free Software Foundation,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-/* Written by Jim Meyering <jim@meyering.net> */
-
-#include <stddef.h>
-char *xreadlink (char const *, size_t);
diff --git a/field.c b/field.c
index 2e7c1505..6bbab8d5 100644
--- a/field.c
+++ b/field.c
@@ -39,22 +39,22 @@ is_blank(int c)
typedef void (* Setfunc)(long, char *, long, NODE *);
static long (*parse_field)(long, char **, int, NODE *,
- Regexp *, Setfunc, NODE *, NODE *, int);
+ Regexp *, Setfunc, NODE *, NODE *, bool);
static void rebuild_record(void);
static long re_parse_field(long, char **, int, NODE *,
- Regexp *, Setfunc, NODE *, NODE *, int);
+ Regexp *, Setfunc, NODE *, NODE *, bool);
static long def_parse_field(long, char **, int, NODE *,
- Regexp *, Setfunc, NODE *, NODE *, int);
+ Regexp *, Setfunc, NODE *, NODE *, bool);
static long posix_def_parse_field(long, char **, int, NODE *,
- Regexp *, Setfunc, NODE *, NODE *, int);
+ Regexp *, Setfunc, NODE *, NODE *, bool);
static long null_parse_field(long, char **, int, NODE *,
- Regexp *, Setfunc, NODE *, NODE *, int);
+ Regexp *, Setfunc, NODE *, NODE *, bool);
static long sc_parse_field(long, char **, int, NODE *,
- Regexp *, Setfunc, NODE *, NODE *, int);
+ Regexp *, Setfunc, NODE *, NODE *, bool);
static long fw_parse_field(long, char **, int, NODE *,
- Regexp *, Setfunc, NODE *, NODE *, int);
+ Regexp *, Setfunc, NODE *, NODE *, bool);
static long fpat_parse_field(long, char **, int, NODE *,
- Regexp *, Setfunc, NODE *, NODE *, int);
+ Regexp *, Setfunc, NODE *, NODE *, bool);
static void set_element(long num, char * str, long len, NODE *arr);
static void grow_fields_arr(long num);
static void set_field(long num, char *str, long len, NODE *dummy);
@@ -62,15 +62,15 @@ static void set_field(long num, char *str, long len, NODE *dummy);
static char *parse_extent; /* marks where to restart parse of record */
static long parse_high_water = 0; /* field number that we have parsed so far */
static long nf_high_water = 0; /* size of fields_arr */
-static int resave_fs;
+static bool resave_fs;
static NODE *save_FS; /* save current value of FS when line is read,
* to be used in deferred parsing
*/
static int *FIELDWIDTHS = NULL;
NODE **fields_arr; /* array of pointers to the field nodes */
-int field0_valid; /* $(>0) has not been changed yet */
-int default_FS; /* TRUE when FS == " " */
+bool field0_valid; /* $(>0) has not been changed yet */
+int default_FS; /* true when FS == " " */
Regexp *FS_re_yes_case = NULL;
Regexp *FS_re_no_case = NULL;
Regexp *FS_regexp = NULL;
@@ -85,14 +85,14 @@ void
init_fields()
{
emalloc(fields_arr, NODE **, sizeof(NODE *), "init_fields");
- fields_arr[0] = Nnull_string;
+ fields_arr[0] = dupnode(Nnull_string);
parse_extent = fields_arr[0]->stptr;
save_FS = dupnode(FS_node->var_value);
getnode(Null_field);
*Null_field = *Nnull_string;
- Null_field->flags |= FIELD;
- Null_field->flags &= ~(NUMCUR|NUMBER|MAYBE_NUM|PERM|MALLOC);
- field0_valid = TRUE;
+ Null_field->valref = 1;
+ Null_field->flags = (FIELD|STRCUR|STRING);
+ field0_valid = true;
}
/* grow_fields --- acquire new fields as needed */
@@ -194,24 +194,34 @@ rebuild_record()
* so that unrefing a field doesn't try to unref into the old $0.
*/
for (cops = ops, i = 1; i <= NF; i++) {
- if (fields_arr[i]->stlen > 0) {
+ NODE *r = fields_arr[i];
+ if (r->stlen > 0) {
NODE *n;
getnode(n);
- if ((fields_arr[i]->flags & FIELD) == 0) {
+ if ((r->flags & FIELD) == 0) {
*n = *Null_field;
- n->stlen = fields_arr[i]->stlen;
- if ((fields_arr[i]->flags & (NUMCUR|NUMBER)) != 0) {
- n->flags |= (fields_arr[i]->flags & (NUMCUR|NUMBER));
- n->numbr = fields_arr[i]->numbr;
+ n->stlen = r->stlen;
+ if ((r->flags & (NUMCUR|NUMBER)) != 0) {
+ n->flags |= (r->flags & (MPFN|MPZN|NUMCUR|NUMBER));
+#ifdef HAVE_MPFR
+ if (is_mpg_float(r)) {
+ mpfr_init(n->mpg_numbr);
+ mpfr_set(n->mpg_numbr, r->mpg_numbr, ROUND_MODE);
+ } else if (is_mpg_integer(r)) {
+ mpz_init(n->mpg_i);
+ mpz_set(n->mpg_i, r->mpg_i);
+ } else
+#endif
+ n->numbr = r->numbr;
}
} else {
- *n = *(fields_arr[i]);
- n->flags &= ~(MALLOC|PERM|STRING);
+ *n = *r;
+ n->flags &= ~(MALLOC|STRING);
}
n->stptr = cops;
- unref(fields_arr[i]);
+ unref(r);
fields_arr[i] = n;
assert((n->flags & WSTRCUR) == 0);
}
@@ -221,7 +231,7 @@ rebuild_record()
unref(fields_arr[0]);
fields_arr[0] = tmp;
- field0_valid = TRUE;
+ field0_valid = true;
}
/*
@@ -289,7 +299,7 @@ reset_record()
int i;
NODE *n;
- (void) force_string(fields_arr[0]);
+ fields_arr[0] = force_string(fields_arr[0]);
NF = -1;
for (i = 1; i <= parse_high_water; i++) {
@@ -304,12 +314,12 @@ reset_record()
* $0 = $0 should resplit using the current value of FS.
*/
if (resave_fs) {
- resave_fs = FALSE;
+ resave_fs = false;
unref(save_FS);
save_FS = dupnode(FS_node->var_value);
}
- field0_valid = TRUE;
+ field0_valid = true;
}
/* set_NF --- handle what happens to $0 and fields when NF is changed */
@@ -323,7 +333,8 @@ set_NF()
assert(NF != -1);
- nf = (long) force_number(NF_node->var_value);
+ (void) force_number(NF_node->var_value);
+ nf = get_number_si(NF_node->var_value);
if (nf < 0)
fatal(_("NF set to negative value"));
NF = nf;
@@ -346,7 +357,7 @@ set_NF()
}
parse_high_water = NF;
}
- field0_valid = FALSE;
+ field0_valid = false;
}
/*
@@ -365,7 +376,7 @@ re_parse_field(long up_to, /* parse only up to this field number */
Setfunc set, /* routine to set the value of the parsed field */
NODE *n,
NODE *sep_arr, /* array of field separators (maybe NULL) */
- int in_middle)
+ bool in_middle)
{
char *scan = *buf;
long nf = parse_high_water;
@@ -459,7 +470,7 @@ def_parse_field(long up_to, /* parse only up to this field number */
Setfunc set, /* routine to set the value of the parsed field */
NODE *n,
NODE *sep_arr, /* array of field separators (maybe NULL) */
- int in_middle ATTRIBUTE_UNUSED)
+ bool in_middle ATTRIBUTE_UNUSED)
{
char *scan = *buf;
long nf = parse_high_water;
@@ -540,7 +551,7 @@ posix_def_parse_field(long up_to, /* parse only up to this field number */
Setfunc set, /* routine to set the value of the parsed field */
NODE *n,
NODE *dummy ATTRIBUTE_UNUSED, /* sep_arr not needed here: hence dummy */
- int in_middle ATTRIBUTE_UNUSED)
+ bool in_middle ATTRIBUTE_UNUSED)
{
char *scan = *buf;
long nf = parse_high_water;
@@ -606,7 +617,7 @@ null_parse_field(long up_to, /* parse only up to this field number */
Setfunc set, /* routine to set the value of the parsed field */
NODE *n,
NODE *sep_arr, /* array of field separators (maybe NULL) */
- int in_middle ATTRIBUTE_UNUSED)
+ bool in_middle ATTRIBUTE_UNUSED)
{
char *scan = *buf;
long nf = parse_high_water;
@@ -661,7 +672,7 @@ sc_parse_field(long up_to, /* parse only up to this field number */
Setfunc set, /* routine to set the value of the parsed field */
NODE *n,
NODE *sep_arr, /* array of field separators (maybe NULL) */
- int in_middle ATTRIBUTE_UNUSED)
+ bool in_middle ATTRIBUTE_UNUSED)
{
char *scan = *buf;
char fschar;
@@ -742,7 +753,7 @@ fw_parse_field(long up_to, /* parse only up to this field number */
Setfunc set, /* routine to set the value of the parsed field */
NODE *n,
NODE *dummy ATTRIBUTE_UNUSED, /* sep_arr not needed here: hence dummy */
- int in_middle ATTRIBUTE_UNUSED)
+ bool in_middle ATTRIBUTE_UNUSED)
{
char *scan = *buf;
long nf = parse_high_water;
@@ -808,7 +819,7 @@ fw_parse_field(long up_to, /* parse only up to this field number */
void
invalidate_field0()
{
- field0_valid = FALSE;
+ field0_valid = false;
}
/* get_field --- return a particular $n */
@@ -818,7 +829,7 @@ invalidate_field0()
NODE **
get_field(long requested, Func_ptr *assign)
{
- int in_middle = FALSE;
+ bool in_middle = false;
/*
* if requesting whole line but some other field has been altered,
* then the whole line must be rebuilt
@@ -847,7 +858,7 @@ get_field(long requested, Func_ptr *assign)
#if 0
if (assign != NULL)
- field0_valid = FALSE; /* $0 needs reconstruction */
+ field0_valid = false; /* $0 needs reconstruction */
#else
/*
* Keep things uniform. Also, mere intention of assigning something
@@ -872,7 +883,7 @@ get_field(long requested, Func_ptr *assign)
if (parse_high_water == 0) /* starting at the beginning */
parse_extent = fields_arr[0]->stptr;
else
- in_middle = TRUE;
+ in_middle = true;
parse_high_water = (*parse_field)(requested, &parse_extent,
fields_arr[0]->stlen - (parse_extent - fields_arr[0]->stptr),
save_FS, NULL, set_field, (NODE *) NULL, (NODE *) NULL, in_middle);
@@ -927,7 +938,7 @@ set_element(long num, char *s, long len, NODE *n)
it = make_string(s, len);
it->flags |= MAYBE_NUM;
sub = make_number((AWKNUM) (num));
- lhs = assoc_lookup(n, sub, FALSE);
+ lhs = assoc_lookup(n, sub);
unref(sub);
unref(*lhs);
*lhs = it;
@@ -941,11 +952,11 @@ do_split(int nargs)
NODE *src, *arr, *sep, *fs, *tmp, *sep_arr = NULL;
char *s;
long (*parseit)(long, char **, int, NODE *,
- Regexp *, Setfunc, NODE *, NODE *, int);
+ Regexp *, Setfunc, NODE *, NODE *, bool);
Regexp *rp = NULL;
if (nargs == 4) {
- static short warned1 = FALSE, warned2 = FALSE;
+ static bool warned1 = false, warned2 = false;
if (do_traditional || do_posix) {
fatal(_("split: fourth argument is a gawk extension"));
@@ -954,11 +965,11 @@ do_split(int nargs)
if (sep_arr->type != Node_var_array)
fatal(_("split: fourth argument is not an array"));
if (do_lint && ! warned1) {
- warned1 = TRUE;
+ warned1 = true;
lintwarn(_("split: fourth argument is a gawk extension"));
}
if (do_lint_old && ! warned2) {
- warned2 = TRUE;
+ warned2 = true;
warning(_("split: fourth argument is a gawk extension"));
}
}
@@ -988,8 +999,8 @@ do_split(int nargs)
/*
* Skip the work if first arg is the null string.
*/
- decr_sp();
- DEREF(src);
+ tmp = POP_SCALAR();
+ DEREF(tmp);
return make_number((AWKNUM) 0);
}
@@ -1001,12 +1012,12 @@ do_split(int nargs)
fs = sep->re_exp;
if (fs->stlen == 0) {
- static short warned = FALSE;
+ static bool warned = false;
parseit = null_parse_field;
if (do_lint && ! warned) {
- warned = TRUE;
+ warned = true;
lintwarn(_("split: null string for third arg is a gawk extension"));
}
} else if (fs->stlen == 1 && (sep->re_flags & CONSTANT) == 0) {
@@ -1025,9 +1036,9 @@ do_split(int nargs)
s = src->stptr;
tmp = make_number((AWKNUM) (*parseit)(UNLIMITED, &s, (int) src->stlen,
- fs, rp, set_element, arr, sep_arr, FALSE));
+ fs, rp, set_element, arr, sep_arr, false));
- decr_sp();
+ src = POP_SCALAR(); /* really pop off stack */
DEREF(src);
return tmp;
}
@@ -1064,7 +1075,7 @@ do_patsplit(int nargs)
if (sep_arr == arr)
fatal(_("patsplit: cannot use the same array for second and fourth args"));
- /* This checks need to be done before clearing any of the arrays */
+ /* These checks need to be done before clearing any of the arrays */
for (tmp = sep_arr->parent_array; tmp != NULL; tmp = tmp->parent_array)
if (tmp == arr)
fatal(_("patsplit: cannot use a subarray of second arg for fourth arg"));
@@ -1085,10 +1096,10 @@ do_patsplit(int nargs)
s = src->stptr;
tmp = make_number((AWKNUM) fpat_parse_field(UNLIMITED, &s,
(int) src->stlen, fpat, rp,
- set_element, arr, sep_arr, FALSE));
+ set_element, arr, sep_arr, false));
}
- decr_sp(); /* 1st argument not POP-ed */
+ src = POP_SCALAR(); /* really pop off stack */
DEREF(src);
return tmp;
}
@@ -1102,11 +1113,12 @@ set_FIELDWIDTHS()
char *end;
int i;
static int fw_alloc = 4;
- static short warned = FALSE;
- int fatal_error = FALSE;
+ static bool warned = false;
+ bool fatal_error = false;
+ NODE *tmp;
if (do_lint && ! warned) {
- warned = TRUE;
+ warned = true;
lintwarn(_("`FIELDWIDTHS' is a gawk extension"));
}
if (do_traditional) /* quick and dirty, does the trick */
@@ -1120,7 +1132,8 @@ set_FIELDWIDTHS()
(void) get_field(UNLIMITED - 1, 0);
parse_field = fw_parse_field;
- scan = force_string(FIELDWIDTHS_node->var_value)->stptr;
+ tmp = force_string(FIELDWIDTHS_node->var_value);
+ scan = tmp->stptr;
if (FIELDWIDTHS == NULL)
emalloc(FIELDWIDTHS, int *, fw_alloc * sizeof(int), "set_FIELDWIDTHS");
@@ -1139,7 +1152,7 @@ set_FIELDWIDTHS()
++scan;
}
if (*scan == '-') {
- fatal_error = TRUE;
+ fatal_error = true;
break;
}
if (*scan == '\0')
@@ -1154,7 +1167,7 @@ set_FIELDWIDTHS()
|| (*end != '\0' && ! is_blank(*end))
|| !(0 < tmp && tmp <= INT_MAX)
) {
- fatal_error = TRUE;
+ fatal_error = true;
break;
}
FIELDWIDTHS[i] = tmp;
@@ -1183,7 +1196,7 @@ set_FS()
NODE *fs;
static NODE *save_fs = NULL;
static NODE *save_rs = NULL;
- int remake_re = TRUE;
+ bool remake_re = true;
/*
* If changing the way fields are split, obey least-surprise
@@ -1210,7 +1223,7 @@ set_FS()
if (current_field_sep() == Using_FS) {
return;
} else {
- remake_re = FALSE;
+ remake_re = false;
goto choose_fs_function;
}
}
@@ -1219,7 +1232,7 @@ set_FS()
save_fs = dupnode(FS_node->var_value);
unref(save_rs);
save_rs = dupnode(RS_node->var_value);
- resave_fs = TRUE;
+ resave_fs = true;
/* If FS_re_no_case assignment is fatal (make_regexp in remake_re)
* FS_regexp will be NULL with a non-null FS_re_yes_case.
@@ -1233,16 +1246,16 @@ set_FS()
choose_fs_function:
buf[0] = '\0';
- default_FS = FALSE;
+ default_FS = false;
fs = force_string(FS_node->var_value);
if (! do_traditional && fs->stlen == 0) {
- static short warned = FALSE;
+ static bool warned = false;
parse_field = null_parse_field;
if (do_lint && ! warned) {
- warned = TRUE;
+ warned = true;
lintwarn(_("null string for `FS' is a gawk extension"));
}
} else if (fs->stlen > 1) {
@@ -1254,7 +1267,7 @@ choose_fs_function:
parse_field = sc_parse_field;
if (fs->stlen == 1) {
if (fs->stptr[0] == ' ') {
- default_FS = TRUE;
+ default_FS = true;
strcpy(buf, "[ \t\n]+");
} else if (fs->stptr[0] == '\\') {
/* yet another special case */
@@ -1270,7 +1283,7 @@ choose_fs_function:
if (fs->stlen == 1) {
if (fs->stptr[0] == ' ')
- default_FS = TRUE;
+ default_FS = true;
else if (fs->stptr[0] == '\\')
/* same special case */
strcpy(buf, "[\\\\]");
@@ -1284,13 +1297,13 @@ choose_fs_function:
FS_re_yes_case = FS_re_no_case = FS_regexp = NULL;
if (buf[0] != '\0') {
- FS_re_yes_case = make_regexp(buf, strlen(buf), FALSE, TRUE, TRUE);
- FS_re_no_case = make_regexp(buf, strlen(buf), TRUE, TRUE, TRUE);
+ FS_re_yes_case = make_regexp(buf, strlen(buf), false, true, true);
+ FS_re_no_case = make_regexp(buf, strlen(buf), true, true, true);
FS_regexp = (IGNORECASE ? FS_re_no_case : FS_re_yes_case);
parse_field = re_parse_field;
} else if (parse_field == re_parse_field) {
- FS_re_yes_case = make_regexp(fs->stptr, fs->stlen, FALSE, TRUE, TRUE);
- FS_re_no_case = make_regexp(fs->stptr, fs->stlen, TRUE, TRUE, TRUE);
+ FS_re_yes_case = make_regexp(fs->stptr, fs->stlen, false, true, true);
+ FS_re_no_case = make_regexp(fs->stptr, fs->stlen, true, true, true);
FS_regexp = (IGNORECASE ? FS_re_no_case : FS_re_yes_case);
} else
FS_re_yes_case = FS_re_no_case = FS_regexp = NULL;
@@ -1331,7 +1344,7 @@ update_PROCINFO_str(const char *subscript, const char *str)
if (PROCINFO_node == NULL)
return;
tmp = make_string(subscript, strlen(subscript));
- aptr = assoc_lookup(PROCINFO_node, tmp, FALSE);
+ aptr = assoc_lookup(PROCINFO_node, tmp);
unref(tmp);
unref(*aptr);
*aptr = make_string(str, strlen(str));
@@ -1348,7 +1361,7 @@ update_PROCINFO_num(const char *subscript, AWKNUM val)
if (PROCINFO_node == NULL)
return;
tmp = make_string(subscript, strlen(subscript));
- aptr = assoc_lookup(PROCINFO_node, tmp, FALSE);
+ aptr = assoc_lookup(PROCINFO_node, tmp);
unref(tmp);
unref(*aptr);
*aptr = make_number(val);
@@ -1359,13 +1372,13 @@ update_PROCINFO_num(const char *subscript, AWKNUM val)
void
set_FPAT()
{
- static short warned = FALSE;
+ static bool warned = false;
static NODE *save_fpat = NULL;
- int remake_re = TRUE;
+ bool remake_re = true;
NODE *fpat;
if (do_lint && ! warned) {
- warned = TRUE;
+ warned = true;
lintwarn(_("`FPAT' is a gawk extension"));
}
if (do_traditional) /* quick and dirty, does the trick */
@@ -1393,7 +1406,7 @@ set_FPAT()
if (current_field_sep() == Using_FPAT) {
return;
} else {
- remake_re = FALSE;
+ remake_re = false;
goto set_fpat_function;
}
}
@@ -1413,8 +1426,8 @@ set_fpat_function:
refree(FPAT_re_no_case);
FPAT_re_yes_case = FPAT_re_no_case = FPAT_regexp = NULL;
- FPAT_re_yes_case = make_regexp(fpat->stptr, fpat->stlen, FALSE, TRUE, TRUE);
- FPAT_re_no_case = make_regexp(fpat->stptr, fpat->stlen, TRUE, TRUE, TRUE);
+ FPAT_re_yes_case = make_regexp(fpat->stptr, fpat->stlen, false, true, true);
+ FPAT_re_no_case = make_regexp(fpat->stptr, fpat->stlen, true, true, true);
FPAT_regexp = (IGNORECASE ? FPAT_re_no_case : FPAT_re_yes_case);
}
@@ -1471,8 +1484,8 @@ incr_scan(char **scanp, size_t len, mbstate_t *mbs)
* by gsub.
*
* BEGIN {
- * FALSE = 0
- * TRUE = 1
+ * false = 0
+ * true = 1
*
* fpat[1] = "([^,]*)|(\"[^\"]+\")"
* fpat[2] = fpat[1]
@@ -1505,11 +1518,11 @@ incr_scan(char **scanp, size_t len, mbstate_t *mbs)
* if (length(string) == 0)
* return 0
*
- * eosflag = non_empty = FALSE
+ * eosflag = non_empty = false
* nf = 0
* while (match(string, pattern)) {
* if (RLENGTH > 0) { # easy case
- * non_empty = TRUE
+ * non_empty = true
* if (! (nf in seps)) {
* if (RSTART == 1) # match at front of string
* seps[nf] = ""
@@ -1524,7 +1537,7 @@ incr_scan(char **scanp, size_t len, mbstate_t *mbs)
* # last match was non-empty, and at the
* # current character we get a zero length match,
* # which we don't want, so skip over it
- * non_empty = FALSE
+ * non_empty = false
* seps[nf] = substr(string, 1, 1)
* string = substr(string, 2)
* } else {
@@ -1544,13 +1557,13 @@ incr_scan(char **scanp, size_t len, mbstate_t *mbs)
* } else {
* string = substr(string, RSTART + 1)
* }
- * non_empty = FALSE
+ * non_empty = false
* }
* if (length(string) == 0) {
* if (eosflag)
* break
* else
- * eosflag = TRUE
+ * eosflag = true
* }
* }
* if (length(string) > 0)
@@ -1568,16 +1581,16 @@ fpat_parse_field(long up_to, /* parse only up to this field number */
Setfunc set, /* routine to set the value of the parsed field */
NODE *n,
NODE *sep_arr, /* array of field separators (may be NULL) */
- int in_middle)
+ bool in_middle)
{
char *scan = *buf;
long nf = parse_high_water;
char *start;
char *end = scan + len;
int regex_flags = RE_NEED_START;
- int need_to_set_sep;
- int non_empty;
- int eosflag;
+ bool need_to_set_sep;
+ bool non_empty;
+ bool eosflag;
#if MBS_SUPPORT
mbstate_t mbs;
@@ -1598,16 +1611,16 @@ fpat_parse_field(long up_to, /* parse only up to this field number */
regex_flags |= RE_NO_BOL;
non_empty = rp->non_empty;
} else
- non_empty = FALSE;
+ non_empty = false;
- eosflag = FALSE;
- need_to_set_sep = TRUE;
+ eosflag = false;
+ need_to_set_sep = true;
start = scan;
while (research(rp, scan, 0, (end - scan), regex_flags) != -1
&& nf < up_to) {
if (REEND(rp, scan) > RESTART(rp, scan)) { /* if (RLENGTH > 0) */
- non_empty = TRUE;
+ non_empty = true;
if (sep_arr != NULL && need_to_set_sep) {
if (RESTART(rp, scan) == 0) /* match at front */
set_element(nf, start, 0L, sep_arr);
@@ -1626,16 +1639,16 @@ fpat_parse_field(long up_to, /* parse only up to this field number */
scan += REEND(rp, scan);
if (scan >= end)
break;
- need_to_set_sep = TRUE;
+ need_to_set_sep = true;
} else if (non_empty) { /* else if non_empty */
/*
* last match was non-empty, and at the
* current character we get a zero length match,
* which we don't want, so skip over it
*/
- non_empty = FALSE;
+ non_empty = false;
if (sep_arr != NULL) {
- need_to_set_sep = FALSE;
+ need_to_set_sep = false;
set_element(nf, start, 1L, sep_arr);
}
increment_scan(& scan, end - scan);
@@ -1649,12 +1662,12 @@ fpat_parse_field(long up_to, /* parse only up to this field number */
(long) RESTART(rp, scan),
sep_arr);
}
- need_to_set_sep = TRUE;
+ need_to_set_sep = true;
(*set)(++nf, scan, 0L, n);
if (! non_empty && ! eosflag) { /* prev was empty */
if (sep_arr != NULL) {
set_element(nf, start, 1L, sep_arr);
- need_to_set_sep = FALSE;
+ need_to_set_sep = false;
}
}
if (RESTART(rp, scan) == 0)
@@ -1662,13 +1675,13 @@ fpat_parse_field(long up_to, /* parse only up to this field number */
else {
scan += RESTART(rp, scan);
}
- non_empty = FALSE;
+ non_empty = false;
}
if (scan >= end) { /* length(string) == 0 */
if (eosflag)
break;
else
- eosflag = TRUE;
+ eosflag = true;
}
start = scan;
diff --git a/gawkapi.c b/gawkapi.c
new file mode 100644
index 00000000..c9b2aced
--- /dev/null
+++ b/gawkapi.c
@@ -0,0 +1,1177 @@
+/*
+ * gawkapi.c -- Implement the functions defined for gawkapi.h
+ */
+
+/*
+ * Copyright (C) 2012, the Free Software Foundation, Inc.
+ *
+ * This file is part of GAWK, the GNU implementation of the
+ * AWK Programming Language.
+ *
+ * GAWK is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GAWK is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "awk.h"
+
+static awk_bool_t node_to_awk_value(NODE *node, awk_value_t *result, awk_valtype_t wanted);
+static void set_constant();
+
+/*
+ * api_get_argument --- get the count'th paramater, zero-based.
+ *
+ * Returns false if count is out of range, or if actual paramater
+ * does not match what is specified in wanted. In the latter
+ * case, fills in result->val_type with the actual type.
+ */
+
+static awk_bool_t
+api_get_argument(awk_ext_id_t id, size_t count,
+ awk_valtype_t wanted, awk_value_t *result)
+{
+#ifdef DYNAMIC
+ NODE *arg;
+
+ if (result == NULL)
+ return false;
+
+ (void) id;
+
+ /* set up default result */
+ memset(result, 0, sizeof(*result));
+ result->val_type = AWK_UNDEFINED;
+
+ /*
+ * Song and dance here. get_array_argument() and get_scalar_argument()
+ * will force a change in type of a parameter that is Node_var_new.
+ *
+ * Start by looking at the unadulterated argument as it was passed.
+ */
+ arg = get_argument(count);
+ if (arg == NULL)
+ return false;
+
+ /* if type is undefined */
+ if (arg->type == Node_var_new) {
+ if (wanted == AWK_UNDEFINED)
+ return true;
+ else if (wanted == AWK_ARRAY) {
+ goto array;
+ } else {
+ goto scalar;
+ }
+ }
+
+ /* at this point, we have real type */
+ if (arg->type == Node_var_array || arg->type == Node_array_ref) {
+ if (wanted != AWK_ARRAY && wanted != AWK_UNDEFINED)
+ return false;
+ goto array;
+ } else
+ goto scalar;
+
+array:
+ /* get the array here */
+ arg = get_array_argument(count, false);
+ if (arg == NULL)
+ return false;
+
+ return node_to_awk_value(arg, result, wanted);
+
+scalar:
+ /* at this point we have a real type that is not an array */
+ arg = get_scalar_argument(count, false);
+ if (arg == NULL)
+ return false;
+
+ return node_to_awk_value(arg, result, wanted);
+#else
+ return false;
+#endif
+}
+
+/* api_set_argument --- convert an argument to an array */
+
+static awk_bool_t
+api_set_argument(awk_ext_id_t id,
+ size_t count,
+ awk_array_t new_array)
+{
+#ifdef DYNAMIC
+ NODE *arg;
+ NODE *array = (NODE *) new_array;
+
+ (void) id;
+
+ if (array == NULL || array->type != Node_var_array)
+ return false;
+
+ if ( (arg = get_argument(count)) == NULL
+ || arg->type != Node_var_new)
+ return false;
+
+ arg = get_array_argument(count, false);
+ if (arg == NULL)
+ return false;
+
+ array->vname = arg->vname;
+ *arg = *array;
+ freenode(array);
+
+ return true;
+#else
+ return false;
+#endif
+}
+
+/* awk_value_to_node --- convert a value into a NODE */
+
+NODE *
+awk_value_to_node(const awk_value_t *retval)
+{
+ NODE *ext_ret_val;
+ NODE *v;
+
+ if (retval == NULL)
+ fatal(_("awk_value_to_node: received null retval"));
+
+ switch (retval->val_type) {
+ case AWK_ARRAY:
+ ext_ret_val = (NODE *) retval->array_cookie;
+ break;
+ case AWK_UNDEFINED:
+ ext_ret_val = dupnode(Nnull_string);
+ break;
+ case AWK_NUMBER:
+ ext_ret_val = make_number(retval->num_value);
+ break;
+ case AWK_STRING:
+ ext_ret_val = make_str_node(retval->str_value.str,
+ retval->str_value.len, ALREADY_MALLOCED);
+ break;
+ case AWK_SCALAR:
+ v = (NODE *) retval->scalar_cookie;
+ if (v->type != Node_var)
+ ext_ret_val = NULL;
+ else
+ ext_ret_val = dupnode(v->var_value);
+ break;
+ case AWK_VALUE_COOKIE:
+ ext_ret_val = dupnode((NODE *)(retval->value_cookie));
+ break;
+ default: /* any invalid type */
+ ext_ret_val = NULL;
+ break;
+ }
+
+ return ext_ret_val;
+}
+
+/* Functions to print messages */
+
+/* api_fatal --- print a fatal message and exit */
+
+static void
+api_fatal(awk_ext_id_t id, const char *format, ...)
+{
+ va_list args;
+
+ (void) id;
+
+ va_start(args, format);
+ err(true, _("fatal: "), format, args);
+ va_end(args);
+}
+
+/* api_warning --- print a warning message and exit */
+
+static void
+api_warning(awk_ext_id_t id, const char *format, ...)
+{
+ va_list args;
+
+ (void) id;
+
+ va_start(args, format);
+ err(false, _("warning: "), format, args);
+ va_end(args);
+}
+
+/* api_lintwarn --- print a lint warning message and exit if appropriate */
+
+static void
+api_lintwarn(awk_ext_id_t id, const char *format, ...)
+{
+ va_list args;
+
+ (void) id;
+
+ va_start(args, format);
+ if (lintwarn == r_fatal) {
+ err(true, _("fatal: "), format, args);
+ va_end(args);
+ } else {
+ err(false, _("warning: "), format, args);
+ va_end(args);
+ }
+}
+
+/* api_register_input_parser --- register an input_parser; for opening files read-only */
+
+static void
+api_register_input_parser(awk_ext_id_t id, awk_input_parser_t *input_parser)
+{
+ (void) id;
+
+ if (input_parser == NULL)
+ return;
+
+ register_input_parser(input_parser);
+}
+
+/* api_register_output_wrapper --- egister an output wrapper, for writing files / two-way pipes */
+
+static void api_register_output_wrapper(awk_ext_id_t id,
+ awk_output_wrapper_t *output_wrapper)
+{
+ (void) id;
+
+ if (output_wrapper == NULL)
+ return;
+
+ register_output_wrapper(output_wrapper);
+}
+
+/* api_register_two_way_processor --- register a processor for two way I/O */
+
+static void
+api_register_two_way_processor(awk_ext_id_t id,
+ awk_two_way_processor_t *two_way_processor)
+{
+ (void) id;
+
+ if (two_way_processor == NULL)
+ return;
+
+ register_two_way_processor(two_way_processor);
+}
+
+/* Functions to update ERRNO */
+
+/* api_update_ERRNO_int --- update ERRNO with an integer value */
+
+static void
+api_update_ERRNO_int(awk_ext_id_t id, int errno_val)
+{
+ (void) id;
+
+ update_ERRNO_int(errno_val);
+}
+
+/* api_update_ERRNO_string --- update ERRNO with a string value */
+
+static void
+api_update_ERRNO_string(awk_ext_id_t id,
+ const char *string)
+{
+ (void) id;
+
+ if (string == NULL)
+ return;
+
+ update_ERRNO_string(string);
+}
+
+/* api_unset_ERRNO --- unset ERRNO */
+
+static void
+api_unset_ERRNO(awk_ext_id_t id)
+{
+ (void) id;
+
+ unset_ERRNO();
+}
+
+
+/* api_add_ext_func --- add a function to the interpreter, returns true upon success */
+
+static awk_bool_t
+api_add_ext_func(awk_ext_id_t id,
+ const char *namespace,
+ const awk_ext_func_t *func)
+{
+ (void) id;
+ (void) namespace;
+
+ if (func == NULL)
+ return false;
+
+#ifdef DYNAMIC
+ return make_builtin(func);
+#else
+ return false;
+#endif
+}
+
+/* Stuff for exit handler - do it as linked list */
+
+struct ext_exit_handler {
+ struct ext_exit_handler *next;
+ void (*funcp)(void *data, int exit_status);
+ void *arg0;
+};
+static struct ext_exit_handler *list_head = NULL;
+
+/* run_ext_exit_handlers --- run the extension exit handlers, LIFO order */
+
+void
+run_ext_exit_handlers(int exitval)
+{
+ struct ext_exit_handler *p, *next;
+
+ for (p = list_head; p != NULL; p = next) {
+ next = p->next;
+ p->funcp(p->arg0, exitval);
+ free(p);
+ }
+ list_head = NULL;
+}
+
+/* api_awk_atexit --- add an exit call back */
+
+static void
+api_awk_atexit(awk_ext_id_t id,
+ void (*funcp)(void *data, int exit_status),
+ void *arg0)
+{
+ struct ext_exit_handler *p;
+
+ (void) id;
+
+ if (funcp == NULL)
+ return;
+
+ /* allocate memory */
+ emalloc(p, struct ext_exit_handler *, sizeof(struct ext_exit_handler), "api_awk_atexit");
+
+ /* fill it in */
+ p->funcp = funcp;
+ p->arg0 = arg0;
+
+ /* add to linked list, LIFO order */
+ p->next = list_head;
+ list_head = p;
+}
+
+/* node_to_awk_value --- convert a node into a value for an extension */
+
+static awk_bool_t
+node_to_awk_value(NODE *node, awk_value_t *val, awk_valtype_t wanted)
+{
+ awk_bool_t ret = false;
+
+ if (node == NULL)
+ fatal(_("node_to_awk_value: received null node"));
+
+ if (val == NULL)
+ fatal(_("node_to_awk_value: received null val"));
+
+ switch (node->type) {
+ case Node_var_new: /* undefined variable */
+ val->val_type = AWK_UNDEFINED;
+ if (wanted == AWK_UNDEFINED) {
+ ret = true;
+ }
+ break;
+
+ case Node_var:
+ /* a scalar value */
+ if (wanted == AWK_SCALAR) {
+ val->val_type = AWK_SCALAR;
+ val->scalar_cookie = (void *) node;
+ ret = true;
+ break;
+ }
+
+ node = node->var_value;
+ /* FALL THROUGH */
+ case Node_val:
+ /* a scalar value */
+ switch (wanted) {
+ case AWK_NUMBER:
+ val->val_type = AWK_NUMBER;
+
+ (void) force_number(node);
+ if (node->flags & NUMCUR) {
+ val->num_value = get_number_d(node);
+ ret = true;
+ }
+ break;
+
+ case AWK_STRING:
+ val->val_type = AWK_STRING;
+
+ (void) force_string(node);
+ if (node->flags & STRCUR) {
+ val->str_value.str = node->stptr;
+ val->str_value.len = node->stlen;
+ ret = true;
+ }
+ break;
+
+ case AWK_SCALAR:
+ if (node->flags & NUMBER) {
+ val->val_type = AWK_NUMBER;
+ } else if (node->flags & STRING) {
+ val->val_type = AWK_STRING;
+ } else
+ val->val_type = AWK_UNDEFINED;
+ ret = false;
+ break;
+
+ case AWK_UNDEFINED:
+ /* return true and actual type for request of undefined */
+ if (node->flags & NUMBER) {
+ val->val_type = AWK_NUMBER;
+ val->num_value = get_number_d(node);
+ ret = true;
+ } else if (node->flags & STRING) {
+ val->val_type = AWK_STRING;
+ val->str_value.str = node->stptr;
+ val->str_value.len = node->stlen;
+ ret = true;
+ } else
+ val->val_type = AWK_UNDEFINED;
+ break;
+
+ case AWK_ARRAY:
+ case AWK_VALUE_COOKIE:
+ break;
+ }
+ break;
+
+ case Node_var_array:
+ val->val_type = AWK_ARRAY;
+ if (wanted == AWK_ARRAY || wanted == AWK_UNDEFINED) {
+ val->array_cookie = node;
+ ret = true;
+ } else {
+ ret = false;
+ }
+ break;
+
+ default:
+ val->val_type = AWK_UNDEFINED;
+ ret = false;
+ break;
+ }
+
+ return ret;
+}
+
+/*
+ * Symbol table access:
+ * - No access to special variables (NF, etc.)
+ * - One special exception: PROCINFO.
+ * - Use sym_update() to change a value, including from UNDEFINED
+ * to scalar or array.
+ */
+/*
+ * Lookup a variable, fills in value. No messing with the value
+ * returned. Returns false if the variable doesn't exist
+ * or the wrong type was requested.
+ * In the latter case, fills in vaule->val_type with the real type.
+ * Built-in variables (except PROCINFO) may not be accessed by an extension.
+ */
+
+/* api_sym_lookup --- look up a symbol */
+
+static awk_bool_t
+api_sym_lookup(awk_ext_id_t id,
+ const char *name,
+ awk_valtype_t wanted,
+ awk_value_t *result)
+{
+ NODE *node;
+
+ if ( name == NULL
+ || *name == '\0'
+ || result == NULL
+ || (node = lookup(name)) == NULL)
+ return false;
+
+ if (is_off_limits_var(name)) /* a built-in variable */
+ node->flags |= NO_EXT_SET;
+
+ return node_to_awk_value(node, result, wanted);
+}
+
+/* api_sym_lookup_scalar --- retrieve the current value of a scalar */
+
+static awk_bool_t
+api_sym_lookup_scalar(awk_ext_id_t id,
+ awk_scalar_t cookie,
+ awk_valtype_t wanted,
+ awk_value_t *result)
+{
+ NODE *node = (NODE *) cookie;
+
+ if (node == NULL
+ || result == NULL
+ || node->type != Node_var)
+ return false;
+
+ return node_to_awk_value(node, result, wanted);
+}
+
+/* api_sym_update_real --- update a symbol's value, see gawkapi.h for semantics */
+
+static awk_bool_t
+sym_update_real(awk_ext_id_t id,
+ const char *name,
+ awk_value_t *value,
+ bool is_const)
+{
+ NODE *node;
+ NODE *array_node;
+
+ if ( name == NULL
+ || *name == '\0'
+ || value == NULL)
+ return false;
+
+ switch (value->val_type) {
+ case AWK_NUMBER:
+ case AWK_STRING:
+ case AWK_UNDEFINED:
+ case AWK_ARRAY:
+ case AWK_SCALAR:
+ case AWK_VALUE_COOKIE:
+ break;
+
+ default:
+ /* fatal(_("api_sym_update: invalid value for type of new value (%d)"), value->val_type); */
+ return false;
+ }
+
+ node = lookup(name);
+
+ if (node == NULL) {
+ /* new value to be installed */
+ if (value->val_type == AWK_ARRAY) {
+ array_node = awk_value_to_node(value);
+ node = install_symbol(estrdup((char *) name, strlen(name)),
+ Node_var_array);
+ array_node->vname = node->vname;
+ *node = *array_node;
+ freenode(array_node);
+ value->array_cookie = node; /* pass new cookie back to extension */
+ } else {
+ /* regular variable */
+ node = install_symbol(estrdup((char *) name, strlen(name)),
+ Node_var);
+ node->var_value = awk_value_to_node(value);
+ if (is_const)
+ node->var_assign = set_constant;
+ }
+
+ return true;
+ }
+
+ /*
+ * If we get here, then it exists already. Any valid type is
+ * OK except for AWK_ARRAY.
+ */
+ if ( (node->flags & NO_EXT_SET) != 0
+ || is_off_limits_var(name)) { /* most built-in vars not allowed */
+ node->flags |= NO_EXT_SET;
+ return false;
+ }
+
+ if ( value->val_type != AWK_ARRAY
+ && (node->type == Node_var || node->type == Node_var_new)) {
+ unref(node->var_value);
+ node->var_value = awk_value_to_node(value);
+ /* let the extension change its own variable */
+ if (is_const)
+ node->var_assign = set_constant;
+
+ return true;
+ }
+
+ return false;
+}
+
+/* api_sym_update --- update a symbol, non-constant */
+
+static awk_bool_t
+api_sym_update(awk_ext_id_t id,
+ const char *name,
+ awk_value_t *value)
+{
+ return sym_update_real(id, name, value, false);
+}
+
+/* api_sym_update --- update a symbol, constant */
+
+static awk_bool_t
+api_sym_constant(awk_ext_id_t id,
+ const char *name,
+ awk_value_t *value)
+{
+ return sym_update_real(id, name, value, true);
+}
+
+/* api_sym_update_scalar --- update a scalar cookie */
+
+static awk_bool_t
+api_sym_update_scalar(awk_ext_id_t id,
+ awk_scalar_t cookie,
+ awk_value_t *value)
+{
+ NODE *node = (NODE *) cookie;
+
+ if (value == NULL
+ || node == NULL
+ || node->type != Node_var
+ || (node->flags & NO_EXT_SET) != 0)
+ return false;
+
+ /*
+ * Optimization: if valref is 1, and the new value is a string or
+ * a number, we can avoid calling unref and then making a new node
+ * by simply installing the new value. First, we follow the same
+ * recipe used by node.c:r_unref to wipe the current values, and then
+ * we copy the logic from r_make_number or make_str_node to install
+ * the new value.
+ */
+ switch (value->val_type) {
+ case AWK_NUMBER:
+ if (node->var_value->valref == 1 && ! do_mpfr) {
+ NODE *r = node->var_value;
+
+ /* r_unref: */
+ if ((r->flags & (MALLOC|STRCUR)) == (MALLOC|STRCUR))
+ efree(r->stptr);
+ free_wstr(r);
+
+ /* r_make_number: */
+ r->numbr = value->num_value;
+ r->flags = MALLOC|NUMBER|NUMCUR;
+ r->stptr = NULL;
+ r->stlen = 0;
+ return true;
+ }
+ break;
+ case AWK_STRING:
+ if (node->var_value->valref == 1) {
+ NODE *r = node->var_value;
+
+ /* r_unref: */
+ if ((r->flags & (MALLOC|STRCUR)) == (MALLOC|STRCUR))
+ efree(r->stptr);
+#ifdef HAVE_MPFR
+ if (is_mpg_float(r))
+ mpfr_clear(r->mpg_numbr);
+ else if (is_mpg_integer(r))
+ mpz_clear(r->mpg_i);
+#endif
+ free_wstr(r);
+
+ /* make_str_node(s, l, ALREADY_MALLOCED): */
+ r->numbr = 0;
+ r->flags = (MALLOC|STRING|STRCUR);
+ r->stfmt = -1;
+ r->stptr = value->str_value.str;
+ r->stlen = value->str_value.len;
+ return true;
+ }
+ break;
+ case AWK_UNDEFINED:
+ case AWK_SCALAR:
+ case AWK_VALUE_COOKIE:
+ break;
+
+ default: /* AWK_ARRAY or invalid type */
+ return false;
+ }
+
+ /* do it the hard (slow) way */
+ unref(node->var_value);
+ node->var_value = awk_value_to_node(value);
+ return true;
+}
+
+/*
+ * valid_subscript_type --- test if a type is allowed for an array subscript.
+ *
+ * Any scalar value is fine, so only AWK_ARRAY (or an invalid type) is illegal.
+ */
+
+static inline int
+valid_subscript_type(awk_valtype_t valtype)
+{
+ switch (valtype) {
+ case AWK_UNDEFINED:
+ case AWK_NUMBER:
+ case AWK_STRING:
+ case AWK_SCALAR:
+ case AWK_VALUE_COOKIE:
+ return true;
+ default: /* AWK_ARRAY or an invalid type */
+ return false;
+ }
+}
+
+/* Array management */
+/*
+ * api_get_array_element --- teturn the value of an element - read only!
+ *
+ * Use set_array_element to change it.
+ */
+
+static awk_bool_t
+api_get_array_element(awk_ext_id_t id,
+ awk_array_t a_cookie,
+ const awk_value_t *const index,
+ awk_valtype_t wanted,
+ awk_value_t *result)
+{
+ NODE *array = (NODE *) a_cookie;
+ NODE *subscript;
+ NODE **aptr;
+
+ /* don't check for index len zero, null str is ok as index */
+ if ( array == NULL
+ || array->type != Node_var_array
+ || result == NULL
+ || index == NULL
+ || ! valid_subscript_type(index->val_type))
+ return false;
+
+ subscript = awk_value_to_node(index);
+
+ /* if it doesn't exist, return false */
+ if (in_array(array, subscript) == NULL) {
+ unref(subscript);
+ return false;
+ }
+
+ aptr = assoc_lookup(array, subscript);
+
+ if (aptr == NULL) { /* can't happen */
+ unref(subscript);
+ return false;
+ }
+
+ unref(subscript);
+
+ return node_to_awk_value(*aptr, result, wanted);
+}
+
+/*
+ * api_set_array_element --- change (or create) element in existing array
+ * with element->index and element->value.
+ */
+
+static awk_bool_t
+api_set_array_element(awk_ext_id_t id, awk_array_t a_cookie,
+ const awk_value_t *const index,
+ const awk_value_t *const value)
+{
+ NODE *array = (NODE *)a_cookie;
+ NODE *tmp;
+ NODE *elem;
+ NODE **aptr;
+
+ /* don't check for index len zero, null str is ok as index */
+ if ( array == NULL
+ || array->type != Node_var_array
+ || (array->flags & NO_EXT_SET) != 0
+ || index == NULL
+ || value == NULL
+ || ! valid_subscript_type(index->val_type))
+ return false;
+
+ tmp = awk_value_to_node(index);
+ aptr = assoc_lookup(array, tmp);
+ unref(tmp);
+ unref(*aptr);
+ elem = *aptr = awk_value_to_node(value);
+ if (elem->type == Node_var_array) {
+ elem->parent_array = array;
+ elem->vname = estrdup(index->str_value.str,
+ index->str_value.len);
+ make_aname(elem);
+ }
+
+ return true;
+}
+
+/*
+ * remove_element --- remove an array element
+ * common code used by multiple functions
+ */
+
+static void
+remove_element(NODE *array, NODE *subscript)
+{
+ NODE *val;
+
+ if (array == NULL)
+ fatal(_("remove_element: received null array"));
+
+ if (subscript == NULL)
+ fatal(_("remove_element: received null subscript"));
+
+ val = in_array(array, subscript);
+
+ if (val == NULL)
+ return;
+
+ if (val->type == Node_var_array) {
+ assoc_clear(val);
+ /* cleared a sub-array, free Node_var_array */
+ efree(val->vname);
+ freenode(val);
+ } else
+ unref(val);
+
+ (void) assoc_remove(array, subscript);
+}
+
+/*
+ * api_del_array_element --- remove the element with the given index.
+ * Return success if removed or if element did not exist.
+ */
+
+static awk_bool_t
+api_del_array_element(awk_ext_id_t id,
+ awk_array_t a_cookie, const awk_value_t* const index)
+{
+ NODE *array, *sub;
+
+ array = (NODE *) a_cookie;
+ if ( array == NULL
+ || array->type != Node_var_array
+ || (array->flags & NO_EXT_SET) != 0
+ || index == NULL
+ || ! valid_subscript_type(index->val_type))
+ return false;
+
+ sub = awk_value_to_node(index);
+ remove_element(array, sub);
+ unref(sub);
+
+ return true;
+}
+
+/*
+ * api_get_element_count --- retrieve total number of elements in array.
+ * Return false if some kind of error.
+ */
+
+static awk_bool_t
+api_get_element_count(awk_ext_id_t id,
+ awk_array_t a_cookie, size_t *count)
+{
+ NODE *node = (NODE *) a_cookie;
+
+ if (count == NULL || node == NULL || node->type != Node_var_array)
+ return false;
+
+ *count = node->table_size;
+ return true;
+}
+
+/* api_create_array --- create a new array cookie to which elements may be added */
+
+static awk_array_t
+api_create_array(awk_ext_id_t id)
+{
+ NODE *n;
+
+ getnode(n);
+ memset(n, 0, sizeof(NODE));
+ init_array(n);
+
+ return (awk_array_t) n;
+}
+
+/* api_clear_array --- clear out an array */
+
+static awk_bool_t
+api_clear_array(awk_ext_id_t id, awk_array_t a_cookie)
+{
+ NODE *node = (NODE *) a_cookie;
+
+ if ( node == NULL
+ || node->type != Node_var_array
+ || (node->flags & NO_EXT_SET) != 0)
+ return false;
+
+ assoc_clear(node);
+ return true;
+}
+
+/* api_flatten_array --- flatten out an array so that it can be looped over easily. */
+
+static awk_bool_t
+api_flatten_array(awk_ext_id_t id,
+ awk_array_t a_cookie,
+ awk_flat_array_t **data)
+{
+ NODE **list;
+ size_t i, j;
+ NODE *array = (NODE *) a_cookie;
+ size_t alloc_size;
+
+ if ( array == NULL
+ || array->type != Node_var_array
+ || array->table_size == 0
+ || data == NULL)
+ return false;
+
+ alloc_size = sizeof(awk_flat_array_t) +
+ (array->table_size - 1) * sizeof(awk_element_t);
+
+ emalloc(*data, awk_flat_array_t *, alloc_size,
+ "api_flatten_array");
+ memset(*data, 0, alloc_size);
+
+ list = assoc_list(array, "@unsorted", ASORTI);
+
+ (*data)->opaque1 = array;
+ (*data)->opaque2 = list;
+ (*data)->count = array->table_size;
+
+ for (i = j = 0; i < 2 * array->table_size; i += 2, j++) {
+ NODE *index, *value;
+
+ index = force_string(list[i]);
+ value = list[i + 1]; /* number or string or subarray */
+
+ /* convert index and value to ext types */
+ if (! node_to_awk_value(index,
+ & (*data)->elements[j].index, AWK_UNDEFINED)) {
+ fatal(_("api_flatten_array: could not convert index %d\n"),
+ (int) i);
+ }
+ if (! node_to_awk_value(value,
+ & (*data)->elements[j].value, AWK_UNDEFINED)) {
+ fatal(_("api_flatten_array: could not convert value %d\n"),
+ (int) i);
+ }
+ }
+ return true;
+}
+
+/*
+ * api_release_flattened_array --- release array memory,
+ * delete any marked elements. Count must match what
+ * gawk thinks the size is.
+ */
+
+static awk_bool_t
+api_release_flattened_array(awk_ext_id_t id,
+ awk_array_t a_cookie,
+ awk_flat_array_t *data)
+{
+ NODE *array = a_cookie;
+ NODE **list;
+ size_t i, j, k;
+
+ if ( array == NULL
+ || array->type != Node_var_array
+ || data == NULL
+ || array != (NODE *) data->opaque1
+ || data->count != array->table_size
+ || data->opaque2 == NULL)
+ return false;
+
+ list = (NODE **) data->opaque2;
+
+ /* free index nodes */
+ for (i = j = 0, k = 2 * array->table_size; i < k; i += 2, j++) {
+ /* Delete items flagged for delete. */
+ if ( (data->elements[j].flags & AWK_ELEMENT_DELETE) != 0
+ && (array->flags & NO_EXT_SET) == 0) {
+ remove_element(array, list[i]);
+ }
+ unref(list[i]);
+ }
+
+ efree(list);
+ efree(data);
+
+ return true;
+}
+
+/* api_create_value --- create a cached value */
+
+static awk_bool_t
+api_create_value(awk_ext_id_t id, awk_value_t *value,
+ awk_value_cookie_t *result)
+{
+ if (value == NULL || result == NULL)
+ return false;
+
+ switch (value->val_type) {
+ case AWK_NUMBER:
+ case AWK_STRING:
+ break;
+ default:
+ /* reject anything other than a simple scalar */
+ return false;
+ }
+
+ return (*result = awk_value_to_node(value)) != NULL;
+}
+
+/* api_release_value --- release a cached value */
+
+static awk_bool_t
+api_release_value(awk_ext_id_t id, awk_value_cookie_t value)
+{
+ NODE *val = (NODE *) value;
+
+ if (val == NULL)
+ return false;
+
+ unref(val);
+ return true;
+}
+
+/*
+ * Register a version string for this extension with gawk.
+ */
+
+struct version_info {
+ const char *version;
+ struct version_info *next;
+};
+
+static struct version_info *vi_head;
+
+/* api_register_ext_version --- add an extension version string to the list */
+
+static void
+api_register_ext_version(awk_ext_id_t id, const char *version)
+{
+ struct version_info *info;
+
+ if (version == NULL)
+ return;
+
+ (void) id;
+
+ emalloc(info, struct version_info *, sizeof(struct version_info), "register_ext_version");
+ info->version = version;
+ info->next = vi_head;
+ vi_head = info;
+}
+
+/* the struct api */
+gawk_api_t api_impl = {
+ /* data */
+ GAWK_API_MAJOR_VERSION, /* major and minor versions */
+ GAWK_API_MINOR_VERSION,
+ { 0 }, /* do_flags */
+
+ /* registration functions */
+ api_add_ext_func,
+ api_register_input_parser,
+ api_register_output_wrapper,
+ api_register_two_way_processor,
+ api_awk_atexit,
+ api_register_ext_version,
+
+ /* message printing functions */
+ api_fatal,
+ api_warning,
+ api_lintwarn,
+
+ /* updating ERRNO */
+ api_update_ERRNO_int,
+ api_update_ERRNO_string,
+ api_unset_ERRNO,
+
+ /* Function arguments */
+ api_get_argument,
+ api_set_argument,
+
+ /* Accessing and installing variables and constants */
+ api_sym_lookup,
+ api_sym_update,
+ api_sym_constant,
+
+ /* Accessing and modifying variables via scalar cookies */
+ api_sym_lookup_scalar,
+ api_sym_update_scalar,
+
+ /* Cached values */
+ api_create_value,
+ api_release_value,
+
+ /* Array management */
+ api_get_element_count,
+ api_get_array_element,
+ api_set_array_element,
+ api_del_array_element,
+ api_create_array,
+ api_clear_array,
+ api_flatten_array,
+ api_release_flattened_array,
+};
+
+/* init_ext_api --- init the extension API */
+
+void
+init_ext_api()
+{
+ /* force values to 1 / 0 */
+ api_impl.do_flags[0] = (do_lint ? 1 : 0);
+ api_impl.do_flags[1] = (do_traditional ? 1 : 0);
+ api_impl.do_flags[2] = (do_profile ? 1 : 0);
+ api_impl.do_flags[3] = (do_sandbox ? 1 : 0);
+ api_impl.do_flags[4] = (do_debug ? 1 : 0);
+ api_impl.do_flags[5] = (do_mpfr ? 1 : 0);
+}
+
+/* update_ext_api --- update the variables in the API that can change */
+
+void
+update_ext_api()
+{
+ api_impl.do_flags[0] = (do_lint ? 1 : 0);
+}
+
+/* set_constant --- prevent awk code from changing a constant */
+
+static void
+set_constant()
+{
+ fatal(_("cannot assign to defined constant"));
+}
+
+/* print_ext_versions --- print the list */
+
+extern void
+print_ext_versions(void)
+{
+ struct version_info *p;
+
+ for (p = vi_head; p != NULL; p = p->next)
+ printf("%s\n", p->version);
+}
diff --git a/gawkapi.h b/gawkapi.h
new file mode 100644
index 00000000..dec87e53
--- /dev/null
+++ b/gawkapi.h
@@ -0,0 +1,898 @@
+/*
+ * gawkapi.h -- Definitions for use by extension functions calling into gawk.
+ */
+
+/*
+ * Copyright (C) 2012, the Free Software Foundation, Inc.
+ *
+ * This file is part of GAWK, the GNU implementation of the
+ * AWK Programming Language.
+ *
+ * GAWK is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GAWK is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * N.B. You must include <sys/types.h> and <sys/stat.h>
+ * before including this file!
+ * You must include <stddef.h> or <stdlib.h> to get size_t's definition.
+ * You should also include <stdio.h> if you intend to use
+ * the dl_load_func() convenience macro.
+ * To pass reasonable integer values for ERRNO, you will need to
+ * include <errno.h>.
+ */
+
+#ifndef _GAWK_API_H
+#define _GAWK_API_H
+
+/*
+ * General introduction:
+ *
+ * This API purposely restricts itself to ISO C 90 features. In particular, no
+ * bool, no // comments, no use of the restrict keyword, or anything else,
+ * in order to provide maximal portability.
+ *
+ * Exception: the "inline" keyword is used below in the "constructor"
+ * functions. If your compiler doesn't support it, you should either
+ * -Dinline='' on your command line, or use the autotools and include a
+ * config.h in your extensions.
+ *
+ * Additional important information:
+ *
+ * 1. ALL string values in awk_value_t objects need to come from malloc().
+ * Gawk will handle releasing the storage if necessary. This is slightly
+ * awkward, in that you can't take an awk_value_t that you got from gawk
+ * and reuse it directly, even for something that is conceptually pass
+ * by value.
+ *
+ * 2. Due to gawk internals, after using sym_update() to install an array
+ * into gawk, you have to retrieve the array cookie from the value
+ * passed in to sym_update(). Like so:
+ *
+ * new_array = create_array();
+ * val.val_type = AWK_ARRAY;
+ * val.array_cookie = new_array;
+ * sym_update("array", & val); // install array in the symbol table
+ *
+ * new_array = val.array_cookie; // MUST DO THIS
+ *
+ * // fill in new array with lots of subscripts and values
+ *
+ * Similarly, if installing a new array as a subarray of an existing
+ * array, you must add the new array to its parent before adding any
+ * elements to it.
+ *
+ * You must also retrieve the value of the array_cookie after the call
+ * to set_element().
+ *
+ * Thus, the correct way to build an array is to work "top down".
+ * Create the array, and immediately install it in gawk's symbol table
+ * using sym_update(), or install it as an element in a previously
+ * existing array using set_element().
+ *
+ * Thus the new array must ultimately be rooted in a global symbol. This is
+ * necessary before installing any subarrays in it, due to gawk's
+ * internal implementation. Strictly speaking, this is required only
+ * for arrays that will have subarrays as elements; however it is
+ * a good idea to always do this. This restriction may be relaxed
+ * in a subsequent revision of the API.
+ */
+
+/* Allow use in C++ code. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* This is used to keep extensions from modifying certain fields in some structs. */
+#ifdef GAWK
+#define awk_const
+#else
+#define awk_const const
+#endif
+
+typedef int awk_bool_t; /* we don't use <stdbool.h> on purpose */
+
+/* The information about input files that input parsers need to know: */
+typedef struct awk_input {
+ const char *name; /* filename */
+ int fd; /* file descriptor */
+#define INVALID_HANDLE (-1)
+ void *opaque; /* private data for input parsers */
+ /*
+ * The get_record function is called to read the next record of data.
+ *
+ * It should return the length of the input record or EOF, and it
+ * should set *out to point to the contents of $0. The rt_start
+ * and rt_len arguments should be used to return RT to gawk.
+ * If EOF is not returned, the parser must set *rt_len (and
+ * *rt_start if *rt_len is non-zero).
+ *
+ * Note that gawk will make a copy of the record in *out, so the
+ * parser is responsible for managing its own memory buffer.
+ * Similarly, gawk will make its own copy of RT, so the parser
+ * is also responsible for managing this memory.
+ *
+ * It is guaranteed that errcode is a valid pointer, so there is
+ * no need to test for a NULL value. Gawk sets *errcode to 0,
+ * so there is no need to set it unless an error occurs.
+ *
+ * If an error does occur, the function should return EOF and set
+ * *errcode to a non-zero value. In that case, if *errcode does not
+ * equal -1, gawk will automatically update the ERRNO variable based
+ * on the value of *errcode (e.g., setting *errcode = errno should do
+ * the right thing).
+ */
+ int (*get_record)(char **out, struct awk_input *iobuf, int *errcode,
+ char **rt_start, size_t *rt_len);
+
+ /*
+ * The close_func is called to allow the parser to free private data.
+ * Gawk itself will close the fd unless close_func first sets it to
+ * INVALID_HANDLE.
+ */
+ void (*close_func)(struct awk_input *iobuf);
+
+ /* put last, for alignment. bleah */
+ struct stat sbuf; /* stat buf */
+
+} awk_input_buf_t;
+
+typedef struct input_parser {
+ const char *name; /* name of parser */
+
+ /*
+ * The can_take_file function should return non-zero if the parser
+ * would like to parse this file. It should not change any gawk
+ * state!
+ */
+ awk_bool_t (*can_take_file)(const awk_input_buf_t *iobuf);
+
+ /*
+ * If this parser is selected, then take_control_of will be called.
+ * It can assume that a previous call to can_take_file was successful,
+ * and no gawk state has changed since that call. It should populate
+ * the awk_input_buf_t's get_record, close_func, and opaque values as needed.
+ * It should return non-zero if successful.
+ */
+ awk_bool_t (*take_control_of)(awk_input_buf_t *iobuf);
+
+ awk_const struct input_parser *awk_const next; /* for use by gawk */
+} awk_input_parser_t;
+
+/*
+ * Similar for output wrapper.
+ */
+
+/* First the data structure */
+typedef struct {
+ const char *name; /* name of output file */
+ const char *mode; /* mode argument to fopen */
+ FILE *fp; /* stdio file pointer */
+ awk_bool_t redirected; /* true if a wrapper is active */
+ void *opaque; /* for use by output wrapper */
+
+ /*
+ * Replacement functions for I/O. Just like the regular
+ * versions but also take the opaque pointer argument.
+ */
+ size_t (*gawk_fwrite)(const void *buf, size_t size, size_t count,
+ FILE *fp, void *opaque);
+ int (*gawk_fflush)(FILE *fp, void *opaque);
+ int (*gawk_ferror)(FILE *fp, void *opaque);
+ int (*gawk_fclose)(FILE *fp, void *opaque);
+} awk_output_buf_t;
+
+/* Next the output wrapper registered with gawk */
+typedef struct output_wrapper {
+ const char *name; /* name of the wrapper */
+
+ /*
+ * The can_take_file function should return non-zero if the wrapper
+ * would like to process this file. It should not change any gawk
+ * state!
+ */
+ awk_bool_t (*can_take_file)(const awk_output_buf_t *outbuf);
+
+ /*
+ * If this wrapper is selected, then take_control_of will be called.
+ * It can assume that a previous call to can_take_file was successful,
+ * and no gawk state has changed since that call. It should populate
+ * the awk_output_buf_t function pointers and opaque pointer as needed.
+ * It should return non-zero if successful.
+ */
+ awk_bool_t (*take_control_of)(awk_output_buf_t *outbuf);
+
+ awk_const struct output_wrapper *awk_const next; /* for use by gawk */
+} awk_output_wrapper_t;
+
+/* A two-way processor combines an input parser and an output wrapper. */
+typedef struct two_way_processor {
+ const char *name; /* name of the two-way processor */
+
+ /*
+ * The can_take_file function should return non-zero if the two-way
+ * processor would like to parse this file. It should not change
+ * any gawk state!
+ */
+ awk_bool_t (*can_take_two_way)(const char *name);
+
+ /*
+ * If this processor is selected, then take_control_of will be called.
+ * It can assume that a previous call to can_take_file was successful,
+ * and no gawk state has changed since that call. It should populate
+ * the awk_input_buf_t and awk_otuput_buf_t structures as needed.
+ * It should return non-zero if successful.
+ */
+ awk_bool_t (*take_control_of)(const char *name, awk_input_buf_t *inbuf,
+ awk_output_buf_t *outbuf);
+
+ awk_const struct two_way_processor *awk_const next; /* for use by gawk */
+} awk_two_way_processor_t;
+
+/* Current version of the API. */
+enum {
+ GAWK_API_MAJOR_VERSION = 0,
+ GAWK_API_MINOR_VERSION = 0
+};
+
+/* A number of typedefs related to different types of values. */
+
+/*
+ * A mutable string. Gawk owns the memory pointed to if it supplied
+ * the value. Otherwise, it takes ownership of the memory pointed to.
+ *
+ * The API deals exclusively with regular chars; these strings may
+ * be multibyte encoded in the current locale's encoding and character
+ * set. Gawk will convert internally to wide characters if necessary.
+ */
+typedef struct {
+ char *str; /* data */
+ size_t len; /* length thereof, in chars */
+} awk_string_t;
+
+/* Arrays are represented as an opaque type. */
+typedef void *awk_array_t;
+
+/* Scalars can be represented as an opaque type. */
+typedef void *awk_scalar_t;
+
+/* Any value can be stored as a cookie. */
+typedef void *awk_value_cookie_t;
+
+/*
+ * This tag defines the type of a value.
+ *
+ * Values are associated with regular variables and with array elements.
+ * Since arrays can be multidimensional (as can regular variables)
+ * it's valid to have a "value" that is actually an array.
+ */
+typedef enum {
+ AWK_UNDEFINED,
+ AWK_NUMBER,
+ AWK_STRING,
+ AWK_ARRAY,
+ AWK_SCALAR, /* opaque access to a variable */
+ AWK_VALUE_COOKIE /* for updating a previously created value */
+} awk_valtype_t;
+
+/*
+ * An awk value. The val_type tag indicates what
+ * is in the union.
+ */
+typedef struct {
+ awk_valtype_t val_type;
+ union {
+ awk_string_t s;
+ double d;
+ awk_array_t a;
+ awk_scalar_t scl;
+ awk_value_cookie_t vc;
+ } u;
+#define str_value u.s
+#define num_value u.d
+#define array_cookie u.a
+#define scalar_cookie u.scl
+#define value_cookie u.vc
+} awk_value_t;
+
+/*
+ * A "flattened" array element. Gawk produces an array of these
+ * inside the awk_flat_array_t.
+ * ALL memory pointed to belongs to gawk. Individual elements may
+ * be marked for deletion. New elements must be added individually,
+ * one at a time, using the separate API for that purpose.
+ */
+
+typedef struct awk_element {
+ /* convenience linked list pointer, not used by gawk */
+ struct awk_element *next;
+ enum {
+ AWK_ELEMENT_DEFAULT = 0, /* set by gawk */
+ AWK_ELEMENT_DELETE = 1 /* set by extension if
+ should be deleted */
+ } flags;
+ awk_value_t index;
+ awk_value_t value;
+} awk_element_t;
+
+/*
+ * A "flattened" array. See the description above for how
+ * to use the elements contained herein.
+ */
+typedef struct awk_flat_array {
+ awk_const void *awk_const opaque1; /* private data for use by gawk */
+ awk_const void *awk_const opaque2; /* private data for use by gawk */
+ awk_const size_t count; /* how many elements */
+ awk_element_t elements[1]; /* will be extended */
+} awk_flat_array_t;
+
+/*
+ * A record describing an extension function. Upon being
+ * loaded, the extension should pass in one of these to gawk for
+ * each C function.
+ *
+ * Each called function must fill in the result with either a number
+ * or string. Gawk takes ownership of any string memory.
+ *
+ * The called function must return the value of `result'.
+ * This is for the convenience of the calling code inside gawk.
+ *
+ * Each extension function may decide what to do if the number of
+ * arguments isn't what it expected. Following awk functions, it
+ * is likely OK to ignore extra arguments.
+ */
+typedef struct {
+ const char *name;
+ awk_value_t *(*function)(int num_actual_args, awk_value_t *result);
+ size_t num_expected_args;
+} awk_ext_func_t;
+
+typedef void *awk_ext_id_t; /* opaque type for extension id */
+
+/*
+ * The API into gawk. Lots of functions here. We hope that they are
+ * logically organized.
+ */
+typedef struct gawk_api {
+ /* First, data fields. */
+
+ /* These are what gawk thinks the API version is. */
+ awk_const int major_version;
+ awk_const int minor_version;
+
+ /*
+ * These can change on the fly as things happen within gawk.
+ * Currently only do_lint is prone to change, but we reserve
+ * the right to allow the others to do so also.
+ */
+#define DO_FLAGS_SIZE 6
+ awk_const int do_flags[DO_FLAGS_SIZE];
+/* Use these as indices into do_flags[] array to check the values */
+#define gawk_do_lint 0
+#define gawk_do_traditional 1
+#define gawk_do_profile 2
+#define gawk_do_sandbox 3
+#define gawk_do_debug 4
+#define gawk_do_mpfr 5
+
+ /* Next, registration functions: */
+
+ /* Add a function to the interpreter, returns true upon success */
+ awk_bool_t (*api_add_ext_func)(awk_ext_id_t id, const char *namespace,
+ const awk_ext_func_t *func);
+
+ /* Register an input parser; for opening files read-only */
+ void (*api_register_input_parser)(awk_ext_id_t id,
+ awk_input_parser_t *input_parser);
+
+ /* Register an output wrapper, for writing files */
+ void (*api_register_output_wrapper)(awk_ext_id_t id,
+ awk_output_wrapper_t *output_wrapper);
+
+ /* Register a processor for two way I/O */
+ void (*api_register_two_way_processor)(awk_ext_id_t id,
+ awk_two_way_processor_t *two_way_processor);
+
+ /*
+ * Add an exit call back.
+ *
+ * arg0 is a private data pointer for use by the extension;
+ * gawk saves it and passes it into the function pointed
+ * to by funcp at exit.
+ *
+ * Exit callback functions are called in LIFO order.
+ */
+ void (*api_awk_atexit)(awk_ext_id_t id,
+ void (*funcp)(void *data, int exit_status),
+ void *arg0);
+
+ /* Register a version string for this extension with gawk. */
+ void (*api_register_ext_version)(awk_ext_id_t id, const char *version);
+
+ /* Functions to print messages */
+ void (*api_fatal)(awk_ext_id_t id, const char *format, ...);
+ void (*api_warning)(awk_ext_id_t id, const char *format, ...);
+ void (*api_lintwarn)(awk_ext_id_t id, const char *format, ...);
+
+ /* Functions to update ERRNO */
+ void (*api_update_ERRNO_int)(awk_ext_id_t id, int errno_val);
+ void (*api_update_ERRNO_string)(awk_ext_id_t id, const char *string);
+ void (*api_unset_ERRNO)(awk_ext_id_t id);
+
+ /*
+ * All of the functions that return a value from inside gawk
+ * (get a parameter, get a global variable, get an array element)
+ * behave in the same way.
+ *
+ * For a function parameter, the return is false if the argument
+ * count is out of range, or if actual paramater does not match
+ * what is specified in wanted. In that case, result->val_type
+ * will hold the actual type of what was passed.
+ *
+ * Similarly for symbol table access to variables and array elements,
+ * the return is false if the actual variable or array element does
+ * not match what was requested, and the result->val_type will hold
+ * the actual type.
+
+ Table entry is type returned:
+
+
+ +-------------------------------------------------+
+ | Type of Actual Value: |
+ +------------+------------+-----------+-----------+
+ | String | Number | Array | Undefined |
+ +-----------+-----------+------------+------------+-----------+-----------+
+ | | String | String | String | false | false |
+ | |-----------+------------+------------+-----------+-----------+
+ | | Number | Number if | Number | false | false |
+ | | | can be | | | |
+ | | | converted, | | | |
+ | | | else false | | | |
+ | |-----------+------------+------------+-----------+-----------+
+ | Type | Array | false | false | Array | false |
+ | Requested |-----------+------------+------------+-----------+-----------+
+ | | Scalar | Scalar | Scalar | false | false |
+ | |-----------+------------+------------+-----------+-----------+
+ | | Undefined | String | Number | Array | Undefined |
+ | |-----------+------------+------------+-----------+-----------+
+ | | Value | false | false | false | false |
+ | | Cookie | | | | |
+ +-----------+-----------+------------+------------+-----------+-----------+
+ */
+
+ /* Functions to handle parameters passed to the extension. */
+
+ /*
+ * Get the count'th paramater, zero-based.
+ * Returns false if count is out of range, or if actual paramater
+ * does not match what is specified in wanted. In that case,
+ * result->val_type is as described above.
+ */
+ awk_bool_t (*api_get_argument)(awk_ext_id_t id, size_t count,
+ awk_valtype_t wanted,
+ awk_value_t *result);
+
+ /*
+ * Convert a paramter that was undefined into an array
+ * (provide call-by-reference for arrays). Returns false
+ * if count is too big, or if the argument's type is
+ * not undefined.
+ */
+ awk_bool_t (*api_set_argument)(awk_ext_id_t id,
+ size_t count,
+ awk_array_t array);
+
+ /*
+ * Symbol table access:
+ * - Read-only access to special variables (NF, etc.)
+ * - One special exception: PROCINFO.
+ * - Use sym_update() to change a value, including from UNDEFINED
+ * to scalar or array.
+ */
+ /*
+ * Lookup a variable, fill in value. No messing with the value
+ * returned.
+ * Returns false if the variable doesn't exist* or if the wrong type
+ * was requested. In the latter case, vaule->val_type will have
+ * the real type, as described above.
+ *
+ * awk_value_t val;
+ * if (! api->sym_lookup(id, name, wanted, & val))
+ * error_code_here();
+ * else {
+ * // safe to use val
+ * }
+ */
+ awk_bool_t (*api_sym_lookup)(awk_ext_id_t id,
+ const char *name,
+ awk_valtype_t wanted,
+ awk_value_t *result);
+
+ /*
+ * Update a value. Adds it to the symbol table if not there.
+ * Changing types (scalar <--> array) is not allowed.
+ * In fact, using this to update an array is not allowed, either.
+ * Such an attempt returns false.
+ */
+ awk_bool_t (*api_sym_update)(awk_ext_id_t id,
+ const char *name,
+ awk_value_t *value);
+
+ /* Install a constant value. Intended to be used only with scalars. */
+ awk_bool_t (*api_sym_constant)(awk_ext_id_t id,
+ const char *name,
+ awk_value_t *value);
+
+ /*
+ * A ``scalar cookie'' is an opaque handle that provide access
+ * to a global variable or array. It is an optimization that
+ * avoids looking up variables in gawk's symbol table every time
+ * access is needed.
+ *
+ * This function retrieves the current value of a scalar cookie.
+ * Once you have obtained a scalar_cookie using sym_lookup, you can
+ * use this function to get its value more efficiently.
+ *
+ * Return will be false if the value cannot be retrieved.
+ *
+ * Flow is thus
+ * awk_value_t val;
+ * awk_scalar_t cookie;
+ * api->sym_lookup(id, "variable", AWK_SCALAR, & val); // get the cookie
+ * cookie = val.scalar_cookie;
+ * ...
+ * api->sym_lookup_scalar(id, cookie, wanted, & val); // get the value
+ */
+ awk_bool_t (*api_sym_lookup_scalar)(awk_ext_id_t id,
+ awk_scalar_t cookie,
+ awk_valtype_t wanted,
+ awk_value_t *result);
+
+ /*
+ * Update the value associated with a scalar cookie.
+ * Flow is
+ * sym_lookup with wanted == AWK_SCALAR
+ * if returns false
+ * sym_update with real initial value to install it
+ * sym_lookup again with AWK_SCALAR
+ * else
+ * use the scalar cookie
+ *
+ * Return will be false if the new value is not one of
+ * AWK_STRING or AWK_NUMBER.
+ *
+ * Here too, the built-in variables may not be updated.
+ */
+ awk_bool_t (*api_sym_update_scalar)(awk_ext_id_t id,
+ awk_scalar_t cookie, awk_value_t *value);
+
+ /* Cached values */
+
+ /*
+ * Create a cached string or numeric value for efficient later
+ * assignment. This improves performance when you want to assign
+ * the same value to one or more variables repeatedly. Only
+ * AWK_NUMBER and AWK_STRING values are allowed. Any other type
+ * is rejected. We disallow AWK_UNDEFINED since that case would
+ * result in inferior performance.
+ */
+ awk_bool_t (*api_create_value)(awk_ext_id_t id, awk_value_t *value,
+ awk_value_cookie_t *result);
+
+ /*
+ * Release the memory associated with a cookie from api_create_value.
+ * Please call this to free memory when the value is no longer needed.
+ */
+ awk_bool_t (*api_release_value)(awk_ext_id_t id, awk_value_cookie_t vc);
+
+ /* Array management */
+
+ /*
+ * Retrieve total number of elements in array.
+ * Returns false if some kind of error.
+ */
+ awk_bool_t (*api_get_element_count)(awk_ext_id_t id,
+ awk_array_t a_cookie, size_t *count);
+
+ /*
+ * Return the value of an element - read only!
+ * Use set_array_element() to change it.
+ * Behavior for value and return is same as for api_get_argument
+ * and sym_lookup.
+ */
+ awk_bool_t (*api_get_array_element)(awk_ext_id_t id,
+ awk_array_t a_cookie,
+ const awk_value_t *const index,
+ awk_valtype_t wanted,
+ awk_value_t *result);
+
+ /*
+ * Change (or create) element in existing array with
+ * index and value.
+ *
+ * ARGV and ENVIRON may not be updated.
+ */
+ awk_bool_t (*api_set_array_element)(awk_ext_id_t id, awk_array_t a_cookie,
+ const awk_value_t *const index,
+ const awk_value_t *const value);
+
+ /*
+ * Remove the element with the given index.
+ * Returns success if removed or false if element did not exist.
+ */
+ awk_bool_t (*api_del_array_element)(awk_ext_id_t id,
+ awk_array_t a_cookie, const awk_value_t* const index);
+
+ /* Create a new array cookie to which elements may be added */
+ awk_array_t (*api_create_array)(awk_ext_id_t id);
+
+ /* Clear out an array */
+ awk_bool_t (*api_clear_array)(awk_ext_id_t id, awk_array_t a_cookie);
+
+ /* Flatten out an array so that it can be looped over easily. */
+ awk_bool_t (*api_flatten_array)(awk_ext_id_t id,
+ awk_array_t a_cookie,
+ awk_flat_array_t **data);
+
+ /* When done, delete any marked elements, release the memory. */
+ awk_bool_t (*api_release_flattened_array)(awk_ext_id_t id,
+ awk_array_t a_cookie,
+ awk_flat_array_t *data);
+} gawk_api_t;
+
+#ifndef GAWK /* these are not for the gawk code itself! */
+/*
+ * Use these if you want to define "global" variables named api
+ * and ext_id to make the code a little easier to read.
+ * See the sample boilerplate code, below.
+ */
+#define do_lint (api->do_flags[gawk_do_lint])
+#define do_traditional (api->do_flags[gawk_do_traditional])
+#define do_profile (api->do_flags[gawk_do_profile])
+#define do_sandbox (api->do_flags[gawk_do_sandbox])
+#define do_debug (api->do_flags[gawk_do_debug])
+#define do_mpfr (api->do_flags[gawk_do_mpfr])
+
+#define get_argument(count, wanted, result) \
+ (api->api_get_argument(ext_id, count, wanted, result))
+#define set_argument(count, new_array) \
+ (api->api_set_argument(ext_id, count, new_array))
+
+#define fatal api->api_fatal
+#define warning api->api_warning
+#define lintwarn api->api_lintwarn
+
+#define register_input_parser(parser) (api->api_register_input_parser(ext_id, parser))
+#define register_output_wrapper(wrapper) (api->api_register_output_wrapper(ext_id, wrapper))
+#define register_two_way_processor(processor) \
+ (api->api_register_two_way_processor(ext_id, processor))
+
+#define update_ERRNO_int(e) (api->api_update_ERRNO_int(ext_id, e))
+#define update_ERRNO_string(str) \
+ (api->api_update_ERRNO_string(ext_id, str))
+#define unset_ERRNO() (api->api_unset_ERRNO(ext_id))
+
+#define add_ext_func(ns, func) (api->api_add_ext_func(ext_id, ns, func))
+#define awk_atexit(funcp, arg0) (api->api_awk_atexit(ext_id, funcp, arg0))
+
+#define sym_lookup(name, wanted, result) \
+ (api->api_sym_lookup(ext_id, name, wanted, result))
+#define sym_lookup_scalar(scalar_cookie, wanted, result) \
+ (api->api_sym_lookup_scalar(ext_id, scalar_cookie, wanted, result))
+#define sym_update(name, value) \
+ (api->api_sym_update(ext_id, name, value))
+#define sym_constant(name, value) \
+ (api->api_sym_constant(ext_id, name, value))
+#define sym_update_scalar(scalar_cookie, value) \
+ (api->api_sym_update_scalar)(ext_id, scalar_cookie, value)
+
+#define get_array_element(array, index, wanted, result) \
+ (api->api_get_array_element(ext_id, array, index, wanted, result))
+
+#define set_array_element(array, index, value) \
+ (api->api_set_array_element(ext_id, array, index, value))
+
+#define set_array_element_by_elem(array, elem) \
+ (api->api_set_array_element(ext_id, array, & (elem)->index, & (elem)->value))
+
+#define del_array_element(array, index) \
+ (api->api_del_array_element(ext_id, array, index))
+
+#define get_element_count(array, count_p) \
+ (api->api_get_element_count(ext_id, array, count_p))
+
+#define create_array() (api->api_create_array(ext_id))
+
+#define clear_array(array) (api->api_clear_array(ext_id, array))
+
+#define flatten_array(array, data) \
+ (api->api_flatten_array(ext_id, array, data))
+
+#define release_flattened_array(array, data) \
+ (api->api_release_flattened_array(ext_id, array, data))
+
+#define create_value(value, result) \
+ (api->api_create_value(ext_id, value,result))
+
+#define release_value(value) \
+ (api->api_release_value(ext_id, value))
+
+#define register_ext_version(version) \
+ (api->api_register_ext_version(ext_id, version))
+
+#define emalloc(pointer, type, size, message) \
+ do { \
+ if ((pointer = (type) malloc(size)) == 0) \
+ fatal(ext_id, "%s: malloc of %d bytes failed\n", message, size); \
+ } while(0)
+
+#define erealloc(pointer, type, size, message) \
+ do { \
+ if ((pointer = (type) realloc(pointer, size)) == 0) \
+ fatal(ext_id, "%s: realloc of %d bytes failed\n", message, size); \
+ } while(0)
+
+/* Constructor functions */
+
+/* r_make_string --- make a string value in result from the passed-in string */
+
+static inline awk_value_t *
+r_make_string(const gawk_api_t *api, /* needed for emalloc */
+ awk_ext_id_t *ext_id, /* ditto */
+ const char *string,
+ size_t length,
+ awk_bool_t duplicate,
+ awk_value_t *result)
+{
+ char *cp = NULL;
+
+ memset(result, 0, sizeof(*result));
+
+ result->val_type = AWK_STRING;
+ result->str_value.len = length;
+
+ if (duplicate) {
+ emalloc(cp, char *, length + 2, "r_make_string");
+ memcpy(cp, string, length);
+ cp[length] = '\0';
+ result->str_value.str = cp;
+ } else {
+ result->str_value.str = (char *) string;
+ }
+
+ return result;
+}
+
+#define make_const_string(str, len, result) r_make_string(api, ext_id, str, len, 1, result)
+#define make_malloced_string(str, len, result) r_make_string(api, ext_id, str, len, 0, result)
+
+/* make_null_string --- make a null string value */
+
+static inline awk_value_t *
+make_null_string(awk_value_t *result)
+{
+ memset(result, 0, sizeof(*result));
+ result->val_type = AWK_UNDEFINED;
+
+ return result;
+}
+
+/* make_number --- make a number value in result */
+
+static inline awk_value_t *
+make_number(double num, awk_value_t *result)
+{
+ memset(result, 0, sizeof(*result));
+
+ result->val_type = AWK_NUMBER;
+ result->num_value = num;
+
+ return result;
+}
+
+/*
+ * Each extension must define a function with this prototype:
+ *
+ * int dl_load(gawk_api_t *api_p, awk_ext_id_t id)
+ *
+ * The return value should be zero on failure and non-zero on success.
+ *
+ * For the macros to work, the function should save api_p in a global
+ * variable named 'api' and save id in a global variable named 'ext_id'.
+ * In addition, a global function pointer named 'init_func' should be
+ * defined and set to either NULL or an initialization function that
+ * returns non-zero on success and zero upon failure.
+ */
+
+extern int dl_load(const gawk_api_t *const api_p, awk_ext_id_t id);
+
+#if 0
+/* Boiler plate code: */
+int plugin_is_GPL_compatible;
+
+static gawk_api_t *const api;
+static awk_ext_id_t ext_id;
+static const char *ext_version = NULL; /* or ... = "some string" */
+
+static awk_ext_func_t func_table[] = {
+ { "name", do_name, 1 },
+ /* ... */
+};
+
+/* EITHER: */
+
+static awk_bool_t (*init_func)(void) = NULL;
+
+/* OR: */
+
+static awk_bool_t
+init_my_module(void)
+{
+ ...
+}
+
+static awk_bool_t (*init_func)(void) = init_my_module;
+
+dl_load_func(func_table, some_name, "name_space_in_quotes")
+#endif
+
+#define dl_load_func(func_table, module, name_space) \
+int dl_load(const gawk_api_t *const api_p, awk_ext_id_t id) \
+{ \
+ size_t i, j; \
+ int errors = 0; \
+\
+ api = api_p; \
+ ext_id = id; \
+\
+ if (api->major_version != GAWK_API_MAJOR_VERSION \
+ || api->minor_version < GAWK_API_MINOR_VERSION) { \
+ fprintf(stderr, #module ": version mismatch with gawk!\n"); \
+ fprintf(stderr, "\tmy version (%d, %d), gawk version (%d, %d)\n", \
+ GAWK_API_MAJOR_VERSION, GAWK_API_MINOR_VERSION, \
+ api->major_version, api->minor_version); \
+ exit(1); \
+ } \
+\
+ /* load functions */ \
+ for (i = 0, j = sizeof(func_table) / sizeof(func_table[0]); i < j; i++) { \
+ if (func_table[i].name == NULL) \
+ break; \
+ if (! add_ext_func(name_space, & func_table[i])) { \
+ warning(ext_id, #module ": could not add %s\n", \
+ func_table[i].name); \
+ errors++; \
+ } \
+ } \
+\
+ if (init_func != NULL) { \
+ if (! init_func()) { \
+ warning(ext_id, #module ": initialization function failed\n"); \
+ errors++; \
+ } \
+ } \
+\
+ if (ext_version != NULL) \
+ register_ext_version(ext_version); \
+\
+ return (errors == 0); \
+}
+
+#endif /* GAWK */
+
+#ifdef __cplusplus
+}
+#endif /* C++ */
+
+#endif /* _GAWK_API_H */
diff --git a/int_array.c b/int_array.c
new file mode 100644
index 00000000..a2c9e41e
--- /dev/null
+++ b/int_array.c
@@ -0,0 +1,800 @@
+/*
+ * int_array.c - routines for arrays of integer indices.
+ */
+
+/*
+ * Copyright (C) 1986, 1988, 1989, 1991-2011 the Free Software Foundation, Inc.
+ *
+ * This file is part of GAWK, the GNU implementation of the
+ * AWK Programming Language.
+ *
+ * GAWK is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GAWK is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "awk.h"
+
+extern FILE *output_fp;
+extern void indent(int indent_level);
+extern NODE **is_integer(NODE *symbol, NODE *subs);
+
+static size_t INT_CHAIN_MAX = 2;
+
+static NODE **int_array_init(NODE *symbol, NODE *subs);
+static NODE **int_lookup(NODE *symbol, NODE *subs);
+static NODE **int_exists(NODE *symbol, NODE *subs);
+static NODE **int_clear(NODE *symbol, NODE *subs);
+static NODE **int_remove(NODE *symbol, NODE *subs);
+static NODE **int_list(NODE *symbol, NODE *t);
+static NODE **int_copy(NODE *symbol, NODE *newsymb);
+static NODE **int_dump(NODE *symbol, NODE *ndump);
+
+static uint32_t int_hash(uint32_t k, uint32_t hsize);
+static inline NODE **int_find(NODE *symbol, long k, uint32_t hash1);
+static NODE **int_insert(NODE *symbol, long k, uint32_t hash1);
+static void grow_int_table(NODE *symbol);
+
+array_ptr int_array_func[] = {
+ int_array_init,
+ is_integer,
+ int_lookup,
+ int_exists,
+ int_clear,
+ int_remove,
+ int_list,
+ int_copy,
+ int_dump,
+};
+
+
+/* int_array_init --- check relevant environment variables */
+
+static NODE **
+int_array_init(NODE *symbol ATTRIBUTE_UNUSED, NODE *subs ATTRIBUTE_UNUSED)
+{
+ long newval;
+
+ if ((newval = getenv_long("INT_CHAIN_MAX")) > 0)
+ INT_CHAIN_MAX = newval;
+ return (NODE **) ! NULL;
+}
+
+
+/* is_integer --- check if subscript is an integer */
+
+NODE **
+is_integer(NODE *symbol, NODE *subs)
+{
+ long l;
+ AWKNUM d;
+
+ if (subs == Nnull_string || do_mpfr)
+ return NULL;
+
+ if ((subs->flags & NUMINT) != 0)
+ return (NODE **) ! NULL;
+
+ if ((subs->flags & NUMBER) != 0) {
+ d = subs->numbr;
+ if (d <= INT32_MAX && d >= INT32_MIN && d == (int32_t) d) {
+ subs->flags |= NUMINT;
+ return (NODE **) ! NULL;
+ }
+ return NULL;
+ }
+
+ /* a[3]=1; print "3" in a -- true
+ * a[3]=1; print "+3" in a -- false
+ * a[3]=1; print "03" in a -- false
+ * a[-3]=1; print "-3" in a -- true
+ */
+
+ if ((subs->flags & (STRING|STRCUR)) != 0) {
+ char *cp = subs->stptr, *cpend, *ptr;
+ char save;
+ size_t len = subs->stlen;
+
+ if (len == 0 || (! isdigit((unsigned char) *cp) && *cp != '-'))
+ return NULL;
+ if (len > 1 &&
+ ((*cp == '0') /* "00", "011" .. */
+ || (*cp == '-' && *(cp + 1) == '0') /* "-0", "-011" .. */
+ )
+ )
+ return NULL;
+ if (len == 1 && *cp != '-') { /* single digit */
+ subs->numbr = (long) (*cp - '0');
+ if ((subs->flags & MAYBE_NUM) != 0) {
+ subs->flags &= ~MAYBE_NUM;
+ subs->flags |= NUMBER;
+ }
+ subs->flags |= (NUMCUR|NUMINT);
+ return (NODE **) ! NULL;
+ }
+
+ cpend = cp + len;
+ save = *cpend;
+ *cpend = '\0';
+
+ errno = 0;
+ l = strtol(cp, & ptr, 10);
+ *cpend = save;
+ if (errno != 0 || ptr != cpend)
+ return NULL;
+ subs->numbr = l;
+ if ((subs->flags & MAYBE_NUM) != 0) {
+ subs->flags &= ~MAYBE_NUM;
+ subs->flags |= NUMBER;
+ }
+ subs->flags |= NUMCUR;
+ if (l <= INT32_MAX && l >= INT32_MIN) {
+ subs->flags |= NUMINT;
+ return (NODE **) ! NULL;
+ }
+ }
+ return NULL;
+}
+
+
+/* int_lookup --- Find SYMBOL[SUBS] in the assoc array. Install it with value ""
+ * if it isn't there. Returns a pointer ala get_lhs to where its value is stored.
+ */
+
+static NODE **
+int_lookup(NODE *symbol, NODE *subs)
+{
+ uint32_t hash1;
+ long k;
+ unsigned long size;
+ NODE **lhs;
+ NODE *xn;
+
+ /* N.B: symbol->table_size is the total # of non-integers (symbol->xarray)
+ * and integer elements. Also, symbol->xarray must have at least one
+ * item in it, and can not exist if there are no integer elements.
+ * In that case, symbol->xarray is promoted to 'symbol' (See int_remove).
+ */
+
+
+ if (! is_integer(symbol, subs)) {
+ xn = symbol->xarray;
+ if (xn == NULL) {
+ xn = symbol->xarray = make_array();
+ xn->vname = symbol->vname; /* shallow copy */
+ xn->flags |= XARRAY;
+ } else if ((lhs = xn->aexists(xn, subs)) != NULL)
+ return lhs;
+ symbol->table_size++;
+ return assoc_lookup(xn, subs);
+ }
+
+ k = subs->numbr;
+ if (symbol->buckets == NULL)
+ grow_int_table(symbol);
+
+ hash1 = int_hash(k, symbol->array_size);
+ if ((lhs = int_find(symbol, k, hash1)) != NULL)
+ return lhs;
+
+ /* It's not there, install it */
+
+ symbol->table_size++;
+
+ /* first see if we would need to grow the array, before installing */
+ size = symbol->table_size;
+ if ((xn = symbol->xarray) != NULL)
+ size -= xn->table_size;
+
+ if ((symbol->flags & ARRAYMAXED) == 0
+ && (size / symbol->array_size) > INT_CHAIN_MAX) {
+ grow_int_table(symbol);
+ /* have to recompute hash value for new size */
+ hash1 = int_hash(k, symbol->array_size);
+ }
+
+ return int_insert(symbol, k, hash1);
+}
+
+
+/* int_exists --- test whether the array element symbol[subs] exists or not,
+ * return pointer to value if it does.
+ */
+
+static NODE **
+int_exists(NODE *symbol, NODE *subs)
+{
+ long k;
+ uint32_t hash1;
+
+ if (! is_integer(symbol, subs)) {
+ NODE *xn = symbol->xarray;
+ if (xn == NULL)
+ return NULL;
+ return xn->aexists(xn, subs);
+ }
+ if (symbol->buckets == NULL)
+ return NULL;
+
+ k = subs->numbr;
+ hash1 = int_hash(k, symbol->array_size);
+ return int_find(symbol, k, hash1);
+}
+
+/* int_clear --- flush all the values in symbol[] */
+
+static NODE **
+int_clear(NODE *symbol, NODE *subs ATTRIBUTE_UNUSED)
+{
+ unsigned long i;
+ int j;
+ BUCKET *b, *next;
+ NODE *r;
+
+ if (symbol->xarray != NULL) {
+ NODE *xn = symbol->xarray;
+ assoc_clear(xn);
+ freenode(xn);
+ symbol->xarray = NULL;
+ }
+
+ for (i = 0; i < symbol->array_size; i++) {
+ for (b = symbol->buckets[i]; b != NULL; b = next) {
+ next = b->ainext;
+ for (j = 0; j < b->aicount; j++) {
+ r = b->aivalue[j];
+ if (r->type == Node_var_array) {
+ assoc_clear(r); /* recursively clear all sub-arrays */
+ efree(r->vname);
+ freenode(r);
+ } else
+ unref(r);
+ }
+ freebucket(b);
+ }
+ symbol->buckets[i] = NULL;
+ }
+ if (symbol->buckets != NULL)
+ efree(symbol->buckets);
+ init_array(symbol); /* re-initialize symbol */
+ symbol->flags &= ~ARRAYMAXED;
+ return NULL;
+}
+
+
+/* int_remove --- If SUBS is already in the table, remove it. */
+
+static NODE **
+int_remove(NODE *symbol, NODE *subs)
+{
+ uint32_t hash1;
+ BUCKET *b, *prev = NULL;
+ long k;
+ int i;
+ NODE *xn = symbol->xarray;
+
+ if (symbol->table_size == 0 || symbol->buckets == NULL)
+ return NULL;
+
+ if (! is_integer(symbol, subs)) {
+ if (xn == NULL || xn->aremove(xn, subs) == NULL)
+ return NULL;
+ if (xn->table_size == 0) {
+ freenode(xn);
+ symbol->xarray = NULL;
+ }
+ symbol->table_size--;
+ assert(symbol->table_size > 0);
+ return (NODE **) ! NULL;
+ }
+
+ k = subs->numbr;
+ hash1 = int_hash(k, symbol->array_size);
+
+ for (b = symbol->buckets[hash1]; b != NULL; prev = b, b = b->ainext) {
+ for (i = 0; i < b->aicount; i++) {
+ if (k != b->ainum[i])
+ continue;
+
+ /* item found */
+ if (i == 0 && b->aicount == 2) {
+ /* removing the 1st item; move 2nd item from position 1 to 0 */
+
+ b->ainum[0] = b->ainum[1];
+ b->aivalue[0] = b->aivalue[1];
+ } /* else
+ removing the only item or the 2nd item */
+
+ goto removed;
+ }
+ }
+
+ if (b == NULL) /* item not in array */
+ return NULL;
+
+removed:
+ b->aicount--;
+
+ if (b->aicount == 0) {
+ /* detach bucket */
+ if (prev != NULL)
+ prev->ainext = b->ainext;
+ else
+ symbol->buckets[hash1] = b->ainext;
+
+ /* delete bucket */
+ freebucket(b);
+ } else if (b != symbol->buckets[hash1]) {
+ BUCKET *head = symbol->buckets[hash1];
+
+ assert(b->aicount == 1);
+ /* move the last element from head
+ * to bucket to make it full.
+ */
+ i = --head->aicount; /* head has one less element */
+ b->ainum[1] = head->ainum[i];
+ b->aivalue[1] = head->aivalue[i];
+ b->aicount++; /* bucket has one more element */
+ if (i == 0) {
+ /* head is now empty; delete head */
+ symbol->buckets[hash1] = head->ainext;
+ freebucket(head);
+ }
+ } /* else
+ do nothing */
+
+ symbol->table_size--;
+ if (xn == NULL && symbol->table_size == 0) {
+ efree(symbol->buckets);
+ init_array(symbol); /* re-initialize array 'symbol' */
+ symbol->flags &= ~ARRAYMAXED;
+ } else if (xn != NULL && symbol->table_size == xn->table_size) {
+ /* promote xn (str_array) to symbol */
+ xn->flags &= ~XARRAY;
+ xn->parent_array = symbol->parent_array;
+ efree(symbol->buckets);
+ *symbol = *xn;
+ freenode(xn);
+ }
+
+ return (NODE **) ! NULL; /* return success */
+}
+
+
+/* int_copy --- duplicate input array "symbol" */
+
+static NODE **
+int_copy(NODE *symbol, NODE *newsymb)
+{
+ BUCKET **old, **new, **pnew;
+ BUCKET *chain, *newchain;
+ int j;
+ unsigned long i, cursize;
+
+ assert(symbol->buckets != NULL);
+
+ /* find the current hash size */
+ cursize = symbol->array_size;
+
+ /* allocate new table */
+ emalloc(new, BUCKET **, cursize * sizeof(BUCKET *), "int_copy");
+ memset(new, '\0', cursize * sizeof(BUCKET *));
+
+ old = symbol->buckets;
+
+ for (i = 0; i < cursize; i++) {
+ for (chain = old[i], pnew = & new[i]; chain != NULL;
+ chain = chain->ainext
+ ) {
+ getbucket(newchain);
+ newchain->aicount = chain->aicount;
+ newchain->ainext = NULL;
+ for (j = 0; j < chain->aicount; j++) {
+ NODE *oldval;
+
+ /*
+ * copy the corresponding key and
+ * value from the original input list
+ */
+ newchain->ainum[j] = chain->ainum[j];
+
+ oldval = chain->aivalue[j];
+ if (oldval->type == Node_val)
+ newchain->aivalue[j] = dupnode(oldval);
+ else {
+ NODE *r;
+ r = make_array();
+ r->vname = estrdup(oldval->vname, strlen(oldval->vname));
+ r->parent_array = newsymb;
+ newchain->aivalue[j] = assoc_copy(oldval, r);
+ }
+ }
+
+ *pnew = newchain;
+ pnew = & newchain->ainext;
+ }
+ }
+
+ if (symbol->xarray != NULL) {
+ NODE *xn, *n;
+ xn = symbol->xarray;
+ n = make_array();
+ n->vname = newsymb->vname; /* shallow copy */
+ (void) xn->acopy(xn, n);
+ newsymb->xarray = n;
+ } else
+ newsymb->xarray = NULL;
+
+ newsymb->table_size = symbol->table_size;
+ newsymb->buckets = new;
+ newsymb->array_size = cursize;
+ newsymb->flags = symbol->flags;
+
+ return NULL;
+}
+
+
+/* int_list --- return a list of array items */
+
+static NODE**
+int_list(NODE *symbol, NODE *t)
+{
+ NODE **list = NULL;
+ unsigned long num_elems, list_size, i, k = 0;
+ BUCKET *b;
+ NODE *r, *subs, *xn;
+ int j, elem_size = 1;
+ long num;
+ static char buf[100];
+
+ if (symbol->table_size == 0)
+ return NULL;
+
+ num_elems = symbol->table_size;
+ if ((t->flags & (AINDEX|AVALUE|ADELETE)) == (AINDEX|ADELETE))
+ num_elems = 1;
+
+ if ((t->flags & (AINDEX|AVALUE)) == (AINDEX|AVALUE))
+ elem_size = 2;
+ list_size = elem_size * num_elems;
+
+ if (symbol->xarray != NULL) {
+ xn = symbol->xarray;
+ list = xn->alist(xn, t);
+ assert(list != NULL);
+ if (num_elems == 1 || num_elems == xn->table_size)
+ return list;
+ erealloc(list, NODE **, list_size * sizeof(NODE *), "int_list");
+ k = elem_size * xn->table_size;
+ } else
+ emalloc(list, NODE **, list_size * sizeof(NODE *), "int_list");
+
+ /* populate it */
+
+ for (i = 0; i < symbol->array_size; i++) {
+ for (b = symbol->buckets[i]; b != NULL; b = b->ainext) {
+ for (j = 0; j < b->aicount; j++) {
+ /* index */
+ num = b->ainum[j];
+ if (t->flags & AISTR) {
+ sprintf(buf, "%ld", num);
+ subs = make_string(buf, strlen(buf));
+ subs->numbr = num;
+ subs->flags |= (NUMCUR|NUMINT);
+ } else {
+ subs = make_number((AWKNUM) num);
+ subs->flags |= (INTIND|NUMINT);
+ }
+ list[k++] = subs;
+
+ /* value */
+ if (t->flags & AVALUE) {
+ r = b->aivalue[j];
+ if (r->type == Node_val) {
+ if ((t->flags & AVNUM) != 0)
+ (void) force_number(r);
+ else if ((t->flags & AVSTR) != 0)
+ r = force_string(r);
+ }
+ list[k++] = r;
+ }
+
+ if (k >= list_size)
+ return list;
+ }
+ }
+ }
+ return list;
+}
+
+
+/* int_kilobytes --- calculate memory consumption of the assoc array */
+
+AWKNUM
+int_kilobytes(NODE *symbol)
+{
+ unsigned long i, bucket_cnt = 0;
+ BUCKET *b;
+ AWKNUM kb;
+ extern AWKNUM str_kilobytes(NODE *symbol);
+
+ for (i = 0; i < symbol->array_size; i++) {
+ for (b = symbol->buckets[i]; b != NULL; b = b->ainext)
+ bucket_cnt++;
+ }
+ kb = (((AWKNUM) bucket_cnt) * sizeof (BUCKET) +
+ ((AWKNUM) symbol->array_size) * sizeof (BUCKET *)) / 1024.0;
+
+ if (symbol->xarray != NULL)
+ kb += str_kilobytes(symbol->xarray);
+
+ return kb;
+}
+
+
+/* int_dump --- dump array info */
+
+static NODE **
+int_dump(NODE *symbol, NODE *ndump)
+{
+#define HCNT 31
+
+ int indent_level;
+ BUCKET *b;
+ NODE *xn = NULL;
+ unsigned long str_size = 0, int_size = 0;
+ unsigned long i;
+ size_t j, bucket_cnt;
+ static size_t hash_dist[HCNT + 1];
+
+ indent_level = ndump->alevel;
+
+ if (symbol->xarray != NULL) {
+ xn = symbol->xarray;
+ str_size = xn->table_size;
+ }
+ int_size = symbol->table_size - str_size;
+
+ if ((symbol->flags & XARRAY) == 0)
+ fprintf(output_fp, "%s `%s'\n",
+ (symbol->parent_array == NULL) ? "array" : "sub-array",
+ array_vname(symbol));
+
+ indent_level++;
+ indent(indent_level);
+ fprintf(output_fp, "array_func: int_array_func\n");
+ if (symbol->flags != 0) {
+ indent(indent_level);
+ fprintf(output_fp, "flags: %s\n", flags2str(symbol->flags));
+ }
+ indent(indent_level);
+ fprintf(output_fp, "INT_CHAIN_MAX: %lu\n", (unsigned long) INT_CHAIN_MAX);
+ indent(indent_level);
+ fprintf(output_fp, "array_size: %lu (int)\n", (unsigned long) symbol->array_size);
+ indent(indent_level);
+ fprintf(output_fp, "table_size: %lu (total), %lu (int), %lu (str)\n",
+ (unsigned long) symbol->table_size, int_size, str_size);
+ indent(indent_level);
+ fprintf(output_fp, "Avg # of items per chain (int): %.2g\n",
+ ((AWKNUM) int_size) / symbol->array_size);
+
+ indent(indent_level);
+ fprintf(output_fp, "memory: %.2g kB (total)\n", int_kilobytes(symbol));
+
+ /* hash value distribution */
+
+ memset(hash_dist, '\0', (HCNT + 1) * sizeof(size_t));
+ for (i = 0; i < symbol->array_size; i++) {
+ bucket_cnt = 0;
+ for (b = symbol->buckets[i]; b != NULL; b = b->ainext)
+ bucket_cnt += b->aicount;
+ if (bucket_cnt >= HCNT)
+ bucket_cnt = HCNT;
+ hash_dist[bucket_cnt]++;
+ }
+
+ indent(indent_level);
+ fprintf(output_fp, "Hash distribution:\n");
+ indent_level++;
+ for (j = 0; j <= HCNT; j++) {
+ if (hash_dist[j] > 0) {
+ indent(indent_level);
+ if (j == HCNT)
+ fprintf(output_fp, "[>=%lu]:%lu\n",
+ (unsigned long) HCNT, (unsigned long) hash_dist[j]);
+ else
+ fprintf(output_fp, "[%lu]:%lu\n",
+ (unsigned long) j, (unsigned long) hash_dist[j]);
+ }
+ }
+ indent_level--;
+
+ /* dump elements */
+
+ if (ndump->adepth >= 0) {
+ NODE *subs;
+ const char *aname;
+
+ fprintf(output_fp, "\n");
+
+ aname = make_aname(symbol);
+ subs = make_number((AWKNUM) 0);
+ subs->flags |= (INTIND|NUMINT);
+
+ for (i = 0; i < symbol->array_size; i++) {
+ for (b = symbol->buckets[i]; b != NULL; b = b->ainext) {
+ for (j = 0; j < b->aicount; j++) {
+ subs->numbr = b->ainum[j];
+ assoc_info(subs, b->aivalue[j], ndump, aname);
+ }
+ }
+ }
+ unref(subs);
+ }
+
+ if (xn != NULL) {
+ fprintf(output_fp, "\n");
+ xn->adump(xn, ndump);
+ }
+
+ return NULL;
+
+#undef HCNT
+}
+
+
+/* int_hash --- calculate the hash function of the integer subs */
+
+static uint32_t
+int_hash(uint32_t k, uint32_t hsize)
+{
+
+/* Code snippet copied from:
+ * Hash functions (http://www.azillionmonkeys.com/qed/hash.html).
+ * Copyright 2004-2008 by Paul Hsieh. Licenced under LGPL 2.1.
+ */
+
+ /* This is the final mixing function used by Paul Hsieh
+ * in SuperFastHash.
+ */
+
+ k ^= k << 3;
+ k += k >> 5;
+ k ^= k << 4;
+ k += k >> 17;
+ k ^= k << 25;
+ k += k >> 6;
+
+ if (k >= hsize)
+ k %= hsize;
+ return k;
+}
+
+/* int_find --- locate symbol[subs] */
+
+static inline NODE **
+int_find(NODE *symbol, long k, uint32_t hash1)
+{
+ BUCKET *b;
+ int i;
+
+ assert(symbol->buckets != NULL);
+ for (b = symbol->buckets[hash1]; b != NULL; b = b->ainext) {
+ for (i = 0; i < b->aicount; i++) {
+ if (b->ainum[i] == k)
+ return (b->aivalue + i);
+ }
+ }
+ return NULL;
+}
+
+
+/* int_insert --- install subs in the assoc array */
+
+static NODE **
+int_insert(NODE *symbol, long k, uint32_t hash1)
+{
+ BUCKET *b;
+ int i;
+
+ b = symbol->buckets[hash1];
+
+ /* Only the first bucket in the chain can be partially full,
+ * but is never empty.
+ */
+
+ if (b == NULL || (i = b->aicount) == 2) {
+ getbucket(b);
+ b->aicount = 0;
+ b->ainext = symbol->buckets[hash1];
+ symbol->buckets[hash1] = b;
+ i = 0;
+ }
+
+ b->ainum[i] = k;
+ b->aivalue[i] = dupnode(Nnull_string);
+ b->aicount++;
+ return & b->aivalue[i];
+}
+
+
+/* grow_int_table --- grow the hash table */
+
+static void
+grow_int_table(NODE *symbol)
+{
+ BUCKET **old, **new;
+ BUCKET *chain, *next;
+ int i, j;
+ unsigned long oldsize, newsize, k;
+
+ /*
+ * This is an array of primes. We grow the table by an order of
+ * magnitude each time (not just doubling) so that growing is a
+ * rare operation. We expect, on average, that it won't happen
+ * more than twice. The final size is also chosen to be small
+ * enough so that MS-DOG mallocs can handle it. When things are
+ * very large (> 8K), we just double more or less, instead of
+ * just jumping from 8K to 64K.
+ */
+
+ static const unsigned long sizes[] = {
+ 13, 127, 1021, 8191, 16381, 32749, 65497,
+ 131101, 262147, 524309, 1048583, 2097169,
+ 4194319, 8388617, 16777259, 33554467,
+ 67108879, 134217757, 268435459, 536870923,
+ 1073741827
+ };
+
+ /* find next biggest hash size */
+ newsize = oldsize = symbol->array_size;
+
+ for (i = 0, j = sizeof(sizes)/sizeof(sizes[0]); i < j; i++) {
+ if (oldsize < sizes[i]) {
+ newsize = sizes[i];
+ break;
+ }
+ }
+ if (newsize == oldsize) { /* table already at max (!) */
+ symbol->flags |= ARRAYMAXED;
+ return;
+ }
+
+ /* allocate new table */
+ emalloc(new, BUCKET **, newsize * sizeof(BUCKET *), "grow_int_table");
+ memset(new, '\0', newsize * sizeof(BUCKET *));
+
+ old = symbol->buckets;
+ symbol->buckets = new;
+ symbol->array_size = newsize;
+
+ /* brand new hash table */
+ if (old == NULL)
+ return; /* DO NOT initialize symbol->table_size */
+
+ /* old hash table there, move stuff to new, free old */
+ /* note that symbol->table_size does not change if an old array. */
+
+ for (k = 0; k < oldsize; k++) {
+ long num;
+ for (chain = old[k]; chain != NULL; chain = next) {
+ for (i = 0; i < chain->aicount; i++) {
+ num = chain->ainum[i];
+ *int_insert(symbol, num, int_hash(num, newsize)) = chain->aivalue[i];
+ }
+ next = chain->ainext;
+ freebucket(chain);
+ }
+ }
+ efree(old);
+}
diff --git a/interpret.h b/interpret.h
new file mode 100644
index 00000000..26725a21
--- /dev/null
+++ b/interpret.h
@@ -0,0 +1,1273 @@
+/*
+ * interpret.h --- run a list of instructions.
+ */
+
+/*
+ * Copyright (C) 1986, 1988, 1989, 1991-2012 the Free Software Foundation, Inc.
+ *
+ * This file is part of GAWK, the GNU implementation of the
+ * AWK Programming Language.
+ *
+ * GAWK is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GAWK is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+
+int
+r_interpret(INSTRUCTION *code)
+{
+ INSTRUCTION *pc; /* current instruction */
+ OPCODE op; /* current opcode */
+ NODE *r = NULL;
+ NODE *m;
+ INSTRUCTION *ni;
+ NODE *t1, *t2;
+ NODE **lhs;
+ AWKNUM x, x2;
+ int di;
+ Regexp *rp;
+
+/* array subscript */
+#define mk_sub(n) (n == 1 ? POP_SCALAR() : concat_exp(n, true))
+
+#ifdef EXEC_HOOK
+#define JUMPTO(x) do { if (post_execute) post_execute(pc); pc = (x); goto top; } while (false)
+#else
+#define JUMPTO(x) do { pc = (x); goto top; } while (false)
+#endif
+
+ pc = code;
+
+ /* N.B.: always use JUMPTO for next instruction, otherwise bad things
+ * may happen. DO NOT add a real loop (for/while) below to
+ * replace ' forever {'; this catches failure to use JUMPTO to execute
+ * next instruction (e.g. continue statement).
+ */
+
+ /* loop until hit Op_stop instruction */
+
+ /* forever { */
+top:
+ if (pc->source_line > 0)
+ sourceline = pc->source_line;
+
+#ifdef EXEC_HOOK
+ for (di = 0; di < num_exec_hook; di++) {
+ if (! pre_execute[di](& pc))
+ goto top;
+ }
+#endif
+
+ switch ((op = pc->opcode)) {
+ case Op_rule:
+ currule = pc->in_rule; /* for sole use in Op_K_next, Op_K_nextfile, Op_K_getline */
+ /* fall through */
+ case Op_func:
+ source = pc->source_file;
+ break;
+
+ case Op_atexit:
+ {
+ bool stdio_problem = false;
+
+ /* avoid false source indications */
+ source = NULL;
+ sourceline = 0;
+ (void) nextfile(& curfile, true); /* close input data file */
+ /*
+ * This used to be:
+ *
+ * if (close_io() != 0 && ! exiting && exit_val == 0)
+ * exit_val = 1;
+ *
+ * Other awks don't care about problems closing open files
+ * and pipes, in that it doesn't affect their exit status.
+ * So we no longer do either.
+ */
+ (void) close_io(& stdio_problem);
+ /*
+ * However, we do want to exit non-zero if there was a problem
+ * with stdout/stderr, so we reinstate a slightly different
+ * version of the above:
+ */
+ if (stdio_problem && ! exiting && exit_val == 0)
+ exit_val = 1;
+ }
+ break;
+
+ case Op_stop:
+ return 0;
+
+ case Op_push_i:
+ m = pc->memory;
+ if (! do_traditional && (m->flags & INTLSTR) != 0) {
+ char *orig, *trans, save;
+
+ save = m->stptr[m->stlen];
+ m->stptr[m->stlen] = '\0';
+ orig = m->stptr;
+ trans = dgettext(TEXTDOMAIN, orig);
+ m->stptr[m->stlen] = save;
+ m = make_string(trans, strlen(trans));
+ } else
+ UPREF(m);
+ PUSH(m);
+ break;
+
+ case Op_push:
+ case Op_push_arg:
+ {
+ NODE *save_symbol;
+ bool isparam = false;
+
+ save_symbol = m = pc->memory;
+ if (m->type == Node_param_list) {
+ isparam = true;
+ save_symbol = m = GET_PARAM(m->param_cnt);
+ if (m->type == Node_array_ref)
+ m = m->orig_array;
+ }
+
+ switch (m->type) {
+ case Node_var:
+ if (do_lint && var_uninitialized(m))
+ lintwarn(isparam ?
+ _("reference to uninitialized argument `%s'") :
+ _("reference to uninitialized variable `%s'"),
+ save_symbol->vname);
+ m = m->var_value;
+ UPREF(m);
+ PUSH(m);
+ break;
+
+ case Node_var_new:
+ m->type = Node_var;
+ m->var_value = dupnode(Nnull_string);
+ if (do_lint)
+ lintwarn(isparam ?
+ _("reference to uninitialized argument `%s'") :
+ _("reference to uninitialized variable `%s'"),
+ save_symbol->vname);
+ m = dupnode(Nnull_string);
+ PUSH(m);
+ break;
+
+ case Node_var_array:
+ if (op == Op_push_arg)
+ PUSH(m);
+ else
+ fatal(_("attempt to use array `%s' in a scalar context"),
+ array_vname(save_symbol));
+ break;
+
+ default:
+ cant_happen();
+ }
+ }
+ break;
+
+ case Op_push_param: /* function argument */
+ m = pc->memory;
+ if (m->type == Node_param_list)
+ m = GET_PARAM(m->param_cnt);
+ if (m->type == Node_var) {
+ m = m->var_value;
+ UPREF(m);
+ PUSH(m);
+ break;
+ }
+ /* else
+ fall through */
+ case Op_push_array:
+ PUSH(pc->memory);
+ break;
+
+ case Op_push_lhs:
+ lhs = get_lhs(pc->memory, pc->do_reference);
+ PUSH_ADDRESS(lhs);
+ break;
+
+ case Op_subscript:
+ t2 = mk_sub(pc->sub_count);
+ t1 = POP_ARRAY();
+
+ if (do_lint && in_array(t1, t2) == NULL) {
+ t2 = force_string(t2);
+ lintwarn(_("reference to uninitialized element `%s[\"%.*s\"]'"),
+ array_vname(t1), (int) t2->stlen, t2->stptr);
+ if (t2->stlen == 0)
+ lintwarn(_("subscript of array `%s' is null string"), array_vname(t1));
+ }
+
+ /* for FUNCTAB, get the name as the element value */
+ if (t1 == func_table) {
+ static bool warned = false;
+
+ if (do_lint && ! warned) {
+ warned = true;
+ lintwarn(_("FUNCTAB is a gawk extension"));
+ }
+ r = t2;
+ } else {
+ r = *assoc_lookup(t1, t2);
+ }
+ DEREF(t2);
+
+ /* for SYMTAB, step through to the actual variable */
+ if (t1 == symbol_table) {
+ static bool warned = false;
+
+ if (do_lint && ! warned) {
+ warned = true;
+ lintwarn(_("SYMTAB is a gawk extension"));
+ }
+ if (r->type == Node_var)
+ r = r->var_value;
+ }
+
+ if (r->type == Node_val)
+ UPREF(r);
+ PUSH(r);
+ break;
+
+ case Op_sub_array:
+ t2 = mk_sub(pc->sub_count);
+ t1 = POP_ARRAY();
+ r = in_array(t1, t2);
+ if (r == NULL) {
+ r = make_array();
+ r->parent_array = t1;
+ *assoc_lookup(t1, t2) = r;
+ t2 = force_string(t2);
+ r->vname = estrdup(t2->stptr, t2->stlen); /* the subscript in parent array */
+ } else if (r->type != Node_var_array) {
+ t2 = force_string(t2);
+ fatal(_("attempt to use scalar `%s[\"%.*s\"]' as an array"),
+ array_vname(t1), (int) t2->stlen, t2->stptr);
+ }
+
+ DEREF(t2);
+ PUSH(r);
+ break;
+
+ case Op_subscript_lhs:
+ t2 = mk_sub(pc->sub_count);
+ t1 = POP_ARRAY();
+ if (do_lint && in_array(t1, t2) == NULL) {
+ t2 = force_string(t2);
+ if (pc->do_reference)
+ lintwarn(_("reference to uninitialized element `%s[\"%.*s\"]'"),
+ array_vname(t1), (int) t2->stlen, t2->stptr);
+ if (t2->stlen == 0)
+ lintwarn(_("subscript of array `%s' is null string"), array_vname(t1));
+ }
+
+ lhs = assoc_lookup(t1, t2);
+ if ((*lhs)->type == Node_var_array) {
+ t2 = force_string(t2);
+ fatal(_("attempt to use array `%s[\"%.*s\"]' in a scalar context"),
+ array_vname(t1), (int) t2->stlen, t2->stptr);
+ }
+
+ DEREF(t2);
+ PUSH_ADDRESS(lhs);
+ break;
+
+ case Op_field_spec:
+ t1 = TOP_SCALAR();
+ lhs = r_get_field(t1, (Func_ptr *) 0, true);
+ decr_sp();
+ DEREF(t1);
+ r = dupnode(*lhs); /* can't use UPREF here */
+ PUSH(r);
+ break;
+
+ case Op_field_spec_lhs:
+ t1 = TOP_SCALAR();
+ lhs = r_get_field(t1, &pc->target_assign->field_assign, pc->do_reference);
+ decr_sp();
+ DEREF(t1);
+ PUSH_ADDRESS(lhs);
+ break;
+
+ case Op_lint:
+ if (do_lint) {
+ switch (pc->lint_type) {
+ case LINT_assign_in_cond:
+ lintwarn(_("assignment used in conditional context"));
+ break;
+
+ case LINT_no_effect:
+ lintwarn(_("statement has no effect"));
+ break;
+
+ default:
+ cant_happen();
+ }
+ }
+ break;
+
+ case Op_K_break:
+ case Op_K_continue:
+ case Op_jmp:
+ assert(pc->target_jmp != NULL);
+ JUMPTO(pc->target_jmp);
+
+ case Op_jmp_false:
+ r = POP_SCALAR();
+ di = eval_condition(r);
+ DEREF(r);
+ if (! di)
+ JUMPTO(pc->target_jmp);
+ break;
+
+ case Op_jmp_true:
+ r = POP_SCALAR();
+ di = eval_condition(r);
+ DEREF(r);
+ if (di)
+ JUMPTO(pc->target_jmp);
+ break;
+
+ case Op_and:
+ case Op_or:
+ t1 = POP_SCALAR();
+ di = eval_condition(t1);
+ DEREF(t1);
+ if ((op == Op_and && di) || (op == Op_or && ! di))
+ break;
+ r = node_Boolean[di];
+ UPREF(r);
+ PUSH(r);
+ ni = pc->target_jmp;
+ JUMPTO(ni->nexti);
+
+ case Op_and_final:
+ case Op_or_final:
+ t1 = TOP_SCALAR();
+ r = node_Boolean[eval_condition(t1)];
+ DEREF(t1);
+ UPREF(r);
+ REPLACE(r);
+ break;
+
+ case Op_not:
+ t1 = TOP_SCALAR();
+ r = node_Boolean[! eval_condition(t1)];
+ DEREF(t1);
+ UPREF(r);
+ REPLACE(r);
+ break;
+
+ case Op_equal:
+ r = node_Boolean[cmp_scalars() == 0];
+ UPREF(r);
+ REPLACE(r);
+ break;
+
+ case Op_notequal:
+ r = node_Boolean[cmp_scalars() != 0];
+ UPREF(r);
+ REPLACE(r);
+ break;
+
+ case Op_less:
+ r = node_Boolean[cmp_scalars() < 0];
+ UPREF(r);
+ REPLACE(r);
+ break;
+
+ case Op_greater:
+ r = node_Boolean[cmp_scalars() > 0];
+ UPREF(r);
+ REPLACE(r);
+ break;
+
+ case Op_leq:
+ r = node_Boolean[cmp_scalars() <= 0];
+ UPREF(r);
+ REPLACE(r);
+ break;
+
+ case Op_geq:
+ r = node_Boolean[cmp_scalars() >= 0];
+ UPREF(r);
+ REPLACE(r);
+ break;
+
+ case Op_plus_i:
+ x2 = force_number(pc->memory)->numbr;
+ goto plus;
+ case Op_plus:
+ t2 = POP_NUMBER();
+ x2 = t2->numbr;
+ DEREF(t2);
+plus:
+ t1 = TOP_NUMBER();
+ r = make_number(t1->numbr + x2);
+ DEREF(t1);
+ REPLACE(r);
+ break;
+
+ case Op_minus_i:
+ x2 = force_number(pc->memory)->numbr;
+ goto minus;
+ case Op_minus:
+ t2 = POP_NUMBER();
+ x2 = t2->numbr;
+ DEREF(t2);
+minus:
+ t1 = TOP_NUMBER();
+ r = make_number(t1->numbr - x2);
+ DEREF(t1);
+ REPLACE(r);
+ break;
+
+ case Op_times_i:
+ x2 = force_number(pc->memory)->numbr;
+ goto times;
+ case Op_times:
+ t2 = POP_NUMBER();
+ x2 = t2->numbr;
+ DEREF(t2);
+times:
+ t1 = TOP_NUMBER();
+ r = make_number(t1->numbr * x2);
+ DEREF(t1);
+ REPLACE(r);
+ break;
+
+ case Op_exp_i:
+ x2 = force_number(pc->memory)->numbr;
+ goto exp;
+ case Op_exp:
+ t2 = POP_NUMBER();
+ x2 = t2->numbr;
+ DEREF(t2);
+exp:
+ t1 = TOP_NUMBER();
+ r = make_number(calc_exp(t1->numbr, x2));
+ DEREF(t1);
+ REPLACE(r);
+ break;
+
+ case Op_quotient_i:
+ x2 = force_number(pc->memory)->numbr;
+ goto quotient;
+ case Op_quotient:
+ t2 = POP_NUMBER();
+ x2 = t2->numbr;
+ DEREF(t2);
+quotient:
+ t1 = TOP_NUMBER();
+ if (x2 == 0)
+ fatal(_("division by zero attempted"));
+ r = make_number(t1->numbr / x2);
+ DEREF(t1);
+ REPLACE(r);
+ break;
+
+ case Op_mod_i:
+ x2 = force_number(pc->memory)->numbr;
+ goto mod;
+ case Op_mod:
+ t2 = POP_NUMBER();
+ x2 = t2->numbr;
+ DEREF(t2);
+mod:
+ t1 = TOP_NUMBER();
+ if (x2 == 0)
+ fatal(_("division by zero attempted in `%%'"));
+#ifdef HAVE_FMOD
+ x = fmod(t1->numbr, x2);
+#else /* ! HAVE_FMOD */
+ (void) modf(t1->numbr / x2, &x);
+ x = t1->numbr - x * x2;
+#endif /* ! HAVE_FMOD */
+ r = make_number(x);
+
+ DEREF(t1);
+ REPLACE(r);
+ break;
+
+ case Op_preincrement:
+ case Op_predecrement:
+ x = op == Op_preincrement ? 1.0 : -1.0;
+ lhs = TOP_ADDRESS();
+ t1 = *lhs;
+ force_number(t1);
+ if (t1->valref == 1 && t1->flags == (MALLOC|NUMCUR|NUMBER)) {
+ /* optimization */
+ t1->numbr += x;
+ r = t1;
+ } else {
+ r = *lhs = make_number(t1->numbr + x);
+ unref(t1);
+ }
+ UPREF(r);
+ REPLACE(r);
+ break;
+
+ case Op_postincrement:
+ case Op_postdecrement:
+ x = op == Op_postincrement ? 1.0 : -1.0;
+ lhs = TOP_ADDRESS();
+ t1 = *lhs;
+ force_number(t1);
+ r = make_number(t1->numbr);
+ if (t1->valref == 1 && t1->flags == (MALLOC|NUMCUR|NUMBER)) {
+ /* optimization */
+ t1->numbr += x;
+ } else {
+ *lhs = make_number(t1->numbr + x);
+ unref(t1);
+ }
+ REPLACE(r);
+ break;
+
+ case Op_unary_minus:
+ t1 = TOP_NUMBER();
+ r = make_number(-t1->numbr);
+ DEREF(t1);
+ REPLACE(r);
+ break;
+
+ case Op_store_sub:
+ /* array[sub] assignment optimization,
+ * see awkgram.y (optimize_assignment)
+ */
+ t1 = get_array(pc->memory, true); /* array */
+ t2 = mk_sub(pc->expr_count); /* subscript */
+ lhs = assoc_lookup(t1, t2);
+ if ((*lhs)->type == Node_var_array) {
+ t2 = force_string(t2);
+ fatal(_("attempt to use array `%s[\"%.*s\"]' in a scalar context"),
+ array_vname(t1), (int) t2->stlen, t2->stptr);
+ }
+ DEREF(t2);
+
+ /*
+ * Changing something in FUNCTAB is not allowed.
+ *
+ * SYMTAB is a little more messy. Three kinds of values may
+ * be stored in SYMTAB:
+ * 1. Variables that don"t yet have a value (Node_var_new)
+ * 2. Variables that have a value (Node_var)
+ * 3. Values that awk code stuck into SYMTAB not related to variables (Node_value)
+ * For 1, since we are giving it a value, we have to change the type to Node_var.
+ * For 1 and 2, we have to step through the Node_var to get to the value.
+ * For 3, we just us the value we got from assoc_lookup(), above.
+ */
+ if (t1 == func_table)
+ fatal(_("cannot assign to elements of FUNCTAB"));
+ else if ( t1 == symbol_table
+ && ( (*lhs)->type == Node_var
+ || (*lhs)->type == Node_var_new)) {
+ (*lhs)->type = Node_var; /* in case was Node_var_new */
+ lhs = & ((*lhs)->var_value); /* extra level of indirection */
+ }
+
+ unref(*lhs);
+ *lhs = POP_SCALAR();
+ break;
+
+ case Op_store_var:
+ /* simple variable assignment optimization,
+ * see awkgram.y (optimize_assignment)
+ */
+
+ lhs = get_lhs(pc->memory, false);
+ unref(*lhs);
+ r = pc->initval; /* constant initializer */
+ if (r == NULL)
+ *lhs = POP_SCALAR();
+ else {
+ UPREF(r);
+ *lhs = r;
+ }
+ break;
+
+ case Op_store_field:
+ {
+ /* field assignment optimization,
+ * see awkgram.y (optimize_assignment)
+ */
+
+ Func_ptr assign;
+ t1 = TOP_SCALAR();
+ lhs = r_get_field(t1, & assign, false);
+ decr_sp();
+ DEREF(t1);
+ unref(*lhs);
+ *lhs = POP_SCALAR();
+ assert(assign != NULL);
+ assign();
+ }
+ break;
+
+ case Op_assign_concat:
+ /* x = x ... string concatenation optimization */
+ lhs = get_lhs(pc->memory, false);
+ t1 = force_string(*lhs);
+ t2 = POP_STRING();
+
+ free_wstr(*lhs);
+
+ if (t1 != *lhs) {
+ unref(*lhs);
+ *lhs = dupnode(t1);
+ }
+
+ if (t1 != t2 && t1->valref == 1 && (t1->flags & MPFN) == 0) {
+ size_t nlen = t1->stlen + t2->stlen;
+
+ erealloc(t1->stptr, char *, nlen + 2, "r_interpret");
+ memcpy(t1->stptr + t1->stlen, t2->stptr, t2->stlen);
+ t1->stlen = nlen;
+ t1->stptr[nlen] = '\0';
+ t1->flags &= ~(NUMCUR|NUMBER|NUMINT);
+ } else {
+ size_t nlen = t1->stlen + t2->stlen;
+ char *p;
+
+ emalloc(p, char *, nlen + 2, "r_interpret");
+ memcpy(p, t1->stptr, t1->stlen);
+ memcpy(p + t1->stlen, t2->stptr, t2->stlen);
+ unref(*lhs);
+ t1 = *lhs = make_str_node(p, nlen, ALREADY_MALLOCED);
+ }
+ DEREF(t2);
+ break;
+
+ case Op_assign:
+ lhs = POP_ADDRESS();
+ r = TOP_SCALAR();
+ unref(*lhs);
+ *lhs = r;
+ UPREF(r);
+ REPLACE(r);
+ break;
+
+ /* numeric assignments */
+ case Op_assign_plus:
+ case Op_assign_minus:
+ case Op_assign_times:
+ case Op_assign_quotient:
+ case Op_assign_mod:
+ case Op_assign_exp:
+ op_assign(op);
+ break;
+
+ case Op_var_update: /* update value of NR, FNR or NF */
+ pc->update_var();
+ break;
+
+ case Op_var_assign:
+ case Op_field_assign:
+ r = TOP();
+ if (pc->assign_ctxt == Op_sub_builtin
+ && get_number_si(r) == 0 /* top of stack has a number == 0 */
+ ) {
+ /* There wasn't any substitutions. If the target is a FIELD,
+ * this means no field re-splitting or $0 reconstruction.
+ * Skip the set_FOO routine if the target is a special variable.
+ */
+
+ break;
+ } else if ((pc->assign_ctxt == Op_K_getline
+ || pc->assign_ctxt == Op_K_getline_redir)
+ && get_number_si(r) <= 0 /* top of stack has a number <= 0 */
+ ) {
+ /* getline returned EOF or error */
+
+ break;
+ }
+
+ if (op == Op_var_assign)
+ pc->assign_var();
+ else
+ pc->field_assign();
+ break;
+
+ case Op_concat:
+ r = concat_exp(pc->expr_count, pc->concat_flag & CSUBSEP);
+ PUSH(r);
+ break;
+
+ case Op_K_case:
+ if ((pc + 1)->match_exp) {
+ /* match a constant regex against switch expression instead of $0. */
+
+ m = POP(); /* regex */
+ t2 = TOP_SCALAR(); /* switch expression */
+ t2 = force_string(t2);
+ rp = re_update(m);
+ di = (research(rp, t2->stptr, 0, t2->stlen,
+ avoid_dfa(m, t2->stptr, t2->stlen)) >= 0);
+ } else {
+ t1 = POP_SCALAR(); /* case value */
+ t2 = TOP_SCALAR(); /* switch expression */
+ di = (cmp_nodes(t2, t1) == 0);
+ DEREF(t1);
+ }
+
+ if (di) {
+ /* match found */
+ t2 = POP_SCALAR();
+ DEREF(t2);
+ JUMPTO(pc->target_jmp);
+ }
+ break;
+
+ case Op_K_delete:
+ t1 = POP_ARRAY();
+ do_delete(t1, pc->expr_count);
+ stack_adj(-pc->expr_count);
+ break;
+
+ case Op_K_delete_loop:
+ t1 = POP_ARRAY();
+ lhs = POP_ADDRESS(); /* item */
+ do_delete_loop(t1, lhs);
+ break;
+
+ case Op_in_array:
+ t1 = POP_ARRAY();
+ t2 = mk_sub(pc->expr_count);
+ r = node_Boolean[(in_array(t1, t2) != NULL)];
+ DEREF(t2);
+ UPREF(r);
+ PUSH(r);
+ break;
+
+ case Op_arrayfor_init:
+ {
+ NODE **list = NULL;
+ NODE *array, *sort_str;
+ size_t num_elems = 0;
+ static NODE *sorted_in = NULL;
+ const char *how_to_sort = "@unsorted";
+
+ /* get the array */
+ array = POP_ARRAY();
+
+ /* sanity: check if empty */
+ if (array_empty(array))
+ goto arrayfor;
+
+ num_elems = array->table_size;
+
+ if (sorted_in == NULL) /* do this once */
+ sorted_in = make_string("sorted_in", 9);
+
+ sort_str = NULL;
+ /*
+ * If posix, or if there's no PROCINFO[],
+ * there's no ["sorted_in"], so no sorting
+ */
+ if (! do_posix && PROCINFO_node != NULL)
+ sort_str = in_array(PROCINFO_node, sorted_in);
+
+ if (sort_str != NULL) {
+ sort_str = force_string(sort_str);
+ if (sort_str->stlen > 0)
+ how_to_sort = sort_str->stptr;
+ }
+
+ list = assoc_list(array, how_to_sort, SORTED_IN);
+
+arrayfor:
+ getnode(r);
+ r->type = Node_arrayfor;
+ r->for_list = list;
+ r->for_list_size = num_elems; /* # of elements in list */
+ r->cur_idx = -1; /* current index */
+ r->for_array = array; /* array */
+ PUSH(r);
+
+ if (num_elems == 0)
+ JUMPTO(pc->target_jmp); /* Op_arrayfor_final */
+ }
+ break;
+
+ case Op_arrayfor_incr:
+ r = TOP(); /* Node_arrayfor */
+ if (++r->cur_idx == r->for_list_size) {
+ NODE *array;
+ array = r->for_array; /* actual array */
+ if (do_lint && array->table_size != r->for_list_size)
+ lintwarn(_("for loop: array `%s' changed size from %ld to %ld during loop execution"),
+ array_vname(array), (long) r->for_list_size, (long) array->table_size);
+ JUMPTO(pc->target_jmp); /* Op_arrayfor_final */
+ }
+
+ t1 = r->for_list[r->cur_idx];
+ lhs = get_lhs(pc->array_var, false);
+ unref(*lhs);
+ *lhs = dupnode(t1);
+ break;
+
+ case Op_arrayfor_final:
+ r = POP();
+ assert(r->type == Node_arrayfor);
+ free_arrayfor(r);
+ break;
+
+ case Op_builtin:
+ r = pc->builtin(pc->expr_count);
+ PUSH(r);
+ break;
+
+ case Op_ext_builtin:
+ {
+ int arg_count = pc->expr_count;
+ awk_value_t result;
+
+ PUSH_CODE(pc);
+ r = awk_value_to_node(pc->extfunc(arg_count, & result));
+ (void) POP_CODE();
+ while (arg_count-- > 0) {
+ t1 = POP();
+ if (t1->type == Node_val)
+ DEREF(t1);
+ }
+ PUSH(r);
+ }
+ break;
+
+ case Op_sub_builtin: /* sub, gsub and gensub */
+ r = do_sub(pc->expr_count, pc->sub_flags);
+ PUSH(r);
+ break;
+
+ case Op_K_print:
+ do_print(pc->expr_count, pc->redir_type);
+ break;
+
+ case Op_K_printf:
+ do_printf(pc->expr_count, pc->redir_type);
+ break;
+
+ case Op_K_print_rec:
+ do_print_rec(pc->expr_count, pc->redir_type);
+ break;
+
+ case Op_push_re:
+ m = pc->memory;
+ if (m->type == Node_dynregex) {
+ r = POP_STRING();
+ unref(m->re_exp);
+ m->re_exp = r;
+ }
+ PUSH(m);
+ break;
+
+ case Op_match_rec:
+ m = pc->memory;
+ t1 = *get_field(0, (Func_ptr *) 0);
+match_re:
+ rp = re_update(m);
+ /*
+ * Any place where research() is called with a last parameter of
+ * zero, we need to use the avoid_dfa test. This appears here and
+ * in the code for Op_K_case.
+ *
+ * A new or improved dfa that distinguishes beginning/end of
+ * string from beginning/end of line will allow us to get rid of
+ * this hack.
+ *
+ * The avoid_dfa() function is in re.c; it is not very smart.
+ */
+
+ di = research(rp, t1->stptr, 0, t1->stlen,
+ avoid_dfa(m, t1->stptr, t1->stlen));
+ di = (di == -1) ^ (op != Op_nomatch);
+ if (op != Op_match_rec) {
+ decr_sp();
+ DEREF(t1);
+ }
+ r = node_Boolean[di];
+ UPREF(r);
+ PUSH(r);
+ break;
+
+ case Op_nomatch:
+ /* fall through */
+ case Op_match:
+ m = pc->memory;
+ t1 = TOP_STRING();
+ if (m->type == Node_dynregex) {
+ unref(m->re_exp);
+ m->re_exp = t1;
+ decr_sp();
+ t1 = TOP_STRING();
+ }
+ goto match_re;
+ break;
+
+ case Op_indirect_func_call:
+ {
+ NODE *f = NULL;
+ int arg_count;
+
+ arg_count = (pc + 1)->expr_count;
+ t1 = PEEK(arg_count); /* indirect var */
+
+ if (t1->type != Node_val) /* @a[1](p) not allowed in grammar */
+ fatal(_("indirect function call requires a simple scalar value"));
+
+ t1 = force_string(t1);
+ if (t1->stlen > 0) {
+ /* retrieve function definition node */
+ f = pc->func_body;
+ if (f != NULL && strcmp(f->vname, t1->stptr) == 0) {
+ /* indirect var hasn't been reassigned */
+
+ ni = setup_frame(pc);
+ JUMPTO(ni); /* Op_func */
+ }
+ f = lookup(t1->stptr);
+ }
+
+ if (f == NULL || f->type != Node_func) {
+ if (f->type == Node_ext_func)
+ fatal(_("cannot (yet) call extension functions indirectly"));
+ else
+ fatal(_("function called indirectly through `%s' does not exist"),
+ pc->func_name);
+ }
+ pc->func_body = f; /* save for next call */
+
+ ni = setup_frame(pc);
+ JUMPTO(ni); /* Op_func */
+ }
+
+ case Op_func_call:
+ {
+ NODE *f;
+
+ /* retrieve function definition node */
+ f = pc->func_body;
+ if (f == NULL) {
+ f = lookup(pc->func_name);
+ if (f == NULL || (f->type != Node_func && f->type != Node_ext_func))
+ fatal(_("function `%s' not defined"), pc->func_name);
+ pc->func_body = f; /* save for next call */
+ }
+
+ if (f->type == Node_ext_func) {
+ INSTRUCTION *bc;
+ char *fname = pc->func_name;
+ int arg_count = (pc + 1)->expr_count;
+
+ bc = f->code_ptr;
+ assert(bc->opcode == Op_symbol);
+ pc->opcode = Op_ext_builtin; /* self modifying code */
+ pc->extfunc = bc->extfunc;
+ pc->expr_count = arg_count; /* actual argument count */
+ (pc + 1)->func_name = fname; /* name of the builtin */
+ (pc + 1)->expr_count = bc->expr_count; /* defined max # of arguments */
+ ni = pc;
+ JUMPTO(ni);
+ }
+
+ ni = setup_frame(pc);
+ JUMPTO(ni); /* Op_func */
+ }
+
+ case Op_K_return:
+ m = POP_SCALAR(); /* return value */
+
+ ni = pop_fcall();
+
+ /* put the return value back on stack */
+ PUSH(m);
+
+ JUMPTO(ni);
+
+ case Op_K_getline_redir:
+ if ((currule == BEGINFILE || currule == ENDFILE)
+ && pc->into_var == false
+ && pc->redir_type == redirect_input)
+ fatal(_("`getline' invalid inside `%s' rule"), ruletab[currule]);
+ r = do_getline_redir(pc->into_var, pc->redir_type);
+ PUSH(r);
+ break;
+
+ case Op_K_getline: /* no redirection */
+ if (! currule || currule == BEGINFILE || currule == ENDFILE)
+ fatal(_("non-redirected `getline' invalid inside `%s' rule"),
+ ruletab[currule]);
+
+ do {
+ int ret;
+ ret = nextfile(& curfile, false);
+ if (ret <= 0)
+ r = do_getline(pc->into_var, curfile);
+ else {
+
+ /* Save execution state so that we can return to it
+ * from Op_after_beginfile or Op_after_endfile.
+ */
+
+ push_exec_state(pc, currule, source, stack_ptr);
+
+ if (curfile == NULL)
+ JUMPTO((pc + 1)->target_endfile);
+ else
+ JUMPTO((pc + 1)->target_beginfile);
+ }
+ } while (r == NULL); /* EOF */
+
+ PUSH(r);
+ break;
+
+ case Op_after_endfile:
+ /* Find the execution state to return to */
+ ni = pop_exec_state(& currule, & source, NULL);
+
+ assert(ni->opcode == Op_newfile || ni->opcode == Op_K_getline);
+ JUMPTO(ni);
+
+ case Op_after_beginfile:
+ after_beginfile(& curfile);
+
+ /* Find the execution state to return to */
+ ni = pop_exec_state(& currule, & source, NULL);
+
+ assert(ni->opcode == Op_newfile || ni->opcode == Op_K_getline);
+ if (ni->opcode == Op_K_getline
+ || curfile == NULL /* skipping directory argument */
+ )
+ JUMPTO(ni);
+
+ break; /* read a record, Op_get_record */
+
+ case Op_newfile:
+ {
+ int ret;
+
+ ret = nextfile(& curfile, false);
+
+ if (ret < 0) /* end of input */
+ JUMPTO(pc->target_jmp); /* end block or Op_atexit */
+
+ if (ret == 0) /* read a record */
+ JUMPTO((pc + 1)->target_get_record);
+
+ /* ret > 0 */
+ /* Save execution state for use in Op_after_beginfile or Op_after_endfile. */
+
+ push_exec_state(pc, currule, source, stack_ptr);
+
+ if (curfile == NULL) /* EOF */
+ JUMPTO(pc->target_endfile);
+ /* else
+ execute beginfile block */
+ }
+ break;
+
+ case Op_get_record:
+ {
+ int errcode = 0;
+
+ ni = pc->target_newfile;
+ if (curfile == NULL) {
+ /* from non-redirected getline, e.g.:
+ * {
+ * while (getline > 0) ;
+ * }
+ */
+
+ ni = ni->target_jmp; /* end_block or Op_atexit */
+ JUMPTO(ni);
+ }
+
+ if (inrec(curfile, & errcode) != 0) {
+ if (errcode > 0 && (do_traditional || ! pc->has_endfile))
+ fatal(_("error reading input file `%s': %s"),
+ curfile->public.name, strerror(errcode));
+
+ JUMPTO(ni);
+ } /* else
+ prog (rule) block */
+ }
+ break;
+
+ case Op_K_nextfile:
+ {
+ int ret;
+
+ if (currule != Rule && currule != BEGINFILE)
+ fatal(_("`nextfile' cannot be called from a `%s' rule"),
+ ruletab[currule]);
+
+ ret = nextfile(& curfile, true); /* skip current file */
+
+ if (currule == BEGINFILE) {
+ long stack_size;
+
+ ni = pop_exec_state(& currule, & source, & stack_size);
+
+ assert(ni->opcode == Op_K_getline || ni->opcode == Op_newfile);
+
+ /* pop stack returning to the state of Op_K_getline or Op_newfile. */
+ unwind_stack(stack_size);
+
+ if (ret == 0) {
+ /* There was an error opening the file;
+ * don't run ENDFILE block(s).
+ */
+
+ JUMPTO(ni);
+ } else {
+ /* do run ENDFILE block(s) first. */
+
+ /* Execution state to return to in Op_after_endfile. */
+ push_exec_state(ni, currule, source, stack_ptr);
+
+ JUMPTO(pc->target_endfile);
+ }
+ } /* else
+ Start over with the first rule. */
+
+ /* empty the run-time stack to avoid memory leak */
+ pop_stack();
+
+ /* Push an execution state for Op_after_endfile to return to */
+ push_exec_state(pc->target_newfile, currule, source, stack_ptr);
+
+ JUMPTO(pc->target_endfile);
+ }
+ break;
+
+ case Op_K_exit:
+ /* exit not allowed in user-defined comparison functions for "sorted_in";
+ * This is done so that END blocks aren't executed more than once.
+ */
+ if (! currule)
+ fatal(_("`exit' cannot be called in the current context"));
+
+ exiting = true;
+ t1 = POP_NUMBER();
+ exit_val = (int) get_number_si(t1);
+ DEREF(t1);
+#ifdef VMS
+ if (exit_val == 0)
+ exit_val = EXIT_SUCCESS;
+ else if (exit_val == 1)
+ exit_val = EXIT_FAILURE;
+ /* else
+ just pass anything else on through */
+#endif
+
+ if (currule == BEGINFILE || currule == ENDFILE) {
+
+ /* Find the rule of the saved execution state (Op_K_getline/Op_newfile).
+ * This is needed to prevent multiple execution of any END rules:
+ * gawk 'BEGINFILE { exit(1) } \
+ * END { while (getline > 0); }' in1 in2
+ */
+
+ (void) pop_exec_state(& currule, & source, NULL);
+ }
+
+ pop_stack(); /* empty stack, don't leak memory */
+
+ /* Jump to either the first END block instruction
+ * or to Op_atexit.
+ */
+
+ if (currule == END)
+ ni = pc->target_atexit;
+ else
+ ni = pc->target_end;
+ JUMPTO(ni);
+
+ case Op_K_next:
+ if (currule != Rule)
+ fatal(_("`next' cannot be called from a `%s' rule"), ruletab[currule]);
+
+ pop_stack();
+ JUMPTO(pc->target_jmp); /* Op_get_record, read next record */
+
+ case Op_pop:
+ r = POP_SCALAR();
+ DEREF(r);
+ break;
+
+ case Op_line_range:
+ if (pc->triggered) /* evaluate right expression */
+ JUMPTO(pc->target_jmp);
+ /* else
+ evaluate left expression */
+ break;
+
+ case Op_cond_pair:
+ {
+ int result;
+ INSTRUCTION *ip;
+
+ t1 = TOP_SCALAR(); /* from right hand side expression */
+ di = (eval_condition(t1) != 0);
+ DEREF(t1);
+
+ ip = pc->line_range; /* Op_line_range */
+
+ if (! ip->triggered && di) {
+ /* not already triggered and left expression is true */
+ decr_sp();
+ ip->triggered = true;
+ JUMPTO(ip->target_jmp); /* evaluate right expression */
+ }
+
+ result = ip->triggered || di;
+ ip->triggered ^= di; /* update triggered flag */
+ r = node_Boolean[result]; /* final value of condition pair */
+ UPREF(r);
+ REPLACE(r);
+ JUMPTO(pc->target_jmp);
+ }
+
+ case Op_exec_count:
+ if (do_profile)
+ pc->exec_count++;
+ break;
+
+ case Op_no_op:
+ case Op_K_do:
+ case Op_K_while:
+ case Op_K_for:
+ case Op_K_arrayfor:
+ case Op_K_switch:
+ case Op_K_default:
+ case Op_K_if:
+ case Op_K_else:
+ case Op_cond_exp:
+ break;
+
+ default:
+ fatal(_("Sorry, don't know how to interpret `%s'"), opcode2str(op));
+ }
+
+ JUMPTO(pc->nexti);
+
+/* } forever */
+
+ /* not reached */
+ return 0;
+
+#undef mk_sub
+#undef JUMPTO
+}
diff --git a/io.c b/io.c
index c57aef2a..d4f7535f 100644
--- a/io.c
+++ b/io.c
@@ -72,11 +72,15 @@
#include <netdb.h>
#endif /* HAVE_NETDB_H */
+#if defined(HAVE_POPEN_H)
+#include "popen.h"
+#endif
+
#ifndef HAVE_GETADDRINFO
#include "missing_d/getaddrinfo.h"
#endif
-#ifndef AI_ADDRCONFIG /* This is a recent symbol, not everyone has it */
+#ifndef AI_ADDRCONFIG /* not everyone has this symbol */
#define AI_ADDRCONFIG 0
#endif /* AI_ADDRCONFIG */
@@ -132,46 +136,57 @@
#define PIPES_SIMULATED
#endif
+#ifdef HAVE_MPFR
+/* increment NR or FNR */
+#define INCREMENT_REC(X) (do_mpfr && X == (LONG_MAX - 1)) ? \
+ (mpz_add_ui(M##X, M##X, 1), X = 0) : X++
+#else
+#define INCREMENT_REC(X) X++
+#endif
+
typedef enum { CLOSE_ALL, CLOSE_TO, CLOSE_FROM } two_way_close_type;
-/* Several macros make the code a bit clearer: */
-/* */
-/* */
-/* <defines and enums>= */
+/* Several macros to make the code a bit clearer. */
#define at_eof(iop) (((iop)->flag & IOP_AT_EOF) != 0)
#define has_no_data(iop) ((iop)->dataend == NULL)
#define no_data_left(iop) ((iop)->off >= (iop)->dataend)
-/* The key point to the design is to split out the code that searches through */
-/* a buffer looking for the record and the terminator into separate routines, */
-/* with a higher-level routine doing the reading of data and buffer management. */
-/* This makes the code easier to manage; the buffering code is the same independent */
-/* of how we find a record. Communication is via the return value: */
-/* */
-/* */
-/* <defines and enums>= */
+
+/*
+ * The key point to the design is to split out the code that searches through
+ * a buffer looking for the record and the terminator into separate routines,
+ * with a higher-level routine doing the reading of data and buffer management.
+ * This makes the code easier to manage; the buffering code is the same
+ * independent of how we find a record. Communication is via the return
+ * value:
+ */
+
typedef enum recvalues {
REC_OK, /* record and terminator found, recmatch struct filled in */
NOTERM, /* no terminator found, give me more input data */
TERMATEND, /* found terminator at end of buffer */
- TERMNEAREND /* found terminator close to end of buffer, for RE might be bigger */
+ TERMNEAREND /* found terminator close to end of buffer, for when
+ the RE might be match more data further in
+ the file. */
} RECVALUE;
-/* Between calls to a scanning routine, the state is stored in */
-/* an [[enum scanstate]] variable. Not all states apply to all */
-/* variants, but the higher code doesn't really care. */
-/* */
-/* */
-/* <defines and enums>= */
+
+/*
+ * Between calls to a scanning routine, the state is stored in
+ * an enum scanstate variable. Not all states apply to all
+ * variants, but the higher code doesn't really care.
+ */
+
typedef enum scanstate {
NOSTATE, /* scanning not started yet (all) */
INLEADER, /* skipping leading data (RS = "") */
INDATA, /* in body of record (all) */
INTERM /* scanning terminator (RS = "", RS = regexp) */
} SCANSTATE;
-/* When a record is seen ([[REC_OK]] or [[TERMATEND]]), the following */
-/* structure is filled in. */
-/* */
-/* */
-/* <recmatch>= */
+
+/*
+ * When a record is seen (REC_OK or TERMATEND), the following
+ * structure is filled in.
+ */
+
struct recmatch {
char *start; /* record start */
size_t len; /* length of record */
@@ -183,17 +198,21 @@ struct recmatch {
static int iop_close(IOBUF *iop);
struct redirect *redirect(NODE *redir_exp, int redirtype, int *errflg);
static void close_one(void);
-static int close_redir(struct redirect *rp, int exitwarn, two_way_close_type how);
+static int close_redir(struct redirect *rp, bool exitwarn, two_way_close_type how);
#ifndef PIPES_SIMULATED
static int wait_any(int interesting);
#endif
static IOBUF *gawk_popen(const char *cmd, struct redirect *rp);
-static IOBUF *iop_alloc(int fd, const char *name, IOBUF *buf, int do_openhooks);
+static IOBUF *iop_alloc(int fd, const char *name, int errno_val);
+static IOBUF *iop_finish(IOBUF *iop);
static int gawk_pclose(struct redirect *rp);
static int str2mode(const char *mode);
static int two_way_open(const char *str, struct redirect *rp);
static int pty_vs_pipe(const char *command);
-static void find_open_hook(IOBUF *iop);
+static void find_input_parser(IOBUF *iop);
+static bool find_output_wrapper(awk_output_buf_t *outbuf);
+static void init_output_wrapper(awk_output_buf_t *outbuf);
+static bool find_two_way_processor(const char *name, struct redirect *rp);
static RECVALUE rs1scan(IOBUF *iop, struct recmatch *recm, SCANSTATE *state);
static RECVALUE rsnullscan(IOBUF *iop, struct recmatch *recm, SCANSTATE *state);
@@ -206,25 +225,55 @@ static int get_a_record(char **out, IOBUF *iop, int *errcode);
static void free_rp(struct redirect *rp);
static int inetfile(const char *str, int *length, int *family);
-#if defined(HAVE_POPEN_H)
-#include "popen.h"
-#endif
+static NODE *in_PROCINFO(const char *pidx1, const char *pidx2, NODE **full_idx);
+static long get_read_timeout(IOBUF *iop);
+static ssize_t read_with_timeout(int fd, char *buf, size_t size);
+
+static bool read_can_timeout = false;
+static long read_timeout;
+static long read_default_timeout;
static struct redirect *red_head = NULL;
-static NODE *RS;
-static Regexp *RS_re_yes_case;
-static Regexp *RS_re_no_case;
+static NODE *RS = NULL;
+static Regexp *RS_re_yes_case; /* regexp for RS when ignoring case */
+static Regexp *RS_re_no_case; /* regexp for RS when not ignoring case */
static Regexp *RS_regexp;
-int RS_is_null;
+bool RS_is_null;
-extern int output_is_tty;
extern NODE *ARGC_node;
extern NODE *ARGV_node;
extern NODE *ARGIND_node;
-extern NODE *ERRNO_node;
extern NODE **fields_arr;
+/* init_io --- set up timeout related variables */
+
+void
+init_io()
+{
+ long tmout;
+
+ /*
+ * N.B.: all these hacks are to minimize the effect
+ * on programs that do not care about timeout.
+ */
+
+ /* Parse the env. variable only once */
+ tmout = getenv_long("GAWK_READ_TIMEOUT");
+ if (tmout > 0) {
+ read_default_timeout = tmout;
+ read_can_timeout = true;
+ }
+
+ /*
+ * PROCINFO entries for timeout are dynamic;
+ * We can't be any more specific than this.
+ */
+ if (PROCINFO_node != NULL)
+ read_can_timeout = true;
+}
+
+
#if defined(__DJGPP__) || defined(__MINGW32__) || defined(__EMX__) || defined(__CYGWIN__)
/* binmode --- convert BINMODE to string for fopen */
@@ -257,6 +306,8 @@ static int vmsrtl_fileno(fp) FILE *fp; { return fileno(fp); }
#define fileno(FP) (((FP) && *(FP)) ? vmsrtl_fileno(FP) : -1)
#endif /* VMS */
+/* after_beginfile --- reset necessary state after BEGINFILE has run */
+
void
after_beginfile(IOBUF **curfile)
{
@@ -265,51 +316,56 @@ after_beginfile(IOBUF **curfile)
iop = *curfile;
assert(iop != NULL);
- if (iop->fd == INVALID_HANDLE) {
+ /*
+ * Input parsers could have been changed by BEGINFILE,
+ * so delay check until now.
+ */
+
+ find_input_parser(iop);
+
+ if (! iop->valid) {
const char *fname;
int errcode;
+ bool valid;
- fname = iop->name;
+ fname = iop->public.name;
errcode = iop->errcode;
- iop->errcode = 0;
+ valid = iop->valid;
errno = 0;
- update_ERRNO();
+ update_ERRNO_int(errcode);
iop_close(iop);
*curfile = NULL;
- if (errcode == EISDIR && ! do_traditional) {
+ if (! valid && errcode == EISDIR && ! do_traditional) {
warning(_("command line argument `%s' is a directory: skipped"), fname);
return; /* read next file */
}
fatal(_("cannot open file `%s' for reading (%s)"),
fname, strerror(errcode));
}
-
- /*
- * Open hooks could have been changed by BEGINFILE,
- * so delay check until now.
- */
-
- find_open_hook(iop);
}
/* nextfile --- move to the next input data file */
+/*
+ * Return value > 0 ----> run BEGINFILE block
+ * *curfile = NULL ----> hit EOF, run ENDFILE block
+ */
int
-nextfile(IOBUF **curfile, int skipping)
+nextfile(IOBUF **curfile, bool skipping)
{
static long i = 1;
- static int files = FALSE;
+ static bool files = false;
NODE *arg, *tmp;
- static IOBUF mybuf;
const char *fname;
int fd = INVALID_HANDLE;
- int errcode;
+ int errcode = 0;
IOBUF *iop = *curfile;
+ long argc;
if (skipping) { /* for 'nextfile' call */
errcode = 0;
if (iop != NULL) {
- errcode = iop->errcode;
+ errcode = iop->errcode;
(void) iop_close(iop);
}
*curfile = NULL;
@@ -318,7 +374,7 @@ nextfile(IOBUF **curfile, int skipping)
if (iop != NULL) {
if (at_eof(iop)) {
- assert(iop->fd != INVALID_HANDLE);
+ assert(iop->public.fd != INVALID_HANDLE);
(void) iop_close(iop);
*curfile = NULL;
return 1; /* run endfile block */
@@ -326,7 +382,9 @@ nextfile(IOBUF **curfile, int skipping)
return 0;
}
- for (; i < (long) (ARGC_node->lnode->numbr); i++) {
+ argc = get_number_si(ARGC_node->var_value);
+
+ for (; i < argc; i++) {
tmp = make_number((AWKNUM) i);
(void) force_string(tmp);
arg = in_array(ARGV_node, tmp);
@@ -340,46 +398,58 @@ nextfile(IOBUF **curfile, int skipping)
ARGIND_node->var_value = make_number((AWKNUM) i);
}
- if (! arg_assign(arg->stptr, FALSE)) {
- files = TRUE;
+ if (! arg_assign(arg->stptr, false)) {
+ files = true;
fname = arg->stptr;
- errno = 0;
- fd = devopen(fname, binmode("r"));
- errcode = errno;
- if (! do_traditional)
- update_ERRNO();
- /* This is a kludge. */
+ /* manage the awk variables: */
unref(FILENAME_node->var_value);
FILENAME_node->var_value = dupnode(arg);
+#ifdef HAVE_MPFR
+ if (is_mpg_number(FNR_node->var_value))
+ mpz_set_ui(MFNR, 0);
+#endif
FNR = 0;
- iop = *curfile = iop_alloc(fd, fname, &mybuf, FALSE);
- if (fd == INVALID_HANDLE)
+
+ /* IOBUF management: */
+ errno = 0;
+ fd = devopen(fname, binmode("r"));
+ errcode = errno;
+ if (! do_traditional)
+ update_ERRNO_int(errno);
+ iop = iop_alloc(fd, fname, errcode);
+ *curfile = iop_finish(iop);
+ if (iop->public.fd == INVALID_HANDLE)
iop->errcode = errcode;
- else
+ else if (iop->valid)
iop->errcode = 0;
- iop->flag |= IOP_NOFREE_OBJ;
+
+ if (! do_traditional && iop->errcode != 0)
+ update_ERRNO_int(iop->errcode);
+
return ++i; /* run beginfile block */
}
}
- if (files == FALSE) {
- files = TRUE;
+ if (files == false) {
+ files = true;
/* no args. -- use stdin */
/* FNR is init'ed to 0 */
errno = 0;
if (! do_traditional)
- update_ERRNO();
+ update_ERRNO_int(errno);
+
unref(FILENAME_node->var_value);
FILENAME_node->var_value = make_string("-", 1);
FILENAME_node->var_value->flags |= MAYBE_NUM; /* be pedantic */
fname = "-";
- iop = *curfile = iop_alloc(fileno(stdin), fname, &mybuf, FALSE);
- iop->flag |= IOP_NOFREE_OBJ;
- if (iop->fd == INVALID_HANDLE) {
+ iop = iop_alloc(fileno(stdin), fname, 0);
+ *curfile = iop_finish(iop);
+
+ if (iop->public.fd == INVALID_HANDLE) {
errcode = errno;
errno = 0;
- update_ERRNO();
+ update_ERRNO_int(errno);
(void) iop_close(iop);
*curfile = NULL;
fatal(_("cannot open file `%s' for reading (%s)"),
@@ -396,7 +466,14 @@ nextfile(IOBUF **curfile, int skipping)
void
set_FNR()
{
- FNR = (long) FNR_node->var_value->numbr;
+ NODE *n = FNR_node->var_value;
+ (void) force_number(n);
+#ifdef HAVE_MPFR
+ if (is_mpg_number(n))
+ FNR = mpg_set_var(FNR_node);
+ else
+#endif
+ FNR = get_number_si(n);
}
/* set_NR --- update internal NR from awk variable */
@@ -404,7 +481,14 @@ set_FNR()
void
set_NR()
{
- NR = (long) NR_node->var_value->numbr;
+ NODE *n = NR_node->var_value;
+ (void) force_number(n);
+#ifdef HAVE_MPFR
+ if (is_mpg_number(n))
+ NR = mpg_set_var(NR_node);
+ else
+#endif
+ NR = get_number_si(n);
}
/* inrec --- This reads in a record from the input file */
@@ -421,15 +505,15 @@ inrec(IOBUF *iop, int *errcode)
else if ((iop->flag & IOP_CLOSED) != 0)
cnt = EOF;
else
- cnt = get_a_record(&begin, iop, errcode);
+ cnt = get_a_record(& begin, iop, errcode);
if (cnt == EOF) {
retval = 1;
if (*errcode > 0)
- update_ERRNO_saved(*errcode);
+ update_ERRNO_int(*errcode);
} else {
- NR += 1;
- FNR += 1;
+ INCREMENT_REC(NR);
+ INCREMENT_REC(FNR);
set_record(begin, cnt);
}
@@ -445,14 +529,14 @@ remap_std_file(int oldfd)
int ret = -1;
/*
- * Give OS-specific routines in gawkmisc.c chance to interpret
+ * Give OS-specific routines in gawkmisc.c a chance to interpret
* "/dev/null" as appropriate for their platforms.
*/
newfd = os_devopen("/dev/null", O_RDWR);
if (newfd == INVALID_HANDLE)
newfd = open("/dev/null", O_RDWR);
if (newfd >= 0) {
- /* dup2() will close oldfd for us first. */
+ /* if oldfd is open, dup2() will close oldfd for us first. */
ret = dup2(newfd, oldfd);
if (ret == 0)
close(newfd);
@@ -467,15 +551,10 @@ remap_std_file(int oldfd)
static int
iop_close(IOBUF *iop)
{
- int ret;
+ int ret = 0;
if (iop == NULL)
return 0;
- if (iop->fd == INVALID_HANDLE) { /* from nextfile(...) above */
- assert(iop->buf == NULL);
- assert((iop->flag & IOP_NOFREE_OBJ) != 0);
- return 0;
- }
errno = 0;
@@ -487,19 +566,21 @@ iop_close(IOBUF *iop)
* So we remap the standard file to /dev/null.
* Thanks to Jim Meyering for the suggestion.
*/
- if (iop->fd == fileno(stdin)
- || iop->fd == fileno(stdout)
- || iop->fd == fileno(stderr))
- ret = remap_std_file(iop->fd);
- else
- ret = close(iop->fd);
-
- if (iop->close_func != NULL)
- (*iop->close_func)(iop);
+ if (iop->public.close_func != NULL)
+ iop->public.close_func(&iop->public);
+
+ if (iop->public.fd != INVALID_HANDLE) {
+ if (iop->public.fd == fileno(stdin)
+ || iop->public.fd == fileno(stdout)
+ || iop->public.fd == fileno(stderr))
+ ret = remap_std_file(iop->public.fd);
+ else
+ ret = close(iop->public.fd);
+ }
if (ret == -1)
- warning(_("close of fd %d (`%s') failed (%s)"), iop->fd,
- iop->name, strerror(errno));
+ warning(_("close of fd %d (`%s') failed (%s)"), iop->public.fd,
+ iop->public.name, strerror(errno));
/*
* Be careful -- $0 may still reference the buffer even though
* an explicit close is being done; in the future, maybe we
@@ -515,7 +596,7 @@ iop_close(IOBUF *iop)
unref(fields_arr[0]);
fields_arr[0] = t;
/*
- * 1/27/2003: This used to be here:
+ * This used to be here:
*
* reset_record();
*
@@ -527,8 +608,7 @@ iop_close(IOBUF *iop)
efree(iop->buf);
iop->buf = NULL;
}
- if ((iop->flag & IOP_NOFREE_OBJ) == 0)
- efree(iop);
+ efree(iop);
return ret == -1 ? 1 : 0;
}
@@ -568,7 +648,7 @@ redirect(NODE *redir_exp, int redirtype, int *errflg)
const char *mode;
int fd;
const char *what = NULL;
- int new_rp = FALSE;
+ bool new_rp = false;
int len; /* used with /inet */
static struct redirect *save_rp = NULL; /* hold onto rp that should
* be freed for reuse
@@ -623,11 +703,11 @@ redirect(NODE *redir_exp, int redirtype, int *errflg)
lintwarn(_("filename `%s' for `%s' redirection may be result of logical expression"),
str, what);
+#ifdef HAVE_SOCKETS
/*
- * XXX: Use /inet4 and /inet6 with plain /inet being whatever
- * we get back from the system.
+ * Use /inet4 to force IPv4, /inet6 to force IPv6, and plain
+ * /inet will be whatever we get back from the system.
*/
-#ifdef HAVE_SOCKETS
if (inetfile(str, & len, NULL)) {
tflag |= RED_SOCKET;
if (strncmp(str + len, "tcp/", 4) == 0)
@@ -643,7 +723,7 @@ redirect(NODE *redir_exp, int redirtype, int *errflg)
* if at all possible. Messing with signal() for
* SIGCLD leads to lots of headaches. However, if
* we've gotten EOF from a child input pipeline, it's
- * good bet that the child has died. So recover it.
+ * a good bet that the child has died. So recover it.
*/
if ((rp->flag & RED_EOF) && redirtype == redirect_pipein) {
if (rp->pid != -1)
@@ -671,7 +751,7 @@ redirect(NODE *redir_exp, int redirtype, int *errflg)
}
if (rp == NULL) {
- new_rp = TRUE;
+ new_rp = true;
if (save_rp != NULL) {
rp = save_rp;
efree(rp->value);
@@ -682,7 +762,7 @@ redirect(NODE *redir_exp, int redirtype, int *errflg)
str[redir_exp->stlen] = '\0';
rp->value = str;
rp->flag = tflag;
- rp->fp = NULL;
+ init_output_wrapper(& rp->output);
rp->iop = NULL;
rp->pid = -1;
rp->status = 0;
@@ -690,10 +770,10 @@ redirect(NODE *redir_exp, int redirtype, int *errflg)
str = rp->value; /* get \0 terminated string */
save_rp = rp;
- while (rp->fp == NULL && rp->iop == NULL) {
+ while (rp->output.fp == NULL && rp->iop == NULL) {
if (! new_rp && rp->flag & RED_EOF) {
/*
- * encountered EOF on file or pipe -- must be cleared
+ * Encountered EOF on file or pipe -- must be cleared
* by explicit close() before reading more
*/
save_rp = NULL;
@@ -715,12 +795,12 @@ redirect(NODE *redir_exp, int redirtype, int *errflg)
(void) flush_io();
os_restore_mode(fileno(stdin));
- if ((rp->fp = popen(str, binmode("w"))) == NULL)
+ if ((rp->output.fp = popen(str, binmode("w"))) == NULL)
fatal(_("can't open pipe `%s' for output (%s)"),
str, strerror(errno));
/* set close-on-exec */
- os_close_on_exec(fileno(rp->fp), str, "pipe", "to");
+ os_close_on_exec(fileno(rp->output.fp), str, "pipe", "to");
rp->flag |= RED_NOBUF;
break;
case redirect_pipein:
@@ -737,7 +817,15 @@ redirect(NODE *redir_exp, int redirtype, int *errflg)
/* do not free rp, saving it for reuse (save_rp = rp) */
return NULL;
}
- rp->iop = iop_alloc(fd, str, NULL, TRUE);
+ rp->iop = iop_alloc(fd, str, errno);
+ find_input_parser(rp->iop);
+ iop_finish(rp->iop);
+ if (! rp->iop->valid) {
+ if (! do_traditional && rp->iop->errcode != 0)
+ update_ERRNO_int(rp->iop->errcode);
+ iop_close(rp->iop);
+ rp->iop = NULL;
+ }
break;
case redirect_twoway:
direction = "to/from";
@@ -759,15 +847,16 @@ redirect(NODE *redir_exp, int redirtype, int *errflg)
if (mode != NULL) {
errno = 0;
+ rp->output.mode = mode;
fd = devopen(str, mode);
if (fd > INVALID_HANDLE) {
if (fd == fileno(stdin))
- rp->fp = stdin;
+ rp->output.fp = stdin;
else if (fd == fileno(stdout))
- rp->fp = stdout;
+ rp->output.fp = stdout;
else if (fd == fileno(stderr))
- rp->fp = stderr;
+ rp->output.fp = stderr;
else {
const char *omode = mode;
#if defined(F_GETFL) && defined(O_APPEND)
@@ -778,13 +867,13 @@ redirect(NODE *redir_exp, int redirtype, int *errflg)
omode = binmode("a");
#endif
os_close_on_exec(fd, str, "file", "");
- rp->fp = fdopen(fd, (const char *) omode);
+ rp->output.fp = fdopen(fd, (const char *) omode);
rp->mode = (const char *) mode;
/* don't leak file descriptors */
- if (rp->fp == NULL)
+ if (rp->output.fp == NULL)
close(fd);
}
- if (rp->fp != NULL && os_isatty(fd))
+ if (rp->output.fp != NULL && os_isatty(fd))
rp->flag |= RED_NOBUF;
/* Move rp to the head of the list. */
@@ -797,13 +886,14 @@ redirect(NODE *redir_exp, int redirtype, int *errflg)
red_head = rp;
}
}
+ find_output_wrapper(& rp->output);
}
- if (rp->fp == NULL && rp->iop == NULL) {
+ if (rp->output.fp == NULL && rp->iop == NULL) {
/* too many files open -- close one and try again */
if (errno == EMFILE || errno == ENFILE)
close_one();
-#if defined __MINGW32__ || defined __sun
+#if defined __MINGW32__
else if (errno == 0) /* HACK! */
close_one();
#endif
@@ -826,9 +916,8 @@ redirect(NODE *redir_exp, int redirtype, int *errflg)
*/
if (errflg != NULL)
*errflg = errno;
- if (redirtype == redirect_output
- || redirtype == redirect_append
- ) {
+ if ( redirtype == redirect_output
+ || redirtype == redirect_append) {
/* multiple messages make life easier for translators */
if (*direction == 'f')
fatal(_("can't redirect from `%s' (%s)"),
@@ -881,10 +970,10 @@ close_one()
struct redirect *rp;
struct redirect *rplast = NULL;
- static short warned = FALSE;
+ static bool warned = false;
if (do_lint && ! warned) {
- warned = TRUE;
+ warned = true;
lintwarn(_("reached system limit for open files: starting to multiplex file descriptors"));
}
@@ -894,16 +983,16 @@ close_one()
/* now work back up through the list */
for (rp = rplast; rp != NULL; rp = rp->prev) {
/* don't close standard files! */
- if (rp->fp == NULL || rp->fp == stderr || rp->fp == stdout)
+ if (rp->output.fp == NULL || rp->output.fp == stderr || rp->output.fp == stdout)
continue;
if ((rp->flag & (RED_FILE|RED_WRITE)) == (RED_FILE|RED_WRITE)) {
rp->flag |= RED_USED;
errno = 0;
- if (/* do_lint && */ fclose(rp->fp) != 0)
+ if (rp->output.gawk_fclose(rp->output.fp, rp->output.opaque) != 0)
warning(_("close of `%s' failed (%s)."),
rp->value, strerror(errno));
- rp->fp = NULL;
+ rp->output.fp = NULL;
break;
}
}
@@ -954,8 +1043,7 @@ do_close(int nargs)
if (! do_traditional) {
/* update ERRNO manually, using errno = ENOENT is a stretch. */
cp = _("close of redirection that was never opened");
- unref(ERRNO_node->var_value);
- ERRNO_node->var_value = make_string(cp, strlen(cp));
+ update_ERRNO_string(cp);
}
DEREF(tmp);
@@ -963,7 +1051,7 @@ do_close(int nargs)
}
DEREF(tmp);
fflush(stdout); /* synchronize regular output */
- tmp = make_number((AWKNUM) close_redir(rp, FALSE, how));
+ tmp = make_number((AWKNUM) close_redir(rp, false, how));
rp = NULL;
/*
* POSIX says close() returns 0 on success, non-zero otherwise.
@@ -973,7 +1061,7 @@ do_close(int nargs)
*/
if (do_posix) {
unref(tmp);
- return make_number((AWKNUM) 0);
+ tmp = make_number((AWKNUM) 0);
}
return tmp;
}
@@ -988,18 +1076,18 @@ close_rp(struct redirect *rp, two_way_close_type how)
errno = 0;
if ((rp->flag & RED_TWOWAY) != 0) { /* two-way pipe */
/* write end: */
- if ((how == CLOSE_ALL || how == CLOSE_TO) && rp->fp != NULL) {
+ if ((how == CLOSE_ALL || how == CLOSE_TO) && rp->output.fp != NULL) {
#ifdef HAVE_SOCKETS
if ((rp->flag & RED_TCP) != 0)
- (void) shutdown(fileno(rp->fp), SHUT_WR);
+ (void) shutdown(fileno(rp->output.fp), SHUT_WR);
#endif /* HAVE_SOCKETS */
if ((rp->flag & RED_PTY) != 0) {
- fwrite("\004\n", sizeof("\004\n") - 1, 1, rp->fp);
- fflush(rp->fp);
+ rp->output.gawk_fwrite("\004\n", sizeof("\004\n") - 1, 1, rp->output.fp, rp->output.opaque);
+ rp->output.gawk_fflush(rp->output.fp, rp->output.opaque);
}
- status = fclose(rp->fp);
- rp->fp = NULL;
+ status = rp->output.gawk_fclose(rp->output.fp, rp->output.opaque);
+ rp->output.fp = NULL;
}
/* read end: */
@@ -1007,7 +1095,7 @@ close_rp(struct redirect *rp, two_way_close_type how)
if ((rp->flag & RED_SOCKET) != 0 && rp->iop != NULL) {
#ifdef HAVE_SOCKETS
if ((rp->flag & RED_TCP) != 0)
- (void) shutdown(rp->iop->fd, SHUT_RD);
+ (void) shutdown(rp->iop->public.fd, SHUT_RD);
#endif /* HAVE_SOCKETS */
(void) iop_close(rp->iop);
} else
@@ -1015,15 +1103,16 @@ close_rp(struct redirect *rp, two_way_close_type how)
rp->iop = NULL;
}
- } else if ((rp->flag & (RED_PIPE|RED_WRITE)) == (RED_PIPE|RED_WRITE)) { /* write to pipe */
- status = pclose(rp->fp);
+ } else if ((rp->flag & (RED_PIPE|RED_WRITE)) == (RED_PIPE|RED_WRITE)) {
+ /* write to pipe */
+ status = pclose(rp->output.fp);
if ((BINMODE & 1) != 0)
os_setbinmode(fileno(stdin), O_BINARY);
- rp->fp = NULL;
- } else if (rp->fp != NULL) { /* write to file */
- status = fclose(rp->fp);
- rp->fp = NULL;
+ rp->output.fp = NULL;
+ } else if (rp->output.fp != NULL) { /* write to file */
+ status = rp->output.gawk_fclose(rp->output.fp, rp->output.opaque);
+ rp->output.fp = NULL;
} else if (rp->iop != NULL) { /* read from pipe/file */
if ((rp->flag & RED_PIPE) != 0) /* read from pipe */
status = gawk_pclose(rp);
@@ -1040,13 +1129,13 @@ close_rp(struct redirect *rp, two_way_close_type how)
/* close_redir --- close an open file or pipe */
static int
-close_redir(struct redirect *rp, int exitwarn, two_way_close_type how)
+close_redir(struct redirect *rp, bool exitwarn, two_way_close_type how)
{
int status = 0;
if (rp == NULL)
return 0;
- if (rp->fp == stdout || rp->fp == stderr)
+ if (rp->output.fp == stdout || rp->output.fp == stderr)
goto checkwarn; /* bypass closing, remove from list */
if (do_lint && (rp->flag & RED_TWOWAY) == 0 && how != CLOSE_ALL)
@@ -1055,14 +1144,15 @@ close_redir(struct redirect *rp, int exitwarn, two_way_close_type how)
status = close_rp(rp, how);
- /* SVR4 awk checks and warns about status of close */
if (status != 0) {
int save_errno = errno;
char *s = strerror(save_errno);
/*
- * Too many people have complained about this.
- * As of 2.15.6, it is now under lint control.
+ * BWK's awk, as far back as SVR4 (1989) would check
+ * and warn about the status of close. However, when
+ * we did this we got too many complaints, so we moved
+ * it to be under lint control.
*/
if (do_lint) {
if ((rp->flag & RED_PIPE) != 0)
@@ -1075,7 +1165,7 @@ close_redir(struct redirect *rp, int exitwarn, two_way_close_type how)
if (! do_traditional) {
/* set ERRNO too so that program can get at it */
- update_ERRNO_saved(save_errno);
+ update_ERRNO_int(save_errno);
}
}
@@ -1103,7 +1193,7 @@ checkwarn:
}
/* remove it from the list if closing both or both ends have been closed */
- if (how == CLOSE_ALL || (rp->iop == NULL && rp->fp == NULL)) {
+ if (how == CLOSE_ALL || (rp->iop == NULL && rp->output.fp == NULL)) {
if (rp->next != NULL)
rp->next->prev = rp->prev;
if (rp->prev != NULL)
@@ -1135,8 +1225,8 @@ flush_io()
}
for (rp = red_head; rp != NULL; rp = rp->next)
/* flush both files and pipes, what the heck */
- if ((rp->flag & RED_WRITE) && rp->fp != NULL) {
- if (fflush(rp->fp)) {
+ if ((rp->flag & RED_WRITE) && rp->output.fp != NULL) {
+ if (rp->output.gawk_fflush(rp->output.fp, rp->output.opaque)) {
if (rp->flag & RED_PIPE)
warning(_("pipe flush of `%s' failed (%s)."),
rp->value, strerror(errno));
@@ -1157,7 +1247,7 @@ flush_io()
/* close_io --- close all open files, called when exiting */
int
-close_io(int *stdio_problem)
+close_io(bool *stdio_problem)
{
struct redirect *rp;
struct redirect *next;
@@ -1167,7 +1257,7 @@ close_io(int *stdio_problem)
for (rp = red_head; rp != NULL; rp = next) {
next = rp->next;
/*
- * close_redir() will print a message if needed
+ * close_redir() will print a message if needed.
* if do_lint, warn about lack of explicit close
*/
if (close_redir(rp, do_lint, CLOSE_ALL))
@@ -1175,20 +1265,20 @@ close_io(int *stdio_problem)
rp = NULL;
}
/*
- * Some of the non-Unix os's have problems doing an fclose
+ * Some of the non-Unix os's have problems doing an fclose()
* on stdout and stderr. Since we don't really need to close
* them, we just flush them, and do that across the board.
*/
- *stdio_problem = FALSE;
+ *stdio_problem = false;
if (fflush(stdout)) {
warning(_("error writing standard output (%s)"), strerror(errno));
status++;
- *stdio_problem = TRUE;
+ *stdio_problem = true;
}
if (fflush(stderr)) {
warning(_("error writing standard error (%s)"), strerror(errno));
status++;
- *stdio_problem = TRUE;
+ *stdio_problem = true;
}
return status;
}
@@ -1245,34 +1335,34 @@ socketopen(int family, int type, const char *localpname,
struct addrinfo *rres, *rres0;
struct addrinfo rhints;
- int lerror;
- int rerror;
+ int lerror, rerror;
int socket_fd = INVALID_HANDLE;
int any_remote_host = (strcmp(remotehostname, "0") == 0);
- memset (&lhints, '\0', sizeof (lhints));
+ memset(& lhints, '\0', sizeof (lhints));
lhints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
lhints.ai_socktype = type;
lhints.ai_family = family;
- lerror = getaddrinfo (NULL, localpname, &lhints, &lres);
+ lerror = getaddrinfo(NULL, localpname, & lhints, & lres);
if (lerror) {
if (strcmp(localpname, "0") != 0)
fatal(_("local port %s invalid in `/inet'"), localpname);
lres0 = NULL;
- lres = &lhints;
+ lres = & lhints;
} else
lres0 = lres;
while (lres != NULL) {
- memset (&rhints, '\0', sizeof (rhints));
+ memset (& rhints, '\0', sizeof (rhints));
rhints.ai_flags = lhints.ai_flags;
rhints.ai_socktype = lhints.ai_socktype;
rhints.ai_family = lhints.ai_family;
rhints.ai_protocol = lhints.ai_protocol;
- rerror = getaddrinfo (any_remote_host ? NULL : remotehostname, remotepname, &rhints, &rres);
+ rerror = getaddrinfo(any_remote_host ? NULL : remotehostname,
+ remotepname, & rhints, & rres);
if (rerror) {
if (lres0 != NULL)
freeaddrinfo(lres0);
@@ -1296,7 +1386,8 @@ socketopen(int family, int type, const char *localpname,
(char *) & on, sizeof(on));
#ifdef SO_LINGER
linger.l_onoff = 1;
- linger.l_linger = 30; /* linger for 30/100 second */
+ /* linger for 30/100 second */
+ linger.l_linger = 30;
setsockopt(socket_fd, SOL_SOCKET, SO_LINGER,
(char *) & linger, sizeof(linger));
#endif
@@ -1312,12 +1403,12 @@ socketopen(int family, int type, const char *localpname,
int clientsocket_fd = INVALID_HANDLE;
struct sockaddr_storage remote_addr;
- socklen_t namelen = sizeof (remote_addr);
+ socklen_t namelen = sizeof(remote_addr);
if (listen(socket_fd, 1) >= 0
&& (clientsocket_fd = accept(socket_fd,
- (struct sockaddr *) &remote_addr,
- &namelen)) >= 0) {
+ (struct sockaddr *) & remote_addr,
+ & namelen)) >= 0) {
close(socket_fd);
socket_fd = clientsocket_fd;
break;
@@ -1326,15 +1417,15 @@ socketopen(int family, int type, const char *localpname,
#ifdef MSG_PEEK
char buf[10];
struct sockaddr_storage remote_addr;
- socklen_t readle;
+ socklen_t read_len;
if (recvfrom(socket_fd, buf, 1, MSG_PEEK,
(struct sockaddr *) & remote_addr,
- & readle) >= 0
- && readle
+ & read_len) >= 0
+ && read_len
&& connect(socket_fd,
- (struct sockaddr *)& remote_addr,
- readle) == 0)
+ (struct sockaddr *) & remote_addr,
+ read_len) == 0)
break;
#endif
}
@@ -1375,11 +1466,10 @@ devopen(const char *name, const char *mode)
int len;
int family;
- flag = str2mode(mode);
-
if (strcmp(name, "-") == 0)
return fileno(stdin);
+ flag = str2mode(mode);
openfd = INVALID_HANDLE;
if (do_traditional)
@@ -1403,9 +1493,9 @@ devopen(const char *name, const char *mode)
struct stat sbuf;
cp += 3;
- openfd = (int) strtoul(cp, &ptr, 10);
+ openfd = (int) strtoul(cp, & ptr, 10);
if (openfd <= INVALID_HANDLE || ptr == cp
- || fstat(openfd, &sbuf) < 0)
+ || fstat(openfd, & sbuf) < 0)
openfd = INVALID_HANDLE;
}
/* do not set close-on-exec for inherited fd's */
@@ -1468,7 +1558,7 @@ devopen(const char *name, const char *mode)
cp++;
/*
* The remote port ends the special file name.
- * This means there already is a 0 at the end of the string.
+ * This means there already is a '\0' at the end of the string.
* Therefore no need to patch any string ending.
*
* Here too, require a port, let them explicitly put 0 if
@@ -1482,48 +1572,48 @@ devopen(const char *name, const char *mode)
{
#define DEFAULT_RETRIES 20
- static unsigned long def_retries = DEFAULT_RETRIES;
- static int first_time = TRUE;
- unsigned long retries = 0;
- static long msleep = 1000;
-
- if (first_time) {
- char *cp, *end;
- unsigned long count = 0;
- char *ms2;
-
- first_time = FALSE;
- if ((cp = getenv("GAWK_SOCK_RETRIES")) != NULL) {
- count = strtoul(cp, &end, 10);
- if (end != cp && count > 0)
- def_retries = count;
- }
-
- /*
- * Env var is in milliseconds, paramter to usleep()
- * is microseconds, make the conversion. Default is
- * 1 millisecond.
- */
- if ((ms2 = getenv("GAWK_MSEC_SLEEP")) != NULL) {
- msleep = strtol(ms2, &end, 10);
- if (end == ms2 || msleep < 0)
- msleep = 1000;
- else
- msleep *= 1000;
- }
+ static unsigned long def_retries = DEFAULT_RETRIES;
+ static bool first_time = true;
+ unsigned long retries = 0;
+ static long msleep = 1000;
+
+ if (first_time) {
+ char *cp, *end;
+ unsigned long count = 0;
+ char *ms2;
+
+ first_time = false;
+ if ((cp = getenv("GAWK_SOCK_RETRIES")) != NULL) {
+ count = strtoul(cp, & end, 10);
+ if (end != cp && count > 0)
+ def_retries = count;
}
- retries = def_retries;
- do {
- openfd = socketopen(family, protocol, localpname, cp, hostname);
- retries--;
- } while (openfd == INVALID_HANDLE && retries > 0 && usleep(msleep) == 0);
+ /*
+ * Env var is in milliseconds, paramter to usleep()
+ * is microseconds, make the conversion. Default is
+ * 1 millisecond.
+ */
+ if ((ms2 = getenv("GAWK_MSEC_SLEEP")) != NULL) {
+ msleep = strtol(ms2, & end, 10);
+ if (end == ms2 || msleep < 0)
+ msleep = 1000;
+ else
+ msleep *= 1000;
+ }
}
+ retries = def_retries;
+
+ do {
+ openfd = socketopen(family, protocol, localpname, cp, hostname);
+ retries--;
+ } while (openfd == INVALID_HANDLE && retries > 0 && usleep(msleep) == 0);
+ }
- *localpnamelastcharp = '/';
- *hostnameslastcharp = '/';
+ *localpnamelastcharp = '/';
+ *hostnameslastcharp = '/';
#else /* ! HAVE_SOCKETS */
- fatal(_("TCP/IP communications are not supported"));
+ fatal(_("TCP/IP communications are not supported"));
#endif /* HAVE_SOCKETS */
}
@@ -1535,25 +1625,15 @@ strictopen:
/* on OS/2 directory access via open() is not permitted */
struct stat buf;
- if (stat(name, &buf) == 0 && S_ISDIR(buf.st_mode))
- errno = EISDIR;
+ if (stat(name, & buf) == 0 && S_ISDIR(buf.st_mode))
+ errno = EISDIR;
}
#endif
if (openfd != INVALID_HANDLE) {
- if (os_isdir(openfd)) {
- (void) close(openfd); /* don't leak fds */
- /* Set useful error number. */
- errno = EISDIR;
- return INVALID_HANDLE;
- }
-
if (openfd > fileno(stderr))
os_close_on_exec(openfd, name, "file", "");
}
- /*
- * XXX: FIXME: if fd is INVALID_HANDLE, see if an open hook
- * can do something.
- */
+
return openfd;
}
@@ -1562,7 +1642,7 @@ strictopen:
static int
two_way_open(const char *str, struct redirect *rp)
{
- static int no_ptys = FALSE;
+ static bool no_ptys = false;
#ifdef HAVE_SOCKETS
/* case 1: socket */
@@ -1571,32 +1651,43 @@ two_way_open(const char *str, struct redirect *rp)
fd = devopen(str, "rw");
if (fd == INVALID_HANDLE)
- return FALSE;
- rp->fp = fdopen(fd, "w");
- if (rp->fp == NULL) {
+ return false;
+ rp->output.fp = fdopen(fd, "w");
+ if (rp->output.fp == NULL) {
close(fd);
- return FALSE;
+ return false;
}
newfd = dup(fd);
if (newfd < 0) {
- fclose(rp->fp);
- return FALSE;
+ rp->output.gawk_fclose(rp->output.fp, rp->output.opaque);
+ return false;
}
+ os_close_on_exec(fd, str, "socket", "to/from");
os_close_on_exec(newfd, str, "socket", "to/from");
- rp->iop = iop_alloc(newfd, str, NULL, TRUE);
- if (rp->iop == NULL) {
- fclose(rp->fp);
- return FALSE;
+ rp->iop = iop_alloc(newfd, str, 0);
+ find_input_parser(rp->iop);
+ iop_finish(rp->iop);
+ if (! rp->iop->valid) {
+ if (! do_traditional && rp->iop->errcode != 0)
+ update_ERRNO_int(rp->iop->errcode);
+ iop_close(rp->iop);
+ rp->iop = NULL;
+ rp->output.gawk_fclose(rp->output.fp, rp->output.opaque);
+ return false;
}
rp->flag |= RED_SOCKET;
- return TRUE;
+ return true;
}
#endif /* HAVE_SOCKETS */
+ /* case 2: see if an extension wants it */
+ if (find_two_way_processor(str, rp))
+ return true;
+
#if defined(HAVE_TERMIOS_H) && ! defined(ZOS_USS)
- /* case 2: use ptys for two-way communications to child */
+ /* case 3: use ptys for two-way communications to child */
if (! no_ptys && pty_vs_pipe(str)) {
- static int initialized = FALSE;
+ static bool initialized = false;
static char first_pty_letter;
#ifdef HAVE_GRANTPT
static int have_dev_ptmx;
@@ -1609,20 +1700,20 @@ two_way_open(const char *str, struct redirect *rp)
pid_t pid;
struct stat statb;
struct termios st;
- /* Use array of chars to avoid ascii / ebcdic issues */
+ /* Use array of chars to avoid ASCII / EBCDIC issues */
static char pty_chars[] = "pqrstuvwxyzabcdefghijklmno";
int i;
if (! initialized) {
- initialized = TRUE;
+ initialized = true;
#ifdef HAVE_GRANTPT
- have_dev_ptmx = (stat("/dev/ptmx", &statb) >= 0);
+ have_dev_ptmx = (stat("/dev/ptmx", & statb) >= 0);
#endif
i = 0;
do {
c = pty_chars[i++];
sprintf(slavenam, "/dev/pty%c0", c);
- if (stat(slavenam, &statb) >= 0) {
+ if (stat(slavenam, & statb) >= 0) {
first_pty_letter = c;
break;
}
@@ -1650,8 +1741,9 @@ two_way_open(const char *str, struct redirect *rp)
if (first_pty_letter) {
/*
* Assume /dev/ptyXNN and /dev/ttyXN naming system.
- * The FIRST_PTY_LETTER gives the first X to try. We try in the
- * sequence FIRST_PTY_LETTER, .., 'z', 'a', .., FIRST_PTY_LETTER.
+ * The FIRST_PTY_LETTER gives the first X to try.
+ * We try in the sequence FIRST_PTY_LETTER, ..,
+ * 'z', 'a', .., FIRST_PTY_LETTER.
* Is this worthwhile, or just over-zealous?
*/
c = first_pty_letter;
@@ -1661,8 +1753,8 @@ two_way_open(const char *str, struct redirect *rp)
for (i = 0; i < 16; i++) {
sprintf(slavenam, "/dev/pty%c%x", c, i);
- if (stat(slavenam, &statb) < 0) {
- no_ptys = TRUE; /* bypass all this next time */
+ if (stat(slavenam, & statb) < 0) {
+ no_ptys = true; /* bypass all this next time */
goto use_pipes;
}
@@ -1682,7 +1774,7 @@ two_way_open(const char *str, struct redirect *rp)
c = *cp;
} while (c != first_pty_letter);
} else
- no_ptys = TRUE;
+ no_ptys = true;
/* Couldn't find a pty. Fall back to using pipes. */
goto use_pipes;
@@ -1703,7 +1795,7 @@ two_way_open(const char *str, struct redirect *rp)
ioctl(slave, I_PUSH, "ldterm");
#endif
- tcgetattr(slave, &st);
+ tcgetattr(slave, & st);
st.c_iflag &= ~(ISTRIP | IGNCR | INLCR | IXOFF);
st.c_iflag |= (ICRNL | IGNPAR | BRKINT | IXON);
st.c_oflag &= ~OPOST;
@@ -1711,10 +1803,6 @@ two_way_open(const char *str, struct redirect *rp)
st.c_cflag |= CREAD | CS8 | CLOCAL;
st.c_lflag &= ~(ECHO | ECHOE | ECHOK | NOFLSH | TOSTOP);
st.c_lflag |= ISIG;
-#if 0
- st.c_cc[VMIN] = 1;
- st.c_cc[VTIME] = 0;
-#endif
/* Set some control codes to default values */
#ifdef VINTR
@@ -1732,9 +1820,9 @@ two_way_open(const char *str, struct redirect *rp)
#ifdef VEOF
st.c_cc[VEOF] = '\004'; /* ^d */
#endif
- tcsetattr(slave, TCSANOW, &st);
+ tcsetattr(slave, TCSANOW, & st);
- switch (pid = fork ()) {
+ switch (pid = fork()) {
case 0:
/* Child process */
setsid();
@@ -1769,50 +1857,57 @@ two_way_open(const char *str, struct redirect *rp)
save_errno = errno;
close(master);
errno = save_errno;
- return FALSE;
+ return false;
}
/* parent */
- if (close(slave)) {
+ if (close(slave) != 0) {
close(master);
- (void) kill(pid, SIGKILL); /* overkill? (pardon pun) */
+ (void) kill(pid, SIGKILL);
fatal(_("close of slave pty failed (%s)"), strerror(errno));
}
rp->pid = pid;
- rp->iop = iop_alloc(master, str, NULL, TRUE);
- if (rp->iop == NULL) {
- (void) close(master);
- (void) kill(pid, SIGKILL); /* overkill? (pardon pun) */
- return FALSE;
+ rp->iop = iop_alloc(master, str, 0);
+ find_input_parser(rp->iop);
+ iop_finish(rp->iop);
+ if (! rp->iop->valid) {
+ if (! do_traditional && rp->iop->errcode != 0)
+ update_ERRNO_int(rp->iop->errcode);
+ iop_close(rp->iop);
+ rp->iop = NULL;
+ (void) kill(pid, SIGKILL);
+ return false;
}
/*
* Force read and write ends of two-way connection to
* be different fd's so they can be closed independently.
*/
+ rp->output.mode = "w";
if ((dup_master = dup(master)) < 0
- || (rp->fp = fdopen(dup_master, "w")) == NULL) {
+ || (rp->output.fp = fdopen(dup_master, "w")) == NULL) {
iop_close(rp->iop);
rp->iop = NULL;
(void) close(master);
- (void) kill(pid, SIGKILL); /* overkill? (pardon pun) */
+ (void) kill(pid, SIGKILL);
if (dup_master > 0)
(void) close(dup_master);
- return FALSE;
- }
+ return false;
+ } else
+ find_output_wrapper(& rp->output);
rp->flag |= RED_PTY;
os_close_on_exec(master, str, "pipe", "from");
os_close_on_exec(dup_master, str, "pipe", "to");
first_pty_letter = '\0'; /* reset for next command */
- return TRUE;
+ return true;
}
#endif /* defined(HAVE_TERMIOS_H) && ! defined(ZOS_USS) */
use_pipes:
#ifndef PIPES_SIMULATED /* real pipes */
- /* case 3: two way pipe to a child process */
+ /* case 4: two way pipe to a child process */
{
int ptoc[2], ctop[2];
int pid;
@@ -1822,14 +1917,14 @@ use_pipes:
#endif
if (pipe(ptoc) < 0)
- return FALSE; /* errno set, diagnostic from caller */
+ return false; /* errno set, diagnostic from caller */
if (pipe(ctop) < 0) {
save_errno = errno;
close(ptoc[0]);
close(ptoc[1]);
errno = save_errno;
- return FALSE;
+ return false;
}
#ifdef __EMX__
@@ -1837,7 +1932,7 @@ use_pipes:
save_stdout = dup(1); /* duplicate stdout */
if (save_stdout == -1 || save_stdin == -1) {
- /* if an error occurrs close all open file handles */
+ /* if an error occurs close all open file handles */
save_errno = errno;
if (save_stdin != -1)
close(save_stdin);
@@ -1846,7 +1941,7 @@ use_pipes:
close(ptoc[0]); close(ptoc[1]);
close(ctop[0]); close(ctop[1]);
errno = save_errno;
- return FALSE;
+ return false;
}
/* connect pipes to stdin and stdout */
@@ -1900,7 +1995,7 @@ use_pipes:
close(ctop[0]);
errno = save_errno;
- return FALSE;
+ return false;
}
#else /* NOT __EMX__ */
@@ -1909,7 +2004,7 @@ use_pipes:
close(ptoc[0]); close(ptoc[1]);
close(ctop[0]); close(ctop[1]);
errno = save_errno;
- return FALSE;
+ return false;
}
if (pid == 0) { /* child */
@@ -1934,28 +2029,36 @@ use_pipes:
/* parent */
rp->pid = pid;
- rp->iop = iop_alloc(ctop[0], str, NULL, TRUE);
- if (rp->iop == NULL) {
- (void) close(ctop[0]);
+ rp->iop = iop_alloc(ctop[0], str, 0);
+ find_input_parser(rp->iop);
+ iop_finish(rp->iop);
+ if (! rp->iop->valid) {
+ if (! do_traditional && rp->iop->errcode != 0)
+ update_ERRNO_int(rp->iop->errcode);
+ iop_close(rp->iop);
+ rp->iop = NULL;
(void) close(ctop[1]);
(void) close(ptoc[0]);
(void) close(ptoc[1]);
- (void) kill(pid, SIGKILL); /* overkill? (pardon pun) */
+ (void) kill(pid, SIGKILL);
- return FALSE;
+ return false;
}
- rp->fp = fdopen(ptoc[1], "w");
- if (rp->fp == NULL) {
+ rp->output.fp = fdopen(ptoc[1], "w");
+ rp->output.mode = "w";
+ if (rp->output.fp == NULL) {
iop_close(rp->iop);
rp->iop = NULL;
(void) close(ctop[0]);
(void) close(ctop[1]);
(void) close(ptoc[0]);
(void) close(ptoc[1]);
- (void) kill(pid, SIGKILL); /* overkill? (pardon pun) */
+ (void) kill(pid, SIGKILL);
- return FALSE;
+ return false;
}
+ else
+ find_output_wrapper(& rp->output);
#ifndef __EMX__
os_close_on_exec(ctop[0], str, "pipe", "from");
@@ -1965,14 +2068,14 @@ use_pipes:
(void) close(ctop[1]);
#endif
- return TRUE;
+ return true;
}
#else /*PIPES_SIMULATED*/
fatal(_("`|&' not supported"));
/*NOTREACHED*/
- return FALSE;
+ return false;
#endif
}
@@ -1994,9 +2097,9 @@ wait_any(int interesting) /* pid of interest, if any */
qstat = signal(SIGQUIT, SIG_IGN);
for (;;) {
#ifdef HAVE_SYS_WAIT_H /* POSIX compatible sys/wait.h */
- pid = wait(&status);
+ pid = wait(& status);
#else
- pid = wait((union wait *)&status);
+ pid = wait((union wait *) & status);
#endif
if (interesting && pid == interesting) {
break;
@@ -2029,27 +2132,31 @@ gawk_popen(const char *cmd, struct redirect *rp)
#endif
/*
- * used to wait for any children to synchronize input and output,
+ * We used to wait for any children to synchronize input and output,
* but this could cause gawk to hang when it is started in a pipeline
- * and thus has a child process feeding it input (shell dependent)
+ * and thus has a child process feeding it input (shell dependent).
+ *
+ * (void) wait_any(0); // wait for outstanding processes
*/
- /*(void) wait_any(0);*/ /* wait for outstanding processes */
if (pipe(p) < 0)
fatal(_("cannot open pipe `%s' (%s)"), cmd, strerror(errno));
#ifdef __EMX__
- save_stdout = dup(1); /* save stdout */
rp->iop = NULL;
+ save_stdout = dup(1); /* save stdout */
if (save_stdout == -1) {
- close(p[0]); close(p[1]);
- return rp->iop; /* failed */
+ close(p[0]);
+ close(p[1]);
+ return NULL; /* failed */
}
close(1); /* close stdout */
if (dup(p[1]) != 1) {
- close(p[0]); close(p[1]);
- fatal(_("moving pipe to stdout in child failed (dup: %s)"), strerror(errno));
+ close(p[0]);
+ close(p[1]);
+ fatal(_("moving pipe to stdout in child failed (dup: %s)"),
+ strerror(errno));
}
/* none of these handles must be inherited by the child process */
@@ -2094,9 +2201,15 @@ gawk_popen(const char *cmd, struct redirect *rp)
}
#endif
os_close_on_exec(p[0], cmd, "pipe", "from");
- rp->iop = iop_alloc(p[0], cmd, NULL, TRUE);
- if (rp->iop == NULL)
- (void) close(p[0]);
+ rp->iop = iop_alloc(p[0], cmd, 0);
+ find_input_parser(rp->iop);
+ iop_finish(rp->iop);
+ if (! rp->iop->valid) {
+ if (! do_traditional && rp->iop->errcode != 0)
+ update_ERRNO_int(rp->iop->errcode);
+ iop_close(rp->iop);
+ rp->iop = NULL;
+ }
return rp->iop;
}
@@ -2139,9 +2252,16 @@ gawk_popen(const char *cmd, struct redirect *rp)
if (current == NULL)
return NULL;
os_close_on_exec(fileno(current), cmd, "pipe", "from");
- rp->iop = iop_alloc(fileno(current), cmd, NULL, TRUE);
- if (rp->iop == NULL) {
+ rp->iop = iop_alloc(fileno(current), cmd, 0);
+ find_input_parser(rp->iop);
+ iop_finish(rp->iop);
+ if (! rp->iop->valid) {
+ if (! do_traditional && rp->iop->errcode != 0)
+ update_ERRNO_int(rp->iop->errcode);
(void) pclose(current);
+ rp->iop->public.fd = INVALID_HANDLE;
+ iop_close(rp->iop);
+ rp->iop = NULL;
current = NULL;
}
rp->ifp = current;
@@ -2153,10 +2273,10 @@ gawk_popen(const char *cmd, struct redirect *rp)
static int
gawk_pclose(struct redirect *rp)
{
- int rval, aval, fd = rp->iop->fd;
+ int rval, aval, fd = rp->iop->public.fd;
if (rp->iop != NULL) {
- rp->iop->fd = dup(fd); /* kludge to allow close() + pclose() */
+ rp->iop->public.fd = dup(fd); /* kludge to allow close() + pclose() */
rval = iop_close(rp->iop);
}
rp->iop = NULL;
@@ -2170,7 +2290,7 @@ gawk_pclose(struct redirect *rp)
/* do_getline --- read in a line, into var and with redirection */
NODE *
-do_getline_redir(int intovar, int redirtype)
+do_getline_redir(int into_variable, enum redirval redirtype)
{
struct redirect *rp = NULL;
IOBUF *iop;
@@ -2181,18 +2301,18 @@ do_getline_redir(int intovar, int redirtype)
NODE **lhs = NULL;
int redir_error = 0;
- if (intovar)
+ if (into_variable)
lhs = POP_ADDRESS();
- assert(redirtype != 0);
+ assert(redirtype != redirect_none);
redir_exp = TOP();
- rp = redirect(redir_exp, redirtype, &redir_error);
+ rp = redirect(redir_exp, redirtype, & redir_error);
DEREF(redir_exp);
decr_sp();
if (rp == NULL) {
if (redir_error) { /* failed redirect */
if (! do_traditional)
- update_ERRNO_saved(redir_error);
+ update_ERRNO_int(redir_error);
}
return make_number((AWKNUM) -1.0);
}
@@ -2201,10 +2321,10 @@ do_getline_redir(int intovar, int redirtype)
return make_number((AWKNUM) 0.0);
errcode = 0;
- cnt = get_a_record(&s, iop, &errcode);
+ cnt = get_a_record(& s, iop, & errcode);
if (errcode != 0) {
if (! do_traditional && (errcode != -1))
- update_ERRNO_saved(errcode);
+ update_ERRNO_int(errcode);
return make_number((AWKNUM) -1.0);
}
@@ -2236,34 +2356,34 @@ do_getline_redir(int intovar, int redirtype)
/* do_getline --- read in a line, into var and without redirection */
NODE *
-do_getline(int intovar, IOBUF *iop)
+do_getline(int into_variable, IOBUF *iop)
{
int cnt = EOF;
char *s = NULL;
int errcode;
if (iop == NULL) { /* end of input */
- if (intovar)
+ if (into_variable)
(void) POP_ADDRESS();
return make_number((AWKNUM) 0.0);
}
errcode = 0;
- cnt = get_a_record(&s, iop, &errcode);
+ cnt = get_a_record(& s, iop, & errcode);
if (errcode != 0) {
if (! do_traditional && (errcode != -1))
- update_ERRNO_saved(errcode);
- if (intovar)
+ update_ERRNO_int(errcode);
+ if (into_variable)
(void) POP_ADDRESS();
return make_number((AWKNUM) -1.0);
}
if (cnt == EOF)
return NULL; /* try next file */
- NR++;
- FNR++;
+ INCREMENT_REC(NR);
+ INCREMENT_REC(FNR);
- if (! intovar) /* no optional var. */
+ if (! into_variable) /* no optional var. */
set_record(s, cnt);
else { /* assignment to variable */
NODE **lhs;
@@ -2275,35 +2395,45 @@ do_getline(int intovar, IOBUF *iop)
return make_number((AWKNUM) 1.0);
}
+typedef struct {
+ const char *envname;
+ char **dfltp; /* pointer to address of default path */
+ char try_cwd; /* always search current directory? */
+ char **awkpath; /* array containing library search paths */
+ int max_pathlen; /* length of the longest item in awkpath */
+} path_info;
+
+static path_info pi_awkpath = {
+ /* envname */ "AWKPATH",
+ /* dfltp */ & defpath,
+ /* try_cwd */ true,
+};
-static char **awkpath = NULL; /* array containing library search paths */
-static int max_pathlen; /* length of the longest item in awkpath */
+static path_info pi_awklibpath = {
+ /* envname */ "AWKLIBPATH",
+ /* dfltp */ & deflibpath,
+ /* try_cwd */ false,
+};
/* init_awkpath --- split path(=$AWKPATH) into components */
static void
-init_awkpath(char *path)
+init_awkpath(path_info *pi)
{
+ char *path;
char *start, *end, *p;
int len, i;
- static int max_path = 0;
+ int max_path; /* (# of allocated paths)-1 */
#define INC_PATH 5
- max_pathlen = 0;
- if (path == NULL || *path == '\0')
- path = defpath;
+ pi->max_pathlen = 0;
+ if ((path = getenv(pi->envname)) == NULL || *path == '\0')
+ path = pi->dfltp[0];
- for (i = 0; i < max_path && awkpath[i]; i++) {
- efree(awkpath[i]);
- awkpath[i] = NULL;
- }
-
- if (max_path == 0) {
- max_path = INC_PATH;
- emalloc(awkpath, char **, (max_path + 1) * sizeof(char *), "init_awkpath");
- memset(awkpath, 0, (max_path + 1) * sizeof(char *));
- }
+ max_path = INC_PATH;
+ emalloc(pi->awkpath, char **, (max_path + 1) * sizeof(char *), "init_awkpath");
+ memset(pi->awkpath, 0, (max_path + 1) * sizeof(char *));
end = start = path;
i = 0;
@@ -2316,18 +2446,18 @@ init_awkpath(char *path)
memcpy(p, start, len);
/* add directory punctuation if necessary */
- if (! isdirpunct(*(end - 1)))
+ if (! isdirpunct(end[-1]))
p[len++] = '/';
p[len] = '\0';
if (i == max_path) {
max_path += INC_PATH;
- erealloc(awkpath, char **, (max_path + 1) * sizeof(char *), "init_awkpath");
- memset(awkpath + i, 0, (INC_PATH + 1) * sizeof(char *));
+ erealloc(pi->awkpath, char **, (max_path + 1) * sizeof(char *), "init_awkpath");
+ memset(pi->awkpath + i, 0, (INC_PATH + 1) * sizeof(char *));
}
- awkpath[i++] = p;
- if (len > max_pathlen)
- max_pathlen = len;
+ pi->awkpath[i++] = p;
+ if (len > pi->max_pathlen)
+ pi->max_pathlen = len;
}
/* skip one or more envsep char */
@@ -2335,15 +2465,39 @@ init_awkpath(char *path)
end++;
start = end;
}
- awkpath[i] = NULL;
+ pi->awkpath[i] = NULL;
#undef INC_PATH
}
+/* get_cwd -- get current working directory */
+
+static char *
+get_cwd ()
+{
+#define BSIZE 100
+ char *buf;
+ size_t bsize = BSIZE;
+
+ emalloc(buf, char *, bsize * sizeof(char), "get_cwd");
+ while (true) {
+ if (getcwd(buf, bsize) == buf)
+ return buf;
+ if (errno != ERANGE) {
+ efree(buf);
+ return NULL;
+ }
+ bsize *= 2;
+ erealloc(buf, char *, bsize * sizeof(char), "get_cwd");
+ }
+#undef BSIZE
+}
+
+
/* do_find_source --- search $AWKPATH for file, return NULL if not found */
static char *
-do_find_source(const char *src, struct stat *stb, int *errcode)
+do_find_source(const char *src, struct stat *stb, int *errcode, path_info *pi)
{
char *path;
int i;
@@ -2361,22 +2515,28 @@ do_find_source(const char *src, struct stat *stb, int *errcode)
return NULL;
}
- /* try current directory before path search */
- if (stat(src, stb) == 0) {
- emalloc(path, char *, strlen(src) + 1, "do_find_source");
- strcpy(path, src);
+ /* try current directory before $AWKPATH search */
+ if (pi->try_cwd && stat(src, stb) == 0) {
+ path = get_cwd();
+ if (path == NULL) {
+ *errcode = errno;
+ return NULL;
+ }
+ erealloc(path, char *, strlen(path) + strlen(src) + 2, "do_find_source");
+ strcat(path, "/");
+ strcat(path, src);
return path;
}
- if (awkpath == NULL)
- init_awkpath(getenv("AWKPATH"));
+ if (pi->awkpath == NULL)
+ init_awkpath(pi);
- emalloc(path, char *, max_pathlen + strlen(src) + 1, "do_find_source");
- for (i = 0; awkpath[i] != NULL; i++) {
- if (strcmp(awkpath[i], "./") == 0 || strcmp(awkpath[i], ".") == 0) {
+ emalloc(path, char *, pi->max_pathlen + strlen(src) + 1, "do_find_source");
+ for (i = 0; pi->awkpath[i] != NULL; i++) {
+ if (strcmp(pi->awkpath[i], "./") == 0 || strcmp(pi->awkpath[i], ".") == 0)
*path = '\0';
- } else
- strcpy(path, awkpath[i]);
+ else
+ strcpy(path, pi->awkpath[i]);
strcat(path, src);
if (stat(path, stb) == 0)
return path;
@@ -2391,19 +2551,54 @@ do_find_source(const char *src, struct stat *stb, int *errcode)
/* find_source --- find source file with default file extension handling */
char *
-find_source(const char *src, struct stat *stb, int *errcode)
+find_source(const char *src, struct stat *stb, int *errcode, int is_extlib)
{
char *path;
+ path_info *pi = (is_extlib ? & pi_awklibpath : & pi_awkpath);
*errcode = 0;
if (src == NULL || *src == '\0')
return NULL;
- path = do_find_source(src, stb, errcode);
+ path = do_find_source(src, stb, errcode, pi);
+
+ if (path == NULL && is_extlib) {
+ char *file_ext;
+ int save_errno;
+ size_t src_len;
+ size_t suffix_len;
+
+#define EXTLIB_SUFFIX "." SHLIBEXT
+ src_len = strlen(src);
+ suffix_len = strlen(EXTLIB_SUFFIX);
+
+ /* check if already has the SUFFIX */
+ if (src_len >= suffix_len && strcmp(& src[src_len - suffix_len], EXTLIB_SUFFIX) == 0)
+ return NULL;
+
+ /* append EXTLIB_SUFFIX and try again */
+ save_errno = errno;
+ emalloc(file_ext, char *, src_len + suffix_len + 1, "find_source");
+ sprintf(file_ext, "%s%s", src, EXTLIB_SUFFIX);
+ path = do_find_source(file_ext, stb, errcode, pi);
+ efree(file_ext);
+ if (path == NULL)
+ errno = save_errno;
+ return path;
+#undef EXTLIB_SUFFIX
+ }
+
+/*
+ * Try searching with .awk appended if the platform headers have not specified
+ * another suffix.
+ */
+#ifndef DEFAULT_FILETYPE
+#define DEFAULT_FILETYPE ".awk"
+#endif
#ifdef DEFAULT_FILETYPE
if (! do_traditional && path == NULL) {
char *file_awk;
- int save = errno;
+ int save_errno = errno;
#ifdef VMS
int vms_save = vaxc$errno;
#endif
@@ -2412,10 +2607,10 @@ find_source(const char *src, struct stat *stb, int *errcode)
emalloc(file_awk, char *, strlen(src) +
sizeof(DEFAULT_FILETYPE) + 1, "find_source");
sprintf(file_awk, "%s%s", src, DEFAULT_FILETYPE);
- path = do_find_source(file_awk, stb, errcode);
+ path = do_find_source(file_awk, stb, errcode, pi);
efree(file_awk);
if (path == NULL) {
- errno = save;
+ errno = save_errno;
#ifdef VMS
vaxc$errno = vms_save;
#endif
@@ -2426,122 +2621,316 @@ find_source(const char *src, struct stat *stb, int *errcode)
return path;
}
+
/* srcopen --- open source file */
int
srcopen(SRCFILE *s)
{
if (s->stype == SRC_STDIN)
- return (0);
+ return fileno(stdin);
if (s->stype == SRC_FILE || s->stype == SRC_INC)
return devopen(s->fullpath, "r");
return INVALID_HANDLE;
}
-#ifdef TEST
-int bufsize = 8192;
+/* input parsers, mainly for use by extension functions */
+
+static awk_input_parser_t *ip_head, *ip_tail;
+
+/*
+ * register_input_parser --- add an input parser to the list, FIFO.
+ * The main reason to use FIFO is to provide the diagnostic
+ * with the correct information: input parser 2 conflicts
+ * with input parser 1. Otherwise LIFO would have been easier.
+ */
void
-fatal(const char *s)
+register_input_parser(awk_input_parser_t *input_parser)
{
- printf("%s\n", s);
- exit(EXIT_FAILURE);
+ if (input_parser == NULL)
+ fatal(_("register_input_parser: received NULL pointer"));
+
+ input_parser->next = NULL; /* force it */
+ if (ip_head == NULL) {
+ ip_head = ip_tail = input_parser;
+ } else {
+ ip_tail->next = input_parser;
+ ip_tail = ip_tail->next;
+ }
}
-#endif
-/* open hooks, mainly for use by extension functions */
+/* find_input_parser --- search the list of input parsers */
+
+static void
+find_input_parser(IOBUF *iop)
+{
+ awk_input_parser_t *ip, *ip2;
+
+ /* if already associated with an input parser, bail out early */
+ if (iop->public.get_record != NULL)
+ return;
+
+ ip = ip2 = NULL;
+ for (ip2 = ip_head; ip2 != NULL; ip2 = ip2->next) {
+ if (ip2->can_take_file(& iop->public)) {
+ if (ip == NULL)
+ ip = ip2; /* found first one */
+ else
+ fatal(_("input parser `%s' conflicts with previously installed input parser `%s'"),
+ ip2->name, ip->name);
+ }
+ }
+
+ if (ip != NULL) {
+ if (! ip->take_control_of(& iop->public))
+ warning(_("input parser `%s' failed to open `%s'"),
+ ip->name, iop->public.name);
+ else
+ iop->valid = true;
+ }
+}
-static struct open_hook {
- struct open_hook *next;
- void *(*open_func)(IOBUF *);
-} *open_hooks;
+/* output wrappers --- for use by extensions */
-/* register_open_hook --- add an open hook to the list */
+static awk_output_wrapper_t *op_head, *op_tail;
+
+/*
+ * register_output_wrapper --- add an output wrapper to the list.
+ * Same stuff here as for input parsers.
+ */
void
-register_open_hook(void *(*open_func)(IOBUF *))
+register_output_wrapper(awk_output_wrapper_t *wrapper)
{
- struct open_hook *oh;
+ if (wrapper == NULL)
+ fatal(_("register_output_wrapper: received NULL pointer"));
- emalloc(oh, struct open_hook *, sizeof(*oh), "register_open_hook");
- oh->open_func = open_func;
- oh->next = open_hooks;
- open_hooks = oh;
+ wrapper->next = NULL; /* force it */
+ if (op_head == NULL) {
+ op_head = op_tail = wrapper;
+ } else {
+ op_tail->next = wrapper;
+ op_tail = op_tail->next;
+ }
}
-/* find_open_hook --- search the list of open hooks */
+/* find_output_wrapper --- search the list of output wrappers */
-static void
-find_open_hook(IOBUF *iop)
+static bool
+find_output_wrapper(awk_output_buf_t *outbuf)
{
- struct open_hook *oh;
+ awk_output_wrapper_t *op, *op2;
- /* walk through open hooks, stop at first one that responds */
- for (oh = open_hooks; oh != NULL; oh = oh->next) {
- if ((iop->opaque = (*oh->open_func)(iop)) != NULL)
- break;
+ /* if already associated with an output wrapper, bail out early */
+ if (outbuf->redirected)
+ return false;
+
+ op = op2 = NULL;
+ for (op2 = op_head; op2 != NULL; op2 = op2->next) {
+ if (op2->can_take_file(outbuf)) {
+ if (op == NULL)
+ op = op2; /* found first one */
+ else
+ fatal(_("output wrapper `%s' conflicts with previously installed output wrapper `%s'"),
+ op2->name, op->name);
+ }
+ }
+
+ if (op != NULL) {
+ if (! op->take_control_of(outbuf)) {
+ warning(_("output wrapper `%s' failed to open `%s'"),
+ op->name, outbuf->name);
+ return false;
+ }
+ return true;
+ }
+
+ return false;
+}
+
+
+/* two way processors --- for use by extensions */
+
+static awk_two_way_processor_t *tw_head, *tw_tail;
+
+/* register_two_way_processor --- register a two-way I/O processor, for extensions */
+
+void
+register_two_way_processor(awk_two_way_processor_t *processor)
+{
+ if (processor == NULL)
+ fatal(_("register_output_processor: received NULL pointer"));
+
+ processor->next = NULL; /* force it */
+ if (tw_head == NULL) {
+ tw_head = tw_tail = processor;
+ } else {
+ tw_tail->next = processor;
+ tw_tail = tw_tail->next;
+ }
+}
+
+/* find_two_way_processor --- search the list of two way processors */
+
+static bool
+find_two_way_processor(const char *name, struct redirect *rp)
+{
+ awk_two_way_processor_t *tw, *tw2;
+
+ /* if already associated with i/o, bail out early */
+ if ( (rp->iop != NULL && rp->iop->public.fd != INVALID_HANDLE)
+ || rp->output.fp != NULL)
+ return false;
+
+ tw = tw2 = NULL;
+ for (tw2 = tw_head; tw2 != NULL; tw2 = tw2->next) {
+ if (tw2->can_take_two_way(name)) {
+ if (tw == NULL)
+ tw = tw2; /* found first one */
+ else
+ fatal(_("two-way processor `%s' conflicts with previously installed two-way processor `%s'"),
+ tw2->name, tw->name);
+ }
+ }
+
+ if (tw != NULL) {
+ if (rp->iop == NULL)
+ rp->iop = iop_alloc(INVALID_HANDLE, name, 0);
+ if (! tw->take_control_of(name, & rp->iop->public, & rp->output)) {
+ warning(_("two way processor `%s' failed to open `%s'"),
+ tw->name, name);
+ return false;
+ }
+ iop_finish(rp->iop);
+ return true;
}
+
+ return false;
}
+/*
+ * IOBUF management is somewhat complicated. In particular,
+ * it is possible and OK for an IOBUF to be allocated with
+ * a file descriptor that is either valid or not usable with
+ * read(2), in case an input parser will come along later and
+ * make it readable. Alternatively, an input parser can simply
+ * come along and take over reading on a valid readable descriptor.
+ *
+ * The first stage is simply to allocate the IOBUF. This is done
+ * during nextfile() for command line files and by redirect()
+ * and other routines for getline, input pipes, and the input
+ * side of a two-way pipe.
+ *
+ * The second stage is to check for input parsers. This is done
+ * for command line files in after_beginfile() and for the others
+ * as part of the full flow. At this point, either:
+ * - The fd is valid on a readable file
+ * - The input parser has taken over a valid fd and made
+ * it usable (e.g., directories)
+ * - Or the input parser has simply hijacked the reading
+ * (such as the gawkextlib XML extension)
+ * If none of those are true, the fd should be closed, reset
+ * to INVALID_HANDLE, and iop->errcode set to indicate the error
+ * (EISDIR for directories, EIO for anything else).
+ * iop->valid should be set to false in this case.
+ *
+ * Otherwise, after the second stage, iop->errcode should be
+ * zero, iop->valid should be true, and iop->public.fd should
+ * not be INVALID_HANDLE.
+ *
+ * The third stage is to set up the rest of the IOBUF for
+ * use by get_a_record(). In this case, iop->valid must
+ * be true already, and iop->public.fd cannot be INVALID_HANDLE.
+ *
+ * Checking for input parsers for command line files is delayed
+ * to after_beginfile() so that the BEGINFILE rule has an
+ * opportunity to look at FILENAME and ERRNO and attempt to
+ * recover with a custom input parser. The XML extension, in
+ * particular, relies strongly upon this ability.
+ */
+
/* iop_alloc --- allocate an IOBUF structure for an open fd */
static IOBUF *
-iop_alloc(int fd, const char *name, IOBUF *iop, int do_openhooks)
+iop_alloc(int fd, const char *name, int errno_val)
{
- struct stat sbuf;
- int iop_malloced = FALSE;
+ IOBUF *iop;
+
+ emalloc(iop, IOBUF *, sizeof(IOBUF), "iop_alloc");
- if (iop == NULL) {
- emalloc(iop, IOBUF *, sizeof(IOBUF), "iop_alloc");
- iop_malloced = TRUE;
- }
memset(iop, '\0', sizeof(IOBUF));
- iop->flag = 0;
- iop->fd = fd;
- iop->name = name;
+ iop->public.fd = fd;
+ iop->public.name = name;
+ iop->read_func = ( ssize_t(*)() ) read;
+ iop->valid = false;
+ iop->errcode = errno_val;
- if (do_openhooks)
- find_open_hook(iop);
- else if (iop->fd == INVALID_HANDLE)
- return iop;
+ if (fd != INVALID_HANDLE)
+ fstat(fd, & iop->public.sbuf);
- /* test reached if tried to find open hook and could not */
- if (iop->fd == INVALID_HANDLE) {
- if (iop_malloced)
- efree(iop);
- return NULL;
+ return iop;
+}
+
+/* iop_finish --- finish setting up an IOBUF */
+
+static IOBUF *
+iop_finish(IOBUF *iop)
+{
+ bool isdir = false;
+
+ if (iop->public.fd != INVALID_HANDLE) {
+ if (os_isreadable(& iop->public, & isdir))
+ iop->valid = true;
+ else {
+ if (isdir)
+ iop->errcode = EISDIR;
+ else {
+ iop->errcode = EIO;
+ (void) close(iop->public.fd);
+ iop->public.fd = INVALID_HANDLE;
+ }
+ /*
+ * Don't close directories: after_beginfile(),
+ * special cases them.
+ */
+ }
}
- if (os_isatty(iop->fd))
+ if (! iop->valid || iop->public.fd == INVALID_HANDLE)
+ return iop;
+
+ if (os_isatty(iop->public.fd))
iop->flag |= IOP_IS_TTY;
- iop->readsize = iop->size = optimal_bufsize(iop->fd, & sbuf);
- iop->sbuf = sbuf;
- if (do_lint && S_ISREG(sbuf.st_mode) && sbuf.st_size == 0)
- lintwarn(_("data file `%s' is empty"), name);
- errno = 0;
+
+ iop->readsize = iop->size = optimal_bufsize(iop->public.fd, & iop->public.sbuf);
+ if (do_lint && S_ISREG(iop->public.sbuf.st_mode) && iop->public.sbuf.st_size == 0)
+ lintwarn(_("data file `%s' is empty"), iop->public.name);
+ iop->errcode = errno = 0;
iop->count = iop->scanoff = 0;
- emalloc(iop->buf, char *, iop->size += 2, "iop_alloc");
+ emalloc(iop->buf, char *, iop->size += 2, "iop_finish");
iop->off = iop->buf;
iop->dataend = NULL;
iop->end = iop->buf + iop->size;
iop->flag |= IOP_AT_START;
+
return iop;
}
#define set_RT_to_null() \
(void)(! do_traditional && (unref(RT_node->var_value), \
- RT_node->var_value = Nnull_string))
+ RT_node->var_value = dupnode(Nnull_string)))
#define set_RT(str, len) \
(void)(! do_traditional && (unref(RT_node->var_value), \
RT_node->var_value = make_string(str, len)))
-/* grow must increase size of buffer, set end, make sure off and dataend point at */
-/* right spot. */
-/* */
-/* */
-/* <growbuffer>= */
-/* grow_iop_buffer --- grow the buffer */
+/*
+ * grow_iop_buffer:
+ *
+ * grow must increase size of buffer, set end, make sure off and dataend
+ * point at the right spot.
+ */
static void
grow_iop_buffer(IOBUF *iop)
@@ -2575,10 +2964,8 @@ grow_iop_buffer(IOBUF *iop)
iop->end = iop->buf + iop->size;
}
-/* Here are the routines. */
-/* */
-/* */
-/* <rs1scan>= */
+/* Here are the routines. */
+
/* rs1scan --- scan for a single character record terminator */
static RECVALUE
@@ -2659,19 +3046,19 @@ rs1scan(IOBUF *iop, struct recmatch *recm, SCANSTATE *state)
int len = iop->dataend - bp;
int found = 0;
- memset(&mbs, 0, sizeof(mbstate_t));
+ memset(& mbs, 0, sizeof(mbstate_t));
do {
if (*bp == rs)
found = 1;
if (is_valid_character(*bp))
mbclen = 1;
else
- mbclen = mbrlen(bp, len, &mbs);
- if ( (mbclen == 1)
- || (mbclen == (size_t) -1)
- || (mbclen == (size_t) -2)
- || (mbclen == 0)) {
- /* We treat it as a singlebyte character. */
+ mbclen = mbrlen(bp, len, & mbs);
+ if ( mbclen == 1
+ || mbclen == (size_t) -1
+ || mbclen == (size_t) -2
+ || mbclen == 0) {
+ /* We treat it as a single-byte character. */
mbclen = 1;
}
len -= mbclen;
@@ -2681,8 +3068,8 @@ rs1scan(IOBUF *iop, struct recmatch *recm, SCANSTATE *state)
/* Check that newline found isn't the sentinel. */
if (found && (bp - mbclen) < iop->dataend) {
/*
- * set len to what we have so far, in case this is
- * all there is
+ * Set len to what we have so far, in case this is
+ * all there is.
*/
recm->len = bp - recm->start - mbclen;
recm->rt_start = bp - mbclen;
@@ -2716,7 +3103,6 @@ rs1scan(IOBUF *iop, struct recmatch *recm, SCANSTATE *state)
}
}
-/* <rsrescan>= */
/* rsrescan --- search for a regex match in the buffer */
static RECVALUE
@@ -2806,21 +3192,15 @@ again:
* This matches the "xyz" and ends up putting the
* "abc" into the front of the next record. Ooops.
*
- * The remaybelong() function looks to see if the
+ * The re->maybe_long member is true if the
* regex contains one of: + * ? |. This is a very
* simple heuristic, but in combination with the
* "end of match within a few bytes of end of buffer"
* check, should keep things reasonable.
*/
- /*
- * XXX: The reisstring and remaybelong tests should
- * really be done once when RS is assigned to and
- * then tested as flags here. Maybe one day.
- */
-
/* succession of tests is easier to trace in GDB. */
- if (remaybelong(RS->stptr, RS->stlen)) {
+ if (RSre->maybe_long) {
char *matchend = iop->off + reend;
if (iop->dataend - matchend < RS->stlen)
@@ -2830,7 +3210,6 @@ again:
return REC_OK;
}
-/* <rsnullscan>= */
/* rsnullscan --- handle RS = "" */
static RECVALUE
@@ -2907,8 +3286,11 @@ find_longest_terminator:
return REC_OK;
}
-/* <getarecord>= */
-/* get_a_record --- read a record from IOP into out, return length of EOF, set RT */
+/*
+ * get_a_record --- read a record from IOP into out,
+ * return length of EOF, set RT.
+ * Note that errcode is never NULL, and the caller initializes *errcode to 0.
+ */
static int
get_a_record(char **out, /* pointer to pointer to data */
@@ -2925,19 +3307,34 @@ get_a_record(char **out, /* pointer to pointer to data */
if (at_eof(iop) && no_data_left(iop))
return EOF;
- if (iop->get_record != NULL)
- return (*iop->get_record)(out, iop, errcode);
+ if (read_can_timeout)
+ read_timeout = get_read_timeout(iop);
- /* <fill initial buffer>= */
+ if (iop->public.get_record != NULL) {
+ char *rt_start;
+ size_t rt_len;
+ int rc = iop->public.get_record(out, &iop->public, errcode,
+ &rt_start, &rt_len);
+ if (rc == EOF)
+ iop->flag |= IOP_AT_EOF;
+ else {
+ if (rt_len != 0)
+ set_RT(rt_start, rt_len);
+ else
+ set_RT_to_null();
+ }
+ return rc;
+ }
+
+ /* fill initial buffer */
if (has_no_data(iop) || no_data_left(iop)) {
- iop->count = read(iop->fd, iop->buf, iop->readsize);
+ iop->count = iop->read_func(iop->public.fd, iop->buf, iop->readsize);
if (iop->count == 0) {
iop->flag |= IOP_AT_EOF;
return EOF;
} else if (iop->count == -1) {
iop->flag |= IOP_AT_EOF;
- if (errcode != NULL)
- *errcode = errno;
+ *errcode = errno;
return EOF;
} else {
iop->dataend = iop->buf + iop->count;
@@ -2945,10 +3342,12 @@ get_a_record(char **out, /* pointer to pointer to data */
}
}
- /* <loop through file to find a record>= */
+ /* loop through file to find a record */
state = NOSTATE;
for (;;) {
size_t dataend_off;
+ size_t room_left;
+ size_t amt_to_read;
ret = (*matchrec)(iop, & recm, & state);
iop->flag &= ~IOP_AT_START;
@@ -2956,64 +3355,62 @@ get_a_record(char **out, /* pointer to pointer to data */
break;
/* need to add more data to buffer */
- /* <shift data down in buffer>= */
+ /* shift data down in buffer */
dataend_off = iop->dataend - iop->off;
memmove(iop->buf, iop->off, dataend_off);
iop->off = iop->buf;
iop->dataend = iop->buf + dataend_off;
- /* <adjust recm contents>= */
+ /* adjust recm contents */
recm.start = iop->off;
if (recm.rt_start != NULL)
recm.rt_start = iop->off + recm.len;
- /* <read more data, break if EOF>= */
- {
+ /* read more data, break if EOF */
#define min(x, y) (x < y ? x : y)
- /* subtract one in read count to leave room for sentinel */
- size_t room_left = iop->end - iop->dataend - 1;
- size_t amt_to_read = min(iop->readsize, room_left);
-
- if (amt_to_read < iop->readsize) {
- grow_iop_buffer(iop);
- /* <adjust recm contents>= */
- recm.start = iop->off;
- if (recm.rt_start != NULL)
- recm.rt_start = iop->off + recm.len;
-
- /* recalculate amt_to_read */
- room_left = iop->end - iop->dataend - 1;
- amt_to_read = min(iop->readsize, room_left);
- }
- while (amt_to_read + iop->readsize < room_left)
- amt_to_read += iop->readsize;
+ /* subtract one in read count to leave room for sentinel */
+ room_left = iop->end - iop->dataend - 1;
+ amt_to_read = min(iop->readsize, room_left);
+
+ if (amt_to_read < iop->readsize) {
+ grow_iop_buffer(iop);
+ /* adjust recm contents */
+ recm.start = iop->off;
+ if (recm.rt_start != NULL)
+ recm.rt_start = iop->off + recm.len;
+
+ /* recalculate amt_to_read */
+ room_left = iop->end - iop->dataend - 1;
+ amt_to_read = min(iop->readsize, room_left);
+ }
+ while (amt_to_read + iop->readsize < room_left)
+ amt_to_read += iop->readsize;
#ifdef SSIZE_MAX
- /*
- * POSIX limits read to SSIZE_MAX. There are (bizarre)
- * systems where this amount is small.
- */
- amt_to_read = min(amt_to_read, SSIZE_MAX);
+ /*
+ * POSIX limits read to SSIZE_MAX. There are (bizarre)
+ * systems where this amount is small.
+ */
+ amt_to_read = min(amt_to_read, SSIZE_MAX);
#endif
- iop->count = read(iop->fd, iop->dataend, amt_to_read);
- if (iop->count == -1) {
- *errcode = errno;
- iop->flag |= IOP_AT_EOF;
- break;
- } else if (iop->count == 0) {
- /*
- * hit EOF before matching RS, so end
- * the record and set RT to ""
- */
- iop->flag |= IOP_AT_EOF;
- break;
- } else
- iop->dataend += iop->count;
- }
+ iop->count = iop->read_func(iop->public.fd, iop->dataend, amt_to_read);
+ if (iop->count == -1) {
+ *errcode = errno;
+ iop->flag |= IOP_AT_EOF;
+ break;
+ } else if (iop->count == 0) {
+ /*
+ * hit EOF before matching RS, so end
+ * the record and set RT to ""
+ */
+ iop->flag |= IOP_AT_EOF;
+ break;
+ } else
+ iop->dataend += iop->count;
}
- /* <set record, RT, return right value>= */
+ /* set record, RT, return right value */
/*
* rtval is not a static pointer to avoid dangling pointer problems
@@ -3100,7 +3497,7 @@ set_RS()
}
unref(save_rs);
save_rs = dupnode(RS_node->var_value);
- RS_is_null = FALSE;
+ RS_is_null = false;
RS = force_string(RS_node->var_value);
/*
* used to be if (RS_regexp != NULL) { refree(..); refree(..); ...; }.
@@ -3112,20 +3509,20 @@ set_RS()
RS_re_yes_case = RS_re_no_case = RS_regexp = NULL;
if (RS->stlen == 0) {
- RS_is_null = TRUE;
+ RS_is_null = true;
matchrec = rsnullscan;
} else if (RS->stlen > 1) {
- static short warned = FALSE;
+ static bool warned = false;
- RS_re_yes_case = make_regexp(RS->stptr, RS->stlen, FALSE, TRUE, TRUE);
- RS_re_no_case = make_regexp(RS->stptr, RS->stlen, TRUE, TRUE, TRUE);
+ RS_re_yes_case = make_regexp(RS->stptr, RS->stlen, false, true, true);
+ RS_re_no_case = make_regexp(RS->stptr, RS->stlen, true, true, true);
RS_regexp = (IGNORECASE ? RS_re_no_case : RS_re_yes_case);
matchrec = rsrescan;
if (do_lint && ! warned) {
lintwarn(_("multicharacter value of `RS' is a gawk extension"));
- warned = TRUE;
+ warned = true;
}
} else
matchrec = rs1scan;
@@ -3134,6 +3531,7 @@ set_FS:
set_FS();
}
+
/* pty_vs_pipe --- return true if should use pty instead of pipes for `|&' */
/*
@@ -3144,37 +3542,21 @@ static int
pty_vs_pipe(const char *command)
{
#ifdef HAVE_TERMIOS_H
- char *full_index;
- size_t full_len;
NODE *val;
- NODE *sub;
if (PROCINFO_node == NULL)
- return FALSE;
-
- full_len = strlen(command)
- + SUBSEP_node->var_value->stlen
- + 3 /* strlen("pty") */
- + 1; /* string terminator */
- emalloc(full_index, char *, full_len, "pty_vs_pipe");
- sprintf(full_index, "%s%.*spty", command,
- (int) SUBSEP_node->var_value->stlen, SUBSEP_node->var_value->stptr);
-
- sub = make_string(full_index, strlen(full_index));
- val = in_array(PROCINFO_node, sub);
- unref(sub);
- efree(full_index);
-
+ return false;
+ val = in_PROCINFO(command, "pty", NULL);
if (val) {
if (val->flags & MAYBE_NUM)
(void) force_number(val);
if (val->flags & NUMBER)
- return (val->numbr != 0.0);
+ return ! iszero(val);
else
return (val->stlen != 0);
}
#endif /* HAVE_TERMIOS_H */
- return FALSE;
+ return false;
}
/* iopflags2str --- make IOP flags printable */
@@ -3184,7 +3566,6 @@ iopflags2str(int flag)
{
static const struct flagtab values[] = {
{ IOP_IS_TTY, "IOP_IS_TTY" },
- { IOP_NOFREE_OBJ, "IOP_NOFREE_OBJ" },
{ IOP_AT_EOF, "IOP_AT_EOF" },
{ IOP_CLOSED, "IOP_CLOSED" },
{ IOP_AT_START, "IOP_AT_START" },
@@ -3208,22 +3589,22 @@ free_rp(struct redirect *rp)
static int
inetfile(const char *str, int *length, int *family)
{
- int ret = FALSE;
+ bool ret = false;
if (strncmp(str, "/inet/", 6) == 0) {
- ret = TRUE;
+ ret = true;
if (length != NULL)
*length = 6;
if (family != NULL)
*family = AF_UNSPEC;
} else if (strncmp(str, "/inet4/", 7) == 0) {
- ret = TRUE;
+ ret = true;
if (length != NULL)
*length = 7;
if (family != NULL)
*family = AF_INET;
} else if (strncmp(str, "/inet6/", 7) == 0) {
- ret = TRUE;
+ ret = true;
if (length != NULL)
*length = 7;
if (family != NULL)
@@ -3235,3 +3616,174 @@ inetfile(const char *str, int *length, int *family)
return ret;
}
+
+/*
+ * in_PROCINFO --- return value for a PROCINFO element with
+ * SUBSEP seperated indices.
+ */
+
+static NODE *
+in_PROCINFO(const char *pidx1, const char *pidx2, NODE **full_idx)
+{
+ char *str;
+ size_t str_len;
+ NODE *r, *sub = NULL;
+ NODE *subsep = SUBSEP_node->var_value;
+
+ /* full_idx is in+out parameter */
+
+ if (full_idx)
+ sub = *full_idx;
+
+ str_len = strlen(pidx1) + subsep->stlen + strlen(pidx2);
+ if (sub == NULL) {
+ emalloc(str, char *, str_len + 1, "in_PROCINFO");
+ sub = make_str_node(str, str_len, ALREADY_MALLOCED);
+ if (full_idx)
+ *full_idx = sub;
+ } else if (str_len != sub->stlen) {
+ /* *full_idx != NULL */
+
+ assert(sub->valref == 1);
+ erealloc(sub->stptr, char *, str_len + 1, "in_PROCINFO");
+ sub->stlen = str_len;
+ }
+
+ sprintf(sub->stptr, "%s%.*s%s", pidx1, (int)subsep->stlen,
+ subsep->stptr, pidx2);
+ r = in_array(PROCINFO_node, sub);
+ if (! full_idx)
+ unref(sub);
+ return r;
+}
+
+
+/* get_read_timeout --- get timeout in milliseconds for reading */
+
+static long
+get_read_timeout(IOBUF *iop)
+{
+ long tmout = 0;
+
+ if (PROCINFO_node != NULL) {
+ const char *name = iop->public.name;
+ NODE *val = NULL;
+ static NODE *full_idx = NULL;
+ static const char *last_name = NULL;
+
+ /*
+ * Do not re-construct the full index when last redirection
+ * string is the same as the current; "efficiency_hack++".
+ */
+ if (full_idx == NULL || strcmp(name, last_name) != 0) {
+ val = in_PROCINFO(name, "READ_TIMEOUT", & full_idx);
+ if (last_name != NULL)
+ efree((void *) last_name);
+ last_name = estrdup(name, strlen(name));
+ } else /* use cached full index */
+ val = in_array(PROCINFO_node, full_idx);
+
+ if (val != NULL) {
+ (void) force_number(val);
+ tmout = get_number_si(val);
+ }
+ } else
+ tmout = read_default_timeout; /* initialized from env. variable in init_io() */
+
+ iop->read_func = tmout > 0 ? read_with_timeout : ( ssize_t(*)() ) read;
+ return tmout;
+}
+
+/*
+ * read_with_timeout --- read with a timeout, return failure
+ * if no data is available within the timeout period.
+ */
+
+static ssize_t
+read_with_timeout(int fd, char *buf, size_t size)
+{
+#ifndef __MINGW32__
+ fd_set readfds;
+ struct timeval tv;
+
+ tv.tv_sec = read_timeout / 1000;
+ tv.tv_usec = 1000 * (read_timeout - 1000 * tv.tv_sec);
+
+ FD_ZERO(& readfds);
+ FD_SET(fd, & readfds);
+
+ errno = 0;
+ if (select(fd + 1, & readfds, NULL, NULL, & tv) < 0)
+ return -1;
+
+ if (FD_ISSET(fd, & readfds))
+ return read(fd, buf, size);
+ /* else
+ timed out */
+
+ /* Set a meaningful errno */
+#ifdef ETIMEDOUT
+ errno = ETIMEDOUT;
+#else
+ errno = EAGAIN;
+#endif
+ return -1;
+#else /* __MINGW32__ */
+ return read(fd, buf, size);
+#endif /* __MINGW32__ */
+}
+
+/*
+ * Dummy pass through functions for default output.
+ */
+
+/* gawk_fwrite --- like fwrite */
+
+static size_t
+gawk_fwrite(const void *buf, size_t size, size_t count, FILE *fp, void *opaque)
+{
+ (void) opaque;
+
+ return fwrite(buf, size, count, fp);
+}
+
+static int
+gawk_fflush(FILE *fp, void *opaque)
+{
+ (void) opaque;
+
+ return fflush(fp);
+}
+
+static int
+gawk_ferror(FILE *fp, void *opaque)
+{
+ (void) opaque;
+
+ return ferror(fp);
+}
+
+static int
+gawk_fclose(FILE *fp, void *opaque)
+{
+ (void) opaque;
+
+ return fclose(fp);
+}
+
+
+/* init_output_wrapper --- initialize the output wrapper */
+
+static void
+init_output_wrapper(awk_output_buf_t *outbuf)
+{
+ outbuf->name = NULL;
+ outbuf->mode = NULL;
+ outbuf->fp = NULL;
+ outbuf->opaque = NULL;
+ outbuf->redirected = false;
+ outbuf->gawk_fwrite = gawk_fwrite;
+ outbuf->gawk_fflush = gawk_fflush;
+ outbuf->gawk_ferror = gawk_ferror;
+ outbuf->gawk_fclose = gawk_fclose;
+}
diff --git a/m4/ChangeLog b/m4/ChangeLog
index f099c857..8489f90e 100644
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,3 +1,17 @@
+2012-10-27 Arnold D. Robbins <arnold@skeeve.com>
+
+ * po.m4, intl.m4: Fix droppings left over from a git merge.
+
+2012-05-21 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * libtool.m4, ltoptions.m4, ltsugar.m4, ltversion.m4, lt~obsolete.m4:
+ Remove files related to libtool support. Libtool usage has been
+ pushed down into the extension directory.
+
+2012-04-01 John Haque <j.eh@mchsi.com>
+
+ * mpfr.m4: New file.
+
2012-04-27 Arnold D. Robbins <arnold@skeeve.com>
Update to autoconf 2.69, automake 1.12.
diff --git a/m4/mpfr.m4 b/m4/mpfr.m4
new file mode 100644
index 00000000..7d9e678b
--- /dev/null
+++ b/m4/mpfr.m4
@@ -0,0 +1,62 @@
+dnl Check for MPFR and dependencies
+dnl Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+dnl
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+dnl
+dnl Defines HAVE_MPFR to 1 if a working MPFR/GMP setup is
+dnl found, and sets @LIBMPFR@ to the necessary libraries.
+
+AC_DEFUN([GNUPG_CHECK_MPFR],
+[
+ AC_ARG_WITH([mpfr],
+ AC_HELP_STRING([--with-mpfr=DIR],
+ [look for the mpfr and gmp libraries in DIR]),
+ [_do_mpfr=$withval],[_do_mpfr=yes])
+
+ if test "$_do_mpfr" != "no" ; then
+ if test -d "$withval" ; then
+ CPPFLAGS="${CPPFLAGS} -I$withval/include"
+ LDFLAGS="${LDFLAGS} -L$withval/lib"
+ fi
+
+ _mpfr_save_libs=$LIBS
+ _combo="-lmpfr -lgmp"
+ LIBS="$LIBS $_combo"
+
+ AC_MSG_CHECKING([whether mpfr via \"$_combo\" is present and usable])
+
+ AC_LINK_IFELSE([
+ AC_LANG_PROGRAM([
+#include <stdio.h>
+#include <mpfr.h>
+#include <gmp.h>
+],[
+mpfr_t p;
+mpz_t z;
+mpfr_init(p);
+mpz_init(z);
+mpfr_printf("%Rf%Zd", p, z);
+mpfr_clear(p);
+mpz_clear(z);
+])],_found_mpfr=yes,_found_mpfr=no)
+
+ AC_MSG_RESULT([$_found_mpfr])
+
+ LIBS=$_mpfr_save_libs
+
+ if test $_found_mpfr = yes ; then
+ AC_DEFINE(HAVE_MPFR,1,
+ [Define to 1 if you have fully functional mpfr and gmp libraries.])
+ AC_SUBST(LIBMPFR,$_combo)
+ break
+ fi
+
+ unset _mpfr_save_libs
+ unset _combo
+ unset _found_mpfr
+ fi
+])dnl
diff --git a/main.c b/main.c
index 2bb0b01f..5e84a3c7 100644
--- a/main.c
+++ b/main.c
@@ -35,6 +35,8 @@
#define DEFAULT_PROFILE "awkprof.out" /* where to put profile */
#define DEFAULT_VARFILE "awkvars.out" /* where to put vars */
+#define DEFAULT_PREC 53
+#define DEFAULT_ROUNDMODE "N" /* round to nearest */
static const char *varfile = DEFAULT_VARFILE;
const char *command_file = NULL; /* debugger commands */
@@ -55,15 +57,18 @@ static void nostalgia(void) ATTRIBUTE_NORETURN;
static void version(void) ATTRIBUTE_NORETURN;
static void init_fds(void);
static void init_groupset(void);
-
static void save_argv(int, char **);
+extern int debug_prog(INSTRUCTION *pc); /* debug.c */
+extern int init_debug(); /* debug.c */
+
/* These nodes store all the special variables AWK uses */
NODE *ARGC_node, *ARGIND_node, *ARGV_node, *BINMODE_node, *CONVFMT_node;
NODE *ENVIRON_node, *ERRNO_node, *FIELDWIDTHS_node, *FILENAME_node;
NODE *FNR_node, *FPAT_node, *FS_node, *IGNORECASE_node, *LINT_node;
NODE *NF_node, *NR_node, *OFMT_node, *OFS_node, *ORS_node, *PROCINFO_node;
NODE *RLENGTH_node, *RSTART_node, *RS_node, *RT_node, *SUBSEP_node;
+NODE *PREC_node, *ROUNDMODE_node;
NODE *TEXTDOMAIN_node;
NODE *_r; /* used as temporary in stack macros */
@@ -125,35 +130,24 @@ struct pre_assign {
static struct pre_assign *preassigns = NULL; /* requested via -v or -F */
static long numassigns = -1; /* how many of them */
-static int disallow_var_assigns = FALSE; /* true for --exec */
+static bool disallow_var_assigns = false; /* true for --exec */
static void add_preassign(enum assign_type type, char *val);
-#undef do_lint
-#undef do_lint_old
-
-int do_traditional = FALSE; /* no gnu extensions, add traditional weirdnesses */
-int do_posix = FALSE; /* turn off gnu and unix extensions */
-int do_lint = FALSE; /* provide warnings about questionable stuff */
-int do_lint_old = FALSE; /* warn about stuff not in V7 awk */
-int do_intl = FALSE; /* dump locale-izable strings to stdout */
-int do_non_decimal_data = FALSE; /* allow octal/hex C style DATA. Use with caution! */
-int do_nostalgia = FALSE; /* provide a blast from the past */
-int do_intervals = FALSE; /* allow {...,...} in regexps, see resetup() */
-int do_profiling = FALSE; /* profile and pretty print the program */
-int do_dump_vars = FALSE; /* dump all global variables at end */
-int do_tidy_mem = FALSE; /* release vars when done */
-int do_optimize = TRUE; /* apply default optimizations */
-int do_binary = FALSE; /* hands off my data! */
-int do_sandbox = FALSE; /* sandbox mode - disable 'system' function & redirections */
-int use_lc_numeric = FALSE; /* obey locale for decimal point */
+int do_flags = false;
+bool do_optimize = true; /* apply default optimizations */
+static int do_nostalgia = false; /* provide a blast from the past */
+static int do_binary = false; /* hands off my data! */
+static int do_version = false; /* print version info */
+
+int use_lc_numeric = false; /* obey locale for decimal point */
#if MBS_SUPPORT
int gawk_mb_cur_max; /* MB_CUR_MAX value, see comment in main() */
#endif
-FILE *output_fp; /* default output for debugger */
-int output_is_tty = FALSE; /* control flushing of output */
+FILE *output_fp; /* default gawk output, can be redirected in the debugger */
+bool output_is_tty = false; /* control flushing of output */
/* default format for strftime(), available via PROCINFO */
const char def_strftime_format[] = "%a %b %e %H:%M:%S %Z %Y";
@@ -167,44 +161,39 @@ int ngroups; /* size of said set */
void (*lintfunc)(const char *mesg, ...) = warning;
-/*
- * Note: reserve -D for future use, to merge dgawk into gawk.
- * Note: reserve -l for future use, for xgawk's -l option.
- */
static const struct option optab[] = {
- { "traditional", no_argument, & do_traditional, 1 },
- { "lint", optional_argument, NULL, 'L' },
- { "lint-old", no_argument, & do_lint_old, 1 },
- { "optimize", no_argument, & do_optimize, 'O' },
- { "posix", no_argument, & do_posix, 1 },
- { "command", required_argument, NULL, 'R' },
+ { "traditional", no_argument, NULL, 'c' },
+ { "lint", optional_argument, NULL, 'L' },
+ { "lint-old", no_argument, NULL, 't' },
+ { "optimize", no_argument, NULL, 'O' },
+ { "posix", no_argument, NULL, 'P' },
{ "nostalgia", no_argument, & do_nostalgia, 1 },
- { "gen-pot", no_argument, & do_intl, 1 },
- { "non-decimal-data", no_argument, & do_non_decimal_data, 1 },
- { "profile", optional_argument, NULL, 'p' },
- { "copyright", no_argument, NULL, 'C' },
- { "field-separator", required_argument, NULL, 'F' },
- { "file", required_argument, NULL, 'f' },
- { "re-interval", no_argument, & do_intervals, 1 },
- { "source", required_argument, NULL, 'e' },
- { "dump-variables", optional_argument, NULL, 'd' },
- { "assign", required_argument, NULL, 'v' },
- { "version", no_argument, NULL, 'V' },
- { "help", no_argument, NULL, 'h' },
- { "exec", required_argument, NULL, 'E' },
+ { "gen-pot", no_argument, NULL, 'g' },
+ { "non-decimal-data", no_argument, NULL, 'n' },
+ { "pretty-print", optional_argument, NULL, 'o' },
+ { "profile", optional_argument, NULL, 'p' },
+ { "debug", optional_argument, NULL, 'D' },
+ { "copyright", no_argument, NULL, 'C' },
+ { "field-separator", required_argument, NULL, 'F' },
+ { "file", required_argument, NULL, 'f' },
+ { "re-interval", no_argument, NULL, 'r' },
+ { "source", required_argument, NULL, 'e' },
+ { "load", required_argument, NULL, 'l' },
+ { "dump-variables", optional_argument, NULL, 'd' },
+ { "assign", required_argument, NULL, 'v' },
+ { "version", no_argument, & do_version, 'V' },
+ { "help", no_argument, NULL, 'h' },
+ { "exec", required_argument, NULL, 'E' },
{ "use-lc-numeric", no_argument, & use_lc_numeric, 1 },
{ "characters-as-bytes", no_argument, & do_binary, 'b' },
- { "sandbox", no_argument, & do_sandbox, 1 },
+ { "sandbox", no_argument, NULL, 'S' },
+ { "bignum", no_argument, NULL, 'M' },
#if defined(YYDEBUG) || defined(GAWKDEBUG)
{ "parsedebug", no_argument, NULL, 'Y' },
#endif
{ NULL, 0, NULL, '\0' }
};
-#ifdef NO_LINT
-#define do_lint 0
-#define do_lint_old 0
-#endif
/* main --- process args, parse program, run it, clean up */
@@ -213,19 +202,20 @@ main(int argc, char **argv)
{
/*
* The + on the front tells GNU getopt not to rearrange argv.
- * Note: reserve -D for future use, to merge dgawk into gawk.
- * Note: reserve -l for future use, for xgawk's -l option.
*/
- const char *optlist = "+F:f:v:W;m:bcCd::e:E:gh:L:nNOp::PrR:StVY";
- int stopped_early = FALSE;
+ const char *optlist = "+F:f:v:W;m:bcCd::D::e:E:gh:i:l:L:nNo::Op::MPrStVY";
+ bool stopped_early = false;
int old_optind;
int i;
int c;
char *scan, *src;
char *extra_stack;
+ int have_srcfile = 0;
+ SRCFILE *s;
/* do these checks early */
- do_tidy_mem = (getenv("TIDYMEM") != NULL);
+ if (getenv("TIDYMEM") != NULL)
+ do_flags |= DO_TIDY_MEM;
#ifdef HAVE_MCHECK_H
#ifdef HAVE_MTRACE
@@ -298,16 +288,22 @@ main(int argc, char **argv)
if (argc < 2)
usage(EXIT_FAILURE, stderr);
+ /* initialize the null string */
+ Nnull_string = make_string("", 0);
+
/* Robustness: check that file descriptors 0, 1, 2 are open */
init_fds();
/* init array handling. */
array_init();
+ /* init the symbol tables */
+ init_symbol_table();
+
output_fp = stdout;
/* we do error messages ourselves on invalid options */
- opterr = FALSE;
+ opterr = false;
/* copy argv before getopt gets to it; used to restart the debugger */
save_argv(argc, argv);
@@ -320,7 +316,7 @@ main(int argc, char **argv)
(c = getopt_long(argc, argv, optlist, optab, NULL)) != EOF;
optopt = 0, old_optind = optind) {
if (do_posix)
- opterr = TRUE;
+ opterr = true;
switch (c) {
case 'F':
@@ -328,7 +324,7 @@ main(int argc, char **argv)
break;
case 'E':
- disallow_var_assigns = TRUE;
+ disallow_var_assigns = true;
/* fall through */
case 'f':
/*
@@ -369,11 +365,11 @@ main(int argc, char **argv)
break;
case 'b':
- do_binary = TRUE;
+ do_binary = true;
break;
case 'c':
- do_traditional = TRUE;
+ do_flags |= DO_TRADITIONAL;
break;
case 'C':
@@ -381,11 +377,17 @@ main(int argc, char **argv)
break;
case 'd':
- do_dump_vars = TRUE;
+ do_flags |= DO_DUMP_VARS;
if (optarg != NULL && optarg[0] != '\0')
varfile = optarg;
break;
+ case 'D':
+ do_flags |= DO_DEBUG;
+ if (optarg != NULL && optarg[0] != '\0')
+ command_file = optarg;
+ break;
+
case 'e':
if (optarg[0] == '\0')
warning(_("empty argument to `-e/--source' ignored"));
@@ -394,7 +396,7 @@ main(int argc, char **argv)
break;
case 'g':
- do_intl = TRUE;
+ do_flags |= DO_INTL;
break;
case 'h':
@@ -402,19 +404,29 @@ main(int argc, char **argv)
usage(EXIT_SUCCESS, stdout);
break;
-#ifndef NO_LINT
+ case 'i':
+ (void) add_srcfile(SRC_INC, optarg, srcfiles, NULL, NULL);
+ break;
+
+ case 'l':
+ (void) add_srcfile(SRC_EXTLIB, optarg, srcfiles, NULL, NULL);
+ break;
+
case 'L':
- do_lint = LINT_ALL;
+#ifndef NO_LINT
+ do_flags |= DO_LINT_ALL;
if (optarg != NULL) {
if (strcmp(optarg, "fatal") == 0)
lintfunc = r_fatal;
- else if (strcmp(optarg, "invalid") == 0)
- do_lint = LINT_INVALID;
+ else if (strcmp(optarg, "invalid") == 0) {
+ do_flags &= ~DO_LINT_ALL;
+ do_flags |= DO_LINT_INVALID;
+ }
}
break;
case 't':
- do_lint_old = TRUE;
+ do_flags |= DO_LINT_OLD;
break;
#else
case 'L':
@@ -423,11 +435,11 @@ main(int argc, char **argv)
#endif
case 'n':
- do_non_decimal_data = TRUE;
+ do_flags |= DO_NON_DEC_DATA;
break;
case 'N':
- use_lc_numeric = TRUE;
+ use_lc_numeric = true;
break;
case 'O':
@@ -435,27 +447,36 @@ main(int argc, char **argv)
break;
case 'p':
- do_profiling = TRUE;
+ do_flags |= DO_PROFILE;
+ /* fall through */
+ case 'o':
+ do_flags |= DO_PRETTY_PRINT;
if (optarg != NULL)
set_prof_file(optarg);
else
set_prof_file(DEFAULT_PROFILE);
break;
+ case 'M':
+#ifdef HAVE_MPFR
+ do_flags |= DO_MPFR;
+#endif
+ break;
+
case 'P':
- do_posix = TRUE;
+ do_flags |= DO_POSIX;
break;
case 'r':
- do_intervals = TRUE;
+ do_flags |= DO_INTERVALS;
break;
case 'S':
- do_sandbox = TRUE;
+ do_flags |= DO_SANDBOX;
break;
case 'V':
- version();
+ do_version = true;
break;
case 'W': /* gawk specific options - now in getopt_long */
@@ -472,20 +493,13 @@ main(int argc, char **argv)
break;
case 'Y':
- case 'R':
#if defined(YYDEBUG) || defined(GAWKDEBUG)
if (c == 'Y') {
yydebug = 2;
break;
}
#endif
- if (c == 'R' && which_gawk == exe_debugging) {
- if (optarg[0] != '\0')
- command_file = optarg;
- break;
- }
- /* if not debugging or dgawk, fall through */
-
+ /* if not debugging, fall through */
case '?':
default:
/*
@@ -507,7 +521,7 @@ main(int argc, char **argv)
* won't have incremented optind.
*/
optind = old_optind;
- stopped_early = TRUE;
+ stopped_early = true;
goto out;
} else if (optopt != '\0') {
/* Use POSIX required message format */
@@ -530,18 +544,18 @@ out:
/* check for POSIXLY_CORRECT environment variable */
if (! do_posix && getenv("POSIXLY_CORRECT") != NULL) {
- do_posix = TRUE;
+ do_flags |= DO_POSIX;
if (do_lint)
lintwarn(
_("environment variable `POSIXLY_CORRECT' set: turning on `--posix'"));
}
if (do_posix) {
- use_lc_numeric = TRUE;
+ use_lc_numeric = true;
if (do_traditional) /* both on command line */
warning(_("`--posix' overrides `--traditional'"));
else
- do_traditional = TRUE;
+ do_flags |= DO_TRADITIONAL;
/*
* POSIX compliance also implies
* no GNU extensions either.
@@ -549,7 +563,7 @@ out:
}
if (do_traditional && do_non_decimal_data) {
- do_non_decimal_data = FALSE;
+ do_flags &= ~DO_NON_DEC_DATA;
warning(_("`--posix'/`--traditional' overrides `--non-decimal-data'"));
}
@@ -568,21 +582,28 @@ out:
}
#endif
- /*
- * Force profiling if this is pgawk.
- * Don't bother if the command line already set profiling up.
- */
- if (! do_profiling)
- init_profiling(& do_profiling, DEFAULT_PROFILE);
+ if (do_debug) /* Need to register the debugger pre-exec hook before any other */
+ init_debug();
+
+#ifdef HAVE_MPFR
+ /* Set up MPFR defaults, and register pre-exec hook to process arithmetic opcodes */
+ if (do_mpfr)
+ init_mpfr(DEFAULT_PREC, DEFAULT_ROUNDMODE);
+#endif
/* load group set */
init_groupset();
- /* initialize the null string */
- Nnull_string = make_string("", 0);
- Nnull_string->numbr = 0.0;
- Nnull_string->type = Node_val;
- Nnull_string->flags = (PERM|STRCUR|STRING|NUMCUR|NUMBER);
+#ifdef HAVE_MPFR
+ if (do_mpfr) {
+ mpz_init(Nnull_string->mpg_i);
+ Nnull_string->flags = (MALLOC|STRCUR|STRING|MPZN|NUMCUR|NUMBER);
+ } else
+#endif
+ {
+ Nnull_string->numbr = 0.0;
+ Nnull_string->flags = (MALLOC|STRCUR|STRING|NUMCUR|NUMBER);
+ }
/*
* Tell the regex routines how they should work.
@@ -591,8 +612,6 @@ out:
*/
resetup();
- (void) grow_stack();
-
/* Set up the special variables */
init_vars();
@@ -602,7 +621,7 @@ out:
/* Now process the pre-assignments */
for (i = 0; i <= numassigns; i++) {
if (preassigns[i].type == PRE_ASSIGN)
- (void) arg_assign(preassigns[i].val, TRUE);
+ (void) arg_assign(preassigns[i].val, true);
else /* PRE_ASSIGN_FS */
cmdline_fs(preassigns[i].val);
efree(preassigns[i].val);
@@ -625,15 +644,34 @@ out:
setbuf(stdout, (char *) NULL); /* make debugging easier */
#endif
if (os_isatty(fileno(stdout)))
- output_is_tty = TRUE;
+ output_is_tty = true;
+
+ /* initialize API before loading extension libraries */
+ init_ext_api();
+
+ /* load extension libs */
+ for (s = srcfiles->next; s != srcfiles; s = s->next) {
+ if (s->stype == SRC_EXTLIB)
+ load_ext(s->fullpath);
+ else if (s->stype != SRC_INC)
+ have_srcfile++;
+ }
+
+ /* do version check after extensions are loaded to get extension info */
+ if (do_version)
+ version();
+
/* No -f or --source options, use next arg */
- if (srcfiles->next == srcfiles) {
+ if (! have_srcfile) {
if (optind > argc - 1 || stopped_early) /* no args left or no program */
usage(EXIT_FAILURE, stderr);
(void) add_srcfile(SRC_CMDLINE, argv[optind], srcfiles, NULL, NULL);
optind++;
}
+ /* Select the interpreter routine */
+ init_interpret();
+
init_args(optind, argc,
do_posix ? argv[0] : myname,
argv);
@@ -647,7 +685,7 @@ out:
setlocale(LC_NUMERIC, "C");
#endif
/* Read in the program */
- if (parse_program(&code_block) != 0)
+ if (parse_program(& code_block) != 0)
exit(EXIT_FAILURE);
if (do_intl)
@@ -659,7 +697,10 @@ out:
if (do_lint && code_block->nexti->opcode == Op_atexit)
lintwarn(_("no program text at all!"));
- init_profiling_signals();
+ load_symbols();
+
+ if (do_profile)
+ init_profiling_signals();
#if defined(LC_NUMERIC)
/*
@@ -680,10 +721,16 @@ out:
if (use_lc_numeric)
setlocale(LC_NUMERIC, "");
#endif
+
+ init_io();
+ output_fp = stdout;
- interpret(code_block);
+ if (do_debug)
+ debug_prog(code_block);
+ else
+ interpret(code_block);
- if (do_profiling) {
+ if (do_pretty_print) {
dump_prog(code_block);
dump_funcs();
}
@@ -698,7 +745,7 @@ out:
if (extra_stack)
efree(extra_stack);
- exit(exit_val); /* more portable */
+ final_exit(exit_val);
return exit_val; /* to suppress warnings */
}
@@ -737,7 +784,7 @@ usage(int exitval, FILE *fp)
fprintf(fp, _("Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"),
myname);
fprintf(fp, _("Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"),
- myname, quote, quote);
+ myname, quote, quote);
/* GNU long options info. This is too many options. */
@@ -750,19 +797,22 @@ usage(int exitval, FILE *fp)
fputs(_("\t-c\t\t\t--traditional\n"), fp);
fputs(_("\t-C\t\t\t--copyright\n"), fp);
fputs(_("\t-d[file]\t\t--dump-variables[=file]\n"), fp);
+ fputs(_("\t-D[file]\t\t--debug[=file]\n"), fp);
fputs(_("\t-e 'program-text'\t--source='program-text'\n"), fp);
fputs(_("\t-E file\t\t\t--exec=file\n"), fp);
fputs(_("\t-g\t\t\t--gen-pot\n"), fp);
fputs(_("\t-h\t\t\t--help\n"), fp);
+ fputs(_("\t-i includefile\t\t--include=includefile\n"), fp);
+ fputs(_("\t-l library\t\t--load=library\n"), fp);
fputs(_("\t-L [fatal]\t\t--lint[=fatal]\n"), fp);
fputs(_("\t-n\t\t\t--non-decimal-data\n"), fp);
+ fputs(_("\t-M\t\t\t--bignum\n"), fp);
fputs(_("\t-N\t\t\t--use-lc-numeric\n"), fp);
+ fputs(_("\t-o[file]\t\t--pretty-print[=file]\n"), fp);
fputs(_("\t-O\t\t\t--optimize\n"), fp);
fputs(_("\t-p[file]\t\t--profile[=file]\n"), fp);
fputs(_("\t-P\t\t\t--posix\n"), fp);
fputs(_("\t-r\t\t\t--re-interval\n"), fp);
- if (which_gawk == exe_debugging)
- fputs(_("\t-R file\t\t\t--command=file\n"), fp);
fputs(_("\t-S\t\t\t--sandbox\n"), fp);
fputs(_("\t-t\t\t\t--lint-old\n"), fp);
fputs(_("\t-V\t\t\t--version\n"), fp);
@@ -860,6 +910,7 @@ cmdline_fs(char *str)
if (do_traditional && ! do_posix)
str[0] = '\t';
}
+
*tmp = make_str_node(str, strlen(str), SCAN); /* do process escapes */
set_FS();
}
@@ -873,26 +924,27 @@ init_args(int argc0, int argc, const char *argv0, char **argv)
NODE **aptr;
NODE *tmp;
- ARGV_node = install_symbol(estrdup("ARGV", 4), mk_symbol(Node_var_array, (NODE *) NULL));
+ ARGV_node = install_symbol(estrdup("ARGV", 4), Node_var_array);
tmp = make_number(0.0);
- aptr = assoc_lookup(ARGV_node, tmp, FALSE);
+ aptr = assoc_lookup(ARGV_node, tmp);
unref(tmp);
unref(*aptr);
*aptr = make_string(argv0, strlen(argv0));
(*aptr)->flags |= MAYBE_NUM;
for (i = argc0, j = 1; i < argc; i++, j++) {
tmp = make_number((AWKNUM) j);
- aptr = assoc_lookup(ARGV_node, tmp, FALSE);
+ aptr = assoc_lookup(ARGV_node, tmp);
unref(tmp);
unref(*aptr);
*aptr = make_string(argv[i], strlen(argv[i]));
(*aptr)->flags |= MAYBE_NUM;
}
- ARGC_node = install_symbol(estrdup("ARGC", 4),
- mk_symbol(Node_var, make_number((AWKNUM) j)));
+ ARGC_node = install_symbol(estrdup("ARGC", 4), Node_var);
+ ARGC_node->var_value = make_number((AWKNUM) j);
}
+
/*
* Set all the special variables to their initial values.
* Note that some of the variables that have set_FOO routines should
@@ -908,40 +960,43 @@ struct varinit {
AWKNUM numval;
Func_ptr update;
Func_ptr assign;
- int do_assign;
+ bool do_assign;
int flags;
#define NO_INSTALL 0x01
#define NON_STANDARD 0x02
+#define NOT_OFF_LIMITS 0x04 /* may be accessed by extension function */
};
static const struct varinit varinit[] = {
-{NULL, "ARGC", NULL, 0, NULL, NULL, FALSE, NO_INSTALL },
-{&ARGIND_node, "ARGIND", NULL, 0, NULL, NULL, FALSE, NON_STANDARD },
-{NULL, "ARGV", NULL, 0, NULL, NULL, FALSE, NO_INSTALL },
-{&BINMODE_node, "BINMODE", NULL, 0, NULL, set_BINMODE, FALSE, NON_STANDARD },
-{&CONVFMT_node, "CONVFMT", "%.6g", 0, NULL, set_CONVFMT,TRUE, 0 },
-{NULL, "ENVIRON", NULL, 0, NULL, NULL, FALSE, NO_INSTALL },
-{&ERRNO_node, "ERRNO", "", 0, NULL, NULL, FALSE, NON_STANDARD },
-{&FIELDWIDTHS_node, "FIELDWIDTHS", "", 0, NULL, set_FIELDWIDTHS, FALSE, NON_STANDARD },
-{&FILENAME_node, "FILENAME", "", 0, NULL, NULL, FALSE, 0 },
-{&FNR_node, "FNR", NULL, 0, update_FNR, set_FNR, TRUE, 0 },
-{&FS_node, "FS", " ", 0, NULL, set_FS, FALSE, 0 },
-{&FPAT_node, "FPAT", "[^[:space:]]+", 0, NULL, set_FPAT, FALSE, NON_STANDARD },
-{&IGNORECASE_node, "IGNORECASE", NULL, 0, NULL, set_IGNORECASE, FALSE, NON_STANDARD },
-{&LINT_node, "LINT", NULL, 0, NULL, set_LINT, FALSE, NON_STANDARD },
-{&NF_node, "NF", NULL, -1, update_NF, set_NF, FALSE, 0 },
-{&NR_node, "NR", NULL, 0, update_NR, set_NR, TRUE, 0 },
-{&OFMT_node, "OFMT", "%.6g", 0, NULL, set_OFMT, TRUE, 0 },
-{&OFS_node, "OFS", " ", 0, NULL, set_OFS, TRUE, 0 },
-{&ORS_node, "ORS", "\n", 0, NULL, set_ORS, TRUE, 0 },
-{NULL, "PROCINFO", NULL, 0, NULL, NULL, FALSE, NO_INSTALL | NON_STANDARD },
-{&RLENGTH_node, "RLENGTH", NULL, 0, NULL, NULL, FALSE, 0 },
-{&RS_node, "RS", "\n", 0, NULL, set_RS, TRUE, 0 },
-{&RSTART_node, "RSTART", NULL, 0, NULL, NULL, FALSE, 0 },
-{&RT_node, "RT", "", 0, NULL, NULL, FALSE, NON_STANDARD },
-{&SUBSEP_node, "SUBSEP", "\034", 0, NULL, set_SUBSEP, TRUE, 0 },
-{&TEXTDOMAIN_node, "TEXTDOMAIN", "messages", 0, NULL, set_TEXTDOMAIN, TRUE, NON_STANDARD },
-{0, NULL, NULL, 0, NULL, NULL, FALSE, 0 },
+{NULL, "ARGC", NULL, 0, NULL, NULL, false, NO_INSTALL },
+{&ARGIND_node, "ARGIND", NULL, 0, NULL, NULL, false, NON_STANDARD },
+{NULL, "ARGV", NULL, 0, NULL, NULL, false, NO_INSTALL },
+{&BINMODE_node, "BINMODE", NULL, 0, NULL, set_BINMODE, false, NON_STANDARD },
+{&CONVFMT_node, "CONVFMT", "%.6g", 0, NULL, set_CONVFMT,true, 0 },
+{NULL, "ENVIRON", NULL, 0, NULL, NULL, false, NO_INSTALL },
+{&ERRNO_node, "ERRNO", "", 0, NULL, NULL, false, NON_STANDARD },
+{&FIELDWIDTHS_node, "FIELDWIDTHS", "", 0, NULL, set_FIELDWIDTHS, false, NON_STANDARD },
+{&FILENAME_node, "FILENAME", "", 0, NULL, NULL, false, 0 },
+{&FNR_node, "FNR", NULL, 0, update_FNR, set_FNR, true, 0 },
+{&FS_node, "FS", " ", 0, NULL, set_FS, false, 0 },
+{&FPAT_node, "FPAT", "[^[:space:]]+", 0, NULL, set_FPAT, false, NON_STANDARD },
+{&IGNORECASE_node, "IGNORECASE", NULL, 0, NULL, set_IGNORECASE, false, NON_STANDARD },
+{&LINT_node, "LINT", NULL, 0, NULL, set_LINT, false, NON_STANDARD },
+{&PREC_node, "PREC", NULL, DEFAULT_PREC, NULL, set_PREC, false, NON_STANDARD},
+{&NF_node, "NF", NULL, -1, update_NF, set_NF, false, 0 },
+{&NR_node, "NR", NULL, 0, update_NR, set_NR, true, 0 },
+{&OFMT_node, "OFMT", "%.6g", 0, NULL, set_OFMT, true, 0 },
+{&OFS_node, "OFS", " ", 0, NULL, set_OFS, true, 0 },
+{&ORS_node, "ORS", "\n", 0, NULL, set_ORS, true, 0 },
+{NULL, "PROCINFO", NULL, 0, NULL, NULL, false, NO_INSTALL | NON_STANDARD | NOT_OFF_LIMITS },
+{&RLENGTH_node, "RLENGTH", NULL, 0, NULL, NULL, false, 0 },
+{&ROUNDMODE_node, "ROUNDMODE", DEFAULT_ROUNDMODE, 0, NULL, set_ROUNDMODE, false, NON_STANDARD },
+{&RS_node, "RS", "\n", 0, NULL, set_RS, true, 0 },
+{&RSTART_node, "RSTART", NULL, 0, NULL, NULL, false, 0 },
+{&RT_node, "RT", "", 0, NULL, NULL, false, NON_STANDARD },
+{&SUBSEP_node, "SUBSEP", "\034", 0, NULL, set_SUBSEP, true, 0 },
+{&TEXTDOMAIN_node, "TEXTDOMAIN", "messages", 0, NULL, set_TEXTDOMAIN, true, NON_STANDARD },
+{0, NULL, NULL, 0, NULL, NULL, false, 0 },
};
/* init_vars --- actually initialize everything in the symbol table */
@@ -955,13 +1010,13 @@ init_vars()
for (vp = varinit; vp->name != NULL; vp++) {
if ((vp->flags & NO_INSTALL) != 0)
continue;
- n = mk_symbol(Node_var, vp->strval == NULL
- ? make_number(vp->numval)
- : make_string(vp->strval, strlen(vp->strval)));
+ n = *(vp->spec) = install_symbol(estrdup(vp->name, strlen(vp->name)), Node_var);
+ if (vp->strval != NULL)
+ n->var_value = make_string(vp->strval, strlen(vp->strval));
+ else
+ n->var_value = make_number(vp->numval);
n->var_assign = (Func_ptr) vp->assign;
n->var_update = (Func_ptr) vp->update;
-
- *(vp->spec) = install_symbol(estrdup(vp->name, strlen(vp->name)), n);
if (vp->do_assign)
(*(vp->assign))();
}
@@ -972,6 +1027,31 @@ init_vars()
register_deferred_variable("ENVIRON", load_environ);
}
+/* path_environ --- put path variable into environment if not already there */
+
+static void
+path_environ(const char *pname, const char *dflt)
+{
+ const char *val;
+ NODE **aptr;
+ NODE *tmp;
+
+ tmp = make_string(pname, strlen(pname));
+ if (! in_array(ENVIRON_node, tmp)) {
+ /*
+ * On VMS, environ[] only holds a subset of what getenv() can
+ * find, so look AWKPATH up before resorting to default path.
+ */
+ val = getenv(pname);
+ if (val == NULL)
+ val = dflt;
+ aptr = assoc_lookup(ENVIRON_node, tmp);
+ unref(*aptr);
+ *aptr = make_string(val, strlen(val));
+ }
+ unref(tmp);
+}
+
/* load_environ --- populate the ENVIRON array */
static NODE *
@@ -984,10 +1064,14 @@ load_environ()
NODE **aptr;
int i;
NODE *tmp;
+ static bool been_here = false;
- ENVIRON_node = install_symbol(estrdup("ENVIRON", 7),
- mk_symbol(Node_var_array, (NODE *) NULL));
+ if (been_here)
+ return ENVIRON_node;
+ been_here = true;
+
+ ENVIRON_node = install_symbol(estrdup("ENVIRON", 7), Node_var_array);
for (i = 0; environ[i] != NULL; i++) {
static char nullstr[] = "";
@@ -998,7 +1082,7 @@ load_environ()
else
val = nullstr;
tmp = make_string(var, strlen(var));
- aptr = assoc_lookup(ENVIRON_node, tmp, FALSE);
+ aptr = assoc_lookup(ENVIRON_node, tmp);
unref(tmp);
unref(*aptr);
*aptr = make_string(val, strlen(val));
@@ -1009,23 +1093,11 @@ load_environ()
*--val = '=';
}
/*
- * Put AWKPATH into ENVIRON if it's not there.
+ * Put AWKPATH and AWKLIBPATH into ENVIRON if not already there.
* This allows querying it from within awk programs.
*/
- tmp = make_string("AWKPATH", 7);
- if (! in_array(ENVIRON_node, tmp)) {
- /*
- * On VMS, environ[] only holds a subset of what getenv() can
- * find, so look AWKPATH up before resorting to default path.
- */
- val = getenv("AWKPATH");
- if (val == NULL)
- val = defpath;
- aptr = assoc_lookup(ENVIRON_node, tmp, FALSE);
- unref(*aptr);
- *aptr = make_string(val, strlen(val));
- }
- unref(tmp);
+ path_environ("AWKPATH", defpath);
+ path_environ("AWKLIBPATH", deflibpath);
return ENVIRON_node;
}
@@ -1036,16 +1108,32 @@ load_procinfo()
{
#if defined (HAVE_GETGROUPS) && defined(NGROUPS_MAX) && NGROUPS_MAX > 0
int i;
+#endif
+#if (defined (HAVE_GETGROUPS) && defined(NGROUPS_MAX) && NGROUPS_MAX > 0) || defined(HAVE_MPFR)
char name[100];
#endif
AWKNUM value;
+ static bool been_here = false;
+
+ if (been_here)
+ return PROCINFO_node;
- PROCINFO_node = install_symbol(estrdup("PROCINFO", 8),
- mk_symbol(Node_var_array, (NODE *) NULL));
+ been_here = true;
+
+ PROCINFO_node = install_symbol(estrdup("PROCINFO", 8), Node_var_array);
update_PROCINFO_str("version", VERSION);
update_PROCINFO_str("strftime", def_strftime_format);
+#ifdef HAVE_MPFR
+ sprintf(name, "GNU MPFR %s", mpfr_get_version());
+ update_PROCINFO_str("mpfr_version", name);
+ sprintf(name, "GNU MP %s", gmp_version);
+ update_PROCINFO_str("gmp_version", name);
+ update_PROCINFO_num("prec_max", MPFR_PREC_MAX);
+ update_PROCINFO_num("prec_min", MPFR_PREC_MIN);
+#endif
+
#ifdef GETPGRP_VOID
#define getpgrp_arg() /* nothing */
#else
@@ -1120,15 +1208,32 @@ is_std_var(const char *var)
for (vp = varinit; vp->name != NULL; vp++) {
if (strcmp(vp->name, var) == 0) {
if ((do_traditional || do_posix) && (vp->flags & NON_STANDARD) != 0)
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
+/*
+ * is_off_limits_var --- return true if a variable is off limits
+ * to extension functions
+ */
+
+int
+is_off_limits_var(const char *var)
+{
+ const struct varinit *vp;
+
+ for (vp = varinit; vp->name != NULL; vp++) {
+ if (strcmp(vp->name, var) == 0)
+ return ((vp->flags & NOT_OFF_LIMITS) == 0);
+ }
+
+ return false;
+}
/* get_spec_varname --- return the name of a special variable
with the given assign or update routine.
@@ -1152,23 +1257,23 @@ get_spec_varname(Func_ptr fptr)
/* arg_assign --- process a command-line assignment */
int
-arg_assign(char *arg, int initing)
+arg_assign(char *arg, bool initing)
{
char *cp, *cp2;
- int badvar;
+ bool badvar;
NODE *var;
NODE *it;
NODE **lhs;
long save_FNR;
if (! initing && disallow_var_assigns)
- return FALSE; /* --exec */
+ return false; /* --exec */
cp = strchr(arg, '=');
if (cp == NULL) {
if (! initing)
- return FALSE; /* This is file name, not assignment. */
+ return false; /* This is file name, not assignment. */
fprintf(stderr,
_("%s: `%s' argument to `-v' not in `var=value' form\n\n"),
@@ -1185,13 +1290,13 @@ arg_assign(char *arg, int initing)
FNR = 0;
/* first check that the variable name has valid syntax */
- badvar = FALSE;
+ badvar = false;
if (! isalpha((unsigned char) arg[0]) && arg[0] != '_')
- badvar = TRUE;
+ badvar = true;
else
for (cp2 = arg+1; *cp2; cp2++)
if (! isalnum((unsigned char) *cp2) && *cp2 != '_') {
- badvar = TRUE;
+ badvar = true;
break;
}
@@ -1237,12 +1342,12 @@ arg_assign(char *arg, int initing)
cp2 = estrdup(arg, cp - arg); /* var name */
- var = variable(cp2, Node_var);
+ var = variable(0, cp2, Node_var);
if (var == NULL) /* error */
- exit(EXIT_FATAL);
+ final_exit(EXIT_FATAL);
if (var->type == Node_var && var->var_update)
var->var_update();
- lhs = get_lhs(var, FALSE);
+ lhs = get_lhs(var, false);
unref(*lhs);
*lhs = it;
/* check for set_FOO() routine */
@@ -1322,7 +1427,13 @@ nostalgia()
static void
version()
{
- printf("%s\n", version_string);
+ printf("%s", version_string);
+#ifdef HAVE_MPFR
+ printf(" (GNU MPFR %s, GNU MP %s)", mpfr_get_version(), gmp_version);
+#endif
+ printf("\n");
+ print_ext_versions();
+
/*
* Per GNU coding standards, print copyright info,
* then exit successfully, do nothing else.
@@ -1464,3 +1575,18 @@ update_global_values()
vp->update();
}
}
+
+/* getenv_long --- read a long value (>= 0) from an environment var. */
+
+long
+getenv_long(const char *name)
+{
+ const char *val;
+ long newval;
+ if ((val = getenv(name)) != NULL && isdigit((unsigned char) *val)) {
+ for (newval = 0; *val && isdigit((unsigned char) *val); val++)
+ newval = (newval * 10) + *val - '0';
+ return newval;
+ }
+ return -1;
+}
diff --git a/mbsupport.h b/mbsupport.h
index 1eb1a444..9a62486f 100644
--- a/mbsupport.h
+++ b/mbsupport.h
@@ -87,6 +87,17 @@
#define iswalnum isalnum
#define iswalpha isalpha
#define iswupper isupper
+#if defined(ZOS_USS)
+#undef towupper
+#undef towlower
+#undef btowc
+#undef iswalnum
+#undef iswalpha
+#undef iswupper
+#undef wctype
+#undef iswctype
+#undef wcscoll
+#endif
extern wctype_t wctype(const char *name);
extern int iswctype(wint_t wc, wctype_t desc);
diff --git a/missing_d/ChangeLog b/missing_d/ChangeLog
index ff29a926..cb797470 100644
--- a/missing_d/ChangeLog
+++ b/missing_d/ChangeLog
@@ -1,3 +1,7 @@
+2012-09-13 Arnold D. Robbins <arnold@skeeve.com>
+
+ * snprintf.c, strtoul.c: Remove TRUE/FALSE in favor of true/false.
+
2012-05-04 Arnold D. Robbins <arnold@skeeve.com>
* snprintf.c [DJGPP]: Change to __DJGPP__.
diff --git a/missing_d/snprintf.c b/missing_d/snprintf.c
index 12e50925..6cee2bed 100644
--- a/missing_d/snprintf.c
+++ b/missing_d/snprintf.c
@@ -53,14 +53,14 @@ static void close_safe_f()
static FILE *
safe_tmpfile (void)
{
- static short first = TRUE;
+ static bool first = true;
static const char template[] = "snprintfXXXXXX";
int fd;
static char *tmpdir = NULL;
static int len = 0;
if (first) {
- first = FALSE;
+ first = false;
/*
* First try Unix stanadard env var, then Windows var,
* then fall back to /tmp.
diff --git a/missing_d/strtoul.c b/missing_d/strtoul.c
index d2655750..cdd7cf14 100644
--- a/missing_d/strtoul.c
+++ b/missing_d/strtoul.c
@@ -14,8 +14,6 @@
#include <string.h>
#include <errno.h>
#include <limits.h>
-#define TRUE 1
-#define FALSE 0
#define strtoul mystrtoul
#endif
@@ -33,10 +31,10 @@ int base;
unsigned long result = 0UL;
char *nptr_orig = (char *) nptr;
- int neg = FALSE;
+ bool neg = false;
char *cp, c;
int val;
- int sawdigs = FALSE;
+ bool sawdigs = false;
/*
* The strtoul() function converts the initial part of the
@@ -64,7 +62,7 @@ int base;
nptr++;
else if (*nptr == '-') {
nptr++;
- neg = TRUE;
+ neg = true;
}
/*
@@ -110,7 +108,7 @@ int base;
goto out;
result *= base;
result += val;
- sawdigs = TRUE;
+ sawdigs = true;
break;
case 'A': case 'B': case 'C': case 'D': case 'E':
case 'F': case 'G': case 'H': case 'I': case 'J':
@@ -133,7 +131,7 @@ int base;
goto out;
result *= base;
result += val;
- sawdigs = TRUE;
+ sawdigs = true;
break;
default:
goto out;
diff --git a/mpfr.c b/mpfr.c
new file mode 100644
index 00000000..434cd2be
--- /dev/null
+++ b/mpfr.c
@@ -0,0 +1,1620 @@
+/*
+ * mpfr.c - routines for arbitrary-precision number support in gawk.
+ */
+
+/*
+ * Copyright (C) 2012 the Free Software Foundation, Inc.
+ *
+ * This file is part of GAWK, the GNU implementation of the
+ * AWK Programming Language.
+ *
+ * GAWK is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GAWK is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "awk.h"
+
+#ifdef HAVE_MPFR
+
+#if !defined(MPFR_VERSION_MAJOR) || MPFR_VERSION_MAJOR < 3
+typedef mp_exp_t mpfr_exp_t;
+#endif
+
+extern NODE **fmt_list; /* declared in eval.c */
+
+mpz_t mpzval; /* GMP integer type, used as temporary in few places */
+mpz_t MNR;
+mpz_t MFNR;
+bool do_ieee_fmt; /* IEEE-754 floating-point emulation */
+mpfr_rnd_t ROUND_MODE;
+
+static mpfr_rnd_t get_rnd_mode(const char rmode);
+static NODE *mpg_force_number(NODE *n);
+static NODE *mpg_make_number(double);
+static NODE *mpg_format_val(const char *format, int index, NODE *s);
+static int mpg_interpret(INSTRUCTION **cp);
+
+static mpfr_exp_t min_exp = MPFR_EMIN_DEFAULT;
+static mpfr_exp_t max_exp = MPFR_EMAX_DEFAULT;
+
+/* temporaries used in bit ops */
+static NODE *_tz1;
+static NODE *_tz2;
+static mpz_t _mpz1;
+static mpz_t _mpz2;
+static mpz_ptr mpz1;
+static mpz_ptr mpz2;
+
+static NODE *get_bit_ops(const char *op);
+#define free_bit_ops() (DEREF(_tz1), DEREF(_tz2))
+
+/* temporary MPFR floats used to hold converted GMP integer operands */
+static mpfr_t _mpf_t1;
+static mpfr_t _mpf_t2;
+
+/*
+ * PRECISION_MIN is the precision used to initialize _mpf_t1 and _mpf_t2.
+ * 64 bits should be enough for exact conversion of most integers to floats.
+ */
+
+#define PRECISION_MIN 64
+
+/* mf = { _mpf_t1, _mpf_t2 } */
+static inline mpfr_ptr mpg_tofloat(mpfr_ptr mf, mpz_ptr mz);
+/* T = {t1, t2} */
+#define MP_FLOAT(T) is_mpg_integer(T) ? mpg_tofloat(_mpf_##T, (T)->mpg_i) : (T)->mpg_numbr
+
+
+/* init_mpfr --- set up MPFR related variables */
+
+void
+init_mpfr(mpfr_prec_t prec, const char *rmode)
+{
+ mpfr_set_default_prec(prec);
+ ROUND_MODE = get_rnd_mode(rmode[0]);
+ mpfr_set_default_rounding_mode(ROUND_MODE);
+ make_number = mpg_make_number;
+ str2number = mpg_force_number;
+ format_val = mpg_format_val;
+ cmp_numbers = mpg_cmp;
+
+ mpz_init(MNR);
+ mpz_init(MFNR);
+ do_ieee_fmt = false;
+
+ mpz_init(_mpz1);
+ mpz_init(_mpz2);
+ mpfr_init2(_mpf_t1, PRECISION_MIN);
+ mpfr_init2(_mpf_t2, PRECISION_MIN);
+ mpz_init(mpzval);
+
+ register_exec_hook(mpg_interpret, 0);
+}
+
+/* mpg_node --- allocate a node to store MPFR float or GMP integer */
+
+NODE *
+mpg_node(unsigned int tp)
+{
+ NODE *r;
+ getnode(r);
+ r->type = Node_val;
+
+ if (tp == MPFN) {
+ /* Initialize, set precision to the default precision, and value to NaN */
+ mpfr_init(r->mpg_numbr);
+ r->flags = MPFN;
+ } else {
+ /* Initialize and set value to 0 */
+ mpz_init(r->mpg_i);
+ r->flags = MPZN;
+ }
+
+ r->valref = 1;
+ r->flags |= MALLOC|NUMBER|NUMCUR;
+ r->stptr = NULL;
+ r->stlen = 0;
+#if MBS_SUPPORT
+ r->wstptr = NULL;
+ r->wstlen = 0;
+#endif /* defined MBS_SUPPORT */
+ return r;
+}
+
+/*
+ * mpg_make_number --- make a arbitrary-precision number node
+ * and initialize with a C double
+ */
+
+static NODE *
+mpg_make_number(double x)
+{
+ NODE *r;
+ double ival;
+
+ if ((ival = double_to_int(x)) != x) {
+ int tval;
+ r = mpg_float();
+ tval = mpfr_set_d(r->mpg_numbr, x, ROUND_MODE);
+ IEEE_FMT(r->mpg_numbr, tval);
+ } else {
+ r = mpg_integer();
+ mpz_set_d(r->mpg_i, ival);
+ }
+ return r;
+}
+
+/* mpg_strtoui --- assign arbitrary-precision integral value from a string */
+
+int
+mpg_strtoui(mpz_ptr zi, char *str, size_t len, char **end, int base)
+{
+ char *s = str;
+ char *start;
+ int ret = -1;
+
+ /*
+ * mpz_set_str does not like leading 0x or 0X for hex (or 0 for octal)
+ * with a non-zero base argument.
+ */
+ if (base == 16 && len >= 2 && *s == '0' && (s[1] == 'x' || s[1] == 'X')) {
+ s += 2; len -= 2;
+ } else if (base == 8 && len >= 1 && *s == '0') {
+ s++; len--;
+ }
+ start = s;
+
+ while (len > 0) {
+ switch (*s) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ break;
+ case '8':
+ case '9':
+ if (base == 8)
+ goto done;
+ break;
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ if (base == 16)
+ break;
+ default:
+ goto done;
+ }
+ s++; len--;
+ }
+done:
+ if (s > start) {
+ char save = *s;
+ *s = '\0';
+ ret = mpz_set_str(zi, start, base);
+ *s = save;
+ }
+ if (end != NULL)
+ *end = s;
+ return ret;
+}
+
+
+/* mpg_maybe_float --- test if a string may contain arbitrary-precision float */
+
+static int
+mpg_maybe_float(const char *str, int use_locale)
+{
+ int dec_point = '.';
+ const char *s = str;
+
+#if defined(HAVE_LOCALE_H)
+ /*
+ * loc.decimal_point may not have been initialized yet,
+ * so double check it before using it.
+ */
+ if (use_locale && loc.decimal_point != NULL && loc.decimal_point[0] != '\0')
+ dec_point = loc.decimal_point[0]; /* XXX --- assumes one char */
+#endif
+
+ if (strlen(s) >= 3
+ && ( ( (s[0] == 'i' || s[0] == 'I')
+ && (s[1] == 'n' || s[1] == 'N')
+ && (s[2] == 'f' || s[2] == 'F'))
+ || ( (s[0] == 'n' || s[0] == 'N')
+ && (s[1] == 'a' || s[1] == 'A')
+ && (s[2] == 'n' || s[2] == 'N'))))
+ return true;
+
+ for (; *s != '\0'; s++) {
+ if (*s == dec_point || *s == 'e' || *s == 'E')
+ return true;
+ }
+
+ return false;
+}
+
+
+/* mpg_zero --- initialize with arbitrary-precision integer(GMP) and set value to zero */
+
+static inline void
+mpg_zero(NODE *n)
+{
+ if (is_mpg_float(n)) {
+ mpfr_clear(n->mpg_numbr);
+ n->flags &= ~MPFN;
+ }
+ if (! is_mpg_integer(n)) {
+ mpz_init(n->mpg_i); /* this also sets its value to 0 */
+ n->flags |= MPZN;
+ } else
+ mpz_set_si(n->mpg_i, 0);
+}
+
+
+/* force_mpnum --- force a value to be a GMP integer or MPFR float */
+
+static int
+force_mpnum(NODE *n, int do_nondec, int use_locale)
+{
+ char *cp, *cpend, *ptr, *cp1;
+ char save;
+ int tval, base = 10;
+
+ if (n->stlen == 0) {
+ mpg_zero(n);
+ return false;
+ }
+
+ cp = n->stptr;
+ cpend = n->stptr + n->stlen;
+ while (cp < cpend && isspace((unsigned char) *cp))
+ cp++;
+ if (cp == cpend) { /* only spaces */
+ mpg_zero(n);
+ return false;
+ }
+
+ save = *cpend;
+ *cpend = '\0';
+
+ if (*cp == '+' || *cp == '-')
+ cp1 = cp + 1;
+ else
+ cp1 = cp;
+
+ if (do_nondec)
+ base = get_numbase(cp1, use_locale);
+
+ if (! mpg_maybe_float(cp1, use_locale)) {
+ mpg_zero(n);
+ errno = 0;
+ mpg_strtoui(n->mpg_i, cp1, cpend - cp1, & ptr, base);
+ if (*cp == '-')
+ mpz_neg(n->mpg_i, n->mpg_i);
+ goto done;
+ }
+
+ if (is_mpg_integer(n)) {
+ mpz_clear(n->mpg_i);
+ n->flags &= ~MPZN;
+ }
+
+ if (! is_mpg_float(n)) {
+ mpfr_init(n->mpg_numbr);
+ n->flags |= MPFN;
+ }
+
+ errno = 0;
+ tval = mpfr_strtofr(n->mpg_numbr, cp, & ptr, base, ROUND_MODE);
+ IEEE_FMT(n->mpg_numbr, tval);
+done:
+ /* trailing space is OK for NUMBER */
+ while (isspace((unsigned char) *ptr))
+ ptr++;
+ *cpend = save;
+ if (errno == 0 && ptr == cpend)
+ return true;
+ errno = 0;
+ return false;
+}
+
+/* mpg_force_number --- force a value to be a multiple-precision number */
+
+static NODE *
+mpg_force_number(NODE *n)
+{
+ unsigned int newflags = 0;
+
+ if (is_mpg_number(n) && (n->flags & NUMCUR))
+ return n;
+
+ if (n->flags & MAYBE_NUM) {
+ n->flags &= ~MAYBE_NUM;
+ newflags = NUMBER;
+ }
+
+ if (force_mpnum(n, (do_non_decimal_data && ! do_traditional), true)) {
+ n->flags |= newflags;
+ n->flags |= NUMCUR;
+ }
+ return n;
+}
+
+/* mpg_format_val --- format a numeric value based on format */
+
+static NODE *
+mpg_format_val(const char *format, int index, NODE *s)
+{
+ NODE *dummy[2], *r;
+ unsigned int oflags;
+
+ /* create dummy node for a sole use of format_tree */
+ dummy[1] = s;
+ oflags = s->flags;
+
+ if (is_mpg_integer(s) || mpfr_integer_p(s->mpg_numbr)) {
+ /* integral value, use %d */
+ r = format_tree("%d", 2, dummy, 2);
+ s->stfmt = -1;
+ } else {
+ r = format_tree(format, fmt_list[index]->stlen, dummy, 2);
+ assert(r != NULL);
+ s->stfmt = (char) index;
+ }
+ s->flags = oflags;
+ s->stlen = r->stlen;
+ if ((s->flags & STRCUR) != 0)
+ efree(s->stptr);
+ s->stptr = r->stptr;
+ freenode(r); /* Do not unref(r)! We want to keep s->stptr == r->stpr. */
+
+ s->flags |= STRCUR;
+ free_wstr(s);
+ return s;
+}
+
+/* mpg_cmp --- compare two numbers */
+
+int
+mpg_cmp(const NODE *t1, const NODE *t2)
+{
+ /*
+ * For the purposes of sorting, NaN is considered greater than
+ * any other value, and all NaN values are considered equivalent and equal.
+ */
+
+ if (is_mpg_float(t1)) {
+ if (is_mpg_float(t2)) {
+ if (mpfr_nan_p(t1->mpg_numbr))
+ return ! mpfr_nan_p(t2->mpg_numbr);
+ if (mpfr_nan_p(t2->mpg_numbr))
+ return -1;
+ return mpfr_cmp(t1->mpg_numbr, t2->mpg_numbr);
+ }
+ if (mpfr_nan_p(t1->mpg_numbr))
+ return 1;
+ return mpfr_cmp_z(t1->mpg_numbr, t2->mpg_i);
+ } else if (is_mpg_float(t2)) {
+ int ret;
+ if (mpfr_nan_p(t2->mpg_numbr))
+ return -1;
+ ret = mpfr_cmp_z(t2->mpg_numbr, t1->mpg_i);
+ return ret > 0 ? -1 : (ret < 0);
+ } else if (is_mpg_integer(t1)) {
+ return mpz_cmp(t1->mpg_i, t2->mpg_i);
+ }
+
+ /* t1 and t2 are AWKNUMs */
+ return cmp_awknums(t1, t2);
+}
+
+
+/*
+ * mpg_update_var --- update NR or FNR.
+ * NR_node->var_value(mpz_t) = MNR(mpz_t) * LONG_MAX + NR(long)
+ */
+
+NODE *
+mpg_update_var(NODE *n)
+{
+ NODE *val = n->var_value;
+ long nr = 0;
+ mpz_ptr nq = 0;
+
+ if (n == NR_node) {
+ nr = NR;
+ nq = MNR;
+ } else if (n == FNR_node) {
+ nr = FNR;
+ nq = MFNR;
+ } else
+ cant_happen();
+
+ if (mpz_sgn(nq) == 0) {
+ /* Efficiency hack similar to that for AWKNUM */
+ if (is_mpg_float(val) || mpz_get_si(val->mpg_i) != nr) {
+ unref(n->var_value);
+ val = n->var_value = mpg_integer();
+ mpz_set_si(val->mpg_i, nr);
+ }
+ } else {
+ unref(n->var_value);
+ val = n->var_value = mpg_integer();
+ mpz_set_si(val->mpg_i, nr);
+ mpz_addmul_ui(val->mpg_i, nq, LONG_MAX); /* val->mpg_i += nq * LONG_MAX */
+ }
+ return val;
+}
+
+/* mpg_set_var --- set NR or FNR */
+
+long
+mpg_set_var(NODE *n)
+{
+ long nr = 0;
+ mpz_ptr nq = 0, r;
+ NODE *val = n->var_value;
+
+ if (n == NR_node)
+ nq = MNR;
+ else if (n == FNR_node)
+ nq = MFNR;
+ else
+ cant_happen();
+
+ if (is_mpg_integer(val))
+ r = val->mpg_i;
+ else {
+ /* convert float to integer */
+ mpfr_get_z(mpzval, val->mpg_numbr, MPFR_RNDZ);
+ r = mpzval;
+ }
+ nr = mpz_fdiv_q_ui(nq, r, LONG_MAX); /* nq (MNR or MFNR) is quotient */
+ return nr; /* remainder (NR or FNR) */
+}
+
+/* set_PREC --- update MPFR PRECISION related variables when PREC assigned to */
+
+void
+set_PREC()
+{
+ long prec = 0;
+ NODE *val;
+ static const struct ieee_fmt {
+ const char *name;
+ mpfr_prec_t precision;
+ mpfr_exp_t emax;
+ mpfr_exp_t emin;
+ } ieee_fmts[] = {
+{ "half", 11, 16, -23 }, /* binary16 */
+{ "single", 24, 128, -148 }, /* binary32 */
+{ "double", 53, 1024, -1073 }, /* binary64 */
+{ "quad", 113, 16384, -16493 }, /* binary128 */
+{ "oct", 237, 262144, -262377 }, /* binary256, not in the IEEE 754-2008 standard */
+
+ /*
+ * For any bitwidth = 32 * k ( k >= 4),
+ * precision = 13 + bitwidth - int(4 * log2(bitwidth))
+ * emax = 1 << bitwidth - precision - 1
+ * emin = 4 - emax - precision
+ */
+ };
+
+ if (! do_mpfr)
+ return;
+
+ val = PREC_node->var_value;
+ if (val->flags & MAYBE_NUM)
+ force_number(val);
+
+ if ((val->flags & (STRING|NUMBER)) == STRING) {
+ int i, j;
+
+ /* emulate IEEE-754 binary format */
+
+ for (i = 0, j = sizeof(ieee_fmts)/sizeof(ieee_fmts[0]); i < j; i++) {
+ if (strcasecmp(ieee_fmts[i].name, val->stptr) == 0)
+ break;
+ }
+
+ if (i < j) {
+ prec = ieee_fmts[i].precision;
+
+ /*
+ * We *DO NOT* change the MPFR exponent range using
+ * mpfr_set_{emin, emax} here. See format_ieee() for details.
+ */
+ max_exp = ieee_fmts[i].emax;
+ min_exp = ieee_fmts[i].emin;
+
+ do_ieee_fmt = true;
+ }
+ }
+
+ if (prec <= 0) {
+ force_number(val);
+ prec = get_number_si(val);
+ if (prec < MPFR_PREC_MIN || prec > MPFR_PREC_MAX) {
+ force_string(val);
+ warning(_("PREC value `%.*s' is invalid"), (int) val->stlen, val->stptr);
+ prec = 0;
+ } else
+ do_ieee_fmt = false;
+ }
+
+ if (prec > 0)
+ mpfr_set_default_prec(prec);
+}
+
+
+/* get_rnd_mode --- convert string to MPFR rounding mode */
+
+static mpfr_rnd_t
+get_rnd_mode(const char rmode)
+{
+ switch (rmode) {
+ case 'N':
+ case 'n':
+ return MPFR_RNDN; /* round to nearest (IEEE-754 roundTiesToEven) */
+ case 'Z':
+ case 'z':
+ return MPFR_RNDZ; /* round toward zero (IEEE-754 roundTowardZero) */
+ case 'U':
+ case 'u':
+ return MPFR_RNDU; /* round toward plus infinity (IEEE-754 roundTowardPositive) */
+ case 'D':
+ case 'd':
+ return MPFR_RNDD; /* round toward minus infinity (IEEE-754 roundTowardNegative) */
+#if defined(MPFR_VERSION_MAJOR) && MPFR_VERSION_MAJOR > 2
+ case 'A':
+ case 'a':
+ return MPFR_RNDA; /* round away from zero (IEEE-754 roundTiesToAway) */
+#endif
+ default:
+ break;
+ }
+ return -1;
+}
+
+/*
+ * set_ROUNDMODE --- update MPFR rounding mode related variables
+ * when ROUNDMODE assigned to
+ */
+
+void
+set_ROUNDMODE()
+{
+ if (do_mpfr) {
+ mpfr_rnd_t rndm = -1;
+ NODE *n;
+ n = force_string(ROUNDMODE_node->var_value);
+ if (n->stlen == 1)
+ rndm = get_rnd_mode(n->stptr[0]);
+ if (rndm != -1) {
+ mpfr_set_default_rounding_mode(rndm);
+ ROUND_MODE = rndm;
+ } else
+ warning(_("RNDMODE value `%.*s' is invalid"), (int) n->stlen, n->stptr);
+ }
+}
+
+
+/* format_ieee --- make sure a number follows IEEE-754 floating-point standard */
+
+int
+format_ieee(mpfr_ptr x, int tval)
+{
+ /*
+ * The MPFR doc says that it's our responsibility to make sure all numbers
+ * including those previously created are in range after we've changed the
+ * exponent range. Most MPFR operations and functions require
+ * the input arguments to have exponents within the current exponent range.
+ * Any argument outside the range results in a MPFR assertion failure
+ * like this:
+ *
+ * $ gawk -M 'BEGIN { x=1.0e-10000; print x+0; PREC="double"; print x+0}'
+ * 1e-10000
+ * init2.c:52: MPFR assertion failed ....
+ *
+ * A "naive" approach would be to keep track of the ternary state and
+ * the rounding mode for each number, and make sure it is in the current
+ * exponent range (using mpfr_check_range) before using it in an
+ * operation or function. Instead, we adopt the following strategy.
+ *
+ * When gawk starts, the exponent range is the MPFR default
+ * [MPFR_EMIN_DEFAULT, MPFR_EMAX_DEFAULT]. Any number that gawk
+ * creates must have exponent in this range (excluding infinities, NaNs and zeros).
+ * Each MPFR operation or function is performed with this default exponent
+ * range.
+ *
+ * When emulating IEEE-754 format, the exponents are *temporarily* changed,
+ * mpfr_check_range is called to make sure the number is in the new range,
+ * and mpfr_subnormalize is used to round following the rules of subnormal
+ * arithmetic. The exponent range is then *restored* to the original value
+ * [MPFR_EMIN_DEFAULT, MPFR_EMAX_DEFAULT].
+ */
+
+ (void) mpfr_set_emin(min_exp);
+ (void) mpfr_set_emax(max_exp);
+ tval = mpfr_check_range(x, tval, ROUND_MODE);
+ tval = mpfr_subnormalize(x, tval, ROUND_MODE);
+ (void) mpfr_set_emin(MPFR_EMIN_DEFAULT);
+ (void) mpfr_set_emax(MPFR_EMAX_DEFAULT);
+ return tval;
+}
+
+
+/* do_mpfr_atan2 --- do the atan2 function */
+
+NODE *
+do_mpfr_atan2(int nargs)
+{
+ NODE *t1, *t2, *res;
+ mpfr_ptr p1, p2;
+ int tval;
+
+ t2 = POP_SCALAR();
+ t1 = POP_SCALAR();
+
+ if (do_lint) {
+ if ((t1->flags & (NUMCUR|NUMBER)) == 0)
+ lintwarn(_("atan2: received non-numeric first argument"));
+ if ((t2->flags & (NUMCUR|NUMBER)) == 0)
+ lintwarn(_("atan2: received non-numeric second argument"));
+ }
+ force_number(t1);
+ force_number(t2);
+
+ p1 = MP_FLOAT(t1);
+ p2 = MP_FLOAT(t2);
+ res = mpg_float();
+ /* See MPFR documentation for handling of special values like +inf as an argument */
+ tval = mpfr_atan2(res->mpg_numbr, p1, p2, ROUND_MODE);
+ IEEE_FMT(res->mpg_numbr, tval);
+
+ DEREF(t1);
+ DEREF(t2);
+ return res;
+}
+
+
+#define SPEC_MATH(X) \
+NODE *t1, *res; \
+mpfr_ptr p1; \
+int tval; \
+t1 = POP_SCALAR(); \
+if (do_lint && (t1->flags & (NUMCUR|NUMBER)) == 0) \
+ lintwarn(_("%s: received non-numeric argument"), #X); \
+force_number(t1); \
+p1 = MP_FLOAT(t1); \
+res = mpg_float(); \
+tval = mpfr_##X(res->mpg_numbr, p1, ROUND_MODE); \
+IEEE_FMT(res->mpg_numbr, tval); \
+DEREF(t1); \
+return res
+
+
+/* do_mpfr_sin --- do the sin function */
+
+NODE *
+do_mpfr_sin(int nargs)
+{
+ SPEC_MATH(sin);
+}
+
+/* do_mpfr_cos --- do the cos function */
+
+NODE *
+do_mpfr_cos(int nargs)
+{
+ SPEC_MATH(cos);
+}
+
+/* do_mpfr_exp --- exponential function */
+
+NODE *
+do_mpfr_exp(int nargs)
+{
+ SPEC_MATH(exp);
+}
+
+/* do_mpfr_log --- the log function */
+
+NODE *
+do_mpfr_log(int nargs)
+{
+ SPEC_MATH(log);
+}
+
+/* do_mpfr_sqrt --- do the sqrt function */
+
+NODE *
+do_mpfr_sqrt(int nargs)
+{
+ SPEC_MATH(sqrt);
+}
+
+/* do_mpfr_int --- convert double to int for awk */
+
+NODE *
+do_mpfr_int(int nargs)
+{
+ NODE *tmp, *r;
+
+ tmp = POP_SCALAR();
+ if (do_lint && (tmp->flags & (NUMCUR|NUMBER)) == 0)
+ lintwarn(_("int: received non-numeric argument"));
+ force_number(tmp);
+
+ if (is_mpg_integer(tmp)) {
+ r = mpg_integer();
+ mpz_set(r->mpg_i, tmp->mpg_i);
+ } else {
+ if (! mpfr_number_p(tmp->mpg_numbr)) {
+ /* [+-]inf or NaN */
+ return tmp;
+ }
+
+ r = mpg_integer();
+ mpfr_get_z(r->mpg_i, tmp->mpg_numbr, MPFR_RNDZ);
+ }
+
+ DEREF(tmp);
+ return r;
+}
+
+/* do_mpfr_compl --- perform a ~ operation */
+
+NODE *
+do_mpfr_compl(int nargs)
+{
+ NODE *tmp, *r;
+ mpz_ptr zptr;
+
+ tmp = POP_SCALAR();
+ if (do_lint && (tmp->flags & (NUMCUR|NUMBER)) == 0)
+ lintwarn(_("compl: received non-numeric argument"));
+
+ force_number(tmp);
+ if (is_mpg_float(tmp)) {
+ mpfr_ptr p = tmp->mpg_numbr;
+
+ if (! mpfr_number_p(p)) {
+ /* [+-]inf or NaN */
+ return tmp;
+ }
+ if (do_lint) {
+ if (mpfr_sgn(p) < 0)
+ lintwarn("%s",
+ mpg_fmt(_("compl(%Rg): negative value will give strange results"), p)
+ );
+ if (! mpfr_integer_p(p))
+ lintwarn("%s",
+ mpg_fmt(_("comp(%Rg): fractional value will be truncated"), p)
+ );
+ }
+
+ mpfr_get_z(mpzval, p, MPFR_RNDZ); /* float to integer conversion */
+ zptr = mpzval;
+ } else {
+ /* (tmp->flags & MPZN) != 0 */
+ zptr = tmp->mpg_i;
+ if (do_lint) {
+ if (mpz_sgn(zptr) < 0)
+ lintwarn("%s",
+ mpg_fmt(_("cmpl(%Zd): negative values will give strange results"), zptr)
+ );
+ }
+ }
+
+ r = mpg_integer();
+ mpz_com(r->mpg_i, zptr);
+ DEREF(tmp);
+ return r;
+}
+
+
+/*
+ * get_bit_ops --- get the numeric operands of a binary function.
+ * Returns a copy of the operand if either is inf or nan. Otherwise
+ * each operand is converted to an integer if necessary, and
+ * the results are placed in the variables mpz1 and mpz2.
+ */
+
+static NODE *
+get_bit_ops(const char *op)
+{
+ _tz2 = POP_SCALAR();
+ _tz1 = POP_SCALAR();
+
+ if (do_lint) {
+ if ((_tz1->flags & (NUMCUR|NUMBER)) == 0)
+ lintwarn(_("%s: received non-numeric first argument"), op);
+ if ((_tz2->flags & (NUMCUR|NUMBER)) == 0)
+ lintwarn(_("%s: received non-numeric second argument"), op);
+ }
+
+ force_number(_tz1);
+ force_number(_tz2);
+
+ if (is_mpg_float(_tz1)) {
+ mpfr_ptr left = _tz1->mpg_numbr;
+ if (! mpfr_number_p(left)) {
+ /* inf or NaN */
+ NODE *res;
+ res = mpg_float();
+ mpfr_set(res->mpg_numbr, _tz1->mpg_numbr, ROUND_MODE);
+ return res;
+ }
+
+ if (do_lint) {
+ if (mpfr_sgn(left) < 0)
+ lintwarn("%s",
+ mpg_fmt(_("%s(%Rg, ..): negative values will give strange results"),
+ op, left)
+ );
+ if (! mpfr_integer_p(left))
+ lintwarn("%s",
+ mpg_fmt(_("%s(%Rg, ..): fractional values will be truncated"),
+ op, left)
+ );
+ }
+
+ mpfr_get_z(_mpz1, left, MPFR_RNDZ); /* float to integer conversion */
+ mpz1 = _mpz1;
+ } else {
+ /* (_tz1->flags & MPZN) != 0 */
+ mpz1 = _tz1->mpg_i;
+ if (do_lint) {
+ if (mpz_sgn(mpz1) < 0)
+ lintwarn("%s",
+ mpg_fmt(_("%s(%Zd, ..): negative values will give strange results"),
+ op, mpz1)
+ );
+ }
+ }
+
+ if (is_mpg_float(_tz2)) {
+ mpfr_ptr right = _tz2->mpg_numbr;
+ if (! mpfr_number_p(right)) {
+ /* inf or NaN */
+ NODE *res;
+ res = mpg_float();
+ mpfr_set(res->mpg_numbr, _tz2->mpg_numbr, ROUND_MODE);
+ return res;
+ }
+
+ if (do_lint) {
+ if (mpfr_sgn(right) < 0)
+ lintwarn("%s",
+ mpg_fmt(_("%s(.., %Rg): negative values will give strange results"),
+ op, right)
+ );
+ if (! mpfr_integer_p(right))
+ lintwarn("%s",
+ mpg_fmt(_("%s(.., %Rg): fractional values will be truncated"),
+ op, right)
+ );
+ }
+
+ mpfr_get_z(_mpz2, right, MPFR_RNDZ); /* float to integer conversion */
+ mpz2 = _mpz2;
+ } else {
+ /* (_tz2->flags & MPZN) != 0 */
+ mpz2 = _tz2->mpg_i;
+ if (do_lint) {
+ if (mpz_sgn(mpz2) < 0)
+ lintwarn("%s",
+ mpg_fmt(_("%s(.., %Zd): negative values will give strange results"),
+ op, mpz2)
+ );
+ }
+ }
+
+ return NULL;
+}
+
+/* do_mpfr_lshift --- perform a << operation */
+
+NODE *
+do_mpfr_lshift(int nargs)
+{
+ NODE *res;
+ unsigned long shift;
+
+ if ((res = get_bit_ops("lshift")) == NULL) {
+
+ /*
+ * mpz_get_ui: If op is too big to fit an unsigned long then just
+ * the least significant bits that do fit are returned.
+ * The sign of op is ignored, only the absolute value is used.
+ */
+
+ shift = mpz_get_ui(mpz2); /* GMP integer => unsigned long conversion */
+ res = mpg_integer();
+ mpz_mul_2exp(res->mpg_i, mpz1, shift); /* res = mpz1 * 2^shift */
+ }
+ free_bit_ops();
+ return res;
+}
+
+/* do_mpfr_rshift --- perform a >> operation */
+
+NODE *
+do_mpfr_rhift(int nargs)
+{
+ NODE *res;
+ unsigned long shift;
+
+ if ((res = get_bit_ops("rshift")) == NULL) {
+ /*
+ * mpz_get_ui: If op is too big to fit an unsigned long then just
+ * the least significant bits that do fit are returned.
+ * The sign of op is ignored, only the absolute value is used.
+ */
+
+ shift = mpz_get_ui(mpz2); /* GMP integer => unsigned long conversion */
+ res = mpg_integer();
+ mpz_fdiv_q_2exp(res->mpg_i, mpz1, shift); /* res = mpz1 / 2^shift, round towards −inf */
+ }
+ free_bit_ops();
+ return res;
+}
+
+/* do_mpfr_and --- perform an & operation */
+
+NODE *
+do_mpfr_and(int nargs)
+{
+ NODE *res;
+
+ if ((res = get_bit_ops("and")) == NULL) {
+ res = mpg_integer();
+ mpz_and(res->mpg_i, mpz1, mpz2);
+ }
+ free_bit_ops();
+ return res;
+}
+
+/* do_mpfr_or --- perform an | operation */
+
+NODE *
+do_mpfr_or(int nargs)
+{
+ NODE *res;
+
+ if ((res = get_bit_ops("or")) == NULL) {
+ res = mpg_integer();
+ mpz_ior(res->mpg_i, mpz1, mpz2);
+ }
+ free_bit_ops();
+ return res;
+}
+
+/* do_mpfr_strtonum --- the strtonum function */
+
+NODE *
+do_mpfr_strtonum(int nargs)
+{
+ NODE *tmp, *r;
+
+ tmp = POP_SCALAR();
+ if ((tmp->flags & (NUMBER|NUMCUR)) == 0) {
+ r = mpg_integer(); /* will be changed to MPFR float if necessary in force_mpnum() */
+ r->stptr = tmp->stptr;
+ r->stlen = tmp->stlen;
+ force_mpnum(r, true, use_lc_numeric);
+ r->stptr = NULL;
+ r->stlen = 0;
+ } else {
+ (void) force_number(tmp);
+ if (is_mpg_float(tmp)) {
+ int tval;
+ r = mpg_float();
+ tval = mpfr_set(r->mpg_numbr, tmp->mpg_numbr, ROUND_MODE);
+ IEEE_FMT(r->mpg_numbr, tval);
+ } else {
+ r = mpg_integer();
+ mpz_set(r->mpg_i, tmp->mpg_i);
+ }
+ }
+
+ DEREF(tmp);
+ return r;
+}
+
+/* do_mpfr_xor --- perform an ^ operation */
+
+NODE *
+do_mpfr_xor(int nargs)
+{
+ NODE *res;
+
+ if ((res = get_bit_ops("xor")) == NULL) {
+ res = mpg_integer();
+ mpz_xor(res->mpg_i, mpz1, mpz2);
+ }
+ free_bit_ops();
+ return res;
+}
+
+
+static bool firstrand = true;
+static gmp_randstate_t state;
+static mpz_t seed; /* current seed */
+
+/* do_mpfr_rand --- do the rand function */
+
+NODE *
+do_mpfr_rand(int nargs ATTRIBUTE_UNUSED)
+{
+ NODE *res;
+ int tval;
+
+ if (firstrand) {
+#if 0
+ /* Choose the default algorithm */
+ gmp_randinit_default(state);
+#endif
+ /*
+ * Choose a specific (Mersenne Twister) algorithm in case the default
+ * changes in the future.
+ */
+
+ gmp_randinit_mt(state);
+
+ mpz_init(seed);
+ mpz_set_ui(seed, 1);
+ /* seed state */
+ gmp_randseed(state, seed);
+ firstrand = false;
+ }
+ res = mpg_float();
+ tval = mpfr_urandomb(res->mpg_numbr, state);
+ IEEE_FMT(res->mpg_numbr, tval);
+ return res;
+}
+
+
+/* do_mpfr_srand --- seed the random number generator */
+
+NODE *
+do_mpfr_srand(int nargs)
+{
+ NODE *res;
+
+ if (firstrand) {
+#if 0
+ /* Choose the default algorithm */
+ gmp_randinit_default(state);
+#endif
+ /*
+ * Choose a specific algorithm (Mersenne Twister) in case default
+ * changes in the future.
+ */
+
+ gmp_randinit_mt(state);
+
+ mpz_init(seed);
+ mpz_set_ui(seed, 1);
+ /* No need to seed state, will change it below */
+ firstrand = false;
+ }
+
+ res = mpg_integer();
+ mpz_set(res->mpg_i, seed); /* previous seed */
+
+ if (nargs == 0)
+ mpz_set_ui(seed, (unsigned long) time((time_t *) 0));
+ else {
+ NODE *tmp;
+ tmp = POP_SCALAR();
+ if (do_lint && (tmp->flags & (NUMCUR|NUMBER)) == 0)
+ lintwarn(_("srand: received non-numeric argument"));
+ force_number(tmp);
+ if (is_mpg_float(tmp))
+ mpfr_get_z(seed, tmp->mpg_numbr, MPFR_RNDZ);
+ else /* MP integer */
+ mpz_set(seed, tmp->mpg_i);
+ DEREF(tmp);
+ }
+
+ gmp_randseed(state, seed);
+ return res;
+}
+
+/*
+ * mpg_tofloat --- convert an arbitrary-precision integer operand to
+ * a float without loss of precision. It is assumed that the
+ * MPFR variable has already been initialized.
+ */
+
+static inline mpfr_ptr
+mpg_tofloat(mpfr_ptr mf, mpz_ptr mz)
+{
+ size_t prec;
+
+ /*
+ * When implicitely converting a GMP integer operand to a MPFR float, use
+ * a precision sufficiently large to hold the converted value exactly.
+ *
+ * $ ./gawk -M 'BEGIN { print 13 % 2 }'
+ * 1
+ * If the user-specified precision is used to convert the integer 13 to a
+ * float, one will get:
+ * $ ./gawk -M 'BEGIN { PREC=2; print 13 % 2.0 }'
+ * 0
+ */
+
+ prec = mpz_sizeinbase(mz, 2); /* most significant 1 bit position starting at 1 */
+ if (prec > PRECISION_MIN) {
+ prec -= (size_t) mpz_scan1(mz, 0); /* least significant 1 bit index starting at 0 */
+ if (prec > MPFR_PREC_MAX)
+ prec = MPFR_PREC_MAX;
+ if (prec > PRECISION_MIN)
+ mpfr_set_prec(mf, prec);
+ }
+
+ mpfr_set_z(mf, mz, ROUND_MODE);
+ return mf;
+}
+
+
+/* mpg_add --- add arbitrary-precision numbers */
+
+static NODE *
+mpg_add(NODE *t1, NODE *t2)
+{
+ NODE *r;
+ int tval;
+
+ if (is_mpg_integer(t1) && is_mpg_integer(t2)) {
+ r = mpg_integer();
+ mpz_add(r->mpg_i, t1->mpg_i, t2->mpg_i);
+ } else {
+ r = mpg_float();
+ if (is_mpg_integer(t2))
+ tval = mpfr_add_z(r->mpg_numbr, t1->mpg_numbr, t2->mpg_i, ROUND_MODE);
+ else if (is_mpg_integer(t1))
+ tval = mpfr_add_z(r->mpg_numbr, t2->mpg_numbr, t1->mpg_i, ROUND_MODE);
+ else
+ tval = mpfr_add(r->mpg_numbr, t1->mpg_numbr, t2->mpg_numbr, ROUND_MODE);
+ IEEE_FMT(r->mpg_numbr, tval);
+ }
+ return r;
+}
+
+/* mpg_sub --- subtract arbitrary-precision numbers */
+
+static NODE *
+mpg_sub(NODE *t1, NODE *t2)
+{
+ NODE *r;
+ int tval;
+
+ if (is_mpg_integer(t1) && is_mpg_integer(t2)) {
+ r = mpg_integer();
+ mpz_sub(r->mpg_i, t1->mpg_i, t2->mpg_i);
+ } else {
+ r = mpg_float();
+ if (is_mpg_integer(t2))
+ tval = mpfr_sub_z(r->mpg_numbr, t1->mpg_numbr, t2->mpg_i, ROUND_MODE);
+ else if (is_mpg_integer(t1)) {
+#if (!defined(MPFR_VERSION) || (MPFR_VERSION < MPFR_VERSION_NUM(3,1,0)))
+ NODE *tmp = t1;
+ t1 = t2;
+ t2 = tmp;
+ tval = mpfr_sub_z(r->mpg_numbr, t1->mpg_numbr, t2->mpg_i, ROUND_MODE);
+ tval = mpfr_neg(r->mpg_numbr, r->mpg_numbr, ROUND_MODE);
+ t2 = t1;
+ t1 = tmp;
+#else
+ tval = mpfr_z_sub(r->mpg_numbr, t1->mpg_i, t2->mpg_numbr, ROUND_MODE);
+#endif
+ } else
+ tval = mpfr_sub(r->mpg_numbr, t1->mpg_numbr, t2->mpg_numbr, ROUND_MODE);
+ IEEE_FMT(r->mpg_numbr, tval);
+ }
+ return r;
+}
+
+/* mpg_mul --- multiply arbitrary-precision numbers */
+
+static NODE *
+mpg_mul(NODE *t1, NODE *t2)
+{
+ NODE *r;
+ int tval;
+
+ if (is_mpg_integer(t1) && is_mpg_integer(t2)) {
+ r = mpg_integer();
+ mpz_mul(r->mpg_i, t1->mpg_i, t2->mpg_i);
+ } else {
+ r = mpg_float();
+ if (is_mpg_integer(t2))
+ tval = mpfr_mul_z(r->mpg_numbr, t1->mpg_numbr, t2->mpg_i, ROUND_MODE);
+ else if (is_mpg_integer(t1))
+ tval = mpfr_mul_z(r->mpg_numbr, t2->mpg_numbr, t1->mpg_i, ROUND_MODE);
+ else
+ tval = mpfr_mul(r->mpg_numbr, t1->mpg_numbr, t2->mpg_numbr, ROUND_MODE);
+ IEEE_FMT(r->mpg_numbr, tval);
+ }
+ return r;
+}
+
+
+/* mpg_pow --- exponentiation involving arbitrary-precision numbers */
+
+static NODE *
+mpg_pow(NODE *t1, NODE *t2)
+{
+ NODE *r;
+ int tval;
+
+ if (is_mpg_integer(t1) && is_mpg_integer(t2)) {
+ if (mpz_sgn(t2->mpg_i) >= 0 && mpz_fits_ulong_p(t2->mpg_i)) {
+ r = mpg_integer();
+ mpz_pow_ui(r->mpg_i, t1->mpg_i, mpz_get_ui(t2->mpg_i));
+ } else {
+ mpfr_ptr p1, p2;
+ p1 = MP_FLOAT(t1);
+ p2 = MP_FLOAT(t2);
+ r = mpg_float();
+ tval = mpfr_pow(r->mpg_numbr, p1, p2, ROUND_MODE);
+ IEEE_FMT(r->mpg_numbr, tval);
+ }
+ } else {
+ r = mpg_float();
+ if (is_mpg_integer(t2))
+ tval = mpfr_pow_z(r->mpg_numbr, t1->mpg_numbr, t2->mpg_i, ROUND_MODE);
+ else {
+ mpfr_ptr p1;
+ p1 = MP_FLOAT(t1);
+ tval = mpfr_pow(r->mpg_numbr, p1, t2->mpg_numbr, ROUND_MODE);
+ }
+ IEEE_FMT(r->mpg_numbr, tval);
+ }
+ return r;
+}
+
+/* mpg_div --- arbitrary-precision division */
+
+static NODE *
+mpg_div(NODE *t1, NODE *t2)
+{
+ NODE *r;
+ int tval;
+
+ if (is_mpg_integer(t1) && is_mpg_integer(t2)
+ && (mpz_sgn(t2->mpg_i) != 0) /* not dividing by 0 */
+ && mpz_divisible_p(t1->mpg_i, t2->mpg_i)
+ ) {
+ r = mpg_integer();
+ mpz_divexact(r->mpg_i, t1->mpg_i, t2->mpg_i);
+ } else {
+ mpfr_ptr p1, p2;
+ p1 = MP_FLOAT(t1);
+ p2 = MP_FLOAT(t2);
+ r = mpg_float();
+ tval = mpfr_div(r->mpg_numbr, p1, p2, ROUND_MODE);
+ IEEE_FMT(r->mpg_numbr, tval);
+ }
+ return r;
+}
+
+/* mpg_mod --- modulus operation with arbitrary-precision numbers */
+
+static NODE *
+mpg_mod(NODE *t1, NODE *t2)
+{
+ NODE *r;
+ int tval;
+
+ if (is_mpg_integer(t1) && is_mpg_integer(t2)) {
+ r = mpg_integer();
+ mpz_mod(r->mpg_i, t1->mpg_i, t2->mpg_i);
+ } else {
+ mpfr_ptr p1, p2;
+ p1 = MP_FLOAT(t1);
+ p2 = MP_FLOAT(t2);
+ r = mpg_float();
+ tval = mpfr_fmod(r->mpg_numbr, p1, p2, ROUND_MODE);
+ IEEE_FMT(r->mpg_numbr, tval);
+ }
+ return r;
+}
+
+/*
+ * mpg_interpret --- pre-exec hook in the interpreter. Handles
+ * arithmetic operations with MPFR/GMP numbers.
+ */
+
+static int
+mpg_interpret(INSTRUCTION **cp)
+{
+ INSTRUCTION *pc = *cp; /* current instruction */
+ OPCODE op; /* current opcode */
+ NODE *r = NULL;
+ NODE *t1, *t2;
+ NODE **lhs;
+ int tval; /* the ternary value returned by a MPFR function */
+
+ switch ((op = pc->opcode)) {
+ case Op_plus_i:
+ t2 = force_number(pc->memory);
+ goto plus;
+ case Op_plus:
+ t2 = POP_NUMBER();
+plus:
+ t1 = TOP_NUMBER();
+ r = mpg_add(t1, t2);
+ DEREF(t1);
+ if (op == Op_plus)
+ DEREF(t2);
+ REPLACE(r);
+ break;
+
+ case Op_minus_i:
+ t2 = force_number(pc->memory);
+ goto minus;
+ case Op_minus:
+ t2 = POP_NUMBER();
+minus:
+ t1 = TOP_NUMBER();
+ r = mpg_sub(t1, t2);
+ DEREF(t1);
+ if (op == Op_minus)
+ DEREF(t2);
+ REPLACE(r);
+ break;
+
+ case Op_times_i:
+ t2 = force_number(pc->memory);
+ goto times;
+ case Op_times:
+ t2 = POP_NUMBER();
+times:
+ t1 = TOP_NUMBER();
+ r = mpg_mul(t1, t2);
+ DEREF(t1);
+ if (op == Op_times)
+ DEREF(t2);
+ REPLACE(r);
+ break;
+
+ case Op_exp_i:
+ t2 = force_number(pc->memory);
+ goto exp;
+ case Op_exp:
+ t2 = POP_NUMBER();
+exp:
+ t1 = TOP_NUMBER();
+ r = mpg_pow(t1, t2);
+ DEREF(t1);
+ if (op == Op_exp)
+ DEREF(t2);
+ REPLACE(r);
+ break;
+
+ case Op_quotient_i:
+ t2 = force_number(pc->memory);
+ goto quotient;
+ case Op_quotient:
+ t2 = POP_NUMBER();
+quotient:
+ t1 = TOP_NUMBER();
+ r = mpg_div(t1, t2);
+ DEREF(t1);
+ if (op == Op_quotient)
+ DEREF(t2);
+ REPLACE(r);
+ break;
+
+ case Op_mod_i:
+ t2 = force_number(pc->memory);
+ goto mod;
+ case Op_mod:
+ t2 = POP_NUMBER();
+mod:
+ t1 = TOP_NUMBER();
+ r = mpg_mod(t1, t2);
+ DEREF(t1);
+ if (op == Op_mod)
+ DEREF(t2);
+ REPLACE(r);
+ break;
+
+ case Op_preincrement:
+ case Op_predecrement:
+ lhs = TOP_ADDRESS();
+ t1 = *lhs;
+ force_number(t1);
+
+ if (is_mpg_integer(t1)) {
+ if (t1->valref == 1 && t1->flags == (MALLOC|MPZN|NUMCUR|NUMBER))
+ /* Efficiency hack. Big speed-up (> 30%) in a tight loop */
+ r = t1;
+ else
+ r = *lhs = mpg_integer();
+ if (op == Op_preincrement)
+ mpz_add_ui(r->mpg_i, t1->mpg_i, 1);
+ else
+ mpz_sub_ui(r->mpg_i, t1->mpg_i, 1);
+ } else {
+
+ /*
+ * An optimization like the one above is not going to work
+ * for a floating-point number. With it,
+ * gawk -M 'BEGIN { PREC=53; i=2^53+0.0; PREC=113; ++i; print i}'
+ * will output 2^53 instead of 2^53+1.
+ */
+
+ r = *lhs = mpg_float();
+ tval = mpfr_add_si(r->mpg_numbr, t1->mpg_numbr,
+ op == Op_preincrement ? 1 : -1,
+ ROUND_MODE);
+ IEEE_FMT(r->mpg_numbr, tval);
+ }
+ if (r != t1)
+ unref(t1);
+ UPREF(r);
+ REPLACE(r);
+ break;
+
+ case Op_postincrement:
+ case Op_postdecrement:
+ lhs = TOP_ADDRESS();
+ t1 = *lhs;
+ force_number(t1);
+
+ if (is_mpg_integer(t1)) {
+ r = mpg_integer();
+ mpz_set(r->mpg_i, t1->mpg_i);
+ if (t1->valref == 1 && t1->flags == (MALLOC|MPZN|NUMCUR|NUMBER))
+ /* Efficiency hack. Big speed-up (> 30%) in a tight loop */
+ t2 = t1;
+ else
+ t2 = *lhs = mpg_integer();
+ if (op == Op_postincrement)
+ mpz_add_ui(t2->mpg_i, t1->mpg_i, 1);
+ else
+ mpz_sub_ui(t2->mpg_i, t1->mpg_i, 1);
+ } else {
+ r = mpg_float();
+ tval = mpfr_set(r->mpg_numbr, t1->mpg_numbr, ROUND_MODE);
+ IEEE_FMT(r->mpg_numbr, tval);
+ t2 = *lhs = mpg_float();
+ tval = mpfr_add_si(t2->mpg_numbr, t1->mpg_numbr,
+ op == Op_postincrement ? 1 : -1,
+ ROUND_MODE);
+ IEEE_FMT(t2->mpg_numbr, tval);
+ }
+ if (t2 != t1)
+ unref(t1);
+ REPLACE(r);
+ break;
+
+ case Op_unary_minus:
+ t1 = TOP_NUMBER();
+ if (is_mpg_float(t1)) {
+ r = mpg_float();
+ tval = mpfr_neg(r->mpg_numbr, t1->mpg_numbr, ROUND_MODE);
+ IEEE_FMT(r->mpg_numbr, tval);
+ } else {
+ r = mpg_integer();
+ mpz_neg(r->mpg_i, t1->mpg_i);
+ }
+ DEREF(t1);
+ REPLACE(r);
+ break;
+
+ case Op_assign_plus:
+ case Op_assign_minus:
+ case Op_assign_times:
+ case Op_assign_quotient:
+ case Op_assign_mod:
+ case Op_assign_exp:
+ lhs = POP_ADDRESS();
+ t1 = *lhs;
+ force_number(t1);
+ t2 = TOP_NUMBER();
+
+ switch (op) {
+ case Op_assign_plus:
+ r = mpg_add(t1, t2);
+ break;
+ case Op_assign_minus:
+ r = mpg_sub(t1, t2);
+ break;
+ case Op_assign_times:
+ r = mpg_mul(t1, t2);
+ break;
+ case Op_assign_quotient:
+ r = mpg_div(t1, t2);
+ break;
+ case Op_assign_mod:
+ r = mpg_mod(t1, t2);
+ break;
+ case Op_assign_exp:
+ r = mpg_pow(t1, t2);
+ break;
+ default:
+ cant_happen();
+ }
+
+ DEREF(t2);
+ unref(*lhs);
+ *lhs = r;
+ UPREF(r);
+ REPLACE(r);
+ break;
+
+ default:
+ return true; /* unhandled */
+ }
+
+ *cp = pc->nexti; /* next instruction to execute */
+ return false;
+}
+
+
+/* mpg_fmt --- output formatted string with special MPFR/GMP conversion specifiers */
+
+const char *
+mpg_fmt(const char *mesg, ...)
+{
+ static char *tmp = NULL;
+ int ret;
+ va_list args;
+
+ if (tmp != NULL) {
+ mpfr_free_str(tmp);
+ tmp = NULL;
+ }
+ va_start(args, mesg);
+ ret = mpfr_vasprintf(& tmp, mesg, args);
+ va_end(args);
+ if (ret >= 0 && tmp != NULL)
+ return tmp;
+ return mesg;
+}
+
+#else
+
+void
+set_PREC()
+{
+ /* dummy function */
+}
+
+void
+set_ROUNDMODE()
+{
+ /* dummy function */
+}
+
+#endif
diff --git a/msg.c b/msg.c
index 3ed02331..bc446a14 100644
--- a/msg.c
+++ b/msg.c
@@ -33,21 +33,19 @@ static const char *srcfile = NULL;
static int srcline;
jmp_buf fatal_tag;
-int fatal_tag_valid = FALSE;
+bool fatal_tag_valid = false;
/* err --- print an error message with source line and file and record */
/* VARARGS2 */
void
-err(const char *s, const char *emsg, va_list argp)
+err(bool isfatal, const char *s, const char *emsg, va_list argp)
{
char *file;
const char *me;
(void) fflush(output_fp);
me = myname;
- if (strncmp(me, "dgawk", 5) == 0)
- me = &myname[1];
(void) fprintf(stderr, "%s: ", me);
#ifdef GAWKDEBUG
if (srcfile != NULL) {
@@ -64,6 +62,21 @@ err(const char *s, const char *emsg, va_list argp)
(void) fprintf(stderr, "%d: ", sourceline);
}
+
+#ifdef HAVE_MPFR
+ if (FNR_node && is_mpg_number(FNR_node->var_value)) {
+ NODE *val;
+ val = mpg_update_var(FNR_node);
+ assert((val->flags & MPZN) != 0);
+ if (mpz_sgn(val->mpg_i) > 0) {
+ file = FILENAME_node->var_value->stptr;
+ (void) putc('(', stderr);
+ if (file)
+ (void) fprintf(stderr, "FILENAME=%s ", file);
+ (void) mpfr_fprintf(stderr, "FNR=%Zd) ", val->mpg_i);
+ }
+ } else
+#endif
if (FNR > 0) {
file = FILENAME_node->var_value->stptr;
(void) putc('(', stderr);
@@ -71,10 +84,18 @@ err(const char *s, const char *emsg, va_list argp)
(void) fprintf(stderr, "FILENAME=%s ", file);
(void) fprintf(stderr, "FNR=%ld) ", FNR);
}
+
(void) fprintf(stderr, "%s", s);
vfprintf(stderr, emsg, argp);
(void) fprintf(stderr, "\n");
(void) fflush(stderr);
+
+ if (isfatal) {
+#ifdef GAWKDEBUG
+ abort();
+#endif
+ gawk_exit(EXIT_FATAL);
+ }
}
/* msg --- take a varargs error message and print it */
@@ -84,7 +105,7 @@ msg(const char *mesg, ...)
{
va_list args;
va_start(args, mesg);
- err("", mesg, args);
+ err(false, "", mesg, args);
va_end(args);
}
@@ -95,7 +116,7 @@ warning(const char *mesg, ...)
{
va_list args;
va_start(args, mesg);
- err(_("warning: "), mesg, args);
+ err(false, _("warning: "), mesg, args);
va_end(args);
}
@@ -104,7 +125,7 @@ error(const char *mesg, ...)
{
va_list args;
va_start(args, mesg);
- err(_("error: "), mesg, args);
+ err(false, _("error: "), mesg, args);
va_end(args);
}
@@ -127,12 +148,8 @@ r_fatal(const char *mesg, ...)
{
va_list args;
va_start(args, mesg);
- err(_("fatal: "), mesg, args);
+ err(true, _("fatal: "), mesg, args);
va_end(args);
-#ifdef GAWKDEBUG
- abort();
-#endif
- gawk_exit(EXIT_FATAL);
}
/* gawk_exit --- longjmp out if necessary */
@@ -144,5 +161,17 @@ gawk_exit(int status)
exit_val = status;
longjmp(fatal_tag, 1);
}
+
+ final_exit(status);
+}
+
+/* final_exit --- run extension exit handlers and exit */
+
+void
+final_exit(int status)
+{
+ /* run any extension exit handlers */
+ run_ext_exit_handlers(status);
+
exit(status);
}
diff --git a/node.c b/node.c
index 204a91f9..f8152bab 100644
--- a/node.c
+++ b/node.c
@@ -26,13 +26,21 @@
#include "awk.h"
#include "math.h"
+#include "floatmagic.h" /* definition of isnan */
static int is_ieee_magic_val(const char *val);
+static NODE *r_make_number(double x);
static AWKNUM get_ieee_magic_val(const char *val);
+extern NODE **fmt_list; /* declared in eval.c */
+
+NODE *(*make_number)(double) = r_make_number;
+NODE *(*str2number)(NODE *) = r_force_number;
+NODE *(*format_val)(const char *, int, NODE *) = r_format_val;
+int (*cmp_numbers)(const NODE *, const NODE *) = cmp_awknums;
/* force_number --- force a value to be numeric */
-AWKNUM
+NODE *
r_force_number(NODE *n)
{
char *cp;
@@ -43,7 +51,7 @@ r_force_number(NODE *n)
extern double strtod();
if (n->flags & NUMCUR)
- return n->numbr;
+ return n;
/* all the conditionals are an attempt to avoid the expensive strtod */
@@ -52,7 +60,7 @@ r_force_number(NODE *n)
n->numbr = 0.0;
if (n->stlen == 0) {
- return 0.0;
+ return n;
}
cp = n->stptr;
@@ -65,14 +73,14 @@ r_force_number(NODE *n)
*/
if (! do_posix) {
if (isalpha((unsigned char) *cp)) {
- return 0.0;
+ return n;
} else if (n->stlen == 4 && is_ieee_magic_val(n->stptr)) {
if (n->flags & MAYBE_NUM)
n->flags &= ~MAYBE_NUM;
n->flags |= NUMBER|NUMCUR;
n->numbr = get_ieee_magic_val(n->stptr);
- return n->numbr;
+ return n;
}
/* else
fall through */
@@ -90,7 +98,7 @@ r_force_number(NODE *n)
/* CANNOT do non-decimal and saw 0x */
|| (! do_non_decimal_data && cp[0] == '0'
&& (cp[1] == 'x' || cp[1] == 'X'))))) {
- return 0.0;
+ return n;
}
if (n->flags & MAYBE_NUM) {
@@ -104,13 +112,15 @@ r_force_number(NODE *n)
n->numbr = (AWKNUM)(*cp - '0');
n->flags |= newflags;
n->flags |= NUMCUR;
+ if (cp == n->stptr) /* no leading spaces */
+ n->flags |= NUMINT;
}
- return n->numbr;
+ return n;
}
if (do_non_decimal_data) { /* main.c assures false if do_posix */
errno = 0;
- if (! do_traditional && isnondecimal(cp, TRUE)) {
+ if (! do_traditional && get_numbase(cp, true) != 10) {
n->numbr = nondec2awknum(cp, cpend - cp);
n->flags |= NUMCUR;
ptr = cpend;
@@ -135,7 +145,7 @@ finish:
errno = 0;
}
- return n->numbr;
+ return n;
}
@@ -158,26 +168,14 @@ static const char *values[] = {
};
#define NVAL (sizeof(values)/sizeof(values[0]))
-/* format_val --- format a numeric value based on format */
+/* r_format_val --- format a numeric value based on format */
NODE *
-format_val(const char *format, int index, NODE *s)
+r_format_val(const char *format, int index, NODE *s)
{
char buf[BUFSIZ];
char *sp = buf;
double val;
- char *orig, *trans, save;
-
- if (! do_traditional && (s->flags & INTLSTR) != 0) {
- save = s->stptr[s->stlen];
- s->stptr[s->stlen] = '\0';
-
- orig = s->stptr;
- trans = dgettext(TEXTDOMAIN, orig);
-
- s->stptr[s->stlen] = save;
- return make_string(trans, strlen(trans));
- }
/*
* 2/2007: Simplify our lives here. Instead of worrying about
@@ -198,7 +196,8 @@ format_val(const char *format, int index, NODE *s)
/* not an integral value, or out of range */
if ((val = double_to_int(s->numbr)) != s->numbr
- || val <= LONG_MIN || val >= LONG_MAX) {
+ || val <= LONG_MIN || val >= LONG_MAX
+ ) {
/*
* Once upon a time, we just blindly did this:
* sprintf(sp, format, s->numbr);
@@ -209,12 +208,12 @@ format_val(const char *format, int index, NODE *s)
*/
NODE *dummy[2], *r;
- unsigned short oflags;
- extern NODE **fmt_list; /* declared in eval.c */
+ unsigned int oflags;
/* create dummy node for a sole use of format_tree */
dummy[1] = s;
oflags = s->flags;
+
if (val == s->numbr) {
/* integral value, but outside range of %ld, use %.0f */
r = format_tree("%.0f", 4, dummy, 2);
@@ -234,8 +233,7 @@ format_val(const char *format, int index, NODE *s)
goto no_malloc;
} else {
/*
- * integral value
- * force conversion to long only once
+ * integral value; force conversion to long only once.
*/
long num = (long) val;
@@ -247,19 +245,25 @@ format_val(const char *format, int index, NODE *s)
s->stlen = strlen(sp);
}
s->stfmt = -1;
+ if (s->flags & INTIND) {
+ s->flags &= ~(INTIND|NUMBER);
+ s->flags |= STRING;
+ }
}
if (s->stptr != NULL)
efree(s->stptr);
emalloc(s->stptr, char *, s->stlen + 2, "format_val");
- memcpy(s->stptr, sp, s->stlen+1);
+ memcpy(s->stptr, sp, s->stlen + 1);
no_malloc:
s->flags |= STRCUR;
free_wstr(s);
return s;
}
-/* force_string --- force a value to be a string */
+/* r_force_string --- force a value to be a string */
+
+#ifdef GAWKDEBUG
NODE *
r_force_string(NODE *s)
{
@@ -269,28 +273,23 @@ r_force_string(NODE *s)
return s;
return format_val(CONVFMT, CONVFMTidx, s);
}
+#endif
-/* dupnode --- duplicate a node */
+/* r_dupnode --- duplicate a node */
NODE *
-dupnode(NODE *n)
+r_dupnode(NODE *n)
{
NODE *r;
- if (n->type == Node_ahash) {
- n->ahname_ref++;
- return n;
- }
-
assert(n->type == Node_val);
- if ((n->flags & PERM) != 0)
- return n;
-
+#ifdef GAWKDEBUG
if ((n->flags & MALLOC) != 0) {
n->valref++;
return n;
}
+#endif
getnode(r);
*r = *n;
@@ -308,13 +307,13 @@ dupnode(NODE *n)
#endif /* MBS_SUPPORT */
if ((n->flags & STRCUR) != 0) {
- emalloc(r->stptr, char *, n->stlen + 2, "dupnode");
+ emalloc(r->stptr, char *, n->stlen + 2, "r_dupnode");
memcpy(r->stptr, n->stptr, n->stlen);
r->stptr[n->stlen] = '\0';
#if MBS_SUPPORT
if ((n->flags & WSTRCUR) != 0) {
r->wstlen = n->wstlen;
- emalloc(r->wstptr, wchar_t *, sizeof(wchar_t) * (n->wstlen + 2), "dupnode");
+ emalloc(r->wstptr, wchar_t *, sizeof(wchar_t) * (n->wstlen + 2), "r_dupnode");
memcpy(r->wstptr, n->wstptr, n->wstlen * sizeof(wchar_t));
r->wstptr[n->wstlen] = L'\0';
r->flags |= WSTRCUR;
@@ -325,35 +324,66 @@ dupnode(NODE *n)
return r;
}
-/* mk_number --- allocate a node with defined number */
+/* r_make_number --- allocate a node with defined number */
-NODE *
-mk_number(AWKNUM x, unsigned int flags)
+static NODE *
+r_make_number(double x)
{
NODE *r;
-
getnode(r);
r->type = Node_val;
r->numbr = x;
+ r->flags = MALLOC|NUMBER|NUMCUR;
r->valref = 1;
- r->flags = flags;
r->stptr = NULL;
r->stlen = 0;
- free_wstr(r);
+#if MBS_SUPPORT
+ r->wstptr = NULL;
+ r->wstlen = 0;
+#endif /* defined MBS_SUPPORT */
return r;
}
+/* cmp_awknums --- compare two AWKNUMs */
+
+int
+cmp_awknums(const NODE *t1, const NODE *t2)
+{
+ /*
+ * This routine is also used to sort numeric array indices or values.
+ * For the purposes of sorting, NaN is considered greater than
+ * any other value, and all NaN values are considered equivalent and equal.
+ * This isn't in compliance with IEEE standard, but compliance w.r.t. NaN
+ * comparison at the awk level is a different issue, and needs to be dealt
+ * with in the interpreter for each opcode seperately.
+ */
+
+ if (isnan(t1->numbr))
+ return ! isnan(t2->numbr);
+ if (isnan(t2->numbr))
+ return -1;
+ /* don't subtract, in case one or both are infinite */
+ if (t1->numbr == t2->numbr)
+ return 0;
+ if (t1->numbr < t2->numbr)
+ return -1;
+ return 1;
+}
+
+
/* make_str_node --- make a string node */
NODE *
-r_make_str_node(const char *s, unsigned long len, int flags)
+make_str_node(const char *s, size_t len, int flags)
{
NODE *r;
-
getnode(r);
r->type = Node_val;
r->numbr = 0;
- r->flags = (STRING|STRCUR|MALLOC);
+ r->flags = (MALLOC|STRING|STRCUR);
+ r->valref = 1;
+ r->stfmt = -1;
+
#if MBS_SUPPORT
r->wstptr = NULL;
r->wstlen = 0;
@@ -366,7 +396,7 @@ r_make_str_node(const char *s, unsigned long len, int flags)
memcpy(r->stptr, s, len);
}
r->stptr[len] = '\0';
-
+
if ((flags & SCAN) != 0) { /* scan for escape sequences */
const char *pf;
char *ptm;
@@ -413,68 +443,41 @@ r_make_str_node(const char *s, unsigned long len, int flags)
len = ptm - r->stptr;
erealloc(r->stptr, char *, len + 1, "make_str_node");
r->stptr[len] = '\0';
- r->flags &= ~MALLOC;
- r->flags |= PERM;
}
r->stlen = len;
- r->valref = 1;
- r->stfmt = -1;
return r;
}
-/* more_nodes --- allocate more nodes */
-
-#define NODECHUNK 100
-
-NODE *nextfree = NULL;
-
-NODE *
-more_nodes()
-{
- NODE *np;
-
- /* get more nodes and initialize list */
- emalloc(nextfree, NODE *, NODECHUNK * sizeof(NODE), "more_nodes");
- memset(nextfree, 0, NODECHUNK * sizeof(NODE));
- for (np = nextfree; np <= &nextfree[NODECHUNK - 1]; np++) {
- np->nextp = np + 1;
- }
- --np;
- np->nextp = NULL;
- np = nextfree;
- nextfree = nextfree->nextp;
- return np;
-}
/* unref --- remove reference to a particular node */
void
-unref(NODE *tmp)
+r_unref(NODE *tmp)
{
+#ifdef GAWKDEBUG
if (tmp == NULL)
return;
- if ((tmp->flags & PERM) != 0)
- return;
-
- if (tmp->type == Node_ahash) {
- if (tmp->ahname_ref > 1)
- tmp->ahname_ref--;
- else {
- efree(tmp->ahname_str);
- freenode(tmp);
- }
- return;
- }
-
if ((tmp->flags & MALLOC) != 0) {
if (tmp->valref > 1) {
- tmp->valref--;
+ tmp->valref--;
return;
- }
+ }
if (tmp->flags & STRCUR)
efree(tmp->stptr);
}
+#else
+ if ((tmp->flags & (MALLOC|STRCUR)) == (MALLOC|STRCUR))
+ efree(tmp->stptr);
+#endif
+
+#ifdef HAVE_MPFR
+ if (is_mpg_float(tmp))
+ mpfr_clear(tmp->mpg_numbr);
+ else if (is_mpg_integer(tmp))
+ mpz_clear(tmp->mpg_i);
+#endif
+
free_wstr(tmp);
freenode(tmp);
}
@@ -561,10 +564,10 @@ parse_escape(const char **string_ptr)
return i;
case 'x':
if (do_lint) {
- static short warned = FALSE;
+ static bool warned = false;
if (! warned) {
- warned = TRUE;
+ warned = true;
lintwarn(_("POSIX does not allow `\\x' escapes"));
}
}
@@ -600,13 +603,13 @@ parse_escape(const char **string_ptr)
return c;
default:
{
- static short warned[256];
+ static bool warned[256];
unsigned char uc = (unsigned char) c;
/* N.B.: use unsigned char here to avoid Latin-1 problems */
if (! warned[uc]) {
- warned[uc] = TRUE;
+ warned[uc] = true;
warning(_("escape sequence `\\%c' treated as plain `%c'"), uc, uc);
}
@@ -615,12 +618,14 @@ parse_escape(const char **string_ptr)
}
}
-/* isnondecimal --- return true if number is not a decimal number */
+/* get_numbase --- return the base to use for the number in 's' */
int
-isnondecimal(const char *str, int use_locale)
+get_numbase(const char *s, bool use_locale)
{
int dec_point = '.';
+ const char *str = s;
+
#if defined(HAVE_LOCALE_H)
/*
* loc.decimal_point may not have been initialized yet,
@@ -631,11 +636,11 @@ isnondecimal(const char *str, int use_locale)
#endif
if (str[0] != '0')
- return FALSE;
+ return 10;
/* leading 0x or 0X */
if (str[1] == 'x' || str[1] == 'X')
- return TRUE;
+ return 16;
/*
* Numbers with '.', 'e', or 'E' are decimal.
@@ -645,12 +650,16 @@ isnondecimal(const char *str, int use_locale)
*/
for (; *str != '\0'; str++) {
if (*str == 'e' || *str == 'E' || *str == dec_point)
- return FALSE;
+ return 10;
else if (! isdigit((unsigned char) *str))
break;
}
- return TRUE;
+ if (! isdigit((unsigned char) s[1])
+ || s[1] == '8' || s[1] == '9'
+ )
+ return 10;
+ return 8;
}
#if MBS_SUPPORT
@@ -663,7 +672,7 @@ str2wstr(NODE *n, size_t **ptr)
char *sp;
mbstate_t mbs;
wchar_t wc, *wsp;
- static short warned = FALSE;
+ static bool warned = false;
assert((n->flags & (STRING|STRCUR)) != 0);
@@ -746,7 +755,7 @@ str2wstr(NODE *n, size_t **ptr)
memset(& mbs, 0, sizeof(mbs));
/* And warn the user something's wrong */
if (do_lint && ! warned) {
- warned = TRUE;
+ warned = true;
lintwarn(_("Invalid multibyte data detected. There may be a mismatch between your data and your locale."));
}
break;
@@ -820,7 +829,7 @@ wstr2str(NODE *n)
/* free_wstr --- release the wide string part of a node */
void
-free_wstr(NODE *n)
+r_free_wstr(NODE *n)
{
assert(n->type == Node_val);
@@ -927,7 +936,7 @@ is_ieee_magic_val(const char *val)
static AWKNUM
get_ieee_magic_val(const char *val)
{
- static short first = TRUE;
+ static bool first = true;
static AWKNUM inf;
static AWKNUM nan;
@@ -936,7 +945,7 @@ get_ieee_magic_val(const char *val)
if (val == ptr) { /* Older strtod implementations don't support inf or nan. */
if (first) {
- first = FALSE;
+ first = false;
nan = sqrt(-1.0);
inf = -log(0.0);
}
@@ -963,3 +972,41 @@ void init_btowc_cache()
}
}
#endif
+
+#define BLOCKCHUNK 100
+
+BLOCK nextfree[BLOCK_MAX] = {
+ { 0, NULL}, /* invalid */
+ { sizeof(NODE), NULL },
+ { sizeof(BUCKET), NULL },
+};
+
+
+/* more_blocks --- get more blocks of memory and add to the free list;
+ size of a block must be >= sizeof(BLOCK)
+ */
+
+void *
+more_blocks(int id)
+{
+ BLOCK *freep, *np, *next;
+ char *p, *endp;
+ size_t size;
+
+ size = nextfree[id].size;
+
+ emalloc(freep, BLOCK *, BLOCKCHUNK * size, "more_blocks");
+ p = (char *) freep;
+ endp = p + BLOCKCHUNK * size;
+
+ for (np = freep; ; np = next) {
+ next = (BLOCK *) (p += size);
+ if (p >= endp) {
+ np->freep = NULL;
+ break;
+ }
+ np->freep = next;
+ }
+ nextfree[id].freep = freep->freep;
+ return freep;
+}
diff --git a/pc/ChangeLog b/pc/ChangeLog
index 535b5be4..0defb81a 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -6,14 +6,76 @@
* Makefile.tst: Sync with mainline version.
+2012-10-28 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.pc (messages): Adjust to use standard failure test for
+ make diffout.
+
+2012-08-08 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkmisc.pc (os_isreadable): Take IOBUF_PUBLIC instead of fd and
+ use passed in info.
+
+2012-07-29 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkmisc.pc (os_isreadable): Add isdir pointer parameter to be
+ set to true if fd is for a directory.
+
+2012-07-26 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkmisc.pc (os_isreadable): New function.
+
+2012-05-14 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile: Remove second mingw32-readline target. Bad
+ result from branch merging.
+
2012-05-06 Eli Zaretskii <eliz@gnu.org>
* config.sed: Update DJGPP -> __DJGPP__.
+2012-04-16 Eli Zaretskii <eliz@gnu.org>
+
+ * Makefile.tst (PGAWK): Redefine as "../gawk.exe -p".
+ (MPFR_TESTS): New variable, a list of MPFR-related tests.
+ (mpfr-tests): A new target.
+ (badargs): Reset GREP_OPTIONS to empty, to avoid gratuitous
+ failures when the user has something like -nH there.
+ (mpfrieee, mpfrexprange, mpfrrnd, mpfrnr, mpfrsort, mpfrbigint):
+ New tests.
+
+ * Makefile (default): Add descriptions of mingw32-mpfr and
+ mingw32-libreadline-mpfr targets.
+ (PRSPFILE, DRSPFILE, PRSP, DRSP, PLDRSP, DLDRSP, DO_PLNK)
+ (DO_PBIND, DO_DLNK, DO_DBIND, PLDJG, DLDJG, PLMINGW32)
+ (DLMINGW32, PAWKOBJS1, PAWKOBJS2, DAWKOBJS2, PGAWKOBJS)
+ (DGAWKOBJS): Remove unused variables.
+ (djgpp, djgpp-debug, mingw32): Don't use them.
+ (mingw32): Add -D__USE_MINGW_ANSI_STDIO to compilation flags.
+ (mingw32-readline, mingw32-mpfr, mingw32-readline-mpfr): New targets.
+ (CFLAGS, AWKOBJS2): Don't reference obsolete DYN_FLAGS and DYN_OBJ
+ variables.
+ (AWKOBJS2): Add symbol$O.
+ (AWKOBJS3): New variable, lists MPFR-related object files.
+ (AWKOBJS): Add $(AWKOBJS3).
+ (all): Remove pgawk.exe and dgawk.exe.
+ (pgawk.exe, dgawk.exe, $(PRSPFILE) $(DRSPFILE), eval_p$O)
+ (profile_p$O): Remove targets.
+ (random$O, debug$O): Don't depend on floatmagic.h
+ (eval$O): Depend on interpret.h.
+ (clean): Prepend '-' to command line, to ignore errors due to
+ non-existent files.
+
+ * config.h: Comment out "#undef HAVE_LIBREADLINE" (again).
+
2012-03-29 Arnold D. Robbins <arnold@skeeve.com>
* config.h: Add definition for _Noreturn.
+2012-03-20 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawkmisc.pc (deflibpath): New global variable.
+
2012-03-28 Arnold D. Robbins <arnold@skeeve.com>
* 4.0.1: Release tar ball made.
@@ -68,6 +130,10 @@
* Makefile.tst: Sync with mainline version.
+2011-12-12 Scott Deifik <scottd.mail@sbcglobal.net>
+
+ * Makefile.tst: Sync with mainline version.
+
2011-12-06 Scott Deifik <scottd.mail@sbcglobal.net>
* Makefile.tst: Sync with mainline version.
diff --git a/pc/Makefile b/pc/Makefile
index af3044d3..f01849a8 100644
--- a/pc/Makefile
+++ b/pc/Makefile
@@ -16,6 +16,9 @@ default:
@echo " mingw32 . Windows32 exe [Mingw32 GNU C] "
@echo " mingw32-readline . Like mingw32, but with readline "
@echo " [You will need to have GNU readline library installed.] "
+ @echo " mingw32-mpfr . Like mingw32, but with MPFR "
+ @echo " [You will need to have GNU MPFR library installed.] "
+ @echo " mingw32-readline-mpfr . mingw32 with readline and MPFR "
@echo " ----------------------------------------------------- "
@echo " test .... Perform tests (see README_d/README.pc) "
@echo " install . Install gawk under $(prefix)/ "
@@ -39,8 +42,6 @@ default:
#======================= Configuration ==================================
RSPFILE = gawk.rsp
-PRSPFILE = pgawk.rsp
-DRSPFILE = dgawk.rsp
#
# Choose method for passing arguments to the linker.
#
@@ -50,11 +51,7 @@ DRSPFILE = dgawk.rsp
#
# else use brain-dead approach (emxbnd will need 'tr').
RSP = $(RSPFILE)
-PRSP = $(PRSPFILE)
-DRSP = $(DRSPFILE)
LDRSP = @$(RSP)
-PLDRSP = @$(PRSP)
-DLDRSP = @$(DRSP)
LNKRSP = $(LDRSP)
#------------------------------------------------------------------------
# Some makes do not define MAKE (and ndmake does not allow a define).
@@ -80,10 +77,6 @@ install = 1
# that $($X) can be expanded.
DO_LNK = $($(LNK))
DO_BIND= $($(BIND))
-DO_PLNK = $($(PLNK))
-DO_PBIND= $($(PBIND))
-DO_DLNK = $($(DLNK))
-DO_DBIND= $($(DBIND))
#========================================================================
# End of general configuration. Some platform-specific configuration
# notes appear below.
@@ -97,21 +90,19 @@ prefix = $(DJDIR)
pkgdatadir = $(prefix)/share/awk
endif
LDJG = $(CC) $(LF) -o gawk.exe $(LDRSP) $(LF2)
-PLDJG = $(CC) $(LF) -o pgawk.exe $(PLDRSP) $(LF2)
-DLDJG = $(CC) $(LF) -o dgawk.exe $(DLDRSP) $(LF2)
BDJG = stubify -g awk.exe | stubedit awk.exe runfile=gawk
djgpp:
$(MAK) all \
CC=gcc O=.o CF=-O2 \
- LNK=LDJG PLNK=PLDJG DLNK=DLDJG LF=-s LF2=-lm \
- BIND=BDJG PBIND='' DBIND=''
+ LNK=LDJG LF=-s LF2=-lm \
+ BIND=BDJG
djgpp-debug:
$(MAK) all \
CC=gcc O=.o CF='-O2 -g' \
- LNK=LDJG PLNK=PLDJG DLNK=DLDJG LF2=-lm \
- BIND=BDJG PBIND='' DBIND=''
+ LNK=LDJG LF2=-lm \
+ BIND=BDJG
#========================================================================
#========================== EMX =========================================
@@ -158,41 +149,47 @@ emxbnd-debug:
#========================================================================
LMINGW32 = $(CC) $(LF) -o $@ $(GAWKOBJS) $(LF2)
-PLMINGW32 = $(CC) $(LF) -o $@ $(PGAWKOBJS) $(LF2)
-DLMINGW32 = $(CC) $(LF) -o $@ $(DGAWKOBJS) $(LF2)
# The following might work around command-line length limitations:
#LMINGW32 = $(CC) $(LF) -o $@ *.o $(LF2)
mingw32:
$(MAK) all \
- CC=gcc O=.o CF="-O2 -gdwarf-2 -g3" OBJ=popen.o \
- LNK=LMINGW32 PLNK=PLMINGW32 DLNK=DLMINGW32 \
- LF="-gdwarf-2 -g3" LF2=-lmsvcp60 RSP=
+ CC=gcc O=.o CF="-D__USE_MINGW_ANSI_STDIO -O2 -gdwarf-2 -g3" \
+ OBJ=popen.o LNK=LMINGW32 LF="-gdwarf-2 -g3" LF2=-lmsvcp60 RSP=
mingw32-readline:
$(MAK) all \
- CC=gcc O=.o CF="-DHAVE_LIBREADLINE -O2 -gdwarf-2 -g3" OBJ=popen.o \
- LNK=LMINGW32 PLNK=PLMINGW32 DLNK=DLMINGW32 \
- LF="-gdwarf-2 -g3" \
+ CC=gcc O=.o \
+ CF="-D__USE_MINGW_ANSI_STDIO -DHAVE_LIBREADLINE -O2 -gdwarf-2 -g3" \
+ OBJ=popen.o LNK=LMINGW32 LF="-gdwarf-2 -g3" \
LF2="-lreadline -lmsvcp60 -Wl,--enable-auto-import" RSP=
+mingw32-mpfr:
+ $(MAK) all \
+ CC=gcc O=.o \
+ CF="-D__USE_MINGW_ANSI_STDIO -DHAVE_MPFR -O2 -gdwarf-2 -g3" \
+ OBJ=popen.o LNK=LMINGW32 LF="-gdwarf-2 -g3" \
+ LF2="-lmpfr -lgmp -lmsvcp60 -Wl,--enable-auto-import" RSP=
+
+mingw32-readline-mpfr:
+ $(MAK) all \
+ CC=gcc O=.o \
+ CF="-D__USE_MINGW_ANSI_STDIO -DHAVE_LIBREADLINE -DHAVE_MPFR -O2 -gdwarf-2 -g3" \
+ OBJ=popen.o LNK=LMINGW32 LF="-gdwarf-2 -g3" \
+ LF2="-lmpfr -lgmp -lreadline -lmsvcp60 -Wl,--enable-auto-import" RSP=
+
# Define BIND for BINDless compiles, otherwise $($(BIND)) may break.
BIND = EMPTY
PBIND = EMPTY
EMPTY=
-# bitwise operations (-DBITOPS) and non-decimal input data (-DNONDECDATA) are
-# undocumented in 3.0.3. They may be enabled in config.h, or added to CFLAGS.
-CFLAGS = $(CF) -DGAWK -I. -DHAVE_CONFIG_H $(DYN_FLAGS)
+CFLAGS = $(CF) -DGAWK -I. -DHAVE_CONFIG_H
# object files
AWKOBJS1 = array$O builtin$O eval$O field$O floatcomp$O gawkmisc$O io$O main$O
-AWKOBJS2 = ext$O msg$O node$O profile$O re$O replace$O version$O $(DYN_OBJ)
-PAWKOBJS1 = array$O builtin$O eval_p$O field$O floatcomp$O gawkmisc$O io$O main$O
-PAWKOBJS2 = ext$O msg$O node$O profile_p$O re$O replace$O version$O $(DYN_OBJ)
-DAWKOBJS1 = array$O builtin$O debug$O eval_d$O field$O floatcomp$O gawkmisc$O io$O main$O
-DAWKOBJS2 = ext$O msg$O node$O profile$O re$O replace$O version$O command$O $(DYN_OBJ)
-AWKOBJS = $(AWKOBJS1) $(AWKOBJS2)
+AWKOBJS2 = ext$O msg$O node$O profile$O re$O replace$O version$O symbol$O
+AWKOBJS3 = debug$O cint_array$O int_array$O mpfr$O str_array$O command$O
+AWKOBJS = $(AWKOBJS1) $(AWKOBJS2) $(AWKOBJS3)
ALLOBJS = $(AWKOBJS) awkgram$O getid$O $(OBJ)
@@ -201,8 +198,6 @@ ALLOBJS = $(AWKOBJS) awkgram$O getid$O $(OBJ)
LIBOBJS= getopt$O getopt1$O dfa$O regex$O random$O
GAWKOBJS = $(ALLOBJS) $(LIBOBJS)
-PGAWKOBJS = $(PAWKOBJS1) $(PAWKOBJS2) $(LIBOBJS) awkgram$O getid$O $(OBJ)
-DGAWKOBJS = $(DAWKOBJS1) $(DAWKOBJS2) $(LIBOBJS) awkgram$O getid$O $(OBJ)
# clear out suffixes list
# .SUFFIXES:
@@ -212,52 +207,34 @@ DGAWKOBJS = $(DAWKOBJS1) $(DAWKOBJS2) $(LIBOBJS) awkgram$O getid$O $(OBJ)
$(CC) -c $(CFLAGS) $<
# rules to build gawk
-all : gawk.exe pgawk.exe dgawk.exe
+all : gawk.exe
gawk.exe:: $(GAWKOBJS) $(RSP)
$(DO_LNK)
$(DO_BIND)
-pgawk.exe:: $(PGAWKOBJS) $(PRSP)
- $(DO_PLNK)
- $(DO_PBIND)
-
-dgawk.exe:: $(DGAWKOBJS) $(DRSP)
- $(DO_DLNK)
- $(DO_DBIND)
-
$(RSPFILE) : $(GAWKOBJS)
echo $(AWKOBJS1)$P > $@
echo $(AWKOBJS2)$P >> $@
echo awkgram$O getid$O $(OBJ) $(LIBOBJS)$P >> $@
-$(PRSPFILE) : $(PGAWKOBJS)
- echo $(PAWKOBJS1)$P > $@
- echo $(PAWKOBJS2)$P >> $@
- echo awkgram$O getid$O $(OBJ) $(LIBOBJS)$P >> $@
-
-$(DRSPFILE) : $(DGAWKOBJS)
- echo $(DAWKOBJS1)$P > $@
- echo $(DAWKOBJS2)$P >> $@
- echo awkgram$O getid$O $(OBJ) $(LIBOBJS)$P >> $@
-
# Notes to dependencies:
# 1. The dependency on getopt.h is because unistd.h includes it,
# and we have -I. on the compiler command line. unistd.h is
# included by awk.h.
# 2. custom.h is not mentioned because pc ports don't use it.
-$(ALLOBJS) $(LIBOBJS) eval_p$O profile_p$O eval_d$O debug$O command$O: \
+$(ALLOBJS) $(LIBOBJS): \
awk.h regex.h config.h gettext.h mbsupport.h protos.h dfa.h getopt.h
builtin$O: floatmagic.h random.h popen.h
-random$O: floatmagic.h random.h
+random$O: random.h
-debug$O: floatmagic.h
+node$O: floatmagic.h
command$O debug$O: cmd.h
-dfa$O: xalloc.h
+dfa$O: xalloc.h
gawkmisc$O: pc/gawkmisc.pc
@@ -267,9 +244,7 @@ io$O: popen.h
regex$O: regcomp.c regexec.c regex_internal.h
-eval_p$O: eval.c
-
-profile_p$O: profile.c
+eval$O: interpret.h
# A bug in ndmake requires the following rule
awkgram$O: awk.h awkgram.c
@@ -300,7 +275,7 @@ install2:
gawk -v prefix=$(prefix) -f install.awk
clean:
- rm -rf gawk pgawk dgawk *.exe gawk.map *.o *.obj core a.out $(RSPFILE) $(PRSPFILE) $(DRSPFILE) $(DYN_EXP)
+ -rm -rf gawk *.exe gawk.map *.o *.obj core a.out $(RSPFILE) $(PRSPFILE) $(DRSPFILE) $(DYN_EXP)
# cd doc && $(MAKE) clean
# cd test && $(MAKE) clean
# cd awklib && $(MAKE) clean
diff --git a/pc/Makefile.tst b/pc/Makefile.tst
index c9aea454..09baaf32 100644
--- a/pc/Makefile.tst
+++ b/pc/Makefile.tst
@@ -67,7 +67,7 @@ AWK2 = '..\gawk.exe'
AWKPROG = ../gawk.exe
# Define PGAWK
-PGAWK = ../pgawk.exe
+PGAWK = ../gawk.exe -p
# Set your cmp command here (you can use most versions of diff instead of cmp
# if you don't want to convert the .ok files to the DOS CR/LF format).
@@ -187,6 +187,7 @@ GAWK_EXT_TESTS = \
EXTRA_TESTS = inftest regtest
INET_TESTS = inetdayu inetdayt inetechu inetecht
MACHINE_TESTS = double1 double2 fmtspcl intformat
+MPFR_TESTS = mpfrnr mpfrrnd mpfrieee mpfrexprange mpfrsort mpfrbigint
LOCALE_CHARSET_TESTS = \
asort asorti fmttest fnarydel fnparydl jarebug lc_num1 mbfw1 \
mbprintf1 mbprintf2 mbprintf3 rebt8b2 rtlenmb sort1 sprintfc
@@ -234,6 +235,8 @@ inet: inetmesg $(INET_TESTS)
machine-tests: $(MACHINE_TESTS)
+mpfr-tests: $(MPFR_TESTS)
+
msg::
@echo ""
@echo "Any output from $(CMP) is bad news, although some differences"
@@ -300,8 +303,8 @@ poundbang::
messages::
@echo $@
- @$(AWK) -f $(srcdir)/messages.awk >out2 2>out3
- @-$(CMP) $(srcdir)/out1.ok out1 && $(CMP) $(srcdir)/out2.ok out2 && $(CMP) $(srcdir)/out3.ok out3 && rm -f out1 out2 out3
+ @$(AWK) -f $(srcdir)/messages.awk >_out2 2>_out3
+ @-$(CMP) $(srcdir)/out1.ok _out1 && $(CMP) $(srcdir)/out2.ok _out2 && $(CMP) $(srcdir)/out3.ok _out3 && rm -f _out1 _out2 _out3
argarray::
@echo $@
@@ -361,7 +364,7 @@ argtest::
badargs::
@echo $@
- @-$(AWK) -f 2>&1 | grep -v patchlevel >_$@
+ @-$(AWK) -f 2>&1 | GREP_OPTIONS='' grep -v patchlevel >_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nonl::
@@ -801,6 +804,36 @@ exit:
@-AWK="$(AWKPROG)" $(srcdir)/$@.sh > _$@ 2>&1
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+mpfrieee:
+ @echo mpfrieee
+ @$(AWK) -M -vPREC=double -f $(srcdir)/$@.awk > _$@ 2>&1
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+mpfrexprange:
+ @echo mpfrexprange
+ @$(AWK) -M -vPREC=53 -f $(srcdir)/$@.awk > _$@ 2>&1
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+mpfrrnd:
+ @echo mpfrrnd
+ @$(AWK) -M -vPREC=53 -f $(srcdir)/$@.awk > _$@ 2>&1
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+mpfrnr:
+ @echo mpfrnr
+ @$(AWK) -M -vPREC=113 -f $(srcdir)/$@.awk $(srcdir)/$@.in > _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+mpfrsort:
+ @echo mpfrsort
+ @$(AWK) -M -vPREC=53 -f $(srcdir)/$@.awk > _$@ 2>&1
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+mpfrbigint:
+ @echo mpfrbigint
+ @$(AWK) -M -f $(srcdir)/$@.awk > _$@ 2>&1
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
rri1::
@echo $@
@[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
@@ -2056,7 +2089,7 @@ $(srcdir)/Maketests: $(srcdir)/Makefile.am $(srcdir)/Gentests
$(AWK) -f $(srcdir)/Gentests "$(srcdir)/Makefile.am" $$files > $(srcdir)/Maketests
clean:
- rm -fr _* core core.* fmtspcl.ok junk out1 out2 out3 strftime.ok test1 test2 seq *~
+ rm -fr _* core core.* fmtspcl.ok junk strftime.ok test1 test2 seq *~
# An attempt to print something that can be grepped for in build logs
pass-fail:
diff --git a/pc/config.h b/pc/config.h
index 88316316..50cd750e 100644
--- a/pc/config.h
+++ b/pc/config.h
@@ -177,6 +177,9 @@
/* we have the mktime function */
#define HAVE_MKTIME 1
+/* Define to 1 if you have fully functional mpfr and gmp libraries. */
+#undef HAVE_MPFR
+
/* Define to 1 if you have the <netdb.h> header file. */
#undef HAVE_NETDB_H
@@ -413,7 +416,7 @@
#define PACKAGE_NAME "GNU Awk"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "GNU Awk 4.0.1a"
+#define PACKAGE_STRING "GNU Awk 4.0.70"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "gawk"
@@ -422,7 +425,7 @@
#define PACKAGE_URL "http://www.gnu.org/software/gawk/"
/* Define to the version of this package. */
-#define PACKAGE_VERSION "4.0.1a"
+#define PACKAGE_VERSION "4.0.70"
/* Define to 1 if *printf supports %F format */
#undef PRINTF_HAS_F_FORMAT
@@ -484,7 +487,7 @@
/* Version number of package */
-#define VERSION "4.0.1a"
+#define VERSION "4.0.70"
/* Enable large inode numbers on Mac OS X 10.5. */
#ifndef _DARWIN_USE_64_BIT_INODE
diff --git a/pc/gawkmisc.pc b/pc/gawkmisc.pc
index b2a67a50..e2f114e4 100644
--- a/pc/gawkmisc.pc
+++ b/pc/gawkmisc.pc
@@ -31,6 +31,8 @@ char *defpath = DEFPATH;
# else
char *defpath = ".;c:\\lib\\awk;c:\\gnu\\lib\\awk";
# endif
+/* the Makefile should define DEFLIBPATH */
+char *deflibpath = DEFLIBPATH;
#ifdef __EMX__
#include<io.h>
@@ -230,6 +232,31 @@ int fd;
return (fstat(fd, &sbuf) == 0 && S_ISDIR(sbuf.st_mode));
}
+/* os_isreadable --- fd can be read from */
+
+int
+os_isreadable(const IOBUF_PUBLIC *iobuf, bool *isdir)
+{
+ *isdir = false;
+
+ switch (iobuf->sbuf.st_mode & S_IFMT) {
+ case S_IFREG:
+ case S_IFCHR: /* ttys, /dev/null, .. */
+#ifdef S_IFSOCK
+ case S_IFSOCK:
+#endif
+#ifdef S_IFIFO
+ case S_IFIFO:
+#endif
+ return true;
+ case S_IFDIR:
+ *isdir = true;
+ /* fall through */
+ default:
+ return false;
+ }
+}
+
/* os_is_setuid --- true if running setuid root */
int
diff --git a/po/.gitignore b/po/.gitignore
new file mode 100644
index 00000000..2a1c0abe
--- /dev/null
+++ b/po/.gitignore
@@ -0,0 +1,4 @@
+# Ignore files that are created by a build.
+Makefile.in
+POTFILES
+
diff --git a/po/ChangeLog b/po/ChangeLog
index d17674da..91cbd991 100644
--- a/po/ChangeLog
+++ b/po/ChangeLog
@@ -1,3 +1,7 @@
+2012-07-25 Arnold D. Robbins <arnold@skeeve.com>
+
+ * POTFILES.in: Brought up to date.
+
2012-03-28 Arnold D. Robbins <arnold@skeeve.com>
* 4.0.1: Release tar ball made.
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 807df336..f62ba39b 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,17 +1,32 @@
# List of source files containing translatable strings.
-# Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2002, 2012 Free Software Foundation, Inc.
array.c
awkgram.c
builtin.c
+cint_array.c
+command.c
+debug.c
+dfa.c
eval.c
ext.c
+extension/filefuncs.c
+extension/fnmatch.c
+extension/fork.c
+extension/ordchr.c
+extension/readfile.c
+extension/rwarray.c
+extension/time.c
field.c
+floatcomp.c
+gawkapi.c
gawkmisc.c
getopt.c
getopt1.c
+int_array.c
io.c
main.c
+mpfr.c
msg.c
node.c
posix/gawkmisc.c
@@ -19,6 +34,10 @@ profile.c
random.c
re.c
regcomp.c
+regex.c
regex_internal.c
regexec.c
replace.c
+str_array.c
+symbol.c
+version.c
diff --git a/po/ast.gmo b/po/ast.gmo
deleted file mode 100644
index 7c2ac4e2..00000000
--- a/po/ast.gmo
+++ /dev/null
Binary files differ
diff --git a/po/ca.gmo b/po/ca.gmo
deleted file mode 100644
index 426541dc..00000000
--- a/po/ca.gmo
+++ /dev/null
Binary files differ
diff --git a/po/da.gmo b/po/da.gmo
index f486abc8..d3607c4a 100644
--- a/po/da.gmo
+++ b/po/da.gmo
Binary files differ
diff --git a/po/da.po b/po/da.po
index 74c245f7..9c3002a3 100644
--- a/po/da.po
+++ b/po/da.po
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gawk 4.0.0h\n"
"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
-"POT-Creation-Date: 2012-10-13 20:24+0200\n"
+"POT-Creation-Date: 2012-10-13 21:21+0200\n"
"PO-Revision-Date: 2012-02-06 10:37+0100\n"
"Last-Translator: Keld Simonsen <keld@keldix.com>\n"
"Language-Team: Danish <dansk@dansk-gruppen.dk>\n"
@@ -21,501 +21,492 @@ msgstr ""
"X-Generator: Lokalize 1.0\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: array.c:140
+#: array.c:266
#, c-format
msgid "from %s"
msgstr "fra %s"
-#: array.c:248
+#: array.c:366
msgid "attempt to use a scalar value as array"
msgstr "forsøg på at bruge en skalar som array"
-#: array.c:251
-#, c-format
-msgid "attempt to use function `%s' as an array"
-msgstr "forsøg på at bruge funktionen '%s' som et array"
-
-#: array.c:254
+#: array.c:368
#, c-format
msgid "attempt to use scalar parameter `%s' as an array"
msgstr "forsøg på at bruge skalarparameteren '%s' som et array"
-#: array.c:257
+#: array.c:371
#, c-format
msgid "attempt to use scalar `%s' as an array"
msgstr "forsøg på at bruge skalar '%s' som et array"
-#: array.c:302 array.c:707 builtin.c:84 builtin.c:1385 builtin.c:1427
-#: builtin.c:1440 builtin.c:1859 builtin.c:1871 eval.c:1135 eval.c:1139
-#: eval.c:1495 eval.c:1812
+#: array.c:418 array.c:584 builtin.c:85 builtin.c:1566 builtin.c:1608
+#: builtin.c:1621 builtin.c:2047 builtin.c:2059 eval.c:1121 eval.c:1125
+#: eval.c:1520
#, c-format
msgid "attempt to use array `%s' in a scalar context"
msgstr "forsøg på at bruge array '%s' i skalarsammenhæng"
-#: array.c:513
-#, c-format
-msgid "reference to uninitialized element `%s[\"%.*s\"]'"
-msgstr "reference til ikke-initieret element '%s[\"%.*s\"]'"
-
-#: array.c:519
-#, c-format
-msgid "subscript of array `%s' is null string"
-msgstr "indeks i array '%s' er en tom streng"
-
-#: array.c:723
+#: array.c:591
#, c-format
msgid "delete: index `%s' not in array `%s'"
msgstr "delete: indeks '%s' findes ikke i array '%s'"
-#: array.c:734 eval.c:1865
+#: array.c:605
#, c-format
msgid "attempt to use scalar `%s[\"%.*s\"]' as an array"
msgstr "forsøg på at bruge skalaren '%s[\"%.*s\"]' som array"
-#: array.c:910
-#, c-format
-msgid "%s: empty (null)\n"
-msgstr "%s: tom (null)\n"
-
-#: array.c:915
-#, c-format
-msgid "%s: empty (zero)\n"
-msgstr "%s: tom (nul)\n"
-
-#: array.c:919
-#, c-format
-msgid "%s: table_size = %d, array_size = %d\n"
-msgstr "%s: tabelstørrelse = %d, arraystørrelse = %d\n"
-
-#: array.c:954
-#, c-format
-msgid "%s: is parameter\n"
-msgstr "%s: er parameter\n"
-
-#: array.c:958
-#, c-format
-msgid "%s: array_ref to %s\n"
-msgstr "%s: arrayreference til %s\n"
-
-#: array.c:963
-msgid "adump: argument not an array"
+#: array.c:784
+#, fuzzy
+msgid "adump: first argument not an array"
msgstr "adump: argument er ikke et array"
-#: array.c:1086
+#: array.c:823
msgid "asort: second argument not an array"
msgstr "asort: andet argument er ikke et array"
-#: array.c:1087
+#: array.c:824
msgid "asorti: second argument not an array"
msgstr "asorti: andet argument er ikke et array"
-#: array.c:1094
+#: array.c:831
msgid "asort: first argument not an array"
msgstr "asort: første argument er ikke et array"
-#: array.c:1095
+#: array.c:832
msgid "asorti: first argument not an array"
msgstr "asorti: første argument er ikke et array"
-#: array.c:1102
+#: array.c:839
msgid "asort: cannot use a subarray of first arg for second arg"
msgstr ""
"asort: kan ikke bruge et underarray af første argument for andet argument"
-#: array.c:1103
+#: array.c:840
msgid "asorti: cannot use a subarray of first arg for second arg"
msgstr ""
"asorti: kan ikke bruge et underarray af første argument for andet argument"
-#: array.c:1108
+#: array.c:845
msgid "asort: cannot use a subarray of second arg for first arg"
msgstr ""
"asort: kan ikke bruge et underarray af andet argument for første argument"
-#: array.c:1109
+#: array.c:846
msgid "asorti: cannot use a subarray of second arg for first arg"
msgstr ""
"asorti: kan ikke bruge et underarray af andet argument for første argument"
-#: array.c:1655
+#: array.c:1314
#, c-format
msgid "`%s' is invalid as a function name"
msgstr "'%s' er ugyldigt som funktionsnavn"
-#: array.c:1659
+#: array.c:1318
#, c-format
msgid "sort comparison function `%s' is not defined"
msgstr "funktionen for sorteringssammenligning '%s' er ikke defineret"
-#: awkgram.y:249
+#: awkgram.y:223
#, c-format
msgid "%s blocks must have an action part"
msgstr "%s-blokke skal have en handlingsdel"
-#: awkgram.y:252
+#: awkgram.y:226
msgid "each rule must have a pattern or an action part"
msgstr "hver regel skal have et mønster eller en handlingsdel"
-#: awkgram.y:323 awkgram.y:334
+#: awkgram.y:315 awkgram.y:326
msgid "old awk does not support multiple `BEGIN' or `END' rules"
msgstr ""
"gamle versioner af awk understøtter ikke flere 'BEGIN'- eller 'END'-regler"
-#: awkgram.y:371
+#: awkgram.y:363
#, c-format
msgid "`%s' is a built-in function, it cannot be redefined"
msgstr "'%s' er en indbygget funktion, den kan ikke omdefineres"
-#: awkgram.y:432
+#: awkgram.y:409
msgid "regexp constant `//' looks like a C++ comment, but is not"
msgstr "regexp-konstanten '//' ser ud som en C++-kommentar, men er det ikke"
-#: awkgram.y:436
+#: awkgram.y:413
#, c-format
msgid "regexp constant `/%s/' looks like a C comment, but is not"
msgstr "regexp-konstanten '/%s/' ser ud som en C-kommentar, men er det ikke"
-#: awkgram.y:528
+#: awkgram.y:505
#, c-format
msgid "duplicate case values in switch body: %s"
msgstr "dublet case-værdier i switch-krop %s"
-#: awkgram.y:549
+#: awkgram.y:526
msgid "duplicate `default' detected in switch body"
msgstr "dublet 'default' opdaget i switch-krop"
-#: awkgram.y:809
+#: awkgram.y:786
msgid "`break' is not allowed outside a loop or switch"
msgstr "'break' uden for en løkke eller switch er ikke tilladt"
-#: awkgram.y:818
+#: awkgram.y:795
msgid "`continue' is not allowed outside a loop"
msgstr "'continue' uden for en løkke er ikke tilladt"
-#: awkgram.y:828
+#: awkgram.y:805
#, c-format
msgid "`next' used in %s action"
msgstr "'next' brugt i %s-handling"
-#: awkgram.y:837
+#: awkgram.y:814
#, c-format
msgid "`nextfile' used in %s action"
msgstr "'nextfile' brugt i %s-handling"
-#: awkgram.y:861
+#: awkgram.y:838
msgid "`return' used outside function context"
msgstr "'return' brugt uden for funktion"
-#: awkgram.y:921
+#: awkgram.y:912
msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'"
msgstr ""
"alenestående 'print' i BEGIN eller END-regel skulle muligvis være 'print "
"\"\"'"
-#: awkgram.y:1016 awkgram.y:1020
+#: awkgram.y:978 awkgram.y:1027
+msgid "`delete' is not allowed with SYMTAB"
+msgstr ""
+
+#: awkgram.y:980 awkgram.y:1029
+msgid "`delete' is not allowed with FUNCTAB"
+msgstr ""
+
+#: awkgram.y:1014 awkgram.y:1018
msgid "`delete(array)' is a non-portable tawk extension"
msgstr "'delete array' er en ikke-portabel udvidelse fra tawk"
-#: awkgram.y:1132
+#: awkgram.y:1139
msgid "multistage two-way pipelines don't work"
msgstr "flertrins dobbeltrettede datakanaler fungerer ikke"
-#: awkgram.y:1235
+#: awkgram.y:1242
msgid "regular expression on right of assignment"
msgstr "regulært udtryk i højreleddet af en tildeling"
-#: awkgram.y:1246
+#: awkgram.y:1253
msgid "regular expression on left of `~' or `!~' operator"
msgstr "regulært udtryk på venstre side af en '~'- eller '!~'-operator"
-#: awkgram.y:1262 awkgram.y:1416
+#: awkgram.y:1269 awkgram.y:1420
msgid "old awk does not support the keyword `in' except after `for'"
msgstr ""
"gamle versioner af awk understøtter ikke nøgleordet 'in' undtagen efter 'for'"
-#: awkgram.y:1272
+#: awkgram.y:1279
msgid "regular expression on right of comparison"
msgstr "regulært udtryk i højreleddet af en sammenligning"
-#: awkgram.y:1391
+#: awkgram.y:1395
#, c-format
msgid "`getline var' invalid inside `%s' rule"
msgstr "'getline var' ugyldig inden i '%s' regel"
-#: awkgram.y:1394 eval.c:2504
+#: awkgram.y:1398
#, c-format
msgid "`getline' invalid inside `%s' rule"
msgstr "'getline' ugyldig inden i '%s' regel"
-#: awkgram.y:1399
+#: awkgram.y:1403
msgid "non-redirected `getline' undefined inside END action"
msgstr "ikke-omdirigeret 'getline' udefineret inden i END-handling"
-#: awkgram.y:1418
+#: awkgram.y:1422
msgid "old awk does not support multidimensional arrays"
msgstr "gamle versioner af awk understøtter ikke flerdimensionale array"
-#: awkgram.y:1514
+#: awkgram.y:1519
msgid "call of `length' without parentheses is not portable"
msgstr "kald af 'length' uden parenteser er ikke portabelt"
-#: awkgram.y:1577
+#: awkgram.y:1585
msgid "indirect function calls are a gawk extension"
msgstr "indirekte funktionskald er en gawk-udvidelse"
-#: awkgram.y:1590
+#: awkgram.y:1598
#, c-format
msgid "can not use special variable `%s' for indirect function call"
msgstr "kan ikke bruge specialvariabel '%s' til indirekte funktionskald"
-#: awkgram.y:1668
+#: awkgram.y:1676
msgid "invalid subscript expression"
msgstr "ugyldigt indeksudtryk"
-#: awkgram.y:1708
-msgid "use of non-array as array"
-msgstr "brug af ikke-array som array"
-
-#: awkgram.y:1972 awkgram.y:1992 msg.c:98
+#: awkgram.y:2000 awkgram.y:2020 gawkapi.c:203 gawkapi.c:221 msg.c:119
msgid "warning: "
msgstr "advarsel: "
-#: awkgram.y:1990 msg.c:130
+#: awkgram.y:2018 gawkapi.c:189 gawkapi.c:218 msg.c:151
msgid "fatal: "
msgstr "fatal: "
-#: awkgram.y:2040
+#: awkgram.y:2068
msgid "unexpected newline or end of string"
msgstr "uventet nylinjetegn eller strengafslutning"
-#: awkgram.y:2297 awkgram.y:2355 awkgram.y:2539
+#: awkgram.y:2335 awkgram.y:2411 awkgram.y:2634 debug.c:517 debug.c:533
+#: debug.c:2790 debug.c:5038
#, c-format
msgid "can't open source file `%s' for reading (%s)"
msgstr "kan ikke åbne kildefilen '%s' for læsning (%s)"
-#: awkgram.y:2298 awkgram.y:2356 builtin.c:122
+#: awkgram.y:2336 awkgram.y:2461
+#, fuzzy, c-format
+msgid "can't open shared library `%s' for reading (%s)"
+msgstr "kan ikke åbne kildefilen '%s' for læsning (%s)"
+
+#: awkgram.y:2338 awkgram.y:2412 awkgram.y:2462 builtin.c:130 debug.c:5189
msgid "reason unknown"
msgstr "ukendt årsag"
-#: awkgram.y:2314
+#: awkgram.y:2347 awkgram.y:2371
+#, c-format
+msgid "can't include `%s' and use it as a program file"
+msgstr ""
+
+#: awkgram.y:2360
#, c-format
msgid "already included source file `%s'"
msgstr "allerede inkluderet kildefil '%s'"
-#: awkgram.y:2340
+#: awkgram.y:2361
+#, fuzzy, c-format
+msgid "already loaded shared library `%s'"
+msgstr "allerede inkluderet kildefil '%s'"
+
+#: awkgram.y:2396
msgid "@include is a gawk extension"
msgstr "@include er en gawk-udvidelse"
-#: awkgram.y:2346
+#: awkgram.y:2402
msgid "empty filename after @include"
msgstr "tomt filnavn efter @include"
-#: awkgram.y:2491
+#: awkgram.y:2446
+#, fuzzy
+msgid "@load is a gawk extension"
+msgstr "@include er en gawk-udvidelse"
+
+#: awkgram.y:2452
+#, fuzzy
+msgid "empty filename after @load"
+msgstr "tomt filnavn efter @include"
+
+#: awkgram.y:2586
msgid "empty program text on command line"
msgstr "tom programtekst på kommandolinjen"
-#: awkgram.y:2606
+#: awkgram.y:2701
#, c-format
msgid "can't read sourcefile `%s' (%s)"
msgstr "kan ikke læse kildefilen '%s' (%s)"
-#: awkgram.y:2617
+#: awkgram.y:2712
#, c-format
msgid "source file `%s' is empty"
msgstr "kildefilen '%s' er tom"
-#: awkgram.y:2794
+#: awkgram.y:2889
msgid "source file does not end in newline"
msgstr "kildefilen slutter ikke med en ny linje"
-#: awkgram.y:2897
+#: awkgram.y:2994
msgid "unterminated regexp ends with `\\' at end of file"
msgstr "uafsluttet regulært udtryk slutter med '\\' i slutningen af filen"
-#: awkgram.y:2921
+#: awkgram.y:3018
#, c-format
msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk"
msgstr "%s: %d: regex-ændringstegn '/.../%c' fra tawk virker ikke i gawk"
-#: awkgram.y:2925
+#: awkgram.y:3022
#, c-format
msgid "tawk regex modifier `/.../%c' doesn't work in gawk"
msgstr "regex-ændringstegn '/.../%c' fra tawk virker ikke i gawk"
-#: awkgram.y:2932
+#: awkgram.y:3029
msgid "unterminated regexp"
msgstr "uafsluttet regulært udtryk"
-#: awkgram.y:2936
+#: awkgram.y:3033
msgid "unterminated regexp at end of file"
msgstr "uafsluttet regulært udtryk i slutningen af filen"
-#: awkgram.y:2995
+#: awkgram.y:3092
msgid "use of `\\ #...' line continuation is not portable"
msgstr "brug af '\\ #...' for linjefortsættelse er ikke portabelt"
-#: awkgram.y:3011
+#: awkgram.y:3108
msgid "backslash not last character on line"
msgstr "sidste tegn på linjen er ikke en omvendt skråstreg"
-#: awkgram.y:3072
+#: awkgram.y:3169
msgid "POSIX does not allow operator `**='"
msgstr "POSIX tillader ikke operatoren '**='"
-#: awkgram.y:3074
+#: awkgram.y:3171
msgid "old awk does not support operator `**='"
msgstr "gamle versioner af awk understøtter ikke operatoren '**='"
-#: awkgram.y:3083
+#: awkgram.y:3180
msgid "POSIX does not allow operator `**'"
msgstr "POSIX tillader ikke operatoren '**'"
-#: awkgram.y:3085
+#: awkgram.y:3182
msgid "old awk does not support operator `**'"
msgstr "gamle versioner af awk understøtter ikke operatoren '**'"
-#: awkgram.y:3120
+#: awkgram.y:3217
msgid "operator `^=' is not supported in old awk"
msgstr "operatoren '^=' understøttes ikke i gamle versioner af awk"
-#: awkgram.y:3128
+#: awkgram.y:3225
msgid "operator `^' is not supported in old awk"
msgstr "operatoren '^' understøttes ikke i gamle versioner af awk"
-#: awkgram.y:3221 awkgram.y:3237
+#: awkgram.y:3318 awkgram.y:3334 command.y:1178
msgid "unterminated string"
msgstr "uafsluttet streng"
-#: awkgram.y:3433
+#: awkgram.y:3555
#, c-format
msgid "invalid char '%c' in expression"
msgstr "ugyldigt tegn '%c' i udtryk"
-#: awkgram.y:3480
+#: awkgram.y:3602
#, c-format
msgid "`%s' is a gawk extension"
msgstr "'%s' er en gawk-udvidelse"
-#: awkgram.y:3485
+#: awkgram.y:3607
#, c-format
msgid "`%s' is a Bell Labs extension"
msgstr "'%s' er en Bell Labs-udvidelse"
-#: awkgram.y:3490
+#: awkgram.y:3612
#, c-format
msgid "POSIX does not allow `%s'"
msgstr "POSIX tillader ikke '%s'"
-#: awkgram.y:3498
+#: awkgram.y:3620
#, c-format
msgid "`%s' is not supported in old awk"
msgstr "'%s' understøttes ikke i gamle versioner af awk"
-#: awkgram.y:3565
+#: awkgram.y:3688
msgid "`goto' considered harmful!\n"
msgstr "'goto' anses for skadelig!\n"
-#: awkgram.y:3616
+#: awkgram.y:3722
#, c-format
msgid "%d is invalid as number of arguments for %s"
msgstr "%d er et ugyldigt antal argumenter for %s"
-#: awkgram.y:3651
+#: awkgram.y:3757
#, c-format
msgid "%s: string literal as last arg of substitute has no effect"
msgstr ""
"%s: bogstavelig streng som sidste argument til erstatning har ingen effekt"
-#: awkgram.y:3656
+#: awkgram.y:3762
#, c-format
msgid "%s third parameter is not a changeable object"
msgstr "%s: tredje argument er ikke et ændringsbart objekt"
-#: awkgram.y:3729 awkgram.y:3732
+#: awkgram.y:3841 awkgram.y:3844
msgid "match: third argument is a gawk extension"
msgstr "match: tredje argument er en gawk-udvidelse"
-#: awkgram.y:3786 awkgram.y:3789
+#: awkgram.y:3898 awkgram.y:3901
msgid "close: second argument is a gawk extension"
msgstr "close: andet argument er en gawk-udvidelse"
-#: awkgram.y:3801
+#: awkgram.y:3913
msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
msgstr ""
"brug af dcgettext(_\"...\") er forkert: fjern det indledende "
"understregningstegn"
-#: awkgram.y:3816
+#: awkgram.y:3928
msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
msgstr ""
"brug af dcgettext(_\"...\") er forkert: fjern det indledende "
"understregningstegn"
-#: awkgram.y:3908
-#, c-format
-msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
-msgstr "funktionen '%s': parameter %d, '%s', er samme som parameter %d"
-
-#: awkgram.y:3950
+#: awkgram.y:3994
#, c-format
msgid "function `%s': parameter `%s' shadows global variable"
msgstr "funktionen '%s': parameteren '%s' overskygger en global variabel"
-#: awkgram.y:4108
+#: awkgram.y:4051 debug.c:4019 debug.c:4062 debug.c:5187
#, c-format
msgid "could not open `%s' for writing (%s)"
msgstr "kunne ikke åbne '%s' for skrivning (%s)"
-#: awkgram.y:4109
+#: awkgram.y:4052
msgid "sending variable list to standard error"
msgstr "sender variabelliste til standard fejl"
-#: awkgram.y:4115
+#: awkgram.y:4060
#, c-format
msgid "%s: close failed (%s)"
msgstr "%s: lukning mislykkedes (%s)"
-#: awkgram.y:4167
+#: awkgram.y:4085
msgid "shadow_funcs() called twice!"
msgstr "shadow_funcs() kaldt to gange!"
-#: awkgram.y:4173
+#: awkgram.y:4093
msgid "there were shadowed variables."
msgstr "der var skyggede variable."
-#: awkgram.y:4203
+#: awkgram.y:4164
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "funktionsnavnet '%s' er allerede defineret"
+
+#: awkgram.y:4210
#, c-format
msgid "function `%s': can't use function name as parameter name"
msgstr "funktionen '%s': kan ikke bruge funktionsnavn som parameternavn"
-#: awkgram.y:4207
+#: awkgram.y:4213
#, c-format
msgid "function `%s': can't use special variable `%s' as a function parameter"
msgstr ""
"funktionen '%s': kan ikke bruge specialvariabel '%s' som en "
"funktionsparameter"
-#: awkgram.y:4223
+#: awkgram.y:4221
#, c-format
-msgid "function name `%s' previously defined"
-msgstr "funktionsnavnet '%s' er allerede defineret"
+msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
+msgstr "funktionen '%s': parameter %d, '%s', er samme som parameter %d"
-#: awkgram.y:4391 awkgram.y:4397
+#: awkgram.y:4315 awkgram.y:4319
#, c-format
msgid "function `%s' called but never defined"
msgstr "funktionen '%s' kaldt, men aldrig defineret"
-#: awkgram.y:4400
+#: awkgram.y:4324
#, c-format
msgid "function `%s' defined but never called directly"
msgstr "funktionen '%s' defineret, men aldrig kaldt direkte"
-#: awkgram.y:4432
+#: awkgram.y:4356
#, c-format
msgid "regexp constant for parameter #%d yields boolean value"
msgstr "konstant regulært udtryk for parameter %d giver en boolesk værdi"
-#: awkgram.y:4541
+#: awkgram.y:4402
#, c-format
msgid ""
"function `%s' called with space between name and `(',\n"
@@ -524,227 +515,227 @@ msgstr ""
"funktionen '%s' kaldt med blanktegn mellem navnet og '(',\n"
"eller brugt som en variabel eller et array"
-#: awkgram.y:4788 eval.c:2056
+#: awkgram.y:4618
msgid "division by zero attempted"
msgstr "forsøgte at dividere med nul"
-#: awkgram.y:4797 eval.c:2072
+#: awkgram.y:4627
#, c-format
msgid "division by zero attempted in `%%'"
msgstr "forsøgte at dividere med nul i '%%'"
-#: builtin.c:120
+#: builtin.c:128
#, c-format
msgid "%s to \"%s\" failed (%s)"
msgstr "%s til '%s' mislykkedes (%s)"
-#: builtin.c:121
+#: builtin.c:129
msgid "standard output"
msgstr "standard ud"
-#: builtin.c:135
+#: builtin.c:143
msgid "exp: received non-numeric argument"
msgstr "exp: fik et ikke-numerisk argument"
-#: builtin.c:141
+#: builtin.c:149
#, c-format
msgid "exp: argument %g is out of range"
msgstr "exp: argumentet %g er uden for det tilladte område"
-#: builtin.c:200
+#: builtin.c:208
#, c-format
msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing"
msgstr ""
"fflush: kan ikke rense: datakanalen '%s' åbnet for læsning, ikke skrivning"
-#: builtin.c:203
+#: builtin.c:211
#, c-format
msgid "fflush: cannot flush: file `%s' opened for reading, not writing"
msgstr "fflush: kan ikke rense: filen '%s' åbnet for læsning, ikke skrivning"
-#: builtin.c:215
+#: builtin.c:223
#, c-format
msgid "fflush: `%s' is not an open file, pipe or co-process"
msgstr "fflush: '%s' er ikke en åben fil, datakanal eller ko-proces"
-#: builtin.c:333
+#: builtin.c:341
msgid "index: received non-string first argument"
msgstr "indeks: første argument er ikke en streng"
-#: builtin.c:335
+#: builtin.c:343
msgid "index: received non-string second argument"
msgstr "indeks: andet argument er ikke en streng"
-#: builtin.c:457
+#: builtin.c:467 mpfr.c:770
msgid "int: received non-numeric argument"
msgstr "int: fik et ikke-numerisk argument"
-#: builtin.c:493
+#: builtin.c:503
msgid "length: received array argument"
msgstr "length: fik et array-argument"
-#: builtin.c:496
+#: builtin.c:506
msgid "`length(array)' is a gawk extension"
msgstr "'length(array)' er en gawk-udvidelse"
-#: builtin.c:504
+#: builtin.c:514
msgid "length: received non-string argument"
msgstr "length: fik et argument som ikke er en streng"
-#: builtin.c:535
+#: builtin.c:545
msgid "log: received non-numeric argument"
msgstr "log: fik et ikke-numerisk argument"
-#: builtin.c:538
+#: builtin.c:548
#, c-format
msgid "log: received negative argument %g"
msgstr "log: fik et negativt argument %g"
-#: builtin.c:694 builtin.c:699
+#: builtin.c:746 builtin.c:751
msgid "fatal: must use `count$' on all formats or none"
msgstr "fatal: skal bruge 'count$' på alle formater eller ikke nogen"
-#: builtin.c:762
+#: builtin.c:821
#, c-format
msgid "field width is ignored for `%%' specifier"
msgstr "feltbredde ignoreret for '%%'-angivelse"
-#: builtin.c:764
+#: builtin.c:823
#, c-format
msgid "precision is ignored for `%%' specifier"
msgstr "præcision ignoreret for '%%'-angivelse"
-#: builtin.c:766
+#: builtin.c:825
#, c-format
msgid "field width and precision are ignored for `%%' specifier"
msgstr "feltbredde og præcision ignoreret for '%%'-angivelse"
-#: builtin.c:817
+#: builtin.c:876
msgid "fatal: `$' is not permitted in awk formats"
msgstr "fatal: '$' tillades ikke i awk-formater"
-#: builtin.c:826
+#: builtin.c:885
msgid "fatal: arg count with `$' must be > 0"
msgstr "fatal: argumentantallet med '$' skal være > 0"
-#: builtin.c:830
+#: builtin.c:889
#, c-format
msgid "fatal: arg count %ld greater than total number of supplied arguments"
msgstr "fatal: argumentantallet %ld er større end antal givne argumenter"
-#: builtin.c:834
+#: builtin.c:893
msgid "fatal: `$' not permitted after period in format"
msgstr "fatal: '$' tillades ikke efter et punktum i formatet"
-#: builtin.c:850
+#: builtin.c:909
msgid "fatal: no `$' supplied for positional field width or precision"
msgstr ""
"fatal: intet '$' angivet for bredde eller præcision af positionsangivet felt"
-#: builtin.c:921
+#: builtin.c:981
msgid "`l' is meaningless in awk formats; ignored"
msgstr "'l' er meningsløst i awk-formater, ignoreret"
-#: builtin.c:925
+#: builtin.c:985
msgid "fatal: `l' is not permitted in POSIX awk formats"
msgstr "fatal: 'l' tillades ikke i POSIX awk-formater"
-#: builtin.c:938
+#: builtin.c:998
msgid "`L' is meaningless in awk formats; ignored"
msgstr "'L' er meningsløst i awk-formater, ignoreret"
-#: builtin.c:942
+#: builtin.c:1002
msgid "fatal: `L' is not permitted in POSIX awk formats"
msgstr "fatal: 'L' tillades ikke i POSIX awk-formater"
-#: builtin.c:955
+#: builtin.c:1015
msgid "`h' is meaningless in awk formats; ignored"
msgstr "'h' er meningsløst i awk-formater, ignoreret"
-#: builtin.c:959
+#: builtin.c:1019
msgid "fatal: `h' is not permitted in POSIX awk formats"
msgstr "fatal: 'h' tillades ikke i POSIX awk-formater"
-#: builtin.c:1272
+#: builtin.c:1414
#, c-format
msgid "[s]printf: value %g is out of range for `%%%c' format"
msgstr "[s]printf: værdi %g er uden for område for '%%%c'-format"
-#: builtin.c:1332
+#: builtin.c:1512
#, c-format
msgid "ignoring unknown format specifier character `%c': no argument converted"
msgstr ""
"ignorerer ukendt formatspecificeringstegn '%c': intet argument konverteret"
-#: builtin.c:1337
+#: builtin.c:1517
msgid "fatal: not enough arguments to satisfy format string"
msgstr "fatal: for få argumenter til formatstrengen"
-#: builtin.c:1339
+#: builtin.c:1519
msgid "^ ran out for this one"
msgstr "^ sluttede her"
-#: builtin.c:1346
+#: builtin.c:1526
msgid "[s]printf: format specifier does not have control letter"
msgstr "[s]printf: formatspecifikation har intet kommandobogstav"
-#: builtin.c:1349
+#: builtin.c:1529
msgid "too many arguments supplied for format string"
msgstr "for mange argumenter til formatstrengen"
-#: builtin.c:1423 builtin.c:1434
+#: builtin.c:1604 builtin.c:1615
msgid "printf: no arguments"
msgstr "printf: ingen argumenter"
-#: builtin.c:1475
+#: builtin.c:1656
msgid "sqrt: received non-numeric argument"
msgstr "sqrt: fik ikke-numerisk argument"
-#: builtin.c:1479
+#: builtin.c:1660
#, c-format
msgid "sqrt: called with negative argument %g"
msgstr "sqrt: kaldt med negativt argument %g"
-#: builtin.c:1503
+#: builtin.c:1691
#, c-format
msgid "substr: length %g is not >= 1"
msgstr "substr: længden %g er ikke >= 1"
-#: builtin.c:1505
+#: builtin.c:1693
#, c-format
msgid "substr: length %g is not >= 0"
msgstr "substr: længden %g er ikke >= 0"
-#: builtin.c:1512
+#: builtin.c:1700
#, c-format
msgid "substr: non-integer length %g will be truncated"
msgstr "substr: længden %g som ikke er et heltal vil blive trunkeret"
-#: builtin.c:1517
+#: builtin.c:1705
#, c-format
msgid "substr: length %g too big for string indexing, truncating to %g"
msgstr "substr: længden %g for stor til strengindeksering, trunkerer til %g"
-#: builtin.c:1529
+#: builtin.c:1717
#, c-format
msgid "substr: start index %g is invalid, using 1"
msgstr "substr: startindeks %g er ugyldigt, bruger 1"
-#: builtin.c:1534
+#: builtin.c:1722
#, c-format
msgid "substr: non-integer start index %g will be truncated"
msgstr "substr: startindeks %g som ikke er et heltal vil blive trunkeret"
-#: builtin.c:1559
+#: builtin.c:1747
msgid "substr: source string is zero length"
msgstr "substr: kildestrengen er tom"
-#: builtin.c:1575
+#: builtin.c:1763
#, c-format
msgid "substr: start index %g is past end of string"
msgstr "substr: startindeks %g er forbi slutningen på strengen"
-#: builtin.c:1583
+#: builtin.c:1771
#, c-format
msgid ""
"substr: length %g at start index %g exceeds length of first argument (%lu)"
@@ -752,229 +743,1086 @@ msgstr ""
"substr: længden %g ved startindeks %g overskrider længden af første argument "
"(%lu)"
-#: builtin.c:1657
+#: builtin.c:1845
msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type"
msgstr "strftime: formatværdi i PROCINFO[\"strftime\"] har numerisk type"
-#: builtin.c:1680
+#: builtin.c:1868
msgid "strftime: received non-numeric second argument"
msgstr "strftime: fik et ikke-numerisk andet argument"
-#: builtin.c:1683
+#: builtin.c:1872
msgid "strftime: second argument less than 0 or too big for time_t"
msgstr "strftime: andet argument mindre end 0 eller for stort til time_t"
-#: builtin.c:1690
+#: builtin.c:1879
msgid "strftime: received non-string first argument"
msgstr "strftime: fik et første argument som ikke er en streng"
-#: builtin.c:1696
+#: builtin.c:1886
msgid "strftime: received empty format string"
msgstr "strftime: fik en tom formatstreng"
-#: builtin.c:1762
+#: builtin.c:1952
msgid "mktime: received non-string argument"
msgstr "mktime: fik et argument som ikke er en streng"
-#: builtin.c:1779
+#: builtin.c:1969
msgid "mktime: at least one of the values is out of the default range"
msgstr "mktime: mindst én af værdierne er udenfor standardområdet"
-#: builtin.c:1814
+#: builtin.c:2004
msgid "'system' function not allowed in sandbox mode"
msgstr "'system'-funktion ikke tilladt i sandkasse-tilstand"
-#: builtin.c:1819
+#: builtin.c:2009
msgid "system: received non-string argument"
msgstr "system: fik et argument som ikke er en streng"
-#: builtin.c:1874 eval.c:1159 eval.c:1790 eval.c:1803
-#, c-format
-msgid "reference to uninitialized variable `%s'"
-msgstr "reference til ikke-initieret variabel '%s'"
-
-#: builtin.c:1941
+#: builtin.c:2127
#, c-format
msgid "reference to uninitialized field `$%d'"
msgstr "reference til ikke-initieret felt '$%d'"
-#: builtin.c:2028
+#: builtin.c:2214
msgid "tolower: received non-string argument"
msgstr "tolower: fik et argument som ikke er en streng"
-#: builtin.c:2062
+#: builtin.c:2248
msgid "toupper: received non-string argument"
msgstr "toupper: fik et argument som ikke er en streng"
-#: builtin.c:2098
+#: builtin.c:2284 mpfr.c:685
msgid "atan2: received non-numeric first argument"
msgstr "atan2: fik et ikke-numerisk første argument"
-#: builtin.c:2100
+#: builtin.c:2286 mpfr.c:687
msgid "atan2: received non-numeric second argument"
msgstr "atan2: fik et ikke-numerisk andet argument"
-#: builtin.c:2119
+#: builtin.c:2305
msgid "sin: received non-numeric argument"
msgstr "sin: fik et ikke-numerisk argument"
-#: builtin.c:2135
+#: builtin.c:2321
msgid "cos: received non-numeric argument"
msgstr "cos: fik et ikke-numerisk argument"
-#: builtin.c:2188
+#: builtin.c:2374 mpfr.c:1137
msgid "srand: received non-numeric argument"
msgstr "srand: fik et ikke-numerisk argument"
-#: builtin.c:2219
+#: builtin.c:2405
msgid "match: third argument is not an array"
msgstr "match: tredje argument er ikke et array"
-#: builtin.c:2483
+#: builtin.c:2670
msgid "gensub: third argument of 0 treated as 1"
msgstr "gensub: 0 i tredje argument behandlet som 1"
-#: builtin.c:2776
+#: builtin.c:2963
msgid "lshift: received non-numeric first argument"
msgstr "lshift: fik et ikke-numerisk første argument"
-#: builtin.c:2778
+#: builtin.c:2965
msgid "lshift: received non-numeric second argument"
msgstr "lshift: fik et ikke-numerisk andet argument"
-#: builtin.c:2784
+#: builtin.c:2971
#, fuzzy, c-format
msgid "lshift(%f, %f): negative values will give strange results"
msgstr "lshift(%lf, %lf): negative værdier vil give mærkelige resultater"
-#: builtin.c:2786
+#: builtin.c:2973
#, fuzzy, c-format
msgid "lshift(%f, %f): fractional values will be truncated"
msgstr "lshift(%lf, %lf): kommatalsværdier vil blive trunkeret"
-#: builtin.c:2788
+#: builtin.c:2975
#, fuzzy, c-format
msgid "lshift(%f, %f): too large shift value will give strange results"
msgstr ""
"lshift(%lf, %lf): for store skifteværdier vil give mærkelige resultater"
-#: builtin.c:2813
+#: builtin.c:3000
msgid "rshift: received non-numeric first argument"
msgstr "rshift: fik et ikke-numerisk første argument"
-#: builtin.c:2815
+#: builtin.c:3002
msgid "rshift: received non-numeric second argument"
msgstr "rshift: fik et ikke-numerisk andet argument"
-#: builtin.c:2821
+#: builtin.c:3008
#, fuzzy, c-format
msgid "rshift(%f, %f): negative values will give strange results"
msgstr "rshift(%lf, %lf): negative værdier vil give mærkelige resultater"
-#: builtin.c:2823
+#: builtin.c:3010
#, fuzzy, c-format
msgid "rshift(%f, %f): fractional values will be truncated"
msgstr "rshift(%lf, %lf): kommatalsværdier vil blive trunkeret"
-#: builtin.c:2825
+#: builtin.c:3012
#, fuzzy, c-format
msgid "rshift(%f, %f): too large shift value will give strange results"
msgstr ""
"rshift(%lf, %lf): for store skifteværdier vil give mærkelige resultater"
-#: builtin.c:2850
-msgid "and: received non-numeric first argument"
-msgstr "and: fik et ikke-numerisk første argument"
-
-#: builtin.c:2852
-msgid "and: received non-numeric second argument"
-msgstr "and: fik et ikke-numerisk andet argument"
+#: builtin.c:3037
+#, fuzzy
+msgid "and: called with less than two arguments"
+msgstr "sqrt: kaldt med negativt argument %g"
-#: builtin.c:2858
+#: builtin.c:3042
#, fuzzy, c-format
-msgid "and(%f, %f): negative values will give strange results"
-msgstr "and(%lf, %lf): negative værdier vil give mærkelige resultater"
+msgid "and: argument %d is non-numeric"
+msgstr "exp: argumentet %g er uden for det tilladte område"
-#: builtin.c:2860
+#: builtin.c:3046
#, fuzzy, c-format
-msgid "and(%f, %f): fractional values will be truncated"
-msgstr "and(%lf, %lf): kommatalsværdier vil blive trunkeret"
-
-#: builtin.c:2885
-msgid "or: received non-numeric first argument"
-msgstr "or: fik et ikke-numerisk første argument"
+msgid "and: argument %d negative value %g will give strange results"
+msgstr "and(%lf, %lf): negative værdier vil give mærkelige resultater"
-#: builtin.c:2887
-msgid "or: received non-numeric second argument"
-msgstr "or: fik et ikke-numerisk andet argument"
+#: builtin.c:3069
+#, fuzzy
+msgid "or: called with less than two arguments"
+msgstr "sqrt: kaldt med negativt argument %g"
-#: builtin.c:2893
+#: builtin.c:3074
#, fuzzy, c-format
-msgid "or(%f, %f): negative values will give strange results"
-msgstr "or(%lf, %lf): negative værdier vil give mærkelige resultater"
+msgid "or: argument %d is non-numeric"
+msgstr "exp: argumentet %g er uden for det tilladte område"
-#: builtin.c:2895
+#: builtin.c:3078
#, fuzzy, c-format
-msgid "or(%f, %f): fractional values will be truncated"
-msgstr "or(%lf, %lf): kommatalsværdier vil blive trunkeret"
-
-#: builtin.c:2923
-msgid "xor: received non-numeric first argument"
-msgstr "xor: fik et ikke-numerisk første argument"
+msgid "or: argument %d negative value %g will give strange results"
+msgstr "compl(%lf): negative værdier vil give mærkelige resultater"
-#: builtin.c:2925
-msgid "xor: received non-numeric second argument"
-msgstr "xor: fik et ikke-numerisk andet argument"
+#: builtin.c:3100
+#, fuzzy
+msgid "xor: called with less than two arguments"
+msgstr "sqrt: kaldt med negativt argument %g"
-#: builtin.c:2931
+#: builtin.c:3106
#, fuzzy, c-format
-msgid "xor(%f, %f): negative values will give strange results"
-msgstr "xor(%lf, %lf): negative værdier vil give mærkelige resultater"
+msgid "xor: argument %d is non-numeric"
+msgstr "exp: argumentet %g er uden for det tilladte område"
-#: builtin.c:2933
+#: builtin.c:3110
#, fuzzy, c-format
-msgid "xor(%f, %f): fractional values will be truncated"
-msgstr "xor(%lf, %lf): kommatalsværdier vil blive trunkeret"
+msgid "xor: argument %d negative value %g will give strange results"
+msgstr "xor(%lf, %lf): negative værdier vil give mærkelige resultater"
-#: builtin.c:2957 builtin.c:2963
+#: builtin.c:3135 mpfr.c:800
msgid "compl: received non-numeric argument"
msgstr "compl: fik et ikke-numerisk argument"
-#: builtin.c:2965
+#: builtin.c:3141
#, fuzzy, c-format
msgid "compl(%f): negative value will give strange results"
msgstr "compl(%lf): negative værdier vil give mærkelige resultater"
-#: builtin.c:2967
+#: builtin.c:3143
#, fuzzy, c-format
msgid "compl(%f): fractional value will be truncated"
msgstr "compl(%lf): kommatalsværdier vil blive trunkeret"
-#: builtin.c:3136
+#: builtin.c:3312
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr "dcgettext: '%s' er ikke en gyldig lokalitetskategori"
-#: eval.c:412
+#: command.y:225
+#, c-format
+msgid "Type (g)awk statement(s). End with the command \"end\"\n"
+msgstr ""
+
+#: command.y:289
+#, fuzzy, c-format
+msgid "invalid frame number: %d"
+msgstr "Ugyldig intervalslutning"
+
+#: command.y:295
+#, fuzzy, c-format
+msgid "info: invalid option - \"%s\""
+msgstr "%s: ugyldigt flag - '%c'\n"
+
+#: command.y:321
+#, c-format
+msgid "source \"%s\": already sourced."
+msgstr ""
+
+#: command.y:326
+#, c-format
+msgid "save \"%s\": command not permitted."
+msgstr ""
+
+#: command.y:339
+msgid "Can't use command `commands' for breakpoint/watchpoint commands"
+msgstr ""
+
+#: command.y:341
+msgid "no breakpoint/watchpoint has been set yet"
+msgstr ""
+
+#: command.y:343
+msgid "invalid breakpoint/watchpoint number"
+msgstr ""
+
+#: command.y:348
+#, c-format
+msgid "Type commands for when %s %d is hit, one per line.\n"
+msgstr ""
+
+#: command.y:350
+#, c-format
+msgid "End with the command \"end\"\n"
+msgstr ""
+
+#: command.y:357
+msgid "`end' valid only in command `commands' or `eval'"
+msgstr ""
+
+#: command.y:367
+msgid "`silent' valid only in command `commands'"
+msgstr ""
+
+#: command.y:373
+#, fuzzy, c-format
+msgid "trace: invalid option - \"%s\""
+msgstr "%s: ugyldigt flag - '%c'\n"
+
+#: command.y:387
+msgid "condition: invalid breakpoint/watchpoint number"
+msgstr ""
+
+#: command.y:449
+#, fuzzy
+msgid "argument not a string"
+msgstr "exp: argumentet %g er uden for det tilladte område"
+
+#: command.y:459 command.y:464
+#, c-format
+msgid "option: invalid parameter - \"%s\""
+msgstr ""
+
+#: command.y:474
+#, c-format
+msgid "no such function - \"%s\""
+msgstr ""
+
+#: command.y:531
+#, fuzzy, c-format
+msgid "enable: invalid option - \"%s\""
+msgstr "%s: ugyldigt flag - '%c'\n"
+
+#: command.y:597
+#, fuzzy, c-format
+msgid "invalid range specification: %d - %d"
+msgstr "Ugyldig intervalslutning"
+
+#: command.y:659
+#, fuzzy
+msgid "non-numeric value for field number"
+msgstr "ukendt værdi for felt-spec: %d\n"
+
+#: command.y:680 command.y:687
+msgid "non-numeric value found, numeric expected"
+msgstr ""
+
+#: command.y:712 command.y:718
+msgid "non-zero integer value"
+msgstr ""
+
+#: command.y:817
+msgid ""
+"backtrace [N] - print trace of all or N innermost (outermost if N < 0) "
+"frames."
+msgstr ""
+
+#: command.y:819
+msgid ""
+"break [[filename:]N|function] - set breakpoint at the specified location."
+msgstr ""
+
+#: command.y:821
+msgid "clear [[filename:]N|function] - delete breakpoints previously set."
+msgstr ""
+
+#: command.y:823
+msgid ""
+"commands [num] - starts a list of commands to be executed at a breakpoint"
+"(watchpoint) hit."
+msgstr ""
+
+#: command.y:825
+msgid "condition num [expr] - set or clear breakpoint or watchpoint condition."
+msgstr ""
+
+#: command.y:827
+msgid "continue [COUNT] - continue program being debugged."
+msgstr ""
+
+#: command.y:829
+msgid "delete [breakpoints] [range] - delete specified breakpoints."
+msgstr ""
+
+#: command.y:831
+msgid "disable [breakpoints] [range] - disable specified breakpoints."
+msgstr ""
+
+#: command.y:833
+msgid "display [var] - print value of variable each time the program stops."
+msgstr ""
+
+#: command.y:835
+msgid "down [N] - move N frames down the stack."
+msgstr ""
+
+#: command.y:837
+msgid "dump [filename] - dump instructions to file or stdout."
+msgstr ""
+
+#: command.y:839
+msgid "enable [once|del] [breakpoints] [range] - enable specified breakpoints."
+msgstr ""
+
+#: command.y:841
+msgid "end - end a list of commands or awk statements."
+msgstr ""
+
+#: command.y:843
+msgid "eval stmt|[p1, p2, ...] - evaluate awk statement(s)."
+msgstr ""
+
+#: command.y:845
+msgid "finish - execute until selected stack frame returns."
+msgstr ""
+
+#: command.y:847
+msgid "frame [N] - select and print stack frame number N."
+msgstr ""
+
+#: command.y:849
+msgid "help [command] - print list of commands or explanation of command."
+msgstr ""
+
+#: command.y:851
+msgid "ignore N COUNT - set ignore-count of breakpoint number N to COUNT."
+msgstr ""
+
+#: command.y:853
+msgid ""
+"info topic - source|sources|variables|functions|break|frame|args|locals|"
+"display|watch."
+msgstr ""
+
+#: command.y:855
+msgid "list [-|+|[filename:]lineno|function|range] - list specified line(s)."
+msgstr ""
+
+#: command.y:857
+msgid "next [COUNT] - step program, proceeding through subroutine calls."
+msgstr ""
+
+#: command.y:859
+msgid ""
+"nexti [COUNT] - step one instruction, but proceed through subroutine calls."
+msgstr ""
+
+#: command.y:861
+msgid "option [name[=value]] - set or display debugger option(s)."
+msgstr ""
+
+#: command.y:863
+msgid "print var [var] - print value of a variable or array."
+msgstr ""
+
+#: command.y:865
+msgid "printf format, [arg], ... - formatted output."
+msgstr ""
+
+#: command.y:867
+msgid "quit - exit debugger."
+msgstr ""
+
+#: command.y:869
+msgid "return [value] - make selected stack frame return to its caller."
+msgstr ""
+
+#: command.y:871
+msgid "run - start or restart executing program."
+msgstr ""
+
+#: command.y:874
+msgid "save filename - save commands from the session to file."
+msgstr ""
+
+#: command.y:877
+msgid "set var = value - assign value to a scalar variable."
+msgstr ""
+
+#: command.y:879
+msgid ""
+"silent - suspends usual message when stopped at a breakpoint/watchpoint."
+msgstr ""
+
+#: command.y:881
+msgid "source file - execute commands from file."
+msgstr ""
+
+#: command.y:883
+msgid "step [COUNT] - step program until it reaches a different source line."
+msgstr ""
+
+#: command.y:885
+msgid "stepi [COUNT] - step one instruction exactly."
+msgstr ""
+
+#: command.y:887
+msgid "tbreak [[filename:]N|function] - set a temporary breakpoint."
+msgstr ""
+
+#: command.y:889
+msgid "trace on|off - print instruction before executing."
+msgstr ""
+
+#: command.y:891
+msgid "undisplay [N] - remove variable(s) from automatic display list."
+msgstr ""
+
+#: command.y:893
+msgid ""
+"until [[filename:]N|function] - execute until program reaches a different "
+"line or line N within current frame."
+msgstr ""
+
+#: command.y:895
+msgid "unwatch [N] - remove variable(s) from watch list."
+msgstr ""
+
+#: command.y:897
+msgid "up [N] - move N frames up the stack."
+msgstr ""
+
+#: command.y:899
+msgid "watch var - set a watchpoint for a variable."
+msgstr ""
+
+#: command.y:1011 debug.c:395 msg.c:128
+#, c-format
+msgid "error: "
+msgstr "fejl: "
+
+#: command.y:1051
+#, fuzzy, c-format
+msgid "can't read command (%s)\n"
+msgstr "kan ikke omdirigere fra '%s' (%s)"
+
+#: command.y:1065
+#, fuzzy, c-format
+msgid "can't read command (%s)"
+msgstr "kan ikke omdirigere fra '%s' (%s)"
+
+#: command.y:1116
+#, fuzzy
+msgid "invalid character in command"
+msgstr "Ugyldigt tegnklassenavn"
+
+#: command.y:1152
+#, c-format
+msgid "unknown command - \"%.*s\", try help"
+msgstr ""
+
+#: command.y:1222
+#, c-format
+msgid "%s"
+msgstr ""
+
+#: command.y:1284
+#, fuzzy
+msgid "invalid character"
+msgstr "Ugyldigt sorteringstegn"
+
+#: command.y:1455
+#, c-format
+msgid "undefined command: %s\n"
+msgstr ""
+
+#: debug.c:246
+msgid "set or show the number of lines to keep in history file."
+msgstr ""
+
+#: debug.c:248
+msgid "set or show the list command window size."
+msgstr ""
+
+#: debug.c:250
+msgid "set or show gawk output file."
+msgstr ""
+
+#: debug.c:252
+msgid "set or show debugger prompt."
+msgstr ""
+
+#: debug.c:254
+msgid "(un)set or show saving of command history (value=on|off)."
+msgstr ""
+
+#: debug.c:256
+msgid "(un)set or show saving of options (value=on|off)."
+msgstr ""
+
+#: debug.c:258
+msgid "(un)set or show instruction tracing (value=on|off)."
+msgstr ""
+
+#: debug.c:339
+msgid "program not running."
+msgstr ""
+
+#: debug.c:442 debug.c:597
+#, fuzzy, c-format
+msgid "can't read source file `%s' (%s)"
+msgstr "kan ikke læse kildefilen '%s' (%s)"
+
+#: debug.c:447
+#, fuzzy, c-format
+msgid "source file `%s' is empty.\n"
+msgstr "kildefilen '%s' er tom"
+
+#: debug.c:474
+msgid "no current source file."
+msgstr ""
+
+#: debug.c:499
+#, fuzzy, c-format
+msgid "cannot find source file named `%s' (%s)"
+msgstr "kan ikke læse kildefilen '%s' (%s)"
+
+#: debug.c:523
+#, c-format
+msgid "WARNING: source file `%s' modified since program compilation.\n"
+msgstr ""
+
+#: debug.c:542
+#, c-format
+msgid "line number %d out of range; `%s' has %d lines"
+msgstr ""
+
+#: debug.c:602
+#, fuzzy, c-format
+msgid "unexpected eof while reading file `%s', line %d"
+msgstr "uventet nylinjetegn eller strengafslutning"
+
+#: debug.c:611
+#, c-format
+msgid "source file `%s' modified since start of program execution"
+msgstr ""
+
+#: debug.c:723
+#, fuzzy, c-format
+msgid "Current source file: %s\n"
+msgstr "allerede inkluderet kildefil '%s'"
+
+#: debug.c:724
+#, c-format
+msgid "Number of lines: %d\n"
+msgstr ""
+
+#: debug.c:731
+#, c-format
+msgid "Source file (lines): %s (%d)\n"
+msgstr ""
+
+#: debug.c:745
+msgid ""
+"Number Disp Enabled Location\n"
+"\n"
+msgstr ""
+
+#: debug.c:756
+#, c-format
+msgid "\tno of hits = %ld\n"
+msgstr ""
+
+#: debug.c:758
+#, c-format
+msgid "\tignore next %ld hit(s)\n"
+msgstr ""
+
+#: debug.c:760 debug.c:900
+#, c-format
+msgid "\tstop condition: %s\n"
+msgstr ""
+
+#: debug.c:762 debug.c:902
+msgid "\tcommands:\n"
+msgstr ""
+
+#: debug.c:784
+#, c-format
+msgid "Current frame: "
+msgstr ""
+
+#: debug.c:787
+#, c-format
+msgid "Called by frame: "
+msgstr ""
+
+#: debug.c:791
+#, c-format
+msgid "Caller of frame: "
+msgstr ""
+
+#: debug.c:809
+#, c-format
+msgid "None in main().\n"
+msgstr ""
+
+#: debug.c:839
+#, fuzzy
+msgid "No arguments.\n"
+msgstr "printf: ingen argumenter"
+
+#: debug.c:840
+msgid "No locals.\n"
+msgstr ""
+
+#: debug.c:848
+msgid ""
+"All defined variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:858
+msgid ""
+"All defined functions:\n"
+"\n"
+msgstr ""
+
+#: debug.c:877
+msgid ""
+"Auto-display variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:880
+msgid ""
+"Watch variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:1020
+#, fuzzy, c-format
+msgid "no symbol `%s' in current context\n"
+msgstr "'exit' kan ikke kaldes i den aktuelle kontekst"
+
+#: debug.c:1032 debug.c:1416
+#, fuzzy, c-format
+msgid "`%s' is not an array\n"
+msgstr "'%s' er ikke et gyldigt variabelnavn"
+
+#: debug.c:1046
+#, fuzzy, c-format
+msgid "$%ld = uninitialized field\n"
+msgstr "reference til ikke-initieret felt '$%d'"
+
+#: debug.c:1067
+#, fuzzy, c-format
+msgid "array `%s' is empty\n"
+msgstr "datafilen '%s' er tom"
+
+#: debug.c:1110 debug.c:1162
+#, fuzzy, c-format
+msgid "[\"%s\"] not in array `%s'\n"
+msgstr "delete: indeks '%s' findes ikke i array '%s'"
+
+#: debug.c:1166
+#, c-format
+msgid "`%s[\"%s\"]' is not an array\n"
+msgstr ""
+
+#: debug.c:1227 debug.c:4947
+#, fuzzy, c-format
+msgid "`%s' is not a scalar variable"
+msgstr "'%s' er ikke et gyldigt variabelnavn"
+
+#: debug.c:1249 debug.c:4977
+#, fuzzy, c-format
+msgid "attempt to use array `%s[\"%s\"]' in a scalar context"
+msgstr "forsøg på at bruge array '%s[\"%.*s\"]' i skalarsammenhæng"
+
+#: debug.c:1269 debug.c:4988
+#, fuzzy, c-format
+msgid "attempt to use scalar `%s[\"%s\"]' as array"
+msgstr "forsøg på at bruge skalaren '%s[\"%.*s\"]' som array"
+
+#: debug.c:1412
+#, fuzzy, c-format
+msgid "`%s' is a function"
+msgstr "'%s' er ugyldigt som funktionsnavn"
+
+#: debug.c:1454
+#, c-format
+msgid "watchpoint %d is unconditional\n"
+msgstr ""
+
+#: debug.c:1488
+#, c-format
+msgid "No display item numbered %ld"
+msgstr ""
+
+#: debug.c:1491
+#, c-format
+msgid "No watch item numbered %ld"
+msgstr ""
+
+#: debug.c:1517
+#, fuzzy, c-format
+msgid "%d: [\"%s\"] not in array `%s'\n"
+msgstr "delete: indeks '%s' findes ikke i array '%s'"
+
+#: debug.c:1756
+#, fuzzy
+msgid "attempt to use scalar value as array"
+msgstr "forsøg på at bruge en skalar som array"
+
+#: debug.c:1845
+#, c-format
+msgid "Watchpoint %d deleted because parameter is out of scope.\n"
+msgstr ""
+
+#: debug.c:1856
+#, c-format
+msgid "Display %d deleted because parameter is out of scope.\n"
+msgstr ""
+
+#: debug.c:1889
+#, c-format
+msgid " in file `%s', line %d\n"
+msgstr ""
+
+#: debug.c:1910
+#, c-format
+msgid " at `%s':%d"
+msgstr ""
+
+#: debug.c:1926 debug.c:1989
+#, c-format
+msgid "#%ld\tin "
+msgstr ""
+
+#: debug.c:1963
+#, c-format
+msgid "More stack frames follow ...\n"
+msgstr ""
+
+#: debug.c:2006
+#, fuzzy
+msgid "invalid frame number"
+msgstr "Ugyldig intervalslutning"
+
+#: debug.c:2178
+#, c-format
+msgid "Note: breakpoint %d (enabled, ignore next %ld hits), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2185
+#, c-format
+msgid "Note: breakpoint %d (enabled), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2192
+#, c-format
+msgid "Note: breakpoint %d (disabled, ignore next %ld hits), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2199
+#, c-format
+msgid "Note: breakpoint %d (disabled), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2216
+#, c-format
+msgid "Breakpoint %d set at file `%s', line %d\n"
+msgstr ""
+
+#: debug.c:2318
+#, c-format
+msgid "Can't set breakpoint in file `%s'\n"
+msgstr ""
+
+#: debug.c:2347 debug.c:2470 debug.c:3328
+#, fuzzy, c-format
+msgid "line number %d in file `%s' out of range"
+msgstr "exp: argumentet %g er uden for det tilladte område"
+
+#: debug.c:2351
+#, c-format
+msgid "Can't find rule!!!\n"
+msgstr ""
+
+#: debug.c:2353
+#, c-format
+msgid "Can't set breakpoint at `%s':%d\n"
+msgstr ""
+
+#: debug.c:2365
+#, c-format
+msgid "Can't set breakpoint in function `%s'\n"
+msgstr ""
+
+#: debug.c:2381
+#, c-format
+msgid "breakpoint %d set at file `%s', line %d is unconditional\n"
+msgstr ""
+
+#: debug.c:2486 debug.c:2508
+#, c-format
+msgid "Deleted breakpoint %d"
+msgstr ""
+
+#: debug.c:2492
+#, c-format
+msgid "No breakpoint(s) at entry to function `%s'\n"
+msgstr ""
+
+#: debug.c:2519
+#, fuzzy, c-format
+msgid "No breakpoint at file `%s', line #%d\n"
+msgstr "fejl ved læsning af inddatafilen '%s': %s"
+
+#: debug.c:2574 debug.c:2615 debug.c:2635 debug.c:2678
+msgid "invalid breakpoint number"
+msgstr ""
+
+#: debug.c:2590
+msgid "Delete all breakpoints? (y or n) "
+msgstr ""
+
+#: debug.c:2591 debug.c:2901 debug.c:2954
+msgid "y"
+msgstr ""
+
+#: debug.c:2640
+#, c-format
+msgid "Will ignore next %ld crossing(s) of breakpoint %d.\n"
+msgstr ""
+
+#: debug.c:2644
+#, c-format
+msgid "Will stop next time breakpoint %d is reached.\n"
+msgstr ""
+
+#: debug.c:2761
+#, c-format
+msgid "Can only debug programs provided with the `-f' option.\n"
+msgstr ""
+
+#: debug.c:2886
+#, c-format
+msgid "Failed to restart debugger"
+msgstr ""
+
+#: debug.c:2900
+msgid "Program already running. Restart from beginning (y/n)? "
+msgstr ""
+
+#: debug.c:2904
+#, c-format
+msgid "Program not restarted\n"
+msgstr ""
+
+#: debug.c:2914
+#, c-format
+msgid "error: cannot restart, operation not allowed\n"
+msgstr ""
+
+#: debug.c:2920
+#, c-format
+msgid "error (%s): cannot restart, ignoring rest of the commands\n"
+msgstr ""
+
+#: debug.c:2928
+#, c-format
+msgid "Starting program: \n"
+msgstr ""
+
+#: debug.c:2937
+#, c-format
+msgid "Program exited %s with exit value: %d\n"
+msgstr ""
+
+#: debug.c:2953
+msgid "The program is running. Exit anyway (y/n)? "
+msgstr ""
+
+#: debug.c:2988
+#, c-format
+msgid "Not stopped at any breakpoint; argument ignored.\n"
+msgstr ""
+
+#: debug.c:2993
+#, c-format
+msgid "invalid breakpoint number %d."
+msgstr ""
+
+#: debug.c:2998
+#, c-format
+msgid "Will ignore next %ld crossings of breakpoint %d.\n"
+msgstr ""
+
+#: debug.c:3185
+#, c-format
+msgid "'finish' not meaningful in the outermost frame main()\n"
+msgstr ""
+
+#: debug.c:3190
+#, c-format
+msgid "Run till return from "
+msgstr ""
+
+#: debug.c:3233
+#, c-format
+msgid "'return' not meaningful in the outermost frame main()\n"
+msgstr ""
+
+#: debug.c:3347
+#, c-format
+msgid "Can't find specified location in function `%s'\n"
+msgstr ""
+
+#: debug.c:3355
+#, fuzzy, c-format
+msgid "invalid source line %d in file `%s'"
+msgstr "allerede inkluderet kildefil '%s'"
+
+#: debug.c:3370
+#, c-format
+msgid "Can't find specified location %d in file `%s'\n"
+msgstr ""
+
+#: debug.c:3402
+#, fuzzy, c-format
+msgid "element not in array\n"
+msgstr "delete: indeks '%s' findes ikke i array '%s'"
+
+#: debug.c:3402
+#, c-format
+msgid "untyped variable\n"
+msgstr ""
+
+#: debug.c:3444
+#, c-format
+msgid "Stopping in %s ...\n"
+msgstr ""
+
+#: debug.c:3521
+#, c-format
+msgid "'finish' not meaningful with non-local jump '%s'\n"
+msgstr ""
+
+#: debug.c:3528
+#, c-format
+msgid "'until' not meaningful with non-local jump '%s'\n"
+msgstr ""
+
+#: debug.c:4163
+msgid "\t------[Enter] to continue or q [Enter] to quit------"
+msgstr ""
+
+#: debug.c:4164
+msgid "q"
+msgstr ""
+
+#: debug.c:4984
+#, fuzzy, c-format
+msgid "[\"%s\"] not in array `%s'"
+msgstr "delete: indeks '%s' findes ikke i array '%s'"
+
+#: debug.c:5190
+#, c-format
+msgid "sending output to stdout\n"
+msgstr ""
+
+#: debug.c:5230
+msgid "invalid number"
+msgstr ""
+
+#: debug.c:5362
+#, fuzzy, c-format
+msgid "`%s' not allowed in current context; statement ignored"
+msgstr "'exit' kan ikke kaldes i den aktuelle kontekst"
+
+#: debug.c:5370
+#, fuzzy
+msgid "`return' not allowed in current context; statement ignored"
+msgstr "'exit' kan ikke kaldes i den aktuelle kontekst"
+
+#: debug.c:5571
+#, fuzzy, c-format
+msgid "No symbol `%s' in current context"
+msgstr "forsøg på at bruge array '%s' i skalarsammenhæng"
+
+#: dfa.c:984 dfa.c:987 dfa.c:1007 dfa.c:1017 dfa.c:1029 dfa.c:1080 dfa.c:1089
+#: dfa.c:1092 dfa.c:1097 dfa.c:1110 dfa.c:1178
+msgid "unbalanced ["
+msgstr ""
+
+#: dfa.c:1038
+#, fuzzy
+msgid "invalid character class"
+msgstr "Ugyldigt tegnklassenavn"
+
+#: dfa.c:1215
+msgid "character class syntax is [[:space:]], not [:space:]"
+msgstr ""
+
+#: dfa.c:1267
+msgid "unfinished \\ escape"
+msgstr ""
+
+#: dfa.c:1414 regcomp.c:161
+msgid "Invalid content of \\{\\}"
+msgstr "Ugyldigt indhold i \\{\\}"
+
+#: dfa.c:1417 regcomp.c:176
+msgid "Regular expression too big"
+msgstr "Regulært udtryk for stort"
+
+#: dfa.c:1802
+msgid "unbalanced ("
+msgstr ""
+
+#: dfa.c:1929
+msgid "no syntax specified"
+msgstr ""
+
+#: dfa.c:1937
+msgid "unbalanced )"
+msgstr ""
+
+#: eval.c:394
#, c-format
msgid "unknown nodetype %d"
msgstr "ukendt nodetype %d"
-#: eval.c:423 eval.c:437
+#: eval.c:405 eval.c:419
#, c-format
msgid "unknown opcode %d"
msgstr "ukendt opkode %d"
-#: eval.c:434
+#: eval.c:416
#, c-format
msgid "opcode %s not an operator or keyword"
msgstr "opkode %s er ikke en operator eller et nøgleord"
-#: eval.c:488
+#: eval.c:471
msgid "buffer overflow in genflags2str"
msgstr "bufferoverløb i genflags2str"
-#: eval.c:698
+#: eval.c:674
#, c-format
msgid ""
"\n"
@@ -985,303 +1833,530 @@ msgstr ""
"\t# Funktionskaldsstak:\n"
"\n"
-#: eval.c:725
+#: eval.c:703
msgid "`IGNORECASE' is a gawk extension"
msgstr "'IGNORECASE' er en gawk-udvidelse"
-#: eval.c:754
+#: eval.c:735
msgid "`BINMODE' is a gawk extension"
msgstr "'BINMODE' er en gawk-udvidelse"
-#: eval.c:812
+#: eval.c:792
#, c-format
msgid "BINMODE value `%s' is invalid, treated as 3"
msgstr "BINMODE værdi '%s' er ugyldig, behandles som 3"
-#: eval.c:902
+#: eval.c:884
#, c-format
msgid "bad `%sFMT' specification `%s'"
msgstr "forkert '%sFMT'-specifikation '%s'"
-#: eval.c:980
+#: eval.c:968
msgid "turning off `--lint' due to assignment to `LINT'"
msgstr "deaktiverer '--lint' på grund af en tildeling til 'LINT'"
-#: eval.c:1127 eval.c:1777
-#, c-format
-msgid "can't use function name `%s' as variable or array"
-msgstr "kan ikke bruge funktionsnavnet '%s' som variabel eller array"
-
-#: eval.c:1158 eval.c:1789 eval.c:1802
+#: eval.c:1144
#, c-format
msgid "reference to uninitialized argument `%s'"
msgstr "reference til ikke-initieret argument '%s'"
-#: eval.c:1177
+#: eval.c:1145
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "reference til ikke-initieret variabel '%s'"
+
+#: eval.c:1163
msgid "attempt to field reference from non-numeric value"
msgstr "forsøg på at referere til et felt fra ikke-numerisk værdi"
-#: eval.c:1179
+#: eval.c:1165
msgid "attempt to field reference from null string"
msgstr "forsøg på at referere til et felt fra tom streng"
-#: eval.c:1185
+#: eval.c:1173
#, c-format
msgid "attempt to access field %ld"
msgstr "forsøg på at få adgang til felt %ld"
-#: eval.c:1194
+#: eval.c:1182
#, c-format
msgid "reference to uninitialized field `$%ld'"
msgstr "reference til ikke-initieret felt '$%ld'"
-#: eval.c:1256
+#: eval.c:1269
#, c-format
msgid "function `%s' called with more arguments than declared"
msgstr "funktionen '%s' kaldt med flere argumenter end deklareret"
-#: eval.c:1437
+#: eval.c:1464
#, c-format
msgid "unwind_stack: unexpected type `%s'"
msgstr "unwind_stack: uventet type `%s'"
-#: eval.c:1532
+#: eval.c:1558
msgid "division by zero attempted in `/='"
msgstr "forsøgte at dividere med nul i '/='"
-#: eval.c:1539
+#: eval.c:1565
#, c-format
msgid "division by zero attempted in `%%='"
msgstr "forsøgte at dividere med nul i '%%='"
-#: eval.c:1876 eval.c:2122
-#, c-format
-msgid "attempt to use array `%s[\"%.*s\"]' in a scalar context"
-msgstr "forsøg på at bruge array '%s[\"%.*s\"]' i skalarsammenhæng"
-
-#: eval.c:1907
-msgid "assignment used in conditional context"
-msgstr "tildeling brugt i sammenligningsammenhæng"
-
-#: eval.c:1911
-msgid "statement has no effect"
-msgstr "kommandoen har ingen effekt"
-
-#: eval.c:2343
-#, c-format
-msgid "for loop: array `%s' changed size from %ld to %ld during loop execution"
-msgstr ""
-"for-løkke: array '%s' ændrede størrelse fra %ld til %ld under udførelse af "
-"løkken"
-
-#: eval.c:2458
-#, c-format
-msgid "function called indirectly through `%s' does not exist"
-msgstr "funktion kaldt indirekte via '%s' eksisterer ikke"
-
-#: eval.c:2470
-#, c-format
-msgid "function `%s' not defined"
-msgstr "funktionen '%s' er ikke defineret"
-
-#: eval.c:2511
-#, c-format
-msgid "non-redirected `getline' invalid inside `%s' rule"
-msgstr "ikke-omdirigeret 'getline' ugyldig inden i '%s'-regel"
-
-#: eval.c:2600
-#, c-format
-msgid "error reading input file `%s': %s"
-msgstr "fejl ved læsning af inddatafilen '%s': %s"
-
-#: eval.c:2614
-#, c-format
-msgid "`nextfile' cannot be called from a `%s' rule"
-msgstr "'nextfile' kan ikke kaldes fra en '%s'-regel"
-
-#: eval.c:2661
-msgid "`exit' cannot be called in the current context"
-msgstr "'exit' kan ikke kaldes i den aktuelle kontekst"
-
-#: eval.c:2700
-#, c-format
-msgid "`next' cannot be called from a `%s' rule"
-msgstr "'next' kan ikke kaldes fra en '%s'-regel"
-
-#: eval.c:2766
-#, c-format
-msgid "Sorry, don't know how to interpret `%s'"
-msgstr "Véd desværre ikke hvordan '%s' skal fortolkes"
-
-#: ext.c:54
+#: ext.c:49
msgid "extensions are not allowed in sandbox mode"
msgstr "udvidelser er ikke tilladt i sandkasse-tilstand"
-#: ext.c:60 ext.c:65
-msgid "`extension' is a gawk extension"
-msgstr "'extension' er en gawk-udvidelse"
+#: ext.c:52
+#, fuzzy
+msgid "-l / @load are gawk extensions"
+msgstr "@include er en gawk-udvidelse"
+
+#: ext.c:55
+msgid "load_ext: received NULL lib_name"
+msgstr ""
-#: ext.c:75
-#, c-format
-msgid "fatal: extension: cannot open `%s' (%s)\n"
+#: ext.c:58
+#, fuzzy, c-format
+msgid "load_ext: cannot open library `%s' (%s)\n"
msgstr "atalt: extension: kan ikke åbne '%s' (%s)\n"
-#: ext.c:84
-#, c-format
+#: ext.c:64
+#, fuzzy, c-format
msgid ""
-"fatal: extension: library `%s': does not define "
-"`plugin_is_GPL_compatible' (%s)\n"
+"load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n"
msgstr ""
"fatalt: extension: bibliotek '%s': definer ikke "
"'plugin_is_GPL_compatible' (%s)\n"
-#: ext.c:93
-#, c-format
-msgid "fatal: extension: library `%s': cannot call function `%s' (%s)\n"
+#: ext.c:70
+#, fuzzy, c-format
+msgid "load_ext: library `%s': cannot call function `%s' (%s)\n"
msgstr ""
"fatalt: extension: bibliotek '%s': kan ikke kalde funktionen '%s' (%s)\n"
-#: ext.c:127
-msgid "extension: missing function name"
+#: ext.c:74
+#, c-format
+msgid "load_ext: library `%s' initialization routine `%s' failed\n"
+msgstr ""
+
+#: ext.c:93
+#, fuzzy
+msgid "make_builtin: missing function name"
msgstr "extension: mangler funktionsnavn"
-#: ext.c:132
-#, c-format
-msgid "extension: illegal character `%c' in function name `%s'"
+#: ext.c:98
+#, fuzzy, c-format
+msgid "make_builtin: illegal character `%c' in function name `%s'"
msgstr "extension: ugyldigt tegn '%c' i funktionsnavn '%s'"
-#: ext.c:141
-#, c-format
-msgid "extension: can't redefine function `%s'"
+#: ext.c:106
+#, fuzzy, c-format
+msgid "make_builtin: can't redefine function `%s'"
msgstr "extension: kan ikke omdefinere funktion '%s'"
-#: ext.c:145
-#, c-format
-msgid "extension: function `%s' already defined"
+#: ext.c:110
+#, fuzzy, c-format
+msgid "make_builtin: function `%s' already defined"
msgstr "extension: funktionen '%s' er allerede defineret"
-#: ext.c:150
-#, c-format
-msgid "extension: function name `%s' previously defined"
+#: ext.c:114
+#, fuzzy, c-format
+msgid "make_builtin: function name `%s' previously defined"
msgstr "extension: funktionsnavnet '%s' er defineret tidligere"
-#: ext.c:152
-#, c-format
-msgid "extension: can't use gawk built-in `%s' as function name"
+#: ext.c:116
+#, fuzzy, c-format
+msgid "make_builtin: can't use gawk built-in `%s' as function name"
msgstr "extension: kan ikke bruge gawk's indbyggede '%s' som funktionsnavn"
-#: ext.c:156
+#: ext.c:119
#, c-format
msgid "make_builtin: negative argument count for function `%s'"
msgstr "make_builtin: negativt argumentantal for funktion '%s'"
-#: ext.c:259
+#: ext.c:183
#, c-format
msgid "function `%s' defined to take no more than %d argument(s)"
msgstr "funktionen '%s' defineret til at tage ikke mere end %d argumenter"
-#: ext.c:262
+#: ext.c:186
#, c-format
msgid "function `%s': missing argument #%d"
msgstr "funktion '%s': mangler argument nummer %d"
-#: ext.c:279
+#: ext.c:203
#, c-format
msgid "function `%s': argument #%d: attempt to use scalar as an array"
msgstr ""
"funktion '%s': argument nummer %d: forsøg på at bruge skalar som et array"
-#: ext.c:283
+#: ext.c:207
#, c-format
msgid "function `%s': argument #%d: attempt to use array as a scalar"
msgstr ""
"funktion '%s': argument nummer %d: forsøg på at bruge array som en skalar"
-#: ext.c:296
-msgid "Operation Not Supported"
-msgstr "Operationen understøttes ikke"
+#: ext.c:221
+msgid "dynamic loading of library not supported"
+msgstr ""
+
+#: extension/filefuncs.c:75
+#, fuzzy
+msgid "chdir: called with incorrect number of arguments, expecting 1"
+msgstr "sqrt: kaldt med negativt argument %g"
+
+#: extension/filefuncs.c:348
+#, fuzzy
+msgid "stat: called with wrong number of arguments"
+msgstr "sqrt: kaldt med negativt argument %g"
+
+#: extension/filefuncs.c:355
+#, fuzzy
+msgid "stat: bad parameters"
+msgstr "%s: er parameter\n"
+
+#: extension/filefuncs.c:421
+msgid "fill_stat_element: could not create array"
+msgstr ""
+
+#: extension/filefuncs.c:430
+msgid "fill_stat_element: could not set element"
+msgstr ""
+
+#: extension/filefuncs.c:445
+#, fuzzy
+msgid "fill_path_element: could not set element"
+msgstr "indeks: andet argument er ikke en streng"
+
+#: extension/filefuncs.c:461
+msgid "fill_error_element: could not set element"
+msgstr ""
+
+#: extension/filefuncs.c:508 extension/filefuncs.c:555
+msgid "fts-process: could not create array"
+msgstr ""
+
+#: extension/filefuncs.c:518 extension/filefuncs.c:565
+#: extension/filefuncs.c:583
+#, fuzzy
+msgid "fts-process: could not set element"
+msgstr "indeks: andet argument er ikke en streng"
+
+#: extension/filefuncs.c:632
+#, fuzzy
+msgid "fts: called with incorrect number of arguments, expecting 3"
+msgstr "sqrt: kaldt med negativt argument %g"
+
+#: extension/filefuncs.c:635
+#, fuzzy
+msgid "fts: bad first parameter"
+msgstr "%s: er parameter\n"
+
+#: extension/filefuncs.c:641
+#, fuzzy
+msgid "fts: bad second parameter"
+msgstr "%s: er parameter\n"
+
+#: extension/filefuncs.c:647
+#, fuzzy
+msgid "fts: bad third parameter"
+msgstr "%s: er parameter\n"
+
+#: extension/filefuncs.c:654
+#, fuzzy
+msgid "fts: could not flatten array\n"
+msgstr "'%s' er ikke et gyldigt variabelnavn"
+
+#: extension/filefuncs.c:672
+msgid "fts: ignoring sneaky FTS_NOSTAT flag. nyah, nyah, nyah."
+msgstr ""
-#: field.c:328
+#: extension/filefuncs.c:689
+msgid "fts: clear_array failed\n"
+msgstr ""
+
+#: extension/fnmatch.c:91
+#, fuzzy
+msgid "fnmatch: called with less than three arguments"
+msgstr "sqrt: kaldt med negativt argument %g"
+
+#: extension/fnmatch.c:94
+#, fuzzy
+msgid "fnmatch: called with more than three arguments"
+msgstr "sqrt: kaldt med negativt argument %g"
+
+#: extension/fnmatch.c:97
+#, fuzzy
+msgid "fnmatch: could not get first argument"
+msgstr "strftime: fik et første argument som ikke er en streng"
+
+#: extension/fnmatch.c:102
+#, fuzzy
+msgid "fnmatch: could not get second argument"
+msgstr "indeks: andet argument er ikke en streng"
+
+#: extension/fnmatch.c:107
+msgid "fnmatch: could not get third argument"
+msgstr ""
+
+#: extension/fnmatch.c:120
+msgid "fnmatch is not implemented on this system\n"
+msgstr ""
+
+#: extension/fnmatch.c:152
+msgid "fnmatch init: could not add FNM_NOMATCH variable"
+msgstr ""
+
+#: extension/fnmatch.c:162
+#, c-format
+msgid "fnmatch init: could not set array element %s"
+msgstr ""
+
+#: extension/fnmatch.c:172
+msgid "fnmatch init: could not install FNM array"
+msgstr ""
+
+#: extension/fork.c:81
+#, fuzzy
+msgid "fork: called with too many arguments"
+msgstr "sqrt: kaldt med negativt argument %g"
+
+#: extension/fork.c:94
+msgid "fork: PROCINFO is not an array!"
+msgstr ""
+
+#: extension/fork.c:118
+#, fuzzy
+msgid "waitpid: called with too many arguments"
+msgstr "sqrt: kaldt med negativt argument %g"
+
+#: extension/fork.c:126
+#, fuzzy
+msgid "wait: called with no arguments"
+msgstr "sqrt: kaldt med negativt argument %g"
+
+#: extension/fork.c:143
+#, fuzzy
+msgid "wait: called with too many arguments"
+msgstr "sqrt: kaldt med negativt argument %g"
+
+#: extension/ordchr.c:69
+#, fuzzy
+msgid "ord: called with too many arguments"
+msgstr "sqrt: kaldt med negativt argument %g"
+
+#: extension/ordchr.c:75
+#, fuzzy
+msgid "ord: called with no arguments"
+msgstr "sqrt: kaldt med negativt argument %g"
+
+#: extension/ordchr.c:77
+#, fuzzy
+msgid "ord: called with inappropriate argument(s)"
+msgstr "sqrt: kaldt med negativt argument %g"
+
+#: extension/ordchr.c:99
+#, fuzzy
+msgid "chr: called with too many arguments"
+msgstr "sqrt: kaldt med negativt argument %g"
+
+#: extension/ordchr.c:109
+#, fuzzy
+msgid "chr: called with no arguments"
+msgstr "sqrt: kaldt med negativt argument %g"
+
+#: extension/ordchr.c:111
+#, fuzzy
+msgid "chr: called with inappropriate argument(s)"
+msgstr "sqrt: kaldt med negativt argument %g"
+
+#: extension/readfile.c:81
+#, fuzzy
+msgid "readfile: called with too many arguments"
+msgstr "sqrt: kaldt med negativt argument %g"
+
+#: extension/readfile.c:114
+#, fuzzy
+msgid "readfile: called with no arguments"
+msgstr "sqrt: kaldt med negativt argument %g"
+
+#: extension/rwarray.c:120
+#, fuzzy
+msgid "writea: called with too many arguments"
+msgstr "sqrt: kaldt med negativt argument %g"
+
+#: extension/rwarray.c:127
+#, fuzzy, c-format
+msgid "do_writea: argument 0 is not a string\n"
+msgstr "exp: argumentet %g er uden for det tilladte område"
+
+#: extension/rwarray.c:133
+#, fuzzy, c-format
+msgid "do_writea: argument 1 is not an array\n"
+msgstr "split: fjerde argument er ikke et array"
+
+#: extension/rwarray.c:180
+#, c-format
+msgid "write_array: could not flatten array\n"
+msgstr ""
+
+#: extension/rwarray.c:194
+#, c-format
+msgid "write_array: could not release flattened array\n"
+msgstr ""
+
+#: extension/rwarray.c:276
+#, fuzzy
+msgid "reada: called with too many arguments"
+msgstr "sqrt: kaldt med negativt argument %g"
+
+#: extension/rwarray.c:283
+#, fuzzy, c-format
+msgid "do_reada: argument 0 is not a string\n"
+msgstr "exp: argumentet %g er uden for det tilladte område"
+
+#: extension/rwarray.c:289
+#, fuzzy, c-format
+msgid "do_reada: argument 1 is not an array\n"
+msgstr "match: tredje argument er ikke et array"
+
+#: extension/rwarray.c:333
+#, c-format
+msgid "do_reada: clear_array failed\n"
+msgstr ""
+
+#: extension/rwarray.c:370
+#, c-format
+msgid "read_array: set_array_element failed\n"
+msgstr ""
+
+#: extension/time.c:78
+#, fuzzy
+msgid "gettimeofday: ignoring arguments"
+msgstr "mktime: fik et argument som ikke er en streng"
+
+#: extension/time.c:109
+msgid "gettimeofday: not supported on this platform"
+msgstr ""
+
+#: extension/time.c:130
+#, fuzzy
+msgid "sleep: called with too many arguments"
+msgstr "sqrt: kaldt med negativt argument %g"
+
+#: extension/time.c:133
+#, fuzzy
+msgid "sleep: missing required numeric argument"
+msgstr "exp: fik et ikke-numerisk argument"
+
+#: extension/time.c:139
+#, fuzzy
+msgid "sleep: argument is negative"
+msgstr "exp: argumentet %g er uden for det tilladte område"
+
+#: extension/time.c:166
+msgid "sleep: not supported on this platform"
+msgstr ""
+
+#: field.c:339
msgid "NF set to negative value"
msgstr "NF sat til en negativ værdi"
-#: field.c:951 field.c:958 field.c:962
+#: field.c:962 field.c:969 field.c:973
msgid "split: fourth argument is a gawk extension"
msgstr "split: fjerde argument er en gawk-udvidelse"
-#: field.c:955
+#: field.c:966
msgid "split: fourth argument is not an array"
msgstr "split: fjerde argument er ikke et array"
-#: field.c:969
+#: field.c:980
msgid "split: second argument is not an array"
msgstr "split: andet argument er ikke et array"
-#: field.c:973
+#: field.c:984
msgid "split: cannot use the same array for second and fourth args"
msgstr "split: kan ikke bruge det samme array som andet og fjerde argument"
-#: field.c:978
+#: field.c:989
msgid "split: cannot use a subarray of second arg for fourth arg"
msgstr ""
"split: kan ikke bruge et underarray af andet argument som fjerde argument"
-#: field.c:981
+#: field.c:992
msgid "split: cannot use a subarray of fourth arg for second arg"
msgstr ""
"split: kan ikke bruge et underarray af fjerde argument som andet argument"
-#: field.c:1010
+#: field.c:1021
msgid "split: null string for third arg is a gawk extension"
msgstr "split: tom streng som tredje argument er en gawk-udvidelse"
-#: field.c:1050
+#: field.c:1061
msgid "patsplit: fourth argument is not an array"
msgstr "patsplit: fjerde argument er ikke et array"
-#: field.c:1055
+#: field.c:1066
msgid "patsplit: second argument is not an array"
msgstr "patsplit: andet argument er ikke et array"
-#: field.c:1061
+#: field.c:1072
msgid "patsplit: third argument must be non-null"
msgstr "patmatch: tredje argument er ikke et array"
-#: field.c:1065
+#: field.c:1076
msgid "patsplit: cannot use the same array for second and fourth args"
msgstr "patsplit: kan ikke bruge det samme array som andet og fjerde argument"
-#: field.c:1070
+#: field.c:1081
msgid "patsplit: cannot use a subarray of second arg for fourth arg"
msgstr ""
"patsplit: kan ikke bruge et underarray af andet argument som fjerde argument"
-#: field.c:1073
+#: field.c:1084
msgid "patsplit: cannot use a subarray of fourth arg for second arg"
msgstr ""
"patsplit: kan ikke bruge et underarray af fjerde argument som andet argument"
-#: field.c:1110
+#: field.c:1122
msgid "`FIELDWIDTHS' is a gawk extension"
msgstr "'FIELDWIDTHS' er en gawk-udvidelse"
-#: field.c:1173
+#: field.c:1186
#, c-format
msgid "invalid FIELDWIDTHS value, near `%s'"
msgstr "ugyldig FIELDWIDTHS værdi, nær '%s"
-#: field.c:1246
+#: field.c:1259
msgid "null string for `FS' is a gawk extension"
msgstr "tom streng som 'FS' er en gawk-udvidelse"
-#: field.c:1250
+#: field.c:1263
msgid "old awk does not support regexps as value of `FS'"
msgstr "gamle versioner af awk understøtter ikke regexp'er som værdi for 'FS'"
-#: field.c:1369
+#: field.c:1382
msgid "`FPAT' is a gawk extension"
msgstr "'FPAT' er en gawk-udvidelse"
+#: gawkapi.c:143
+msgid "awk_value_to_node: received null retval"
+msgstr ""
+
+#: gawkapi.c:932
+#, c-format
+msgid "api_flatten_array: could not convert index %d\n"
+msgstr ""
+
+#: gawkapi.c:937
+#, c-format
+msgid "api_flatten_array: could not convert value %d\n"
+msgstr ""
+
+#: gawkapi.c:1111
+msgid "cannot assign to defined constant"
+msgstr ""
+
#: getopt.c:604 getopt.c:633
#, fuzzy, c-format
msgid "%s: option '%s' is ambiguous; possibilities:"
@@ -1337,460 +2412,524 @@ msgstr "%s: flaget '-W %s' tillader ikke noget argument\n"
msgid "%s: option '-W %s' requires an argument\n"
msgstr "%s: flaget '-W %s' kræver et argument\n"
-#: io.c:280
+#: io.c:339
#, c-format
msgid "command line argument `%s' is a directory: skipped"
msgstr "kommandolinjeargument '%s' er et katalog, oversprunget"
-#: io.c:283 io.c:385
+#: io.c:342 io.c:455
#, c-format
msgid "cannot open file `%s' for reading (%s)"
msgstr "kan ikke åbne filen '%s' for læsning (%s)"
-#: io.c:501
+#: io.c:582
#, c-format
msgid "close of fd %d (`%s') failed (%s)"
msgstr "lukning af fd %d ('%s') mislykkedes (%s)"
-#: io.c:578
+#: io.c:658
msgid "redirection not allowed in sandbox mode"
msgstr "omdirigering ikke tilladt i sandkasse-tilstand"
-#: io.c:612
+#: io.c:692
#, c-format
msgid "expression in `%s' redirection only has numeric value"
msgstr "udtrykket i '%s'-omdirigering har kun numerisk værdi"
-#: io.c:618
+#: io.c:698
#, c-format
msgid "expression for `%s' redirection has null string value"
msgstr "udtrykket for '%s'-omdirigering har en tom streng som værdi"
-#: io.c:623
+#: io.c:703
#, c-format
msgid "filename `%s' for `%s' redirection may be result of logical expression"
msgstr ""
"filnavnet '%s' for '%s'-omdirigering kan være resultatet af et logisk udtryk"
-#: io.c:666
+#: io.c:746
#, c-format
msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
msgstr "unødig blanding af '>' og '>>' for filen '%.*s'"
-#: io.c:719
+#: io.c:799
#, c-format
msgid "can't open pipe `%s' for output (%s)"
msgstr "kan ikke åbne datakanalen '%s' for udskrivning (%s)"
-#: io.c:729
+#: io.c:809
#, c-format
msgid "can't open pipe `%s' for input (%s)"
msgstr "kan ikke åbne datakanalen '%s' for indtastning (%s)"
-#: io.c:752
+#: io.c:840
#, c-format
msgid "can't open two way pipe `%s' for input/output (%s)"
msgstr "kan ikke åbne tovejsdatakanalen '%s' for ind-/uddata (%s)"
-#: io.c:834
+#: io.c:923
#, c-format
msgid "can't redirect from `%s' (%s)"
msgstr "kan ikke omdirigere fra '%s' (%s)"
-#: io.c:837
+#: io.c:926
#, c-format
msgid "can't redirect to `%s' (%s)"
msgstr "kan ikke omdirigere til '%s' (%s)"
-#: io.c:888
+#: io.c:977
msgid ""
"reached system limit for open files: starting to multiplex file descriptors"
msgstr ""
"nåede systembegrænsningen for åbne filer: begynder at multiplekse "
"fildeskriptorer"
-#: io.c:904
+#: io.c:993
#, c-format
msgid "close of `%s' failed (%s)."
msgstr "lukning af '%s' mislykkedes (%s)."
-#: io.c:912
+#: io.c:1001
msgid "too many pipes or input files open"
msgstr "for mange datakanaler eller inddatafiler åbne"
-#: io.c:934
+#: io.c:1023
msgid "close: second argument must be `to' or `from'"
msgstr "close: andet argument skal være 'to' eller 'from'"
-#: io.c:951
+#: io.c:1040
#, c-format
msgid "close: `%.*s' is not an open file, pipe or co-process"
msgstr "close: '%.*s' er ikke en åben fil, datakanal eller ko-proces"
-#: io.c:956
+#: io.c:1045
msgid "close of redirection that was never opened"
msgstr "lukning af omdirigering som aldrig blev åbnet"
-#: io.c:1053
+#: io.c:1142
#, c-format
msgid "close: redirection `%s' not opened with `|&', second argument ignored"
msgstr ""
"close: omdirigeringen '%s' blev ikke åbnet med '|&', andet argument ignoreret"
-#: io.c:1069
+#: io.c:1159
#, c-format
msgid "failure status (%d) on pipe close of `%s' (%s)"
msgstr "fejlstatus (%d) fra lukning af datakanalen '%s' (%s)"
-#: io.c:1072
+#: io.c:1162
#, c-format
msgid "failure status (%d) on file close of `%s' (%s)"
msgstr "fejlstatus (%d) fra fillukning af '%s' (%s)"
-#: io.c:1092
+#: io.c:1182
#, c-format
msgid "no explicit close of socket `%s' provided"
msgstr "ingen eksplicit lukning af soklen '%s' angivet"
-#: io.c:1095
+#: io.c:1185
#, c-format
msgid "no explicit close of co-process `%s' provided"
msgstr "ingen eksplicit lukning af ko-processen '%s' angivet"
-#: io.c:1098
+#: io.c:1188
#, c-format
msgid "no explicit close of pipe `%s' provided"
msgstr "ingen eksplicit lukning af datakanalen '%s' angivet"
-#: io.c:1101
+#: io.c:1191
#, c-format
msgid "no explicit close of file `%s' provided"
msgstr "ingen eksplicit lukning af filen '%s' angivet"
-#: io.c:1129 io.c:1184 main.c:797 main.c:834
+#: io.c:1219 io.c:1274 main.c:847 main.c:884
#, c-format
msgid "error writing standard output (%s)"
msgstr "fejl ved skrivning til standard ud (%s)"
-#: io.c:1133 io.c:1189
+#: io.c:1223 io.c:1279
#, c-format
msgid "error writing standard error (%s)"
msgstr "fejl ved skrivning til standard fejl (%s)"
-#: io.c:1141
+#: io.c:1231
#, c-format
msgid "pipe flush of `%s' failed (%s)."
msgstr "datakanalsrensning af '%s' mislykkedes (%s)."
-#: io.c:1144
+#: io.c:1234
#, c-format
msgid "co-process flush of pipe to `%s' failed (%s)."
msgstr "ko-procesrensning af datakanalen til '%s' mislykkedes (%s)."
-#: io.c:1147
+#: io.c:1237
#, c-format
msgid "file flush of `%s' failed (%s)."
msgstr "filrensning af '%s' mislykkedes (%s)."
-#: io.c:1262
+#: io.c:1351
#, c-format
msgid "local port %s invalid in `/inet'"
msgstr "lokal port %s ugyldig i '/inet'"
-#: io.c:1279
+#: io.c:1369
#, c-format
msgid "remote host and port information (%s, %s) invalid"
msgstr "fjernvært og portinformation (%s, %s) ugyldige"
-#: io.c:1431
+#: io.c:1521
#, c-format
msgid "no (known) protocol supplied in special filename `%s'"
msgstr "ingen (kendt) protokol opgivet i special-filnavn '%s'"
-#: io.c:1445
+#: io.c:1535
#, c-format
msgid "special file name `%s' is incomplete"
msgstr "special-filnavn '%s' er ufuldstændigt"
-#: io.c:1462
+#: io.c:1552
msgid "must supply a remote hostname to `/inet'"
msgstr "fjernmaskinenavn til '/inet' skal angives"
-#: io.c:1480
+#: io.c:1570
msgid "must supply a remote port to `/inet'"
msgstr "fjernport til '/inet' skal angives"
-#: io.c:1526
+#: io.c:1616
msgid "TCP/IP communications are not supported"
msgstr "TCP/IP-kommunikation understøttes ikke"
-#: io.c:1693
+#: io.c:1785
#, c-format
msgid "could not open `%s', mode `%s'"
msgstr "kunne ikke åbne '%s', tilstand '%s'"
-#: io.c:1747
+#: io.c:1835
#, c-format
msgid "close of master pty failed (%s)"
msgstr "lukning af master-pty mislykkedes (%s)"
-#: io.c:1749 io.c:1917 io.c:2074
+#: io.c:1837 io.c:2012 io.c:2181
#, c-format
msgid "close of stdout in child failed (%s)"
msgstr "lukning af standard ud i underproces mislykkedes (%s)"
-#: io.c:1752
+#: io.c:1840
#, c-format
msgid "moving slave pty to stdout in child failed (dup: %s)"
msgstr ""
"flytning af slave-pty til standard ud i underproces mislykkedes (dup: %s)"
-#: io.c:1754 io.c:1922
+#: io.c:1842 io.c:2017
#, c-format
msgid "close of stdin in child failed (%s)"
msgstr "lukning af standard ind i underproces mislykkedes (%s)"
-#: io.c:1757
+#: io.c:1845
#, c-format
msgid "moving slave pty to stdin in child failed (dup: %s)"
msgstr ""
"flytning af slave-pty til standard ind i underproces mislykkedes (dup: %s)"
-#: io.c:1759 io.c:1780
+#: io.c:1847 io.c:1868
#, c-format
msgid "close of slave pty failed (%s)"
msgstr "lukning af slave-pty mislykkedes (%s)"
-#: io.c:1858 io.c:1920 io.c:2052 io.c:2077
+#: io.c:1953 io.c:2015 io.c:2158 io.c:2184
#, c-format
msgid "moving pipe to stdout in child failed (dup: %s)"
msgstr ""
"flytning af datakanal til standard ud i underproces mislykkedes (dup: %s)"
-#: io.c:1865 io.c:1925
+#: io.c:1960 io.c:2020
#, c-format
msgid "moving pipe to stdin in child failed (dup: %s)"
msgstr ""
"flytning af datakanalen til standard ind i underproces mislykkedes (dup: %s)"
-#: io.c:1885 io.c:2067
+#: io.c:1980 io.c:2174
msgid "restoring stdout in parent process failed\n"
msgstr "genskabelse af standard ud i forælderprocessen mislykkedes\n"
-#: io.c:1893
+#: io.c:1988
msgid "restoring stdin in parent process failed\n"
msgstr "genskabelse af standard ind i forælderprocessen mislykkedes\n"
-#: io.c:1928 io.c:2079 io.c:2093
+#: io.c:2023 io.c:2186 io.c:2200
#, c-format
msgid "close of pipe failed (%s)"
msgstr "lukning af datakanalen mislykkedes (%s)"
-#: io.c:1973
+#: io.c:2076
msgid "`|&' not supported"
msgstr "'|&' understøttes ikke"
-#: io.c:2039
+#: io.c:2143
#, c-format
msgid "cannot open pipe `%s' (%s)"
msgstr "kan ikke åbne datakanalen '%s' (%s)"
-#: io.c:2087
+#: io.c:2194
#, c-format
msgid "cannot create child process for `%s' (fork: %s)"
msgstr "kan ikke oprette barneproces for '%s' (fork: %s)"
-#: io.c:2520
+#: io.c:2652
+msgid "register_input_parser: received NULL pointer"
+msgstr ""
+
+#: io.c:2680
+#, c-format
+msgid "input parser `%s' conflicts with previously installed input parser `%s'"
+msgstr ""
+
+#: io.c:2687
+#, c-format
+msgid "input parser `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2707
+msgid "register_output_wrapper: received NULL pointer"
+msgstr ""
+
+#: io.c:2735
+#, c-format
+msgid ""
+"output wrapper `%s' conflicts with previously installed output wrapper `%s'"
+msgstr ""
+
+#: io.c:2742
+#, c-format
+msgid "output wrapper `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2763
+msgid "register_output_processor: received NULL pointer"
+msgstr ""
+
+#: io.c:2792
+#, c-format
+msgid ""
+"two-way processor `%s' conflicts with previously installed two-way processor "
+"`%s'"
+msgstr ""
+
+#: io.c:2801
+#, c-format
+msgid "two way processor `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2908
#, c-format
msgid "data file `%s' is empty"
msgstr "datafilen '%s' er tom"
-#: io.c:2561 io.c:2569
+#: io.c:2950 io.c:2958
msgid "could not allocate more input memory"
msgstr "kunne ikke allokere mere hukommelse til inddata"
-#: io.c:3127
+#: io.c:3524
msgid "multicharacter value of `RS' is a gawk extension"
msgstr "'RS' som flertegnsværdi er en gawk-udvidelse"
-#: io.c:3232
+#: io.c:3613
msgid "IPv6 communication is not supported"
msgstr "IPv6-kommunikation understøttes ikke"
-#: main.c:366
+#: main.c:362
msgid "`-m[fr]' option irrelevant in gawk"
msgstr "'-m[fr]'-flaget er irrelevant i gawk"
-#: main.c:368
+#: main.c:364
msgid "-m option usage: `-m[fr] nnn'"
msgstr "brug af flaget -m: '-m[fr] nnn'"
-#: main.c:391
+#: main.c:393
msgid "empty argument to `-e/--source' ignored"
msgstr "tomt argument til '-e/--source' ignoreret"
-#: main.c:462
+#: main.c:483
#, c-format
msgid "%s: option `-W %s' unrecognized, ignored\n"
msgstr "%s: flaget '-W %s' ukendt, ignoreret\n"
-#: main.c:515
+#: main.c:529
#, c-format
msgid "%s: option requires an argument -- %c\n"
msgstr "%s: flaget kræver et argument -- %c\n"
-#: main.c:536
+#: main.c:550
msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
msgstr "miljøvariablen 'POSIXLY_CORRECT' sat: aktiverer '--posix'"
-#: main.c:542
+#: main.c:556
msgid "`--posix' overrides `--traditional'"
msgstr "'--posix' tilsidesætter '--traditional'"
-#: main.c:553
+#: main.c:567
msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
msgstr "'--posix'/'--traditional' tilsidesætter '--non-decimal-data'"
-#: main.c:557
+#: main.c:571
#, c-format
msgid "running %s setuid root may be a security problem"
msgstr "at køre %s setuid root kan være et sikkerhedsproblem"
-#: main.c:562
+#: main.c:576
#, fuzzy
msgid "`--posix' overrides `--characters-as-bytes'"
msgstr "'--posix' tilsidesætter '--binary'"
-#: main.c:616
+#: main.c:635
#, c-format
msgid "can't set binary mode on stdin (%s)"
msgstr "kan ikke sætte binær tilstand på standard ind (%s)"
-#: main.c:619
+#: main.c:638
#, c-format
msgid "can't set binary mode on stdout (%s)"
msgstr "kan ikke sætte binær tilstand på standard ud (%s)"
-#: main.c:621
+#: main.c:640
#, c-format
msgid "can't set binary mode on stderr (%s)"
msgstr "kan ikke sætte binær tilstand på standard fejl (%s)"
-#: main.c:660
+#: main.c:698
msgid "no program text at all!"
msgstr "ingen programtekst overhovedet!"
-#: main.c:737
+#: main.c:784
#, c-format
msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"
msgstr "Brug: %s [flag i POSIX- eller GNU-stil] -f progfil [--] fil ...\n"
-#: main.c:739
+#: main.c:786
#, c-format
msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"
msgstr "Brug: %s [flag i POSIX- eller GNU-stil] %cprogram%c fil ...\n"
-#: main.c:744
+#: main.c:791
msgid "POSIX options:\t\tGNU long options: (standard)\n"
msgstr "POSIX-flag:\t\tlange GNU-flag: (standard)\n"
-#: main.c:745
+#: main.c:792
msgid "\t-f progfile\t\t--file=progfile\n"
msgstr "\t-f progfil\t\t--file=progfil\n"
-#: main.c:746
+#: main.c:793
msgid "\t-F fs\t\t\t--field-separator=fs\n"
msgstr "\t-F fs\t\t\t--field-separator=fs\n"
-#: main.c:747
+#: main.c:794
msgid "\t-v var=val\t\t--assign=var=val\n"
msgstr "\t-v var=værdi\t\t--assign=var=værdi\n"
-#: main.c:748
+#: main.c:795
msgid "Short options:\t\tGNU long options: (extensions)\n"
msgstr "POSIX-flag:\t\tlange GNU-flag: (udvidelser)\n"
-#: main.c:749
+#: main.c:796
msgid "\t-b\t\t\t--characters-as-bytes\n"
msgstr "\t-b\t\t\t--characters-as-bytes\n"
-#: main.c:750
+#: main.c:797
msgid "\t-c\t\t\t--traditional\n"
msgstr "\t-c\t\t\t--traditional\n"
-#: main.c:751
+#: main.c:798
msgid "\t-C\t\t\t--copyright\n"
msgstr "\t-C\t\t\t--copyright\n"
-#: main.c:752
+#: main.c:799
msgid "\t-d[file]\t\t--dump-variables[=file]\n"
msgstr "\t-d[fil]\t\t--dump-variables[=fil]\n"
-#: main.c:753
+#: main.c:800
+#, fuzzy
+msgid "\t-D[file]\t\t--debug[=file]\n"
+msgstr "\t-p[fil]\t\t--profile[=fil]\n"
+
+#: main.c:801
msgid "\t-e 'program-text'\t--source='program-text'\n"
msgstr "\t-e 'programtekst'\t--source='programtekst'\n"
-#: main.c:754
+#: main.c:802
msgid "\t-E file\t\t\t--exec=file\n"
msgstr "\t-E fil\t\t\t--exec=fil\n"
-#: main.c:755
+#: main.c:803
msgid "\t-g\t\t\t--gen-pot\n"
msgstr "\t-g\t\t\t--gen-pot\n"
-#: main.c:756
+#: main.c:804
msgid "\t-h\t\t\t--help\n"
msgstr "\t-h\t\t\t--help\n"
-#: main.c:757
+#: main.c:805
+msgid "\t-i includefile\t\t--include=includefile\n"
+msgstr ""
+
+#: main.c:806
+msgid "\t-l library\t\t--load=library\n"
+msgstr ""
+
+#: main.c:807
msgid "\t-L [fatal]\t\t--lint[=fatal]\n"
msgstr "\t-L [fatal]\t\t--lint[=fatal]\n"
-#: main.c:758
+#: main.c:808
msgid "\t-n\t\t\t--non-decimal-data\n"
msgstr "\t-n\t\t\t--non-decimal-data\n"
-#: main.c:759
+#: main.c:809
+#, fuzzy
+msgid "\t-M\t\t\t--bignum\n"
+msgstr "\t-g\t\t\t--gen-pot\n"
+
+#: main.c:810
msgid "\t-N\t\t\t--use-lc-numeric\n"
msgstr "\t-N\t\t\t--use-lc-numeric\n"
-#: main.c:760
+#: main.c:811
+#, fuzzy
+msgid "\t-o[file]\t\t--pretty-print[=file]\n"
+msgstr "\t-p[fil]\t\t--profile[=fil]\n"
+
+#: main.c:812
msgid "\t-O\t\t\t--optimize\n"
msgstr "\t-O\t\t\t--optimize\n"
-#: main.c:761
+#: main.c:813
msgid "\t-p[file]\t\t--profile[=file]\n"
msgstr "\t-p[fil]\t\t--profile[=fil]\n"
-#: main.c:762
+#: main.c:814
msgid "\t-P\t\t\t--posix\n"
msgstr "\t-P\t\t\t--posix\n"
-#: main.c:763
+#: main.c:815
msgid "\t-r\t\t\t--re-interval\n"
msgstr "\t-r\t\t\t--re-interval\n"
-#: main.c:765
-msgid "\t-R file\t\t\t--command=file\n"
-msgstr "\t-R file\t\t\t--command=fil\n"
-
-#: main.c:766
+#: main.c:816
msgid "\t-S\t\t\t--sandbox\n"
msgstr "\t-S\t\t\t--sandbox\n"
-#: main.c:767
+#: main.c:817
msgid "\t-t\t\t\t--lint-old\n"
msgstr "\t-t\t\t\t--lint-old\n"
-#: main.c:768
+#: main.c:818
msgid "\t-V\t\t\t--version\n"
msgstr "\t-V\t\t\t--version\n"
-#: main.c:770
+#: main.c:820
msgid "\t-W nostalgia\t\t--nostalgia\n"
msgstr "\t-W nostalgia\t\t--nostalgia\n"
-#: main.c:773
+#: main.c:823
msgid "\t-Y\t\t--parsedebug\n"
msgstr "\t-Y\t\t--parsedebug\n"
@@ -1799,7 +2938,7 @@ msgstr "\t-Y\t\t--parsedebug\n"
#. for this application. Please add _another line_ with the
#. address for translation bugs.
#. no-wrap
-#: main.c:782
+#: main.c:832
msgid ""
"\n"
"To report bugs, see node `Bugs' in `gawk.info', which is\n"
@@ -1812,7 +2951,7 @@ msgstr ""
"\n"
"Rapportér kommentarer til oversættelsen til <dansk@dansk-gruppen.dk>.\n"
-#: main.c:786
+#: main.c:836
msgid ""
"gawk is a pattern scanning and processing language.\n"
"By default it reads standard input and writes standard output.\n"
@@ -1822,7 +2961,7 @@ msgstr ""
"Almindeligvis læser gawk fra standard ind og skriver til standard ud.\n"
"\n"
-#: main.c:790
+#: main.c:840
msgid ""
"Examples:\n"
"\tgawk '{ sum += $1 }; END { print sum }' file\n"
@@ -1832,7 +2971,7 @@ msgstr ""
"\tgawk '{ sum += $1 }; END { print sum }' fil\n"
"\tgawk -F: '{ print $1 }' /etc/passwd\n"
-#: main.c:810
+#: main.c:860
#, c-format
msgid ""
"Copyright (C) 1989, 1991-%d Free Software Foundation.\n"
@@ -1852,7 +2991,7 @@ msgstr ""
"enhver senere version.\n"
"\n"
-#: main.c:818
+#: main.c:868
msgid ""
"This program is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
@@ -1866,7 +3005,7 @@ msgstr ""
"General Public License for yderligere information.\n"
"\n"
-#: main.c:824
+#: main.c:874
msgid ""
"You should have received a copy of the GNU General Public License\n"
"along with this program. If not, see http://www.gnu.org/licenses/.\n"
@@ -1874,16 +3013,16 @@ msgstr ""
"Du bør have fået en kopi af GNU General Public License sammen\n"
"med dette program. Hvis ikke, så se http://www.gnu.org/licenses/.\n"
-#: main.c:859
+#: main.c:909
msgid "-Ft does not set FS to tab in POSIX awk"
msgstr "-Ft sætter ikke FS til tab i POSIX-awk"
-#: main.c:1093
+#: main.c:1169
#, c-format
msgid "unknown value for field spec: %d\n"
msgstr "ukendt værdi for felt-spec: %d\n"
-#: main.c:1174
+#: main.c:1267
#, c-format
msgid ""
"%s: `%s' argument to `-v' not in `var=value' form\n"
@@ -1892,79 +3031,145 @@ msgstr ""
"%s: '%s' argument til '-v' ikke på formen 'var=værdi'\n"
"\n"
-#: main.c:1200
+#: main.c:1293
#, c-format
msgid "`%s' is not a legal variable name"
msgstr "'%s' er ikke et gyldigt variabelnavn"
-#: main.c:1203
+#: main.c:1296
#, c-format
msgid "`%s' is not a variable name, looking for file `%s=%s'"
msgstr "'%s' er ikke et variabelnavn, leder efter fil '%s=%s'"
-#: main.c:1207
+#: main.c:1300
#, c-format
msgid "cannot use gawk builtin `%s' as variable name"
msgstr "kan ikke bruge gawk's indbyggede '%s' som variabelnavn"
-#: main.c:1212
+#: main.c:1305
#, c-format
msgid "cannot use function `%s' as variable name"
msgstr "kan ikke bruge funktion '%s' som variabelnavn"
-#: main.c:1265
+#: main.c:1358
msgid "floating point exception"
msgstr "flydendetalsundtagelse"
-#: main.c:1272
+#: main.c:1365
msgid "fatal error: internal error"
msgstr "fatal fejl: intern fejl"
-#: main.c:1287
+#: main.c:1380
msgid "fatal error: internal error: segfault"
msgstr "fatal fejl: intern fejl: segmentfejl"
-#: main.c:1299
+#: main.c:1392
msgid "fatal error: internal error: stack overflow"
msgstr "fatal fejl: intern fejl: stakoverløb"
-#: main.c:1349
+#: main.c:1448
#, c-format
msgid "no pre-opened fd %d"
msgstr "ingen fd %d åbnet i forvejen"
-#: main.c:1356
+#: main.c:1455
#, c-format
msgid "could not pre-open /dev/null for fd %d"
msgstr "kunne ikke i forvejen åbne /dev/null for fd %d"
-#: msg.c:63
+#: mpfr.c:563
+#, fuzzy, c-format
+msgid "PREC value `%.*s' is invalid"
+msgstr "BINMODE værdi '%s' er ugyldig, behandles som 3"
+
+#: mpfr.c:621
+#, fuzzy, c-format
+msgid "RNDMODE value `%.*s' is invalid"
+msgstr "BINMODE værdi '%s' er ugyldig, behandles som 3"
+
+#: mpfr.c:711
+#, fuzzy, c-format
+msgid "%s: received non-numeric argument"
+msgstr "cos: fik et ikke-numerisk argument"
+
+#: mpfr.c:813
+#, fuzzy
+msgid "compl(%Rg): negative value will give strange results"
+msgstr "compl(%lf): negative værdier vil give mærkelige resultater"
+
+#: mpfr.c:817
+#, fuzzy
+msgid "comp(%Rg): fractional value will be truncated"
+msgstr "compl(%lf): kommatalsværdier vil blive trunkeret"
+
+#: mpfr.c:829
+#, fuzzy, c-format
+msgid "cmpl(%Zd): negative values will give strange results"
+msgstr "compl(%lf): negative værdier vil give mærkelige resultater"
+
+#: mpfr.c:856
+#, fuzzy, c-format
+msgid "%s: received non-numeric first argument"
+msgstr "or: fik et ikke-numerisk første argument"
+
+#: mpfr.c:858
+#, fuzzy, c-format
+msgid "%s: received non-numeric second argument"
+msgstr "or: fik et ikke-numerisk andet argument"
+
+#: mpfr.c:877
+#, fuzzy
+msgid "%s(%Rg, ..): negative values will give strange results"
+msgstr "or(%lf, %lf): negative værdier vil give mærkelige resultater"
+
+#: mpfr.c:882
+#, fuzzy
+msgid "%s(%Rg, ..): fractional values will be truncated"
+msgstr "or(%lf, %lf): kommatalsværdier vil blive trunkeret"
+
+#: mpfr.c:895
+#, fuzzy, c-format
+msgid "%s(%Zd, ..): negative values will give strange results"
+msgstr "or(%lf, %lf): negative værdier vil give mærkelige resultater"
+
+#: mpfr.c:914
+#, fuzzy
+msgid "%s(.., %Rg): negative values will give strange results"
+msgstr "or(%lf, %lf): negative værdier vil give mærkelige resultater"
+
+#: mpfr.c:919
+#, fuzzy
+msgid "%s(.., %Rg): fractional values will be truncated"
+msgstr "or(%lf, %lf): kommatalsværdier vil blive trunkeret"
+
+#: mpfr.c:932
+#, fuzzy, c-format
+msgid "%s(.., %Zd): negative values will give strange results"
+msgstr "or(%lf, %lf): negative værdier vil give mærkelige resultater"
+
+#: msg.c:61
#, c-format
msgid "cmd. line:"
msgstr "kommandolinje:"
-#: msg.c:107
-msgid "error: "
-msgstr "fejl: "
-
-#: node.c:406
+#: node.c:436
msgid "backslash at end of string"
msgstr "omvendt skråstreg i slutningen af strengen"
-#: node.c:517
+#: node.c:520
#, c-format
msgid "old awk does not support the `\\%c' escape sequence"
msgstr "gamle versioner af awk understøtter ikke '\\%c' undvigesekvens"
-#: node.c:568
+#: node.c:571
msgid "POSIX does not allow `\\x' escapes"
msgstr "POSIX tillader ikke '\\x'-kontrolsekvenser"
-#: node.c:574
+#: node.c:577
msgid "no hex digits in `\\x' escape sequence"
msgstr "ingen heksadecimale cifre i '\\x'-kontrolsekvenser"
-#: node.c:596
+#: node.c:599
#, c-format
msgid ""
"hex escape \\x%.*s of %d characters probably not interpreted the way you "
@@ -1973,12 +3178,12 @@ msgstr ""
"den heksadecimale sekvens \\x%.*s på %d tegn nok ikke forstået som du "
"forventer det"
-#: node.c:611
+#: node.c:614
#, c-format
msgid "escape sequence `\\%c' treated as plain `%c'"
msgstr "kontrolsekvensen '\\%c' behandlet som kun '%c'"
-#: node.c:750
+#: node.c:759
msgid ""
"Invalid multibyte data detected. There may be a mismatch between your data "
"and your locale."
@@ -1986,26 +3191,26 @@ msgstr ""
"Ugyldigt multibyte data fundet. Måske er der uoverensstemmelse mellem dine "
"data og dit locale."
-#: posix/gawkmisc.c:176
+#: posix/gawkmisc.c:177
#, c-format
msgid "%s %s `%s': could not get fd flags: (fcntl F_GETFD: %s)"
msgstr "%s %s '%s': kunne ikke få fat på fd flag: (fcntl F_GETFD: %s)"
-#: posix/gawkmisc.c:188
+#: posix/gawkmisc.c:189
#, c-format
msgid "%s %s `%s': could not set close-on-exec: (fcntl F_SETFD: %s)"
msgstr "%s %s '%s': kunne ikke sætte luk-ved-exec (fcntl F_SETFD: %s)"
-#: profile.c:83
+#: profile.c:70
#, c-format
msgid "could not open `%s' for writing: %s"
msgstr "kunne ikke åbne '%s' for skrivning: %s"
-#: profile.c:85
+#: profile.c:72
msgid "sending profile to standard error"
msgstr "sender profilen til standard fejl"
-#: profile.c:203
+#: profile.c:188
#, c-format
msgid ""
"\t# %s block(s)\n"
@@ -2014,7 +3219,7 @@ msgstr ""
"\t# %s blokke\n"
"\n"
-#: profile.c:208
+#: profile.c:193
#, c-format
msgid ""
"\t# Rule(s)\n"
@@ -2023,17 +3228,22 @@ msgstr ""
"\t# Regler\n"
"\n"
-#: profile.c:279
+#: profile.c:267
#, c-format
msgid "internal error: %s with null vname"
msgstr "intern fejl: %s med null vname"
-#: profile.c:952
+#: profile.c:529
+#, fuzzy
+msgid "internal error: builtin with null fname"
+msgstr "intern fejl: %s med null vname"
+
+#: profile.c:944
#, c-format
msgid "\t# gawk profile, created %s\n"
msgstr "\t# profil til gawk oprettet %s\n"
-#: profile.c:1331
+#: profile.c:1329
#, c-format
msgid ""
"\n"
@@ -2042,17 +3252,17 @@ msgstr ""
"\n"
"\t# Funktioner, listede alfabetisk\n"
-#: profile.c:1370
+#: profile.c:1367
#, c-format
msgid "redir2str: unknown redirection type %d"
msgstr "redir2str: uykendt omdirigeringstype %d"
-#: re.c:573
+#: re.c:568
#, c-format
msgid "range of the form `[%c-%c]' is locale dependent"
msgstr "område på formen `[%c-%c]' er locale-afhængig"
-#: re.c:600
+#: re.c:595
#, c-format
msgid "regexp component `%.*s' should probably be `[%.*s]'"
msgstr "regexp-komponent `%.*s' skulle nok være `[%.*s]'"
@@ -2097,10 +3307,6 @@ msgstr "Ubalanceret ( eller \\("
msgid "Unmatched \\{"
msgstr "Ubalanceret \\{"
-#: regcomp.c:161
-msgid "Invalid content of \\{\\}"
-msgstr "Ugyldigt indhold i \\{\\}"
-
#: regcomp.c:164
msgid "Invalid range end"
msgstr "Ugyldig intervalslutning"
@@ -2117,10 +3323,6 @@ msgstr "Ugyldigt foregående regulært udtryk"
msgid "Premature end of regular expression"
msgstr "For tidligt slut på regulært udtryk"
-#: regcomp.c:176
-msgid "Regular expression too big"
-msgstr "Regulært udtryk for stort"
-
#: regcomp.c:179
msgid "Unmatched ) or \\)"
msgstr "Ubalanceret ) eller \\)"
@@ -2129,12 +3331,100 @@ msgstr "Ubalanceret ) eller \\)"
msgid "No previous regular expression"
msgstr "Intet foregående regulært udtryk"
+#: symbol.c:722
+msgid "can not pop main context"
+msgstr ""
+
#~ msgid "`nextfile' is a gawk extension"
#~ msgstr "'nextfile' er en gawk-udvidelse"
#~ msgid "`delete array' is a gawk extension"
#~ msgstr "'delete array' er en gawk-udvidelse"
+#~ msgid "and: received non-numeric first argument"
+#~ msgstr "and: fik et ikke-numerisk første argument"
+
+#~ msgid "and: received non-numeric second argument"
+#~ msgstr "and: fik et ikke-numerisk andet argument"
+
+#~ msgid "and(%lf, %lf): fractional values will be truncated"
+#~ msgstr "and(%lf, %lf): kommatalsværdier vil blive trunkeret"
+
+#~ msgid "xor: received non-numeric first argument"
+#~ msgstr "xor: fik et ikke-numerisk første argument"
+
+#~ msgid "xor: received non-numeric second argument"
+#~ msgstr "xor: fik et ikke-numerisk andet argument"
+
+#~ msgid "xor(%lf, %lf): fractional values will be truncated"
+#~ msgstr "xor(%lf, %lf): kommatalsværdier vil blive trunkeret"
+
+#~ msgid "`extension' is a gawk extension"
+#~ msgstr "'extension' er en gawk-udvidelse"
+
+#~ msgid "Operation Not Supported"
+#~ msgstr "Operationen understøttes ikke"
+
+#~ msgid "attempt to use function `%s' as an array"
+#~ msgstr "forsøg på at bruge funktionen '%s' som et array"
+
+#~ msgid "reference to uninitialized element `%s[\"%.*s\"]'"
+#~ msgstr "reference til ikke-initieret element '%s[\"%.*s\"]'"
+
+#~ msgid "subscript of array `%s' is null string"
+#~ msgstr "indeks i array '%s' er en tom streng"
+
+#~ msgid "%s: empty (null)\n"
+#~ msgstr "%s: tom (null)\n"
+
+#~ msgid "%s: empty (zero)\n"
+#~ msgstr "%s: tom (nul)\n"
+
+#~ msgid "%s: table_size = %d, array_size = %d\n"
+#~ msgstr "%s: tabelstørrelse = %d, arraystørrelse = %d\n"
+
+#~ msgid "%s: array_ref to %s\n"
+#~ msgstr "%s: arrayreference til %s\n"
+
+#~ msgid "use of non-array as array"
+#~ msgstr "brug af ikke-array som array"
+
+#~ msgid "can't use function name `%s' as variable or array"
+#~ msgstr "kan ikke bruge funktionsnavnet '%s' som variabel eller array"
+
+#~ msgid "assignment used in conditional context"
+#~ msgstr "tildeling brugt i sammenligningsammenhæng"
+
+#~ msgid "statement has no effect"
+#~ msgstr "kommandoen har ingen effekt"
+
+#~ msgid ""
+#~ "for loop: array `%s' changed size from %ld to %ld during loop execution"
+#~ msgstr ""
+#~ "for-løkke: array '%s' ændrede størrelse fra %ld til %ld under udførelse "
+#~ "af løkken"
+
+#~ msgid "function called indirectly through `%s' does not exist"
+#~ msgstr "funktion kaldt indirekte via '%s' eksisterer ikke"
+
+#~ msgid "function `%s' not defined"
+#~ msgstr "funktionen '%s' er ikke defineret"
+
+#~ msgid "non-redirected `getline' invalid inside `%s' rule"
+#~ msgstr "ikke-omdirigeret 'getline' ugyldig inden i '%s'-regel"
+
+#~ msgid "`nextfile' cannot be called from a `%s' rule"
+#~ msgstr "'nextfile' kan ikke kaldes fra en '%s'-regel"
+
+#~ msgid "`next' cannot be called from a `%s' rule"
+#~ msgstr "'next' kan ikke kaldes fra en '%s'-regel"
+
+#~ msgid "Sorry, don't know how to interpret `%s'"
+#~ msgstr "Véd desværre ikke hvordan '%s' skal fortolkes"
+
+#~ msgid "\t-R file\t\t\t--command=file\n"
+#~ msgstr "\t-R file\t\t\t--command=fil\n"
+
#~ msgid "could not find groups: %s"
#~ msgstr "kunne ikke finde grupper: %s"
@@ -2153,9 +3443,6 @@ msgstr "Intet foregående regulært udtryk"
#~ msgid "attempt to use scalar `%s' as array"
#~ msgstr "forsøg på at bruge skalaren '%s' som array"
-#~ msgid "attempt to use array `%s' in scalar context"
-#~ msgstr "forsøg på at bruge array '%s' i skalarsammenhæng"
-
#~ msgid "call of `length' without parentheses is deprecated by POSIX"
#~ msgstr "kald af 'length' uden parenteser er forældet ifølge POSIX"
diff --git a/po/de.gmo b/po/de.gmo
index 938acf70..8f2a3548 100644
--- a/po/de.gmo
+++ b/po/de.gmo
Binary files differ
diff --git a/po/de.po b/po/de.po
index 4cebb3bb..ea8534fa 100644
--- a/po/de.po
+++ b/po/de.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gawk 4.0.0h\n"
"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
-"POT-Creation-Date: 2012-10-13 20:24+0200\n"
+"POT-Creation-Date: 2012-10-13 21:21+0200\n"
"PO-Revision-Date: 2012-01-30 16:21+0100\n"
"Last-Translator: Philipp Thomas <pth@suse.de>\n"
"Language-Team: German <translation-team-de@lists.sourceforge.net>\n"
@@ -17,517 +17,508 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: array.c:140
+#: array.c:266
#, c-format
msgid "from %s"
msgstr "von %s"
-#: array.c:248
+#: array.c:366
msgid "attempt to use a scalar value as array"
msgstr "Es wird versucht, einen Skalar als Feld zu verwenden"
-#: array.c:251
-#, c-format
-msgid "attempt to use function `%s' as an array"
-msgstr "Es wird versucht, die Funktion »%s« als Feld zu verwenden"
-
-#: array.c:254
+#: array.c:368
#, c-format
msgid "attempt to use scalar parameter `%s' as an array"
msgstr "Es wird versucht, den skalaren Parameter »%s« als Feld zu verwenden"
-#: array.c:257
+#: array.c:371
#, c-format
msgid "attempt to use scalar `%s' as an array"
msgstr "Es wird versucht, den Skalar »%s« als Array zu verwenden"
-#: array.c:302 array.c:707 builtin.c:84 builtin.c:1385 builtin.c:1427
-#: builtin.c:1440 builtin.c:1859 builtin.c:1871 eval.c:1135 eval.c:1139
-#: eval.c:1495 eval.c:1812
+#: array.c:418 array.c:584 builtin.c:85 builtin.c:1566 builtin.c:1608
+#: builtin.c:1621 builtin.c:2047 builtin.c:2059 eval.c:1121 eval.c:1125
+#: eval.c:1520
#, c-format
msgid "attempt to use array `%s' in a scalar context"
msgstr "Es wird versucht, das Feld »%s« in einem Skalarkontext zu verwenden"
-#: array.c:513
-#, c-format
-msgid "reference to uninitialized element `%s[\"%.*s\"]'"
-msgstr "Bezug auf ein nicht initialisiertes Element »%s[\"%.*s\"]«"
-
-#: array.c:519
-#, c-format
-msgid "subscript of array `%s' is null string"
-msgstr "Der Index von Feld »%s« ist ein Nullstring"
-
-#: array.c:723
+#: array.c:591
#, c-format
msgid "delete: index `%s' not in array `%s'"
msgstr "delete: Index »%s« ist in Feld »%s« nicht vorhanden"
-#: array.c:734 eval.c:1865
+#: array.c:605
#, c-format
msgid "attempt to use scalar `%s[\"%.*s\"]' as an array"
msgstr "Es wird versucht, den Skalar »%s[\"%.*s\"]« als Feld zu verwenden"
-#: array.c:910
-#, c-format
-msgid "%s: empty (null)\n"
-msgstr "%s: leer (Null)\n"
-
-#: array.c:915
-#, c-format
-msgid "%s: empty (zero)\n"
-msgstr "%s: leer (0)\n"
-
-#: array.c:919
-#, c-format
-msgid "%s: table_size = %d, array_size = %d\n"
-msgstr "%s: Tabellengröße = %d, Feldgröße = %d\n"
-
-#: array.c:954
-#, c-format
-msgid "%s: is parameter\n"
-msgstr "%s: ist ein Parameter\n"
-
-#: array.c:958
-#, c-format
-msgid "%s: array_ref to %s\n"
-msgstr "%s: Feld-Referenz auf %s\n"
-
-#: array.c:963
-msgid "adump: argument not an array"
+#: array.c:784
+#, fuzzy
+msgid "adump: first argument not an array"
msgstr "adump: Das Argument ist kein Feld"
-#: array.c:1086
+#: array.c:823
msgid "asort: second argument not an array"
msgstr "asort: Das zweite Argument ist kein Feld"
-#: array.c:1087
+#: array.c:824
msgid "asorti: second argument not an array"
msgstr "asorti: Das zweite Argument ist kein Feld"
-#: array.c:1094
+#: array.c:831
msgid "asort: first argument not an array"
msgstr "asort: Das erste Argument ist kein Feld"
-#: array.c:1095
+#: array.c:832
msgid "asorti: first argument not an array"
msgstr "asorti: Das erste Argument ist kein Feld"
-#: array.c:1102
+#: array.c:839
msgid "asort: cannot use a subarray of first arg for second arg"
msgstr ""
"asort: ein untergeordnetes Feld des ersten Arguments kann nicht als zweites "
"Argument verwendet werden"
-#: array.c:1103
+#: array.c:840
msgid "asorti: cannot use a subarray of first arg for second arg"
msgstr ""
"asorti: ein untergeordnetes Feld des ersten Arguments kann nicht als zweites "
"Argument verwendet werden"
-#: array.c:1108
+#: array.c:845
msgid "asort: cannot use a subarray of second arg for first arg"
msgstr ""
"asort: ein untergeordnetes Feld des zweiten Arguments kann nicht als erstes "
"Argument verwendet werden"
-#: array.c:1109
+#: array.c:846
msgid "asorti: cannot use a subarray of second arg for first arg"
msgstr ""
"asorti: ein untergeordnetes Feld des zweiten Arguments kann nicht als erstes "
"Argument verwendet werden"
-#: array.c:1655
+#: array.c:1314
#, c-format
msgid "`%s' is invalid as a function name"
msgstr "»%s« ist ein unzulässiger Funktionsname"
-#: array.c:1659
+#: array.c:1318
#, c-format
msgid "sort comparison function `%s' is not defined"
msgstr "Die Vergleichsfunktion »%s« für das Sortieren ist nicht definiert"
-#: awkgram.y:249
+#: awkgram.y:223
#, c-format
msgid "%s blocks must have an action part"
msgstr "%s-Blöcke müssen einen Aktionsteil haben"
-#: awkgram.y:252
+#: awkgram.y:226
msgid "each rule must have a pattern or an action part"
msgstr "Jede Regel muss entweder ein Muster oder einen Aktionsteil haben"
-#: awkgram.y:323 awkgram.y:334
+#: awkgram.y:315 awkgram.y:326
msgid "old awk does not support multiple `BEGIN' or `END' rules"
msgstr "Das alte awk erlaubt keine mehrfachen »BEGIN«- oder »END«-Regeln"
-#: awkgram.y:371
+#: awkgram.y:363
#, c-format
msgid "`%s' is a built-in function, it cannot be redefined"
msgstr "»%s« ist eine eingebaute Funktion und kann nicht umdefiniert werden"
-#: awkgram.y:432
+#: awkgram.y:409
msgid "regexp constant `//' looks like a C++ comment, but is not"
msgstr ""
"Die Regulärer-Ausdruck-Konstante »//« sieht wie ein C-Kommentar aus, ist "
"aber keiner"
-#: awkgram.y:436
+#: awkgram.y:413
#, c-format
msgid "regexp constant `/%s/' looks like a C comment, but is not"
msgstr ""
"Die Regulärer-Ausdruck-Konstante »/%s/« sieht wie ein C-Kommentar aus, ist "
"aber keiner"
-#: awkgram.y:528
+#: awkgram.y:505
#, c-format
msgid "duplicate case values in switch body: %s"
msgstr "doppelte Case-Werte im Switch-Block: %s"
-#: awkgram.y:549
+#: awkgram.y:526
msgid "duplicate `default' detected in switch body"
msgstr "doppeltes »default« im Switch-Block gefunden"
-#: awkgram.y:809
+#: awkgram.y:786
msgid "`break' is not allowed outside a loop or switch"
msgstr ""
"»break« ist außerhalb einer Schleife oder eines Switch-Blocks nicht zulässig"
-#: awkgram.y:818
+#: awkgram.y:795
msgid "`continue' is not allowed outside a loop"
msgstr "»continue« ist außerhalb einer Schleife nicht zulässig"
-#: awkgram.y:828
+#: awkgram.y:805
#, c-format
msgid "`next' used in %s action"
msgstr "»next« wird in %s-Aktion verwendet"
-#: awkgram.y:837
+#: awkgram.y:814
#, c-format
msgid "`nextfile' used in %s action"
msgstr "»nextfile« wird in %s-Aktion verwendet"
-#: awkgram.y:861
+#: awkgram.y:838
msgid "`return' used outside function context"
msgstr "»return« wird außerhalb einer Funktion verwendet"
-#: awkgram.y:921
+#: awkgram.y:912
msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'"
msgstr ""
"Einfaches »print« in BEGIN- oder END-Regel soll vermutlich »print \"\"« sein"
-#: awkgram.y:1016 awkgram.y:1020
+#: awkgram.y:978 awkgram.y:1027
+msgid "`delete' is not allowed with SYMTAB"
+msgstr ""
+
+#: awkgram.y:980 awkgram.y:1029
+msgid "`delete' is not allowed with FUNCTAB"
+msgstr ""
+
+#: awkgram.y:1014 awkgram.y:1018
msgid "`delete(array)' is a non-portable tawk extension"
msgstr "»delete(array)« ist eine gawk-Erweiterung"
-#: awkgram.y:1132
+#: awkgram.y:1139
msgid "multistage two-way pipelines don't work"
msgstr "mehrstufige Zweiwege-Pipes funktionieren nicht"
-#: awkgram.y:1235
+#: awkgram.y:1242
msgid "regular expression on right of assignment"
msgstr "Regulärer Ausdruck auf der rechten Seite einer Zuweisung"
-#: awkgram.y:1246
+#: awkgram.y:1253
msgid "regular expression on left of `~' or `!~' operator"
msgstr "Regulärer Ausdruck links vom »~«- oder »!~«-Operator"
-#: awkgram.y:1262 awkgram.y:1416
+#: awkgram.y:1269 awkgram.y:1420
msgid "old awk does not support the keyword `in' except after `for'"
msgstr "Das alte awk unterstützt das Schlüsselwort »in« nur nach »for«"
-#: awkgram.y:1272
+#: awkgram.y:1279
msgid "regular expression on right of comparison"
msgstr "Regulärer Ausdruck rechts von einem Vergleich"
-#: awkgram.y:1391
+#: awkgram.y:1395
#, c-format
msgid "`getline var' invalid inside `%s' rule"
msgstr "»getline var« ist ungültig innerhalb der »%s«-Regel"
-#: awkgram.y:1394 eval.c:2504
+#: awkgram.y:1398
#, c-format
msgid "`getline' invalid inside `%s' rule"
msgstr "»getline« ist ungültig innerhalb der »%s«-Regel"
-#: awkgram.y:1399
+#: awkgram.y:1403
msgid "non-redirected `getline' undefined inside END action"
msgstr ""
"Nicht-umgelenktes »getline« ist innerhalb der END-Aktion nicht definiert"
-#: awkgram.y:1418
+#: awkgram.y:1422
msgid "old awk does not support multidimensional arrays"
msgstr "Das alte awk unterstützt keine mehrdimensionalen Felder"
-#: awkgram.y:1514
+#: awkgram.y:1519
msgid "call of `length' without parentheses is not portable"
msgstr "Aufruf von »length« ohne Klammern ist nicht portabel"
-#: awkgram.y:1577
+#: awkgram.y:1585
msgid "indirect function calls are a gawk extension"
msgstr "indirekte Funktionsaufrufe sind eine gawk-Erweiterung"
-#: awkgram.y:1590
+#: awkgram.y:1598
#, c-format
msgid "can not use special variable `%s' for indirect function call"
msgstr ""
"die besondere Variable »%s« kann nicht für den indirekten Funktionsaufruf "
"verwendet werden"
-#: awkgram.y:1668
+#: awkgram.y:1676
msgid "invalid subscript expression"
msgstr "Ungültiger Index-Ausdruck"
-#: awkgram.y:1708
-msgid "use of non-array as array"
-msgstr "Verwendung eines Nicht-Feldes als Feld"
-
-#: awkgram.y:1972 awkgram.y:1992 msg.c:98
+#: awkgram.y:2000 awkgram.y:2020 gawkapi.c:203 gawkapi.c:221 msg.c:119
msgid "warning: "
msgstr "Warnung: "
-#: awkgram.y:1990 msg.c:130
+#: awkgram.y:2018 gawkapi.c:189 gawkapi.c:218 msg.c:151
msgid "fatal: "
msgstr "Fatal: "
-#: awkgram.y:2040
+#: awkgram.y:2068
msgid "unexpected newline or end of string"
msgstr "Unerwarteter Zeilenumbruch oder Ende der Zeichenkette"
-#: awkgram.y:2297 awkgram.y:2355 awkgram.y:2539
+#: awkgram.y:2335 awkgram.y:2411 awkgram.y:2634 debug.c:517 debug.c:533
+#: debug.c:2790 debug.c:5038
#, c-format
msgid "can't open source file `%s' for reading (%s)"
msgstr "Quelldatei »%s« kann nicht zum Lesen geöffnet werden (%s)"
-#: awkgram.y:2298 awkgram.y:2356 builtin.c:122
+#: awkgram.y:2336 awkgram.y:2461
+#, fuzzy, c-format
+msgid "can't open shared library `%s' for reading (%s)"
+msgstr "Quelldatei »%s« kann nicht zum Lesen geöffnet werden (%s)"
+
+#: awkgram.y:2338 awkgram.y:2412 awkgram.y:2462 builtin.c:130 debug.c:5189
msgid "reason unknown"
msgstr "Unbekannte Ursache"
-#: awkgram.y:2314
+#: awkgram.y:2347 awkgram.y:2371
+#, c-format
+msgid "can't include `%s' and use it as a program file"
+msgstr ""
+
+#: awkgram.y:2360
#, c-format
msgid "already included source file `%s'"
msgstr "Quelldatei »%s« wurde bereits eingebunden"
-#: awkgram.y:2340
+#: awkgram.y:2361
+#, fuzzy, c-format
+msgid "already loaded shared library `%s'"
+msgstr "Quelldatei »%s« wurde bereits eingebunden"
+
+#: awkgram.y:2396
msgid "@include is a gawk extension"
msgstr "»@include« ist eine gawk-Erweiterung"
-#: awkgram.y:2346
+#: awkgram.y:2402
msgid "empty filename after @include"
msgstr "leerer Dateiname nach @include"
-#: awkgram.y:2491
+#: awkgram.y:2446
+#, fuzzy
+msgid "@load is a gawk extension"
+msgstr "»@include« ist eine gawk-Erweiterung"
+
+#: awkgram.y:2452
+#, fuzzy
+msgid "empty filename after @load"
+msgstr "leerer Dateiname nach @include"
+
+#: awkgram.y:2586
msgid "empty program text on command line"
msgstr "Kein Programmtext auf der Kommandozeile"
-#: awkgram.y:2606
+#: awkgram.y:2701
#, c-format
msgid "can't read sourcefile `%s' (%s)"
msgstr "Die Quelldatei »%s« kann nicht gelesen werden (%s)"
-#: awkgram.y:2617
+#: awkgram.y:2712
#, c-format
msgid "source file `%s' is empty"
msgstr "Die Quelldatei »%s« ist leer"
-#: awkgram.y:2794
+#: awkgram.y:2889
msgid "source file does not end in newline"
msgstr "Die Quelldatei hört nicht mit einem Zeilenende auf"
-#: awkgram.y:2897
+#: awkgram.y:2994
msgid "unterminated regexp ends with `\\' at end of file"
msgstr ""
"Nicht beendeter regulärer Ausdruck (hört mit '\\' auf) am Ende der Datei"
-#: awkgram.y:2921
+#: awkgram.y:3018
#, c-format
msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk"
msgstr ""
"%s: %d: der tawk-Modifizierer für reguläre Ausdrücke »/.../%c« funktioniert "
"nicht in gawk"
-#: awkgram.y:2925
+#: awkgram.y:3022
#, c-format
msgid "tawk regex modifier `/.../%c' doesn't work in gawk"
msgstr ""
"Der tawk-Modifizierer für reguläre Ausdrücke »/.../%c« funktioniert nicht in "
"gawk"
-#: awkgram.y:2932
+#: awkgram.y:3029
msgid "unterminated regexp"
msgstr "Nicht beendeter regulärer Ausdruck"
-#: awkgram.y:2936
+#: awkgram.y:3033
msgid "unterminated regexp at end of file"
msgstr "Nicht beendeter regulärer Ausdruck am Dateiende"
-#: awkgram.y:2995
+#: awkgram.y:3092
msgid "use of `\\ #...' line continuation is not portable"
msgstr ""
"Die Verwendung von »\\#...« zur Fortsetzung von Zeilen ist nicht portabel"
-#: awkgram.y:3011
+#: awkgram.y:3108
msgid "backslash not last character on line"
msgstr "das letzte Zeichen auf der Zeile ist kein Backslash (»\\«)"
-#: awkgram.y:3072
+#: awkgram.y:3169
msgid "POSIX does not allow operator `**='"
msgstr "POSIX erlaubt den Operator »**=« nicht"
-#: awkgram.y:3074
+#: awkgram.y:3171
msgid "old awk does not support operator `**='"
msgstr "Das alte awk unterstützt den Operator »**=« nicht"
-#: awkgram.y:3083
+#: awkgram.y:3180
msgid "POSIX does not allow operator `**'"
msgstr "POSIX erlaubt den Operator »**« nicht"
-#: awkgram.y:3085
+#: awkgram.y:3182
msgid "old awk does not support operator `**'"
msgstr "Das alte awk unterstützt den Operator »**« nicht"
-#: awkgram.y:3120
+#: awkgram.y:3217
msgid "operator `^=' is not supported in old awk"
msgstr "Das alte awk unterstützt den Operator »^=« nicht"
-#: awkgram.y:3128
+#: awkgram.y:3225
msgid "operator `^' is not supported in old awk"
msgstr "Das alte awk unterstützt den Operator »^« nicht"
-#: awkgram.y:3221 awkgram.y:3237
+#: awkgram.y:3318 awkgram.y:3334 command.y:1178
msgid "unterminated string"
msgstr "Nicht beendete Zeichenkette"
-#: awkgram.y:3433
+#: awkgram.y:3555
#, c-format
msgid "invalid char '%c' in expression"
msgstr "Ungültiges Zeichen »%c« in einem Ausdruck"
-#: awkgram.y:3480
+#: awkgram.y:3602
#, c-format
msgid "`%s' is a gawk extension"
msgstr "»%s« ist eine gawk-Erweiterung"
-#: awkgram.y:3485
+#: awkgram.y:3607
#, c-format
msgid "`%s' is a Bell Labs extension"
msgstr "»%s« ist eine Erweiterung der Bell Labs"
-#: awkgram.y:3490
+#: awkgram.y:3612
#, c-format
msgid "POSIX does not allow `%s'"
msgstr "POSIX erlaubt »%s« nicht"
-#: awkgram.y:3498
+#: awkgram.y:3620
#, c-format
msgid "`%s' is not supported in old awk"
msgstr "»%s« wird im alten awk nicht unterstützt"
-#: awkgram.y:3565
+#: awkgram.y:3688
msgid "`goto' considered harmful!\n"
msgstr "»goto« gilt als schlechter Stil!\n"
-#: awkgram.y:3616
+#: awkgram.y:3722
#, c-format
msgid "%d is invalid as number of arguments for %s"
msgstr "Unzulässige Argumentzahl %d für %s"
-#: awkgram.y:3651
+#: awkgram.y:3757
#, c-format
msgid "%s: string literal as last arg of substitute has no effect"
msgstr "%s: Ein String als letztes Argument von substitute hat keinen Effekt"
-#: awkgram.y:3656
+#: awkgram.y:3762
#, c-format
msgid "%s third parameter is not a changeable object"
msgstr "Der dritte Parameter von %s ist ein unveränderliches Objekt"
-#: awkgram.y:3729 awkgram.y:3732
+#: awkgram.y:3841 awkgram.y:3844
msgid "match: third argument is a gawk extension"
msgstr "match: Das dritte Argument ist eine gawk-Erweiterung"
-#: awkgram.y:3786 awkgram.y:3789
+#: awkgram.y:3898 awkgram.y:3901
msgid "close: second argument is a gawk extension"
msgstr "close: Das zweite Argument ist eine gawk-Erweiterung"
-#: awkgram.y:3801
+#: awkgram.y:3913
msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
msgstr ""
"Fehlerhafte Verwendung von dcgettext(_\"...\"): \n"
"Entfernen Sie den führenden Unterstrich"
-#: awkgram.y:3816
+#: awkgram.y:3928
msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
msgstr ""
"Fehlerhafte Verwendung von dcngettext(_\"...\"): \n"
"Entfernen Sie den führenden Unterstrich"
-#: awkgram.y:3908
-#, c-format
-msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
-msgstr "Funktion »%s«: Parameter #%d, »%s« wiederholt Parameter #%d"
-
-#: awkgram.y:3950
+#: awkgram.y:3994
#, c-format
msgid "function `%s': parameter `%s' shadows global variable"
msgstr "Funktion »%s«: Parameter »%s« verdeckt eine globale Variable"
-#: awkgram.y:4108
+#: awkgram.y:4051 debug.c:4019 debug.c:4062 debug.c:5187
#, c-format
msgid "could not open `%s' for writing (%s)"
msgstr "»%s« kann nicht zum Schreiben geöffne werden(%s)"
-#: awkgram.y:4109
+#: awkgram.y:4052
msgid "sending variable list to standard error"
msgstr "Die Liste der Variablen wird auf der Standardfehlerausgabe ausgegeben"
-#: awkgram.y:4115
+#: awkgram.y:4060
#, c-format
msgid "%s: close failed (%s)"
msgstr "%s: close ist gescheitert (%s)"
-#: awkgram.y:4167
+#: awkgram.y:4085
msgid "shadow_funcs() called twice!"
msgstr "shadow_funcs() zweimal aufgerufen!"
-#: awkgram.y:4173
+#: awkgram.y:4093
msgid "there were shadowed variables."
msgstr "es sind verdeckte Variablen vorhanden"
-#: awkgram.y:4203
+#: awkgram.y:4164
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "Funktion »%s« wurde bereits definiert"
+
+#: awkgram.y:4210
#, c-format
msgid "function `%s': can't use function name as parameter name"
msgstr "Funktion »%s«: Funktionsnamen können nicht als Parameternamen benutzen"
-#: awkgram.y:4207
+#: awkgram.y:4213
#, c-format
msgid "function `%s': can't use special variable `%s' as a function parameter"
msgstr ""
"Funktion »%s«: die spezielle Variable »%s« kann nicht als Parameter "
"verwendet werden"
-#: awkgram.y:4223
+#: awkgram.y:4221
#, c-format
-msgid "function name `%s' previously defined"
-msgstr "Funktion »%s« wurde bereits definiert"
+msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
+msgstr "Funktion »%s«: Parameter #%d, »%s« wiederholt Parameter #%d"
-#: awkgram.y:4391 awkgram.y:4397
+#: awkgram.y:4315 awkgram.y:4319
#, c-format
msgid "function `%s' called but never defined"
msgstr "Aufgerufene Funktion »%s« ist nirgends definiert"
-#: awkgram.y:4400
+#: awkgram.y:4324
#, c-format
msgid "function `%s' defined but never called directly"
msgstr "Funktion »%s« wurde definiert aber nirgends aufgerufen"
-#: awkgram.y:4432
+#: awkgram.y:4356
#, c-format
msgid "regexp constant for parameter #%d yields boolean value"
msgstr ""
"Regulärer-Ausdruck-Konstante für Parameter #%d ergibt einen \n"
"logischen Wert"
-#: awkgram.y:4541
+#: awkgram.y:4402
#, c-format
msgid ""
"function `%s' called with space between name and `(',\n"
@@ -536,233 +527,233 @@ msgstr ""
"Funktion »%s« wird mit Leerzeichen zwischen Name und »(« aufgerufen, \n"
"oder als Variable oder Feld verwendet"
-#: awkgram.y:4788 eval.c:2056
+#: awkgram.y:4618
msgid "division by zero attempted"
msgstr "Division durch Null wurde versucht"
-#: awkgram.y:4797 eval.c:2072
+#: awkgram.y:4627
#, c-format
msgid "division by zero attempted in `%%'"
msgstr "Division durch Null versucht in »%%«"
-#: builtin.c:120
+#: builtin.c:128
#, c-format
msgid "%s to \"%s\" failed (%s)"
msgstr "%s to \"%s\" fehlgeschlagen (%s)"
-#: builtin.c:121
+#: builtin.c:129
msgid "standard output"
msgstr "Standardausgabe"
-#: builtin.c:135
+#: builtin.c:143
msgid "exp: received non-numeric argument"
msgstr "exp: das Argument ist keine Zahl"
-#: builtin.c:141
+#: builtin.c:149
#, c-format
msgid "exp: argument %g is out of range"
msgstr "exp: das Argument %g liegt außerhalb des gültigen Bereichs"
-#: builtin.c:200
+#: builtin.c:208
#, c-format
msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing"
msgstr ""
"fflush: Leeren der Puffer nicht möglich, Pipe »%s« ist nur zum Lesen geöffnet"
-#: builtin.c:203
+#: builtin.c:211
#, c-format
msgid "fflush: cannot flush: file `%s' opened for reading, not writing"
msgstr ""
"fflush: Leeren der Puffer nicht möglich, Datei »%s« ist nur zum Lesen "
"geöffnet"
-#: builtin.c:215
+#: builtin.c:223
#, c-format
msgid "fflush: `%s' is not an open file, pipe or co-process"
msgstr "fflush: »%s« ist keine geöffnete Datei, Pipe oder Prozess"
-#: builtin.c:333
+#: builtin.c:341
msgid "index: received non-string first argument"
msgstr "index: Erstes Argument ist kein String"
-#: builtin.c:335
+#: builtin.c:343
msgid "index: received non-string second argument"
msgstr "index: Zweites Argument ist kein string"
-#: builtin.c:457
+#: builtin.c:467 mpfr.c:770
msgid "int: received non-numeric argument"
msgstr "Argument ist keine Zahl"
-#: builtin.c:493
+#: builtin.c:503
msgid "length: received array argument"
msgstr "length: Argument ist ein Feld"
-#: builtin.c:496
+#: builtin.c:506
msgid "`length(array)' is a gawk extension"
msgstr "»length(array)« ist eine gawk-Erweiterung"
-#: builtin.c:504
+#: builtin.c:514
msgid "length: received non-string argument"
msgstr "length: Argument ist kein String"
-#: builtin.c:535
+#: builtin.c:545
msgid "log: received non-numeric argument"
msgstr "log: Argument ist keine Zahl"
-#: builtin.c:538
+#: builtin.c:548
#, c-format
msgid "log: received negative argument %g"
msgstr "log: Negatives Argument %g"
-#: builtin.c:694 builtin.c:699
+#: builtin.c:746 builtin.c:751
msgid "fatal: must use `count$' on all formats or none"
msgstr "Fatal: »count$« muss auf alle Formate angewandt werden oder auf keines"
-#: builtin.c:762
+#: builtin.c:821
#, c-format
msgid "field width is ignored for `%%' specifier"
msgstr "Feldbreite wird für die »%%«-Angabe ignoriert"
-#: builtin.c:764
+#: builtin.c:823
#, c-format
msgid "precision is ignored for `%%' specifier"
msgstr "Genauigkeit wird für die »%%«-Angabe ignoriert"
-#: builtin.c:766
+#: builtin.c:825
#, c-format
msgid "field width and precision are ignored for `%%' specifier"
msgstr "Feldbreite und Genauigkeit werden für die »%%«-Angabe ignoriert"
-#: builtin.c:817
+#: builtin.c:876
msgid "fatal: `$' is not permitted in awk formats"
msgstr "Fatal: »$« ist in awk-Formaten nicht zulässig"
-#: builtin.c:826
+#: builtin.c:885
msgid "fatal: arg count with `$' must be > 0"
msgstr "Fatal: die Anzahl der Argumen bei »$« muss > 0 sein"
-#: builtin.c:830
+#: builtin.c:889
#, c-format
msgid "fatal: arg count %ld greater than total number of supplied arguments"
msgstr ""
"Fatal: Argumentenanzahl %ld ist größer als die Gesamtzahl angegebener "
"Argumente"
-#: builtin.c:834
+#: builtin.c:893
msgid "fatal: `$' not permitted after period in format"
msgstr "Fatal: »$« nach Punkt in Formatangabe nicht zulässig"
-#: builtin.c:850
+#: builtin.c:909
msgid "fatal: no `$' supplied for positional field width or precision"
msgstr "Fatal: »$« fehlt in positionsabhängiger Feldbreite oder Genauigkeit"
#
-#: builtin.c:921
+#: builtin.c:981
msgid "`l' is meaningless in awk formats; ignored"
msgstr "»l« ist in awk-Formaten bedeutungslos, ignoriert"
-#: builtin.c:925
+#: builtin.c:985
msgid "fatal: `l' is not permitted in POSIX awk formats"
msgstr "Fatal: »l« ist in POSIX-awk-Formaten nicht zulässig"
-#: builtin.c:938
+#: builtin.c:998
msgid "`L' is meaningless in awk formats; ignored"
msgstr "»L« ist in awk-Formaten bedeutungslos, ignoriert"
-#: builtin.c:942
+#: builtin.c:1002
msgid "fatal: `L' is not permitted in POSIX awk formats"
msgstr "Fatal: »L« ist in POSIX-awk-Formaten nicht zulässig"
-#: builtin.c:955
+#: builtin.c:1015
msgid "`h' is meaningless in awk formats; ignored"
msgstr "»h« ist in awk-Formaten bedeutungslos, ignoriert"
-#: builtin.c:959
+#: builtin.c:1019
msgid "fatal: `h' is not permitted in POSIX awk formats"
msgstr "Fatal: »h« ist in POSIX-awk-Formaten nicht zulässig"
-#: builtin.c:1272
+#: builtin.c:1414
#, c-format
msgid "[s]printf: value %g is out of range for `%%%c' format"
msgstr "[s]printf: Wert %g ist außerhalb des Bereichs für Format »%%%c«"
-#: builtin.c:1332
+#: builtin.c:1512
#, c-format
msgid "ignoring unknown format specifier character `%c': no argument converted"
msgstr ""
"das unbekannte Zeichen »%c« in der Formatspezifikation wird ignoriert: keine "
"Argumente umgewandelt"
-#: builtin.c:1337
+#: builtin.c:1517
msgid "fatal: not enough arguments to satisfy format string"
msgstr "Fatal: Nicht genügend Argumente für die Formatangabe"
-#: builtin.c:1339
+#: builtin.c:1519
msgid "^ ran out for this one"
msgstr "^ hierfür fehlte es"
-#: builtin.c:1346
+#: builtin.c:1526
msgid "[s]printf: format specifier does not have control letter"
msgstr "[s]printf: Format-Spezifikation hat keinen Controlcode"
-#: builtin.c:1349
+#: builtin.c:1529
msgid "too many arguments supplied for format string"
msgstr "Zu viele Argumente für den Formatstring"
-#: builtin.c:1423 builtin.c:1434
+#: builtin.c:1604 builtin.c:1615
msgid "printf: no arguments"
msgstr "printf: Keine Argumente"
-#: builtin.c:1475
+#: builtin.c:1656
msgid "sqrt: received non-numeric argument"
msgstr "sqrt: das Argument ist keine Zahl"
-#: builtin.c:1479
+#: builtin.c:1660
#, c-format
msgid "sqrt: called with negative argument %g"
msgstr "sqrt: das Argument %g ist negativ"
-#: builtin.c:1503
+#: builtin.c:1691
#, c-format
msgid "substr: length %g is not >= 1"
msgstr "substr: Länge %g ist nicht >= 1"
-#: builtin.c:1505
+#: builtin.c:1693
#, c-format
msgid "substr: length %g is not >= 0"
msgstr "substr: Länge %g ist nicht >= 0"
-#: builtin.c:1512
+#: builtin.c:1700
#, c-format
msgid "substr: non-integer length %g will be truncated"
msgstr "substr: Nicht ganzzahlige Länge %g wird abgeschnitten"
-#: builtin.c:1517
+#: builtin.c:1705
#, c-format
msgid "substr: length %g too big for string indexing, truncating to %g"
msgstr ""
"substr: Länge %g ist zu groß für Stringindizierung, wird auf %g gekürzt"
-#: builtin.c:1529
+#: builtin.c:1717
#, c-format
msgid "substr: start index %g is invalid, using 1"
msgstr "substr: Start-Index %g ist ungültig, 1 wird verwendet"
-#: builtin.c:1534
+#: builtin.c:1722
#, c-format
msgid "substr: non-integer start index %g will be truncated"
msgstr "substr: Nicht ganzzahliger Start-Wert %g wird abgeschnitten"
-#: builtin.c:1559
+#: builtin.c:1747
msgid "substr: source string is zero length"
msgstr "substr: Quellstring ist leer"
-#: builtin.c:1575
+#: builtin.c:1763
#, c-format
msgid "substr: start index %g is past end of string"
msgstr "substr: Start-Wert %g liegt hinter dem Ende des Strings"
-#: builtin.c:1583
+#: builtin.c:1771
#, c-format
msgid ""
"substr: length %g at start index %g exceeds length of first argument (%lu)"
@@ -770,235 +761,1093 @@ msgstr ""
"substr: Länge %g am Start-Wert %g überschreitet die Länge des ersten "
"Arguments (%lu)"
-#: builtin.c:1657
+#: builtin.c:1845
msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type"
msgstr "strftime: Formatwert in PROCINFO[\"strftime\"] ist numerischen Typs"
-#: builtin.c:1680
+#: builtin.c:1868
msgid "strftime: received non-numeric second argument"
msgstr "strftime: Das zweite Argument ist keine Zahl"
-#: builtin.c:1683
+#: builtin.c:1872
msgid "strftime: second argument less than 0 or too big for time_t"
msgstr ""
"strftime: das zweite Argument ist kleiner als 0 oder zu groß für time_t"
-#: builtin.c:1690
+#: builtin.c:1879
msgid "strftime: received non-string first argument"
msgstr "strftime: Das erste Argument ist kein String"
-#: builtin.c:1696
+#: builtin.c:1886
msgid "strftime: received empty format string"
msgstr "strftime: Der Format-String ist leer"
-#: builtin.c:1762
+#: builtin.c:1952
msgid "mktime: received non-string argument"
msgstr "mktime: Das Argument ist kein String"
-#: builtin.c:1779
+#: builtin.c:1969
msgid "mktime: at least one of the values is out of the default range"
msgstr "mktime: mindestens einer der Werte ist außerhalb des normalen Bereichs"
-#: builtin.c:1814
+#: builtin.c:2004
msgid "'system' function not allowed in sandbox mode"
msgstr "Die Funktion »system« ist im Sandbox-Modus nicht erlaubt"
-#: builtin.c:1819
+#: builtin.c:2009
msgid "system: received non-string argument"
msgstr "system: Das Argument ist kein String"
-#: builtin.c:1874 eval.c:1159 eval.c:1790 eval.c:1803
-#, c-format
-msgid "reference to uninitialized variable `%s'"
-msgstr "Referenz auf die nicht initialisierte Variable »%s«"
-
-#: builtin.c:1941
+#: builtin.c:2127
#, c-format
msgid "reference to uninitialized field `$%d'"
msgstr "Referenz auf das nicht initialisierte Feld »$%d«"
-#: builtin.c:2028
+#: builtin.c:2214
msgid "tolower: received non-string argument"
msgstr "tolower: das Argument ist kein String"
-#: builtin.c:2062
+#: builtin.c:2248
msgid "toupper: received non-string argument"
msgstr "toupper: das Argument ist kein String"
-#: builtin.c:2098
+#: builtin.c:2284 mpfr.c:685
msgid "atan2: received non-numeric first argument"
msgstr "atan2: das erste Argument ist keine Zahl"
-#: builtin.c:2100
+#: builtin.c:2286 mpfr.c:687
msgid "atan2: received non-numeric second argument"
msgstr "atan2: das zweite Argument ist keine Zahl"
-#: builtin.c:2119
+#: builtin.c:2305
msgid "sin: received non-numeric argument"
msgstr "sin: das Argument ist keine Zahl"
-#: builtin.c:2135
+#: builtin.c:2321
msgid "cos: received non-numeric argument"
msgstr "cos: das Argument ist keine Zahl"
-#: builtin.c:2188
+#: builtin.c:2374 mpfr.c:1137
msgid "srand: received non-numeric argument"
msgstr "srand: das Argument ist keine Zahl"
-#: builtin.c:2219
+#: builtin.c:2405
msgid "match: third argument is not an array"
msgstr "match: das dritte Argument ist kein Array"
-#: builtin.c:2483
+#: builtin.c:2670
msgid "gensub: third argument of 0 treated as 1"
msgstr "gensub: 0 als drittes Argument wird als 1 interpretiert"
-#: builtin.c:2776
+#: builtin.c:2963
msgid "lshift: received non-numeric first argument"
msgstr "lshift: das erste Argument ist keine Zahl"
-#: builtin.c:2778
+#: builtin.c:2965
msgid "lshift: received non-numeric second argument"
msgstr "lshift: das zweite Argument ist keine Zahl"
-#: builtin.c:2784
+#: builtin.c:2971
#, fuzzy, c-format
msgid "lshift(%f, %f): negative values will give strange results"
msgstr ""
"lshift(%lf, %lf): Negative Werte werden zu merkwürdigen Ergebnissen führen"
-#: builtin.c:2786
+#: builtin.c:2973
#, fuzzy, c-format
msgid "lshift(%f, %f): fractional values will be truncated"
msgstr "lshift(%lf, %lf): Dezimalteil wird abgeschnitten"
-#: builtin.c:2788
+#: builtin.c:2975
#, fuzzy, c-format
msgid "lshift(%f, %f): too large shift value will give strange results"
msgstr ""
"lshift(%lf, %lf): Zu große Shift-Werte werden zu merkwürdigen Ergebnissen "
"führen"
-#: builtin.c:2813
+#: builtin.c:3000
msgid "rshift: received non-numeric first argument"
msgstr "rshift: das erste Argument ist keine Zahl"
-#: builtin.c:2815
+#: builtin.c:3002
msgid "rshift: received non-numeric second argument"
msgstr "rshift: das zweite Argument ist keine Zahl"
-#: builtin.c:2821
+#: builtin.c:3008
#, fuzzy, c-format
msgid "rshift(%f, %f): negative values will give strange results"
msgstr ""
"rshift (%lf, %lf): Negative Werte werden zu merkwürdigen Ergebnissen führen"
-#: builtin.c:2823
+#: builtin.c:3010
#, fuzzy, c-format
msgid "rshift(%f, %f): fractional values will be truncated"
msgstr "rshift(%lf, %lf): Dezimalteil wird abgeschnitten"
-#: builtin.c:2825
+#: builtin.c:3012
#, fuzzy, c-format
msgid "rshift(%f, %f): too large shift value will give strange results"
msgstr ""
"rshift(%lf, %lf): Zu große Shift-Werte werden zu merkwürdigen Ergebnissen "
"führen"
-#: builtin.c:2850
-msgid "and: received non-numeric first argument"
-msgstr "and: das erste Argument ist keine Zahl"
+#: builtin.c:3037
+#, fuzzy
+msgid "and: called with less than two arguments"
+msgstr "sqrt: das Argument %g ist negativ"
-#: builtin.c:2852
-msgid "and: received non-numeric second argument"
-msgstr "and: das zweite Argument ist keine Zahl"
+#: builtin.c:3042
+#, fuzzy, c-format
+msgid "and: argument %d is non-numeric"
+msgstr "exp: das Argument %g liegt außerhalb des gültigen Bereichs"
-#: builtin.c:2858
+#: builtin.c:3046
#, fuzzy, c-format
-msgid "and(%f, %f): negative values will give strange results"
+msgid "and: argument %d negative value %g will give strange results"
msgstr ""
"and(%lf, %lf): Negative Werte werden zu merkwürdigen Ergebnissen führen"
-#: builtin.c:2860
-#, fuzzy, c-format
-msgid "and(%f, %f): fractional values will be truncated"
-msgstr "and(%lf, %lf): Dezimalteil wird abgeschnitten"
-
-#: builtin.c:2885
-msgid "or: received non-numeric first argument"
-msgstr "or: das erste Argument ist keine Zahl"
-
-#: builtin.c:2887
-msgid "or: received non-numeric second argument"
-msgstr "or: das zweite Argument ist keine Zahl"
+#: builtin.c:3069
+#, fuzzy
+msgid "or: called with less than two arguments"
+msgstr "sqrt: das Argument %g ist negativ"
-#: builtin.c:2893
+#: builtin.c:3074
#, fuzzy, c-format
-msgid "or(%f, %f): negative values will give strange results"
-msgstr "or(%lf, %lf): Negative Werte werden zu merkwürdigen Ergebnissen führen"
+msgid "or: argument %d is non-numeric"
+msgstr "exp: das Argument %g liegt außerhalb des gültigen Bereichs"
-#: builtin.c:2895
+#: builtin.c:3078
#, fuzzy, c-format
-msgid "or(%f, %f): fractional values will be truncated"
-msgstr "or(%lf, %lf): Dezimalteil wird abgeschnitten"
-
-#: builtin.c:2923
-msgid "xor: received non-numeric first argument"
-msgstr "xor: das erste Argument ist keine Zahl"
+msgid "or: argument %d negative value %g will give strange results"
+msgstr "compl(%lf): Negativer Wert wird zu merkwürdigen Ergebnissen führen"
-#: builtin.c:2925
-msgid "xor: received non-numeric second argument"
-msgstr "xor: das zweite Argument ist keine Zahl"
+#: builtin.c:3100
+#, fuzzy
+msgid "xor: called with less than two arguments"
+msgstr "sqrt: das Argument %g ist negativ"
-#: builtin.c:2931
+#: builtin.c:3106
#, fuzzy, c-format
-msgid "xor(%f, %f): negative values will give strange results"
-msgstr "xor(%lf, %lf: Negative Werte werden zu merkwürdigen Ergebnissen führen"
+msgid "xor: argument %d is non-numeric"
+msgstr "exp: das Argument %g liegt außerhalb des gültigen Bereichs"
-#: builtin.c:2933
+#: builtin.c:3110
#, fuzzy, c-format
-msgid "xor(%f, %f): fractional values will be truncated"
-msgstr "xor(%lf, %lf): Dezimalteil wird abgeschnitten"
+msgid "xor: argument %d negative value %g will give strange results"
+msgstr "xor(%lf, %lf: Negative Werte werden zu merkwürdigen Ergebnissen führen"
-#: builtin.c:2957 builtin.c:2963
+#: builtin.c:3135 mpfr.c:800
msgid "compl: received non-numeric argument"
msgstr "compl: das erste Argument ist keine Zahl"
-#: builtin.c:2965
+#: builtin.c:3141
#, fuzzy, c-format
msgid "compl(%f): negative value will give strange results"
msgstr "compl(%lf): Negativer Wert wird zu merkwürdigen Ergebnissen führen"
-#: builtin.c:2967
+#: builtin.c:3143
#, fuzzy, c-format
msgid "compl(%f): fractional value will be truncated"
msgstr "compl(%lf): Dezimalteil wird abgeschnitten"
-#: builtin.c:3136
+#: builtin.c:3312
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr "dcgettext: »%s« ist keine gültige Locale-Kategorie"
-#: eval.c:412
+#: command.y:225
+#, c-format
+msgid "Type (g)awk statement(s). End with the command \"end\"\n"
+msgstr ""
+
+#: command.y:289
+#, fuzzy, c-format
+msgid "invalid frame number: %d"
+msgstr "Ungültiges Bereichsende"
+
+#: command.y:295
+#, fuzzy, c-format
+msgid "info: invalid option - \"%s\""
+msgstr "%s: Ungültige Option -- »%c«\n"
+
+#: command.y:321
+#, c-format
+msgid "source \"%s\": already sourced."
+msgstr ""
+
+#: command.y:326
+#, c-format
+msgid "save \"%s\": command not permitted."
+msgstr ""
+
+#: command.y:339
+msgid "Can't use command `commands' for breakpoint/watchpoint commands"
+msgstr ""
+
+#: command.y:341
+msgid "no breakpoint/watchpoint has been set yet"
+msgstr ""
+
+#: command.y:343
+msgid "invalid breakpoint/watchpoint number"
+msgstr ""
+
+#: command.y:348
+#, c-format
+msgid "Type commands for when %s %d is hit, one per line.\n"
+msgstr ""
+
+#: command.y:350
+#, c-format
+msgid "End with the command \"end\"\n"
+msgstr ""
+
+#: command.y:357
+msgid "`end' valid only in command `commands' or `eval'"
+msgstr ""
+
+#: command.y:367
+msgid "`silent' valid only in command `commands'"
+msgstr ""
+
+#: command.y:373
+#, fuzzy, c-format
+msgid "trace: invalid option - \"%s\""
+msgstr "%s: Ungültige Option -- »%c«\n"
+
+#: command.y:387
+msgid "condition: invalid breakpoint/watchpoint number"
+msgstr ""
+
+#: command.y:449
+#, fuzzy
+msgid "argument not a string"
+msgstr "exp: das Argument %g liegt außerhalb des gültigen Bereichs"
+
+#: command.y:459 command.y:464
+#, c-format
+msgid "option: invalid parameter - \"%s\""
+msgstr ""
+
+#: command.y:474
+#, c-format
+msgid "no such function - \"%s\""
+msgstr ""
+
+#: command.y:531
+#, fuzzy, c-format
+msgid "enable: invalid option - \"%s\""
+msgstr "%s: Ungültige Option -- »%c«\n"
+
+#: command.y:597
+#, fuzzy, c-format
+msgid "invalid range specification: %d - %d"
+msgstr "Ungültiges Bereichsende"
+
+#: command.y:659
+#, fuzzy
+msgid "non-numeric value for field number"
+msgstr "unbekannter Wert für eine Feldangabe: %d\n"
+
+#: command.y:680 command.y:687
+msgid "non-numeric value found, numeric expected"
+msgstr ""
+
+#: command.y:712 command.y:718
+msgid "non-zero integer value"
+msgstr ""
+
+#: command.y:817
+msgid ""
+"backtrace [N] - print trace of all or N innermost (outermost if N < 0) "
+"frames."
+msgstr ""
+
+#: command.y:819
+msgid ""
+"break [[filename:]N|function] - set breakpoint at the specified location."
+msgstr ""
+
+#: command.y:821
+msgid "clear [[filename:]N|function] - delete breakpoints previously set."
+msgstr ""
+
+#: command.y:823
+msgid ""
+"commands [num] - starts a list of commands to be executed at a breakpoint"
+"(watchpoint) hit."
+msgstr ""
+
+#: command.y:825
+msgid "condition num [expr] - set or clear breakpoint or watchpoint condition."
+msgstr ""
+
+#: command.y:827
+msgid "continue [COUNT] - continue program being debugged."
+msgstr ""
+
+#: command.y:829
+msgid "delete [breakpoints] [range] - delete specified breakpoints."
+msgstr ""
+
+#: command.y:831
+msgid "disable [breakpoints] [range] - disable specified breakpoints."
+msgstr ""
+
+#: command.y:833
+msgid "display [var] - print value of variable each time the program stops."
+msgstr ""
+
+#: command.y:835
+msgid "down [N] - move N frames down the stack."
+msgstr ""
+
+#: command.y:837
+msgid "dump [filename] - dump instructions to file or stdout."
+msgstr ""
+
+#: command.y:839
+msgid "enable [once|del] [breakpoints] [range] - enable specified breakpoints."
+msgstr ""
+
+#: command.y:841
+msgid "end - end a list of commands or awk statements."
+msgstr ""
+
+#: command.y:843
+msgid "eval stmt|[p1, p2, ...] - evaluate awk statement(s)."
+msgstr ""
+
+#: command.y:845
+msgid "finish - execute until selected stack frame returns."
+msgstr ""
+
+#: command.y:847
+msgid "frame [N] - select and print stack frame number N."
+msgstr ""
+
+#: command.y:849
+msgid "help [command] - print list of commands or explanation of command."
+msgstr ""
+
+#: command.y:851
+msgid "ignore N COUNT - set ignore-count of breakpoint number N to COUNT."
+msgstr ""
+
+#: command.y:853
+msgid ""
+"info topic - source|sources|variables|functions|break|frame|args|locals|"
+"display|watch."
+msgstr ""
+
+#: command.y:855
+msgid "list [-|+|[filename:]lineno|function|range] - list specified line(s)."
+msgstr ""
+
+#: command.y:857
+msgid "next [COUNT] - step program, proceeding through subroutine calls."
+msgstr ""
+
+#: command.y:859
+msgid ""
+"nexti [COUNT] - step one instruction, but proceed through subroutine calls."
+msgstr ""
+
+#: command.y:861
+msgid "option [name[=value]] - set or display debugger option(s)."
+msgstr ""
+
+#: command.y:863
+msgid "print var [var] - print value of a variable or array."
+msgstr ""
+
+#: command.y:865
+msgid "printf format, [arg], ... - formatted output."
+msgstr ""
+
+#: command.y:867
+msgid "quit - exit debugger."
+msgstr ""
+
+#: command.y:869
+msgid "return [value] - make selected stack frame return to its caller."
+msgstr ""
+
+#: command.y:871
+msgid "run - start or restart executing program."
+msgstr ""
+
+#: command.y:874
+msgid "save filename - save commands from the session to file."
+msgstr ""
+
+#: command.y:877
+msgid "set var = value - assign value to a scalar variable."
+msgstr ""
+
+#: command.y:879
+msgid ""
+"silent - suspends usual message when stopped at a breakpoint/watchpoint."
+msgstr ""
+
+#: command.y:881
+msgid "source file - execute commands from file."
+msgstr ""
+
+#: command.y:883
+msgid "step [COUNT] - step program until it reaches a different source line."
+msgstr ""
+
+#: command.y:885
+msgid "stepi [COUNT] - step one instruction exactly."
+msgstr ""
+
+#: command.y:887
+msgid "tbreak [[filename:]N|function] - set a temporary breakpoint."
+msgstr ""
+
+#: command.y:889
+msgid "trace on|off - print instruction before executing."
+msgstr ""
+
+#: command.y:891
+msgid "undisplay [N] - remove variable(s) from automatic display list."
+msgstr ""
+
+#: command.y:893
+msgid ""
+"until [[filename:]N|function] - execute until program reaches a different "
+"line or line N within current frame."
+msgstr ""
+
+#: command.y:895
+msgid "unwatch [N] - remove variable(s) from watch list."
+msgstr ""
+
+#: command.y:897
+msgid "up [N] - move N frames up the stack."
+msgstr ""
+
+#: command.y:899
+msgid "watch var - set a watchpoint for a variable."
+msgstr ""
+
+#: command.y:1011 debug.c:395 msg.c:128
+#, c-format
+msgid "error: "
+msgstr "Fehler: "
+
+#: command.y:1051
+#, fuzzy, c-format
+msgid "can't read command (%s)\n"
+msgstr "Von »%s« kann nicht umgelenkt werden (%s)"
+
+#: command.y:1065
+#, fuzzy, c-format
+msgid "can't read command (%s)"
+msgstr "Von »%s« kann nicht umgelenkt werden (%s)"
+
+#: command.y:1116
+#, fuzzy
+msgid "invalid character in command"
+msgstr "Ungültiger Name für eine Zeichenklasse"
+
+#: command.y:1152
+#, c-format
+msgid "unknown command - \"%.*s\", try help"
+msgstr ""
+
+#: command.y:1222
+#, c-format
+msgid "%s"
+msgstr ""
+
+#: command.y:1284
+#, fuzzy
+msgid "invalid character"
+msgstr "Ungültiges Zeichen"
+
+#: command.y:1455
+#, c-format
+msgid "undefined command: %s\n"
+msgstr ""
+
+#: debug.c:246
+msgid "set or show the number of lines to keep in history file."
+msgstr ""
+
+#: debug.c:248
+msgid "set or show the list command window size."
+msgstr ""
+
+#: debug.c:250
+msgid "set or show gawk output file."
+msgstr ""
+
+#: debug.c:252
+msgid "set or show debugger prompt."
+msgstr ""
+
+#: debug.c:254
+msgid "(un)set or show saving of command history (value=on|off)."
+msgstr ""
+
+#: debug.c:256
+msgid "(un)set or show saving of options (value=on|off)."
+msgstr ""
+
+#: debug.c:258
+msgid "(un)set or show instruction tracing (value=on|off)."
+msgstr ""
+
+#: debug.c:339
+msgid "program not running."
+msgstr ""
+
+#: debug.c:442 debug.c:597
+#, fuzzy, c-format
+msgid "can't read source file `%s' (%s)"
+msgstr "Die Quelldatei »%s« kann nicht gelesen werden (%s)"
+
+#: debug.c:447
+#, fuzzy, c-format
+msgid "source file `%s' is empty.\n"
+msgstr "Die Quelldatei »%s« ist leer"
+
+#: debug.c:474
+msgid "no current source file."
+msgstr ""
+
+#: debug.c:499
+#, fuzzy, c-format
+msgid "cannot find source file named `%s' (%s)"
+msgstr "Die Quelldatei »%s« kann nicht gelesen werden (%s)"
+
+#: debug.c:523
+#, c-format
+msgid "WARNING: source file `%s' modified since program compilation.\n"
+msgstr ""
+
+#: debug.c:542
+#, c-format
+msgid "line number %d out of range; `%s' has %d lines"
+msgstr ""
+
+#: debug.c:602
+#, fuzzy, c-format
+msgid "unexpected eof while reading file `%s', line %d"
+msgstr "Unerwarteter Zeilenumbruch oder Ende der Zeichenkette"
+
+#: debug.c:611
+#, c-format
+msgid "source file `%s' modified since start of program execution"
+msgstr ""
+
+#: debug.c:723
+#, fuzzy, c-format
+msgid "Current source file: %s\n"
+msgstr "Quelldatei »%s« wurde bereits eingebunden"
+
+#: debug.c:724
+#, c-format
+msgid "Number of lines: %d\n"
+msgstr ""
+
+#: debug.c:731
+#, c-format
+msgid "Source file (lines): %s (%d)\n"
+msgstr ""
+
+#: debug.c:745
+msgid ""
+"Number Disp Enabled Location\n"
+"\n"
+msgstr ""
+
+#: debug.c:756
+#, c-format
+msgid "\tno of hits = %ld\n"
+msgstr ""
+
+#: debug.c:758
+#, c-format
+msgid "\tignore next %ld hit(s)\n"
+msgstr ""
+
+#: debug.c:760 debug.c:900
+#, c-format
+msgid "\tstop condition: %s\n"
+msgstr ""
+
+#: debug.c:762 debug.c:902
+msgid "\tcommands:\n"
+msgstr ""
+
+#: debug.c:784
+#, c-format
+msgid "Current frame: "
+msgstr ""
+
+#: debug.c:787
+#, c-format
+msgid "Called by frame: "
+msgstr ""
+
+#: debug.c:791
+#, c-format
+msgid "Caller of frame: "
+msgstr ""
+
+#: debug.c:809
+#, c-format
+msgid "None in main().\n"
+msgstr ""
+
+#: debug.c:839
+#, fuzzy
+msgid "No arguments.\n"
+msgstr "printf: Keine Argumente"
+
+#: debug.c:840
+msgid "No locals.\n"
+msgstr ""
+
+#: debug.c:848
+msgid ""
+"All defined variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:858
+msgid ""
+"All defined functions:\n"
+"\n"
+msgstr ""
+
+#: debug.c:877
+msgid ""
+"Auto-display variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:880
+msgid ""
+"Watch variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:1020
+#, fuzzy, c-format
+msgid "no symbol `%s' in current context\n"
+msgstr "»exit« kann im aktuellen Kontext nicht aufgerufen werden"
+
+#: debug.c:1032 debug.c:1416
+#, fuzzy, c-format
+msgid "`%s' is not an array\n"
+msgstr "»%s« ist kein gültiger Variablenname"
+
+#: debug.c:1046
+#, fuzzy, c-format
+msgid "$%ld = uninitialized field\n"
+msgstr "Referenz auf das nicht initialisierte Feld »$%d«"
+
+#: debug.c:1067
+#, fuzzy, c-format
+msgid "array `%s' is empty\n"
+msgstr "Die Datei »%s« ist leer"
+
+#: debug.c:1110 debug.c:1162
+#, fuzzy, c-format
+msgid "[\"%s\"] not in array `%s'\n"
+msgstr "delete: Index »%s« ist in Feld »%s« nicht vorhanden"
+
+#: debug.c:1166
+#, c-format
+msgid "`%s[\"%s\"]' is not an array\n"
+msgstr ""
+
+#: debug.c:1227 debug.c:4947
+#, fuzzy, c-format
+msgid "`%s' is not a scalar variable"
+msgstr "»%s« ist kein gültiger Variablenname"
+
+#: debug.c:1249 debug.c:4977
+#, fuzzy, c-format
+msgid "attempt to use array `%s[\"%s\"]' in a scalar context"
+msgstr ""
+"Es wird versucht, das Feld »%s[\"%.*s\"]« in einem Skalarkontext zu verwenden"
+
+#: debug.c:1269 debug.c:4988
+#, fuzzy, c-format
+msgid "attempt to use scalar `%s[\"%s\"]' as array"
+msgstr "Es wird versucht, den Skalar »%s[\"%.*s\"]« als Feld zu verwenden"
+
+#: debug.c:1412
+#, fuzzy, c-format
+msgid "`%s' is a function"
+msgstr "»%s« ist ein unzulässiger Funktionsname"
+
+#: debug.c:1454
+#, c-format
+msgid "watchpoint %d is unconditional\n"
+msgstr ""
+
+#: debug.c:1488
+#, c-format
+msgid "No display item numbered %ld"
+msgstr ""
+
+#: debug.c:1491
+#, c-format
+msgid "No watch item numbered %ld"
+msgstr ""
+
+#: debug.c:1517
+#, fuzzy, c-format
+msgid "%d: [\"%s\"] not in array `%s'\n"
+msgstr "delete: Index »%s« ist in Feld »%s« nicht vorhanden"
+
+#: debug.c:1756
+#, fuzzy
+msgid "attempt to use scalar value as array"
+msgstr "Es wird versucht, einen Skalar als Feld zu verwenden"
+
+#: debug.c:1845
+#, c-format
+msgid "Watchpoint %d deleted because parameter is out of scope.\n"
+msgstr ""
+
+#: debug.c:1856
+#, c-format
+msgid "Display %d deleted because parameter is out of scope.\n"
+msgstr ""
+
+#: debug.c:1889
+#, c-format
+msgid " in file `%s', line %d\n"
+msgstr ""
+
+#: debug.c:1910
+#, c-format
+msgid " at `%s':%d"
+msgstr ""
+
+#: debug.c:1926 debug.c:1989
+#, c-format
+msgid "#%ld\tin "
+msgstr ""
+
+#: debug.c:1963
+#, c-format
+msgid "More stack frames follow ...\n"
+msgstr ""
+
+#: debug.c:2006
+#, fuzzy
+msgid "invalid frame number"
+msgstr "Ungültiges Bereichsende"
+
+#: debug.c:2178
+#, c-format
+msgid "Note: breakpoint %d (enabled, ignore next %ld hits), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2185
+#, c-format
+msgid "Note: breakpoint %d (enabled), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2192
+#, c-format
+msgid "Note: breakpoint %d (disabled, ignore next %ld hits), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2199
+#, c-format
+msgid "Note: breakpoint %d (disabled), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2216
+#, c-format
+msgid "Breakpoint %d set at file `%s', line %d\n"
+msgstr ""
+
+#: debug.c:2318
+#, c-format
+msgid "Can't set breakpoint in file `%s'\n"
+msgstr ""
+
+#: debug.c:2347 debug.c:2470 debug.c:3328
+#, fuzzy, c-format
+msgid "line number %d in file `%s' out of range"
+msgstr "exp: das Argument %g liegt außerhalb des gültigen Bereichs"
+
+#: debug.c:2351
+#, c-format
+msgid "Can't find rule!!!\n"
+msgstr ""
+
+#: debug.c:2353
+#, c-format
+msgid "Can't set breakpoint at `%s':%d\n"
+msgstr ""
+
+#: debug.c:2365
+#, c-format
+msgid "Can't set breakpoint in function `%s'\n"
+msgstr ""
+
+#: debug.c:2381
+#, c-format
+msgid "breakpoint %d set at file `%s', line %d is unconditional\n"
+msgstr ""
+
+#: debug.c:2486 debug.c:2508
+#, c-format
+msgid "Deleted breakpoint %d"
+msgstr ""
+
+#: debug.c:2492
+#, c-format
+msgid "No breakpoint(s) at entry to function `%s'\n"
+msgstr ""
+
+#: debug.c:2519
+#, fuzzy, c-format
+msgid "No breakpoint at file `%s', line #%d\n"
+msgstr "Fehler beim Lesen der Eingabedatei »%s«: %s"
+
+#: debug.c:2574 debug.c:2615 debug.c:2635 debug.c:2678
+msgid "invalid breakpoint number"
+msgstr ""
+
+#: debug.c:2590
+msgid "Delete all breakpoints? (y or n) "
+msgstr ""
+
+#: debug.c:2591 debug.c:2901 debug.c:2954
+msgid "y"
+msgstr ""
+
+#: debug.c:2640
+#, c-format
+msgid "Will ignore next %ld crossing(s) of breakpoint %d.\n"
+msgstr ""
+
+#: debug.c:2644
+#, c-format
+msgid "Will stop next time breakpoint %d is reached.\n"
+msgstr ""
+
+#: debug.c:2761
+#, c-format
+msgid "Can only debug programs provided with the `-f' option.\n"
+msgstr ""
+
+#: debug.c:2886
+#, c-format
+msgid "Failed to restart debugger"
+msgstr ""
+
+#: debug.c:2900
+msgid "Program already running. Restart from beginning (y/n)? "
+msgstr ""
+
+#: debug.c:2904
+#, c-format
+msgid "Program not restarted\n"
+msgstr ""
+
+#: debug.c:2914
+#, c-format
+msgid "error: cannot restart, operation not allowed\n"
+msgstr ""
+
+#: debug.c:2920
+#, c-format
+msgid "error (%s): cannot restart, ignoring rest of the commands\n"
+msgstr ""
+
+#: debug.c:2928
+#, c-format
+msgid "Starting program: \n"
+msgstr ""
+
+#: debug.c:2937
+#, c-format
+msgid "Program exited %s with exit value: %d\n"
+msgstr ""
+
+#: debug.c:2953
+msgid "The program is running. Exit anyway (y/n)? "
+msgstr ""
+
+#: debug.c:2988
+#, c-format
+msgid "Not stopped at any breakpoint; argument ignored.\n"
+msgstr ""
+
+#: debug.c:2993
+#, c-format
+msgid "invalid breakpoint number %d."
+msgstr ""
+
+#: debug.c:2998
+#, c-format
+msgid "Will ignore next %ld crossings of breakpoint %d.\n"
+msgstr ""
+
+#: debug.c:3185
+#, c-format
+msgid "'finish' not meaningful in the outermost frame main()\n"
+msgstr ""
+
+#: debug.c:3190
+#, c-format
+msgid "Run till return from "
+msgstr ""
+
+#: debug.c:3233
+#, c-format
+msgid "'return' not meaningful in the outermost frame main()\n"
+msgstr ""
+
+#: debug.c:3347
+#, c-format
+msgid "Can't find specified location in function `%s'\n"
+msgstr ""
+
+#: debug.c:3355
+#, fuzzy, c-format
+msgid "invalid source line %d in file `%s'"
+msgstr "Quelldatei »%s« wurde bereits eingebunden"
+
+#: debug.c:3370
+#, c-format
+msgid "Can't find specified location %d in file `%s'\n"
+msgstr ""
+
+#: debug.c:3402
+#, fuzzy, c-format
+msgid "element not in array\n"
+msgstr "delete: Index »%s« ist in Feld »%s« nicht vorhanden"
+
+#: debug.c:3402
+#, c-format
+msgid "untyped variable\n"
+msgstr ""
+
+#: debug.c:3444
+#, c-format
+msgid "Stopping in %s ...\n"
+msgstr ""
+
+#: debug.c:3521
+#, c-format
+msgid "'finish' not meaningful with non-local jump '%s'\n"
+msgstr ""
+
+#: debug.c:3528
+#, c-format
+msgid "'until' not meaningful with non-local jump '%s'\n"
+msgstr ""
+
+#: debug.c:4163
+msgid "\t------[Enter] to continue or q [Enter] to quit------"
+msgstr ""
+
+#: debug.c:4164
+msgid "q"
+msgstr ""
+
+#: debug.c:4984
+#, fuzzy, c-format
+msgid "[\"%s\"] not in array `%s'"
+msgstr "delete: Index »%s« ist in Feld »%s« nicht vorhanden"
+
+#: debug.c:5190
+#, c-format
+msgid "sending output to stdout\n"
+msgstr ""
+
+#: debug.c:5230
+msgid "invalid number"
+msgstr ""
+
+#: debug.c:5362
+#, fuzzy, c-format
+msgid "`%s' not allowed in current context; statement ignored"
+msgstr "»exit« kann im aktuellen Kontext nicht aufgerufen werden"
+
+#: debug.c:5370
+#, fuzzy
+msgid "`return' not allowed in current context; statement ignored"
+msgstr "»exit« kann im aktuellen Kontext nicht aufgerufen werden"
+
+#: debug.c:5571
+#, c-format
+msgid "No symbol `%s' in current context"
+msgstr ""
+
+#: dfa.c:984 dfa.c:987 dfa.c:1007 dfa.c:1017 dfa.c:1029 dfa.c:1080 dfa.c:1089
+#: dfa.c:1092 dfa.c:1097 dfa.c:1110 dfa.c:1178
+msgid "unbalanced ["
+msgstr ""
+
+#: dfa.c:1038
+#, fuzzy
+msgid "invalid character class"
+msgstr "Ungültiger Name für eine Zeichenklasse"
+
+#: dfa.c:1215
+msgid "character class syntax is [[:space:]], not [:space:]"
+msgstr ""
+
+#: dfa.c:1267
+msgid "unfinished \\ escape"
+msgstr ""
+
+#: dfa.c:1414 regcomp.c:161
+msgid "Invalid content of \\{\\}"
+msgstr "Ungültiger Inhalt von \\{\\}"
+
+#: dfa.c:1417 regcomp.c:176
+msgid "Regular expression too big"
+msgstr "Regulärer Ausdruck ist zu groß"
+
+#: dfa.c:1802
+msgid "unbalanced ("
+msgstr ""
+
+#: dfa.c:1929
+msgid "no syntax specified"
+msgstr ""
+
+#: dfa.c:1937
+msgid "unbalanced )"
+msgstr ""
+
+#: eval.c:394
#, c-format
msgid "unknown nodetype %d"
msgstr "Unbekannter Knotentyp %d"
-#: eval.c:423 eval.c:437
+#: eval.c:405 eval.c:419
#, c-format
msgid "unknown opcode %d"
msgstr "Unbekannter Opcode %d"
-#: eval.c:434
+#: eval.c:416
#, c-format
msgid "opcode %s not an operator or keyword"
msgstr "Opcode %s ist weder ein Operator noch ein Schlüsselwort"
-#: eval.c:488
+#: eval.c:471
msgid "buffer overflow in genflags2str"
msgstr "Pufferüberlauf in genflags2str"
-#: eval.c:698
+#: eval.c:674
#, c-format
msgid ""
"\n"
@@ -1009,319 +1858,545 @@ msgstr ""
"\t# Funktions-Aufruf-Stack\n"
"\n"
-#: eval.c:725
+#: eval.c:703
msgid "`IGNORECASE' is a gawk extension"
msgstr "»IGNORECASE« ist eine gawk-Erweiterung"
-#: eval.c:754
+#: eval.c:735
msgid "`BINMODE' is a gawk extension"
msgstr "»BINMODE« ist eine gawk-Erweiterung"
-#: eval.c:812
+#: eval.c:792
#, c-format
msgid "BINMODE value `%s' is invalid, treated as 3"
msgstr "BINMODE Wert »%s« ist ungültig und wird als 3 behandelt"
-#: eval.c:902
+#: eval.c:884
#, c-format
msgid "bad `%sFMT' specification `%s'"
msgstr "Falsche »%sFMT«-Angabe »%s«"
-#: eval.c:980
+#: eval.c:968
msgid "turning off `--lint' due to assignment to `LINT'"
msgstr "»--lint« wird abgeschaltet, da an »LINT« zugewiesen wird"
-#: eval.c:1127 eval.c:1777
-#, c-format
-msgid "can't use function name `%s' as variable or array"
-msgstr "Funktion »%s« kann nicht als Variable oder Feld verwendet werden"
-
-#: eval.c:1158 eval.c:1789 eval.c:1802
+#: eval.c:1144
#, c-format
msgid "reference to uninitialized argument `%s'"
msgstr "Referenz auf nicht initialisiertes Argument »%s«"
-#: eval.c:1177
+#: eval.c:1145
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "Referenz auf die nicht initialisierte Variable »%s«"
+
+#: eval.c:1163
msgid "attempt to field reference from non-numeric value"
msgstr "Nicht numerischer Wert für Feldreferenz verwendet"
-#: eval.c:1179
+#: eval.c:1165
msgid "attempt to field reference from null string"
msgstr "Referenz auf ein Feld von einem Null-String"
-#: eval.c:1185
+#: eval.c:1173
#, c-format
msgid "attempt to access field %ld"
msgstr "Versuch des Zugriffs auf Feld %ld"
-#: eval.c:1194
+#: eval.c:1182
#, c-format
msgid "reference to uninitialized field `$%ld'"
msgstr "Referenz auf das nicht initialisierte Feld »$%ld«"
-#: eval.c:1256
+#: eval.c:1269
#, c-format
msgid "function `%s' called with more arguments than declared"
msgstr "Funktion »%s« mit zu vielen Argumenten aufgerufen"
-#: eval.c:1437
+#: eval.c:1464
#, c-format
msgid "unwind_stack: unexpected type `%s'"
msgstr "unwind_stack: unerwarteter Typ »%s«"
-#: eval.c:1532
+#: eval.c:1558
msgid "division by zero attempted in `/='"
msgstr "Division durch Null versucht in »/=«"
-#: eval.c:1539
+#: eval.c:1565
#, c-format
msgid "division by zero attempted in `%%='"
msgstr "Division durch Null versucht in »%%=«"
-#: eval.c:1876 eval.c:2122
-#, c-format
-msgid "attempt to use array `%s[\"%.*s\"]' in a scalar context"
-msgstr ""
-"Es wird versucht, das Feld »%s[\"%.*s\"]« in einem Skalarkontext zu verwenden"
-
-#: eval.c:1907
-msgid "assignment used in conditional context"
-msgstr "Zuweisung in einer Bedingung"
-
-#: eval.c:1911
-msgid "statement has no effect"
-msgstr "Anweisung hat keinen Effekt"
-
-#: eval.c:2343
-#, c-format
-msgid "for loop: array `%s' changed size from %ld to %ld during loop execution"
-msgstr ""
-"for-Schleife: Feld »%s« ändert seine Größe von %ld innerhalb der Schleife zu "
-"%ld"
-
-#: eval.c:2458
-#, c-format
-msgid "function called indirectly through `%s' does not exist"
-msgstr "die durch »%s« indirekt aufgerufene Funktion existiert nicht"
-
-#: eval.c:2470
-#, c-format
-msgid "function `%s' not defined"
-msgstr "Funktion »%s« ist nicht definiert"
-
-#: eval.c:2511
-#, c-format
-msgid "non-redirected `getline' invalid inside `%s' rule"
-msgstr "Nicht umgelenktes »getline« ist innerhalb der »%s«-Aktion unzuässig"
-
-#: eval.c:2600
-#, c-format
-msgid "error reading input file `%s': %s"
-msgstr "Fehler beim Lesen der Eingabedatei »%s«: %s"
-
-#: eval.c:2614
-#, c-format
-msgid "`nextfile' cannot be called from a `%s' rule"
-msgstr "»nextfile« kann nicht aus einer »«%s-Regel aufgerufen werden"
-
-#: eval.c:2661
-msgid "`exit' cannot be called in the current context"
-msgstr "»exit« kann im aktuellen Kontext nicht aufgerufen werden"
-
-#: eval.c:2700
-#, c-format
-msgid "`next' cannot be called from a `%s' rule"
-msgstr "»next« kann nicht in einer »%s«-Regel verwendet werden"
-
-#: eval.c:2766
-#, c-format
-msgid "Sorry, don't know how to interpret `%s'"
-msgstr "Entschuldigung, aber es ist unbekannt, wie »%s« zu interpretieren ist"
-
-#: ext.c:54
+#: ext.c:49
msgid "extensions are not allowed in sandbox mode"
msgstr "Erweiterungen sind im Sandbox-Modus nicht erlaubt"
-#: ext.c:60 ext.c:65
-msgid "`extension' is a gawk extension"
-msgstr "»extension« ist eine gawk-Erweiterung"
+#: ext.c:52
+#, fuzzy
+msgid "-l / @load are gawk extensions"
+msgstr "»@include« ist eine gawk-Erweiterung"
-#: ext.c:75
-#, c-format
-msgid "fatal: extension: cannot open `%s' (%s)\n"
+#: ext.c:55
+msgid "load_ext: received NULL lib_name"
+msgstr ""
+
+#: ext.c:58
+#, fuzzy, c-format
+msgid "load_ext: cannot open library `%s' (%s)\n"
msgstr "Fatal: extension: »%s« kann nicht geöffnet werden (%s)\n"
-#: ext.c:84
-#, c-format
+#: ext.c:64
+#, fuzzy, c-format
msgid ""
-"fatal: extension: library `%s': does not define "
-"`plugin_is_GPL_compatible' (%s)\n"
+"load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n"
msgstr ""
"Fatal: Erweiterung: Bibliothek »%s«: definiert »plugin_is_GPL_compatible« "
"nicht (%s)\n"
-#: ext.c:93
-#, c-format
-msgid "fatal: extension: library `%s': cannot call function `%s' (%s)\n"
+#: ext.c:70
+#, fuzzy, c-format
+msgid "load_ext: library `%s': cannot call function `%s' (%s)\n"
msgstr ""
"Fatal: Erweiterung: Bibliothek »%s«: Funktion »%s« kann nicht aufgerufen "
"werden (%s)\n"
-#: ext.c:127
-msgid "extension: missing function name"
+#: ext.c:74
+#, c-format
+msgid "load_ext: library `%s' initialization routine `%s' failed\n"
+msgstr ""
+
+#: ext.c:93
+#, fuzzy
+msgid "make_builtin: missing function name"
msgstr "Erweiterung: Funktionsname fehlt"
-#: ext.c:132
-#, c-format
-msgid "extension: illegal character `%c' in function name `%s'"
+#: ext.c:98
+#, fuzzy, c-format
+msgid "make_builtin: illegal character `%c' in function name `%s'"
msgstr "Erweiterung: unzulässiges Zeichen »%c« in Funktionsname »%s«"
-#: ext.c:141
-#, c-format
-msgid "extension: can't redefine function `%s'"
+#: ext.c:106
+#, fuzzy, c-format
+msgid "make_builtin: can't redefine function `%s'"
msgstr "Erweiterung: Funktion »%s« kann nicht neu definiert werden"
-#: ext.c:145
-#, c-format
-msgid "extension: function `%s' already defined"
+#: ext.c:110
+#, fuzzy, c-format
+msgid "make_builtin: function `%s' already defined"
msgstr "Erweiterung: Funktion »%s« wurde bereits definiert"
-#: ext.c:150
-#, c-format
-msgid "extension: function name `%s' previously defined"
+#: ext.c:114
+#, fuzzy, c-format
+msgid "make_builtin: function name `%s' previously defined"
msgstr "Erweiterung: Funktion »%s« wurde bereits vorher definiert"
-#: ext.c:152
-#, c-format
-msgid "extension: can't use gawk built-in `%s' as function name"
+#: ext.c:116
+#, fuzzy, c-format
+msgid "make_builtin: can't use gawk built-in `%s' as function name"
msgstr ""
"Erweiterung: die eingebaute Funktion »%s« kann nicht als Funktionsname "
"verwendet werden"
-#: ext.c:156
+#: ext.c:119
#, c-format
msgid "make_builtin: negative argument count for function `%s'"
msgstr "make_builtin: negative Anzahl von Argumenten für Funktion »%s«"
-#: ext.c:259
+#: ext.c:183
#, c-format
msgid "function `%s' defined to take no more than %d argument(s)"
msgstr ""
"Funktion »%s« wird als Funktion definiert, die nie mehr als %d Argument(e) "
"akzeptiert"
-#: ext.c:262
+#: ext.c:186
#, c-format
msgid "function `%s': missing argument #%d"
msgstr "Funktion »%s«: fehlendes Argument #%d"
-#: ext.c:279
+#: ext.c:203
#, c-format
msgid "function `%s': argument #%d: attempt to use scalar as an array"
msgstr ""
"Funktion »%s«: Argument #%d: Es wird versucht, einen Skalar als Feld zu "
"verwenden"
-#: ext.c:283
+#: ext.c:207
#, c-format
msgid "function `%s': argument #%d: attempt to use array as a scalar"
msgstr ""
"Funktion »%s«: Argument #%d: Es wird versucht, ein Feld als Skalar zu "
"verwenden"
-#: ext.c:296
-msgid "Operation Not Supported"
-msgstr "Die Operation wird nicht unterstützt"
+#: ext.c:221
+msgid "dynamic loading of library not supported"
+msgstr ""
+
+#: extension/filefuncs.c:75
+#, fuzzy
+msgid "chdir: called with incorrect number of arguments, expecting 1"
+msgstr "sqrt: das Argument %g ist negativ"
+
+#: extension/filefuncs.c:348
+#, fuzzy
+msgid "stat: called with wrong number of arguments"
+msgstr "sqrt: das Argument %g ist negativ"
+
+#: extension/filefuncs.c:355
+#, fuzzy
+msgid "stat: bad parameters"
+msgstr "%s: ist ein Parameter\n"
+
+#: extension/filefuncs.c:421
+msgid "fill_stat_element: could not create array"
+msgstr ""
+
+#: extension/filefuncs.c:430
+msgid "fill_stat_element: could not set element"
+msgstr ""
+
+#: extension/filefuncs.c:445
+#, fuzzy
+msgid "fill_path_element: could not set element"
+msgstr "index: Zweites Argument ist kein string"
+
+#: extension/filefuncs.c:461
+msgid "fill_error_element: could not set element"
+msgstr ""
+
+#: extension/filefuncs.c:508 extension/filefuncs.c:555
+msgid "fts-process: could not create array"
+msgstr ""
+
+#: extension/filefuncs.c:518 extension/filefuncs.c:565
+#: extension/filefuncs.c:583
+#, fuzzy
+msgid "fts-process: could not set element"
+msgstr "index: Zweites Argument ist kein string"
+
+#: extension/filefuncs.c:632
+#, fuzzy
+msgid "fts: called with incorrect number of arguments, expecting 3"
+msgstr "sqrt: das Argument %g ist negativ"
+
+#: extension/filefuncs.c:635
+#, fuzzy
+msgid "fts: bad first parameter"
+msgstr "%s: ist ein Parameter\n"
+
+#: extension/filefuncs.c:641
+#, fuzzy
+msgid "fts: bad second parameter"
+msgstr "%s: ist ein Parameter\n"
+
+#: extension/filefuncs.c:647
+#, fuzzy
+msgid "fts: bad third parameter"
+msgstr "%s: ist ein Parameter\n"
+
+#: extension/filefuncs.c:654
+#, fuzzy
+msgid "fts: could not flatten array\n"
+msgstr "»%s« ist kein gültiger Variablenname"
+
+#: extension/filefuncs.c:672
+msgid "fts: ignoring sneaky FTS_NOSTAT flag. nyah, nyah, nyah."
+msgstr ""
+
+#: extension/filefuncs.c:689
+msgid "fts: clear_array failed\n"
+msgstr ""
+
+#: extension/fnmatch.c:91
+#, fuzzy
+msgid "fnmatch: called with less than three arguments"
+msgstr "sqrt: das Argument %g ist negativ"
+
+#: extension/fnmatch.c:94
+#, fuzzy
+msgid "fnmatch: called with more than three arguments"
+msgstr "sqrt: das Argument %g ist negativ"
+
+#: extension/fnmatch.c:97
+#, fuzzy
+msgid "fnmatch: could not get first argument"
+msgstr "strftime: Das erste Argument ist kein String"
+
+#: extension/fnmatch.c:102
+#, fuzzy
+msgid "fnmatch: could not get second argument"
+msgstr "index: Zweites Argument ist kein string"
+
+#: extension/fnmatch.c:107
+msgid "fnmatch: could not get third argument"
+msgstr ""
+
+#: extension/fnmatch.c:120
+msgid "fnmatch is not implemented on this system\n"
+msgstr ""
+
+#: extension/fnmatch.c:152
+msgid "fnmatch init: could not add FNM_NOMATCH variable"
+msgstr ""
+
+#: extension/fnmatch.c:162
+#, c-format
+msgid "fnmatch init: could not set array element %s"
+msgstr ""
+
+#: extension/fnmatch.c:172
+msgid "fnmatch init: could not install FNM array"
+msgstr ""
+
+#: extension/fork.c:81
+#, fuzzy
+msgid "fork: called with too many arguments"
+msgstr "sqrt: das Argument %g ist negativ"
+
+#: extension/fork.c:94
+msgid "fork: PROCINFO is not an array!"
+msgstr ""
+
+#: extension/fork.c:118
+#, fuzzy
+msgid "waitpid: called with too many arguments"
+msgstr "sqrt: das Argument %g ist negativ"
+
+#: extension/fork.c:126
+#, fuzzy
+msgid "wait: called with no arguments"
+msgstr "sqrt: das Argument %g ist negativ"
+
+#: extension/fork.c:143
+#, fuzzy
+msgid "wait: called with too many arguments"
+msgstr "sqrt: das Argument %g ist negativ"
+
+#: extension/ordchr.c:69
+#, fuzzy
+msgid "ord: called with too many arguments"
+msgstr "sqrt: das Argument %g ist negativ"
+
+#: extension/ordchr.c:75
+#, fuzzy
+msgid "ord: called with no arguments"
+msgstr "sqrt: das Argument %g ist negativ"
+
+#: extension/ordchr.c:77
+#, fuzzy
+msgid "ord: called with inappropriate argument(s)"
+msgstr "sqrt: das Argument %g ist negativ"
+
+#: extension/ordchr.c:99
+#, fuzzy
+msgid "chr: called with too many arguments"
+msgstr "sqrt: das Argument %g ist negativ"
+
+#: extension/ordchr.c:109
+#, fuzzy
+msgid "chr: called with no arguments"
+msgstr "sqrt: das Argument %g ist negativ"
+
+#: extension/ordchr.c:111
+#, fuzzy
+msgid "chr: called with inappropriate argument(s)"
+msgstr "sqrt: das Argument %g ist negativ"
+
+#: extension/readfile.c:81
+#, fuzzy
+msgid "readfile: called with too many arguments"
+msgstr "sqrt: das Argument %g ist negativ"
+
+#: extension/readfile.c:114
+#, fuzzy
+msgid "readfile: called with no arguments"
+msgstr "sqrt: das Argument %g ist negativ"
+
+#: extension/rwarray.c:120
+#, fuzzy
+msgid "writea: called with too many arguments"
+msgstr "sqrt: das Argument %g ist negativ"
+
+#: extension/rwarray.c:127
+#, fuzzy, c-format
+msgid "do_writea: argument 0 is not a string\n"
+msgstr "exp: das Argument %g liegt außerhalb des gültigen Bereichs"
+
+#: extension/rwarray.c:133
+#, fuzzy, c-format
+msgid "do_writea: argument 1 is not an array\n"
+msgstr "split: das vierte Argument ist kein Feld"
+
+#: extension/rwarray.c:180
+#, c-format
+msgid "write_array: could not flatten array\n"
+msgstr ""
+
+#: extension/rwarray.c:194
+#, c-format
+msgid "write_array: could not release flattened array\n"
+msgstr ""
-#: field.c:328
+#: extension/rwarray.c:276
+#, fuzzy
+msgid "reada: called with too many arguments"
+msgstr "sqrt: das Argument %g ist negativ"
+
+#: extension/rwarray.c:283
+#, fuzzy, c-format
+msgid "do_reada: argument 0 is not a string\n"
+msgstr "exp: das Argument %g liegt außerhalb des gültigen Bereichs"
+
+#: extension/rwarray.c:289
+#, fuzzy, c-format
+msgid "do_reada: argument 1 is not an array\n"
+msgstr "match: das dritte Argument ist kein Array"
+
+#: extension/rwarray.c:333
+#, c-format
+msgid "do_reada: clear_array failed\n"
+msgstr ""
+
+#: extension/rwarray.c:370
+#, c-format
+msgid "read_array: set_array_element failed\n"
+msgstr ""
+
+#: extension/time.c:78
+#, fuzzy
+msgid "gettimeofday: ignoring arguments"
+msgstr "mktime: Das Argument ist kein String"
+
+#: extension/time.c:109
+msgid "gettimeofday: not supported on this platform"
+msgstr ""
+
+#: extension/time.c:130
+#, fuzzy
+msgid "sleep: called with too many arguments"
+msgstr "sqrt: das Argument %g ist negativ"
+
+#: extension/time.c:133
+#, fuzzy
+msgid "sleep: missing required numeric argument"
+msgstr "exp: das Argument ist keine Zahl"
+
+#: extension/time.c:139
+#, fuzzy
+msgid "sleep: argument is negative"
+msgstr "exp: das Argument %g liegt außerhalb des gültigen Bereichs"
+
+#: extension/time.c:166
+msgid "sleep: not supported on this platform"
+msgstr ""
+
+#: field.c:339
msgid "NF set to negative value"
msgstr "NF wird ein negativer Wert zugewiesen"
-#: field.c:951 field.c:958 field.c:962
+#: field.c:962 field.c:969 field.c:973
msgid "split: fourth argument is a gawk extension"
msgstr "split: das vierte Argument ist eine gawk-Erweiterung"
-#: field.c:955
+#: field.c:966
msgid "split: fourth argument is not an array"
msgstr "split: das vierte Argument ist kein Feld"
-#: field.c:969
+#: field.c:980
msgid "split: second argument is not an array"
msgstr "split: das zweite Argument ist kein Feld"
-#: field.c:973
+#: field.c:984
msgid "split: cannot use the same array for second and fourth args"
msgstr ""
"split: als zweites und viertes Argument kann nicht das gleiche Feld "
"verwendet werden"
-#: field.c:978
+#: field.c:989
msgid "split: cannot use a subarray of second arg for fourth arg"
msgstr ""
"split: Ein untergeordnetes Feld des zweiten Arguments kann nicht als viertes "
"Argument verwendet werden"
-#: field.c:981
+#: field.c:992
msgid "split: cannot use a subarray of fourth arg for second arg"
msgstr ""
"split: Ein untergeordnetes Feld des vierten Arguments kann nicht als zweites "
"Argument verwendet werden"
-#: field.c:1010
+#: field.c:1021
msgid "split: null string for third arg is a gawk extension"
msgstr "split: Null-String als drittes Argument ist eine gawk-Erweiterung"
-#: field.c:1050
+#: field.c:1061
msgid "patsplit: fourth argument is not an array"
msgstr "patsplit: Das vierte Argument ist kein Feld"
-#: field.c:1055
+#: field.c:1066
msgid "patsplit: second argument is not an array"
msgstr "patsplit: Das zweite Argument ist kein Feld"
-#: field.c:1061
+#: field.c:1072
msgid "patsplit: third argument must be non-null"
msgstr "patsplit: Das dritte Argument darf nicht Null sein"
-#: field.c:1065
+#: field.c:1076
msgid "patsplit: cannot use the same array for second and fourth args"
msgstr ""
"patsplit: als zweites und viertes Argument kann nicht das gleiche Feld "
"verwendet werden"
-#: field.c:1070
+#: field.c:1081
msgid "patsplit: cannot use a subarray of second arg for fourth arg"
msgstr ""
"patsplit: Ein untergeordnetes Feld des zweiten Arguments kann nicht als "
"viertes Argument verwendet werden"
-#: field.c:1073
+#: field.c:1084
msgid "patsplit: cannot use a subarray of fourth arg for second arg"
msgstr ""
"patsplit: Ein untergeordnetes Feld des vierten Arguments kann nicht als "
"zweites Argument verwendet werden"
-#: field.c:1110
+#: field.c:1122
msgid "`FIELDWIDTHS' is a gawk extension"
msgstr "»FIELDWIDTHS« ist eine gawk-Erweiterung"
-#: field.c:1173
+#: field.c:1186
#, c-format
msgid "invalid FIELDWIDTHS value, near `%s'"
msgstr "ungültiger FIELDWIDTHS-Wert nah bei »%s«"
-#: field.c:1246
+#: field.c:1259
msgid "null string for `FS' is a gawk extension"
msgstr "Null-String für »FS« ist eine gawk-Erweiterung"
-#: field.c:1250
+#: field.c:1263
msgid "old awk does not support regexps as value of `FS'"
msgstr "Das alte awk unterstützt keine regulären Ausdrücke als Wert von »FS«"
-#: field.c:1369
+#: field.c:1382
msgid "`FPAT' is a gawk extension"
msgstr "»FPAT« ist eine gawk-Erweiterung"
+#: gawkapi.c:143
+msgid "awk_value_to_node: received null retval"
+msgstr ""
+
+#: gawkapi.c:932
+#, c-format
+msgid "api_flatten_array: could not convert index %d\n"
+msgstr ""
+
+#: gawkapi.c:937
+#, c-format
+msgid "api_flatten_array: could not convert value %d\n"
+msgstr ""
+
+#: gawkapi.c:1111
+msgid "cannot assign to defined constant"
+msgstr ""
+
#: getopt.c:604 getopt.c:633
#, fuzzy, c-format
msgid "%s: option '%s' is ambiguous; possibilities:"
@@ -1377,480 +2452,544 @@ msgstr "%s: Die Option »-W %s« hat keine Argumente\n"
msgid "%s: option '-W %s' requires an argument\n"
msgstr "%s: Die Option »-W %s« erfordert ein Argument\n"
-#: io.c:280
+#: io.c:339
#, c-format
msgid "command line argument `%s' is a directory: skipped"
msgstr ""
"das Kommandozeilen-Argument »%s« ist ein Verzeichnis: wird übersprungen"
-#: io.c:283 io.c:385
+#: io.c:342 io.c:455
#, c-format
msgid "cannot open file `%s' for reading (%s)"
msgstr "Die Datei »%s« kann nicht zum Lesen geöffnet werden (%s)"
-#: io.c:501
+#: io.c:582
#, c-format
msgid "close of fd %d (`%s') failed (%s)"
msgstr "Das Schließen des Dateideskriptors %d (»%s«) ist gescheitert (%s)"
-#: io.c:578
+#: io.c:658
msgid "redirection not allowed in sandbox mode"
msgstr "Umlenkungen sind im Sandbox-Modus nicht erlaubt"
-#: io.c:612
+#: io.c:692
#, c-format
msgid "expression in `%s' redirection only has numeric value"
msgstr ""
"Der Ausdruck in einer Umlenkung mittels »%s« hat nur einen numerischen Wert"
-#: io.c:618
+#: io.c:698
#, c-format
msgid "expression for `%s' redirection has null string value"
msgstr "Der Ausdruck für eine Umlenkung mittels »%s« ist ein leerer String"
-#: io.c:623
+#: io.c:703
#, c-format
msgid "filename `%s' for `%s' redirection may be result of logical expression"
msgstr ""
"Der Dateiname »%s« für eine Umlenkung mittels »%s« kann das Ergebnis eines "
"logischen Ausdrucks sein"
-#: io.c:666
+#: io.c:746
#, c-format
msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
msgstr "Unnötige Kombination von »>« und »>>« für Datei »%.*s«"
-#: io.c:719
+#: io.c:799
#, c-format
msgid "can't open pipe `%s' for output (%s)"
msgstr "Die Pipe »%s« kann nicht für die Ausgabe geöffnet werden (%s)"
-#: io.c:729
+#: io.c:809
#, c-format
msgid "can't open pipe `%s' for input (%s)"
msgstr "Die Pipe »%s« kann nicht für die Eingabe geöffnet werden (%s)"
-#: io.c:752
+#: io.c:840
#, c-format
msgid "can't open two way pipe `%s' for input/output (%s)"
msgstr ""
"Die bidirektionale Pipe »%s« kann nicht für die Ein-/Ausgabe geöffnet werden "
"(%s)"
-#: io.c:834
+#: io.c:923
#, c-format
msgid "can't redirect from `%s' (%s)"
msgstr "Von »%s« kann nicht umgelenkt werden (%s)"
-#: io.c:837
+#: io.c:926
#, c-format
msgid "can't redirect to `%s' (%s)"
msgstr "Zu »%s« kann nicht umgelenkt werden (%s)"
-#: io.c:888
+#: io.c:977
msgid ""
"reached system limit for open files: starting to multiplex file descriptors"
msgstr ""
"Die Systemgrenze offener Dateien ist erreicht, daher werden nun "
"Dateideskriptoren mehrfach verwendet"
-#: io.c:904
+#: io.c:993
#, c-format
msgid "close of `%s' failed (%s)."
msgstr "Das Schließen von »%s« ist gescheitert (%s)."
-#: io.c:912
+#: io.c:1001
msgid "too many pipes or input files open"
msgstr "Zu viele Pipes oder Eingabedateien offen"
-#: io.c:934
+#: io.c:1023
msgid "close: second argument must be `to' or `from'"
msgstr "close: Das zweite Argument muss »to« oder »from« sein"
-#: io.c:951
+#: io.c:1040
#, c-format
msgid "close: `%.*s' is not an open file, pipe or co-process"
msgstr "close: »%.*s« ist weder offene Datei, noch Pipe oder Ko-Prozess"
-#: io.c:956
+#: io.c:1045
msgid "close of redirection that was never opened"
msgstr "»close« für eine Umlenkung, die nie geöffnet wurde"
-#: io.c:1053
+#: io.c:1142
#, c-format
msgid "close: redirection `%s' not opened with `|&', second argument ignored"
msgstr ""
"close: Umlenkung »%s« wurde nicht mit »[&« geöffnet, das zweite Argument "
"wird ignoriert"
-#: io.c:1069
+#: io.c:1159
#, c-format
msgid "failure status (%d) on pipe close of `%s' (%s)"
msgstr "Fehlerstatus (%d) beim Schließen der Pipe »%s« (%s)"
-#: io.c:1072
+#: io.c:1162
#, c-format
msgid "failure status (%d) on file close of `%s' (%s)"
msgstr "Fehlerstatus (%d) beim Schließen der Datei »%s« (%s)"
-#: io.c:1092
+#: io.c:1182
#, c-format
msgid "no explicit close of socket `%s' provided"
msgstr "Das explizite Schließen des Sockets »%s« fehlt"
-#: io.c:1095
+#: io.c:1185
#, c-format
msgid "no explicit close of co-process `%s' provided"
msgstr "Das explizite Schließen des Ko-Prozesses »%s« fehlt"
-#: io.c:1098
+#: io.c:1188
#, c-format
msgid "no explicit close of pipe `%s' provided"
msgstr "Das explizite Schließen der Pipe »%s« fehlt"
-#: io.c:1101
+#: io.c:1191
#, c-format
msgid "no explicit close of file `%s' provided"
msgstr "Das explizite Schließen der Datei »%s« fehlt"
-#: io.c:1129 io.c:1184 main.c:797 main.c:834
+#: io.c:1219 io.c:1274 main.c:847 main.c:884
#, c-format
msgid "error writing standard output (%s)"
msgstr "Fehler beim Schreiben auf die Standardausgabe (%s)"
-#: io.c:1133 io.c:1189
+#: io.c:1223 io.c:1279
#, c-format
msgid "error writing standard error (%s)"
msgstr "Fehler beim Schreiben auf die Standardfehlerausgabe (%s)"
-#: io.c:1141
+#: io.c:1231
#, c-format
msgid "pipe flush of `%s' failed (%s)."
msgstr "Das Leeren der Pipe »%s« ist gescheitert (%s)"
-#: io.c:1144
+#: io.c:1234
#, c-format
msgid "co-process flush of pipe to `%s' failed (%s)."
msgstr "Ko-Prozess: Das Leeren der Pipe zu »%s« ist gescheitert (%s)"
-#: io.c:1147
+#: io.c:1237
#, c-format
msgid "file flush of `%s' failed (%s)."
msgstr "Das Leeren der Datei »%s« ist gescheitert (%s)"
-#: io.c:1262
+#: io.c:1351
#, c-format
msgid "local port %s invalid in `/inet'"
msgstr "Der lokale Port »%s« ist ungültig in »/inet«"
-#: io.c:1279
+#: io.c:1369
#, c-format
msgid "remote host and port information (%s, %s) invalid"
msgstr "Die Angaben zu entferntem Host und Port (%s, %s) sind ungültig"
-#: io.c:1431
+#: io.c:1521
#, c-format
msgid "no (known) protocol supplied in special filename `%s'"
msgstr "Es wurde kein (bekanntes) Protokoll im Dateinamen »%s« angegeben"
-#: io.c:1445
+#: io.c:1535
#, c-format
msgid "special file name `%s' is incomplete"
msgstr "Der Dateiname »%s« ist unvollständig"
-#: io.c:1462
+#: io.c:1552
msgid "must supply a remote hostname to `/inet'"
msgstr "Sie müssen in /inet einen Rechnernamen angeben"
-#: io.c:1480
+#: io.c:1570
msgid "must supply a remote port to `/inet'"
msgstr "Sie müssen in »/inet« einen Port angeben"
-#: io.c:1526
+#: io.c:1616
msgid "TCP/IP communications are not supported"
msgstr "TCP/IP-Verbindungen werden nicht unterstützt"
-#: io.c:1693
+#: io.c:1785
#, c-format
msgid "could not open `%s', mode `%s'"
msgstr "»%s« konnte nicht geöffnet werden, Modus »%s«"
-#: io.c:1747
+#: io.c:1835
#, c-format
msgid "close of master pty failed (%s)"
msgstr ""
"Das Schließen der übergeordneten Terminal-Gerätedatei ist gescheitert (%s)"
-#: io.c:1749 io.c:1917 io.c:2074
+#: io.c:1837 io.c:2012 io.c:2181
#, c-format
msgid "close of stdout in child failed (%s)"
msgstr "Das Schließen der Standardausgabe im Kindprozess ist gescheitert (%s)"
-#: io.c:1752
+#: io.c:1840
#, c-format
msgid "moving slave pty to stdout in child failed (dup: %s)"
msgstr ""
"Das Verschieben der untergeordneten Terminal-Gerätedatei zur Standardausgabe "
"im Kindprozess ist gescheitert (dup: %s)"
-#: io.c:1754 io.c:1922
+#: io.c:1842 io.c:2017
#, c-format
msgid "close of stdin in child failed (%s)"
msgstr "Schließen von stdin im Kindprozess gescheitert (%s)"
-#: io.c:1757
+#: io.c:1845
#, c-format
msgid "moving slave pty to stdin in child failed (dup: %s)"
msgstr ""
"Das Verschieben der untergeordneten Terminal-Gerätedatei zur Standardeingabe "
"im Kindprozess ist gescheitert (dup: %s)"
-#: io.c:1759 io.c:1780
+#: io.c:1847 io.c:1868
#, c-format
msgid "close of slave pty failed (%s)"
msgstr ""
"Das Schließen der untergeordneten Terminal-Gerätedatei ist gescheitert (%s)"
-#: io.c:1858 io.c:1920 io.c:2052 io.c:2077
+#: io.c:1953 io.c:2015 io.c:2158 io.c:2184
#, c-format
msgid "moving pipe to stdout in child failed (dup: %s)"
msgstr ""
"Das Verschieben der Pipe zur Standardausgabe im Kindprozess ist gescheitert "
"(dup: %s)"
-#: io.c:1865 io.c:1925
+#: io.c:1960 io.c:2020
#, c-format
msgid "moving pipe to stdin in child failed (dup: %s)"
msgstr ""
"Das Verschieben der Pipe zur Standardeingabe im Kindprozess ist gescheitert "
"(dup: %s)"
-#: io.c:1885 io.c:2067
+#: io.c:1980 io.c:2174
msgid "restoring stdout in parent process failed\n"
msgstr ""
"Das Wiederherstellen der Standardausgabe im Elternprozess ist gescheitert\n"
-#: io.c:1893
+#: io.c:1988
msgid "restoring stdin in parent process failed\n"
msgstr ""
"Das Wiederherstellen der Standardeingabe im Elternprozess ist gescheitert\n"
-#: io.c:1928 io.c:2079 io.c:2093
+#: io.c:2023 io.c:2186 io.c:2200
#, c-format
msgid "close of pipe failed (%s)"
msgstr "Das Schließen der Pipe ist gescheitert (%s)"
-#: io.c:1973
+#: io.c:2076
msgid "`|&' not supported"
msgstr "»|&« wird nicht unterstützt"
-#: io.c:2039
+#: io.c:2143
#, c-format
msgid "cannot open pipe `%s' (%s)"
msgstr "Pipe »%s« kann nicht geöffnet werden (%s)"
-#: io.c:2087
+#: io.c:2194
#, c-format
msgid "cannot create child process for `%s' (fork: %s)"
msgstr "Kindprozess für »%s« kann nicht erzeugt werden (fork: %s)"
-#: io.c:2520
+#: io.c:2652
+msgid "register_input_parser: received NULL pointer"
+msgstr ""
+
+#: io.c:2680
+#, c-format
+msgid "input parser `%s' conflicts with previously installed input parser `%s'"
+msgstr ""
+
+#: io.c:2687
+#, c-format
+msgid "input parser `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2707
+msgid "register_output_wrapper: received NULL pointer"
+msgstr ""
+
+#: io.c:2735
+#, c-format
+msgid ""
+"output wrapper `%s' conflicts with previously installed output wrapper `%s'"
+msgstr ""
+
+#: io.c:2742
+#, c-format
+msgid "output wrapper `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2763
+msgid "register_output_processor: received NULL pointer"
+msgstr ""
+
+#: io.c:2792
+#, c-format
+msgid ""
+"two-way processor `%s' conflicts with previously installed two-way processor "
+"`%s'"
+msgstr ""
+
+#: io.c:2801
+#, c-format
+msgid "two way processor `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2908
#, c-format
msgid "data file `%s' is empty"
msgstr "Die Datei »%s« ist leer"
-#: io.c:2561 io.c:2569
+#: io.c:2950 io.c:2958
msgid "could not allocate more input memory"
msgstr "Es konnte kein weiterer Speicher für die Eingabe beschafft werden"
-#: io.c:3127
+#: io.c:3524
msgid "multicharacter value of `RS' is a gawk extension"
msgstr "Multicharacter-Wert von »RS« ist eine gawk-Erweiterung"
-#: io.c:3232
+#: io.c:3613
msgid "IPv6 communication is not supported"
msgstr "IPv6-Verbindungen werden nicht unterstützt"
-#: main.c:366
+#: main.c:362
msgid "`-m[fr]' option irrelevant in gawk"
msgstr "Die Option »-m[fr]« ist in gawk bedeutungslos"
-#: main.c:368
+#: main.c:364
msgid "-m option usage: `-m[fr] nnn'"
msgstr "Anwendung der Option -m: »-m[fr] nnn«"
-#: main.c:391
+#: main.c:393
msgid "empty argument to `-e/--source' ignored"
msgstr "Das leere Argument für »--source« wird ignoriert"
-#: main.c:462
+#: main.c:483
#, c-format
msgid "%s: option `-W %s' unrecognized, ignored\n"
msgstr "%s: Die Option »-W %s« ist unbekannt und wird ignoriert\n"
-#: main.c:515
+#: main.c:529
#, c-format
msgid "%s: option requires an argument -- %c\n"
msgstr "%s: Die Option %c erfordert ein Argument\n"
-#: main.c:536
+#: main.c:550
msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
msgstr ""
"Die Umgebungsvariable »POSIXLY_CORRECT« ist gesetzt: »--posix« wird "
"eingeschaltet"
-#: main.c:542
+#: main.c:556
msgid "`--posix' overrides `--traditional'"
msgstr "»--posix« hat Vorrang vor »--traditional«"
-#: main.c:553
+#: main.c:567
msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
msgstr "»--posix« /»--traditional« hat Vorrang vor »--non-decimal-data«"
-#: main.c:557
+#: main.c:571
#, c-format
msgid "running %s setuid root may be a security problem"
msgstr "%s als setuid root auszuführen kann zu Sicherheitsproblemen führen"
-#: main.c:562
+#: main.c:576
#, fuzzy
msgid "`--posix' overrides `--characters-as-bytes'"
msgstr "»--posix« hat Vorrang vor »--binary«"
-#: main.c:616
+#: main.c:635
#, c-format
msgid "can't set binary mode on stdin (%s)"
msgstr ""
"Das Setzen des Binärermodus für die Standardeingabe ist nicht möglich (%s)"
-#: main.c:619
+#: main.c:638
#, c-format
msgid "can't set binary mode on stdout (%s)"
msgstr ""
"Das Setzen des Binärermodus für die Standardausgabe ist nicht möglich (%s)"
-#: main.c:621
+#: main.c:640
#, c-format
msgid "can't set binary mode on stderr (%s)"
msgstr ""
"Das Setzen des Binärermodus für die Standardfehlerausgabe ist nicht möglich "
"(%s)"
-#: main.c:660
+#: main.c:698
msgid "no program text at all!"
msgstr "Es wurde überhaupt kein Programmtext angegeben!"
-#: main.c:737
+#: main.c:784
#, c-format
msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"
msgstr "Aufruf: %s [POSIX- oder GNU-Optionen] -f PROGRAMM [--] Datei ...\n"
-#: main.c:739
+#: main.c:786
#, c-format
msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"
msgstr "Aufruf: %s [POSIX- oder GNU-Optionen] -- %cPROGRAMM%c Datei ...\n"
-#: main.c:744
+#: main.c:791
msgid "POSIX options:\t\tGNU long options: (standard)\n"
msgstr "POSIX-Optionen\t\tlange GNU-Optionen: (standard)\n"
-#: main.c:745
+#: main.c:792
msgid "\t-f progfile\t\t--file=progfile\n"
msgstr "\t-f PROGRAMM\t\t--file=PROGRAMM\n"
-#: main.c:746
+#: main.c:793
msgid "\t-F fs\t\t\t--field-separator=fs\n"
msgstr "\t-F Feldtrenner\t\t\t--field-separator=Feldtrenner\n"
-#: main.c:747
+#: main.c:794
msgid "\t-v var=val\t\t--assign=var=val\n"
msgstr "\t-v var=Wert\t\t--assign=var=Wert\n"
-#: main.c:748
+#: main.c:795
msgid "Short options:\t\tGNU long options: (extensions)\n"
msgstr "POSIX-Optionen\t\tGNU-Optionen (lang): (Erweiterungen)\n"
-#: main.c:749
+#: main.c:796
msgid "\t-b\t\t\t--characters-as-bytes\n"
msgstr "\t-b\t\t\t--characters-as-bytes\n"
-#: main.c:750
+#: main.c:797
msgid "\t-c\t\t\t--traditional\n"
msgstr "\t-c\t\t\t--traditional\n"
-#: main.c:751
+#: main.c:798
msgid "\t-C\t\t\t--copyright\n"
msgstr "\t-C\t\t\t--copyright\n"
-#: main.c:752
+#: main.c:799
msgid "\t-d[file]\t\t--dump-variables[=file]\n"
msgstr "\t-d [Datei]\t\t--dump-variables[=Datei]\n"
-#: main.c:753
+#: main.c:800
+#, fuzzy
+msgid "\t-D[file]\t\t--debug[=file]\n"
+msgstr "\t-p [Datei]\t\t--profile[=Datei]\n"
+
+#: main.c:801
msgid "\t-e 'program-text'\t--source='program-text'\n"
msgstr "\t-e 'Programmtext'\t--source=Programmtext\n"
-#: main.c:754
+#: main.c:802
msgid "\t-E file\t\t\t--exec=file\n"
msgstr "\t-E Datei\t\t\t--exec=Datei\n"
-#: main.c:755
+#: main.c:803
msgid "\t-g\t\t\t--gen-pot\n"
msgstr "\t-g\t\t\t--gen-pot\n"
-#: main.c:756
+#: main.c:804
msgid "\t-h\t\t\t--help\n"
msgstr "\t-h\t\t\t--help\n"
-#: main.c:757
+#: main.c:805
+msgid "\t-i includefile\t\t--include=includefile\n"
+msgstr ""
+
+#: main.c:806
+msgid "\t-l library\t\t--load=library\n"
+msgstr ""
+
+#: main.c:807
msgid "\t-L [fatal]\t\t--lint[=fatal]\n"
msgstr "\t-L [fatal]\t\t--lint[=fatal]\n"
-#: main.c:758
+#: main.c:808
msgid "\t-n\t\t\t--non-decimal-data\n"
msgstr "\t-n\t\t\t--non-decimal-data\n"
-#: main.c:759
+#: main.c:809
+#, fuzzy
+msgid "\t-M\t\t\t--bignum\n"
+msgstr "\t-g\t\t\t--gen-pot\n"
+
+#: main.c:810
msgid "\t-N\t\t\t--use-lc-numeric\n"
msgstr "\t-N\t\t\t--use-lc-numeric\n"
-#: main.c:760
+#: main.c:811
+#, fuzzy
+msgid "\t-o[file]\t\t--pretty-print[=file]\n"
+msgstr "\t-p [Datei]\t\t--profile[=Datei]\n"
+
+#: main.c:812
msgid "\t-O\t\t\t--optimize\n"
msgstr "\t-O\t\t\t--optimize\n"
-#: main.c:761
+#: main.c:813
msgid "\t-p[file]\t\t--profile[=file]\n"
msgstr "\t-p [Datei]\t\t--profile[=Datei]\n"
-#: main.c:762
+#: main.c:814
msgid "\t-P\t\t\t--posix\n"
msgstr "\t-P\t\t\t--posix\n"
-#: main.c:763
+#: main.c:815
msgid "\t-r\t\t\t--re-interval\n"
msgstr "\t-r\t\t\t--re-interval\n"
-#: main.c:765
-msgid "\t-R file\t\t\t--command=file\n"
-msgstr "\t-R Datei\t\t\t--command=Datei\n"
-
-#: main.c:766
+#: main.c:816
msgid "\t-S\t\t\t--sandbox\n"
msgstr "\t-S\t\t\t--sandbox\n"
-#: main.c:767
+#: main.c:817
msgid "\t-t\t\t\t--lint-old\n"
msgstr "\t-t\t\t\t--lint-old\n"
-#: main.c:768
+#: main.c:818
msgid "\t-V\t\t\t--version\n"
msgstr "\t-V\t\t\t--version\n"
-#: main.c:770
+#: main.c:820
msgid "\t-W nostalgia\t\t--nostalgia\n"
msgstr "\t-W nostalgia\t\t--nostalgia\n"
-#: main.c:773
+#: main.c:823
msgid "\t-Y\t\t--parsedebug\n"
msgstr "\t-Y\t\t--parsedebug\n"
@@ -1859,7 +2998,7 @@ msgstr "\t-Y\t\t--parsedebug\n"
#. for this application. Please add _another line_ with the
#. address for translation bugs.
#. no-wrap
-#: main.c:782
+#: main.c:832
msgid ""
"\n"
"To report bugs, see node `Bugs' in `gawk.info', which is\n"
@@ -1875,7 +3014,7 @@ msgstr ""
"an translation-team-de@lists.sourceforge.net\n"
"\n"
-#: main.c:786
+#: main.c:836
msgid ""
"gawk is a pattern scanning and processing language.\n"
"By default it reads standard input and writes standard output.\n"
@@ -1886,7 +3025,7 @@ msgstr ""
"auf der Standardausgabe aus.\n"
"\n"
-#: main.c:790
+#: main.c:840
msgid ""
"Examples:\n"
"\tgawk '{ sum += $1 }; END { print sum }' file\n"
@@ -1896,7 +3035,7 @@ msgstr ""
"\tgawk '{ sum += $1 }; END { print sum }' file\n"
"\tgawk -F: '{ print $1 }' /etc/passwd\n"
-#: main.c:810
+#: main.c:860
#, c-format
msgid ""
"Copyright (C) 1989, 1991-%d Free Software Foundation.\n"
@@ -1916,7 +3055,7 @@ msgstr ""
"spätere Version.\n"
"\n"
-#: main.c:818
+#: main.c:868
msgid ""
"This program is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
@@ -1929,7 +3068,7 @@ msgstr ""
"leistung einer HANDELBARKEIT oder der EIGNUNG FÃœR EINEN BESTIMMTEN ZWECK.\n"
"Sehen Sie bitte die GNU General Public License für weitere Details.\n"
-#: main.c:824
+#: main.c:874
msgid ""
"You should have received a copy of the GNU General Public License\n"
"along with this program. If not, see http://www.gnu.org/licenses/.\n"
@@ -1938,16 +3077,16 @@ msgstr ""
"diesem Programm erhalten haben. Wenn nicht, lesen Sie bitte\n"
"http://www.gnu.org/licenses/.\n"
-#: main.c:859
+#: main.c:909
msgid "-Ft does not set FS to tab in POSIX awk"
msgstr "-Ft setzt FS im POSIX-awk nicht auf Tab"
-#: main.c:1093
+#: main.c:1169
#, c-format
msgid "unknown value for field spec: %d\n"
msgstr "unbekannter Wert für eine Feldangabe: %d\n"
-#: main.c:1174
+#: main.c:1267
#, c-format
msgid ""
"%s: `%s' argument to `-v' not in `var=value' form\n"
@@ -1956,81 +3095,147 @@ msgstr ""
"%s: Argument »%s« von »-v« ist nicht in der Form »Variable=Wert«\n"
"\n"
-#: main.c:1200
+#: main.c:1293
#, c-format
msgid "`%s' is not a legal variable name"
msgstr "»%s« ist kein gültiger Variablenname"
-#: main.c:1203
+#: main.c:1296
#, c-format
msgid "`%s' is not a variable name, looking for file `%s=%s'"
msgstr "»%s« ist kein Variablenname, es wird nach der Datei »%s=%s« gesucht"
-#: main.c:1207
+#: main.c:1300
#, c-format
msgid "cannot use gawk builtin `%s' as variable name"
msgstr ""
"die eingebaute Funktion »%s« kann nicht als Variablenname verwendet werden"
# c-format
-#: main.c:1212
+#: main.c:1305
#, c-format
msgid "cannot use function `%s' as variable name"
msgstr "Funktion »%s« kann nicht als Name einer Variablen verwendet werden"
-#: main.c:1265
+#: main.c:1358
msgid "floating point exception"
msgstr "Fließkomma-Ausnahme"
-#: main.c:1272
+#: main.c:1365
msgid "fatal error: internal error"
msgstr "Fataler Fehler: interner Fehler"
-#: main.c:1287
+#: main.c:1380
msgid "fatal error: internal error: segfault"
msgstr "Fataler Fehler: interner Fehler: Speicherbegrenzungsfehler"
-#: main.c:1299
+#: main.c:1392
msgid "fatal error: internal error: stack overflow"
msgstr "Fataler Fehler: interner Fehler: Stapelüberlauf"
-#: main.c:1349
+#: main.c:1448
#, c-format
msgid "no pre-opened fd %d"
msgstr "Kein bereits geöffneter Dateideskriptor %d"
-#: main.c:1356
+#: main.c:1455
#, c-format
msgid "could not pre-open /dev/null for fd %d"
msgstr "/dev/null konnte nicht für Dateideskriptor %d geöffnet werden"
-#: msg.c:63
+#: mpfr.c:563
+#, fuzzy, c-format
+msgid "PREC value `%.*s' is invalid"
+msgstr "BINMODE Wert »%s« ist ungültig und wird als 3 behandelt"
+
+#: mpfr.c:621
+#, fuzzy, c-format
+msgid "RNDMODE value `%.*s' is invalid"
+msgstr "BINMODE Wert »%s« ist ungültig und wird als 3 behandelt"
+
+#: mpfr.c:711
+#, fuzzy, c-format
+msgid "%s: received non-numeric argument"
+msgstr "cos: das Argument ist keine Zahl"
+
+#: mpfr.c:813
+#, fuzzy
+msgid "compl(%Rg): negative value will give strange results"
+msgstr "compl(%lf): Negativer Wert wird zu merkwürdigen Ergebnissen führen"
+
+#: mpfr.c:817
+#, fuzzy
+msgid "comp(%Rg): fractional value will be truncated"
+msgstr "compl(%lf): Dezimalteil wird abgeschnitten"
+
+#: mpfr.c:829
+#, fuzzy, c-format
+msgid "cmpl(%Zd): negative values will give strange results"
+msgstr "compl(%lf): Negativer Wert wird zu merkwürdigen Ergebnissen führen"
+
+#: mpfr.c:856
+#, fuzzy, c-format
+msgid "%s: received non-numeric first argument"
+msgstr "or: das erste Argument ist keine Zahl"
+
+#: mpfr.c:858
+#, fuzzy, c-format
+msgid "%s: received non-numeric second argument"
+msgstr "or: das zweite Argument ist keine Zahl"
+
+#: mpfr.c:877
+#, fuzzy
+msgid "%s(%Rg, ..): negative values will give strange results"
+msgstr "or(%lf, %lf): Negative Werte werden zu merkwürdigen Ergebnissen führen"
+
+#: mpfr.c:882
+#, fuzzy
+msgid "%s(%Rg, ..): fractional values will be truncated"
+msgstr "or(%lf, %lf): Dezimalteil wird abgeschnitten"
+
+#: mpfr.c:895
+#, fuzzy, c-format
+msgid "%s(%Zd, ..): negative values will give strange results"
+msgstr "or(%lf, %lf): Negative Werte werden zu merkwürdigen Ergebnissen führen"
+
+#: mpfr.c:914
+#, fuzzy
+msgid "%s(.., %Rg): negative values will give strange results"
+msgstr "or(%lf, %lf): Negative Werte werden zu merkwürdigen Ergebnissen führen"
+
+#: mpfr.c:919
+#, fuzzy
+msgid "%s(.., %Rg): fractional values will be truncated"
+msgstr "or(%lf, %lf): Dezimalteil wird abgeschnitten"
+
+#: mpfr.c:932
+#, fuzzy, c-format
+msgid "%s(.., %Zd): negative values will give strange results"
+msgstr "or(%lf, %lf): Negative Werte werden zu merkwürdigen Ergebnissen führen"
+
+#: msg.c:61
#, c-format
msgid "cmd. line:"
msgstr "Kommandozeile:"
-#: msg.c:107
-msgid "error: "
-msgstr "Fehler: "
-
-#: node.c:406
+#: node.c:436
msgid "backslash at end of string"
msgstr "Backslash am Ende der Zeichenkette"
-#: node.c:517
+#: node.c:520
#, c-format
msgid "old awk does not support the `\\%c' escape sequence"
msgstr "Das alte awk unterstützt die Fluchsequenz »\\%c« nicht"
-#: node.c:568
+#: node.c:571
msgid "POSIX does not allow `\\x' escapes"
msgstr "POSIX erlaubt keine »\\x«-Escapes"
-#: node.c:574
+#: node.c:577
msgid "no hex digits in `\\x' escape sequence"
msgstr "In der »\\x«-Fluchtsequenz sind keine hexadezimalen Zahlen"
-#: node.c:596
+#: node.c:599
#, c-format
msgid ""
"hex escape \\x%.*s of %d characters probably not interpreted the way you "
@@ -2039,12 +3244,12 @@ msgstr ""
"Die Hex-Sequenz \\x%.*s aus %d Zeichen wird wahrscheinlich nicht wie "
"gewünscht interpretiert"
-#: node.c:611
+#: node.c:614
#, c-format
msgid "escape sequence `\\%c' treated as plain `%c'"
msgstr "Fluchtsequenz »\\%c« wird wie ein normales »%c« behandelt"
-#: node.c:750
+#: node.c:759
msgid ""
"Invalid multibyte data detected. There may be a mismatch between your data "
"and your locale."
@@ -2052,29 +3257,29 @@ msgstr ""
"Es wurden unbekannte Multibyte-Daten gefunden. Ihre Daten entsprechen "
"neventuell nicht der gesetzten Locale"
-#: posix/gawkmisc.c:176
+#: posix/gawkmisc.c:177
#, c-format
msgid "%s %s `%s': could not get fd flags: (fcntl F_GETFD: %s)"
msgstr ""
"%s %s »%s«: Die Kennungen des Dateideskriptors konnten nicht abgefragt "
"werden: (fcntl F_GETFD: %s)"
-#: posix/gawkmisc.c:188
+#: posix/gawkmisc.c:189
#, c-format
msgid "%s %s `%s': could not set close-on-exec: (fcntl F_SETFD: %s)"
msgstr ""
"%s %s »%s«: close-on-exec konnte nicht gesetzt werden: (fcntl F_SETFD: %s)"
-#: profile.c:83
+#: profile.c:70
#, c-format
msgid "could not open `%s' for writing: %s"
msgstr "»%s« konnte nicht zum Schreiben geöffnet werden: %s"
-#: profile.c:85
+#: profile.c:72
msgid "sending profile to standard error"
msgstr "Das Profil wird auf der Standardfehlerausgabe ausgegeben"
-#: profile.c:203
+#: profile.c:188
#, c-format
msgid ""
"\t# %s block(s)\n"
@@ -2083,7 +3288,7 @@ msgstr ""
"\t# %s Blöcke\n"
"\n"
-#: profile.c:208
+#: profile.c:193
#, c-format
msgid ""
"\t# Rule(s)\n"
@@ -2092,17 +3297,22 @@ msgstr ""
"\t# Regeln(s)\n"
"\n"
-#: profile.c:279
+#: profile.c:267
#, c-format
msgid "internal error: %s with null vname"
msgstr "Interner Fehler: %s mit null vname"
-#: profile.c:952
+#: profile.c:529
+#, fuzzy
+msgid "internal error: builtin with null fname"
+msgstr "Interner Fehler: %s mit null vname"
+
+#: profile.c:944
#, c-format
msgid "\t# gawk profile, created %s\n"
msgstr "\t# gawk-Profil, erzeugt %s\n"
-#: profile.c:1331
+#: profile.c:1329
#, c-format
msgid ""
"\n"
@@ -2111,18 +3321,18 @@ msgstr ""
"\n"
"\t# Funktionen in alphabetischer Reihenfolge\n"
-#: profile.c:1370
+#: profile.c:1367
#, c-format
msgid "redir2str: unknown redirection type %d"
msgstr "redir2str: unbekannter Umlenkungstyp %d"
-#: re.c:573
+#: re.c:568
#, c-format
msgid "range of the form `[%c-%c]' is locale dependent"
msgstr ""
"Ein Bereich in der Form »[%c-%c]« ist abhängig von der gesetzten Locale"
-#: re.c:600
+#: re.c:595
#, c-format
msgid "regexp component `%.*s' should probably be `[%.*s]'"
msgstr ""
@@ -2168,10 +3378,6 @@ msgstr "( oder \\( werden nicht geschlossen"
msgid "Unmatched \\{"
msgstr "\\{ wird nicht geschlossen"
-#: regcomp.c:161
-msgid "Invalid content of \\{\\}"
-msgstr "Ungültiger Inhalt von \\{\\}"
-
#: regcomp.c:164
msgid "Invalid range end"
msgstr "Ungültiges Bereichsende"
@@ -2188,10 +3394,6 @@ msgstr "Vorangehender regulärer Ausdruck ist ungültig"
msgid "Premature end of regular expression"
msgstr "Vorzeitiges Ende des regulären Ausdrucks"
-#: regcomp.c:176
-msgid "Regular expression too big"
-msgstr "Regulärer Ausdruck ist zu groß"
-
#: regcomp.c:179
msgid "Unmatched ) or \\)"
msgstr ") oder \\) werden nicht geöffnet"
@@ -2200,12 +3402,101 @@ msgstr ") oder \\) werden nicht geöffnet"
msgid "No previous regular expression"
msgstr "Kein vorangehender regulärer Ausdruck"
+#: symbol.c:722
+msgid "can not pop main context"
+msgstr ""
+
#~ msgid "`nextfile' is a gawk extension"
#~ msgstr "»nextfile« ist eine gawk-Erweiterung"
#~ msgid "`delete array' is a gawk extension"
#~ msgstr "»delete array« ist eine gawk-Erweiterung"
+#~ msgid "and: received non-numeric first argument"
+#~ msgstr "and: das erste Argument ist keine Zahl"
+
+#~ msgid "and: received non-numeric second argument"
+#~ msgstr "and: das zweite Argument ist keine Zahl"
+
+#~ msgid "and(%lf, %lf): fractional values will be truncated"
+#~ msgstr "and(%lf, %lf): Dezimalteil wird abgeschnitten"
+
+#~ msgid "xor: received non-numeric first argument"
+#~ msgstr "xor: das erste Argument ist keine Zahl"
+
+#~ msgid "xor: received non-numeric second argument"
+#~ msgstr "xor: das zweite Argument ist keine Zahl"
+
+#~ msgid "xor(%lf, %lf): fractional values will be truncated"
+#~ msgstr "xor(%lf, %lf): Dezimalteil wird abgeschnitten"
+
+#~ msgid "`extension' is a gawk extension"
+#~ msgstr "»extension« ist eine gawk-Erweiterung"
+
+#~ msgid "Operation Not Supported"
+#~ msgstr "Die Operation wird nicht unterstützt"
+
+#~ msgid "attempt to use function `%s' as an array"
+#~ msgstr "Es wird versucht, die Funktion »%s« als Feld zu verwenden"
+
+#~ msgid "reference to uninitialized element `%s[\"%.*s\"]'"
+#~ msgstr "Bezug auf ein nicht initialisiertes Element »%s[\"%.*s\"]«"
+
+#~ msgid "subscript of array `%s' is null string"
+#~ msgstr "Der Index von Feld »%s« ist ein Nullstring"
+
+#~ msgid "%s: empty (null)\n"
+#~ msgstr "%s: leer (Null)\n"
+
+#~ msgid "%s: empty (zero)\n"
+#~ msgstr "%s: leer (0)\n"
+
+#~ msgid "%s: table_size = %d, array_size = %d\n"
+#~ msgstr "%s: Tabellengröße = %d, Feldgröße = %d\n"
+
+#~ msgid "%s: array_ref to %s\n"
+#~ msgstr "%s: Feld-Referenz auf %s\n"
+
+#~ msgid "use of non-array as array"
+#~ msgstr "Verwendung eines Nicht-Feldes als Feld"
+
+#~ msgid "can't use function name `%s' as variable or array"
+#~ msgstr "Funktion »%s« kann nicht als Variable oder Feld verwendet werden"
+
+#~ msgid "assignment used in conditional context"
+#~ msgstr "Zuweisung in einer Bedingung"
+
+#~ msgid "statement has no effect"
+#~ msgstr "Anweisung hat keinen Effekt"
+
+#~ msgid ""
+#~ "for loop: array `%s' changed size from %ld to %ld during loop execution"
+#~ msgstr ""
+#~ "for-Schleife: Feld »%s« ändert seine Größe von %ld innerhalb der Schleife "
+#~ "zu %ld"
+
+#~ msgid "function called indirectly through `%s' does not exist"
+#~ msgstr "die durch »%s« indirekt aufgerufene Funktion existiert nicht"
+
+#~ msgid "function `%s' not defined"
+#~ msgstr "Funktion »%s« ist nicht definiert"
+
+#~ msgid "non-redirected `getline' invalid inside `%s' rule"
+#~ msgstr "Nicht umgelenktes »getline« ist innerhalb der »%s«-Aktion unzuässig"
+
+#~ msgid "`nextfile' cannot be called from a `%s' rule"
+#~ msgstr "»nextfile« kann nicht aus einer »«%s-Regel aufgerufen werden"
+
+#~ msgid "`next' cannot be called from a `%s' rule"
+#~ msgstr "»next« kann nicht in einer »%s«-Regel verwendet werden"
+
+#~ msgid "Sorry, don't know how to interpret `%s'"
+#~ msgstr ""
+#~ "Entschuldigung, aber es ist unbekannt, wie »%s« zu interpretieren ist"
+
+#~ msgid "\t-R file\t\t\t--command=file\n"
+#~ msgstr "\t-R Datei\t\t\t--command=Datei\n"
+
#~ msgid "could not find groups: %s"
#~ msgstr "Die Gruppen konnten nicht gefunden werden: %s"
diff --git a/po/es.gmo b/po/es.gmo
index 1bfb81a1..a5f642e6 100644
--- a/po/es.gmo
+++ b/po/es.gmo
Binary files differ
diff --git a/po/es.po b/po/es.po
index 57f5052c..36e51912 100644
--- a/po/es.po
+++ b/po/es.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gawk 4.0.0h\n"
"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
-"POT-Creation-Date: 2012-10-13 20:24+0200\n"
+"POT-Creation-Date: 2012-10-13 21:21+0200\n"
"PO-Revision-Date: 2012-01-30 07:42-0600\n"
"Last-Translator: Cristian Othón Martínez Vera <cfuga@cfuga.mx>\n"
"Language-Team: Spanish <es@li.org>\n"
@@ -16,511 +16,502 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: array.c:140
+#: array.c:266
#, c-format
msgid "from %s"
msgstr "desde %s"
-#: array.c:248
+#: array.c:366
msgid "attempt to use a scalar value as array"
msgstr "se intentó usar un valor escalar como una matriz"
-#: array.c:251
-#, c-format
-msgid "attempt to use function `%s' as an array"
-msgstr "se intentó usar la función `%s' como una matriz"
-
-#: array.c:254
+#: array.c:368
#, c-format
msgid "attempt to use scalar parameter `%s' as an array"
msgstr "se intentó usar el parámetro escalar `%s como una matriz'"
-#: array.c:257
+#: array.c:371
#, c-format
msgid "attempt to use scalar `%s' as an array"
msgstr "se intentó usar el escalar `%s' como una matriz"
-#: array.c:302 array.c:707 builtin.c:84 builtin.c:1385 builtin.c:1427
-#: builtin.c:1440 builtin.c:1859 builtin.c:1871 eval.c:1135 eval.c:1139
-#: eval.c:1495 eval.c:1812
+#: array.c:418 array.c:584 builtin.c:85 builtin.c:1566 builtin.c:1608
+#: builtin.c:1621 builtin.c:2047 builtin.c:2059 eval.c:1121 eval.c:1125
+#: eval.c:1520
#, c-format
msgid "attempt to use array `%s' in a scalar context"
msgstr "se intentó usar la matriz `%s' en un contexto escalar"
-#: array.c:513
-#, c-format
-msgid "reference to uninitialized element `%s[\"%.*s\"]'"
-msgstr "referencia al elemento sin inicializar `%s[\"%.*s\"]'"
-
-#: array.c:519
-#, c-format
-msgid "subscript of array `%s' is null string"
-msgstr "el subíndice de la matriz `%s' es la cadena nula"
-
-#: array.c:723
+#: array.c:591
#, c-format
msgid "delete: index `%s' not in array `%s'"
msgstr "delete: el índice `%s' no está en la matriz `%s'"
-#: array.c:734 eval.c:1865
+#: array.c:605
#, c-format
msgid "attempt to use scalar `%s[\"%.*s\"]' as an array"
msgstr "se intentó usar el dato escalar `%s[\"%.*s\"]' como una matriz"
-#: array.c:910
-#, c-format
-msgid "%s: empty (null)\n"
-msgstr "%s: vacío (nulo)\n"
-
-#: array.c:915
-#, c-format
-msgid "%s: empty (zero)\n"
-msgstr "%s: vacío (cero)\n"
-
-#: array.c:919
-#, c-format
-msgid "%s: table_size = %d, array_size = %d\n"
-msgstr "%s: tamaño_tabla = %d, tamaño_matriz = %d\n"
-
-#: array.c:954
-#, c-format
-msgid "%s: is parameter\n"
-msgstr "%s: es un parámetro\n"
-
-#: array.c:958
-#, c-format
-msgid "%s: array_ref to %s\n"
-msgstr "%s: array_ref a %s\n"
-
-#: array.c:963
-msgid "adump: argument not an array"
+#: array.c:784
+#, fuzzy
+msgid "adump: first argument not an array"
msgstr "adump: el argumento no es una matriz"
-#: array.c:1086
+#: array.c:823
msgid "asort: second argument not an array"
msgstr "asort: el segundo argumento no es una matriz"
-#: array.c:1087
+#: array.c:824
msgid "asorti: second argument not an array"
msgstr "asorti: el segundo argumento no es una matriz"
-#: array.c:1094
+#: array.c:831
msgid "asort: first argument not an array"
msgstr "asort: el primer argumento no es una matriz"
-#: array.c:1095
+#: array.c:832
msgid "asorti: first argument not an array"
msgstr "asorti: el primer argumento no es una matriz"
-#: array.c:1102
+#: array.c:839
msgid "asort: cannot use a subarray of first arg for second arg"
msgstr ""
"asort: no se puede usar una submatriz del primer argumento para el segundo "
"argumento"
-#: array.c:1103
+#: array.c:840
msgid "asorti: cannot use a subarray of first arg for second arg"
msgstr ""
"asorti: no se puede usar una submatriz del primer argumento para el segundo "
"argumento"
-#: array.c:1108
+#: array.c:845
msgid "asort: cannot use a subarray of second arg for first arg"
msgstr ""
"asort: no se puede usar una submatriz del segundo argumento para el primer "
"argumento"
-#: array.c:1109
+#: array.c:846
msgid "asorti: cannot use a subarray of second arg for first arg"
msgstr ""
"asorti: no se puede usar una submatriz del segundo argumento para el primer "
"argumento"
-#: array.c:1655
+#: array.c:1314
#, c-format
msgid "`%s' is invalid as a function name"
msgstr "`%s' es inválido como un nombre de función"
-#: array.c:1659
+#: array.c:1318
#, c-format
msgid "sort comparison function `%s' is not defined"
msgstr "la función de comparación de ordenamiento `%s' no está definida"
-#: awkgram.y:249
+#: awkgram.y:223
#, c-format
msgid "%s blocks must have an action part"
msgstr "los bloques %s deben tener una parte de acción"
-#: awkgram.y:252
+#: awkgram.y:226
msgid "each rule must have a pattern or an action part"
msgstr "cada regla debe tener un patrón o una parte de acción"
-#: awkgram.y:323 awkgram.y:334
+#: awkgram.y:315 awkgram.y:326
msgid "old awk does not support multiple `BEGIN' or `END' rules"
msgstr "el awk antiguo no admite múltiples reglas `BEGIN' o `END'"
-#: awkgram.y:371
+#: awkgram.y:363
#, c-format
msgid "`%s' is a built-in function, it cannot be redefined"
msgstr "`%s' es una función interna, no se puede redefinir"
-#: awkgram.y:432
+#: awkgram.y:409
msgid "regexp constant `//' looks like a C++ comment, but is not"
msgstr ""
"la constante de expresión regular `//' parece un comentario de C++, pero no "
"lo es"
-#: awkgram.y:436
+#: awkgram.y:413
#, c-format
msgid "regexp constant `/%s/' looks like a C comment, but is not"
msgstr ""
"la constante de expresión regular `/%s/' parece un comentario de C, pero no "
"lo es"
-#: awkgram.y:528
+#: awkgram.y:505
#, c-format
msgid "duplicate case values in switch body: %s"
msgstr "valores case duplicados en el cuerpo de un switch: %s"
-#: awkgram.y:549
+#: awkgram.y:526
msgid "duplicate `default' detected in switch body"
msgstr "se detectó un `default' duplicado en el cuerpo de un switch"
-#: awkgram.y:809
+#: awkgram.y:786
msgid "`break' is not allowed outside a loop or switch"
msgstr "no se permite `break' fuera de un bucle o switch"
-#: awkgram.y:818
+#: awkgram.y:795
msgid "`continue' is not allowed outside a loop"
msgstr "no se permite `continue' fuera de un bucle"
-#: awkgram.y:828
+#: awkgram.y:805
#, c-format
msgid "`next' used in %s action"
msgstr "se usó `next' en la acción %s"
-#: awkgram.y:837
+#: awkgram.y:814
#, c-format
msgid "`nextfile' used in %s action"
msgstr "se usó `nextfile' en la acción %s"
-#: awkgram.y:861
+#: awkgram.y:838
msgid "`return' used outside function context"
msgstr "se usó `return' fuera del contexto de la función"
-#: awkgram.y:921
+#: awkgram.y:912
msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'"
msgstr ""
"el `print' simple en la regla BEGIN o END probablemente debe ser `print \"\"'"
-#: awkgram.y:1016 awkgram.y:1020
+#: awkgram.y:978 awkgram.y:1027
+msgid "`delete' is not allowed with SYMTAB"
+msgstr ""
+
+#: awkgram.y:980 awkgram.y:1029
+msgid "`delete' is not allowed with FUNCTAB"
+msgstr ""
+
+#: awkgram.y:1014 awkgram.y:1018
msgid "`delete(array)' is a non-portable tawk extension"
msgstr "`delete(array)' es una extensión de tawk que no es transportable"
-#: awkgram.y:1132
+#: awkgram.y:1139
msgid "multistage two-way pipelines don't work"
msgstr "las líneas de trabajo de dos vías multiestado no funcionan"
-#: awkgram.y:1235
+#: awkgram.y:1242
msgid "regular expression on right of assignment"
msgstr "expresión regular del lado derecho de una asignación"
-#: awkgram.y:1246
+#: awkgram.y:1253
msgid "regular expression on left of `~' or `!~' operator"
msgstr "expresión regular a la izquierda del operador `~' o `!~'"
-#: awkgram.y:1262 awkgram.y:1416
+#: awkgram.y:1269 awkgram.y:1420
msgid "old awk does not support the keyword `in' except after `for'"
msgstr ""
"el awk antiguo no admite la palabra clave `in' excepto después de `for'"
-#: awkgram.y:1272
+#: awkgram.y:1279
msgid "regular expression on right of comparison"
msgstr "expresión regular a la derecha de una comparación"
-#: awkgram.y:1391
+#: awkgram.y:1395
#, c-format
msgid "`getline var' invalid inside `%s' rule"
msgstr "`getline var' inválido dentro de la regla `%s'"
-#: awkgram.y:1394 eval.c:2504
+#: awkgram.y:1398
#, c-format
msgid "`getline' invalid inside `%s' rule"
msgstr "`getline' inválido dentro de la regla `%s'"
-#: awkgram.y:1399
+#: awkgram.y:1403
msgid "non-redirected `getline' undefined inside END action"
msgstr "`getline' no redirigido indefinido dentro de la acción de END"
-#: awkgram.y:1418
+#: awkgram.y:1422
msgid "old awk does not support multidimensional arrays"
msgstr "el awk antiguo no admite matrices multidimensionales"
-#: awkgram.y:1514
+#: awkgram.y:1519
msgid "call of `length' without parentheses is not portable"
msgstr "la llamada de `length' sin paréntesis no es transportable"
-#: awkgram.y:1577
+#: awkgram.y:1585
msgid "indirect function calls are a gawk extension"
msgstr "las llamadas indirectas a función son una extensión de gawk"
-#: awkgram.y:1590
+#: awkgram.y:1598
#, c-format
msgid "can not use special variable `%s' for indirect function call"
msgstr ""
"no se puede usar la variable especial `%s' como llamada indirecta a función"
-#: awkgram.y:1668
+#: awkgram.y:1676
msgid "invalid subscript expression"
msgstr "expresión de subíndice inválida"
-#: awkgram.y:1708
-msgid "use of non-array as array"
-msgstr "uso de una matriz que no es matriz"
-
-#: awkgram.y:1972 awkgram.y:1992 msg.c:98
+#: awkgram.y:2000 awkgram.y:2020 gawkapi.c:203 gawkapi.c:221 msg.c:119
msgid "warning: "
msgstr "aviso: "
-#: awkgram.y:1990 msg.c:130
+#: awkgram.y:2018 gawkapi.c:189 gawkapi.c:218 msg.c:151
msgid "fatal: "
msgstr "fatal: "
-#: awkgram.y:2040
+#: awkgram.y:2068
msgid "unexpected newline or end of string"
msgstr "nueva línea o fin de la cadena inesperados"
-#: awkgram.y:2297 awkgram.y:2355 awkgram.y:2539
+#: awkgram.y:2335 awkgram.y:2411 awkgram.y:2634 debug.c:517 debug.c:533
+#: debug.c:2790 debug.c:5038
#, c-format
msgid "can't open source file `%s' for reading (%s)"
msgstr "no se puede abrir el fichero fuente `%s' para lectura (%s)"
-#: awkgram.y:2298 awkgram.y:2356 builtin.c:122
+#: awkgram.y:2336 awkgram.y:2461
+#, fuzzy, c-format
+msgid "can't open shared library `%s' for reading (%s)"
+msgstr "no se puede abrir el fichero fuente `%s' para lectura (%s)"
+
+#: awkgram.y:2338 awkgram.y:2412 awkgram.y:2462 builtin.c:130 debug.c:5189
msgid "reason unknown"
msgstr "razón desconocida"
-#: awkgram.y:2314
+#: awkgram.y:2347 awkgram.y:2371
+#, c-format
+msgid "can't include `%s' and use it as a program file"
+msgstr ""
+
+#: awkgram.y:2360
#, c-format
msgid "already included source file `%s'"
msgstr "ya se incluyó el fichero fuente `%s'"
-#: awkgram.y:2340
+#: awkgram.y:2361
+#, fuzzy, c-format
+msgid "already loaded shared library `%s'"
+msgstr "ya se incluyó el fichero fuente `%s'"
+
+#: awkgram.y:2396
msgid "@include is a gawk extension"
msgstr "@include es una extensión de gawk"
-#: awkgram.y:2346
+#: awkgram.y:2402
msgid "empty filename after @include"
msgstr "nombre de fichero vacío después de @include"
-#: awkgram.y:2491
+#: awkgram.y:2446
+#, fuzzy
+msgid "@load is a gawk extension"
+msgstr "@include es una extensión de gawk"
+
+#: awkgram.y:2452
+#, fuzzy
+msgid "empty filename after @load"
+msgstr "nombre de fichero vacío después de @include"
+
+#: awkgram.y:2586
msgid "empty program text on command line"
msgstr "texto de programa vacío en la linea de órdenes"
-#: awkgram.y:2606
+#: awkgram.y:2701
#, c-format
msgid "can't read sourcefile `%s' (%s)"
msgstr "no se puede leer el fichero fuente `%s' (%s)"
-#: awkgram.y:2617
+#: awkgram.y:2712
#, c-format
msgid "source file `%s' is empty"
msgstr "el fichero fuente `%s' está vacío"
-#: awkgram.y:2794
+#: awkgram.y:2889
msgid "source file does not end in newline"
msgstr "el fichero fuente no termina con línea nueva"
-#: awkgram.y:2897
+#: awkgram.y:2994
msgid "unterminated regexp ends with `\\' at end of file"
msgstr "expresión regular sin terminar termina con `\\` al final del fichero"
-#: awkgram.y:2921
+#: awkgram.y:3018
#, c-format
msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk"
msgstr ""
"%s: %d: el modificador de expresión regular `/.../%c` de tawk no funciona en "
"gawk"
-#: awkgram.y:2925
+#: awkgram.y:3022
#, c-format
msgid "tawk regex modifier `/.../%c' doesn't work in gawk"
msgstr ""
"el modificador de expresión regular `/.../%c` de tawk no funciona en gawk"
-#: awkgram.y:2932
+#: awkgram.y:3029
msgid "unterminated regexp"
msgstr "expresión regular sin terminar"
-#: awkgram.y:2936
+#: awkgram.y:3033
msgid "unterminated regexp at end of file"
msgstr "expresión regular sin terminar al final del fichero"
-#: awkgram.y:2995
+#: awkgram.y:3092
msgid "use of `\\ #...' line continuation is not portable"
msgstr "el uso de la continuación de línea `\\ #...' no es transportable"
-#: awkgram.y:3011
+#: awkgram.y:3108
msgid "backslash not last character on line"
msgstr "la barra invertida no es el último caracter en la línea"
-#: awkgram.y:3072
+#: awkgram.y:3169
msgid "POSIX does not allow operator `**='"
msgstr "POSIX no permite el operador `**='"
-#: awkgram.y:3074
+#: awkgram.y:3171
msgid "old awk does not support operator `**='"
msgstr "el awk antiguo no admite el operador `**='"
-#: awkgram.y:3083
+#: awkgram.y:3180
msgid "POSIX does not allow operator `**'"
msgstr "POSIX no permite el operador `**'"
-#: awkgram.y:3085
+#: awkgram.y:3182
msgid "old awk does not support operator `**'"
msgstr "el awk antiguo no admite el operador `**='"
-#: awkgram.y:3120
+#: awkgram.y:3217
msgid "operator `^=' is not supported in old awk"
msgstr "el operador `^=' no se admite en el awk antiguo"
-#: awkgram.y:3128
+#: awkgram.y:3225
msgid "operator `^' is not supported in old awk"
msgstr "el operador `^' no se admite en el awk antiguo"
-#: awkgram.y:3221 awkgram.y:3237
+#: awkgram.y:3318 awkgram.y:3334 command.y:1178
msgid "unterminated string"
msgstr "cadena sin terminar"
-#: awkgram.y:3433
+#: awkgram.y:3555
#, c-format
msgid "invalid char '%c' in expression"
msgstr "caracter '%c' inválido en la expresión"
-#: awkgram.y:3480
+#: awkgram.y:3602
#, c-format
msgid "`%s' is a gawk extension"
msgstr "`%s' es una extensión de gawk"
-#: awkgram.y:3485
+#: awkgram.y:3607
#, c-format
msgid "`%s' is a Bell Labs extension"
msgstr "`%s' es una extensión de Bell Labs"
-#: awkgram.y:3490
+#: awkgram.y:3612
#, c-format
msgid "POSIX does not allow `%s'"
msgstr "POSIX no permite `%s'"
-#: awkgram.y:3498
+#: awkgram.y:3620
#, c-format
msgid "`%s' is not supported in old awk"
msgstr "`%s' no se admite en el awk antiguo"
-#: awkgram.y:3565
+#: awkgram.y:3688
msgid "`goto' considered harmful!\n"
msgstr "¡`goto' se considera dañino!\n"
-#: awkgram.y:3616
+#: awkgram.y:3722
#, c-format
msgid "%d is invalid as number of arguments for %s"
msgstr "%d es inválido como número de argumentos para %s"
-#: awkgram.y:3651
+#: awkgram.y:3757
#, c-format
msgid "%s: string literal as last arg of substitute has no effect"
msgstr ""
"%s: la literal de cadena como último argumento de substitute no tiene efecto"
-#: awkgram.y:3656
+#: awkgram.y:3762
#, c-format
msgid "%s third parameter is not a changeable object"
msgstr "el tercer argumento de %s no es un objecto modificable"
-#: awkgram.y:3729 awkgram.y:3732
+#: awkgram.y:3841 awkgram.y:3844
msgid "match: third argument is a gawk extension"
msgstr "match: el tercer argumento es una extensión de gawk"
-#: awkgram.y:3786 awkgram.y:3789
+#: awkgram.y:3898 awkgram.y:3901
msgid "close: second argument is a gawk extension"
msgstr "close: el segundo argumento es una extensión de gawk"
-#: awkgram.y:3801
+#: awkgram.y:3913
msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
msgstr ""
"el uso de dcgettext(_\"...\") es incorrecto: quite el subrayado inicial"
-#: awkgram.y:3816
+#: awkgram.y:3928
msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
msgstr ""
"el uso de dcngettext(_\"...\") es incorrecto: quite el subrayado inicial"
-#: awkgram.y:3908
-#, c-format
-msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
-msgstr "función `%s': parámetro #%d, `%s', duplica el parámetro #%d"
-
-#: awkgram.y:3950
+#: awkgram.y:3994
#, c-format
msgid "function `%s': parameter `%s' shadows global variable"
msgstr "función `%s': parámetro `%s' oscurece la variable global"
-#: awkgram.y:4108
+#: awkgram.y:4051 debug.c:4019 debug.c:4062 debug.c:5187
#, c-format
msgid "could not open `%s' for writing (%s)"
msgstr "no se puede abrir `%s' para escritura (%s)"
-#: awkgram.y:4109
+#: awkgram.y:4052
msgid "sending variable list to standard error"
msgstr "se envía la lista de variables a la salida estándar de error"
-#: awkgram.y:4115
+#: awkgram.y:4060
#, c-format
msgid "%s: close failed (%s)"
msgstr "%s: falló close (%s)"
-#: awkgram.y:4167
+#: awkgram.y:4085
msgid "shadow_funcs() called twice!"
msgstr "¡se llamó shadow_funcs() dos veces!"
-#: awkgram.y:4173
+#: awkgram.y:4093
msgid "there were shadowed variables."
msgstr "hay variables opacadas."
-#: awkgram.y:4203
+#: awkgram.y:4164
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "el nombre de función `%s' se definió previamente"
+
+#: awkgram.y:4210
#, c-format
msgid "function `%s': can't use function name as parameter name"
msgstr ""
"función `%s': no se puede usar un nombre de función como nombre de parámetro"
-#: awkgram.y:4207
+#: awkgram.y:4213
#, c-format
msgid "function `%s': can't use special variable `%s' as a function parameter"
msgstr ""
"función `%s': no se puede usar la variable especial `%s' como un parámetro "
"de función"
-#: awkgram.y:4223
+#: awkgram.y:4221
#, c-format
-msgid "function name `%s' previously defined"
-msgstr "el nombre de función `%s' se definió previamente"
+msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
+msgstr "función `%s': parámetro #%d, `%s', duplica el parámetro #%d"
-#: awkgram.y:4391 awkgram.y:4397
+#: awkgram.y:4315 awkgram.y:4319
#, c-format
msgid "function `%s' called but never defined"
msgstr "se llamó a la función `%s' pero nunca se definió"
-#: awkgram.y:4400
+#: awkgram.y:4324
#, c-format
msgid "function `%s' defined but never called directly"
msgstr "se definió la función `%s' pero nunca se llamó directamente"
-#: awkgram.y:4432
+#: awkgram.y:4356
#, c-format
msgid "regexp constant for parameter #%d yields boolean value"
msgstr ""
"la constante de expresión regular para el parámetro #%d da un valor booleano"
-#: awkgram.y:4541
+#: awkgram.y:4402
#, c-format
msgid ""
"function `%s' called with space between name and `(',\n"
@@ -529,238 +520,238 @@ msgstr ""
"se llamó la función `%s' con espacio entre el nombre y el `(',\n"
"o se usó como una variable o una matriz"
-#: awkgram.y:4788 eval.c:2056
+#: awkgram.y:4618
msgid "division by zero attempted"
msgstr "se intentó una división por cero"
-#: awkgram.y:4797 eval.c:2072
+#: awkgram.y:4627
#, c-format
msgid "division by zero attempted in `%%'"
msgstr "se intentó una división por cero en `%%'"
-#: builtin.c:120
+#: builtin.c:128
#, c-format
msgid "%s to \"%s\" failed (%s)"
msgstr "falló %s a \"%s\" (%s)"
-#: builtin.c:121
+#: builtin.c:129
msgid "standard output"
msgstr "salida estándar"
-#: builtin.c:135
+#: builtin.c:143
msgid "exp: received non-numeric argument"
msgstr "exp: se recibió un argumento que no es númerico"
-#: builtin.c:141
+#: builtin.c:149
#, c-format
msgid "exp: argument %g is out of range"
msgstr "exp: el argumento %g está fuera de rango"
-#: builtin.c:200
+#: builtin.c:208
#, c-format
msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing"
msgstr ""
"fflush: no se puede limpiar: se abrió la tubería `%s' para lectura, no para "
"escritura"
-#: builtin.c:203
+#: builtin.c:211
#, c-format
msgid "fflush: cannot flush: file `%s' opened for reading, not writing"
msgstr ""
"fflush: no se puede limpiar: se abrió el fichero `%s' para lectura, no para "
"escritura"
-#: builtin.c:215
+#: builtin.c:223
#, c-format
msgid "fflush: `%s' is not an open file, pipe or co-process"
msgstr "fflush: `%s' no es un fichero abierto, tubería o co-proceso"
-#: builtin.c:333
+#: builtin.c:341
msgid "index: received non-string first argument"
msgstr "index: el primer argumento recibido no es una cadena"
-#: builtin.c:335
+#: builtin.c:343
msgid "index: received non-string second argument"
msgstr "index: el segundo argumento recibido no es una cadena"
-#: builtin.c:457
+#: builtin.c:467 mpfr.c:770
msgid "int: received non-numeric argument"
msgstr "int: se recibió un argumento que no es númerico"
-#: builtin.c:493
+#: builtin.c:503
msgid "length: received array argument"
msgstr "length: se recibió un argumento de matriz"
-#: builtin.c:496
+#: builtin.c:506
msgid "`length(array)' is a gawk extension"
msgstr "`length(array)' es una extensión de gawk"
-#: builtin.c:504
+#: builtin.c:514
msgid "length: received non-string argument"
msgstr "length: se recibió un argumento que no es una cadena"
-#: builtin.c:535
+#: builtin.c:545
msgid "log: received non-numeric argument"
msgstr "log: se recibió un argumento que no es númerico"
-#: builtin.c:538
+#: builtin.c:548
#, c-format
msgid "log: received negative argument %g"
msgstr "log: se recibió el argumento negativo %g"
-#: builtin.c:694 builtin.c:699
+#: builtin.c:746 builtin.c:751
msgid "fatal: must use `count$' on all formats or none"
msgstr "fatal: se debe utilizar `count$' en todos los formatos o en ninguno"
-#: builtin.c:762
+#: builtin.c:821
#, c-format
msgid "field width is ignored for `%%' specifier"
msgstr "se descarta la anchura del campo para el especificador `%%'"
-#: builtin.c:764
+#: builtin.c:823
#, c-format
msgid "precision is ignored for `%%' specifier"
msgstr "se descarta la precisión para el especificador `%%'"
-#: builtin.c:766
+#: builtin.c:825
#, c-format
msgid "field width and precision are ignored for `%%' specifier"
msgstr ""
"se descartan la anchura del campo y la precisión para el especificador `%%'"
-#: builtin.c:817
+#: builtin.c:876
msgid "fatal: `$' is not permitted in awk formats"
msgstr "fatal: no se permite `$' en los formatos de awk"
-#: builtin.c:826
+#: builtin.c:885
msgid "fatal: arg count with `$' must be > 0"
msgstr "fatal: la cuenta de argumentos con `$' debe ser > 0"
-#: builtin.c:830
+#: builtin.c:889
#, c-format
msgid "fatal: arg count %ld greater than total number of supplied arguments"
msgstr ""
"fatal: la cuenta de argumentos %ld es mayor que el número total de "
"argumentos proporcionados"
-#: builtin.c:834
+#: builtin.c:893
msgid "fatal: `$' not permitted after period in format"
msgstr "fatal: no se permite `$' después de un punto en el formato"
-#: builtin.c:850
+#: builtin.c:909
msgid "fatal: no `$' supplied for positional field width or precision"
msgstr ""
"fatal: no se proporciona `$' para la anchura o la precisión del campo "
"posicional"
-#: builtin.c:921
+#: builtin.c:981
msgid "`l' is meaningless in awk formats; ignored"
msgstr "`l' no tiene significado en los formatos de awk; se descarta"
-#: builtin.c:925
+#: builtin.c:985
msgid "fatal: `l' is not permitted in POSIX awk formats"
msgstr "fatal: no se permite `l' en los formatos POSIX de awk"
-#: builtin.c:938
+#: builtin.c:998
msgid "`L' is meaningless in awk formats; ignored"
msgstr "`L' no tiene significado en los formatos de awk; se descarta"
-#: builtin.c:942
+#: builtin.c:1002
msgid "fatal: `L' is not permitted in POSIX awk formats"
msgstr "fatal: no se permite `L' en los formatos POSIX de awk"
-#: builtin.c:955
+#: builtin.c:1015
msgid "`h' is meaningless in awk formats; ignored"
msgstr "`h' no tiene significado en los formatos de awk; se descarta"
-#: builtin.c:959
+#: builtin.c:1019
msgid "fatal: `h' is not permitted in POSIX awk formats"
msgstr "fatal: no se permite `h' en los formatos POSIX de awk"
-#: builtin.c:1272
+#: builtin.c:1414
#, c-format
msgid "[s]printf: value %g is out of range for `%%%c' format"
msgstr "[s]printf: el valor %g está fuera del rango para el formato `%%%c'"
-#: builtin.c:1332
+#: builtin.c:1512
#, c-format
msgid "ignoring unknown format specifier character `%c': no argument converted"
msgstr ""
"se descarta el carácter especificador de formato `%c' desconocido: no se "
"convirtió ningún argumento"
-#: builtin.c:1337
+#: builtin.c:1517
msgid "fatal: not enough arguments to satisfy format string"
msgstr ""
"fatal: no hay suficientes argumentos para satisfacer a la cadena de formato"
-#: builtin.c:1339
+#: builtin.c:1519
msgid "^ ran out for this one"
msgstr "se acabó ^ para éste"
-#: builtin.c:1346
+#: builtin.c:1526
msgid "[s]printf: format specifier does not have control letter"
msgstr "[s]printf: el especificador de formato no tiene letras de control"
-#: builtin.c:1349
+#: builtin.c:1529
msgid "too many arguments supplied for format string"
msgstr "se proporcionaron demasiados argumentos para la cadena de formato"
-#: builtin.c:1423 builtin.c:1434
+#: builtin.c:1604 builtin.c:1615
msgid "printf: no arguments"
msgstr "printf: sin argumentos"
-#: builtin.c:1475
+#: builtin.c:1656
msgid "sqrt: received non-numeric argument"
msgstr "sqrt: se recibió un argumento que no es un númerico"
-#: builtin.c:1479
+#: builtin.c:1660
#, c-format
msgid "sqrt: called with negative argument %g"
msgstr "sqrt: se llamó con el argumento negativo %g"
-#: builtin.c:1503
+#: builtin.c:1691
#, c-format
msgid "substr: length %g is not >= 1"
msgstr "substr: la longitud %g no es >= 1"
-#: builtin.c:1505
+#: builtin.c:1693
#, c-format
msgid "substr: length %g is not >= 0"
msgstr "substr: la longitud %g no es >= 0"
-#: builtin.c:1512
+#: builtin.c:1700
#, c-format
msgid "substr: non-integer length %g will be truncated"
msgstr "substr: se truncará la longitud no entera %g"
-#: builtin.c:1517
+#: builtin.c:1705
#, c-format
msgid "substr: length %g too big for string indexing, truncating to %g"
msgstr ""
"substr: la longitud %g es demasiado grande para ser índice de cadena, se "
"trunca a %g"
-#: builtin.c:1529
+#: builtin.c:1717
#, c-format
msgid "substr: start index %g is invalid, using 1"
msgstr "substr: el índice de inicio %g es inválido, se usa 1"
-#: builtin.c:1534
+#: builtin.c:1722
#, c-format
msgid "substr: non-integer start index %g will be truncated"
msgstr "substr: se truncará el índice de inicio no entero %g"
-#: builtin.c:1559
+#: builtin.c:1747
msgid "substr: source string is zero length"
msgstr "substr: la cadena de origen es de longitud cero"
-#: builtin.c:1575
+#: builtin.c:1763
#, c-format
msgid "substr: start index %g is past end of string"
msgstr "substr: el índice de inicio %g está después del fin de la cadena"
-#: builtin.c:1583
+#: builtin.c:1771
#, c-format
msgid ""
"substr: length %g at start index %g exceeds length of first argument (%lu)"
@@ -768,234 +759,1096 @@ msgstr ""
"substr: la cadena %g en el índice de inicio %g excede la longitud del primer "
"argumento (%lu)"
-#: builtin.c:1657
+#: builtin.c:1845
msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type"
msgstr ""
"strftime: el valor de formato en PROCINFO[\"strftime\"] tiene tipo numérico"
-#: builtin.c:1680
+#: builtin.c:1868
msgid "strftime: received non-numeric second argument"
msgstr "strftime: el segundo argumento recibido no es númerico"
-#: builtin.c:1683
+#: builtin.c:1872
msgid "strftime: second argument less than 0 or too big for time_t"
msgstr ""
"strftime: el segundo argumento es menor que 0 o demasiado grande para time_t"
-#: builtin.c:1690
+#: builtin.c:1879
msgid "strftime: received non-string first argument"
msgstr "strftime: el primer argumento recibido no es una cadena"
-#: builtin.c:1696
+#: builtin.c:1886
msgid "strftime: received empty format string"
msgstr "strftime: se recibió una cadena de formato vacía"
-#: builtin.c:1762
+#: builtin.c:1952
msgid "mktime: received non-string argument"
msgstr "mktime: se recibió un argumento que no es una cadena"
-#: builtin.c:1779
+#: builtin.c:1969
msgid "mktime: at least one of the values is out of the default range"
msgstr ""
"mktime: por lo menos uno de los valores está fuera del rango por defecto"
-#: builtin.c:1814
+#: builtin.c:2004
msgid "'system' function not allowed in sandbox mode"
msgstr "no se permite la función 'system' en modo sandbox"
-#: builtin.c:1819
+#: builtin.c:2009
msgid "system: received non-string argument"
msgstr "system: se recibió un argumento que no es una cadena"
-#: builtin.c:1874 eval.c:1159 eval.c:1790 eval.c:1803
-#, c-format
-msgid "reference to uninitialized variable `%s'"
-msgstr "referencia a la variable sin inicializar `%s'"
-
-#: builtin.c:1941
+#: builtin.c:2127
#, c-format
msgid "reference to uninitialized field `$%d'"
msgstr "referencia al campo sin inicializar `$%d'"
-#: builtin.c:2028
+#: builtin.c:2214
msgid "tolower: received non-string argument"
msgstr "tolower: se recibió un argumento que no es una cadena"
-#: builtin.c:2062
+#: builtin.c:2248
msgid "toupper: received non-string argument"
msgstr "toupper: se recibió un argumento que no es una cadena"
-#: builtin.c:2098
+#: builtin.c:2284 mpfr.c:685
msgid "atan2: received non-numeric first argument"
msgstr "atan2: el primer argumento recibido no es númerico"
-#: builtin.c:2100
+#: builtin.c:2286 mpfr.c:687
msgid "atan2: received non-numeric second argument"
msgstr "atan2: el segundo argumento recibido no es númerico"
-#: builtin.c:2119
+#: builtin.c:2305
msgid "sin: received non-numeric argument"
msgstr "sin: se recibió un argumento que no es númerico"
-#: builtin.c:2135
+#: builtin.c:2321
msgid "cos: received non-numeric argument"
msgstr "cos: se recibió un argumento que no es númerico"
-#: builtin.c:2188
+#: builtin.c:2374 mpfr.c:1137
msgid "srand: received non-numeric argument"
msgstr "srand: se recibió un argumento que no es númerico"
-#: builtin.c:2219
+#: builtin.c:2405
msgid "match: third argument is not an array"
msgstr "match: el tercer argumento no es una matriz"
-#: builtin.c:2483
+#: builtin.c:2670
msgid "gensub: third argument of 0 treated as 1"
msgstr "gensub: el tercer argumento de 0 se trata como 1"
-#: builtin.c:2776
+#: builtin.c:2963
msgid "lshift: received non-numeric first argument"
msgstr "lshift: el primer argumento recibido no es númerico"
-#: builtin.c:2778
+#: builtin.c:2965
msgid "lshift: received non-numeric second argument"
msgstr "lshift: el segundo argumento recibido no es númerico"
-#: builtin.c:2784
+#: builtin.c:2971
#, fuzzy, c-format
msgid "lshift(%f, %f): negative values will give strange results"
msgstr "lshift(%lf, %lf): los valores negativos darán resultados extraños"
-#: builtin.c:2786
+#: builtin.c:2973
#, fuzzy, c-format
msgid "lshift(%f, %f): fractional values will be truncated"
msgstr "lshift(%lf, %lf): los valores fraccionarios se truncarán"
-#: builtin.c:2788
+#: builtin.c:2975
#, fuzzy, c-format
msgid "lshift(%f, %f): too large shift value will give strange results"
msgstr ""
"lshift(%lf, %lf): un valor de desplazamiento muy grande dará resultados "
"extraños"
-#: builtin.c:2813
+#: builtin.c:3000
msgid "rshift: received non-numeric first argument"
msgstr "rshift: el primer argumento recibido no es númerico"
-#: builtin.c:2815
+#: builtin.c:3002
msgid "rshift: received non-numeric second argument"
msgstr "rshift: el segundo argumento recibido no es númerico"
-#: builtin.c:2821
+#: builtin.c:3008
#, fuzzy, c-format
msgid "rshift(%f, %f): negative values will give strange results"
msgstr "rshift(%lf, %lf): los valores negativos darán resultados extraños"
-#: builtin.c:2823
+#: builtin.c:3010
#, fuzzy, c-format
msgid "rshift(%f, %f): fractional values will be truncated"
msgstr "rshift(%lf, %lf): los valores fraccionarios serán truncados"
-#: builtin.c:2825
+#: builtin.c:3012
#, fuzzy, c-format
msgid "rshift(%f, %f): too large shift value will give strange results"
msgstr ""
"rshift(%lf, %lf): un valor de desplazamiento muy grande dará resultados "
"extraños"
-#: builtin.c:2850
-msgid "and: received non-numeric first argument"
-msgstr "and: el primer argumento recibido no es númerico"
-
-#: builtin.c:2852
-msgid "and: received non-numeric second argument"
-msgstr "and: el segundo argumento recibido no es númerico"
+#: builtin.c:3037
+#, fuzzy
+msgid "and: called with less than two arguments"
+msgstr "sqrt: se llamó con el argumento negativo %g"
-#: builtin.c:2858
+#: builtin.c:3042
#, fuzzy, c-format
-msgid "and(%f, %f): negative values will give strange results"
-msgstr "and(%lf, %lf): los valores negativos darán resultados extraños"
+msgid "and: argument %d is non-numeric"
+msgstr "exp: el argumento %g está fuera de rango"
-#: builtin.c:2860
+#: builtin.c:3046
#, fuzzy, c-format
-msgid "and(%f, %f): fractional values will be truncated"
-msgstr "and(%lf, %lf): los valores fraccionarios serán truncados"
-
-#: builtin.c:2885
-msgid "or: received non-numeric first argument"
-msgstr "or: el primer argumento recibido no es númerico"
+msgid "and: argument %d negative value %g will give strange results"
+msgstr "and(%lf, %lf): los valores negativos darán resultados extraños"
-#: builtin.c:2887
-msgid "or: received non-numeric second argument"
-msgstr "or: el segundo argumento recibido no es númerico"
+#: builtin.c:3069
+#, fuzzy
+msgid "or: called with less than two arguments"
+msgstr "sqrt: se llamó con el argumento negativo %g"
-#: builtin.c:2893
+#: builtin.c:3074
#, fuzzy, c-format
-msgid "or(%f, %f): negative values will give strange results"
-msgstr "or(%lf, %lf): los valores negativos darán resultados extraños"
+msgid "or: argument %d is non-numeric"
+msgstr "exp: el argumento %g está fuera de rango"
-#: builtin.c:2895
+#: builtin.c:3078
#, fuzzy, c-format
-msgid "or(%f, %f): fractional values will be truncated"
-msgstr "or(%lf, %lf): los valores fraccionarios serán truncados"
-
-#: builtin.c:2923
-msgid "xor: received non-numeric first argument"
-msgstr "xor: el primer argumento recibido no es númerico"
+msgid "or: argument %d negative value %g will give strange results"
+msgstr "compl(%lf): el valor negativo dará resultados extraños"
-#: builtin.c:2925
-msgid "xor: received non-numeric second argument"
-msgstr "xor: el segundo argumento recibido no es númerico"
+#: builtin.c:3100
+#, fuzzy
+msgid "xor: called with less than two arguments"
+msgstr "sqrt: se llamó con el argumento negativo %g"
-#: builtin.c:2931
+#: builtin.c:3106
#, fuzzy, c-format
-msgid "xor(%f, %f): negative values will give strange results"
-msgstr "xor(%lf, %lf): los valores negativos darán resultados extraños"
+msgid "xor: argument %d is non-numeric"
+msgstr "exp: el argumento %g está fuera de rango"
-#: builtin.c:2933
+#: builtin.c:3110
#, fuzzy, c-format
-msgid "xor(%f, %f): fractional values will be truncated"
-msgstr "xor(%lf, %lf): los valores fraccionarios se truncarán"
+msgid "xor: argument %d negative value %g will give strange results"
+msgstr "xor(%lf, %lf): los valores negativos darán resultados extraños"
-#: builtin.c:2957 builtin.c:2963
+#: builtin.c:3135 mpfr.c:800
msgid "compl: received non-numeric argument"
msgstr "compl: se recibió un argumento que no es númerico"
-#: builtin.c:2965
+#: builtin.c:3141
#, fuzzy, c-format
msgid "compl(%f): negative value will give strange results"
msgstr "compl(%lf): el valor negativo dará resultados extraños"
-#: builtin.c:2967
+#: builtin.c:3143
#, fuzzy, c-format
msgid "compl(%f): fractional value will be truncated"
msgstr "compl(%lf): el valor fraccionario se truncará"
-#: builtin.c:3136
+#: builtin.c:3312
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr "dcgettext: `%s' no es una categoría local válida"
-#: eval.c:412
+#: command.y:225
+#, c-format
+msgid "Type (g)awk statement(s). End with the command \"end\"\n"
+msgstr ""
+
+#: command.y:289
+#, fuzzy, c-format
+msgid "invalid frame number: %d"
+msgstr "Final de rango inválido"
+
+#: command.y:295
+#, fuzzy, c-format
+msgid "info: invalid option - \"%s\""
+msgstr "%s: opción inválida -- '%c'\n"
+
+#: command.y:321
+#, c-format
+msgid "source \"%s\": already sourced."
+msgstr ""
+
+#: command.y:326
+#, c-format
+msgid "save \"%s\": command not permitted."
+msgstr ""
+
+#: command.y:339
+msgid "Can't use command `commands' for breakpoint/watchpoint commands"
+msgstr ""
+
+#: command.y:341
+msgid "no breakpoint/watchpoint has been set yet"
+msgstr ""
+
+#: command.y:343
+msgid "invalid breakpoint/watchpoint number"
+msgstr ""
+
+#: command.y:348
+#, c-format
+msgid "Type commands for when %s %d is hit, one per line.\n"
+msgstr ""
+
+#: command.y:350
+#, c-format
+msgid "End with the command \"end\"\n"
+msgstr ""
+
+#: command.y:357
+msgid "`end' valid only in command `commands' or `eval'"
+msgstr ""
+
+#: command.y:367
+msgid "`silent' valid only in command `commands'"
+msgstr ""
+
+#: command.y:373
+#, fuzzy, c-format
+msgid "trace: invalid option - \"%s\""
+msgstr "%s: opción inválida -- '%c'\n"
+
+#: command.y:387
+msgid "condition: invalid breakpoint/watchpoint number"
+msgstr ""
+
+#: command.y:449
+#, fuzzy
+msgid "argument not a string"
+msgstr "exp: el argumento %g está fuera de rango"
+
+#: command.y:459 command.y:464
+#, c-format
+msgid "option: invalid parameter - \"%s\""
+msgstr ""
+
+#: command.y:474
+#, c-format
+msgid "no such function - \"%s\""
+msgstr ""
+
+#: command.y:531
+#, fuzzy, c-format
+msgid "enable: invalid option - \"%s\""
+msgstr "%s: opción inválida -- '%c'\n"
+
+#: command.y:597
+#, fuzzy, c-format
+msgid "invalid range specification: %d - %d"
+msgstr "Final de rango inválido"
+
+#: command.y:659
+#, fuzzy
+msgid "non-numeric value for field number"
+msgstr "valor desconocido para la especificación de campo: %d\n"
+
+#: command.y:680 command.y:687
+msgid "non-numeric value found, numeric expected"
+msgstr ""
+
+#: command.y:712 command.y:718
+msgid "non-zero integer value"
+msgstr ""
+
+#: command.y:817
+msgid ""
+"backtrace [N] - print trace of all or N innermost (outermost if N < 0) "
+"frames."
+msgstr ""
+
+#: command.y:819
+msgid ""
+"break [[filename:]N|function] - set breakpoint at the specified location."
+msgstr ""
+
+#: command.y:821
+msgid "clear [[filename:]N|function] - delete breakpoints previously set."
+msgstr ""
+
+#: command.y:823
+msgid ""
+"commands [num] - starts a list of commands to be executed at a breakpoint"
+"(watchpoint) hit."
+msgstr ""
+
+#: command.y:825
+msgid "condition num [expr] - set or clear breakpoint or watchpoint condition."
+msgstr ""
+
+#: command.y:827
+msgid "continue [COUNT] - continue program being debugged."
+msgstr ""
+
+#: command.y:829
+msgid "delete [breakpoints] [range] - delete specified breakpoints."
+msgstr ""
+
+#: command.y:831
+msgid "disable [breakpoints] [range] - disable specified breakpoints."
+msgstr ""
+
+#: command.y:833
+msgid "display [var] - print value of variable each time the program stops."
+msgstr ""
+
+#: command.y:835
+msgid "down [N] - move N frames down the stack."
+msgstr ""
+
+#: command.y:837
+msgid "dump [filename] - dump instructions to file or stdout."
+msgstr ""
+
+#: command.y:839
+msgid "enable [once|del] [breakpoints] [range] - enable specified breakpoints."
+msgstr ""
+
+#: command.y:841
+msgid "end - end a list of commands or awk statements."
+msgstr ""
+
+#: command.y:843
+msgid "eval stmt|[p1, p2, ...] - evaluate awk statement(s)."
+msgstr ""
+
+#: command.y:845
+msgid "finish - execute until selected stack frame returns."
+msgstr ""
+
+#: command.y:847
+msgid "frame [N] - select and print stack frame number N."
+msgstr ""
+
+#: command.y:849
+msgid "help [command] - print list of commands or explanation of command."
+msgstr ""
+
+#: command.y:851
+msgid "ignore N COUNT - set ignore-count of breakpoint number N to COUNT."
+msgstr ""
+
+#: command.y:853
+msgid ""
+"info topic - source|sources|variables|functions|break|frame|args|locals|"
+"display|watch."
+msgstr ""
+
+#: command.y:855
+msgid "list [-|+|[filename:]lineno|function|range] - list specified line(s)."
+msgstr ""
+
+#: command.y:857
+msgid "next [COUNT] - step program, proceeding through subroutine calls."
+msgstr ""
+
+#: command.y:859
+msgid ""
+"nexti [COUNT] - step one instruction, but proceed through subroutine calls."
+msgstr ""
+
+#: command.y:861
+msgid "option [name[=value]] - set or display debugger option(s)."
+msgstr ""
+
+#: command.y:863
+msgid "print var [var] - print value of a variable or array."
+msgstr ""
+
+#: command.y:865
+msgid "printf format, [arg], ... - formatted output."
+msgstr ""
+
+#: command.y:867
+msgid "quit - exit debugger."
+msgstr ""
+
+#: command.y:869
+msgid "return [value] - make selected stack frame return to its caller."
+msgstr ""
+
+#: command.y:871
+msgid "run - start or restart executing program."
+msgstr ""
+
+#: command.y:874
+msgid "save filename - save commands from the session to file."
+msgstr ""
+
+#: command.y:877
+msgid "set var = value - assign value to a scalar variable."
+msgstr ""
+
+#: command.y:879
+msgid ""
+"silent - suspends usual message when stopped at a breakpoint/watchpoint."
+msgstr ""
+
+#: command.y:881
+msgid "source file - execute commands from file."
+msgstr ""
+
+#: command.y:883
+msgid "step [COUNT] - step program until it reaches a different source line."
+msgstr ""
+
+#: command.y:885
+msgid "stepi [COUNT] - step one instruction exactly."
+msgstr ""
+
+#: command.y:887
+msgid "tbreak [[filename:]N|function] - set a temporary breakpoint."
+msgstr ""
+
+#: command.y:889
+msgid "trace on|off - print instruction before executing."
+msgstr ""
+
+#: command.y:891
+msgid "undisplay [N] - remove variable(s) from automatic display list."
+msgstr ""
+
+#: command.y:893
+msgid ""
+"until [[filename:]N|function] - execute until program reaches a different "
+"line or line N within current frame."
+msgstr ""
+
+#: command.y:895
+msgid "unwatch [N] - remove variable(s) from watch list."
+msgstr ""
+
+#: command.y:897
+msgid "up [N] - move N frames up the stack."
+msgstr ""
+
+#: command.y:899
+msgid "watch var - set a watchpoint for a variable."
+msgstr ""
+
+#: command.y:1011 debug.c:395 msg.c:128
+#, c-format
+msgid "error: "
+msgstr "error: "
+
+#: command.y:1051
+#, fuzzy, c-format
+msgid "can't read command (%s)\n"
+msgstr "no se puede redirigir desde `%s' (%s)"
+
+#: command.y:1065
+#, fuzzy, c-format
+msgid "can't read command (%s)"
+msgstr "no se puede redirigir desde `%s' (%s)"
+
+#: command.y:1116
+#, fuzzy
+msgid "invalid character in command"
+msgstr "Nombre de clase de caracter inválido"
+
+#: command.y:1152
+#, c-format
+msgid "unknown command - \"%.*s\", try help"
+msgstr ""
+
+#: command.y:1222
+#, c-format
+msgid "%s"
+msgstr ""
+
+#: command.y:1284
+#, fuzzy
+msgid "invalid character"
+msgstr "Caracter de ordenación inválido"
+
+#: command.y:1455
+#, c-format
+msgid "undefined command: %s\n"
+msgstr ""
+
+#: debug.c:246
+msgid "set or show the number of lines to keep in history file."
+msgstr ""
+
+#: debug.c:248
+msgid "set or show the list command window size."
+msgstr ""
+
+#: debug.c:250
+msgid "set or show gawk output file."
+msgstr ""
+
+#: debug.c:252
+msgid "set or show debugger prompt."
+msgstr ""
+
+#: debug.c:254
+msgid "(un)set or show saving of command history (value=on|off)."
+msgstr ""
+
+#: debug.c:256
+msgid "(un)set or show saving of options (value=on|off)."
+msgstr ""
+
+#: debug.c:258
+msgid "(un)set or show instruction tracing (value=on|off)."
+msgstr ""
+
+#: debug.c:339
+msgid "program not running."
+msgstr ""
+
+#: debug.c:442 debug.c:597
+#, fuzzy, c-format
+msgid "can't read source file `%s' (%s)"
+msgstr "no se puede leer el fichero fuente `%s' (%s)"
+
+#: debug.c:447
+#, fuzzy, c-format
+msgid "source file `%s' is empty.\n"
+msgstr "el fichero fuente `%s' está vacío"
+
+#: debug.c:474
+msgid "no current source file."
+msgstr ""
+
+#: debug.c:499
+#, fuzzy, c-format
+msgid "cannot find source file named `%s' (%s)"
+msgstr "no se puede leer el fichero fuente `%s' (%s)"
+
+#: debug.c:523
+#, c-format
+msgid "WARNING: source file `%s' modified since program compilation.\n"
+msgstr ""
+
+#: debug.c:542
+#, c-format
+msgid "line number %d out of range; `%s' has %d lines"
+msgstr ""
+
+#: debug.c:602
+#, fuzzy, c-format
+msgid "unexpected eof while reading file `%s', line %d"
+msgstr "error interno: fichero `%s', línea %d\n"
+
+#: debug.c:611
+#, c-format
+msgid "source file `%s' modified since start of program execution"
+msgstr ""
+
+#: debug.c:723
+#, fuzzy, c-format
+msgid "Current source file: %s\n"
+msgstr "ya se incluyó el fichero fuente `%s'"
+
+#: debug.c:724
+#, c-format
+msgid "Number of lines: %d\n"
+msgstr ""
+
+#: debug.c:731
+#, c-format
+msgid "Source file (lines): %s (%d)\n"
+msgstr ""
+
+#: debug.c:745
+msgid ""
+"Number Disp Enabled Location\n"
+"\n"
+msgstr ""
+
+#: debug.c:756
+#, c-format
+msgid "\tno of hits = %ld\n"
+msgstr ""
+
+#: debug.c:758
+#, c-format
+msgid "\tignore next %ld hit(s)\n"
+msgstr ""
+
+#: debug.c:760 debug.c:900
+#, c-format
+msgid "\tstop condition: %s\n"
+msgstr ""
+
+#: debug.c:762 debug.c:902
+msgid "\tcommands:\n"
+msgstr ""
+
+#: debug.c:784
+#, c-format
+msgid "Current frame: "
+msgstr ""
+
+#: debug.c:787
+#, c-format
+msgid "Called by frame: "
+msgstr ""
+
+#: debug.c:791
+#, c-format
+msgid "Caller of frame: "
+msgstr ""
+
+#: debug.c:809
+#, c-format
+msgid "None in main().\n"
+msgstr ""
+
+#: debug.c:839
+#, fuzzy
+msgid "No arguments.\n"
+msgstr "printf: sin argumentos"
+
+#: debug.c:840
+msgid "No locals.\n"
+msgstr ""
+
+#: debug.c:848
+msgid ""
+"All defined variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:858
+msgid ""
+"All defined functions:\n"
+"\n"
+msgstr ""
+
+#: debug.c:877
+msgid ""
+"Auto-display variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:880
+msgid ""
+"Watch variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:1020
+#, fuzzy, c-format
+msgid "no symbol `%s' in current context\n"
+msgstr "`exit' no se puede llamar en el contexto actual"
+
+#: debug.c:1032 debug.c:1416
+#, fuzzy, c-format
+msgid "`%s' is not an array\n"
+msgstr "`%s' no es un nombre de variable legal"
+
+#: debug.c:1046
+#, fuzzy, c-format
+msgid "$%ld = uninitialized field\n"
+msgstr "referencia al campo sin inicializar `$%d'"
+
+#: debug.c:1067
+#, fuzzy, c-format
+msgid "array `%s' is empty\n"
+msgstr "el fichero de datos `%s' está vacío"
+
+#: debug.c:1110 debug.c:1162
+#, fuzzy, c-format
+msgid "[\"%s\"] not in array `%s'\n"
+msgstr "delete: el índice `%s' no está en la matriz `%s'"
+
+#: debug.c:1166
+#, c-format
+msgid "`%s[\"%s\"]' is not an array\n"
+msgstr ""
+
+#: debug.c:1227 debug.c:4947
+#, fuzzy, c-format
+msgid "`%s' is not a scalar variable"
+msgstr "`%s' no es un nombre de variable legal"
+
+#: debug.c:1249 debug.c:4977
+#, fuzzy, c-format
+msgid "attempt to use array `%s[\"%s\"]' in a scalar context"
+msgstr "se intentó usar la matriz `%s[\"%.*s\"]' en un contexto escalar"
+
+#: debug.c:1269 debug.c:4988
+#, fuzzy, c-format
+msgid "attempt to use scalar `%s[\"%s\"]' as array"
+msgstr "se intentó usar el dato escalar `%s[\"%.*s\"]' como una matriz"
+
+#: debug.c:1412
+#, fuzzy, c-format
+msgid "`%s' is a function"
+msgstr "`%s' es inválido como un nombre de función"
+
+#: debug.c:1454
+#, c-format
+msgid "watchpoint %d is unconditional\n"
+msgstr ""
+
+#: debug.c:1488
+#, c-format
+msgid "No display item numbered %ld"
+msgstr ""
+
+#: debug.c:1491
+#, c-format
+msgid "No watch item numbered %ld"
+msgstr ""
+
+#: debug.c:1517
+#, fuzzy, c-format
+msgid "%d: [\"%s\"] not in array `%s'\n"
+msgstr "delete: el índice `%s' no está en la matriz `%s'"
+
+#: debug.c:1756
+#, fuzzy
+msgid "attempt to use scalar value as array"
+msgstr "se intentó usar un valor escalar como una matriz"
+
+#: debug.c:1845
+#, c-format
+msgid "Watchpoint %d deleted because parameter is out of scope.\n"
+msgstr ""
+
+#: debug.c:1856
+#, c-format
+msgid "Display %d deleted because parameter is out of scope.\n"
+msgstr ""
+
+#: debug.c:1889
+#, fuzzy, c-format
+msgid " in file `%s', line %d\n"
+msgstr "error interno: fichero `%s', línea %d\n"
+
+#: debug.c:1910
+#, c-format
+msgid " at `%s':%d"
+msgstr ""
+
+#: debug.c:1926 debug.c:1989
+#, c-format
+msgid "#%ld\tin "
+msgstr ""
+
+#: debug.c:1963
+#, c-format
+msgid "More stack frames follow ...\n"
+msgstr ""
+
+#: debug.c:2006
+#, fuzzy
+msgid "invalid frame number"
+msgstr "Final de rango inválido"
+
+#: debug.c:2178
+#, c-format
+msgid "Note: breakpoint %d (enabled, ignore next %ld hits), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2185
+#, c-format
+msgid "Note: breakpoint %d (enabled), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2192
+#, c-format
+msgid "Note: breakpoint %d (disabled, ignore next %ld hits), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2199
+#, c-format
+msgid "Note: breakpoint %d (disabled), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2216
+#, fuzzy, c-format
+msgid "Breakpoint %d set at file `%s', line %d\n"
+msgstr "error interno: fichero `%s', línea %d\n"
+
+#: debug.c:2318
+#, c-format
+msgid "Can't set breakpoint in file `%s'\n"
+msgstr ""
+
+#: debug.c:2347 debug.c:2470 debug.c:3328
+#, fuzzy, c-format
+msgid "line number %d in file `%s' out of range"
+msgstr "exp: el argumento %g está fuera de rango"
+
+#: debug.c:2351
+#, c-format
+msgid "Can't find rule!!!\n"
+msgstr ""
+
+#: debug.c:2353
+#, c-format
+msgid "Can't set breakpoint at `%s':%d\n"
+msgstr ""
+
+#: debug.c:2365
+#, c-format
+msgid "Can't set breakpoint in function `%s'\n"
+msgstr ""
+
+#: debug.c:2381
+#, c-format
+msgid "breakpoint %d set at file `%s', line %d is unconditional\n"
+msgstr ""
+
+#: debug.c:2486 debug.c:2508
+#, c-format
+msgid "Deleted breakpoint %d"
+msgstr ""
+
+#: debug.c:2492
+#, c-format
+msgid "No breakpoint(s) at entry to function `%s'\n"
+msgstr ""
+
+#: debug.c:2519
+#, fuzzy, c-format
+msgid "No breakpoint at file `%s', line #%d\n"
+msgstr "error interno: fichero `%s', línea %d\n"
+
+#: debug.c:2574 debug.c:2615 debug.c:2635 debug.c:2678
+msgid "invalid breakpoint number"
+msgstr ""
+
+#: debug.c:2590
+msgid "Delete all breakpoints? (y or n) "
+msgstr ""
+
+#: debug.c:2591 debug.c:2901 debug.c:2954
+msgid "y"
+msgstr ""
+
+#: debug.c:2640
+#, c-format
+msgid "Will ignore next %ld crossing(s) of breakpoint %d.\n"
+msgstr ""
+
+#: debug.c:2644
+#, c-format
+msgid "Will stop next time breakpoint %d is reached.\n"
+msgstr ""
+
+#: debug.c:2761
+#, c-format
+msgid "Can only debug programs provided with the `-f' option.\n"
+msgstr ""
+
+#: debug.c:2886
+#, c-format
+msgid "Failed to restart debugger"
+msgstr ""
+
+#: debug.c:2900
+msgid "Program already running. Restart from beginning (y/n)? "
+msgstr ""
+
+#: debug.c:2904
+#, c-format
+msgid "Program not restarted\n"
+msgstr ""
+
+#: debug.c:2914
+#, c-format
+msgid "error: cannot restart, operation not allowed\n"
+msgstr ""
+
+#: debug.c:2920
+#, c-format
+msgid "error (%s): cannot restart, ignoring rest of the commands\n"
+msgstr ""
+
+#: debug.c:2928
+#, c-format
+msgid "Starting program: \n"
+msgstr ""
+
+#: debug.c:2937
+#, c-format
+msgid "Program exited %s with exit value: %d\n"
+msgstr ""
+
+#: debug.c:2953
+msgid "The program is running. Exit anyway (y/n)? "
+msgstr ""
+
+#: debug.c:2988
+#, c-format
+msgid "Not stopped at any breakpoint; argument ignored.\n"
+msgstr ""
+
+#: debug.c:2993
+#, c-format
+msgid "invalid breakpoint number %d."
+msgstr ""
+
+#: debug.c:2998
+#, c-format
+msgid "Will ignore next %ld crossings of breakpoint %d.\n"
+msgstr ""
+
+#: debug.c:3185
+#, c-format
+msgid "'finish' not meaningful in the outermost frame main()\n"
+msgstr ""
+
+#: debug.c:3190
+#, c-format
+msgid "Run till return from "
+msgstr ""
+
+#: debug.c:3233
+#, c-format
+msgid "'return' not meaningful in the outermost frame main()\n"
+msgstr ""
+
+#: debug.c:3347
+#, c-format
+msgid "Can't find specified location in function `%s'\n"
+msgstr ""
+
+#: debug.c:3355
+#, fuzzy, c-format
+msgid "invalid source line %d in file `%s'"
+msgstr "ya se incluyó el fichero fuente `%s'"
+
+#: debug.c:3370
+#, c-format
+msgid "Can't find specified location %d in file `%s'\n"
+msgstr ""
+
+#: debug.c:3402
+#, fuzzy, c-format
+msgid "element not in array\n"
+msgstr "delete: el índice `%s' no está en la matriz `%s'"
+
+#: debug.c:3402
+#, c-format
+msgid "untyped variable\n"
+msgstr ""
+
+#: debug.c:3444
+#, c-format
+msgid "Stopping in %s ...\n"
+msgstr ""
+
+#: debug.c:3521
+#, c-format
+msgid "'finish' not meaningful with non-local jump '%s'\n"
+msgstr ""
+
+#: debug.c:3528
+#, c-format
+msgid "'until' not meaningful with non-local jump '%s'\n"
+msgstr ""
+
+#: debug.c:4163
+msgid "\t------[Enter] to continue or q [Enter] to quit------"
+msgstr ""
+
+#: debug.c:4164
+msgid "q"
+msgstr ""
+
+#: debug.c:4984
+#, fuzzy, c-format
+msgid "[\"%s\"] not in array `%s'"
+msgstr "delete: el índice `%s' no está en la matriz `%s'"
+
+#: debug.c:5190
+#, c-format
+msgid "sending output to stdout\n"
+msgstr ""
+
+#: debug.c:5230
+msgid "invalid number"
+msgstr ""
+
+#: debug.c:5362
+#, fuzzy, c-format
+msgid "`%s' not allowed in current context; statement ignored"
+msgstr "`exit' no se puede llamar en el contexto actual"
+
+#: debug.c:5370
+#, fuzzy
+msgid "`return' not allowed in current context; statement ignored"
+msgstr "`exit' no se puede llamar en el contexto actual"
+
+#: debug.c:5571
+#, fuzzy, c-format
+msgid "No symbol `%s' in current context"
+msgstr "se intentó usar la matriz `%s' en un contexto escalar"
+
+#: dfa.c:984 dfa.c:987 dfa.c:1007 dfa.c:1017 dfa.c:1029 dfa.c:1080 dfa.c:1089
+#: dfa.c:1092 dfa.c:1097 dfa.c:1110 dfa.c:1178
+#, fuzzy
+msgid "unbalanced ["
+msgstr "[ desbalanceado"
+
+#: dfa.c:1038
+#, fuzzy
+msgid "invalid character class"
+msgstr "Nombre de clase de caracter inválido"
+
+#: dfa.c:1215
+msgid "character class syntax is [[:space:]], not [:space:]"
+msgstr ""
+
+#: dfa.c:1267
+#, fuzzy
+msgid "unfinished \\ escape"
+msgstr "Escape \\ sin terminar"
+
+#: dfa.c:1414 regcomp.c:161
+msgid "Invalid content of \\{\\}"
+msgstr "Contenido inválido de \\{\\}"
+
+#: dfa.c:1417 regcomp.c:176
+msgid "Regular expression too big"
+msgstr "La expresión regular es demasiado grande"
+
+#: dfa.c:1802
+#, fuzzy
+msgid "unbalanced ("
+msgstr "( desbalanceado"
+
+#: dfa.c:1929
+#, fuzzy
+msgid "no syntax specified"
+msgstr "No se especifican los bits de sintaxis de la expresión regular"
+
+#: dfa.c:1937
+#, fuzzy
+msgid "unbalanced )"
+msgstr ") desbalanceado"
+
+#: eval.c:394
#, c-format
msgid "unknown nodetype %d"
msgstr "tipo de nodo %d desconocido"
-#: eval.c:423 eval.c:437
+#: eval.c:405 eval.c:419
#, c-format
msgid "unknown opcode %d"
msgstr "código de operación %d desconocido"
-#: eval.c:434
+#: eval.c:416
#, c-format
msgid "opcode %s not an operator or keyword"
msgstr "el código de operación %s no es un operador o una palabra clave"
-#: eval.c:488
+#: eval.c:471
msgid "buffer overflow in genflags2str"
msgstr "desbordamiento de almacenamiento temporal en genflags2str"
-#: eval.c:698
+#: eval.c:674
#, c-format
msgid ""
"\n"
@@ -1006,314 +1859,541 @@ msgstr ""
"\t# Pila de Llamadas de Funciones:\n"
"\n"
-#: eval.c:725
+#: eval.c:703
msgid "`IGNORECASE' is a gawk extension"
msgstr "`IGNORECASE' es una extensión de gawk"
-#: eval.c:754
+#: eval.c:735
msgid "`BINMODE' is a gawk extension"
msgstr "`BINMODE' es una extensión de gawk"
-#: eval.c:812
+#: eval.c:792
#, c-format
msgid "BINMODE value `%s' is invalid, treated as 3"
msgstr "el valor BINMODE `%s' es inválido; se trata como 3"
-#: eval.c:902
+#: eval.c:884
#, c-format
msgid "bad `%sFMT' specification `%s'"
msgstr "especificación `%sFMT' `%s' errónea"
-#: eval.c:980
+#: eval.c:968
msgid "turning off `--lint' due to assignment to `LINT'"
msgstr "se desactiva `--lint' debido a una asignación a `LINT'"
-#: eval.c:1127 eval.c:1777
-#, c-format
-msgid "can't use function name `%s' as variable or array"
-msgstr "no se puede usar el nombre de la función `%s' como variable o matriz"
-
-#: eval.c:1158 eval.c:1789 eval.c:1802
+#: eval.c:1144
#, c-format
msgid "reference to uninitialized argument `%s'"
msgstr "referencia al argumento sin inicializar `%s'"
-#: eval.c:1177
+#: eval.c:1145
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "referencia a la variable sin inicializar `%s'"
+
+#: eval.c:1163
msgid "attempt to field reference from non-numeric value"
msgstr "se intentó una referencia de campo desde un valor que no es númerico"
-#: eval.c:1179
+#: eval.c:1165
msgid "attempt to field reference from null string"
msgstr "se intentó una referencia de campo desde una cadena nula"
-#: eval.c:1185
+#: eval.c:1173
#, c-format
msgid "attempt to access field %ld"
msgstr "se intentó acceder al campo %ld"
-#: eval.c:1194
+#: eval.c:1182
#, c-format
msgid "reference to uninitialized field `$%ld'"
msgstr "referencia al campo sin inicializar `$%ld'"
-#: eval.c:1256
+#: eval.c:1269
#, c-format
msgid "function `%s' called with more arguments than declared"
msgstr "se llamó a la función `%s' con más argumentos de los declarados"
-#: eval.c:1437
+#: eval.c:1464
#, c-format
msgid "unwind_stack: unexpected type `%s'"
msgstr "unwind_stack: tipo `%s' inesperado"
-#: eval.c:1532
+#: eval.c:1558
msgid "division by zero attempted in `/='"
msgstr "se intentó una división por cero en `/='"
-#: eval.c:1539
+#: eval.c:1565
#, c-format
msgid "division by zero attempted in `%%='"
msgstr "se intentó una división por cero en `%%='"
-#: eval.c:1876 eval.c:2122
-#, c-format
-msgid "attempt to use array `%s[\"%.*s\"]' in a scalar context"
-msgstr "se intentó usar la matriz `%s[\"%.*s\"]' en un contexto escalar"
-
-#: eval.c:1907
-msgid "assignment used in conditional context"
-msgstr "se usó una asignación en un contexto condicional"
-
-#: eval.c:1911
-msgid "statement has no effect"
-msgstr "la declaración no tiene efecto"
-
-#: eval.c:2343
-#, c-format
-msgid "for loop: array `%s' changed size from %ld to %ld during loop execution"
-msgstr ""
-"bucle for: la matriz `%s' cambió de tamaño de %ld a %ld durante la ejecución "
-"del bucle"
-
-#: eval.c:2458
-#, c-format
-msgid "function called indirectly through `%s' does not exist"
-msgstr "no existe la función llamada indirectamente a través de `%s'"
-
-#: eval.c:2470
-#, c-format
-msgid "function `%s' not defined"
-msgstr "la función `%s' no está definida"
-
-#: eval.c:2511
-#, c-format
-msgid "non-redirected `getline' invalid inside `%s' rule"
-msgstr "`getline' no redirigido es inválido dentro de la regla `%s'"
-
-#: eval.c:2600
-#, c-format
-msgid "error reading input file `%s': %s"
-msgstr "error al leer el fichero de entrada `%s': %s"
-
-#: eval.c:2614
-#, c-format
-msgid "`nextfile' cannot be called from a `%s' rule"
-msgstr "`nextfile' no se puede llamar desde una regla `%s'"
-
-#: eval.c:2661
-msgid "`exit' cannot be called in the current context"
-msgstr "`exit' no se puede llamar en el contexto actual"
-
-#: eval.c:2700
-#, c-format
-msgid "`next' cannot be called from a `%s' rule"
-msgstr "`next' no se puede llamar desde una regla `%s'"
-
-#: eval.c:2766
-#, c-format
-msgid "Sorry, don't know how to interpret `%s'"
-msgstr "Perdón, no se cómo interpretar `%s'"
-
-#: ext.c:54
+#: ext.c:49
msgid "extensions are not allowed in sandbox mode"
msgstr "no se permiten las extensiones en modo sandbox"
-#: ext.c:60 ext.c:65
-msgid "`extension' is a gawk extension"
-msgstr "`extension' es una extensión de gawk"
+#: ext.c:52
+#, fuzzy
+msgid "-l / @load are gawk extensions"
+msgstr "@include es una extensión de gawk"
-#: ext.c:75
-#, c-format
-msgid "fatal: extension: cannot open `%s' (%s)\n"
+#: ext.c:55
+msgid "load_ext: received NULL lib_name"
+msgstr ""
+
+#: ext.c:58
+#, fuzzy, c-format
+msgid "load_ext: cannot open library `%s' (%s)\n"
msgstr "fatal: extension: no se puede abrir `%s' (%s)\n"
-#: ext.c:84
-#, c-format
+#: ext.c:64
+#, fuzzy, c-format
msgid ""
-"fatal: extension: library `%s': does not define "
-"`plugin_is_GPL_compatible' (%s)\n"
+"load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n"
msgstr ""
"fatal: extension: la biblioteca `%s': no define "
"`plugin_is_GPL_compatible' (%s)\n"
-#: ext.c:93
-#, c-format
-msgid "fatal: extension: library `%s': cannot call function `%s' (%s)\n"
+#: ext.c:70
+#, fuzzy, c-format
+msgid "load_ext: library `%s': cannot call function `%s' (%s)\n"
msgstr ""
"fatal: extension: la biblioteca `%s': no puede llamar a la función `"
"%s' (%s)\n"
-#: ext.c:127
-msgid "extension: missing function name"
+#: ext.c:74
+#, c-format
+msgid "load_ext: library `%s' initialization routine `%s' failed\n"
+msgstr ""
+
+#: ext.c:93
+#, fuzzy
+msgid "make_builtin: missing function name"
msgstr "extension: falta el nombre de la función"
-#: ext.c:132
-#, c-format
-msgid "extension: illegal character `%c' in function name `%s'"
+#: ext.c:98
+#, fuzzy, c-format
+msgid "make_builtin: illegal character `%c' in function name `%s'"
msgstr "extension: carácter ilegal `%c' en el nombre de la función `%s'"
-#: ext.c:141
-#, c-format
-msgid "extension: can't redefine function `%s'"
+#: ext.c:106
+#, fuzzy, c-format
+msgid "make_builtin: can't redefine function `%s'"
msgstr "extension: no se puede redefinir la función `%s'"
-#: ext.c:145
-#, c-format
-msgid "extension: function `%s' already defined"
+#: ext.c:110
+#, fuzzy, c-format
+msgid "make_builtin: function `%s' already defined"
msgstr "extension: la función `%s' ya está definida"
-#: ext.c:150
-#, c-format
-msgid "extension: function name `%s' previously defined"
+#: ext.c:114
+#, fuzzy, c-format
+msgid "make_builtin: function name `%s' previously defined"
msgstr "extension: el nombre de función `%s' se definió previamente"
-#: ext.c:152
-#, c-format
-msgid "extension: can't use gawk built-in `%s' as function name"
+#: ext.c:116
+#, fuzzy, c-format
+msgid "make_builtin: can't use gawk built-in `%s' as function name"
msgstr ""
"extension: no se puede utilizar la orden interna de gawk `%s' como nombre de "
"función"
-#: ext.c:156
+#: ext.c:119
#, c-format
msgid "make_builtin: negative argument count for function `%s'"
msgstr "make_builtin: cuenta de argumento negativa para la función `%s'"
-#: ext.c:259
+#: ext.c:183
#, c-format
msgid "function `%s' defined to take no more than %d argument(s)"
msgstr "la función `%s' se definió para tomar no más de %d argumento(s)"
-#: ext.c:262
+#: ext.c:186
#, c-format
msgid "function `%s': missing argument #%d"
msgstr "función `%s': falta el argumento #%d"
-#: ext.c:279
+#: ext.c:203
#, c-format
msgid "function `%s': argument #%d: attempt to use scalar as an array"
msgstr ""
"función `%s': argumento #%d: se intentó usar un escalar como una matriz"
-#: ext.c:283
+#: ext.c:207
#, c-format
msgid "function `%s': argument #%d: attempt to use array as a scalar"
msgstr ""
"función `%s': argumento #%d: se intentó usar una matriz como un escalar"
-#: ext.c:296
-msgid "Operation Not Supported"
-msgstr "No Se Admite La Operación"
+#: ext.c:221
+msgid "dynamic loading of library not supported"
+msgstr ""
+
+#: extension/filefuncs.c:75
+#, fuzzy
+msgid "chdir: called with incorrect number of arguments, expecting 1"
+msgstr "sqrt: se llamó con el argumento negativo %g"
+
+#: extension/filefuncs.c:348
+#, fuzzy
+msgid "stat: called with wrong number of arguments"
+msgstr "sqrt: se llamó con el argumento negativo %g"
+
+#: extension/filefuncs.c:355
+#, fuzzy
+msgid "stat: bad parameters"
+msgstr "%s: es un parámetro\n"
+
+#: extension/filefuncs.c:421
+msgid "fill_stat_element: could not create array"
+msgstr ""
+
+#: extension/filefuncs.c:430
+msgid "fill_stat_element: could not set element"
+msgstr ""
+
+#: extension/filefuncs.c:445
+#, fuzzy
+msgid "fill_path_element: could not set element"
+msgstr "index: el segundo argumento recibido no es una cadena"
+
+#: extension/filefuncs.c:461
+msgid "fill_error_element: could not set element"
+msgstr ""
+
+#: extension/filefuncs.c:508 extension/filefuncs.c:555
+msgid "fts-process: could not create array"
+msgstr ""
+
+#: extension/filefuncs.c:518 extension/filefuncs.c:565
+#: extension/filefuncs.c:583
+#, fuzzy
+msgid "fts-process: could not set element"
+msgstr "index: el segundo argumento recibido no es una cadena"
+
+#: extension/filefuncs.c:632
+#, fuzzy
+msgid "fts: called with incorrect number of arguments, expecting 3"
+msgstr "sqrt: se llamó con el argumento negativo %g"
+
+#: extension/filefuncs.c:635
+#, fuzzy
+msgid "fts: bad first parameter"
+msgstr "%s: es un parámetro\n"
+
+#: extension/filefuncs.c:641
+#, fuzzy
+msgid "fts: bad second parameter"
+msgstr "%s: es un parámetro\n"
+
+#: extension/filefuncs.c:647
+#, fuzzy
+msgid "fts: bad third parameter"
+msgstr "%s: es un parámetro\n"
+
+#: extension/filefuncs.c:654
+#, fuzzy
+msgid "fts: could not flatten array\n"
+msgstr "`%s' no es un nombre de variable legal"
+
+#: extension/filefuncs.c:672
+msgid "fts: ignoring sneaky FTS_NOSTAT flag. nyah, nyah, nyah."
+msgstr ""
+
+#: extension/filefuncs.c:689
+msgid "fts: clear_array failed\n"
+msgstr ""
+
+#: extension/fnmatch.c:91
+#, fuzzy
+msgid "fnmatch: called with less than three arguments"
+msgstr "sqrt: se llamó con el argumento negativo %g"
+
+#: extension/fnmatch.c:94
+#, fuzzy
+msgid "fnmatch: called with more than three arguments"
+msgstr "sqrt: se llamó con el argumento negativo %g"
+
+#: extension/fnmatch.c:97
+#, fuzzy
+msgid "fnmatch: could not get first argument"
+msgstr "strftime: el primer argumento recibido no es una cadena"
+
+#: extension/fnmatch.c:102
+#, fuzzy
+msgid "fnmatch: could not get second argument"
+msgstr "index: el segundo argumento recibido no es una cadena"
+
+#: extension/fnmatch.c:107
+msgid "fnmatch: could not get third argument"
+msgstr ""
+
+#: extension/fnmatch.c:120
+msgid "fnmatch is not implemented on this system\n"
+msgstr ""
+
+#: extension/fnmatch.c:152
+msgid "fnmatch init: could not add FNM_NOMATCH variable"
+msgstr ""
+
+#: extension/fnmatch.c:162
+#, c-format
+msgid "fnmatch init: could not set array element %s"
+msgstr ""
+
+#: extension/fnmatch.c:172
+msgid "fnmatch init: could not install FNM array"
+msgstr ""
+
+#: extension/fork.c:81
+#, fuzzy
+msgid "fork: called with too many arguments"
+msgstr "sqrt: se llamó con el argumento negativo %g"
-#: field.c:328
+#: extension/fork.c:94
+msgid "fork: PROCINFO is not an array!"
+msgstr ""
+
+#: extension/fork.c:118
+#, fuzzy
+msgid "waitpid: called with too many arguments"
+msgstr "sqrt: se llamó con el argumento negativo %g"
+
+#: extension/fork.c:126
+#, fuzzy
+msgid "wait: called with no arguments"
+msgstr "sqrt: se llamó con el argumento negativo %g"
+
+#: extension/fork.c:143
+#, fuzzy
+msgid "wait: called with too many arguments"
+msgstr "sqrt: se llamó con el argumento negativo %g"
+
+#: extension/ordchr.c:69
+#, fuzzy
+msgid "ord: called with too many arguments"
+msgstr "sqrt: se llamó con el argumento negativo %g"
+
+#: extension/ordchr.c:75
+#, fuzzy
+msgid "ord: called with no arguments"
+msgstr "sqrt: se llamó con el argumento negativo %g"
+
+#: extension/ordchr.c:77
+#, fuzzy
+msgid "ord: called with inappropriate argument(s)"
+msgstr "sqrt: se llamó con el argumento negativo %g"
+
+#: extension/ordchr.c:99
+#, fuzzy
+msgid "chr: called with too many arguments"
+msgstr "sqrt: se llamó con el argumento negativo %g"
+
+#: extension/ordchr.c:109
+#, fuzzy
+msgid "chr: called with no arguments"
+msgstr "sqrt: se llamó con el argumento negativo %g"
+
+#: extension/ordchr.c:111
+#, fuzzy
+msgid "chr: called with inappropriate argument(s)"
+msgstr "sqrt: se llamó con el argumento negativo %g"
+
+#: extension/readfile.c:81
+#, fuzzy
+msgid "readfile: called with too many arguments"
+msgstr "sqrt: se llamó con el argumento negativo %g"
+
+#: extension/readfile.c:114
+#, fuzzy
+msgid "readfile: called with no arguments"
+msgstr "sqrt: se llamó con el argumento negativo %g"
+
+#: extension/rwarray.c:120
+#, fuzzy
+msgid "writea: called with too many arguments"
+msgstr "sqrt: se llamó con el argumento negativo %g"
+
+#: extension/rwarray.c:127
+#, fuzzy, c-format
+msgid "do_writea: argument 0 is not a string\n"
+msgstr "exp: el argumento %g está fuera de rango"
+
+#: extension/rwarray.c:133
+#, fuzzy, c-format
+msgid "do_writea: argument 1 is not an array\n"
+msgstr "split: el cuarto argumento no es una matriz"
+
+#: extension/rwarray.c:180
+#, c-format
+msgid "write_array: could not flatten array\n"
+msgstr ""
+
+#: extension/rwarray.c:194
+#, c-format
+msgid "write_array: could not release flattened array\n"
+msgstr ""
+
+#: extension/rwarray.c:276
+#, fuzzy
+msgid "reada: called with too many arguments"
+msgstr "sqrt: se llamó con el argumento negativo %g"
+
+#: extension/rwarray.c:283
+#, fuzzy, c-format
+msgid "do_reada: argument 0 is not a string\n"
+msgstr "exp: el argumento %g está fuera de rango"
+
+#: extension/rwarray.c:289
+#, fuzzy, c-format
+msgid "do_reada: argument 1 is not an array\n"
+msgstr "match: el tercer argumento no es una matriz"
+
+#: extension/rwarray.c:333
+#, c-format
+msgid "do_reada: clear_array failed\n"
+msgstr ""
+
+#: extension/rwarray.c:370
+#, c-format
+msgid "read_array: set_array_element failed\n"
+msgstr ""
+
+#: extension/time.c:78
+#, fuzzy
+msgid "gettimeofday: ignoring arguments"
+msgstr "mktime: se recibió un argumento que no es una cadena"
+
+#: extension/time.c:109
+msgid "gettimeofday: not supported on this platform"
+msgstr ""
+
+#: extension/time.c:130
+#, fuzzy
+msgid "sleep: called with too many arguments"
+msgstr "sqrt: se llamó con el argumento negativo %g"
+
+#: extension/time.c:133
+#, fuzzy
+msgid "sleep: missing required numeric argument"
+msgstr "exp: se recibió un argumento que no es númerico"
+
+#: extension/time.c:139
+#, fuzzy
+msgid "sleep: argument is negative"
+msgstr "exp: el argumento %g está fuera de rango"
+
+#: extension/time.c:166
+msgid "sleep: not supported on this platform"
+msgstr ""
+
+#: field.c:339
msgid "NF set to negative value"
msgstr "se definió NF con un valor negativo"
-#: field.c:951 field.c:958 field.c:962
+#: field.c:962 field.c:969 field.c:973
msgid "split: fourth argument is a gawk extension"
msgstr "split: el cuarto argumento es una extensión de gawk"
-#: field.c:955
+#: field.c:966
msgid "split: fourth argument is not an array"
msgstr "split: el cuarto argumento no es una matriz"
-#: field.c:969
+#: field.c:980
msgid "split: second argument is not an array"
msgstr "split: el segundo argumento no es una matriz"
-#: field.c:973
+#: field.c:984
msgid "split: cannot use the same array for second and fourth args"
msgstr ""
"split: no se puede usar la misma matriz para el segundo y cuarto argumentos"
-#: field.c:978
+#: field.c:989
msgid "split: cannot use a subarray of second arg for fourth arg"
msgstr ""
"split: no se puede usar una submatriz del segundo argumento para el cuarto "
"argumento"
-#: field.c:981
+#: field.c:992
msgid "split: cannot use a subarray of fourth arg for second arg"
msgstr ""
"split: no se puede usar una submatriz del cuarto argumento para el segundo "
"argumento"
-#: field.c:1010
+#: field.c:1021
msgid "split: null string for third arg is a gawk extension"
msgstr ""
"split: la cadena nula para el tercer argumento es una extensión de gawk"
-#: field.c:1050
+#: field.c:1061
msgid "patsplit: fourth argument is not an array"
msgstr "patsplit: el cuarto argumento no es una matriz"
-#: field.c:1055
+#: field.c:1066
msgid "patsplit: second argument is not an array"
msgstr "patsplit: el segundo argumento no es una matriz"
-#: field.c:1061
+#: field.c:1072
msgid "patsplit: third argument must be non-null"
msgstr "patsplit: el tercer argumento no debe ser nulo"
-#: field.c:1065
+#: field.c:1076
msgid "patsplit: cannot use the same array for second and fourth args"
msgstr ""
"patsplit: no se puede usar la misma matriz para el segundo y cuarto "
"argumentos"
-#: field.c:1070
+#: field.c:1081
msgid "patsplit: cannot use a subarray of second arg for fourth arg"
msgstr ""
"patsplit: no se puede usar una submatriz del segundo argumento para el "
"cuarto argumento"
-#: field.c:1073
+#: field.c:1084
msgid "patsplit: cannot use a subarray of fourth arg for second arg"
msgstr ""
"patsplit: no se puede usar una submatriz del cuarto argumento para el "
"segundo argumento"
-#: field.c:1110
+#: field.c:1122
msgid "`FIELDWIDTHS' is a gawk extension"
msgstr "`FIELDWIDTHS' es una extensión gawk"
-#: field.c:1173
+#: field.c:1186
#, c-format
msgid "invalid FIELDWIDTHS value, near `%s'"
msgstr "valor de FIELDWIDTHS inválido, cerca de `%s'"
-#: field.c:1246
+#: field.c:1259
msgid "null string for `FS' is a gawk extension"
msgstr "la cadena nula para `FS' es una extensión de gawk"
-#: field.c:1250
+#: field.c:1263
msgid "old awk does not support regexps as value of `FS'"
msgstr "el awk antiguo no admite expresiones regulares como valor de `FS'"
-#: field.c:1369
+#: field.c:1382
msgid "`FPAT' is a gawk extension"
msgstr "`FPAT' es una extensión de gawk"
+#: gawkapi.c:143
+msgid "awk_value_to_node: received null retval"
+msgstr ""
+
+#: gawkapi.c:932
+#, c-format
+msgid "api_flatten_array: could not convert index %d\n"
+msgstr ""
+
+#: gawkapi.c:937
+#, c-format
+msgid "api_flatten_array: could not convert value %d\n"
+msgstr ""
+
+#: gawkapi.c:1111
+msgid "cannot assign to defined constant"
+msgstr ""
+
#: getopt.c:604 getopt.c:633
#, fuzzy, c-format
msgid "%s: option '%s' is ambiguous; possibilities:"
@@ -1369,472 +2449,536 @@ msgstr "%s: la opción '-W %s' no admite ningún argumento\n"
msgid "%s: option '-W %s' requires an argument\n"
msgstr "%s: la opción '-W %s' requiere un argumento\n"
-#: io.c:280
+#: io.c:339
#, c-format
msgid "command line argument `%s' is a directory: skipped"
msgstr "el argumento de la línea de órdenes `%s' es un directorio: se salta"
-#: io.c:283 io.c:385
+#: io.c:342 io.c:455
#, c-format
msgid "cannot open file `%s' for reading (%s)"
msgstr "no se puede abrir el fichero `%s' para lectura (%s)"
-#: io.c:501
+#: io.c:582
#, c-format
msgid "close of fd %d (`%s') failed (%s)"
msgstr "falló al cerrar el df %d (`%s') (%s)"
-#: io.c:578
+#: io.c:658
msgid "redirection not allowed in sandbox mode"
msgstr "no se permite la redirección en modo sandbox"
-#: io.c:612
+#: io.c:692
#, c-format
msgid "expression in `%s' redirection only has numeric value"
msgstr "la expresión en la redirección `%s' sólo tiene valor numérico"
-#: io.c:618
+#: io.c:698
#, c-format
msgid "expression for `%s' redirection has null string value"
msgstr "la expresión para la redirección `%s' tiene un valor de cadena nula"
-#: io.c:623
+#: io.c:703
#, c-format
msgid "filename `%s' for `%s' redirection may be result of logical expression"
msgstr ""
"el fichero `%s' para la redirección `%s' puede ser resultado de una "
"expresión lógica"
-#: io.c:666
+#: io.c:746
#, c-format
msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
msgstr "mezcla innecesaria de `>' y `>>' para el fichero `%.*s'"
-#: io.c:719
+#: io.c:799
#, c-format
msgid "can't open pipe `%s' for output (%s)"
msgstr "no se puede abrir la tubería `%s' para la salida (%s)"
-#: io.c:729
+#: io.c:809
#, c-format
msgid "can't open pipe `%s' for input (%s)"
msgstr "no se puede abrir la tubería `%s' para la entrada (%s)"
-#: io.c:752
+#: io.c:840
#, c-format
msgid "can't open two way pipe `%s' for input/output (%s)"
msgstr "no se puede abrir la tubería de dos vías `%s' para entrada/salida (%s)"
-#: io.c:834
+#: io.c:923
#, c-format
msgid "can't redirect from `%s' (%s)"
msgstr "no se puede redirigir desde `%s' (%s)"
-#: io.c:837
+#: io.c:926
#, c-format
msgid "can't redirect to `%s' (%s)"
msgstr "no se puede redirigir a `%s' (%s)"
-#: io.c:888
+#: io.c:977
msgid ""
"reached system limit for open files: starting to multiplex file descriptors"
msgstr ""
"se alcanzó el límite del sistema para ficheros abiertos: comenzando a "
"multiplexar los descriptores de fichero"
-#: io.c:904
+#: io.c:993
#, c-format
msgid "close of `%s' failed (%s)."
msgstr "falló al cerrar `%s' (%s)."
-#: io.c:912
+#: io.c:1001
msgid "too many pipes or input files open"
msgstr "demasiadas tuberías o ficheros de entrada abiertos"
-#: io.c:934
+#: io.c:1023
msgid "close: second argument must be `to' or `from'"
msgstr "close: el segundo argumento debe ser `to' o `from'"
-#: io.c:951
+#: io.c:1040
#, c-format
msgid "close: `%.*s' is not an open file, pipe or co-process"
msgstr "close: `%.*s' no es un fichero abierto, tubería o co-proceso"
-#: io.c:956
+#: io.c:1045
msgid "close of redirection that was never opened"
msgstr "se cerró una redirección que nunca se abrió"
-#: io.c:1053
+#: io.c:1142
#, c-format
msgid "close: redirection `%s' not opened with `|&', second argument ignored"
msgstr ""
"close: la redirección `%s' no se abrió con `|&', se descarta el segundo "
"argumento"
-#: io.c:1069
+#: io.c:1159
#, c-format
msgid "failure status (%d) on pipe close of `%s' (%s)"
msgstr "estado de fallo (%d) al cerrar la tubería de `%s' (%s)"
-#: io.c:1072
+#: io.c:1162
#, c-format
msgid "failure status (%d) on file close of `%s' (%s)"
msgstr "estado de fallo (%d) al cerrar el fichero de `%s' (%s)"
-#: io.c:1092
+#: io.c:1182
#, c-format
msgid "no explicit close of socket `%s' provided"
msgstr "no se provee el cerrado explícito del `socket' `%s'"
-#: io.c:1095
+#: io.c:1185
#, c-format
msgid "no explicit close of co-process `%s' provided"
msgstr "no se provee el cerrado explícito del co-proceso `%s'"
-#: io.c:1098
+#: io.c:1188
#, c-format
msgid "no explicit close of pipe `%s' provided"
msgstr "no se provee el cerrado explícito del la tubería `%s'"
-#: io.c:1101
+#: io.c:1191
#, c-format
msgid "no explicit close of file `%s' provided"
msgstr "no se provee el cerrado explícito del fichero `%s'"
-#: io.c:1129 io.c:1184 main.c:797 main.c:834
+#: io.c:1219 io.c:1274 main.c:847 main.c:884
#, c-format
msgid "error writing standard output (%s)"
msgstr "error al escribir en la salida estándar (%s)"
-#: io.c:1133 io.c:1189
+#: io.c:1223 io.c:1279
#, c-format
msgid "error writing standard error (%s)"
msgstr "error al escribir en la salida estándar de error (%s)"
-#: io.c:1141
+#: io.c:1231
#, c-format
msgid "pipe flush of `%s' failed (%s)."
msgstr "falló la limpieza de la tubería de `%s' (%s)."
-#: io.c:1144
+#: io.c:1234
#, c-format
msgid "co-process flush of pipe to `%s' failed (%s)."
msgstr "falló la limpieza del co-proceso de la tubería a `%s' (%s)."
-#: io.c:1147
+#: io.c:1237
#, c-format
msgid "file flush of `%s' failed (%s)."
msgstr "falló la limpieza del fichero de `%s' (%s)."
-#: io.c:1262
+#: io.c:1351
#, c-format
msgid "local port %s invalid in `/inet'"
msgstr "puerto local %s inválido en `/inet'"
-#: io.c:1279
+#: io.c:1369
#, c-format
msgid "remote host and port information (%s, %s) invalid"
msgstr "anfitrión remoto e información de puerto (%s, %s) inválidos"
-#: io.c:1431
+#: io.c:1521
#, c-format
msgid "no (known) protocol supplied in special filename `%s'"
msgstr ""
"no se proporciona algún protocolo (conocido) en el nombre de fichero "
"especial `%s'"
-#: io.c:1445
+#: io.c:1535
#, c-format
msgid "special file name `%s' is incomplete"
msgstr "el nombre de fichero especial `%s' está incompleto"
-#: io.c:1462
+#: io.c:1552
msgid "must supply a remote hostname to `/inet'"
msgstr "se debe proporcionar a `/inet' un nombre de anfitrión remoto"
-#: io.c:1480
+#: io.c:1570
msgid "must supply a remote port to `/inet'"
msgstr "se debe proporcionar a `/inet' un puerto remoto"
-#: io.c:1526
+#: io.c:1616
msgid "TCP/IP communications are not supported"
msgstr "no se admiten las comunicaciones TCP/IP"
-#: io.c:1693
+#: io.c:1785
#, c-format
msgid "could not open `%s', mode `%s'"
msgstr "no se puede abrir `%s', modo `%s'"
-#: io.c:1747
+#: io.c:1835
#, c-format
msgid "close of master pty failed (%s)"
msgstr "falló al cerrar el pty maestro (%s)"
-#: io.c:1749 io.c:1917 io.c:2074
+#: io.c:1837 io.c:2012 io.c:2181
#, c-format
msgid "close of stdout in child failed (%s)"
msgstr "falló al cerrar la salida estándar en el hijo (%s)"
-#: io.c:1752
+#: io.c:1840
#, c-format
msgid "moving slave pty to stdout in child failed (dup: %s)"
msgstr ""
"falló el movimiento del pty esclavo a la salida estándar en el hijo (dup: %s)"
-#: io.c:1754 io.c:1922
+#: io.c:1842 io.c:2017
#, c-format
msgid "close of stdin in child failed (%s)"
msgstr "falló al cerrar la entrada estándar en el hijo (%s)"
-#: io.c:1757
+#: io.c:1845
#, c-format
msgid "moving slave pty to stdin in child failed (dup: %s)"
msgstr ""
"falló el movimiento del pty esclavo a la entrada estándar en el hijo (dup: "
"%s)"
-#: io.c:1759 io.c:1780
+#: io.c:1847 io.c:1868
#, c-format
msgid "close of slave pty failed (%s)"
msgstr "falló al cerrar el pty esclavo (%s)"
-#: io.c:1858 io.c:1920 io.c:2052 io.c:2077
+#: io.c:1953 io.c:2015 io.c:2158 io.c:2184
#, c-format
msgid "moving pipe to stdout in child failed (dup: %s)"
msgstr "falló el movimiento a la salida estándar en el hijo (dup: %s)"
-#: io.c:1865 io.c:1925
+#: io.c:1960 io.c:2020
#, c-format
msgid "moving pipe to stdin in child failed (dup: %s)"
msgstr ""
"falló el movimiento de la tubería a la entrada estándar en el hijo (dup: %s)"
-#: io.c:1885 io.c:2067
+#: io.c:1980 io.c:2174
msgid "restoring stdout in parent process failed\n"
msgstr "falló la restauración de la salida estándar en el proceso padre\n"
-#: io.c:1893
+#: io.c:1988
msgid "restoring stdin in parent process failed\n"
msgstr "falló la restauración de la entrada estándar en el proceso padre\n"
-#: io.c:1928 io.c:2079 io.c:2093
+#: io.c:2023 io.c:2186 io.c:2200
#, c-format
msgid "close of pipe failed (%s)"
msgstr "falló al cerrar la tubería (%s)"
-#: io.c:1973
+#: io.c:2076
msgid "`|&' not supported"
msgstr "no se admite `|&'"
-#: io.c:2039
+#: io.c:2143
#, c-format
msgid "cannot open pipe `%s' (%s)"
msgstr "no se puede abrir la tubería `%s' (%s)"
-#: io.c:2087
+#: io.c:2194
#, c-format
msgid "cannot create child process for `%s' (fork: %s)"
msgstr "no se puede crear el proceso hijo para `%s' (fork: %s)"
-#: io.c:2520
+#: io.c:2652
+msgid "register_input_parser: received NULL pointer"
+msgstr ""
+
+#: io.c:2680
+#, c-format
+msgid "input parser `%s' conflicts with previously installed input parser `%s'"
+msgstr ""
+
+#: io.c:2687
+#, c-format
+msgid "input parser `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2707
+msgid "register_output_wrapper: received NULL pointer"
+msgstr ""
+
+#: io.c:2735
+#, c-format
+msgid ""
+"output wrapper `%s' conflicts with previously installed output wrapper `%s'"
+msgstr ""
+
+#: io.c:2742
+#, c-format
+msgid "output wrapper `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2763
+msgid "register_output_processor: received NULL pointer"
+msgstr ""
+
+#: io.c:2792
+#, c-format
+msgid ""
+"two-way processor `%s' conflicts with previously installed two-way processor "
+"`%s'"
+msgstr ""
+
+#: io.c:2801
+#, c-format
+msgid "two way processor `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2908
#, c-format
msgid "data file `%s' is empty"
msgstr "el fichero de datos `%s' está vacío"
-#: io.c:2561 io.c:2569
+#: io.c:2950 io.c:2958
msgid "could not allocate more input memory"
msgstr "no se puede reservar más memoria de entrada"
-#: io.c:3127
+#: io.c:3524
msgid "multicharacter value of `RS' is a gawk extension"
msgstr "el valor multicaracter de `RS' es una extensión de gawk"
-#: io.c:3232
+#: io.c:3613
msgid "IPv6 communication is not supported"
msgstr "no se admite la comunicación IPv6"
-#: main.c:366
+#: main.c:362
msgid "`-m[fr]' option irrelevant in gawk"
msgstr "la opción -m[fr] es irrelevante en gawk"
-#: main.c:368
+#: main.c:364
msgid "-m option usage: `-m[fr] nnn'"
msgstr "uso de la opción -m: `-m[fr]' nnn"
-#: main.c:391
+#: main.c:393
msgid "empty argument to `-e/--source' ignored"
msgstr "se descarta el argumento vacío para `-e/--source'"
-#: main.c:462
+#: main.c:483
#, c-format
msgid "%s: option `-W %s' unrecognized, ignored\n"
msgstr "%s: no se reconoce la opción `-W %s', se descarta\n"
-#: main.c:515
+#: main.c:529
#, c-format
msgid "%s: option requires an argument -- %c\n"
msgstr "%s: la opción requiere un argumento -- %c\n"
-#: main.c:536
+#: main.c:550
msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
msgstr ""
"la variable de ambiente `POSIXLY_CORRECT' está definida: se activa `--posix'"
-#: main.c:542
+#: main.c:556
msgid "`--posix' overrides `--traditional'"
msgstr "`--posix' se impone a `--traditional'"
-#: main.c:553
+#: main.c:567
msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
msgstr "`--posix'/`--traditional' se imponen a `--non-decimal-data'"
-#: main.c:557
+#: main.c:571
#, c-format
msgid "running %s setuid root may be a security problem"
msgstr "ejecutar %s como setuid root puede ser un problema de seguridad"
-#: main.c:562
+#: main.c:576
#, fuzzy
msgid "`--posix' overrides `--characters-as-bytes'"
msgstr "`--posix' se impone a `--binary'"
-#: main.c:616
+#: main.c:635
#, c-format
msgid "can't set binary mode on stdin (%s)"
msgstr "no se puede establecer el modo binario en la entrada estándar (%s)"
-#: main.c:619
+#: main.c:638
#, c-format
msgid "can't set binary mode on stdout (%s)"
msgstr "no se puede establecer el modo binario en la salida estándar (%s)"
-#: main.c:621
+#: main.c:640
#, c-format
msgid "can't set binary mode on stderr (%s)"
msgstr ""
"no se puede establecer el modo binario en la salida estándar de error (%s)"
-#: main.c:660
+#: main.c:698
msgid "no program text at all!"
msgstr "¡No hay ningún programa de texto!"
-#: main.c:737
+#: main.c:784
#, c-format
msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"
msgstr ""
"Modo de empleo: %s [opciones estilo POSIX o GNU] -f fichprog [--] "
"fichero ...\n"
-#: main.c:739
+#: main.c:786
#, c-format
msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"
msgstr ""
"Modo de empleo: %s [opciones estilo POSIX o GNU] [--] %cprograma%c "
"fichero ...\n"
-#: main.c:744
+#: main.c:791
msgid "POSIX options:\t\tGNU long options: (standard)\n"
msgstr "Opciones POSIX:\t\tOpciones largas GNU: (estándar)\n"
-#: main.c:745
+#: main.c:792
msgid "\t-f progfile\t\t--file=progfile\n"
msgstr "\t-f fichprog\t\t--file=fichprog\n"
-#: main.c:746
+#: main.c:793
msgid "\t-F fs\t\t\t--field-separator=fs\n"
msgstr "\t-F sc\t\t\t--field-separator=sc\n"
-#: main.c:747
+#: main.c:794
msgid "\t-v var=val\t\t--assign=var=val\n"
msgstr "\t-v var=valor\t\t--assign=var=valor\n"
-#: main.c:748
+#: main.c:795
msgid "Short options:\t\tGNU long options: (extensions)\n"
msgstr "Opciones cortas:\t\tOpciones largas GNU: (extensiones)\n"
-#: main.c:749
+#: main.c:796
msgid "\t-b\t\t\t--characters-as-bytes\n"
msgstr "\t-b\t\t\t--characters-as-bytes\n"
-#: main.c:750
+#: main.c:797
msgid "\t-c\t\t\t--traditional\n"
msgstr "\t-c\t\t\t--traditional\n"
-#: main.c:751
+#: main.c:798
msgid "\t-C\t\t\t--copyright\n"
msgstr "\t-C\t\t\t--copyright\n"
-#: main.c:752
+#: main.c:799
msgid "\t-d[file]\t\t--dump-variables[=file]\n"
msgstr "\t-d[fichero]\t\t--dump-variables[=fichero]\n"
+#: main.c:800
+#, fuzzy
+msgid "\t-D[file]\t\t--debug[=file]\n"
+msgstr "\t-p[fichero]\t\t--profile[=fichero]\n"
+
# Esta es la línea más larga de la lista de argumentos.
# Probar con gawk para revisar tabuladores. cfuga
-#: main.c:753
+#: main.c:801
msgid "\t-e 'program-text'\t--source='program-text'\n"
msgstr "\t-e 'texto-prog'\t--source='texto-prog'\n"
-#: main.c:754
+#: main.c:802
msgid "\t-E file\t\t\t--exec=file\n"
msgstr "\t-E fichero\t\t--exec=fichero\n"
-#: main.c:755
+#: main.c:803
msgid "\t-g\t\t\t--gen-pot\n"
msgstr "\t-g\t\t\t--gen-pot\n"
-#: main.c:756
+#: main.c:804
msgid "\t-h\t\t\t--help\n"
msgstr "\t-h\t\t\t--help\n"
-#: main.c:757
+#: main.c:805
+msgid "\t-i includefile\t\t--include=includefile\n"
+msgstr ""
+
+#: main.c:806
+msgid "\t-l library\t\t--load=library\n"
+msgstr ""
+
+#: main.c:807
msgid "\t-L [fatal]\t\t--lint[=fatal]\n"
msgstr "\t-L [fatal]\t\t--lint[=fatal]\n"
-#: main.c:758
+#: main.c:808
msgid "\t-n\t\t\t--non-decimal-data\n"
msgstr "\t-n\t\t\t--non-decimal-data\n"
-#: main.c:759
+#: main.c:809
+#, fuzzy
+msgid "\t-M\t\t\t--bignum\n"
+msgstr "\t-g\t\t\t--gen-pot\n"
+
+#: main.c:810
msgid "\t-N\t\t\t--use-lc-numeric\n"
msgstr "\t-N\t\t\t--use-lc-numeric\n"
-#: main.c:760
+#: main.c:811
+#, fuzzy
+msgid "\t-o[file]\t\t--pretty-print[=file]\n"
+msgstr "\t-p[fichero]\t\t--profile[=fichero]\n"
+
+#: main.c:812
msgid "\t-O\t\t\t--optimize\n"
msgstr "\t-O\t\t\t--optimize\n"
-#: main.c:761
+#: main.c:813
msgid "\t-p[file]\t\t--profile[=file]\n"
msgstr "\t-p[fichero]\t\t--profile[=fichero]\n"
-#: main.c:762
+#: main.c:814
msgid "\t-P\t\t\t--posix\n"
msgstr "\t-P\t\t\t--posix\n"
-#: main.c:763
+#: main.c:815
msgid "\t-r\t\t\t--re-interval\n"
msgstr "\t-r\t\t\t--re-interval\n"
-#: main.c:765
-msgid "\t-R file\t\t\t--command=file\n"
-msgstr "\t-R fichero\t\t\t--command=fichero\n"
-
-#: main.c:766
+#: main.c:816
msgid "\t-S\t\t\t--sandbox\n"
msgstr "\t-S\t\t\t--sandbox\n"
-#: main.c:767
+#: main.c:817
msgid "\t-t\t\t\t--lint-old\n"
msgstr "\t-t\t\t\t--lint-old\n"
-#: main.c:768
+#: main.c:818
msgid "\t-V\t\t\t--version\n"
msgstr "\t-V\t\t\t--version\n"
-#: main.c:770
+#: main.c:820
msgid "\t-W nostalgia\t\t--nostalgia\n"
msgstr "\t-W nostalgia\t\t--nostalgia\n"
-#: main.c:773
+#: main.c:823
msgid "\t-Y\t\t--parsedebug\n"
msgstr "\t-Y\t\t--parsedebug\n"
@@ -1843,7 +2987,7 @@ msgstr "\t-Y\t\t--parsedebug\n"
#. for this application. Please add _another line_ with the
#. address for translation bugs.
#. no-wrap
-#: main.c:782
+#: main.c:832
msgid ""
"\n"
"To report bugs, see node `Bugs' in `gawk.info', which is\n"
@@ -1857,7 +3001,7 @@ msgstr ""
"Reporte los errores de los mensajes en español a <es@li.org>.\n"
"\n"
-#: main.c:786
+#: main.c:836
msgid ""
"gawk is a pattern scanning and processing language.\n"
"By default it reads standard input and writes standard output.\n"
@@ -1867,7 +3011,7 @@ msgstr ""
"Por defecto lee la entrada estándar y escribe en la salida estándar.\n"
"\n"
-#: main.c:790
+#: main.c:840
msgid ""
"Examples:\n"
"\tgawk '{ sum += $1 }; END { print sum }' file\n"
@@ -1877,7 +3021,7 @@ msgstr ""
"\tgawk '{ sum += $1 }; END { print sum }' fichero\n"
"\tgawk -F: '{ print $1 }' /etc/passwd\n"
-#: main.c:810
+#: main.c:860
#, c-format
msgid ""
"Copyright (C) 1989, 1991-%d Free Software Foundation.\n"
@@ -1897,7 +3041,7 @@ msgstr ""
"(a su elección) cualquier versión posterior.\n"
"\n"
-#: main.c:818
+#: main.c:868
msgid ""
"This program is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
@@ -1911,7 +3055,7 @@ msgstr ""
"Licencia Pública General de GNU para más detalles.\n"
"\n"
-#: main.c:824
+#: main.c:874
msgid ""
"You should have received a copy of the GNU General Public License\n"
"along with this program. If not, see http://www.gnu.org/licenses/.\n"
@@ -1920,16 +3064,16 @@ msgstr ""
"junto con este programa. Si no es así, consulte\n"
"http://www.gnu.org/licenses/.\n"
-#: main.c:859
+#: main.c:909
msgid "-Ft does not set FS to tab in POSIX awk"
msgstr "-Ft no establece FS a tabulador en el awk de POSIX"
-#: main.c:1093
+#: main.c:1169
#, c-format
msgid "unknown value for field spec: %d\n"
msgstr "valor desconocido para la especificación de campo: %d\n"
-#: main.c:1174
+#: main.c:1267
#, c-format
msgid ""
"%s: `%s' argument to `-v' not in `var=value' form\n"
@@ -1938,80 +3082,146 @@ msgstr ""
"%s: el argumento `%s' para `-v' no es de la forma `var=valor'\n"
"\n"
-#: main.c:1200
+#: main.c:1293
#, c-format
msgid "`%s' is not a legal variable name"
msgstr "`%s' no es un nombre de variable legal"
-#: main.c:1203
+#: main.c:1296
#, c-format
msgid "`%s' is not a variable name, looking for file `%s=%s'"
msgstr "`%s' no es un nombre de variable, se busca el fichero `%s=%s'"
-#: main.c:1207
+#: main.c:1300
#, c-format
msgid "cannot use gawk builtin `%s' as variable name"
msgstr ""
"no se puede utilizar la orden interna de gawk `%s' como nombre de variable"
-#: main.c:1212
+#: main.c:1305
#, c-format
msgid "cannot use function `%s' as variable name"
msgstr "no se puede usar la función `%s' como nombre de variable"
-#: main.c:1265
+#: main.c:1358
msgid "floating point exception"
msgstr "excepción de coma flotante"
-#: main.c:1272
+#: main.c:1365
msgid "fatal error: internal error"
msgstr "error fatal: error interno"
-#: main.c:1287
+#: main.c:1380
msgid "fatal error: internal error: segfault"
msgstr "error fatal: error interno: falla de segmentación"
-#: main.c:1299
+#: main.c:1392
msgid "fatal error: internal error: stack overflow"
msgstr "error fatal: error interno: desbordamiento de pila"
-#: main.c:1349
+#: main.c:1448
#, c-format
msgid "no pre-opened fd %d"
msgstr "no existe el df %d abierto previamente"
-#: main.c:1356
+#: main.c:1455
#, c-format
msgid "could not pre-open /dev/null for fd %d"
msgstr "no se puede abrir previamente /dev/null para el df %d"
-#: msg.c:63
+#: mpfr.c:563
+#, fuzzy, c-format
+msgid "PREC value `%.*s' is invalid"
+msgstr "el valor BINMODE `%s' es inválido; se trata como 3"
+
+#: mpfr.c:621
+#, fuzzy, c-format
+msgid "RNDMODE value `%.*s' is invalid"
+msgstr "el valor BINMODE `%s' es inválido; se trata como 3"
+
+#: mpfr.c:711
+#, fuzzy, c-format
+msgid "%s: received non-numeric argument"
+msgstr "cos: se recibió un argumento que no es númerico"
+
+#: mpfr.c:813
+#, fuzzy
+msgid "compl(%Rg): negative value will give strange results"
+msgstr "compl(%lf): el valor negativo dará resultados extraños"
+
+#: mpfr.c:817
+#, fuzzy
+msgid "comp(%Rg): fractional value will be truncated"
+msgstr "compl(%lf): el valor fraccionario se truncará"
+
+#: mpfr.c:829
+#, fuzzy, c-format
+msgid "cmpl(%Zd): negative values will give strange results"
+msgstr "compl(%lf): el valor negativo dará resultados extraños"
+
+#: mpfr.c:856
+#, fuzzy, c-format
+msgid "%s: received non-numeric first argument"
+msgstr "or: el primer argumento recibido no es númerico"
+
+#: mpfr.c:858
+#, fuzzy, c-format
+msgid "%s: received non-numeric second argument"
+msgstr "or: el segundo argumento recibido no es númerico"
+
+#: mpfr.c:877
+#, fuzzy
+msgid "%s(%Rg, ..): negative values will give strange results"
+msgstr "or(%lf, %lf): los valores negativos darán resultados extraños"
+
+#: mpfr.c:882
+#, fuzzy
+msgid "%s(%Rg, ..): fractional values will be truncated"
+msgstr "or(%lf, %lf): los valores fraccionarios serán truncados"
+
+#: mpfr.c:895
+#, fuzzy, c-format
+msgid "%s(%Zd, ..): negative values will give strange results"
+msgstr "or(%lf, %lf): los valores negativos darán resultados extraños"
+
+#: mpfr.c:914
+#, fuzzy
+msgid "%s(.., %Rg): negative values will give strange results"
+msgstr "or(%lf, %lf): los valores negativos darán resultados extraños"
+
+#: mpfr.c:919
+#, fuzzy
+msgid "%s(.., %Rg): fractional values will be truncated"
+msgstr "or(%lf, %lf): los valores fraccionarios serán truncados"
+
+#: mpfr.c:932
+#, fuzzy, c-format
+msgid "%s(.., %Zd): negative values will give strange results"
+msgstr "or(%lf, %lf): los valores negativos darán resultados extraños"
+
+#: msg.c:61
#, c-format
msgid "cmd. line:"
msgstr "línea ord.:"
-#: msg.c:107
-msgid "error: "
-msgstr "error: "
-
-#: node.c:406
+#: node.c:436
msgid "backslash at end of string"
msgstr "barra invertida al final de la cadena"
-#: node.c:517
+#: node.c:520
#, c-format
msgid "old awk does not support the `\\%c' escape sequence"
msgstr "el awk antiguo no admite la secuencia de escape `\\%c'"
-#: node.c:568
+#: node.c:571
msgid "POSIX does not allow `\\x' escapes"
msgstr "POSIX no permite escapes `\\x'"
-#: node.c:574
+#: node.c:577
msgid "no hex digits in `\\x' escape sequence"
msgstr "no hay dígitos hexadecimales en la secuencia de escape `\\x'"
-#: node.c:596
+#: node.c:599
#, c-format
msgid ""
"hex escape \\x%.*s of %d characters probably not interpreted the way you "
@@ -2020,12 +3230,12 @@ msgstr ""
"el escape hexadecimal \\x%.*s de %d caracteres tal vez no se interprete de "
"la forma esperada"
-#: node.c:611
+#: node.c:614
#, c-format
msgid "escape sequence `\\%c' treated as plain `%c'"
msgstr "la secuencia de escape `\\%c' se trata como una simple `%c'"
-#: node.c:750
+#: node.c:759
msgid ""
"Invalid multibyte data detected. There may be a mismatch between your data "
"and your locale."
@@ -2033,27 +3243,27 @@ msgstr ""
"Se detectaron datos multibyte inválidos. Puede ser que no coincidan sus "
"datos con su local."
-#: posix/gawkmisc.c:176
+#: posix/gawkmisc.c:177
#, c-format
msgid "%s %s `%s': could not get fd flags: (fcntl F_GETFD: %s)"
msgstr ""
"%s %s `%s': no se pueden obtener las opciones del fd: (fcntl F_GETFD: %s)"
-#: posix/gawkmisc.c:188
+#: posix/gawkmisc.c:189
#, c-format
msgid "%s %s `%s': could not set close-on-exec: (fcntl F_SETFD: %s)"
msgstr "%s %s `%s': no se puede establecer close-on-exec: (fcntl F_SETFD: %s)"
-#: profile.c:83
+#: profile.c:70
#, c-format
msgid "could not open `%s' for writing: %s"
msgstr "no se puede abrir `%s' para escritura: %s"
-#: profile.c:85
+#: profile.c:72
msgid "sending profile to standard error"
msgstr "se envía el perfil a la salida estándar de error"
-#: profile.c:203
+#: profile.c:188
#, c-format
msgid ""
"\t# %s block(s)\n"
@@ -2062,7 +3272,7 @@ msgstr ""
"\t# bloque(s) %s\n"
"\n"
-#: profile.c:208
+#: profile.c:193
#, c-format
msgid ""
"\t# Rule(s)\n"
@@ -2071,17 +3281,22 @@ msgstr ""
"\t# Regla(s)\n"
"\n"
-#: profile.c:279
+#: profile.c:267
#, c-format
msgid "internal error: %s with null vname"
msgstr "error interno: %s con vname nulo"
-#: profile.c:952
+#: profile.c:529
+#, fuzzy
+msgid "internal error: builtin with null fname"
+msgstr "error interno: %s con vname nulo"
+
+#: profile.c:944
#, c-format
msgid "\t# gawk profile, created %s\n"
msgstr "\t# perfil de gawk, creado %s\n"
-#: profile.c:1331
+#: profile.c:1329
#, c-format
msgid ""
"\n"
@@ -2090,17 +3305,17 @@ msgstr ""
"\n"
"\t# Funciones, enumeradas alfabéticamente\n"
-#: profile.c:1370
+#: profile.c:1367
#, c-format
msgid "redir2str: unknown redirection type %d"
msgstr "redir2str: tipo de redirección %d desconocida"
-#: re.c:573
+#: re.c:568
#, c-format
msgid "range of the form `[%c-%c]' is locale dependent"
msgstr "el rango de la forma `[%c-%c]' depende del local"
-#: re.c:600
+#: re.c:595
#, c-format
msgid "regexp component `%.*s' should probably be `[%.*s]'"
msgstr ""
@@ -2146,10 +3361,6 @@ msgstr "( o \\( desemparejados"
msgid "Unmatched \\{"
msgstr "\\{ desemparejado"
-#: regcomp.c:161
-msgid "Invalid content of \\{\\}"
-msgstr "Contenido inválido de \\{\\}"
-
#: regcomp.c:164
msgid "Invalid range end"
msgstr "Final de rango inválido"
@@ -2166,10 +3377,6 @@ msgstr "Expresión regular precedente inválida"
msgid "Premature end of regular expression"
msgstr "Fin prematuro de la expresión regular"
-#: regcomp.c:176
-msgid "Regular expression too big"
-msgstr "La expresión regular es demasiado grande"
-
#: regcomp.c:179
msgid "Unmatched ) or \\)"
msgstr ") o \\) desemparejados"
@@ -2178,12 +3385,104 @@ msgstr ") o \\) desemparejados"
msgid "No previous regular expression"
msgstr "No hay una expresión regular previa"
+#: symbol.c:722
+msgid "can not pop main context"
+msgstr ""
+
#~ msgid "`nextfile' is a gawk extension"
#~ msgstr "`nextfile' es una extensión de gawk"
#~ msgid "`delete array' is a gawk extension"
#~ msgstr "`delete array' es una extensión de gawk"
+#~ msgid "and: received non-numeric first argument"
+#~ msgstr "and: el primer argumento recibido no es númerico"
+
+#~ msgid "and: received non-numeric second argument"
+#~ msgstr "and: el segundo argumento recibido no es númerico"
+
+#~ msgid "and(%lf, %lf): fractional values will be truncated"
+#~ msgstr "and(%lf, %lf): los valores fraccionarios serán truncados"
+
+#~ msgid "xor: received non-numeric first argument"
+#~ msgstr "xor: el primer argumento recibido no es númerico"
+
+#~ msgid "xor: received non-numeric second argument"
+#~ msgstr "xor: el segundo argumento recibido no es númerico"
+
+#~ msgid "xor(%lf, %lf): fractional values will be truncated"
+#~ msgstr "xor(%lf, %lf): los valores fraccionarios se truncarán"
+
+#~ msgid "`extension' is a gawk extension"
+#~ msgstr "`extension' es una extensión de gawk"
+
+#~ msgid "Operation Not Supported"
+#~ msgstr "No Se Admite La Operación"
+
+#~ msgid "attempt to use function `%s' as an array"
+#~ msgstr "se intentó usar la función `%s' como una matriz"
+
+#~ msgid "reference to uninitialized element `%s[\"%.*s\"]'"
+#~ msgstr "referencia al elemento sin inicializar `%s[\"%.*s\"]'"
+
+#~ msgid "subscript of array `%s' is null string"
+#~ msgstr "el subíndice de la matriz `%s' es la cadena nula"
+
+#~ msgid "%s: empty (null)\n"
+#~ msgstr "%s: vacío (nulo)\n"
+
+#~ msgid "%s: empty (zero)\n"
+#~ msgstr "%s: vacío (cero)\n"
+
+#~ msgid "%s: table_size = %d, array_size = %d\n"
+#~ msgstr "%s: tamaño_tabla = %d, tamaño_matriz = %d\n"
+
+#~ msgid "%s: array_ref to %s\n"
+#~ msgstr "%s: array_ref a %s\n"
+
+#~ msgid "use of non-array as array"
+#~ msgstr "uso de una matriz que no es matriz"
+
+#~ msgid "can't use function name `%s' as variable or array"
+#~ msgstr ""
+#~ "no se puede usar el nombre de la función `%s' como variable o matriz"
+
+#~ msgid "assignment used in conditional context"
+#~ msgstr "se usó una asignación en un contexto condicional"
+
+#~ msgid "statement has no effect"
+#~ msgstr "la declaración no tiene efecto"
+
+#~ msgid ""
+#~ "for loop: array `%s' changed size from %ld to %ld during loop execution"
+#~ msgstr ""
+#~ "bucle for: la matriz `%s' cambió de tamaño de %ld a %ld durante la "
+#~ "ejecución del bucle"
+
+#~ msgid "function called indirectly through `%s' does not exist"
+#~ msgstr "no existe la función llamada indirectamente a través de `%s'"
+
+#~ msgid "function `%s' not defined"
+#~ msgstr "la función `%s' no está definida"
+
+#~ msgid "non-redirected `getline' invalid inside `%s' rule"
+#~ msgstr "`getline' no redirigido es inválido dentro de la regla `%s'"
+
+#~ msgid "error reading input file `%s': %s"
+#~ msgstr "error al leer el fichero de entrada `%s': %s"
+
+#~ msgid "`nextfile' cannot be called from a `%s' rule"
+#~ msgstr "`nextfile' no se puede llamar desde una regla `%s'"
+
+#~ msgid "`next' cannot be called from a `%s' rule"
+#~ msgstr "`next' no se puede llamar desde una regla `%s'"
+
+#~ msgid "Sorry, don't know how to interpret `%s'"
+#~ msgstr "Perdón, no se cómo interpretar `%s'"
+
+#~ msgid "\t-R file\t\t\t--command=file\n"
+#~ msgstr "\t-R fichero\t\t\t--command=fichero\n"
+
#~ msgid "could not find groups: %s"
#~ msgstr "no se pueden encontrar los grupos: %s"
@@ -2202,9 +3501,6 @@ msgstr "No hay una expresión regular previa"
#~ msgid "attempt to use scalar `%s' as array"
#~ msgstr "se intentó usar el dato escalar `%s' como una matriz"
-#~ msgid "attempt to use array `%s' in scalar context"
-#~ msgstr "se intentó usar la matriz `%s' en un contexto escalar"
-
#~ msgid "call of `length' without parentheses is deprecated by POSIX"
#~ msgstr "la llamada de `length' sin paréntesis está obsoleta por POSIX"
@@ -2353,30 +3649,12 @@ msgstr "No hay una expresión regular previa"
#~ msgid "gsub third parameter is not a changeable object"
#~ msgstr "el tercer argumento de gsub no es un objecto que se puede cambiar"
-#~ msgid "Unbalanced ["
-#~ msgstr "[ desbalanceado"
-
-#~ msgid "Unfinished \\ escape"
-#~ msgstr "Escape \\ sin terminar"
-
#~ msgid "unfinished repeat count"
#~ msgstr "cuenta de repetición sin terminar"
#~ msgid "malformed repeat count"
#~ msgstr "cuenta de repetición malformada"
-#~ msgid "Unbalanced ("
-#~ msgstr "( desbalanceado"
-
-#~ msgid "No regexp syntax bits specified"
-#~ msgstr "No se especifican los bits de sintaxis de la expresión regular"
-
-#~ msgid "Unbalanced )"
-#~ msgstr ") desbalanceado"
-
-#~ msgid "internal error: file `%s', line %d\n"
-#~ msgstr "error interno: fichero `%s', línea %d\n"
-
#~ msgid ""
#~ "\n"
#~ "To report bugs, see node `Bugs' in `gawk.info', which is\n"
diff --git a/po/fi.gmo b/po/fi.gmo
index a0103eb7..2af6320f 100644
--- a/po/fi.gmo
+++ b/po/fi.gmo
Binary files differ
diff --git a/po/fi.po b/po/fi.po
index 19c741be..6878f5b9 100644
--- a/po/fi.po
+++ b/po/fi.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gawk 4.0.0h\n"
"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
-"POT-Creation-Date: 2012-10-13 20:24+0200\n"
+"POT-Creation-Date: 2012-10-13 21:21+0200\n"
"PO-Revision-Date: 2012-03-13 18:00+0200\n"
"Last-Translator: Jorma Karvonen <karvonen.jorma@gmail.com>\n"
"Language-Team: Finnish <translation-team-fi@lists.sourceforge.net>\n"
@@ -17,500 +17,491 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: array.c:140
+#: array.c:266
#, c-format
msgid "from %s"
msgstr "taulukosta %s"
-#: array.c:248
+#: array.c:366
msgid "attempt to use a scalar value as array"
msgstr "yritettiin käyttää skalaariarvoa taulukkona"
-#: array.c:251
-#, c-format
-msgid "attempt to use function `%s' as an array"
-msgstr "yritettiin käyttää funktiota â€%s†taulukkona"
-
-#: array.c:254
+#: array.c:368
#, c-format
msgid "attempt to use scalar parameter `%s' as an array"
msgstr "yritettiin käyttää skalaariparametria â€%s†taulukkona"
-#: array.c:257
+#: array.c:371
#, c-format
msgid "attempt to use scalar `%s' as an array"
msgstr "yritettiin käyttää skalaaria â€%s†taulukkona"
-#: array.c:302 array.c:707 builtin.c:84 builtin.c:1385 builtin.c:1427
-#: builtin.c:1440 builtin.c:1859 builtin.c:1871 eval.c:1135 eval.c:1139
-#: eval.c:1495 eval.c:1812
+#: array.c:418 array.c:584 builtin.c:85 builtin.c:1566 builtin.c:1608
+#: builtin.c:1621 builtin.c:2047 builtin.c:2059 eval.c:1121 eval.c:1125
+#: eval.c:1520
#, c-format
msgid "attempt to use array `%s' in a scalar context"
msgstr "yritettiin käyttää taulukkoa â€%s†skalaarikontekstissa"
-#: array.c:513
-#, c-format
-msgid "reference to uninitialized element `%s[\"%.*s\"]'"
-msgstr "viite alustamattomaan elementtiin â€%s[\"%.*s\"]â€"
-
-#: array.c:519
-#, c-format
-msgid "subscript of array `%s' is null string"
-msgstr "taulukon alaindeksi â€%s†on null-merkkijono"
-
-#: array.c:723
+#: array.c:591
#, c-format
msgid "delete: index `%s' not in array `%s'"
msgstr "delete: indeksi â€%s†ei ole taulukossa â€%sâ€"
-#: array.c:734 eval.c:1865
+#: array.c:605
#, c-format
msgid "attempt to use scalar `%s[\"%.*s\"]' as an array"
msgstr "yritettiin käyttää skalaaria â€%s[\"%.*s\"]†taulukkona"
-#: array.c:910
-#, c-format
-msgid "%s: empty (null)\n"
-msgstr "%s: tyhjä (null)\n"
-
-#: array.c:915
-#, c-format
-msgid "%s: empty (zero)\n"
-msgstr "%s: tyhjä (nolla)\n"
-
-#: array.c:919
-#, c-format
-msgid "%s: table_size = %d, array_size = %d\n"
-msgstr "%s: table_size = %d, array_size = %d\n"
-
-#: array.c:954
-#, c-format
-msgid "%s: is parameter\n"
-msgstr "%s: on parametri\n"
-
-#: array.c:958
-#, c-format
-msgid "%s: array_ref to %s\n"
-msgstr "%s: array_ref-viite taulukkoon %s\n"
-
-#: array.c:963
-msgid "adump: argument not an array"
+#: array.c:784
+#, fuzzy
+msgid "adump: first argument not an array"
msgstr "adump: argumentti ei ole taulukko"
-#: array.c:1086
+#: array.c:823
msgid "asort: second argument not an array"
msgstr "asort: toinen argumentti ei ole taulukko"
-#: array.c:1087
+#: array.c:824
msgid "asorti: second argument not an array"
msgstr "asorti: toinen argumentti ei ole taulukko"
-#: array.c:1094
+#: array.c:831
msgid "asort: first argument not an array"
msgstr "asort: ensimmäinen argumentti ei ole taulukko"
-#: array.c:1095
+#: array.c:832
msgid "asorti: first argument not an array"
msgstr "asorti: ensimmäinen argumentti ei ole taulukko"
-#: array.c:1102
+#: array.c:839
msgid "asort: cannot use a subarray of first arg for second arg"
msgstr ""
"asort: ei voida käyttää ensimmäisen argumentin alitaulukkoa toiselle "
"argumentille"
-#: array.c:1103
+#: array.c:840
msgid "asorti: cannot use a subarray of first arg for second arg"
msgstr ""
"asorti: ei voida käyttää ensimmäisen argumentin alitaulukkoa toiselle "
"argumentille"
-#: array.c:1108
+#: array.c:845
msgid "asort: cannot use a subarray of second arg for first arg"
msgstr ""
"asort: ei voida käyttää toisen argumentin alitaulukkoa ensimmäiselle "
"argumentille"
-#: array.c:1109
+#: array.c:846
msgid "asorti: cannot use a subarray of second arg for first arg"
msgstr ""
"asorti: ei voida käyttää toisen argumentin alitaulukkoa ensimmäiselle "
"argumentille"
-#: array.c:1655
+#: array.c:1314
#, c-format
msgid "`%s' is invalid as a function name"
msgstr "â€%s†on virheellinen funktionimenä"
-#: array.c:1659
+#: array.c:1318
#, c-format
msgid "sort comparison function `%s' is not defined"
msgstr "lajitteluvertailufunktiota â€%s†ei ole määritelty"
-#: awkgram.y:249
+#: awkgram.y:223
#, c-format
msgid "%s blocks must have an action part"
msgstr "%s lohkoilla on oltava toiminto-osa"
-#: awkgram.y:252
+#: awkgram.y:226
msgid "each rule must have a pattern or an action part"
msgstr "jokaisella säännöllä on oltava malli tai toiminto-osa"
-#: awkgram.y:323 awkgram.y:334
+#: awkgram.y:315 awkgram.y:326
msgid "old awk does not support multiple `BEGIN' or `END' rules"
msgstr "vanha awk ei tue useita â€BEGINâ€- tai â€ENDâ€-sääntöjä"
-#: awkgram.y:371
+#: awkgram.y:363
#, c-format
msgid "`%s' is a built-in function, it cannot be redefined"
msgstr "â€%s†on sisäänrakennettu funktio. Sitä ei voi määritellä uudelleen"
-#: awkgram.y:432
+#: awkgram.y:409
msgid "regexp constant `//' looks like a C++ comment, but is not"
msgstr ""
"säännöllisen lausekkeen vakio â€//†näyttää C++-kommentilta, mutta ei ole"
-#: awkgram.y:436
+#: awkgram.y:413
#, c-format
msgid "regexp constant `/%s/' looks like a C comment, but is not"
msgstr ""
"säännöllisen lausekkeen vakio â€/%s/†näyttää C-kommentilta, mutta ei ole"
-#: awkgram.y:528
+#: awkgram.y:505
#, c-format
msgid "duplicate case values in switch body: %s"
msgstr "kaksi samanlaista case-arvoa switch-rakenteen rungossa: %s"
-#: awkgram.y:549
+#: awkgram.y:526
msgid "duplicate `default' detected in switch body"
msgstr "kaksoiskappale â€default†havaittu switch-rungossa"
-#: awkgram.y:809
+#: awkgram.y:786
msgid "`break' is not allowed outside a loop or switch"
msgstr "â€break†ei ole sallittu silmukan tai switch-lauseen ulkopuolella"
-#: awkgram.y:818
+#: awkgram.y:795
msgid "`continue' is not allowed outside a loop"
msgstr "â€continue†ei ole sallittu silmukan ulkopuolella"
-#: awkgram.y:828
+#: awkgram.y:805
#, c-format
msgid "`next' used in %s action"
msgstr "â€next†käytetty %s-toiminnossa"
-#: awkgram.y:837
+#: awkgram.y:814
#, c-format
msgid "`nextfile' used in %s action"
msgstr "â€nextfile†käytetty %s-toiminnossa"
-#: awkgram.y:861
+#: awkgram.y:838
msgid "`return' used outside function context"
msgstr "â€return†käytetty funktiokontekstin ulkopuolella"
-#: awkgram.y:921
+#: awkgram.y:912
msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'"
msgstr ""
"pelkkä â€print†BEGIN- tai END-säännössä pitäisi luultavasti olla â€print \"\"â€"
-#: awkgram.y:1016 awkgram.y:1020
+#: awkgram.y:978 awkgram.y:1027
+msgid "`delete' is not allowed with SYMTAB"
+msgstr ""
+
+#: awkgram.y:980 awkgram.y:1029
+msgid "`delete' is not allowed with FUNCTAB"
+msgstr ""
+
+#: awkgram.y:1014 awkgram.y:1018
msgid "`delete(array)' is a non-portable tawk extension"
msgstr "â€delete(array)†ei ole siirrettävä tawk-laajennus"
-#: awkgram.y:1132
+#: awkgram.y:1139
msgid "multistage two-way pipelines don't work"
msgstr "monivaiheiset kaksisuuntaiset putket eivät toimi"
-#: awkgram.y:1235
+#: awkgram.y:1242
msgid "regular expression on right of assignment"
msgstr "säännöllinen lauseke sijoituksen oikealla puolella"
-#: awkgram.y:1246
+#: awkgram.y:1253
msgid "regular expression on left of `~' or `!~' operator"
msgstr "säännöllinen lauseke â€~â€- tai â€!~â€-operaattorin vasemmalla puolella"
-#: awkgram.y:1262 awkgram.y:1416
+#: awkgram.y:1269 awkgram.y:1420
msgid "old awk does not support the keyword `in' except after `for'"
msgstr "vanha awk ei tue avainsanaa â€in†paitsi â€forâ€-sanan jälkeen"
-#: awkgram.y:1272
+#: awkgram.y:1279
msgid "regular expression on right of comparison"
msgstr "säännöllinen lauseke vertailun oikealla puolella"
-#: awkgram.y:1391
+#: awkgram.y:1395
#, c-format
msgid "`getline var' invalid inside `%s' rule"
msgstr "â€getline var†virheellinen säännön â€%s†sisällä"
-#: awkgram.y:1394 eval.c:2504
+#: awkgram.y:1398
#, c-format
msgid "`getline' invalid inside `%s' rule"
msgstr "â€getline†virheellinen säännön â€%s†sisällä"
-#: awkgram.y:1399
+#: awkgram.y:1403
msgid "non-redirected `getline' undefined inside END action"
msgstr "edelleenohjaamaton â€getline†määrittelemätön END-toiminnon sisällä"
-#: awkgram.y:1418
+#: awkgram.y:1422
msgid "old awk does not support multidimensional arrays"
msgstr "vanha awk ei tue moniulotteisia taulukkoja"
-#: awkgram.y:1514
+#: awkgram.y:1519
msgid "call of `length' without parentheses is not portable"
msgstr "â€lengthâ€-kutsu ilman sulkumerkkejä ei ole siirrettävä"
-#: awkgram.y:1577
+#: awkgram.y:1585
msgid "indirect function calls are a gawk extension"
msgstr "epäsuorat funktiokutsut ovat gawk-laajennus"
-#: awkgram.y:1590
+#: awkgram.y:1598
#, c-format
msgid "can not use special variable `%s' for indirect function call"
msgstr "ei voi käyttää erikoismuuttujaa â€%s†epäsuoralle funktiokutsulle"
-#: awkgram.y:1668
+#: awkgram.y:1676
msgid "invalid subscript expression"
msgstr "virheellinen indeksointilauseke"
-#: awkgram.y:1708
-msgid "use of non-array as array"
-msgstr "ei-taulukon käyttö taulukkona"
-
-#: awkgram.y:1972 awkgram.y:1992 msg.c:98
+#: awkgram.y:2000 awkgram.y:2020 gawkapi.c:203 gawkapi.c:221 msg.c:119
msgid "warning: "
msgstr "varoitus:"
-#: awkgram.y:1990 msg.c:130
+#: awkgram.y:2018 gawkapi.c:189 gawkapi.c:218 msg.c:151
msgid "fatal: "
msgstr "tuhoisa:"
-#: awkgram.y:2040
+#: awkgram.y:2068
msgid "unexpected newline or end of string"
msgstr "odottamaton rivinvaihto tai merkkijonon loppu"
-#: awkgram.y:2297 awkgram.y:2355 awkgram.y:2539
+#: awkgram.y:2335 awkgram.y:2411 awkgram.y:2634 debug.c:517 debug.c:533
+#: debug.c:2790 debug.c:5038
#, c-format
msgid "can't open source file `%s' for reading (%s)"
msgstr "ei voi avata lähdetiedostoa â€%s†lukemista varten (%s)"
-#: awkgram.y:2298 awkgram.y:2356 builtin.c:122
+#: awkgram.y:2336 awkgram.y:2461
+#, fuzzy, c-format
+msgid "can't open shared library `%s' for reading (%s)"
+msgstr "ei voi avata lähdetiedostoa â€%s†lukemista varten (%s)"
+
+#: awkgram.y:2338 awkgram.y:2412 awkgram.y:2462 builtin.c:130 debug.c:5189
msgid "reason unknown"
msgstr "syy tuntematon"
-#: awkgram.y:2314
+#: awkgram.y:2347 awkgram.y:2371
+#, c-format
+msgid "can't include `%s' and use it as a program file"
+msgstr ""
+
+#: awkgram.y:2360
#, c-format
msgid "already included source file `%s'"
msgstr "on jo sisällytetty lähdetiedostoon â€%sâ€"
-#: awkgram.y:2340
+#: awkgram.y:2361
+#, fuzzy, c-format
+msgid "already loaded shared library `%s'"
+msgstr "on jo sisällytetty lähdetiedostoon â€%sâ€"
+
+#: awkgram.y:2396
msgid "@include is a gawk extension"
msgstr "@include on gawk-laajennus"
-#: awkgram.y:2346
+#: awkgram.y:2402
msgid "empty filename after @include"
msgstr "tyhjä tiedostonimi @include:n jälkeen"
-#: awkgram.y:2491
+#: awkgram.y:2446
+#, fuzzy
+msgid "@load is a gawk extension"
+msgstr "@include on gawk-laajennus"
+
+#: awkgram.y:2452
+#, fuzzy
+msgid "empty filename after @load"
+msgstr "tyhjä tiedostonimi @include:n jälkeen"
+
+#: awkgram.y:2586
msgid "empty program text on command line"
msgstr "tyhjä ohjelmateksti komentorivillä"
-#: awkgram.y:2606
+#: awkgram.y:2701
#, c-format
msgid "can't read sourcefile `%s' (%s)"
msgstr "ei voi lukea lähdetiedostoa â€%s†(%s)"
-#: awkgram.y:2617
+#: awkgram.y:2712
#, c-format
msgid "source file `%s' is empty"
msgstr "lähdetiedosto â€%s†on tyhjä"
-#: awkgram.y:2794
+#: awkgram.y:2889
msgid "source file does not end in newline"
msgstr "lähdetiedoston lopussa ei ole rivinvaihtoa"
-#: awkgram.y:2897
+#: awkgram.y:2994
msgid "unterminated regexp ends with `\\' at end of file"
msgstr ""
"päättämätön säännöllinen lauseke loppuu â€\\â€-merkkeihin tiedoston lopussa"
-#: awkgram.y:2921
+#: awkgram.y:3018
#, c-format
msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk"
msgstr "%s: %d: tawk:n regex-määre â€/.../%c†ei toimi gawk:ssa"
-#: awkgram.y:2925
+#: awkgram.y:3022
#, c-format
msgid "tawk regex modifier `/.../%c' doesn't work in gawk"
msgstr "tawkin regex-määre â€/.../%c†ei toimi gawkissa"
-#: awkgram.y:2932
+#: awkgram.y:3029
msgid "unterminated regexp"
msgstr "päättämätön säännöllinen lauseke"
-#: awkgram.y:2936
+#: awkgram.y:3033
msgid "unterminated regexp at end of file"
msgstr "päättämätön säännöllinen lauseke tiedoston lopussa"
-#: awkgram.y:2995
+#: awkgram.y:3092
msgid "use of `\\ #...' line continuation is not portable"
msgstr "â€\\ #...â€-rivijatkamisen käyttö ei ole siirrettävä"
-#: awkgram.y:3011
+#: awkgram.y:3108
msgid "backslash not last character on line"
msgstr "kenoviiva ei ole rivin viimeinen merkki"
-#: awkgram.y:3072
+#: awkgram.y:3169
msgid "POSIX does not allow operator `**='"
msgstr "POSIX ei salli operaattoria â€**=â€"
-#: awkgram.y:3074
+#: awkgram.y:3171
msgid "old awk does not support operator `**='"
msgstr "vanha awk ei tue operaattoria â€**=â€"
-#: awkgram.y:3083
+#: awkgram.y:3180
msgid "POSIX does not allow operator `**'"
msgstr "POSIX ei salli operaattoria â€**â€"
-#: awkgram.y:3085
+#: awkgram.y:3182
msgid "old awk does not support operator `**'"
msgstr "vanha awk ei tue operaattoria â€**â€"
-#: awkgram.y:3120
+#: awkgram.y:3217
msgid "operator `^=' is not supported in old awk"
msgstr "operaattoria â€^=†ei tueta vanhassa awk:ssa"
-#: awkgram.y:3128
+#: awkgram.y:3225
msgid "operator `^' is not supported in old awk"
msgstr "operaattoria â€^†ei tueta vanhassa awk:ssa"
-#: awkgram.y:3221 awkgram.y:3237
+#: awkgram.y:3318 awkgram.y:3334 command.y:1178
msgid "unterminated string"
msgstr "päättämätön merkkijono"
-#: awkgram.y:3433
+#: awkgram.y:3555
#, c-format
msgid "invalid char '%c' in expression"
msgstr "virheellinen merkki ’%c’ lausekkeessa"
-#: awkgram.y:3480
+#: awkgram.y:3602
#, c-format
msgid "`%s' is a gawk extension"
msgstr "â€%s†on gawk-laajennus"
-#: awkgram.y:3485
+#: awkgram.y:3607
#, c-format
msgid "`%s' is a Bell Labs extension"
msgstr "â€%s†on Bell Labs -laajennus"
-#: awkgram.y:3490
+#: awkgram.y:3612
#, c-format
msgid "POSIX does not allow `%s'"
msgstr "POSIX ei salli operaattori â€%sâ€"
-#: awkgram.y:3498
+#: awkgram.y:3620
#, c-format
msgid "`%s' is not supported in old awk"
msgstr "â€%s†ei ole tuettu vanhassa awk-ohjelmassa"
-#: awkgram.y:3565
+#: awkgram.y:3688
msgid "`goto' considered harmful!\n"
msgstr "â€gotoâ€-käskyä pidetään haitallisena!\n"
-#: awkgram.y:3616
+#: awkgram.y:3722
#, c-format
msgid "%d is invalid as number of arguments for %s"
msgstr "%d on virheellinen argumenttilukumäärä operaattorille %s"
-#: awkgram.y:3651
+#: awkgram.y:3757
#, c-format
msgid "%s: string literal as last arg of substitute has no effect"
msgstr ""
"%s: merkkijonoliteraalilla ei ole vaikutusta korvauksen viimeisenä "
"argumenttina"
-#: awkgram.y:3656
+#: awkgram.y:3762
#, c-format
msgid "%s third parameter is not a changeable object"
msgstr "%s kolmas parametri ei ole vaihdettava objekti"
-#: awkgram.y:3729 awkgram.y:3732
+#: awkgram.y:3841 awkgram.y:3844
msgid "match: third argument is a gawk extension"
msgstr "match: kolmas argumentti on gawk-laajennus"
-#: awkgram.y:3786 awkgram.y:3789
+#: awkgram.y:3898 awkgram.y:3901
msgid "close: second argument is a gawk extension"
msgstr "close: toinen argumentti on gawk-laajennus"
-#: awkgram.y:3801
+#: awkgram.y:3913
msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
msgstr "dcgettext(_\"...\")-käyttö on virheellinen: poista alaviiva alusta"
-#: awkgram.y:3816
+#: awkgram.y:3928
msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
msgstr "dcngettext(_\"...\")-käyttö on virheellinen: poista alaviiva alusta"
-#: awkgram.y:3908
-#, c-format
-msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
-msgstr "funktio â€%sâ€: parametri #%d, â€%sâ€, samanlainen parametri #%d"
-
-#: awkgram.y:3950
+#: awkgram.y:3994
#, c-format
msgid "function `%s': parameter `%s' shadows global variable"
msgstr "funktio â€%sâ€: parametri â€%s†varjostaa yleismuuttujaa"
-#: awkgram.y:4108
+#: awkgram.y:4051 debug.c:4019 debug.c:4062 debug.c:5187
#, c-format
msgid "could not open `%s' for writing (%s)"
msgstr "ei voitu avata tiedostoa â€%s†kirjoittamista varten (%s)"
-#: awkgram.y:4109
+#: awkgram.y:4052
msgid "sending variable list to standard error"
msgstr "lähetetään muuttujaluettelo vakiovirheeseen"
-#: awkgram.y:4115
+#: awkgram.y:4060
#, c-format
msgid "%s: close failed (%s)"
msgstr "%s: sulkeminen epäonnistui (%s)"
-#: awkgram.y:4167
+#: awkgram.y:4085
msgid "shadow_funcs() called twice!"
msgstr "shadow_funcs() kutsuttu kahdesti!"
-#: awkgram.y:4173
+#: awkgram.y:4093
msgid "there were shadowed variables."
msgstr "siellä oli varjostettuja muuttujia."
-#: awkgram.y:4203
+#: awkgram.y:4164
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "funktionimi â€%s†on jo aikaisemmin määritelty"
+
+#: awkgram.y:4210
#, c-format
msgid "function `%s': can't use function name as parameter name"
msgstr "funktio â€%sâ€: ei voi käyttää funktionimeä parametrinimenä"
-#: awkgram.y:4207
+#: awkgram.y:4213
#, c-format
msgid "function `%s': can't use special variable `%s' as a function parameter"
msgstr "funktio â€%sâ€: ei voi käyttää erikoismuuttujaa â€%s†funktioparametrina"
-#: awkgram.y:4223
+#: awkgram.y:4221
#, c-format
-msgid "function name `%s' previously defined"
-msgstr "funktionimi â€%s†on jo aikaisemmin määritelty"
+msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
+msgstr "funktio â€%sâ€: parametri #%d, â€%sâ€, samanlainen parametri #%d"
-#: awkgram.y:4391 awkgram.y:4397
+#: awkgram.y:4315 awkgram.y:4319
#, c-format
msgid "function `%s' called but never defined"
msgstr "funktiota â€%s†kutsuttiin, mutta sitä ei ole koskaan määritelty"
-#: awkgram.y:4400
+#: awkgram.y:4324
#, c-format
msgid "function `%s' defined but never called directly"
msgstr "funktio â€%s†määriteltiin, mutta sitä ei ole koskaan kutsuttu suoraan"
-#: awkgram.y:4432
+#: awkgram.y:4356
#, c-format
msgid "regexp constant for parameter #%d yields boolean value"
msgstr "säännöllisen lausekkeen vakio parametrille #%d antaa boolean-arvon"
-#: awkgram.y:4541
+#: awkgram.y:4402
#, c-format
msgid ""
"function `%s' called with space between name and `(',\n"
@@ -519,235 +510,235 @@ msgstr ""
"funktio â€%s†kutsuttu välilyönnillä nimen ja â€(â€-merkin\n"
"välillä, tai käytetty muuttujana tai taulukkona"
-#: awkgram.y:4788 eval.c:2056
+#: awkgram.y:4618
msgid "division by zero attempted"
msgstr "nollalla jakoa yritettiin"
-#: awkgram.y:4797 eval.c:2072
+#: awkgram.y:4627
#, c-format
msgid "division by zero attempted in `%%'"
msgstr "jakoa nollalla yritettiin operaattorissa â€%%â€"
# kohteena voi olla vakiotuloste tai joku muu
-#: builtin.c:120
+#: builtin.c:128
#, c-format
msgid "%s to \"%s\" failed (%s)"
msgstr "%s kohteeseen â€%s†epäonnistui (%s)"
-#: builtin.c:121
+#: builtin.c:129
msgid "standard output"
msgstr "vakiotuloste"
-#: builtin.c:135
+#: builtin.c:143
msgid "exp: received non-numeric argument"
msgstr "exp: vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:141
+#: builtin.c:149
#, c-format
msgid "exp: argument %g is out of range"
msgstr "exp: argumentti %g on lukualueen ulkopuolella"
-#: builtin.c:200
+#: builtin.c:208
#, c-format
msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing"
msgstr ""
"fflush: ei voi tyhjentää: putki â€%s†avattu lukemista varten, ei "
"kirjoittamiseen"
-#: builtin.c:203
+#: builtin.c:211
#, c-format
msgid "fflush: cannot flush: file `%s' opened for reading, not writing"
msgstr ""
"fflush: ei voi tyhjentää: tiedosto â€%s†avattu lukemista varten, ei "
"kirjoittamiseen"
-#: builtin.c:215
+#: builtin.c:223
#, c-format
msgid "fflush: `%s' is not an open file, pipe or co-process"
msgstr "fflush: â€%s†ei ole avoin tiedosto, putki tai apuprosessi"
-#: builtin.c:333
+#: builtin.c:341
msgid "index: received non-string first argument"
msgstr "index: ensimmäinen vastaanotettu argumentti ei ole merkkijono"
-#: builtin.c:335
+#: builtin.c:343
msgid "index: received non-string second argument"
msgstr "index: toinen vastaanotettu argumentti ei ole merkkijono"
-#: builtin.c:457
+#: builtin.c:467 mpfr.c:770
msgid "int: received non-numeric argument"
msgstr "int: vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:493
+#: builtin.c:503
msgid "length: received array argument"
msgstr "length: vastaanotettu taulukkoargumentti"
-#: builtin.c:496
+#: builtin.c:506
msgid "`length(array)' is a gawk extension"
msgstr "â€length(array)†on gawk-laajennus"
-#: builtin.c:504
+#: builtin.c:514
msgid "length: received non-string argument"
msgstr "length: vastaanotettu argumentti ei ole merkkijono"
-#: builtin.c:535
+#: builtin.c:545
msgid "log: received non-numeric argument"
msgstr "log: vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:538
+#: builtin.c:548
#, c-format
msgid "log: received negative argument %g"
msgstr "log: vastaanotettu negatiivinen argumentti %g"
-#: builtin.c:694 builtin.c:699
+#: builtin.c:746 builtin.c:751
msgid "fatal: must use `count$' on all formats or none"
msgstr "kohtalokas: on käytettävä â€count$†kaikilla muodoilla tai ei missään"
-#: builtin.c:762
+#: builtin.c:821
#, c-format
msgid "field width is ignored for `%%' specifier"
msgstr "kenttäleveys ohitetaan â€%%%%â€-määritteelle"
-#: builtin.c:764
+#: builtin.c:823
#, c-format
msgid "precision is ignored for `%%' specifier"
msgstr "tarkkuus ohitetaan â€%%%%â€-määritteelle"
-#: builtin.c:766
+#: builtin.c:825
#, c-format
msgid "field width and precision are ignored for `%%' specifier"
msgstr "kenttäleveys ja tarkkuus ohitetaan â€%%%%â€-määritteelle"
-#: builtin.c:817
+#: builtin.c:876
msgid "fatal: `$' is not permitted in awk formats"
msgstr "kohtalokas: â€$â€-argumentti ei ole sallittu awk-muodoissa"
-#: builtin.c:826
+#: builtin.c:885
msgid "fatal: arg count with `$' must be > 0"
msgstr "kohtalokas: argumenttilukumäärän argumentilla â€$†on oltava > 0"
-#: builtin.c:830
+#: builtin.c:889
#, c-format
msgid "fatal: arg count %ld greater than total number of supplied arguments"
msgstr ""
"kohtalokas: argumenttilukumäärä %ld on suurempi kuin toimitettujen "
"argumenttien lukumäärä"
-#: builtin.c:834
+#: builtin.c:893
msgid "fatal: `$' not permitted after period in format"
msgstr "kohtalokas: â€$â€-argumentti ei ole sallittu pisteen jälkeen muodossa"
-#: builtin.c:850
+#: builtin.c:909
msgid "fatal: no `$' supplied for positional field width or precision"
msgstr ""
"kohtalokas: ei â€$â€-argumenttia tarjottu sijantikenttäleveydelle tai "
"tarkkuudelle"
-#: builtin.c:921
+#: builtin.c:981
msgid "`l' is meaningless in awk formats; ignored"
msgstr "â€l†on merkityksetön awk-muodoissa; ohitetaan"
-#: builtin.c:925
+#: builtin.c:985
msgid "fatal: `l' is not permitted in POSIX awk formats"
msgstr "kohtalokas: â€l†ei ole sallittu POSIX awk -muodoissa"
-#: builtin.c:938
+#: builtin.c:998
msgid "`L' is meaningless in awk formats; ignored"
msgstr "â€L†on merkityksetön awk-muodoissa; ohitetaan"
-#: builtin.c:942
+#: builtin.c:1002
msgid "fatal: `L' is not permitted in POSIX awk formats"
msgstr "kohtalokas: â€L†ei ole sallittu POSIX awk -muodoissa"
-#: builtin.c:955
+#: builtin.c:1015
msgid "`h' is meaningless in awk formats; ignored"
msgstr "â€h†on merkityksetön awk-muodoissa; ohitetaan"
-#: builtin.c:959
+#: builtin.c:1019
msgid "fatal: `h' is not permitted in POSIX awk formats"
msgstr "kohtalokas: â€h†ei ole sallittu POSIX awk -muodoissa"
-#: builtin.c:1272
+#: builtin.c:1414
#, c-format
msgid "[s]printf: value %g is out of range for `%%%c' format"
msgstr "[s]printf: arvo %g on lukualueen ulkopuolella â€%%%câ€-muodolle"
-#: builtin.c:1332
+#: builtin.c:1512
#, c-format
msgid "ignoring unknown format specifier character `%c': no argument converted"
msgstr ""
"ohitetaan tuntematon muotoargumenttimerkki â€%câ€: ei muunnettu argumenttia"
-#: builtin.c:1337
+#: builtin.c:1517
msgid "fatal: not enough arguments to satisfy format string"
msgstr "kohtalokas: ei kylliksi argumentteja muotomerkkijonon tyydyttämiseksi"
-#: builtin.c:1339
+#: builtin.c:1519
msgid "^ ran out for this one"
msgstr "^ tällainen loppui kesken"
-#: builtin.c:1346
+#: builtin.c:1526
msgid "[s]printf: format specifier does not have control letter"
msgstr "[s]printf: muotoargumentilla ei ole ohjauskirjainta"
-#: builtin.c:1349
+#: builtin.c:1529
msgid "too many arguments supplied for format string"
msgstr "muotomerkkijonoon toimitettu liian monta argumenttia"
-#: builtin.c:1423 builtin.c:1434
+#: builtin.c:1604 builtin.c:1615
msgid "printf: no arguments"
msgstr "printf: ei argumentteja"
-#: builtin.c:1475
+#: builtin.c:1656
msgid "sqrt: received non-numeric argument"
msgstr "sqrt: vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:1479
+#: builtin.c:1660
#, c-format
msgid "sqrt: called with negative argument %g"
msgstr "sqrt: kutsuttu negatiivisella argumentilla %g"
-#: builtin.c:1503
+#: builtin.c:1691
#, c-format
msgid "substr: length %g is not >= 1"
msgstr "substr: pituus %g ei ole >= 1"
-#: builtin.c:1505
+#: builtin.c:1693
#, c-format
msgid "substr: length %g is not >= 0"
msgstr "substr: pituus %g ei ole >= 0"
-#: builtin.c:1512
+#: builtin.c:1700
#, c-format
msgid "substr: non-integer length %g will be truncated"
msgstr "substr: typistetään pituus %g, joka ei ole kokonaisluku"
-#: builtin.c:1517
+#: builtin.c:1705
#, c-format
msgid "substr: length %g too big for string indexing, truncating to %g"
msgstr ""
"substr: pituus %g liian suuri merkkijononindeksointiin, typistetään arvoon %g"
-#: builtin.c:1529
+#: builtin.c:1717
#, c-format
msgid "substr: start index %g is invalid, using 1"
msgstr "substr: aloitusindeksi %g on virheellinen, käytetään 1:tä"
-#: builtin.c:1534
+#: builtin.c:1722
#, c-format
msgid "substr: non-integer start index %g will be truncated"
msgstr "substr: typistetään aloitusindeksi %g, joka ei ole kokonaisluku"
-#: builtin.c:1559
+#: builtin.c:1747
msgid "substr: source string is zero length"
msgstr "substr: lähdemerkkijono on nollapituinen"
-#: builtin.c:1575
+#: builtin.c:1763
#, c-format
msgid "substr: start index %g is past end of string"
msgstr "substr: aloitusindeksi %g on merkkijonon lopun jälkeen"
-#: builtin.c:1583
+#: builtin.c:1771
#, c-format
msgid ""
"substr: length %g at start index %g exceeds length of first argument (%lu)"
@@ -755,230 +746,1087 @@ msgstr ""
"substr: pituus %g alkuindeksissä %g ylittää ensimmäisen argumentin pituuden "
"(%lu)"
-#: builtin.c:1657
+#: builtin.c:1845
msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type"
msgstr ""
"strftime: muotoarvolla kohteessa PROCINFO[\"strftime\"] on numerotyyppi"
-#: builtin.c:1680
+#: builtin.c:1868
msgid "strftime: received non-numeric second argument"
msgstr "strftime: toinen vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:1683
+#: builtin.c:1872
msgid "strftime: second argument less than 0 or too big for time_t"
msgstr ""
"strftime: toinen argumentti on pienempi kuin 0 tai liian suuri time_t-"
"rakenteeseen"
-#: builtin.c:1690
+#: builtin.c:1879
msgid "strftime: received non-string first argument"
msgstr "strftime: ensimmäinen vastaanotettu argumentti ei ole merkkijono"
-#: builtin.c:1696
+#: builtin.c:1886
msgid "strftime: received empty format string"
msgstr "strftime: vastaanotettu tyhjä muotomerkkijono"
-#: builtin.c:1762
+#: builtin.c:1952
msgid "mktime: received non-string argument"
msgstr "mktime: vastaanotettu argumentti ei ole merkkijono"
-#: builtin.c:1779
+#: builtin.c:1969
msgid "mktime: at least one of the values is out of the default range"
msgstr "mktime: vähintään yksi arvoista on oletuslukualueen ulkopuolella"
-#: builtin.c:1814
+#: builtin.c:2004
msgid "'system' function not allowed in sandbox mode"
msgstr "â€systemâ€-funktio ei ole sallittu hiekkalaatikkotilassa"
-#: builtin.c:1819
+#: builtin.c:2009
msgid "system: received non-string argument"
msgstr "system: vastaanotettu argumentti ei ole merkkijono"
-#: builtin.c:1874 eval.c:1159 eval.c:1790 eval.c:1803
-#, c-format
-msgid "reference to uninitialized variable `%s'"
-msgstr "viite alustamattomaan muuttujaan â€%sâ€"
-
-#: builtin.c:1941
+#: builtin.c:2127
#, c-format
msgid "reference to uninitialized field `$%d'"
msgstr "viite alustamattomaan kenttään â€$%dâ€"
-#: builtin.c:2028
+#: builtin.c:2214
msgid "tolower: received non-string argument"
msgstr "tolower: vastaanotettu argumentti ei ole merkkijono"
-#: builtin.c:2062
+#: builtin.c:2248
msgid "toupper: received non-string argument"
msgstr "toupper: vastaanotettu argumentti ei ole merkkijono"
-#: builtin.c:2098
+#: builtin.c:2284 mpfr.c:685
msgid "atan2: received non-numeric first argument"
msgstr "atan2: ensimmäinen vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:2100
+#: builtin.c:2286 mpfr.c:687
msgid "atan2: received non-numeric second argument"
msgstr "atan2: toinen vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:2119
+#: builtin.c:2305
msgid "sin: received non-numeric argument"
msgstr "sin: vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:2135
+#: builtin.c:2321
msgid "cos: received non-numeric argument"
msgstr "cos: vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:2188
+#: builtin.c:2374 mpfr.c:1137
msgid "srand: received non-numeric argument"
msgstr "srand: vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:2219
+#: builtin.c:2405
msgid "match: third argument is not an array"
msgstr "match: kolmas argumentti ei ole taulukko"
-#: builtin.c:2483
+#: builtin.c:2670
msgid "gensub: third argument of 0 treated as 1"
msgstr "gensub: 0-arvoinen kolmas argumentti käsitellään kuin 1"
-#: builtin.c:2776
+#: builtin.c:2963
msgid "lshift: received non-numeric first argument"
msgstr "lshift: ensimmäinen vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:2778
+#: builtin.c:2965
msgid "lshift: received non-numeric second argument"
msgstr "lshift: toinen vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:2784
+#: builtin.c:2971
#, fuzzy, c-format
msgid "lshift(%f, %f): negative values will give strange results"
msgstr "lshift(%lf, %lf): negatiiviset arvot antavat outoja tuloksia"
-#: builtin.c:2786
+#: builtin.c:2973
#, fuzzy, c-format
msgid "lshift(%f, %f): fractional values will be truncated"
msgstr "lshift(%lf, %lf): jaosarvot typistetään"
-#: builtin.c:2788
+#: builtin.c:2975
#, fuzzy, c-format
msgid "lshift(%f, %f): too large shift value will give strange results"
msgstr "lshift(%lf, %lf): liian suuri siirrosarvo antaa outoja tuloksia"
-#: builtin.c:2813
+#: builtin.c:3000
msgid "rshift: received non-numeric first argument"
msgstr "rshift: ensimmäinen vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:2815
+#: builtin.c:3002
msgid "rshift: received non-numeric second argument"
msgstr "rshift: toinen vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:2821
+#: builtin.c:3008
#, fuzzy, c-format
msgid "rshift(%f, %f): negative values will give strange results"
msgstr "rshift(%lf, %lf): negatiiviset arvot antavat outoja tuloksia"
-#: builtin.c:2823
+#: builtin.c:3010
#, fuzzy, c-format
msgid "rshift(%f, %f): fractional values will be truncated"
msgstr "rshift(%lf, %lf): jaosarvot typistetään"
-#: builtin.c:2825
+#: builtin.c:3012
#, fuzzy, c-format
msgid "rshift(%f, %f): too large shift value will give strange results"
msgstr "rshift(%lf, %lf): liian suuri siirrosarvo antaa outoja tuloksia"
-#: builtin.c:2850
-msgid "and: received non-numeric first argument"
-msgstr "and: ensimmäinen vastaanotettu argumentti ei ole numeerinen"
-
-#: builtin.c:2852
-msgid "and: received non-numeric second argument"
-msgstr "and: toinen vastaanotettu argumentti ei ole numeerinen"
+#: builtin.c:3037
+#, fuzzy
+msgid "and: called with less than two arguments"
+msgstr "sqrt: kutsuttu negatiivisella argumentilla %g"
-#: builtin.c:2858
+#: builtin.c:3042
#, fuzzy, c-format
-msgid "and(%f, %f): negative values will give strange results"
-msgstr "and(%lf, %lf): negatiiviset arvot antavat outoja tuloksia"
+msgid "and: argument %d is non-numeric"
+msgstr "exp: argumentti %g on lukualueen ulkopuolella"
-#: builtin.c:2860
+#: builtin.c:3046
#, fuzzy, c-format
-msgid "and(%f, %f): fractional values will be truncated"
-msgstr "and(%lf, %lf): jaosarvot typistetään"
-
-#: builtin.c:2885
-msgid "or: received non-numeric first argument"
-msgstr "or: ensimmäinen vastaanotettu argumentti ei ole numeerinen"
+msgid "and: argument %d negative value %g will give strange results"
+msgstr "and(%lf, %lf): negatiiviset arvot antavat outoja tuloksia"
-#: builtin.c:2887
-msgid "or: received non-numeric second argument"
-msgstr "or: toinen vastaanotettu argumentti ei ole numeerinen"
+#: builtin.c:3069
+#, fuzzy
+msgid "or: called with less than two arguments"
+msgstr "sqrt: kutsuttu negatiivisella argumentilla %g"
-#: builtin.c:2893
+#: builtin.c:3074
#, fuzzy, c-format
-msgid "or(%f, %f): negative values will give strange results"
-msgstr "or(%lf, %lf): negatiiviset arvot antavat outoja tuloksia"
+msgid "or: argument %d is non-numeric"
+msgstr "exp: argumentti %g on lukualueen ulkopuolella"
-#: builtin.c:2895
+#: builtin.c:3078
#, fuzzy, c-format
-msgid "or(%f, %f): fractional values will be truncated"
-msgstr "or(%lf, %lf): jaosarvot typistetään"
-
-#: builtin.c:2923
-msgid "xor: received non-numeric first argument"
-msgstr "xor: ensimmäinen vastaanotettu argumentti ei ole numeerinen"
+msgid "or: argument %d negative value %g will give strange results"
+msgstr "compl(%lf): negatiiviset arvot antavat outoja tuloksia"
-#: builtin.c:2925
-msgid "xor: received non-numeric second argument"
-msgstr "xor: toinen vastaanotettu argumentti ei ole numeerinen"
+#: builtin.c:3100
+#, fuzzy
+msgid "xor: called with less than two arguments"
+msgstr "sqrt: kutsuttu negatiivisella argumentilla %g"
-#: builtin.c:2931
+#: builtin.c:3106
#, fuzzy, c-format
-msgid "xor(%f, %f): negative values will give strange results"
-msgstr "xor(%lf, %lf): negatiiviset arvot antavat outoja tuloksia"
+msgid "xor: argument %d is non-numeric"
+msgstr "exp: argumentti %g on lukualueen ulkopuolella"
-#: builtin.c:2933
+#: builtin.c:3110
#, fuzzy, c-format
-msgid "xor(%f, %f): fractional values will be truncated"
-msgstr "xor(%lf, %lf): jaosarvot typistetään"
+msgid "xor: argument %d negative value %g will give strange results"
+msgstr "xor(%lf, %lf): negatiiviset arvot antavat outoja tuloksia"
-#: builtin.c:2957 builtin.c:2963
+#: builtin.c:3135 mpfr.c:800
msgid "compl: received non-numeric argument"
msgstr "compl: vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:2965
+#: builtin.c:3141
#, fuzzy, c-format
msgid "compl(%f): negative value will give strange results"
msgstr "compl(%lf): negatiiviset arvot antavat outoja tuloksia"
-#: builtin.c:2967
+#: builtin.c:3143
#, fuzzy, c-format
msgid "compl(%f): fractional value will be truncated"
msgstr "compl(%lf): jaosarvo typistetään"
-#: builtin.c:3136
+#: builtin.c:3312
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr "dcgettext: â€%s†ei ole kelvollinen paikallinen kategoria"
-#: eval.c:412
+#: command.y:225
+#, c-format
+msgid "Type (g)awk statement(s). End with the command \"end\"\n"
+msgstr ""
+
+#: command.y:289
+#, fuzzy, c-format
+msgid "invalid frame number: %d"
+msgstr "Virheellinen lukualueen loppu"
+
+#: command.y:295
+#, fuzzy, c-format
+msgid "info: invalid option - \"%s\""
+msgstr "%s: virheellinen valitsin -- ’%c’\n"
+
+#: command.y:321
+#, c-format
+msgid "source \"%s\": already sourced."
+msgstr ""
+
+#: command.y:326
+#, c-format
+msgid "save \"%s\": command not permitted."
+msgstr ""
+
+#: command.y:339
+msgid "Can't use command `commands' for breakpoint/watchpoint commands"
+msgstr ""
+
+#: command.y:341
+msgid "no breakpoint/watchpoint has been set yet"
+msgstr ""
+
+#: command.y:343
+msgid "invalid breakpoint/watchpoint number"
+msgstr ""
+
+#: command.y:348
+#, c-format
+msgid "Type commands for when %s %d is hit, one per line.\n"
+msgstr ""
+
+#: command.y:350
+#, c-format
+msgid "End with the command \"end\"\n"
+msgstr ""
+
+#: command.y:357
+msgid "`end' valid only in command `commands' or `eval'"
+msgstr ""
+
+#: command.y:367
+msgid "`silent' valid only in command `commands'"
+msgstr ""
+
+#: command.y:373
+#, fuzzy, c-format
+msgid "trace: invalid option - \"%s\""
+msgstr "%s: virheellinen valitsin -- ’%c’\n"
+
+#: command.y:387
+msgid "condition: invalid breakpoint/watchpoint number"
+msgstr ""
+
+#: command.y:449
+#, fuzzy
+msgid "argument not a string"
+msgstr "exp: argumentti %g on lukualueen ulkopuolella"
+
+#: command.y:459 command.y:464
+#, c-format
+msgid "option: invalid parameter - \"%s\""
+msgstr ""
+
+#: command.y:474
+#, c-format
+msgid "no such function - \"%s\""
+msgstr ""
+
+#: command.y:531
+#, fuzzy, c-format
+msgid "enable: invalid option - \"%s\""
+msgstr "%s: virheellinen valitsin -- ’%c’\n"
+
+#: command.y:597
+#, fuzzy, c-format
+msgid "invalid range specification: %d - %d"
+msgstr "Virheellinen lukualueen loppu"
+
+#: command.y:659
+#, fuzzy
+msgid "non-numeric value for field number"
+msgstr "tuntematon arvo kenttämääritteelle: %d\n"
+
+#: command.y:680 command.y:687
+msgid "non-numeric value found, numeric expected"
+msgstr ""
+
+#: command.y:712 command.y:718
+msgid "non-zero integer value"
+msgstr ""
+
+#: command.y:817
+msgid ""
+"backtrace [N] - print trace of all or N innermost (outermost if N < 0) "
+"frames."
+msgstr ""
+
+#: command.y:819
+msgid ""
+"break [[filename:]N|function] - set breakpoint at the specified location."
+msgstr ""
+
+#: command.y:821
+msgid "clear [[filename:]N|function] - delete breakpoints previously set."
+msgstr ""
+
+#: command.y:823
+msgid ""
+"commands [num] - starts a list of commands to be executed at a breakpoint"
+"(watchpoint) hit."
+msgstr ""
+
+#: command.y:825
+msgid "condition num [expr] - set or clear breakpoint or watchpoint condition."
+msgstr ""
+
+#: command.y:827
+msgid "continue [COUNT] - continue program being debugged."
+msgstr ""
+
+#: command.y:829
+msgid "delete [breakpoints] [range] - delete specified breakpoints."
+msgstr ""
+
+#: command.y:831
+msgid "disable [breakpoints] [range] - disable specified breakpoints."
+msgstr ""
+
+#: command.y:833
+msgid "display [var] - print value of variable each time the program stops."
+msgstr ""
+
+#: command.y:835
+msgid "down [N] - move N frames down the stack."
+msgstr ""
+
+#: command.y:837
+msgid "dump [filename] - dump instructions to file or stdout."
+msgstr ""
+
+#: command.y:839
+msgid "enable [once|del] [breakpoints] [range] - enable specified breakpoints."
+msgstr ""
+
+#: command.y:841
+msgid "end - end a list of commands or awk statements."
+msgstr ""
+
+#: command.y:843
+msgid "eval stmt|[p1, p2, ...] - evaluate awk statement(s)."
+msgstr ""
+
+#: command.y:845
+msgid "finish - execute until selected stack frame returns."
+msgstr ""
+
+#: command.y:847
+msgid "frame [N] - select and print stack frame number N."
+msgstr ""
+
+#: command.y:849
+msgid "help [command] - print list of commands or explanation of command."
+msgstr ""
+
+#: command.y:851
+msgid "ignore N COUNT - set ignore-count of breakpoint number N to COUNT."
+msgstr ""
+
+#: command.y:853
+msgid ""
+"info topic - source|sources|variables|functions|break|frame|args|locals|"
+"display|watch."
+msgstr ""
+
+#: command.y:855
+msgid "list [-|+|[filename:]lineno|function|range] - list specified line(s)."
+msgstr ""
+
+#: command.y:857
+msgid "next [COUNT] - step program, proceeding through subroutine calls."
+msgstr ""
+
+#: command.y:859
+msgid ""
+"nexti [COUNT] - step one instruction, but proceed through subroutine calls."
+msgstr ""
+
+#: command.y:861
+msgid "option [name[=value]] - set or display debugger option(s)."
+msgstr ""
+
+#: command.y:863
+msgid "print var [var] - print value of a variable or array."
+msgstr ""
+
+#: command.y:865
+msgid "printf format, [arg], ... - formatted output."
+msgstr ""
+
+#: command.y:867
+msgid "quit - exit debugger."
+msgstr ""
+
+#: command.y:869
+msgid "return [value] - make selected stack frame return to its caller."
+msgstr ""
+
+#: command.y:871
+msgid "run - start or restart executing program."
+msgstr ""
+
+#: command.y:874
+msgid "save filename - save commands from the session to file."
+msgstr ""
+
+#: command.y:877
+msgid "set var = value - assign value to a scalar variable."
+msgstr ""
+
+#: command.y:879
+msgid ""
+"silent - suspends usual message when stopped at a breakpoint/watchpoint."
+msgstr ""
+
+#: command.y:881
+msgid "source file - execute commands from file."
+msgstr ""
+
+#: command.y:883
+msgid "step [COUNT] - step program until it reaches a different source line."
+msgstr ""
+
+#: command.y:885
+msgid "stepi [COUNT] - step one instruction exactly."
+msgstr ""
+
+#: command.y:887
+msgid "tbreak [[filename:]N|function] - set a temporary breakpoint."
+msgstr ""
+
+#: command.y:889
+msgid "trace on|off - print instruction before executing."
+msgstr ""
+
+#: command.y:891
+msgid "undisplay [N] - remove variable(s) from automatic display list."
+msgstr ""
+
+#: command.y:893
+msgid ""
+"until [[filename:]N|function] - execute until program reaches a different "
+"line or line N within current frame."
+msgstr ""
+
+#: command.y:895
+msgid "unwatch [N] - remove variable(s) from watch list."
+msgstr ""
+
+#: command.y:897
+msgid "up [N] - move N frames up the stack."
+msgstr ""
+
+#: command.y:899
+msgid "watch var - set a watchpoint for a variable."
+msgstr ""
+
+#: command.y:1011 debug.c:395 msg.c:128
+#, c-format
+msgid "error: "
+msgstr "virhe:"
+
+#: command.y:1051
+#, fuzzy, c-format
+msgid "can't read command (%s)\n"
+msgstr "ei voi uudelleenohjata putkesta â€%s†(%s)"
+
+#: command.y:1065
+#, fuzzy, c-format
+msgid "can't read command (%s)"
+msgstr "ei voi uudelleenohjata putkesta â€%s†(%s)"
+
+#: command.y:1116
+#, fuzzy
+msgid "invalid character in command"
+msgstr "Virheellinen merkkiluokkanimi"
+
+#: command.y:1152
+#, c-format
+msgid "unknown command - \"%.*s\", try help"
+msgstr ""
+
+#: command.y:1222
+#, c-format
+msgid "%s"
+msgstr ""
+
+#: command.y:1284
+#, fuzzy
+msgid "invalid character"
+msgstr "Virheellinen vertailumerkki"
+
+#: command.y:1455
+#, c-format
+msgid "undefined command: %s\n"
+msgstr ""
+
+#: debug.c:246
+msgid "set or show the number of lines to keep in history file."
+msgstr ""
+
+#: debug.c:248
+msgid "set or show the list command window size."
+msgstr ""
+
+#: debug.c:250
+msgid "set or show gawk output file."
+msgstr ""
+
+#: debug.c:252
+msgid "set or show debugger prompt."
+msgstr ""
+
+#: debug.c:254
+msgid "(un)set or show saving of command history (value=on|off)."
+msgstr ""
+
+#: debug.c:256
+msgid "(un)set or show saving of options (value=on|off)."
+msgstr ""
+
+#: debug.c:258
+msgid "(un)set or show instruction tracing (value=on|off)."
+msgstr ""
+
+#: debug.c:339
+msgid "program not running."
+msgstr ""
+
+#: debug.c:442 debug.c:597
+#, fuzzy, c-format
+msgid "can't read source file `%s' (%s)"
+msgstr "ei voi lukea lähdetiedostoa â€%s†(%s)"
+
+#: debug.c:447
+#, fuzzy, c-format
+msgid "source file `%s' is empty.\n"
+msgstr "lähdetiedosto â€%s†on tyhjä"
+
+#: debug.c:474
+msgid "no current source file."
+msgstr ""
+
+#: debug.c:499
+#, fuzzy, c-format
+msgid "cannot find source file named `%s' (%s)"
+msgstr "ei voi lukea lähdetiedostoa â€%s†(%s)"
+
+#: debug.c:523
+#, c-format
+msgid "WARNING: source file `%s' modified since program compilation.\n"
+msgstr ""
+
+#: debug.c:542
+#, c-format
+msgid "line number %d out of range; `%s' has %d lines"
+msgstr ""
+
+#: debug.c:602
+#, fuzzy, c-format
+msgid "unexpected eof while reading file `%s', line %d"
+msgstr "odottamaton rivinvaihto tai merkkijonon loppu"
+
+#: debug.c:611
+#, c-format
+msgid "source file `%s' modified since start of program execution"
+msgstr ""
+
+#: debug.c:723
+#, fuzzy, c-format
+msgid "Current source file: %s\n"
+msgstr "on jo sisällytetty lähdetiedostoon â€%sâ€"
+
+#: debug.c:724
+#, c-format
+msgid "Number of lines: %d\n"
+msgstr ""
+
+#: debug.c:731
+#, c-format
+msgid "Source file (lines): %s (%d)\n"
+msgstr ""
+
+#: debug.c:745
+msgid ""
+"Number Disp Enabled Location\n"
+"\n"
+msgstr ""
+
+#: debug.c:756
+#, c-format
+msgid "\tno of hits = %ld\n"
+msgstr ""
+
+#: debug.c:758
+#, c-format
+msgid "\tignore next %ld hit(s)\n"
+msgstr ""
+
+#: debug.c:760 debug.c:900
+#, c-format
+msgid "\tstop condition: %s\n"
+msgstr ""
+
+#: debug.c:762 debug.c:902
+msgid "\tcommands:\n"
+msgstr ""
+
+#: debug.c:784
+#, c-format
+msgid "Current frame: "
+msgstr ""
+
+#: debug.c:787
+#, c-format
+msgid "Called by frame: "
+msgstr ""
+
+#: debug.c:791
+#, c-format
+msgid "Caller of frame: "
+msgstr ""
+
+#: debug.c:809
+#, c-format
+msgid "None in main().\n"
+msgstr ""
+
+#: debug.c:839
+#, fuzzy
+msgid "No arguments.\n"
+msgstr "printf: ei argumentteja"
+
+#: debug.c:840
+msgid "No locals.\n"
+msgstr ""
+
+#: debug.c:848
+msgid ""
+"All defined variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:858
+msgid ""
+"All defined functions:\n"
+"\n"
+msgstr ""
+
+#: debug.c:877
+msgid ""
+"Auto-display variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:880
+msgid ""
+"Watch variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:1020
+#, fuzzy, c-format
+msgid "no symbol `%s' in current context\n"
+msgstr "â€exit†ei voida kutsua nykyisessä asiayhteydessä"
+
+#: debug.c:1032 debug.c:1416
+#, fuzzy, c-format
+msgid "`%s' is not an array\n"
+msgstr "â€%s†ei ole laillinen muuttujanimi"
+
+#: debug.c:1046
+#, fuzzy, c-format
+msgid "$%ld = uninitialized field\n"
+msgstr "viite alustamattomaan kenttään â€$%dâ€"
+
+#: debug.c:1067
+#, fuzzy, c-format
+msgid "array `%s' is empty\n"
+msgstr "data-tiedosto â€%s†on tyhjä"
+
+#: debug.c:1110 debug.c:1162
+#, fuzzy, c-format
+msgid "[\"%s\"] not in array `%s'\n"
+msgstr "delete: indeksi â€%s†ei ole taulukossa â€%sâ€"
+
+#: debug.c:1166
+#, c-format
+msgid "`%s[\"%s\"]' is not an array\n"
+msgstr ""
+
+#: debug.c:1227 debug.c:4947
+#, fuzzy, c-format
+msgid "`%s' is not a scalar variable"
+msgstr "â€%s†ei ole laillinen muuttujanimi"
+
+#: debug.c:1249 debug.c:4977
+#, fuzzy, c-format
+msgid "attempt to use array `%s[\"%s\"]' in a scalar context"
+msgstr "yritettiin käyttää taulukkoa â€%s[\"%.*s\"]†skalaarikontekstissa"
+
+#: debug.c:1269 debug.c:4988
+#, fuzzy, c-format
+msgid "attempt to use scalar `%s[\"%s\"]' as array"
+msgstr "yritettiin käyttää skalaaria â€%s[\"%.*s\"]†taulukkona"
+
+#: debug.c:1412
+#, fuzzy, c-format
+msgid "`%s' is a function"
+msgstr "â€%s†on virheellinen funktionimenä"
+
+#: debug.c:1454
+#, c-format
+msgid "watchpoint %d is unconditional\n"
+msgstr ""
+
+#: debug.c:1488
+#, c-format
+msgid "No display item numbered %ld"
+msgstr ""
+
+#: debug.c:1491
+#, c-format
+msgid "No watch item numbered %ld"
+msgstr ""
+
+#: debug.c:1517
+#, fuzzy, c-format
+msgid "%d: [\"%s\"] not in array `%s'\n"
+msgstr "delete: indeksi â€%s†ei ole taulukossa â€%sâ€"
+
+#: debug.c:1756
+#, fuzzy
+msgid "attempt to use scalar value as array"
+msgstr "yritettiin käyttää skalaariarvoa taulukkona"
+
+#: debug.c:1845
+#, c-format
+msgid "Watchpoint %d deleted because parameter is out of scope.\n"
+msgstr ""
+
+#: debug.c:1856
+#, c-format
+msgid "Display %d deleted because parameter is out of scope.\n"
+msgstr ""
+
+#: debug.c:1889
+#, c-format
+msgid " in file `%s', line %d\n"
+msgstr ""
+
+#: debug.c:1910
+#, c-format
+msgid " at `%s':%d"
+msgstr ""
+
+#: debug.c:1926 debug.c:1989
+#, c-format
+msgid "#%ld\tin "
+msgstr ""
+
+#: debug.c:1963
+#, c-format
+msgid "More stack frames follow ...\n"
+msgstr ""
+
+#: debug.c:2006
+#, fuzzy
+msgid "invalid frame number"
+msgstr "Virheellinen lukualueen loppu"
+
+#: debug.c:2178
+#, c-format
+msgid "Note: breakpoint %d (enabled, ignore next %ld hits), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2185
+#, c-format
+msgid "Note: breakpoint %d (enabled), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2192
+#, c-format
+msgid "Note: breakpoint %d (disabled, ignore next %ld hits), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2199
+#, c-format
+msgid "Note: breakpoint %d (disabled), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2216
+#, c-format
+msgid "Breakpoint %d set at file `%s', line %d\n"
+msgstr ""
+
+#: debug.c:2318
+#, c-format
+msgid "Can't set breakpoint in file `%s'\n"
+msgstr ""
+
+#: debug.c:2347 debug.c:2470 debug.c:3328
+#, fuzzy, c-format
+msgid "line number %d in file `%s' out of range"
+msgstr "exp: argumentti %g on lukualueen ulkopuolella"
+
+#: debug.c:2351
+#, c-format
+msgid "Can't find rule!!!\n"
+msgstr ""
+
+#: debug.c:2353
+#, c-format
+msgid "Can't set breakpoint at `%s':%d\n"
+msgstr ""
+
+#: debug.c:2365
+#, c-format
+msgid "Can't set breakpoint in function `%s'\n"
+msgstr ""
+
+#: debug.c:2381
+#, c-format
+msgid "breakpoint %d set at file `%s', line %d is unconditional\n"
+msgstr ""
+
+#: debug.c:2486 debug.c:2508
+#, c-format
+msgid "Deleted breakpoint %d"
+msgstr ""
+
+#: debug.c:2492
+#, c-format
+msgid "No breakpoint(s) at entry to function `%s'\n"
+msgstr ""
+
+#: debug.c:2519
+#, fuzzy, c-format
+msgid "No breakpoint at file `%s', line #%d\n"
+msgstr "virhe luettaessa syötetiedostoa â€%sâ€: %s"
+
+#: debug.c:2574 debug.c:2615 debug.c:2635 debug.c:2678
+msgid "invalid breakpoint number"
+msgstr ""
+
+#: debug.c:2590
+msgid "Delete all breakpoints? (y or n) "
+msgstr ""
+
+#: debug.c:2591 debug.c:2901 debug.c:2954
+msgid "y"
+msgstr ""
+
+#: debug.c:2640
+#, c-format
+msgid "Will ignore next %ld crossing(s) of breakpoint %d.\n"
+msgstr ""
+
+#: debug.c:2644
+#, c-format
+msgid "Will stop next time breakpoint %d is reached.\n"
+msgstr ""
+
+#: debug.c:2761
+#, c-format
+msgid "Can only debug programs provided with the `-f' option.\n"
+msgstr ""
+
+#: debug.c:2886
+#, c-format
+msgid "Failed to restart debugger"
+msgstr ""
+
+#: debug.c:2900
+msgid "Program already running. Restart from beginning (y/n)? "
+msgstr ""
+
+#: debug.c:2904
+#, c-format
+msgid "Program not restarted\n"
+msgstr ""
+
+#: debug.c:2914
+#, c-format
+msgid "error: cannot restart, operation not allowed\n"
+msgstr ""
+
+#: debug.c:2920
+#, c-format
+msgid "error (%s): cannot restart, ignoring rest of the commands\n"
+msgstr ""
+
+#: debug.c:2928
+#, c-format
+msgid "Starting program: \n"
+msgstr ""
+
+#: debug.c:2937
+#, c-format
+msgid "Program exited %s with exit value: %d\n"
+msgstr ""
+
+#: debug.c:2953
+msgid "The program is running. Exit anyway (y/n)? "
+msgstr ""
+
+#: debug.c:2988
+#, c-format
+msgid "Not stopped at any breakpoint; argument ignored.\n"
+msgstr ""
+
+#: debug.c:2993
+#, c-format
+msgid "invalid breakpoint number %d."
+msgstr ""
+
+#: debug.c:2998
+#, c-format
+msgid "Will ignore next %ld crossings of breakpoint %d.\n"
+msgstr ""
+
+#: debug.c:3185
+#, c-format
+msgid "'finish' not meaningful in the outermost frame main()\n"
+msgstr ""
+
+#: debug.c:3190
+#, c-format
+msgid "Run till return from "
+msgstr ""
+
+#: debug.c:3233
+#, c-format
+msgid "'return' not meaningful in the outermost frame main()\n"
+msgstr ""
+
+#: debug.c:3347
+#, c-format
+msgid "Can't find specified location in function `%s'\n"
+msgstr ""
+
+#: debug.c:3355
+#, fuzzy, c-format
+msgid "invalid source line %d in file `%s'"
+msgstr "on jo sisällytetty lähdetiedostoon â€%sâ€"
+
+#: debug.c:3370
+#, c-format
+msgid "Can't find specified location %d in file `%s'\n"
+msgstr ""
+
+#: debug.c:3402
+#, fuzzy, c-format
+msgid "element not in array\n"
+msgstr "delete: indeksi â€%s†ei ole taulukossa â€%sâ€"
+
+#: debug.c:3402
+#, c-format
+msgid "untyped variable\n"
+msgstr ""
+
+#: debug.c:3444
+#, c-format
+msgid "Stopping in %s ...\n"
+msgstr ""
+
+#: debug.c:3521
+#, c-format
+msgid "'finish' not meaningful with non-local jump '%s'\n"
+msgstr ""
+
+#: debug.c:3528
+#, c-format
+msgid "'until' not meaningful with non-local jump '%s'\n"
+msgstr ""
+
+#: debug.c:4163
+msgid "\t------[Enter] to continue or q [Enter] to quit------"
+msgstr ""
+
+#: debug.c:4164
+msgid "q"
+msgstr ""
+
+#: debug.c:4984
+#, fuzzy, c-format
+msgid "[\"%s\"] not in array `%s'"
+msgstr "delete: indeksi â€%s†ei ole taulukossa â€%sâ€"
+
+#: debug.c:5190
+#, c-format
+msgid "sending output to stdout\n"
+msgstr ""
+
+#: debug.c:5230
+msgid "invalid number"
+msgstr ""
+
+#: debug.c:5362
+#, fuzzy, c-format
+msgid "`%s' not allowed in current context; statement ignored"
+msgstr "â€exit†ei voida kutsua nykyisessä asiayhteydessä"
+
+#: debug.c:5370
+#, fuzzy
+msgid "`return' not allowed in current context; statement ignored"
+msgstr "â€exit†ei voida kutsua nykyisessä asiayhteydessä"
+
+#: debug.c:5571
+#, fuzzy, c-format
+msgid "No symbol `%s' in current context"
+msgstr "yritettiin käyttää taulukkoa â€%s†skalaarikontekstissa"
+
+#: dfa.c:984 dfa.c:987 dfa.c:1007 dfa.c:1017 dfa.c:1029 dfa.c:1080 dfa.c:1089
+#: dfa.c:1092 dfa.c:1097 dfa.c:1110 dfa.c:1178
+msgid "unbalanced ["
+msgstr ""
+
+#: dfa.c:1038
+#, fuzzy
+msgid "invalid character class"
+msgstr "Virheellinen merkkiluokkanimi"
+
+#: dfa.c:1215
+msgid "character class syntax is [[:space:]], not [:space:]"
+msgstr ""
+
+#: dfa.c:1267
+msgid "unfinished \\ escape"
+msgstr ""
+
+#: dfa.c:1414 regcomp.c:161
+msgid "Invalid content of \\{\\}"
+msgstr "Virheellinen \\{\\}-sisältö"
+
+#: dfa.c:1417 regcomp.c:176
+msgid "Regular expression too big"
+msgstr "Säännöllinen lauseke on liian iso"
+
+#: dfa.c:1802
+msgid "unbalanced ("
+msgstr ""
+
+#: dfa.c:1929
+msgid "no syntax specified"
+msgstr ""
+
+#: dfa.c:1937
+msgid "unbalanced )"
+msgstr ""
+
+#: eval.c:394
#, c-format
msgid "unknown nodetype %d"
msgstr "tuntematon solmutyyppi %d"
-#: eval.c:423 eval.c:437
+#: eval.c:405 eval.c:419
#, c-format
msgid "unknown opcode %d"
msgstr "tuntematon käskykoodi %d"
-#: eval.c:434
+#: eval.c:416
#, c-format
msgid "opcode %s not an operator or keyword"
msgstr "käskykoodi %s ei ole operaattori tai avainsana"
-#: eval.c:488
+#: eval.c:471
msgid "buffer overflow in genflags2str"
msgstr "puskurin ylivuoto funktiossa genflags2str"
-#: eval.c:698
+#: eval.c:674
#, c-format
msgid ""
"\n"
@@ -989,309 +1837,536 @@ msgstr ""
"\t# Funktiokutsupino:\n"
"\n"
-#: eval.c:725
+#: eval.c:703
msgid "`IGNORECASE' is a gawk extension"
msgstr "â€IGNORECASE†on gawk-laajennus"
-#: eval.c:754
+#: eval.c:735
msgid "`BINMODE' is a gawk extension"
msgstr "â€BINMODE†on gawk-laajennus"
-#: eval.c:812
+#: eval.c:792
#, c-format
msgid "BINMODE value `%s' is invalid, treated as 3"
msgstr "BINMODE-arvo â€%s†on virheellinen, käsiteltiin arvona 3"
-#: eval.c:902
+#: eval.c:884
#, c-format
msgid "bad `%sFMT' specification `%s'"
msgstr "väärä â€%sFMTâ€-määritys â€%sâ€"
-#: eval.c:980
+#: eval.c:968
msgid "turning off `--lint' due to assignment to `LINT'"
msgstr "käännetään pois â€--lintâ€-valitsin â€LINTâ€-sijoituksen vuoksi"
-#: eval.c:1127 eval.c:1777
-#, c-format
-msgid "can't use function name `%s' as variable or array"
-msgstr "funktionimeä â€%s†ei voi käyttää muuttujana tai taulukkona"
-
-#: eval.c:1158 eval.c:1789 eval.c:1802
+#: eval.c:1144
#, c-format
msgid "reference to uninitialized argument `%s'"
msgstr "viite alustamattomaan argumenttiin â€%sâ€"
-#: eval.c:1177
+#: eval.c:1145
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "viite alustamattomaan muuttujaan â€%sâ€"
+
+#: eval.c:1163
msgid "attempt to field reference from non-numeric value"
msgstr "yritettiin kenttäviitettä arvosta, joka ei ole numeerinen"
-#: eval.c:1179
+#: eval.c:1165
msgid "attempt to field reference from null string"
msgstr "yritettiin kenttäviitettä null-merkkijonosta"
-#: eval.c:1185
+#: eval.c:1173
#, c-format
msgid "attempt to access field %ld"
msgstr "yritettiin saantia kenttään %ld"
-#: eval.c:1194
+#: eval.c:1182
#, c-format
msgid "reference to uninitialized field `$%ld'"
msgstr "viite alustamattomaan kenttään â€$%ldâ€"
-#: eval.c:1256
+#: eval.c:1269
#, c-format
msgid "function `%s' called with more arguments than declared"
msgstr "funktio â€%s†kutsuttiin useammalla argumentilla kuin esiteltiin"
-#: eval.c:1437
+#: eval.c:1464
#, c-format
msgid "unwind_stack: unexpected type `%s'"
msgstr "unwind_stack: odottamaton tyyppi â€%sâ€"
-#: eval.c:1532
+#: eval.c:1558
msgid "division by zero attempted in `/='"
msgstr "jakoa nollalla yritettiin operaatiossa â€/=â€"
-#: eval.c:1539
+#: eval.c:1565
#, c-format
msgid "division by zero attempted in `%%='"
msgstr "jakoa nollalla yritettiin operaatiossa â€%%=â€"
-#: eval.c:1876 eval.c:2122
-#, c-format
-msgid "attempt to use array `%s[\"%.*s\"]' in a scalar context"
-msgstr "yritettiin käyttää taulukkoa â€%s[\"%.*s\"]†skalaarikontekstissa"
-
-#: eval.c:1907
-msgid "assignment used in conditional context"
-msgstr "sijoitusta käytetty ehdollisessa kontekstissa"
-
-#: eval.c:1911
-msgid "statement has no effect"
-msgstr "käskyllä ei ole vaikutusta"
-
-#: eval.c:2343
-#, c-format
-msgid "for loop: array `%s' changed size from %ld to %ld during loop execution"
-msgstr ""
-"for-silmukka: taulukon â€%s†koko muuttui arvosta %ld arvoon %ld silmukan "
-"suorituksen aikana"
-
-#: eval.c:2458
-#, c-format
-msgid "function called indirectly through `%s' does not exist"
-msgstr "kohteen â€%s†kautta epäsuorasti kutsuttu funktio ei ole olemassa"
-
-#: eval.c:2470
-#, c-format
-msgid "function `%s' not defined"
-msgstr "funktio â€%s†ei ole määritelty"
-
-#: eval.c:2511
-#, c-format
-msgid "non-redirected `getline' invalid inside `%s' rule"
-msgstr "edelleenohjaamaton â€getline†virheellinen â€%sâ€-säännön sisällä"
-
-#: eval.c:2600
-#, c-format
-msgid "error reading input file `%s': %s"
-msgstr "virhe luettaessa syötetiedostoa â€%sâ€: %s"
-
-#: eval.c:2614
-#, c-format
-msgid "`nextfile' cannot be called from a `%s' rule"
-msgstr "â€nextfile†ei voida kutsua â€%sâ€-säännöstä"
-
-#: eval.c:2661
-msgid "`exit' cannot be called in the current context"
-msgstr "â€exit†ei voida kutsua nykyisessä asiayhteydessä"
-
-#: eval.c:2700
-#, c-format
-msgid "`next' cannot be called from a `%s' rule"
-msgstr "â€next†ei voida kutsua â€%sâ€-säännöstä"
-
-#: eval.c:2766
-#, c-format
-msgid "Sorry, don't know how to interpret `%s'"
-msgstr "Ei osata tulkita kohdetta â€%sâ€"
-
-#: ext.c:54
+#: ext.c:49
msgid "extensions are not allowed in sandbox mode"
msgstr "laajennuksia ei sallita hiekkalaatikkotilassa"
-#: ext.c:60 ext.c:65
-msgid "`extension' is a gawk extension"
-msgstr "â€extension†on gawk-laajennus"
+#: ext.c:52
+#, fuzzy
+msgid "-l / @load are gawk extensions"
+msgstr "@include on gawk-laajennus"
+
+#: ext.c:55
+msgid "load_ext: received NULL lib_name"
+msgstr ""
-#: ext.c:75
-#, c-format
-msgid "fatal: extension: cannot open `%s' (%s)\n"
+#: ext.c:58
+#, fuzzy, c-format
+msgid "load_ext: cannot open library `%s' (%s)\n"
msgstr "tuhoisa: extension: ei voi avata solmua â€%s†(%s)\n"
-#: ext.c:84
-#, c-format
+#: ext.c:64
+#, fuzzy, c-format
msgid ""
-"fatal: extension: library `%s': does not define "
-"`plugin_is_GPL_compatible' (%s)\n"
+"load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n"
msgstr ""
"tuhoisa: extension: kirjasto â€%sâ€: ei määrittele "
"â€plugin_is_GPL_compatible†(%s)\n"
-#: ext.c:93
-#, c-format
-msgid "fatal: extension: library `%s': cannot call function `%s' (%s)\n"
+#: ext.c:70
+#, fuzzy, c-format
+msgid "load_ext: library `%s': cannot call function `%s' (%s)\n"
msgstr "tuhoisa: extension: kirjasto â€%sâ€: ei voi kutsua funktiota â€%s†(%s)\n"
-#: ext.c:127
-msgid "extension: missing function name"
+#: ext.c:74
+#, c-format
+msgid "load_ext: library `%s' initialization routine `%s' failed\n"
+msgstr ""
+
+#: ext.c:93
+#, fuzzy
+msgid "make_builtin: missing function name"
msgstr "extension: puuttuva funktionimi"
-#: ext.c:132
-#, c-format
-msgid "extension: illegal character `%c' in function name `%s'"
+#: ext.c:98
+#, fuzzy, c-format
+msgid "make_builtin: illegal character `%c' in function name `%s'"
msgstr "extension: virheellinen merkki â€%c†funktionimessä â€%sâ€"
-#: ext.c:141
-#, c-format
-msgid "extension: can't redefine function `%s'"
+#: ext.c:106
+#, fuzzy, c-format
+msgid "make_builtin: can't redefine function `%s'"
msgstr "extension: ei voi määritellä uudelleen funktiota â€%sâ€"
-#: ext.c:145
-#, c-format
-msgid "extension: function `%s' already defined"
+#: ext.c:110
+#, fuzzy, c-format
+msgid "make_builtin: function `%s' already defined"
msgstr "extension: funktio â€%s†on jo määritelty"
-#: ext.c:150
-#, c-format
-msgid "extension: function name `%s' previously defined"
+#: ext.c:114
+#, fuzzy, c-format
+msgid "make_builtin: function name `%s' previously defined"
msgstr "extension: funktionimi â€%s†on määritelty jo aiemmin"
-#: ext.c:152
-#, c-format
-msgid "extension: can't use gawk built-in `%s' as function name"
+#: ext.c:116
+#, fuzzy, c-format
+msgid "make_builtin: can't use gawk built-in `%s' as function name"
msgstr ""
"extension: ei voi käyttää gawk-ohjelman sisäistä muuttujanimeä â€%s†"
"funktionimenä"
-#: ext.c:156
+#: ext.c:119
#, c-format
msgid "make_builtin: negative argument count for function `%s'"
msgstr "make_builtin: negatiivinen argumenttilukumäärä funktiolle â€%sâ€"
-#: ext.c:259
+#: ext.c:183
#, c-format
msgid "function `%s' defined to take no more than %d argument(s)"
msgstr "funktio â€%s†on määritelty ottamaan enemmän kuin %d argumenttia"
-#: ext.c:262
+#: ext.c:186
#, c-format
msgid "function `%s': missing argument #%d"
msgstr "function â€%sâ€: puuttuva argumentti #%d"
-#: ext.c:279
+#: ext.c:203
#, c-format
msgid "function `%s': argument #%d: attempt to use scalar as an array"
msgstr "funktio â€%sâ€: argumentti #%d: yritettiin käyttää skalaaria taulukkona"
-#: ext.c:283
+#: ext.c:207
#, c-format
msgid "function `%s': argument #%d: attempt to use array as a scalar"
msgstr "funktio â€%sâ€: argumentti #%d: yritettiin käyttää taulukkoa skalaarina"
-#: ext.c:296
-msgid "Operation Not Supported"
-msgstr "Toimintoa ei tueta"
+#: ext.c:221
+msgid "dynamic loading of library not supported"
+msgstr ""
+
+#: extension/filefuncs.c:75
+#, fuzzy
+msgid "chdir: called with incorrect number of arguments, expecting 1"
+msgstr "sqrt: kutsuttu negatiivisella argumentilla %g"
+
+#: extension/filefuncs.c:348
+#, fuzzy
+msgid "stat: called with wrong number of arguments"
+msgstr "sqrt: kutsuttu negatiivisella argumentilla %g"
+
+#: extension/filefuncs.c:355
+#, fuzzy
+msgid "stat: bad parameters"
+msgstr "%s: on parametri\n"
+
+#: extension/filefuncs.c:421
+msgid "fill_stat_element: could not create array"
+msgstr ""
+
+#: extension/filefuncs.c:430
+msgid "fill_stat_element: could not set element"
+msgstr ""
+
+#: extension/filefuncs.c:445
+#, fuzzy
+msgid "fill_path_element: could not set element"
+msgstr "index: toinen vastaanotettu argumentti ei ole merkkijono"
+
+#: extension/filefuncs.c:461
+msgid "fill_error_element: could not set element"
+msgstr ""
+
+#: extension/filefuncs.c:508 extension/filefuncs.c:555
+msgid "fts-process: could not create array"
+msgstr ""
+
+#: extension/filefuncs.c:518 extension/filefuncs.c:565
+#: extension/filefuncs.c:583
+#, fuzzy
+msgid "fts-process: could not set element"
+msgstr "index: toinen vastaanotettu argumentti ei ole merkkijono"
+
+#: extension/filefuncs.c:632
+#, fuzzy
+msgid "fts: called with incorrect number of arguments, expecting 3"
+msgstr "sqrt: kutsuttu negatiivisella argumentilla %g"
+
+#: extension/filefuncs.c:635
+#, fuzzy
+msgid "fts: bad first parameter"
+msgstr "%s: on parametri\n"
+
+#: extension/filefuncs.c:641
+#, fuzzy
+msgid "fts: bad second parameter"
+msgstr "%s: on parametri\n"
+
+#: extension/filefuncs.c:647
+#, fuzzy
+msgid "fts: bad third parameter"
+msgstr "%s: on parametri\n"
+
+#: extension/filefuncs.c:654
+#, fuzzy
+msgid "fts: could not flatten array\n"
+msgstr "â€%s†ei ole laillinen muuttujanimi"
+
+#: extension/filefuncs.c:672
+msgid "fts: ignoring sneaky FTS_NOSTAT flag. nyah, nyah, nyah."
+msgstr ""
-#: field.c:328
+#: extension/filefuncs.c:689
+msgid "fts: clear_array failed\n"
+msgstr ""
+
+#: extension/fnmatch.c:91
+#, fuzzy
+msgid "fnmatch: called with less than three arguments"
+msgstr "sqrt: kutsuttu negatiivisella argumentilla %g"
+
+#: extension/fnmatch.c:94
+#, fuzzy
+msgid "fnmatch: called with more than three arguments"
+msgstr "sqrt: kutsuttu negatiivisella argumentilla %g"
+
+#: extension/fnmatch.c:97
+#, fuzzy
+msgid "fnmatch: could not get first argument"
+msgstr "strftime: ensimmäinen vastaanotettu argumentti ei ole merkkijono"
+
+#: extension/fnmatch.c:102
+#, fuzzy
+msgid "fnmatch: could not get second argument"
+msgstr "index: toinen vastaanotettu argumentti ei ole merkkijono"
+
+#: extension/fnmatch.c:107
+msgid "fnmatch: could not get third argument"
+msgstr ""
+
+#: extension/fnmatch.c:120
+msgid "fnmatch is not implemented on this system\n"
+msgstr ""
+
+#: extension/fnmatch.c:152
+msgid "fnmatch init: could not add FNM_NOMATCH variable"
+msgstr ""
+
+#: extension/fnmatch.c:162
+#, c-format
+msgid "fnmatch init: could not set array element %s"
+msgstr ""
+
+#: extension/fnmatch.c:172
+msgid "fnmatch init: could not install FNM array"
+msgstr ""
+
+#: extension/fork.c:81
+#, fuzzy
+msgid "fork: called with too many arguments"
+msgstr "sqrt: kutsuttu negatiivisella argumentilla %g"
+
+#: extension/fork.c:94
+msgid "fork: PROCINFO is not an array!"
+msgstr ""
+
+#: extension/fork.c:118
+#, fuzzy
+msgid "waitpid: called with too many arguments"
+msgstr "sqrt: kutsuttu negatiivisella argumentilla %g"
+
+#: extension/fork.c:126
+#, fuzzy
+msgid "wait: called with no arguments"
+msgstr "sqrt: kutsuttu negatiivisella argumentilla %g"
+
+#: extension/fork.c:143
+#, fuzzy
+msgid "wait: called with too many arguments"
+msgstr "sqrt: kutsuttu negatiivisella argumentilla %g"
+
+#: extension/ordchr.c:69
+#, fuzzy
+msgid "ord: called with too many arguments"
+msgstr "sqrt: kutsuttu negatiivisella argumentilla %g"
+
+#: extension/ordchr.c:75
+#, fuzzy
+msgid "ord: called with no arguments"
+msgstr "sqrt: kutsuttu negatiivisella argumentilla %g"
+
+#: extension/ordchr.c:77
+#, fuzzy
+msgid "ord: called with inappropriate argument(s)"
+msgstr "sqrt: kutsuttu negatiivisella argumentilla %g"
+
+#: extension/ordchr.c:99
+#, fuzzy
+msgid "chr: called with too many arguments"
+msgstr "sqrt: kutsuttu negatiivisella argumentilla %g"
+
+#: extension/ordchr.c:109
+#, fuzzy
+msgid "chr: called with no arguments"
+msgstr "sqrt: kutsuttu negatiivisella argumentilla %g"
+
+#: extension/ordchr.c:111
+#, fuzzy
+msgid "chr: called with inappropriate argument(s)"
+msgstr "sqrt: kutsuttu negatiivisella argumentilla %g"
+
+#: extension/readfile.c:81
+#, fuzzy
+msgid "readfile: called with too many arguments"
+msgstr "sqrt: kutsuttu negatiivisella argumentilla %g"
+
+#: extension/readfile.c:114
+#, fuzzy
+msgid "readfile: called with no arguments"
+msgstr "sqrt: kutsuttu negatiivisella argumentilla %g"
+
+#: extension/rwarray.c:120
+#, fuzzy
+msgid "writea: called with too many arguments"
+msgstr "sqrt: kutsuttu negatiivisella argumentilla %g"
+
+#: extension/rwarray.c:127
+#, fuzzy, c-format
+msgid "do_writea: argument 0 is not a string\n"
+msgstr "exp: argumentti %g on lukualueen ulkopuolella"
+
+#: extension/rwarray.c:133
+#, fuzzy, c-format
+msgid "do_writea: argument 1 is not an array\n"
+msgstr "split: neljäs argumentti ei ole taulukko"
+
+#: extension/rwarray.c:180
+#, c-format
+msgid "write_array: could not flatten array\n"
+msgstr ""
+
+#: extension/rwarray.c:194
+#, c-format
+msgid "write_array: could not release flattened array\n"
+msgstr ""
+
+#: extension/rwarray.c:276
+#, fuzzy
+msgid "reada: called with too many arguments"
+msgstr "sqrt: kutsuttu negatiivisella argumentilla %g"
+
+#: extension/rwarray.c:283
+#, fuzzy, c-format
+msgid "do_reada: argument 0 is not a string\n"
+msgstr "exp: argumentti %g on lukualueen ulkopuolella"
+
+#: extension/rwarray.c:289
+#, fuzzy, c-format
+msgid "do_reada: argument 1 is not an array\n"
+msgstr "match: kolmas argumentti ei ole taulukko"
+
+#: extension/rwarray.c:333
+#, c-format
+msgid "do_reada: clear_array failed\n"
+msgstr ""
+
+#: extension/rwarray.c:370
+#, c-format
+msgid "read_array: set_array_element failed\n"
+msgstr ""
+
+#: extension/time.c:78
+#, fuzzy
+msgid "gettimeofday: ignoring arguments"
+msgstr "mktime: vastaanotettu argumentti ei ole merkkijono"
+
+#: extension/time.c:109
+msgid "gettimeofday: not supported on this platform"
+msgstr ""
+
+#: extension/time.c:130
+#, fuzzy
+msgid "sleep: called with too many arguments"
+msgstr "sqrt: kutsuttu negatiivisella argumentilla %g"
+
+#: extension/time.c:133
+#, fuzzy
+msgid "sleep: missing required numeric argument"
+msgstr "exp: vastaanotettu argumentti ei ole numeerinen"
+
+#: extension/time.c:139
+#, fuzzy
+msgid "sleep: argument is negative"
+msgstr "exp: argumentti %g on lukualueen ulkopuolella"
+
+#: extension/time.c:166
+msgid "sleep: not supported on this platform"
+msgstr ""
+
+#: field.c:339
msgid "NF set to negative value"
msgstr "NF asetettu negatiiviseen arvoon"
-#: field.c:951 field.c:958 field.c:962
+#: field.c:962 field.c:969 field.c:973
msgid "split: fourth argument is a gawk extension"
msgstr "split: neljäs argumentti on gawk-laajennus"
-#: field.c:955
+#: field.c:966
msgid "split: fourth argument is not an array"
msgstr "split: neljäs argumentti ei ole taulukko"
-#: field.c:969
+#: field.c:980
msgid "split: second argument is not an array"
msgstr "split: toinen argumentti ei ole taulukko"
-#: field.c:973
+#: field.c:984
msgid "split: cannot use the same array for second and fourth args"
msgstr ""
"split: ei voida käyttää samaa taulukkoa toiselle ja neljännelle argumentille"
-#: field.c:978
+#: field.c:989
msgid "split: cannot use a subarray of second arg for fourth arg"
msgstr ""
"split: ei voida käyttää toisen argumentin alitaulukkoa neljännelle "
"argumentille"
-#: field.c:981
+#: field.c:992
msgid "split: cannot use a subarray of fourth arg for second arg"
msgstr ""
"split: ei voida käyttää neljännen argumentin alitaulukkoa toiselle "
"argumentille"
-#: field.c:1010
+#: field.c:1021
msgid "split: null string for third arg is a gawk extension"
msgstr "split: null-merkkijono kolmantena argumenttina on gawk-laajennus"
-#: field.c:1050
+#: field.c:1061
msgid "patsplit: fourth argument is not an array"
msgstr "patsplit: neljäs argumentti ei ole taulukko"
-#: field.c:1055
+#: field.c:1066
msgid "patsplit: second argument is not an array"
msgstr "patsplit: toinen argumentti ei ole taulukko"
-#: field.c:1061
+#: field.c:1072
msgid "patsplit: third argument must be non-null"
msgstr "patsplit: kolmas argumentti ei ole taulukko"
-#: field.c:1065
+#: field.c:1076
msgid "patsplit: cannot use the same array for second and fourth args"
msgstr ""
"patsplit: ei voida käyttää samaa taulukkoa toiselle ja neljännelle "
"argumentille"
-#: field.c:1070
+#: field.c:1081
msgid "patsplit: cannot use a subarray of second arg for fourth arg"
msgstr ""
"patsplit: ei voida käyttää toisen argumentin alitaulukkkoa neljännelle "
"argumentille"
-#: field.c:1073
+#: field.c:1084
msgid "patsplit: cannot use a subarray of fourth arg for second arg"
msgstr ""
"patsplit: ei voida käyttää neljännen argumentin alitaulukkoa toiselle "
"argumentille"
-#: field.c:1110
+#: field.c:1122
msgid "`FIELDWIDTHS' is a gawk extension"
msgstr "â€FIELDWIDTHS†on gawk-laajennus"
-#: field.c:1173
+#: field.c:1186
#, c-format
msgid "invalid FIELDWIDTHS value, near `%s'"
msgstr "virheellinen FIELDWIDTHS-arvo, lähellä â€%sâ€"
-#: field.c:1246
+#: field.c:1259
msgid "null string for `FS' is a gawk extension"
msgstr "null-merkkijono â€FSâ€-kenttäerotinmuuttujalle on gawk-laajennus"
-#: field.c:1250
+#: field.c:1263
msgid "old awk does not support regexps as value of `FS'"
msgstr "vanha awk ei tue regexp-arvoja â€FSâ€-kenttäerotinmuuttujana"
-#: field.c:1369
+#: field.c:1382
msgid "`FPAT' is a gawk extension"
msgstr "â€FPAT†on gawk-laajennus"
+#: gawkapi.c:143
+msgid "awk_value_to_node: received null retval"
+msgstr ""
+
+#: gawkapi.c:932
+#, c-format
+msgid "api_flatten_array: could not convert index %d\n"
+msgstr ""
+
+#: gawkapi.c:937
+#, c-format
+msgid "api_flatten_array: could not convert value %d\n"
+msgstr ""
+
+#: gawkapi.c:1111
+msgid "cannot assign to defined constant"
+msgstr ""
+
#: getopt.c:604 getopt.c:633
#, fuzzy, c-format
msgid "%s: option '%s' is ambiguous; possibilities:"
@@ -1347,471 +2422,535 @@ msgstr "%s: valitsin ’-W %s’ ei salli argumenttia\n"
msgid "%s: option '-W %s' requires an argument\n"
msgstr "%s: valitsin ’-W %s’ vaatii argumentin\n"
-#: io.c:280
+#: io.c:339
#, c-format
msgid "command line argument `%s' is a directory: skipped"
msgstr "komentoriviargumentti â€%s†on hakemisto: ohitettiin"
-#: io.c:283 io.c:385
+#: io.c:342 io.c:455
#, c-format
msgid "cannot open file `%s' for reading (%s)"
msgstr "ei voi avata tiedostoa â€%s†lukemista varten (%s)"
-#: io.c:501
+#: io.c:582
#, c-format
msgid "close of fd %d (`%s') failed (%s)"
msgstr "tiedostomäärittelijän %d (â€%sâ€) sulkeminen epäonnistui (%s)"
-#: io.c:578
+#: io.c:658
msgid "redirection not allowed in sandbox mode"
msgstr "edelleenohjaus ei ole sallittua hiekkalaatikkotilassa"
-#: io.c:612
+#: io.c:692
#, c-format
msgid "expression in `%s' redirection only has numeric value"
msgstr "lausekkeella â€%sâ€-uudellenohjauksessa on vain numeerinen arvo"
-#: io.c:618
+#: io.c:698
#, c-format
msgid "expression for `%s' redirection has null string value"
msgstr "lausekkeella â€%sâ€-uudelleenohjauksessa on null-merkkijonoarvo"
-#: io.c:623
+#: io.c:703
#, c-format
msgid "filename `%s' for `%s' redirection may be result of logical expression"
msgstr ""
"tiedostonimi â€%s†â€%sâ€-uudelleenohjaukselle saattaa olla loogisen lausekkeen "
"tulos"
-#: io.c:666
+#: io.c:746
#, c-format
msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
msgstr "turha merkkien â€>†ja â€>>†sekoittaminen tiedostolle â€%.*sâ€"
-#: io.c:719
+#: io.c:799
#, c-format
msgid "can't open pipe `%s' for output (%s)"
msgstr "ei voi avata putkea â€%s†tulosteelle (%s)"
-#: io.c:729
+#: io.c:809
#, c-format
msgid "can't open pipe `%s' for input (%s)"
msgstr "ei voi avata putkea â€%s†syötteelle (%s)"
-#: io.c:752
+#: io.c:840
#, c-format
msgid "can't open two way pipe `%s' for input/output (%s)"
msgstr "ei voi avata kaksisuuntaista putkea â€%s†syötteelle/tulosteelle (%s)"
-#: io.c:834
+#: io.c:923
#, c-format
msgid "can't redirect from `%s' (%s)"
msgstr "ei voi uudelleenohjata putkesta â€%s†(%s)"
-#: io.c:837
+#: io.c:926
#, c-format
msgid "can't redirect to `%s' (%s)"
msgstr "ei voi uudelleenohjata putkeen â€%s†(%s)"
-#: io.c:888
+#: io.c:977
msgid ""
"reached system limit for open files: starting to multiplex file descriptors"
msgstr ""
"saavutettiin avoimien tiedostojen järjestelmäraja: aloitetaan "
"tiedostomäärittelijöiden lomittaminen"
-#: io.c:904
+#: io.c:993
#, c-format
msgid "close of `%s' failed (%s)."
msgstr "uudelleenohjauksen â€%s†sulkeminen epäonnistui (%s)."
-#: io.c:912
+#: io.c:1001
msgid "too many pipes or input files open"
msgstr "avoinna liian monta putkea tai syötetiedostoa"
-#: io.c:934
+#: io.c:1023
msgid "close: second argument must be `to' or `from'"
msgstr "close: toisen argumentin on oltava â€to†tai â€fromâ€"
-#: io.c:951
+#: io.c:1040
#, c-format
msgid "close: `%.*s' is not an open file, pipe or co-process"
msgstr "close: â€%.*s†ei ole avoin tiedosto, putki tai apuprosessi"
-#: io.c:956
+#: io.c:1045
msgid "close of redirection that was never opened"
msgstr "suljettiin uudelleenohjaus, jota ei avattu koskaan"
-#: io.c:1053
+#: io.c:1142
#, c-format
msgid "close: redirection `%s' not opened with `|&', second argument ignored"
msgstr ""
"close: uudelleenohjaus â€%s†ei ole avattu operaattoreilla â€|&â€, toinen "
"argumentti ohitettu"
-#: io.c:1069
+#: io.c:1159
#, c-format
msgid "failure status (%d) on pipe close of `%s' (%s)"
msgstr "virhetila (%d) putken â€%s†sulkemisessa (%s)"
-#: io.c:1072
+#: io.c:1162
#, c-format
msgid "failure status (%d) on file close of `%s' (%s)"
msgstr "virhetila (%d) tiedoston â€%s†sulkemisessa (%s)"
-#: io.c:1092
+#: io.c:1182
#, c-format
msgid "no explicit close of socket `%s' provided"
msgstr "pistokkeen â€%s†eksplisiittistä sulkemista ei tarjota"
-#: io.c:1095
+#: io.c:1185
#, c-format
msgid "no explicit close of co-process `%s' provided"
msgstr "apuprosessin â€%s†eksplisiittistä sulkemista ei tarjota"
-#: io.c:1098
+#: io.c:1188
#, c-format
msgid "no explicit close of pipe `%s' provided"
msgstr "putken â€%s†eksplisiittistä sulkemista ei tarjota"
-#: io.c:1101
+#: io.c:1191
#, c-format
msgid "no explicit close of file `%s' provided"
msgstr "tiedoston â€%s†eksplisiittistä sulkemista ei tarjota"
-#: io.c:1129 io.c:1184 main.c:797 main.c:834
+#: io.c:1219 io.c:1274 main.c:847 main.c:884
#, c-format
msgid "error writing standard output (%s)"
msgstr "virhe kirjoitettaessa vakiotulosteeseen (%s)"
-#: io.c:1133 io.c:1189
+#: io.c:1223 io.c:1279
#, c-format
msgid "error writing standard error (%s)"
msgstr "virhe kirjoitettaessa vakiovirheeseen (%s)"
-#: io.c:1141
+#: io.c:1231
#, c-format
msgid "pipe flush of `%s' failed (%s)."
msgstr "uudelleenohjauksen â€%s†putken tyhjennys epäonnistui (%s)."
-#: io.c:1144
+#: io.c:1234
#, c-format
msgid "co-process flush of pipe to `%s' failed (%s)."
msgstr "putken apuprosessityhjennys uudelleenohjaukseen â€%s†epäonnistui (%s)."
-#: io.c:1147
+#: io.c:1237
#, c-format
msgid "file flush of `%s' failed (%s)."
msgstr "uudelleenohjauksen â€%s†tiedostontyhjennys epäonnistui (%s)."
-#: io.c:1262
+#: io.c:1351
#, c-format
msgid "local port %s invalid in `/inet'"
msgstr "paikallinen portti %s virheellinen pistokkeessa â€/inetâ€"
-#: io.c:1279
+#: io.c:1369
#, c-format
msgid "remote host and port information (%s, %s) invalid"
msgstr "etäkone- ja porttitiedot (%s, %s) ovat virheellisiä"
-#: io.c:1431
+#: io.c:1521
#, c-format
msgid "no (known) protocol supplied in special filename `%s'"
msgstr "ei (tunnettua) yhteyskäytäntöä tarjottu erikoistiedostonimessä â€%sâ€"
-#: io.c:1445
+#: io.c:1535
#, c-format
msgid "special file name `%s' is incomplete"
msgstr "erikoistiedostonimi â€%s†on vaillinainen"
-#: io.c:1462
+#: io.c:1552
msgid "must supply a remote hostname to `/inet'"
msgstr "on tarjottava etäkoneen nimi pistokkeeseen â€/inetâ€"
-#: io.c:1480
+#: io.c:1570
msgid "must supply a remote port to `/inet'"
msgstr "on tarjottava etäportti pistokkeeseen â€/inetâ€"
-#: io.c:1526
+#: io.c:1616
msgid "TCP/IP communications are not supported"
msgstr "TCP/IP-viestintää ei tueta"
-#: io.c:1693
+#: io.c:1785
#, c-format
msgid "could not open `%s', mode `%s'"
msgstr "ei voitu avata laitetta â€%sâ€, tila â€%sâ€"
-#: io.c:1747
+#: io.c:1835
#, c-format
msgid "close of master pty failed (%s)"
msgstr "â€master ptyâ€-sulkeminen epäonnistui (%s)"
-#: io.c:1749 io.c:1917 io.c:2074
+#: io.c:1837 io.c:2012 io.c:2181
#, c-format
msgid "close of stdout in child failed (%s)"
msgstr "vakiotulosteen sulkeminen lapsiprosessissa epäonnistui (%s)"
-#: io.c:1752
+#: io.c:1840
#, c-format
msgid "moving slave pty to stdout in child failed (dup: %s)"
msgstr ""
"â€slave ptyâ€:n siirtäminen vakiotulosteeseen lapsiprosessissa epäonnistui "
"(dup: %s)"
-#: io.c:1754 io.c:1922
+#: io.c:1842 io.c:2017
#, c-format
msgid "close of stdin in child failed (%s)"
msgstr "vakiosyötteen sulkeminen lapsiprosessissa epäonnistui (%s)"
-#: io.c:1757
+#: io.c:1845
#, c-format
msgid "moving slave pty to stdin in child failed (dup: %s)"
msgstr ""
"â€slave ptyâ€:n siirtäminen vakiosyötteeseen lapsiprosessissa epäonnistui "
"(dup: %s)"
-#: io.c:1759 io.c:1780
+#: io.c:1847 io.c:1868
#, c-format
msgid "close of slave pty failed (%s)"
msgstr "â€slave ptyâ€:n sulkeminen epäonnistui (%s)"
-#: io.c:1858 io.c:1920 io.c:2052 io.c:2077
+#: io.c:1953 io.c:2015 io.c:2158 io.c:2184
#, c-format
msgid "moving pipe to stdout in child failed (dup: %s)"
msgstr ""
"putken siirtäminen vakiotulosteeseen lapsiprosessissa epäonnistui (dup: %s)"
-#: io.c:1865 io.c:1925
+#: io.c:1960 io.c:2020
#, c-format
msgid "moving pipe to stdin in child failed (dup: %s)"
msgstr ""
"putken siirtäminen vakiosyötteeseen lapsiprosessissa epäonnistui (dup: %s)"
-#: io.c:1885 io.c:2067
+#: io.c:1980 io.c:2174
msgid "restoring stdout in parent process failed\n"
msgstr "vakiotulosteen palauttaminen äitiprosessissa epäonnistui\n"
-#: io.c:1893
+#: io.c:1988
msgid "restoring stdin in parent process failed\n"
msgstr "vakiosyötön palauttaminen äitiprosessissa epäonnistui\n"
-#: io.c:1928 io.c:2079 io.c:2093
+#: io.c:2023 io.c:2186 io.c:2200
#, c-format
msgid "close of pipe failed (%s)"
msgstr "putken sulkeminen epäonnistui (%s)"
-#: io.c:1973
+#: io.c:2076
msgid "`|&' not supported"
msgstr "â€|&†ei tueta"
-#: io.c:2039
+#: io.c:2143
#, c-format
msgid "cannot open pipe `%s' (%s)"
msgstr "ei voi avata putkea â€%s†(%s)"
-#: io.c:2087
+#: io.c:2194
#, c-format
msgid "cannot create child process for `%s' (fork: %s)"
msgstr "ei voida luoda lapsiprosessia komennolle â€%s†(fork: %s)"
-#: io.c:2520
+#: io.c:2652
+msgid "register_input_parser: received NULL pointer"
+msgstr ""
+
+#: io.c:2680
+#, c-format
+msgid "input parser `%s' conflicts with previously installed input parser `%s'"
+msgstr ""
+
+#: io.c:2687
+#, c-format
+msgid "input parser `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2707
+msgid "register_output_wrapper: received NULL pointer"
+msgstr ""
+
+#: io.c:2735
+#, c-format
+msgid ""
+"output wrapper `%s' conflicts with previously installed output wrapper `%s'"
+msgstr ""
+
+#: io.c:2742
+#, c-format
+msgid "output wrapper `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2763
+msgid "register_output_processor: received NULL pointer"
+msgstr ""
+
+#: io.c:2792
+#, c-format
+msgid ""
+"two-way processor `%s' conflicts with previously installed two-way processor "
+"`%s'"
+msgstr ""
+
+#: io.c:2801
+#, c-format
+msgid "two way processor `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2908
#, c-format
msgid "data file `%s' is empty"
msgstr "data-tiedosto â€%s†on tyhjä"
-#: io.c:2561 io.c:2569
+#: io.c:2950 io.c:2958
msgid "could not allocate more input memory"
msgstr "ei voitu varata lisää syötemuistia"
-#: io.c:3127
+#: io.c:3524
msgid "multicharacter value of `RS' is a gawk extension"
msgstr "â€RSâ€-monimerkkiarvo on gawk-laajennus"
-#: io.c:3232
+#: io.c:3613
msgid "IPv6 communication is not supported"
msgstr "IPv6-viestintää ei tueta"
-#: main.c:366
+#: main.c:362
msgid "`-m[fr]' option irrelevant in gawk"
msgstr "â€-m[fr]â€-valitsin asiaanliittymätön gawk:ssa"
-#: main.c:368
+#: main.c:364
msgid "-m option usage: `-m[fr] nnn'"
msgstr "-m valitsinkäyttö: â€-m[fr] nnnâ€"
-#: main.c:391
+#: main.c:393
msgid "empty argument to `-e/--source' ignored"
msgstr "tyhjä argumentti valitsimelle â€-e/--source†ohitetaan"
-#: main.c:462
+#: main.c:483
#, c-format
msgid "%s: option `-W %s' unrecognized, ignored\n"
msgstr "%s: valitsin â€-W %s†on tunnistamaton, ohitetaan\n"
-#: main.c:515
+#: main.c:529
#, c-format
msgid "%s: option requires an argument -- %c\n"
msgstr "%s: valitsin vaatii argumentin -- %c\n"
-#: main.c:536
+#: main.c:550
msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
msgstr ""
"ympäristömuuttuja â€POSIXLY_CORRECT†asetettu: käännetään päälle valitsin â€--"
"posixâ€"
-#: main.c:542
+#: main.c:556
msgid "`--posix' overrides `--traditional'"
msgstr "valitsin â€--posix†korvaa valitsimen â€--traditionalâ€"
-#: main.c:553
+#: main.c:567
msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
msgstr ""
"valitsin â€--posix†tai â€--traditional†korvaa valitsimen â€--non-decimal-dataâ€"
-#: main.c:557
+#: main.c:571
#, c-format
msgid "running %s setuid root may be a security problem"
msgstr "suorittaminen â€%s setuid rootâ€-käyttäjänä saattaa olla turvapulma"
-#: main.c:562
+#: main.c:576
#, fuzzy
msgid "`--posix' overrides `--characters-as-bytes'"
msgstr "valitsin â€--posix†korvaa valitsimen â€--binaryâ€"
-#: main.c:616
+#: main.c:635
#, c-format
msgid "can't set binary mode on stdin (%s)"
msgstr "ei voi asettaa binaaritilaa vakiosyötteessä (%s)"
-#: main.c:619
+#: main.c:638
#, c-format
msgid "can't set binary mode on stdout (%s)"
msgstr "ei voi asettaa binaaritilaa vakiotulosteessa (%s)"
-#: main.c:621
+#: main.c:640
#, c-format
msgid "can't set binary mode on stderr (%s)"
msgstr "ei voi asettaa binaaritilaa vakiovirheessä (%s)"
-#: main.c:660
+#: main.c:698
msgid "no program text at all!"
msgstr "ei ohjelmatekstiä ollenkaan!"
-#: main.c:737
+#: main.c:784
#, c-format
msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"
msgstr ""
"Käyttö: %s [POSIX- tai GNU-tyyliset valitsimet] -f ohjelmatiedosto [--] "
"tiedosto ...\n"
-#: main.c:739
+#: main.c:786
#, c-format
msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"
msgstr ""
"Käyttö: %s [POSIX- tai GNU-tyyliset valitsimet] [--] %cohjelma%c "
"tiedosto ...\n"
-#: main.c:744
+#: main.c:791
msgid "POSIX options:\t\tGNU long options: (standard)\n"
msgstr "POSIX-valitsimet:\t\tGNU-pitkät valitsimet: (vakio)\n"
-#: main.c:745
+#: main.c:792
msgid "\t-f progfile\t\t--file=progfile\n"
msgstr "\t-f ohjelmatiedosto\t\t--file=ohjelmatiedosto\n"
-#: main.c:746
+#: main.c:793
msgid "\t-F fs\t\t\t--field-separator=fs\n"
msgstr "\t-F fs\t\t\t--field-separator=fs\n"
-#: main.c:747
+#: main.c:794
msgid "\t-v var=val\t\t--assign=var=val\n"
msgstr "\t-v var=arvo\t\t--assign=muuttuja=arvo\n"
-#: main.c:748
+#: main.c:795
msgid "Short options:\t\tGNU long options: (extensions)\n"
msgstr "Lyhyet valitsimet:\t\tGNU-pitkät valitsimet: (laajennukset)\n"
-#: main.c:749
+#: main.c:796
msgid "\t-b\t\t\t--characters-as-bytes\n"
msgstr "\t-b\t\t\t--characters-as-bytes\n"
-#: main.c:750
+#: main.c:797
msgid "\t-c\t\t\t--traditional\n"
msgstr "\t-c\t\t\t--traditional\n"
-#: main.c:751
+#: main.c:798
msgid "\t-C\t\t\t--copyright\n"
msgstr "\t-C\t\t\t--copyright\n"
-#: main.c:752
+#: main.c:799
msgid "\t-d[file]\t\t--dump-variables[=file]\n"
msgstr "\t-d[tiedosto]\t\t--dump-variables[=tiedosto]\n"
-#: main.c:753
+#: main.c:800
+#, fuzzy
+msgid "\t-D[file]\t\t--debug[=file]\n"
+msgstr "\t-p[tiedosto]\t\t--profile[=tiedosto]\n"
+
+#: main.c:801
msgid "\t-e 'program-text'\t--source='program-text'\n"
msgstr "\t-e 'program-text'\t--source='program-text'\n"
-#: main.c:754
+#: main.c:802
msgid "\t-E file\t\t\t--exec=file\n"
msgstr "\t-E file\t\t\t--exec=tiedosto\n"
-#: main.c:755
+#: main.c:803
msgid "\t-g\t\t\t--gen-pot\n"
msgstr "\t-g\t\t\t--gen-po\n"
-#: main.c:756
+#: main.c:804
msgid "\t-h\t\t\t--help\n"
msgstr "\t-h\t\t\t--help\n"
-#: main.c:757
+#: main.c:805
+msgid "\t-i includefile\t\t--include=includefile\n"
+msgstr ""
+
+#: main.c:806
+msgid "\t-l library\t\t--load=library\n"
+msgstr ""
+
+#: main.c:807
msgid "\t-L [fatal]\t\t--lint[=fatal]\n"
msgstr "\t-L [fatal]\t\t--lint[=fatal]\n"
-#: main.c:758
+#: main.c:808
msgid "\t-n\t\t\t--non-decimal-data\n"
msgstr "\t-n\t\t\t--non-decimal-data\n"
-#: main.c:759
+#: main.c:809
+#, fuzzy
+msgid "\t-M\t\t\t--bignum\n"
+msgstr "\t-g\t\t\t--gen-po\n"
+
+#: main.c:810
msgid "\t-N\t\t\t--use-lc-numeric\n"
msgstr "\t-N\t\t\t--use-lc-numeric\n"
-#: main.c:760
+#: main.c:811
+#, fuzzy
+msgid "\t-o[file]\t\t--pretty-print[=file]\n"
+msgstr "\t-p[tiedosto]\t\t--profile[=tiedosto]\n"
+
+#: main.c:812
msgid "\t-O\t\t\t--optimize\n"
msgstr "\t-O\t\t\t--optimize\n"
-#: main.c:761
+#: main.c:813
msgid "\t-p[file]\t\t--profile[=file]\n"
msgstr "\t-p[tiedosto]\t\t--profile[=tiedosto]\n"
-#: main.c:762
+#: main.c:814
msgid "\t-P\t\t\t--posix\n"
msgstr "\t-P\t\t\t--posix\n"
-#: main.c:763
+#: main.c:815
msgid "\t-r\t\t\t--re-interval\n"
msgstr "\t-r\t\t\t--re-interval\n"
-#: main.c:765
-msgid "\t-R file\t\t\t--command=file\n"
-msgstr "\t-R tiedosto\t\t\t--exec=tiedosto\n"
-
-#: main.c:766
+#: main.c:816
msgid "\t-S\t\t\t--sandbox\n"
msgstr "\t-S\t\t\t--sandbox\n"
-#: main.c:767
+#: main.c:817
msgid "\t-t\t\t\t--lint-old\n"
msgstr "\t-t\t\t\t--lint-old\n"
-#: main.c:768
+#: main.c:818
msgid "\t-V\t\t\t--version\n"
msgstr "\t-V\t\t\t--version\n"
-#: main.c:770
+#: main.c:820
msgid "\t-W nostalgia\t\t--nostalgia\n"
msgstr "\t-W nostalgia\t\t--nostalgia\n"
-#: main.c:773
+#: main.c:823
msgid "\t-Y\t\t--parsedebug\n"
msgstr "\t-Y\t\t--parsedebug\n"
@@ -1820,7 +2959,7 @@ msgstr "\t-Y\t\t--parsedebug\n"
#. for this application. Please add _another line_ with the
#. address for translation bugs.
#. no-wrap
-#: main.c:782
+#: main.c:832
msgid ""
"\n"
"To report bugs, see node `Bugs' in `gawk.info', which is\n"
@@ -1833,7 +2972,7 @@ msgstr ""
"joka on kappale â€Reporting Problems and Bugs†painetussa versiossa.\n"
"\n"
-#: main.c:786
+#: main.c:836
msgid ""
"gawk is a pattern scanning and processing language.\n"
"By default it reads standard input and writes standard output.\n"
@@ -1843,7 +2982,7 @@ msgstr ""
"Oletuksena se lukee vakiosyötettä ja kirjoittaa vakiotulosteeseen.\n"
"\n"
-#: main.c:790
+#: main.c:840
msgid ""
"Examples:\n"
"\tgawk '{ sum += $1 }; END { print sum }' file\n"
@@ -1853,7 +2992,7 @@ msgstr ""
"\tgawk '{ sum += $1 }; END { print sum }' tiedosto\n"
"\tgawk -F: '{ print $1 }' /etc/passwd\n"
-#: main.c:810
+#: main.c:860
#, c-format
msgid ""
"Copyright (C) 1989, 1991-%d Free Software Foundation.\n"
@@ -1872,7 +3011,7 @@ msgstr ""
"ehtojen mukaisesti.\n"
"\n"
-#: main.c:818
+#: main.c:868
msgid ""
"This program is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
@@ -1886,7 +3025,7 @@ msgstr ""
"GNU General Public License-ehdoista.\n"
"\n"
-#: main.c:824
+#: main.c:874
msgid ""
"You should have received a copy of the GNU General Public License\n"
"along with this program. If not, see http://www.gnu.org/licenses/.\n"
@@ -1894,16 +3033,16 @@ msgstr ""
"Sinun pitäisi vastaanottaa kopion GNU General Public Licence-lisenssistä\n"
"tämän ohjelman mukana. Jos näin ei ole, katso http://www.gnu.org/licenses/.\n"
-#: main.c:859
+#: main.c:909
msgid "-Ft does not set FS to tab in POSIX awk"
msgstr "-Ft ei aseta FS välilehteen POSIX awk:ssa"
-#: main.c:1093
+#: main.c:1169
#, c-format
msgid "unknown value for field spec: %d\n"
msgstr "tuntematon arvo kenttämääritteelle: %d\n"
-#: main.c:1174
+#: main.c:1267
#, c-format
msgid ""
"%s: `%s' argument to `-v' not in `var=value' form\n"
@@ -1912,79 +3051,145 @@ msgstr ""
"%s: â€%s†argumentti valitsimelle â€-v†ei ole â€var=arvoâ€-muodossa\n"
"\n"
-#: main.c:1200
+#: main.c:1293
#, c-format
msgid "`%s' is not a legal variable name"
msgstr "â€%s†ei ole laillinen muuttujanimi"
-#: main.c:1203
+#: main.c:1296
#, c-format
msgid "`%s' is not a variable name, looking for file `%s=%s'"
msgstr "â€%s†ei ole muuttujanimi, etsitään tiedostoa â€%s=%sâ€"
-#: main.c:1207
+#: main.c:1300
#, c-format
msgid "cannot use gawk builtin `%s' as variable name"
msgstr "ei voi käyttää gawk-ohjelman sisäistä â€%sâ€-määrittelyä muuttujanimenä"
-#: main.c:1212
+#: main.c:1305
#, c-format
msgid "cannot use function `%s' as variable name"
msgstr "funktionimeä â€%s†ei voi käyttää muuttujanimenä"
-#: main.c:1265
+#: main.c:1358
msgid "floating point exception"
msgstr "liukulukupoikkeus"
-#: main.c:1272
+#: main.c:1365
msgid "fatal error: internal error"
msgstr "tuhoisa virhe: sisäinen virhe"
-#: main.c:1287
+#: main.c:1380
msgid "fatal error: internal error: segfault"
msgstr "tuhoisa virhe: sisäinen virhe: segmenttivirhe"
-#: main.c:1299
+#: main.c:1392
msgid "fatal error: internal error: stack overflow"
msgstr "tuhoisa virhe: sisäinen virhe: pinoylivuoto"
-#: main.c:1349
+#: main.c:1448
#, c-format
msgid "no pre-opened fd %d"
msgstr "ei avattu uudelleen tiedostomäärittelijää %d"
-#: main.c:1356
+#: main.c:1455
#, c-format
msgid "could not pre-open /dev/null for fd %d"
msgstr "ei voitu avata uudelleen laitetta /dev/null tiedostomäärittelijälle %d"
-#: msg.c:63
+#: mpfr.c:563
+#, fuzzy, c-format
+msgid "PREC value `%.*s' is invalid"
+msgstr "BINMODE-arvo â€%s†on virheellinen, käsiteltiin arvona 3"
+
+#: mpfr.c:621
+#, fuzzy, c-format
+msgid "RNDMODE value `%.*s' is invalid"
+msgstr "BINMODE-arvo â€%s†on virheellinen, käsiteltiin arvona 3"
+
+#: mpfr.c:711
+#, fuzzy, c-format
+msgid "%s: received non-numeric argument"
+msgstr "cos: vastaanotettu argumentti ei ole numeerinen"
+
+#: mpfr.c:813
+#, fuzzy
+msgid "compl(%Rg): negative value will give strange results"
+msgstr "compl(%lf): negatiiviset arvot antavat outoja tuloksia"
+
+#: mpfr.c:817
+#, fuzzy
+msgid "comp(%Rg): fractional value will be truncated"
+msgstr "compl(%lf): jaosarvo typistetään"
+
+#: mpfr.c:829
+#, fuzzy, c-format
+msgid "cmpl(%Zd): negative values will give strange results"
+msgstr "compl(%lf): negatiiviset arvot antavat outoja tuloksia"
+
+#: mpfr.c:856
+#, fuzzy, c-format
+msgid "%s: received non-numeric first argument"
+msgstr "or: ensimmäinen vastaanotettu argumentti ei ole numeerinen"
+
+#: mpfr.c:858
+#, fuzzy, c-format
+msgid "%s: received non-numeric second argument"
+msgstr "or: toinen vastaanotettu argumentti ei ole numeerinen"
+
+#: mpfr.c:877
+#, fuzzy
+msgid "%s(%Rg, ..): negative values will give strange results"
+msgstr "or(%lf, %lf): negatiiviset arvot antavat outoja tuloksia"
+
+#: mpfr.c:882
+#, fuzzy
+msgid "%s(%Rg, ..): fractional values will be truncated"
+msgstr "or(%lf, %lf): jaosarvot typistetään"
+
+#: mpfr.c:895
+#, fuzzy, c-format
+msgid "%s(%Zd, ..): negative values will give strange results"
+msgstr "or(%lf, %lf): negatiiviset arvot antavat outoja tuloksia"
+
+#: mpfr.c:914
+#, fuzzy
+msgid "%s(.., %Rg): negative values will give strange results"
+msgstr "or(%lf, %lf): negatiiviset arvot antavat outoja tuloksia"
+
+#: mpfr.c:919
+#, fuzzy
+msgid "%s(.., %Rg): fractional values will be truncated"
+msgstr "or(%lf, %lf): jaosarvot typistetään"
+
+#: mpfr.c:932
+#, fuzzy, c-format
+msgid "%s(.., %Zd): negative values will give strange results"
+msgstr "or(%lf, %lf): negatiiviset arvot antavat outoja tuloksia"
+
+#: msg.c:61
#, c-format
msgid "cmd. line:"
msgstr "komentorivi:"
-#: msg.c:107
-msgid "error: "
-msgstr "virhe:"
-
-#: node.c:406
+#: node.c:436
msgid "backslash at end of string"
msgstr "kenoviiva merkkijonon lopussa"
-#: node.c:517
+#: node.c:520
#, c-format
msgid "old awk does not support the `\\%c' escape sequence"
msgstr "vanha awk ei tue â€\\%câ€-koodinvaihtosekvenssiä"
-#: node.c:568
+#: node.c:571
msgid "POSIX does not allow `\\x' escapes"
msgstr "POSIX ei salli â€\\xâ€-koodinvaihtoja"
-#: node.c:574
+#: node.c:577
msgid "no hex digits in `\\x' escape sequence"
msgstr "ei heksadesimaalilukuja â€\\xâ€-koodinvaihtosekvenssissä"
-#: node.c:596
+#: node.c:599
#, c-format
msgid ""
"hex escape \\x%.*s of %d characters probably not interpreted the way you "
@@ -1993,12 +3198,12 @@ msgstr ""
"heksadesimaalikoodinvaihtomerkkejä \\x%.*s / %d ei ole luultavasti tulkittu "
"sillä tavalla kuin odotat"
-#: node.c:611
+#: node.c:614
#, c-format
msgid "escape sequence `\\%c' treated as plain `%c'"
msgstr "koodinvaihtosekvenssi â€\\%c†käsitelty kuin pelkkä â€%câ€"
-#: node.c:750
+#: node.c:759
msgid ""
"Invalid multibyte data detected. There may be a mismatch between your data "
"and your locale."
@@ -2006,26 +3211,26 @@ msgstr ""
"Virheellinen monitavutieto havaittu. Paikallisasetuksesi ja tietojesi "
"välillä saattaa olla täsmäämättömyys."
-#: posix/gawkmisc.c:176
+#: posix/gawkmisc.c:177
#, c-format
msgid "%s %s `%s': could not get fd flags: (fcntl F_GETFD: %s)"
msgstr "%s %s â€%sâ€: ei voitu hakea fd-lippuja: (fcntl F_GETFD: %s)"
-#: posix/gawkmisc.c:188
+#: posix/gawkmisc.c:189
#, c-format
msgid "%s %s `%s': could not set close-on-exec: (fcntl F_SETFD: %s)"
msgstr "%s %s â€%sâ€: ei voitu asettaa close-on-exec: (fcntl F_SETFD: %s)"
-#: profile.c:83
+#: profile.c:70
#, c-format
msgid "could not open `%s' for writing: %s"
msgstr "ei voitu avata tiedostoa â€%s†kirjoittamista varten: %s"
-#: profile.c:85
+#: profile.c:72
msgid "sending profile to standard error"
msgstr "lähetetään profiili vakiovirheeseen"
-#: profile.c:203
+#: profile.c:188
#, c-format
msgid ""
"\t# %s block(s)\n"
@@ -2034,7 +3239,7 @@ msgstr ""
"\t# %s-lohko(t)\n"
"\n"
-#: profile.c:208
+#: profile.c:193
#, c-format
msgid ""
"\t# Rule(s)\n"
@@ -2043,17 +3248,22 @@ msgstr ""
"\t# Säännöt\n"
"\n"
-#: profile.c:279
+#: profile.c:267
#, c-format
msgid "internal error: %s with null vname"
msgstr "sisäinen virhe: %s null vname-arvolla"
-#: profile.c:952
+#: profile.c:529
+#, fuzzy
+msgid "internal error: builtin with null fname"
+msgstr "sisäinen virhe: %s null vname-arvolla"
+
+#: profile.c:944
#, c-format
msgid "\t# gawk profile, created %s\n"
msgstr "\t# gawk-profiili, luotu %s\n"
-#: profile.c:1331
+#: profile.c:1329
#, c-format
msgid ""
"\n"
@@ -2062,17 +3272,17 @@ msgstr ""
"\n"
"\t# Funktiot, luetteloitu aakkosjärjestyksessä\n"
-#: profile.c:1370
+#: profile.c:1367
#, c-format
msgid "redir2str: unknown redirection type %d"
msgstr "redir2str: tuntematon edelleenohjaustyyppi %d"
-#: re.c:573
+#: re.c:568
#, c-format
msgid "range of the form `[%c-%c]' is locale dependent"
msgstr "muodon â€[%c-%c]†lukualue on paikallisasetuksesta riippuvainen"
-#: re.c:600
+#: re.c:595
#, c-format
msgid "regexp component `%.*s' should probably be `[%.*s]'"
msgstr ""
@@ -2118,10 +3328,6 @@ msgstr "Pariton ( tai \\("
msgid "Unmatched \\{"
msgstr "Pariton \\{"
-#: regcomp.c:161
-msgid "Invalid content of \\{\\}"
-msgstr "Virheellinen \\{\\}-sisältö"
-
#: regcomp.c:164
msgid "Invalid range end"
msgstr "Virheellinen lukualueen loppu"
@@ -2138,10 +3344,6 @@ msgstr "Virheellinen edeltävä säännöllinen lauseke"
msgid "Premature end of regular expression"
msgstr "Ennenaikainen säännöllisen lausekkeen loppu"
-#: regcomp.c:176
-msgid "Regular expression too big"
-msgstr "Säännöllinen lauseke on liian iso"
-
#: regcomp.c:179
msgid "Unmatched ) or \\)"
msgstr "Pariton ) tai \\)"
@@ -2150,12 +3352,100 @@ msgstr "Pariton ) tai \\)"
msgid "No previous regular expression"
msgstr "Ei edellistä säännöllistä lauseketta"
+#: symbol.c:722
+msgid "can not pop main context"
+msgstr ""
+
#~ msgid "`nextfile' is a gawk extension"
#~ msgstr "â€nextfile†on gawk-laajennus"
#~ msgid "`delete array' is a gawk extension"
#~ msgstr "â€delete array†on gawk-laajennus"
+#~ msgid "and: received non-numeric first argument"
+#~ msgstr "and: ensimmäinen vastaanotettu argumentti ei ole numeerinen"
+
+#~ msgid "and: received non-numeric second argument"
+#~ msgstr "and: toinen vastaanotettu argumentti ei ole numeerinen"
+
+#~ msgid "and(%lf, %lf): fractional values will be truncated"
+#~ msgstr "and(%lf, %lf): jaosarvot typistetään"
+
+#~ msgid "xor: received non-numeric first argument"
+#~ msgstr "xor: ensimmäinen vastaanotettu argumentti ei ole numeerinen"
+
+#~ msgid "xor: received non-numeric second argument"
+#~ msgstr "xor: toinen vastaanotettu argumentti ei ole numeerinen"
+
+#~ msgid "xor(%lf, %lf): fractional values will be truncated"
+#~ msgstr "xor(%lf, %lf): jaosarvot typistetään"
+
+#~ msgid "`extension' is a gawk extension"
+#~ msgstr "â€extension†on gawk-laajennus"
+
+#~ msgid "Operation Not Supported"
+#~ msgstr "Toimintoa ei tueta"
+
+#~ msgid "attempt to use function `%s' as an array"
+#~ msgstr "yritettiin käyttää funktiota â€%s†taulukkona"
+
+#~ msgid "reference to uninitialized element `%s[\"%.*s\"]'"
+#~ msgstr "viite alustamattomaan elementtiin â€%s[\"%.*s\"]â€"
+
+#~ msgid "subscript of array `%s' is null string"
+#~ msgstr "taulukon alaindeksi â€%s†on null-merkkijono"
+
+#~ msgid "%s: empty (null)\n"
+#~ msgstr "%s: tyhjä (null)\n"
+
+#~ msgid "%s: empty (zero)\n"
+#~ msgstr "%s: tyhjä (nolla)\n"
+
+#~ msgid "%s: table_size = %d, array_size = %d\n"
+#~ msgstr "%s: table_size = %d, array_size = %d\n"
+
+#~ msgid "%s: array_ref to %s\n"
+#~ msgstr "%s: array_ref-viite taulukkoon %s\n"
+
+#~ msgid "use of non-array as array"
+#~ msgstr "ei-taulukon käyttö taulukkona"
+
+#~ msgid "can't use function name `%s' as variable or array"
+#~ msgstr "funktionimeä â€%s†ei voi käyttää muuttujana tai taulukkona"
+
+#~ msgid "assignment used in conditional context"
+#~ msgstr "sijoitusta käytetty ehdollisessa kontekstissa"
+
+#~ msgid "statement has no effect"
+#~ msgstr "käskyllä ei ole vaikutusta"
+
+#~ msgid ""
+#~ "for loop: array `%s' changed size from %ld to %ld during loop execution"
+#~ msgstr ""
+#~ "for-silmukka: taulukon â€%s†koko muuttui arvosta %ld arvoon %ld silmukan "
+#~ "suorituksen aikana"
+
+#~ msgid "function called indirectly through `%s' does not exist"
+#~ msgstr "kohteen â€%s†kautta epäsuorasti kutsuttu funktio ei ole olemassa"
+
+#~ msgid "function `%s' not defined"
+#~ msgstr "funktio â€%s†ei ole määritelty"
+
+#~ msgid "non-redirected `getline' invalid inside `%s' rule"
+#~ msgstr "edelleenohjaamaton â€getline†virheellinen â€%sâ€-säännön sisällä"
+
+#~ msgid "`nextfile' cannot be called from a `%s' rule"
+#~ msgstr "â€nextfile†ei voida kutsua â€%sâ€-säännöstä"
+
+#~ msgid "`next' cannot be called from a `%s' rule"
+#~ msgstr "â€next†ei voida kutsua â€%sâ€-säännöstä"
+
+#~ msgid "Sorry, don't know how to interpret `%s'"
+#~ msgstr "Ei osata tulkita kohdetta â€%sâ€"
+
+#~ msgid "\t-R file\t\t\t--command=file\n"
+#~ msgstr "\t-R tiedosto\t\t\t--exec=tiedosto\n"
+
#~ msgid "could not find groups: %s"
#~ msgstr "ei voitu löytää ryhmiä: %s"
@@ -2270,6 +3560,3 @@ msgstr "Ei edellistä säännöllistä lauseketta"
#~ msgid "attempt to use scalar `%s' as array"
#~ msgstr "yritettiin käyttää skalaaria â€%s†taulukkona"
-
-#~ msgid "attempt to use array `%s' in scalar context"
-#~ msgstr "yritettiin käyttää taulukkoa â€%s†skalaarikontekstissa"
diff --git a/po/fr.gmo b/po/fr.gmo
index 7d65d362..0116d5de 100644
--- a/po/fr.gmo
+++ b/po/fr.gmo
Binary files differ
diff --git a/po/fr.po b/po/fr.po
index 1fecefa5..64e84396 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gawk 4.0.0h\n"
"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
-"POT-Creation-Date: 2012-10-13 20:24+0200\n"
+"POT-Creation-Date: 2012-10-13 21:21+0200\n"
"PO-Revision-Date: 2012-01-30 23:52+0100\n"
"Last-Translator: Jean-Philippe Guérard <jean-philippe.guerard@corbeaunoir."
"org>\n"
@@ -20,504 +20,495 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-#: array.c:140
+#: array.c:266
#, c-format
msgid "from %s"
msgstr "de %s"
-#: array.c:248
+#: array.c:366
msgid "attempt to use a scalar value as array"
msgstr "tentative d'utiliser un scalaire comme tableau"
-#: array.c:251
-#, c-format
-msgid "attempt to use function `%s' as an array"
-msgstr "tentative d'utiliser la fonction « %s » comme tableau"
-
-#: array.c:254
+#: array.c:368
#, c-format
msgid "attempt to use scalar parameter `%s' as an array"
msgstr "tentative d'utiliser le paramètre scalaire « %s » comme tableau"
-#: array.c:257
+#: array.c:371
#, c-format
msgid "attempt to use scalar `%s' as an array"
msgstr "tentative d'utiliser le scalaire « %s » comme tableau"
-#: array.c:302 array.c:707 builtin.c:84 builtin.c:1385 builtin.c:1427
-#: builtin.c:1440 builtin.c:1859 builtin.c:1871 eval.c:1135 eval.c:1139
-#: eval.c:1495 eval.c:1812
+#: array.c:418 array.c:584 builtin.c:85 builtin.c:1566 builtin.c:1608
+#: builtin.c:1621 builtin.c:2047 builtin.c:2059 eval.c:1121 eval.c:1125
+#: eval.c:1520
#, c-format
msgid "attempt to use array `%s' in a scalar context"
msgstr "tentative d'utilisation du tableau « %s » dans un contexte scalaire"
-#: array.c:513
-#, c-format
-msgid "reference to uninitialized element `%s[\"%.*s\"]'"
-msgstr "référence à un élément non initialisé « %s[\"%.*s\"] »"
-
-#: array.c:519
-#, c-format
-msgid "subscript of array `%s' is null string"
-msgstr "l'indice du tableau « %s » est une chaîne vide"
-
-#: array.c:723
+#: array.c:591
#, c-format
msgid "delete: index `%s' not in array `%s'"
msgstr "delete : l'indice « %s » est absent du tableau « %s »"
-#: array.c:734 eval.c:1865
+#: array.c:605
#, c-format
msgid "attempt to use scalar `%s[\"%.*s\"]' as an array"
msgstr "tentative d'utiliser le scalaire « %s[\"%.*s\"] » comme tableau"
-#: array.c:910
-#, c-format
-msgid "%s: empty (null)\n"
-msgstr "%s : vide (non défini)\n"
-
-#: array.c:915
-#, c-format
-msgid "%s: empty (zero)\n"
-msgstr "%s : vide (vide)\n"
-
-#: array.c:919
-#, c-format
-msgid "%s: table_size = %d, array_size = %d\n"
-msgstr "%s : table_size = %d, array_size = %d\n"
-
-#: array.c:954
-#, c-format
-msgid "%s: is parameter\n"
-msgstr "%s : est un paramètre\n"
-
-#: array.c:958
-#, c-format
-msgid "%s: array_ref to %s\n"
-msgstr "%s : array_ref à %s\n"
-
-#: array.c:963
-msgid "adump: argument not an array"
+#: array.c:784
+#, fuzzy
+msgid "adump: first argument not an array"
msgstr "adump : l'argument n'est pas un tableau"
-#: array.c:1086
+#: array.c:823
msgid "asort: second argument not an array"
msgstr "asort : le 2nd argument n'est pas un tableau"
-#: array.c:1087
+#: array.c:824
msgid "asorti: second argument not an array"
msgstr "asorti : le 2nd argument n'est pas un tableau"
-#: array.c:1094
+#: array.c:831
msgid "asort: first argument not an array"
msgstr "asort : le 1er argument n'est pas un tableau"
-#: array.c:1095
+#: array.c:832
msgid "asorti: first argument not an array"
msgstr "asorti : le 1er argument n'est pas un tableau"
-#: array.c:1102
+#: array.c:839
msgid "asort: cannot use a subarray of first arg for second arg"
msgstr "asort : le 2nd argument ne doit pas être un sous-tableau du 1er"
-#: array.c:1103
+#: array.c:840
msgid "asorti: cannot use a subarray of first arg for second arg"
msgstr "asorti : le 2nd argument ne doit pas être un sous-tableau du 1er"
-#: array.c:1108
+#: array.c:845
msgid "asort: cannot use a subarray of second arg for first arg"
msgstr "asort : le 1er argument ne doit pas être un sous-tableau du 2nd"
-#: array.c:1109
+#: array.c:846
msgid "asorti: cannot use a subarray of second arg for first arg"
msgstr "asorti : le 1er argument ne doit pas être un sous-tableau du 2nd"
-#: array.c:1655
+#: array.c:1314
#, c-format
msgid "`%s' is invalid as a function name"
msgstr "« %s » n'est pas un nom de fonction valide"
-#: array.c:1659
+#: array.c:1318
#, c-format
msgid "sort comparison function `%s' is not defined"
msgstr "la fonction de comparaison « %s » du tri n'est pas définie"
-#: awkgram.y:249
+#: awkgram.y:223
#, c-format
msgid "%s blocks must have an action part"
msgstr "les blocs %s doivent avoir une partie action"
-#: awkgram.y:252
+#: awkgram.y:226
msgid "each rule must have a pattern or an action part"
msgstr "chaque règle doit avoir au moins une partie motif ou action"
-#: awkgram.y:323 awkgram.y:334
+#: awkgram.y:315 awkgram.y:326
msgid "old awk does not support multiple `BEGIN' or `END' rules"
msgstr "l'ancien awk ne permet pas les « BEGIN » ou « END » multiples"
-#: awkgram.y:371
+#: awkgram.y:363
#, c-format
msgid "`%s' is a built-in function, it cannot be redefined"
msgstr "« %s » est une fonction interne, elle ne peut être redéfinie"
-#: awkgram.y:432
+#: awkgram.y:409
msgid "regexp constant `//' looks like a C++ comment, but is not"
msgstr "l'expression rationnelle constante « // » n'est pas un commentaire C++"
-#: awkgram.y:436
+#: awkgram.y:413
#, c-format
msgid "regexp constant `/%s/' looks like a C comment, but is not"
msgstr "l'expression rationnelle constante « /%s/ » n'est pas un commentaire C"
-#: awkgram.y:528
+#: awkgram.y:505
#, c-format
msgid "duplicate case values in switch body: %s"
msgstr "le corps du switch comporte des cas répétés : %s"
-#: awkgram.y:549
+#: awkgram.y:526
msgid "duplicate `default' detected in switch body"
msgstr "plusieurs « default » ont été détectés dans le corps du switch"
-#: awkgram.y:809
+#: awkgram.y:786
msgid "`break' is not allowed outside a loop or switch"
msgstr "« break » est interdit en dehors d'une boucle ou d'un switch"
-#: awkgram.y:818
+#: awkgram.y:795
msgid "`continue' is not allowed outside a loop"
msgstr "« continue » est interdit en dehors d'une boucle ou d'un switch"
-#: awkgram.y:828
+#: awkgram.y:805
#, c-format
msgid "`next' used in %s action"
msgstr "« next » est utilisé dans l'action %s"
-#: awkgram.y:837
+#: awkgram.y:814
#, c-format
msgid "`nextfile' used in %s action"
msgstr "« nextfile » est utilisé dans l'action %s"
-#: awkgram.y:861
+#: awkgram.y:838
msgid "`return' used outside function context"
msgstr "« return » est utilisé hors du contexte d'une fonction"
-#: awkgram.y:921
+#: awkgram.y:912
msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'"
msgstr ""
"dans BEGIN ou END, un « print » seul devrait sans doute être un « print "
"\"\" »"
-#: awkgram.y:1016 awkgram.y:1020
+#: awkgram.y:978 awkgram.y:1027
+msgid "`delete' is not allowed with SYMTAB"
+msgstr ""
+
+#: awkgram.y:980 awkgram.y:1029
+msgid "`delete' is not allowed with FUNCTAB"
+msgstr ""
+
+#: awkgram.y:1014 awkgram.y:1018
msgid "`delete(array)' is a non-portable tawk extension"
msgstr "« delete(array) » est une extension non portable de tawk"
-#: awkgram.y:1132
+#: awkgram.y:1139
msgid "multistage two-way pipelines don't work"
msgstr "impossible d'utiliser des tubes bidirectionnels en série"
-#: awkgram.y:1235
+#: awkgram.y:1242
msgid "regular expression on right of assignment"
msgstr "expression rationnelle à droite d'une affectation"
-#: awkgram.y:1246
+#: awkgram.y:1253
msgid "regular expression on left of `~' or `!~' operator"
msgstr "expression rationnelle à gauche d'un opérateur « ~ » ou « !~ »"
-#: awkgram.y:1262 awkgram.y:1416
+#: awkgram.y:1269 awkgram.y:1420
msgid "old awk does not support the keyword `in' except after `for'"
msgstr "l'ancien awk n'autorise le mot-clef « in » qu'après « for »"
-#: awkgram.y:1272
+#: awkgram.y:1279
msgid "regular expression on right of comparison"
msgstr "expression rationnelle à droite d'une comparaison"
-#: awkgram.y:1391
+#: awkgram.y:1395
#, c-format
msgid "`getline var' invalid inside `%s' rule"
msgstr "« getline var » n'est pas valable dans une règle « %s »"
-#: awkgram.y:1394 eval.c:2504
+#: awkgram.y:1398
#, c-format
msgid "`getline' invalid inside `%s' rule"
msgstr "« getline » n'est pas valable dans une règle « %s »"
-#: awkgram.y:1399
+#: awkgram.y:1403
msgid "non-redirected `getline' undefined inside END action"
msgstr "dans une action END, un « getline » non redirigé n'est pas défini"
-#: awkgram.y:1418
+#: awkgram.y:1422
msgid "old awk does not support multidimensional arrays"
msgstr "l'ancien awk ne dispose pas des tableaux multidimensionnels"
-#: awkgram.y:1514
+#: awkgram.y:1519
msgid "call of `length' without parentheses is not portable"
msgstr "l'appel de « length » sans parenthèses n'est pas portable"
-#: awkgram.y:1577
+#: awkgram.y:1585
msgid "indirect function calls are a gawk extension"
msgstr "les appels indirects de fonctions sont une extension gawk"
-#: awkgram.y:1590
+#: awkgram.y:1598
#, c-format
msgid "can not use special variable `%s' for indirect function call"
msgstr ""
"impossible d'utiliser la variable spéciale « %s » pour un appel indirect de "
"fonction"
-#: awkgram.y:1668
+#: awkgram.y:1676
msgid "invalid subscript expression"
msgstr "expression indice non valide"
-#: awkgram.y:1708
-msgid "use of non-array as array"
-msgstr "utilisation d'un non tableau comme tableau"
-
-#: awkgram.y:1972 awkgram.y:1992 msg.c:98
+#: awkgram.y:2000 awkgram.y:2020 gawkapi.c:203 gawkapi.c:221 msg.c:119
msgid "warning: "
msgstr "avertissement : "
-#: awkgram.y:1990 msg.c:130
+#: awkgram.y:2018 gawkapi.c:189 gawkapi.c:218 msg.c:151
msgid "fatal: "
msgstr "fatal : "
-#: awkgram.y:2040
+#: awkgram.y:2068
msgid "unexpected newline or end of string"
msgstr "fin de chaîne ou passage à la ligne inattendu"
-#: awkgram.y:2297 awkgram.y:2355 awkgram.y:2539
+#: awkgram.y:2335 awkgram.y:2411 awkgram.y:2634 debug.c:517 debug.c:533
+#: debug.c:2790 debug.c:5038
#, c-format
msgid "can't open source file `%s' for reading (%s)"
msgstr "impossible d'ouvrir le fichier source « %s » en lecture (%s)"
-#: awkgram.y:2298 awkgram.y:2356 builtin.c:122
+#: awkgram.y:2336 awkgram.y:2461
+#, fuzzy, c-format
+msgid "can't open shared library `%s' for reading (%s)"
+msgstr "impossible d'ouvrir le fichier source « %s » en lecture (%s)"
+
+#: awkgram.y:2338 awkgram.y:2412 awkgram.y:2462 builtin.c:130 debug.c:5189
msgid "reason unknown"
msgstr "raison inconnue"
-#: awkgram.y:2314
+#: awkgram.y:2347 awkgram.y:2371
+#, c-format
+msgid "can't include `%s' and use it as a program file"
+msgstr ""
+
+#: awkgram.y:2360
#, c-format
msgid "already included source file `%s'"
msgstr "le fichier source « %s » a déjà été intégré"
-#: awkgram.y:2340
+#: awkgram.y:2361
+#, fuzzy, c-format
+msgid "already loaded shared library `%s'"
+msgstr "le fichier source « %s » a déjà été intégré"
+
+#: awkgram.y:2396
msgid "@include is a gawk extension"
msgstr "@include est une extension gawk"
-#: awkgram.y:2346
+#: awkgram.y:2402
msgid "empty filename after @include"
msgstr "Le nom de fichier après @include est vide"
-#: awkgram.y:2491
+#: awkgram.y:2446
+#, fuzzy
+msgid "@load is a gawk extension"
+msgstr "@include est une extension gawk"
+
+#: awkgram.y:2452
+#, fuzzy
+msgid "empty filename after @load"
+msgstr "Le nom de fichier après @include est vide"
+
+#: awkgram.y:2586
msgid "empty program text on command line"
msgstr "le programme indiqué en ligne de commande est vide"
-#: awkgram.y:2606
+#: awkgram.y:2701
#, c-format
msgid "can't read sourcefile `%s' (%s)"
msgstr "impossible de lire le fichier source « %s » (%s)"
-#: awkgram.y:2617
+#: awkgram.y:2712
#, c-format
msgid "source file `%s' is empty"
msgstr "le fichier source « %s » est vide"
-#: awkgram.y:2794
+#: awkgram.y:2889
msgid "source file does not end in newline"
msgstr "le fichier source ne se termine pas par un passage à la ligne"
-#: awkgram.y:2897
+#: awkgram.y:2994
msgid "unterminated regexp ends with `\\' at end of file"
msgstr ""
"expression rationnelle non refermée terminée par un « \\ » en fin de fichier"
-#: awkgram.y:2921
+#: awkgram.y:3018
#, c-format
msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk"
msgstr ""
"%s : %d : le modificateur d'expressions rationnelles « /.../%c » de tawk ne "
"marche pas dans gawk"
-#: awkgram.y:2925
+#: awkgram.y:3022
#, c-format
msgid "tawk regex modifier `/.../%c' doesn't work in gawk"
msgstr ""
"le modificateur d'expressions rationnelles « /.../%c » de tawk ne marche pas "
"dans gawk"
-#: awkgram.y:2932
+#: awkgram.y:3029
msgid "unterminated regexp"
msgstr "expression rationnelle non refermée"
-#: awkgram.y:2936
+#: awkgram.y:3033
msgid "unterminated regexp at end of file"
msgstr "expression rationnelle non refermée en fin de fichier"
-#: awkgram.y:2995
+#: awkgram.y:3092
msgid "use of `\\ #...' line continuation is not portable"
msgstr ""
"l'utilisation de « \\ #... » pour prolonger une ligne n'est pas portable"
-#: awkgram.y:3011
+#: awkgram.y:3108
msgid "backslash not last character on line"
msgstr "la barre oblique inverse n'est pas le dernier caractère de la ligne"
-#: awkgram.y:3072
+#: awkgram.y:3169
msgid "POSIX does not allow operator `**='"
msgstr "POSIX n'autorise pas l'opérateur « **= »"
-#: awkgram.y:3074
+#: awkgram.y:3171
msgid "old awk does not support operator `**='"
msgstr "l'ancien awk ne dispose pas de l'opérateur « **= »"
-#: awkgram.y:3083
+#: awkgram.y:3180
msgid "POSIX does not allow operator `**'"
msgstr "POSIX n'autorise pas l'opérateur « ** »"
-#: awkgram.y:3085
+#: awkgram.y:3182
msgid "old awk does not support operator `**'"
msgstr "l'ancien awk ne dispose pas de l'opérateur « ** »"
-#: awkgram.y:3120
+#: awkgram.y:3217
msgid "operator `^=' is not supported in old awk"
msgstr "l'ancien awk ne dispose pas de l'opérateur « ^= »"
-#: awkgram.y:3128
+#: awkgram.y:3225
msgid "operator `^' is not supported in old awk"
msgstr "l'ancien awk ne dispose pas de l'opérateur « ^ »"
-#: awkgram.y:3221 awkgram.y:3237
+#: awkgram.y:3318 awkgram.y:3334 command.y:1178
msgid "unterminated string"
msgstr "chaîne non refermée"
-#: awkgram.y:3433
+#: awkgram.y:3555
#, c-format
msgid "invalid char '%c' in expression"
msgstr "caractère non valide « %c » dans l'expression"
-#: awkgram.y:3480
+#: awkgram.y:3602
#, c-format
msgid "`%s' is a gawk extension"
msgstr "« %s » est une extension gawk"
-#: awkgram.y:3485
+#: awkgram.y:3607
#, c-format
msgid "`%s' is a Bell Labs extension"
msgstr "« %s » est une extension Bell Labs"
-#: awkgram.y:3490
+#: awkgram.y:3612
#, c-format
msgid "POSIX does not allow `%s'"
msgstr "POSIX n'autorise pas « %s »"
-#: awkgram.y:3498
+#: awkgram.y:3620
#, c-format
msgid "`%s' is not supported in old awk"
msgstr "l'ancien awk ne dispose pas de « %s »"
-#: awkgram.y:3565
+#: awkgram.y:3688
msgid "`goto' considered harmful!\n"
msgstr "« goto est jugé dangereux ! » (Edsger W. Dijkstra)\n"
-#: awkgram.y:3616
+#: awkgram.y:3722
#, c-format
msgid "%d is invalid as number of arguments for %s"
msgstr "%d n'est pas un nombre d'arguments valide de %s"
-#: awkgram.y:3651
+#: awkgram.y:3757
#, c-format
msgid "%s: string literal as last arg of substitute has no effect"
msgstr ""
"%s : une chaîne littérale en dernier argument d'une substitution est sans "
"effet"
-#: awkgram.y:3656
+#: awkgram.y:3762
#, c-format
msgid "%s third parameter is not a changeable object"
msgstr "le 3e paramètre de %s n'est pas un objet modifiable"
-#: awkgram.y:3729 awkgram.y:3732
+#: awkgram.y:3841 awkgram.y:3844
msgid "match: third argument is a gawk extension"
msgstr "match : le 3e argument est une extension gawk"
-#: awkgram.y:3786 awkgram.y:3789
+#: awkgram.y:3898 awkgram.y:3901
msgid "close: second argument is a gawk extension"
msgstr "close : le 2e argument est une extension gawk"
-#: awkgram.y:3801
+#: awkgram.y:3913
msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
msgstr ""
"utilisation incorrecte de dcgettext(_\"...\") : enlevez le souligné de tête"
-#: awkgram.y:3816
+#: awkgram.y:3928
msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
msgstr ""
"utilisation incorrecte de dcngettext(_\"...\") : enlevez le souligné de tête"
-#: awkgram.y:3908
-#, c-format
-msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
-msgstr ""
-"fonction « %s » : paramètre #%d, « %s » est un doublon du paramètre #%d"
-
-#: awkgram.y:3950
+#: awkgram.y:3994
#, c-format
msgid "function `%s': parameter `%s' shadows global variable"
msgstr "fonction « %s » : le paramètre « %s » masque la variable globale"
-#: awkgram.y:4108
+#: awkgram.y:4051 debug.c:4019 debug.c:4062 debug.c:5187
#, c-format
msgid "could not open `%s' for writing (%s)"
msgstr "impossible d'ouvrir « %s » en écriture (%s)"
-#: awkgram.y:4109
+#: awkgram.y:4052
msgid "sending variable list to standard error"
msgstr "envoi de la liste des variables vers la sortie d'erreur standard"
-#: awkgram.y:4115
+#: awkgram.y:4060
#, c-format
msgid "%s: close failed (%s)"
msgstr "%s : échec de la fermeture (%s)"
-#: awkgram.y:4167
+#: awkgram.y:4085
msgid "shadow_funcs() called twice!"
msgstr "shadows_funcs() a été appelé deux fois !"
-#: awkgram.y:4173
+#: awkgram.y:4093
msgid "there were shadowed variables."
msgstr "il y avait des variables masquées."
-#: awkgram.y:4203
+#: awkgram.y:4164
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "nom de fonction « %s » déjà défini"
+
+#: awkgram.y:4210
#, c-format
msgid "function `%s': can't use function name as parameter name"
msgstr ""
"fonction « %s » : impossible d'utiliser un nom de fonction comme paramètre"
-#: awkgram.y:4207
+#: awkgram.y:4213
#, c-format
msgid "function `%s': can't use special variable `%s' as a function parameter"
msgstr ""
"fonction « %s » : impossible d'utiliser la variable spéciale « %s » comme "
"paramètre d'une fonction"
-#: awkgram.y:4223
+#: awkgram.y:4221
#, c-format
-msgid "function name `%s' previously defined"
-msgstr "nom de fonction « %s » déjà défini"
+msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
+msgstr ""
+"fonction « %s » : paramètre #%d, « %s » est un doublon du paramètre #%d"
-#: awkgram.y:4391 awkgram.y:4397
+#: awkgram.y:4315 awkgram.y:4319
#, c-format
msgid "function `%s' called but never defined"
msgstr "fonction « %s » appelée sans être définie"
-#: awkgram.y:4400
+#: awkgram.y:4324
#, c-format
msgid "function `%s' defined but never called directly"
msgstr "fonction « %s » définie mais jamais appelée directement"
-#: awkgram.y:4432
+#: awkgram.y:4356
#, c-format
msgid "regexp constant for parameter #%d yields boolean value"
msgstr "le paramètre #%d, une expr. rationnelle constante, fournit un booléen"
-#: awkgram.y:4541
+#: awkgram.y:4402
#, c-format
msgid ""
"function `%s' called with space between name and `(',\n"
@@ -526,232 +517,232 @@ msgstr ""
"fonction « %s » appelée avec un espace entre son nom\n"
"et « ( », ou utilisée comme variable ou tableau"
-#: awkgram.y:4788 eval.c:2056
+#: awkgram.y:4618
msgid "division by zero attempted"
msgstr "tentative de division par zéro"
-#: awkgram.y:4797 eval.c:2072
+#: awkgram.y:4627
#, c-format
msgid "division by zero attempted in `%%'"
msgstr "tentative de division par zéro dans « %% »"
-#: builtin.c:120
+#: builtin.c:128
#, c-format
msgid "%s to \"%s\" failed (%s)"
msgstr "échec de %s vers « %s » (%s)"
-#: builtin.c:121
+#: builtin.c:129
msgid "standard output"
msgstr "sortie standard"
-#: builtin.c:135
+#: builtin.c:143
msgid "exp: received non-numeric argument"
msgstr "exp : l'argument n'est pas numérique"
-#: builtin.c:141
+#: builtin.c:149
#, c-format
msgid "exp: argument %g is out of range"
msgstr "exp : l'argument %g est hors limite"
-#: builtin.c:200
+#: builtin.c:208
#, c-format
msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing"
msgstr ""
"fflush : vidage impossible : le tube « %s » est ouvert en lecture et non en "
"écriture"
-#: builtin.c:203
+#: builtin.c:211
#, c-format
msgid "fflush: cannot flush: file `%s' opened for reading, not writing"
msgstr ""
"fflush : vidage impossible : fichier « %s » ouvert en lecture, pas en "
"écriture"
-#: builtin.c:215
+#: builtin.c:223
#, c-format
msgid "fflush: `%s' is not an open file, pipe or co-process"
msgstr ""
"fflush : « %s » n'est ni un fichier ouvert, ni un tube, ni un co-processus"
-#: builtin.c:333
+#: builtin.c:341
msgid "index: received non-string first argument"
msgstr "index : le premier argument n'est pas une chaîne"
-#: builtin.c:335
+#: builtin.c:343
msgid "index: received non-string second argument"
msgstr "index : le second argument n'est pas une chaîne"
-#: builtin.c:457
+#: builtin.c:467 mpfr.c:770
msgid "int: received non-numeric argument"
msgstr "int : l'argument n'est pas numérique"
-#: builtin.c:493
+#: builtin.c:503
msgid "length: received array argument"
msgstr "length : l'argument reçu est un tableau"
-#: builtin.c:496
+#: builtin.c:506
msgid "`length(array)' is a gawk extension"
msgstr "« length(tableau) » est une extension gawk"
-#: builtin.c:504
+#: builtin.c:514
msgid "length: received non-string argument"
msgstr "length : l'argument n'est pas une chaîne"
-#: builtin.c:535
+#: builtin.c:545
msgid "log: received non-numeric argument"
msgstr "log : l'argument n'est pas numérique"
-#: builtin.c:538
+#: builtin.c:548
#, c-format
msgid "log: received negative argument %g"
msgstr "log : l'argument est négatif %g"
-#: builtin.c:694 builtin.c:699
+#: builtin.c:746 builtin.c:751
msgid "fatal: must use `count$' on all formats or none"
msgstr ""
"fatal : « numéro$ » doit être utilisé pour toutes les formats ou pour aucun"
-#: builtin.c:762
+#: builtin.c:821
#, c-format
msgid "field width is ignored for `%%' specifier"
msgstr "taille du champ de la spécification « %% » ignorée"
-#: builtin.c:764
+#: builtin.c:823
#, c-format
msgid "precision is ignored for `%%' specifier"
msgstr "précision de la spécification « %% » ignorée"
-#: builtin.c:766
+#: builtin.c:825
#, c-format
msgid "field width and precision are ignored for `%%' specifier"
msgstr "taille du champ et précision de la spécification « %% » ignorées"
-#: builtin.c:817
+#: builtin.c:876
msgid "fatal: `$' is not permitted in awk formats"
msgstr "fatal : « $ » n'est pas autorisé dans les formats awk"
-#: builtin.c:826
+#: builtin.c:885
msgid "fatal: arg count with `$' must be > 0"
msgstr "fatal : le numéro d'argument de « $ » doit être > 0"
-#: builtin.c:830
+#: builtin.c:889
#, c-format
msgid "fatal: arg count %ld greater than total number of supplied arguments"
msgstr ""
"fatal : le numéro d'argument %ld est > au nombre total d'arguments fournis"
-#: builtin.c:834
+#: builtin.c:893
msgid "fatal: `$' not permitted after period in format"
msgstr "fatal : dans un format, « $ » ne doit pas suivre un point"
-#: builtin.c:850
+#: builtin.c:909
msgid "fatal: no `$' supplied for positional field width or precision"
msgstr ""
"fatal : aucun « $ » fourni pour la taille ou la précision du champ positionné"
-#: builtin.c:921
+#: builtin.c:981
msgid "`l' is meaningless in awk formats; ignored"
msgstr "« l » n'a aucun sens dans un format awk ; ignoré"
-#: builtin.c:925
+#: builtin.c:985
msgid "fatal: `l' is not permitted in POSIX awk formats"
msgstr "fatal : « l » est interdit dans un format awk POSIX"
-#: builtin.c:938
+#: builtin.c:998
msgid "`L' is meaningless in awk formats; ignored"
msgstr "« L » n'a aucun sens dans un format awk ; ignoré"
-#: builtin.c:942
+#: builtin.c:1002
msgid "fatal: `L' is not permitted in POSIX awk formats"
msgstr "fatal : « L » est interdit dans un format awk POSIX"
-#: builtin.c:955
+#: builtin.c:1015
msgid "`h' is meaningless in awk formats; ignored"
msgstr "« h » n'a aucun sens dans un format awk ; ignoré"
-#: builtin.c:959
+#: builtin.c:1019
msgid "fatal: `h' is not permitted in POSIX awk formats"
msgstr "fatal : « h » est interdit dans un format awk POSIX"
-#: builtin.c:1272
+#: builtin.c:1414
#, c-format
msgid "[s]printf: value %g is out of range for `%%%c' format"
msgstr "[s]printf : valeur %g hors limite pour le format « %%%c »"
-#: builtin.c:1332
+#: builtin.c:1512
#, c-format
msgid "ignoring unknown format specifier character `%c': no argument converted"
msgstr "caractère de format inconnu « %c » ignoré : aucun argument converti"
-#: builtin.c:1337
+#: builtin.c:1517
msgid "fatal: not enough arguments to satisfy format string"
msgstr "fatal : pas assez d'arguments pour satisfaire la chaîne de formatage"
-#: builtin.c:1339
+#: builtin.c:1519
msgid "^ ran out for this one"
msgstr "^ à court pour celui-ci"
-#: builtin.c:1346
+#: builtin.c:1526
msgid "[s]printf: format specifier does not have control letter"
msgstr "[s]printf : spécification de format sans lettre de contrôle"
-#: builtin.c:1349
+#: builtin.c:1529
msgid "too many arguments supplied for format string"
msgstr "trop d'arguments pour la chaîne de formatage"
-#: builtin.c:1423 builtin.c:1434
+#: builtin.c:1604 builtin.c:1615
msgid "printf: no arguments"
msgstr "printf : aucun argument"
-#: builtin.c:1475
+#: builtin.c:1656
msgid "sqrt: received non-numeric argument"
msgstr "sqrt : l'argument n'est pas numérique"
-#: builtin.c:1479
+#: builtin.c:1660
#, c-format
msgid "sqrt: called with negative argument %g"
msgstr "sqrt : appelé avec un argument négatif %g"
-#: builtin.c:1503
+#: builtin.c:1691
#, c-format
msgid "substr: length %g is not >= 1"
msgstr "substr : la longueur %g n'est pas >= 1"
-#: builtin.c:1505
+#: builtin.c:1693
#, c-format
msgid "substr: length %g is not >= 0"
msgstr "substr : la longueur %g n'est pas >= 0"
-#: builtin.c:1512
+#: builtin.c:1700
#, c-format
msgid "substr: non-integer length %g will be truncated"
msgstr "substr : la longueur %g n'est pas entière, elle sera tronquée"
-#: builtin.c:1517
+#: builtin.c:1705
#, c-format
msgid "substr: length %g too big for string indexing, truncating to %g"
msgstr "substr : la longueur %g est trop grande, tronquée à %g"
-#: builtin.c:1529
+#: builtin.c:1717
#, c-format
msgid "substr: start index %g is invalid, using 1"
msgstr "substr : l'index de début %g n'est pas valide, utilisation de 1"
-#: builtin.c:1534
+#: builtin.c:1722
#, c-format
msgid "substr: non-integer start index %g will be truncated"
msgstr "substr : l'index de début %g n'est pas un entier, il sera tronqué"
-#: builtin.c:1559
+#: builtin.c:1747
msgid "substr: source string is zero length"
msgstr "substr : la chaîne source est de longueur nulle"
-#: builtin.c:1575
+#: builtin.c:1763
#, c-format
msgid "substr: start index %g is past end of string"
msgstr "substr : l'index de début %g est au-delà de la fin de la chaîne"
-#: builtin.c:1583
+#: builtin.c:1771
#, c-format
msgid ""
"substr: length %g at start index %g exceeds length of first argument (%lu)"
@@ -759,237 +750,1094 @@ msgstr ""
"substr : la longueur %g à partir de %g dépasse la fin du 1er argument (%lu)"
# Exemple : gawk --lint 'BEGIN { PROCINFO["strftime"]=123 ; print strftime() }'
-#: builtin.c:1657
+#: builtin.c:1845
msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type"
msgstr ""
"strftime : la valeur de formatage PROCINFO[\"strftime\"] est de type "
"numérique"
-#: builtin.c:1680
+#: builtin.c:1868
msgid "strftime: received non-numeric second argument"
msgstr "strftime : le second argument n'est pas numérique"
-#: builtin.c:1683
+#: builtin.c:1872
msgid "strftime: second argument less than 0 or too big for time_t"
msgstr "strftime: second argument négatif ou trop grand pour time_t"
-#: builtin.c:1690
+#: builtin.c:1879
msgid "strftime: received non-string first argument"
msgstr "strftim : le premier argument n'est pas une chaîne"
-#: builtin.c:1696
+#: builtin.c:1886
msgid "strftime: received empty format string"
msgstr "strftime : la chaîne de formatage est vide"
-#: builtin.c:1762
+#: builtin.c:1952
msgid "mktime: received non-string argument"
msgstr "mktime : l'argument n'est pas une chaîne"
-#: builtin.c:1779
+#: builtin.c:1969
msgid "mktime: at least one of the values is out of the default range"
msgstr ""
"mktime : au moins l'une des valeurs est en dehors de la plage par défaut"
-#: builtin.c:1814
+#: builtin.c:2004
msgid "'system' function not allowed in sandbox mode"
msgstr "La fonction « system » est interdite en isolement (mode sandbox)"
-#: builtin.c:1819
+#: builtin.c:2009
msgid "system: received non-string argument"
msgstr "system : l'argument n'est pas une chaîne"
-#: builtin.c:1874 eval.c:1159 eval.c:1790 eval.c:1803
-#, c-format
-msgid "reference to uninitialized variable `%s'"
-msgstr "référence à une variable non initialisée « %s »"
-
-#: builtin.c:1941
+#: builtin.c:2127
#, c-format
msgid "reference to uninitialized field `$%d'"
msgstr "référence à un champ non initialisé « $%d »"
-#: builtin.c:2028
+#: builtin.c:2214
msgid "tolower: received non-string argument"
msgstr "tolower : l'argument n'est pas une chaîne"
-#: builtin.c:2062
+#: builtin.c:2248
msgid "toupper: received non-string argument"
msgstr "toupper : l'argument n'est pas une chaîne"
-#: builtin.c:2098
+#: builtin.c:2284 mpfr.c:685
msgid "atan2: received non-numeric first argument"
msgstr "atan2 : le premier argument n'est pas numérique"
-#: builtin.c:2100
+#: builtin.c:2286 mpfr.c:687
msgid "atan2: received non-numeric second argument"
msgstr "atan2 : le second argument n'est pas numérique"
-#: builtin.c:2119
+#: builtin.c:2305
msgid "sin: received non-numeric argument"
msgstr "sin : l'argument n'est pas numérique"
-#: builtin.c:2135
+#: builtin.c:2321
msgid "cos: received non-numeric argument"
msgstr "cos : l'argument n'est pas numérique"
-#: builtin.c:2188
+#: builtin.c:2374 mpfr.c:1137
msgid "srand: received non-numeric argument"
msgstr "srand : l'argument n'est pas numérique"
-#: builtin.c:2219
+#: builtin.c:2405
msgid "match: third argument is not an array"
msgstr "match : le 3e argument n'est pas un tableau"
-#: builtin.c:2483
+#: builtin.c:2670
msgid "gensub: third argument of 0 treated as 1"
msgstr "gensub : le 3e argument vaut 0, il sera traité comme un 1"
-#: builtin.c:2776
+#: builtin.c:2963
msgid "lshift: received non-numeric first argument"
msgstr "lshift : le premier argument n'est pas numérique"
-#: builtin.c:2778
+#: builtin.c:2965
msgid "lshift: received non-numeric second argument"
msgstr "lshift : le second argument reçu n'est pas numérique"
-#: builtin.c:2784
+#: builtin.c:2971
#, fuzzy, c-format
msgid "lshift(%f, %f): negative values will give strange results"
msgstr ""
"lshift(%lf, %lf) : les valeurs négatives donneront des résultats inattendus"
-#: builtin.c:2786
+#: builtin.c:2973
#, fuzzy, c-format
msgid "lshift(%f, %f): fractional values will be truncated"
msgstr "lshift(%lf, %lf) : les valeurs non entières seront tronquées"
-#: builtin.c:2788
+#: builtin.c:2975
#, fuzzy, c-format
msgid "lshift(%f, %f): too large shift value will give strange results"
msgstr ""
"lshift(%lf, %lf) : un décalage trop grand donnera des résultats inattendus"
-#: builtin.c:2813
+#: builtin.c:3000
msgid "rshift: received non-numeric first argument"
msgstr "rshift : le premier argument n'est pas numérique"
-#: builtin.c:2815
+#: builtin.c:3002
msgid "rshift: received non-numeric second argument"
msgstr "rshift : le second argument reçu n'est pas numérique"
-#: builtin.c:2821
+#: builtin.c:3008
#, fuzzy, c-format
msgid "rshift(%f, %f): negative values will give strange results"
msgstr ""
"rshift(%lf, %lf) : les valeurs négatives donneront des résultats inattendus"
-#: builtin.c:2823
+#: builtin.c:3010
#, fuzzy, c-format
msgid "rshift(%f, %f): fractional values will be truncated"
msgstr "rshift(%lf, %lf) : les valeurs non entières seront tronquées"
-#: builtin.c:2825
+#: builtin.c:3012
#, fuzzy, c-format
msgid "rshift(%f, %f): too large shift value will give strange results"
msgstr ""
"rshift(%lf, %lf) : un décalage trop grand donnera des résultats inattendus"
-#: builtin.c:2850
-msgid "and: received non-numeric first argument"
-msgstr "and : le premier argument n'est pas numérique"
+#: builtin.c:3037
+#, fuzzy
+msgid "and: called with less than two arguments"
+msgstr "sqrt : appelé avec un argument négatif %g"
-#: builtin.c:2852
-msgid "and: received non-numeric second argument"
-msgstr "and : le second argument reçu n'est pas numérique"
+#: builtin.c:3042
+#, fuzzy, c-format
+msgid "and: argument %d is non-numeric"
+msgstr "exp : l'argument %g est hors limite"
-#: builtin.c:2858
+#: builtin.c:3046
#, fuzzy, c-format
-msgid "and(%f, %f): negative values will give strange results"
+msgid "and: argument %d negative value %g will give strange results"
msgstr ""
"and(%lf, %lf) : les valeurs négatives donneront des résultats inattendus"
-#: builtin.c:2860
-#, fuzzy, c-format
-msgid "and(%f, %f): fractional values will be truncated"
-msgstr "and(%lf, %lf): les valeurs non entières seront tronquées"
-
-#: builtin.c:2885
-msgid "or: received non-numeric first argument"
-msgstr "or : le premier argument n'est pas numérique"
-
-#: builtin.c:2887
-msgid "or: received non-numeric second argument"
-msgstr "or : le second argument reçu n'est pas numérique"
+#: builtin.c:3069
+#, fuzzy
+msgid "or: called with less than two arguments"
+msgstr "sqrt : appelé avec un argument négatif %g"
-#: builtin.c:2893
+#: builtin.c:3074
#, fuzzy, c-format
-msgid "or(%f, %f): negative values will give strange results"
-msgstr ""
-"or(%lf, %lf) : les valeurs négatives donneront des résultats inattendus"
+msgid "or: argument %d is non-numeric"
+msgstr "exp : l'argument %g est hors limite"
-#: builtin.c:2895
+#: builtin.c:3078
#, fuzzy, c-format
-msgid "or(%f, %f): fractional values will be truncated"
-msgstr "or(%lf, %lf) : les valeurs non entières seront tronquées"
+msgid "or: argument %d negative value %g will give strange results"
+msgstr "compl(%lf) : les valeurs négatives donneront des résultats inattendus"
-#: builtin.c:2923
-msgid "xor: received non-numeric first argument"
-msgstr "xor : le premier argument n'est pas numérique"
+#: builtin.c:3100
+#, fuzzy
+msgid "xor: called with less than two arguments"
+msgstr "sqrt : appelé avec un argument négatif %g"
-#: builtin.c:2925
-msgid "xor: received non-numeric second argument"
-msgstr "xor : le second argument reçu n'est pas numérique"
+#: builtin.c:3106
+#, fuzzy, c-format
+msgid "xor: argument %d is non-numeric"
+msgstr "exp : l'argument %g est hors limite"
-#: builtin.c:2931
+#: builtin.c:3110
#, fuzzy, c-format
-msgid "xor(%f, %f): negative values will give strange results"
+msgid "xor: argument %d negative value %g will give strange results"
msgstr ""
"xor(%lf, %lf) : les valeurs négatives donneront des résultats inattendus"
-#: builtin.c:2933
-#, fuzzy, c-format
-msgid "xor(%f, %f): fractional values will be truncated"
-msgstr "xor(%lf, %lf) : les valeurs non entières seront tronquées"
-
-#: builtin.c:2957 builtin.c:2963
+#: builtin.c:3135 mpfr.c:800
msgid "compl: received non-numeric argument"
msgstr "compl : l'argument n'est pas numérique"
-#: builtin.c:2965
+#: builtin.c:3141
#, fuzzy, c-format
msgid "compl(%f): negative value will give strange results"
msgstr "compl(%lf) : les valeurs négatives donneront des résultats inattendus"
-#: builtin.c:2967
+#: builtin.c:3143
#, fuzzy, c-format
msgid "compl(%f): fractional value will be truncated"
msgstr "compl(%lf) : les valeurs non entières seront tronquées"
-#: builtin.c:3136
+#: builtin.c:3312
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr "dcgettext : « %s » n'est pas dans un catégorie valide de la locale"
-#: eval.c:412
+#: command.y:225
+#, c-format
+msgid "Type (g)awk statement(s). End with the command \"end\"\n"
+msgstr ""
+
+#: command.y:289
+#, fuzzy, c-format
+msgid "invalid frame number: %d"
+msgstr "Borne finale non valide"
+
+#: command.y:295
+#, fuzzy, c-format
+msgid "info: invalid option - \"%s\""
+msgstr "%s : option non valide -- « %c »\n"
+
+#: command.y:321
+#, c-format
+msgid "source \"%s\": already sourced."
+msgstr ""
+
+#: command.y:326
+#, c-format
+msgid "save \"%s\": command not permitted."
+msgstr ""
+
+#: command.y:339
+msgid "Can't use command `commands' for breakpoint/watchpoint commands"
+msgstr ""
+
+#: command.y:341
+msgid "no breakpoint/watchpoint has been set yet"
+msgstr ""
+
+#: command.y:343
+msgid "invalid breakpoint/watchpoint number"
+msgstr ""
+
+#: command.y:348
+#, c-format
+msgid "Type commands for when %s %d is hit, one per line.\n"
+msgstr ""
+
+#: command.y:350
+#, c-format
+msgid "End with the command \"end\"\n"
+msgstr ""
+
+#: command.y:357
+msgid "`end' valid only in command `commands' or `eval'"
+msgstr ""
+
+#: command.y:367
+msgid "`silent' valid only in command `commands'"
+msgstr ""
+
+#: command.y:373
+#, fuzzy, c-format
+msgid "trace: invalid option - \"%s\""
+msgstr "%s : option non valide -- « %c »\n"
+
+#: command.y:387
+msgid "condition: invalid breakpoint/watchpoint number"
+msgstr ""
+
+#: command.y:449
+#, fuzzy
+msgid "argument not a string"
+msgstr "exp : l'argument %g est hors limite"
+
+#: command.y:459 command.y:464
+#, c-format
+msgid "option: invalid parameter - \"%s\""
+msgstr ""
+
+#: command.y:474
+#, c-format
+msgid "no such function - \"%s\""
+msgstr ""
+
+#: command.y:531
+#, fuzzy, c-format
+msgid "enable: invalid option - \"%s\""
+msgstr "%s : option non valide -- « %c »\n"
+
+#: command.y:597
+#, fuzzy, c-format
+msgid "invalid range specification: %d - %d"
+msgstr "Borne finale non valide"
+
+#: command.y:659
+#, fuzzy
+msgid "non-numeric value for field number"
+msgstr "valeur inconnue pour la définition de champ : %d\n"
+
+#: command.y:680 command.y:687
+msgid "non-numeric value found, numeric expected"
+msgstr ""
+
+#: command.y:712 command.y:718
+msgid "non-zero integer value"
+msgstr ""
+
+#: command.y:817
+msgid ""
+"backtrace [N] - print trace of all or N innermost (outermost if N < 0) "
+"frames."
+msgstr ""
+
+#: command.y:819
+msgid ""
+"break [[filename:]N|function] - set breakpoint at the specified location."
+msgstr ""
+
+#: command.y:821
+msgid "clear [[filename:]N|function] - delete breakpoints previously set."
+msgstr ""
+
+#: command.y:823
+msgid ""
+"commands [num] - starts a list of commands to be executed at a breakpoint"
+"(watchpoint) hit."
+msgstr ""
+
+#: command.y:825
+msgid "condition num [expr] - set or clear breakpoint or watchpoint condition."
+msgstr ""
+
+#: command.y:827
+msgid "continue [COUNT] - continue program being debugged."
+msgstr ""
+
+#: command.y:829
+msgid "delete [breakpoints] [range] - delete specified breakpoints."
+msgstr ""
+
+#: command.y:831
+msgid "disable [breakpoints] [range] - disable specified breakpoints."
+msgstr ""
+
+#: command.y:833
+msgid "display [var] - print value of variable each time the program stops."
+msgstr ""
+
+#: command.y:835
+msgid "down [N] - move N frames down the stack."
+msgstr ""
+
+#: command.y:837
+msgid "dump [filename] - dump instructions to file or stdout."
+msgstr ""
+
+#: command.y:839
+msgid "enable [once|del] [breakpoints] [range] - enable specified breakpoints."
+msgstr ""
+
+#: command.y:841
+msgid "end - end a list of commands or awk statements."
+msgstr ""
+
+#: command.y:843
+msgid "eval stmt|[p1, p2, ...] - evaluate awk statement(s)."
+msgstr ""
+
+#: command.y:845
+msgid "finish - execute until selected stack frame returns."
+msgstr ""
+
+#: command.y:847
+msgid "frame [N] - select and print stack frame number N."
+msgstr ""
+
+#: command.y:849
+msgid "help [command] - print list of commands or explanation of command."
+msgstr ""
+
+#: command.y:851
+msgid "ignore N COUNT - set ignore-count of breakpoint number N to COUNT."
+msgstr ""
+
+#: command.y:853
+msgid ""
+"info topic - source|sources|variables|functions|break|frame|args|locals|"
+"display|watch."
+msgstr ""
+
+#: command.y:855
+msgid "list [-|+|[filename:]lineno|function|range] - list specified line(s)."
+msgstr ""
+
+#: command.y:857
+msgid "next [COUNT] - step program, proceeding through subroutine calls."
+msgstr ""
+
+#: command.y:859
+msgid ""
+"nexti [COUNT] - step one instruction, but proceed through subroutine calls."
+msgstr ""
+
+#: command.y:861
+msgid "option [name[=value]] - set or display debugger option(s)."
+msgstr ""
+
+#: command.y:863
+msgid "print var [var] - print value of a variable or array."
+msgstr ""
+
+#: command.y:865
+msgid "printf format, [arg], ... - formatted output."
+msgstr ""
+
+#: command.y:867
+msgid "quit - exit debugger."
+msgstr ""
+
+#: command.y:869
+msgid "return [value] - make selected stack frame return to its caller."
+msgstr ""
+
+#: command.y:871
+msgid "run - start or restart executing program."
+msgstr ""
+
+#: command.y:874
+msgid "save filename - save commands from the session to file."
+msgstr ""
+
+#: command.y:877
+msgid "set var = value - assign value to a scalar variable."
+msgstr ""
+
+#: command.y:879
+msgid ""
+"silent - suspends usual message when stopped at a breakpoint/watchpoint."
+msgstr ""
+
+#: command.y:881
+msgid "source file - execute commands from file."
+msgstr ""
+
+#: command.y:883
+msgid "step [COUNT] - step program until it reaches a different source line."
+msgstr ""
+
+#: command.y:885
+msgid "stepi [COUNT] - step one instruction exactly."
+msgstr ""
+
+#: command.y:887
+msgid "tbreak [[filename:]N|function] - set a temporary breakpoint."
+msgstr ""
+
+#: command.y:889
+msgid "trace on|off - print instruction before executing."
+msgstr ""
+
+#: command.y:891
+msgid "undisplay [N] - remove variable(s) from automatic display list."
+msgstr ""
+
+#: command.y:893
+msgid ""
+"until [[filename:]N|function] - execute until program reaches a different "
+"line or line N within current frame."
+msgstr ""
+
+#: command.y:895
+msgid "unwatch [N] - remove variable(s) from watch list."
+msgstr ""
+
+#: command.y:897
+msgid "up [N] - move N frames up the stack."
+msgstr ""
+
+#: command.y:899
+msgid "watch var - set a watchpoint for a variable."
+msgstr ""
+
+#: command.y:1011 debug.c:395 msg.c:128
+#, c-format
+msgid "error: "
+msgstr "erreur : "
+
+#: command.y:1051
+#, fuzzy, c-format
+msgid "can't read command (%s)\n"
+msgstr "impossible de rediriger depuis « %s » (%s)"
+
+#: command.y:1065
+#, fuzzy, c-format
+msgid "can't read command (%s)"
+msgstr "impossible de rediriger depuis « %s » (%s)"
+
+#: command.y:1116
+#, fuzzy
+msgid "invalid character in command"
+msgstr "Nom de classe de caractères non valide"
+
+#: command.y:1152
+#, c-format
+msgid "unknown command - \"%.*s\", try help"
+msgstr ""
+
+#: command.y:1222
+#, c-format
+msgid "%s"
+msgstr ""
+
+#: command.y:1284
+#, fuzzy
+msgid "invalid character"
+msgstr "Caractère d'interclassement non valide"
+
+#: command.y:1455
+#, c-format
+msgid "undefined command: %s\n"
+msgstr ""
+
+#: debug.c:246
+msgid "set or show the number of lines to keep in history file."
+msgstr ""
+
+#: debug.c:248
+msgid "set or show the list command window size."
+msgstr ""
+
+#: debug.c:250
+msgid "set or show gawk output file."
+msgstr ""
+
+#: debug.c:252
+msgid "set or show debugger prompt."
+msgstr ""
+
+#: debug.c:254
+msgid "(un)set or show saving of command history (value=on|off)."
+msgstr ""
+
+#: debug.c:256
+msgid "(un)set or show saving of options (value=on|off)."
+msgstr ""
+
+#: debug.c:258
+msgid "(un)set or show instruction tracing (value=on|off)."
+msgstr ""
+
+#: debug.c:339
+msgid "program not running."
+msgstr ""
+
+#: debug.c:442 debug.c:597
+#, fuzzy, c-format
+msgid "can't read source file `%s' (%s)"
+msgstr "impossible de lire le fichier source « %s » (%s)"
+
+#: debug.c:447
+#, fuzzy, c-format
+msgid "source file `%s' is empty.\n"
+msgstr "le fichier source « %s » est vide"
+
+#: debug.c:474
+msgid "no current source file."
+msgstr ""
+
+#: debug.c:499
+#, fuzzy, c-format
+msgid "cannot find source file named `%s' (%s)"
+msgstr "impossible de lire le fichier source « %s » (%s)"
+
+#: debug.c:523
+#, c-format
+msgid "WARNING: source file `%s' modified since program compilation.\n"
+msgstr ""
+
+#: debug.c:542
+#, c-format
+msgid "line number %d out of range; `%s' has %d lines"
+msgstr ""
+
+#: debug.c:602
+#, fuzzy, c-format
+msgid "unexpected eof while reading file `%s', line %d"
+msgstr "fin de chaîne ou passage à la ligne inattendu"
+
+#: debug.c:611
+#, c-format
+msgid "source file `%s' modified since start of program execution"
+msgstr ""
+
+#: debug.c:723
+#, fuzzy, c-format
+msgid "Current source file: %s\n"
+msgstr "le fichier source « %s » a déjà été intégré"
+
+#: debug.c:724
+#, c-format
+msgid "Number of lines: %d\n"
+msgstr ""
+
+#: debug.c:731
+#, c-format
+msgid "Source file (lines): %s (%d)\n"
+msgstr ""
+
+#: debug.c:745
+msgid ""
+"Number Disp Enabled Location\n"
+"\n"
+msgstr ""
+
+#: debug.c:756
+#, c-format
+msgid "\tno of hits = %ld\n"
+msgstr ""
+
+#: debug.c:758
+#, c-format
+msgid "\tignore next %ld hit(s)\n"
+msgstr ""
+
+#: debug.c:760 debug.c:900
+#, c-format
+msgid "\tstop condition: %s\n"
+msgstr ""
+
+#: debug.c:762 debug.c:902
+msgid "\tcommands:\n"
+msgstr ""
+
+#: debug.c:784
+#, c-format
+msgid "Current frame: "
+msgstr ""
+
+#: debug.c:787
+#, c-format
+msgid "Called by frame: "
+msgstr ""
+
+#: debug.c:791
+#, c-format
+msgid "Caller of frame: "
+msgstr ""
+
+#: debug.c:809
+#, c-format
+msgid "None in main().\n"
+msgstr ""
+
+#: debug.c:839
+#, fuzzy
+msgid "No arguments.\n"
+msgstr "printf : aucun argument"
+
+#: debug.c:840
+msgid "No locals.\n"
+msgstr ""
+
+#: debug.c:848
+msgid ""
+"All defined variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:858
+msgid ""
+"All defined functions:\n"
+"\n"
+msgstr ""
+
+#: debug.c:877
+msgid ""
+"Auto-display variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:880
+msgid ""
+"Watch variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:1020
+#, fuzzy, c-format
+msgid "no symbol `%s' in current context\n"
+msgstr "« exit » ne peut pas être appelé dans ce contexte"
+
+#: debug.c:1032 debug.c:1416
+#, fuzzy, c-format
+msgid "`%s' is not an array\n"
+msgstr "« %s » n'est pas un nom de variable valide"
+
+#: debug.c:1046
+#, fuzzy, c-format
+msgid "$%ld = uninitialized field\n"
+msgstr "référence à un champ non initialisé « $%d »"
+
+#: debug.c:1067
+#, fuzzy, c-format
+msgid "array `%s' is empty\n"
+msgstr "le fichier de données « %s » est vide"
+
+#: debug.c:1110 debug.c:1162
+#, fuzzy, c-format
+msgid "[\"%s\"] not in array `%s'\n"
+msgstr "delete : l'indice « %s » est absent du tableau « %s »"
+
+#: debug.c:1166
+#, c-format
+msgid "`%s[\"%s\"]' is not an array\n"
+msgstr ""
+
+#: debug.c:1227 debug.c:4947
+#, fuzzy, c-format
+msgid "`%s' is not a scalar variable"
+msgstr "« %s » n'est pas un nom de variable valide"
+
+#: debug.c:1249 debug.c:4977
+#, fuzzy, c-format
+msgid "attempt to use array `%s[\"%s\"]' in a scalar context"
+msgstr ""
+"tentative d'utilisation du tableau « %s[\"%.*s\"] » dans un contexte scalaire"
+
+#: debug.c:1269 debug.c:4988
+#, fuzzy, c-format
+msgid "attempt to use scalar `%s[\"%s\"]' as array"
+msgstr "tentative d'utiliser le scalaire « %s[\"%.*s\"] » comme tableau"
+
+#: debug.c:1412
+#, fuzzy, c-format
+msgid "`%s' is a function"
+msgstr "« %s » n'est pas un nom de fonction valide"
+
+#: debug.c:1454
+#, c-format
+msgid "watchpoint %d is unconditional\n"
+msgstr ""
+
+#: debug.c:1488
+#, c-format
+msgid "No display item numbered %ld"
+msgstr ""
+
+#: debug.c:1491
+#, c-format
+msgid "No watch item numbered %ld"
+msgstr ""
+
+#: debug.c:1517
+#, fuzzy, c-format
+msgid "%d: [\"%s\"] not in array `%s'\n"
+msgstr "delete : l'indice « %s » est absent du tableau « %s »"
+
+#: debug.c:1756
+#, fuzzy
+msgid "attempt to use scalar value as array"
+msgstr "tentative d'utiliser un scalaire comme tableau"
+
+#: debug.c:1845
+#, c-format
+msgid "Watchpoint %d deleted because parameter is out of scope.\n"
+msgstr ""
+
+#: debug.c:1856
+#, c-format
+msgid "Display %d deleted because parameter is out of scope.\n"
+msgstr ""
+
+#: debug.c:1889
+#, c-format
+msgid " in file `%s', line %d\n"
+msgstr ""
+
+#: debug.c:1910
+#, c-format
+msgid " at `%s':%d"
+msgstr ""
+
+#: debug.c:1926 debug.c:1989
+#, c-format
+msgid "#%ld\tin "
+msgstr ""
+
+#: debug.c:1963
+#, c-format
+msgid "More stack frames follow ...\n"
+msgstr ""
+
+#: debug.c:2006
+#, fuzzy
+msgid "invalid frame number"
+msgstr "Borne finale non valide"
+
+#: debug.c:2178
+#, c-format
+msgid "Note: breakpoint %d (enabled, ignore next %ld hits), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2185
+#, c-format
+msgid "Note: breakpoint %d (enabled), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2192
+#, c-format
+msgid "Note: breakpoint %d (disabled, ignore next %ld hits), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2199
+#, c-format
+msgid "Note: breakpoint %d (disabled), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2216
+#, c-format
+msgid "Breakpoint %d set at file `%s', line %d\n"
+msgstr ""
+
+#: debug.c:2318
+#, c-format
+msgid "Can't set breakpoint in file `%s'\n"
+msgstr ""
+
+#: debug.c:2347 debug.c:2470 debug.c:3328
+#, fuzzy, c-format
+msgid "line number %d in file `%s' out of range"
+msgstr "exp : l'argument %g est hors limite"
+
+#: debug.c:2351
+#, c-format
+msgid "Can't find rule!!!\n"
+msgstr ""
+
+#: debug.c:2353
+#, c-format
+msgid "Can't set breakpoint at `%s':%d\n"
+msgstr ""
+
+#: debug.c:2365
+#, c-format
+msgid "Can't set breakpoint in function `%s'\n"
+msgstr ""
+
+#: debug.c:2381
+#, c-format
+msgid "breakpoint %d set at file `%s', line %d is unconditional\n"
+msgstr ""
+
+#: debug.c:2486 debug.c:2508
+#, c-format
+msgid "Deleted breakpoint %d"
+msgstr ""
+
+#: debug.c:2492
+#, c-format
+msgid "No breakpoint(s) at entry to function `%s'\n"
+msgstr ""
+
+#: debug.c:2519
+#, fuzzy, c-format
+msgid "No breakpoint at file `%s', line #%d\n"
+msgstr "erreur lors de la lecture du fichier en entrée « %s » : %s"
+
+#: debug.c:2574 debug.c:2615 debug.c:2635 debug.c:2678
+msgid "invalid breakpoint number"
+msgstr ""
+
+#: debug.c:2590
+msgid "Delete all breakpoints? (y or n) "
+msgstr ""
+
+#: debug.c:2591 debug.c:2901 debug.c:2954
+msgid "y"
+msgstr ""
+
+#: debug.c:2640
+#, c-format
+msgid "Will ignore next %ld crossing(s) of breakpoint %d.\n"
+msgstr ""
+
+#: debug.c:2644
+#, c-format
+msgid "Will stop next time breakpoint %d is reached.\n"
+msgstr ""
+
+#: debug.c:2761
+#, c-format
+msgid "Can only debug programs provided with the `-f' option.\n"
+msgstr ""
+
+#: debug.c:2886
+#, c-format
+msgid "Failed to restart debugger"
+msgstr ""
+
+#: debug.c:2900
+msgid "Program already running. Restart from beginning (y/n)? "
+msgstr ""
+
+#: debug.c:2904
+#, c-format
+msgid "Program not restarted\n"
+msgstr ""
+
+#: debug.c:2914
+#, c-format
+msgid "error: cannot restart, operation not allowed\n"
+msgstr ""
+
+#: debug.c:2920
+#, c-format
+msgid "error (%s): cannot restart, ignoring rest of the commands\n"
+msgstr ""
+
+#: debug.c:2928
+#, c-format
+msgid "Starting program: \n"
+msgstr ""
+
+#: debug.c:2937
+#, c-format
+msgid "Program exited %s with exit value: %d\n"
+msgstr ""
+
+#: debug.c:2953
+msgid "The program is running. Exit anyway (y/n)? "
+msgstr ""
+
+#: debug.c:2988
+#, c-format
+msgid "Not stopped at any breakpoint; argument ignored.\n"
+msgstr ""
+
+#: debug.c:2993
+#, c-format
+msgid "invalid breakpoint number %d."
+msgstr ""
+
+#: debug.c:2998
+#, c-format
+msgid "Will ignore next %ld crossings of breakpoint %d.\n"
+msgstr ""
+
+#: debug.c:3185
+#, c-format
+msgid "'finish' not meaningful in the outermost frame main()\n"
+msgstr ""
+
+#: debug.c:3190
+#, c-format
+msgid "Run till return from "
+msgstr ""
+
+#: debug.c:3233
+#, c-format
+msgid "'return' not meaningful in the outermost frame main()\n"
+msgstr ""
+
+#: debug.c:3347
+#, c-format
+msgid "Can't find specified location in function `%s'\n"
+msgstr ""
+
+#: debug.c:3355
+#, fuzzy, c-format
+msgid "invalid source line %d in file `%s'"
+msgstr "le fichier source « %s » a déjà été intégré"
+
+#: debug.c:3370
+#, c-format
+msgid "Can't find specified location %d in file `%s'\n"
+msgstr ""
+
+#: debug.c:3402
+#, fuzzy, c-format
+msgid "element not in array\n"
+msgstr "delete : l'indice « %s » est absent du tableau « %s »"
+
+#: debug.c:3402
+#, c-format
+msgid "untyped variable\n"
+msgstr ""
+
+#: debug.c:3444
+#, c-format
+msgid "Stopping in %s ...\n"
+msgstr ""
+
+#: debug.c:3521
+#, c-format
+msgid "'finish' not meaningful with non-local jump '%s'\n"
+msgstr ""
+
+#: debug.c:3528
+#, c-format
+msgid "'until' not meaningful with non-local jump '%s'\n"
+msgstr ""
+
+#: debug.c:4163
+msgid "\t------[Enter] to continue or q [Enter] to quit------"
+msgstr ""
+
+#: debug.c:4164
+msgid "q"
+msgstr ""
+
+#: debug.c:4984
+#, fuzzy, c-format
+msgid "[\"%s\"] not in array `%s'"
+msgstr "delete : l'indice « %s » est absent du tableau « %s »"
+
+#: debug.c:5190
+#, c-format
+msgid "sending output to stdout\n"
+msgstr ""
+
+#: debug.c:5230
+msgid "invalid number"
+msgstr ""
+
+#: debug.c:5362
+#, fuzzy, c-format
+msgid "`%s' not allowed in current context; statement ignored"
+msgstr "« exit » ne peut pas être appelé dans ce contexte"
+
+#: debug.c:5370
+#, fuzzy
+msgid "`return' not allowed in current context; statement ignored"
+msgstr "« exit » ne peut pas être appelé dans ce contexte"
+
+#: debug.c:5571
+#, c-format
+msgid "No symbol `%s' in current context"
+msgstr ""
+
+#: dfa.c:984 dfa.c:987 dfa.c:1007 dfa.c:1017 dfa.c:1029 dfa.c:1080 dfa.c:1089
+#: dfa.c:1092 dfa.c:1097 dfa.c:1110 dfa.c:1178
+msgid "unbalanced ["
+msgstr ""
+
+#: dfa.c:1038
+#, fuzzy
+msgid "invalid character class"
+msgstr "Nom de classe de caractères non valide"
+
+#: dfa.c:1215
+msgid "character class syntax is [[:space:]], not [:space:]"
+msgstr ""
+
+#: dfa.c:1267
+msgid "unfinished \\ escape"
+msgstr ""
+
+#: dfa.c:1414 regcomp.c:161
+msgid "Invalid content of \\{\\}"
+msgstr "Contenu de \\{\\} non valide"
+
+#: dfa.c:1417 regcomp.c:176
+msgid "Regular expression too big"
+msgstr "Expression rationnelle trop grande"
+
+#: dfa.c:1802
+msgid "unbalanced ("
+msgstr ""
+
+#: dfa.c:1929
+msgid "no syntax specified"
+msgstr ""
+
+#: dfa.c:1937
+msgid "unbalanced )"
+msgstr ""
+
+#: eval.c:394
#, c-format
msgid "unknown nodetype %d"
msgstr "type de nœud %d inconnu"
-#: eval.c:423 eval.c:437
+#: eval.c:405 eval.c:419
#, c-format
msgid "unknown opcode %d"
msgstr "code opération %d inconnu"
-#: eval.c:434
+#: eval.c:416
#, c-format
msgid "opcode %s not an operator or keyword"
msgstr "le code opération %s n'est pas un opérateur ou un mot-clef"
-#: eval.c:488
+#: eval.c:471
msgid "buffer overflow in genflags2str"
msgstr "débordement de tampon dans genflag2str"
-#: eval.c:698
+#: eval.c:674
#, c-format
msgid ""
"\n"
@@ -1000,311 +1848,539 @@ msgstr ""
"\t# Pile des appels de fonctions :\n"
"\n"
-#: eval.c:725
+#: eval.c:703
msgid "`IGNORECASE' is a gawk extension"
msgstr "« IGNORECASE » est une extension gawk"
-#: eval.c:754
+#: eval.c:735
msgid "`BINMODE' is a gawk extension"
msgstr "« BINMODE » est une extension gawk"
-#: eval.c:812
+#: eval.c:792
#, c-format
msgid "BINMODE value `%s' is invalid, treated as 3"
msgstr "la valeur « %s » de BINMODE n'est pas valide, 3 utilisé à la place"
-#: eval.c:902
+#: eval.c:884
#, c-format
msgid "bad `%sFMT' specification `%s'"
msgstr "spécification de « %sFMT » erronée « %s »"
-#: eval.c:980
+#: eval.c:968
msgid "turning off `--lint' due to assignment to `LINT'"
msgstr "désactivation de « --lint » en raison d'une affectation à « LINT »"
-#: eval.c:1127 eval.c:1777
-#, c-format
-msgid "can't use function name `%s' as variable or array"
-msgstr "impossible d'utiliser la fonction « %s » comme variable ou tableau"
-
-#: eval.c:1158 eval.c:1789 eval.c:1802
+#: eval.c:1144
#, c-format
msgid "reference to uninitialized argument `%s'"
msgstr "référence à un argument non initialisé « %s »"
-#: eval.c:1177
+#: eval.c:1145
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "référence à une variable non initialisée « %s »"
+
+#: eval.c:1163
msgid "attempt to field reference from non-numeric value"
msgstr "tentative de référence à un champ via une valeur non numérique"
-#: eval.c:1179
+#: eval.c:1165
msgid "attempt to field reference from null string"
msgstr "tentative de référence à un champ via une chaîne nulle"
-#: eval.c:1185
+#: eval.c:1173
#, c-format
msgid "attempt to access field %ld"
msgstr "tentative d'accès au champ %ld"
-#: eval.c:1194
+#: eval.c:1182
#, c-format
msgid "reference to uninitialized field `$%ld'"
msgstr "référence à un champ non initialisé « $%ld »"
-#: eval.c:1256
+#: eval.c:1269
#, c-format
msgid "function `%s' called with more arguments than declared"
msgstr "la fonction « %s » a été appelée avec trop d'arguments"
-#: eval.c:1437
+#: eval.c:1464
#, c-format
msgid "unwind_stack: unexpected type `%s'"
msgstr "unwind_stack: type « %s » inattendu"
-#: eval.c:1532
+#: eval.c:1558
msgid "division by zero attempted in `/='"
msgstr "tentative de division par zéro dans « /= »"
-#: eval.c:1539
+#: eval.c:1565
#, c-format
msgid "division by zero attempted in `%%='"
msgstr "tentative de division par zéro dans « %%= »"
-#: eval.c:1876 eval.c:2122
-#, c-format
-msgid "attempt to use array `%s[\"%.*s\"]' in a scalar context"
-msgstr ""
-"tentative d'utilisation du tableau « %s[\"%.*s\"] » dans un contexte scalaire"
-
-#: eval.c:1907
-msgid "assignment used in conditional context"
-msgstr "affectation utilisée dans un contexte conditionnel"
-
-#: eval.c:1911
-msgid "statement has no effect"
-msgstr "la déclaration est sans effet"
-
-#: eval.c:2343
-#, c-format
-msgid "for loop: array `%s' changed size from %ld to %ld during loop execution"
-msgstr "boucle for : la taille du tableau « %s » est passée de %ld à %ld"
-
-#: eval.c:2458
-#, c-format
-msgid "function called indirectly through `%s' does not exist"
-msgstr "la fonction indirectement appelée via « %s » n'existe pas"
-
-#: eval.c:2470
-#, c-format
-msgid "function `%s' not defined"
-msgstr "fonction « %s » non définie"
-
-#: eval.c:2511
-#, c-format
-msgid "non-redirected `getline' invalid inside `%s' rule"
-msgstr "un « getline » non redirigé n'est pas valable dans une règle « %s »"
-
-#: eval.c:2600
-#, c-format
-msgid "error reading input file `%s': %s"
-msgstr "erreur lors de la lecture du fichier en entrée « %s » : %s"
-
-#: eval.c:2614
-#, c-format
-msgid "`nextfile' cannot be called from a `%s' rule"
-msgstr "« nextfile » ne peut pas être appelé depuis une règle « %s »"
-
-#: eval.c:2661
-msgid "`exit' cannot be called in the current context"
-msgstr "« exit » ne peut pas être appelé dans ce contexte"
-
-#: eval.c:2700
-#, c-format
-msgid "`next' cannot be called from a `%s' rule"
-msgstr "« next » ne peut pas être appelé depuis une règle « %s »"
-
-#: eval.c:2766
-#, c-format
-msgid "Sorry, don't know how to interpret `%s'"
-msgstr "Désolé, je ne sais pas comment interpréter « %s »"
-
-#: ext.c:54
+#: ext.c:49
msgid "extensions are not allowed in sandbox mode"
msgstr "les extensions sont interdites en isolement (mode sandbox)"
-#: ext.c:60 ext.c:65
-msgid "`extension' is a gawk extension"
-msgstr "« extension » est une extension gawk"
+#: ext.c:52
+#, fuzzy
+msgid "-l / @load are gawk extensions"
+msgstr "@include est une extension gawk"
-#: ext.c:75
-#, c-format
-msgid "fatal: extension: cannot open `%s' (%s)\n"
+#: ext.c:55
+msgid "load_ext: received NULL lib_name"
+msgstr ""
+
+#: ext.c:58
+#, fuzzy, c-format
+msgid "load_ext: cannot open library `%s' (%s)\n"
msgstr "fatal : extension : impossible d'ouvrir « %s » (%s)\n"
-#: ext.c:84
-#, c-format
+#: ext.c:64
+#, fuzzy, c-format
msgid ""
-"fatal: extension: library `%s': does not define "
-"`plugin_is_GPL_compatible' (%s)\n"
+"load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n"
msgstr ""
"fatal : extension : la bibliothèque « %s »ne définit pas "
"« plugin_is_GPL_compatible » (%s)\n"
-#: ext.c:93
-#, c-format
-msgid "fatal: extension: library `%s': cannot call function `%s' (%s)\n"
+#: ext.c:70
+#, fuzzy, c-format
+msgid "load_ext: library `%s': cannot call function `%s' (%s)\n"
msgstr ""
"fatal : extension : bibliothèque « %s » : impossible d'appeler la fonction "
"« %s » (%s)\n"
-#: ext.c:127
-msgid "extension: missing function name"
+#: ext.c:74
+#, c-format
+msgid "load_ext: library `%s' initialization routine `%s' failed\n"
+msgstr ""
+
+#: ext.c:93
+#, fuzzy
+msgid "make_builtin: missing function name"
msgstr "extension : nom de fonction manquant"
-#: ext.c:132
-#, c-format
-msgid "extension: illegal character `%c' in function name `%s'"
+#: ext.c:98
+#, fuzzy, c-format
+msgid "make_builtin: illegal character `%c' in function name `%s'"
msgstr "extension : caractère illégal « %c » dans le nom de la fonction « %s »"
-#: ext.c:141
-#, c-format
-msgid "extension: can't redefine function `%s'"
+#: ext.c:106
+#, fuzzy, c-format
+msgid "make_builtin: can't redefine function `%s'"
msgstr "extension : impossible de redéfinir la fonction « %s »"
-#: ext.c:145
-#, c-format
-msgid "extension: function `%s' already defined"
+#: ext.c:110
+#, fuzzy, c-format
+msgid "make_builtin: function `%s' already defined"
msgstr "extension : fonction « %s » est déjà définie"
-#: ext.c:150
-#, c-format
-msgid "extension: function name `%s' previously defined"
+#: ext.c:114
+#, fuzzy, c-format
+msgid "make_builtin: function name `%s' previously defined"
msgstr "extension : nom de la fonction « %s » déjà défini"
-#: ext.c:152
-#, c-format
-msgid "extension: can't use gawk built-in `%s' as function name"
+#: ext.c:116
+#, fuzzy, c-format
+msgid "make_builtin: can't use gawk built-in `%s' as function name"
msgstr ""
"extension : impossible d'utiliser la fonction interne gawk « %s » comme nom "
"de fonction"
-#: ext.c:156
+#: ext.c:119
#, c-format
msgid "make_builtin: negative argument count for function `%s'"
msgstr "make_builtin : la fonction « %s » a un nombre négatif d'arguments"
-#: ext.c:259
+#: ext.c:183
#, c-format
msgid "function `%s' defined to take no more than %d argument(s)"
msgstr "fonction « %s » définie comme ayant au maximum« %d » argument(s)"
-#: ext.c:262
+#: ext.c:186
#, c-format
msgid "function `%s': missing argument #%d"
msgstr "fonction « %s » : argument #%d manquant"
-#: ext.c:279
+#: ext.c:203
#, c-format
msgid "function `%s': argument #%d: attempt to use scalar as an array"
msgstr ""
"fonction « %s » : argument #%d : tentative d'utilisation d'un scalaire comme "
"tableau"
-#: ext.c:283
+#: ext.c:207
#, c-format
msgid "function `%s': argument #%d: attempt to use array as a scalar"
msgstr ""
"fonction « %s » : argument #%d : tentative d'utiliser un tableau comme "
"scalaire"
-#: ext.c:296
-msgid "Operation Not Supported"
-msgstr "Opération non disponible"
+#: ext.c:221
+msgid "dynamic loading of library not supported"
+msgstr ""
+
+#: extension/filefuncs.c:75
+#, fuzzy
+msgid "chdir: called with incorrect number of arguments, expecting 1"
+msgstr "sqrt : appelé avec un argument négatif %g"
+
+#: extension/filefuncs.c:348
+#, fuzzy
+msgid "stat: called with wrong number of arguments"
+msgstr "sqrt : appelé avec un argument négatif %g"
+
+#: extension/filefuncs.c:355
+#, fuzzy
+msgid "stat: bad parameters"
+msgstr "%s : est un paramètre\n"
+
+#: extension/filefuncs.c:421
+msgid "fill_stat_element: could not create array"
+msgstr ""
+
+#: extension/filefuncs.c:430
+msgid "fill_stat_element: could not set element"
+msgstr ""
+
+#: extension/filefuncs.c:445
+#, fuzzy
+msgid "fill_path_element: could not set element"
+msgstr "index : le second argument n'est pas une chaîne"
+
+#: extension/filefuncs.c:461
+msgid "fill_error_element: could not set element"
+msgstr ""
+
+#: extension/filefuncs.c:508 extension/filefuncs.c:555
+msgid "fts-process: could not create array"
+msgstr ""
+
+#: extension/filefuncs.c:518 extension/filefuncs.c:565
+#: extension/filefuncs.c:583
+#, fuzzy
+msgid "fts-process: could not set element"
+msgstr "index : le second argument n'est pas une chaîne"
+
+#: extension/filefuncs.c:632
+#, fuzzy
+msgid "fts: called with incorrect number of arguments, expecting 3"
+msgstr "sqrt : appelé avec un argument négatif %g"
+
+#: extension/filefuncs.c:635
+#, fuzzy
+msgid "fts: bad first parameter"
+msgstr "%s : est un paramètre\n"
+
+#: extension/filefuncs.c:641
+#, fuzzy
+msgid "fts: bad second parameter"
+msgstr "%s : est un paramètre\n"
+
+#: extension/filefuncs.c:647
+#, fuzzy
+msgid "fts: bad third parameter"
+msgstr "%s : est un paramètre\n"
+
+#: extension/filefuncs.c:654
+#, fuzzy
+msgid "fts: could not flatten array\n"
+msgstr "« %s » n'est pas un nom de variable valide"
+
+#: extension/filefuncs.c:672
+msgid "fts: ignoring sneaky FTS_NOSTAT flag. nyah, nyah, nyah."
+msgstr ""
+
+#: extension/filefuncs.c:689
+msgid "fts: clear_array failed\n"
+msgstr ""
+
+#: extension/fnmatch.c:91
+#, fuzzy
+msgid "fnmatch: called with less than three arguments"
+msgstr "sqrt : appelé avec un argument négatif %g"
+
+#: extension/fnmatch.c:94
+#, fuzzy
+msgid "fnmatch: called with more than three arguments"
+msgstr "sqrt : appelé avec un argument négatif %g"
+
+#: extension/fnmatch.c:97
+#, fuzzy
+msgid "fnmatch: could not get first argument"
+msgstr "strftim : le premier argument n'est pas une chaîne"
+
+#: extension/fnmatch.c:102
+#, fuzzy
+msgid "fnmatch: could not get second argument"
+msgstr "index : le second argument n'est pas une chaîne"
+
+#: extension/fnmatch.c:107
+msgid "fnmatch: could not get third argument"
+msgstr ""
+
+#: extension/fnmatch.c:120
+msgid "fnmatch is not implemented on this system\n"
+msgstr ""
+
+#: extension/fnmatch.c:152
+msgid "fnmatch init: could not add FNM_NOMATCH variable"
+msgstr ""
+
+#: extension/fnmatch.c:162
+#, c-format
+msgid "fnmatch init: could not set array element %s"
+msgstr ""
+
+#: extension/fnmatch.c:172
+msgid "fnmatch init: could not install FNM array"
+msgstr ""
+
+#: extension/fork.c:81
+#, fuzzy
+msgid "fork: called with too many arguments"
+msgstr "sqrt : appelé avec un argument négatif %g"
+
+#: extension/fork.c:94
+msgid "fork: PROCINFO is not an array!"
+msgstr ""
+
+#: extension/fork.c:118
+#, fuzzy
+msgid "waitpid: called with too many arguments"
+msgstr "sqrt : appelé avec un argument négatif %g"
+
+#: extension/fork.c:126
+#, fuzzy
+msgid "wait: called with no arguments"
+msgstr "sqrt : appelé avec un argument négatif %g"
+
+#: extension/fork.c:143
+#, fuzzy
+msgid "wait: called with too many arguments"
+msgstr "sqrt : appelé avec un argument négatif %g"
+
+#: extension/ordchr.c:69
+#, fuzzy
+msgid "ord: called with too many arguments"
+msgstr "sqrt : appelé avec un argument négatif %g"
-#: field.c:328
+#: extension/ordchr.c:75
+#, fuzzy
+msgid "ord: called with no arguments"
+msgstr "sqrt : appelé avec un argument négatif %g"
+
+#: extension/ordchr.c:77
+#, fuzzy
+msgid "ord: called with inappropriate argument(s)"
+msgstr "sqrt : appelé avec un argument négatif %g"
+
+#: extension/ordchr.c:99
+#, fuzzy
+msgid "chr: called with too many arguments"
+msgstr "sqrt : appelé avec un argument négatif %g"
+
+#: extension/ordchr.c:109
+#, fuzzy
+msgid "chr: called with no arguments"
+msgstr "sqrt : appelé avec un argument négatif %g"
+
+#: extension/ordchr.c:111
+#, fuzzy
+msgid "chr: called with inappropriate argument(s)"
+msgstr "sqrt : appelé avec un argument négatif %g"
+
+#: extension/readfile.c:81
+#, fuzzy
+msgid "readfile: called with too many arguments"
+msgstr "sqrt : appelé avec un argument négatif %g"
+
+#: extension/readfile.c:114
+#, fuzzy
+msgid "readfile: called with no arguments"
+msgstr "sqrt : appelé avec un argument négatif %g"
+
+#: extension/rwarray.c:120
+#, fuzzy
+msgid "writea: called with too many arguments"
+msgstr "sqrt : appelé avec un argument négatif %g"
+
+#: extension/rwarray.c:127
+#, fuzzy, c-format
+msgid "do_writea: argument 0 is not a string\n"
+msgstr "exp : l'argument %g est hors limite"
+
+#: extension/rwarray.c:133
+#, fuzzy, c-format
+msgid "do_writea: argument 1 is not an array\n"
+msgstr "split : le 4e argument n'est pas un tableau"
+
+#: extension/rwarray.c:180
+#, c-format
+msgid "write_array: could not flatten array\n"
+msgstr ""
+
+#: extension/rwarray.c:194
+#, c-format
+msgid "write_array: could not release flattened array\n"
+msgstr ""
+
+#: extension/rwarray.c:276
+#, fuzzy
+msgid "reada: called with too many arguments"
+msgstr "sqrt : appelé avec un argument négatif %g"
+
+#: extension/rwarray.c:283
+#, fuzzy, c-format
+msgid "do_reada: argument 0 is not a string\n"
+msgstr "exp : l'argument %g est hors limite"
+
+#: extension/rwarray.c:289
+#, fuzzy, c-format
+msgid "do_reada: argument 1 is not an array\n"
+msgstr "match : le 3e argument n'est pas un tableau"
+
+#: extension/rwarray.c:333
+#, c-format
+msgid "do_reada: clear_array failed\n"
+msgstr ""
+
+#: extension/rwarray.c:370
+#, c-format
+msgid "read_array: set_array_element failed\n"
+msgstr ""
+
+#: extension/time.c:78
+#, fuzzy
+msgid "gettimeofday: ignoring arguments"
+msgstr "mktime : l'argument n'est pas une chaîne"
+
+#: extension/time.c:109
+msgid "gettimeofday: not supported on this platform"
+msgstr ""
+
+#: extension/time.c:130
+#, fuzzy
+msgid "sleep: called with too many arguments"
+msgstr "sqrt : appelé avec un argument négatif %g"
+
+#: extension/time.c:133
+#, fuzzy
+msgid "sleep: missing required numeric argument"
+msgstr "exp : l'argument n'est pas numérique"
+
+#: extension/time.c:139
+#, fuzzy
+msgid "sleep: argument is negative"
+msgstr "exp : l'argument %g est hors limite"
+
+#: extension/time.c:166
+msgid "sleep: not supported on this platform"
+msgstr ""
+
+#: field.c:339
msgid "NF set to negative value"
msgstr "une valeur négative a été assignée à NF"
-#: field.c:951 field.c:958 field.c:962
+#: field.c:962 field.c:969 field.c:973
msgid "split: fourth argument is a gawk extension"
msgstr "split : le 4e argument est une extension gawk"
-#: field.c:955
+#: field.c:966
msgid "split: fourth argument is not an array"
msgstr "split : le 4e argument n'est pas un tableau"
-#: field.c:969
+#: field.c:980
msgid "split: second argument is not an array"
msgstr "split : le 2e argument n'est pas un tableau"
-#: field.c:973
+#: field.c:984
msgid "split: cannot use the same array for second and fourth args"
msgstr "split : impossible d'utiliser le même tableau comme 2e et 4e argument"
-#: field.c:978
+#: field.c:989
msgid "split: cannot use a subarray of second arg for fourth arg"
msgstr ""
"split : impossible d'utiliser un sous-tableau du 2e argument en 4e argument"
-#: field.c:981
+#: field.c:992
msgid "split: cannot use a subarray of fourth arg for second arg"
msgstr ""
"split : impossible d'utiliser un sous-tableau du 4e argument en 2e argument"
-#: field.c:1010
+#: field.c:1021
msgid "split: null string for third arg is a gawk extension"
msgstr "split : utiliser une chaîne vide en 3e argument est une extension gawk"
-#: field.c:1050
+#: field.c:1061
msgid "patsplit: fourth argument is not an array"
msgstr "patsplit : le 4e argument n'est pas un tableau"
-#: field.c:1055
+#: field.c:1066
msgid "patsplit: second argument is not an array"
msgstr "patsplit : le 2e argument n'est pas un tableau"
-#: field.c:1061
+#: field.c:1072
msgid "patsplit: third argument must be non-null"
msgstr "patsplit : le 3e argument n'est pas un tableau"
-#: field.c:1065
+#: field.c:1076
msgid "patsplit: cannot use the same array for second and fourth args"
msgstr ""
"patsplit : impossible d'utiliser le même tableau comme 2e et 4e argument"
-#: field.c:1070
+#: field.c:1081
msgid "patsplit: cannot use a subarray of second arg for fourth arg"
msgstr ""
"patsplit : impossible d'utiliser un sous-tableau du 2e argument en 4e "
"argument"
-#: field.c:1073
+#: field.c:1084
msgid "patsplit: cannot use a subarray of fourth arg for second arg"
msgstr ""
"patsplit : impossible d'utiliser un sous-tableau du 4e argument en 2e "
"argument"
-#: field.c:1110
+#: field.c:1122
msgid "`FIELDWIDTHS' is a gawk extension"
msgstr "« FIELDWIDTHS » est une extension gawk"
-#: field.c:1173
+#: field.c:1186
#, c-format
msgid "invalid FIELDWIDTHS value, near `%s'"
msgstr "valeur de FIELDWIDTHS non valide, près de « %s »"
-#: field.c:1246
+#: field.c:1259
msgid "null string for `FS' is a gawk extension"
msgstr "utiliser une chaîne vide pour « FS » est une extension gawk"
-#: field.c:1250
+#: field.c:1263
msgid "old awk does not support regexps as value of `FS'"
msgstr ""
"l'ancien awk n'accepte pas les expr. rationnelles comme valeur de « FS »"
-#: field.c:1369
+#: field.c:1382
msgid "`FPAT' is a gawk extension"
msgstr "« FPAT » est une extension gawk"
+#: gawkapi.c:143
+msgid "awk_value_to_node: received null retval"
+msgstr ""
+
+#: gawkapi.c:932
+#, c-format
+msgid "api_flatten_array: could not convert index %d\n"
+msgstr ""
+
+#: gawkapi.c:937
+#, c-format
+msgid "api_flatten_array: could not convert value %d\n"
+msgstr ""
+
+#: gawkapi.c:1111
+msgid "cannot assign to defined constant"
+msgstr ""
+
#: getopt.c:604 getopt.c:633
#, fuzzy, c-format
msgid "%s: option '%s' is ambiguous; possibilities:"
@@ -1360,473 +2436,537 @@ msgstr "%s : l'option « -W %s » n'accepte pas d'argument\n"
msgid "%s: option '-W %s' requires an argument\n"
msgstr "%s : l'option « -W %s » nécessite un argument\n"
-#: io.c:280
+#: io.c:339
#, c-format
msgid "command line argument `%s' is a directory: skipped"
msgstr "L'argument « %s » de la ligne de commande est un répertoire : ignoré"
-#: io.c:283 io.c:385
+#: io.c:342 io.c:455
#, c-format
msgid "cannot open file `%s' for reading (%s)"
msgstr "impossible d'ouvrir le fichier « %s » en lecture (%s)"
-#: io.c:501
+#: io.c:582
#, c-format
msgid "close of fd %d (`%s') failed (%s)"
msgstr "échec de la fermeture du fd %d (« %s ») : %s"
-#: io.c:578
+#: io.c:658
msgid "redirection not allowed in sandbox mode"
msgstr "les redirections sont interdites en isolement (mode sandbox)"
-#: io.c:612
+#: io.c:692
#, c-format
msgid "expression in `%s' redirection only has numeric value"
msgstr "l'expression dans la redirection « %s » n'a qu'une valeur numérique"
-#: io.c:618
+#: io.c:698
#, c-format
msgid "expression for `%s' redirection has null string value"
msgstr "l'expression dans la redirection « %s » donne une chaîne nulle"
-#: io.c:623
+#: io.c:703
#, c-format
msgid "filename `%s' for `%s' redirection may be result of logical expression"
msgstr ""
"le fichier « %s » de la redirection « %s » pourrait être le résultat d'une "
"expression booléenne"
-#: io.c:666
+#: io.c:746
#, c-format
msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
msgstr "mélange non nécessaire de « > » et « >> » pour le fichier « %.*s »"
-#: io.c:719
+#: io.c:799
#, c-format
msgid "can't open pipe `%s' for output (%s)"
msgstr "impossible d'ouvrir le tube « %s » en sortie (%s)"
-#: io.c:729
+#: io.c:809
#, c-format
msgid "can't open pipe `%s' for input (%s)"
msgstr "impossible d'ouvrir le tube « %s » en entrée (%s)"
-#: io.c:752
+#: io.c:840
#, c-format
msgid "can't open two way pipe `%s' for input/output (%s)"
msgstr ""
"impossible d'ouvrir un tube bidirectionnel « %s » en entrées-sorties (%s)"
-#: io.c:834
+#: io.c:923
#, c-format
msgid "can't redirect from `%s' (%s)"
msgstr "impossible de rediriger depuis « %s » (%s)"
-#: io.c:837
+#: io.c:926
#, c-format
msgid "can't redirect to `%s' (%s)"
msgstr "impossible de rediriger vers « %s » (%s)"
-#: io.c:888
+#: io.c:977
msgid ""
"reached system limit for open files: starting to multiplex file descriptors"
msgstr ""
"limite système du nombre de fichiers ouverts atteinte : début du "
"multiplexage des descripteurs de fichiers"
-#: io.c:904
+#: io.c:993
#, c-format
msgid "close of `%s' failed (%s)."
msgstr "échec de la fermeture de « %s » (%s)"
-#: io.c:912
+#: io.c:1001
msgid "too many pipes or input files open"
msgstr "trop de fichiers d'entrées ou de tubes ouverts"
-#: io.c:934
+#: io.c:1023
msgid "close: second argument must be `to' or `from'"
msgstr "close : le second argument doit être « to » ou « from »"
-#: io.c:951
+#: io.c:1040
#, c-format
msgid "close: `%.*s' is not an open file, pipe or co-process"
msgstr ""
"close : « %.*s » n'est ni un fichier ouvert, ni un tube ou un co-processus"
-#: io.c:956
+#: io.c:1045
msgid "close of redirection that was never opened"
msgstr "fermeture d'une redirection qui n'a jamais été ouverte"
-#: io.c:1053
+#: io.c:1142
#, c-format
msgid "close: redirection `%s' not opened with `|&', second argument ignored"
msgstr ""
"close : la redirection « %s » n'a pas été ouverte avec « |& », second "
"argument ignoré"
-#: io.c:1069
+#: io.c:1159
#, c-format
msgid "failure status (%d) on pipe close of `%s' (%s)"
msgstr "résultat d'échec (%d) sur la fermeture du tube « %s » (%s)"
-#: io.c:1072
+#: io.c:1162
#, c-format
msgid "failure status (%d) on file close of `%s' (%s)"
msgstr "résultat d'échec (%d) sur la fermeture du fichier « %s » (%s)"
-#: io.c:1092
+#: io.c:1182
#, c-format
msgid "no explicit close of socket `%s' provided"
msgstr "aucune fermeture explicite du connecteur « %s » fournie"
-#: io.c:1095
+#: io.c:1185
#, c-format
msgid "no explicit close of co-process `%s' provided"
msgstr "aucune fermeture explicite du co-processus « %s » fournie"
-#: io.c:1098
+#: io.c:1188
#, c-format
msgid "no explicit close of pipe `%s' provided"
msgstr "aucune fermeture explicite du tube « %s » fournie"
-#: io.c:1101
+#: io.c:1191
#, c-format
msgid "no explicit close of file `%s' provided"
msgstr "aucune fermeture explicite du fichier « %s » fournie"
-#: io.c:1129 io.c:1184 main.c:797 main.c:834
+#: io.c:1219 io.c:1274 main.c:847 main.c:884
#, c-format
msgid "error writing standard output (%s)"
msgstr "erreur lors de l'écriture vers la sortie standard (%s)"
-#: io.c:1133 io.c:1189
+#: io.c:1223 io.c:1279
#, c-format
msgid "error writing standard error (%s)"
msgstr "erreur lors de l'écriture vers l'erreur standard (%s)"
-#: io.c:1141
+#: io.c:1231
#, c-format
msgid "pipe flush of `%s' failed (%s)."
msgstr "échec du vidage du tube « %s » (%s)."
-#: io.c:1144
+#: io.c:1234
#, c-format
msgid "co-process flush of pipe to `%s' failed (%s)."
msgstr "échec du vidage du tube vers « %s » par le co-processus (%s)."
-#: io.c:1147
+#: io.c:1237
#, c-format
msgid "file flush of `%s' failed (%s)."
msgstr "échec du vidage vers le fichier « %s » (%s)"
-#: io.c:1262
+#: io.c:1351
#, c-format
msgid "local port %s invalid in `/inet'"
msgstr "le port local %s n'est pas valide dans « /inet »"
-#: io.c:1279
+#: io.c:1369
#, c-format
msgid "remote host and port information (%s, %s) invalid"
msgstr ""
"les informations sur l'hôte et le port distants (%s, %s) ne sont pas valides"
-#: io.c:1431
+#: io.c:1521
#, c-format
msgid "no (known) protocol supplied in special filename `%s'"
msgstr ""
"aucun protocole (connu) n'a été fourni dans le nom de fichier spécial « %s »"
-#: io.c:1445
+#: io.c:1535
#, c-format
msgid "special file name `%s' is incomplete"
msgstr "nom de fichier spécial « %s » incomplet"
-#: io.c:1462
+#: io.c:1552
msgid "must supply a remote hostname to `/inet'"
msgstr "un nom d'hôte distant doit être fourni à « /inet »"
-#: io.c:1480
+#: io.c:1570
msgid "must supply a remote port to `/inet'"
msgstr "un port distant doit être fourni à « /inet »"
-#: io.c:1526
+#: io.c:1616
msgid "TCP/IP communications are not supported"
msgstr "les communications TCP/IP ne sont pas disponibles"
-#: io.c:1693
+#: io.c:1785
#, c-format
msgid "could not open `%s', mode `%s'"
msgstr "impossible d'ouvrir « %s », mode « %s »"
-#: io.c:1747
+#: io.c:1835
#, c-format
msgid "close of master pty failed (%s)"
msgstr "échec de la fermeture du pty maître (%s)"
-#: io.c:1749 io.c:1917 io.c:2074
+#: io.c:1837 io.c:2012 io.c:2181
#, c-format
msgid "close of stdout in child failed (%s)"
msgstr "échec de la fermeture de stdout du processus fils (%s)"
-#: io.c:1752
+#: io.c:1840
#, c-format
msgid "moving slave pty to stdout in child failed (dup: %s)"
msgstr ""
"échec du déplacement du pty esclave vers le stdout du processus fils (dup : "
"%s)"
-#: io.c:1754 io.c:1922
+#: io.c:1842 io.c:2017
#, c-format
msgid "close of stdin in child failed (%s)"
msgstr "échec de fermeture du stdin du processus fils (%s)"
-#: io.c:1757
+#: io.c:1845
#, c-format
msgid "moving slave pty to stdin in child failed (dup: %s)"
msgstr ""
"échec du déplacement du pty esclave vers le stdin du processus fils (dup : "
"%s)"
-#: io.c:1759 io.c:1780
+#: io.c:1847 io.c:1868
#, c-format
msgid "close of slave pty failed (%s)"
msgstr "échec de la fermeture du pty esclave (%s)"
-#: io.c:1858 io.c:1920 io.c:2052 io.c:2077
+#: io.c:1953 io.c:2015 io.c:2158 io.c:2184
#, c-format
msgid "moving pipe to stdout in child failed (dup: %s)"
msgstr "échec du déplacement du tube vers stdout du processus fils (dup : %s)"
-#: io.c:1865 io.c:1925
+#: io.c:1960 io.c:2020
#, c-format
msgid "moving pipe to stdin in child failed (dup: %s)"
msgstr "échec de déplacement du tube vers stdin du processus fils (dup : %s)"
-#: io.c:1885 io.c:2067
+#: io.c:1980 io.c:2174
msgid "restoring stdout in parent process failed\n"
msgstr "échec de la restauration du stdout dans le processus parent\n"
-#: io.c:1893
+#: io.c:1988
msgid "restoring stdin in parent process failed\n"
msgstr "échec de la restauration du stdin dans le processus parent\n"
-#: io.c:1928 io.c:2079 io.c:2093
+#: io.c:2023 io.c:2186 io.c:2200
#, c-format
msgid "close of pipe failed (%s)"
msgstr "échec de la fermeture du tube (%s)"
-#: io.c:1973
+#: io.c:2076
msgid "`|&' not supported"
msgstr "« |& » non disponible"
-#: io.c:2039
+#: io.c:2143
#, c-format
msgid "cannot open pipe `%s' (%s)"
msgstr "impossible d'ouvrir le tube « %s » (%s)"
-#: io.c:2087
+#: io.c:2194
#, c-format
msgid "cannot create child process for `%s' (fork: %s)"
msgstr "impossible de créer le processus fils pour « %s » (fork : %s)"
-#: io.c:2520
+#: io.c:2652
+msgid "register_input_parser: received NULL pointer"
+msgstr ""
+
+#: io.c:2680
+#, c-format
+msgid "input parser `%s' conflicts with previously installed input parser `%s'"
+msgstr ""
+
+#: io.c:2687
+#, c-format
+msgid "input parser `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2707
+msgid "register_output_wrapper: received NULL pointer"
+msgstr ""
+
+#: io.c:2735
+#, c-format
+msgid ""
+"output wrapper `%s' conflicts with previously installed output wrapper `%s'"
+msgstr ""
+
+#: io.c:2742
+#, c-format
+msgid "output wrapper `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2763
+msgid "register_output_processor: received NULL pointer"
+msgstr ""
+
+#: io.c:2792
+#, c-format
+msgid ""
+"two-way processor `%s' conflicts with previously installed two-way processor "
+"`%s'"
+msgstr ""
+
+#: io.c:2801
+#, c-format
+msgid "two way processor `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2908
#, c-format
msgid "data file `%s' is empty"
msgstr "le fichier de données « %s » est vide"
-#: io.c:2561 io.c:2569
+#: io.c:2950 io.c:2958
msgid "could not allocate more input memory"
msgstr "impossible d'allouer plus de mémoire d'entrée"
-#: io.c:3127
+#: io.c:3524
msgid "multicharacter value of `RS' is a gawk extension"
msgstr ""
"l'utilisation d'un « RS » de plusieurs caractères est une extension gawk"
-#: io.c:3232
+#: io.c:3613
msgid "IPv6 communication is not supported"
msgstr "les communications IPv6 ne sont pas disponibles"
-#: main.c:366
+#: main.c:362
msgid "`-m[fr]' option irrelevant in gawk"
msgstr "l'option « -m[fr] » n'est pas pertinente en gawk"
-#: main.c:368
+#: main.c:364
msgid "-m option usage: `-m[fr] nnn'"
msgstr "utilisation de l'option « -m » : « -m[fr] nnn »"
-#: main.c:391
+#: main.c:393
msgid "empty argument to `-e/--source' ignored"
msgstr "argument vide de l'option « -e / --source » ignoré"
-#: main.c:462
+#: main.c:483
#, c-format
msgid "%s: option `-W %s' unrecognized, ignored\n"
msgstr "%s : option « -W %s » non reconnue, ignorée\n"
-#: main.c:515
+#: main.c:529
#, c-format
msgid "%s: option requires an argument -- %c\n"
msgstr "%s : l'option requiert un argument -- %c\n"
-#: main.c:536
+#: main.c:550
msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
msgstr ""
"variable d'environnement « POSIXLY__CORRECT » définie : activation de « --"
"posix »"
-#: main.c:542
+#: main.c:556
msgid "`--posix' overrides `--traditional'"
msgstr "« --posix » prend le pas sur « --traditional »"
-#: main.c:553
+#: main.c:567
msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
msgstr ""
"« --posix » et « --traditional » prennent le pas sur « --non-decimal-data »"
-#: main.c:557
+#: main.c:571
#, c-format
msgid "running %s setuid root may be a security problem"
msgstr ""
"l'exécution de %s en mode setuid root peut être un problème de sécurité"
-#: main.c:562
+#: main.c:576
#, fuzzy
msgid "`--posix' overrides `--characters-as-bytes'"
msgstr "« --posix » prend le pas sur « --binary »"
-#: main.c:616
+#: main.c:635
#, c-format
msgid "can't set binary mode on stdin (%s)"
msgstr "impossible d'activer le mode binaire sur stdin (%s)"
-#: main.c:619
+#: main.c:638
#, c-format
msgid "can't set binary mode on stdout (%s)"
msgstr "impossible d'activer le mode binaire sur stdout (%s)"
-#: main.c:621
+#: main.c:640
#, c-format
msgid "can't set binary mode on stderr (%s)"
msgstr "impossible d'activer le mode binaire sur stderr (%s)"
-#: main.c:660
+#: main.c:698
msgid "no program text at all!"
msgstr "aucun programme !"
-#: main.c:737
+#: main.c:784
#, c-format
msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"
msgstr ""
"Utilisation : %s [options GNU ou POSIX] -f fichier_prog [--] fichier ...\n"
-#: main.c:739
+#: main.c:786
#, c-format
msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"
msgstr ""
"Utilisation : %s [options GNU ou POSIX] [--] %cprogramme%c fichier ...\n"
-#: main.c:744
+#: main.c:791
msgid "POSIX options:\t\tGNU long options: (standard)\n"
msgstr "Options POSIX :\t\tOptions longues GNU : (standard)\n"
-#: main.c:745
+#: main.c:792
msgid "\t-f progfile\t\t--file=progfile\n"
msgstr "\t-f fichier_prog\t\t--file=fichier_prog\n"
-#: main.c:746
+#: main.c:793
msgid "\t-F fs\t\t\t--field-separator=fs\n"
msgstr "\t-F fs\t\t\t--field-separator=fs\n"
-#: main.c:747
+#: main.c:794
msgid "\t-v var=val\t\t--assign=var=val\n"
msgstr "\t-v var=valeur\t\t--assign=var=valeur\n"
-#: main.c:748
+#: main.c:795
msgid "Short options:\t\tGNU long options: (extensions)\n"
msgstr "Options POSIX :\t\tOptions longues GNU : (extensions)\n"
-#: main.c:749
+#: main.c:796
msgid "\t-b\t\t\t--characters-as-bytes\n"
msgstr "\t-b\t\t\t--characters-as-bytes\n"
-#: main.c:750
+#: main.c:797
msgid "\t-c\t\t\t--traditional\n"
msgstr "\t-c\t\t\t--traditional\n"
-#: main.c:751
+#: main.c:798
msgid "\t-C\t\t\t--copyright\n"
msgstr "\t-C\t\t\t--copyright\n"
-#: main.c:752
+#: main.c:799
msgid "\t-d[file]\t\t--dump-variables[=file]\n"
msgstr "\t-d[fichier]\t\t--dump-variables[=fichier]\n"
-#: main.c:753
+#: main.c:800
+#, fuzzy
+msgid "\t-D[file]\t\t--debug[=file]\n"
+msgstr "\t-p[fichier]\t\t--profile[=fichier]\n"
+
+#: main.c:801
msgid "\t-e 'program-text'\t--source='program-text'\n"
msgstr "\t-e 'programme'\t\t--source='programme'\n"
-#: main.c:754
+#: main.c:802
msgid "\t-E file\t\t\t--exec=file\n"
msgstr "\t-E fichier\t\t--exec=fichier\n"
-#: main.c:755
+#: main.c:803
msgid "\t-g\t\t\t--gen-pot\n"
msgstr "\t-g\t\t\t--gen-pot\n"
-#: main.c:756
+#: main.c:804
msgid "\t-h\t\t\t--help\n"
msgstr "\t-h\t\t\t--help\n"
-#: main.c:757
+#: main.c:805
+msgid "\t-i includefile\t\t--include=includefile\n"
+msgstr ""
+
+#: main.c:806
+msgid "\t-l library\t\t--load=library\n"
+msgstr ""
+
+#: main.c:807
msgid "\t-L [fatal]\t\t--lint[=fatal]\n"
msgstr "\t-L [fatal]\t\t--lint[=fatal]\n"
-#: main.c:758
+#: main.c:808
msgid "\t-n\t\t\t--non-decimal-data\n"
msgstr "\t-n\t\t\t--non-decimal-data\n"
-#: main.c:759
+#: main.c:809
+#, fuzzy
+msgid "\t-M\t\t\t--bignum\n"
+msgstr "\t-g\t\t\t--gen-pot\n"
+
+#: main.c:810
msgid "\t-N\t\t\t--use-lc-numeric\n"
msgstr "\t-N\t\t\t--use-lc-numeric\n"
-#: main.c:760
+#: main.c:811
+#, fuzzy
+msgid "\t-o[file]\t\t--pretty-print[=file]\n"
+msgstr "\t-p[fichier]\t\t--profile[=fichier]\n"
+
+#: main.c:812
msgid "\t-O\t\t\t--optimize\n"
msgstr "\t-O\t\t\t--optimize\n"
-#: main.c:761
+#: main.c:813
msgid "\t-p[file]\t\t--profile[=file]\n"
msgstr "\t-p[fichier]\t\t--profile[=fichier]\n"
-#: main.c:762
+#: main.c:814
msgid "\t-P\t\t\t--posix\n"
msgstr "\t-P\t\t\t--posix\n"
-#: main.c:763
+#: main.c:815
msgid "\t-r\t\t\t--re-interval\n"
msgstr "\t-r\t\t\t--re-interval\n"
-#: main.c:765
-msgid "\t-R file\t\t\t--command=file\n"
-msgstr "\t-R fichier\t\t\t--command=fichier\n"
-
-#: main.c:766
+#: main.c:816
msgid "\t-S\t\t\t--sandbox\n"
msgstr "\t-S\t\t\t--sandbox\n"
-#: main.c:767
+#: main.c:817
msgid "\t-t\t\t\t--lint-old\n"
msgstr "\t-t\t\t\t--lint-old\n"
-#: main.c:768
+#: main.c:818
msgid "\t-V\t\t\t--version\n"
msgstr "\t-V\t\t\t--version\n"
-#: main.c:770
+#: main.c:820
msgid "\t-W nostalgia\t\t--nostalgia\n"
msgstr "\t-W nostalgia\t\t--nostalgia\n"
-#: main.c:773
+#: main.c:823
msgid "\t-Y\t\t--parsedebug\n"
msgstr "\t-Y\t\t--parsedebug\n"
@@ -1835,7 +2975,7 @@ msgstr "\t-Y\t\t--parsedebug\n"
#. for this application. Please add _another line_ with the
#. address for translation bugs.
#. no-wrap
-#: main.c:782
+#: main.c:832
msgid ""
"\n"
"To report bugs, see node `Bugs' in `gawk.info', which is\n"
@@ -1850,7 +2990,7 @@ msgstr ""
"<traduc CHEZ traduc POINT org>.\n"
"\n"
-#: main.c:786
+#: main.c:836
msgid ""
"gawk is a pattern scanning and processing language.\n"
"By default it reads standard input and writes standard output.\n"
@@ -1860,7 +3000,7 @@ msgstr ""
"Par défaut, il lit l'entrée standard et écrit sur la sortie standard.\n"
"\n"
-#: main.c:790
+#: main.c:840
msgid ""
"Examples:\n"
"\tgawk '{ sum += $1 }; END { print sum }' file\n"
@@ -1870,7 +3010,7 @@ msgstr ""
"\tgawk '{ somme += $1 }; END { print somme }' fichier\n"
"\tgawk -F: '{ print $1 }' /etc/passwd\n"
-#: main.c:810
+#: main.c:860
#, c-format
msgid ""
"Copyright (C) 1989, 1991-%d Free Software Foundation.\n"
@@ -1890,7 +3030,7 @@ msgstr ""
"version ultérieure de votre choix.\n"
"\n"
-#: main.c:818
+#: main.c:868
msgid ""
"This program is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
@@ -1905,7 +3045,7 @@ msgstr ""
"General Public License).\n"
"\n"
-#: main.c:824
+#: main.c:874
msgid ""
"You should have received a copy of the GNU General Public License\n"
"along with this program. If not, see http://www.gnu.org/licenses/.\n"
@@ -1914,16 +3054,16 @@ msgstr ""
"(GNU General Public License) avec ce programme. Sinon, consultez\n"
"http://www.gnu.org/licenses/.\n"
-#: main.c:859
+#: main.c:909
msgid "-Ft does not set FS to tab in POSIX awk"
msgstr "-Ft ne définit pas le FS comme étant une tabulation en awk POSIX"
-#: main.c:1093
+#: main.c:1169
#, c-format
msgid "unknown value for field spec: %d\n"
msgstr "valeur inconnue pour la définition de champ : %d\n"
-#: main.c:1174
+#: main.c:1267
#, c-format
msgid ""
"%s: `%s' argument to `-v' not in `var=value' form\n"
@@ -1932,79 +3072,149 @@ msgstr ""
"%s : « %s » l'argument de « -v » ne respecte pas la forme « var=valeur »\n"
"\n"
-#: main.c:1200
+#: main.c:1293
#, c-format
msgid "`%s' is not a legal variable name"
msgstr "« %s » n'est pas un nom de variable valide"
-#: main.c:1203
+#: main.c:1296
#, c-format
msgid "`%s' is not a variable name, looking for file `%s=%s'"
msgstr "« %s » n'est pas un nom de variable, recherche du fichier « %s=%s »"
-#: main.c:1207
+#: main.c:1300
#, c-format
msgid "cannot use gawk builtin `%s' as variable name"
msgstr "impossible d'utiliser le mot clef gawk « %s » comme variable"
-#: main.c:1212
+#: main.c:1305
#, c-format
msgid "cannot use function `%s' as variable name"
msgstr "impossible d'utiliser la fonction « %s » comme variable"
-#: main.c:1265
+#: main.c:1358
msgid "floating point exception"
msgstr "exception du traitement en virgule flottante"
-#: main.c:1272
+#: main.c:1365
msgid "fatal error: internal error"
msgstr "fatal : erreur interne"
-#: main.c:1287
+#: main.c:1380
msgid "fatal error: internal error: segfault"
msgstr "fatal : erreur interne : erreur de segmentation"
-#: main.c:1299
+#: main.c:1392
msgid "fatal error: internal error: stack overflow"
msgstr "fatal : erreur interne : débordement de la pile"
-#: main.c:1349
+#: main.c:1448
#, c-format
msgid "no pre-opened fd %d"
msgstr "aucun descripteur fd %d pré-ouvert"
-#: main.c:1356
+#: main.c:1455
#, c-format
msgid "could not pre-open /dev/null for fd %d"
msgstr "impossible de pré-ouvrir /dev/null pour le descripteud fd %d"
-#: msg.c:63
+#: mpfr.c:563
+#, fuzzy, c-format
+msgid "PREC value `%.*s' is invalid"
+msgstr "la valeur « %s » de BINMODE n'est pas valide, 3 utilisé à la place"
+
+#: mpfr.c:621
+#, fuzzy, c-format
+msgid "RNDMODE value `%.*s' is invalid"
+msgstr "la valeur « %s » de BINMODE n'est pas valide, 3 utilisé à la place"
+
+#: mpfr.c:711
+#, fuzzy, c-format
+msgid "%s: received non-numeric argument"
+msgstr "cos : l'argument n'est pas numérique"
+
+#: mpfr.c:813
+#, fuzzy
+msgid "compl(%Rg): negative value will give strange results"
+msgstr "compl(%lf) : les valeurs négatives donneront des résultats inattendus"
+
+#: mpfr.c:817
+#, fuzzy
+msgid "comp(%Rg): fractional value will be truncated"
+msgstr "compl(%lf) : les valeurs non entières seront tronquées"
+
+#: mpfr.c:829
+#, fuzzy, c-format
+msgid "cmpl(%Zd): negative values will give strange results"
+msgstr "compl(%lf) : les valeurs négatives donneront des résultats inattendus"
+
+#: mpfr.c:856
+#, fuzzy, c-format
+msgid "%s: received non-numeric first argument"
+msgstr "or : le premier argument n'est pas numérique"
+
+#: mpfr.c:858
+#, fuzzy, c-format
+msgid "%s: received non-numeric second argument"
+msgstr "or : le second argument reçu n'est pas numérique"
+
+#: mpfr.c:877
+#, fuzzy
+msgid "%s(%Rg, ..): negative values will give strange results"
+msgstr ""
+"or(%lf, %lf) : les valeurs négatives donneront des résultats inattendus"
+
+#: mpfr.c:882
+#, fuzzy
+msgid "%s(%Rg, ..): fractional values will be truncated"
+msgstr "or(%lf, %lf) : les valeurs non entières seront tronquées"
+
+#: mpfr.c:895
+#, fuzzy, c-format
+msgid "%s(%Zd, ..): negative values will give strange results"
+msgstr ""
+"or(%lf, %lf) : les valeurs négatives donneront des résultats inattendus"
+
+#: mpfr.c:914
+#, fuzzy
+msgid "%s(.., %Rg): negative values will give strange results"
+msgstr ""
+"or(%lf, %lf) : les valeurs négatives donneront des résultats inattendus"
+
+#: mpfr.c:919
+#, fuzzy
+msgid "%s(.., %Rg): fractional values will be truncated"
+msgstr "or(%lf, %lf) : les valeurs non entières seront tronquées"
+
+#: mpfr.c:932
+#, fuzzy, c-format
+msgid "%s(.., %Zd): negative values will give strange results"
+msgstr ""
+"or(%lf, %lf) : les valeurs négatives donneront des résultats inattendus"
+
+#: msg.c:61
#, c-format
msgid "cmd. line:"
msgstr "ligne de commande:"
-#: msg.c:107
-msgid "error: "
-msgstr "erreur : "
-
-#: node.c:406
+#: node.c:436
msgid "backslash at end of string"
msgstr "barre oblique inverse à la fin de la chaîne"
-#: node.c:517
+#: node.c:520
#, c-format
msgid "old awk does not support the `\\%c' escape sequence"
msgstr "l'ancien awk ne dispose pas de la séquence d'échappement « \\%c »"
-#: node.c:568
+#: node.c:571
msgid "POSIX does not allow `\\x' escapes"
msgstr "POSIX n'autorise pas les séquences d'échappement « \\x »"
-#: node.c:574
+#: node.c:577
msgid "no hex digits in `\\x' escape sequence"
msgstr "aucun chiffre hexadécimal dans la séquence d'échappement « \\x » "
-#: node.c:596
+#: node.c:599
#, c-format
msgid ""
"hex escape \\x%.*s of %d characters probably not interpreted the way you "
@@ -2013,12 +3223,12 @@ msgstr ""
"la séquence d'échappement hexa. \\x%.*s de %d caractères ne sera "
"probablement pas interprétée comme vous l'imaginez"
-#: node.c:611
+#: node.c:614
#, c-format
msgid "escape sequence `\\%c' treated as plain `%c'"
msgstr "séquence d'échappement « \\%c » traitée comme un simple « %c »"
-#: node.c:750
+#: node.c:759
msgid ""
"Invalid multibyte data detected. There may be a mismatch between your data "
"and your locale."
@@ -2026,28 +3236,28 @@ msgstr ""
"Données multioctets non valables détectées. Possible incohérence entre "
"données et paramètres régionaux (locale)."
-#: posix/gawkmisc.c:176
+#: posix/gawkmisc.c:177
#, c-format
msgid "%s %s `%s': could not get fd flags: (fcntl F_GETFD: %s)"
msgstr ""
"%s %s « %s » : impossible d'obtenir les drapeaux du fd : (fcntl F_GETFD: %s)"
-#: posix/gawkmisc.c:188
+#: posix/gawkmisc.c:189
#, c-format
msgid "%s %s `%s': could not set close-on-exec: (fcntl F_SETFD: %s)"
msgstr ""
"%s %s « %s »: impossible de positionner close-on-exec: (fcntl F_SETFD: %s)"
-#: profile.c:83
+#: profile.c:70
#, c-format
msgid "could not open `%s' for writing: %s"
msgstr "impossible d'ouvrir « %s » en écriture : %s"
-#: profile.c:85
+#: profile.c:72
msgid "sending profile to standard error"
msgstr "envoi du profil vers la sortie d'erreur standard"
-#: profile.c:203
+#: profile.c:188
#, c-format
msgid ""
"\t# %s block(s)\n"
@@ -2056,7 +3266,7 @@ msgstr ""
"\t# Bloc(s) %s\n"
"\n"
-#: profile.c:208
+#: profile.c:193
#, c-format
msgid ""
"\t# Rule(s)\n"
@@ -2065,17 +3275,22 @@ msgstr ""
"\t# Règle(s)\n"
"\n"
-#: profile.c:279
+#: profile.c:267
#, c-format
msgid "internal error: %s with null vname"
msgstr "erreur interne : %s avec un vname nul"
-#: profile.c:952
+#: profile.c:529
+#, fuzzy
+msgid "internal error: builtin with null fname"
+msgstr "erreur interne : %s avec un vname nul"
+
+#: profile.c:944
#, c-format
msgid "\t# gawk profile, created %s\n"
msgstr "\t# profile gawk, créé %s\n"
-#: profile.c:1331
+#: profile.c:1329
#, c-format
msgid ""
"\n"
@@ -2084,17 +3299,17 @@ msgstr ""
"\n"
"\t# Fonctions, par ordre alphabétique\n"
-#: profile.c:1370
+#: profile.c:1367
#, c-format
msgid "redir2str: unknown redirection type %d"
msgstr "redir2str : type de redirection %d inconnu"
-#: re.c:573
+#: re.c:568
#, c-format
msgid "range of the form `[%c-%c]' is locale dependent"
msgstr "les plages « [%c-%c] » sont dépendantes des paramètres régionaux"
-#: re.c:600
+#: re.c:595
#, c-format
msgid "regexp component `%.*s' should probably be `[%.*s]'"
msgstr ""
@@ -2141,10 +3356,6 @@ msgstr "( ou \\( sans correspondance"
msgid "Unmatched \\{"
msgstr "\\{ sans correspondance"
-#: regcomp.c:161
-msgid "Invalid content of \\{\\}"
-msgstr "Contenu de \\{\\} non valide"
-
#: regcomp.c:164
msgid "Invalid range end"
msgstr "Borne finale non valide"
@@ -2161,10 +3372,6 @@ msgstr "Expression rationnelle précédente non valide"
msgid "Premature end of regular expression"
msgstr "Fin prématurée de l'expression rationnelle"
-#: regcomp.c:176
-msgid "Regular expression too big"
-msgstr "Expression rationnelle trop grande"
-
#: regcomp.c:179
msgid "Unmatched ) or \\)"
msgstr ") ou \\) sans correspondance"
@@ -2173,12 +3380,98 @@ msgstr ") ou \\) sans correspondance"
msgid "No previous regular expression"
msgstr "Aucune expression rationnelle précédente"
+#: symbol.c:722
+msgid "can not pop main context"
+msgstr ""
+
#~ msgid "`nextfile' is a gawk extension"
#~ msgstr "« nextfile » est une extension gawk"
#~ msgid "`delete array' is a gawk extension"
#~ msgstr "« delete array » est une extension gawk"
+#~ msgid "and: received non-numeric first argument"
+#~ msgstr "and : le premier argument n'est pas numérique"
+
+#~ msgid "and: received non-numeric second argument"
+#~ msgstr "and : le second argument reçu n'est pas numérique"
+
+#~ msgid "and(%lf, %lf): fractional values will be truncated"
+#~ msgstr "and(%lf, %lf): les valeurs non entières seront tronquées"
+
+#~ msgid "xor: received non-numeric first argument"
+#~ msgstr "xor : le premier argument n'est pas numérique"
+
+#~ msgid "xor: received non-numeric second argument"
+#~ msgstr "xor : le second argument reçu n'est pas numérique"
+
+#~ msgid "xor(%lf, %lf): fractional values will be truncated"
+#~ msgstr "xor(%lf, %lf) : les valeurs non entières seront tronquées"
+
+#~ msgid "`extension' is a gawk extension"
+#~ msgstr "« extension » est une extension gawk"
+
+#~ msgid "Operation Not Supported"
+#~ msgstr "Opération non disponible"
+
+#~ msgid "attempt to use function `%s' as an array"
+#~ msgstr "tentative d'utiliser la fonction « %s » comme tableau"
+
+#~ msgid "reference to uninitialized element `%s[\"%.*s\"]'"
+#~ msgstr "référence à un élément non initialisé « %s[\"%.*s\"] »"
+
+#~ msgid "subscript of array `%s' is null string"
+#~ msgstr "l'indice du tableau « %s » est une chaîne vide"
+
+#~ msgid "%s: empty (null)\n"
+#~ msgstr "%s : vide (non défini)\n"
+
+#~ msgid "%s: empty (zero)\n"
+#~ msgstr "%s : vide (vide)\n"
+
+#~ msgid "%s: table_size = %d, array_size = %d\n"
+#~ msgstr "%s : table_size = %d, array_size = %d\n"
+
+#~ msgid "%s: array_ref to %s\n"
+#~ msgstr "%s : array_ref à %s\n"
+
+#~ msgid "use of non-array as array"
+#~ msgstr "utilisation d'un non tableau comme tableau"
+
+#~ msgid "can't use function name `%s' as variable or array"
+#~ msgstr "impossible d'utiliser la fonction « %s » comme variable ou tableau"
+
+#~ msgid "assignment used in conditional context"
+#~ msgstr "affectation utilisée dans un contexte conditionnel"
+
+#~ msgid "statement has no effect"
+#~ msgstr "la déclaration est sans effet"
+
+#~ msgid ""
+#~ "for loop: array `%s' changed size from %ld to %ld during loop execution"
+#~ msgstr "boucle for : la taille du tableau « %s » est passée de %ld à %ld"
+
+#~ msgid "function called indirectly through `%s' does not exist"
+#~ msgstr "la fonction indirectement appelée via « %s » n'existe pas"
+
+#~ msgid "function `%s' not defined"
+#~ msgstr "fonction « %s » non définie"
+
+#~ msgid "non-redirected `getline' invalid inside `%s' rule"
+#~ msgstr "un « getline » non redirigé n'est pas valable dans une règle « %s »"
+
+#~ msgid "`nextfile' cannot be called from a `%s' rule"
+#~ msgstr "« nextfile » ne peut pas être appelé depuis une règle « %s »"
+
+#~ msgid "`next' cannot be called from a `%s' rule"
+#~ msgstr "« next » ne peut pas être appelé depuis une règle « %s »"
+
+#~ msgid "Sorry, don't know how to interpret `%s'"
+#~ msgstr "Désolé, je ne sais pas comment interpréter « %s »"
+
+#~ msgid "\t-R file\t\t\t--command=file\n"
+#~ msgstr "\t-R fichier\t\t\t--command=fichier\n"
+
#~ msgid "could not find groups: %s"
#~ msgstr "impossible de trouver les groupes : %s"
diff --git a/po/ga.gmo b/po/ga.gmo
deleted file mode 100644
index 21141c51..00000000
--- a/po/ga.gmo
+++ /dev/null
Binary files differ
diff --git a/po/gawk.pot b/po/gawk.pot
index db2473ec..0b4a55a8 100644
--- a/po/gawk.pot
+++ b/po/gawk.pot
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: gawk 4.0.1a\n"
+"Project-Id-Version: gawk 4.0.70\n"
"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
-"POT-Creation-Date: 2012-10-13 20:24+0200\n"
+"POT-Creation-Date: 2012-10-13 21:21+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,936 +17,1769 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
-#: array.c:140
+#: array.c:266
#, c-format
msgid "from %s"
msgstr ""
-#: array.c:248
+#: array.c:366
msgid "attempt to use a scalar value as array"
msgstr ""
-#: array.c:251
-#, c-format
-msgid "attempt to use function `%s' as an array"
-msgstr ""
-
-#: array.c:254
+#: array.c:368
#, c-format
msgid "attempt to use scalar parameter `%s' as an array"
msgstr ""
-#: array.c:257
+#: array.c:371
#, c-format
msgid "attempt to use scalar `%s' as an array"
msgstr ""
-#: array.c:302 array.c:707 builtin.c:84 builtin.c:1385 builtin.c:1427
-#: builtin.c:1440 builtin.c:1859 builtin.c:1871 eval.c:1135 eval.c:1139
-#: eval.c:1495 eval.c:1812
+#: array.c:418 array.c:584 builtin.c:85 builtin.c:1566 builtin.c:1608
+#: builtin.c:1621 builtin.c:2047 builtin.c:2059 eval.c:1121 eval.c:1125
+#: eval.c:1520
#, c-format
msgid "attempt to use array `%s' in a scalar context"
msgstr ""
-#: array.c:513
-#, c-format
-msgid "reference to uninitialized element `%s[\"%.*s\"]'"
-msgstr ""
-
-#: array.c:519
-#, c-format
-msgid "subscript of array `%s' is null string"
-msgstr ""
-
-#: array.c:723
+#: array.c:591
#, c-format
msgid "delete: index `%s' not in array `%s'"
msgstr ""
-#: array.c:734 eval.c:1865
+#: array.c:605
#, c-format
msgid "attempt to use scalar `%s[\"%.*s\"]' as an array"
msgstr ""
-#: array.c:910
-#, c-format
-msgid "%s: empty (null)\n"
-msgstr ""
-
-#: array.c:915
-#, c-format
-msgid "%s: empty (zero)\n"
+#: array.c:784
+msgid "adump: first argument not an array"
msgstr ""
-#: array.c:919
-#, c-format
-msgid "%s: table_size = %d, array_size = %d\n"
-msgstr ""
-
-#: array.c:954
-#, c-format
-msgid "%s: is parameter\n"
-msgstr ""
-
-#: array.c:958
-#, c-format
-msgid "%s: array_ref to %s\n"
-msgstr ""
-
-#: array.c:963
-msgid "adump: argument not an array"
-msgstr ""
-
-#: array.c:1086
+#: array.c:823
msgid "asort: second argument not an array"
msgstr ""
-#: array.c:1087
+#: array.c:824
msgid "asorti: second argument not an array"
msgstr ""
-#: array.c:1094
+#: array.c:831
msgid "asort: first argument not an array"
msgstr ""
-#: array.c:1095
+#: array.c:832
msgid "asorti: first argument not an array"
msgstr ""
-#: array.c:1102
+#: array.c:839
msgid "asort: cannot use a subarray of first arg for second arg"
msgstr ""
-#: array.c:1103
+#: array.c:840
msgid "asorti: cannot use a subarray of first arg for second arg"
msgstr ""
-#: array.c:1108
+#: array.c:845
msgid "asort: cannot use a subarray of second arg for first arg"
msgstr ""
-#: array.c:1109
+#: array.c:846
msgid "asorti: cannot use a subarray of second arg for first arg"
msgstr ""
-#: array.c:1655
+#: array.c:1314
#, c-format
msgid "`%s' is invalid as a function name"
msgstr ""
-#: array.c:1659
+#: array.c:1318
#, c-format
msgid "sort comparison function `%s' is not defined"
msgstr ""
-#: awkgram.y:249
+#: awkgram.y:223
#, c-format
msgid "%s blocks must have an action part"
msgstr ""
-#: awkgram.y:252
+#: awkgram.y:226
msgid "each rule must have a pattern or an action part"
msgstr ""
-#: awkgram.y:323 awkgram.y:334
+#: awkgram.y:315 awkgram.y:326
msgid "old awk does not support multiple `BEGIN' or `END' rules"
msgstr ""
-#: awkgram.y:371
+#: awkgram.y:363
#, c-format
msgid "`%s' is a built-in function, it cannot be redefined"
msgstr ""
-#: awkgram.y:432
+#: awkgram.y:409
msgid "regexp constant `//' looks like a C++ comment, but is not"
msgstr ""
-#: awkgram.y:436
+#: awkgram.y:413
#, c-format
msgid "regexp constant `/%s/' looks like a C comment, but is not"
msgstr ""
-#: awkgram.y:528
+#: awkgram.y:505
#, c-format
msgid "duplicate case values in switch body: %s"
msgstr ""
-#: awkgram.y:549
+#: awkgram.y:526
msgid "duplicate `default' detected in switch body"
msgstr ""
-#: awkgram.y:809
+#: awkgram.y:786
msgid "`break' is not allowed outside a loop or switch"
msgstr ""
-#: awkgram.y:818
+#: awkgram.y:795
msgid "`continue' is not allowed outside a loop"
msgstr ""
-#: awkgram.y:828
+#: awkgram.y:805
#, c-format
msgid "`next' used in %s action"
msgstr ""
-#: awkgram.y:837
+#: awkgram.y:814
#, c-format
msgid "`nextfile' used in %s action"
msgstr ""
-#: awkgram.y:861
+#: awkgram.y:838
msgid "`return' used outside function context"
msgstr ""
-#: awkgram.y:921
+#: awkgram.y:912
msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'"
msgstr ""
-#: awkgram.y:1016 awkgram.y:1020
+#: awkgram.y:978 awkgram.y:1027
+msgid "`delete' is not allowed with SYMTAB"
+msgstr ""
+
+#: awkgram.y:980 awkgram.y:1029
+msgid "`delete' is not allowed with FUNCTAB"
+msgstr ""
+
+#: awkgram.y:1014 awkgram.y:1018
msgid "`delete(array)' is a non-portable tawk extension"
msgstr ""
-#: awkgram.y:1132
+#: awkgram.y:1139
msgid "multistage two-way pipelines don't work"
msgstr ""
-#: awkgram.y:1235
+#: awkgram.y:1242
msgid "regular expression on right of assignment"
msgstr ""
-#: awkgram.y:1246
+#: awkgram.y:1253
msgid "regular expression on left of `~' or `!~' operator"
msgstr ""
-#: awkgram.y:1262 awkgram.y:1416
+#: awkgram.y:1269 awkgram.y:1420
msgid "old awk does not support the keyword `in' except after `for'"
msgstr ""
-#: awkgram.y:1272
+#: awkgram.y:1279
msgid "regular expression on right of comparison"
msgstr ""
-#: awkgram.y:1391
+#: awkgram.y:1395
#, c-format
msgid "`getline var' invalid inside `%s' rule"
msgstr ""
-#: awkgram.y:1394 eval.c:2504
+#: awkgram.y:1398
#, c-format
msgid "`getline' invalid inside `%s' rule"
msgstr ""
-#: awkgram.y:1399
+#: awkgram.y:1403
msgid "non-redirected `getline' undefined inside END action"
msgstr ""
-#: awkgram.y:1418
+#: awkgram.y:1422
msgid "old awk does not support multidimensional arrays"
msgstr ""
-#: awkgram.y:1514
+#: awkgram.y:1519
msgid "call of `length' without parentheses is not portable"
msgstr ""
-#: awkgram.y:1577
+#: awkgram.y:1585
msgid "indirect function calls are a gawk extension"
msgstr ""
-#: awkgram.y:1590
+#: awkgram.y:1598
#, c-format
msgid "can not use special variable `%s' for indirect function call"
msgstr ""
-#: awkgram.y:1668
+#: awkgram.y:1676
msgid "invalid subscript expression"
msgstr ""
-#: awkgram.y:1708
-msgid "use of non-array as array"
-msgstr ""
-
-#: awkgram.y:1972 awkgram.y:1992 msg.c:98
+#: awkgram.y:2000 awkgram.y:2020 gawkapi.c:203 gawkapi.c:221 msg.c:119
msgid "warning: "
msgstr ""
-#: awkgram.y:1990 msg.c:130
+#: awkgram.y:2018 gawkapi.c:189 gawkapi.c:218 msg.c:151
msgid "fatal: "
msgstr ""
-#: awkgram.y:2040
+#: awkgram.y:2068
msgid "unexpected newline or end of string"
msgstr ""
-#: awkgram.y:2297 awkgram.y:2355 awkgram.y:2539
+#: awkgram.y:2335 awkgram.y:2411 awkgram.y:2634 debug.c:517 debug.c:533
+#: debug.c:2790 debug.c:5038
#, c-format
msgid "can't open source file `%s' for reading (%s)"
msgstr ""
-#: awkgram.y:2298 awkgram.y:2356 builtin.c:122
+#: awkgram.y:2336 awkgram.y:2461
+#, c-format
+msgid "can't open shared library `%s' for reading (%s)"
+msgstr ""
+
+#: awkgram.y:2338 awkgram.y:2412 awkgram.y:2462 builtin.c:130 debug.c:5189
msgid "reason unknown"
msgstr ""
-#: awkgram.y:2314
+#: awkgram.y:2347 awkgram.y:2371
+#, c-format
+msgid "can't include `%s' and use it as a program file"
+msgstr ""
+
+#: awkgram.y:2360
#, c-format
msgid "already included source file `%s'"
msgstr ""
-#: awkgram.y:2340
+#: awkgram.y:2361
+#, c-format
+msgid "already loaded shared library `%s'"
+msgstr ""
+
+#: awkgram.y:2396
msgid "@include is a gawk extension"
msgstr ""
-#: awkgram.y:2346
+#: awkgram.y:2402
msgid "empty filename after @include"
msgstr ""
-#: awkgram.y:2491
+#: awkgram.y:2446
+msgid "@load is a gawk extension"
+msgstr ""
+
+#: awkgram.y:2452
+msgid "empty filename after @load"
+msgstr ""
+
+#: awkgram.y:2586
msgid "empty program text on command line"
msgstr ""
-#: awkgram.y:2606
+#: awkgram.y:2701
#, c-format
msgid "can't read sourcefile `%s' (%s)"
msgstr ""
-#: awkgram.y:2617
+#: awkgram.y:2712
#, c-format
msgid "source file `%s' is empty"
msgstr ""
-#: awkgram.y:2794
+#: awkgram.y:2889
msgid "source file does not end in newline"
msgstr ""
-#: awkgram.y:2897
+#: awkgram.y:2994
msgid "unterminated regexp ends with `\\' at end of file"
msgstr ""
-#: awkgram.y:2921
+#: awkgram.y:3018
#, c-format
msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk"
msgstr ""
-#: awkgram.y:2925
+#: awkgram.y:3022
#, c-format
msgid "tawk regex modifier `/.../%c' doesn't work in gawk"
msgstr ""
-#: awkgram.y:2932
+#: awkgram.y:3029
msgid "unterminated regexp"
msgstr ""
-#: awkgram.y:2936
+#: awkgram.y:3033
msgid "unterminated regexp at end of file"
msgstr ""
-#: awkgram.y:2995
+#: awkgram.y:3092
msgid "use of `\\ #...' line continuation is not portable"
msgstr ""
-#: awkgram.y:3011
+#: awkgram.y:3108
msgid "backslash not last character on line"
msgstr ""
-#: awkgram.y:3072
+#: awkgram.y:3169
msgid "POSIX does not allow operator `**='"
msgstr ""
-#: awkgram.y:3074
+#: awkgram.y:3171
msgid "old awk does not support operator `**='"
msgstr ""
-#: awkgram.y:3083
+#: awkgram.y:3180
msgid "POSIX does not allow operator `**'"
msgstr ""
-#: awkgram.y:3085
+#: awkgram.y:3182
msgid "old awk does not support operator `**'"
msgstr ""
-#: awkgram.y:3120
+#: awkgram.y:3217
msgid "operator `^=' is not supported in old awk"
msgstr ""
-#: awkgram.y:3128
+#: awkgram.y:3225
msgid "operator `^' is not supported in old awk"
msgstr ""
-#: awkgram.y:3221 awkgram.y:3237
+#: awkgram.y:3318 awkgram.y:3334 command.y:1178
msgid "unterminated string"
msgstr ""
-#: awkgram.y:3433
+#: awkgram.y:3555
#, c-format
msgid "invalid char '%c' in expression"
msgstr ""
-#: awkgram.y:3480
+#: awkgram.y:3602
#, c-format
msgid "`%s' is a gawk extension"
msgstr ""
-#: awkgram.y:3485
+#: awkgram.y:3607
#, c-format
msgid "`%s' is a Bell Labs extension"
msgstr ""
-#: awkgram.y:3490
+#: awkgram.y:3612
#, c-format
msgid "POSIX does not allow `%s'"
msgstr ""
-#: awkgram.y:3498
+#: awkgram.y:3620
#, c-format
msgid "`%s' is not supported in old awk"
msgstr ""
-#: awkgram.y:3565
+#: awkgram.y:3688
msgid "`goto' considered harmful!\n"
msgstr ""
-#: awkgram.y:3616
+#: awkgram.y:3722
#, c-format
msgid "%d is invalid as number of arguments for %s"
msgstr ""
-#: awkgram.y:3651
+#: awkgram.y:3757
#, c-format
msgid "%s: string literal as last arg of substitute has no effect"
msgstr ""
-#: awkgram.y:3656
+#: awkgram.y:3762
#, c-format
msgid "%s third parameter is not a changeable object"
msgstr ""
-#: awkgram.y:3729 awkgram.y:3732
+#: awkgram.y:3841 awkgram.y:3844
msgid "match: third argument is a gawk extension"
msgstr ""
-#: awkgram.y:3786 awkgram.y:3789
+#: awkgram.y:3898 awkgram.y:3901
msgid "close: second argument is a gawk extension"
msgstr ""
-#: awkgram.y:3801
+#: awkgram.y:3913
msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
msgstr ""
-#: awkgram.y:3816
+#: awkgram.y:3928
msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
msgstr ""
-#: awkgram.y:3908
-#, c-format
-msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
-msgstr ""
-
-#: awkgram.y:3950
+#: awkgram.y:3994
#, c-format
msgid "function `%s': parameter `%s' shadows global variable"
msgstr ""
-#: awkgram.y:4108
+#: awkgram.y:4051 debug.c:4019 debug.c:4062 debug.c:5187
#, c-format
msgid "could not open `%s' for writing (%s)"
msgstr ""
-#: awkgram.y:4109
+#: awkgram.y:4052
msgid "sending variable list to standard error"
msgstr ""
-#: awkgram.y:4115
+#: awkgram.y:4060
#, c-format
msgid "%s: close failed (%s)"
msgstr ""
-#: awkgram.y:4167
+#: awkgram.y:4085
msgid "shadow_funcs() called twice!"
msgstr ""
-#: awkgram.y:4173
+#: awkgram.y:4093
msgid "there were shadowed variables."
msgstr ""
-#: awkgram.y:4203
+#: awkgram.y:4164
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr ""
+
+#: awkgram.y:4210
#, c-format
msgid "function `%s': can't use function name as parameter name"
msgstr ""
-#: awkgram.y:4207
+#: awkgram.y:4213
#, c-format
msgid "function `%s': can't use special variable `%s' as a function parameter"
msgstr ""
-#: awkgram.y:4223
+#: awkgram.y:4221
#, c-format
-msgid "function name `%s' previously defined"
+msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
msgstr ""
-#: awkgram.y:4391 awkgram.y:4397
+#: awkgram.y:4315 awkgram.y:4319
#, c-format
msgid "function `%s' called but never defined"
msgstr ""
-#: awkgram.y:4400
+#: awkgram.y:4324
#, c-format
msgid "function `%s' defined but never called directly"
msgstr ""
-#: awkgram.y:4432
+#: awkgram.y:4356
#, c-format
msgid "regexp constant for parameter #%d yields boolean value"
msgstr ""
-#: awkgram.y:4541
+#: awkgram.y:4402
#, c-format
msgid ""
"function `%s' called with space between name and `(',\n"
"or used as a variable or an array"
msgstr ""
-#: awkgram.y:4788 eval.c:2056
+#: awkgram.y:4618
msgid "division by zero attempted"
msgstr ""
-#: awkgram.y:4797 eval.c:2072
+#: awkgram.y:4627
#, c-format
msgid "division by zero attempted in `%%'"
msgstr ""
-#: builtin.c:120
+#: builtin.c:128
#, c-format
msgid "%s to \"%s\" failed (%s)"
msgstr ""
-#: builtin.c:121
+#: builtin.c:129
msgid "standard output"
msgstr ""
-#: builtin.c:135
+#: builtin.c:143
msgid "exp: received non-numeric argument"
msgstr ""
-#: builtin.c:141
+#: builtin.c:149
#, c-format
msgid "exp: argument %g is out of range"
msgstr ""
-#: builtin.c:200
+#: builtin.c:208
#, c-format
msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing"
msgstr ""
-#: builtin.c:203
+#: builtin.c:211
#, c-format
msgid "fflush: cannot flush: file `%s' opened for reading, not writing"
msgstr ""
-#: builtin.c:215
+#: builtin.c:223
#, c-format
msgid "fflush: `%s' is not an open file, pipe or co-process"
msgstr ""
-#: builtin.c:333
+#: builtin.c:341
msgid "index: received non-string first argument"
msgstr ""
-#: builtin.c:335
+#: builtin.c:343
msgid "index: received non-string second argument"
msgstr ""
-#: builtin.c:457
+#: builtin.c:467 mpfr.c:770
msgid "int: received non-numeric argument"
msgstr ""
-#: builtin.c:493
+#: builtin.c:503
msgid "length: received array argument"
msgstr ""
-#: builtin.c:496
+#: builtin.c:506
msgid "`length(array)' is a gawk extension"
msgstr ""
-#: builtin.c:504
+#: builtin.c:514
msgid "length: received non-string argument"
msgstr ""
-#: builtin.c:535
+#: builtin.c:545
msgid "log: received non-numeric argument"
msgstr ""
-#: builtin.c:538
+#: builtin.c:548
#, c-format
msgid "log: received negative argument %g"
msgstr ""
-#: builtin.c:694 builtin.c:699
+#: builtin.c:746 builtin.c:751
msgid "fatal: must use `count$' on all formats or none"
msgstr ""
-#: builtin.c:762
+#: builtin.c:821
#, c-format
msgid "field width is ignored for `%%' specifier"
msgstr ""
-#: builtin.c:764
+#: builtin.c:823
#, c-format
msgid "precision is ignored for `%%' specifier"
msgstr ""
-#: builtin.c:766
+#: builtin.c:825
#, c-format
msgid "field width and precision are ignored for `%%' specifier"
msgstr ""
-#: builtin.c:817
+#: builtin.c:876
msgid "fatal: `$' is not permitted in awk formats"
msgstr ""
-#: builtin.c:826
+#: builtin.c:885
msgid "fatal: arg count with `$' must be > 0"
msgstr ""
-#: builtin.c:830
+#: builtin.c:889
#, c-format
msgid "fatal: arg count %ld greater than total number of supplied arguments"
msgstr ""
-#: builtin.c:834
+#: builtin.c:893
msgid "fatal: `$' not permitted after period in format"
msgstr ""
-#: builtin.c:850
+#: builtin.c:909
msgid "fatal: no `$' supplied for positional field width or precision"
msgstr ""
-#: builtin.c:921
+#: builtin.c:981
msgid "`l' is meaningless in awk formats; ignored"
msgstr ""
-#: builtin.c:925
+#: builtin.c:985
msgid "fatal: `l' is not permitted in POSIX awk formats"
msgstr ""
-#: builtin.c:938
+#: builtin.c:998
msgid "`L' is meaningless in awk formats; ignored"
msgstr ""
-#: builtin.c:942
+#: builtin.c:1002
msgid "fatal: `L' is not permitted in POSIX awk formats"
msgstr ""
-#: builtin.c:955
+#: builtin.c:1015
msgid "`h' is meaningless in awk formats; ignored"
msgstr ""
-#: builtin.c:959
+#: builtin.c:1019
msgid "fatal: `h' is not permitted in POSIX awk formats"
msgstr ""
-#: builtin.c:1272
+#: builtin.c:1414
#, c-format
msgid "[s]printf: value %g is out of range for `%%%c' format"
msgstr ""
-#: builtin.c:1332
+#: builtin.c:1512
#, c-format
msgid "ignoring unknown format specifier character `%c': no argument converted"
msgstr ""
-#: builtin.c:1337
+#: builtin.c:1517
msgid "fatal: not enough arguments to satisfy format string"
msgstr ""
-#: builtin.c:1339
+#: builtin.c:1519
msgid "^ ran out for this one"
msgstr ""
-#: builtin.c:1346
+#: builtin.c:1526
msgid "[s]printf: format specifier does not have control letter"
msgstr ""
-#: builtin.c:1349
+#: builtin.c:1529
msgid "too many arguments supplied for format string"
msgstr ""
-#: builtin.c:1423 builtin.c:1434
+#: builtin.c:1604 builtin.c:1615
msgid "printf: no arguments"
msgstr ""
-#: builtin.c:1475
+#: builtin.c:1656
msgid "sqrt: received non-numeric argument"
msgstr ""
-#: builtin.c:1479
+#: builtin.c:1660
#, c-format
msgid "sqrt: called with negative argument %g"
msgstr ""
-#: builtin.c:1503
+#: builtin.c:1691
#, c-format
msgid "substr: length %g is not >= 1"
msgstr ""
-#: builtin.c:1505
+#: builtin.c:1693
#, c-format
msgid "substr: length %g is not >= 0"
msgstr ""
-#: builtin.c:1512
+#: builtin.c:1700
#, c-format
msgid "substr: non-integer length %g will be truncated"
msgstr ""
-#: builtin.c:1517
+#: builtin.c:1705
#, c-format
msgid "substr: length %g too big for string indexing, truncating to %g"
msgstr ""
-#: builtin.c:1529
+#: builtin.c:1717
#, c-format
msgid "substr: start index %g is invalid, using 1"
msgstr ""
-#: builtin.c:1534
+#: builtin.c:1722
#, c-format
msgid "substr: non-integer start index %g will be truncated"
msgstr ""
-#: builtin.c:1559
+#: builtin.c:1747
msgid "substr: source string is zero length"
msgstr ""
-#: builtin.c:1575
+#: builtin.c:1763
#, c-format
msgid "substr: start index %g is past end of string"
msgstr ""
-#: builtin.c:1583
+#: builtin.c:1771
#, c-format
msgid ""
"substr: length %g at start index %g exceeds length of first argument (%lu)"
msgstr ""
-#: builtin.c:1657
+#: builtin.c:1845
msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type"
msgstr ""
-#: builtin.c:1680
+#: builtin.c:1868
msgid "strftime: received non-numeric second argument"
msgstr ""
-#: builtin.c:1683
+#: builtin.c:1872
msgid "strftime: second argument less than 0 or too big for time_t"
msgstr ""
-#: builtin.c:1690
+#: builtin.c:1879
msgid "strftime: received non-string first argument"
msgstr ""
-#: builtin.c:1696
+#: builtin.c:1886
msgid "strftime: received empty format string"
msgstr ""
-#: builtin.c:1762
+#: builtin.c:1952
msgid "mktime: received non-string argument"
msgstr ""
-#: builtin.c:1779
+#: builtin.c:1969
msgid "mktime: at least one of the values is out of the default range"
msgstr ""
-#: builtin.c:1814
+#: builtin.c:2004
msgid "'system' function not allowed in sandbox mode"
msgstr ""
-#: builtin.c:1819
+#: builtin.c:2009
msgid "system: received non-string argument"
msgstr ""
-#: builtin.c:1874 eval.c:1159 eval.c:1790 eval.c:1803
-#, c-format
-msgid "reference to uninitialized variable `%s'"
-msgstr ""
-
-#: builtin.c:1941
+#: builtin.c:2127
#, c-format
msgid "reference to uninitialized field `$%d'"
msgstr ""
-#: builtin.c:2028
+#: builtin.c:2214
msgid "tolower: received non-string argument"
msgstr ""
-#: builtin.c:2062
+#: builtin.c:2248
msgid "toupper: received non-string argument"
msgstr ""
-#: builtin.c:2098
+#: builtin.c:2284 mpfr.c:685
msgid "atan2: received non-numeric first argument"
msgstr ""
-#: builtin.c:2100
+#: builtin.c:2286 mpfr.c:687
msgid "atan2: received non-numeric second argument"
msgstr ""
-#: builtin.c:2119
+#: builtin.c:2305
msgid "sin: received non-numeric argument"
msgstr ""
-#: builtin.c:2135
+#: builtin.c:2321
msgid "cos: received non-numeric argument"
msgstr ""
-#: builtin.c:2188
+#: builtin.c:2374 mpfr.c:1137
msgid "srand: received non-numeric argument"
msgstr ""
-#: builtin.c:2219
+#: builtin.c:2405
msgid "match: third argument is not an array"
msgstr ""
-#: builtin.c:2483
+#: builtin.c:2670
msgid "gensub: third argument of 0 treated as 1"
msgstr ""
-#: builtin.c:2776
+#: builtin.c:2963
msgid "lshift: received non-numeric first argument"
msgstr ""
-#: builtin.c:2778
+#: builtin.c:2965
msgid "lshift: received non-numeric second argument"
msgstr ""
-#: builtin.c:2784
+#: builtin.c:2971
#, c-format
msgid "lshift(%f, %f): negative values will give strange results"
msgstr ""
-#: builtin.c:2786
+#: builtin.c:2973
#, c-format
msgid "lshift(%f, %f): fractional values will be truncated"
msgstr ""
-#: builtin.c:2788
+#: builtin.c:2975
#, c-format
msgid "lshift(%f, %f): too large shift value will give strange results"
msgstr ""
-#: builtin.c:2813
+#: builtin.c:3000
msgid "rshift: received non-numeric first argument"
msgstr ""
-#: builtin.c:2815
+#: builtin.c:3002
msgid "rshift: received non-numeric second argument"
msgstr ""
-#: builtin.c:2821
+#: builtin.c:3008
#, c-format
msgid "rshift(%f, %f): negative values will give strange results"
msgstr ""
-#: builtin.c:2823
+#: builtin.c:3010
#, c-format
msgid "rshift(%f, %f): fractional values will be truncated"
msgstr ""
-#: builtin.c:2825
+#: builtin.c:3012
#, c-format
msgid "rshift(%f, %f): too large shift value will give strange results"
msgstr ""
-#: builtin.c:2850
-msgid "and: received non-numeric first argument"
+#: builtin.c:3037
+msgid "and: called with less than two arguments"
+msgstr ""
+
+#: builtin.c:3042
+#, c-format
+msgid "and: argument %d is non-numeric"
+msgstr ""
+
+#: builtin.c:3046
+#, c-format
+msgid "and: argument %d negative value %g will give strange results"
+msgstr ""
+
+#: builtin.c:3069
+msgid "or: called with less than two arguments"
msgstr ""
-#: builtin.c:2852
-msgid "and: received non-numeric second argument"
+#: builtin.c:3074
+#, c-format
+msgid "or: argument %d is non-numeric"
msgstr ""
-#: builtin.c:2858
+#: builtin.c:3078
#, c-format
-msgid "and(%f, %f): negative values will give strange results"
+msgid "or: argument %d negative value %g will give strange results"
msgstr ""
-#: builtin.c:2860
+#: builtin.c:3100
+msgid "xor: called with less than two arguments"
+msgstr ""
+
+#: builtin.c:3106
#, c-format
-msgid "and(%f, %f): fractional values will be truncated"
+msgid "xor: argument %d is non-numeric"
msgstr ""
-#: builtin.c:2885
-msgid "or: received non-numeric first argument"
+#: builtin.c:3110
+#, c-format
+msgid "xor: argument %d negative value %g will give strange results"
msgstr ""
-#: builtin.c:2887
-msgid "or: received non-numeric second argument"
+#: builtin.c:3135 mpfr.c:800
+msgid "compl: received non-numeric argument"
msgstr ""
-#: builtin.c:2893
+#: builtin.c:3141
#, c-format
-msgid "or(%f, %f): negative values will give strange results"
+msgid "compl(%f): negative value will give strange results"
msgstr ""
-#: builtin.c:2895
+#: builtin.c:3143
#, c-format
-msgid "or(%f, %f): fractional values will be truncated"
+msgid "compl(%f): fractional value will be truncated"
msgstr ""
-#: builtin.c:2923
-msgid "xor: received non-numeric first argument"
+#: builtin.c:3312
+#, c-format
+msgid "dcgettext: `%s' is not a valid locale category"
msgstr ""
-#: builtin.c:2925
-msgid "xor: received non-numeric second argument"
+#: command.y:225
+#, c-format
+msgid "Type (g)awk statement(s). End with the command \"end\"\n"
msgstr ""
-#: builtin.c:2931
+#: command.y:289
#, c-format
-msgid "xor(%f, %f): negative values will give strange results"
+msgid "invalid frame number: %d"
msgstr ""
-#: builtin.c:2933
+#: command.y:295
#, c-format
-msgid "xor(%f, %f): fractional values will be truncated"
+msgid "info: invalid option - \"%s\""
msgstr ""
-#: builtin.c:2957 builtin.c:2963
-msgid "compl: received non-numeric argument"
+#: command.y:321
+#, c-format
+msgid "source \"%s\": already sourced."
msgstr ""
-#: builtin.c:2965
+#: command.y:326
#, c-format
-msgid "compl(%f): negative value will give strange results"
+msgid "save \"%s\": command not permitted."
+msgstr ""
+
+#: command.y:339
+msgid "Can't use command `commands' for breakpoint/watchpoint commands"
+msgstr ""
+
+#: command.y:341
+msgid "no breakpoint/watchpoint has been set yet"
+msgstr ""
+
+#: command.y:343
+msgid "invalid breakpoint/watchpoint number"
msgstr ""
-#: builtin.c:2967
+#: command.y:348
#, c-format
-msgid "compl(%f): fractional value will be truncated"
+msgid "Type commands for when %s %d is hit, one per line.\n"
msgstr ""
-#: builtin.c:3136
+#: command.y:350
#, c-format
-msgid "dcgettext: `%s' is not a valid locale category"
+msgid "End with the command \"end\"\n"
+msgstr ""
+
+#: command.y:357
+msgid "`end' valid only in command `commands' or `eval'"
+msgstr ""
+
+#: command.y:367
+msgid "`silent' valid only in command `commands'"
+msgstr ""
+
+#: command.y:373
+#, c-format
+msgid "trace: invalid option - \"%s\""
+msgstr ""
+
+#: command.y:387
+msgid "condition: invalid breakpoint/watchpoint number"
+msgstr ""
+
+#: command.y:449
+msgid "argument not a string"
+msgstr ""
+
+#: command.y:459 command.y:464
+#, c-format
+msgid "option: invalid parameter - \"%s\""
+msgstr ""
+
+#: command.y:474
+#, c-format
+msgid "no such function - \"%s\""
+msgstr ""
+
+#: command.y:531
+#, c-format
+msgid "enable: invalid option - \"%s\""
+msgstr ""
+
+#: command.y:597
+#, c-format
+msgid "invalid range specification: %d - %d"
+msgstr ""
+
+#: command.y:659
+msgid "non-numeric value for field number"
+msgstr ""
+
+#: command.y:680 command.y:687
+msgid "non-numeric value found, numeric expected"
+msgstr ""
+
+#: command.y:712 command.y:718
+msgid "non-zero integer value"
+msgstr ""
+
+#: command.y:817
+msgid ""
+"backtrace [N] - print trace of all or N innermost (outermost if N < 0) "
+"frames."
+msgstr ""
+
+#: command.y:819
+msgid ""
+"break [[filename:]N|function] - set breakpoint at the specified location."
+msgstr ""
+
+#: command.y:821
+msgid "clear [[filename:]N|function] - delete breakpoints previously set."
+msgstr ""
+
+#: command.y:823
+msgid ""
+"commands [num] - starts a list of commands to be executed at a breakpoint"
+"(watchpoint) hit."
+msgstr ""
+
+#: command.y:825
+msgid "condition num [expr] - set or clear breakpoint or watchpoint condition."
+msgstr ""
+
+#: command.y:827
+msgid "continue [COUNT] - continue program being debugged."
+msgstr ""
+
+#: command.y:829
+msgid "delete [breakpoints] [range] - delete specified breakpoints."
+msgstr ""
+
+#: command.y:831
+msgid "disable [breakpoints] [range] - disable specified breakpoints."
+msgstr ""
+
+#: command.y:833
+msgid "display [var] - print value of variable each time the program stops."
+msgstr ""
+
+#: command.y:835
+msgid "down [N] - move N frames down the stack."
+msgstr ""
+
+#: command.y:837
+msgid "dump [filename] - dump instructions to file or stdout."
+msgstr ""
+
+#: command.y:839
+msgid "enable [once|del] [breakpoints] [range] - enable specified breakpoints."
+msgstr ""
+
+#: command.y:841
+msgid "end - end a list of commands or awk statements."
+msgstr ""
+
+#: command.y:843
+msgid "eval stmt|[p1, p2, ...] - evaluate awk statement(s)."
+msgstr ""
+
+#: command.y:845
+msgid "finish - execute until selected stack frame returns."
+msgstr ""
+
+#: command.y:847
+msgid "frame [N] - select and print stack frame number N."
+msgstr ""
+
+#: command.y:849
+msgid "help [command] - print list of commands or explanation of command."
+msgstr ""
+
+#: command.y:851
+msgid "ignore N COUNT - set ignore-count of breakpoint number N to COUNT."
+msgstr ""
+
+#: command.y:853
+msgid ""
+"info topic - source|sources|variables|functions|break|frame|args|locals|"
+"display|watch."
+msgstr ""
+
+#: command.y:855
+msgid "list [-|+|[filename:]lineno|function|range] - list specified line(s)."
+msgstr ""
+
+#: command.y:857
+msgid "next [COUNT] - step program, proceeding through subroutine calls."
+msgstr ""
+
+#: command.y:859
+msgid ""
+"nexti [COUNT] - step one instruction, but proceed through subroutine calls."
+msgstr ""
+
+#: command.y:861
+msgid "option [name[=value]] - set or display debugger option(s)."
+msgstr ""
+
+#: command.y:863
+msgid "print var [var] - print value of a variable or array."
+msgstr ""
+
+#: command.y:865
+msgid "printf format, [arg], ... - formatted output."
+msgstr ""
+
+#: command.y:867
+msgid "quit - exit debugger."
+msgstr ""
+
+#: command.y:869
+msgid "return [value] - make selected stack frame return to its caller."
+msgstr ""
+
+#: command.y:871
+msgid "run - start or restart executing program."
+msgstr ""
+
+#: command.y:874
+msgid "save filename - save commands from the session to file."
+msgstr ""
+
+#: command.y:877
+msgid "set var = value - assign value to a scalar variable."
+msgstr ""
+
+#: command.y:879
+msgid ""
+"silent - suspends usual message when stopped at a breakpoint/watchpoint."
+msgstr ""
+
+#: command.y:881
+msgid "source file - execute commands from file."
+msgstr ""
+
+#: command.y:883
+msgid "step [COUNT] - step program until it reaches a different source line."
+msgstr ""
+
+#: command.y:885
+msgid "stepi [COUNT] - step one instruction exactly."
+msgstr ""
+
+#: command.y:887
+msgid "tbreak [[filename:]N|function] - set a temporary breakpoint."
+msgstr ""
+
+#: command.y:889
+msgid "trace on|off - print instruction before executing."
+msgstr ""
+
+#: command.y:891
+msgid "undisplay [N] - remove variable(s) from automatic display list."
+msgstr ""
+
+#: command.y:893
+msgid ""
+"until [[filename:]N|function] - execute until program reaches a different "
+"line or line N within current frame."
+msgstr ""
+
+#: command.y:895
+msgid "unwatch [N] - remove variable(s) from watch list."
+msgstr ""
+
+#: command.y:897
+msgid "up [N] - move N frames up the stack."
+msgstr ""
+
+#: command.y:899
+msgid "watch var - set a watchpoint for a variable."
+msgstr ""
+
+#: command.y:1011 debug.c:395 msg.c:128
+#, c-format
+msgid "error: "
+msgstr ""
+
+#: command.y:1051
+#, c-format
+msgid "can't read command (%s)\n"
+msgstr ""
+
+#: command.y:1065
+#, c-format
+msgid "can't read command (%s)"
+msgstr ""
+
+#: command.y:1116
+msgid "invalid character in command"
+msgstr ""
+
+#: command.y:1152
+#, c-format
+msgid "unknown command - \"%.*s\", try help"
+msgstr ""
+
+#: command.y:1222
+#, c-format
+msgid "%s"
+msgstr ""
+
+#: command.y:1284
+msgid "invalid character"
+msgstr ""
+
+#: command.y:1455
+#, c-format
+msgid "undefined command: %s\n"
+msgstr ""
+
+#: debug.c:246
+msgid "set or show the number of lines to keep in history file."
+msgstr ""
+
+#: debug.c:248
+msgid "set or show the list command window size."
+msgstr ""
+
+#: debug.c:250
+msgid "set or show gawk output file."
+msgstr ""
+
+#: debug.c:252
+msgid "set or show debugger prompt."
+msgstr ""
+
+#: debug.c:254
+msgid "(un)set or show saving of command history (value=on|off)."
+msgstr ""
+
+#: debug.c:256
+msgid "(un)set or show saving of options (value=on|off)."
+msgstr ""
+
+#: debug.c:258
+msgid "(un)set or show instruction tracing (value=on|off)."
+msgstr ""
+
+#: debug.c:339
+msgid "program not running."
+msgstr ""
+
+#: debug.c:442 debug.c:597
+#, c-format
+msgid "can't read source file `%s' (%s)"
+msgstr ""
+
+#: debug.c:447
+#, c-format
+msgid "source file `%s' is empty.\n"
+msgstr ""
+
+#: debug.c:474
+msgid "no current source file."
+msgstr ""
+
+#: debug.c:499
+#, c-format
+msgid "cannot find source file named `%s' (%s)"
+msgstr ""
+
+#: debug.c:523
+#, c-format
+msgid "WARNING: source file `%s' modified since program compilation.\n"
+msgstr ""
+
+#: debug.c:542
+#, c-format
+msgid "line number %d out of range; `%s' has %d lines"
+msgstr ""
+
+#: debug.c:602
+#, c-format
+msgid "unexpected eof while reading file `%s', line %d"
+msgstr ""
+
+#: debug.c:611
+#, c-format
+msgid "source file `%s' modified since start of program execution"
+msgstr ""
+
+#: debug.c:723
+#, c-format
+msgid "Current source file: %s\n"
+msgstr ""
+
+#: debug.c:724
+#, c-format
+msgid "Number of lines: %d\n"
+msgstr ""
+
+#: debug.c:731
+#, c-format
+msgid "Source file (lines): %s (%d)\n"
+msgstr ""
+
+#: debug.c:745
+msgid ""
+"Number Disp Enabled Location\n"
+"\n"
+msgstr ""
+
+#: debug.c:756
+#, c-format
+msgid "\tno of hits = %ld\n"
+msgstr ""
+
+#: debug.c:758
+#, c-format
+msgid "\tignore next %ld hit(s)\n"
+msgstr ""
+
+#: debug.c:760 debug.c:900
+#, c-format
+msgid "\tstop condition: %s\n"
+msgstr ""
+
+#: debug.c:762 debug.c:902
+msgid "\tcommands:\n"
+msgstr ""
+
+#: debug.c:784
+#, c-format
+msgid "Current frame: "
+msgstr ""
+
+#: debug.c:787
+#, c-format
+msgid "Called by frame: "
+msgstr ""
+
+#: debug.c:791
+#, c-format
+msgid "Caller of frame: "
+msgstr ""
+
+#: debug.c:809
+#, c-format
+msgid "None in main().\n"
+msgstr ""
+
+#: debug.c:839
+msgid "No arguments.\n"
+msgstr ""
+
+#: debug.c:840
+msgid "No locals.\n"
+msgstr ""
+
+#: debug.c:848
+msgid ""
+"All defined variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:858
+msgid ""
+"All defined functions:\n"
+"\n"
+msgstr ""
+
+#: debug.c:877
+msgid ""
+"Auto-display variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:880
+msgid ""
+"Watch variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:1020
+#, c-format
+msgid "no symbol `%s' in current context\n"
+msgstr ""
+
+#: debug.c:1032 debug.c:1416
+#, c-format
+msgid "`%s' is not an array\n"
+msgstr ""
+
+#: debug.c:1046
+#, c-format
+msgid "$%ld = uninitialized field\n"
+msgstr ""
+
+#: debug.c:1067
+#, c-format
+msgid "array `%s' is empty\n"
+msgstr ""
+
+#: debug.c:1110 debug.c:1162
+#, c-format
+msgid "[\"%s\"] not in array `%s'\n"
+msgstr ""
+
+#: debug.c:1166
+#, c-format
+msgid "`%s[\"%s\"]' is not an array\n"
+msgstr ""
+
+#: debug.c:1227 debug.c:4947
+#, c-format
+msgid "`%s' is not a scalar variable"
+msgstr ""
+
+#: debug.c:1249 debug.c:4977
+#, c-format
+msgid "attempt to use array `%s[\"%s\"]' in a scalar context"
+msgstr ""
+
+#: debug.c:1269 debug.c:4988
+#, c-format
+msgid "attempt to use scalar `%s[\"%s\"]' as array"
+msgstr ""
+
+#: debug.c:1412
+#, c-format
+msgid "`%s' is a function"
+msgstr ""
+
+#: debug.c:1454
+#, c-format
+msgid "watchpoint %d is unconditional\n"
+msgstr ""
+
+#: debug.c:1488
+#, c-format
+msgid "No display item numbered %ld"
+msgstr ""
+
+#: debug.c:1491
+#, c-format
+msgid "No watch item numbered %ld"
+msgstr ""
+
+#: debug.c:1517
+#, c-format
+msgid "%d: [\"%s\"] not in array `%s'\n"
+msgstr ""
+
+#: debug.c:1756
+msgid "attempt to use scalar value as array"
+msgstr ""
+
+#: debug.c:1845
+#, c-format
+msgid "Watchpoint %d deleted because parameter is out of scope.\n"
+msgstr ""
+
+#: debug.c:1856
+#, c-format
+msgid "Display %d deleted because parameter is out of scope.\n"
+msgstr ""
+
+#: debug.c:1889
+#, c-format
+msgid " in file `%s', line %d\n"
+msgstr ""
+
+#: debug.c:1910
+#, c-format
+msgid " at `%s':%d"
+msgstr ""
+
+#: debug.c:1926 debug.c:1989
+#, c-format
+msgid "#%ld\tin "
+msgstr ""
+
+#: debug.c:1963
+#, c-format
+msgid "More stack frames follow ...\n"
+msgstr ""
+
+#: debug.c:2006
+msgid "invalid frame number"
+msgstr ""
+
+#: debug.c:2178
+#, c-format
+msgid "Note: breakpoint %d (enabled, ignore next %ld hits), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2185
+#, c-format
+msgid "Note: breakpoint %d (enabled), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2192
+#, c-format
+msgid "Note: breakpoint %d (disabled, ignore next %ld hits), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2199
+#, c-format
+msgid "Note: breakpoint %d (disabled), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2216
+#, c-format
+msgid "Breakpoint %d set at file `%s', line %d\n"
+msgstr ""
+
+#: debug.c:2318
+#, c-format
+msgid "Can't set breakpoint in file `%s'\n"
+msgstr ""
+
+#: debug.c:2347 debug.c:2470 debug.c:3328
+#, c-format
+msgid "line number %d in file `%s' out of range"
+msgstr ""
+
+#: debug.c:2351
+#, c-format
+msgid "Can't find rule!!!\n"
+msgstr ""
+
+#: debug.c:2353
+#, c-format
+msgid "Can't set breakpoint at `%s':%d\n"
+msgstr ""
+
+#: debug.c:2365
+#, c-format
+msgid "Can't set breakpoint in function `%s'\n"
+msgstr ""
+
+#: debug.c:2381
+#, c-format
+msgid "breakpoint %d set at file `%s', line %d is unconditional\n"
+msgstr ""
+
+#: debug.c:2486 debug.c:2508
+#, c-format
+msgid "Deleted breakpoint %d"
+msgstr ""
+
+#: debug.c:2492
+#, c-format
+msgid "No breakpoint(s) at entry to function `%s'\n"
+msgstr ""
+
+#: debug.c:2519
+#, c-format
+msgid "No breakpoint at file `%s', line #%d\n"
+msgstr ""
+
+#: debug.c:2574 debug.c:2615 debug.c:2635 debug.c:2678
+msgid "invalid breakpoint number"
+msgstr ""
+
+#: debug.c:2590
+msgid "Delete all breakpoints? (y or n) "
+msgstr ""
+
+#: debug.c:2591 debug.c:2901 debug.c:2954
+msgid "y"
+msgstr ""
+
+#: debug.c:2640
+#, c-format
+msgid "Will ignore next %ld crossing(s) of breakpoint %d.\n"
+msgstr ""
+
+#: debug.c:2644
+#, c-format
+msgid "Will stop next time breakpoint %d is reached.\n"
+msgstr ""
+
+#: debug.c:2761
+#, c-format
+msgid "Can only debug programs provided with the `-f' option.\n"
+msgstr ""
+
+#: debug.c:2886
+#, c-format
+msgid "Failed to restart debugger"
+msgstr ""
+
+#: debug.c:2900
+msgid "Program already running. Restart from beginning (y/n)? "
+msgstr ""
+
+#: debug.c:2904
+#, c-format
+msgid "Program not restarted\n"
+msgstr ""
+
+#: debug.c:2914
+#, c-format
+msgid "error: cannot restart, operation not allowed\n"
+msgstr ""
+
+#: debug.c:2920
+#, c-format
+msgid "error (%s): cannot restart, ignoring rest of the commands\n"
+msgstr ""
+
+#: debug.c:2928
+#, c-format
+msgid "Starting program: \n"
+msgstr ""
+
+#: debug.c:2937
+#, c-format
+msgid "Program exited %s with exit value: %d\n"
+msgstr ""
+
+#: debug.c:2953
+msgid "The program is running. Exit anyway (y/n)? "
+msgstr ""
+
+#: debug.c:2988
+#, c-format
+msgid "Not stopped at any breakpoint; argument ignored.\n"
+msgstr ""
+
+#: debug.c:2993
+#, c-format
+msgid "invalid breakpoint number %d."
+msgstr ""
+
+#: debug.c:2998
+#, c-format
+msgid "Will ignore next %ld crossings of breakpoint %d.\n"
msgstr ""
-#: eval.c:412
+#: debug.c:3185
+#, c-format
+msgid "'finish' not meaningful in the outermost frame main()\n"
+msgstr ""
+
+#: debug.c:3190
+#, c-format
+msgid "Run till return from "
+msgstr ""
+
+#: debug.c:3233
+#, c-format
+msgid "'return' not meaningful in the outermost frame main()\n"
+msgstr ""
+
+#: debug.c:3347
+#, c-format
+msgid "Can't find specified location in function `%s'\n"
+msgstr ""
+
+#: debug.c:3355
+#, c-format
+msgid "invalid source line %d in file `%s'"
+msgstr ""
+
+#: debug.c:3370
+#, c-format
+msgid "Can't find specified location %d in file `%s'\n"
+msgstr ""
+
+#: debug.c:3402
+#, c-format
+msgid "element not in array\n"
+msgstr ""
+
+#: debug.c:3402
+#, c-format
+msgid "untyped variable\n"
+msgstr ""
+
+#: debug.c:3444
+#, c-format
+msgid "Stopping in %s ...\n"
+msgstr ""
+
+#: debug.c:3521
+#, c-format
+msgid "'finish' not meaningful with non-local jump '%s'\n"
+msgstr ""
+
+#: debug.c:3528
+#, c-format
+msgid "'until' not meaningful with non-local jump '%s'\n"
+msgstr ""
+
+#: debug.c:4163
+msgid "\t------[Enter] to continue or q [Enter] to quit------"
+msgstr ""
+
+#: debug.c:4164
+msgid "q"
+msgstr ""
+
+#: debug.c:4984
+#, c-format
+msgid "[\"%s\"] not in array `%s'"
+msgstr ""
+
+#: debug.c:5190
+#, c-format
+msgid "sending output to stdout\n"
+msgstr ""
+
+#: debug.c:5230
+msgid "invalid number"
+msgstr ""
+
+#: debug.c:5362
+#, c-format
+msgid "`%s' not allowed in current context; statement ignored"
+msgstr ""
+
+#: debug.c:5370
+msgid "`return' not allowed in current context; statement ignored"
+msgstr ""
+
+#: debug.c:5571
+#, c-format
+msgid "No symbol `%s' in current context"
+msgstr ""
+
+#: dfa.c:984 dfa.c:987 dfa.c:1007 dfa.c:1017 dfa.c:1029 dfa.c:1080 dfa.c:1089
+#: dfa.c:1092 dfa.c:1097 dfa.c:1110 dfa.c:1178
+msgid "unbalanced ["
+msgstr ""
+
+#: dfa.c:1038
+msgid "invalid character class"
+msgstr ""
+
+#: dfa.c:1215
+msgid "character class syntax is [[:space:]], not [:space:]"
+msgstr ""
+
+#: dfa.c:1267
+msgid "unfinished \\ escape"
+msgstr ""
+
+#: dfa.c:1414 regcomp.c:161
+msgid "Invalid content of \\{\\}"
+msgstr ""
+
+#: dfa.c:1417 regcomp.c:176
+msgid "Regular expression too big"
+msgstr ""
+
+#: dfa.c:1802
+msgid "unbalanced ("
+msgstr ""
+
+#: dfa.c:1929
+msgid "no syntax specified"
+msgstr ""
+
+#: dfa.c:1937
+msgid "unbalanced )"
+msgstr ""
+
+#: eval.c:394
#, c-format
msgid "unknown nodetype %d"
msgstr ""
-#: eval.c:423 eval.c:437
+#: eval.c:405 eval.c:419
#, c-format
msgid "unknown opcode %d"
msgstr ""
-#: eval.c:434
+#: eval.c:416
#, c-format
msgid "opcode %s not an operator or keyword"
msgstr ""
-#: eval.c:488
+#: eval.c:471
msgid "buffer overflow in genflags2str"
msgstr ""
-#: eval.c:698
+#: eval.c:674
#, c-format
msgid ""
"\n"
@@ -954,292 +1787,487 @@ msgid ""
"\n"
msgstr ""
-#: eval.c:725
+#: eval.c:703
msgid "`IGNORECASE' is a gawk extension"
msgstr ""
-#: eval.c:754
+#: eval.c:735
msgid "`BINMODE' is a gawk extension"
msgstr ""
-#: eval.c:812
+#: eval.c:792
#, c-format
msgid "BINMODE value `%s' is invalid, treated as 3"
msgstr ""
-#: eval.c:902
+#: eval.c:884
#, c-format
msgid "bad `%sFMT' specification `%s'"
msgstr ""
-#: eval.c:980
+#: eval.c:968
msgid "turning off `--lint' due to assignment to `LINT'"
msgstr ""
-#: eval.c:1127 eval.c:1777
+#: eval.c:1144
#, c-format
-msgid "can't use function name `%s' as variable or array"
+msgid "reference to uninitialized argument `%s'"
msgstr ""
-#: eval.c:1158 eval.c:1789 eval.c:1802
+#: eval.c:1145
#, c-format
-msgid "reference to uninitialized argument `%s'"
+msgid "reference to uninitialized variable `%s'"
msgstr ""
-#: eval.c:1177
+#: eval.c:1163
msgid "attempt to field reference from non-numeric value"
msgstr ""
-#: eval.c:1179
+#: eval.c:1165
msgid "attempt to field reference from null string"
msgstr ""
-#: eval.c:1185
+#: eval.c:1173
#, c-format
msgid "attempt to access field %ld"
msgstr ""
-#: eval.c:1194
+#: eval.c:1182
#, c-format
msgid "reference to uninitialized field `$%ld'"
msgstr ""
-#: eval.c:1256
+#: eval.c:1269
#, c-format
msgid "function `%s' called with more arguments than declared"
msgstr ""
-#: eval.c:1437
+#: eval.c:1464
#, c-format
msgid "unwind_stack: unexpected type `%s'"
msgstr ""
-#: eval.c:1532
+#: eval.c:1558
msgid "division by zero attempted in `/='"
msgstr ""
-#: eval.c:1539
+#: eval.c:1565
#, c-format
msgid "division by zero attempted in `%%='"
msgstr ""
-#: eval.c:1876 eval.c:2122
-#, c-format
-msgid "attempt to use array `%s[\"%.*s\"]' in a scalar context"
+#: ext.c:49
+msgid "extensions are not allowed in sandbox mode"
msgstr ""
-#: eval.c:1907
-msgid "assignment used in conditional context"
+#: ext.c:52
+msgid "-l / @load are gawk extensions"
msgstr ""
-#: eval.c:1911
-msgid "statement has no effect"
+#: ext.c:55
+msgid "load_ext: received NULL lib_name"
msgstr ""
-#: eval.c:2343
+#: ext.c:58
#, c-format
-msgid "for loop: array `%s' changed size from %ld to %ld during loop execution"
+msgid "load_ext: cannot open library `%s' (%s)\n"
msgstr ""
-#: eval.c:2458
+#: ext.c:64
#, c-format
-msgid "function called indirectly through `%s' does not exist"
+msgid ""
+"load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n"
msgstr ""
-#: eval.c:2470
+#: ext.c:70
#, c-format
-msgid "function `%s' not defined"
+msgid "load_ext: library `%s': cannot call function `%s' (%s)\n"
msgstr ""
-#: eval.c:2511
+#: ext.c:74
#, c-format
-msgid "non-redirected `getline' invalid inside `%s' rule"
+msgid "load_ext: library `%s' initialization routine `%s' failed\n"
+msgstr ""
+
+#: ext.c:93
+msgid "make_builtin: missing function name"
msgstr ""
-#: eval.c:2600
+#: ext.c:98
#, c-format
-msgid "error reading input file `%s': %s"
+msgid "make_builtin: illegal character `%c' in function name `%s'"
msgstr ""
-#: eval.c:2614
+#: ext.c:106
#, c-format
-msgid "`nextfile' cannot be called from a `%s' rule"
+msgid "make_builtin: can't redefine function `%s'"
msgstr ""
-#: eval.c:2661
-msgid "`exit' cannot be called in the current context"
+#: ext.c:110
+#, c-format
+msgid "make_builtin: function `%s' already defined"
msgstr ""
-#: eval.c:2700
+#: ext.c:114
#, c-format
-msgid "`next' cannot be called from a `%s' rule"
+msgid "make_builtin: function name `%s' previously defined"
msgstr ""
-#: eval.c:2766
+#: ext.c:116
#, c-format
-msgid "Sorry, don't know how to interpret `%s'"
+msgid "make_builtin: can't use gawk built-in `%s' as function name"
msgstr ""
-#: ext.c:54
-msgid "extensions are not allowed in sandbox mode"
+#: ext.c:119
+#, c-format
+msgid "make_builtin: negative argument count for function `%s'"
msgstr ""
-#: ext.c:60 ext.c:65
-msgid "`extension' is a gawk extension"
+#: ext.c:183
+#, c-format
+msgid "function `%s' defined to take no more than %d argument(s)"
msgstr ""
-#: ext.c:75
+#: ext.c:186
#, c-format
-msgid "fatal: extension: cannot open `%s' (%s)\n"
+msgid "function `%s': missing argument #%d"
msgstr ""
-#: ext.c:84
+#: ext.c:203
#, c-format
-msgid ""
-"fatal: extension: library `%s': does not define "
-"`plugin_is_GPL_compatible' (%s)\n"
+msgid "function `%s': argument #%d: attempt to use scalar as an array"
msgstr ""
-#: ext.c:93
+#: ext.c:207
#, c-format
-msgid "fatal: extension: library `%s': cannot call function `%s' (%s)\n"
+msgid "function `%s': argument #%d: attempt to use array as a scalar"
msgstr ""
-#: ext.c:127
-msgid "extension: missing function name"
+#: ext.c:221
+msgid "dynamic loading of library not supported"
msgstr ""
-#: ext.c:132
-#, c-format
-msgid "extension: illegal character `%c' in function name `%s'"
+#: extension/filefuncs.c:75
+msgid "chdir: called with incorrect number of arguments, expecting 1"
+msgstr ""
+
+#: extension/filefuncs.c:348
+msgid "stat: called with wrong number of arguments"
msgstr ""
-#: ext.c:141
+#: extension/filefuncs.c:355
+msgid "stat: bad parameters"
+msgstr ""
+
+#: extension/filefuncs.c:421
+msgid "fill_stat_element: could not create array"
+msgstr ""
+
+#: extension/filefuncs.c:430
+msgid "fill_stat_element: could not set element"
+msgstr ""
+
+#: extension/filefuncs.c:445
+msgid "fill_path_element: could not set element"
+msgstr ""
+
+#: extension/filefuncs.c:461
+msgid "fill_error_element: could not set element"
+msgstr ""
+
+#: extension/filefuncs.c:508 extension/filefuncs.c:555
+msgid "fts-process: could not create array"
+msgstr ""
+
+#: extension/filefuncs.c:518 extension/filefuncs.c:565
+#: extension/filefuncs.c:583
+msgid "fts-process: could not set element"
+msgstr ""
+
+#: extension/filefuncs.c:632
+msgid "fts: called with incorrect number of arguments, expecting 3"
+msgstr ""
+
+#: extension/filefuncs.c:635
+msgid "fts: bad first parameter"
+msgstr ""
+
+#: extension/filefuncs.c:641
+msgid "fts: bad second parameter"
+msgstr ""
+
+#: extension/filefuncs.c:647
+msgid "fts: bad third parameter"
+msgstr ""
+
+#: extension/filefuncs.c:654
+msgid "fts: could not flatten array\n"
+msgstr ""
+
+#: extension/filefuncs.c:672
+msgid "fts: ignoring sneaky FTS_NOSTAT flag. nyah, nyah, nyah."
+msgstr ""
+
+#: extension/filefuncs.c:689
+msgid "fts: clear_array failed\n"
+msgstr ""
+
+#: extension/fnmatch.c:91
+msgid "fnmatch: called with less than three arguments"
+msgstr ""
+
+#: extension/fnmatch.c:94
+msgid "fnmatch: called with more than three arguments"
+msgstr ""
+
+#: extension/fnmatch.c:97
+msgid "fnmatch: could not get first argument"
+msgstr ""
+
+#: extension/fnmatch.c:102
+msgid "fnmatch: could not get second argument"
+msgstr ""
+
+#: extension/fnmatch.c:107
+msgid "fnmatch: could not get third argument"
+msgstr ""
+
+#: extension/fnmatch.c:120
+msgid "fnmatch is not implemented on this system\n"
+msgstr ""
+
+#: extension/fnmatch.c:152
+msgid "fnmatch init: could not add FNM_NOMATCH variable"
+msgstr ""
+
+#: extension/fnmatch.c:162
#, c-format
-msgid "extension: can't redefine function `%s'"
+msgid "fnmatch init: could not set array element %s"
+msgstr ""
+
+#: extension/fnmatch.c:172
+msgid "fnmatch init: could not install FNM array"
+msgstr ""
+
+#: extension/fork.c:81
+msgid "fork: called with too many arguments"
+msgstr ""
+
+#: extension/fork.c:94
+msgid "fork: PROCINFO is not an array!"
msgstr ""
-#: ext.c:145
+#: extension/fork.c:118
+msgid "waitpid: called with too many arguments"
+msgstr ""
+
+#: extension/fork.c:126
+msgid "wait: called with no arguments"
+msgstr ""
+
+#: extension/fork.c:143
+msgid "wait: called with too many arguments"
+msgstr ""
+
+#: extension/ordchr.c:69
+msgid "ord: called with too many arguments"
+msgstr ""
+
+#: extension/ordchr.c:75
+msgid "ord: called with no arguments"
+msgstr ""
+
+#: extension/ordchr.c:77
+msgid "ord: called with inappropriate argument(s)"
+msgstr ""
+
+#: extension/ordchr.c:99
+msgid "chr: called with too many arguments"
+msgstr ""
+
+#: extension/ordchr.c:109
+msgid "chr: called with no arguments"
+msgstr ""
+
+#: extension/ordchr.c:111
+msgid "chr: called with inappropriate argument(s)"
+msgstr ""
+
+#: extension/readfile.c:81
+msgid "readfile: called with too many arguments"
+msgstr ""
+
+#: extension/readfile.c:114
+msgid "readfile: called with no arguments"
+msgstr ""
+
+#: extension/rwarray.c:120
+msgid "writea: called with too many arguments"
+msgstr ""
+
+#: extension/rwarray.c:127
#, c-format
-msgid "extension: function `%s' already defined"
+msgid "do_writea: argument 0 is not a string\n"
msgstr ""
-#: ext.c:150
+#: extension/rwarray.c:133
#, c-format
-msgid "extension: function name `%s' previously defined"
+msgid "do_writea: argument 1 is not an array\n"
msgstr ""
-#: ext.c:152
+#: extension/rwarray.c:180
#, c-format
-msgid "extension: can't use gawk built-in `%s' as function name"
+msgid "write_array: could not flatten array\n"
msgstr ""
-#: ext.c:156
+#: extension/rwarray.c:194
#, c-format
-msgid "make_builtin: negative argument count for function `%s'"
+msgid "write_array: could not release flattened array\n"
+msgstr ""
+
+#: extension/rwarray.c:276
+msgid "reada: called with too many arguments"
msgstr ""
-#: ext.c:259
+#: extension/rwarray.c:283
#, c-format
-msgid "function `%s' defined to take no more than %d argument(s)"
+msgid "do_reada: argument 0 is not a string\n"
msgstr ""
-#: ext.c:262
+#: extension/rwarray.c:289
#, c-format
-msgid "function `%s': missing argument #%d"
+msgid "do_reada: argument 1 is not an array\n"
msgstr ""
-#: ext.c:279
+#: extension/rwarray.c:333
#, c-format
-msgid "function `%s': argument #%d: attempt to use scalar as an array"
+msgid "do_reada: clear_array failed\n"
msgstr ""
-#: ext.c:283
+#: extension/rwarray.c:370
#, c-format
-msgid "function `%s': argument #%d: attempt to use array as a scalar"
+msgid "read_array: set_array_element failed\n"
+msgstr ""
+
+#: extension/time.c:78
+msgid "gettimeofday: ignoring arguments"
+msgstr ""
+
+#: extension/time.c:109
+msgid "gettimeofday: not supported on this platform"
+msgstr ""
+
+#: extension/time.c:130
+msgid "sleep: called with too many arguments"
+msgstr ""
+
+#: extension/time.c:133
+msgid "sleep: missing required numeric argument"
msgstr ""
-#: ext.c:296
-msgid "Operation Not Supported"
+#: extension/time.c:139
+msgid "sleep: argument is negative"
msgstr ""
-#: field.c:328
+#: extension/time.c:166
+msgid "sleep: not supported on this platform"
+msgstr ""
+
+#: field.c:339
msgid "NF set to negative value"
msgstr ""
-#: field.c:951 field.c:958 field.c:962
+#: field.c:962 field.c:969 field.c:973
msgid "split: fourth argument is a gawk extension"
msgstr ""
-#: field.c:955
+#: field.c:966
msgid "split: fourth argument is not an array"
msgstr ""
-#: field.c:969
+#: field.c:980
msgid "split: second argument is not an array"
msgstr ""
-#: field.c:973
+#: field.c:984
msgid "split: cannot use the same array for second and fourth args"
msgstr ""
-#: field.c:978
+#: field.c:989
msgid "split: cannot use a subarray of second arg for fourth arg"
msgstr ""
-#: field.c:981
+#: field.c:992
msgid "split: cannot use a subarray of fourth arg for second arg"
msgstr ""
-#: field.c:1010
+#: field.c:1021
msgid "split: null string for third arg is a gawk extension"
msgstr ""
-#: field.c:1050
+#: field.c:1061
msgid "patsplit: fourth argument is not an array"
msgstr ""
-#: field.c:1055
+#: field.c:1066
msgid "patsplit: second argument is not an array"
msgstr ""
-#: field.c:1061
+#: field.c:1072
msgid "patsplit: third argument must be non-null"
msgstr ""
-#: field.c:1065
+#: field.c:1076
msgid "patsplit: cannot use the same array for second and fourth args"
msgstr ""
-#: field.c:1070
+#: field.c:1081
msgid "patsplit: cannot use a subarray of second arg for fourth arg"
msgstr ""
-#: field.c:1073
+#: field.c:1084
msgid "patsplit: cannot use a subarray of fourth arg for second arg"
msgstr ""
-#: field.c:1110
+#: field.c:1122
msgid "`FIELDWIDTHS' is a gawk extension"
msgstr ""
-#: field.c:1173
+#: field.c:1186
#, c-format
msgid "invalid FIELDWIDTHS value, near `%s'"
msgstr ""
-#: field.c:1246
+#: field.c:1259
msgid "null string for `FS' is a gawk extension"
msgstr ""
-#: field.c:1250
+#: field.c:1263
msgid "old awk does not support regexps as value of `FS'"
msgstr ""
-#: field.c:1369
+#: field.c:1382
msgid "`FPAT' is a gawk extension"
msgstr ""
+#: gawkapi.c:143
+msgid "awk_value_to_node: received null retval"
+msgstr ""
+
+#: gawkapi.c:932
+#, c-format
+msgid "api_flatten_array: could not convert index %d\n"
+msgstr ""
+
+#: gawkapi.c:937
+#, c-format
+msgid "api_flatten_array: could not convert value %d\n"
+msgstr ""
+
+#: gawkapi.c:1111
+msgid "cannot assign to defined constant"
+msgstr ""
+
#: getopt.c:604 getopt.c:633
#, c-format
msgid "%s: option '%s' is ambiguous; possibilities:"
@@ -1295,451 +2323,512 @@ msgstr ""
msgid "%s: option '-W %s' requires an argument\n"
msgstr ""
-#: io.c:280
+#: io.c:339
#, c-format
msgid "command line argument `%s' is a directory: skipped"
msgstr ""
-#: io.c:283 io.c:385
+#: io.c:342 io.c:455
#, c-format
msgid "cannot open file `%s' for reading (%s)"
msgstr ""
-#: io.c:501
+#: io.c:582
#, c-format
msgid "close of fd %d (`%s') failed (%s)"
msgstr ""
-#: io.c:578
+#: io.c:658
msgid "redirection not allowed in sandbox mode"
msgstr ""
-#: io.c:612
+#: io.c:692
#, c-format
msgid "expression in `%s' redirection only has numeric value"
msgstr ""
-#: io.c:618
+#: io.c:698
#, c-format
msgid "expression for `%s' redirection has null string value"
msgstr ""
-#: io.c:623
+#: io.c:703
#, c-format
msgid "filename `%s' for `%s' redirection may be result of logical expression"
msgstr ""
-#: io.c:666
+#: io.c:746
#, c-format
msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
msgstr ""
-#: io.c:719
+#: io.c:799
#, c-format
msgid "can't open pipe `%s' for output (%s)"
msgstr ""
-#: io.c:729
+#: io.c:809
#, c-format
msgid "can't open pipe `%s' for input (%s)"
msgstr ""
-#: io.c:752
+#: io.c:840
#, c-format
msgid "can't open two way pipe `%s' for input/output (%s)"
msgstr ""
-#: io.c:834
+#: io.c:923
#, c-format
msgid "can't redirect from `%s' (%s)"
msgstr ""
-#: io.c:837
+#: io.c:926
#, c-format
msgid "can't redirect to `%s' (%s)"
msgstr ""
-#: io.c:888
+#: io.c:977
msgid ""
"reached system limit for open files: starting to multiplex file descriptors"
msgstr ""
-#: io.c:904
+#: io.c:993
#, c-format
msgid "close of `%s' failed (%s)."
msgstr ""
-#: io.c:912
+#: io.c:1001
msgid "too many pipes or input files open"
msgstr ""
-#: io.c:934
+#: io.c:1023
msgid "close: second argument must be `to' or `from'"
msgstr ""
-#: io.c:951
+#: io.c:1040
#, c-format
msgid "close: `%.*s' is not an open file, pipe or co-process"
msgstr ""
-#: io.c:956
+#: io.c:1045
msgid "close of redirection that was never opened"
msgstr ""
-#: io.c:1053
+#: io.c:1142
#, c-format
msgid "close: redirection `%s' not opened with `|&', second argument ignored"
msgstr ""
-#: io.c:1069
+#: io.c:1159
#, c-format
msgid "failure status (%d) on pipe close of `%s' (%s)"
msgstr ""
-#: io.c:1072
+#: io.c:1162
#, c-format
msgid "failure status (%d) on file close of `%s' (%s)"
msgstr ""
-#: io.c:1092
+#: io.c:1182
#, c-format
msgid "no explicit close of socket `%s' provided"
msgstr ""
-#: io.c:1095
+#: io.c:1185
#, c-format
msgid "no explicit close of co-process `%s' provided"
msgstr ""
-#: io.c:1098
+#: io.c:1188
#, c-format
msgid "no explicit close of pipe `%s' provided"
msgstr ""
-#: io.c:1101
+#: io.c:1191
#, c-format
msgid "no explicit close of file `%s' provided"
msgstr ""
-#: io.c:1129 io.c:1184 main.c:797 main.c:834
+#: io.c:1219 io.c:1274 main.c:847 main.c:884
#, c-format
msgid "error writing standard output (%s)"
msgstr ""
-#: io.c:1133 io.c:1189
+#: io.c:1223 io.c:1279
#, c-format
msgid "error writing standard error (%s)"
msgstr ""
-#: io.c:1141
+#: io.c:1231
#, c-format
msgid "pipe flush of `%s' failed (%s)."
msgstr ""
-#: io.c:1144
+#: io.c:1234
#, c-format
msgid "co-process flush of pipe to `%s' failed (%s)."
msgstr ""
-#: io.c:1147
+#: io.c:1237
#, c-format
msgid "file flush of `%s' failed (%s)."
msgstr ""
-#: io.c:1262
+#: io.c:1351
#, c-format
msgid "local port %s invalid in `/inet'"
msgstr ""
-#: io.c:1279
+#: io.c:1369
#, c-format
msgid "remote host and port information (%s, %s) invalid"
msgstr ""
-#: io.c:1431
+#: io.c:1521
#, c-format
msgid "no (known) protocol supplied in special filename `%s'"
msgstr ""
-#: io.c:1445
+#: io.c:1535
#, c-format
msgid "special file name `%s' is incomplete"
msgstr ""
-#: io.c:1462
+#: io.c:1552
msgid "must supply a remote hostname to `/inet'"
msgstr ""
-#: io.c:1480
+#: io.c:1570
msgid "must supply a remote port to `/inet'"
msgstr ""
-#: io.c:1526
+#: io.c:1616
msgid "TCP/IP communications are not supported"
msgstr ""
-#: io.c:1693
+#: io.c:1785
#, c-format
msgid "could not open `%s', mode `%s'"
msgstr ""
-#: io.c:1747
+#: io.c:1835
#, c-format
msgid "close of master pty failed (%s)"
msgstr ""
-#: io.c:1749 io.c:1917 io.c:2074
+#: io.c:1837 io.c:2012 io.c:2181
#, c-format
msgid "close of stdout in child failed (%s)"
msgstr ""
-#: io.c:1752
+#: io.c:1840
#, c-format
msgid "moving slave pty to stdout in child failed (dup: %s)"
msgstr ""
-#: io.c:1754 io.c:1922
+#: io.c:1842 io.c:2017
#, c-format
msgid "close of stdin in child failed (%s)"
msgstr ""
-#: io.c:1757
+#: io.c:1845
#, c-format
msgid "moving slave pty to stdin in child failed (dup: %s)"
msgstr ""
-#: io.c:1759 io.c:1780
+#: io.c:1847 io.c:1868
#, c-format
msgid "close of slave pty failed (%s)"
msgstr ""
-#: io.c:1858 io.c:1920 io.c:2052 io.c:2077
+#: io.c:1953 io.c:2015 io.c:2158 io.c:2184
#, c-format
msgid "moving pipe to stdout in child failed (dup: %s)"
msgstr ""
-#: io.c:1865 io.c:1925
+#: io.c:1960 io.c:2020
#, c-format
msgid "moving pipe to stdin in child failed (dup: %s)"
msgstr ""
-#: io.c:1885 io.c:2067
+#: io.c:1980 io.c:2174
msgid "restoring stdout in parent process failed\n"
msgstr ""
-#: io.c:1893
+#: io.c:1988
msgid "restoring stdin in parent process failed\n"
msgstr ""
-#: io.c:1928 io.c:2079 io.c:2093
+#: io.c:2023 io.c:2186 io.c:2200
#, c-format
msgid "close of pipe failed (%s)"
msgstr ""
-#: io.c:1973
+#: io.c:2076
msgid "`|&' not supported"
msgstr ""
-#: io.c:2039
+#: io.c:2143
#, c-format
msgid "cannot open pipe `%s' (%s)"
msgstr ""
-#: io.c:2087
+#: io.c:2194
#, c-format
msgid "cannot create child process for `%s' (fork: %s)"
msgstr ""
-#: io.c:2520
+#: io.c:2652
+msgid "register_input_parser: received NULL pointer"
+msgstr ""
+
+#: io.c:2680
+#, c-format
+msgid "input parser `%s' conflicts with previously installed input parser `%s'"
+msgstr ""
+
+#: io.c:2687
+#, c-format
+msgid "input parser `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2707
+msgid "register_output_wrapper: received NULL pointer"
+msgstr ""
+
+#: io.c:2735
+#, c-format
+msgid ""
+"output wrapper `%s' conflicts with previously installed output wrapper `%s'"
+msgstr ""
+
+#: io.c:2742
+#, c-format
+msgid "output wrapper `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2763
+msgid "register_output_processor: received NULL pointer"
+msgstr ""
+
+#: io.c:2792
+#, c-format
+msgid ""
+"two-way processor `%s' conflicts with previously installed two-way processor "
+"`%s'"
+msgstr ""
+
+#: io.c:2801
+#, c-format
+msgid "two way processor `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2908
#, c-format
msgid "data file `%s' is empty"
msgstr ""
-#: io.c:2561 io.c:2569
+#: io.c:2950 io.c:2958
msgid "could not allocate more input memory"
msgstr ""
-#: io.c:3127
+#: io.c:3524
msgid "multicharacter value of `RS' is a gawk extension"
msgstr ""
-#: io.c:3232
+#: io.c:3613
msgid "IPv6 communication is not supported"
msgstr ""
-#: main.c:366
+#: main.c:362
msgid "`-m[fr]' option irrelevant in gawk"
msgstr ""
-#: main.c:368
+#: main.c:364
msgid "-m option usage: `-m[fr] nnn'"
msgstr ""
-#: main.c:391
+#: main.c:393
msgid "empty argument to `-e/--source' ignored"
msgstr ""
-#: main.c:462
+#: main.c:483
#, c-format
msgid "%s: option `-W %s' unrecognized, ignored\n"
msgstr ""
-#: main.c:515
+#: main.c:529
#, c-format
msgid "%s: option requires an argument -- %c\n"
msgstr ""
-#: main.c:536
+#: main.c:550
msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
msgstr ""
-#: main.c:542
+#: main.c:556
msgid "`--posix' overrides `--traditional'"
msgstr ""
-#: main.c:553
+#: main.c:567
msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
msgstr ""
-#: main.c:557
+#: main.c:571
#, c-format
msgid "running %s setuid root may be a security problem"
msgstr ""
-#: main.c:562
+#: main.c:576
msgid "`--posix' overrides `--characters-as-bytes'"
msgstr ""
-#: main.c:616
+#: main.c:635
#, c-format
msgid "can't set binary mode on stdin (%s)"
msgstr ""
-#: main.c:619
+#: main.c:638
#, c-format
msgid "can't set binary mode on stdout (%s)"
msgstr ""
-#: main.c:621
+#: main.c:640
#, c-format
msgid "can't set binary mode on stderr (%s)"
msgstr ""
-#: main.c:660
+#: main.c:698
msgid "no program text at all!"
msgstr ""
-#: main.c:737
+#: main.c:784
#, c-format
msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"
msgstr ""
-#: main.c:739
+#: main.c:786
#, c-format
msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"
msgstr ""
-#: main.c:744
+#: main.c:791
msgid "POSIX options:\t\tGNU long options: (standard)\n"
msgstr ""
-#: main.c:745
+#: main.c:792
msgid "\t-f progfile\t\t--file=progfile\n"
msgstr ""
-#: main.c:746
+#: main.c:793
msgid "\t-F fs\t\t\t--field-separator=fs\n"
msgstr ""
-#: main.c:747
+#: main.c:794
msgid "\t-v var=val\t\t--assign=var=val\n"
msgstr ""
-#: main.c:748
+#: main.c:795
msgid "Short options:\t\tGNU long options: (extensions)\n"
msgstr ""
-#: main.c:749
+#: main.c:796
msgid "\t-b\t\t\t--characters-as-bytes\n"
msgstr ""
-#: main.c:750
+#: main.c:797
msgid "\t-c\t\t\t--traditional\n"
msgstr ""
-#: main.c:751
+#: main.c:798
msgid "\t-C\t\t\t--copyright\n"
msgstr ""
-#: main.c:752
+#: main.c:799
msgid "\t-d[file]\t\t--dump-variables[=file]\n"
msgstr ""
-#: main.c:753
+#: main.c:800
+msgid "\t-D[file]\t\t--debug[=file]\n"
+msgstr ""
+
+#: main.c:801
msgid "\t-e 'program-text'\t--source='program-text'\n"
msgstr ""
-#: main.c:754
+#: main.c:802
msgid "\t-E file\t\t\t--exec=file\n"
msgstr ""
-#: main.c:755
+#: main.c:803
msgid "\t-g\t\t\t--gen-pot\n"
msgstr ""
-#: main.c:756
+#: main.c:804
msgid "\t-h\t\t\t--help\n"
msgstr ""
-#: main.c:757
+#: main.c:805
+msgid "\t-i includefile\t\t--include=includefile\n"
+msgstr ""
+
+#: main.c:806
+msgid "\t-l library\t\t--load=library\n"
+msgstr ""
+
+#: main.c:807
msgid "\t-L [fatal]\t\t--lint[=fatal]\n"
msgstr ""
-#: main.c:758
+#: main.c:808
msgid "\t-n\t\t\t--non-decimal-data\n"
msgstr ""
-#: main.c:759
+#: main.c:809
+msgid "\t-M\t\t\t--bignum\n"
+msgstr ""
+
+#: main.c:810
msgid "\t-N\t\t\t--use-lc-numeric\n"
msgstr ""
-#: main.c:760
+#: main.c:811
+msgid "\t-o[file]\t\t--pretty-print[=file]\n"
+msgstr ""
+
+#: main.c:812
msgid "\t-O\t\t\t--optimize\n"
msgstr ""
-#: main.c:761
+#: main.c:813
msgid "\t-p[file]\t\t--profile[=file]\n"
msgstr ""
-#: main.c:762
+#: main.c:814
msgid "\t-P\t\t\t--posix\n"
msgstr ""
-#: main.c:763
+#: main.c:815
msgid "\t-r\t\t\t--re-interval\n"
msgstr ""
-#: main.c:765
-msgid "\t-R file\t\t\t--command=file\n"
-msgstr ""
-
-#: main.c:766
+#: main.c:816
msgid "\t-S\t\t\t--sandbox\n"
msgstr ""
-#: main.c:767
+#: main.c:817
msgid "\t-t\t\t\t--lint-old\n"
msgstr ""
-#: main.c:768
+#: main.c:818
msgid "\t-V\t\t\t--version\n"
msgstr ""
-#: main.c:770
+#: main.c:820
msgid "\t-W nostalgia\t\t--nostalgia\n"
msgstr ""
-#: main.c:773
+#: main.c:823
msgid "\t-Y\t\t--parsedebug\n"
msgstr ""
@@ -1748,7 +2837,7 @@ msgstr ""
#. for this application. Please add _another line_ with the
#. address for translation bugs.
#. no-wrap
-#: main.c:782
+#: main.c:832
msgid ""
"\n"
"To report bugs, see node `Bugs' in `gawk.info', which is\n"
@@ -1756,21 +2845,21 @@ msgid ""
"\n"
msgstr ""
-#: main.c:786
+#: main.c:836
msgid ""
"gawk is a pattern scanning and processing language.\n"
"By default it reads standard input and writes standard output.\n"
"\n"
msgstr ""
-#: main.c:790
+#: main.c:840
msgid ""
"Examples:\n"
"\tgawk '{ sum += $1 }; END { print sum }' file\n"
"\tgawk -F: '{ print $1 }' /etc/passwd\n"
msgstr ""
-#: main.c:810
+#: main.c:860
#, c-format
msgid ""
"Copyright (C) 1989, 1991-%d Free Software Foundation.\n"
@@ -1782,7 +2871,7 @@ msgid ""
"\n"
msgstr ""
-#: main.c:818
+#: main.c:868
msgid ""
"This program is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
@@ -1791,179 +2880,243 @@ msgid ""
"\n"
msgstr ""
-#: main.c:824
+#: main.c:874
msgid ""
"You should have received a copy of the GNU General Public License\n"
"along with this program. If not, see http://www.gnu.org/licenses/.\n"
msgstr ""
-#: main.c:859
+#: main.c:909
msgid "-Ft does not set FS to tab in POSIX awk"
msgstr ""
-#: main.c:1093
+#: main.c:1169
#, c-format
msgid "unknown value for field spec: %d\n"
msgstr ""
-#: main.c:1174
+#: main.c:1267
#, c-format
msgid ""
"%s: `%s' argument to `-v' not in `var=value' form\n"
"\n"
msgstr ""
-#: main.c:1200
+#: main.c:1293
#, c-format
msgid "`%s' is not a legal variable name"
msgstr ""
-#: main.c:1203
+#: main.c:1296
#, c-format
msgid "`%s' is not a variable name, looking for file `%s=%s'"
msgstr ""
-#: main.c:1207
+#: main.c:1300
#, c-format
msgid "cannot use gawk builtin `%s' as variable name"
msgstr ""
-#: main.c:1212
+#: main.c:1305
#, c-format
msgid "cannot use function `%s' as variable name"
msgstr ""
-#: main.c:1265
+#: main.c:1358
msgid "floating point exception"
msgstr ""
-#: main.c:1272
+#: main.c:1365
msgid "fatal error: internal error"
msgstr ""
-#: main.c:1287
+#: main.c:1380
msgid "fatal error: internal error: segfault"
msgstr ""
-#: main.c:1299
+#: main.c:1392
msgid "fatal error: internal error: stack overflow"
msgstr ""
-#: main.c:1349
+#: main.c:1448
#, c-format
msgid "no pre-opened fd %d"
msgstr ""
-#: main.c:1356
+#: main.c:1455
#, c-format
msgid "could not pre-open /dev/null for fd %d"
msgstr ""
-#: msg.c:63
+#: mpfr.c:563
#, c-format
-msgid "cmd. line:"
+msgid "PREC value `%.*s' is invalid"
msgstr ""
-#: msg.c:107
-msgid "error: "
+#: mpfr.c:621
+#, c-format
+msgid "RNDMODE value `%.*s' is invalid"
+msgstr ""
+
+#: mpfr.c:711
+#, c-format
+msgid "%s: received non-numeric argument"
+msgstr ""
+
+#: mpfr.c:813
+msgid "compl(%Rg): negative value will give strange results"
+msgstr ""
+
+#: mpfr.c:817
+msgid "comp(%Rg): fractional value will be truncated"
+msgstr ""
+
+#: mpfr.c:829
+#, c-format
+msgid "cmpl(%Zd): negative values will give strange results"
+msgstr ""
+
+#: mpfr.c:856
+#, c-format
+msgid "%s: received non-numeric first argument"
+msgstr ""
+
+#: mpfr.c:858
+#, c-format
+msgid "%s: received non-numeric second argument"
+msgstr ""
+
+#: mpfr.c:877
+msgid "%s(%Rg, ..): negative values will give strange results"
+msgstr ""
+
+#: mpfr.c:882
+msgid "%s(%Rg, ..): fractional values will be truncated"
msgstr ""
-#: node.c:406
+#: mpfr.c:895
+#, c-format
+msgid "%s(%Zd, ..): negative values will give strange results"
+msgstr ""
+
+#: mpfr.c:914
+msgid "%s(.., %Rg): negative values will give strange results"
+msgstr ""
+
+#: mpfr.c:919
+msgid "%s(.., %Rg): fractional values will be truncated"
+msgstr ""
+
+#: mpfr.c:932
+#, c-format
+msgid "%s(.., %Zd): negative values will give strange results"
+msgstr ""
+
+#: msg.c:61
+#, c-format
+msgid "cmd. line:"
+msgstr ""
+
+#: node.c:436
msgid "backslash at end of string"
msgstr ""
-#: node.c:517
+#: node.c:520
#, c-format
msgid "old awk does not support the `\\%c' escape sequence"
msgstr ""
-#: node.c:568
+#: node.c:571
msgid "POSIX does not allow `\\x' escapes"
msgstr ""
-#: node.c:574
+#: node.c:577
msgid "no hex digits in `\\x' escape sequence"
msgstr ""
-#: node.c:596
+#: node.c:599
#, c-format
msgid ""
"hex escape \\x%.*s of %d characters probably not interpreted the way you "
"expect"
msgstr ""
-#: node.c:611
+#: node.c:614
#, c-format
msgid "escape sequence `\\%c' treated as plain `%c'"
msgstr ""
-#: node.c:750
+#: node.c:759
msgid ""
"Invalid multibyte data detected. There may be a mismatch between your data "
"and your locale."
msgstr ""
-#: posix/gawkmisc.c:176
+#: posix/gawkmisc.c:177
#, c-format
msgid "%s %s `%s': could not get fd flags: (fcntl F_GETFD: %s)"
msgstr ""
-#: posix/gawkmisc.c:188
+#: posix/gawkmisc.c:189
#, c-format
msgid "%s %s `%s': could not set close-on-exec: (fcntl F_SETFD: %s)"
msgstr ""
-#: profile.c:83
+#: profile.c:70
#, c-format
msgid "could not open `%s' for writing: %s"
msgstr ""
-#: profile.c:85
+#: profile.c:72
msgid "sending profile to standard error"
msgstr ""
-#: profile.c:203
+#: profile.c:188
#, c-format
msgid ""
"\t# %s block(s)\n"
"\n"
msgstr ""
-#: profile.c:208
+#: profile.c:193
#, c-format
msgid ""
"\t# Rule(s)\n"
"\n"
msgstr ""
-#: profile.c:279
+#: profile.c:267
#, c-format
msgid "internal error: %s with null vname"
msgstr ""
-#: profile.c:952
+#: profile.c:529
+msgid "internal error: builtin with null fname"
+msgstr ""
+
+#: profile.c:944
#, c-format
msgid "\t# gawk profile, created %s\n"
msgstr ""
-#: profile.c:1331
+#: profile.c:1329
#, c-format
msgid ""
"\n"
"\t# Functions, listed alphabetically\n"
msgstr ""
-#: profile.c:1370
+#: profile.c:1367
#, c-format
msgid "redir2str: unknown redirection type %d"
msgstr ""
-#: re.c:573
+#: re.c:568
#, c-format
msgid "range of the form `[%c-%c]' is locale dependent"
msgstr ""
-#: re.c:600
+#: re.c:595
#, c-format
msgid "regexp component `%.*s' should probably be `[%.*s]'"
msgstr ""
@@ -2008,10 +3161,6 @@ msgstr ""
msgid "Unmatched \\{"
msgstr ""
-#: regcomp.c:161
-msgid "Invalid content of \\{\\}"
-msgstr ""
-
#: regcomp.c:164
msgid "Invalid range end"
msgstr ""
@@ -2028,10 +3177,6 @@ msgstr ""
msgid "Premature end of regular expression"
msgstr ""
-#: regcomp.c:176
-msgid "Regular expression too big"
-msgstr ""
-
#: regcomp.c:179
msgid "Unmatched ) or \\)"
msgstr ""
@@ -2039,3 +3184,7 @@ msgstr ""
#: regcomp.c:700
msgid "No previous regular expression"
msgstr ""
+
+#: symbol.c:722
+msgid "can not pop main context"
+msgstr ""
diff --git a/po/he.gmo b/po/he.gmo
deleted file mode 100644
index b9cb6d3c..00000000
--- a/po/he.gmo
+++ /dev/null
Binary files differ
diff --git a/po/id.gmo b/po/id.gmo
deleted file mode 100644
index 272d5f8c..00000000
--- a/po/id.gmo
+++ /dev/null
Binary files differ
diff --git a/po/it.gmo b/po/it.gmo
index 20c68ebf..1fb10dab 100644
--- a/po/it.gmo
+++ b/po/it.gmo
Binary files differ
diff --git a/po/it.po b/po/it.po
index 3d2e434d..9ea9ab66 100644
--- a/po/it.po
+++ b/po/it.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gawk 3.1.81\n"
"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
-"POT-Creation-Date: 2012-10-13 20:24+0200\n"
+"POT-Creation-Date: 2012-10-13 21:21+0200\n"
"PO-Revision-Date: 2012-05-08 16:11+0100\n"
"Last-Translator: Antonio Colombo <azc100@gmail.com>\n"
"Language-Team: Italian <it@li.org>\n"
@@ -15,505 +15,495 @@ msgstr ""
"Content-Type: text/plain; charset=ISO-8859-1\n"
"Content-Transfer-Encoding: 8-bit\n"
-#: array.c:140
+#: array.c:266
#, c-format
msgid "from %s"
msgstr "da %s"
-#: array.c:248
+#: array.c:366
msgid "attempt to use a scalar value as array"
msgstr "tentativo di usare valore scalare come vettore"
-#: array.c:251
-#, fuzzy, c-format
-msgid "attempt to use function `%s' as an array"
-msgstr "tentativo di usare scalare '%s' come vettore"
-
-#: array.c:254
+#: array.c:368
#, c-format
msgid "attempt to use scalar parameter `%s' as an array"
msgstr "tentativo di usare il parametro scalare `%s' come un vettore"
-#: array.c:257
+#: array.c:371
#, c-format
msgid "attempt to use scalar `%s' as an array"
msgstr "tentativo di usare scalare '%s' come vettore"
-#: array.c:302 array.c:707 builtin.c:84 builtin.c:1385 builtin.c:1427
-#: builtin.c:1440 builtin.c:1859 builtin.c:1871 eval.c:1135 eval.c:1139
-#: eval.c:1495 eval.c:1812
+#: array.c:418 array.c:584 builtin.c:85 builtin.c:1566 builtin.c:1608
+#: builtin.c:1621 builtin.c:2047 builtin.c:2059 eval.c:1121 eval.c:1125
+#: eval.c:1520
#, c-format
msgid "attempt to use array `%s' in a scalar context"
msgstr "tentativo di usare vettore `%s' in un contesto scalare"
-#: array.c:513
-#, fuzzy, c-format
-msgid "reference to uninitialized element `%s[\"%.*s\"]'"
-msgstr "riferimento ad argomento non inizializzato `%s'"
-
-#: array.c:519
-#, c-format
-msgid "subscript of array `%s' is null string"
-msgstr ""
-
-#: array.c:723
+#: array.c:591
#, c-format
msgid "delete: index `%s' not in array `%s'"
msgstr "delete: indice `%s' non presente nel vettore `%s'"
-#: array.c:734 eval.c:1865
+#: array.c:605
#, c-format
msgid "attempt to use scalar `%s[\"%.*s\"]' as an array"
msgstr "tentativo di usare scalare`%s[\"%.*s\"]' come vettore"
-#: array.c:910
-#, c-format
-msgid "%s: empty (null)\n"
-msgstr ""
-
-#: array.c:915
-#, c-format
-msgid "%s: empty (zero)\n"
-msgstr ""
-
-#: array.c:919
-#, c-format
-msgid "%s: table_size = %d, array_size = %d\n"
-msgstr ""
-
-#: array.c:954
-#, c-format
-msgid "%s: is parameter\n"
-msgstr ""
-
-#: array.c:958
-#, c-format
-msgid "%s: array_ref to %s\n"
-msgstr ""
-
-#: array.c:963
+#: array.c:784
#, fuzzy
-msgid "adump: argument not an array"
+msgid "adump: first argument not an array"
msgstr "adump: il primo argomento non è un vettore"
-#: array.c:1086
+#: array.c:823
msgid "asort: second argument not an array"
msgstr "asort: il secondo argomento non è un vettore"
-#: array.c:1087
+#: array.c:824
msgid "asorti: second argument not an array"
msgstr "asorti: il secondo argomento non è un vettore"
-#: array.c:1094
+#: array.c:831
msgid "asort: first argument not an array"
msgstr "asort: il primo argomento non è un vettore"
-#: array.c:1095
+#: array.c:832
msgid "asorti: first argument not an array"
msgstr "asorti: il primo argomento non è un vettore"
-#: array.c:1102
+#: array.c:839
msgid "asort: cannot use a subarray of first arg for second arg"
msgstr ""
"asort: non permesso un secondo argomento che sia un sottovettore del primo "
"argomento"
-#: array.c:1103
+#: array.c:840
msgid "asorti: cannot use a subarray of first arg for second arg"
msgstr ""
"asorti: non permesso un secondo argomento che sia un sottovettore del primo "
"argomento"
-#: array.c:1108
+#: array.c:845
msgid "asort: cannot use a subarray of second arg for first arg"
msgstr ""
"asort: non permesso un primo argomento che sia un sottovettore del secondo "
"argomento"
-#: array.c:1109
+#: array.c:846
msgid "asorti: cannot use a subarray of second arg for first arg"
msgstr ""
"asorti: non permesso un primo argomento che sia un sottovettore del secondo "
"argomento"
-#: array.c:1655
+#: array.c:1314
#, c-format
msgid "`%s' is invalid as a function name"
msgstr "`%s' non è un nome funzione valido"
-#: array.c:1659
+#: array.c:1318
#, c-format
msgid "sort comparison function `%s' is not defined"
msgstr "funzione di confronto del sort `%s' non definita"
-#: awkgram.y:249
+#: awkgram.y:223
#, c-format
msgid "%s blocks must have an action part"
msgstr "blocchi %s richiedono una 'azione'"
-#: awkgram.y:252
+#: awkgram.y:226
msgid "each rule must have a pattern or an action part"
msgstr "ogni regola deve avere una parte 'espressione' o una parte 'azione'"
-#: awkgram.y:323 awkgram.y:334
+#: awkgram.y:315 awkgram.y:326
msgid "old awk does not support multiple `BEGIN' or `END' rules"
msgstr "il vecchio awk non supporta più di una regola `BEGIN' o `END'"
-#: awkgram.y:371
+#: awkgram.y:363
#, c-format
msgid "`%s' is a built-in function, it cannot be redefined"
msgstr "`%s' è una funzione interna, non si può ridefinire"
-#: awkgram.y:432
+#: awkgram.y:409
msgid "regexp constant `//' looks like a C++ comment, but is not"
msgstr "espressione regolare costante `//' sembra un commento C++, ma non lo è"
-#: awkgram.y:436
+#: awkgram.y:413
#, c-format
msgid "regexp constant `/%s/' looks like a C comment, but is not"
msgstr "espressione regolare costante `/%s/' sembra un commento C, ma non lo è"
-#: awkgram.y:528
+#: awkgram.y:505
#, c-format
msgid "duplicate case values in switch body: %s"
msgstr "valori di 'case' doppi all'interno di uno 'switch': %s"
-#: awkgram.y:549
+#: awkgram.y:526
msgid "duplicate `default' detected in switch body"
msgstr "valori di default doppi all'interno di uno 'switch'"
-#: awkgram.y:809
+#: awkgram.y:786
msgid "`break' is not allowed outside a loop or switch"
msgstr "`break' non permesso fuori da un ciclo o da uno 'switch'"
-#: awkgram.y:818
+#: awkgram.y:795
msgid "`continue' is not allowed outside a loop"
msgstr "`continue' non permesso fuori da un un ciclo"
-#: awkgram.y:828
+#: awkgram.y:805
#, c-format
msgid "`next' used in %s action"
msgstr "`next' usato in 'azione' %s"
-#: awkgram.y:837
+#: awkgram.y:814
#, c-format
msgid "`nextfile' used in %s action"
msgstr "`nextfile' usato in 'azione' %s"
-#: awkgram.y:861
+#: awkgram.y:838
msgid "`return' used outside function context"
msgstr "`return' usato fuori da una funzione"
-#: awkgram.y:921
+#: awkgram.y:912
msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'"
msgstr "`print' da solo in BEGIN o END dovrebbe forse essere `print \"\"'"
-#: awkgram.y:1016 awkgram.y:1020
+#: awkgram.y:978 awkgram.y:1027
+msgid "`delete' is not allowed with SYMTAB"
+msgstr ""
+
+#: awkgram.y:980 awkgram.y:1029
+msgid "`delete' is not allowed with FUNCTAB"
+msgstr ""
+
+#: awkgram.y:1014 awkgram.y:1018
msgid "`delete(array)' is a non-portable tawk extension"
msgstr "`delete(array)' è un'estensione tawk non-portabile"
-#: awkgram.y:1132
+#: awkgram.y:1139
msgid "multistage two-way pipelines don't work"
msgstr "'pipeline' multistadio bidirezionali non funzionano"
-#: awkgram.y:1235
+#: awkgram.y:1242
msgid "regular expression on right of assignment"
msgstr "espressione regolare usata per assegnare un valore"
-#: awkgram.y:1246
+#: awkgram.y:1253
msgid "regular expression on left of `~' or `!~' operator"
msgstr "espressione regolare prima di operatore `~' o `!~'"
-#: awkgram.y:1262 awkgram.y:1416
+#: awkgram.y:1269 awkgram.y:1420
msgid "old awk does not support the keyword `in' except after `for'"
msgstr "il vecchio awk non supporta la parola-chiave `in' se non dopo `for'"
-#: awkgram.y:1272
+#: awkgram.y:1279
msgid "regular expression on right of comparison"
msgstr "espressione regolare a destra in un confronto"
-#: awkgram.y:1391
+#: awkgram.y:1395
#, c-format
msgid "`getline var' invalid inside `%s' rule"
msgstr "`getline var' invalida all'interno della regola `%s'"
-#: awkgram.y:1394 eval.c:2504
+#: awkgram.y:1398
#, c-format
msgid "`getline' invalid inside `%s' rule"
msgstr "`getline' invalida all'interno della regola `%s'"
-#: awkgram.y:1399
+#: awkgram.y:1403
msgid "non-redirected `getline' undefined inside END action"
msgstr "`getline' non re-diretta indefinita dentro 'azione' END"
-#: awkgram.y:1418
+#: awkgram.y:1422
msgid "old awk does not support multidimensional arrays"
msgstr "il vecchio awk non supporta vettori multidimensionali"
-#: awkgram.y:1514
+#: awkgram.y:1519
msgid "call of `length' without parentheses is not portable"
msgstr "chiamata a `length' senza parentesi non portabile"
-#: awkgram.y:1577
+#: awkgram.y:1585
msgid "indirect function calls are a gawk extension"
msgstr "chiamate a funzione indirette sono un'estensione gawk"
-#: awkgram.y:1590
+#: awkgram.y:1598
#, c-format
msgid "can not use special variable `%s' for indirect function call"
msgstr ""
"non posso usare la variabile speciale `%s' come parametro indiretto di "
"funzione "
-#: awkgram.y:1668
+#: awkgram.y:1676
msgid "invalid subscript expression"
msgstr "espressione indice invalida"
-#: awkgram.y:1708
-msgid "use of non-array as array"
-msgstr ""
-
-#: awkgram.y:1972 awkgram.y:1992 msg.c:98
+#: awkgram.y:2000 awkgram.y:2020 gawkapi.c:203 gawkapi.c:221 msg.c:119
msgid "warning: "
msgstr "attenzione: "
-#: awkgram.y:1990 msg.c:130
+#: awkgram.y:2018 gawkapi.c:189 gawkapi.c:218 msg.c:151
msgid "fatal: "
msgstr "fatale: "
-#: awkgram.y:2040
+#: awkgram.y:2068
msgid "unexpected newline or end of string"
msgstr "carattere 'a capo' o fine stringa inaspettati"
-#: awkgram.y:2297 awkgram.y:2355 awkgram.y:2539
+#: awkgram.y:2335 awkgram.y:2411 awkgram.y:2634 debug.c:517 debug.c:533
+#: debug.c:2790 debug.c:5038
#, c-format
msgid "can't open source file `%s' for reading (%s)"
msgstr "non riesco ad aprire file sorgente `%s' in lettura (%s)"
-#: awkgram.y:2298 awkgram.y:2356 builtin.c:122
+#: awkgram.y:2336 awkgram.y:2461
+#, fuzzy, c-format
+msgid "can't open shared library `%s' for reading (%s)"
+msgstr "non riesco ad aprire file sorgente `%s' in lettura (%s)"
+
+#: awkgram.y:2338 awkgram.y:2412 awkgram.y:2462 builtin.c:130 debug.c:5189
msgid "reason unknown"
msgstr "ragione indeterminata"
-#: awkgram.y:2314
+#: awkgram.y:2347 awkgram.y:2371
+#, c-format
+msgid "can't include `%s' and use it as a program file"
+msgstr ""
+
+#: awkgram.y:2360
#, c-format
msgid "already included source file `%s'"
msgstr "file sorgente `%s' già incluso"
-#: awkgram.y:2340
+#: awkgram.y:2361
+#, fuzzy, c-format
+msgid "already loaded shared library `%s'"
+msgstr "file sorgente `%s' già incluso"
+
+#: awkgram.y:2396
msgid "@include is a gawk extension"
msgstr "@include è un'estensione gawk"
-#: awkgram.y:2346
+#: awkgram.y:2402
msgid "empty filename after @include"
msgstr "nome-file mancante dopo @include"
-#: awkgram.y:2491
+#: awkgram.y:2446
+#, fuzzy
+msgid "@load is a gawk extension"
+msgstr "@include è un'estensione gawk"
+
+#: awkgram.y:2452
+#, fuzzy
+msgid "empty filename after @load"
+msgstr "nome-file mancante dopo @include"
+
+#: awkgram.y:2586
msgid "empty program text on command line"
msgstr "programma nullo sulla linea comandi"
-#: awkgram.y:2606
+#: awkgram.y:2701
#, c-format
msgid "can't read sourcefile `%s' (%s)"
msgstr "non riesco a leggere file sorgente `%s' (%s)"
-#: awkgram.y:2617
+#: awkgram.y:2712
#, c-format
msgid "source file `%s' is empty"
msgstr "file sorgente `%s' vuoto"
-#: awkgram.y:2794
+#: awkgram.y:2889
msgid "source file does not end in newline"
msgstr "file sorgente non termina con carattere 'a capo'"
-#: awkgram.y:2897
+#: awkgram.y:2994
msgid "unterminated regexp ends with `\\' at end of file"
msgstr "espressione regolare non completata termina con `\\' a fine file"
-#: awkgram.y:2921
+#: awkgram.y:3018
#, c-format
msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk"
msgstr ""
"%s: %d: modificatore di espressione regolare tawk `/.../%c' non valido in "
"gawk"
-#: awkgram.y:2925
+#: awkgram.y:3022
#, c-format
msgid "tawk regex modifier `/.../%c' doesn't work in gawk"
msgstr "modificatore di espressione regolare tawk `/.../%c' non valido in gawk"
-#: awkgram.y:2932
+#: awkgram.y:3029
msgid "unterminated regexp"
msgstr "espressione regolare non completata"
-#: awkgram.y:2936
+#: awkgram.y:3033
msgid "unterminated regexp at end of file"
msgstr "espressione regolare non completata a fine file"
-#: awkgram.y:2995
+#: awkgram.y:3092
msgid "use of `\\ #...' line continuation is not portable"
msgstr "uso di `\\ #...' continuazione linea non portabile"
-#: awkgram.y:3011
+#: awkgram.y:3108
msgid "backslash not last character on line"
msgstr "'\\' non è l'ultimo carattere della linea"
-#: awkgram.y:3072
+#: awkgram.y:3169
msgid "POSIX does not allow operator `**='"
msgstr "POSIX non permette l'operatore `**='"
-#: awkgram.y:3074
+#: awkgram.y:3171
msgid "old awk does not support operator `**='"
msgstr "il vecchio awk non supporta l'operatore `**='"
-#: awkgram.y:3083
+#: awkgram.y:3180
msgid "POSIX does not allow operator `**'"
msgstr "POSIX non permette l'operatore `**'"
-#: awkgram.y:3085
+#: awkgram.y:3182
msgid "old awk does not support operator `**'"
msgstr "il vecchio awk non supporta l'operatore `**'"
-#: awkgram.y:3120
+#: awkgram.y:3217
msgid "operator `^=' is not supported in old awk"
msgstr "l'operatore `^=' non è supportato nel vecchio awk"
-#: awkgram.y:3128
+#: awkgram.y:3225
msgid "operator `^' is not supported in old awk"
msgstr "l'operatore `^' non è supportato nel vecchio awk"
-#: awkgram.y:3221 awkgram.y:3237
+#: awkgram.y:3318 awkgram.y:3334 command.y:1178
msgid "unterminated string"
msgstr "stringa non terminata"
-#: awkgram.y:3433
+#: awkgram.y:3555
#, c-format
msgid "invalid char '%c' in expression"
msgstr "carattere '%c' non valido in un'espressione"
-#: awkgram.y:3480
+#: awkgram.y:3602
#, c-format
msgid "`%s' is a gawk extension"
msgstr "`%s' è un'estensione gawk"
-#: awkgram.y:3485
+#: awkgram.y:3607
#, c-format
msgid "`%s' is a Bell Labs extension"
msgstr "`%s' è un'estensione Bell Labs"
-#: awkgram.y:3490
+#: awkgram.y:3612
#, c-format
msgid "POSIX does not allow `%s'"
msgstr "POSIX non permette `%s'"
-#: awkgram.y:3498
+#: awkgram.y:3620
#, c-format
msgid "`%s' is not supported in old awk"
msgstr "`%s' non è supportato nel vecchio awk"
-#: awkgram.y:3565
+#: awkgram.y:3688
msgid "`goto' considered harmful!\n"
msgstr "`goto' considerato pericoloso!\n"
-#: awkgram.y:3616
+#: awkgram.y:3722
#, c-format
msgid "%d is invalid as number of arguments for %s"
msgstr "%d non valido come numero di argomenti per %s"
-#: awkgram.y:3651
+#: awkgram.y:3757
#, c-format
msgid "%s: string literal as last arg of substitute has no effect"
msgstr "%s: una stringa come ultimo argomento di 'substitute' non ha effetto"
-#: awkgram.y:3656
+#: awkgram.y:3762
#, c-format
msgid "%s third parameter is not a changeable object"
msgstr "il terzo parametro di '%s' non è un oggetto modificabile"
-#: awkgram.y:3729 awkgram.y:3732
+#: awkgram.y:3841 awkgram.y:3844
msgid "match: third argument is a gawk extension"
msgstr "match: il terzo argomento è un'estensione gawk"
-#: awkgram.y:3786 awkgram.y:3789
+#: awkgram.y:3898 awkgram.y:3901
msgid "close: second argument is a gawk extension"
msgstr "close: il secondo argomento è un'estensione gawk"
-#: awkgram.y:3801
+#: awkgram.y:3913
msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
msgstr ""
"uso scorretto di dcgettext(_\"...\"): togliere il carattere '_' iniziale"
-#: awkgram.y:3816
+#: awkgram.y:3928
msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
msgstr ""
"uso scorretto di dcngettext(_\"...\"): togliere il carattere '_' iniziale"
-#: awkgram.y:3908
-#, c-format
-msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
-msgstr "funzione `%s': parametro #%d, `%s', duplica parametro #%d"
-
-#: awkgram.y:3950
+#: awkgram.y:3994
#, c-format
msgid "function `%s': parameter `%s' shadows global variable"
msgstr "funzione `%s': parametro `%s' nasconde variabile globale"
-#: awkgram.y:4108
+#: awkgram.y:4051 debug.c:4019 debug.c:4062 debug.c:5187
#, c-format
msgid "could not open `%s' for writing (%s)"
msgstr "non riesco ad aprire `%s' in scrittura (%s)"
-#: awkgram.y:4109
+#: awkgram.y:4052
msgid "sending variable list to standard error"
msgstr "mando lista variabili a 'standard error'"
-#: awkgram.y:4115
+#: awkgram.y:4060
#, c-format
msgid "%s: close failed (%s)"
msgstr "%s: 'close' fallita (%s)"
-#: awkgram.y:4167
+#: awkgram.y:4085
msgid "shadow_funcs() called twice!"
msgstr "shadow_funcs() chiamata due volte!"
-#: awkgram.y:4173
+#: awkgram.y:4093
msgid "there were shadowed variables."
msgstr "c'erano variabili nascoste."
-#: awkgram.y:4203
+#: awkgram.y:4164
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "funzione di nome `%s' definita in precedenza"
+
+#: awkgram.y:4210
#, c-format
msgid "function `%s': can't use function name as parameter name"
msgstr "funzione `%s': non posso usare nome della funzione come nome parametro"
-#: awkgram.y:4207
+#: awkgram.y:4213
#, c-format
msgid "function `%s': can't use special variable `%s' as a function parameter"
msgstr ""
"funzione `%s': non posso usare la variabile speciale `%s' come parametro di "
"funzione"
-#: awkgram.y:4223
-#, c-format
-msgid "function name `%s' previously defined"
-msgstr "funzione di nome `%s' definita in precedenza"
+#: awkgram.y:4221
+#, fuzzy, c-format
+msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
+msgstr "funzione `%s': parametro `%s' nasconde variabile globale"
-#: awkgram.y:4391 awkgram.y:4397
+#: awkgram.y:4315 awkgram.y:4319
#, c-format
msgid "function `%s' called but never defined"
msgstr "funzione `%s' chiamata ma mai definita"
-#: awkgram.y:4400
+#: awkgram.y:4324
#, c-format
msgid "function `%s' defined but never called directly"
msgstr "funzione `%s' definita ma mai chiamata direttamente"
-#: awkgram.y:4432
+#: awkgram.y:4356
#, c-format
msgid "regexp constant for parameter #%d yields boolean value"
msgstr ""
"espressione regolare di valore costante per parametro #%d genera valore "
"booleano"
-#: awkgram.y:4541
+#: awkgram.y:4402
#, c-format
msgid ""
"function `%s' called with space between name and `(',\n"
@@ -522,229 +512,229 @@ msgstr ""
"funzione `%s' chiamata con spazio tra il nome e `(',\n"
"o usata come variabile o vettore"
-#: awkgram.y:4788 eval.c:2056
+#: awkgram.y:4618
msgid "division by zero attempted"
msgstr "tentativo di dividere per zero"
-#: awkgram.y:4797 eval.c:2072
+#: awkgram.y:4627
#, c-format
msgid "division by zero attempted in `%%'"
msgstr "tentativo di dividere per zero in `%%'"
-#: builtin.c:120
+#: builtin.c:128
#, c-format
msgid "%s to \"%s\" failed (%s)"
msgstr "%s a \"%s\" fallita (%s)"
-#: builtin.c:121
+#: builtin.c:129
msgid "standard output"
msgstr "standard output"
-#: builtin.c:135
+#: builtin.c:143
msgid "exp: received non-numeric argument"
msgstr "exp: argomento non numerico"
-#: builtin.c:141
+#: builtin.c:149
#, c-format
msgid "exp: argument %g is out of range"
msgstr "exp: argomento %g fuori dai limiti ammessi"
-#: builtin.c:200
+#: builtin.c:208
#, c-format
msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing"
msgstr ""
"fflush: non posso scaricare: 'pipe' `%s' aperta in lettura, non in scrittura"
-#: builtin.c:203
+#: builtin.c:211
#, c-format
msgid "fflush: cannot flush: file `%s' opened for reading, not writing"
msgstr ""
"fflush: non posso scaricare: file `%s' aperto in lettura, non in scrittura"
-#: builtin.c:215
+#: builtin.c:223
#, c-format
msgid "fflush: `%s' is not an open file, pipe or co-process"
msgstr "fflush: `%s' non è un file aperto, una 'pipe' o un co-processo"
-#: builtin.c:333
+#: builtin.c:341
msgid "index: received non-string first argument"
msgstr "index: il primo argomento non è una stringa"
-#: builtin.c:335
+#: builtin.c:343
msgid "index: received non-string second argument"
msgstr "index: il secondo argomento non è una stringa"
-#: builtin.c:457
+#: builtin.c:467 mpfr.c:770
msgid "int: received non-numeric argument"
msgstr "int: argomento non numerico"
-#: builtin.c:493
+#: builtin.c:503
msgid "length: received array argument"
msgstr "length: l'argomento fornito è un vettore"
-#: builtin.c:496
+#: builtin.c:506
msgid "`length(array)' is a gawk extension"
msgstr "`length(array)' è un'estensione gawk"
-#: builtin.c:504
+#: builtin.c:514
msgid "length: received non-string argument"
msgstr "length: l'argomento non è una stringa"
-#: builtin.c:535
+#: builtin.c:545
msgid "log: received non-numeric argument"
msgstr "log: argomento non numerico"
-#: builtin.c:538
+#: builtin.c:548
#, c-format
msgid "log: received negative argument %g"
msgstr "log: argomento negativo %g"
-#: builtin.c:694 builtin.c:699
+#: builtin.c:746 builtin.c:751
msgid "fatal: must use `count$' on all formats or none"
msgstr "fatale: `count$' va usato per ogni 'format' o per nessuno"
-#: builtin.c:762
+#: builtin.c:821
#, c-format
msgid "field width is ignored for `%%' specifier"
msgstr "larghezza campo ignorata per la specifica `%%'"
-#: builtin.c:764
+#: builtin.c:823
#, c-format
msgid "precision is ignored for `%%' specifier"
msgstr "precisione ignorata per la specifica `%%'"
-#: builtin.c:766
+#: builtin.c:825
#, c-format
msgid "field width and precision are ignored for `%%' specifier"
msgstr "larghezza campo e precisone ignorate per la specifica `%%'"
-#: builtin.c:817
+#: builtin.c:876
msgid "fatal: `$' is not permitted in awk formats"
msgstr "fatale: operatore `$' non consentito nei 'format' awk"
-#: builtin.c:826
+#: builtin.c:885
msgid "fatal: arg count with `$' must be > 0"
msgstr "fatale: numero argomenti con `$' dev'essere > 0"
-#: builtin.c:830
+#: builtin.c:889
#, c-format
msgid "fatal: arg count %ld greater than total number of supplied arguments"
msgstr "fatale: numero argomenti %ld > del numero totale argomenti specificati"
-#: builtin.c:834
+#: builtin.c:893
msgid "fatal: `$' not permitted after period in format"
msgstr "fatale: `$' non permesso dopo il punto in un 'format'"
-#: builtin.c:850
+#: builtin.c:909
msgid "fatal: no `$' supplied for positional field width or precision"
msgstr "fatale: manca `$' per i campi posizionali larghezza o precisione"
-#: builtin.c:921
+#: builtin.c:981
msgid "`l' is meaningless in awk formats; ignored"
msgstr "`l' non ha senso nei 'format' awk; ignorato"
-#: builtin.c:925
+#: builtin.c:985
msgid "fatal: `l' is not permitted in POSIX awk formats"
msgstr "fatale: `l' non permesso nei 'format' POSIX awk"
-#: builtin.c:938
+#: builtin.c:998
msgid "`L' is meaningless in awk formats; ignored"
msgstr "`L' non ha senso nei 'format' awk; ignorato"
-#: builtin.c:942
+#: builtin.c:1002
msgid "fatal: `L' is not permitted in POSIX awk formats"
msgstr "`L' non ha senso nei 'format' awk; ignorato"
-#: builtin.c:955
+#: builtin.c:1015
msgid "`h' is meaningless in awk formats; ignored"
msgstr "`h' non ha senso nei 'format' awk; ignorato"
-#: builtin.c:959
+#: builtin.c:1019
msgid "fatal: `h' is not permitted in POSIX awk formats"
msgstr "fatale: `h' non permesso nei 'format' POSIX awk"
-#: builtin.c:1272
+#: builtin.c:1414
#, c-format
msgid "[s]printf: value %g is out of range for `%%%c' format"
msgstr "[s]printf: valore %g fuori dai limiti ammessi per il 'format' `%%%c'"
-#: builtin.c:1332
+#: builtin.c:1512
#, c-format
msgid "ignoring unknown format specifier character `%c': no argument converted"
msgstr ""
"carattere di 'format' sconosciuto `%c' ignorato: nessun argomento convertito"
-#: builtin.c:1337
+#: builtin.c:1517
msgid "fatal: not enough arguments to satisfy format string"
msgstr ""
"fatale: argomenti in numero minore di quelli richiesti dalla stringa di "
"'format'"
-#: builtin.c:1339
+#: builtin.c:1519
msgid "^ ran out for this one"
msgstr "^ esauriti a questo punto"
-#: builtin.c:1346
+#: builtin.c:1526
msgid "[s]printf: format specifier does not have control letter"
msgstr "[s]printf: specifica di 'format' senza un carattere di controllo"
-#: builtin.c:1349
+#: builtin.c:1529
msgid "too many arguments supplied for format string"
msgstr "troppi argomenti specificati per questa stringa di 'format'"
-#: builtin.c:1423 builtin.c:1434
+#: builtin.c:1604 builtin.c:1615
msgid "printf: no arguments"
msgstr "printf: mancano argomenti"
-#: builtin.c:1475
+#: builtin.c:1656
msgid "sqrt: received non-numeric argument"
msgstr "sqrt: argomento non numerico"
-#: builtin.c:1479
+#: builtin.c:1660
#, c-format
msgid "sqrt: called with negative argument %g"
msgstr "sqrt: chiamata con argomento negativo %g"
-#: builtin.c:1503
+#: builtin.c:1691
#, c-format
msgid "substr: length %g is not >= 1"
msgstr "substr: lunghezza %g non >= 1"
-#: builtin.c:1505
+#: builtin.c:1693
#, c-format
msgid "substr: length %g is not >= 0"
msgstr "substr: lunghezza %g non >= 0"
-#: builtin.c:1512
+#: builtin.c:1700
#, c-format
msgid "substr: non-integer length %g will be truncated"
msgstr "substr: lunghezza non intera %g: sarà troncata"
-#: builtin.c:1517
+#: builtin.c:1705
#, c-format
msgid "substr: length %g too big for string indexing, truncating to %g"
msgstr "substr: lunghezza %g troppo elevata per indice stringa, tronco a %g"
-#: builtin.c:1529
+#: builtin.c:1717
#, c-format
msgid "substr: start index %g is invalid, using 1"
msgstr "substr: indice di partenza %g non valido, uso 1"
-#: builtin.c:1534
+#: builtin.c:1722
#, c-format
msgid "substr: non-integer start index %g will be truncated"
msgstr "substr: indice di partenza non intero %g: sarà troncato"
-#: builtin.c:1559
+#: builtin.c:1747
msgid "substr: source string is zero length"
msgstr "substr: stringa di partenza lunga zero"
-#: builtin.c:1575
+#: builtin.c:1763
#, c-format
msgid "substr: start index %g is past end of string"
msgstr "substr: indice di partenza %g oltre la fine della stringa"
-#: builtin.c:1583
+#: builtin.c:1771
#, c-format
msgid ""
"substr: length %g at start index %g exceeds length of first argument (%lu)"
@@ -752,228 +742,1084 @@ msgstr ""
"substr: lunghezza %g all'indice di partenza %g supera la lunghezza del primo "
"argomento (%lu)"
-#: builtin.c:1657
+#: builtin.c:1845
msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type"
msgstr ""
"strftime: il valore del 'format' in PROCINFO[\"strftime\"] è di tipo numerico"
-#: builtin.c:1680
+#: builtin.c:1868
msgid "strftime: received non-numeric second argument"
msgstr "strftime: il secondo argomento non è numerico"
-#: builtin.c:1683
+#: builtin.c:1872
msgid "strftime: second argument less than 0 or too big for time_t"
msgstr "strftime: secondo argomento < 0 o troppo elevato per time_t"
-#: builtin.c:1690
+#: builtin.c:1879
msgid "strftime: received non-string first argument"
msgstr "strftime: il primo argomento non è una stringa"
-#: builtin.c:1696
+#: builtin.c:1886
msgid "strftime: received empty format string"
msgstr "strftime: 'format' è una stringa nulla"
-#: builtin.c:1762
+#: builtin.c:1952
msgid "mktime: received non-string argument"
msgstr "mktime: l'argomento non è una stringa"
-#: builtin.c:1779
+#: builtin.c:1969
msgid "mktime: at least one of the values is out of the default range"
msgstr "mktime: almeno un valore è fuori dall'intervallo di default"
-#: builtin.c:1814
+#: builtin.c:2004
msgid "'system' function not allowed in sandbox mode"
msgstr "la funzione 'system' non è permessa in modo 'sandbox'"
-#: builtin.c:1819
+#: builtin.c:2009
msgid "system: received non-string argument"
msgstr "system: l'argomento non è una stringa"
-#: builtin.c:1874 eval.c:1159 eval.c:1790 eval.c:1803
-#, c-format
-msgid "reference to uninitialized variable `%s'"
-msgstr "riferimento a variabile non inizializzata `%s'"
-
-#: builtin.c:1941
+#: builtin.c:2127
#, c-format
msgid "reference to uninitialized field `$%d'"
msgstr "riferimento a variabile non inizializzata `$%d'"
-#: builtin.c:2028
+#: builtin.c:2214
msgid "tolower: received non-string argument"
msgstr "tolower: l'argomento non è una stringa"
-#: builtin.c:2062
+#: builtin.c:2248
msgid "toupper: received non-string argument"
msgstr "toupper: l'argomento non è una stringa"
-#: builtin.c:2098
+#: builtin.c:2284 mpfr.c:685
msgid "atan2: received non-numeric first argument"
msgstr "atan2: il primo argomento non è numerico"
-#: builtin.c:2100
+#: builtin.c:2286 mpfr.c:687
msgid "atan2: received non-numeric second argument"
msgstr "atan2: il secondo argomento non è numerico"
-#: builtin.c:2119
+#: builtin.c:2305
msgid "sin: received non-numeric argument"
msgstr "sin: l'argomento non è numerico"
-#: builtin.c:2135
+#: builtin.c:2321
msgid "cos: received non-numeric argument"
msgstr "cos: l'argomento non è numerico"
-#: builtin.c:2188
+#: builtin.c:2374 mpfr.c:1137
msgid "srand: received non-numeric argument"
msgstr "srand: l'argomento non è numerico"
-#: builtin.c:2219
+#: builtin.c:2405
msgid "match: third argument is not an array"
msgstr "match: il terzo argomento non è un vettore"
-#: builtin.c:2483
+#: builtin.c:2670
msgid "gensub: third argument of 0 treated as 1"
msgstr "gensub: il terzo argomento è 0, trattato come 1"
-#: builtin.c:2776
+#: builtin.c:2963
msgid "lshift: received non-numeric first argument"
msgstr "lshift: il primo argomento non è numerico"
-#: builtin.c:2778
+#: builtin.c:2965
msgid "lshift: received non-numeric second argument"
msgstr "lshift: il secondo argomento non è numerico"
-#: builtin.c:2784
+#: builtin.c:2971
#, fuzzy, c-format
msgid "lshift(%f, %f): negative values will give strange results"
msgstr "lshift(%lf, %lf): valori negativi daranno risultati strani"
-#: builtin.c:2786
+#: builtin.c:2973
#, fuzzy, c-format
msgid "lshift(%f, %f): fractional values will be truncated"
msgstr "lshift(%lf, %lf): valori con decimali verranno troncati"
-#: builtin.c:2788
+#: builtin.c:2975
#, fuzzy, c-format
msgid "lshift(%f, %f): too large shift value will give strange results"
msgstr "lshift(%lf, %lf): valori troppo alti daranno risultati strani"
-#: builtin.c:2813
+#: builtin.c:3000
msgid "rshift: received non-numeric first argument"
msgstr "rshift: il primo argomento non è numerico"
-#: builtin.c:2815
+#: builtin.c:3002
msgid "rshift: received non-numeric second argument"
msgstr "rshift: il secondo argomento non è numerico"
-#: builtin.c:2821
+#: builtin.c:3008
#, fuzzy, c-format
msgid "rshift(%f, %f): negative values will give strange results"
msgstr "rshift(%lf, %lf): valori negativi daranno risultati strani"
-#: builtin.c:2823
+#: builtin.c:3010
#, fuzzy, c-format
msgid "rshift(%f, %f): fractional values will be truncated"
msgstr "rshift(%lf, %lf): valori con decimali verranno troncati"
-#: builtin.c:2825
+#: builtin.c:3012
#, fuzzy, c-format
msgid "rshift(%f, %f): too large shift value will give strange results"
msgstr "rshift(%lf, %lf): valori troppo alti daranno risultati strani"
-#: builtin.c:2850
-msgid "and: received non-numeric first argument"
-msgstr "and: il primo argomento non è numerico"
-
-#: builtin.c:2852
-msgid "and: received non-numeric second argument"
-msgstr "and: il secondo argomento non è numerico"
+#: builtin.c:3037
+#, fuzzy
+msgid "and: called with less than two arguments"
+msgstr "sqrt: chiamata con argomento negativo %g"
-#: builtin.c:2858
+#: builtin.c:3042
#, fuzzy, c-format
-msgid "and(%f, %f): negative values will give strange results"
-msgstr "and(%lf, %lf): valori negativi daranno risultati strani"
+msgid "and: argument %d is non-numeric"
+msgstr "exp: argomento %g fuori dai limiti ammessi"
-#: builtin.c:2860
+#: builtin.c:3046
#, fuzzy, c-format
-msgid "and(%f, %f): fractional values will be truncated"
-msgstr "and(%lf, %lf): valori con decimali verranno troncati"
-
-#: builtin.c:2885
-msgid "or: received non-numeric first argument"
-msgstr "or: il primo argomento non è numerico"
+msgid "and: argument %d negative value %g will give strange results"
+msgstr "and(%lf, %lf): valori negativi daranno risultati strani"
-#: builtin.c:2887
-msgid "or: received non-numeric second argument"
-msgstr "or: il secondo argomento non è numerico"
+#: builtin.c:3069
+#, fuzzy
+msgid "or: called with less than two arguments"
+msgstr "sqrt: chiamata con argomento negativo %g"
-#: builtin.c:2893
+#: builtin.c:3074
#, fuzzy, c-format
-msgid "or(%f, %f): negative values will give strange results"
-msgstr "or(%lf, %lf): valori negativi daranno risultati strani"
+msgid "or: argument %d is non-numeric"
+msgstr "exp: argomento %g fuori dai limiti ammessi"
-#: builtin.c:2895
+#: builtin.c:3078
#, fuzzy, c-format
-msgid "or(%f, %f): fractional values will be truncated"
-msgstr "or(%lf, %lf): valori con decimali verranno troncati"
-
-#: builtin.c:2923
-msgid "xor: received non-numeric first argument"
-msgstr "xor: il primo argomento non è numerico"
+msgid "or: argument %d negative value %g will give strange results"
+msgstr "compl(%lf): valore negativo darà risultati strani"
-#: builtin.c:2925
-msgid "xor: received non-numeric second argument"
-msgstr "xor: il secondo argomento non è numerico"
+#: builtin.c:3100
+#, fuzzy
+msgid "xor: called with less than two arguments"
+msgstr "sqrt: chiamata con argomento negativo %g"
-#: builtin.c:2931
+#: builtin.c:3106
#, fuzzy, c-format
-msgid "xor(%f, %f): negative values will give strange results"
-msgstr "xor(%lf, %lf): valori negativi daranno risultati strani"
+msgid "xor: argument %d is non-numeric"
+msgstr "exp: argomento %g fuori dai limiti ammessi"
-#: builtin.c:2933
+#: builtin.c:3110
#, fuzzy, c-format
-msgid "xor(%f, %f): fractional values will be truncated"
-msgstr "xor(%lf, %lf): valori con decimali verranno troncati"
+msgid "xor: argument %d negative value %g will give strange results"
+msgstr "xor(%lf, %lf): valori negativi daranno risultati strani"
-#: builtin.c:2957 builtin.c:2963
+#: builtin.c:3135 mpfr.c:800
msgid "compl: received non-numeric argument"
msgstr "compl: l'argomento non è numerico"
-#: builtin.c:2965
+#: builtin.c:3141
#, fuzzy, c-format
msgid "compl(%f): negative value will give strange results"
msgstr "compl(%lf): valore negativo darà risultati strani"
-#: builtin.c:2967
+#: builtin.c:3143
#, fuzzy, c-format
msgid "compl(%f): fractional value will be truncated"
msgstr "compl(%lf): valore con decimali verrà troncato"
-#: builtin.c:3136
+#: builtin.c:3312
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr "dcgettext: `%s' non è una categoria 'locale' valida"
-#: eval.c:412
+#: command.y:225
+#, c-format
+msgid "Type (g)awk statement(s). End with the command \"end\"\n"
+msgstr ""
+
+#: command.y:289
+#, fuzzy, c-format
+msgid "invalid frame number: %d"
+msgstr "Fine di intervallo non valido"
+
+#: command.y:295
+#, fuzzy, c-format
+msgid "info: invalid option - \"%s\""
+msgstr "%s: opzione non valida -- '%c'\n"
+
+#: command.y:321
+#, c-format
+msgid "source \"%s\": already sourced."
+msgstr ""
+
+#: command.y:326
+#, c-format
+msgid "save \"%s\": command not permitted."
+msgstr ""
+
+#: command.y:339
+msgid "Can't use command `commands' for breakpoint/watchpoint commands"
+msgstr ""
+
+#: command.y:341
+msgid "no breakpoint/watchpoint has been set yet"
+msgstr ""
+
+#: command.y:343
+msgid "invalid breakpoint/watchpoint number"
+msgstr ""
+
+#: command.y:348
+#, c-format
+msgid "Type commands for when %s %d is hit, one per line.\n"
+msgstr ""
+
+#: command.y:350
+#, c-format
+msgid "End with the command \"end\"\n"
+msgstr ""
+
+#: command.y:357
+msgid "`end' valid only in command `commands' or `eval'"
+msgstr ""
+
+#: command.y:367
+msgid "`silent' valid only in command `commands'"
+msgstr ""
+
+#: command.y:373
+#, fuzzy, c-format
+msgid "trace: invalid option - \"%s\""
+msgstr "%s: opzione non valida -- '%c'\n"
+
+#: command.y:387
+msgid "condition: invalid breakpoint/watchpoint number"
+msgstr ""
+
+#: command.y:449
+#, fuzzy
+msgid "argument not a string"
+msgstr "exp: argomento %g fuori dai limiti ammessi"
+
+#: command.y:459 command.y:464
+#, c-format
+msgid "option: invalid parameter - \"%s\""
+msgstr ""
+
+#: command.y:474
+#, c-format
+msgid "no such function - \"%s\""
+msgstr ""
+
+#: command.y:531
+#, fuzzy, c-format
+msgid "enable: invalid option - \"%s\""
+msgstr "%s: opzione non valida -- '%c'\n"
+
+#: command.y:597
+#, fuzzy, c-format
+msgid "invalid range specification: %d - %d"
+msgstr "Fine di intervallo non valido"
+
+#: command.y:659
+#, fuzzy
+msgid "non-numeric value for field number"
+msgstr "valore non noto per specifica campo: %d\n"
+
+#: command.y:680 command.y:687
+msgid "non-numeric value found, numeric expected"
+msgstr ""
+
+#: command.y:712 command.y:718
+msgid "non-zero integer value"
+msgstr ""
+
+#: command.y:817
+msgid ""
+"backtrace [N] - print trace of all or N innermost (outermost if N < 0) "
+"frames."
+msgstr ""
+
+#: command.y:819
+msgid ""
+"break [[filename:]N|function] - set breakpoint at the specified location."
+msgstr ""
+
+#: command.y:821
+msgid "clear [[filename:]N|function] - delete breakpoints previously set."
+msgstr ""
+
+#: command.y:823
+msgid ""
+"commands [num] - starts a list of commands to be executed at a breakpoint"
+"(watchpoint) hit."
+msgstr ""
+
+#: command.y:825
+msgid "condition num [expr] - set or clear breakpoint or watchpoint condition."
+msgstr ""
+
+#: command.y:827
+msgid "continue [COUNT] - continue program being debugged."
+msgstr ""
+
+#: command.y:829
+msgid "delete [breakpoints] [range] - delete specified breakpoints."
+msgstr ""
+
+#: command.y:831
+msgid "disable [breakpoints] [range] - disable specified breakpoints."
+msgstr ""
+
+#: command.y:833
+msgid "display [var] - print value of variable each time the program stops."
+msgstr ""
+
+#: command.y:835
+msgid "down [N] - move N frames down the stack."
+msgstr ""
+
+#: command.y:837
+msgid "dump [filename] - dump instructions to file or stdout."
+msgstr ""
+
+#: command.y:839
+msgid "enable [once|del] [breakpoints] [range] - enable specified breakpoints."
+msgstr ""
+
+#: command.y:841
+msgid "end - end a list of commands or awk statements."
+msgstr ""
+
+#: command.y:843
+msgid "eval stmt|[p1, p2, ...] - evaluate awk statement(s)."
+msgstr ""
+
+#: command.y:845
+msgid "finish - execute until selected stack frame returns."
+msgstr ""
+
+#: command.y:847
+msgid "frame [N] - select and print stack frame number N."
+msgstr ""
+
+#: command.y:849
+msgid "help [command] - print list of commands or explanation of command."
+msgstr ""
+
+#: command.y:851
+msgid "ignore N COUNT - set ignore-count of breakpoint number N to COUNT."
+msgstr ""
+
+#: command.y:853
+msgid ""
+"info topic - source|sources|variables|functions|break|frame|args|locals|"
+"display|watch."
+msgstr ""
+
+#: command.y:855
+msgid "list [-|+|[filename:]lineno|function|range] - list specified line(s)."
+msgstr ""
+
+#: command.y:857
+msgid "next [COUNT] - step program, proceeding through subroutine calls."
+msgstr ""
+
+#: command.y:859
+msgid ""
+"nexti [COUNT] - step one instruction, but proceed through subroutine calls."
+msgstr ""
+
+#: command.y:861
+msgid "option [name[=value]] - set or display debugger option(s)."
+msgstr ""
+
+#: command.y:863
+msgid "print var [var] - print value of a variable or array."
+msgstr ""
+
+#: command.y:865
+msgid "printf format, [arg], ... - formatted output."
+msgstr ""
+
+#: command.y:867
+msgid "quit - exit debugger."
+msgstr ""
+
+#: command.y:869
+msgid "return [value] - make selected stack frame return to its caller."
+msgstr ""
+
+#: command.y:871
+msgid "run - start or restart executing program."
+msgstr ""
+
+#: command.y:874
+msgid "save filename - save commands from the session to file."
+msgstr ""
+
+#: command.y:877
+msgid "set var = value - assign value to a scalar variable."
+msgstr ""
+
+#: command.y:879
+msgid ""
+"silent - suspends usual message when stopped at a breakpoint/watchpoint."
+msgstr ""
+
+#: command.y:881
+msgid "source file - execute commands from file."
+msgstr ""
+
+#: command.y:883
+msgid "step [COUNT] - step program until it reaches a different source line."
+msgstr ""
+
+#: command.y:885
+msgid "stepi [COUNT] - step one instruction exactly."
+msgstr ""
+
+#: command.y:887
+msgid "tbreak [[filename:]N|function] - set a temporary breakpoint."
+msgstr ""
+
+#: command.y:889
+msgid "trace on|off - print instruction before executing."
+msgstr ""
+
+#: command.y:891
+msgid "undisplay [N] - remove variable(s) from automatic display list."
+msgstr ""
+
+#: command.y:893
+msgid ""
+"until [[filename:]N|function] - execute until program reaches a different "
+"line or line N within current frame."
+msgstr ""
+
+#: command.y:895
+msgid "unwatch [N] - remove variable(s) from watch list."
+msgstr ""
+
+#: command.y:897
+msgid "up [N] - move N frames up the stack."
+msgstr ""
+
+#: command.y:899
+msgid "watch var - set a watchpoint for a variable."
+msgstr ""
+
+#: command.y:1011 debug.c:395 msg.c:128
+#, c-format
+msgid "error: "
+msgstr "errore: "
+
+#: command.y:1051
+#, fuzzy, c-format
+msgid "can't read command (%s)\n"
+msgstr "non posso re-dirigere da `%s' (%s)"
+
+#: command.y:1065
+#, fuzzy, c-format
+msgid "can't read command (%s)"
+msgstr "non posso re-dirigere da `%s' (%s)"
+
+#: command.y:1116
+#, fuzzy
+msgid "invalid character in command"
+msgstr "Nome di 'classe di caratteri' non valido"
+
+#: command.y:1152
+#, c-format
+msgid "unknown command - \"%.*s\", try help"
+msgstr ""
+
+#: command.y:1222
+#, c-format
+msgid "%s"
+msgstr ""
+
+#: command.y:1284
+#, fuzzy
+msgid "invalid character"
+msgstr "Carattere di ordinamento non valido"
+
+#: command.y:1455
+#, c-format
+msgid "undefined command: %s\n"
+msgstr ""
+
+#: debug.c:246
+msgid "set or show the number of lines to keep in history file."
+msgstr ""
+
+#: debug.c:248
+msgid "set or show the list command window size."
+msgstr ""
+
+#: debug.c:250
+msgid "set or show gawk output file."
+msgstr ""
+
+#: debug.c:252
+msgid "set or show debugger prompt."
+msgstr ""
+
+#: debug.c:254
+msgid "(un)set or show saving of command history (value=on|off)."
+msgstr ""
+
+#: debug.c:256
+msgid "(un)set or show saving of options (value=on|off)."
+msgstr ""
+
+#: debug.c:258
+msgid "(un)set or show instruction tracing (value=on|off)."
+msgstr ""
+
+#: debug.c:339
+msgid "program not running."
+msgstr ""
+
+#: debug.c:442 debug.c:597
+#, fuzzy, c-format
+msgid "can't read source file `%s' (%s)"
+msgstr "non riesco a leggere file sorgente `%s' (%s)"
+
+#: debug.c:447
+#, fuzzy, c-format
+msgid "source file `%s' is empty.\n"
+msgstr "file sorgente `%s' vuoto"
+
+#: debug.c:474
+msgid "no current source file."
+msgstr ""
+
+#: debug.c:499
+#, fuzzy, c-format
+msgid "cannot find source file named `%s' (%s)"
+msgstr "non riesco a leggere file sorgente `%s' (%s)"
+
+#: debug.c:523
+#, c-format
+msgid "WARNING: source file `%s' modified since program compilation.\n"
+msgstr ""
+
+#: debug.c:542
+#, c-format
+msgid "line number %d out of range; `%s' has %d lines"
+msgstr ""
+
+#: debug.c:602
+#, fuzzy, c-format
+msgid "unexpected eof while reading file `%s', line %d"
+msgstr "carattere 'a capo' o fine stringa inaspettati"
+
+#: debug.c:611
+#, c-format
+msgid "source file `%s' modified since start of program execution"
+msgstr ""
+
+#: debug.c:723
+#, fuzzy, c-format
+msgid "Current source file: %s\n"
+msgstr "file sorgente `%s' già incluso"
+
+#: debug.c:724
+#, c-format
+msgid "Number of lines: %d\n"
+msgstr ""
+
+#: debug.c:731
+#, c-format
+msgid "Source file (lines): %s (%d)\n"
+msgstr ""
+
+#: debug.c:745
+msgid ""
+"Number Disp Enabled Location\n"
+"\n"
+msgstr ""
+
+#: debug.c:756
+#, c-format
+msgid "\tno of hits = %ld\n"
+msgstr ""
+
+#: debug.c:758
+#, c-format
+msgid "\tignore next %ld hit(s)\n"
+msgstr ""
+
+#: debug.c:760 debug.c:900
+#, c-format
+msgid "\tstop condition: %s\n"
+msgstr ""
+
+#: debug.c:762 debug.c:902
+msgid "\tcommands:\n"
+msgstr ""
+
+#: debug.c:784
+#, c-format
+msgid "Current frame: "
+msgstr ""
+
+#: debug.c:787
+#, c-format
+msgid "Called by frame: "
+msgstr ""
+
+#: debug.c:791
+#, c-format
+msgid "Caller of frame: "
+msgstr ""
+
+#: debug.c:809
+#, c-format
+msgid "None in main().\n"
+msgstr ""
+
+#: debug.c:839
+#, fuzzy
+msgid "No arguments.\n"
+msgstr "printf: mancano argomenti"
+
+#: debug.c:840
+msgid "No locals.\n"
+msgstr ""
+
+#: debug.c:848
+msgid ""
+"All defined variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:858
+msgid ""
+"All defined functions:\n"
+"\n"
+msgstr ""
+
+#: debug.c:877
+msgid ""
+"Auto-display variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:880
+msgid ""
+"Watch variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:1020
+#, c-format
+msgid "no symbol `%s' in current context\n"
+msgstr ""
+
+#: debug.c:1032 debug.c:1416
+#, fuzzy, c-format
+msgid "`%s' is not an array\n"
+msgstr "`%s' non è un nome di variabile ammesso"
+
+#: debug.c:1046
+#, fuzzy, c-format
+msgid "$%ld = uninitialized field\n"
+msgstr "riferimento a variabile non inizializzata `$%d'"
+
+#: debug.c:1067
+#, fuzzy, c-format
+msgid "array `%s' is empty\n"
+msgstr "file dati `%s' vuoto"
+
+#: debug.c:1110 debug.c:1162
+#, fuzzy, c-format
+msgid "[\"%s\"] not in array `%s'\n"
+msgstr "delete: indice `%s' non presente nel vettore `%s'"
+
+#: debug.c:1166
+#, c-format
+msgid "`%s[\"%s\"]' is not an array\n"
+msgstr ""
+
+#: debug.c:1227 debug.c:4947
+#, fuzzy, c-format
+msgid "`%s' is not a scalar variable"
+msgstr "`%s' non è un nome di variabile ammesso"
+
+#: debug.c:1249 debug.c:4977
+#, fuzzy, c-format
+msgid "attempt to use array `%s[\"%s\"]' in a scalar context"
+msgstr "tentativo di usare vettore `%s' in un contesto scalare"
+
+#: debug.c:1269 debug.c:4988
+#, fuzzy, c-format
+msgid "attempt to use scalar `%s[\"%s\"]' as array"
+msgstr "tentativo di usare scalare`%s[\"%.*s\"]' come vettore"
+
+#: debug.c:1412
+#, fuzzy, c-format
+msgid "`%s' is a function"
+msgstr "`%s' non è un nome funzione valido"
+
+#: debug.c:1454
+#, c-format
+msgid "watchpoint %d is unconditional\n"
+msgstr ""
+
+#: debug.c:1488
+#, c-format
+msgid "No display item numbered %ld"
+msgstr ""
+
+#: debug.c:1491
+#, c-format
+msgid "No watch item numbered %ld"
+msgstr ""
+
+#: debug.c:1517
+#, fuzzy, c-format
+msgid "%d: [\"%s\"] not in array `%s'\n"
+msgstr "delete: indice `%s' non presente nel vettore `%s'"
+
+#: debug.c:1756
+#, fuzzy
+msgid "attempt to use scalar value as array"
+msgstr "tentativo di usare valore scalare come vettore"
+
+#: debug.c:1845
+#, c-format
+msgid "Watchpoint %d deleted because parameter is out of scope.\n"
+msgstr ""
+
+#: debug.c:1856
+#, c-format
+msgid "Display %d deleted because parameter is out of scope.\n"
+msgstr ""
+
+#: debug.c:1889
+#, c-format
+msgid " in file `%s', line %d\n"
+msgstr ""
+
+#: debug.c:1910
+#, c-format
+msgid " at `%s':%d"
+msgstr ""
+
+#: debug.c:1926 debug.c:1989
+#, c-format
+msgid "#%ld\tin "
+msgstr ""
+
+#: debug.c:1963
+#, c-format
+msgid "More stack frames follow ...\n"
+msgstr ""
+
+#: debug.c:2006
+#, fuzzy
+msgid "invalid frame number"
+msgstr "Fine di intervallo non valido"
+
+#: debug.c:2178
+#, c-format
+msgid "Note: breakpoint %d (enabled, ignore next %ld hits), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2185
+#, c-format
+msgid "Note: breakpoint %d (enabled), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2192
+#, c-format
+msgid "Note: breakpoint %d (disabled, ignore next %ld hits), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2199
+#, c-format
+msgid "Note: breakpoint %d (disabled), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2216
+#, c-format
+msgid "Breakpoint %d set at file `%s', line %d\n"
+msgstr ""
+
+#: debug.c:2318
+#, c-format
+msgid "Can't set breakpoint in file `%s'\n"
+msgstr ""
+
+#: debug.c:2347 debug.c:2470 debug.c:3328
+#, fuzzy, c-format
+msgid "line number %d in file `%s' out of range"
+msgstr "exp: argomento %g fuori dai limiti ammessi"
+
+#: debug.c:2351
+#, c-format
+msgid "Can't find rule!!!\n"
+msgstr ""
+
+#: debug.c:2353
+#, c-format
+msgid "Can't set breakpoint at `%s':%d\n"
+msgstr ""
+
+#: debug.c:2365
+#, c-format
+msgid "Can't set breakpoint in function `%s'\n"
+msgstr ""
+
+#: debug.c:2381
+#, c-format
+msgid "breakpoint %d set at file `%s', line %d is unconditional\n"
+msgstr ""
+
+#: debug.c:2486 debug.c:2508
+#, c-format
+msgid "Deleted breakpoint %d"
+msgstr ""
+
+#: debug.c:2492
+#, c-format
+msgid "No breakpoint(s) at entry to function `%s'\n"
+msgstr ""
+
+#: debug.c:2519
+#, c-format
+msgid "No breakpoint at file `%s', line #%d\n"
+msgstr ""
+
+#: debug.c:2574 debug.c:2615 debug.c:2635 debug.c:2678
+msgid "invalid breakpoint number"
+msgstr ""
+
+#: debug.c:2590
+msgid "Delete all breakpoints? (y or n) "
+msgstr ""
+
+#: debug.c:2591 debug.c:2901 debug.c:2954
+msgid "y"
+msgstr ""
+
+#: debug.c:2640
+#, c-format
+msgid "Will ignore next %ld crossing(s) of breakpoint %d.\n"
+msgstr ""
+
+#: debug.c:2644
+#, c-format
+msgid "Will stop next time breakpoint %d is reached.\n"
+msgstr ""
+
+#: debug.c:2761
+#, c-format
+msgid "Can only debug programs provided with the `-f' option.\n"
+msgstr ""
+
+#: debug.c:2886
+#, c-format
+msgid "Failed to restart debugger"
+msgstr ""
+
+#: debug.c:2900
+msgid "Program already running. Restart from beginning (y/n)? "
+msgstr ""
+
+#: debug.c:2904
+#, c-format
+msgid "Program not restarted\n"
+msgstr ""
+
+#: debug.c:2914
+#, c-format
+msgid "error: cannot restart, operation not allowed\n"
+msgstr ""
+
+#: debug.c:2920
+#, c-format
+msgid "error (%s): cannot restart, ignoring rest of the commands\n"
+msgstr ""
+
+#: debug.c:2928
+#, c-format
+msgid "Starting program: \n"
+msgstr ""
+
+#: debug.c:2937
+#, c-format
+msgid "Program exited %s with exit value: %d\n"
+msgstr ""
+
+#: debug.c:2953
+msgid "The program is running. Exit anyway (y/n)? "
+msgstr ""
+
+#: debug.c:2988
+#, c-format
+msgid "Not stopped at any breakpoint; argument ignored.\n"
+msgstr ""
+
+#: debug.c:2993
+#, c-format
+msgid "invalid breakpoint number %d."
+msgstr ""
+
+#: debug.c:2998
+#, c-format
+msgid "Will ignore next %ld crossings of breakpoint %d.\n"
+msgstr ""
+
+#: debug.c:3185
+#, c-format
+msgid "'finish' not meaningful in the outermost frame main()\n"
+msgstr ""
+
+#: debug.c:3190
+#, c-format
+msgid "Run till return from "
+msgstr ""
+
+#: debug.c:3233
+#, c-format
+msgid "'return' not meaningful in the outermost frame main()\n"
+msgstr ""
+
+#: debug.c:3347
+#, c-format
+msgid "Can't find specified location in function `%s'\n"
+msgstr ""
+
+#: debug.c:3355
+#, fuzzy, c-format
+msgid "invalid source line %d in file `%s'"
+msgstr "file sorgente `%s' già incluso"
+
+#: debug.c:3370
+#, c-format
+msgid "Can't find specified location %d in file `%s'\n"
+msgstr ""
+
+#: debug.c:3402
+#, fuzzy, c-format
+msgid "element not in array\n"
+msgstr "delete: indice `%s' non presente nel vettore `%s'"
+
+#: debug.c:3402
+#, c-format
+msgid "untyped variable\n"
+msgstr ""
+
+#: debug.c:3444
+#, c-format
+msgid "Stopping in %s ...\n"
+msgstr ""
+
+#: debug.c:3521
+#, c-format
+msgid "'finish' not meaningful with non-local jump '%s'\n"
+msgstr ""
+
+#: debug.c:3528
+#, c-format
+msgid "'until' not meaningful with non-local jump '%s'\n"
+msgstr ""
+
+#: debug.c:4163
+msgid "\t------[Enter] to continue or q [Enter] to quit------"
+msgstr ""
+
+#: debug.c:4164
+msgid "q"
+msgstr ""
+
+#: debug.c:4984
+#, fuzzy, c-format
+msgid "[\"%s\"] not in array `%s'"
+msgstr "delete: indice `%s' non presente nel vettore `%s'"
+
+#: debug.c:5190
+#, c-format
+msgid "sending output to stdout\n"
+msgstr ""
+
+#: debug.c:5230
+msgid "invalid number"
+msgstr ""
+
+#: debug.c:5362
+#, c-format
+msgid "`%s' not allowed in current context; statement ignored"
+msgstr ""
+
+#: debug.c:5370
+msgid "`return' not allowed in current context; statement ignored"
+msgstr ""
+
+#: debug.c:5571
+#, c-format
+msgid "No symbol `%s' in current context"
+msgstr ""
+
+#: dfa.c:984 dfa.c:987 dfa.c:1007 dfa.c:1017 dfa.c:1029 dfa.c:1080 dfa.c:1089
+#: dfa.c:1092 dfa.c:1097 dfa.c:1110 dfa.c:1178
+msgid "unbalanced ["
+msgstr ""
+
+#: dfa.c:1038
+#, fuzzy
+msgid "invalid character class"
+msgstr "Nome di 'classe di caratteri' non valido"
+
+#: dfa.c:1215
+msgid "character class syntax is [[:space:]], not [:space:]"
+msgstr ""
+
+#: dfa.c:1267
+msgid "unfinished \\ escape"
+msgstr ""
+
+#: dfa.c:1414 regcomp.c:161
+msgid "Invalid content of \\{\\}"
+msgstr "Contenuto di \\{\\} non valido"
+
+#: dfa.c:1417 regcomp.c:176
+msgid "Regular expression too big"
+msgstr "Espressione regolare troppo complessa"
+
+#: dfa.c:1802
+msgid "unbalanced ("
+msgstr ""
+
+#: dfa.c:1929
+msgid "no syntax specified"
+msgstr ""
+
+#: dfa.c:1937
+msgid "unbalanced )"
+msgstr ""
+
+#: eval.c:394
#, c-format
msgid "unknown nodetype %d"
msgstr "tipo nodo sconosciuto %d"
-#: eval.c:423 eval.c:437
+#: eval.c:405 eval.c:419
#, c-format
msgid "unknown opcode %d"
msgstr "codice operativo sconosciuto %d"
-#: eval.c:434
+#: eval.c:416
#, c-format
msgid "opcode %s not an operator or keyword"
msgstr "codice operativo %s non è un operatore o una parola chiave"
-#: eval.c:488
+#: eval.c:471
msgid "buffer overflow in genflags2str"
msgstr "superamento limiti buffer in 'genflags2str'"
-#: eval.c:698
+#: eval.c:674
#, c-format
msgid ""
"\n"
@@ -984,305 +1830,529 @@ msgstr ""
"\t# 'Stack' (Pila) Chiamate Funzione:\n"
"\n"
-#: eval.c:725
+#: eval.c:703
msgid "`IGNORECASE' is a gawk extension"
msgstr "`IGNORECASE' è un'estensione gawk"
-#: eval.c:754
+#: eval.c:735
msgid "`BINMODE' is a gawk extension"
msgstr "`BINMODE' è un'estensione gawk"
-#: eval.c:812
+#: eval.c:792
#, c-format
msgid "BINMODE value `%s' is invalid, treated as 3"
msgstr "valore di BINMODE `%s' non valido, considerato come 3"
-#: eval.c:902
+#: eval.c:884
#, c-format
msgid "bad `%sFMT' specification `%s'"
msgstr "specificazione invalida `%sFMT' `%s'"
-#: eval.c:980
+#: eval.c:968
msgid "turning off `--lint' due to assignment to `LINT'"
msgstr "disabilito `--lint' a causa di assegnamento a `LINT'"
-#: eval.c:1127 eval.c:1777
-#, fuzzy, c-format
-msgid "can't use function name `%s' as variable or array"
-msgstr "non posso usare nome di funzione `%s' come nome di variabile"
-
-#: eval.c:1158 eval.c:1789 eval.c:1802
+#: eval.c:1144
#, c-format
msgid "reference to uninitialized argument `%s'"
msgstr "riferimento ad argomento non inizializzato `%s'"
-#: eval.c:1177
+#: eval.c:1145
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "riferimento a variabile non inizializzata `%s'"
+
+#: eval.c:1163
msgid "attempt to field reference from non-numeric value"
msgstr "tentativo di riferimento a un campo da valore non numerico"
-#: eval.c:1179
+#: eval.c:1165
msgid "attempt to field reference from null string"
msgstr "tentativo di riferimento a un campo da una stringa nulla"
-#: eval.c:1185
+#: eval.c:1173
#, c-format
msgid "attempt to access field %ld"
msgstr "tentativo di accedere al campo %ld"
-#: eval.c:1194
+#: eval.c:1182
#, c-format
msgid "reference to uninitialized field `$%ld'"
msgstr "riferimento a campo non inizializzato `$%ld'"
-#: eval.c:1256
+#: eval.c:1269
#, c-format
msgid "function `%s' called with more arguments than declared"
msgstr "funzione `%s' chiamata con più argomenti di quelli previsti"
-#: eval.c:1437
+#: eval.c:1464
#, c-format
msgid "unwind_stack: unexpected type `%s'"
msgstr "unwind_stack: tipo non previsto `%s'"
-#: eval.c:1532
+#: eval.c:1558
msgid "division by zero attempted in `/='"
msgstr "divisione per zero tentata in `/='"
-#: eval.c:1539
+#: eval.c:1565
#, c-format
msgid "division by zero attempted in `%%='"
msgstr "divisione per zero tentata in `%%='"
-#: eval.c:1876 eval.c:2122
-#, fuzzy, c-format
-msgid "attempt to use array `%s[\"%.*s\"]' in a scalar context"
-msgstr "tentativo di usare vettore `%s' in un contesto scalare"
+#: ext.c:49
+msgid "extensions are not allowed in sandbox mode"
+msgstr "le estensioni non sono permesse in modo 'sandbox'"
-#: eval.c:1907
+#: ext.c:52
#, fuzzy
-msgid "assignment used in conditional context"
-msgstr "`return' usato fuori da una funzione"
+msgid "-l / @load are gawk extensions"
+msgstr "@include è un'estensione gawk"
-#: eval.c:1911
-msgid "statement has no effect"
+#: ext.c:55
+msgid "load_ext: received NULL lib_name"
msgstr ""
-#: eval.c:2343
-#, c-format
-msgid "for loop: array `%s' changed size from %ld to %ld during loop execution"
+#: ext.c:58
+#, fuzzy, c-format
+msgid "load_ext: cannot open library `%s' (%s)\n"
+msgstr "estensione: non riesco ad aprire libreria `%s' (%s)\n"
+
+#: ext.c:64
+#, fuzzy, c-format
+msgid ""
+"load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n"
msgstr ""
+"estensione: libreria `%s': non definisce `plugin_is_GPL_compatible' (%s)\n"
+
+#: ext.c:70
+#, fuzzy, c-format
+msgid "load_ext: library `%s': cannot call function `%s' (%s)\n"
+msgstr "estensione: libreria `%s': non riesco a chiamare funzione `%s' (%s)\n"
-#: eval.c:2458
+#: ext.c:74
#, c-format
-msgid "function called indirectly through `%s' does not exist"
+msgid "load_ext: library `%s' initialization routine `%s' failed\n"
msgstr ""
-#: eval.c:2470
+#: ext.c:93
+#, fuzzy
+msgid "make_builtin: missing function name"
+msgstr "estensione: manca nome di funzione"
+
+#: ext.c:98
+#, fuzzy, c-format
+msgid "make_builtin: illegal character `%c' in function name `%s'"
+msgstr "estensione: carattere non ammesso `%c' nel nome di funzione `%s'"
+
+#: ext.c:106
+#, fuzzy, c-format
+msgid "make_builtin: can't redefine function `%s'"
+msgstr "estensione: non riesco a ridefinire funzione `%s'"
+
+#: ext.c:110
+#, fuzzy, c-format
+msgid "make_builtin: function `%s' already defined"
+msgstr "estensione: funzione `%s' già definita"
+
+#: ext.c:114
#, fuzzy, c-format
-msgid "function `%s' not defined"
+msgid "make_builtin: function name `%s' previously defined"
msgstr "funzione di nome `%s' definita in precedenza"
-#: eval.c:2511
+#: ext.c:116
#, fuzzy, c-format
-msgid "non-redirected `getline' invalid inside `%s' rule"
-msgstr "`getline' invalida all'interno della regola `%s'"
+msgid "make_builtin: can't use gawk built-in `%s' as function name"
+msgstr ""
+"estensione: nome funzione interna gawk `%s' non ammesso come nome funzione"
-#: eval.c:2600
+#: ext.c:119
#, c-format
-msgid "error reading input file `%s': %s"
-msgstr ""
+msgid "make_builtin: negative argument count for function `%s'"
+msgstr "make_builtin: contatore argomenti negativo per la funzione `%s'"
+
+#: ext.c:183
+#, c-format
+msgid "function `%s' defined to take no more than %d argument(s)"
+msgstr "funzione `%s' definita per avere al massimo %d argomenti(o)"
+
+#: ext.c:186
+#, c-format
+msgid "function `%s': missing argument #%d"
+msgstr "funzione `%s': manca argomento #%d"
-#: eval.c:2614
+#: ext.c:203
#, c-format
-msgid "`nextfile' cannot be called from a `%s' rule"
+msgid "function `%s': argument #%d: attempt to use scalar as an array"
+msgstr "funzione `%s': argomento #%d: tentativo di usare scalare come vettore"
+
+#: ext.c:207
+#, c-format
+msgid "function `%s': argument #%d: attempt to use array as a scalar"
+msgstr "funzione `%s': argomento #%d: tentativo di usare vettore come scalare"
+
+#: ext.c:221
+msgid "dynamic loading of library not supported"
+msgstr "caricamento dinamico di libreria non supportato"
+
+#: extension/filefuncs.c:75
+#, fuzzy
+msgid "chdir: called with incorrect number of arguments, expecting 1"
+msgstr "sqrt: chiamata con argomento negativo %g"
+
+#: extension/filefuncs.c:348
+#, fuzzy
+msgid "stat: called with wrong number of arguments"
+msgstr "sqrt: chiamata con argomento negativo %g"
+
+#: extension/filefuncs.c:355
+msgid "stat: bad parameters"
msgstr ""
-#: eval.c:2661
-msgid "`exit' cannot be called in the current context"
+#: extension/filefuncs.c:421
+msgid "fill_stat_element: could not create array"
msgstr ""
-#: eval.c:2700
-#, c-format
-msgid "`next' cannot be called from a `%s' rule"
+#: extension/filefuncs.c:430
+msgid "fill_stat_element: could not set element"
msgstr ""
-#: eval.c:2766
-#, c-format
-msgid "Sorry, don't know how to interpret `%s'"
+#: extension/filefuncs.c:445
+#, fuzzy
+msgid "fill_path_element: could not set element"
+msgstr "index: il secondo argomento non è una stringa"
+
+#: extension/filefuncs.c:461
+msgid "fill_error_element: could not set element"
msgstr ""
-#: ext.c:54
-msgid "extensions are not allowed in sandbox mode"
-msgstr "le estensioni non sono permesse in modo 'sandbox'"
+#: extension/filefuncs.c:508 extension/filefuncs.c:555
+msgid "fts-process: could not create array"
+msgstr ""
-#: ext.c:60 ext.c:65
-msgid "`extension' is a gawk extension"
-msgstr "`extension' è un'estensione gawk"
+#: extension/filefuncs.c:518 extension/filefuncs.c:565
+#: extension/filefuncs.c:583
+#, fuzzy
+msgid "fts-process: could not set element"
+msgstr "index: il secondo argomento non è una stringa"
-#: ext.c:75
-#, fuzzy, c-format
-msgid "fatal: extension: cannot open `%s' (%s)\n"
-msgstr "estensione: non riesco ad aprire libreria `%s' (%s)\n"
+#: extension/filefuncs.c:632
+#, fuzzy
+msgid "fts: called with incorrect number of arguments, expecting 3"
+msgstr "sqrt: chiamata con argomento negativo %g"
-#: ext.c:84
-#, fuzzy, c-format
-msgid ""
-"fatal: extension: library `%s': does not define "
-"`plugin_is_GPL_compatible' (%s)\n"
+#: extension/filefuncs.c:635
+msgid "fts: bad first parameter"
msgstr ""
-"estensione: libreria `%s': non definisce `plugin_is_GPL_compatible' (%s)\n"
-#: ext.c:93
-#, fuzzy, c-format
-msgid "fatal: extension: library `%s': cannot call function `%s' (%s)\n"
-msgstr "estensione: libreria `%s': non riesco a chiamare funzione `%s' (%s)\n"
+#: extension/filefuncs.c:641
+msgid "fts: bad second parameter"
+msgstr ""
-#: ext.c:127
-msgid "extension: missing function name"
-msgstr "estensione: manca nome di funzione"
+#: extension/filefuncs.c:647
+msgid "fts: bad third parameter"
+msgstr ""
-#: ext.c:132
-#, c-format
-msgid "extension: illegal character `%c' in function name `%s'"
-msgstr "estensione: carattere non ammesso `%c' nel nome di funzione `%s'"
+#: extension/filefuncs.c:654
+#, fuzzy
+msgid "fts: could not flatten array\n"
+msgstr "`%s' non è un nome di variabile ammesso"
-#: ext.c:141
-#, c-format
-msgid "extension: can't redefine function `%s'"
-msgstr "estensione: non riesco a ridefinire funzione `%s'"
+#: extension/filefuncs.c:672
+msgid "fts: ignoring sneaky FTS_NOSTAT flag. nyah, nyah, nyah."
+msgstr ""
-#: ext.c:145
-#, c-format
-msgid "extension: function `%s' already defined"
-msgstr "estensione: funzione `%s' già definita"
+#: extension/filefuncs.c:689
+msgid "fts: clear_array failed\n"
+msgstr ""
-#: ext.c:150
-#, c-format
-msgid "extension: function name `%s' previously defined"
-msgstr "estensione: funzione di nome `%s' definita in precedenza"
+#: extension/fnmatch.c:91
+#, fuzzy
+msgid "fnmatch: called with less than three arguments"
+msgstr "sqrt: chiamata con argomento negativo %g"
-#: ext.c:152
-#, c-format
-msgid "extension: can't use gawk built-in `%s' as function name"
+#: extension/fnmatch.c:94
+#, fuzzy
+msgid "fnmatch: called with more than three arguments"
+msgstr "sqrt: chiamata con argomento negativo %g"
+
+#: extension/fnmatch.c:97
+#, fuzzy
+msgid "fnmatch: could not get first argument"
+msgstr "strftime: il primo argomento non è una stringa"
+
+#: extension/fnmatch.c:102
+#, fuzzy
+msgid "fnmatch: could not get second argument"
+msgstr "index: il secondo argomento non è una stringa"
+
+#: extension/fnmatch.c:107
+msgid "fnmatch: could not get third argument"
+msgstr ""
+
+#: extension/fnmatch.c:120
+msgid "fnmatch is not implemented on this system\n"
+msgstr ""
+
+#: extension/fnmatch.c:152
+msgid "fnmatch init: could not add FNM_NOMATCH variable"
msgstr ""
-"estensione: nome funzione interna gawk `%s' non ammesso come nome funzione"
-#: ext.c:156
+#: extension/fnmatch.c:162
#, c-format
-msgid "make_builtin: negative argument count for function `%s'"
-msgstr "make_builtin: contatore argomenti negativo per la funzione `%s'"
+msgid "fnmatch init: could not set array element %s"
+msgstr ""
+
+#: extension/fnmatch.c:172
+msgid "fnmatch init: could not install FNM array"
+msgstr ""
+
+#: extension/fork.c:81
+#, fuzzy
+msgid "fork: called with too many arguments"
+msgstr "sqrt: chiamata con argomento negativo %g"
+
+#: extension/fork.c:94
+msgid "fork: PROCINFO is not an array!"
+msgstr ""
+
+#: extension/fork.c:118
+#, fuzzy
+msgid "waitpid: called with too many arguments"
+msgstr "sqrt: chiamata con argomento negativo %g"
+
+#: extension/fork.c:126
+#, fuzzy
+msgid "wait: called with no arguments"
+msgstr "sqrt: chiamata con argomento negativo %g"
+
+#: extension/fork.c:143
+#, fuzzy
+msgid "wait: called with too many arguments"
+msgstr "sqrt: chiamata con argomento negativo %g"
+
+#: extension/ordchr.c:69
+#, fuzzy
+msgid "ord: called with too many arguments"
+msgstr "sqrt: chiamata con argomento negativo %g"
+
+#: extension/ordchr.c:75
+#, fuzzy
+msgid "ord: called with no arguments"
+msgstr "sqrt: chiamata con argomento negativo %g"
+
+#: extension/ordchr.c:77
+#, fuzzy
+msgid "ord: called with inappropriate argument(s)"
+msgstr "sqrt: chiamata con argomento negativo %g"
+
+#: extension/ordchr.c:99
+#, fuzzy
+msgid "chr: called with too many arguments"
+msgstr "sqrt: chiamata con argomento negativo %g"
+
+#: extension/ordchr.c:109
+#, fuzzy
+msgid "chr: called with no arguments"
+msgstr "sqrt: chiamata con argomento negativo %g"
-#: ext.c:259
+#: extension/ordchr.c:111
+#, fuzzy
+msgid "chr: called with inappropriate argument(s)"
+msgstr "sqrt: chiamata con argomento negativo %g"
+
+#: extension/readfile.c:81
+#, fuzzy
+msgid "readfile: called with too many arguments"
+msgstr "sqrt: chiamata con argomento negativo %g"
+
+#: extension/readfile.c:114
+#, fuzzy
+msgid "readfile: called with no arguments"
+msgstr "sqrt: chiamata con argomento negativo %g"
+
+#: extension/rwarray.c:120
+#, fuzzy
+msgid "writea: called with too many arguments"
+msgstr "sqrt: chiamata con argomento negativo %g"
+
+#: extension/rwarray.c:127
+#, fuzzy, c-format
+msgid "do_writea: argument 0 is not a string\n"
+msgstr "exp: argomento %g fuori dai limiti ammessi"
+
+#: extension/rwarray.c:133
+#, fuzzy, c-format
+msgid "do_writea: argument 1 is not an array\n"
+msgstr "split: il quarto argomento non è un vettore"
+
+#: extension/rwarray.c:180
#, c-format
-msgid "function `%s' defined to take no more than %d argument(s)"
-msgstr "funzione `%s' definita per avere al massimo %d argomenti(o)"
+msgid "write_array: could not flatten array\n"
+msgstr ""
-#: ext.c:262
+#: extension/rwarray.c:194
#, c-format
-msgid "function `%s': missing argument #%d"
-msgstr "funzione `%s': manca argomento #%d"
+msgid "write_array: could not release flattened array\n"
+msgstr ""
+
+#: extension/rwarray.c:276
+#, fuzzy
+msgid "reada: called with too many arguments"
+msgstr "sqrt: chiamata con argomento negativo %g"
+
+#: extension/rwarray.c:283
+#, fuzzy, c-format
+msgid "do_reada: argument 0 is not a string\n"
+msgstr "exp: argomento %g fuori dai limiti ammessi"
-#: ext.c:279
+#: extension/rwarray.c:289
+#, fuzzy, c-format
+msgid "do_reada: argument 1 is not an array\n"
+msgstr "match: il terzo argomento non è un vettore"
+
+#: extension/rwarray.c:333
#, c-format
-msgid "function `%s': argument #%d: attempt to use scalar as an array"
-msgstr "funzione `%s': argomento #%d: tentativo di usare scalare come vettore"
+msgid "do_reada: clear_array failed\n"
+msgstr ""
-#: ext.c:283
+#: extension/rwarray.c:370
#, c-format
-msgid "function `%s': argument #%d: attempt to use array as a scalar"
-msgstr "funzione `%s': argomento #%d: tentativo di usare vettore come scalare"
+msgid "read_array: set_array_element failed\n"
+msgstr ""
+
+#: extension/time.c:78
+#, fuzzy
+msgid "gettimeofday: ignoring arguments"
+msgstr "mktime: l'argomento non è una stringa"
-#: ext.c:296
-msgid "Operation Not Supported"
-msgstr "Operazione Non Supportata"
+#: extension/time.c:109
+msgid "gettimeofday: not supported on this platform"
+msgstr ""
+
+#: extension/time.c:130
+#, fuzzy
+msgid "sleep: called with too many arguments"
+msgstr "sqrt: chiamata con argomento negativo %g"
+
+#: extension/time.c:133
+#, fuzzy
+msgid "sleep: missing required numeric argument"
+msgstr "exp: argomento non numerico"
-#: field.c:328
+#: extension/time.c:139
+#, fuzzy
+msgid "sleep: argument is negative"
+msgstr "exp: argomento %g fuori dai limiti ammessi"
+
+#: extension/time.c:166
+msgid "sleep: not supported on this platform"
+msgstr ""
+
+#: field.c:339
msgid "NF set to negative value"
msgstr "NF impostato a un valore negativo"
-#: field.c:951 field.c:958 field.c:962
+#: field.c:962 field.c:969 field.c:973
msgid "split: fourth argument is a gawk extension"
msgstr "split: il quarto argomento è un'estensione gawk"
-#: field.c:955
+#: field.c:966
msgid "split: fourth argument is not an array"
msgstr "split: il quarto argomento non è un vettore"
-#: field.c:969
+#: field.c:980
msgid "split: second argument is not an array"
msgstr "split: il secondo argomento non è un vettore"
-#: field.c:973
+#: field.c:984
msgid "split: cannot use the same array for second and fourth args"
msgstr ""
"split: non si può usare un unico vettore come secondo e quarto argomento"
-#: field.c:978
+#: field.c:989
msgid "split: cannot use a subarray of second arg for fourth arg"
msgstr ""
"split: non permesso un quarto argomento che sia un sottovettore del secondo "
"argomento"
-#: field.c:981
+#: field.c:992
msgid "split: cannot use a subarray of fourth arg for second arg"
msgstr ""
"split: non permesso un secondo argomento che sia un sottovettore del quarto "
"argomento"
-#: field.c:1010
+#: field.c:1021
msgid "split: null string for third arg is a gawk extension"
msgstr "split: la stringa nulla come terzo arg. è un'estensione gawk"
-#: field.c:1050
+#: field.c:1061
msgid "patsplit: fourth argument is not an array"
msgstr "patsplit: il secondo argomento non è un vettore"
-#: field.c:1055
+#: field.c:1066
msgid "patsplit: second argument is not an array"
msgstr "patsplit: il secondo argomento non è un vettore"
-#: field.c:1061
+#: field.c:1072
msgid "patsplit: third argument must be non-null"
msgstr "patsplit: il terzo argomento non può essere nullo"
-#: field.c:1065
+#: field.c:1076
msgid "patsplit: cannot use the same array for second and fourth args"
msgstr ""
"patsplit: non si può usare un unico vettore come secondo e quarto argomento"
-#: field.c:1070
+#: field.c:1081
msgid "patsplit: cannot use a subarray of second arg for fourth arg"
msgstr ""
"patsplit: non permesso un quarto argomento che sia un sottovettore del "
"secondo argomento"
-#: field.c:1073
+#: field.c:1084
msgid "patsplit: cannot use a subarray of fourth arg for second arg"
msgstr ""
"patsplit: non permesso un secondo argomento che sia un sottovettore del "
"quarto argomento"
-#: field.c:1110
+#: field.c:1122
msgid "`FIELDWIDTHS' is a gawk extension"
msgstr "`FIELDWIDTHS' è un'estensione gawk"
-#: field.c:1173
+#: field.c:1186
#, c-format
msgid "invalid FIELDWIDTHS value, near `%s'"
msgstr "valore di FIELDWIDTHS non valido, vicino a `%s'"
-#: field.c:1246
+#: field.c:1259
msgid "null string for `FS' is a gawk extension"
msgstr "la stringa nulla usata come `FS' è un'estensione gawk"
-#: field.c:1250
+#: field.c:1263
msgid "old awk does not support regexps as value of `FS'"
msgstr "il vecchio awk non supporta espressioni come valori di `FS'"
-#: field.c:1369
+#: field.c:1382
msgid "`FPAT' is a gawk extension"
msgstr "`FPAT' è un'estensione gawk"
+#: gawkapi.c:143
+msgid "awk_value_to_node: received null retval"
+msgstr ""
+
+#: gawkapi.c:932
+#, c-format
+msgid "api_flatten_array: could not convert index %d\n"
+msgstr ""
+
+#: gawkapi.c:937
+#, c-format
+msgid "api_flatten_array: could not convert value %d\n"
+msgstr ""
+
+#: gawkapi.c:1111
+msgid "cannot assign to defined constant"
+msgstr ""
+
#: getopt.c:604 getopt.c:633
#, c-format
msgid "%s: option '%s' is ambiguous; possibilities:"
@@ -1338,461 +2408,521 @@ msgstr "%s: l'opzione '-W %s' non ammette un argomento\n"
msgid "%s: option '-W %s' requires an argument\n"
msgstr "%s: l'opzione '-W %s' richiede un argomento\n"
-#: io.c:280
+#: io.c:339
#, c-format
msgid "command line argument `%s' is a directory: skipped"
msgstr "l'argomento in linea comando `%s' è una directory: saltato"
-#: io.c:283 io.c:385
+#: io.c:342 io.c:455
#, c-format
msgid "cannot open file `%s' for reading (%s)"
msgstr "non riesco ad aprire file `%s' in lettura (%s)"
-#: io.c:501
+#: io.c:582
#, c-format
msgid "close of fd %d (`%s') failed (%s)"
msgstr "chiusura di fd %d (`%s') fallita (%s)"
-#: io.c:578
+#: io.c:658
msgid "redirection not allowed in sandbox mode"
msgstr "re-direzione non permessa in modo 'sandbox'"
-#: io.c:612
+#: io.c:692
#, c-format
msgid "expression in `%s' redirection only has numeric value"
msgstr "espressione nella re-direzione `%s' ha solo un valore numerico"
-#: io.c:618
+#: io.c:698
#, c-format
msgid "expression for `%s' redirection has null string value"
msgstr "espressione nella re-direzione `%s' ha per valore la stringa nulla"
-#: io.c:623
+#: io.c:703
#, c-format
msgid "filename `%s' for `%s' redirection may be result of logical expression"
msgstr ""
"nome-file `%s' per la re-direzione `%s' può essere il risultato di una "
"espressione logica"
-#: io.c:666
+#: io.c:746
#, c-format
msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
msgstr "mistura non necessaria di `>' e `>>' per il file `%.*s'"
-#: io.c:719
+#: io.c:799
#, c-format
msgid "can't open pipe `%s' for output (%s)"
msgstr "non posso aprire 'pipe' `%s' in scrittura (%s)"
-#: io.c:729
+#: io.c:809
#, c-format
msgid "can't open pipe `%s' for input (%s)"
msgstr "non posso aprire 'pipe' `%s' in lettura (%s)"
-#: io.c:752
+#: io.c:840
#, c-format
msgid "can't open two way pipe `%s' for input/output (%s)"
msgstr "non posso aprire 'pipe' bidirezionale `%s' per lettura/scrittura (%s)"
-#: io.c:834
+#: io.c:923
#, c-format
msgid "can't redirect from `%s' (%s)"
msgstr "non posso re-dirigere da `%s' (%s)"
-#: io.c:837
+#: io.c:926
#, c-format
msgid "can't redirect to `%s' (%s)"
msgstr "non posso re-dirigere a `%s' (%s)"
-#: io.c:888
+#: io.c:977
msgid ""
"reached system limit for open files: starting to multiplex file descriptors"
msgstr ""
"numero massimo consentito di file aperti raggiunto: comincio a riutilizzare "
"i descrittori di file"
-#: io.c:904
+#: io.c:993
#, c-format
msgid "close of `%s' failed (%s)."
msgstr "chiusura di `%s' fallita (%s)."
-#: io.c:912
+#: io.c:1001
msgid "too many pipes or input files open"
msgstr "troppe 'pipe' o file di input aperti"
-#: io.c:934
+#: io.c:1023
msgid "close: second argument must be `to' or `from'"
msgstr "close: il secondo argomento deve essere `a' o `da'"
-#: io.c:951
+#: io.c:1040
#, c-format
msgid "close: `%.*s' is not an open file, pipe or co-process"
msgstr "close: `%.*s' non è un file aperto, una 'pipe' o un co-processo"
-#: io.c:956
+#: io.c:1045
msgid "close of redirection that was never opened"
msgstr "chiusura di una re-direzione mai aperta"
-#: io.c:1053
+#: io.c:1142
#, c-format
msgid "close: redirection `%s' not opened with `|&', second argument ignored"
msgstr "close: re-direzione `%s' non aperta con `|&', ignoro secondo argomento"
-#: io.c:1069
+#: io.c:1159
#, c-format
msgid "failure status (%d) on pipe close of `%s' (%s)"
msgstr "errore ritornato (%d) dalla chiusura della 'pipe' `%s' (%s)"
-#: io.c:1072
+#: io.c:1162
#, c-format
msgid "failure status (%d) on file close of `%s' (%s)"
msgstr "errore ritornato (%d) dalla chiusura del file `%s' (%s)"
-#: io.c:1092
+#: io.c:1182
#, c-format
msgid "no explicit close of socket `%s' provided"
msgstr "nessuna chiusura esplicita richiesta per 'socket' `%s'"
-#: io.c:1095
+#: io.c:1185
#, c-format
msgid "no explicit close of co-process `%s' provided"
msgstr "nessuna chiusura esplicita richiesta per co-processo `%s'"
-#: io.c:1098
+#: io.c:1188
#, c-format
msgid "no explicit close of pipe `%s' provided"
msgstr "nessuna chiusura esplicita richiesta per 'pipe' `%s'"
-#: io.c:1101
+#: io.c:1191
#, c-format
msgid "no explicit close of file `%s' provided"
msgstr "nessuna chiusura esplicita richiesta per file `%s'"
-#: io.c:1129 io.c:1184 main.c:797 main.c:834
+#: io.c:1219 io.c:1274 main.c:847 main.c:884
#, c-format
msgid "error writing standard output (%s)"
msgstr "errore scrivendo 'standard output' (%s)"
-#: io.c:1133 io.c:1189
+#: io.c:1223 io.c:1279
#, c-format
msgid "error writing standard error (%s)"
msgstr "errore scrivendo 'standard error' (%s)"
-#: io.c:1141
+#: io.c:1231
#, c-format
msgid "pipe flush of `%s' failed (%s)."
msgstr "scaricamento di 'pipe' `%s' fallita (%s)."
-#: io.c:1144
+#: io.c:1234
#, c-format
msgid "co-process flush of pipe to `%s' failed (%s)."
msgstr "scaricamento da co-processo di 'pipe' a `%s' fallita (%s)."
-#: io.c:1147
+#: io.c:1237
#, c-format
msgid "file flush of `%s' failed (%s)."
msgstr "scaricamento di file `%s' fallita (%s)."
-#: io.c:1262
+#: io.c:1351
#, c-format
msgid "local port %s invalid in `/inet'"
msgstr "porta locale %s invalida in `/inet'"
-#: io.c:1279
+#: io.c:1369
#, c-format
msgid "remote host and port information (%s, %s) invalid"
msgstr "host remoto e informazione di porta (%s, %s) invalidi"
-#: io.c:1431
+#: io.c:1521
#, c-format
msgid "no (known) protocol supplied in special filename `%s'"
msgstr "nessuno protocollo (noto) specificato nel filename speciale `%s'"
-#: io.c:1445
+#: io.c:1535
#, c-format
msgid "special file name `%s' is incomplete"
msgstr "nome-file speciale `%s' incompleto"
-#: io.c:1462
+#: io.c:1552
msgid "must supply a remote hostname to `/inet'"
msgstr "va fornito nome di 'host' remoto a `/inet'"
-#: io.c:1480
+#: io.c:1570
msgid "must supply a remote port to `/inet'"
msgstr "va fornita porta remota a `/inet'"
-#: io.c:1526
+#: io.c:1616
msgid "TCP/IP communications are not supported"
msgstr "comunicazioni TCP/IP non supportate"
-#: io.c:1693
+#: io.c:1785
#, c-format
msgid "could not open `%s', mode `%s'"
msgstr "non riesco ad aprire `%s', modo `%s'"
-#: io.c:1747
+#: io.c:1835
#, c-format
msgid "close of master pty failed (%s)"
msgstr "fallita chiusura di 'pty' principale (%s)"
-#: io.c:1749 io.c:1917 io.c:2074
+#: io.c:1837 io.c:2012 io.c:2181
#, c-format
msgid "close of stdout in child failed (%s)"
msgstr "fallita chiusura di 'stdout' nel processo-figlio (%s)"
-#: io.c:1752
+#: io.c:1840
#, c-format
msgid "moving slave pty to stdout in child failed (dup: %s)"
msgstr ""
"fallito trasferimento di 'pty' secondaria a 'stdout' nel processo-figlio "
"(dup: %s)"
-#: io.c:1754 io.c:1922
+#: io.c:1842 io.c:2017
#, c-format
msgid "close of stdin in child failed (%s)"
msgstr "fallita chiusura di 'stdin' nel processo-figlio (%s)"
-#: io.c:1757
+#: io.c:1845
#, c-format
msgid "moving slave pty to stdin in child failed (dup: %s)"
msgstr ""
"fallito trasferimento di 'pty' secondaria a 'stdin' nel processo-figlio "
"(dup: %s)"
-#: io.c:1759 io.c:1780
+#: io.c:1847 io.c:1868
#, c-format
msgid "close of slave pty failed (%s)"
msgstr "fallita chiusura di 'pty' secondaria (%s)"
-#: io.c:1858 io.c:1920 io.c:2052 io.c:2077
+#: io.c:1953 io.c:2015 io.c:2158 io.c:2184
#, c-format
msgid "moving pipe to stdout in child failed (dup: %s)"
msgstr "fallito passaggio di 'pipe' a 'stdout' nel processo-figlio (dup: %s)"
-#: io.c:1865 io.c:1925
+#: io.c:1960 io.c:2020
#, c-format
msgid "moving pipe to stdin in child failed (dup: %s)"
msgstr "fallito passaggio di pipe a 'stdin' nel processo-figlio (dup: %s)"
-#: io.c:1885 io.c:2067
+#: io.c:1980 io.c:2174
msgid "restoring stdout in parent process failed\n"
msgstr "fallito ripristino di 'stdout' nel processo-padre\n"
-#: io.c:1893
+#: io.c:1988
msgid "restoring stdin in parent process failed\n"
msgstr "fallito ripristino di 'stdin' nel processo-padre\n"
-#: io.c:1928 io.c:2079 io.c:2093
+#: io.c:2023 io.c:2186 io.c:2200
#, c-format
msgid "close of pipe failed (%s)"
msgstr "fallita chiusura di 'pipe' (%s)"
-#: io.c:1973
+#: io.c:2076
msgid "`|&' not supported"
msgstr "`|&' non supportato"
-#: io.c:2039
+#: io.c:2143
#, c-format
msgid "cannot open pipe `%s' (%s)"
msgstr "non riesco ad aprire 'pipe' `%s' (%s)"
-#: io.c:2087
+#: io.c:2194
#, c-format
msgid "cannot create child process for `%s' (fork: %s)"
msgstr "non riesco a creare processo-figlio per `%s' (fork: %s)"
-#: io.c:2520
+#: io.c:2652
+msgid "register_input_parser: received NULL pointer"
+msgstr ""
+
+#: io.c:2680
+#, c-format
+msgid "input parser `%s' conflicts with previously installed input parser `%s'"
+msgstr ""
+
+#: io.c:2687
+#, c-format
+msgid "input parser `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2707
+msgid "register_output_wrapper: received NULL pointer"
+msgstr ""
+
+#: io.c:2735
+#, c-format
+msgid ""
+"output wrapper `%s' conflicts with previously installed output wrapper `%s'"
+msgstr ""
+
+#: io.c:2742
+#, c-format
+msgid "output wrapper `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2763
+msgid "register_output_processor: received NULL pointer"
+msgstr ""
+
+#: io.c:2792
+#, c-format
+msgid ""
+"two-way processor `%s' conflicts with previously installed two-way processor "
+"`%s'"
+msgstr ""
+
+#: io.c:2801
+#, c-format
+msgid "two way processor `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2908
#, c-format
msgid "data file `%s' is empty"
msgstr "file dati `%s' vuoto"
-#: io.c:2561 io.c:2569
+#: io.c:2950 io.c:2958
msgid "could not allocate more input memory"
msgstr "non riesco ad allocare ulteriore memoria per l'input"
-#: io.c:3127
+#: io.c:3524
msgid "multicharacter value of `RS' is a gawk extension"
msgstr "valore multicarattere per `RS' è un'estensione gawk"
-#: io.c:3232
+#: io.c:3613
msgid "IPv6 communication is not supported"
msgstr "comunicazioni IPv6 non supportate"
-#: main.c:366
+#: main.c:362
msgid "`-m[fr]' option irrelevant in gawk"
msgstr "`-m[fr]' opzione irrilevante per gawk"
-#: main.c:368
+#: main.c:364
msgid "-m option usage: `-m[fr] nnn'"
msgstr "-m uso opzione: `-m[fr] nnn'"
-#: main.c:391
+#: main.c:393
msgid "empty argument to `-e/--source' ignored"
msgstr "argomento di `-e/--source' nullo, ignorato"
-#: main.c:462
+#: main.c:483
#, c-format
msgid "%s: option `-W %s' unrecognized, ignored\n"
msgstr "%s: opzione `-W %s' non riconosciuta, ignorata\n"
-#: main.c:515
+#: main.c:529
#, c-format
msgid "%s: option requires an argument -- %c\n"
msgstr "%s: l'opzione richiede un argomento -- %c\n"
-#: main.c:536
+#: main.c:550
msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
msgstr "variable d'ambiente `POSIXLY_CORRECT' impostata: attivo `--posix'"
-#: main.c:542
+#: main.c:556
msgid "`--posix' overrides `--traditional'"
msgstr "`--posix' annulla `--traditional'"
-#: main.c:553
+#: main.c:567
msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
msgstr "`--posix'/`--traditional' annulla `--non-decimal-data'"
-#: main.c:557
+#: main.c:571
#, c-format
msgid "running %s setuid root may be a security problem"
msgstr "eseguire %s con 'setuid' root può essere un rischio per la sicurezza"
-#: main.c:562
+#: main.c:576
#, fuzzy
msgid "`--posix' overrides `--characters-as-bytes'"
msgstr "`--posix' annulla `--binary"
-#: main.c:616
+#: main.c:635
#, c-format
msgid "can't set binary mode on stdin (%s)"
msgstr "non posso impostare modalità binaria su 'stdin'(%s)"
-#: main.c:619
+#: main.c:638
#, c-format
msgid "can't set binary mode on stdout (%s)"
msgstr "non posso impostare modalità binaria su 'stdout'(%s)"
-#: main.c:621
+#: main.c:640
#, c-format
msgid "can't set binary mode on stderr (%s)"
msgstr "non posso impostare modalità binaria su 'stderr'(%s)"
-#: main.c:660
+#: main.c:698
msgid "no program text at all!"
msgstr "manca del tutto il testo del programma!"
-#: main.c:737
+#: main.c:784
#, c-format
msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"
msgstr "Uso: %s [opzioni in stile POSIX o GNU] -f file-prog. [--] file ...\n"
-#: main.c:739
+#: main.c:786
#, c-format
msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"
msgstr "Usage: %s [opzioni in stile POSIX o GNU] [--] %cprogramma%c file ...\n"
-#: main.c:744
+#: main.c:791
msgid "POSIX options:\t\tGNU long options: (standard)\n"
msgstr "Opzioni POSIX:\t\topzioni lunghe GNU: (standard)\n"
-#: main.c:745
+#: main.c:792
msgid "\t-f progfile\t\t--file=progfile\n"
msgstr "\t-f fileprog\t\t--file=file-prog.\n"
-#: main.c:746
+#: main.c:793
msgid "\t-F fs\t\t\t--field-separator=fs\n"
msgstr "\t-F fs\t\t\t--field-separator=fs\n"
-#: main.c:747
+#: main.c:794
msgid "\t-v var=val\t\t--assign=var=val\n"
msgstr "\t-v var=valore\t\t--assign=var=valore\n"
-#: main.c:748
+#: main.c:795
msgid "Short options:\t\tGNU long options: (extensions)\n"
msgstr "Opzioni brevi:\t\topzioni lunghe GNU: (estensioni)\n"
-#: main.c:749
+#: main.c:796
msgid "\t-b\t\t\t--characters-as-bytes\n"
msgstr "\t-b\t\t\t--characters-as-bytes\n"
-#: main.c:750
+#: main.c:797
msgid "\t-c\t\t\t--traditional\n"
msgstr "\t-c\t\t\t--traditional\n"
-#: main.c:751
+#: main.c:798
msgid "\t-C\t\t\t--copyright\n"
msgstr "\t-C\t\t\t--copyright\n"
-#: main.c:752
+#: main.c:799
msgid "\t-d[file]\t\t--dump-variables[=file]\n"
msgstr "\t-d[file]\t\t--dump-variables[=file]\n"
-#: main.c:753
+#: main.c:800
+msgid "\t-D[file]\t\t--debug[=file]\n"
+msgstr "\t-D[file]\t\t--debug[=file]\n"
+
+#: main.c:801
msgid "\t-e 'program-text'\t--source='program-text'\n"
msgstr "\t-e 'testo-del-programma'\t--source='testo-del-programma'\n"
-#: main.c:754
+#: main.c:802
msgid "\t-E file\t\t\t--exec=file\n"
msgstr "\t-E file\t\t\t--exec=file\n"
-#: main.c:755
+#: main.c:803
msgid "\t-g\t\t\t--gen-pot\n"
msgstr "\t-g\t\t\t--gen-pot\n"
-#: main.c:756
+#: main.c:804
msgid "\t-h\t\t\t--help\n"
msgstr "\t-h\t\t\t--help\n"
-#: main.c:757
+#: main.c:805
+msgid "\t-i includefile\t\t--include=includefile\n"
+msgstr ""
+
+#: main.c:806
+msgid "\t-l library\t\t--load=library\n"
+msgstr "\t-l libreria\t\t--load=libreria\n"
+
+#: main.c:807
msgid "\t-L [fatal]\t\t--lint[=fatal]\n"
msgstr "\t-L [fatal]\t\t--lint[=fatal]\n"
-#: main.c:758
+#: main.c:808
msgid "\t-n\t\t\t--non-decimal-data\n"
msgstr "\t-n\t\t\t--non-decimal-data\n"
-#: main.c:759
+#: main.c:809
+msgid "\t-M\t\t\t--bignum\n"
+msgstr "\t-M\t\t\t--bignum\n"
+
+#: main.c:810
msgid "\t-N\t\t\t--use-lc-numeric\n"
msgstr "\t-N\t\t\t--use-lc-numeric\n"
-#: main.c:760
+#: main.c:811
+msgid "\t-o[file]\t\t--pretty-print[=file]\n"
+msgstr "\t-o[file]\t\t--pretty-print[=file]\n"
+
+#: main.c:812
msgid "\t-O\t\t\t--optimize\n"
msgstr "\t-O\t\t\t--optimize\n"
-#: main.c:761
+#: main.c:813
msgid "\t-p[file]\t\t--profile[=file]\n"
msgstr "\t-p[file]\t\t--profile[=file]\n"
-#: main.c:762
+#: main.c:814
msgid "\t-P\t\t\t--posix\n"
msgstr "\t-P\t\t\t--posix\n"
-#: main.c:763
+#: main.c:815
msgid "\t-r\t\t\t--re-interval\n"
msgstr "\t-r\t\t\t--re-interval\n"
-#: main.c:765
-#, fuzzy
-msgid "\t-R file\t\t\t--command=file\n"
-msgstr "\t-E file\t\t\t--exec=file\n"
-
-#: main.c:766
+#: main.c:816
msgid "\t-S\t\t\t--sandbox\n"
msgstr "\t-S\t\t\t--sandbox\n"
-#: main.c:767
+#: main.c:817
msgid "\t-t\t\t\t--lint-old\n"
msgstr "\t-t\t\t\t--lint-old\n"
-#: main.c:768
+#: main.c:818
msgid "\t-V\t\t\t--version\n"
msgstr "\t-V\t\t\t--version\n"
-#: main.c:770
+#: main.c:820
msgid "\t-W nostalgia\t\t--nostalgia\n"
msgstr "\t-W nostalgia\t\t--nostalgia\n"
-#: main.c:773
+#: main.c:823
msgid "\t-Y\t\t--parsedebug\n"
msgstr "\t-Y\t\t--parsedebug\n"
@@ -1801,7 +2931,7 @@ msgstr "\t-Y\t\t--parsedebug\n"
#. for this application. Please add _another line_ with the
#. address for translation bugs.
#. no-wrap
-#: main.c:782
+#: main.c:832
msgid ""
"\n"
"To report bugs, see node `Bugs' in `gawk.info', which is\n"
@@ -1814,7 +2944,7 @@ msgstr ""
"Problemi di traduzione, segnalare ad: azc100@gmail.com.\n"
"\n"
-#: main.c:786
+#: main.c:836
msgid ""
"gawk is a pattern scanning and processing language.\n"
"By default it reads standard input and writes standard output.\n"
@@ -1824,7 +2954,7 @@ msgstr ""
"Senza parametri, legge da 'standard input' e scrive su 'standard output'.\n"
"\n"
-#: main.c:790
+#: main.c:840
msgid ""
"Examples:\n"
"\tgawk '{ sum += $1 }; END { print sum }' file\n"
@@ -1834,7 +2964,7 @@ msgstr ""
"\tgawk '{ sum += $1 }; END { print sum }' file\n"
"\tgawk -F: '{ print $1 }' /etc/passwd\n"
-#: main.c:810
+#: main.c:860
#, c-format
msgid ""
"Copyright (C) 1989, 1991-%d Free Software Foundation.\n"
@@ -1853,7 +2983,7 @@ msgstr ""
"Licenza, o (a tua scelta) a una qualsiasi versione successiva.\n"
"\n"
-#: main.c:818
+#: main.c:868
msgid ""
"This program is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
@@ -1867,7 +2997,7 @@ msgstr ""
"Vedi la 'GNU General Public License' per ulteriori dettagli.\n"
"\n"
-#: main.c:824
+#: main.c:874
msgid ""
"You should have received a copy of the GNU General Public License\n"
"along with this program. If not, see http://www.gnu.org/licenses/.\n"
@@ -1876,16 +3006,16 @@ msgstr ""
"assieme a questo programma; se non è così, vedi http://www.gnu.org/"
"licenses/.\n"
-#: main.c:859
+#: main.c:909
msgid "-Ft does not set FS to tab in POSIX awk"
msgstr "-Ft non imposta FS a 'tab' nell'awk POSIX"
-#: main.c:1093
+#: main.c:1169
#, c-format
msgid "unknown value for field spec: %d\n"
msgstr "valore non noto per specifica campo: %d\n"
-#: main.c:1174
+#: main.c:1267
#, c-format
msgid ""
"%s: `%s' argument to `-v' not in `var=value' form\n"
@@ -1894,79 +3024,145 @@ msgstr ""
"%s: `%s' argomento di `-v' non in forma `var=valore'\n"
"\n"
-#: main.c:1200
+#: main.c:1293
#, c-format
msgid "`%s' is not a legal variable name"
msgstr "`%s' non è un nome di variabile ammesso"
-#: main.c:1203
+#: main.c:1296
#, c-format
msgid "`%s' is not a variable name, looking for file `%s=%s'"
msgstr "`%s' non è un nome di variabile, cerco il file `%s=%s'"
-#: main.c:1207
+#: main.c:1300
#, c-format
msgid "cannot use gawk builtin `%s' as variable name"
msgstr "nome funzione interna gawk `%s' non ammesso come nome variabile"
-#: main.c:1212
+#: main.c:1305
#, c-format
msgid "cannot use function `%s' as variable name"
msgstr "non posso usare nome di funzione `%s' come nome di variabile"
-#: main.c:1265
+#: main.c:1358
msgid "floating point exception"
msgstr "eccezione floating point"
-#: main.c:1272
+#: main.c:1365
msgid "fatal error: internal error"
msgstr "errore fatale: errore interno"
-#: main.c:1287
+#: main.c:1380
msgid "fatal error: internal error: segfault"
msgstr "errore fatale: errore interno: segfault"
-#: main.c:1299
+#: main.c:1392
msgid "fatal error: internal error: stack overflow"
msgstr "errore fatale: errore interno: stack overflow"
-#: main.c:1349
+#: main.c:1448
#, c-format
msgid "no pre-opened fd %d"
msgstr "manca 'fd' pre-aperta %d"
-#: main.c:1356
+#: main.c:1455
#, c-format
msgid "could not pre-open /dev/null for fd %d"
msgstr "non riesco a pre-aprire /dev/null per 'fd' %d"
-#: msg.c:63
+#: mpfr.c:563
+#, fuzzy, c-format
+msgid "PREC value `%.*s' is invalid"
+msgstr "valore di BINMODE `%s' non valido, considerato come 3"
+
+#: mpfr.c:621
+#, fuzzy, c-format
+msgid "RNDMODE value `%.*s' is invalid"
+msgstr "valore di BINMODE `%s' non valido, considerato come 3"
+
+#: mpfr.c:711
+#, fuzzy, c-format
+msgid "%s: received non-numeric argument"
+msgstr "cos: l'argomento non è numerico"
+
+#: mpfr.c:813
+#, fuzzy
+msgid "compl(%Rg): negative value will give strange results"
+msgstr "compl(%lf): valore negativo darà risultati strani"
+
+#: mpfr.c:817
+#, fuzzy
+msgid "comp(%Rg): fractional value will be truncated"
+msgstr "compl(%lf): valore con decimali verrà troncato"
+
+#: mpfr.c:829
+#, fuzzy, c-format
+msgid "cmpl(%Zd): negative values will give strange results"
+msgstr "compl(%lf): valore negativo darà risultati strani"
+
+#: mpfr.c:856
+#, fuzzy, c-format
+msgid "%s: received non-numeric first argument"
+msgstr "or: il primo argomento non è numerico"
+
+#: mpfr.c:858
+#, fuzzy, c-format
+msgid "%s: received non-numeric second argument"
+msgstr "or: il secondo argomento non è numerico"
+
+#: mpfr.c:877
+#, fuzzy
+msgid "%s(%Rg, ..): negative values will give strange results"
+msgstr "or(%lf, %lf): valori negativi daranno risultati strani"
+
+#: mpfr.c:882
+#, fuzzy
+msgid "%s(%Rg, ..): fractional values will be truncated"
+msgstr "or(%lf, %lf): valori con decimali verranno troncati"
+
+#: mpfr.c:895
+#, fuzzy, c-format
+msgid "%s(%Zd, ..): negative values will give strange results"
+msgstr "or(%lf, %lf): valori negativi daranno risultati strani"
+
+#: mpfr.c:914
+#, fuzzy
+msgid "%s(.., %Rg): negative values will give strange results"
+msgstr "or(%lf, %lf): valori negativi daranno risultati strani"
+
+#: mpfr.c:919
+#, fuzzy
+msgid "%s(.., %Rg): fractional values will be truncated"
+msgstr "or(%lf, %lf): valori con decimali verranno troncati"
+
+#: mpfr.c:932
+#, fuzzy, c-format
+msgid "%s(.., %Zd): negative values will give strange results"
+msgstr "or(%lf, %lf): valori negativi daranno risultati strani"
+
+#: msg.c:61
#, c-format
msgid "cmd. line:"
msgstr "linea com.:"
-#: msg.c:107
-msgid "error: "
-msgstr "errore: "
-
-#: node.c:406
+#: node.c:436
msgid "backslash at end of string"
msgstr "'\\' a fine stringa"
-#: node.c:517
+#: node.c:520
#, c-format
msgid "old awk does not support the `\\%c' escape sequence"
msgstr "il vecchio awk non supporta la sequenza di escape '\\%c'"
-#: node.c:568
+#: node.c:571
msgid "POSIX does not allow `\\x' escapes"
msgstr "POSIX non permette escape `\\x'"
-#: node.c:574
+#: node.c:577
msgid "no hex digits in `\\x' escape sequence"
msgstr "niente cifre esadecimali nella sequenza di escape `\\x'"
-#: node.c:596
+#: node.c:599
#, c-format
msgid ""
"hex escape \\x%.*s of %d characters probably not interpreted the way you "
@@ -1975,12 +3171,12 @@ msgstr ""
"sequenza di escape esadec.\\x%.*s di %d caratteri probabilmente non "
"interpretata nel modo previsto"
-#: node.c:611
+#: node.c:614
#, c-format
msgid "escape sequence `\\%c' treated as plain `%c'"
msgstr "sequenza di escape `\\%c' considerata come semplice `%c'"
-#: node.c:750
+#: node.c:759
msgid ""
"Invalid multibyte data detected. There may be a mismatch between your data "
"and your locale."
@@ -1988,27 +3184,27 @@ msgstr ""
"Trovati dati multi-byte invalidi. Può esserci una differenza tra i dati e la "
"codifica locale."
-#: posix/gawkmisc.c:176
+#: posix/gawkmisc.c:177
#, c-format
msgid "%s %s `%s': could not get fd flags: (fcntl F_GETFD: %s)"
msgstr "%s %s `%s': non riesco a ottenere flag 'fd': (fcntl F_GETFD: %s)"
-#: posix/gawkmisc.c:188
+#: posix/gawkmisc.c:189
#, c-format
msgid "%s %s `%s': could not set close-on-exec: (fcntl F_SETFD: %s)"
msgstr ""
"%s %s `%s': non riesco a impostare 'close-on-exec': (fcntl F_SETFD: %s)"
-#: profile.c:83
+#: profile.c:70
#, c-format
msgid "could not open `%s' for writing: %s"
msgstr "non riesco ad aprire `%s' in scrittura: %s"
-#: profile.c:85
+#: profile.c:72
msgid "sending profile to standard error"
msgstr "mando profilo a 'standard error'"
-#: profile.c:203
+#: profile.c:188
#, c-format
msgid ""
"\t# %s block(s)\n"
@@ -2017,7 +3213,7 @@ msgstr ""
"\t# blocco(hi) %s\n"
"\n"
-#: profile.c:208
+#: profile.c:193
#, c-format
msgid ""
"\t# Rule(s)\n"
@@ -2026,17 +3222,22 @@ msgstr ""
"\t# Regola(e)\n"
"\n"
-#: profile.c:279
+#: profile.c:267
#, c-format
msgid "internal error: %s with null vname"
msgstr "errore interno: %s con 'vname' nullo"
-#: profile.c:952
+#: profile.c:529
+#, fuzzy
+msgid "internal error: builtin with null fname"
+msgstr "errore interno: %s con 'vname' nullo"
+
+#: profile.c:944
#, c-format
msgid "\t# gawk profile, created %s\n"
msgstr "\t# profilo gawk, creato %s\n"
-#: profile.c:1331
+#: profile.c:1329
#, c-format
msgid ""
"\n"
@@ -2045,17 +3246,17 @@ msgstr ""
"\n"
"\t# Funzioni, in ordine alfabetico\n"
-#: profile.c:1370
+#: profile.c:1367
#, c-format
msgid "redir2str: unknown redirection type %d"
msgstr "redir2str: tipo di re-direzione non noto %d"
-#: re.c:573
+#: re.c:568
#, c-format
msgid "range of the form `[%c-%c]' is locale dependent"
msgstr "intervallo della forma `[%c-%c]' dipende da 'locale'"
-#: re.c:600
+#: re.c:595
#, c-format
msgid "regexp component `%.*s' should probably be `[%.*s]'"
msgstr ""
@@ -2101,10 +3302,6 @@ msgstr "( o \\( non chiusa"
msgid "Unmatched \\{"
msgstr "\\{ non chiusa"
-#: regcomp.c:161
-msgid "Invalid content of \\{\\}"
-msgstr "Contenuto di \\{\\} non valido"
-
#: regcomp.c:164
msgid "Invalid range end"
msgstr "Fine di intervallo non valido"
@@ -2121,10 +3318,6 @@ msgstr "Espressione regolare precedente invalida"
msgid "Premature end of regular expression"
msgstr "Fine di espressione regolare inaspettata"
-#: regcomp.c:176
-msgid "Regular expression too big"
-msgstr "Espressione regolare troppo complessa"
-
#: regcomp.c:179
msgid "Unmatched ) or \\)"
msgstr ") o \\) non aperta"
@@ -2133,26 +3326,44 @@ msgstr ") o \\) non aperta"
msgid "No previous regular expression"
msgstr "Nessuna espressione regolare precedente"
+#: symbol.c:722
+msgid "can not pop main context"
+msgstr ""
+
+#, fuzzy
+#~ msgid "attempt to use function `%s' as an array"
+#~ msgstr "tentativo di usare scalare '%s' come vettore"
+
+#, fuzzy
+#~ msgid "reference to uninitialized element `%s[\"%.*s\"]'"
+#~ msgstr "riferimento ad argomento non inizializzato `%s'"
+
#~ msgid "`nextfile' is a gawk extension"
#~ msgstr "`nextfile' è un'estensione gawk"
#~ msgid "`delete array' is a gawk extension"
#~ msgstr "`delete array' è un'estensione gawk"
-#~ msgid "dynamic loading of library not supported"
-#~ msgstr "caricamento dinamico di libreria non supportato"
+#~ msgid "and: received non-numeric first argument"
+#~ msgstr "and: il primo argomento non è numerico"
+
+#~ msgid "and: received non-numeric second argument"
+#~ msgstr "and: il secondo argomento non è numerico"
+
+#~ msgid "and(%lf, %lf): fractional values will be truncated"
+#~ msgstr "and(%lf, %lf): valori con decimali verranno troncati"
-#~ msgid "\t-D[file]\t\t--debug[=file]\n"
-#~ msgstr "\t-D[file]\t\t--debug[=file]\n"
+#~ msgid "xor: received non-numeric first argument"
+#~ msgstr "xor: il primo argomento non è numerico"
-#~ msgid "\t-l library\t\t--load=library\n"
-#~ msgstr "\t-l libreria\t\t--load=libreria\n"
+#~ msgid "xor: received non-numeric second argument"
+#~ msgstr "xor: il secondo argomento non è numerico"
-#~ msgid "\t-M\t\t\t--bignum\n"
-#~ msgstr "\t-M\t\t\t--bignum\n"
+#~ msgid "xor(%lf, %lf): fractional values will be truncated"
+#~ msgstr "xor(%lf, %lf): valori con decimali verranno troncati"
-#~ msgid "\t-o[file]\t\t--pretty-print[=file]\n"
-#~ msgstr "\t-o[file]\t\t--pretty-print[=file]\n"
+#~ msgid "`extension' is a gawk extension"
+#~ msgstr "`extension' è un'estensione gawk"
-#~ msgid "internal error: builtin with null fname"
-#~ msgstr "errore interno: funzione interna con 'fname' nullo"
+#~ msgid "Operation Not Supported"
+#~ msgstr "Operazione Non Supportata"
diff --git a/po/ja.gmo b/po/ja.gmo
index 6acfa1e4..025aedf0 100644
--- a/po/ja.gmo
+++ b/po/ja.gmo
Binary files differ
diff --git a/po/ja.po b/po/ja.po
index cffeb573..656e1787 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gawk 4.0.0\n"
"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
-"POT-Creation-Date: 2012-10-13 20:24+0200\n"
+"POT-Creation-Date: 2012-10-13 21:21+0200\n"
"PO-Revision-Date: 2011-07-17 08:28+0900\n"
"Last-Translator: Yasuaki Taniguchi <yasuakit@gmail.com>\n"
"Language-Team: Japanese <translation-team-ja@lists.sourceforge.net>\n"
@@ -18,491 +18,482 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-#: array.c:140
+#: array.c:266
#, c-format
msgid "from %s"
msgstr "%s ã‹ã‚‰"
-#: array.c:248
+#: array.c:366
msgid "attempt to use a scalar value as array"
msgstr "スカラー値をé…列ã¨ã—ã¦ä½¿ç”¨ã™ã‚‹è©¦ã¿ã§ã™"
-#: array.c:251
-#, c-format
-msgid "attempt to use function `%s' as an array"
-msgstr "関数 `%s' ã‚’é…列ã¨ã—ã¦ä½¿ç”¨ã™ã‚‹è©¦ã¿ã§ã™"
-
-#: array.c:254
+#: array.c:368
#, c-format
msgid "attempt to use scalar parameter `%s' as an array"
msgstr "スカラー仮引数 `%s' ã‚’é…列ã¨ã—ã¦ä½¿ç”¨ã™ã‚‹è©¦ã¿ã§ã™"
-#: array.c:257
+#: array.c:371
#, c-format
msgid "attempt to use scalar `%s' as an array"
msgstr "スカラー `%s' ã‚’é…列ã¨ã—ã¦ä½¿ç”¨ã™ã‚‹è©¦ã¿ã§ã™"
-#: array.c:302 array.c:707 builtin.c:84 builtin.c:1385 builtin.c:1427
-#: builtin.c:1440 builtin.c:1859 builtin.c:1871 eval.c:1135 eval.c:1139
-#: eval.c:1495 eval.c:1812
+#: array.c:418 array.c:584 builtin.c:85 builtin.c:1566 builtin.c:1608
+#: builtin.c:1621 builtin.c:2047 builtin.c:2059 eval.c:1121 eval.c:1125
+#: eval.c:1520
#, c-format
msgid "attempt to use array `%s' in a scalar context"
msgstr "スカラーコンテキストã§é…列 `%s' を使用ã™ã‚‹è©¦ã¿ã§ã™"
-#: array.c:513
-#, c-format
-msgid "reference to uninitialized element `%s[\"%.*s\"]'"
-msgstr "åˆæœŸåŒ–ã•ã‚Œã¦ã„ãªã„è¦ç´  `%s[\"%.*s\"]' ã¸ã®å‚ç…§ã§ã™"
-
-#: array.c:519
-#, c-format
-msgid "subscript of array `%s' is null string"
-msgstr "é…列 `%s' ã®æ·»å­—㌠NULL 文字列ã§ã™"
-
-#: array.c:723
+#: array.c:591
#, c-format
msgid "delete: index `%s' not in array `%s'"
msgstr "delete: é…列 `%2$s' 内ã«ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ `%1$s' ãŒã‚ã‚Šã¾ã›ã‚“"
-#: array.c:734 eval.c:1865
+#: array.c:605
#, c-format
msgid "attempt to use scalar `%s[\"%.*s\"]' as an array"
msgstr "スカラー `%s[\"%.*s\"]' ã‚’é…列ã¨ã—ã¦ä½¿ç”¨ã™ã‚‹è©¦ã¿ã§ã™"
-#: array.c:910
-#, c-format
-msgid "%s: empty (null)\n"
-msgstr "%s: 空 (null)\n"
-
-#: array.c:915
-#, c-format
-msgid "%s: empty (zero)\n"
-msgstr "%s: 空 (zero)\n"
-
-#: array.c:919
-#, c-format
-msgid "%s: table_size = %d, array_size = %d\n"
-msgstr "%s: テーブルサイズ (table_size) = %d, é…列サイズ (array_size) = %d\n"
-
-#: array.c:954
-#, c-format
-msgid "%s: is parameter\n"
-msgstr "%s: 仮引数ã§ã™\n"
-
-#: array.c:958
-#, c-format
-msgid "%s: array_ref to %s\n"
-msgstr "%s: %s ã¸ã®é…列å‚ç…§ (array_ref) ã§ã™\n"
-
-#: array.c:963
-msgid "adump: argument not an array"
+#: array.c:784
+#, fuzzy
+msgid "adump: first argument not an array"
msgstr "adump: 引数ãŒé…列ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
-#: array.c:1086
+#: array.c:823
msgid "asort: second argument not an array"
msgstr "asort: 第二引数ãŒé…列ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
-#: array.c:1087
+#: array.c:824
msgid "asorti: second argument not an array"
msgstr "asorti: 第二引数ãŒé…列ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
-#: array.c:1094
+#: array.c:831
msgid "asort: first argument not an array"
msgstr "asort: 第一引数ãŒé…列ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
-#: array.c:1095
+#: array.c:832
msgid "asorti: first argument not an array"
msgstr "asorti: 第一引数ãŒé…列ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
-#: array.c:1102
+#: array.c:839
msgid "asort: cannot use a subarray of first arg for second arg"
msgstr "asort: 第一引数ã®éƒ¨åˆ†é…列を第二引数用ã«ä½¿ç”¨ã™ã‚‹ã“ã¨ã¯å‡ºæ¥ã¾ã›ã‚“"
-#: array.c:1103
+#: array.c:840
msgid "asorti: cannot use a subarray of first arg for second arg"
msgstr "asorti: 第一引数ã®éƒ¨åˆ†é…列を第二引数用ã«ä½¿ç”¨ã™ã‚‹ã“ã¨ã¯å‡ºæ¥ã¾ã›ã‚“"
-#: array.c:1108
+#: array.c:845
msgid "asort: cannot use a subarray of second arg for first arg"
msgstr "asort: 第二引数ã®éƒ¨åˆ†é…列を第一引数用ã«ä½¿ç”¨ã™ã‚‹ã“ã¨ã¯å‡ºæ¥ã¾ã›ã‚“"
-#: array.c:1109
+#: array.c:846
msgid "asorti: cannot use a subarray of second arg for first arg"
msgstr "asorti: 第二引数ã®éƒ¨åˆ†é…列を第一引数用ã«ä½¿ç”¨ã™ã‚‹ã“ã¨ã¯å‡ºæ¥ã¾ã›ã‚“"
-#: array.c:1655
+#: array.c:1314
#, c-format
msgid "`%s' is invalid as a function name"
msgstr "`%s' ã¯é–¢æ•°åã¨ã—ã¦ã¯ç„¡åŠ¹ã§ã™"
-#: array.c:1659
+#: array.c:1318
#, c-format
msgid "sort comparison function `%s' is not defined"
msgstr "ソート比較関数 `%s' ãŒå®šç¾©ã•ã‚Œã¦ã„ã¾ã›ã‚“"
-#: awkgram.y:249
+#: awkgram.y:223
#, c-format
msgid "%s blocks must have an action part"
msgstr "%s ブロックã«ã¯ã‚¢ã‚¯ã‚·ãƒ§ãƒ³éƒ¨ãŒå¿…é ˆã§ã™"
-#: awkgram.y:252
+#: awkgram.y:226
msgid "each rule must have a pattern or an action part"
msgstr "å„ルールã«ã¯ãƒ‘ターンã¾ãŸã¯ã‚¢ã‚¯ã‚·ãƒ§ãƒ³éƒ¨ãŒå¿…é ˆã§ã™ã€‚"
-#: awkgram.y:323 awkgram.y:334
+#: awkgram.y:315 awkgram.y:326
msgid "old awk does not support multiple `BEGIN' or `END' rules"
msgstr "å¤ã„ awk ã¯è¤‡æ•°ã® `BEGIN' ã¾ãŸã¯ `END' ルールをサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
-#: awkgram.y:371
+#: awkgram.y:363
#, c-format
msgid "`%s' is a built-in function, it cannot be redefined"
msgstr "`%s' ã¯çµ„è¾¼ã¿é–¢æ•°ã§ã™ã€‚å†å®šç¾©ã§ãã¾ã›ã‚“"
-#: awkgram.y:432
+#: awkgram.y:409
msgid "regexp constant `//' looks like a C++ comment, but is not"
msgstr "æ­£è¦è¡¨ç¾å®šæ•° `//' 㯠C++コメントã«ä¼¼ã¦ã„ã¾ã™ãŒã€é•ã„ã¾ã™ã€‚"
-#: awkgram.y:436
+#: awkgram.y:413
#, c-format
msgid "regexp constant `/%s/' looks like a C comment, but is not"
msgstr "æ­£è¦è¡¨ç¾å®šæ•° `/%s/' 㯠C コメントã«ä¼¼ã¦ã„ã¾ã™ãŒã€ç•°ãªã‚Šã¾ã™"
-#: awkgram.y:528
+#: awkgram.y:505
#, c-format
msgid "duplicate case values in switch body: %s"
msgstr "switch æ–‡ã®ä¸­ã§é‡è¤‡ã—㟠case 値ãŒä½¿ç”¨ã•ã‚Œã¦ã„ã¾ã™: %s"
-#: awkgram.y:549
+#: awkgram.y:526
msgid "duplicate `default' detected in switch body"
msgstr "switch æ–‡ã®ä¸­ã§é‡è¤‡ã—㟠`default' ãŒæ¤œå‡ºã•ã‚Œã¾ã—ãŸ"
-#: awkgram.y:809
+#: awkgram.y:786
msgid "`break' is not allowed outside a loop or switch"
msgstr "`break' ã¯ãƒ«ãƒ¼ãƒ—ã¾ãŸã¯ switch ã®å¤–ã§ã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
-#: awkgram.y:818
+#: awkgram.y:795
msgid "`continue' is not allowed outside a loop"
msgstr "`continue' ã¯ãƒ«ãƒ¼ãƒ—ã®å¤–ã§ã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
-#: awkgram.y:828
+#: awkgram.y:805
#, c-format
msgid "`next' used in %s action"
msgstr "%s アクション内㧠`next' ãŒä½¿ç”¨ã•ã‚Œã¾ã—ãŸ"
-#: awkgram.y:837
+#: awkgram.y:814
#, c-format
msgid "`nextfile' used in %s action"
msgstr "`nextfile' ㌠%s アクション内ã§ä½¿ç”¨ã•ã‚Œã¾ã—ãŸ"
-#: awkgram.y:861
+#: awkgram.y:838
msgid "`return' used outside function context"
msgstr "`return' ãŒé–¢æ•°å®šç¾©æ–‡ã®å¤–ã§ä½¿ã‚ã‚Œã¾ã—ãŸ"
-#: awkgram.y:921
+#: awkgram.y:912
msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'"
msgstr ""
"BEGIN ã¾ãŸã¯ END ルール内ã®å¼•æ•°ã®ç„¡ã„ `print' 㯠`print \"\"' ã ã¨æ€ã‚ã‚Œã¾ã™"
-#: awkgram.y:1016 awkgram.y:1020
+#: awkgram.y:978 awkgram.y:1027
+msgid "`delete' is not allowed with SYMTAB"
+msgstr ""
+
+#: awkgram.y:980 awkgram.y:1029
+msgid "`delete' is not allowed with FUNCTAB"
+msgstr ""
+
+#: awkgram.y:1014 awkgram.y:1018
msgid "`delete(array)' is a non-portable tawk extension"
msgstr "`delete(array)' ã¯ç§»æ¤æ€§ã®ç„¡ã„ tawk æ‹¡å¼µã§ã™"
-#: awkgram.y:1132
+#: awkgram.y:1139
msgid "multistage two-way pipelines don't work"
msgstr "多段階ã§åŒæ–¹å‘パイプを利用ã—ãŸå¼ã¯ä½¿ç”¨ã§ãã¾ã›ã‚“"
-#: awkgram.y:1235
+#: awkgram.y:1242
msgid "regular expression on right of assignment"
msgstr "æ­£è¦è¡¨ç¾ãŒä»£å…¥å¼ã®å³è¾ºã«ä½¿ç”¨ã•ã‚Œã¦ã„ã¾ã™"
-#: awkgram.y:1246
+#: awkgram.y:1253
msgid "regular expression on left of `~' or `!~' operator"
msgstr "`~' ã‚„ `!~' 演算å­ã®å·¦è¾ºã«æ­£è¦è¡¨ç¾ãŒä½¿ç”¨ã•ã‚Œã¦ã„ã¾ã™"
-#: awkgram.y:1262 awkgram.y:1416
+#: awkgram.y:1269 awkgram.y:1420
msgid "old awk does not support the keyword `in' except after `for'"
msgstr "å¤ã„ awk ã§ã¯ `in' 予約語㯠`for' ã®å¾Œã‚’除ãサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
-#: awkgram.y:1272
+#: awkgram.y:1279
msgid "regular expression on right of comparison"
msgstr "比較å¼ã®å³è¾ºã«æ­£è¦è¡¨ç¾ãŒä½¿ç”¨ã•ã‚Œã¦ã„ã¾ã™ã€‚"
-#: awkgram.y:1391
+#: awkgram.y:1395
#, c-format
msgid "`getline var' invalid inside `%s' rule"
msgstr "`%s' ルールã®å†…部ã§ã¯ `getline var' ã¯ç„¡åŠ¹ã§ã™"
-#: awkgram.y:1394 eval.c:2504
+#: awkgram.y:1398
#, c-format
msgid "`getline' invalid inside `%s' rule"
msgstr "`%s' ルールã®å†…部ã§ã¯ `getline' ã¯ç„¡åŠ¹ã§ã™"
-#: awkgram.y:1399
+#: awkgram.y:1403
msgid "non-redirected `getline' undefined inside END action"
msgstr "リダイレクトã•ã‚Œã¦ã„ãªã„ `getline' 㯠END アクションã§ã¯æœªå®šç¾©ã§ã™ã€‚"
-#: awkgram.y:1418
+#: awkgram.y:1422
msgid "old awk does not support multidimensional arrays"
msgstr "å¤ã„ awk ã¯å¤šæ¬¡å…ƒé…列をサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
-#: awkgram.y:1514
+#: awkgram.y:1519
msgid "call of `length' without parentheses is not portable"
msgstr "å°æ‹¬å¼§ãŒç„¡ã„ `length' ã¯ç§»æ¤æ€§ãŒã‚ã‚Šã¾ã›ã‚“"
-#: awkgram.y:1577
+#: awkgram.y:1585
msgid "indirect function calls are a gawk extension"
msgstr "間接関数呼ã³å‡ºã—㯠gawk æ‹¡å¼µã§ã™"
-#: awkgram.y:1590
+#: awkgram.y:1598
#, c-format
msgid "can not use special variable `%s' for indirect function call"
msgstr "特別ãªå¤‰æ•° `%s' ã¯é–“接関数呼ã³å‡ºã—用ã«ã¯ä½¿ç”¨å‡ºæ¥ã¾ã›ã‚“"
-#: awkgram.y:1668
+#: awkgram.y:1676
msgid "invalid subscript expression"
msgstr "添字ã®å¼ãŒç„¡åŠ¹ã§ã™"
-#: awkgram.y:1708
-msgid "use of non-array as array"
-msgstr "é…列ã§ãªã„ã‚‚ã®ã‚’é…列ã¨ã—ã¦ä½¿ç”¨ã—ã¦ã„ã¾ã™"
-
-#: awkgram.y:1972 awkgram.y:1992 msg.c:98
+#: awkgram.y:2000 awkgram.y:2020 gawkapi.c:203 gawkapi.c:221 msg.c:119
msgid "warning: "
msgstr "警告: "
-#: awkgram.y:1990 msg.c:130
+#: awkgram.y:2018 gawkapi.c:189 gawkapi.c:218 msg.c:151
msgid "fatal: "
msgstr "致命的: "
-#: awkgram.y:2040
+#: awkgram.y:2068
msgid "unexpected newline or end of string"
msgstr "予期ã—ãªã„改行ã¾ãŸã¯æ–‡å­—列終端ã§ã™"
-#: awkgram.y:2297 awkgram.y:2355 awkgram.y:2539
+#: awkgram.y:2335 awkgram.y:2411 awkgram.y:2634 debug.c:517 debug.c:533
+#: debug.c:2790 debug.c:5038
#, c-format
msgid "can't open source file `%s' for reading (%s)"
msgstr "ソースファイル `%s' を読ã¿è¾¼ã¿ç”¨ã«é–‹ã‘ã¾ã›ã‚“ (%s)"
-#: awkgram.y:2298 awkgram.y:2356 builtin.c:122
+#: awkgram.y:2336 awkgram.y:2461
+#, fuzzy, c-format
+msgid "can't open shared library `%s' for reading (%s)"
+msgstr "ソースファイル `%s' を読ã¿è¾¼ã¿ç”¨ã«é–‹ã‘ã¾ã›ã‚“ (%s)"
+
+#: awkgram.y:2338 awkgram.y:2412 awkgram.y:2462 builtin.c:130 debug.c:5189
msgid "reason unknown"
msgstr "原因ä¸æ˜Ž"
-#: awkgram.y:2314
+#: awkgram.y:2347 awkgram.y:2371
+#, c-format
+msgid "can't include `%s' and use it as a program file"
+msgstr ""
+
+#: awkgram.y:2360
#, c-format
msgid "already included source file `%s'"
msgstr "ソースファイル `%s' ã¯æ—¢ã«èª­ã¿è¾¼ã¾ã‚Œã¦ã„ã¾ã™"
-#: awkgram.y:2340
+#: awkgram.y:2361
+#, fuzzy, c-format
+msgid "already loaded shared library `%s'"
+msgstr "ソースファイル `%s' ã¯æ—¢ã«èª­ã¿è¾¼ã¾ã‚Œã¦ã„ã¾ã™"
+
+#: awkgram.y:2396
msgid "@include is a gawk extension"
msgstr "@include 㯠gawk æ‹¡å¼µã§ã™"
-#: awkgram.y:2346
+#: awkgram.y:2402
msgid "empty filename after @include"
msgstr "@include ã®å¾Œã«ç©ºã®ãƒ•ã‚¡ã‚¤ãƒ«åãŒã‚ã‚Šã¾ã™"
-#: awkgram.y:2491
+#: awkgram.y:2446
+#, fuzzy
+msgid "@load is a gawk extension"
+msgstr "@include 㯠gawk æ‹¡å¼µã§ã™"
+
+#: awkgram.y:2452
+#, fuzzy
+msgid "empty filename after @load"
+msgstr "@include ã®å¾Œã«ç©ºã®ãƒ•ã‚¡ã‚¤ãƒ«åãŒã‚ã‚Šã¾ã™"
+
+#: awkgram.y:2586
msgid "empty program text on command line"
msgstr "コマンド行ã®ãƒ—ログラム表記ãŒç©ºã§ã™"
-#: awkgram.y:2606
+#: awkgram.y:2701
#, c-format
msgid "can't read sourcefile `%s' (%s)"
msgstr "ソースファイル `%s' を読ã¿è¾¼ã‚ã¾ã›ã‚“ (%s)"
-#: awkgram.y:2617
+#: awkgram.y:2712
#, c-format
msgid "source file `%s' is empty"
msgstr "ソースファイル `%s' ã¯ç©ºã§ã™"
-#: awkgram.y:2794
+#: awkgram.y:2889
msgid "source file does not end in newline"
msgstr "ソースファイルãŒæ”¹è¡Œã§çµ‚ã£ã¦ã„ã¾ã›ã‚“"
-#: awkgram.y:2897
+#: awkgram.y:2994
msgid "unterminated regexp ends with `\\' at end of file"
msgstr "終端ã•ã‚Œã¦ã„ãªã„æ­£è¦è¡¨ç¾ãŒãƒ•ã‚¡ã‚¤ãƒ«æœ€å¾Œã® `\\' ã§çµ‚ã£ã¦ã„ã¾ã™ã€‚"
-#: awkgram.y:2921
+#: awkgram.y:3018
#, c-format
msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk"
msgstr "%s: %d: tawk ã®æ­£è¦è¡¨ç¾ä¿®é£¾å­ `/.../%c' 㯠gawk ã§ä½¿ç”¨ã§ãã¾ã›ã‚“"
-#: awkgram.y:2925
+#: awkgram.y:3022
#, c-format
msgid "tawk regex modifier `/.../%c' doesn't work in gawk"
msgstr "tawk ã®æ­£è¦è¡¨ç¾ä¿®é£¾å­ `/.../%c' 㯠gawk ã§ä½¿ç”¨ã§ãã¾ã›ã‚“"
-#: awkgram.y:2932
+#: awkgram.y:3029
msgid "unterminated regexp"
msgstr "æ­£è¦è¡¨ç¾ãŒçµ‚端ã•ã‚Œã¦ã„ã¾ã›ã‚“"
-#: awkgram.y:2936
+#: awkgram.y:3033
msgid "unterminated regexp at end of file"
msgstr "ファイルã®ä¸­ã§æ­£è¦è¡¨ç¾ãŒçµ‚端ã•ã‚Œã¦ã„ã¾ã›ã‚“"
-#: awkgram.y:2995
+#: awkgram.y:3092
msgid "use of `\\ #...' line continuation is not portable"
msgstr "`\\ #...' å½¢å¼ã®è¡Œç¶™ç¶šã¯ç§»æ¤æ€§ãŒã‚ã‚Šã¾ã›ã‚“"
-#: awkgram.y:3011
+#: awkgram.y:3108
msgid "backslash not last character on line"
msgstr "ãƒãƒƒã‚¯ã‚¹ãƒ©ãƒƒã‚·ãƒ¥ãŒè¡Œæœ€å¾Œã®æ–‡å­—ã«ãªã£ã¦ã„ã¾ã›ã‚“。"
-#: awkgram.y:3072
+#: awkgram.y:3169
msgid "POSIX does not allow operator `**='"
msgstr "POSIX ã§ã¯æ¼”ç®—å­ `**=' ã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
-#: awkgram.y:3074
+#: awkgram.y:3171
msgid "old awk does not support operator `**='"
msgstr "å¤ã„ awk ã¯æ¼”ç®—å­ `**=' をサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
-#: awkgram.y:3083
+#: awkgram.y:3180
msgid "POSIX does not allow operator `**'"
msgstr "POSIX ã§ã¯æ¼”ç®—å­ `**' ã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
-#: awkgram.y:3085
+#: awkgram.y:3182
msgid "old awk does not support operator `**'"
msgstr "å¤ã„ awk ã¯æ¼”ç®—å­ `**' をサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
-#: awkgram.y:3120
+#: awkgram.y:3217
msgid "operator `^=' is not supported in old awk"
msgstr "å¤ã„ awk ã¯æ¼”ç®—å­ `^=' をサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
-#: awkgram.y:3128
+#: awkgram.y:3225
msgid "operator `^' is not supported in old awk"
msgstr "å¤ã„ awk ã¯æ¼”ç®—å­ `^' をサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
-#: awkgram.y:3221 awkgram.y:3237
+#: awkgram.y:3318 awkgram.y:3334 command.y:1178
msgid "unterminated string"
msgstr "文字列ãŒçµ‚端ã•ã‚Œã¦ã„ã¾ã›ã‚“"
-#: awkgram.y:3433
+#: awkgram.y:3555
#, c-format
msgid "invalid char '%c' in expression"
msgstr "å¼å†…ã«ç„¡åŠ¹ãªæ–‡å­— '%c' ãŒã‚ã‚Šã¾ã™"
-#: awkgram.y:3480
+#: awkgram.y:3602
#, c-format
msgid "`%s' is a gawk extension"
msgstr "`%s' 㯠gawk æ‹¡å¼µã§ã™"
-#: awkgram.y:3485
+#: awkgram.y:3607
#, c-format
msgid "`%s' is a Bell Labs extension"
msgstr "`%s' ã¯ãƒ™ãƒ«ç ”究所ã«ã‚ˆã‚‹æ‹¡å¼µã§ã™"
-#: awkgram.y:3490
+#: awkgram.y:3612
#, c-format
msgid "POSIX does not allow `%s'"
msgstr "POSIX ã§ã¯ `%s' ã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
-#: awkgram.y:3498
+#: awkgram.y:3620
#, c-format
msgid "`%s' is not supported in old awk"
msgstr "å¤ã„ awk 㯠`%s' をサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
-#: awkgram.y:3565
+#: awkgram.y:3688
msgid "`goto' considered harmful!\n"
msgstr "`goto' ã¯æœ‰å®³ã ã¨è¦‹ãªã•ã‚Œã¦ã„ã¾ã™!\n"
-#: awkgram.y:3616
+#: awkgram.y:3722
#, c-format
msgid "%d is invalid as number of arguments for %s"
msgstr "%d 㯠%s 用ã®å¼•æ•°ã®æ•°ã¨ã—ã¦ã¯ç„¡åŠ¹ã§ã™"
-#: awkgram.y:3651
+#: awkgram.y:3757
#, c-format
msgid "%s: string literal as last arg of substitute has no effect"
msgstr "%s: 文字列リテラルを置ãæ›ãˆæœ€å¾Œã®å¼•æ•°ã«ä½¿ç”¨ã™ã‚‹ã¨åŠ¹æžœãŒã‚ã‚Šã¾ã›ã‚“"
-#: awkgram.y:3656
+#: awkgram.y:3762
#, c-format
msgid "%s third parameter is not a changeable object"
msgstr "%s 第三仮引数ã¯å¯å¤‰ã‚ªãƒ–ジェクトã§ã¯ã‚ã‚Šã¾ã›ã‚“"
-#: awkgram.y:3729 awkgram.y:3732
+#: awkgram.y:3841 awkgram.y:3844
msgid "match: third argument is a gawk extension"
msgstr "match: 第三引数㯠gawk æ‹¡å¼µã§ã™"
-#: awkgram.y:3786 awkgram.y:3789
+#: awkgram.y:3898 awkgram.y:3901
msgid "close: second argument is a gawk extension"
msgstr "close: 第二引数㯠gawk æ‹¡å¼µã§ã™"
-#: awkgram.y:3801
+#: awkgram.y:3913
msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
msgstr ""
"dcgettext(_\"...\")ã®ä½¿ç”¨æ³•ãŒé–“é•ã£ã¦ã„ã¾ã™: 先頭ã®ã‚¢ãƒ³ãƒ€ãƒ¼ã‚¹ã‚³ã‚¢(_)を削除ã—"
"ã¦ãã ã•ã„"
-#: awkgram.y:3816
+#: awkgram.y:3928
msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
msgstr ""
"dcngettext(_\"...\")ã®ä½¿ç”¨æ³•ãŒé–“é•ã£ã¦ã„ã¾ã™: 先頭ã®ã‚¢ãƒ³ãƒ€ãƒ¼ã‚¹ã‚³ã‚¢(_)を削除ã—"
"ã¦ãã ã•ã„"
-#: awkgram.y:3908
-#, c-format
-msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
-msgstr "関数 `%s': 仮引数 #%d, `%s' ãŒä»®å¼•æ•° #%d ã¨é‡è¤‡ã—ã¦ã„ã¾ã™"
-
-#: awkgram.y:3950
+#: awkgram.y:3994
#, c-format
msgid "function `%s': parameter `%s' shadows global variable"
msgstr "関数 `%s': 仮引数 `%s' ãŒå¤§åŸŸå¤‰æ•°ã‚’覆ã„éš ã—ã¦ã„ã¾ã™"
-#: awkgram.y:4108
+#: awkgram.y:4051 debug.c:4019 debug.c:4062 debug.c:5187
#, c-format
msgid "could not open `%s' for writing (%s)"
msgstr "`%s' を書込ã¿ç”¨ã«é–‹ã‘ã¾ã›ã‚“ã§ã—㟠(%s)"
-#: awkgram.y:4109
+#: awkgram.y:4052
msgid "sending variable list to standard error"
msgstr "変数リストを標準エラーã«é€ã£ã¦ã„ã¾ã™"
-#: awkgram.y:4115
+#: awkgram.y:4060
#, c-format
msgid "%s: close failed (%s)"
msgstr "%s: é–‰ã˜ã‚‹ã®ã«å¤±æ•—ã—ã¾ã—㟠(%s)"
-#: awkgram.y:4167
+#: awkgram.y:4085
msgid "shadow_funcs() called twice!"
msgstr "shadow_funcs() を二回呼ã³å‡ºã—ã¦ã„ã¾ã™!"
-#: awkgram.y:4173
+#: awkgram.y:4093
msgid "there were shadowed variables."
msgstr "覆ã„éš ã•ã‚ŒãŸå¤‰æ•°ãŒã‚ã‚Šã¾ã—ãŸ"
-#: awkgram.y:4203
+#: awkgram.y:4164
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "関数å `%s' ã¯å‰ã«å®šç¾©ã•ã‚Œã¦ã„ã¾ã™"
+
+#: awkgram.y:4210
#, c-format
msgid "function `%s': can't use function name as parameter name"
msgstr "関数 `%s': 関数åを仮引数åã¨ã—ã¦ä½¿ç”¨å‡ºæ¥ã¾ã›ã‚“"
-#: awkgram.y:4207
+#: awkgram.y:4213
#, c-format
msgid "function `%s': can't use special variable `%s' as a function parameter"
msgstr "関数 `%s': 特別ãªå¤‰æ•° `%s' ã¯é–¢æ•°ã®ä»®å¼•æ•°ã¨ã—ã¦ä½¿ç”¨å‡ºæ¥ã¾ã›ã‚“"
-#: awkgram.y:4223
+#: awkgram.y:4221
#, c-format
-msgid "function name `%s' previously defined"
-msgstr "関数å `%s' ã¯å‰ã«å®šç¾©ã•ã‚Œã¦ã„ã¾ã™"
+msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
+msgstr "関数 `%s': 仮引数 #%d, `%s' ãŒä»®å¼•æ•° #%d ã¨é‡è¤‡ã—ã¦ã„ã¾ã™"
-#: awkgram.y:4391 awkgram.y:4397
+#: awkgram.y:4315 awkgram.y:4319
#, c-format
msgid "function `%s' called but never defined"
msgstr "未定義ã®é–¢æ•° `%s' を呼ã³å‡ºã—ã¾ã—ãŸ"
-#: awkgram.y:4400
+#: awkgram.y:4324
#, c-format
msgid "function `%s' defined but never called directly"
msgstr "関数 `%s' ã¯å®šç¾©ã•ã‚Œã¦ã„ã¾ã™ãŒã€ä¸€åº¦ã‚‚直接呼ã³å‡ºã•ã‚Œã¦ã„ã¾ã›ã‚“"
-#: awkgram.y:4432
+#: awkgram.y:4356
#, c-format
msgid "regexp constant for parameter #%d yields boolean value"
msgstr "仮引数 #%d 用ã®æ­£è¦è¡¨ç¾å®šæ•°ã¯çœŸå½å€¤ã‚’出力ã—ã¾ã™"
-#: awkgram.y:4541
+#: awkgram.y:4402
#, c-format
msgid ""
"function `%s' called with space between name and `(',\n"
@@ -511,230 +502,230 @@ msgstr ""
"関数å㨠`(' ã®é–“ã«ã‚¹ãƒšãƒ¼ã‚¹ã‚’入れã¦é–¢æ•° `%s' を呼ã³å‡ºã—ã¦ã„ã¾ã™ã€‚\n"
"ã¾ãŸã¯ã€å¤‰æ•°ã‹é…列ã¨ã—ã¦ä½¿ã‚ã‚Œã¦ã„ã¾ã™ã€‚"
-#: awkgram.y:4788 eval.c:2056
+#: awkgram.y:4618
msgid "division by zero attempted"
msgstr "ゼロã«ã‚ˆã‚‹é™¤ç®—ãŒè©¦ã¿ã‚‰ã‚Œã¾ã—ãŸ"
-#: awkgram.y:4797 eval.c:2072
+#: awkgram.y:4627
#, c-format
msgid "division by zero attempted in `%%'"
msgstr "`%%' 内ã§ã‚¼ãƒ­ã«ã‚ˆã‚‹é™¤ç®—ãŒè©¦ã¿ã‚‰ã‚Œã¾ã—ãŸ"
-#: builtin.c:120
+#: builtin.c:128
#, c-format
msgid "%s to \"%s\" failed (%s)"
msgstr "%s ã‹ã‚‰ \"%s\" ã¸å‡ºåŠ›ã§ãã¾ã›ã‚“ (%s)。"
-#: builtin.c:121
+#: builtin.c:129
msgid "standard output"
msgstr "標準出力"
-#: builtin.c:135
+#: builtin.c:143
msgid "exp: received non-numeric argument"
msgstr "exp: 引数ãŒæ•°å€¤ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
-#: builtin.c:141
+#: builtin.c:149
#, c-format
msgid "exp: argument %g is out of range"
msgstr "exp: 引数 %g ãŒç¯„囲外ã§ã™"
-#: builtin.c:200
+#: builtin.c:208
#, c-format
msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing"
msgstr ""
"fflush: flush ã§ãã¾ã›ã‚“: パイプ `%s' ã¯èª­ã¿è¾¼ã¿ç”¨ã«é–‹ã‹ã‚Œã¦ã„ã¾ã™ã€‚書ãè¾¼ã¿"
"用ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
-#: builtin.c:203
+#: builtin.c:211
#, c-format
msgid "fflush: cannot flush: file `%s' opened for reading, not writing"
msgstr ""
"fflush: flush ã§ãã¾ã›ã‚“: ファイル `%s' ã¯èª­ã¿è¾¼ã¿ç”¨ã«é–‹ã‹ã‚Œã¦ã„ã¾ã™ã€‚書ãè¾¼"
"ã¿ç”¨ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
-#: builtin.c:215
+#: builtin.c:223
#, c-format
msgid "fflush: `%s' is not an open file, pipe or co-process"
msgstr "fflush: `%s' ãŒé–‹ã‹ã‚ŒãŸãƒ•ã‚¡ã‚¤ãƒ«ã€ãƒ‘イプã€ãƒ—ロセス共有ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
-#: builtin.c:333
+#: builtin.c:341
msgid "index: received non-string first argument"
msgstr "index: 文字列ã§ã¯ç„¡ã„第一引数をå—ã‘å–ã‚Šã¾ã—ãŸ"
-#: builtin.c:335
+#: builtin.c:343
msgid "index: received non-string second argument"
msgstr "index: 文字列ã§ã¯ç„¡ã„第二引数をå—ã‘å–ã‚Šã¾ã—ãŸ"
-#: builtin.c:457
+#: builtin.c:467 mpfr.c:770
msgid "int: received non-numeric argument"
msgstr "int: 数値ã§ã¯ç„¡ã„引数をå—ã‘å–ã‚Šã¾ã—ãŸ"
-#: builtin.c:493
+#: builtin.c:503
msgid "length: received array argument"
msgstr "length: é…列引数をå—ã‘å–ã‚Šã¾ã—ãŸ"
-#: builtin.c:496
+#: builtin.c:506
msgid "`length(array)' is a gawk extension"
msgstr "`length(array)' 㯠gawk æ‹¡å¼µã§ã™"
-#: builtin.c:504
+#: builtin.c:514
msgid "length: received non-string argument"
msgstr "length: 文字列ã§ã¯ç„¡ã„引数をå—ã‘å–ã‚Šã¾ã—ãŸ"
-#: builtin.c:535
+#: builtin.c:545
msgid "log: received non-numeric argument"
msgstr "log: 数値ã§ã¯ç„¡ã„引数をå—ã‘å–ã‚Šã¾ã—ãŸ"
-#: builtin.c:538
+#: builtin.c:548
#, c-format
msgid "log: received negative argument %g"
msgstr "log: è² ã®å¼•æ•° %g ã‚’å—ã‘å–ã‚Šã¾ã—ãŸ"
-#: builtin.c:694 builtin.c:699
+#: builtin.c:746 builtin.c:751
msgid "fatal: must use `count$' on all formats or none"
msgstr ""
"致命的: `count$’ ã¯å…¨ã¦ã®æ›¸å¼ä½¿ç”¨ã™ã‚‹ã€ã¾ãŸã¯å…¨ã¦ã«ä½¿ç”¨ã—ãªã„ã®ã„ãšã‚Œã‹ã§ãªã‘"
"ã‚Œã°ã„ã‘ã¾ã›ã‚“"
-#: builtin.c:762
+#: builtin.c:821
#, c-format
msgid "field width is ignored for `%%' specifier"
msgstr "`%%' 指定用ã®ãƒ•ã‚£ãƒ¼ãƒ«ãƒ‰å¹…ã¯ç„¡è¦–ã•ã‚Œã¾ã™"
-#: builtin.c:764
+#: builtin.c:823
#, c-format
msgid "precision is ignored for `%%' specifier"
msgstr "`%%' 指定用ã®ãƒ•ã‚£ãƒ¼ãƒ«ãƒ‰å¹…ã¯ç„¡è¦–ã•ã‚Œã¾ã™"
-#: builtin.c:766
+#: builtin.c:825
#, c-format
msgid "field width and precision are ignored for `%%' specifier"
msgstr "`%%' 指定用ã®ãƒ•ã‚£ãƒ¼ãƒ«ãƒ‰å¹…ãŠã‚ˆã³ç²¾åº¦ã¯ç„¡è¦–ã•ã‚Œã¾ã™"
-#: builtin.c:817
+#: builtin.c:876
msgid "fatal: `$' is not permitted in awk formats"
msgstr "致命的: `$' 㯠awk å½¢å¼å†…ã§ã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
-#: builtin.c:826
+#: builtin.c:885
msgid "fatal: arg count with `$' must be > 0"
msgstr "致命的: `$' ã§æŒ‡å®šã™ã‚‹å¼•æ•°ã®ç•ªå·ã¯æ­£ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
-#: builtin.c:830
+#: builtin.c:889
#, c-format
msgid "fatal: arg count %ld greater than total number of supplied arguments"
msgstr "致命的: 引数ã®ç•ªå· %ld ã¯å¼•æ•°ã¨ã—ã¦ä¸Žãˆã‚‰ã‚ŒãŸæ•°ã‚ˆã‚Šå¤§ãã„ã§ã™"
-#: builtin.c:834
+#: builtin.c:893
msgid "fatal: `$' not permitted after period in format"
msgstr "致命的: `$' ã¯æ›¸å¼æŒ‡å®šå†…ã®ãƒ”リオド `.' ã®å¾Œã«ä½¿ç”¨ã§ãã¾ã›ã‚“"
-#: builtin.c:850
+#: builtin.c:909
msgid "fatal: no `$' supplied for positional field width or precision"
msgstr "致命的: フィールド幅ã€ã¾ãŸã¯ç²¾åº¦ã®æŒ‡å®šå­ã« `$' ãŒä¸Žãˆã‚‰ã‚Œã¦ã„ã¾ã›ã‚“"
-#: builtin.c:921
+#: builtin.c:981
msgid "`l' is meaningless in awk formats; ignored"
msgstr "awk ã®æ›¸å¼æŒ‡å®šã§ã¯ `l' ã¯ç„¡æ„味ã§ã™ã€‚無視ã—ã¾ã™"
-#: builtin.c:925
+#: builtin.c:985
msgid "fatal: `l' is not permitted in POSIX awk formats"
msgstr "致命的: POSIX awk 書å¼å†…ã§ã¯ `l' ã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
-#: builtin.c:938
+#: builtin.c:998
msgid "`L' is meaningless in awk formats; ignored"
msgstr "awk ã®æ›¸å¼æŒ‡å®šã§ã¯ `L' ã¯ç„¡æ„味ã§ã™ã€‚無視ã—ã¾ã™ã€‚"
-#: builtin.c:942
+#: builtin.c:1002
msgid "fatal: `L' is not permitted in POSIX awk formats"
msgstr "致命的: POSIX awk 書å¼å†…ã§ã¯ `L' ã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
-#: builtin.c:955
+#: builtin.c:1015
msgid "`h' is meaningless in awk formats; ignored"
msgstr "awk ã®æ›¸å¼æŒ‡å®šã§ã¯ `h' ã¯ç„¡æ„味ã§ã™ã€‚無視ã—ã¾ã™ã€‚"
-#: builtin.c:959
+#: builtin.c:1019
msgid "fatal: `h' is not permitted in POSIX awk formats"
msgstr "致命的: POSIX awk 書å¼å†…ã§ã¯ `h' ã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
-#: builtin.c:1272
+#: builtin.c:1414
#, c-format
msgid "[s]printf: value %g is out of range for `%%%c' format"
msgstr "[s]printf: 値 %g ã¯æ›¸å¼ `%%%c' ã®ç¯„囲外ã§ã™"
-#: builtin.c:1332
+#: builtin.c:1512
#, c-format
msgid "ignoring unknown format specifier character `%c': no argument converted"
msgstr "ä¸æ˜Žãªæ›¸å¼æŒ‡å®šæ–‡å­— `%c' を無視ã—ã¦ã„ã¾ã™: 変æ›ã•ã‚Œã‚‹å¼•æ•°ã¯ã‚ã‚Šã¾ã›ã‚“"
-#: builtin.c:1337
+#: builtin.c:1517
msgid "fatal: not enough arguments to satisfy format string"
msgstr "致命的: 書å¼æ–‡å­—列を満ãŸã™å分ãªæ•°ã®å¼•æ•°ãŒã‚ã‚Šã¾ã›ã‚“"
-#: builtin.c:1339
+#: builtin.c:1519
msgid "^ ran out for this one"
msgstr "^ ã“ã“ã‹ã‚‰è¶³ã‚Šã¾ã›ã‚“"
-#: builtin.c:1346
+#: builtin.c:1526
msgid "[s]printf: format specifier does not have control letter"
msgstr "[s]printf: 書å¼æŒ‡å®šå­ã«åˆ¶å¾¡æ–‡å­—ãŒã‚ã‚Šã¾ã›ã‚“"
-#: builtin.c:1349
+#: builtin.c:1529
msgid "too many arguments supplied for format string"
msgstr "書å¼æ–‡å­—列ã«ä¸Žãˆã‚‰ã‚Œã¦ã„る引数ãŒå¤šã™ãŽã¾ã™"
-#: builtin.c:1423 builtin.c:1434
+#: builtin.c:1604 builtin.c:1615
msgid "printf: no arguments"
msgstr "printf: 引数ãŒã‚ã‚Šã¾ã›ã‚“"
-#: builtin.c:1475
+#: builtin.c:1656
msgid "sqrt: received non-numeric argument"
msgstr "sqrt: 数値ã§ã¯ç„¡ã„引数をå—ã‘å–ã‚Šã¾ã—ãŸ"
-#: builtin.c:1479
+#: builtin.c:1660
#, c-format
msgid "sqrt: called with negative argument %g"
msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•ã‚Œã¾ã—ãŸ"
-#: builtin.c:1503
+#: builtin.c:1691
#, c-format
msgid "substr: length %g is not >= 1"
msgstr "substr: é•·ã• %g ㌠1 以上ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
-#: builtin.c:1505
+#: builtin.c:1693
#, c-format
msgid "substr: length %g is not >= 0"
msgstr "substr: é•·ã• %g ㌠0 以上ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
-#: builtin.c:1512
+#: builtin.c:1700
#, c-format
msgid "substr: non-integer length %g will be truncated"
msgstr "substr: 文字数 %g ã®å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã¾ã™ã€‚"
-#: builtin.c:1517
+#: builtin.c:1705
#, c-format
msgid "substr: length %g too big for string indexing, truncating to %g"
msgstr "substr: 文字数 %g ã¯æœ€å¤§å€¤ã‚’超ãˆã¦ã„ã¾ã™ã€‚%g を使ã„ã¾ã™ã€‚"
-#: builtin.c:1529
+#: builtin.c:1717
#, c-format
msgid "substr: start index %g is invalid, using 1"
msgstr "substr: 開始インデックス %g ãŒç„¡åŠ¹ã§ã™ã€‚1を使用ã—ã¾ã™"
-#: builtin.c:1534
+#: builtin.c:1722
#, c-format
msgid "substr: non-integer start index %g will be truncated"
msgstr "substr: 開始インデックス %g ãŒéžæ•´æ•°ã®ãŸã‚ã€å€¤ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™"
-#: builtin.c:1559
+#: builtin.c:1747
msgid "substr: source string is zero length"
msgstr "substr: 文字列ã®é•·ã•ãŒã‚¼ãƒ­ã§ã™ã€‚"
-#: builtin.c:1575
+#: builtin.c:1763
#, c-format
msgid "substr: start index %g is past end of string"
msgstr "substr: 開始インデックス %g ãŒæ–‡å­—列終端ã®å¾Œã«ã‚ã‚Šã¾ã™"
-#: builtin.c:1583
+#: builtin.c:1771
#, c-format
msgid ""
"substr: length %g at start index %g exceeds length of first argument (%lu)"
@@ -742,227 +733,1084 @@ msgstr ""
"substr: 開始インデックス %2$g ã‹ã‚‰ã®é•·ã• %1$g ã¯ç¬¬ä¸€å¼•æ•°ã®é•·ã•ã‚’超ãˆã¦ã„ã¾ã™ "
"(%3$lu)"
-#: builtin.c:1657
+#: builtin.c:1845
msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type"
msgstr "strftime: PROCINFO[\"strftime\"] ã®æ›¸å¼ã®å€¤ã¯æ•°å€¤åž‹ã§ã™"
-#: builtin.c:1680
+#: builtin.c:1868
msgid "strftime: received non-numeric second argument"
msgstr "strftime: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–ã‚Šã¾ã—ãŸ"
-#: builtin.c:1683
+#: builtin.c:1872
msgid "strftime: second argument less than 0 or too big for time_t"
msgstr ""
-#: builtin.c:1690
+#: builtin.c:1879
msgid "strftime: received non-string first argument"
msgstr "strftime: éžæ–‡å­—列ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–ã‚Šã¾ã—ãŸ"
-#: builtin.c:1696
+#: builtin.c:1886
msgid "strftime: received empty format string"
msgstr "strftime: 空ã®æ›¸å¼æ–‡å­—列をå—ã‘å–ã‚Šã¾ã—ãŸ"
-#: builtin.c:1762
+#: builtin.c:1952
msgid "mktime: received non-string argument"
msgstr "mktime: éžæ–‡å­—列引数をå—ã‘å–ã‚Šã¾ã—ãŸ"
-#: builtin.c:1779
+#: builtin.c:1969
msgid "mktime: at least one of the values is out of the default range"
msgstr "mktime: 一ã¤ä»¥ä¸Šã®å€¤ãŒãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®ç¯„囲を超ãˆã¦ã„ã¾ã™"
-#: builtin.c:1814
+#: builtin.c:2004
msgid "'system' function not allowed in sandbox mode"
msgstr "サンドボックスモードã§ã¯ 'system' 関数ã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
-#: builtin.c:1819
+#: builtin.c:2009
msgid "system: received non-string argument"
msgstr "system: 文字列ã§ã¯ç„¡ã„引数をå—ã‘å–ã‚Šã¾ã—ãŸ"
-#: builtin.c:1874 eval.c:1159 eval.c:1790 eval.c:1803
-#, c-format
-msgid "reference to uninitialized variable `%s'"
-msgstr "åˆæœŸåŒ–ã•ã‚Œã¦ã„ãªã„変数 `%s' ã¸ã®å‚ç…§ã§ã™"
-
-#: builtin.c:1941
+#: builtin.c:2127
#, c-format
msgid "reference to uninitialized field `$%d'"
msgstr "åˆæœŸåŒ–ã•ã‚Œã¦ã„ãªã„フィールド `$%d' ã¸ã®å‚ç…§ã§ã™"
-#: builtin.c:2028
+#: builtin.c:2214
msgid "tolower: received non-string argument"
msgstr "tolower: éžæ–‡å­—列引数をå—ã‘å–ã‚Šã¾ã—ãŸ"
-#: builtin.c:2062
+#: builtin.c:2248
msgid "toupper: received non-string argument"
msgstr "toupper: éžæ–‡å­—列引数をå—ã‘å–ã‚Šã¾ã—ãŸ"
-#: builtin.c:2098
+#: builtin.c:2284 mpfr.c:685
msgid "atan2: received non-numeric first argument"
msgstr "atan2: éžæ•°å€¤ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–ã‚Šã¾ã—ãŸ"
-#: builtin.c:2100
+#: builtin.c:2286 mpfr.c:687
msgid "atan2: received non-numeric second argument"
msgstr "atan2: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–ã‚Šã¾ã—ãŸ"
-#: builtin.c:2119
+#: builtin.c:2305
msgid "sin: received non-numeric argument"
msgstr "sin: éžæ•°å€¤ã®å¼•æ•°ã‚’å—ã‘å–ã‚Šã¾ã—ãŸ"
-#: builtin.c:2135
+#: builtin.c:2321
msgid "cos: received non-numeric argument"
msgstr "cos: éžæ•°å€¤ã®å¼•æ•°ã‚’å—ã‘å–ã‚Šã¾ã—ãŸ"
-#: builtin.c:2188
+#: builtin.c:2374 mpfr.c:1137
msgid "srand: received non-numeric argument"
msgstr "srand: éžæ•°å€¤ã®å¼•æ•°ã‚’å—ã‘å–ã‚Šã¾ã—ãŸ"
-#: builtin.c:2219
+#: builtin.c:2405
msgid "match: third argument is not an array"
msgstr "match: 第三引数ãŒé…列ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
-#: builtin.c:2483
+#: builtin.c:2670
msgid "gensub: third argument of 0 treated as 1"
msgstr "gensub: 第三引数㌠0 ã§ã™ã€‚1 を代ã‚ã‚Šã«ä½¿ç”¨ã—ã¾ã™"
-#: builtin.c:2776
+#: builtin.c:2963
msgid "lshift: received non-numeric first argument"
msgstr "lshift: éžæ•°å€¤ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–ã‚Šã¾ã—ãŸ"
-#: builtin.c:2778
+#: builtin.c:2965
msgid "lshift: received non-numeric second argument"
msgstr "lshift: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–ã‚Šã¾ã—ãŸ"
-#: builtin.c:2784
+#: builtin.c:2971
#, fuzzy, c-format
msgid "lshift(%f, %f): negative values will give strange results"
msgstr "lshift(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™"
-#: builtin.c:2786
+#: builtin.c:2973
#, fuzzy, c-format
msgid "lshift(%f, %f): fractional values will be truncated"
msgstr "lshift(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™"
-#: builtin.c:2788
+#: builtin.c:2975
#, fuzzy, c-format
msgid "lshift(%f, %f): too large shift value will give strange results"
msgstr "lshift(%lf, %lf): シフト値ãŒå¤§ãéŽãŽã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™"
-#: builtin.c:2813
+#: builtin.c:3000
msgid "rshift: received non-numeric first argument"
msgstr "rshift: éžæ•°å€¤ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–ã‚Šã¾ã—ãŸ"
-#: builtin.c:2815
+#: builtin.c:3002
msgid "rshift: received non-numeric second argument"
msgstr "rshift: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–ã‚Šã¾ã—ãŸ"
-#: builtin.c:2821
+#: builtin.c:3008
#, fuzzy, c-format
msgid "rshift(%f, %f): negative values will give strange results"
msgstr "rshift(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™"
-#: builtin.c:2823
+#: builtin.c:3010
#, fuzzy, c-format
msgid "rshift(%f, %f): fractional values will be truncated"
msgstr "rshift(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™"
-#: builtin.c:2825
+#: builtin.c:3012
#, fuzzy, c-format
msgid "rshift(%f, %f): too large shift value will give strange results"
msgstr "rshift(%lf, %lf): シフト値ãŒå¤§ãéŽãŽã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™"
-#: builtin.c:2850
-msgid "and: received non-numeric first argument"
-msgstr "and: éžæ•°å€¤ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–ã‚Šã¾ã—ãŸ"
-
-#: builtin.c:2852
-msgid "and: received non-numeric second argument"
-msgstr "and: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–ã‚Šã¾ã—ãŸ"
+#: builtin.c:3037
+#, fuzzy
+msgid "and: called with less than two arguments"
+msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•ã‚Œã¾ã—ãŸ"
-#: builtin.c:2858
+#: builtin.c:3042
#, fuzzy, c-format
-msgid "and(%f, %f): negative values will give strange results"
-msgstr "and(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™"
+msgid "and: argument %d is non-numeric"
+msgstr "exp: 引数 %g ãŒç¯„囲外ã§ã™"
-#: builtin.c:2860
+#: builtin.c:3046
#, fuzzy, c-format
-msgid "and(%f, %f): fractional values will be truncated"
-msgstr "and(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™"
-
-#: builtin.c:2885
-msgid "or: received non-numeric first argument"
-msgstr "or: éžæ•°å€¤ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–ã‚Šã¾ã—ãŸ"
+msgid "and: argument %d negative value %g will give strange results"
+msgstr "and(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™"
-#: builtin.c:2887
-msgid "or: received non-numeric second argument"
-msgstr "or: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–ã‚Šã¾ã—ãŸ"
+#: builtin.c:3069
+#, fuzzy
+msgid "or: called with less than two arguments"
+msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•ã‚Œã¾ã—ãŸ"
-#: builtin.c:2893
+#: builtin.c:3074
#, fuzzy, c-format
-msgid "or(%f, %f): negative values will give strange results"
-msgstr "or(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™"
+msgid "or: argument %d is non-numeric"
+msgstr "exp: 引数 %g ãŒç¯„囲外ã§ã™"
-#: builtin.c:2895
+#: builtin.c:3078
#, fuzzy, c-format
-msgid "or(%f, %f): fractional values will be truncated"
-msgstr "or(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™"
-
-#: builtin.c:2923
-msgid "xor: received non-numeric first argument"
-msgstr "xor: éžæ•°å€¤ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–ã‚Šã¾ã—ãŸ"
+msgid "or: argument %d negative value %g will give strange results"
+msgstr "compl(%lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™"
-#: builtin.c:2925
-msgid "xor: received non-numeric second argument"
-msgstr "xor: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–ã‚Šã¾ã—ãŸ"
+#: builtin.c:3100
+#, fuzzy
+msgid "xor: called with less than two arguments"
+msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•ã‚Œã¾ã—ãŸ"
-#: builtin.c:2931
+#: builtin.c:3106
#, fuzzy, c-format
-msgid "xor(%f, %f): negative values will give strange results"
-msgstr "xor(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™"
+msgid "xor: argument %d is non-numeric"
+msgstr "exp: 引数 %g ãŒç¯„囲外ã§ã™"
-#: builtin.c:2933
+#: builtin.c:3110
#, fuzzy, c-format
-msgid "xor(%f, %f): fractional values will be truncated"
-msgstr "xor(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™"
+msgid "xor: argument %d negative value %g will give strange results"
+msgstr "xor(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™"
-#: builtin.c:2957 builtin.c:2963
+#: builtin.c:3135 mpfr.c:800
msgid "compl: received non-numeric argument"
msgstr "compl: éžæ•°å€¤ã®å¼•æ•°ã‚’å—ã‘å–ã‚Šã¾ã—ãŸ"
-#: builtin.c:2965
+#: builtin.c:3141
#, fuzzy, c-format
msgid "compl(%f): negative value will give strange results"
msgstr "compl(%lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™"
-#: builtin.c:2967
+#: builtin.c:3143
#, fuzzy, c-format
msgid "compl(%f): fractional value will be truncated"
msgstr "compl(%lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™"
-#: builtin.c:3136
+#: builtin.c:3312
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr "dcgettext: `%s' ã¯ç„¡åŠ¹ãªãƒ­ã‚±ãƒ¼ãƒ«åŒºåˆ†ã§ã™"
-#: eval.c:412
+#: command.y:225
+#, c-format
+msgid "Type (g)awk statement(s). End with the command \"end\"\n"
+msgstr ""
+
+#: command.y:289
+#, fuzzy, c-format
+msgid "invalid frame number: %d"
+msgstr "無効ãªç¯„囲終了ã§ã™"
+
+#: command.y:295
+#, fuzzy, c-format
+msgid "info: invalid option - \"%s\""
+msgstr "%s: 無効ãªã‚ªãƒ—ション -- '%c'\n"
+
+#: command.y:321
+#, c-format
+msgid "source \"%s\": already sourced."
+msgstr ""
+
+#: command.y:326
+#, c-format
+msgid "save \"%s\": command not permitted."
+msgstr ""
+
+#: command.y:339
+msgid "Can't use command `commands' for breakpoint/watchpoint commands"
+msgstr ""
+
+#: command.y:341
+msgid "no breakpoint/watchpoint has been set yet"
+msgstr ""
+
+#: command.y:343
+msgid "invalid breakpoint/watchpoint number"
+msgstr ""
+
+#: command.y:348
+#, c-format
+msgid "Type commands for when %s %d is hit, one per line.\n"
+msgstr ""
+
+#: command.y:350
+#, c-format
+msgid "End with the command \"end\"\n"
+msgstr ""
+
+#: command.y:357
+msgid "`end' valid only in command `commands' or `eval'"
+msgstr ""
+
+#: command.y:367
+msgid "`silent' valid only in command `commands'"
+msgstr ""
+
+#: command.y:373
+#, fuzzy, c-format
+msgid "trace: invalid option - \"%s\""
+msgstr "%s: 無効ãªã‚ªãƒ—ション -- '%c'\n"
+
+#: command.y:387
+msgid "condition: invalid breakpoint/watchpoint number"
+msgstr ""
+
+#: command.y:449
+#, fuzzy
+msgid "argument not a string"
+msgstr "exp: 引数 %g ãŒç¯„囲外ã§ã™"
+
+#: command.y:459 command.y:464
+#, c-format
+msgid "option: invalid parameter - \"%s\""
+msgstr ""
+
+#: command.y:474
+#, c-format
+msgid "no such function - \"%s\""
+msgstr ""
+
+#: command.y:531
+#, fuzzy, c-format
+msgid "enable: invalid option - \"%s\""
+msgstr "%s: 無効ãªã‚ªãƒ—ション -- '%c'\n"
+
+#: command.y:597
+#, fuzzy, c-format
+msgid "invalid range specification: %d - %d"
+msgstr "無効ãªç¯„囲終了ã§ã™"
+
+#: command.y:659
+#, fuzzy
+msgid "non-numeric value for field number"
+msgstr "フィールド指定ã«ä¸æ˜Žãªå€¤ãŒã‚ã‚Šã¾ã™: %d\n"
+
+#: command.y:680 command.y:687
+msgid "non-numeric value found, numeric expected"
+msgstr ""
+
+#: command.y:712 command.y:718
+msgid "non-zero integer value"
+msgstr ""
+
+#: command.y:817
+msgid ""
+"backtrace [N] - print trace of all or N innermost (outermost if N < 0) "
+"frames."
+msgstr ""
+
+#: command.y:819
+msgid ""
+"break [[filename:]N|function] - set breakpoint at the specified location."
+msgstr ""
+
+#: command.y:821
+msgid "clear [[filename:]N|function] - delete breakpoints previously set."
+msgstr ""
+
+#: command.y:823
+msgid ""
+"commands [num] - starts a list of commands to be executed at a breakpoint"
+"(watchpoint) hit."
+msgstr ""
+
+#: command.y:825
+msgid "condition num [expr] - set or clear breakpoint or watchpoint condition."
+msgstr ""
+
+#: command.y:827
+msgid "continue [COUNT] - continue program being debugged."
+msgstr ""
+
+#: command.y:829
+msgid "delete [breakpoints] [range] - delete specified breakpoints."
+msgstr ""
+
+#: command.y:831
+msgid "disable [breakpoints] [range] - disable specified breakpoints."
+msgstr ""
+
+#: command.y:833
+msgid "display [var] - print value of variable each time the program stops."
+msgstr ""
+
+#: command.y:835
+msgid "down [N] - move N frames down the stack."
+msgstr ""
+
+#: command.y:837
+msgid "dump [filename] - dump instructions to file or stdout."
+msgstr ""
+
+#: command.y:839
+msgid "enable [once|del] [breakpoints] [range] - enable specified breakpoints."
+msgstr ""
+
+#: command.y:841
+msgid "end - end a list of commands or awk statements."
+msgstr ""
+
+#: command.y:843
+msgid "eval stmt|[p1, p2, ...] - evaluate awk statement(s)."
+msgstr ""
+
+#: command.y:845
+msgid "finish - execute until selected stack frame returns."
+msgstr ""
+
+#: command.y:847
+msgid "frame [N] - select and print stack frame number N."
+msgstr ""
+
+#: command.y:849
+msgid "help [command] - print list of commands or explanation of command."
+msgstr ""
+
+#: command.y:851
+msgid "ignore N COUNT - set ignore-count of breakpoint number N to COUNT."
+msgstr ""
+
+#: command.y:853
+msgid ""
+"info topic - source|sources|variables|functions|break|frame|args|locals|"
+"display|watch."
+msgstr ""
+
+#: command.y:855
+msgid "list [-|+|[filename:]lineno|function|range] - list specified line(s)."
+msgstr ""
+
+#: command.y:857
+msgid "next [COUNT] - step program, proceeding through subroutine calls."
+msgstr ""
+
+#: command.y:859
+msgid ""
+"nexti [COUNT] - step one instruction, but proceed through subroutine calls."
+msgstr ""
+
+#: command.y:861
+msgid "option [name[=value]] - set or display debugger option(s)."
+msgstr ""
+
+#: command.y:863
+msgid "print var [var] - print value of a variable or array."
+msgstr ""
+
+#: command.y:865
+msgid "printf format, [arg], ... - formatted output."
+msgstr ""
+
+#: command.y:867
+msgid "quit - exit debugger."
+msgstr ""
+
+#: command.y:869
+msgid "return [value] - make selected stack frame return to its caller."
+msgstr ""
+
+#: command.y:871
+msgid "run - start or restart executing program."
+msgstr ""
+
+#: command.y:874
+msgid "save filename - save commands from the session to file."
+msgstr ""
+
+#: command.y:877
+msgid "set var = value - assign value to a scalar variable."
+msgstr ""
+
+#: command.y:879
+msgid ""
+"silent - suspends usual message when stopped at a breakpoint/watchpoint."
+msgstr ""
+
+#: command.y:881
+msgid "source file - execute commands from file."
+msgstr ""
+
+#: command.y:883
+msgid "step [COUNT] - step program until it reaches a different source line."
+msgstr ""
+
+#: command.y:885
+msgid "stepi [COUNT] - step one instruction exactly."
+msgstr ""
+
+#: command.y:887
+msgid "tbreak [[filename:]N|function] - set a temporary breakpoint."
+msgstr ""
+
+#: command.y:889
+msgid "trace on|off - print instruction before executing."
+msgstr ""
+
+#: command.y:891
+msgid "undisplay [N] - remove variable(s) from automatic display list."
+msgstr ""
+
+#: command.y:893
+msgid ""
+"until [[filename:]N|function] - execute until program reaches a different "
+"line or line N within current frame."
+msgstr ""
+
+#: command.y:895
+msgid "unwatch [N] - remove variable(s) from watch list."
+msgstr ""
+
+#: command.y:897
+msgid "up [N] - move N frames up the stack."
+msgstr ""
+
+#: command.y:899
+msgid "watch var - set a watchpoint for a variable."
+msgstr ""
+
+#: command.y:1011 debug.c:395 msg.c:128
+#, c-format
+msgid "error: "
+msgstr "エラー: "
+
+#: command.y:1051
+#, fuzzy, c-format
+msgid "can't read command (%s)\n"
+msgstr "`%s' ã‹ã‚‰ãƒªãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆã§ãã¾ã›ã‚“ (%s)"
+
+#: command.y:1065
+#, fuzzy, c-format
+msgid "can't read command (%s)"
+msgstr "`%s' ã‹ã‚‰ãƒªãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆã§ãã¾ã›ã‚“ (%s)"
+
+#: command.y:1116
+#, fuzzy
+msgid "invalid character in command"
+msgstr "無効ãªæ–‡å­—クラスåã§ã™"
+
+#: command.y:1152
+#, c-format
+msgid "unknown command - \"%.*s\", try help"
+msgstr ""
+
+#: command.y:1222
+#, c-format
+msgid "%s"
+msgstr ""
+
+#: command.y:1284
+#, fuzzy
+msgid "invalid character"
+msgstr "無効ãªç…§åˆæ–‡å­—ã§ã™"
+
+#: command.y:1455
+#, c-format
+msgid "undefined command: %s\n"
+msgstr ""
+
+#: debug.c:246
+msgid "set or show the number of lines to keep in history file."
+msgstr ""
+
+#: debug.c:248
+msgid "set or show the list command window size."
+msgstr ""
+
+#: debug.c:250
+msgid "set or show gawk output file."
+msgstr ""
+
+#: debug.c:252
+msgid "set or show debugger prompt."
+msgstr ""
+
+#: debug.c:254
+msgid "(un)set or show saving of command history (value=on|off)."
+msgstr ""
+
+#: debug.c:256
+msgid "(un)set or show saving of options (value=on|off)."
+msgstr ""
+
+#: debug.c:258
+msgid "(un)set or show instruction tracing (value=on|off)."
+msgstr ""
+
+#: debug.c:339
+msgid "program not running."
+msgstr ""
+
+#: debug.c:442 debug.c:597
+#, fuzzy, c-format
+msgid "can't read source file `%s' (%s)"
+msgstr "ソースファイル `%s' を読ã¿è¾¼ã‚ã¾ã›ã‚“ (%s)"
+
+#: debug.c:447
+#, fuzzy, c-format
+msgid "source file `%s' is empty.\n"
+msgstr "ソースファイル `%s' ã¯ç©ºã§ã™"
+
+#: debug.c:474
+msgid "no current source file."
+msgstr ""
+
+#: debug.c:499
+#, fuzzy, c-format
+msgid "cannot find source file named `%s' (%s)"
+msgstr "ソースファイル `%s' を読ã¿è¾¼ã‚ã¾ã›ã‚“ (%s)"
+
+#: debug.c:523
+#, c-format
+msgid "WARNING: source file `%s' modified since program compilation.\n"
+msgstr ""
+
+#: debug.c:542
+#, c-format
+msgid "line number %d out of range; `%s' has %d lines"
+msgstr ""
+
+#: debug.c:602
+#, fuzzy, c-format
+msgid "unexpected eof while reading file `%s', line %d"
+msgstr "予期ã—ãªã„改行ã¾ãŸã¯æ–‡å­—列終端ã§ã™"
+
+#: debug.c:611
+#, c-format
+msgid "source file `%s' modified since start of program execution"
+msgstr ""
+
+#: debug.c:723
+#, fuzzy, c-format
+msgid "Current source file: %s\n"
+msgstr "ソースファイル `%s' ã¯æ—¢ã«èª­ã¿è¾¼ã¾ã‚Œã¦ã„ã¾ã™"
+
+#: debug.c:724
+#, c-format
+msgid "Number of lines: %d\n"
+msgstr ""
+
+#: debug.c:731
+#, c-format
+msgid "Source file (lines): %s (%d)\n"
+msgstr ""
+
+#: debug.c:745
+msgid ""
+"Number Disp Enabled Location\n"
+"\n"
+msgstr ""
+
+#: debug.c:756
+#, c-format
+msgid "\tno of hits = %ld\n"
+msgstr ""
+
+#: debug.c:758
+#, c-format
+msgid "\tignore next %ld hit(s)\n"
+msgstr ""
+
+#: debug.c:760 debug.c:900
+#, c-format
+msgid "\tstop condition: %s\n"
+msgstr ""
+
+#: debug.c:762 debug.c:902
+msgid "\tcommands:\n"
+msgstr ""
+
+#: debug.c:784
+#, c-format
+msgid "Current frame: "
+msgstr ""
+
+#: debug.c:787
+#, c-format
+msgid "Called by frame: "
+msgstr ""
+
+#: debug.c:791
+#, c-format
+msgid "Caller of frame: "
+msgstr ""
+
+#: debug.c:809
+#, c-format
+msgid "None in main().\n"
+msgstr ""
+
+#: debug.c:839
+#, fuzzy
+msgid "No arguments.\n"
+msgstr "printf: 引数ãŒã‚ã‚Šã¾ã›ã‚“"
+
+#: debug.c:840
+msgid "No locals.\n"
+msgstr ""
+
+#: debug.c:848
+msgid ""
+"All defined variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:858
+msgid ""
+"All defined functions:\n"
+"\n"
+msgstr ""
+
+#: debug.c:877
+msgid ""
+"Auto-display variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:880
+msgid ""
+"Watch variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:1020
+#, fuzzy, c-format
+msgid "no symbol `%s' in current context\n"
+msgstr "`next' 㯠`%s' ã‹ã‚‰å‘¼ã³å‡ºã™ã“ã¨ãŒå‡ºæ¥ã¾ã›ã‚“"
+
+#: debug.c:1032 debug.c:1416
+#, fuzzy, c-format
+msgid "`%s' is not an array\n"
+msgstr "`%s' ã¯ä¸æ­£ãªå¤‰æ•°åã§ã™"
+
+#: debug.c:1046
+#, fuzzy, c-format
+msgid "$%ld = uninitialized field\n"
+msgstr "åˆæœŸåŒ–ã•ã‚Œã¦ã„ãªã„フィールド `$%d' ã¸ã®å‚ç…§ã§ã™"
+
+#: debug.c:1067
+#, fuzzy, c-format
+msgid "array `%s' is empty\n"
+msgstr "データファイル `%s' ã¯ç©ºã§ã™ã€‚"
+
+#: debug.c:1110 debug.c:1162
+#, fuzzy, c-format
+msgid "[\"%s\"] not in array `%s'\n"
+msgstr "delete: é…列 `%2$s' 内ã«ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ `%1$s' ãŒã‚ã‚Šã¾ã›ã‚“"
+
+#: debug.c:1166
+#, c-format
+msgid "`%s[\"%s\"]' is not an array\n"
+msgstr ""
+
+#: debug.c:1227 debug.c:4947
+#, fuzzy, c-format
+msgid "`%s' is not a scalar variable"
+msgstr "`%s' ã¯ä¸æ­£ãªå¤‰æ•°åã§ã™"
+
+#: debug.c:1249 debug.c:4977
+#, fuzzy, c-format
+msgid "attempt to use array `%s[\"%s\"]' in a scalar context"
+msgstr "スカラーコンテキスト内ã§é…列 `%s[\"%.*s\"]' ã®ä½¿ç”¨ã®è©¦ã¿ã§ã™"
+
+#: debug.c:1269 debug.c:4988
+#, fuzzy, c-format
+msgid "attempt to use scalar `%s[\"%s\"]' as array"
+msgstr "スカラー `%s[\"%.*s\"]' ã‚’é…列ã¨ã—ã¦ä½¿ç”¨ã™ã‚‹è©¦ã¿ã§ã™"
+
+#: debug.c:1412
+#, fuzzy, c-format
+msgid "`%s' is a function"
+msgstr "`%s' ã¯é–¢æ•°åã¨ã—ã¦ã¯ç„¡åŠ¹ã§ã™"
+
+#: debug.c:1454
+#, c-format
+msgid "watchpoint %d is unconditional\n"
+msgstr ""
+
+#: debug.c:1488
+#, c-format
+msgid "No display item numbered %ld"
+msgstr ""
+
+#: debug.c:1491
+#, c-format
+msgid "No watch item numbered %ld"
+msgstr ""
+
+#: debug.c:1517
+#, fuzzy, c-format
+msgid "%d: [\"%s\"] not in array `%s'\n"
+msgstr "delete: é…列 `%2$s' 内ã«ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ `%1$s' ãŒã‚ã‚Šã¾ã›ã‚“"
+
+#: debug.c:1756
+#, fuzzy
+msgid "attempt to use scalar value as array"
+msgstr "スカラー値をé…列ã¨ã—ã¦ä½¿ç”¨ã™ã‚‹è©¦ã¿ã§ã™"
+
+#: debug.c:1845
+#, c-format
+msgid "Watchpoint %d deleted because parameter is out of scope.\n"
+msgstr ""
+
+#: debug.c:1856
+#, c-format
+msgid "Display %d deleted because parameter is out of scope.\n"
+msgstr ""
+
+#: debug.c:1889
+#, c-format
+msgid " in file `%s', line %d\n"
+msgstr ""
+
+#: debug.c:1910
+#, c-format
+msgid " at `%s':%d"
+msgstr ""
+
+#: debug.c:1926 debug.c:1989
+#, c-format
+msgid "#%ld\tin "
+msgstr ""
+
+#: debug.c:1963
+#, c-format
+msgid "More stack frames follow ...\n"
+msgstr ""
+
+#: debug.c:2006
+#, fuzzy
+msgid "invalid frame number"
+msgstr "無効ãªç¯„囲終了ã§ã™"
+
+#: debug.c:2178
+#, c-format
+msgid "Note: breakpoint %d (enabled, ignore next %ld hits), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2185
+#, c-format
+msgid "Note: breakpoint %d (enabled), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2192
+#, c-format
+msgid "Note: breakpoint %d (disabled, ignore next %ld hits), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2199
+#, c-format
+msgid "Note: breakpoint %d (disabled), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2216
+#, c-format
+msgid "Breakpoint %d set at file `%s', line %d\n"
+msgstr ""
+
+#: debug.c:2318
+#, c-format
+msgid "Can't set breakpoint in file `%s'\n"
+msgstr ""
+
+#: debug.c:2347 debug.c:2470 debug.c:3328
+#, fuzzy, c-format
+msgid "line number %d in file `%s' out of range"
+msgstr "exp: 引数 %g ãŒç¯„囲外ã§ã™"
+
+#: debug.c:2351
+#, c-format
+msgid "Can't find rule!!!\n"
+msgstr ""
+
+#: debug.c:2353
+#, c-format
+msgid "Can't set breakpoint at `%s':%d\n"
+msgstr ""
+
+#: debug.c:2365
+#, c-format
+msgid "Can't set breakpoint in function `%s'\n"
+msgstr ""
+
+#: debug.c:2381
+#, c-format
+msgid "breakpoint %d set at file `%s', line %d is unconditional\n"
+msgstr ""
+
+#: debug.c:2486 debug.c:2508
+#, c-format
+msgid "Deleted breakpoint %d"
+msgstr ""
+
+#: debug.c:2492
+#, c-format
+msgid "No breakpoint(s) at entry to function `%s'\n"
+msgstr ""
+
+#: debug.c:2519
+#, fuzzy, c-format
+msgid "No breakpoint at file `%s', line #%d\n"
+msgstr "入力ファイル `%s' を読ã¿è¾¼ã¿ä¸­ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸ: %s"
+
+#: debug.c:2574 debug.c:2615 debug.c:2635 debug.c:2678
+msgid "invalid breakpoint number"
+msgstr ""
+
+#: debug.c:2590
+msgid "Delete all breakpoints? (y or n) "
+msgstr ""
+
+#: debug.c:2591 debug.c:2901 debug.c:2954
+msgid "y"
+msgstr ""
+
+#: debug.c:2640
+#, c-format
+msgid "Will ignore next %ld crossing(s) of breakpoint %d.\n"
+msgstr ""
+
+#: debug.c:2644
+#, c-format
+msgid "Will stop next time breakpoint %d is reached.\n"
+msgstr ""
+
+#: debug.c:2761
+#, c-format
+msgid "Can only debug programs provided with the `-f' option.\n"
+msgstr ""
+
+#: debug.c:2886
+#, c-format
+msgid "Failed to restart debugger"
+msgstr ""
+
+#: debug.c:2900
+msgid "Program already running. Restart from beginning (y/n)? "
+msgstr ""
+
+#: debug.c:2904
+#, c-format
+msgid "Program not restarted\n"
+msgstr ""
+
+#: debug.c:2914
+#, c-format
+msgid "error: cannot restart, operation not allowed\n"
+msgstr ""
+
+#: debug.c:2920
+#, c-format
+msgid "error (%s): cannot restart, ignoring rest of the commands\n"
+msgstr ""
+
+#: debug.c:2928
+#, c-format
+msgid "Starting program: \n"
+msgstr ""
+
+#: debug.c:2937
+#, c-format
+msgid "Program exited %s with exit value: %d\n"
+msgstr ""
+
+#: debug.c:2953
+msgid "The program is running. Exit anyway (y/n)? "
+msgstr ""
+
+#: debug.c:2988
+#, c-format
+msgid "Not stopped at any breakpoint; argument ignored.\n"
+msgstr ""
+
+#: debug.c:2993
+#, c-format
+msgid "invalid breakpoint number %d."
+msgstr ""
+
+#: debug.c:2998
+#, c-format
+msgid "Will ignore next %ld crossings of breakpoint %d.\n"
+msgstr ""
+
+#: debug.c:3185
+#, c-format
+msgid "'finish' not meaningful in the outermost frame main()\n"
+msgstr ""
+
+#: debug.c:3190
+#, c-format
+msgid "Run till return from "
+msgstr ""
+
+#: debug.c:3233
+#, c-format
+msgid "'return' not meaningful in the outermost frame main()\n"
+msgstr ""
+
+#: debug.c:3347
+#, c-format
+msgid "Can't find specified location in function `%s'\n"
+msgstr ""
+
+#: debug.c:3355
+#, fuzzy, c-format
+msgid "invalid source line %d in file `%s'"
+msgstr "ソースファイル `%s' ã¯æ—¢ã«èª­ã¿è¾¼ã¾ã‚Œã¦ã„ã¾ã™"
+
+#: debug.c:3370
+#, c-format
+msgid "Can't find specified location %d in file `%s'\n"
+msgstr ""
+
+#: debug.c:3402
+#, fuzzy, c-format
+msgid "element not in array\n"
+msgstr "delete: é…列 `%2$s' 内ã«ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ `%1$s' ãŒã‚ã‚Šã¾ã›ã‚“"
+
+#: debug.c:3402
+#, c-format
+msgid "untyped variable\n"
+msgstr ""
+
+#: debug.c:3444
+#, c-format
+msgid "Stopping in %s ...\n"
+msgstr ""
+
+#: debug.c:3521
+#, c-format
+msgid "'finish' not meaningful with non-local jump '%s'\n"
+msgstr ""
+
+#: debug.c:3528
+#, c-format
+msgid "'until' not meaningful with non-local jump '%s'\n"
+msgstr ""
+
+#: debug.c:4163
+msgid "\t------[Enter] to continue or q [Enter] to quit------"
+msgstr ""
+
+#: debug.c:4164
+msgid "q"
+msgstr ""
+
+#: debug.c:4984
+#, fuzzy, c-format
+msgid "[\"%s\"] not in array `%s'"
+msgstr "delete: é…列 `%2$s' 内ã«ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ `%1$s' ãŒã‚ã‚Šã¾ã›ã‚“"
+
+#: debug.c:5190
+#, c-format
+msgid "sending output to stdout\n"
+msgstr ""
+
+#: debug.c:5230
+msgid "invalid number"
+msgstr ""
+
+#: debug.c:5362
+#, fuzzy, c-format
+msgid "`%s' not allowed in current context; statement ignored"
+msgstr "`next' 㯠`%s' ã‹ã‚‰å‘¼ã³å‡ºã™ã“ã¨ãŒå‡ºæ¥ã¾ã›ã‚“"
+
+#: debug.c:5370
+#, fuzzy
+msgid "`return' not allowed in current context; statement ignored"
+msgstr "`next' 㯠`%s' ã‹ã‚‰å‘¼ã³å‡ºã™ã“ã¨ãŒå‡ºæ¥ã¾ã›ã‚“"
+
+#: debug.c:5571
+#, c-format
+msgid "No symbol `%s' in current context"
+msgstr ""
+
+#: dfa.c:984 dfa.c:987 dfa.c:1007 dfa.c:1017 dfa.c:1029 dfa.c:1080 dfa.c:1089
+#: dfa.c:1092 dfa.c:1097 dfa.c:1110 dfa.c:1178
+msgid "unbalanced ["
+msgstr ""
+
+#: dfa.c:1038
+#, fuzzy
+msgid "invalid character class"
+msgstr "無効ãªæ–‡å­—クラスåã§ã™"
+
+#: dfa.c:1215
+msgid "character class syntax is [[:space:]], not [:space:]"
+msgstr ""
+
+#: dfa.c:1267
+msgid "unfinished \\ escape"
+msgstr ""
+
+#: dfa.c:1414 regcomp.c:161
+msgid "Invalid content of \\{\\}"
+msgstr "\\{\\} ã®ä¸­èº«ãŒç„¡åŠ¹ã§ã™"
+
+#: dfa.c:1417 regcomp.c:176
+msgid "Regular expression too big"
+msgstr "æ­£è¦è¡¨ç¾ãŒå¤§ãã™ãŽã¾ã™"
+
+#: dfa.c:1802
+msgid "unbalanced ("
+msgstr ""
+
+#: dfa.c:1929
+msgid "no syntax specified"
+msgstr ""
+
+#: dfa.c:1937
+msgid "unbalanced )"
+msgstr ""
+
+#: eval.c:394
#, c-format
msgid "unknown nodetype %d"
msgstr "ä¸æ˜ŽãªãƒŽãƒ¼ãƒ‰åž‹ %d ã§ã™"
-#: eval.c:423 eval.c:437
+#: eval.c:405 eval.c:419
#, c-format
msgid "unknown opcode %d"
msgstr "ä¸æ˜Žãªã‚ªãƒšã‚³ãƒ¼ãƒ‰ %d ã§ã™"
-#: eval.c:434
+#: eval.c:416
#, c-format
msgid "opcode %s not an operator or keyword"
msgstr "オペコード %s ã¯æ¼”ç®—å­ã¾ãŸã¯äºˆç´„語ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
-#: eval.c:488
+#: eval.c:471
msgid "buffer overflow in genflags2str"
msgstr "genflags2str 内ã§ãƒãƒƒãƒ•ã‚¡ã‚ªãƒ¼ãƒãƒ¼ãƒ•ãƒ­ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸ"
-#: eval.c:698
+#: eval.c:674
#, c-format
msgid ""
"\n"
@@ -973,298 +1821,525 @@ msgstr ""
"\t# 呼出関数スタック:\n"
"\n"
-#: eval.c:725
+#: eval.c:703
msgid "`IGNORECASE' is a gawk extension"
msgstr "`IGNORECASE' 㯠gawk æ‹¡å¼µã§ã™"
-#: eval.c:754
+#: eval.c:735
msgid "`BINMODE' is a gawk extension"
msgstr "`BINMODE' 㯠gawk æ‹¡å¼µã§ã™"
-#: eval.c:812
+#: eval.c:792
#, c-format
msgid "BINMODE value `%s' is invalid, treated as 3"
msgstr "BINMODE 値 `%s' ã¯ç„¡åŠ¹ã§ã™ã€‚代ã‚ã‚Šã« 3 を使用ã—ã¾ã™"
-#: eval.c:902
+#: eval.c:884
#, c-format
msgid "bad `%sFMT' specification `%s'"
msgstr "誤ã£ãŸ `%sFMT' 指定 `%s' ã§ã™"
-#: eval.c:980
+#: eval.c:968
msgid "turning off `--lint' due to assignment to `LINT'"
msgstr "`LINT' ã¸ã®ä»£å…¥ã«å¾“ã„ `--lint' を無効ã«ã—ã¾ã™"
-#: eval.c:1127 eval.c:1777
-#, c-format
-msgid "can't use function name `%s' as variable or array"
-msgstr "関数å `%s' ã¯å¤‰æ•°ã¾ãŸã¯é…列ã¨ã—ã¦ä½¿ç”¨å‡ºæ¥ã¾ã›ã‚“"
-
-#: eval.c:1158 eval.c:1789 eval.c:1802
+#: eval.c:1144
#, c-format
msgid "reference to uninitialized argument `%s'"
msgstr "åˆæœŸåŒ–ã•ã‚Œã¦ã„ãªã„引数 `%s' ã¸ã®å‚ç…§ã§ã™"
-#: eval.c:1177
+#: eval.c:1145
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "åˆæœŸåŒ–ã•ã‚Œã¦ã„ãªã„変数 `%s' ã¸ã®å‚ç…§ã§ã™"
+
+#: eval.c:1163
msgid "attempt to field reference from non-numeric value"
msgstr "éžæ•°å€¤ã‚’使用ã—ãŸãƒ•ã‚¤ãƒ¼ãƒ«ãƒ‰å‚ç…§ã®è©¦ã¿ã§ã™"
-#: eval.c:1179
+#: eval.c:1165
msgid "attempt to field reference from null string"
msgstr "NULL 文字列を使用ã—ã¦ãƒ•ã‚£ãƒ¼ãƒ«ãƒ‰ã®å‚照を試ã¿ã¦ã„ã¾ã™"
-#: eval.c:1185
+#: eval.c:1173
#, c-format
msgid "attempt to access field %ld"
msgstr "フィールド %ld ã¸ã®ã‚¢ã‚¯ã‚»ã‚¹ã®è©¦ã¿ã§ã™"
-#: eval.c:1194
+#: eval.c:1182
#, c-format
msgid "reference to uninitialized field `$%ld'"
msgstr "åˆæœŸåŒ–ã•ã‚Œã¦ã„ãªã„フィールド `$%ld' ã¸ã®å‚ç…§ã§ã™"
-#: eval.c:1256
+#: eval.c:1269
#, c-format
msgid "function `%s' called with more arguments than declared"
msgstr "宣言ã•ã‚Œã¦ã„る数より多ã„引数を使ã£ã¦é–¢æ•° `%s' を呼ã³å‡ºã—ã¾ã—ãŸ"
-#: eval.c:1437
+#: eval.c:1464
#, c-format
msgid "unwind_stack: unexpected type `%s'"
msgstr "unwind_stack: 予期ã—ãªã„åž‹ `%s' ã§ã™"
-#: eval.c:1532
+#: eval.c:1558
msgid "division by zero attempted in `/='"
msgstr "`/=' 内ã§ã‚¼ãƒ­ã«ã‚ˆã‚‹é™¤ç®—ãŒè¡Œã‚ã‚Œã¾ã—ãŸ"
-#: eval.c:1539
+#: eval.c:1565
#, c-format
msgid "division by zero attempted in `%%='"
msgstr "`%%=' 内ã§ã‚¼ãƒ­ã«ã‚ˆã‚‹é™¤ç®—ãŒè¡Œã‚ã‚Œã¾ã—ãŸ"
-#: eval.c:1876 eval.c:2122
-#, c-format
-msgid "attempt to use array `%s[\"%.*s\"]' in a scalar context"
-msgstr "スカラーコンテキスト内ã§é…列 `%s[\"%.*s\"]' ã®ä½¿ç”¨ã®è©¦ã¿ã§ã™"
-
-#: eval.c:1907
-msgid "assignment used in conditional context"
-msgstr "æ¡ä»¶ã‚³ãƒ³ãƒ†ã‚­ã‚¹ãƒˆå†…ã§ä»£å…¥ãŒä½¿ç”¨ã•ã‚Œã¾ã—ãŸ"
-
-#: eval.c:1911
-msgid "statement has no effect"
-msgstr "æ–‡ã«åŠ¹æžœãŒã‚ã‚Šã¾ã›ã‚“"
-
-#: eval.c:2343
-#, c-format
-msgid "for loop: array `%s' changed size from %ld to %ld during loop execution"
-msgstr ""
-"for ループ: ループ実行中ã«é…列 `%s' ã®ã‚µã‚¤ã‚ºãŒ %ld ã‹ã‚‰ %ld ã¸å¤‰æ›´ã•ã‚Œã¾ã—ãŸ"
-
-#: eval.c:2458
-#, c-format
-msgid "function called indirectly through `%s' does not exist"
-msgstr "`%s' を通ã—ã¦é–“接的ã«å‘¼ã³å‡ºã•ã‚ŒãŸé–¢æ•°ãŒå­˜åœ¨ã—ã¾ã›ã‚“"
-
-#: eval.c:2470
-#, c-format
-msgid "function `%s' not defined"
-msgstr "関数 `%s' ã¯å®šç¾©ã•ã‚Œã¦ã„ã¾ã›ã‚“"
-
-#: eval.c:2511
-#, c-format
-msgid "non-redirected `getline' invalid inside `%s' rule"
-msgstr "`%s' ルールã®å†…å´ã§ã¯ãƒªãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆã•ã‚Œã¦ã„ãªã„ `getline' ã¯ç„¡åŠ¹ã§ã™"
-
-#: eval.c:2600
-#, c-format
-msgid "error reading input file `%s': %s"
-msgstr "入力ファイル `%s' を読ã¿è¾¼ã¿ä¸­ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸ: %s"
-
-#: eval.c:2614
-#, c-format
-msgid "`nextfile' cannot be called from a `%s' rule"
-msgstr "`nextfile' 㯠`%s' ルールã‹ã‚‰å‘¼ã³å‡ºã™ã“ã¨ãŒå‡ºæ¥ã¾ã›ã‚“"
-
-#: eval.c:2661
-#, fuzzy
-msgid "`exit' cannot be called in the current context"
-msgstr "`next' 㯠`%s' ã‹ã‚‰å‘¼ã³å‡ºã™ã“ã¨ãŒå‡ºæ¥ã¾ã›ã‚“"
-
-#: eval.c:2700
-#, c-format
-msgid "`next' cannot be called from a `%s' rule"
-msgstr "`next' 㯠`%s' ã‹ã‚‰å‘¼ã³å‡ºã™ã“ã¨ãŒå‡ºæ¥ã¾ã›ã‚“"
-
-#: eval.c:2766
-#, c-format
-msgid "Sorry, don't know how to interpret `%s'"
-msgstr "申ã—訳ã‚ã‚Šã¾ã›ã‚“㌠`%s' ã‚’ã©ã®ã‚ˆã†ã«è§£é‡ˆã™ã‚‹ã‹åˆ†ã‹ã‚Šã¾ã›ã‚“"
-
-#: ext.c:54
+#: ext.c:49
msgid "extensions are not allowed in sandbox mode"
msgstr "サンドボックスモード内ã§ã¯æ‹¡å¼µã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
-#: ext.c:60 ext.c:65
-msgid "`extension' is a gawk extension"
-msgstr "`extension' 㯠gawk æ‹¡å¼µã§ã™"
+#: ext.c:52
+#, fuzzy
+msgid "-l / @load are gawk extensions"
+msgstr "@include 㯠gawk æ‹¡å¼µã§ã™"
+
+#: ext.c:55
+msgid "load_ext: received NULL lib_name"
+msgstr ""
-#: ext.c:75
-#, c-format
-msgid "fatal: extension: cannot open `%s' (%s)\n"
+#: ext.c:58
+#, fuzzy, c-format
+msgid "load_ext: cannot open library `%s' (%s)\n"
msgstr "致命的: extension: `%s' ã‚’é–‹ãã“ã¨ãŒå‡ºæ¥ã¾ã›ã‚“ (%s)\n"
-#: ext.c:84
-#, c-format
+#: ext.c:64
+#, fuzzy, c-format
msgid ""
-"fatal: extension: library `%s': does not define "
-"`plugin_is_GPL_compatible' (%s)\n"
+"load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n"
msgstr ""
"致命的: extension: ライブラリ `%s': `plugin_is_GPL_compatible' ãŒå®šç¾©ã•ã‚Œã¦ã„"
"ã¾ã›ã‚“ (%s)\n"
-#: ext.c:93
-#, c-format
-msgid "fatal: extension: library `%s': cannot call function `%s' (%s)\n"
+#: ext.c:70
+#, fuzzy, c-format
+msgid "load_ext: library `%s': cannot call function `%s' (%s)\n"
msgstr ""
"致命的: extension: ライブラリ `%s': 関数 `%s' を呼ã³å‡ºã™ã“ã¨ãŒå‡ºæ¥ã¾ã›ã‚“ "
"(%s)\n"
-#: ext.c:127
-msgid "extension: missing function name"
+#: ext.c:74
+#, c-format
+msgid "load_ext: library `%s' initialization routine `%s' failed\n"
+msgstr ""
+
+#: ext.c:93
+#, fuzzy
+msgid "make_builtin: missing function name"
msgstr "extension: 関数åãŒã‚ã‚Šã¾ã›ã‚“"
-#: ext.c:132
-#, c-format
-msgid "extension: illegal character `%c' in function name `%s'"
+#: ext.c:98
+#, fuzzy, c-format
+msgid "make_builtin: illegal character `%c' in function name `%s'"
msgstr "extension: 関数å `%2$s' ã®ä¸­ã§ä¸æ­£ãªæ–‡å­— `%1$c' ãŒä½¿ç”¨ã•ã‚Œã¦ã„ã¾ã™"
-#: ext.c:141
-#, c-format
-msgid "extension: can't redefine function `%s'"
+#: ext.c:106
+#, fuzzy, c-format
+msgid "make_builtin: can't redefine function `%s'"
msgstr "extension: 関数 `%s' ã‚’å†å®šç¾©ã§ãã¾ã›ã‚“"
-#: ext.c:145
-#, c-format
-msgid "extension: function `%s' already defined"
+#: ext.c:110
+#, fuzzy, c-format
+msgid "make_builtin: function `%s' already defined"
msgstr "extension: 関数 `%s' ã¯æ—¢ã«å®šç¾©ã•ã‚Œã¦ã„ã¾ã™"
-#: ext.c:150
-#, c-format
-msgid "extension: function name `%s' previously defined"
+#: ext.c:114
+#, fuzzy, c-format
+msgid "make_builtin: function name `%s' previously defined"
msgstr "extension: 関数å `%s' ã¯å‰ã«å®šç¾©ã•ã‚Œã¦ã„ã¾ã™"
-#: ext.c:152
-#, c-format
-msgid "extension: can't use gawk built-in `%s' as function name"
+#: ext.c:116
+#, fuzzy, c-format
+msgid "make_builtin: can't use gawk built-in `%s' as function name"
msgstr "extension: gawk ã«çµ„ã¿è¾¼ã¾ã‚Œã¦ã„ã‚‹ `%s' ã¯é–¢æ•°åã¨ã—ã¦ä½¿ç”¨å‡ºæ¥ã¾ã›ã‚“"
-#: ext.c:156
+#: ext.c:119
#, c-format
msgid "make_builtin: negative argument count for function `%s'"
msgstr "make_builtin: 関数 `%s' ã®å¼•æ•°ã®æ•°ãŒè² ã§ã™"
-#: ext.c:259
+#: ext.c:183
#, c-format
msgid "function `%s' defined to take no more than %d argument(s)"
msgstr "関数 `%s' ã«ä½¿ãˆã‚‹å¼•æ•°ã®æ•°ã¯ `%d' 以下ã¨å®šç¾©ã•ã‚Œã¦ã„ã¾ã™"
-#: ext.c:262
+#: ext.c:186
#, c-format
msgid "function `%s': missing argument #%d"
msgstr "関数 `%s': 引数 #%d ãŒã‚ã‚Šã¾ã›ã‚“"
-#: ext.c:279
+#: ext.c:203
#, c-format
msgid "function `%s': argument #%d: attempt to use scalar as an array"
msgstr "関数 `%s': 引数 #%d: スカラーをé…列ã¨ã—ã¦ä½¿ç”¨ã™ã‚‹è©¦ã¿ã§ã™"
-#: ext.c:283
+#: ext.c:207
#, c-format
msgid "function `%s': argument #%d: attempt to use array as a scalar"
msgstr "関数 `%s': 引数 #%d: é…列をスカラーã¨ã—ã¦ä½¿ç”¨ã™ã‚‹è©¦ã¿ã§ã™"
-#: ext.c:296
-msgid "Operation Not Supported"
-msgstr "ã“ã®æ“作ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
+#: ext.c:221
+msgid "dynamic loading of library not supported"
+msgstr ""
+
+#: extension/filefuncs.c:75
+#, fuzzy
+msgid "chdir: called with incorrect number of arguments, expecting 1"
+msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•ã‚Œã¾ã—ãŸ"
+
+#: extension/filefuncs.c:348
+#, fuzzy
+msgid "stat: called with wrong number of arguments"
+msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•ã‚Œã¾ã—ãŸ"
+
+#: extension/filefuncs.c:355
+#, fuzzy
+msgid "stat: bad parameters"
+msgstr "%s: 仮引数ã§ã™\n"
+
+#: extension/filefuncs.c:421
+msgid "fill_stat_element: could not create array"
+msgstr ""
+
+#: extension/filefuncs.c:430
+msgid "fill_stat_element: could not set element"
+msgstr ""
+
+#: extension/filefuncs.c:445
+#, fuzzy
+msgid "fill_path_element: could not set element"
+msgstr "index: 文字列ã§ã¯ç„¡ã„第二引数をå—ã‘å–ã‚Šã¾ã—ãŸ"
+
+#: extension/filefuncs.c:461
+msgid "fill_error_element: could not set element"
+msgstr ""
+
+#: extension/filefuncs.c:508 extension/filefuncs.c:555
+msgid "fts-process: could not create array"
+msgstr ""
+
+#: extension/filefuncs.c:518 extension/filefuncs.c:565
+#: extension/filefuncs.c:583
+#, fuzzy
+msgid "fts-process: could not set element"
+msgstr "index: 文字列ã§ã¯ç„¡ã„第二引数をå—ã‘å–ã‚Šã¾ã—ãŸ"
+
+#: extension/filefuncs.c:632
+#, fuzzy
+msgid "fts: called with incorrect number of arguments, expecting 3"
+msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•ã‚Œã¾ã—ãŸ"
+
+#: extension/filefuncs.c:635
+#, fuzzy
+msgid "fts: bad first parameter"
+msgstr "%s: 仮引数ã§ã™\n"
+
+#: extension/filefuncs.c:641
+#, fuzzy
+msgid "fts: bad second parameter"
+msgstr "%s: 仮引数ã§ã™\n"
+
+#: extension/filefuncs.c:647
+#, fuzzy
+msgid "fts: bad third parameter"
+msgstr "%s: 仮引数ã§ã™\n"
+
+#: extension/filefuncs.c:654
+#, fuzzy
+msgid "fts: could not flatten array\n"
+msgstr "`%s' ã¯ä¸æ­£ãªå¤‰æ•°åã§ã™"
+
+#: extension/filefuncs.c:672
+msgid "fts: ignoring sneaky FTS_NOSTAT flag. nyah, nyah, nyah."
+msgstr ""
+
+#: extension/filefuncs.c:689
+msgid "fts: clear_array failed\n"
+msgstr ""
+
+#: extension/fnmatch.c:91
+#, fuzzy
+msgid "fnmatch: called with less than three arguments"
+msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•ã‚Œã¾ã—ãŸ"
+
+#: extension/fnmatch.c:94
+#, fuzzy
+msgid "fnmatch: called with more than three arguments"
+msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•ã‚Œã¾ã—ãŸ"
+
+#: extension/fnmatch.c:97
+#, fuzzy
+msgid "fnmatch: could not get first argument"
+msgstr "strftime: éžæ–‡å­—列ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–ã‚Šã¾ã—ãŸ"
+
+#: extension/fnmatch.c:102
+#, fuzzy
+msgid "fnmatch: could not get second argument"
+msgstr "index: 文字列ã§ã¯ç„¡ã„第二引数をå—ã‘å–ã‚Šã¾ã—ãŸ"
+
+#: extension/fnmatch.c:107
+msgid "fnmatch: could not get third argument"
+msgstr ""
+
+#: extension/fnmatch.c:120
+msgid "fnmatch is not implemented on this system\n"
+msgstr ""
-#: field.c:328
+#: extension/fnmatch.c:152
+msgid "fnmatch init: could not add FNM_NOMATCH variable"
+msgstr ""
+
+#: extension/fnmatch.c:162
+#, c-format
+msgid "fnmatch init: could not set array element %s"
+msgstr ""
+
+#: extension/fnmatch.c:172
+msgid "fnmatch init: could not install FNM array"
+msgstr ""
+
+#: extension/fork.c:81
+#, fuzzy
+msgid "fork: called with too many arguments"
+msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•ã‚Œã¾ã—ãŸ"
+
+#: extension/fork.c:94
+msgid "fork: PROCINFO is not an array!"
+msgstr ""
+
+#: extension/fork.c:118
+#, fuzzy
+msgid "waitpid: called with too many arguments"
+msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•ã‚Œã¾ã—ãŸ"
+
+#: extension/fork.c:126
+#, fuzzy
+msgid "wait: called with no arguments"
+msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•ã‚Œã¾ã—ãŸ"
+
+#: extension/fork.c:143
+#, fuzzy
+msgid "wait: called with too many arguments"
+msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•ã‚Œã¾ã—ãŸ"
+
+#: extension/ordchr.c:69
+#, fuzzy
+msgid "ord: called with too many arguments"
+msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•ã‚Œã¾ã—ãŸ"
+
+#: extension/ordchr.c:75
+#, fuzzy
+msgid "ord: called with no arguments"
+msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•ã‚Œã¾ã—ãŸ"
+
+#: extension/ordchr.c:77
+#, fuzzy
+msgid "ord: called with inappropriate argument(s)"
+msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•ã‚Œã¾ã—ãŸ"
+
+#: extension/ordchr.c:99
+#, fuzzy
+msgid "chr: called with too many arguments"
+msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•ã‚Œã¾ã—ãŸ"
+
+#: extension/ordchr.c:109
+#, fuzzy
+msgid "chr: called with no arguments"
+msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•ã‚Œã¾ã—ãŸ"
+
+#: extension/ordchr.c:111
+#, fuzzy
+msgid "chr: called with inappropriate argument(s)"
+msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•ã‚Œã¾ã—ãŸ"
+
+#: extension/readfile.c:81
+#, fuzzy
+msgid "readfile: called with too many arguments"
+msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•ã‚Œã¾ã—ãŸ"
+
+#: extension/readfile.c:114
+#, fuzzy
+msgid "readfile: called with no arguments"
+msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•ã‚Œã¾ã—ãŸ"
+
+#: extension/rwarray.c:120
+#, fuzzy
+msgid "writea: called with too many arguments"
+msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•ã‚Œã¾ã—ãŸ"
+
+#: extension/rwarray.c:127
+#, fuzzy, c-format
+msgid "do_writea: argument 0 is not a string\n"
+msgstr "exp: 引数 %g ãŒç¯„囲外ã§ã™"
+
+#: extension/rwarray.c:133
+#, fuzzy, c-format
+msgid "do_writea: argument 1 is not an array\n"
+msgstr "split: 第四引数ãŒé…列ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+
+#: extension/rwarray.c:180
+#, c-format
+msgid "write_array: could not flatten array\n"
+msgstr ""
+
+#: extension/rwarray.c:194
+#, c-format
+msgid "write_array: could not release flattened array\n"
+msgstr ""
+
+#: extension/rwarray.c:276
+#, fuzzy
+msgid "reada: called with too many arguments"
+msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•ã‚Œã¾ã—ãŸ"
+
+#: extension/rwarray.c:283
+#, fuzzy, c-format
+msgid "do_reada: argument 0 is not a string\n"
+msgstr "exp: 引数 %g ãŒç¯„囲外ã§ã™"
+
+#: extension/rwarray.c:289
+#, fuzzy, c-format
+msgid "do_reada: argument 1 is not an array\n"
+msgstr "match: 第三引数ãŒé…列ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+
+#: extension/rwarray.c:333
+#, c-format
+msgid "do_reada: clear_array failed\n"
+msgstr ""
+
+#: extension/rwarray.c:370
+#, c-format
+msgid "read_array: set_array_element failed\n"
+msgstr ""
+
+#: extension/time.c:78
+#, fuzzy
+msgid "gettimeofday: ignoring arguments"
+msgstr "mktime: éžæ–‡å­—列引数をå—ã‘å–ã‚Šã¾ã—ãŸ"
+
+#: extension/time.c:109
+msgid "gettimeofday: not supported on this platform"
+msgstr ""
+
+#: extension/time.c:130
+#, fuzzy
+msgid "sleep: called with too many arguments"
+msgstr "sqrt: è² ã®å€¤ %g を引数ã«ä½¿ç”¨ã—ã¦å‘¼ã³å‡ºã•ã‚Œã¾ã—ãŸ"
+
+#: extension/time.c:133
+#, fuzzy
+msgid "sleep: missing required numeric argument"
+msgstr "exp: 引数ãŒæ•°å€¤ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+
+#: extension/time.c:139
+#, fuzzy
+msgid "sleep: argument is negative"
+msgstr "exp: 引数 %g ãŒç¯„囲外ã§ã™"
+
+#: extension/time.c:166
+msgid "sleep: not supported on this platform"
+msgstr ""
+
+#: field.c:339
msgid "NF set to negative value"
msgstr "NF ãŒè² ã®å€¤ã«è¨­å®šã•ã‚Œã¦ã„ã¾ã™"
-#: field.c:951 field.c:958 field.c:962
+#: field.c:962 field.c:969 field.c:973
msgid "split: fourth argument is a gawk extension"
msgstr "split: 第四引数㯠gawk æ‹¡å¼µã§ã™"
-#: field.c:955
+#: field.c:966
msgid "split: fourth argument is not an array"
msgstr "split: 第四引数ãŒé…列ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
-#: field.c:969
+#: field.c:980
msgid "split: second argument is not an array"
msgstr "split: 第二引数ãŒé…列ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
-#: field.c:973
+#: field.c:984
msgid "split: cannot use the same array for second and fourth args"
msgstr "split: 第二引数ã¨ç¬¬å››å¼•æ•°ã«åŒã˜é…列を使用ã™ã‚‹ã“ã¨ã¯å‡ºæ¥ã¾ã›ã‚“"
-#: field.c:978
+#: field.c:989
msgid "split: cannot use a subarray of second arg for fourth arg"
msgstr "split: 第四引数ã«ç¬¬äºŒå¼•æ•°ã®éƒ¨åˆ†é…列を使用ã™ã‚‹ã“ã¨ã¯å‡ºæ¥ã¾ã›ã‚“"
-#: field.c:981
+#: field.c:992
msgid "split: cannot use a subarray of fourth arg for second arg"
msgstr "split: 第二引数ã«ç¬¬å››å¼•æ•°ã®éƒ¨åˆ†é…列を使用ã™ã‚‹ã“ã¨ã¯å‡ºæ¥ã¾ã›ã‚“"
-#: field.c:1010
+#: field.c:1021
msgid "split: null string for third arg is a gawk extension"
msgstr "split: 第三引数㫠NULL 文字列を使用ã™ã‚‹ã“ã¨ã¯ gawk æ‹¡å¼µã§ã™"
-#: field.c:1050
+#: field.c:1061
msgid "patsplit: fourth argument is not an array"
msgstr "patsplit: 第四引数ãŒé…列ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
-#: field.c:1055
+#: field.c:1066
msgid "patsplit: second argument is not an array"
msgstr "patsplit: 第二引数ãŒé…列ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
-#: field.c:1061
+#: field.c:1072
msgid "patsplit: third argument must be non-null"
msgstr "patsplit: 第三引数ã¯éž NULL ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
-#: field.c:1065
+#: field.c:1076
msgid "patsplit: cannot use the same array for second and fourth args"
msgstr "patsplit: 第二引数ã¨ç¬¬å››å¼•æ•°ã«åŒã˜é…列を使用ã™ã‚‹ã“ã¨ã¯å‡ºæ¥ã¾ã›ã‚“"
-#: field.c:1070
+#: field.c:1081
msgid "patsplit: cannot use a subarray of second arg for fourth arg"
msgstr "patsplit: 第四引数ã«ç¬¬äºŒå¼•æ•°ã®éƒ¨åˆ†é…列を使用ã™ã‚‹ã“ã¨ã¯å‡ºæ¥ã¾ã›ã‚“"
-#: field.c:1073
+#: field.c:1084
msgid "patsplit: cannot use a subarray of fourth arg for second arg"
msgstr "patsplit: 第二引数ã«ç¬¬å››å¼•æ•°ã®éƒ¨åˆ†é…列を使用ã™ã‚‹ã“ã¨ã¯å‡ºæ¥ã¾ã›ã‚“"
-#: field.c:1110
+#: field.c:1122
msgid "`FIELDWIDTHS' is a gawk extension"
msgstr "`FIELDWIDTHS' 㯠gawk æ‹¡å¼µã§ã™"
-#: field.c:1173
+#: field.c:1186
#, c-format
msgid "invalid FIELDWIDTHS value, near `%s'"
msgstr "`%s' 付近㮠FIELDWIDTHS 値ãŒç„¡åŠ¹ã§ã™"
-#: field.c:1246
+#: field.c:1259
msgid "null string for `FS' is a gawk extension"
msgstr "`FS' ã« NULL 文字列を使用ã™ã‚‹ã®ã¯ gawk æ‹¡å¼µã§ã™"
-#: field.c:1250
+#: field.c:1263
msgid "old awk does not support regexps as value of `FS'"
msgstr "å¤ã„ awk 㯠`FS' ã®å€¤ã¨ã—ã¦æ­£è¦è¡¨ç¾ã‚’サãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
-#: field.c:1369
+#: field.c:1382
msgid "`FPAT' is a gawk extension"
msgstr "`FPAT' 㯠gawk æ‹¡å¼µã§ã™"
+#: gawkapi.c:143
+msgid "awk_value_to_node: received null retval"
+msgstr ""
+
+#: gawkapi.c:932
+#, c-format
+msgid "api_flatten_array: could not convert index %d\n"
+msgstr ""
+
+#: gawkapi.c:937
+#, c-format
+msgid "api_flatten_array: could not convert value %d\n"
+msgstr ""
+
+#: gawkapi.c:1111
+msgid "cannot assign to defined constant"
+msgstr ""
+
#: getopt.c:604 getopt.c:633
#, fuzzy, c-format
msgid "%s: option '%s' is ambiguous; possibilities:"
@@ -1320,466 +2395,530 @@ msgstr "%s: オプション '-W %s' ã¯å¼•æ•°ã‚’å–ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“\n
msgid "%s: option '-W %s' requires an argument\n"
msgstr "%s: オプション '-W %s' ã«ã¯å¼•æ•°ãŒå¿…è¦ã§ã™\n"
-#: io.c:280
+#: io.c:339
#, c-format
msgid "command line argument `%s' is a directory: skipped"
msgstr "コマンドライン引数 `%s' ã¯ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã§ã™: スキップã•ã‚Œã¾ã—ãŸ"
-#: io.c:283 io.c:385
+#: io.c:342 io.c:455
#, c-format
msgid "cannot open file `%s' for reading (%s)"
msgstr "ファイル `%s' を読ã¿è¾¼ã¿ç”¨ã«é–‹ã‘ã¾ã›ã‚“ (%s)"
-#: io.c:501
+#: io.c:582
#, c-format
msgid "close of fd %d (`%s') failed (%s)"
msgstr "fd %d (`%s') ã‚’é–‰ã˜ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“ (%s)"
-#: io.c:578
+#: io.c:658
msgid "redirection not allowed in sandbox mode"
msgstr "サンドボックスモード内ã§ã¯ãƒªãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
-#: io.c:612
+#: io.c:692
#, c-format
msgid "expression in `%s' redirection only has numeric value"
msgstr "`%s' リダイレクトã®å‘½ä»¤å¼ã«æ•°å€¤ã—ã‹è¨˜è¿°ã•ã‚Œã¦ã„ã¾ã›ã‚“。"
-#: io.c:618
+#: io.c:698
#, c-format
msgid "expression for `%s' redirection has null string value"
msgstr "`%s' リダイレクトã®å‘½ä»¤å¼ãŒç©ºåˆ—ã§ã™ã€‚"
-#: io.c:623
+#: io.c:703
#, c-format
msgid "filename `%s' for `%s' redirection may be result of logical expression"
msgstr ""
"`%2$s' リダイレクトã«è«–ç†æ¼”ç®—ã®çµæžœã¨æ€ã‚れるファイルå `%1$s' ãŒä½¿ã‚ã‚Œã¦ã„ã¾"
"ã™ã€‚"
-#: io.c:666
+#: io.c:746
#, c-format
msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
msgstr "ファイル `%.*s' ã§å¿…è¦ä»¥ä¸Šã« `>' 㨠`>>' を組åˆã›ã¦ã„ã¾ã™ã€‚"
-#: io.c:719
+#: io.c:799
#, c-format
msgid "can't open pipe `%s' for output (%s)"
msgstr "出力用ã«ãƒ‘イプ `%s' ã‚’é–‹ã‘ã¾ã›ã‚“ (%s)"
-#: io.c:729
+#: io.c:809
#, c-format
msgid "can't open pipe `%s' for input (%s)"
msgstr "入力用ã«ãƒ‘イプ `%s' ã‚’é–‹ã‘ã¾ã›ã‚“ (%s)"
-#: io.c:752
+#: io.c:840
#, c-format
msgid "can't open two way pipe `%s' for input/output (%s)"
msgstr "入出力用ã®åŒæ–¹å‘パイプ `%s' ãŒé–‹ã‘ã¾ã›ã‚“ (%s)"
-#: io.c:834
+#: io.c:923
#, c-format
msgid "can't redirect from `%s' (%s)"
msgstr "`%s' ã‹ã‚‰ãƒªãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆã§ãã¾ã›ã‚“ (%s)"
-#: io.c:837
+#: io.c:926
#, c-format
msgid "can't redirect to `%s' (%s)"
msgstr "`%s' ã«ãƒªãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆã§ãã¾ã›ã‚“ (%s)"
-#: io.c:888
+#: io.c:977
msgid ""
"reached system limit for open files: starting to multiplex file descriptors"
msgstr ""
"é–‹ã„ã¦ã„るファイルã®æ•°ãŒã‚·ã‚¹ãƒ†ãƒ åˆ¶é™ã«é”ã—ã¾ã—ãŸã€‚ファイル記述å­ã‚’多é‡åŒ–ã—ã¾"
"ã™ã€‚"
-#: io.c:904
+#: io.c:993
#, c-format
msgid "close of `%s' failed (%s)."
msgstr "`%s' ã‚’é–‰ã˜ã‚‹ã®ã«å¤±æ•—ã—ã¾ã—㟠(%s)"
-#: io.c:912
+#: io.c:1001
msgid "too many pipes or input files open"
msgstr "é–‹ã„ã¦ã„るパイプã¾ãŸã¯å…¥åŠ›ãƒ•ã‚¡ã‚¤ãƒ«ã®æ•°ãŒå¤šéŽãŽã¾ã™ã€‚"
-#: io.c:934
+#: io.c:1023
msgid "close: second argument must be `to' or `from'"
msgstr "close: 第二引数㯠`to' ã¾ãŸã¯ `from' ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
-#: io.c:951
+#: io.c:1040
#, c-format
msgid "close: `%.*s' is not an open file, pipe or co-process"
msgstr "close: `%.*s' ã¯é–‹ã„ã¦ã„るファイルã€ãƒ‘イプã€ãƒ—ロセス共有ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
-#: io.c:956
+#: io.c:1045
msgid "close of redirection that was never opened"
msgstr "é–‹ã„ã¦ãªã„リダイレクトを閉ã˜ã‚ˆã†ã¨ã—ã¦ã„ã¾ã™"
-#: io.c:1053
+#: io.c:1142
#, c-format
msgid "close: redirection `%s' not opened with `|&', second argument ignored"
msgstr ""
"close: リダイレクト `%s' 㯠`|&' を使用ã—ã¦é–‹ã‹ã‚Œã¦ã„ã¾ã›ã‚“。第二引数ã¯ç„¡è¦–ã•"
"ã‚Œã¾ã—ãŸ"
-#: io.c:1069
+#: io.c:1159
#, c-format
msgid "failure status (%d) on pipe close of `%s' (%s)"
msgstr "パイプ `%2$s' ã‚’é–‰ã˜ãŸã¨ãã®çŠ¶æ…‹ã‚³ãƒ¼ãƒ‰ãŒå¤±æ•— (%1$d) ã§ã—㟠(%3$s)。"
-#: io.c:1072
+#: io.c:1162
#, c-format
msgid "failure status (%d) on file close of `%s' (%s)"
msgstr "ファイル `%2$s' ã‚’é–‰ã˜ãŸã¨ãã®çŠ¶æ…‹ã‚³ãƒ¼ãƒ‰ãŒå¤±æ•— (%1$d) ã§ã—㟠(%3$s)。"
-#: io.c:1092
+#: io.c:1182
#, c-format
msgid "no explicit close of socket `%s' provided"
msgstr "ソケット `%s' を明示ã—ã¦é–‰ã˜ã¦ã„ã¾ã›ã‚“。"
-#: io.c:1095
+#: io.c:1185
#, c-format
msgid "no explicit close of co-process `%s' provided"
msgstr "並行プロセス `%s' を明示ã—ã¦é–‰ã˜ã¦ã„ã¾ã›ã‚“。"
-#: io.c:1098
+#: io.c:1188
#, c-format
msgid "no explicit close of pipe `%s' provided"
msgstr "パイプ `%s' を明示ã—ã¦é–‰ã˜ã¦ã„ã¾ã›ã‚“。"
-#: io.c:1101
+#: io.c:1191
#, c-format
msgid "no explicit close of file `%s' provided"
msgstr "ファイル `%s' を明示ã—ã¦é–‰ã˜ã¦ã„ã¾ã›ã‚“。"
-#: io.c:1129 io.c:1184 main.c:797 main.c:834
+#: io.c:1219 io.c:1274 main.c:847 main.c:884
#, c-format
msgid "error writing standard output (%s)"
msgstr "標準出力ã¸ã®æ›¸è¾¼ã¿ã‚¨ãƒ©ãƒ¼ (%s)"
-#: io.c:1133 io.c:1189
+#: io.c:1223 io.c:1279
#, c-format
msgid "error writing standard error (%s)"
msgstr "標準エラーã¸ã®æ›¸è¾¼ã¿ã‚¨ãƒ©ãƒ¼ (%s)"
-#: io.c:1141
+#: io.c:1231
#, c-format
msgid "pipe flush of `%s' failed (%s)."
msgstr "パイプ `%s' をフラッシュã§ãã¾ã›ã‚“ (%s)。"
-#: io.c:1144
+#: io.c:1234
#, c-format
msgid "co-process flush of pipe to `%s' failed (%s)."
msgstr "`%s' ã¸æŽ¥ç¶šã™ã‚‹ãƒ‘イプを並行プロセスã‹ã‚‰ãƒ•ãƒ©ãƒƒã‚·ãƒ¥ã§ãã¾ã›ã‚“ (%s)。"
-#: io.c:1147
+#: io.c:1237
#, c-format
msgid "file flush of `%s' failed (%s)."
msgstr "ファイル `%s' をフラッシュã§ãã¾ã›ã‚“ (%s)。"
-#: io.c:1262
+#: io.c:1351
#, c-format
msgid "local port %s invalid in `/inet'"
msgstr "`/inet' 内ã®ãƒ­ãƒ¼ã‚«ãƒ«ãƒãƒ¼ãƒˆ %s ãŒç„¡åŠ¹ã§ã™"
-#: io.c:1279
+#: io.c:1369
#, c-format
msgid "remote host and port information (%s, %s) invalid"
msgstr "リモートã®ãƒ›ã‚¹ãƒˆãŠã‚ˆã³ãƒãƒ¼ãƒˆæƒ…å ± (%s, %s) ãŒç„¡åŠ¹ã§ã™"
-#: io.c:1431
+#: io.c:1521
#, c-format
msgid "no (known) protocol supplied in special filename `%s'"
msgstr ""
"スペシャルファイルå `%s' ã«ï¼ˆèªè­˜ã§ãる)プロトコルãŒæŒ‡å®šã•ã‚Œã¦ã„ã¾ã›ã‚“"
-#: io.c:1445
+#: io.c:1535
#, c-format
msgid "special file name `%s' is incomplete"
msgstr "スペシャルファイルå `%s' ã¯ä¸å®Œå…¨ã§ã™"
-#: io.c:1462
+#: io.c:1552
msgid "must supply a remote hostname to `/inet'"
msgstr "`/inet' ã«ã¯ãƒªãƒ¢ãƒ¼ãƒˆãƒ›ã‚¹ãƒˆåを与ãˆãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
-#: io.c:1480
+#: io.c:1570
msgid "must supply a remote port to `/inet'"
msgstr "`/inet' ã«ã¯ãƒªãƒ¢ãƒ¼ãƒˆãƒãƒ¼ãƒˆç•ªå·ã‚’与ãˆãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
-#: io.c:1526
+#: io.c:1616
msgid "TCP/IP communications are not supported"
msgstr "TCP/IP 通信ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
-#: io.c:1693
+#: io.c:1785
#, c-format
msgid "could not open `%s', mode `%s'"
msgstr "`%s' をモード `%s' ã§é–‹ã‘ã¾ã›ã‚“"
-#: io.c:1747
+#: io.c:1835
#, c-format
msgid "close of master pty failed (%s)"
msgstr "マスター pty ã‚’é–‰ã˜ã‚‹ã®ã«å¤±æ•—ã—ã¾ã—㟠(%s)"
-#: io.c:1749 io.c:1917 io.c:2074
+#: io.c:1837 io.c:2012 io.c:2181
#, c-format
msgid "close of stdout in child failed (%s)"
msgstr "å­ãƒ—ロセスãŒæ¨™æº–出力を閉ã˜ã‚‹ã®ã«å¤±æ•—ã—ã¾ã—㟠(%s)"
-#: io.c:1752
+#: io.c:1840
#, c-format
msgid "moving slave pty to stdout in child failed (dup: %s)"
msgstr "å­ãƒ—ロセスãŒã‚¹ãƒ¬ãƒ¼ãƒ– pty を標準出力ã«ç§»å‹•ã§ãã¾ã›ã‚“ (dup: %s)。"
-#: io.c:1754 io.c:1922
+#: io.c:1842 io.c:2017
#, c-format
msgid "close of stdin in child failed (%s)"
msgstr "å­ãƒ—ロセスãŒæ¨™æº–入力を閉ã˜ã‚‰ã‚Œã¾ã›ã‚“ (%s)。"
-#: io.c:1757
+#: io.c:1845
#, c-format
msgid "moving slave pty to stdin in child failed (dup: %s)"
msgstr "å­ãƒ—ロセスãŒã‚¹ãƒ¬ãƒ¼ãƒ– pty を標準入力ã«ç§»å‹•ã§ãã¾ã›ã‚“ (dup: %s)。"
-#: io.c:1759 io.c:1780
+#: io.c:1847 io.c:1868
#, c-format
msgid "close of slave pty failed (%s)"
msgstr "スレーブ pty ã‚’é–‰ã˜ã‚‹ã®ã«å¤±æ•—ã—ã¾ã—㟠(%s)"
-#: io.c:1858 io.c:1920 io.c:2052 io.c:2077
+#: io.c:1953 io.c:2015 io.c:2158 io.c:2184
#, c-format
msgid "moving pipe to stdout in child failed (dup: %s)"
msgstr "å­ãƒ—ロセスãŒãƒ‘イプを標準出力ã«ç§»å‹•ã§ãã¾ã›ã‚“ (dup: %s)。"
-#: io.c:1865 io.c:1925
+#: io.c:1960 io.c:2020
#, c-format
msgid "moving pipe to stdin in child failed (dup: %s)"
msgstr "å­ãƒ—ロセスãŒãƒ‘イプを標準入力ã«ç§»å‹•ã§ãã¾ã›ã‚“ (dup: %s)。"
-#: io.c:1885 io.c:2067
+#: io.c:1980 io.c:2174
msgid "restoring stdout in parent process failed\n"
msgstr "親プロセスãŒæ¨™æº–出力を復旧ã§ãã¾ã›ã‚“。\n"
-#: io.c:1893
+#: io.c:1988
msgid "restoring stdin in parent process failed\n"
msgstr "親プロセスãŒæ¨™æº–入力を復旧ã§ãã¾ã›ã‚“。\n"
-#: io.c:1928 io.c:2079 io.c:2093
+#: io.c:2023 io.c:2186 io.c:2200
#, c-format
msgid "close of pipe failed (%s)"
msgstr "パイプを閉ã˜ã‚‰ã‚Œã¾ã›ã‚“ (%s)。"
-#: io.c:1973
+#: io.c:2076
msgid "`|&' not supported"
msgstr "`|&' ã¯ä½¿ç”¨ã§ãã¾ã›ã‚“。"
-#: io.c:2039
+#: io.c:2143
#, c-format
msgid "cannot open pipe `%s' (%s)"
msgstr "パイプ `%s' ãŒé–‹ã‘ã¾ã›ã‚“ (%s)。"
-#: io.c:2087
+#: io.c:2194
#, c-format
msgid "cannot create child process for `%s' (fork: %s)"
msgstr "`%s' 用ã®å­ãƒ—ロセスを実行ã§ãã¾ã›ã‚“ (fork: %s)。"
-#: io.c:2520
+#: io.c:2652
+msgid "register_input_parser: received NULL pointer"
+msgstr ""
+
+#: io.c:2680
+#, c-format
+msgid "input parser `%s' conflicts with previously installed input parser `%s'"
+msgstr ""
+
+#: io.c:2687
+#, c-format
+msgid "input parser `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2707
+msgid "register_output_wrapper: received NULL pointer"
+msgstr ""
+
+#: io.c:2735
+#, c-format
+msgid ""
+"output wrapper `%s' conflicts with previously installed output wrapper `%s'"
+msgstr ""
+
+#: io.c:2742
+#, c-format
+msgid "output wrapper `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2763
+msgid "register_output_processor: received NULL pointer"
+msgstr ""
+
+#: io.c:2792
+#, c-format
+msgid ""
+"two-way processor `%s' conflicts with previously installed two-way processor "
+"`%s'"
+msgstr ""
+
+#: io.c:2801
+#, c-format
+msgid "two way processor `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2908
#, c-format
msgid "data file `%s' is empty"
msgstr "データファイル `%s' ã¯ç©ºã§ã™ã€‚"
-#: io.c:2561 io.c:2569
+#: io.c:2950 io.c:2958
msgid "could not allocate more input memory"
msgstr "入力用メモリーをã“れ以上確ä¿ã§ãã¾ã›ã‚“。"
-#: io.c:3127
+#: io.c:3524
msgid "multicharacter value of `RS' is a gawk extension"
msgstr "複数ã®æ–‡å­—ã‚’ `RS' ã«ä½¿ç”¨ã™ã‚‹ã®ã¯ gawk 特有ã®æ‹¡å¼µã§ã™ã€‚"
-#: io.c:3232
+#: io.c:3613
msgid "IPv6 communication is not supported"
msgstr "IPv6 通信ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
-#: main.c:366
+#: main.c:362
msgid "`-m[fr]' option irrelevant in gawk"
msgstr "gawk ã§ã¯ã‚ªãƒ—ション `-m[fr]' ã«åŠ¹æžœã¯ã‚ã‚Šã¾ã›ã‚“。"
-#: main.c:368
+#: main.c:364
msgid "-m option usage: `-m[fr] nnn'"
msgstr "-m オプションã®ä½¿ç”¨æ³•: `-m[fr] 数値'"
-#: main.c:391
+#: main.c:393
msgid "empty argument to `-e/--source' ignored"
msgstr "`-e/--source' ã¸ã®ç©ºã®å¼•æ•°ã¯ç„¡è¦–ã•ã‚Œã¾ã—ãŸ"
-#: main.c:462
+#: main.c:483
#, c-format
msgid "%s: option `-W %s' unrecognized, ignored\n"
msgstr "%s: オプション `-W %s' ã¯èªè­˜ã§ãã¾ã›ã‚“。無視ã•ã‚Œã¾ã—ãŸ\n"
-#: main.c:515
+#: main.c:529
#, c-format
msgid "%s: option requires an argument -- %c\n"
msgstr "%s: 引数ãŒå¿…è¦ãªã‚ªãƒ—ション -- %c\n"
-#: main.c:536
+#: main.c:550
msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
msgstr ""
"環境変数 `POSIXLY_CORRECT' ãŒæŒ‡å®šã•ã‚Œã¦ã„ã¾ã™ã€‚オプション `--posix' を有効ã«"
"ã—ã¾ã™"
-#: main.c:542
+#: main.c:556
msgid "`--posix' overrides `--traditional'"
msgstr "オプション `--posix' 㯠`--traditional' を無効ã«ã—ã¾ã™ã€‚"
-#: main.c:553
+#: main.c:567
msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
msgstr ""
"オプション `--posix'/`--traditional' 㯠`--non-decimal-data' を無効ã«ã—ã¾ã™ã€‚"
-#: main.c:557
+#: main.c:571
#, c-format
msgid "running %s setuid root may be a security problem"
msgstr ""
"setuid root 㧠%s を実行ã™ã‚‹ã¨ã€ã‚»ã‚­ãƒ¥ãƒªãƒ†ã‚£ä¸Šã®å•é¡ŒãŒç™ºç”Ÿã™ã‚‹å ´åˆãŒã‚ã‚Šã¾"
"ã™ã€‚"
-#: main.c:562
+#: main.c:576
#, fuzzy
msgid "`--posix' overrides `--characters-as-bytes'"
msgstr "`--posix' 㯠`--binary' を上書ãã—ã¾ã™"
-#: main.c:616
+#: main.c:635
#, c-format
msgid "can't set binary mode on stdin (%s)"
msgstr "標準入力をãƒã‚¤ãƒŠãƒªãƒ¢ãƒ¼ãƒ‰ã«è¨­å®šã§ãã¾ã›ã‚“ (%s)"
-#: main.c:619
+#: main.c:638
#, c-format
msgid "can't set binary mode on stdout (%s)"
msgstr "標準出力をãƒã‚¤ãƒŠãƒªãƒ¢ãƒ¼ãƒ‰ã«è¨­å®šã§ãã¾ã›ã‚“ (%s)"
-#: main.c:621
+#: main.c:640
#, c-format
msgid "can't set binary mode on stderr (%s)"
msgstr "標準エラーをãƒã‚¤ãƒŠãƒªãƒ¢ãƒ¼ãƒ‰ã«è¨­å®šã§ãã¾ã›ã‚“ (%s)"
-#: main.c:660
+#: main.c:698
msgid "no program text at all!"
msgstr "プログラム文ãŒå…¨ãã‚ã‚Šã¾ã›ã‚“!"
-#: main.c:737
+#: main.c:784
#, c-format
msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"
msgstr ""
"使用法: %s [POSIX ã¾ãŸã¯ GNU å½¢å¼ã®ã‚ªãƒ—ション] -f progfile [--] file ...\n"
-#: main.c:739
+#: main.c:786
#, c-format
msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"
msgstr ""
"使用法: %s [POSIX ã¾ãŸã¯ GNU å½¢å¼ã®ã‚ªãƒ—ション] [--] %cprogram%c file ...\n"
-#: main.c:744
+#: main.c:791
msgid "POSIX options:\t\tGNU long options: (standard)\n"
msgstr "POSIX オプション:\t\tGNU é•·ã„å½¢å¼ã®ã‚ªãƒ—ション: (標準)\n"
-#: main.c:745
+#: main.c:792
msgid "\t-f progfile\t\t--file=progfile\n"
msgstr "\t-f progfile\t\t--file=progfile\n"
-#: main.c:746
+#: main.c:793
msgid "\t-F fs\t\t\t--field-separator=fs\n"
msgstr "\t-F fs\t\t\t--field-separator=fs\n"
-#: main.c:747
+#: main.c:794
msgid "\t-v var=val\t\t--assign=var=val\n"
msgstr "\t-v var=val\t\t--assign=var=val\n"
-#: main.c:748
+#: main.c:795
msgid "Short options:\t\tGNU long options: (extensions)\n"
msgstr "短ã„オプション:\t\tGNU é•·ã„å½¢å¼ã®ã‚ªãƒ—ション: (æ‹¡å¼µ)\n"
-#: main.c:749
+#: main.c:796
msgid "\t-b\t\t\t--characters-as-bytes\n"
msgstr "\t-b\t\t\t--characters-as-bytes\n"
-#: main.c:750
+#: main.c:797
msgid "\t-c\t\t\t--traditional\n"
msgstr "\t-c\t\t\t--traditional\n"
-#: main.c:751
+#: main.c:798
msgid "\t-C\t\t\t--copyright\n"
msgstr "\t-C\t\t\t--copyright\n"
-#: main.c:752
+#: main.c:799
msgid "\t-d[file]\t\t--dump-variables[=file]\n"
msgstr "\t-d[file]\t\t--dump-variables[=file]\n"
-#: main.c:753
+#: main.c:800
+#, fuzzy
+msgid "\t-D[file]\t\t--debug[=file]\n"
+msgstr "\t-p[file]\t\t--profile[=file]\n"
+
+#: main.c:801
msgid "\t-e 'program-text'\t--source='program-text'\n"
msgstr "\t-e 'program-text'\t--source='program-text'\n"
-#: main.c:754
+#: main.c:802
msgid "\t-E file\t\t\t--exec=file\n"
msgstr "\t-E file\t\t\t--exec=file\n"
-#: main.c:755
+#: main.c:803
msgid "\t-g\t\t\t--gen-pot\n"
msgstr "\t-g\t\t\t--gen-pot\n"
-#: main.c:756
+#: main.c:804
msgid "\t-h\t\t\t--help\n"
msgstr "\t-h\t\t\t--help\n"
-#: main.c:757
+#: main.c:805
+msgid "\t-i includefile\t\t--include=includefile\n"
+msgstr ""
+
+#: main.c:806
+msgid "\t-l library\t\t--load=library\n"
+msgstr ""
+
+#: main.c:807
msgid "\t-L [fatal]\t\t--lint[=fatal]\n"
msgstr "\t-L [fatal]\t\t--lint[=fatal]\n"
-#: main.c:758
+#: main.c:808
msgid "\t-n\t\t\t--non-decimal-data\n"
msgstr "\t-n\t\t\t--non-decimal-data\n"
-#: main.c:759
+#: main.c:809
+#, fuzzy
+msgid "\t-M\t\t\t--bignum\n"
+msgstr "\t-g\t\t\t--gen-pot\n"
+
+#: main.c:810
msgid "\t-N\t\t\t--use-lc-numeric\n"
msgstr "\t-N\t\t\t--use-lc-numeric\n"
-#: main.c:760
+#: main.c:811
+#, fuzzy
+msgid "\t-o[file]\t\t--pretty-print[=file]\n"
+msgstr "\t-p[file]\t\t--profile[=file]\n"
+
+#: main.c:812
msgid "\t-O\t\t\t--optimize\n"
msgstr "\t-O\t\t\t--optimize\n"
-#: main.c:761
+#: main.c:813
msgid "\t-p[file]\t\t--profile[=file]\n"
msgstr "\t-p[file]\t\t--profile[=file]\n"
-#: main.c:762
+#: main.c:814
msgid "\t-P\t\t\t--posix\n"
msgstr "\t-P\t\t\t--posix\n"
-#: main.c:763
+#: main.c:815
msgid "\t-r\t\t\t--re-interval\n"
msgstr "\t-r\t\t\t--re-interval\n"
-#: main.c:765
-msgid "\t-R file\t\t\t--command=file\n"
-msgstr "\t-R file\t\t\t--command=file\n"
-
-#: main.c:766
+#: main.c:816
msgid "\t-S\t\t\t--sandbox\n"
msgstr "\t-S\t\t\t--sandbox\n"
-#: main.c:767
+#: main.c:817
msgid "\t-t\t\t\t--lint-old\n"
msgstr "\t-t\t\t\t--lint-old\n"
-#: main.c:768
+#: main.c:818
msgid "\t-V\t\t\t--version\n"
msgstr "\t-V\t\t\t--version\n"
-#: main.c:770
+#: main.c:820
msgid "\t-W nostalgia\t\t--nostalgia\n"
msgstr "\t-W nostalgia\t\t--nostalgia\n"
-#: main.c:773
+#: main.c:823
msgid "\t-Y\t\t--parsedebug\n"
msgstr "\t-Y\t\t--parsedebug\n"
@@ -1788,7 +2927,7 @@ msgstr "\t-Y\t\t--parsedebug\n"
#. for this application. Please add _another line_ with the
#. address for translation bugs.
#. no-wrap
-#: main.c:782
+#: main.c:832
msgid ""
"\n"
"To report bugs, see node `Bugs' in `gawk.info', which is\n"
@@ -1803,7 +2942,7 @@ msgstr ""
"翻訳ã«é–¢ã™ã‚‹ãƒã‚°ã¯<translation-team-ja@lists.sourceforge.net>ã«å ±å‘Šã—ã¦ãã ã•"
"ã„。\n"
-#: main.c:786
+#: main.c:836
msgid ""
"gawk is a pattern scanning and processing language.\n"
"By default it reads standard input and writes standard output.\n"
@@ -1813,7 +2952,7 @@ msgstr ""
"デフォルト設定ã§ã¯ã€æ¨™æº–入力を読ã¿è¾¼ã¿ã€æ¨™æº–出力ã«æ›¸ã出ã—ã¾ã™ã€‚\n"
"\n"
-#: main.c:790
+#: main.c:840
msgid ""
"Examples:\n"
"\tgawk '{ sum += $1 }; END { print sum }' file\n"
@@ -1823,7 +2962,7 @@ msgstr ""
"\tgawk '{ sum += $1 }; END { print sum }' file\n"
"\tgawk -F: '{ print $1 }' /etc/passwd\n"
-#: main.c:810
+#: main.c:860
#, c-format
msgid ""
"Copyright (C) 1989, 1991-%d Free Software Foundation.\n"
@@ -1842,7 +2981,7 @@ msgstr ""
"(at your option) any later version.\n"
"\n"
-#: main.c:818
+#: main.c:868
msgid ""
"This program is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
@@ -1856,7 +2995,7 @@ msgstr ""
"GNU General Public License for more details.\n"
"\n"
-#: main.c:824
+#: main.c:874
msgid ""
"You should have received a copy of the GNU General Public License\n"
"along with this program. If not, see http://www.gnu.org/licenses/.\n"
@@ -1864,16 +3003,16 @@ msgstr ""
"You should have received a copy of the GNU General Public License\n"
"along with this program. If not, see http://www.gnu.org/licenses/.\n"
-#: main.c:859
+#: main.c:909
msgid "-Ft does not set FS to tab in POSIX awk"
msgstr "POSIX awk ã§ã¯ -Ft 㯠FS をタブã«è¨­å®šã—ã¾ã›ã‚“"
-#: main.c:1093
+#: main.c:1169
#, c-format
msgid "unknown value for field spec: %d\n"
msgstr "フィールド指定ã«ä¸æ˜Žãªå€¤ãŒã‚ã‚Šã¾ã™: %d\n"
-#: main.c:1174
+#: main.c:1267
#, c-format
msgid ""
"%s: `%s' argument to `-v' not in `var=value' form\n"
@@ -1882,79 +3021,145 @@ msgstr ""
"%s: オプション `-v' ã®å¼•æ•° `%s' ㌠`変数=代入値' ã®å½¢å¼ã«ãªã£ã¦ã„ã¾ã›ã‚“。\n"
"\n"
-#: main.c:1200
+#: main.c:1293
#, c-format
msgid "`%s' is not a legal variable name"
msgstr "`%s' ã¯ä¸æ­£ãªå¤‰æ•°åã§ã™"
-#: main.c:1203
+#: main.c:1296
#, c-format
msgid "`%s' is not a variable name, looking for file `%s=%s'"
msgstr "`%s' ã¯å¤‰æ•°åã§ã¯ã‚ã‚Šã¾ã›ã‚“。`%s=%s' ã®ãƒ•ã‚¡ã‚¤ãƒ«ã‚’探ã—ã¾ã™ã€‚"
-#: main.c:1207
+#: main.c:1300
#, c-format
msgid "cannot use gawk builtin `%s' as variable name"
msgstr "gawk ã«çµ„ã¿è¾¼ã¿ã® `%s' ã¯å¤‰æ•°åã¨ã—ã¦ä½¿ç”¨å‡ºæ¥ã¾ã›ã‚“"
-#: main.c:1212
+#: main.c:1305
#, c-format
msgid "cannot use function `%s' as variable name"
msgstr "関数 `%s' ã¯å¤‰æ•°åã¨ã—ã¦ä½¿ç”¨å‡ºæ¥ã¾ã›ã‚“"
-#: main.c:1265
+#: main.c:1358
msgid "floating point exception"
msgstr "浮動å°æ•°ç‚¹ä¾‹å¤–"
-#: main.c:1272
+#: main.c:1365
msgid "fatal error: internal error"
msgstr "致命的エラー: 内部エラー"
-#: main.c:1287
+#: main.c:1380
msgid "fatal error: internal error: segfault"
msgstr "致命的エラー: 内部エラー: セグメンテーションé•å"
-#: main.c:1299
+#: main.c:1392
msgid "fatal error: internal error: stack overflow"
msgstr "致命的エラー: 内部エラー: スタックオーãƒãƒ¼ãƒ•ãƒ­ãƒ¼"
-#: main.c:1349
+#: main.c:1448
#, c-format
msgid "no pre-opened fd %d"
msgstr "fd %d ãŒäº‹å‰ã«é–‹ã„ã¦ã„ã¾ã›ã‚“。"
-#: main.c:1356
+#: main.c:1455
#, c-format
msgid "could not pre-open /dev/null for fd %d"
msgstr "事å‰ã« fd %d 用㫠/dev/null ã‚’é–‹ã‘ã¾ã›ã‚“。"
-#: msg.c:63
+#: mpfr.c:563
+#, fuzzy, c-format
+msgid "PREC value `%.*s' is invalid"
+msgstr "BINMODE 値 `%s' ã¯ç„¡åŠ¹ã§ã™ã€‚代ã‚ã‚Šã« 3 を使用ã—ã¾ã™"
+
+#: mpfr.c:621
+#, fuzzy, c-format
+msgid "RNDMODE value `%.*s' is invalid"
+msgstr "BINMODE 値 `%s' ã¯ç„¡åŠ¹ã§ã™ã€‚代ã‚ã‚Šã« 3 を使用ã—ã¾ã™"
+
+#: mpfr.c:711
+#, fuzzy, c-format
+msgid "%s: received non-numeric argument"
+msgstr "cos: éžæ•°å€¤ã®å¼•æ•°ã‚’å—ã‘å–ã‚Šã¾ã—ãŸ"
+
+#: mpfr.c:813
+#, fuzzy
+msgid "compl(%Rg): negative value will give strange results"
+msgstr "compl(%lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™"
+
+#: mpfr.c:817
+#, fuzzy
+msgid "comp(%Rg): fractional value will be truncated"
+msgstr "compl(%lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™"
+
+#: mpfr.c:829
+#, fuzzy, c-format
+msgid "cmpl(%Zd): negative values will give strange results"
+msgstr "compl(%lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™"
+
+#: mpfr.c:856
+#, fuzzy, c-format
+msgid "%s: received non-numeric first argument"
+msgstr "or: éžæ•°å€¤ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–ã‚Šã¾ã—ãŸ"
+
+#: mpfr.c:858
+#, fuzzy, c-format
+msgid "%s: received non-numeric second argument"
+msgstr "or: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–ã‚Šã¾ã—ãŸ"
+
+#: mpfr.c:877
+#, fuzzy
+msgid "%s(%Rg, ..): negative values will give strange results"
+msgstr "or(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™"
+
+#: mpfr.c:882
+#, fuzzy
+msgid "%s(%Rg, ..): fractional values will be truncated"
+msgstr "or(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™"
+
+#: mpfr.c:895
+#, fuzzy, c-format
+msgid "%s(%Zd, ..): negative values will give strange results"
+msgstr "or(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™"
+
+#: mpfr.c:914
+#, fuzzy
+msgid "%s(.., %Rg): negative values will give strange results"
+msgstr "or(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™"
+
+#: mpfr.c:919
+#, fuzzy
+msgid "%s(.., %Rg): fractional values will be truncated"
+msgstr "or(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™"
+
+#: mpfr.c:932
+#, fuzzy, c-format
+msgid "%s(.., %Zd): negative values will give strange results"
+msgstr "or(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™"
+
+#: msg.c:61
#, c-format
msgid "cmd. line:"
msgstr "コマンドライン:"
-#: msg.c:107
-msgid "error: "
-msgstr "エラー: "
-
-#: node.c:406
+#: node.c:436
msgid "backslash at end of string"
msgstr "文字列ã®çµ‚ã‚Šã«ãƒãƒƒã‚¯ã‚¹ãƒ©ãƒƒã‚·ãƒ¥ãŒä½¿ã‚ã‚Œã¦ã„ã¾ã™ã€‚"
-#: node.c:517
+#: node.c:520
#, c-format
msgid "old awk does not support the `\\%c' escape sequence"
msgstr "å¤ã„ awk 㯠`\\%c' エスケープシーケンスをサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
-#: node.c:568
+#: node.c:571
msgid "POSIX does not allow `\\x' escapes"
msgstr "POSIX ã§ã¯ `\\x' エスケープã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
-#: node.c:574
+#: node.c:577
msgid "no hex digits in `\\x' escape sequence"
msgstr "`\\x' エスケープシーケンスã«å六進数ãŒã‚ã‚Šã¾ã›ã‚“"
-#: node.c:596
+#: node.c:599
#, c-format
msgid ""
"hex escape \\x%.*s of %d characters probably not interpreted the way you "
@@ -1963,12 +3168,12 @@ msgstr ""
"å六進エスケープ \\x%.*s (%d 文字) ã¯ãŠãらã予期ã—ãŸã‚ˆã†ã«ã¯è§£é‡ˆã•ã‚Œãªã„ã§"
"ã—ょã†"
-#: node.c:611
+#: node.c:614
#, c-format
msgid "escape sequence `\\%c' treated as plain `%c'"
msgstr "エスケープシーケンス `\\%c' 㯠`%c' ã¨åŒç­‰ã«æ‰±ã‚ã‚Œã¾ã™"
-#: node.c:750
+#: node.c:759
msgid ""
"Invalid multibyte data detected. There may be a mismatch between your data "
"and your locale."
@@ -1976,26 +3181,26 @@ msgstr ""
"無効ãªãƒžãƒ«ãƒãƒã‚¤ãƒˆãƒ‡ãƒ¼ã‚¿ãŒæ¤œå‡ºã•ã‚Œã¾ã—ãŸã€‚データã¨ãƒ­ã‚±ãƒ¼ãƒ«ãŒä¸€è‡´ã—ã¦ã„ãªã„よ"
"ã†ã§ã™ã€‚"
-#: posix/gawkmisc.c:176
+#: posix/gawkmisc.c:177
#, c-format
msgid "%s %s `%s': could not get fd flags: (fcntl F_GETFD: %s)"
msgstr "%s %s `%s': fd フラグをå–å¾—ã§ãã¾ã›ã‚“: (fcntl F_GETFD: %s)"
-#: posix/gawkmisc.c:188
+#: posix/gawkmisc.c:189
#, c-format
msgid "%s %s `%s': could not set close-on-exec: (fcntl F_SETFD: %s)"
msgstr "%s %s `%s': close-on-exec を設定ã§ãã¾ã›ã‚“: (fcntl F_SETFD: %s)"
-#: profile.c:83
+#: profile.c:70
#, c-format
msgid "could not open `%s' for writing: %s"
msgstr "`%s' を書込ã¿ç”¨ã«é–‹ã‘ã¾ã›ã‚“ã§ã—ãŸ: %s"
-#: profile.c:85
+#: profile.c:72
msgid "sending profile to standard error"
msgstr "プロファイルを標準エラーã«é€ã£ã¦ã„ã¾ã™"
-#: profile.c:203
+#: profile.c:188
#, c-format
msgid ""
"\t# %s block(s)\n"
@@ -2004,7 +3209,7 @@ msgstr ""
"\t# %s ブロック\n"
"\n"
-#: profile.c:208
+#: profile.c:193
#, c-format
msgid ""
"\t# Rule(s)\n"
@@ -2013,17 +3218,22 @@ msgstr ""
"\t# ルール\n"
"\n"
-#: profile.c:279
+#: profile.c:267
#, c-format
msgid "internal error: %s with null vname"
msgstr "内部エラー: %s ã® vname ãŒç„¡åŠ¹ã§ã™ã€‚"
-#: profile.c:952
+#: profile.c:529
+#, fuzzy
+msgid "internal error: builtin with null fname"
+msgstr "内部エラー: %s ã® vname ãŒç„¡åŠ¹ã§ã™ã€‚"
+
+#: profile.c:944
#, c-format
msgid "\t# gawk profile, created %s\n"
msgstr "\t# gawk プロファイルã€ä½œæˆæ—¥æ™‚ %s\n"
-#: profile.c:1331
+#: profile.c:1329
#, c-format
msgid ""
"\n"
@@ -2032,17 +3242,17 @@ msgstr ""
"\n"
"\t# 関数一覧(アルファベット順)\n"
-#: profile.c:1370
+#: profile.c:1367
#, c-format
msgid "redir2str: unknown redirection type %d"
msgstr "redir2str: ä¸æ˜Žãªãƒªãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆåž‹ %d ã§ã™"
-#: re.c:573
+#: re.c:568
#, fuzzy, c-format
msgid "range of the form `[%c-%c]' is locale dependent"
msgstr "`[%c-%c]' å½¢å¼ã®ç¯„囲ã¯ãƒ­ã‚±ãƒ¼ãƒ«ä¾å­˜ã§ã™"
-#: re.c:600
+#: re.c:595
#, c-format
msgid "regexp component `%.*s' should probably be `[%.*s]'"
msgstr "æ­£è¦è¡¨ç¾ã®è¦ç´  `%.*s' ã¯ãŠãらã `[%.*s]' ã§ã‚ã‚‹ã¹ãã§ã™"
@@ -2087,10 +3297,6 @@ msgstr "( ã¾ãŸã¯ \\( ãŒä¸ä¸€è‡´ã§ã™"
msgid "Unmatched \\{"
msgstr "\\{ ãŒä¸ä¸€è‡´ã§ã™"
-#: regcomp.c:161
-msgid "Invalid content of \\{\\}"
-msgstr "\\{\\} ã®ä¸­èº«ãŒç„¡åŠ¹ã§ã™"
-
#: regcomp.c:164
msgid "Invalid range end"
msgstr "無効ãªç¯„囲終了ã§ã™"
@@ -2107,10 +3313,6 @@ msgstr "無効ãªå‰æ–¹æ­£è¦è¡¨ç¾ã§ã™"
msgid "Premature end of regular expression"
msgstr "æ­£è¦è¡¨ç¾ãŒé€”中ã§çµ‚了ã—ã¾ã—ãŸ"
-#: regcomp.c:176
-msgid "Regular expression too big"
-msgstr "æ­£è¦è¡¨ç¾ãŒå¤§ãã™ãŽã¾ã™"
-
#: regcomp.c:179
msgid "Unmatched ) or \\)"
msgstr ") ã¾ãŸã¯ \\) ãŒä¸ä¸€è‡´ã§ã™"
@@ -2119,12 +3321,101 @@ msgstr ") ã¾ãŸã¯ \\) ãŒä¸ä¸€è‡´ã§ã™"
msgid "No previous regular expression"
msgstr "以å‰ã«æ­£è¦è¡¨ç¾ãŒã‚ã‚Šã¾ã›ã‚“"
+#: symbol.c:722
+msgid "can not pop main context"
+msgstr ""
+
#~ msgid "`nextfile' is a gawk extension"
#~ msgstr "`nextfile' 㯠gawk æ‹¡å¼µã§ã™"
#~ msgid "`delete array' is a gawk extension"
#~ msgstr "`delete array' 㯠gawk æ‹¡å¼µã§ã™"
+#~ msgid "and: received non-numeric first argument"
+#~ msgstr "and: éžæ•°å€¤ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–ã‚Šã¾ã—ãŸ"
+
+#~ msgid "and: received non-numeric second argument"
+#~ msgstr "and: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–ã‚Šã¾ã—ãŸ"
+
+#~ msgid "and(%lf, %lf): fractional values will be truncated"
+#~ msgstr "and(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™"
+
+#~ msgid "xor: received non-numeric first argument"
+#~ msgstr "xor: éžæ•°å€¤ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–ã‚Šã¾ã—ãŸ"
+
+#~ msgid "xor: received non-numeric second argument"
+#~ msgstr "xor: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–ã‚Šã¾ã—ãŸ"
+
+#~ msgid "xor(%lf, %lf): fractional values will be truncated"
+#~ msgstr "xor(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™"
+
+#~ msgid "`extension' is a gawk extension"
+#~ msgstr "`extension' 㯠gawk æ‹¡å¼µã§ã™"
+
+#~ msgid "Operation Not Supported"
+#~ msgstr "ã“ã®æ“作ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
+
+#~ msgid "attempt to use function `%s' as an array"
+#~ msgstr "関数 `%s' ã‚’é…列ã¨ã—ã¦ä½¿ç”¨ã™ã‚‹è©¦ã¿ã§ã™"
+
+#~ msgid "reference to uninitialized element `%s[\"%.*s\"]'"
+#~ msgstr "åˆæœŸåŒ–ã•ã‚Œã¦ã„ãªã„è¦ç´  `%s[\"%.*s\"]' ã¸ã®å‚ç…§ã§ã™"
+
+#~ msgid "subscript of array `%s' is null string"
+#~ msgstr "é…列 `%s' ã®æ·»å­—㌠NULL 文字列ã§ã™"
+
+#~ msgid "%s: empty (null)\n"
+#~ msgstr "%s: 空 (null)\n"
+
+#~ msgid "%s: empty (zero)\n"
+#~ msgstr "%s: 空 (zero)\n"
+
+#~ msgid "%s: table_size = %d, array_size = %d\n"
+#~ msgstr ""
+#~ "%s: テーブルサイズ (table_size) = %d, é…列サイズ (array_size) = %d\n"
+
+#~ msgid "%s: array_ref to %s\n"
+#~ msgstr "%s: %s ã¸ã®é…列å‚ç…§ (array_ref) ã§ã™\n"
+
+#~ msgid "use of non-array as array"
+#~ msgstr "é…列ã§ãªã„ã‚‚ã®ã‚’é…列ã¨ã—ã¦ä½¿ç”¨ã—ã¦ã„ã¾ã™"
+
+#~ msgid "can't use function name `%s' as variable or array"
+#~ msgstr "関数å `%s' ã¯å¤‰æ•°ã¾ãŸã¯é…列ã¨ã—ã¦ä½¿ç”¨å‡ºæ¥ã¾ã›ã‚“"
+
+#~ msgid "assignment used in conditional context"
+#~ msgstr "æ¡ä»¶ã‚³ãƒ³ãƒ†ã‚­ã‚¹ãƒˆå†…ã§ä»£å…¥ãŒä½¿ç”¨ã•ã‚Œã¾ã—ãŸ"
+
+#~ msgid "statement has no effect"
+#~ msgstr "æ–‡ã«åŠ¹æžœãŒã‚ã‚Šã¾ã›ã‚“"
+
+#~ msgid ""
+#~ "for loop: array `%s' changed size from %ld to %ld during loop execution"
+#~ msgstr ""
+#~ "for ループ: ループ実行中ã«é…列 `%s' ã®ã‚µã‚¤ã‚ºãŒ %ld ã‹ã‚‰ %ld ã¸å¤‰æ›´ã•ã‚Œã¾ã—"
+#~ "ãŸ"
+
+#~ msgid "function called indirectly through `%s' does not exist"
+#~ msgstr "`%s' を通ã—ã¦é–“接的ã«å‘¼ã³å‡ºã•ã‚ŒãŸé–¢æ•°ãŒå­˜åœ¨ã—ã¾ã›ã‚“"
+
+#~ msgid "function `%s' not defined"
+#~ msgstr "関数 `%s' ã¯å®šç¾©ã•ã‚Œã¦ã„ã¾ã›ã‚“"
+
+#~ msgid "non-redirected `getline' invalid inside `%s' rule"
+#~ msgstr "`%s' ルールã®å†…å´ã§ã¯ãƒªãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆã•ã‚Œã¦ã„ãªã„ `getline' ã¯ç„¡åŠ¹ã§ã™"
+
+#~ msgid "`nextfile' cannot be called from a `%s' rule"
+#~ msgstr "`nextfile' 㯠`%s' ルールã‹ã‚‰å‘¼ã³å‡ºã™ã“ã¨ãŒå‡ºæ¥ã¾ã›ã‚“"
+
+#~ msgid "`next' cannot be called from a `%s' rule"
+#~ msgstr "`next' 㯠`%s' ã‹ã‚‰å‘¼ã³å‡ºã™ã“ã¨ãŒå‡ºæ¥ã¾ã›ã‚“"
+
+#~ msgid "Sorry, don't know how to interpret `%s'"
+#~ msgstr "申ã—訳ã‚ã‚Šã¾ã›ã‚“㌠`%s' ã‚’ã©ã®ã‚ˆã†ã«è§£é‡ˆã™ã‚‹ã‹åˆ†ã‹ã‚Šã¾ã›ã‚“"
+
+#~ msgid "\t-R file\t\t\t--command=file\n"
+#~ msgstr "\t-R file\t\t\t--command=file\n"
+
#~ msgid "could not find groups: %s"
#~ msgstr "グループãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“: %s"
diff --git a/po/nl.gmo b/po/nl.gmo
index 4ac951a5..24e13c0c 100644
--- a/po/nl.gmo
+++ b/po/nl.gmo
Binary files differ
diff --git a/po/nl.po b/po/nl.po
index bb2c5558..a1ce5b40 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gawk 4.0.0h\n"
"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
-"POT-Creation-Date: 2012-10-13 20:24+0200\n"
+"POT-Creation-Date: 2012-10-13 21:21+0200\n"
"PO-Revision-Date: 2012-01-30 20:40+0100\n"
"Last-Translator: Benno Schulenberg <benno@vertaalt.nl>\n"
"Language-Team: Dutch <vertaling@vrijschrift.org>\n"
@@ -21,497 +21,488 @@ msgstr ""
"X-Generator: Lokalize 1.0\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: array.c:140
+#: array.c:266
#, c-format
msgid "from %s"
msgstr "van %s"
-#: array.c:248
+#: array.c:366
msgid "attempt to use a scalar value as array"
msgstr "scalaire waarde wordt gebruikt als array"
-#: array.c:251
-#, c-format
-msgid "attempt to use function `%s' as an array"
-msgstr "functie '%s' wordt gebruikt als array"
-
-#: array.c:254
+#: array.c:368
#, c-format
msgid "attempt to use scalar parameter `%s' as an array"
msgstr "scalaire parameter '%s' wordt gebruikt als array"
-#: array.c:257
+#: array.c:371
#, c-format
msgid "attempt to use scalar `%s' as an array"
msgstr "scalair '%s' wordt gebruikt als array"
-#: array.c:302 array.c:707 builtin.c:84 builtin.c:1385 builtin.c:1427
-#: builtin.c:1440 builtin.c:1859 builtin.c:1871 eval.c:1135 eval.c:1139
-#: eval.c:1495 eval.c:1812
+#: array.c:418 array.c:584 builtin.c:85 builtin.c:1566 builtin.c:1608
+#: builtin.c:1621 builtin.c:2047 builtin.c:2059 eval.c:1121 eval.c:1125
+#: eval.c:1520
#, c-format
msgid "attempt to use array `%s' in a scalar context"
msgstr "array '%s' wordt gebruikt in een scalaire context"
-#: array.c:513
-#, c-format
-msgid "reference to uninitialized element `%s[\"%.*s\"]'"
-msgstr "verwijzing naar ongeïnitialiseerd element '%s[\"%.*s\"]'"
-
-#: array.c:519
-#, c-format
-msgid "subscript of array `%s' is null string"
-msgstr "index van array '%s' is lege string"
-
-#: array.c:723
+#: array.c:591
#, c-format
msgid "delete: index `%s' not in array `%s'"
msgstr "delete: index '%s' niet in array '%s'"
-#: array.c:734 eval.c:1865
+#: array.c:605
#, c-format
msgid "attempt to use scalar `%s[\"%.*s\"]' as an array"
msgstr "scalair '%s[\"%.*s\"]' wordt gebruikt als array"
-#: array.c:910
-#, c-format
-msgid "%s: empty (null)\n"
-msgstr "%s: leeg (nil)\n"
-
-#: array.c:915
-#, c-format
-msgid "%s: empty (zero)\n"
-msgstr "%s: leeg (nul)\n"
-
-#: array.c:919
-#, c-format
-msgid "%s: table_size = %d, array_size = %d\n"
-msgstr "%s: tabelgrootte = %d, arraygrootte = %d\n"
-
-#: array.c:954
-#, c-format
-msgid "%s: is parameter\n"
-msgstr "%s: is een parameter\n"
-
-#: array.c:958
-#, c-format
-msgid "%s: array_ref to %s\n"
-msgstr "%s: array-verwijzing naar %s\n"
-
-#: array.c:963
-msgid "adump: argument not an array"
+#: array.c:784
+#, fuzzy
+msgid "adump: first argument not an array"
msgstr "adump: argument is geen array"
-#: array.c:1086
+#: array.c:823
msgid "asort: second argument not an array"
msgstr "asort: tweede argument is geen array"
-#: array.c:1087
+#: array.c:824
msgid "asorti: second argument not an array"
msgstr "asorti: tweede argument is geen array"
-#: array.c:1094
+#: array.c:831
msgid "asort: first argument not an array"
msgstr "asort: eerste argument is geen array"
-#: array.c:1095
+#: array.c:832
msgid "asorti: first argument not an array"
msgstr "asorti: eerste argument is geen array"
-#: array.c:1102
+#: array.c:839
msgid "asort: cannot use a subarray of first arg for second arg"
msgstr ""
"asort: een subarray van het eerste argument kan niet als tweede argument "
"gebruikt worden"
-#: array.c:1103
+#: array.c:840
msgid "asorti: cannot use a subarray of first arg for second arg"
msgstr ""
"asorti: een subarray van het eerste argument kan niet als tweede argument "
"gebruikt worden"
-#: array.c:1108
+#: array.c:845
msgid "asort: cannot use a subarray of second arg for first arg"
msgstr ""
"asort: een subarray van het tweede argument kan niet als eerste argument "
"gebruikt worden"
-#: array.c:1109
+#: array.c:846
msgid "asorti: cannot use a subarray of second arg for first arg"
msgstr ""
"asorti: een subarray van het tweede argument kan niet als eerste argument "
"gebruikt worden"
-#: array.c:1655
+#: array.c:1314
#, c-format
msgid "`%s' is invalid as a function name"
msgstr "'%s' is ongeldig als functienaam"
-#: array.c:1659
+#: array.c:1318
#, c-format
msgid "sort comparison function `%s' is not defined"
msgstr "sorteervergelijkingsfunctie '%s' is niet gedefinieerd"
-#: awkgram.y:249
+#: awkgram.y:223
#, c-format
msgid "%s blocks must have an action part"
msgstr "%s-blokken horen een actiedeel te hebben"
-#: awkgram.y:252
+#: awkgram.y:226
msgid "each rule must have a pattern or an action part"
msgstr "elke regel hoort een patroon of een actiedeel te hebben"
-#: awkgram.y:323 awkgram.y:334
+#: awkgram.y:315 awkgram.y:326
msgid "old awk does not support multiple `BEGIN' or `END' rules"
msgstr "oude 'awk' staat meerdere 'BEGIN'- en 'END'-regels niet toe"
-#: awkgram.y:371
+#: awkgram.y:363
#, c-format
msgid "`%s' is a built-in function, it cannot be redefined"
msgstr "'%s' is een ingebouwde functie en is niet te herdefiniëren"
-#: awkgram.y:432
+#: awkgram.y:409
msgid "regexp constant `//' looks like a C++ comment, but is not"
msgstr "regexp-constante '//' lijkt op C-commentaar, maar is het niet"
-#: awkgram.y:436
+#: awkgram.y:413
#, c-format
msgid "regexp constant `/%s/' looks like a C comment, but is not"
msgstr "regexp-constante '/%s/' lijkt op C-commentaar, maar is het niet"
-#: awkgram.y:528
+#: awkgram.y:505
#, c-format
msgid "duplicate case values in switch body: %s"
msgstr "dubbele 'case'-waarde in 'switch'-opdracht: %s"
-#: awkgram.y:549
+#: awkgram.y:526
msgid "duplicate `default' detected in switch body"
msgstr "dubbele 'default' in 'switch'-opdracht"
-#: awkgram.y:809
+#: awkgram.y:786
msgid "`break' is not allowed outside a loop or switch"
msgstr "'break' buiten een lus of 'switch'-opdracht is niet toegestaan"
-#: awkgram.y:818
+#: awkgram.y:795
msgid "`continue' is not allowed outside a loop"
msgstr "'continue' buiten een lus is niet toegestaan"
-#: awkgram.y:828
+#: awkgram.y:805
#, c-format
msgid "`next' used in %s action"
msgstr "'next' wordt gebruikt in %s-actie"
-#: awkgram.y:837
+#: awkgram.y:814
#, c-format
msgid "`nextfile' used in %s action"
msgstr "'nextfile' wordt gebruikt in %s-actie"
-#: awkgram.y:861
+#: awkgram.y:838
msgid "`return' used outside function context"
msgstr "'return' wordt gebruikt buiten functiecontext"
-#: awkgram.y:921
+#: awkgram.y:912
msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'"
msgstr ""
"kale 'print' in BEGIN- of END-regel moet vermoedelijk 'print \"\"' zijn"
-#: awkgram.y:1016 awkgram.y:1020
+#: awkgram.y:978 awkgram.y:1027
+msgid "`delete' is not allowed with SYMTAB"
+msgstr ""
+
+#: awkgram.y:980 awkgram.y:1029
+msgid "`delete' is not allowed with FUNCTAB"
+msgstr ""
+
+#: awkgram.y:1014 awkgram.y:1018
msgid "`delete(array)' is a non-portable tawk extension"
msgstr "'delete(array)' is een niet-overdraagbare 'tawk'-uitbreiding"
-#: awkgram.y:1132
+#: awkgram.y:1139
msgid "multistage two-way pipelines don't work"
msgstr "meerfase-tweerichtings-pijplijnen werken niet"
-#: awkgram.y:1235
+#: awkgram.y:1242
msgid "regular expression on right of assignment"
msgstr "reguliere expressie rechts van toewijzing"
-#: awkgram.y:1246
+#: awkgram.y:1253
msgid "regular expression on left of `~' or `!~' operator"
msgstr "reguliere expressie links van operator '~' of '!~'"
-#: awkgram.y:1262 awkgram.y:1416
+#: awkgram.y:1269 awkgram.y:1420
msgid "old awk does not support the keyword `in' except after `for'"
msgstr "oude 'awk' kent het sleutelwoord 'in' niet, behalve na 'for'"
-#: awkgram.y:1272
+#: awkgram.y:1279
msgid "regular expression on right of comparison"
msgstr "reguliere expressie rechts van vergelijking"
-#: awkgram.y:1391
+#: awkgram.y:1395
#, c-format
msgid "`getline var' invalid inside `%s' rule"
msgstr "'getline var' is ongeldig binnen een '%s'-regel"
-#: awkgram.y:1394 eval.c:2504
+#: awkgram.y:1398
#, c-format
msgid "`getline' invalid inside `%s' rule"
msgstr "'getline' is ongeldig binnen een '%s'-regel"
-#: awkgram.y:1399
+#: awkgram.y:1403
msgid "non-redirected `getline' undefined inside END action"
msgstr "niet-omgeleide 'getline' is ongedefinieerd binnen een END-actie"
-#: awkgram.y:1418
+#: awkgram.y:1422
msgid "old awk does not support multidimensional arrays"
msgstr "oude 'awk' kent geen meerdimensionale arrays"
-#: awkgram.y:1514
+#: awkgram.y:1519
msgid "call of `length' without parentheses is not portable"
msgstr "aanroep van 'length' zonder haakjes is niet overdraagbaar"
-#: awkgram.y:1577
+#: awkgram.y:1585
msgid "indirect function calls are a gawk extension"
msgstr "indirecte functieaanroepen zijn een gawk-uitbreiding"
-#: awkgram.y:1590
+#: awkgram.y:1598
#, c-format
msgid "can not use special variable `%s' for indirect function call"
msgstr ""
"kan speciale variabele '%s' niet voor indirecte functieaanroep gebruiken"
-#: awkgram.y:1668
+#: awkgram.y:1676
msgid "invalid subscript expression"
msgstr "ongeldige index-expressie"
-#: awkgram.y:1708
-msgid "use of non-array as array"
-msgstr "non-array wordt gebruikt als array"
-
-#: awkgram.y:1972 awkgram.y:1992 msg.c:98
+#: awkgram.y:2000 awkgram.y:2020 gawkapi.c:203 gawkapi.c:221 msg.c:119
msgid "warning: "
msgstr "waarschuwing: "
-#: awkgram.y:1990 msg.c:130
+#: awkgram.y:2018 gawkapi.c:189 gawkapi.c:218 msg.c:151
msgid "fatal: "
msgstr "fataal: "
-#: awkgram.y:2040
+#: awkgram.y:2068
msgid "unexpected newline or end of string"
msgstr "onverwacht regeleinde of einde van string"
-#: awkgram.y:2297 awkgram.y:2355 awkgram.y:2539
+#: awkgram.y:2335 awkgram.y:2411 awkgram.y:2634 debug.c:517 debug.c:533
+#: debug.c:2790 debug.c:5038
#, c-format
msgid "can't open source file `%s' for reading (%s)"
msgstr "kan bronbestand '%s' niet openen om te lezen (%s)"
-#: awkgram.y:2298 awkgram.y:2356 builtin.c:122
+#: awkgram.y:2336 awkgram.y:2461
+#, fuzzy, c-format
+msgid "can't open shared library `%s' for reading (%s)"
+msgstr "kan bronbestand '%s' niet openen om te lezen (%s)"
+
+#: awkgram.y:2338 awkgram.y:2412 awkgram.y:2462 builtin.c:130 debug.c:5189
msgid "reason unknown"
msgstr "reden onbekend"
-#: awkgram.y:2314
+#: awkgram.y:2347 awkgram.y:2371
+#, c-format
+msgid "can't include `%s' and use it as a program file"
+msgstr ""
+
+#: awkgram.y:2360
#, c-format
msgid "already included source file `%s'"
msgstr "bronbestand '%s' is reeds ingesloten"
-#: awkgram.y:2340
+#: awkgram.y:2361
+#, fuzzy, c-format
+msgid "already loaded shared library `%s'"
+msgstr "bronbestand '%s' is reeds ingesloten"
+
+#: awkgram.y:2396
msgid "@include is a gawk extension"
msgstr "'@include' is een gawk-uitbreiding"
-#: awkgram.y:2346
+#: awkgram.y:2402
msgid "empty filename after @include"
msgstr "lege bestandsnaam na '@include'"
-#: awkgram.y:2491
+#: awkgram.y:2446
+#, fuzzy
+msgid "@load is a gawk extension"
+msgstr "'@include' is een gawk-uitbreiding"
+
+#: awkgram.y:2452
+#, fuzzy
+msgid "empty filename after @load"
+msgstr "lege bestandsnaam na '@include'"
+
+#: awkgram.y:2586
msgid "empty program text on command line"
msgstr "lege programmatekst op commandoregel"
-#: awkgram.y:2606
+#: awkgram.y:2701
#, c-format
msgid "can't read sourcefile `%s' (%s)"
msgstr "kan bronbestand '%s' niet lezen (%s)"
-#: awkgram.y:2617
+#: awkgram.y:2712
#, c-format
msgid "source file `%s' is empty"
msgstr "bronbestand '%s' is leeg"
-#: awkgram.y:2794
+#: awkgram.y:2889
msgid "source file does not end in newline"
msgstr "bronbestand eindigt niet met een regeleindeteken (LF)"
-#: awkgram.y:2897
+#: awkgram.y:2994
msgid "unterminated regexp ends with `\\' at end of file"
msgstr "onafgesloten reguliere expressie eindigt met '\\' aan bestandseinde"
-#: awkgram.y:2921
+#: awkgram.y:3018
#, c-format
msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk"
msgstr "%s: %d: regexp-optie '/.../%c' van 'tawk' werkt niet in gawk"
-#: awkgram.y:2925
+#: awkgram.y:3022
#, c-format
msgid "tawk regex modifier `/.../%c' doesn't work in gawk"
msgstr "regexp-optie '/.../%c' van 'tawk' werkt niet in gawk"
-#: awkgram.y:2932
+#: awkgram.y:3029
msgid "unterminated regexp"
msgstr "onafgesloten reguliere expressie"
-#: awkgram.y:2936
+#: awkgram.y:3033
msgid "unterminated regexp at end of file"
msgstr "onafgesloten reguliere expressie aan bestandseinde"
-#: awkgram.y:2995
+#: awkgram.y:3092
msgid "use of `\\ #...' line continuation is not portable"
msgstr "gebruik van regelvoortzetting '\\ #...' is niet overdraagbaar"
-#: awkgram.y:3011
+#: awkgram.y:3108
msgid "backslash not last character on line"
msgstr "backslash is niet het laatste teken op de regel"
-#: awkgram.y:3072
+#: awkgram.y:3169
msgid "POSIX does not allow operator `**='"
msgstr "POSIX staat operator '**=' niet toe"
-#: awkgram.y:3074
+#: awkgram.y:3171
msgid "old awk does not support operator `**='"
msgstr "oude 'awk' kent de operator '**=' niet"
-#: awkgram.y:3083
+#: awkgram.y:3180
msgid "POSIX does not allow operator `**'"
msgstr "POSIX staat operator '**' niet toe"
-#: awkgram.y:3085
+#: awkgram.y:3182
msgid "old awk does not support operator `**'"
msgstr "oude 'awk' kent de operator '**' niet"
-#: awkgram.y:3120
+#: awkgram.y:3217
msgid "operator `^=' is not supported in old awk"
msgstr "oude 'awk' kent de operator '^=' niet"
-#: awkgram.y:3128
+#: awkgram.y:3225
msgid "operator `^' is not supported in old awk"
msgstr "oude 'awk' kent de operator '^' niet"
-#: awkgram.y:3221 awkgram.y:3237
+#: awkgram.y:3318 awkgram.y:3334 command.y:1178
msgid "unterminated string"
msgstr "onafgesloten string"
-#: awkgram.y:3433
+#: awkgram.y:3555
#, c-format
msgid "invalid char '%c' in expression"
msgstr "ongeldig teken '%c' in expressie"
-#: awkgram.y:3480
+#: awkgram.y:3602
#, c-format
msgid "`%s' is a gawk extension"
msgstr "'%s' is een gawk-uitbreiding"
-#: awkgram.y:3485
+#: awkgram.y:3607
#, c-format
msgid "`%s' is a Bell Labs extension"
msgstr "'%s' is een uitbreiding door Bell Labs"
-#: awkgram.y:3490
+#: awkgram.y:3612
#, c-format
msgid "POSIX does not allow `%s'"
msgstr "POSIX staat '%s' niet toe"
-#: awkgram.y:3498
+#: awkgram.y:3620
#, c-format
msgid "`%s' is not supported in old awk"
msgstr "oude 'awk' kent '%s' niet"
-#: awkgram.y:3565
+#: awkgram.y:3688
msgid "`goto' considered harmful!\n"
msgstr "'goto' wordt als schadelijk beschouwd!\n"
-#: awkgram.y:3616
+#: awkgram.y:3722
#, c-format
msgid "%d is invalid as number of arguments for %s"
msgstr "%d is een ongeldig aantal argumenten voor %s"
-#: awkgram.y:3651
+#: awkgram.y:3757
#, c-format
msgid "%s: string literal as last arg of substitute has no effect"
msgstr "%s: een stringwaarde als laatste vervangingsargument heeft geen effect"
-#: awkgram.y:3656
+#: awkgram.y:3762
#, c-format
msgid "%s third parameter is not a changeable object"
msgstr "%s: derde parameter is geen veranderbaar object"
-#: awkgram.y:3729 awkgram.y:3732
+#: awkgram.y:3841 awkgram.y:3844
msgid "match: third argument is a gawk extension"
msgstr "match: derde argument is een gawk-uitbreiding"
-#: awkgram.y:3786 awkgram.y:3789
+#: awkgram.y:3898 awkgram.y:3901
msgid "close: second argument is a gawk extension"
msgstr "close: tweede argument is een gawk-uitbreiding"
-#: awkgram.y:3801
+#: awkgram.y:3913
msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
msgstr "dcgettext(_\"...\") is onjuist: verwijder het liggende streepje"
-#: awkgram.y:3816
+#: awkgram.y:3928
msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
msgstr "dcngettext(_\"...\") is onjuist: verwijder het liggende streepje"
-#: awkgram.y:3908
-#, c-format
-msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
-msgstr "functie '%s': parameter #%d, '%s', dupliceert parameter #%d"
-
-#: awkgram.y:3950
+#: awkgram.y:3994
#, c-format
msgid "function `%s': parameter `%s' shadows global variable"
msgstr "functie '%s': parameter '%s' schaduwt een globale variabele"
-#: awkgram.y:4108
+#: awkgram.y:4051 debug.c:4019 debug.c:4062 debug.c:5187
#, c-format
msgid "could not open `%s' for writing (%s)"
msgstr "kan '%s' niet openen om te schrijven (%s)"
-#: awkgram.y:4109
+#: awkgram.y:4052
msgid "sending variable list to standard error"
msgstr "variabelenlijst gaat naar standaardfoutuitvoer"
-#: awkgram.y:4115
+#: awkgram.y:4060
#, c-format
msgid "%s: close failed (%s)"
msgstr "%s: sluiten is mislukt (%s)"
-#: awkgram.y:4167
+#: awkgram.y:4085
msgid "shadow_funcs() called twice!"
msgstr "shadow_funcs() twee keer aangeroepen!"
-#: awkgram.y:4173
+#: awkgram.y:4093
msgid "there were shadowed variables."
msgstr "er waren geschaduwde variabelen."
-#: awkgram.y:4203
+#: awkgram.y:4164
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "functienaam '%s' is al eerder gedefinieerd"
+
+#: awkgram.y:4210
#, c-format
msgid "function `%s': can't use function name as parameter name"
msgstr "functie '%s': kan functienaam niet als parameternaam gebruiken"
-#: awkgram.y:4207
+#: awkgram.y:4213
#, c-format
msgid "function `%s': can't use special variable `%s' as a function parameter"
msgstr ""
"functie '%s': kan speciale variabele '%s' niet als functieparameter gebruiken"
-#: awkgram.y:4223
+#: awkgram.y:4221
#, c-format
-msgid "function name `%s' previously defined"
-msgstr "functienaam '%s' is al eerder gedefinieerd"
+msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
+msgstr "functie '%s': parameter #%d, '%s', dupliceert parameter #%d"
-#: awkgram.y:4391 awkgram.y:4397
+#: awkgram.y:4315 awkgram.y:4319
#, c-format
msgid "function `%s' called but never defined"
msgstr "functie '%s' wordt aangeroepen maar is nergens gedefinieerd"
-#: awkgram.y:4400
+#: awkgram.y:4324
#, c-format
msgid "function `%s' defined but never called directly"
msgstr "functie '%s' is gedefinieerd maar wordt nergens direct aangeroepen"
-#: awkgram.y:4432
+#: awkgram.y:4356
#, c-format
msgid "regexp constant for parameter #%d yields boolean value"
msgstr "regexp-constante als parameter #%d levert booleanwaarde op"
-#: awkgram.y:4541
+#: awkgram.y:4402
#, c-format
msgid ""
"function `%s' called with space between name and `(',\n"
@@ -520,230 +511,230 @@ msgstr ""
"functie '%s' wordt aangeroepen met een spatie tussen naam en '(',\n"
"of wordt gebruikt als variabele of array"
-#: awkgram.y:4788 eval.c:2056
+#: awkgram.y:4618
msgid "division by zero attempted"
msgstr "deling door nul"
-#: awkgram.y:4797 eval.c:2072
+#: awkgram.y:4627
#, c-format
msgid "division by zero attempted in `%%'"
msgstr "deling door nul in '%%'"
-#: builtin.c:120
+#: builtin.c:128
#, c-format
msgid "%s to \"%s\" failed (%s)"
msgstr "%s naar \"%s\" is mislukt (%s)"
-#: builtin.c:121
+#: builtin.c:129
msgid "standard output"
msgstr "standaarduitvoer"
-#: builtin.c:135
+#: builtin.c:143
msgid "exp: received non-numeric argument"
msgstr "exp: argument is geen getal"
-#: builtin.c:141
+#: builtin.c:149
#, c-format
msgid "exp: argument %g is out of range"
msgstr "exp: argument %g ligt buiten toegestane bereik"
-#: builtin.c:200
+#: builtin.c:208
#, c-format
msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing"
msgstr ""
"fflush: kan pijp niet leegmaken: '%s' is geopend om te lezen, niet om te "
"schrijven"
-#: builtin.c:203
+#: builtin.c:211
#, c-format
msgid "fflush: cannot flush: file `%s' opened for reading, not writing"
msgstr ""
"fflush: kan bestand niet leegmaken: '%s' is geopend om te lezen, niet om te "
"schrijven"
-#: builtin.c:215
+#: builtin.c:223
#, c-format
msgid "fflush: `%s' is not an open file, pipe or co-process"
msgstr "fflush: '%s' is geen open bestand, pijp, of co-proces"
-#: builtin.c:333
+#: builtin.c:341
msgid "index: received non-string first argument"
msgstr "index: eerste argument is geen string"
-#: builtin.c:335
+#: builtin.c:343
msgid "index: received non-string second argument"
msgstr "index: tweede argument is geen string"
-#: builtin.c:457
+#: builtin.c:467 mpfr.c:770
msgid "int: received non-numeric argument"
msgstr "int: argument is geen getal"
-#: builtin.c:493
+#: builtin.c:503
msgid "length: received array argument"
msgstr "length: argument is een array"
-#: builtin.c:496
+#: builtin.c:506
msgid "`length(array)' is a gawk extension"
msgstr "'length(array)' is een gawk-uitbreiding"
-#: builtin.c:504
+#: builtin.c:514
msgid "length: received non-string argument"
msgstr "length: argument is geen string"
-#: builtin.c:535
+#: builtin.c:545
msgid "log: received non-numeric argument"
msgstr "log: argument is geen getal"
-#: builtin.c:538
+#: builtin.c:548
#, c-format
msgid "log: received negative argument %g"
msgstr "log: argument %g is negatief"
-#: builtin.c:694 builtin.c:699
+#: builtin.c:746 builtin.c:751
msgid "fatal: must use `count$' on all formats or none"
msgstr "fataal: 'count$' hoort in alle opmaken gebruikt te worden, of in geen"
-#: builtin.c:762
+#: builtin.c:821
#, c-format
msgid "field width is ignored for `%%' specifier"
msgstr "veldbreedte wordt genegeerd voor opmaakaanduiding '%%'"
-#: builtin.c:764
+#: builtin.c:823
#, c-format
msgid "precision is ignored for `%%' specifier"
msgstr "veldprecisie wordt genegeerd voor opmaakaanduiding '%%'"
-#: builtin.c:766
+#: builtin.c:825
#, c-format
msgid "field width and precision are ignored for `%%' specifier"
msgstr "veldbreedte en -precisie worden genegeerd voor opmaakaanduiding '%%'"
-#: builtin.c:817
+#: builtin.c:876
msgid "fatal: `$' is not permitted in awk formats"
msgstr "fataal: '$' is niet toegestaan in awk-opmaak"
-#: builtin.c:826
+#: builtin.c:885
msgid "fatal: arg count with `$' must be > 0"
msgstr "fataal: het aantal argumenten met '$' moet > 0 zijn"
-#: builtin.c:830
+#: builtin.c:889
#, c-format
msgid "fatal: arg count %ld greater than total number of supplied arguments"
msgstr "fataal: argumentental %ld is groter dan het gegeven aantal argumenten"
-#: builtin.c:834
+#: builtin.c:893
msgid "fatal: `$' not permitted after period in format"
msgstr "fataal: '$' is niet toegestaan na een punt in de opmaak"
-#: builtin.c:850
+#: builtin.c:909
msgid "fatal: no `$' supplied for positional field width or precision"
msgstr "fataal: geen '$' opgegeven bij positionele veldbreedte of -precisie"
-#: builtin.c:921
+#: builtin.c:981
msgid "`l' is meaningless in awk formats; ignored"
msgstr "'l' is betekenisloos in awk-opmaak; genegeerd"
-#: builtin.c:925
+#: builtin.c:985
msgid "fatal: `l' is not permitted in POSIX awk formats"
msgstr "fataal: 'l' is niet toegestaan in POSIX awk-opmaak"
-#: builtin.c:938
+#: builtin.c:998
msgid "`L' is meaningless in awk formats; ignored"
msgstr "'L' is betekenisloos in awk-opmaak; genegeerd"
-#: builtin.c:942
+#: builtin.c:1002
msgid "fatal: `L' is not permitted in POSIX awk formats"
msgstr "fataal: 'L' is niet toegestaan in POSIX awk-opmaak"
-#: builtin.c:955
+#: builtin.c:1015
msgid "`h' is meaningless in awk formats; ignored"
msgstr "'h' is betekenisloos in awk-opmaak; genegeerd"
-#: builtin.c:959
+#: builtin.c:1019
msgid "fatal: `h' is not permitted in POSIX awk formats"
msgstr "fataal: 'h' is niet toegestaan in POSIX awk-opmaak"
-#: builtin.c:1272
+#: builtin.c:1414
#, c-format
msgid "[s]printf: value %g is out of range for `%%%c' format"
msgstr "[s]printf: waarde %g ligt buiten toegestaan bereik voor opmaak '%%%c'"
-#: builtin.c:1332
+#: builtin.c:1512
#, c-format
msgid "ignoring unknown format specifier character `%c': no argument converted"
msgstr ""
"onbekend opmaakteken '%c' wordt genegeerd: geen argument is geconverteerd"
-#: builtin.c:1337
+#: builtin.c:1517
msgid "fatal: not enough arguments to satisfy format string"
msgstr "fataal: niet genoeg argumenten voor opmaakstring"
-#: builtin.c:1339
+#: builtin.c:1519
msgid "^ ran out for this one"
msgstr "niet genoeg ^ voor deze"
-#: builtin.c:1346
+#: builtin.c:1526
msgid "[s]printf: format specifier does not have control letter"
msgstr "[s]printf: opmaakaanduiding mist een stuurletter"
-#: builtin.c:1349
+#: builtin.c:1529
msgid "too many arguments supplied for format string"
msgstr "te veel argumenten voor opmaakstring"
-#: builtin.c:1423 builtin.c:1434
+#: builtin.c:1604 builtin.c:1615
msgid "printf: no arguments"
msgstr "printf: geen argumenten"
-#: builtin.c:1475
+#: builtin.c:1656
msgid "sqrt: received non-numeric argument"
msgstr "sqrt: argument is geen getal"
-#: builtin.c:1479
+#: builtin.c:1660
#, c-format
msgid "sqrt: called with negative argument %g"
msgstr "sqrt: argument %g is negatief"
-#: builtin.c:1503
+#: builtin.c:1691
#, c-format
msgid "substr: length %g is not >= 1"
msgstr "substr: lengte %g is niet >= 1"
-#: builtin.c:1505
+#: builtin.c:1693
#, c-format
msgid "substr: length %g is not >= 0"
msgstr "substr: lengte %g is niet >= 0"
-#: builtin.c:1512
+#: builtin.c:1700
#, c-format
msgid "substr: non-integer length %g will be truncated"
msgstr "substr: lengte %g is geen integer; wordt afgekapt"
-#: builtin.c:1517
+#: builtin.c:1705
#, c-format
msgid "substr: length %g too big for string indexing, truncating to %g"
msgstr ""
"substr: lengte %g is te groot voor stringindexering; wordt verkort tot %g"
-#: builtin.c:1529
+#: builtin.c:1717
#, c-format
msgid "substr: start index %g is invalid, using 1"
msgstr "substr: startindex %g is ongeldig; 1 wordt gebruikt"
-#: builtin.c:1534
+#: builtin.c:1722
#, c-format
msgid "substr: non-integer start index %g will be truncated"
msgstr "substr: startindex %g is geen integer; wordt afgekapt"
-#: builtin.c:1559
+#: builtin.c:1747
msgid "substr: source string is zero length"
msgstr "substr: bronstring heeft lengte nul"
-#: builtin.c:1575
+#: builtin.c:1763
#, c-format
msgid "substr: start index %g is past end of string"
msgstr "substr: startindex %g ligt voorbij het einde van de string"
-#: builtin.c:1583
+#: builtin.c:1771
#, c-format
msgid ""
"substr: length %g at start index %g exceeds length of first argument (%lu)"
@@ -751,227 +742,1084 @@ msgstr ""
"substr: lengte %g bij startindex %g is groter dan de lengte van het eerste "
"argument (%lu)"
-#: builtin.c:1657
+#: builtin.c:1845
msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type"
msgstr "strftime: opmaakwaarde in PROCINFO[\"strftime\"] is numeriek"
-#: builtin.c:1680
+#: builtin.c:1868
msgid "strftime: received non-numeric second argument"
msgstr "strftime: tweede argument is geen getal"
-#: builtin.c:1683
+#: builtin.c:1872
msgid "strftime: second argument less than 0 or too big for time_t"
msgstr "strftime: tweede argument is kleiner dan nul of te groot voor 'time_t'"
-#: builtin.c:1690
+#: builtin.c:1879
msgid "strftime: received non-string first argument"
msgstr "strftime: eerste argument is geen string"
-#: builtin.c:1696
+#: builtin.c:1886
msgid "strftime: received empty format string"
msgstr "strftime: opmaakstring is leeg"
-#: builtin.c:1762
+#: builtin.c:1952
msgid "mktime: received non-string argument"
msgstr "mktime: argument is geen string"
-#: builtin.c:1779
+#: builtin.c:1969
msgid "mktime: at least one of the values is out of the default range"
msgstr "mktime: minstens één van waarden valt buiten het standaardbereik"
-#: builtin.c:1814
+#: builtin.c:2004
msgid "'system' function not allowed in sandbox mode"
msgstr "'system'-functie is niet toegestaan in sandbox-modus"
-#: builtin.c:1819
+#: builtin.c:2009
msgid "system: received non-string argument"
msgstr "system: argument is geen string"
-#: builtin.c:1874 eval.c:1159 eval.c:1790 eval.c:1803
-#, c-format
-msgid "reference to uninitialized variable `%s'"
-msgstr "verwijzing naar ongeïnitialiseerde variabele '%s'"
-
-#: builtin.c:1941
+#: builtin.c:2127
#, c-format
msgid "reference to uninitialized field `$%d'"
msgstr "verwijzing naar ongeïnitialiseerd veld '$%d'"
-#: builtin.c:2028
+#: builtin.c:2214
msgid "tolower: received non-string argument"
msgstr "tolower: argument is geen string"
-#: builtin.c:2062
+#: builtin.c:2248
msgid "toupper: received non-string argument"
msgstr "toupper: argument is geen string"
-#: builtin.c:2098
+#: builtin.c:2284 mpfr.c:685
msgid "atan2: received non-numeric first argument"
msgstr "atan2: eerste argument is geen getal"
-#: builtin.c:2100
+#: builtin.c:2286 mpfr.c:687
msgid "atan2: received non-numeric second argument"
msgstr "atan2: tweede argument is geen getal"
-#: builtin.c:2119
+#: builtin.c:2305
msgid "sin: received non-numeric argument"
msgstr "sin: argument is geen getal"
-#: builtin.c:2135
+#: builtin.c:2321
msgid "cos: received non-numeric argument"
msgstr "cos: argument is geen getal"
-#: builtin.c:2188
+#: builtin.c:2374 mpfr.c:1137
msgid "srand: received non-numeric argument"
msgstr "srand: argument is geen getal"
-#: builtin.c:2219
+#: builtin.c:2405
msgid "match: third argument is not an array"
msgstr "match: derde argument is geen array"
-#: builtin.c:2483
+#: builtin.c:2670
msgid "gensub: third argument of 0 treated as 1"
msgstr "gensub: derde argument is 0; wordt beschouwd als 1"
-#: builtin.c:2776
+#: builtin.c:2963
msgid "lshift: received non-numeric first argument"
msgstr "lshift: eerste argument is geen getal"
-#: builtin.c:2778
+#: builtin.c:2965
msgid "lshift: received non-numeric second argument"
msgstr "lshift: tweede argument is geen getal"
-#: builtin.c:2784
+#: builtin.c:2971
#, fuzzy, c-format
msgid "lshift(%f, %f): negative values will give strange results"
msgstr "lshift(%lf, %lf): negatieve waarden geven rare resultaten"
-#: builtin.c:2786
+#: builtin.c:2973
#, fuzzy, c-format
msgid "lshift(%f, %f): fractional values will be truncated"
msgstr "lshift(%lf, %lf): cijfers na de komma worden afgekapt"
-#: builtin.c:2788
+#: builtin.c:2975
#, fuzzy, c-format
msgid "lshift(%f, %f): too large shift value will give strange results"
msgstr "lshift(%lf, %lf): te grote opschuifwaarden geven rare resultaten"
-#: builtin.c:2813
+#: builtin.c:3000
msgid "rshift: received non-numeric first argument"
msgstr "rshift: eerste argument is geen getal"
-#: builtin.c:2815
+#: builtin.c:3002
msgid "rshift: received non-numeric second argument"
msgstr "rshift: tweede argument is geen getal"
-#: builtin.c:2821
+#: builtin.c:3008
#, fuzzy, c-format
msgid "rshift(%f, %f): negative values will give strange results"
msgstr "rshift(%lf, %lf): negatieve waarden geven rare resultaten"
-#: builtin.c:2823
+#: builtin.c:3010
#, fuzzy, c-format
msgid "rshift(%f, %f): fractional values will be truncated"
msgstr "rshift(%lf, %lf): cijfers na de komma worden afgekapt"
-#: builtin.c:2825
+#: builtin.c:3012
#, fuzzy, c-format
msgid "rshift(%f, %f): too large shift value will give strange results"
msgstr "rshift(%lf, %lf): te grote opschuifwaarden geven rare resultaten"
-#: builtin.c:2850
-msgid "and: received non-numeric first argument"
-msgstr "and: eerste argument is geen getal"
-
-#: builtin.c:2852
-msgid "and: received non-numeric second argument"
-msgstr "and: tweede argument is geen getal"
+#: builtin.c:3037
+#, fuzzy
+msgid "and: called with less than two arguments"
+msgstr "sqrt: argument %g is negatief"
-#: builtin.c:2858
+#: builtin.c:3042
#, fuzzy, c-format
-msgid "and(%f, %f): negative values will give strange results"
-msgstr "and(%lf, %lf): negatieve waarden geven rare resultaten"
+msgid "and: argument %d is non-numeric"
+msgstr "exp: argument %g ligt buiten toegestane bereik"
-#: builtin.c:2860
+#: builtin.c:3046
#, fuzzy, c-format
-msgid "and(%f, %f): fractional values will be truncated"
-msgstr "and(%lf, %lf): cijfers na de komma worden afgekapt"
-
-#: builtin.c:2885
-msgid "or: received non-numeric first argument"
-msgstr "or: eerste argument is geen getal"
+msgid "and: argument %d negative value %g will give strange results"
+msgstr "and(%lf, %lf): negatieve waarden geven rare resultaten"
-#: builtin.c:2887
-msgid "or: received non-numeric second argument"
-msgstr "or: tweede argument is geen getal"
+#: builtin.c:3069
+#, fuzzy
+msgid "or: called with less than two arguments"
+msgstr "sqrt: argument %g is negatief"
-#: builtin.c:2893
+#: builtin.c:3074
#, fuzzy, c-format
-msgid "or(%f, %f): negative values will give strange results"
-msgstr "or(%lf, %lf): negatieve waarden geven rare resultaten"
+msgid "or: argument %d is non-numeric"
+msgstr "exp: argument %g ligt buiten toegestane bereik"
-#: builtin.c:2895
+#: builtin.c:3078
#, fuzzy, c-format
-msgid "or(%f, %f): fractional values will be truncated"
-msgstr "or(%lf, %lf): cijfers na de komma worden afgekapt"
-
-#: builtin.c:2923
-msgid "xor: received non-numeric first argument"
-msgstr "xor: eerste argument is geen getal"
+msgid "or: argument %d negative value %g will give strange results"
+msgstr "compl(%lf): negatieve waarden geven rare resultaten"
-#: builtin.c:2925
-msgid "xor: received non-numeric second argument"
-msgstr "xor: tweede argument is geen getal"
+#: builtin.c:3100
+#, fuzzy
+msgid "xor: called with less than two arguments"
+msgstr "sqrt: argument %g is negatief"
-#: builtin.c:2931
+#: builtin.c:3106
#, fuzzy, c-format
-msgid "xor(%f, %f): negative values will give strange results"
-msgstr "xor(%lf, %lf): negatieve waarden geven rare resultaten"
+msgid "xor: argument %d is non-numeric"
+msgstr "exp: argument %g ligt buiten toegestane bereik"
-#: builtin.c:2933
+#: builtin.c:3110
#, fuzzy, c-format
-msgid "xor(%f, %f): fractional values will be truncated"
-msgstr "xor(%lf, %lf): cijfers na de komma worden afgekapt"
+msgid "xor: argument %d negative value %g will give strange results"
+msgstr "xor(%lf, %lf): negatieve waarden geven rare resultaten"
-#: builtin.c:2957 builtin.c:2963
+#: builtin.c:3135 mpfr.c:800
msgid "compl: received non-numeric argument"
msgstr "compl: argument is geen getal"
-#: builtin.c:2965
+#: builtin.c:3141
#, fuzzy, c-format
msgid "compl(%f): negative value will give strange results"
msgstr "compl(%lf): negatieve waarden geven rare resultaten"
-#: builtin.c:2967
+#: builtin.c:3143
#, fuzzy, c-format
msgid "compl(%f): fractional value will be truncated"
msgstr "compl(%lf): cijfers na de komma worden afgekapt"
-#: builtin.c:3136
+#: builtin.c:3312
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr "dcgettext: '%s' is geen geldige taalregio-deelcategorie"
-#: eval.c:412
+#: command.y:225
+#, c-format
+msgid "Type (g)awk statement(s). End with the command \"end\"\n"
+msgstr ""
+
+#: command.y:289
+#, fuzzy, c-format
+msgid "invalid frame number: %d"
+msgstr "Ongeldig bereikeinde"
+
+#: command.y:295
+#, fuzzy, c-format
+msgid "info: invalid option - \"%s\""
+msgstr "%s: ongeldige optie -- '%c'\n"
+
+#: command.y:321
+#, c-format
+msgid "source \"%s\": already sourced."
+msgstr ""
+
+#: command.y:326
+#, c-format
+msgid "save \"%s\": command not permitted."
+msgstr ""
+
+#: command.y:339
+msgid "Can't use command `commands' for breakpoint/watchpoint commands"
+msgstr ""
+
+#: command.y:341
+msgid "no breakpoint/watchpoint has been set yet"
+msgstr ""
+
+#: command.y:343
+msgid "invalid breakpoint/watchpoint number"
+msgstr ""
+
+#: command.y:348
+#, c-format
+msgid "Type commands for when %s %d is hit, one per line.\n"
+msgstr ""
+
+#: command.y:350
+#, c-format
+msgid "End with the command \"end\"\n"
+msgstr ""
+
+#: command.y:357
+msgid "`end' valid only in command `commands' or `eval'"
+msgstr ""
+
+#: command.y:367
+msgid "`silent' valid only in command `commands'"
+msgstr ""
+
+#: command.y:373
+#, fuzzy, c-format
+msgid "trace: invalid option - \"%s\""
+msgstr "%s: ongeldige optie -- '%c'\n"
+
+#: command.y:387
+msgid "condition: invalid breakpoint/watchpoint number"
+msgstr ""
+
+#: command.y:449
+#, fuzzy
+msgid "argument not a string"
+msgstr "exp: argument %g ligt buiten toegestane bereik"
+
+#: command.y:459 command.y:464
+#, c-format
+msgid "option: invalid parameter - \"%s\""
+msgstr ""
+
+#: command.y:474
+#, c-format
+msgid "no such function - \"%s\""
+msgstr ""
+
+#: command.y:531
+#, fuzzy, c-format
+msgid "enable: invalid option - \"%s\""
+msgstr "%s: ongeldige optie -- '%c'\n"
+
+#: command.y:597
+#, fuzzy, c-format
+msgid "invalid range specification: %d - %d"
+msgstr "Ongeldig bereikeinde"
+
+#: command.y:659
+#, fuzzy
+msgid "non-numeric value for field number"
+msgstr "onbekende waarde voor veldspecificatie: %d\n"
+
+#: command.y:680 command.y:687
+msgid "non-numeric value found, numeric expected"
+msgstr ""
+
+#: command.y:712 command.y:718
+msgid "non-zero integer value"
+msgstr ""
+
+#: command.y:817
+msgid ""
+"backtrace [N] - print trace of all or N innermost (outermost if N < 0) "
+"frames."
+msgstr ""
+
+#: command.y:819
+msgid ""
+"break [[filename:]N|function] - set breakpoint at the specified location."
+msgstr ""
+
+#: command.y:821
+msgid "clear [[filename:]N|function] - delete breakpoints previously set."
+msgstr ""
+
+#: command.y:823
+msgid ""
+"commands [num] - starts a list of commands to be executed at a breakpoint"
+"(watchpoint) hit."
+msgstr ""
+
+#: command.y:825
+msgid "condition num [expr] - set or clear breakpoint or watchpoint condition."
+msgstr ""
+
+#: command.y:827
+msgid "continue [COUNT] - continue program being debugged."
+msgstr ""
+
+#: command.y:829
+msgid "delete [breakpoints] [range] - delete specified breakpoints."
+msgstr ""
+
+#: command.y:831
+msgid "disable [breakpoints] [range] - disable specified breakpoints."
+msgstr ""
+
+#: command.y:833
+msgid "display [var] - print value of variable each time the program stops."
+msgstr ""
+
+#: command.y:835
+msgid "down [N] - move N frames down the stack."
+msgstr ""
+
+#: command.y:837
+msgid "dump [filename] - dump instructions to file or stdout."
+msgstr ""
+
+#: command.y:839
+msgid "enable [once|del] [breakpoints] [range] - enable specified breakpoints."
+msgstr ""
+
+#: command.y:841
+msgid "end - end a list of commands or awk statements."
+msgstr ""
+
+#: command.y:843
+msgid "eval stmt|[p1, p2, ...] - evaluate awk statement(s)."
+msgstr ""
+
+#: command.y:845
+msgid "finish - execute until selected stack frame returns."
+msgstr ""
+
+#: command.y:847
+msgid "frame [N] - select and print stack frame number N."
+msgstr ""
+
+#: command.y:849
+msgid "help [command] - print list of commands or explanation of command."
+msgstr ""
+
+#: command.y:851
+msgid "ignore N COUNT - set ignore-count of breakpoint number N to COUNT."
+msgstr ""
+
+#: command.y:853
+msgid ""
+"info topic - source|sources|variables|functions|break|frame|args|locals|"
+"display|watch."
+msgstr ""
+
+#: command.y:855
+msgid "list [-|+|[filename:]lineno|function|range] - list specified line(s)."
+msgstr ""
+
+#: command.y:857
+msgid "next [COUNT] - step program, proceeding through subroutine calls."
+msgstr ""
+
+#: command.y:859
+msgid ""
+"nexti [COUNT] - step one instruction, but proceed through subroutine calls."
+msgstr ""
+
+#: command.y:861
+msgid "option [name[=value]] - set or display debugger option(s)."
+msgstr ""
+
+#: command.y:863
+msgid "print var [var] - print value of a variable or array."
+msgstr ""
+
+#: command.y:865
+msgid "printf format, [arg], ... - formatted output."
+msgstr ""
+
+#: command.y:867
+msgid "quit - exit debugger."
+msgstr ""
+
+#: command.y:869
+msgid "return [value] - make selected stack frame return to its caller."
+msgstr ""
+
+#: command.y:871
+msgid "run - start or restart executing program."
+msgstr ""
+
+#: command.y:874
+msgid "save filename - save commands from the session to file."
+msgstr ""
+
+#: command.y:877
+msgid "set var = value - assign value to a scalar variable."
+msgstr ""
+
+#: command.y:879
+msgid ""
+"silent - suspends usual message when stopped at a breakpoint/watchpoint."
+msgstr ""
+
+#: command.y:881
+msgid "source file - execute commands from file."
+msgstr ""
+
+#: command.y:883
+msgid "step [COUNT] - step program until it reaches a different source line."
+msgstr ""
+
+#: command.y:885
+msgid "stepi [COUNT] - step one instruction exactly."
+msgstr ""
+
+#: command.y:887
+msgid "tbreak [[filename:]N|function] - set a temporary breakpoint."
+msgstr ""
+
+#: command.y:889
+msgid "trace on|off - print instruction before executing."
+msgstr ""
+
+#: command.y:891
+msgid "undisplay [N] - remove variable(s) from automatic display list."
+msgstr ""
+
+#: command.y:893
+msgid ""
+"until [[filename:]N|function] - execute until program reaches a different "
+"line or line N within current frame."
+msgstr ""
+
+#: command.y:895
+msgid "unwatch [N] - remove variable(s) from watch list."
+msgstr ""
+
+#: command.y:897
+msgid "up [N] - move N frames up the stack."
+msgstr ""
+
+#: command.y:899
+msgid "watch var - set a watchpoint for a variable."
+msgstr ""
+
+#: command.y:1011 debug.c:395 msg.c:128
+#, c-format
+msgid "error: "
+msgstr "fout: "
+
+#: command.y:1051
+#, fuzzy, c-format
+msgid "can't read command (%s)\n"
+msgstr "kan niet omleiden van '%s' (%s)"
+
+#: command.y:1065
+#, fuzzy, c-format
+msgid "can't read command (%s)"
+msgstr "kan niet omleiden van '%s' (%s)"
+
+#: command.y:1116
+#, fuzzy
+msgid "invalid character in command"
+msgstr "Ongeldige tekenklassenaam"
+
+#: command.y:1152
+#, c-format
+msgid "unknown command - \"%.*s\", try help"
+msgstr ""
+
+#: command.y:1222
+#, c-format
+msgid "%s"
+msgstr ""
+
+#: command.y:1284
+#, fuzzy
+msgid "invalid character"
+msgstr "Ongeldig samengesteld teken"
+
+#: command.y:1455
+#, c-format
+msgid "undefined command: %s\n"
+msgstr ""
+
+#: debug.c:246
+msgid "set or show the number of lines to keep in history file."
+msgstr ""
+
+#: debug.c:248
+msgid "set or show the list command window size."
+msgstr ""
+
+#: debug.c:250
+msgid "set or show gawk output file."
+msgstr ""
+
+#: debug.c:252
+msgid "set or show debugger prompt."
+msgstr ""
+
+#: debug.c:254
+msgid "(un)set or show saving of command history (value=on|off)."
+msgstr ""
+
+#: debug.c:256
+msgid "(un)set or show saving of options (value=on|off)."
+msgstr ""
+
+#: debug.c:258
+msgid "(un)set or show instruction tracing (value=on|off)."
+msgstr ""
+
+#: debug.c:339
+msgid "program not running."
+msgstr ""
+
+#: debug.c:442 debug.c:597
+#, fuzzy, c-format
+msgid "can't read source file `%s' (%s)"
+msgstr "kan bronbestand '%s' niet lezen (%s)"
+
+#: debug.c:447
+#, fuzzy, c-format
+msgid "source file `%s' is empty.\n"
+msgstr "bronbestand '%s' is leeg"
+
+#: debug.c:474
+msgid "no current source file."
+msgstr ""
+
+#: debug.c:499
+#, fuzzy, c-format
+msgid "cannot find source file named `%s' (%s)"
+msgstr "kan bronbestand '%s' niet lezen (%s)"
+
+#: debug.c:523
+#, c-format
+msgid "WARNING: source file `%s' modified since program compilation.\n"
+msgstr ""
+
+#: debug.c:542
+#, c-format
+msgid "line number %d out of range; `%s' has %d lines"
+msgstr ""
+
+#: debug.c:602
+#, fuzzy, c-format
+msgid "unexpected eof while reading file `%s', line %d"
+msgstr "onverwacht regeleinde of einde van string"
+
+#: debug.c:611
+#, c-format
+msgid "source file `%s' modified since start of program execution"
+msgstr ""
+
+#: debug.c:723
+#, fuzzy, c-format
+msgid "Current source file: %s\n"
+msgstr "bronbestand '%s' is reeds ingesloten"
+
+#: debug.c:724
+#, c-format
+msgid "Number of lines: %d\n"
+msgstr ""
+
+#: debug.c:731
+#, c-format
+msgid "Source file (lines): %s (%d)\n"
+msgstr ""
+
+#: debug.c:745
+msgid ""
+"Number Disp Enabled Location\n"
+"\n"
+msgstr ""
+
+#: debug.c:756
+#, c-format
+msgid "\tno of hits = %ld\n"
+msgstr ""
+
+#: debug.c:758
+#, c-format
+msgid "\tignore next %ld hit(s)\n"
+msgstr ""
+
+#: debug.c:760 debug.c:900
+#, c-format
+msgid "\tstop condition: %s\n"
+msgstr ""
+
+#: debug.c:762 debug.c:902
+msgid "\tcommands:\n"
+msgstr ""
+
+#: debug.c:784
+#, c-format
+msgid "Current frame: "
+msgstr ""
+
+#: debug.c:787
+#, c-format
+msgid "Called by frame: "
+msgstr ""
+
+#: debug.c:791
+#, c-format
+msgid "Caller of frame: "
+msgstr ""
+
+#: debug.c:809
+#, c-format
+msgid "None in main().\n"
+msgstr ""
+
+#: debug.c:839
+#, fuzzy
+msgid "No arguments.\n"
+msgstr "printf: geen argumenten"
+
+#: debug.c:840
+msgid "No locals.\n"
+msgstr ""
+
+#: debug.c:848
+msgid ""
+"All defined variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:858
+msgid ""
+"All defined functions:\n"
+"\n"
+msgstr ""
+
+#: debug.c:877
+msgid ""
+"Auto-display variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:880
+msgid ""
+"Watch variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:1020
+#, fuzzy, c-format
+msgid "no symbol `%s' in current context\n"
+msgstr "'exit' kan niet aangeroepen worden in de huidige context"
+
+#: debug.c:1032 debug.c:1416
+#, fuzzy, c-format
+msgid "`%s' is not an array\n"
+msgstr "'%s' is geen geldige variabelenaam"
+
+#: debug.c:1046
+#, fuzzy, c-format
+msgid "$%ld = uninitialized field\n"
+msgstr "verwijzing naar ongeïnitialiseerd veld '$%d'"
+
+#: debug.c:1067
+#, fuzzy, c-format
+msgid "array `%s' is empty\n"
+msgstr "databestand '%s' is leeg"
+
+#: debug.c:1110 debug.c:1162
+#, fuzzy, c-format
+msgid "[\"%s\"] not in array `%s'\n"
+msgstr "delete: index '%s' niet in array '%s'"
+
+#: debug.c:1166
+#, c-format
+msgid "`%s[\"%s\"]' is not an array\n"
+msgstr ""
+
+#: debug.c:1227 debug.c:4947
+#, fuzzy, c-format
+msgid "`%s' is not a scalar variable"
+msgstr "'%s' is geen geldige variabelenaam"
+
+#: debug.c:1249 debug.c:4977
+#, fuzzy, c-format
+msgid "attempt to use array `%s[\"%s\"]' in a scalar context"
+msgstr "array '%s[\"%.*s\"]' wordt gebruikt in een scalaire context"
+
+#: debug.c:1269 debug.c:4988
+#, fuzzy, c-format
+msgid "attempt to use scalar `%s[\"%s\"]' as array"
+msgstr "scalair '%s[\"%.*s\"]' wordt gebruikt als array"
+
+#: debug.c:1412
+#, fuzzy, c-format
+msgid "`%s' is a function"
+msgstr "'%s' is ongeldig als functienaam"
+
+#: debug.c:1454
+#, c-format
+msgid "watchpoint %d is unconditional\n"
+msgstr ""
+
+#: debug.c:1488
+#, c-format
+msgid "No display item numbered %ld"
+msgstr ""
+
+#: debug.c:1491
+#, c-format
+msgid "No watch item numbered %ld"
+msgstr ""
+
+#: debug.c:1517
+#, fuzzy, c-format
+msgid "%d: [\"%s\"] not in array `%s'\n"
+msgstr "delete: index '%s' niet in array '%s'"
+
+#: debug.c:1756
+#, fuzzy
+msgid "attempt to use scalar value as array"
+msgstr "scalaire waarde wordt gebruikt als array"
+
+#: debug.c:1845
+#, c-format
+msgid "Watchpoint %d deleted because parameter is out of scope.\n"
+msgstr ""
+
+#: debug.c:1856
+#, c-format
+msgid "Display %d deleted because parameter is out of scope.\n"
+msgstr ""
+
+#: debug.c:1889
+#, c-format
+msgid " in file `%s', line %d\n"
+msgstr ""
+
+#: debug.c:1910
+#, c-format
+msgid " at `%s':%d"
+msgstr ""
+
+#: debug.c:1926 debug.c:1989
+#, c-format
+msgid "#%ld\tin "
+msgstr ""
+
+#: debug.c:1963
+#, c-format
+msgid "More stack frames follow ...\n"
+msgstr ""
+
+#: debug.c:2006
+#, fuzzy
+msgid "invalid frame number"
+msgstr "Ongeldig bereikeinde"
+
+#: debug.c:2178
+#, c-format
+msgid "Note: breakpoint %d (enabled, ignore next %ld hits), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2185
+#, c-format
+msgid "Note: breakpoint %d (enabled), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2192
+#, c-format
+msgid "Note: breakpoint %d (disabled, ignore next %ld hits), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2199
+#, c-format
+msgid "Note: breakpoint %d (disabled), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2216
+#, c-format
+msgid "Breakpoint %d set at file `%s', line %d\n"
+msgstr ""
+
+#: debug.c:2318
+#, c-format
+msgid "Can't set breakpoint in file `%s'\n"
+msgstr ""
+
+#: debug.c:2347 debug.c:2470 debug.c:3328
+#, fuzzy, c-format
+msgid "line number %d in file `%s' out of range"
+msgstr "exp: argument %g ligt buiten toegestane bereik"
+
+#: debug.c:2351
+#, c-format
+msgid "Can't find rule!!!\n"
+msgstr ""
+
+#: debug.c:2353
+#, c-format
+msgid "Can't set breakpoint at `%s':%d\n"
+msgstr ""
+
+#: debug.c:2365
+#, c-format
+msgid "Can't set breakpoint in function `%s'\n"
+msgstr ""
+
+#: debug.c:2381
+#, c-format
+msgid "breakpoint %d set at file `%s', line %d is unconditional\n"
+msgstr ""
+
+#: debug.c:2486 debug.c:2508
+#, c-format
+msgid "Deleted breakpoint %d"
+msgstr ""
+
+#: debug.c:2492
+#, c-format
+msgid "No breakpoint(s) at entry to function `%s'\n"
+msgstr ""
+
+#: debug.c:2519
+#, fuzzy, c-format
+msgid "No breakpoint at file `%s', line #%d\n"
+msgstr "fout tijdens lezen van invoerbestand '%s': %s"
+
+#: debug.c:2574 debug.c:2615 debug.c:2635 debug.c:2678
+msgid "invalid breakpoint number"
+msgstr ""
+
+#: debug.c:2590
+msgid "Delete all breakpoints? (y or n) "
+msgstr ""
+
+#: debug.c:2591 debug.c:2901 debug.c:2954
+msgid "y"
+msgstr ""
+
+#: debug.c:2640
+#, c-format
+msgid "Will ignore next %ld crossing(s) of breakpoint %d.\n"
+msgstr ""
+
+#: debug.c:2644
+#, c-format
+msgid "Will stop next time breakpoint %d is reached.\n"
+msgstr ""
+
+#: debug.c:2761
+#, c-format
+msgid "Can only debug programs provided with the `-f' option.\n"
+msgstr ""
+
+#: debug.c:2886
+#, c-format
+msgid "Failed to restart debugger"
+msgstr ""
+
+#: debug.c:2900
+msgid "Program already running. Restart from beginning (y/n)? "
+msgstr ""
+
+#: debug.c:2904
+#, c-format
+msgid "Program not restarted\n"
+msgstr ""
+
+#: debug.c:2914
+#, c-format
+msgid "error: cannot restart, operation not allowed\n"
+msgstr ""
+
+#: debug.c:2920
+#, c-format
+msgid "error (%s): cannot restart, ignoring rest of the commands\n"
+msgstr ""
+
+#: debug.c:2928
+#, c-format
+msgid "Starting program: \n"
+msgstr ""
+
+#: debug.c:2937
+#, c-format
+msgid "Program exited %s with exit value: %d\n"
+msgstr ""
+
+#: debug.c:2953
+msgid "The program is running. Exit anyway (y/n)? "
+msgstr ""
+
+#: debug.c:2988
+#, c-format
+msgid "Not stopped at any breakpoint; argument ignored.\n"
+msgstr ""
+
+#: debug.c:2993
+#, c-format
+msgid "invalid breakpoint number %d."
+msgstr ""
+
+#: debug.c:2998
+#, c-format
+msgid "Will ignore next %ld crossings of breakpoint %d.\n"
+msgstr ""
+
+#: debug.c:3185
+#, c-format
+msgid "'finish' not meaningful in the outermost frame main()\n"
+msgstr ""
+
+#: debug.c:3190
+#, c-format
+msgid "Run till return from "
+msgstr ""
+
+#: debug.c:3233
+#, c-format
+msgid "'return' not meaningful in the outermost frame main()\n"
+msgstr ""
+
+#: debug.c:3347
+#, c-format
+msgid "Can't find specified location in function `%s'\n"
+msgstr ""
+
+#: debug.c:3355
+#, fuzzy, c-format
+msgid "invalid source line %d in file `%s'"
+msgstr "bronbestand '%s' is reeds ingesloten"
+
+#: debug.c:3370
+#, c-format
+msgid "Can't find specified location %d in file `%s'\n"
+msgstr ""
+
+#: debug.c:3402
+#, fuzzy, c-format
+msgid "element not in array\n"
+msgstr "delete: index '%s' niet in array '%s'"
+
+#: debug.c:3402
+#, c-format
+msgid "untyped variable\n"
+msgstr ""
+
+#: debug.c:3444
+#, c-format
+msgid "Stopping in %s ...\n"
+msgstr ""
+
+#: debug.c:3521
+#, c-format
+msgid "'finish' not meaningful with non-local jump '%s'\n"
+msgstr ""
+
+#: debug.c:3528
+#, c-format
+msgid "'until' not meaningful with non-local jump '%s'\n"
+msgstr ""
+
+#: debug.c:4163
+msgid "\t------[Enter] to continue or q [Enter] to quit------"
+msgstr ""
+
+#: debug.c:4164
+msgid "q"
+msgstr ""
+
+#: debug.c:4984
+#, fuzzy, c-format
+msgid "[\"%s\"] not in array `%s'"
+msgstr "delete: index '%s' niet in array '%s'"
+
+#: debug.c:5190
+#, c-format
+msgid "sending output to stdout\n"
+msgstr ""
+
+#: debug.c:5230
+msgid "invalid number"
+msgstr ""
+
+#: debug.c:5362
+#, fuzzy, c-format
+msgid "`%s' not allowed in current context; statement ignored"
+msgstr "'exit' kan niet aangeroepen worden in de huidige context"
+
+#: debug.c:5370
+#, fuzzy
+msgid "`return' not allowed in current context; statement ignored"
+msgstr "'exit' kan niet aangeroepen worden in de huidige context"
+
+#: debug.c:5571
+#, fuzzy, c-format
+msgid "No symbol `%s' in current context"
+msgstr "array '%s' wordt gebruikt in een scalaire context"
+
+#: dfa.c:984 dfa.c:987 dfa.c:1007 dfa.c:1017 dfa.c:1029 dfa.c:1080 dfa.c:1089
+#: dfa.c:1092 dfa.c:1097 dfa.c:1110 dfa.c:1178
+msgid "unbalanced ["
+msgstr ""
+
+#: dfa.c:1038
+#, fuzzy
+msgid "invalid character class"
+msgstr "Ongeldige tekenklassenaam"
+
+#: dfa.c:1215
+msgid "character class syntax is [[:space:]], not [:space:]"
+msgstr ""
+
+#: dfa.c:1267
+msgid "unfinished \\ escape"
+msgstr ""
+
+#: dfa.c:1414 regcomp.c:161
+msgid "Invalid content of \\{\\}"
+msgstr "Ongeldige inhoud van \\{\\}"
+
+#: dfa.c:1417 regcomp.c:176
+msgid "Regular expression too big"
+msgstr "Reguliere expressie is te groot"
+
+#: dfa.c:1802
+msgid "unbalanced ("
+msgstr ""
+
+#: dfa.c:1929
+msgid "no syntax specified"
+msgstr ""
+
+#: dfa.c:1937
+msgid "unbalanced )"
+msgstr ""
+
+#: eval.c:394
#, c-format
msgid "unknown nodetype %d"
msgstr "onbekend knooptype %d"
-#: eval.c:423 eval.c:437
+#: eval.c:405 eval.c:419
#, c-format
msgid "unknown opcode %d"
msgstr "onbekende opcode %d"
-#: eval.c:434
+#: eval.c:416
#, c-format
msgid "opcode %s not an operator or keyword"
msgstr "opcode %s is geen operator noch sleutelwoord"
-#: eval.c:488
+#: eval.c:471
msgid "buffer overflow in genflags2str"
msgstr "bufferoverloop in genflags2str()"
-#: eval.c:698
+#: eval.c:674
#, c-format
msgid ""
"\n"
@@ -982,311 +1830,538 @@ msgstr ""
"\t# Functieaanroepen-stack:\n"
"\n"
-#: eval.c:725
+#: eval.c:703
msgid "`IGNORECASE' is a gawk extension"
msgstr "'IGNORECASE' is een gawk-uitbreiding"
-#: eval.c:754
+#: eval.c:735
msgid "`BINMODE' is a gawk extension"
msgstr "'BINMODE' is een gawk-uitbreiding"
-#: eval.c:812
+#: eval.c:792
#, c-format
msgid "BINMODE value `%s' is invalid, treated as 3"
msgstr "BINMODE-waarde '%s' is ongeldig, wordt behandeld als 3"
-#: eval.c:902
+#: eval.c:884
#, c-format
msgid "bad `%sFMT' specification `%s'"
msgstr "onjuiste opgave van '%sFMT': '%s'"
-#: eval.c:980
+#: eval.c:968
msgid "turning off `--lint' due to assignment to `LINT'"
msgstr "'--lint' wordt uitgeschakeld wegens toewijzing aan 'LINT'"
-#: eval.c:1127 eval.c:1777
-#, c-format
-msgid "can't use function name `%s' as variable or array"
-msgstr "kan functienaam '%s' niet als variabele of array gebruiken"
-
-#: eval.c:1158 eval.c:1789 eval.c:1802
+#: eval.c:1144
#, c-format
msgid "reference to uninitialized argument `%s'"
msgstr "verwijzing naar ongeïnitialiseerd argument '%s'"
-#: eval.c:1177
+#: eval.c:1145
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "verwijzing naar ongeïnitialiseerde variabele '%s'"
+
+#: eval.c:1163
msgid "attempt to field reference from non-numeric value"
msgstr "veldverwijzingspoging via een waarde die geen getal is"
-#: eval.c:1179
+#: eval.c:1165
msgid "attempt to field reference from null string"
msgstr "veldverwijzingspoging via een lege string"
-#: eval.c:1185
+#: eval.c:1173
#, c-format
msgid "attempt to access field %ld"
msgstr "toegangspoging tot veld %ld"
-#: eval.c:1194
+#: eval.c:1182
#, c-format
msgid "reference to uninitialized field `$%ld'"
msgstr "verwijzing naar ongeïnitialiseerd veld '$%ld'"
-#: eval.c:1256
+#: eval.c:1269
#, c-format
msgid "function `%s' called with more arguments than declared"
msgstr "functie '%s' aangeroepen met meer argumenten dan gedeclareerd"
-#: eval.c:1437
+#: eval.c:1464
#, c-format
msgid "unwind_stack: unexpected type `%s'"
msgstr "unwind_stack(): onverwacht type '%s'"
-#: eval.c:1532
+#: eval.c:1558
msgid "division by zero attempted in `/='"
msgstr "deling door nul in '/='"
-#: eval.c:1539
+#: eval.c:1565
#, c-format
msgid "division by zero attempted in `%%='"
msgstr "deling door nul in '%%='"
-#: eval.c:1876 eval.c:2122
-#, c-format
-msgid "attempt to use array `%s[\"%.*s\"]' in a scalar context"
-msgstr "array '%s[\"%.*s\"]' wordt gebruikt in een scalaire context"
-
-#: eval.c:1907
-msgid "assignment used in conditional context"
-msgstr "toewijzing wordt gebruikt in een conditionele context"
-
-#: eval.c:1911
-msgid "statement has no effect"
-msgstr "opdracht heeft geen effect"
-
-#: eval.c:2343
-#, c-format
-msgid "for loop: array `%s' changed size from %ld to %ld during loop execution"
-msgstr ""
-"for: array '%s' veranderde van grootte %ld naar %ld tijdens uitvoer van de "
-"lus"
-
-#: eval.c:2458
-#, c-format
-msgid "function called indirectly through `%s' does not exist"
-msgstr "indirect (via '%s') aangeroepen functie bestaat niet"
-
-#: eval.c:2470
-#, c-format
-msgid "function `%s' not defined"
-msgstr "functie '%s' is niet gedefinieerd"
-
-#: eval.c:2511
-#, c-format
-msgid "non-redirected `getline' invalid inside `%s' rule"
-msgstr "niet-omgeleide 'getline' is ongeldig binnen een '%s'-regel"
-
-#: eval.c:2600
-#, c-format
-msgid "error reading input file `%s': %s"
-msgstr "fout tijdens lezen van invoerbestand '%s': %s"
-
-#: eval.c:2614
-#, c-format
-msgid "`nextfile' cannot be called from a `%s' rule"
-msgstr "'nextfile' kan niet aangeroepen worden in een '%s'-regel"
-
-#: eval.c:2661
-msgid "`exit' cannot be called in the current context"
-msgstr "'exit' kan niet aangeroepen worden in de huidige context"
-
-#: eval.c:2700
-#, c-format
-msgid "`next' cannot be called from a `%s' rule"
-msgstr "'next' kan niet aangeroepen worden in een '%s'-regel"
-
-#: eval.c:2766
-#, c-format
-msgid "Sorry, don't know how to interpret `%s'"
-msgstr "Kan '%s' niet interpreteren"
-
-#: ext.c:54
+#: ext.c:49
msgid "extensions are not allowed in sandbox mode"
msgstr "uitbreidingen zijn niet toegestaan in sandbox-modus"
-#: ext.c:60 ext.c:65
-msgid "`extension' is a gawk extension"
-msgstr "'extension' is een gawk-uitbreiding"
+#: ext.c:52
+#, fuzzy
+msgid "-l / @load are gawk extensions"
+msgstr "'@include' is een gawk-uitbreiding"
+
+#: ext.c:55
+msgid "load_ext: received NULL lib_name"
+msgstr ""
-#: ext.c:75
-#, c-format
-msgid "fatal: extension: cannot open `%s' (%s)\n"
+#: ext.c:58
+#, fuzzy, c-format
+msgid "load_ext: cannot open library `%s' (%s)\n"
msgstr "fatale fout: extension: kan '%s' niet openen (%s)\n"
-#: ext.c:84
-#, c-format
+#: ext.c:64
+#, fuzzy, c-format
msgid ""
-"fatal: extension: library `%s': does not define "
-"`plugin_is_GPL_compatible' (%s)\n"
+"load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n"
msgstr ""
"fatale fout: extension: bibliotheek '%s': definieert "
"'plugin_is_GPL_compatible' niet (%s)\n"
-#: ext.c:93
-#, c-format
-msgid "fatal: extension: library `%s': cannot call function `%s' (%s)\n"
+#: ext.c:70
+#, fuzzy, c-format
+msgid "load_ext: library `%s': cannot call function `%s' (%s)\n"
msgstr ""
"fatale fout: extension: bibliotheek '%s': kan functie '%s' niet aanroepen "
"(%s)\n"
-#: ext.c:127
-msgid "extension: missing function name"
+#: ext.c:74
+#, c-format
+msgid "load_ext: library `%s' initialization routine `%s' failed\n"
+msgstr ""
+
+#: ext.c:93
+#, fuzzy
+msgid "make_builtin: missing function name"
msgstr "extension: ontbrekende functienaam"
-#: ext.c:132
-#, c-format
-msgid "extension: illegal character `%c' in function name `%s'"
+#: ext.c:98
+#, fuzzy, c-format
+msgid "make_builtin: illegal character `%c' in function name `%s'"
msgstr "extension: ongeldig teken '%c' in functienaam '%s'"
-#: ext.c:141
-#, c-format
-msgid "extension: can't redefine function `%s'"
+#: ext.c:106
+#, fuzzy, c-format
+msgid "make_builtin: can't redefine function `%s'"
msgstr "extension: kan functie '%s' niet herdefiniëren"
-#: ext.c:145
-#, c-format
-msgid "extension: function `%s' already defined"
+#: ext.c:110
+#, fuzzy, c-format
+msgid "make_builtin: function `%s' already defined"
msgstr "extension: functie '%s' is al gedefinieerd"
-#: ext.c:150
-#, c-format
-msgid "extension: function name `%s' previously defined"
+#: ext.c:114
+#, fuzzy, c-format
+msgid "make_builtin: function name `%s' previously defined"
msgstr "extension: functienaam '%s' is al eerder gedefinieerd"
-#: ext.c:152
-#, c-format
-msgid "extension: can't use gawk built-in `%s' as function name"
+#: ext.c:116
+#, fuzzy, c-format
+msgid "make_builtin: can't use gawk built-in `%s' as function name"
msgstr "extension: kan in gawk ingebouwde '%s' niet als functienaam gebruiken"
-#: ext.c:156
+#: ext.c:119
#, c-format
msgid "make_builtin: negative argument count for function `%s'"
msgstr "make_builtin: negatief aantal argumenten voor functie '%s'"
-#: ext.c:259
+#: ext.c:183
#, c-format
msgid "function `%s' defined to take no more than %d argument(s)"
msgstr ""
"functie '%s' is gedefinieerd om niet meer dan %d argument(en) te accepteren"
-#: ext.c:262
+#: ext.c:186
#, c-format
msgid "function `%s': missing argument #%d"
msgstr "functie '%s': ontbrekend argument #%d"
-#: ext.c:279
+#: ext.c:203
#, c-format
msgid "function `%s': argument #%d: attempt to use scalar as an array"
msgstr "functie '%s': argument #%d: een scalair wordt gebruikt als array"
-#: ext.c:283
+#: ext.c:207
#, c-format
msgid "function `%s': argument #%d: attempt to use array as a scalar"
msgstr "functie '%s': argument #%d: een array wordt gebruikt als scalair"
-#: ext.c:296
-msgid "Operation Not Supported"
-msgstr "Actie wordt niet ondersteund"
+#: ext.c:221
+msgid "dynamic loading of library not supported"
+msgstr ""
+
+#: extension/filefuncs.c:75
+#, fuzzy
+msgid "chdir: called with incorrect number of arguments, expecting 1"
+msgstr "sqrt: argument %g is negatief"
+
+#: extension/filefuncs.c:348
+#, fuzzy
+msgid "stat: called with wrong number of arguments"
+msgstr "sqrt: argument %g is negatief"
+
+#: extension/filefuncs.c:355
+#, fuzzy
+msgid "stat: bad parameters"
+msgstr "%s: is een parameter\n"
+
+#: extension/filefuncs.c:421
+msgid "fill_stat_element: could not create array"
+msgstr ""
+
+#: extension/filefuncs.c:430
+msgid "fill_stat_element: could not set element"
+msgstr ""
+
+#: extension/filefuncs.c:445
+#, fuzzy
+msgid "fill_path_element: could not set element"
+msgstr "index: tweede argument is geen string"
+
+#: extension/filefuncs.c:461
+msgid "fill_error_element: could not set element"
+msgstr ""
+
+#: extension/filefuncs.c:508 extension/filefuncs.c:555
+msgid "fts-process: could not create array"
+msgstr ""
+
+#: extension/filefuncs.c:518 extension/filefuncs.c:565
+#: extension/filefuncs.c:583
+#, fuzzy
+msgid "fts-process: could not set element"
+msgstr "index: tweede argument is geen string"
+
+#: extension/filefuncs.c:632
+#, fuzzy
+msgid "fts: called with incorrect number of arguments, expecting 3"
+msgstr "sqrt: argument %g is negatief"
+
+#: extension/filefuncs.c:635
+#, fuzzy
+msgid "fts: bad first parameter"
+msgstr "%s: is een parameter\n"
+
+#: extension/filefuncs.c:641
+#, fuzzy
+msgid "fts: bad second parameter"
+msgstr "%s: is een parameter\n"
+
+#: extension/filefuncs.c:647
+#, fuzzy
+msgid "fts: bad third parameter"
+msgstr "%s: is een parameter\n"
+
+#: extension/filefuncs.c:654
+#, fuzzy
+msgid "fts: could not flatten array\n"
+msgstr "'%s' is geen geldige variabelenaam"
+
+#: extension/filefuncs.c:672
+msgid "fts: ignoring sneaky FTS_NOSTAT flag. nyah, nyah, nyah."
+msgstr ""
-#: field.c:328
+#: extension/filefuncs.c:689
+msgid "fts: clear_array failed\n"
+msgstr ""
+
+#: extension/fnmatch.c:91
+#, fuzzy
+msgid "fnmatch: called with less than three arguments"
+msgstr "sqrt: argument %g is negatief"
+
+#: extension/fnmatch.c:94
+#, fuzzy
+msgid "fnmatch: called with more than three arguments"
+msgstr "sqrt: argument %g is negatief"
+
+#: extension/fnmatch.c:97
+#, fuzzy
+msgid "fnmatch: could not get first argument"
+msgstr "strftime: eerste argument is geen string"
+
+#: extension/fnmatch.c:102
+#, fuzzy
+msgid "fnmatch: could not get second argument"
+msgstr "index: tweede argument is geen string"
+
+#: extension/fnmatch.c:107
+msgid "fnmatch: could not get third argument"
+msgstr ""
+
+#: extension/fnmatch.c:120
+msgid "fnmatch is not implemented on this system\n"
+msgstr ""
+
+#: extension/fnmatch.c:152
+msgid "fnmatch init: could not add FNM_NOMATCH variable"
+msgstr ""
+
+#: extension/fnmatch.c:162
+#, c-format
+msgid "fnmatch init: could not set array element %s"
+msgstr ""
+
+#: extension/fnmatch.c:172
+msgid "fnmatch init: could not install FNM array"
+msgstr ""
+
+#: extension/fork.c:81
+#, fuzzy
+msgid "fork: called with too many arguments"
+msgstr "sqrt: argument %g is negatief"
+
+#: extension/fork.c:94
+msgid "fork: PROCINFO is not an array!"
+msgstr ""
+
+#: extension/fork.c:118
+#, fuzzy
+msgid "waitpid: called with too many arguments"
+msgstr "sqrt: argument %g is negatief"
+
+#: extension/fork.c:126
+#, fuzzy
+msgid "wait: called with no arguments"
+msgstr "sqrt: argument %g is negatief"
+
+#: extension/fork.c:143
+#, fuzzy
+msgid "wait: called with too many arguments"
+msgstr "sqrt: argument %g is negatief"
+
+#: extension/ordchr.c:69
+#, fuzzy
+msgid "ord: called with too many arguments"
+msgstr "sqrt: argument %g is negatief"
+
+#: extension/ordchr.c:75
+#, fuzzy
+msgid "ord: called with no arguments"
+msgstr "sqrt: argument %g is negatief"
+
+#: extension/ordchr.c:77
+#, fuzzy
+msgid "ord: called with inappropriate argument(s)"
+msgstr "sqrt: argument %g is negatief"
+
+#: extension/ordchr.c:99
+#, fuzzy
+msgid "chr: called with too many arguments"
+msgstr "sqrt: argument %g is negatief"
+
+#: extension/ordchr.c:109
+#, fuzzy
+msgid "chr: called with no arguments"
+msgstr "sqrt: argument %g is negatief"
+
+#: extension/ordchr.c:111
+#, fuzzy
+msgid "chr: called with inappropriate argument(s)"
+msgstr "sqrt: argument %g is negatief"
+
+#: extension/readfile.c:81
+#, fuzzy
+msgid "readfile: called with too many arguments"
+msgstr "sqrt: argument %g is negatief"
+
+#: extension/readfile.c:114
+#, fuzzy
+msgid "readfile: called with no arguments"
+msgstr "sqrt: argument %g is negatief"
+
+#: extension/rwarray.c:120
+#, fuzzy
+msgid "writea: called with too many arguments"
+msgstr "sqrt: argument %g is negatief"
+
+#: extension/rwarray.c:127
+#, fuzzy, c-format
+msgid "do_writea: argument 0 is not a string\n"
+msgstr "exp: argument %g ligt buiten toegestane bereik"
+
+#: extension/rwarray.c:133
+#, fuzzy, c-format
+msgid "do_writea: argument 1 is not an array\n"
+msgstr "split: vierde argument is geen array"
+
+#: extension/rwarray.c:180
+#, c-format
+msgid "write_array: could not flatten array\n"
+msgstr ""
+
+#: extension/rwarray.c:194
+#, c-format
+msgid "write_array: could not release flattened array\n"
+msgstr ""
+
+#: extension/rwarray.c:276
+#, fuzzy
+msgid "reada: called with too many arguments"
+msgstr "sqrt: argument %g is negatief"
+
+#: extension/rwarray.c:283
+#, fuzzy, c-format
+msgid "do_reada: argument 0 is not a string\n"
+msgstr "exp: argument %g ligt buiten toegestane bereik"
+
+#: extension/rwarray.c:289
+#, fuzzy, c-format
+msgid "do_reada: argument 1 is not an array\n"
+msgstr "match: derde argument is geen array"
+
+#: extension/rwarray.c:333
+#, c-format
+msgid "do_reada: clear_array failed\n"
+msgstr ""
+
+#: extension/rwarray.c:370
+#, c-format
+msgid "read_array: set_array_element failed\n"
+msgstr ""
+
+#: extension/time.c:78
+#, fuzzy
+msgid "gettimeofday: ignoring arguments"
+msgstr "mktime: argument is geen string"
+
+#: extension/time.c:109
+msgid "gettimeofday: not supported on this platform"
+msgstr ""
+
+#: extension/time.c:130
+#, fuzzy
+msgid "sleep: called with too many arguments"
+msgstr "sqrt: argument %g is negatief"
+
+#: extension/time.c:133
+#, fuzzy
+msgid "sleep: missing required numeric argument"
+msgstr "exp: argument is geen getal"
+
+#: extension/time.c:139
+#, fuzzy
+msgid "sleep: argument is negative"
+msgstr "exp: argument %g ligt buiten toegestane bereik"
+
+#: extension/time.c:166
+msgid "sleep: not supported on this platform"
+msgstr ""
+
+#: field.c:339
msgid "NF set to negative value"
msgstr "NF is op een negatieve waarde gezet"
-#: field.c:951 field.c:958 field.c:962
+#: field.c:962 field.c:969 field.c:973
msgid "split: fourth argument is a gawk extension"
msgstr "split: vierde argument is een gawk-uitbreiding"
-#: field.c:955
+#: field.c:966
msgid "split: fourth argument is not an array"
msgstr "split: vierde argument is geen array"
-#: field.c:969
+#: field.c:980
msgid "split: second argument is not an array"
msgstr "split: tweede argument is geen array"
-#: field.c:973
+#: field.c:984
msgid "split: cannot use the same array for second and fourth args"
msgstr ""
"split: hetzelfde array kan niet zowel als tweede als als vierde argument "
"gebruikt worden"
-#: field.c:978
+#: field.c:989
msgid "split: cannot use a subarray of second arg for fourth arg"
msgstr ""
"split: een subarray van het tweede argument kan niet als vierde argument "
"gebruikt worden"
-#: field.c:981
+#: field.c:992
msgid "split: cannot use a subarray of fourth arg for second arg"
msgstr ""
"split: een subarray van het vierde argument kan niet als tweede argument "
"gebruikt worden"
-#: field.c:1010
+#: field.c:1021
msgid "split: null string for third arg is a gawk extension"
msgstr "split: lege string als derde argument is een gawk-uitbreiding"
-#: field.c:1050
+#: field.c:1061
msgid "patsplit: fourth argument is not an array"
msgstr "patsplit: vierde argument is geen array"
-#: field.c:1055
+#: field.c:1066
msgid "patsplit: second argument is not an array"
msgstr "patsplit: tweede argument is geen array"
-#: field.c:1061
+#: field.c:1072
msgid "patsplit: third argument must be non-null"
msgstr "patsplit: derde argument moet niet-nil zijn"
-#: field.c:1065
+#: field.c:1076
msgid "patsplit: cannot use the same array for second and fourth args"
msgstr ""
"patsplit: hetzelfde array kan niet zowel als tweede als als vierde argument "
"gebruikt worden"
-#: field.c:1070
+#: field.c:1081
msgid "patsplit: cannot use a subarray of second arg for fourth arg"
msgstr ""
"patsplit: een subarray van het tweede argument kan niet als vierde argument "
"gebruikt worden"
-#: field.c:1073
+#: field.c:1084
msgid "patsplit: cannot use a subarray of fourth arg for second arg"
msgstr ""
"patsplit: een subarray van het vierde argument kan niet als tweede argument "
"gebruikt worden"
-#: field.c:1110
+#: field.c:1122
msgid "`FIELDWIDTHS' is a gawk extension"
msgstr "'FIELDWIDTHS' is een gawk-uitbreiding"
-#: field.c:1173
+#: field.c:1186
#, c-format
msgid "invalid FIELDWIDTHS value, near `%s'"
msgstr "ongeldige waarde voor FIELDWIDTHS, nabij '%s'"
-#: field.c:1246
+#: field.c:1259
msgid "null string for `FS' is a gawk extension"
msgstr "een lege string als 'FS' is een gawk-uitbreiding"
-#: field.c:1250
+#: field.c:1263
msgid "old awk does not support regexps as value of `FS'"
msgstr "oude 'awk' staat geen reguliere expressies toe als waarde van 'FS'"
-#: field.c:1369
+#: field.c:1382
msgid "`FPAT' is a gawk extension"
msgstr "'FPAT' is een gawk-uitbreiding"
+#: gawkapi.c:143
+msgid "awk_value_to_node: received null retval"
+msgstr ""
+
+#: gawkapi.c:932
+#, c-format
+msgid "api_flatten_array: could not convert index %d\n"
+msgstr ""
+
+#: gawkapi.c:937
+#, c-format
+msgid "api_flatten_array: could not convert value %d\n"
+msgstr ""
+
+#: gawkapi.c:1111
+msgid "cannot assign to defined constant"
+msgstr ""
+
#: getopt.c:604 getopt.c:633
#, fuzzy, c-format
msgid "%s: option '%s' is ambiguous; possibilities:"
@@ -1342,467 +2417,531 @@ msgstr "%s: optie '-W %s' staat geen argument toe\n"
msgid "%s: option '-W %s' requires an argument\n"
msgstr "%s: optie '-W %s' vereist een argument\n"
-#: io.c:280
+#: io.c:339
#, c-format
msgid "command line argument `%s' is a directory: skipped"
msgstr "opdrachtregelargument '%s' is een map -- overgeslagen"
-#: io.c:283 io.c:385
+#: io.c:342 io.c:455
#, c-format
msgid "cannot open file `%s' for reading (%s)"
msgstr "kan bestand '%s' niet openen om te lezen (%s)"
-#: io.c:501
+#: io.c:582
#, c-format
msgid "close of fd %d (`%s') failed (%s)"
msgstr "sluiten van bestandsdescriptor %d ('%s') is mislukt (%s)"
-#: io.c:578
+#: io.c:658
msgid "redirection not allowed in sandbox mode"
msgstr "omleiding is niet toegestaan in sandbox-modus"
-#: io.c:612
+#: io.c:692
#, c-format
msgid "expression in `%s' redirection only has numeric value"
msgstr "expressie in omleiding '%s' heeft alleen een getal als waarde"
-#: io.c:618
+#: io.c:698
#, c-format
msgid "expression for `%s' redirection has null string value"
msgstr "expressie voor omleiding '%s' heeft een lege string als waarde"
-#: io.c:623
+#: io.c:703
#, c-format
msgid "filename `%s' for `%s' redirection may be result of logical expression"
msgstr ""
"bestandsnaam '%s' voor omleiding '%s' kan het resultaat zijn van een "
"logische expressie"
-#: io.c:666
+#: io.c:746
#, c-format
msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
msgstr "onnodige mix van '>' en '>>' voor bestand '%.*s'"
-#: io.c:719
+#: io.c:799
#, c-format
msgid "can't open pipe `%s' for output (%s)"
msgstr "kan pijp '%s' niet openen voor uitvoer (%s)"
-#: io.c:729
+#: io.c:809
#, c-format
msgid "can't open pipe `%s' for input (%s)"
msgstr "kan pijp '%s' niet openen voor invoer (%s)"
-#: io.c:752
+#: io.c:840
#, c-format
msgid "can't open two way pipe `%s' for input/output (%s)"
msgstr "kan tweerichtings-pijp '%s' niet openen voor in- en uitvoer (%s)"
-#: io.c:834
+#: io.c:923
#, c-format
msgid "can't redirect from `%s' (%s)"
msgstr "kan niet omleiden van '%s' (%s)"
-#: io.c:837
+#: io.c:926
#, c-format
msgid "can't redirect to `%s' (%s)"
msgstr "kan niet omleiden naar '%s' (%s)"
-#: io.c:888
+#: io.c:977
msgid ""
"reached system limit for open files: starting to multiplex file descriptors"
msgstr ""
"systeemgrens voor aantal open bestanden is bereikt: begonnen met multiplexen"
-#: io.c:904
+#: io.c:993
#, c-format
msgid "close of `%s' failed (%s)."
msgstr "sluiten van '%s' is mislukt (%s)"
-#: io.c:912
+#: io.c:1001
msgid "too many pipes or input files open"
msgstr "te veel pijpen of invoerbestanden geopend"
-#: io.c:934
+#: io.c:1023
msgid "close: second argument must be `to' or `from'"
msgstr "close: tweede argument moet 'to' of 'from' zijn"
-#: io.c:951
+#: io.c:1040
#, c-format
msgid "close: `%.*s' is not an open file, pipe or co-process"
msgstr "close: '%.*s' is geen open bestand, pijp, of co-proces"
-#: io.c:956
+#: io.c:1045
msgid "close of redirection that was never opened"
msgstr "sluiten van een nooit-geopende omleiding"
-#: io.c:1053
+#: io.c:1142
#, c-format
msgid "close: redirection `%s' not opened with `|&', second argument ignored"
msgstr ""
"close: omleiding '%s' is niet geopend met '|&'; tweede argument wordt "
"genegeerd"
-#: io.c:1069
+#: io.c:1159
#, c-format
msgid "failure status (%d) on pipe close of `%s' (%s)"
msgstr "afsluitwaarde %d bij mislukte sluiting van pijp '%s' (%s)"
-#: io.c:1072
+#: io.c:1162
#, c-format
msgid "failure status (%d) on file close of `%s' (%s)"
msgstr "afsluitwaarde %d bij mislukte sluiting van bestand '%s' (%s)"
-#: io.c:1092
+#: io.c:1182
#, c-format
msgid "no explicit close of socket `%s' provided"
msgstr "geen expliciete sluiting van socket '%s' aangegeven"
-#: io.c:1095
+#: io.c:1185
#, c-format
msgid "no explicit close of co-process `%s' provided"
msgstr "geen expliciete sluiting van co-proces '%s' aangegeven"
-#: io.c:1098
+#: io.c:1188
#, c-format
msgid "no explicit close of pipe `%s' provided"
msgstr "geen expliciete sluiting van pijp '%s' aangegeven"
-#: io.c:1101
+#: io.c:1191
#, c-format
msgid "no explicit close of file `%s' provided"
msgstr "geen expliciete sluiting van bestand '%s' aangegeven"
-#: io.c:1129 io.c:1184 main.c:797 main.c:834
+#: io.c:1219 io.c:1274 main.c:847 main.c:884
#, c-format
msgid "error writing standard output (%s)"
msgstr "fout tijdens schrijven van standaarduitvoer (%s)"
-#: io.c:1133 io.c:1189
+#: io.c:1223 io.c:1279
#, c-format
msgid "error writing standard error (%s)"
msgstr "fout tijdens schrijven van standaardfoutuitvoer (%s)"
-#: io.c:1141
+#: io.c:1231
#, c-format
msgid "pipe flush of `%s' failed (%s)."
msgstr "leegmaken van pijp '%s' is mislukt (%s)"
-#: io.c:1144
+#: io.c:1234
#, c-format
msgid "co-process flush of pipe to `%s' failed (%s)."
msgstr "leegmaken door co-proces van pijp naar '%s' is mislukt (%s)"
-#: io.c:1147
+#: io.c:1237
#, c-format
msgid "file flush of `%s' failed (%s)."
msgstr "leegmaken van bestand '%s' is mislukt (%s)"
-#: io.c:1262
+#: io.c:1351
#, c-format
msgid "local port %s invalid in `/inet'"
msgstr "lokale poort %s is ongeldig in '/inet'"
-#: io.c:1279
+#: io.c:1369
#, c-format
msgid "remote host and port information (%s, %s) invalid"
msgstr "host- en poortinformatie (%s, %s) zijn ongeldig"
-#: io.c:1431
+#: io.c:1521
#, c-format
msgid "no (known) protocol supplied in special filename `%s'"
msgstr "geen (bekend) protocol aangegeven in speciale bestandsnaam '%s'"
-#: io.c:1445
+#: io.c:1535
#, c-format
msgid "special file name `%s' is incomplete"
msgstr "speciale bestandsnaam '%s' is onvolledig"
-#: io.c:1462
+#: io.c:1552
msgid "must supply a remote hostname to `/inet'"
msgstr "'/inet' heeft een gindse hostnaam nodig"
-#: io.c:1480
+#: io.c:1570
msgid "must supply a remote port to `/inet'"
msgstr "'/inet' heeft een gindse poort nodig"
-#: io.c:1526
+#: io.c:1616
msgid "TCP/IP communications are not supported"
msgstr "TCP/IP-communicatie wordt niet ondersteund"
-#: io.c:1693
+#: io.c:1785
#, c-format
msgid "could not open `%s', mode `%s'"
msgstr "kan '%s' niet openen -- modus '%s'"
-#: io.c:1747
+#: io.c:1835
#, c-format
msgid "close of master pty failed (%s)"
msgstr "kan meester-pty van dochterproces niet sluiten (%s)"
-#: io.c:1749 io.c:1917 io.c:2074
+#: io.c:1837 io.c:2012 io.c:2181
#, c-format
msgid "close of stdout in child failed (%s)"
msgstr "kan standaarduitvoer van dochterproces niet sluiten (%s)"
-#: io.c:1752
+#: io.c:1840
#, c-format
msgid "moving slave pty to stdout in child failed (dup: %s)"
msgstr ""
"kan slaaf-pty niet overzetten naar standaarduitvoer van dochterproces (dup: "
"%s)"
-#: io.c:1754 io.c:1922
+#: io.c:1842 io.c:2017
#, c-format
msgid "close of stdin in child failed (%s)"
msgstr "kan standaardinvoer van dochterproces niet sluiten (%s)"
-#: io.c:1757
+#: io.c:1845
#, c-format
msgid "moving slave pty to stdin in child failed (dup: %s)"
msgstr ""
"kan slaaf-pty niet overzetten naar standaardinvoer van dochterproces (dup: "
"%s)"
-#: io.c:1759 io.c:1780
+#: io.c:1847 io.c:1868
#, c-format
msgid "close of slave pty failed (%s)"
msgstr "kan slaaf-pty niet sluiten (%s)"
-#: io.c:1858 io.c:1920 io.c:2052 io.c:2077
+#: io.c:1953 io.c:2015 io.c:2158 io.c:2184
#, c-format
msgid "moving pipe to stdout in child failed (dup: %s)"
msgstr ""
"kan pijp niet overzetten naar standaarduitvoer van dochterproces (dup: %s)"
-#: io.c:1865 io.c:1925
+#: io.c:1960 io.c:2020
#, c-format
msgid "moving pipe to stdin in child failed (dup: %s)"
msgstr ""
"kan pijp niet overzetten naar standaardinvoer van dochterproces (dup: %s)"
-#: io.c:1885 io.c:2067
+#: io.c:1980 io.c:2174
msgid "restoring stdout in parent process failed\n"
msgstr "kan standaarduitvoer van ouderproces niet herstellen\n"
-#: io.c:1893
+#: io.c:1988
msgid "restoring stdin in parent process failed\n"
msgstr "kan standaardinvoer van ouderproces niet herstellen\n"
-#: io.c:1928 io.c:2079 io.c:2093
+#: io.c:2023 io.c:2186 io.c:2200
#, c-format
msgid "close of pipe failed (%s)"
msgstr "kan pijp niet sluiten (%s)"
-#: io.c:1973
+#: io.c:2076
msgid "`|&' not supported"
msgstr "'|&' wordt niet ondersteund"
-#: io.c:2039
+#: io.c:2143
#, c-format
msgid "cannot open pipe `%s' (%s)"
msgstr "kan pijp '%s' niet openen (%s)"
-#: io.c:2087
+#: io.c:2194
#, c-format
msgid "cannot create child process for `%s' (fork: %s)"
msgstr "kan voor '%s' geen dochterproces starten (fork: %s)"
-#: io.c:2520
+#: io.c:2652
+msgid "register_input_parser: received NULL pointer"
+msgstr ""
+
+#: io.c:2680
+#, c-format
+msgid "input parser `%s' conflicts with previously installed input parser `%s'"
+msgstr ""
+
+#: io.c:2687
+#, c-format
+msgid "input parser `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2707
+msgid "register_output_wrapper: received NULL pointer"
+msgstr ""
+
+#: io.c:2735
+#, c-format
+msgid ""
+"output wrapper `%s' conflicts with previously installed output wrapper `%s'"
+msgstr ""
+
+#: io.c:2742
+#, c-format
+msgid "output wrapper `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2763
+msgid "register_output_processor: received NULL pointer"
+msgstr ""
+
+#: io.c:2792
+#, c-format
+msgid ""
+"two-way processor `%s' conflicts with previously installed two-way processor "
+"`%s'"
+msgstr ""
+
+#: io.c:2801
+#, c-format
+msgid "two way processor `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2908
#, c-format
msgid "data file `%s' is empty"
msgstr "databestand '%s' is leeg"
-#: io.c:2561 io.c:2569
+#: io.c:2950 io.c:2958
msgid "could not allocate more input memory"
msgstr "kan geen extra invoergeheugen meer toewijzen"
-#: io.c:3127
+#: io.c:3524
msgid "multicharacter value of `RS' is a gawk extension"
msgstr "een 'RS' van meerdere tekens is een gawk-uitbreiding"
-#: io.c:3232
+#: io.c:3613
msgid "IPv6 communication is not supported"
msgstr "IPv6-communicatie wordt niet ondersteund"
-#: main.c:366
+#: main.c:362
msgid "`-m[fr]' option irrelevant in gawk"
msgstr "optie '-m[fr]' is irrelevant in gawk"
-#: main.c:368
+#: main.c:364
msgid "-m option usage: `-m[fr] nnn'"
msgstr "gebruikswijze van optie -m: '-m[fr] nnn'"
-#: main.c:391
+#: main.c:393
msgid "empty argument to `-e/--source' ignored"
msgstr "argument van '-e/--source' is leeg; genegeerd"
-#: main.c:462
+#: main.c:483
#, c-format
msgid "%s: option `-W %s' unrecognized, ignored\n"
msgstr "%s: optie '-W %s' is onbekend; genegeerd\n"
-#: main.c:515
+#: main.c:529
#, c-format
msgid "%s: option requires an argument -- %c\n"
msgstr "%s: optie vereist een argument -- %c\n"
-#: main.c:536
+#: main.c:550
msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
msgstr "omgevingsvariabele 'POSIXLY_CORRECT' is gezet: '--posix' ingeschakeld"
-#: main.c:542
+#: main.c:556
msgid "`--posix' overrides `--traditional'"
msgstr "'--posix' overstijgt '--traditional'"
-#: main.c:553
+#: main.c:567
msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
msgstr "'--posix'/'--traditional' overstijgen '--non-decimal-data'"
-#: main.c:557
+#: main.c:571
#, c-format
msgid "running %s setuid root may be a security problem"
msgstr "het uitvoeren van %s als 'setuid root' kan een veiligheidsrisico zijn"
-#: main.c:562
+#: main.c:576
#, fuzzy
msgid "`--posix' overrides `--characters-as-bytes'"
msgstr "'--posix' overstijgt '--binary'"
-#: main.c:616
+#: main.c:635
#, c-format
msgid "can't set binary mode on stdin (%s)"
msgstr "kan standaardinvoer niet in binaire modus zetten (%s)"
-#: main.c:619
+#: main.c:638
#, c-format
msgid "can't set binary mode on stdout (%s)"
msgstr "kan standaarduitvoer niet in binaire modus zetten (%s)"
-#: main.c:621
+#: main.c:640
#, c-format
msgid "can't set binary mode on stderr (%s)"
msgstr "kan standaardfoutuitvoer niet in binaire modus zetten (%s)"
-#: main.c:660
+#: main.c:698
msgid "no program text at all!"
msgstr "helemaal geen programmatekst!"
-#: main.c:737
+#: main.c:784
#, c-format
msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"
msgstr "Gebruik: %s [opties] -f programmabestand [--] bestand...\n"
-#: main.c:739
+#: main.c:786
#, c-format
msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"
msgstr ""
" of: %s [opties] [--] %cprogrammatekst%c bestand...\n"
"\n"
-#: main.c:744
+#: main.c:791
msgid "POSIX options:\t\tGNU long options: (standard)\n"
msgstr "\tPOSIX-opties:\t\tEquivalente GNU-opties: (standaard)\n"
-#: main.c:745
+#: main.c:792
msgid "\t-f progfile\t\t--file=progfile\n"
msgstr "\t-f programmabestand\t--file=programmabestand\n"
-#: main.c:746
+#: main.c:793
msgid "\t-F fs\t\t\t--field-separator=fs\n"
msgstr "\t-F veldscheidingsteken\t--field-separator=veldscheidingsteken\n"
-#: main.c:747
+#: main.c:794
msgid "\t-v var=val\t\t--assign=var=val\n"
msgstr ""
"\t-v var=waarde\t\t--assign=var=waarde\n"
"\n"
-#: main.c:748
+#: main.c:795
msgid "Short options:\t\tGNU long options: (extensions)\n"
msgstr "\tKorte opties:\t\tEquivalente GNU-opties: (uitbreidingen)\n"
-#: main.c:749
+#: main.c:796
msgid "\t-b\t\t\t--characters-as-bytes\n"
msgstr "\t-b\t\t\t--characters-as-bytes\n"
-#: main.c:750
+#: main.c:797
msgid "\t-c\t\t\t--traditional\n"
msgstr "\t-c\t\t\t--traditional\n"
-#: main.c:751
+#: main.c:798
msgid "\t-C\t\t\t--copyright\n"
msgstr "\t-C\t\t\t--copyright\n"
-#: main.c:752
+#: main.c:799
msgid "\t-d[file]\t\t--dump-variables[=file]\n"
msgstr "\t-d[bestand]\t\t--dump-variables[=bestand]\n"
-#: main.c:753
+#: main.c:800
+#, fuzzy
+msgid "\t-D[file]\t\t--debug[=file]\n"
+msgstr "\t-p[bestand]\t\t--profile[=bestand]\n"
+
+#: main.c:801
msgid "\t-e 'program-text'\t--source='program-text'\n"
msgstr "\t-e 'programmatekst'\t--source='programmatekst'\n"
-#: main.c:754
+#: main.c:802
msgid "\t-E file\t\t\t--exec=file\n"
msgstr "\t-E bestand\t\t--exec=bestand\n"
-#: main.c:755
+#: main.c:803
msgid "\t-g\t\t\t--gen-pot\n"
msgstr "\t-g\t\t\t--gen-pot\n"
-#: main.c:756
+#: main.c:804
msgid "\t-h\t\t\t--help\n"
msgstr "\t-h\t\t\t--help\n"
-#: main.c:757
+#: main.c:805
+msgid "\t-i includefile\t\t--include=includefile\n"
+msgstr ""
+
+#: main.c:806
+msgid "\t-l library\t\t--load=library\n"
+msgstr ""
+
+#: main.c:807
msgid "\t-L [fatal]\t\t--lint[=fatal]\n"
msgstr "\t-L [fataal]\t\t--lint[=fataal]\n"
-#: main.c:758
+#: main.c:808
msgid "\t-n\t\t\t--non-decimal-data\n"
msgstr "\t-n\t\t\t--non-decimal-data\n"
-#: main.c:759
+#: main.c:809
+#, fuzzy
+msgid "\t-M\t\t\t--bignum\n"
+msgstr "\t-g\t\t\t--gen-pot\n"
+
+#: main.c:810
msgid "\t-N\t\t\t--use-lc-numeric\n"
msgstr "\t-N\t\t\t--use-lc-numeric\n"
-#: main.c:760
+#: main.c:811
+#, fuzzy
+msgid "\t-o[file]\t\t--pretty-print[=file]\n"
+msgstr "\t-p[bestand]\t\t--profile[=bestand]\n"
+
+#: main.c:812
msgid "\t-O\t\t\t--optimize\n"
msgstr "\t-O\t\t\t--optimize\n"
-#: main.c:761
+#: main.c:813
msgid "\t-p[file]\t\t--profile[=file]\n"
msgstr "\t-p[bestand]\t\t--profile[=bestand]\n"
-#: main.c:762
+#: main.c:814
msgid "\t-P\t\t\t--posix\n"
msgstr "\t-P\t\t\t--posix\n"
-#: main.c:763
+#: main.c:815
msgid "\t-r\t\t\t--re-interval\n"
msgstr "\t-r\t\t\t--re-interval\n"
-#: main.c:765
-msgid "\t-R file\t\t\t--command=file\n"
-msgstr "\t-R bestand\t\t\t--command=bestand\n"
-
-#: main.c:766
+#: main.c:816
msgid "\t-S\t\t\t--sandbox\n"
msgstr "\t-S\t\t\t--sandbox\n"
-#: main.c:767
+#: main.c:817
msgid "\t-t\t\t\t--lint-old\n"
msgstr "\t-t\t\t\t--lint-old\n"
-#: main.c:768
+#: main.c:818
msgid "\t-V\t\t\t--version\n"
msgstr "\t-V\t\t\t--version\n"
-#: main.c:770
+#: main.c:820
msgid "\t-W nostalgia\t\t--nostalgia\n"
msgstr "\t-W nostalgia\t\t\t--nostalgia\n"
-#: main.c:773
+#: main.c:823
msgid "\t-Y\t\t--parsedebug\n"
msgstr "\t-Y\t\t\t--parsedebug\n"
@@ -1811,7 +2950,7 @@ msgstr "\t-Y\t\t\t--parsedebug\n"
#. for this application. Please add _another line_ with the
#. address for translation bugs.
#. no-wrap
-#: main.c:782
+#: main.c:832
msgid ""
"\n"
"To report bugs, see node `Bugs' in `gawk.info', which is\n"
@@ -1824,7 +2963,7 @@ msgstr ""
"Meld fouten in de vertaling aan <vertaling@vrijschrift.org>.\n"
"\n"
-#: main.c:786
+#: main.c:836
msgid ""
"gawk is a pattern scanning and processing language.\n"
"By default it reads standard input and writes standard output.\n"
@@ -1834,7 +2973,7 @@ msgstr ""
"Standaard leest het van standaardinvoer en schrijft naar standaarduitvoer.\n"
"\n"
-#: main.c:790
+#: main.c:840
msgid ""
"Examples:\n"
"\tgawk '{ sum += $1 }; END { print sum }' file\n"
@@ -1844,7 +2983,7 @@ msgstr ""
"\tgawk '{ som += $1 }; END { print som }' bestand\n"
"\tgawk -F: '{ print $1 }' /etc/passwd\n"
-#: main.c:810
+#: main.c:860
#, c-format
msgid ""
"Copyright (C) 1989, 1991-%d Free Software Foundation.\n"
@@ -1862,7 +3001,7 @@ msgstr ""
"uitgegeven door de Free Software Foundation, naar keuze ofwel onder\n"
"versie 3 of onder een nieuwere versie van die licentie.\n"
-#: main.c:818
+#: main.c:868
msgid ""
"This program is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
@@ -1876,7 +3015,7 @@ msgstr ""
"Zie de GNU General Public License voor meer details.\n"
"\n"
-#: main.c:824
+#: main.c:874
msgid ""
"You should have received a copy of the GNU General Public License\n"
"along with this program. If not, see http://www.gnu.org/licenses/.\n"
@@ -1885,16 +3024,16 @@ msgstr ""
"ontvangen te hebben; is dit niet het geval, dan kunt u deze licentie\n"
"ook vinden op http://www.gnu.org/licenses/.\n"
-#: main.c:859
+#: main.c:909
msgid "-Ft does not set FS to tab in POSIX awk"
msgstr "-Ft maakt van FS geen tab in POSIX-awk"
-#: main.c:1093
+#: main.c:1169
#, c-format
msgid "unknown value for field spec: %d\n"
msgstr "onbekende waarde voor veldspecificatie: %d\n"
-#: main.c:1174
+#: main.c:1267
#, c-format
msgid ""
"%s: `%s' argument to `-v' not in `var=value' form\n"
@@ -1903,79 +3042,145 @@ msgstr ""
"%s: argument '%s' van '-v' is niet van de vorm 'var=waarde'\n"
"\n"
-#: main.c:1200
+#: main.c:1293
#, c-format
msgid "`%s' is not a legal variable name"
msgstr "'%s' is geen geldige variabelenaam"
-#: main.c:1203
+#: main.c:1296
#, c-format
msgid "`%s' is not a variable name, looking for file `%s=%s'"
msgstr "'%s' is geen variabelenaam; zoekend naar bestand '%s=%s'"
-#: main.c:1207
+#: main.c:1300
#, c-format
msgid "cannot use gawk builtin `%s' as variable name"
msgstr "kan in gawk ingebouwde '%s' niet als variabelenaam gebruiken"
-#: main.c:1212
+#: main.c:1305
#, c-format
msgid "cannot use function `%s' as variable name"
msgstr "kan functie '%s' niet als variabelenaam gebruiken"
-#: main.c:1265
+#: main.c:1358
msgid "floating point exception"
msgstr "drijvendekomma-berekeningsfout"
-#: main.c:1272
+#: main.c:1365
msgid "fatal error: internal error"
msgstr "fatale fout: **interne fout**"
-#: main.c:1287
+#: main.c:1380
msgid "fatal error: internal error: segfault"
msgstr "fatale fout: **interne fout**: segmentatiefout"
-#: main.c:1299
+#: main.c:1392
msgid "fatal error: internal error: stack overflow"
msgstr "fatale fout: **interne fout**: stack is vol"
-#: main.c:1349
+#: main.c:1448
#, c-format
msgid "no pre-opened fd %d"
msgstr "geen reeds-geopende bestandsdescriptor %d"
-#: main.c:1356
+#: main.c:1455
#, c-format
msgid "could not pre-open /dev/null for fd %d"
msgstr "kan /dev/null niet openen voor bestandsdescriptor %d"
-#: msg.c:63
+#: mpfr.c:563
+#, fuzzy, c-format
+msgid "PREC value `%.*s' is invalid"
+msgstr "BINMODE-waarde '%s' is ongeldig, wordt behandeld als 3"
+
+#: mpfr.c:621
+#, fuzzy, c-format
+msgid "RNDMODE value `%.*s' is invalid"
+msgstr "BINMODE-waarde '%s' is ongeldig, wordt behandeld als 3"
+
+#: mpfr.c:711
+#, fuzzy, c-format
+msgid "%s: received non-numeric argument"
+msgstr "cos: argument is geen getal"
+
+#: mpfr.c:813
+#, fuzzy
+msgid "compl(%Rg): negative value will give strange results"
+msgstr "compl(%lf): negatieve waarden geven rare resultaten"
+
+#: mpfr.c:817
+#, fuzzy
+msgid "comp(%Rg): fractional value will be truncated"
+msgstr "compl(%lf): cijfers na de komma worden afgekapt"
+
+#: mpfr.c:829
+#, fuzzy, c-format
+msgid "cmpl(%Zd): negative values will give strange results"
+msgstr "compl(%lf): negatieve waarden geven rare resultaten"
+
+#: mpfr.c:856
+#, fuzzy, c-format
+msgid "%s: received non-numeric first argument"
+msgstr "or: eerste argument is geen getal"
+
+#: mpfr.c:858
+#, fuzzy, c-format
+msgid "%s: received non-numeric second argument"
+msgstr "or: tweede argument is geen getal"
+
+#: mpfr.c:877
+#, fuzzy
+msgid "%s(%Rg, ..): negative values will give strange results"
+msgstr "or(%lf, %lf): negatieve waarden geven rare resultaten"
+
+#: mpfr.c:882
+#, fuzzy
+msgid "%s(%Rg, ..): fractional values will be truncated"
+msgstr "or(%lf, %lf): cijfers na de komma worden afgekapt"
+
+#: mpfr.c:895
+#, fuzzy, c-format
+msgid "%s(%Zd, ..): negative values will give strange results"
+msgstr "or(%lf, %lf): negatieve waarden geven rare resultaten"
+
+#: mpfr.c:914
+#, fuzzy
+msgid "%s(.., %Rg): negative values will give strange results"
+msgstr "or(%lf, %lf): negatieve waarden geven rare resultaten"
+
+#: mpfr.c:919
+#, fuzzy
+msgid "%s(.., %Rg): fractional values will be truncated"
+msgstr "or(%lf, %lf): cijfers na de komma worden afgekapt"
+
+#: mpfr.c:932
+#, fuzzy, c-format
+msgid "%s(.., %Zd): negative values will give strange results"
+msgstr "or(%lf, %lf): negatieve waarden geven rare resultaten"
+
+#: msg.c:61
#, c-format
msgid "cmd. line:"
msgstr "commandoregel:"
-#: msg.c:107
-msgid "error: "
-msgstr "fout: "
-
-#: node.c:406
+#: node.c:436
msgid "backslash at end of string"
msgstr "backslash aan het einde van de string"
-#: node.c:517
+#: node.c:520
#, c-format
msgid "old awk does not support the `\\%c' escape sequence"
msgstr "oude 'awk' kent de stuurcodereeks '\\%c' niet"
-#: node.c:568
+#: node.c:571
msgid "POSIX does not allow `\\x' escapes"
msgstr "POSIX staat stuurcode '\\x' niet toe"
-#: node.c:574
+#: node.c:577
msgid "no hex digits in `\\x' escape sequence"
msgstr "geen hex cijfers in stuurcodereeks '\\x'"
-#: node.c:596
+#: node.c:599
#, c-format
msgid ""
"hex escape \\x%.*s of %d characters probably not interpreted the way you "
@@ -1984,12 +3189,12 @@ msgstr ""
"hexadecimale stuurcode \\x%.*s van %d tekens wordt waarschijnlijk niet "
"afgehandeld zoals u verwacht"
-#: node.c:611
+#: node.c:614
#, c-format
msgid "escape sequence `\\%c' treated as plain `%c'"
msgstr "stuurcodereeks '\\%c' behandeld als normale '%c'"
-#: node.c:750
+#: node.c:759
msgid ""
"Invalid multibyte data detected. There may be a mismatch between your data "
"and your locale."
@@ -1997,28 +3202,28 @@ msgstr ""
"Ongeldige multibyte-gegevens gevonden.\n"
"Uw gegevens passen vermoedelijk niet bij uw taalregio."
-#: posix/gawkmisc.c:176
+#: posix/gawkmisc.c:177
#, c-format
msgid "%s %s `%s': could not get fd flags: (fcntl F_GETFD: %s)"
msgstr ""
"%s %s '%s': kan bestandsdescriptorvlaggen niet verkrijgen: (fcntl F_GETFD: "
"%s)"
-#: posix/gawkmisc.c:188
+#: posix/gawkmisc.c:189
#, c-format
msgid "%s %s `%s': could not set close-on-exec: (fcntl F_SETFD: %s)"
msgstr "%s %s '%s': kan 'close-on-exec' niet activeren: (fcntl F_SETFD: %s)"
-#: profile.c:83
+#: profile.c:70
#, c-format
msgid "could not open `%s' for writing: %s"
msgstr "kan '%s' niet openen om te schrijven: %s"
-#: profile.c:85
+#: profile.c:72
msgid "sending profile to standard error"
msgstr "profiel gaat naar standaardfoutuitvoer"
-#: profile.c:203
+#: profile.c:188
#, c-format
msgid ""
"\t# %s block(s)\n"
@@ -2027,7 +3232,7 @@ msgstr ""
"\t# %s-blok(ken)\n"
"\n"
-#: profile.c:208
+#: profile.c:193
#, c-format
msgid ""
"\t# Rule(s)\n"
@@ -2036,17 +3241,22 @@ msgstr ""
"\t# Regel(s)\n"
"\n"
-#: profile.c:279
+#: profile.c:267
#, c-format
msgid "internal error: %s with null vname"
msgstr "**interne fout**: %s heeft een lege 'vname'"
-#: profile.c:952
+#: profile.c:529
+#, fuzzy
+msgid "internal error: builtin with null fname"
+msgstr "**interne fout**: %s heeft een lege 'vname'"
+
+#: profile.c:944
#, c-format
msgid "\t# gawk profile, created %s\n"
msgstr "\t# gawk-profiel, gemaakt op %s\n"
-#: profile.c:1331
+#: profile.c:1329
#, c-format
msgid ""
"\n"
@@ -2055,19 +3265,19 @@ msgstr ""
"\n"
"\t# Functies, alfabetisch geordend\n"
-#: profile.c:1370
+#: profile.c:1367
#, c-format
msgid "redir2str: unknown redirection type %d"
msgstr "redir2str(): onbekend omleidingstype %d"
-#: re.c:573
+#: re.c:568
#, c-format
msgid "range of the form `[%c-%c]' is locale dependent"
msgstr ""
"de betekenis van een bereik van de vorm '[%c-%c]' is afhankelijk van de "
"taalregio"
-#: re.c:600
+#: re.c:595
#, c-format
msgid "regexp component `%.*s' should probably be `[%.*s]'"
msgstr ""
@@ -2113,10 +3323,6 @@ msgstr "Ongepaarde ( of \\("
msgid "Unmatched \\{"
msgstr "Ongepaarde \\{"
-#: regcomp.c:161
-msgid "Invalid content of \\{\\}"
-msgstr "Ongeldige inhoud van \\{\\}"
-
#: regcomp.c:164
msgid "Invalid range end"
msgstr "Ongeldig bereikeinde"
@@ -2133,10 +3339,6 @@ msgstr "Ongeldige voorafgaande reguliere expressie"
msgid "Premature end of regular expression"
msgstr "Voortijdig einde van reguliere expressie"
-#: regcomp.c:176
-msgid "Regular expression too big"
-msgstr "Reguliere expressie is te groot"
-
#: regcomp.c:179
msgid "Unmatched ) or \\)"
msgstr "Ongepaarde ) of \\)"
@@ -2145,12 +3347,100 @@ msgstr "Ongepaarde ) of \\)"
msgid "No previous regular expression"
msgstr "Geen eerdere reguliere expressie"
+#: symbol.c:722
+msgid "can not pop main context"
+msgstr ""
+
#~ msgid "`nextfile' is a gawk extension"
#~ msgstr "'nextfile' is een gawk-uitbreiding"
#~ msgid "`delete array' is a gawk extension"
#~ msgstr "'delete array' is een gawk-uitbreiding"
+#~ msgid "and: received non-numeric first argument"
+#~ msgstr "and: eerste argument is geen getal"
+
+#~ msgid "and: received non-numeric second argument"
+#~ msgstr "and: tweede argument is geen getal"
+
+#~ msgid "and(%lf, %lf): fractional values will be truncated"
+#~ msgstr "and(%lf, %lf): cijfers na de komma worden afgekapt"
+
+#~ msgid "xor: received non-numeric first argument"
+#~ msgstr "xor: eerste argument is geen getal"
+
+#~ msgid "xor: received non-numeric second argument"
+#~ msgstr "xor: tweede argument is geen getal"
+
+#~ msgid "xor(%lf, %lf): fractional values will be truncated"
+#~ msgstr "xor(%lf, %lf): cijfers na de komma worden afgekapt"
+
+#~ msgid "`extension' is a gawk extension"
+#~ msgstr "'extension' is een gawk-uitbreiding"
+
+#~ msgid "Operation Not Supported"
+#~ msgstr "Actie wordt niet ondersteund"
+
+#~ msgid "attempt to use function `%s' as an array"
+#~ msgstr "functie '%s' wordt gebruikt als array"
+
+#~ msgid "reference to uninitialized element `%s[\"%.*s\"]'"
+#~ msgstr "verwijzing naar ongeïnitialiseerd element '%s[\"%.*s\"]'"
+
+#~ msgid "subscript of array `%s' is null string"
+#~ msgstr "index van array '%s' is lege string"
+
+#~ msgid "%s: empty (null)\n"
+#~ msgstr "%s: leeg (nil)\n"
+
+#~ msgid "%s: empty (zero)\n"
+#~ msgstr "%s: leeg (nul)\n"
+
+#~ msgid "%s: table_size = %d, array_size = %d\n"
+#~ msgstr "%s: tabelgrootte = %d, arraygrootte = %d\n"
+
+#~ msgid "%s: array_ref to %s\n"
+#~ msgstr "%s: array-verwijzing naar %s\n"
+
+#~ msgid "use of non-array as array"
+#~ msgstr "non-array wordt gebruikt als array"
+
+#~ msgid "can't use function name `%s' as variable or array"
+#~ msgstr "kan functienaam '%s' niet als variabele of array gebruiken"
+
+#~ msgid "assignment used in conditional context"
+#~ msgstr "toewijzing wordt gebruikt in een conditionele context"
+
+#~ msgid "statement has no effect"
+#~ msgstr "opdracht heeft geen effect"
+
+#~ msgid ""
+#~ "for loop: array `%s' changed size from %ld to %ld during loop execution"
+#~ msgstr ""
+#~ "for: array '%s' veranderde van grootte %ld naar %ld tijdens uitvoer van "
+#~ "de lus"
+
+#~ msgid "function called indirectly through `%s' does not exist"
+#~ msgstr "indirect (via '%s') aangeroepen functie bestaat niet"
+
+#~ msgid "function `%s' not defined"
+#~ msgstr "functie '%s' is niet gedefinieerd"
+
+#~ msgid "non-redirected `getline' invalid inside `%s' rule"
+#~ msgstr "niet-omgeleide 'getline' is ongeldig binnen een '%s'-regel"
+
+#~ msgid "`nextfile' cannot be called from a `%s' rule"
+#~ msgstr "'nextfile' kan niet aangeroepen worden in een '%s'-regel"
+
+#~ msgid "`next' cannot be called from a `%s' rule"
+#~ msgstr "'next' kan niet aangeroepen worden in een '%s'-regel"
+
+#~ msgid "Sorry, don't know how to interpret `%s'"
+#~ msgstr "Kan '%s' niet interpreteren"
+
+#~ msgid "\t-R file\t\t\t--command=file\n"
+#~ msgstr "\t-R bestand\t\t\t--command=bestand\n"
+
#~ msgid "could not find groups: %s"
#~ msgstr "kan groepen niet vinden: %s"
@@ -2170,9 +3460,6 @@ msgstr "Geen eerdere reguliere expressie"
#~ msgid "attempt to use scalar `%s' as array"
#~ msgstr "scalair '%s' wordt gebruikt als array"
-#~ msgid "attempt to use array `%s' in scalar context"
-#~ msgstr "array '%s' wordt gebruikt in een scalaire context"
-
#~ msgid "call of `length' without parentheses is deprecated by POSIX"
#~ msgstr "aanroep van 'length' zonder haakjes wordt door POSIX afgeraden"
diff --git a/po/pl.gmo b/po/pl.gmo
index 3823e48b..c314f488 100644
--- a/po/pl.gmo
+++ b/po/pl.gmo
Binary files differ
diff --git a/po/pl.po b/po/pl.po
index f25dce4c..84f3f4d9 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gawk 4.0.0h\n"
"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
-"POT-Creation-Date: 2012-10-13 20:24+0200\n"
+"POT-Creation-Date: 2012-10-13 21:21+0200\n"
"PO-Revision-Date: 2012-02-04 19:17+0100\n"
"Last-Translator: Wojciech Polak <polak@gnu.org>\n"
"Language-Team: Polish <translation-team-pl@lists.sourceforge.net>\n"
@@ -20,506 +20,497 @@ msgstr ""
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2);\n"
-#: array.c:140
+#: array.c:266
#, c-format
msgid "from %s"
msgstr "od %s"
-#: array.c:248
+#: array.c:366
msgid "attempt to use a scalar value as array"
msgstr "próba użycia wartości skalarnej jako tablicy"
-#: array.c:251
-#, c-format
-msgid "attempt to use function `%s' as an array"
-msgstr "próba użycia funkcji `%s' jako tablicy"
-
-#: array.c:254
+#: array.c:368
#, c-format
msgid "attempt to use scalar parameter `%s' as an array"
msgstr "próba użycia parametru `%s' skalaru jako tablicy"
-#: array.c:257
+#: array.c:371
#, c-format
msgid "attempt to use scalar `%s' as an array"
msgstr "próba użycia skalaru `%s' jako tablicy"
-#: array.c:302 array.c:707 builtin.c:84 builtin.c:1385 builtin.c:1427
-#: builtin.c:1440 builtin.c:1859 builtin.c:1871 eval.c:1135 eval.c:1139
-#: eval.c:1495 eval.c:1812
+#: array.c:418 array.c:584 builtin.c:85 builtin.c:1566 builtin.c:1608
+#: builtin.c:1621 builtin.c:2047 builtin.c:2059 eval.c:1121 eval.c:1125
+#: eval.c:1520
#, c-format
msgid "attempt to use array `%s' in a scalar context"
msgstr "próba użycia tablicy `%s' w kontekście skalaru"
-#: array.c:513
-#, c-format
-msgid "reference to uninitialized element `%s[\"%.*s\"]'"
-msgstr "odwołanie do niezainicjowanego elementu `%s[\"%.*s\"]'"
-
-#: array.c:519
-#, c-format
-msgid "subscript of array `%s' is null string"
-msgstr "indeks tablicy `%s' jest zerowym łańcuchem"
-
-#: array.c:723
+#: array.c:591
#, c-format
msgid "delete: index `%s' not in array `%s'"
msgstr "delete: indeks `%s' nie jest w tablicy `%s'"
-#: array.c:734 eval.c:1865
+#: array.c:605
#, c-format
msgid "attempt to use scalar `%s[\"%.*s\"]' as an array"
msgstr "próba użycia skalaru `%s[\"%.*s\"]' jako tablicy"
-#: array.c:910
-#, c-format
-msgid "%s: empty (null)\n"
-msgstr "%s: pusty (null)\n"
-
-#: array.c:915
-#, c-format
-msgid "%s: empty (zero)\n"
-msgstr "%s: pusty (zero)\n"
-
-#: array.c:919
-#, c-format
-msgid "%s: table_size = %d, array_size = %d\n"
-msgstr "%s: table_size = %d, array_size = %d\n"
-
-#: array.c:954
-#, c-format
-msgid "%s: is parameter\n"
-msgstr "%s: jest parametrem\n"
-
-#: array.c:958
-#, c-format
-msgid "%s: array_ref to %s\n"
-msgstr "%s: array_ref do %s\n"
-
-#: array.c:963
-msgid "adump: argument not an array"
+#: array.c:784
+#, fuzzy
+msgid "adump: first argument not an array"
msgstr "adump: argument nie jest tablicÄ…"
-#: array.c:1086
+#: array.c:823
msgid "asort: second argument not an array"
msgstr "asort: drugi argument nie jest tablicÄ…"
-#: array.c:1087
+#: array.c:824
msgid "asorti: second argument not an array"
msgstr "asorti: drugi argument nie jest tablicÄ…"
-#: array.c:1094
+#: array.c:831
msgid "asort: first argument not an array"
msgstr "asort: pierwszy argument nie jest tablicÄ…"
-#: array.c:1095
+#: array.c:832
msgid "asorti: first argument not an array"
msgstr "asorti: pierwszy argument nie jest tablicÄ…"
-#: array.c:1102
+#: array.c:839
msgid "asort: cannot use a subarray of first arg for second arg"
msgstr ""
"asort: nie można użyć podtablicy pierwszego argumentu dla drugiego argumentu"
-#: array.c:1103
+#: array.c:840
msgid "asorti: cannot use a subarray of first arg for second arg"
msgstr ""
"asorti: nie można użyć podtablicy pierwszego argumentu dla drugiego argumentu"
-#: array.c:1108
+#: array.c:845
msgid "asort: cannot use a subarray of second arg for first arg"
msgstr ""
"asort: nie można użyć podtablicy drugiego argumentu dla pierwszego argumentu"
-#: array.c:1109
+#: array.c:846
msgid "asorti: cannot use a subarray of second arg for first arg"
msgstr ""
"asorti: nie można użyć podtablicy drugiego argumentu dla pierwszego argumentu"
-#: array.c:1655
+#: array.c:1314
#, c-format
msgid "`%s' is invalid as a function name"
msgstr "nieprawidłowa nazwa funkcji `%s'"
-#: array.c:1659
+#: array.c:1318
#, c-format
msgid "sort comparison function `%s' is not defined"
msgstr "funkcja porównująca w sortowaniu `%s' nie została zdefiniowna"
-#: awkgram.y:249
+#: awkgram.y:223
#, c-format
msgid "%s blocks must have an action part"
msgstr "%s bloków musi posiadać część dotyczącą akcji"
-#: awkgram.y:252
+#: awkgram.y:226
msgid "each rule must have a pattern or an action part"
msgstr "każda reguła musi posiadać wzorzec lub część dotyczącą akcji"
-#: awkgram.y:323 awkgram.y:334
+#: awkgram.y:315 awkgram.y:326
msgid "old awk does not support multiple `BEGIN' or `END' rules"
msgstr "stary awk nie wspiera wielokrotnych reguł `BEGIN' lub `END'"
-#: awkgram.y:371
+#: awkgram.y:363
#, c-format
msgid "`%s' is a built-in function, it cannot be redefined"
msgstr ""
"`%s' jest funkcją wbudowaną, więc nie może zostać ponownie zdefiniowana"
-#: awkgram.y:432
+#: awkgram.y:409
msgid "regexp constant `//' looks like a C++ comment, but is not"
msgstr ""
"stałe wyrażenie regularne `//' wygląda jak komentarz C++, ale nim nie jest"
-#: awkgram.y:436
+#: awkgram.y:413
#, c-format
msgid "regexp constant `/%s/' looks like a C comment, but is not"
msgstr ""
"stałe wyrażenie regularne `/%s/' wygląda jak komentarz C, ale nim nie jest"
-#: awkgram.y:528
+#: awkgram.y:505
#, c-format
msgid "duplicate case values in switch body: %s"
msgstr "powielone wartości case w ciele switch: %s"
-#: awkgram.y:549
+#: awkgram.y:526
msgid "duplicate `default' detected in switch body"
msgstr "wykryto powielony `default' w ciele switch"
-#: awkgram.y:809
+#: awkgram.y:786
msgid "`break' is not allowed outside a loop or switch"
msgstr "instrukcja `break' poza pętlą lub switch'em jest niedozwolona"
-#: awkgram.y:818
+#: awkgram.y:795
msgid "`continue' is not allowed outside a loop"
msgstr "instrukcja `continue' poza pętlą jest niedozwolona"
-#: awkgram.y:828
+#: awkgram.y:805
#, c-format
msgid "`next' used in %s action"
msgstr "`next' użyty w akcji %s"
-#: awkgram.y:837
+#: awkgram.y:814
#, c-format
msgid "`nextfile' used in %s action"
msgstr "`nextfile' użyty w akcji %s"
-#: awkgram.y:861
+#: awkgram.y:838
msgid "`return' used outside function context"
msgstr "`return' użyty poza kontekstem funkcji"
-#: awkgram.y:921
+#: awkgram.y:912
msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'"
msgstr ""
"zwykły `print' w regułach BEGIN lub END powinien prawdopodobnie być jako "
"`print \"\"'"
-#: awkgram.y:1016 awkgram.y:1020
+#: awkgram.y:978 awkgram.y:1027
+msgid "`delete' is not allowed with SYMTAB"
+msgstr ""
+
+#: awkgram.y:980 awkgram.y:1029
+msgid "`delete' is not allowed with FUNCTAB"
+msgstr ""
+
+#: awkgram.y:1014 awkgram.y:1018
msgid "`delete(array)' is a non-portable tawk extension"
msgstr "`delete(tablica)' jest nieprzenośnym rozszerzeniem tawk"
-#: awkgram.y:1132
+#: awkgram.y:1139
msgid "multistage two-way pipelines don't work"
msgstr "wieloetapowe dwukierunkowe linie potokowe nie działają"
-#: awkgram.y:1235
+#: awkgram.y:1242
msgid "regular expression on right of assignment"
msgstr "wyrażanie regularne po prawej stronie przypisania"
-#: awkgram.y:1246
+#: awkgram.y:1253
msgid "regular expression on left of `~' or `!~' operator"
msgstr "wyrażenie regularne po lewej stronie operatora `~' lub `!~'"
-#: awkgram.y:1262 awkgram.y:1416
+#: awkgram.y:1269 awkgram.y:1420
msgid "old awk does not support the keyword `in' except after `for'"
msgstr ""
"stary awk nie wspiera słowa kluczowego `in', z wyjątkiem po słowie `for'"
-#: awkgram.y:1272
+#: awkgram.y:1279
msgid "regular expression on right of comparison"
msgstr "wyrażenie regularne po prawej stronie porównania"
-#: awkgram.y:1391
+#: awkgram.y:1395
#, c-format
msgid "`getline var' invalid inside `%s' rule"
msgstr "nieprawidłowy `getline var' wewnątrz reguły `%s'"
-#: awkgram.y:1394 eval.c:2504
+#: awkgram.y:1398
#, c-format
msgid "`getline' invalid inside `%s' rule"
msgstr "nieprawidłowy `getline' wewnątrz reguły `%s'"
-#: awkgram.y:1399
+#: awkgram.y:1403
msgid "non-redirected `getline' undefined inside END action"
msgstr ""
"komenda `getline' bez przekierowania nie jest zdefiniowana wewnÄ…trz akcji END"
-#: awkgram.y:1418
+#: awkgram.y:1422
msgid "old awk does not support multidimensional arrays"
msgstr "stary awk nie wspiera wielowymiarowych tablic"
-#: awkgram.y:1514
+#: awkgram.y:1519
msgid "call of `length' without parentheses is not portable"
msgstr "wywołanie `length' bez nawiasów jest nieprzenośne"
-#: awkgram.y:1577
+#: awkgram.y:1585
msgid "indirect function calls are a gawk extension"
msgstr "pośrednie wywołania funkcji są rozszerzeniem gawk"
-#: awkgram.y:1590
+#: awkgram.y:1598
#, c-format
msgid "can not use special variable `%s' for indirect function call"
msgstr ""
"nie można użyć specjalnej zmiennej `%s' do pośredniego wywołania funkcji"
-#: awkgram.y:1668
+#: awkgram.y:1676
msgid "invalid subscript expression"
msgstr "nieprawidłowe wyrażenie indeksowe"
-#: awkgram.y:1708
-msgid "use of non-array as array"
-msgstr "użycie nie-tablicy jako tablicy"
-
-#: awkgram.y:1972 awkgram.y:1992 msg.c:98
+#: awkgram.y:2000 awkgram.y:2020 gawkapi.c:203 gawkapi.c:221 msg.c:119
msgid "warning: "
msgstr "ostrzeżenie: "
-#: awkgram.y:1990 msg.c:130
+#: awkgram.y:2018 gawkapi.c:189 gawkapi.c:218 msg.c:151
msgid "fatal: "
msgstr "fatalny błąd: "
-#: awkgram.y:2040
+#: awkgram.y:2068
msgid "unexpected newline or end of string"
msgstr "niespodziewany znak nowego wiersza lub końca łańcucha"
-#: awkgram.y:2297 awkgram.y:2355 awkgram.y:2539
+#: awkgram.y:2335 awkgram.y:2411 awkgram.y:2634 debug.c:517 debug.c:533
+#: debug.c:2790 debug.c:5038
#, c-format
msgid "can't open source file `%s' for reading (%s)"
msgstr "nie można otworzyć pliku źródłowego `%s' do czytania (%s)"
-#: awkgram.y:2298 awkgram.y:2356 builtin.c:122
+#: awkgram.y:2336 awkgram.y:2461
+#, fuzzy, c-format
+msgid "can't open shared library `%s' for reading (%s)"
+msgstr "nie można otworzyć pliku źródłowego `%s' do czytania (%s)"
+
+#: awkgram.y:2338 awkgram.y:2412 awkgram.y:2462 builtin.c:130 debug.c:5189
msgid "reason unknown"
msgstr "nieznany powód"
-#: awkgram.y:2314
+#: awkgram.y:2347 awkgram.y:2371
+#, c-format
+msgid "can't include `%s' and use it as a program file"
+msgstr ""
+
+#: awkgram.y:2360
#, c-format
msgid "already included source file `%s'"
msgstr "plik źródłowy `%s' jest już załączony"
-#: awkgram.y:2340
+#: awkgram.y:2361
+#, fuzzy, c-format
+msgid "already loaded shared library `%s'"
+msgstr "plik źródłowy `%s' jest już załączony"
+
+#: awkgram.y:2396
msgid "@include is a gawk extension"
msgstr "@include jest rozszerzeniem gawk"
-#: awkgram.y:2346
+#: awkgram.y:2402
msgid "empty filename after @include"
msgstr "pusta nazwa pliku po @include"
-#: awkgram.y:2491
+#: awkgram.y:2446
+#, fuzzy
+msgid "@load is a gawk extension"
+msgstr "@include jest rozszerzeniem gawk"
+
+#: awkgram.y:2452
+#, fuzzy
+msgid "empty filename after @load"
+msgstr "pusta nazwa pliku po @include"
+
+#: awkgram.y:2586
msgid "empty program text on command line"
msgstr "pusty tekst programu w linii poleceń"
-#: awkgram.y:2606
+#: awkgram.y:2701
#, c-format
msgid "can't read sourcefile `%s' (%s)"
msgstr "nie można otworzyć pliku źródłowego `%s' (%s)"
-#: awkgram.y:2617
+#: awkgram.y:2712
#, c-format
msgid "source file `%s' is empty"
msgstr "plik źródłowy `%s' jest pusty"
-#: awkgram.y:2794
+#: awkgram.y:2889
msgid "source file does not end in newline"
msgstr "plik źródłowy nie posiada na końcu znaku nowego wiersza"
-#: awkgram.y:2897
+#: awkgram.y:2994
msgid "unterminated regexp ends with `\\' at end of file"
msgstr ""
"niezakończone prawidłowo wyrażenie regularne kończy się znakiem `\\' na "
"końcu pliku"
-#: awkgram.y:2921
+#: awkgram.y:3018
#, c-format
msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk"
msgstr ""
"%s: %d: modyfikator wyrażenia regularnego `/.../%c' tawk nie działa w gawk"
-#: awkgram.y:2925
+#: awkgram.y:3022
#, c-format
msgid "tawk regex modifier `/.../%c' doesn't work in gawk"
msgstr "modyfikator wyrażenia regularnego `/.../%c' tawk nie działa w gawk"
-#: awkgram.y:2932
+#: awkgram.y:3029
msgid "unterminated regexp"
msgstr "niezakończone wyrażenie regularne"
-#: awkgram.y:2936
+#: awkgram.y:3033
msgid "unterminated regexp at end of file"
msgstr "niezakończone wyrażenie regularne na końcu pliku"
-#: awkgram.y:2995
+#: awkgram.y:3092
msgid "use of `\\ #...' line continuation is not portable"
msgstr "użycie `\\ #...' kontynuacji linii nie jest przenośne"
-#: awkgram.y:3011
+#: awkgram.y:3108
msgid "backslash not last character on line"
msgstr "backslash nie jest ostatnim znakiem w wierszu"
-#: awkgram.y:3072
+#: awkgram.y:3169
msgid "POSIX does not allow operator `**='"
msgstr "POSIX nie zezwala na operator `**='"
-#: awkgram.y:3074
+#: awkgram.y:3171
msgid "old awk does not support operator `**='"
msgstr "stary awk nie wspiera operatora `**='"
-#: awkgram.y:3083
+#: awkgram.y:3180
msgid "POSIX does not allow operator `**'"
msgstr "POSIX nie zezwala na operator `**'"
-#: awkgram.y:3085
+#: awkgram.y:3182
msgid "old awk does not support operator `**'"
msgstr "stary awk nie wspiera operatora `**'"
-#: awkgram.y:3120
+#: awkgram.y:3217
msgid "operator `^=' is not supported in old awk"
msgstr "operator `^=' nie jest wspierany w starym awk"
-#: awkgram.y:3128
+#: awkgram.y:3225
msgid "operator `^' is not supported in old awk"
msgstr "operator `^' nie jest wspierany w starym awk"
-#: awkgram.y:3221 awkgram.y:3237
+#: awkgram.y:3318 awkgram.y:3334 command.y:1178
msgid "unterminated string"
msgstr "niezakończony łańcuch"
-#: awkgram.y:3433
+#: awkgram.y:3555
#, c-format
msgid "invalid char '%c' in expression"
msgstr "nieprawidłowy znak '%c' w wyrażeniu"
-#: awkgram.y:3480
+#: awkgram.y:3602
#, c-format
msgid "`%s' is a gawk extension"
msgstr "`%s' jest rozszerzeniem gawk"
-#: awkgram.y:3485
+#: awkgram.y:3607
#, c-format
msgid "`%s' is a Bell Labs extension"
msgstr "`%s' jest rozszerzeniem Bell Labs"
-#: awkgram.y:3490
+#: awkgram.y:3612
#, c-format
msgid "POSIX does not allow `%s'"
msgstr "POSIX nie zezwala na `%s'"
-#: awkgram.y:3498
+#: awkgram.y:3620
#, c-format
msgid "`%s' is not supported in old awk"
msgstr "`%s' nie jest wspierany w starym awk"
-#: awkgram.y:3565
+#: awkgram.y:3688
msgid "`goto' considered harmful!\n"
msgstr "`goto' uważane za szkodliwe!\n"
-#: awkgram.y:3616
+#: awkgram.y:3722
#, c-format
msgid "%d is invalid as number of arguments for %s"
msgstr "%d jest nieprawidłowe jako liczba argumentów dla %s"
-#: awkgram.y:3651
+#: awkgram.y:3757
#, c-format
msgid "%s: string literal as last arg of substitute has no effect"
msgstr ""
"%s: literał łańcuchowy jako ostatni argument podstawienia nie ma żadnego "
"efektu"
-#: awkgram.y:3656
+#: awkgram.y:3762
#, c-format
msgid "%s third parameter is not a changeable object"
msgstr "%s trzeci parametr nie jest zmiennym obiektem"
-#: awkgram.y:3729 awkgram.y:3732
+#: awkgram.y:3841 awkgram.y:3844
msgid "match: third argument is a gawk extension"
msgstr "match: trzeci argument jest rozszerzeniem gawk"
-#: awkgram.y:3786 awkgram.y:3789
+#: awkgram.y:3898 awkgram.y:3901
msgid "close: second argument is a gawk extension"
msgstr "close: drugi argument jest rozszerzeniem gawk"
-#: awkgram.y:3801
+#: awkgram.y:3913
msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
msgstr "nieprawidłowe użycie dcgettext(_\"...\"): usuń znak podkreślenia"
-#: awkgram.y:3816
+#: awkgram.y:3928
msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
msgstr "nieprawidłowe użycie dcngettext(_\"...\"): usuń znak podkreślenia"
-#: awkgram.y:3908
-#, c-format
-msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
-msgstr "funkcja `%s': parametr #%d, `%s', powiela parametr #%d"
-
-#: awkgram.y:3950
+#: awkgram.y:3994
#, c-format
msgid "function `%s': parameter `%s' shadows global variable"
msgstr "funkcja `%s': parametr `%s' zasłania globalną zmienną"
-#: awkgram.y:4108
+#: awkgram.y:4051 debug.c:4019 debug.c:4062 debug.c:5187
#, c-format
msgid "could not open `%s' for writing (%s)"
msgstr "nie można otworzyć `%s' do zapisu (%s)"
-#: awkgram.y:4109
+#: awkgram.y:4052
msgid "sending variable list to standard error"
msgstr "wysyłanie listy zmiennych na standardowe wyjście diagnostyczne"
-#: awkgram.y:4115
+#: awkgram.y:4060
#, c-format
msgid "%s: close failed (%s)"
msgstr "%s: zamknięcie nie powiodło się (%s)"
-#: awkgram.y:4167
+#: awkgram.y:4085
msgid "shadow_funcs() called twice!"
msgstr "shadow_funcs() wywołana podwójnie!"
-#: awkgram.y:4173
+#: awkgram.y:4093
msgid "there were shadowed variables."
msgstr "wystąpiły przykryte zmienne."
-#: awkgram.y:4203
+#: awkgram.y:4164
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "nazwa funkcji `%s' została zdefiniowana poprzednio"
+
+#: awkgram.y:4210
#, c-format
msgid "function `%s': can't use function name as parameter name"
msgstr "funkcja `%s': nie można użyć nazwy funkcji jako nazwy parametru"
-#: awkgram.y:4207
+#: awkgram.y:4213
#, c-format
msgid "function `%s': can't use special variable `%s' as a function parameter"
msgstr ""
"funkcja `%s': nie można użyć specjalnej zmiennej `%s' jako parametru funkcji"
-#: awkgram.y:4223
+#: awkgram.y:4221
#, c-format
-msgid "function name `%s' previously defined"
-msgstr "nazwa funkcji `%s' została zdefiniowana poprzednio"
+msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
+msgstr "funkcja `%s': parametr #%d, `%s', powiela parametr #%d"
-#: awkgram.y:4391 awkgram.y:4397
+#: awkgram.y:4315 awkgram.y:4319
#, c-format
msgid "function `%s' called but never defined"
msgstr "funkcja `%s' została wywołana, ale nigdy nie została zdefiniowana"
-#: awkgram.y:4400
+#: awkgram.y:4324
#, c-format
msgid "function `%s' defined but never called directly"
msgstr ""
"funkcja `%s' została zdefiniowana, ale nigdy nie została wywołana "
"bezpośrednio"
-#: awkgram.y:4432
+#: awkgram.y:4356
#, c-format
msgid "regexp constant for parameter #%d yields boolean value"
msgstr "stałe wyrażenie regularne dla parametru #%d daje wartość logiczną"
-#: awkgram.y:4541
+#: awkgram.y:4402
#, c-format
msgid ""
"function `%s' called with space between name and `(',\n"
@@ -529,233 +520,233 @@ msgstr ""
"`(',\n"
"lub użyta jako zmienna lub jako tablica"
-#: awkgram.y:4788 eval.c:2056
+#: awkgram.y:4618
msgid "division by zero attempted"
msgstr "próba dzielenia przez zero"
-#: awkgram.y:4797 eval.c:2072
+#: awkgram.y:4627
#, c-format
msgid "division by zero attempted in `%%'"
msgstr "próba dzielenia przez zero w `%%'"
-#: builtin.c:120
+#: builtin.c:128
#, c-format
msgid "%s to \"%s\" failed (%s)"
msgstr "%s do \"%s\" nie powiódł się (%s)"
-#: builtin.c:121
+#: builtin.c:129
msgid "standard output"
msgstr "standardowe wyjście"
-#: builtin.c:135
+#: builtin.c:143
msgid "exp: received non-numeric argument"
msgstr "exp: otrzymano argument nie będący liczbą"
-#: builtin.c:141
+#: builtin.c:149
#, c-format
msgid "exp: argument %g is out of range"
msgstr "exp: argument %g jest poza zasięgiem"
-#: builtin.c:200
+#: builtin.c:208
#, c-format
msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing"
msgstr ""
"fflush: nie można opróżnić: potok `%s' otwarty do czytania, a nie do zapisu"
-#: builtin.c:203
+#: builtin.c:211
#, c-format
msgid "fflush: cannot flush: file `%s' opened for reading, not writing"
msgstr ""
"fflush: nie można opróżnić: plik `%s' otwarty do czytania, a nie do zapisu"
-#: builtin.c:215
+#: builtin.c:223
#, c-format
msgid "fflush: `%s' is not an open file, pipe or co-process"
msgstr "fflush: `%s' nie jest ani otwartym plikiem, ani potokiem, ani procesem"
-#: builtin.c:333
+#: builtin.c:341
msgid "index: received non-string first argument"
msgstr "index: otrzymano pierwszy argument, który nie jest łańcuchem"
-#: builtin.c:335
+#: builtin.c:343
msgid "index: received non-string second argument"
msgstr "index: otrzymano drugi argument, który nie jest łańcuchem"
-#: builtin.c:457
+#: builtin.c:467 mpfr.c:770
msgid "int: received non-numeric argument"
msgstr "int: otrzymano argument, który nie jest liczbą"
-#: builtin.c:493
+#: builtin.c:503
msgid "length: received array argument"
msgstr "length: otrzymano argument, który jest tablicą"
-#: builtin.c:496
+#: builtin.c:506
msgid "`length(array)' is a gawk extension"
msgstr "`length(tablica)' jest rozszerzeniem gawk"
-#: builtin.c:504
+#: builtin.c:514
msgid "length: received non-string argument"
msgstr "length: otrzymano argument, który nie jest łańcuchem"
-#: builtin.c:535
+#: builtin.c:545
msgid "log: received non-numeric argument"
msgstr "log: otrzymano argument, który nie jest liczbą"
-#: builtin.c:538
+#: builtin.c:548
#, c-format
msgid "log: received negative argument %g"
msgstr "log: otrzymano ujemny argument %g"
-#: builtin.c:694 builtin.c:699
+#: builtin.c:746 builtin.c:751
msgid "fatal: must use `count$' on all formats or none"
msgstr "fatal: należy użyć `count$' we wszystkich formatach lub nic"
-#: builtin.c:762
+#: builtin.c:821
#, c-format
msgid "field width is ignored for `%%' specifier"
msgstr "szerokość pola jest ignorowana dla specyfikatora `%%'"
-#: builtin.c:764
+#: builtin.c:823
#, c-format
msgid "precision is ignored for `%%' specifier"
msgstr "precyzja jest ignorowana dla specyfikatora `%%'"
-#: builtin.c:766
+#: builtin.c:825
#, c-format
msgid "field width and precision are ignored for `%%' specifier"
msgstr "szerokość pola i precyzja są ignorowane dla specyfikatora `%%'"
-#: builtin.c:817
+#: builtin.c:876
msgid "fatal: `$' is not permitted in awk formats"
msgstr "fatal: `$' jest niedozwolony w formatach awk"
-#: builtin.c:826
+#: builtin.c:885
msgid "fatal: arg count with `$' must be > 0"
msgstr "fatal: argument count z `$' musi być > 0"
-#: builtin.c:830
+#: builtin.c:889
#, c-format
msgid "fatal: arg count %ld greater than total number of supplied arguments"
msgstr ""
"fatal: argument count %ld większy niż całkowita suma argumentów dostarczonych"
-#: builtin.c:834
+#: builtin.c:893
msgid "fatal: `$' not permitted after period in format"
msgstr "fatal: `$' jest niedozwolony po kropce w formacie"
-#: builtin.c:850
+#: builtin.c:909
msgid "fatal: no `$' supplied for positional field width or precision"
msgstr "fatal: brak `$' dla pozycyjnej szerokości pola lub precyzji"
-#: builtin.c:921
+#: builtin.c:981
msgid "`l' is meaningless in awk formats; ignored"
msgstr "`l' jest bezsensowny w formatach awk; zignorowany"
-#: builtin.c:925
+#: builtin.c:985
msgid "fatal: `l' is not permitted in POSIX awk formats"
msgstr "fatal: `l' jest niedozwolony w formatach POSIX awk"
-#: builtin.c:938
+#: builtin.c:998
msgid "`L' is meaningless in awk formats; ignored"
msgstr "`L' jest bezsensowny w formatach awk; zignorowany"
-#: builtin.c:942
+#: builtin.c:1002
msgid "fatal: `L' is not permitted in POSIX awk formats"
msgstr "fatal: `L' jest niedozwolony w formatach POSIX awk"
-#: builtin.c:955
+#: builtin.c:1015
msgid "`h' is meaningless in awk formats; ignored"
msgstr "`h' jest bezsensowny w formatach awk; zignorowany"
-#: builtin.c:959
+#: builtin.c:1019
msgid "fatal: `h' is not permitted in POSIX awk formats"
msgstr "fatal: `h' jest niedozwolony w formatach POSIX awk"
-#: builtin.c:1272
+#: builtin.c:1414
#, c-format
msgid "[s]printf: value %g is out of range for `%%%c' format"
msgstr "[s]printf: wartość %g jest poza zasięgiem dla formatu `%%%c'"
-#: builtin.c:1332
+#: builtin.c:1512
#, c-format
msgid "ignoring unknown format specifier character `%c': no argument converted"
msgstr ""
"pominięcie nieznanego formatu specyfikatora znaku `%c': nie skonwertowano "
"argumentu"
-#: builtin.c:1337
+#: builtin.c:1517
msgid "fatal: not enough arguments to satisfy format string"
msgstr ""
"fatal: brak wystarczającej liczby argumentów, aby zaspokoić łańcuch "
"formatujÄ…cy"
-#: builtin.c:1339
+#: builtin.c:1519
msgid "^ ran out for this one"
msgstr "zabrakło ^"
-#: builtin.c:1346
+#: builtin.c:1526
msgid "[s]printf: format specifier does not have control letter"
msgstr "[s]printf: specyfikator formatu nie posiada kontrolnej litery"
-#: builtin.c:1349
+#: builtin.c:1529
msgid "too many arguments supplied for format string"
msgstr "zbyt dużo podanych argumentów w łańcuchu formatującym"
-#: builtin.c:1423 builtin.c:1434
+#: builtin.c:1604 builtin.c:1615
msgid "printf: no arguments"
msgstr "printf: brak argumentów"
-#: builtin.c:1475
+#: builtin.c:1656
msgid "sqrt: received non-numeric argument"
msgstr "sqrt: otrzymano argument, który nie jest liczbą"
-#: builtin.c:1479
+#: builtin.c:1660
#, c-format
msgid "sqrt: called with negative argument %g"
msgstr "sqrt: wywołana z ujemnym argumentem %g"
-#: builtin.c:1503
+#: builtin.c:1691
#, c-format
msgid "substr: length %g is not >= 1"
msgstr "substr: długość %g nie jest >= 1"
-#: builtin.c:1505
+#: builtin.c:1693
#, c-format
msgid "substr: length %g is not >= 0"
msgstr "substr: długość %g nie jest >= 0"
-#: builtin.c:1512
+#: builtin.c:1700
#, c-format
msgid "substr: non-integer length %g will be truncated"
msgstr "substr: długość %g, która nie jest liczbą całkowitą, zostanie obcięta"
-#: builtin.c:1517
+#: builtin.c:1705
#, c-format
msgid "substr: length %g too big for string indexing, truncating to %g"
msgstr "substr: długość %g zbyt duża dla indeksu łańcucha, obcinanie do %g"
-#: builtin.c:1529
+#: builtin.c:1717
#, c-format
msgid "substr: start index %g is invalid, using 1"
msgstr "substr: początkowy indeks %g jest nieprawidłowy, nastąpi użycie 1"
-#: builtin.c:1534
+#: builtin.c:1722
#, c-format
msgid "substr: non-integer start index %g will be truncated"
msgstr ""
"substr: początkowy indeks %g, który nie jest liczbą całkowitą, zostanie "
"obcięty"
-#: builtin.c:1559
+#: builtin.c:1747
msgid "substr: source string is zero length"
msgstr "substr: łańcuch źródłowy ma zerową długość"
-#: builtin.c:1575
+#: builtin.c:1763
#, c-format
msgid "substr: start index %g is past end of string"
msgstr "substr: początkowy indeks %g leży poza końcem łańcucha"
-#: builtin.c:1583
+#: builtin.c:1771
#, c-format
msgid ""
"substr: length %g at start index %g exceeds length of first argument (%lu)"
@@ -763,230 +754,1092 @@ msgstr ""
"substr: długość %g zaczynając od %g przekracza długość pierwszego argumentu "
"(%lu)"
-#: builtin.c:1657
+#: builtin.c:1845
msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type"
msgstr ""
"strftime: wartość formatu w PROCINFO[\"strftime\"] posiada typ numeryczny"
-#: builtin.c:1680
+#: builtin.c:1868
msgid "strftime: received non-numeric second argument"
msgstr "strftime: otrzymano drugi argument, który nie jest liczbą"
-#: builtin.c:1683
+#: builtin.c:1872
msgid "strftime: second argument less than 0 or too big for time_t"
msgstr "strftime: drugi argument mniejszy od 0 lub zbyt duży dla time_t"
-#: builtin.c:1690
+#: builtin.c:1879
msgid "strftime: received non-string first argument"
msgstr "strftime: otrzymano pierwszy argument, który nie jest łańcuchem"
-#: builtin.c:1696
+#: builtin.c:1886
msgid "strftime: received empty format string"
msgstr "strftime: otrzymano pusty łańcuch formatujący"
-#: builtin.c:1762
+#: builtin.c:1952
msgid "mktime: received non-string argument"
msgstr "mktime: otrzymano argument, który nie jest łańcuchem"
-#: builtin.c:1779
+#: builtin.c:1969
msgid "mktime: at least one of the values is out of the default range"
msgstr "mktime: przynajmniej jedna z wartości jest poza domyślnym zakresem"
-#: builtin.c:1814
+#: builtin.c:2004
msgid "'system' function not allowed in sandbox mode"
msgstr "funkcja 'system' nie jest dozwolona w trybie piaskownicy"
-#: builtin.c:1819
+#: builtin.c:2009
msgid "system: received non-string argument"
msgstr "system: otrzymano argument, który nie jest łańcuchem"
-#: builtin.c:1874 eval.c:1159 eval.c:1790 eval.c:1803
-#, c-format
-msgid "reference to uninitialized variable `%s'"
-msgstr "odwołanie do niezainicjowanej zmiennej `%s'"
-
-#: builtin.c:1941
+#: builtin.c:2127
#, c-format
msgid "reference to uninitialized field `$%d'"
msgstr "odwołanie do niezainicjowanego pola `$%d'"
-#: builtin.c:2028
+#: builtin.c:2214
msgid "tolower: received non-string argument"
msgstr "tolower: otrzymano argument, który nie jest łańcuchem"
-#: builtin.c:2062
+#: builtin.c:2248
msgid "toupper: received non-string argument"
msgstr "toupper: otrzymano argument, który nie jest łańcuchem"
-#: builtin.c:2098
+#: builtin.c:2284 mpfr.c:685
msgid "atan2: received non-numeric first argument"
msgstr "atan2: otrzymano pierwszy argument, który nie jest liczbą"
-#: builtin.c:2100
+#: builtin.c:2286 mpfr.c:687
msgid "atan2: received non-numeric second argument"
msgstr "atan2: otrzymano drugi argument, który nie jest liczbą"
-#: builtin.c:2119
+#: builtin.c:2305
msgid "sin: received non-numeric argument"
msgstr "sin: otrzymano argument, który nie jest liczbą"
-#: builtin.c:2135
+#: builtin.c:2321
msgid "cos: received non-numeric argument"
msgstr "cos: otrzymano argument, który nie jest liczbą"
-#: builtin.c:2188
+#: builtin.c:2374 mpfr.c:1137
msgid "srand: received non-numeric argument"
msgstr "srand: otrzymano argument, który nie jest liczbą"
-#: builtin.c:2219
+#: builtin.c:2405
msgid "match: third argument is not an array"
msgstr "match: otrzymano trzeci argument, który nie jest tablicą"
-#: builtin.c:2483
+#: builtin.c:2670
msgid "gensub: third argument of 0 treated as 1"
msgstr "gensub: trzeci argument 0 potraktowany jako 1"
-#: builtin.c:2776
+#: builtin.c:2963
msgid "lshift: received non-numeric first argument"
msgstr "lshift: otrzymano pierwszy argument, który nie jest liczbą"
-#: builtin.c:2778
+#: builtin.c:2965
msgid "lshift: received non-numeric second argument"
msgstr "lshift: otrzymano drugi argument, który nie jest liczbą"
-#: builtin.c:2784
+#: builtin.c:2971
#, fuzzy, c-format
msgid "lshift(%f, %f): negative values will give strange results"
msgstr "lshift(%lf, %lf): ujemne wartości spowodują dziwne wyniki"
-#: builtin.c:2786
+#: builtin.c:2973
#, fuzzy, c-format
msgid "lshift(%f, %f): fractional values will be truncated"
msgstr "lshift(%lf, %lf): ułamkowe wartości zostaną obcięte"
-#: builtin.c:2788
+#: builtin.c:2975
#, fuzzy, c-format
msgid "lshift(%f, %f): too large shift value will give strange results"
msgstr ""
"lshift(%lf, %lf): zbyt duża wartość przesunięcia spowoduje dziwne wyniki"
-#: builtin.c:2813
+#: builtin.c:3000
msgid "rshift: received non-numeric first argument"
msgstr "rshift: otrzymano pierwszy argument, który nie jest liczbą"
-#: builtin.c:2815
+#: builtin.c:3002
msgid "rshift: received non-numeric second argument"
msgstr "rshift: otrzymano drugi argument, który nie jest liczbą"
-#: builtin.c:2821
+#: builtin.c:3008
#, fuzzy, c-format
msgid "rshift(%f, %f): negative values will give strange results"
msgstr "rshift(%lf, %lf): ujemne wartości spowodują dziwne wyniki"
-#: builtin.c:2823
+#: builtin.c:3010
#, fuzzy, c-format
msgid "rshift(%f, %f): fractional values will be truncated"
msgstr "rshift(%lf, %lf): ułamkowe wartości zostaną obcięte"
-#: builtin.c:2825
+#: builtin.c:3012
#, fuzzy, c-format
msgid "rshift(%f, %f): too large shift value will give strange results"
msgstr ""
"rshift(%lf, %lf): zbyt duża wartość przesunięcia spowoduje dziwne wyniki"
-#: builtin.c:2850
-msgid "and: received non-numeric first argument"
-msgstr "and: otrzymano pierwszy argument, który nie jest liczbą"
-
-#: builtin.c:2852
-msgid "and: received non-numeric second argument"
-msgstr "and: otrzymano drugi argument, który nie jest liczbą"
+#: builtin.c:3037
+#, fuzzy
+msgid "and: called with less than two arguments"
+msgstr "sqrt: wywołana z ujemnym argumentem %g"
-#: builtin.c:2858
+#: builtin.c:3042
#, fuzzy, c-format
-msgid "and(%f, %f): negative values will give strange results"
-msgstr "and(%lf, %lf): ujemne wartości spowodują dziwne wyniki"
+msgid "and: argument %d is non-numeric"
+msgstr "exp: argument %g jest poza zasięgiem"
-#: builtin.c:2860
+#: builtin.c:3046
#, fuzzy, c-format
-msgid "and(%f, %f): fractional values will be truncated"
-msgstr "and(%lf, %lf): ułamkowe wartości zostaną obcięte"
-
-#: builtin.c:2885
-msgid "or: received non-numeric first argument"
-msgstr "or: otrzymano pierwszy argument, który nie jest liczbą"
+msgid "and: argument %d negative value %g will give strange results"
+msgstr "and(%lf, %lf): ujemne wartości spowodują dziwne wyniki"
-#: builtin.c:2887
-msgid "or: received non-numeric second argument"
-msgstr "or: otrzymano drugi argument, który nie jest liczbą"
+#: builtin.c:3069
+#, fuzzy
+msgid "or: called with less than two arguments"
+msgstr "sqrt: wywołana z ujemnym argumentem %g"
-#: builtin.c:2893
+#: builtin.c:3074
#, fuzzy, c-format
-msgid "or(%f, %f): negative values will give strange results"
-msgstr "or(%lf, %lf): ujemne wartości spowodują dziwne wyniki"
+msgid "or: argument %d is non-numeric"
+msgstr "exp: argument %g jest poza zasięgiem"
-#: builtin.c:2895
+#: builtin.c:3078
#, fuzzy, c-format
-msgid "or(%f, %f): fractional values will be truncated"
-msgstr "or(%lf, %lf): ułamkowe wartości zostaną obcięte"
-
-#: builtin.c:2923
-msgid "xor: received non-numeric first argument"
-msgstr "xor: otrzymano pierwszy argument, który nie jest liczbą"
+msgid "or: argument %d negative value %g will give strange results"
+msgstr "compl(%lf): ujemne wartości spowodują dziwne wyniki"
-#: builtin.c:2925
-msgid "xor: received non-numeric second argument"
-msgstr "xor: otrzymano drugi argument, który nie jest liczbą"
+#: builtin.c:3100
+#, fuzzy
+msgid "xor: called with less than two arguments"
+msgstr "sqrt: wywołana z ujemnym argumentem %g"
-#: builtin.c:2931
+#: builtin.c:3106
#, fuzzy, c-format
-msgid "xor(%f, %f): negative values will give strange results"
-msgstr "xor(%lf, %lf): ujemne wartości spowodują dziwne wyniki"
+msgid "xor: argument %d is non-numeric"
+msgstr "exp: argument %g jest poza zasięgiem"
-#: builtin.c:2933
+#: builtin.c:3110
#, fuzzy, c-format
-msgid "xor(%f, %f): fractional values will be truncated"
-msgstr "xor(%lf, %lf): ułamkowe wartości zostaną obcięte"
+msgid "xor: argument %d negative value %g will give strange results"
+msgstr "xor(%lf, %lf): ujemne wartości spowodują dziwne wyniki"
-#: builtin.c:2957 builtin.c:2963
+#: builtin.c:3135 mpfr.c:800
msgid "compl: received non-numeric argument"
msgstr "compl: otrzymano argument, który nie jest liczbą"
-#: builtin.c:2965
+#: builtin.c:3141
#, fuzzy, c-format
msgid "compl(%f): negative value will give strange results"
msgstr "compl(%lf): ujemne wartości spowodują dziwne wyniki"
-#: builtin.c:2967
+#: builtin.c:3143
#, fuzzy, c-format
msgid "compl(%f): fractional value will be truncated"
msgstr "compl(%lf): ułamkowe wartości zostaną obcięte"
-#: builtin.c:3136
+#: builtin.c:3312
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr "dcgettext: `%s' nie jest prawidłową kategorią lokalizacji"
-#: eval.c:412
+#: command.y:225
+#, c-format
+msgid "Type (g)awk statement(s). End with the command \"end\"\n"
+msgstr ""
+
+#: command.y:289
+#, fuzzy, c-format
+msgid "invalid frame number: %d"
+msgstr "Nieprawidłowy koniec zakresu"
+
+#: command.y:295
+#, fuzzy, c-format
+msgid "info: invalid option - \"%s\""
+msgstr "%s: błędna opcja -- '%c'\n"
+
+#: command.y:321
+#, c-format
+msgid "source \"%s\": already sourced."
+msgstr ""
+
+#: command.y:326
+#, c-format
+msgid "save \"%s\": command not permitted."
+msgstr ""
+
+#: command.y:339
+msgid "Can't use command `commands' for breakpoint/watchpoint commands"
+msgstr ""
+
+#: command.y:341
+msgid "no breakpoint/watchpoint has been set yet"
+msgstr ""
+
+#: command.y:343
+msgid "invalid breakpoint/watchpoint number"
+msgstr ""
+
+#: command.y:348
+#, c-format
+msgid "Type commands for when %s %d is hit, one per line.\n"
+msgstr ""
+
+#: command.y:350
+#, c-format
+msgid "End with the command \"end\"\n"
+msgstr ""
+
+#: command.y:357
+msgid "`end' valid only in command `commands' or `eval'"
+msgstr ""
+
+#: command.y:367
+msgid "`silent' valid only in command `commands'"
+msgstr ""
+
+#: command.y:373
+#, fuzzy, c-format
+msgid "trace: invalid option - \"%s\""
+msgstr "%s: błędna opcja -- '%c'\n"
+
+#: command.y:387
+msgid "condition: invalid breakpoint/watchpoint number"
+msgstr ""
+
+#: command.y:449
+#, fuzzy
+msgid "argument not a string"
+msgstr "exp: argument %g jest poza zasięgiem"
+
+#: command.y:459 command.y:464
+#, c-format
+msgid "option: invalid parameter - \"%s\""
+msgstr ""
+
+#: command.y:474
+#, c-format
+msgid "no such function - \"%s\""
+msgstr ""
+
+#: command.y:531
+#, fuzzy, c-format
+msgid "enable: invalid option - \"%s\""
+msgstr "%s: błędna opcja -- '%c'\n"
+
+#: command.y:597
+#, fuzzy, c-format
+msgid "invalid range specification: %d - %d"
+msgstr "Nieprawidłowy koniec zakresu"
+
+#: command.y:659
+#, fuzzy
+msgid "non-numeric value for field number"
+msgstr "nieznana wartość dla specyfikacji pola: %d\n"
+
+#: command.y:680 command.y:687
+msgid "non-numeric value found, numeric expected"
+msgstr ""
+
+#: command.y:712 command.y:718
+msgid "non-zero integer value"
+msgstr ""
+
+#: command.y:817
+msgid ""
+"backtrace [N] - print trace of all or N innermost (outermost if N < 0) "
+"frames."
+msgstr ""
+
+#: command.y:819
+msgid ""
+"break [[filename:]N|function] - set breakpoint at the specified location."
+msgstr ""
+
+#: command.y:821
+msgid "clear [[filename:]N|function] - delete breakpoints previously set."
+msgstr ""
+
+#: command.y:823
+msgid ""
+"commands [num] - starts a list of commands to be executed at a breakpoint"
+"(watchpoint) hit."
+msgstr ""
+
+#: command.y:825
+msgid "condition num [expr] - set or clear breakpoint or watchpoint condition."
+msgstr ""
+
+#: command.y:827
+msgid "continue [COUNT] - continue program being debugged."
+msgstr ""
+
+#: command.y:829
+msgid "delete [breakpoints] [range] - delete specified breakpoints."
+msgstr ""
+
+#: command.y:831
+msgid "disable [breakpoints] [range] - disable specified breakpoints."
+msgstr ""
+
+#: command.y:833
+msgid "display [var] - print value of variable each time the program stops."
+msgstr ""
+
+#: command.y:835
+msgid "down [N] - move N frames down the stack."
+msgstr ""
+
+#: command.y:837
+msgid "dump [filename] - dump instructions to file or stdout."
+msgstr ""
+
+#: command.y:839
+msgid "enable [once|del] [breakpoints] [range] - enable specified breakpoints."
+msgstr ""
+
+#: command.y:841
+msgid "end - end a list of commands or awk statements."
+msgstr ""
+
+#: command.y:843
+msgid "eval stmt|[p1, p2, ...] - evaluate awk statement(s)."
+msgstr ""
+
+#: command.y:845
+msgid "finish - execute until selected stack frame returns."
+msgstr ""
+
+#: command.y:847
+msgid "frame [N] - select and print stack frame number N."
+msgstr ""
+
+#: command.y:849
+msgid "help [command] - print list of commands or explanation of command."
+msgstr ""
+
+#: command.y:851
+msgid "ignore N COUNT - set ignore-count of breakpoint number N to COUNT."
+msgstr ""
+
+#: command.y:853
+msgid ""
+"info topic - source|sources|variables|functions|break|frame|args|locals|"
+"display|watch."
+msgstr ""
+
+#: command.y:855
+msgid "list [-|+|[filename:]lineno|function|range] - list specified line(s)."
+msgstr ""
+
+#: command.y:857
+msgid "next [COUNT] - step program, proceeding through subroutine calls."
+msgstr ""
+
+#: command.y:859
+msgid ""
+"nexti [COUNT] - step one instruction, but proceed through subroutine calls."
+msgstr ""
+
+#: command.y:861
+msgid "option [name[=value]] - set or display debugger option(s)."
+msgstr ""
+
+#: command.y:863
+msgid "print var [var] - print value of a variable or array."
+msgstr ""
+
+#: command.y:865
+msgid "printf format, [arg], ... - formatted output."
+msgstr ""
+
+#: command.y:867
+msgid "quit - exit debugger."
+msgstr ""
+
+#: command.y:869
+msgid "return [value] - make selected stack frame return to its caller."
+msgstr ""
+
+#: command.y:871
+msgid "run - start or restart executing program."
+msgstr ""
+
+#: command.y:874
+msgid "save filename - save commands from the session to file."
+msgstr ""
+
+#: command.y:877
+msgid "set var = value - assign value to a scalar variable."
+msgstr ""
+
+#: command.y:879
+msgid ""
+"silent - suspends usual message when stopped at a breakpoint/watchpoint."
+msgstr ""
+
+#: command.y:881
+msgid "source file - execute commands from file."
+msgstr ""
+
+#: command.y:883
+msgid "step [COUNT] - step program until it reaches a different source line."
+msgstr ""
+
+#: command.y:885
+msgid "stepi [COUNT] - step one instruction exactly."
+msgstr ""
+
+#: command.y:887
+msgid "tbreak [[filename:]N|function] - set a temporary breakpoint."
+msgstr ""
+
+#: command.y:889
+msgid "trace on|off - print instruction before executing."
+msgstr ""
+
+#: command.y:891
+msgid "undisplay [N] - remove variable(s) from automatic display list."
+msgstr ""
+
+#: command.y:893
+msgid ""
+"until [[filename:]N|function] - execute until program reaches a different "
+"line or line N within current frame."
+msgstr ""
+
+#: command.y:895
+msgid "unwatch [N] - remove variable(s) from watch list."
+msgstr ""
+
+#: command.y:897
+msgid "up [N] - move N frames up the stack."
+msgstr ""
+
+#: command.y:899
+msgid "watch var - set a watchpoint for a variable."
+msgstr ""
+
+#: command.y:1011 debug.c:395 msg.c:128
+#, c-format
+msgid "error: "
+msgstr "błąd: "
+
+#: command.y:1051
+#, fuzzy, c-format
+msgid "can't read command (%s)\n"
+msgstr "nie można przekierować z `%s' (%s)"
+
+#: command.y:1065
+#, fuzzy, c-format
+msgid "can't read command (%s)"
+msgstr "nie można przekierować z `%s' (%s)"
+
+#: command.y:1116
+#, fuzzy
+msgid "invalid character in command"
+msgstr "Nieprawidłowa nazwa klasy znaku"
+
+#: command.y:1152
+#, c-format
+msgid "unknown command - \"%.*s\", try help"
+msgstr ""
+
+#: command.y:1222
+#, c-format
+msgid "%s"
+msgstr ""
+
+#: command.y:1284
+#, fuzzy
+msgid "invalid character"
+msgstr "Nieprawidłowy znak porównania"
+
+#: command.y:1455
+#, c-format
+msgid "undefined command: %s\n"
+msgstr ""
+
+#: debug.c:246
+msgid "set or show the number of lines to keep in history file."
+msgstr ""
+
+#: debug.c:248
+msgid "set or show the list command window size."
+msgstr ""
+
+#: debug.c:250
+msgid "set or show gawk output file."
+msgstr ""
+
+#: debug.c:252
+msgid "set or show debugger prompt."
+msgstr ""
+
+#: debug.c:254
+msgid "(un)set or show saving of command history (value=on|off)."
+msgstr ""
+
+#: debug.c:256
+msgid "(un)set or show saving of options (value=on|off)."
+msgstr ""
+
+#: debug.c:258
+msgid "(un)set or show instruction tracing (value=on|off)."
+msgstr ""
+
+#: debug.c:339
+msgid "program not running."
+msgstr ""
+
+#: debug.c:442 debug.c:597
+#, fuzzy, c-format
+msgid "can't read source file `%s' (%s)"
+msgstr "nie można otworzyć pliku źródłowego `%s' (%s)"
+
+#: debug.c:447
+#, fuzzy, c-format
+msgid "source file `%s' is empty.\n"
+msgstr "plik źródłowy `%s' jest pusty"
+
+#: debug.c:474
+msgid "no current source file."
+msgstr ""
+
+#: debug.c:499
+#, fuzzy, c-format
+msgid "cannot find source file named `%s' (%s)"
+msgstr "nie można otworzyć pliku źródłowego `%s' (%s)"
+
+#: debug.c:523
+#, c-format
+msgid "WARNING: source file `%s' modified since program compilation.\n"
+msgstr ""
+
+#: debug.c:542
+#, c-format
+msgid "line number %d out of range; `%s' has %d lines"
+msgstr ""
+
+#: debug.c:602
+#, fuzzy, c-format
+msgid "unexpected eof while reading file `%s', line %d"
+msgstr "wewnętrzny błąd: plik `%s', linia %d\n"
+
+#: debug.c:611
+#, c-format
+msgid "source file `%s' modified since start of program execution"
+msgstr ""
+
+#: debug.c:723
+#, fuzzy, c-format
+msgid "Current source file: %s\n"
+msgstr "plik źródłowy `%s' jest już załączony"
+
+#: debug.c:724
+#, c-format
+msgid "Number of lines: %d\n"
+msgstr ""
+
+#: debug.c:731
+#, c-format
+msgid "Source file (lines): %s (%d)\n"
+msgstr ""
+
+#: debug.c:745
+msgid ""
+"Number Disp Enabled Location\n"
+"\n"
+msgstr ""
+
+#: debug.c:756
+#, c-format
+msgid "\tno of hits = %ld\n"
+msgstr ""
+
+#: debug.c:758
+#, c-format
+msgid "\tignore next %ld hit(s)\n"
+msgstr ""
+
+#: debug.c:760 debug.c:900
+#, c-format
+msgid "\tstop condition: %s\n"
+msgstr ""
+
+#: debug.c:762 debug.c:902
+msgid "\tcommands:\n"
+msgstr ""
+
+#: debug.c:784
+#, c-format
+msgid "Current frame: "
+msgstr ""
+
+#: debug.c:787
+#, c-format
+msgid "Called by frame: "
+msgstr ""
+
+#: debug.c:791
+#, c-format
+msgid "Caller of frame: "
+msgstr ""
+
+#: debug.c:809
+#, c-format
+msgid "None in main().\n"
+msgstr ""
+
+#: debug.c:839
+#, fuzzy
+msgid "No arguments.\n"
+msgstr "printf: brak argumentów"
+
+#: debug.c:840
+msgid "No locals.\n"
+msgstr ""
+
+#: debug.c:848
+msgid ""
+"All defined variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:858
+msgid ""
+"All defined functions:\n"
+"\n"
+msgstr ""
+
+#: debug.c:877
+msgid ""
+"Auto-display variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:880
+msgid ""
+"Watch variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:1020
+#, fuzzy, c-format
+msgid "no symbol `%s' in current context\n"
+msgstr "instrukcja `exit' nie może być wywołana w tym kontekście"
+
+#: debug.c:1032 debug.c:1416
+#, fuzzy, c-format
+msgid "`%s' is not an array\n"
+msgstr "`%s' nie jest dozwolonÄ… nazwÄ… zmiennej"
+
+#: debug.c:1046
+#, fuzzy, c-format
+msgid "$%ld = uninitialized field\n"
+msgstr "odwołanie do niezainicjowanego pola `$%d'"
+
+#: debug.c:1067
+#, fuzzy, c-format
+msgid "array `%s' is empty\n"
+msgstr "plik danych `%s' jest pusty"
+
+#: debug.c:1110 debug.c:1162
+#, fuzzy, c-format
+msgid "[\"%s\"] not in array `%s'\n"
+msgstr "delete: indeks `%s' nie jest w tablicy `%s'"
+
+#: debug.c:1166
+#, c-format
+msgid "`%s[\"%s\"]' is not an array\n"
+msgstr ""
+
+#: debug.c:1227 debug.c:4947
+#, fuzzy, c-format
+msgid "`%s' is not a scalar variable"
+msgstr "`%s' nie jest dozwolonÄ… nazwÄ… zmiennej"
+
+#: debug.c:1249 debug.c:4977
+#, fuzzy, c-format
+msgid "attempt to use array `%s[\"%s\"]' in a scalar context"
+msgstr "próba użycia tablicy `%s[\"%.*s\"]' w kontekście skalaru"
+
+#: debug.c:1269 debug.c:4988
+#, fuzzy, c-format
+msgid "attempt to use scalar `%s[\"%s\"]' as array"
+msgstr "próba użycia skalaru `%s[\"%.*s\"]' jako tablicy"
+
+#: debug.c:1412
+#, fuzzy, c-format
+msgid "`%s' is a function"
+msgstr "nieprawidłowa nazwa funkcji `%s'"
+
+#: debug.c:1454
+#, c-format
+msgid "watchpoint %d is unconditional\n"
+msgstr ""
+
+#: debug.c:1488
+#, c-format
+msgid "No display item numbered %ld"
+msgstr ""
+
+#: debug.c:1491
+#, c-format
+msgid "No watch item numbered %ld"
+msgstr ""
+
+#: debug.c:1517
+#, fuzzy, c-format
+msgid "%d: [\"%s\"] not in array `%s'\n"
+msgstr "delete: indeks `%s' nie jest w tablicy `%s'"
+
+#: debug.c:1756
+#, fuzzy
+msgid "attempt to use scalar value as array"
+msgstr "próba użycia wartości skalarnej jako tablicy"
+
+#: debug.c:1845
+#, c-format
+msgid "Watchpoint %d deleted because parameter is out of scope.\n"
+msgstr ""
+
+#: debug.c:1856
+#, c-format
+msgid "Display %d deleted because parameter is out of scope.\n"
+msgstr ""
+
+#: debug.c:1889
+#, fuzzy, c-format
+msgid " in file `%s', line %d\n"
+msgstr "wewnętrzny błąd: plik `%s', linia %d\n"
+
+#: debug.c:1910
+#, c-format
+msgid " at `%s':%d"
+msgstr ""
+
+#: debug.c:1926 debug.c:1989
+#, c-format
+msgid "#%ld\tin "
+msgstr ""
+
+#: debug.c:1963
+#, c-format
+msgid "More stack frames follow ...\n"
+msgstr ""
+
+#: debug.c:2006
+#, fuzzy
+msgid "invalid frame number"
+msgstr "Nieprawidłowy koniec zakresu"
+
+#: debug.c:2178
+#, c-format
+msgid "Note: breakpoint %d (enabled, ignore next %ld hits), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2185
+#, c-format
+msgid "Note: breakpoint %d (enabled), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2192
+#, c-format
+msgid "Note: breakpoint %d (disabled, ignore next %ld hits), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2199
+#, c-format
+msgid "Note: breakpoint %d (disabled), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2216
+#, fuzzy, c-format
+msgid "Breakpoint %d set at file `%s', line %d\n"
+msgstr "wewnętrzny błąd: plik `%s', linia %d\n"
+
+#: debug.c:2318
+#, c-format
+msgid "Can't set breakpoint in file `%s'\n"
+msgstr ""
+
+#: debug.c:2347 debug.c:2470 debug.c:3328
+#, fuzzy, c-format
+msgid "line number %d in file `%s' out of range"
+msgstr "exp: argument %g jest poza zasięgiem"
+
+#: debug.c:2351
+#, c-format
+msgid "Can't find rule!!!\n"
+msgstr ""
+
+#: debug.c:2353
+#, c-format
+msgid "Can't set breakpoint at `%s':%d\n"
+msgstr ""
+
+#: debug.c:2365
+#, c-format
+msgid "Can't set breakpoint in function `%s'\n"
+msgstr ""
+
+#: debug.c:2381
+#, c-format
+msgid "breakpoint %d set at file `%s', line %d is unconditional\n"
+msgstr ""
+
+#: debug.c:2486 debug.c:2508
+#, c-format
+msgid "Deleted breakpoint %d"
+msgstr ""
+
+#: debug.c:2492
+#, c-format
+msgid "No breakpoint(s) at entry to function `%s'\n"
+msgstr ""
+
+#: debug.c:2519
+#, fuzzy, c-format
+msgid "No breakpoint at file `%s', line #%d\n"
+msgstr "wewnętrzny błąd: plik `%s', linia %d\n"
+
+#: debug.c:2574 debug.c:2615 debug.c:2635 debug.c:2678
+msgid "invalid breakpoint number"
+msgstr ""
+
+#: debug.c:2590
+msgid "Delete all breakpoints? (y or n) "
+msgstr ""
+
+#: debug.c:2591 debug.c:2901 debug.c:2954
+msgid "y"
+msgstr ""
+
+#: debug.c:2640
+#, c-format
+msgid "Will ignore next %ld crossing(s) of breakpoint %d.\n"
+msgstr ""
+
+#: debug.c:2644
+#, c-format
+msgid "Will stop next time breakpoint %d is reached.\n"
+msgstr ""
+
+#: debug.c:2761
+#, c-format
+msgid "Can only debug programs provided with the `-f' option.\n"
+msgstr ""
+
+#: debug.c:2886
+#, c-format
+msgid "Failed to restart debugger"
+msgstr ""
+
+#: debug.c:2900
+msgid "Program already running. Restart from beginning (y/n)? "
+msgstr ""
+
+#: debug.c:2904
+#, c-format
+msgid "Program not restarted\n"
+msgstr ""
+
+#: debug.c:2914
+#, c-format
+msgid "error: cannot restart, operation not allowed\n"
+msgstr ""
+
+#: debug.c:2920
+#, c-format
+msgid "error (%s): cannot restart, ignoring rest of the commands\n"
+msgstr ""
+
+#: debug.c:2928
+#, c-format
+msgid "Starting program: \n"
+msgstr ""
+
+#: debug.c:2937
+#, c-format
+msgid "Program exited %s with exit value: %d\n"
+msgstr ""
+
+#: debug.c:2953
+msgid "The program is running. Exit anyway (y/n)? "
+msgstr ""
+
+#: debug.c:2988
+#, c-format
+msgid "Not stopped at any breakpoint; argument ignored.\n"
+msgstr ""
+
+#: debug.c:2993
+#, c-format
+msgid "invalid breakpoint number %d."
+msgstr ""
+
+#: debug.c:2998
+#, c-format
+msgid "Will ignore next %ld crossings of breakpoint %d.\n"
+msgstr ""
+
+#: debug.c:3185
+#, c-format
+msgid "'finish' not meaningful in the outermost frame main()\n"
+msgstr ""
+
+#: debug.c:3190
+#, c-format
+msgid "Run till return from "
+msgstr ""
+
+#: debug.c:3233
+#, c-format
+msgid "'return' not meaningful in the outermost frame main()\n"
+msgstr ""
+
+#: debug.c:3347
+#, c-format
+msgid "Can't find specified location in function `%s'\n"
+msgstr ""
+
+#: debug.c:3355
+#, fuzzy, c-format
+msgid "invalid source line %d in file `%s'"
+msgstr "plik źródłowy `%s' jest już załączony"
+
+#: debug.c:3370
+#, c-format
+msgid "Can't find specified location %d in file `%s'\n"
+msgstr ""
+
+#: debug.c:3402
+#, fuzzy, c-format
+msgid "element not in array\n"
+msgstr "delete: indeks `%s' nie jest w tablicy `%s'"
+
+#: debug.c:3402
+#, c-format
+msgid "untyped variable\n"
+msgstr ""
+
+#: debug.c:3444
+#, c-format
+msgid "Stopping in %s ...\n"
+msgstr ""
+
+#: debug.c:3521
+#, c-format
+msgid "'finish' not meaningful with non-local jump '%s'\n"
+msgstr ""
+
+#: debug.c:3528
+#, c-format
+msgid "'until' not meaningful with non-local jump '%s'\n"
+msgstr ""
+
+#: debug.c:4163
+msgid "\t------[Enter] to continue or q [Enter] to quit------"
+msgstr ""
+
+#: debug.c:4164
+msgid "q"
+msgstr ""
+
+#: debug.c:4984
+#, fuzzy, c-format
+msgid "[\"%s\"] not in array `%s'"
+msgstr "delete: indeks `%s' nie jest w tablicy `%s'"
+
+#: debug.c:5190
+#, c-format
+msgid "sending output to stdout\n"
+msgstr ""
+
+#: debug.c:5230
+msgid "invalid number"
+msgstr ""
+
+#: debug.c:5362
+#, fuzzy, c-format
+msgid "`%s' not allowed in current context; statement ignored"
+msgstr "instrukcja `exit' nie może być wywołana w tym kontekście"
+
+#: debug.c:5370
+#, fuzzy
+msgid "`return' not allowed in current context; statement ignored"
+msgstr "instrukcja `exit' nie może być wywołana w tym kontekście"
+
+#: debug.c:5571
+#, fuzzy, c-format
+msgid "No symbol `%s' in current context"
+msgstr "próba użycia tablicy `%s' w kontekście skalaru"
+
+#: dfa.c:984 dfa.c:987 dfa.c:1007 dfa.c:1017 dfa.c:1029 dfa.c:1080 dfa.c:1089
+#: dfa.c:1092 dfa.c:1097 dfa.c:1110 dfa.c:1178
+#, fuzzy
+msgid "unbalanced ["
+msgstr "[ nie do pary"
+
+#: dfa.c:1038
+#, fuzzy
+msgid "invalid character class"
+msgstr "Nieprawidłowa nazwa klasy znaku"
+
+#: dfa.c:1215
+msgid "character class syntax is [[:space:]], not [:space:]"
+msgstr ""
+
+#: dfa.c:1267
+#, fuzzy
+msgid "unfinished \\ escape"
+msgstr "Niedokończona sekwencja ucieczki \\"
+
+#: dfa.c:1414 regcomp.c:161
+msgid "Invalid content of \\{\\}"
+msgstr "Nieprawidłowa zawartość \\{\\}"
+
+#: dfa.c:1417 regcomp.c:176
+msgid "Regular expression too big"
+msgstr "Wyrażenie regularne jest zbyt duże"
+
+#: dfa.c:1802
+#, fuzzy
+msgid "unbalanced ("
+msgstr "( nie do pary"
+
+#: dfa.c:1929
+#, fuzzy
+msgid "no syntax specified"
+msgstr "Nie zostały podane bity składni wyrażenia regularnego"
+
+#: dfa.c:1937
+#, fuzzy
+msgid "unbalanced )"
+msgstr ") nie do pary"
+
+#: eval.c:394
#, c-format
msgid "unknown nodetype %d"
msgstr "nieznany typ węzła %d"
-#: eval.c:423 eval.c:437
+#: eval.c:405 eval.c:419
#, c-format
msgid "unknown opcode %d"
msgstr "nieznany opcode %d"
-#: eval.c:434
+#: eval.c:416
#, c-format
msgid "opcode %s not an operator or keyword"
msgstr "opcode %s nie jest operatorem ani słowem kluczowym"
-#: eval.c:488
+#: eval.c:471
msgid "buffer overflow in genflags2str"
msgstr "przepełnienie bufora w genflags2str"
-#: eval.c:698
+#: eval.c:674
#, c-format
msgid ""
"\n"
@@ -997,308 +1850,534 @@ msgstr ""
"\t# Stos Wywoławczy Funkcji:\n"
"\n"
-#: eval.c:725
+#: eval.c:703
msgid "`IGNORECASE' is a gawk extension"
msgstr "`IGNORECASE' jest rozszerzeniem gawk"
-#: eval.c:754
+#: eval.c:735
msgid "`BINMODE' is a gawk extension"
msgstr "`BINMODE' jest rozszerzeniem gawk"
-#: eval.c:812
+#: eval.c:792
#, c-format
msgid "BINMODE value `%s' is invalid, treated as 3"
msgstr "wartość BINMODE `%s' jest nieprawidłowa, przyjęto ją jako 3"
-#: eval.c:902
+#: eval.c:884
#, c-format
msgid "bad `%sFMT' specification `%s'"
msgstr "zła specyfikacja `%sFMT' `%s'"
-#: eval.c:980
+#: eval.c:968
msgid "turning off `--lint' due to assignment to `LINT'"
msgstr "wyłączenie `--lint' z powodu przypisania do `LINT'"
-#: eval.c:1127 eval.c:1777
-#, c-format
-msgid "can't use function name `%s' as variable or array"
-msgstr "nie można użyć nazwy funkcji `%s' jako zmiennej lub tablicy"
-
-#: eval.c:1158 eval.c:1789 eval.c:1802
+#: eval.c:1144
#, c-format
msgid "reference to uninitialized argument `%s'"
msgstr "odwołanie do niezainicjowanego argumentu `%s'"
-#: eval.c:1177
+#: eval.c:1145
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "odwołanie do niezainicjowanej zmiennej `%s'"
+
+#: eval.c:1163
msgid "attempt to field reference from non-numeric value"
msgstr "próba odwołania do pola poprzez nienumeryczną wartość"
-#: eval.c:1179
+#: eval.c:1165
msgid "attempt to field reference from null string"
msgstr "próba odwołania z zerowego łańcucha"
-#: eval.c:1185
+#: eval.c:1173
#, c-format
msgid "attempt to access field %ld"
msgstr "próba dostępu do pola %ld"
-#: eval.c:1194
+#: eval.c:1182
#, c-format
msgid "reference to uninitialized field `$%ld'"
msgstr "odwołanie do niezainicjowanego pola `$%ld'"
-#: eval.c:1256
+#: eval.c:1269
#, c-format
msgid "function `%s' called with more arguments than declared"
msgstr ""
"funkcja `%s' została wywołana z większą ilością argumentów niż zostało to "
"zadeklarowane"
-#: eval.c:1437
+#: eval.c:1464
#, c-format
msgid "unwind_stack: unexpected type `%s'"
msgstr "unwind_stack: niespodziewany typ `%s'"
-#: eval.c:1532
+#: eval.c:1558
msgid "division by zero attempted in `/='"
msgstr "próba dzielenia przez zero w `/='"
-#: eval.c:1539
+#: eval.c:1565
#, c-format
msgid "division by zero attempted in `%%='"
msgstr "próba dzielenia przez zero w `%%='"
-#: eval.c:1876 eval.c:2122
-#, c-format
-msgid "attempt to use array `%s[\"%.*s\"]' in a scalar context"
-msgstr "próba użycia tablicy `%s[\"%.*s\"]' w kontekście skalaru"
-
-#: eval.c:1907
-msgid "assignment used in conditional context"
-msgstr "przypisanie użyte w kontekście warunkowym"
-
-#: eval.c:1911
-msgid "statement has no effect"
-msgstr "instrukcja nie ma żadnego efektu"
-
-#: eval.c:2343
-#, c-format
-msgid "for loop: array `%s' changed size from %ld to %ld during loop execution"
-msgstr ""
-"pętla for: tablica `%s' zmieniła rozmiar z %ld do %ld podczas wykonywania "
-"pętli"
-
-#: eval.c:2458
-#, c-format
-msgid "function called indirectly through `%s' does not exist"
-msgstr "pośrednio wywołana funkcja poprzez `%s' nie istnieje"
-
-#: eval.c:2470
-#, c-format
-msgid "function `%s' not defined"
-msgstr "funkcja `%s' nie została zdefiniowana"
-
-#: eval.c:2511
-#, c-format
-msgid "non-redirected `getline' invalid inside `%s' rule"
-msgstr ""
-"komenda `getline' bez przekierowania jest nieprawidłowa wewnątrz reguły `%s'"
-
-#: eval.c:2600
-#, c-format
-msgid "error reading input file `%s': %s"
-msgstr "błąd podczas czytania z pliku `%s': %s"
-
-#: eval.c:2614
-#, c-format
-msgid "`nextfile' cannot be called from a `%s' rule"
-msgstr "instrukcja `nextfile' nie może być wywołana z wnętrza reguły `%s'"
-
-#: eval.c:2661
-msgid "`exit' cannot be called in the current context"
-msgstr "instrukcja `exit' nie może być wywołana w tym kontekście"
-
-#: eval.c:2700
-#, c-format
-msgid "`next' cannot be called from a `%s' rule"
-msgstr "instrukcja `next' nie może być wywołana z wnętrza reguły `%s'"
-
-#: eval.c:2766
-#, c-format
-msgid "Sorry, don't know how to interpret `%s'"
-msgstr "Niestety nie wiem jak zinterpretować `%s'"
-
-#: ext.c:54
+#: ext.c:49
msgid "extensions are not allowed in sandbox mode"
msgstr "rozszerzenia nie sÄ… dozwolone w trybie piaskownicy"
-#: ext.c:60 ext.c:65
-msgid "`extension' is a gawk extension"
-msgstr "`extension' jest rozszerzeniem gawk"
+#: ext.c:52
+#, fuzzy
+msgid "-l / @load are gawk extensions"
+msgstr "@include jest rozszerzeniem gawk"
-#: ext.c:75
-#, c-format
-msgid "fatal: extension: cannot open `%s' (%s)\n"
+#: ext.c:55
+msgid "load_ext: received NULL lib_name"
+msgstr ""
+
+#: ext.c:58
+#, fuzzy, c-format
+msgid "load_ext: cannot open library `%s' (%s)\n"
msgstr "fatal: rozszerzenie: nie można otworzyć `%s' (%s)\n"
-#: ext.c:84
-#, c-format
+#: ext.c:64
+#, fuzzy, c-format
msgid ""
-"fatal: extension: library `%s': does not define "
-"`plugin_is_GPL_compatible' (%s)\n"
+"load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n"
msgstr ""
"fatal: rozszerzenie: biblioteka `%s': nie definiuje "
"`plugin_is_GPL_compatible' (%s)\n"
-#: ext.c:93
-#, c-format
-msgid "fatal: extension: library `%s': cannot call function `%s' (%s)\n"
+#: ext.c:70
+#, fuzzy, c-format
+msgid "load_ext: library `%s': cannot call function `%s' (%s)\n"
msgstr ""
"fatal: rozszerzenie: biblioteka `%s': nie można wywołać funkcji `%s' (%s)\n"
-#: ext.c:127
-msgid "extension: missing function name"
+#: ext.c:74
+#, c-format
+msgid "load_ext: library `%s' initialization routine `%s' failed\n"
+msgstr ""
+
+#: ext.c:93
+#, fuzzy
+msgid "make_builtin: missing function name"
msgstr "rozszerzenie: brakujÄ…ca nazwa funkcji"
-#: ext.c:132
-#, c-format
-msgid "extension: illegal character `%c' in function name `%s'"
+#: ext.c:98
+#, fuzzy, c-format
+msgid "make_builtin: illegal character `%c' in function name `%s'"
msgstr "rozszerzenie: nieprawidłowy znak `%c' w nazwie funkcji `%s'"
-#: ext.c:141
-#, c-format
-msgid "extension: can't redefine function `%s'"
+#: ext.c:106
+#, fuzzy, c-format
+msgid "make_builtin: can't redefine function `%s'"
msgstr "rozszerzenie: nie można zredefiniować funkcji `%s'"
-#: ext.c:145
-#, c-format
-msgid "extension: function `%s' already defined"
+#: ext.c:110
+#, fuzzy, c-format
+msgid "make_builtin: function `%s' already defined"
msgstr "rozserzenie: funkcja `%s' została już zdefiniowana"
-#: ext.c:150
-#, c-format
-msgid "extension: function name `%s' previously defined"
+#: ext.c:114
+#, fuzzy, c-format
+msgid "make_builtin: function name `%s' previously defined"
msgstr "rozserzenie: nazwa funkcji `%s' została zdefiniowana wcześniej"
-#: ext.c:152
-#, c-format
-msgid "extension: can't use gawk built-in `%s' as function name"
+#: ext.c:116
+#, fuzzy, c-format
+msgid "make_builtin: can't use gawk built-in `%s' as function name"
msgstr "rozszerzenie: nie można użyć wbudowanej w gawk `%s' jako nazwy funkcji"
-#: ext.c:156
+#: ext.c:119
#, c-format
msgid "make_builtin: negative argument count for function `%s'"
msgstr "make_builtin: ujemny licznik argumentów dla funkcji `%s'"
-#: ext.c:259
+#: ext.c:183
#, c-format
msgid "function `%s' defined to take no more than %d argument(s)"
msgstr "funkcja `%s' zdefiniowana aby pobrać nie więcej niż %d argument(ów)"
-#: ext.c:262
+#: ext.c:186
#, c-format
msgid "function `%s': missing argument #%d"
msgstr "funkcja `%s': brakuje #%d argumentu"
-#: ext.c:279
+#: ext.c:203
#, c-format
msgid "function `%s': argument #%d: attempt to use scalar as an array"
msgstr "funkcja `%s': argument #%d: próba użycia skalaru jako tablicy"
-#: ext.c:283
+#: ext.c:207
#, c-format
msgid "function `%s': argument #%d: attempt to use array as a scalar"
msgstr "funkcja `%s': argument #%d: próba użycia tablicy jako skalaru"
-#: ext.c:296
-msgid "Operation Not Supported"
-msgstr "Operacja nie jest wspierana"
+#: ext.c:221
+msgid "dynamic loading of library not supported"
+msgstr ""
+
+#: extension/filefuncs.c:75
+#, fuzzy
+msgid "chdir: called with incorrect number of arguments, expecting 1"
+msgstr "sqrt: wywołana z ujemnym argumentem %g"
+
+#: extension/filefuncs.c:348
+#, fuzzy
+msgid "stat: called with wrong number of arguments"
+msgstr "sqrt: wywołana z ujemnym argumentem %g"
+
+#: extension/filefuncs.c:355
+#, fuzzy
+msgid "stat: bad parameters"
+msgstr "%s: jest parametrem\n"
+
+#: extension/filefuncs.c:421
+msgid "fill_stat_element: could not create array"
+msgstr ""
+
+#: extension/filefuncs.c:430
+msgid "fill_stat_element: could not set element"
+msgstr ""
+
+#: extension/filefuncs.c:445
+#, fuzzy
+msgid "fill_path_element: could not set element"
+msgstr "index: otrzymano drugi argument, który nie jest łańcuchem"
+
+#: extension/filefuncs.c:461
+msgid "fill_error_element: could not set element"
+msgstr ""
+
+#: extension/filefuncs.c:508 extension/filefuncs.c:555
+msgid "fts-process: could not create array"
+msgstr ""
+
+#: extension/filefuncs.c:518 extension/filefuncs.c:565
+#: extension/filefuncs.c:583
+#, fuzzy
+msgid "fts-process: could not set element"
+msgstr "index: otrzymano drugi argument, który nie jest łańcuchem"
+
+#: extension/filefuncs.c:632
+#, fuzzy
+msgid "fts: called with incorrect number of arguments, expecting 3"
+msgstr "sqrt: wywołana z ujemnym argumentem %g"
+
+#: extension/filefuncs.c:635
+#, fuzzy
+msgid "fts: bad first parameter"
+msgstr "%s: jest parametrem\n"
+
+#: extension/filefuncs.c:641
+#, fuzzy
+msgid "fts: bad second parameter"
+msgstr "%s: jest parametrem\n"
+
+#: extension/filefuncs.c:647
+#, fuzzy
+msgid "fts: bad third parameter"
+msgstr "%s: jest parametrem\n"
+
+#: extension/filefuncs.c:654
+#, fuzzy
+msgid "fts: could not flatten array\n"
+msgstr "`%s' nie jest dozwolonÄ… nazwÄ… zmiennej"
+
+#: extension/filefuncs.c:672
+msgid "fts: ignoring sneaky FTS_NOSTAT flag. nyah, nyah, nyah."
+msgstr ""
+
+#: extension/filefuncs.c:689
+msgid "fts: clear_array failed\n"
+msgstr ""
+
+#: extension/fnmatch.c:91
+#, fuzzy
+msgid "fnmatch: called with less than three arguments"
+msgstr "sqrt: wywołana z ujemnym argumentem %g"
+
+#: extension/fnmatch.c:94
+#, fuzzy
+msgid "fnmatch: called with more than three arguments"
+msgstr "sqrt: wywołana z ujemnym argumentem %g"
+
+#: extension/fnmatch.c:97
+#, fuzzy
+msgid "fnmatch: could not get first argument"
+msgstr "strftime: otrzymano pierwszy argument, który nie jest łańcuchem"
+
+#: extension/fnmatch.c:102
+#, fuzzy
+msgid "fnmatch: could not get second argument"
+msgstr "index: otrzymano drugi argument, który nie jest łańcuchem"
+
+#: extension/fnmatch.c:107
+msgid "fnmatch: could not get third argument"
+msgstr ""
+
+#: extension/fnmatch.c:120
+msgid "fnmatch is not implemented on this system\n"
+msgstr ""
+
+#: extension/fnmatch.c:152
+msgid "fnmatch init: could not add FNM_NOMATCH variable"
+msgstr ""
+
+#: extension/fnmatch.c:162
+#, c-format
+msgid "fnmatch init: could not set array element %s"
+msgstr ""
+
+#: extension/fnmatch.c:172
+msgid "fnmatch init: could not install FNM array"
+msgstr ""
+
+#: extension/fork.c:81
+#, fuzzy
+msgid "fork: called with too many arguments"
+msgstr "sqrt: wywołana z ujemnym argumentem %g"
+
+#: extension/fork.c:94
+msgid "fork: PROCINFO is not an array!"
+msgstr ""
+
+#: extension/fork.c:118
+#, fuzzy
+msgid "waitpid: called with too many arguments"
+msgstr "sqrt: wywołana z ujemnym argumentem %g"
+
+#: extension/fork.c:126
+#, fuzzy
+msgid "wait: called with no arguments"
+msgstr "sqrt: wywołana z ujemnym argumentem %g"
+
+#: extension/fork.c:143
+#, fuzzy
+msgid "wait: called with too many arguments"
+msgstr "sqrt: wywołana z ujemnym argumentem %g"
+
+#: extension/ordchr.c:69
+#, fuzzy
+msgid "ord: called with too many arguments"
+msgstr "sqrt: wywołana z ujemnym argumentem %g"
+
+#: extension/ordchr.c:75
+#, fuzzy
+msgid "ord: called with no arguments"
+msgstr "sqrt: wywołana z ujemnym argumentem %g"
+
+#: extension/ordchr.c:77
+#, fuzzy
+msgid "ord: called with inappropriate argument(s)"
+msgstr "sqrt: wywołana z ujemnym argumentem %g"
+
+#: extension/ordchr.c:99
+#, fuzzy
+msgid "chr: called with too many arguments"
+msgstr "sqrt: wywołana z ujemnym argumentem %g"
+
+#: extension/ordchr.c:109
+#, fuzzy
+msgid "chr: called with no arguments"
+msgstr "sqrt: wywołana z ujemnym argumentem %g"
+
+#: extension/ordchr.c:111
+#, fuzzy
+msgid "chr: called with inappropriate argument(s)"
+msgstr "sqrt: wywołana z ujemnym argumentem %g"
-#: field.c:328
+#: extension/readfile.c:81
+#, fuzzy
+msgid "readfile: called with too many arguments"
+msgstr "sqrt: wywołana z ujemnym argumentem %g"
+
+#: extension/readfile.c:114
+#, fuzzy
+msgid "readfile: called with no arguments"
+msgstr "sqrt: wywołana z ujemnym argumentem %g"
+
+#: extension/rwarray.c:120
+#, fuzzy
+msgid "writea: called with too many arguments"
+msgstr "sqrt: wywołana z ujemnym argumentem %g"
+
+#: extension/rwarray.c:127
+#, fuzzy, c-format
+msgid "do_writea: argument 0 is not a string\n"
+msgstr "exp: argument %g jest poza zasięgiem"
+
+#: extension/rwarray.c:133
+#, fuzzy, c-format
+msgid "do_writea: argument 1 is not an array\n"
+msgstr "split: czwarty argument nie jest tablicÄ…"
+
+#: extension/rwarray.c:180
+#, c-format
+msgid "write_array: could not flatten array\n"
+msgstr ""
+
+#: extension/rwarray.c:194
+#, c-format
+msgid "write_array: could not release flattened array\n"
+msgstr ""
+
+#: extension/rwarray.c:276
+#, fuzzy
+msgid "reada: called with too many arguments"
+msgstr "sqrt: wywołana z ujemnym argumentem %g"
+
+#: extension/rwarray.c:283
+#, fuzzy, c-format
+msgid "do_reada: argument 0 is not a string\n"
+msgstr "exp: argument %g jest poza zasięgiem"
+
+#: extension/rwarray.c:289
+#, fuzzy, c-format
+msgid "do_reada: argument 1 is not an array\n"
+msgstr "match: otrzymano trzeci argument, który nie jest tablicą"
+
+#: extension/rwarray.c:333
+#, c-format
+msgid "do_reada: clear_array failed\n"
+msgstr ""
+
+#: extension/rwarray.c:370
+#, c-format
+msgid "read_array: set_array_element failed\n"
+msgstr ""
+
+#: extension/time.c:78
+#, fuzzy
+msgid "gettimeofday: ignoring arguments"
+msgstr "mktime: otrzymano argument, który nie jest łańcuchem"
+
+#: extension/time.c:109
+msgid "gettimeofday: not supported on this platform"
+msgstr ""
+
+#: extension/time.c:130
+#, fuzzy
+msgid "sleep: called with too many arguments"
+msgstr "sqrt: wywołana z ujemnym argumentem %g"
+
+#: extension/time.c:133
+#, fuzzy
+msgid "sleep: missing required numeric argument"
+msgstr "exp: otrzymano argument nie będący liczbą"
+
+#: extension/time.c:139
+#, fuzzy
+msgid "sleep: argument is negative"
+msgstr "exp: argument %g jest poza zasięgiem"
+
+#: extension/time.c:166
+msgid "sleep: not supported on this platform"
+msgstr ""
+
+#: field.c:339
msgid "NF set to negative value"
msgstr "NF ustawiony na wartość ujemną"
-#: field.c:951 field.c:958 field.c:962
+#: field.c:962 field.c:969 field.c:973
msgid "split: fourth argument is a gawk extension"
msgstr "split: czwarty argument jest rozszerzeniem gawk"
-#: field.c:955
+#: field.c:966
msgid "split: fourth argument is not an array"
msgstr "split: czwarty argument nie jest tablicÄ…"
-#: field.c:969
+#: field.c:980
msgid "split: second argument is not an array"
msgstr "split: drugi argument nie jest tablicÄ…"
-#: field.c:973
+#: field.c:984
msgid "split: cannot use the same array for second and fourth args"
msgstr ""
"split: nie można użyć tej samej tablicy dla drugiego i czwartego argumentu"
-#: field.c:978
+#: field.c:989
msgid "split: cannot use a subarray of second arg for fourth arg"
msgstr ""
"split: nie można użyć podtablicy drugiego argumentu dla czwartego argumentu"
-#: field.c:981
+#: field.c:992
msgid "split: cannot use a subarray of fourth arg for second arg"
msgstr ""
"split: nie można użyć podtablicy czwartego argumentu dla drugiego argumentu"
-#: field.c:1010
+#: field.c:1021
msgid "split: null string for third arg is a gawk extension"
msgstr "split: zerowy łańcuch dla trzeciego argumentu jest rozszerzeniem gawk"
-#: field.c:1050
+#: field.c:1061
msgid "patsplit: fourth argument is not an array"
msgstr "patsplit: czwarty argument nie jest tablicÄ…"
-#: field.c:1055
+#: field.c:1066
msgid "patsplit: second argument is not an array"
msgstr "patsplit: drugi argument nie jest tablicÄ…"
-#: field.c:1061
+#: field.c:1072
msgid "patsplit: third argument must be non-null"
msgstr "patsplit: trzeci argument nie może być pusty"
-#: field.c:1065
+#: field.c:1076
msgid "patsplit: cannot use the same array for second and fourth args"
msgstr ""
"patsplit: nie można użyć tej samej tablicy dla drugiego i czwartego argumentu"
-#: field.c:1070
+#: field.c:1081
msgid "patsplit: cannot use a subarray of second arg for fourth arg"
msgstr ""
"patsplit: nie można użyć podtablicy drugiego argumentu dla czwartego "
"argumentu"
-#: field.c:1073
+#: field.c:1084
msgid "patsplit: cannot use a subarray of fourth arg for second arg"
msgstr ""
"patsplit: nie można użyć podtablicy czwartego argumentu dla drugiego "
"argumentu"
-#: field.c:1110
+#: field.c:1122
msgid "`FIELDWIDTHS' is a gawk extension"
msgstr "`FIELDWIDTHS' jest rozszerzeniem gawk"
-#: field.c:1173
+#: field.c:1186
#, c-format
msgid "invalid FIELDWIDTHS value, near `%s'"
msgstr "nieprawidłowa wartość FIELDWIDTHS, w pobliżu `%s'"
-#: field.c:1246
+#: field.c:1259
msgid "null string for `FS' is a gawk extension"
msgstr "zerowy łańcuch dla `FS' jest rozszerzeniem gawk"
-#: field.c:1250
+#: field.c:1263
msgid "old awk does not support regexps as value of `FS'"
msgstr "stary awk nie wspiera wyrażeń regularnych jako wartości `FS'"
-#: field.c:1369
+#: field.c:1382
msgid "`FPAT' is a gawk extension"
msgstr "`FPAT' jest rozszerzeniem gawk"
+#: gawkapi.c:143
+msgid "awk_value_to_node: received null retval"
+msgstr ""
+
+#: gawkapi.c:932
+#, c-format
+msgid "api_flatten_array: could not convert index %d\n"
+msgstr ""
+
+#: gawkapi.c:937
+#, c-format
+msgid "api_flatten_array: could not convert value %d\n"
+msgstr ""
+
+#: gawkapi.c:1111
+msgid "cannot assign to defined constant"
+msgstr ""
+
#: getopt.c:604 getopt.c:633
#, fuzzy, c-format
msgid "%s: option '%s' is ambiguous; possibilities:"
@@ -1354,476 +2433,540 @@ msgstr "%s: opcja '-W %s' nie może mieć argumentów\n"
msgid "%s: option '-W %s' requires an argument\n"
msgstr "%s: opcja '-W %s' wymaga argumentu\n"
-#: io.c:280
+#: io.c:339
#, c-format
msgid "command line argument `%s' is a directory: skipped"
msgstr "argument linii poleceń `%s' jest katalogiem: pominięto"
-#: io.c:283 io.c:385
+#: io.c:342 io.c:455
#, c-format
msgid "cannot open file `%s' for reading (%s)"
msgstr "nie można otworzyć pliku `%s' do czytania (%s)"
-#: io.c:501
+#: io.c:582
#, c-format
msgid "close of fd %d (`%s') failed (%s)"
msgstr "zamknięcie fd %d (`%s') nie powiodło się (%s)"
-#: io.c:578
+#: io.c:658
msgid "redirection not allowed in sandbox mode"
msgstr "przekierowanie nie jest dozwolone w trybie piaskownicy"
-#: io.c:612
+#: io.c:692
#, c-format
msgid "expression in `%s' redirection only has numeric value"
msgstr "wyrażenie w przekierowaniu `%s' ma tylko wartość numeryczną"
-#: io.c:618
+#: io.c:698
#, c-format
msgid "expression for `%s' redirection has null string value"
msgstr "wyrażenie dla przekierowania `%s' ma zerową wartość łańcucha"
-#: io.c:623
+#: io.c:703
#, c-format
msgid "filename `%s' for `%s' redirection may be result of logical expression"
msgstr ""
"nazwa pliku `%s' dla przekierowania `%s' może być rezultatem logicznego "
"wyrażenia"
-#: io.c:666
+#: io.c:746
#, c-format
msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
msgstr "niepotrzebne mieszanie `>' i `>>' dla pliku `%.*s'"
-#: io.c:719
+#: io.c:799
#, c-format
msgid "can't open pipe `%s' for output (%s)"
msgstr "nie można otworzyć potoku `%s' jako wyjścia (%s)"
-#: io.c:729
+#: io.c:809
#, c-format
msgid "can't open pipe `%s' for input (%s)"
msgstr "nie można otworzyć potoku `%s' jako wejścia (%s)"
-#: io.c:752
+#: io.c:840
#, c-format
msgid "can't open two way pipe `%s' for input/output (%s)"
msgstr ""
"nie można otworzyć dwukierunkowego potoku `%s' jako wejścia/wyjścia (%s)"
-#: io.c:834
+#: io.c:923
#, c-format
msgid "can't redirect from `%s' (%s)"
msgstr "nie można przekierować z `%s' (%s)"
-#: io.c:837
+#: io.c:926
#, c-format
msgid "can't redirect to `%s' (%s)"
msgstr "nie można przekierować do `%s' (%s)"
-#: io.c:888
+#: io.c:977
msgid ""
"reached system limit for open files: starting to multiplex file descriptors"
msgstr ""
"osiągnięto systemowy limit otwartych plików: rozpoczęcie multipleksowania "
"deskryptorów plików"
-#: io.c:904
+#: io.c:993
#, c-format
msgid "close of `%s' failed (%s)."
msgstr "zamknięcie `%s' nie powiodło się (%s)."
-#: io.c:912
+#: io.c:1001
msgid "too many pipes or input files open"
msgstr "zbyt dużo otwartych potoków lub plików wejściowych"
-#: io.c:934
+#: io.c:1023
msgid "close: second argument must be `to' or `from'"
msgstr "close: drugim argumentem musi być `to' lub `from'"
-#: io.c:951
+#: io.c:1040
#, c-format
msgid "close: `%.*s' is not an open file, pipe or co-process"
msgstr ""
"close: `%.*s' nie jest ani otwartym plikiem, ani potokiem, ani procesem"
-#: io.c:956
+#: io.c:1045
msgid "close of redirection that was never opened"
msgstr "zamknięcie przekierowania, które nigdy nie zostało otwarte"
-#: io.c:1053
+#: io.c:1142
#, c-format
msgid "close: redirection `%s' not opened with `|&', second argument ignored"
msgstr ""
"close: przekierowanie `%s' nie zostało otwarte z `|&', drugi argument "
"zignorowany"
-#: io.c:1069
+#: io.c:1159
#, c-format
msgid "failure status (%d) on pipe close of `%s' (%s)"
msgstr "status awarii (%d) podczas zamykania potoku `%s' (%s)"
-#: io.c:1072
+#: io.c:1162
#, c-format
msgid "failure status (%d) on file close of `%s' (%s)"
msgstr "status awarii (%d) podczas zamykania pliku `%s' (%s)"
-#: io.c:1092
+#: io.c:1182
#, c-format
msgid "no explicit close of socket `%s' provided"
msgstr "brak jawnego zamknięcia gniazdka `%s'"
-#: io.c:1095
+#: io.c:1185
#, c-format
msgid "no explicit close of co-process `%s' provided"
msgstr "brak jawnego zamknięcia procesu pomocniczego `%s'"
-#: io.c:1098
+#: io.c:1188
#, c-format
msgid "no explicit close of pipe `%s' provided"
msgstr "brak jawnego zamknięcia potoku `%s'"
-#: io.c:1101
+#: io.c:1191
#, c-format
msgid "no explicit close of file `%s' provided"
msgstr "brak jawnego zamknięcia pliku `%s'"
-#: io.c:1129 io.c:1184 main.c:797 main.c:834
+#: io.c:1219 io.c:1274 main.c:847 main.c:884
#, c-format
msgid "error writing standard output (%s)"
msgstr "błąd podczas zapisu na standardowe wyjście (%s)"
-#: io.c:1133 io.c:1189
+#: io.c:1223 io.c:1279
#, c-format
msgid "error writing standard error (%s)"
msgstr "błąd podczas zapisu na standardowe wyjście diagnostyczne (%s)"
-#: io.c:1141
+#: io.c:1231
#, c-format
msgid "pipe flush of `%s' failed (%s)."
msgstr "opróżnienie potoku `%s' nie powiodło się (%s)."
-#: io.c:1144
+#: io.c:1234
#, c-format
msgid "co-process flush of pipe to `%s' failed (%s)."
msgstr ""
"opróżnienie potoku do `%s' przez proces pomocniczy nie powiodło się (%s)."
-#: io.c:1147
+#: io.c:1237
#, c-format
msgid "file flush of `%s' failed (%s)."
msgstr "opróżnienie pliku `%s' nie powiodło się (%s)."
-#: io.c:1262
+#: io.c:1351
#, c-format
msgid "local port %s invalid in `/inet'"
msgstr "nieprawidłowy lokalny port %s w `/inet'"
-#: io.c:1279
+#: io.c:1369
#, c-format
msgid "remote host and port information (%s, %s) invalid"
msgstr "informacje o zdalnym hoście i porcie są nieprawidłowe (%s, %s)"
-#: io.c:1431
+#: io.c:1521
#, c-format
msgid "no (known) protocol supplied in special filename `%s'"
msgstr "nie dostarczono (znanego) protokołu w specjalnym pliku `%s'"
-#: io.c:1445
+#: io.c:1535
#, c-format
msgid "special file name `%s' is incomplete"
msgstr "specjalna nazwa pliku `%s' jest niekompletna"
-#: io.c:1462
+#: io.c:1552
msgid "must supply a remote hostname to `/inet'"
msgstr "należy dostarczyć nazwę zdalnego hosta do `/inet'"
-#: io.c:1480
+#: io.c:1570
msgid "must supply a remote port to `/inet'"
msgstr "należy dostarczyć numer zdalnego portu do `/inet'"
-#: io.c:1526
+#: io.c:1616
msgid "TCP/IP communications are not supported"
msgstr "Komunikacja TCP/IP nie jest wspierana"
-#: io.c:1693
+#: io.c:1785
#, c-format
msgid "could not open `%s', mode `%s'"
msgstr "nie można otworzyć `%s', tryb `%s'"
-#: io.c:1747
+#: io.c:1835
#, c-format
msgid "close of master pty failed (%s)"
msgstr "zamknięcie nadrzędnego pty nie powiodło się (%s)"
-#: io.c:1749 io.c:1917 io.c:2074
+#: io.c:1837 io.c:2012 io.c:2181
#, c-format
msgid "close of stdout in child failed (%s)"
msgstr ""
"zamknięcie standardowego wyjścia w procesie potomnym nie powiodło się (%s)"
-#: io.c:1752
+#: io.c:1840
#, c-format
msgid "moving slave pty to stdout in child failed (dup: %s)"
msgstr ""
"przesunięcie podległego pty na standardowe wyjście w procesie potomnym nie "
"powiodło się (dup: %s)"
-#: io.c:1754 io.c:1922
+#: io.c:1842 io.c:2017
#, c-format
msgid "close of stdin in child failed (%s)"
msgstr ""
"zamknięcie standardowego wejścia w procesie potomnym nie powiodło się (%s)"
-#: io.c:1757
+#: io.c:1845
#, c-format
msgid "moving slave pty to stdin in child failed (dup: %s)"
msgstr ""
"przesunięcie podległego pty na standardowe wejście w procesie potomnym nie "
"powiodło się (dup: %s)"
-#: io.c:1759 io.c:1780
+#: io.c:1847 io.c:1868
#, c-format
msgid "close of slave pty failed (%s)"
msgstr "zamknięcie podległego pty nie powiodło się (%s)"
-#: io.c:1858 io.c:1920 io.c:2052 io.c:2077
+#: io.c:1953 io.c:2015 io.c:2158 io.c:2184
#, c-format
msgid "moving pipe to stdout in child failed (dup: %s)"
msgstr ""
"przesunięcie potoku na standardowe wyjście w procesie potomnym nie powiodło "
"siÄ™ (dup: %s)"
-#: io.c:1865 io.c:1925
+#: io.c:1960 io.c:2020
#, c-format
msgid "moving pipe to stdin in child failed (dup: %s)"
msgstr ""
"przesunięcie potoku na standardowe wejście w procesie potomnym nie powiodło "
"siÄ™ (dup: %s)"
-#: io.c:1885 io.c:2067
+#: io.c:1980 io.c:2174
msgid "restoring stdout in parent process failed\n"
msgstr ""
"odzyskanie standardowego wyjścia w procesie potomnym nie powiodło się\n"
-#: io.c:1893
+#: io.c:1988
msgid "restoring stdin in parent process failed\n"
msgstr ""
"odzyskanie standardowego wejścia w procesie potomnym nie powiodło się\n"
-#: io.c:1928 io.c:2079 io.c:2093
+#: io.c:2023 io.c:2186 io.c:2200
#, c-format
msgid "close of pipe failed (%s)"
msgstr "zamknięcie potoku nie powiodło się (%s)"
-#: io.c:1973
+#: io.c:2076
msgid "`|&' not supported"
msgstr "`|&' nie jest wspierany"
-#: io.c:2039
+#: io.c:2143
#, c-format
msgid "cannot open pipe `%s' (%s)"
msgstr "nie można otworzyć potoku `%s' (%s)"
-#: io.c:2087
+#: io.c:2194
#, c-format
msgid "cannot create child process for `%s' (fork: %s)"
msgstr "nie można utworzyć procesu potomnego dla `%s' (fork: %s)"
-#: io.c:2520
+#: io.c:2652
+msgid "register_input_parser: received NULL pointer"
+msgstr ""
+
+#: io.c:2680
+#, c-format
+msgid "input parser `%s' conflicts with previously installed input parser `%s'"
+msgstr ""
+
+#: io.c:2687
+#, c-format
+msgid "input parser `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2707
+msgid "register_output_wrapper: received NULL pointer"
+msgstr ""
+
+#: io.c:2735
+#, c-format
+msgid ""
+"output wrapper `%s' conflicts with previously installed output wrapper `%s'"
+msgstr ""
+
+#: io.c:2742
+#, c-format
+msgid "output wrapper `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2763
+msgid "register_output_processor: received NULL pointer"
+msgstr ""
+
+#: io.c:2792
+#, c-format
+msgid ""
+"two-way processor `%s' conflicts with previously installed two-way processor "
+"`%s'"
+msgstr ""
+
+#: io.c:2801
+#, c-format
+msgid "two way processor `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2908
#, c-format
msgid "data file `%s' is empty"
msgstr "plik danych `%s' jest pusty"
-#: io.c:2561 io.c:2569
+#: io.c:2950 io.c:2958
msgid "could not allocate more input memory"
msgstr "nie można zarezerwować więcej pamięci wejściowej"
-#: io.c:3127
+#: io.c:3524
msgid "multicharacter value of `RS' is a gawk extension"
msgstr "wieloznakowa wartość `RS' jest rozszerzeniem gawk"
-#: io.c:3232
+#: io.c:3613
msgid "IPv6 communication is not supported"
msgstr "Komunikacja IPv6 nie jest wspierana"
-#: main.c:366
+#: main.c:362
msgid "`-m[fr]' option irrelevant in gawk"
msgstr "nieistotna opcja `-m[fr]' w gawk"
-#: main.c:368
+#: main.c:364
msgid "-m option usage: `-m[fr] nnn'"
msgstr "użycie opcji -m: `-m[fr] nnn'"
-#: main.c:391
+#: main.c:393
msgid "empty argument to `-e/--source' ignored"
msgstr "pusty argument dla opcji `-e/--source' został zignorowany"
-#: main.c:462
+#: main.c:483
#, c-format
msgid "%s: option `-W %s' unrecognized, ignored\n"
msgstr "%s: opcja `-W %s' nierozpoznana i zignorowana\n"
-#: main.c:515
+#: main.c:529
#, c-format
msgid "%s: option requires an argument -- %c\n"
msgstr "%s: opcja musi mieć argument -- %c\n"
-#: main.c:536
+#: main.c:550
msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
msgstr ""
"zmienna środowiskowa `POSIXLY_CORRECT' ustawiona: `--posix' został włączony"
-#: main.c:542
+#: main.c:556
msgid "`--posix' overrides `--traditional'"
msgstr "opcja `--posix' zostanie użyta nad `--traditional'"
-#: main.c:553
+#: main.c:567
msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
msgstr "`--posix'/`--traditional' użyte nad opcją `--non-decimal-data'"
-#: main.c:557
+#: main.c:571
#, c-format
msgid "running %s setuid root may be a security problem"
msgstr ""
"uruchamianie %s setuid root może być problemem pod względem bezpieczeństwa"
-#: main.c:562
+#: main.c:576
#, fuzzy
msgid "`--posix' overrides `--characters-as-bytes'"
msgstr "opcja `--posix' zostanie użyta nad `--binary'"
-#: main.c:616
+#: main.c:635
#, c-format
msgid "can't set binary mode on stdin (%s)"
msgstr "nie można ustawić trybu binarnego na standardowym wejściu (%s)"
-#: main.c:619
+#: main.c:638
#, c-format
msgid "can't set binary mode on stdout (%s)"
msgstr "nie można ustawić trybu binarnego na standardowym wyjściu (%s)"
-#: main.c:621
+#: main.c:640
#, c-format
msgid "can't set binary mode on stderr (%s)"
msgstr "nie można ustawić trybu binarnego na wyjściu diagnostycznym (%s)"
-#: main.c:660
+#: main.c:698
msgid "no program text at all!"
msgstr "brak tekstu programu!"
-#: main.c:737
+#: main.c:784
#, c-format
msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"
msgstr ""
"Użycie: %s [styl opcji POSIX lub GNU] -f plik_z_programem [--] plik ...\n"
-#: main.c:739
+#: main.c:786
#, c-format
msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"
msgstr "Użycie: %s [styl opcji POSIX lub GNU] [--] %cprogram%c plik ...\n"
-#: main.c:744
+#: main.c:791
msgid "POSIX options:\t\tGNU long options: (standard)\n"
msgstr "Opcje POSIX:\t\tDÅ‚ugie opcje GNU (standard):\n"
-#: main.c:745
+#: main.c:792
msgid "\t-f progfile\t\t--file=progfile\n"
msgstr "\t-f program\t\t--file=program\n"
-#: main.c:746
+#: main.c:793
msgid "\t-F fs\t\t\t--field-separator=fs\n"
msgstr "\t-F fs\t\t\t--field-separator=fs\n"
-#: main.c:747
+#: main.c:794
msgid "\t-v var=val\t\t--assign=var=val\n"
msgstr "\t-v zmienna=wartość\t--assign=zmienna=wartość\n"
-#: main.c:748
+#: main.c:795
msgid "Short options:\t\tGNU long options: (extensions)\n"
msgstr "Krótkie opcje:\t\tDługie opcje GNU: (rozszerzenia)\n"
-#: main.c:749
+#: main.c:796
msgid "\t-b\t\t\t--characters-as-bytes\n"
msgstr "\t-b\t\t\t--characters-as-bytes\n"
-#: main.c:750
+#: main.c:797
msgid "\t-c\t\t\t--traditional\n"
msgstr "\t-c\t\t\t--traditional\n"
-#: main.c:751
+#: main.c:798
msgid "\t-C\t\t\t--copyright\n"
msgstr "\t-C\t\t\t--copyright\n"
-#: main.c:752
+#: main.c:799
msgid "\t-d[file]\t\t--dump-variables[=file]\n"
msgstr "\t-d[plik]\t\t--dump-variables[=plik]\n"
-#: main.c:753
+#: main.c:800
+#, fuzzy
+msgid "\t-D[file]\t\t--debug[=file]\n"
+msgstr "\t-p[plik]\t\t--profile[=plik]\n"
+
+#: main.c:801
msgid "\t-e 'program-text'\t--source='program-text'\n"
msgstr "\t-e 'tekst-programu'\t--source='tekst-programu'\n"
-#: main.c:754
+#: main.c:802
msgid "\t-E file\t\t\t--exec=file\n"
msgstr "\t-E plik\t\t\t--exec=plik\n"
-#: main.c:755
+#: main.c:803
msgid "\t-g\t\t\t--gen-pot\n"
msgstr "\t-g\t\t\t--gen-pot\n"
-#: main.c:756
+#: main.c:804
msgid "\t-h\t\t\t--help\n"
msgstr "\t-h\t\t\t--help\n"
-#: main.c:757
+#: main.c:805
+msgid "\t-i includefile\t\t--include=includefile\n"
+msgstr ""
+
+#: main.c:806
+msgid "\t-l library\t\t--load=library\n"
+msgstr ""
+
+#: main.c:807
msgid "\t-L [fatal]\t\t--lint[=fatal]\n"
msgstr "\t-L [fatal]\t\t--lint[=fatal]\n"
-#: main.c:758
+#: main.c:808
msgid "\t-n\t\t\t--non-decimal-data\n"
msgstr "\t-n\t\t\t--non-decimal-data\n"
-#: main.c:759
+#: main.c:809
+#, fuzzy
+msgid "\t-M\t\t\t--bignum\n"
+msgstr "\t-g\t\t\t--gen-pot\n"
+
+#: main.c:810
msgid "\t-N\t\t\t--use-lc-numeric\n"
msgstr "\t-N\t\t\t--use-lc-numeric\n"
-#: main.c:760
+#: main.c:811
+#, fuzzy
+msgid "\t-o[file]\t\t--pretty-print[=file]\n"
+msgstr "\t-p[plik]\t\t--profile[=plik]\n"
+
+#: main.c:812
msgid "\t-O\t\t\t--optimize\n"
msgstr "\t-O\t\t\t--optimize\n"
-#: main.c:761
+#: main.c:813
msgid "\t-p[file]\t\t--profile[=file]\n"
msgstr "\t-p[plik]\t\t--profile[=plik]\n"
-#: main.c:762
+#: main.c:814
msgid "\t-P\t\t\t--posix\n"
msgstr "\t-P\t\t\t--posix\n"
-#: main.c:763
+#: main.c:815
msgid "\t-r\t\t\t--re-interval\n"
msgstr "\t-r\t\t\t--re-interval\n"
-#: main.c:765
-msgid "\t-R file\t\t\t--command=file\n"
-msgstr "\t-R plik\t\t\t--command=plik\n"
-
-#: main.c:766
+#: main.c:816
msgid "\t-S\t\t\t--sandbox\n"
msgstr "\t-S\t\t\t--sandbox\n"
-#: main.c:767
+#: main.c:817
msgid "\t-t\t\t\t--lint-old\n"
msgstr "\t-t\t\t\t--lint-old\n"
-#: main.c:768
+#: main.c:818
msgid "\t-V\t\t\t--version\n"
msgstr "\t-V\t\t\t--version\n"
-#: main.c:770
+#: main.c:820
msgid "\t-W nostalgia\t\t--nostalgia\n"
msgstr "\t-W nostalgia\t\t--nostalgia\n"
-#: main.c:773
+#: main.c:823
msgid "\t-Y\t\t--parsedebug\n"
msgstr "\t-Y\t\t--parsedebug\n"
@@ -1832,7 +2975,7 @@ msgstr "\t-Y\t\t--parsedebug\n"
#. for this application. Please add _another line_ with the
#. address for translation bugs.
#. no-wrap
-#: main.c:782
+#: main.c:832
msgid ""
"\n"
"To report bugs, see node `Bugs' in `gawk.info', which is\n"
@@ -1845,7 +2988,7 @@ msgstr ""
"dokumentacji.\n"
"\n"
-#: main.c:786
+#: main.c:836
msgid ""
"gawk is a pattern scanning and processing language.\n"
"By default it reads standard input and writes standard output.\n"
@@ -1855,7 +2998,7 @@ msgstr ""
"Program domyślnie czyta standardowe wejście i zapisuje standardowe wyjście.\n"
"\n"
-#: main.c:790
+#: main.c:840
msgid ""
"Examples:\n"
"\tgawk '{ sum += $1 }; END { print sum }' file\n"
@@ -1865,7 +3008,7 @@ msgstr ""
"\tgawk '{ suma += $1 }; END { print suma }' plik\n"
"\tgawk -F: '{ print $1 }' /etc/passwd\n"
-#: main.c:810
+#: main.c:860
#, c-format
msgid ""
"Copyright (C) 1989, 1991-%d Free Software Foundation.\n"
@@ -1884,7 +3027,7 @@ msgstr ""
"tej Licencji lub którejś z późniejszych wersji.\n"
"\n"
-#: main.c:818
+#: main.c:868
msgid ""
"This program is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
@@ -1899,7 +3042,7 @@ msgstr ""
"PowszechnÄ… LicencjÄ™ PublicznÄ… GNU.\n"
"\n"
-#: main.c:824
+#: main.c:874
msgid ""
"You should have received a copy of the GNU General Public License\n"
"along with this program. If not, see http://www.gnu.org/licenses/.\n"
@@ -1908,16 +3051,16 @@ msgstr ""
"Powszechnej Licencji Publicznej GNU (GNU General Public License);\n"
"jeśli zaś nie - odwiedź stronę http://www.gnu.org/licenses/.\n"
-#: main.c:859
+#: main.c:909
msgid "-Ft does not set FS to tab in POSIX awk"
msgstr "-Ft nie ustawia FS na znak tabulatora w POSIX awk"
-#: main.c:1093
+#: main.c:1169
#, c-format
msgid "unknown value for field spec: %d\n"
msgstr "nieznana wartość dla specyfikacji pola: %d\n"
-#: main.c:1174
+#: main.c:1267
#, c-format
msgid ""
"%s: `%s' argument to `-v' not in `var=value' form\n"
@@ -1926,79 +3069,145 @@ msgstr ""
"%s: argument `%s' dla `-v' nie jest zgodny ze składnią `zmienna=wartość'\n"
"\n"
-#: main.c:1200
+#: main.c:1293
#, c-format
msgid "`%s' is not a legal variable name"
msgstr "`%s' nie jest dozwolonÄ… nazwÄ… zmiennej"
-#: main.c:1203
+#: main.c:1296
#, c-format
msgid "`%s' is not a variable name, looking for file `%s=%s'"
msgstr "`%s' nie jest nazwÄ… zmiennej, szukanie pliku `%s=%s'"
-#: main.c:1207
+#: main.c:1300
#, c-format
msgid "cannot use gawk builtin `%s' as variable name"
msgstr "nie można użyć wbudowanej w gawk `%s' jako nazwy zmiennej"
-#: main.c:1212
+#: main.c:1305
#, c-format
msgid "cannot use function `%s' as variable name"
msgstr "nie można użyć funkcji `%s' jako nazwy zmiennej"
-#: main.c:1265
+#: main.c:1358
msgid "floating point exception"
msgstr "wyjÄ…tek zmiennopozycyjny"
-#: main.c:1272
+#: main.c:1365
msgid "fatal error: internal error"
msgstr "fatalny błąd: wewnętrzny błąd"
-#: main.c:1287
+#: main.c:1380
msgid "fatal error: internal error: segfault"
msgstr "fatalny błąd: wewnętrzny błąd: błąd segmentacji"
-#: main.c:1299
+#: main.c:1392
msgid "fatal error: internal error: stack overflow"
msgstr "fatalny błąd: wewnętrzny błąd: przepełnienie stosu"
-#: main.c:1349
+#: main.c:1448
#, c-format
msgid "no pre-opened fd %d"
msgstr "brak już otwartego fd %d"
-#: main.c:1356
+#: main.c:1455
#, c-format
msgid "could not pre-open /dev/null for fd %d"
msgstr "nie można otworzyć zawczasu /dev/null dla fd %d"
-#: msg.c:63
+#: mpfr.c:563
+#, fuzzy, c-format
+msgid "PREC value `%.*s' is invalid"
+msgstr "wartość BINMODE `%s' jest nieprawidłowa, przyjęto ją jako 3"
+
+#: mpfr.c:621
+#, fuzzy, c-format
+msgid "RNDMODE value `%.*s' is invalid"
+msgstr "wartość BINMODE `%s' jest nieprawidłowa, przyjęto ją jako 3"
+
+#: mpfr.c:711
+#, fuzzy, c-format
+msgid "%s: received non-numeric argument"
+msgstr "cos: otrzymano argument, który nie jest liczbą"
+
+#: mpfr.c:813
+#, fuzzy
+msgid "compl(%Rg): negative value will give strange results"
+msgstr "compl(%lf): ujemne wartości spowodują dziwne wyniki"
+
+#: mpfr.c:817
+#, fuzzy
+msgid "comp(%Rg): fractional value will be truncated"
+msgstr "compl(%lf): ułamkowe wartości zostaną obcięte"
+
+#: mpfr.c:829
+#, fuzzy, c-format
+msgid "cmpl(%Zd): negative values will give strange results"
+msgstr "compl(%lf): ujemne wartości spowodują dziwne wyniki"
+
+#: mpfr.c:856
+#, fuzzy, c-format
+msgid "%s: received non-numeric first argument"
+msgstr "or: otrzymano pierwszy argument, który nie jest liczbą"
+
+#: mpfr.c:858
+#, fuzzy, c-format
+msgid "%s: received non-numeric second argument"
+msgstr "or: otrzymano drugi argument, który nie jest liczbą"
+
+#: mpfr.c:877
+#, fuzzy
+msgid "%s(%Rg, ..): negative values will give strange results"
+msgstr "or(%lf, %lf): ujemne wartości spowodują dziwne wyniki"
+
+#: mpfr.c:882
+#, fuzzy
+msgid "%s(%Rg, ..): fractional values will be truncated"
+msgstr "or(%lf, %lf): ułamkowe wartości zostaną obcięte"
+
+#: mpfr.c:895
+#, fuzzy, c-format
+msgid "%s(%Zd, ..): negative values will give strange results"
+msgstr "or(%lf, %lf): ujemne wartości spowodują dziwne wyniki"
+
+#: mpfr.c:914
+#, fuzzy
+msgid "%s(.., %Rg): negative values will give strange results"
+msgstr "or(%lf, %lf): ujemne wartości spowodują dziwne wyniki"
+
+#: mpfr.c:919
+#, fuzzy
+msgid "%s(.., %Rg): fractional values will be truncated"
+msgstr "or(%lf, %lf): ułamkowe wartości zostaną obcięte"
+
+#: mpfr.c:932
+#, fuzzy, c-format
+msgid "%s(.., %Zd): negative values will give strange results"
+msgstr "or(%lf, %lf): ujemne wartości spowodują dziwne wyniki"
+
+#: msg.c:61
#, c-format
msgid "cmd. line:"
msgstr "linia poleceń:"
-#: msg.c:107
-msgid "error: "
-msgstr "błąd: "
-
-#: node.c:406
+#: node.c:436
msgid "backslash at end of string"
msgstr "backslash na końcu łańcucha"
-#: node.c:517
+#: node.c:520
#, c-format
msgid "old awk does not support the `\\%c' escape sequence"
msgstr "stary awk nie wspiera sekwencji ucieczki `\\%c'"
-#: node.c:568
+#: node.c:571
msgid "POSIX does not allow `\\x' escapes"
msgstr "POSIX nie zezwala na sekwencjÄ™ ucieczki `\\x'"
-#: node.c:574
+#: node.c:577
msgid "no hex digits in `\\x' escape sequence"
msgstr "brak liczb szesnastkowych w sekwencji ucieczki `\\x'"
-#: node.c:596
+#: node.c:599
#, c-format
msgid ""
"hex escape \\x%.*s of %d characters probably not interpreted the way you "
@@ -2007,12 +3216,12 @@ msgstr ""
"szesnastkowa sekwencja ucieczki \\x%.*s %d znaków prawdopodobnie nie została "
"zinterpretowana jak tego oczekujesz"
-#: node.c:611
+#: node.c:614
#, c-format
msgid "escape sequence `\\%c' treated as plain `%c'"
msgstr "sekwencja ucieczki `\\%c' potraktowana jako zwykłe `%c'"
-#: node.c:750
+#: node.c:759
msgid ""
"Invalid multibyte data detected. There may be a mismatch between your data "
"and your locale."
@@ -2020,26 +3229,26 @@ msgstr ""
"Wykryto nieprawidłowe dane. Możliwe jest niedopasowanie pomiędzy Twoimi "
"danymi a ustawieniami regionalnymi."
-#: posix/gawkmisc.c:176
+#: posix/gawkmisc.c:177
#, c-format
msgid "%s %s `%s': could not get fd flags: (fcntl F_GETFD: %s)"
msgstr "%s %s `%s': nie można uzyskać flag fd: (fcntl F_GETFD: %s)"
-#: posix/gawkmisc.c:188
+#: posix/gawkmisc.c:189
#, c-format
msgid "%s %s `%s': could not set close-on-exec: (fcntl F_SETFD: %s)"
msgstr "%s %s `%s': nie można ustawić close-on-exec: (fcntl F_SETFD: %s)"
-#: profile.c:83
+#: profile.c:70
#, c-format
msgid "could not open `%s' for writing: %s"
msgstr "nie można otworzyć `%s' do zapisu: %s"
-#: profile.c:85
+#: profile.c:72
msgid "sending profile to standard error"
msgstr "wysyłanie profilu na standardowe wyjście diagnostyczne"
-#: profile.c:203
+#: profile.c:188
#, c-format
msgid ""
"\t# %s block(s)\n"
@@ -2048,7 +3257,7 @@ msgstr ""
"\t# %s blok(i)\n"
"\n"
-#: profile.c:208
+#: profile.c:193
#, c-format
msgid ""
"\t# Rule(s)\n"
@@ -2057,17 +3266,22 @@ msgstr ""
"\t# Reguła(i)\n"
"\n"
-#: profile.c:279
+#: profile.c:267
#, c-format
msgid "internal error: %s with null vname"
msgstr "wewnętrzny błąd: %s z zerowym vname"
-#: profile.c:952
+#: profile.c:529
+#, fuzzy
+msgid "internal error: builtin with null fname"
+msgstr "wewnętrzny błąd: %s z zerowym vname"
+
+#: profile.c:944
#, c-format
msgid "\t# gawk profile, created %s\n"
msgstr "\t# profil programu gawk, utworzony %s\n"
-#: profile.c:1331
+#: profile.c:1329
#, c-format
msgid ""
"\n"
@@ -2076,17 +3290,17 @@ msgstr ""
"\n"
"\t# Funkcje, spis alfabetyczny\n"
-#: profile.c:1370
+#: profile.c:1367
#, c-format
msgid "redir2str: unknown redirection type %d"
msgstr "redir2str: nieznany typ przekierowania %d"
-#: re.c:573
+#: re.c:568
#, c-format
msgid "range of the form `[%c-%c]' is locale dependent"
msgstr "zasięg formy `[%c-%c]' jest zależny od lokalizacji"
-#: re.c:600
+#: re.c:595
#, c-format
msgid "regexp component `%.*s' should probably be `[%.*s]'"
msgstr "komponent regexp `%.*s' powinien być prawdopodobnie `[%.*s]'"
@@ -2131,10 +3345,6 @@ msgstr "Niedopasowany znak ( lub \\("
msgid "Unmatched \\{"
msgstr "Niedopasowany znak \\{"
-#: regcomp.c:161
-msgid "Invalid content of \\{\\}"
-msgstr "Nieprawidłowa zawartość \\{\\}"
-
#: regcomp.c:164
msgid "Invalid range end"
msgstr "Nieprawidłowy koniec zakresu"
@@ -2151,10 +3361,6 @@ msgstr "Nieprawidłowe poprzedzające wyrażenie regularne"
msgid "Premature end of regular expression"
msgstr "Przedwczesny koniec wyrażenia regularnego"
-#: regcomp.c:176
-msgid "Regular expression too big"
-msgstr "Wyrażenie regularne jest zbyt duże"
-
#: regcomp.c:179
msgid "Unmatched ) or \\)"
msgstr "Niedopasowany znak ) lub \\)"
@@ -2163,12 +3369,105 @@ msgstr "Niedopasowany znak ) lub \\)"
msgid "No previous regular expression"
msgstr "Brak poprzedniego wyrażenia regularnego"
+#: symbol.c:722
+msgid "can not pop main context"
+msgstr ""
+
#~ msgid "`nextfile' is a gawk extension"
#~ msgstr "`nextfile' jest rozszerzeniem gawk"
#~ msgid "`delete array' is a gawk extension"
#~ msgstr "`delete tablica' jest rozszerzeniem gawk"
+#~ msgid "and: received non-numeric first argument"
+#~ msgstr "and: otrzymano pierwszy argument, który nie jest liczbą"
+
+#~ msgid "and: received non-numeric second argument"
+#~ msgstr "and: otrzymano drugi argument, który nie jest liczbą"
+
+#~ msgid "and(%lf, %lf): fractional values will be truncated"
+#~ msgstr "and(%lf, %lf): ułamkowe wartości zostaną obcięte"
+
+#~ msgid "xor: received non-numeric first argument"
+#~ msgstr "xor: otrzymano pierwszy argument, który nie jest liczbą"
+
+#~ msgid "xor: received non-numeric second argument"
+#~ msgstr "xor: otrzymano drugi argument, który nie jest liczbą"
+
+#~ msgid "xor(%lf, %lf): fractional values will be truncated"
+#~ msgstr "xor(%lf, %lf): ułamkowe wartości zostaną obcięte"
+
+#~ msgid "`extension' is a gawk extension"
+#~ msgstr "`extension' jest rozszerzeniem gawk"
+
+#~ msgid "Operation Not Supported"
+#~ msgstr "Operacja nie jest wspierana"
+
+#~ msgid "attempt to use function `%s' as an array"
+#~ msgstr "próba użycia funkcji `%s' jako tablicy"
+
+#~ msgid "reference to uninitialized element `%s[\"%.*s\"]'"
+#~ msgstr "odwołanie do niezainicjowanego elementu `%s[\"%.*s\"]'"
+
+#~ msgid "subscript of array `%s' is null string"
+#~ msgstr "indeks tablicy `%s' jest zerowym łańcuchem"
+
+#~ msgid "%s: empty (null)\n"
+#~ msgstr "%s: pusty (null)\n"
+
+#~ msgid "%s: empty (zero)\n"
+#~ msgstr "%s: pusty (zero)\n"
+
+#~ msgid "%s: table_size = %d, array_size = %d\n"
+#~ msgstr "%s: table_size = %d, array_size = %d\n"
+
+#~ msgid "%s: array_ref to %s\n"
+#~ msgstr "%s: array_ref do %s\n"
+
+#~ msgid "use of non-array as array"
+#~ msgstr "użycie nie-tablicy jako tablicy"
+
+#~ msgid "can't use function name `%s' as variable or array"
+#~ msgstr "nie można użyć nazwy funkcji `%s' jako zmiennej lub tablicy"
+
+#~ msgid "assignment used in conditional context"
+#~ msgstr "przypisanie użyte w kontekście warunkowym"
+
+#~ msgid "statement has no effect"
+#~ msgstr "instrukcja nie ma żadnego efektu"
+
+#~ msgid ""
+#~ "for loop: array `%s' changed size from %ld to %ld during loop execution"
+#~ msgstr ""
+#~ "pętla for: tablica `%s' zmieniła rozmiar z %ld do %ld podczas wykonywania "
+#~ "pętli"
+
+#~ msgid "function called indirectly through `%s' does not exist"
+#~ msgstr "pośrednio wywołana funkcja poprzez `%s' nie istnieje"
+
+#~ msgid "function `%s' not defined"
+#~ msgstr "funkcja `%s' nie została zdefiniowana"
+
+#~ msgid "non-redirected `getline' invalid inside `%s' rule"
+#~ msgstr ""
+#~ "komenda `getline' bez przekierowania jest nieprawidłowa wewnątrz reguły `"
+#~ "%s'"
+
+#~ msgid "error reading input file `%s': %s"
+#~ msgstr "błąd podczas czytania z pliku `%s': %s"
+
+#~ msgid "`nextfile' cannot be called from a `%s' rule"
+#~ msgstr "instrukcja `nextfile' nie może być wywołana z wnętrza reguły `%s'"
+
+#~ msgid "`next' cannot be called from a `%s' rule"
+#~ msgstr "instrukcja `next' nie może być wywołana z wnętrza reguły `%s'"
+
+#~ msgid "Sorry, don't know how to interpret `%s'"
+#~ msgstr "Niestety nie wiem jak zinterpretować `%s'"
+
+#~ msgid "\t-R file\t\t\t--command=file\n"
+#~ msgstr "\t-R plik\t\t\t--command=plik\n"
+
#~ msgid "could not find groups: %s"
#~ msgstr "nie można znaleźć grup: %s"
@@ -2187,9 +3486,6 @@ msgstr "Brak poprzedniego wyrażenia regularnego"
#~ msgid "attempt to use scalar `%s' as array"
#~ msgstr "próba użycia skalaru `%s' jako tablicy"
-#~ msgid "attempt to use array `%s' in scalar context"
-#~ msgstr "próba użycia tablicy `%s' w kontekście skalaru"
-
#~ msgid "call of `length' without parentheses is deprecated by POSIX"
#~ msgstr ""
#~ "wywołanie `length' bez podania nawiasów jest niezalecane przez POSIX"
@@ -2336,26 +3632,8 @@ msgstr "Brak poprzedniego wyrażenia regularnego"
#~ msgid "gsub third parameter is not a changeable object"
#~ msgstr "trzeci parametr gsub nie jest zmiennym obiektem"
-#~ msgid "Unfinished \\ escape"
-#~ msgstr "Niedokończona sekwencja ucieczki \\"
-
#~ msgid "unfinished repeat count"
#~ msgstr "niedokończona liczba powtórzeń"
#~ msgid "malformed repeat count"
#~ msgstr "źle sformatowana liczba powtórzeń"
-
-#~ msgid "Unbalanced ["
-#~ msgstr "[ nie do pary"
-
-#~ msgid "Unbalanced ("
-#~ msgstr "( nie do pary"
-
-#~ msgid "No regexp syntax bits specified"
-#~ msgstr "Nie zostały podane bity składni wyrażenia regularnego"
-
-#~ msgid "Unbalanced )"
-#~ msgstr ") nie do pary"
-
-#~ msgid "internal error: file `%s', line %d\n"
-#~ msgstr "wewnętrzny błąd: plik `%s', linia %d\n"
diff --git a/po/pt_BR.gmo b/po/pt_BR.gmo
deleted file mode 100644
index 4cbc6792..00000000
--- a/po/pt_BR.gmo
+++ /dev/null
Binary files differ
diff --git a/po/ro.gmo b/po/ro.gmo
deleted file mode 100644
index e3534b89..00000000
--- a/po/ro.gmo
+++ /dev/null
Binary files differ
diff --git a/po/rw.gmo b/po/rw.gmo
deleted file mode 100644
index a08f9183..00000000
--- a/po/rw.gmo
+++ /dev/null
Binary files differ
diff --git a/po/sv.gmo b/po/sv.gmo
index 27b19149..12d5cc31 100644
--- a/po/sv.gmo
+++ b/po/sv.gmo
Binary files differ
diff --git a/po/sv.po b/po/sv.po
index 23861f67..5bf9d462 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gawk 4.0.0h\n"
"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
-"POT-Creation-Date: 2012-10-13 20:24+0200\n"
+"POT-Creation-Date: 2012-10-13 21:21+0200\n"
"PO-Revision-Date: 2012-01-30 12:07+0100\n"
"Last-Translator: Göran Uddeborg <goeran@uddeborg.se>\n"
"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
@@ -19,506 +19,497 @@ msgstr ""
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
-#: array.c:140
+#: array.c:266
#, c-format
msgid "from %s"
msgstr "från %s"
-#: array.c:248
+#: array.c:366
msgid "attempt to use a scalar value as array"
msgstr "försök att använda ett skalärt värde som vektor"
-#: array.c:251
-#, c-format
-msgid "attempt to use function `%s' as an array"
-msgstr "försök att använda funktionen \"%s\" som vektor"
-
-#: array.c:254
+#: array.c:368
#, c-format
msgid "attempt to use scalar parameter `%s' as an array"
msgstr "försök att använda skalärparametern \"%s\" som en vektor"
-#: array.c:257
+#: array.c:371
#, c-format
msgid "attempt to use scalar `%s' as an array"
msgstr "försök att använda skalären \"%s\" som en vektor"
-#: array.c:302 array.c:707 builtin.c:84 builtin.c:1385 builtin.c:1427
-#: builtin.c:1440 builtin.c:1859 builtin.c:1871 eval.c:1135 eval.c:1139
-#: eval.c:1495 eval.c:1812
+#: array.c:418 array.c:584 builtin.c:85 builtin.c:1566 builtin.c:1608
+#: builtin.c:1621 builtin.c:2047 builtin.c:2059 eval.c:1121 eval.c:1125
+#: eval.c:1520
#, c-format
msgid "attempt to use array `%s' in a scalar context"
msgstr "försök att använda vektorn \"%s\" i skalärsammanhang"
-#: array.c:513
-#, c-format
-msgid "reference to uninitialized element `%s[\"%.*s\"]'"
-msgstr "referens till oinitierat element \"%s[\"%.*s\"]\""
-
-#: array.c:519
-#, c-format
-msgid "subscript of array `%s' is null string"
-msgstr "index i vektorn \"%s\" är en tom sträng"
-
-#: array.c:723
+#: array.c:591
#, c-format
msgid "delete: index `%s' not in array `%s'"
msgstr "delete: index \"%s\" finns inte i vektorn \"%s\""
-#: array.c:734 eval.c:1865
+#: array.c:605
#, c-format
msgid "attempt to use scalar `%s[\"%.*s\"]' as an array"
msgstr "försök att använda skalären \"%s[\"%.*s\"]\" som en vektor"
-#: array.c:910
-#, c-format
-msgid "%s: empty (null)\n"
-msgstr "%s: tom (null)\n"
-
-#: array.c:915
-#, c-format
-msgid "%s: empty (zero)\n"
-msgstr "%s: tom (noll)\n"
-
-#: array.c:919
-#, c-format
-msgid "%s: table_size = %d, array_size = %d\n"
-msgstr "%s: tabellstorlek = %d, vektorstorlek = %d\n"
-
-#: array.c:954
-#, c-format
-msgid "%s: is parameter\n"
-msgstr "%s: är en parameter\n"
-
-#: array.c:958
-#, c-format
-msgid "%s: array_ref to %s\n"
-msgstr "%s: vektorreferens till %s\n"
-
-#: array.c:963
-msgid "adump: argument not an array"
+#: array.c:784
+#, fuzzy
+msgid "adump: first argument not an array"
msgstr "adump: argumentet är inte en vektor"
-#: array.c:1086
+#: array.c:823
msgid "asort: second argument not an array"
msgstr "asort: andra argumentet är inte en vektor"
-#: array.c:1087
+#: array.c:824
msgid "asorti: second argument not an array"
msgstr "asorti: andra argumentet är inte en vektor"
-#: array.c:1094
+#: array.c:831
msgid "asort: first argument not an array"
msgstr "asort: första argumentet är inte en vektor"
-#: array.c:1095
+#: array.c:832
msgid "asorti: first argument not an array"
msgstr "asorti: första argumentet är inte en vektor"
-#: array.c:1102
+#: array.c:839
msgid "asort: cannot use a subarray of first arg for second arg"
msgstr ""
"asort: det går inte att använda en delvektor av första argumentet som andra "
"argument"
-#: array.c:1103
+#: array.c:840
msgid "asorti: cannot use a subarray of first arg for second arg"
msgstr ""
"asorti: det går inte att använda en delvektor av första argumentet som andra "
"argument"
-#: array.c:1108
+#: array.c:845
msgid "asort: cannot use a subarray of second arg for first arg"
msgstr ""
"asort: det går inte att använda en delvektor av andra argumentet som första "
"argument"
-#: array.c:1109
+#: array.c:846
msgid "asorti: cannot use a subarray of second arg for first arg"
msgstr ""
"asorti: det går inte att använda en delvektor av andra argumentet som första "
"argument"
-#: array.c:1655
+#: array.c:1314
#, c-format
msgid "`%s' is invalid as a function name"
msgstr "\"%s\" är ogiltigt som ett funktionsnamn"
-#: array.c:1659
+#: array.c:1318
#, c-format
msgid "sort comparison function `%s' is not defined"
msgstr "jämförelsefunktionen \"%s\" för sortering är inte definierad"
-#: awkgram.y:249
+#: awkgram.y:223
#, c-format
msgid "%s blocks must have an action part"
msgstr "%s-block måste ha en åtgärdsdel"
-#: awkgram.y:252
+#: awkgram.y:226
msgid "each rule must have a pattern or an action part"
msgstr "varje regel måste ha ett mönster eller en åtgärdsdel"
-#: awkgram.y:323 awkgram.y:334
+#: awkgram.y:315 awkgram.y:326
msgid "old awk does not support multiple `BEGIN' or `END' rules"
msgstr "gamla awk stöder inte flera \"BEGIN\"- eller \"END\"-regler"
-#: awkgram.y:371
+#: awkgram.y:363
#, c-format
msgid "`%s' is a built-in function, it cannot be redefined"
msgstr "\"%s\" är en inbyggd funktion, den kan inte definieras om"
-#: awkgram.y:432
+#: awkgram.y:409
msgid "regexp constant `//' looks like a C++ comment, but is not"
msgstr "regexp-konstanten \"//\" ser ut som en C++-kommentar men är inte det"
-#: awkgram.y:436
+#: awkgram.y:413
#, c-format
msgid "regexp constant `/%s/' looks like a C comment, but is not"
msgstr "regexp-konstanten \"/%s/\" ser ut som en C-kommentar men är inte det"
-#: awkgram.y:528
+#: awkgram.y:505
#, c-format
msgid "duplicate case values in switch body: %s"
msgstr "upprepade case-värden i switch-sats: %s"
-#: awkgram.y:549
+#: awkgram.y:526
msgid "duplicate `default' detected in switch body"
msgstr "flera \"default\" upptäcktes i switch-sats"
-#: awkgram.y:809
+#: awkgram.y:786
msgid "`break' is not allowed outside a loop or switch"
msgstr "\"break\" är inte tillåtet utanför en slinga eller switch"
-#: awkgram.y:818
+#: awkgram.y:795
msgid "`continue' is not allowed outside a loop"
msgstr "\"continue\" är inte tillåtet utanför en slinga"
-#: awkgram.y:828
+#: awkgram.y:805
#, c-format
msgid "`next' used in %s action"
msgstr "\"next\" använt i %s-åtgärd"
-#: awkgram.y:837
+#: awkgram.y:814
#, c-format
msgid "`nextfile' used in %s action"
msgstr "\"nextfile\" använt i %s-åtgärd"
-#: awkgram.y:861
+#: awkgram.y:838
msgid "`return' used outside function context"
msgstr "\"return\" använd utanför funktion"
-#: awkgram.y:921
+#: awkgram.y:912
msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'"
msgstr ""
"ensamt \"print\" i BEGIN eller END-regel bör troligen vara 'print \"\"'"
-#: awkgram.y:1016 awkgram.y:1020
+#: awkgram.y:978 awkgram.y:1027
+msgid "`delete' is not allowed with SYMTAB"
+msgstr ""
+
+#: awkgram.y:980 awkgram.y:1029
+msgid "`delete' is not allowed with FUNCTAB"
+msgstr ""
+
+#: awkgram.y:1014 awkgram.y:1018
msgid "`delete(array)' is a non-portable tawk extension"
msgstr "\"delete(array)\" är en icke portabel tawk-utökning"
-#: awkgram.y:1132
+#: awkgram.y:1139
msgid "multistage two-way pipelines don't work"
msgstr "flerstegs dubbelriktade rör fungerar inte"
-#: awkgram.y:1235
+#: awkgram.y:1242
msgid "regular expression on right of assignment"
msgstr "reguljärt uttryck i högerledet av en tilldelning"
-#: awkgram.y:1246
+#: awkgram.y:1253
msgid "regular expression on left of `~' or `!~' operator"
msgstr "reguljärt uttryck på vänster sida om en \"~\"- eller \"!~\"-operator"
-#: awkgram.y:1262 awkgram.y:1416
+#: awkgram.y:1269 awkgram.y:1420
msgid "old awk does not support the keyword `in' except after `for'"
msgstr "gamla awk stöder inte operatorn \"**\""
-#: awkgram.y:1272
+#: awkgram.y:1279
msgid "regular expression on right of comparison"
msgstr "reguljärt uttryck i högerledet av en jämförelse"
-#: awkgram.y:1391
+#: awkgram.y:1395
#, c-format
msgid "`getline var' invalid inside `%s' rule"
msgstr "\"getline var\" är ogiltigt inuti \"%s\"-regel"
-#: awkgram.y:1394 eval.c:2504
+#: awkgram.y:1398
#, c-format
msgid "`getline' invalid inside `%s' rule"
msgstr "\"getline är ogiltigt inuti \"%s\"-regel"
-#: awkgram.y:1399
+#: awkgram.y:1403
msgid "non-redirected `getline' undefined inside END action"
msgstr "icke omdirigerad \"getline\" odefinierad inuti END-åtgärd"
-#: awkgram.y:1418
+#: awkgram.y:1422
msgid "old awk does not support multidimensional arrays"
msgstr "gamla awk stöder inte flerdimensionella vektorer"
-#: awkgram.y:1514
+#: awkgram.y:1519
msgid "call of `length' without parentheses is not portable"
msgstr "anrop av \"length\" utan parenteser är inte portabelt"
-#: awkgram.y:1577
+#: awkgram.y:1585
msgid "indirect function calls are a gawk extension"
msgstr "indirekta funktionsanrop är en gawk-utökning"
-#: awkgram.y:1590
+#: awkgram.y:1598
#, c-format
msgid "can not use special variable `%s' for indirect function call"
msgstr ""
"det går inte att använda specialvariabeln \"%s\" för indirekta fuktionsanrop"
-#: awkgram.y:1668
+#: awkgram.y:1676
msgid "invalid subscript expression"
msgstr "ogiltig indexuttryck"
-#: awkgram.y:1708
-msgid "use of non-array as array"
-msgstr "icke-vektor används som vektor"
-
-#: awkgram.y:1972 awkgram.y:1992 msg.c:98
+#: awkgram.y:2000 awkgram.y:2020 gawkapi.c:203 gawkapi.c:221 msg.c:119
msgid "warning: "
msgstr "varning: "
-#: awkgram.y:1990 msg.c:130
+#: awkgram.y:2018 gawkapi.c:189 gawkapi.c:218 msg.c:151
msgid "fatal: "
msgstr "ödesdigert: "
-#: awkgram.y:2040
+#: awkgram.y:2068
msgid "unexpected newline or end of string"
msgstr "oväntat nyradstecken eller slut på strängen"
-#: awkgram.y:2297 awkgram.y:2355 awkgram.y:2539
+#: awkgram.y:2335 awkgram.y:2411 awkgram.y:2634 debug.c:517 debug.c:533
+#: debug.c:2790 debug.c:5038
#, c-format
msgid "can't open source file `%s' for reading (%s)"
msgstr "kan inte öppna källfilen \"%s\" för läsning (%s)"
-#: awkgram.y:2298 awkgram.y:2356 builtin.c:122
+#: awkgram.y:2336 awkgram.y:2461
+#, fuzzy, c-format
+msgid "can't open shared library `%s' for reading (%s)"
+msgstr "kan inte öppna källfilen \"%s\" för läsning (%s)"
+
+#: awkgram.y:2338 awkgram.y:2412 awkgram.y:2462 builtin.c:130 debug.c:5189
msgid "reason unknown"
msgstr "okänd anledning"
-#: awkgram.y:2314
+#: awkgram.y:2347 awkgram.y:2371
+#, c-format
+msgid "can't include `%s' and use it as a program file"
+msgstr ""
+
+#: awkgram.y:2360
#, c-format
msgid "already included source file `%s'"
msgstr "inkluderade redan källfilen \"%s\""
-#: awkgram.y:2340
+#: awkgram.y:2361
+#, fuzzy, c-format
+msgid "already loaded shared library `%s'"
+msgstr "inkluderade redan källfilen \"%s\""
+
+#: awkgram.y:2396
msgid "@include is a gawk extension"
msgstr "@include är en gawk-utökning"
-#: awkgram.y:2346
+#: awkgram.y:2402
msgid "empty filename after @include"
msgstr "tomt filnamn efter @include"
-#: awkgram.y:2491
+#: awkgram.y:2446
+#, fuzzy
+msgid "@load is a gawk extension"
+msgstr "@include är en gawk-utökning"
+
+#: awkgram.y:2452
+#, fuzzy
+msgid "empty filename after @load"
+msgstr "tomt filnamn efter @include"
+
+#: awkgram.y:2586
msgid "empty program text on command line"
msgstr "tom programtext på kommandoraden"
-#: awkgram.y:2606
+#: awkgram.y:2701
#, c-format
msgid "can't read sourcefile `%s' (%s)"
msgstr "kan inte läsa källfilen \"%s\" (%s)"
-#: awkgram.y:2617
+#: awkgram.y:2712
#, c-format
msgid "source file `%s' is empty"
msgstr "källfilen \"%s\" är tom"
-#: awkgram.y:2794
+#: awkgram.y:2889
msgid "source file does not end in newline"
msgstr "källfilen slutar inte med en ny rad"
-#: awkgram.y:2897
+#: awkgram.y:2994
msgid "unterminated regexp ends with `\\' at end of file"
msgstr "oavslutat reguljärt uttryck slutar med \"\\\" i slutet av filen"
-#: awkgram.y:2921
+#: awkgram.y:3018
#, c-format
msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk"
msgstr ""
"%s: %d: tawk-modifierare för reguljära uttryck \"/.../%c\" fungerar inte i "
"gawk"
-#: awkgram.y:2925
+#: awkgram.y:3022
#, c-format
msgid "tawk regex modifier `/.../%c' doesn't work in gawk"
msgstr ""
"tawk-modifierare för reguljära uttryck \"/.../%c\" fungerar inte i gawk"
-#: awkgram.y:2932
+#: awkgram.y:3029
msgid "unterminated regexp"
msgstr "oavslutat reguljärt uttryck"
-#: awkgram.y:2936
+#: awkgram.y:3033
msgid "unterminated regexp at end of file"
msgstr "oavslutat reguljärt uttryck i slutet av filen"
-#: awkgram.y:2995
+#: awkgram.y:3092
msgid "use of `\\ #...' line continuation is not portable"
msgstr "Användning av \"\\ #...\" för radfortsättning är inte portabelt"
-#: awkgram.y:3011
+#: awkgram.y:3108
msgid "backslash not last character on line"
msgstr "sista tecknet på raden är inte ett omvänt snedstreck"
-#: awkgram.y:3072
+#: awkgram.y:3169
msgid "POSIX does not allow operator `**='"
msgstr "POSIX tillåter inte operatorn \"**=\""
-#: awkgram.y:3074
+#: awkgram.y:3171
msgid "old awk does not support operator `**='"
msgstr "gamla awk stöder inte operatorn \"**=\""
-#: awkgram.y:3083
+#: awkgram.y:3180
msgid "POSIX does not allow operator `**'"
msgstr "POSIX tillåter inte operatorn \"**\""
-#: awkgram.y:3085
+#: awkgram.y:3182
msgid "old awk does not support operator `**'"
msgstr "gamla awk stöder inte operatorn \"**\""
-#: awkgram.y:3120
+#: awkgram.y:3217
msgid "operator `^=' is not supported in old awk"
msgstr "operatorn \"^=\" stöds inte i gamla awk"
-#: awkgram.y:3128
+#: awkgram.y:3225
msgid "operator `^' is not supported in old awk"
msgstr "operatorn \"^\" stöds inte i gamla awk"
-#: awkgram.y:3221 awkgram.y:3237
+#: awkgram.y:3318 awkgram.y:3334 command.y:1178
msgid "unterminated string"
msgstr "oavslutad sträng"
-#: awkgram.y:3433
+#: awkgram.y:3555
#, c-format
msgid "invalid char '%c' in expression"
msgstr "ogiltigt tecken \"%c\" i uttryck"
-#: awkgram.y:3480
+#: awkgram.y:3602
#, c-format
msgid "`%s' is a gawk extension"
msgstr "\"%s\" är en gawk-utökning"
-#: awkgram.y:3485
+#: awkgram.y:3607
#, c-format
msgid "`%s' is a Bell Labs extension"
msgstr "\"%s\" är en Bell Labs-utökning"
-#: awkgram.y:3490
+#: awkgram.y:3612
#, c-format
msgid "POSIX does not allow `%s'"
msgstr "POSIX tillåter inte \"%s\""
-#: awkgram.y:3498
+#: awkgram.y:3620
#, c-format
msgid "`%s' is not supported in old awk"
msgstr "\"%s\" stöds inte i gamla awk"
-#: awkgram.y:3565
+#: awkgram.y:3688
msgid "`goto' considered harmful!\n"
msgstr "\"goto\" anses skadlig!\n"
-#: awkgram.y:3616
+#: awkgram.y:3722
#, c-format
msgid "%d is invalid as number of arguments for %s"
msgstr "%d är ett ogiltigt antal argument för %s"
-#: awkgram.y:3651
+#: awkgram.y:3757
#, c-format
msgid "%s: string literal as last arg of substitute has no effect"
msgstr ""
"%s: bokstavlig sträng som sista argument till ersättning har ingen effekt"
-#: awkgram.y:3656
+#: awkgram.y:3762
#, c-format
msgid "%s third parameter is not a changeable object"
msgstr "%s: tredje argumentet är inte ett ändringsbart objekt"
-#: awkgram.y:3729 awkgram.y:3732
+#: awkgram.y:3841 awkgram.y:3844
msgid "match: third argument is a gawk extension"
msgstr "match: tredje argumentet är en gawk-utökning"
-#: awkgram.y:3786 awkgram.y:3789
+#: awkgram.y:3898 awkgram.y:3901
msgid "close: second argument is a gawk extension"
msgstr "close: andra argumentet är en gawk-utökning"
-#: awkgram.y:3801
+#: awkgram.y:3913
msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
msgstr ""
"användandet av dcgettext(_\"...\") är felaktigt: ta bort det inledande "
"understrykningstecknet"
-#: awkgram.y:3816
+#: awkgram.y:3928
msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
msgstr ""
"användandet av dcngettext(_\"...\") är felaktigt: ta bort det inledande "
"understrykningstecknet"
-#: awkgram.y:3908
-#, c-format
-msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
-msgstr "funktionen \"%s\": parameter %d, \"%s\", är samma som parameter %d"
-
-#: awkgram.y:3950
+#: awkgram.y:3994
#, c-format
msgid "function `%s': parameter `%s' shadows global variable"
msgstr "funktionen \"%s\": parametern \"%s\" överskuggar en global variabel"
-#: awkgram.y:4108
+#: awkgram.y:4051 debug.c:4019 debug.c:4062 debug.c:5187
#, c-format
msgid "could not open `%s' for writing (%s)"
msgstr "kunde inte öppna \"%s\" för skrivning (%s)"
-#: awkgram.y:4109
+#: awkgram.y:4052
msgid "sending variable list to standard error"
msgstr "skickar variabellista till standard fel"
-#: awkgram.y:4115
+#: awkgram.y:4060
#, c-format
msgid "%s: close failed (%s)"
msgstr "%s: misslyckades att stänga (%s)"
-#: awkgram.y:4167
+#: awkgram.y:4085
msgid "shadow_funcs() called twice!"
msgstr "shadow_funcs() anropad två gånger!"
-#: awkgram.y:4173
+#: awkgram.y:4093
msgid "there were shadowed variables."
msgstr "det fanns överskuggade variabler."
-#: awkgram.y:4203
+#: awkgram.y:4164
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "funktionsnamnet \"%s\" är definierat sedan tidigare"
+
+#: awkgram.y:4210
#, c-format
msgid "function `%s': can't use function name as parameter name"
msgstr "funktionen \"%s\": kan inte använda funktionsnamn som parameternamn"
-#: awkgram.y:4207
+#: awkgram.y:4213
#, c-format
msgid "function `%s': can't use special variable `%s' as a function parameter"
msgstr ""
"funktionen \"%s\": det går inte att använda specialvariabeln \"%s\" som en "
"funktionsparameter"
-#: awkgram.y:4223
+#: awkgram.y:4221
#, c-format
-msgid "function name `%s' previously defined"
-msgstr "funktionsnamnet \"%s\" är definierat sedan tidigare"
+msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
+msgstr "funktionen \"%s\": parameter %d, \"%s\", är samma som parameter %d"
-#: awkgram.y:4391 awkgram.y:4397
+#: awkgram.y:4315 awkgram.y:4319
#, c-format
msgid "function `%s' called but never defined"
msgstr "funktionen \"%s\" anropad men aldrig definierad"
-#: awkgram.y:4400
+#: awkgram.y:4324
#, c-format
msgid "function `%s' defined but never called directly"
msgstr "funktionen \"%s\" definierad men aldrig anropad direkt"
-#: awkgram.y:4432
+#: awkgram.y:4356
#, c-format
msgid "regexp constant for parameter #%d yields boolean value"
msgstr "konstant reguljärt uttryck för parameter %d ger ett booleskt värde"
-#: awkgram.y:4541
+#: awkgram.y:4402
#, c-format
msgid ""
"function `%s' called with space between name and `(',\n"
@@ -527,229 +518,229 @@ msgstr ""
"funktionen \"%s\" anropad med blanktecken mellan namnet och \"(\",\n"
"eller använd som variabel eller vektor"
-#: awkgram.y:4788 eval.c:2056
+#: awkgram.y:4618
msgid "division by zero attempted"
msgstr "försökte dividera med noll"
-#: awkgram.y:4797 eval.c:2072
+#: awkgram.y:4627
#, c-format
msgid "division by zero attempted in `%%'"
msgstr "försökte dividera med noll i \"%%\""
-#: builtin.c:120
+#: builtin.c:128
#, c-format
msgid "%s to \"%s\" failed (%s)"
msgstr "%s till \"%s\" misslyckades (%s)"
-#: builtin.c:121
+#: builtin.c:129
msgid "standard output"
msgstr "standard ut"
-#: builtin.c:135
+#: builtin.c:143
msgid "exp: received non-numeric argument"
msgstr "exp: fick ett ickenumeriskt argument"
-#: builtin.c:141
+#: builtin.c:149
#, c-format
msgid "exp: argument %g is out of range"
msgstr "exp: argumentet %g är inte inom tillåten gräns"
-#: builtin.c:200
+#: builtin.c:208
#, c-format
msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing"
msgstr ""
"fflush: kan inte spola: röret \"%s\" öppnat för läsning, inte skrivning"
-#: builtin.c:203
+#: builtin.c:211
#, c-format
msgid "fflush: cannot flush: file `%s' opened for reading, not writing"
msgstr ""
"fflush: kan inte spola: filen \"%s\" öppnad för läsning, inte skrivning"
-#: builtin.c:215
+#: builtin.c:223
#, c-format
msgid "fflush: `%s' is not an open file, pipe or co-process"
msgstr "fflush: \"%s\" är inte en öppen fil, rör eller koprocess"
-#: builtin.c:333
+#: builtin.c:341
msgid "index: received non-string first argument"
msgstr "index: första argumentet är inte en sträng"
-#: builtin.c:335
+#: builtin.c:343
msgid "index: received non-string second argument"
msgstr "index: andra argumentet är inte en sträng"
-#: builtin.c:457
+#: builtin.c:467 mpfr.c:770
msgid "int: received non-numeric argument"
msgstr "int: fick ett ickenumeriskt argument"
-#: builtin.c:493
+#: builtin.c:503
msgid "length: received array argument"
msgstr "length: fick ett vektorargument"
-#: builtin.c:496
+#: builtin.c:506
msgid "`length(array)' is a gawk extension"
msgstr "\"length(array)\" är en gawk-utökning"
-#: builtin.c:504
+#: builtin.c:514
msgid "length: received non-string argument"
msgstr "length: fick ett argument som inte är en sträng"
-#: builtin.c:535
+#: builtin.c:545
msgid "log: received non-numeric argument"
msgstr "log: fick ett ickenumeriskt argument"
-#: builtin.c:538
+#: builtin.c:548
#, c-format
msgid "log: received negative argument %g"
msgstr "log: fick ett negativt argumentet %g"
-#: builtin.c:694 builtin.c:699
+#: builtin.c:746 builtin.c:751
msgid "fatal: must use `count$' on all formats or none"
msgstr "ödesdigert: måste använda \"count$\" på alla eller inga format"
-#: builtin.c:762
+#: builtin.c:821
#, c-format
msgid "field width is ignored for `%%' specifier"
msgstr "fältbredd ignoreras för \"%%\"-specificerare"
-#: builtin.c:764
+#: builtin.c:823
#, c-format
msgid "precision is ignored for `%%' specifier"
msgstr "precision ignoreras för \"%%\"-specificerare"
-#: builtin.c:766
+#: builtin.c:825
#, c-format
msgid "field width and precision are ignored for `%%' specifier"
msgstr "fältbredd och precision ignoreras för \"%%\"-specificerare"
-#: builtin.c:817
+#: builtin.c:876
msgid "fatal: `$' is not permitted in awk formats"
msgstr "ödesdigert: \"$\" tillåts inte i awk-format"
-#: builtin.c:826
+#: builtin.c:885
msgid "fatal: arg count with `$' must be > 0"
msgstr "ödesdigert: argumentantalet med \"$\" måste vara > 0"
-#: builtin.c:830
+#: builtin.c:889
#, c-format
msgid "fatal: arg count %ld greater than total number of supplied arguments"
msgstr "ödesdigert: argumentantalet %ld är större än antalet givna argument"
-#: builtin.c:834
+#: builtin.c:893
msgid "fatal: `$' not permitted after period in format"
msgstr "ödesdigert: \"$\" tillåts inte efter en punkt i formatet"
-#: builtin.c:850
+#: builtin.c:909
msgid "fatal: no `$' supplied for positional field width or precision"
msgstr ""
"ödesdigert: inget \"$\" bifogat för positionsangiven fältbredd eller "
"precision"
-#: builtin.c:921
+#: builtin.c:981
msgid "`l' is meaningless in awk formats; ignored"
msgstr "\"l\" är meningslös i awk-format, ignorerad"
-#: builtin.c:925
+#: builtin.c:985
msgid "fatal: `l' is not permitted in POSIX awk formats"
msgstr "ödesdigert: \"l\" tillåts inte i POSIX awk-format"
-#: builtin.c:938
+#: builtin.c:998
msgid "`L' is meaningless in awk formats; ignored"
msgstr "\"L\" är meningslös i awk-format, ignorerad"
-#: builtin.c:942
+#: builtin.c:1002
msgid "fatal: `L' is not permitted in POSIX awk formats"
msgstr "ödesdigert: \"L\" tillåts inte i POSIX awk-format"
-#: builtin.c:955
+#: builtin.c:1015
msgid "`h' is meaningless in awk formats; ignored"
msgstr "\"h\" är meningslös i awk-format, ignorerad"
-#: builtin.c:959
+#: builtin.c:1019
msgid "fatal: `h' is not permitted in POSIX awk formats"
msgstr "ödesdigert: \"h\" tillåts inte i POSIX awk-format"
-#: builtin.c:1272
+#: builtin.c:1414
#, c-format
msgid "[s]printf: value %g is out of range for `%%%c' format"
msgstr "[s]printf: värdet %g är utanför \"%%%c\"-formatets giltiga intervall"
-#: builtin.c:1332
+#: builtin.c:1512
#, c-format
msgid "ignoring unknown format specifier character `%c': no argument converted"
msgstr ""
"ignorerar okänt formatspecifikationstecken \"%c\": inget argument konverterat"
-#: builtin.c:1337
+#: builtin.c:1517
msgid "fatal: not enough arguments to satisfy format string"
msgstr "ödesdigert: för få argument för formatsträngen"
-#: builtin.c:1339
+#: builtin.c:1519
msgid "^ ran out for this one"
msgstr "^ tog slut här"
-#: builtin.c:1346
+#: builtin.c:1526
msgid "[s]printf: format specifier does not have control letter"
msgstr "[s]printf: formatspecifieraren har ingen kommandobokstav"
-#: builtin.c:1349
+#: builtin.c:1529
msgid "too many arguments supplied for format string"
msgstr "för många argument för formatsträngen"
-#: builtin.c:1423 builtin.c:1434
+#: builtin.c:1604 builtin.c:1615
msgid "printf: no arguments"
msgstr "printf: inga argument"
-#: builtin.c:1475
+#: builtin.c:1656
msgid "sqrt: received non-numeric argument"
msgstr "sqrt: fick ickenumeriskt argument"
-#: builtin.c:1479
+#: builtin.c:1660
#, c-format
msgid "sqrt: called with negative argument %g"
msgstr "sqrt: anropad med negativt argument %g"
-#: builtin.c:1503
+#: builtin.c:1691
#, c-format
msgid "substr: length %g is not >= 1"
msgstr "substr: längden %g är inte >= 1"
-#: builtin.c:1505
+#: builtin.c:1693
#, c-format
msgid "substr: length %g is not >= 0"
msgstr "substr: längden %g är inte >= 0"
-#: builtin.c:1512
+#: builtin.c:1700
#, c-format
msgid "substr: non-integer length %g will be truncated"
msgstr "substr: längden %g som inte är ett heltal kommer trunkeras"
-#: builtin.c:1517
+#: builtin.c:1705
#, c-format
msgid "substr: length %g too big for string indexing, truncating to %g"
msgstr "substr: längden %g är för stor för strängindexering, trunkeras till %g"
-#: builtin.c:1529
+#: builtin.c:1717
#, c-format
msgid "substr: start index %g is invalid, using 1"
msgstr "substr: startindex %g är ogiltigt, använder 1"
-#: builtin.c:1534
+#: builtin.c:1722
#, c-format
msgid "substr: non-integer start index %g will be truncated"
msgstr "substr: startindex %g som inte är ett heltal kommer trunkeras"
-#: builtin.c:1559
+#: builtin.c:1747
msgid "substr: source string is zero length"
msgstr "substr: källsträngen är tom"
-#: builtin.c:1575
+#: builtin.c:1763
#, c-format
msgid "substr: start index %g is past end of string"
msgstr "substr: startindex %g är bortom strängens slut"
-#: builtin.c:1583
+#: builtin.c:1771
#, c-format
msgid ""
"substr: length %g at start index %g exceeds length of first argument (%lu)"
@@ -757,227 +748,1084 @@ msgstr ""
"substr: längden %g vid startindex %g överskrider det första argumentets "
"längd (%lu)"
-#: builtin.c:1657
+#: builtin.c:1845
msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type"
msgstr "strftime: formatvärde i PROCINFO[\"strftime\"] har numerisk typ"
-#: builtin.c:1680
+#: builtin.c:1868
msgid "strftime: received non-numeric second argument"
msgstr "strftime: fick ett ickenumeriskt andra argument"
-#: builtin.c:1683
+#: builtin.c:1872
msgid "strftime: second argument less than 0 or too big for time_t"
msgstr "strftime: andra argimentet mindre än 0 eller för stort för time_t"
-#: builtin.c:1690
+#: builtin.c:1879
msgid "strftime: received non-string first argument"
msgstr "strftime: fick ett första argument som inte är en sträng"
-#: builtin.c:1696
+#: builtin.c:1886
msgid "strftime: received empty format string"
msgstr "strftime: fick en tom formatsträng"
-#: builtin.c:1762
+#: builtin.c:1952
msgid "mktime: received non-string argument"
msgstr "mktime: fick ett argument som inte är en sträng"
-#: builtin.c:1779
+#: builtin.c:1969
msgid "mktime: at least one of the values is out of the default range"
msgstr "mktime: åtminstone ett av värdena är utanför standardintervallet"
-#: builtin.c:1814
+#: builtin.c:2004
msgid "'system' function not allowed in sandbox mode"
msgstr "funktionen \"system\" är inte tillåten i sandlådeläge"
-#: builtin.c:1819
+#: builtin.c:2009
msgid "system: received non-string argument"
msgstr "system: fick ett argument som inte är en sträng"
-#: builtin.c:1874 eval.c:1159 eval.c:1790 eval.c:1803
-#, c-format
-msgid "reference to uninitialized variable `%s'"
-msgstr "referens till icke initierad variabel \"%s\""
-
-#: builtin.c:1941
+#: builtin.c:2127
#, c-format
msgid "reference to uninitialized field `$%d'"
msgstr "referens till icke initierat fält \"$%d\""
-#: builtin.c:2028
+#: builtin.c:2214
msgid "tolower: received non-string argument"
msgstr "tolower: fick ett argument som inte är en sträng"
-#: builtin.c:2062
+#: builtin.c:2248
msgid "toupper: received non-string argument"
msgstr "toupper: fick ett argument som inte är en sträng"
-#: builtin.c:2098
+#: builtin.c:2284 mpfr.c:685
msgid "atan2: received non-numeric first argument"
msgstr "atan2: fick ett ickenumeriskt första argument"
-#: builtin.c:2100
+#: builtin.c:2286 mpfr.c:687
msgid "atan2: received non-numeric second argument"
msgstr "atan2: fick ett ickenumeriskt andra argument"
-#: builtin.c:2119
+#: builtin.c:2305
msgid "sin: received non-numeric argument"
msgstr "sin: fick ett ickenumeriskt argument"
-#: builtin.c:2135
+#: builtin.c:2321
msgid "cos: received non-numeric argument"
msgstr "cos: fick ett ickenumeriskt argument"
-#: builtin.c:2188
+#: builtin.c:2374 mpfr.c:1137
msgid "srand: received non-numeric argument"
msgstr "srand: fick ett ickenumeriskt argument"
-#: builtin.c:2219
+#: builtin.c:2405
msgid "match: third argument is not an array"
msgstr "match: tredje argumentet är inte en vektor"
-#: builtin.c:2483
+#: builtin.c:2670
msgid "gensub: third argument of 0 treated as 1"
msgstr "gensub: nollan i tredje argumentet behandlad som en etta"
-#: builtin.c:2776
+#: builtin.c:2963
msgid "lshift: received non-numeric first argument"
msgstr "lshift: fick ett ickenumeriskt första argument"
-#: builtin.c:2778
+#: builtin.c:2965
msgid "lshift: received non-numeric second argument"
msgstr "lshift: fick ett ickenumeriskt andra argument"
-#: builtin.c:2784
+#: builtin.c:2971
#, fuzzy, c-format
msgid "lshift(%f, %f): negative values will give strange results"
msgstr "lshift(%lf, %lf): negativa värden kommer ge konstiga resultat"
-#: builtin.c:2786
+#: builtin.c:2973
#, fuzzy, c-format
msgid "lshift(%f, %f): fractional values will be truncated"
msgstr "lshift(%lf, %lf): flyttalsvärden kommer trunkeras"
-#: builtin.c:2788
+#: builtin.c:2975
#, fuzzy, c-format
msgid "lshift(%f, %f): too large shift value will give strange results"
msgstr "lshift(%lf, %lf): för stora skiftvärden kommer ge konstiga resultat"
-#: builtin.c:2813
+#: builtin.c:3000
msgid "rshift: received non-numeric first argument"
msgstr "rshift: fick ett ickenumeriskt första argument"
-#: builtin.c:2815
+#: builtin.c:3002
msgid "rshift: received non-numeric second argument"
msgstr "rshift: fick ett ickenumeriskt andra argument"
-#: builtin.c:2821
+#: builtin.c:3008
#, fuzzy, c-format
msgid "rshift(%f, %f): negative values will give strange results"
msgstr "rshift(%lf, %lf): negativa värden kommer ge konstiga resultat"
-#: builtin.c:2823
+#: builtin.c:3010
#, fuzzy, c-format
msgid "rshift(%f, %f): fractional values will be truncated"
msgstr "rshift(%lf, %lf): flyttalsvärden kommer trunkeras"
-#: builtin.c:2825
+#: builtin.c:3012
#, fuzzy, c-format
msgid "rshift(%f, %f): too large shift value will give strange results"
msgstr "rshift(%lf, %lf): för stora skiftvärden kommer ge konstiga resultat"
-#: builtin.c:2850
-msgid "and: received non-numeric first argument"
-msgstr "and: fick ett ickenumeriskt första argument"
-
-#: builtin.c:2852
-msgid "and: received non-numeric second argument"
-msgstr "and: fick ett ickenumeriskt andra argument"
+#: builtin.c:3037
+#, fuzzy
+msgid "and: called with less than two arguments"
+msgstr "sqrt: anropad med negativt argument %g"
-#: builtin.c:2858
+#: builtin.c:3042
#, fuzzy, c-format
-msgid "and(%f, %f): negative values will give strange results"
-msgstr "and(%lf, %lf): negativa värden kommer ge konstiga resultat"
+msgid "and: argument %d is non-numeric"
+msgstr "exp: argumentet %g är inte inom tillåten gräns"
-#: builtin.c:2860
+#: builtin.c:3046
#, fuzzy, c-format
-msgid "and(%f, %f): fractional values will be truncated"
-msgstr "and(%lf, %lf): flyttalsvärden kommer trunkeras"
-
-#: builtin.c:2885
-msgid "or: received non-numeric first argument"
-msgstr "or: fick ett ickenumeriskt första argument"
+msgid "and: argument %d negative value %g will give strange results"
+msgstr "and(%lf, %lf): negativa värden kommer ge konstiga resultat"
-#: builtin.c:2887
-msgid "or: received non-numeric second argument"
-msgstr "or: fick ett ickenumeriskt andra argument"
+#: builtin.c:3069
+#, fuzzy
+msgid "or: called with less than two arguments"
+msgstr "sqrt: anropad med negativt argument %g"
-#: builtin.c:2893
+#: builtin.c:3074
#, fuzzy, c-format
-msgid "or(%f, %f): negative values will give strange results"
-msgstr "or(%lf, %lf): negativa värden kommer ge konstiga resultat"
+msgid "or: argument %d is non-numeric"
+msgstr "exp: argumentet %g är inte inom tillåten gräns"
-#: builtin.c:2895
+#: builtin.c:3078
#, fuzzy, c-format
-msgid "or(%f, %f): fractional values will be truncated"
-msgstr "or(%lf, %lf): flyttalsvärden kommer trunkeras"
-
-#: builtin.c:2923
-msgid "xor: received non-numeric first argument"
-msgstr "xor: fick ett ickenumeriskt första argument"
+msgid "or: argument %d negative value %g will give strange results"
+msgstr "compl(%lf): negativa värden kommer ge konstiga resultat"
-#: builtin.c:2925
-msgid "xor: received non-numeric second argument"
-msgstr "xor: fick ett ickenumeriskt andra argument"
+#: builtin.c:3100
+#, fuzzy
+msgid "xor: called with less than two arguments"
+msgstr "sqrt: anropad med negativt argument %g"
-#: builtin.c:2931
+#: builtin.c:3106
#, fuzzy, c-format
-msgid "xor(%f, %f): negative values will give strange results"
-msgstr "xor(%lf, %lf): negativa värden kommer ge konstiga resultat"
+msgid "xor: argument %d is non-numeric"
+msgstr "exp: argumentet %g är inte inom tillåten gräns"
-#: builtin.c:2933
+#: builtin.c:3110
#, fuzzy, c-format
-msgid "xor(%f, %f): fractional values will be truncated"
-msgstr "xor(%lf, %lf): flyttalsvärden kommer trunkeras"
+msgid "xor: argument %d negative value %g will give strange results"
+msgstr "xor(%lf, %lf): negativa värden kommer ge konstiga resultat"
-#: builtin.c:2957 builtin.c:2963
+#: builtin.c:3135 mpfr.c:800
msgid "compl: received non-numeric argument"
msgstr "compl: fick ett ickenumeriskt argument"
-#: builtin.c:2965
+#: builtin.c:3141
#, fuzzy, c-format
msgid "compl(%f): negative value will give strange results"
msgstr "compl(%lf): negativa värden kommer ge konstiga resultat"
-#: builtin.c:2967
+#: builtin.c:3143
#, fuzzy, c-format
msgid "compl(%f): fractional value will be truncated"
msgstr "compl(%lf): flyttalsvärden kommer trunkeras"
-#: builtin.c:3136
+#: builtin.c:3312
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr "dcgettext: \"%s\" är inte en giltig lokalkategori"
-#: eval.c:412
+#: command.y:225
+#, c-format
+msgid "Type (g)awk statement(s). End with the command \"end\"\n"
+msgstr ""
+
+#: command.y:289
+#, fuzzy, c-format
+msgid "invalid frame number: %d"
+msgstr "Ogiltigt omfångsslut"
+
+#: command.y:295
+#, fuzzy, c-format
+msgid "info: invalid option - \"%s\""
+msgstr "%s: ogiltig flagga -- \"%c\"\n"
+
+#: command.y:321
+#, c-format
+msgid "source \"%s\": already sourced."
+msgstr ""
+
+#: command.y:326
+#, c-format
+msgid "save \"%s\": command not permitted."
+msgstr ""
+
+#: command.y:339
+msgid "Can't use command `commands' for breakpoint/watchpoint commands"
+msgstr ""
+
+#: command.y:341
+msgid "no breakpoint/watchpoint has been set yet"
+msgstr ""
+
+#: command.y:343
+msgid "invalid breakpoint/watchpoint number"
+msgstr ""
+
+#: command.y:348
+#, c-format
+msgid "Type commands for when %s %d is hit, one per line.\n"
+msgstr ""
+
+#: command.y:350
+#, c-format
+msgid "End with the command \"end\"\n"
+msgstr ""
+
+#: command.y:357
+msgid "`end' valid only in command `commands' or `eval'"
+msgstr ""
+
+#: command.y:367
+msgid "`silent' valid only in command `commands'"
+msgstr ""
+
+#: command.y:373
+#, fuzzy, c-format
+msgid "trace: invalid option - \"%s\""
+msgstr "%s: ogiltig flagga -- \"%c\"\n"
+
+#: command.y:387
+msgid "condition: invalid breakpoint/watchpoint number"
+msgstr ""
+
+#: command.y:449
+#, fuzzy
+msgid "argument not a string"
+msgstr "exp: argumentet %g är inte inom tillåten gräns"
+
+#: command.y:459 command.y:464
+#, c-format
+msgid "option: invalid parameter - \"%s\""
+msgstr ""
+
+#: command.y:474
+#, c-format
+msgid "no such function - \"%s\""
+msgstr ""
+
+#: command.y:531
+#, fuzzy, c-format
+msgid "enable: invalid option - \"%s\""
+msgstr "%s: ogiltig flagga -- \"%c\"\n"
+
+#: command.y:597
+#, fuzzy, c-format
+msgid "invalid range specification: %d - %d"
+msgstr "Ogiltigt omfångsslut"
+
+#: command.y:659
+#, fuzzy
+msgid "non-numeric value for field number"
+msgstr "okänt värde till fältspecifikation: %d\n"
+
+#: command.y:680 command.y:687
+msgid "non-numeric value found, numeric expected"
+msgstr ""
+
+#: command.y:712 command.y:718
+msgid "non-zero integer value"
+msgstr ""
+
+#: command.y:817
+msgid ""
+"backtrace [N] - print trace of all or N innermost (outermost if N < 0) "
+"frames."
+msgstr ""
+
+#: command.y:819
+msgid ""
+"break [[filename:]N|function] - set breakpoint at the specified location."
+msgstr ""
+
+#: command.y:821
+msgid "clear [[filename:]N|function] - delete breakpoints previously set."
+msgstr ""
+
+#: command.y:823
+msgid ""
+"commands [num] - starts a list of commands to be executed at a breakpoint"
+"(watchpoint) hit."
+msgstr ""
+
+#: command.y:825
+msgid "condition num [expr] - set or clear breakpoint or watchpoint condition."
+msgstr ""
+
+#: command.y:827
+msgid "continue [COUNT] - continue program being debugged."
+msgstr ""
+
+#: command.y:829
+msgid "delete [breakpoints] [range] - delete specified breakpoints."
+msgstr ""
+
+#: command.y:831
+msgid "disable [breakpoints] [range] - disable specified breakpoints."
+msgstr ""
+
+#: command.y:833
+msgid "display [var] - print value of variable each time the program stops."
+msgstr ""
+
+#: command.y:835
+msgid "down [N] - move N frames down the stack."
+msgstr ""
+
+#: command.y:837
+msgid "dump [filename] - dump instructions to file or stdout."
+msgstr ""
+
+#: command.y:839
+msgid "enable [once|del] [breakpoints] [range] - enable specified breakpoints."
+msgstr ""
+
+#: command.y:841
+msgid "end - end a list of commands or awk statements."
+msgstr ""
+
+#: command.y:843
+msgid "eval stmt|[p1, p2, ...] - evaluate awk statement(s)."
+msgstr ""
+
+#: command.y:845
+msgid "finish - execute until selected stack frame returns."
+msgstr ""
+
+#: command.y:847
+msgid "frame [N] - select and print stack frame number N."
+msgstr ""
+
+#: command.y:849
+msgid "help [command] - print list of commands or explanation of command."
+msgstr ""
+
+#: command.y:851
+msgid "ignore N COUNT - set ignore-count of breakpoint number N to COUNT."
+msgstr ""
+
+#: command.y:853
+msgid ""
+"info topic - source|sources|variables|functions|break|frame|args|locals|"
+"display|watch."
+msgstr ""
+
+#: command.y:855
+msgid "list [-|+|[filename:]lineno|function|range] - list specified line(s)."
+msgstr ""
+
+#: command.y:857
+msgid "next [COUNT] - step program, proceeding through subroutine calls."
+msgstr ""
+
+#: command.y:859
+msgid ""
+"nexti [COUNT] - step one instruction, but proceed through subroutine calls."
+msgstr ""
+
+#: command.y:861
+msgid "option [name[=value]] - set or display debugger option(s)."
+msgstr ""
+
+#: command.y:863
+msgid "print var [var] - print value of a variable or array."
+msgstr ""
+
+#: command.y:865
+msgid "printf format, [arg], ... - formatted output."
+msgstr ""
+
+#: command.y:867
+msgid "quit - exit debugger."
+msgstr ""
+
+#: command.y:869
+msgid "return [value] - make selected stack frame return to its caller."
+msgstr ""
+
+#: command.y:871
+msgid "run - start or restart executing program."
+msgstr ""
+
+#: command.y:874
+msgid "save filename - save commands from the session to file."
+msgstr ""
+
+#: command.y:877
+msgid "set var = value - assign value to a scalar variable."
+msgstr ""
+
+#: command.y:879
+msgid ""
+"silent - suspends usual message when stopped at a breakpoint/watchpoint."
+msgstr ""
+
+#: command.y:881
+msgid "source file - execute commands from file."
+msgstr ""
+
+#: command.y:883
+msgid "step [COUNT] - step program until it reaches a different source line."
+msgstr ""
+
+#: command.y:885
+msgid "stepi [COUNT] - step one instruction exactly."
+msgstr ""
+
+#: command.y:887
+msgid "tbreak [[filename:]N|function] - set a temporary breakpoint."
+msgstr ""
+
+#: command.y:889
+msgid "trace on|off - print instruction before executing."
+msgstr ""
+
+#: command.y:891
+msgid "undisplay [N] - remove variable(s) from automatic display list."
+msgstr ""
+
+#: command.y:893
+msgid ""
+"until [[filename:]N|function] - execute until program reaches a different "
+"line or line N within current frame."
+msgstr ""
+
+#: command.y:895
+msgid "unwatch [N] - remove variable(s) from watch list."
+msgstr ""
+
+#: command.y:897
+msgid "up [N] - move N frames up the stack."
+msgstr ""
+
+#: command.y:899
+msgid "watch var - set a watchpoint for a variable."
+msgstr ""
+
+#: command.y:1011 debug.c:395 msg.c:128
+#, c-format
+msgid "error: "
+msgstr "fel: "
+
+#: command.y:1051
+#, fuzzy, c-format
+msgid "can't read command (%s)\n"
+msgstr "kan inte dirigera om från \"%s\" (%s)"
+
+#: command.y:1065
+#, fuzzy, c-format
+msgid "can't read command (%s)"
+msgstr "kan inte dirigera om från \"%s\" (%s)"
+
+#: command.y:1116
+#, fuzzy
+msgid "invalid character in command"
+msgstr "Ogiltigt teckenklassnamn"
+
+#: command.y:1152
+#, c-format
+msgid "unknown command - \"%.*s\", try help"
+msgstr ""
+
+#: command.y:1222
+#, c-format
+msgid "%s"
+msgstr ""
+
+#: command.y:1284
+#, fuzzy
+msgid "invalid character"
+msgstr "Ogiltigt kollationeringstecken"
+
+#: command.y:1455
+#, c-format
+msgid "undefined command: %s\n"
+msgstr ""
+
+#: debug.c:246
+msgid "set or show the number of lines to keep in history file."
+msgstr ""
+
+#: debug.c:248
+msgid "set or show the list command window size."
+msgstr ""
+
+#: debug.c:250
+msgid "set or show gawk output file."
+msgstr ""
+
+#: debug.c:252
+msgid "set or show debugger prompt."
+msgstr ""
+
+#: debug.c:254
+msgid "(un)set or show saving of command history (value=on|off)."
+msgstr ""
+
+#: debug.c:256
+msgid "(un)set or show saving of options (value=on|off)."
+msgstr ""
+
+#: debug.c:258
+msgid "(un)set or show instruction tracing (value=on|off)."
+msgstr ""
+
+#: debug.c:339
+msgid "program not running."
+msgstr ""
+
+#: debug.c:442 debug.c:597
+#, fuzzy, c-format
+msgid "can't read source file `%s' (%s)"
+msgstr "kan inte läsa källfilen \"%s\" (%s)"
+
+#: debug.c:447
+#, fuzzy, c-format
+msgid "source file `%s' is empty.\n"
+msgstr "källfilen \"%s\" är tom"
+
+#: debug.c:474
+msgid "no current source file."
+msgstr ""
+
+#: debug.c:499
+#, fuzzy, c-format
+msgid "cannot find source file named `%s' (%s)"
+msgstr "kan inte läsa källfilen \"%s\" (%s)"
+
+#: debug.c:523
+#, c-format
+msgid "WARNING: source file `%s' modified since program compilation.\n"
+msgstr ""
+
+#: debug.c:542
+#, c-format
+msgid "line number %d out of range; `%s' has %d lines"
+msgstr ""
+
+#: debug.c:602
+#, fuzzy, c-format
+msgid "unexpected eof while reading file `%s', line %d"
+msgstr "oväntat nyradstecken eller slut på strängen"
+
+#: debug.c:611
+#, c-format
+msgid "source file `%s' modified since start of program execution"
+msgstr ""
+
+#: debug.c:723
+#, fuzzy, c-format
+msgid "Current source file: %s\n"
+msgstr "inkluderade redan källfilen \"%s\""
+
+#: debug.c:724
+#, c-format
+msgid "Number of lines: %d\n"
+msgstr ""
+
+#: debug.c:731
+#, c-format
+msgid "Source file (lines): %s (%d)\n"
+msgstr ""
+
+#: debug.c:745
+msgid ""
+"Number Disp Enabled Location\n"
+"\n"
+msgstr ""
+
+#: debug.c:756
+#, c-format
+msgid "\tno of hits = %ld\n"
+msgstr ""
+
+#: debug.c:758
+#, c-format
+msgid "\tignore next %ld hit(s)\n"
+msgstr ""
+
+#: debug.c:760 debug.c:900
+#, c-format
+msgid "\tstop condition: %s\n"
+msgstr ""
+
+#: debug.c:762 debug.c:902
+msgid "\tcommands:\n"
+msgstr ""
+
+#: debug.c:784
+#, c-format
+msgid "Current frame: "
+msgstr ""
+
+#: debug.c:787
+#, c-format
+msgid "Called by frame: "
+msgstr ""
+
+#: debug.c:791
+#, c-format
+msgid "Caller of frame: "
+msgstr ""
+
+#: debug.c:809
+#, c-format
+msgid "None in main().\n"
+msgstr ""
+
+#: debug.c:839
+#, fuzzy
+msgid "No arguments.\n"
+msgstr "printf: inga argument"
+
+#: debug.c:840
+msgid "No locals.\n"
+msgstr ""
+
+#: debug.c:848
+msgid ""
+"All defined variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:858
+msgid ""
+"All defined functions:\n"
+"\n"
+msgstr ""
+
+#: debug.c:877
+msgid ""
+"Auto-display variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:880
+msgid ""
+"Watch variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:1020
+#, fuzzy, c-format
+msgid "no symbol `%s' in current context\n"
+msgstr "\"exit\" kan inte anropas i det aktuella sammanhanget"
+
+#: debug.c:1032 debug.c:1416
+#, fuzzy, c-format
+msgid "`%s' is not an array\n"
+msgstr "\"%s\" är inte ett giltigt variabelnamn"
+
+#: debug.c:1046
+#, fuzzy, c-format
+msgid "$%ld = uninitialized field\n"
+msgstr "referens till icke initierat fält \"$%d\""
+
+#: debug.c:1067
+#, fuzzy, c-format
+msgid "array `%s' is empty\n"
+msgstr "datafilen \"%s\" är tom"
+
+#: debug.c:1110 debug.c:1162
+#, fuzzy, c-format
+msgid "[\"%s\"] not in array `%s'\n"
+msgstr "delete: index \"%s\" finns inte i vektorn \"%s\""
+
+#: debug.c:1166
+#, c-format
+msgid "`%s[\"%s\"]' is not an array\n"
+msgstr ""
+
+#: debug.c:1227 debug.c:4947
+#, fuzzy, c-format
+msgid "`%s' is not a scalar variable"
+msgstr "\"%s\" är inte ett giltigt variabelnamn"
+
+#: debug.c:1249 debug.c:4977
+#, fuzzy, c-format
+msgid "attempt to use array `%s[\"%s\"]' in a scalar context"
+msgstr "försök att använda vektorn \"%s[\"%.*s\"]\" i skalärsammanhang"
+
+#: debug.c:1269 debug.c:4988
+#, fuzzy, c-format
+msgid "attempt to use scalar `%s[\"%s\"]' as array"
+msgstr "försök att använda skalären \"%s[\"%.*s\"]\" som en vektor"
+
+#: debug.c:1412
+#, fuzzy, c-format
+msgid "`%s' is a function"
+msgstr "\"%s\" är ogiltigt som ett funktionsnamn"
+
+#: debug.c:1454
+#, c-format
+msgid "watchpoint %d is unconditional\n"
+msgstr ""
+
+#: debug.c:1488
+#, c-format
+msgid "No display item numbered %ld"
+msgstr ""
+
+#: debug.c:1491
+#, c-format
+msgid "No watch item numbered %ld"
+msgstr ""
+
+#: debug.c:1517
+#, fuzzy, c-format
+msgid "%d: [\"%s\"] not in array `%s'\n"
+msgstr "delete: index \"%s\" finns inte i vektorn \"%s\""
+
+#: debug.c:1756
+#, fuzzy
+msgid "attempt to use scalar value as array"
+msgstr "försök att använda ett skalärt värde som vektor"
+
+#: debug.c:1845
+#, c-format
+msgid "Watchpoint %d deleted because parameter is out of scope.\n"
+msgstr ""
+
+#: debug.c:1856
+#, c-format
+msgid "Display %d deleted because parameter is out of scope.\n"
+msgstr ""
+
+#: debug.c:1889
+#, c-format
+msgid " in file `%s', line %d\n"
+msgstr ""
+
+#: debug.c:1910
+#, c-format
+msgid " at `%s':%d"
+msgstr ""
+
+#: debug.c:1926 debug.c:1989
+#, c-format
+msgid "#%ld\tin "
+msgstr ""
+
+#: debug.c:1963
+#, c-format
+msgid "More stack frames follow ...\n"
+msgstr ""
+
+#: debug.c:2006
+#, fuzzy
+msgid "invalid frame number"
+msgstr "Ogiltigt omfångsslut"
+
+#: debug.c:2178
+#, c-format
+msgid "Note: breakpoint %d (enabled, ignore next %ld hits), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2185
+#, c-format
+msgid "Note: breakpoint %d (enabled), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2192
+#, c-format
+msgid "Note: breakpoint %d (disabled, ignore next %ld hits), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2199
+#, c-format
+msgid "Note: breakpoint %d (disabled), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2216
+#, c-format
+msgid "Breakpoint %d set at file `%s', line %d\n"
+msgstr ""
+
+#: debug.c:2318
+#, c-format
+msgid "Can't set breakpoint in file `%s'\n"
+msgstr ""
+
+#: debug.c:2347 debug.c:2470 debug.c:3328
+#, fuzzy, c-format
+msgid "line number %d in file `%s' out of range"
+msgstr "exp: argumentet %g är inte inom tillåten gräns"
+
+#: debug.c:2351
+#, c-format
+msgid "Can't find rule!!!\n"
+msgstr ""
+
+#: debug.c:2353
+#, c-format
+msgid "Can't set breakpoint at `%s':%d\n"
+msgstr ""
+
+#: debug.c:2365
+#, c-format
+msgid "Can't set breakpoint in function `%s'\n"
+msgstr ""
+
+#: debug.c:2381
+#, c-format
+msgid "breakpoint %d set at file `%s', line %d is unconditional\n"
+msgstr ""
+
+#: debug.c:2486 debug.c:2508
+#, c-format
+msgid "Deleted breakpoint %d"
+msgstr ""
+
+#: debug.c:2492
+#, c-format
+msgid "No breakpoint(s) at entry to function `%s'\n"
+msgstr ""
+
+#: debug.c:2519
+#, fuzzy, c-format
+msgid "No breakpoint at file `%s', line #%d\n"
+msgstr "fel vid läsning av indatafilen \"%s\": %s"
+
+#: debug.c:2574 debug.c:2615 debug.c:2635 debug.c:2678
+msgid "invalid breakpoint number"
+msgstr ""
+
+#: debug.c:2590
+msgid "Delete all breakpoints? (y or n) "
+msgstr ""
+
+#: debug.c:2591 debug.c:2901 debug.c:2954
+msgid "y"
+msgstr ""
+
+#: debug.c:2640
+#, c-format
+msgid "Will ignore next %ld crossing(s) of breakpoint %d.\n"
+msgstr ""
+
+#: debug.c:2644
+#, c-format
+msgid "Will stop next time breakpoint %d is reached.\n"
+msgstr ""
+
+#: debug.c:2761
+#, c-format
+msgid "Can only debug programs provided with the `-f' option.\n"
+msgstr ""
+
+#: debug.c:2886
+#, c-format
+msgid "Failed to restart debugger"
+msgstr ""
+
+#: debug.c:2900
+msgid "Program already running. Restart from beginning (y/n)? "
+msgstr ""
+
+#: debug.c:2904
+#, c-format
+msgid "Program not restarted\n"
+msgstr ""
+
+#: debug.c:2914
+#, c-format
+msgid "error: cannot restart, operation not allowed\n"
+msgstr ""
+
+#: debug.c:2920
+#, c-format
+msgid "error (%s): cannot restart, ignoring rest of the commands\n"
+msgstr ""
+
+#: debug.c:2928
+#, c-format
+msgid "Starting program: \n"
+msgstr ""
+
+#: debug.c:2937
+#, c-format
+msgid "Program exited %s with exit value: %d\n"
+msgstr ""
+
+#: debug.c:2953
+msgid "The program is running. Exit anyway (y/n)? "
+msgstr ""
+
+#: debug.c:2988
+#, c-format
+msgid "Not stopped at any breakpoint; argument ignored.\n"
+msgstr ""
+
+#: debug.c:2993
+#, c-format
+msgid "invalid breakpoint number %d."
+msgstr ""
+
+#: debug.c:2998
+#, c-format
+msgid "Will ignore next %ld crossings of breakpoint %d.\n"
+msgstr ""
+
+#: debug.c:3185
+#, c-format
+msgid "'finish' not meaningful in the outermost frame main()\n"
+msgstr ""
+
+#: debug.c:3190
+#, c-format
+msgid "Run till return from "
+msgstr ""
+
+#: debug.c:3233
+#, c-format
+msgid "'return' not meaningful in the outermost frame main()\n"
+msgstr ""
+
+#: debug.c:3347
+#, c-format
+msgid "Can't find specified location in function `%s'\n"
+msgstr ""
+
+#: debug.c:3355
+#, fuzzy, c-format
+msgid "invalid source line %d in file `%s'"
+msgstr "inkluderade redan källfilen \"%s\""
+
+#: debug.c:3370
+#, c-format
+msgid "Can't find specified location %d in file `%s'\n"
+msgstr ""
+
+#: debug.c:3402
+#, fuzzy, c-format
+msgid "element not in array\n"
+msgstr "delete: index \"%s\" finns inte i vektorn \"%s\""
+
+#: debug.c:3402
+#, c-format
+msgid "untyped variable\n"
+msgstr ""
+
+#: debug.c:3444
+#, c-format
+msgid "Stopping in %s ...\n"
+msgstr ""
+
+#: debug.c:3521
+#, c-format
+msgid "'finish' not meaningful with non-local jump '%s'\n"
+msgstr ""
+
+#: debug.c:3528
+#, c-format
+msgid "'until' not meaningful with non-local jump '%s'\n"
+msgstr ""
+
+#: debug.c:4163
+msgid "\t------[Enter] to continue or q [Enter] to quit------"
+msgstr ""
+
+#: debug.c:4164
+msgid "q"
+msgstr ""
+
+#: debug.c:4984
+#, fuzzy, c-format
+msgid "[\"%s\"] not in array `%s'"
+msgstr "delete: index \"%s\" finns inte i vektorn \"%s\""
+
+#: debug.c:5190
+#, c-format
+msgid "sending output to stdout\n"
+msgstr ""
+
+#: debug.c:5230
+msgid "invalid number"
+msgstr ""
+
+#: debug.c:5362
+#, fuzzy, c-format
+msgid "`%s' not allowed in current context; statement ignored"
+msgstr "\"exit\" kan inte anropas i det aktuella sammanhanget"
+
+#: debug.c:5370
+#, fuzzy
+msgid "`return' not allowed in current context; statement ignored"
+msgstr "\"exit\" kan inte anropas i det aktuella sammanhanget"
+
+#: debug.c:5571
+#, c-format
+msgid "No symbol `%s' in current context"
+msgstr ""
+
+#: dfa.c:984 dfa.c:987 dfa.c:1007 dfa.c:1017 dfa.c:1029 dfa.c:1080 dfa.c:1089
+#: dfa.c:1092 dfa.c:1097 dfa.c:1110 dfa.c:1178
+msgid "unbalanced ["
+msgstr ""
+
+#: dfa.c:1038
+#, fuzzy
+msgid "invalid character class"
+msgstr "Ogiltigt teckenklassnamn"
+
+#: dfa.c:1215
+msgid "character class syntax is [[:space:]], not [:space:]"
+msgstr ""
+
+#: dfa.c:1267
+msgid "unfinished \\ escape"
+msgstr ""
+
+#: dfa.c:1414 regcomp.c:161
+msgid "Invalid content of \\{\\}"
+msgstr "Ogiltigt innehåll i \\{\\}"
+
+#: dfa.c:1417 regcomp.c:176
+msgid "Regular expression too big"
+msgstr "Reguljärt uttryck för stort"
+
+#: dfa.c:1802
+msgid "unbalanced ("
+msgstr ""
+
+#: dfa.c:1929
+msgid "no syntax specified"
+msgstr ""
+
+#: dfa.c:1937
+msgid "unbalanced )"
+msgstr ""
+
+#: eval.c:394
#, c-format
msgid "unknown nodetype %d"
msgstr "okänd nodtyp %d"
-#: eval.c:423 eval.c:437
+#: eval.c:405 eval.c:419
#, c-format
msgid "unknown opcode %d"
msgstr "okänd op-kod %d"
-#: eval.c:434
+#: eval.c:416
#, c-format
msgid "opcode %s not an operator or keyword"
msgstr "op-kod %s är inte en operator eller ett nyckelord"
-#: eval.c:488
+#: eval.c:471
msgid "buffer overflow in genflags2str"
msgstr "buffertöverflöd i genflags2str"
-#: eval.c:698
+#: eval.c:674
#, c-format
msgid ""
"\n"
@@ -988,309 +1836,536 @@ msgstr ""
"\t# Funktionsanropsstack:\n"
"\n"
-#: eval.c:725
+#: eval.c:703
msgid "`IGNORECASE' is a gawk extension"
msgstr "\"IGNORECASE\" är en gawk-utökning"
-#: eval.c:754
+#: eval.c:735
msgid "`BINMODE' is a gawk extension"
msgstr "\"BINMODE\" är en gawk-utökning"
-#: eval.c:812
+#: eval.c:792
#, c-format
msgid "BINMODE value `%s' is invalid, treated as 3"
msgstr "BINMODE-värde \"%s\" är ogiltigt, behandlas som 3"
-#: eval.c:902
+#: eval.c:884
#, c-format
msgid "bad `%sFMT' specification `%s'"
msgstr "felaktig \"%sFMT\"-specifikation \"%s\""
-#: eval.c:980
+#: eval.c:968
msgid "turning off `--lint' due to assignment to `LINT'"
msgstr "slår av \"--lint\" på grund av en tilldelning till \"LINT\""
-#: eval.c:1127 eval.c:1777
-#, c-format
-msgid "can't use function name `%s' as variable or array"
-msgstr "kan inte använda funktionsnamnet \"%s\" som variabel eller vektor"
-
-#: eval.c:1158 eval.c:1789 eval.c:1802
+#: eval.c:1144
#, c-format
msgid "reference to uninitialized argument `%s'"
msgstr "referens till icke initierat argument \"%s\""
-#: eval.c:1177
+#: eval.c:1145
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "referens till icke initierad variabel \"%s\""
+
+#: eval.c:1163
msgid "attempt to field reference from non-numeric value"
msgstr "försök att fältreferera från ickenumeriskt värde"
-#: eval.c:1179
+#: eval.c:1165
msgid "attempt to field reference from null string"
msgstr "försök till fältreferens från en tom sträng"
-#: eval.c:1185
+#: eval.c:1173
#, c-format
msgid "attempt to access field %ld"
msgstr "försök att komma åt fält nummer %ld"
-#: eval.c:1194
+#: eval.c:1182
#, c-format
msgid "reference to uninitialized field `$%ld'"
msgstr "referens till icke initierat fält \"$%ld\""
-#: eval.c:1256
+#: eval.c:1269
#, c-format
msgid "function `%s' called with more arguments than declared"
msgstr "funktionen \"%s\" anropad med fler argument än vad som deklarerats"
-#: eval.c:1437
+#: eval.c:1464
#, c-format
msgid "unwind_stack: unexpected type `%s'"
msgstr "unwind_stack: oväntad typ \"%s\""
-#: eval.c:1532
+#: eval.c:1558
msgid "division by zero attempted in `/='"
msgstr "försökte dividera med noll i \"/=\""
-#: eval.c:1539
+#: eval.c:1565
#, c-format
msgid "division by zero attempted in `%%='"
msgstr "försökte dividera med noll i \"%%=\""
-#: eval.c:1876 eval.c:2122
-#, c-format
-msgid "attempt to use array `%s[\"%.*s\"]' in a scalar context"
-msgstr "försök att använda vektorn \"%s[\"%.*s\"]\" i skalärsammanhang"
-
-#: eval.c:1907
-msgid "assignment used in conditional context"
-msgstr "tilldelning använt i jämförelsesammanhang"
-
-#: eval.c:1911
-msgid "statement has no effect"
-msgstr "kommandot har ingen effekt"
-
-#: eval.c:2343
-#, c-format
-msgid "for loop: array `%s' changed size from %ld to %ld during loop execution"
-msgstr ""
-"forslinga: vektorn \"%s\" ändrade storlek från %ld till %ld under "
-"slingexekvering"
-
-#: eval.c:2458
-#, c-format
-msgid "function called indirectly through `%s' does not exist"
-msgstr "funktionen anropad indirekt genom \"%s\" finns inte"
-
-#: eval.c:2470
-#, c-format
-msgid "function `%s' not defined"
-msgstr "funktionen \"%s\" är inte definierad"
-
-#: eval.c:2511
-#, c-format
-msgid "non-redirected `getline' invalid inside `%s' rule"
-msgstr "icke omdirigerad \"getline\" odefinierad inuti \"%s\"-regel"
-
-#: eval.c:2600
-#, c-format
-msgid "error reading input file `%s': %s"
-msgstr "fel vid läsning av indatafilen \"%s\": %s"
-
-#: eval.c:2614
-#, c-format
-msgid "`nextfile' cannot be called from a `%s' rule"
-msgstr "\"nextfile\" kan inte anropas från en \"%s\"-regel"
-
-#: eval.c:2661
-msgid "`exit' cannot be called in the current context"
-msgstr "\"exit\" kan inte anropas i det aktuella sammanhanget"
-
-#: eval.c:2700
-#, c-format
-msgid "`next' cannot be called from a `%s' rule"
-msgstr "\"next\" kan inte anropas från en \"%s\"-regel"
-
-#: eval.c:2766
-#, c-format
-msgid "Sorry, don't know how to interpret `%s'"
-msgstr "Tyvärr, vet inte hur \"%s\" skall tolkas"
-
-#: ext.c:54
+#: ext.c:49
msgid "extensions are not allowed in sandbox mode"
msgstr "utökningar är inte tillåtna i sandlådeläge"
-#: ext.c:60 ext.c:65
-msgid "`extension' is a gawk extension"
-msgstr "\"extension\" är en gawk-utökning"
+#: ext.c:52
+#, fuzzy
+msgid "-l / @load are gawk extensions"
+msgstr "@include är en gawk-utökning"
+
+#: ext.c:55
+msgid "load_ext: received NULL lib_name"
+msgstr ""
-#: ext.c:75
-#, c-format
-msgid "fatal: extension: cannot open `%s' (%s)\n"
+#: ext.c:58
+#, fuzzy, c-format
+msgid "load_ext: cannot open library `%s' (%s)\n"
msgstr "ödesdigert: extension: kan inte öppna \"%s\" (%s)\n"
-#: ext.c:84
-#, c-format
+#: ext.c:64
+#, fuzzy, c-format
msgid ""
-"fatal: extension: library `%s': does not define "
-"`plugin_is_GPL_compatible' (%s)\n"
+"load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n"
msgstr ""
"ödesdigert: extension: biblioteket \"%s\": definierar inte "
"\"plugin_is_GPL_compatible\" (%s)\n"
-#: ext.c:93
-#, c-format
-msgid "fatal: extension: library `%s': cannot call function `%s' (%s)\n"
+#: ext.c:70
+#, fuzzy, c-format
+msgid "load_ext: library `%s': cannot call function `%s' (%s)\n"
msgstr ""
"ödesdigert: extension: bibliotek \"%s\": kan inte anropa funktionen \"%s"
"\" (%s)\n"
-#: ext.c:127
-msgid "extension: missing function name"
+#: ext.c:74
+#, c-format
+msgid "load_ext: library `%s' initialization routine `%s' failed\n"
+msgstr ""
+
+#: ext.c:93
+#, fuzzy
+msgid "make_builtin: missing function name"
msgstr "extension: saknar funktionsnamn"
-#: ext.c:132
-#, c-format
-msgid "extension: illegal character `%c' in function name `%s'"
+#: ext.c:98
+#, fuzzy, c-format
+msgid "make_builtin: illegal character `%c' in function name `%s'"
msgstr "extension: ogiltigt tecken \"%c\" i funktionsnamnet \"%s\""
-#: ext.c:141
-#, c-format
-msgid "extension: can't redefine function `%s'"
+#: ext.c:106
+#, fuzzy, c-format
+msgid "make_builtin: can't redefine function `%s'"
msgstr "extension: det går inte att definiera om funktionen \"%s\""
-#: ext.c:145
-#, c-format
-msgid "extension: function `%s' already defined"
+#: ext.c:110
+#, fuzzy, c-format
+msgid "make_builtin: function `%s' already defined"
msgstr "extension: funktionen \"%s\" är redan definierad"
-#: ext.c:150
-#, c-format
-msgid "extension: function name `%s' previously defined"
+#: ext.c:114
+#, fuzzy, c-format
+msgid "make_builtin: function name `%s' previously defined"
msgstr "extension: funktionsnamnet \"%s\" är definierat sedan tidigare"
-#: ext.c:152
-#, c-format
-msgid "extension: can't use gawk built-in `%s' as function name"
+#: ext.c:116
+#, fuzzy, c-format
+msgid "make_builtin: can't use gawk built-in `%s' as function name"
msgstr ""
"extension: kan inte använda gawks inbyggda \"%s\" som ett funktionsnamn"
-#: ext.c:156
+#: ext.c:119
#, c-format
msgid "make_builtin: negative argument count for function `%s'"
msgstr "make_builtin: negativt argumentantal för funktionen \"%s\""
-#: ext.c:259
+#: ext.c:183
#, c-format
msgid "function `%s' defined to take no more than %d argument(s)"
msgstr "funktionen \"%s\" definierades för att ta maximalt %d argument"
-#: ext.c:262
+#: ext.c:186
#, c-format
msgid "function `%s': missing argument #%d"
msgstr "funktionen \"%s\": argument %d saknas"
-#: ext.c:279
+#: ext.c:203
#, c-format
msgid "function `%s': argument #%d: attempt to use scalar as an array"
msgstr "funktionen \"%s\": argument %d: försök att använda skalär som vektor"
-#: ext.c:283
+#: ext.c:207
#, c-format
msgid "function `%s': argument #%d: attempt to use array as a scalar"
msgstr "funktionen \"%s\": argument %d: försök att använda vektor som skalär"
-#: ext.c:296
-msgid "Operation Not Supported"
-msgstr "Operationen stöds inte"
+#: ext.c:221
+msgid "dynamic loading of library not supported"
+msgstr ""
+
+#: extension/filefuncs.c:75
+#, fuzzy
+msgid "chdir: called with incorrect number of arguments, expecting 1"
+msgstr "sqrt: anropad med negativt argument %g"
+
+#: extension/filefuncs.c:348
+#, fuzzy
+msgid "stat: called with wrong number of arguments"
+msgstr "sqrt: anropad med negativt argument %g"
+
+#: extension/filefuncs.c:355
+#, fuzzy
+msgid "stat: bad parameters"
+msgstr "%s: är en parameter\n"
+
+#: extension/filefuncs.c:421
+msgid "fill_stat_element: could not create array"
+msgstr ""
+
+#: extension/filefuncs.c:430
+msgid "fill_stat_element: could not set element"
+msgstr ""
+
+#: extension/filefuncs.c:445
+#, fuzzy
+msgid "fill_path_element: could not set element"
+msgstr "index: andra argumentet är inte en sträng"
+
+#: extension/filefuncs.c:461
+msgid "fill_error_element: could not set element"
+msgstr ""
+
+#: extension/filefuncs.c:508 extension/filefuncs.c:555
+msgid "fts-process: could not create array"
+msgstr ""
+
+#: extension/filefuncs.c:518 extension/filefuncs.c:565
+#: extension/filefuncs.c:583
+#, fuzzy
+msgid "fts-process: could not set element"
+msgstr "index: andra argumentet är inte en sträng"
+
+#: extension/filefuncs.c:632
+#, fuzzy
+msgid "fts: called with incorrect number of arguments, expecting 3"
+msgstr "sqrt: anropad med negativt argument %g"
+
+#: extension/filefuncs.c:635
+#, fuzzy
+msgid "fts: bad first parameter"
+msgstr "%s: är en parameter\n"
+
+#: extension/filefuncs.c:641
+#, fuzzy
+msgid "fts: bad second parameter"
+msgstr "%s: är en parameter\n"
+
+#: extension/filefuncs.c:647
+#, fuzzy
+msgid "fts: bad third parameter"
+msgstr "%s: är en parameter\n"
+
+#: extension/filefuncs.c:654
+#, fuzzy
+msgid "fts: could not flatten array\n"
+msgstr "\"%s\" är inte ett giltigt variabelnamn"
+
+#: extension/filefuncs.c:672
+msgid "fts: ignoring sneaky FTS_NOSTAT flag. nyah, nyah, nyah."
+msgstr ""
+
+#: extension/filefuncs.c:689
+msgid "fts: clear_array failed\n"
+msgstr ""
+
+#: extension/fnmatch.c:91
+#, fuzzy
+msgid "fnmatch: called with less than three arguments"
+msgstr "sqrt: anropad med negativt argument %g"
+
+#: extension/fnmatch.c:94
+#, fuzzy
+msgid "fnmatch: called with more than three arguments"
+msgstr "sqrt: anropad med negativt argument %g"
+
+#: extension/fnmatch.c:97
+#, fuzzy
+msgid "fnmatch: could not get first argument"
+msgstr "strftime: fick ett första argument som inte är en sträng"
+
+#: extension/fnmatch.c:102
+#, fuzzy
+msgid "fnmatch: could not get second argument"
+msgstr "index: andra argumentet är inte en sträng"
+
+#: extension/fnmatch.c:107
+msgid "fnmatch: could not get third argument"
+msgstr ""
+
+#: extension/fnmatch.c:120
+msgid "fnmatch is not implemented on this system\n"
+msgstr ""
+
+#: extension/fnmatch.c:152
+msgid "fnmatch init: could not add FNM_NOMATCH variable"
+msgstr ""
+
+#: extension/fnmatch.c:162
+#, c-format
+msgid "fnmatch init: could not set array element %s"
+msgstr ""
+
+#: extension/fnmatch.c:172
+msgid "fnmatch init: could not install FNM array"
+msgstr ""
+
+#: extension/fork.c:81
+#, fuzzy
+msgid "fork: called with too many arguments"
+msgstr "sqrt: anropad med negativt argument %g"
+
+#: extension/fork.c:94
+msgid "fork: PROCINFO is not an array!"
+msgstr ""
+
+#: extension/fork.c:118
+#, fuzzy
+msgid "waitpid: called with too many arguments"
+msgstr "sqrt: anropad med negativt argument %g"
+
+#: extension/fork.c:126
+#, fuzzy
+msgid "wait: called with no arguments"
+msgstr "sqrt: anropad med negativt argument %g"
+
+#: extension/fork.c:143
+#, fuzzy
+msgid "wait: called with too many arguments"
+msgstr "sqrt: anropad med negativt argument %g"
+
+#: extension/ordchr.c:69
+#, fuzzy
+msgid "ord: called with too many arguments"
+msgstr "sqrt: anropad med negativt argument %g"
+
+#: extension/ordchr.c:75
+#, fuzzy
+msgid "ord: called with no arguments"
+msgstr "sqrt: anropad med negativt argument %g"
+
+#: extension/ordchr.c:77
+#, fuzzy
+msgid "ord: called with inappropriate argument(s)"
+msgstr "sqrt: anropad med negativt argument %g"
+
+#: extension/ordchr.c:99
+#, fuzzy
+msgid "chr: called with too many arguments"
+msgstr "sqrt: anropad med negativt argument %g"
+
+#: extension/ordchr.c:109
+#, fuzzy
+msgid "chr: called with no arguments"
+msgstr "sqrt: anropad med negativt argument %g"
+
+#: extension/ordchr.c:111
+#, fuzzy
+msgid "chr: called with inappropriate argument(s)"
+msgstr "sqrt: anropad med negativt argument %g"
+
+#: extension/readfile.c:81
+#, fuzzy
+msgid "readfile: called with too many arguments"
+msgstr "sqrt: anropad med negativt argument %g"
+
+#: extension/readfile.c:114
+#, fuzzy
+msgid "readfile: called with no arguments"
+msgstr "sqrt: anropad med negativt argument %g"
+
+#: extension/rwarray.c:120
+#, fuzzy
+msgid "writea: called with too many arguments"
+msgstr "sqrt: anropad med negativt argument %g"
+
+#: extension/rwarray.c:127
+#, fuzzy, c-format
+msgid "do_writea: argument 0 is not a string\n"
+msgstr "exp: argumentet %g är inte inom tillåten gräns"
+
+#: extension/rwarray.c:133
+#, fuzzy, c-format
+msgid "do_writea: argument 1 is not an array\n"
+msgstr "split: fjärde argumentet är inte en vektor"
+
+#: extension/rwarray.c:180
+#, c-format
+msgid "write_array: could not flatten array\n"
+msgstr ""
+
+#: extension/rwarray.c:194
+#, c-format
+msgid "write_array: could not release flattened array\n"
+msgstr ""
+
+#: extension/rwarray.c:276
+#, fuzzy
+msgid "reada: called with too many arguments"
+msgstr "sqrt: anropad med negativt argument %g"
+
+#: extension/rwarray.c:283
+#, fuzzy, c-format
+msgid "do_reada: argument 0 is not a string\n"
+msgstr "exp: argumentet %g är inte inom tillåten gräns"
+
+#: extension/rwarray.c:289
+#, fuzzy, c-format
+msgid "do_reada: argument 1 is not an array\n"
+msgstr "match: tredje argumentet är inte en vektor"
+
+#: extension/rwarray.c:333
+#, c-format
+msgid "do_reada: clear_array failed\n"
+msgstr ""
+
+#: extension/rwarray.c:370
+#, c-format
+msgid "read_array: set_array_element failed\n"
+msgstr ""
+
+#: extension/time.c:78
+#, fuzzy
+msgid "gettimeofday: ignoring arguments"
+msgstr "mktime: fick ett argument som inte är en sträng"
+
+#: extension/time.c:109
+msgid "gettimeofday: not supported on this platform"
+msgstr ""
+
+#: extension/time.c:130
+#, fuzzy
+msgid "sleep: called with too many arguments"
+msgstr "sqrt: anropad med negativt argument %g"
+
+#: extension/time.c:133
+#, fuzzy
+msgid "sleep: missing required numeric argument"
+msgstr "exp: fick ett ickenumeriskt argument"
+
+#: extension/time.c:139
+#, fuzzy
+msgid "sleep: argument is negative"
+msgstr "exp: argumentet %g är inte inom tillåten gräns"
+
+#: extension/time.c:166
+msgid "sleep: not supported on this platform"
+msgstr ""
-#: field.c:328
+#: field.c:339
msgid "NF set to negative value"
msgstr "NF satt till ett negativt värde"
-#: field.c:951 field.c:958 field.c:962
+#: field.c:962 field.c:969 field.c:973
msgid "split: fourth argument is a gawk extension"
msgstr "split: fjärde argumentet är en gawk-utökning"
-#: field.c:955
+#: field.c:966
msgid "split: fourth argument is not an array"
msgstr "split: fjärde argumentet är inte en vektor"
-#: field.c:969
+#: field.c:980
msgid "split: second argument is not an array"
msgstr "split: andra argumentet är inte en vektor"
-#: field.c:973
+#: field.c:984
msgid "split: cannot use the same array for second and fourth args"
msgstr ""
"split: det går inte att använda samma vektor som andra och fjärde argument"
-#: field.c:978
+#: field.c:989
msgid "split: cannot use a subarray of second arg for fourth arg"
msgstr ""
"split: det går inte att använda en delvektor av andra argumentet som fjärde "
"argument"
-#: field.c:981
+#: field.c:992
msgid "split: cannot use a subarray of fourth arg for second arg"
msgstr ""
"split: det går inte att använda en delvektor av fjärde argumentet som andra "
"argument"
-#: field.c:1010
+#: field.c:1021
msgid "split: null string for third arg is a gawk extension"
msgstr "split: tom sträng som tredje argument är en gawk-utökning"
-#: field.c:1050
+#: field.c:1061
msgid "patsplit: fourth argument is not an array"
msgstr "patsplit: fjärde argumentet är inte en vektor"
-#: field.c:1055
+#: field.c:1066
msgid "patsplit: second argument is not an array"
msgstr "patsplit: andra argumentet är inte en vektor"
-#: field.c:1061
+#: field.c:1072
msgid "patsplit: third argument must be non-null"
msgstr "patsplit: tredje argumentet får inte vara tomt"
-#: field.c:1065
+#: field.c:1076
msgid "patsplit: cannot use the same array for second and fourth args"
msgstr ""
"patsplit: det går inte att använda samma vektor som andra och fjärde argument"
-#: field.c:1070
+#: field.c:1081
msgid "patsplit: cannot use a subarray of second arg for fourth arg"
msgstr ""
"patsplit: det går inte att använda en delvektor av andra argumentet som "
"fjärde argument"
-#: field.c:1073
+#: field.c:1084
msgid "patsplit: cannot use a subarray of fourth arg for second arg"
msgstr ""
"patsplit: det går inte att använda en delvektor av fjärde argumentet som "
"andra argument"
-#: field.c:1110
+#: field.c:1122
msgid "`FIELDWIDTHS' is a gawk extension"
msgstr "\"FIELDWIDTHS\" är en gawk-utökning"
-#: field.c:1173
+#: field.c:1186
#, c-format
msgid "invalid FIELDWIDTHS value, near `%s'"
msgstr "ogiltigt FIELDWITHS-värde i närheten av \"%s\""
-#: field.c:1246
+#: field.c:1259
msgid "null string for `FS' is a gawk extension"
msgstr "tom sträng som \"FS\" är en gawk-utökning"
-#: field.c:1250
+#: field.c:1263
msgid "old awk does not support regexps as value of `FS'"
msgstr "gamla awk stöder inte reguljära uttryck som värden på \"FS\""
-#: field.c:1369
+#: field.c:1382
msgid "`FPAT' is a gawk extension"
msgstr "\"FPAT\" är en gawk-utökning"
+#: gawkapi.c:143
+msgid "awk_value_to_node: received null retval"
+msgstr ""
+
+#: gawkapi.c:932
+#, c-format
+msgid "api_flatten_array: could not convert index %d\n"
+msgstr ""
+
+#: gawkapi.c:937
+#, c-format
+msgid "api_flatten_array: could not convert value %d\n"
+msgstr ""
+
+#: gawkapi.c:1111
+msgid "cannot assign to defined constant"
+msgstr ""
+
#: getopt.c:604 getopt.c:633
#, fuzzy, c-format
msgid "%s: option '%s' is ambiguous; possibilities:"
@@ -1346,459 +2421,523 @@ msgstr "%s: flaggan \"-W %s\" tillåter inte något argument\n"
msgid "%s: option '-W %s' requires an argument\n"
msgstr "%s: flaggan \"-W %s\" kräver ett argument\n"
-#: io.c:280
+#: io.c:339
#, c-format
msgid "command line argument `%s' is a directory: skipped"
msgstr "kommandoradsargumentet \"%s\" är en katalog: hoppas över"
-#: io.c:283 io.c:385
+#: io.c:342 io.c:455
#, c-format
msgid "cannot open file `%s' for reading (%s)"
msgstr "kan inte öppna filen \"%s\" för läsning (%s)"
-#: io.c:501
+#: io.c:582
#, c-format
msgid "close of fd %d (`%s') failed (%s)"
msgstr "stängning av fd %d (\"%s\") misslyckades (%s)"
-#: io.c:578
+#: io.c:658
msgid "redirection not allowed in sandbox mode"
msgstr "omdirigering är inte tillåten i sandlådeläge"
-#: io.c:612
+#: io.c:692
#, c-format
msgid "expression in `%s' redirection only has numeric value"
msgstr "uttrycket i \"%s\"-omdirigering har bara numeriskt värde"
-#: io.c:618
+#: io.c:698
#, c-format
msgid "expression for `%s' redirection has null string value"
msgstr "uttrycket för \"%s\"-omdirigering har en tom sträng som värde"
-#: io.c:623
+#: io.c:703
#, c-format
msgid "filename `%s' for `%s' redirection may be result of logical expression"
msgstr ""
"filnamnet \"%s\" för \"%s\"-omdirigering kan vara resultatet av ett logiskt "
"uttryck"
-#: io.c:666
+#: io.c:746
#, c-format
msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
msgstr "onödig blandning av \">\" och \">>\" för filen \"%.*s\""
-#: io.c:719
+#: io.c:799
#, c-format
msgid "can't open pipe `%s' for output (%s)"
msgstr "kan inte öppna röret \"%s\" för utmatning (%s)"
-#: io.c:729
+#: io.c:809
#, c-format
msgid "can't open pipe `%s' for input (%s)"
msgstr "kan inte öppna röret \"%s\" för inmatning (%s)"
-#: io.c:752
+#: io.c:840
#, c-format
msgid "can't open two way pipe `%s' for input/output (%s)"
msgstr "kan inte öppna tvåvägsröret \"%s\" för in-/utmatning (%s)"
-#: io.c:834
+#: io.c:923
#, c-format
msgid "can't redirect from `%s' (%s)"
msgstr "kan inte dirigera om från \"%s\" (%s)"
-#: io.c:837
+#: io.c:926
#, c-format
msgid "can't redirect to `%s' (%s)"
msgstr "kan inte dirigera om till \"%s\" (%s)"
-#: io.c:888
+#: io.c:977
msgid ""
"reached system limit for open files: starting to multiplex file descriptors"
msgstr ""
"nådde systembegränsningen för öppna filer: börjar multiplexa fildeskriptorer"
-#: io.c:904
+#: io.c:993
#, c-format
msgid "close of `%s' failed (%s)."
msgstr "stängning av \"%s\" misslyckades (%s)"
-#: io.c:912
+#: io.c:1001
msgid "too many pipes or input files open"
msgstr "för många rör eller indatafiler öppna"
-#: io.c:934
+#: io.c:1023
msgid "close: second argument must be `to' or `from'"
msgstr "close: andra argumentet måste vara \"to\" eller \"from\""
-#: io.c:951
+#: io.c:1040
#, c-format
msgid "close: `%.*s' is not an open file, pipe or co-process"
msgstr "close: \"%.*s\" är inte en öppen fil, rör eller koprocess"
-#: io.c:956
+#: io.c:1045
msgid "close of redirection that was never opened"
msgstr "stängning av omdirigering som aldrig öppnades"
-#: io.c:1053
+#: io.c:1142
#, c-format
msgid "close: redirection `%s' not opened with `|&', second argument ignored"
msgstr ""
"close: omdirigeringen \"%s\" öppnades inte med \"|&\", andra argumentet "
"ignorerat"
-#: io.c:1069
+#: io.c:1159
#, c-format
msgid "failure status (%d) on pipe close of `%s' (%s)"
msgstr "felstatus (%d) från rörstängning av \"%s\" (%s)"
-#: io.c:1072
+#: io.c:1162
#, c-format
msgid "failure status (%d) on file close of `%s' (%s)"
msgstr "felstatus (%d) från filstängning av \"%s\" (%s)"
-#: io.c:1092
+#: io.c:1182
#, c-format
msgid "no explicit close of socket `%s' provided"
msgstr "ingen explicit stängning av uttaget \"%s\" tillhandahållen"
-#: io.c:1095
+#: io.c:1185
#, c-format
msgid "no explicit close of co-process `%s' provided"
msgstr "ingen explicit stängning av koprocessen \"%s\" tillhandahållen"
-#: io.c:1098
+#: io.c:1188
#, c-format
msgid "no explicit close of pipe `%s' provided"
msgstr "ingen explicit stängning av röret \"%s\" tillhandahållen"
-#: io.c:1101
+#: io.c:1191
#, c-format
msgid "no explicit close of file `%s' provided"
msgstr "ingen explicit stängning av filen \"%s\" tillhandahållen"
-#: io.c:1129 io.c:1184 main.c:797 main.c:834
+#: io.c:1219 io.c:1274 main.c:847 main.c:884
#, c-format
msgid "error writing standard output (%s)"
msgstr "fel vid skrivning till standard ut (%s)"
-#: io.c:1133 io.c:1189
+#: io.c:1223 io.c:1279
#, c-format
msgid "error writing standard error (%s)"
msgstr "fel vid skrivning till standard fel (%s)"
-#: io.c:1141
+#: io.c:1231
#, c-format
msgid "pipe flush of `%s' failed (%s)."
msgstr "rörspolning av \"%s\" misslyckades (%s)"
-#: io.c:1144
+#: io.c:1234
#, c-format
msgid "co-process flush of pipe to `%s' failed (%s)."
msgstr "koprocesspolning av röret till \"%s\" misslyckades (%s)"
-#: io.c:1147
+#: io.c:1237
#, c-format
msgid "file flush of `%s' failed (%s)."
msgstr "filspolning av \"%s\" misslyckades (%s)"
-#: io.c:1262
+#: io.c:1351
#, c-format
msgid "local port %s invalid in `/inet'"
msgstr "lokal port %s ogiltig i \"/inet\""
-#: io.c:1279
+#: io.c:1369
#, c-format
msgid "remote host and port information (%s, %s) invalid"
msgstr "ogiltig information (%s, %s) för fjärrvärd och fjärrport"
-#: io.c:1431
+#: io.c:1521
#, c-format
msgid "no (known) protocol supplied in special filename `%s'"
msgstr ""
"inget (känt) protokoll tillhandahållet i det speciella filnamnet \"%s\""
-#: io.c:1445
+#: io.c:1535
#, c-format
msgid "special file name `%s' is incomplete"
msgstr "speciellt filnamn \"%s\" är ofullständigt"
-#: io.c:1462
+#: io.c:1552
msgid "must supply a remote hostname to `/inet'"
msgstr "måste tillhandahålla ett fjärrdatornamn till \"/inet\""
-#: io.c:1480
+#: io.c:1570
msgid "must supply a remote port to `/inet'"
msgstr "måste tillhandahålla en fjärrport till \"/inet\""
-#: io.c:1526
+#: io.c:1616
msgid "TCP/IP communications are not supported"
msgstr "TCP/IP-kommunikation stöds inte"
-#: io.c:1693
+#: io.c:1785
#, c-format
msgid "could not open `%s', mode `%s'"
msgstr "kunde inte öppna \"%s\", läge \"%s\""
-#: io.c:1747
+#: io.c:1835
#, c-format
msgid "close of master pty failed (%s)"
msgstr "stängning av huvudpty misslyckades (%s)"
-#: io.c:1749 io.c:1917 io.c:2074
+#: io.c:1837 io.c:2012 io.c:2181
#, c-format
msgid "close of stdout in child failed (%s)"
msgstr "stängning av standard ut i barnet misslyckades (%s)"
-#: io.c:1752
+#: io.c:1840
#, c-format
msgid "moving slave pty to stdout in child failed (dup: %s)"
msgstr "flyttandet av slavpty till standard ut i barnet misslyckades (dup: %s)"
-#: io.c:1754 io.c:1922
+#: io.c:1842 io.c:2017
#, c-format
msgid "close of stdin in child failed (%s)"
msgstr "stängning av standard in i barnet misslyckades (%s)"
-#: io.c:1757
+#: io.c:1845
#, c-format
msgid "moving slave pty to stdin in child failed (dup: %s)"
msgstr "flyttandet av slavpty till standard in i barnet misslyckades (dup: %s)"
-#: io.c:1759 io.c:1780
+#: io.c:1847 io.c:1868
#, c-format
msgid "close of slave pty failed (%s)"
msgstr "stängning av slavpty misslyckades (%s)"
-#: io.c:1858 io.c:1920 io.c:2052 io.c:2077
+#: io.c:1953 io.c:2015 io.c:2158 io.c:2184
#, c-format
msgid "moving pipe to stdout in child failed (dup: %s)"
msgstr "flyttande av rör till standard ut i barnet misslyckades (dup: %s)"
-#: io.c:1865 io.c:1925
+#: io.c:1960 io.c:2020
#, c-format
msgid "moving pipe to stdin in child failed (dup: %s)"
msgstr "flyttande av rör till standard in i barnet misslyckades (dup: %s)"
-#: io.c:1885 io.c:2067
+#: io.c:1980 io.c:2174
msgid "restoring stdout in parent process failed\n"
msgstr "återställande av standard ut i förälderprocessen misslyckades\n"
-#: io.c:1893
+#: io.c:1988
msgid "restoring stdin in parent process failed\n"
msgstr "återställande av standard in i förälderprocessen misslyckades\n"
-#: io.c:1928 io.c:2079 io.c:2093
+#: io.c:2023 io.c:2186 io.c:2200
#, c-format
msgid "close of pipe failed (%s)"
msgstr "stängning av röret misslyckades (%s)"
-#: io.c:1973
+#: io.c:2076
msgid "`|&' not supported"
msgstr "\"|&\" stöds inte"
-#: io.c:2039
+#: io.c:2143
#, c-format
msgid "cannot open pipe `%s' (%s)"
msgstr "kan inte öppna röret \"%s\" (%s)"
-#: io.c:2087
+#: io.c:2194
#, c-format
msgid "cannot create child process for `%s' (fork: %s)"
msgstr "kan inte skapa barnprocess för \"%s\" (fork: %s)"
-#: io.c:2520
+#: io.c:2652
+msgid "register_input_parser: received NULL pointer"
+msgstr ""
+
+#: io.c:2680
+#, c-format
+msgid "input parser `%s' conflicts with previously installed input parser `%s'"
+msgstr ""
+
+#: io.c:2687
+#, c-format
+msgid "input parser `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2707
+msgid "register_output_wrapper: received NULL pointer"
+msgstr ""
+
+#: io.c:2735
+#, c-format
+msgid ""
+"output wrapper `%s' conflicts with previously installed output wrapper `%s'"
+msgstr ""
+
+#: io.c:2742
+#, c-format
+msgid "output wrapper `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2763
+msgid "register_output_processor: received NULL pointer"
+msgstr ""
+
+#: io.c:2792
+#, c-format
+msgid ""
+"two-way processor `%s' conflicts with previously installed two-way processor "
+"`%s'"
+msgstr ""
+
+#: io.c:2801
+#, c-format
+msgid "two way processor `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2908
#, c-format
msgid "data file `%s' is empty"
msgstr "datafilen \"%s\" är tom"
-#: io.c:2561 io.c:2569
+#: io.c:2950 io.c:2958
msgid "could not allocate more input memory"
msgstr "kunde inte allokera mer indataminne"
-#: io.c:3127
+#: io.c:3524
msgid "multicharacter value of `RS' is a gawk extension"
msgstr "flerteckensvärdet av \"RS\" är en gawk-utökning"
-#: io.c:3232
+#: io.c:3613
msgid "IPv6 communication is not supported"
msgstr "IPv6-kommunikation stöds inte"
-#: main.c:366
+#: main.c:362
msgid "`-m[fr]' option irrelevant in gawk"
msgstr "\"-m[fr]\"-flaggan är irrelevant i gawk"
-#: main.c:368
+#: main.c:364
msgid "-m option usage: `-m[fr] nnn'"
msgstr "-m-flaggans användning: \"-m[fr] nnn\""
-#: main.c:391
+#: main.c:393
msgid "empty argument to `-e/--source' ignored"
msgstr "tomt argument till \"-e/--source\" ignorerat"
-#: main.c:462
+#: main.c:483
#, c-format
msgid "%s: option `-W %s' unrecognized, ignored\n"
msgstr "%s: flaggan \"-W %s\" okänd, ignorerad\n"
-#: main.c:515
+#: main.c:529
#, c-format
msgid "%s: option requires an argument -- %c\n"
msgstr "%s: flaggan kräver ett argument -- %c\n"
-#: main.c:536
+#: main.c:550
msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
msgstr "miljövariabeln \"POSIXLY_CORRECT\" satt: slår på \"--posix\""
-#: main.c:542
+#: main.c:556
msgid "`--posix' overrides `--traditional'"
msgstr "\"--posix\" åsidosätter \"--traditional\""
-#: main.c:553
+#: main.c:567
msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
msgstr "\"--posix\"/\"--traditional\" åsidosätter \"--non-decimal-data\""
-#: main.c:557
+#: main.c:571
#, c-format
msgid "running %s setuid root may be a security problem"
msgstr "att köra %s setuid root kan vara ett säkerhetsproblem"
-#: main.c:562
+#: main.c:576
#, fuzzy
msgid "`--posix' overrides `--characters-as-bytes'"
msgstr "\"--posix\" åsidosätter \"--binary\""
-#: main.c:616
+#: main.c:635
#, c-format
msgid "can't set binary mode on stdin (%s)"
msgstr "kan inte sätta binärläge på standard in (%s)"
-#: main.c:619
+#: main.c:638
#, c-format
msgid "can't set binary mode on stdout (%s)"
msgstr "kan inte sätta binärläge på standard ut (%s)"
-#: main.c:621
+#: main.c:640
#, c-format
msgid "can't set binary mode on stderr (%s)"
msgstr "kan inte sätta binärläge på standard fel (%s)"
-#: main.c:660
+#: main.c:698
msgid "no program text at all!"
msgstr "ingen programtext alls!"
-#: main.c:737
+#: main.c:784
#, c-format
msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"
msgstr ""
"Användning: %s [POSIX- eller GNU-stilsflaggor] -f progfil [--] fil ...\n"
-#: main.c:739
+#: main.c:786
#, c-format
msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"
msgstr "Användning: %s [POSIX- eller GNU-stilsflaggor] %cprogram%c fil ...\n"
-#: main.c:744
+#: main.c:791
msgid "POSIX options:\t\tGNU long options: (standard)\n"
msgstr "POSIX-flaggor:\t\tGNU långa flaggor: (standard)\n"
-#: main.c:745
+#: main.c:792
msgid "\t-f progfile\t\t--file=progfile\n"
msgstr "\t-f progfil\t\t--file=progfil\n"
-#: main.c:746
+#: main.c:793
msgid "\t-F fs\t\t\t--field-separator=fs\n"
msgstr "\t-F fs\t\t\t--field-separator=fs\n"
-#: main.c:747
+#: main.c:794
msgid "\t-v var=val\t\t--assign=var=val\n"
msgstr "\t-v var=värde\t\t--assign=var=värde\n"
-#: main.c:748
+#: main.c:795
msgid "Short options:\t\tGNU long options: (extensions)\n"
msgstr "Korta flaggor:\t\tGNU långa flaggor: (utökningar)\n"
-#: main.c:749
+#: main.c:796
msgid "\t-b\t\t\t--characters-as-bytes\n"
msgstr "\t-b\t\t\t--characters-as-bytes\n"
-#: main.c:750
+#: main.c:797
msgid "\t-c\t\t\t--traditional\n"
msgstr "\t-c\t\t\t--traditional\n"
-#: main.c:751
+#: main.c:798
msgid "\t-C\t\t\t--copyright\n"
msgstr "\t-C\t\t\t--copyright\n"
-#: main.c:752
+#: main.c:799
msgid "\t-d[file]\t\t--dump-variables[=file]\n"
msgstr "\t-d[fil]\t\t\t--dump-variables[=fil]\n"
-#: main.c:753
+#: main.c:800
+#, fuzzy
+msgid "\t-D[file]\t\t--debug[=file]\n"
+msgstr "\t-p[fil]\t\t\t--profile[=fil]\n"
+
+#: main.c:801
msgid "\t-e 'program-text'\t--source='program-text'\n"
msgstr "\t-e 'programtext'\t--source='programtext'\n"
-#: main.c:754
+#: main.c:802
msgid "\t-E file\t\t\t--exec=file\n"
msgstr "\t-E fil\t\t\t--exec=fil\n"
-#: main.c:755
+#: main.c:803
msgid "\t-g\t\t\t--gen-pot\n"
msgstr "\t-g\t\t\t--gen-pot\n"
-#: main.c:756
+#: main.c:804
msgid "\t-h\t\t\t--help\n"
msgstr "\t-h\t\t\t--help\n"
-#: main.c:757
+#: main.c:805
+msgid "\t-i includefile\t\t--include=includefile\n"
+msgstr ""
+
+#: main.c:806
+msgid "\t-l library\t\t--load=library\n"
+msgstr ""
+
+#: main.c:807
msgid "\t-L [fatal]\t\t--lint[=fatal]\n"
msgstr "\t-L [fatal]\t\t--lint[=fatal]\n"
-#: main.c:758
+#: main.c:808
msgid "\t-n\t\t\t--non-decimal-data\n"
msgstr "\t-n\t\t\t--non-decimal-data\n"
-#: main.c:759
+#: main.c:809
+#, fuzzy
+msgid "\t-M\t\t\t--bignum\n"
+msgstr "\t-g\t\t\t--gen-pot\n"
+
+#: main.c:810
msgid "\t-N\t\t\t--use-lc-numeric\n"
msgstr "\t-N\t\t\t--use-lc-numeric\n"
-#: main.c:760
+#: main.c:811
+#, fuzzy
+msgid "\t-o[file]\t\t--pretty-print[=file]\n"
+msgstr "\t-p[fil]\t\t\t--profile[=fil]\n"
+
+#: main.c:812
msgid "\t-O\t\t\t--optimize\n"
msgstr "\t-O\t\t\t--optimize\n"
-#: main.c:761
+#: main.c:813
msgid "\t-p[file]\t\t--profile[=file]\n"
msgstr "\t-p[fil]\t\t\t--profile[=fil]\n"
-#: main.c:762
+#: main.c:814
msgid "\t-P\t\t\t--posix\n"
msgstr "\t-P\t\t\t--posix\n"
-#: main.c:763
+#: main.c:815
msgid "\t-r\t\t\t--re-interval\n"
msgstr "\t-r\t\t\t--re-interval\n"
-#: main.c:765
-msgid "\t-R file\t\t\t--command=file\n"
-msgstr "\t-R file\t\t\t--command=file\n"
-
-#: main.c:766
+#: main.c:816
msgid "\t-S\t\t\t--sandbox\n"
msgstr "\t-S\t\t\t--sandbox\n"
-#: main.c:767
+#: main.c:817
msgid "\t-t\t\t\t--lint-old\n"
msgstr "\t-t\t\t\t--lint-old\n"
-#: main.c:768
+#: main.c:818
msgid "\t-V\t\t\t--version\n"
msgstr "\t-V\t\t\t--version\n"
-#: main.c:770
+#: main.c:820
msgid "\t-W nostalgia\t\t--nostalgia\n"
msgstr "\t-W nostalgia\t\t--nostalgia\n"
-#: main.c:773
+#: main.c:823
msgid "\t-Y\t\t--parsedebug\n"
msgstr "\t-Y\t\t--parsedebug\n"
@@ -1807,7 +2946,7 @@ msgstr "\t-Y\t\t--parsedebug\n"
#. for this application. Please add _another line_ with the
#. address for translation bugs.
#. no-wrap
-#: main.c:782
+#: main.c:832
msgid ""
"\n"
"To report bugs, see node `Bugs' in `gawk.info', which is\n"
@@ -1821,7 +2960,7 @@ msgstr ""
"Rapportera synpunkter på översättningen till <tp-sv@listor.tp-sv.se>.\n"
"\n"
-#: main.c:786
+#: main.c:836
msgid ""
"gawk is a pattern scanning and processing language.\n"
"By default it reads standard input and writes standard output.\n"
@@ -1831,7 +2970,7 @@ msgstr ""
"Normalt läser det från standard in och skriver till standard ut.\n"
"\n"
-#: main.c:790
+#: main.c:840
msgid ""
"Examples:\n"
"\tgawk '{ sum += $1 }; END { print sum }' file\n"
@@ -1841,7 +2980,7 @@ msgstr ""
"\tgawk '{ sum += $1 }; END { print sum }' fil\n"
"\tgawk -F: '{ print $1 }' /etc/passwd\n"
-#: main.c:810
+#: main.c:860
#, c-format
msgid ""
"Copyright (C) 1989, 1991-%d Free Software Foundation.\n"
@@ -1860,7 +2999,7 @@ msgstr ""
"någon senare version.\n"
"\n"
-#: main.c:818
+#: main.c:868
msgid ""
"This program is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
@@ -1874,7 +3013,7 @@ msgstr ""
"General Public License för ytterligare information.\n"
"\n"
-#: main.c:824
+#: main.c:874
msgid ""
"You should have received a copy of the GNU General Public License\n"
"along with this program. If not, see http://www.gnu.org/licenses/.\n"
@@ -1882,95 +3021,161 @@ msgstr ""
"Du bör ha fått en kopia av GNU General Public License tillsammans\n"
"med detta program. Om inte, se http//www.gnu.org/liceences/.\n"
-#: main.c:859
+#: main.c:909
msgid "-Ft does not set FS to tab in POSIX awk"
msgstr "-Ft sätter inte FS till tab i POSIX-awk"
-#: main.c:1093
+#: main.c:1169
#, c-format
msgid "unknown value for field spec: %d\n"
msgstr "okänt värde till fältspecifikation: %d\n"
-#: main.c:1174
+#: main.c:1267
#, c-format
msgid ""
"%s: `%s' argument to `-v' not in `var=value' form\n"
"\n"
msgstr "%s: Argumentet \"%s\" till \"-v\" är inte på formatet \"var=värde\"\n"
-#: main.c:1200
+#: main.c:1293
#, c-format
msgid "`%s' is not a legal variable name"
msgstr "\"%s\" är inte ett giltigt variabelnamn"
-#: main.c:1203
+#: main.c:1296
#, c-format
msgid "`%s' is not a variable name, looking for file `%s=%s'"
msgstr "\"%s\" är inte ett variabelnamn, letar efter filen \"%s=%s\""
-#: main.c:1207
+#: main.c:1300
#, c-format
msgid "cannot use gawk builtin `%s' as variable name"
msgstr "kan inte använda gawks inbyggda \"%s\" som ett funktionsnamn"
-#: main.c:1212
+#: main.c:1305
#, c-format
msgid "cannot use function `%s' as variable name"
msgstr "kan inte använda funktionen \"%s\" som variabelnamn"
-#: main.c:1265
+#: main.c:1358
msgid "floating point exception"
msgstr "flyttalsundantag"
-#: main.c:1272
+#: main.c:1365
msgid "fatal error: internal error"
msgstr "ödesdigert fel: internt fel"
-#: main.c:1287
+#: main.c:1380
msgid "fatal error: internal error: segfault"
msgstr "ödesdigert fel: internt fel: segmenteringsfel"
-#: main.c:1299
+#: main.c:1392
msgid "fatal error: internal error: stack overflow"
msgstr "ödesdigert fel: internt fel: stackspill"
-#: main.c:1349
+#: main.c:1448
#, c-format
msgid "no pre-opened fd %d"
msgstr "ingen föröppnad fd %d"
-#: main.c:1356
+#: main.c:1455
#, c-format
msgid "could not pre-open /dev/null for fd %d"
msgstr "kunde inte föröppna /dev/null för fd %d"
-#: msg.c:63
+#: mpfr.c:563
+#, fuzzy, c-format
+msgid "PREC value `%.*s' is invalid"
+msgstr "BINMODE-värde \"%s\" är ogiltigt, behandlas som 3"
+
+#: mpfr.c:621
+#, fuzzy, c-format
+msgid "RNDMODE value `%.*s' is invalid"
+msgstr "BINMODE-värde \"%s\" är ogiltigt, behandlas som 3"
+
+#: mpfr.c:711
+#, fuzzy, c-format
+msgid "%s: received non-numeric argument"
+msgstr "cos: fick ett ickenumeriskt argument"
+
+#: mpfr.c:813
+#, fuzzy
+msgid "compl(%Rg): negative value will give strange results"
+msgstr "compl(%lf): negativa värden kommer ge konstiga resultat"
+
+#: mpfr.c:817
+#, fuzzy
+msgid "comp(%Rg): fractional value will be truncated"
+msgstr "compl(%lf): flyttalsvärden kommer trunkeras"
+
+#: mpfr.c:829
+#, fuzzy, c-format
+msgid "cmpl(%Zd): negative values will give strange results"
+msgstr "compl(%lf): negativa värden kommer ge konstiga resultat"
+
+#: mpfr.c:856
+#, fuzzy, c-format
+msgid "%s: received non-numeric first argument"
+msgstr "or: fick ett ickenumeriskt första argument"
+
+#: mpfr.c:858
+#, fuzzy, c-format
+msgid "%s: received non-numeric second argument"
+msgstr "or: fick ett ickenumeriskt andra argument"
+
+#: mpfr.c:877
+#, fuzzy
+msgid "%s(%Rg, ..): negative values will give strange results"
+msgstr "or(%lf, %lf): negativa värden kommer ge konstiga resultat"
+
+#: mpfr.c:882
+#, fuzzy
+msgid "%s(%Rg, ..): fractional values will be truncated"
+msgstr "or(%lf, %lf): flyttalsvärden kommer trunkeras"
+
+#: mpfr.c:895
+#, fuzzy, c-format
+msgid "%s(%Zd, ..): negative values will give strange results"
+msgstr "or(%lf, %lf): negativa värden kommer ge konstiga resultat"
+
+#: mpfr.c:914
+#, fuzzy
+msgid "%s(.., %Rg): negative values will give strange results"
+msgstr "or(%lf, %lf): negativa värden kommer ge konstiga resultat"
+
+#: mpfr.c:919
+#, fuzzy
+msgid "%s(.., %Rg): fractional values will be truncated"
+msgstr "or(%lf, %lf): flyttalsvärden kommer trunkeras"
+
+#: mpfr.c:932
+#, fuzzy, c-format
+msgid "%s(.., %Zd): negative values will give strange results"
+msgstr "or(%lf, %lf): negativa värden kommer ge konstiga resultat"
+
+#: msg.c:61
#, c-format
msgid "cmd. line:"
msgstr "kommandorad:"
-#: msg.c:107
-msgid "error: "
-msgstr "fel: "
-
-#: node.c:406
+#: node.c:436
msgid "backslash at end of string"
msgstr "omvänt snedstreck i slutet av strängen"
-#: node.c:517
+#: node.c:520
#, c-format
msgid "old awk does not support the `\\%c' escape sequence"
msgstr "gamla awk stöder inte kontrollsekvensen \"\\%c\""
-#: node.c:568
+#: node.c:571
msgid "POSIX does not allow `\\x' escapes"
msgstr "POSIX tillåter inte \"\\x\"-kontrollsekvenser"
-#: node.c:574
+#: node.c:577
msgid "no hex digits in `\\x' escape sequence"
msgstr "inga hexadecimala siffror i \"\\x\"-kontrollsekvenser"
-#: node.c:596
+#: node.c:599
#, c-format
msgid ""
"hex escape \\x%.*s of %d characters probably not interpreted the way you "
@@ -1979,12 +3184,12 @@ msgstr ""
"hexkod \\x%.*s med %d tecken tolkas förmodligen inte på det sätt du "
"förväntar dig"
-#: node.c:611
+#: node.c:614
#, c-format
msgid "escape sequence `\\%c' treated as plain `%c'"
msgstr "kontrollsekvensen \"\\%c\" behandlad som bara \"%c\""
-#: node.c:750
+#: node.c:759
msgid ""
"Invalid multibyte data detected. There may be a mismatch between your data "
"and your locale."
@@ -1992,26 +3197,26 @@ msgstr ""
"Ogiltig multibytedata upptäckt. Dina data och din lokal stämmer kanske inte "
"överens."
-#: posix/gawkmisc.c:176
+#: posix/gawkmisc.c:177
#, c-format
msgid "%s %s `%s': could not get fd flags: (fcntl F_GETFD: %s)"
msgstr "%s %s \"%s\": kunde inte hämta fb-flaggor: (fcntl F_GETFD: %s)"
-#: posix/gawkmisc.c:188
+#: posix/gawkmisc.c:189
#, c-format
msgid "%s %s `%s': could not set close-on-exec: (fcntl F_SETFD: %s)"
msgstr "%s %s \"%s\": kunde inte sätta stäng-vid-exec (fcntl F_SETFD: %s)"
-#: profile.c:83
+#: profile.c:70
#, c-format
msgid "could not open `%s' for writing: %s"
msgstr "kunde inte öppna \"%s\" för skrivning: %s"
-#: profile.c:85
+#: profile.c:72
msgid "sending profile to standard error"
msgstr "skickar profilen till standard fel"
-#: profile.c:203
+#: profile.c:188
#, c-format
msgid ""
"\t# %s block(s)\n"
@@ -2020,7 +3225,7 @@ msgstr ""
"\t# %s-block\n"
"\n"
-#: profile.c:208
+#: profile.c:193
#, c-format
msgid ""
"\t# Rule(s)\n"
@@ -2029,17 +3234,22 @@ msgstr ""
"\t# Regel/regler\n"
"\n"
-#: profile.c:279
+#: profile.c:267
#, c-format
msgid "internal error: %s with null vname"
msgstr "internt fel: %s med null vname"
-#: profile.c:952
+#: profile.c:529
+#, fuzzy
+msgid "internal error: builtin with null fname"
+msgstr "internt fel: %s med null vname"
+
+#: profile.c:944
#, c-format
msgid "\t# gawk profile, created %s\n"
msgstr "\t# gawkprofil, skapad %s\n"
-#: profile.c:1331
+#: profile.c:1329
#, c-format
msgid ""
"\n"
@@ -2048,17 +3258,17 @@ msgstr ""
"\n"
"\t# Funktioner, listade alfabetiskt\n"
-#: profile.c:1370
+#: profile.c:1367
#, c-format
msgid "redir2str: unknown redirection type %d"
msgstr "redir2str: okänd omdirigeringstyp %d"
-#: re.c:573
+#: re.c:568
#, c-format
msgid "range of the form `[%c-%c]' is locale dependent"
msgstr "intervall på formen \"[%c-%c]\" är lokalberoende"
-#: re.c:600
+#: re.c:595
#, c-format
msgid "regexp component `%.*s' should probably be `[%.*s]'"
msgstr ""
@@ -2104,10 +3314,6 @@ msgstr "Obalanserad ( eller \\("
msgid "Unmatched \\{"
msgstr "Obalanserad \\{"
-#: regcomp.c:161
-msgid "Invalid content of \\{\\}"
-msgstr "Ogiltigt innehåll i \\{\\}"
-
#: regcomp.c:164
msgid "Invalid range end"
msgstr "Ogiltigt omfångsslut"
@@ -2124,10 +3330,6 @@ msgstr "Ogiltigt föregående reguljärt uttryck"
msgid "Premature end of regular expression"
msgstr "För tidigt slut på reguljärt uttryck"
-#: regcomp.c:176
-msgid "Regular expression too big"
-msgstr "Reguljärt uttryck för stort"
-
#: regcomp.c:179
msgid "Unmatched ) or \\)"
msgstr "Obalanserad ) eller \\)"
@@ -2136,11 +3338,99 @@ msgstr "Obalanserad ) eller \\)"
msgid "No previous regular expression"
msgstr "Inget föregående reguljärt uttryck"
+#: symbol.c:722
+msgid "can not pop main context"
+msgstr ""
+
#~ msgid "`nextfile' is a gawk extension"
#~ msgstr "\"nextfile\" är en gawk-utökning"
#~ msgid "`delete array' is a gawk extension"
#~ msgstr "\"delete array\" är en gawk-utökning"
+#~ msgid "and: received non-numeric first argument"
+#~ msgstr "and: fick ett ickenumeriskt första argument"
+
+#~ msgid "and: received non-numeric second argument"
+#~ msgstr "and: fick ett ickenumeriskt andra argument"
+
+#~ msgid "and(%lf, %lf): fractional values will be truncated"
+#~ msgstr "and(%lf, %lf): flyttalsvärden kommer trunkeras"
+
+#~ msgid "xor: received non-numeric first argument"
+#~ msgstr "xor: fick ett ickenumeriskt första argument"
+
+#~ msgid "xor: received non-numeric second argument"
+#~ msgstr "xor: fick ett ickenumeriskt andra argument"
+
+#~ msgid "xor(%lf, %lf): fractional values will be truncated"
+#~ msgstr "xor(%lf, %lf): flyttalsvärden kommer trunkeras"
+
+#~ msgid "`extension' is a gawk extension"
+#~ msgstr "\"extension\" är en gawk-utökning"
+
+#~ msgid "Operation Not Supported"
+#~ msgstr "Operationen stöds inte"
+
+#~ msgid "attempt to use function `%s' as an array"
+#~ msgstr "försök att använda funktionen \"%s\" som vektor"
+
+#~ msgid "reference to uninitialized element `%s[\"%.*s\"]'"
+#~ msgstr "referens till oinitierat element \"%s[\"%.*s\"]\""
+
+#~ msgid "subscript of array `%s' is null string"
+#~ msgstr "index i vektorn \"%s\" är en tom sträng"
+
+#~ msgid "%s: empty (null)\n"
+#~ msgstr "%s: tom (null)\n"
+
+#~ msgid "%s: empty (zero)\n"
+#~ msgstr "%s: tom (noll)\n"
+
+#~ msgid "%s: table_size = %d, array_size = %d\n"
+#~ msgstr "%s: tabellstorlek = %d, vektorstorlek = %d\n"
+
+#~ msgid "%s: array_ref to %s\n"
+#~ msgstr "%s: vektorreferens till %s\n"
+
+#~ msgid "use of non-array as array"
+#~ msgstr "icke-vektor används som vektor"
+
+#~ msgid "can't use function name `%s' as variable or array"
+#~ msgstr "kan inte använda funktionsnamnet \"%s\" som variabel eller vektor"
+
+#~ msgid "assignment used in conditional context"
+#~ msgstr "tilldelning använt i jämförelsesammanhang"
+
+#~ msgid "statement has no effect"
+#~ msgstr "kommandot har ingen effekt"
+
+#~ msgid ""
+#~ "for loop: array `%s' changed size from %ld to %ld during loop execution"
+#~ msgstr ""
+#~ "forslinga: vektorn \"%s\" ändrade storlek från %ld till %ld under "
+#~ "slingexekvering"
+
+#~ msgid "function called indirectly through `%s' does not exist"
+#~ msgstr "funktionen anropad indirekt genom \"%s\" finns inte"
+
+#~ msgid "function `%s' not defined"
+#~ msgstr "funktionen \"%s\" är inte definierad"
+
+#~ msgid "non-redirected `getline' invalid inside `%s' rule"
+#~ msgstr "icke omdirigerad \"getline\" odefinierad inuti \"%s\"-regel"
+
+#~ msgid "`nextfile' cannot be called from a `%s' rule"
+#~ msgstr "\"nextfile\" kan inte anropas från en \"%s\"-regel"
+
+#~ msgid "`next' cannot be called from a `%s' rule"
+#~ msgstr "\"next\" kan inte anropas från en \"%s\"-regel"
+
+#~ msgid "Sorry, don't know how to interpret `%s'"
+#~ msgstr "Tyvärr, vet inte hur \"%s\" skall tolkas"
+
+#~ msgid "\t-R file\t\t\t--command=file\n"
+#~ msgstr "\t-R file\t\t\t--command=file\n"
+
#~ msgid "could not find groups: %s"
#~ msgstr "kunde inte hitta grupper: %s"
diff --git a/po/tr.gmo b/po/tr.gmo
deleted file mode 100644
index 146da41d..00000000
--- a/po/tr.gmo
+++ /dev/null
Binary files differ
diff --git a/po/vi.gmo b/po/vi.gmo
index e83a5a1b..7dc43c45 100644
--- a/po/vi.gmo
+++ b/po/vi.gmo
Binary files differ
diff --git a/po/vi.po b/po/vi.po
index 834caf0a..da28f71e 100644
--- a/po/vi.po
+++ b/po/vi.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gawk-4.0.0h\n"
"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
-"POT-Creation-Date: 2012-10-13 20:24+0200\n"
+"POT-Creation-Date: 2012-10-13 21:21+0200\n"
"PO-Revision-Date: 2012-04-04 08:01+0700\n"
"Last-Translator: Trần Ngá»c Quân <vnwildman@gmail.com>\n"
"Language-Team: Vietnamese <vi-VN@googlegroups.com>\n"
@@ -22,513 +22,504 @@ msgstr ""
"X-Poedit-Country: VIET NAM\n"
"X-Poedit-SourceCharset: utf-8\n"
-#: array.c:140
+#: array.c:266
#, c-format
msgid "from %s"
msgstr "từ %s"
-#: array.c:248
+#: array.c:366
msgid "attempt to use a scalar value as array"
msgstr "cố sử dụng giá trị vô hướng như là một mảng"
-#: array.c:251
-#, c-format
-msgid "attempt to use function `%s' as an array"
-msgstr "cố gắng dùng hàm « %s » như mảng"
-
-#: array.c:254
+#: array.c:368
#, c-format
msgid "attempt to use scalar parameter `%s' as an array"
msgstr "cố gắng dùng tham số vô hướng « %s » như là mảng"
-#: array.c:257
+#: array.c:371
#, c-format
msgid "attempt to use scalar `%s' as an array"
msgstr "cố dùng «%s» vô hướng như là mảng"
-#: array.c:302 array.c:707 builtin.c:84 builtin.c:1385 builtin.c:1427
-#: builtin.c:1440 builtin.c:1859 builtin.c:1871 eval.c:1135 eval.c:1139
-#: eval.c:1495 eval.c:1812
+#: array.c:418 array.c:584 builtin.c:85 builtin.c:1566 builtin.c:1608
+#: builtin.c:1621 builtin.c:2047 builtin.c:2059 eval.c:1121 eval.c:1125
+#: eval.c:1520
#, c-format
msgid "attempt to use array `%s' in a scalar context"
msgstr "cố gắng dùng mảng « %s » trong một ngữ cảnh vô hướng"
-#: array.c:513
-#, c-format
-msgid "reference to uninitialized element `%s[\"%.*s\"]'"
-msgstr "tham chiếu đến phần tử chưa sở khởi « %s[\"%.*s\"] »"
-
-#: array.c:519
-#, c-format
-msgid "subscript of array `%s' is null string"
-msgstr "chữ in dưới mảng « %s » là chuỗi rỗng"
-
-#: array.c:723
+#: array.c:591
#, c-format
msgid "delete: index `%s' not in array `%s'"
msgstr "delete: (xoá) số mũ « %s » không phải nằm trong mảng « %s »"
-#: array.c:734 eval.c:1865
+#: array.c:605
#, c-format
msgid "attempt to use scalar `%s[\"%.*s\"]' as an array"
msgstr "cố dùng «%s[\"%.*s\"]» vô hướng như là mảng"
-#: array.c:910
-#, c-format
-msgid "%s: empty (null)\n"
-msgstr "%s: rỗng (vô giá trị)\n"
-
-#: array.c:915
-#, c-format
-msgid "%s: empty (zero)\n"
-msgstr "%s: rỗng (số không)\n"
-
-#: array.c:919
-#, c-format
-msgid "%s: table_size = %d, array_size = %d\n"
-msgstr "%s: cỡ_bảng = %d, cỡ_mảng = %d\n"
-
-#: array.c:954
-#, c-format
-msgid "%s: is parameter\n"
-msgstr "%s: là tham số\n"
-
-#: array.c:958
-#, c-format
-msgid "%s: array_ref to %s\n"
-msgstr "%s: « array_ref » (mảng tham chiếu) đến « %s »\n"
-
-#: array.c:963
-msgid "adump: argument not an array"
+#: array.c:784
+#, fuzzy
+msgid "adump: first argument not an array"
msgstr "adump: đối số không phải là một mảng"
-#: array.c:1086
+#: array.c:823
msgid "asort: second argument not an array"
msgstr "asort: đối số thứ hai không phải là một mảng"
-#: array.c:1087
+#: array.c:824
msgid "asorti: second argument not an array"
msgstr "asorti: đối số thứ hai không phải là một mảng"
-#: array.c:1094
+#: array.c:831
msgid "asort: first argument not an array"
msgstr "asort: đối số thứ nhất không phải là một mảng"
-#: array.c:1095
+#: array.c:832
msgid "asorti: first argument not an array"
msgstr "asorti: đối số thứ nhất không phải là một mảng"
-#: array.c:1102
+#: array.c:839
msgid "asort: cannot use a subarray of first arg for second arg"
msgstr ""
"asort (một chương trính xắp xếp thứ tự): không thể sử dụng mảng con của tham "
"số thứ nhất cho tham số thứ hai"
-#: array.c:1103
+#: array.c:840
msgid "asorti: cannot use a subarray of first arg for second arg"
msgstr ""
"asorti (một chương trính xắp xếp thứ tự): không thể sử dụng mảng con của "
"tham số thứ nhất cho tham số thứ hai"
-#: array.c:1108
+#: array.c:845
msgid "asort: cannot use a subarray of second arg for first arg"
msgstr ""
"asort (một chương trính xắp xếp thứ tự): không thể sử dụng mảng con của tham "
"số thứ hai cho tham số thứ nhất"
-#: array.c:1109
+#: array.c:846
msgid "asorti: cannot use a subarray of second arg for first arg"
msgstr ""
"asorti (một chương trính xắp xếp thứ tự): không thể sử dụng mảng con của "
"tham số thứ hai cho tham số thứ nhất"
-#: array.c:1655
+#: array.c:1314
#, c-format
msgid "`%s' is invalid as a function name"
msgstr "`%s' không phải là tên hàm hợp lệ"
-#: array.c:1659
+#: array.c:1318
#, c-format
msgid "sort comparison function `%s' is not defined"
msgstr "chưa định nghĩa hàm so sánh xắp xếp « %s »"
-#: awkgram.y:249
+#: awkgram.y:223
#, c-format
msgid "%s blocks must have an action part"
msgstr "Má»i khối %s phải có má»™t phần kiểu hành Ä‘á»™ng"
-#: awkgram.y:252
+#: awkgram.y:226
msgid "each rule must have a pattern or an action part"
msgstr "Má»i quy tắc phải có má»™t mẫu hay phần kiểu hành Ä‘á»™ng"
-#: awkgram.y:323 awkgram.y:334
+#: awkgram.y:315 awkgram.y:326
msgid "old awk does not support multiple `BEGIN' or `END' rules"
msgstr ""
"awk cÅ© không há»— trợ nhiá»u quy tắc kiểu « BEGIN » (bắt đầu) hay « END » (kết "
"thúc)"
-#: awkgram.y:371
+#: awkgram.y:363
#, c-format
msgid "`%s' is a built-in function, it cannot be redefined"
msgstr "« %s » là một hàm có sẵn nên nó không thể được định nghĩa lái."
-#: awkgram.y:432
+#: awkgram.y:409
msgid "regexp constant `//' looks like a C++ comment, but is not"
msgstr ""
"hằng biểu thức chính quy « // » hình như một chú thích C, nhưng mà không phải"
-#: awkgram.y:436
+#: awkgram.y:413
#, c-format
msgid "regexp constant `/%s/' looks like a C comment, but is not"
msgstr ""
"hằng biểu thức chính quy « /%s/ » hình như một chú thích C, nhưng mà không "
"phải"
-#: awkgram.y:528
+#: awkgram.y:505
#, c-format
msgid "duplicate case values in switch body: %s"
msgstr "gặp giá trị case trùng trong thân chuyển đổi (switch body): %s"
-#: awkgram.y:549
+#: awkgram.y:526
msgid "duplicate `default' detected in switch body"
msgstr ""
"đã phát hiện trùng `default' trong thân cấu trúc Ä‘iá»u khiển chá»n lá»±a (switch)"
-#: awkgram.y:809
+#: awkgram.y:786
msgid "`break' is not allowed outside a loop or switch"
msgstr ""
"không cho phép « break » (ngắt) nằm ở ngoại vòng lặp hay cấu trúc chá»n lá»±a"
-#: awkgram.y:818
+#: awkgram.y:795
msgid "`continue' is not allowed outside a loop"
msgstr "không cho phép «continue» (tiếp tục) ở ngoài một vòng lặp"
-#: awkgram.y:828
+#: awkgram.y:805
#, c-format
msgid "`next' used in %s action"
msgstr "« next » (kế tiếp) được dùng trong hành động %s"
-#: awkgram.y:837
+#: awkgram.y:814
#, c-format
msgid "`nextfile' used in %s action"
msgstr "« nextfile » (tệp tin kế tiếp) được dùng trong hành động %s"
-#: awkgram.y:861
+#: awkgram.y:838
msgid "`return' used outside function context"
msgstr "« return » (trở vá») được dùng ở ngoại ngữ cảnh hàm"
-#: awkgram.y:921
+#: awkgram.y:912
msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'"
msgstr ""
"« print » (in) thÆ°á»ng trong quy tắc « BEGIN » (bắt đầu) hay « END » (kết "
"thúc) hầu như chắc chắn nên là « print\"\" »"
-#: awkgram.y:1016 awkgram.y:1020
+#: awkgram.y:978 awkgram.y:1027
+msgid "`delete' is not allowed with SYMTAB"
+msgstr ""
+
+#: awkgram.y:980 awkgram.y:1029
+msgid "`delete' is not allowed with FUNCTAB"
+msgstr ""
+
+#: awkgram.y:1014 awkgram.y:1018
msgid "`delete(array)' is a non-portable tawk extension"
msgstr "« delete array » (xoá mảng) là phần mở rộng gawk không khả chuyển"
-#: awkgram.y:1132
+#: awkgram.y:1139
msgid "multistage two-way pipelines don't work"
msgstr "Ä‘Æ°á»ng ống dẫn hai chiếu Ä‘a giai Ä‘oạn không phải hoạt Ä‘á»™ng được"
-#: awkgram.y:1235
+#: awkgram.y:1242
msgid "regular expression on right of assignment"
msgstr "biểu thức chính quy nằm bên phải Ä‘iá»u gán"
-#: awkgram.y:1246
+#: awkgram.y:1253
msgid "regular expression on left of `~' or `!~' operator"
msgstr "biểu thức chính quy nằm bên trái toán tử « ~ » hay « !~ »"
-#: awkgram.y:1262 awkgram.y:1416
+#: awkgram.y:1269 awkgram.y:1420
msgid "old awk does not support the keyword `in' except after `for'"
msgstr "awk cũ không hỗ trợ từ khoá « in », trừ khi nằm sau « for »"
-#: awkgram.y:1272
+#: awkgram.y:1279
msgid "regular expression on right of comparison"
msgstr "biểu thức chính quy nằm bên phải sự so sánh"
-#: awkgram.y:1391
+#: awkgram.y:1395
#, c-format
msgid "`getline var' invalid inside `%s' rule"
msgstr "`getline var' không hợp lệ bên trong quy tắc `%s'"
-#: awkgram.y:1394 eval.c:2504
+#: awkgram.y:1398
#, c-format
msgid "`getline' invalid inside `%s' rule"
msgstr "`getline' không hợp lệ trong quy tắc `%s'"
-#: awkgram.y:1399
+#: awkgram.y:1403
msgid "non-redirected `getline' undefined inside END action"
msgstr ""
"trong hành động « END » (kết thúc) có « getline » (lấy dòng) không được "
"chuyển hướng lại và chưa được xác định."
-#: awkgram.y:1418
+#: awkgram.y:1422
msgid "old awk does not support multidimensional arrays"
msgstr "awk cÅ© không há»— trợ mảng Ä‘a chiá»u"
-#: awkgram.y:1514
+#: awkgram.y:1519
msgid "call of `length' without parentheses is not portable"
msgstr "không thể mang lá»i gá»i « length » (Ä‘á»™ dài) không có dấu ngoặc"
-#: awkgram.y:1577
+#: awkgram.y:1585
msgid "indirect function calls are a gawk extension"
msgstr "cuá»™c gá»i hàm gián tiếp là má»™t phần mở rá»™ng gawk"
-#: awkgram.y:1590
+#: awkgram.y:1598
#, c-format
msgid "can not use special variable `%s' for indirect function call"
msgstr "không thể dùng biến đặc biệt « %s » cho cú gá»i hàm gián tiếp"
-#: awkgram.y:1668
+#: awkgram.y:1676
msgid "invalid subscript expression"
msgstr "biểu thức in thấp không hợp lệ"
-#: awkgram.y:1708
-msgid "use of non-array as array"
-msgstr "việc dùng cái khác mảng như là mảng"
-
-#: awkgram.y:1972 awkgram.y:1992 msg.c:98
+#: awkgram.y:2000 awkgram.y:2020 gawkapi.c:203 gawkapi.c:221 msg.c:119
msgid "warning: "
msgstr "cảnh báo : "
-#: awkgram.y:1990 msg.c:130
+#: awkgram.y:2018 gawkapi.c:189 gawkapi.c:218 msg.c:151
msgid "fatal: "
msgstr "nghiêm trá»ng: "
-#: awkgram.y:2040
+#: awkgram.y:2068
msgid "unexpected newline or end of string"
msgstr "gặp dòng mới bất ngỠhay kết thúc của chuỗi"
-#: awkgram.y:2297 awkgram.y:2355 awkgram.y:2539
+#: awkgram.y:2335 awkgram.y:2411 awkgram.y:2634 debug.c:517 debug.c:533
+#: debug.c:2790 debug.c:5038
#, c-format
msgid "can't open source file `%s' for reading (%s)"
msgstr "không thể mở tập tin nguồn « %s » để Ä‘á»c (%s)"
-#: awkgram.y:2298 awkgram.y:2356 builtin.c:122
+#: awkgram.y:2336 awkgram.y:2461
+#, fuzzy, c-format
+msgid "can't open shared library `%s' for reading (%s)"
+msgstr "không thể mở tập tin nguồn « %s » để Ä‘á»c (%s)"
+
+#: awkgram.y:2338 awkgram.y:2412 awkgram.y:2462 builtin.c:130 debug.c:5189
msgid "reason unknown"
msgstr "không biết sao"
-#: awkgram.y:2314
+#: awkgram.y:2347 awkgram.y:2371
+#, c-format
+msgid "can't include `%s' and use it as a program file"
+msgstr ""
+
+#: awkgram.y:2360
#, c-format
msgid "already included source file `%s'"
msgstr "đã sẵn bao gồm tập tin nguồn `%s'"
-#: awkgram.y:2340
+#: awkgram.y:2361
+#, fuzzy, c-format
+msgid "already loaded shared library `%s'"
+msgstr "đã sẵn bao gồm tập tin nguồn `%s'"
+
+#: awkgram.y:2396
msgid "@include is a gawk extension"
msgstr "@include là phần mở rộng của gawk"
-#: awkgram.y:2346
+#: awkgram.y:2402
msgid "empty filename after @include"
msgstr "tệp tin rống sau @include"
-#: awkgram.y:2491
+#: awkgram.y:2446
+#, fuzzy
+msgid "@load is a gawk extension"
+msgstr "@include là phần mở rộng của gawk"
+
+#: awkgram.y:2452
+#, fuzzy
+msgid "empty filename after @load"
+msgstr "tệp tin rống sau @include"
+
+#: awkgram.y:2586
msgid "empty program text on command line"
msgstr "gặp đoạn chữ chương trình rỗng nằm trên dòng lệnh"
-#: awkgram.y:2606
+#: awkgram.y:2701
#, c-format
msgid "can't read sourcefile `%s' (%s)"
msgstr "không thể Ä‘á»c tập tin nguồn « %s » (%s)"
-#: awkgram.y:2617
+#: awkgram.y:2712
#, c-format
msgid "source file `%s' is empty"
msgstr "tập tin nguồn « %s » là rỗng"
-#: awkgram.y:2794
+#: awkgram.y:2889
msgid "source file does not end in newline"
msgstr "tập tin nguồn không kết thúc với một dòng mới"
-#: awkgram.y:2897
+#: awkgram.y:2994
msgid "unterminated regexp ends with `\\' at end of file"
msgstr ""
"biểu thức chính quy chưa được chấm dứt kết thúc với « \\ » tại kết thúc của "
"tập tin"
-#: awkgram.y:2921
+#: awkgram.y:3018
#, c-format
msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk"
msgstr ""
"%s: %d: bộ sửa đổi biểu thức chính quy tawk « /.../%c » không hoạt động được "
"trong gawk"
-#: awkgram.y:2925
+#: awkgram.y:3022
#, c-format
msgid "tawk regex modifier `/.../%c' doesn't work in gawk"
msgstr ""
"bộ sửa đổi biểu thức chính quy tawk « /.../%c » không hoạt động được trong "
"gawk"
-#: awkgram.y:2932
+#: awkgram.y:3029
msgid "unterminated regexp"
msgstr "biểu thức chính quy chưa được chấm dứt"
-#: awkgram.y:2936
+#: awkgram.y:3033
msgid "unterminated regexp at end of file"
msgstr "biểu thức chính quy chưa được chấm dứt nằm tại kết thúc của tập tin"
-#: awkgram.y:2995
+#: awkgram.y:3092
msgid "use of `\\ #...' line continuation is not portable"
msgstr "không thể mang khả năng dùng « \\#... » để tiếp tục dòng"
-#: awkgram.y:3011
+#: awkgram.y:3108
msgid "backslash not last character on line"
msgstr "xuyệc ngược không phải là ký tự cuối cùng nằm trên dòng"
-#: awkgram.y:3072
+#: awkgram.y:3169
msgid "POSIX does not allow operator `**='"
msgstr "POSIX không cho phép toán tử « **= »"
-#: awkgram.y:3074
+#: awkgram.y:3171
msgid "old awk does not support operator `**='"
msgstr "awk cũ không hỗ trợ toán tử « **= »"
-#: awkgram.y:3083
+#: awkgram.y:3180
msgid "POSIX does not allow operator `**'"
msgstr "POSIX không cho phép toán tử « ** »"
-#: awkgram.y:3085
+#: awkgram.y:3182
msgid "old awk does not support operator `**'"
msgstr "awk cũ không hỗ trợ toán tử « ** »"
-#: awkgram.y:3120
+#: awkgram.y:3217
msgid "operator `^=' is not supported in old awk"
msgstr "awk cũ không hỗ trợ toán tử « ^= »"
-#: awkgram.y:3128
+#: awkgram.y:3225
msgid "operator `^' is not supported in old awk"
msgstr "awk cũ không hỗ trợ toán tử « ^ »"
-#: awkgram.y:3221 awkgram.y:3237
+#: awkgram.y:3318 awkgram.y:3334 command.y:1178
msgid "unterminated string"
msgstr "chuỗi không được chấm dứt"
-#: awkgram.y:3433
+#: awkgram.y:3555
#, c-format
msgid "invalid char '%c' in expression"
msgstr "biểu thức một ký tự không hợp lệ « %c » nằm trong biểu thức"
-#: awkgram.y:3480
+#: awkgram.y:3602
#, c-format
msgid "`%s' is a gawk extension"
msgstr "« %s » là một phần mở rộng gawk"
-#: awkgram.y:3485
+#: awkgram.y:3607
#, c-format
msgid "`%s' is a Bell Labs extension"
msgstr "« %s » là một phần mở rộng của Bell Labs (Phòng thí nghiệm Bell)"
-#: awkgram.y:3490
+#: awkgram.y:3612
#, c-format
msgid "POSIX does not allow `%s'"
msgstr "POSIX không cho phép « %s »"
-#: awkgram.y:3498
+#: awkgram.y:3620
#, c-format
msgid "`%s' is not supported in old awk"
msgstr "awk kiểu cũ không hỗ trợ « %s »"
-#: awkgram.y:3565
+#: awkgram.y:3688
msgid "`goto' considered harmful!\n"
msgstr "« goto » được xem là gây tai hại!\n"
-#: awkgram.y:3616
+#: awkgram.y:3722
#, c-format
msgid "%d is invalid as number of arguments for %s"
msgstr "« %d » không hợp lệ khi là số đối số cho « %s »"
-#: awkgram.y:3651
+#: awkgram.y:3757
#, c-format
msgid "%s: string literal as last arg of substitute has no effect"
msgstr ""
"%s: khi đối số cuối cùng của sự thay thế, hằng mã nguồn chuỗi không có tác "
"dụng"
-#: awkgram.y:3656
+#: awkgram.y:3762
#, c-format
msgid "%s third parameter is not a changeable object"
msgstr "tham số thứ ba %s không phải là một đối tượng có thể thay đổi"
-#: awkgram.y:3729 awkgram.y:3732
+#: awkgram.y:3841 awkgram.y:3844
msgid "match: third argument is a gawk extension"
msgstr "match: (khớp) đối số thứ ba là phần mở rộng gawk"
-#: awkgram.y:3786 awkgram.y:3789
+#: awkgram.y:3898 awkgram.y:3901
msgid "close: second argument is a gawk extension"
msgstr "close: (đóng) đối số thứ hai là phần mở rộng gawk"
-#: awkgram.y:3801
+#: awkgram.y:3913
msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
msgstr "dùng « dcgettext(_\"...\") » không đúng: hãy gỡ bỠgạch dưới nằm trước"
-#: awkgram.y:3816
+#: awkgram.y:3928
msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
msgstr "dùng « dcgettext(_\"...\") » không đúng: hãy gỡ bỠgạch dưới nằm trước"
-#: awkgram.y:3908
-#, c-format
-msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
-msgstr "hàm « %s »: tham số « #%d », « %s », nhân đôi tham số « #%d »"
-
-#: awkgram.y:3950
+#: awkgram.y:3994
#, c-format
msgid "function `%s': parameter `%s' shadows global variable"
msgstr "hàm « %s »: tham số « %s » che biến toàn cục"
-#: awkgram.y:4108
+#: awkgram.y:4051 debug.c:4019 debug.c:4062 debug.c:5187
#, c-format
msgid "could not open `%s' for writing (%s)"
msgstr "không mở được « %s » để ghi (%s)"
-#: awkgram.y:4109
+#: awkgram.y:4052
msgid "sending variable list to standard error"
msgstr "đang gởi danh sách biến tới thiết bị lỗi chuẩn"
-#: awkgram.y:4115
+#: awkgram.y:4060
#, c-format
msgid "%s: close failed (%s)"
msgstr "%s: lỗi đóng (%s)"
-#: awkgram.y:4167
+#: awkgram.y:4085
msgid "shadow_funcs() called twice!"
msgstr "shadow_funcs() (hàm bóng) được gá»i hai lần !"
-#: awkgram.y:4173
+#: awkgram.y:4093
msgid "there were shadowed variables."
msgstr "có biến bị bóng."
-#: awkgram.y:4203
+#: awkgram.y:4164
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "tên hàm « %s » trước đây đã được định nghĩa rồi"
+
+#: awkgram.y:4210
#, c-format
msgid "function `%s': can't use function name as parameter name"
msgstr "hàm « %s »: không thể dùng tên hàm như là tên tham số"
-#: awkgram.y:4207
+#: awkgram.y:4213
#, c-format
msgid "function `%s': can't use special variable `%s' as a function parameter"
msgstr "hàm « %s »: không thể dùng biến đặc biệt « %s » như là tham số hàm"
-#: awkgram.y:4223
+#: awkgram.y:4221
#, c-format
-msgid "function name `%s' previously defined"
-msgstr "tên hàm « %s » trước đây đã được định nghĩa rồi"
+msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
+msgstr "hàm « %s »: tham số « #%d », « %s », nhân đôi tham số « #%d »"
-#: awkgram.y:4391 awkgram.y:4397
+#: awkgram.y:4315 awkgram.y:4319
#, c-format
msgid "function `%s' called but never defined"
msgstr "hàm « %s » được gá»i nhÆ°ng mà chÆ°a xác định"
-#: awkgram.y:4400
+#: awkgram.y:4324
#, c-format
msgid "function `%s' defined but never called directly"
msgstr "hàm « %s » được định nghÄ©a nhÆ°ng mà chÆ°a được gá»i trá»±c tiếp bao giá»"
-#: awkgram.y:4432
+#: awkgram.y:4356
#, c-format
msgid "regexp constant for parameter #%d yields boolean value"
msgstr "hằng biểu thức chính quy cho tham số « #%d » làm giá trị luận lý (bun)"
-#: awkgram.y:4541
+#: awkgram.y:4402
#, c-format
msgid ""
"function `%s' called with space between name and `(',\n"
@@ -537,232 +528,232 @@ msgstr ""
"hàm « %s » được gá»i vá»›i dấu cách nằm giữa tên và « ( »\n"
"hoặc được dùng như là biến hay mảng"
-#: awkgram.y:4788 eval.c:2056
+#: awkgram.y:4618
msgid "division by zero attempted"
msgstr "cố gắng chia cho số không"
-#: awkgram.y:4797 eval.c:2072
+#: awkgram.y:4627
#, c-format
msgid "division by zero attempted in `%%'"
msgstr "thử chia cho không trong « %% »"
-#: builtin.c:120
+#: builtin.c:128
#, c-format
msgid "%s to \"%s\" failed (%s)"
msgstr "%s tới « %s » bị lỗi (%s)"
-#: builtin.c:121
+#: builtin.c:129
msgid "standard output"
msgstr "thiết bị xuất chuẩn"
-#: builtin.c:135
+#: builtin.c:143
msgid "exp: received non-numeric argument"
msgstr "exp: đã nhận đối số không phải thuộc số"
-#: builtin.c:141
+#: builtin.c:149
#, c-format
msgid "exp: argument %g is out of range"
msgstr "exp: đối số « %g » ở ngoại phạm vị"
-#: builtin.c:200
+#: builtin.c:208
#, c-format
msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing"
msgstr ""
"fflush: không thể xoá sạch: ống dẫn « %s » được mở để Ä‘á»c, không phải để ghi"
-#: builtin.c:203
+#: builtin.c:211
#, c-format
msgid "fflush: cannot flush: file `%s' opened for reading, not writing"
msgstr ""
"fflush: không thể xoá sạch: tập tin « %s » được mở để Ä‘á»c, không phải để ghi"
-#: builtin.c:215
+#: builtin.c:223
#, c-format
msgid "fflush: `%s' is not an open file, pipe or co-process"
msgstr ""
"fflush: « %s » không phải là tập tin đã mở, ống dẫn hay đồng tiến trình"
-#: builtin.c:333
+#: builtin.c:341
msgid "index: received non-string first argument"
msgstr "index: (chỉ mục) đã nhận đối số thứ nhất không phải là chuỗi"
-#: builtin.c:335
+#: builtin.c:343
msgid "index: received non-string second argument"
msgstr "index: (chỉ mục) đã nhận đối số thứ hai không phải là chuỗi"
-#: builtin.c:457
+#: builtin.c:467 mpfr.c:770
msgid "int: received non-numeric argument"
msgstr "int: (số nguyên?) đã nhận đối số không phải thuộc số"
-#: builtin.c:493
+#: builtin.c:503
msgid "length: received array argument"
msgstr "length: (chiá»u dài) đã nhận mảng đối số"
-#: builtin.c:496
+#: builtin.c:506
msgid "`length(array)' is a gawk extension"
msgstr "« length(array) » (độ dài mảng) là một phần mở rộng gawk"
-#: builtin.c:504
+#: builtin.c:514
msgid "length: received non-string argument"
msgstr "length: (chiá»u dài) đã nhận đối số không phải chuá»—i"
-#: builtin.c:535
+#: builtin.c:545
msgid "log: received non-numeric argument"
msgstr "log: (bản ghi) đã nhận đối số không phải thuộc số"
-#: builtin.c:538
+#: builtin.c:548
#, c-format
msgid "log: received negative argument %g"
msgstr "log: (bản ghi) đã nhận đối số âm « %g »"
-#: builtin.c:694 builtin.c:699
+#: builtin.c:746 builtin.c:751
msgid "fatal: must use `count$' on all formats or none"
msgstr "nghiêm trá»ng: phải dùng « count$ » vá»›i má»i dạng thức hay không gì cả"
-#: builtin.c:762
+#: builtin.c:821
#, c-format
msgid "field width is ignored for `%%' specifier"
msgstr "chiá»u rá»™ng trÆ°á»ng bị bá» qua đối vá»›i bá»™ chỉ định `%%'"
-#: builtin.c:764
+#: builtin.c:823
#, c-format
msgid "precision is ignored for `%%' specifier"
msgstr "độ chính xác bị bỠqua đối với bộ chỉ định `%%'"
-#: builtin.c:766
+#: builtin.c:825
#, c-format
msgid "field width and precision are ignored for `%%' specifier"
msgstr "chiá»u rá»™ng trÆ°á»ng và Ä‘á»™ chính xác bị bá» qua đối vá»›i bá»™ chỉ định `%%'"
-#: builtin.c:817
+#: builtin.c:876
msgid "fatal: `$' is not permitted in awk formats"
msgstr "nghiêm trá»ng: không cho phép `$' trong định dạng awk"
-#: builtin.c:826
+#: builtin.c:885
msgid "fatal: arg count with `$' must be > 0"
msgstr "nghiêm trá»ng: số lượng đối số vá»›i « $ » phải >0"
-#: builtin.c:830
+#: builtin.c:889
#, c-format
msgid "fatal: arg count %ld greater than total number of supplied arguments"
msgstr "nghiêm trá»ng: số lượng đối số %ld lá»›n hÆ¡n tổng số đối số được cung cấp"
-#: builtin.c:834
+#: builtin.c:893
msgid "fatal: `$' not permitted after period in format"
msgstr "nghiêm trá»ng: không cho phép « $ » nằm sau dấu chấm trong định dạng"
-#: builtin.c:850
+#: builtin.c:909
msgid "fatal: no `$' supplied for positional field width or precision"
msgstr ""
"nghiêm trá»ng: chÆ°a cung cấp « $ » cho Ä‘á»™ rá»™ng trÆ°á»ng thuá»™c vị trí hay cho Ä‘á»™ "
"chính xác"
-#: builtin.c:921
+#: builtin.c:981
msgid "`l' is meaningless in awk formats; ignored"
msgstr "chữ « l » không có nghĩa trong định dạng awk nên bị bỠqua"
-#: builtin.c:925
+#: builtin.c:985
msgid "fatal: `l' is not permitted in POSIX awk formats"
msgstr "nghiêm trá»ng: không cho phép chữ « l » nằm trong định dạng awk POSIX"
-#: builtin.c:938
+#: builtin.c:998
msgid "`L' is meaningless in awk formats; ignored"
msgstr "chữ « L » không có nghĩa trong định dạng awk nên bị bỠqua"
-#: builtin.c:942
+#: builtin.c:1002
msgid "fatal: `L' is not permitted in POSIX awk formats"
msgstr "nghiêm trá»ng: không cho phép chữ « L » nằm trong định dạng awk POSIX"
-#: builtin.c:955
+#: builtin.c:1015
msgid "`h' is meaningless in awk formats; ignored"
msgstr "chữ « h » không có nghĩa trong định dạng awk nên bị bỠqua"
-#: builtin.c:959
+#: builtin.c:1019
msgid "fatal: `h' is not permitted in POSIX awk formats"
msgstr "nghiêm trá»ng: không cho phép chữ « h » nằm trong định dạng awk POSIX"
-#: builtin.c:1272
+#: builtin.c:1414
#, c-format
msgid "[s]printf: value %g is out of range for `%%%c' format"
msgstr "[s]printf: giá trị %g ở ngoại phạm vị cho dạng thức « %%%c »"
-#: builtin.c:1332
+#: builtin.c:1512
#, c-format
msgid "ignoring unknown format specifier character `%c': no argument converted"
msgstr ""
"đang bỠqua ký tự ghi rõ định dạng không rõ « %c »: không có đối số được "
"chuyển đổi"
-#: builtin.c:1337
+#: builtin.c:1517
msgid "fatal: not enough arguments to satisfy format string"
msgstr "nghiêm trá»ng: chÆ°a có đủ đối số để đáp ứng chuá»—i định dạng"
-#: builtin.c:1339
+#: builtin.c:1519
msgid "^ ran out for this one"
msgstr "bị hết « ^ » cho Ä‘iá»u này"
-#: builtin.c:1346
+#: builtin.c:1526
msgid "[s]printf: format specifier does not have control letter"
msgstr "[s]printf: Ä‘iá»u ghi rõ định dạng không có chữ Ä‘iá»u khiển"
-#: builtin.c:1349
+#: builtin.c:1529
msgid "too many arguments supplied for format string"
msgstr "quá nhiá»u đối số được cung cấp cho chuá»—i định dạng"
-#: builtin.c:1423 builtin.c:1434
+#: builtin.c:1604 builtin.c:1615
msgid "printf: no arguments"
msgstr "printf: không có đối số"
-#: builtin.c:1475
+#: builtin.c:1656
msgid "sqrt: received non-numeric argument"
msgstr "sqrt: (căn bậc hai) đã nhận đối số không phải thuộc số"
-#: builtin.c:1479
+#: builtin.c:1660
#, c-format
msgid "sqrt: called with negative argument %g"
msgstr "sqrt: (căn bậc hai) đã gá»i vá»›i đối số âm « %g »"
-#: builtin.c:1503
+#: builtin.c:1691
#, c-format
msgid "substr: length %g is not >= 1"
msgstr "substr: (chuỗi phụ) độ dài %g không phải ≥1"
-#: builtin.c:1505
+#: builtin.c:1693
#, c-format
msgid "substr: length %g is not >= 0"
msgstr "substr: (chuỗi phụ) độ dài %g không phải ≥0"
-#: builtin.c:1512
+#: builtin.c:1700
#, c-format
msgid "substr: non-integer length %g will be truncated"
msgstr "substr: (chuỗi phụ) sẽ cắt xén độ dài không phải số nguyên « %g »"
-#: builtin.c:1517
+#: builtin.c:1705
#, c-format
msgid "substr: length %g too big for string indexing, truncating to %g"
msgstr "substr: độ dài %g quá lớn để chỉ mục chuỗi nên xén ngắn thành %g"
-#: builtin.c:1529
+#: builtin.c:1717
#, c-format
msgid "substr: start index %g is invalid, using 1"
msgstr "substr: (chuỗi phụ) số chỉ mục đầu « %g » không hợp lệ nên dùng 1"
-#: builtin.c:1534
+#: builtin.c:1722
#, c-format
msgid "substr: non-integer start index %g will be truncated"
msgstr ""
"substr: (chuỗi phụ) số chỉ mục đầu không phải số nguyên « %g » sẽ bị cắt ngắn"
-#: builtin.c:1559
+#: builtin.c:1747
msgid "substr: source string is zero length"
msgstr "substr: (chuỗi con) chuỗi nguồn có độ dài số không"
-#: builtin.c:1575
+#: builtin.c:1763
#, c-format
msgid "substr: start index %g is past end of string"
msgstr "substr: (chuỗi phụ) số chỉ mục đầu %g nằm sau kết thúc của chuỗi"
-#: builtin.c:1583
+#: builtin.c:1771
#, c-format
msgid ""
"substr: length %g at start index %g exceeds length of first argument (%lu)"
@@ -770,228 +761,1085 @@ msgstr ""
"substr: (chuỗi phụ) độ dài %g tại số chỉ mục đầu %g vượt quá độ dài của đối "
"số đầu (%lu)"
-#: builtin.c:1657
+#: builtin.c:1845
msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type"
msgstr ""
"strftime: giá trị định dạng trong PROCINFO[\"strftime\"] phải thuộc kiểu số"
-#: builtin.c:1680
+#: builtin.c:1868
msgid "strftime: received non-numeric second argument"
msgstr "strftime: đã nhận đối số thứ hai khác thuộc số"
-#: builtin.c:1683
+#: builtin.c:1872
msgid "strftime: second argument less than 0 or too big for time_t"
msgstr "strftime: tham số thứ hai nhỠhơn 0 hay quá lớn dành cho time_t"
-#: builtin.c:1690
+#: builtin.c:1879
msgid "strftime: received non-string first argument"
msgstr "strftime: đã nhận đối số thứ nhất khác chuỗi"
-#: builtin.c:1696
+#: builtin.c:1886
msgid "strftime: received empty format string"
msgstr "strftime: đã nhận chuỗi định dạng rỗng"
-#: builtin.c:1762
+#: builtin.c:1952
msgid "mktime: received non-string argument"
msgstr "mktime: đã nhận đối số khác chuỗi"
-#: builtin.c:1779
+#: builtin.c:1969
msgid "mktime: at least one of the values is out of the default range"
msgstr "mktime: ít nhất một của những giá trị nằm ở ngoại phạm vi mặc định"
-#: builtin.c:1814
+#: builtin.c:2004
msgid "'system' function not allowed in sandbox mode"
msgstr "hàm 'system' không cho phép ở chế độ khuôn đúc"
-#: builtin.c:1819
+#: builtin.c:2009
msgid "system: received non-string argument"
msgstr "system: (hệ thống) đã nhận đối số khác chuỗi"
-#: builtin.c:1874 eval.c:1159 eval.c:1790 eval.c:1803
-#, c-format
-msgid "reference to uninitialized variable `%s'"
-msgstr "gặp tham chiếu đến biến chưa được sở khởi « %s »"
-
-#: builtin.c:1941
+#: builtin.c:2127
#, c-format
msgid "reference to uninitialized field `$%d'"
msgstr "gặp tham chiếu đến trÆ°á»ng chÆ°a được sở khởi « $%d »"
-#: builtin.c:2028
+#: builtin.c:2214
msgid "tolower: received non-string argument"
msgstr "tolower: (đến thấp hơn) đã nhận đối số khác chuỗi"
-#: builtin.c:2062
+#: builtin.c:2248
msgid "toupper: received non-string argument"
msgstr "toupper: (đến cao hơn) đã nhận đối số khác chuỗi"
-#: builtin.c:2098
+#: builtin.c:2284 mpfr.c:685
msgid "atan2: received non-numeric first argument"
msgstr "atan2: đã nhận đối số thứ nhất khác thuộc số"
-#: builtin.c:2100
+#: builtin.c:2286 mpfr.c:687
msgid "atan2: received non-numeric second argument"
msgstr "atan2: đã nhận đối số thứ hai khác thuộc số"
-#: builtin.c:2119
+#: builtin.c:2305
msgid "sin: received non-numeric argument"
msgstr "sin: đã nhận đối số không phải thuộc số"
-#: builtin.c:2135
+#: builtin.c:2321
msgid "cos: received non-numeric argument"
msgstr "cos: đã nhận đối số không phải thuộc số"
-#: builtin.c:2188
+#: builtin.c:2374 mpfr.c:1137
msgid "srand: received non-numeric argument"
msgstr "srand: đã nhận đối số không phải thuộc số"
-#: builtin.c:2219
+#: builtin.c:2405
msgid "match: third argument is not an array"
msgstr "match: (khớp) đối số thứ ba không phải là mảng"
-#: builtin.c:2483
+#: builtin.c:2670
msgid "gensub: third argument of 0 treated as 1"
msgstr "gensub: đối số thứ ba 0 được xử lý như 1"
-#: builtin.c:2776
+#: builtin.c:2963
msgid "lshift: received non-numeric first argument"
msgstr "lshift: đã nhận đối số đầu không phải thuộc số"
-#: builtin.c:2778
+#: builtin.c:2965
msgid "lshift: received non-numeric second argument"
msgstr "lshift: (dịch bên trái) đã nhận đối số thứ hai khác thuộc số"
-#: builtin.c:2784
+#: builtin.c:2971
#, fuzzy, c-format
msgid "lshift(%f, %f): negative values will give strange results"
msgstr "lshift(%lf, %lf): giá trị âm sẽ gây ra kết quả lạ"
-#: builtin.c:2786
+#: builtin.c:2973
#, fuzzy, c-format
msgid "lshift(%f, %f): fractional values will be truncated"
msgstr "lshift(%lf, %lf): giá trị thuộc phân số sẽ bị xén ngắn"
-#: builtin.c:2788
+#: builtin.c:2975
#, fuzzy, c-format
msgid "lshift(%f, %f): too large shift value will give strange results"
msgstr "lshift(%lf, %lf): giá trị dịch quá lớn sẽ gây ra kết quả lạ"
-#: builtin.c:2813
+#: builtin.c:3000
msgid "rshift: received non-numeric first argument"
msgstr "rshift: đã nhận đối số thứ nhất khác thuộc số"
-#: builtin.c:2815
+#: builtin.c:3002
msgid "rshift: received non-numeric second argument"
msgstr "rshift: (dịch bên phải) đã nhận đối số thứ hai khác thuộc số"
-#: builtin.c:2821
+#: builtin.c:3008
#, fuzzy, c-format
msgid "rshift(%f, %f): negative values will give strange results"
msgstr "rshift(%lf, %lf): giá trị âm sẽ gây ra kết quả lạ"
-#: builtin.c:2823
+#: builtin.c:3010
#, fuzzy, c-format
msgid "rshift(%f, %f): fractional values will be truncated"
msgstr "rshift(%lf, %lf): giá trị thuộc phân số sẽ bị xén ngắn"
-#: builtin.c:2825
+#: builtin.c:3012
#, fuzzy, c-format
msgid "rshift(%f, %f): too large shift value will give strange results"
msgstr "rshift(%lf, %lf): giá trị dịch quá lớn sẽ gây ra kết quả lạ"
-#: builtin.c:2850
-msgid "and: received non-numeric first argument"
-msgstr "and: (và) đã nhận đối số đầu không phải thuộc số"
-
-#: builtin.c:2852
-msgid "and: received non-numeric second argument"
-msgstr "and: (và) đã nhận đối số thứ hai khác thuộc số"
+#: builtin.c:3037
+#, fuzzy
+msgid "and: called with less than two arguments"
+msgstr "sqrt: (căn bậc hai) đã gá»i vá»›i đối số âm « %g »"
-#: builtin.c:2858
+#: builtin.c:3042
#, fuzzy, c-format
-msgid "and(%f, %f): negative values will give strange results"
-msgstr "and(%lf, %lf): (và) giá trị âm sẽ gây ra kết quả lạ"
+msgid "and: argument %d is non-numeric"
+msgstr "exp: đối số « %g » ở ngoại phạm vị"
-#: builtin.c:2860
+#: builtin.c:3046
#, fuzzy, c-format
-msgid "and(%f, %f): fractional values will be truncated"
-msgstr "and(%lf, %lf): (và) giá trị thuộc phân số sẽ bị xén ngắn"
-
-#: builtin.c:2885
-msgid "or: received non-numeric first argument"
-msgstr "or: (hoặc) đã nhận đối số đầu không phải thuộc số"
+msgid "and: argument %d negative value %g will give strange results"
+msgstr "and(%lf, %lf): (và) giá trị âm sẽ gây ra kết quả lạ"
-#: builtin.c:2887
-msgid "or: received non-numeric second argument"
-msgstr "or: (hoặc) đã nhận đối số thứ hai khác thuộc số"
+#: builtin.c:3069
+#, fuzzy
+msgid "or: called with less than two arguments"
+msgstr "sqrt: (căn bậc hai) đã gá»i vá»›i đối số âm « %g »"
-#: builtin.c:2893
+#: builtin.c:3074
#, fuzzy, c-format
-msgid "or(%f, %f): negative values will give strange results"
-msgstr "or(%lf, %lf): (hoặc) giá trị âm sẽ gây ra kết quả lạ"
+msgid "or: argument %d is non-numeric"
+msgstr "exp: đối số « %g » ở ngoại phạm vị"
-#: builtin.c:2895
+#: builtin.c:3078
#, fuzzy, c-format
-msgid "or(%f, %f): fractional values will be truncated"
-msgstr "or(%lf, %lf): (hoặc) giá trị thuộc phân số sẽ bị xén ngắn"
-
-#: builtin.c:2923
-msgid "xor: received non-numeric first argument"
-msgstr "xor: (không hoặc) đã nhận đối số thứ nhất khác thuộc số"
+msgid "or: argument %d negative value %g will give strange results"
+msgstr "compl(%lf): (biên dịch) giá trị âm sẽ gây ra kết quả lạ"
-#: builtin.c:2925
-msgid "xor: received non-numeric second argument"
-msgstr "xor: đã nhận đối số thứ hai khác thuộc số"
+#: builtin.c:3100
+#, fuzzy
+msgid "xor: called with less than two arguments"
+msgstr "sqrt: (căn bậc hai) đã gá»i vá»›i đối số âm « %g »"
-#: builtin.c:2931
+#: builtin.c:3106
#, fuzzy, c-format
-msgid "xor(%f, %f): negative values will give strange results"
-msgstr "xor(%lf, %lf): (không hoặc) giá trị âm sẽ gây ra kết quả lạ"
+msgid "xor: argument %d is non-numeric"
+msgstr "exp: đối số « %g » ở ngoại phạm vị"
-#: builtin.c:2933
+#: builtin.c:3110
#, fuzzy, c-format
-msgid "xor(%f, %f): fractional values will be truncated"
-msgstr "xor(%lf, %lf): (không hoặc) giá trị thuộc phân số sẽ bị xén ngắn"
+msgid "xor: argument %d negative value %g will give strange results"
+msgstr "xor(%lf, %lf): (không hoặc) giá trị âm sẽ gây ra kết quả lạ"
-#: builtin.c:2957 builtin.c:2963
+#: builtin.c:3135 mpfr.c:800
msgid "compl: received non-numeric argument"
msgstr "compl: (biên dịch) đã nhận đối số khác thuộc số"
-#: builtin.c:2965
+#: builtin.c:3141
#, fuzzy, c-format
msgid "compl(%f): negative value will give strange results"
msgstr "compl(%lf): (biên dịch) giá trị âm sẽ gây ra kết quả lạ"
-#: builtin.c:2967
+#: builtin.c:3143
#, fuzzy, c-format
msgid "compl(%f): fractional value will be truncated"
msgstr "compl(%lf): (biên dịch) giá trị thuộc phân số se bị xén ngắn"
-#: builtin.c:3136
+#: builtin.c:3312
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr "dcgettext: « %s » không phải là má»™t phân loại miá»n địa phÆ°Æ¡ng hợp lệ"
-#: eval.c:412
+#: command.y:225
+#, c-format
+msgid "Type (g)awk statement(s). End with the command \"end\"\n"
+msgstr ""
+
+#: command.y:289
+#, fuzzy, c-format
+msgid "invalid frame number: %d"
+msgstr "Kết thúc phạm vị không hợp lệ"
+
+#: command.y:295
+#, fuzzy, c-format
+msgid "info: invalid option - \"%s\""
+msgstr "%s: tùy chá»n không hợp lệ -- « %c »\n"
+
+#: command.y:321
+#, c-format
+msgid "source \"%s\": already sourced."
+msgstr ""
+
+#: command.y:326
+#, c-format
+msgid "save \"%s\": command not permitted."
+msgstr ""
+
+#: command.y:339
+msgid "Can't use command `commands' for breakpoint/watchpoint commands"
+msgstr ""
+
+#: command.y:341
+msgid "no breakpoint/watchpoint has been set yet"
+msgstr ""
+
+#: command.y:343
+msgid "invalid breakpoint/watchpoint number"
+msgstr ""
+
+#: command.y:348
+#, c-format
+msgid "Type commands for when %s %d is hit, one per line.\n"
+msgstr ""
+
+#: command.y:350
+#, c-format
+msgid "End with the command \"end\"\n"
+msgstr ""
+
+#: command.y:357
+msgid "`end' valid only in command `commands' or `eval'"
+msgstr ""
+
+#: command.y:367
+msgid "`silent' valid only in command `commands'"
+msgstr ""
+
+#: command.y:373
+#, fuzzy, c-format
+msgid "trace: invalid option - \"%s\""
+msgstr "%s: tùy chá»n không hợp lệ -- « %c »\n"
+
+#: command.y:387
+msgid "condition: invalid breakpoint/watchpoint number"
+msgstr ""
+
+#: command.y:449
+#, fuzzy
+msgid "argument not a string"
+msgstr "exp: đối số « %g » ở ngoại phạm vị"
+
+#: command.y:459 command.y:464
+#, c-format
+msgid "option: invalid parameter - \"%s\""
+msgstr ""
+
+#: command.y:474
+#, c-format
+msgid "no such function - \"%s\""
+msgstr ""
+
+#: command.y:531
+#, fuzzy, c-format
+msgid "enable: invalid option - \"%s\""
+msgstr "%s: tùy chá»n không hợp lệ -- « %c »\n"
+
+#: command.y:597
+#, fuzzy, c-format
+msgid "invalid range specification: %d - %d"
+msgstr "Kết thúc phạm vị không hợp lệ"
+
+#: command.y:659
+#, fuzzy
+msgid "non-numeric value for field number"
+msgstr "không hiểu giá trị dành cho đặc tính trÆ°á»ng: %d\n"
+
+#: command.y:680 command.y:687
+msgid "non-numeric value found, numeric expected"
+msgstr ""
+
+#: command.y:712 command.y:718
+msgid "non-zero integer value"
+msgstr ""
+
+#: command.y:817
+msgid ""
+"backtrace [N] - print trace of all or N innermost (outermost if N < 0) "
+"frames."
+msgstr ""
+
+#: command.y:819
+msgid ""
+"break [[filename:]N|function] - set breakpoint at the specified location."
+msgstr ""
+
+#: command.y:821
+msgid "clear [[filename:]N|function] - delete breakpoints previously set."
+msgstr ""
+
+#: command.y:823
+msgid ""
+"commands [num] - starts a list of commands to be executed at a breakpoint"
+"(watchpoint) hit."
+msgstr ""
+
+#: command.y:825
+msgid "condition num [expr] - set or clear breakpoint or watchpoint condition."
+msgstr ""
+
+#: command.y:827
+msgid "continue [COUNT] - continue program being debugged."
+msgstr ""
+
+#: command.y:829
+msgid "delete [breakpoints] [range] - delete specified breakpoints."
+msgstr ""
+
+#: command.y:831
+msgid "disable [breakpoints] [range] - disable specified breakpoints."
+msgstr ""
+
+#: command.y:833
+msgid "display [var] - print value of variable each time the program stops."
+msgstr ""
+
+#: command.y:835
+msgid "down [N] - move N frames down the stack."
+msgstr ""
+
+#: command.y:837
+msgid "dump [filename] - dump instructions to file or stdout."
+msgstr ""
+
+#: command.y:839
+msgid "enable [once|del] [breakpoints] [range] - enable specified breakpoints."
+msgstr ""
+
+#: command.y:841
+msgid "end - end a list of commands or awk statements."
+msgstr ""
+
+#: command.y:843
+msgid "eval stmt|[p1, p2, ...] - evaluate awk statement(s)."
+msgstr ""
+
+#: command.y:845
+msgid "finish - execute until selected stack frame returns."
+msgstr ""
+
+#: command.y:847
+msgid "frame [N] - select and print stack frame number N."
+msgstr ""
+
+#: command.y:849
+msgid "help [command] - print list of commands or explanation of command."
+msgstr ""
+
+#: command.y:851
+msgid "ignore N COUNT - set ignore-count of breakpoint number N to COUNT."
+msgstr ""
+
+#: command.y:853
+msgid ""
+"info topic - source|sources|variables|functions|break|frame|args|locals|"
+"display|watch."
+msgstr ""
+
+#: command.y:855
+msgid "list [-|+|[filename:]lineno|function|range] - list specified line(s)."
+msgstr ""
+
+#: command.y:857
+msgid "next [COUNT] - step program, proceeding through subroutine calls."
+msgstr ""
+
+#: command.y:859
+msgid ""
+"nexti [COUNT] - step one instruction, but proceed through subroutine calls."
+msgstr ""
+
+#: command.y:861
+msgid "option [name[=value]] - set or display debugger option(s)."
+msgstr ""
+
+#: command.y:863
+msgid "print var [var] - print value of a variable or array."
+msgstr ""
+
+#: command.y:865
+msgid "printf format, [arg], ... - formatted output."
+msgstr ""
+
+#: command.y:867
+msgid "quit - exit debugger."
+msgstr ""
+
+#: command.y:869
+msgid "return [value] - make selected stack frame return to its caller."
+msgstr ""
+
+#: command.y:871
+msgid "run - start or restart executing program."
+msgstr ""
+
+#: command.y:874
+msgid "save filename - save commands from the session to file."
+msgstr ""
+
+#: command.y:877
+msgid "set var = value - assign value to a scalar variable."
+msgstr ""
+
+#: command.y:879
+msgid ""
+"silent - suspends usual message when stopped at a breakpoint/watchpoint."
+msgstr ""
+
+#: command.y:881
+msgid "source file - execute commands from file."
+msgstr ""
+
+#: command.y:883
+msgid "step [COUNT] - step program until it reaches a different source line."
+msgstr ""
+
+#: command.y:885
+msgid "stepi [COUNT] - step one instruction exactly."
+msgstr ""
+
+#: command.y:887
+msgid "tbreak [[filename:]N|function] - set a temporary breakpoint."
+msgstr ""
+
+#: command.y:889
+msgid "trace on|off - print instruction before executing."
+msgstr ""
+
+#: command.y:891
+msgid "undisplay [N] - remove variable(s) from automatic display list."
+msgstr ""
+
+#: command.y:893
+msgid ""
+"until [[filename:]N|function] - execute until program reaches a different "
+"line or line N within current frame."
+msgstr ""
+
+#: command.y:895
+msgid "unwatch [N] - remove variable(s) from watch list."
+msgstr ""
+
+#: command.y:897
+msgid "up [N] - move N frames up the stack."
+msgstr ""
+
+#: command.y:899
+msgid "watch var - set a watchpoint for a variable."
+msgstr ""
+
+#: command.y:1011 debug.c:395 msg.c:128
+#, c-format
+msgid "error: "
+msgstr "lá»—i: "
+
+#: command.y:1051
+#, fuzzy, c-format
+msgid "can't read command (%s)\n"
+msgstr "không thể chuyển hướng từ « %s » (%s)"
+
+#: command.y:1065
+#, fuzzy, c-format
+msgid "can't read command (%s)"
+msgstr "không thể chuyển hướng từ « %s » (%s)"
+
+#: command.y:1116
+#, fuzzy
+msgid "invalid character in command"
+msgstr "Tên hạng ký tự không hợp lệ"
+
+#: command.y:1152
+#, c-format
+msgid "unknown command - \"%.*s\", try help"
+msgstr ""
+
+#: command.y:1222
+#, c-format
+msgid "%s"
+msgstr ""
+
+#: command.y:1284
+#, fuzzy
+msgid "invalid character"
+msgstr "Ký tự đối chiếu không hợp lệ"
+
+#: command.y:1455
+#, c-format
+msgid "undefined command: %s\n"
+msgstr ""
+
+#: debug.c:246
+msgid "set or show the number of lines to keep in history file."
+msgstr ""
+
+#: debug.c:248
+msgid "set or show the list command window size."
+msgstr ""
+
+#: debug.c:250
+msgid "set or show gawk output file."
+msgstr ""
+
+#: debug.c:252
+msgid "set or show debugger prompt."
+msgstr ""
+
+#: debug.c:254
+msgid "(un)set or show saving of command history (value=on|off)."
+msgstr ""
+
+#: debug.c:256
+msgid "(un)set or show saving of options (value=on|off)."
+msgstr ""
+
+#: debug.c:258
+msgid "(un)set or show instruction tracing (value=on|off)."
+msgstr ""
+
+#: debug.c:339
+msgid "program not running."
+msgstr ""
+
+#: debug.c:442 debug.c:597
+#, fuzzy, c-format
+msgid "can't read source file `%s' (%s)"
+msgstr "không thể Ä‘á»c tập tin nguồn « %s » (%s)"
+
+#: debug.c:447
+#, fuzzy, c-format
+msgid "source file `%s' is empty.\n"
+msgstr "tập tin nguồn « %s » là rỗng"
+
+#: debug.c:474
+msgid "no current source file."
+msgstr ""
+
+#: debug.c:499
+#, fuzzy, c-format
+msgid "cannot find source file named `%s' (%s)"
+msgstr "không thể Ä‘á»c tập tin nguồn « %s » (%s)"
+
+#: debug.c:523
+#, c-format
+msgid "WARNING: source file `%s' modified since program compilation.\n"
+msgstr ""
+
+#: debug.c:542
+#, c-format
+msgid "line number %d out of range; `%s' has %d lines"
+msgstr ""
+
+#: debug.c:602
+#, fuzzy, c-format
+msgid "unexpected eof while reading file `%s', line %d"
+msgstr "gặp dòng mới bất ngỠhay kết thúc của chuỗi"
+
+#: debug.c:611
+#, c-format
+msgid "source file `%s' modified since start of program execution"
+msgstr ""
+
+#: debug.c:723
+#, fuzzy, c-format
+msgid "Current source file: %s\n"
+msgstr "đã sẵn bao gồm tập tin nguồn `%s'"
+
+#: debug.c:724
+#, c-format
+msgid "Number of lines: %d\n"
+msgstr ""
+
+#: debug.c:731
+#, c-format
+msgid "Source file (lines): %s (%d)\n"
+msgstr ""
+
+#: debug.c:745
+msgid ""
+"Number Disp Enabled Location\n"
+"\n"
+msgstr ""
+
+#: debug.c:756
+#, c-format
+msgid "\tno of hits = %ld\n"
+msgstr ""
+
+#: debug.c:758
+#, c-format
+msgid "\tignore next %ld hit(s)\n"
+msgstr ""
+
+#: debug.c:760 debug.c:900
+#, c-format
+msgid "\tstop condition: %s\n"
+msgstr ""
+
+#: debug.c:762 debug.c:902
+msgid "\tcommands:\n"
+msgstr ""
+
+#: debug.c:784
+#, c-format
+msgid "Current frame: "
+msgstr ""
+
+#: debug.c:787
+#, c-format
+msgid "Called by frame: "
+msgstr ""
+
+#: debug.c:791
+#, c-format
+msgid "Caller of frame: "
+msgstr ""
+
+#: debug.c:809
+#, c-format
+msgid "None in main().\n"
+msgstr ""
+
+#: debug.c:839
+#, fuzzy
+msgid "No arguments.\n"
+msgstr "printf: không có đối số"
+
+#: debug.c:840
+msgid "No locals.\n"
+msgstr ""
+
+#: debug.c:848
+msgid ""
+"All defined variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:858
+msgid ""
+"All defined functions:\n"
+"\n"
+msgstr ""
+
+#: debug.c:877
+msgid ""
+"Auto-display variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:880
+msgid ""
+"Watch variables:\n"
+"\n"
+msgstr ""
+
+#: debug.c:1020
+#, fuzzy, c-format
+msgid "no symbol `%s' in current context\n"
+msgstr "`exit' (thoát) không thể được gá»i trong ngữ cảnh hiện hành"
+
+#: debug.c:1032 debug.c:1416
+#, fuzzy, c-format
+msgid "`%s' is not an array\n"
+msgstr "« %s » không phải là tên biến hợp lệ"
+
+#: debug.c:1046
+#, fuzzy, c-format
+msgid "$%ld = uninitialized field\n"
+msgstr "gặp tham chiếu đến trÆ°á»ng chÆ°a được sở khởi « $%d »"
+
+#: debug.c:1067
+#, fuzzy, c-format
+msgid "array `%s' is empty\n"
+msgstr "tập tin dữ liệu « %s » là rỗng"
+
+#: debug.c:1110 debug.c:1162
+#, fuzzy, c-format
+msgid "[\"%s\"] not in array `%s'\n"
+msgstr "delete: (xoá) số mũ « %s » không phải nằm trong mảng « %s »"
+
+#: debug.c:1166
+#, c-format
+msgid "`%s[\"%s\"]' is not an array\n"
+msgstr ""
+
+#: debug.c:1227 debug.c:4947
+#, fuzzy, c-format
+msgid "`%s' is not a scalar variable"
+msgstr "« %s » không phải là tên biến hợp lệ"
+
+#: debug.c:1249 debug.c:4977
+#, fuzzy, c-format
+msgid "attempt to use array `%s[\"%s\"]' in a scalar context"
+msgstr "cố gắng dùng mảng `%s[\"%.*s\"]' trong một ngữ cảnh vô hướng"
+
+#: debug.c:1269 debug.c:4988
+#, fuzzy, c-format
+msgid "attempt to use scalar `%s[\"%s\"]' as array"
+msgstr "cố dùng «%s[\"%.*s\"]» vô hướng như là mảng"
+
+#: debug.c:1412
+#, fuzzy, c-format
+msgid "`%s' is a function"
+msgstr "`%s' không phải là tên hàm hợp lệ"
+
+#: debug.c:1454
+#, c-format
+msgid "watchpoint %d is unconditional\n"
+msgstr ""
+
+#: debug.c:1488
+#, c-format
+msgid "No display item numbered %ld"
+msgstr ""
+
+#: debug.c:1491
+#, c-format
+msgid "No watch item numbered %ld"
+msgstr ""
+
+#: debug.c:1517
+#, fuzzy, c-format
+msgid "%d: [\"%s\"] not in array `%s'\n"
+msgstr "delete: (xoá) số mũ « %s » không phải nằm trong mảng « %s »"
+
+#: debug.c:1756
+#, fuzzy
+msgid "attempt to use scalar value as array"
+msgstr "cố sử dụng giá trị vô hướng như là một mảng"
+
+#: debug.c:1845
+#, c-format
+msgid "Watchpoint %d deleted because parameter is out of scope.\n"
+msgstr ""
+
+#: debug.c:1856
+#, c-format
+msgid "Display %d deleted because parameter is out of scope.\n"
+msgstr ""
+
+#: debug.c:1889
+#, c-format
+msgid " in file `%s', line %d\n"
+msgstr ""
+
+#: debug.c:1910
+#, c-format
+msgid " at `%s':%d"
+msgstr ""
+
+#: debug.c:1926 debug.c:1989
+#, c-format
+msgid "#%ld\tin "
+msgstr ""
+
+#: debug.c:1963
+#, c-format
+msgid "More stack frames follow ...\n"
+msgstr ""
+
+#: debug.c:2006
+#, fuzzy
+msgid "invalid frame number"
+msgstr "Kết thúc phạm vị không hợp lệ"
+
+#: debug.c:2178
+#, c-format
+msgid "Note: breakpoint %d (enabled, ignore next %ld hits), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2185
+#, c-format
+msgid "Note: breakpoint %d (enabled), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2192
+#, c-format
+msgid "Note: breakpoint %d (disabled, ignore next %ld hits), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2199
+#, c-format
+msgid "Note: breakpoint %d (disabled), also set at %s:%d"
+msgstr ""
+
+#: debug.c:2216
+#, c-format
+msgid "Breakpoint %d set at file `%s', line %d\n"
+msgstr ""
+
+#: debug.c:2318
+#, c-format
+msgid "Can't set breakpoint in file `%s'\n"
+msgstr ""
+
+#: debug.c:2347 debug.c:2470 debug.c:3328
+#, fuzzy, c-format
+msgid "line number %d in file `%s' out of range"
+msgstr "exp: đối số « %g » ở ngoại phạm vị"
+
+#: debug.c:2351
+#, c-format
+msgid "Can't find rule!!!\n"
+msgstr ""
+
+#: debug.c:2353
+#, c-format
+msgid "Can't set breakpoint at `%s':%d\n"
+msgstr ""
+
+#: debug.c:2365
+#, c-format
+msgid "Can't set breakpoint in function `%s'\n"
+msgstr ""
+
+#: debug.c:2381
+#, c-format
+msgid "breakpoint %d set at file `%s', line %d is unconditional\n"
+msgstr ""
+
+#: debug.c:2486 debug.c:2508
+#, c-format
+msgid "Deleted breakpoint %d"
+msgstr ""
+
+#: debug.c:2492
+#, c-format
+msgid "No breakpoint(s) at entry to function `%s'\n"
+msgstr ""
+
+#: debug.c:2519
+#, fuzzy, c-format
+msgid "No breakpoint at file `%s', line #%d\n"
+msgstr "gặp lá»—i khi Ä‘á»c tập tin nhập « %s »: %s"
+
+#: debug.c:2574 debug.c:2615 debug.c:2635 debug.c:2678
+msgid "invalid breakpoint number"
+msgstr ""
+
+#: debug.c:2590
+msgid "Delete all breakpoints? (y or n) "
+msgstr ""
+
+#: debug.c:2591 debug.c:2901 debug.c:2954
+msgid "y"
+msgstr ""
+
+#: debug.c:2640
+#, c-format
+msgid "Will ignore next %ld crossing(s) of breakpoint %d.\n"
+msgstr ""
+
+#: debug.c:2644
+#, c-format
+msgid "Will stop next time breakpoint %d is reached.\n"
+msgstr ""
+
+#: debug.c:2761
+#, c-format
+msgid "Can only debug programs provided with the `-f' option.\n"
+msgstr ""
+
+#: debug.c:2886
+#, c-format
+msgid "Failed to restart debugger"
+msgstr ""
+
+#: debug.c:2900
+msgid "Program already running. Restart from beginning (y/n)? "
+msgstr ""
+
+#: debug.c:2904
+#, c-format
+msgid "Program not restarted\n"
+msgstr ""
+
+#: debug.c:2914
+#, c-format
+msgid "error: cannot restart, operation not allowed\n"
+msgstr ""
+
+#: debug.c:2920
+#, c-format
+msgid "error (%s): cannot restart, ignoring rest of the commands\n"
+msgstr ""
+
+#: debug.c:2928
+#, c-format
+msgid "Starting program: \n"
+msgstr ""
+
+#: debug.c:2937
+#, c-format
+msgid "Program exited %s with exit value: %d\n"
+msgstr ""
+
+#: debug.c:2953
+msgid "The program is running. Exit anyway (y/n)? "
+msgstr ""
+
+#: debug.c:2988
+#, c-format
+msgid "Not stopped at any breakpoint; argument ignored.\n"
+msgstr ""
+
+#: debug.c:2993
+#, c-format
+msgid "invalid breakpoint number %d."
+msgstr ""
+
+#: debug.c:2998
+#, c-format
+msgid "Will ignore next %ld crossings of breakpoint %d.\n"
+msgstr ""
+
+#: debug.c:3185
+#, c-format
+msgid "'finish' not meaningful in the outermost frame main()\n"
+msgstr ""
+
+#: debug.c:3190
+#, c-format
+msgid "Run till return from "
+msgstr ""
+
+#: debug.c:3233
+#, c-format
+msgid "'return' not meaningful in the outermost frame main()\n"
+msgstr ""
+
+#: debug.c:3347
+#, c-format
+msgid "Can't find specified location in function `%s'\n"
+msgstr ""
+
+#: debug.c:3355
+#, fuzzy, c-format
+msgid "invalid source line %d in file `%s'"
+msgstr "đã sẵn bao gồm tập tin nguồn `%s'"
+
+#: debug.c:3370
+#, c-format
+msgid "Can't find specified location %d in file `%s'\n"
+msgstr ""
+
+#: debug.c:3402
+#, fuzzy, c-format
+msgid "element not in array\n"
+msgstr "delete: (xoá) số mũ « %s » không phải nằm trong mảng « %s »"
+
+#: debug.c:3402
+#, c-format
+msgid "untyped variable\n"
+msgstr ""
+
+#: debug.c:3444
+#, c-format
+msgid "Stopping in %s ...\n"
+msgstr ""
+
+#: debug.c:3521
+#, c-format
+msgid "'finish' not meaningful with non-local jump '%s'\n"
+msgstr ""
+
+#: debug.c:3528
+#, c-format
+msgid "'until' not meaningful with non-local jump '%s'\n"
+msgstr ""
+
+#: debug.c:4163
+msgid "\t------[Enter] to continue or q [Enter] to quit------"
+msgstr ""
+
+#: debug.c:4164
+msgid "q"
+msgstr ""
+
+#: debug.c:4984
+#, fuzzy, c-format
+msgid "[\"%s\"] not in array `%s'"
+msgstr "delete: (xoá) số mũ « %s » không phải nằm trong mảng « %s »"
+
+#: debug.c:5190
+#, c-format
+msgid "sending output to stdout\n"
+msgstr ""
+
+#: debug.c:5230
+msgid "invalid number"
+msgstr ""
+
+#: debug.c:5362
+#, fuzzy, c-format
+msgid "`%s' not allowed in current context; statement ignored"
+msgstr "`exit' (thoát) không thể được gá»i trong ngữ cảnh hiện hành"
+
+#: debug.c:5370
+#, fuzzy
+msgid "`return' not allowed in current context; statement ignored"
+msgstr "`exit' (thoát) không thể được gá»i trong ngữ cảnh hiện hành"
+
+#: debug.c:5571
+#, c-format
+msgid "No symbol `%s' in current context"
+msgstr ""
+
+#: dfa.c:984 dfa.c:987 dfa.c:1007 dfa.c:1017 dfa.c:1029 dfa.c:1080 dfa.c:1089
+#: dfa.c:1092 dfa.c:1097 dfa.c:1110 dfa.c:1178
+msgid "unbalanced ["
+msgstr ""
+
+#: dfa.c:1038
+#, fuzzy
+msgid "invalid character class"
+msgstr "Tên hạng ký tự không hợp lệ"
+
+#: dfa.c:1215
+msgid "character class syntax is [[:space:]], not [:space:]"
+msgstr ""
+
+#: dfa.c:1267
+msgid "unfinished \\ escape"
+msgstr ""
+
+#: dfa.c:1414 regcomp.c:161
+msgid "Invalid content of \\{\\}"
+msgstr "Nội dụng « \\{\\} » không hợp lệ"
+
+#: dfa.c:1417 regcomp.c:176
+msgid "Regular expression too big"
+msgstr "Biểu thức chính quy quá lớn"
+
+#: dfa.c:1802
+msgid "unbalanced ("
+msgstr ""
+
+#: dfa.c:1929
+msgid "no syntax specified"
+msgstr ""
+
+#: dfa.c:1937
+msgid "unbalanced )"
+msgstr ""
+
+#: eval.c:394
#, c-format
msgid "unknown nodetype %d"
msgstr "không biết kiểu nút %d"
-#: eval.c:423 eval.c:437
+#: eval.c:405 eval.c:419
#, c-format
msgid "unknown opcode %d"
msgstr "gặp opcode (mã thao tác) không rõ %d"
-#: eval.c:434
+#: eval.c:416
#, c-format
msgid "opcode %s not an operator or keyword"
msgstr "mã lệnh %s không phải là một toán tử hoặc từ khoá"
-#: eval.c:488
+#: eval.c:471
msgid "buffer overflow in genflags2str"
msgstr "tràn bộ đệm trong « genflags2str » (tạo ra cỠđến chuỗi)"
-#: eval.c:698
+#: eval.c:674
#, c-format
msgid ""
"\n"
@@ -1002,314 +1850,541 @@ msgstr ""
"\t# Äống gá»i hàm:\n"
"\n"
-#: eval.c:725
+#: eval.c:703
msgid "`IGNORECASE' is a gawk extension"
msgstr "« IGNORECASE » (bá» qua chữ hoa/thÆ°á»ng) là phần mở rá»™ng gawk"
-#: eval.c:754
+#: eval.c:735
msgid "`BINMODE' is a gawk extension"
msgstr "« BINMODE » (chế độ nhị phân) là phần mở rộng gawk"
-#: eval.c:812
+#: eval.c:792
#, c-format
msgid "BINMODE value `%s' is invalid, treated as 3"
msgstr "Giá trị BINMODE (chế độ nhị phân) « %s » không hợp lệ nên thấy là 3"
-#: eval.c:902
+#: eval.c:884
#, c-format
msgid "bad `%sFMT' specification `%s'"
msgstr "đặc tả « %sFMT » sai « %s »"
-#: eval.c:980
+#: eval.c:968
msgid "turning off `--lint' due to assignment to `LINT'"
msgstr "đang tắt « --lint » do việc gán cho « LINT »"
-#: eval.c:1127 eval.c:1777
-#, c-format
-msgid "can't use function name `%s' as variable or array"
-msgstr "không thể dùng tên hàm « %s » như là biến hay mảng"
-
-#: eval.c:1158 eval.c:1789 eval.c:1802
+#: eval.c:1144
#, c-format
msgid "reference to uninitialized argument `%s'"
msgstr "gặp tham chiếu đến đối số chưa được sở khởi « %s »"
-#: eval.c:1177
+#: eval.c:1145
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "gặp tham chiếu đến biến chưa được sở khởi « %s »"
+
+#: eval.c:1163
msgid "attempt to field reference from non-numeric value"
msgstr "cố gắng tham chiếu trÆ°á»ng từ giá trị khác thuá»™c số"
-#: eval.c:1179
+#: eval.c:1165
msgid "attempt to field reference from null string"
msgstr "cố gắng tham chiếu trÆ°á»ng từ chá»—i trống rá»—ng"
-#: eval.c:1185
+#: eval.c:1173
#, c-format
msgid "attempt to access field %ld"
msgstr "cố gắng để truy cập trÆ°á»ng %ld"
-#: eval.c:1194
+#: eval.c:1182
#, c-format
msgid "reference to uninitialized field `$%ld'"
msgstr "tham chiếu đến trÆ°á»ng chÆ°a được khởi tạo « $%ld »"
-#: eval.c:1256
+#: eval.c:1269
#, c-format
msgid "function `%s' called with more arguments than declared"
msgstr "hàm « %s » được gá»i vá»›i số đối số hÆ¡n số được tuyên bố"
-#: eval.c:1437
+#: eval.c:1464
#, c-format
msgid "unwind_stack: unexpected type `%s'"
msgstr "unwind_stack: không mong đợi kiểu `%s'"
-#: eval.c:1532
+#: eval.c:1558
msgid "division by zero attempted in `/='"
msgstr "cố gắng chia cho số không trong « /= »"
-#: eval.c:1539
+#: eval.c:1565
#, c-format
msgid "division by zero attempted in `%%='"
msgstr "cố gắng chia cho số không trong « %%= »"
-#: eval.c:1876 eval.c:2122
-#, c-format
-msgid "attempt to use array `%s[\"%.*s\"]' in a scalar context"
-msgstr "cố gắng dùng mảng `%s[\"%.*s\"]' trong một ngữ cảnh vô hướng"
-
-#: eval.c:1907
-msgid "assignment used in conditional context"
-msgstr "Ä‘iá»u gán được dùng trong ngữ cảnh Ä‘iá»u kiện"
-
-#: eval.c:1911
-msgid "statement has no effect"
-msgstr "câu không có tác dụng"
-
-#: eval.c:2343
-#, c-format
-msgid "for loop: array `%s' changed size from %ld to %ld during loop execution"
-msgstr ""
-"cho loop: (cho vòng lặp) mảng « %s » đã thay đổi kích thước từ %ld đến %ld "
-"trong khi thực hiện vòng lặp"
-
-#: eval.c:2458
-#, c-format
-msgid "function called indirectly through `%s' does not exist"
-msgstr "hàm được gá»i gián tiếp thông qua `%s' không tồn tại"
-
-#: eval.c:2470
-#, c-format
-msgid "function `%s' not defined"
-msgstr "chưa xác định hàm « %s »"
-
-#: eval.c:2511
-#, c-format
-msgid "non-redirected `getline' invalid inside `%s' rule"
-msgstr "`getline' không-gửi-lại không hợp lệ bên trong quy tắc `%s'"
-
-#: eval.c:2600
-#, c-format
-msgid "error reading input file `%s': %s"
-msgstr "gặp lá»—i khi Ä‘á»c tập tin nhập « %s »: %s"
-
-#: eval.c:2614
-#, c-format
-msgid "`nextfile' cannot be called from a `%s' rule"
-msgstr "«nextfile» (tập tin kế tiếp) không thể được gá»i từ má»™t quy tắc `%s'"
-
-#: eval.c:2661
-msgid "`exit' cannot be called in the current context"
-msgstr "`exit' (thoát) không thể được gá»i trong ngữ cảnh hiện hành"
-
-#: eval.c:2700
-#, c-format
-msgid "`next' cannot be called from a `%s' rule"
-msgstr "«next» (kế tiếp) không thể được gá»i từ má»™t quy tắc `%s'"
-
-#: eval.c:2766
-#, c-format
-msgid "Sorry, don't know how to interpret `%s'"
-msgstr "Rất tiếc, không biết làm cách nào để phiên dịch được `%s'"
-
-#: ext.c:54
+#: ext.c:49
msgid "extensions are not allowed in sandbox mode"
msgstr "phần mở rộng không cho phép ở chế độ khuôn đúc"
-#: ext.c:60 ext.c:65
-msgid "`extension' is a gawk extension"
-msgstr "« extension » là một phần mở rộng gawk"
+#: ext.c:52
+#, fuzzy
+msgid "-l / @load are gawk extensions"
+msgstr "@include là phần mở rộng của gawk"
-#: ext.c:75
-#, c-format
-msgid "fatal: extension: cannot open `%s' (%s)\n"
+#: ext.c:55
+msgid "load_ext: received NULL lib_name"
+msgstr ""
+
+#: ext.c:58
+#, fuzzy, c-format
+msgid "load_ext: cannot open library `%s' (%s)\n"
msgstr "nghiêm trá»ng: phần mở rá»™ng: không thể mở `%s' (%s)\n"
-#: ext.c:84
-#, c-format
+#: ext.c:64
+#, fuzzy, c-format
msgid ""
-"fatal: extension: library `%s': does not define "
-"`plugin_is_GPL_compatible' (%s)\n"
+"load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n"
msgstr ""
"nghiêm trá»ng: extension (phần mở rá»™ng): thÆ° viện « %s »: không thể định "
"nghĩa `plugin_is_GPL_compatible' (tương thích cắm là dùng GPL) (%s)\n"
-#: ext.c:93
-#, c-format
-msgid "fatal: extension: library `%s': cannot call function `%s' (%s)\n"
+#: ext.c:70
+#, fuzzy, c-format
+msgid "load_ext: library `%s': cannot call function `%s' (%s)\n"
msgstr ""
"nghiêm trá»ng: extension (phần mở rá»™ng): thÆ° viện « %s »: không thể gá»i hàm « "
"%s » (%s)\n"
-#: ext.c:127
-msgid "extension: missing function name"
+#: ext.c:74
+#, c-format
+msgid "load_ext: library `%s' initialization routine `%s' failed\n"
+msgstr ""
+
+#: ext.c:93
+#, fuzzy
+msgid "make_builtin: missing function name"
msgstr "extension: (phần mở rộng) tên hàm còn thiếu"
-#: ext.c:132
-#, c-format
-msgid "extension: illegal character `%c' in function name `%s'"
+#: ext.c:98
+#, fuzzy, c-format
+msgid "make_builtin: illegal character `%c' in function name `%s'"
msgstr ""
"extension: (phần mở rộng) gặp ký tự cấm « %c » nằm trong tên hàm « %s »"
-#: ext.c:141
-#, c-format
-msgid "extension: can't redefine function `%s'"
+#: ext.c:106
+#, fuzzy, c-format
+msgid "make_builtin: can't redefine function `%s'"
msgstr "extension: (phần mở rộng) không thể xác định lại hàm « %s »"
-#: ext.c:145
-#, c-format
-msgid "extension: function `%s' already defined"
+#: ext.c:110
+#, fuzzy, c-format
+msgid "make_builtin: function `%s' already defined"
msgstr "extension: (phần mở rộng) hàm « %s » đã được xác định"
-#: ext.c:150
-#, c-format
-msgid "extension: function name `%s' previously defined"
+#: ext.c:114
+#, fuzzy, c-format
+msgid "make_builtin: function name `%s' previously defined"
msgstr "tên hàm « %s » đã được xác định trước"
-#: ext.c:152
-#, c-format
-msgid "extension: can't use gawk built-in `%s' as function name"
+#: ext.c:116
+#, fuzzy, c-format
+msgid "make_builtin: can't use gawk built-in `%s' as function name"
msgstr ""
"extension: (phần mở rá»™ng) không thể dùng Ä‘iá»u có sẵn của gawk « %s » nhÆ° là "
"tên hàm"
-#: ext.c:156
+#: ext.c:119
#, c-format
msgid "make_builtin: negative argument count for function `%s'"
msgstr "make_builtin: đối số dành cho số đếm bị âm cho hàm `%s'"
-#: ext.c:259
+#: ext.c:183
#, c-format
msgid "function `%s' defined to take no more than %d argument(s)"
msgstr "hàm « %s » được xác định để chấp nhấn %d đối số tối đa"
-#: ext.c:262
+#: ext.c:186
#, c-format
msgid "function `%s': missing argument #%d"
msgstr "hàm « %s » còn thiếu đối số thứ %d"
-#: ext.c:279
+#: ext.c:203
#, c-format
msgid "function `%s': argument #%d: attempt to use scalar as an array"
msgstr "hàm « %s »: đối số thứ %d: cố gắng dùng Ä‘iá»u vô hÆ°á»›ng nhÆ° là mảng"
-#: ext.c:283
+#: ext.c:207
#, c-format
msgid "function `%s': argument #%d: attempt to use array as a scalar"
msgstr "hàm « %s »: đối số thứ %d: cố gắng dùng mảng nhÆ° là Ä‘iá»u vô hÆ°á»›ng"
-#: ext.c:296
-msgid "Operation Not Supported"
-msgstr "Thao tác không được hỗ trợ"
+#: ext.c:221
+msgid "dynamic loading of library not supported"
+msgstr ""
+
+#: extension/filefuncs.c:75
+#, fuzzy
+msgid "chdir: called with incorrect number of arguments, expecting 1"
+msgstr "sqrt: (căn bậc hai) đã gá»i vá»›i đối số âm « %g »"
+
+#: extension/filefuncs.c:348
+#, fuzzy
+msgid "stat: called with wrong number of arguments"
+msgstr "sqrt: (căn bậc hai) đã gá»i vá»›i đối số âm « %g »"
+
+#: extension/filefuncs.c:355
+#, fuzzy
+msgid "stat: bad parameters"
+msgstr "%s: là tham số\n"
+
+#: extension/filefuncs.c:421
+msgid "fill_stat_element: could not create array"
+msgstr ""
+
+#: extension/filefuncs.c:430
+msgid "fill_stat_element: could not set element"
+msgstr ""
+
+#: extension/filefuncs.c:445
+#, fuzzy
+msgid "fill_path_element: could not set element"
+msgstr "index: (chỉ mục) đã nhận đối số thứ hai không phải là chuỗi"
+
+#: extension/filefuncs.c:461
+msgid "fill_error_element: could not set element"
+msgstr ""
+
+#: extension/filefuncs.c:508 extension/filefuncs.c:555
+msgid "fts-process: could not create array"
+msgstr ""
+
+#: extension/filefuncs.c:518 extension/filefuncs.c:565
+#: extension/filefuncs.c:583
+#, fuzzy
+msgid "fts-process: could not set element"
+msgstr "index: (chỉ mục) đã nhận đối số thứ hai không phải là chuỗi"
+
+#: extension/filefuncs.c:632
+#, fuzzy
+msgid "fts: called with incorrect number of arguments, expecting 3"
+msgstr "sqrt: (căn bậc hai) đã gá»i vá»›i đối số âm « %g »"
+
+#: extension/filefuncs.c:635
+#, fuzzy
+msgid "fts: bad first parameter"
+msgstr "%s: là tham số\n"
+
+#: extension/filefuncs.c:641
+#, fuzzy
+msgid "fts: bad second parameter"
+msgstr "%s: là tham số\n"
+
+#: extension/filefuncs.c:647
+#, fuzzy
+msgid "fts: bad third parameter"
+msgstr "%s: là tham số\n"
+
+#: extension/filefuncs.c:654
+#, fuzzy
+msgid "fts: could not flatten array\n"
+msgstr "« %s » không phải là tên biến hợp lệ"
+
+#: extension/filefuncs.c:672
+msgid "fts: ignoring sneaky FTS_NOSTAT flag. nyah, nyah, nyah."
+msgstr ""
+
+#: extension/filefuncs.c:689
+msgid "fts: clear_array failed\n"
+msgstr ""
+
+#: extension/fnmatch.c:91
+#, fuzzy
+msgid "fnmatch: called with less than three arguments"
+msgstr "sqrt: (căn bậc hai) đã gá»i vá»›i đối số âm « %g »"
+
+#: extension/fnmatch.c:94
+#, fuzzy
+msgid "fnmatch: called with more than three arguments"
+msgstr "sqrt: (căn bậc hai) đã gá»i vá»›i đối số âm « %g »"
+
+#: extension/fnmatch.c:97
+#, fuzzy
+msgid "fnmatch: could not get first argument"
+msgstr "strftime: đã nhận đối số thứ nhất khác chuỗi"
+
+#: extension/fnmatch.c:102
+#, fuzzy
+msgid "fnmatch: could not get second argument"
+msgstr "index: (chỉ mục) đã nhận đối số thứ hai không phải là chuỗi"
+
+#: extension/fnmatch.c:107
+msgid "fnmatch: could not get third argument"
+msgstr ""
+
+#: extension/fnmatch.c:120
+msgid "fnmatch is not implemented on this system\n"
+msgstr ""
+
+#: extension/fnmatch.c:152
+msgid "fnmatch init: could not add FNM_NOMATCH variable"
+msgstr ""
-#: field.c:328
+#: extension/fnmatch.c:162
+#, c-format
+msgid "fnmatch init: could not set array element %s"
+msgstr ""
+
+#: extension/fnmatch.c:172
+msgid "fnmatch init: could not install FNM array"
+msgstr ""
+
+#: extension/fork.c:81
+#, fuzzy
+msgid "fork: called with too many arguments"
+msgstr "sqrt: (căn bậc hai) đã gá»i vá»›i đối số âm « %g »"
+
+#: extension/fork.c:94
+msgid "fork: PROCINFO is not an array!"
+msgstr ""
+
+#: extension/fork.c:118
+#, fuzzy
+msgid "waitpid: called with too many arguments"
+msgstr "sqrt: (căn bậc hai) đã gá»i vá»›i đối số âm « %g »"
+
+#: extension/fork.c:126
+#, fuzzy
+msgid "wait: called with no arguments"
+msgstr "sqrt: (căn bậc hai) đã gá»i vá»›i đối số âm « %g »"
+
+#: extension/fork.c:143
+#, fuzzy
+msgid "wait: called with too many arguments"
+msgstr "sqrt: (căn bậc hai) đã gá»i vá»›i đối số âm « %g »"
+
+#: extension/ordchr.c:69
+#, fuzzy
+msgid "ord: called with too many arguments"
+msgstr "sqrt: (căn bậc hai) đã gá»i vá»›i đối số âm « %g »"
+
+#: extension/ordchr.c:75
+#, fuzzy
+msgid "ord: called with no arguments"
+msgstr "sqrt: (căn bậc hai) đã gá»i vá»›i đối số âm « %g »"
+
+#: extension/ordchr.c:77
+#, fuzzy
+msgid "ord: called with inappropriate argument(s)"
+msgstr "sqrt: (căn bậc hai) đã gá»i vá»›i đối số âm « %g »"
+
+#: extension/ordchr.c:99
+#, fuzzy
+msgid "chr: called with too many arguments"
+msgstr "sqrt: (căn bậc hai) đã gá»i vá»›i đối số âm « %g »"
+
+#: extension/ordchr.c:109
+#, fuzzy
+msgid "chr: called with no arguments"
+msgstr "sqrt: (căn bậc hai) đã gá»i vá»›i đối số âm « %g »"
+
+#: extension/ordchr.c:111
+#, fuzzy
+msgid "chr: called with inappropriate argument(s)"
+msgstr "sqrt: (căn bậc hai) đã gá»i vá»›i đối số âm « %g »"
+
+#: extension/readfile.c:81
+#, fuzzy
+msgid "readfile: called with too many arguments"
+msgstr "sqrt: (căn bậc hai) đã gá»i vá»›i đối số âm « %g »"
+
+#: extension/readfile.c:114
+#, fuzzy
+msgid "readfile: called with no arguments"
+msgstr "sqrt: (căn bậc hai) đã gá»i vá»›i đối số âm « %g »"
+
+#: extension/rwarray.c:120
+#, fuzzy
+msgid "writea: called with too many arguments"
+msgstr "sqrt: (căn bậc hai) đã gá»i vá»›i đối số âm « %g »"
+
+#: extension/rwarray.c:127
+#, fuzzy, c-format
+msgid "do_writea: argument 0 is not a string\n"
+msgstr "exp: đối số « %g » ở ngoại phạm vị"
+
+#: extension/rwarray.c:133
+#, fuzzy, c-format
+msgid "do_writea: argument 1 is not an array\n"
+msgstr "split (chia tách): đối số thứ tư không phải là mảng"
+
+#: extension/rwarray.c:180
+#, c-format
+msgid "write_array: could not flatten array\n"
+msgstr ""
+
+#: extension/rwarray.c:194
+#, c-format
+msgid "write_array: could not release flattened array\n"
+msgstr ""
+
+#: extension/rwarray.c:276
+#, fuzzy
+msgid "reada: called with too many arguments"
+msgstr "sqrt: (căn bậc hai) đã gá»i vá»›i đối số âm « %g »"
+
+#: extension/rwarray.c:283
+#, fuzzy, c-format
+msgid "do_reada: argument 0 is not a string\n"
+msgstr "exp: đối số « %g » ở ngoại phạm vị"
+
+#: extension/rwarray.c:289
+#, fuzzy, c-format
+msgid "do_reada: argument 1 is not an array\n"
+msgstr "match: (khớp) đối số thứ ba không phải là mảng"
+
+#: extension/rwarray.c:333
+#, c-format
+msgid "do_reada: clear_array failed\n"
+msgstr ""
+
+#: extension/rwarray.c:370
+#, c-format
+msgid "read_array: set_array_element failed\n"
+msgstr ""
+
+#: extension/time.c:78
+#, fuzzy
+msgid "gettimeofday: ignoring arguments"
+msgstr "mktime: đã nhận đối số khác chuỗi"
+
+#: extension/time.c:109
+msgid "gettimeofday: not supported on this platform"
+msgstr ""
+
+#: extension/time.c:130
+#, fuzzy
+msgid "sleep: called with too many arguments"
+msgstr "sqrt: (căn bậc hai) đã gá»i vá»›i đối số âm « %g »"
+
+#: extension/time.c:133
+#, fuzzy
+msgid "sleep: missing required numeric argument"
+msgstr "exp: đã nhận đối số không phải thuộc số"
+
+#: extension/time.c:139
+#, fuzzy
+msgid "sleep: argument is negative"
+msgstr "exp: đối số « %g » ở ngoại phạm vị"
+
+#: extension/time.c:166
+msgid "sleep: not supported on this platform"
+msgstr ""
+
+#: field.c:339
msgid "NF set to negative value"
msgstr "« NF » được đặt thành giá trị âm"
-#: field.c:951 field.c:958 field.c:962
+#: field.c:962 field.c:969 field.c:973
msgid "split: fourth argument is a gawk extension"
msgstr "split (chia tách): đối số thứ tư là phần mở rộng gawk"
-#: field.c:955
+#: field.c:966
msgid "split: fourth argument is not an array"
msgstr "split (chia tách): đối số thứ tư không phải là mảng"
-#: field.c:969
+#: field.c:980
msgid "split: second argument is not an array"
msgstr "split: (chia tách) đối số thứ hai không phải là mảng"
-#: field.c:973
+#: field.c:984
msgid "split: cannot use the same array for second and fourth args"
msgstr ""
"split (chia tách): không thể sử dụng cùng một mảng có cả đối số thứ hai và "
"thứ tư"
-#: field.c:978
+#: field.c:989
msgid "split: cannot use a subarray of second arg for fourth arg"
msgstr ""
"split (phân tách): không thể sử dụng mảng con của tham số thứ hai cho tham "
"số thứ tư"
-#: field.c:981
+#: field.c:992
msgid "split: cannot use a subarray of fourth arg for second arg"
msgstr ""
"split (phân tách): không thể sử dụng mảng con của tham số thứ tư cho tham số "
"thứ hai"
-#: field.c:1010
+#: field.c:1021
msgid "split: null string for third arg is a gawk extension"
msgstr ""
"split: (chia tách) chuỗi vô giá trị cho đối số thứ ba là phần mở rộng gawk"
-#: field.c:1050
+#: field.c:1061
msgid "patsplit: fourth argument is not an array"
msgstr "patsplit: đối số thứ tư không phải là mảng"
-#: field.c:1055
+#: field.c:1066
msgid "patsplit: second argument is not an array"
msgstr "patsplit: đối số thứ hai không phải là mảng"
-#: field.c:1061
+#: field.c:1072
msgid "patsplit: third argument must be non-null"
msgstr "patsplit: đối số thứ ba không phải không rỗng"
-#: field.c:1065
+#: field.c:1076
msgid "patsplit: cannot use the same array for second and fourth args"
msgstr ""
"patsplit (chương trình chia tách): không thể sử dụng cùng một mảng cho cả "
"hai đối số thứ hai và thứ tư"
-#: field.c:1070
+#: field.c:1081
msgid "patsplit: cannot use a subarray of second arg for fourth arg"
msgstr ""
"patsplit (chương trình phân tách): không thể sử dụng mảng con của tham số "
"thứ hai cho tham số thứ tư"
-#: field.c:1073
+#: field.c:1084
msgid "patsplit: cannot use a subarray of fourth arg for second arg"
msgstr ""
"patsplit (chương trình phân tách): không thể sử dụng mảng con của tham số "
"thứ tư cho tham số thứ hai"
-#: field.c:1110
+#: field.c:1122
msgid "`FIELDWIDTHS' is a gawk extension"
msgstr "« FIELDWIDTHS » (Ä‘á»™ rá»™ng trÆ°á»ng) là phần mở rá»™ng gawk"
-#: field.c:1173
+#: field.c:1186
#, c-format
msgid "invalid FIELDWIDTHS value, near `%s'"
msgstr "giá trị FIELDWIDTHS (Ä‘á»™ rá»™ng trÆ°á»ng) không hợp lệ, gần « %s »"
-#: field.c:1246
+#: field.c:1259
msgid "null string for `FS' is a gawk extension"
msgstr "chuỗi vô giá trị cho « FS » là phần mở rộng gawk"
-#: field.c:1250
+#: field.c:1263
msgid "old awk does not support regexps as value of `FS'"
msgstr "awk cũ không hỗ trợ biểu thức chính quy làm giá trị của « FS »"
-#: field.c:1369
+#: field.c:1382
msgid "`FPAT' is a gawk extension"
msgstr "`FPAT' là phần mở rộng của gawk"
+#: gawkapi.c:143
+msgid "awk_value_to_node: received null retval"
+msgstr ""
+
+#: gawkapi.c:932
+#, c-format
+msgid "api_flatten_array: could not convert index %d\n"
+msgstr ""
+
+#: gawkapi.c:937
+#, c-format
+msgid "api_flatten_array: could not convert value %d\n"
+msgstr ""
+
+#: gawkapi.c:1111
+msgid "cannot assign to defined constant"
+msgstr ""
+
#: getopt.c:604 getopt.c:633
#, fuzzy, c-format
msgid "%s: option '%s' is ambiguous; possibilities:"
@@ -1365,481 +2440,545 @@ msgstr "%s: tùy chá»n « -W %s » không cho phép đối số\n"
msgid "%s: option '-W %s' requires an argument\n"
msgstr "%s: tùy chá»n « -W %s » yêu cầu má»™t đối số\n"
-#: io.c:280
+#: io.c:339
#, c-format
msgid "command line argument `%s' is a directory: skipped"
msgstr "tham số dòng lệnh `%s' là một thư mục: đã bị bỠqua"
-#: io.c:283 io.c:385
+#: io.c:342 io.c:455
#, c-format
msgid "cannot open file `%s' for reading (%s)"
msgstr "không mở được tập tin « %s » để Ä‘á»c (%s)"
-#: io.c:501
+#: io.c:582
#, c-format
msgid "close of fd %d (`%s') failed (%s)"
msgstr "lỗi đóng fd %d (« %s ») (%s)"
-#: io.c:578
+#: io.c:658
msgid "redirection not allowed in sandbox mode"
msgstr "chuyển hướng không cho phép ở chế độ khuôn đúc"
-#: io.c:612
+#: io.c:692
#, c-format
msgid "expression in `%s' redirection only has numeric value"
msgstr "biểu thức trong Ä‘iá»u chuyển hÆ°á»›ng « %s » chỉ có giá trị thuá»™c số"
-#: io.c:618
+#: io.c:698
#, c-format
msgid "expression for `%s' redirection has null string value"
msgstr "biểu thức cho Ä‘iá»u chuyển hÆ°á»›ng « %s » có giá trị chuá»—i vô giá trị"
-#: io.c:623
+#: io.c:703
#, c-format
msgid "filename `%s' for `%s' redirection may be result of logical expression"
msgstr ""
"tên tập tin « %s » cho Ä‘iá»u chuyển hÆ°á»›ng « %s » có lẽ là kết quả của biểu "
"thức luận lý"
-#: io.c:666
+#: io.c:746
#, c-format
msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
msgstr "không cần hợp « > » và « >> » cho tập tin « %.*s »"
-#: io.c:719
+#: io.c:799
#, c-format
msgid "can't open pipe `%s' for output (%s)"
msgstr "không thể mở ống dẫn « %s » để xuất (%s)"
-#: io.c:729
+#: io.c:809
#, c-format
msgid "can't open pipe `%s' for input (%s)"
msgstr "không thể mở ống dẫn « %s » để nhập (%s)"
-#: io.c:752
+#: io.c:840
#, c-format
msgid "can't open two way pipe `%s' for input/output (%s)"
msgstr "không thể mở ống dẫn hai chiá»u « %s » để nhập/xuất (%s)"
-#: io.c:834
+#: io.c:923
#, c-format
msgid "can't redirect from `%s' (%s)"
msgstr "không thể chuyển hướng từ « %s » (%s)"
-#: io.c:837
+#: io.c:926
#, c-format
msgid "can't redirect to `%s' (%s)"
msgstr "không thể chuyển hướng đến « %s » (%s)"
-#: io.c:888
+#: io.c:977
msgid ""
"reached system limit for open files: starting to multiplex file descriptors"
msgstr ""
"đã tá»›i giá»›i hạn hệ thống vá» tập tin được mở nên bắt đầu phối hợp nhiá»u dòng "
"Ä‘iá»u mô tả tập tin"
-#: io.c:904
+#: io.c:993
#, c-format
msgid "close of `%s' failed (%s)."
msgstr "lỗi đóng « %s » (%s)"
-#: io.c:912
+#: io.c:1001
msgid "too many pipes or input files open"
msgstr "quá nhiá»u ống dẫn hay tập tin nhập được mở"
-#: io.c:934
+#: io.c:1023
msgid "close: second argument must be `to' or `from'"
msgstr "close: (đóng) đối số thứ hai phải là « to » (đến) hay « from » (từ)"
-#: io.c:951
+#: io.c:1040
#, c-format
msgid "close: `%.*s' is not an open file, pipe or co-process"
msgstr ""
"close: (đóng) « %.*s » không phải là tập tin được mở, ống dẫn hay tiến trình "
"vá»›i nhau"
-#: io.c:956
+#: io.c:1045
msgid "close of redirection that was never opened"
msgstr "việc đóng Ä‘iá»u chuyển hÆ°á»›ng chÆ°a mở"
-#: io.c:1053
+#: io.c:1142
#, c-format
msgid "close: redirection `%s' not opened with `|&', second argument ignored"
msgstr ""
"close: (đóng) Ä‘iá»u chuyển hÆ°á»›ng « %s » không được mở bởi « |& » nên đối số "
"thứ hai bị bỠqua"
-#: io.c:1069
+#: io.c:1159
#, c-format
msgid "failure status (%d) on pipe close of `%s' (%s)"
msgstr "trạng thái thất bại (%d) khi đóng ống dẫn « %s » (%s)"
-#: io.c:1072
+#: io.c:1162
#, c-format
msgid "failure status (%d) on file close of `%s' (%s)"
msgstr "trạng thái thất bại (%d) khi đóng tập tin « %s » (%s)"
-#: io.c:1092
+#: io.c:1182
#, c-format
msgid "no explicit close of socket `%s' provided"
msgstr "không có việc đóng dứt khoát ổ cắm « %s » được cung cấp"
-#: io.c:1095
+#: io.c:1185
#, c-format
msgid "no explicit close of co-process `%s' provided"
msgstr "không có việc đóng dứt khoát đồng tiến trình « %s » được cung cấp"
-#: io.c:1098
+#: io.c:1188
#, c-format
msgid "no explicit close of pipe `%s' provided"
msgstr "không có việc đóng dứt khoát ống dẫn « %s » được cung cấp"
-#: io.c:1101
+#: io.c:1191
#, c-format
msgid "no explicit close of file `%s' provided"
msgstr "không có việc đóng dứt khoát tập tin « %s » được cung cấp"
-#: io.c:1129 io.c:1184 main.c:797 main.c:834
+#: io.c:1219 io.c:1274 main.c:847 main.c:884
#, c-format
msgid "error writing standard output (%s)"
msgstr "gặp lỗi khi ghi thiết bị xụất chuẩn (%s)"
-#: io.c:1133 io.c:1189
+#: io.c:1223 io.c:1279
#, c-format
msgid "error writing standard error (%s)"
msgstr "gặp lỗi khi ghi thiết bị lỗi chuẩn (%s)"
-#: io.c:1141
+#: io.c:1231
#, c-format
msgid "pipe flush of `%s' failed (%s)."
msgstr "lỗi xoá sạch ống dẫn « %s » (%s)"
-#: io.c:1144
+#: io.c:1234
#, c-format
msgid "co-process flush of pipe to `%s' failed (%s)."
msgstr "lỗi xoá sạch ống dẫn đồng tiến trình đến « %s » (%s)"
-#: io.c:1147
+#: io.c:1237
#, c-format
msgid "file flush of `%s' failed (%s)."
msgstr "lỗi xoá sạch tập tin « %s » (%s)"
-#: io.c:1262
+#: io.c:1351
#, c-format
msgid "local port %s invalid in `/inet'"
msgstr "cổng cục bộ %s không hợp lệ trong « /inet »"
-#: io.c:1279
+#: io.c:1369
#, c-format
msgid "remote host and port information (%s, %s) invalid"
msgstr "thông tin vỠmáy/cổng ở xa (%s, %s) không phải hợp lệ"
-#: io.c:1431
+#: io.c:1521
#, c-format
msgid "no (known) protocol supplied in special filename `%s'"
msgstr ""
"trong tên tập tin đặc biệt « %s » không cung cấp giao thức (đã biết) nào"
-#: io.c:1445
+#: io.c:1535
#, c-format
msgid "special file name `%s' is incomplete"
msgstr "tên tập tin đặc biệt « %s » chưa xong"
-#: io.c:1462
+#: io.c:1552
msgid "must supply a remote hostname to `/inet'"
msgstr "phải cung cấp một tên máy từ xa cho </inet>"
-#: io.c:1480
+#: io.c:1570
msgid "must supply a remote port to `/inet'"
msgstr "phải cung cấp một cổng từ xa cho </inet>"
-#: io.c:1526
+#: io.c:1616
msgid "TCP/IP communications are not supported"
msgstr "truyá»n thông TCP/IP không được há»— trợ"
-#: io.c:1693
+#: io.c:1785
#, c-format
msgid "could not open `%s', mode `%s'"
msgstr "không mở được « %s », chế độ « %s »"
-#: io.c:1747
+#: io.c:1835
#, c-format
msgid "close of master pty failed (%s)"
msgstr "lỗi đóng pty (tài sản?) chính (%s)"
-#: io.c:1749 io.c:1917 io.c:2074
+#: io.c:1837 io.c:2012 io.c:2181
#, c-format
msgid "close of stdout in child failed (%s)"
msgstr "lỗi đóng thiết bị xuất chuẩn trong tiến trình con (%s)"
-#: io.c:1752
+#: io.c:1840
#, c-format
msgid "moving slave pty to stdout in child failed (dup: %s)"
msgstr ""
"lá»—i di chuyển pty (tài sản?) phụ tá»›i thiết bị xuất chuẩn trong Ä‘iá»u con "
"(nhân đôi: %s)"
-#: io.c:1754 io.c:1922
+#: io.c:1842 io.c:2017
#, c-format
msgid "close of stdin in child failed (%s)"
msgstr "lỗi đóng thiết bị nhập chuẩn trong tiến trình con (%s)"
-#: io.c:1757
+#: io.c:1845
#, c-format
msgid "moving slave pty to stdin in child failed (dup: %s)"
msgstr ""
"lá»—i di chuyển pty (tài sản?) phụ tá»›i thiết bị nhập chuẩn trong Ä‘iá»u con "
"(nhân đôi: %s)"
-#: io.c:1759 io.c:1780
+#: io.c:1847 io.c:1868
#, c-format
msgid "close of slave pty failed (%s)"
msgstr "lỗi đóng pty (tài sản?) phụ (%s)"
-#: io.c:1858 io.c:1920 io.c:2052 io.c:2077
+#: io.c:1953 io.c:2015 io.c:2158 io.c:2184
#, c-format
msgid "moving pipe to stdout in child failed (dup: %s)"
msgstr ""
"lỗi di chuyển ống dẫn đến thiết bị xuất chuẩn trong tiến trình con (dup: %s) "
"(nhân đôi)"
-#: io.c:1865 io.c:1925
+#: io.c:1960 io.c:2020
#, c-format
msgid "moving pipe to stdin in child failed (dup: %s)"
msgstr ""
"lỗi di chuyển ống dẫn đến thiết bị nhập chuẩn trong tiến trình con (dup: %s) "
"(nhân đôi)"
-#: io.c:1885 io.c:2067
+#: io.c:1980 io.c:2174
msgid "restoring stdout in parent process failed\n"
msgstr "lỗi phục hồi thiết bị xuất chuẩn trong tiến trình mẹ\n"
-#: io.c:1893
+#: io.c:1988
msgid "restoring stdin in parent process failed\n"
msgstr "lỗi phục hồi thiết bị nhập chuẩn trong tiến trình mẹ\n"
-#: io.c:1928 io.c:2079 io.c:2093
+#: io.c:2023 io.c:2186 io.c:2200
#, c-format
msgid "close of pipe failed (%s)"
msgstr "lỗi đóng ống dẫn (%s)"
-#: io.c:1973
+#: io.c:2076
msgid "`|&' not supported"
msgstr "« |& » không được hỗ trợ"
-#: io.c:2039
+#: io.c:2143
#, c-format
msgid "cannot open pipe `%s' (%s)"
msgstr "không thể mở ống dẫn « %s » (%s)"
-#: io.c:2087
+#: io.c:2194
#, c-format
msgid "cannot create child process for `%s' (fork: %s)"
msgstr "không thể tạo tiến trình con cho « %s » (fork: %s)"
-#: io.c:2520
+#: io.c:2652
+msgid "register_input_parser: received NULL pointer"
+msgstr ""
+
+#: io.c:2680
+#, c-format
+msgid "input parser `%s' conflicts with previously installed input parser `%s'"
+msgstr ""
+
+#: io.c:2687
+#, c-format
+msgid "input parser `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2707
+msgid "register_output_wrapper: received NULL pointer"
+msgstr ""
+
+#: io.c:2735
+#, c-format
+msgid ""
+"output wrapper `%s' conflicts with previously installed output wrapper `%s'"
+msgstr ""
+
+#: io.c:2742
+#, c-format
+msgid "output wrapper `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2763
+msgid "register_output_processor: received NULL pointer"
+msgstr ""
+
+#: io.c:2792
+#, c-format
+msgid ""
+"two-way processor `%s' conflicts with previously installed two-way processor "
+"`%s'"
+msgstr ""
+
+#: io.c:2801
+#, c-format
+msgid "two way processor `%s' failed to open `%s'"
+msgstr ""
+
+#: io.c:2908
#, c-format
msgid "data file `%s' is empty"
msgstr "tập tin dữ liệu « %s » là rỗng"
-#: io.c:2561 io.c:2569
+#: io.c:2950 io.c:2958
msgid "could not allocate more input memory"
msgstr "không thể cấp phát bộ nhớ nhập thêm nữa"
-#: io.c:3127
+#: io.c:3524
msgid "multicharacter value of `RS' is a gawk extension"
msgstr "giá trị đa ký tự của « RS » là phần mở rộng gawk"
-#: io.c:3232
+#: io.c:3613
msgid "IPv6 communication is not supported"
msgstr "Truyá»n thông trên IPv6 không được há»— trợ"
-#: main.c:366
+#: main.c:362
msgid "`-m[fr]' option irrelevant in gawk"
msgstr "tùy chá»n « -m[fr] » không thích Ä‘ang trong gawk"
-#: main.c:368
+#: main.c:364
msgid "-m option usage: `-m[fr] nnn'"
msgstr "cách sá»­ dụng tùy chá»n « -m »: « -m[fr] nnn »"
-#: main.c:391
+#: main.c:393
msgid "empty argument to `-e/--source' ignored"
msgstr "đối số rá»—ng cho tuỳ chá»n `-e/--source' bị bá» qua"
-#: main.c:462
+#: main.c:483
#, c-format
msgid "%s: option `-W %s' unrecognized, ignored\n"
msgstr "%s: tùy chá»n « -W %s » không được nhận diện nên bị bá» qua\n"
-#: main.c:515
+#: main.c:529
#, c-format
msgid "%s: option requires an argument -- %c\n"
msgstr "%s: tùy chá»n cần đến đối số « -- %c »\n"
-#: main.c:536
+#: main.c:550
msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
msgstr ""
"biến môi trÆ°á»ng « POSIXLY_CORRECT » (đúng kiểu POSIX) đã được đặt; Ä‘ang bật "
"tùy chá»n « --posix »"
-#: main.c:542
+#: main.c:556
msgid "`--posix' overrides `--traditional'"
msgstr "tùy chá»n « --posix » có quyá»n cao hÆ¡n « --traditional » (truyá»n thống)"
-#: main.c:553
+#: main.c:567
msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
msgstr ""
"« --posix »/« --traditional » (truyá»n thống) có quyá»n cao hÆ¡n « --non-"
"decimal-data » (dữ liệu khác thập phân)"
-#: main.c:557
+#: main.c:571
#, c-format
msgid "running %s setuid root may be a security problem"
msgstr "việc chạy %s với tư cách « setuid root » có thể rủi rỠbảo mật"
-#: main.c:562
+#: main.c:576
#, fuzzy
msgid "`--posix' overrides `--characters-as-bytes'"
msgstr "`--posix' đè lên `--binary'"
-#: main.c:616
+#: main.c:635
#, c-format
msgid "can't set binary mode on stdin (%s)"
msgstr "không thể đặt chế độ nhị phân trên thiết bị nhập chuẩn (%s)"
-#: main.c:619
+#: main.c:638
#, c-format
msgid "can't set binary mode on stdout (%s)"
msgstr "không thể đặt chế độ nhị phân trên thiết bị xuất chuẩn (%s)"
-#: main.c:621
+#: main.c:640
#, c-format
msgid "can't set binary mode on stderr (%s)"
msgstr "không thể đặt chế độ nhị phân trên thiết bị lỗi chuẩn (%s)"
-#: main.c:660
+#: main.c:698
msgid "no program text at all!"
msgstr "không có đoạn chữ chương trình nào cả !"
-#: main.c:737
+#: main.c:784
#, c-format
msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"
msgstr ""
"Cách sá»­ dụng: %s [tùy chá»n kiểu POSIX hay GNU] -f tập_tin_chÆ°Æ¡ng_trình [--] "
"tập_tin ...\n"
-#: main.c:739
+#: main.c:786
#, c-format
msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"
msgstr ""
"Cách sá»­ dụng: %s [tùy chá»n kiểu POSIX hay GNU] [--] %cchÆ°Æ¡ng_trình%c "
"tập_tin ...\n"
-#: main.c:744
+#: main.c:791
msgid "POSIX options:\t\tGNU long options: (standard)\n"
msgstr "Tùy chá»n POSIX:\t\tTùy chá»n dài GNU: (theo tiêu chuẩn)\n"
-#: main.c:745
+#: main.c:792
msgid "\t-f progfile\t\t--file=progfile\n"
msgstr "\t-f tập_tin_chương_trình\t\t--file=tập_tin_chương_trình\n"
-#: main.c:746
+#: main.c:793
msgid "\t-F fs\t\t\t--field-separator=fs\n"
msgstr "\t-F fs\t\t\t--field-separator=Ä‘iá»u phân cách trÆ°á»ng\n"
-#: main.c:747
+#: main.c:794
msgid "\t-v var=val\t\t--assign=var=val\n"
msgstr ""
"\t-v var=giá trị\t\t--assign=biến=giá_trị\n"
"(assign: gán)\n"
-#: main.c:748
+#: main.c:795
msgid "Short options:\t\tGNU long options: (extensions)\n"
msgstr "Tuỳ chá»n ngắn:\t\tTuỳ chá»n GNU dạng dài: (phần mở rá»™ng)\n"
-#: main.c:749
+#: main.c:796
msgid "\t-b\t\t\t--characters-as-bytes\n"
msgstr "\t-b\t\t\t--characters-as-bytes\n"
-#: main.c:750
+#: main.c:797
msgid "\t-c\t\t\t--traditional\n"
msgstr "\t-c\t\t\t--traditional\n"
-#: main.c:751
+#: main.c:798
msgid "\t-C\t\t\t--copyright\n"
msgstr "\t-C\t\t\t--copyright\n"
-#: main.c:752
+#: main.c:799
msgid "\t-d[file]\t\t--dump-variables[=file]\n"
msgstr "\t-d[tệp_tin]\t\t--dump-variables[=tệp_tin]\n"
-#: main.c:753
+#: main.c:800
+#, fuzzy
+msgid "\t-D[file]\t\t--debug[=file]\n"
+msgstr "\t-p[file]\t\t--profile[=file]\n"
+
+#: main.c:801
msgid "\t-e 'program-text'\t--source='program-text'\n"
msgstr "\t-e 'program-text'\t--source='program-text'\n"
-#: main.c:754
+#: main.c:802
msgid "\t-E file\t\t\t--exec=file\n"
msgstr "\t-E file\t\t\t--exec=tệp_tin\n"
-#: main.c:755
+#: main.c:803
msgid "\t-g\t\t\t--gen-pot\n"
msgstr "\t-g\t\t\t--gen-pot\n"
-#: main.c:756
+#: main.c:804
msgid "\t-h\t\t\t--help\n"
msgstr "\t-h\t\t\t--help\n"
-#: main.c:757
+#: main.c:805
+msgid "\t-i includefile\t\t--include=includefile\n"
+msgstr ""
+
+#: main.c:806
+msgid "\t-l library\t\t--load=library\n"
+msgstr ""
+
+#: main.c:807
msgid "\t-L [fatal]\t\t--lint[=fatal]\n"
msgstr "\t-L [fatal]\t\t--lint[=fatal]\n"
-#: main.c:758
+#: main.c:808
msgid "\t-n\t\t\t--non-decimal-data\n"
msgstr "\t-n\t\t\t--non-decimal-data\n"
-#: main.c:759
+#: main.c:809
+#, fuzzy
+msgid "\t-M\t\t\t--bignum\n"
+msgstr "\t-g\t\t\t--gen-pot\n"
+
+#: main.c:810
msgid "\t-N\t\t\t--use-lc-numeric\n"
msgstr "\t-N\t\t\t--use-lc-numeric\n"
-#: main.c:760
+#: main.c:811
+#, fuzzy
+msgid "\t-o[file]\t\t--pretty-print[=file]\n"
+msgstr "\t-p[file]\t\t--profile[=file]\n"
+
+#: main.c:812
msgid "\t-O\t\t\t--optimize\n"
msgstr "\t-O\t\t\t--optimize\ttối ưu hoá\n"
-#: main.c:761
+#: main.c:813
msgid "\t-p[file]\t\t--profile[=file]\n"
msgstr "\t-p[file]\t\t--profile[=file]\n"
-#: main.c:762
+#: main.c:814
msgid "\t-P\t\t\t--posix\n"
msgstr "\t-P\t\t\t--posix\n"
-#: main.c:763
+#: main.c:815
msgid "\t-r\t\t\t--re-interval\n"
msgstr "\t-r\t\t\t--re-interval\n"
-#: main.c:765
-msgid "\t-R file\t\t\t--command=file\n"
-msgstr "\t-R file\t\t\t--command=tệp_tin\n"
-
-#: main.c:766
+#: main.c:816
msgid "\t-S\t\t\t--sandbox\n"
msgstr "\t-S\t\t\t--sandbox\n"
-#: main.c:767
+#: main.c:817
msgid "\t-t\t\t\t--lint-old\n"
msgstr "\t-t\t\t\t--lint-old\n"
-#: main.c:768
+#: main.c:818
msgid "\t-V\t\t\t--version\n"
msgstr "\t-V\t\t\t--version\n"
-#: main.c:770
+#: main.c:820
msgid "\t-W nostalgia\t\t--nostalgia\n"
msgstr ""
"\t-W nostalgia\t\t--nostalgia\n"
"(nỗi luyến tiếc quá khứ)\n"
-#: main.c:773
+#: main.c:823
msgid "\t-Y\t\t--parsedebug\n"
msgstr "\t-Y\t\t--parsedebug\n"
@@ -1848,7 +2987,7 @@ msgstr "\t-Y\t\t--parsedebug\n"
#. for this application. Please add _another line_ with the
#. address for translation bugs.
#. no-wrap
-#: main.c:782
+#: main.c:832
msgid ""
"\n"
"To report bugs, see node `Bugs' in `gawk.info', which is\n"
@@ -1862,7 +3001,7 @@ msgstr ""
"trong bản in.\n"
"\n"
-#: main.c:786
+#: main.c:836
msgid ""
"gawk is a pattern scanning and processing language.\n"
"By default it reads standard input and writes standard output.\n"
@@ -1872,7 +3011,7 @@ msgstr ""
"Mặc định là nó Ä‘á»c thiết bị nhập chuẩn và ghi ra thiết bị xuất chuẩn.\n"
"\n"
-#: main.c:790
+#: main.c:840
msgid ""
"Examples:\n"
"\tgawk '{ sum += $1 }; END { print sum }' file\n"
@@ -1882,7 +3021,7 @@ msgstr ""
"\tgawk '{ sum += $1 }; END { print sum }' file\n"
"\tgawk -F: '{ print $1 }' /etc/passwd\n"
-#: main.c:810
+#: main.c:860
#, c-format
msgid ""
"Copyright (C) 1989, 1991-%d Free Software Foundation.\n"
@@ -1901,7 +3040,7 @@ msgstr ""
"kỳ phiên bản sau nào.\n"
"\n"
-#: main.c:818
+#: main.c:868
msgid ""
"This program is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
@@ -1915,7 +3054,7 @@ msgstr ""
"Hãy xem Bản Quyá»n Công Chung GNU (GPL) để tìm chi tiết.\n"
"\n"
-#: main.c:824
+#: main.c:874
msgid ""
"You should have received a copy of the GNU General Public License\n"
"along with this program. If not, see http://www.gnu.org/licenses/.\n"
@@ -1924,16 +3063,16 @@ msgstr ""
"cùng với chương trình này. Không thì xem địa chỉ « http://www.gnu.org/"
"licenses/ ».\n"
-#: main.c:859
+#: main.c:909
msgid "-Ft does not set FS to tab in POSIX awk"
msgstr "-Ft không đặt FS (hệ thống tập tin?) là tab trong awk POSIX"
-#: main.c:1093
+#: main.c:1169
#, c-format
msgid "unknown value for field spec: %d\n"
msgstr "không hiểu giá trị dành cho đặc tính trÆ°á»ng: %d\n"
-#: main.c:1174
+#: main.c:1267
#, c-format
msgid ""
"%s: `%s' argument to `-v' not in `var=value' form\n"
@@ -1942,79 +3081,145 @@ msgstr ""
"%s: đối số « %s » đối với « -v » không phải có dạng « biến=giá_trị »\n"
"\n"
-#: main.c:1200
+#: main.c:1293
#, c-format
msgid "`%s' is not a legal variable name"
msgstr "« %s » không phải là tên biến hợp lệ"
-#: main.c:1203
+#: main.c:1296
#, c-format
msgid "`%s' is not a variable name, looking for file `%s=%s'"
msgstr "« %s » không phải là tên biến; đang tìm tập tin « %s=%s »"
-#: main.c:1207
+#: main.c:1300
#, c-format
msgid "cannot use gawk builtin `%s' as variable name"
msgstr "không thể dùng builtin (dựng sẵn) của gawk « %s » như là tên biến"
-#: main.c:1212
+#: main.c:1305
#, c-format
msgid "cannot use function `%s' as variable name"
msgstr "không thể dùng hàm « %s » như là tên biến"
-#: main.c:1265
+#: main.c:1358
msgid "floating point exception"
msgstr "ngoại lệ điểm phù động"
-#: main.c:1272
+#: main.c:1365
msgid "fatal error: internal error"
msgstr "lá»—i nghiêm trá»ng: lá»—i ná»™i bá»™"
-#: main.c:1287
+#: main.c:1380
msgid "fatal error: internal error: segfault"
msgstr "lá»—i nghiêm trá»ng: lá»—i ná»™i bá»™ : lá»—i chia ra từng Ä‘oạn"
-#: main.c:1299
+#: main.c:1392
msgid "fatal error: internal error: stack overflow"
msgstr "lá»—i nghiêm trá»ng: lá»—i ná»™i bá»™ : tràn đống"
-#: main.c:1349
+#: main.c:1448
#, c-format
msgid "no pre-opened fd %d"
msgstr "không có fd (chỉ thị tập tin?) %d đã mở trước"
-#: main.c:1356
+#: main.c:1455
#, c-format
msgid "could not pre-open /dev/null for fd %d"
msgstr "không thể mở sẵn « /dev/null » cho fd %d"
-#: msg.c:63
+#: mpfr.c:563
+#, fuzzy, c-format
+msgid "PREC value `%.*s' is invalid"
+msgstr "Giá trị BINMODE (chế độ nhị phân) « %s » không hợp lệ nên thấy là 3"
+
+#: mpfr.c:621
+#, fuzzy, c-format
+msgid "RNDMODE value `%.*s' is invalid"
+msgstr "Giá trị BINMODE (chế độ nhị phân) « %s » không hợp lệ nên thấy là 3"
+
+#: mpfr.c:711
+#, fuzzy, c-format
+msgid "%s: received non-numeric argument"
+msgstr "cos: đã nhận đối số không phải thuộc số"
+
+#: mpfr.c:813
+#, fuzzy
+msgid "compl(%Rg): negative value will give strange results"
+msgstr "compl(%lf): (biên dịch) giá trị âm sẽ gây ra kết quả lạ"
+
+#: mpfr.c:817
+#, fuzzy
+msgid "comp(%Rg): fractional value will be truncated"
+msgstr "compl(%lf): (biên dịch) giá trị thuộc phân số se bị xén ngắn"
+
+#: mpfr.c:829
+#, fuzzy, c-format
+msgid "cmpl(%Zd): negative values will give strange results"
+msgstr "compl(%lf): (biên dịch) giá trị âm sẽ gây ra kết quả lạ"
+
+#: mpfr.c:856
+#, fuzzy, c-format
+msgid "%s: received non-numeric first argument"
+msgstr "or: (hoặc) đã nhận đối số đầu không phải thuộc số"
+
+#: mpfr.c:858
+#, fuzzy, c-format
+msgid "%s: received non-numeric second argument"
+msgstr "or: (hoặc) đã nhận đối số thứ hai khác thuộc số"
+
+#: mpfr.c:877
+#, fuzzy
+msgid "%s(%Rg, ..): negative values will give strange results"
+msgstr "or(%lf, %lf): (hoặc) giá trị âm sẽ gây ra kết quả lạ"
+
+#: mpfr.c:882
+#, fuzzy
+msgid "%s(%Rg, ..): fractional values will be truncated"
+msgstr "or(%lf, %lf): (hoặc) giá trị thuộc phân số sẽ bị xén ngắn"
+
+#: mpfr.c:895
+#, fuzzy, c-format
+msgid "%s(%Zd, ..): negative values will give strange results"
+msgstr "or(%lf, %lf): (hoặc) giá trị âm sẽ gây ra kết quả lạ"
+
+#: mpfr.c:914
+#, fuzzy
+msgid "%s(.., %Rg): negative values will give strange results"
+msgstr "or(%lf, %lf): (hoặc) giá trị âm sẽ gây ra kết quả lạ"
+
+#: mpfr.c:919
+#, fuzzy
+msgid "%s(.., %Rg): fractional values will be truncated"
+msgstr "or(%lf, %lf): (hoặc) giá trị thuộc phân số sẽ bị xén ngắn"
+
+#: mpfr.c:932
+#, fuzzy, c-format
+msgid "%s(.., %Zd): negative values will give strange results"
+msgstr "or(%lf, %lf): (hoặc) giá trị âm sẽ gây ra kết quả lạ"
+
+#: msg.c:61
#, c-format
msgid "cmd. line:"
msgstr "dòng lệnh:"
-#: msg.c:107
-msgid "error: "
-msgstr "lá»—i: "
-
-#: node.c:406
+#: node.c:436
msgid "backslash at end of string"
msgstr "gặp xuyệc ngoặc tại kết thúc của chuỗi"
-#: node.c:517
+#: node.c:520
#, c-format
msgid "old awk does not support the `\\%c' escape sequence"
msgstr "awk cũ không hỗ trợ dãy thoát « \\%c »"
-#: node.c:568
+#: node.c:571
msgid "POSIX does not allow `\\x' escapes"
msgstr "POSIX không cho phép Ä‘iá»u thoát « \\x »"
-#: node.c:574
+#: node.c:577
msgid "no hex digits in `\\x' escape sequence"
msgstr "không có số thập lúc nằm trong dây thoát « \\x »"
-#: node.c:596
+#: node.c:599
#, c-format
msgid ""
"hex escape \\x%.*s of %d characters probably not interpreted the way you "
@@ -2023,12 +3228,12 @@ msgstr ""
"dây thoát thập lục \\x%.*s chứa %d ký tá»± mà rất có thể không phải được Ä‘á»c "
"bằng cách dự định"
-#: node.c:611
+#: node.c:614
#, c-format
msgid "escape sequence `\\%c' treated as plain `%c'"
msgstr "dây thoát « \\%c » được xử lý như là « %c » chuẩn"
-#: node.c:750
+#: node.c:759
msgid ""
"Invalid multibyte data detected. There may be a mismatch between your data "
"and your locale."
@@ -2036,28 +3241,28 @@ msgstr ""
"Dữ liệu dạng đa byte (multibyte) không hợp lệ được tìm thấy. Tại đó có lẽ "
"không khớp giữa dữ liệu của bạn và nơi xảy ra."
-#: posix/gawkmisc.c:176
+#: posix/gawkmisc.c:177
#, c-format
msgid "%s %s `%s': could not get fd flags: (fcntl F_GETFD: %s)"
msgstr "%s %s `%s': không thể lấy cỠmô tả (fd): (fcntl F_GETFD: %s)"
-#: posix/gawkmisc.c:188
+#: posix/gawkmisc.c:189
#, c-format
msgid "%s %s `%s': could not set close-on-exec: (fcntl F_SETFD: %s)"
msgstr ""
"%s %s « %s »: không thể đặt « close-on-exec » (đóng một khi thực hiện): "
"(fcntl F_SETFD: %s)"
-#: profile.c:83
+#: profile.c:70
#, c-format
msgid "could not open `%s' for writing: %s"
msgstr "không thể mở « %s » để ghi: %s"
-#: profile.c:85
+#: profile.c:72
msgid "sending profile to standard error"
msgstr "đang gởi hồ sơ cho thiết bị lỗi chuẩn"
-#: profile.c:203
+#: profile.c:188
#, c-format
msgid ""
"\t# %s block(s)\n"
@@ -2066,7 +3271,7 @@ msgstr ""
"\t# %s khối\n"
"\n"
-#: profile.c:208
+#: profile.c:193
#, c-format
msgid ""
"\t# Rule(s)\n"
@@ -2075,17 +3280,22 @@ msgstr ""
"\t# Quy tắc\n"
"\n"
-#: profile.c:279
+#: profile.c:267
#, c-format
msgid "internal error: %s with null vname"
msgstr "lỗi nội bộ: %s với vname (tên biến?) vô giá trị"
-#: profile.c:952
+#: profile.c:529
+#, fuzzy
+msgid "internal error: builtin with null fname"
+msgstr "lỗi nội bộ: %s với vname (tên biến?) vô giá trị"
+
+#: profile.c:944
#, c-format
msgid "\t# gawk profile, created %s\n"
msgstr "\t# hồ sơ gawk, được tạo %s\n"
-#: profile.c:1331
+#: profile.c:1329
#, c-format
msgid ""
"\n"
@@ -2094,17 +3304,17 @@ msgstr ""
"\n"
"\t# Danh sách các hàm theo thứ tự abc\n"
-#: profile.c:1370
+#: profile.c:1367
#, c-format
msgid "redir2str: unknown redirection type %d"
msgstr "redir2str: không hiểu kiểu chuyển hướng %d"
-#: re.c:573
+#: re.c:568
#, c-format
msgid "range of the form `[%c-%c]' is locale dependent"
msgstr "dạng thức vùng `[%c-%c]' thì phụ thuộc vị trí"
-#: re.c:600
+#: re.c:595
#, c-format
msgid "regexp component `%.*s' should probably be `[%.*s]'"
msgstr ""
@@ -2151,10 +3361,6 @@ msgstr "Chưa khớp « ( » hay « \\( »"
msgid "Unmatched \\{"
msgstr "Chưa khớp « \\{ »"
-#: regcomp.c:161
-msgid "Invalid content of \\{\\}"
-msgstr "Nội dụng « \\{\\} » không hợp lệ"
-
#: regcomp.c:164
msgid "Invalid range end"
msgstr "Kết thúc phạm vị không hợp lệ"
@@ -2171,10 +3377,6 @@ msgstr "Biểu thức chính quy nằm trước không hợp lệ"
msgid "Premature end of regular expression"
msgstr "Kết thúc quá sớm của biểu thức chính quy"
-#: regcomp.c:176
-msgid "Regular expression too big"
-msgstr "Biểu thức chính quy quá lớn"
-
#: regcomp.c:179
msgid "Unmatched ) or \\)"
msgstr "Chưa khớp « ) » hay « \\) »"
@@ -2183,12 +3385,100 @@ msgstr "Chưa khớp « ) » hay « \\) »"
msgid "No previous regular expression"
msgstr "Không có biểu thức chính quy nằm trước"
+#: symbol.c:722
+msgid "can not pop main context"
+msgstr ""
+
#~ msgid "`nextfile' is a gawk extension"
#~ msgstr "« nextfile » (tập tin kế tiếp) là một phần mở rộng gawk"
#~ msgid "`delete array' is a gawk extension"
#~ msgstr "« delete array » (xoá mảng) là một phần mở rộng gawk"
+#~ msgid "and: received non-numeric first argument"
+#~ msgstr "and: (và) đã nhận đối số đầu không phải thuộc số"
+
+#~ msgid "and: received non-numeric second argument"
+#~ msgstr "and: (và) đã nhận đối số thứ hai khác thuộc số"
+
+#~ msgid "and(%lf, %lf): fractional values will be truncated"
+#~ msgstr "and(%lf, %lf): (và) giá trị thuộc phân số sẽ bị xén ngắn"
+
+#~ msgid "xor: received non-numeric first argument"
+#~ msgstr "xor: (không hoặc) đã nhận đối số thứ nhất khác thuộc số"
+
+#~ msgid "xor: received non-numeric second argument"
+#~ msgstr "xor: đã nhận đối số thứ hai khác thuộc số"
+
+#~ msgid "xor(%lf, %lf): fractional values will be truncated"
+#~ msgstr "xor(%lf, %lf): (không hoặc) giá trị thuộc phân số sẽ bị xén ngắn"
+
+#~ msgid "`extension' is a gawk extension"
+#~ msgstr "« extension » là một phần mở rộng gawk"
+
+#~ msgid "Operation Not Supported"
+#~ msgstr "Thao tác không được hỗ trợ"
+
+#~ msgid "attempt to use function `%s' as an array"
+#~ msgstr "cố gắng dùng hàm « %s » như mảng"
+
+#~ msgid "reference to uninitialized element `%s[\"%.*s\"]'"
+#~ msgstr "tham chiếu đến phần tử chưa sở khởi « %s[\"%.*s\"] »"
+
+#~ msgid "subscript of array `%s' is null string"
+#~ msgstr "chữ in dưới mảng « %s » là chuỗi rỗng"
+
+#~ msgid "%s: empty (null)\n"
+#~ msgstr "%s: rỗng (vô giá trị)\n"
+
+#~ msgid "%s: empty (zero)\n"
+#~ msgstr "%s: rỗng (số không)\n"
+
+#~ msgid "%s: table_size = %d, array_size = %d\n"
+#~ msgstr "%s: cỡ_bảng = %d, cỡ_mảng = %d\n"
+
+#~ msgid "%s: array_ref to %s\n"
+#~ msgstr "%s: « array_ref » (mảng tham chiếu) đến « %s »\n"
+
+#~ msgid "use of non-array as array"
+#~ msgstr "việc dùng cái khác mảng như là mảng"
+
+#~ msgid "can't use function name `%s' as variable or array"
+#~ msgstr "không thể dùng tên hàm « %s » như là biến hay mảng"
+
+#~ msgid "assignment used in conditional context"
+#~ msgstr "Ä‘iá»u gán được dùng trong ngữ cảnh Ä‘iá»u kiện"
+
+#~ msgid "statement has no effect"
+#~ msgstr "câu không có tác dụng"
+
+#~ msgid ""
+#~ "for loop: array `%s' changed size from %ld to %ld during loop execution"
+#~ msgstr ""
+#~ "cho loop: (cho vòng lặp) mảng « %s » đã thay đổi kích thước từ %ld đến "
+#~ "%ld trong khi thực hiện vòng lặp"
+
+#~ msgid "function called indirectly through `%s' does not exist"
+#~ msgstr "hàm được gá»i gián tiếp thông qua `%s' không tồn tại"
+
+#~ msgid "function `%s' not defined"
+#~ msgstr "chưa xác định hàm « %s »"
+
+#~ msgid "non-redirected `getline' invalid inside `%s' rule"
+#~ msgstr "`getline' không-gửi-lại không hợp lệ bên trong quy tắc `%s'"
+
+#~ msgid "`nextfile' cannot be called from a `%s' rule"
+#~ msgstr "«nextfile» (tập tin kế tiếp) không thể được gá»i từ má»™t quy tắc `%s'"
+
+#~ msgid "`next' cannot be called from a `%s' rule"
+#~ msgstr "«next» (kế tiếp) không thể được gá»i từ má»™t quy tắc `%s'"
+
+#~ msgid "Sorry, don't know how to interpret `%s'"
+#~ msgstr "Rất tiếc, không biết làm cách nào để phiên dịch được `%s'"
+
+#~ msgid "\t-R file\t\t\t--command=file\n"
+#~ msgstr "\t-R file\t\t\t--command=tệp_tin\n"
+
#~ msgid "could not find groups: %s"
#~ msgstr "không tìm thấy nhóm: %s"
diff --git a/po/zh_CN.gmo b/po/zh_CN.gmo
deleted file mode 100644
index 7ed096c3..00000000
--- a/po/zh_CN.gmo
+++ /dev/null
Binary files differ
diff --git a/posix/ChangeLog b/posix/ChangeLog
index d684afe9..17a93f7f 100644
--- a/posix/ChangeLog
+++ b/posix/ChangeLog
@@ -1,3 +1,30 @@
+2012-10-14 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkmisc.c (os_isreadable): Change name of input parameter to
+ awk_inputbuf_t.
+
+2012-08-08 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkmisc.pc (os_isreadable): Take IOBUF_PUBLIC instead of fd and
+ use passed in info.
+
+2012-07-29 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkmisc.c (os_isreadable): Add isdir pointer parameter to be
+ set to true if fd is for a directory.
+
+2012-07-26 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkmisc.c (os_isreadable): New function.
+
+2012-05-11 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkmisc.c: Use `bool', `true', and `false' everywhere.
+
+2012-03-20 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawkmisc.c (deflibpath): New global variable.
+
2012-03-28 Arnold D. Robbins <arnold@skeeve.com>
* 4.0.1: Release tar ball made.
diff --git a/posix/gawkmisc.c b/posix/gawkmisc.c
index acc3c9d5..90bf1c38 100644
--- a/posix/gawkmisc.c
+++ b/posix/gawkmisc.c
@@ -26,6 +26,7 @@
char quote = '\'';
char *defpath = DEFPATH;
+char *deflibpath = DEFLIBPATH;
char envsep = ':';
#ifndef INVALID_HANDLE
@@ -92,8 +93,8 @@ optimal_bufsize(int fd, struct stat *stb)
{
char *val;
static size_t env_val = 0;
- static short first = TRUE;
- static short exact = FALSE;
+ static bool first = true;
+ static bool exact = false;
/* force all members to zero in case OS doesn't use all of them. */
memset(stb, '\0', sizeof(struct stat));
@@ -103,11 +104,11 @@ optimal_bufsize(int fd, struct stat *stb)
fatal("can't stat fd %d (%s)", fd, strerror(errno));
if (first) {
- first = FALSE;
+ first = false;
if ((val = getenv("AWKBUFSIZE")) != NULL) {
if (strcmp(val, "exact") == 0)
- exact = TRUE;
+ exact = true;
else if (isdigit((unsigned char) *val)) {
for (; *val && isdigit((unsigned char) *val); val++)
env_val = (env_val * 10) + *val - '0';
@@ -203,6 +204,34 @@ os_isdir(int fd)
return (fstat(fd, &sbuf) == 0 && S_ISDIR(sbuf.st_mode));
}
+/* os_isreadable --- fd can be read from */
+
+int
+os_isreadable(const awk_input_buf_t *iobuf, bool *isdir)
+{
+ *isdir = false;
+
+ if (iobuf->fd == INVALID_HANDLE)
+ return false;
+
+ switch (iobuf->sbuf.st_mode & S_IFMT) {
+ case S_IFREG:
+ case S_IFCHR: /* ttys, /dev/null, .. */
+#ifdef S_IFSOCK
+ case S_IFSOCK:
+#endif
+#ifdef S_IFIFO
+ case S_IFIFO:
+#endif
+ return true;
+ case S_IFDIR:
+ *isdir = true;
+ /* fall through */
+ default:
+ return false;
+ }
+}
+
/* os_is_setuid --- true if running setuid root */
int
diff --git a/profile.c b/profile.c
index eb788377..dfac5c10 100644
--- a/profile.c
+++ b/profile.c
@@ -25,7 +25,7 @@
#include "awk.h"
-static void pprint(INSTRUCTION *startp, INSTRUCTION *endp, int in_for_header);
+static void pprint(INSTRUCTION *startp, INSTRUCTION *endp, bool in_for_header);
static void pp_parenthesize(NODE *n);
static void parenthesize(int type, NODE *left, NODE *right);
static char *pp_list(int nargs, const char *paren, const char *delim);
@@ -37,21 +37,21 @@ static NODE *pp_pop(void);
static void pp_free(NODE *n);
const char *redir2str(int redirtype);
-#define pp_str hname
-#define pp_len hlength
+#define pp_str vname
+#define pp_len sub.nodep.reserved
+#define pp_next rnode
#define DONT_FREE 1
#define CAN_FREE 2
-#ifdef PROFILING
+
static RETSIGTYPE dump_and_exit(int signum) ATTRIBUTE_NORETURN;
static RETSIGTYPE just_dump(int signum);
-#endif
/* pretty printing related functions and variables */
static NODE *pp_stack = NULL;
-static char **fparms; /* function parameter names */
+static NODE *func_params; /* function parameters */
static FILE *prof_fp; /* where to send the profile */
static long indent_level = 0;
@@ -59,20 +59,7 @@ static long indent_level = 0;
#define SPACEOVER 0
-/* init_profiling --- do needed initializations, see also main.c */
-
-void
-init_profiling(int *flag ATTRIBUTE_UNUSED, const char *def_file ATTRIBUTE_UNUSED)
-{
-#ifdef PROFILING
- if (*flag == FALSE) {
- *flag = TRUE;
- set_prof_file(def_file);
- }
-#endif
-}
-
-/* set_prof_file --- set the output file for profiling */
+/* set_prof_file --- set the output file for profiling or pretty-printing */
void
set_prof_file(const char *file)
@@ -87,12 +74,11 @@ set_prof_file(const char *file)
}
}
-/* init_profiling_signals --- set up signal handling for pgawk */
+/* init_profiling_signals --- set up signal handling for gawk --profile */
void
init_profiling_signals()
{
-#ifdef PROFILING
#ifdef __DJGPP__
signal(SIGINT, dump_and_exit);
signal(SIGQUIT, just_dump);
@@ -104,7 +90,6 @@ init_profiling_signals()
signal(SIGUSR1, just_dump);
#endif
#endif /* !__DJGPP__ */
-#endif /* PROFILING */
}
/* indent --- print out enough tabs */
@@ -151,7 +136,7 @@ pp_push(int type, char *s, int flag)
n->pp_len = strlen(s);
n->flags = flag;
n->type = type;
- n->hnext = pp_stack;
+ n->pp_next = pp_stack;
pp_stack = n;
}
@@ -160,7 +145,7 @@ pp_pop()
{
NODE *n;
n = pp_stack;
- pp_stack = n->hnext;
+ pp_stack = n->pp_next;
return n;
}
@@ -177,7 +162,7 @@ pp_free(NODE *n)
*/
static void
-pprint(INSTRUCTION *startp, INSTRUCTION *endp, int in_for_header)
+pprint(INSTRUCTION *startp, INSTRUCTION *endp, bool in_for_header)
{
INSTRUCTION *pc;
NODE *t1;
@@ -209,15 +194,15 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, int in_for_header)
ip = pc->nexti;
indent(ip->exec_count);
if (ip != (pc + 1)->firsti) { /* non-empty pattern */
- pprint(ip->nexti, (pc + 1)->firsti, FALSE);
+ pprint(ip->nexti, (pc + 1)->firsti, false);
t1 = pp_pop();
fprintf(prof_fp, "%s {", t1->pp_str);
pp_free(t1);
ip = (pc + 1)->firsti;
-#ifdef PROFILING
- if (ip->exec_count > 0)
+
+ if (do_profile && ip->exec_count > 0)
fprintf(prof_fp, " # %ld", ip->exec_count);
-#endif
+
fprintf(prof_fp, "\n");
} else {
fprintf(prof_fp, "{\n");
@@ -226,7 +211,7 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, int in_for_header)
ip = ip->nexti;
}
indent_in();
- pprint(ip, (pc + 1)->lasti, FALSE);
+ pprint(ip, (pc + 1)->lasti, false);
indent_out();
fprintf(prof_fp, "\t}\n\n");
pc = (pc + 1)->lasti;
@@ -244,7 +229,7 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, int in_for_header)
if (m == Nnull_string) /* optional return or exit value; don't print 0 or "" */
pp_push(pc->opcode, m->stptr, DONT_FREE);
else if ((m->flags & NUMBER) != 0)
- pp_push(pc->opcode, pp_number(m->numbr), CAN_FREE);
+ pp_push(pc->opcode, pp_number(m), CAN_FREE);
else {
str = pp_string(m->stptr, m->stlen, '"');
if ((m->flags & INTLSTR) != 0) {
@@ -257,6 +242,9 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, int in_for_header)
break;
case Op_store_var:
+ if (pc->initval != NULL)
+ pp_push(Op_push_i, pp_node(pc->initval), CAN_FREE);
+ /* fall through */
case Op_store_sub:
case Op_assign_concat:
case Op_push_lhs:
@@ -267,7 +255,7 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, int in_for_header)
m = pc->memory;
switch (m->type) {
case Node_param_list:
- pp_push(pc->opcode, fparms[m->param_cnt], DONT_FREE);
+ pp_push(pc->opcode, func_params[m->param_cnt].param, DONT_FREE);
break;
case Node_var:
@@ -354,7 +342,7 @@ cleanup:
&& is_binary(t1->type)) /* (a - b) * 1 */
pp_parenthesize(t1);
if ((m->flags & NUMBER) != 0)
- tmp = pp_number(m->numbr);
+ tmp = pp_number(m);
else
tmp = pp_string(m->stptr, m->stlen, '"');
str = pp_concat(t1->pp_str, op2str(pc->opcode), tmp);
@@ -522,9 +510,13 @@ cleanup:
break;
case Op_builtin:
+ case Op_ext_builtin:
{
- static char *ext_func = "extension_function()";
- const char *fname = getfname(pc->builtin);
+ const char *fname;
+ if (pc->opcode == Op_builtin)
+ fname = getfname(pc->builtin);
+ else
+ fname = (pc + 1)->func_name;
if (fname != NULL) {
if (pc->expr_count > 0) {
tmp = pp_list(pc->expr_count, "()", ", ");
@@ -534,10 +526,10 @@ cleanup:
str = pp_concat(fname, "()", "");
pp_push(Op_builtin, str, CAN_FREE);
} else
- pp_push(Op_builtin, ext_func, DONT_FREE);
+ fatal(_("internal error: builtin with null fname"));
}
break;
-
+
case Op_K_print:
case Op_K_printf:
case Op_K_print_rec:
@@ -685,8 +677,8 @@ cleanup:
case Op_line_range:
ip = pc + 1;
- pprint(pc->nexti, ip->condpair_left, FALSE);
- pprint(ip->condpair_left->nexti, ip->condpair_right, FALSE);
+ pprint(pc->nexti, ip->condpair_left, false);
+ pprint(ip->condpair_left->nexti, ip->condpair_right, false);
t2 = pp_pop();
t1 = pp_pop();
str = pp_concat(t1->pp_str, ", ", t2->pp_str);
@@ -700,12 +692,12 @@ cleanup:
ip = pc + 1;
indent(ip->while_body->exec_count);
fprintf(prof_fp, "%s (", op2str(pc->opcode));
- pprint(pc->nexti, ip->while_body, FALSE);
+ pprint(pc->nexti, ip->while_body, false);
t1 = pp_pop();
fprintf(prof_fp, "%s) {\n", t1->pp_str);
pp_free(t1);
indent_in();
- pprint(ip->while_body->nexti, pc->target_break, FALSE);
+ pprint(ip->while_body->nexti, pc->target_break, false);
indent_out();
indent(SPACEOVER);
fprintf(prof_fp, "}\n");
@@ -717,9 +709,9 @@ cleanup:
indent(pc->nexti->exec_count);
fprintf(prof_fp, "%s {\n", op2str(pc->opcode));
indent_in();
- pprint(pc->nexti->nexti, ip->doloop_cond, FALSE);
+ pprint(pc->nexti->nexti, ip->doloop_cond, false);
indent_out();
- pprint(ip->doloop_cond, pc->target_break, FALSE);
+ pprint(ip->doloop_cond, pc->target_break, false);
indent(SPACEOVER);
t1 = pp_pop();
fprintf(prof_fp, "} %s (%s)\n", op2str(Op_K_while), t1->pp_str);
@@ -731,23 +723,23 @@ cleanup:
ip = pc + 1;
indent(ip->forloop_body->exec_count);
fprintf(prof_fp, "%s (", op2str(pc->opcode));
- pprint(pc->nexti, ip->forloop_cond, TRUE);
+ pprint(pc->nexti, ip->forloop_cond, true);
fprintf(prof_fp, "; ");
if (ip->forloop_cond->opcode == Op_no_op &&
ip->forloop_cond->nexti == ip->forloop_body)
fprintf(prof_fp, "; ");
else {
- pprint(ip->forloop_cond, ip->forloop_body, TRUE);
+ pprint(ip->forloop_cond, ip->forloop_body, true);
t1 = pp_pop();
fprintf(prof_fp, "%s; ", t1->pp_str);
pp_free(t1);
}
- pprint(pc->target_continue, pc->target_break, TRUE);
+ pprint(pc->target_continue, pc->target_break, true);
fprintf(prof_fp, ") {\n");
indent_in();
- pprint(ip->forloop_body->nexti, pc->target_continue, FALSE);
+ pprint(ip->forloop_body->nexti, pc->target_continue, false);
indent_out();
indent(SPACEOVER);
fprintf(prof_fp, "}\n");
@@ -756,14 +748,15 @@ cleanup:
case Op_K_arrayfor:
{
- char *array, *item;
+ char *array;
+ const char *item;
ip = pc + 1;
t1 = pp_pop();
array = t1->pp_str;
m = ip->forloop_cond->array_var;
if (m->type == Node_param_list)
- item = fparms[m->param_cnt];
+ item = func_params[m->param_cnt].param;
else
item = m->vname;
indent(ip->forloop_body->exec_count);
@@ -771,7 +764,7 @@ cleanup:
item, op2str(Op_in_array), array);
indent_in();
pp_free(t1);
- pprint(ip->forloop_body->nexti, pc->target_break, FALSE);
+ pprint(ip->forloop_body->nexti, pc->target_break, false);
indent_out();
indent(SPACEOVER);
fprintf(prof_fp, "}\n");
@@ -782,11 +775,11 @@ cleanup:
case Op_K_switch:
ip = pc + 1;
fprintf(prof_fp, "%s (", op2str(pc->opcode));
- pprint(pc->nexti, ip->switch_start, FALSE);
+ pprint(pc->nexti, ip->switch_start, false);
t1 = pp_pop();
fprintf(prof_fp, "%s) {\n", t1->pp_str);
pp_free(t1);
- pprint(ip->switch_start, ip->switch_end, FALSE);
+ pprint(ip->switch_start, ip->switch_end, false);
indent(SPACEOVER);
fprintf(prof_fp, "}\n");
pc = pc->target_break;
@@ -802,13 +795,13 @@ cleanup:
} else
fprintf(prof_fp, "%s:\n", op2str(pc->opcode));
indent_in();
- pprint(pc->stmt_start->nexti, pc->stmt_end->nexti, FALSE);
+ pprint(pc->stmt_start->nexti, pc->stmt_end->nexti, false);
indent_out();
break;
case Op_K_if:
fprintf(prof_fp, "%s (", op2str(pc->opcode));
- pprint(pc->nexti, pc->branch_if, FALSE);
+ pprint(pc->nexti, pc->branch_if, false);
t1 = pp_pop();
fprintf(prof_fp, "%s) {", t1->pp_str);
pp_free(t1);
@@ -818,7 +811,7 @@ cleanup:
fprintf(prof_fp, " # %ld", ip->exec_count);
fprintf(prof_fp, "\n");
indent_in();
- pprint(ip->nexti, pc->branch_else, FALSE);
+ pprint(ip->nexti, pc->branch_else, false);
indent_out();
pc = pc->branch_else;
if (pc->nexti->opcode == Op_no_op) {
@@ -830,7 +823,7 @@ cleanup:
case Op_K_else:
fprintf(prof_fp, "} %s {\n", op2str(pc->opcode));
indent_in();
- pprint(pc->nexti, pc->branch_end, FALSE);
+ pprint(pc->nexti, pc->branch_end, false);
indent_out();
indent(SPACEOVER);
fprintf(prof_fp, "}\n");
@@ -842,14 +835,14 @@ cleanup:
NODE *f, *t, *cond;
size_t len;
- pprint(pc->nexti, pc->branch_if, FALSE);
+ pprint(pc->nexti, pc->branch_if, false);
ip = pc->branch_if;
- pprint(ip->nexti, pc->branch_else, FALSE);
+ pprint(ip->nexti, pc->branch_else, false);
ip = pc->branch_else->nexti;
pc = ip->nexti;
assert(pc->opcode == Op_cond_exp);
- pprint(pc->nexti, pc->branch_end, FALSE);
+ pprint(pc->nexti, pc->branch_end, false);
f = pp_pop();
t = pp_pop();
@@ -890,7 +883,7 @@ cleanup:
void
pp_string_fp(Func_print print_func, FILE *fp, const char *in_str,
- size_t len, int delim, int breaklines)
+ size_t len, int delim, bool breaklines)
{
char *s = pp_string(in_str, len, delim);
int count;
@@ -909,7 +902,7 @@ pp_string_fp(Func_print print_func, FILE *fp, const char *in_str,
efree(s);
}
-#ifdef PROFILING
+
/* just_dump --- dump the profile and function stack and keep going */
static RETSIGTYPE
@@ -930,10 +923,9 @@ static RETSIGTYPE
dump_and_exit(int signum)
{
just_dump(signum);
- exit(EXIT_FAILURE);
+ final_exit(EXIT_FAILURE);
}
-#endif
/* dump_prog --- dump the program */
@@ -950,7 +942,7 @@ dump_prog(INSTRUCTION *code)
(void) time(& now);
/* \n on purpose, with \n in ctime() output */
fprintf(prof_fp, _("\t# gawk profile, created %s\n"), ctime(& now));
- pprint(code, NULL, FALSE);
+ pprint(code, NULL, false);
}
/* prec_level --- return the precedence of an operator, for paren tests */
@@ -1090,10 +1082,10 @@ is_binary(int type)
case Op_in_array:
case Op_K_getline_redir: /* sometimes */
case Op_K_getline:
- return TRUE;
+ return true;
default:
- return FALSE;
+ return false;
}
}
@@ -1211,13 +1203,20 @@ pp_string(const char *in_str, size_t len, int delim)
/* pp_number --- pretty format a number */
char *
-pp_number(AWKNUM d)
+pp_number(NODE *n)
{
#define PP_PRECISION 6
char *str;
emalloc(str, char *, PP_PRECISION + 10, "pp_number");
- sprintf(str, "%0.*g", PP_PRECISION, d);
+#ifdef HAVE_MPFR
+ if (is_mpg_float(n))
+ mpfr_sprintf(str, "%0.*R*g", PP_PRECISION, ROUND_MODE, n->mpg_numbr);
+ else if (is_mpg_integer(n))
+ mpfr_sprintf(str, "%Zd", n->mpg_i);
+ else
+#endif
+ sprintf(str, "%0.*g", PP_PRECISION, n->numbr);
return str;
#undef PP_PRECISION
}
@@ -1228,7 +1227,7 @@ char *
pp_node(NODE *n)
{
if ((n->flags & NUMBER) != 0)
- return pp_number(n->numbr);
+ return pp_number(n);
return pp_string(n->stptr, n->stlen, '"');
}
@@ -1321,31 +1320,29 @@ int
pp_func(INSTRUCTION *pc, void *data ATTRIBUTE_UNUSED)
{
int j;
- char **pnames;
- NODE *f;
- static int first = TRUE;
+ static bool first = true;
+ NODE *func;
int pcount;
if (first) {
- first = FALSE;
+ first = false;
fprintf(prof_fp, _("\n\t# Functions, listed alphabetically\n"));
}
- f = pc->func_body;
+ func = pc->func_body;
fprintf(prof_fp, "\n");
indent(pc->nexti->exec_count);
- fprintf(prof_fp, "%s %s(", op2str(Op_K_function), f->lnode->param);
- pnames = f->parmlist;
- fparms = pnames;
- pcount = f->lnode->param_cnt;
+ fprintf(prof_fp, "%s %s(", op2str(Op_K_function), func->vname);
+ pcount = func->param_cnt;
+ func_params = func->fparms;
for (j = 0; j < pcount; j++) {
- fprintf(prof_fp, "%s", pnames[j]);
+ fprintf(prof_fp, "%s", func_params[j].param);
if (j < pcount - 1)
fprintf(prof_fp, ", ");
}
fprintf(prof_fp, ")\n\t{\n");
indent_in();
- pprint(pc->nexti->nexti, NULL, FALSE); /* function body */
+ pprint(pc->nexti->nexti, NULL, false); /* function body */
indent_out();
fprintf(prof_fp, "\t}\n");
return 0;
diff --git a/profile_p.c b/profile_p.c
deleted file mode 100644
index 97edd367..00000000
--- a/profile_p.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * profile_p.c - compile profile.c with profiling turned on.
- */
-
-/*
- * Copyright (C) 2001 the Free Software Foundation, Inc.
- *
- * This file is part of GAWK, the GNU implementation of the
- * AWK Programming Language.
- *
- * GAWK is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * GAWK is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#define PROFILING 1
-#include "profile.c"
diff --git a/re.c b/re.c
index 9be46d96..8ad255e2 100644
--- a/re.c
+++ b/re.c
@@ -31,8 +31,9 @@ static void check_bracket_exp(char *s, size_t len);
/* make_regexp --- generate compiled regular expressions */
Regexp *
-make_regexp(const char *s, size_t len, int ignorecase, int dfa, int canfatal)
+make_regexp(const char *s, size_t len, bool ignorecase, bool dfa, bool canfatal)
{
+ static char metas[] = ".*+(){}[]|?^$\\";
Regexp *rp;
const char *rerr;
const char *src = s;
@@ -41,11 +42,11 @@ make_regexp(const char *s, size_t len, int ignorecase, int dfa, int canfatal)
const char *end = s + len;
char *dest;
int c, c2;
- static short first = TRUE;
- static short no_dfa = FALSE;
- int has_anchor = FALSE;
- int may_have_range = 0;
+ static bool first = true;
+ static bool no_dfa = false;
+ bool has_anchor = false;
reg_syntax_t dfa_syn;
+ int i;
/*
* The number of bytes in the current multibyte character.
@@ -60,7 +61,7 @@ make_regexp(const char *s, size_t len, int ignorecase, int dfa, int canfatal)
#endif
if (first) {
- first = FALSE;
+ first = false;
/* for debugging and testing */
no_dfa = (getenv("GAWK_NO_DFA") != NULL);
}
@@ -90,11 +91,11 @@ make_regexp(const char *s, size_t len, int ignorecase, int dfa, int canfatal)
/* The previous byte is a singlebyte character, or last byte
of a multibyte character. We check the next character. */
is_multibyte = mbrlen(src, end - src, &mbs);
- if ( (is_multibyte == 1)
- || (is_multibyte == (size_t) -1)
- || (is_multibyte == (size_t) -2
- || (is_multibyte == 0))) {
- /* We treat it as a singlebyte character. */
+ if ( is_multibyte == 1
+ || is_multibyte == (size_t) -1
+ || is_multibyte == (size_t) -2
+ || is_multibyte == 0) {
+ /* We treat it as a single-byte character. */
is_multibyte = 0;
}
}
@@ -160,9 +161,7 @@ make_regexp(const char *s, size_t len, int ignorecase, int dfa, int canfatal)
} else {
c = *src;
if (c == '^' || c == '$')
- has_anchor = TRUE;
- if (c == '[' || c == '-' || c == ']')
- may_have_range++;
+ has_anchor = true;
*dest++ = *src++; /* not '\\' */
}
@@ -225,14 +224,29 @@ make_regexp(const char *s, size_t len, int ignorecase, int dfa, int canfatal)
}
/* gack. this must be done *after* re_compile_pattern */
- rp->pat.newline_anchor = FALSE; /* don't get \n in middle of string */
+ rp->pat.newline_anchor = false; /* don't get \n in middle of string */
if (dfa && ! no_dfa) {
- rp->dfa = TRUE;
+ rp->dfa = true;
rp->dfareg = dfaalloc();
- dfacomp(buf, len, rp->dfareg, TRUE);
+ dfacomp(buf, len, rp->dfareg, true);
} else
- rp->dfa = FALSE;
+ rp->dfa = false;
rp->has_anchor = has_anchor;
+
+ /* Additional flags that help with RS as regexp. */
+ for (i = 0; i < len; i++) {
+ if (strchr(metas, buf[i]) != NULL) {
+ rp->has_meta = true;
+ break;
+ }
+ }
+
+ for (i = len - 1; i >= 0; i--) {
+ if (strchr("*+|?", buf[i]) != NULL) {
+ rp->maybe_long = true;
+ break;
+ }
+ }
return rp;
}
@@ -274,13 +288,13 @@ research(Regexp *rp, char *str, int start,
* text. So we just save and restore the character.
*/
save = str[start+len];
- ret = dfaexec(rp->dfareg, str+start, str+start+len, TRUE,
+ ret = dfaexec(rp->dfareg, str+start, str+start+len, true,
&count, &try_backref);
str[start+len] = save;
}
if (ret) {
- if (need_start || rp->dfa == FALSE || try_backref) {
+ if (need_start || rp->dfa == false || try_backref) {
/*
* Passing NULL as last arg speeds up search for cases
* where we don't need the start/end info.
@@ -367,7 +381,7 @@ re_update(NODE *t)
}
/* compile it */
t->re_reg = make_regexp(t->re_text->stptr, t->re_text->stlen,
- IGNORECASE, t->re_cnt, TRUE);
+ IGNORECASE, t->re_cnt, true);
/* clear case flag */
t->re_flags &= ~CASE;
@@ -397,7 +411,7 @@ resetup()
syn |= RE_INTERVALS | RE_INVALID_INTERVAL_ORD;
(void) re_set_syntax(syn);
- dfasyntax(syn, FALSE, '\n');
+ dfasyntax(syn, false, '\n');
}
/* avoid_dfa --- return true if we should not use the DFA matcher */
@@ -408,31 +422,26 @@ avoid_dfa(NODE *re, char *str, size_t len)
char *end;
if (! re->re_reg->has_anchor)
- return FALSE;
+ return false;
for (end = str + len; str < end; str++)
if (*str == '\n')
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
-/* reisstring --- return TRUE if the RE match is a simple string match */
+/* reisstring --- return true if the RE match is a simple string match */
int
reisstring(const char *text, size_t len, Regexp *re, const char *buf)
{
- static char metas[] = ".*+(){}[]|?^$\\";
- int i;
int res;
const char *matched;
- /* simple checking for has meta characters in re */
- for (i = 0; i < len; i++) {
- if (strchr(metas, text[i]) != NULL) {
- return FALSE; /* give up early, can't be string match */
- }
- }
+ /* simple checking for meta characters in re */
+ if (re->has_meta)
+ return false; /* give up early, can't be string match */
/* make accessable to gdb */
matched = &buf[RESTART(re, buf)];
@@ -442,20 +451,6 @@ reisstring(const char *text, size_t len, Regexp *re, const char *buf)
return res;
}
-/* remaybelong --- return TRUE if the RE contains * ? | + */
-
-int
-remaybelong(const char *text, size_t len)
-{
- while (len--) {
- if (strchr("*+|?", *text++) != NULL) {
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
/* reflags2str --- make a regex flags value readable */
const char *
@@ -518,28 +513,28 @@ check_bracket_exp(char *s, size_t length)
static struct reclass {
const char *name;
size_t len;
- short warned;
+ bool warned;
} classes[] = {
/*
* Ordered by what we hope is frequency,
* since it's linear searched.
*/
- { "[:alpha:]", 9, FALSE },
- { "[:digit:]", 9, FALSE },
- { "[:alnum:]", 9, FALSE },
- { "[:upper:]", 9, FALSE },
- { "[:lower:]", 9, FALSE },
- { "[:space:]", 9, FALSE },
- { "[:xdigit:]", 10, FALSE },
- { "[:punct:]", 9, FALSE },
- { "[:print:]", 9, FALSE },
- { "[:graph:]", 9, FALSE },
- { "[:cntrl:]", 9, FALSE },
- { "[:blank:]", 9, FALSE },
+ { "[:alpha:]", 9, false },
+ { "[:digit:]", 9, false },
+ { "[:alnum:]", 9, false },
+ { "[:upper:]", 9, false },
+ { "[:lower:]", 9, false },
+ { "[:space:]", 9, false },
+ { "[:xdigit:]", 10, false },
+ { "[:punct:]", 9, false },
+ { "[:print:]", 9, false },
+ { "[:graph:]", 9, false },
+ { "[:cntrl:]", 9, false },
+ { "[:blank:]", 9, false },
{ NULL, 0 }
};
int i;
- int found = FALSE;
+ bool found = false;
char save;
char *sp, *sp2, *end;
int len;
@@ -559,7 +554,7 @@ again:
goto done;
for (count++, sp++; *sp != '\0'; sp++) {
- static short range_warned = FALSE;
+ static bool range_warned = false;
if (*sp == '[')
count++;
@@ -569,7 +564,7 @@ again:
&& sp[-1] != '[' && sp[1] != ']'
&& ! isdigit((unsigned char) sp[-1]) && ! isdigit((unsigned char) sp[1])
&& ! (sp[-2] == '[' && sp[-1] == '^')) {
- range_warned = TRUE;
+ range_warned = true;
warning(_("range of the form `[%c-%c]' is locale dependent"),
sp[-1], sp[1]);
}
@@ -591,7 +586,7 @@ again:
len = classes[i].len;
if ( len == (sp - sp2)
&& memcmp(sp2, classes[i].name, len) == 0) {
- found = TRUE;
+ found = true;
break;
}
}
@@ -599,11 +594,11 @@ again:
if (found && ! classes[i].warned) {
warning(_("regexp component `%.*s' should probably be `[%.*s]'"),
len, sp2, len, sp2);
- classes[i].warned = TRUE;
+ classes[i].warned = true;
}
if (sp < end) {
- found = FALSE;
+ found = false;
goto again;
}
done:
diff --git a/str_array.c b/str_array.c
new file mode 100644
index 00000000..1b3a33f1
--- /dev/null
+++ b/str_array.c
@@ -0,0 +1,731 @@
+/*
+ * str_array.c - routines for associative arrays of string indices.
+ */
+
+/*
+ * Copyright (C) 1986, 1988, 1989, 1991-2011 the Free Software Foundation, Inc.
+ *
+ * This file is part of GAWK, the GNU implementation of the
+ * AWK Programming Language.
+ *
+ * GAWK is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GAWK is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "awk.h"
+
+/*
+ * Tree walks (``for (iggy in foo)'') and array deletions use expensive
+ * linear searching. So what we do is start out with small arrays and
+ * grow them as needed, so that our arrays are hopefully small enough,
+ * most of the time, that they're pretty full and we're not looking at
+ * wasted space.
+ *
+ * The decision is made to grow the array if the average chain length is
+ * ``too big''. This is defined as the total number of entries in the table
+ * divided by the size of the array being greater than some constant.
+ *
+ * 11/2002: We make the constant a variable, so that it can be tweaked
+ * via environment variable.
+ * 11/2002: Modern machines are bigger, cut this down from 10.
+ */
+
+static size_t STR_CHAIN_MAX = 2;
+
+extern FILE *output_fp;
+extern void indent(int indent_level);
+
+static NODE **str_array_init(NODE *symbol, NODE *subs);
+static NODE **str_lookup(NODE *symbol, NODE *subs);
+static NODE **str_exists(NODE *symbol, NODE *subs);
+static NODE **str_clear(NODE *symbol, NODE *subs);
+static NODE **str_remove(NODE *symbol, NODE *subs);
+static NODE **str_list(NODE *symbol, NODE *subs);
+static NODE **str_copy(NODE *symbol, NODE *newsymb);
+static NODE **str_dump(NODE *symbol, NODE *ndump);
+
+array_ptr str_array_func[] = {
+ str_array_init,
+ (array_ptr) 0,
+ str_lookup,
+ str_exists,
+ str_clear,
+ str_remove,
+ str_list,
+ str_copy,
+ str_dump,
+};
+
+static inline NODE **str_find(NODE *symbol, NODE *s1, size_t code1, unsigned long hash1);
+static void grow_table(NODE *symbol);
+
+static unsigned long gst_hash_string(const char *str, size_t len, unsigned long hsize, size_t *code);
+static unsigned long scramble(unsigned long x);
+static unsigned long awk_hash(const char *s, size_t len, unsigned long hsize, size_t *code);
+
+unsigned long (*hash)(const char *s, size_t len, unsigned long hsize, size_t *code) = awk_hash;
+
+
+/* str_array_init --- check relevant environment variables */
+
+static NODE **
+str_array_init(NODE *symbol ATTRIBUTE_UNUSED, NODE *subs ATTRIBUTE_UNUSED)
+{
+ long newval;
+ const char *val;
+
+ if ((newval = getenv_long("STR_CHAIN_MAX")) > 0)
+ STR_CHAIN_MAX = newval;
+ if ((val = getenv("AWK_HASH")) != NULL && strcmp(val, "gst") == 0)
+ hash = gst_hash_string;
+ return (NODE **) ! NULL;
+}
+
+
+/*
+ * assoc_lookup:
+ * Find SYMBOL[SUBS] in the assoc array. Install it with value "" if it
+ * isn't there. Returns a pointer ala get_lhs to where its value is stored.
+ *
+ * SYMBOL is the address of the node (or other pointer) being dereferenced.
+ * SUBS is a number or string used as the subscript.
+ */
+
+static NODE **
+str_lookup(NODE *symbol, NODE *subs)
+{
+ unsigned long hash1;
+ NODE **lhs;
+ BUCKET *b;
+ size_t code1;
+
+ subs = force_string(subs);
+
+ if (symbol->buckets == NULL)
+ grow_table(symbol);
+ hash1 = hash(subs->stptr, subs->stlen,
+ (unsigned long) symbol->array_size, & code1);
+ if ((lhs = str_find(symbol, subs, code1, hash1)) != NULL)
+ return lhs;
+
+ /* It's not there, install it. */
+ /* first see if we would need to grow the array, before installing */
+
+ symbol->table_size++;
+ if ((symbol->flags & ARRAYMAXED) == 0
+ && (symbol->table_size / symbol->array_size) > STR_CHAIN_MAX) {
+ grow_table(symbol);
+ /* have to recompute hash value for new size */
+ hash1 = code1 % (unsigned long) symbol->array_size;
+ }
+
+ if (subs->stfmt != -1) {
+ NODE *tmp;
+
+ /*
+ * Need to freeze this string value --- it must never
+ * change, no matter what happens to the value
+ * that created it or to CONVFMT, etc.; So, get
+ * a private copy.
+ */
+
+ tmp = make_string(subs->stptr, subs->stlen);
+
+ /*
+ * Set the numeric value for the index if it's available. Useful
+ * for numeric sorting by index. Do this only if the numeric
+ * value is available, instead of all the time, since doing it
+ * all the time is a big performance hit for something that may
+ * never be used.
+ */
+
+ if ((subs->flags & (MPFN|MPZN|NUMCUR)) == NUMCUR) {
+ tmp->numbr = subs->numbr;
+ tmp->flags |= NUMCUR;
+ }
+ subs = tmp;
+ } else {
+ /* string value already "frozen" */
+
+ subs = dupnode(subs);
+ }
+
+ getbucket(b);
+ b->ahnext = symbol->buckets[hash1];
+ symbol->buckets[hash1] = b;
+ b->ahname = subs;
+ b->ahname_str = subs->stptr;
+ b->ahname_len = subs->stlen;
+ b->ahvalue = dupnode(Nnull_string);
+ b->ahcode = code1;
+ return & (b->ahvalue);
+}
+
+/* str_exists --- test whether the array element symbol[subs] exists or not,
+ * return pointer to value if it does.
+ */
+
+static NODE **
+str_exists(NODE *symbol, NODE *subs)
+{
+ unsigned long hash1;
+ size_t code1;
+
+ if (symbol->table_size == 0)
+ return NULL;
+
+ subs = force_string(subs);
+ hash1 = hash(subs->stptr, subs->stlen, (unsigned long) symbol->array_size, & code1);
+ return str_find(symbol, subs, code1, hash1);
+}
+
+/* str_clear --- flush all the values in symbol[] */
+
+static NODE **
+str_clear(NODE *symbol, NODE *subs ATTRIBUTE_UNUSED)
+{
+ unsigned long i;
+ BUCKET *b, *next;
+ NODE *r;
+
+ for (i = 0; i < symbol->array_size; i++) {
+ for (b = symbol->buckets[i]; b != NULL; b = next) {
+ next = b->ahnext;
+ r = b->ahvalue;
+ if (r->type == Node_var_array) {
+ assoc_clear(r); /* recursively clear all sub-arrays */
+ efree(r->vname);
+ freenode(r);
+ } else
+ unref(r);
+ unref(b->ahname);
+ freebucket(b);
+ }
+ symbol->buckets[i] = NULL;
+ }
+
+ if (symbol->buckets != NULL)
+ efree(symbol->buckets);
+ init_array(symbol); /* re-initialize symbol */
+ symbol->flags &= ~ARRAYMAXED;
+ return NULL;
+}
+
+
+/* str_remove --- If SUBS is already in the table, remove it. */
+
+static NODE **
+str_remove(NODE *symbol, NODE *subs)
+{
+ unsigned long hash1;
+ BUCKET *b, *prev;
+ NODE *s2;
+ size_t s1_len;
+
+ if (symbol->table_size == 0)
+ return NULL;
+
+ s2 = force_string(subs);
+ hash1 = hash(s2->stptr, s2->stlen, (unsigned long) symbol->array_size, NULL);
+
+ for (b = symbol->buckets[hash1], prev = NULL; b != NULL;
+ prev = b, b = b->ahnext) {
+
+ /* Array indexes are strings; compare as such, always! */
+ s1_len = b->ahname_len;
+
+ if (s1_len != s2->stlen)
+ continue;
+ if (s1_len == 0 /* "" is a valid index */
+ || memcmp(b->ahname_str, s2->stptr, s1_len) == 0) {
+ /* item found */
+
+ unref(b->ahname);
+ if (prev != NULL)
+ prev->ahnext = b->ahnext;
+ else
+ symbol->buckets[hash1] = b->ahnext;
+
+ /* delete bucket */
+ freebucket(b);
+
+ /* one less element in array */
+ if (--symbol->table_size == 0) {
+ if (symbol->buckets != NULL)
+ efree(symbol->buckets);
+ init_array(symbol); /* re-initialize symbol */
+ symbol->flags &= ~ARRAYMAXED;
+ }
+
+ return (NODE **) ! NULL; /* return success */
+ }
+ }
+
+ return NULL;
+}
+
+
+/* str_copy --- duplicate input array "symbol" */
+
+static NODE **
+str_copy(NODE *symbol, NODE *newsymb)
+{
+ BUCKET **old, **new, **pnew;
+ BUCKET *chain, *newchain;
+ unsigned long cursize, i;
+
+ assert(symbol->table_size > 0);
+
+ /* find the current hash size */
+ cursize = symbol->array_size;
+
+ /* allocate new table */
+ emalloc(new, BUCKET **, cursize * sizeof(BUCKET *), "str_copy");
+ memset(new, '\0', cursize * sizeof(BUCKET *));
+
+ old = symbol->buckets;
+
+ for (i = 0; i < cursize; i++) {
+ for (chain = old[i], pnew = & new[i]; chain != NULL;
+ chain = chain->ahnext
+ ) {
+ NODE *oldval, *newsubs;
+
+ getbucket(newchain);
+
+ /*
+ * copy the corresponding name and
+ * value from the original input list
+ */
+
+ newsubs = newchain->ahname = dupnode(chain->ahname);
+ newchain->ahname_str = newsubs->stptr;
+ newchain->ahname_len = newsubs->stlen;
+
+ oldval = chain->ahvalue;
+ if (oldval->type == Node_val)
+ newchain->ahvalue = dupnode(oldval);
+ else {
+ NODE *r;
+
+ r = make_array();
+ r->vname = estrdup(oldval->vname, strlen(oldval->vname));
+ r->parent_array = newsymb;
+ newchain->ahvalue = assoc_copy(oldval, r);
+ }
+ newchain->ahcode = chain->ahcode;
+
+ *pnew = newchain;
+ pnew = & newchain->ahnext;
+ }
+ }
+
+ newsymb->table_size = symbol->table_size;
+ newsymb->buckets = new;
+ newsymb->array_size = cursize;
+ newsymb->flags = symbol->flags;
+ return NULL;
+}
+
+
+/* str_list --- return a list of array items */
+
+static NODE**
+str_list(NODE *symbol, NODE *t)
+{
+ NODE **list;
+ NODE *subs, *val;
+ BUCKET *b;
+ unsigned long num_elems, list_size, i, k = 0;
+ int elem_size = 1;
+
+ if (symbol->table_size == 0)
+ return NULL;
+
+ if ((t->flags & (AINDEX|AVALUE)) == (AINDEX|AVALUE))
+ elem_size = 2;
+
+ /* allocate space for array */
+ num_elems = symbol->table_size;
+ if ((t->flags & (AINDEX|AVALUE|ADELETE)) == (AINDEX|ADELETE))
+ num_elems = 1;
+ list_size = elem_size * num_elems;
+
+ emalloc(list, NODE **, list_size * sizeof(NODE *), "str_list");
+
+ /* populate it */
+
+ for (i = 0; i < symbol->array_size; i++) {
+ for (b = symbol->buckets[i]; b != NULL; b = b->ahnext) {
+ /* index */
+ subs = b->ahname;
+ if (t->flags & AINUM)
+ (void) force_number(subs);
+ list[k++] = dupnode(subs);
+
+ /* value */
+ if (t->flags & AVALUE) {
+ val = b->ahvalue;
+ if (val->type == Node_val) {
+ if ((t->flags & AVNUM) != 0)
+ (void) force_number(val);
+ else if ((t->flags & AVSTR) != 0)
+ val = force_string(val);
+ }
+ list[k++] = val;
+ }
+ if (k >= list_size)
+ return list;
+ }
+ }
+ return list;
+}
+
+
+/* str_kilobytes --- calculate memory consumption of the assoc array */
+
+AWKNUM
+str_kilobytes(NODE *symbol)
+{
+ unsigned long bucket_cnt;
+ AWKNUM kb;
+
+ bucket_cnt = symbol->table_size;
+
+ /* This does not include extra memory for indices with stfmt != -1 */
+ kb = (((AWKNUM) bucket_cnt) * sizeof (BUCKET) +
+ ((AWKNUM) symbol->array_size) * sizeof (BUCKET *)) / 1024.0;
+ return kb;
+}
+
+
+/* str_dump --- dump array info */
+
+static NODE **
+str_dump(NODE *symbol, NODE *ndump)
+{
+#define HCNT 31
+
+ int indent_level;
+ unsigned long i, bucket_cnt;
+ BUCKET *b;
+ static size_t hash_dist[HCNT + 1];
+
+ indent_level = ndump->alevel;
+
+ if ((symbol->flags & XARRAY) == 0)
+ fprintf(output_fp, "%s `%s'\n",
+ (symbol->parent_array == NULL) ? "array" : "sub-array",
+ array_vname(symbol));
+ indent_level++;
+ indent(indent_level);
+ fprintf(output_fp, "array_func: str_array_func\n");
+ if (symbol->flags != 0) {
+ indent(indent_level);
+ fprintf(output_fp, "flags: %s\n", flags2str(symbol->flags));
+ }
+ indent(indent_level);
+ fprintf(output_fp, "STR_CHAIN_MAX: %lu\n", (unsigned long) STR_CHAIN_MAX);
+ indent(indent_level);
+ fprintf(output_fp, "array_size: %lu\n", (unsigned long) symbol->array_size);
+ indent(indent_level);
+ fprintf(output_fp, "table_size: %lu\n", (unsigned long) symbol->table_size);
+ indent(indent_level);
+ fprintf(output_fp, "Avg # of items per chain: %.2g\n",
+ ((AWKNUM) symbol->table_size) / symbol->array_size);
+
+ indent(indent_level);
+ fprintf(output_fp, "memory: %.2g kB\n", str_kilobytes(symbol));
+
+ /* hash value distribution */
+
+ memset(hash_dist, '\0', (HCNT + 1) * sizeof(size_t));
+ for (i = 0; i < symbol->array_size; i++) {
+ bucket_cnt = 0;
+ for (b = symbol->buckets[i]; b != NULL; b = b->ahnext)
+ bucket_cnt++;
+ if (bucket_cnt >= HCNT)
+ bucket_cnt = HCNT;
+ hash_dist[bucket_cnt]++;
+ }
+
+ indent(indent_level);
+ fprintf(output_fp, "Hash distribution:\n");
+ indent_level++;
+ for (i = 0; i <= HCNT; i++) {
+ if (hash_dist[i] > 0) {
+ indent(indent_level);
+ if (i == HCNT)
+ fprintf(output_fp, "[>=%lu]:%lu\n",
+ (unsigned long) HCNT, (unsigned long) hash_dist[i]);
+ else
+ fprintf(output_fp, "[%lu]:%lu\n",
+ (unsigned long) i, (unsigned long) hash_dist[i]);
+ }
+ }
+ indent_level--;
+
+ /* dump elements */
+
+ if (ndump->adepth >= 0) {
+ const char *aname;
+
+ fprintf(output_fp, "\n");
+ aname = make_aname(symbol);
+ for (i = 0; i < symbol->array_size; i++) {
+ for (b = symbol->buckets[i]; b != NULL; b = b->ahnext)
+ assoc_info(b->ahname, b->ahvalue, ndump, aname);
+ }
+ }
+
+ return NULL;
+
+#undef HCNT
+}
+
+
+/* awk_hash --- calculate the hash function of the string in subs */
+
+static unsigned long
+awk_hash(const char *s, size_t len, unsigned long hsize, size_t *code)
+{
+ unsigned long h = 0;
+ unsigned long htmp;
+
+ /*
+ * Ozan Yigit's original sdbm hash, copied from Margo Seltzers
+ * db package.
+ *
+ * This is INCREDIBLY ugly, but fast. We break the string up into
+ * 8 byte units. On the first time through the loop we get the
+ * "leftover bytes" (strlen % 8). On every other iteration, we
+ * perform 8 HASHC's so we handle all 8 bytes. Essentially, this
+ * saves us 7 cmp & branch instructions. If this routine is
+ * heavily used enough, it's worth the ugly coding.
+ */
+
+ /*
+ * Even more speed:
+ * #define HASHC h = *s++ + 65599 * h
+ * Because 65599 = pow(2, 6) + pow(2, 16) - 1 we multiply by shifts
+ *
+ * 4/2011: Force the results to 32 bits, to get the same
+ * result on both 32- and 64-bit systems. This may be a
+ * bad idea.
+ */
+#define HASHC htmp = (h << 6); \
+ h = *s++ + htmp + (htmp << 10) - h ; \
+ htmp &= 0xFFFFFFFF; \
+ h &= 0xFFFFFFFF
+
+ h = 0;
+
+ /* "Duff's Device" */
+ if (len > 0) {
+ size_t loop = (len + 8 - 1) >> 3;
+
+ switch (len & (8 - 1)) {
+ case 0:
+ do { /* All fall throughs */
+ HASHC;
+ case 7: HASHC;
+ case 6: HASHC;
+ case 5: HASHC;
+ case 4: HASHC;
+ case 3: HASHC;
+ case 2: HASHC;
+ case 1: HASHC;
+ } while (--loop);
+ }
+ }
+
+ if (code != NULL)
+ *code = h;
+
+ if (h >= hsize)
+ h %= hsize;
+ return h;
+}
+
+
+/* str_find --- locate symbol[subs] */
+
+static inline NODE **
+str_find(NODE *symbol, NODE *s1, size_t code1, unsigned long hash1)
+{
+ BUCKET *b;
+ size_t s2_len;
+
+ for (b = symbol->buckets[hash1]; b != NULL; b = b->ahnext) {
+ /*
+ * This used to use cmp_nodes() here. That's wrong.
+ * Array indexes are strings; compare as such, always!
+ */
+ s2_len = b->ahname_len;
+
+ if (code1 == b->ahcode
+ && s1->stlen == s2_len
+ && (s2_len == 0 /* "" is a valid index */
+ || memcmp(s1->stptr, b->ahname_str, s2_len) == 0)
+ )
+ return & (b->ahvalue);
+ }
+ return NULL;
+}
+
+
+/* grow_table --- grow a hash table */
+
+static void
+grow_table(NODE *symbol)
+{
+ BUCKET **old, **new;
+ BUCKET *chain, *next;
+ int i, j;
+ unsigned long oldsize, newsize, k;
+ unsigned long hash1;
+
+ /*
+ * This is an array of primes. We grow the table by an order of
+ * magnitude each time (not just doubling) so that growing is a
+ * rare operation. We expect, on average, that it won't happen
+ * more than twice. The final size is also chosen to be small
+ * enough so that MS-DOG mallocs can handle it. When things are
+ * very large (> 8K), we just double more or less, instead of
+ * just jumping from 8K to 64K.
+ */
+
+ static const unsigned long sizes[] = {
+ 13, 127, 1021, 8191, 16381, 32749, 65497,
+ 131101, 262147, 524309, 1048583, 2097169,
+ 4194319, 8388617, 16777259, 33554467,
+ 67108879, 134217757, 268435459, 536870923,
+ 1073741827
+ };
+
+ /* find next biggest hash size */
+ newsize = oldsize = symbol->array_size;
+
+ for (i = 0, j = sizeof(sizes)/sizeof(sizes[0]); i < j; i++) {
+ if (oldsize < sizes[i]) {
+ newsize = sizes[i];
+ break;
+ }
+ }
+ if (newsize == oldsize) { /* table already at max (!) */
+ symbol->flags |= ARRAYMAXED;
+ return;
+ }
+
+ /* allocate new table */
+ emalloc(new, BUCKET **, newsize * sizeof(BUCKET *), "grow_table");
+ memset(new, '\0', newsize * sizeof(BUCKET *));
+
+ old = symbol->buckets;
+ symbol->buckets = new;
+ symbol->array_size = newsize;
+
+ /* brand new hash table, set things up and return */
+ if (old == NULL) {
+ symbol->table_size = 0;
+ return;
+ }
+
+ /* old hash table there, move stuff to new, free old */
+
+ /*
+ * note that symbol->table_size does not change if an old array,
+ * and is explicitly set to 0 if a new one.
+ */
+
+ for (k = 0; k < oldsize; k++) {
+ for (chain = old[k]; chain != NULL; chain = next) {
+ next = chain->ahnext;
+ hash1 = chain->ahcode % newsize;
+
+ /* remove from old list, add to new */
+ chain->ahnext = new[hash1];
+ new[hash1] = chain;
+ }
+ }
+ efree(old);
+}
+
+
+
+/*
+From bonzini@gnu.org Mon Oct 28 16:05:26 2002
+Date: Mon, 28 Oct 2002 13:33:03 +0100
+From: Paolo Bonzini <bonzini@gnu.org>
+To: arnold@skeeve.com
+Subject: Hash function
+Message-ID: <20021028123303.GA6832@biancaneve>
+
+Here is the hash function I'm using in GNU Smalltalk. The scrambling is
+needed if you use powers of two as the table sizes. If you use primes it
+is not needed.
+
+To use double-hashing with power-of-two size, you should use the
+_gst_hash_string(str, len) as the primary hash and
+scramble(_gst_hash_string (str, len)) | 1 as the secondary hash.
+
+Paolo
+
+*/
+/*
+ * ADR: Slightly modified to work w/in the context of gawk.
+ */
+
+static unsigned long
+gst_hash_string(const char *str, size_t len, unsigned long hsize, size_t *code)
+{
+ unsigned long hashVal = 1497032417; /* arbitrary value */
+ unsigned long ret;
+
+ while (len--) {
+ hashVal += *str++;
+ hashVal += (hashVal << 10);
+ hashVal ^= (hashVal >> 6);
+ }
+
+ ret = scramble(hashVal);
+
+ if (code != NULL)
+ *code = ret;
+
+ if (ret >= hsize)
+ ret %= hsize;
+
+ return ret;
+}
+
+static unsigned long
+scramble(unsigned long x)
+{
+ if (sizeof(long) == 4) {
+ int y = ~x;
+
+ x += (y << 10) | (y >> 22);
+ x += (x << 6) | (x >> 26);
+ x -= (x << 16) | (x >> 16);
+ } else {
+ x ^= (~x) >> 31;
+ x += (x << 21) | (x >> 11);
+ x += (x << 5) | (x >> 27);
+ x += (x << 27) | (x >> 5);
+ x += (x << 31);
+ }
+
+ return x;
+}
diff --git a/symbol.c b/symbol.c
new file mode 100644
index 00000000..e698298f
--- /dev/null
+++ b/symbol.c
@@ -0,0 +1,855 @@
+/*
+ * symbol.c - routines for symbol table management and code allocation
+ */
+
+/*
+ * Copyright (C) 1986, 1988, 1989, 1991-2011 the Free Software Foundation, Inc.
+ *
+ * This file is part of GAWK, the GNU implementation of the
+ * AWK Programming Language.
+ *
+ * GAWK is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GAWK is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "awk.h"
+
+extern SRCFILE *srcfiles;
+extern INSTRUCTION *rule_list;
+
+#define HASHSIZE 1021
+
+static int func_count; /* total number of functions */
+static int var_count; /* total number of global variables and functions */
+
+static NODE *symbol_list;
+static void (*install_func)(NODE *) = NULL;
+static NODE *make_symbol(char *name, NODETYPE type);
+static NODE *install(char *name, NODE *parm, NODETYPE type);
+static void free_bcpool(INSTRUCTION *pl);
+
+static AWK_CONTEXT *curr_ctxt = NULL;
+static int ctxt_level;
+
+static NODE *global_table, *param_table;
+NODE *symbol_table, *func_table;
+
+/* Use a flag to avoid a strcmp() call inside install() */
+static bool installing_specials = false;
+
+/* init_symbol_table --- make sure the symbol tables are initialized */
+
+void
+init_symbol_table()
+{
+ getnode(global_table);
+ memset(global_table, '\0', sizeof(NODE));
+ init_array(global_table);
+
+ getnode(param_table);
+ memset(param_table, '\0', sizeof(NODE));
+ init_array(param_table);
+
+ installing_specials = true;
+ func_table = install_symbol(estrdup("FUNCTAB", 7), Node_var_array);
+
+ symbol_table = install_symbol(estrdup("SYMTAB", 6), Node_var_array);
+ installing_specials = false;
+}
+
+/*
+ * install_symbol:
+ * Install a global name in the symbol table, even if it is already there.
+ * Caller must check against redefinition if that is desired.
+ */
+
+NODE *
+install_symbol(char *name, NODETYPE type)
+{
+ return install(name, NULL, type);
+}
+
+
+/*
+ * lookup --- find the most recent global or param node for name
+ * installed by install_symbol
+ */
+
+NODE *
+lookup(const char *name)
+{
+ NODE *n;
+ NODE *tmp;
+ NODE *tables[5]; /* manual init below, for z/OS */
+ int i;
+
+ /* ``It's turtles, all the way down.'' */
+ tables[0] = param_table; /* parameters shadow everything */
+ tables[1] = global_table; /* SYMTAB and FUNCTAB found first, can't be redefined */
+ tables[2] = func_table; /* then functions */
+ tables[3] = symbol_table; /* then globals */
+ tables[4] = NULL;
+
+ tmp = make_string(name, strlen(name));
+
+ n = NULL;
+ for (i = 0; tables[i] != NULL; i++) {
+ if (tables[i]->table_size == 0)
+ continue;
+
+ if ((do_posix || do_traditional) && tables[i] == global_table)
+ continue;
+
+ n = in_array(tables[i], tmp);
+ if (n != NULL) {
+ unref(tmp);
+ return n;
+ }
+ }
+
+ unref(tmp);
+ return n; /* NULL */
+}
+
+/* make_params --- allocate function parameters for the symbol table */
+
+NODE *
+make_params(char **pnames, int pcount)
+{
+ NODE *p, *parms;
+ int i;
+
+ if (pcount <= 0 || pnames == NULL)
+ return NULL;
+
+ emalloc(parms, NODE *, pcount * sizeof(NODE), "make_params");
+ memset(parms, '\0', pcount * sizeof(NODE));
+
+ for (i = 0, p = parms; i < pcount; i++, p++) {
+ p->type = Node_param_list;
+ p->param = pnames[i]; /* shadows pname and vname */
+ p->param_cnt = i;
+ }
+
+ return parms;
+}
+
+/* install_params --- install function parameters into the symbol table */
+
+void
+install_params(NODE *func)
+{
+ int i, pcount;
+ NODE *parms;
+
+ if (func == NULL)
+ return;
+ assert(func->type == Node_func);
+ if ((pcount = func->param_cnt) <= 0
+ || (parms = func->fparms) == NULL
+ )
+ return;
+ for (i = 0; i < pcount; i++)
+ (void) install(parms[i].param, parms + i, Node_param_list);
+}
+
+
+/*
+ * remove_params --- remove function parameters out of the symbol table.
+ */
+
+void
+remove_params(NODE *func)
+{
+ NODE *parms, *p;
+ int i, pcount;
+
+ if (func == NULL)
+ return;
+ assert(func->type == Node_func);
+ if ((pcount = func->param_cnt) <= 0
+ || (parms = func->fparms) == NULL
+ )
+ return;
+
+ for (i = pcount - 1; i >= 0; i--) {
+ NODE *tmp;
+ NODE *tmp2;
+
+ p = parms + i;
+ assert(p->type == Node_param_list);
+ tmp = make_string(p->vname, strlen(p->vname));
+ tmp2 = in_array(param_table, tmp);
+ if (tmp2 != NULL && tmp2->dup_ent != NULL) {
+ tmp2->dup_ent = tmp2->dup_ent->dup_ent;
+ } else {
+ (void) assoc_remove(param_table, tmp);
+ }
+ unref(tmp);
+ }
+
+ assoc_clear(param_table); /* shazzam! */
+}
+
+
+/* remove_symbol --- remove a symbol from the symbol table */
+
+NODE *
+remove_symbol(NODE *r)
+{
+ NODE *n = in_array(symbol_table, r);
+
+ if (n == NULL)
+ return n;
+
+ n = dupnode(n);
+
+ (void) assoc_remove(symbol_table, r);
+
+ return n;
+}
+
+
+/* destroy_symbol --- remove a symbol from symbol table
+* and free all associated memory.
+*/
+
+void
+destroy_symbol(NODE *r)
+{
+ r = remove_symbol(r);
+ if (r == NULL)
+ return;
+
+ switch (r->type) {
+ case Node_func:
+ if (r->param_cnt > 0) {
+ NODE *n;
+ int i;
+ int pcount = r->param_cnt;
+
+ /* function parameters of type Node_param_list */
+ for (i = 0; i < pcount; i++) {
+ n = r->fparms + i;
+ efree(n->param);
+ }
+ efree(r->fparms);
+ }
+ break;
+
+ case Node_ext_func:
+ bcfree(r->code_ptr);
+ break;
+
+ case Node_var_array:
+ assoc_clear(r);
+ break;
+
+ case Node_var:
+ unref(r->var_value);
+ break;
+
+ default:
+ /* Node_param_list -- YYABORT */
+ return;
+ }
+
+ efree(r->vname);
+ freenode(r);
+}
+
+
+/* make_symbol --- allocates a global symbol for the symbol table. */
+
+static NODE *
+make_symbol(char *name, NODETYPE type)
+{
+ NODE *r;
+
+ getnode(r);
+ memset(r, '\0', sizeof(NODE));
+ if (type == Node_var_array)
+ init_array(r);
+ else if (type == Node_var)
+ r->var_value = dupnode(Nnull_string);
+ r->vname = name;
+ r->type = type;
+
+ return r;
+}
+
+/* install --- install a global name or function parameter in the symbol table */
+
+static NODE *
+install(char *name, NODE *parm, NODETYPE type)
+{
+ NODE *r;
+ NODE **aptr;
+ NODE *table;
+ NODE *n_name;
+ NODE *prev;
+
+ n_name = make_string(name, strlen(name));
+ table = symbol_table;
+
+ if (type == Node_param_list) {
+ table = param_table;
+ } else if (type == Node_func || type == Node_ext_func) {
+ table = func_table;
+ } else if (installing_specials) {
+ table = global_table;
+ }
+
+ if (parm != NULL) {
+ r = parm;
+ } else {
+ /* global symbol */
+ r = make_symbol(name, type);
+ if (type == Node_func)
+ func_count++;
+ if (type != Node_ext_func && table != global_table)
+ var_count++; /* total, includes Node_func */
+ }
+
+ if (type == Node_param_list) {
+ prev = in_array(table, n_name);
+ if (prev == NULL)
+ goto simple;
+ r->dup_ent = prev->dup_ent;
+ prev->dup_ent = r;
+ } else {
+simple:
+ /* the simple case */
+ aptr = assoc_lookup(table, n_name);
+ unref(*aptr);
+ *aptr = r;
+ }
+ unref(n_name);
+
+ if (install_func)
+ (*install_func)(r);
+
+ return r;
+}
+
+
+/* comp_symbol --- compare two (variable or function) names */
+
+static int
+comp_symbol(const void *v1, const void *v2)
+{
+ const NODE *const *npp1, *const *npp2;
+ const NODE *n1, *n2;
+
+ npp1 = (const NODE *const *) v1;
+ npp2 = (const NODE *const *) v2;
+ n1 = *npp1;
+ n2 = *npp2;
+
+ return strcmp(n1->vname, n2->vname);
+}
+
+
+typedef enum { FUNCTION = 1, VARIABLE } SYMBOL_TYPE;
+
+/* get_symbols --- return a list of optionally sorted symbols */
+
+static NODE **
+get_symbols(SYMBOL_TYPE what, int sort)
+{
+ int i;
+ NODE **table;
+ NODE **list;
+ NODE *r;
+ long j, count = 0;
+ long max;
+ NODE *the_table;
+
+ if (what == FUNCTION) {
+ count = func_count;
+ the_table = func_table;
+
+ max = the_table->table_size * 2;
+ list = assoc_list(the_table, "@unsorted", ASORTI);
+ emalloc(table, NODE **, (count + 1) * sizeof(NODE *), "symbol_list");
+
+ for (i = j = 0; i < max; i += 2) {
+ r = list[i+1];
+ if (r->type == Node_ext_func)
+ continue;
+ assert(r->type == Node_func);
+ table[j++] = r;
+ }
+ } else { /* what == VARIABLE */
+ the_table = symbol_table;
+ count = var_count;
+
+ update_global_values();
+
+ max = the_table->table_size * 2;
+ list = assoc_list(the_table, "@unsorted", ASORTI);
+ emalloc(table, NODE **, (count + 1) * sizeof(NODE *), "symbol_list");
+
+ for (i = j = 0; i < max; i += 2) {
+ r = list[i+1];
+ if (r->vname == NULL) /* non-variable in SYMTAB */
+ continue;
+ table[j++] = r;
+ }
+ }
+
+ efree(list);
+
+ if (sort && count > 1)
+ qsort(table, count, sizeof(NODE *), comp_symbol); /* Shazzam! */
+ table[count] = NULL; /* null terminate the list */
+ return table;
+}
+
+
+/* variable_list --- list of global variables */
+
+NODE **
+variable_list()
+{
+ return get_symbols(VARIABLE, true);
+}
+
+/* function_list --- list of functions */
+
+NODE **
+function_list(int sort)
+{
+ return get_symbols(FUNCTION, sort);
+}
+
+/* print_vars --- print names and values of global variables */
+
+void
+print_vars(NODE **table, int (*print_func)(FILE *, const char *, ...), FILE *fp)
+{
+ int i;
+ NODE *r;
+
+ assert(table != NULL);
+
+ for (i = 0; (r = table[i]) != NULL; i++) {
+ if (r->type == Node_func || r->type == Node_ext_func)
+ continue;
+ print_func(fp, "%s: ", r->vname);
+ if (r->type == Node_var_array)
+ print_func(fp, "array, %ld elements\n", r->table_size);
+ else if (r->type == Node_var_new)
+ print_func(fp, "untyped variable\n");
+ else if (r->type == Node_var)
+ valinfo(r->var_value, print_func, fp);
+ }
+}
+
+
+/* foreach_func --- execute given function for each awk function in table. */
+
+int
+foreach_func(NODE **table, int (*pfunc)(INSTRUCTION *, void *), void *data)
+{
+ int i;
+ NODE *r;
+ int ret = 0;
+
+ assert(table != NULL);
+
+ for (i = 0; (r = table[i]) != NULL; i++) {
+ if ((ret = pfunc(r->code_ptr, data)) != 0)
+ break;
+ }
+ return ret;
+}
+
+/* release_all_vars --- free all variable memory */
+
+void
+release_all_vars()
+{
+ assoc_clear(symbol_table);
+ assoc_clear(func_table);
+ assoc_clear(global_table);
+}
+
+
+/* append_symbol --- append symbol to the list of symbols
+ * installed in the symbol table.
+ */
+
+void
+append_symbol(NODE *r)
+{
+ NODE *p;
+
+ getnode(p);
+ p->lnode = r;
+ p->rnode = symbol_list->rnode;
+ symbol_list->rnode = p;
+}
+
+/* release_symbol --- free symbol list and optionally remove symbol from symbol table */
+
+void
+release_symbols(NODE *symlist, int keep_globals)
+{
+ NODE *p, *next;
+
+ for (p = symlist->rnode; p != NULL; p = next) {
+ if (! keep_globals) {
+ /* destroys globals, function, and params
+ * if still in symbol table
+ */
+ destroy_symbol(p->lnode);
+ }
+ next = p->rnode;
+ freenode(p);
+ }
+ symlist->rnode = NULL;
+}
+
+/* load_symbols --- fill in symbols' information */
+
+void
+load_symbols()
+{
+ NODE *r;
+ NODE *tmp;
+ NODE *sym_array;
+ NODE **aptr;
+ long i, j, max;
+ NODE *user, *extension, *untyped, *scalar, *array;
+ NODE **list;
+ NODE *tables[4];
+
+ if (PROCINFO_node == NULL)
+ return;
+
+ tables[0] = func_table;
+ tables[1] = symbol_table;
+ tables[2] = global_table;
+ tables[3] = NULL;
+
+ tmp = make_string("identifiers", 11);
+ aptr = assoc_lookup(PROCINFO_node, tmp);
+
+ getnode(sym_array);
+ memset(sym_array, '\0', sizeof(NODE)); /* PPC Mac OS X wants this */
+ init_array(sym_array);
+
+ unref(*aptr);
+ *aptr = sym_array;
+
+ sym_array->parent_array = PROCINFO_node;
+ sym_array->vname = estrdup("identifiers", 11);
+ make_aname(sym_array);
+
+ user = make_string("user", 4);
+ extension = make_string("extension", 9);
+ scalar = make_string("scalar", 6);
+ untyped = make_string("untyped", 7);
+ array = make_string("array", 5);
+
+ for (i = 0; tables[i] != NULL; i++) {
+ list = assoc_list(tables[i], "@unsorted", ASORTI);
+ max = tables[i]->table_size * 2;
+ if (max == 0)
+ continue;
+ for (j = 0; j < max; j += 2) {
+ r = list[j+1];
+ if ( r->type == Node_ext_func
+ || r->type == Node_func
+ || r->type == Node_var
+ || r->type == Node_var_array
+ || r->type == Node_var_new) {
+ tmp = make_string(r->vname, strlen(r->vname));
+ aptr = assoc_lookup(sym_array, tmp);
+ unref(tmp);
+ unref(*aptr);
+ switch (r->type) {
+ case Node_ext_func:
+ *aptr = dupnode(extension);
+ break;
+ case Node_func:
+ *aptr = dupnode(user);
+ break;
+ case Node_var:
+ *aptr = dupnode(scalar);
+ break;
+ case Node_var_array:
+ *aptr = dupnode(array);
+ break;
+ case Node_var_new:
+ *aptr = dupnode(untyped);
+ break;
+ default:
+ cant_happen();
+ break;
+ }
+ }
+ }
+ efree(list);
+ }
+
+ unref(user);
+ unref(extension);
+ unref(scalar);
+ unref(untyped);
+ unref(array);
+}
+
+#define pool_size d.dl
+#define freei x.xi
+static INSTRUCTION *pool_list;
+
+/* INSTR_CHUNK must be > largest code size (3) */
+#define INSTR_CHUNK 127
+
+/* bcfree --- deallocate instruction */
+
+void
+bcfree(INSTRUCTION *cp)
+{
+ cp->opcode = 0;
+ cp->nexti = pool_list->freei;
+ pool_list->freei = cp;
+}
+
+/* bcalloc --- allocate a new instruction */
+
+INSTRUCTION *
+bcalloc(OPCODE op, int size, int srcline)
+{
+ INSTRUCTION *cp;
+
+ if (size > 1) {
+ /* wide instructions Op_rule, Op_func_call .. */
+ emalloc(cp, INSTRUCTION *, (size + 1) * sizeof(INSTRUCTION), "bcalloc");
+ cp->pool_size = size;
+ cp->nexti = pool_list->nexti;
+ pool_list->nexti = cp++;
+ } else {
+ INSTRUCTION *pool;
+
+ pool = pool_list->freei;
+ if (pool == NULL) {
+ INSTRUCTION *last;
+ emalloc(cp, INSTRUCTION *, (INSTR_CHUNK + 1) * sizeof(INSTRUCTION), "bcalloc");
+
+ cp->pool_size = INSTR_CHUNK;
+ cp->nexti = pool_list->nexti;
+ pool_list->nexti = cp;
+ pool = ++cp;
+ last = &pool[INSTR_CHUNK - 1];
+ for (; cp <= last; cp++) {
+ cp->opcode = 0;
+ cp->nexti = cp + 1;
+ }
+ --cp;
+ cp->nexti = NULL;
+ }
+ cp = pool;
+ pool_list->freei = cp->nexti;
+ }
+
+ memset(cp, 0, size * sizeof(INSTRUCTION));
+ cp->opcode = op;
+ cp->source_line = srcline;
+ return cp;
+}
+
+/* new_context --- create a new execution context. */
+
+AWK_CONTEXT *
+new_context()
+{
+ AWK_CONTEXT *ctxt;
+
+ emalloc(ctxt, AWK_CONTEXT *, sizeof(AWK_CONTEXT), "new_context");
+ memset(ctxt, 0, sizeof(AWK_CONTEXT));
+ ctxt->srcfiles.next = ctxt->srcfiles.prev = & ctxt->srcfiles;
+ ctxt->rule_list.opcode = Op_list;
+ ctxt->rule_list.lasti = & ctxt->rule_list;
+ return ctxt;
+}
+
+/* set_context --- change current execution context. */
+
+static void
+set_context(AWK_CONTEXT *ctxt)
+{
+ pool_list = & ctxt->pools;
+ symbol_list = & ctxt->symbols;
+ srcfiles = & ctxt->srcfiles;
+ rule_list = & ctxt->rule_list;
+ install_func = ctxt->install_func;
+ curr_ctxt = ctxt;
+}
+
+/*
+ * push_context:
+ *
+ * Switch to the given context after saving the current one. The set
+ * of active execution contexts forms a stack; the global or main context
+ * is at the bottom of the stack.
+ */
+
+void
+push_context(AWK_CONTEXT *ctxt)
+{
+ ctxt->prev = curr_ctxt;
+ /* save current source and sourceline */
+ if (curr_ctxt != NULL) {
+ curr_ctxt->sourceline = sourceline;
+ curr_ctxt->source = source;
+ }
+ sourceline = 0;
+ source = NULL;
+ set_context(ctxt);
+ ctxt_level++;
+}
+
+/* pop_context --- switch to previous execution context. */
+
+void
+pop_context()
+{
+ AWK_CONTEXT *ctxt;
+
+ assert(curr_ctxt != NULL);
+ if (curr_ctxt->prev == NULL)
+ fatal(_("can not pop main context"));
+ ctxt = curr_ctxt->prev;
+ /* restore source and sourceline */
+ sourceline = ctxt->sourceline;
+ source = ctxt->source;
+ set_context(ctxt);
+ ctxt_level--;
+}
+
+/* in_main_context --- are we in the main context ? */
+
+int
+in_main_context()
+{
+ assert(ctxt_level > 0);
+ return (ctxt_level == 1);
+}
+
+/* free_context --- free context structure and related data. */
+
+void
+free_context(AWK_CONTEXT *ctxt, bool keep_globals)
+{
+ SRCFILE *s, *sn;
+
+ if (ctxt == NULL)
+ return;
+
+ assert(curr_ctxt != ctxt);
+
+ /* free all code including function codes */
+
+ free_bcpool(& ctxt->pools);
+
+ /* free symbols */
+
+ release_symbols(& ctxt->symbols, keep_globals);
+
+ /* free srcfiles */
+
+ for (s = & ctxt->srcfiles; s != & ctxt->srcfiles; s = sn) {
+ sn = s->next;
+ if (s->stype != SRC_CMDLINE && s->stype != SRC_STDIN)
+ efree(s->fullpath);
+ efree(s->src);
+ efree(s);
+ }
+
+ efree(ctxt);
+}
+
+/* free_bc_internal --- free internal memory of an instruction. */
+
+static void
+free_bc_internal(INSTRUCTION *cp)
+{
+ NODE *m;
+
+ switch(cp->opcode) {
+ case Op_func_call:
+ if (cp->func_name != NULL)
+ efree(cp->func_name);
+ break;
+ case Op_push_re:
+ case Op_match_rec:
+ case Op_match:
+ case Op_nomatch:
+ m = cp->memory;
+ if (m->re_reg != NULL)
+ refree(m->re_reg);
+ if (m->re_exp != NULL)
+ unref(m->re_exp);
+ if (m->re_text != NULL)
+ unref(m->re_text);
+ freenode(m);
+ break;
+ case Op_token:
+ /* token lost during error recovery in yyparse */
+ if (cp->lextok != NULL)
+ efree(cp->lextok);
+ break;
+ case Op_push_i:
+ m = cp->memory;
+ unref(m);
+ break;
+ case Op_store_var:
+ m = cp->initval;
+ if (m != NULL)
+ unref(m);
+ break;
+ case Op_illegal:
+ cant_happen();
+ default:
+ break;
+ }
+}
+
+/* free_bcpool --- free list of instruction memory pools */
+
+static void
+free_bcpool(INSTRUCTION *pl)
+{
+ INSTRUCTION *pool, *tmp;
+
+ for (pool = pl->nexti; pool != NULL; pool = tmp) {
+ INSTRUCTION *cp, *last;
+ long psiz;
+ psiz = pool->pool_size;
+ if (psiz == INSTR_CHUNK)
+ last = pool + psiz;
+ else
+ last = pool + 1;
+ for (cp = pool + 1; cp <= last ; cp++) {
+ if (cp->opcode != 0)
+ free_bc_internal(cp);
+ }
+ tmp = pool->nexti;
+ efree(pool);
+ }
+ memset(pl, 0, sizeof(INSTRUCTION));
+}
diff --git a/test/ChangeLog b/test/ChangeLog
index 5dbc11a4..55c6494c 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,17 +1,200 @@
+2012-11-10 Arnold D. Robbins <arnold@skeeve.com>
+
+ * symtab4.awk, symtab4.in, symtab4.ok, symtab5.awk, symtab5.in,
+ symtab5.ok, symtab6.awk: New files.
+ * Makefile.am (EXTRA_DIST): Add new files.
+ (symtab4, symtab5, symtab6): New tests.
+ Thanks to Assaf Gordon <gordon@cshl.edu>.
+
+2012-10-28 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * messages.awk, fts.awk: Adjusted so make diffout will work.
+ * Makefile.am (messages): Adjust to use standard failure test for
+ make diffout.
+
+2012-10-19 Arnold D. Robbins <arnold@skeeve.com>
+
+ * symtab1.awk: Adjust to not print ENVIRON and PROCINFO which won't
+ be the same as on the author's machine.
+ * lintwarn.ok: Adjust.
+
2012-10-13 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (EXTRA_DIST): Add jarebug.sh.
+2012-10-11 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (readdir): Use $(top_srcdir) instead of `.'. Helps
+ when running the valgrind tests.
+
+2012-10-11 Arnold D. Robbins <arnold@skeeve.com>
+
+ * testext.ok: Updated.
+
+2012-10-04 Akim Demaille <akim@lrde.epita.fr>
+
+ Fix VPATH builds.
+
+ * Makefile.am (shlib-tests): config.h is in builddir.
+ (beginfile2): So is gawk itself.
+
+ * Makefile.am (functab1, functab2, functab3, functab4, id, symtab1,
+ symtab2, symtab3): New tests.
+ * functab1.awk, functab1.ok, functab2.awk, functab2.ok, functab3.awk,
+ functab3.ok, functab4.awk, functab4.ok, id.awk, id.ok, symtab1.awk,
+ symtab1.ok, symtab2.awk, symtab2.ok, symtab3.awk, symtab3.ok:
+ New files.
+
2012-09-23 Arnold D. Robbins <arnold@skeeve.com>
* lintwarn.ok: Updated.
+2012-09-14 Arnold D. Robbins <arnold@skeeve.com>
+
+ * testext.ok: Updated. Twice.
+
+2012-09-11 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (shlib-tests): Check if DYNAMIC is enabled and
+ only if so run the tests. A bit hacky. Needed at least for
+ z/OS.
+
+2012-09-07 Arnold D. Robbins <arnold@skeeve.com>
+
+ * readdir.awk: Change argument to readdir_do_ftype().
+
+2012-08-28 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (EXTRA_DIST): Add jarebug.sh.
+ (readdir): Use standard output filenames readdir.ok and _readdir
+ instead of readdir.out1 and readdir.out2. The standard names are
+ required for the pass-fail and diffout rules to work correctly.
+ (clean): Remove readdir.ok
+
2012-08-26 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (charasbytes): Revise test to canonicalize
whitespace. (For Mac OS X 10.5, at least.)
* charasbytes.ok: Updated.
+2012-08-23 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (revout, revtwoway): New tests.
+ * revout.awk, revout.ok, revtwoway.awk, revtwoway.ok: New files.
+
+2012-08-11 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (EXTRA_DIST): Add inchello.awk and incdupe[4-7].ok.
+ (GAWK_EXT_TESTS): Add incdupe[4-7].
+ (incdupe[4-7]): New tests to ensure that mixing -f with include
+ causes a fatal error.
+ * incdupe[4-7].ok, inchello.awk: New files.
+
+2012-08-08 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (fts): New test.
+ * fts.awk: New file.
+
+2012-07-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (assignconst): Use AWKPATH to get results that will
+ be consistent no matter where the test is run.
+ * assignconst.ok: Updated.
+
+2012-07-29 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (readdir): New test.
+ * readdir0.awk, readdir.awk: New files.
+
+2012-07-16 Arnold D. Robbins <arnold@skeeve.com>
+
+ * fnmatch.awk, fnmatch.ok: Portability updates.
+
+2012-07-15 Arnold D. Robbins <arnold@skeeve.com>
+
+ * testext.ok: Update contents.
+
+2012-07-12 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (fnmatch): New test.
+ * fnmatch.awk, fnmatch.ok: New files.
+
+ * Makefile.am (assignconst): New test.
+ * assignconst.awk, assignconst.ok: New files.
+
+2012-06-28 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * time.awk: Avoid possibly throwing a spurious error by protecting
+ a race condition that depends on the order of expression evaluation.
+
+2012-06-25 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (rwarray): New test.
+ * rwarray.awk, rwarray.in, rwarray.ok: New files.
+
+2012-06-21 Arnold D. Robbins <arnold@skeeve.com>
+
+ * testext.ok: Update contents.
+
+2012-06-20 Arnold D. Robbins <arnold@skeeve.com>
+
+ * testext.ok: Update contents.
+
+2012-06-19 Arnold D. Robbins <arnold@skeeve.com>
+
+ * testext.ok: Update contents.
+
+2012-06-18 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (testext): New test.
+ (EXTRA_DIST): Add new file testext.ok.
+ (SHLIB_TESTS): Add testext.
+ (clean): Add testext.awk to the list.
+ * testext.ok: New file.
+
+2012-06-12 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (clean): Add fork.tmp.* to the list.
+
+2012-06-10 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (EXTRA_DIST): Add new files time.awk and time.ok.
+ (SHLIB_TESTS): Add time.
+ * time.awk, time.ok: New files.
+
+2012-05-29 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (clean): Add readfile.ok to list of files to removed.
+
+2012-05-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (readfile): Revert previous patch, and add comment
+ explaining that we need to create readfile.ok on failure so that
+ "make diffout" will work properly.
+ (ordchr.awk, ordchr.ok): Add more tests to catch type conversion
+ problems.
+
+2012-05-25 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (readfile): Don't copy the Makefile over readfile.ok
+ if there's a problem.
+
+2012-05-24 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (fmtspcl, include2, incdupe, incdup2, incdupe3): Fix
+ paths to work properly when built in another directory.
+
+2012-05-19 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (EXTRA_DIST): Add new files hello.awk, inclib.awk,
+ include.awk, include.ok, include2.ok, incdupe.ok, incdupe2.ok and
+ incdupe3.ok.
+ (GAWK_EXT_TESTS): Add include, include2, incdupe, incdupe2 and incdupe3.
+ (include2, incdupe, incdupe2, incdupe3): New tests.
+ * badargs.ok: Fix usage message to include new -i option.
+ * hello.awk, incdupe.ok, incdupe2.ok, incdupe3.ok, inclib.awk,
+ include.awk, include.ok, include2.ok: New files.
+
2012-08-12 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (regexprange): New test.
@@ -53,6 +236,63 @@
* Makefile.am (jarebug): New test.
* jarebug.awk, jarebug.in, jarebug.ok: New files.
+2012-04-08 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (VALGRIND): Set to empty to protect against random
+ values in the environment.
+
+2012-04-08 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (EXTRA_DIST): Add missing files fork.ok, fork2.ok
+ and ordchr2.ok.
+
+2012-04-08 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (AWK, PGAWK): Include new $(VALGRIND) variable in
+ command line (now passed in by top-level Makefile).
+
+2012-04-07 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (ordchr2, readfile): Fix so "make diffout" will work
+ properly.
+ * orchr2.ok: New file.
+
+2012-04-07 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (check): Add new shlib-tests target.
+ (SHLIB_TESTS): Add tests ordchr, ordchr2, fork, fork2, readfile and
+ filefuncs.
+ * ordchr.awk, ordchr.ok, fork.awk, fork.ok, fork2.awk, fork2.ok,
+ filefuncs.awk, filefuncs.ok: New files.
+
+2012-04-01 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (valgrind-scan): Update to match modern valgrind output.
+
+2012-04-01 John Haque <j.eh@mchsi.com>
+
+ * Makefile.am (mpfr-test): Add target for manual testing of MPFR
+ and GMP numbers.
+ * mpfrbigint.awk, mpfrexprange.awk, mpfrieee.awk, mpfrnr.awk,
+ mpfrrnd.awk, mpfrsort.awk: New tests.
+ (MPFR_TESTS): Add the new tests.
+ * mpfrnr.in, mpfrbigint.ok, mpfrexprange.ok, mpfrieee.ok, mpfrnr.ok,
+ mpfrrnd.ok, mpfrsort.ok: New files.
+ (AWK): Add AWKFLAGS; useful for testing with 'gawk -M' invocation.
+
+2012-02-28 Arnold D. Robbins <arnold@skeeve.com>
+
+ * fmtspcl-mpfr.ok, fnarydel-mpfr.ok, fnparydl-mpfr.ok,
+ rand-mpfr.ok: New files.
+ * Makefile.am (EXTRA_DIST): Add them.
+ (CHECK_MPFR): New list of files that have MPFR variant .ok file.
+ * Gentests: Deal with MPFR files by modifying the generated
+ comparison command.
+
+2011-12-26 John Haque <j.eh@mchsi.com>
+
+ * badargs.ok: Adjust for new and changed command line options.
+
2012-03-28 Arnold D. Robbins <arnold@skeeve.com>
* 4.0.1: Release tar ball made.
diff --git a/test/Gentests b/test/Gentests
index fc779f00..ae56b8cc 100755
--- a/test/Gentests
+++ b/test/Gentests
@@ -45,6 +45,13 @@ BEGIN {
next
}
+/^CHECK_MPFR *=/,/[^\\]$/ {
+ gsub(/(^CHECK_MPFR *=|\\$)/,"")
+ for (i = 1; i <= NF; i++)
+ mpfr[$i]
+ next
+}
+
/^[[:alpha:]_][[:alnum:]_]*:/ {
# remember all targets from Makefile.am
sub(/:.*/,"")
@@ -91,9 +98,17 @@ function generate(x, s)
delete files[x".in"]
}
- printf "\t@echo %s\n", x
+ printf "\t@echo $@\n"
printf "\t@AWKPATH=$(srcdir) $(AWK) -f $@.awk %s >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@\n", s
- printf "\t@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@\n\n"
+
+ if (x in mpfr) {
+ delete mpfr[x]
+ printf "\t@-if test -z \"$$AWKFLAGS\" ; then $(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ ; else \\\n"
+ printf "\t$(CMP) $(srcdir)/$@-mpfr.ok _$@ && rm -f _$@ ; \\\n"
+ printf "\tfi\n\n"
+ } else {
+ printf "\t@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@\n\n"
+ }
}
END {
diff --git a/test/Makefile.am b/test/Makefile.am
index 0dcedb6f..55244ee3 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -47,8 +47,6 @@ EXTRA_DIST = \
anchgsub.awk \
anchgsub.in \
anchgsub.ok \
- arraysort.awk \
- arraysort.ok \
argarray.awk \
argarray.in \
argarray.ok \
@@ -62,6 +60,8 @@ EXTRA_DIST = \
arrayprm3.ok \
arrayref.awk \
arrayref.ok \
+ arraysort.awk \
+ arraysort.ok \
arrymem1.awk \
arrymem1.ok \
arryref2.awk \
@@ -102,6 +102,8 @@ EXTRA_DIST = \
asort.ok \
asorti.awk \
asorti.ok \
+ assignconst.awk \
+ assignconst.ok \
awkpath.ok \
back89.awk \
back89.in \
@@ -158,10 +160,10 @@ EXTRA_DIST = \
defref.ok \
delargv.awk \
delargv.ok \
- delarprm.awk \
- delarprm.ok \
delarpm2.awk \
delarpm2.ok \
+ delarprm.awk \
+ delarprm.ok \
delfunc.awk \
delfunc.ok \
delsub.awk \
@@ -197,19 +199,22 @@ EXTRA_DIST = \
fcall_exit.awk \
fcall_exit.ok \
fcall_exit2.awk \
- fcall_exit2.ok \
fcall_exit2.in \
+ fcall_exit2.ok \
fflush.ok \
fflush.sh \
fieldwdth.awk \
fieldwdth.in \
fieldwdth.ok \
+ filefuncs.awk \
+ filefuncs.ok \
fldchg.awk \
fldchg.in \
fldchg.ok \
fldchgnf.awk \
fldchgnf.in \
fldchgnf.ok \
+ fmtspcl-mpfr.ok \
fmtspcl.awk \
fmtspcl.tok \
fmttest.awk \
@@ -220,7 +225,9 @@ EXTRA_DIST = \
fnarray.awk \
fnarray.ok \
fnarray2.awk \
+ fnarray2.in \
fnarray2.ok \
+ fnarydel-mpfr.ok \
fnarydel.awk \
fnarydel.ok \
fnaryscl.awk \
@@ -228,10 +235,23 @@ EXTRA_DIST = \
fnasgnm.awk \
fnasgnm.in \
fnasgnm.ok \
+ fnmatch.awk \
+ fnmatch.ok \
fnmisc.awk \
fnmisc.ok \
+ fnparydl-mpfr.ok \
fnparydl.awk \
fnparydl.ok \
+ fordel.awk \
+ fordel.ok \
+ fork.awk \
+ fork.ok \
+ fork2.awk \
+ fork2.ok \
+ forref.awk \
+ forref.ok \
+ forsimp.awk \
+ forsimp.ok \
fpat1.awk \
fpat1.in \
fpat1.ok \
@@ -243,12 +263,6 @@ EXTRA_DIST = \
fpatnull.awk \
fpatnull.in \
fpatnull.ok \
- fordel.awk \
- fordel.ok \
- forref.awk \
- forref.ok \
- forsimp.awk \
- forsimp.ok \
fsbs.awk \
fsbs.in \
fsbs.ok \
@@ -264,6 +278,15 @@ EXTRA_DIST = \
fstabplus.awk \
fstabplus.in \
fstabplus.ok \
+ fts.awk \
+ functab1.awk \
+ functab1.ok \
+ functab2.awk \
+ functab2.ok \
+ functab3.awk \
+ functab3.ok \
+ functab4.awk \
+ functab4.ok \
funlen.awk \
funlen.in \
funlen.ok \
@@ -342,6 +365,7 @@ EXTRA_DIST = \
gsubtst8.in \
gsubtst8.ok \
gtlnbufv.awk \
+ hello.awk \
hex.awk \
hex.ok \
hsprint.awk \
@@ -351,17 +375,31 @@ EXTRA_DIST = \
icasers.awk \
icasers.in \
icasers.ok \
+ id.awk \
+ id.ok \
igncdym.awk \
igncdym.in \
igncdym.ok \
igncfs.awk \
igncfs.in \
igncfs.ok \
+ ignrcas2.awk \
+ ignrcas2.ok \
ignrcase.awk \
ignrcase.in \
ignrcase.ok \
- ignrcas2.awk \
- ignrcas2.ok \
+ incdupe.ok \
+ incdupe2.ok \
+ incdupe3.ok \
+ incdupe4.ok \
+ incdupe5.ok \
+ incdupe6.ok \
+ incdupe7.ok \
+ inchello.awk \
+ inclib.awk \
+ include.awk \
+ include.ok \
+ include2.ok \
indirectcall.awk \
indirectcall.in \
indirectcall.ok \
@@ -406,8 +444,8 @@ EXTRA_DIST = \
longsub.in \
longsub.ok \
longwrds.awk \
- longwrds.ok \
longwrds.in \
+ longwrds.ok \
manglprm.awk \
manglprm.in \
manglprm.ok \
@@ -533,6 +571,9 @@ EXTRA_DIST = \
opasnidx.ok \
opasnslf.awk \
opasnslf.ok \
+ ordchr.awk \
+ ordchr.ok \
+ ordchr2.ok \
out1.ok \
out2.ok \
out3.ok \
@@ -571,9 +612,6 @@ EXTRA_DIST = \
prdupval.awk \
prdupval.in \
prdupval.ok \
- profile2.ok \
- profile3.awk \
- profile3.ok \
prec.awk \
prec.ok \
printf0.awk \
@@ -595,21 +633,30 @@ EXTRA_DIST = \
prmreuse.ok \
procinfs.awk \
procinfs.ok \
+ profile2.ok \
+ profile3.awk \
+ profile3.ok \
prt1eval.awk \
prt1eval.ok \
prtoeval.awk \
prtoeval.ok \
pty1.awk \
pty1.ok \
+ rand-mpfr.ok \
rand.awk \
rand.ok \
range1.awk \
range1.in \
range1.ok \
+ readdir.awk \
+ readdir0.awk \
rebt8b1.awk \
rebt8b1.ok \
rebt8b2.awk \
rebt8b2.ok \
+ rebuf.awk \
+ rebuf.in \
+ rebuf.ok \
redfilnm.awk \
redfilnm.in \
redfilnm.ok \
@@ -623,9 +670,6 @@ EXTRA_DIST = \
regtest.sh \
regx8bit.awk \
regx8bit.ok \
- rebuf.awk \
- rebuf.in \
- rebuf.ok \
reindops.awk \
reindops.in \
reindops.ok \
@@ -641,6 +685,10 @@ EXTRA_DIST = \
resplit.awk \
resplit.in \
resplit.ok \
+ revout.awk \
+ revout.ok \
+ revtwoway.awk \
+ revtwoway.ok \
rri1.awk \
rri1.in \
rri1.ok \
@@ -678,6 +726,9 @@ EXTRA_DIST = \
rtlen.sh \
rtlen01.ok \
rtlen01.sh \
+ rwarray.awk \
+ rwarray.in \
+ rwarray.ok \
scalar.awk \
scalar.ok \
sclforin.awk \
@@ -716,16 +767,16 @@ EXTRA_DIST = \
sprintfc.ok \
strcat1.awk \
strcat1.ok \
+ strftime.awk \
+ strftlng.awk \
+ strftlng.ok \
+ strnum1.awk \
+ strnum1.ok \
strtod.awk \
strtod.in \
strtod.ok \
- strnum1.awk \
- strnum1.ok \
strtonum.awk \
strtonum.ok \
- strftime.awk \
- strftlng.awk \
- strftlng.ok \
subamp.awk \
subamp.in \
subamp.ok \
@@ -742,10 +793,27 @@ EXTRA_DIST = \
swaplns.ok \
switch2.awk \
switch2.ok \
+ symtab1.awk \
+ symtab1.ok \
+ symtab2.awk \
+ symtab2.ok \
+ symtab3.awk \
+ symtab3.ok \
+ symtab4.awk \
+ symtab4.in \
+ symtab4.ok \
+ symtab5.awk \
+ symtab5.in \
+ symtab5.ok \
+ symtab6.awk \
+ symtab6.ok \
synerr1.awk \
synerr1.ok \
synerr2.awk \
synerr2.ok \
+ testext.ok \
+ time.awk \
+ time.ok \
tradanch.awk \
tradanch.in \
tradanch.ok \
@@ -793,6 +861,7 @@ EXTRA_DIST = \
zeroflag.awk \
zeroflag.ok
+
TESTS_WE_ARE_NOT_DOING_YET_FIXME_ONE_DAY = longdbl
# Get rid of core files when cleaning and generated .ok file
@@ -846,9 +915,10 @@ GAWK_EXT_TESTS = \
backw badargs beginfile1 beginfile2 binmode1 charasbytes \
clos1way delsub devfd devfd1 devfd2 dumpvars exit \
fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \
+ functab1 functab2 functab3 functab4 \
fwtest fwtest2 fwtest3 \
gensub gensub2 getlndir gnuops2 gnuops3 gnureops \
- icasefs icasers igncdym igncfs ignrcas2 ignrcase indirectcall \
+ icasefs icasers id igncdym igncfs ignrcas2 ignrcase indirectcall \
lint lintold lintwarn \
manyfiles match1 match2 match3 mbstr1 \
nastyparm next nondec nondec2 \
@@ -856,7 +926,10 @@ GAWK_EXT_TESTS = \
profile1 profile2 profile3 pty1 \
rebuf regx8bit reint reint2 rsstart1 \
rsstart2 rsstart3 rstest6 shadow sortfor sortu splitarg4 strftime \
- strtonum switch2
+ strtonum switch2 \
+ symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \
+ include include2 incdupe incdupe2 incdupe3 \
+ incdupe4 incdupe5 incdupe6 incdupe7
EXTRA_TESTS = inftest regtest
@@ -864,10 +937,16 @@ INET_TESTS = inetdayu inetdayt inetechu inetecht
MACHINE_TESTS = double1 double2 fmtspcl intformat
+MPFR_TESTS = mpfrnr mpfrrnd mpfrieee mpfrexprange mpfrsort mpfrbigint
+
LOCALE_CHARSET_TESTS = \
asort asorti fmttest fnarydel fnparydl jarebug lc_num1 mbfw1 \
mbprintf1 mbprintf2 mbprintf3 rebt8b2 rtlenmb sort1 sprintfc
+SHLIB_TESTS = \
+ assignconst fnmatch filefuncs fork fork2 fts ordchr ordchr2 \
+ readdir readfile revout revtwoway rwarray testext time
+
# List of the tests which should be run with --lint option:
NEED_LINT = \
defref fmtspcl lintwarn noeffect nofmtch shadow \
@@ -880,20 +959,29 @@ NEED_LINT_OLD = lintold
FAIL_CODE1 = \
fnarray2 fnmisc gsubasgn mixed1 noparms paramdup synerr1 synerr2 unterm
+# List of files which have .ok versions for MPFR
+CHECK_MPFR = \
+ rand fnarydel fnparydl
+
# List of the files that appear in manual tests or are for reserve testing:
-GENTESTS_UNUSED = Makefile.in gtlnbufv.awk printfloat.awk
+GENTESTS_UNUSED = Makefile.in gtlnbufv.awk printfloat.awk inclib.awk hello.awk
CMP = cmp
AWKPROG = ../gawk$(EXEEXT)
-PGAWKPROG = ../pgawk$(EXEEXT)
+
+# Default for VALGRIND is empty unless overridden by a command-line argument.
+# This protects against cruft in the environment.
+VALGRIND =
# This business forces the locale to be C for running the tests,
# unless we override it to something else for testing.
#
# This can also be done in individual tests where we wish to
# check things specifically not in the C locale.
-AWK = LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} $(AWKPROG)
-PGAWK = LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} $(PGAWKPROG)
+
+#
+# And we set AWKLIBPATH to find the extension libraries we built.
+AWK = LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} AWKLIBPATH=../extension/.libs $(VALGRIND) $(AWKPROG)
# Message stuff is to make it a little easier to follow.
# Make the pass-fail last and dependent on others to avoid
@@ -904,7 +992,8 @@ check: msg \
unix-msg-start unix-tests unix-msg-end \
extend-msg-start gawk-extensions extend-msg-end \
machine-msg-start machine-tests machine-msg-end \
- charset-msg-start charset-tests charset-msg-end
+ charset-msg-start charset-tests charset-msg-end \
+ shlib-msg-start shlib-tests shlib-msg-end
@$(MAKE) pass-fail
basic: $(BASIC_TESTS)
@@ -921,6 +1010,16 @@ inet: inetmesg $(INET_TESTS)
machine-tests: $(MACHINE_TESTS)
+mpfr-tests: $(MPFR_TESTS)
+
+shlib-tests:
+ @if grep 'DYNAMIC 1' $(top_builddir)/config.h > /dev/null ; then \
+ $(MAKE) shlib-real-tests ; \
+ else echo shlib tests not supported on this system ; \
+ fi
+
+shlib-real-tests: $(SHLIB_TESTS)
+
msg::
@echo ''
@echo 'Any output from "cmp" is bad news, although some differences'
@@ -961,6 +1060,12 @@ charset-msg-start:
charset-msg-end:
@echo "======== Done with tests that can vary based on character set or locale support ========"
+shlib-msg-start:
+ @echo "======== Starting shared library tests ========"
+
+shlib-msg-end:
+ @echo "======== Done with shared library tests ========"
+
lc_num1:
@echo $@
@@ -989,8 +1094,8 @@ poundbang::
messages::
@echo $@
- @$(AWK) -f $(srcdir)/messages.awk >out2 2>out3
- @-$(CMP) $(srcdir)/out1.ok out1 && $(CMP) $(srcdir)/out2.ok out2 && $(CMP) $(srcdir)/out3.ok out3 && rm -f out1 out2 out3
+ @$(AWK) -f $(srcdir)/messages.awk >_out2 2>_out3
+ @-$(CMP) $(srcdir)/out1.ok _out1 && $(CMP) $(srcdir)/out2.ok _out2 && $(CMP) $(srcdir)/out3.ok _out3 && rm -f _out1 _out2 _out3
argarray::
@echo $@
@@ -1121,9 +1226,11 @@ fmtspcl.ok: fmtspcl.tok Makefile
@$(AWK) -v "sd=$(srcdir)" 'BEGIN {pnan = sprintf("%g",sqrt(-1)); nnan = sprintf("%g",-sqrt(-1)); pinf = sprintf("%g",-log(0)); ninf = sprintf("%g",log(0))} {sub(/positive_nan/,pnan); sub(/negative_nan/,nnan); sub(/positive_infinity/,pinf); sub(/negative_infinity/,ninf); sub(/fmtspcl/,(sd"/fmtspcl")); print}' < $(srcdir)/fmtspcl.tok > $@ 2>/dev/null
fmtspcl: fmtspcl.ok
- @echo fmtspcl
+ @echo $@
@$(AWK) -f $(srcdir)/fmtspcl.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
- @-$(CMP) $@.ok _$@ && rm -f _$@
+ @-if test -z "$$AWKFLAGS" ; then $(CMP) $@.ok _$@ && rm -f _$@ ; else \
+ $(CMP) $(srcdir)/$@-mpfr.ok _$@ && rm -f _$@ ; \
+ fi
reint::
@echo $@
@@ -1418,7 +1525,7 @@ beginfile1::
beginfile2:
@echo $@
- @-( cd $(srcdir) && LC_ALL=C AWK="$(abs_builddir)/$(AWKPROG)" $(srcdir)/$@.sh $(srcdir)/$@.in ) > _$@ 2>&1
+ @-( cd $(srcdir) && LC_ALL=C AWK="$(abs_builddir)/$(AWKPROG)" $(abs_srcdir)/$@.sh $(abs_srcdir)/$@.in ) > _$@ 2>&1
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
dumpvars::
@@ -1429,19 +1536,19 @@ dumpvars::
profile1:
@echo $@
- @$(AWK) --profile=ap-$@.out -f $(srcdir)/xref.awk $(srcdir)/dtdgport.awk > _$@.out1
+ @$(AWK) --pretty-print=ap-$@.out -f $(srcdir)/xref.awk $(srcdir)/dtdgport.awk > _$@.out1
@$(AWK) -f ap-$@.out $(srcdir)/dtdgport.awk > _$@.out2 ; rm ap-$@.out
@cmp _$@.out1 _$@.out2 && rm _$@.out[12] || echo EXIT CODE: $$? >>_$@
profile2:
@echo $@
- @$(PGAWK) --profile=ap-$@.out -v sortcmd=sort -f $(srcdir)/xref.awk $(srcdir)/dtdgport.awk > /dev/null
+ @$(AWK) --profile=ap-$@.out -v sortcmd=sort -f $(srcdir)/xref.awk $(srcdir)/dtdgport.awk > /dev/null
@sed 1,2d < ap-$@.out > _$@; rm ap-$@.out
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
profile3:
@echo $@
- @$(PGAWK) --profile=ap-$@.out -f $(srcdir)/$@.awk > /dev/null
+ @$(AWK) --profile=ap-$@.out -f $(srcdir)/$@.awk > /dev/null
@sed 1,2d < ap-$@.out > _$@; rm ap-$@.out
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
@@ -1466,11 +1573,123 @@ rri1::
AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+rand:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-if test -z "$$AWKFLAGS" ; then $(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ ; else \
+ ($(CMP) $(srcdir)/$@-mpfr.ok _$@ || $(CMP) $(srcdir)/$@-mpfr1.ok _$@) && rm -f _$@ ; \
+ fi
+
+mpfrieee:
+ @echo $@
+ @$(AWK) -M -vPREC=double -f $(srcdir)/$@.awk > _$@ 2>&1
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+mpfrexprange:
+ @echo $@
+ @$(AWK) -M -vPREC=53 -f $(srcdir)/$@.awk > _$@ 2>&1
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+mpfrrnd:
+ @echo $@
+ @$(AWK) -M -vPREC=53 -f $(srcdir)/$@.awk > _$@ 2>&1
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+mpfrnr:
+ @echo $@
+ @$(AWK) -M -vPREC=113 -f $(srcdir)/$@.awk $(srcdir)/$@.in > _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+mpfrsort:
+ @echo $@
+ @$(AWK) -M -vPREC=53 -f $(srcdir)/$@.awk > _$@ 2>&1
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+mpfrbigint:
+ @echo $@
+ @$(AWK) -M -f $(srcdir)/$@.awk > _$@ 2>&1
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
jarebug::
@echo $@
@$(srcdir)/$@.sh "$(AWKPROG)" "$(srcdir)/$@.awk" "$(srcdir)/$@.in" "_$@"
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+ordchr2::
+ @echo $@
+ @$(AWK) -l ordchr 'BEGIN {print chr(ord("z"))}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+# N.B. If the test fails, create readfile.ok so that "make diffout" will work
+readfile::
+ @echo $@
+ @$(AWK) -l readfile 'BEGIN {printf "%s", readfile("Makefile")}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) Makefile _$@ && rm -f _$@ || cp -p Makefile $@.ok
+
+include2::
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -i inclib 'BEGIN {print sandwich("a", "b", "c")}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+incdupe::
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) --lint -i inclib -i inclib.awk 'BEGIN {print sandwich("a", "b", "c")}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+incdupe2::
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) --lint -f inclib -f inclib.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+incdupe3::
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) --lint -f hello -f hello.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+incdupe4::
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) --lint -f hello -i hello.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+incdupe5::
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) --lint -i hello -f hello.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+incdupe6::
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) --lint -i inchello -f hello.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+incdupe7::
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) --lint -f hello -i inchello >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+testext::
+ @echo $@
+ @$(AWK) '/^(@load|BEGIN)/,/^}/' $(top_srcdir)/extension/testext.c > testext.awk
+ @$(AWK) -f testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ testext.awk
+
+assignconst:
+ @echo $@
+ @for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14; \
+ do AWKPATH=$(srcdir) $(AWK) -f $@.awk $$i ; \
+ done 2>&1 | grep -v at_exit > _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+readdir:
+ @echo $@
+ @ls -fli $(top_srcdir) | sed 1d | $(AWK) -f $(srcdir)/readdir0.awk > $@.ok
+ @$(AWK) -f $(srcdir)/readdir.awk $(top_srcdir) > _$@
+ @-$(CMP) $@.ok _$@ && rm -f $@.ok _$@
+
+fts:
+ @echo $@
+ @$(AWK) -f $(srcdir)/fts.awk
+ @-$(CMP) $@.ok _$@ && rm -f $@.ok _$@
+
charasbytes:
@echo $@
@[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
@@ -1478,6 +1697,12 @@ charasbytes:
od -c -t x1 | sed -e 's/ */ /g' -e 's/ *$$//' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+symtab6:
+ @echo $@
+ @$(AWK) -d__$@ -f $(srcdir)/$@.awk
+ @grep -v '^ENVIRON' __$@ > _$@ ; rm __$@
+ @-$(CMP) $@.ok _$@ && rm -f _$@
+
# Targets generated for other tests:
include Maketests
@@ -1486,7 +1711,7 @@ $(srcdir)/Maketests: $(srcdir)/Makefile.am $(srcdir)/Gentests
$(AWK) -f $(srcdir)/Gentests "$(srcdir)/Makefile.am" $$files > $(srcdir)/Maketests
clean:
- rm -fr _* core core.* fmtspcl.ok junk out1 out2 out3 strftime.ok test1 test2 seq *~
+ rm -fr _* core core.* fmtspcl.ok junk strftime.ok test1 test2 seq *~ readfile.ok fork.tmp.* testext.awk fts.ok readdir.ok
# An attempt to print something that can be grepped for in build logs
pass-fail:
@@ -1517,8 +1742,8 @@ valgrind-scan:
function show() {if (cmd) {printf "%s: %s\n",FILENAME,cmd; cmd = ""}; \
printf "\t%s\n",$$0}; \
{$$1 = ""}; \
- /Prog and args are:/ {incmd = 1; cmd = ""; next}; \
- incmd {if (NF == 1) incmd = 0; else {cmd = (cmd $$0); next}}; \
+ $$2 == "Command:" {incmd = 1; $$2 = ""; cmd = $$0; next}; \
+ incmd {if (/Parent PID:/) incmd = 0; else {cmd = (cmd $$0); next}}; \
/ERROR SUMMARY:/ && !/: 0 errors from 0 contexts/ {show()}; \
/definitely lost:/ && !/: 0 bytes in 0 blocks/ {show()}; \
/possibly lost:/ && !/: 0 bytes in 0 blocks/ {show()}; \
diff --git a/test/Makefile.in b/test/Makefile.in
index 38a8e91a..d3711386 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -82,11 +82,11 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
$(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lcmessage.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \
- $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/nls.m4 \
- $(top_srcdir)/m4/noreturn.m4 $(top_srcdir)/m4/po.m4 \
- $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/readline.m4 \
- $(top_srcdir)/m4/socket.m4 $(top_srcdir)/m4/ulonglong.m4 \
- $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/mpfr.m4 \
+ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/noreturn.m4 \
+ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+ $(top_srcdir)/m4/readline.m4 $(top_srcdir)/m4/socket.m4 \
+ $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -112,7 +112,10 @@ AUTOMAKE = @AUTOMAKE@
#
# This can also be done in individual tests where we wish to
# check things specifically not in the C locale.
-AWK = LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} $(AWKPROG)
+
+#
+# And we set AWKLIBPATH to find the extension libraries we built.
+AWK = LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} AWKLIBPATH=../extension/.libs $(VALGRIND) $(AWKPROG)
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
@@ -126,6 +129,7 @@ ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
+GAWKLIBEXT = @GAWKLIBEXT@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
@@ -141,6 +145,7 @@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
+LIBMPFR = @LIBMPFR@
LIBOBJS = @LIBOBJS@
LIBREADLINE = @LIBREADLINE@
LIBS = @LIBS@
@@ -182,6 +187,7 @@ abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
+acl_shlibext = @acl_shlibext@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -216,12 +222,14 @@ mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
+pkgextensiondir = @pkgextensiondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
+subdirs = @subdirs@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
@@ -251,8 +259,6 @@ EXTRA_DIST = \
anchgsub.awk \
anchgsub.in \
anchgsub.ok \
- arraysort.awk \
- arraysort.ok \
argarray.awk \
argarray.in \
argarray.ok \
@@ -266,6 +272,8 @@ EXTRA_DIST = \
arrayprm3.ok \
arrayref.awk \
arrayref.ok \
+ arraysort.awk \
+ arraysort.ok \
arrymem1.awk \
arrymem1.ok \
arryref2.awk \
@@ -306,6 +314,8 @@ EXTRA_DIST = \
asort.ok \
asorti.awk \
asorti.ok \
+ assignconst.awk \
+ assignconst.ok \
awkpath.ok \
back89.awk \
back89.in \
@@ -362,10 +372,10 @@ EXTRA_DIST = \
defref.ok \
delargv.awk \
delargv.ok \
- delarprm.awk \
- delarprm.ok \
delarpm2.awk \
delarpm2.ok \
+ delarprm.awk \
+ delarprm.ok \
delfunc.awk \
delfunc.ok \
delsub.awk \
@@ -401,19 +411,22 @@ EXTRA_DIST = \
fcall_exit.awk \
fcall_exit.ok \
fcall_exit2.awk \
- fcall_exit2.ok \
fcall_exit2.in \
+ fcall_exit2.ok \
fflush.ok \
fflush.sh \
fieldwdth.awk \
fieldwdth.in \
fieldwdth.ok \
+ filefuncs.awk \
+ filefuncs.ok \
fldchg.awk \
fldchg.in \
fldchg.ok \
fldchgnf.awk \
fldchgnf.in \
fldchgnf.ok \
+ fmtspcl-mpfr.ok \
fmtspcl.awk \
fmtspcl.tok \
fmttest.awk \
@@ -424,7 +437,9 @@ EXTRA_DIST = \
fnarray.awk \
fnarray.ok \
fnarray2.awk \
+ fnarray2.in \
fnarray2.ok \
+ fnarydel-mpfr.ok \
fnarydel.awk \
fnarydel.ok \
fnaryscl.awk \
@@ -432,10 +447,23 @@ EXTRA_DIST = \
fnasgnm.awk \
fnasgnm.in \
fnasgnm.ok \
+ fnmatch.awk \
+ fnmatch.ok \
fnmisc.awk \
fnmisc.ok \
+ fnparydl-mpfr.ok \
fnparydl.awk \
fnparydl.ok \
+ fordel.awk \
+ fordel.ok \
+ fork.awk \
+ fork.ok \
+ fork2.awk \
+ fork2.ok \
+ forref.awk \
+ forref.ok \
+ forsimp.awk \
+ forsimp.ok \
fpat1.awk \
fpat1.in \
fpat1.ok \
@@ -447,12 +475,6 @@ EXTRA_DIST = \
fpatnull.awk \
fpatnull.in \
fpatnull.ok \
- fordel.awk \
- fordel.ok \
- forref.awk \
- forref.ok \
- forsimp.awk \
- forsimp.ok \
fsbs.awk \
fsbs.in \
fsbs.ok \
@@ -468,6 +490,15 @@ EXTRA_DIST = \
fstabplus.awk \
fstabplus.in \
fstabplus.ok \
+ fts.awk \
+ functab1.awk \
+ functab1.ok \
+ functab2.awk \
+ functab2.ok \
+ functab3.awk \
+ functab3.ok \
+ functab4.awk \
+ functab4.ok \
funlen.awk \
funlen.in \
funlen.ok \
@@ -546,6 +577,7 @@ EXTRA_DIST = \
gsubtst8.in \
gsubtst8.ok \
gtlnbufv.awk \
+ hello.awk \
hex.awk \
hex.ok \
hsprint.awk \
@@ -555,17 +587,31 @@ EXTRA_DIST = \
icasers.awk \
icasers.in \
icasers.ok \
+ id.awk \
+ id.ok \
igncdym.awk \
igncdym.in \
igncdym.ok \
igncfs.awk \
igncfs.in \
igncfs.ok \
+ ignrcas2.awk \
+ ignrcas2.ok \
ignrcase.awk \
ignrcase.in \
ignrcase.ok \
- ignrcas2.awk \
- ignrcas2.ok \
+ incdupe.ok \
+ incdupe2.ok \
+ incdupe3.ok \
+ incdupe4.ok \
+ incdupe5.ok \
+ incdupe6.ok \
+ incdupe7.ok \
+ inchello.awk \
+ inclib.awk \
+ include.awk \
+ include.ok \
+ include2.ok \
indirectcall.awk \
indirectcall.in \
indirectcall.ok \
@@ -610,8 +656,8 @@ EXTRA_DIST = \
longsub.in \
longsub.ok \
longwrds.awk \
- longwrds.ok \
longwrds.in \
+ longwrds.ok \
manglprm.awk \
manglprm.in \
manglprm.ok \
@@ -737,6 +783,9 @@ EXTRA_DIST = \
opasnidx.ok \
opasnslf.awk \
opasnslf.ok \
+ ordchr.awk \
+ ordchr.ok \
+ ordchr2.ok \
out1.ok \
out2.ok \
out3.ok \
@@ -775,9 +824,6 @@ EXTRA_DIST = \
prdupval.awk \
prdupval.in \
prdupval.ok \
- profile2.ok \
- profile3.awk \
- profile3.ok \
prec.awk \
prec.ok \
printf0.awk \
@@ -799,21 +845,30 @@ EXTRA_DIST = \
prmreuse.ok \
procinfs.awk \
procinfs.ok \
+ profile2.ok \
+ profile3.awk \
+ profile3.ok \
prt1eval.awk \
prt1eval.ok \
prtoeval.awk \
prtoeval.ok \
pty1.awk \
pty1.ok \
+ rand-mpfr.ok \
rand.awk \
rand.ok \
range1.awk \
range1.in \
range1.ok \
+ readdir.awk \
+ readdir0.awk \
rebt8b1.awk \
rebt8b1.ok \
rebt8b2.awk \
rebt8b2.ok \
+ rebuf.awk \
+ rebuf.in \
+ rebuf.ok \
redfilnm.awk \
redfilnm.in \
redfilnm.ok \
@@ -827,9 +882,6 @@ EXTRA_DIST = \
regtest.sh \
regx8bit.awk \
regx8bit.ok \
- rebuf.awk \
- rebuf.in \
- rebuf.ok \
reindops.awk \
reindops.in \
reindops.ok \
@@ -845,6 +897,10 @@ EXTRA_DIST = \
resplit.awk \
resplit.in \
resplit.ok \
+ revout.awk \
+ revout.ok \
+ revtwoway.awk \
+ revtwoway.ok \
rri1.awk \
rri1.in \
rri1.ok \
@@ -882,6 +938,9 @@ EXTRA_DIST = \
rtlen.sh \
rtlen01.ok \
rtlen01.sh \
+ rwarray.awk \
+ rwarray.in \
+ rwarray.ok \
scalar.awk \
scalar.ok \
sclforin.awk \
@@ -920,16 +979,16 @@ EXTRA_DIST = \
sprintfc.ok \
strcat1.awk \
strcat1.ok \
+ strftime.awk \
+ strftlng.awk \
+ strftlng.ok \
+ strnum1.awk \
+ strnum1.ok \
strtod.awk \
strtod.in \
strtod.ok \
- strnum1.awk \
- strnum1.ok \
strtonum.awk \
strtonum.ok \
- strftime.awk \
- strftlng.awk \
- strftlng.ok \
subamp.awk \
subamp.in \
subamp.ok \
@@ -946,10 +1005,27 @@ EXTRA_DIST = \
swaplns.ok \
switch2.awk \
switch2.ok \
+ symtab1.awk \
+ symtab1.ok \
+ symtab2.awk \
+ symtab2.ok \
+ symtab3.awk \
+ symtab3.ok \
+ symtab4.awk \
+ symtab4.in \
+ symtab4.ok \
+ symtab5.awk \
+ symtab5.in \
+ symtab5.ok \
+ symtab6.awk \
+ symtab6.ok \
synerr1.awk \
synerr1.ok \
synerr2.awk \
synerr2.ok \
+ testext.ok \
+ time.awk \
+ time.ok \
tradanch.awk \
tradanch.in \
tradanch.ok \
@@ -1050,9 +1126,10 @@ GAWK_EXT_TESTS = \
backw badargs beginfile1 beginfile2 binmode1 charasbytes \
clos1way delsub devfd devfd1 devfd2 dumpvars exit \
fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \
+ functab1 functab2 functab3 functab4 \
fwtest fwtest2 fwtest3 \
gensub gensub2 getlndir gnuops2 gnuops3 gnureops \
- icasefs icasers igncdym igncfs ignrcas2 ignrcase indirectcall \
+ icasefs icasers id igncdym igncfs ignrcas2 ignrcase indirectcall \
lint lintold lintwarn \
manyfiles match1 match2 match3 mbstr1 \
nastyparm next nondec nondec2 \
@@ -1060,15 +1137,23 @@ GAWK_EXT_TESTS = \
profile1 profile2 profile3 pty1 \
rebuf regx8bit reint reint2 rsstart1 \
rsstart2 rsstart3 rstest6 shadow sortfor sortu splitarg4 strftime \
- strtonum switch2
+ strtonum switch2 \
+ symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \
+ include include2 incdupe incdupe2 incdupe3 \
+ incdupe4 incdupe5 incdupe6 incdupe7
EXTRA_TESTS = inftest regtest
INET_TESTS = inetdayu inetdayt inetechu inetecht
MACHINE_TESTS = double1 double2 fmtspcl intformat
+MPFR_TESTS = mpfrnr mpfrrnd mpfrieee mpfrexprange mpfrsort mpfrbigint
LOCALE_CHARSET_TESTS = \
asort asorti fmttest fnarydel fnparydl jarebug lc_num1 mbfw1 \
mbprintf1 mbprintf2 mbprintf3 rebt8b2 rtlenmb sort1 sprintfc
+SHLIB_TESTS = \
+ assignconst fnmatch filefuncs fork fork2 fts ordchr ordchr2 \
+ readdir readfile revout revtwoway rwarray testext time
+
# List of the tests which should be run with --lint option:
NEED_LINT = \
@@ -1084,12 +1169,19 @@ FAIL_CODE1 = \
fnarray2 fnmisc gsubasgn mixed1 noparms paramdup synerr1 synerr2 unterm
+# List of files which have .ok versions for MPFR
+CHECK_MPFR = \
+ rand fnarydel fnparydl
+
+
# List of the files that appear in manual tests or are for reserve testing:
-GENTESTS_UNUSED = Makefile.in gtlnbufv.awk printfloat.awk
+GENTESTS_UNUSED = Makefile.in gtlnbufv.awk printfloat.awk inclib.awk hello.awk
CMP = cmp
AWKPROG = ../gawk$(EXEEXT)
-PGAWKPROG = ../pgawk$(EXEEXT)
-PGAWK = LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} $(PGAWKPROG)
+
+# Default for VALGRIND is empty unless overridden by a command-line argument.
+# This protects against cruft in the environment.
+VALGRIND =
all: all-am
.SUFFIXES:
@@ -1283,7 +1375,8 @@ check: msg \
unix-msg-start unix-tests unix-msg-end \
extend-msg-start gawk-extensions extend-msg-end \
machine-msg-start machine-tests machine-msg-end \
- charset-msg-start charset-tests charset-msg-end
+ charset-msg-start charset-tests charset-msg-end \
+ shlib-msg-start shlib-tests shlib-msg-end
@$(MAKE) pass-fail
basic: $(BASIC_TESTS)
@@ -1300,6 +1393,16 @@ inet: inetmesg $(INET_TESTS)
machine-tests: $(MACHINE_TESTS)
+mpfr-tests: $(MPFR_TESTS)
+
+shlib-tests:
+ @if grep 'DYNAMIC 1' $(top_builddir)/config.h > /dev/null ; then \
+ $(MAKE) shlib-real-tests ; \
+ else echo shlib tests not supported on this system ; \
+ fi
+
+shlib-real-tests: $(SHLIB_TESTS)
+
msg::
@echo ''
@echo 'Any output from "cmp" is bad news, although some differences'
@@ -1340,6 +1443,12 @@ charset-msg-start:
charset-msg-end:
@echo "======== Done with tests that can vary based on character set or locale support ========"
+shlib-msg-start:
+ @echo "======== Starting shared library tests ========"
+
+shlib-msg-end:
+ @echo "======== Done with shared library tests ========"
+
lc_num1:
@echo $@
@[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
@@ -1366,8 +1475,8 @@ poundbang::
messages::
@echo $@
- @$(AWK) -f $(srcdir)/messages.awk >out2 2>out3
- @-$(CMP) $(srcdir)/out1.ok out1 && $(CMP) $(srcdir)/out2.ok out2 && $(CMP) $(srcdir)/out3.ok out3 && rm -f out1 out2 out3
+ @$(AWK) -f $(srcdir)/messages.awk >_out2 2>_out3
+ @-$(CMP) $(srcdir)/out1.ok _out1 && $(CMP) $(srcdir)/out2.ok _out2 && $(CMP) $(srcdir)/out3.ok _out3 && rm -f _out1 _out2 _out3
argarray::
@echo $@
@@ -1498,9 +1607,11 @@ fmtspcl.ok: fmtspcl.tok Makefile
@$(AWK) -v "sd=$(srcdir)" 'BEGIN {pnan = sprintf("%g",sqrt(-1)); nnan = sprintf("%g",-sqrt(-1)); pinf = sprintf("%g",-log(0)); ninf = sprintf("%g",log(0))} {sub(/positive_nan/,pnan); sub(/negative_nan/,nnan); sub(/positive_infinity/,pinf); sub(/negative_infinity/,ninf); sub(/fmtspcl/,(sd"/fmtspcl")); print}' < $(srcdir)/fmtspcl.tok > $@ 2>/dev/null
fmtspcl: fmtspcl.ok
- @echo fmtspcl
+ @echo $@
@$(AWK) -f $(srcdir)/fmtspcl.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
- @-$(CMP) $@.ok _$@ && rm -f _$@
+ @-if test -z "$$AWKFLAGS" ; then $(CMP) $@.ok _$@ && rm -f _$@ ; else \
+ $(CMP) $(srcdir)/$@-mpfr.ok _$@ && rm -f _$@ ; \
+ fi
reint::
@echo $@
@@ -1795,7 +1906,7 @@ beginfile1::
beginfile2:
@echo $@
- @-( cd $(srcdir) && LC_ALL=C AWK="$(abs_builddir)/$(AWKPROG)" $(srcdir)/$@.sh $(srcdir)/$@.in ) > _$@ 2>&1
+ @-( cd $(srcdir) && LC_ALL=C AWK="$(abs_builddir)/$(AWKPROG)" $(abs_srcdir)/$@.sh $(abs_srcdir)/$@.in ) > _$@ 2>&1
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
dumpvars::
@@ -1806,19 +1917,19 @@ dumpvars::
profile1:
@echo $@
- @$(AWK) --profile=ap-$@.out -f $(srcdir)/xref.awk $(srcdir)/dtdgport.awk > _$@.out1
+ @$(AWK) --pretty-print=ap-$@.out -f $(srcdir)/xref.awk $(srcdir)/dtdgport.awk > _$@.out1
@$(AWK) -f ap-$@.out $(srcdir)/dtdgport.awk > _$@.out2 ; rm ap-$@.out
@cmp _$@.out1 _$@.out2 && rm _$@.out[12] || echo EXIT CODE: $$? >>_$@
profile2:
@echo $@
- @$(PGAWK) --profile=ap-$@.out -v sortcmd=sort -f $(srcdir)/xref.awk $(srcdir)/dtdgport.awk > /dev/null
+ @$(AWK) --profile=ap-$@.out -v sortcmd=sort -f $(srcdir)/xref.awk $(srcdir)/dtdgport.awk > /dev/null
@sed 1,2d < ap-$@.out > _$@; rm ap-$@.out
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
profile3:
@echo $@
- @$(PGAWK) --profile=ap-$@.out -f $(srcdir)/$@.awk > /dev/null
+ @$(AWK) --profile=ap-$@.out -f $(srcdir)/$@.awk > /dev/null
@sed 1,2d < ap-$@.out > _$@; rm ap-$@.out
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
@@ -1843,1229 +1954,1446 @@ rri1::
AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+rand:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-if test -z "$$AWKFLAGS" ; then $(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ ; else \
+ ($(CMP) $(srcdir)/$@-mpfr.ok _$@ || $(CMP) $(srcdir)/$@-mpfr1.ok _$@) && rm -f _$@ ; \
+ fi
+
+mpfrieee:
+ @echo $@
+ @$(AWK) -M -vPREC=double -f $(srcdir)/$@.awk > _$@ 2>&1
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+mpfrexprange:
+ @echo $@
+ @$(AWK) -M -vPREC=53 -f $(srcdir)/$@.awk > _$@ 2>&1
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+mpfrrnd:
+ @echo $@
+ @$(AWK) -M -vPREC=53 -f $(srcdir)/$@.awk > _$@ 2>&1
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+mpfrnr:
+ @echo $@
+ @$(AWK) -M -vPREC=113 -f $(srcdir)/$@.awk $(srcdir)/$@.in > _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+mpfrsort:
+ @echo $@
+ @$(AWK) -M -vPREC=53 -f $(srcdir)/$@.awk > _$@ 2>&1
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+mpfrbigint:
+ @echo $@
+ @$(AWK) -M -f $(srcdir)/$@.awk > _$@ 2>&1
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
jarebug::
@echo $@
@$(srcdir)/$@.sh "$(AWKPROG)" "$(srcdir)/$@.awk" "$(srcdir)/$@.in" "_$@"
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+ordchr2::
+ @echo $@
+ @$(AWK) -l ordchr 'BEGIN {print chr(ord("z"))}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+# N.B. If the test fails, create readfile.ok so that "make diffout" will work
+readfile::
+ @echo $@
+ @$(AWK) -l readfile 'BEGIN {printf "%s", readfile("Makefile")}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) Makefile _$@ && rm -f _$@ || cp -p Makefile $@.ok
+
+include2::
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -i inclib 'BEGIN {print sandwich("a", "b", "c")}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+incdupe::
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) --lint -i inclib -i inclib.awk 'BEGIN {print sandwich("a", "b", "c")}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+incdupe2::
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) --lint -f inclib -f inclib.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+incdupe3::
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) --lint -f hello -f hello.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+incdupe4::
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) --lint -f hello -i hello.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+incdupe5::
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) --lint -i hello -f hello.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+incdupe6::
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) --lint -i inchello -f hello.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+incdupe7::
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) --lint -f hello -i inchello >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+testext::
+ @echo $@
+ @$(AWK) '/^(@load|BEGIN)/,/^}/' $(top_srcdir)/extension/testext.c > testext.awk
+ @$(AWK) -f testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ testext.awk
+
+assignconst:
+ @echo $@
+ @for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14; \
+ do AWKPATH=$(srcdir) $(AWK) -f $@.awk $$i ; \
+ done 2>&1 | grep -v at_exit > _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+readdir:
+ @echo $@
+ @ls -fli $(top_srcdir) | sed 1d | $(AWK) -f $(srcdir)/readdir0.awk > $@.ok
+ @$(AWK) -f $(srcdir)/readdir.awk $(top_srcdir) > _$@
+ @-$(CMP) $@.ok _$@ && rm -f $@.ok _$@
+
+fts:
+ @echo $@
+ @$(AWK) -f $(srcdir)/fts.awk
+ @-$(CMP) $@.ok _$@ && rm -f $@.ok _$@
+
charasbytes:
@echo $@
@[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
AWKPATH=$(srcdir) $(AWK) -b -f $@.awk $(srcdir)/$@.in | \
od -c -t x1 | sed -e 's/ */ /g' -e 's/ *$$//' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+symtab6:
+ @echo $@
+ @$(AWK) -d__$@ -f $(srcdir)/$@.awk
+ @grep -v '^ENVIRON' __$@ > _$@ ; rm __$@
+ @-$(CMP) $@.ok _$@ && rm -f _$@
Gt-dummy:
# file Maketests, generated from Makefile.am by the Gentests program
addcomma:
- @echo addcomma
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
anchgsub:
- @echo anchgsub
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
arrayparm:
- @echo arrayparm
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
arrayprm2:
- @echo arrayprm2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
arrayprm3:
- @echo arrayprm3
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
arrayref:
- @echo arrayref
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
arrymem1:
- @echo arrymem1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
arryref2:
- @echo arryref2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
arryref3:
- @echo arryref3
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
arryref4:
- @echo arryref4
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
arryref5:
- @echo arryref5
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
arynasty:
- @echo arynasty
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
aryprm1:
- @echo aryprm1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
aryprm2:
- @echo aryprm2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
aryprm3:
- @echo aryprm3
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
aryprm4:
- @echo aryprm4
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
aryprm5:
- @echo aryprm5
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
aryprm6:
- @echo aryprm6
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
aryprm7:
- @echo aryprm7
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
aryprm8:
- @echo aryprm8
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
arysubnm:
- @echo arysubnm
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
asgext:
- @echo asgext
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
back89:
- @echo back89
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
backgsub:
- @echo backgsub
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
childin:
- @echo childin
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
closebad:
- @echo closebad
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
clsflnam:
- @echo clsflnam
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
compare2:
- @echo compare2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
concat1:
- @echo concat1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
concat2:
- @echo concat2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
concat3:
- @echo concat3
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
convfmt:
- @echo convfmt
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
datanonl:
- @echo datanonl
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
defref:
- @echo defref
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
delargv:
- @echo delargv
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
delarpm2:
- @echo delarpm2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
delarprm:
- @echo delarprm
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
delfunc:
- @echo delfunc
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
dfastress:
- @echo dfastress
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
dynlj:
- @echo dynlj
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
eofsplit:
- @echo eofsplit
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
exitval2:
- @echo exitval2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fcall_exit:
- @echo fcall_exit
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fcall_exit2:
- @echo fcall_exit2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fldchg:
- @echo fldchg
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fldchgnf:
- @echo fldchgnf
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fnamedat:
- @echo fnamedat
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fnarray:
- @echo fnarray
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fnarray2:
- @echo fnarray2
- @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fnaryscl:
- @echo fnaryscl
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fnasgnm:
- @echo fnasgnm
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fnmisc:
- @echo fnmisc
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fordel:
- @echo fordel
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
forref:
- @echo forref
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
forsimp:
- @echo forsimp
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fsbs:
- @echo fsbs
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fsrs:
- @echo fsrs
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fstabplus:
- @echo fstabplus
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
funsemnl:
- @echo funsemnl
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
funsmnam:
- @echo funsmnam
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
funstack:
- @echo funstack
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
getline:
- @echo getline
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
getline3:
- @echo getline3
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
getline4:
- @echo getline4
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
getline5:
- @echo getline5
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
getnr2tb:
- @echo getnr2tb
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
getnr2tm:
- @echo getnr2tm
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
gsubasgn:
- @echo gsubasgn
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
gsubtest:
- @echo gsubtest
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
gsubtst2:
- @echo gsubtst2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
gsubtst4:
- @echo gsubtst4
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
gsubtst5:
- @echo gsubtst5
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
gsubtst7:
- @echo gsubtst7
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
gsubtst8:
- @echo gsubtst8
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
hex:
- @echo hex
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
hsprint:
- @echo hsprint
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
inputred:
- @echo inputred
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
intest:
- @echo intest
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
intprec:
- @echo intprec
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
iobug1:
- @echo iobug1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
leadnl:
- @echo leadnl
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
longsub:
- @echo longsub
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
longwrds:
- @echo longwrds
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
manglprm:
- @echo manglprm
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
math:
- @echo math
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
membug1:
- @echo membug1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
minusstr:
- @echo minusstr
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nasty:
- @echo nasty
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nasty2:
- @echo nasty2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
negexp:
- @echo negexp
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
negrange:
- @echo negrange
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nested:
- @echo nested
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nfldstr:
- @echo nfldstr
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nfneg:
- @echo nfneg
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nfset:
- @echo nfset
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nlfldsep:
- @echo nlfldsep
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nlinstr:
- @echo nlinstr
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nlstrina:
- @echo nlstrina
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
noeffect:
- @echo noeffect
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nofmtch:
- @echo nofmtch
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
noloop1:
- @echo noloop1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
noloop2:
- @echo noloop2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
noparms:
- @echo noparms
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nulrsend:
- @echo nulrsend
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
numindex:
- @echo numindex
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
numsubstr:
- @echo numsubstr
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
octsub:
- @echo octsub
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
ofmt:
- @echo ofmt
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
ofmta:
- @echo ofmta
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
ofmtbig:
- @echo ofmtbig
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
ofmtfidl:
- @echo ofmtfidl
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
ofmts:
- @echo ofmts
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
ofs1:
- @echo ofs1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
onlynl:
- @echo onlynl
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
opasnidx:
- @echo opasnidx
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
opasnslf:
- @echo opasnslf
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
paramdup:
- @echo paramdup
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
paramres:
- @echo paramres
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
paramtyp:
- @echo paramtyp
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
parse1:
- @echo parse1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
parsefld:
- @echo parsefld
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
parseme:
- @echo parseme
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
pcntplus:
- @echo pcntplus
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
prdupval:
- @echo prdupval
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
prec:
- @echo prec
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
printf1:
- @echo printf1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
prmarscl:
- @echo prmarscl
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
prmreuse:
- @echo prmreuse
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
prt1eval:
- @echo prt1eval
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
prtoeval:
- @echo prtoeval
- @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
- @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
-
-rand:
- @echo rand
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
range1:
- @echo range1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
rebt8b1:
- @echo rebt8b1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
regeq:
- @echo regeq
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
regexprange:
- @echo regexprange
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
regrange:
- @echo regrange
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
reindops:
- @echo reindops
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
reparse:
- @echo reparse
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
resplit:
- @echo resplit
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
rs:
- @echo rs
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
rsnul1nl:
- @echo rsnul1nl
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
rstest1:
- @echo rstest1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
rstest2:
- @echo rstest2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
rstest3:
- @echo rstest3
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
rstest4:
- @echo rstest4
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
rstest5:
- @echo rstest5
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
rswhite:
- @echo rswhite
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
scalar:
- @echo scalar
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
sclforin:
- @echo sclforin
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
sclifin:
- @echo sclifin
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
sortempty:
- @echo sortempty
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
splitargv:
- @echo splitargv
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
splitarr:
- @echo splitarr
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
splitdef:
- @echo splitdef
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
splitvar:
- @echo splitvar
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
splitwht:
- @echo splitwht
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
strcat1:
- @echo strcat1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
strnum1:
- @echo strnum1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
strtod:
- @echo strtod
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
subsepnm:
- @echo subsepnm
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
subslash:
- @echo subslash
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
substr:
- @echo substr
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
swaplns:
- @echo swaplns
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
synerr1:
- @echo synerr1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
synerr2:
- @echo synerr2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
uninit2:
- @echo uninit2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
uninit3:
- @echo uninit3
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
uninit4:
- @echo uninit4
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
uninit5:
- @echo uninit5
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
uninitialized:
- @echo uninitialized
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
unterm:
- @echo unterm
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
uparrfs:
- @echo uparrfs
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
wjposer1:
- @echo wjposer1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
zero2:
- @echo zero2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
zeroe0:
- @echo zeroe0
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
zeroflag:
- @echo zeroflag
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
getlnhd:
- @echo getlnhd
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
aadelete1:
- @echo aadelete1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
aadelete2:
- @echo aadelete2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
aarray1:
- @echo aarray1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
aasort:
- @echo aasort
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
aasorti:
- @echo aasorti
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
arraysort:
- @echo arraysort
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
backw:
- @echo backw
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
clos1way:
- @echo clos1way
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
delsub:
- @echo delsub
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fieldwdth:
- @echo fieldwdth
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fpat1:
- @echo fpat1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fpat2:
- @echo fpat2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fpat3:
- @echo fpat3
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fpatnull:
- @echo fpatnull
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fsfwfs:
- @echo fsfwfs
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
funlen:
- @echo funlen
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+functab1:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+functab2:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+functab3:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+functab4:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
fwtest:
- @echo fwtest
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fwtest2:
- @echo fwtest2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fwtest3:
- @echo fwtest3
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
gensub:
- @echo gensub
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
gensub2:
- @echo gensub2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
getlndir:
- @echo getlndir
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
gnuops2:
- @echo gnuops2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
gnuops3:
- @echo gnuops3
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
gnureops:
- @echo gnureops
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
icasefs:
- @echo icasefs
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
icasers:
- @echo icasers
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+id:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
igncdym:
- @echo igncdym
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
igncfs:
- @echo igncfs
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
ignrcase:
- @echo ignrcase
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
indirectcall:
- @echo indirectcall
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
lint:
- @echo lint
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
lintold:
- @echo lintold
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint-old < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
lintwarn:
- @echo lintwarn
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
match1:
- @echo match1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
match2:
- @echo match2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
match3:
- @echo match3
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nastyparm:
- @echo nastyparm
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nondec:
- @echo nondec
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
patsplit:
- @echo patsplit
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
posix:
- @echo posix
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
printfbad1:
- @echo printfbad1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
printfbad3:
- @echo printfbad3
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
procinfs:
- @echo procinfs
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
pty1:
- @echo pty1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
rebuf:
- @echo rebuf
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
regx8bit:
- @echo regx8bit
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
rstest6:
- @echo rstest6
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
shadow:
- @echo shadow
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
sortfor:
- @echo sortfor
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
sortu:
- @echo sortu
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
splitarg4:
- @echo splitarg4
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
strtonum:
- @echo strtonum
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
switch2:
- @echo switch2
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+symtab1:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+symtab2:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+symtab3:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+symtab4:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+symtab5:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+include:
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
double1:
- @echo double1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
double2:
- @echo double2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
intformat:
- @echo intformat
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
asort:
- @echo asort
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
asorti:
- @echo asorti
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fmttest:
- @echo fmttest
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fnarydel:
- @echo fnarydel
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
- @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+ @-if test -z "$$AWKFLAGS" ; then $(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ ; else \
+ $(CMP) $(srcdir)/$@-mpfr.ok _$@ && rm -f _$@ ; \
+ fi
fnparydl:
- @echo fnparydl
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
- @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+ @-if test -z "$$AWKFLAGS" ; then $(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ ; else \
+ $(CMP) $(srcdir)/$@-mpfr.ok _$@ && rm -f _$@ ; \
+ fi
rebt8b2:
- @echo rebt8b2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
sort1:
- @echo sort1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
sprintfc:
- @echo sprintfc
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+fnmatch:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+filefuncs:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fork:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fork2:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+ordchr:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+revout:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+revtwoway:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rwarray:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+time:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
# end of file Maketests
# Targets generated for other tests:
@@ -3075,7 +3403,7 @@ $(srcdir)/Maketests: $(srcdir)/Makefile.am $(srcdir)/Gentests
$(AWK) -f $(srcdir)/Gentests "$(srcdir)/Makefile.am" $$files > $(srcdir)/Maketests
clean:
- rm -fr _* core core.* fmtspcl.ok junk out1 out2 out3 strftime.ok test1 test2 seq *~
+ rm -fr _* core core.* fmtspcl.ok junk strftime.ok test1 test2 seq *~ readfile.ok fork.tmp.* testext.awk fts.ok readdir.ok
# An attempt to print something that can be grepped for in build logs
pass-fail:
@@ -3106,8 +3434,8 @@ valgrind-scan:
function show() {if (cmd) {printf "%s: %s\n",FILENAME,cmd; cmd = ""}; \
printf "\t%s\n",$$0}; \
{$$1 = ""}; \
- /Prog and args are:/ {incmd = 1; cmd = ""; next}; \
- incmd {if (NF == 1) incmd = 0; else {cmd = (cmd $$0); next}}; \
+ $$2 == "Command:" {incmd = 1; $$2 = ""; cmd = $$0; next}; \
+ incmd {if (/Parent PID:/) incmd = 0; else {cmd = (cmd $$0); next}}; \
/ERROR SUMMARY:/ && !/: 0 errors from 0 contexts/ {show()}; \
/definitely lost:/ && !/: 0 bytes in 0 blocks/ {show()}; \
/possibly lost:/ && !/: 0 bytes in 0 blocks/ {show()}; \
diff --git a/test/Maketests b/test/Maketests
index df52108d..1accc80d 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -1,1213 +1,1312 @@
Gt-dummy:
# file Maketests, generated from Makefile.am by the Gentests program
addcomma:
- @echo addcomma
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
anchgsub:
- @echo anchgsub
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
arrayparm:
- @echo arrayparm
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
arrayprm2:
- @echo arrayprm2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
arrayprm3:
- @echo arrayprm3
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
arrayref:
- @echo arrayref
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
arrymem1:
- @echo arrymem1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
arryref2:
- @echo arryref2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
arryref3:
- @echo arryref3
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
arryref4:
- @echo arryref4
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
arryref5:
- @echo arryref5
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
arynasty:
- @echo arynasty
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
aryprm1:
- @echo aryprm1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
aryprm2:
- @echo aryprm2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
aryprm3:
- @echo aryprm3
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
aryprm4:
- @echo aryprm4
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
aryprm5:
- @echo aryprm5
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
aryprm6:
- @echo aryprm6
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
aryprm7:
- @echo aryprm7
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
aryprm8:
- @echo aryprm8
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
arysubnm:
- @echo arysubnm
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
asgext:
- @echo asgext
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
back89:
- @echo back89
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
backgsub:
- @echo backgsub
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
childin:
- @echo childin
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
closebad:
- @echo closebad
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
clsflnam:
- @echo clsflnam
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
compare2:
- @echo compare2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
concat1:
- @echo concat1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
concat2:
- @echo concat2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
concat3:
- @echo concat3
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
convfmt:
- @echo convfmt
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
datanonl:
- @echo datanonl
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
defref:
- @echo defref
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
delargv:
- @echo delargv
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
delarpm2:
- @echo delarpm2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
delarprm:
- @echo delarprm
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
delfunc:
- @echo delfunc
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
dfastress:
- @echo dfastress
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
dynlj:
- @echo dynlj
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
eofsplit:
- @echo eofsplit
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
exitval2:
- @echo exitval2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fcall_exit:
- @echo fcall_exit
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fcall_exit2:
- @echo fcall_exit2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fldchg:
- @echo fldchg
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fldchgnf:
- @echo fldchgnf
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fnamedat:
- @echo fnamedat
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fnarray:
- @echo fnarray
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fnarray2:
- @echo fnarray2
- @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fnaryscl:
- @echo fnaryscl
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fnasgnm:
- @echo fnasgnm
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fnmisc:
- @echo fnmisc
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fordel:
- @echo fordel
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
forref:
- @echo forref
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
forsimp:
- @echo forsimp
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fsbs:
- @echo fsbs
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fsrs:
- @echo fsrs
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fstabplus:
- @echo fstabplus
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
funsemnl:
- @echo funsemnl
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
funsmnam:
- @echo funsmnam
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
funstack:
- @echo funstack
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
getline:
- @echo getline
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
getline3:
- @echo getline3
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
getline4:
- @echo getline4
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
getline5:
- @echo getline5
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
getnr2tb:
- @echo getnr2tb
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
getnr2tm:
- @echo getnr2tm
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
gsubasgn:
- @echo gsubasgn
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
gsubtest:
- @echo gsubtest
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
gsubtst2:
- @echo gsubtst2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
gsubtst4:
- @echo gsubtst4
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
gsubtst5:
- @echo gsubtst5
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
gsubtst7:
- @echo gsubtst7
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
gsubtst8:
- @echo gsubtst8
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
hex:
- @echo hex
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
hsprint:
- @echo hsprint
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
inputred:
- @echo inputred
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
intest:
- @echo intest
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
intprec:
- @echo intprec
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
iobug1:
- @echo iobug1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
leadnl:
- @echo leadnl
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
longsub:
- @echo longsub
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
longwrds:
- @echo longwrds
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
manglprm:
- @echo manglprm
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
math:
- @echo math
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
membug1:
- @echo membug1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
minusstr:
- @echo minusstr
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nasty:
- @echo nasty
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nasty2:
- @echo nasty2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
negexp:
- @echo negexp
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
negrange:
- @echo negrange
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nested:
- @echo nested
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nfldstr:
- @echo nfldstr
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nfneg:
- @echo nfneg
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nfset:
- @echo nfset
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nlfldsep:
- @echo nlfldsep
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nlinstr:
- @echo nlinstr
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nlstrina:
- @echo nlstrina
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
noeffect:
- @echo noeffect
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nofmtch:
- @echo nofmtch
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
noloop1:
- @echo noloop1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
noloop2:
- @echo noloop2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
noparms:
- @echo noparms
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nulrsend:
- @echo nulrsend
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
numindex:
- @echo numindex
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
numsubstr:
- @echo numsubstr
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
octsub:
- @echo octsub
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
ofmt:
- @echo ofmt
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
ofmta:
- @echo ofmta
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
ofmtbig:
- @echo ofmtbig
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
ofmtfidl:
- @echo ofmtfidl
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
ofmts:
- @echo ofmts
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
ofs1:
- @echo ofs1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
onlynl:
- @echo onlynl
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
opasnidx:
- @echo opasnidx
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
opasnslf:
- @echo opasnslf
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
paramdup:
- @echo paramdup
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
paramres:
- @echo paramres
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
paramtyp:
- @echo paramtyp
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
parse1:
- @echo parse1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
parsefld:
- @echo parsefld
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
parseme:
- @echo parseme
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
pcntplus:
- @echo pcntplus
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
prdupval:
- @echo prdupval
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
prec:
- @echo prec
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
printf1:
- @echo printf1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
prmarscl:
- @echo prmarscl
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
prmreuse:
- @echo prmreuse
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
prt1eval:
- @echo prt1eval
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
prtoeval:
- @echo prtoeval
- @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
- @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
-
-rand:
- @echo rand
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
range1:
- @echo range1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
rebt8b1:
- @echo rebt8b1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
regeq:
- @echo regeq
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
regexprange:
- @echo regexprange
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
regrange:
- @echo regrange
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
reindops:
- @echo reindops
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
reparse:
- @echo reparse
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
resplit:
- @echo resplit
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
rs:
- @echo rs
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
rsnul1nl:
- @echo rsnul1nl
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
rstest1:
- @echo rstest1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
rstest2:
- @echo rstest2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
rstest3:
- @echo rstest3
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
rstest4:
- @echo rstest4
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
rstest5:
- @echo rstest5
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
rswhite:
- @echo rswhite
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
scalar:
- @echo scalar
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
sclforin:
- @echo sclforin
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
sclifin:
- @echo sclifin
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
sortempty:
- @echo sortempty
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
splitargv:
- @echo splitargv
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
splitarr:
- @echo splitarr
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
splitdef:
- @echo splitdef
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
splitvar:
- @echo splitvar
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
splitwht:
- @echo splitwht
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
strcat1:
- @echo strcat1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
strnum1:
- @echo strnum1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
strtod:
- @echo strtod
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
subsepnm:
- @echo subsepnm
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
subslash:
- @echo subslash
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
substr:
- @echo substr
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
swaplns:
- @echo swaplns
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
synerr1:
- @echo synerr1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
synerr2:
- @echo synerr2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
uninit2:
- @echo uninit2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
uninit3:
- @echo uninit3
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
uninit4:
- @echo uninit4
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
uninit5:
- @echo uninit5
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
uninitialized:
- @echo uninitialized
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
unterm:
- @echo unterm
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
uparrfs:
- @echo uparrfs
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
wjposer1:
- @echo wjposer1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
zero2:
- @echo zero2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
zeroe0:
- @echo zeroe0
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
zeroflag:
- @echo zeroflag
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
getlnhd:
- @echo getlnhd
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
aadelete1:
- @echo aadelete1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
aadelete2:
- @echo aadelete2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
aarray1:
- @echo aarray1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
aasort:
- @echo aasort
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
aasorti:
- @echo aasorti
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
arraysort:
- @echo arraysort
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
backw:
- @echo backw
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
clos1way:
- @echo clos1way
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
delsub:
- @echo delsub
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fieldwdth:
- @echo fieldwdth
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fpat1:
- @echo fpat1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fpat2:
- @echo fpat2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fpat3:
- @echo fpat3
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fpatnull:
- @echo fpatnull
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fsfwfs:
- @echo fsfwfs
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
funlen:
- @echo funlen
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+functab1:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+functab2:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+functab3:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+functab4:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
fwtest:
- @echo fwtest
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fwtest2:
- @echo fwtest2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fwtest3:
- @echo fwtest3
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
gensub:
- @echo gensub
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
gensub2:
- @echo gensub2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
getlndir:
- @echo getlndir
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
gnuops2:
- @echo gnuops2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
gnuops3:
- @echo gnuops3
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
gnureops:
- @echo gnureops
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
icasefs:
- @echo icasefs
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
icasers:
- @echo icasers
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+id:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
igncdym:
- @echo igncdym
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
igncfs:
- @echo igncfs
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
ignrcase:
- @echo ignrcase
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
indirectcall:
- @echo indirectcall
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
lint:
- @echo lint
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
lintold:
- @echo lintold
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint-old < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
lintwarn:
- @echo lintwarn
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
match1:
- @echo match1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
match2:
- @echo match2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
match3:
- @echo match3
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nastyparm:
- @echo nastyparm
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nondec:
- @echo nondec
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
patsplit:
- @echo patsplit
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
posix:
- @echo posix
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
printfbad1:
- @echo printfbad1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
printfbad3:
- @echo printfbad3
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
procinfs:
- @echo procinfs
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
pty1:
- @echo pty1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
rebuf:
- @echo rebuf
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
regx8bit:
- @echo regx8bit
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
rstest6:
- @echo rstest6
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
shadow:
- @echo shadow
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
sortfor:
- @echo sortfor
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
sortu:
- @echo sortu
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
splitarg4:
- @echo splitarg4
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
strtonum:
- @echo strtonum
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
switch2:
- @echo switch2
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+symtab1:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+symtab2:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+symtab3:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+symtab4:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+symtab5:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+include:
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
double1:
- @echo double1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
double2:
- @echo double2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
intformat:
- @echo intformat
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
asort:
- @echo asort
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
asorti:
- @echo asorti
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fmttest:
- @echo fmttest
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fnarydel:
- @echo fnarydel
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
- @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+ @-if test -z "$$AWKFLAGS" ; then $(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ ; else \
+ $(CMP) $(srcdir)/$@-mpfr.ok _$@ && rm -f _$@ ; \
+ fi
fnparydl:
- @echo fnparydl
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
- @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+ @-if test -z "$$AWKFLAGS" ; then $(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ ; else \
+ $(CMP) $(srcdir)/$@-mpfr.ok _$@ && rm -f _$@ ; \
+ fi
rebt8b2:
- @echo rebt8b2
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
sort1:
- @echo sort1
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
sprintfc:
- @echo sprintfc
+ @echo $@
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+fnmatch:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+filefuncs:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fork:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fork2:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+ordchr:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+revout:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+revtwoway:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rwarray:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+time:
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
# end of file Maketests
diff --git a/test/assignconst.awk b/test/assignconst.awk
new file mode 100644
index 00000000..907987c7
--- /dev/null
+++ b/test/assignconst.awk
@@ -0,0 +1,58 @@
+@load "testext"
+
+BEGIN {
+ print ""
+ print "test:", ARGV[1]
+ switch (ARGV[1] + 0) {
+ case 1:
+ answer_num = 43
+ break
+ case 2:
+ ++answer_num
+ break
+ case 3:
+ --answer_num
+ break
+ case 4:
+ answer_num++
+ break
+ case 5:
+ answer_num--
+ break
+ case 6:
+ answer_num += 1
+ break
+ case 7:
+ answer_num -= 1
+ break
+ case 8:
+ answer_num *= 1
+ break
+ case 9:
+ answer_num /= 1
+ break
+ case 10:
+ answer_num ^= 1
+ break
+ case 11:
+ answer_num = answer_num "foo"
+ break
+ case 12:
+ sub(/2/, "3", answer_num)
+ break
+ case 13:
+ a[1] = 1
+ for (answer_num in a)
+ print answer_num, a[answer_num]
+ break
+ case 14:
+ test_func(answer_num)
+ break
+ }
+}
+
+function test_func(val)
+{
+ val++
+ print "in test_func, val now =", val
+}
diff --git a/test/assignconst.ok b/test/assignconst.ok
new file mode 100644
index 00000000..97698b27
--- /dev/null
+++ b/test/assignconst.ok
@@ -0,0 +1,42 @@
+
+test: 1
+gawk: assignconst.awk:8: fatal: cannot assign to defined constant
+
+test: 2
+gawk: assignconst.awk:11: fatal: cannot assign to defined constant
+
+test: 3
+gawk: assignconst.awk:14: fatal: cannot assign to defined constant
+
+test: 4
+gawk: assignconst.awk:17: fatal: cannot assign to defined constant
+
+test: 5
+gawk: assignconst.awk:20: fatal: cannot assign to defined constant
+
+test: 6
+gawk: assignconst.awk:23: fatal: cannot assign to defined constant
+
+test: 7
+gawk: assignconst.awk:26: fatal: cannot assign to defined constant
+
+test: 8
+gawk: assignconst.awk:29: fatal: cannot assign to defined constant
+
+test: 9
+gawk: assignconst.awk:32: fatal: cannot assign to defined constant
+
+test: 10
+gawk: assignconst.awk:35: fatal: cannot assign to defined constant
+
+test: 11
+gawk: assignconst.awk:38: fatal: cannot assign to defined constant
+
+test: 12
+gawk: assignconst.awk:41: fatal: cannot assign to defined constant
+
+test: 13
+gawk: assignconst.awk:45: fatal: cannot assign to defined constant
+
+test: 14
+in test_func, val now = 43
diff --git a/test/badargs.ok b/test/badargs.ok
index 66e67b03..1be81ec3 100644
--- a/test/badargs.ok
+++ b/test/badargs.ok
@@ -10,13 +10,18 @@ Short options: GNU long options: (extensions)
-c --traditional
-C --copyright
-d[file] --dump-variables[=file]
+ -D[file] --debug[=file]
-e 'program-text' --source='program-text'
-E file --exec=file
-g --gen-pot
-h --help
+ -i includefile --include=includefile
+ -l library --load=library
-L [fatal] --lint[=fatal]
-n --non-decimal-data
+ -M --bignum
-N --use-lc-numeric
+ -o[file] --pretty-print[=file]
-O --optimize
-p[file] --profile[=file]
-P --posix
diff --git a/test/delfunc.ok b/test/delfunc.ok
index d12f0bc9..29a7450d 100644
--- a/test/delfunc.ok
+++ b/test/delfunc.ok
@@ -1,2 +1,3 @@
-gawk: delfunc.awk:4: fatal: attempt to use function `f' as an array
-EXIT CODE: 2
+gawk: delfunc.awk:4: error: function `f' called with space between name and `(',
+or used as a variable or an array
+EXIT CODE: 1
diff --git a/test/dumpvars.ok b/test/dumpvars.ok
index 01d5fb78..73d3d306 100644
--- a/test/dumpvars.ok
+++ b/test/dumpvars.ok
@@ -16,7 +16,9 @@ NR: 3
OFMT: "%.6g"
OFS: " "
ORS: "\n"
+PREC: 53
RLENGTH: 0
+ROUNDMODE: "N"
RS: "\n"
RSTART: 0
RT: "\n"
diff --git a/test/filefuncs.awk b/test/filefuncs.awk
new file mode 100644
index 00000000..aa532741
--- /dev/null
+++ b/test/filefuncs.awk
@@ -0,0 +1,25 @@
+@load "filefuncs"
+
+BEGIN {
+ if (chdir("..") < 0) {
+ printf "Error: chdir failed with ERRNO %s\n", ERRNO
+ exit 1
+ }
+
+ if (stat(ARGV[0], st) < 0) {
+ printf "Error: stat(%s) failed with ERRNO %s\n", ARGV[0], ERRNO
+ exit 1
+ }
+
+ nf = split("name dev ino mode nlink uid gid size blocks atime mtime ctime pmode type", f)
+
+ for (i = 1; i <= nf; i++) {
+ if (!(f[i] in st)) {
+ printf "stat value for %s is missing\n",f[i]
+ rc = 1
+ }
+ else
+ delete st[f[i]]
+ }
+ exit rc+0
+}
diff --git a/test/filefuncs.ok b/test/filefuncs.ok
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/filefuncs.ok
diff --git a/test/fmtspcl-mpfr.ok b/test/fmtspcl-mpfr.ok
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fmtspcl-mpfr.ok
diff --git a/test/fnamedat.ok b/test/fnamedat.ok
index d32acff4..d7b71c41 100644
--- a/test/fnamedat.ok
+++ b/test/fnamedat.ok
@@ -1,2 +1,3 @@
-gawk: fnamedat.awk:1: (FILENAME=- FNR=1) fatal: can't use function name `foo' as variable or array
-EXIT CODE: 2
+gawk: fnamedat.awk:1: error: function `foo' called with space between name and `(',
+or used as a variable or an array
+EXIT CODE: 1
diff --git a/test/fnarray.ok b/test/fnarray.ok
index 04260b0f..6cab9134 100644
--- a/test/fnarray.ok
+++ b/test/fnarray.ok
@@ -1,5 +1,3 @@
-gawk: fnarray.awk:5: Num = foo[c]
-gawk: fnarray.awk:5: ^ use of non-array as array
gawk: fnarray.awk:5: error: function `foo' called with space between name and `(',
or used as a variable or an array
EXIT CODE: 1
diff --git a/test/fnarray2.in b/test/fnarray2.in
new file mode 100644
index 00000000..587be6b4
--- /dev/null
+++ b/test/fnarray2.in
@@ -0,0 +1 @@
+x
diff --git a/test/fnarray2.ok b/test/fnarray2.ok
index 243e4cc3..82815055 100644
--- a/test/fnarray2.ok
+++ b/test/fnarray2.ok
@@ -1,3 +1,3 @@
-gawk: fnarray2.awk:3: r = ++pile[c]
-gawk: fnarray2.awk:3: ^ use of non-array as array
+gawk: fnarray2.awk:3: error: function `pile' called with space between name and `(',
+or used as a variable or an array
EXIT CODE: 1
diff --git a/test/fnarydel-mpfr.ok b/test/fnarydel-mpfr.ok
new file mode 100644
index 00000000..7f3e4531
--- /dev/null
+++ b/test/fnarydel-mpfr.ok
@@ -0,0 +1,27 @@
+first loop
+4
+5
+6
+7
+8
+9
+1
+2
+3
+second loop
+third loop
+4
+5
+6
+7
+8
+9
+1
+2
+3
+call func
+fourth loop
+You should just see: 4 4
+4 4
+You should see nothing between this line
+And this one
diff --git a/test/fnarydel.ok b/test/fnarydel.ok
index 7f3e4531..7078c015 100644
--- a/test/fnarydel.ok
+++ b/test/fnarydel.ok
@@ -1,24 +1,24 @@
first loop
+1
+2
+3
4
5
6
7
8
9
+second loop
+third loop
1
2
3
-second loop
-third loop
4
5
6
7
8
9
-1
-2
-3
call func
fourth loop
You should just see: 4 4
diff --git a/test/fnasgnm.ok b/test/fnasgnm.ok
index 0db5c6d8..5cacff27 100644
--- a/test/fnasgnm.ok
+++ b/test/fnasgnm.ok
@@ -1,2 +1,3 @@
-gawk: fnasgnm.awk:14: (FILENAME=- FNR=1) fatal: can't use function name `ShowMe' as variable or array
-EXIT CODE: 2
+gawk: fnasgnm.awk:14: error: function `ShowMe' called with space between name and `(',
+or used as a variable or an array
+EXIT CODE: 1
diff --git a/test/fnmatch.awk b/test/fnmatch.awk
new file mode 100644
index 00000000..c0885074
--- /dev/null
+++ b/test/fnmatch.awk
@@ -0,0 +1,11 @@
+@load "fnmatch"
+
+BEGIN {
+ print "FNM_NOMATCH =", FNM_NOMATCH
+ # can't print the values; they vary from system to system
+ for (i in FNM)
+ printf("\"%s\" is an element in FNM\n", i)
+
+ printf("fnmatch(\"*.a\", \"foo.a\", 0) = %d\n", fnmatch("*.a", "foo.a", 0) )
+ printf("fnmatch(\"*.a\", \"foo.c\", 0) = %d\n", fnmatch("*.a", "foo.c", 0))
+}
diff --git a/test/fnmatch.ok b/test/fnmatch.ok
new file mode 100644
index 00000000..fd8a78ce
--- /dev/null
+++ b/test/fnmatch.ok
@@ -0,0 +1,9 @@
+FNM_NOMATCH = 1
+"LEADING_DIR" is an element in FNM
+"CASEFOLD" is an element in FNM
+"NOESCAPE" is an element in FNM
+"PERIOD" is an element in FNM
+"PATHNAME" is an element in FNM
+"FILE_NAME" is an element in FNM
+fnmatch("*.a", "foo.a", 0) = 0
+fnmatch("*.a", "foo.c", 0) = 1
diff --git a/test/fnparydl-mpfr.ok b/test/fnparydl-mpfr.ok
new file mode 100644
index 00000000..26a5c390
--- /dev/null
+++ b/test/fnparydl-mpfr.ok
@@ -0,0 +1,10 @@
+BEFORE LOOP
+DELETING KEY 4
+DELETING KEY 5
+DELETING KEY 6
+DELETING KEY 7
+DELETING KEY 1
+DELETING KEY 2
+DELETING KEY 3
+AFTER LOOP
+0 elements still in q[]
diff --git a/test/fnparydl.ok b/test/fnparydl.ok
index 26a5c390..9f798224 100644
--- a/test/fnparydl.ok
+++ b/test/fnparydl.ok
@@ -1,10 +1,10 @@
BEFORE LOOP
+DELETING KEY 1
+DELETING KEY 2
+DELETING KEY 3
DELETING KEY 4
DELETING KEY 5
DELETING KEY 6
DELETING KEY 7
-DELETING KEY 1
-DELETING KEY 2
-DELETING KEY 3
AFTER LOOP
0 elements still in q[]
diff --git a/test/fork.awk b/test/fork.awk
new file mode 100644
index 00000000..0b29f9ff
--- /dev/null
+++ b/test/fork.awk
@@ -0,0 +1,33 @@
+@load "fork"
+
+BEGIN {
+ fn = ("fork.tmp." PROCINFO["pid"])
+ switch (pid = fork()) {
+ case -1:
+ printf "Error: fork failed with ERRNO %s\n", ERRNO
+ exit 1
+ case 0:
+ # child
+ printf "pid %s ppid %s\n", PROCINFO["pid"], PROCINFO["ppid"] > fn
+ exit 0
+ default:
+ # parent
+ erc = 1
+ if ((rc = wait()) < 0)
+ printf "Error: wait failed with ERRNO %s\n", ERRNO
+ else if (rc != pid)
+ printf "Error: wait returned %s instead of child pid %s\n", rc, pid
+ else if ((getline x < fn) != 1)
+ printf "Error: getline failed on temp file %s\n", fn
+ else {
+ expected = ("pid " pid " ppid " PROCINFO["pid"])
+ if (x != expected)
+ printf "Error: child data (%s) != expected (%s)\n", x, expected
+ else if ((rc = system("rm " fn)) != 0)
+ printf "Error removing temp file %s with ERRNO %s\n", fn, ERRNO
+ else
+ erc = 0
+ }
+ exit erc
+ }
+}
diff --git a/test/fork.ok b/test/fork.ok
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fork.ok
diff --git a/test/fork2.awk b/test/fork2.awk
new file mode 100644
index 00000000..bd364286
--- /dev/null
+++ b/test/fork2.awk
@@ -0,0 +1,35 @@
+@load "fork"
+
+BEGIN {
+ # avoid instantiating PROCINFO prior to the fork
+ switch (pid = fork()) {
+ case -1:
+ printf "Error: fork failed with ERRNO %s\n", ERRNO
+ exit 1
+ case 0:
+ # child
+ fn = ("fork.tmp." PROCINFO["pid"])
+ printf "pid %s ppid %s\n", PROCINFO["pid"], PROCINFO["ppid"] > fn
+ exit 0
+ default:
+ # parent
+ erc = 1
+ fn = ("fork.tmp." pid)
+ if ((rc = wait()) < 0)
+ printf "Error: wait failed with ERRNO %s\n", ERRNO
+ else if (rc != pid)
+ printf "Error: wait returned %s instead of child pid %s\n", rc, pid
+ else if ((getline x < fn) != 1)
+ printf "Error: getline failed on temp file %s\n", fn
+ else {
+ expected = ("pid " pid " ppid " PROCINFO["pid"])
+ if (x != expected)
+ printf "Error: child data (%s) != expected (%s)\n", x, expected
+ else if ((rc = system("rm " fn)) != 0)
+ printf "Error removing temp file %s with ERRNO %s\n", fn, ERRNO
+ else
+ erc = 0
+ }
+ exit erc
+ }
+}
diff --git a/test/fork2.ok b/test/fork2.ok
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/fork2.ok
diff --git a/test/fts.awk b/test/fts.awk
new file mode 100644
index 00000000..a1b49cbd
--- /dev/null
+++ b/test/fts.awk
@@ -0,0 +1,121 @@
+@load "filefuncs"
+
+BEGIN {
+ Level = 0
+
+ system("rm -fr d1 d2")
+ system("mkdir d1 d2 ; touch d1/f1 d1/f2 d2/f1 d2/f2")
+ pathlist[1] = "d1"
+ pathlist[2] = "d2"
+ flags = FTS_PHYSICAL
+ fts(pathlist, flags, data)
+
+ output = "fts.ok"
+ traverse(data)
+ close(output)
+
+ ftswalk(pathlist, data2)
+ output = "_fts"
+ traverse(data2)
+ close(output)
+
+ system("rm -fr d1 d2")
+}
+
+function indent( i)
+{
+ for (i = 1; i <= Level; i++)
+ printf("\t") > output
+}
+
+function sort_traverse(data, sorted, i)
+{
+ asorti(data, sorted)
+ for (i = 1; i in sorted; i++) {
+ indent()
+ printf("%s --> %s\n", sorted[i], data[sorted[i]]) > output
+ }
+}
+
+function traverse(data, i)
+{
+ for (i in data) {
+ if (isarray(data[i])) {
+ indent()
+ printf("%s:\n", i) > output
+
+ Level++
+ if (("mtime" in data[i]) && ! isarray(data[i][mtime])) {
+ sort_traverse(data[i])
+ } else {
+ traverse(data[i])
+ }
+ Level--
+ } else {
+ indent()
+ printf("%s --> %s\n", i, data[i]) > output
+ }
+ }
+}
+
+
+function ftswalk(pathlist, data, i, toppath)
+{
+ delete data
+ for (i = 1; i in pathlist; i++) {
+ toppath = pathlist[i]
+ data[toppath]["junk"]++ # create array
+ delete data[toppath]["junk"]
+ process(pathlist[i], data)
+ }
+}
+
+# enter process with pathname, array for that path already created but
+# empty
+
+function process(pathname, data_array,
+ stat_data, i, direntry, command, shortname) # locals
+{
+ stat(pathname, stat_data)
+ if (stat_data["type"] == "file") {
+ shortname = strrstr(pathname, "/")
+ data_array["path"] = pathname
+ for (i in stat_data) {
+ if (i == "name")
+ data_array["stat"][i] = shortname
+ else
+ data_array["stat"][i] = stat_data[i]
+ }
+
+ return
+ }
+
+ # stuff for a directory
+
+ data_array[pathname]["."]["path"] = pathname
+ for (i in stat_data)
+ data_array[pathname]["."]["stat"][i] = stat_data[i]
+
+ command = ("ls -f " pathname)
+ while ((command | getline direntry) > 0) {
+ if (direntry == "." || direntry == "..")
+ continue
+ data_array[pathname][direntry]["junk"]++
+ delete data_array[pathname][direntry]["junk"]
+ process(pathname "/" direntry,
+ data_array[pathname][direntry])
+ }
+ close(command)
+}
+
+function strrstr(string, delim, ind)
+{
+ if ((ind = index(string, delim)) == 0)
+ return string
+
+ do {
+ string = substr(string, ind + 1)
+ } while ((ind = index(string, delim)) > 0)
+
+ return string
+}
diff --git a/test/functab1.awk b/test/functab1.awk
new file mode 100644
index 00000000..05692684
--- /dev/null
+++ b/test/functab1.awk
@@ -0,0 +1,3 @@
+BEGIN {
+ delete FUNCTAB
+}
diff --git a/test/functab1.ok b/test/functab1.ok
new file mode 100644
index 00000000..2a60a4cb
--- /dev/null
+++ b/test/functab1.ok
@@ -0,0 +1,2 @@
+gawk: functab1.awk:3: fatal: `delete' is not allowed with FUNCTAB
+EXIT CODE: 2
diff --git a/test/functab2.awk b/test/functab2.awk
new file mode 100644
index 00000000..9a07dfc3
--- /dev/null
+++ b/test/functab2.awk
@@ -0,0 +1,8 @@
+function foo()
+{
+ print "foo!"
+}
+
+BEGIN {
+ FUNCTAB["a"] = "something"
+}
diff --git a/test/functab2.ok b/test/functab2.ok
new file mode 100644
index 00000000..32b07ad3
--- /dev/null
+++ b/test/functab2.ok
@@ -0,0 +1,2 @@
+gawk: functab2.awk:7: fatal: cannot assign to elements of FUNCTAB
+EXIT CODE: 2
diff --git a/test/functab3.awk b/test/functab3.awk
new file mode 100644
index 00000000..98fa49b1
--- /dev/null
+++ b/test/functab3.awk
@@ -0,0 +1,10 @@
+function foo()
+{
+ print "foo!"
+}
+
+BEGIN {
+ x = FUNCTAB["foo"]
+ print "x =", x
+ @x()
+}
diff --git a/test/functab3.ok b/test/functab3.ok
new file mode 100644
index 00000000..66f53d72
--- /dev/null
+++ b/test/functab3.ok
@@ -0,0 +1,2 @@
+x = foo
+foo!
diff --git a/test/functab4.awk b/test/functab4.awk
new file mode 100644
index 00000000..0d9d4267
--- /dev/null
+++ b/test/functab4.awk
@@ -0,0 +1,14 @@
+@load "filefuncs"
+
+function foo()
+{
+ print "foo!"
+}
+
+BEGIN {
+ x = FUNCTAB["chdir"]
+ print "x =", x
+ @x("/tmp")
+ printf "we are now in --> "
+ system("/bin/pwd || /usr/bin/pwd")
+}
diff --git a/test/functab4.ok b/test/functab4.ok
new file mode 100644
index 00000000..70a520b7
--- /dev/null
+++ b/test/functab4.ok
@@ -0,0 +1,3 @@
+x = chdir
+gawk: functab4.awk:11: fatal: cannot (yet) call extension functions indirectly
+EXIT CODE: 2
diff --git a/test/funsmnam.ok b/test/funsmnam.ok
index e4f2174a..cce0d275 100644
--- a/test/funsmnam.ok
+++ b/test/funsmnam.ok
@@ -1,2 +1,2 @@
-gawk: funsmnam.awk:1: error: function `foo': can't use function name as parameter name
+gawk: funsmnam.awk:2: error: function `foo': can't use function name as parameter name
EXIT CODE: 1
diff --git a/test/gsubasgn.ok b/test/gsubasgn.ok
index 8817c36d..8a309c7c 100644
--- a/test/gsubasgn.ok
+++ b/test/gsubasgn.ok
@@ -1,5 +1,5 @@
-gawk: gsubasgn.awk:4: function test1 (r) { gsub(r, "x", test1) }
-gawk: gsubasgn.awk:4: ^ gsub third parameter is not a changeable object
-gawk: gsubasgn.awk:8: function test2 () { gsub(/a/, "x", test2) }
-gawk: gsubasgn.awk:8: ^ gsub third parameter is not a changeable object
+gawk: gsubasgn.awk:4: error: function `test1' called with space between name and `(',
+or used as a variable or an array
+gawk: gsubasgn.awk:8: error: function `test2' called with space between name and `(',
+or used as a variable or an array
EXIT CODE: 1
diff --git a/test/hello.awk b/test/hello.awk
new file mode 100644
index 00000000..9e6d569d
--- /dev/null
+++ b/test/hello.awk
@@ -0,0 +1,3 @@
+BEGIN {
+ print "Hello"
+}
diff --git a/test/id.awk b/test/id.awk
new file mode 100644
index 00000000..2a35e42c
--- /dev/null
+++ b/test/id.awk
@@ -0,0 +1,11 @@
+function function1()
+{
+ print "function1"
+}
+
+BEGIN {
+ an_array[1] = 1
+
+ for (i in PROCINFO["identifiers"])
+ printf("%s -> %s\n", i, PROCINFO["identifiers"][i])
+}
diff --git a/test/id.ok b/test/id.ok
new file mode 100644
index 00000000..d31573de
--- /dev/null
+++ b/test/id.ok
@@ -0,0 +1,32 @@
+FUNCTAB -> array
+ARGV -> array
+SYMTAB -> array
+ORS -> scalar
+ROUNDMODE -> scalar
+i -> untyped
+OFS -> scalar
+ERRNO -> scalar
+FNR -> scalar
+LINT -> scalar
+IGNORECASE -> scalar
+NR -> scalar
+function1 -> user
+ARGIND -> scalar
+NF -> scalar
+TEXTDOMAIN -> scalar
+CONVFMT -> scalar
+FIELDWIDTHS -> scalar
+ARGC -> scalar
+an_array -> untyped
+PROCINFO -> array
+PREC -> scalar
+SUBSEP -> scalar
+FPAT -> scalar
+RS -> scalar
+FS -> scalar
+OFMT -> scalar
+RLENGTH -> scalar
+RT -> scalar
+BINMODE -> scalar
+FILENAME -> scalar
+RSTART -> scalar
diff --git a/test/incdupe.ok b/test/incdupe.ok
new file mode 100644
index 00000000..63c85e41
--- /dev/null
+++ b/test/incdupe.ok
@@ -0,0 +1,3 @@
+gawk: warning: already included source file `inclib.awk'
+Include library loaded.
+abc
diff --git a/test/incdupe2.ok b/test/incdupe2.ok
new file mode 100644
index 00000000..11787238
--- /dev/null
+++ b/test/incdupe2.ok
@@ -0,0 +1,2 @@
+gawk: inclib.awk:5: error: function name `sandwich' previously defined
+EXIT CODE: 1
diff --git a/test/incdupe3.ok b/test/incdupe3.ok
new file mode 100644
index 00000000..af17d2f8
--- /dev/null
+++ b/test/incdupe3.ok
@@ -0,0 +1,2 @@
+Hello
+Hello
diff --git a/test/incdupe4.ok b/test/incdupe4.ok
new file mode 100644
index 00000000..a6fc26e2
--- /dev/null
+++ b/test/incdupe4.ok
@@ -0,0 +1,2 @@
+gawk: fatal: can't include `hello.awk' and use it as a program file
+EXIT CODE: 2
diff --git a/test/incdupe5.ok b/test/incdupe5.ok
new file mode 100644
index 00000000..a6fc26e2
--- /dev/null
+++ b/test/incdupe5.ok
@@ -0,0 +1,2 @@
+gawk: fatal: can't include `hello.awk' and use it as a program file
+EXIT CODE: 2
diff --git a/test/incdupe6.ok b/test/incdupe6.ok
new file mode 100644
index 00000000..42a4f9fd
--- /dev/null
+++ b/test/incdupe6.ok
@@ -0,0 +1,3 @@
+gawk: inchello:1: warning: `include' is a gawk extension
+gawk: inchello:2: fatal: can't include `hello' and use it as a program file
+EXIT CODE: 2
diff --git a/test/incdupe7.ok b/test/incdupe7.ok
new file mode 100644
index 00000000..42a4f9fd
--- /dev/null
+++ b/test/incdupe7.ok
@@ -0,0 +1,3 @@
+gawk: inchello:1: warning: `include' is a gawk extension
+gawk: inchello:2: fatal: can't include `hello' and use it as a program file
+EXIT CODE: 2
diff --git a/test/inchello.awk b/test/inchello.awk
new file mode 100644
index 00000000..148d4bef
--- /dev/null
+++ b/test/inchello.awk
@@ -0,0 +1 @@
+@include "hello"
diff --git a/test/inclib.awk b/test/inclib.awk
new file mode 100644
index 00000000..51785283
--- /dev/null
+++ b/test/inclib.awk
@@ -0,0 +1,7 @@
+BEGIN {
+ print "Include library loaded."
+}
+
+function sandwich(pfx,x,sfx) {
+ return (pfx x sfx)
+}
diff --git a/test/include.awk b/test/include.awk
new file mode 100644
index 00000000..8fc7837d
--- /dev/null
+++ b/test/include.awk
@@ -0,0 +1,5 @@
+@include "inclib.awk"
+
+BEGIN {
+ print sandwich("a", "b", "c")
+}
diff --git a/test/include.ok b/test/include.ok
new file mode 100644
index 00000000..a720efca
--- /dev/null
+++ b/test/include.ok
@@ -0,0 +1,2 @@
+Include library loaded.
+abc
diff --git a/test/include2.ok b/test/include2.ok
new file mode 100644
index 00000000..a720efca
--- /dev/null
+++ b/test/include2.ok
@@ -0,0 +1,2 @@
+Include library loaded.
+abc
diff --git a/test/lintwarn.ok b/test/lintwarn.ok
index 312d40d4..ec87612f 100644
--- a/test/lintwarn.ok
+++ b/test/lintwarn.ok
@@ -16,6 +16,7 @@ gawk: lintwarn.awk:18: warning: `case' is a gawk extension
gawk: lintwarn.awk:19: warning: `default' is a gawk extension
gawk: lintwarn.awk:19: error: duplicate `default' detected in switch body
gawk: lintwarn.awk:18: error: duplicate case values in switch body: 1
+gawk: lintwarn.awk:24: error: `continue' is not allowed outside a loop
gawk: lintwarn.awk:23: error: `break' is not allowed outside a loop or switch
gawk: lintwarn.awk:24: error: `continue' is not allowed outside a loop
gawk: lintwarn.awk:25: error: `next' used in BEGIN action
diff --git a/test/match2.ok b/test/match2.ok
index a4a91e85..ad2e324c 100644
--- a/test/match2.ok
+++ b/test/match2.ok
@@ -1,2 +1,3 @@
-gawk: match2.awk:3: fatal: match: third argument is not an array
-EXIT CODE: 2
+gawk: match2.awk:3: error: function `f' called with space between name and `(',
+or used as a variable or an array
+EXIT CODE: 1
diff --git a/test/messages.awk b/test/messages.awk
index 555f6e38..50f7d91f 100644
--- a/test/messages.awk
+++ b/test/messages.awk
@@ -2,7 +2,7 @@
# with and without -c (compatibility) flag, redirecting output
# from gawk to a file or not. Some results can be quite unexpected.
BEGIN {
- print "Goes to a file out1" > "out1"
+ print "Goes to a file out1" > "_out1"
print "Normal print statement"
print "This printed on stdout" > "/dev/stdout"
print "You blew it!" > "/dev/stderr"
diff --git a/test/mpfrbigint.awk b/test/mpfrbigint.awk
new file mode 100644
index 00000000..bfdd871a
--- /dev/null
+++ b/test/mpfrbigint.awk
@@ -0,0 +1,11 @@
+BEGIN {
+ x = 5^4^3^2
+ print "# of digits =", length(x)
+ print substr(x, 1, 20), "...", substr(x, length(x) - 19, 20)
+
+ PREC = 1 + 3.321928095 * length(x); # 1 + digits * log2(10)
+ print "floating-point computation with precision =", PREC
+ y = 5.0^4.0^3.0^2.0
+ print "# of digits =", length(y)
+ print substr(y, 1, 20), "...", substr(y, length(y) - 19, 20)
+}
diff --git a/test/mpfrbigint.ok b/test/mpfrbigint.ok
new file mode 100644
index 00000000..670d4e07
--- /dev/null
+++ b/test/mpfrbigint.ok
@@ -0,0 +1,5 @@
+# of digits = 183231
+62060698786608744707 ... 92256259918212890625
+floating-point computation with precision = 608681
+# of digits = 183231
+62060698786608744707 ... 92256259918212890625
diff --git a/test/mpfrexprange.awk b/test/mpfrexprange.awk
new file mode 100644
index 00000000..68e95a39
--- /dev/null
+++ b/test/mpfrexprange.awk
@@ -0,0 +1,7 @@
+# test change of allowed exponent range
+BEGIN {
+ x=1.0e-10000
+ print x+0
+ PREC="double"
+ print x+0
+}
diff --git a/test/mpfrexprange.ok b/test/mpfrexprange.ok
new file mode 100644
index 00000000..4700ee22
--- /dev/null
+++ b/test/mpfrexprange.ok
@@ -0,0 +1,2 @@
+1e-10000
+0
diff --git a/test/mpfrieee.awk b/test/mpfrieee.awk
new file mode 100644
index 00000000..dc6e120d
--- /dev/null
+++ b/test/mpfrieee.awk
@@ -0,0 +1,13 @@
+# Test IEEE-754 binary double format
+BEGIN {
+ x = 1.0e-320
+ i = 0
+ while (x > 0) {
+ printf("%.15e\n", x)
+ x /= 2
+
+ # terminate early when the test is going to fail.
+ if (++i > 50)
+ break
+ }
+}
diff --git a/test/mpfrieee.ok b/test/mpfrieee.ok
new file mode 100644
index 00000000..e88f5c79
--- /dev/null
+++ b/test/mpfrieee.ok
@@ -0,0 +1,12 @@
+9.999888671826830e-321
+4.999944335913415e-321
+2.499972167956708e-321
+1.249986083978354e-321
+6.225227137599706e-322
+3.112613568799853e-322
+1.581010066691989e-322
+7.905050333459945e-323
+3.952525166729972e-323
+1.976262583364986e-323
+9.881312916824931e-324
+4.940656458412465e-324
diff --git a/test/mpfrnr.awk b/test/mpfrnr.awk
new file mode 100644
index 00000000..1a3b753a
--- /dev/null
+++ b/test/mpfrnr.awk
@@ -0,0 +1,10 @@
+# Test NR and FNR for file(s) with records > LONG_MAX
+BEGIN {
+ NR = 0x7FFFFFFF
+}
+BEGINFILE {
+ FNR = 0x7fffffffffffffff
+}
+END {
+ print NR, NR-0x7FFFFFFF, FNR, FNR-0x7fffffffffffffff
+}
diff --git a/test/mpfrnr.in b/test/mpfrnr.in
new file mode 100644
index 00000000..6ad36e52
--- /dev/null
+++ b/test/mpfrnr.in
@@ -0,0 +1,3 @@
+Line 1
+Line 2
+Line 3
diff --git a/test/mpfrnr.ok b/test/mpfrnr.ok
new file mode 100644
index 00000000..e472f8bf
--- /dev/null
+++ b/test/mpfrnr.ok
@@ -0,0 +1 @@
+2147483650 3 9223372036854775810 3
diff --git a/test/mpfrrnd.awk b/test/mpfrrnd.awk
new file mode 100644
index 00000000..508ac26b
--- /dev/null
+++ b/test/mpfrrnd.awk
@@ -0,0 +1,15 @@
+BEGIN {
+ N = 22/7
+ printf(" %.15f\n", N)
+
+ printf("* %.10f\n", N) # default
+ ROUNDMODE="N"; printf("N %.10f\n", N)
+ ROUNDMODE="U"; printf("U %.10f\n", N)
+ ROUNDMODE="D"; printf("D %.10f\n", N)
+ ROUNDMODE="Z"; printf("Z %.10f\n", N)
+ N = -N
+ ROUNDMODE="N"; printf("N %.10f\n", N)
+ ROUNDMODE="U"; printf("U %.10f\n", N)
+ ROUNDMODE="D"; printf("D %.10f\n", N)
+ ROUNDMODE="Z"; printf("Z %.10f\n", N)
+}
diff --git a/test/mpfrrnd.ok b/test/mpfrrnd.ok
new file mode 100644
index 00000000..fceb937b
--- /dev/null
+++ b/test/mpfrrnd.ok
@@ -0,0 +1,10 @@
+ 3.142857142857143
+* 3.1428571429
+N 3.1428571429
+U 3.1428571429
+D 3.1428571428
+Z 3.1428571428
+N -3.1428571429
+U -3.1428571428
+D -3.1428571429
+Z -3.1428571428
diff --git a/test/mpfrsort.awk b/test/mpfrsort.awk
new file mode 100644
index 00000000..6f7fa65c
--- /dev/null
+++ b/test/mpfrsort.awk
@@ -0,0 +1,8 @@
+BEGIN {
+# s = "1.0 +nan 0.0 -1 +inf -0.0 1 nan 1.0 -nan -inf 2.0"
+ s = "1.0 +nan 0.0 -1 +inf -0.0 1 1.0 -nan -inf 2.0"
+ split(s, a)
+ PROCINFO["sorted_in"] = "@val_num_asc"
+ for (i in a)
+ print a[i]
+}
diff --git a/test/mpfrsort.ok b/test/mpfrsort.ok
new file mode 100644
index 00000000..77a51ecf
--- /dev/null
+++ b/test/mpfrsort.ok
@@ -0,0 +1,11 @@
+-inf
+-1
+-0.0
+0.0
+1
+1.0
+1.0
+2.0
++inf
++nan
+-nan
diff --git a/test/ordchr.awk b/test/ordchr.awk
new file mode 100644
index 00000000..0295105e
--- /dev/null
+++ b/test/ordchr.awk
@@ -0,0 +1,10 @@
+@load "ordchr"
+
+BEGIN {
+ print chr(ord("A"))
+ print chr(ord("0"))
+ print ord(chr(65))
+ # test if type conversion between strings and numbers is working properly
+ print chr(ord(0))
+ print ord(chr("65"))
+}
diff --git a/test/ordchr.ok b/test/ordchr.ok
new file mode 100644
index 00000000..86d901e9
--- /dev/null
+++ b/test/ordchr.ok
@@ -0,0 +1,5 @@
+A
+0
+65
+0
+65
diff --git a/test/ordchr2.ok b/test/ordchr2.ok
new file mode 100644
index 00000000..b6802534
--- /dev/null
+++ b/test/ordchr2.ok
@@ -0,0 +1 @@
+z
diff --git a/test/rand-mpfr.ok b/test/rand-mpfr.ok
new file mode 100644
index 00000000..76ab51b4
--- /dev/null
+++ b/test/rand-mpfr.ok
@@ -0,0 +1 @@
+ 27 89 11 47 77 49 13 34 78 93 76 96 91 53 3 94 25 51 10
diff --git a/test/rand-mpfr1.ok b/test/rand-mpfr1.ok
new file mode 100644
index 00000000..448f4032
--- /dev/null
+++ b/test/rand-mpfr1.ok
@@ -0,0 +1 @@
+ 25 42 47 49 80 5 4 92 59 96 8 63 92 28 41 37 80 51 48
diff --git a/test/readdir.awk b/test/readdir.awk
new file mode 100644
index 00000000..2e3df453
--- /dev/null
+++ b/test/readdir.awk
@@ -0,0 +1,7 @@
+@load "readdir"
+
+BEGIN {
+ readdir_do_ftype("stat")
+}
+
+{ print }
diff --git a/test/readdir0.awk b/test/readdir0.awk
new file mode 100644
index 00000000..54306f10
--- /dev/null
+++ b/test/readdir0.awk
@@ -0,0 +1,9 @@
+{
+ ino = $1
+ name = $NF
+ type = substr($2, 1, 1)
+ if (type == "-")
+ type = "f"
+
+ printf "%s/%s/%s\n", ino, name, type
+}
diff --git a/test/revout.awk b/test/revout.awk
new file mode 100644
index 00000000..25f62fc7
--- /dev/null
+++ b/test/revout.awk
@@ -0,0 +1,6 @@
+@load "revoutput"
+
+BEGIN {
+ REVOUT = 1
+ print "hello, world" > "/dev/stdout"
+}
diff --git a/test/revout.ok b/test/revout.ok
new file mode 100644
index 00000000..8101cb93
--- /dev/null
+++ b/test/revout.ok
@@ -0,0 +1 @@
+dlrow ,olleh
diff --git a/test/revtwoway.awk b/test/revtwoway.awk
new file mode 100644
index 00000000..05bded5a
--- /dev/null
+++ b/test/revtwoway.awk
@@ -0,0 +1,11 @@
+@load "revtwoway"
+
+BEGIN {
+ cmd = "/magic/mirror"
+
+ print "hello, world" |& cmd
+ cmd |& getline line
+
+ printf("got back: <%s>, RT = <%s>\n", line, RT)
+ close(cmd)
+}
diff --git a/test/revtwoway.ok b/test/revtwoway.ok
new file mode 100644
index 00000000..b8a5ff31
--- /dev/null
+++ b/test/revtwoway.ok
@@ -0,0 +1,2 @@
+got back: <dlrow ,olleh>, RT = <
+>
diff --git a/test/rwarray.awk b/test/rwarray.awk
new file mode 100644
index 00000000..5d1b7e9d
--- /dev/null
+++ b/test/rwarray.awk
@@ -0,0 +1,33 @@
+@load "rwarray"
+
+BEGIN {
+ while ((getline word) > 0)
+ dict[word] = word word
+
+ n = asorti(dict, dictindices)
+ for (i = 1; i <= n; i++)
+ printf("dict[%s] = %s\n", dictindices[i], dict[dictindices[i]]) > "orig.out"
+ close("orig.out");
+
+ ret = writea("orig.bin", dict)
+ printf "writea() returned %d, expecting 1\n", ret
+
+
+ ret = reada("orig.bin", dict)
+ printf "reada() returned %d, expecting 1\n", ret
+
+ n = asorti(dict, dictindices)
+ for (i = 1; i <= n; i++)
+ printf("dict[%s] = %s\n", dictindices[i], dict[dictindices[i]]) > "new.out"
+ close("new.out");
+
+ ret = system("cmp orig.out new.out")
+
+ if (ret == 0)
+ print "old and new are equal - GOOD"
+ else
+ print "old and new are not equal - BAD"
+
+ if (ret == 0 && !("KEEPIT" in ENVIRON))
+ system("rm -f orig.bin orig.out new.out")
+}
diff --git a/test/rwarray.in b/test/rwarray.in
new file mode 100644
index 00000000..aff88306
--- /dev/null
+++ b/test/rwarray.in
@@ -0,0 +1,780 @@
+a
+aardvark
+aardvark's
+aardvarks
+abaci
+aback
+abacus
+abacus's
+abacuses
+abaft
+abalone
+abalone's
+abalones
+abandon
+abandoned
+abandoning
+abandonment
+abandonment's
+abandons
+abase
+abased
+abasement
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+b
+baa
+baaed
+baaing
+baas
+babble
+babbled
+babbler
+babbler's
+babblers
+babbles
+babbling
+babe
+babe's
+babel
+babels
+babes
+babied
+babier
+babies
+babiest
+baboon
+baboon's
+baboons
+babushka
+babushka's
+babushkas
+baby
+baby's
+babyhood
+c
+cab
+cab's
+cabal
+cabal's
+cabals
+cabana
+cabana's
+cabanas
+cabaret
+cabaret's
+cabarets
+cabbage
+cabbage's
+cabbages
+cabbed
+cabbie
+cabbies
+cabbing
+cabby
+cabby's
+cabin
+cabin's
+cabinet
+cabinet's
+cabinetmaker
+cabinetmaker's
+cabinetmakers
+cabinets
+cabins
+d
+d'arezzo
+d'estaing
+dab
+dabbed
+dabbing
+dabble
+dabbled
+dabbler
+dabbler's
+dabblers
+dabbles
+dabbling
+dabs
+dacha
+dacha's
+dachas
+dachshund
+dachshund's
+dachshunds
+dactyl
+dactyl's
+dactylic
+dactylics
+dactyls
+dad
+dad's
+daddies
+db
+db's
+e
+e'er
+each
+eager
+eager's
+eagerer
+eagerest
+eagerly
+eagerness
+eagerness's
+eagle
+eagle's
+eagles
+eaglet
+eaglet's
+eaglets
+ear
+ear's
+earache
+earache's
+earaches
+eardrum
+eardrum's
+eardrums
+earful
+earful's
+earfuls
+earl
+ebay
+ebay's
+f
+fa
+fa's
+fable
+fable's
+fabled
+fables
+fabric
+fabric's
+fabricate
+fabricated
+fabricates
+fabricating
+fabrication
+fabrication's
+fabrications
+fabrics
+fabulous
+fabulously
+facade
+facade's
+facades
+face
+face's
+faced
+faceless
+facelift
+facelifts
+faces
+facet
+g
+gab
+gabardine
+gabardine's
+gabardines
+gabbed
+gabbier
+gabbiest
+gabbing
+gabble
+gabbled
+gabbles
+gabbling
+gabby
+gaberdine
+gaberdine's
+gaberdines
+gable
+gable's
+gabled
+gables
+gabling
+gabs
+gad
+gadabout
+gadabout's
+gadabouts
+gadded
+gadding
+gadflies
+h
+h'm
+ha
+haberdasher
+haberdasher's
+haberdasheries
+haberdashers
+haberdashery
+haberdashery's
+habit
+habit's
+habitability
+habitability's
+habitable
+habitat
+habitat's
+habitation
+habitation's
+habitations
+habitats
+habits
+habitual
+habitually
+habituals
+habituate
+habituated
+habituates
+habituating
+habituation
+habituation's
+i
+iamb
+iamb's
+iambic
+iambics
+iambs
+ibex
+ibex's
+ibexes
+ibices
+ibis
+ibis's
+ibises
+ibuprofen
+ice
+ice's
+iceberg
+iceberg's
+icebergs
+icebound
+icebox
+icebox's
+iceboxes
+icebreaker
+icebreaker's
+icebreakers
+icecap
+icecap's
+icecaps
+iced
+j
+jab
+jabbed
+jabber
+jabbered
+jabberer
+jabberer's
+jabberers
+jabbering
+jabbers
+jabbing
+jabot
+jabot's
+jabots
+jabs
+jack
+jack's
+jackal
+jackal's
+jackals
+jackass
+jackass's
+jackasses
+jackboot
+jackboot's
+jackboots
+jackdaw
+jackdaw's
+jackdaws
+jacked
+k
+kabob
+kabob's
+kabobs
+kaboom
+kale
+kale's
+kaleidoscope
+kaleidoscope's
+kaleidoscopes
+kaleidoscopic
+kamikaze
+kamikaze's
+kamikazes
+kangaroo
+kangaroo's
+kangarooed
+kangarooing
+kangaroos
+kaolin
+kaolin's
+kapok
+kapok's
+kaput
+kaput's
+karakul
+karakul's
+khz
+khz's
+kw
+l
+la
+la's
+lab
+lab's
+label
+label's
+labeled
+labeling
+labelled
+labelling
+labels
+labia
+labia's
+labial
+labials
+labium
+labor
+labor's
+laboratories
+laboratory
+laboratory's
+labored
+laborer
+laborer's
+laborers
+laboring
+laborious
+laboriously
+labors
+m
+ma
+ma'am
+ma's
+macabre
+macadam
+macadam's
+macaroni
+macaroni's
+macaroon
+macaroon's
+macaroons
+macaw
+macaw's
+macaws
+mace
+mace's
+maced
+macerate
+macerated
+macerates
+macerating
+maceration
+maceration's
+maces
+machete
+machete's
+machetes
+machination
+machination's
+n
+nab
+nabbed
+nabbing
+nabob
+nabob's
+nabobs
+nabs
+nacho
+nachos
+nacre
+nacre's
+nadir
+nadir's
+nadirs
+nag
+nagged
+nagging
+nags
+naiad
+naiad's
+naiades
+naiads
+nail
+nail's
+nailbrush
+nailbrush's
+nailbrushes
+nailed
+nailing
+o
+o'clock
+o'er
+oaf
+oaf's
+oafish
+oafs
+oak
+oak's
+oaken
+oaks
+oakum
+oakum's
+oar
+oar's
+oared
+oaring
+oarlock
+oarlock's
+oarlocks
+oars
+oarsman
+oarsman's
+oarsmen
+oases
+oasis
+oasis's
+oat
+oat's
+oaten
+p
+pa
+pa's
+pace
+pace's
+paced
+pacemaker
+pacemaker's
+pacemakers
+paces
+pacesetter
+pacesetter's
+pacesetters
+pachyderm
+pachyderm's
+pachyderms
+pacific
+pacifically
+pacification
+pacification's
+pacified
+pacifier
+pacifier's
+pacifiers
+pacifies
+pacifism
+pacifism's
+pacifist
+ph
+ph's
+q
+qua
+quack
+quacked
+quackery
+quackery's
+quacking
+quacks
+quad
+quad's
+quadrangle
+quadrangle's
+quadrangles
+quadrangular
+quadrangular's
+quadrant
+quadrant's
+quadrants
+quadraphonic
+quadraphonics
+quadratic
+quadratic's
+quadrature
+quadrature's
+quadrennial
+quadriceps
+quadriceps's
+quadricepses
+quadrilateral
+quadrilaterals
+r
+rabbi
+rabbi's
+rabbies
+rabbinate
+rabbinate's
+rabbinical
+rabbis
+rabbit
+rabbit's
+rabbited
+rabbiting
+rabbits
+rabble
+rabble's
+rabbles
+rabid
+rabies
+raccoon
+raccoon's
+raccoons
+race
+race's
+racecourse
+racecourse's
+racecourses
+raced
+racehorse
+racehorse's
+racehorses
+s
+sabbatical
+sabbaticals
+saber
+saber's
+sabers
+sable
+sable's
+sabled
+sables
+sabling
+sabotage
+sabotage's
+sabotaged
+sabotages
+sabotaging
+saboteur
+saboteur's
+saboteurs
+sabre
+sabres
+sac
+sac's
+saccharin
+saccharin's
+saccharine
+sacerdotal
+sachem
+sachem's
+sachems
+t
+tab
+tab's
+tabbed
+tabbies
+tabbing
+tabby
+tabernacle
+tabernacle's
+tabernacles
+table
+table's
+tableau
+tableau's
+tableaus
+tableaux
+tablecloth
+tablecloth's
+tablecloths
+tabled
+tableland
+tableland's
+tablelands
+tables
+tablespoon
+tablespoon's
+tablespoonful
+tablespoonful's
+tablespoonfuls
+tablespoons
+u
+ubiquitous
+ubiquitously
+ubiquity
+udder
+udder's
+udders
+ugh
+uglied
+uglier
+uglies
+ugliest
+ugliness
+ugliness's
+ugly
+uglying
+uh
+ukulele
+ukulele's
+ukuleles
+ulcer
+ulcer's
+ulcerate
+ulcerated
+ulcerates
+ulcerating
+ulceration
+ulceration's
+ulcered
+ulcering
+v
+vacancies
+vacancy
+vacancy's
+vacant
+vacantly
+vacate
+vacated
+vacates
+vacating
+vacation
+vacation's
+vacationed
+vacationer
+vacationers
+vacationing
+vacations
+vaccinate
+vaccinated
+vaccinates
+vaccinating
+vaccination
+vaccination's
+vaccinations
+vaccine
+vaccine's
+vaccines
+vacillate
+vacillated
+vacillates
+w
+wackes
+wackier
+wackiest
+wackiness
+wackiness's
+wacko
+wackos
+wacky
+wad
+wad's
+wadded
+wadding
+wadding's
+waddle
+waddled
+waddles
+waddling
+wade
+waded
+wader
+wader's
+waders
+wades
+wadi
+wadi's
+wadies
+wading
+wadis
+wads
+x
+xenon
+xenon's
+xenophobia
+xenophobia's
+xenophobic
+xenophon's
+xerographic
+xerography
+xerography's
+xerox
+xerox's
+xeroxed
+xeroxes
+xeroxing
+xerxes
+xerxes's
+xhosa
+xhosa's
+xi'an
+xiaoping
+xiaoping's
+xingu
+xylem
+xylem's
+xylophone
+xylophone's
+xylophones
+xylophonist
+xylophonists
+y
+y'all
+ya
+yacht
+yacht's
+yachted
+yachting
+yachting's
+yachts
+yachtsman
+yachtsmen
+yahoo
+yahoo's
+yahoos
+yak
+yak's
+yakked
+yakking
+yaks
+yam
+yam's
+yammer
+yammered
+yammering
+yammers
+yams
+yank
+yanked
+yanking
+yanks
+z
+zanied
+zanier
+zanies
+zaniest
+zaniness
+zaniness's
+zany
+zanying
+zap
+zapped
+zapping
+zaps
+zeal
+zeal's
+zealot
+zealot's
+zealots
+zealous
+zealously
+zealousness
+zealousness's
+zebra
+zebra's
+zebras
+zebu
+zebu's
+zebus
+zed
+zed's
diff --git a/test/rwarray.ok b/test/rwarray.ok
new file mode 100644
index 00000000..8392135e
--- /dev/null
+++ b/test/rwarray.ok
@@ -0,0 +1,3 @@
+writea() returned 1, expecting 1
+reada() returned 1, expecting 1
+old and new are equal - GOOD
diff --git a/test/symtab1.awk b/test/symtab1.awk
new file mode 100644
index 00000000..eeb01437
--- /dev/null
+++ b/test/symtab1.awk
@@ -0,0 +1,21 @@
+function dumparray(name, array, i)
+{
+ if (name == "ENVIRON" || name == "PROCINFO")
+ return
+
+ for (i in array)
+ if (isarray(array[i]))
+ dumparray(name "[" i "]", array[i])
+ else
+ printf("%s[%s] = %s\n", name, i, array[i])
+}
+
+BEGIN {
+ a[1] = 1
+ a[2][1] = 21
+ for (i in SYMTAB)
+ if (isarray(SYMTAB[i]))
+ dumparray(i, SYMTAB[i])
+ else
+ printf("SYMTAB[\"%s\"] = \"%s\"\n", i, SYMTAB[i])
+}
diff --git a/test/symtab1.ok b/test/symtab1.ok
new file mode 100644
index 00000000..3e435dd2
--- /dev/null
+++ b/test/symtab1.ok
@@ -0,0 +1,31 @@
+ARGV[0] = gawk
+SYMTAB["i"] = "i"
+SYMTAB["ROUNDMODE"] = "N"
+SYMTAB["ORS"] = "
+"
+SYMTAB["OFS"] = " "
+SYMTAB["LINT"] = "0"
+SYMTAB["FNR"] = "0"
+SYMTAB["ERRNO"] = ""
+SYMTAB["NR"] = "0"
+SYMTAB["IGNORECASE"] = "0"
+SYMTAB["TEXTDOMAIN"] = "messages"
+SYMTAB["NF"] = "-1"
+SYMTAB["ARGIND"] = "0"
+a[1] = 1
+a[2][1] = 21
+SYMTAB["ARGC"] = "1"
+SYMTAB["FIELDWIDTHS"] = ""
+SYMTAB["CONVFMT"] = "%.6g"
+SYMTAB["SUBSEP"] = ""
+SYMTAB["PREC"] = "53"
+SYMTAB["RS"] = "
+"
+SYMTAB["FPAT"] = "[^[:space:]]+"
+SYMTAB["RT"] = ""
+SYMTAB["RLENGTH"] = "0"
+SYMTAB["OFMT"] = "%.6g"
+SYMTAB["FS"] = " "
+SYMTAB["RSTART"] = "0"
+SYMTAB["FILENAME"] = ""
+SYMTAB["BINMODE"] = "0"
diff --git a/test/symtab2.awk b/test/symtab2.awk
new file mode 100644
index 00000000..bb26f75d
--- /dev/null
+++ b/test/symtab2.awk
@@ -0,0 +1,6 @@
+BEGIN {
+ a = 5
+ printf "a = %d, SYMTAB[\"a\"] = %d\n", a, SYMTAB["a"]
+ SYMTAB["a"] = 4
+ printf "a = %d, SYMTAB[\"a\"] = %d\n", a, SYMTAB["a"]
+}
diff --git a/test/symtab2.ok b/test/symtab2.ok
new file mode 100644
index 00000000..23d2bf69
--- /dev/null
+++ b/test/symtab2.ok
@@ -0,0 +1,2 @@
+a = 5, SYMTAB["a"] = 5
+a = 4, SYMTAB["a"] = 4
diff --git a/test/symtab3.awk b/test/symtab3.awk
new file mode 100644
index 00000000..4c2026dc
--- /dev/null
+++ b/test/symtab3.awk
@@ -0,0 +1 @@
+BEGIN { a = 5 ; delete SYMTAB["a"] }
diff --git a/test/symtab3.ok b/test/symtab3.ok
new file mode 100644
index 00000000..5b283583
--- /dev/null
+++ b/test/symtab3.ok
@@ -0,0 +1,2 @@
+gawk: symtab3.awk:1: fatal: `delete' is not allowed with SYMTAB
+EXIT CODE: 2
diff --git a/test/symtab4.awk b/test/symtab4.awk
new file mode 100644
index 00000000..4eed7e99
--- /dev/null
+++ b/test/symtab4.awk
@@ -0,0 +1 @@
+{SYMTAB["POS"]=1 ; print $POS }
diff --git a/test/symtab4.in b/test/symtab4.in
new file mode 100644
index 00000000..d35e1920
--- /dev/null
+++ b/test/symtab4.in
@@ -0,0 +1,2 @@
+1 a
+2 b
diff --git a/test/symtab4.ok b/test/symtab4.ok
new file mode 100644
index 00000000..1191247b
--- /dev/null
+++ b/test/symtab4.ok
@@ -0,0 +1,2 @@
+1
+2
diff --git a/test/symtab5.awk b/test/symtab5.awk
new file mode 100644
index 00000000..e4fbc85f
--- /dev/null
+++ b/test/symtab5.awk
@@ -0,0 +1 @@
+BEGIN {SYMTAB["POS"]=1} {print $POS}
diff --git a/test/symtab5.in b/test/symtab5.in
new file mode 100644
index 00000000..d35e1920
--- /dev/null
+++ b/test/symtab5.in
@@ -0,0 +1,2 @@
+1 a
+2 b
diff --git a/test/symtab5.ok b/test/symtab5.ok
new file mode 100644
index 00000000..1191247b
--- /dev/null
+++ b/test/symtab5.ok
@@ -0,0 +1,2 @@
+1
+2
diff --git a/test/symtab6.awk b/test/symtab6.awk
new file mode 100644
index 00000000..d8f4cb1d
--- /dev/null
+++ b/test/symtab6.awk
@@ -0,0 +1 @@
+BEGIN {SYMTAB["POS"]=1}
diff --git a/test/symtab6.ok b/test/symtab6.ok
new file mode 100644
index 00000000..ac5484d5
--- /dev/null
+++ b/test/symtab6.ok
@@ -0,0 +1,27 @@
+ARGC: 1
+ARGIND: 0
+ARGV: array, 1 elements
+BINMODE: 0
+CONVFMT: "%.6g"
+ERRNO: ""
+FIELDWIDTHS: ""
+FILENAME: ""
+FNR: 0
+FPAT: "[^[:space:]]+"
+FS: " "
+IGNORECASE: 0
+LINT: 0
+NF: 0
+NR: 0
+OFMT: "%.6g"
+OFS: " "
+ORS: "\n"
+PREC: 53
+PROCINFO: array, 23 elements
+RLENGTH: 0
+ROUNDMODE: "N"
+RS: "\n"
+RSTART: 0
+RT: ""
+SUBSEP: "\034"
+TEXTDOMAIN: "messages"
diff --git a/test/testext.ok b/test/testext.ok
new file mode 100644
index 00000000..f6066352
--- /dev/null
+++ b/test/testext.ok
@@ -0,0 +1,75 @@
+pets has 5 elements
+dump_array_and_delete: sym_lookup of pets passed
+dump_array_and_delete: incoming size is 5
+ pets["1"] = "blacky"
+ pets["2"] = "rusty"
+ pets["3"] = "sophie"
+dump_array_and_delete: marking element "3" for deletion
+ pets["4"] = "raincloud"
+ pets["5"] = "lucky"
+dump_array_and_delete(pets) returned 1
+dump_array_and_delete() did remove index "3"!
+
+try_modify_environ: sym_lookup of ENVIRON passed
+try_modify_environ: set_array_element of ENVIRON failed
+try_modify_environ: marking element "testext" for deletion
+try_del_environ() could not delete element - pass
+try_del_environ() could not add an element - pass
+var_test: sym_lookup of ARGC passed - got a value!
+var_test: sym_update of ARGC failed - correctly
+var_test: sym_update("testvar") succeeded
+var_test() returned 1, test_var = 42
+
+test_errno() returned 1, ERRNO = No child processes
+
+length of test_array is 10, should be 10
+test_array_size: incoming size is 10
+test_array_size() returned 1, length is now 0
+
+test_array_elem: a["3"] = "three"
+test_array_elem() returned 1, test_array2[3] = 42
+test_array_elem() did remove element "5"
+test_array_elem() added element "7" --> seven
+test_array2["subarray"]["hello"] = world
+test_array2["subarray"]["answer"] = 42
+
+test_array_param() returned 1
+isarray(a_new_array) = 1
+a_new_array["hello"] = world
+a_new_array["answer"] = 42
+test_array_param: argument is not undefined (1)
+test_array_param() returned 0
+isarray(a_scalar) = 0
+
+Initial value of LINT is 0
+print_do_lint: lint = 0
+print_do_lint() returned 1
+Changed value of LINT is 1
+print_do_lint: lint = 1
+print_do_lint() returned 1
+
+test_scalar(1) returned 1, the_scalar is 1
+test_scalar(3) returned 1, the_scalar is 3
+test_scalar(5) returned 1, the_scalar is 5
+test_scalar(7) returned 1, the_scalar is 7
+test_scalar(9) returned 1, the_scalar is 9
+test_scalar(11) returned 1, the_scalar is 11
+test_scalar(the) returned 1, the_scalar is the
+test_scalar(quick) returned 1, the_scalar is quick
+test_scalar(brown) returned 1, the_scalar is brown
+test_scalar(fox) returned 1, the_scalar is fox
+test_scalar(jumps) returned 1, the_scalar is jumps
+test_scalar(over) returned 1, the_scalar is over
+test_scalar(the) returned 1, the_scalar is the
+test_scalar(lazy) returned 1, the_scalar is lazy
+test_scalar(dog) returned 1, the_scalar is dog
+test_scalar_reserved: sym_lookup of ARGC passed - got a value!
+test_scalar_reserved: could not update new_value2 for ARGC - pass
+answer_num = 42
+message_string = hello, world
+new_array["hello"] = "world"
+new_array["answer"] = "42"
+
+at_exit2 called (should be first): data = NULL, exit_status = 0
+at_exit1 called (should be second): (data is & data_for_1), data value = 0xdeadbeef, exit_status = 0
+at_exit0 called (should be third): data = NULL, exit_status = 0
diff --git a/test/time.awk b/test/time.awk
new file mode 100644
index 00000000..517377e2
--- /dev/null
+++ b/test/time.awk
@@ -0,0 +1,22 @@
+@load "time"
+
+# make sure gettimeofday() is consistent with systime(). We must call
+# gettimeofday() before systime() to make sure the subtraction gives 0
+# without risk of rolling over to the next second.
+function timecheck(st,res) {
+ res = gettimeofday()
+ st = systime()
+ printf "gettimeofday - systime = %d\n", res-st
+ return res
+}
+
+BEGIN {
+ delta = 1.3
+ t0 = timecheck()
+ printf "sleep(%s) = %s\n",delta,sleep(delta)
+ t1 = timecheck()
+ slept = t1-t0
+ if ((slept < 0.9*delta) || (slept > 1.3*delta))
+ printf "Warning: tried to sleep %.2f secs, but slept for %.2f secs\n",
+ delta,slept
+}
diff --git a/test/time.ok b/test/time.ok
new file mode 100644
index 00000000..46606bfe
--- /dev/null
+++ b/test/time.ok
@@ -0,0 +1,3 @@
+gettimeofday - systime = 0
+sleep(1.3) = 0
+gettimeofday - systime = 0
diff --git a/version.c b/version.c
index c1ecb4f1..4c1b6402 100644
--- a/version.c
+++ b/version.c
@@ -1,3 +1,3 @@
#include "config.h"
-const char *version_string = "GNU Awk 4.0.1a";
+const char *version_string = "GNU Awk 4.0.70";
diff --git a/vms/ChangeLog b/vms/ChangeLog
index fa1fbd16..725a223b 100644
--- a/vms/ChangeLog
+++ b/vms/ChangeLog
@@ -1,7 +1,25 @@
+2012-08-08 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkmisc.pc (os_isreadable): Take IOBUF_PUBLIC instead of fd and
+ use passed in info.
+
+2012-07-29 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkmisc.vms (os_isreadable): Add isdir pointer parameter to be
+ set to true if fd is for a directory.
+
+2012-07-26 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkmisc.vms (os_isreadable): New function.
+
2012-03-29 Arnold D. Robbins <arnold@skeeve.com>
* config.h: Add definition for _Noreturn.
+2012-03-20 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawkmisc.vms (deflibpath): New global variable.
+
2012-03-28 Arnold D. Robbins <arnold@skeeve.com>
* 4.0.1: Release tar ball made.
diff --git a/vms/gawkmisc.vms b/vms/gawkmisc.vms
index 346a1e88..0ca3e0bf 100644
--- a/vms/gawkmisc.vms
+++ b/vms/gawkmisc.vms
@@ -25,6 +25,7 @@
char quote = '\'';
char *defpath = DEFPATH;
+char *deflibpath = DEFLIBPATH;
char envsep = ',';
/* gawk_name --- pull out the "gawk" part from how the OS called us */
@@ -143,6 +144,31 @@ int fd;
return (fstat(fd, &sbuf) == 0 && S_ISDIR(sbuf.st_mode));
}
+/* os_isreadable --- fd can be read from */
+
+int
+os_isreadable(const IOBUF_PUBLIC *iobuf, bool *isdir)
+{
+ *isdir = false;
+
+ switch (iobuf->sbuf.st_mode & S_IFMT) {
+ case S_IFREG:
+ case S_IFCHR: /* ttys, /dev/null, .. */
+#ifdef S_IFSOCK
+ case S_IFSOCK:
+#endif
+#ifdef S_IFIFO
+ case S_IFIFO:
+#endif
+ return true;
+ case S_IFDIR:
+ *isdir = true;
+ /* fall through */
+ default:
+ return false;
+ }
+}
+
/* os_is_setuid --- true if running setuid root */
int