aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog228
-rwxr-xr-xtest/Gentests2
-rw-r--r--test/Makefile.am138
-rw-r--r--test/Makefile.in231
-rw-r--r--test/Maketests65
-rw-r--r--test/badbuild.awk6
-rw-r--r--test/badbuild.in1
-rw-r--r--test/badbuild.ok3
-rw-r--r--test/callparam.awk6
-rw-r--r--test/callparam.ok2
-rw-r--r--[-rwxr-xr-x]test/charasbytes.awk0
-rw-r--r--test/crlf.awk11
-rw-r--r--test/crlf.ok3
-rw-r--r--test/errno.awk10
-rw-r--r--test/errno.in3
-rw-r--r--test/errno.ok3
-rwxr-xr-xtest/exit.sh2
-rw-r--r--test/exitval3.awk2
-rw-r--r--test/exitval3.ok1
-rw-r--r--test/fpat4.awk105
-rw-r--r--test/fpat4.ok65
-rw-r--r--test/gensub2.ok1
-rw-r--r--test/getfile.awk35
-rw-r--r--test/getfile.ok17
-rw-r--r--test/id.ok4
-rw-r--r--test/indirectbuiltin.awk371
-rw-r--r--test/indirectbuiltin.ok43
-rw-r--r--test/inplace1.ok2
-rw-r--r--test/inplace2.ok2
-rw-r--r--test/inplace3.ok4
-rw-r--r--test/mbprintf4.awk51
-rw-r--r--test/mbprintf4.ok144
-rw-r--r--test/mpfrmemok1.awk7
-rw-r--r--test/mpfrmemok1.ok7
-rw-r--r--test/mpfrsqrt.awk6
-rw-r--r--test/nonfatal1.awk6
-rw-r--r--test/nonfatal1.ok2
-rw-r--r--test/nonfatal2.awk5
-rw-r--r--test/nonfatal2.ok1
-rw-r--r--test/nonfatal3.awk6
-rw-r--r--test/nonfatal3.ok1
-rw-r--r--[-rwxr-xr-x]test/ofs1.awk0
-rw-r--r--test/paramasfunc1.awk9
-rw-r--r--test/paramasfunc1.ok3
-rw-r--r--test/paramasfunc2.awk10
-rw-r--r--test/paramasfunc2.ok3
-rw-r--r--test/printfbad4.awk5
-rw-r--r--test/printfbad4.ok2
-rw-r--r--test/profile0.awk1
-rw-r--r--test/profile0.in2
-rw-r--r--test/profile0.ok6
-rw-r--r--test/profile5.ok707
-rw-r--r--test/profile6.awk7
-rw-r--r--test/profile6.ok10
-rw-r--r--test/profile7.awk12
-rw-r--r--test/profile7.ok15
-rw-r--r--test/profile8.awk9
-rw-r--r--test/profile8.ok14
-rw-r--r--[-rwxr-xr-x]test/range1.awk0
-rw-r--r--test/regexpbrack.awk2
-rw-r--r--test/regexpbrack.in0
-rw-r--r--test/regexpbrack.ok0
-rw-r--r--test/sortglos.awk51
-rw-r--r--test/sortglos.in22
-rw-r--r--test/sortglos.ok15
-rw-r--r--test/testext.ok14
-rw-r--r--test/timeout.awk26
-rw-r--r--test/timeout.ok12
68 files changed, 2070 insertions, 489 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index aa0ddcbe..f9e49945 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,231 @@
+2015-04-02 Arnold D. Robbins <arnold@skeeve.com>
+
+ * id.ok, mpfrsqrt.awk: Update after rename of div() --> intdiv().
+
+2015-03-31 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (indirectbuiltin): New test.
+ * indirectbuiltin.awk, indirectbuiltin.ok: New files.
+
+2015-03-27 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am: Remove defvar test and reference to files; test
+ code moved into extension/testext.c.
+ * defvar.awk, defvar.ok: Removed.
+ * testext.ok: Updated.
+
+2015-03-24 Arnold D. Robbins <arnold@skeeve.com>
+
+ * id.ok: Update after fixes in code.
+
+2015-03-24 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (EXTRA_DIST): Add exitval3.awk and exitval3.ok.
+ (BASIC_TESTS): Add new test exitval3.
+ * exitval3.awk, exitval3.ok: New files.
+
+2015-03-17 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * inplace1.ok, inplace2.ok, inplace3.ok: Update error message line
+ numbers to reflect changes to inplace.awk.
+
+2015-03-17 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (mpfrmemok1): New test.
+ * mpfrmemok1.awk, mpfrmemok1.ok: New files.
+
+2015-03-10 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (fpat4): New test.
+ * fpat4.awk, fpat4.ok: New files.
+
+2015-03-08 Arnold D. Robbins <arnold@skeeve.com>
+
+ * nonfatal3.awk, nonfatal3.ok: Adjust for portability.
+ Thanks to Hermann Peifer for the report.
+
+2015-03-06 Arnold D. Robbins <arnold@skeeve.com>
+
+ * charasbytes.awk, ofs1.awk, range1.awk, sortglos.awk,
+ sortglos.in: Remove execute permission.
+
+2015-03-02 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * nonfatal1.awk: Do not print ERRNO, since the value appears to be
+ platform-dependent. Instead, print (ERRNO != "").
+ * nonfatal1.ok: Update.
+
+2015-02-28 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (EXTRA_DIST): Add nonfatal3.{awk,ok}.
+ (GAWK_EXT_TESTS): Add nonfatal3.
+ * nonfatal1.awk: Replace "ti10/357" with "local:host/25", since
+ "local:host" should be a universally bad hostname due to the
+ invalid ":" character.
+ * nonfatal1.ok: Update.
+ * nonfatal3.{awk,ok}: New test for connecting to a TCP port where
+ nobody is listening.
+
+2015-02-27 Arnold D. Robbins <arnold@skeeve.com>
+
+ * nonfatal1.ok: Update after code changes.
+
+2015-02-26 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (EXTRA_DIST): Add profile0.in which got forgotten
+ earlier. Ooops.
+
+2015-02-24 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (crlf): New test.
+ * crlf.awk, crlf.ok: New files.
+
+2015-02-10 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (profile0): New test.
+ * profile0.awk, profile0.in, profile0.ok: New files.
+
+2015-02-08 Arnold D. Robbins <arnold@skeeve.com>
+
+ * nonfatal1.awk, nonfatal2.awk: String is now "NONFATAL".
+
+2015-02-06 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (nonfatal1, nonfatal2): New tests.
+ * nonfatal1.awk, nonfatal1.ok: New files.
+ * nonfatal2.awk, nonfatal2.ok: New files.
+
+2015-02-01 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (paramasfunc1, paramasfunc2): Now need --posix.
+ * indirectcall.awk: Restore after code change.
+
+2015-01-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (callparam, paramasfunc1, paramasfunc2): New tests.
+ * callparam.awk, callparam.ok: New files.
+ * paramasfunc1.awk, paramasfunc1.ok: New files.
+ * paramasfunc2.awk, paramasfunc2.ok: New files.
+ * exit.sh, indirectcall.awk: Update after code change.
+
+2015-01-19 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (profile8): Actually add the test and the files.
+ Thanks to Hermann Peifer for the report.
+
+2015-01-16 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (profile8): New test.
+ * profile8.awk, profile8.ok: New files.
+
+2015-01-14 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (dumpvars): Grep out ENVIRON and PROCINFO since
+ those can be different depending on who runs the test.
+ * dumpvars.ok, id.ok: Updated after code changes.
+
+2015-01-07 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (regexpbrack): New test.
+ * regexpbrack.awk, regexpbrack.in, regexpbrack.ok: New files.
+
+ Unrelated:
+
+ * Makefile.am (printfbad4): New test.
+ * printfbad4.awk, printfbad4.ok: New files.
+
+ Unrelated:
+
+ * testext.ok: Adjust for code changes.
+
+2015-01-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (EXTRA_DIST): Add defvar.awk and defvar.ok.
+ (SHLIB_TESTS): Add defvar.
+ (defvar): New test.
+ * defvar.awk, defvar.ok: New files.
+
+2015-01-05 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (EXTRA_DIST): Add getfile.awk and getfile.ok.
+ (SHLIB_TESTS): Add getfile.
+ (getfile): New test.
+ * getfile.awk, getfile.ok: New files.
+
+2015-01-05 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (EXTRA_DIST): Add timeout.awk and timeout.ok.
+ (BASIC_TESTS): Remove errno.
+ (GAWK_EXT_TESTS): Add errno and timeout.
+ * timeout.awk, timeout.ok: New files.
+
+2015-01-05 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (EXTRA_DIST): Add errno.awk, errno.in, and errno.ok.
+ (BASIC_TESTS): Add errno.
+ (errno): New test.
+ * errno.awk, errno.in, errno.ok: New files.
+
+2014-12-24 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (badbuild): New test.
+ * badbuild.awk, badbuild.in, badbuild.ok: New files.
+
+2014-12-24 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (check): If tests don't pass, run 'make diffout'
+ and exit 1. Should help distros to notice when they have built
+ gawk incorrectly. (Can you say "Fedora", boys and girls?)
+
+2014-12-12 Arnold D. Robbins <arnold@skeeve.com>
+
+ * profile5.ok: Updated after code changes.
+
+2014-11-26 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Gentests: Fix gensub call after adding warning.
+
+2014-11-26 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gensub2.ok: Update after code changes.
+
+2014-11-16 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (sortglos): New test.
+ * sortglos.awk, sortglos.in, sortglos.ok: New files.
+ Thanks to Antonio Columbo.
+
+2014-11-09 Arnold D. Robbins <arnold@skeeve.com>
+
+ * mbprintf4.awk: Add record and line number for debugging.
+ * mpprint4.ok: Adjust.
+
+2014-11-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * testext.ok: Add results from new test_get_file test.
+
+2014-11-02 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (profile7): New test.
+ (profile6): Add missing @ in front of gawk run.
+ * profile7.awk, profile7.ok: New files.
+
+2014-11-01 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (profile6): Actually run profiling. Should make test
+ output consistent with what's in master.
+ * profile6.ok: Updated.
+
+2014-10-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (profile6): New test.
+ * profile6.awk, profile6.ok: New files.
+
+2014-10-17 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (profile1, testext): Use explicit ./foo.awk to avoid
+ assumptions about AWKPATH in the environment.
+
2014-10-12 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (charset-msg-start): Add a list of needed locales.
diff --git a/test/Gentests b/test/Gentests
index 460edbae..5a7aaa09 100755
--- a/test/Gentests
+++ b/test/Gentests
@@ -123,7 +123,7 @@ END {
printf "WARNING: --lint-old target `%s' is missing.\n", x > "/dev/stderr"
for (x in files)
if (!(x in unused) && \
- !(gensub(/\.(awk|in)$/,"","",x) in targets))
+ !(gensub(/\.(awk|in)$/,"",1,x) in targets))
printf "WARNING: unused file `%s'.\n", x > "/dev/stderr"
}
diff --git a/test/Makefile.am b/test/Makefile.am
index 81548186..b45eaf95 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,7 +1,7 @@
#
# test/Makefile.am --- automake input file for gawk
#
-# Copyright (C) 1988-2014 the Free Software Foundation, Inc.
+# Copyright (C) 1988-2015 the Free Software Foundation, Inc.
#
# This file is part of GAWK, the GNU implementation of the
# AWK Programming Language.
@@ -123,12 +123,17 @@ EXTRA_DIST = \
badargs.ok \
badassign1.awk \
badassign1.ok \
+ badbuild.awk \
+ badbuild.in \
+ badbuild.ok \
beginfile1.awk \
beginfile1.ok \
beginfile2.in \
beginfile2.ok \
beginfile2.sh \
binmode1.ok \
+ callparam.awk \
+ callparam.ok \
charasbytes.awk \
charasbytes.in \
charasbytes.ok \
@@ -164,6 +169,8 @@ EXTRA_DIST = \
concat4.ok \
convfmt.awk \
convfmt.ok \
+ crlf.awk \
+ crlf.ok \
datanonl.awk \
datanonl.in \
datanonl.ok \
@@ -205,6 +212,9 @@ EXTRA_DIST = \
dynlj.ok \
eofsplit.awk \
eofsplit.ok \
+ errno.awk \
+ errno.in \
+ errno.ok \
exit.ok \
exit.sh \
exit2.awk \
@@ -214,6 +224,8 @@ EXTRA_DIST = \
exitval2.awk \
exitval2.ok \
exitval2.w32 \
+ exitval3.awk \
+ exitval3.ok \
fcall_exit.awk \
fcall_exit.ok \
fcall_exit2.awk \
@@ -278,6 +290,8 @@ EXTRA_DIST = \
fpat3.awk \
fpat3.in \
fpat3.ok \
+ fpat4.awk \
+ fpat4.ok \
fpatnull.awk \
fpatnull.in \
fpatnull.ok \
@@ -331,6 +345,8 @@ EXTRA_DIST = \
gensub.ok \
gensub2.awk \
gensub2.ok \
+ getfile.awk \
+ getfile.ok \
getline.awk \
getline.in \
getline.ok \
@@ -420,6 +436,8 @@ EXTRA_DIST = \
include.awk \
include.ok \
include2.ok \
+ indirectbuiltin.awk \
+ indirectbuiltin.ok \
indirectcall.awk \
indirectcall.in \
indirectcall.ok \
@@ -528,6 +546,8 @@ EXTRA_DIST = \
mpfrexprange.ok \
mpfrieee.awk \
mpfrieee.ok \
+ mpfrmemok1.awk \
+ mpfrmemok1.ok \
mpfrnegzero.awk \
mpfrnegzero.ok \
mpfrnr.awk \
@@ -592,6 +612,12 @@ EXTRA_DIST = \
nondec.ok \
nondec2.awk \
nondec2.ok \
+ nonfatal1.awk \
+ nonfatal1.ok \
+ nonfatal2.awk \
+ nonfatal2.ok \
+ nonfatal3.awk \
+ nonfatal3.ok \
nonl.awk \
nonl.ok \
noparms.awk \
@@ -639,6 +665,10 @@ EXTRA_DIST = \
out1.ok \
out2.ok \
out3.ok \
+ paramasfunc1.awk \
+ paramasfunc1.ok \
+ paramasfunc2.awk \
+ paramasfunc2.ok \
paramdup.awk \
paramdup.ok \
paramres.awk \
@@ -689,6 +719,8 @@ EXTRA_DIST = \
printfbad2.ok \
printfbad3.awk \
printfbad3.ok \
+ printfbad4.awk \
+ printfbad4.ok \
printfloat.awk \
printhuge.awk \
printhuge.ok \
@@ -699,6 +731,9 @@ EXTRA_DIST = \
prmreuse.ok \
procinfs.awk \
procinfs.ok \
+ profile0.awk \
+ profile0.in \
+ profile0.ok \
profile2.ok \
profile3.awk \
profile3.ok \
@@ -706,6 +741,12 @@ EXTRA_DIST = \
profile4.ok \
profile5.awk \
profile5.ok \
+ profile6.awk \
+ profile6.ok \
+ profile7.awk \
+ profile7.ok \
+ profile8.awk \
+ profile8.ok \
prt1eval.awk \
prt1eval.ok \
prtoeval.awk \
@@ -737,6 +778,9 @@ EXTRA_DIST = \
regeq.awk \
regeq.in \
regeq.ok \
+ regexpbrack.awk \
+ regexpbrack.in \
+ regexpbrack.ok \
regexprange.awk \
regexprange.ok \
reginttrad.awk \
@@ -829,6 +873,9 @@ EXTRA_DIST = \
sortfor.awk \
sortfor.in \
sortfor.ok \
+ sortglos.awk \
+ sortglos.in \
+ sortglos.ok \
sortu.awk \
sortu.ok \
space.ok \
@@ -910,6 +957,8 @@ EXTRA_DIST = \
testext.ok \
time.awk \
time.ok \
+ timeout.awk \
+ timeout.ok \
tradanch.awk \
tradanch.in \
tradanch.ok \
@@ -969,11 +1018,11 @@ BASIC_TESTS = \
arrayref arrymem1 arryref2 arryref3 arryref4 arryref5 arynasty \
arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \
aryprm8 arysubnm asgext awkpath \
- back89 backgsub badassign1 \
- childin clobber closebad clsflnam compare compare2 concat1 concat2 \
+ back89 backgsub badassign1 badbuild \
+ callparam childin clobber closebad clsflnam compare compare2 concat1 concat2 \
concat3 concat4 convfmt \
datanonl defref delargv delarpm2 delarprm delfunc dfamb1 dfastress dynlj \
- eofsplit exit2 exitval1 exitval2 \
+ eofsplit exit2 exitval1 exitval2 exitval3 \
fcall_exit fcall_exit2 fldchg fldchgnf fnamedat fnarray fnarray2 \
fnaryscl fnasgnm fnmisc fordel forref forsimp fsbs fsrs fsspcoln \
fstabplus funsemnl funsmnam funstack \
@@ -988,13 +1037,14 @@ BASIC_TESTS = \
nlinstr nlstrina noeffect nofile nofmtch noloop1 noloop2 nonl \
noparms nors nulrsend numindex numsubstr \
octsub ofmt ofmta ofmtbig ofmtfidl ofmts ofs1 onlynl opasnidx opasnslf \
+ paramasfunc1 paramasfunc2 \
paramdup paramres paramtyp paramuninitglobal parse1 parsefld parseme \
pcntplus posix2008sub prdupval prec printf0 printf1 prmarscl prmreuse \
prt1eval prtoeval \
- rand randtest range1 rebt8b1 redfilnm regeq regexprange regrange reindops \
+ rand randtest range1 rebt8b1 redfilnm regeq regexpbrack regexprange regrange reindops \
reparse resplit rri1 rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \
rstest3 rstest4 rstest5 rswhite \
- scalar sclforin sclifin sortempty splitargv splitarr splitdef \
+ scalar sclforin sclifin sortempty sortglos splitargv splitarr splitdef \
splitvar splitwht strcat1 strnum1 strtod subamp subi18n \
subsepnm subslash substr swaplns synerr1 synerr2 tradanch tweakfld \
uninit2 uninit3 uninit4 uninit5 uninitialized unterm uparrfs \
@@ -1008,23 +1058,26 @@ UNIX_TESTS = \
GAWK_EXT_TESTS = \
aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \
backw badargs beginfile1 beginfile2 binmode1 charasbytes \
- colonwarn clos1way dbugeval delsub devfd devfd1 devfd2 dumpvars exit \
- fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \
+ colonwarn clos1way crlf dbugeval delsub devfd devfd1 devfd2 dumpvars errno exit \
+ fieldwdth fpat1 fpat2 fpat3 fpat4 fpatnull fsfwfs funlen \
functab1 functab2 functab3 fwtest fwtest2 fwtest3 \
genpot gensub gensub2 getlndir gnuops2 gnuops3 gnureops \
icasefs icasers id igncdym igncfs ignrcas2 ignrcase \
incdupe incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 \
- include include2 indirectcall indirectcall2 \
+ include include2 indirectbuiltin indirectcall indirectcall2 \
lint lintold lintwarn \
manyfiles match1 match2 match3 mbstr1 \
nastyparm next nondec nondec2 \
- patsplit posix printfbad1 printfbad2 printfbad3 printhuge procinfs \
- profile1 profile2 profile3 profile4 profile5 pty1 \
+ nonfatal1 nonfatal2 nonfatal3 \
+ patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \
+ profile0 profile1 profile2 profile3 profile4 profile5 profile6 profile7 \
+ profile8 pty1 \
rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \
rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \
splitarg4 strftime \
strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \
- symtab7 symtab8 symtab9
+ symtab7 symtab8 symtab9 \
+ timeout
EXTRA_TESTS = inftest regtest
@@ -1032,8 +1085,8 @@ INET_TESTS = inetdayu inetdayt inetechu inetecht
MACHINE_TESTS = double1 double2 fmtspcl intformat
-MPFR_TESTS = mpfrnr mpfrnegzero mpfrrem mpfrrnd mpfrieee mpfrexprange \
- mpfrsort mpfrsqrt mpfrbigint
+MPFR_TESTS = mpfrnr mpfrnegzero mpfrmemok1 mpfrrem mpfrrnd mpfrieee \
+ mpfrexprange mpfrsort mpfrsqrt mpfrbigint
LOCALE_CHARSET_TESTS = \
asort asorti backbigs1 backsmalls1 backsmalls2 \
@@ -1041,7 +1094,7 @@ LOCALE_CHARSET_TESTS = \
mbprintf1 mbprintf2 mbprintf3 mbprintf4 rebt8b2 rtlenmb sort1 sprintfc
SHLIB_TESTS = \
- fnmatch filefuncs fork fork2 fts functab4 inplace1 inplace2 inplace3 \
+ fnmatch filefuncs fork fork2 fts functab4 getfile inplace1 inplace2 inplace3 \
ordchr ordchr2 readdir readfile readfile2 revout revtwoway rwarray testext time
# List of the tests which should be run with --lint option:
@@ -1095,7 +1148,7 @@ check: msg \
charset-msg-start charset-tests charset-msg-end \
shlib-msg-start shlib-tests shlib-msg-end \
mpfr-msg-start mpfr-tests mpfr-msg-end
- @$(MAKE) pass-fail
+ @$(MAKE) pass-fail || { $(MAKE) diffout; exit 1; }
basic: $(BASIC_TESTS)
@@ -1300,6 +1353,11 @@ devfd::
@$(AWK) 1 /dev/fd/4 /dev/fd/5 4<"$(srcdir)"/devfd.in4 5<"$(srcdir)"/devfd.in5 >_$@ 2>&1 || echo EXIT CODE: $$? >> _$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+errno:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
fflush::
@echo $@
@"$(srcdir)"/fflush.sh >_$@
@@ -1666,14 +1724,20 @@ beginfile2:
dumpvars::
@echo $@
@AWKPATH="$(srcdir)" $(AWK) --dump-variables 1 < "$(srcdir)"/$@.in >/dev/null 2>&1 || echo EXIT CODE: $$? >>_$@
- @mv awkvars.out _$@
+ @grep -v ENVIRON < awkvars.out | grep -v PROCINFO > _$@; rm awkvars.out
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+profile0:
+ @echo $@
+ @$(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk "$(srcdir)"/$@.in > /dev/null
+ @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
profile1:
@echo $@
@$(AWK) -f "$(srcdir)"/xref.awk "$(srcdir)"/dtdgport.awk > _$@.out1
@$(AWK) --pretty-print=ap-$@.out -f "$(srcdir)"/xref.awk
- @$(AWK) -f ap-$@.out "$(srcdir)"/dtdgport.awk > _$@.out2 ; rm ap-$@.out
+ @$(AWK) -f ./ap-$@.out "$(srcdir)"/dtdgport.awk > _$@.out2 ; rm ap-$@.out
@$(CMP) _$@.out1 _$@.out2 && rm _$@.out[12] || { echo EXIT CODE: $$? >>_$@ ; \
cp "$(srcdir)"/dtdgport.awk $@.ok ; }
@@ -1700,6 +1764,23 @@ profile5:
@$(AWK) --pretty-print=_$@ -f "$(srcdir)"/$@.awk > /dev/null
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+profile6:
+ @echo $@
+ @$(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null
+ @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+profile7:
+ @echo $@
+ @$(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null
+ @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+profile8:
+ @echo $@
+ @$(AWK) --pretty-print=_$@ -f "$(srcdir)"/$@.awk > /dev/null
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
posix2008sub:
@echo $@
@$(AWK) --posix -f "$(srcdir)"/$@.awk > _$@ 2>&1
@@ -1766,6 +1847,11 @@ mpfrrem:
@$(AWK) -M -f "$(srcdir)"/$@.awk > _$@ 2>&1
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+mpfrmemok1:
+ @echo $@
+ @$(AWK) -p/dev/stdout -M -f "$(srcdir)"/$@.awk 2>&1 | sed 1d > _$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
jarebug::
@echo $@
@"$(srcdir)"/$@.sh "$(AWKPROG)" "$(srcdir)"/$@.awk "$(srcdir)"/$@.in "_$@"
@@ -1862,9 +1948,14 @@ inplace3::
testext::
@echo $@
@$(AWK) '/^(@load|BEGIN)/,/^}/' "$(top_srcdir)"/extension/testext.c > testext.awk
- @$(AWK) -f testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @$(AWK) -f ./testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ testext.awk
+getfile:
+ @echo $@
+ @$(AWK) -v TESTEXT_QUIET=1 -ltestext -f $(srcdir)/$@.awk $(srcdir)/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
readdir:
@if [ "`uname`" = Linux ] && [ "`stat -f . 2>/dev/null | awk 'NR == 2 { print $$NF }'`" = nfs ]; then \
echo This test may fail on GNU/Linux systems when run on an NFS filesystem.; \
@@ -1984,6 +2075,15 @@ genpot:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk --gen-pot >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+paramasfunc1::
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --posix >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+paramasfunc2::
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --posix >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
# Targets generated for other tests:
include Maketests
diff --git a/test/Makefile.in b/test/Makefile.in
index 8d7790f4..8053df5c 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.13.4 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -17,7 +17,7 @@
#
# test/Makefile.am --- automake input file for gawk
#
-# Copyright (C) 1988-2014 the Free Software Foundation, Inc.
+# Copyright (C) 1988-2015 the Free Software Foundation, Inc.
#
# This file is part of GAWK, the GNU implementation of the
# AWK Programming Language.
@@ -37,7 +37,17 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -100,9 +110,6 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-DIST_COMMON = $(srcdir)/Maketests $(srcdir)/Makefile.in \
- $(srcdir)/Makefile.am $(top_srcdir)/mkinstalldirs ChangeLog \
- README
subdir = test
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
@@ -118,6 +125,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
$(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@@ -142,6 +150,8 @@ am__can_run_installinfo = \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Maketests \
+ $(top_srcdir)/mkinstalldirs ChangeLog README
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -205,6 +215,7 @@ PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
POSUB = @POSUB@
+SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOCKET_LIBS = @SOCKET_LIBS@
@@ -369,12 +380,17 @@ EXTRA_DIST = \
badargs.ok \
badassign1.awk \
badassign1.ok \
+ badbuild.awk \
+ badbuild.in \
+ badbuild.ok \
beginfile1.awk \
beginfile1.ok \
beginfile2.in \
beginfile2.ok \
beginfile2.sh \
binmode1.ok \
+ callparam.awk \
+ callparam.ok \
charasbytes.awk \
charasbytes.in \
charasbytes.ok \
@@ -410,6 +426,8 @@ EXTRA_DIST = \
concat4.ok \
convfmt.awk \
convfmt.ok \
+ crlf.awk \
+ crlf.ok \
datanonl.awk \
datanonl.in \
datanonl.ok \
@@ -451,6 +469,9 @@ EXTRA_DIST = \
dynlj.ok \
eofsplit.awk \
eofsplit.ok \
+ errno.awk \
+ errno.in \
+ errno.ok \
exit.ok \
exit.sh \
exit2.awk \
@@ -460,6 +481,8 @@ EXTRA_DIST = \
exitval2.awk \
exitval2.ok \
exitval2.w32 \
+ exitval3.awk \
+ exitval3.ok \
fcall_exit.awk \
fcall_exit.ok \
fcall_exit2.awk \
@@ -524,6 +547,8 @@ EXTRA_DIST = \
fpat3.awk \
fpat3.in \
fpat3.ok \
+ fpat4.awk \
+ fpat4.ok \
fpatnull.awk \
fpatnull.in \
fpatnull.ok \
@@ -577,6 +602,8 @@ EXTRA_DIST = \
gensub.ok \
gensub2.awk \
gensub2.ok \
+ getfile.awk \
+ getfile.ok \
getline.awk \
getline.in \
getline.ok \
@@ -666,6 +693,8 @@ EXTRA_DIST = \
include.awk \
include.ok \
include2.ok \
+ indirectbuiltin.awk \
+ indirectbuiltin.ok \
indirectcall.awk \
indirectcall.in \
indirectcall.ok \
@@ -774,6 +803,8 @@ EXTRA_DIST = \
mpfrexprange.ok \
mpfrieee.awk \
mpfrieee.ok \
+ mpfrmemok1.awk \
+ mpfrmemok1.ok \
mpfrnegzero.awk \
mpfrnegzero.ok \
mpfrnr.awk \
@@ -838,6 +869,12 @@ EXTRA_DIST = \
nondec.ok \
nondec2.awk \
nondec2.ok \
+ nonfatal1.awk \
+ nonfatal1.ok \
+ nonfatal2.awk \
+ nonfatal2.ok \
+ nonfatal3.awk \
+ nonfatal3.ok \
nonl.awk \
nonl.ok \
noparms.awk \
@@ -885,6 +922,10 @@ EXTRA_DIST = \
out1.ok \
out2.ok \
out3.ok \
+ paramasfunc1.awk \
+ paramasfunc1.ok \
+ paramasfunc2.awk \
+ paramasfunc2.ok \
paramdup.awk \
paramdup.ok \
paramres.awk \
@@ -935,6 +976,8 @@ EXTRA_DIST = \
printfbad2.ok \
printfbad3.awk \
printfbad3.ok \
+ printfbad4.awk \
+ printfbad4.ok \
printfloat.awk \
printhuge.awk \
printhuge.ok \
@@ -945,6 +988,9 @@ EXTRA_DIST = \
prmreuse.ok \
procinfs.awk \
procinfs.ok \
+ profile0.awk \
+ profile0.in \
+ profile0.ok \
profile2.ok \
profile3.awk \
profile3.ok \
@@ -952,6 +998,12 @@ EXTRA_DIST = \
profile4.ok \
profile5.awk \
profile5.ok \
+ profile6.awk \
+ profile6.ok \
+ profile7.awk \
+ profile7.ok \
+ profile8.awk \
+ profile8.ok \
prt1eval.awk \
prt1eval.ok \
prtoeval.awk \
@@ -983,6 +1035,9 @@ EXTRA_DIST = \
regeq.awk \
regeq.in \
regeq.ok \
+ regexpbrack.awk \
+ regexpbrack.in \
+ regexpbrack.ok \
regexprange.awk \
regexprange.ok \
reginttrad.awk \
@@ -1075,6 +1130,9 @@ EXTRA_DIST = \
sortfor.awk \
sortfor.in \
sortfor.ok \
+ sortglos.awk \
+ sortglos.in \
+ sortglos.ok \
sortu.awk \
sortu.ok \
space.ok \
@@ -1156,6 +1214,8 @@ EXTRA_DIST = \
testext.ok \
time.awk \
time.ok \
+ timeout.awk \
+ timeout.ok \
tradanch.awk \
tradanch.in \
tradanch.ok \
@@ -1214,11 +1274,11 @@ BASIC_TESTS = \
arrayref arrymem1 arryref2 arryref3 arryref4 arryref5 arynasty \
arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \
aryprm8 arysubnm asgext awkpath \
- back89 backgsub badassign1 \
- childin clobber closebad clsflnam compare compare2 concat1 concat2 \
+ back89 backgsub badassign1 badbuild \
+ callparam childin clobber closebad clsflnam compare compare2 concat1 concat2 \
concat3 concat4 convfmt \
datanonl defref delargv delarpm2 delarprm delfunc dfamb1 dfastress dynlj \
- eofsplit exit2 exitval1 exitval2 \
+ eofsplit exit2 exitval1 exitval2 exitval3 \
fcall_exit fcall_exit2 fldchg fldchgnf fnamedat fnarray fnarray2 \
fnaryscl fnasgnm fnmisc fordel forref forsimp fsbs fsrs fsspcoln \
fstabplus funsemnl funsmnam funstack \
@@ -1233,13 +1293,14 @@ BASIC_TESTS = \
nlinstr nlstrina noeffect nofile nofmtch noloop1 noloop2 nonl \
noparms nors nulrsend numindex numsubstr \
octsub ofmt ofmta ofmtbig ofmtfidl ofmts ofs1 onlynl opasnidx opasnslf \
+ paramasfunc1 paramasfunc2 \
paramdup paramres paramtyp paramuninitglobal parse1 parsefld parseme \
pcntplus posix2008sub prdupval prec printf0 printf1 prmarscl prmreuse \
prt1eval prtoeval \
- rand randtest range1 rebt8b1 redfilnm regeq regexprange regrange reindops \
+ rand randtest range1 rebt8b1 redfilnm regeq regexpbrack regexprange regrange reindops \
reparse resplit rri1 rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \
rstest3 rstest4 rstest5 rswhite \
- scalar sclforin sclifin sortempty splitargv splitarr splitdef \
+ scalar sclforin sclifin sortempty sortglos splitargv splitarr splitdef \
splitvar splitwht strcat1 strnum1 strtod subamp subi18n \
subsepnm subslash substr swaplns synerr1 synerr2 tradanch tweakfld \
uninit2 uninit3 uninit4 uninit5 uninitialized unterm uparrfs \
@@ -1253,29 +1314,32 @@ UNIX_TESTS = \
GAWK_EXT_TESTS = \
aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \
backw badargs beginfile1 beginfile2 binmode1 charasbytes \
- colonwarn clos1way dbugeval delsub devfd devfd1 devfd2 dumpvars exit \
- fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \
+ colonwarn clos1way crlf dbugeval delsub devfd devfd1 devfd2 dumpvars errno exit \
+ fieldwdth fpat1 fpat2 fpat3 fpat4 fpatnull fsfwfs funlen \
functab1 functab2 functab3 fwtest fwtest2 fwtest3 \
genpot gensub gensub2 getlndir gnuops2 gnuops3 gnureops \
icasefs icasers id igncdym igncfs ignrcas2 ignrcase \
incdupe incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 \
- include include2 indirectcall indirectcall2 \
+ include include2 indirectbuiltin indirectcall indirectcall2 \
lint lintold lintwarn \
manyfiles match1 match2 match3 mbstr1 \
nastyparm next nondec nondec2 \
- patsplit posix printfbad1 printfbad2 printfbad3 printhuge procinfs \
- profile1 profile2 profile3 profile4 profile5 pty1 \
+ nonfatal1 nonfatal2 nonfatal3 \
+ patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \
+ profile0 profile1 profile2 profile3 profile4 profile5 profile6 profile7 \
+ profile8 pty1 \
rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \
rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \
splitarg4 strftime \
strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \
- symtab7 symtab8 symtab9
+ symtab7 symtab8 symtab9 \
+ timeout
EXTRA_TESTS = inftest regtest
INET_TESTS = inetdayu inetdayt inetechu inetecht
MACHINE_TESTS = double1 double2 fmtspcl intformat
-MPFR_TESTS = mpfrnr mpfrnegzero mpfrrem mpfrrnd mpfrieee mpfrexprange \
- mpfrsort mpfrsqrt mpfrbigint
+MPFR_TESTS = mpfrnr mpfrnegzero mpfrmemok1 mpfrrem mpfrrnd mpfrieee \
+ mpfrexprange mpfrsort mpfrsqrt mpfrbigint
LOCALE_CHARSET_TESTS = \
asort asorti backbigs1 backsmalls1 backsmalls2 \
@@ -1283,7 +1347,7 @@ LOCALE_CHARSET_TESTS = \
mbprintf1 mbprintf2 mbprintf3 mbprintf4 rebt8b2 rtlenmb sort1 sprintfc
SHLIB_TESTS = \
- fnmatch filefuncs fork fork2 fts functab4 inplace1 inplace2 inplace3 \
+ fnmatch filefuncs fork fork2 fts functab4 getfile inplace1 inplace2 inplace3 \
ordchr ordchr2 readdir readfile readfile2 revout revtwoway rwarray testext time
@@ -1342,7 +1406,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/Maketests $(am__configur
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu test/Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@@ -1351,6 +1414,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
+$(srcdir)/Maketests $(am__empty):
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
@@ -1509,6 +1573,8 @@ uninstall-am:
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am tags-am uninstall uninstall-am
+.PRECIOUS: Makefile
+
# Message stuff is to make it a little easier to follow.
# Make the pass-fail last and dependent on others to avoid
@@ -1522,7 +1588,7 @@ check: msg \
charset-msg-start charset-tests charset-msg-end \
shlib-msg-start shlib-tests shlib-msg-end \
mpfr-msg-start mpfr-tests mpfr-msg-end
- @$(MAKE) pass-fail
+ @$(MAKE) pass-fail || { $(MAKE) diffout; exit 1; }
basic: $(BASIC_TESTS)
@@ -1725,6 +1791,11 @@ devfd::
@$(AWK) 1 /dev/fd/4 /dev/fd/5 4<"$(srcdir)"/devfd.in4 5<"$(srcdir)"/devfd.in5 >_$@ 2>&1 || echo EXIT CODE: $$? >> _$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+errno:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
fflush::
@echo $@
@"$(srcdir)"/fflush.sh >_$@
@@ -2091,14 +2162,20 @@ beginfile2:
dumpvars::
@echo $@
@AWKPATH="$(srcdir)" $(AWK) --dump-variables 1 < "$(srcdir)"/$@.in >/dev/null 2>&1 || echo EXIT CODE: $$? >>_$@
- @mv awkvars.out _$@
+ @grep -v ENVIRON < awkvars.out | grep -v PROCINFO > _$@; rm awkvars.out
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+profile0:
+ @echo $@
+ @$(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk "$(srcdir)"/$@.in > /dev/null
+ @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
profile1:
@echo $@
@$(AWK) -f "$(srcdir)"/xref.awk "$(srcdir)"/dtdgport.awk > _$@.out1
@$(AWK) --pretty-print=ap-$@.out -f "$(srcdir)"/xref.awk
- @$(AWK) -f ap-$@.out "$(srcdir)"/dtdgport.awk > _$@.out2 ; rm ap-$@.out
+ @$(AWK) -f ./ap-$@.out "$(srcdir)"/dtdgport.awk > _$@.out2 ; rm ap-$@.out
@$(CMP) _$@.out1 _$@.out2 && rm _$@.out[12] || { echo EXIT CODE: $$? >>_$@ ; \
cp "$(srcdir)"/dtdgport.awk $@.ok ; }
@@ -2124,6 +2201,23 @@ profile5:
@$(AWK) --pretty-print=_$@ -f "$(srcdir)"/$@.awk > /dev/null
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+profile6:
+ @echo $@
+ @$(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null
+ @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+profile7:
+ @echo $@
+ @$(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null
+ @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+profile8:
+ @echo $@
+ @$(AWK) --pretty-print=_$@ -f "$(srcdir)"/$@.awk > /dev/null
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
posix2008sub:
@echo $@
@$(AWK) --posix -f "$(srcdir)"/$@.awk > _$@ 2>&1
@@ -2190,6 +2284,11 @@ mpfrrem:
@$(AWK) -M -f "$(srcdir)"/$@.awk > _$@ 2>&1
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+mpfrmemok1:
+ @echo $@
+ @$(AWK) -p/dev/stdout -M -f "$(srcdir)"/$@.awk 2>&1 | sed 1d > _$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
jarebug::
@echo $@
@"$(srcdir)"/$@.sh "$(AWKPROG)" "$(srcdir)"/$@.awk "$(srcdir)"/$@.in "_$@"
@@ -2286,9 +2385,14 @@ inplace3::
testext::
@echo $@
@$(AWK) '/^(@load|BEGIN)/,/^}/' "$(top_srcdir)"/extension/testext.c > testext.awk
- @$(AWK) -f testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @$(AWK) -f ./testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ testext.awk
+getfile:
+ @echo $@
+ @$(AWK) -v TESTEXT_QUIET=1 -ltestext -f $(srcdir)/$@.awk $(srcdir)/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
readdir:
@if [ "`uname`" = Linux ] && [ "`stat -f . 2>/dev/null | awk 'NR == 2 { print $$NF }'`" = nfs ]; then \
echo This test may fail on GNU/Linux systems when run on an NFS filesystem.; \
@@ -2406,6 +2510,16 @@ genpot:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk --gen-pot >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+paramasfunc1::
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --posix >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+paramasfunc2::
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --posix >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
Gt-dummy:
# file Maketests, generated from Makefile.am by the Gentests program
addcomma:
@@ -2533,6 +2647,16 @@ badassign1:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+badbuild:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+callparam:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
childin:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@@ -2628,6 +2752,11 @@ exitval2:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+exitval3:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
fcall_exit:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@@ -3100,6 +3229,11 @@ regeq:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+regexpbrack:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
regexprange:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@@ -3185,6 +3319,11 @@ sortempty:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+sortglos:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
splitargv:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@@ -3350,6 +3489,11 @@ backw:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+crlf:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
delsub:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@@ -3375,6 +3519,11 @@ fpat3:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+fpat4:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
fpatnull:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@@ -3485,6 +3634,11 @@ include:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+indirectbuiltin:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
indirectcall:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@@ -3535,6 +3689,21 @@ nondec:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+nonfatal1:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+nonfatal2:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+nonfatal3:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
patsplit:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@@ -3555,6 +3724,11 @@ printfbad3:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+printfbad4:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
procinfs:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@@ -3655,6 +3829,11 @@ symtab7:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+timeout:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
double1:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index f8d5e8a9..219d592d 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -125,6 +125,16 @@ badassign1:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+badbuild:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+callparam:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
childin:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@@ -220,6 +230,11 @@ exitval2:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+exitval3:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
fcall_exit:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@@ -692,6 +707,11 @@ regeq:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+regexpbrack:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
regexprange:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@@ -777,6 +797,11 @@ sortempty:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+sortglos:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
splitargv:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@@ -942,6 +967,11 @@ backw:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+crlf:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
delsub:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@@ -967,6 +997,11 @@ fpat3:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+fpat4:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
fpatnull:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@@ -1077,6 +1112,11 @@ include:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+indirectbuiltin:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
indirectcall:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@@ -1127,6 +1167,21 @@ nondec:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+nonfatal1:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+nonfatal2:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+nonfatal3:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
patsplit:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@@ -1147,6 +1202,11 @@ printfbad3:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+printfbad4:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
procinfs:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@@ -1247,6 +1307,11 @@ symtab7:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+timeout:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
double1:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/badbuild.awk b/test/badbuild.awk
new file mode 100644
index 00000000..12a6caeb
--- /dev/null
+++ b/test/badbuild.awk
@@ -0,0 +1,6 @@
+$1 == $2 == $3 {
+ print "Gawk was built incorrectly."
+ print "Use bison, not byacc or something else!"
+ print "(Really, why aren't you using the awkgram.c in the distribution?)"
+ exit 42
+}
diff --git a/test/badbuild.in b/test/badbuild.in
new file mode 100644
index 00000000..560711d4
--- /dev/null
+++ b/test/badbuild.in
@@ -0,0 +1 @@
+a a 1
diff --git a/test/badbuild.ok b/test/badbuild.ok
new file mode 100644
index 00000000..6d60f5a9
--- /dev/null
+++ b/test/badbuild.ok
@@ -0,0 +1,3 @@
+gawk: badbuild.awk:1: $1 == $2 == $3 {
+gawk: badbuild.awk:1: ^ syntax error
+EXIT CODE: 1
diff --git a/test/callparam.awk b/test/callparam.awk
new file mode 100644
index 00000000..b925db01
--- /dev/null
+++ b/test/callparam.awk
@@ -0,0 +1,6 @@
+BEGIN { f() }
+
+function f( a, b)
+{
+ a = b()
+}
diff --git a/test/callparam.ok b/test/callparam.ok
new file mode 100644
index 00000000..00a027e8
--- /dev/null
+++ b/test/callparam.ok
@@ -0,0 +1,2 @@
+gawk: callparam.awk:5: error: attempt to use non-function `b' in function call
+EXIT CODE: 1
diff --git a/test/charasbytes.awk b/test/charasbytes.awk
index feb195c8..feb195c8 100755..100644
--- a/test/charasbytes.awk
+++ b/test/charasbytes.awk
diff --git a/test/crlf.awk b/test/crlf.awk
new file mode 100644
index 00000000..79be9eb6
--- /dev/null
+++ b/test/crlf.awk
@@ -0,0 +1,11 @@
+BEGIN {
+ print \
+ "hi there"
+ print "hello \
+world"
+ if ("foo" ~ /fo\
+o/)
+ print "matches"
+ else
+ print "does not match!"
+}
diff --git a/test/crlf.ok b/test/crlf.ok
new file mode 100644
index 00000000..0ba071b5
--- /dev/null
+++ b/test/crlf.ok
@@ -0,0 +1,3 @@
+hi there
+hello world
+matches
diff --git a/test/errno.awk b/test/errno.awk
new file mode 100644
index 00000000..bcb77614
--- /dev/null
+++ b/test/errno.awk
@@ -0,0 +1,10 @@
+BEGIN {
+ # check that PROCINFO["errno"] is working properly
+ getline
+ if (close(FILENAME)) {
+ print "Error `" ERRNO "' closing input file"
+ print "errno =", PROCINFO["errno"]
+ }
+ getline < (FILENAME "/bogus")
+ print (PROCINFO["errno"] > 0), ERRNO
+}
diff --git a/test/errno.in b/test/errno.in
new file mode 100644
index 00000000..a92d664b
--- /dev/null
+++ b/test/errno.in
@@ -0,0 +1,3 @@
+line 1
+line 2
+line 3
diff --git a/test/errno.ok b/test/errno.ok
new file mode 100644
index 00000000..181afdaf
--- /dev/null
+++ b/test/errno.ok
@@ -0,0 +1,3 @@
+Error `close of redirection that was never opened' closing input file
+errno = 0
+1 Not a directory
diff --git a/test/exit.sh b/test/exit.sh
index 9510dcdc..3922f83c 100755
--- a/test/exit.sh
+++ b/test/exit.sh
@@ -30,7 +30,7 @@ x='function f(){ exit}; BEGINFILE {f()}; NR>1{ f()}; END{print NR}'
$AWK 'BEGIN { print "a\nb" }' | $AWK "$x"
echo "-- 5"
-y='function strip(f) { sub(/.*\//, "", f); return f };'
+y='function strip(val) { sub(/.*\//, "", val); return val };'
x='BEGINFILE{if(++i==1) exit;}; END{print i, strip(FILENAME)}'
$AWK "$y$x" /dev/null $0
diff --git a/test/exitval3.awk b/test/exitval3.awk
new file mode 100644
index 00000000..33e8c433
--- /dev/null
+++ b/test/exitval3.awk
@@ -0,0 +1,2 @@
+BEGIN { exit 42 }
+END { exit }
diff --git a/test/exitval3.ok b/test/exitval3.ok
new file mode 100644
index 00000000..20f64b8c
--- /dev/null
+++ b/test/exitval3.ok
@@ -0,0 +1 @@
+EXIT CODE: 42
diff --git a/test/fpat4.awk b/test/fpat4.awk
new file mode 100644
index 00000000..79cd6a7f
--- /dev/null
+++ b/test/fpat4.awk
@@ -0,0 +1,105 @@
+BEGIN {
+ false = 0
+ true = 1
+
+ fpat[1] = "([^,]*)|(\"[^\"]+\")"
+ fpat[2] = fpat[1]
+ fpat[3] = fpat[1]
+ fpat[4] = "aa+"
+ fpat[5] = fpat[4]
+ fpat[6] = "[a-z]"
+
+ data[1] = "Robbins,,Arnold,"
+ data[2] = "Smith,,\"1234 A Pretty Place, NE\",Sometown,NY,12345-6789,USA"
+ data[3] = "Robbins,Arnold,\"1234 A Pretty Place, NE\",Sometown,NY,12345-6789,USA"
+ data[4] = "bbbaaacccdddaaaaaqqqq"
+ data[5] = "bbbaaacccdddaaaaaqqqqa" # should get trailing qqqa
+ data[6] = "aAbBcC"
+
+ for (i = 1; i in data; i++) {
+ printf("Splitting: <%s>\n", data[i])
+ n = mypatsplit(data[i], fields, fpat[i], seps)
+ m = patsplit(data[i], fields2, fpat[i], seps2)
+ print "n =", n, "m =", m
+ if (n != m) {
+ printf("ERROR: counts wrong!\n") > "/dev/stderr"
+ exit 1
+ }
+ for (j = 1; j <= n; j++) {
+ printf("fields[%d] = <%s>\tfields2[%d] = <%s>\n", j, fields[j], j, fields2[j])
+ if (fields[j] != fields2[j]) {
+ printf("ERROR: data %d, field %d mismatch!\n", i, j) > "/dev/stderr"
+ exit 1
+ }
+ }
+ for (j = 0; j in seps; j++) {
+ printf("seps[%d] = <%s>\tseps2[%d] = <%s>\n", j, seps[j], j, seps2[j])
+ if (seps[j] != seps2[j]) {
+ printf("ERROR: data %d, separator %d mismatch!\n", i, j) > "/dev/stderr"
+ exit 1
+ }
+ }
+ }
+}
+
+function mypatsplit(string, array, pattern, seps,
+ eosflag, non_empty, nf) # locals
+{
+ delete array
+ delete seps
+ if (length(string) == 0)
+ return 0
+
+ eosflag = non_empty = false
+ nf = 0
+ while (match(string, pattern)) {
+ if (RLENGTH > 0) { # easy case
+ non_empty = true
+ if (! (nf in seps)) {
+ if (RSTART == 1) # match at front of string
+ seps[nf] = ""
+ else
+ seps[nf] = substr(string, 1, RSTART - 1)
+ }
+ array[++nf] = substr(string, RSTART, RLENGTH)
+ string = substr(string, RSTART+RLENGTH)
+ if (length(string) == 0)
+ break
+ } 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
+ seps[nf] = substr(string, 1, 1)
+ string = substr(string, 2)
+ } else {
+ # 0 length match
+ if (! (nf in seps)) {
+ if (RSTART == 1)
+ seps[nf] = ""
+ else
+ seps[nf] = substr(string, 1, RSTART - 1)
+ }
+ array[++nf] = ""
+ if (! non_empty && ! eosflag) { # prev was empty
+ seps[nf] = substr(string, 1, 1)
+ }
+ if (RSTART == 1) {
+ string = substr(string, 2)
+ } else {
+ string = substr(string, RSTART + 1)
+ }
+ non_empty = false
+ }
+ if (length(string) == 0) {
+ if (eosflag)
+ break
+ else
+ eosflag = true
+ }
+ }
+ if (length(string) > 0)
+ seps[nf] = string
+
+ return length(array)
+}
diff --git a/test/fpat4.ok b/test/fpat4.ok
new file mode 100644
index 00000000..b4430aba
--- /dev/null
+++ b/test/fpat4.ok
@@ -0,0 +1,65 @@
+Splitting: <Robbins,,Arnold,>
+n = 4 m = 4
+fields[1] = <Robbins> fields2[1] = <Robbins>
+fields[2] = <> fields2[2] = <>
+fields[3] = <Arnold> fields2[3] = <Arnold>
+fields[4] = <> fields2[4] = <>
+seps[0] = <> seps2[0] = <>
+seps[1] = <,> seps2[1] = <,>
+seps[2] = <,> seps2[2] = <,>
+seps[3] = <,> seps2[3] = <,>
+Splitting: <Smith,,"1234 A Pretty Place, NE",Sometown,NY,12345-6789,USA>
+n = 7 m = 7
+fields[1] = <Smith> fields2[1] = <Smith>
+fields[2] = <> fields2[2] = <>
+fields[3] = <"1234 A Pretty Place, NE"> fields2[3] = <"1234 A Pretty Place, NE">
+fields[4] = <Sometown> fields2[4] = <Sometown>
+fields[5] = <NY> fields2[5] = <NY>
+fields[6] = <12345-6789> fields2[6] = <12345-6789>
+fields[7] = <USA> fields2[7] = <USA>
+seps[0] = <> seps2[0] = <>
+seps[1] = <,> seps2[1] = <,>
+seps[2] = <,> seps2[2] = <,>
+seps[3] = <,> seps2[3] = <,>
+seps[4] = <,> seps2[4] = <,>
+seps[5] = <,> seps2[5] = <,>
+seps[6] = <,> seps2[6] = <,>
+Splitting: <Robbins,Arnold,"1234 A Pretty Place, NE",Sometown,NY,12345-6789,USA>
+n = 7 m = 7
+fields[1] = <Robbins> fields2[1] = <Robbins>
+fields[2] = <Arnold> fields2[2] = <Arnold>
+fields[3] = <"1234 A Pretty Place, NE"> fields2[3] = <"1234 A Pretty Place, NE">
+fields[4] = <Sometown> fields2[4] = <Sometown>
+fields[5] = <NY> fields2[5] = <NY>
+fields[6] = <12345-6789> fields2[6] = <12345-6789>
+fields[7] = <USA> fields2[7] = <USA>
+seps[0] = <> seps2[0] = <>
+seps[1] = <,> seps2[1] = <,>
+seps[2] = <,> seps2[2] = <,>
+seps[3] = <,> seps2[3] = <,>
+seps[4] = <,> seps2[4] = <,>
+seps[5] = <,> seps2[5] = <,>
+seps[6] = <,> seps2[6] = <,>
+Splitting: <bbbaaacccdddaaaaaqqqq>
+n = 2 m = 2
+fields[1] = <aaa> fields2[1] = <aaa>
+fields[2] = <aaaaa> fields2[2] = <aaaaa>
+seps[0] = <bbb> seps2[0] = <bbb>
+seps[1] = <cccddd> seps2[1] = <cccddd>
+seps[2] = <qqqq> seps2[2] = <qqqq>
+Splitting: <bbbaaacccdddaaaaaqqqqa>
+n = 2 m = 2
+fields[1] = <aaa> fields2[1] = <aaa>
+fields[2] = <aaaaa> fields2[2] = <aaaaa>
+seps[0] = <bbb> seps2[0] = <bbb>
+seps[1] = <cccddd> seps2[1] = <cccddd>
+seps[2] = <qqqqa> seps2[2] = <qqqqa>
+Splitting: <aAbBcC>
+n = 3 m = 3
+fields[1] = <a> fields2[1] = <a>
+fields[2] = <b> fields2[2] = <b>
+fields[3] = <c> fields2[3] = <c>
+seps[0] = <> seps2[0] = <>
+seps[1] = <A> seps2[1] = <A>
+seps[2] = <B> seps2[2] = <B>
+seps[3] = <C> seps2[3] = <C>
diff --git a/test/gensub2.ok b/test/gensub2.ok
index 89824140..318f940c 100644
--- a/test/gensub2.ok
+++ b/test/gensub2.ok
@@ -1,3 +1,4 @@
xy
xy
+gawk: gensub2.awk:4: warning: gensub: third argument `a' treated as 1
yx
diff --git a/test/getfile.awk b/test/getfile.awk
new file mode 100644
index 00000000..6ee783f6
--- /dev/null
+++ b/test/getfile.awk
@@ -0,0 +1,35 @@
+function basename(x) {
+ return gensub(/^.*\//, "", 1, x)
+}
+
+BEGIN {
+ print "BEGIN"
+
+ cmd = "echo hello; echo goodbye"
+ rc = get_file(cmd, "<<", -1, res)
+ print "expected error result", rc, ERRNO
+ print "get_file returned", get_file(cmd, "|<", -1, res)
+ print "input_name", basename(res["input_name"])
+ print (cmd | getline x)
+ print x
+
+ # check that calling get_file on "" triggers the BEGINFILE rule
+ print "get_file returned", get_file("", "", -1, res)
+ print "input_name", basename(res["input_name"])
+ print "end BEGIN"
+}
+
+BEGINFILE {
+ printf "BEGINFILE (%s) ERRNO (%s)\n", basename(FILENAME), ERRNO
+}
+
+ENDFILE {
+ printf "ENDFILE (%s) ERRNO (%s)\n", basename(FILENAME), ERRNO
+}
+
+END {
+ print "END"
+ print (cmd | getline x)
+ print x
+ print close(cmd)
+}
diff --git a/test/getfile.ok b/test/getfile.ok
new file mode 100644
index 00000000..92c915f2
--- /dev/null
+++ b/test/getfile.ok
@@ -0,0 +1,17 @@
+BEGIN
+gawk: ./getfile.awk:9: warning: cannot open unrecognized file type `<<' for `echo hello; echo goodbye'
+get_file: get_file(echo hello; echo goodbye, <<, -1) failed
+expected error result 0
+get_file returned 1
+input_name echo hello; echo goodbye
+1
+hello
+BEGINFILE (getfile.awk) ERRNO ()
+get_file returned 1
+input_name getfile.awk
+end BEGIN
+ENDFILE (getfile.awk) ERRNO ()
+END
+1
+goodbye
+0
diff --git a/test/id.ok b/test/id.ok
index 4cb39b32..bd26b473 100644
--- a/test/id.ok
+++ b/test/id.ok
@@ -14,6 +14,7 @@ sprintf -> builtin
ROUNDMODE -> scalar
strftime -> builtin
systime -> builtin
+length -> builtin
and -> builtin
srand -> builtin
FNR -> scalar
@@ -23,7 +24,6 @@ cos -> builtin
TEXTDOMAIN -> scalar
ORS -> scalar
split -> builtin
-div -> builtin
RSTART -> scalar
compl -> builtin
bindtextdomain -> builtin
@@ -62,6 +62,7 @@ sub -> builtin
OFMT -> scalar
RLENGTH -> scalar
substr -> builtin
+intdiv -> builtin
FPAT -> scalar
RS -> scalar
xor -> builtin
@@ -71,3 +72,4 @@ lshift -> builtin
SYMTAB -> array
strtonum -> builtin
toupper -> builtin
+ENVIRON -> array
diff --git a/test/indirectbuiltin.awk b/test/indirectbuiltin.awk
new file mode 100644
index 00000000..4d5291d2
--- /dev/null
+++ b/test/indirectbuiltin.awk
@@ -0,0 +1,371 @@
+function print_result(category, fname, builtin_result, indirect_result)
+{
+ if (builtin_result == indirect_result)
+ printf("%s: %s: pass\n", category, fname)
+ else {
+ printf("%s: %s: fail: builtin: %s \tindirect: %s\n", category, fname,
+ builtin_result, indirect_result)
+ exit 1
+ }
+}
+
+
+BEGIN {
+# math functions
+
+ fun = "and"
+ b1 = and(0x11, 0x01)
+ i1 = @fun(0x11, 0x01)
+ print_result("math", fun, b1, i1)
+
+ fun = "atan2"
+ b1 = atan2(-1, 0)
+ i1 = @fun(-1, 0)
+ print_result("math", fun, b1, i1)
+
+ fun = "compl"
+ b1 = compl(0x1111)
+ i1 = @fun(0x1111)
+ print_result("math", fun, b1, i1)
+
+ fun = "cos"
+ b1 = cos(3.1415927 / 4)
+ i1 = @fun(3.1415927 / 4)
+ print_result("math", fun, b1, i1)
+
+ fun = "exp"
+ b1 = exp(2)
+ i1 = @fun(2)
+ print_result("math", fun, b1, i1)
+
+ fun = "int"
+ b1 = int(3.1415927)
+ i1 = @fun(3.1415927)
+ print_result("math", fun, b1, i1)
+
+ fun = "log"
+ b1 = log(10)
+ i1 = @fun(10)
+ print_result("math", fun, b1, i1)
+
+ fun = "lshift"
+ b1 = lshift(1, 2)
+ i1 = @fun(1, 2)
+ print_result("math", fun, b1, i1)
+
+ fun = "or"
+ b1 = or(0x10, 0x01)
+ i1 = @fun(0x10, 0x01)
+ print_result("math", fun, b1, i1)
+
+ fun = "rand"
+ srand(1)
+ b1 = rand();
+ srand(1)
+ i1 = @fun()
+ print_result("math", fun, b1, i1)
+
+ fun = "rshift"
+ b1 = rshift(0x10, 1)
+ i1 = @fun(0x10, 1)
+ print_result("math", fun, b1, i1)
+
+ fun = "sin"
+ b1 = sin(3.1415927 / 4)
+ i1 = @fun(3.1415927 / 4)
+ print_result("math", fun, b1, i1)
+
+ fun = "sqrt"
+ b1 = sqrt(2)
+ i1 = @fun(2)
+ print_result("math", fun, b1, i1)
+
+ srand()
+ fun = "srand"
+ b1 = srand()
+ i1 = @fun()
+ print_result("math", fun, b1, i1)
+
+ fun = "xor"
+ b1 = xor(0x11, 0x01)
+ i1 = @fun(0x11, 0x01)
+ print_result("math", fun, b1, i1)
+
+# string functions
+
+ fun = "gensub"
+ b1 = gensub("f", "q", "g", "ff11bb")
+ i1 = @fun("f", "q", "g", "ff11bb")
+ print_result("string", fun, b1, i1)
+
+ fun = "gsub"
+ $0 = "ff11bb"
+ b1 = gsub("f", "q")
+ b2 = $0
+ $0 = "ff11bb"
+ i1 = @fun("f", "q")
+ i2 = $0
+ print_result("string", fun, b1, i1)
+ if (b2 != i2) {
+ printf("string: %s: fail: $0 (%s) != $0 (%s)\n",
+ fun, b2, i2)
+ exit 1
+ }
+
+ fun = "index"
+ b1 = index("hi, how are you", "how")
+ i1 = @fun("hi, how are you", "how")
+ print_result("string", fun, b1, i1)
+
+ fun = "dcgettext"
+ b1 = dcgettext("hello, world")
+ i1 = @fun("hello, world")
+ print_result("string", fun, b1, i1)
+
+ fun = "dcngettext"
+ b1 = dcngettext("hello, world", "howdy", 2)
+ i1 = @fun("hello, world", "howdy", 2)
+ print_result("string", fun, b1, i1)
+
+ fun = "length"
+ b1 = length("hi, how are you")
+ i1 = @fun("hi, how are you")
+ print_result("string", fun, b1, i1)
+
+ fun = "sprintf"
+ b1 = sprintf("%s world", "hello")
+ i1 = @fun("%s world", "hello")
+ print_result("string", fun, b1, i1)
+
+ fun = "strtonum"
+ b1 = strtonum("0xdeadbeef")
+ i1 = @fun("0xdeadbeef")
+ print_result("string", fun, b1, i1)
+
+ fun = "sub"
+ $0 = "ff11bb"
+ b1 = sub("f", "q")
+ b2 = $0
+ $0 = "ff11bb"
+ i1 = @fun("f", "q")
+ i2 = $0
+ print_result("string", fun, b1, i1)
+ if (b2 != i2) {
+ printf("string: %s: fail: $0 (%s) != $0 (%s)\n",
+ fun, b2, i2)
+ exit 1
+ }
+
+ fun = "substr"
+ b1 = substr("0xdeadbeef", 7, 4)
+ i1 = @fun("0xdeadbeef", 7, 4)
+ print_result("string", fun, b1, i1)
+
+ fun = "tolower"
+ b1 = tolower("0xDeAdBeEf")
+ i1 = @fun("0xDeAdBeEf")
+ print_result("string", fun, b1, i1)
+
+ fun = "toupper"
+ b1 = toupper("0xDeAdBeEf")
+ i1 = @fun("0xDeAdBeEf")
+ print_result("string", fun, b1, i1)
+
+# time functions
+
+ fun = "mktime"
+ b1 = mktime("1990 02 11 12 00 00")
+ i1 = @fun("1990 02 11 12 00 00")
+ print_result("time", fun, b1, i1)
+
+ then = b1
+ fun = "strftime"
+ b1 = strftime(PROCINFO["strftime"], then)
+ i1 = @fun(PROCINFO["strftime"], then)
+ print_result("time", fun, b1, i1)
+
+ fun = "systime"
+ b1 = systime()
+ i1 = @fun()
+ print_result("time", fun, b1, i1)
+
+# regexp functions
+
+ fun = "match"
+ b1 = match("o+", "fooob")
+ rstart = RSTART
+ rlength = RLENGTH
+ i1 = @fun("o+", "fooob")
+ print_result("regexp", fun, b1, i1)
+ if (rstart != RSTART) {
+ printf("match: failure: biRSTART (%d) != iRSTART (%d)\n",
+ rstart, RSTART)
+ exit 1
+ }
+ if (rlength != RLENGTH) {
+ printf("match: failure: biRLENGTH (%d) != iRLENGTH (%d)\n",
+ rlength, RLENGTH)
+ exit 1
+ }
+
+ ############## start patsplit ##############
+ fun = "patsplit"
+ delete data
+ delete data2
+ delete seps
+ delete seps2
+ b1 = patsplit("a:b:c:d", data, ":", seps)
+ i1 = @fun("a:b:c:d", data2, ":", seps2)
+ print_result("regexp", fun, b1, i1)
+ for (i in data) {
+ if ((! (i in data2)) || data[i] != data2[i]) {
+ printf("patsplit1a: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n",
+ i, data[i], i, data2[i])
+ exit 1
+ }
+ }
+ for (i in seps) {
+ if ((! (i in seps2)) || seps[i] != seps2[i]) {
+ printf("patsplit1b: fail: builtin seps[%d] (%s) != indirect seps[%d] (%s)\n",
+ i, seps[i], i, seps2[i])
+ exit 1
+ }
+ }
+
+ fun = "patsplit"
+ delete data
+ delete data2
+ b1 = patsplit("a:b:c:d", data, ":")
+ i1 = @fun("a:b:c:d", data2, ":")
+ print_result("regexp", fun, b1, i1)
+ for (i in data) {
+ if ((! (i in data2)) || data[i] != data2[i]) {
+ printf("patsplit2: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n",
+ i, data[i], i, data2[i])
+ exit 1
+ }
+ }
+
+ fun = "patsplit"
+ delete data
+ delete data2
+ FPAT = "[a-z]+"
+ b1 = patsplit("a b c d", data)
+ i1 = @fun("a b c d", data2)
+ print_result("regexp", fun, b1, i1)
+ for (i in data) {
+ if ((! (i in data2)) || data[i] != data2[i]) {
+ printf("patsplit3: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n",
+ i, data[i], i, data2[i])
+ exit 1
+ }
+ }
+ ############## end patsplit ##############
+
+ ############## start split ##############
+ fun = "split"
+ delete data
+ delete data2
+ delete seps
+ delete seps2
+ b1 = split("a:b:c:d", data, ":", seps)
+ i1 = @fun("a:b:c:d", data2, ":", seps2)
+ print_result("regexp", fun, b1, i1)
+ for (i in data) {
+ if ((! (i in data2)) || data[i] != data2[i]) {
+ printf("split1a: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n",
+ i, data[i], i, data2[i])
+ exit 1
+ }
+ }
+ for (i in seps) {
+ if ((! (i in seps2)) || seps[i] != seps2[i]) {
+ printf("split1b: fail: builtin seps[%d] (%s) != indirect seps[%d] (%s)\n",
+ i, seps[i], i, seps2[i])
+ exit 1
+ }
+ }
+
+ fun = "split"
+ delete data
+ delete data2
+ b1 = split("a:b:c:d", data, ":")
+ i1 = @fun("a:b:c:d", data2, ":")
+ print_result("regexp", fun, b1, i1)
+ for (i in data) {
+ if ((! (i in data2)) || data[i] != data2[i]) {
+ printf("split2: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n",
+ i, data[i], i, data2[i])
+ exit 1
+ }
+ }
+
+ fun = "split"
+ delete data
+ delete data2
+ b1 = split("a b c d", data)
+ i1 = @fun("a b c d", data2)
+ print_result("regexp", fun, b1, i1)
+ for (i in data) {
+ if ((! (i in data2)) || data[i] != data2[i]) {
+ printf("split3: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n",
+ i, data[i], i, data2[i])
+ exit 1
+ }
+ }
+ ############## end split ##############
+
+# array functions
+
+ split("z y x w v u t", data)
+ fun = "asort"
+ asort(data, newdata)
+ @fun(data, newdata2)
+ print_result("array", fun, b1, i1)
+ for (i in newdata) {
+ if (! (i in newdata2) || newdata[i] != newdata2[i]) {
+ print fun ": failed, index", i
+ exit
+ }
+ }
+
+ for (i in data)
+ data2[data[i]] = i
+
+ fun = "asorti"
+ asorti(data2, newdata)
+ @fun(data2, newdata2)
+ print_result("array", fun, b1, i1)
+ for (i in newdata) {
+ if (! (i in newdata2) || newdata[i] != newdata2[i]) {
+ print fun ": failed, index", i, "value", newdata[i], newdata2[i]
+ exit
+ }
+ }
+
+ arr[1] = arr[2] = 42
+ fun = "isarray"
+ b1 = isarray(arr)
+ i1 = @fun(arr)
+ print_result("array", fun, b1, i1)
+
+# i/o functions
+
+ print("hi") > "x1.out"
+ print("hi") > "x2.out"
+
+ fun = "fflush"
+ b1 = fflush("x1.out")
+ i1 = @fun("x2.out")
+ print_result("i/o", fun, b1, i1)
+
+ fun = "close"
+ b1 = close("x1.out")
+ i1 = @fun("x2.out")
+ print_result("i/o", fun, b1, i1)
+
+ fun = "system"
+ b1 = system("rm x1.out")
+ i1 = @fun("rm x2.out")
+ print_result("i/o", fun, b1, i1)
+}
diff --git a/test/indirectbuiltin.ok b/test/indirectbuiltin.ok
new file mode 100644
index 00000000..312bbd76
--- /dev/null
+++ b/test/indirectbuiltin.ok
@@ -0,0 +1,43 @@
+math: and: pass
+math: atan2: pass
+math: compl: pass
+math: cos: pass
+math: exp: pass
+math: int: pass
+math: log: pass
+math: lshift: pass
+math: or: pass
+math: rand: pass
+math: rshift: pass
+math: sin: pass
+math: sqrt: pass
+math: srand: pass
+math: xor: pass
+string: gensub: pass
+string: gsub: pass
+string: index: pass
+string: dcgettext: pass
+string: dcngettext: pass
+string: length: pass
+string: sprintf: pass
+string: strtonum: pass
+string: sub: pass
+string: substr: pass
+string: tolower: pass
+string: toupper: pass
+time: mktime: pass
+time: strftime: pass
+time: systime: pass
+regexp: match: pass
+regexp: patsplit: pass
+regexp: patsplit: pass
+regexp: patsplit: pass
+regexp: split: pass
+regexp: split: pass
+regexp: split: pass
+array: asort: pass
+array: asorti: pass
+array: isarray: pass
+i/o: fflush: pass
+i/o: close: pass
+i/o: system: pass
diff --git a/test/inplace1.ok b/test/inplace1.ok
index ffcb768d..82562235 100644
--- a/test/inplace1.ok
+++ b/test/inplace1.ok
@@ -1,5 +1,5 @@
before
-gawk: inplace:9: warning: inplace_begin: disabling in-place editing for invalid FILENAME `-'
+gawk: inplace:14: warning: inplace_begin: disabling in-place editing for invalid FILENAME `-'
stdin start
is bar replaced?
stdin end
diff --git a/test/inplace2.ok b/test/inplace2.ok
index ffcb768d..82562235 100644
--- a/test/inplace2.ok
+++ b/test/inplace2.ok
@@ -1,5 +1,5 @@
before
-gawk: inplace:9: warning: inplace_begin: disabling in-place editing for invalid FILENAME `-'
+gawk: inplace:14: warning: inplace_begin: disabling in-place editing for invalid FILENAME `-'
stdin start
is bar replaced?
stdin end
diff --git a/test/inplace3.ok b/test/inplace3.ok
index 7cd960bc..a7b7254f 100644
--- a/test/inplace3.ok
+++ b/test/inplace3.ok
@@ -1,11 +1,11 @@
before
-gawk: inplace:9: warning: inplace_begin: disabling in-place editing for invalid FILENAME `-'
+gawk: inplace:14: warning: inplace_begin: disabling in-place editing for invalid FILENAME `-'
stdin start
is bar replaced?
stdin end
after
Before
-gawk: inplace:9: warning: inplace_begin: disabling in-place editing for invalid FILENAME `-'
+gawk: inplace:14: warning: inplace_begin: disabling in-place editing for invalid FILENAME `-'
stdin start
is foo replaced?
stdin end
diff --git a/test/mbprintf4.awk b/test/mbprintf4.awk
index a4b2a218..1e436bca 100644
--- a/test/mbprintf4.awk
+++ b/test/mbprintf4.awk
@@ -1,32 +1,35 @@
# printf with multi-byte text encoding, %c and %s, width and precision, and left-alignment.
{
- print "printf %c " $0
- printf "|%c|\n", $0
- printf "|%1c|\n", $0
- printf "|%3c|\n", $0
+ count = 1
+
+ print NR, count++, "printf %c " $0
+ printf "%d:%d: |%c|\n", NR, count++, $0
+ printf "%d:%d: |%1c|\n", NR, count++, $0
+ printf "%d:%d: |%3c|\n", NR, count++, $0
# precision is ignored by %c.
- printf "|%3.1c|\n", $0
- printf "|%3.5c|\n", $0
- print "printf %-c " $0
- printf "|%-c|\n", $0
- printf "|%-1c|\n", $0
- printf "|%-3c|\n", $0
+ printf "%d:%d: |%3.1c|\n", NR, count++, $0
+ printf "%d:%d: |%3.5c|\n", NR, count++, $0
+ print NR, count++, "printf %-c " $0
+ printf "%d:%d: |%-c|\n", NR, count++, $0
+ printf "%d:%d: |%-1c|\n", NR, count++, $0
+ printf "%d:%d: |%-3c|\n", NR, count++, $0
# precision is ignored by %c.
- printf "|%-3.1c|\n", $0
- printf "|%-3.5c|\n", $0
+ printf "%d:%d: |%-3.1c|\n", NR, count++, $0
+ printf "%d:%d: |%-3.5c|\n", NR, count++, $0
printf ORS
- print "printf %s " $0
- printf "|%s|\n", $0
- printf "|%1s|\n", $0
- printf "|%3s|\n", $0
- printf "|%3.1s|\n", $0
- printf "|%3.5s|\n", $0
- print "printf %-s " $0
- printf "|%-s|\n", $0
- printf "|%-1s|\n", $0
- printf "|%-3s|\n", $0
- printf "|%-3.1s|\n", $0
- printf "|%-3.5s|\n", $0
+ print NR, count++, "printf %s " $0
+ printf "%d:%d: |%s|\n", NR, count++, $0
+ printf "%d:%d: |%1s|\n", NR, count++, $0
+ printf "%d:%d: |%3s|\n", NR, count++, $0
+ printf "%d:%d: |%3.1s|\n", NR, count++, $0
+ printf "%d:%d: |%3.5s|\n", NR, count++, $0
+
+ print NR, count++, "printf %-s " $0
+ printf "%d:%d: |%-s|\n", NR, count++, $0
+ printf "%d:%d: |%-1s|\n", NR, count++, $0
+ printf "%d:%d: |%-3s|\n", NR, count++, $0
+ printf "%d:%d: |%-3.1s|\n", NR, count++, $0
+ printf "%d:%d: |%-3.5s|\n", NR, count++, $0
printf ORS ORS
}
diff --git a/test/mbprintf4.ok b/test/mbprintf4.ok
index 9b9dd4e2..e32fe408 100644
--- a/test/mbprintf4.ok
+++ b/test/mbprintf4.ok
@@ -1,81 +1,81 @@
-printf %c ú
-|ú|
-|ú|
-| ú|
-| ú|
-| ú|
-printf %-c ú
-|ú|
-|ú|
-|ú |
-|ú |
-|ú |
+1 1 printf %c ú
+1:2: |ú|
+1:3: |ú|
+1:4: | ú|
+1:5: | ú|
+1:6: | ú|
+1 7 printf %-c ú
+1:8: |ú|
+1:9: |ú|
+1:10: |ú |
+1:11: |ú |
+1:12: |ú |
-printf %s ú
-|ú|
-|ú|
-| ú|
-| ú|
-| ú|
-printf %-s ú
-|ú|
-|ú|
-|ú |
-|ú |
-|ú |
+1 13 printf %s ú
+1:14: |ú|
+1:15: |ú|
+1:16: | ú|
+1:17: | ú|
+1:18: | ú|
+1 19 printf %-s ú
+1:20: |ú|
+1:21: |ú|
+1:22: |ú |
+1:23: |ú |
+1:24: |ú |
-printf %c último
-|ú|
-|ú|
-| ú|
-| ú|
-| ú|
-printf %-c último
-|ú|
-|ú|
-|ú |
-|ú |
-|ú |
+2 1 printf %c último
+2:2: |ú|
+2:3: |ú|
+2:4: | ú|
+2:5: | ú|
+2:6: | ú|
+2 7 printf %-c último
+2:8: |ú|
+2:9: |ú|
+2:10: |ú |
+2:11: |ú |
+2:12: |ú |
-printf %s último
-|último|
-|último|
-|último|
-| ú|
-|últim|
-printf %-s último
-|último|
-|último|
-|último|
-|ú |
-|últim|
+2 13 printf %s último
+2:14: |último|
+2:15: |último|
+2:16: |último|
+2:17: | ú|
+2:18: |últim|
+2 19 printf %-s último
+2:20: |último|
+2:21: |último|
+2:22: |último|
+2:23: |ú |
+2:24: |últim|
-printf %c áé
-|á|
-|á|
-| á|
-| á|
-| á|
-printf %-c áé
-|á|
-|á|
-|á |
-|á |
-|á |
+3 1 printf %c áé
+3:2: |á|
+3:3: |á|
+3:4: | á|
+3:5: | á|
+3:6: | á|
+3 7 printf %-c áé
+3:8: |á|
+3:9: |á|
+3:10: |á |
+3:11: |á |
+3:12: |á |
-printf %s áé
-|áé|
-|áé|
-| áé|
-| á|
-| áé|
-printf %-s áé
-|áé|
-|áé|
-|áé |
-|á |
-|áé |
+3 13 printf %s áé
+3:14: |áé|
+3:15: |áé|
+3:16: | áé|
+3:17: | á|
+3:18: | áé|
+3 19 printf %-s áé
+3:20: |áé|
+3:21: |áé|
+3:22: |áé |
+3:23: |á |
+3:24: |áé |
diff --git a/test/mpfrmemok1.awk b/test/mpfrmemok1.awk
new file mode 100644
index 00000000..9331a34d
--- /dev/null
+++ b/test/mpfrmemok1.awk
@@ -0,0 +1,7 @@
+# This program tests that -M works with profiling.
+# It does not do anything real, but there should not be glibc memory
+# errors and it should be valgrind-clean too.
+
+BEGIN {
+ v = 0x0100000000000000000000000000000000
+}
diff --git a/test/mpfrmemok1.ok b/test/mpfrmemok1.ok
new file mode 100644
index 00000000..2389a2d5
--- /dev/null
+++ b/test/mpfrmemok1.ok
@@ -0,0 +1,7 @@
+
+ # BEGIN rule(s)
+
+ BEGIN {
+ 1 v = 340282366920938463463374607431768211456
+ }
+
diff --git a/test/mpfrsqrt.awk b/test/mpfrsqrt.awk
index 23a15c92..3fb1f5f8 100644
--- a/test/mpfrsqrt.awk
+++ b/test/mpfrsqrt.awk
@@ -14,7 +14,7 @@ a=11111111111111111111111111111111111111111111111111111111111
print sqrt(a^2)
#print sq_root(a^2)
-# ADR: Added for gawk-4.1-stable which doesn't have built-in div() function
+# ADR: Added for gawk-4.1-stable which doesn't have built-in intdiv() function
if (PROCINFO["version"] < "4.1.60")
print sq_root2(a^2)
else
@@ -27,9 +27,9 @@ function sq_root(x, temp,r,z)
z=0
while (abs(z-temp)>1)
{ z=temp
- div(x,temp,r)
+ intdiv(x,temp,r)
temp=r["quotient"] + temp
- div(temp,2,r)
+ intdiv(temp,2,r)
temp=r["quotient"]
}
return temp
diff --git a/test/nonfatal1.awk b/test/nonfatal1.awk
new file mode 100644
index 00000000..a9228f3a
--- /dev/null
+++ b/test/nonfatal1.awk
@@ -0,0 +1,6 @@
+BEGIN {
+ PROCINFO["NONFATAL"]
+ # note that ":" is not a valid hostname character
+ print |& "/inet/tcp/0/local:host/25"
+ print (ERRNO != "")
+}
diff --git a/test/nonfatal1.ok b/test/nonfatal1.ok
new file mode 100644
index 00000000..51583f2c
--- /dev/null
+++ b/test/nonfatal1.ok
@@ -0,0 +1,2 @@
+gawk: nonfatal1.awk:4: warning: remote host and port information (local:host, 25) invalid
+1
diff --git a/test/nonfatal2.awk b/test/nonfatal2.awk
new file mode 100644
index 00000000..fedbba43
--- /dev/null
+++ b/test/nonfatal2.awk
@@ -0,0 +1,5 @@
+BEGIN {
+ PROCINFO["NONFATAL"] = 1
+ print > "/dev/no/such/file"
+ print ERRNO
+}
diff --git a/test/nonfatal2.ok b/test/nonfatal2.ok
new file mode 100644
index 00000000..ddc88691
--- /dev/null
+++ b/test/nonfatal2.ok
@@ -0,0 +1 @@
+No such file or directory
diff --git a/test/nonfatal3.awk b/test/nonfatal3.awk
new file mode 100644
index 00000000..b2a4ec9e
--- /dev/null
+++ b/test/nonfatal3.awk
@@ -0,0 +1,6 @@
+BEGIN {
+ PROCINFO["NONFATAL"]
+ # valid host but bogus port
+ print |& "/inet/tcp/0/localhost/0"
+ print ERRNO != ""
+}
diff --git a/test/nonfatal3.ok b/test/nonfatal3.ok
new file mode 100644
index 00000000..d00491fd
--- /dev/null
+++ b/test/nonfatal3.ok
@@ -0,0 +1 @@
+1
diff --git a/test/ofs1.awk b/test/ofs1.awk
index 83b3c2a5..83b3c2a5 100755..100644
--- a/test/ofs1.awk
+++ b/test/ofs1.awk
diff --git a/test/paramasfunc1.awk b/test/paramasfunc1.awk
new file mode 100644
index 00000000..b0d06849
--- /dev/null
+++ b/test/paramasfunc1.awk
@@ -0,0 +1,9 @@
+BEGIN{ X() }
+
+function X( abc)
+{
+ abc = "stamp out "
+ print abc abc()
+}
+
+function abc() { return "dark corners" }
diff --git a/test/paramasfunc1.ok b/test/paramasfunc1.ok
new file mode 100644
index 00000000..9ee95116
--- /dev/null
+++ b/test/paramasfunc1.ok
@@ -0,0 +1,3 @@
+gawk: paramasfunc1.awk:6: error: attempt to use non-function `abc' in function call
+gawk: error: function `X': can't use function `abc' as a parameter name
+EXIT CODE: 1
diff --git a/test/paramasfunc2.awk b/test/paramasfunc2.awk
new file mode 100644
index 00000000..849b3d1b
--- /dev/null
+++ b/test/paramasfunc2.awk
@@ -0,0 +1,10 @@
+BEGIN{ X() }
+
+function abc() { return "dark corners" }
+
+function X( abc)
+{
+ abc = "stamp out "
+ print abc abc()
+}
+
diff --git a/test/paramasfunc2.ok b/test/paramasfunc2.ok
new file mode 100644
index 00000000..2cdf4f66
--- /dev/null
+++ b/test/paramasfunc2.ok
@@ -0,0 +1,3 @@
+gawk: paramasfunc2.awk:8: error: attempt to use non-function `abc' in function call
+gawk: error: function `X': can't use function `abc' as a parameter name
+EXIT CODE: 1
diff --git a/test/printfbad4.awk b/test/printfbad4.awk
new file mode 100644
index 00000000..dd9220ae
--- /dev/null
+++ b/test/printfbad4.awk
@@ -0,0 +1,5 @@
+BEGIN {
+ for (i = 1; i <= 10; i++) {
+ printf "%03$*d %2$d \n", 4, 5, i
+ }
+}
diff --git a/test/printfbad4.ok b/test/printfbad4.ok
new file mode 100644
index 00000000..71eed3d6
--- /dev/null
+++ b/test/printfbad4.ok
@@ -0,0 +1,2 @@
+gawk: printfbad4.awk:3: fatal: fatal: must use `count$' on all formats or none
+EXIT CODE: 2
diff --git a/test/profile0.awk b/test/profile0.awk
new file mode 100644
index 00000000..a42e94df
--- /dev/null
+++ b/test/profile0.awk
@@ -0,0 +1 @@
+NR == 1
diff --git a/test/profile0.in b/test/profile0.in
new file mode 100644
index 00000000..7bba8c8e
--- /dev/null
+++ b/test/profile0.in
@@ -0,0 +1,2 @@
+line 1
+line 2
diff --git a/test/profile0.ok b/test/profile0.ok
new file mode 100644
index 00000000..2e3c5728
--- /dev/null
+++ b/test/profile0.ok
@@ -0,0 +1,6 @@
+ # Rule(s)
+
+ 2 NR == 1 { # 1
+ 1 print $0
+ }
+
diff --git a/test/profile5.ok b/test/profile5.ok
index 4c944627..5bf04dcf 100644
--- a/test/profile5.ok
+++ b/test/profile5.ok
@@ -2,8 +2,7 @@ BEGIN {
_addlib("_BASE")
}
-############################################################################
-
+#___________________________________________________________________________________
BEGIN {
BINMODE = "rw"
SUBSEP = "\000"
@@ -24,8 +23,7 @@ BEGIN {
_addlib("_INSTRUC")
}
-#############################################################################
-
+#___________________________________________________________________________________
BEGIN {
_delay_perfmsdelay = 11500
}
@@ -38,19 +36,11 @@ BEGIN {
BEGIN {
}
-###########################################################################
-
-
-
-
-
-
-BEGIN {
+BEGIN { ###########################################################################
_addlib("_EXTFN")
}
-#############################################################################
-
+#___________________________________________________________________________________
BEGIN {
delete _XCHR
delete _ASC
@@ -78,7 +68,6 @@ BEGIN {
_QSTR[_CHR[i]] = _QSTRQ[_CHR[i]]
}
_QSTR["\\"] = "\\\\"
- #; _QSTR["\""]="\\\""
#_____________________________________________________________________________
_CHR["CR"] = "\r"
@@ -117,8 +106,7 @@ BEGIN {
_addlib("_SYSIO")
}
-#############################################################################
-
+#___________________________________________________________________________________
BEGIN {
_SYS_STDCON = "CON"
_CON_WIDTH = (match(_cmd("MODE " _SYS_STDCON " 2>NUL"), /Columns:[ \t]*([0-9]+)/, A) ? strtonum(A[1]) : 80)
@@ -128,8 +116,7 @@ BEGIN {
_addlib("_FILEIO")
}
-#############################################################################
-
+#___________________________________________________________________________________
BEGIN {
if (_SYS_STDOUT == "") {
_SYS_STDOUT = "/dev/stdout"
@@ -151,7 +138,7 @@ BEGIN {
_addlib("_tOBJ")
}
-#############################################################################
+#___________________________________________________________________________________
BEGIN {
_tInBy = "\212._tInBy"
_tgenuid_init()
@@ -183,8 +170,7 @@ BEGIN {
_addlib("_ERRLOG")
}
-#############################################################################
-
+#___________________________________________________________________________________
BEGIN {
if (_gawk_scriptlevel < 1) {
_ERRLOG_TF = 1
@@ -206,11 +192,7 @@ BEGIN {
_shortcut_init()
}
-#########################################################
-
-
-
-BEGIN {
+BEGIN { #########################################################
_addlib("_eXTFN")
}
@@ -219,10 +201,7 @@ BEGIN {
_extfn_init()
}
-############################################################
-
-
-BEGIN {
+BEGIN { ############################################################
_addlib("_sHARE")
}
@@ -231,9 +210,7 @@ BEGIN {
}
BEGIN {
- _addlib("_DS")
- ###############################################################################
-
+ _addlib("_DS") ###############################################################################
_PRODUCT_NAME = "Deployment Solution Control"
_PRODUCT_VERSION = "1.0"
_PRODUCT_COPYRIGHT = "Copyright (C) 2013 by CosumoGEN"
@@ -300,7 +277,29 @@ BEGIN {
_initsys()
}
-############################################################################
+#_________________________________________________________________________________________
+##########################################################################################
+
+
+
+
+
+
+
+#BootDevice BuildNumber BuildType Caption CodeSet CountryCode CreationClassName CSCreationClassName CSDVersion CSName CurrentTimeZone DataExecutionPrevention_32BitApplications DataExecutionPrevention_Available DataExecutionPrevention_Drivers DataExecutionPrevention_SupportPolicy Debug Description Distributed EncryptionLevel ForegroundApplicationBoost FreePhysicalMemory FreeSpaceInPagingFiles FreeVirtualMemory InstallDate LargeSystemCache LastBootUpTime LocalDateTime Locale Manufacturer MaxNumberOfProcesses MaxProcessMemorySize MUILanguages Name NumberOfLicensedUsers NumberOfProcesses NumberOfUsers OperatingSystemSKU Organization OSArchitecture OSLanguage OSProductSuite OSType OtherTypeDescription PAEEnabled PlusProductID PlusVersionNumber Primary ProductType RegisteredUser SerialNumber ServicePackMajorVersion ServicePackMinorVersion SizeStoredInPagingFiles Status SuiteMask SystemDevice SystemDirectory SystemDrive TotalSwapSpaceSize TotalVirtualMemorySize TotalVisibleMemorySize Version WindowsDirectory
+#\Device\HarddiskVolume1 7601 Multiprocessor Free Microsoft Windows Server 2008 R2 Enterprise 1252 1 Win32_OperatingSystem Win32_ComputerSystem Service Pack 1 CPU 180 TRUE TRUE TRUE 3 FALSE FALSE 256 0 6925316 33518716 41134632 20110502192745.000000+180 20130426120425.497469+180 20130510134606.932000+180 0409 Microsoft Corporation -1 8589934464 {"en-US"} Microsoft Windows Server 2008 R2 Enterprise |C:\Windows|\Device\Harddisk0\Partition2 0 116 2 10 64-bit 1033 274 18 TRUE 3 Windows User 55041-507-2389175-84833 1 0 33554432 OK 274 \Device\HarddiskVolume2 C:\Windows\system32 C: 50311020 16758448 6.1.7601 C:\Windows
+
+
+
+
+
+
+
+
+
+
+
+
BEGIN {
a = ENVIRON["EGAWK_CMDLINE"]
@@ -321,13 +320,43 @@ BEGIN {
_END()
}
-########################################################################
-
+#_____________________________________________________________________________
END {
_EXIT()
}
-###############################################################################
+#_______________________________________________________________________
+########################################################################
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
END {
if (_gawk_scriptlevel < 1) {
@@ -339,8 +368,17 @@ END {
}
}
-###############################################################################
-
+##########################################################################################
+# PUBLIC:
+#_____________________________________________________________________________
+# _rFBRO(ptr) - Return ptr of first-bro. [TESTED]
+# If !ptr then returns "".
+#_____________________________________________________________________________
+# _rLBRO(ptr) - Return ptr of last-bro. [TESTED]
+# If !ptr then returns "".
+#_____________________________________________________________________________
+# _rQBRO(ptr) - Returns brothers total quantity. [TESTED]
+# If !ptr then returns "".
END {
if (_gawk_scriptlevel < 1) {
if (! _fileio_notdeltmpflag) {
@@ -350,7 +388,297 @@ END {
}
}
-###############################################################################
+#___________________________________________________________________________________
+####################################################################################
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#___________________________________________________________________________________
+# fn _dirtree(array,pathmask)
+#
+# Return in `array' file tree from pathmask:
+# array["file.filerdne"]="size date time"
+# array["subdir.filerd"]["file.filerdne"]="size date time"
+# array["subdir.filerd"]["file.filerd"][...]
+#
+# The array will be cleared before any action. Function return pathmask w/o ltabspc and rtabspc.
+#___________________________________________________________________________________
+
+
+
+
+
+# OK: change internal function's names to: w\o "_"
+# OK: FLENGTH: should cover r-spcs
+# OK: optimize REXP
+# OK: add new symbols to dir/file names ( ! and + )
+# OK: create _getfilepath()
+# OK: del - conflict with WROOTDIR (do not update it)
+# OK: dir/del - support for filemask ( * and ? )
+# OK: how to define code injections: header\ender; and HANDLERS
+# OK: units in header\ender? conline division...
+# OK: _FILEPATH problem: it will not been defined at the moment when subscript0 starts - at the start TMPRD="_tmp"
+# OK: del: if del("dir\\") - then all ok except it NOT deleted "dir\\" - _del function removed(renamed to __del)
+# OK: tmpdirs: it delete only autotmp dir and only from script0
+# OK: MICROTEST: global testing of filepath (UNC! CORRECT RESULTS! )
+# question about cache: did new just now generated absolute filepath cached in FILECACHE? its seems like NO
+# check _untmp: CONFLICT: if file or dir from autotmp dir will be untmp then it anyway will be deleted; but file or dir from other point never be deleted anyway - so what is the point of untmp?????
+#ERRLOG: _setmpath: warning!!!!!
+
+#___________________________________________________________________________________
+####################################################################################
+# PUBLIC:
+#___________________________________________________________________________________
+#
+# fn _rdfile(_filepath)
+#
+# Read and return data from file specified in _filepath.
+# If _filepath=="" then no action occured and return "".
+# Function read and return data from file. No any changes in data occured.
+# Function use _filerdne function internally. If some syntax error
+# found in _filepath then function return "".
+# If some error occured while reading data from file then fuction return ""
+# and error-text is in ERRNO(and no close-file action will be occured!).
+# If reading data completed successfully then function try to close
+# file and if while closing file some error occured then function
+# returns "" and error-text is in ERRNO.
+# Otherwise function returns readed data.
+#_____________________________________________________________________________
+#
+# fn _wrfile(_filepath,_data)
+#
+# Write data into file specified in _filepath.
+# If _filepath=="" then no action occured and return "".
+# Function write _data to file. No any changes in data occured.
+# Function use _filerdne function internally. If some syntax error
+# found in _filepath then function return "".
+# If some error occured while writing data to file then fuction return ""
+# and error-text is in ERRNO(and no close-file action will be occured!).
+# If writing data completed successfully then function try to close
+# file and if while closing file some error occured then function
+# returns "" and error-text is in ERRNO.
+# Otherwise function returns _filepath(re-processed).
+#___________________________________________________________________________________
+#
+# fn _filepath(_filepath)
+#
+# Return re-processed root-dir-name-ext of _filepath.
+# If _filepath=="" then no action occured and return "".
+# If some syntax error found in _filepath then function return ""
+# (and NO _filepath-cache-record will be created!).
+#_____________________________________________________________________________
+#
+# fn _filerdne(_filepath)
+#
+# Return re-processed root-dir-filename of _filepath.
+# If _filepath=="" then no action occured and return "".
+# Function return result only if in _filepath present file-name(name
+# and/or extension) - otherwise its return "".
+# If some syntax error found in _filepath then function return ""
+# (and NO _filepath-cache-record will be created!).
+#_____________________________________________________________________________
+#
+# fn _filerdn(_filepath)
+#
+# Return re-processed root-dir-name of _filepath.
+# If _filepath=="" then no action occured and return "".
+# Function return result only if in _filepath present name field -
+# - otherwise its return "".
+# If some syntax error found in _filepath then function return ""
+# (and NO _filepath-cache-record will be created!).
+#_____________________________________________________________________________
+#
+# fn _filerd(_filepath)
+#
+# Return re-processed root-dir of _filepath.
+# If _filepath=="" then no action occured and return "".
+# If some syntax error found in _filepath then function return ""
+# (and NO _filepath-cache-record will be created!).
+#_____________________________________________________________________________
+#
+# fn _filer(_filepath)
+#
+# Return re-processed root of _filepath.
+# If _filepath=="" then no action occured and return "".
+# If some syntax error found in _filepath then function return ""
+# (and NO _filepath-cache-record will be created!).
+#_____________________________________________________________________________
+#
+# fn _filed(_filepath)
+#
+# Return re-processed dir of _filepath.
+# If _filepath=="" then no action occured and return "".
+# There is only one case when dir string can be =="" - when in
+# _filepath specified unmounted drive(MS-format) and from-
+# current-location address used(like Z:file.ext). In this
+# case no rootdir-cache-record will be created.
+# If some syntax error found in _filepath then function return ""
+# (and NO _filepath-cache-record will be created!).
+#_____________________________________________________________________________
+# fn _filene(_filepath)
+#
+# Return re-processed name-ext of _filepath.
+# If _filepath=="" then no action occured and return "".
+# Function return result only if in _filepath present file-name(name
+# and/or extension) - otherwise its return "".
+# If some syntax error found in _filepath then function return ""
+# (and NO _filepath-cache-record will be created!).
+#_____________________________________________________________________________
+#
+# fn _filen(_filepath)
+#
+# Return re-processed name of _filepath.
+# If _filepath=="" then no action occured and return "".
+# Function return result only if in _filepath present name field -
+# - otherwise its return "".
+# If some syntax error found in _filepath then function return ""
+# (and NO _filepath-cache-record will be created!).
+#_____________________________________________________________________________
+#
+# fn _file(_filepath)
+#
+# Return re-processed ext of _filepath.
+# If _filepath=="" then no action occured and return "".
+# Function return result only if in _filepath present ext field -
+# - otherwise its return "".
+# If some syntax error found in _filepath then function return ""
+# (and NO _filepath-cache-record will be created!).
+#___________________________________________________________________________________
+#
+# fn _dir(_ARR,_filepathmask)
+#
+# Get file-/folder-list of root-folder of _filepathmask.
+# If _filepathmask=="" then no action occured and return "".
+# _filepathmask can contain symbols like `*' and `?' as like
+# its used in `dir'-shell command.
+# Function gets file-/folder-list of specified root-dir-_filepathmask
+# and return this list in array _ARR - where each element:
+#
+# index - is the _filepath of file-or-folder name-ext
+# value - contains 3 fields separated by " ":
+# 1. =="D" if this is folder
+# ==/[0-9]+/ if this is file - size of file in bytes
+# 2. ==date-of-creation of file or folder
+# 3. ==time-of-creation of file or folder
+#
+# Function returns quantity of items in ARR.
+#___________________________________________________________________________________
+#
+# fn _filexist(_filepath)
+#
+# Test if file or path or drive specified in _filepath is exist.
+# If _filepath=="" then no action occured and return "".
+# If some syntax error found in _filepath then function return ""
+# (and NO _filepath-cache-record will be created!).
+# Function returns _filepath if _filepath is exist. Otherwise
+# function return 0.
+#_____________________________________________________________________________
+#
+# fn _filenotexist(_filepath)
+#
+# Test if file or path or drive specified in _filepath is not exist.
+# If _filepath=="" then no action occured and return "".
+# If some syntax error found in _filepath then function return ""
+# (and NO _filepath-cache-record will be created!).
+# Function returns 1 if _filepath is not exist. Otherwise function
+# return 0.
+#_____________________________________________________________________________
+#
+# fn _newdir(_filepath)
+#
+# Create path specified in root-dir-_filepath.
+# If _filepath=="" then no action occured and return "".
+# If some syntax error found in _filepath then function return ""
+# (and NO _filepath-cache-record will be created!).
+# Function returns root-dir of _filepath.
+#_______________________________________________________________________
+#
+# fn _newdir(_filepath)
+#
+# Create path specified in root-dir-_filepath. If this folder
+# already exist then it will be completely cleared.
+# If _filepath=="" then no action occured and return "".
+# If some syntax error found in _filepath then function return ""
+# (and NO _filepath-cache-record will be created!).
+# Function returns root-dir of _filepath.
+#___________________________________________________________________________________
+#
+# fn _getmpfile(_filepath,_currfilepath)
+#
+# Return ....
+#
+#_____________________________________________________________________________
+#
+# fn _getmpdir(_filepath,_currfilepath)
+#
+# Return ...
+#
+#_____________________________________________________________________________
+#
+# Temporary files folder.
+#
+# Temporary files folder location is defined by _FILEIO_TMPRD.
+# If it wasn't been initialized before program run or not been initialized
+# by ENVIRON["TMPDIR"] then it will defined as the:
+# `current rootdir(stored in _FILEIO_RD)\programname.TMP'
+# In this case if its already exist then it will completely cleared when _FILEIO
+# library initialization processed.
+# And at the program uninitialization processed it will completely
+# cleared if _FILEIO_TMPCLRFLAG is true.
+#___________________________________________________________________________________
+#
+# var _FILEIO_RD (ENVIRON["CD"])
+#
+# This var can be set before running program. It can contain path which
+# will be used as default current dir while program run.
+# If this var is set before program runs - then it will be refreshed by the
+# _filerd it will be used as default current dir while program run.
+# If this var is not set before program runs - then ENVIRON["CD"] can also
+# set up default current dir while program run. If it set before program
+# begin then it will be refreshed by the _filerd - and also writed into
+# _FILEIO_RD.
+# If both _FILEIO_RD and ENVIRON["CD"] are not set before program begins
+# then real current root\dir will be writed into both _FILEIO_RD and
+# ENVIRON["CD"] and it will be used as default current dir while program run.
+#
+#___________________________________________________________________________________
+#
+# var _FILEIO_TMPRD (ENVIRON["TMPRD"])
+#
+# This var can be set before running program. It can contain path which
+# will be used as default temporary files root-folder while program run.
+# If this var is set before program runs - then it will be refreshed by the
+# _filerd - and also writed into ENVIRON["TMPRD"].
+# If this var is not set before program runs - then ENVIRON["TMPRD"] can also
+# set up default temporary files root-folder while program run. If it set
+# before program begin then it will be refreshed by the _filerd - and
+# also writed into _FILEIO_TMPRD.
+# If both _FILEIO_TMPRD and ENVIRON["TMPRD"] are not set before program begins
+# then new folder into path specified by the _FILEIO_RD(after its handling)
+# will be writed into both _FILEIO_TMPRD and ENVIRON["TMPRD"] and it
+# will be used as default temporary files root-folder while program run.
+#___________________________________________________________________________________
+#
+# var _FILEPATH
+#
+# This var contain filepath of working script. It should be setting up externally.
+#
+# var _gawk_scriptlevel
+#___________________________________________________________________________________
+####################################################################################
END {
if (_constatstrln > 0) {
_constat()
@@ -376,7 +704,6 @@ END {
#_______________________________________________________________________
function W(p, p0, p1)
{
- #####################################################
if (isarray(p0)) {
delete p0[p]
if (isarray(p1)) {
@@ -410,7 +737,6 @@ function W(p, p0, p1)
}
##########################################################
-
function _ARR(c, t, P)
{
switch (c) {
@@ -440,7 +766,6 @@ function _ARR(c, t, P)
}
##########################################################
-
function _BASE(c, t, P, A)
{
switch (c) {
@@ -494,7 +819,6 @@ function _BASE(c, t, P, A)
#____________________________________________________________________________
function _DS(c, t, P, a, A)
{
- ######################################################
switch (c) {
case "_lib_CMDLN":
#___________________________________________________________
@@ -520,12 +844,9 @@ function _DS(c, t, P, a, A)
#______________________________________________________________________________________________
function _END()
{
- #################################################################################
-
}
########################################################
-
function _ERRLOG(c, t, P, a, b, A)
{
switch (c) {
@@ -597,12 +918,9 @@ function _ERRLOG(c, t, P, a, b, A)
#______________________________________________________________________________________________
function _EXIT()
{
- ################################################################################
-
}
########################################################
-
function _EXTFN(c, t, P)
{
switch (c) {
@@ -632,7 +950,6 @@ function _EXTFN(c, t, P)
}
#######################################################
-
function _FILEIO(c, t, P, A)
{
switch (c) {
@@ -679,11 +996,9 @@ function _FILEIO(c, t, P, A)
}
}
-############################################################
#_____________________________________________________________________________
function _FILEVER(c, t, P, a, A)
{
- #################################################
switch (c) {
case "_lib_CMDLN":
#___________________________________________________________
@@ -720,13 +1035,10 @@ function _INIT(f)
#___________________________________________________________________________________
function _INITBASE()
{
- ################################################################
-
_egawk_utilpath = ENVIRON["EGAWK_PATH"] "BIN\\UTIL\\"
}
######################################################
-
function _INSTRUC(c, t, P)
{
switch (c) {
@@ -764,7 +1076,6 @@ function _INSTRUC(c, t, P)
#_____________________________________________________________________________
function _N(F, v, p)
{
- ###########################################################
for (p in _UIDS) {
delete _UIDS[p]
return _nN_i0(p, F, v)
@@ -773,7 +1084,6 @@ function _N(F, v, p)
}
#####################################################
-
function _SHORTCUT(c, t, P)
{
switch (c) {
@@ -805,7 +1115,6 @@ function _SHORTCUT(c, t, P)
#______________________________________________________________________________________________
function _START(t, i, A)
{
- #########################################################################
_torexp_init()
test_uid()
return
@@ -915,7 +1224,6 @@ function _START(t, i, A)
}
#########################################################
-
function _SYSIO(c, t, P)
{
switch (c) {
@@ -969,7 +1277,6 @@ function _W(p, A, v)
#_______________________________________________________________________
function _Zexparr(S, s, t, i)
{
- ##############################################
t = ""
if (isarray(S)) {
for (i in S) {
@@ -1021,7 +1328,6 @@ function _Zexparr_i3(t)
#_______________________________________________________________________
function _Zimparr(D, t, A, B)
{
- ##############################################
if (isarray(D)) {
split(t, A, /\x10/, B)
t = _Zimparr_i0(A, B, _Zimparr_i1(D, A, B, 1))
@@ -1072,7 +1378,6 @@ function _Zimparr_i2(t)
#_____________________________________________________________________________
function _Zimport(t, p, A, c, i, n, B)
{
- ##############################################
if (p) {
c = split(t, B, /\x0A/)
for (i = 1; i <= c; i++) {
@@ -1147,7 +1452,6 @@ function _accmpu(A, a, n)
#_______________________________________________________________________
function _add(S, sf, D, df)
{
- ################################################
if (sf in S) {
if (isarray(S[sf])) {
if (df in D) {
@@ -1171,7 +1475,6 @@ function _add(S, sf, D, df)
#_________________________________________________________________
function _addarr(D, S)
{
- #############################################
if (isarray(S)) {
_addarr_i0(D, S)
}
@@ -1196,7 +1499,6 @@ function _addarr_i0(D, S, i)
#_______________________________________________________________________
function _addarrmask(D, S, M)
{
- #############################################
for (_addarrmaski0 in M) {
if (_addarrmaski0 in S) {
if (isarray(S[_addarrmaski0])) {
@@ -1229,14 +1531,12 @@ function _addarrmask(D, S, M)
#_______________________________________________________________________
function _addf(A, f)
{
- #####################################################
A["B"][""] = A["F"][A["B"][f] = A["B"][""]] = f
}
#___________________________________________________________
function _addfile(f, d, a, b)
{
- ##################################
if ((f = _wfilerdnehnd(f)) == "" || _filene(f) == "") {
ERRNO = "Filename error"
return
@@ -1262,7 +1562,6 @@ function _addfile(f, d, a, b)
#_____________________________________________________________________________
function _addlib(f)
{
- ###########################################################
_addf(_LIBAPI, f)
}
@@ -1273,15 +1572,12 @@ function _addlib(f)
#_______________________________________________________________________
function _addlist(A, v)
{
- ##################################################
A[++A[0]] = v
}
-############################################
#_______________________________________________________________________
function _bearray(A)
{
- ####################################################
if (isarray(A) || A == 0 && A == "") {
return 1
}
@@ -1290,7 +1586,6 @@ function _bearray(A)
#_________________________________________________________________
function _bframe(A, t, p)
{
- ###########################################
return _bframe_i0(A, t, p, A[""])
}
@@ -1322,7 +1617,6 @@ function _bframe_i0(A, t, p, f)
#_______________________________________________________________________
function _cfguid(p, optr, pfx, sfx, hstrcnt, lstrchr)
{
- #################### 0 #
delete _UIDOBL[p]
if (_isptr(optr)) {
if (optr == p) {
@@ -1391,7 +1685,6 @@ function _cfguidl(p, H, L, hi, h, hl, li)
#____________________________________________________________________________________________________
function _check(p)
{
- ####################################################################################
_dll_check(p)
_file_check(p)
_serv_check(p)
@@ -1401,14 +1694,12 @@ function _check(p)
#_______________________________________________________________________
function _chrline(t, ts, w, s)
{
- #############################################
return ((t = " " _tabtospc(t, ts) ((t ? (t ~ /[ \t]$/ ? "" : " ") : ""))) _getchrln((s ? s : "_"), ((w ? w : _CON_WIDTH - 1)) - length(t)) _CHR["EOL"])
}
#_____________________________________________________________________________
function _cmd(c, i, A)
{
- #######################################################
_fio_cmda = RS
RS = ".{1,}"
_fio_cmdb = BINMODE
@@ -1426,7 +1717,6 @@ function _cmd(c, i, A)
#_______________________________________________________________________
function _cmparr(A0, A1, R, a, i)
{
- ##########################################
a = 0
delete R
for (i in A0) {
@@ -1452,7 +1742,6 @@ function _cmparr(A0, A1, R, a, i)
#_____________________________________________________________________________
function _con(t, ts, a, b, c, d, i, r, A, B)
{
- ##########################################
d = RLENGTH
if ((c = split(r = t, A, /\x0D?\x0A/, B)) > 0) {
a = BINMODE
@@ -1494,7 +1783,6 @@ function _con(t, ts, a, b, c, d, i, r, A, B)
#_______________________________________________________________________
function _conin(t, a, b)
{
- #################################################
_constatpush()
_constat()
a = BINMODE
@@ -1516,14 +1804,12 @@ function _conin(t, a, b)
#_______________________________________________________________________
function _conl(t, ts)
{
- ####################################################
return _con(t ((t ~ /\x0A$/ ? "" : _CHR["EOL"])), ts)
}
#_______________________________________________________________________
function _conline(t, ts)
{
- #################################################
return _con(_chrline(t, ts))
}
@@ -1540,7 +1826,6 @@ function _conlq(t, ts)
#_______________________________________________________________________
function _constat(t, ts, ln, a)
{
- ###########################################
if (_constatstrln > (ln = length(t = _constatgtstr(_constatstr = _tabtospc(t, ts), _CON_WIDTH - 1 - _conlastrln)))) {
t = t _getchrln(" ", _constatstrln - ln)
}
@@ -1577,7 +1862,6 @@ function _constatgtstr(t, ln, a, b)
#_______________________________________________________________________
function _constatpop()
{
- ##################################################
if (_CONSTATPUSH[0] > 0) {
return _constat(_CONSTATPUSH[_CONSTATPUSH[0]--])
}
@@ -1587,7 +1871,6 @@ function _constatpop()
#_______________________________________________________________________
function _constatpush(t, ts)
{
- #############################################
_CONSTATPUSH[++_CONSTATPUSH[0]] = _constatstr
if (t) {
_constat(t, ts)
@@ -1604,7 +1887,6 @@ function _creport(p, t, f, z)
#_________________________________________________________________________________________
function _defdir(pp, n, f, v, p)
{
- #############################################################
_[p = _wLCHLD(pp, _n("TYPE", "defdir"))]["NAME"] = n
_[p]["DIR"] = f
return p
@@ -1613,7 +1895,6 @@ function _defdir(pp, n, f, v, p)
#_________________________________________________________________________________________
function _defdll(pp, n, rn, p)
{
- ##############################################################
_[p = _wLCHLD(pp, _n("TYPE", "defdll"))]["NAME"] = n
_[p]["REGPATH"] = _[pp]["REGPATH"] rn
_[p]["ERRHOST"] = pp
@@ -1654,7 +1935,6 @@ function _defescarr(D, r, S, i, c, t)
#_________________________________________________________________________________________
function _defile(pp, n, f, v, p)
{
- #############################################################
_[p = _wLCHLD(pp, _n("TYPE", "defile"))]["NAME"] = n
_[p]["FILE"] = f
if (! (v == 0 && v == "")) {
@@ -1666,14 +1946,12 @@ function _defile(pp, n, f, v, p)
#_______________________________________________________________________
function _defn(f, c, v)
{
- ###################################################
FUNCTAB[c f] = v
}
#_________________________________________________________________________________________
function _defreg(pp, n, f, v, p)
{
- #############################################################
_[p = _wLCHLD(pp, _n("TYPE", "defreg"))]["NAME"] = n
_[p]["REGPATH"] = f
if (! (v == 0 && v == "")) {
@@ -1684,7 +1962,6 @@ function _defreg(pp, n, f, v, p)
#_______________________________________________________________________________________________
function _defsolution(pp, n, rn, p)
{
- ###############################################################
_[p = _wLCHLD(pp, _n("TYPE", "solution"))]["NAME"] = n
_[p]["REGPATH"] = rn
_[p]["ERRHOST"] = pp
@@ -1694,7 +1971,6 @@ function _defsolution(pp, n, rn, p)
#_________________________________________________________________________________________
function _defsrv(pp, n, f, v, p)
{
- #############################################################
_[p = _wLCHLD(pp, _n("TYPE", "defsrv"))]["NAME"] = n
_[p]["SERVNAME"] = f
return p
@@ -1703,7 +1979,6 @@ function _defsrv(pp, n, f, v, p)
#_______________________________________________________________________
function _del(f, c, a, A)
{
- #################################################
if (match(f, /\\[ \t]*$/)) {
if ((c = toupper(_filerd(f))) && length(f) == FLENGTH) {
_cmd("rd " c " /S /Q 2>NUL")
@@ -1732,7 +2007,6 @@ function _del(f, c, a, A)
#_______________________________________________________________________
function _delay(t, a)
{
- ###################################################
for (a = 1; a <= t; a++) {
_delayms()
}
@@ -1741,7 +2015,6 @@ function _delay(t, a)
#_________________________________________________________________
function _delayms(a)
{
- #############################################
for (a = 1; a <= _delay_perfmsdelay; a++) {
}
}
@@ -1749,7 +2022,6 @@ function _delayms(a)
#_______________________________________________________________________
function _deletepfx(A, f, B, le, i)
{
- ########################################
le = length(f)
for (i in A) {
if (substr(toupper(i), 1, le) == f) {
@@ -1762,7 +2034,6 @@ function _deletepfx(A, f, B, le, i)
#_________________________________________________________________
function _delf(A, f)
{
- ###############################################
A["B"][A["F"][A["B"][f]] = A["F"][f]] = A["B"][f]
delete A["F"][f]
delete A["B"][f]
@@ -1771,7 +2042,6 @@ function _delf(A, f)
#_______________________________________________________________________
function _deluid(p)
{
- ################################################# 1 #
if (p in _CLASSPTR) {
_deluida0 = _CLASSPTR[p]
if (_deluida0 in _UIDOBL) {
@@ -1785,7 +2055,6 @@ function _deluid(p)
#_______________________________________________________________________
function _dir(A, rd, i, r, f, ds, pf, B, C)
{
- ####################################
delete A
gsub(/(^[ \t]*)|([ \t]*$)/, "", rd)
if (rd == "") {
@@ -1815,7 +2084,6 @@ function _dir(A, rd, i, r, f, ds, pf, B, C)
#_________________________________________________________________
function _dirtree(A, f, B)
{
- #########################################
gsub(/(^[ \t]*)|([ \t]*$)/, "", f)
delete A
A[""]
@@ -1852,8 +2120,7 @@ function _dll_check(pp)
{
_dllchktv = ""
_missfl = 1
- _tframe("_dll_check_i0", pp, _REG, pp)
- #also check that all dll have same version; also check that all dlls have success and then report that DS plug-in version n - installed
+ _tframe("_dll_check_i0", pp, _REG, pp) #also check that all dll have same version; also check that all dlls have success and then report that DS plug-in version n - installed
if (1 || "AGENT" in _[pp]) {
if (_dllchktv != _[pp][".Product Version"]) {
_dllerr(_[pp]["AGENT"], "agent version (" _[pp][".Product Version"] ") do not match all lib versions: " _dllchktv "'")
@@ -1888,7 +2155,6 @@ function _dll_check_i0(p, R, pp, p2, i, i2, r, f, v, rs, d, tv, tf)
}
}
}
- #{ rs=_missfl=1; _[p]["." gensub(/^([^\\]+\\)+(.*)\..../,"\\2","G",i)]=R[i] } }
if (rs) {
if ((i = ".Install Path") in _[p] && (i = ".Product Version") in _[p]) {
_[p]["STATUS"] = "PRESENT"
@@ -1982,7 +2248,6 @@ function _drawuid(p, cn, ch, o)
#_______________________________________________________________________
function _dumparr(A, t, lv, a)
{
- ############################################
b = PROCINFO["sorted_in"]
PROCINFO["sorted_in"] = "_lengthsort"
if (isarray(A)) {
@@ -2047,7 +2312,6 @@ function _dumparr_i1(A, lv, ls, ln, t, t2, i, a, f)
#_____________________________________________________________________________
function _dumpobj(p, f, t, s)
{
- ###################################################
s = _dumpobj_i0(p, f, t = t "." p "{")
if (p = _rFCHLD(p)) {
return (s = s _dumpobjm(p, f, (s ? _getchrln(" ", length(t) - 1) : t " ")))
@@ -2115,14 +2379,12 @@ function _dumpobj_i4(t)
#_________________________________________________________________
function _dumpobj_nc(p, f, t)
{
- #######################################
return _dumpobj_i0(p, f, t "." p "{ ")
}
#_________________________________________________________________
function _dumpobjm(p, f, t, s, t2)
{
- ###################################
t2 = _getchrln(" ", length(t))
do {
s = s _dumpobj(p, f, t)
@@ -2134,7 +2396,6 @@ function _dumpobjm(p, f, t, s, t2)
#_________________________________________________________________
function _dumpobjm_nc(p, f, t, s, t2)
{
- ################################
t2 = _getchrln(" ", length(t))
do {
s = s _dumpobj_nc(p, f, t)
@@ -2174,7 +2435,6 @@ function _dumpval(v, n)
}
########################################################
-
function _eXTFN(c, t, P)
{
switch (c) {
@@ -2212,7 +2472,6 @@ function _endpass(t)
#_______________________________________________________________________
function _err(t, a, b)
{
- ###################################################
a = BINMODE
b = ORS
BINMODE = "rw"
@@ -2227,14 +2486,12 @@ function _err(t, a, b)
#_________________________________________________________________
function _errnl(t)
{
- ################################################
return _err(t ((t ~ /\x0A$/ ? "" : _CHR["EOL"])))
}
#_______________________________________________________________________
function _error(t, d, A)
{
- #################################################
if (_ERRLOG_EF) {
A["TYPE"] = "ERROR"
A["TEXT"] = t
@@ -2245,14 +2502,12 @@ function _error(t, d, A)
#_______________________________________________________________________
function _exit(c)
{
- #######################################################
exit c
}
#_____________________________________________________________________________
function _export_data(t, i, A)
{
- #################################################
A["DATA"] = t
A["ID"] = i
_expout("_DATA: " _Zexparr(A) "\n")
@@ -2264,7 +2519,6 @@ function _export_data(t, i, A)
#_____________________________________________________________________________
function _expout(t, d, a, b)
{
- ####################################################
a = BINMODE
b = ORS
BINMODE = "rw"
@@ -2287,8 +2541,6 @@ function _expout(t, d, a, b)
function _extfn_init()
{
- ##############################################################
-
_formatstrs_init()
_formatstrd_init()
_formatrexp_init()
@@ -2321,7 +2573,6 @@ function _faccr_i0(A, t, p, P, f, r)
#_______________________________________________________________________
function _fatal(t, d, A)
{
- #################################################
if (_ERRLOG_FF) {
A["TYPE"] = "FATAL"
A["TEXT"] = t
@@ -2352,11 +2603,9 @@ function _ffaccr(A, t, p, P)
return _faccr_i0(A["F"], t, p, P)
}
-##################
#_______________________________________________________________________
function _fframe(A, t, p)
{
- #################################################
return _fframe_i0(A, t, p, A[""])
}
@@ -2369,7 +2618,6 @@ function _fframe_i0(A, t, p, f)
#_________________________________________________________________
function _file(f)
{
- #################################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2418,7 +2666,6 @@ function _file_check_i0(p, pp, p1, p2, f, v)
#_________________________________________________________________
function _filed(f, dd, d)
{
- ##########################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2443,7 +2690,6 @@ function _filed(f, dd, d)
#_________________________________________________________________
function _filen(f)
{
- ################################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2453,7 +2699,6 @@ function _filen(f)
#_________________________________________________________________
function _filene(f)
{
- ###############################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2463,7 +2708,6 @@ function _filene(f)
#_________________________________________________________________
function _filenotexist(f, a)
{
- ######################################
if (f == "") {
return ""
}
@@ -2481,7 +2725,6 @@ function _filenotexist(f, a)
#_______________________________________________________________________
function _filepath(f, dd)
{
- ################################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2491,7 +2734,6 @@ function _filepath(f, dd)
#_________________________________________________________________
function _filer(f, dd)
{
- #############################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2507,7 +2749,6 @@ function _filer(f, dd)
#_________________________________________________________________
function _filerd(f, dd)
{
- ############################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2517,7 +2758,6 @@ function _filerd(f, dd)
#_________________________________________________________________
function _filerdn(f, dd)
{
- ###########################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2527,7 +2767,6 @@ function _filerdn(f, dd)
#_________________________________________________________________
function _filerdne(f, dd)
{
- ##########################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2598,7 +2837,6 @@ function _filerdnehnd(st, c, r, d, n, A)
#_______________________________________________________________________
function _filexist(f, a)
{
- ################################################
if (f == "") {
return ""
}
@@ -2617,7 +2855,6 @@ function _filexist(f, a)
#_______________________________________________________________________
function _fn(f, p0, p1, p2)
{
- ################################################
if (f in FUNCTAB) {
return @f(p0, p1, p2)
}
@@ -2626,7 +2863,6 @@ function _fn(f, p0, p1, p2)
#_______________________________________________________________________
function _foreach(A, f, r, p0, p1, p2, i, p)
{
- ####################################
if (isarray(A)) {
_TMP0[p = _n()]["."] = 1
_foreach_i0(A, f, _TMP0[p], p0, p1, p2)
@@ -2695,7 +2931,6 @@ function _formatstrd_init()
_FORMATSTRDESC["\t"] = "\\t"
}
-#__________________________________________________________________________________
####################################################################################
@@ -2765,7 +3000,6 @@ function _gen(D, t)
#_____________________________________________________________________________
function _gensubfn(t, r, f, p0, A)
{
- ###############################################
if (match(t, r, A)) {
return (substr(t, 1, RSTART - 1) (@f(_th0(substr(t, RSTART, RLENGTH), t = substr(t, RSTART + RLENGTH)), A, p0)) _gensubfn(t, r, f, p0))
}
@@ -2775,7 +3009,6 @@ function _gensubfn(t, r, f, p0, A)
#_____________________________________________________________________________
function _get_errout(p)
{
- #######################################################
return _tframe("_get_errout_i0", p)
}
@@ -2830,7 +3063,6 @@ function _get_errout_i3(p, t, ts, cl, cp, cr, a, b)
#_____________________________________________________________________________
function _get_logout(p)
{
- #######################################################
return _tframe("_get_logout_i0", p)
}
@@ -2854,7 +3086,6 @@ function _get_logout_i0(p, t, n, a)
#_______________________________________________________________________
function _getchrln(s, w)
{
- #################################################
if (s == "") {
return
}
@@ -2880,14 +3111,12 @@ function _getchrln(s, w)
#_______________________________________________________________________
function _getdate()
{
- #####################################################
return strftime("%F")
}
#_____________________________________________________________________________
function _getfilepath(t, f, al, b, A)
{
- ############################################
ERRNO = ""
if (match(t, /^[ \t]*(("([^"]*)"[ \t]*)|([`']([^']*)'[ \t]*)|(([^ \t]+)[ \t]*))/, A)) {
al = RLENGTH
@@ -2906,7 +3135,6 @@ function _getfilepath(t, f, al, b, A)
function _getfilever(f)
{
- #############################################################
split(_cmd(_fileverpath " \"" f "\""), _GETFILEVERA0, /[ \t]+/)
if (_GETFILEVERA0[5]) {
return _GETFILEVERA0[5]
@@ -2916,14 +3144,12 @@ function _getfilever(f)
#_________________________________________________________________
function _getime()
{
- ################################################
return strftime("%H:%M:%S")
}
#_________________________________________________________________
function _getmpdir(f, dd)
{
- ##########################################
if (! dd || ! (dd = _filerd(dd))) {
dd = _FILEIO_TMPRD
}
@@ -2936,7 +3162,6 @@ function _getmpdir(f, dd)
#_________________________________________________________________
function _getmpfile(f, dd)
{
- #########################################
if (! dd || ! (dd = _filerd(dd))) {
dd = _FILEIO_TMPRD
}
@@ -2949,7 +3174,6 @@ function _getmpfile(f, dd)
#_______________________________________________________________________
function _getperf(o, t, a)
{
- ###############################################
(o == "" ? ++_getperf_opcurr : _getperf_opcurr = o)
if ((a = _getsecond()) != _getperf_last) {
_getperf_opsec = (_getperf_opcurr - _getperf_opstart) / ((_getperf_last = a) - _getperf_start)
@@ -3045,14 +3269,12 @@ function _getreg_i1(D, r, R, a, i, il, ir, rc, B)
#_________________________________________________________________
function _getsecond()
{
- #############################################
return systime()
}
#___________________________________________________________
function _getsecondsync(a, c, b, c2)
{
- ##########################
a = systime()
while (a == systime()) {
++c
@@ -3063,7 +3285,6 @@ function _getsecondsync(a, c, b, c2)
#_______________________________________________________________________
function _getuid(p)
{
- ################################################# 1 #
if (p in _UIDOBL) {
for (_tptr in _UIDOBLV[_getuida0 = _UIDOBL[p]]) {
delete _UIDOBLV[_getuida0][_tptr]
@@ -3096,7 +3317,6 @@ function _handle8494(t)
#_____________________________________________________________________________
function _hexnum(n, l)
{
- #########################################################
if (l + 0 < 1) {
l = 2
}
@@ -3106,7 +3326,6 @@ function _hexnum(n, l)
#_________________________________________________________________
function _igetperf(t, s, o)
{
- ######################################### # t-test period in seconds(==0 ? no period; s(=true/false)-output/not output status; o-qnt of ops before test start
if (t == 0 && t == "" && s == 0 && s == "" && o == 0 && o == "") {
if (_getperf_fn !~ /not$/ && _constatstr == _getperf_stat) {
_constat(_getperf_statstr)
@@ -3137,7 +3356,6 @@ function _import_data(t, p, p2, a)
#_______________________________________________________________________
function _info(t, d, A)
{
- ##################################################
if (_ERRLOG_IF) {
A["TYPE"] = "INFO"
A["TEXT"] = t
@@ -3209,7 +3427,6 @@ function _initsys()
#_______________________________________________________________________
function _inituid(p, cs, dptr, pfx, sfx, hstr, lstr, A)
{
- ################### 1 #
if (cs == 0 && cs == "") {
cs = p
p = _getuid()
@@ -3271,7 +3488,6 @@ function _inituidefault(h, l, H, L)
#_______________________________________________________________________
function _ins(S, sf, D, df)
{
- ################################################
if (sf in S) {
if (isarray(S[sf])) {
if (df in D) {
@@ -3295,19 +3511,16 @@ function _ins(S, sf, D, df)
#_________________________________________________________________
function _insf(A, f)
{
- ###############################################
A["F"][""] = A["B"][A["F"][f] = A["F"][""]] = f
}
#_________________________________________________________________
function _insframe(A, f)
{
- ###########################################
A[f] = A[""]
A[""] = f
}
-########################
#_________________________________________________________________
function _inspass(A, f)
{
@@ -3320,7 +3533,6 @@ function _inspass(A, f)
#_______________________________________________________________________
function _isptr(p)
{
- ################################################## 1 #
if (isarray(p)) {
is = _NOP
it = "A"
@@ -3341,7 +3553,6 @@ function _isptr(p)
#_______________________________________________________________________
function _istr(p)
{
- ################################################### 1 #
if (isarray(p)) {
is = _NOP
it = "A"
@@ -3358,7 +3569,6 @@ function _istr(p)
#_________________________________________________________________
function _lengthsort(i1, v1, i2, v2)
{
- ##############################
return ((length(i1) < length(i2) ? -1 : (length(i1) > length(i2) ? 1 : (i1 < i2 ? -1 : 1))))
}
@@ -3401,14 +3611,12 @@ function _lib_NAMEVER()
#_____________________________________________________________________________
function _ln(t)
{
- ###############################################################
return ((t ~ /\x0A$/ ? t : t _CHR["EOL"]))
}
#_________________________________________________________________
function _log(A, p, a, B)
{
- ###########################################
if (isarray(A)) {
A["TIME"] = _getime()
A["DATE"] = _getdate()
@@ -3429,7 +3637,6 @@ function _log(A, p, a, B)
#_________________________________________________________________
function _lspctab(t, ts, l, l1, l2, A)
{
- ################################
while (match(t, /^(\t*)( *)((\t*)(.*))$/, A)) {
if (A[1, "length"] >= l) {
return substr(t, l + 1)
@@ -3471,7 +3678,6 @@ function _macsfx94(F, D, C, p1, p2, p3)
#_______________________________________________________________________
function _movarr(D, S)
{
- ###################################################
delete D
D[""]
delete D[""]
@@ -3589,7 +3795,6 @@ function _mpusub(F, D, C, d, p1, p2, p3, q)
#_______________________________________________________________________
function _n(F, v, p)
{
- #####################################################
for (p in _UIDSDEL) {
delete _UIDSDEL[p]
delete _ptr[p]
@@ -3652,7 +3857,6 @@ function _nN_i0(p, F, v)
#_________________________________________________________________
function _newclrdir(f)
{
- ############################################
if ((f = _filerd(f)) == "") {
return
}
@@ -3665,7 +3869,6 @@ function _newclrdir(f)
#_______________________________________________________________________
function _newdir(f)
{
- #####################################################
if ((f = _filerd(f)) == "") {
return
}
@@ -3676,7 +3879,6 @@ function _newdir(f)
return f
}
-##############################
#_______________________________________________________________________
function _nop(p0, p1, p2, p3)
{
@@ -3700,7 +3902,6 @@ function _nop(p0, p1, p2, p3)
#_________________________________________________________________
function _nretarr(A, i, v, r, q)
{
- #####################################
if ((i = (i == "" ? 1 : i + 0)) <= (q = A[_ARRLEN])) {
if (i <= (r = q - 16)) {
_ARRSTR = A[i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i]
@@ -3720,7 +3921,6 @@ function _nretarr(A, i, v, r, q)
#___________________________________________________________
function _nretarrd(A, i, v, r, q)
{
- ##############################
if ((i = (i == "" ? 1 : i + 0)) <= (q = A[_ARRLEN])) {
if (i <= (r = q - 16)) {
_ARRSTR = A[i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i]
@@ -3745,7 +3945,6 @@ function _nretarrd(A, i, v, r, q)
#___________________________________________________________________________________
function _out(t, a, b)
{
- ###############################################################
a = BINMODE
b = ORS
BINMODE = "rw"
@@ -3760,7 +3959,6 @@ function _out(t, a, b)
#_________________________________________________________________
function _outnl(t)
{
- ################################################
return _out(t ((t ~ /\x0A$/ ? "" : _CHR["EOL"])))
}
@@ -3815,7 +4013,6 @@ function _p8(s1, s2, s3, s4, s5, s6, s7, s8, p1, p2, p3, p4, p5, p6, p7, p8)
#_______________________________________________________________________
function _pass(A, f, t, p2, i, a)
{
- ###########################################
a = _endpass_v0
_endpass_v0 = ""
i = 1
@@ -3838,7 +4035,6 @@ function _pass(A, f, t, p2, i, a)
#_____________________________________________________________________________
function _patharr0(D, q, i, h, A, B)
{
- ##############################################
delete D
if (0 < (q = split(gensub(/\\/, "/", "G", gensub(/ *([:$\\\/]) */, "\\1", "G", gensub(/(^[ \t]+)|([ \t]+$)/, "", "G", q))), A, /\/+/, B))) {
if (2 > (h = length(B[1]))) {
@@ -3927,9 +4123,6 @@ function _patharr0_i1(D, A, i, q, t, c)
}
#############################################################################
-
-
-
function _pmap(m, s1, s2, s3, s4, s5, s6, s7, s8)
{
if (match(m, /^([^\(]+)\(([^\)]*)\)$/, _QMAP)) {
@@ -3988,7 +4181,6 @@ function _pr8(s1, s2, s3, s4, s5, s6, s7, s8, p1, p2, p3, p4, p5, p6, p7, p8)
#_________________________________________________________________
function _printarr(A, t, lv, r, a)
{
- ####################################
a = PROCINFO["sorted_in"]
PROCINFO["sorted_in"] = "_lengthsort"
_printarrexp = (r ? r : "")
@@ -4094,7 +4286,6 @@ function _qparam_i0(p0, p1, p2, p3, p4, p5, p6, p7)
#_______________________________________________________________________
function _qstr(t, c, A, B)
{
- ################################################
c = ""
for (t = split(t, A, /[\x00-\x1F\\"]/, B); t >= 0; t--) {
c = _QSTR[B[t]] A[t + 1] c
@@ -4105,17 +4296,14 @@ function _qstr(t, c, A, B)
#_________________________________________________________________
function _qstrq(t)
{
- ################################################
gsub(/\\/, "\\\\", t)
gsub(/"/, "\\\"", t)
return t
}
-################################################################
#_____________________________________________________________________________
function _rEG(c, t, P, a, A)
{
- #####################################################
switch (c) {
case "_lib_CMDLN":
#___________________________________________________________
@@ -4141,7 +4329,6 @@ function _rEG(c, t, P, a, A)
#_______________________________________________________________________
function _rFBRO(p)
{
- ######################################################
if (p) {
if (p in _tPARENT) {
return _tFCHLD[_tPARENT[p]]
@@ -4157,18 +4344,15 @@ function _rFBRO(p)
#_______________________________________________________________________
function _rFCHLD(p)
{
- #####################################################
if (p && p in _tFCHLD) {
return _tFCHLD[p]
}
return ""
}
-######################## p="", !v
#_______________________________________________________________________
function _rLBRO(p)
{
- ######################################################
if (p) {
if (p in _tPARENT) {
return _tLCHLD[_tPARENT[p]]
@@ -4181,11 +4365,9 @@ function _rLBRO(p)
return p
}
-######################## p=""
#_______________________________________________________________________
function _rLCHLD(p)
{
- #####################################################
if (p && p in _tLCHLD) {
return _tLCHLD[p]
}
@@ -4195,48 +4377,39 @@ function _rLCHLD(p)
#_______________________________________________________________________
function _rLINK(p)
{
- ######################################################
return ((p in _tLINK ? _tLINK[p] : ""))
}
-######################## p=""
#_______________________________________________________________________
function _rNEXT(p)
{
- ######################################################
if (p && p in _tNEXT) {
return _tNEXT[p]
}
return ""
}
-######################## p=""
#_______________________________________________________________________
function _rPARENT(p)
{
- ####################################################
if (p && p in _tPARENT) {
return _tPARENT[p]
}
return ""
}
-######################## p=""
#_______________________________________________________________________
function _rPREV(p)
{
- ######################################################
if (p && p in _tPREV) {
return _tPREV[p]
}
return ""
}
-######################## p=""
#_______________________________________________________________________
function _rQBRO(p, c, p1)
{
- ################################################
if (p) {
if (p in _tPARENT) {
return _tQCHLD[_tPARENT[p]]
@@ -4256,11 +4429,9 @@ function _rQBRO(p, c, p1)
return p
}
-######################## p=""
#_______________________________________________________________________
function _rQCHLD(p)
{
- #####################################################
if (p && p in _tQCHLD) {
return _tQCHLD[p]
}
@@ -4273,7 +4444,6 @@ function _rQCHLD(p)
#_____________________________________________________________________________
function _rSQFIRST(g, p, A)
{
- #####################################################
if (isarray(A)) {
return _rSQFIRSTA(g, p, A)
}
@@ -4285,7 +4455,6 @@ function _rSQFIRST(g, p, A)
#_________________________________________________________________
function _rSQFIRSTA(g, p, A)
{
- ########################################
_SQTOPTR[g] = p
_SQSTACK[g][0] = 0
if ((p = _rsqgetptr(g, p)) in A) {
@@ -4297,7 +4466,6 @@ function _rSQFIRSTA(g, p, A)
#_______________________________________________________________________
function _rSQNEXT(g, p, A)
{
- ################################################
if (isarray(A)) {
return _rSQNEXTA(g, p, A)
}
@@ -4307,7 +4475,6 @@ function _rSQNEXT(g, p, A)
#_________________________________________________________________
function _rSQNEXTA(g, p, A)
{
- #########################################
if (p == _SQTOPTR[g]) {
if (_SQSTACK[g][0] > 0) {
_SQTOPTR[g] = _SQSTACK[g][_SQSTACK[g][0]--]
@@ -4353,7 +4520,6 @@ function _rd_shortcut(D, f)
#_______________________________________________________________________
function _rdfile(f, i, A)
{
- ################################################
if ((f = _filerdne(f)) == "" || _filene(f) == "") {
ERRNO = "Filename error"
return
@@ -4406,7 +4572,6 @@ function _rdfile(f, i, A)
# fn _getsecondsync()
function _rdreg(D, p)
{
- ################################################################
_rdregp0 = "reg query \"" p "\" /S /reg:64 2>NUL"
_rdregfld = _rdregkey = 0
_rdregq0 = split(gensub(/[\x0D?\x0A]{2,}/, _CHR["EOL"], "G", _cmd(_rdregp0)), _RDREGA0, /\x0D?\x0A/)
@@ -4545,7 +4710,6 @@ function _registryinit()
#_____________________________________________________________________________
function _regpath0(D, i, s, q, S)
{
- ############################################ 0 #
if (i = _patharr0(S, i)) {
if ("name" in S) {
D["name"] = S["name"]
@@ -4569,7 +4733,6 @@ function _regpath0(D, i, s, q, S)
#_________________________________________________________________________________________
function _report(p)
{
- #######################################################################
_report_t0 = _reportparnt = ""
_report_i0(p)
_tframe("_report_i0", p)
@@ -4667,7 +4830,6 @@ function _reporterr(p, t3, pp, t, t2)
#_____________________________________________________________________________
function _retarr(A, i, p, a, q)
{
- ##################################################
if (isarray(A)) {
i = (i == "" ? 0 : i + 0)
q = A[_ARRLEN] + 0
@@ -4691,7 +4853,6 @@ function _retarr_i0(A, q, i, a)
#_________________________________________________________________
function _retarrd(A, v, i)
{
- #########################################
if (1 in A) {
return (A[1] A[2] A[3] A[4] A[5] A[6] A[7] A[8] A[9] A[10] A[11] A[12] A[13] A[14] A[15] A[16] (((i = 17) in A ? _retarrd_i0(A, i) v : v)))
}
@@ -4729,7 +4890,6 @@ function _rexpfnend(t)
#_____________________________________________________________________________
function _rexpstr(r, i, c, A)
{
- ###################################################
c = split(r, A, "")
r = ""
for (i = 1; i <= c; i++) {
@@ -4771,7 +4931,6 @@ function _rpp(q, D, S)
#_________________________________________________________________________________________
function _rrdreg(DD, p, k, t, v, c, i, q, tT, A, B, C, D)
{
- ############################################# old; regedit
if (! _registrytmpfile) {
_registryinit()
}
@@ -4889,11 +5048,9 @@ function _rxpfn(R, t, p, i, f, A)
return _rexpfnend(t)
}
-##############################################################
#_____________________________________________________________________________
function _sHARE(c, t, P, a, A)
{
- ###################################################
switch (c) {
case "_lib_CMDLN":
#___________________________________________________________
@@ -4916,11 +5073,9 @@ function _sHARE(c, t, P, a, A)
}
}
-################################################################
#_____________________________________________________________________________
function _sYS(c, t, P, a, A)
{
- #####################################################
switch (c) {
case "_lib_CMDLN":
#___________________________________________________________
@@ -4967,7 +5122,6 @@ function _serv_check_i0(p, p0, p1, p2, p3, i, q, c)
#_______________________________________________________________________
function _setarrsort(f, a)
{
- ##############################################
a = PROCINFO["sorted_in"]
if (! f) {
delete PROCINFO["sorted_in"]
@@ -4980,7 +5134,6 @@ function _setarrsort(f, a)
#_______________________________________________________________________
function _setmpath(p, a)
{
- ################################################
ERRNO = ""
if (p && (a = _filerd(p))) {
if (_FILEIO_TMPRD) {
@@ -5018,7 +5171,6 @@ function _setmpath(p, a)
function _sharelist(D, h, q, c, l, A, B)
{
- #################################################
delete D
c = _sharextool " \\\\" ((h == "" ? h = ENVIRON["COMPUTERNAME"] : h)) " 2>&1"
if (match(c = _cmd(c), /\x0AShare[^\x0A]*Remark/)) {
@@ -5038,7 +5190,6 @@ function _sharelist(D, h, q, c, l, A, B)
#_____________________________________________________________________________
function _sharepath(h, s, A)
{
- ###################################################
s = _sharextool " \\\\" ((h == "" ? h = ENVIRON["COMPUTERNAME"] : h)) "\\\"" s "\" 2>&1"
if (match(s = _cmd(s), /\x0APath[ \t]+([^\x0D\x0A]+)/, _SHAREPATHA0)) {
return gensub(/[ \t\\\/]*$/, "\\\\", 1, _SHAREPATHA0[1])
@@ -5048,17 +5199,14 @@ function _sharepath(h, s, A)
function _shortcut(D, S)
{
- #############################################################
if (isarray(D)) {
if (isarray(S)) {
_addarrmask(D, S, _SHORTCUTWSTRUC)
} else {
if (S == 0 && S == "") {
- # array,array2* - copy from array2 to array shorcut-specific elements
_addarrmask(D, _SHORTCUTDEFAULT, _SHORTCUTWSTRUC)
} else {
if (_isnotfileptr(S)) {
- # array* - define shortcut-specific elements in array by default values
_addarrmask(D, _[S], _SHORTCUTWSTRUC)
} else {
if (_rd_shortcut(D, S)) {
@@ -5067,22 +5215,18 @@ function _shortcut(D, S)
}
}
}
- # array,ptr* - copy from array _[ptr] to array shorcut-specific elements
} else {
if (D == 0 && D == "") {
return _NOP
} else {
if (_isnotfileptr(D)) {
- # -* - no action(return -)
if (isarray(S)) {
_addarrmask(_[D], S, _SHORTCUTWSTRUC)
} else {
if (S == 0 && S == "") {
- # ptr,array* - copy from array to array _[ptr] shorcut-specific elements
_addarrmask(_[D], _SHORTCUTDEFAULT, _SHORTCUTWSTRUC)
} else {
if (_isnotfileptr(S)) {
- # ptr* - define shortcut-specifc elements in array _[ptr] by default values
_addarrmask(_[D], _[S], _SHORTCUTWSTRUC)
} else {
if (_rd_shortcut(_[D], S)) {
@@ -5091,9 +5235,7 @@ function _shortcut(D, S)
}
}
}
- # ptr,ptr2* - copy from array _[ptr2] to array _[ptr] shorcut-specific elements
} else {
- # ptr,filepath* - define in array _[ptr] shortcut-specific elements by reading its from shortcut file filepath(load shortcut)
if (isarray(S) && _wr_shortcut(D, S)) {
return
} else {
@@ -5109,11 +5251,9 @@ function _shortcut(D, S)
}
}
}
- # filepath,ptr* - [over]write shorcut file filepath; shortcut parameters will be defined by shortcut-specific elements in array _[ptr](save shortcut)
}
}
}
- # filepath,filepath2* - [over]write shorcut file filepath; shortcut parameters will be defined from shortcut file filepath2(copy shortcut)
return 1
}
@@ -5299,7 +5439,6 @@ function _splitpath_test()
#_______________________________________________________________________
function _splitstr(A, t, r)
{
- ########################################### 1 #
if (_istr(t)) {
if (_splitstr_i0(A, t) > 0) {
return _splitstrp0
@@ -5475,7 +5614,6 @@ function _subseqon(B, r, F, f, s, e, q, i, A)
function _sysinfo(D, h)
{
- ##############################################################
h = "wmic /NODE: \"" h "\" OS 2>NUL"
if (split(_cmd(h), _SYSINFOA0, /[\x0D\x0A]+/) == 3) {
_sysinfol0 = length(h = _SYSINFOA0[2]) + 1
@@ -5488,7 +5626,6 @@ function _sysinfo(D, h)
}
#########################################################
-
function _tOBJ(c, t, P)
{
switch (c) {
@@ -5519,7 +5656,6 @@ function _tOBJ(c, t, P)
#_______________________________________________________________________
function _tOBJ_CLEANUP(p)
{
- ##############################################
for (p in UIDSDEL) {
delete _ptr[p]
delete _tPREV[p]
@@ -5538,7 +5674,6 @@ function _tOBJ_CLEANUP(p)
#_______________________________________________________________________
function _tabtospc(t, ts, xc, a, c, n, A, B)
{
- ##################################
if (! ts) {
ts = _TAB_STEP_DEFAULT
}
@@ -5575,7 +5710,6 @@ function _tapi(p, f, p0, p1, p2, p3, c)
#_____________________________________________________________________________
function _tbframe(f, p, p0, p1)
{
- ##################################################
delete _t_ENDF[++_t_ENDF[0]]
f = (p ? _tbframe_i0(f, p, p0, p1) : "")
--_t_ENDF[0]
@@ -5594,7 +5728,6 @@ function _tbframe_i0(f, p, p0, p1, a)
#_______________________________________________________________________
function _tbframex(f, p, p0, p1)
{
- ###########################################
delete _t_ENDF[++_t_ENDF[0]]
f = (p ? _tbframex_i0(f, p, p0, p1) : "")
--_t_ENDF[0]
@@ -5613,7 +5746,6 @@ function _tbframex_i0(f, p, p0, p1)
#_____________________________________________________________________________
function _tbpass(f, p, p0, p1)
{
- ###################################################
delete _t_ENDF[++_t_ENDF[0]]
f = (p ? _tbpass_i0(f, p, p0, p1) : "")
--_t_ENDF[0]
@@ -5632,7 +5764,6 @@ function _tbpass_i0(f, p, p0, p1, a)
#_____________________________________________________________________________
function _tbpassx(f, p, p0, p1)
{
- ##################################################
delete _t_ENDF[++_t_ENDF[0]]
f = (p ? _tbpassx_i0(f, p, p0, p1) : "")
--_t_ENDF[0]
@@ -5651,7 +5782,6 @@ function _tbpassx_i0(f, p, p0, p1)
#_____________________________________________________________________________
function _tbrochld(p, f, pp)
{
- ################################################### # TEST!!!
if (p) {
if (p in _tFCHLD) {
f = _tFCHLD[p]
@@ -5743,35 +5873,30 @@ function _tbrochld(p, f, pp)
#_________________________________________________________________
function _tbrunframe(f, p, p0, p1)
{
- ###################################
return _tbframe((f ? f : "_trunframe_i0"), p, p0, p1)
}
#_________________________________________________________________
function _tbrunframex(f, p, p0, p1)
{
- ##################################
return _tbframex((f ? f : "_trunframe_i0"), p, p0, p1)
}
#_________________________________________________________________
function _tbrunpass(f, p, p0, p1)
{
- ####################################
return _tbpass((f ? f : "_trunframe_i0"), p, p0, p1)
}
#_________________________________________________________________
function _tbrunpassx(f, p, p0, p1)
{
- ###################################
return _tbpassx((f ? f : "_trunframe_i0"), p, p0, p1)
}
#_____________________________________________________________________________
function _tdel(p, i)
{
- ##########################################################
if (p in _) {
_texclude(p)
for (i in _ptr[p]) {
@@ -5833,7 +5958,6 @@ function _tdel_i1(A, i)
#_____________________________________________________________________________
function _tdelete(p, v)
{
- ####################################################### # REMAKE EXCLUDE
if (p) {
_wLCHLD(_tDELPTR, p)
}
@@ -5843,7 +5967,6 @@ function _tdelete(p, v)
#_________________________________________________________________
function _tdelitem(p)
{
- #############################################
if (p) {
if ("HOST" in _PTR[p] && "ITEMNAME" in _[p]) {
return _wLCHLD(_PTR[_PTR[p]["HOST"]]["ITEM"][_[p]["ITEMNAME"]], p)
@@ -5856,7 +5979,6 @@ function _tdelitem(p)
#_______________________________________________________________________
function _tend(a, b)
{
- #####################################################
if (b == "") {
return (_t_ENDF[_t_ENDF[0]] = a)
} else {
@@ -5867,7 +5989,6 @@ function _tend(a, b)
#_____________________________________________________________________________
function _texclude(p, v, pp)
{
- ################################################### # TEST!!!
if (p in _) {
if (p in _tPARENT) {
pp = _tPARENT[p]
@@ -5916,7 +6037,6 @@ function _texclude(p, v, pp)
#_____________________________________________________________________________
function _tframe(fF, p, p0, p1, p2)
{
- ###############################################
delete _t_ENDF[++_t_ENDF[0]]
p = (_isptr(p) ? (isarray(fF) ? _tframe_i1(fF, p, p0, p1, p2) : _tframe_i0(fF, p, p0, p1, p2)) : "")
--_t_ENDF[0]
@@ -5926,7 +6046,6 @@ function _tframe(fF, p, p0, p1, p2)
#_____________________________________________________________________________
function _tframe0(f, p, p0, p1, p2, p3, A)
{
- #########################################
if (_isptr(p)) {
if (isarray(f)) {
return _tframe0_i0(f, p)
@@ -5993,7 +6112,6 @@ function _tframe0_i2(A, m, p)
#_________________________________________________________________
function _tframe1(f, p, p0, p1, p2, p3, A)
{
- #############################
if (_isptr(p)) {
if (isarray(f)) {
return _tframe1_i0(f, p, p0)
@@ -6049,7 +6167,6 @@ function _tframe1_i2(A, m, p, p0)
#_________________________________________________________________
function _tframe2(f, p, p0, p1, p2, p3, A)
{
- #############################
if (_isptr(p)) {
if (isarray(f)) {
return _tframe2_i0(f, p, p0, p1)
@@ -6105,7 +6222,6 @@ function _tframe2_i2(A, m, p, p0, p1)
#_________________________________________________________________
function _tframe3(f, p, p0, p1, p2, p3, A)
{
- #############################
if (_isptr(p)) {
if (isarray(f)) {
return _tframe3_i0(f, p, p0, p1, p2)
@@ -6161,7 +6277,6 @@ function _tframe3_i2(A, m, p, p0, p1, p2)
#_________________________________________________________________
function _tframe4(f, p, p0, p1, p2, p3, A)
{
- #############################
if (_isptr(p)) {
if (isarray(f)) {
return _tframe4_i0(f, p, p0, p1, p2, p3)
@@ -6235,7 +6350,6 @@ function _tframe_i1(F, p, p0, p1, p2, a)
#_______________________________________________________________________
function _tframex(f, p, p0, p1)
{
- ############################################
delete _t_ENDF[++_t_ENDF[0]]
f = (p ? _tframex_i0(f, p, p0, p1) : "")
--_t_ENDF[0]
@@ -6347,7 +6461,6 @@ function _tgenuid_init(a, b, A)
#_______________________________________________________________________
function _tgetitem(p, n, a, b)
{
- ############################################
if (p) {
if (isarray(_PTR[p]["ITEM"]) && n in _PTR[p]["ITEM"]) {
a = _PTR[p]["ITEM"][n]
@@ -6366,7 +6479,6 @@ function _tgetitem(p, n, a, b)
#_________________________________________________________________
function _tgetsp(p)
{
- ###############################################
return _tSTACK[p][0]
}
@@ -6378,28 +6490,24 @@ function _th0(p, p1, p2, p3)
return p
}
-##########################################
#_________________________________________________________________
function _th1(p0, p, p2, p3)
{
return p
}
-##############################
#_________________________________________________________________
function _th10(p0, p1)
{
return (p1 p0)
}
-##############################
#_________________________________________________________________
function _th2(p0, p1, r, p3)
{
return p
}
-##############################
#_________________________________________________________________
function _th3(p0, p1, p2, r)
{
@@ -6409,7 +6517,6 @@ function _th3(p0, p1, p2, r)
#_________________________________________________________________
function _tifend(l)
{
- ###############################################
return ((_t_ENDF[0] + l in _t_ENDF ? (_t_ENDF[_t_ENDF[0] + l] ? _t_ENDF[_t_ENDF[0] + l] : 1) : ""))
}
@@ -6579,7 +6686,6 @@ function _tlist_i1(L, p)
#_________________________________________________________________
function _tmbframe(f, p, p0, p1, t)
{
- ##################################
while (p && ! (_t_ENDF[0] in _t_ENDF)) {
t = t _tbframe_i0(f, p, p0, p1, p = (p in _tPREV ? _tPREV[p] : ""))
}
@@ -6589,7 +6695,6 @@ function _tmbframe(f, p, p0, p1, t)
#_________________________________________________________________
function _tmbframex(f, p, p0, p1, t)
{
- #################################
while (p && ! (_t_ENDF[0] in _t_ENDF)) {
t = t _tbframex_i0(f, p, p0, p1)
p = (p in _tPREV ? _tPREV[p] : "")
@@ -6600,7 +6705,6 @@ function _tmbframex(f, p, p0, p1, t)
#_________________________________________________________________
function _tmbpass(f, p, p0, p1)
{
- ######################################
while (p && ! (_t_ENDF[0] in _t_ENDF)) {
p0 = _tbpass_i0(f, p, p0, p1, p = (p in _tPREV ? _tPREV[p] : ""))
}
@@ -6610,7 +6714,6 @@ function _tmbpass(f, p, p0, p1)
#_________________________________________________________________
function _tmbpassx(f, p, p0, p1)
{
- #####################################
while (p && ! (_t_ENDF[0] in _t_ENDF)) {
p0 = _tbpassx_i0(f, p, p0, p1)
p = (p in _tPREV ? _tPREV[p] : "")
@@ -6621,7 +6724,6 @@ function _tmbpassx(f, p, p0, p1)
#_________________________________________________________________
function _tmframe(f, p, p0, p1, p2)
{
- ###################################
delete _t_ENDF[++_t_ENDF[0]]
f = (p ? _tmframe_i0(f, p, p0, p1, p2) : "")
--_t_ENDF[0]
@@ -6649,7 +6751,6 @@ function _tmframe_i1(F, p, p0, p1, p2, t)
#_________________________________________________________________
function _tmframex(f, p, p0, p1, t)
{
- ##################################
while (p && ! (_t_ENDF[0] in _t_ENDF)) {
t = t _tframex_i0(f, p, p0, p1)
p = (p in _tNEXT ? _tNEXT[p] : "")
@@ -6660,7 +6761,6 @@ function _tmframex(f, p, p0, p1, t)
#_________________________________________________________________
function _tmpass(f, p, p0, p1)
{
- #######################################
while (p && ! (_t_ENDF[0] in _t_ENDF)) {
p0 = _tbpass_i0(f, p, p0, p1, p = (p in _tNEXT ? _tNEXT[p] : ""))
}
@@ -6670,7 +6770,6 @@ function _tmpass(f, p, p0, p1)
#_________________________________________________________________
function _tmpassx(f, p, p0, p1)
{
- ######################################
while (p && ! (_t_ENDF[0] in _t_ENDF)) {
p0 = _tbpassx_i0(f, p, p0, p1)
p = (p in _tNEXT ? _tNEXT[p] : "")
@@ -6714,7 +6813,6 @@ function _torexp_rexp(t)
#_____________________________________________________________________________
function _tpass(f, p, p0, p1)
{
- ####################################################
delete _t_ENDF[++_t_ENDF[0]]
f = (p ? _tpass_i0(f, p, p0, p1) : "")
--_t_ENDF[0]
@@ -6733,7 +6831,6 @@ function _tpass_i0(f, p, p0, p1, a)
#_____________________________________________________________________________
function _tpassx(f, p, p0, p1)
{
- ###################################################
delete _t_ENDF[++_t_ENDF[0]]
f = (p ? _tpassx_i0(f, p, p0, p1) : "")
--_t_ENDF[0]
@@ -6752,7 +6849,6 @@ function _tpassx_i0(f, p, p0, p1)
#_________________________________________________________________
function _tpop(p, aA, a)
{
- ###########################################
if ((a = _tSTACK[p][0]) > 0) {
_tSTACK[p][0]--
if (isarray(_tSTACK[p][a])) {
@@ -6768,7 +6864,6 @@ function _tpop(p, aA, a)
#_____________________________________________________________________________
function _tpush(p, aA, a)
{
- ######################################################
if (isarray(aA)) {
delete _tSTACK[p][a = ++_tSTACK[p][0]]
_tSTACK[p][a][""]
@@ -6807,7 +6902,6 @@ function _tr(n, cs, H)
#_______________________________________________________________________
function _trace(t, d, A)
{
- #################################################
if (_ERRLOG_TF) {
A["TYPE"] = "TRACE"
A["TEXT"] = t
@@ -6818,7 +6912,6 @@ function _trace(t, d, A)
#_________________________________________________________________
function _trunframe(f, p, p0, p1, p2)
{
- #################################
return _tframe((f ? f : "_trunframe_i0"), p, p0, p1, p2)
}
@@ -6834,28 +6927,24 @@ function _trunframe_i0(p, p0, p1, p2, f)
#_________________________________________________________________
function _trunframex(f, p, p0, p1)
{
- ###################################
return _tframex((f ? f : "_trunframe_i0"), p, p0, p1)
}
#_________________________________________________________________
function _trunpass(f, p, p0, p1)
{
- #####################################
return _tpass((f ? f : "_trunframe_i0"), p, p0, p1)
}
#_________________________________________________________________
function _trunpassx(f, p, p0, p1)
{
- ####################################
return _tpassx((f ? f : "_trunframe_i0"), p, p0, p1)
}
#_________________________________________________________________
function _tsetsp(p, v)
{
- #############################################
return (_tSTACK[p][0] = v)
}
@@ -7036,7 +7125,6 @@ function _typa(p, A)
#_______________________________________________________________________
function _tzend(a, b)
{
- #####################################################
if (b == 0 && b == "") {
return (_TEND[_TEND[_ARRLEN]] = a)
} else {
@@ -7176,7 +7264,6 @@ function _unstr(t)
#_________________________________________________________________
function _untmp(f, a)
{
- #############################################
if (f = filepath(f)) {
if (match(f, /\\$/)) {
_deletepfx(_FILEIO_RDTMP, a = toupper(f))
@@ -7228,7 +7315,6 @@ function _var(v, t)
#_______________________________________________________________________
function _verb(t, d, A)
{
- ##################################################
if (_ERRLOG_VF) {
A["TYPE"] = "VERB"
A["TEXT"] = t
@@ -7239,7 +7325,6 @@ function _verb(t, d, A)
#_________________________________________________________________
function _wFBRO(p, v, a)
{
- ###########################################
if (p) {
if (v) {
for (a = p; a in _tPARENT; ) {
@@ -7247,7 +7332,6 @@ function _wFBRO(p, v, a)
return v
}
}
- ######################## v is parentesis of p
if (p in _tPARENT) {
p = _tPARENT[p]
if (v in _tNEXT) {
@@ -7346,19 +7430,15 @@ function _wFBRO(p, v, a)
if (v == 0) {
return v
}
- ######################## p=ptr, v=0
return v
}
} else {
- ######################## p=ptr, v=""
if (p == 0) {
return v
}
- ######################## p=0
if (v) {
return _texclude(v)
}
- ######################## p="", v=ptr - exclude v
return v
}
}
@@ -7366,19 +7446,16 @@ function _wFBRO(p, v, a)
#_________________________________________________________________
function _wFCHLD(p, v, a)
{
- ##########################################
if (p) {
if (v) {
if (p == v) {
return v
}
- ######################## p=v=ptr
for (a = p; a in _tPARENT; ) {
if ((a = _tPARENT[a]) == v) {
return v
}
}
- ######################## v is parentesis of p
if (v in _tNEXT) {
if (v in _tPREV) {
_tPREV[_tNEXT[a] = _tNEXT[v]] = a = _tPREV[v]
@@ -7438,7 +7515,6 @@ function _wFCHLD(p, v, a)
} else {
if (v == 0) {
if (p in _tFCHLD) {
- ######################## p=ptr, v=0 > delete all chld
v = _tFCHLD[p]
delete _tFCHLD[p]
delete _tLCHLD[p]
@@ -7451,11 +7527,9 @@ function _wFCHLD(p, v, a)
return v
}
} else {
- ######################## p=ptr, v="" > ignore action
if (p == 0) {
return v
}
- ######################## p=0
return v
}
}
@@ -7463,7 +7537,6 @@ function _wFCHLD(p, v, a)
#_________________________________________________________________
function _wLBRO(p, v, a)
{
- ###########################################
if (p) {
if (v) {
for (a = p; a in _tPARENT; ) {
@@ -7471,7 +7544,6 @@ function _wLBRO(p, v, a)
return v
}
}
- ######################## v is parentesis of p
if (p in _tPARENT) {
p = _tPARENT[p]
if (v in _tPREV) {
@@ -7570,19 +7642,15 @@ function _wLBRO(p, v, a)
if (v == 0) {
return v
}
- ######################## p=ptr, v=0
return v
}
} else {
- ######################## p=ptr, v=""
if (p == 0) {
return v
}
- ######################## p=0
if (v) {
return _texclude(v)
}
- ######################## p="", v=ptr - exclude v
return v
}
}
@@ -7590,19 +7658,16 @@ function _wLBRO(p, v, a)
#_________________________________________________________________
function _wLCHLD(p, v, a)
{
- ##########################################
if (p) {
if (v) {
if (p == v) {
return v
}
- ######################## p=v=ptr
for (a = p; a in _tPARENT; ) {
if ((a = _tPARENT[a]) == v) {
return v
}
}
- ######################## v is parentesis of p
if (v in _tPREV) {
if (v in _tNEXT) {
_tNEXT[_tPREV[a] = _tPREV[v]] = a = _tNEXT[v]
@@ -7662,7 +7727,6 @@ function _wLCHLD(p, v, a)
} else {
if (v == 0) {
if (p in _tFCHLD) {
- ######################## p=ptr, v=0 > delete all chld
v = _tFCHLD[p]
delete _tFCHLD[p]
delete _tLCHLD[p]
@@ -7675,11 +7739,9 @@ function _wLCHLD(p, v, a)
return v
}
} else {
- ######################## p=ptr, v="" > ignore action
if (p == 0) {
return v
}
- ######################## p=0
return v
}
}
@@ -7687,26 +7749,22 @@ function _wLCHLD(p, v, a)
#_________________________________________________________________
function _wLINK(p, v)
{
- ##############################################
return (_tLINK[p] = v)
}
#_________________________________________________________________
function _wNEXT(p, v, a, b)
{
- #########################################
if (p) {
if (v) {
if (p == v) {
return v
}
- ######################## p=v=ptr
for (a = p; a in _tPARENT; ) {
if ((a = _tPARENT[a]) == v) {
return v
}
}
- ######################## v is parentesis of p
if (v in _tPREV) {
if (p == (a = _tPREV[v])) {
return v
@@ -7759,19 +7817,15 @@ function _wNEXT(p, v, a, b)
if (v == 0) {
return v
}
- ######################## p=ptr, v=0
return v
}
} else {
- ######################## p=ptr, v=""
if (p == 0) {
return v
}
- ######################## p=0
if (v) {
return _texclude(v)
}
- ######################## p="", v=ptr - exclude v
return v
}
}
@@ -7779,26 +7833,22 @@ function _wNEXT(p, v, a, b)
#_________________________________________________________________
function _wPARENT(p, v)
{
- ############################################
return v
}
#_________________________________________________________________
function _wPREV(p, v, a, b)
{
- #########################################
if (p) {
if (v) {
if (p == v) {
return v
}
- ######################## p=v=ptr
for (a = p; a in _tPARENT; ) {
if ((a = _tPARENT[a]) == v) {
return v
}
}
- ######################## v is parentesis of p
if (v in _tNEXT) {
if (p == (a = _tNEXT[v])) {
return v
@@ -7851,19 +7901,15 @@ function _wPREV(p, v, a, b)
if (v == 0) {
return v
}
- ######################## p=ptr, v=0
return v
}
} else {
- ######################## p=ptr, v=""
if (p == 0) {
return v
}
- ######################## p=0
if (v) {
return _texclude(v)
}
- ######################## p="", v=ptr - exclude v
return v
}
}
@@ -7871,21 +7917,17 @@ function _wPREV(p, v, a, b)
#_________________________________________________________________
function _wQBRO(p, v)
{
- ##############################################
return v
}
#_________________________________________________________________
function _wQCHLD(p, v)
{
- #############################################
if (p) {
if (v) {
} else {
- ######################## p=ptr, v=ptr
if (v == 0) {
if (p in _tFCHLD) {
- ######################## p=ptr, v=0 > delete all chld
v = _tFCHLD[p]
delete _tFCHLD[p]
delete _tLCHLD[p]
@@ -7898,11 +7940,9 @@ function _wQCHLD(p, v)
return v
}
} else {
- ######################## p=ptr, v="" > ignore action
if (p == 0) {
return v
}
- ######################## p=0
return v
}
}
@@ -7910,7 +7950,6 @@ function _wQCHLD(p, v)
#_______________________________________________________________________
function _warning(t, d, A)
{
- ###############################################
if (_ERRLOG_WF) {
A["TYPE"] = "WARNING"
A["TEXT"] = t
@@ -7962,7 +8001,6 @@ function _wr_shortcut(f, S)
#_________________________________________________________________
function _wrfile(f, d, a, b)
{
- #########################################
if ((f = _wfilerdnehnd(f)) == "" || _filene(f) == "") {
ERRNO = "Filename error"
return
@@ -7988,7 +8026,6 @@ function _wrfile(f, d, a, b)
#___________________________________________________________
function _wrfile1(f, d, a, b)
{
- ##################################
if ((f = _wfilerdnehnd(f)) == "" || _filene(f) == "") {
ERRNO = "Filename error"
return
@@ -8014,7 +8051,6 @@ function _wrfile1(f, d, a, b)
#_______________________________________________________________________
function _yexport(p)
{
- #####################################################
return _tframe("_yexport_i0", p)
}
@@ -8035,7 +8071,6 @@ function _yexport_i0(p, p0, p1, p2)
#_________________________________________________________________
function cmp_str_idx(i1, v1, i2, v2)
{
- ##############################
return ((i1 < i2 ? -1 : 1))
}
@@ -8190,7 +8225,6 @@ function hujf(a, b, c)
#___________________________________________________________
function ncmp_str_idx(i1, v1, i2, v2)
{
- #######################
return ((i1 < i2 ? 1 : -1))
}
@@ -8317,5 +8351,4 @@ function zorr(A, i, r)
#_____________________________________________________________________________
function zzer()
{
- ################################################################
}
diff --git a/test/profile6.awk b/test/profile6.awk
new file mode 100644
index 00000000..754f8ae6
--- /dev/null
+++ b/test/profile6.awk
@@ -0,0 +1,7 @@
+BEGIN {
+ x = 3
+ print -(-x)
+ Q = "|"
+ print -3 Q (-4)
+ print -3 Q (-4) (-5)
+}
diff --git a/test/profile6.ok b/test/profile6.ok
new file mode 100644
index 00000000..0c9486c7
--- /dev/null
+++ b/test/profile6.ok
@@ -0,0 +1,10 @@
+ # BEGIN rule(s)
+
+ BEGIN {
+ 1 x = 3
+ 1 print -(-x)
+ 1 Q = "|"
+ 1 print -3 Q (-4)
+ 1 print -3 Q (-4) (-5)
+ }
+
diff --git a/test/profile7.awk b/test/profile7.awk
new file mode 100644
index 00000000..454694f9
--- /dev/null
+++ b/test/profile7.awk
@@ -0,0 +1,12 @@
+BEGIN {
+ print 1 / 10 * 10
+ print 1 / (10 * 10)
+ print 1 % 10 * 10
+ print 1 % (10 * 10)
+ print (10 * 5) / 2
+ print 10 * (5 / 2)
+ a = 5
+ b = 3
+ print a - 1 - b
+ print a + 1 - b
+}
diff --git a/test/profile7.ok b/test/profile7.ok
new file mode 100644
index 00000000..d65afa86
--- /dev/null
+++ b/test/profile7.ok
@@ -0,0 +1,15 @@
+ # BEGIN rule(s)
+
+ BEGIN {
+ 1 print 1 / 10 * 10
+ 1 print 1 / (10 * 10)
+ 1 print 1 % 10 * 10
+ 1 print 1 % (10 * 10)
+ 1 print 10 * 5 / 2
+ 1 print 10 * 5 / 2
+ 1 a = 5
+ 1 b = 3
+ 1 print a - 1 - b
+ 1 print a + 1 - b
+ }
+
diff --git a/test/profile8.awk b/test/profile8.awk
new file mode 100644
index 00000000..16252cea
--- /dev/null
+++ b/test/profile8.awk
@@ -0,0 +1,9 @@
+# Some
+# header
+# comments
+
+# Add up
+{ sum += $1 }
+
+# Print sum
+END { print sum }
diff --git a/test/profile8.ok b/test/profile8.ok
new file mode 100644
index 00000000..34f7a96b
--- /dev/null
+++ b/test/profile8.ok
@@ -0,0 +1,14 @@
+# Some
+# header
+# comments
+
+# Add up
+{
+ sum += $1
+}
+
+# Print sum
+END {
+ print sum
+}
+
diff --git a/test/range1.awk b/test/range1.awk
index aca5db50..aca5db50 100755..100644
--- a/test/range1.awk
+++ b/test/range1.awk
diff --git a/test/regexpbrack.awk b/test/regexpbrack.awk
new file mode 100644
index 00000000..136cd194
--- /dev/null
+++ b/test/regexpbrack.awk
@@ -0,0 +1,2 @@
+/[]+()0-9.,$%/'"-]*$/
+/^[]+()0-9.,$%/'"-]*$/
diff --git a/test/regexpbrack.in b/test/regexpbrack.in
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/regexpbrack.in
diff --git a/test/regexpbrack.ok b/test/regexpbrack.ok
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/regexpbrack.ok
diff --git a/test/sortglos.awk b/test/sortglos.awk
new file mode 100644
index 00000000..e4f910d7
--- /dev/null
+++ b/test/sortglos.awk
@@ -0,0 +1,51 @@
+BEGIN {
+ pr="y";
+ npre=0;
+ po="n";
+ npos=0;
+ }
+
+pr=="y" { npre++; pre[npre]=$0; }
+$1=="@table" && $2=="@asis" { pr="n";nite++; next; }
+
+po=="y" { npos++; pos[npos]=$0; }
+$1=="@end" && $2=="table" {
+ po="y";
+ npos++;
+ pos[npos]=$0;
+ # last item...
+ vec[nite]=nlin;
+}
+
+ { nite++; }
+
+END {
+ for ( i=1; i<=npre; i++ ) { print pre[i]; }
+ if ( srt=="y" ) {
+ n=asorti(entr,ital);
+ ##print "n=",n;
+ for ( i=1; i<=n; i++ ) {
+ #printf("=========> %3.3d %s\n",i,ital[i]);
+ # ital[i] is the sorted key;
+ j=entr[ital[i]];
+ # j is the original item number
+ for ( k=1; k<=vec[j]; k++ ) {
+ print dat[j,k];
+ }
+ }
+ }
+ if ( srt=="n" ) {
+ for ( i=1; i<=nite; i++ ) {
+ printf("=========> %3.3d %2.2d %s\n",i,vec[i],titl[i]);
+ for ( j=1; j<=vec[i]; j++ ) {
+ print dat[i,j];
+ }
+ }
+ print "========================= END";
+ }
+ for ( i=1; i<=npos; i++ ) { print pos[i]; }
+ print "@c npre=" npre;
+ print "@c nite=" nite;
+ print "@c npos=" npos;
+}
+
diff --git a/test/sortglos.in b/test/sortglos.in
new file mode 100644
index 00000000..b24373de
--- /dev/null
+++ b/test/sortglos.in
@@ -0,0 +1,22 @@
+@node Glossario
+@unnumbered Glossario
+
+@table @asis
+@item Azione
+Una serie di istruzioni @command{awk} associate a una regola. Se
+l'espressione di ricerca della regola individua un record in input,
+@command{awk} esegue su quel record l'azione relativa. Le azioni sono
+sempre racchiuse fra parentesi graffe.
+(@xref{Panoramica sulle azioni}).
+
+@item Spazio bianco
+Una sequenza di spazi, TAB, o caratteri di "a capo" presenti in un record in
+input o in una stringa.
+@end table
+
+@end ifclear
+
+@c The GNU General Public License.
+
+@c aggiornato alla versione: settembre 2014
+@c ultimo aggiornamento: 14 novembre 2014
diff --git a/test/sortglos.ok b/test/sortglos.ok
new file mode 100644
index 00000000..69ddbe67
--- /dev/null
+++ b/test/sortglos.ok
@@ -0,0 +1,15 @@
+@node Glossario
+@unnumbered Glossario
+
+@table @asis
+@end table
+
+@end ifclear
+
+@c The GNU General Public License.
+
+@c aggiornato alla versione: settembre 2014
+@c ultimo aggiornamento: 14 novembre 2014
+@c npre=4
+@c nite=22
+@c npos=8
diff --git a/test/testext.ok b/test/testext.ok
index 9b36bf72..897a7336 100644
--- a/test/testext.ok
+++ b/test/testext.ok
@@ -15,7 +15,7 @@ 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 PROCINFO passed - did not get a value
+var_test: sym_lookup of PROCINFO passed - got a value!
var_test: sym_lookup of ARGC passed - got a value!
var_test: sym_update of ARGC failed - correctly
var_test: sym_update("testvar") succeeded
@@ -23,6 +23,12 @@ var_test() returned 1, test_var = 42
test_errno() returned 1, ERRNO = No child processes
+fubar = 9
+rumpus = -5
+uid matches 1
+api_major matches 1
+test_deferred returns 1
+
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
@@ -69,6 +75,12 @@ test_scalar_reserved: could not update new_value2 for ARGC - pass
test_indirect_var: sym_lookup of NR passed
test_indirect_var: value of NR is 3
test_indirect_var() return 1
+
+test_get_file returned 0
+File [.test.alias] nr [1]: line 1
+File [.test.alias] nr [2]: line 2
+File [.test.alias] nr [3]: line 3
+
answer_num = 42
message_string = hello, world
new_array["hello"] = "world"
diff --git a/test/timeout.awk b/test/timeout.awk
new file mode 100644
index 00000000..ccf4537d
--- /dev/null
+++ b/test/timeout.awk
@@ -0,0 +1,26 @@
+BEGIN {
+ cmd = "echo hello; sleep 1; echo goodbye"
+
+ print "With timeouts"
+ PROCINFO[cmd, "READ_TIMEOUT"] = 300
+ while ((rc = (cmd | getline x)) > 0)
+ print x
+ if (rc < 0)
+ print rc, (PROCINFO["errno"] != 0), (ERRNO != "")
+ print (close(cmd) != 0)
+
+ PROCINFO[cmd, "RETRY"]
+ print ""
+ print "With timeouts and retries"
+ while (((rc = (cmd | getline x)) > 0) || (rc == -2)) {
+ if (rc > 0) {
+ print x
+ n = 0
+ }
+ else
+ print ++n, "timed out; trying again"
+ }
+ if (rc < 0)
+ print rc, (PROCINFO["errno"] != 0), (ERRNO != "")
+ print (close(cmd) != 0)
+}
diff --git a/test/timeout.ok b/test/timeout.ok
new file mode 100644
index 00000000..a388747b
--- /dev/null
+++ b/test/timeout.ok
@@ -0,0 +1,12 @@
+With timeouts
+hello
+-1 1 1
+1
+
+With timeouts and retries
+hello
+1 timed out; trying again
+2 timed out; trying again
+3 timed out; trying again
+goodbye
+0