aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2013-07-30 14:26:50 -0400
committerArnold D. Robbins <arnold@skeeve.com>2013-08-14 00:00:19 +0300
commitafc5c481f97b85b803b9b973d52684deceb715d0 (patch)
treea0915082f5e3d2e8a8a8fafba3d0ee160e362417
parent15a922b8a62092fab8b0e9b9fa06c3182b38b596 (diff)
downloadegawk-afc5c481f97b85b803b9b973d52684deceb715d0.tar.gz
egawk-afc5c481f97b85b803b9b973d52684deceb715d0.tar.bz2
egawk-afc5c481f97b85b803b9b973d52684deceb715d0.zip
Start new branch that adds comments to profiling.
-rw-r--r--ChangeLog13
-rw-r--r--awk.h1
-rw-r--r--awkgram.c462
-rw-r--r--awkgram.y80
-rw-r--r--debug.c1
-rw-r--r--eval.c1
-rw-r--r--extension/ChangeLog4
-rw-r--r--interpret.h1
-rw-r--r--profile.c22
-rw-r--r--test/profile2.ok21
-rw-r--r--test/profile5.ok1420
11 files changed, 1813 insertions, 213 deletions
diff --git a/ChangeLog b/ChangeLog
index daa80052..e53b21c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2013-07-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (enum opcodeval): Add Op_comment.
+ * awkgram.y (comment): New variable to hold comment text.
+ (statement): Add saved comments to lists being built.
+ (allow_newline): Save comment text if necessary. Append if have
+ existing text.
+ (yylex): Ditto.
+ * debug.c (print_instruction): Handle Op_comment.
+ * eval.c (optypes): Add entry for Op_comment.
+ * interpret.h (r_interpret): Ditto.
+ * profile.c (pprint): For Op_comment, print the comment text.
+
2013-07-24 Arnold D. Robbins <arnold@skeeve.com>
* io.c (FAKE_FD_VALUE): Move definition from here ...
diff --git a/awk.h b/awk.h
index e01726d9..7b8761cd 100644
--- a/awk.h
+++ b/awk.h
@@ -679,6 +679,7 @@ typedef enum opcodeval {
Op_func,
+ Op_comment, /* for pretty printing */
Op_exec_count,
Op_breakpoint,
Op_lint,
diff --git a/awkgram.c b/awkgram.c
index 947f4a30..d087b140 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -187,6 +187,8 @@ static INSTRUCTION *ip_end;
static INSTRUCTION *ip_endfile;
static INSTRUCTION *ip_beginfile;
+static INSTRUCTION *comment = NULL;
+
static inline INSTRUCTION *list_create(INSTRUCTION *x);
static inline INSTRUCTION *list_append(INSTRUCTION *l, INSTRUCTION *x);
static inline INSTRUCTION *list_prepend(INSTRUCTION *l, INSTRUCTION *x);
@@ -199,7 +201,7 @@ extern double fmod(double x, double y);
#define is_identchar(c) (isalnum(c) || (c) == '_')
/* Line 371 of yacc.c */
-#line 203 "awkgram.c"
+#line 205 "awkgram.c"
# ifndef YY_NULL
# if defined __cplusplus && 201103L <= __cplusplus
@@ -368,7 +370,7 @@ int yyparse ();
/* Copy the second part of user declarations. */
/* Line 390 of yacc.c */
-#line 372 "awkgram.c"
+#line 374 "awkgram.c"
#ifdef short
# undef short
@@ -744,25 +746,25 @@ static const yytype_int16 yyrhs[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 200, 200, 202, 207, 208, 214, 226, 230, 241,
- 247, 252, 260, 268, 270, 275, 283, 285, 291, 292,
- 294, 320, 331, 342, 348, 357, 367, 369, 371, 377,
- 382, 383, 387, 406, 405, 439, 441, 446, 447, 460,
- 465, 466, 470, 472, 474, 481, 571, 613, 655, 768,
- 775, 782, 792, 801, 810, 819, 830, 846, 845, 869,
- 881, 881, 979, 979, 1012, 1042, 1048, 1049, 1055, 1056,
- 1063, 1068, 1080, 1094, 1096, 1104, 1109, 1111, 1119, 1121,
- 1130, 1131, 1139, 1144, 1144, 1155, 1159, 1167, 1168, 1171,
- 1173, 1178, 1179, 1188, 1189, 1194, 1199, 1205, 1207, 1209,
- 1216, 1217, 1223, 1224, 1229, 1231, 1236, 1238, 1246, 1251,
- 1260, 1267, 1269, 1271, 1287, 1297, 1304, 1306, 1311, 1313,
- 1315, 1323, 1325, 1330, 1332, 1337, 1339, 1341, 1391, 1393,
- 1395, 1397, 1399, 1401, 1403, 1405, 1428, 1433, 1438, 1463,
- 1469, 1471, 1473, 1475, 1477, 1479, 1484, 1488, 1520, 1522,
- 1528, 1534, 1547, 1548, 1549, 1554, 1559, 1563, 1567, 1582,
- 1595, 1600, 1636, 1654, 1655, 1661, 1662, 1667, 1669, 1676,
- 1693, 1710, 1712, 1719, 1724, 1732, 1742, 1754, 1763, 1767,
- 1771, 1775, 1779, 1783, 1786, 1788, 1792, 1796, 1800
+ 0, 202, 202, 204, 209, 210, 216, 228, 232, 243,
+ 249, 254, 262, 270, 272, 277, 285, 287, 293, 294,
+ 296, 322, 333, 344, 350, 359, 369, 371, 373, 379,
+ 384, 385, 389, 408, 407, 441, 443, 448, 449, 472,
+ 477, 478, 482, 484, 486, 493, 583, 625, 667, 780,
+ 787, 794, 804, 813, 822, 831, 842, 858, 857, 881,
+ 893, 893, 991, 991, 1024, 1054, 1060, 1061, 1067, 1068,
+ 1075, 1080, 1092, 1106, 1108, 1116, 1121, 1123, 1131, 1133,
+ 1142, 1143, 1151, 1156, 1156, 1167, 1171, 1179, 1180, 1183,
+ 1185, 1190, 1191, 1200, 1201, 1206, 1211, 1217, 1219, 1221,
+ 1228, 1229, 1235, 1236, 1241, 1243, 1248, 1250, 1258, 1263,
+ 1272, 1279, 1281, 1283, 1299, 1309, 1316, 1318, 1323, 1325,
+ 1327, 1335, 1337, 1342, 1344, 1349, 1351, 1353, 1403, 1405,
+ 1407, 1409, 1411, 1413, 1415, 1417, 1440, 1445, 1450, 1475,
+ 1481, 1483, 1485, 1487, 1489, 1491, 1496, 1500, 1532, 1534,
+ 1540, 1546, 1559, 1560, 1561, 1566, 1571, 1575, 1579, 1594,
+ 1607, 1612, 1648, 1666, 1667, 1673, 1674, 1679, 1681, 1688,
+ 1705, 1722, 1724, 1731, 1736, 1744, 1754, 1766, 1775, 1779,
+ 1783, 1787, 1791, 1795, 1798, 1800, 1804, 1808, 1812
};
#endif
@@ -2049,7 +2051,7 @@ yyreduce:
{
case 3:
/* Line 1787 of yacc.c */
-#line 203 "awkgram.y"
+#line 205 "awkgram.y"
{
rule = 0;
yyerrok;
@@ -2058,7 +2060,7 @@ yyreduce:
case 5:
/* Line 1787 of yacc.c */
-#line 209 "awkgram.y"
+#line 211 "awkgram.y"
{
next_sourcefile();
if (sourcefile == srcfiles)
@@ -2068,7 +2070,7 @@ yyreduce:
case 6:
/* Line 1787 of yacc.c */
-#line 215 "awkgram.y"
+#line 217 "awkgram.y"
{
rule = 0;
/*
@@ -2081,7 +2083,7 @@ yyreduce:
case 7:
/* Line 1787 of yacc.c */
-#line 227 "awkgram.y"
+#line 229 "awkgram.y"
{
(void) append_rule((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]));
}
@@ -2089,7 +2091,7 @@ yyreduce:
case 8:
/* Line 1787 of yacc.c */
-#line 231 "awkgram.y"
+#line 233 "awkgram.y"
{
if (rule != Rule) {
msg(_("%s blocks must have an action part"), ruletab[rule]);
@@ -2104,7 +2106,7 @@ yyreduce:
case 9:
/* Line 1787 of yacc.c */
-#line 242 "awkgram.y"
+#line 244 "awkgram.y"
{
in_function = NULL;
(void) mk_function((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]));
@@ -2114,7 +2116,7 @@ yyreduce:
case 10:
/* Line 1787 of yacc.c */
-#line 248 "awkgram.y"
+#line 250 "awkgram.y"
{
want_source = false;
yyerrok;
@@ -2123,7 +2125,7 @@ yyreduce:
case 11:
/* Line 1787 of yacc.c */
-#line 253 "awkgram.y"
+#line 255 "awkgram.y"
{
want_source = false;
yyerrok;
@@ -2132,7 +2134,7 @@ yyreduce:
case 12:
/* Line 1787 of yacc.c */
-#line 261 "awkgram.y"
+#line 263 "awkgram.y"
{
if (include_source((yyvsp[(1) - (1)])) < 0)
YYABORT;
@@ -2144,19 +2146,19 @@ yyreduce:
case 13:
/* Line 1787 of yacc.c */
-#line 269 "awkgram.y"
+#line 271 "awkgram.y"
{ (yyval) = NULL; }
break;
case 14:
/* Line 1787 of yacc.c */
-#line 271 "awkgram.y"
+#line 273 "awkgram.y"
{ (yyval) = NULL; }
break;
case 15:
/* Line 1787 of yacc.c */
-#line 276 "awkgram.y"
+#line 278 "awkgram.y"
{
if (load_library((yyvsp[(1) - (1)])) < 0)
YYABORT;
@@ -2168,31 +2170,31 @@ yyreduce:
case 16:
/* Line 1787 of yacc.c */
-#line 284 "awkgram.y"
+#line 286 "awkgram.y"
{ (yyval) = NULL; }
break;
case 17:
/* Line 1787 of yacc.c */
-#line 286 "awkgram.y"
+#line 288 "awkgram.y"
{ (yyval) = NULL; }
break;
case 18:
/* Line 1787 of yacc.c */
-#line 291 "awkgram.y"
+#line 293 "awkgram.y"
{ (yyval) = NULL; rule = Rule; }
break;
case 19:
/* Line 1787 of yacc.c */
-#line 293 "awkgram.y"
+#line 295 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); rule = Rule; }
break;
case 20:
/* Line 1787 of yacc.c */
-#line 295 "awkgram.y"
+#line 297 "awkgram.y"
{
INSTRUCTION *tp;
@@ -2222,7 +2224,7 @@ yyreduce:
case 21:
/* Line 1787 of yacc.c */
-#line 321 "awkgram.y"
+#line 323 "awkgram.y"
{
static int begin_seen = 0;
if (do_lint_old && ++begin_seen == 2)
@@ -2237,7 +2239,7 @@ yyreduce:
case 22:
/* Line 1787 of yacc.c */
-#line 332 "awkgram.y"
+#line 334 "awkgram.y"
{
static int end_seen = 0;
if (do_lint_old && ++end_seen == 2)
@@ -2252,7 +2254,7 @@ yyreduce:
case 23:
/* Line 1787 of yacc.c */
-#line 343 "awkgram.y"
+#line 345 "awkgram.y"
{
(yyvsp[(1) - (1)])->in_rule = rule = BEGINFILE;
(yyvsp[(1) - (1)])->source_file = source;
@@ -2262,7 +2264,7 @@ yyreduce:
case 24:
/* Line 1787 of yacc.c */
-#line 349 "awkgram.y"
+#line 351 "awkgram.y"
{
(yyvsp[(1) - (1)])->in_rule = rule = ENDFILE;
(yyvsp[(1) - (1)])->source_file = source;
@@ -2272,7 +2274,7 @@ yyreduce:
case 25:
/* Line 1787 of yacc.c */
-#line 358 "awkgram.y"
+#line 360 "awkgram.y"
{
if ((yyvsp[(2) - (5)]) == NULL)
(yyval) = list_create(instruction(Op_no_op));
@@ -2283,19 +2285,19 @@ yyreduce:
case 26:
/* Line 1787 of yacc.c */
-#line 368 "awkgram.y"
+#line 370 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 27:
/* Line 1787 of yacc.c */
-#line 370 "awkgram.y"
+#line 372 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 28:
/* Line 1787 of yacc.c */
-#line 372 "awkgram.y"
+#line 374 "awkgram.y"
{
yyerror(_("`%s' is a built-in function, it cannot be redefined"),
tokstart);
@@ -2305,13 +2307,13 @@ yyreduce:
case 29:
/* Line 1787 of yacc.c */
-#line 378 "awkgram.y"
+#line 380 "awkgram.y"
{ (yyval) = (yyvsp[(2) - (2)]); }
break;
case 32:
/* Line 1787 of yacc.c */
-#line 388 "awkgram.y"
+#line 390 "awkgram.y"
{
(yyvsp[(1) - (6)])->source_file = source;
if (install_function((yyvsp[(2) - (6)])->lextok, (yyvsp[(1) - (6)]), (yyvsp[(4) - (6)])) < 0)
@@ -2326,13 +2328,13 @@ yyreduce:
case 33:
/* Line 1787 of yacc.c */
-#line 406 "awkgram.y"
+#line 408 "awkgram.y"
{ want_regexp = true; }
break;
case 34:
/* Line 1787 of yacc.c */
-#line 408 "awkgram.y"
+#line 410 "awkgram.y"
{
NODE *n, *exp;
char *re;
@@ -2365,54 +2367,64 @@ yyreduce:
case 35:
/* Line 1787 of yacc.c */
-#line 440 "awkgram.y"
+#line 442 "awkgram.y"
{ bcfree((yyvsp[(1) - (1)])); }
break;
case 37:
/* Line 1787 of yacc.c */
-#line 446 "awkgram.y"
+#line 448 "awkgram.y"
{ (yyval) = NULL; }
break;
case 38:
/* Line 1787 of yacc.c */
-#line 448 "awkgram.y"
+#line 450 "awkgram.y"
{
- if ((yyvsp[(2) - (2)]) == NULL)
- (yyval) = (yyvsp[(1) - (2)]);
- else {
- add_lint((yyvsp[(2) - (2)]), LINT_no_effect);
- if ((yyvsp[(1) - (2)]) == NULL)
- (yyval) = (yyvsp[(2) - (2)]);
+ if ((yyvsp[(2) - (2)]) == NULL) {
+ if (comment == NULL)
+ (yyval) = (yyvsp[(1) - (2)]);
else
+ (yyval) = list_prepend((yyvsp[(1) - (2)]), comment);
+ } else {
+ add_lint((yyvsp[(2) - (2)]), LINT_no_effect);
+ if ((yyvsp[(1) - (2)]) == NULL) {
+ if (comment == NULL)
+ (yyval) = (yyvsp[(2) - (2)]);
+ else
+ (yyval) = list_prepend((yyvsp[(2) - (2)]), comment);
+ } else {
+ if (comment != NULL)
+ list_append((yyvsp[(1) - (2)]), comment);
(yyval) = list_merge((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]));
+ }
}
- yyerrok;
+ comment = NULL;
+ yyerrok;
}
break;
case 39:
/* Line 1787 of yacc.c */
-#line 461 "awkgram.y"
+#line 473 "awkgram.y"
{ (yyval) = NULL; }
break;
case 42:
/* Line 1787 of yacc.c */
-#line 471 "awkgram.y"
+#line 483 "awkgram.y"
{ (yyval) = NULL; }
break;
case 43:
/* Line 1787 of yacc.c */
-#line 473 "awkgram.y"
+#line 485 "awkgram.y"
{ (yyval) = (yyvsp[(2) - (3)]); }
break;
case 44:
/* Line 1787 of yacc.c */
-#line 475 "awkgram.y"
+#line 487 "awkgram.y"
{
if (do_pretty_print)
(yyval) = list_prepend((yyvsp[(1) - (1)]), instruction(Op_exec_count));
@@ -2423,7 +2435,7 @@ yyreduce:
case 45:
/* Line 1787 of yacc.c */
-#line 482 "awkgram.y"
+#line 494 "awkgram.y"
{
INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt;
INSTRUCTION *ip, *nextc, *tbreak;
@@ -2517,7 +2529,7 @@ yyreduce:
case 46:
/* Line 1787 of yacc.c */
-#line 572 "awkgram.y"
+#line 584 "awkgram.y"
{
/*
* -----------------
@@ -2563,7 +2575,7 @@ yyreduce:
case 47:
/* Line 1787 of yacc.c */
-#line 614 "awkgram.y"
+#line 626 "awkgram.y"
{
/*
* -----------------
@@ -2609,7 +2621,7 @@ yyreduce:
case 48:
/* Line 1787 of yacc.c */
-#line 656 "awkgram.y"
+#line 668 "awkgram.y"
{
INSTRUCTION *ip;
char *var_name = (yyvsp[(3) - (8)])->lextok;
@@ -2726,7 +2738,7 @@ regular_loop:
case 49:
/* Line 1787 of yacc.c */
-#line 769 "awkgram.y"
+#line 781 "awkgram.y"
{
(yyval) = mk_for_loop((yyvsp[(1) - (12)]), (yyvsp[(3) - (12)]), (yyvsp[(6) - (12)]), (yyvsp[(9) - (12)]), (yyvsp[(12) - (12)]));
@@ -2737,7 +2749,7 @@ regular_loop:
case 50:
/* Line 1787 of yacc.c */
-#line 776 "awkgram.y"
+#line 788 "awkgram.y"
{
(yyval) = mk_for_loop((yyvsp[(1) - (11)]), (yyvsp[(3) - (11)]), (INSTRUCTION *) NULL, (yyvsp[(8) - (11)]), (yyvsp[(11) - (11)]));
@@ -2748,7 +2760,7 @@ regular_loop:
case 51:
/* Line 1787 of yacc.c */
-#line 783 "awkgram.y"
+#line 795 "awkgram.y"
{
if (do_pretty_print)
(yyval) = list_prepend((yyvsp[(1) - (1)]), instruction(Op_exec_count));
@@ -2759,7 +2771,7 @@ regular_loop:
case 52:
/* Line 1787 of yacc.c */
-#line 793 "awkgram.y"
+#line 805 "awkgram.y"
{
if (! break_allowed)
error_ln((yyvsp[(1) - (2)])->source_line,
@@ -2772,7 +2784,7 @@ regular_loop:
case 53:
/* Line 1787 of yacc.c */
-#line 802 "awkgram.y"
+#line 814 "awkgram.y"
{
if (! continue_allowed)
error_ln((yyvsp[(1) - (2)])->source_line,
@@ -2785,7 +2797,7 @@ regular_loop:
case 54:
/* Line 1787 of yacc.c */
-#line 811 "awkgram.y"
+#line 823 "awkgram.y"
{
/* if inside function (rule = 0), resolve context at run-time */
if (rule && rule != Rule)
@@ -2798,7 +2810,7 @@ regular_loop:
case 55:
/* Line 1787 of yacc.c */
-#line 820 "awkgram.y"
+#line 832 "awkgram.y"
{
/* if inside function (rule = 0), resolve context at run-time */
if (rule == BEGIN || rule == END || rule == ENDFILE)
@@ -2813,7 +2825,7 @@ regular_loop:
case 56:
/* Line 1787 of yacc.c */
-#line 831 "awkgram.y"
+#line 843 "awkgram.y"
{
/* Initialize the two possible jump targets, the actual target
* is resolved at run-time.
@@ -2832,7 +2844,7 @@ regular_loop:
case 57:
/* Line 1787 of yacc.c */
-#line 846 "awkgram.y"
+#line 858 "awkgram.y"
{
if (! in_function)
yyerror(_("`return' used outside function context"));
@@ -2841,7 +2853,7 @@ regular_loop:
case 58:
/* Line 1787 of yacc.c */
-#line 849 "awkgram.y"
+#line 861 "awkgram.y"
{
if ((yyvsp[(3) - (4)]) == NULL) {
(yyval) = list_create((yyvsp[(1) - (4)]));
@@ -2866,13 +2878,13 @@ regular_loop:
case 60:
/* Line 1787 of yacc.c */
-#line 881 "awkgram.y"
+#line 893 "awkgram.y"
{ in_print = true; in_parens = 0; }
break;
case 61:
/* Line 1787 of yacc.c */
-#line 882 "awkgram.y"
+#line 894 "awkgram.y"
{
/*
* Optimization: plain `print' has no expression list, so $3 is null.
@@ -2973,13 +2985,13 @@ regular_print:
case 62:
/* Line 1787 of yacc.c */
-#line 979 "awkgram.y"
+#line 991 "awkgram.y"
{ sub_counter = 0; }
break;
case 63:
/* Line 1787 of yacc.c */
-#line 980 "awkgram.y"
+#line 992 "awkgram.y"
{
char *arr = (yyvsp[(2) - (4)])->lextok;
@@ -3016,7 +3028,7 @@ regular_print:
case 64:
/* Line 1787 of yacc.c */
-#line 1017 "awkgram.y"
+#line 1029 "awkgram.y"
{
static bool warned = false;
char *arr = (yyvsp[(3) - (4)])->lextok;
@@ -3046,31 +3058,31 @@ regular_print:
case 65:
/* Line 1787 of yacc.c */
-#line 1043 "awkgram.y"
+#line 1055 "awkgram.y"
{ (yyval) = optimize_assignment((yyvsp[(1) - (1)])); }
break;
case 66:
/* Line 1787 of yacc.c */
-#line 1048 "awkgram.y"
+#line 1060 "awkgram.y"
{ (yyval) = NULL; }
break;
case 67:
/* Line 1787 of yacc.c */
-#line 1050 "awkgram.y"
+#line 1062 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 68:
/* Line 1787 of yacc.c */
-#line 1055 "awkgram.y"
+#line 1067 "awkgram.y"
{ (yyval) = NULL; }
break;
case 69:
/* Line 1787 of yacc.c */
-#line 1057 "awkgram.y"
+#line 1069 "awkgram.y"
{
if ((yyvsp[(1) - (2)]) == NULL)
(yyval) = list_create((yyvsp[(2) - (2)]));
@@ -3081,13 +3093,13 @@ regular_print:
case 70:
/* Line 1787 of yacc.c */
-#line 1064 "awkgram.y"
+#line 1076 "awkgram.y"
{ (yyval) = NULL; }
break;
case 71:
/* Line 1787 of yacc.c */
-#line 1069 "awkgram.y"
+#line 1081 "awkgram.y"
{
INSTRUCTION *casestmt = (yyvsp[(5) - (5)]);
if ((yyvsp[(5) - (5)]) == NULL)
@@ -3103,7 +3115,7 @@ regular_print:
case 72:
/* Line 1787 of yacc.c */
-#line 1081 "awkgram.y"
+#line 1093 "awkgram.y"
{
INSTRUCTION *casestmt = (yyvsp[(4) - (4)]);
if ((yyvsp[(4) - (4)]) == NULL)
@@ -3118,13 +3130,13 @@ regular_print:
case 73:
/* Line 1787 of yacc.c */
-#line 1095 "awkgram.y"
+#line 1107 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 74:
/* Line 1787 of yacc.c */
-#line 1097 "awkgram.y"
+#line 1109 "awkgram.y"
{
NODE *n = (yyvsp[(2) - (2)])->memory;
(void) force_number(n);
@@ -3136,7 +3148,7 @@ regular_print:
case 75:
/* Line 1787 of yacc.c */
-#line 1105 "awkgram.y"
+#line 1117 "awkgram.y"
{
bcfree((yyvsp[(1) - (2)]));
(yyval) = (yyvsp[(2) - (2)]);
@@ -3145,13 +3157,13 @@ regular_print:
case 76:
/* Line 1787 of yacc.c */
-#line 1110 "awkgram.y"
+#line 1122 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 77:
/* Line 1787 of yacc.c */
-#line 1112 "awkgram.y"
+#line 1124 "awkgram.y"
{
(yyvsp[(1) - (1)])->opcode = Op_push_re;
(yyval) = (yyvsp[(1) - (1)]);
@@ -3160,19 +3172,19 @@ regular_print:
case 78:
/* Line 1787 of yacc.c */
-#line 1120 "awkgram.y"
+#line 1132 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 79:
/* Line 1787 of yacc.c */
-#line 1122 "awkgram.y"
+#line 1134 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 81:
/* Line 1787 of yacc.c */
-#line 1132 "awkgram.y"
+#line 1144 "awkgram.y"
{
(yyval) = (yyvsp[(2) - (3)]);
}
@@ -3180,7 +3192,7 @@ regular_print:
case 82:
/* Line 1787 of yacc.c */
-#line 1139 "awkgram.y"
+#line 1151 "awkgram.y"
{
in_print = false;
in_parens = 0;
@@ -3190,13 +3202,13 @@ regular_print:
case 83:
/* Line 1787 of yacc.c */
-#line 1144 "awkgram.y"
+#line 1156 "awkgram.y"
{ in_print = false; in_parens = 0; }
break;
case 84:
/* Line 1787 of yacc.c */
-#line 1145 "awkgram.y"
+#line 1157 "awkgram.y"
{
if ((yyvsp[(1) - (3)])->redir_type == redirect_twoway
&& (yyvsp[(3) - (3)])->lasti->opcode == Op_K_getline_redir
@@ -3208,7 +3220,7 @@ regular_print:
case 85:
/* Line 1787 of yacc.c */
-#line 1156 "awkgram.y"
+#line 1168 "awkgram.y"
{
(yyval) = mk_condition((yyvsp[(3) - (6)]), (yyvsp[(1) - (6)]), (yyvsp[(6) - (6)]), NULL, NULL);
}
@@ -3216,7 +3228,7 @@ regular_print:
case 86:
/* Line 1787 of yacc.c */
-#line 1161 "awkgram.y"
+#line 1173 "awkgram.y"
{
(yyval) = mk_condition((yyvsp[(3) - (9)]), (yyvsp[(1) - (9)]), (yyvsp[(6) - (9)]), (yyvsp[(7) - (9)]), (yyvsp[(9) - (9)]));
}
@@ -3224,13 +3236,13 @@ regular_print:
case 91:
/* Line 1787 of yacc.c */
-#line 1178 "awkgram.y"
+#line 1190 "awkgram.y"
{ (yyval) = NULL; }
break;
case 92:
/* Line 1787 of yacc.c */
-#line 1180 "awkgram.y"
+#line 1192 "awkgram.y"
{
bcfree((yyvsp[(1) - (2)]));
(yyval) = (yyvsp[(2) - (2)]);
@@ -3239,19 +3251,19 @@ regular_print:
case 93:
/* Line 1787 of yacc.c */
-#line 1188 "awkgram.y"
+#line 1200 "awkgram.y"
{ (yyval) = NULL; }
break;
case 94:
/* Line 1787 of yacc.c */
-#line 1190 "awkgram.y"
+#line 1202 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]) ; }
break;
case 95:
/* Line 1787 of yacc.c */
-#line 1195 "awkgram.y"
+#line 1207 "awkgram.y"
{
(yyvsp[(1) - (1)])->param_count = 0;
(yyval) = list_create((yyvsp[(1) - (1)]));
@@ -3260,7 +3272,7 @@ regular_print:
case 96:
/* Line 1787 of yacc.c */
-#line 1200 "awkgram.y"
+#line 1212 "awkgram.y"
{
(yyvsp[(3) - (3)])->param_count = (yyvsp[(1) - (3)])->lasti->param_count + 1;
(yyval) = list_append((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]));
@@ -3270,55 +3282,55 @@ regular_print:
case 97:
/* Line 1787 of yacc.c */
-#line 1206 "awkgram.y"
+#line 1218 "awkgram.y"
{ (yyval) = NULL; }
break;
case 98:
/* Line 1787 of yacc.c */
-#line 1208 "awkgram.y"
+#line 1220 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (2)]); }
break;
case 99:
/* Line 1787 of yacc.c */
-#line 1210 "awkgram.y"
+#line 1222 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (3)]); }
break;
case 100:
/* Line 1787 of yacc.c */
-#line 1216 "awkgram.y"
+#line 1228 "awkgram.y"
{ (yyval) = NULL; }
break;
case 101:
/* Line 1787 of yacc.c */
-#line 1218 "awkgram.y"
+#line 1230 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 102:
/* Line 1787 of yacc.c */
-#line 1223 "awkgram.y"
+#line 1235 "awkgram.y"
{ (yyval) = NULL; }
break;
case 103:
/* Line 1787 of yacc.c */
-#line 1225 "awkgram.y"
+#line 1237 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 104:
/* Line 1787 of yacc.c */
-#line 1230 "awkgram.y"
+#line 1242 "awkgram.y"
{ (yyval) = mk_expression_list(NULL, (yyvsp[(1) - (1)])); }
break;
case 105:
/* Line 1787 of yacc.c */
-#line 1232 "awkgram.y"
+#line 1244 "awkgram.y"
{
(yyval) = mk_expression_list((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]));
yyerrok;
@@ -3327,13 +3339,13 @@ regular_print:
case 106:
/* Line 1787 of yacc.c */
-#line 1237 "awkgram.y"
+#line 1249 "awkgram.y"
{ (yyval) = NULL; }
break;
case 107:
/* Line 1787 of yacc.c */
-#line 1239 "awkgram.y"
+#line 1251 "awkgram.y"
{
/*
* Returning the expression list instead of NULL lets
@@ -3345,7 +3357,7 @@ regular_print:
case 108:
/* Line 1787 of yacc.c */
-#line 1247 "awkgram.y"
+#line 1259 "awkgram.y"
{
/* Ditto */
(yyval) = mk_expression_list((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]));
@@ -3354,7 +3366,7 @@ regular_print:
case 109:
/* Line 1787 of yacc.c */
-#line 1252 "awkgram.y"
+#line 1264 "awkgram.y"
{
/* Ditto */
(yyval) = (yyvsp[(1) - (3)]);
@@ -3363,7 +3375,7 @@ regular_print:
case 110:
/* Line 1787 of yacc.c */
-#line 1261 "awkgram.y"
+#line 1273 "awkgram.y"
{
if (do_lint && (yyvsp[(3) - (3)])->lasti->opcode == Op_match_rec)
lintwarn_ln((yyvsp[(2) - (3)])->source_line,
@@ -3374,19 +3386,19 @@ regular_print:
case 111:
/* Line 1787 of yacc.c */
-#line 1268 "awkgram.y"
+#line 1280 "awkgram.y"
{ (yyval) = mk_boolean((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
case 112:
/* Line 1787 of yacc.c */
-#line 1270 "awkgram.y"
+#line 1282 "awkgram.y"
{ (yyval) = mk_boolean((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
case 113:
/* Line 1787 of yacc.c */
-#line 1272 "awkgram.y"
+#line 1284 "awkgram.y"
{
if ((yyvsp[(1) - (3)])->lasti->opcode == Op_match_rec)
warning_ln((yyvsp[(2) - (3)])->source_line,
@@ -3406,7 +3418,7 @@ regular_print:
case 114:
/* Line 1787 of yacc.c */
-#line 1288 "awkgram.y"
+#line 1300 "awkgram.y"
{
if (do_lint_old)
warning_ln((yyvsp[(2) - (3)])->source_line,
@@ -3420,7 +3432,7 @@ regular_print:
case 115:
/* Line 1787 of yacc.c */
-#line 1298 "awkgram.y"
+#line 1310 "awkgram.y"
{
if (do_lint && (yyvsp[(3) - (3)])->lasti->opcode == Op_match_rec)
lintwarn_ln((yyvsp[(2) - (3)])->source_line,
@@ -3431,31 +3443,31 @@ regular_print:
case 116:
/* Line 1787 of yacc.c */
-#line 1305 "awkgram.y"
+#line 1317 "awkgram.y"
{ (yyval) = mk_condition((yyvsp[(1) - (5)]), (yyvsp[(2) - (5)]), (yyvsp[(3) - (5)]), (yyvsp[(4) - (5)]), (yyvsp[(5) - (5)])); }
break;
case 117:
/* Line 1787 of yacc.c */
-#line 1307 "awkgram.y"
+#line 1319 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 118:
/* Line 1787 of yacc.c */
-#line 1312 "awkgram.y"
+#line 1324 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 119:
/* Line 1787 of yacc.c */
-#line 1314 "awkgram.y"
+#line 1326 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 120:
/* Line 1787 of yacc.c */
-#line 1316 "awkgram.y"
+#line 1328 "awkgram.y"
{
(yyvsp[(2) - (2)])->opcode = Op_assign_quotient;
(yyval) = (yyvsp[(2) - (2)]);
@@ -3464,43 +3476,43 @@ regular_print:
case 121:
/* Line 1787 of yacc.c */
-#line 1324 "awkgram.y"
+#line 1336 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 122:
/* Line 1787 of yacc.c */
-#line 1326 "awkgram.y"
+#line 1338 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 123:
/* Line 1787 of yacc.c */
-#line 1331 "awkgram.y"
+#line 1343 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 124:
/* Line 1787 of yacc.c */
-#line 1333 "awkgram.y"
+#line 1345 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 125:
/* Line 1787 of yacc.c */
-#line 1338 "awkgram.y"
+#line 1350 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 126:
/* Line 1787 of yacc.c */
-#line 1340 "awkgram.y"
+#line 1352 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 127:
/* Line 1787 of yacc.c */
-#line 1342 "awkgram.y"
+#line 1354 "awkgram.y"
{
int count = 2;
bool is_simple_var = false;
@@ -3551,43 +3563,43 @@ regular_print:
case 129:
/* Line 1787 of yacc.c */
-#line 1394 "awkgram.y"
+#line 1406 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
case 130:
/* Line 1787 of yacc.c */
-#line 1396 "awkgram.y"
+#line 1408 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
case 131:
/* Line 1787 of yacc.c */
-#line 1398 "awkgram.y"
+#line 1410 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
case 132:
/* Line 1787 of yacc.c */
-#line 1400 "awkgram.y"
+#line 1412 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
case 133:
/* Line 1787 of yacc.c */
-#line 1402 "awkgram.y"
+#line 1414 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
case 134:
/* Line 1787 of yacc.c */
-#line 1404 "awkgram.y"
+#line 1416 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
case 135:
/* Line 1787 of yacc.c */
-#line 1406 "awkgram.y"
+#line 1418 "awkgram.y"
{
/*
* In BEGINFILE/ENDFILE, allow `getline var < file'
@@ -3614,7 +3626,7 @@ regular_print:
case 136:
/* Line 1787 of yacc.c */
-#line 1429 "awkgram.y"
+#line 1441 "awkgram.y"
{
(yyvsp[(2) - (2)])->opcode = Op_postincrement;
(yyval) = mk_assignment((yyvsp[(1) - (2)]), NULL, (yyvsp[(2) - (2)]));
@@ -3623,7 +3635,7 @@ regular_print:
case 137:
/* Line 1787 of yacc.c */
-#line 1434 "awkgram.y"
+#line 1446 "awkgram.y"
{
(yyvsp[(2) - (2)])->opcode = Op_postdecrement;
(yyval) = mk_assignment((yyvsp[(1) - (2)]), NULL, (yyvsp[(2) - (2)]));
@@ -3632,7 +3644,7 @@ regular_print:
case 138:
/* Line 1787 of yacc.c */
-#line 1439 "awkgram.y"
+#line 1451 "awkgram.y"
{
if (do_lint_old) {
warning_ln((yyvsp[(4) - (5)])->source_line,
@@ -3656,7 +3668,7 @@ regular_print:
case 139:
/* Line 1787 of yacc.c */
-#line 1464 "awkgram.y"
+#line 1476 "awkgram.y"
{
(yyval) = mk_getline((yyvsp[(3) - (4)]), (yyvsp[(4) - (4)]), (yyvsp[(1) - (4)]), (yyvsp[(2) - (4)])->redir_type);
bcfree((yyvsp[(2) - (4)]));
@@ -3665,43 +3677,43 @@ regular_print:
case 140:
/* Line 1787 of yacc.c */
-#line 1470 "awkgram.y"
+#line 1482 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
case 141:
/* Line 1787 of yacc.c */
-#line 1472 "awkgram.y"
+#line 1484 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
case 142:
/* Line 1787 of yacc.c */
-#line 1474 "awkgram.y"
+#line 1486 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
case 143:
/* Line 1787 of yacc.c */
-#line 1476 "awkgram.y"
+#line 1488 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
case 144:
/* Line 1787 of yacc.c */
-#line 1478 "awkgram.y"
+#line 1490 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
case 145:
/* Line 1787 of yacc.c */
-#line 1480 "awkgram.y"
+#line 1492 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
case 146:
/* Line 1787 of yacc.c */
-#line 1485 "awkgram.y"
+#line 1497 "awkgram.y"
{
(yyval) = list_create((yyvsp[(1) - (1)]));
}
@@ -3709,7 +3721,7 @@ regular_print:
case 147:
/* Line 1787 of yacc.c */
-#line 1489 "awkgram.y"
+#line 1501 "awkgram.y"
{
if ((yyvsp[(2) - (2)])->opcode == Op_match_rec) {
(yyvsp[(2) - (2)])->opcode = Op_nomatch;
@@ -3745,13 +3757,13 @@ regular_print:
case 148:
/* Line 1787 of yacc.c */
-#line 1521 "awkgram.y"
+#line 1533 "awkgram.y"
{ (yyval) = (yyvsp[(2) - (3)]); }
break;
case 149:
/* Line 1787 of yacc.c */
-#line 1523 "awkgram.y"
+#line 1535 "awkgram.y"
{
(yyval) = snode((yyvsp[(3) - (4)]), (yyvsp[(1) - (4)]));
if ((yyval) == NULL)
@@ -3761,7 +3773,7 @@ regular_print:
case 150:
/* Line 1787 of yacc.c */
-#line 1529 "awkgram.y"
+#line 1541 "awkgram.y"
{
(yyval) = snode((yyvsp[(3) - (4)]), (yyvsp[(1) - (4)]));
if ((yyval) == NULL)
@@ -3771,7 +3783,7 @@ regular_print:
case 151:
/* Line 1787 of yacc.c */
-#line 1535 "awkgram.y"
+#line 1547 "awkgram.y"
{
static bool warned = false;
@@ -3788,7 +3800,7 @@ regular_print:
case 154:
/* Line 1787 of yacc.c */
-#line 1550 "awkgram.y"
+#line 1562 "awkgram.y"
{
(yyvsp[(1) - (2)])->opcode = Op_preincrement;
(yyval) = mk_assignment((yyvsp[(2) - (2)]), NULL, (yyvsp[(1) - (2)]));
@@ -3797,7 +3809,7 @@ regular_print:
case 155:
/* Line 1787 of yacc.c */
-#line 1555 "awkgram.y"
+#line 1567 "awkgram.y"
{
(yyvsp[(1) - (2)])->opcode = Op_predecrement;
(yyval) = mk_assignment((yyvsp[(2) - (2)]), NULL, (yyvsp[(1) - (2)]));
@@ -3806,7 +3818,7 @@ regular_print:
case 156:
/* Line 1787 of yacc.c */
-#line 1560 "awkgram.y"
+#line 1572 "awkgram.y"
{
(yyval) = list_create((yyvsp[(1) - (1)]));
}
@@ -3814,7 +3826,7 @@ regular_print:
case 157:
/* Line 1787 of yacc.c */
-#line 1564 "awkgram.y"
+#line 1576 "awkgram.y"
{
(yyval) = list_create((yyvsp[(1) - (1)]));
}
@@ -3822,7 +3834,7 @@ regular_print:
case 158:
/* Line 1787 of yacc.c */
-#line 1568 "awkgram.y"
+#line 1580 "awkgram.y"
{
if ((yyvsp[(2) - (2)])->lasti->opcode == Op_push_i
&& ((yyvsp[(2) - (2)])->lasti->memory->flags & (STRCUR|STRING)) == 0
@@ -3841,7 +3853,7 @@ regular_print:
case 159:
/* Line 1787 of yacc.c */
-#line 1583 "awkgram.y"
+#line 1595 "awkgram.y"
{
/*
* was: $$ = $2
@@ -3855,7 +3867,7 @@ regular_print:
case 160:
/* Line 1787 of yacc.c */
-#line 1596 "awkgram.y"
+#line 1608 "awkgram.y"
{
func_use((yyvsp[(1) - (1)])->lasti->func_name, FUNC_USE);
(yyval) = (yyvsp[(1) - (1)]);
@@ -3864,7 +3876,7 @@ regular_print:
case 161:
/* Line 1787 of yacc.c */
-#line 1601 "awkgram.y"
+#line 1613 "awkgram.y"
{
/* indirect function call */
INSTRUCTION *f, *t;
@@ -3901,7 +3913,7 @@ regular_print:
case 162:
/* Line 1787 of yacc.c */
-#line 1637 "awkgram.y"
+#line 1649 "awkgram.y"
{
param_sanity((yyvsp[(3) - (4)]));
(yyvsp[(1) - (4)])->opcode = Op_func_call;
@@ -3919,37 +3931,37 @@ regular_print:
case 163:
/* Line 1787 of yacc.c */
-#line 1654 "awkgram.y"
+#line 1666 "awkgram.y"
{ (yyval) = NULL; }
break;
case 164:
/* Line 1787 of yacc.c */
-#line 1656 "awkgram.y"
+#line 1668 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 165:
/* Line 1787 of yacc.c */
-#line 1661 "awkgram.y"
+#line 1673 "awkgram.y"
{ (yyval) = NULL; }
break;
case 166:
/* Line 1787 of yacc.c */
-#line 1663 "awkgram.y"
+#line 1675 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (2)]); }
break;
case 167:
/* Line 1787 of yacc.c */
-#line 1668 "awkgram.y"
+#line 1680 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 168:
/* Line 1787 of yacc.c */
-#line 1670 "awkgram.y"
+#line 1682 "awkgram.y"
{
(yyval) = list_merge((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]));
}
@@ -3957,7 +3969,7 @@ regular_print:
case 169:
/* Line 1787 of yacc.c */
-#line 1677 "awkgram.y"
+#line 1689 "awkgram.y"
{
INSTRUCTION *ip = (yyvsp[(1) - (1)])->lasti;
int count = ip->sub_count; /* # of SUBSEP-seperated expressions */
@@ -3975,7 +3987,7 @@ regular_print:
case 170:
/* Line 1787 of yacc.c */
-#line 1694 "awkgram.y"
+#line 1706 "awkgram.y"
{
INSTRUCTION *t = (yyvsp[(2) - (3)]);
if ((yyvsp[(2) - (3)]) == NULL) {
@@ -3993,13 +4005,13 @@ regular_print:
case 171:
/* Line 1787 of yacc.c */
-#line 1711 "awkgram.y"
+#line 1723 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 172:
/* Line 1787 of yacc.c */
-#line 1713 "awkgram.y"
+#line 1725 "awkgram.y"
{
(yyval) = list_merge((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]));
}
@@ -4007,13 +4019,13 @@ regular_print:
case 173:
/* Line 1787 of yacc.c */
-#line 1720 "awkgram.y"
+#line 1732 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (2)]); }
break;
case 174:
/* Line 1787 of yacc.c */
-#line 1725 "awkgram.y"
+#line 1737 "awkgram.y"
{
char *var_name = (yyvsp[(1) - (1)])->lextok;
@@ -4025,7 +4037,7 @@ regular_print:
case 175:
/* Line 1787 of yacc.c */
-#line 1733 "awkgram.y"
+#line 1745 "awkgram.y"
{
char *arr = (yyvsp[(1) - (2)])->lextok;
(yyvsp[(1) - (2)])->memory = variable((yyvsp[(1) - (2)])->source_line, arr, Node_var_new);
@@ -4036,7 +4048,7 @@ regular_print:
case 176:
/* Line 1787 of yacc.c */
-#line 1743 "awkgram.y"
+#line 1755 "awkgram.y"
{
INSTRUCTION *ip = (yyvsp[(1) - (1)])->nexti;
if (ip->opcode == Op_push
@@ -4052,7 +4064,7 @@ regular_print:
case 177:
/* Line 1787 of yacc.c */
-#line 1755 "awkgram.y"
+#line 1767 "awkgram.y"
{
(yyval) = list_append((yyvsp[(2) - (3)]), (yyvsp[(1) - (3)]));
if ((yyvsp[(3) - (3)]) != NULL)
@@ -4062,7 +4074,7 @@ regular_print:
case 178:
/* Line 1787 of yacc.c */
-#line 1764 "awkgram.y"
+#line 1776 "awkgram.y"
{
(yyvsp[(1) - (1)])->opcode = Op_postincrement;
}
@@ -4070,7 +4082,7 @@ regular_print:
case 179:
/* Line 1787 of yacc.c */
-#line 1768 "awkgram.y"
+#line 1780 "awkgram.y"
{
(yyvsp[(1) - (1)])->opcode = Op_postdecrement;
}
@@ -4078,43 +4090,43 @@ regular_print:
case 180:
/* Line 1787 of yacc.c */
-#line 1771 "awkgram.y"
+#line 1783 "awkgram.y"
{ (yyval) = NULL; }
break;
case 182:
/* Line 1787 of yacc.c */
-#line 1779 "awkgram.y"
+#line 1791 "awkgram.y"
{ yyerrok; }
break;
case 183:
/* Line 1787 of yacc.c */
-#line 1783 "awkgram.y"
+#line 1795 "awkgram.y"
{ yyerrok; }
break;
case 186:
/* Line 1787 of yacc.c */
-#line 1792 "awkgram.y"
+#line 1804 "awkgram.y"
{ yyerrok; }
break;
case 187:
/* Line 1787 of yacc.c */
-#line 1796 "awkgram.y"
+#line 1808 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); yyerrok; }
break;
case 188:
/* Line 1787 of yacc.c */
-#line 1800 "awkgram.y"
+#line 1812 "awkgram.y"
{ yyerrok; }
break;
/* Line 1787 of yacc.c */
-#line 4118 "awkgram.c"
+#line 4130 "awkgram.c"
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -4346,7 +4358,7 @@ yyreturn:
/* Line 2050 of yacc.c */
-#line 1802 "awkgram.y"
+#line 1814 "awkgram.y"
struct token {
@@ -5428,8 +5440,28 @@ allow_newline(void)
break;
}
if (c == '#') {
- while ((c = nextc()) != '\n' && c != END_FILE)
- continue;
+// if (do_pretty_print) {
+ tok = tokstart;
+ tokadd('#');
+ while ((c = nextc()) != '\n' && c != END_FILE)
+ tokadd(c);
+ if (c == '\n')
+ tokadd(c);
+
+ if (comment != NULL) {
+ size_t new = comment->memory->stlen + (tok - tokstart) + 2;
+ erealloc(comment->memory->stptr, char *, new, "allow_newline");
+ memcpy(comment->memory->stptr + comment->memory->stlen, tokstart, (tok - tokstart));
+ comment->memory->stlen += (tok - tokstart);
+ comment->memory->stptr[comment->memory->stlen] = '\0';
+ } else {
+ comment = bcalloc(Op_comment, 1, sourceline);
+ comment->memory = make_str_node(tokstart, tok - tokstart, 0);
+ }
+// } else {
+// while ((c = nextc()) != '\n' && c != END_FILE)
+// continue;
+// }
if (c == END_FILE) {
pushback();
break;
@@ -5633,10 +5665,36 @@ retry:
return lasttok = NEWLINE;
case '#': /* it's a comment */
- while ((c = nextc()) != '\n') {
+// if (do_pretty_print) {
+ tok = tokstart;
+ tokadd('#');
+ while ((c = nextc()) != '\n') {
+ if (c == END_FILE)
+ break;
+ tokadd(c);
+ }
+ if (c == '\n')
+ tokadd(c);
+
+ if (comment != NULL) {
+ size_t new = comment->memory->stlen + (tok - tokstart) + 2;
+ erealloc(comment->memory->stptr, char *, new, "yylex");
+ memcpy(comment->memory->stptr + comment->memory->stlen, tokstart, (tok - tokstart));
+ comment->memory->stlen += (tok - tokstart);
+ comment->memory->stptr[comment->memory->stlen] = '\0';
+ } else {
+ comment = bcalloc(Op_comment, 1, sourceline);
+ comment->memory = make_str_node(tokstart, tok - tokstart, 0);
+ }
+
if (c == END_FILE)
return lasttok = NEWLINE_EOF;
- }
+// } else {
+// while ((c = nextc()) != '\n') {
+// if (c == END_FILE)
+// return lasttok = NEWLINE_EOF;
+// }
+// }
sourceline++;
return lasttok = NEWLINE;
diff --git a/awkgram.y b/awkgram.y
index f0ff4f0c..68a328ea 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -146,6 +146,8 @@ static INSTRUCTION *ip_end;
static INSTRUCTION *ip_endfile;
static INSTRUCTION *ip_beginfile;
+static INSTRUCTION *comment = NULL;
+
static inline INSTRUCTION *list_create(INSTRUCTION *x);
static inline INSTRUCTION *list_append(INSTRUCTION *l, INSTRUCTION *x);
static inline INSTRUCTION *list_prepend(INSTRUCTION *l, INSTRUCTION *x);
@@ -446,16 +448,26 @@ statements
{ $$ = NULL; }
| statements statement
{
- if ($2 == NULL)
- $$ = $1;
- else {
- add_lint($2, LINT_no_effect);
- if ($1 == NULL)
- $$ = $2;
+ if ($2 == NULL) {
+ if (comment == NULL)
+ $$ = $1;
else
+ $$ = list_prepend($1, comment);
+ } else {
+ add_lint($2, LINT_no_effect);
+ if ($1 == NULL) {
+ if (comment == NULL)
+ $$ = $2;
+ else
+ $$ = list_prepend($2, comment);
+ } else {
+ if (comment != NULL)
+ list_append($1, comment);
$$ = list_merge($1, $2);
+ }
}
- yyerrok;
+ comment = NULL;
+ yyerrok;
}
| statements error
{ $$ = NULL; }
@@ -2880,8 +2892,28 @@ allow_newline(void)
break;
}
if (c == '#') {
- while ((c = nextc()) != '\n' && c != END_FILE)
- continue;
+// if (do_pretty_print) {
+ tok = tokstart;
+ tokadd('#');
+ while ((c = nextc()) != '\n' && c != END_FILE)
+ tokadd(c);
+ if (c == '\n')
+ tokadd(c);
+
+ if (comment != NULL) {
+ size_t new = comment->memory->stlen + (tok - tokstart) + 2;
+ erealloc(comment->memory->stptr, char *, new, "allow_newline");
+ memcpy(comment->memory->stptr + comment->memory->stlen, tokstart, (tok - tokstart));
+ comment->memory->stlen += (tok - tokstart);
+ comment->memory->stptr[comment->memory->stlen] = '\0';
+ } else {
+ comment = bcalloc(Op_comment, 1, sourceline);
+ comment->memory = make_str_node(tokstart, tok - tokstart, 0);
+ }
+// } else {
+// while ((c = nextc()) != '\n' && c != END_FILE)
+// continue;
+// }
if (c == END_FILE) {
pushback();
break;
@@ -3085,10 +3117,36 @@ retry:
return lasttok = NEWLINE;
case '#': /* it's a comment */
- while ((c = nextc()) != '\n') {
+// if (do_pretty_print) {
+ tok = tokstart;
+ tokadd('#');
+ while ((c = nextc()) != '\n') {
+ if (c == END_FILE)
+ break;
+ tokadd(c);
+ }
+ if (c == '\n')
+ tokadd(c);
+
+ if (comment != NULL) {
+ size_t new = comment->memory->stlen + (tok - tokstart) + 2;
+ erealloc(comment->memory->stptr, char *, new, "yylex");
+ memcpy(comment->memory->stptr + comment->memory->stlen, tokstart, (tok - tokstart));
+ comment->memory->stlen += (tok - tokstart);
+ comment->memory->stptr[comment->memory->stlen] = '\0';
+ } else {
+ comment = bcalloc(Op_comment, 1, sourceline);
+ comment->memory = make_str_node(tokstart, tok - tokstart, 0);
+ }
+
if (c == END_FILE)
return lasttok = NEWLINE_EOF;
- }
+// } else {
+// while ((c = nextc()) != '\n') {
+// if (c == END_FILE)
+// return lasttok = NEWLINE_EOF;
+// }
+// }
sourceline++;
return lasttok = NEWLINE;
diff --git a/debug.c b/debug.c
index 0cb9d562..4678acae 100644
--- a/debug.c
+++ b/debug.c
@@ -3978,6 +3978,7 @@ print_instruction(INSTRUCTION *pc, Func_print print_func, FILE *fp, int in_dump)
case Op_quotient_i:
case Op_mod_i:
case Op_assign_concat:
+ case Op_comment:
print_memory(pc->memory, func, print_func, fp);
/* fall through */
default:
diff --git a/eval.c b/eval.c
index cf2264bf..a0dddf46 100644
--- a/eval.c
+++ b/eval.c
@@ -360,6 +360,7 @@ static struct optypetab {
{ "Op_after_beginfile", NULL },
{ "Op_after_endfile", NULL },
{ "Op_func", NULL },
+ { "Op_comment", NULL },
{ "Op_exec_count", NULL },
{ "Op_breakpoint", NULL },
{ "Op_lint", NULL },
diff --git a/extension/ChangeLog b/extension/ChangeLog
index 97c3f40e..f0b7baba 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -9,6 +9,10 @@
"not supported" fatal message. This is slightly better than the
"fts not found" which is otherwise produced.
+2013-07-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * profile2.ok, profile5.ok: Update.
+
2013-07-24 Arnold D. Robbins <arnold@skeeve.com>
* gawkdirfd.h (FAKE_FD_VALUE): Move definition up in the file to give
diff --git a/interpret.h b/interpret.h
index ba70cf08..69987cf4 100644
--- a/interpret.h
+++ b/interpret.h
@@ -1356,6 +1356,7 @@ match_re:
case Op_K_if:
case Op_K_else:
case Op_cond_exp:
+ case Op_comment:
break;
default:
diff --git a/profile.c b/profile.c
index eae24b1c..5c7555e6 100644
--- a/profile.c
+++ b/profile.c
@@ -873,6 +873,28 @@ cleanup:
indent(pc->exec_count);
break;
+ case Op_comment:
+ {
+ char *text;
+ size_t count;
+ bool after_newline = false;
+
+ count = pc->memory->stlen;
+ text = pc->memory->stptr;
+
+ indent(SPACEOVER);
+ for (; count > 0; count--, text++) {
+ if (after_newline) {
+ indent(SPACEOVER);
+ after_newline = false;
+ }
+ putc(*text, prof_fp);
+ if (*text == '\n')
+ after_newline = true;
+ }
+ }
+ break;
+
default:
cant_happen();
}
diff --git a/test/profile2.ok b/test/profile2.ok
index fe76a2c9..77169336 100644
--- a/test/profile2.ok
+++ b/test/profile2.ok
@@ -1,19 +1,34 @@
# BEGIN block(s)
BEGIN {
+ # xref.awk - cross reference an awk program
+ # 12/2010: Modified for gawk test suite to use a variable
+ # for the sort command and to use `sort -k1' instead of `sort +1'
+ # "sort -k1"
+ # create array of keywords to be ignored by lexer
1 if (sortcmd == "") {
sortcmd = "sort"
}
+ # build the symbol-state table
1 asplit("BEGIN:END:atan2:break:close:continue:cos:delete:" "do:else:exit:exp:for:getline:gsub:if:in:index:int:" "length:log:match:next:print:printf:rand:return:sin:" "split:sprintf:sqrt:srand:sub:substr:system:while", keywords, ":")
+ # parse the input and store an intermediate representation
+ # of the cross-reference information
+ # set up the machine
1 split("00:00:00:00:00:00:00:00:00:00:" "20:10:10:12:12:11:07:00:00:00:" "08:08:08:08:08:33:08:00:00:00:" "08:44:08:36:08:08:08:00:00:00:" "08:44:45:42:42:41:08", machine, ":")
+ # run the machine
1 state = 1
+ # finished parsing, now ready to print output
571 for (; ; ) {
+ # get next symbol
571 symb = lex()
571 nextstate = substr(machine[state symb], 1, 1)
+ # perform required action
571 act = substr(machine[state symb], 2, 1)
+ # finished with current token
571 if (act == "0") { # 12
559 } else {
559 if (act == "1") { # 8
+ # do nothing
8 if (! inarray(tok, names)) { # 3
3 names[++nnames] = tok
}
@@ -93,6 +108,7 @@
1 function asplit(str, arr, fs, n)
{
+ # END OF PROGRAM
1 n = split(str, temp_asplit, fs)
36 for (i = 1; i <= n; i++) {
36 arr[temp_asplit[i]]++
@@ -119,9 +135,13 @@
1 return 7
}
}
+ # remove white space,
1701 sub(/^[ \t]+/, "", line)
+ # quoted strings,
1701 sub(/^"([^"]|\\")*"/, "", line)
+ # regular expressions,
1701 sub(/^\/([^\/]|\\\/)+\//, "", line)
+ # and comments
1701 sub(/^#.*/, "", line)
1701 if (line ~ /^function/) { # 4
4 tok = "function"
@@ -139,6 +159,7 @@
53 return 3
1591 } else {
1591 if (match(line, /^[[:alpha:]_][[:alnum:]]*\[/)) { # 43
+ # change regexes to use posix character classes
43 tok = substr(line, 1, RLENGTH - 1)
43 line = substr(line, RLENGTH + 1)
43 return 5
diff --git a/test/profile5.ok b/test/profile5.ok
index cc83dc06..3e0736d5 100644
--- a/test/profile5.ok
+++ b/test/profile5.ok
@@ -5,6 +5,8 @@
}
BEGIN {
+ #___________________________________________________________________________________
+ ############################################################################
BINMODE = "rw"
SUBSEP = "\000"
_NULARR[""]
@@ -25,6 +27,8 @@
}
BEGIN {
+ #___________________________________________________________________________________
+ #############################################################################
_delay_perfmsdelay = 11500
}
@@ -36,19 +40,25 @@
}
BEGIN {
+ #___________________________________________________________________________________
+ ###########################################################################
_addlib("_EXTFN")
}
BEGIN {
+ #___________________________________________________________________________________
+ #############################################################################
delete _XCHR
delete _ASC
delete _CHR
t = ""
+ #_____________________________________________________________________________
for (i = 0; i < 256; i++) {
_ASC[a = _CHR[i] = sprintf("%c", i)] = i
_QASC[a] = sprintf("%.3o", i)
_XCHR[_CHR[i]] = sprintf("%c", (i < 128 ? i + 128 : i - 128))
}
+ #_______________________________________________________________________
for (i = 0; i < 256; i++) {
_QSTRQ[_CHR[i]] = "\\" sprintf("%.3o", i)
}
@@ -61,10 +71,13 @@
for (; i < 256; i++) {
_QSTR[_CHR[i]] = _QSTRQ[_CHR[i]]
}
+ #; _QSTR["\""]="\\\""
+ #_____________________________________________________________________________
_QSTR["\\"] = "\\\\"
_CHR["CR"] = "\r"
_CHR["EOL"] = "\r\n"
_CHR["EOF"] = "\032"
+ #_______________________________________________________________________
_QSTR[_CHR["EOL"]] = "\\015\\012"
_CHR["MONTH"][_CHR["MONTH"]["Jan"] = "01"] = "Jan"
_CHR["MONTH"][_CHR["MONTH"]["Feb"] = "02"] = "Feb"
@@ -77,7 +90,9 @@
_CHR["MONTH"][_CHR["MONTH"]["Sep"] = "09"] = "Sep"
_CHR["MONTH"][_CHR["MONTH"]["Oct"] = "10"] = "Oct"
_CHR["MONTH"][_CHR["MONTH"]["Nov"] = "11"] = "Nov"
+ #_____________________________________________________________________________
_CHR["MONTH"][_CHR["MONTH"]["Dec"] = "12"] = "Dec"
+ #_____________________________________________________________________________
_TAB_STEP_DEFAULT = 8
for (i = 0; i < 32; i++) {
_REXPSTR[_CHR[i]] = _QSTRQ[_CHR[i]]
@@ -93,6 +108,8 @@
}
BEGIN {
+ #___________________________________________________________________________________
+ #############################################################################
_SYS_STDCON = "CON"
_CON_WIDTH = (match(_cmd("MODE " _SYS_STDCON " 2>NUL"), /Columns:[ \t]*([0-9]+)/, A) ? strtonum(A[1]) : 80)
}
@@ -102,6 +119,8 @@
}
BEGIN {
+ #___________________________________________________________________________________
+ #############################################################################
if (_SYS_STDOUT == "") {
_SYS_STDOUT = "/dev/stdout"
}
@@ -123,6 +142,8 @@
}
BEGIN {
+ #___________________________________________________________________________________
+ #############################################################################
_tInBy = "\212._tInBy"
_tgenuid_init()
_UIDS[""]
@@ -155,6 +176,8 @@
BEGIN {
if (_gawk_scriptlevel < 1) {
+ #___________________________________________________________________________________
+ #############################################################################
_ERRLOG_TF = 1
_ERRLOG_VF = 1
_ERRLOG_IF = 1
@@ -170,18 +193,22 @@
}
BEGIN {
+ #___________________________________________________________________________________
_shortcut_init()
}
BEGIN {
+ #########################################################
_addlib("_eXTFN")
}
BEGIN {
+ #___________________________________________________________________________________
_extfn_init()
}
BEGIN {
+ ############################################################
_addlib("_sHARE")
}
@@ -190,6 +217,7 @@
}
BEGIN {
+ ###############################################################################
_addlib("_DS")
_PRODUCT_NAME = "Deployment Solution Control"
_PRODUCT_VERSION = "1.0"
@@ -198,33 +226,42 @@
}
BEGIN {
+ # problem configuring uid by array charset: i can' understand what format of the array: possibly - remove array support
+ # after removal of array format detection: there is unfinished conflicts: it is possible to totally remove array uid-gen initialization
+ #_____________________________________________________
_inituidefault()
}
BEGIN {
+ #_____________________________________________________
_initfilever()
}
BEGIN {
+ #_____________________________________________________
_initshare()
}
BEGIN {
+ #_________________________________________________________________
_inspass(_IMPORT, "_import_data")
}
BEGIN {
+ #_______________________________________________
_TEND[_ARRLEN] = 0
_TYPEWORD = "_TYPE"
}
BEGIN {
+ #_______________________________________________
_ARRLEN = "\032LEN"
_ARRPTR = "\032PTR"
_ARRSTR = ""
}
BEGIN {
+ #_____________________________________________________
_getperf_fn = "_nop"
}
@@ -233,18 +270,28 @@
}
BEGIN {
+ #_____________________________________________________
_initrdreg()
}
BEGIN {
+ #_____________________________________________________
_initregpath0()
}
BEGIN {
+ #_____________________________________________________________________________
+ ################################################################
+ #_____________________________________________________
_initsys()
}
BEGIN {
+ #_________________________________________________________________________________________
+ ##########################################################################################
+ #BootDevice BuildNumber BuildType Caption CodeSet CountryCode CreationClassName CSCreationClassName CSDVersion CSName CurrentTimeZone DataExecutionPrevention_32BitApplications DataExecutionPrevention_Available DataExecutionPrevention_Drivers DataExecutionPrevention_SupportPolicy Debug Description Distributed EncryptionLevel ForegroundApplicationBoost FreePhysicalMemory FreeSpaceInPagingFiles FreeVirtualMemory InstallDate LargeSystemCache LastBootUpTime LocalDateTime Locale Manufacturer MaxNumberOfProcesses MaxProcessMemorySize MUILanguages Name NumberOfLicensedUsers NumberOfProcesses NumberOfUsers OperatingSystemSKU Organization OSArchitecture OSLanguage OSProductSuite OSType OtherTypeDescription PAEEnabled PlusProductID PlusVersionNumber Primary ProductType RegisteredUser SerialNumber ServicePackMajorVersion ServicePackMinorVersion SizeStoredInPagingFiles Status SuiteMask SystemDevice SystemDirectory SystemDrive TotalSwapSpaceSize TotalVirtualMemorySize TotalVisibleMemorySize Version WindowsDirectory
+ #\Device\HarddiskVolume1 7601 Multiprocessor Free Microsoft Windows Server 2008 R2 Enterprise 1252 1 Win32_OperatingSystem Win32_ComputerSystem Service Pack 1 CPU 180 TRUE TRUE TRUE 3 FALSE FALSE 256 0 6925316 33518716 41134632 20110502192745.000000+180 20130426120425.497469+180 20130510134606.932000+180 0409 Microsoft Corporation -1 8589934464 {"en-US"} Microsoft Windows Server 2008 R2 Enterprise |C:\Windows|\Device\Harddisk0\Partition2 0 116 2 10 64-bit 1033 274 18 TRUE 3 Windows User 55041-507-2389175-84833 1 0 33554432 OK 274 \Device\HarddiskVolume2 C:\Windows\system32 C: 50311020 16758448 6.1.7601 C:\Windows
+ ############################################################################
a = ENVIRON["EGAWK_CMDLINE"]
gsub(/^[ \t]*/, "", a)
a = _lib_CMDLN(a)
@@ -266,11 +313,16 @@
# END block(s)
END {
+ #_____________________________________________________________________________
+ ########################################################################
_EXIT()
}
END {
if (_gawk_scriptlevel < 1) {
+ #_______________________________________________________________________
+ ########################################################################
+ ###############################################################################
close(_errlog_file)
p = _Zimport(_rdfile(_errlog_file), _N())
if ((t = _get_errout(p)) != "") {
@@ -282,6 +334,18 @@
END {
if (_gawk_scriptlevel < 1) {
if (! _fileio_notdeltmpflag) {
+ ##########################################################################################
+ # PUBLIC:
+ #_____________________________________________________________________________
+ # _rFBRO(ptr) - Return ptr of first-bro. [TESTED]
+ # If !ptr then returns "".
+ #_____________________________________________________________________________
+ # _rLBRO(ptr) - Return ptr of last-bro. [TESTED]
+ # If !ptr then returns "".
+ #_____________________________________________________________________________
+ # _rQBRO(ptr) - Returns brothers total quantity. [TESTED]
+ # If !ptr then returns "".
+ ###############################################################################
_FILEIO_TMPATHS[_FILEIO_TMPRD]
_Foreach(_FILEIO_TMPATHS, "_uninit_del")
}
@@ -289,6 +353,276 @@
}
END {
+ #___________________________________________________________________________________
+ ####################################################################################
+ #___________________________________________________________________________________
+ # fn _dirtree(array,pathmask)
+ #
+ # Return in `array' file tree from pathmask:
+ # array["file.filerdne"]="size date time"
+ # array["subdir.filerd"]["file.filerdne"]="size date time"
+ # array["subdir.filerd"]["file.filerd"][...]
+ #
+ # The array will be cleared before any action. Function return pathmask w/o ltabspc and rtabspc.
+ #___________________________________________________________________________________
+ # OK: change internal function's names to: w\o "_"
+ # OK: FLENGTH: should cover r-spcs
+ # OK: optimize REXP
+ # OK: add new symbols to dir/file names ( ! and + )
+ # OK: create _getfilepath()
+ # OK: del - conflict with WROOTDIR (do not update it)
+ # OK: dir/del - support for filemask ( * and ? )
+ # OK: how to define code injections: header\ender; and HANDLERS
+ # OK: units in header\ender? conline division...
+ # OK: _FILEPATH problem: it will not been defined at the moment when subscript0 starts - at the start TMPRD="_tmp"
+ # OK: del: if del("dir\\") - then all ok except it NOT deleted "dir\\" - _del function removed(renamed to __del)
+ # OK: tmpdirs: it delete only autotmp dir and only from script0
+ # OK: MICROTEST: global testing of filepath (UNC! CORRECT RESULTS! )
+ # question about cache: did new just now generated absolute filepath cached in FILECACHE? its seems like NO
+ # check _untmp: CONFLICT: if file or dir from autotmp dir will be untmp then it anyway will be deleted; but file or dir from other point never be deleted anyway - so what is the point of untmp?????
+ #ERRLOG: _setmpath: warning!!!!!
+ #___________________________________________________________________________________
+ ####################################################################################
+ # PUBLIC:
+ #___________________________________________________________________________________
+ #
+ # fn _rdfile(_filepath)
+ #
+ # Read and return data from file specified in _filepath.
+ # If _filepath=="" then no action occured and return "".
+ # Function read and return data from file. No any changes in data occured.
+ # Function use _filerdne function internally. If some syntax error
+ # found in _filepath then function return "".
+ # If some error occured while reading data from file then fuction return ""
+ # and error-text is in ERRNO(and no close-file action will be occured!).
+ # If reading data completed successfully then function try to close
+ # file and if while closing file some error occured then function
+ # returns "" and error-text is in ERRNO.
+ # Otherwise function returns readed data.
+ #_____________________________________________________________________________
+ #
+ # fn _wrfile(_filepath,_data)
+ #
+ # Write data into file specified in _filepath.
+ # If _filepath=="" then no action occured and return "".
+ # Function write _data to file. No any changes in data occured.
+ # Function use _filerdne function internally. If some syntax error
+ # found in _filepath then function return "".
+ # If some error occured while writing data to file then fuction return ""
+ # and error-text is in ERRNO(and no close-file action will be occured!).
+ # If writing data completed successfully then function try to close
+ # file and if while closing file some error occured then function
+ # returns "" and error-text is in ERRNO.
+ # Otherwise function returns _filepath(re-processed).
+ #___________________________________________________________________________________
+ #
+ # fn _filepath(_filepath)
+ #
+ # Return re-processed root-dir-name-ext of _filepath.
+ # If _filepath=="" then no action occured and return "".
+ # If some syntax error found in _filepath then function return ""
+ # (and NO _filepath-cache-record will be created!).
+ #_____________________________________________________________________________
+ #
+ # fn _filerdne(_filepath)
+ #
+ # Return re-processed root-dir-filename of _filepath.
+ # If _filepath=="" then no action occured and return "".
+ # Function return result only if in _filepath present file-name(name
+ # and/or extension) - otherwise its return "".
+ # If some syntax error found in _filepath then function return ""
+ # (and NO _filepath-cache-record will be created!).
+ #_____________________________________________________________________________
+ #
+ # fn _filerdn(_filepath)
+ #
+ # Return re-processed root-dir-name of _filepath.
+ # If _filepath=="" then no action occured and return "".
+ # Function return result only if in _filepath present name field -
+ # - otherwise its return "".
+ # If some syntax error found in _filepath then function return ""
+ # (and NO _filepath-cache-record will be created!).
+ #_____________________________________________________________________________
+ #
+ # fn _filerd(_filepath)
+ #
+ # Return re-processed root-dir of _filepath.
+ # If _filepath=="" then no action occured and return "".
+ # If some syntax error found in _filepath then function return ""
+ # (and NO _filepath-cache-record will be created!).
+ #_____________________________________________________________________________
+ #
+ # fn _filer(_filepath)
+ #
+ # Return re-processed root of _filepath.
+ # If _filepath=="" then no action occured and return "".
+ # If some syntax error found in _filepath then function return ""
+ # (and NO _filepath-cache-record will be created!).
+ #_____________________________________________________________________________
+ #
+ # fn _filed(_filepath)
+ #
+ # Return re-processed dir of _filepath.
+ # If _filepath=="" then no action occured and return "".
+ # There is only one case when dir string can be =="" - when in
+ # _filepath specified unmounted drive(MS-format) and from-
+ # current-location address used(like Z:file.ext). In this
+ # case no rootdir-cache-record will be created.
+ # If some syntax error found in _filepath then function return ""
+ # (and NO _filepath-cache-record will be created!).
+ #_____________________________________________________________________________
+ # fn _filene(_filepath)
+ #
+ # Return re-processed name-ext of _filepath.
+ # If _filepath=="" then no action occured and return "".
+ # Function return result only if in _filepath present file-name(name
+ # and/or extension) - otherwise its return "".
+ # If some syntax error found in _filepath then function return ""
+ # (and NO _filepath-cache-record will be created!).
+ #_____________________________________________________________________________
+ #
+ # fn _filen(_filepath)
+ #
+ # Return re-processed name of _filepath.
+ # If _filepath=="" then no action occured and return "".
+ # Function return result only if in _filepath present name field -
+ # - otherwise its return "".
+ # If some syntax error found in _filepath then function return ""
+ # (and NO _filepath-cache-record will be created!).
+ #_____________________________________________________________________________
+ #
+ # fn _file(_filepath)
+ #
+ # Return re-processed ext of _filepath.
+ # If _filepath=="" then no action occured and return "".
+ # Function return result only if in _filepath present ext field -
+ # - otherwise its return "".
+ # If some syntax error found in _filepath then function return ""
+ # (and NO _filepath-cache-record will be created!).
+ #___________________________________________________________________________________
+ #
+ # fn _dir(_ARR,_filepathmask)
+ #
+ # Get file-/folder-list of root-folder of _filepathmask.
+ # If _filepathmask=="" then no action occured and return "".
+ # _filepathmask can contain symbols like `*' and `?' as like
+ # its used in `dir'-shell command.
+ # Function gets file-/folder-list of specified root-dir-_filepathmask
+ # and return this list in array _ARR - where each element:
+ #
+ # index - is the _filepath of file-or-folder name-ext
+ # value - contains 3 fields separated by " ":
+ # 1. =="D" if this is folder
+ # ==/[0-9]+/ if this is file - size of file in bytes
+ # 2. ==date-of-creation of file or folder
+ # 3. ==time-of-creation of file or folder
+ #
+ # Function returns quantity of items in ARR.
+ #___________________________________________________________________________________
+ #
+ # fn _filexist(_filepath)
+ #
+ # Test if file or path or drive specified in _filepath is exist.
+ # If _filepath=="" then no action occured and return "".
+ # If some syntax error found in _filepath then function return ""
+ # (and NO _filepath-cache-record will be created!).
+ # Function returns _filepath if _filepath is exist. Otherwise
+ # function return 0.
+ #_____________________________________________________________________________
+ #
+ # fn _filenotexist(_filepath)
+ #
+ # Test if file or path or drive specified in _filepath is not exist.
+ # If _filepath=="" then no action occured and return "".
+ # If some syntax error found in _filepath then function return ""
+ # (and NO _filepath-cache-record will be created!).
+ # Function returns 1 if _filepath is not exist. Otherwise function
+ # return 0.
+ #_____________________________________________________________________________
+ #
+ # fn _newdir(_filepath)
+ #
+ # Create path specified in root-dir-_filepath.
+ # If _filepath=="" then no action occured and return "".
+ # If some syntax error found in _filepath then function return ""
+ # (and NO _filepath-cache-record will be created!).
+ # Function returns root-dir of _filepath.
+ #_______________________________________________________________________
+ #
+ # fn _newdir(_filepath)
+ #
+ # Create path specified in root-dir-_filepath. If this folder
+ # already exist then it will be completely cleared.
+ # If _filepath=="" then no action occured and return "".
+ # If some syntax error found in _filepath then function return ""
+ # (and NO _filepath-cache-record will be created!).
+ # Function returns root-dir of _filepath.
+ #___________________________________________________________________________________
+ #
+ # fn _getmpfile(_filepath,_currfilepath)
+ #
+ # Return ....
+ #
+ #_____________________________________________________________________________
+ #
+ # fn _getmpdir(_filepath,_currfilepath)
+ #
+ # Return ...
+ #
+ #_____________________________________________________________________________
+ #
+ # Temporary files folder.
+ #
+ # Temporary files folder location is defined by _FILEIO_TMPRD.
+ # If it wasn't been initialized before program run or not been initialized
+ # by ENVIRON["TMPDIR"] then it will defined as the:
+ # `current rootdir(stored in _FILEIO_RD)\programname.TMP'
+ # In this case if its already exist then it will completely cleared when _FILEIO
+ # library initialization processed.
+ # And at the program uninitialization processed it will completely
+ # cleared if _FILEIO_TMPCLRFLAG is true.
+ #___________________________________________________________________________________
+ #
+ # var _FILEIO_RD (ENVIRON["CD"])
+ #
+ # This var can be set before running program. It can contain path which
+ # will be used as default current dir while program run.
+ # If this var is set before program runs - then it will be refreshed by the
+ # _filerd it will be used as default current dir while program run.
+ # If this var is not set before program runs - then ENVIRON["CD"] can also
+ # set up default current dir while program run. If it set before program
+ # begin then it will be refreshed by the _filerd - and also writed into
+ # _FILEIO_RD.
+ # If both _FILEIO_RD and ENVIRON["CD"] are not set before program begins
+ # then real current root\dir will be writed into both _FILEIO_RD and
+ # ENVIRON["CD"] and it will be used as default current dir while program run.
+ #
+ #___________________________________________________________________________________
+ #
+ # var _FILEIO_TMPRD (ENVIRON["TMPRD"])
+ #
+ # This var can be set before running program. It can contain path which
+ # will be used as default temporary files root-folder while program run.
+ # If this var is set before program runs - then it will be refreshed by the
+ # _filerd - and also writed into ENVIRON["TMPRD"].
+ # If this var is not set before program runs - then ENVIRON["TMPRD"] can also
+ # set up default temporary files root-folder while program run. If it set
+ # before program begin then it will be refreshed by the _filerd - and
+ # also writed into _FILEIO_TMPRD.
+ # If both _FILEIO_TMPRD and ENVIRON["TMPRD"] are not set before program begins
+ # then new folder into path specified by the _FILEIO_RD(after its handling)
+ # will be writed into both _FILEIO_TMPRD and ENVIRON["TMPRD"] and it
+ # will be used as default temporary files root-folder while program run.
+ #___________________________________________________________________________________
+ #
+ # var _FILEPATH
+ #
+ # This var contain filepath of working script. It should be setting up externally.
+ #
+ # var _gawk_scriptlevel
+ #___________________________________________________________________________________
+ ####################################################################################
+ ###############################################################################
if (_constatstrln > 0) {
_constat()
}
@@ -300,6 +634,8 @@
function W(p, p0, p1)
{
if (isarray(p0)) {
+ #_______________________________________________________________________
+ #####################################################
delete p0[p]
if (isarray(p1)) {
for (i in p1) {
@@ -335,14 +671,20 @@
{
switch (c) {
case "_lib_CMDLN":
+ ##########################################################
+ #___________________________________________________________
return t
case "_lib_APPLY":
+ #___________________________________________________________
return
case "_lib_HELP":
+ #___________________________________________________________
return
case "_lib_NAMEVER":
+ #___________________________________________________________
return _ln("_ARR 1.0")
case "_lib_BEGIN":
+ #___________________________________________________________
return
case "_lib_END":
return
@@ -354,6 +696,7 @@
switch (c) {
case "_lib_CMDLN":
if (match(t, /^((--([Vv])ersion)|(-([Vv])))[ \t]*/, A)) {
+ ##########################################################
t = substr(t, RLENGTH + 1)
_cmdln_version = A[3] A[5]
} else {
@@ -366,6 +709,7 @@
}
}
}
+ #___________________________________________________________
return t
case "_lib_APPLY":
if (_cmdln_help) {
@@ -377,12 +721,16 @@
_out(_ln(_PRODUCT_NAME " v" _PRODUCT_VERSION) _ln(_PRODUCT_COPYRIGHT) _ln() ((_cmdln_version == "v" ? "" : _lib_NAMEVER())))
return _endpass(_basexit_fl = 1)
}
+ #___________________________________________________________
return
case "_lib_HELP":
+ #___________________________________________________________
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"))
case "_lib_NAMEVER":
+ #___________________________________________________________
return _ln("_BASE 3.0")
case "_lib_BEGIN":
+ #___________________________________________________________
return
case "_lib_END":
return
@@ -393,14 +741,22 @@
{
switch (c) {
case "_lib_CMDLN":
+ #____________________________________________________________________________
+ ######################################################
+ #___________________________________________________________
+ #_____________________________________________________
return t
case "_lib_APPLY":
+ #_____________________________________________________
return
case "_lib_HELP":
+ #_____________________________________________________
return (_ln() _ln(" Usage: " _PRODUCT_NAME " [/key1 /key2...] sourcefile [cmdline]") _ln())
case "_lib_NAMEVER":
+ #_____________________________________________________
return
case "_lib_BEGIN":
+ #_____________________________________________________
return
case "_lib_END":
return
@@ -416,9 +772,11 @@
switch (c) {
case "_lib_CMDLN":
if (match(t, /^[ \t]*-L:([TtVvIiWwEeFf]*)[ \t]*/, A)) {
+ ########################################################
t = substr(t, RLENGTH + 1)
_errlog_errflkey = _errlog_errflkey A[1]
}
+ #_______________________________________________________________________
return t
case "_lib_APPLY":
if (_errlog_errflkey) {
@@ -454,10 +812,13 @@
_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")))
}
}
+ #_______________________________________________________________________
return
case "_lib_HELP":
+ #_______________________________________________________________________
return (_ln(" -L:TtVvIiWwEeFf - enable(upcase: TVIWEF) or disable(lowcase: tviwef) allowable type of") _ln(" log messages. Trace/Verbose/Informational/Warning/Error/Fatal.") _ln())
case "_lib_NAMEVER":
+ #_______________________________________________________________________
return _ln("_ERRLOG 1.0")
case "_lib_BEGIN":
P["_ERRLOG_TF"] = _ERRLOG_TF
@@ -479,14 +840,20 @@
{
switch (c) {
case "_lib_CMDLN":
+ ########################################################
+ #___________________________________________________________
return t
case "_lib_APPLY":
+ #___________________________________________________________
return
case "_lib_HELP":
+ #___________________________________________________________
return
case "_lib_NAMEVER":
+ #___________________________________________________________
return _ln("_EXTFN 1.0")
case "_lib_BEGIN":
+ #___________________________________________________________
return
case "_lib_END":
return
@@ -498,6 +865,7 @@
switch (c) {
case "_lib_CMDLN":
if (match(t, /^[ \t]*-[Tt]([\+-])[ \t]*/, A)) {
+ #######################################################
t = substr(t, RLENGTH + 1)
if (A[1] == "+") {
_fileio_notdeltmpflag = 1
@@ -505,15 +873,19 @@
_fileio_notdeltmpflag = ""
}
}
+ #___________________________________________________________
return t
case "_lib_APPLY":
if (_fileio_notdeltmpflag) {
_info("Temporary objects deletion DISABLED (inherited)")
}
+ #___________________________________________________________
return
case "_lib_HELP":
+ #___________________________________________________________
return (_ln(" -[Tt][+-] - inherited: +enable\\-disable temporary files\\dirs deletion") _ln())
case "_lib_NAMEVER":
+ #___________________________________________________________
return _ln("_FILEIO 2.1")
case "_lib_BEGIN":
P["ENVIRON"]["CD"] = ENVIRON["CD"]
@@ -523,6 +895,7 @@
if (! ("_FILEIO_TMPRD" in P)) {
P["_FILEIO_TMPRD"] = _getmpdir(_filen(P["SOURCE"]) "." ++_egawk_subcntr _CHR["SUBDIR"])
}
+ #___________________________________________________________
return
case "_lib_END":
return
@@ -533,14 +906,23 @@
{
switch (c) {
case "_lib_CMDLN":
+ ############################################################
+ #_____________________________________________________________________________
+ #################################################
+ #___________________________________________________________
+ #_____________________________________________________
return t
case "_lib_APPLY":
+ #_____________________________________________________
return
case "_lib_HELP":
+ #_____________________________________________________
return
case "_lib_NAMEVER":
+ #_____________________________________________________
return
case "_lib_BEGIN":
+ #_____________________________________________________
return
case "_lib_END":
return
@@ -560,6 +942,8 @@
function _INITBASE()
{
+ #___________________________________________________________________________________
+ ################################################################
_egawk_utilpath = ENVIRON["EGAWK_PATH"] "BIN\\UTIL\\"
}
@@ -567,14 +951,20 @@
{
switch (c) {
case "_lib_CMDLN":
+ ######################################################
+ #___________________________________________________________
return t
case "_lib_APPLY":
+ #___________________________________________________________
return
case "_lib_HELP":
+ #___________________________________________________________
return
case "_lib_NAMEVER":
+ #___________________________________________________________
return _ln("_INSTRUC 1.0")
case "_lib_BEGIN":
+ #___________________________________________________________
return
case "_lib_END":
return
@@ -584,6 +974,10 @@
function _N(F, v, p)
{
for (p in _UIDS) {
+ #___________________________________________________________________________________
+ ####################################################################################
+ #_____________________________________________________________________________
+ ###########################################################
delete _UIDS[p]
return _nN_i0(p, F, v)
}
@@ -594,14 +988,20 @@
{
switch (c) {
case "_lib_CMDLN":
+ #####################################################
+ #___________________________________________________________
return t
case "_lib_APPLY":
+ #___________________________________________________________
return
case "_lib_HELP":
+ #___________________________________________________________
return
case "_lib_NAMEVER":
+ #___________________________________________________________
return _ln("_shortcut 1.0")
case "_lib_BEGIN":
+ #___________________________________________________________
return
case "_lib_END":
return
@@ -610,6 +1010,8 @@
function _START(t, i, A)
{
+ #______________________________________________________________________________________________
+ #########################################################################
_torexp_init()
test_uid()
return
@@ -639,6 +1041,7 @@
return
_tstini()
return
+ # _split_regpath()
_splitpath_test()
return
hh = "CPU"
@@ -669,8 +1072,12 @@
_dsbasepath = "\\\\CPU\\CPU\\DEV\\PROJECT\\_DS\\"
_rdreg(_REG, "HKEY_LOCAL_MACHINE\\SOFTWARE\\Altiris")
_wrfile("rego.txt", _dumparr(_REG))
+ #_______________________________________________________________________
_conl("fF")
+ #_________________________________________________________________________________________
c = _getreg_i1(DDD, "HKEY_LOCAL_MACHINE\\SOFTWARE\\Altiris\\Altiris Agent\\Plugin Objects\\\204~.*\224Install path", _REG)
+ #pp=_n()
+ #___________________________________________________________________________________
pp = _n("NAME", "NS")
p = _defsolution(pp, "DS Plug-in", "HKEY_LOCAL_MACHINE\\SOFTWARE\\Altiris\\Altiris Agent\\Plugin Objects\\Agents\\")
ClientConfiguration = _defdll(p, "Client Configuration", "ClientConfiguration")
@@ -689,6 +1096,7 @@
_defsrv(p, "DS Plug-in Service", "Altiris Deployment Solution - System Configuration")
_defreg(p, "Deployment Agent Path", "HKEY_LOCAL_MACHINE\\SOFTWARE\\Altiris\\Deployment\\AgentInstallPath.STR")
_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"), "")
+ #___________________________________________________________________________________
_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\\")))
p = _defsolution(pp, "DS Auto", "HKEY_LOCAL_MACHINE\\SOFTWARE\\Altiris\\Altiris Agent\\Plugin Objects\\Agents\\")
_defdir(p, "C:\\Boot\\Altiris\\iso\\boot\\fonts\\", "C:\\Boot\\Altiris\\iso\\boot\\fonts\\")
@@ -701,7 +1109,9 @@
_defile(p, "C:\\Boot\\Altiris\\iso\\bootmgr", "C:\\Boot\\Altiris\\iso\\bootmgr", "")
_defile(p, "C:\\Boot\\Altiris\\iso\\bootsect.exe", "C:\\Boot\\Altiris\\iso\\bootsect.exe", "")
_defreg(p, "Deployment Automation reg.File", "HKEY_LOCAL_MACHINE\\SOFTWARE\\Altiris\\AutoUtil\\File.XSZ", "autoutil.exe")
+ #_________________________________________________________________________________________
_defreg(p, "Deployment Automation reg.Path", "HKEY_LOCAL_MACHINE\\SOFTWARE\\Altiris\\AutoUtil\\Path.XSZ", "%systemdrive%\\boot\\altiris\\iso")
+ #_________________________________________________________________________________________
_check(pp)
_conl(_report(pp))
_wrfile("report.txt", _report(pp))
@@ -711,14 +1121,20 @@
{
switch (c) {
case "_lib_CMDLN":
+ #########################################################
+ #___________________________________________________________
return t
case "_lib_APPLY":
+ #___________________________________________________________
return
case "_lib_HELP":
+ #___________________________________________________________
return
case "_lib_NAMEVER":
+ #___________________________________________________________
return _ln("_SYSIO 1.0")
case "_lib_BEGIN":
+ #___________________________________________________________
return
case "_lib_END":
return
@@ -729,6 +1145,8 @@
{
if (isarray(v)) {
if (p) {
+ #_______________________________________________________________________
+ ########################################################################
delete A[p]
A[p][""]
delete A[p][""]
@@ -745,6 +1163,8 @@
function _Zexparr(S, s, t, i)
{
+ #_______________________________________________________________________
+ ##############################################
t = ""
if (isarray(S)) {
for (i in S) {
@@ -763,6 +1183,7 @@
function _Zexparr_i0(S, t, i)
{
for (i in S) {
+ #_________________________________________________________________
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"))
}
return t
@@ -770,6 +1191,7 @@
function _Zexparr_i1(t)
{
+ #_________________________________________________________________
gsub(/\x1B/, "\033;", t)
gsub(/\x11/, "\0331", t)
gsub(/\x10/, "\0330", t)
@@ -778,12 +1200,14 @@
function _Zexparr_i2(t)
{
+ #_________________________________________________________________
gsub(/\x10/, "\0330", t)
return t
}
function _Zexparr_i3(t)
{
+ #_________________________________________________________________
gsub(/\x1B/, "\033;", t)
gsub(/\x11/, "\0331", t)
return t
@@ -792,6 +1216,8 @@
function _Zimparr(D, t, A, B)
{
if (isarray(D)) {
+ #_______________________________________________________________________
+ ##############################################
split(t, A, /\x10/, B)
t = _Zimparr_i0(A, B, _Zimparr_i1(D, A, B, 1))
gsub(/\x1B\x30/, "\020", t)
@@ -802,12 +1228,14 @@
function _Zimparr_i0(A, B, i)
{
+ #_________________________________________________________________
return ((i in A ? A[i] B[i] _Zimparr_i0(A, B, i + 1) : ""))
}
function _Zimparr_i1(D, A, B, i, t, a, n)
{
while (i in B) {
+ #_________________________________________________________________
if ((t = A[i++]) == "\021\021") {
return i
}
@@ -830,6 +1258,7 @@
function _Zimparr_i2(t)
{
+ #_________________________________________________________________
gsub(/\x1B\x31/, "\021", t)
gsub(/\x1B\x3B/, "\033", t)
return t
@@ -838,6 +1267,8 @@
function _Zimport(t, p, A, c, i, n, B)
{
if (p) {
+ #_____________________________________________________________________________
+ ##############################################
c = split(t, B, /\x0A/)
for (i = 1; i <= c; i++) {
if ((t = B[i]) == "") {
@@ -913,6 +1344,8 @@
if (sf in S) {
if (isarray(S[sf])) {
if (df in D) {
+ #_______________________________________________________________________
+ ################################################
if (isarray(D[df])) {
return _extarr(D[df], S[sf])
}
@@ -932,6 +1365,8 @@
function _addarr(D, S)
{
+ #_________________________________________________________________
+ #############################################
if (isarray(S)) {
_addarr_i0(D, S)
}
@@ -941,6 +1376,7 @@
{
for (i in S) {
if (isarray(S[i])) {
+ #_____________________________________________________
delete D[i]
D[i][""]
delete D[i][""]
@@ -958,6 +1394,8 @@
if (_addarrmaski0 in S) {
if (isarray(S[_addarrmaski0])) {
if (! isarray(D[_addarrmaski0])) {
+ #_______________________________________________________________________
+ #############################################
delete D[_addarrmaski0]
D[_addarrmaski0][""]
delete D[_addarrmaski0][""]
@@ -981,12 +1419,18 @@
function _addf(A, f)
{
+ #___________________________________________________________________________________
+ ####################################################################################
+ #_______________________________________________________________________
+ #####################################################
A["B"][""] = A["F"][A["B"][f] = A["B"][""]] = f
}
function _addfile(f, d, a, b)
{
if ((f = _wfilerdnehnd(f)) == "" || _filene(f) == "") {
+ #___________________________________________________________
+ ##################################
ERRNO = "Filename error"
return
}
@@ -1010,16 +1454,27 @@
function _addlib(f)
{
+ #_____________________________________________________________________________
+ ###########################################################
_addf(_LIBAPI, f)
}
function _addlist(A, v)
{
+ #___________________________________________________________________________________
+ ####################################################################################
+ #_______________________________________________________________________
+ ##################################################
A[++A[0]] = v
}
function _bearray(A)
{
+ ##############################
+ #_______________________________________________________________________
+ ############################################
+ #_______________________________________________________________________
+ ####################################################
if (isarray(A) || A == 0 && A == "") {
return 1
}
@@ -1027,16 +1482,22 @@
function _bframe(A, t, p)
{
+ #_________________________________________________________________
+ ###########################################
return _bframe_i0(A, t, p, A[""])
}
function _bframe_i0(A, t, p, f)
{
+ #___________________________________________________________
return ((f ? _bframe_i0(A, t, p, A[f]) (@f(t, p)) : ""))
}
function _cfguid(p, optr, pfx, sfx, hstrcnt, lstrchr)
{
+ # add to _dumparr: checking that if element is undefined
+ #_______________________________________________________________________
+ #################### 0 #
delete _UIDOBL[p]
if (_isptr(optr)) {
if (optr == p) {
@@ -1064,6 +1525,7 @@
function _cfguidchr(p, h, l, H, L)
{
if (_isptr(l)) {
+ #_____________________________________________________
if (l != p) {
return (_UIDCHR[p] = _UIDCHR[l])
}
@@ -1082,6 +1544,7 @@
function _cfguidh(p, H, L, hi, h, li)
{
for (hi = 1; hi in H; hi++) {
+ #_______________________________________________
h = H[hi]
for (li = 1; li in L; li++) {
_UIDCHRH[p][h L[li]]
@@ -1102,6 +1565,12 @@
function _check(p)
{
+ #______________________________________________________________________________________________
+ #################################################################################
+ #______________________________________________________________________________________________
+ ################################################################################
+ #____________________________________________________________________________________________________
+ ####################################################################################
_dll_check(p)
_file_check(p)
_serv_check(p)
@@ -1110,11 +1579,15 @@
function _chrline(t, ts, w, s)
{
+ #_______________________________________________________________________
+ #############################################
return ((t = " " _tabtospc(t, ts) ((t ? (t ~ /[ \t]$/ ? "" : " ") : ""))) _getchrln((s ? s : "_"), ((w ? w : _CON_WIDTH - 1)) - length(t)) _CHR["EOL"])
}
function _cmd(c, i, A)
{
+ #_____________________________________________________________________________
+ #######################################################
_fio_cmda = RS
RS = ".{1,}"
_fio_cmdb = BINMODE
@@ -1131,6 +1604,8 @@
function _cmparr(A0, A1, R, a, i)
{
+ #_______________________________________________________________________
+ ##########################################
a = 0
delete R
for (i in A0) {
@@ -1155,6 +1630,8 @@
function _con(t, ts, a, b, c, d, i, r, A, B)
{
+ #_____________________________________________________________________________
+ ##########################################
d = RLENGTH
if ((c = split(r = t, A, /\x0D?\x0A/, B)) > 0) {
a = BINMODE
@@ -1195,6 +1672,8 @@
function _conin(t, a, b)
{
+ #_______________________________________________________________________
+ #################################################
_constatpush()
_constat()
a = BINMODE
@@ -1215,22 +1694,30 @@
function _conl(t, ts)
{
+ #_______________________________________________________________________
+ ####################################################
return _con(t ((t ~ /\x0A$/ ? "" : _CHR["EOL"])), ts)
}
function _conline(t, ts)
{
+ #_______________________________________________________________________
+ #################################################
return _con(_chrline(t, ts))
}
function _conlq(t, ts)
{
+ #___________________________________________________________________________________
+ ####################################################################################
return _conl("`" t "'", ts)
}
function _constat(t, ts, ln, a)
{
if (_constatstrln > (ln = length(t = _constatgtstr(_constatstr = _tabtospc(t, ts), _CON_WIDTH - 1 - _conlastrln)))) {
+ #_______________________________________________________________________
+ ###########################################
t = t _getchrln(" ", _constatstrln - ln)
}
_constatstrln = ln
@@ -1248,6 +1735,7 @@
function _constatgtstr(t, ln, a, b)
{
if (ln < 1) {
+ #_________________________________________________________________
return ""
}
if ((a = length(t)) <= ln) {
@@ -1265,6 +1753,8 @@
function _constatpop()
{
if (_CONSTATPUSH[0] > 0) {
+ #_______________________________________________________________________
+ ##################################################
return _constat(_CONSTATPUSH[_CONSTATPUSH[0]--])
}
return _constat("")
@@ -1272,6 +1762,8 @@
function _constatpush(t, ts)
{
+ #_______________________________________________________________________
+ #############################################
_CONSTATPUSH[++_CONSTATPUSH[0]] = _constatstr
if (t) {
_constat(t, ts)
@@ -1281,11 +1773,14 @@
function _creport(p, t, f, z)
{
+ #___________________________________________________________________________________
_[p]["REPORT"] = _[p]["REPORT"] _ln(t ((f == "" ? "" : ": " f)))
}
function _defdir(pp, n, f, v, p)
{
+ #_________________________________________________________________________________________
+ #############################################################
_[p = _wLCHLD(pp, _n("TYPE", "defdir"))]["NAME"] = n
_[p]["DIR"] = f
return p
@@ -1293,6 +1788,8 @@
function _defdll(pp, n, rn, p)
{
+ #_________________________________________________________________________________________
+ ##############################################################
_[p = _wLCHLD(pp, _n("TYPE", "defdll"))]["NAME"] = n
_[p]["REGPATH"] = _[pp]["REGPATH"] rn
_[p]["ERRHOST"] = pp
@@ -1304,6 +1801,7 @@
if (isarray(S)) {
for (i = 0; i < 256; i++) {
if ((c = _CHR[i]) ~ r) {
+ #___________________________________________________________
D[c] = "\\" S[c]
t = t c
} else {
@@ -1331,6 +1829,8 @@
function _defile(pp, n, f, v, p)
{
+ #_________________________________________________________________________________________
+ #############################################################
_[p = _wLCHLD(pp, _n("TYPE", "defile"))]["NAME"] = n
_[p]["FILE"] = f
if (! (v == 0 && v == "")) {
@@ -1341,11 +1841,15 @@
function _defn(f, c, v)
{
+ #_______________________________________________________________________
+ ###################################################
FUNCTAB[c f] = v
}
function _defreg(pp, n, f, v, p)
{
+ #_________________________________________________________________________________________
+ #############################################################
_[p = _wLCHLD(pp, _n("TYPE", "defreg"))]["NAME"] = n
_[p]["REGPATH"] = f
if (! (v == 0 && v == "")) {
@@ -1355,6 +1859,8 @@
function _defsolution(pp, n, rn, p)
{
+ #_______________________________________________________________________________________________
+ ###############################################################
_[p = _wLCHLD(pp, _n("TYPE", "solution"))]["NAME"] = n
_[p]["REGPATH"] = rn
_[p]["ERRHOST"] = pp
@@ -1363,6 +1869,8 @@
function _defsrv(pp, n, f, v, p)
{
+ #_________________________________________________________________________________________
+ #############################################################
_[p = _wLCHLD(pp, _n("TYPE", "defsrv"))]["NAME"] = n
_[p]["SERVNAME"] = f
return p
@@ -1372,6 +1880,8 @@
{
if (match(f, /\\[ \t]*$/)) {
if ((c = toupper(_filerd(f))) && length(f) == FLENGTH) {
+ #_______________________________________________________________________
+ #################################################
_cmd("rd " c " /S /Q 2>NUL")
_deletepfx(_WFILEROOTDIR, c)
_deletepfx(_FILEIO_RDTMP, c)
@@ -1398,18 +1908,24 @@
function _delay(t, a)
{
for (a = 1; a <= t; a++) {
+ #_______________________________________________________________________
+ ###################################################
_delayms()
}
}
function _delayms(a)
{
+ #_________________________________________________________________
+ #############################################
for (a = 1; a <= _delay_perfmsdelay; a++) {
}
}
function _deletepfx(A, f, B, le, i)
{
+ #_______________________________________________________________________
+ ########################################
le = length(f)
for (i in A) {
if (substr(toupper(i), 1, le) == f) {
@@ -1421,6 +1937,8 @@
function _delf(A, f)
{
+ #_________________________________________________________________
+ ###############################################
A["B"][A["F"][A["B"][f]] = A["F"][f]] = A["B"][f]
delete A["F"][f]
delete A["B"][f]
@@ -1429,6 +1947,8 @@
function _deluid(p)
{
if (p in _CLASSPTR) {
+ #_______________________________________________________________________
+ ################################################# 1 #
_deluida0 = _CLASSPTR[p]
if (_deluida0 in _UIDOBL) {
_UIDOBLV[_UIDOBL[_deluida0]][p]
@@ -1440,6 +1960,8 @@
function _dir(A, rd, i, r, f, ds, pf, B, C)
{
+ #_______________________________________________________________________
+ ####################################
delete A
gsub(/(^[ \t]*)|([ \t]*$)/, "", rd)
if (rd == "") {
@@ -1468,6 +1990,8 @@
function _dirtree(A, f, B)
{
+ #_________________________________________________________________
+ #########################################
gsub(/(^[ \t]*)|([ \t]*$)/, "", f)
delete A
A[""]
@@ -1478,6 +2002,7 @@
function _dirtree_i0(B, i, c, A, f, lf, a, C)
{
+ #___________________________________________________________
delete A[f]
A[f][0]
delete A[f][0]
@@ -1500,8 +2025,10 @@
function _dll_check(pp)
{
+ #_______________________________________________________________________
_dllchktv = ""
_missfl = 1
+ #also check that all dll have same version; also check that all dlls have success and then report that DS plug-in version n - installed
_tframe("_dll_check_i0", pp, _REG, pp)
if (1 || "AGENT" in _[pp]) {
if (_dllchktv != _[pp][".Product Version"]) {
@@ -1520,10 +2047,12 @@
function _dll_check_i0(p, R, pp, p2, i, i2, r, f, v, rs, d, tv, tf)
{
if (_[p]["TYPE"] == "defdll") {
+ #_______________________________________________
r = toupper(_[p]["REGPATH"])
rs = 0
tf = 0
tv = ""
+ #{ rs=_missfl=1; _[p]["." gensub(/^([^\\]+\\)+(.*)\..../,"\\2","G",i)]=R[i] } }
for (i in R) {
if (toupper(substr(i, 1, length(r))) == r) {
if ((_chka0 = substr(i, 1 + length(r), 1)) == "" || _chka0 == "\\") {
@@ -1578,6 +2107,7 @@
{
if (_[p]["TYPE"] == "defdll") {
for (i in _[p]) {
+ #_______________________________________________
if (i ~ /^\./) {
_dllerr(pp, " " _[p]["REGPATH"] "\\" substr(i, 2))
}
@@ -1587,6 +2117,7 @@
function _dllerr(p, t, f)
{
+ #___________________________________________________________________________________
if (t !~ /\x00/) {
t = "ERROR: \000" t
}
@@ -1626,6 +2157,8 @@
function _dumparr(A, t, lv, a)
{
+ #_______________________________________________________________________
+ ############################################
b = PROCINFO["sorted_in"]
PROCINFO["sorted_in"] = "_lengthsort"
if (isarray(A)) {
@@ -1639,6 +2172,7 @@
function _dumparr_i1(A, lv, ls, ln, t, t2, i, a, f)
{
+ #___________________________________________________________
t2 = _getchrln(" ", length(t))
if (ln == lv) {
if (ls > 0) {
@@ -1681,6 +2215,12 @@
function _dumpobj(p, f, t, s)
{
+ #___________________________________________________________________________________
+ ####################################################################################
+ #___________________________________________________________________________________
+ # OTHER tFUNCTIONs #################################################################
+ #_____________________________________________________________________________
+ ###################################################
s = _dumpobj_i0(p, f, t = t "." p "{")
if (p = _rFCHLD(p)) {
return (s = s _dumpobjm(p, f, (s ? _getchrln(" ", length(t) - 1) : t " ")))
@@ -1690,6 +2230,7 @@
function _dumpobj_i0(p, f, t)
{
+ #___________________________________________________________
if (f == "") {
return _dumpobj_i2(p, t)
}
@@ -1701,11 +2242,13 @@
function _dumpobj_i1(p, t)
{
+ #___________________________________________________________
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))
}
function _dumpobj_i2(p, t)
{
+ #___________________________________________________________
return (_dumpobj_i3(_[p], t " ") _dumpobj_i3(_ptr[p], _getchrln(" ", length(t)) "`", "`"))
}
@@ -1713,6 +2256,7 @@
{
if (isarray(A)) {
for (i in A) {
+ #___________________________________________________________
t2 = _getchrln(" ", length(t))
for (i in A) {
if (isarray(A[i])) {
@@ -1734,6 +2278,7 @@
function _dumpobj_i4(t)
{
+ #___________________________________________________________
if (length(t) > 64) {
return (substr(t, 1, 28) " ... " substr(t, length(t) - 28))
}
@@ -1742,11 +2287,15 @@
function _dumpobj_nc(p, f, t)
{
+ #_________________________________________________________________
+ #######################################
return _dumpobj_i0(p, f, t "." p "{ ")
}
function _dumpobjm(p, f, t, s, t2)
{
+ #_________________________________________________________________
+ ###################################
t2 = _getchrln(" ", length(t))
do {
s = s _dumpobj(p, f, t)
@@ -1757,6 +2306,8 @@
function _dumpobjm_nc(p, f, t, s, t2)
{
+ #_________________________________________________________________
+ ################################
t2 = _getchrln(" ", length(t))
do {
s = s _dumpobj_nc(p, f, t)
@@ -1790,6 +2341,7 @@
function _dumpval(v, n)
{
+ #_____________________________________________________________________________
_dumpstr = _dumpstr (v = _ln(((n == 0 && n == "" ? "RET" : n)) ": " ((v == 0 && v == "" ? "-" : v "'"))))
return v
}
@@ -1798,14 +2350,20 @@
{
switch (c) {
case "_lib_CMDLN":
+ ########################################################
+ #___________________________________________________________
return t
case "_lib_APPLY":
+ #___________________________________________________________
return
case "_lib_HELP":
+ #___________________________________________________________
return
case "_lib_NAMEVER":
+ #___________________________________________________________
return _ln("_extfn 1.0")
case "_lib_BEGIN":
+ #___________________________________________________________
return
case "_lib_END":
return
@@ -1814,11 +2372,14 @@
function _endpass(t)
{
+ #_________________________________________________________________
_endpass_v0 = t
}
function _err(t, a, b)
{
+ #_______________________________________________________________________
+ ###################################################
a = BINMODE
b = ORS
BINMODE = "rw"
@@ -1832,12 +2393,16 @@
function _errnl(t)
{
+ #_________________________________________________________________
+ ################################################
return _err(t ((t ~ /\x0A$/ ? "" : _CHR["EOL"])))
}
function _error(t, d, A)
{
if (_ERRLOG_EF) {
+ #_______________________________________________________________________
+ #################################################
A["TYPE"] = "ERROR"
A["TEXT"] = t
_log(A, d)
@@ -1846,11 +2411,15 @@
function _exit(c)
{
+ #_______________________________________________________________________
+ #######################################################
exit c
}
function _export_data(t, i, A)
{
+ #_____________________________________________________________________________
+ #################################################
A["DATA"] = t
A["ID"] = i
_expout("_DATA: " _Zexparr(A) "\n")
@@ -1858,6 +2427,10 @@
function _expout(t, d, a, b)
{
+ #___________________________________________________________________________________
+ ####################################################################################
+ #_____________________________________________________________________________
+ ####################################################
a = BINMODE
b = ORS
BINMODE = "rw"
@@ -1870,6 +2443,9 @@
function _extfn_init()
{
+ #_________________________________________________________________________________________
+ ##########################################################################################
+ ##############################################################
_formatstrs_init()
_formatstrd_init()
_formatrexp_init()
@@ -1902,6 +2478,8 @@
function _fatal(t, d, A)
{
if (_ERRLOG_FF) {
+ #_______________________________________________________________________
+ #################################################
A["TYPE"] = "FATAL"
A["TEXT"] = t
_log(A, d)
@@ -1933,16 +2511,22 @@
function _fframe(A, t, p)
{
+ ##################
+ #_______________________________________________________________________
+ #################################################
return _fframe_i0(A, t, p, A[""])
}
function _fframe_i0(A, t, p, f)
{
+ #___________________________________________________________
return ((f ? (@f(t, p)) _fframe_i0(A, t, p, A[f]) : ""))
}
function _file(f)
{
+ #_________________________________________________________________
+ #################################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -1952,6 +2536,7 @@
function _file_check(p)
{
if (1 || "AGENT" in _[p]) {
+ #_______________________________________________________________________
_tframe("_file_check_i0", p, p)
}
}
@@ -1959,6 +2544,7 @@
function _file_check_i0(p, pp, p1, p2, f, v)
{
if (_[p]["TYPE"] == "defile") {
+ #_______________________________________________
f = _[p]["FILE"]
f = ((match(f, /^.:/) ? "" : _[_[pp]["AGENT"]][".Install Path"] "\\")) _[p]["FILE"]
if ("RQVERSION" in _[p]) {
@@ -1988,6 +2574,8 @@
function _filed(f, dd, d)
{
+ #_________________________________________________________________
+ ##########################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2011,6 +2599,8 @@
function _filen(f)
{
+ #_________________________________________________________________
+ ################################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2019,6 +2609,8 @@
function _filene(f)
{
+ #_________________________________________________________________
+ ###############################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2027,6 +2619,8 @@
function _filenotexist(f, a)
{
+ #_________________________________________________________________
+ ######################################
if (f == "") {
return ""
}
@@ -2043,6 +2637,8 @@
function _filepath(f, dd)
{
+ #_______________________________________________________________________
+ ################################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2051,6 +2647,8 @@
function _filer(f, dd)
{
+ #_________________________________________________________________
+ #############################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2065,6 +2663,8 @@
function _filerd(f, dd)
{
+ #_________________________________________________________________
+ ############################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2073,6 +2673,8 @@
function _filerdn(f, dd)
{
+ #_________________________________________________________________
+ ###########################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2081,6 +2683,8 @@
function _filerdne(f, dd)
{
+ #_________________________________________________________________
+ ##########################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2097,6 +2701,7 @@
{
if (st) {
if ((c = toupper(st)) in _FILECACHE) {
+ #___________________________________________________________
FLENGTH = length(st)
return _FILECACHE[c]
}
@@ -2149,6 +2754,8 @@
function _filexist(f, a)
{
+ #_______________________________________________________________________
+ ################################################
if (f == "") {
return ""
}
@@ -2166,6 +2773,8 @@
function _fn(f, p0, p1, p2)
{
+ #_______________________________________________________________________
+ ################################################
if (f in FUNCTAB) {
return @f(p0, p1, p2)
}
@@ -2174,6 +2783,8 @@
function _foreach(A, f, r, p0, p1, p2, i, p)
{
if (isarray(A)) {
+ #_______________________________________________________________________
+ ####################################
_TMP0[p = _n()]["."] = 1
_foreach_i0(A, f, _TMP0[p], p0, p1, p2)
return _th0(_retarr(_TMP0[p]), _tdel(p))
@@ -2188,6 +2799,7 @@
function _foreach_i0(A, f, D, p0, p1, p2)
{
for (i in A) {
+ #_____________________________________________________
if (isarray(A[i])) {
_foreach_i0(A[i], f, D, p0, p1, p2)
} else {
@@ -2198,11 +2810,13 @@
function _foreach_i1(p, f, D, p0, p1, p2)
{
+ #_____________________________________________________
_gen(D, @f(p, p0, p1, p2))
}
function _formatrexp(t)
{
+ #_____________________________________________________________________________
_formatstrq0 = split(t, _FORMATSTRA, /[\/\x00-\x1F\x80-\xFF]/, _FORMATSTRB)
_formatstrs0 = ""
for (t = 1; t < _formatstrq0; t++) {
@@ -2213,6 +2827,7 @@
function _formatrexp_init()
{
+ #___________________________________________________________
_defescarr(_FORMATREXPESC, "[\\x00-\\x1F\\x80-\\xFF]", _QASC)
_defescarr(_FORMATREXPESC, "\\/", "\\")
_FORMATREXPESC["\t"] = "\\t"
@@ -2220,6 +2835,7 @@
function _formatstrd(t)
{
+ #_____________________________________________________________________________
_formatstrq0 = split(t, _FORMATSTRA, /["\x00-\x1F\x80-\xFF]/, _FORMATSTRB)
_formatstrs0 = ""
for (t = 1; t < _formatstrq0; t++) {
@@ -2230,6 +2846,7 @@
function _formatstrd_init()
{
+ #___________________________________________________________
_defescarr(_FORMATSTRDESC, "[\\x00-\\x1F\\x80-\\xFF]", _QASC)
_defescarr(_FORMATSTRDESC, "[\\\\\"]", "\\")
_FORMATSTRDESC["\t"] = "\\t"
@@ -2237,6 +2854,9 @@
function _formatstrs(t)
{
+ #__________________________________________________________________________________
+ ####################################################################################
+ #___________________________________________________________________________________
_formatstrq0 = split(t, _FORMATSTRA, /['\x00-\x1F\x80-\xFF]/, _FORMATSTRB)
_formatstrs0 = ""
for (t = 1; t < _formatstrq0; t++) {
@@ -2247,6 +2867,7 @@
function _formatstrs_init()
{
+ #___________________________________________________________
_defescarr(_FORMATSTRSESC, "[\\x00-\\x1F\\x80-\\xFF]", _QASC)
_defescarr(_FORMATSTRSESC, "[\\\\']", "\\")
_FORMATSTRSESC["\t"] = "\\t"
@@ -2257,6 +2878,8 @@
_conl()
_conline(q)
_conl()
+ #_arregpath(D,S)
+ #_conl(_dumparr(D))
q = _patharr0(S, q)
_conl(_dumparr(S))
_conl()
@@ -2265,11 +2888,14 @@
function _fthru(A, c, p, B)
{
+ #_______________________________________________________________________
+ ########################################################################
return _fthru_i0(A, c, p, B, A[""])
}
function _fthru_i0(A, c, p, B, f)
{
+ #_________________________________________________________________
return ((f ? @f(c, _fthru_i0(A, c, p, B, A[f]), B) : ""))
}
@@ -2282,6 +2908,8 @@
function _gensubfn(t, r, f, p0, A)
{
+ #_____________________________________________________________________________
+ ###############################################
if (match(t, r, A)) {
return (substr(t, 1, RSTART - 1) (@f(_th0(substr(t, RSTART, RLENGTH), t = substr(t, RSTART + RLENGTH)), A, p0)) _gensubfn(t, r, f, p0))
}
@@ -2290,17 +2918,21 @@
function _get_errout(p)
{
+ #_____________________________________________________________________________
+ #######################################################
return _tframe("_get_errout_i0", p)
}
function _get_errout_i0(p, t, n, a)
{
+ #_______________________________________________________________________
return ((p in _tLOG ? _get_errout_i1(p) _get_errout_i3(p) : ""))
}
function _get_errout_i1(p, t, n, a)
{
if (p in _tLOG) {
+ #_________________________________________________________________
n = ""
if (_tLOG[p]["TYPE"]) {
n = _tLOG[p]["TYPE"] ": " _get_errout_i2(p)
@@ -2316,12 +2948,14 @@
function _get_errout_i2(p)
{
+ #_______________________________________________________________________
return (("FILE" in _tLOG[p] ? _tLOG[p]["FILE"] (("LINE" in _tLOG[p] ? "(" _tLOG[p]["LINE"] ")" : "")) ": " : ""))
}
function _get_errout_i3(p, t, ts, cl, cp, cr, a, b)
{
if ("LSTR" in _tLOG[p]) {
+ #_______________________________________________________________________
t = _tLOG[p]["FULLSTR"]
ts = _tLOG[p]["TS"]
cp = "^"
@@ -2339,12 +2973,15 @@
function _get_logout(p)
{
+ #_____________________________________________________________________________
+ #######################################################
return _tframe("_get_logout_i0", p)
}
function _get_logout_i0(p, t, n, a)
{
if (p in _tLOG) {
+ #_______________________________________________________________________
n = (("DATE" in _tLOG[p] ? _tLOG[p]["DATE"] " " : "")) (("TIME" in _tLOG[p] ? _tLOG[p]["TIME"] " " : ""))
if (_tLOG[p]["TYPE"]) {
n = n _tLOG[p]["TYPE"] ": " (("FILE" in _tLOG[p] ? _tLOG[p]["FILE"] (("LINE" in _tLOG[p] ? "(" _tLOG[p]["LINE"] ")" : "")) ": " : ""))
@@ -2360,6 +2997,9 @@
function _getchrln(s, w)
{
+ #_______________________________________________________________________
+ #################################################
+ #if ( w!=w+0 || w<0 ) w=_CON_WIDTH
if (s == "") {
return
}
@@ -2383,11 +3023,15 @@
function _getdate()
{
+ #_______________________________________________________________________
+ #####################################################
return strftime("%F")
}
function _getfilepath(t, f, al, b, A)
{
+ #_____________________________________________________________________________
+ ############################################
ERRNO = ""
if (match(t, /^[ \t]*(("([^"]*)"[ \t]*)|([`']([^']*)'[ \t]*)|(([^ \t]+)[ \t]*))/, A)) {
al = RLENGTH
@@ -2406,6 +3050,7 @@
function _getfilever(f)
{
+ #############################################################
split(_cmd(_fileverpath " \"" f "\""), _GETFILEVERA0, /[ \t]+/)
if (_GETFILEVERA0[5]) {
return _GETFILEVERA0[5]
@@ -2414,11 +3059,15 @@
function _getime()
{
+ #_________________________________________________________________
+ ################################################
return strftime("%H:%M:%S")
}
function _getmpdir(f, dd)
{
+ #_________________________________________________________________
+ ##########################################
if (! dd || ! (dd = _filerd(dd))) {
dd = _FILEIO_TMPRD
}
@@ -2430,6 +3079,8 @@
function _getmpfile(f, dd)
{
+ #_________________________________________________________________
+ #########################################
if (! dd || ! (dd = _filerd(dd))) {
dd = _FILEIO_TMPRD
}
@@ -2441,6 +3092,8 @@
function _getperf(o, t, a)
{
+ #_______________________________________________________________________
+ ###############################################
(o == "" ? ++_getperf_opcurr : _getperf_opcurr = o)
if ((a = _getsecond()) != _getperf_last) {
_getperf_opsec = (_getperf_opcurr - _getperf_opstart) / ((_getperf_last = a) - _getperf_start)
@@ -2451,6 +3104,7 @@
function _getperf_(o, t, a)
{
+ #___________________________________________________________
if (a >= _getperf_end) {
return 0
}
@@ -2464,6 +3118,7 @@
function _getperf_noe(o, t, a)
{
if (_getperf_opsecp != _getperf_opsec) {
+ #___________________________________________________________
_constat(((_constatstr == _getperf_stat ? _getperf_statstr : _getperf_statstr = _constatstr)) t " [TIME=" (a - _getperf_start) " sec(" (_getperf_opsecp = _getperf_opsec) " ops/sec)]")
_getperf_stat = _constatstr
}
@@ -2472,11 +3127,13 @@
function _getperf_noenot(o, t, a)
{
+ #___________________________________________________________
return 1
}
function _getperf_not(o, t, a)
{
+ #___________________________________________________________
if (a < _getperf_end) {
return 1
}
@@ -2484,6 +3141,8 @@
function _getreg_i1(D, r, R, a, i, il, ir, rc, B)
{
+ #_________________________________________________________________________________________
+ ##########################################################################################
a = IGNORECASE
IGNORECASE = 1
r = "^" _torexp(r)
@@ -2508,11 +3167,15 @@
function _getsecond()
{
+ #_________________________________________________________________
+ #############################################
return systime()
}
function _getsecondsync(a, c, b, c2)
{
+ #___________________________________________________________
+ ##########################
a = systime()
while (a == systime()) {
++c
@@ -2524,6 +3187,8 @@
{
if (p in _UIDOBL) {
for (_tptr in _UIDOBLV[_getuida0 = _UIDOBL[p]]) {
+ #_______________________________________________________________________
+ ################################################# 1 #
delete _UIDOBLV[_getuida0][_tptr]
_CLASSPTR[_tptr] = p
return _tptr
@@ -2537,6 +3202,7 @@
{
if ("" == (_tptr = UL[_UIDCNTL[p]])) {
for (_tptr in UH) {
+ #_____________________________________________________
delete UH[_tptr]
return ((_UIDCNTH[p] = _tptr) (_UIDCNTL[p] = UL[""]))
}
@@ -2552,6 +3218,8 @@
function _hexnum(n, l)
{
+ #_____________________________________________________________________________
+ #########################################################
if (l + 0 < 1) {
l = 2
}
@@ -2561,6 +3229,8 @@
function _igetperf(t, s, o)
{
if (t == 0 && t == "" && s == 0 && s == "" && o == 0 && o == "") {
+ #_________________________________________________________________
+ ######################################### # t-test period in seconds(==0 ? no period; s(=true/false)-output/not output status; o-qnt of ops before test start
if (_getperf_fn !~ /not$/ && _constatstr == _getperf_stat) {
_constat(_getperf_statstr)
}
@@ -2590,6 +3260,8 @@
function _info(t, d, A)
{
if (_ERRLOG_IF) {
+ #_______________________________________________________________________
+ ##################################################
A["TYPE"] = "INFO"
A["TEXT"] = t
_log(A, d)
@@ -2598,6 +3270,8 @@
function _ini(p, cs, dptr, pfx, sfx, hstr, lstr)
{
+ # test with the different path types
+ # _conl(_ln("SRC:") _dumparr(S)); _conl();
return _inituid(p, cs, dptr, pfx, sfx, hstr, lstr, A)
}
@@ -2641,6 +3315,7 @@
function _initspecialuid()
{
+ #_________________________________________
_NOINDEX = _getuid()
_LEN = _getuid()
_PTR = _getuid()
@@ -2656,6 +3331,8 @@
function _inituid(p, cs, dptr, pfx, sfx, hstr, lstr, A)
{
if (cs == 0 && cs == "") {
+ #_______________________________________________________________________
+ ################### 1 #
cs = p
p = _getuid()
}
@@ -2718,6 +3395,8 @@
if (sf in S) {
if (isarray(S[sf])) {
if (df in D) {
+ #_______________________________________________________________________
+ ################################################
if (isarray(D[df])) {
return _extarr(D[df], S[sf])
}
@@ -2737,17 +3416,23 @@
function _insf(A, f)
{
+ #_________________________________________________________________
+ ###############################################
A["F"][""] = A["B"][A["F"][f] = A["F"][""]] = f
}
function _insframe(A, f)
{
+ #_________________________________________________________________
+ ###########################################
A[f] = A[""]
A[""] = f
}
function _inspass(A, f)
{
+ ########################
+ #_________________________________________________________________
A[f] = A[""]
A[""] = f
}
@@ -2755,6 +3440,9 @@
function _isptr(p)
{
if (isarray(p)) {
+ # there is problem with string's format: i can;t easilly merge 2 charsets: comma-divided and every-char-divided strings
+ #_______________________________________________________________________
+ ################################################## 1 #
is = _NOP
it = "A"
return 0
@@ -2774,6 +3462,8 @@
function _istr(p)
{
if (isarray(p)) {
+ #_______________________________________________________________________
+ ################################################### 1 #
is = _NOP
it = "A"
return 0
@@ -2788,47 +3478,59 @@
function _lengthsort(i1, v1, i2, v2)
{
+ #_________________________________________________________________
+ ##############################
return ((length(i1) < length(i2) ? -1 : (length(i1) > length(i2) ? 1 : (i1 < i2 ? -1 : 1))))
}
function _lib_APPLY()
{
+ #_________________________________________________________________
return _ffaccr(_LIBAPI, "_lib_APPLY")
}
function _lib_BEGIN(A)
{
+ #_________________________________________________________________
return _ffaccr(_LIBAPI, "_lib_BEGIN", "", A)
}
function _lib_CMDLN(t)
{
+ #_______________________________________________________________________
return _pass(_LIBAPI["F"], "_lib_CMDLN", t)
}
function _lib_END(A)
{
+ #_________________________________________________________________
return _ffaccr(_LIBAPI, "_lib_END", "", A)
}
function _lib_HELP()
{
+ #_________________________________________________________________
return _fbaccr(_LIBAPI, "_lib_HELP")
}
function _lib_NAMEVER()
{
+ #_________________________________________________________________
return _fbaccr(_LIBAPI, "_lib_NAMEVER")
}
function _ln(t)
{
+ #_____________________________________________________________________________
+ ###############################################################
return ((t ~ /\x0A$/ ? t : t _CHR["EOL"]))
}
function _log(A, p, a, B)
{
if (isarray(A)) {
+ #_________________________________________________________________
+ ###########################################
A["TIME"] = _getime()
A["DATE"] = _getdate()
if (p) {
@@ -2848,6 +3550,8 @@
function _lspctab(t, ts, l, l1, l2, A)
{
while (match(t, /^(\t*)( *)((\t*)(.*))$/, A)) {
+ #_________________________________________________________________
+ ################################
if (A[1, "length"] >= l) {
return substr(t, l + 1)
}
@@ -2887,6 +3591,8 @@
function _movarr(D, S)
{
+ #_______________________________________________________________________
+ ###################################################
delete D
D[""]
delete D[""]
@@ -2912,6 +3618,11 @@
function _mpudefaulthnd(F, D, C, p1, p2, p3)
{
+ #
+ # /rexpstr/ -> datastr
+ # (\x00\t\+)* -> 28 00 09 5B 2B 29
+ #
+ # unesc all non-rexp characters: replace unesc of rexp-characters but do not remove it: \* -> \*, \x2A -> \*, \052 -> \*, \\ -> \#
_mpuretsub(D, _mpucc0)
}
@@ -2957,6 +3668,7 @@
_conl("WARNING: unclosed expression: `" d _mpuacc "'")
_mpuacc = d _mpuacc
}
+ # collect: _mpuacc=_retarr(D) _mpuacc
_retarrm(D, q, "", (_mpufn0 == -1 ? _th0(d, _mpusubwrng("WARNING: unclosed expression", d _mpuacc)) : ""))
_conl("mpusub exit: _mpuacc: `" _mpuacc "'")
}
@@ -2964,6 +3676,8 @@
function _n(F, v, p)
{
for (p in _UIDSDEL) {
+ #_______________________________________________________________________
+ #####################################################
delete _UIDSDEL[p]
delete _ptr[p]
delete _tPREV[p]
@@ -2987,6 +3701,7 @@
function _nN_i0(p, F, v)
{
+ #_____________________________________________________
_[p][""]
delete _[p][""]
_ptr[p][""]
@@ -3023,6 +3738,8 @@
function _newclrdir(f)
{
+ #_________________________________________________________________
+ ############################################
if ((f = _filerd(f)) == "") {
return
}
@@ -3034,6 +3751,8 @@
function _newdir(f)
{
+ #_______________________________________________________________________
+ #####################################################
if ((f = _filerd(f)) == "") {
return
}
@@ -3052,6 +3771,23 @@
{
if ((i = (i == "" ? 1 : i + 0)) <= (q = A[_ARRLEN])) {
if (i <= (r = q - 16)) {
+ #_____________________________________________________
+ # _retarr(ARRAY,start,prefixtr,postfixtr)
+ # Return string collected from elements of ARRAY.
+ # 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
+ # 0,-1,-.... The last data element in the ARRAY have the highest numeric index that is stored in ARRAY[_ARRLEN].
+ # Optimized for very large data size.
+ #
+ # IN: ARRAY - source data array(is ARRAY is not array then return undefined)
+ # start - (optional) start index in ARRAY; if missed or have non-numeric value then start array index will be 1.
+ # prefixst - the string that will be inserted in the begin of generated return string
+ # postfix - the string that will be added at the end of generated return string
+ # MOD: -
+ # OUT: -
+ # RETURN: undefined - if ARRAY is not array; if ARRAY is empty; if start is higher than ARRAY last element index
+ # string - collected string: prefixtr-arraydata-postfixtr
+ #_________________________________________________________________
+ #####################################
_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]
while (i < r) {
_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]
@@ -3070,6 +3806,8 @@
{
if ((i = (i == "" ? 1 : i + 0)) <= (q = A[_ARRLEN])) {
if (i <= (r = q - 16)) {
+ #___________________________________________________________
+ ##############################
_ARRSTR = A[i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i]
while (i < r) {
_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]
@@ -3088,6 +3826,10 @@
function _out(t, a, b)
{
+ #___________________________________________________________________________________
+ ####################################################################################
+ #___________________________________________________________________________________
+ ###############################################################
a = BINMODE
b = ORS
BINMODE = "rw"
@@ -3101,6 +3843,8 @@
function _outnl(t)
{
+ #_________________________________________________________________
+ ################################################
return _out(t ((t ~ /\x0A$/ ? "" : _CHR["EOL"])))
}
@@ -3154,6 +3898,8 @@
function _pass(A, f, t, p2, i, a)
{
+ #_______________________________________________________________________
+ ###########################################
a = _endpass_v0
_endpass_v0 = ""
i = 1
@@ -3174,6 +3920,9 @@
function _patharr0(D, q, i, h, A, B)
{
+ # this is somnitelno: that / / . / / com 56 / / - is the DEV...; what is DEV ??? this already PROBLEM
+ #_____________________________________________________________________________
+ ##############################################
delete D
if (0 < (q = split(gensub(/\\/, "/", "G", gensub(/ *([:$\\\/]) */, "\\1", "G", gensub(/(^[ \t]+)|([ \t]+$)/, "", "G", q))), A, /\/+/, B))) {
if (2 > (h = length(B[1]))) {
@@ -3214,6 +3963,7 @@
function _patharr0_i0(t, D, l, r, d, i)
{
if (i = index(t, ":")) {
+ #_____________________________________________________
if (d) {
D["type"] = d
}
@@ -3235,6 +3985,7 @@
function _patharr0_i1(D, A, i, q, t, c)
{
if (D["type"] == "UNC") {
+ #_____________________________________________________
if (t = A[i++]) {
D[0] = (D["share"] = D[++c] = t) "/"
} else {
@@ -3262,6 +4013,7 @@
function _pmap(m, s1, s2, s3, s4, s5, s6, s7, s8)
{
if (match(m, /^([^\(]+)\(([^\)]*)\)$/, _QMAP)) {
+ #############################################################################
_qparamf1 = _QMAP[1]
_QMAP[0] = "r" (_qparamc1 = split(_QMAP[2], _QMAP, ""))
_qparamf0 = "_p" _QMAP[_qparamc1--]
@@ -3316,6 +4068,8 @@
function _printarr(A, t, lv, r, a)
{
+ #_________________________________________________________________
+ ####################################
a = PROCINFO["sorted_in"]
PROCINFO["sorted_in"] = "_lengthsort"
_printarrexp = (r ? r : "")
@@ -3330,6 +4084,7 @@
function _printarr_i1(A, lv, ls, ln, t, t2, i, a, f)
{
+ #___________________________________________________________
t2 = _getchrln(" ", length(t))
if (ln == lv) {
if (ls > 0) {
@@ -3419,6 +4174,8 @@
function _qstr(t, c, A, B)
{
+ #_______________________________________________________________________
+ ################################################
c = ""
for (t = split(t, A, /[\x00-\x1F\\"]/, B); t >= 0; t--) {
c = _QSTR[B[t]] A[t + 1] c
@@ -3428,6 +4185,8 @@
function _qstrq(t)
{
+ #_________________________________________________________________
+ ################################################
gsub(/\\/, "\\\\", t)
gsub(/"/, "\\\"", t)
return t
@@ -3437,14 +4196,23 @@
{
switch (c) {
case "_lib_CMDLN":
+ ################################################################
+ #_____________________________________________________________________________
+ #####################################################
+ #___________________________________________________________
+ #_____________________________________________________
return t
case "_lib_APPLY":
+ #_____________________________________________________
return
case "_lib_HELP":
+ #_____________________________________________________
return
case "_lib_NAMEVER":
+ #_____________________________________________________
return _ln("_reg 0.001")
case "_lib_BEGIN":
+ #_____________________________________________________
return
case "_lib_END":
return
@@ -3455,6 +4223,8 @@
{
if (p) {
if (p in _tPARENT) {
+ #_______________________________________________________________________
+ ######################################################
return _tFCHLD[_tPARENT[p]]
}
while (p in _tPREV) {
@@ -3468,6 +4238,8 @@
function _rFCHLD(p)
{
if (p && p in _tFCHLD) {
+ #_______________________________________________________________________
+ #####################################################
return _tFCHLD[p]
}
return ""
@@ -3477,6 +4249,9 @@
{
if (p) {
if (p in _tPARENT) {
+ ######################## p="", !v
+ #_______________________________________________________________________
+ ######################################################
return _tLCHLD[_tPARENT[p]]
}
while (p in _tNEXT) {
@@ -3490,6 +4265,9 @@
function _rLCHLD(p)
{
if (p && p in _tLCHLD) {
+ ######################## p=""
+ #_______________________________________________________________________
+ #####################################################
return _tLCHLD[p]
}
return ""
@@ -3497,12 +4275,17 @@
function _rLINK(p)
{
+ #_______________________________________________________________________
+ ######################################################
return ((p in _tLINK ? _tLINK[p] : ""))
}
function _rNEXT(p)
{
if (p && p in _tNEXT) {
+ ######################## p=""
+ #_______________________________________________________________________
+ ######################################################
return _tNEXT[p]
}
return ""
@@ -3511,6 +4294,9 @@
function _rPARENT(p)
{
if (p && p in _tPARENT) {
+ ######################## p=""
+ #_______________________________________________________________________
+ ####################################################
return _tPARENT[p]
}
return ""
@@ -3519,6 +4305,9 @@
function _rPREV(p)
{
if (p && p in _tPREV) {
+ ######################## p=""
+ #_______________________________________________________________________
+ ######################################################
return _tPREV[p]
}
return ""
@@ -3528,6 +4317,9 @@
{
if (p) {
if (p in _tPARENT) {
+ ######################## p=""
+ #_______________________________________________________________________
+ ################################################
return _tQCHLD[_tPARENT[p]]
}
c = 1
@@ -3548,6 +4340,9 @@
function _rQCHLD(p)
{
if (p && p in _tQCHLD) {
+ ######################## p=""
+ #_______________________________________________________________________
+ #####################################################
return _tQCHLD[p]
}
return ""
@@ -3555,6 +4350,10 @@
function _rSQFIRST(g, p, A)
{
+ #___________________________________________________________________________________
+ # EMMULATED FUNCTIONAL FIELDS ######################################################
+ #_____________________________________________________________________________
+ #####################################################
if (isarray(A)) {
return _rSQFIRSTA(g, p, A)
}
@@ -3565,6 +4364,8 @@
function _rSQFIRSTA(g, p, A)
{
+ #_________________________________________________________________
+ ########################################
_SQTOPTR[g] = p
_SQSTACK[g][0] = 0
if ((p = _rsqgetptr(g, p)) in A) {
@@ -3575,6 +4376,8 @@
function _rSQNEXT(g, p, A)
{
+ #_______________________________________________________________________
+ ################################################
if (isarray(A)) {
return _rSQNEXTA(g, p, A)
}
@@ -3585,6 +4388,8 @@
{
if (p == _SQTOPTR[g]) {
if (_SQSTACK[g][0] > 0) {
+ #_________________________________________________________________
+ #########################################
_SQTOPTR[g] = _SQSTACK[g][_SQSTACK[g][0]--]
return _rSQNEXTA(g, _SQSTACK[g][_SQSTACK[g][0]--], A)
}
@@ -3611,6 +4416,7 @@
function _rd_shortcut(D, f)
{
if ((_shrtcutf0 = _filepath(f)) && _shortcut_nerr(_shrtcuta0 = _cmd(_shortcut_fpath " /A:Q /F:\"" _shrtcutf0 "\" 2>&1"), _shrtcutf0)) {
+ #___________________________________________________________
ERRNO = ""
split(_shrtcuta0, _SHRTCUTA0, /\x0D?\x0A/)
for (_shrtcuta0 in _SHRTCUTA0) {
@@ -3627,6 +4433,8 @@
function _rdfile(f, i, A)
{
if ((f = _filerdne(f)) == "" || _filene(f) == "") {
+ #_______________________________________________________________________
+ ################################################
ERRNO = "Filename error"
return
}
@@ -3649,6 +4457,36 @@
function _rdreg(D, p)
{
+ ####################################################################################
+ # PUBLIC:
+ #_____________________________________________________________________________
+ # fn _th0,_th1,_th2,_th3
+ # USAGE:
+ # _th0(p1,p2,p3,p4)
+ #
+ # Each of this functions can have up to 4 parameters.
+ # _th0(p1,p2,p3,p4) return 1st parameter (p1)
+ # _th1(p1,p2,p3,p4) return 2nd parameter (p2)
+ # _th2(p1,p2,p3,p4) return 3rd parameter (p3)
+ # _th3(p1,p2,p3,p4) return 4th parameter (p4)
+ #_____________________________________________________________________________
+ # fn _nop(p1,p2,p3,p4,p5,p6,p7,p8)
+ # USAGE:
+ # _nop()
+ #
+ # Does not do any action. No result returned. Up to 8 parameters.
+ #_____________________________________________________________________________
+ # fn _exit(c)
+ # USAGE:
+ # _exit(code)
+ #
+ # This function do the same as GAWK-operator `exit code'.
+ #_____________________________________________________________________________
+ # fn _getdate()
+ # fn _getime()
+ # fn _getsecond()
+ # fn _getsecondsync()
+ ################################################################
_rdregp0 = "reg query \"" p "\" /S /reg:64 2>NUL"
_rdregfld = _rdregkey = 0
_rdregq0 = split(gensub(/[\x0D?\x0A]{2,}/, _CHR["EOL"], "G", _cmd(_rdregp0)), _RDREGA0, /\x0D?\x0A/)
@@ -3663,6 +4501,7 @@
while (_rdregq0 > 0) {
if (match(_rdregp0 = _RDREGA0[_rdregq0--], / (.*) REG_((SZ)|(DWORD)|(QWORD)|(BINARY)|(EXPAND_SZ)|(MULTI_SZ)) (.*)$/, A)) {
if (! _rdreg_i0(D)) {
+ #___________________________________________________________
++_rdregfld
D[_rdregp0 A[1] "." _RDREGTYPE[A[2]]] = A[9]
return
@@ -3681,6 +4520,8 @@
function _rdsafe(A, i, d)
{
+ #_____________________________________________________________________________________________________
+ ######################################################################################################
if (i in A) {
return A[i]
}
@@ -3689,6 +4530,7 @@
function _reg_check(p)
{
+ #_______________________________________________________________________
_tframe("_reg_check_i0", p, p)
}
@@ -3697,6 +4539,7 @@
if (_[p]["TYPE"] == "defreg") {
if (_[p]["REGPATH"] in _REG) {
if ("VALUE" in _[p]) {
+ #_______________________________________________
if (_[p]["VALUE"] == _REG[_[p]["REGPATH"]]) {
_creport(p, substr("OK: REGENTRY MATCH(==" _[p]["VALUE"] "): " _[p]["REGPATH"], 1, 126))
} else {
@@ -3717,12 +4560,17 @@
function _registryinit()
{
+ #_____________________________________________________
_registrytmpfile = _getmpfile()
}
function _regpath0(D, i, s, q, S)
{
if (i = _patharr0(S, i)) {
+ # _rdregfld : gvar - number of readed registry fields by _rdreg()
+ # _rdregkey : gvar - number of readed registry keys by _rdreg()
+ #_____________________________________________________________________________
+ ############################################ 0 #
if ("name" in S) {
D["name"] = S["name"]
}
@@ -3744,6 +4592,8 @@
function _report(p)
{
+ #_________________________________________________________________________________________
+ #######################################################################
_report_t0 = _reportparnt = ""
_report_i0(p)
_tframe("_report_i0", p)
@@ -3767,6 +4617,7 @@
function _reporterr(p, t3, pp, t, t2)
{
+ #___________________________________________________________________________________
t = ""
pp = p
do {
@@ -3781,6 +4632,55 @@
function _retarr(A, i, p, a, q)
{
if (isarray(A)) {
+ #___________________________________________________________________________________
+ ####################################################################################
+ #_______________________________________________________________________
+ # _CHR array
+ #
+ # _CHR[ASC-code decimal number]=="char"
+ #
+ # Contains 256 elements. The index is the decimal number from 0-255.
+ # The value is the single character with ASC-code equivalent to index number:
+ #
+ # _CHR[97] =="a" - character with ASC-code 97 is `a'
+ #
+ # This array is useful if you want to get character using it's ASC-code
+ #_________________________________________________________________
+ # _ASC array
+ #
+ # _ASC[char]==number: ASC-code of char
+ #
+ # Contains 256 elements. The index is the any single character with ASC-code \x00-\xFF.
+ # The value is the number equivalent of character's ASC-code:
+ #
+ # _ASC["A"] ==65 - ASC-code of character `A' is 65
+ #
+ # This array is useful if you want to get ASC-code of the character.
+ #_________________________________________________________________
+ # _QASC array
+ #
+ # _QASC[char]=="string: octal ASC-code of char in 3-digit octal format"
+ #
+ # Contains 256 elements. The index is the any single charcter with ASC-code \x00-\xFF.
+ # The value is the octal number equivalent of character's ASC-code in fixed-length - 3-digit - string:
+ #
+ # _QASC["!"] =="041" - ASC-code of character `!' is 33(decimal) == 41(in octal)
+ # _QASC["\x0D"] =="015"
+ #
+ # This array is useful when some type of string escape conversion is performed. It allows quickly get
+ # replace string for the characters that can be specified only by character code in result string:
+ #
+ # "\x0D" -> "\\015"
+ #_______________________________________________________________________
+ ####################################################################################
+ # PUBLIC:
+ #_____________________________________________________________________________
+ # fn _getchrln(ptt,len)
+ #_____________________________________________________________________________
+ # fn _tabtospc(src,tabstep,xcoord)
+ ####################################################################################
+ #_____________________________________________________________________________
+ ##################################################
i = (i == "" ? 0 : i + 0)
q = A[_ARRLEN] + 0
if (i < q) {
@@ -3802,6 +4702,8 @@
function _retarrd(A, v, i)
{
+ #_________________________________________________________________
+ #########################################
if (1 in A) {
return (A[1] A[2] A[3] A[4] A[5] A[6] A[7] A[8] A[9] A[10] A[11] A[12] A[13] A[14] A[15] A[16] (((i = 17) in A ? _retarrd_i0(A, i) v : v)))
}
@@ -3811,6 +4713,7 @@
function _retarrd_i0(A, i)
{
+ #_____________________________________________________
if (i in A) {
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) : "")))
}
@@ -3819,6 +4722,9 @@
function _rexpfn(R, t, p)
{
+ #_______________________________________________________________________
+ ########################################################################
+ #EXPERIMENTAL
_REXPFN[""] = ""
while (t) {
t = _rxpfn(R, t, p)
@@ -3833,6 +4739,8 @@
function _rexpstr(r, i, c, A)
{
+ #_____________________________________________________________________________
+ ###################################################
c = split(r, A, "")
r = ""
for (i = 1; i <= c; i++) {
@@ -3843,11 +4751,13 @@
function _rexpstr_i0(t, A, p0)
{
+ #_____________________________________________________________________________
return (_REXPSTR[t] = "\\" t)
}
function _rmtsharerr(h, t)
{
+ #___________________________________________________________
gsub(/[\x0D\x0A]+/, "", t)
if (t ~ /^The command failed: 53/) {
ERRNO = "host not found: \\\\" h
@@ -3861,6 +4771,7 @@
_conl()
_conline(q)
_conl()
+ #_conl(_dumparr(D))
_regpath0(D, q)
_conl(_ln("DEST:") _dumparr(D))
_conl()
@@ -3869,6 +4780,8 @@
function _rrdreg(DD, p, k, t, v, c, i, q, tT, A, B, C, D)
{
+ #_________________________________________________________________________________________
+ ############################################# old; regedit
if (! _registrytmpfile) {
_registryinit()
}
@@ -3923,6 +4836,7 @@
function _rsqgetptr(g, p, A)
{
if (p in _tLINK) {
+ #_________________________________________________________________
_SQSTACK[g][++_SQSTACK[g][0]] = p
_SQSTACK[g][++_SQSTACK[g][0]] = _SQTOPTR[g]
while ((p = _tLINK[p]) in _tLINK) {
@@ -3940,6 +4854,7 @@
{
if (p == _SQTOPTR[g]) {
if (_SQSTACK[g][0] > 0) {
+ #___________________________________________________________
_SQTOPTR[g] = _SQSTACK[g][_SQSTACK[g][0]--]
return _rsqnext_i0(g, _SQSTACK[g][_SQSTACK[g][0]--])
}
@@ -3988,14 +4903,23 @@
{
switch (c) {
case "_lib_CMDLN":
+ ##############################################################
+ #_____________________________________________________________________________
+ ###################################################
+ #___________________________________________________________
+ #_____________________________________________________
return t
case "_lib_APPLY":
+ #_____________________________________________________
return
case "_lib_HELP":
+ #_____________________________________________________
return
case "_lib_NAMEVER":
+ #_____________________________________________________
return _ln("_share 1.000")
case "_lib_BEGIN":
+ #_____________________________________________________
return
case "_lib_END":
return
@@ -4006,14 +4930,23 @@
{
switch (c) {
case "_lib_CMDLN":
+ ################################################################
+ #_____________________________________________________________________________
+ #####################################################
+ #___________________________________________________________
+ #_____________________________________________________
return t
case "_lib_APPLY":
+ #_____________________________________________________
return
case "_lib_HELP":
+ #_____________________________________________________
return
case "_lib_NAMEVER":
+ #_____________________________________________________
return
case "_lib_BEGIN":
+ #_____________________________________________________
return
case "_lib_END":
return
@@ -4022,12 +4955,14 @@
function _serv_check(p)
{
+ #_______________________________________________________________________
_tframe("_serv_check_i0", p, p)
}
function _serv_check_i0(p, p0, p1, p2, p3, i, q, c)
{
if (_[p]["TYPE"] == "defsrv") {
+ #_______________________________________________
i = IGNORECASE
IGNORECASE = 1
if (match(_servoutput, roi = "\\012DISPLAY_NAME: " _torexp(_[p]["SERVNAME"]))) {
@@ -4041,6 +4976,8 @@
function _setarrsort(f, a)
{
+ #_______________________________________________________________________
+ ##############################################
a = PROCINFO["sorted_in"]
if (! f) {
delete PROCINFO["sorted_in"]
@@ -4052,8 +4989,12 @@
function _setmpath(p, a)
{
+ #_______________________________________________________________________
+ ################################################
ERRNO = ""
if (p && (a = _filerd(p))) {
+ #if ( _filexist(a) ) _del(a)
+ #_cmd("rd " a " /S /Q 2>NUL"); _cmd("del " a " /Q 2>NUL")
if (_FILEIO_TMPRD) {
_FILEIO_TMPATHS[_FILEIO_TMPRD]
}
@@ -4065,6 +5006,9 @@
function _sharelist(D, h, q, c, l, A, B)
{
+ #_________________________________________________________________________________________
+ ##########################################################################################
+ #################################################
delete D
c = _sharextool " \\\\" ((h == "" ? h = ENVIRON["COMPUTERNAME"] : h)) " 2>&1"
if (match(c = _cmd(c), /\x0AShare[^\x0A]*Remark/)) {
@@ -4083,6 +5027,8 @@
function _sharepath(h, s, A)
{
+ #_____________________________________________________________________________
+ ###################################################
s = _sharextool " \\\\" ((h == "" ? h = ENVIRON["COMPUTERNAME"] : h)) "\\\"" s "\" 2>&1"
if (match(s = _cmd(s), /\x0APath[ \t]+([^\x0D\x0A]+)/, _SHAREPATHA0)) {
return gensub(/[ \t\\\/]*$/, "\\\\", 1, _SHAREPATHA0[1])
@@ -4092,14 +5038,19 @@
function _shortcut(D, S)
{
+ # filepath,filepath2* - [over]write shorcut file filepath; shortcut parameters will be defined from shortcut file filepath2(copy shortcut)
if (isarray(D)) {
+ # array,ptr* - copy from array _[ptr] to array shorcut-specific elements
if (isarray(S)) {
+ #############################################################
_addarrmask(D, S, _SHORTCUTWSTRUC)
} else {
if (S == 0 && S == "") {
+ # array,array2* - copy from array2 to array shorcut-specific elements
_addarrmask(D, _SHORTCUTDEFAULT, _SHORTCUTWSTRUC)
} else {
if (_isnotfileptr(S)) {
+ # array* - define shortcut-specific elements in array by default values
_addarrmask(D, _[S], _SHORTCUTWSTRUC)
} else {
if (_rd_shortcut(D, S)) {
@@ -4113,13 +5064,18 @@
return _NOP
} else {
if (_isnotfileptr(D)) {
+ # ptr,ptr2* - copy from array _[ptr2] to array _[ptr] shorcut-specific elements
if (isarray(S)) {
+ # array,filepath* - define in array shortcut-specific elements by reading its from shortcut file filepath(load shortcut)
+ # -* - no action(return -)
_addarrmask(_[D], S, _SHORTCUTWSTRUC)
} else {
if (S == 0 && S == "") {
+ # ptr,array* - copy from array to array _[ptr] shorcut-specific elements
_addarrmask(_[D], _SHORTCUTDEFAULT, _SHORTCUTWSTRUC)
} else {
if (_isnotfileptr(S)) {
+ # ptr* - define shortcut-specifc elements in array _[ptr] by default values
_addarrmask(_[D], _[S], _SHORTCUTWSTRUC)
} else {
if (_rd_shortcut(_[D], S)) {
@@ -4129,6 +5085,10 @@
}
}
} else {
+ # ptr,filepath* - define in array _[ptr] shortcut-specific elements by reading its from shortcut file filepath(load shortcut)
+ # filepath,array* - [over]write shorcut file filepath; shortcut parameters will be defined by shortcut-specific elements in array(save shortcut)
+ # filepath* - [over]write shorcut file filepath; shortcut parameters will be defined by default values
+ # filepath,ptr* - [over]write shorcut file filepath; shortcut parameters will be defined by shortcut-specific elements in array _[ptr](save shortcut)
if (isarray(S) && _wr_shortcut(D, S)) {
return
} else {
@@ -4152,6 +5112,7 @@
function _shortcut_init(A, B, q)
{
+ #________________________________________________
_SHORTCUTERR[2] = "file not found"
_SHORTCUTERR[3] = "no such filepath"
_SHORTCUTERR["The system cannot find the file specified."] = "no such filepath"
@@ -4186,6 +5147,7 @@
function _shortcut_nerr(t, s, A)
{
if (match(t, /\x0ASystem error (-?[0-9]+)[^\x0D\x0A]*[\x0D\x0A]+([^\x0D\x0A]+)/, A)) {
+ #_____________________________________________________
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 "'" : ""))
} else {
return 1
@@ -4330,6 +5292,8 @@
function _splitstr(A, t, r)
{
if (_istr(t)) {
+ #_______________________________________________________________________
+ ########################################### 1 #
if (_splitstr_i0(A, t) > 0) {
return _splitstrp0
}
@@ -4355,6 +5319,7 @@
function _splitstr_i0(A, t, C)
{
+ #_____________________________________________________
if (2 > (_splitstrq0 = patsplit(t, _SPLITSTRA0, /([^,\xB4]*\xB4.)*[^,\xB4]*/))) {
_splitstrq0 = split(gensub(/\xB4(.)/, "\\1", "G", t), _SPLITSTRA0, "")
}
@@ -4371,6 +5336,7 @@
function _strtorexp(t)
{
+ #_______________________________________________
gsub(/[\\\.\?\*\+\-\(\)\{\}\[\]\^\$\/\|]/, "\\\\&", t)
t = split(t, _TOREXP_STRA, /[\x00-\x1F]/, _TOREXP_STRB)
_torexp_strt0 = ""
@@ -4392,7 +5358,10 @@
r = ""
f = F[""]
for (i = 1; i < q; i++) {
+ #_conl("curr r==`" r "': A[" i "]=`" A[i] "'")
+ #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 "'"))
s = substr(e = B[i], 2, 1)
+ #_conl("`" f "'")
s = (s in F ? F[s] : F[""])
r = r (@f(A[i])) (@s(substr(e, 3, length(e) - 3)))
}
@@ -4401,6 +5370,34 @@
function _sysinfo(D, h)
{
+ #_____________________________________________________________________________
+ # _rdreg(ARRAY,reg_path)
+ # Import into ARRAY the content of the whole registree tree with the higher point specified by reg_path.
+ # ARRAY will be filled by the strings with following format:
+ #
+ # HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\GnuWin32\CoreUtils\5.3.0\pck\InstallPath.STR=C:\Program Files (x86)\GnuWin32
+ # where:
+ # HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\GnuWin32\CoreUtils\5.3.0\pck <- REG KEY PATH
+ # InstallPath <- DATA FIELD
+ # STR <- TYPE
+ # C:\Program Files (x86)\GnuWin32 <- VALUE
+ # TYPE:
+ # STR - REG_SZ (String Value)
+ # W32 - REG_DWORD (DWORD (32-bit) Value)
+ # W64 - REG_QWORD (QWORD (64-bit) Value)
+ # BIN - REG_BINARY (Binary Value)
+ # XSZ - REG_EXPAND_SZ (Expandable String Value)
+ # MSZ - REG_MULTI_SZ (Multi-String Value)
+ #_________________________________________________________________________________________
+ # HKCR HKEY_CLASSES_ROOT
+ # HKCU HKEY_CURRENT_USER
+ # HKLM HKEY_LOCAL_MACHINE
+ # HKU HKEY_USERS
+ # HKCC HKEY_CURRENT_CONFIG
+ # HKPD HKEY_PERFORMANCE_DATA
+ #___________________________________________________________________________________
+ ####################################################################################
+ ##############################################################
h = "wmic /NODE: \"" h "\" OS 2>NUL"
if (split(_cmd(h), _SYSINFOA0, /[\x0D\x0A]+/) == 3) {
_sysinfol0 = length(h = _SYSINFOA0[2]) + 1
@@ -4416,16 +5413,24 @@
{
switch (c) {
case "_lib_CMDLN":
+ #########################################################
+ #___________________________________________________________
+ #___________________________________________________________
return t
case "_lib_APPLY":
+ #___________________________________________________________
return
case "_lib_HELP":
+ #___________________________________________________________
return
case "_lib_NAMEVER":
+ #___________________________________________________________
return _ln("_tOBJ 3.0")
case "_lib_BEGIN":
+ #___________________________________________________________
return
case "_lib_END":
+ #___________________________________________________________
return
case "_lib_CLEANUP":
return _tOBJ_CLEANUP()
@@ -4435,6 +5440,8 @@
function _tOBJ_CLEANUP(p)
{
for (p in UIDSDEL) {
+ #_______________________________________________________________________
+ ##############################################
delete _ptr[p]
delete _tPREV[p]
delete _tPARENT[p]
@@ -4452,6 +5459,8 @@
function _tabtospc(t, ts, xc, a, c, n, A, B)
{
if (! ts) {
+ #_______________________________________________________________________
+ ##################################
ts = _TAB_STEP_DEFAULT
}
c = split("." t, A, /\t+/, B)
@@ -4465,6 +5474,8 @@
function _tapi(p, f, p0, p1, p2, p3, c)
{
+ #___________________________________________________________________________________
+ ####################################################################################
c = p
do {
if (f in _[c]["API"]) {
@@ -4477,6 +5488,8 @@
function _tbframe(f, p, p0, p1)
{
+ #_____________________________________________________________________________
+ ##################################################
delete _t_ENDF[++_t_ENDF[0]]
f = (p ? _tbframe_i0(f, p, p0, p1) : "")
--_t_ENDF[0]
@@ -4485,6 +5498,7 @@
function _tbframe_i0(f, p, p0, p1, a)
{
+ #___________________________________________________________
while (p in _tLINK) {
p = _tLINK[p]
}
@@ -4493,6 +5507,8 @@
function _tbframex(f, p, p0, p1)
{
+ #_______________________________________________________________________
+ ###########################################
delete _t_ENDF[++_t_ENDF[0]]
f = (p ? _tbframex_i0(f, p, p0, p1) : "")
--_t_ENDF[0]
@@ -4501,6 +5517,7 @@
function _tbframex_i0(f, p, p0, p1)
{
+ #___________________________________________________________
while (p in _tLINK) {
p = _tLINK[p]
}
@@ -4509,6 +5526,8 @@
function _tbpass(f, p, p0, p1)
{
+ #_____________________________________________________________________________
+ ###################################################
delete _t_ENDF[++_t_ENDF[0]]
f = (p ? _tbpass_i0(f, p, p0, p1) : "")
--_t_ENDF[0]
@@ -4517,6 +5536,7 @@
function _tbpass_i0(f, p, p0, p1, a)
{
+ #___________________________________________________________
while (p in _tLINK) {
p = _tLINK[p]
}
@@ -4525,6 +5545,8 @@
function _tbpassx(f, p, p0, p1)
{
+ #_____________________________________________________________________________
+ ##################################################
delete _t_ENDF[++_t_ENDF[0]]
f = (p ? _tbpassx_i0(f, p, p0, p1) : "")
--_t_ENDF[0]
@@ -4533,6 +5555,7 @@
function _tbpassx_i0(f, p, p0, p1)
{
+ #___________________________________________________________
while (p in _tLINK) {
p = _tLINK[p]
}
@@ -4543,6 +5566,8 @@
{
if (p) {
if (p in _tFCHLD) {
+ #_____________________________________________________________________________
+ ################################################### # TEST!!!
f = _tFCHLD[p]
delete _tFCHLD[p]
delete _tLCHLD[p]
@@ -4631,27 +5656,37 @@
function _tbrunframe(f, p, p0, p1)
{
+ #_________________________________________________________________
+ ###################################
return _tbframe((f ? f : "_trunframe_i0"), p, p0, p1)
}
function _tbrunframex(f, p, p0, p1)
{
+ #_________________________________________________________________
+ ##################################
return _tbframex((f ? f : "_trunframe_i0"), p, p0, p1)
}
function _tbrunpass(f, p, p0, p1)
{
+ #_________________________________________________________________
+ ####################################
return _tbpass((f ? f : "_trunframe_i0"), p, p0, p1)
}
function _tbrunpassx(f, p, p0, p1)
{
+ #_________________________________________________________________
+ ###################################
return _tbpassx((f ? f : "_trunframe_i0"), p, p0, p1)
}
function _tdel(p, i)
{
if (p in _) {
+ #_____________________________________________________________________________
+ ##########################################################
_texclude(p)
for (i in _ptr[p]) {
if (isarray(_ptr[p][i])) {
@@ -4676,6 +5711,7 @@
function _tdel_i0(p, i)
{
for (i in _ptr[p]) {
+ #_____________________________________________________
if (isarray(_ptr[p][i])) {
_tdel_i1(_ptr[p][i])
} else {
@@ -4697,6 +5733,7 @@
function _tdel_i1(A, i)
{
for (i in A) {
+ #_____________________________________________________
if (isarray(A[i])) {
_tdel_i1(A[i])
} else {
@@ -4709,6 +5746,8 @@
function _tdelete(p, v)
{
+ #_____________________________________________________________________________
+ ####################################################### # REMAKE EXCLUDE
if (p) {
_wLCHLD(_tDELPTR, p)
}
@@ -4719,6 +5758,8 @@
{
if (p) {
if ("HOST" in _PTR[p] && "ITEMNAME" in _[p]) {
+ #_________________________________________________________________
+ #############################################
return _wLCHLD(_PTR[_PTR[p]["HOST"]]["ITEM"][_[p]["ITEMNAME"]], p)
}
_tdelete(p)
@@ -4728,6 +5769,8 @@
function _tend(a, b)
{
+ #_______________________________________________________________________
+ #####################################################
if (b == "") {
return (_t_ENDF[_t_ENDF[0]] = a)
} else {
@@ -4739,6 +5782,8 @@
{
if (p in _) {
if (p in _tPARENT) {
+ #_____________________________________________________________________________
+ ################################################### # TEST!!!
pp = _tPARENT[p]
delete _tPARENT[p]
if (p in _tPREV) {
@@ -4783,6 +5828,9 @@
function _tframe(fF, p, p0, p1, p2)
{
+ # _tDLINK progressive development: concrete _tDLINK function\processing algo; all frame's families support
+ #_____________________________________________________________________________
+ ###############################################
delete _t_ENDF[++_t_ENDF[0]]
p = (_isptr(p) ? (isarray(fF) ? _tframe_i1(fF, p, p0, p1, p2) : _tframe_i0(fF, p, p0, p1, p2)) : "")
--_t_ENDF[0]
@@ -4792,6 +5840,8 @@
function _tframe0(f, p, p0, p1, p2, p3, A)
{
if (_isptr(p)) {
+ #_____________________________________________________________________________
+ #########################################
if (isarray(f)) {
return _tframe0_i0(f, p)
}
@@ -4803,6 +5853,7 @@
function _tframe0_i0(A, p, f)
{
if (p in _tLINK) {
+ #_______________________________________________
_tframe_link = p
if ("`" in A) {
f = A["`"]
@@ -4825,6 +5876,7 @@
function _tframe0_i1(A, p)
{
+ #_______________________________________________
if (_TEND[_ARRLEN] in _TEND) {
return
}
@@ -4836,6 +5888,7 @@
function _tframe0_i2(A, m, p)
{
+ #_______________________________________________
_tframe_dlink = p
while (p in _tDLINK) {
p = _tDLINK[p]
@@ -4854,6 +5907,8 @@
function _tframe1(f, p, p0, p1, p2, p3, A)
{
if (_isptr(p)) {
+ #_________________________________________________________________
+ #############################
if (isarray(f)) {
return _tframe1_i0(f, p, p0)
}
@@ -4864,6 +5919,7 @@
function _tframe1_i0(A, p, p0)
{
+ #_______________________________________________
_tframe_link = p
while (p in _tLINK) {
p = _tLINK[p]
@@ -4876,6 +5932,7 @@
function _tframe1_i1(A, p, p0)
{
+ #_______________________________________________
if (_TEND[_ARRLEN] in _TEND) {
return
}
@@ -4887,6 +5944,7 @@
function _tframe1_i2(A, m, p, p0)
{
+ #_______________________________________________
_tframe_dlink = p
while (p in _tDLINK) {
p = _tDLINK[p]
@@ -4905,6 +5963,8 @@
function _tframe2(f, p, p0, p1, p2, p3, A)
{
if (_isptr(p)) {
+ #_________________________________________________________________
+ #############################
if (isarray(f)) {
return _tframe2_i0(f, p, p0, p1)
}
@@ -4915,6 +5975,7 @@
function _tframe2_i0(A, p, p0, p1)
{
+ #_______________________________________________
_tframe_link = p
while (p in _tLINK) {
p = _tLINK[p]
@@ -4927,6 +5988,7 @@
function _tframe2_i1(A, p, p0, p1)
{
+ #_______________________________________________
if (_TEND[_ARRLEN] in _TEND) {
return
}
@@ -4938,6 +6000,7 @@
function _tframe2_i2(A, m, p, p0, p1)
{
+ #_______________________________________________
_tframe_dlink = p
while (p in _tDLINK) {
p = _tDLINK[p]
@@ -4956,6 +6019,8 @@
function _tframe3(f, p, p0, p1, p2, p3, A)
{
if (_isptr(p)) {
+ #_________________________________________________________________
+ #############################
if (isarray(f)) {
return _tframe3_i0(f, p, p0, p1, p2)
}
@@ -4966,6 +6031,7 @@
function _tframe3_i0(A, p, p0, p1, p2)
{
+ #_______________________________________________
_tframe_link = p
while (p in _tLINK) {
p = _tLINK[p]
@@ -4978,6 +6044,7 @@
function _tframe3_i1(A, p, p0, p1, p2)
{
+ #_______________________________________________
if (_TEND[_ARRLEN] in _TEND) {
return
}
@@ -4989,6 +6056,7 @@
function _tframe3_i2(A, m, p, p0, p1, p2)
{
+ #_______________________________________________
_tframe_dlink = p
while (p in _tDLINK) {
p = _tDLINK[p]
@@ -5007,6 +6075,8 @@
function _tframe4(f, p, p0, p1, p2, p3, A)
{
if (_isptr(p)) {
+ #_________________________________________________________________
+ #############################
if (isarray(f)) {
return _tframe4_i0(f, p, p0, p1, p2, p3)
}
@@ -5017,6 +6087,7 @@
function _tframe4_i0(A, p, p0, p1, p2, p3)
{
+ #_______________________________________________
_tframe_link = p
while (p in _tLINK) {
p = _tLINK[p]
@@ -5029,6 +6100,7 @@
function _tframe4_i1(A, p, p0, p1, p2, p3)
{
+ #_______________________________________________
if (_TEND[_ARRLEN] in _TEND) {
return
}
@@ -5040,6 +6112,7 @@
function _tframe4_i2(A, m, p, p0, p1, p2, p3)
{
+ #_______________________________________________
_tframe_dlink = p
while (p in _tDLINK) {
p = _tDLINK[p]
@@ -5057,6 +6130,7 @@
function _tframe_i0(f, p, p0, p1, p2, a)
{
+ #___________________________________________________________
while (p in _tLINK) {
p = _tLINK[p]
}
@@ -5065,6 +6139,7 @@
function _tframe_i1(F, p, p0, p1, p2, a)
{
+ #___________________________________________________________
while (p in _tLINK) {
p = _tLINK[p]
}
@@ -5073,6 +6148,8 @@
function _tframex(f, p, p0, p1)
{
+ #_______________________________________________________________________
+ ############################################
delete _t_ENDF[++_t_ENDF[0]]
f = (p ? _tframex_i0(f, p, p0, p1) : "")
--_t_ENDF[0]
@@ -5081,6 +6158,7 @@
function _tframex_i0(f, p, p0, p1)
{
+ #___________________________________________________________
while (p in _tLINK) {
p = _tLINK[p]
}
@@ -5089,6 +6167,7 @@
function _tframex_p0(A, f, q, i, B, C)
{
+ #_____________________________________________________
_tframe_qparam = q
delete _TEND[++_TEND[_ARRLEN]]
if (match(f, /\~(.*)$/, B)) {
@@ -5109,6 +6188,7 @@
function _tframex_p1(A, v, i, r, B)
{
+ #_______________________________________________
gsub(/[ \t]+/, "", v)
while (match(v, /^([^~]*)~\/(([^\/\\]*\\.)*[^\/\\]*)\//, B)) {
v = B[1] substr(v, RSTART + RLENGTH)
@@ -5138,6 +6218,17 @@
function _tgenuid(c)
{
for (_uidcntr in _UIDARR1) {
+ #_____________________________________________________
+ # F v action
+ #-----------------------------------------------------
+ # - * no additional action
+ # A B delete A[p] and define A[p] as array; copy array B to array A[p]
+ # A - delete A[p]
+ # A "*" delete A[p]; A[p]="*"
+ # "*" B define _[p]["*"] as array; copy array B to array _[p]["*"]
+ # "*" - run _mpu program "*" for `p
+ # "*0" "*1" _[p]["*0"]="*1"
+ #___________________________________________________________
delete _UIDARR1[_uidcntr]
for (c in _UIDARR0) {
_UIDS[_uidcntr c]
@@ -5150,6 +6241,7 @@
function _tgenuid_init(a, b, A)
{
+ #_____________________________________________________
_ptrlength = 4
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"
split(a, A, "")
@@ -5164,6 +6256,12 @@
function _tgetitem(p, n, a, b)
{
if (p) {
+ # if ( F in _TCLASS ) { _[p]["CLASS"]=_TCLASS[F]; _tapi(p); return p }
+ # # ??? _mpu(F,p) ???
+ # return p }
+ # _[p][F]=v; return p }
+ #_______________________________________________________________________
+ ############################################
if (isarray(_PTR[p]["ITEM"]) && n in _PTR[p]["ITEM"]) {
a = _PTR[p]["ITEM"][n]
} else {
@@ -5180,36 +6278,50 @@
function _tgetsp(p)
{
+ #_________________________________________________________________
+ ###############################################
return _tSTACK[p][0]
}
function _th0(p, p1, p2, p3)
{
+ ####################################################################################
+ #_____________________________________________________________________________
return p
}
function _th1(p0, p, p2, p3)
{
+ ##########################################
+ #_________________________________________________________________
return p
}
function _th10(p0, p1)
{
+ ##############################
+ #_________________________________________________________________
return (p1 p0)
}
function _th2(p0, p1, r, p3)
{
+ ##############################
+ #_________________________________________________________________
return p
}
function _th3(p0, p1, p2, r)
{
+ ##############################
+ #_________________________________________________________________
return p
}
function _tifend(l)
{
+ #_________________________________________________________________
+ ###############################################
return ((_t_ENDF[0] + l in _t_ENDF ? (_t_ENDF[_t_ENDF[0] + l] ? _t_ENDF[_t_ENDF[0] + l] : 1) : ""))
}
@@ -5218,6 +6330,8 @@
for (i in S) {
if (isarray(S[i])) {
if (! isarray(D[i][""])) {
+ # test _tbrochld fn; develope tOBJ r\w func specification for brochld func
+ #_________________________________________________________________
delete D[i]
D[i][""]
delete D[i][""]
@@ -5234,6 +6348,51 @@
function _tlist(L, p, f)
{
+ #_______________________________________________________________________
+ ########################################################################
+ #_______________________________________________________________________
+ # _N(arr\str\mpuptr,val) \ _n(arr\str\mpuptr,val)
+ # This functions create new object and return ptr.
+ # _n() - creates object from list of deleted objects or if it's empty create new one, while _N() always create new one
+ # It is strongly recommended to use _N() for the objects that have some data outside of standart object arrays. Or - make routines
+ # that will clear outsided object data in case if object deleting.
+ #
+ # IN: arr\str\mpu,val - (both missed) just create obj and return ptr
+ # arr,val - create object and write arr[ptr]=val
+ # str,val - create object and write _[ptr][str]=val
+ # mpuptr - NOT ALLOWED (val missed) create object and run MPU-code specified by mpuptr with created object ptr as primary parameter
+ # MOD: -
+ # OUT: -
+ # RETURN: ptr - pointer to newly created object
+ #_________________________________________________________________
+ # _tdel(ptr)
+ # This function exclude object from it's current structure and delete it. ptr can be later used by function: _n() for creating new object
+ # Also same story will occured with all chields and subchields of object specified by ptr.
+ # ??? What happened with linked py _ptr[ptr] objects ???
+ #
+ # IN: ptr - pointer to object that will deleted
+ # MOD: -
+ # OUT: -
+ # RETURN: undefined
+ #_________________________________________________________________
+ # _isptr(ptr)
+ # This function checks: is ptr is the object pointer that is currently exist?
+ # Unescaped remained data will be in data of src_dst_ptr.
+ #
+ # IN: ptr - string that will be tested
+ # MOD: -
+ # OUT: -
+ # RETURN: undefined - if ptr is not pointer to exist object
+ # ptr - if ptr is the pointer to exist object
+ #_________________________________________________________________
+ #_________________________________________________________________
+ #
+ # TO DESIGN:
+ #
+ # create basic objectapi interface support
+ # modify everywhere checking ptr not by `if ( ptr )...', but by `if ( ptr in _ )...'
+ # _TMP0, _TMP1 name change to something like _DATA name ???
+ # think about redesigning routines for not depending if ptr is exist in tsysarrs: reason: performance\light code
_tlisti1 = _tlisti0 = L[_ARRLEN] + 0
if (f == 0 && f == "") {
_tlist_i0(L, p)
@@ -5295,6 +6454,8 @@
function _tmbframe(f, p, p0, p1, t)
{
while (p && ! (_t_ENDF[0] in _t_ENDF)) {
+ #_________________________________________________________________
+ ##################################
t = t _tbframe_i0(f, p, p0, p1, p = (p in _tPREV ? _tPREV[p] : ""))
}
return t
@@ -5303,6 +6464,8 @@
function _tmbframex(f, p, p0, p1, t)
{
while (p && ! (_t_ENDF[0] in _t_ENDF)) {
+ #_________________________________________________________________
+ #################################
t = t _tbframex_i0(f, p, p0, p1)
p = (p in _tPREV ? _tPREV[p] : "")
}
@@ -5312,6 +6475,8 @@
function _tmbpass(f, p, p0, p1)
{
while (p && ! (_t_ENDF[0] in _t_ENDF)) {
+ #_________________________________________________________________
+ ######################################
p0 = _tbpass_i0(f, p, p0, p1, p = (p in _tPREV ? _tPREV[p] : ""))
}
return p0
@@ -5320,6 +6485,8 @@
function _tmbpassx(f, p, p0, p1)
{
while (p && ! (_t_ENDF[0] in _t_ENDF)) {
+ #_________________________________________________________________
+ #####################################
p0 = _tbpassx_i0(f, p, p0, p1)
p = (p in _tPREV ? _tPREV[p] : "")
}
@@ -5328,6 +6495,8 @@
function _tmframe(f, p, p0, p1, p2)
{
+ #_________________________________________________________________
+ ###################################
delete _t_ENDF[++_t_ENDF[0]]
f = (p ? _tmframe_i0(f, p, p0, p1, p2) : "")
--_t_ENDF[0]
@@ -5337,6 +6506,7 @@
function _tmframe_i0(f, p, p0, p1, p2, t)
{
while (p && ! (_t_ENDF[0] in _t_ENDF)) {
+ #___________________________________________________________
t = t _tframe_i0(f, p, p0, p1, p2, p = (p in _tNEXT ? _tNEXT[p] : ""))
}
return t
@@ -5345,6 +6515,7 @@
function _tmframe_i1(F, p, p0, p1, p2, t)
{
while (p && ! (_t_ENDF[0] in _t_ENDF)) {
+ #___________________________________________________________
t = t _tframe_i1(F, p, p0, p1, p2, p = (p in _tNEXT ? _tNEXT[p] : ""))
}
return t
@@ -5353,6 +6524,8 @@
function _tmframex(f, p, p0, p1, t)
{
while (p && ! (_t_ENDF[0] in _t_ENDF)) {
+ #_________________________________________________________________
+ ##################################
t = t _tframex_i0(f, p, p0, p1)
p = (p in _tNEXT ? _tNEXT[p] : "")
}
@@ -5362,6 +6535,8 @@
function _tmpass(f, p, p0, p1)
{
while (p && ! (_t_ENDF[0] in _t_ENDF)) {
+ #_________________________________________________________________
+ #######################################
p0 = _tbpass_i0(f, p, p0, p1, p = (p in _tNEXT ? _tNEXT[p] : ""))
}
return p0
@@ -5370,6 +6545,8 @@
function _tmpassx(f, p, p0, p1)
{
while (p && ! (_t_ENDF[0] in _t_ENDF)) {
+ #_________________________________________________________________
+ ######################################
p0 = _tbpassx_i0(f, p, p0, p1)
p = (p in _tNEXT ? _tNEXT[p] : "")
}
@@ -5393,6 +6570,7 @@
function _torexp_init()
{
+ #_______________________________________________
_TOREXPFN[""] = "_strtorexp"
_TOREXPFN["~"] = "_torexp_rexp"
_TOREXPFN["="] = "_strtorexp"
@@ -5404,11 +6582,14 @@
function _torexp_rexp(t)
{
+ #_______________________________________________
return t
}
function _tpass(f, p, p0, p1)
{
+ #_____________________________________________________________________________
+ ####################################################
delete _t_ENDF[++_t_ENDF[0]]
f = (p ? _tpass_i0(f, p, p0, p1) : "")
--_t_ENDF[0]
@@ -5417,6 +6598,7 @@
function _tpass_i0(f, p, p0, p1, a)
{
+ #___________________________________________________________
while (p in _tLINK) {
p = _tLINK[p]
}
@@ -5425,6 +6607,8 @@
function _tpassx(f, p, p0, p1)
{
+ #_____________________________________________________________________________
+ ###################################################
delete _t_ENDF[++_t_ENDF[0]]
f = (p ? _tpassx_i0(f, p, p0, p1) : "")
--_t_ENDF[0]
@@ -5433,6 +6617,7 @@
function _tpassx_i0(f, p, p0, p1)
{
+ #___________________________________________________________
while (p in _tLINK) {
p = _tLINK[p]
}
@@ -5442,6 +6627,8 @@
function _tpop(p, aA, a)
{
if ((a = _tSTACK[p][0]) > 0) {
+ #_________________________________________________________________
+ ###########################################
_tSTACK[p][0]--
if (isarray(_tSTACK[p][a])) {
delete aA
@@ -5456,6 +6643,8 @@
function _tpush(p, aA, a)
{
if (isarray(aA)) {
+ #_____________________________________________________________________________
+ ######################################################
delete _tSTACK[p][a = ++_tSTACK[p][0]]
_tSTACK[p][a][""]
delete _tSTACK[p][a][""]
@@ -5468,6 +6657,13 @@
function _tr(n, cs, H)
{
+ # prefix -
+ # prichr - aware character `{', `^',`]'
+ # sechr - aware character `.' as the first char of sechr, and character `}'
+ # suffix - aware character `]'
+ # cntptr - aware character `]'
+ #_tuidinitcs[p]=cs
+ #2 uidel, 5 pfx, 7 hichr,11(10) lochr,14 suffix
_rconline(n ": " cs)
_rconl()
if (match(cs, /^((([^\xB4:\[\|\]]*\xB4.)*[^\xB4:\[\|\]]*):)?((([^\xB4\[\|\]]*\xB4.)*[^\xB4\[\|\]]*)\[)?(([^\xB4\|\]]*\xB4.)*[^\xB4\|\]]*)?(\|(\.)?(([^\xB4\]]*\xB4.)*[^\xB4\]]*))?(\](.*))?$/, H)) {
@@ -5485,6 +6681,8 @@
function _trace(t, d, A)
{
if (_ERRLOG_TF) {
+ #_______________________________________________________________________
+ #################################################
A["TYPE"] = "TRACE"
A["TEXT"] = t
_log(A, d)
@@ -5493,12 +6691,15 @@
function _trunframe(f, p, p0, p1, p2)
{
+ #_________________________________________________________________
+ #################################
return _tframe((f ? f : "_trunframe_i0"), p, p0, p1, p2)
}
function _trunframe_i0(p, p0, p1, p2, f)
{
if (p in _tFN) {
+ #_________________________________________________________________
f = _tFN[p]
return @f(p, p0, p1, p2)
}
@@ -5506,26 +6707,88 @@
function _trunframex(f, p, p0, p1)
{
+ #_________________________________________________________________
+ ###################################
return _tframex((f ? f : "_trunframe_i0"), p, p0, p1)
}
function _trunpass(f, p, p0, p1)
{
+ #_________________________________________________________________
+ #####################################
return _tpass((f ? f : "_trunframe_i0"), p, p0, p1)
}
function _trunpassx(f, p, p0, p1)
{
+ #_________________________________________________________________
+ ####################################
return _tpassx((f ? f : "_trunframe_i0"), p, p0, p1)
}
function _tsetsp(p, v)
{
+ #_________________________________________________________________
+ #############################################
return (_tSTACK[p][0] = v)
}
function _tstini()
{
+ # dptr - morg ptr; in case if object deleted then _CLASSPTR[ptr] will be deleted(object is death), but
+ # _tUIDEL[_CLASSPTR[ptr]] will be created that object can be resurrected from morg
+ # dptr can be any string containing any characters except `:'. It's not verified
+ # pfx,sfx - uid prefix str, and uid suffix str; this strings specifies string that can be inserted before/after
+ # uid generated by uid generator:
+ #
+ # class uid: pfx uidgen sfx
+ #
+ # Both can be any string(including ""), and can contains any character with B4-escaping feature.
+ # Note: that this strings cannot contains "'" character: it's should be escaped by B4-escaper.
+ # hstr,lstr - this values configure uid-generator itself. ther is a 3 combinations regarding its:
+ #
+ # hstr lstr function
+ #
+ # `ptr * - specify pointer to external uid-generator
+ # All uids and chars will be generated by external uid-generator
+ # * ^ptr - class will have it's own uid generator using external character set
+ # str str - class will have it's own uid generator with it's own character set
+ # character set inmplemented in hstr(high-charset) and in lstr(low-charset) in 2 ways:
+ # 1) "AB" "AB01" - this mean that high-charset contain chars: `A' and `B'
+ # low-charset contains chars: `A', `B', `0', `1'
+ #
+ # 2) "Az,By" "Ax,Bw,0v,1u" - this mean that high-charset contain chars: `Az' and `By'
+ # low-charset contains chars: `Ax', `Bw', `0v', `1u'
+ # Note: both: hstr and lstr cannot contain char `,' directly, but it's can uses
+ # B4-escaper to escape any char including `,'
+ # !!!! in case of using `,' in hstr/lstr - the escaped `,' will leads to interpretate hstr and lstr as divided by `,'
+ # if parameters error then i should be more specific about what error in parameters detected
+ # document _inituid(): parameters; document cs: uid initialization string format
+ # test with escape char
+ # adv hstr and lstr splitting?
+ # chk if hstr len==0 ?
+ # return _tclass & report error?
+ # _tapi thru function
+ # additional syntax checking ???
+ # implement syntax and uid srv in docs
+ # add _dumpuid() ????
+ # make performance measurement
+ # protection against badchar list
+ # additional feature to specify _getuid() to not resurrect uid; and informative that uid was ressurected or not
+ # build _defclass fn
+ # _tuidinitcs ????
+ # _tuidchrh[p]
+ # _tuidchrl[p]
+ # _tuidchr[p]
+ # _tuidcnt[p]
+ # _tUIDPFX[p]
+ # _tUIDSFX[p]
+ # _tUIDEL
+ # _tUIDCNTH
+ # _tUIDCNTL
+ # _tUIDCHRL
+ # _tUIDCHRH
+ # create default class basic `new' and `del' functions
_ini("uidel:pfx'hstr|lstr'sfx")
_ini("uidel:pfx'hstr|lstr'")
_ini("uidel:'hstr|lstr'sfx")
@@ -5613,6 +6876,32 @@
function _tzend(a, b)
{
+ #_____________________________________________________
+ # _tframe0(hndstr,ptr)
+ #
+ #
+ # IN:
+ # MOD:
+ # OUT:
+ # RETURN:
+ #
+ # handler string:
+ # Handler-string divides to words. Word splitter is char ";"
+ #
+ # Note that handler-string processed left to right. This mean that next word(more rightly) will overwrite fields implemented before(leftmost).
+ # Note that if word-string contains more than one rexp-field then only last rexp-field(most rightly) will be applied.
+ #_______________________________________________
+ # TO DESIGN:
+ #
+ # 0-4: complete design of tlink handler call
+ # 1-4: add new tlink handler call
+ # 1-4: add new run fn (changed rexp to different for each type: see _tframe0)
+ #
+ # hndstr:
+ # may be add rexp for each type of handler and also total rexp for all ??? ADDED (test)
+ # may be add separator char ";" ??? ADDED (test)
+ #_______________________________________________________________________
+ #####################################################
if (b == 0 && b == "") {
return (_TEND[_TEND[_ARRLEN]] = a)
} else {
@@ -5636,6 +6925,7 @@
function _unformatrexp(t)
{
+ #___________________________________________________________________________________
_formatstrq0 = split(t, _FORMATSTRA, /(\\[0-9]{1,3})|(\\x[[:xdigit:]]+)|(\\.)/, _FORMATSTRB)
_formatstrs0 = ""
for (t = 1; t < _formatstrq0; t++) {
@@ -5646,6 +6936,7 @@
function _unformatrexp_init(i, a)
{
+ #___________________________________________________________
_formatstrs0 = "\\^$.[]|()*+?{}-sSwW<>yB`'"
delete _FORMATSTRB
for (i = 0; i < 256; i++) {
@@ -5673,6 +6964,7 @@
function _unformatstr(t)
{
+ #___________________________________________________________________________________
_formatstrq0 = split(t, _FORMATSTRA, /(\\[0-9]{1,3})|(\\x[[:xdigit:]]+)|(\\.)/, _FORMATSTRB)
_formatstrs0 = ""
for (t = 1; t < _formatstrq0; t++) {
@@ -5683,6 +6975,7 @@
function _unformatstr_init(i)
{
+ #___________________________________________________________
for (i = 0; i < 256; i++) {
_QESCHR["\\" _CHR[i]] = _CHR[i]
}
@@ -5708,11 +7001,38 @@
function _uninit_del(A, i, p0)
{
+ #_____________________________________________________________________________
_del(i)
}
function _unstr(t)
{
+ ####################################################################################
+ # PUBLIC:
+ #_____________________________________________________________________________
+ # var _SYS_STDOUT - (by default = "/dev/stdout") standart output pipe filename
+ # var _SYS_STDERR - (by default = "/dev/stderr") standart error output pipe filename
+ # var _SYS_STDCON - (by default = "CON") standart console output device
+ #_____________________________________________________________________________
+ # var _CHR["CR"] - return cursor to the position 0 without newline(normally ="\x0D")
+ # var _CHR["EOL"] - return cursor to the position 0 & newline (MS:="\x0D\x0A" / UX:="\x0D")
+ # var _CON_WIDTH - console width(columns number)
+ #_____________________________________________________________________________
+ # fn _cmd(c) - execute shell command c and return output
+ # fn _err - output string w\o any addition into _SYS_STDERR device
+ # fn _errnl - output string with addition _CHR["EOL"] at the end of the string into _SYS_STDERR device
+ # fn _out - output string w\o any addition into _SYS_STDOUT device
+ # fn _outnl - output string with addition _CHR["EOL"] at the end of the string into _SYS_STDOUT device
+ #_____________________________________________________________________________
+ # fn _con(text[,tabspace])
+ # fn _conl(text[,tabspace])
+ # fn _conline(text[,tabspace])
+ # fn _constat(status[,tabspace])
+ # fn _constatpush([status[,tabspace]])
+ # fn _constatpop()
+ #_______________________________________________________________________
+ # var _constatstr
+ ####################################################################################
return gensub(/\\(.)/, "\\1", "G", t)
}
@@ -5720,6 +7040,8 @@
{
if (f = filepath(f)) {
if (match(f, /\\$/)) {
+ #_________________________________________________________________
+ #############################################
_deletepfx(_FILEIO_RDTMP, a = toupper(f))
_deletepfx(_FILEIO_RDNETMP, a)
} else {
@@ -5732,6 +7054,7 @@
function _val(v, t)
{
+ #_____________________________________________________________________________
if (isarray(v)) {
return (_dumparr(v) _ln(t))
}
@@ -5743,6 +7066,7 @@
function _val0(v)
{
+ #_____________________________________________________________________________
if (isarray(v)) {
return _dumparr(v)
}
@@ -5754,6 +7078,7 @@
function _var(v, t)
{
+ #_____________________________________________________________________________
if (isarray(v)) {
return (_dumparr(v) _ln(t))
}
@@ -5766,6 +7091,8 @@
function _verb(t, d, A)
{
if (_ERRLOG_VF) {
+ #_______________________________________________________________________
+ ##################################################
A["TYPE"] = "VERB"
A["TEXT"] = t
_log(A, d)
@@ -5776,8 +7103,11 @@
{
if (p) {
if (v) {
+ ######################## v is parentesis of p
for (a = p; a in _tPARENT; ) {
if ((a = _tPARENT[a]) == v) {
+ #_________________________________________________________________
+ ###########################################
return v
}
}
@@ -5876,15 +7206,19 @@
return (_tPREV[_tNEXT[v] = p] = v)
}
} else {
+ ######################## p=ptr, v=0
if (v == 0) {
return v
}
return v
}
} else {
+ ######################## p=ptr, v=""
+ ######################## p=0
if (p == 0) {
return v
}
+ ######################## p="", v=ptr - exclude v
if (v) {
return _texclude(v)
}
@@ -5896,9 +7230,13 @@
{
if (p) {
if (v) {
+ ######################## p=v=ptr
if (p == v) {
+ #_________________________________________________________________
+ ##########################################
return v
}
+ ######################## v is parentesis of p
for (a = p; a in _tPARENT; ) {
if ((a = _tPARENT[a]) == v) {
return v
@@ -5963,6 +7301,7 @@
} else {
if (v == 0) {
if (p in _tFCHLD) {
+ ######################## p=ptr, v=0 > delete all chld
v = _tFCHLD[p]
delete _tFCHLD[p]
delete _tLCHLD[p]
@@ -5975,6 +7314,8 @@
return v
}
} else {
+ ######################## p=ptr, v="" > ignore action
+ ######################## p=0
if (p == 0) {
return v
}
@@ -5986,8 +7327,11 @@
{
if (p) {
if (v) {
+ ######################## v is parentesis of p
for (a = p; a in _tPARENT; ) {
if ((a = _tPARENT[a]) == v) {
+ #_________________________________________________________________
+ ###########################################
return v
}
}
@@ -6086,15 +7430,19 @@
return (_tNEXT[_tPREV[v] = p] = v)
}
} else {
+ ######################## p=ptr, v=0
if (v == 0) {
return v
}
return v
}
} else {
+ ######################## p=ptr, v=""
+ ######################## p=0
if (p == 0) {
return v
}
+ ######################## p="", v=ptr - exclude v
if (v) {
return _texclude(v)
}
@@ -6106,9 +7454,13 @@
{
if (p) {
if (v) {
+ ######################## p=v=ptr
if (p == v) {
+ #_________________________________________________________________
+ ##########################################
return v
}
+ ######################## v is parentesis of p
for (a = p; a in _tPARENT; ) {
if ((a = _tPARENT[a]) == v) {
return v
@@ -6173,6 +7525,7 @@
} else {
if (v == 0) {
if (p in _tFCHLD) {
+ ######################## p=ptr, v=0 > delete all chld
v = _tFCHLD[p]
delete _tFCHLD[p]
delete _tLCHLD[p]
@@ -6185,6 +7538,8 @@
return v
}
} else {
+ ######################## p=ptr, v="" > ignore action
+ ######################## p=0
if (p == 0) {
return v
}
@@ -6194,6 +7549,8 @@
function _wLINK(p, v)
{
+ #_________________________________________________________________
+ ##############################################
return (_tLINK[p] = v)
}
@@ -6201,9 +7558,13 @@
{
if (p) {
if (v) {
+ ######################## p=v=ptr
if (p == v) {
+ #_________________________________________________________________
+ #########################################
return v
}
+ ######################## v is parentesis of p
for (a = p; a in _tPARENT; ) {
if ((a = _tPARENT[a]) == v) {
return v
@@ -6258,15 +7619,19 @@
}
return (_tNEXT[_tPREV[v] = p] = v)
} else {
+ ######################## p=ptr, v=0
if (v == 0) {
return v
}
return v
}
} else {
+ ######################## p=ptr, v=""
+ ######################## p=0
if (p == 0) {
return v
}
+ ######################## p="", v=ptr - exclude v
if (v) {
return _texclude(v)
}
@@ -6276,6 +7641,8 @@
function _wPARENT(p, v)
{
+ #_________________________________________________________________
+ ############################################
return v
}
@@ -6283,9 +7650,13 @@
{
if (p) {
if (v) {
+ ######################## p=v=ptr
if (p == v) {
+ #_________________________________________________________________
+ #########################################
return v
}
+ ######################## v is parentesis of p
for (a = p; a in _tPARENT; ) {
if ((a = _tPARENT[a]) == v) {
return v
@@ -6340,15 +7711,19 @@
}
return (_tPREV[_tNEXT[v] = p] = v)
} else {
+ ######################## p=ptr, v=0
if (v == 0) {
return v
}
return v
}
} else {
+ ######################## p=ptr, v=""
+ ######################## p=0
if (p == 0) {
return v
}
+ ######################## p="", v=ptr - exclude v
if (v) {
return _texclude(v)
}
@@ -6358,6 +7733,8 @@
function _wQBRO(p, v)
{
+ #_________________________________________________________________
+ ##############################################
return v
}
@@ -6368,6 +7745,10 @@
} else {
if (v == 0) {
if (p in _tFCHLD) {
+ #_________________________________________________________________
+ #############################################
+ ######################## p=ptr, v=ptr
+ ######################## p=ptr, v=0 > delete all chld
v = _tFCHLD[p]
delete _tFCHLD[p]
delete _tLCHLD[p]
@@ -6380,7 +7761,9 @@
return v
}
} else {
+ ######################## p=0
if (p == 0) {
+ ######################## p=ptr, v="" > ignore action
return v
}
return v
@@ -6390,6 +7773,8 @@
function _warning(t, d, A)
{
if (_ERRLOG_WF) {
+ #_______________________________________________________________________
+ ###############################################
A["TYPE"] = "WARNING"
A["TEXT"] = t
_log(A, d)
@@ -6398,6 +7783,7 @@
function _wfilerdnehnd(f, t)
{
+ #___________________________________________________________
if ((f = _filerdne(f)) == "") {
return ""
}
@@ -6421,6 +7807,7 @@
function _wr_shortcut(f, S)
{
if (_shrtcutf0 = _filepath(f)) {
+ #___________________________________________________________
ERRNO = ""
_shrtcuta0 = _shortcut_fpath " /A:C /F:\"" _shrtcutf0 "\" 2>&1"
for (f in _SHORTCUTWSTRUC) {
@@ -6438,6 +7825,8 @@
function _wrfile(f, d, a, b)
{
if ((f = _wfilerdnehnd(f)) == "" || _filene(f) == "") {
+ #_________________________________________________________________
+ #########################################
ERRNO = "Filename error"
return
}
@@ -6462,6 +7851,8 @@
function _wrfile1(f, d, a, b)
{
if ((f = _wfilerdnehnd(f)) == "" || _filene(f) == "") {
+ #___________________________________________________________
+ ##################################
ERRNO = "Filename error"
return
}
@@ -6485,11 +7876,14 @@
function _yexport(p)
{
+ #_______________________________________________________________________
+ #####################################################
return _tframe("_yexport_i0", p)
}
function _yexport_i0(p, p0, p1, p2)
{
+ #_______________________________________________________________________
if (p in _tLOG) {
return ("_ERRLOG: " _Zexparr(_tLOG[p]) "\n")
}
@@ -6503,11 +7897,14 @@
function cmp_str_idx(i1, v1, i2, v2)
{
+ #_________________________________________________________________
+ ##############################
return ((i1 < i2 ? -1 : 1))
}
function filedi(f, d)
{
+ #___________________________________________________________
if ((f = filerdnehndi(f)) == "") {
return _FILEIO_D
}
@@ -6528,6 +7925,7 @@
function filegetdrvdir(t, r)
{
+ #___________________________________________________________
if (t in _FILEDRV) {
return _FILEDRV[t]
}
@@ -6544,6 +7942,7 @@
function filegetrootdir(f, dd, d)
{
if (f in _FILEDIRFL) {
+ #___________________________________________________________
if (f in _FILEROOT) {
return (_FILEROOT[f] _FILEDIR[f])
}
@@ -6581,6 +7980,7 @@
function filerdnehndi(st, a, c, r, d, n, A)
{
if (st) {
+ #___________________________________________________________
if ((c = toupper(st)) in _FILECACHE) {
return _FILECACHE[c]
}
@@ -6632,6 +8032,7 @@
function fileri(f)
{
+ #_____________________________________________________
if ((f = filerdnehndi(f)) == "") {
return _FILEIO_R
}
@@ -6651,6 +8052,8 @@
function ncmp_str_idx(i1, v1, i2, v2)
{
+ #___________________________________________________________
+ #######################
return ((i1 < i2 ? 1 : -1))
}
@@ -6709,6 +8112,9 @@
function test_uid(p, i)
{
+ #test_cfg()
+ #return
+ #_fclass=_cfguid(p=_getuid(_classys),_NOP,_NOP,_NOP,"",_classys)
_fclass = _cfguid(p = _getuid(_classys), p, "pfx", "sfx", "abc")
_conl("_fclass uid: " _getuid(_fclass))
_drawuid(_fclass)
@@ -6741,6 +8147,20 @@
function zorr(A, i, r)
{
+ # # - p is array
+ # ` - p is ptr detected in array _CLASSPTR(for _typ); or p is ptr detected in array A(for _typa)
+ # 0 - p is undefined
+ # 2 - p is string==""
+ # 3 - p is string!=""
+ # 4 - p is number 0
+ # 5 - p is any number except 0(positive and negative)
+ # str: _typ(p)+0 !_typ(p)+0
+ # str/ptr _typ(p)>0 _typ(p)<1
+ # str/arr "`">_typ(p0) && _t0
+ # str/ptr/arr _typ(p) !_typ(p)
+ # ptr _typ(p)=="`" _typ(p)<"`" ?
+ # ptr/arr _typ(p)+0!=_t0
+ # arr _typ(p)=="#" _typ(p)>"#" ?
if (i in A) {
_conl("`" i "' in A")
} else {