"Fossies" - the Fresh Open Source Software Archive

Member "gawk-5.1.0/test/profile5.ok" (6 Mar 2020, 228237 Bytes) of package /linux/misc/gawk-5.1.0.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "profile5.ok": 5.0.1_vs_5.1.0.

    1 BEGIN {
    2 	_addlib("_BASE")
    3 }
    4 
    5 #___________________________________________________________________________________
    6 BEGIN {	############################################################################
    7 	BINMODE = "rw"
    8 	SUBSEP = "\000"
    9 	_NULARR[""]
   10 	delete _NULARR[""]
   11 	_INITBASE()
   12 }
   13 
   14 BEGIN {
   15 	_addlib("_sYS")
   16 }
   17 
   18 BEGIN {
   19 	_addlib("_rEG")
   20 }
   21 
   22 BEGIN {
   23 	_addlib("_INSTRUC")
   24 }
   25 
   26 #___________________________________________________________________________________
   27 BEGIN {	#############################################################################
   28 	_delay_perfmsdelay = 11500
   29 }
   30 
   31 BEGIN {
   32 	_addlib("_ARR")
   33 }
   34 
   35 #___________________________________________________________________________________
   36 BEGIN {
   37 }
   38 
   39 ###########################################################################
   40 BEGIN {
   41 	_addlib("_EXTFN")
   42 }
   43 
   44 #___________________________________________________________________________________
   45 BEGIN {	#############################################################################
   46 	delete _XCHR
   47 	delete _ASC
   48 	delete _CHR
   49 	t = ""
   50 	for (i = 0; i < 256; i++) {
   51 		_ASC[a = _CHR[i] = sprintf("%c", i)] = i
   52 		_QASC[a] = sprintf("%.3o", i)
   53 		_XCHR[_CHR[i]] = sprintf("%c", (i < 128 ? i + 128 : i - 128))
   54 	}
   55 	#_____________________________________________________________________________
   56 	for (i = 0; i < 256; i++) {
   57 		_QSTRQ[_CHR[i]] = "\\" sprintf("%.3o", i)
   58 	}
   59 	#_______________________________________________________________________
   60 	for (i = 0; i < 32; i++) {
   61 		_QSTR[_CHR[i]] = _QSTRQ[_CHR[i]]
   62 	}
   63 	for (; i < 128; i++) {
   64 		_QSTR[_CHR[i]] = _CHR[i]
   65 	}
   66 	for (; i < 256; i++) {
   67 		_QSTR[_CHR[i]] = _QSTRQ[_CHR[i]]
   68 	}
   69 	_QSTR["\\"] = "\\\\"	#; _QSTR["\""]="\\\""
   70 	#_____________________________________________________________________________
   71 	_CHR["CR"] = "\r"
   72 	_CHR["EOL"] = "\r\n"
   73 	_CHR["EOF"] = "\032"
   74 	_QSTR[_CHR["EOL"]] = "\\015\\012"
   75 	#_______________________________________________________________________
   76 	_CHR["MONTH"][_CHR["MONTH"]["Jan"] = "01"] = "Jan"
   77 	_CHR["MONTH"][_CHR["MONTH"]["Feb"] = "02"] = "Feb"
   78 	_CHR["MONTH"][_CHR["MONTH"]["Mar"] = "03"] = "Mar"
   79 	_CHR["MONTH"][_CHR["MONTH"]["Apr"] = "04"] = "Apr"
   80 	_CHR["MONTH"][_CHR["MONTH"]["May"] = "05"] = "May"
   81 	_CHR["MONTH"][_CHR["MONTH"]["Jun"] = "06"] = "Jun"
   82 	_CHR["MONTH"][_CHR["MONTH"]["Jul"] = "07"] = "Jul"
   83 	_CHR["MONTH"][_CHR["MONTH"]["Aug"] = "08"] = "Aug"
   84 	_CHR["MONTH"][_CHR["MONTH"]["Sep"] = "09"] = "Sep"
   85 	_CHR["MONTH"][_CHR["MONTH"]["Oct"] = "10"] = "Oct"
   86 	_CHR["MONTH"][_CHR["MONTH"]["Nov"] = "11"] = "Nov"
   87 	_CHR["MONTH"][_CHR["MONTH"]["Dec"] = "12"] = "Dec"
   88 	#_____________________________________________________________________________
   89 	_TAB_STEP_DEFAULT = 8
   90 	#_____________________________________________________________________________
   91 	for (i = 0; i < 32; i++) {
   92 		_REXPSTR[_CHR[i]] = _QSTRQ[_CHR[i]]
   93 	}
   94 	for (; i < 256; i++) {
   95 		_REXPSTR[_CHR[i]] = _CHR[i]
   96 	}
   97 	_gensubfn("\\^$.()|{,}[-]?+*", ".", "_rexpstr_i0")
   98 }
   99 
  100 BEGIN {
  101 	_addlib("_SYSIO")
  102 }
  103 
  104 #___________________________________________________________________________________
  105 BEGIN {	#############################################################################
  106 	_SYS_STDCON = "CON"
  107 	_CON_WIDTH = match(_cmd("MODE " _SYS_STDCON " 2>NUL"), /Columns:[ \t]*([0-9]+)/, A) ? strtonum(A[1]) : 80
  108 }
  109 
  110 BEGIN {
  111 	_addlib("_FILEIO")
  112 }
  113 
  114 #___________________________________________________________________________________
  115 BEGIN {	#############################################################################
  116 	if (_SYS_STDOUT == "") {
  117 		_SYS_STDOUT = "/dev/stdout"
  118 	}
  119 	if (_SYS_STDERR == "") {
  120 		_SYS_STDERR = "/dev/stderr"
  121 	}
  122 	_CHR["SUBDIR"] = "\\"
  123 	if (_gawk_scriptlevel < 1) {
  124 		match(b = _cmd("echo %CD% 2>NUL"), /[^\x00-\x1F]*/)
  125 		ENVIRON["CD"] = _FILEIO_RD = _filerd(substr(b, RSTART, RLENGTH) _CHR["SUBDIR"])
  126 		_FILEIO_R = _filer(_FILEIO_RD)
  127 		_FILEIO_D = _filed(_FILEIO_RD)
  128 		_setmpath(_filerd(_FILEIO_RD "_tmp" _CHR["SUBDIR"]))
  129 	}
  130 }
  131 
  132 BEGIN {
  133 	_addlib("_tOBJ")
  134 }
  135 
  136 #___________________________________________________________________________________
  137 BEGIN {	#############################################################################
  138 	_tInBy = "\212._tInBy"
  139 	_tgenuid_init()
  140 	_UIDS[""]
  141 	delete _UIDS[""]
  142 	_UIDSDEL[""]
  143 	delete _UIDSDEL[""]
  144 	_tPREV[""]
  145 	_tPARENT[""]
  146 	_tNEXT[""]
  147 	_tFCHLD[""]
  148 	_tQCHLD[""]
  149 	_tLCHLD[""]
  150 	_tLINK[""]
  151 	_tCLASS[""]
  152 	_tSTR[""]
  153 	_tDLINK[""]
  154 	_[""]
  155 	delete _[""]
  156 	_ptr[""]
  157 	delete _ptr[""]
  158 	_TMP0[""]
  159 	delete _TMP0[""]
  160 	_TMP1[""]
  161 	delete _TMP1[""]
  162 }
  163 
  164 BEGIN {
  165 	_addlib("_ERRLOG")
  166 }
  167 
  168 #___________________________________________________________________________________
  169 BEGIN {	#############################################################################
  170 	if (_gawk_scriptlevel < 1) {
  171 		_ERRLOG_TF = 1
  172 		_ERRLOG_VF = 1
  173 		_ERRLOG_IF = 1
  174 		_ERRLOG_WF = 1
  175 		_ERRLOG_EF = 1
  176 		_ERRLOG_FF = 1
  177 		_wrfile(_errlog_file = _getmpfile("OUTPUT.LOG"), "")
  178 	}
  179 }
  180 
  181 BEGIN {
  182 	_addlib("_SHORTCUT")
  183 }
  184 
  185 #___________________________________________________________________________________
  186 BEGIN {
  187 	_shortcut_init()
  188 }
  189 
  190 #########################################################
  191 BEGIN {
  192 	_addlib("_eXTFN")
  193 }
  194 
  195 #___________________________________________________________________________________
  196 BEGIN {
  197 	_extfn_init()
  198 }
  199 
  200 ############################################################
  201 BEGIN {
  202 	_addlib("_sHARE")
  203 }
  204 
  205 BEGIN {
  206 	_addlib("_FILEVER")
  207 }
  208 
  209 BEGIN {
  210 	_addlib("_DS")	###############################################################################
  211 	_PRODUCT_NAME = "Deployment Solution Control"
  212 	_PRODUCT_VERSION = "1.0"
  213 	_PRODUCT_COPYRIGHT = "Copyright (C) 2013 by CosumoGEN"
  214 	_PRODUCT_FILENAME = "_main.ewk"
  215 }
  216 
  217 # problem configuring uid by array charset: i can' understand what format of the array: possibly - remove array support
  218 # after removal of array format detection: there is unfinished conflicts: it is possible to totally remove array uid-gen initialization
  219 
  220 #_____________________________________________________
  221 BEGIN {
  222 	_inituidefault()
  223 }
  224 
  225 #_____________________________________________________
  226 BEGIN {
  227 	_initfilever()
  228 }
  229 
  230 #_____________________________________________________
  231 BEGIN {
  232 	_initshare()
  233 }
  234 
  235 #_________________________________________________________________
  236 BEGIN {
  237 	_inspass(_IMPORT, "_import_data")
  238 }
  239 
  240 #_______________________________________________
  241 BEGIN {
  242 	_TEND[_ARRLEN] = 0
  243 	_TYPEWORD = "_TYPE"
  244 }
  245 
  246 #_______________________________________________
  247 BEGIN {
  248 	_ARRLEN = "\032LEN"
  249 	_ARRPTR = "\032PTR"
  250 	_ARRSTR = ""
  251 }
  252 
  253 #_____________________________________________________
  254 BEGIN {
  255 	_getperf_fn = "_nop"
  256 }
  257 
  258 BEGIN {
  259 	_datablock_length = 262144
  260 }
  261 
  262 #_____________________________________________________
  263 BEGIN {
  264 	_initrdreg()
  265 }
  266 
  267 #_____________________________________________________
  268 BEGIN {
  269 	_initregpath0()
  270 }
  271 
  272 #_____________________________________________________
  273 BEGIN {
  274 	_initsys()
  275 }
  276 
  277 #_________________________________________________________________________________________
  278 ##########################################################################################
  279 
  280 
  281 
  282 
  283 
  284 
  285 
  286 #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
  287 #\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
  288 BEGIN {	############################################################################
  289 	a = ENVIRON["EGAWK_CMDLINE"]
  290 	gsub(/^[ \t]*/, "", a)
  291 	a = _lib_CMDLN(a)
  292 	if ((a != "") && (! _LIBAPI["F"]["!"])) {
  293 		_out(_lib_HELP())
  294 		_fatal("Bad comandline argument `" a "'")
  295 	}
  296 	gsub(/^[ \t]*/, "", a)
  297 	ENVIRON["EGAWK_CMDLINE"] = a
  298 	_lib_APPLY()
  299 	if (_basexit_fl) {
  300 		exit
  301 	}
  302 	_INIT()
  303 	_START()
  304 	_END()
  305 }
  306 
  307 #_____________________________________________________________________________
  308 END {	########################################################################
  309 	_EXIT()
  310 }
  311 
  312 #_______________________________________________________________________
  313 ########################################################################
  314 END {	###############################################################################
  315 	if (_gawk_scriptlevel < 1) {
  316 		close(_errlog_file)
  317 		p = _Zimport(_rdfile(_errlog_file), _N())
  318 		if ((t = _get_errout(p)) != "") {
  319 			_expout(t, "/dev/stderr")
  320 		}
  321 	}
  322 }
  323 
  324 ##########################################################################################
  325 # PUBLIC:
  326 #_____________________________________________________________________________
  327 # _rFBRO(ptr)				- Return ptr of first-bro.				[TESTED]
  328 #						If !ptr then returns "".
  329 #_____________________________________________________________________________
  330 # _rLBRO(ptr)				- Return ptr of last-bro.				[TESTED]
  331 #						If !ptr then returns "".
  332 #_____________________________________________________________________________
  333 # _rQBRO(ptr)				- Returns brothers total quantity.			[TESTED]
  334 #						If !ptr then returns "".
  335 END {	###############################################################################
  336 	if (_gawk_scriptlevel < 1) {
  337 		if (! _fileio_notdeltmpflag) {
  338 			_FILEIO_TMPATHS[_FILEIO_TMPRD]
  339 			_Foreach(_FILEIO_TMPATHS, "_uninit_del")
  340 		}
  341 	}
  342 }
  343 
  344 #___________________________________________________________________________________
  345 ####################################################################################
  346 
  347 
  348 
  349 
  350 
  351 
  352 
  353 
  354 
  355 
  356 
  357 
  358 
  359 
  360 
  361 
  362 #___________________________________________________________________________________
  363 # fn	_dirtree(array,pathmask)
  364 #
  365 #	Return in `array' file tree from pathmask:
  366 #		array["file.filerdne"]="size date time"
  367 #		array["subdir.filerd"]["file.filerdne"]="size date time"
  368 #		array["subdir.filerd"]["file.filerd"][...]
  369 #
  370 #		The array will be cleared before any action. Function return pathmask w/o ltabspc and rtabspc.
  371 #___________________________________________________________________________________
  372 
  373 
  374 
  375 
  376 
  377 # OK:		change internal function's names to: w\o "_"
  378 # OK:		FLENGTH: should cover r-spcs
  379 # OK:		optimize REXP
  380 # OK:		add new symbols to dir/file names ( ! and + )
  381 # OK:		create _getfilepath()
  382 # OK:		del - conflict with WROOTDIR (do not update it)
  383 # OK:		dir/del - support for filemask ( * and ? )
  384 # OK:		how to define code injections: header\ender; and HANDLERS
  385 # OK:		units in header\ender? conline division...
  386 # OK:		_FILEPATH problem: it will not been defined at the moment when subscript0 starts - at the start TMPRD="_tmp"
  387 # OK:		del:	if del("dir\\") - then all ok except it NOT deleted "dir\\"	- _del function removed(renamed to __del)
  388 # OK:		tmpdirs: it delete only autotmp dir and only from script0
  389 # OK:		MICROTEST:	global testing of filepath (UNC! CORRECT RESULTS! )
  390 #	question about cache: did new just now generated absolute filepath cached in FILECACHE? its seems like NO
  391 # 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?????
  392 #ERRLOG:	_setmpath:	warning!!!!!
  393 
  394 #___________________________________________________________________________________
  395 ####################################################################################
  396 # PUBLIC:
  397 #___________________________________________________________________________________
  398 #
  399 #	fn	_rdfile(_filepath)
  400 #
  401 #		Read and return data from file specified in _filepath.
  402 #			If _filepath=="" then no action occured and return "".
  403 #			Function read and return data from file. No any changes in data occured.
  404 #			Function use _filerdne function internally. If some syntax error
  405 #				found in _filepath then function return "".
  406 #			If some error occured while reading data from file then fuction return ""
  407 #				and error-text is in ERRNO(and no close-file action will be occured!).
  408 #			If reading data completed successfully then function try to close
  409 #				file and if while closing file some error occured then function
  410 #				returns "" and error-text is in ERRNO.
  411 #			Otherwise function returns readed data.
  412 #_____________________________________________________________________________
  413 #
  414 #	fn	_wrfile(_filepath,_data)
  415 #
  416 #		Write data into file specified in _filepath.
  417 #			If _filepath=="" then no action occured and return "".
  418 #			Function write _data to file. No any changes in data occured.
  419 #			Function use _filerdne function internally. If some syntax error
  420 #				found in _filepath then function return "".
  421 #			If some error occured while writing data to file then fuction return ""
  422 #				and error-text is in ERRNO(and no close-file action will be occured!).
  423 #			If writing data completed successfully then function try to close
  424 #				file and if while closing file some error occured then function
  425 #				returns "" and error-text is in ERRNO.
  426 #			Otherwise function returns _filepath(re-processed).
  427 #___________________________________________________________________________________
  428 #
  429 #	fn	_filepath(_filepath)
  430 #
  431 #		Return re-processed root-dir-name-ext of _filepath.
  432 #			If _filepath=="" then no action occured and return "".
  433 #			If some syntax error found in _filepath then function return ""
  434 #				(and NO _filepath-cache-record will be created!).
  435 #_____________________________________________________________________________
  436 #
  437 #	fn	_filerdne(_filepath)
  438 #
  439 #		Return re-processed root-dir-filename of _filepath.
  440 #			If _filepath=="" then no action occured and return "".
  441 #			Function return result only if in _filepath present file-name(name
  442 #				and/or extension) - otherwise its return "".
  443 #			If some syntax error found in _filepath then function return ""
  444 #				(and NO _filepath-cache-record will be created!).
  445 #_____________________________________________________________________________
  446 #
  447 #	fn	_filerdn(_filepath)
  448 #
  449 #		Return re-processed root-dir-name of _filepath.
  450 #			If _filepath=="" then no action occured and return "".
  451 #			Function return result only if in _filepath present name field -
  452 #				- otherwise its return "".
  453 #			If some syntax error found in _filepath then function return ""
  454 #				(and NO _filepath-cache-record will be created!).
  455 #_____________________________________________________________________________
  456 #
  457 #	fn	_filerd(_filepath)
  458 #
  459 #		Return re-processed root-dir of _filepath.
  460 #			If _filepath=="" then no action occured and return "".
  461 #			If some syntax error found in _filepath then function return ""
  462 #				(and NO _filepath-cache-record will be created!).
  463 #_____________________________________________________________________________
  464 #
  465 #	fn	_filer(_filepath)
  466 #
  467 #		Return re-processed root of _filepath.
  468 #			If _filepath=="" then no action occured and return "".
  469 #			If some syntax error found in _filepath then function return ""
  470 #				(and NO _filepath-cache-record will be created!).
  471 #_____________________________________________________________________________
  472 #
  473 #	fn	_filed(_filepath)
  474 #
  475 #		Return re-processed dir of _filepath.
  476 #			If _filepath=="" then no action occured and return "".
  477 #			There is only one case when dir string can be =="" - when in
  478 #				_filepath specified unmounted drive(MS-format) and from-
  479 #				current-location address used(like Z:file.ext). In this
  480 #				case no rootdir-cache-record will be created.
  481 #			If some syntax error found in _filepath then function return ""
  482 #				(and NO _filepath-cache-record will be created!).
  483 #_____________________________________________________________________________
  484 #	fn	_filene(_filepath)
  485 #
  486 #		Return re-processed name-ext of _filepath.
  487 #			If _filepath=="" then no action occured and return "".
  488 #			Function return result only if in _filepath present file-name(name
  489 #				and/or extension) - otherwise its return "".
  490 #			If some syntax error found in _filepath then function return ""
  491 #				(and NO _filepath-cache-record will be created!).
  492 #_____________________________________________________________________________
  493 #
  494 #	fn	_filen(_filepath)
  495 #
  496 #		Return re-processed name of _filepath.
  497 #			If _filepath=="" then no action occured and return "".
  498 #			Function return result only if in _filepath present name field -
  499 #				- otherwise its return "".
  500 #			If some syntax error found in _filepath then function return ""
  501 #				(and NO _filepath-cache-record will be created!).
  502 #_____________________________________________________________________________
  503 #
  504 #	fn	_file(_filepath)
  505 #
  506 #		Return re-processed ext of _filepath.
  507 #			If _filepath=="" then no action occured and return "".
  508 #			Function return result only if in _filepath present ext field -
  509 #				- otherwise its return "".
  510 #			If some syntax error found in _filepath then function return ""
  511 #				(and NO _filepath-cache-record will be created!).
  512 #___________________________________________________________________________________
  513 #
  514 #	fn	_dir(_ARR,_filepathmask)
  515 #
  516 #		Get file-/folder-list of root-folder of _filepathmask.
  517 #			If _filepathmask=="" then no action occured and return "".
  518 #			_filepathmask can contain symbols like `*' and `?' as like
  519 #				its used in `dir'-shell command.
  520 #			Function gets file-/folder-list of specified root-dir-_filepathmask
  521 #				and return this list in array _ARR - where each element:
  522 #
  523 #			index - is the _filepath of file-or-folder name-ext
  524 #			value - contains 3 fields separated by " ":
  525 #				1. =="D" if this is folder
  526 #				   ==/[0-9]+/ if this is file - size of file in bytes
  527 #				2. ==date-of-creation of file or folder
  528 #				3. ==time-of-creation of file or folder
  529 #
  530 #			Function returns quantity of items in ARR.
  531 #___________________________________________________________________________________
  532 #
  533 #	fn	_filexist(_filepath)
  534 #
  535 #		Test if file or path or drive specified in _filepath is exist.
  536 #				If _filepath=="" then no action occured and return "".
  537 #				If some syntax error found in _filepath then function return ""
  538 #			(and NO _filepath-cache-record will be created!).
  539 #				Function returns _filepath if _filepath is exist. Otherwise
  540 #			function return 0.
  541 #_____________________________________________________________________________
  542 #
  543 #	fn	_filenotexist(_filepath)
  544 #
  545 #		Test if file or path or drive specified in _filepath is not exist.
  546 #			If _filepath=="" then no action occured and return "".
  547 #			If some syntax error found in _filepath then function return ""
  548 #				(and NO _filepath-cache-record will be created!).
  549 #			Function returns 1 if _filepath is not exist. Otherwise function
  550 #				return 0.
  551 #_____________________________________________________________________________
  552 #
  553 #	fn	_newdir(_filepath)
  554 #
  555 #		Create path specified in root-dir-_filepath.
  556 #			If _filepath=="" then no action occured and return "".
  557 #			If some syntax error found in _filepath then function return ""
  558 #				(and NO _filepath-cache-record will be created!).
  559 #			Function returns root-dir of _filepath.
  560 #_______________________________________________________________________
  561 #
  562 #	fn	_newdir(_filepath)
  563 #
  564 #		Create path specified in root-dir-_filepath. If this folder
  565 #		already exist then it will be completely cleared.
  566 #			If _filepath=="" then no action occured and return "".
  567 #			If some syntax error found in _filepath then function return ""
  568 #				(and NO _filepath-cache-record will be created!).
  569 #			Function returns root-dir of _filepath.
  570 #___________________________________________________________________________________
  571 #
  572 #	fn	_getmpfile(_filepath,_currfilepath)
  573 #
  574 #		Return ....
  575 #
  576 #_____________________________________________________________________________
  577 #
  578 #	fn	_getmpdir(_filepath,_currfilepath)
  579 #
  580 #		Return ...
  581 #
  582 #_____________________________________________________________________________
  583 #
  584 #	Temporary files folder.
  585 #
  586 #		Temporary files folder location is defined by _FILEIO_TMPRD.
  587 #		If it wasn't been initialized before program run or not been initialized
  588 #			by ENVIRON["TMPDIR"] then it will defined as the:
  589 #				`current rootdir(stored in _FILEIO_RD)\programname.TMP'
  590 #			In this case if its already exist then it will completely cleared when _FILEIO
  591 #			library initialization processed.
  592 #			And at the program uninitialization processed it will completely
  593 #			cleared if _FILEIO_TMPCLRFLAG is true.
  594 #___________________________________________________________________________________
  595 #
  596 #	var	_FILEIO_RD (ENVIRON["CD"])
  597 #
  598 #		This var can be set before running program. It can contain path which
  599 #		will be used as default current dir while program run.
  600 #		If this var is set before program runs - then it will be refreshed by the
  601 #			_filerd it will be used as default current dir while program run.
  602 #		If this var is not set before program runs - then ENVIRON["CD"] can also
  603 #			set up default current dir while program run. If it set before program
  604 #			begin then it will be refreshed by the _filerd - and also writed into
  605 #			_FILEIO_RD.
  606 #		If both _FILEIO_RD and ENVIRON["CD"] are not set before program begins
  607 #			then real current root\dir will be writed into both _FILEIO_RD and
  608 #			ENVIRON["CD"] and it will be used as default current dir while program run.
  609 #
  610 #___________________________________________________________________________________
  611 #
  612 #	var	_FILEIO_TMPRD (ENVIRON["TMPRD"])
  613 #
  614 #		This var can be set before running program. It can contain path which
  615 #		will be used as default temporary files root-folder while program run.
  616 #		If this var is set before program runs - then it will be refreshed by the
  617 #			_filerd - and also writed into ENVIRON["TMPRD"].
  618 #		If this var is not set before program runs - then ENVIRON["TMPRD"] can also
  619 #			set up default temporary files root-folder while program run. If it set
  620 #			before program begin then it will be refreshed by the _filerd - and
  621 #			also writed into _FILEIO_TMPRD.
  622 #		If both _FILEIO_TMPRD and ENVIRON["TMPRD"] are not set before program begins
  623 #			then new folder into path specified by the _FILEIO_RD(after its handling)
  624 #			will be writed into both _FILEIO_TMPRD and ENVIRON["TMPRD"] and it
  625 #			will be used as default temporary files root-folder while program run.
  626 #___________________________________________________________________________________
  627 #
  628 #	var	_FILEPATH
  629 #
  630 #		This var contain filepath of working script. It should be setting up externally.
  631 #
  632 #	var	_gawk_scriptlevel
  633 #___________________________________________________________________________________
  634 ####################################################################################
  635 END {	###############################################################################
  636 	if (_constatstrln > 0) {
  637 		_constat()
  638 	}
  639 }
  640 
  641 #___________________________________________________________________________________
  642 ####################################################################################
  643 
  644 
  645 
  646 
  647 
  648 
  649 
  650 # make sure that stdout contain only expected characters
  651 # make sure that stderr contain only expected characters
  652 # redesign & reformat keys and its outputs
  653 # try different key combinations
  654 # add lib-specified to all libs
  655 
  656 #_______________________________________________________________________
  657 function W(p, p0, p1)
  658 {
  659 	#####################################################
  660 	if (isarray(p0)) {
  661 		delete p0[p]
  662 		if (isarray(p1)) {
  663 			for (i in p1) {
  664 				if (isarray(p1[i])) {
  665 					p0[p][i][""]
  666 					delete p0[p][i][""]
  667 					_N_i0(p0[p][i], p1[i])
  668 				} else {
  669 					p0[p][i] = p1[i]
  670 				}
  671 			}
  672 			return p
  673 		}
  674 		return (p0[p] = p1)
  675 	}
  676 	delete _[p][p0]
  677 	if (isarray(p1)) {
  678 		for (i in p1) {
  679 			if (isarray(p1[i])) {
  680 				_[p][p0][i][""]
  681 				delete _[p][p0][i][""]
  682 				_N_i0(_[p][p0][i], p1[i])
  683 			} else {
  684 				_[p][p0][i] = p1[i]
  685 			}
  686 		}
  687 		return p
  688 	}
  689 	return (_[p][p0] = p1)
  690 }
  691 
  692 ##########################################################
  693 function _ARR(c, t, P)
  694 {
  695 	switch (c) {
  696 	case "_lib_CMDLN":
  697 		return t
  698 		#___________________________________________________________
  699 	case "_lib_APPLY":
  700 		return
  701 		#___________________________________________________________
  702 	case "_lib_HELP":
  703 		return
  704 		#___________________________________________________________
  705 	case "_lib_NAMEVER":
  706 		return _ln("_ARR 1.0")
  707 		#___________________________________________________________
  708 	case "_lib_BEGIN":
  709 		return
  710 		#___________________________________________________________
  711 	case "_lib_END":
  712 		return
  713 	}
  714 }
  715 
  716 ##########################################################
  717 function _BASE(c, t, P, A)
  718 {
  719 	switch (c) {
  720 	case "_lib_CMDLN":
  721 		if (match(t, /^((--([Vv])ersion)|(-([Vv])))[ \t]*/, A)) {
  722 			t = substr(t, RLENGTH + 1)
  723 			_cmdln_version = A[3] A[5]
  724 		} else if (match(t, /^((-?\?)|(--help))[ \t]*/)) {
  725 			t = substr(t, RLENGTH + 1)
  726 			_cmdln_help = 1
  727 		} else if (match(t, /^--[ \t]*/)) {
  728 			return _endpass(substr(t, RLENGTH + 1))
  729 		}
  730 		return t
  731 		#___________________________________________________________
  732 	case "_lib_APPLY":
  733 		if (_cmdln_help) {
  734 			match(_fbaccr(_LIBAPI, "_lib_HELP"), /^([^\x00]*)\x00([^\x01]*)\x01(.*)/, A)
  735 			_out(A[2] A[1] A[3])
  736 			return _endpass(_basexit_fl = 1)
  737 		}
  738 		if (_cmdln_version) {
  739 			_out(_ln(_PRODUCT_NAME " v" _PRODUCT_VERSION) _ln(_PRODUCT_COPYRIGHT) _ln() (_cmdln_version == "v" ? "" : _lib_NAMEVER()))
  740 			return _endpass(_basexit_fl = 1)
  741 		}
  742 		return
  743 		#___________________________________________________________
  744 	case "_lib_HELP":
  745 		return ("\000" _ln(_PRODUCT_NAME " v" _PRODUCT_VERSION) _ln(_PRODUCT_COPYRIGHT) _ln() _ln(" Usage:") _ln() _ln("    " _PRODUCT_FILENAME " [/key1 /key2...] [-- cmdline]") _ln() _ln(" keys:") _ln() "\001" _ln("    -v -V --version                    - output product version and (if /V) all modules") _ln("    ? -? --help                        - output this help page") _ln("    --                                 - command line string edge"))
  746 		#___________________________________________________________
  747 	case "_lib_NAMEVER":
  748 		return _ln("_BASE 3.0")
  749 		#___________________________________________________________
  750 	case "_lib_BEGIN":
  751 		return
  752 		#___________________________________________________________
  753 	case "_lib_END":
  754 		return
  755 	}
  756 }
  757 
  758 #____________________________________________________________________________
  759 function _DS(c, t, P, a, A)
  760 {
  761 	######################################################
  762 	switch (c) {
  763 	#___________________________________________________________
  764 	case "_lib_CMDLN":
  765 		return t
  766 		#_____________________________________________________
  767 	case "_lib_APPLY":
  768 		return
  769 		#_____________________________________________________
  770 	case "_lib_HELP":
  771 		return (_ln() _ln(" Usage: " _PRODUCT_NAME " [/key1 /key2...] sourcefile [cmdline]") _ln())
  772 		#_____________________________________________________
  773 	case "_lib_NAMEVER":
  774 		return
  775 		#_____________________________________________________
  776 	case "_lib_BEGIN":
  777 		return
  778 		#_____________________________________________________
  779 	case "_lib_END":
  780 		return
  781 	}
  782 }
  783 
  784 #______________________________________________________________________________________________
  785 function _END()
  786 {
  787 	#################################################################################
  788 }
  789 
  790 ########################################################
  791 function _ERRLOG(c, t, P, a, b, A)
  792 {
  793 	switch (c) {
  794 	case "_lib_CMDLN":
  795 		if (match(t, /^[ \t]*-L:([TtVvIiWwEeFf]*)[ \t]*/, A)) {
  796 			t = substr(t, RLENGTH + 1)
  797 			_errlog_errflkey = _errlog_errflkey A[1]
  798 		}
  799 		return t
  800 		#_______________________________________________________________________
  801 	case "_lib_APPLY":
  802 		if (_errlog_errflkey) {
  803 			split(_errlog_errflkey, A, "")
  804 			for (a = 1; a in A; a++) {
  805 				if (A[a] == toupper(A[a])) {
  806 					b = 1
  807 				} else {
  808 					b = ""
  809 				}
  810 				switch (toupper(A[a])) {
  811 				case "T":
  812 					_ERRLOG_TF = b
  813 					break
  814 				case "V":
  815 					_ERRLOG_VF = b
  816 					break
  817 				case "I":
  818 					_ERRLOG_IF = b
  819 					break
  820 				case "W":
  821 					_ERRLOG_WF = b
  822 					break
  823 				case "E":
  824 					_ERRLOG_EF = b
  825 					break
  826 				case "F":
  827 					_ERRLOG_FF = b
  828 					break
  829 				}
  830 			}
  831 			if (_ERRLOG_IF) {
  832 				_info("Log-message types inherited acc/deny: " "TRACE " (_ERRLOG_TF ? "ON" : "OFF") "/" "VERBOSE " (_ERRLOG_VF ? "ON" : "OFF") "/" "INFO " (_ERRLOG_IF ? "ON" : "OFF") "/" "WARNING " (_ERRLOG_WF ? "ON" : "OFF") "/" "ERROR " (_ERRLOG_EF ? "ON" : "OFF") "/" "FATAL " (_ERRLOG_FF ? "ON" : "OFF"))
  833 			}
  834 		}
  835 		return
  836 		#_______________________________________________________________________
  837 	case "_lib_HELP":
  838 		return (_ln("    -L:TtVvIiWwEeFf                    - enable(upcase: TVIWEF) or disable(lowcase: tviwef) allowable type of") _ln("                                         log messages. Trace/Verbose/Informational/Warning/Error/Fatal.") _ln())
  839 		#_______________________________________________________________________
  840 	case "_lib_NAMEVER":
  841 		return _ln("_ERRLOG 1.0")
  842 		#_______________________________________________________________________
  843 	case "_lib_BEGIN":
  844 		P["_ERRLOG_TF"] = _ERRLOG_TF
  845 		P["_ERRLOG_VF"] = _ERRLOG_VF
  846 		P["_ERRLOG_IF"] = _ERRLOG_IF
  847 		P["_ERRLOG_WF"] = _ERRLOG_WF
  848 		P["_ERRLOG_EF"] = _ERRLOG_EF
  849 		P["_ERRLOG_FF"] = _ERRLOG_FF
  850 		P["_errlog_file"] = "/dev/stderr"
  851 		return
  852 	}
  853 }
  854 
  855 #______________________________________________________________________________________________
  856 function _EXIT()
  857 {
  858 	################################################################################
  859 }
  860 
  861 ########################################################
  862 function _EXTFN(c, t, P)
  863 {
  864 	switch (c) {
  865 	case "_lib_CMDLN":
  866 		return t
  867 		#___________________________________________________________
  868 	case "_lib_APPLY":
  869 		return
  870 		#___________________________________________________________
  871 	case "_lib_HELP":
  872 		return
  873 		#___________________________________________________________
  874 	case "_lib_NAMEVER":
  875 		return _ln("_EXTFN 1.0")
  876 		#___________________________________________________________
  877 	case "_lib_BEGIN":
  878 		return
  879 		#___________________________________________________________
  880 	case "_lib_END":
  881 		return
  882 	}
  883 }
  884 
  885 #######################################################
  886 function _FILEIO(c, t, P, A)
  887 {
  888 	switch (c) {
  889 	case "_lib_CMDLN":
  890 		if (match(t, /^[ \t]*-[Tt]([\+-])[ \t]*/, A)) {
  891 			t = substr(t, RLENGTH + 1)
  892 			if (A[1] == "+") {
  893 				_fileio_notdeltmpflag = 1
  894 			} else {
  895 				_fileio_notdeltmpflag = ""
  896 			}
  897 		}
  898 		return t
  899 		#___________________________________________________________
  900 	case "_lib_APPLY":
  901 		if (_fileio_notdeltmpflag) {
  902 			_info("Temporary objects deletion DISABLED (inherited)")
  903 		}
  904 		return
  905 		#___________________________________________________________
  906 	case "_lib_HELP":
  907 		return (_ln("    -[Tt][+-]                          - inherited: +enable\\-disable temporary files\\dirs deletion") _ln())
  908 		#___________________________________________________________
  909 	case "_lib_NAMEVER":
  910 		return _ln("_FILEIO 2.1")
  911 		#___________________________________________________________
  912 	case "_lib_BEGIN":
  913 		P["ENVIRON"]["CD"] = ENVIRON["CD"]
  914 		P["_FILEIO_RD"] = _FILEIO_RD
  915 		P["_FILEIO_R"] = _FILEIO_R
  916 		P["_FILEIO_D"] = _FILEIO_D
  917 		if (! ("_FILEIO_TMPRD" in P)) {
  918 			P["_FILEIO_TMPRD"] = _getmpdir(_filen(P["SOURCE"]) "." ++_egawk_subcntr _CHR["SUBDIR"])
  919 		}
  920 		return
  921 		#___________________________________________________________
  922 	case "_lib_END":
  923 		return
  924 	}
  925 }
  926 
  927 ############################################################
  928 
  929 #_____________________________________________________________________________
  930 function _FILEVER(c, t, P, a, A)
  931 {
  932 	#################################################
  933 	switch (c) {
  934 	#___________________________________________________________
  935 	case "_lib_CMDLN":
  936 		return t
  937 		#_____________________________________________________
  938 	case "_lib_APPLY":
  939 		return
  940 		#_____________________________________________________
  941 	case "_lib_HELP":
  942 		return
  943 		#_____________________________________________________
  944 	case "_lib_NAMEVER":
  945 		return
  946 		#_____________________________________________________
  947 	case "_lib_BEGIN":
  948 		return
  949 		#_____________________________________________________
  950 	case "_lib_END":
  951 		return
  952 	}
  953 }
  954 
  955 function _Foreach(A, f, p0, i)
  956 {
  957 	for (i in A) {
  958 		@f(A, i, p0)
  959 	}
  960 }
  961 
  962 function _INIT(f)
  963 {
  964 }
  965 
  966 #___________________________________________________________________________________
  967 function _INITBASE()
  968 {
  969 	################################################################
  970 	_egawk_utilpath = ENVIRON["EGAWK_PATH"] "BIN\\UTIL\\"
  971 }
  972 
  973 ######################################################
  974 function _INSTRUC(c, t, P)
  975 {
  976 	switch (c) {
  977 	case "_lib_CMDLN":
  978 		return t
  979 		#___________________________________________________________
  980 	case "_lib_APPLY":
  981 		return
  982 		#___________________________________________________________
  983 	case "_lib_HELP":
  984 		return
  985 		#___________________________________________________________
  986 	case "_lib_NAMEVER":
  987 		return _ln("_INSTRUC 1.0")
  988 		#___________________________________________________________
  989 	case "_lib_BEGIN":
  990 		return
  991 		#___________________________________________________________
  992 	case "_lib_END":
  993 		return
  994 	}
  995 }
  996 
  997 #___________________________________________________________________________________
  998 
  999 
 1000 ####################################################################################
 1001 
 1002 
 1003 #_____________________________________________________________________________
 1004 function _N(F, v, p)
 1005 {
 1006 	###########################################################
 1007 	for (p in _UIDS) {
 1008 		delete _UIDS[p]
 1009 		return _nN_i0(p, F, v)
 1010 	}
 1011 	return _nN_i0(_tgenuid(), F, v)
 1012 }
 1013 
 1014 #####################################################
 1015 function _SHORTCUT(c, t, P)
 1016 {
 1017 	switch (c) {
 1018 	case "_lib_CMDLN":
 1019 		return t
 1020 		#___________________________________________________________
 1021 	case "_lib_APPLY":
 1022 		return
 1023 		#___________________________________________________________
 1024 	case "_lib_HELP":
 1025 		return
 1026 		#___________________________________________________________
 1027 	case "_lib_NAMEVER":
 1028 		return _ln("_shortcut 1.0")
 1029 		#___________________________________________________________
 1030 	case "_lib_BEGIN":
 1031 		return
 1032 		#___________________________________________________________
 1033 	case "_lib_END":
 1034 		return
 1035 	}
 1036 }
 1037 
 1038 #______________________________________________________________________________________________
 1039 function _START(t, i, A)
 1040 {
 1041 	#########################################################################
 1042 	_torexp_init()
 1043 	test_uid()
 1044 	return
 1045 	_conl(patsplit("a,b,c", A, /[^,]/, B))
 1046 	test_splitstr()
 1047 	return
 1048 	A[""]
 1049 	_CLASSPTR["ptr"]
 1050 	ALTARR["ptra"]
 1051 	_conl(_dumparr(SYMTAB))
 1052 	BB[1] = _NOP
 1053 	zorr(1, 2, 3, 4, 5, 6)
 1054 	zorr(BB, 1)
 1055 	_rtn()
 1056 	_rtn("")
 1057 	_rtn(0)
 1058 	_rtn("0")
 1059 	_rtn(1)
 1060 	_rtn("1")
 1061 	_rtn(-1)
 1062 	_rtn("-1")
 1063 	_rtn("huj")
 1064 	_rtn("ptr")
 1065 	_rtn("ptra", ALTARR)
 1066 	_rtn(ALTARR)
 1067 	_rtn(ALTARR, ALTARR)
 1068 	return
 1069 	_tstini()
 1070 	return
 1071 	_splitpath_test()
 1072 	#	_split_regpath()
 1073 	return
 1074 	hh = "CPU"
 1075 	_conl("go1!")
 1076 	_conl(_var(_sharepath(hh, "gdfsgdsgsd sdgsdighjui teretiewrotrewut 345345345 rtjtireutireu huj")))
 1077 	_conl("go2!")
 1078 	_conl(_var(_sharelist(AAA, hh), _dumparr(AAA)))
 1079 	_conline()
 1080 	A[1] = "h"
 1081 	A[3] = "j"
 1082 	t = "pizda"
 1083 	if (match(t, /^pi(Z)da/, A)) {
 1084 		_conl("match")
 1085 	} else {
 1086 		_conl("not match")
 1087 	}
 1088 	_conl(_dumparr(A))
 1089 	return
 1090 	_pathSMA = "C:\\Program Files\\Altiris\\Altiris Agent\\"
 1091 	DSPlugInPath = _pathSMA "Agents\\Deployment\\Agent\\"
 1092 	DSAutoPath = _pathSMA
 1093 	if (! _sysinfo(_SYS, _hostname)) {
 1094 		_fatal("_sysinfo: unknown error")
 1095 	}
 1096 	_REG[""]
 1097 	delete _REG[""]
 1098 	_servoutput = _CHR["EOL"] _cmd("sc query state= all")
 1099 	_dsbasepath = "\\\\CPU\\CPU\\DEV\\PROJECT\\_DS\\"
 1100 	_rdreg(_REG, "HKEY_LOCAL_MACHINE\\SOFTWARE\\Altiris")
 1101 	_wrfile("rego.txt", _dumparr(_REG))
 1102 	_conl("fF")
 1103 	#_______________________________________________________________________
 1104 	c = _getreg_i1(DDD, "HKEY_LOCAL_MACHINE\\SOFTWARE\\Altiris\\Altiris Agent\\Plugin Objects\\\204~.*\224Install path", _REG)
 1105 	#_________________________________________________________________________________________
 1106 	pp = _n("NAME", "NS")
 1107 	#pp=_n()
 1108 	#___________________________________________________________________________________
 1109 	p = _defsolution(pp, "DS Plug-in", "HKEY_LOCAL_MACHINE\\SOFTWARE\\Altiris\\Altiris Agent\\Plugin Objects\\Agents\\")
 1110 	ClientConfiguration = _defdll(p, "Client Configuration", "ClientConfiguration")
 1111 	ClientImagingPrep = _defdll(p, "Client Inaging Preparation", "ClientImagingPrep")
 1112 	ClientImaging = _defdll(p, "Client Imaging", "ClientImaging")
 1113 	ClientPCT = _defdll(p, "Client PCT", "ClientPCT")
 1114 	ClientRebootTo = _defdll(p, "Client Reboot To", "ClientRebootTo")
 1115 	DeploymentAgent = _defdll(p, "Deployment Agent", "Deployment Agent")
 1116 	DeploymentSolutionBaseAgent = _defdll(p, "Deployment Solution Base Agent", "Deployment Solution Base Agent")
 1117 	ClientBCDEdit = _defile(p, "Client BCD Edit", "ClientBCDEdit.dll")
 1118 	ClientCopyFile = _defile(p, "Client Copy File", "ClientCopyFile.dll")
 1119 	ClientPreImage = _defile(p, "Client Pre Image", "ClientPreImage.dll")
 1120 	ClientRebootTo = _defile(p, "Client Reboot To", "ClientRebootTo.dll")
 1121 	_defile(p, "ConfigService.exe", "ConfigService.exe", "")
 1122 	_defile(p, "config.dll", "config.dll", "")
 1123 	_defsrv(p, "DS Plug-in Service", "Altiris Deployment Solution - System Configuration")
 1124 	_defreg(p, "Deployment Agent Path", "HKEY_LOCAL_MACHINE\\SOFTWARE\\Altiris\\Deployment\\AgentInstallPath.STR")
 1125 	_defile(p, "Altiris_DeploymentSolutionAgent_7_1_x86.msi", _SYS["OSArchitecture"] == "64-bit" ? "C:\\Program Files\\Altiris\\Altiris Agent\\Agents\\SoftwareManagement\\Software Delivery\\{9D76E4CA-377A-472D-A82E-EDAD77E7E4ED}\\cache\\Altiris_DeploymentSolutionAgent_7_1_x64.msi" : "C:\\Program Files\\Altiris\\Altiris Agent\\Agents\\SoftwareManagement\\Software Delivery\\{4B747D25-612F-48FC-B6B5-9916D1BB755C}\\cache\\Altiris_DeploymentSolutionAgent_7_1_x86.msi", "")
 1126 	_defdir(p, "Deployment Folder", a = gensub(/[^\\]*$/, "", 1, _rdsafe(_REG, "HKEY_LOCAL_MACHINE\\SOFTWARE\\Altiris\\Deployment\\AgentInstallPath.STR", "C:\\Program Files\\Altiris\\Altiris Agent\\Agents\\Deployment\\Agent\\")))
 1127 	#___________________________________________________________________________________
 1128 	p = _defsolution(pp, "DS Auto", "HKEY_LOCAL_MACHINE\\SOFTWARE\\Altiris\\Altiris Agent\\Plugin Objects\\Agents\\")
 1129 	_defdir(p, "C:\\Boot\\Altiris\\iso\\boot\\fonts\\", "C:\\Boot\\Altiris\\iso\\boot\\fonts\\")
 1130 	_defdir(p, "C:\\Boot\\Altiris\\iso\\sources\\", "C:\\Boot\\Altiris\\iso\\sources\\")
 1131 	_defile(p, "C:\\Boot\\Altiris\\iso\\autoinst.exe", "C:\\Boot\\Altiris\\iso\\autoinst.exe", "")
 1132 	_defile(p, "C:\\Boot\\Altiris\\iso\\autoinst.ini", "C:\\Boot\\Altiris\\iso\\autoinst.ini", "")
 1133 	_defile(p, "C:\\Boot\\Altiris\\iso\\autoutil.exe", "C:\\Boot\\Altiris\\iso\\autoutil.exe", "")
 1134 	_defile(p, "C:\\Boot\\Altiris\\iso\\autoutil.ini", "C:\\Boot\\Altiris\\iso\\autoutil.ini", "")
 1135 	_defile(p, "C:\\Boot\\Altiris\\iso\\bcdedit.exe", "C:\\Boot\\Altiris\\iso\\bcdedit.exe", "")
 1136 	_defile(p, "C:\\Boot\\Altiris\\iso\\bootmgr", "C:\\Boot\\Altiris\\iso\\bootmgr", "")
 1137 	_defile(p, "C:\\Boot\\Altiris\\iso\\bootsect.exe", "C:\\Boot\\Altiris\\iso\\bootsect.exe", "")
 1138 	_defreg(p, "Deployment Automation reg.File", "HKEY_LOCAL_MACHINE\\SOFTWARE\\Altiris\\AutoUtil\\File.XSZ", "autoutil.exe")
 1139 	_defreg(p, "Deployment Automation reg.Path", "HKEY_LOCAL_MACHINE\\SOFTWARE\\Altiris\\AutoUtil\\Path.XSZ", "%systemdrive%\\boot\\altiris\\iso")
 1140 	#_________________________________________________________________________________________
 1141 	_check(pp)
 1142 	#_________________________________________________________________________________________
 1143 	_conl(_report(pp))
 1144 	_wrfile("report.txt", _report(pp))
 1145 }
 1146 
 1147 #########################################################
 1148 function _SYSIO(c, t, P)
 1149 {
 1150 	switch (c) {
 1151 	case "_lib_CMDLN":
 1152 		return t
 1153 		#___________________________________________________________
 1154 	case "_lib_APPLY":
 1155 		return
 1156 		#___________________________________________________________
 1157 	case "_lib_HELP":
 1158 		return
 1159 		#___________________________________________________________
 1160 	case "_lib_NAMEVER":
 1161 		return _ln("_SYSIO 1.0")
 1162 		#___________________________________________________________
 1163 	case "_lib_BEGIN":
 1164 		return
 1165 		#___________________________________________________________
 1166 	case "_lib_END":
 1167 		return
 1168 	}
 1169 }
 1170 
 1171 #_______________________________________________________________________
 1172 ########################################################################
 1173 function _W(p, A, v)
 1174 {
 1175 	if (isarray(v)) {
 1176 		if (p) {
 1177 			delete A[p]
 1178 			A[p][""]
 1179 			delete A[p][""]
 1180 			_movarr(A[p], v)
 1181 		}
 1182 		return p
 1183 	}
 1184 	if (p) {
 1185 		delete A[p]
 1186 		return (A[p] = v)
 1187 	}
 1188 	return v
 1189 }
 1190 
 1191 #_______________________________________________________________________
 1192 function _Zexparr(S, s, t, i)
 1193 {
 1194 	##############################################
 1195 	t = ""
 1196 	if (isarray(S)) {
 1197 		for (i in S) {
 1198 			t = t (isarray(S[i]) ? (_Zexparr_i1(i) "\020" _Zexparr_i0(S[i]) "\021\021\020") : (_Zexparr_i2(_Zexparr_i3(i) "\021" _Zexparr_i3(S[i])) "\020"))
 1199 		}
 1200 	}
 1201 	if (s != "") {
 1202 		gsub(/\x1B/, "\033;", s)
 1203 		gsub(/\x10/, "\0330", s)
 1204 		t = t "\021\021\020" s
 1205 	}
 1206 	gsub(/\x0A/, "\033:", t)
 1207 	return t
 1208 }
 1209 
 1210 #_________________________________________________________________
 1211 function _Zexparr_i0(S, t, i)
 1212 {
 1213 	for (i in S) {
 1214 		t = t (isarray(S[i]) ? (_Zexparr_i1(i) "\020" _Zexparr_i0(S[i]) "\021\021\020") : (_Zexparr_i2(_Zexparr_i3(i) "\021" _Zexparr_i3(S[i])) "\020"))
 1215 	}
 1216 	return t
 1217 }
 1218 
 1219 #_________________________________________________________________
 1220 function _Zexparr_i1(t)
 1221 {
 1222 	gsub(/\x1B/, "\033;", t)
 1223 	gsub(/\x11/, "\0331", t)
 1224 	gsub(/\x10/, "\0330", t)
 1225 	return t
 1226 }
 1227 
 1228 #_________________________________________________________________
 1229 function _Zexparr_i2(t)
 1230 {
 1231 	gsub(/\x10/, "\0330", t)
 1232 	return t
 1233 }
 1234 
 1235 #_________________________________________________________________
 1236 function _Zexparr_i3(t)
 1237 {
 1238 	gsub(/\x1B/, "\033;", t)
 1239 	gsub(/\x11/, "\0331", t)
 1240 	return t
 1241 }
 1242 
 1243 #_______________________________________________________________________
 1244 function _Zimparr(D, t, A, B)
 1245 {
 1246 	##############################################
 1247 	if (isarray(D)) {
 1248 		split(t, A, /\x10/, B)
 1249 		t = _Zimparr_i0(A, B, _Zimparr_i1(D, A, B, 1))
 1250 		gsub(/\x1B\x30/, "\020", t)
 1251 		gsub(/\x1B\x3B/, "\033", t)
 1252 		return t
 1253 	}
 1254 }
 1255 
 1256 #_________________________________________________________________
 1257 function _Zimparr_i0(A, B, i)
 1258 {
 1259 	return (i in A ? (A[i] B[i] _Zimparr_i0(A, B, i + 1)) : "")
 1260 }
 1261 
 1262 #_________________________________________________________________
 1263 function _Zimparr_i1(D, A, B, i, t, a, n)
 1264 {
 1265 	while (i in B) {
 1266 		if ((t = A[i++]) == "\021\021") {
 1267 			return i
 1268 		}
 1269 		gsub(/\x1B\x30/, "\020", t)
 1270 		if ((a = index(t, "\021")) > 0) {
 1271 			if (isarray(D[n = _Zimparr_i2(substr(t, 1, a - 1))])) {
 1272 				delete D[n]
 1273 			}
 1274 			D[n] = _Zimparr_i2(substr(t, a + 1))
 1275 		} else {
 1276 			if (! isarray(D[t = _Zimparr_i2(t)])) {
 1277 				delete D[t]
 1278 				D[t][""]
 1279 				delete D[t][""]
 1280 			}
 1281 			i = _Zimparr_i1(D[t], A, B, i)
 1282 		}
 1283 	}
 1284 }
 1285 
 1286 #_________________________________________________________________
 1287 function _Zimparr_i2(t)
 1288 {
 1289 	gsub(/\x1B\x31/, "\021", t)
 1290 	gsub(/\x1B\x3B/, "\033", t)
 1291 	return t
 1292 }
 1293 
 1294 #_____________________________________________________________________________
 1295 function _Zimport(t, p, A, c, i, n, B)
 1296 {
 1297 	##############################################
 1298 	if (p) {
 1299 		c = split(t, B, /\x0A/)
 1300 		for (i = 1; i <= c; i++) {
 1301 			if ((t = B[i]) == "") {
 1302 				continue
 1303 			}
 1304 			gsub(/\x1B\x3A/, "\n", t)
 1305 			if (match(t, /^_ERRLOG: /)) {
 1306 				_tLOG[n = _wLCHLD(p, _N())][""]
 1307 				delete _tLOG[n][""]
 1308 				_Zimparr(_tLOG[n], substr(t, 10))
 1309 			} else if ((t = _pass(_IMPORT, t, p, A)) != "") {
 1310 				gsub(/\x1B\x3B/, "\033", t)
 1311 				_wLCHLD(p, _N(_tSTR, t))
 1312 			}
 1313 		}
 1314 		return p
 1315 	} else {
 1316 		_expout(t)
 1317 	}
 1318 }
 1319 
 1320 function _acc(A, a, t)
 1321 {
 1322 	if (t) {
 1323 		if (_VLDMAXSTRING < length(t) + length(a)) {
 1324 			if (a) {
 1325 				if (_VLDMAXSTRING < length(t)) {
 1326 					A[--A[_ARRPTR]] = a
 1327 					A[--A[_ARRPTR]] = t
 1328 				} else {
 1329 					A[--A[_ARRPTR]] = a t
 1330 				}
 1331 			} else {
 1332 				A[++A[_ARRLEN]] = t
 1333 			}
 1334 			return ""
 1335 		}
 1336 		return (a t)
 1337 	}
 1338 	return a
 1339 }
 1340 
 1341 function _accmpu(A, a, n)
 1342 {
 1343 	if (n) {
 1344 		return (_mpufn0 = n)
 1345 	}
 1346 	if (_mpuacc) {
 1347 		if (_VLDMAXSTRING < length(_mpuacc) + length(a)) {
 1348 			if (a) {
 1349 				if (_VLDMAXSTRING < length(_mpuacc)) {
 1350 					A[--A[_ARRLEN]] = a
 1351 					A[--A[_ARRLEN]] = _mpuacc
 1352 				} else {
 1353 					A[--A[_ARRLEN]] = a _mpuacc
 1354 				}
 1355 			} else {
 1356 				A[--A[_ARRLEN]] = _mpuacc
 1357 			}
 1358 			_mpuacc = ""
 1359 		} else {
 1360 			_mpuacc = a _mpuacc
 1361 		}
 1362 	} else {
 1363 		_mpuacc = a
 1364 	}
 1365 }
 1366 
 1367 #_______________________________________________________________________
 1368 function _add(S, sf, D, df)
 1369 {
 1370 	################################################
 1371 	if (sf in S) {
 1372 		if (isarray(S[sf])) {
 1373 			if (df in D) {
 1374 				if (isarray(D[df])) {
 1375 					return _extarr(D[df], S[sf])
 1376 				}
 1377 				delete D[df]
 1378 			}
 1379 			D[df][""]
 1380 			delete D[df][""]
 1381 			return _extarr(D[df], S[sf])
 1382 		} else {
 1383 			if (isarray(D[df])) {
 1384 				delete D[df]
 1385 			}
 1386 			D[df] = D[df] S[sf]
 1387 		}
 1388 	}
 1389 }
 1390 
 1391 #_________________________________________________________________
 1392 function _addarr(D, S)
 1393 {
 1394 	#############################################
 1395 	if (isarray(S)) {
 1396 		_addarr_i0(D, S)
 1397 	}
 1398 }
 1399 
 1400 #_____________________________________________________
 1401 function _addarr_i0(D, S, i)
 1402 {
 1403 	for (i in S) {
 1404 		if (isarray(S[i])) {
 1405 			delete D[i]
 1406 			D[i][""]
 1407 			delete D[i][""]
 1408 			_addarr_i0(D[i], S[i])
 1409 		} else {
 1410 			delete D[i]
 1411 			D[i] = S[i]
 1412 		}
 1413 	}
 1414 }
 1415 
 1416 #_______________________________________________________________________
 1417 function _addarrmask(D, S, M)
 1418 {
 1419 	#############################################
 1420 	for (_addarrmaski0 in M) {
 1421 		if (_addarrmaski0 in S) {
 1422 			if (isarray(S[_addarrmaski0])) {
 1423 				if (! isarray(D[_addarrmaski0])) {
 1424 					delete D[_addarrmaski0]
 1425 					D[_addarrmaski0][""]
 1426 					delete D[_addarrmaski0][""]
 1427 				}
 1428 				if (isarray(M[_addarrmaski0])) {
 1429 					_addarrmask(D[_addarrmaski0], S[_addarrmaski0], M[_addarrmaski0])
 1430 				} else {
 1431 					_extarr_i0(D[_addarrmaski0], S[_addarrmaski0])
 1432 				}
 1433 			} else {
 1434 				if (isarray(D[_addarrmaski0])) {
 1435 					delete D[_addarrmaski0]
 1436 				}
 1437 				D[_addarrmaski0] = S[_addarrmaski0]
 1438 			}
 1439 		} else {
 1440 			delete D[_addarrmaski0]
 1441 		}
 1442 	}
 1443 }
 1444 
 1445 #___________________________________________________________________________________
 1446 ####################################################################################
 1447 
 1448 
 1449 #_______________________________________________________________________
 1450 function _addf(A, f)
 1451 {
 1452 	#####################################################
 1453 	A["B"][""] = A["F"][A["B"][f] = A["B"][""]] = f
 1454 }
 1455 
 1456 #___________________________________________________________
 1457 function _addfile(f, d, a, b)
 1458 {
 1459 	##################################
 1460 	if (((f = _wfilerdnehnd(f)) == "") || (_filene(f) == "")) {
 1461 		ERRNO = "Filename error"
 1462 		return
 1463 	}
 1464 	a = BINMODE
 1465 	BINMODE = "rw"
 1466 	b = ORS
 1467 	ORS = ""
 1468 	ERRNO = ""
 1469 	print(d) >> f
 1470 	if (ERRNO) {
 1471 		return ""
 1472 	}
 1473 	close(f)
 1474 	BINMODE = a
 1475 	ORS = b
 1476 	if (ERRNO) {
 1477 		return ""
 1478 	}
 1479 	return d
 1480 }
 1481 
 1482 #_____________________________________________________________________________
 1483 function _addlib(f)
 1484 {
 1485 	###########################################################
 1486 	_addf(_LIBAPI, f)
 1487 }
 1488 
 1489 #___________________________________________________________________________________
 1490 ####################################################################################
 1491 
 1492 
 1493 #_______________________________________________________________________
 1494 function _addlist(A, v)
 1495 {
 1496 	##################################################
 1497 	A[++A[0]] = v
 1498 }
 1499 
 1500 ############################################
 1501 
 1502 #_______________________________________________________________________
 1503 function _bearray(A)
 1504 {
 1505 	####################################################
 1506 	if (isarray(A) || (A == 0 && A == "")) {
 1507 		return 1
 1508 	}
 1509 }
 1510 
 1511 #_________________________________________________________________
 1512 function _bframe(A, t, p)
 1513 {
 1514 	###########################################
 1515 	return _bframe_i0(A, t, p, A[""])
 1516 }
 1517 
 1518 #___________________________________________________________
 1519 function _bframe_i0(A, t, p, f)
 1520 {
 1521 	return (f ? (_bframe_i0(A, t, p, A[f]) (@f(t, p))) : "")
 1522 }
 1523 
 1524 # add to _dumparr: checking that if element is undefined
 1525 
 1526 
 1527 
 1528 
 1529 
 1530 
 1531 
 1532 
 1533 
 1534 
 1535 
 1536 
 1537 
 1538 
 1539 
 1540 
 1541 
 1542 
 1543 #_______________________________________________________________________
 1544 function _cfguid(p, optr, pfx, sfx, hstrcnt, lstrchr)
 1545 {
 1546 	#################### 0 #
 1547 	delete _UIDOBL[p]
 1548 	if (_isptr(optr)) {
 1549 		if (optr == p) {
 1550 			delete _UIDOBLV[p]
 1551 			delete _UIDOBLV[_UIDOBLV[_UIDOBL[p] = p][""] = p][""]
 1552 		} else if (optr in _UIDOBL) {
 1553 			_UIDOBL[p] = _UIDOBL[optr]
 1554 		}
 1555 	}
 1556 	_UIDPFX[p] = _istr(pfx) ? pfx : ""
 1557 	_UIDSFX[p] = _istr(sfx) ? sfx : ""
 1558 	if (_isptr(hstrcnt)) {
 1559 		if (hstrcnt != p) {
 1560 			_UIDCHR[p] = _UIDCHR[_UIDCNT[p] = _UIDCNT[hstrcnt]]
 1561 			return p
 1562 		}
 1563 		hstrcnt = _NOP
 1564 	}
 1565 	_UIDCNTL[_UIDCNT[p] = p] = _cfguidchr(p, hstrcnt, lstrchr)
 1566 	return p
 1567 }
 1568 
 1569 #_____________________________________________________
 1570 function _cfguidchr(p, h, l, H, L)
 1571 {
 1572 	if (_isptr(l)) {
 1573 		if (l != p) {
 1574 			return (_UIDCHR[p] = _UIDCHR[l])
 1575 		}
 1576 		_UIDCHR[p] = p
 1577 		l = _NOP
 1578 	}
 1579 	_UIDCHR[p] = p
 1580 	_splitstr(H, h, _UIDCHRH[_classys])
 1581 	_splitstr(L, l, H)
 1582 	delete _UIDCHRH[_UIDCHRH[p][""] = p][""]
 1583 	delete _UIDCHRL[_UIDCHRL[p][""] = p][""]
 1584 	_cfguidh(p, H, L)
 1585 	return _cfguidl(p, L, L)
 1586 }
 1587 
 1588 #_______________________________________________
 1589 function _cfguidh(p, H, L, hi, h, li)
 1590 {
 1591 	for (hi = 1; hi in H; hi++) {
 1592 		h = H[hi]
 1593 		for (li = 1; li in L; li++) {
 1594 			_UIDCHRH[p][h L[li]]
 1595 		}
 1596 	}
 1597 }
 1598 
 1599 function _cfguidl(p, H, L, hi, h, hl, li)
 1600 {
 1601 	for (hi = 1; hi in H; hi++) {
 1602 		h = H[hi]
 1603 		for (li = 1; li in L; li++) {
 1604 			hl = _UIDCHRL[p][hl] = h L[li]
 1605 		}
 1606 	}
 1607 	return hl
 1608 }
 1609 
 1610 #____________________________________________________________________________________________________
 1611 function _check(p)
 1612 {
 1613 	####################################################################################
 1614 	_dll_check(p)
 1615 	_file_check(p)
 1616 	_serv_check(p)
 1617 	_reg_check(p)
 1618 }
 1619 
 1620 #_______________________________________________________________________
 1621 function _chrline(t, ts, w, s)
 1622 {
 1623 	#############################################
 1624 	return (t = " " _tabtospc(t, ts) (t ? t ~ /[ \t]$/ ? "" : " " : "")) _getchrln(s ? s : "_", (w ? w : _CON_WIDTH - 1) - length(t)) _CHR["EOL"]
 1625 }
 1626 
 1627 #_____________________________________________________________________________
 1628 function _cmd(c, i, A)
 1629 {
 1630 	#######################################################
 1631 	_fio_cmda = RS
 1632 	RS = ".{1,}"
 1633 	_fio_cmdb = BINMODE
 1634 	BINMODE = "rw"
 1635 	ERRNO = RT = _NUL
 1636 	c | getline RS
 1637 	BINMODE = _fio_cmdb
 1638 	RS = _fio_cmda
 1639 	if (ERRNO || 0 > (_exitcode = close(c))) {
 1640 		return (RT = _NOP)
 1641 	}
 1642 	return RT
 1643 }
 1644 
 1645 #_______________________________________________________________________
 1646 function _cmparr(A0, A1, R, a, i)
 1647 {
 1648 	##########################################
 1649 	a = 0
 1650 	delete R
 1651 	for (i in A0) {
 1652 		if (! (i in A1)) {
 1653 			a++
 1654 			R[i] = 0
 1655 		} else if (A0[i] != A1[i]) {
 1656 			a++
 1657 			R[i] = 2
 1658 		}
 1659 	}
 1660 	for (i in A1) {
 1661 		if (! (i in A0)) {
 1662 			a++
 1663 			R[i] = 1
 1664 		}
 1665 	}
 1666 	return a
 1667 }
 1668 
 1669 #_____________________________________________________________________________
 1670 function _con(t, ts, a, b, c, d, i, r, A, B)
 1671 {
 1672 	##########################################
 1673 	d = RLENGTH
 1674 	if ((c = split(r = t, A, /\x0D?\x0A/, B)) > 0) {
 1675 		a = BINMODE
 1676 		b = ORS
 1677 		BINMODE = "rw"
 1678 		ORS = ""
 1679 		if (c > 1) {
 1680 			if ((i = length(t = _tabtospc(A[1], ts, _conlastrln))) < _constatstrln) {
 1681 				t = t _getchrln(" ", _constatstrln - i)
 1682 			}
 1683 			print(t B[1]) > _SYS_STDCON
 1684 			for (i = 2; i < c; i++) {
 1685 				print(_tabtospc(A[i], ts) B[i]) > _SYS_STDCON
 1686 			}
 1687 			print(_conlastr = _tabtospc(A[c], ts)) > _SYS_STDCON
 1688 			fflush(_SYS_STDCON)
 1689 		} else {
 1690 			print(t = _tabtospc(t, ts, _conlastrln)) > _SYS_STDCON
 1691 			fflush(_SYS_STDCON)
 1692 			_conlastr = _conlastr t
 1693 		}
 1694 		if ((i = length(_conlastr)) >= _CON_WIDTH) {
 1695 			_conlastr = substr(_conlastr, 1 + (int(i / _CON_WIDTH) * _CON_WIDTH))
 1696 		}
 1697 		_conlastrln = length(_conlastr)
 1698 		if (_constatstr) {
 1699 			print((t = _constatgtstr(_constatstr, _CON_WIDTH - 1 - _conlastrln)) _CHR["CR"] _conlastr) > _SYS_STDCON
 1700 			fflush(_SYS_STDCON)
 1701 			_constatstrln = length(t)
 1702 		}
 1703 		BINMODE = a
 1704 		ORS = b
 1705 		RLENGTH = d
 1706 		return r
 1707 	}
 1708 	RLENGTH = d
 1709 }
 1710 
 1711 #_______________________________________________________________________
 1712 function _conin(t, a, b)
 1713 {
 1714 	#################################################
 1715 	_constatpush()
 1716 	_constat()
 1717 	a = BINMODE
 1718 	b = RS
 1719 	BINMODE = "rw"
 1720 	RS = "\n"
 1721 	_con(t)
 1722 	getline t < "CON"
 1723 	close("CON")
 1724 	_conlastrln = 0
 1725 	_conlastr = ""
 1726 	gsub(/[\x0D\x0A]+/, "", t)
 1727 	BINMODE = a
 1728 	RS = b
 1729 	_constatpop()
 1730 	return t
 1731 }
 1732 
 1733 #_______________________________________________________________________
 1734 function _conl(t, ts)
 1735 {
 1736 	####################################################
 1737 	return _con(t (t ~ /\x0A$/ ? "" : _CHR["EOL"]), ts)
 1738 }
 1739 
 1740 #_______________________________________________________________________
 1741 function _conline(t, ts)
 1742 {
 1743 	#################################################
 1744 	return _con(_chrline(t, ts))
 1745 }
 1746 
 1747 #___________________________________________________________________________________
 1748 ####################################################################################
 1749 function _conlq(t, ts)
 1750 {
 1751 	return _conl("`" t "'", ts)
 1752 }
 1753 
 1754 #_______________________________________________________________________
 1755 function _constat(t, ts, ln, a)
 1756 {
 1757 	###########################################
 1758 	if (_constatstrln > (ln = length(t = _constatgtstr(_constatstr = _tabtospc(t, ts), _CON_WIDTH - 1 - _conlastrln)))) {
 1759 		t = t _getchrln(" ", _constatstrln - ln)
 1760 	}
 1761 	_constatstrln = ln
 1762 	ln = ORS
 1763 	a = BINMODE
 1764 	BINMODE = "rw"
 1765 	ORS = ""
 1766 	print(t _CHR["CR"] _conlastr) > _SYS_STDCON
 1767 	fflush(_SYS_STDCON)
 1768 	ORS = ln
 1769 	BINMODE = a
 1770 	return _constatstr
 1771 }
 1772 
 1773 #_________________________________________________________________
 1774 function _constatgtstr(t, ln, a, b)
 1775 {
 1776 	if (ln < 1) {
 1777 		return ""
 1778 	}
 1779 	if ((a = length(t)) <= ln) {
 1780 		return t
 1781 	}
 1782 	if (ln < 11) {
 1783 		return substr(t, a - ln + 1)
 1784 	}
 1785 	if (ln < 19) {
 1786 		return ("..." substr(t, a - ln + 4))
 1787 	}
 1788 	return (substr(t, 1, b = int((ln - 3) / 2)) "..." substr(t, a - ln + b + 4))
 1789 }
 1790 
 1791 #_______________________________________________________________________
 1792 function _constatpop()
 1793 {
 1794 	##################################################
 1795 	if (_CONSTATPUSH[0] > 0) {
 1796 		return _constat(_CONSTATPUSH[_CONSTATPUSH[0]--])
 1797 	}
 1798 	return _constat("")
 1799 }
 1800 
 1801 #_______________________________________________________________________
 1802 function _constatpush(t, ts)
 1803 {
 1804 	#############################################
 1805 	_CONSTATPUSH[++_CONSTATPUSH[0]] = _constatstr
 1806 	if (t) {
 1807 		_constat(t, ts)
 1808 	}
 1809 	return _constatstr
 1810 }
 1811 
 1812 #___________________________________________________________________________________
 1813 function _creport(p, t, f, z)
 1814 {
 1815 	_[p]["REPORT"] = _[p]["REPORT"] _ln(t (f == "" ? "" : ": " f))
 1816 }
 1817 
 1818 #_________________________________________________________________________________________
 1819 function _defdir(pp, n, f, v, p)
 1820 {
 1821 	#############################################################
 1822 	_[p = _wLCHLD(pp, _n("TYPE", "defdir"))]["NAME"] = n
 1823 	_[p]["DIR"] = f
 1824 	return p
 1825 }
 1826 
 1827 #_________________________________________________________________________________________
 1828 function _defdll(pp, n, rn, p)
 1829 {
 1830 	##############################################################
 1831 	_[p = _wLCHLD(pp, _n("TYPE", "defdll"))]["NAME"] = n
 1832 	_[p]["REGPATH"] = _[pp]["REGPATH"] rn
 1833 	_[p]["ERRHOST"] = pp
 1834 	return p
 1835 }
 1836 
 1837 #___________________________________________________________
 1838 function _defescarr(D, r, S, i, c, t)
 1839 {
 1840 	if (isarray(S)) {
 1841 		for (i = 0; i < 256; i++) {
 1842 			if ((c = _CHR[i]) ~ r) {
 1843 				D[c] = "\\" S[c]
 1844 				t = t c
 1845 			} else if (D[c] == "") {
 1846 				D[c] = c
 1847 			}
 1848 		}
 1849 	} else {
 1850 		for (i = 0; i < 256; i++) {
 1851 			if ((c = _CHR[i]) ~ r) {
 1852 				D[c] = S c
 1853 				if (S != "") {
 1854 					t = t c
 1855 				}
 1856 			} else if (D[c] == "") {
 1857 				D[c] = c
 1858 			}
 1859 		}
 1860 	}
 1861 	return t
 1862 }
 1863 
 1864 #_________________________________________________________________________________________
 1865 function _defile(pp, n, f, v, p)
 1866 {
 1867 	#############################################################
 1868 	_[p = _wLCHLD(pp, _n("TYPE", "defile"))]["NAME"] = n
 1869 	_[p]["FILE"] = f
 1870 	if (! (v == 0 && v == "")) {
 1871 		_[p]["RQVERSION"] = v
 1872 	}
 1873 	return p
 1874 }
 1875 
 1876 #_______________________________________________________________________
 1877 function _defn(f, c, v)
 1878 {
 1879 	###################################################
 1880 	FUNCTAB[c f] = v
 1881 }
 1882 
 1883 #_________________________________________________________________________________________
 1884 function _defreg(pp, n, f, v, p)
 1885 {
 1886 	#############################################################
 1887 	_[p = _wLCHLD(pp, _n("TYPE", "defreg"))]["NAME"] = n
 1888 	_[p]["REGPATH"] = f
 1889 	if (! (v == 0 && v == "")) {
 1890 		_[p]["VALUE"] = v
 1891 	}
 1892 }
 1893 
 1894 #_______________________________________________________________________________________________
 1895 function _defsolution(pp, n, rn, p)
 1896 {
 1897 	###############################################################
 1898 	_[p = _wLCHLD(pp, _n("TYPE", "solution"))]["NAME"] = n
 1899 	_[p]["REGPATH"] = rn
 1900 	_[p]["ERRHOST"] = pp
 1901 	return p
 1902 }
 1903 
 1904 #_________________________________________________________________________________________
 1905 function _defsrv(pp, n, f, v, p)
 1906 {
 1907 	#############################################################
 1908 	_[p = _wLCHLD(pp, _n("TYPE", "defsrv"))]["NAME"] = n
 1909 	_[p]["SERVNAME"] = f
 1910 	return p
 1911 }
 1912 
 1913 #_______________________________________________________________________
 1914 function _del(f, c, a, A)
 1915 {
 1916 	#################################################
 1917 	if (match(f, /\\[ \t]*$/)) {
 1918 		if ((c = toupper(_filerd(f))) && (length(f) == FLENGTH)) {
 1919 			_cmd("rd " c " /S /Q 2>NUL")
 1920 			_deletepfx(_WFILEROOTDIR, c)
 1921 			_deletepfx(_FILEIO_RDTMP, c)
 1922 			_deletepfx(_FILEIO_RDNETMP, c)
 1923 		} else {
 1924 			_conl("HUJ TEBE!")
 1925 			return ""
 1926 		}
 1927 	} else {
 1928 		a = _dir(A, f)
 1929 		_cmd("del " f " /Q 2>NUL")
 1930 		for (c in A) {
 1931 			if (c ~ /\\$/) {
 1932 				_cmd("rd " c " /S /Q 2>NUL")
 1933 				_deletepfx(_WFILEROOTDIR, c)
 1934 				_deletepfx(_FILEIO_RDTMP, c)
 1935 			}
 1936 			_deletepfx(_FILEIO_RDNETMP, c)
 1937 		}
 1938 	}
 1939 	return a
 1940 }
 1941 
 1942 #_______________________________________________________________________
 1943 function _delay(t, a)
 1944 {
 1945 	###################################################
 1946 	for (a = 1; a <= t; a++) {
 1947 		_delayms()
 1948 	}
 1949 }
 1950 
 1951 #_________________________________________________________________
 1952 function _delayms(a)
 1953 {
 1954 	#############################################
 1955 	for (a = 1; a <= _delay_perfmsdelay; a++) {
 1956 	}
 1957 }
 1958 
 1959 #_______________________________________________________________________
 1960 function _deletepfx(A, f, B, le, i)
 1961 {
 1962 	########################################
 1963 	le = length(f)
 1964 	for (i in A) {
 1965 		if (substr(toupper(i), 1, le) == f) {
 1966 			B[i] = A[i]
 1967 			delete A[i]
 1968 		}
 1969 	}
 1970 }
 1971 
 1972 #_________________________________________________________________
 1973 function _delf(A, f)
 1974 {
 1975 	###############################################
 1976 	A["B"][A["F"][A["B"][f]] = A["F"][f]] = A["B"][f]
 1977 	delete A["F"][f]
 1978 	delete A["B"][f]
 1979 }
 1980 
 1981 #_______________________________________________________________________
 1982 function _deluid(p)
 1983 {
 1984 	################################################# 1 #
 1985 	if (p in _CLASSPTR) {
 1986 		_deluida0 = _CLASSPTR[p]
 1987 		if (_deluida0 in _UIDOBL) {
 1988 			_UIDOBLV[_UIDOBL[_deluida0]][p]
 1989 		}
 1990 	}
 1991 	delete _CLASSPTR[p]
 1992 	return _deluida0
 1993 }
 1994 
 1995 #_______________________________________________________________________
 1996 function _dir(A, rd, i, r, f, ds, pf, B, C)
 1997 {
 1998 	####################################
 1999 	delete A
 2000 	gsub(/(^[ \t]*)|([ \t]*$)/, "", rd)
 2001 	if (rd == "") {
 2002 		return ""
 2003 	}
 2004 	i = split(_cmd("dir \"" rd "\" 2>NUL"), B, /\x0D?\x0A/) - 3
 2005 	pf = (match(B[4], /Directory of ([^\x00-\x1F]+)/, C) ? (C[1] (C[1] ~ /\\$/ ? "" : "\\")) : "")
 2006 	for (r = 0; i > 5; i--) {
 2007 		if (match(B[i], /^([^ \t]*)[ \t]+([^ \t]*)[ \t]+((<DIR>)|([0-9\,]+))[ \t]+([^\x00-\x1F]+)$/, C)) {
 2008 			if (C[6] !~ /^\.\.?$/) {
 2009 				if (C[4]) {
 2010 					ds = "D "
 2011 				} else {
 2012 					ds = C[5] " "
 2013 					gsub(/\,/, "", ds)
 2014 				}
 2015 				if ((f = _filepath(pf C[6] (C[4] ? "\\" : ""))) != "") {
 2016 					A[f] = ds C[1] " " C[2]
 2017 					r++
 2018 				}
 2019 			}
 2020 		}
 2021 	}
 2022 	return r
 2023 }
 2024 
 2025 #_________________________________________________________________
 2026 function _dirtree(A, f, B)
 2027 {
 2028 	#########################################
 2029 	gsub(/(^[ \t]*)|([ \t]*$)/, "", f)
 2030 	delete A
 2031 	A[""]
 2032 	delete A[""]
 2033 	_dirtree_i0(B, 8, split(_cmd("dir \"" f "\" /-C /S 2>NUL"), B, /\x0D?\x0A/), A, f = _filerd(f))
 2034 	return f
 2035 }
 2036 
 2037 #___________________________________________________________
 2038 function _dirtree_i0(B, i, c, A, f, lf, a, C)
 2039 {
 2040 	delete A[f]
 2041 	A[f][0]
 2042 	delete A[f][0]
 2043 	lf = length(f)
 2044 	for (; i <= c; ) {
 2045 		if (match(B[i], /^[ \t]*Directory of (.+)/, C)) {
 2046 			if (substr(a = _filerd(C[1] "\\"), 1, lf) == f) {
 2047 				i = _dirtree_i0(B, i + 4, c, A[f], a)
 2048 			} else {
 2049 				return i
 2050 			}
 2051 		} else if (match(B[i++], /^([^ \t\-]+)\-([^ \t\-]+)\-([^ \t]+)[ \t]+([^ \t]+)[ \t]+([0-9]+)[ \t]+(.+)$/, C)) {
 2052 			A[f][f C[6]] = C[5] " " C[1] "/" _CHR["MONTH"][C[2]] "/" C[3] " " C[4]
 2053 		}
 2054 	}
 2055 	return i
 2056 }
 2057 
 2058 #_______________________________________________________________________
 2059 function _dll_check(pp)
 2060 {
 2061 	_dllchktv = ""
 2062 	_missfl = 1
 2063 	_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
 2064 	if (1 || "AGENT" in _[pp]) {
 2065 		if (_dllchktv != _[pp][".Product Version"]) {
 2066 			_dllerr(_[pp]["AGENT"], "agent version (" _[pp][".Product Version"] ") do not match all lib versions: " _dllchktv "'")
 2067 		}
 2068 	} else if (! _missfl) {
 2069 		_creport(pp, "agent not detected in registry")
 2070 	} else {
 2071 		_dllerr(pp, "agent not detected in registry but some registry entries exist:")
 2072 		_tframe("_dll_check_i1", pp, pp)
 2073 	}
 2074 }
 2075 
 2076 #_______________________________________________
 2077 function _dll_check_i0(p, R, pp, p2, i, i2, r, f, v, rs, d, tv, tf)
 2078 {
 2079 	if (_[p]["TYPE"] == "defdll") {
 2080 		r = toupper(_[p]["REGPATH"])
 2081 		rs = 0
 2082 		tf = 0
 2083 		tv = ""
 2084 		for (i in R) {
 2085 			if (toupper(substr(i, 1, length(r))) == r) {
 2086 				if ((_chka0 = substr(i, 1 + length(r), 1)) == "" || _chka0 == "\\") {
 2087 					rs = 1
 2088 					_missfl = 1
 2089 					_[p]["." substr(gensub(/\....$/, "", 1, i), i2 = 2 + length(r), length(i) - i2 + 1)] = R[i]
 2090 					if (chka0 != "") {
 2091 						rs = 1
 2092 					}
 2093 				}
 2094 			}
 2095 		}	#{ rs=_missfl=1; _[p]["." gensub(/^([^\\]+\\)+(.*)\..../,"\\2","G",i)]=R[i] } }
 2096 		if (rs) {
 2097 			if ((i = ".Install Path") in _[p] && (i = ".Product Version") in _[p]) {
 2098 				_[p]["STATUS"] = "PRESENT"
 2099 				f = _[p][".Install Path"]
 2100 				v = _[p][".Product Version"]
 2101 				if (! (".Module" in _[p])) {
 2102 					_[pp][".Product Version"] = v
 2103 					_VAR["HKEY_LOCAL_MACHINE\\SOFTWARE\\Altiris\\Deployment\\AgentInstallPath.STR"] = f
 2104 					_[pp]["AGENT"] = p
 2105 					_creport("OK:  DLL DETECTED(" v "): " substr(_[p]["NAME"], 1, 112))
 2106 				} else {
 2107 					if (_dllchktv == "") {
 2108 						_dllchktv = v
 2109 					} else if (v != _dllchktv) {
 2110 						return _dllerr(p, "different versions detected: " _dllchktv "!=" v "'")
 2111 					}
 2112 					ERRNO = ""
 2113 					if (_th1(_[p]["DATA"] = _rdfile(f), ERRNO)) {
 2114 						delete _[p]["DATA"]
 2115 						return _dllerr(p, "read lib: " ERRNO, f)
 2116 					}
 2117 					if (v != (_[p]["VERSION"] = _getfilever(f))) {
 2118 						return _dllerr(p, "library file version mismatch: ==`" _[p]["VERSION"] "'; !=`" v "'", f)
 2119 					}
 2120 					_creport(p, "OK:    LIBRARY DETECTED(" v "): " substr(f, 1, 100))
 2121 				}
 2122 			} else {
 2123 				tf = 1
 2124 				_dllerr(p, "registry corrupt: `" i "' not present")
 2125 			}
 2126 		} else {
 2127 			_[p]["STATUS"] = "MISSED"
 2128 		}
 2129 	}
 2130 }
 2131 
 2132 #_______________________________________________
 2133 function _dll_check_i1(p, pp, p1, p2, p3, i)
 2134 {
 2135 	if (_[p]["TYPE"] == "defdll") {
 2136 		for (i in _[p]) {
 2137 			if (i ~ /^\./) {
 2138 				_dllerr(pp, "          " _[p]["REGPATH"] "\\" substr(i, 2))
 2139 			}
 2140 		}
 2141 	}
 2142 }
 2143 
 2144 #___________________________________________________________________________________
 2145 function _dllerr(p, t, f)
 2146 {
 2147 	if (t !~ /\x00/) {
 2148 		t = "ERROR: \000" t
 2149 	}
 2150 	_errfl = 1
 2151 	_[p]["ERROR"] = _[p]["ERROR"] _ln(t (f == "" ? "" : ": " f))
 2152 }
 2153 
 2154 function _drawuid(p, cn, ch, o)
 2155 {
 2156 	_conl("uid: " p)
 2157 	_conl("\toblptr: " (p in _UIDOBL ? _UIDOBL[p] "'" : "-"))
 2158 	if (p in _UIDOBL) {
 2159 		if (! _isptr(o = _UIDOBL[p])) {
 2160 			_conl(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> oblptr not pointer")
 2161 		}
 2162 		if (! isarray(_UIDOBLV[o])) {
 2163 			_conl(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> no OBLV array at ptr")
 2164 		}
 2165 	}
 2166 	_conl("\tprefix:   " (p in _UIDPFX ? _UIDPFX[p] "'" : "-"))
 2167 	_conl("\tsuffix:   " (p in _UIDSFX ? _UIDSFX[p] "'" : "-"))
 2168 	_conl("\tcounters: " (cn = p in _UIDCNT ? _UIDCNT[p] "'" : "-"))
 2169 	if (cn != "-") {
 2170 		_conl("\t\tcntrL:   " _UIDCNTL[_UIDCNT[p]] "'")
 2171 		_conl("\t\tcntrH:   " _UIDCNTH[_UIDCNT[p]] "'")
 2172 	}
 2173 	_conl("\tcharset:  " (ch = p in _UIDCHR ? _UIDCHR[p] "'" : "-"))
 2174 	if (ch != "-") {
 2175 		_conl("chrH:    ")
 2176 		_conl(_dumparr(_UIDCHRH[_UIDCHR[p]]))
 2177 		_conl()
 2178 		_conl("chrL:    ")
 2179 		_conl(_dumparr(_UIDCHRL[_UIDCHR[p]]))
 2180 		_conl()
 2181 	}
 2182 }
 2183 
 2184 #_______________________________________________________________________
 2185 function _dumparr(A, t, lv, a)
 2186 {
 2187 	############################################
 2188 	b = PROCINFO["sorted_in"]
 2189 	PROCINFO["sorted_in"] = "_lengthsort"
 2190 	if (isarray(A)) {
 2191 		delete _DUMPARR
 2192 		_dumparrc = _dumparrd = ""
 2193 		_dumparr_i1(A, lv = (lv == "" ? 16 : lv == 0 || (lv + 0) != 0 ? lv : lv == "-*" ? -3 : lv ~ /^\+?\*$/ ? 3 : 16) + 0, lv < 0 ? -1 : 1, 0, _tabtospc(t))
 2194 		PROCINFO["sorted_in"] = a
 2195 		return _retarrd(_DUMPARR, _dumparrd, _dumparrd = "")
 2196 	}
 2197 }
 2198 
 2199 #___________________________________________________________
 2200 function _dumparr_i1(A, lv, ls, ln, t, t2, i, a, f)
 2201 {
 2202 	t2 = _getchrln(" ", length(t))
 2203 	if (ln == lv) {
 2204 		if (ls > 0) {
 2205 			for (i in A) {
 2206 				++a
 2207 			}
 2208 		} else {
 2209 			for (i in A) {
 2210 				isarray(A[i]) ? ++a : ""
 2211 			}
 2212 		}
 2213 		if (length(_dumparrd = _dumparrd t (a > 0 ? " ... (x" a ")" : "") _CHR["EOL"]) > 262144) {
 2214 			_DUMPARR[++_dumparrc] = _dumparrd
 2215 			_dumparrd = ""
 2216 		}
 2217 		return
 2218 	}
 2219 	if (ls >= 0) {
 2220 		for (i in A) {
 2221 			if (! isarray(A[i])) {
 2222 				if (length(_dumparrd = _dumparrd (f ? t2 : t _nop(f = 1)) "[" i "]=" A[i] "'" _CHR["EOL"]) > 262144) {
 2223 					_DUMPARR[++_dumparrc] = _dumparrd
 2224 					_dumparrd = ""
 2225 				}
 2226 			}
 2227 		}
 2228 	}
 2229 	for (i in A) {
 2230 		if (isarray(A[i])) {
 2231 			_dumparr_i1(A[i], lv, ls, ln + ls, _th0(f ? t2 : t, f = 1) "[" i "]")
 2232 		}
 2233 	}
 2234 	if (! f) {
 2235 		if (length(_dumparrd = _dumparrd t _CHR["EOL"]) > 262144) {
 2236 			_DUMPARR[++_dumparrc] = _dumparrd
 2237 			_dumparrd = ""
 2238 		}
 2239 	}
 2240 }
 2241 
 2242 #___________________________________________________________________________________
 2243 ####################################################################################
 2244 
 2245 
 2246 #___________________________________________________________________________________
 2247 # OTHER tFUNCTIONs #################################################################
 2248 
 2249 #_____________________________________________________________________________
 2250 function _dumpobj(p, f, t, s)
 2251 {
 2252 	###################################################
 2253 	s = _dumpobj_i0(p, f, t = t "." p "{")
 2254 	if ((p = _rFCHLD(p))) {
 2255 		return (s = s _dumpobjm(p, f, s ? _getchrln(" ", length(t) - 1) : t " "))
 2256 	}
 2257 	return s
 2258 }
 2259 
 2260 #___________________________________________________________
 2261 function _dumpobj_i0(p, f, t)
 2262 {
 2263 	if (f == "") {
 2264 		return _dumpobj_i2(p, t)
 2265 	}
 2266 	if (f == 0) {
 2267 		return _dumpobj_i1(p, t " ")
 2268 	}
 2269 	return (_dumpobj_i1(p, t " ") _dumpobj_i2(p, _getchrln(" ", length(t))))
 2270 }
 2271 
 2272 #___________________________________________________________
 2273 function _dumpobj_i1(p, t)
 2274 {
 2275 	return _ln(t substr(((p in _tPREV) ? "\253" _tPREV[p] : "") "       ", 1, 7) " " substr(((p in _tPARENT) ? "\210" _tPARENT[p] : "") "       ", 1, 7) " " substr(((p in _tFCHLD) ? _tFCHLD[p] : "") "\205" ((p in _tQCHLD) ? " (" _tQCHLD[p] ") " : "\205") "\205" ((p in _tLCHLD) ? _tLCHLD[p] : "") "                      ", 1, 22) substr(((p in _tNEXT) ? "\273" _tNEXT[p] : "") "        ", 1, 8))
 2276 }
 2277 
 2278 #___________________________________________________________
 2279 function _dumpobj_i2(p, t)
 2280 {
 2281 	return (_dumpobj_i3(_[p], t " ") _dumpobj_i3(_ptr[p], _getchrln(" ", length(t)) "`", "`"))
 2282 }
 2283 
 2284 #___________________________________________________________
 2285 function _dumpobj_i3(A, t, p, e, s, i, t2)
 2286 {
 2287 	if (isarray(A)) {
 2288 		for (i in A) {
 2289 			t2 = _getchrln(" ", length(t))
 2290 			for (i in A) {
 2291 				if (isarray(A[i])) {
 2292 					s = s _dumpobj_i3(A[i], t "[" _dumpobj_i4(i) "]", p, _ln())
 2293 				} else {
 2294 					s = s _ln(t "[" _dumpobj_i4(i) "]=" p _dumpobj_i4(A[i]) "'")
 2295 				}
 2296 				t = t2
 2297 			}
 2298 			return s
 2299 		}
 2300 		return (e == "" ? "" : t e)
 2301 	}
 2302 	if (A == 0 && A == "") {
 2303 		return
 2304 	}
 2305 	return _ln(t "=" _dumpobj_i4(p A) "'")
 2306 }
 2307 
 2308 #___________________________________________________________
 2309 function _dumpobj_i4(t)
 2310 {
 2311 	if (length(t) > 64) {
 2312 		return (substr(t, 1, 28) " ... " substr(t, length(t) - 28))
 2313 	}
 2314 	return t
 2315 }
 2316 
 2317 #_________________________________________________________________
 2318 function _dumpobj_nc(p, f, t)
 2319 {
 2320 	#######################################
 2321 	return _dumpobj_i0(p, f, t "." p "{ ")
 2322 }
 2323 
 2324 #_________________________________________________________________
 2325 function _dumpobjm(p, f, t, s, t2)
 2326 {
 2327 	###################################
 2328 	t2 = _getchrln(" ", length(t))
 2329 	do {
 2330 		s = s _dumpobj(p, f, t)
 2331 		t = t2
 2332 	} while ((p = _rNEXT(p)))
 2333 	return s
 2334 }
 2335 
 2336 #_________________________________________________________________
 2337 function _dumpobjm_nc(p, f, t, s, t2)
 2338 {
 2339 	################################
 2340 	t2 = _getchrln(" ", length(t))
 2341 	do {
 2342 		s = s _dumpobj_nc(p, f, t)
 2343 		t = t2
 2344 	} while ((p = _rNEXT(p)))
 2345 	return s
 2346 }
 2347 
 2348 function _dumpuidgen(p, pd, pc, ps)
 2349 {
 2350 	_conline("#" (++cntdm) ": " p "'")
 2351 	_conl()
 2352 	if (p in _tuidel) {
 2353 		_conl("DEL:   " _var(pd = _tuidel[p]))
 2354 		_conl(_dumparr(_tUIDEL[pd]) _ln())
 2355 	}
 2356 	_conl("PFX: " _tUIDPFX[p] "'")
 2357 	_conl("SFX: " _tUIDSFX[p] "'")
 2358 	_conl("COUNT: " (p in _tuidcnt ? (pc = _tuidcnt[p]) "'" : _th0("-", pc = -2)))
 2359 	_con("CHARS: ")
 2360 	if (p in _tuidchr) {
 2361 		_conl((ps = _tuidchr[p]) "'")
 2362 		_conl("HCHR: " (pc == -2 ? "-" : _tUIDCNTH[pc] "'"))
 2363 		_conl(_dumparr(_tUIDCHRH[ps]) _ln())
 2364 		_conl("LCHR: " (pc == -2 ? "-" : _tUIDCNTL[pc] "'"))
 2365 		_conl(_dumparr(_tUIDCHRL[ps]) _ln())
 2366 	} else {
 2367 		_conl("-")
 2368 	}
 2369 }
 2370 
 2371 #_____________________________________________________________________________
 2372 function _dumpval(v, n)
 2373 {
 2374 	_dumpstr = _dumpstr (v = _ln((n == 0 && n == "" ? "RET" : n) ": " (v == 0 && v == "" ? "-" : v "'")))
 2375 	return v
 2376 }
 2377 
 2378 ########################################################
 2379 function _eXTFN(c, t, P)
 2380 {
 2381 	switch (c) {
 2382 	case "_lib_CMDLN":
 2383 		return t
 2384 		#___________________________________________________________
 2385 	case "_lib_APPLY":
 2386 		return
 2387 		#___________________________________________________________
 2388 	case "_lib_HELP":
 2389 		return
 2390 		#___________________________________________________________
 2391 	case "_lib_NAMEVER":
 2392 		return _ln("_extfn 1.0")
 2393 		#___________________________________________________________
 2394 	case "_lib_BEGIN":
 2395 		return
 2396 		#___________________________________________________________
 2397 	case "_lib_END":
 2398 		return
 2399 	}
 2400 }
 2401 
 2402 #_________________________________________________________________
 2403 function _endpass(t)
 2404 {
 2405 	_endpass_v0 = t
 2406 }
 2407 
 2408 #_______________________________________________________________________
 2409 function _err(t, a, b)
 2410 {
 2411 	###################################################
 2412 	a = BINMODE
 2413 	b = ORS
 2414 	BINMODE = "rw"
 2415 	ORS = ""
 2416 	print(t) > _SYS_STDERR
 2417 	fflush(_SYS_STDERR)
 2418 	BINMODE = a
 2419 	ORS = b
 2420 	return t
 2421 }
 2422 
 2423 #_________________________________________________________________
 2424 function _errnl(t)
 2425 {
 2426 	################################################
 2427 	return _err(t (t ~ /\x0A$/ ? "" : _CHR["EOL"]))
 2428 }
 2429 
 2430 #_______________________________________________________________________
 2431 function _error(t, d, A)
 2432 {
 2433 	#################################################
 2434 	if (_ERRLOG_EF) {
 2435 		A["TYPE"] = "ERROR"
 2436 		A["TEXT"] = t
 2437 		_log(A, d)
 2438 	}
 2439 }
 2440 
 2441 #_______________________________________________________________________
 2442 function _exit(c)
 2443 {
 2444 	#######################################################
 2445 	exit c
 2446 }
 2447 
 2448 #_____________________________________________________________________________
 2449 function _export_data(t, i, A)
 2450 {
 2451 	#################################################
 2452 	A["DATA"] = t
 2453 	A["ID"] = i
 2454 	_expout("_DATA: " _Zexparr(A) "\n")
 2455 }
 2456 
 2457 #___________________________________________________________________________________
 2458 ####################################################################################
 2459 
 2460 #_____________________________________________________________________________
 2461 function _expout(t, d, a, b)
 2462 {
 2463 	####################################################
 2464 	a = BINMODE
 2465 	b = ORS
 2466 	BINMODE = "rw"
 2467 	ORS = ""
 2468 	print(t) > (d ? d : (d = _errlog_file))
 2469 	fflush(d)
 2470 	BINMODE = a
 2471 	ORS = b
 2472 }
 2473 
 2474 #_________________________________________________________________________________________
 2475 ##########################################################################################
 2476 function _extfn_init()
 2477 {
 2478 	##############################################################
 2479 	_formatstrs_init()
 2480 	_formatstrd_init()
 2481 	_formatrexp_init()
 2482 	_unformatstr_init()
 2483 	_mac_init()
 2484 }
 2485 
 2486 function _faccl_i0(A, t, p, P, f, r)
 2487 {
 2488 	f = r = ""
 2489 	if (isarray(A)) {
 2490 		while ((f = A[f])) {
 2491 			r = (@f(t, p, P)) r
 2492 		}
 2493 	}
 2494 	return r
 2495 }
 2496 
 2497 function _faccr_i0(A, t, p, P, f, r)
 2498 {
 2499 	f = r = ""
 2500 	if (isarray(A)) {
 2501 		while ((f = A[f])) {
 2502 			r = r @f(t, p, P)
 2503 		}
 2504 	}
 2505 	return r
 2506 }
 2507 
 2508 #_______________________________________________________________________
 2509 function _fatal(t, d, A)
 2510 {
 2511 	#################################################
 2512 	if (_ERRLOG_FF) {
 2513 		A["TYPE"] = "FATAL"
 2514 		A["TEXT"] = t
 2515 		_log(A, d)
 2516 	}
 2517 	if (! d) {
 2518 		exit
 2519 	}
 2520 }
 2521 
 2522 function _fbaccl(A, t, p, P)
 2523 {
 2524 	return _faccl_i0(A["B"], t, p, P)
 2525 }
 2526 
 2527 function _fbaccr(A, t, p, P)
 2528 {
 2529 	return _faccr_i0(A["B"], t, p, P)
 2530 }
 2531 
 2532 function _ffaccl(A, t, p, P)
 2533 {
 2534 	return _faccl_i0(A["F"], t, p, P)
 2535 }
 2536 
 2537 function _ffaccr(A, t, p, P)
 2538 {
 2539 	return _faccr_i0(A["F"], t, p, P)
 2540 }
 2541 
 2542 ##################
 2543 
 2544 #_______________________________________________________________________
 2545 function _fframe(A, t, p)
 2546 {
 2547 	#################################################
 2548 	return _fframe_i0(A, t, p, A[""])
 2549 }
 2550 
 2551 #___________________________________________________________
 2552 function _fframe_i0(A, t, p, f)
 2553 {
 2554 	return (f ? ((@f(t, p)) _fframe_i0(A, t, p, A[f])) : "")
 2555 }
 2556 
 2557 #_________________________________________________________________
 2558 function _file(f)
 2559 {
 2560 	#################################################
 2561 	if ((f = _filerdnehnd(f)) == "") {
 2562 		return ""
 2563 	}
 2564 	return (f in _FILEXT ? _FILEXT[f] : "")
 2565 }
 2566 
 2567 #_______________________________________________________________________
 2568 function _file_check(p)
 2569 {
 2570 	if (1 || "AGENT" in _[p]) {
 2571 		_tframe("_file_check_i0", p, p)
 2572 	}
 2573 }
 2574 
 2575 #_______________________________________________
 2576 function _file_check_i0(p, pp, p1, p2, f, v)
 2577 {
 2578 	if (_[p]["TYPE"] == "defile") {
 2579 		f = _[p]["FILE"]
 2580 		f = (match(f, /^.:/) ? "" : _[_[pp]["AGENT"]][".Install Path"] "\\") _[p]["FILE"]
 2581 		if ("RQVERSION" in _[p]) {
 2582 			v = _[p]["RQVERSION"]
 2583 		} else {
 2584 			v = _[pp][".Product Version"]
 2585 		}
 2586 		ERRNO = ""
 2587 		if (_th1(_[p]["DATA"] = _rdfile(f), ERRNO)) {
 2588 			delete _[p]["DATA"]
 2589 			return _dllerr(p, "read file: " ERRNO, f)
 2590 		}
 2591 		if (v != "" && v != (_[p]["VERSION"] = _getfilever(f))) {
 2592 			return _dllerr(p, " file version mismatch: ==`" _[p]["VERSION"] "'; !=`" v "'", f)
 2593 		}
 2594 		_creport(p, substr("OK:    FILE DETECTED" (v == "" ? "" : "(" v ")") ": " f, 1, 122))
 2595 	} else if (_[p]["TYPE"] == "defdir") {
 2596 		if (_filexist(f = _[p]["DIR"])) {
 2597 			_creport(p, substr("OK:    DIR DETECTED: " f, 1, 112))
 2598 		} else {
 2599 			_dllerr(p, "directory " f " is not detected")
 2600 		}
 2601 	}
 2602 }
 2603 
 2604 #_________________________________________________________________
 2605 function _filed(f, dd, d)
 2606 {
 2607 	##########################################
 2608 	if ((f = _filerdnehnd(f)) == "") {
 2609 		return ""
 2610 	}
 2611 	if (f in _FILEDIRFL) {
 2612 		return _FILEDIR[f]
 2613 	}
 2614 	if (f in _FILEROOT) {
 2615 		if ((d = filegetdrvdir(_FILEROOT[f]))) {
 2616 			_FILEDIRFL[f]
 2617 		}
 2618 		return (_FILEDIR[f] = d _FILEDIR[f])
 2619 	}
 2620 	if (((dd = dd ? dd : _FILEIO_RD), f) in _FILEDIR) {
 2621 		return _FILEDIR[dd, f]
 2622 	}
 2623 	if ((d = filedi(dd) _FILEDIR[f]) ~ /^\\/) {
 2624 		return (_FILEDIR[dd, f] = d)
 2625 	}
 2626 	return d
 2627 }
 2628 
 2629 #_________________________________________________________________
 2630 function _filen(f)
 2631 {
 2632 	################################################
 2633 	if ((f = _filerdnehnd(f)) == "") {
 2634 		return ""
 2635 	}
 2636 	return (f in _FILENAM ? _FILENAM[f] : "")
 2637 }
 2638 
 2639 #_________________________________________________________________
 2640 function _filene(f)
 2641 {
 2642 	###############################################
 2643 	if ((f = _filerdnehnd(f)) == "") {
 2644 		return ""
 2645 	}
 2646 	return (f in _FILENAM ? _FILENAM[f] : "") (f in _FILEXT ? _FILEXT[f] : "")
 2647 }
 2648 
 2649 #_________________________________________________________________
 2650 function _filenotexist(f, a)
 2651 {
 2652 	######################################
 2653 	if (f == "") {
 2654 		return ""
 2655 	}
 2656 	if ((a = _filepath(f)) == "") {
 2657 		ERRNO = "Filepath error `" f "'"
 2658 		return ""
 2659 	}
 2660 	_cmd("if exist \"" a "\" exit 1 2>NUL")
 2661 	if (_exitcode == 1) {
 2662 		return (ERRNO = _NOP)
 2663 	}
 2664 	return a
 2665 }
 2666 
 2667 #_______________________________________________________________________
 2668 function _filepath(f, dd)
 2669 {
 2670 	################################################
 2671 	if ((f = _filerdnehnd(f)) == "") {
 2672 		return ""
 2673 	}
 2674 	return (filegetrootdir(f, dd) (f in _FILENAM ? _FILENAM[f] : "") (f in _FILEXT ? _FILEXT[f] : ""))
 2675 }
 2676 
 2677 #_________________________________________________________________
 2678 function _filer(f, dd)
 2679 {
 2680 	#############################################
 2681 	if ((f = _filerdnehnd(f)) == "") {
 2682 		return ""
 2683 	}
 2684 	if (f in _FILEROOT) {
 2685 		return _FILEROOT[f]
 2686 	}
 2687 	if (((dd = dd ? dd : _FILEIO_RD), f) in _FILEROOT) {
 2688 		return _FILEROOT[dd, f]
 2689 	}
 2690 	return (_FILEROOT[dd, f] = fileri(dd))
 2691 }
 2692 
 2693 #_________________________________________________________________
 2694 function _filerd(f, dd)
 2695 {
 2696 	############################################
 2697 	if ((f = _filerdnehnd(f)) == "") {
 2698 		return ""
 2699 	}
 2700 	return filegetrootdir(f, dd)
 2701 }
 2702 
 2703 #_________________________________________________________________
 2704 function _filerdn(f, dd)
 2705 {
 2706 	###########################################
 2707 	if ((f = _filerdnehnd(f)) == "") {
 2708 		return ""
 2709 	}
 2710 	return (f in _FILENAM ? (filegetrootdir(f, dd) _FILENAM[f]) : "")
 2711 }
 2712 
 2713 #_________________________________________________________________
 2714 function _filerdne(f, dd)
 2715 {
 2716 	##########################################
 2717 	if ((f = _filerdnehnd(f)) == "") {
 2718 		return ""
 2719 	}
 2720 	if ((f in _FILENAM)) {
 2721 		return (filegetrootdir(f, dd) _FILENAM[f] (f in _FILEXT ? _FILEXT[f] : ""))
 2722 	}
 2723 	if (f in _FILEXT) {
 2724 		return (filegetrootdir(f, dd) _FILEXT[f])
 2725 	}
 2726 	return ""
 2727 }
 2728 
 2729 #___________________________________________________________
 2730 function _filerdnehnd(st, c, r, d, n, A)
 2731 {
 2732 	if (st) {
 2733 		if ((c = toupper(st)) in _FILECACHE) {
 2734 			FLENGTH = length(st)
 2735 			return _FILECACHE[c]
 2736 		}
 2737 		if (match(st, /^[ \t]*\\[ \t]*\\/)) {
 2738 			if (match(substr(st, (FLENGTH = RLENGTH) + 1), /^[ \t]*([0-9A-Za-z\-]+)[ \t]*(\\[ \t]*([A-Za-z])[ \t]*\$[ \t]*)?(\\[ \t]*([0-9A-Za-z_\!\+\-\[\]\(\)\{\}\~\.]+( +[0-9A-Za-z_\!\+\-\[\]\(\)\{\}\~\.]+)*[ \t]*\\)+[ \t]*)?(([0-9A-Za-z_\!\+\.\~\-\[\]\{\}\(\)]+( +[0-9A-Za-z_\!\+\.\~\-\[\]\{\}\(\)]+)*)[ \t]*)?/, A)) {
 2739 				FLENGTH = FLENGTH + RLENGTH
 2740 				d = (A[3] ? ("\\" A[3] "$") : "") A[4]
 2741 				gsub(/[ \t]*\\[ \t]*/, "\\", d)
 2742 				if ((st = toupper((r = "\\\\" A[1]) d (n = A[8]))) in _FILECACHE) {
 2743 					return (_FILECACHE[substr(c, 1, FLENGTH)] = _FILECACHE[st])
 2744 				}
 2745 				_FILEDIR[c = _FILECACHE[substr(c, 1, FLENGTH)] = _FILECACHE[st] = ++_file_rootcntr] = d
 2746 				_FILEDIRFL[c]
 2747 				_FILEROOT[c] = r
 2748 			} else {
 2749 				FLENGTH = 0
 2750 				_filepath_err = "UNC"
 2751 				return ""
 2752 			}
 2753 		} else {
 2754 			match(st, /^(([ \t]*\.[ \t]*\\[ \t]*)|(([ \t]*([A-Za-z])[ \t]*(\:)[ \t]*)?([ \t]*(\\)[ \t]*)?))([ \t]*(([ \t]*[0-9A-Za-z_\!\+\-\[\]\(\)\{\}\~\.]+( +[0-9A-Za-z_\!\+\-\[\]\(\)\{\}\~\.]+)*[ \t]*\\)+)[ \t]*)?([ \t]*([0-9A-Za-z_\!\+\.\~\-\[\]\{\}\(\)]+( +[0-9A-Za-z_\!\+\.\~\-\[\]\{\}\(\)]+)*)[ \t]*)?/, A)
 2755 			if (! (FLENGTH = RLENGTH)) {
 2756 				return ""
 2757 			}
 2758 			d = A[8] A[10]
 2759 			gsub(/[ \t]*\\[ \t]*/, "\\", d)
 2760 			if ((st = toupper((r = A[5] A[6]) d (n = A[14]))) in _FILECACHE) {
 2761 				return (_FILECACHE[substr(c, 1, FLENGTH)] = _FILECACHE[st])
 2762 			}
 2763 			_FILEDIR[c = _FILECACHE[substr(c, 1, FLENGTH)] = _FILECACHE[st] = ++_file_rootcntr] = d
 2764 			if (A[8]) {
 2765 				_FILEDIRFL[c]
 2766 			}
 2767 			if (r) {
 2768 				_FILEROOT[c] = r
 2769 			}
 2770 		}
 2771 		if (n) {
 2772 			if (match(n, /\.[^\.]*$/)) {
 2773 				_FILEXT[c] = substr(n, RSTART)
 2774 				_FILENAM[c] = substr(n, 1, RSTART - 1)
 2775 			} else {
 2776 				_FILENAM[c] = n
 2777 			}
 2778 		}
 2779 		return c
 2780 	}
 2781 	return ""
 2782 }
 2783 
 2784 #_______________________________________________________________________
 2785 function _filexist(f, a)
 2786 {
 2787 	################################################
 2788 	if (f == "") {
 2789 		return ""
 2790 	}
 2791 	if ((a = _filepath(f)) == "") {
 2792 		ERRNO = "Filepath error `" f "'"
 2793 		return ""
 2794 	}
 2795 	_cmd("if exist \"" a "\" exit 1 2>NUL")
 2796 	if (_exitcode == 1) {
 2797 		return a
 2798 	}
 2799 	ERRNO = "File not found `" f "'"
 2800 	return _NOP
 2801 }
 2802 
 2803 #_______________________________________________________________________
 2804 function _fn(f, p0, p1, p2)
 2805 {
 2806 	################################################
 2807 	if (f in FUNCTAB) {
 2808 		return @f(p0, p1, p2)
 2809 	}
 2810 }
 2811 
 2812 #_______________________________________________________________________
 2813 function _foreach(A, f, r, p0, p1, p2, i, p)
 2814 {
 2815 	####################################
 2816 	if (isarray(A)) {
 2817 		_TMP0[p = _n()]["."] = 1
 2818 		_foreach_i0(A, f, _TMP0[p], p0, p1, p2)
 2819 		return _th0(_retarr(_TMP0[p]), _tdel(p))
 2820 	}
 2821 	if (_isptr(A)) {
 2822 		_TMP0[p = _n()][_ARRLEN] = 1
 2823 		_tframe4("_foreach_i1" (r ? "~" r : ""), A, f, _TMP0[p], p0, p1)
 2824 		return _th0(_retarr(_TMP0[p]), _tdel(p))
 2825 	}
 2826 }
 2827 
 2828 #_____________________________________________________
 2829 function _foreach_i0(A, f, D, p0, p1, p2)
 2830 {
 2831 	for (i in A) {
 2832 		if (isarray(A[i])) {
 2833 			_foreach_i0(A[i], f, D, p0, p1, p2)
 2834 		} else {
 2835 			_gen(D, @f(A[i], p0, p1, p2))
 2836 		}
 2837 	}
 2838 }
 2839 
 2840 #_____________________________________________________
 2841 function _foreach_i1(p, f, D, p0, p1, p2)
 2842 {
 2843 	_gen(D, @f(p, p0, p1, p2))
 2844 }
 2845 
 2846 #_____________________________________________________________________________
 2847 function _formatrexp(t)
 2848 {
 2849 	_formatstrq0 = split(t, _FORMATSTRA, /[\/\x00-\x1F\x80-\xFF]/, _FORMATSTRB)
 2850 	_formatstrs0 = ""
 2851 	for (t = 1; t < _formatstrq0; t++) {
 2852 		_formatstrs0 = _formatstrs0 _FORMATSTRA[t] _FORMATREXPESC[_FORMATSTRB[t]]
 2853 	}
 2854 	return (_formatstrs0 _FORMATSTRA[t])
 2855 }
 2856 
 2857 #___________________________________________________________
 2858 function _formatrexp_init()
 2859 {
 2860 	_defescarr(_FORMATREXPESC, "[\\x00-\\x1F\\x80-\\xFF]", _QASC)
 2861 	_defescarr(_FORMATREXPESC, "\\/", "\\")
 2862 	_FORMATREXPESC["\t"] = "\\t"
 2863 }
 2864 
 2865 #_____________________________________________________________________________
 2866 function _formatstrd(t)
 2867 {
 2868 	_formatstrq0 = split(t, _FORMATSTRA, /["\x00-\x1F\x80-\xFF]/, _FORMATSTRB)
 2869 	_formatstrs0 = ""
 2870 	for (t = 1; t < _formatstrq0; t++) {
 2871 		_formatstrs0 = _formatstrs0 _FORMATSTRA[t] _FORMATSTRDESC[_FORMATSTRB[t]]
 2872 	}
 2873 	return (_formatstrs0 _FORMATSTRA[t])
 2874 }
 2875 
 2876 #___________________________________________________________
 2877 function _formatstrd_init()
 2878 {
 2879 	_defescarr(_FORMATSTRDESC, "[\\x00-\\x1F\\x80-\\xFF]", _QASC)
 2880 	_defescarr(_FORMATSTRDESC, "[\\\\\"]", "\\")
 2881 	_FORMATSTRDESC["\t"] = "\\t"
 2882 }
 2883 
 2884 #__________________________________________________________________________________
 2885 
 2886 ####################################################################################
 2887 
 2888 
 2889 
 2890 
 2891 #___________________________________________________________________________________
 2892 function _formatstrs(t)
 2893 {
 2894 	_formatstrq0 = split(t, _FORMATSTRA, /['\x00-\x1F\x80-\xFF]/, _FORMATSTRB)
 2895 	_formatstrs0 = ""
 2896 	for (t = 1; t < _formatstrq0; t++) {
 2897 		_formatstrs0 = _formatstrs0 _FORMATSTRA[t] _FORMATSTRSESC[_FORMATSTRB[t]]
 2898 	}
 2899 	return (_formatstrs0 _FORMATSTRA[t])
 2900 }
 2901 
 2902 #___________________________________________________________
 2903 function _formatstrs_init()
 2904 {
 2905 	_defescarr(_FORMATSTRSESC, "[\\x00-\\x1F\\x80-\\xFF]", _QASC)
 2906 	_defescarr(_FORMATSTRSESC, "[\\\\']", "\\")
 2907 	_FORMATSTRSESC["\t"] = "\\t"
 2908 }
 2909 
 2910 function _fpp(q, D, S)
 2911 {
 2912 	_conl()
 2913 	_conline(q)
 2914 	_conl()
 2915 	q = _patharr0(S, q)
 2916 	#_arregpath(D,S)
 2917 	#_conl(_dumparr(D))
 2918 	_conl(_dumparr(S))
 2919 	_conl()
 2920 	return q
 2921 }
 2922 
 2923 #_______________________________________________________________________
 2924 ########################################################################
 2925 function _fthru(A, c, p, B)
 2926 {
 2927 	return _fthru_i0(A, c, p, B, A[""])
 2928 }
 2929 
 2930 #_________________________________________________________________
 2931 function _fthru_i0(A, c, p, B, f)
 2932 {
 2933 	return (f ? @f(c, _fthru_i0(A, c, p, B, A[f]), B) : "")
 2934 }
 2935 
 2936 function _gen(D, t)
 2937 {
 2938 	if (length(D[D[_ARRLEN]] = D[D["."]] t) > _datablock_length) {
 2939 		D[++D[_ARRLEN]] = ""
 2940 	}
 2941 }
 2942 
 2943 #_____________________________________________________________________________
 2944 function _gensubfn(t, r, f, p0, A)
 2945 {
 2946 	###############################################
 2947 	if (match(t, r, A)) {
 2948 		return (substr(t, 1, RSTART - 1) (@f(_th0(substr(t, RSTART, RLENGTH), t = substr(t, RSTART + RLENGTH)), A, p0)) _gensubfn(t, r, f, p0))
 2949 	}
 2950 	return t
 2951 }
 2952 
 2953 #_____________________________________________________________________________
 2954 function _get_errout(p)
 2955 {
 2956 	#######################################################
 2957 	return _tframe("_get_errout_i0", p)
 2958 }
 2959 
 2960 #_______________________________________________________________________
 2961 function _get_errout_i0(p, t, n, a)
 2962 {
 2963 	return (p in _tLOG ? (_get_errout_i1(p) _get_errout_i3(p)) : "")
 2964 }
 2965 
 2966 #_________________________________________________________________
 2967 function _get_errout_i1(p, t, n, a)
 2968 {
 2969 	if (p in _tLOG) {
 2970 		n = ""
 2971 		if (_tLOG[p]["TYPE"]) {
 2972 			n = _tLOG[p]["TYPE"] ": " _get_errout_i2(p)
 2973 			if (match(_tLOG[p]["TEXT"], /\x1F/)) {
 2974 				t = n
 2975 				gsub(/[^\t]/, " ", t)
 2976 				return (_ln(n substr(_tLOG[p]["TEXT"], 1, RSTART - 1)) _ln(t substr(_tLOG[p]["TEXT"], RSTART + 1)))
 2977 			}
 2978 		}
 2979 		return _ln(n _tLOG[p]["TEXT"])
 2980 	}
 2981 }
 2982 
 2983 #_______________________________________________________________________
 2984 function _get_errout_i2(p)
 2985 {
 2986 	return ("FILE" in _tLOG[p] ? (_tLOG[p]["FILE"] ("LINE" in _tLOG[p] ? ("(" _tLOG[p]["LINE"] ")") : "") ": ") : "")
 2987 }
 2988 
 2989 #_______________________________________________________________________
 2990 function _get_errout_i3(p, t, ts, cl, cp, cr, a, b)
 2991 {
 2992 	if ("LSTR" in _tLOG[p]) {
 2993 		t = _tLOG[p]["FULLSTR"]
 2994 		ts = _tLOG[p]["TS"]
 2995 		cp = "^"
 2996 		if ("CSTR" in _tLOG[p]) {
 2997 			cr = _tLOG[p]["CSTR"]
 2998 			cl = _tLOG[p]["CLSTR"]
 2999 			if ("CPSTR" in _tLOG[p]) {
 3000 				cp = _tLOG[p]["CPSTR"]
 3001 			}
 3002 		}
 3003 		cr = substr(cr, length(cl) + length(cp) + 1)
 3004 		return (_ln(_tabtospc(t, ts)) _ln(_getchrln(" ", a = length(_tabtospc(_tLOG[p]["LSTR"], ts))) _getchrln("-", b = length(_tabtospc(cl, ts, a))) _getchrln("^", b = length(_tabtospc(cp, ts, a = a + b))) _getchrln("-", length(_tabtospc(cr, ts, a + b)))))
 3005 	}
 3006 }
 3007 
 3008 #_____________________________________________________________________________
 3009 function _get_logout(p)
 3010 {
 3011 	#######################################################
 3012 	return _tframe("_get_logout_i0", p)
 3013 }
 3014 
 3015 #_______________________________________________________________________
 3016 function _get_logout_i0(p, t, n, a)
 3017 {
 3018 	if (p in _tLOG) {
 3019 		n = ("DATE" in _tLOG[p] ? (_tLOG[p]["DATE"] " ") : "") ("TIME" in _tLOG[p] ? (_tLOG[p]["TIME"] " ") : "")
 3020 		if (_tLOG[p]["TYPE"]) {
 3021 			n = n _tLOG[p]["TYPE"] ": " ("FILE" in _tLOG[p] ? (_tLOG[p]["FILE"] ("LINE" in _tLOG[p] ? ("(" _tLOG[p]["LINE"] ")") : "") ": ") : "")
 3022 			if (match(_tLOG[p]["TEXT"], /\x1F/)) {
 3023 				t = n
 3024 				gsub(/[^\t]/, " ", t)
 3025 				return (_ln(n substr(_tLOG[p]["TEXT"], 1, RSTART - 1)) _ln(t substr(_tLOG[p]["TEXT"], RSTART + 1)))
 3026 			}
 3027 		}
 3028 		return _ln(n _tLOG[p]["TEXT"])
 3029 	}
 3030 }
 3031 
 3032 #_______________________________________________________________________
 3033 function _getchrln(s, w)
 3034 {
 3035 	#################################################
 3036 	if (s == "") {
 3037 		return
 3038 		#if ( w!=w+0 || w<0 )	w=_CON_WIDTH
 3039 	}
 3040 	if (length(s) < w) {
 3041 		if (s in _GETCHRLN) {
 3042 			if (length(_getchrlnt0 = _GETCHRLN[s]) >= w) {
 3043 				return substr(_getchrlnt0, 1, w)
 3044 			}
 3045 		} else {
 3046 			_getchrlnt0 = s s
 3047 		}
 3048 		while (length(_getchrlnt0) < w) {
 3049 			_getchrlnt0 = _getchrlnt0 _getchrlnt0
 3050 		}
 3051 		_GETCHRLN[s] = _getchrlnt0
 3052 		return substr(_getchrlnt0, 1, w)
 3053 	} else {
 3054 		return substr(s, 1, w)
 3055 	}
 3056 }
 3057 
 3058 #_______________________________________________________________________
 3059 function _getdate()
 3060 {
 3061 	#####################################################
 3062 	return strftime("%F")
 3063 }
 3064 
 3065 #_____________________________________________________________________________
 3066 function _getfilepath(t, f, al, b, A)
 3067 {
 3068 	############################################
 3069 	ERRNO = ""
 3070 	if (match(t, /^[ \t]*(("([^"]*)"[ \t]*)|([`']([^']*)'[ \t]*)|(([^ \t]+)[ \t]*))/, A)) {
 3071 		al = RLENGTH
 3072 		f = A[3] A[5] A[7]
 3073 		_conl("_getfilepath(" f ")        (" al ")")
 3074 		if ((b = _filepath(f))) {
 3075 			if (length(f) <= FLENGTH) {
 3076 				FLENGTH = al
 3077 				return b
 3078 			}
 3079 			ERRNO = "Filepath `" f "' error"
 3080 		}
 3081 	}
 3082 	FLENGTH = 0
 3083 }
 3084 
 3085 function _getfilever(f)
 3086 {
 3087 	#############################################################
 3088 	split(_cmd(_fileverpath " \"" f "\""), _GETFILEVERA0, /[ \t]+/)
 3089 	if (_GETFILEVERA0[5]) {
 3090 		return _GETFILEVERA0[5]
 3091 	}
 3092 }
 3093 
 3094 #_________________________________________________________________
 3095 function _getime()
 3096 {
 3097 	################################################
 3098 	return strftime("%H:%M:%S")
 3099 }
 3100 
 3101 #_________________________________________________________________
 3102 function _getmpdir(f, dd)
 3103 {
 3104 	##########################################
 3105 	if ((! dd) || (! (dd = _filerd(dd)))) {
 3106 		dd = _FILEIO_TMPRD
 3107 	}
 3108 	if ((f = f ? _filerd(f, dd) : _filerd("_" ++_FILEIO_TMPCNTR "\\", dd))) {
 3109 		_FILEIO_RDTMP[toupper(f)]
 3110 	}
 3111 	return f
 3112 }
 3113 
 3114 #_________________________________________________________________
 3115 function _getmpfile(f, dd)
 3116 {
 3117 	#########################################
 3118 	if ((! dd) || (! (dd = _filerd(dd)))) {
 3119 		dd = _FILEIO_TMPRD
 3120 	}
 3121 	if ((f = _filerdne(_filene(f) ? f : (f "_" ++_FILEIO_TMPCNTR), dd))) {
 3122 		_FILEIO_RDNETMP[toupper(f)]
 3123 	}
 3124 	return f
 3125 }
 3126 
 3127 #_______________________________________________________________________
 3128 function _getperf(o, t, a)
 3129 {
 3130 	###############################################
 3131 	o == "" ? ++_getperf_opcurr : _getperf_opcurr = o
 3132 	if ((a = _getsecond()) != _getperf_last) {
 3133 		_getperf_opsec = (_getperf_opcurr - _getperf_opstart) / ((_getperf_last = a) - _getperf_start)
 3134 		return @_getperf_fn(o, t, a)
 3135 	}
 3136 	return 1
 3137 }
 3138 
 3139 #___________________________________________________________
 3140 function _getperf_(o, t, a)
 3141 {
 3142 	if (a >= _getperf_end) {
 3143 		return 0
 3144 	}
 3145 	if (_getperf_opsecp != _getperf_opsec) {
 3146 		_constat((_constatstr == _getperf_stat ? _getperf_statstr : (_getperf_statstr = _constatstr)) t " [TIME=" (a - _getperf_start) " sec(" (_getperf_opsecp = _getperf_opsec) " ops/sec)]")
 3147 		_getperf_stat = _constatstr
 3148 	}
 3149 	return 1
 3150 }
 3151 
 3152 #___________________________________________________________
 3153 function _getperf_noe(o, t, a)
 3154 {
 3155 	if (_getperf_opsecp != _getperf_opsec) {
 3156 		_constat((_constatstr == _getperf_stat ? _getperf_statstr : (_getperf_statstr = _constatstr)) t " [TIME=" (a - _getperf_start) " sec(" (_getperf_opsecp = _getperf_opsec) " ops/sec)]")
 3157 		_getperf_stat = _constatstr
 3158 	}
 3159 	return 1
 3160 }
 3161 
 3162 #___________________________________________________________
 3163 function _getperf_noenot(o, t, a)
 3164 {
 3165 	return 1
 3166 }
 3167 
 3168 #___________________________________________________________
 3169 function _getperf_not(o, t, a)
 3170 {
 3171 	if (a < _getperf_end) {
 3172 		return 1
 3173 	}
 3174 }
 3175 
 3176 #_________________________________________________________________________________________
 3177 ##########################################################################################
 3178 function _getreg_i1(D, r, R, a, i, il, ir, rc, B)
 3179 {
 3180 	a = IGNORECASE
 3181 	IGNORECASE = 1
 3182 	r = "^" _torexp(r)
 3183 	rc = 0
 3184 	zs = ""
 3185 	for (i in R) {
 3186 		if (match(i, r, B)) {
 3187 			il = B[_torexp_pfxcntr]
 3188 			ir = gensub(/....$/, "", 1, substr(i, 1 + B[_torexp_pfxcntr, "length"]))
 3189 			if (! gsub(/^\\/, "", ir) && match(il, /[^\\]+$/)) {
 3190 				ir = substr(il, RSTART) ir
 3191 			}
 3192 			D[ir] = R[i]
 3193 			rc++
 3194 		}
 3195 	}
 3196 	IGNORECASE = a
 3197 	if (rc > 0) {
 3198 		return rc
 3199 	}
 3200 }
 3201 
 3202 #_________________________________________________________________
 3203 function _getsecond()
 3204 {
 3205 	#############################################
 3206 	return systime()
 3207 }
 3208 
 3209 #___________________________________________________________
 3210 function _getsecondsync(a, c, b, c2)
 3211 {
 3212 	##########################
 3213 	a = systime()
 3214 	while (a == systime()) {
 3215 		++c
 3216 	}
 3217 	return (a + 1)
 3218 }
 3219 
 3220 #_______________________________________________________________________
 3221 function _getuid(p)
 3222 {
 3223 	################################################# 1 #
 3224 	if (p in _UIDOBL) {
 3225 		for (_tptr in _UIDOBLV[_getuida0 = _UIDOBL[p]]) {
 3226 			delete _UIDOBLV[_getuida0][_tptr]
 3227 			_CLASSPTR[_tptr] = p
 3228 			return _tptr
 3229 		}
 3230 	}
 3231 	_CLASSPTR[_tptr = _UIDPFX[p] _getuid_i0(_UIDCNT[p], _UIDCHRL[_tptr = _UIDCHR[p]], _UIDCHRH[_tptr]) _UIDSFX[p]] = p
 3232 	return _tptr
 3233 }
 3234 
 3235 #_____________________________________________________
 3236 function _getuid_i0(p, UL, UH)
 3237 {
 3238 	if ("" == (_tptr = UL[_UIDCNTL[p]])) {
 3239 		for (_tptr in UH) {
 3240 			delete UH[_tptr]
 3241 			return (_UIDCNTH[p] = _tptr) (_UIDCNTL[p] = UL[""])
 3242 		}
 3243 		_fatal("out of UID")
 3244 	}
 3245 	return (_UIDCNTH[p] (_UIDCNTL[p] = _tptr))
 3246 }
 3247 
 3248 function _handle8494(t)
 3249 {
 3250 	return gensub(/(.)/, ".\\1", "G", t)
 3251 }
 3252 
 3253 #_____________________________________________________________________________
 3254 function _hexnum(n, l)
 3255 {
 3256 	#########################################################
 3257 	if (l + 0 < 1) {
 3258 		l = 2
 3259 	}
 3260 	return sprintf("%." (l + 0 < 1 ? 2 : l) "X", n)
 3261 }
 3262 
 3263 #_________________________________________________________________
 3264 function _igetperf(t, s, o)
 3265 {
 3266 	#########################################	# t-test period in seconds(==0 ? no period; s(=true/false)-output/not output status; o-qnt of ops before test start
 3267 	if (t == 0 && t == "" && s == 0 && s == "" && o == 0 && o == "") {
 3268 		if (_getperf_fn !~ /not$/ && _constatstr == _getperf_stat) {
 3269 			_constat(_getperf_statstr)
 3270 		}
 3271 		_getperf_fn = "_nop"
 3272 		return ("[TIME=" (_getperf_last - _getperf_start) " sec(" _getperf_opsec " ops/sec)]")
 3273 	}
 3274 	_conl("initiate _getperf")
 3275 	_getperf_opstart = _getperf_opcurr = o + 0
 3276 	_getperf_opsec = _getperf_opsecp = _getperf_stat = _getperf_statstr = ""
 3277 	_getperf_end = t + (_getperf_start = _getperf_last = _getsecondsync())
 3278 	_getperf_fn = (t + 0 > 0 ? "_getperf_" : "_getperf_noe") (s ? "" : "not")
 3279 	return _getperf_start
 3280 }
 3281 
 3282 function _import_data(t, p, p2, a)
 3283 {
 3284 	if (match(t, /^_DATA: /)) {
 3285 		_tDATA[a = _wLCHLD(p, _N())][""]
 3286 		delete _tDATA[a][""]
 3287 		_Zimparr(_tDATA[a], substr(t, 8))
 3288 		_conl("DATA: `" _tDATA[a]["ID"] "':`" _tDATA[a]["DATA"] "'")
 3289 		return ""
 3290 	}
 3291 	return t
 3292 }
 3293 
 3294 #_______________________________________________________________________
 3295 function _info(t, d, A)
 3296 {
 3297 	##################################################
 3298 	if (_ERRLOG_IF) {
 3299 		A["TYPE"] = "INFO"
 3300 		A["TEXT"] = t
 3301 		_log(A, d)
 3302 	}
 3303 }
 3304 
 3305 # test with the different path types
 3306 #	_conl(_ln("SRC:") _dumparr(S)); _conl();
 3307 function _ini(p, cs, dptr, pfx, sfx, hstr, lstr)
 3308 {
 3309 	return _inituid(p, cs, dptr, pfx, sfx, hstr, lstr, A)
 3310 }
 3311 
 3312 function _initfilever()
 3313 {
 3314 	_fileverpath = "\\\\CPU\\eGAWK\\LIB\\_filever\\_filever.exe"
 3315 }
 3316 
 3317 function _initrdreg()
 3318 {
 3319 	_RDREGTYPE["SZ"] = "STR"
 3320 	_RDREGTYPE["DWORD"] = "W32"
 3321 	_RDREGTYPE["QWORD"] = "W64"
 3322 	_RDREGTYPE["BINARY"] = "BIN"
 3323 	_RDREGTYPE["EXPAND_SZ"] = "XSZ"
 3324 	_RDREGTYPE["MULTI_SZ"] = "MSZ"
 3325 	_RDrdregfld = _rdregkey = 0
 3326 }
 3327 
 3328 function _initregpath0()
 3329 {
 3330 	_REGPATH0REGDIR[""] = "HKEY_LOCAL_MACHINE"
 3331 	_REGPATH0REGDIR["HKLM"] = "HKEY_LOCAL_MACHINE"
 3332 	_REGPATH0REGDIR["HKEY_LOCAL_MACHINE"] = "HKEY_LOCAL_MACHINE"
 3333 	_REGPATH0REGDIR["HKCR"] = "HKEY_CLASSES_ROOT"
 3334 	_REGPATH0REGDIR["HKEY_CLASSES_ROOT"] = "HKEY_CLASSES_ROOT"
 3335 	_REGPATH0REGDIR["HKCU"] = "HKEY_CURRENT_USER"
 3336 	_REGPATH0REGDIR["HKEY_CURRENT_USER"] = "HKEY_CURRENT_USER"
 3337 	_REGPATH0REGDIR["HKU"] = "HKEY_USERS"
 3338 	_REGPATH0REGDIR["HKEY_USERS"] = "HKEY_USERS"
 3339 	_REGPATH0REGDIR["HKCC"] = "HKEY_CURRENT_CONFIG"
 3340 	_REGPATH0REGDIR["HKEY_CURRENT_CONFIG"] = "HKEY_CURRENT_CONFIG"
 3341 	_REGPATH0REGDIR["HKPD"] = "HKEY_PERFORMANCE_DATA"
 3342 	_REGPATH0REGDIR["HKEY_PERFORMANCE_DATA"] = "HKEY_PERFORMANCE_DATA"
 3343 }
 3344 
 3345 function _initshare()
 3346 {
 3347 	_sharextool = "\\\\CPU\\eGAWK\\LIB\\_share\\_share.exe"
 3348 }
 3349 
 3350 #_________________________________________
 3351 function _initspecialuid()
 3352 {
 3353 	_NOINDEX = _getuid()
 3354 	_LEN = _getuid()
 3355 	_PTR = _getuid()
 3356 	_NAME = _getuid()
 3357 	_TYPE = _getuid()
 3358 	_FORMAT = _getuid()
 3359 }
 3360 
 3361 function _initsys()
 3362 {
 3363 }
 3364 
 3365 #_______________________________________________________________________
 3366 function _inituid(p, cs, dptr, pfx, sfx, hstr, lstr, A)
 3367 {
 3368 	################### 1 #
 3369 	if (cs == 0 && cs == "") {
 3370 		cs = p
 3371 		p = _getuid()
 3372 	}
 3373 	_conl()
 3374 	_conl()
 3375 	_conl(cs)
 3376 	if (match(cs, /^(([^:]*):)?(([^'\xB4]*\xB4.)*[^'\xB4]*)[']/, A)) {
 3377 		pfx = A[3]
 3378 		dptr = A[2]
 3379 	}
 3380 	if (match(cs = substr(cs, 1 + RLENGTH), /'(([^'\xB4]*\xB4.)*[^'\xB4]*)$/, A)) {
 3381 		sfx = A[1]
 3382 		cs = substr(cs, 1, RSTART - 1)
 3383 	}
 3384 	if (match(cs, /^(([`\^])(.*))/, A)) {
 3385 		if (A[2] == "`") {
 3386 			hstr = A[3] "~"
 3387 			lstr = ""
 3388 		} else {
 3389 			lstr = A[3] "+"
 3390 			hstr = ""
 3391 		}
 3392 	} else if (match(cs, /^(([^'\xB4\|]*\xB4.)*[^'\xB4\|]*)(\|(.*))?/, A)) {
 3393 		hstr = A[1]
 3394 		lstr = A[4]
 3395 	} else {
 3396 		ERRNO = "_inituid(): bad parameters"
 3397 		return
 3398 	}
 3399 	_conl(dptr ":" pfx "'" hstr "|" lstr "'" sfx)
 3400 	return _cfguid(p, dptr, pfx, sfx, hstr, lstr)
 3401 }
 3402 
 3403 function _inituidefault(h, l, H, L)
 3404 {
 3405 	_classys = ""
 3406 	delete _UIDOBLV[_UIDOBLV[_UIDOBL[_classys] = _classys][""] = _classys][""]
 3407 	_UIDPFX[_classys]
 3408 	_UIDSFX[_classys]
 3409 	_UIDCNT[_classys] = _UIDCHR[_classys] = _CLASSPTR[_classys] = _classys
 3410 	h = "AB"
 3411 	l = h "01"
 3412 	_splitstr(H, h)
 3413 	_splitstr(L, l)
 3414 	delete _UIDCHRH[_UIDCHRH[_classys][""] = _classys][""]
 3415 	delete _UIDCHRL[_UIDCHRL[_classys][""] = _classys][""]
 3416 	_UIDCNTH[_classys]
 3417 	_cfguidh(_classys, H, L)
 3418 	_UIDCNTL[_classys] = _cfguidl(_classys, L, L)
 3419 	_CLASSFN[_classys]["del"] = "_tobjDEL"
 3420 	_CLASSFN[_classys]["new"] = "_tobjNEW"
 3421 	_drawuid(_classys)
 3422 	_initspecialuid()
 3423 }
 3424 
 3425 #_______________________________________________________________________
 3426 function _ins(S, sf, D, df)
 3427 {
 3428 	################################################
 3429 	if (sf in S) {
 3430 		if (isarray(S[sf])) {
 3431 			if (df in D) {
 3432 				if (isarray(D[df])) {
 3433 					return _extarr(D[df], S[sf])
 3434 				}
 3435 				delete D[df]
 3436 			}
 3437 			D[df][""]
 3438 			delete D[df][""]
 3439 			return _extarr(D[df], S[sf])
 3440 		} else {
 3441 			if (isarray(D[df])) {
 3442 				delete D[df]
 3443 			}
 3444 			D[df] = S[sf] D[df]
 3445 		}
 3446 	}
 3447 }
 3448 
 3449 #_________________________________________________________________
 3450 function _insf(A, f)
 3451 {
 3452 	###############################################
 3453 	A["F"][""] = A["B"][A["F"][f] = A["F"][""]] = f
 3454 }
 3455 
 3456 #_________________________________________________________________
 3457 function _insframe(A, f)
 3458 {
 3459 	###########################################
 3460 	A[f] = A[""]
 3461 	A[""] = f
 3462 }
 3463 
 3464 ########################
 3465 
 3466 #_________________________________________________________________
 3467 function _inspass(A, f)
 3468 {
 3469 	A[f] = A[""]
 3470 	A[""] = f
 3471 }
 3472 
 3473 # there is problem with string's format: i can;t easilly merge 2 charsets: comma-divided and every-char-divided strings
 3474 
 3475 #_______________________________________________________________________
 3476 function _isptr(p)
 3477 {
 3478 	################################################## 1 #
 3479 	if (isarray(p)) {
 3480 		is = _NOP
 3481 		it = "A"
 3482 		return 0
 3483 	}
 3484 	is = p
 3485 	if (p == 0 && p == "") {
 3486 		it = "-"
 3487 		return 0
 3488 	}
 3489 	if (p in _CLASSPTR) {
 3490 		return (it = "P")
 3491 	}
 3492 	it = "S"
 3493 	return 0
 3494 }
 3495 
 3496 #_______________________________________________________________________
 3497 function _istr(p)
 3498 {
 3499 	################################################### 1 #
 3500 	if (isarray(p)) {
 3501 		is = _NOP
 3502 		it = "A"
 3503 		return 0
 3504 	}
 3505 	is = p
 3506 	if (p == 0 && p == "") {
 3507 		it = "-"
 3508 		return 0
 3509 	}
 3510 	return (it = p == "" ? "s" : "S")
 3511 }
 3512 
 3513 #_________________________________________________________________
 3514 function _lengthsort(i1, v1, i2, v2)
 3515 {
 3516 	##############################
 3517 	return (length(i1) < length(i2) ? -1 : length(i1) > length(i2) ? 1 : i1 < i2 ? -1 : 1)
 3518 }
 3519 
 3520 #_________________________________________________________________
 3521 function _lib_APPLY()
 3522 {
 3523 	return _ffaccr(_LIBAPI, "_lib_APPLY")
 3524 }
 3525 
 3526 #_________________________________________________________________
 3527 function _lib_BEGIN(A)
 3528 {
 3529 	return _ffaccr(_LIBAPI, "_lib_BEGIN", "", A)
 3530 }
 3531 
 3532 #_______________________________________________________________________
 3533 function _lib_CMDLN(t)
 3534 {
 3535 	return _pass(_LIBAPI["F"], "_lib_CMDLN", t)
 3536 }
 3537 
 3538 #_________________________________________________________________
 3539 function _lib_END(A)
 3540 {
 3541 	return _ffaccr(_LIBAPI, "_lib_END", "", A)
 3542 }
 3543 
 3544 #_________________________________________________________________
 3545 function _lib_HELP()
 3546 {
 3547 	return _fbaccr(_LIBAPI, "_lib_HELP")
 3548 }
 3549 
 3550 #_________________________________________________________________
 3551 function _lib_NAMEVER()
 3552 {
 3553 	return _fbaccr(_LIBAPI, "_lib_NAMEVER")
 3554 }
 3555 
 3556 #_____________________________________________________________________________
 3557 function _ln(t)
 3558 {
 3559 	###############################################################
 3560 	return (t ~ /\x0A$/ ? t : (t _CHR["EOL"]))
 3561 }
 3562 
 3563 #_________________________________________________________________
 3564 function _log(A, p, a, B)
 3565 {
 3566 	###########################################
 3567 	if (isarray(A)) {
 3568 		A["TIME"] = _getime()
 3569 		A["DATE"] = _getdate()
 3570 		if (p) {
 3571 			_tLOG[p = _wLCHLD(p, _N())][""]
 3572 			delete _tLOG[p][""]
 3573 			_movarr(_tLOG[p], A)
 3574 			return p
 3575 		}
 3576 		_expout("_ERRLOG: " _Zexparr(A) "\n")
 3577 	} else {
 3578 		B["TEXT"] = A
 3579 		B["TYPE"] = ""
 3580 		return _log(B, p)
 3581 	}
 3582 }
 3583 
 3584 #_________________________________________________________________
 3585 function _lspctab(t, ts, l, l1, l2, A)
 3586 {
 3587 	################################
 3588 	while (match(t, /^(\t*)( *)((\t*)(.*))$/, A)) {
 3589 		if (A[1, "length"] >= l) {
 3590 			return substr(t, l + 1)
 3591 		}
 3592 		if (A[2]) {
 3593 			if ((l1 = int(A[2, "length"] / ts)) >= (l2 = l - A[1, "length"])) {
 3594 				return (substr(A[2], l2 * ts + 1) A[3])
 3595 			}
 3596 			if (! A[4]) {
 3597 				return A[5]
 3598 			}
 3599 			t = A[1] _getchrln("\t", l1) A[3]
 3600 		} else {
 3601 			return t
 3602 		}
 3603 	}
 3604 }
 3605 
 3606 function _mac_init()
 3607 {
 3608 	_MACPFX["\204"] = "_macpfx84"
 3609 	_MACPFX[""] = "_mpupfxsubret"
 3610 	_MACPFX84SFX["\204"] = "_macpfx84"
 3611 	_MACPFX84SFX["\224"] = "_macsfx94"
 3612 	_MACPFX84SFX[""] = "_mpusfxsubret"
 3613 	_VLDMAXSTRING = 1000000
 3614 }
 3615 
 3616 function _macpfx84(F, D, C, p1, p2, p3)
 3617 {
 3618 	return _mpusub(_MACPFX84SFX, D, C, D[_mpuptr++], p1, p2, p3)
 3619 }
 3620 
 3621 function _macsfx94(F, D, C, p1, p2, p3)
 3622 {
 3623 	return _mpuretsub(D, _handle8494(_mpuacc))
 3624 }
 3625 
 3626 #_______________________________________________________________________
 3627 function _movarr(D, S)
 3628 {
 3629 	###################################################
 3630 	delete D
 3631 	D[""]
 3632 	delete D[""]
 3633 	_addarr(D, S)
 3634 }
 3635 
 3636 function _mpu(t, F, p1, p2, p3, D, C)
 3637 {
 3638 	if (patsplit(t, C, /[\x84\x93\x94]/, D) > 0) {
 3639 		_conline("CODE")
 3640 		_conl()
 3641 		_conl(_dumparr(C))
 3642 		_conline("DATA")
 3643 		_conl()
 3644 		_conl(_dumparr(D))
 3645 		_mpuptr = 0
 3646 		_mpucc0 = ""
 3647 		_mpusub(F, D, C, D[_mpuptr++], p1, p2, p3)
 3648 		return _mpuacc
 3649 	}
 3650 	return t
 3651 }
 3652 
 3653 #
 3654 #	/rexpstr/	->	datastr
 3655 #	(\x00\t\+)*	->	28 00 09 5B 2B 29
 3656 #
 3657 # unesc all non-rexp characters: replace unesc of rexp-characters but do not remove it: \* -> \*, \x2A -> \*, \052 -> \*, \\ -> \#
 3658 function _mpudefaulthnd(F, D, C, p1, p2, p3)
 3659 {
 3660 	_mpuretsub(D, _mpucc0)
 3661 }
 3662 
 3663 function _mpupfxsubret(F, D, C, p1, p2, p3)
 3664 {
 3665 	return 1
 3666 }
 3667 
 3668 function _mpuretsub(D, t)
 3669 {
 3670 	_mpuacc = D[_mpuptr++]
 3671 	_accmpu(D, t)
 3672 	return 1
 3673 }
 3674 
 3675 function _mpusfxsubret(F, D, C, p1, p2, p3)
 3676 {
 3677 	return -1
 3678 }
 3679 
 3680 function _mpusub(F, D, C, d, p1, p2, p3, q)
 3681 {
 3682 	q = D[_ARRLEN]
 3683 	if (_VLDMAXSTRING < length(d)) {
 3684 		D[--D[_ARRLEN]] = d
 3685 		_mpuacc = ""
 3686 	} else {
 3687 		_mpuacc = d
 3688 	}
 3689 	d = _mpucc0
 3690 	_conl("_mpusub enter: in `" _mpuacc "' / _mpuptr=" _mpuptr "'")
 3691 	do {
 3692 		if ((_mpucc0 = C[_mpuptr]) in F) {
 3693 			if (isarray(F[_mpucc0])) {
 3694 				_mpufn0 = F[_mpucc0]
 3695 			}
 3696 			_conl("FN: `" _mpucc0 "' > CALL: `" (_mpufn0) "' : _mpuacc=" _mpuacc "'")
 3697 		} else {
 3698 			_mpufn0 = "_mpudefaulthnd"
 3699 		}
 3700 	} while (! _accmpu(D, _mpuacc, @_mpufn0(F, D, C, p1, p2, p3)))
 3701 	if (_mpufn0 == -1) {
 3702 		_conl("WARNING: unclosed expression: `" d _mpuacc "'")
 3703 		_mpuacc = d _mpuacc
 3704 	}
 3705 	_retarrm(D, q, "", _mpufn0 == -1 ? _th0(d, _mpusubwrng("WARNING: unclosed expression", d _mpuacc)) : "")
 3706 	# collect: _mpuacc=_retarr(D) _mpuacc
 3707 	_conl("mpusub exit: _mpuacc: `" _mpuacc "'")
 3708 }
 3709 
 3710 #_______________________________________________________________________
 3711 function _n(F, v, p)
 3712 {
 3713 	#####################################################
 3714 	for (p in _UIDSDEL) {
 3715 		delete _UIDSDEL[p]
 3716 		delete _ptr[p]
 3717 		delete _tPREV[p]
 3718 		delete _tPARENT[p]
 3719 		delete _tNEXT[p]
 3720 		delete _tFCHLD[p]
 3721 		delete _tQCHLD[p]
 3722 		delete _tLCHLD[p]
 3723 		delete _TMP0[p]
 3724 		delete _TMP1[p]
 3725 		delete _tLINK[p]
 3726 		delete _tCLASS[p]
 3727 		return _nN_i0(p, F, v)
 3728 	}
 3729 	for (p in _UIDS) {
 3730 		delete _UIDS[p]
 3731 		return _nN_i0(p, F, v)
 3732 	}
 3733 	return _nN_i0(_tgenuid(), F, v)
 3734 }
 3735 
 3736 #_____________________________________________________
 3737 function _nN_i0(p, F, v)
 3738 {
 3739 	_[p][""]
 3740 	delete _[p][""]
 3741 	_ptr[p][""]
 3742 	delete _ptr[p][""]
 3743 	_TMP0[p][_ARRLEN] = _TMP1[p][_ARRLEN] = 0
 3744 	if (isarray(F)) {
 3745 		delete F[p]
 3746 		if (isarray(v)) {
 3747 			F[p][""]
 3748 			delete F[p][""]
 3749 			_copyarr(F[p], v)
 3750 		} else if (! (v == 0 && v == "")) {
 3751 			F[p] = v
 3752 		}
 3753 	} else if (! (F == 0 && F == "")) {
 3754 		if (isarray(v)) {
 3755 			_[p][F][""]
 3756 			delete _[p][F][""]
 3757 			_copyarr(_[p][F], v)
 3758 		} else if (v == 0 && v == "") {
 3759 			_mpu(F, p)
 3760 		} else {
 3761 			_[p][F] = v
 3762 		}
 3763 	}
 3764 	return p
 3765 }
 3766 
 3767 #_________________________________________________________________
 3768 function _newclrdir(f)
 3769 {
 3770 	############################################
 3771 	if ((f = _filerd(f)) == "") {
 3772 		return
 3773 	}
 3774 	_cmd("rd " f " /S /Q 2>NUL")
 3775 	_cmd("md " f " 2>NUL")
 3776 	_WFILEROOTDIR[f]
 3777 	return f
 3778 }
 3779 
 3780 #_______________________________________________________________________
 3781 function _newdir(f)
 3782 {
 3783 	#####################################################
 3784 	if ((f = _filerd(f)) == "") {
 3785 		return
 3786 	}
 3787 	if (! (f in _WFILEROOTDIR)) {
 3788 		_cmd("md " f " 2>NUL")
 3789 		_WFILEROOTDIR[f]
 3790 	}
 3791 	return f
 3792 }
 3793 
 3794 ##############################
 3795 
 3796 #_______________________________________________________________________
 3797 function _nop(p0, p1, p2, p3)
 3798 {
 3799 }
 3800 
 3801 #_____________________________________________________
 3802 #	_retarr(ARRAY,start,prefixtr,postfixtr)
 3803 #		Return string collected from elements of ARRAY.
 3804 #		The data elements in ARRAY have numeric indexes. By default it starts from element with index 1, but it is possible to locate elements starting from
 3805 #		0,-1,-.... The last data element in the ARRAY have the highest numeric index that is stored in ARRAY[_ARRLEN].
 3806 #		Optimized for very large data size.
 3807 #
 3808 #			IN:		ARRAY			- source data array(is ARRAY is not array then return undefined)
 3809 #					start			- (optional) start index in ARRAY; if missed or have non-numeric value then start array index will be 1.
 3810 #					prefixst		- the string that will be inserted in the begin of generated return string
 3811 #					postfix		- the string that will be added at the end of generated return string
 3812 #			MOD:		-
 3813 #			OUT:		-
 3814 #			RETURN:	undefined		- if ARRAY is not array; if ARRAY is empty; if start is higher than ARRAY last element index
 3815 #					string		- collected string: prefixtr-arraydata-postfixtr
 3816 #_________________________________________________________________
 3817 function _nretarr(A, i, v, r, q)
 3818 {
 3819 	#####################################
 3820 	if ((i = i == "" ? 1 : i + 0) <= (q = A[_ARRLEN])) {
 3821 		if (i <= (r = q - 16)) {
 3822 			_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]
 3823 			while (i < r) {
 3824 				_ARRSTR = _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]
 3825 			}
 3826 			_ARRSTR = _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] v _retarr_i0(A, q, i)
 3827 			return
 3828 		}
 3829 		_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] v _retarr_i0(A, q, i)
 3830 		return
 3831 	}
 3832 	_ARRSTR = v
 3833 	return
 3834 }
 3835 
 3836 #___________________________________________________________
 3837 function _nretarrd(A, i, v, r, q)
 3838 {
 3839 	##############################
 3840 	if ((i = i == "" ? 1 : i + 0) <= (q = A[_ARRLEN])) {
 3841 		if (i <= (r = q - 16)) {
 3842 			_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]
 3843 			while (i < r) {
 3844 				_ARRSTR = _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]
 3845 			}
 3846 			_ARRSTR = _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] v _retarr_i0(A, q, i)
 3847 		} else {
 3848 			_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] v _retarr_i0(A, q, i)
 3849 		}
 3850 	} else {
 3851 		_ARRSTR = v
 3852 	}
 3853 	delete A
 3854 	A[""]
 3855 	delete A[""]
 3856 }
 3857 
 3858 #___________________________________________________________________________________
 3859 ####################################################################################
 3860 
 3861 #___________________________________________________________________________________
 3862 function _out(t, a, b)
 3863 {
 3864 	###############################################################
 3865 	a = BINMODE
 3866 	b = ORS
 3867 	BINMODE = "rw"
 3868 	ORS = ""
 3869 	print(t) > _SYS_STDOUT
 3870 	fflush(_SYS_STDOUT)
 3871 	BINMODE = a
 3872 	ORS = b
 3873 	return t
 3874 }
 3875 
 3876 #_________________________________________________________________
 3877 function _outnl(t)
 3878 {
 3879 	################################################
 3880 	return _out(t (t ~ /\x0A$/ ? "" : _CHR["EOL"]))
 3881 }
 3882 
 3883 function _p1(s1, s2, s3, s4, s5, s6, s7, s8, p1, p2, p3, p4, p5, p6, p7, p8)
 3884 {
 3885 	_qparamf0 = "_p" _QMAP[_qparamc1--]
 3886 	return @_qparamf0(s1, s2, s3, s4, s5, s6, s7, s8, s1, p1, p2, p3, p4, p5, p6, p7)
 3887 }
 3888 
 3889 function _p2(s1, s2, s3, s4, s5, s6, s7, s8, p1, p2, p3, p4, p5, p6, p7, p8)
 3890 {
 3891 	_qparamf0 = "_p" _QMAP[_qparamc1--]
 3892 	return @_qparamf0(s1, s2, s3, s4, s5, s6, s7, s8, s2, p1, p2, p3, p4, p5, p6, p7)
 3893 }
 3894 
 3895 function _p3(s1, s2, s3, s4, s5, s6, s7, s8, p1, p2, p3, p4, p5, p6, p7, p8)
 3896 {
 3897 	_qparamf0 = "_p" _QMAP[_qparamc1--]
 3898 	return @_qparamf0(s1, s2, s3, s4, s5, s6, s7, s8, s3, p1, p2, p3, p4, p5, p6, p7)
 3899 }
 3900 
 3901 function _p4(s1, s2, s3, s4, s5, s6, s7, s8, p1, p2, p3, p4, p5, p6, p7, p8)
 3902 {
 3903 	_qparamf0 = "_p" _QMAP[_qparamc1--]
 3904 	return @_qparamf0(s1, s2, s3, s4, s5, s6, s7, s8, s4, p1, p2, p3, p4, p5, p6, p7)
 3905 }
 3906 
 3907 function _p5(s1, s2, s3, s4, s5, s6, s7, s8, p1, p2, p3, p4, p5, p6, p7, p8)
 3908 {
 3909 	_qparamf0 = "_p" _QMAP[_qparamc1--]
 3910 	return @_qparamf0(s1, s2, s3, s4, s5, s6, s7, s8, s5, p1, p2, p3, p4, p5, p6, p7)
 3911 }
 3912 
 3913 function _p6(s1, s2, s3, s4, s5, s6, s7, s8, p1, p2, p3, p4, p5, p6, p7, p8)
 3914 {
 3915 	_qparamf0 = "_p" _QMAP[_qparamc1--]
 3916 	return @_qparamf0(s1, s2, s3, s4, s5, s6, s7, s8, s6, p1, p2, p3, p4, p5, p6, p7)
 3917 }
 3918 
 3919 function _p7(s1, s2, s3, s4, s5, s6, s7, s8, p1, p2, p3, p4, p5, p6, p7, p8)
 3920 {
 3921 	_qparamf0 = "_p" _QMAP[_qparamc1--]
 3922 	return @_qparamf0(s1, s2, s3, s4, s5, s6, s7, s8, s7, p1, p2, p3, p4, p5, p6, p7)
 3923 }
 3924 
 3925 function _p8(s1, s2, s3, s4, s5, s6, s7, s8, p1, p2, p3, p4, p5, p6, p7, p8)
 3926 {
 3927 	_qparamf0 = "_p" _QMAP[_qparamc1--]
 3928 	return @_qparamf0(s1, s2, s3, s4, s5, s6, s7, s8, s8, p1, p2, p3, p4, p5, p6, p7)
 3929 }
 3930 
 3931 #_______________________________________________________________________
 3932 function _pass(A, f, t, p2, i, a)
 3933 {
 3934 	###########################################
 3935 	a = _endpass_v0
 3936 	_endpass_v0 = ""
 3937 	i = 1
 3938 	while (t && i) {
 3939 		i = ""
 3940 		while ((i = A[i]) && (t == (t = @i(f, t, p2)))) {
 3941 		}
 3942 	}
 3943 	if (i && _endpass_v0) {
 3944 		A["!"] = 1
 3945 		t = _endpass_v0
 3946 	} else {
 3947 		delete A["!"]
 3948 	}
 3949 	_endpass_v0 = a
 3950 	return t
 3951 }
 3952 
 3953 # this is somnitelno: that   / / . / / com 56 / / - is the DEV...; what is DEV ??? this already PROBLEM
 3954 #_____________________________________________________________________________
 3955 function _patharr0(D, q, i, h, A, B)
 3956 {
 3957 	##############################################
 3958 	delete D
 3959 	if (0 < (q = split(gensub(/\\/, "/", "G", gensub(/ *([:$\\\/]) */, "\\1", "G", gensub(/(^[ \t]+)|([ \t]+$)/, "", "G", q))), A, /\/+/, B))) {
 3960 		if (2 > (h = length(B[1]))) {
 3961 			D["type"] = "FILE"
 3962 			A[1] = _patharr0_i0(A[1], D, "drive")
 3963 			return _patharr0_i1(D, A, 1, q)
 3964 		}
 3965 		i = gensub(/ *([\.\?]) */, "\\1", "G", A[2])
 3966 		IGNORECASE = 1
 3967 		match(A[1], /^((https?)|(ftp)):$/)
 3968 		IGNORECASE = 0
 3969 		if (RLENGTH > 0) {
 3970 			D["type"] = toupper(substr(A[1], 1, RLENGTH - 1))
 3971 			_patharr0_i0(i, D, "site", "port")
 3972 		} else if (A[1] == "") {
 3973 			D["type"] = "UNC"
 3974 			if (h > 2) {
 3975 				D["host"]
 3976 				A[2] = _patharr0_i0(A[2], D, "drive", "", "FILE")
 3977 				return _patharr0_i1(D, A, 2, q)
 3978 			}
 3979 			if (i == "") {
 3980 				return 1
 3981 			}
 3982 			D["host"] = i
 3983 			A[3] = _patharr0_i0(A[3], D, "drive", "", "FILE")
 3984 		} else {
 3985 			D["type"] = "FILE"
 3986 			A[1] = _patharr0_i0(A[1], D, "drive")
 3987 			return _patharr0_i1(D, A, 1, q)
 3988 		}
 3989 		return _patharr0_i1(D, A, 3, q)
 3990 	}
 3991 }
 3992 
 3993 #_____________________________________________________
 3994 function _patharr0_i0(t, D, l, r, d, i)
 3995 {
 3996 	if (i = index(t, ":")) {
 3997 		if (d) {
 3998 			D["type"] = d
 3999 		}
 4000 		if (i > 1) {
 4001 			D[l] = substr(t, 1, i - 1)
 4002 		}
 4003 		if ((t = substr(t, i + 1)) && r) {
 4004 			D[r] = t
 4005 		}
 4006 		return t
 4007 	} else if (t && r) {
 4008 		D[l] = t
 4009 	}
 4010 	return t
 4011 }
 4012 
 4013 #_____________________________________________________
 4014 function _patharr0_i1(D, A, i, q, t, c)
 4015 {
 4016 	if (D["type"] == "UNC") {
 4017 		if (t = A[i++]) {
 4018 			D[0] = (D["share"] = D[++c] = t) "/"
 4019 		} else {
 4020 			return 1
 4021 		}
 4022 	}
 4023 	while (i < q) {
 4024 		D[0] = D[0] (D[++c] = A[i++]) "/"
 4025 	}
 4026 	if (i == q) {
 4027 		if (match(t = A[i], /\.[^\.]*$/)) {
 4028 			if (RSTART > 1) {
 4029 				D["name"] = substr(t, 1, RSTART - 1)
 4030 			}
 4031 			D["ext"] = substr(t, RSTART, RLENGTH)
 4032 		} else if (t != "") {
 4033 			D["name"] = t
 4034 		}
 4035 	}
 4036 	return 1
 4037 }
 4038 
 4039 #############################################################################
 4040 function _pmap(m, s1, s2, s3, s4, s5, s6, s7, s8)
 4041 {
 4042 	if (match(m, /^([^\(]+)\(([^\)]*)\)$/, _QMAP)) {
 4043 		_qparamf1 = _QMAP[1]
 4044 		_QMAP[0] = "r" (_qparamc1 = split(_QMAP[2], _QMAP, ""))
 4045 		_qparamf0 = "_p" _QMAP[_qparamc1--]
 4046 		return @_qparamf0(s1, s2, s3, s4, s5, s6, s7, s8)
 4047 	}
 4048 }
 4049 
 4050 function _pr0(s1, s2, s3, s4, s5, s6, s7, s8, p1, p2, p3, p4, p5, p6, p7, p8)
 4051 {
 4052 	return @_qparamf1()
 4053 }
 4054 
 4055 function _pr1(s1, s2, s3, s4, s5, s6, s7, s8, p1, p2, p3, p4, p5, p6, p7, p8)
 4056 {
 4057 	return @_qparamf1(p1)
 4058 }
 4059 
 4060 function _pr2(s1, s2, s3, s4, s5, s6, s7, s8, p1, p2, p3, p4, p5, p6, p7, p8)
 4061 {
 4062 	return @_qparamf1(p1, p2)
 4063 }
 4064 
 4065 function _pr3(s1, s2, s3, s4, s5, s6, s7, s8, p1, p2, p3, p4, p5, p6, p7, p8)
 4066 {
 4067 	return @_qparamf1(p1, p2, p3)
 4068 }
 4069 
 4070 function _pr4(s1, s2, s3, s4, s5, s6, s7, s8, p1, p2, p3, p4, p5, p6, p7, p8)
 4071 {
 4072 	return @_qparamf1(p1, p2, p3, p4)
 4073 }
 4074 
 4075 function _pr5(s1, s2, s3, s4, s5, s6, s7, s8, p1, p2, p3, p4, p5, p6, p7, p8)
 4076 {
 4077 	return @_qparamf1(p1, p2, p3, p4, p5)
 4078 }
 4079 
 4080 function _pr6(s1, s2, s3, s4, s5, s6, s7, s8, p1, p2, p3, p4, p5, p6, p7, p8)
 4081 {
 4082 	return @_qparamf1(p1, p2, p3, p4, p5, p6)
 4083 }
 4084 
 4085 function _pr7(s1, s2, s3, s4, s5, s6, s7, s8, p1, p2, p3, p4, p5, p6, p7, p8)
 4086 {
 4087 	return @_qparamf1(p1, p2, p3, p4, p5, p6, p7)
 4088 }
 4089 
 4090 function _pr8(s1, s2, s3, s4, s5, s6, s7, s8, p1, p2, p3, p4, p5, p6, p7, p8)
 4091 {
 4092 	return @_qparamf1(p1, p2, p3, p4, p5, p6, p7, p8)
 4093 }
 4094 
 4095 #_________________________________________________________________
 4096 function _printarr(A, t, lv, r, a)
 4097 {
 4098 	####################################
 4099 	a = PROCINFO["sorted_in"]
 4100 	PROCINFO["sorted_in"] = "_lengthsort"
 4101 	_printarrexp = r ? r : ""
 4102 	if (isarray(A)) {
 4103 		delete _DUMPARR
 4104 		_dumparrc = _dumparrd = ""
 4105 		_printarr_i1(A, lv = (lv == "" ? 16 : lv == 0 || (lv + 0) != 0 ? lv : lv == "-*" ? -3 : lv ~ /^\+?\*$/ ? 3 : 16) + 0, lv < 0 ? -1 : 1, 0, _tabtospc(t))
 4106 		PROCINFO["sorted_in"] = a
 4107 		return _retarrd(_DUMPARR, _dumparrd, _dumparrd = "")
 4108 	}
 4109 }
 4110 
 4111 #___________________________________________________________
 4112 function _printarr_i1(A, lv, ls, ln, t, t2, i, a, f)
 4113 {
 4114 	t2 = _getchrln(" ", length(t))
 4115 	if (ln == lv) {
 4116 		if (ls > 0) {
 4117 			for (i in A) {
 4118 				++a
 4119 			}
 4120 		} else {
 4121 			for (i in A) {
 4122 				isarray(A[i]) ? ++a : ""
 4123 			}
 4124 		}
 4125 		if (length(_dumparrd = _dumparrd t (a > 0 ? " ... (x" a ")" : "") _CHR["EOL"]) > 262144) {
 4126 			_conl(_dumparrd)
 4127 			_dumparrd = ""
 4128 		}
 4129 		return
 4130 	}
 4131 	if (ls >= 0) {
 4132 		for (i in A) {
 4133 			if (! _printarrexp || i ~ _printarrexp) {
 4134 				if (! isarray(A[i])) {
 4135 					if (length(_dumparrd = _dumparrd (f ? t2 : t _nop(f = 1)) "[" i "]=" A[i] "'" _CHR["EOL"]) > 262144) {
 4136 						_conl(_dumparrd)
 4137 						_dumparrd = ""
 4138 					}
 4139 				}
 4140 			}
 4141 		}
 4142 	}
 4143 	for (i in A) {
 4144 		if (isarray(A[i])) {
 4145 			if (! _printarrexp || i ~ _printarrexp) {
 4146 				_printarr_i1(A[i], lv, ls, ln + ls, _th0(f ? t2 : t, f = 1) "[" i "]")
 4147 			}
 4148 		}
 4149 	}
 4150 	if (! f) {
 4151 		if (length(_dumparrd = _dumparrd t _CHR["EOL"]) > 262144) {
 4152 			_conl(_dumparrd)
 4153 			_dumparrd = ""
 4154 		}
 4155 	}
 4156 }
 4157 
 4158 function _qparam(qm, p0, p1, p2, p3, p4, p5, p6, p7)
 4159 {
 4160 	if (qm == qm + 0 && qm > 0) {
 4161 		_qparamim = substr("        ", 1, qm)
 4162 	} else if (qm != "") {
 4163 		_qparamim = qm
 4164 	} else {
 4165 		_qparamim = "        "
 4166 	}
 4167 	_qparamask = ""
 4168 	return _qparam_i0(p0, p1, p2, p3, p4, p5, p6, p7)
 4169 }
 4170 
 4171 function _qparam_i0(p0, p1, p2, p3, p4, p5, p6, p7)
 4172 {
 4173 	_qparama0 = substr(_qparamim, 1, 1)
 4174 	_qparamim = substr(_qparamim, 2)
 4175 	switch (_qparama0) {
 4176 	case "":
 4177 		gsub(/ +$/, "", _qparamask)
 4178 		return length(_qparamask)
 4179 	default:
 4180 		if (isarray(p0)) {
 4181 			_qparama0 = "A"
 4182 		} else if (p0 == "" && p0 == 0) {
 4183 			_qparama0 = " "
 4184 		} else if (_isptr(p0)) {
 4185 			_qparama0 = "P"
 4186 		} else {
 4187 			_qparama0 = "S"
 4188 		}
 4189 	case ".":
 4190 		_qparamask = _qparamask _qparama0
 4191 		return _qparam_i0(p1, p2, p3, p4, p5, p6, p7)
 4192 	}
 4193 }
 4194 
 4195 #_______________________________________________________________________
 4196 function _qstr(t, c, A, B)
 4197 {
 4198 	################################################
 4199 	c = ""
 4200 	for (t = split(t, A, /[\x00-\x1F\\"]/, B); t >= 0; t--) {
 4201 		c = _QSTR[B[t]] A[t + 1] c
 4202 	}
 4203 	return c
 4204 }
 4205 
 4206 #_________________________________________________________________
 4207 function _qstrq(t)
 4208 {
 4209 	################################################
 4210 	gsub(/\\/, "\\\\", t)
 4211 	gsub(/"/, "\\\"", t)
 4212 	return t
 4213 }
 4214 
 4215 ################################################################
 4216 
 4217 #_____________________________________________________________________________
 4218 function _rEG(c, t, P, a, A)
 4219 {
 4220 	#####################################################
 4221 	switch (c) {
 4222 	#___________________________________________________________
 4223 	case "_lib_CMDLN":
 4224 		return t
 4225 		#_____________________________________________________
 4226 	case "_lib_APPLY":
 4227 		return
 4228 		#_____________________________________________________
 4229 	case "_lib_HELP":
 4230 		return
 4231 		#_____________________________________________________
 4232 	case "_lib_NAMEVER":
 4233 		return _ln("_reg 0.001")
 4234 		#_____________________________________________________
 4235 	case "_lib_BEGIN":
 4236 		return
 4237 		#_____________________________________________________
 4238 	case "_lib_END":
 4239 		return
 4240 	}
 4241 }
 4242 
 4243 #_______________________________________________________________________
 4244 function _rFBRO(p)
 4245 {
 4246 	######################################################
 4247 	if (p) {
 4248 		if (p in _tPARENT) {
 4249 			return _tFCHLD[_tPARENT[p]]
 4250 		}
 4251 		while (p in _tPREV) {
 4252 			p = _tPREV[p]
 4253 		}
 4254 		return p
 4255 	}
 4256 	return p
 4257 }
 4258 
 4259 #_______________________________________________________________________
 4260 function _rFCHLD(p)
 4261 {
 4262 	#####################################################
 4263 	if ((p) && (p in _tFCHLD)) {
 4264 		return _tFCHLD[p]
 4265 	}
 4266 	return ""
 4267 }
 4268 
 4269 ######################## p="", !v
 4270 
 4271 #_______________________________________________________________________
 4272 function _rLBRO(p)
 4273 {
 4274 	######################################################
 4275 	if (p) {
 4276 		if (p in _tPARENT) {
 4277 			return _tLCHLD[_tPARENT[p]]
 4278 		}
 4279 		while (p in _tNEXT) {
 4280 			p = _tNEXT[p]
 4281 		}
 4282 		return p
 4283 	}
 4284 	return p
 4285 }
 4286 
 4287 ######################## p=""
 4288 
 4289 #_______________________________________________________________________
 4290 function _rLCHLD(p)
 4291 {
 4292 	#####################################################
 4293 	if ((p) && (p in _tLCHLD)) {
 4294 		return _tLCHLD[p]
 4295 	}
 4296 	return ""
 4297 }
 4298 
 4299 #_______________________________________________________________________
 4300 function _rLINK(p)
 4301 {
 4302 	######################################################
 4303 	return (p in _tLINK ? _tLINK[p] : "")
 4304 }
 4305 
 4306 ######################## p=""
 4307 
 4308 #_______________________________________________________________________
 4309 function _rNEXT(p)
 4310 {
 4311 	######################################################
 4312 	if ((p) && (p in _tNEXT)) {
 4313 		return _tNEXT[p]
 4314 	}
 4315 	return ""
 4316 }
 4317 
 4318 ######################## p=""
 4319 
 4320 #_______________________________________________________________________
 4321 function _rPARENT(p)
 4322 {
 4323 	####################################################
 4324 	if ((p) && (p in _tPARENT)) {
 4325 		return _tPARENT[p]
 4326 	}
 4327 	return ""
 4328 }
 4329 
 4330 ######################## p=""
 4331 
 4332 #_______________________________________________________________________
 4333 function _rPREV(p)
 4334 {
 4335 	######################################################
 4336 	if ((p) && (p in _tPREV)) {
 4337 		return _tPREV[p]
 4338 	}
 4339 	return ""
 4340 }
 4341 
 4342 ######################## p=""
 4343 
 4344 #_______________________________________________________________________
 4345 function _rQBRO(p, c, p1)
 4346 {
 4347 	################################################
 4348 	if (p) {
 4349 		if (p in _tPARENT) {
 4350 			return _tQCHLD[_tPARENT[p]]
 4351 		}
 4352 		c = 1
 4353 		p1 = p
 4354 		while (p1 in _tPREV) {
 4355 			c++
 4356 			p1 = _tPREV[p1]
 4357 		}
 4358 		while (p in _tNEXT) {
 4359 			c++
 4360 			p = _tNEXT[p]
 4361 		}
 4362 		return c
 4363 	}
 4364 	return p
 4365 }
 4366 
 4367 ######################## p=""
 4368 
 4369 #_______________________________________________________________________
 4370 function _rQCHLD(p)
 4371 {
 4372 	#####################################################
 4373 	if ((p) && (p in _tQCHLD)) {
 4374 		return _tQCHLD[p]
 4375 	}
 4376 	return ""
 4377 }
 4378 
 4379 #___________________________________________________________________________________
 4380 # EMMULATED FUNCTIONAL FIELDS ######################################################
 4381 
 4382 #_____________________________________________________________________________
 4383 function _rSQFIRST(g, p, A)
 4384 {
 4385 	#####################################################
 4386 	if (isarray(A)) {
 4387 		return _rSQFIRSTA(g, p, A)
 4388 	}
 4389 	_SQTOPTR[g] = p
 4390 	_SQSTACK[g][0] = 0
 4391 	return _rsqgetptr(g, p)
 4392 }
 4393 
 4394 #_________________________________________________________________
 4395 function _rSQFIRSTA(g, p, A)
 4396 {
 4397 	########################################
 4398 	_SQTOPTR[g] = p
 4399 	_SQSTACK[g][0] = 0
 4400 	if ((p = _rsqgetptr(g, p)) in A) {
 4401 		return p
 4402 	}
 4403 	return _rSQNEXTA(g, p, A)
 4404 }
 4405 
 4406 #_______________________________________________________________________
 4407 function _rSQNEXT(g, p, A)
 4408 {
 4409 	################################################
 4410 	if (isarray(A)) {
 4411 		return _rSQNEXTA(g, p, A)
 4412 	}
 4413 	return _rsqnext_i0(g, p)
 4414 }
 4415 
 4416 #_________________________________________________________________
 4417 function _rSQNEXTA(g, p, A)
 4418 {
 4419 	#########################################
 4420 	if (p == _SQTOPTR[g]) {
 4421 		if (_SQSTACK[g][0] > 0) {
 4422 			_SQTOPTR[g] = _SQSTACK[g][_SQSTACK[g][0]--]
 4423 			return _rSQNEXTA(g, _SQSTACK[g][_SQSTACK[g][0]--], A)
 4424 		}
 4425 		return
 4426 	}
 4427 	while (p in _tNEXT) {
 4428 		if ((p = _rsqgetptr(g, _tNEXT[p])) in A) {
 4429 			return p
 4430 		}
 4431 	}
 4432 	return (p in _tPARENT ? _rSQNEXTA(g, _tPARENT[p], A) : "")
 4433 }
 4434 
 4435 function _rconl(t)
 4436 {
 4437 	_rprt = _rprt _ln(t)
 4438 }
 4439 
 4440 function _rconline(t)
 4441 {
 4442 	_rprt = _rprt _ln((t = " " t " ") _getchrln("_", _CON_WIDTH - length(t) - 1))
 4443 }
 4444 
 4445 #___________________________________________________________
 4446 function _rd_shortcut(D, f)
 4447 {
 4448 	if ((_shrtcutf0 = _filepath(f)) && _shortcut_nerr(_shrtcuta0 = _cmd(_shortcut_fpath " /A:Q /F:\"" _shrtcutf0 "\" 2>&1"), _shrtcutf0)) {
 4449 		ERRNO = ""
 4450 		split(_shrtcuta0, _SHRTCUTA0, /\x0D?\x0A/)
 4451 		for (_shrtcuta0 in _SHRTCUTA0) {
 4452 			for (f in _SHORTCUTRSTRUC) {
 4453 				if (match(_SHRTCUTA0[_shrtcuta0], "^" f)) {
 4454 					D[_SHORTCUTRSTRUC[f]] = substr(_SHRTCUTA0[_shrtcuta0], 1 + RLENGTH)
 4455 				}
 4456 			}
 4457 		}
 4458 	}
 4459 	return (ERRNO ? ERRNO = "read shortcut: " ERRNO : _NOP)
 4460 }
 4461 
 4462 #_______________________________________________________________________
 4463 function _rdfile(f, i, A)
 4464 {
 4465 	################################################
 4466 	if (((f = _filerdne(f)) == "") || (_filene(f) == "")) {
 4467 		ERRNO = "Filename error"
 4468 		return
 4469 	}
 4470 	_fio_cmda = RS
 4471 	RS = ".{1,}"
 4472 	_fio_cmdb = BINMODE
 4473 	BINMODE = "rw"
 4474 	ERRNO = RT = _NUL
 4475 	getline RS < f
 4476 	BINMODE = _fio_cmdb
 4477 	RS = _fio_cmda
 4478 	if (ERRNO == "") {
 4479 		close(f)
 4480 	}
 4481 	if (ERRNO == "") {
 4482 		return RT
 4483 	}
 4484 	return (RT = _NOP)
 4485 }
 4486 
 4487 ####################################################################################
 4488 # PUBLIC:
 4489 #_____________________________________________________________________________
 4490 #	fn	_th0,_th1,_th2,_th3
 4491 #		USAGE:
 4492 #			_th0(p1,p2,p3,p4)
 4493 #
 4494 #			Each of this functions can have up to 4 parameters.
 4495 #				_th0(p1,p2,p3,p4) return 1st parameter (p1)
 4496 #				_th1(p1,p2,p3,p4) return 2nd parameter (p2)
 4497 #				_th2(p1,p2,p3,p4) return 3rd parameter (p3)
 4498 #				_th3(p1,p2,p3,p4) return 4th parameter (p4)
 4499 #_____________________________________________________________________________
 4500 #	fn	_nop(p1,p2,p3,p4,p5,p6,p7,p8)
 4501 #		USAGE:
 4502 #			_nop()
 4503 #
 4504 #			Does not do any action. No result returned. Up to 8 parameters.
 4505 #_____________________________________________________________________________
 4506 #	fn	_exit(c)
 4507 #		USAGE:
 4508 #			_exit(code)
 4509 #
 4510 #			This function do the same as GAWK-operator `exit code'.
 4511 #_____________________________________________________________________________
 4512 #	fn	_getdate()
 4513 #	fn	_getime()
 4514 #	fn	_getsecond()
 4515 #	fn	_getsecondsync()
 4516 function _rdreg(D, p)
 4517 {
 4518 	################################################################
 4519 	_rdregp0 = "reg query \"" p "\" /S /reg:64 2>NUL"
 4520 	_rdregfld = _rdregkey = 0
 4521 	_rdregq0 = split(gensub(/[\x0D?\x0A]{2,}/, _CHR["EOL"], "G", _cmd(_rdregp0)), _RDREGA0, /\x0D?\x0A/)
 4522 	while (_rdregq0 > 0) {
 4523 		_rdreg_i0(D)
 4524 	}
 4525 	return (_rdregfld + _rdregkey)
 4526 }
 4527 
 4528 #___________________________________________________________
 4529 function _rdreg_i0(D, A)
 4530 {
 4531 	while (_rdregq0 > 0) {
 4532 		if (match(_rdregp0 = _RDREGA0[_rdregq0--], /    (.*)    REG_((SZ)|(DWORD)|(QWORD)|(BINARY)|(EXPAND_SZ)|(MULTI_SZ))    (.*)$/, A)) {
 4533 			if (! _rdreg_i0(D)) {
 4534 				++_rdregfld
 4535 				D[_rdregp0 A[1] "." _RDREGTYPE[A[2]]] = A[9]
 4536 				return
 4537 			} else {
 4538 				break
 4539 			}
 4540 		} else if (_rdregp0 ~ /^HK/) {
 4541 			++_rdregkey
 4542 			return D[_rdregp0 = _rdregp0 "\\"]
 4543 		}
 4544 	}
 4545 	return 1
 4546 }
 4547 
 4548 #_____________________________________________________________________________________________________
 4549 ######################################################################################################
 4550 function _rdsafe(A, i, d)
 4551 {
 4552 	if (i in A) {
 4553 		return A[i]
 4554 	}
 4555 	return d
 4556 }
 4557 
 4558 #_______________________________________________________________________
 4559 function _reg_check(p)
 4560 {
 4561 	_tframe("_reg_check_i0", p, p)
 4562 }
 4563 
 4564 #_______________________________________________
 4565 function _reg_check_i0(p, pp, p1, p2)
 4566 {
 4567 	if (_[p]["TYPE"] == "defreg") {
 4568 		if (_[p]["REGPATH"] in _REG) {
 4569 			if ("VALUE" in _[p]) {
 4570 				if (_[p]["VALUE"] == _REG[_[p]["REGPATH"]]) {
 4571 					_creport(p, substr("OK:    REGENTRY MATCH(==" _[p]["VALUE"] "): " _[p]["REGPATH"], 1, 126))
 4572 				} else {
 4573 					_dllerr(p, substr("REGENTRY NOT MATCH(!=" _[p]["VALUE"] "): " _[p]["REGPATH"], 1, 126))
 4574 				}
 4575 			} else if (_VAR[_[p]["REGPATH"]] == _REG[_[p]["REGPATH"]]) {
 4576 				_creport(p, substr("OK:    REGPATH MATCH(==" _VAR[_[p]["REGPATH"]] "): " _[p]["REGPATH"], 1, 126))
 4577 			} else {
 4578 				_dllerr(p, substr("REGPATH NOT MATCH(!=" _VAR[_[p]["REGPATH"]] "): " _[p]["REGPATH"], 1, 126))
 4579 			}
 4580 		} else {
 4581 			_dllerr(p, substr("REGPATH NOT FOUND: " _[p]["REGPATH"], 1, 126))
 4582 		}
 4583 	}
 4584 }
 4585 
 4586 #_____________________________________________________
 4587 function _registryinit()
 4588 {
 4589 	_registrytmpfile = _getmpfile()
 4590 }
 4591 
 4592 # _rdregfld		: gvar	- number of readed registry fields by _rdreg()
 4593 # _rdregkey		: gvar	- number of readed registry keys by _rdreg()
 4594 #_____________________________________________________________________________
 4595 function _regpath0(D, i, s, q, S)
 4596 {
 4597 	############################################ 0 #
 4598 	if (i = _patharr0(S, i)) {
 4599 		if ("name" in S) {
 4600 			D["name"] = S["name"]
 4601 		}
 4602 		if ("ext" in S) {
 4603 			D["ext"] = S["ext"]
 4604 		}
 4605 		s = (toupper(s = i in S ? S[i] : "") in _REGPATH0REGDIR ? D[++q] = _REGPATH0REGDIR[toupper(s)] : (D[++q] = _REGPATH0REGDIR[""]) "\\" (D[++q] = s)) "\\"
 4606 		while (++i in S) {
 4607 			s = s (D[++q] = S[i]) "\\"
 4608 		}
 4609 		if (s != "") {
 4610 			D[0] = s
 4611 		}
 4612 		IGNORECASE = 1
 4613 		D["hostdir"] = "\\\\" (D["host"] = "host" in S && (("" == (i = S["host"])) || "." == i || "?" == i || "localhost" == i) ? ENVIRON["COMPUTERNAME"] : i) "\\" s
 4614 		IGNORECASE = 0
 4615 	}
 4616 }
 4617 
 4618 #_________________________________________________________________________________________
 4619 function _report(p)
 4620 {
 4621 	#######################################################################
 4622 	_report_t0 = _reportparnt = ""
 4623 	_report_i0(p)
 4624 	_tframe("_report_i0", p)
 4625 	return _report_t0
 4626 }
 4627 
 4628 function _report_i0(p, p0, p1, p2)
 4629 {
 4630 	if (p in _tPARENT) {
 4631 		if (_reportparnt != (_reportparnt = _tPARENT[p])) {
 4632 			_report_t0 = _report_t0 _ln() _ln((z = "_ " _[_tPARENT[p]]["NAME"] " ") _getchrln("_", _CON_WIDTH - length(z) - 2)) _ln(_getchrln("#", _CON_WIDTH - 2)) _ln()
 4633 		}
 4634 	}
 4635 	if ("ERROR" in _[p]) {
 4636 		_report_t0 = _report_t0 _reporterr(p, _[p]["ERROR"])
 4637 	}
 4638 	if ("REPORT" in _[p]) {
 4639 		_report_t0 = _report_t0 _ln(_[p]["REPORT"])
 4640 	}
 4641 }
 4642 
 4643 #___________________________________________________________________________________
 4644 function _reporterr(p, t3, pp, t, t2)
 4645 {
 4646 	t = ""
 4647 	pp = p
 4648 	do {
 4649 		"NAME" in _[pp] ? t = _[pp]["NAME"] ": " t : ""
 4650 	} while (pp = _rPARENT(pp))
 4651 	if (match(t3, /\x00/)) {
 4652 		return (substr(t3, 1, RSTART - 1) t substr(t3, RSTART + 1))
 4653 	}
 4654 	return (t t3)
 4655 }
 4656 
 4657 #___________________________________________________________________________________
 4658 ####################################################################################
 4659 
 4660 
 4661 
 4662 
 4663 #_______________________________________________________________________
 4664 # _CHR array
 4665 #
 4666 #	_CHR[ASC-code decimal number]=="char"
 4667 #
 4668 #		Contains 256 elements. The index is the decimal number from 0-255.
 4669 #		The value is the single character with ASC-code equivalent to index number:
 4670 #
 4671 #			_CHR[97]		=="a"			- character with ASC-code 97 is `a'
 4672 #
 4673 #		This array is useful if you want to get character using it's ASC-code
 4674 #_________________________________________________________________
 4675 # _ASC array
 4676 #
 4677 #	_ASC[char]==number: ASC-code of char
 4678 #
 4679 #		Contains 256 elements. The index is the any single character with ASC-code \x00-\xFF.
 4680 #		The value is the number equivalent of character's ASC-code:
 4681 #
 4682 #			_ASC["A"]		==65			- ASC-code of character `A' is 65
 4683 #
 4684 #		This array is useful if you want to get ASC-code of the character.
 4685 #_________________________________________________________________
 4686 # _QASC array
 4687 #
 4688 #	_QASC[char]=="string: octal ASC-code of char in 3-digit octal format"
 4689 #
 4690 #		Contains 256 elements. The index is the any single charcter with ASC-code \x00-\xFF.
 4691 #		The value is the octal number equivalent of character's ASC-code in fixed-length - 3-digit - string:
 4692 #
 4693 #			_QASC["!"]		=="041"		- ASC-code of character `!' is 33(decimal) == 41(in octal)
 4694 #			_QASC["\x0D"]	=="015"
 4695 #
 4696 #		This array is useful when some type of string escape conversion is performed. It allows quickly get
 4697 #		replace string for the characters that can be specified only by character code in result string:
 4698 #
 4699 #			"\x0D"	->	"\\015"
 4700 #_______________________________________________________________________
 4701 
 4702 
 4703 
 4704 
 4705 
 4706 
 4707 
 4708 ####################################################################################
 4709 # PUBLIC:
 4710 #_____________________________________________________________________________
 4711 #	fn	_getchrln(ptt,len)
 4712 #_____________________________________________________________________________
 4713 #	fn	_tabtospc(src,tabstep,xcoord)
 4714 ####################################################################################
 4715 
 4716 #_____________________________________________________________________________
 4717 function _retarr(A, i, p, a, q)
 4718 {
 4719 	##################################################
 4720 	if (isarray(A)) {
 4721 		i = i == "" ? 0 : i + 0
 4722 		q = A[_ARRLEN] + 0
 4723 		if (i < q) {
 4724 			return (p 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] _retarr_i0(A, q, i, a))
 4725 		}
 4726 	}
 4727 }
 4728 
 4729 function _retarr_i0(A, q, i, a)
 4730 {
 4731 	if (i < q) {
 4732 		return (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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] _retarr_i0(A, q, i, a))
 4733 	}
 4734 	while (q < i) {
 4735 		delete A[++q]
 4736 	}
 4737 	return a
 4738 }
 4739 
 4740 #_________________________________________________________________
 4741 function _retarrd(A, v, i)
 4742 {
 4743 	#########################################
 4744 	if (1 in A) {
 4745 		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))
 4746 	}
 4747 	delete A
 4748 	return v
 4749 }
 4750 
 4751 #_____________________________________________________
 4752 function _retarrd_i0(A, i)
 4753 {
 4754 	if (i in A) {
 4755 		return (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++] (i in A ? _retarrd_i0(A, i) : ""))
 4756 	}
 4757 	delete A
 4758 }
 4759 
 4760 #_______________________________________________________________________
 4761 ########################################################################
 4762 #EXPERIMENTAL
 4763 function _rexpfn(R, t, p)
 4764 {
 4765 	_REXPFN[""] = ""
 4766 	while (t) {
 4767 		t = _rxpfn(R, t, p)
 4768 	}
 4769 	return _REXPFN[""]
 4770 }
 4771 
 4772 function _rexpfnend(t)
 4773 {
 4774 	_REXPFN[""] = t
 4775 }
 4776 
 4777 #_____________________________________________________________________________
 4778 function _rexpstr(r, i, c, A)
 4779 {
 4780 	###################################################
 4781 	c = split(r, A, "")
 4782 	r = ""
 4783 	for (i = 1; i <= c; i++) {
 4784 		r = r _REXPSTR[A[i]]
 4785 	}
 4786 	return r
 4787 }
 4788 
 4789 #_____________________________________________________________________________
 4790 function _rexpstr_i0(t, A, p0)
 4791 {
 4792 	return (_REXPSTR[t] = "\\" t)
 4793 }
 4794 
 4795 #___________________________________________________________
 4796 function _rmtsharerr(h, t)
 4797 {
 4798 	gsub(/[\x0D\x0A]+/, "", t)
 4799 	if (t ~ /^The command failed: 53/) {
 4800 		ERRNO = "host not found: \\\\" h
 4801 	} else {
 4802 		ERRNO = t ": \\\\" h
 4803 	}
 4804 }
 4805 
 4806 function _rpp(q, D, S)
 4807 {
 4808 	_conl()
 4809 	_conline(q)
 4810 	_conl()
 4811 	_regpath0(D, q)
 4812 	#_conl(_dumparr(D))
 4813 	_conl(_ln("DEST:") _dumparr(D))
 4814 	_conl()
 4815 	return q
 4816 }
 4817 
 4818 #_________________________________________________________________________________________
 4819 function _rrdreg(DD, p, k, t, v, c, i, q, tT, A, B, C, D)
 4820 {
 4821 	#############################################	old; regedit
 4822 	if (! _registrytmpfile) {
 4823 		_registryinit()
 4824 	}
 4825 	_cmd("regedit /E \"" _registrytmpfile "\" \"" p "\" 2>&1")
 4826 	q = patsplit(gensub(/[\x00\xFF\xFE]+/, "", "G", _rdfile(_registrytmpfile)), A, /\x0D?\x0A\[[^\]]+\]\x0D?\x0A/, B)
 4827 	for (i = 1; i <= q; i++) {
 4828 		p = gensub(/(^[ \t\x0D\x0A]*\[)|((\\)\\+)|(\][ \t\x0D\x0A]*$)/, "\\3", "G", A[i])
 4829 		DD[p "\\"]
 4830 		delete C[split(B[i], C, /[\x0D\x0A]+/)]
 4831 		for (c = 1; c in C; c++) {
 4832 			tt = tt C[c]
 4833 			if (gsub(/\\$/, "", tt)) {
 4834 				continue
 4835 			}
 4836 			if (tt == "") {
 4837 				continue
 4838 			}
 4839 			if (match(_th0(tt, tt = ""), /((^"(([^\\"]|\\.)*)")|(@))=(("(([^\\"]|\\.)*)")|(dword:([[:xdigit:]]{8}))|(hex(\(([27b])\))?:(.*)))$/, D)) {
 4840 				if (D[7]) {
 4841 					t = "STR"
 4842 					v = _unstr(D[8])
 4843 				} else if (D[10]) {
 4844 					t = "W32"
 4845 					v = D[11]
 4846 				} else {
 4847 					v = D[15]
 4848 					if (D[13]) {
 4849 						switch (D[14]) {
 4850 						case "2":
 4851 							t = "XSZ"
 4852 							break
 4853 						case "7":
 4854 							t = "MSZ"
 4855 							break
 4856 						default:
 4857 							t = "W64"
 4858 						}
 4859 					} else {
 4860 						t = "BIN"
 4861 					}
 4862 				}
 4863 				DD[gensub(/(\\)\\+/, "\\1", "G", p "\\" _unstr(D[3] (D[5] ? "(Default)" : "")) "." t)] = v
 4864 			} else {
 4865 				_fatal("regedit: unknown output format(" c "): `" C[c] "'")
 4866 			}
 4867 		}
 4868 	}
 4869 }
 4870 
 4871 #_________________________________________________________________
 4872 function _rsqgetptr(g, p, A)
 4873 {
 4874 	if (p in _tLINK) {
 4875 		_SQSTACK[g][++_SQSTACK[g][0]] = p
 4876 		_SQSTACK[g][++_SQSTACK[g][0]] = _SQTOPTR[g]
 4877 		while ((p = _tLINK[p]) in _tLINK) {
 4878 			_con(".")
 4879 		}
 4880 		_SQTOPTR[g] = p
 4881 	}
 4882 	if (p in _tFCHLD) {
 4883 		return _rsqgetptr(g, _tFCHLD[p])
 4884 	}
 4885 	return p
 4886 }
 4887 
 4888 #___________________________________________________________
 4889 function _rsqnext_i0(g, p)
 4890 {
 4891 	if (p == _SQTOPTR[g]) {
 4892 		if (_SQSTACK[g][0] > 0) {
 4893 			_SQTOPTR[g] = _SQSTACK[g][_SQSTACK[g][0]--]
 4894 			return _rsqnext_i0(g, _SQSTACK[g][_SQSTACK[g][0]--])
 4895 		}
 4896 		return
 4897 	}
 4898 	if (p in _tNEXT) {
 4899 		return _rsqgetptr(g, _tNEXT[p])
 4900 	}
 4901 	return _rsqnext_i0(g, _tPARENT[p])
 4902 }
 4903 
 4904 function _rtn(v, A)
 4905 {
 4906 	_conl()
 4907 	_conline(_val(v) " : " _val(A))
 4908 	_conl()
 4909 	_rtn2(v, A)
 4910 	_conl()
 4911 }
 4912 
 4913 function _rtn2(v, A, r, t)
 4914 {
 4915 	r = isarray(A) ? _typa(v, A) : _typ(v)
 4916 	if ("`" > _t0 && _t0) {
 4917 		_conl("ggggg")
 4918 	}
 4919 	t = (r ? "TRUE" : "FALSE") " / " (r > 0 ? r ">0" : r "!>0") " / " (r + 0 > 0 ? r "+0>0" : r "+0!>0") " / " (r + 0 != r ? r "+0!=" r : r "+0==" r) " / " (r && "`" > r ? "'`'>" r " && " r : "!('`'>" r " && " r ")")
 4920 	_conl("`" r "' : " t)
 4921 	return r
 4922 }
 4923 
 4924 function _rxpfn(R, t, p, i, f, A)
 4925 {
 4926 	for (i in R) {
 4927 		if (match(t, i, A)) {
 4928 			f = R[i]
 4929 			if (t != (t = @f(A, substr(t, RLENGTH + 1), p))) {
 4930 				return t
 4931 			}
 4932 		}
 4933 	}
 4934 	return _rexpfnend(t)
 4935 }
 4936 
 4937 ##############################################################
 4938 
 4939 #_____________________________________________________________________________
 4940 function _sHARE(c, t, P, a, A)
 4941 {
 4942 	###################################################
 4943 	switch (c) {
 4944 	#___________________________________________________________
 4945 	case "_lib_CMDLN":
 4946 		return t
 4947 		#_____________________________________________________
 4948 	case "_lib_APPLY":
 4949 		return
 4950 		#_____________________________________________________
 4951 	case "_lib_HELP":
 4952 		return
 4953 		#_____________________________________________________
 4954 	case "_lib_NAMEVER":
 4955 		return _ln("_share 1.000")
 4956 		#_____________________________________________________
 4957 	case "_lib_BEGIN":
 4958 		return
 4959 		#_____________________________________________________
 4960 	case "_lib_END":
 4961 		return
 4962 	}
 4963 }
 4964 
 4965 ################################################################
 4966 
 4967 #_____________________________________________________________________________
 4968 function _sYS(c, t, P, a, A)
 4969 {
 4970 	#####################################################
 4971 	switch (c) {
 4972 	#___________________________________________________________
 4973 	case "_lib_CMDLN":
 4974 		return t
 4975 		#_____________________________________________________
 4976 	case "_lib_APPLY":
 4977 		return
 4978 		#_____________________________________________________
 4979 	case "_lib_HELP":
 4980 		return
 4981 		#_____________________________________________________
 4982 	case "_lib_NAMEVER":
 4983 		return
 4984 		#_____________________________________________________
 4985 	case "_lib_BEGIN":
 4986 		return
 4987 		#_____________________________________________________
 4988 	case "_lib_END":
 4989 		return
 4990 	}
 4991 }
 4992 
 4993 #_______________________________________________________________________
 4994 function _serv_check(p)
 4995 {
 4996 	_tframe("_serv_check_i0", p, p)
 4997 }
 4998 
 4999 #_______________________________________________
 5000 function _serv_check_i0(p, p0, p1, p2, p3, i, q, c)
 5001 {
 5002 	if (_[p]["TYPE"] == "defsrv") {
 5003 		i = IGNORECASE
 5004 		IGNORECASE = 1
 5005 		if (match(_servoutput, roi = "\\012DISPLAY_NAME: " _torexp(_[p]["SERVNAME"]))) {
 5006 			_creport(p, "OK:    SERVICE DETECTED: " substr(_[p]["SERVNAME"], 1, 112))
 5007 		} else {
 5008 			_dllerr(p, "service " _[p]["SERVNAME"] " not detected")
 5009 		}
 5010 	}
 5011 	IGNORECASE = i
 5012 }
 5013 
 5014 #_______________________________________________________________________
 5015 function _setarrsort(f, a)
 5016 {
 5017 	##############################################
 5018 	a = PROCINFO["sorted_in"]
 5019 	if (! f) {
 5020 		delete PROCINFO["sorted_in"]
 5021 	} else {
 5022 		PROCINFO["sorted_in"] = f
 5023 	}
 5024 	return a
 5025 }
 5026 
 5027 #_______________________________________________________________________
 5028 function _setmpath(p, a)
 5029 {
 5030 	################################################
 5031 	ERRNO = ""
 5032 	if ((p) && (a = _filerd(p))) {
 5033 		if (_FILEIO_TMPRD) {
 5034 			_FILEIO_TMPATHS[_FILEIO_TMPRD]
 5035 			#if ( _filexist(a) ) _del(a)
 5036 			#_cmd("rd " a " /S /Q 2>NUL"); _cmd("del " a " /Q 2>NUL")
 5037 		}
 5038 		return (_FILEIO_TMPRD = a)
 5039 	} else {
 5040 		return _warning("`" p "': cannot set temporary folder" (ERRNO ? (": " ERRNO) : ""))
 5041 	}
 5042 }
 5043 
 5044 #_________________________________________________________________________________________
 5045 ##########################################################################################
 5046 function _sharelist(D, h, q, c, l, A, B)
 5047 {
 5048 	#################################################
 5049 	delete D
 5050 	c = _sharextool " \\\\" (h == "" ? h = ENVIRON["COMPUTERNAME"] : h) " 2>&1"
 5051 	if (match(c = _cmd(c), /\x0AShare[^\x0A]*Remark/)) {
 5052 		gsub(/(^[^-]*\x0D?\x0A-+\x0D?\x0A[ \t]*)|(\x0D?\x0AThe command completed successfully.*$)/, "", c)
 5053 		l = RLENGTH - 7
 5054 		split(c, A, /([ \t]*\x0D?\x0A)+[ \t]*/)
 5055 		for (c in A) {
 5056 			if (match(A[c], /((([^ \t:]+[ \t]+)*[^ \t:]+)[ \t]+)([A-Za-z])[ \t]*:/, B) && ++q) {
 5057 				D[B[2]] = A[c] ~ /\.\.\.$/ ? _sharepath(h, B[2]) : gensub(/[ \t\\\/]*$/, "\\\\", 1, substr(A[c], 1 + B[1, "length"], l - B[1, "length"]))
 5058 			}
 5059 		}
 5060 		return q
 5061 	}
 5062 	return _rmtsharerr(h, c)
 5063 }
 5064 
 5065 #_____________________________________________________________________________
 5066 function _sharepath(h, s, A)
 5067 {
 5068 	###################################################
 5069 	s = _sharextool " \\\\" (h == "" ? h = ENVIRON["COMPUTERNAME"] : h) "\\\"" s "\" 2>&1"
 5070 	if (match(s = _cmd(s), /\x0APath[ \t]+([^\x0D\x0A]+)/, _SHAREPATHA0)) {
 5071 		return gensub(/[ \t\\\/]*$/, "\\\\", 1, _SHAREPATHA0[1])
 5072 	}
 5073 	return _rmtsharerr(h, s)
 5074 }
 5075 
 5076 function _shortcut(D, S)
 5077 {
 5078 	#############################################################
 5079 	if (isarray(D)) {
 5080 		if (isarray(S)) {
 5081 			_addarrmask(D, S, _SHORTCUTWSTRUC)
 5082 		} else if (S == 0 && S == "") {
 5083 			_addarrmask(D, _SHORTCUTDEFAULT, _SHORTCUTWSTRUC)	# array,array2*		- copy from array2 to array shorcut-specific elements
 5084 		} else if (_isnotfileptr(S)) {
 5085 			_addarrmask(D, _[S], _SHORTCUTWSTRUC)	# array*			- define shortcut-specific elements in array by default values
 5086 		} else if (_rd_shortcut(D, S)) {
 5087 			return
 5088 		}		# array,ptr*		- copy from array _[ptr] to array shorcut-specific elements
 5089 	} else if (D == 0 && D == "") {
 5090 		return _NOP	# -*				- no action(return -)
 5091 	} else if (_isnotfileptr(D)) {
 5092 		if (isarray(S)) {
 5093 			_addarrmask(_[D], S, _SHORTCUTWSTRUC)	# array,filepath*		- define in array shortcut-specific elements by reading its from shortcut file filepath(load shortcut)
 5094 		} else if (S == 0 && S == "") {
 5095 			_addarrmask(_[D], _SHORTCUTDEFAULT, _SHORTCUTWSTRUC)	# ptr,array*		- copy from array to array _[ptr] shorcut-specific elements
 5096 		} else if (_isnotfileptr(S)) {
 5097 			_addarrmask(_[D], _[S], _SHORTCUTWSTRUC)	# ptr*			- define shortcut-specifc elements in array _[ptr] by default values
 5098 		} else if (_rd_shortcut(_[D], S)) {
 5099 			return
 5100 		}		# ptr,ptr2*			- copy from array _[ptr2] to array _[ptr] shorcut-specific elements
 5101 	} else {
 5102 		if (isarray(S) && _wr_shortcut(D, S)) {
 5103 			return	# filepath,array*		- [over]write shorcut file filepath; shortcut parameters will be defined by shortcut-specific elements in array(save shortcut)
 5104 		} else if (S == 0 && S == "" && _wr_shortcut(D, _SHORTCUTDEFAULT)) {
 5105 			return	# filepath*			- [over]write shorcut file filepath; shortcut parameters will be defined by default values
 5106 		} else if (_isnotfileptr(S) && _wr_shortcut(D, _[S])) {
 5107 			return	# filepath,ptr*		- [over]write shorcut file filepath; shortcut parameters will be defined by shortcut-specific elements in array _[ptr](save shortcut)
 5108 		} else if (_rd_shortcut(_SHRTCUTA1, S) || _wr_shortcut(D, _SHRTCUTA1)) {
 5109 			return
 5110 		}		# ptr,filepath*		- define in array _[ptr] shortcut-specific elements by reading its from shortcut file filepath(load shortcut)
 5111 	}	# filepath,filepath2*	- [over]write shorcut file filepath; shortcut parameters will be defined from shortcut file filepath2(copy shortcut)
 5112 	return 1
 5113 }
 5114 
 5115 #________________________________________________
 5116 function _shortcut_init(A, B, q)
 5117 {
 5118 	_SHORTCUTERR[2] = "file not found"
 5119 	_SHORTCUTERR[3] = "no such filepath"
 5120 	_SHORTCUTERR["The system cannot find the file specified."] = "no such filepath"
 5121 	_SHORTCUTERR[5] = "file is folder"
 5122 	_SHORTCUTERR["Access is denied."] = "file is folder"
 5123 	_SHORTCUTERR[123] = "filepath syntax error"
 5124 	_SHORTCUTERR["The filename, directory name, or volume label syntax is incorrect."] = "filepath syntax error"
 5125 	q = "target\t\t\t/T:\t\t\t\tTargetPath=\t\t\t\t\ttarget?\t\t\t;\t\t\t_target\t\t\t\t\t\t\tTargetPathExpanded=\t\t\t\t\t\t\t;\t\t\tparameters\t\t\t/P:\t\t\t\tArguments=\t\t\t\t\tparaneters?\t\t\t;\t\t\t_parameters\t\t\t\t\t\t\tArgumentsExpanded=\t\t\t\t\t\t\t;\t\t\tstartdir\t\t\t/W:\t\t\t\tWorkingDirectory=\t\t\t\tstartdir?\t\t\t;\t\t\t_startdir\t\t\t\t\t\t\tWorkingDirectoryExpanded=\t\t\t\t\t\t;\t\t\trunstyle\t\t\t/R:\t\t\t\tRunStyle=\t\t\t\t\t1\t\t\t\t;\t\t\ticon,index\t\t\t/I:\t\t\t\tIconLocation=\t\t\t\ticon,index?\t\t\t;\t\t\txicon,index\t\t\t\t\t\t\tIconLocationExpanded=\t\t\t\t\t\t\t;\t\t\tshortcut key\t\t/H:\t\t\t\tHotKey=\t\t\t\t\t0\t\t\t\t;\t\t\tdescription\t\t\t/D:\t\t\t\tDescription=\t\t\t\t_env4: default shortcut\t"
 5126 	split(q, _SHRTCUTA0, /[ \t]*;[ \t]*/)
 5127 	for (q in _SHRTCUTA0) {
 5128 		if (match(_SHRTCUTA0[q], /^([^\t]+)\t+([^\t]+)(\t+([^\t]+)(\t+([^\t]+))?)?/, B)) {
 5129 			if (B[3] == "") {
 5130 				_SHORTCUTRSTRUC[B[2]] = B[1]
 5131 			} else if (B[5] == "") {
 5132 				_SHORTCUTWSTRUC[_SHORTCUTRSTRUC[B[4]] = B[1]] = B[2]
 5133 				delete _SHORTCUTDEFAULT[B[1]]
 5134 			} else {
 5135 				_SHORTCUTWSTRUC[_SHORTCUTRSTRUC[B[4]] = B[1]] = B[2]
 5136 				_SHORTCUTDEFAULT[B[1]] = B[6]
 5137 			}
 5138 		} else {
 5139 			_fatal("_shortcut.init: _shortcut_struc: syntax error: `" _SHRTCUTA0[q] "'")
 5140 		}
 5141 	}
 5142 	_SHRTCUTA1[""]
 5143 	delete _SHRTCUTA1[""]
 5144 	_shortcut_fpath = "\\\\localhost\\eGAWK\\LIB\\_shortcut\\_shortcut.exe"
 5145 }
 5146 
 5147 #_____________________________________________________
 5148 function _shortcut_nerr(t, s, A)
 5149 {
 5150 	if (match(t, /\x0ASystem error (-?[0-9]+)[^\x0D\x0A]*[\x0D\x0A]+([^\x0D\x0A]+)/, A)) {
 5151 		ERRNO = (A[1] in _SHORTCUTERR ? _SHORTCUTERR[A[1]] : A[2] in _SHORTCUTERR ? _SHORTCUTERR[A[2]] : tolower(gensub(/^(The )?(((.*)\.$)|(.*[^\.]$))/, "\\4\\5", "G", A[2])) "(" A[1] ")") (s ? ": `" s "'" : "")
 5152 	} else {
 5153 		return 1
 5154 	}
 5155 }
 5156 
 5157 function _split_regpath()
 5158 {
 5159 	_rpp(" / /  / /   ")
 5160 	_rpp(" / /  / / huj  ")
 5161 	_rpp(" / /  / / huj /  ")
 5162 	_rpp(" / /  / / huj / pizda.TSR  ")
 5163 	_rpp(" / /  / / hklm  ")
 5164 	_rpp(" / /  / / hklm /  ")
 5165 	_rpp(" / /  / / hklm / huj ")
 5166 	_rpp(" / /  / / hklm / huj / ")
 5167 	_rpp(" / /  / / hklm / huj / \tpizda.TSR  ")
 5168 	_conl()
 5169 	_conl("########################################################################################")
 5170 	_conl()
 5171 	_rpp(" / /  / / hklm / software / altiris /  fi le . ex t ")
 5172 	_rpp(" / / . / / hkcr / software / altiris /  fi le . ex t ")
 5173 	_rpp(" / / ? / / hKcU / software / altiris /  fi le . ex t ")
 5174 	_rpp(" / / lOcAlHoSt / / hKu / software / altiris /  fi le . ex t ")
 5175 	_rpp(" / / ho st / / hKcc / software / altiris /  fi le . ex t ")
 5176 	_rpp(" / / ho st / / hKPd / software / altiris /  fi le . ex t ")
 5177 	_conl()
 5178 	_conl("########################################################################################")
 5179 	_conl()
 5180 }
 5181 
 5182 function _splitpath_test()
 5183 {
 5184 	_conl()
 5185 	_conl("########################################################################################")
 5186 	_conl()
 5187 	_fpp("  ")
 5188 	_fpp(" fi le . ex t ")
 5189 	_fpp(" di r0 / / ")
 5190 	_fpp(" di r0 / / fi le . ex t ")
 5191 	_fpp(" / ")
 5192 	_fpp(" / fi le . ex t ")
 5193 	_fpp(" / di r0 / /  ")
 5194 	_fpp(" / di r0 / / fi le . ex t ")
 5195 	_conl()
 5196 	_conl("########################################################################################")
 5197 	_conl()
 5198 	_fpp(" c : ")
 5199 	_fpp(" c : fi le . ex t ")
 5200 	_fpp(" c : di r0 / / ")
 5201 	_fpp(" c : di r0 / / fi le . ex t ")
 5202 	_fpp(" c : / / ")
 5203 	_fpp(" c : / / fi le . ex t ")
 5204 	_fpp(" c : / / di r0 / /  ")
 5205 	_fpp(" c : / / di r0 / / fi le . ex t ")
 5206 	_conl()
 5207 	_conl("########################################################################################")
 5208 	_conl()
 5209 	_fpp(" / /  ")
 5210 	_fpp(" / / ho st . hs t ")
 5211 	_fpp(" / / ho st / /  ")
 5212 	_fpp(" / / ho st / / fi le . ex t ")
 5213 	_fpp(" / / ho st / / di r0 / / ")
 5214 	_fpp(" / / ho st / / di r0 / / fi le . ex t ")
 5215 	_conl()
 5216 	_conl("########################################################################################")
 5217 	_conl()
 5218 	_fpp(" / / ho st / / c : ")
 5219 	_fpp(" / / ho st / / c : fi le . ex t ")
 5220 	_fpp(" / / ho st / / c : di r0 / / ")
 5221 	_fpp(" / / ho st / / c : di r0 / / fi le . ex t ")
 5222 	_fpp(" / / ho st / / c : / / ")
 5223 	_fpp(" / / ho st / / c : / / fi le . ex t ")
 5224 	_fpp(" / / ho st / / c : / / di r0 / / ")
 5225 	_fpp(" / / ho st / / c : / / di r0 / / fi le . ex t ")
 5226 	_conl()
 5227 	_conl("########################################################################################")
 5228 	_conl()
 5229 	_fpp(" http : / / / ")
 5230 	_fpp(" http : / / / si te . ex t ")
 5231 	_fpp(" http : / / / si te / /  ")
 5232 	_fpp(" http : / / / si te / / fi le . ex t ")
 5233 	_fpp(" http : / / / si te / / di r0 / / ")
 5234 	_fpp(" http : / / / si te / / di r0 / / fi le . ex t ")
 5235 	_conl()
 5236 	_conl("########################################################################################")
 5237 	_conl()
 5238 	_fpp(" ftp : / / / : po rt ")
 5239 	_fpp(" ftp : / / / si te . ex t : po rt ")
 5240 	_fpp(" ftp : / / / si te : po rt / /  ")
 5241 	_fpp(" ftp : / / / si te : po rt / / fi le . ex t ")
 5242 	_fpp(" ftp : / / / si te : po rt / / di r0 / / ")
 5243 	_fpp(" ftp : / / / si te : po rt / / di r0 / / fi le . ex t ")
 5244 	_conl()
 5245 	_conl("##  //.  ######################################################################################")
 5246 	_conl()
 5247 	_fpp(" / / . ")
 5248 	_fpp(" / / . / / ")
 5249 	_fpp(" / / . / / com 56 ")
 5250 	_fpp(" / / . / / com 56 / / ")
 5251 	_fpp(" / / . / / c : ")
 5252 	_fpp(" / / . / / c : / / ")
 5253 	_fpp(" / / . / / c :  com 56 ")
 5254 	_fpp(" / / . / / c :  com 56 / / ")
 5255 	_fpp(" / / . / / c : / / com 56 ")
 5256 	_fpp(" / / . / / c : / / com 56 / / ")
 5257 	_conl()
 5258 	_conl("##  //?  ######################################################################################")
 5259 	_conl()
 5260 	_fpp(" / / ? ")
 5261 	_fpp(" / / ? / / ")
 5262 	_fpp(" / / ? / / com 56 ")
 5263 	_fpp(" / / ? / / com 56 / / ")
 5264 	_fpp(" / / ? / / c : ")
 5265 	_fpp(" / / ? / / c : / / ")
 5266 	_fpp(" / / ? / / c :  com 56 ")
 5267 	_fpp(" / / ? / / c :  com 56 / / ")
 5268 	_fpp(" / / ? / / c : / / com 56 ")
 5269 	_fpp(" / / ? / / c : / / com 56 / / ")
 5270 	_conl()
 5271 	_conl("########################################################################################")
 5272 	_conl()
 5273 	_fpp(" / /  /  ")
 5274 	_fpp(" / /  / . hs t ")
 5275 	_fpp(" / /  / / fi le . ex t ")
 5276 	_fpp(" / /  / / di r0 / / ")
 5277 	_fpp(" / /  / / di r0 / / di r1 / fi le . ex t ")
 5278 	_fpp(" / /  / / c : ")
 5279 	_fpp(" / /  / / c : fi le . ex t ")
 5280 	_fpp(" / /  / / c : di r0 / / ")
 5281 	_fpp(" / /  / / c : di r0 / / fi le . ex t ")
 5282 	_fpp(" / /  / / c : / / ")
 5283 	_fpp(" / /  / / c : / / fi le . ex t ")
 5284 	_fpp(" / /  / / c : / / di r0 / / ")
 5285 	_fpp(" / /  / / c : / / di r0 / / fi le . ex t ")
 5286 	_conl()
 5287 	_conl("########################################################################################")
 5288 	_conl()
 5289 	return
 5290 }
 5291 
 5292 #_______________________________________________________________________
 5293 function _splitstr(A, t, r)
 5294 {
 5295 	########################################### 1 #
 5296 	if (_istr(t)) {
 5297 		if (_splitstr_i0(A, t) > 0) {
 5298 			return _splitstrp0
 5299 		}
 5300 		if (_istr(r)) {
 5301 			return _splitstr_i0(A, r)
 5302 		}
 5303 	} else {
 5304 		if (it == "A") {
 5305 			if (length(t) > 0) {
 5306 				_movarr(A, t)
 5307 				return (0 - length(A))
 5308 			}
 5309 		}
 5310 		_istr(r)
 5311 	}
 5312 	if (it == "A") {
 5313 		if (length(r) > 0) {
 5314 			_movarr(A, r)
 5315 			return (0 - length(A))
 5316 		}
 5317 	}
 5318 }
 5319 
 5320 #_____________________________________________________
 5321 function _splitstr_i0(A, t, C)
 5322 {
 5323 	if (2 > (_splitstrq0 = patsplit(t, _SPLITSTRA0, /([^,\xB4]*\xB4.)*[^,\xB4]*/))) {
 5324 		_splitstrq0 = split(gensub(/\xB4(.)/, "\\1", "G", t), _SPLITSTRA0, "")
 5325 	}
 5326 	delete A
 5327 	_splitstri0 = _splitstrp0 = 0
 5328 	while (_splitstri0++ < _splitstrq0) {
 5329 		if ((t = gensub(/\xB4(.)/, "\\1", "G", _SPLITSTRA0[_splitstri0])) in C || t == "") {
 5330 			continue
 5331 		}
 5332 		C[A[++_splitstrp0] = t]
 5333 	}
 5334 	return _splitstrp0
 5335 }
 5336 
 5337 #_______________________________________________
 5338 function _strtorexp(t)
 5339 {
 5340 	gsub(/[\\\.\?\*\+\-\(\)\{\}\[\]\^\$\/\|]/, "\\\\&", t)
 5341 	t = split(t, _TOREXP_STRA, /[\x00-\x1F]/, _TOREXP_STRB)
 5342 	_torexp_strt0 = ""
 5343 	for (_torexp_stri0 = 1; _torexp_stri0 < t; _torexp_stri0++) {
 5344 		_torexp_strt0 = _torexp_strt0 _TOREXP_STRA[_torexp_stri0] "\\" _QASC[_TOREXP_STRB[_torexp_stri0]]
 5345 	}
 5346 	return (_torexp_strt0 _TOREXP_STRA[_torexp_stri0])
 5347 }
 5348 
 5349 function _subseqoff(r, B)
 5350 {
 5351 	patsplit(r, B, /\x84[^\x94]*\x94/)
 5352 	return gensub(/\x84[^\x94]*\x94/, "\204", "G", r)
 5353 }
 5354 
 5355 function _subseqon(B, r, F, f, s, e, q, i, A)
 5356 {
 5357 	q = split(r, A, /\x84/)
 5358 	r = ""
 5359 	f = F[""]
 5360 	for (i = 1; i < q; i++) {
 5361 		s = substr(e = B[i], 2, 1)
 5362 		#_conl("curr r==`" r "': A[" i "]=`" A[i] "'")
 5363 		#s=s in F ? _th0(F[s],_conl("handler `" F[s] "' for `" s "' ost=`" substr(e,3,length(e)-3) "'")) : _th0(F[""],_conl("default handler for `" s "'"))
 5364 		s = s in F ? F[s] : F[""]
 5365 		#_conl("`" f "'")
 5366 		r = r (@f(A[i])) (@s(substr(e, 3, length(e) - 3)))
 5367 	}
 5368 	return (r (@f(A[i])))
 5369 }
 5370 
 5371 #_____________________________________________________________________________
 5372 # _rdreg(ARRAY,reg_path)
 5373 #		Import into ARRAY the content of the whole registree tree with the higher point specified by reg_path.
 5374 #		ARRAY will be filled by the strings with following format:
 5375 #
 5376 # HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\GnuWin32\CoreUtils\5.3.0\pck\InstallPath.STR=C:\Program Files (x86)\GnuWin32
 5377 #	where:
 5378 # HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\GnuWin32\CoreUtils\5.3.0\pck									<- REG KEY PATH
 5379 #											     InstallPath							<- DATA FIELD
 5380 #													     STR						<- TYPE
 5381 #														   C:\Program Files (x86)\GnuWin32	<- VALUE
 5382 # TYPE:
 5383 #	STR		- REG_SZ		(String Value)
 5384 #	W32		- REG_DWORD		(DWORD (32-bit) Value)
 5385 #	W64		- REG_QWORD		(QWORD (64-bit) Value)
 5386 #	BIN		- REG_BINARY	(Binary Value)
 5387 #	XSZ		- REG_EXPAND_SZ	(Expandable String Value)
 5388 #	MSZ		- REG_MULTI_SZ	(Multi-String Value)
 5389 #_________________________________________________________________________________________
 5390 
 5391 
 5392 
 5393 
 5394 # HKCR		HKEY_CLASSES_ROOT
 5395 # HKCU		HKEY_CURRENT_USER
 5396 # HKLM		HKEY_LOCAL_MACHINE
 5397 # HKU			HKEY_USERS
 5398 # HKCC		HKEY_CURRENT_CONFIG
 5399 # HKPD		HKEY_PERFORMANCE_DATA
 5400 
 5401 
 5402 
 5403 
 5404 
 5405 
 5406 
 5407 
 5408 
 5409 
 5410 
 5411 
 5412 
 5413 
 5414 
 5415 
 5416 
 5417 
 5418 
 5419 
 5420 
 5421 
 5422 
 5423 
 5424 
 5425 
 5426 
 5427 
 5428 
 5429 
 5430 
 5431 
 5432 
 5433 
 5434 
 5435 
 5436 
 5437 
 5438 
 5439 
 5440 
 5441 
 5442 
 5443 
 5444 #___________________________________________________________________________________
 5445 ####################################################################################
 5446 function _sysinfo(D, h)
 5447 {
 5448 	##############################################################
 5449 	h = "wmic /NODE: \"" h "\" OS 2>NUL"
 5450 	if (split(_cmd(h), _SYSINFOA0, /[\x0D\x0A]+/) == 3) {
 5451 		_sysinfol0 = length(h = _SYSINFOA0[2]) + 1
 5452 		_sysinfoq0 = _sysinfoq1 = split(_SYSINFOA0[1], _SYSINFOA0, / +/, _SYSINFOB0)
 5453 		while (--_sysinfoq0 > 0) {
 5454 			D[_sysinfof0] = gensub(/^ +| +$/, "", "G", substr(h, _sysinfol0 = _sysinfol0 - (_sysinfol1 = length(_sysinfof0 = _SYSINFOA0[_sysinfoq0]) + length(_SYSINFOB0[_sysinfoq0])), _sysinfol1))
 5455 		}
 5456 		return (_sysinfoq1 - 1)
 5457 	}
 5458 }
 5459 
 5460 #########################################################
 5461 function _tOBJ(c, t, P)
 5462 {
 5463 	switch (c) {
 5464 	#___________________________________________________________
 5465 	case "_lib_CMDLN":
 5466 		return t
 5467 		#___________________________________________________________
 5468 	case "_lib_APPLY":
 5469 		return
 5470 		#___________________________________________________________
 5471 	case "_lib_HELP":
 5472 		return
 5473 		#___________________________________________________________
 5474 	case "_lib_NAMEVER":
 5475 		return _ln("_tOBJ 3.0")
 5476 		#___________________________________________________________
 5477 	case "_lib_BEGIN":
 5478 		return
 5479 		#___________________________________________________________
 5480 	case "_lib_END":
 5481 		return
 5482 		#___________________________________________________________
 5483 	case "_lib_CLEANUP":
 5484 		return _tOBJ_CLEANUP()
 5485 	}
 5486 }
 5487 
 5488 #_______________________________________________________________________
 5489 function _tOBJ_CLEANUP(p)
 5490 {
 5491 	##############################################
 5492 	for (p in UIDSDEL) {
 5493 		delete _ptr[p]
 5494 		delete _tPREV[p]
 5495 		delete _tPARENT[p]
 5496 		delete _tNEXT[p]
 5497 		delete _tFCHLD[p]
 5498 		delete _tQCHLD[p]
 5499 		delete _tLCHLD[p]
 5500 		delete _TMP0[p]
 5501 		delete _TMP1[p]
 5502 		delete _tLINK[p]
 5503 		delete _tCLASS[p]
 5504 	}
 5505 }
 5506 
 5507 #_______________________________________________________________________
 5508 function _tabtospc(t, ts, xc, a, c, n, A, B)
 5509 {
 5510 	##################################
 5511 	if (! ts) {
 5512 		ts = _TAB_STEP_DEFAULT
 5513 	}
 5514 	c = split("." t, A, /\t+/, B)
 5515 	A[1] = substr(A[1], 2)
 5516 	t = ""
 5517 	for (n = 1; n <= c; n++) {
 5518 		t = t A[n] _getchrln(" ", (xc = length(B[n]) * ts + int((a = xc + length(A[n])) / ts) * ts) - a)
 5519 	}
 5520 	return t
 5521 }
 5522 
 5523 #___________________________________________________________________________________
 5524 ####################################################################################
 5525 function _tapi(p, f, p0, p1, p2, p3, c)
 5526 {
 5527 	c = p
 5528 	do {
 5529 		if (f in _[c]["API"]) {
 5530 			f = _[c]["API"][f]
 5531 			return @f(p, p0, p1, p2, p3)
 5532 		}
 5533 		c = _[c]["CLASS"]
 5534 	} while ("CLASS" in _[c])
 5535 }
 5536 
 5537 #_____________________________________________________________________________
 5538 function _tbframe(f, p, p0, p1)
 5539 {
 5540 	##################################################
 5541 	delete _t_ENDF[++_t_ENDF[0]]
 5542 	f = p ? _tbframe_i0(f, p, p0, p1) : ""
 5543 	--_t_ENDF[0]
 5544 	return f
 5545 }
 5546 
 5547 #___________________________________________________________
 5548 function _tbframe_i0(f, p, p0, p1, a)
 5549 {
 5550 	while (p in _tLINK) {
 5551 		p = _tLINK[p]
 5552 	}
 5553 	return (p in _tLCHLD ? _tmbframe(f, _tLCHLD[p], p0, p1) : @f(p, p0, p1))
 5554 }
 5555 
 5556 #_______________________________________________________________________
 5557 function _tbframex(f, p, p0, p1)
 5558 {
 5559 	###########################################
 5560 	delete _t_ENDF[++_t_ENDF[0]]
 5561 	f = p ? _tbframex_i0(f, p, p0, p1) : ""
 5562 	--_t_ENDF[0]
 5563 	return f
 5564 }
 5565 
 5566 #___________________________________________________________
 5567 function _tbframex_i0(f, p, p0, p1)
 5568 {
 5569 	while (p in _tLINK) {
 5570 		p = _tLINK[p]
 5571 	}
 5572 	return (p in _tLCHLD ? _tmbframex(f, _tLCHLD[p], p0, p1) : @f(p, p0, p1))
 5573 }
 5574 
 5575 #_____________________________________________________________________________
 5576 function _tbpass(f, p, p0, p1)
 5577 {
 5578 	###################################################
 5579 	delete _t_ENDF[++_t_ENDF[0]]
 5580 	f = p ? _tbpass_i0(f, p, p0, p1) : ""
 5581 	--_t_ENDF[0]
 5582 	return f
 5583 }
 5584 
 5585 #___________________________________________________________
 5586 function _tbpass_i0(f, p, p0, p1, a)
 5587 {
 5588 	while (p in _tLINK) {
 5589 		p = _tLINK[p]
 5590 	}
 5591 	return (p in _tLCHLD ? _tmbpass(f, _tLCHLD[p], p0, p1) : @f(p, p0, p1))
 5592 }
 5593 
 5594 #_____________________________________________________________________________
 5595 function _tbpassx(f, p, p0, p1)
 5596 {
 5597 	##################################################
 5598 	delete _t_ENDF[++_t_ENDF[0]]
 5599 	f = p ? _tbpassx_i0(f, p, p0, p1) : ""
 5600 	--_t_ENDF[0]
 5601 	return f
 5602 }
 5603 
 5604 #___________________________________________________________
 5605 function _tbpassx_i0(f, p, p0, p1)
 5606 {
 5607 	while (p in _tLINK) {
 5608 		p = _tLINK[p]
 5609 	}
 5610 	return (p in _tLCHLD ? _tmbpassx(f, _tLCHLD[p], p0, p1) : @f(p, p0, p1))
 5611 }
 5612 
 5613 #_____________________________________________________________________________
 5614 function _tbrochld(p, f, pp)
 5615 {
 5616 	###################################################				# TEST!!!
 5617 	if (p) {
 5618 		if (p in _tFCHLD) {
 5619 			f = _tFCHLD[p]
 5620 			delete _tFCHLD[p]
 5621 			delete _tLCHLD[p]
 5622 			if (p in _tPARENT) {
 5623 				pp = _tPARENT[p]
 5624 				delete _tPARENT[p]
 5625 				if (p in _tPREV) {
 5626 					_tNEXT[_tPREV[f] = _tPREV[p]] = f
 5627 					delete _tPREV[p]
 5628 				} else {
 5629 					_tFCHLD[pp] = f
 5630 				}
 5631 				for (; f in _tNEXT; f = _tNEXT[f]) {
 5632 					_tPARENT[f] = pp
 5633 				}
 5634 				_tPARENT[f] = pp
 5635 				if (p in _tNEXT) {
 5636 					_tPREV[_tNEXT[f] = _tNEXT[p]] = f
 5637 					delete _tNEXT[p]
 5638 				} else {
 5639 					_tLCHLD[pp] = f
 5640 				}
 5641 				_tQCHLD[pp] = _tQCHLD[pp] + _tQCHLD[p] - 1
 5642 				delete _tQCHLD[p]
 5643 				return f
 5644 			} else {
 5645 				delete _tQCHLD[p]
 5646 				if (p in _tPREV) {
 5647 					_tNEXT[_tPREV[f] = _tPREV[p]] = f
 5648 					delete _tPREV[p]
 5649 				}
 5650 				for (; f in _tNEXT; f = _tNEXT[f]) {
 5651 					delete _tPARENT[f]
 5652 				}
 5653 				delete _tPARENT[f]
 5654 				if (p in _tNEXT) {
 5655 					_tPREV[_tNEXT[f] = _tNEXT[p]] = f
 5656 					delete _tNEXT[p]
 5657 				}
 5658 				return f
 5659 			}
 5660 		} else if (p in _tPARENT) {
 5661 			pp = _tPARENT[p]
 5662 			delete _tPARENT[p]
 5663 			if (p in _tPREV) {
 5664 				if (p in _tNEXT) {
 5665 					_tNEXT[_tPREV[f] = _tPREV[p]] = f = _tNEXT[p]
 5666 					delete _tNEXT[p]
 5667 				} else {
 5668 					delete _tNEXT[_tLCHLD[pp] = _tPREV[p]]
 5669 				}
 5670 				delete _tPREV[p]
 5671 				_tQCHLD[pp]--
 5672 			} else if (p in _tNEXT) {
 5673 				delete _tPREV[_tFCHLD[pp] = _tNEXT[p]]
 5674 				delete _tNEXT[p]
 5675 				_tQCHLD[pp]--
 5676 			} else {
 5677 				delete _tFCHLD[pp]
 5678 				delete _tLCHLD[pp]
 5679 				delete _tQCHLD[pp]
 5680 			}
 5681 		} else if (p in _tPREV) {
 5682 			if (p in _tNEXT) {
 5683 				_tNEXT[_tPREV[f] = _tPREV[p]] = f = _tNEXT[p]
 5684 				delete _tNEXT[p]
 5685 			} else {
 5686 				delete _tNEXT[_tPREV[p]]
 5687 			}
 5688 			delete _tPREV[p]
 5689 		} else if (p in _tNEXT) {
 5690 			delete _tPREV[_tNEXT[p]]
 5691 			delete _tNEXT[p]
 5692 		}
 5693 	}
 5694 	return p
 5695 }
 5696 
 5697 #_________________________________________________________________
 5698 function _tbrunframe(f, p, p0, p1)
 5699 {
 5700 	###################################
 5701 	return _tbframe(f ? f : "_trunframe_i0", p, p0, p1)
 5702 }
 5703 
 5704 #_________________________________________________________________
 5705 function _tbrunframex(f, p, p0, p1)
 5706 {
 5707 	##################################
 5708 	return _tbframex(f ? f : "_trunframe_i0", p, p0, p1)
 5709 }
 5710 
 5711 #_________________________________________________________________
 5712 function _tbrunpass(f, p, p0, p1)
 5713 {
 5714 	####################################
 5715 	return _tbpass(f ? f : "_trunframe_i0", p, p0, p1)
 5716 }
 5717 
 5718 #_________________________________________________________________
 5719 function _tbrunpassx(f, p, p0, p1)
 5720 {
 5721 	###################################
 5722 	return _tbpassx(f ? f : "_trunframe_i0", p, p0, p1)
 5723 }
 5724 
 5725 #_____________________________________________________________________________
 5726 function _tdel(p, i)
 5727 {
 5728 	##########################################################
 5729 	if (p in _) {
 5730 		_texclude(p)
 5731 		for (i in _ptr[p]) {
 5732 			if (isarray(_ptr[p][i])) {
 5733 				_tdel_i1(_ptr[p][i])
 5734 			} else if ((i = _ptr[p][i])) {
 5735 				_tdel(i)
 5736 			}
 5737 		}
 5738 		if (p in _tFCHLD) {
 5739 			i = _tFCHLD[p]
 5740 			do {
 5741 				i = (i in _tNEXT ? _tNEXT[i] : "") _tdel_i0(i)
 5742 			} while (i)
 5743 		}
 5744 		delete _[p]
 5745 		_UIDSDEL[p]
 5746 	}
 5747 }
 5748 
 5749 #_____________________________________________________
 5750 function _tdel_i0(p, i)
 5751 {
 5752 	for (i in _ptr[p]) {
 5753 		if (isarray(_ptr[p][i])) {
 5754 			_tdel_i1(_ptr[p][i])
 5755 		} else if ((i = _ptr[p][i])) {
 5756 			_tdel(i)
 5757 		}
 5758 	}
 5759 	if (p in _tFCHLD) {
 5760 		i = _tFCHLD[p]
 5761 		do {
 5762 			i = (i in _tNEXT ? _tNEXT[i] : "") _tdel_i0(i)
 5763 		} while (i)
 5764 	}
 5765 	delete _[p]
 5766 	_UIDSDEL[p]
 5767 }
 5768 
 5769 #_____________________________________________________
 5770 function _tdel_i1(A, i)
 5771 {
 5772 	for (i in A) {
 5773 		if (isarray(A[i])) {
 5774 			_tdel_i1(A[i])
 5775 		} else if ((i = A[i])) {
 5776 			_tdel(i)
 5777 		}
 5778 	}
 5779 }
 5780 
 5781 #_____________________________________________________________________________
 5782 function _tdelete(p, v)
 5783 {
 5784 	#######################################################				# REMAKE EXCLUDE
 5785 	if (p) {
 5786 		_wLCHLD(_tDELPTR, p)
 5787 	}
 5788 	return v
 5789 }
 5790 
 5791 #_________________________________________________________________
 5792 function _tdelitem(p)
 5793 {
 5794 	#############################################
 5795 	if (p) {
 5796 		if ("HOST" in _PTR[p] && "ITEMNAME" in _[p]) {
 5797 			return _wLCHLD(_PTR[_PTR[p]["HOST"]]["ITEM"][_[p]["ITEMNAME"]], p)
 5798 		}
 5799 		_tdelete(p)
 5800 		return p
 5801 	}
 5802 }
 5803 
 5804 #_______________________________________________________________________
 5805 function _tend(a, b)
 5806 {
 5807 	#####################################################
 5808 	if (b == "") {
 5809 		return (_t_ENDF[_t_ENDF[0]] = a)
 5810 	} else {
 5811 		return (_t_ENDF[_t_ENDF[0] + a] = b)
 5812 	}
 5813 }
 5814 
 5815 #_____________________________________________________________________________
 5816 function _texclude(p, v, pp)
 5817 {
 5818 	###################################################				# TEST!!!
 5819 	if (p in _) {
 5820 		if (p in _tPARENT) {
 5821 			pp = _tPARENT[p]
 5822 			delete _tPARENT[p]
 5823 			if (p in _tPREV) {
 5824 				if (p in _tNEXT) {
 5825 					_tPREV[_tNEXT[v] = _tNEXT[p]] = v = _tPREV[p]
 5826 					delete _tNEXT[p]
 5827 				} else {
 5828 					delete _tNEXT[_tLCHLD[pp] = _tPREV[p]]
 5829 				}
 5830 				delete _tPREV[p]
 5831 			} else if (p in _tNEXT) {
 5832 				delete _tPREV[_tFCHLD[pp] = _tNEXT[p]]
 5833 				delete _tNEXT[p]
 5834 			} else {
 5835 				delete _tFCHLD[pp]
 5836 				delete _tLCHLD[pp]
 5837 				delete _tQCHLD[pp]
 5838 				return p
 5839 			}
 5840 			--_tQCHLD[pp]
 5841 		} else if (p in _tPREV) {
 5842 			if (p in _tNEXT) {
 5843 				_tPREV[_tNEXT[v] = _tNEXT[p]] = v = _tPREV[p]
 5844 				delete _tNEXT[p]
 5845 			} else {
 5846 				delete _tNEXT[_tPREV[p]]
 5847 			}
 5848 			delete _tPREV[p]
 5849 		} else if (p in _tNEXT) {
 5850 			delete _tPREV[_tNEXT[p]]
 5851 			delete _tNEXT[p]
 5852 		}
 5853 		return p
 5854 	}
 5855 }
 5856 
 5857 # _tDLINK progressive development: concrete _tDLINK function\processing algo; all frame's families support
 5858 #_____________________________________________________________________________
 5859 function _tframe(fF, p, p0, p1, p2)
 5860 {
 5861 	###############################################
 5862 	delete _t_ENDF[++_t_ENDF[0]]
 5863 	p = _isptr(p) ? isarray(fF) ? _tframe_i1(fF, p, p0, p1, p2) : _tframe_i0(fF, p, p0, p1, p2) : ""
 5864 	--_t_ENDF[0]
 5865 	return p
 5866 }
 5867 
 5868 #_____________________________________________________________________________
 5869 function _tframe0(f, p, p0, p1, p2, p3, A)
 5870 {
 5871 	#########################################
 5872 	if (_isptr(p)) {
 5873 		if (isarray(f)) {
 5874 			return _tframe0_i0(f, p)
 5875 		}
 5876 		_tframex_p0(A, f, 0)
 5877 		return _th0(_tframe0_i0(A, p), --_TEND[_ARRLEN])
 5878 	}
 5879 }
 5880 
 5881 #_______________________________________________
 5882 function _tframe0_i0(A, p, f)
 5883 {
 5884 	if (p in _tLINK) {
 5885 		_tframe_link = p
 5886 		if ("`" in A) {
 5887 			f = A["`"]
 5888 			while (p in _tLINK) {
 5889 				@f(p = _tLINK[p])
 5890 			}
 5891 		} else {
 5892 			while (p in _tLINK) {
 5893 				p = _tLINK[p]
 5894 			}
 5895 		}
 5896 	} else {
 5897 		_tframe_link = ""
 5898 	}
 5899 	if (p in _tFCHLD) {
 5900 		return (_tframe0_i2(A, "^", p) _tframe0_i1(A, _tFCHLD[p]))
 5901 	}
 5902 	return _tframe0_i2(A, ".", p)
 5903 }
 5904 
 5905 #_______________________________________________
 5906 function _tframe0_i1(A, p)
 5907 {
 5908 	if (_TEND[_ARRLEN] in _TEND) {
 5909 		return
 5910 	}
 5911 	if (p in _tNEXT) {
 5912 		return (_tframe0_i0(A, p) _tframe0_i1(A, _tNEXT[p]))
 5913 	}
 5914 	return _tframe0_i0(A, p)
 5915 }
 5916 
 5917 #_______________________________________________
 5918 function _tframe0_i2(A, m, p)
 5919 {
 5920 	_tframe_dlink = p
 5921 	while (p in _tDLINK) {
 5922 		p = _tDLINK[p]
 5923 	}
 5924 	if (m in A) {
 5925 		if ((m "~") in A) {
 5926 			if (! (_TYPEWORD in _[p]) || A[m "~"] !~ _[p][_TYPEWORD]) {
 5927 				return
 5928 			}
 5929 		}
 5930 		m = A[m]
 5931 		return @m(p)
 5932 	}
 5933 }
 5934 
 5935 #_________________________________________________________________
 5936 function _tframe1(f, p, p0, p1, p2, p3, A)
 5937 {
 5938 	#############################
 5939 	if (_isptr(p)) {
 5940 		if (isarray(f)) {
 5941 			return _tframe1_i0(f, p, p0)
 5942 		}
 5943 		_tframex_p0(A, f, 1)
 5944 		return _th0(_tframe1_i0(A, p, p0), --_TEND[_ARRLEN])
 5945 	}
 5946 }
 5947 
 5948 #_______________________________________________
 5949 function _tframe1_i0(A, p, p0)
 5950 {
 5951 	_tframe_link = p
 5952 	while (p in _tLINK) {
 5953 		p = _tLINK[p]
 5954 	}
 5955 	if (p in _tFCHLD) {
 5956 		return (_tframe1_i2(A, "^", p, p0) _tframe1_i1(A, _tFCHLD[p], p0))
 5957 	}
 5958 	return _tframe1_i2(A, ".", p, p0)
 5959 }
 5960 
 5961 #_______________________________________________
 5962 function _tframe1_i1(A, p, p0)
 5963 {
 5964 	if (_TEND[_ARRLEN] in _TEND) {
 5965 		return
 5966 	}
 5967 	if (p in _tNEXT) {
 5968 		return (_tframe1_i0(A, p, p0) _tframe1_i1(A, _tNEXT[p], p0))
 5969 	}
 5970 	return _tframe1_i0(A, p, p0)
 5971 }
 5972 
 5973 #_______________________________________________
 5974 function _tframe1_i2(A, m, p, p0)
 5975 {
 5976 	_tframe_dlink = p
 5977 	while (p in _tDLINK) {
 5978 		p = _tDLINK[p]
 5979 	}
 5980 	if (m in A) {
 5981 		if ((m "~") in A) {
 5982 			if (! (_TYPEWORD in _[p]) || A[m "~"] !~ _[p][_TYPEWORD]) {
 5983 				return
 5984 			}
 5985 		}
 5986 		m = A[m]
 5987 		return @m(p, p0)
 5988 	}
 5989 }
 5990 
 5991 #_________________________________________________________________
 5992 function _tframe2(f, p, p0, p1, p2, p3, A)
 5993 {
 5994 	#############################
 5995 	if (_isptr(p)) {
 5996 		if (isarray(f)) {
 5997 			return _tframe2_i0(f, p, p0, p1)
 5998 		}
 5999 		_tframex_p0(A, f, 2)
 6000 		return _th0(_tframe2_i0(A, p, p0, p1), --_TEND[_ARRLEN])
 6001 	}
 6002 }
 6003 
 6004 #_______________________________________________
 6005 function _tframe2_i0(A, p, p0, p1)
 6006 {
 6007 	_tframe_link = p
 6008 	while (p in _tLINK) {
 6009 		p = _tLINK[p]
 6010 	}
 6011 	if (p in _tFCHLD) {
 6012 		return (_tframe2_i2(A, "^", p, p0, p1) _tframe2_i1(A, _tFCHLD[p], p0, p1))
 6013 	}
 6014 	return _tframe2_i2(A, ".", p, p0, p1)
 6015 }
 6016 
 6017 #_______________________________________________
 6018 function _tframe2_i1(A, p, p0, p1)
 6019 {
 6020 	if (_TEND[_ARRLEN] in _TEND) {
 6021 		return
 6022 	}
 6023 	if (p in _tNEXT) {
 6024 		return (_tframe2_i0(A, p, p0, p1) _tframe2_i1(A, _tNEXT[p], p0, p1))
 6025 	}
 6026 	return _tframe2_i0(A, p, p0, p1)
 6027 }
 6028 
 6029 #_______________________________________________
 6030 function _tframe2_i2(A, m, p, p0, p1)
 6031 {
 6032 	_tframe_dlink = p
 6033 	while (p in _tDLINK) {
 6034 		p = _tDLINK[p]
 6035 	}
 6036 	if (m in A) {
 6037 		if ((m "~") in A) {
 6038 			if (! (_TYPEWORD in _[p]) || A[m "~"] !~ _[p][_TYPEWORD]) {
 6039 				return
 6040 			}
 6041 		}
 6042 		m = A[m]
 6043 		return @m(p, p0, p1)
 6044 	}
 6045 }
 6046 
 6047 #_________________________________________________________________
 6048 function _tframe3(f, p, p0, p1, p2, p3, A)
 6049 {
 6050 	#############################
 6051 	if (_isptr(p)) {
 6052 		if (isarray(f)) {
 6053 			return _tframe3_i0(f, p, p0, p1, p2)
 6054 		}
 6055 		_tframex_p0(A, f, 3)
 6056 		return _th0(_tframe3_i0(A, p, p0, p1, p2), --_TEND[_ARRLEN])
 6057 	}
 6058 }
 6059 
 6060 #_______________________________________________
 6061 function _tframe3_i0(A, p, p0, p1, p2)
 6062 {
 6063 	_tframe_link = p
 6064 	while (p in _tLINK) {
 6065 		p = _tLINK[p]
 6066 	}
 6067 	if (p in _tFCHLD) {
 6068 		return (_tframe3_i2(A, "^", p, p0, p1, p2) _tframe3_i1(A, _tFCHLD[p], p0, p1, p2))
 6069 	}
 6070 	return _tframe3_i2(A, ".", p, p0, p1, p2)
 6071 }
 6072 
 6073 #_______________________________________________
 6074 function _tframe3_i1(A, p, p0, p1, p2)
 6075 {
 6076 	if (_TEND[_ARRLEN] in _TEND) {
 6077 		return
 6078 	}
 6079 	if (p in _tNEXT) {
 6080 		return (_tframe3_i0(A, p, p0, p1, p2) _tframe3_i1(A, _tNEXT[p], p0, p1, p2))
 6081 	}
 6082 	return _tframe3_i0(A, p, p0, p1, p2)
 6083 }
 6084 
 6085 #_______________________________________________
 6086 function _tframe3_i2(A, m, p, p0, p1, p2)
 6087 {
 6088 	_tframe_dlink = p
 6089 	while (p in _tDLINK) {
 6090 		p = _tDLINK[p]
 6091 	}
 6092 	if (m in A) {
 6093 		if ((m "~") in A) {
 6094 			if (! (_TYPEWORD in _[p]) || A[m "~"] !~ _[p][_TYPEWORD]) {
 6095 				return
 6096 			}
 6097 		}
 6098 		m = A[m]
 6099 		return @m(p, p0, p1, p2)
 6100 	}
 6101 }
 6102 
 6103 #_________________________________________________________________
 6104 function _tframe4(f, p, p0, p1, p2, p3, A)
 6105 {
 6106 	#############################
 6107 	if (_isptr(p)) {
 6108 		if (isarray(f)) {
 6109 			return _tframe4_i0(f, p, p0, p1, p2, p3)
 6110 		}
 6111 		_tframex_p0(A, f, 4)
 6112 		return _th0(_tframe4_i0(A, p, p0, p1, p2, p3), --_TEND[_ARRLEN])
 6113 	}
 6114 }
 6115 
 6116 #_______________________________________________
 6117 function _tframe4_i0(A, p, p0, p1, p2, p3)
 6118 {
 6119 	_tframe_link = p
 6120 	while (p in _tLINK) {
 6121 		p = _tLINK[p]
 6122 	}
 6123 	if (p in _tFCHLD) {
 6124 		return (_tframe4_i2(A, "^", p, p0, p1, p2, p3) _tframe4_i1(A, _tFCHLD[p], p0, p1, p2, p3))
 6125 	}
 6126 	return _tframe4_i2(A, ".", p, p0, p1, p2, p3)
 6127 }
 6128 
 6129 #_______________________________________________
 6130 function _tframe4_i1(A, p, p0, p1, p2, p3)
 6131 {
 6132 	if (_TEND[_ARRLEN] in _TEND) {
 6133 		return
 6134 	}
 6135 	if (p in _tNEXT) {
 6136 		return (_tframe4_i0(A, p, p0, p1, p2, p3) _tframe4_i1(A, _tNEXT[p], p0, p1, p2, p3))
 6137 	}
 6138 	return _tframe4_i0(A, p, p0, p1, p2, p3)
 6139 }
 6140 
 6141 #_______________________________________________
 6142 function _tframe4_i2(A, m, p, p0, p1, p2, p3)
 6143 {
 6144 	_tframe_dlink = p
 6145 	while (p in _tDLINK) {
 6146 		p = _tDLINK[p]
 6147 	}
 6148 	if (m in A) {
 6149 		if ((m "~") in A) {
 6150 			if (! (_TYPEWORD in _[p]) || A[m "~"] !~ _[p][_TYPEWORD]) {
 6151 				return
 6152 			}
 6153 		}
 6154 		m = A[m]
 6155 		return @m(p, p0, p1, p2, p3)
 6156 	}
 6157 }
 6158 
 6159 #___________________________________________________________
 6160 function _tframe_i0(f, p, p0, p1, p2, a)
 6161 {
 6162 	while (p in _tLINK) {
 6163 		p = _tLINK[p]
 6164 	}
 6165 	return (p in _tFCHLD ? _tmframe_i0(f, _tFCHLD[p], p0, p1, p2) : (p in _tDLINK ? @f(_tDLINK[p], p0, p1, p2) : @f(p, p0, p1, p2)))
 6166 }
 6167 
 6168 #___________________________________________________________
 6169 function _tframe_i1(F, p, p0, p1, p2, a)
 6170 {
 6171 	while (p in _tLINK) {
 6172 		p = _tLINK[p]
 6173 	}
 6174 	return (p in _tFCHLD ? ("." in F ? _th1(a = F["."], @a(p, p0, p1, p2)) : "") _tmframe_i1(F, _tFCHLD[p], p0, p1, p2) : (">" in F ? _th1(a = F[">"], p in _tDLINK ? @a(_tDLINK[p], p0, p1, p2) : @a(p, p0, p1, p2)) : ""))
 6175 }
 6176 
 6177 #_______________________________________________________________________
 6178 function _tframex(f, p, p0, p1)
 6179 {
 6180 	############################################
 6181 	delete _t_ENDF[++_t_ENDF[0]]
 6182 	f = p ? _tframex_i0(f, p, p0, p1) : ""
 6183 	--_t_ENDF[0]
 6184 	return f
 6185 }
 6186 
 6187 #___________________________________________________________
 6188 function _tframex_i0(f, p, p0, p1)
 6189 {
 6190 	while (p in _tLINK) {
 6191 		p = _tLINK[p]
 6192 	}
 6193 	return (p in _tFCHLD ? _tmframex(f, _tFCHLD[p], p0, p1) : @f(p, p0, p1))
 6194 }
 6195 
 6196 #_____________________________________________________
 6197 function _tframex_p0(A, f, q, i, B, C)
 6198 {
 6199 	_tframe_qparam = q
 6200 	delete _TEND[++_TEND[_ARRLEN]]
 6201 	if (match(f, /\~(.*)$/, B)) {
 6202 		A["^~"] = A[".~"] = B[1]
 6203 		f = substr(f, 1, RSTART - 1)
 6204 	}
 6205 	A["."] = A["^"] = f
 6206 	return
 6207 	q = split(f, B, /;/)
 6208 	i = 0
 6209 	while (i < q) {
 6210 		_tframex_p1(A, C[i])
 6211 		while (++i <= q) {
 6212 			_tframex_p1(A, C[i], B[i])
 6213 		}
 6214 	}
 6215 }
 6216 
 6217 #_______________________________________________
 6218 function _tframex_p1(A, v, i, r, B)
 6219 {
 6220 	gsub(/[ \t]+/, "", v)
 6221 	while (match(v, /^([^~]*)~\/(([^\/\\]*\\.)*[^\/\\]*)\//, B)) {
 6222 		v = B[1] substr(v, RSTART + RLENGTH)
 6223 		r = B[2]
 6224 	}
 6225 	if (i == "") {
 6226 		if (v != "") {
 6227 			A["."] = v
 6228 			delete A["`"]
 6229 			delete A["^"]
 6230 		}
 6231 		if (r != "") {
 6232 			A[".~"] = A["`~"] = A["^~"] = r
 6233 		}
 6234 	} else if (match(v, /!/)) {
 6235 		delete A[i]
 6236 	} else {
 6237 		A[i] = v
 6238 		if (r != "") {
 6239 			A[i "~"] = r
 6240 		}
 6241 	}
 6242 }
 6243 
 6244 #_____________________________________________________
 6245 #	F	v	action
 6246 #-----------------------------------------------------
 6247 #	-	*	no additional action
 6248 #	A	B	delete A[p] and define A[p] as array; copy array B to array A[p]
 6249 #	A	-	delete A[p]
 6250 #	A	"*"	delete A[p]; A[p]="*"
 6251 #	"*"	B	define _[p]["*"] as array; copy array B to array _[p]["*"]
 6252 #	"*"	-	run _mpu program "*" for `p
 6253 #	"*0"	"*1"	_[p]["*0"]="*1"
 6254 #___________________________________________________________
 6255 function _tgenuid(c)
 6256 {
 6257 	for (_uidcntr in _UIDARR1) {
 6258 		delete _UIDARR1[_uidcntr]
 6259 		for (c in _UIDARR0) {
 6260 			_UIDS[_uidcntr c]
 6261 		}
 6262 		delete _UIDS[_uidcntr c]
 6263 		return (_uidcntr c)
 6264 	}
 6265 	return _fatal("_tUID: Out of UID range")
 6266 }
 6267 
 6268 #_____________________________________________________
 6269 function _tgenuid_init(a, b, A)
 6270 {
 6271 	_ptrlength = 4
 6272 	a = "\222\223\224\225\226\227\230\231\232" "\240\241\242\243\244\245\246\247" "\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277" "\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317" "\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337"
 6273 	split(a, A, "")
 6274 	for (a in A) {
 6275 		for (b in A) {
 6276 			_UIDARR0[A[a] A[b]] _UIDARR1[A[a] A[b]]
 6277 		}
 6278 	}
 6279 	_uidcntr = A[a] A[b]
 6280 }
 6281 
 6282 #	if ( F in _TCLASS )				{ _[p]["CLASS"]=_TCLASS[F]; _tapi(p); return p }
 6283 #		# ???		_mpu(F,p)		???
 6284 #		return p }
 6285 #	_[p][F]=v; return p }
 6286 
 6287 #_______________________________________________________________________
 6288 function _tgetitem(p, n, a, b)
 6289 {
 6290 	############################################
 6291 	if (p) {
 6292 		if (isarray(_PTR[p]["ITEM"]) && (n in _PTR[p]["ITEM"])) {
 6293 			a = _PTR[p]["ITEM"][n]
 6294 		} else {
 6295 			a = _PTR[p]["ITEM"][n] = _N()
 6296 		}
 6297 		if (! (b = _rFCHLD(a))) {
 6298 			b = _wLCHLD(a, _N())
 6299 			_PTR[b]["HOST"] = p
 6300 			_[b]["ITEMNAME"] = n
 6301 		}
 6302 		return b
 6303 	}
 6304 }
 6305 
 6306 #_________________________________________________________________
 6307 function _tgetsp(p)
 6308 {
 6309 	###############################################
 6310 	return _tSTACK[p][0]
 6311 }
 6312 
 6313 ####################################################################################
 6314 
 6315 #_____________________________________________________________________________
 6316 function _th0(p, p1, p2, p3)
 6317 {
 6318 	return p
 6319 }
 6320 
 6321 ##########################################
 6322 
 6323 #_________________________________________________________________
 6324 function _th1(p0, p, p2, p3)
 6325 {
 6326 	return p
 6327 }
 6328 
 6329 ##############################
 6330 
 6331 #_________________________________________________________________
 6332 function _th10(p0, p1)
 6333 {
 6334 	return (p1 p0)
 6335 }
 6336 
 6337 ##############################
 6338 
 6339 #_________________________________________________________________
 6340 function _th2(p0, p1, r, p3)
 6341 {
 6342 	return p
 6343 }
 6344 
 6345 ##############################
 6346 
 6347 #_________________________________________________________________
 6348 function _th3(p0, p1, p2, r)
 6349 {
 6350 	return p
 6351 }
 6352 
 6353 #_________________________________________________________________
 6354 function _tifend(l)
 6355 {
 6356 	###############################################
 6357 	return (_t_ENDF[0] + l) in _t_ENDF ? (_t_ENDF[_t_ENDF[0] + l] ? _t_ENDF[_t_ENDF[0] + l] : 1) : ""
 6358 }
 6359 
 6360 # 	test _tbrochld fn; develope tOBJ r\w func specification for brochld func
 6361 
 6362 #_________________________________________________________________
 6363 function _tinit_i0(D, S, i)
 6364 {
 6365 	for (i in S) {
 6366 		if (isarray(S[i])) {
 6367 			if (! isarray(D[i][""])) {
 6368 				delete D[i]
 6369 				D[i][""]
 6370 				delete D[i][""]
 6371 			}
 6372 			_N_i0(D[i], S[i])
 6373 		} else {
 6374 			if (isarray(D[i])) {
 6375 				delete D[i]
 6376 			}
 6377 			D[i] = S[i]
 6378 		}
 6379 	}
 6380 }
 6381 
 6382 #_______________________________________________________________________
 6383 ########################################################################
 6384 
 6385 
 6386 
 6387 
 6388 
 6389 
 6390 
 6391 
 6392 
 6393 
 6394 
 6395 
 6396 
 6397 
 6398 
 6399 
 6400 
 6401 
 6402 
 6403 
 6404 
 6405 
 6406 #_______________________________________________________________________
 6407 #	_N(arr\str\mpuptr,val) \ _n(arr\str\mpuptr,val)
 6408 #		This functions create new object and return ptr.
 6409 #		_n() - creates object from list of deleted objects or if it's empty create new one, while _N() always create new one
 6410 #		It is strongly recommended to use _N() for the objects that have some data outside of standart object arrays. Or - make routines
 6411 #		that will clear outsided object data in case if object deleting.
 6412 #
 6413 #			IN:		arr\str\mpu,val	- (both missed) just create obj and return ptr
 6414 #					arr,val		- create object and write arr[ptr]=val
 6415 #					str,val		- create object and write _[ptr][str]=val
 6416 #					mpuptr		- NOT ALLOWED (val missed) create object and run MPU-code specified by mpuptr with created object ptr as primary parameter
 6417 #			MOD:		-
 6418 #			OUT:		-
 6419 #			RETURN:	ptr			- pointer to newly created object
 6420 #_________________________________________________________________
 6421 #	_tdel(ptr)
 6422 #		This function exclude object from it's current structure and delete it. ptr can be later used by function: _n() for creating new object
 6423 #		Also same story will occured with all chields and subchields of object specified by ptr.
 6424 #		??? What happened with linked py _ptr[ptr] objects ???
 6425 #
 6426 #			IN:		ptr			- pointer to object that will deleted
 6427 #			MOD:		-
 6428 #			OUT:		-
 6429 #			RETURN:	undefined
 6430 #_________________________________________________________________
 6431 #	_isptr(ptr)
 6432 #		This function checks: is ptr is the object pointer that is currently exist?
 6433 #		Unescaped remained data will be in data of src_dst_ptr.
 6434 #
 6435 #			IN:		ptr			- string that will be tested
 6436 #			MOD:		-
 6437 #			OUT:		-
 6438 #			RETURN:	undefined		- if ptr is not pointer to exist object
 6439 #					ptr			- if ptr is the pointer to exist object
 6440 #_________________________________________________________________
 6441 
 6442 
 6443 
 6444 #_________________________________________________________________
 6445 #
 6446 # TO DESIGN:
 6447 #
 6448 # create basic objectapi interface support
 6449 # modify everywhere checking ptr not by `if ( ptr )...', but by `if ( ptr in _ )...'
 6450 # _TMP0, _TMP1 name change to something like _DATA name ???
 6451 # think about redesigning routines for not depending if ptr is exist in tsysarrs: reason: performance\light code
 6452 function _tlist(L, p, f)
 6453 {
 6454 	_tlisti1 = _tlisti0 = L[_ARRLEN] + 0
 6455 	if (f == 0 && f == "") {
 6456 		_tlist_i0(L, p)
 6457 	} else {
 6458 		_tlistf0 = f in _TAPI ? _TAPI[f] : f
 6459 		_tlist_i1(L, p)
 6460 	}
 6461 	return (_tlisti0 - _tlisti1)
 6462 }
 6463 
 6464 function _tlist_i0(L, p, q, i)
 6465 {
 6466 	if (isarray(p)) {
 6467 		q = p[_ARRLEN]
 6468 		i = 0
 6469 		while (i++ < q) {
 6470 			_tlist_i0(L, p[i])
 6471 		}
 6472 		return
 6473 	}
 6474 	if (p in _) {
 6475 		while (p in _tLINK) {
 6476 			p = _tLINK[p]
 6477 		}
 6478 		L[++_tlisti0] = p
 6479 		if (p in _tFCHLD) {
 6480 			for (p = _tFCHLD[p]; p; p = p in _tNEXT ? _tNEXT[p] : "") {
 6481 				_tlist_i0(L, p)
 6482 			}
 6483 		}
 6484 	}
 6485 }
 6486 
 6487 function _tlist_i1(L, p)
 6488 {
 6489 	if (isarray(p)) {
 6490 		q = p[_ARRLEN]
 6491 		i = 0
 6492 		while (i++ < q) {
 6493 			_tlist_i1(L, p[i])
 6494 		}
 6495 		return
 6496 	}
 6497 	if (p in _) {
 6498 		while (p in _tLINK) {
 6499 			p = _tLINK[p]
 6500 		}
 6501 		if (_tlistf0 in _[p]) {
 6502 			L[++_tlisti0] = p
 6503 		}
 6504 		if (p in _tFCHLD) {
 6505 			for (p = _tFCHLD[p]; p; p = p in _tNEXT ? _tNEXT[p] : "") {
 6506 				_tlist_i1(L, p)
 6507 			}
 6508 		}
 6509 	}
 6510 }
 6511 
 6512 #_________________________________________________________________
 6513 function _tmbframe(f, p, p0, p1, t)
 6514 {
 6515 	##################################
 6516 	while ((p) && (! (_t_ENDF[0] in _t_ENDF))) {
 6517 		t = t _tbframe_i0(f, p, p0, p1, p = p in _tPREV ? _tPREV[p] : "")
 6518 	}
 6519 	return t
 6520 }
 6521 
 6522 #_________________________________________________________________
 6523 function _tmbframex(f, p, p0, p1, t)
 6524 {
 6525 	#################################
 6526 	while ((p) && (! (_t_ENDF[0] in _t_ENDF))) {
 6527 		t = t _tbframex_i0(f, p, p0, p1)
 6528 		p = p in _tPREV ? _tPREV[p] : ""
 6529 	}
 6530 	return t
 6531 }
 6532 
 6533 #_________________________________________________________________
 6534 function _tmbpass(f, p, p0, p1)
 6535 {
 6536 	######################################
 6537 	while ((p) && (! (_t_ENDF[0] in _t_ENDF))) {
 6538 		p0 = _tbpass_i0(f, p, p0, p1, p = p in _tPREV ? _tPREV[p] : "")
 6539 	}
 6540 	return p0
 6541 }
 6542 
 6543 #_________________________________________________________________
 6544 function _tmbpassx(f, p, p0, p1)
 6545 {
 6546 	#####################################
 6547 	while ((p) && (! (_t_ENDF[0] in _t_ENDF))) {
 6548 		p0 = _tbpassx_i0(f, p, p0, p1)
 6549 		p = p in _tPREV ? _tPREV[p] : ""
 6550 	}
 6551 	return p0
 6552 }
 6553 
 6554 #_________________________________________________________________
 6555 function _tmframe(f, p, p0, p1, p2)
 6556 {
 6557 	###################################
 6558 	delete _t_ENDF[++_t_ENDF[0]]
 6559 	f = p ? _tmframe_i0(f, p, p0, p1, p2) : ""
 6560 	--_t_ENDF[0]
 6561 	return f
 6562 }
 6563 
 6564 #___________________________________________________________
 6565 function _tmframe_i0(f, p, p0, p1, p2, t)
 6566 {
 6567 	while ((p) && (! (_t_ENDF[0] in _t_ENDF))) {
 6568 		t = t _tframe_i0(f, p, p0, p1, p2, p = p in _tNEXT ? _tNEXT[p] : "")
 6569 	}
 6570 	return t
 6571 }
 6572 
 6573 #___________________________________________________________
 6574 function _tmframe_i1(F, p, p0, p1, p2, t)
 6575 {
 6576 	while ((p) && (! (_t_ENDF[0] in _t_ENDF))) {
 6577 		t = t _tframe_i1(F, p, p0, p1, p2, p = p in _tNEXT ? _tNEXT[p] : "")
 6578 	}
 6579 	return t
 6580 }
 6581 
 6582 #_________________________________________________________________
 6583 function _tmframex(f, p, p0, p1, t)
 6584 {
 6585 	##################################
 6586 	while ((p) && (! (_t_ENDF[0] in _t_ENDF))) {
 6587 		t = t _tframex_i0(f, p, p0, p1)
 6588 		p = p in _tNEXT ? _tNEXT[p] : ""
 6589 	}
 6590 	return t
 6591 }
 6592 
 6593 #_________________________________________________________________
 6594 function _tmpass(f, p, p0, p1)
 6595 {
 6596 	#######################################
 6597 	while ((p) && (! (_t_ENDF[0] in _t_ENDF))) {
 6598 		p0 = _tbpass_i0(f, p, p0, p1, p = p in _tNEXT ? _tNEXT[p] : "")
 6599 	}
 6600 	return p0
 6601 }
 6602 
 6603 #_________________________________________________________________
 6604 function _tmpassx(f, p, p0, p1)
 6605 {
 6606 	######################################
 6607 	while ((p) && (! (_t_ENDF[0] in _t_ENDF))) {
 6608 		p0 = _tbpassx_i0(f, p, p0, p1)
 6609 		p = p in _tNEXT ? _tNEXT[p] : ""
 6610 	}
 6611 	return p0
 6612 }
 6613 
 6614 function _torexp(r)
 6615 {
 6616 	return _subseqon(_TOREXPB0, gensub(/(^[ \t]+)|(([ \t]*(\\)+)+[ \t]*)|([ \t]+$)/, "\\4", "G", _subseqoff(r, _TOREXPB0)), _TOREXPFN)
 6617 }
 6618 
 6619 function _torexp_cmdstr(t)
 6620 {
 6621 	return _strtorexp(gensub(/\^(.)/, "\\1", "G", t))
 6622 }
 6623 
 6624 function _torexp_fmask(t)
 6625 {
 6626 	return gensub(/\\\*/, ".*", "G", gensub(/\\\?/, ".?", "G", _strtorexp(t)))
 6627 }
 6628 
 6629 #_______________________________________________
 6630 function _torexp_init()
 6631 {
 6632 	_TOREXPFN[""] = "_strtorexp"
 6633 	_TOREXPFN["~"] = "_torexp_rexp"
 6634 	_TOREXPFN["="] = "_strtorexp"
 6635 	_TOREXPFN[">"] = "_torexp_cmdstr"
 6636 	_TOREXPFN["#"] = "_torexp_fmask"
 6637 	_TOREXPFN["\""] = "_torexp_dqstr"
 6638 	_TOREXPFN["'"] = "_torexp_sqstr"
 6639 }
 6640 
 6641 #_______________________________________________
 6642 function _torexp_rexp(t)
 6643 {
 6644 	return t
 6645 }
 6646 
 6647 #_____________________________________________________________________________
 6648 function _tpass(f, p, p0, p1)
 6649 {
 6650 	####################################################
 6651 	delete _t_ENDF[++_t_ENDF[0]]
 6652 	f = p ? _tpass_i0(f, p, p0, p1) : ""
 6653 	--_t_ENDF[0]
 6654 	return f
 6655 }
 6656 
 6657 #___________________________________________________________
 6658 function _tpass_i0(f, p, p0, p1, a)
 6659 {
 6660 	while (p in _tLINK) {
 6661 		p = _tLINK[p]
 6662 	}
 6663 	return (p in _tFCHLD ? _tmpass(f, _tFCHLD[p], p0, p1) : @f(p, p0, p1))
 6664 }
 6665 
 6666 #_____________________________________________________________________________
 6667 function _tpassx(f, p, p0, p1)
 6668 {
 6669 	###################################################
 6670 	delete _t_ENDF[++_t_ENDF[0]]
 6671 	f = p ? _tpassx_i0(f, p, p0, p1) : ""
 6672 	--_t_ENDF[0]
 6673 	return f
 6674 }
 6675 
 6676 #___________________________________________________________
 6677 function _tpassx_i0(f, p, p0, p1)
 6678 {
 6679 	while (p in _tLINK) {
 6680 		p = _tLINK[p]
 6681 	}
 6682 	return (p in _tFCHLD ? _tmpassx(f, _tFCHLD[p], p0, p1) : @f(p, p0, p1))
 6683 }
 6684 
 6685 #_________________________________________________________________
 6686 function _tpop(p, aA, a)
 6687 {
 6688 	###########################################
 6689 	if ((a = _tSTACK[p][0]) > 0) {
 6690 		_tSTACK[p][0]--
 6691 		if (isarray(_tSTACK[p][a])) {
 6692 			delete aA
 6693 			_movarr(aA, _tSTACK[p][a])
 6694 			return
 6695 		}
 6696 		return _tSTACK[p][a]
 6697 	}
 6698 	_fatal("^" p ": Out of tSTACK")
 6699 }
 6700 
 6701 #_____________________________________________________________________________
 6702 function _tpush(p, aA, a)
 6703 {
 6704 	######################################################
 6705 	if (isarray(aA)) {
 6706 		delete _tSTACK[p][a = ++_tSTACK[p][0]]
 6707 		_tSTACK[p][a][""]
 6708 		delete _tSTACK[p][a][""]
 6709 		_movarr(_tSTACK[p][a], aA)
 6710 		return
 6711 	}
 6712 	delete _tSTACK[p][a = ++_tSTACK[p][0]]
 6713 	return (_tSTACK[p][a] = aA)
 6714 }
 6715 
 6716 # prefix	-
 6717 # prichr	- aware character `{', `^',`]'
 6718 # sechr	- aware character `.' as the first char of sechr, and character `}'
 6719 # suffix	- aware character `]'
 6720 # cntptr	- aware character `]'
 6721 function _tr(n, cs, H)
 6722 {
 6723 	#_tuidinitcs[p]=cs
 6724 	#2 uidel, 5 pfx, 7 hichr,11(10) lochr,14 suffix
 6725 	_rconline(n ": " cs)
 6726 	_rconl()
 6727 	if (match(cs, /^((([^\xB4:\[\|\]]*\xB4.)*[^\xB4:\[\|\]]*):)?((([^\xB4\[\|\]]*\xB4.)*[^\xB4\[\|\]]*)\[)?(([^\xB4\|\]]*\xB4.)*[^\xB4\|\]]*)?(\|(\.)?(([^\xB4\]]*\xB4.)*[^\xB4\]]*))?(\](.*))?$/, H)) {
 6728 		_rconl("delptr: " _une(H[2]) "'")
 6729 		_rconl("pfxstr: " _une(H[5]) "'")
 6730 		_rconl("hichr:  " _une(H[7]) "'")
 6731 		_rconl("lochr:  " _une(H[10] ? H[7] "' and " H[11] "'" : H[11] "'"))
 6732 		_rconl("sfxstr: " _une(H[14]) "'")
 6733 	} else {
 6734 		_rconl("NOT MATCH!")
 6735 	}
 6736 	_rconl()
 6737 }
 6738 
 6739 #_______________________________________________________________________
 6740 function _trace(t, d, A)
 6741 {
 6742 	#################################################
 6743 	if (_ERRLOG_TF) {
 6744 		A["TYPE"] = "TRACE"
 6745 		A["TEXT"] = t
 6746 		_log(A, d)
 6747 	}
 6748 }
 6749 
 6750 #_________________________________________________________________
 6751 function _trunframe(f, p, p0, p1, p2)
 6752 {
 6753 	#################################
 6754 	return _tframe(f ? f : "_trunframe_i0", p, p0, p1, p2)
 6755 }
 6756 
 6757 #_________________________________________________________________
 6758 function _trunframe_i0(p, p0, p1, p2, f)
 6759 {
 6760 	if (p in _tFN) {
 6761 		f = _tFN[p]
 6762 		return @f(p, p0, p1, p2)
 6763 	}
 6764 }
 6765 
 6766 #_________________________________________________________________
 6767 function _trunframex(f, p, p0, p1)
 6768 {
 6769 	###################################
 6770 	return _tframex(f ? f : "_trunframe_i0", p, p0, p1)
 6771 }
 6772 
 6773 #_________________________________________________________________
 6774 function _trunpass(f, p, p0, p1)
 6775 {
 6776 	#####################################
 6777 	return _tpass(f ? f : "_trunframe_i0", p, p0, p1)
 6778 }
 6779 
 6780 #_________________________________________________________________
 6781 function _trunpassx(f, p, p0, p1)
 6782 {
 6783 	####################################
 6784 	return _tpassx(f ? f : "_trunframe_i0", p, p0, p1)
 6785 }
 6786 
 6787 #_________________________________________________________________
 6788 function _tsetsp(p, v)
 6789 {
 6790 	#############################################
 6791 	return (_tSTACK[p][0] = v)
 6792 }
 6793 
 6794 #			dptr			- morg ptr; in case if object deleted then _CLASSPTR[ptr] will be deleted(object is death), but
 6795 #							_tUIDEL[_CLASSPTR[ptr]] will be created that object can be resurrected from morg
 6796 #							dptr can be any string containing any characters except `:'. It's not verified
 6797 #			pfx,sfx		- uid prefix str, and uid suffix str; this strings specifies string that can be inserted before/after
 6798 #							uid generated by uid generator:
 6799 #
 6800 #								class uid:			pfx uidgen sfx
 6801 #
 6802 #							Both can be any string(including ""), and can contains any character with B4-escaping feature.
 6803 #							Note: that this strings cannot contains "'" character: it's should be escaped by B4-escaper.
 6804 #			hstr,lstr		- this values configure uid-generator itself. ther is a 3 combinations regarding its:
 6805 #
 6806 #								hstr			lstr			function
 6807 #
 6808 #								`ptr			*			- specify pointer to external uid-generator
 6809 #														All uids and chars will be generated by external uid-generator
 6810 #								*			^ptr			- class will have it's own uid generator using external character set
 6811 #								str			str			- class will have it's own uid generator with it's own character set
 6812 #														character set inmplemented in hstr(high-charset) and in lstr(low-charset) in 2 ways:
 6813 #							1)	"AB"			"AB01"			- this mean that high-charset contain chars: `A' and `B'
 6814 #																low-charset contains chars: `A', `B', `0', `1'
 6815 #
 6816 #							2)	"Az,By"		"Ax,Bw,0v,1u"		- this mean that high-charset contain chars: `Az' and `By'
 6817 #																low-charset contains chars:  `Ax', `Bw', `0v', `1u'
 6818 #															Note: both: hstr and lstr cannot contain char `,' directly, but it's can uses
 6819 #																	B4-escaper to escape any char including `,'
 6820 
 6821 
 6822 
 6823 # !!!! in case of using `,' in hstr/lstr - the escaped `,' will leads to interpretate hstr and lstr as divided by `,'
 6824 # if parameters error then i should be more specific about what error in parameters detected
 6825 # document _inituid(): parameters; document cs: uid initialization string format
 6826 # test with escape char
 6827 # adv hstr and lstr splitting?
 6828 # chk if hstr len==0 ?
 6829 # return _tclass & report error?
 6830 # _tapi thru function
 6831 
 6832 # additional syntax checking ???
 6833 # implement syntax and uid srv in docs
 6834 # add _dumpuid() ????
 6835 # make performance measurement
 6836 # protection against badchar list
 6837 # additional feature to specify _getuid() to not resurrect uid; and informative that uid was ressurected or not
 6838 # build _defclass fn
 6839 
 6840 # _tuidinitcs ????
 6841 # _tuidchrh[p]
 6842 # _tuidchrl[p]
 6843 # _tuidchr[p]
 6844 # _tuidcnt[p]
 6845 # _tUIDPFX[p]
 6846 # _tUIDSFX[p]
 6847 # _tUIDEL
 6848 # _tUIDCNTH
 6849 # _tUIDCNTL
 6850 # _tUIDCHRL
 6851 # _tUIDCHRH
 6852 
 6853 # create default class basic `new' and `del' functions
 6854 function _tstini()
 6855 {
 6856 	_ini("uidel:pfx'hstr|lstr'sfx")
 6857 	_ini("uidel:pfx'hstr|lstr'")
 6858 	_ini("uidel:'hstr|lstr'sfx")
 6859 	_ini("uidel:'hstr|lstr'")
 6860 	_ini("uidel:pfx'hstr'sfx")
 6861 	_ini("uidel:pfx'hstr'")
 6862 	_ini("uidel:'hstr'sfx")
 6863 	_ini("uidel:'hstr'")
 6864 	_conl()
 6865 	_conl("########################################################################################")
 6866 	_conl()
 6867 	_ini("pfx'hstr|lstr'sfx")
 6868 	_ini("pfx'hstr|lstr'")
 6869 	_ini("'hstr|lstr'sfx")
 6870 	_ini("'hstr|lstr'")
 6871 	_ini("pfx'hstr'sfx")
 6872 	_ini("pfx'hstr'")
 6873 	_ini("'hstr'sfx")
 6874 	_ini("'hstr'")
 6875 	_conl()
 6876 	_conl("########################################################################################")
 6877 	_conl()
 6878 	_ini("uidel:pfx'`cntptr'sfx")
 6879 	_ini("uidel:pfx'`cntptr'")
 6880 	_ini("uidel:'`cntptr'sfx")
 6881 	_ini("uidel:'`cntptr'")
 6882 	_conl()
 6883 	_conl("########################################################################################")
 6884 	_conl()
 6885 	_ini("pfx'`cntptr'sfx")
 6886 	_ini("pfx'`cntptr'")
 6887 	_ini("'`cntptr'sfx")
 6888 	_ini("'`cntptr'")
 6889 	_conl()
 6890 	_conl("########################################################################################")
 6891 	_conl()
 6892 	_ini("uidel:pfx'^chrptr'sfx")
 6893 	_ini("uidel:pfx'^chrptr'")
 6894 	_ini("uidel:'^chrptr'sfx")
 6895 	_ini("uidel:'^chrptr'")
 6896 	_conl()
 6897 	_conl("########################################################################################")
 6898 	_conl()
 6899 	_ini("pfx'^chrptr'sfx")
 6900 	_ini("pfx'^chrptr'")
 6901 	_ini("'^chrptr'sfx")
 6902 	_ini("'^chrptr'")
 6903 	_conl()
 6904 	_conl("########################################################################################")
 6905 	_conl()
 6906 }
 6907 
 6908 function _tstv(p, A, r, f)
 6909 {
 6910 	if (f == "") {
 6911 		f = "tst_splitstr"
 6912 	}
 6913 	@f(_NOP, A, p)
 6914 	@f(AA0, A, p)
 6915 	@f(AB0, A, p)
 6916 	@f(AC0, A, p)
 6917 	@f("", A, p)
 6918 	@f("a", A, p)
 6919 	@f("\264a", A, p)
 6920 	@f("\264", A, p)
 6921 	@f("a\264\264\264,ba\264\264\264,", A, p)
 6922 	@f("\264,", A, p)
 6923 	@f(",", A, p)
 6924 	@f("\264a,", A, p)
 6925 	@f("ab,", A, p)
 6926 	@f("ab,\264", A, p)
 6927 	@f("\264a\264,,ba", A, p)
 6928 	@f(",a,,b\264,c,,\264a,,\264,,,", A, p)
 6929 }
 6930 
 6931 function _typ(p)
 6932 {
 6933 	return (_t0 = isarray(p) ? "#" : p == 0 ? p == "" ? 0 : p in _CLASSPTR ? "`" : p ? 3 : 4 : p in _CLASSPTR ? "`" : p + 0 == p ? 5 : p ? 3 : 2)
 6934 }
 6935 
 6936 function _typa(p, A)
 6937 {
 6938 	return (_t0 = isarray(p) ? "#" : p == 0 ? p == "" ? 0 : p in A ? "`" : p ? 3 : 4 : p in A ? "`" : p + 0 == p ? 5 : p ? 3 : 2)
 6939 }
 6940 
 6941 #_____________________________________________________
 6942 #	_tframe0(hndstr,ptr)
 6943 #
 6944 #
 6945 #			IN:
 6946 #			MOD:
 6947 #			OUT:
 6948 #			RETURN:
 6949 #
 6950 #	handler string:
 6951 #		Handler-string divides to words. Word splitter is char ";"
 6952 #
 6953 #	Note that handler-string processed left to right. This mean that next word(more rightly) will overwrite fields implemented before(leftmost).
 6954 #	Note that if word-string contains more than one rexp-field then only last rexp-field(most rightly) will be applied.
 6955 #_______________________________________________
 6956 # TO DESIGN:
 6957 #
 6958 # 0-4: complete design of tlink handler call
 6959 # 1-4: add new tlink handler call
 6960 # 1-4: add new run fn (changed rexp to different for each type: see _tframe0)
 6961 #
 6962 # hndstr:
 6963 #	may be add rexp for each type of handler and also total rexp for all ??? ADDED (test)
 6964 #	may be add separator char ";" ???		ADDED (test)
 6965 #_______________________________________________________________________
 6966 function _tzend(a, b)
 6967 {
 6968 	#####################################################
 6969 	if (b == 0 && b == "") {
 6970 		return (_TEND[_TEND[_ARRLEN]] = a)
 6971 	} else {
 6972 		return (_TEND[_TEND[_ARRLEN] + a] = b)
 6973 	}
 6974 }
 6975 
 6976 function _uidcyc(p, i)
 6977 {
 6978 	_dumpuidgen(p)
 6979 	for (i = 1; i < (64 * 8 * 6 - 1); i++) {
 6980 		_conl(i ":" _var(_getuid(p)))
 6981 	}
 6982 	_dumpuidgen(p)
 6983 }
 6984 
 6985 function _une(t)
 6986 {
 6987 	return gensub(/\xB4(.)/, "\\1", "G", t)
 6988 }
 6989 
 6990 #___________________________________________________________________________________
 6991 function _unformatrexp(t)
 6992 {
 6993 	_formatstrq0 = split(t, _FORMATSTRA, /(\\[0-9]{1,3})|(\\x[[:xdigit:]]+)|(\\.)/, _FORMATSTRB)
 6994 	_formatstrs0 = ""
 6995 	for (t = 1; t < _formatstrq0; t++) {
 6996 		_formatstrs0 = _formatstrs0 _FORMATSTRA[t] (_FORMATSTRB[t] in _QESCHR ? _QESCREXP[_FORMATSTRB[t]] : _QESCREXP[toupper(substr(_FORMATSTRB[t], length(_FORMATSTRB[t]) - 1))])
 6997 	}
 6998 	return (_formatstrs0 _FORMATSTRA[t])
 6999 }
 7000 
 7001 #___________________________________________________________
 7002 function _unformatrexp_init(i, a)
 7003 {
 7004 	_formatstrs0 = "\\^$.[]|()*+?{}-sSwW<>yB`'"
 7005 	delete _FORMATSTRB
 7006 	for (i = 0; i < 256; i++) {
 7007 		_QESCREXP["\\" _CHR[i]] = index(_formatstrs0, _CHR[i]) ? "\\" _CHR[i] : _CHR[i]
 7008 	}
 7009 	for (i = 0; i < 256; i++) {
 7010 		a = index(_formatstrs0, _CHR[i]) ? "\\" : ""
 7011 		_QESCREXP[sprintf("%.2X", i)] = a _CHR[i]
 7012 		_QESCREXP["\\" sprintf("%.3o", i)] = a _CHR[i]
 7013 		if (i < 8) {
 7014 			_QESCREXP["\\" sprintf("%.1o", i)] = a _CHR[i]
 7015 		}
 7016 		if (i < 64) {
 7017 			_QESCREXP["\\" sprintf("%.2o", i)] = a _CHR[i]
 7018 		}
 7019 		if (i < 16) {
 7020 			_QESCREXP["\\x" sprintf("%.1X", i)] = _QESCREXP["\\x" sprintf("%.1x", i)] = a _CHR[i]
 7021 		}
 7022 	}
 7023 	patsplit("a" 7 "b" 8 "f" 12 "n" 10 "r" 13 "t" 9 "v" 11, _FORMATSTRA, /[^0-9]/, _FORMATSTRB)
 7024 	for (i in _FORMATSTRA) {
 7025 		_QESCREXP["\\" _FORMATSTRA[i]] = _CHR[_FORMATSTRB[i] + 0]
 7026 	}
 7027 }
 7028 
 7029 #___________________________________________________________________________________
 7030 function _unformatstr(t)
 7031 {
 7032 	_formatstrq0 = split(t, _FORMATSTRA, /(\\[0-9]{1,3})|(\\x[[:xdigit:]]+)|(\\.)/, _FORMATSTRB)
 7033 	_formatstrs0 = ""
 7034 	for (t = 1; t < _formatstrq0; t++) {
 7035 		_formatstrs0 = _formatstrs0 _FORMATSTRA[t] (_FORMATSTRB[t] in _QESCHR ? _QESCHR[_FORMATSTRB[t]] : _QESCHR[toupper(substr(_FORMATSTRB[t], length(_FORMATSTRB[t]) - 1))])
 7036 	}
 7037 	return (_formatstrs0 _FORMATSTRA[t])
 7038 }
 7039 
 7040 #___________________________________________________________
 7041 function _unformatstr_init(i)
 7042 {
 7043 	for (i = 0; i < 256; i++) {
 7044 		_QESCHR["\\" _CHR[i]] = _CHR[i]
 7045 	}
 7046 	for (i = 0; i < 256; i++) {
 7047 		_QESCHR[sprintf("%.2X", i)] = _CHR[i]
 7048 		_QESCHR["\\" sprintf("%.3o", i)] = _CHR[i]
 7049 		if (i < 8) {
 7050 			_QESCHR["\\" sprintf("%.1o", i)] = _CHR[i]
 7051 		}
 7052 		if (i < 64) {
 7053 			_QESCHR["\\" sprintf("%.2o", i)] = _CHR[i]
 7054 		}
 7055 		if (i < 16) {
 7056 			_QESCHR["\\x" sprintf("%.1X", i)] = _QESCHR["\\x" sprintf("%.1x", i)] = _CHR[i]
 7057 		}
 7058 	}
 7059 	i = "a" 7 "b" 8 "f" 12 "n" 10 "r" 13 "t" 9 "v" 11
 7060 	patsplit(i, _FORMATSTRA, /[^0-9]/, _FORMATSTRB)
 7061 	for (i in _FORMATSTRA) {
 7062 		_QESCHR["\\" _FORMATSTRA[i]] = _CHR[_FORMATSTRB[i] + 0]
 7063 	}
 7064 }
 7065 
 7066 #_____________________________________________________________________________
 7067 function _uninit_del(A, i, p0)
 7068 {
 7069 	_del(i)
 7070 }
 7071 
 7072 ####################################################################################
 7073 # PUBLIC:
 7074 #_____________________________________________________________________________
 7075 #	var	_SYS_STDOUT			- (by default = "/dev/stdout") standart output pipe filename
 7076 #	var	_SYS_STDERR			- (by default = "/dev/stderr") standart error output pipe filename
 7077 #	var	_SYS_STDCON			- (by default = "CON") standart console output device
 7078 #_____________________________________________________________________________
 7079 #	var	_CHR["CR"]			- return cursor to the position 0 without newline(normally ="\x0D")
 7080 #	var	_CHR["EOL"]			- return cursor to the position 0 & newline (MS:="\x0D\x0A" / UX:="\x0D")
 7081 #	var	_CON_WIDTH 			- console width(columns number)
 7082 #_____________________________________________________________________________
 7083 #	fn	_cmd(c)			- execute shell command c and return output
 7084 #	fn	_err				- output string w\o any addition into _SYS_STDERR device
 7085 #	fn	_errnl			- output string with addition _CHR["EOL"] at the end of the string into _SYS_STDERR device
 7086 #	fn	_out				- output string w\o any addition into _SYS_STDOUT device
 7087 #	fn	_outnl			- output string with addition _CHR["EOL"] at the end of the string into _SYS_STDOUT device
 7088 #_____________________________________________________________________________
 7089 #	fn	_con(text[,tabspace])
 7090 #	fn	_conl(text[,tabspace])
 7091 #	fn	_conline(text[,tabspace])
 7092 #	fn	_constat(status[,tabspace])
 7093 #	fn	_constatpush([status[,tabspace]])
 7094 #	fn	_constatpop()
 7095 #_______________________________________________________________________
 7096 #	var	_constatstr
 7097 ####################################################################################
 7098 function _unstr(t)
 7099 {
 7100 	return gensub(/\\(.)/, "\\1", "G", t)
 7101 }
 7102 
 7103 #_________________________________________________________________
 7104 function _untmp(f, a)
 7105 {
 7106 	#############################################
 7107 	if ((f = filepath(f))) {
 7108 		if (match(f, /\\$/)) {
 7109 			_deletepfx(_FILEIO_RDTMP, a = toupper(f))
 7110 			_deletepfx(_FILEIO_RDNETMP, a)
 7111 		} else {
 7112 			delete _FILEIO_RDNETMP[toupper(f)]
 7113 		}
 7114 		return f
 7115 	}
 7116 	return ""
 7117 }
 7118 
 7119 #_____________________________________________________________________________
 7120 function _val(v, t)
 7121 {
 7122 	if (isarray(v)) {
 7123 		return (_dumparr(v) _ln(t))
 7124 	}
 7125 	if (v == 0 && v == "") {
 7126 		return (_ln("- (ERRNO=" ERRNO ")") _ln(t))
 7127 	}
 7128 	return (_ln(v "'") _ln(t))
 7129 }
 7130 
 7131 #_____________________________________________________________________________
 7132 function _val0(v)
 7133 {
 7134 	if (isarray(v)) {
 7135 		return _dumparr(v)
 7136 	}
 7137 	if (v == 0 && v == "") {
 7138 		return "-"
 7139 	}
 7140 	return ("\"" v "\"")
 7141 }
 7142 
 7143 #_____________________________________________________________________________
 7144 function _var(v, t)
 7145 {
 7146 	if (isarray(v)) {
 7147 		return (_dumparr(v) _ln(t))
 7148 	}
 7149 	if (v == 0 && v == "") {
 7150 		return (_ln("- (ERRNO=" ERRNO ")") _ln(t))
 7151 	}
 7152 	return (_ln(v "'") _ln(t))
 7153 }
 7154 
 7155 #_______________________________________________________________________
 7156 function _verb(t, d, A)
 7157 {
 7158 	##################################################
 7159 	if (_ERRLOG_VF) {
 7160 		A["TYPE"] = "VERB"
 7161 		A["TEXT"] = t
 7162 		_log(A, d)
 7163 	}
 7164 }
 7165 
 7166 #_________________________________________________________________
 7167 function _wFBRO(p, v, a)
 7168 {
 7169 	###########################################
 7170 	if (p) {
 7171 		if (v) {
 7172 			for (a = p; a in _tPARENT; ) {
 7173 				if ((a = _tPARENT[a]) == v) {
 7174 					return v
 7175 				}
 7176 			}	######################## v is parentesis of p
 7177 			if (p in _tPARENT) {
 7178 				p = _tPARENT[p]
 7179 				if (v in _tNEXT) {
 7180 					if (v in _tPREV) {
 7181 						_tPREV[_tNEXT[a] = _tNEXT[v]] = a = _tPREV[v]
 7182 						delete _tPREV[v]
 7183 						if (v in _tPARENT) {
 7184 							if (p == (a = _tPARENT[v])) {
 7185 								return (_tFCHLD[p] = _tPREV[_tNEXT[v] = _tFCHLD[p]] = v)
 7186 							}
 7187 							--_tQCHLD[a]
 7188 						}
 7189 					} else if (v in _tPARENT) {
 7190 						if (p == (a = _tPARENT[v])) {
 7191 							return v
 7192 						}
 7193 						delete _tPREV[_tFCHLD[a] = _tNEXT[v]]
 7194 						--_tQCHLD[a]
 7195 					} else {
 7196 						delete _tPREV[_tNEXT[v]]
 7197 					}
 7198 					++_tQCHLD[p]
 7199 					return (_tFCHLD[p] = _tPREV[_tNEXT[v] = _tFCHLD[_tPARENT[v] = p]] = v)
 7200 				} else {
 7201 					if (v in _tPREV) {
 7202 						if (v in _tPARENT) {
 7203 							delete _tNEXT[_tLCHLD[a = _tPARENT[v]] = _tPREV[v]]
 7204 							if (p == a) {
 7205 								delete _tPREV[v]
 7206 								return (_tFCHLD[p] = _tPREV[_tNEXT[v] = _tFCHLD[p]] = v)
 7207 							}
 7208 							--_tQCHLD[a]
 7209 						} else {
 7210 							delete _tNEXT[_tPREV[v]]
 7211 						}
 7212 						delete _tPREV[v]
 7213 					} else if (v in _tPARENT) {
 7214 						if (p == (a = _tPARENT[v])) {
 7215 							return v
 7216 						}
 7217 						delete _tFCHLD[a]
 7218 						delete _tLCHLD[a]
 7219 						delete _tQCHLD[a]
 7220 					}
 7221 					++_tQCHLD[p]
 7222 					return (_tFCHLD[p] = _tPREV[_tNEXT[v] = _tFCHLD[_tPARENT[v] = p]] = v)
 7223 				}
 7224 			} else {
 7225 				while (p in _tPREV) {
 7226 					p = _tPREV[p]
 7227 				}
 7228 				if (v in _tPREV) {
 7229 					if (v in _tPARENT) {
 7230 						--_tQCHLD[a = _tPARENT[v]]
 7231 						delete _tPARENT[v]
 7232 						if (v in _tNEXT) {
 7233 							_tNEXT[_tPREV[a] = _tPREV[v]] = a = _tNEXT[v]
 7234 						} else {
 7235 							delete _tNEXT[_tLCHLD[a] = _tPREV[v]]
 7236 						}
 7237 					} else if (v in _tNEXT) {
 7238 						_tNEXT[_tPREV[a] = _tPREV[v]] = a = _tNEXT[v]
 7239 					} else {
 7240 						delete _tNEXT[_tPREV[v]]
 7241 					}
 7242 					delete _tPREV[v]
 7243 				} else {
 7244 					if (p == v) {
 7245 						return v
 7246 					}
 7247 					if (v in _tPARENT) {
 7248 						if (v in _tNEXT) {
 7249 							delete _tPREV[_tFCHLD[a = _tPARENT[v]] = _tNEXT[v]]
 7250 							--_tQCHLD[a]
 7251 						} else {
 7252 							delete _tLCHLD[a = _tPARENT[v]]
 7253 							delete _tFCHLD[a]
 7254 							delete _tQCHLD[a]
 7255 						}
 7256 						delete _tPARENT[v]
 7257 					} else if (v in _tNEXT) {
 7258 						delete _tPREV[_tNEXT[v]]
 7259 					}
 7260 				}
 7261 				return (_tPREV[_tNEXT[v] = p] = v)
 7262 			}
 7263 		} else {
 7264 			if (v == 0) {
 7265 				return v
 7266 			}			######################## p=ptr, v=0
 7267 			return v
 7268 		}
 7269 	} else {
 7270 		if (p == 0) {
 7271 			return v	######################## p=0
 7272 		}		######################## p=ptr, v=""
 7273 		if (v) {
 7274 			return _texclude(v)	######################## p="", v=ptr	- exclude v
 7275 		}
 7276 		return v
 7277 	}
 7278 }
 7279 
 7280 #_________________________________________________________________
 7281 function _wFCHLD(p, v, a)
 7282 {
 7283 	##########################################
 7284 	if (p) {
 7285 		if (v) {
 7286 			if (p == v) {
 7287 				return v
 7288 			}			######################## p=v=ptr
 7289 			for (a = p; a in _tPARENT; ) {
 7290 				if ((a = _tPARENT[a]) == v) {
 7291 					return v
 7292 				}
 7293 			}	######################## v is parentesis of p
 7294 			if (v in _tNEXT) {
 7295 				if (v in _tPREV) {
 7296 					_tPREV[_tNEXT[a] = _tNEXT[v]] = a = _tPREV[v]
 7297 					delete _tPREV[v]
 7298 					if (v in _tPARENT) {
 7299 						if (p == (a = _tPARENT[v])) {
 7300 							return (_tFCHLD[p] = _tPREV[_tNEXT[v] = _tFCHLD[p]] = v)
 7301 						}
 7302 						--_tQCHLD[a]
 7303 					}
 7304 				} else if (v in _tPARENT) {
 7305 					if (p == (a = _tPARENT[v])) {
 7306 						return v
 7307 					}
 7308 					delete _tPREV[_tFCHLD[a] = _tNEXT[v]]
 7309 					--_tQCHLD[a]
 7310 				} else {
 7311 					delete _tPREV[_tNEXT[v]]
 7312 				}
 7313 				if (p in _tFCHLD) {
 7314 					++_tQCHLD[p]
 7315 					return (_tFCHLD[p] = _tPREV[_tNEXT[v] = _tFCHLD[_tPARENT[v] = p]] = v)
 7316 				}
 7317 				delete _tNEXT[v]
 7318 			} else {
 7319 				if (v in _tPREV) {
 7320 					if (v in _tPARENT) {
 7321 						delete _tNEXT[_tLCHLD[a = _tPARENT[v]] = _tPREV[v]]
 7322 						if (p == a) {
 7323 							delete _tPREV[v]
 7324 							return (_tFCHLD[p] = _tPREV[_tNEXT[v] = _tFCHLD[p]] = v)
 7325 						}
 7326 						--_tQCHLD[a]
 7327 					} else {
 7328 						delete _tNEXT[_tPREV[v]]
 7329 					}
 7330 					delete _tPREV[v]
 7331 				} else if (v in _tPARENT) {
 7332 					if (p == (a = _tPARENT[v])) {
 7333 						return v
 7334 					}
 7335 					delete _tFCHLD[a]
 7336 					delete _tLCHLD[a]
 7337 					delete _tQCHLD[a]
 7338 				}
 7339 				if (p in _tFCHLD) {
 7340 					++_tQCHLD[p]
 7341 					return (_tFCHLD[p] = _tPREV[_tNEXT[v] = _tFCHLD[_tPARENT[v] = p]] = v)
 7342 				}
 7343 			}
 7344 			_tQCHLD[p] = 1
 7345 			return (_tFCHLD[_tPARENT[v] = p] = _tLCHLD[p] = v)
 7346 		} else {
 7347 			if (v == 0) {
 7348 				if (p in _tFCHLD) {	######################## p=ptr, v=0 > delete all chld
 7349 					v = _tFCHLD[p]
 7350 					delete _tFCHLD[p]
 7351 					delete _tLCHLD[p]
 7352 					delete _tQCHLD[p]
 7353 					do {
 7354 						delete _tPARENT[v]
 7355 					} while ((v in _tNEXT) && (v = _tNEXT[v]))
 7356 				}
 7357 			}
 7358 			return v
 7359 		}
 7360 	} else {
 7361 		if (p == 0) {
 7362 			return v	######################## p=0
 7363 		}		######################## p=ptr, v="" > ignore action
 7364 		return v
 7365 	}
 7366 }
 7367 
 7368 #_________________________________________________________________
 7369 function _wLBRO(p, v, a)
 7370 {
 7371 	###########################################
 7372 	if (p) {
 7373 		if (v) {
 7374 			for (a = p; a in _tPARENT; ) {
 7375 				if ((a = _tPARENT[a]) == v) {
 7376 					return v
 7377 				}
 7378 			}	######################## v is parentesis of p
 7379 			if (p in _tPARENT) {
 7380 				p = _tPARENT[p]
 7381 				if (v in _tPREV) {
 7382 					if (v in _tNEXT) {
 7383 						_tNEXT[_tPREV[a] = _tPREV[v]] = a = _tNEXT[v]
 7384 						delete _tNEXT[v]
 7385 						if (v in _tPARENT) {
 7386 							if (p == (a = _tPARENT[v])) {
 7387 								return (_tLCHLD[p] = _tNEXT[_tPREV[v] = _tLCHLD[p]] = v)
 7388 							}
 7389 							--_tQCHLD[a]
 7390 						}
 7391 					} else if (v in _tPARENT) {
 7392 						if (p == (a = _tPARENT[v])) {
 7393 							return v
 7394 						}
 7395 						delete _tNEXT[_tLCHLD[a] = _tPREV[v]]
 7396 						--_tQCHLD[a]
 7397 					} else {
 7398 						delete _tNEXT[_tPREV[v]]
 7399 					}
 7400 					++_tQCHLD[p]
 7401 					return (_tLCHLD[p] = _tNEXT[_tPREV[v] = _tLCHLD[_tPARENT[v] = p]] = v)
 7402 				} else {
 7403 					if (v in _tNEXT) {
 7404 						if (v in _tPARENT) {
 7405 							delete _tPREV[_tFCHLD[a = _tPARENT[v]] = _tNEXT[v]]
 7406 							if (p == a) {
 7407 								delete _tNEXT[v]
 7408 								return (_tLCHLD[p] = _tNEXT[_tPREV[v] = _tLCHLD[p]] = v)
 7409 							}
 7410 							--_tQCHLD[a]
 7411 						} else {
 7412 							delete _tPREV[_tNEXT[v]]
 7413 						}
 7414 						delete _tNEXT[v]
 7415 					} else if (v in _tPARENT) {
 7416 						if (p == (a = _tPARENT[v])) {
 7417 							return v
 7418 						}
 7419 						delete _tLCHLD[a]
 7420 						delete _tFCHLD[a]
 7421 						delete _tQCHLD[a]
 7422 					}
 7423 					++_tQCHLD[p]
 7424 					return (_tLCHLD[p] = _tNEXT[_tPREV[v] = _tLCHLD[_tPARENT[v] = p]] = v)
 7425 				}
 7426 			} else {
 7427 				while (p in _tNEXT) {
 7428 					p = _tNEXT[p]
 7429 				}
 7430 				if (v in _tNEXT) {
 7431 					if (v in _tPARENT) {
 7432 						--_tQCHLD[a = _tPARENT[v]]
 7433 						delete _tPARENT[v]
 7434 						if (v in _tPREV) {
 7435 							_tPREV[_tNEXT[a] = _tNEXT[v]] = a = _tPREV[v]
 7436 						} else {
 7437 							delete _tPREV[_tFCHLD[a] = _tNEXT[v]]
 7438 						}
 7439 					} else if (v in _tPREV) {
 7440 						_tPREV[_tNEXT[a] = _tNEXT[v]] = a = _tPREV[v]
 7441 					} else {
 7442 						delete _tPREV[_tNEXT[v]]
 7443 					}
 7444 					delete _tNEXT[v]
 7445 				} else {
 7446 					if (p == v) {
 7447 						return v
 7448 					}
 7449 					if (v in _tPARENT) {
 7450 						if (v in _tPREV) {
 7451 							delete _tNEXT[_tLCHLD[a = _tPARENT[v]] = _tPREV[v]]
 7452 							--_tQCHLD[a]
 7453 						} else {
 7454 							delete _tFCHLD[a = _tPARENT[v]]
 7455 							delete _tLCHLD[a]
 7456 							delete _tQCHLD[a]
 7457 						}
 7458 						delete _tPARENT[v]
 7459 					} else if (v in _tPREV) {
 7460 						delete _tNEXT[_tPREV[v]]
 7461 					}
 7462 				}
 7463 				return (_tNEXT[_tPREV[v] = p] = v)
 7464 			}
 7465 		} else {
 7466 			if (v == 0) {
 7467 				return v
 7468 			}			######################## p=ptr, v=0
 7469 			return v
 7470 		}
 7471 	} else {
 7472 		if (p == 0) {
 7473 			return v	######################## p=0
 7474 		}		######################## p=ptr, v=""
 7475 		if (v) {
 7476 			return _texclude(v)	######################## p="", v=ptr	- exclude v
 7477 		}
 7478 		return v
 7479 	}
 7480 }
 7481 
 7482 #_________________________________________________________________
 7483 function _wLCHLD(p, v, a)
 7484 {
 7485 	##########################################
 7486 	if (p) {
 7487 		if (v) {
 7488 			if (p == v) {
 7489 				return v
 7490 			}			######################## p=v=ptr
 7491 			for (a = p; a in _tPARENT; ) {
 7492 				if ((a = _tPARENT[a]) == v) {
 7493 					return v
 7494 				}
 7495 			}	######################## v is parentesis of p
 7496 			if (v in _tPREV) {
 7497 				if (v in _tNEXT) {
 7498 					_tNEXT[_tPREV[a] = _tPREV[v]] = a = _tNEXT[v]
 7499 					delete _tNEXT[v]
 7500 					if (v in _tPARENT) {
 7501 						if (p == (a = _tPARENT[v])) {
 7502 							return (_tLCHLD[p] = _tNEXT[_tPREV[v] = _tLCHLD[p]] = v)
 7503 						}
 7504 						--_tQCHLD[a]
 7505 					}
 7506 				} else if (v in _tPARENT) {
 7507 					if (p == (a = _tPARENT[v])) {
 7508 						return v
 7509 					}
 7510 					delete _tNEXT[_tLCHLD[a] = _tPREV[v]]
 7511 					--_tQCHLD[a]
 7512 				} else {
 7513 					delete _tNEXT[_tPREV[v]]
 7514 				}
 7515 				if (p in _tLCHLD) {
 7516 					++_tQCHLD[p]
 7517 					return (_tLCHLD[p] = _tNEXT[_tPREV[v] = _tLCHLD[_tPARENT[v] = p]] = v)
 7518 				}
 7519 				delete _tPREV[v]
 7520 			} else {
 7521 				if (v in _tNEXT) {
 7522 					if (v in _tPARENT) {
 7523 						delete _tPREV[_tFCHLD[a = _tPARENT[v]] = _tNEXT[v]]
 7524 						if (p == a) {
 7525 							delete _tNEXT[v]
 7526 							return (_tLCHLD[p] = _tNEXT[_tPREV[v] = _tLCHLD[p]] = v)
 7527 						}
 7528 						--_tQCHLD[a]
 7529 					} else {
 7530 						delete _tPREV[_tNEXT[v]]
 7531 					}
 7532 					delete _tNEXT[v]
 7533 				} else if (v in _tPARENT) {
 7534 					if (p == (a = _tPARENT[v])) {
 7535 						return v
 7536 					}
 7537 					delete _tLCHLD[a]
 7538 					delete _tFCHLD[a]
 7539 					delete _tQCHLD[a]
 7540 				}
 7541 				if (p in _tLCHLD) {
 7542 					++_tQCHLD[p]
 7543 					return (_tLCHLD[p] = _tNEXT[_tPREV[v] = _tLCHLD[_tPARENT[v] = p]] = v)
 7544 				}
 7545 			}
 7546 			_tQCHLD[p] = 1
 7547 			return (_tLCHLD[_tPARENT[v] = p] = _tFCHLD[p] = v)
 7548 		} else {
 7549 			if (v == 0) {
 7550 				if (p in _tFCHLD) {	######################## p=ptr, v=0 > delete all chld
 7551 					v = _tFCHLD[p]
 7552 					delete _tFCHLD[p]
 7553 					delete _tLCHLD[p]
 7554 					delete _tQCHLD[p]
 7555 					do {
 7556 						delete _tPARENT[v]
 7557 					} while ((v in _tNEXT) && (v = _tNEXT[v]))
 7558 				}
 7559 			}
 7560 			return v
 7561 		}
 7562 	} else {
 7563 		if (p == 0) {
 7564 			return v	######################## p=0
 7565 		}		######################## p=ptr, v="" > ignore action
 7566 		return v
 7567 	}
 7568 }
 7569 
 7570 #_________________________________________________________________
 7571 function _wLINK(p, v)
 7572 {
 7573 	##############################################
 7574 	return (_tLINK[p] = v)
 7575 }
 7576 
 7577 #_________________________________________________________________
 7578 function _wNEXT(p, v, a, b)
 7579 {
 7580 	#########################################
 7581 	if (p) {
 7582 		if (v) {
 7583 			if (p == v) {
 7584 				return v
 7585 			}			######################## p=v=ptr
 7586 			for (a = p; a in _tPARENT; ) {
 7587 				if ((a = _tPARENT[a]) == v) {
 7588 					return v
 7589 				}
 7590 			}	######################## v is parentesis of p
 7591 			if (v in _tPREV) {
 7592 				if (p == (a = _tPREV[v])) {
 7593 					return v
 7594 				}
 7595 				if (v in _tNEXT) {
 7596 					_tPREV[_tNEXT[a] = _tNEXT[v]] = a
 7597 					if (v in _tPARENT) {
 7598 						--_tQCHLD[_tPARENT[v]]
 7599 					}
 7600 				} else {
 7601 					delete _tNEXT[a]
 7602 					if (v in _tPARENT) {
 7603 						_tLCHLD[b = _tPARENT[v]] = a
 7604 						--_tQCHLD[b]
 7605 					}
 7606 				}
 7607 			} else if (v in _tNEXT) {
 7608 				if (v in _tPARENT) {
 7609 					delete _tPREV[_tFCHLD[a = _tPARENT[v]] = _tNEXT[v]]
 7610 					--_tQCHLD[a]
 7611 				} else {
 7612 					delete _tPREV[_tNEXT[v]]
 7613 				}
 7614 			} else if (v in _tPARENT) {
 7615 				delete _tFCHLD[a = _tPARENT[v]]
 7616 				delete _tLCHLD[a]
 7617 				delete _tQCHLD[a]
 7618 			}
 7619 			if (p in _tNEXT) {
 7620 				_tPREV[_tNEXT[v] = _tNEXT[p]] = v
 7621 				if (p in _tPARENT) {
 7622 					++_tQCHLD[_tPARENT[v] = _tPARENT[p]]
 7623 				} else {
 7624 					delete _tPARENT[v]
 7625 				}
 7626 			} else {
 7627 				delete _tNEXT[v]
 7628 				if (p in _tPARENT) {
 7629 					++_tQCHLD[_tPARENT[_tLCHLD[a] = v] = a = _tPARENT[p]]
 7630 				} else {
 7631 					delete _tPARENT[v]
 7632 				}
 7633 			}
 7634 			return (_tNEXT[_tPREV[v] = p] = v)
 7635 		} else {
 7636 			if (v == 0) {
 7637 				return v
 7638 			}			######################## p=ptr, v=0
 7639 			return v
 7640 		}
 7641 	} else {
 7642 		if (p == 0) {
 7643 			return v	######################## p=0
 7644 		}		######################## p=ptr, v=""
 7645 		if (v) {
 7646 			return _texclude(v)	######################## p="", v=ptr	- exclude v
 7647 		}
 7648 		return v
 7649 	}
 7650 }
 7651 
 7652 #_________________________________________________________________
 7653 function _wPARENT(p, v)
 7654 {
 7655 	############################################
 7656 	return v
 7657 }
 7658 
 7659 #_________________________________________________________________
 7660 function _wPREV(p, v, a, b)
 7661 {
 7662 	#########################################
 7663 	if (p) {
 7664 		if (v) {
 7665 			if (p == v) {
 7666 				return v
 7667 			}			######################## p=v=ptr
 7668 			for (a = p; a in _tPARENT; ) {
 7669 				if ((a = _tPARENT[a]) == v) {
 7670 					return v
 7671 				}
 7672 			}	######################## v is parentesis of p
 7673 			if (v in _tNEXT) {
 7674 				if (p == (a = _tNEXT[v])) {
 7675 					return v
 7676 				}
 7677 				if (v in _tPREV) {
 7678 					_tNEXT[_tPREV[a] = _tPREV[v]] = a
 7679 					if (v in _tPARENT) {
 7680 						--_tQCHLD[_tPARENT[v]]
 7681 					}
 7682 				} else {
 7683 					delete _tPREV[a]
 7684 					if (v in _tPARENT) {
 7685 						_tFCHLD[b = _tPARENT[v]] = a
 7686 						--_tQCHLD[b]
 7687 					}
 7688 				}
 7689 			} else if (v in _tPREV) {
 7690 				if (v in _tPARENT) {
 7691 					delete _tNEXT[_tLCHLD[a = _tPARENT[v]] = _tPREV[v]]
 7692 					--_tQCHLD[a]
 7693 				} else {
 7694 					delete _tNEXT[_tPREV[v]]
 7695 				}
 7696 			} else if (v in _tPARENT) {
 7697 				delete _tLCHLD[a = _tPARENT[v]]
 7698 				delete _tFCHLD[a]
 7699 				delete _tQCHLD[a]
 7700 			}
 7701 			if (p in _tPREV) {
 7702 				_tNEXT[_tPREV[v] = _tPREV[p]] = v
 7703 				if (p in _tPARENT) {
 7704 					++_tQCHLD[_tPARENT[v] = _tPARENT[p]]
 7705 				} else {
 7706 					delete _tPARENT[v]
 7707 				}
 7708 			} else {
 7709 				delete _tPREV[v]
 7710 				if (p in _tPARENT) {
 7711 					++_tQCHLD[_tPARENT[_tFCHLD[a] = v] = a = _tPARENT[p]]
 7712 				} else {
 7713 					delete _tPARENT[v]
 7714 				}
 7715 			}
 7716 			return (_tPREV[_tNEXT[v] = p] = v)
 7717 		} else {
 7718 			if (v == 0) {
 7719 				return v
 7720 			}			######################## p=ptr, v=0
 7721 			return v
 7722 		}
 7723 	} else {
 7724 		if (p == 0) {
 7725 			return v	######################## p=0
 7726 		}		######################## p=ptr, v=""
 7727 		if (v) {
 7728 			return _texclude(v)	######################## p="", v=ptr	- exclude v
 7729 		}
 7730 		return v
 7731 	}
 7732 }
 7733 
 7734 #_________________________________________________________________
 7735 function _wQBRO(p, v)
 7736 {
 7737 	##############################################
 7738 	return v
 7739 }
 7740 
 7741 #_________________________________________________________________
 7742 function _wQCHLD(p, v)
 7743 {
 7744 	#############################################
 7745 	if (p) {
 7746 		if (v) {
 7747 		} else {
 7748 			if (v == 0) {
 7749 				if (p in _tFCHLD) {	######################## p=ptr, v=0 > delete all chld
 7750 					v = _tFCHLD[p]	######################## p=ptr, v=ptr
 7751 					delete _tFCHLD[p]
 7752 					delete _tLCHLD[p]
 7753 					delete _tQCHLD[p]
 7754 					do {
 7755 						delete _tPARENT[v]
 7756 					} while ((v in _tNEXT) && (v = _tNEXT[v]))
 7757 				}
 7758 			}
 7759 			return v
 7760 		}
 7761 	} else {
 7762 		if (p == 0) {
 7763 			return v	######################## p=ptr, v="" > ignore action
 7764 		}		######################## p=0
 7765 		return v
 7766 	}
 7767 }
 7768 
 7769 #_______________________________________________________________________
 7770 function _warning(t, d, A)
 7771 {
 7772 	###############################################
 7773 	if (_ERRLOG_WF) {
 7774 		A["TYPE"] = "WARNING"
 7775 		A["TEXT"] = t
 7776 		_log(A, d)
 7777 	}
 7778 }
 7779 
 7780 #___________________________________________________________
 7781 function _wfilerdnehnd(f, t)
 7782 {
 7783 	if ((f = _filerdne(f)) == "") {
 7784 		return ""
 7785 	}
 7786 	if (! ((t = _filerd(f)) in _WFILEROOTDIR)) {
 7787 		_cmd("md \"" t "\" 2>NUL")
 7788 		_WFILEROOTDIR[t]
 7789 	}
 7790 	return f
 7791 }
 7792 
 7793 function _wonl(t)
 7794 {
 7795 	wonl = wonl _ln(t)
 7796 }
 7797 
 7798 function _wonline(t)
 7799 {
 7800 	wonl = wonl _ln(substr(" _ " t " _____________________________________________________________________________________________________________________________________", 1, 126))
 7801 }
 7802 
 7803 #___________________________________________________________
 7804 function _wr_shortcut(f, S)
 7805 {
 7806 	if ((_shrtcutf0 = _filepath(f))) {
 7807 		ERRNO = ""
 7808 		_shrtcuta0 = _shortcut_fpath " /A:C /F:\"" _shrtcutf0 "\" 2>&1"
 7809 		for (f in _SHORTCUTWSTRUC) {
 7810 			if (f in S) {
 7811 				_shrtcuta0 = _shrtcuta0 " " _SHORTCUTWSTRUC[f] "\"" (gensub(/(\\?)$/, "\\1\\1", 1, S[f])) "\""
 7812 			}
 7813 		}
 7814 		if (_shortcut_nerr(_cmd(_shrtcuta0), _shrtcutf0)) {
 7815 			return
 7816 		}
 7817 	}
 7818 	return (ERRNO ? ERRNO = "write shortcut: " ERRNO : _NOP)
 7819 }
 7820 
 7821 #_________________________________________________________________
 7822 function _wrfile(f, d, a, b)
 7823 {
 7824 	#########################################
 7825 	if (((f = _wfilerdnehnd(f)) == "") || (_filene(f) == "")) {
 7826 		ERRNO = "Filename error"
 7827 		return
 7828 	}
 7829 	a = BINMODE
 7830 	BINMODE = "rw"
 7831 	b = ORS
 7832 	ORS = ""
 7833 	ERRNO = ""
 7834 	print(d) > f
 7835 	if (ERRNO) {
 7836 		return ""
 7837 	}
 7838 	close(f)
 7839 	BINMODE = a
 7840 	ORS = b
 7841 	if (ERRNO) {
 7842 		return ""
 7843 	}
 7844 	return f
 7845 }
 7846 
 7847 #___________________________________________________________
 7848 function _wrfile1(f, d, a, b)
 7849 {
 7850 	##################################
 7851 	if (((f = _wfilerdnehnd(f)) == "") || (_filene(f) == "")) {
 7852 		ERRNO = "Filename error"
 7853 		return
 7854 	}
 7855 	a = BINMODE
 7856 	BINMODE = "rw"
 7857 	b = ORS
 7858 	ORS = ""
 7859 	ERRNO = ""
 7860 	print(d) > f
 7861 	if (ERRNO) {
 7862 		return ""
 7863 	}
 7864 	close(f)
 7865 	BINMODE = a
 7866 	ORS = b
 7867 	if (ERRNO) {
 7868 		return ""
 7869 	}
 7870 	return d
 7871 }
 7872 
 7873 #_______________________________________________________________________
 7874 function _yexport(p)
 7875 {
 7876 	#####################################################
 7877 	return _tframe("_yexport_i0", p)
 7878 }
 7879 
 7880 #_______________________________________________________________________
 7881 function _yexport_i0(p, p0, p1, p2)
 7882 {
 7883 	if (p in _tLOG) {
 7884 		return ("_ERRLOG: " _Zexparr(_tLOG[p]) "\n")
 7885 	}
 7886 	if (p in _tSTR) {
 7887 		p = _tSTR[p]
 7888 		gsub(/\x1B/, "\033;", p)
 7889 		gsub(/\x0A/, "\033:", p)
 7890 		return (p "\n")
 7891 	}
 7892 }
 7893 
 7894 #_________________________________________________________________
 7895 function cmp_str_idx(i1, v1, i2, v2)
 7896 {
 7897 	##############################
 7898 	return (i1 < i2 ? -1 : 1)
 7899 }
 7900 
 7901 #___________________________________________________________
 7902 function filedi(f, d)
 7903 {
 7904 	if ((f = filerdnehndi(f)) == "") {
 7905 		return _FILEIO_D
 7906 	}
 7907 	if (f in _FILEDIRFL) {
 7908 		return _FILEDIR[f]
 7909 	}
 7910 	if (f in _FILEROOT) {
 7911 		if ((d = filegetdrvdir(_FILEROOT[f]))) {
 7912 			_FILEDIRFL[f]
 7913 		}
 7914 		return (_FILEDIR[f] = d _FILEDIR[f])
 7915 	}
 7916 	if ((_FILEIO_RD, f) in _FILEDIR) {
 7917 		return _FILEDIR[_FILEIO_RD, f]
 7918 	}
 7919 	return (_FILEDIR[_FILEIO_RD, f] = _FILEIO_D _FILEDIR[f])
 7920 }
 7921 
 7922 #___________________________________________________________
 7923 function filegetdrvdir(t, r)
 7924 {
 7925 	if (t in _FILEDRV) {
 7926 		return _FILEDRV[t]
 7927 	}
 7928 	if (match(r = _cmd("cd " t " 2>NUL"), /[^\x00-\x1F]+/)) {
 7929 		r = gensub(/[ \t]*([\\\$\:])[ \t]*/, "\\1", "G", substr(r, RSTART, RLENGTH))
 7930 		gsub(/(^[ \t]*)|([ \t]*$)/, "", r)
 7931 		if (match(r, /\:(.*)/)) {
 7932 			return (_FILEDRV[tolower(t)] = _FILEDRV[toupper(t)] = substr(r, RSTART + 1) (r ~ /\\$/ ? "" : "\\"))
 7933 		}
 7934 	}
 7935 	return ""
 7936 }
 7937 
 7938 #___________________________________________________________
 7939 function filegetrootdir(f, dd, d)
 7940 {
 7941 	if (f in _FILEDIRFL) {
 7942 		if (f in _FILEROOT) {
 7943 			return (_FILEROOT[f] _FILEDIR[f])
 7944 		}
 7945 		if (((dd = dd ? dd : _FILEIO_RD), f) in _FILEROOT) {
 7946 			return (_FILEROOT[dd, f] _FILEDIR[f])
 7947 		}
 7948 		return (_FILEROOT[dd, f] = fileri(dd)) _FILEDIR[f]
 7949 	}
 7950 	if (f in _FILEROOT) {
 7951 		if ((d = filegetdrvdir(_FILEROOT[f]))) {
 7952 			_FILEDIRFL[f]
 7953 			return (_FILEROOT[f] (_FILEDIR[f] = d _FILEDIR[f]))
 7954 		} else {
 7955 			return (_FILEROOT[f] _FILEDIR[f])
 7956 		}
 7957 	}
 7958 	if (((dd = dd ? dd : _FILEIO_RD), f) in _FILEROOT) {
 7959 		if ((dd, f) in _FILEDIR) {
 7960 			return (_FILEROOT[dd, f] _FILEDIR[dd, f])
 7961 		}
 7962 		if ((d = filedi(dd) _FILEDIR[f]) ~ /^\\/) {
 7963 			return (_FILEROOT[dd, f] (_FILEDIR[dd, f] = d))
 7964 		}
 7965 		return (_FILEROOT[dd, f] d)
 7966 	}
 7967 	if ((dd, f) in _FILEDIR) {
 7968 		return (_FILEROOT[dd, f] = fileri(dd)) _FILEDIR[dd, f]
 7969 	}
 7970 	if ((d = filedi(dd) _FILEDIR[f]) ~ /^\\/) {
 7971 		return (_FILEROOT[dd, f] = fileri(dd)) (_FILEDIR[dd, f] = d)
 7972 	}
 7973 	return (_FILEROOT[dd, f] = fileri(dd)) d
 7974 }
 7975 
 7976 #___________________________________________________________
 7977 function filerdnehndi(st, a, c, r, d, n, A)
 7978 {
 7979 	if (st) {
 7980 		if ((c = toupper(st)) in _FILECACHE) {
 7981 			return _FILECACHE[c]
 7982 		}
 7983 		if (match(st, /^[ \t]*\\[ \t]*\\/)) {
 7984 			if (match(substr(st, a = RLENGTH + 1), /^[ \t]*([0-9A-Za-z\-]+)[ \t]*(\\[ \t]*([A-Za-z])[ \t]*\$[ \t]*)?(\\[ \t]*([0-9A-Za-z_\!\+\-\[\]\(\)\{\}\~\.]+( +[0-9A-Za-z_\!\+\-\[\]\(\)\{\}\~\.]+)*[ \t]*\\)*[ \t]*)?(([0-9A-Za-z_\!\+\.\~\-\[\]\{\}\(\)]+( +[0-9A-Za-z_\!\+\.\~\-\[\]\{\}\(\)]+)*)[ \t]*)?/, A)) {
 7985 				a = a + RLENGTH
 7986 				d = (A[3] ? ("\\" A[3] "$") : "") "\\" A[5]
 7987 				gsub(/[ \t]*\\[ \t]*/, "\\", d)
 7988 				if ((st = toupper((r = "\\\\" A[1]) d (n = A[8]))) in _FILECACHE) {
 7989 					return (_FILECACHE[substr(c, 1, a)] = _FILECACHE[st])
 7990 				}
 7991 				_FILEDIR[c = _FILECACHE[substr(c, 1, a)] = _FILECACHE[st] = ++_file_rootcntr] = d
 7992 				_FILEDIRFL[c]
 7993 				_FILEROOT[c] = r
 7994 			} else {
 7995 				_filepath_err = "UNC"
 7996 				return ""
 7997 			}
 7998 		} else {
 7999 			match(st, /^(([ \t]*\.[ \t]*\\[ \t]*)|(([ \t]*([A-Za-z])[ \t]*(\:)[ \t]*)?([ \t]*(\\)[ \t]*)?))([ \t]*(([ \t]*[0-9A-Za-z_\!\+\-\[\]\(\)\{\}\~\.]+( +[0-9A-Za-z_\!\+\-\[\]\(\)\{\}\~\.]+)*[ \t]*\\)+)[ \t]*)?([ \t]*([0-9A-Za-z_\!\+\.\~\-\[\]\{\}\(\)]+( +[0-9A-Za-z_\!\+\.\~\-\[\]\{\}\(\)]+)*)[ \t]*)?/, A)
 8000 			if (! RLENGTH) {
 8001 				return ""
 8002 			}
 8003 			d = A[8] A[10]
 8004 			gsub(/[ \t]*\\[ \t]*/, "\\", d)
 8005 			if ((st = toupper((r = A[5] A[6]) d (n = A[14]))) in _FILECACHE) {
 8006 				return (_FILECACHE[substr(c, 1, RLENGTH)] = _FILECACHE[st])
 8007 			}
 8008 			_FILEDIR[c = _FILECACHE[substr(c, 1, RLENGTH)] = _FILECACHE[st] = ++_file_rootcntr] = d
 8009 			if (A[8]) {
 8010 				_FILEDIRFL[c]
 8011 			}
 8012 			if (r) {
 8013 				_FILEROOT[c] = r
 8014 			}
 8015 		}
 8016 		if (n) {
 8017 			if (match(n, /\.[^\.]*$/)) {
 8018 				_FILEXT[c] = substr(n, RSTART)
 8019 				_FILENAM[c] = substr(n, 1, RSTART - 1)
 8020 			} else {
 8021 				_FILENAM[c] = n
 8022 			}
 8023 		}
 8024 		return c
 8025 	}
 8026 	return ""
 8027 }
 8028 
 8029 #_____________________________________________________
 8030 function fileri(f)
 8031 {
 8032 	if ((f = filerdnehndi(f)) == "") {
 8033 		return _FILEIO_R
 8034 	}
 8035 	if (f in _FILEROOT) {
 8036 		return _FILEROOT[f]
 8037 	}
 8038 	if ((_FILEIO_RD, f) in _FILEROOT) {
 8039 		return _FILEROOT[_FILEIO_RD, f]
 8040 	}
 8041 	return (_FILEROOT[_FILEIO_RD, f] = _FILEIO_R)
 8042 }
 8043 
 8044 function hujf(a, b, c)
 8045 {
 8046 	_conl("hujf(" a "," b "," c ")")
 8047 }
 8048 
 8049 #___________________________________________________________
 8050 function ncmp_str_idx(i1, v1, i2, v2)
 8051 {
 8052 	#######################
 8053 	return (i1 < i2 ? 1 : -1)
 8054 }
 8055 
 8056 function test_cfg(p, z, AA0, a)
 8057 {
 8058 	AA0[1]
 8059 	_fclass = _cfguid(p = _getuid(_classys), _NOP, _NOP, _NOP, _NOP, _classys)
 8060 	_conl()
 8061 	_conline()
 8062 	_conl()
 8063 	_drawuid(p)
 8064 	_fclass = _cfguid(p = _getuid(_classys), AA0, AA0, AA0, AA0, _classys)
 8065 	_conl()
 8066 	_conline()
 8067 	_conl()
 8068 	_drawuid(p)
 8069 	a = _getuid(z = _fclass = _cfguid(p = _getuid(_classys), p, "<", ">", "ab", "cd"))
 8070 	_conl("### " a "########")
 8071 	_conline()
 8072 	_conl()
 8073 	_drawuid(p)
 8074 	a = _getuid(_fclass = _cfguid(p = _getuid(_classys), z, 0, 0, _NOP, z))
 8075 	_conl("### " a "########")
 8076 	_conline()
 8077 	_conl()
 8078 	_drawuid(p)
 8079 	a = _getuid(_fclass = _cfguid(p = _getuid(_classys), z, "^", "$", z, _classys))
 8080 	_conl("### " a "########")
 8081 	_conline()
 8082 	_conl()
 8083 	_drawuid(p)
 8084 	_fclass = _cfguid(p = _getuid(_classys), "oblptr", "pfx", "sfx", "abcd")
 8085 	_conl()
 8086 	_conline()
 8087 	_conl()
 8088 	_drawuid(p)
 8089 	_conl("```````````````````" z "'''''''''" (_isptr(z) ? " ptr" : " not ptr"))
 8090 	_drawuid(z)
 8091 }
 8092 
 8093 function test_splitstr(A)
 8094 {
 8095 	AA0[-1] = "huj"
 8096 	AA0["A"] = "pizda"
 8097 	AA0[1] = "zhopa"
 8098 	delete AB0[AB0[""] = ""]
 8099 	AC0[-1] = "HUJ"
 8100 	AC0["A"] = "PIZDA"
 8101 	AC0[1] = "ZHOPA"
 8102 	_SPLITSTRB0["1"]
 8103 	wonl = ""
 8104 	_tstv(0, A, 0, "_tstv")
 8105 	_conl(wonl)
 8106 	_wrfile("wonl.out", wonl)
 8107 }
 8108 
 8109 function test_uid(p, i)
 8110 {
 8111 	#test_cfg()
 8112 	#return
 8113 	_fclass = _cfguid(p = _getuid(_classys), p, "pfx", "sfx", "abc")
 8114 	#_fclass=_cfguid(p=_getuid(_classys),_NOP,_NOP,_NOP,"",_classys)
 8115 	_conl("_fclass uid: " _getuid(_fclass))
 8116 	_drawuid(_fclass)
 8117 	_conl("_classys uid: " _getuid(_classys)) _drawuid(_classys)
 8118 	for (i = 1; i < 81; i++) {
 8119 		_conl(i ": " _getuid(_fclass))
 8120 	}
 8121 	_drawuid(_fclass)
 8122 }
 8123 
 8124 function tst_splitstr(t, A, R, r)
 8125 {
 8126 	delete A
 8127 	A["not cleared"]
 8128 	_wonl()
 8129 	_wonline("_splitstr(" (isarray(t) ? "ARR" (length(t) > 0 ? "#" (t[1] != "zhopa" ? "U" : "l") : "") : _val0(t)) ",A" (isarray(R) ? ",        ARR" (length(R) > 0 ? "#" (R[1] != "zhopa" ? "U" : "l") : "") : ",        " _val0(R)) "):")
 8130 	_wonl(_val0(r = _splitstr(t, A, R)))
 8131 	_wonl("arrary A:")
 8132 	_wonl(_dumparr(A))
 8133 	return r
 8134 }
 8135 
 8136 function tts(p, uidel, psfx, cnt, chr, p5, p6, p7, im)
 8137 {
 8138 	im = "     "
 8139 	im = ".. .."
 8140 	_conl("ret:   " _qparam(im, p, uidel, psfx, cnt, chr, p5, p6, p7) "'")
 8141 	_conl("mask: `" _qparamask "'")
 8142 }
 8143 
 8144 #			#		- p is array
 8145 #			`		- p is ptr detected in array _CLASSPTR(for _typ); or p is ptr detected in array A(for _typa)
 8146 #			0		- p is undefined
 8147 
 8148 #			2		- p is string==""
 8149 #			3		- p is string!=""
 8150 #			4		- p is number 0
 8151 #			5		- p is any number except 0(positive and negative)
 8152 
 8153 # str:			_typ(p)+0		!_typ(p)+0
 8154 # str/ptr			_typ(p)>0		_typ(p)<1
 8155 # str/arr			"`">_typ(p0) && _t0
 8156 # str/ptr/arr		_typ(p)		!_typ(p)
 8157 # ptr				_typ(p)=="`"	_typ(p)<"`"  ?
 8158 # ptr/arr			_typ(p)+0!=_t0
 8159 # arr				_typ(p)=="#"	_typ(p)>"#"  ?
 8160 function zorr(A, i, r)
 8161 {
 8162 	if (i in A) {
 8163 		_conl("`" i "' in A")
 8164 	} else {
 8165 		_conl("`" i "' not in A")
 8166 	}
 8167 	r = A[i] == "" && A[i] == 0
 8168 	_conl("A[" i "] status is " r)
 8169 	return
 8170 	a = a + -a
 8171 	_conl("``````````````" a "''''''''''''''''")
 8172 }
 8173 
 8174 #_____________________________________________________________________________
 8175 function zzer()
 8176 {
 8177 	################################################################
 8178 }
 8179 gawk: profile5.awk:3278: warning: regexp escape sequence `\~' is not a known regexp operator
 8180 gawk: profile5.awk:3601: warning: regexp escape sequence `\!' is not a known regexp operator
 8181 gawk: profile5.awk:3610: warning: regexp escape sequence `\:' is not a known regexp operator
 8182 gawk: profile5.awk:3742: warning: regexp escape sequence `\,' is not a known regexp operator