diff options
author | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2014-12-14 12:53:35 -0500 |
---|---|---|
committer | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2014-12-14 12:53:35 -0500 |
commit | 1fc7a1fe6aba3c1ba98c44f8df1926c10ff79c87 (patch) | |
tree | e6eff5ba1ffaa2250c59ce02464d783b08508f4c /test | |
parent | f9c7ec30542ef2550761f49cd25503e0775ef271 (diff) | |
parent | 0d52289482d468c8566976d77c0c6a6a4e602add (diff) | |
download | egawk-1fc7a1fe6aba3c1ba98c44f8df1926c10ff79c87.tar.gz egawk-1fc7a1fe6aba3c1ba98c44f8df1926c10ff79c87.tar.bz2 egawk-1fc7a1fe6aba3c1ba98c44f8df1926c10ff79c87.zip |
Merge branch 'master' into select
Diffstat (limited to 'test')
-rw-r--r-- | test/ChangeLog | 23 | ||||
-rwxr-xr-x | test/Gentests | 2 | ||||
-rw-r--r-- | test/Makefile.am | 5 | ||||
-rw-r--r-- | test/Makefile.in | 11 | ||||
-rw-r--r-- | test/Maketests | 5 | ||||
-rw-r--r-- | test/gensub2.ok | 1 | ||||
-rw-r--r-- | test/mbprintf4.awk | 51 | ||||
-rw-r--r-- | test/mbprintf4.ok | 144 | ||||
-rw-r--r-- | test/profile5.ok | 707 | ||||
-rwxr-xr-x | test/sortglos.awk | 51 | ||||
-rwxr-xr-x | test/sortglos.in | 22 | ||||
-rw-r--r-- | test/sortglos.ok | 15 |
12 files changed, 601 insertions, 436 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index b6d60d97..5e6b2c13 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,26 @@ +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. 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 db1cb086..a00e011e 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -833,6 +833,9 @@ EXTRA_DIST = \ sortfor.awk \ sortfor.in \ sortfor.ok \ + sortglos.awk \ + sortglos.in \ + sortglos.ok \ sortu.awk \ sortu.ok \ space.ok \ @@ -998,7 +1001,7 @@ BASIC_TESTS = \ rand randtest range1 rebt8b1 redfilnm regeq 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 \ diff --git a/test/Makefile.in b/test/Makefile.in index 7214b707..93a989b5 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -205,6 +205,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@ @@ -1079,6 +1080,9 @@ EXTRA_DIST = \ sortfor.awk \ sortfor.in \ sortfor.ok \ + sortglos.awk \ + sortglos.in \ + sortglos.ok \ sortu.awk \ sortu.ok \ space.ok \ @@ -1243,7 +1247,7 @@ BASIC_TESTS = \ rand randtest range1 rebt8b1 redfilnm regeq 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 \ @@ -3201,6 +3205,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: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index f8d5e8a9..85c13d5d 100644 --- a/test/Maketests +++ b/test/Maketests @@ -777,6 +777,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: $$? >>_$@ 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/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/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/sortglos.awk b/test/sortglos.awk new file mode 100755 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 100755 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 |