1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
|
2013-05-30 Arnold D. Robbins <arnold@skeeve.com>
More profiling fixes:
* profile.c (pprint): For Op_in_array, parenthesize subscript if
the precedence is lower. E.g.: (c = tolower(foo)) in ARRAY.
(prec_level): Merge cases for precedence of 5.
(parenthesize): Simplify, as in 3.1.8. Avoids stuff like
`(x == 1 && (z ==2 && (q == 4 && w == 7)))'.
Unrelated:
* io.c (iop_finish): fstat the fd before closing it to avoid
errors on some operating systems. Thanks to Eli Zaretskii
for the report.
2013-05-29 Arnold D. Robbins <arnold@skeeve.com>
* profile.c (pp_group3): Renamed from pp_concat. Change all calls.
(is_binary): Change return type to bool.
(is_scalar): New function.
(pp_concat): New function to handle concatenation operator better.
(pprint): Call it at case Op_concat. Fix Op_K_delete if multiple
indexes to separate with "][".
General: Add leading comments as needed.
2013-05-28 Arnold D. Robbins <arnold@skeeve.com>
* main.c (main): Add minor hack to not run code if pretty printing
and undocumented env var GAWK_NO_PP_RUN exists.
* profile.c (pp_string): Explicitly print NUL chars as \000.
2013-05-27 Arnold D. Robbins <arnold@skeeve.com>
* configure.ac (AM_INIT_AUTOMAKE): Add dist-lzip to quiet
outside maintainer warnings.
Unrelated:
* configure.ac (AC_STRUCT_ST_BLKSIZE): Replaced with call to
AC_CHECK_MEMBERS.
Unrelated:
* array.c (null_array): Remove the assert and just clear
symbol->xarray.
2013-05-26 Arnold D. Robbins <arnold@skeeve.com>
* getopt.c: For Mac OS X, also include <stdlib.h> to avoid
some compiler warnings.
2013-05-20 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.h [FAKE_FD_VALUE]: Moved from here to ...
* io.c [FAKE_FD_VALAUE]: here.
2013-05-14 Eli Zaretskii <eliz@gnu.org>
* io.c (devopen) [__EMX__ || __MINGW32__]: Produce EISDIR on MinGW
when an attempt to open() a directory fails.
(two_way_open) [__EMX__ || __MINGW32__]: When trying to open() a
directory fails with EISDIR, assign FAKE_FD_VALUE to the file
descriptor and attributes of a directory to its mode bits. This
is needed to support the readdir extension.
* gawkapi.h (FAKE_FD_VALUE): New macro, used in io.h and in
extension/gawkdirfd.h.
2013-05-09 Arnold D. Robbins <arnold@skeeve.com>
* 4.1.0: Release tar ball made.
2013-05-09 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y (snode): Make it a fatal error to use a regexp constant
as the second argument of index(). Thanks to Christopher Durant
<christopher.durant@marquesa.net> and Brian Kernighan for the report
and the advice.
2013-04-28 Eli Zaretskii <eliz@gnu.org>
* io.c (redirect): Remove the HACK that called close_one when
errno was zero in the MinGW build. This prevents failure in
several tests in the test suite, e.g., closebad.
2013-04-28 Arnold D. Robbins <arnold@skeeve.com>
* bootstrap.sh: Fix a comment.
2013-04-24 Arnold D. Robbins <arnold@skeeve.com>
* io.c (do_getline_redir): Fix the leading comment.
2013-04-23 Arnold D. Robbins <arnold@skeeve.com>
* main.c (load_procinfo): Add PROCINFO entries for API major
and minor versions.
2013-04-21 Arnold D. Robbins <arnold@skeeve.com>
* missing: Update from Automake 1.13.1.
2013-04-18 Arnold D. Robbins <arnold@skeeve.com>
* configure.ac: Fix a typo.
2013-04-17 Corinna Vinschen <vinschen@redhat.com>
* configure.ac: Remove special casing for cygwin for libiconv
and libintl.
2013-04-16 Arnold D. Robbins <arnold@skeeve.com>
* bootstrap.sh: Touch gawk.texi too. Update copyright.
2013-04-16 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.c: Regenerated from bison 2.7.1.
* command.c: Ditto.
* dfa.h, dfa.c: Minor edits to sync with GNU grep.
* gettext.h: Sync with gettext 0.18.2.1.
* random.h: Remove obsolete __P macro and use. Update copyright year.
* Makefile.am, array.c, builtin.c, cint_array.c, cmd.h, debug.c,
eval.c, ext.c, field.c, gawkapi.c, gawkapi.h, gettext.h, int_array.c,
interpret.h, msg.c, node.c, profile.c, re.c, replace.c, str_array.c,
symbol.c: Update copyright year.
Update to automake 1.13.1:
* configure.ac (AM_INIT_AUTOMAKE): Update version.
* configure, Makefile.in, aclocal.m4, awklib/Makefile.in,
doc/Makefile.in, test/Makefile.in: Regenerated.
* getopt.c, getopt.h, getopt1.c, getopt_int.h: Sync with GLIBC.
2013-04-14 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y (check_funcs): Fix logic of test for called but
not defined warning. Thanks to Scott Deifik for the bug report.
2013-04-02 Arnold D. Robbins <arnold@skeeve.com>
* profile.c (print_lib_list): Send final newline to prof_fp
instead of stdout. Thanks to Hermann Peifer for the bug report.
2013-03-27 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (SUBDIRS): Move extension back into the middle of
the list so that `make check' without a prior `make' works.
Unrelated:
* main.c (main): Move env_lc into ifdef for LIBC_IS_BORKED.
2013-03-20 Arnold D. Robbins <arnold@skeeve.com>
For systems where libc is borked (MirBSD, maybe others).
* dfa.c: Force use of gawk_mb_cur_max instead of MB_CUR_MAX and make
mbrtowc a macro that always fails.
(using_utf8): Force utf8 to be 0 if libc borked and gawk_mb_cur_max
is one.
* main.c (main): If libc is borked and LC_ALL or LANG exist in the
environment and are set to "C" or "c", force gawk_mb_cur_max to one.
2013-03-11 Arnold D. Robbins <arnold@skeeve.com>
* re.c (check_bracket_exp): Make handling of embedded ] in
regexp smarter. Thanks to Ed Morton <mortoneccc@comcast.net>
for reporting the bug.
2013-03-01 Arnold D. Robbins <arnold@skeeve.com>
Don't build extensions if API isn't supported:
* Makefile.am (SUBDIRS): Move extension directory to last in case
building the extensions is not supported.
* configure.ac: Add check for MirBSD and don't even try to run the
checks for DYNAMIC if so.
Check for systems (MirBSD) where libc doesn't understand not
to use UTF-8 for LC_ALL=C.
* configure.ac (LIBC_IS_BORKED): AC_DEFINE if needed.
* regcomp.c (init_dfa): Change logic as needed if LIBC_IS_BORKED.
2013-02-28 Arnold D. Robbins <arnold@skeeve.com>
Cause profiling / pretty printing to include a list of
loaded extensions. Thanks to Hermann Peifer for the bug report.
* awk.h (srcfiles): Add declaration.
* profile.c (print_lib_list): New function.
(dump_prog): Call it.
2013-02-26 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y (expression_list): In case of error return the list
instead of NULL so that snode gets something it can count.
2013-02-12 Arnold D. Robbins <arnold@skeeve.com>
* bisonfix.awk: Comment out code for fixing contined #if
statements. It is likely not needed anymore. Leave it there in
case I'm wrong.
2013-02-06 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (printf_common): Move nargs > 0 check into assert.
(do_sprintf): Add nargs check and fatal message to here.
2013-02-04 Arnold D. Robbins <arnold@skeeve.com>
* main.c (main): Remove undocumented -m option which was for
compatibility with BWK awk. His awk dropped it back in 2007.
2013-02-03 Arnold D. Robbins <arnold@skeeve.com>
* configure.ac: Add Automake test for cross compiling.
2013-01-31 Arnold D. Robbins <arnold@skeeve.com>
* regcomp.c, regex.c, regex_internal.c, regexec.c: Update
copyright years to sync with GLIBC.
From: http://www.sourceware.org/ml/libc-alpha/2013-01/msg00967.html,
by Andreas Schwab <schwab@suse.de>:
* regexec.c (extend_buffers): Add parameter min_len.
(check_matching): Pass minimum needed length.
(clean_state_log_if_needed): Likewise.
(get_subexp): Likewise.`
2013-01-31 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c: Include "dfa.h" which includes regex.h after limits.h
so that RE_DUP_MAX gets the correct value. Especially needed on
OpenVMS. Thanks to Anders Wallin.
* main.c (version): Print out API version numbers if DYNAMIC.
Helpful also for knowing if to run the shlib tests.
* configure: Regenerated after change in m4/readline.m4.
2013-01-31 Arnold D. Robbins <arnold@skeeve.com>
* PROBLEMS: Removed. It is no longer needed.
* Makefile.am (EXTRA_DIST): Remove PROBLEMS from list.
2013-01-31 Andrew J. Schorr <aschorr@telemetry-investments.com>
* configure.ac: Remove TEST_MPFR conditional added in last patch.
We will instead test for MPFR capability by looking at the output
from gawk --version.
2013-01-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
* configure.ac: Add MPFR test for use in test/Makefile.am.
2013-01-25 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y (parms_shadow): Change int param to bool.
* cmd.h (output_is_tty): Sync type with rest of code (is bool).
* dfa.c (MALLOC): Undef first, for Irix.
* Makefile.am (LDADD): Use LIBREADLINE and LIBMPFR instead of
automake substitutions.
* configure.ac (AC_INIT): Version bump.
(GAWK_CHECK_READLINE): Renamed from GNUPG_CHECK_READLINE.
2013-01-23 Arnold D. Robbins <arnold@skeeve.com>
* awk.h (list_functions): Change parameter to bool.
* symbol.c (list_functions): Ditto.
(get_symbols): Change sort parameter to bool. Additional
code cleanup.
2013-01-22 Arnold D. Robbins <arnold@skeeve.com>
* symbol.c (get_symbols): Reset count after each loop to only
sort the actual items retrieved. Thanks to Hermann Peifer (by
way of Andrew Schorr) for reporting the bug. Also add some
commentary and fix function name in emalloc calls.
2013-01-20 Arnold D. Robbins <arnold@skeeve.com>
* re.c (regexflags2str): New routine.
(resetup): If do_intervals, also turn on RE_NO_BK_BRACES.
Thanks to Yan Lei <yanl.fnst@cn.fujitsu.com> for the
bug report.
2013-01-18 Arnold D. Robbins <arnold@skeeve.com>
Fix a problem with include ordering to get ptrdiff_t definition,
showed up on Debian Lenny. Reported by Manuel Collado.
Fix brought over from grep.
* dfa.h: Include regex.h and stddef.h directly.
* dfa.c: Adjust includes.
2013-01-11 John Haque <j.eh@mchsi.com>
* awk.h (do_mpfr_rshift): Renamed from do_mpfr_rhift.
* awkgram.y (do_mpfr_rshift): Renamed from do_mpfr_rhift.
* mpfr.c (_tz1, _tz2, _mpz1, _mpz2, mpz1, mpz2, get_bit_ops,
free_bit_ops): Removed.
(init_mpfr): Remove calls to mpz_init.
(get_intval, free_intval): New functions.
(do_mpfr_rshift, do_mpfr_lshift): Rework code.
(do_mpfr_and, do_mpfr_or, do_mpfr_xor): Accept two or more arguments
to match regular functions.
2013-01-11 Arnold D. Robbins <arnold@skeeve.com>
* bisonfix.awk: Adjust ARGV / ARGC to force reading of standard
input; apparently needed for Mac OS X. Thanks to Akim Demaille
for the report.
2013-01-06 Arnold D. Robbins <arnold@skeeve.com>
* io.c (redirect, two_way_open): Set the name field in the
awk_input_buf_t and awk_output_buf_t structures, as needed.
Thanks to Manuel Collado for the report.
2013-01-05 Arnold D. Robbins <arnold@skeeve.com>
* regex_internal.h (struct re_dfa_t): Restore ifdefs around
__libc_lock_define, they really were needed. Bleah.
2013-01-01 Arnold D. Robbins <arnold@skeeve.com>
Sync with GLIBC regex files.
* regex_internal.h (struct re_dfa_t): Remove ifdefs around
__libc_lock_define since it's already defined to empty in non-LIBC
case.
* regexec.c (check_node_accept_bytes): Restore decl with use from
GLIBC code since this is LIBC case.
2012-12-27 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (do_print, do_printf): Use output_fp as default
output for print/printf only if running under the debugger.
Otherwise use stdout as Brian, Peter, and Al intended.
2012-12-25 Arnold D. Robbins <arnold@skeeve.com>
Remove sym-constant from API after discussions with John
Haque and Andy Schorr.
* gawkapi.h (api_sym_constant): Removed field in API struct.
(sym_constant): Remove macro.
* gawkapi.c (set_constant, api_sym_update, api_sym_constant): Removed.
(sym_update_real): Renamed to api_sym_update(). is_const parameter
removed and code adjusted.
2012-12-24 Arnold D. Robbins <arnold@skeeve.com>
* 4.0.2: Release tar ball made.
2012-12-23 John Haque <j.eh@mchsi.com>
* eval.c (r_get_lhs): Node_array_ref. If original is Node_var,
don't assign null-string as value.
* ext.c (get_argument): Node_array_ref. Check if already a scalar.
2011-12-23 John Haque <j.eh@mchsi.com>
* awkgram.y (is_deferred_variable): New function.
(func_install): Call it.
* eval.c (r_interpret): Op_push_arg. Check for uninitialized scalar.
2012-12-23 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y (tokentab): Whitespace fix for "include".
* builtin.c (printf_common): Do a fatal error if no args to printf()
or sprintf().
2012-12-19 Arnold D. Robbins <arnold@skeeve.com>
* bootstrap.sh: Touch extension/aclocal.m4 also.
Unrelated: Extend input parser API:
* awk.h (IOBUF): Remove read_func pointer.
* gawkapi.h (awk_input_buf_t): Move it to here.
* io.c (iop_alloc, get_a_record, get_read_timeout): Adjust code.
Unrelated: Make sure that variables like NF, NR, FNR are
accessable correctly both through SYMTAB and through API.
* gawkapi.c (api_sym_lookup): Call update_global_values().
(api_sym_lookup_scalar): Ditto.
* interpret.h (Op_subscript, Op_subscript_lhs): Ditto.
* main.c (update_global_values): Adjust comment.
Unrelated: Fix --disable-lint so that everything compiles.
* main.c (main): Move case lable inside ifdef.
* awkgram.y (isnoeffect): Add ifdefs around declaration, use,
and function body.
Unrelated: Restore building with tcc.
* awk.h (AFUNC): Move to array.c which is the only place its used.
(ainit_ind, atypeof_ind, etc.): New macros for use in array.c
* array.c (AFUNC): Change to use F##_ind. Works with tcc and other
compilers.
* configure.ac: Only add -export-dynamic flag if compiling with gcc.
2012-12-18 Andrew J. Schorr <aschorr@telemetry-investments.com>
* gawkapi.c (sym_update_real): If setting a scalar variable that exists
already in an undefined state with type set to Node_var_new, we must
update the type to Node_var if the new value is not undefined.
2012-12-18 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y (tokentab): "extension" needs to be inside ifdef DYNAMIC.
Thanks to Anders Wallin for finding this.
2012-12-16 Arnold D. Robbins <arnold@skeeve.com>
* debug.c (do_set_var): Fix last remaining `*assoc_lookup() = x'.
2012-12-15 Arnold D. Robbins <arnold@skeeve.com>
Infrastructure Updates:
* awkgram.c, command.c: Regenerated with bison 2.7.
* config.guess, config.sub, depcomp: Updated from automake 1.12.6.
2012-12-09 Arnold D. Robbins <arnold@skeeve.com>
Clean up BINMODE to use symbolic values.
* awk.h (enum binmode_values): New enum.
* eval.c (set_BINMODE): Use them.
* io.c (binmode, close_rp, gawk_popen): Ditto.
* main.c (main): Ditto.
* builtin.c (do_system): Ditto.
Unrelated:
* configure.ac: Look for posix_openpt
* io.c (two_way_open): Use posix_openpt if it's available.
Thanks to Christian Weisgerber <naddy@mips.inka.de> for
the changes.
Also unrelated:
* regex.c: Don't include <sys/param.h> on VMS. Thanks to
Anders Wallin.
Also unrelated:
* ext.c (is_letter, is_identifier_char): New functions. Don't use
<ctype.h> functions since those could rely on the locale.
(make_builtin): Adjust test for valid name to call the new
functions and return false instead of throwing a fatal error.
(make_old_builtin): Adjust test for valid name to call the new
function.
* awk.h (is_identchar): Move from here, ...
* awkgram.y (is_identchar): ... to here. This is safe, since
the locale is C during parsing the program.
Also unrelated: Make all checks for bitflags being set consistent
in case we should wish to switch them to macro calls:
* awkgram.y, builtin.c, cint_array.c, debug.c, eval.c, gawkapi.c,
int_array.c, io.c, mpfr.c, node.c, profile.c, str_array.c: Fix
as needed.
2012-12-07 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y (tokentab): `fflush()' is now in POSIX, remove the
RESX flag. This was the last use, so delete the flag.
(yylex): Don't check RESX.
Thanks to Nathan Weeks <weeks@iastate.edu> for helping make this
happen.
2012-12-01 Arnold D. Robbins <arnold@skeeve.com>
* interpret.h: For op_assign_concat, if both strings
have WSTRCUR, then do the realloc() and append for the
wide string too. Thanks to Janis Papanagnou
<janis_papanagnou@hotmail.com> for the discussion in
comp.lang.awk.
2012-11-30 Arnold D. Robbins <arnold@skeeve.com>
* regcomp.c, regex.c, regex_internal.h, regexec.c: Sync
with GLIBC. Why not.
* gawkapi.c (awk_bool_t): Change into an enum with awk_false and
awk_true values.
2012-01-30 Andrew J. Schorr <aschorr@telemetry-investments.com>
Further cleanups of macros in awk.h
* awk.h (_r, _t): Remove declarations.
(unref, m_force_string): Remove macros.
(r_unref): Move declaration.
(r_force_string): Remove declaration.
(DEREF, force_string, force_number, unref): Now inline functions.
(POP_STRING, TOP_STRING): Back to macros.
* eval.c (_t): Remove definition.
* main.c (_r): Remove definition.
* node.c (r_force_string): Remove.
2012-11-27 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (do_fflush): Make fflush() and fflush("") both
flush everything. See the comment in the code.
2012-11-26 Arnold D. Robbins <arnold@skeeve.com>
* awk.h (Node_old_ext_func, Op_old_ext_func): New enum values.
* configure.ac: Use -export-dynamic if supported for old extension
mechanism.
* eval.c (nodeytpes): Add Node_old_ext_func.
(optypetab): Add Op_old_ext_func.
* ext.c (make_old_ext_builtin): "New" function.
* interpret.h: Special case Op_old_ext_builtin. Add checks for
Node_old_ext_func.
* msg.c: Adjust placement of a comment.
2012-05-02 John Haque <j.eh@mchsi.com>
* str_array.c (str_copy): Initialize next pointer in the linked list
to avoid memory corruption.
* int_array.c (int_copy): Ditto.
2012-04-21 John Haque <j.eh@mchsi.com>
Shutdown routine for a dynamic extension.
* awk.h (SRCFILE): New field fini_func.
* ext.c (load_ext): Takes an additional argument to look up and
save the clean up routine in SRCFILE struct.
(INIT_FUNC, FINI_FUNC): Defines for default init and fini routine
names.
(do_ext): Use default for the name of the init or fini routine if
one is not supplied. Adjust call to load_ext().
(close_extensions): Execute fini routines.
* interpret.h (Op_at_exit): Call close_extensions().
* msg.c (gawk_exit): Ditto.
* debug.c (close_all): Ditto.
* main.c (main): Adjust call to load_ext().
* awkgram.y (tokentab): Specify 2nd and 3rd optional arguments
for the extension() built-in.
Unrelated:
* interpret.h (Op_arrayfor_init): Use assoc_length for array size.
2012-04-19 John Haque <j.eh@mchsi.com>
Enhanced array interface to support transparent implementation
using external storage and ...
* awk.h (astore): Optional post-assignment store routine for
array subscripts.
(Op_subscript_assign): New opcode to support the store routine.
(alength): New array interface routine for array length.
(assoc_length): New macro.
(assoc_empty): Renamed from array_empty.
* awkgram.y (snode): Append Op_subscript_assign opcode if
(g)sub variable is an array element.
(mk_getline): Same for getline variable.
(mk_assignment): Same if assigning to an array element.
* field.c (set_element): Call store routine if needed.
* builtin.c (do_match): Ditto.
(do_length): Use length routine for array size.
* symbol.c (print_vars): Ditto.
* array.c (null_length): Default function for array length interface.
(asort_actual): Call store routine if defined.
(asort_actual, assoc_list): Use length routine for array size.
(null_array_func): Add length and store routine entries.
* str_array.c (str_array_func): Same.
* cint_array.c (cint_array_func): Same.
* int_array.c (int_array_func): Same.
* eval.c (optypetab): Add Op_subscript_assign.
* profile.c (pprint): Add case Op_subscript_assign.
* interpret.h (set_array, set_idx): New variables to keep track
of an array element with store routine.
(Op_sub_array, Op_subscript_lhs, Op_store_sub, Op_subscript_assign):
Add code to handle array store routine.
* debug.c (print_symbol, print_array, cmp_val, watchpoint_triggered,
initialize_watch_item): Use length routine for array size.
* awk.h (assoc_kind_t): New typedef for enum assoc_list_flags.
(sort_context_t): Renamed from SORT_CONTEXT.
* array.c (asort_actual, assoc_sort): Adjust.
* cint_array.c (cint_list, tree_list, leaf_list): Adjust.
* int_array.c (int_list): Adjust.
* str_array.c (str_list): Adjust.
2012-04-18 John Haque <j.eh@mchsi.com>
* awk.h (atypeof, AFUNC): New macros.
(afunc_t): Renamed typedef from array_ptr.
* array.c (register_array_func, null_lookup): Use AFUNC macro
instead of hard-coded index for array functions.
(asort_actual): Unref null array elements before overwriting.
(force_array): Renamed from get_array.
(null_array): Renamed from init_array. Also initialize flags to 0.
(array_types): Renamed from atypes.
(num_array_types): Renamed from num_atypes.
* interpret.h (r_interpret): In case Op_sub_array, unref null array element.
* str_array.c (str_array_init): Reworked for (re)initialization of array.
* int_array.c (int_array_init): Ditto.
* cint_array.c (cint_array_init): Ditto.
2012-11-24 Arnold D. Robbins <arnold@skeeve.com>
Directory cleanup.
* TODO.xgawk, FUTURES: Merged into TODO.
* TODO: More stuff added.
* Makefile.am (EXTRA_DIST): Updated.
2012-11-22 Arnold D. Robbins <arnold@skeeve.com>
Cleanup of awk.h.
* array.c (r_in_array): Removed.
* awk.h (MALLOC_ARG_T): Replaced with size_t everywhere.
(S_ISREG, setsid): Moved to io.c.
(__extension__): Removed.
(INT32_BIT): Moved to cint_array.c.
(_t): Always declare.
(DO_LINT_INVALID, et al): Moved into an enum.
(POP_ARRAY, POP_PARAM, POP_SCALAR, TOP_SCALAR, dupnode, in_array):
Moved into inline functions.
(force_number, force_string): Simplified.
(ZOS_USS): Remove undef of DYNAMIC, it's handled in configure.ac.
* io.c (S_ISREG, setsid): Moved to here.
* cint_array.c (INT32_BIT): Moved to here.
* eval.c (_t): Always define.
* protos.h: Use size_t directly instead of MALLOC_ARG_T.
Unrelated:
* gawkapi.h: Add `awk_' prefix to structure tags where they
were missing. Document the full list of include files needed.
2012-11-14 Arnold D. Robbins <arnold@skeeve.com>
* io.c (do_find_source): On VMS, don't add the `/' separater.
Thanks to Anders Wallin.
MPFR minor cleanup:
* awk.h (mpfr_unset): Declare new function.
* mpfr.c (mpfr_unset): New function.
* node.c (r_unref): Call it instead of inline code.
* gawk_api.c (api_sym_update_scalar): Call it instead of inline code.
2012-11-13 Arnold D. Robbins <arnold@skeeve.com>
* symbol.c (get_symbols): Check type, not vname. Keeps
valgrind happy. Thanks to Andrew Schorr for noticing the problem.
2012-11-10 Arnold D. Robbins <arnold@skeeve.com>
* Update to bison 2.6.5. Various files regenerated.
* io.c (find_source): Add a default value for SHLIBEXT.
(read_with_timeout): For VMS also, just use read().
2012-11-10 John Haque <j.eh@mchsi.com>
* int_array.c (int_copy): Initialize next pointer of newchain to null.
* eval.c (eval_condition): Force string context for an integer used
as array index.
2012-11-10 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.c (api_add_ext_func, api_awk_atexit, api_clear_array,
api_create_array, api_create_value, api_register_ext_version,
api_release_value, api_update_ERRNO_string, node_to_awk_value,
remove_element, run_ext_exit_handlers): Add null pointer checks.
Everywhere: Add / fixup leading comments.
* interpret.h (Op_store_sub): If assigning to an unitialized variable
through SYMTAB, change it to Node_var. Add explanatory comments.
* symbol.c (get_symbol): Rationalized. Skip non-variables in SYMTAB.
2012-11-04 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.h: Minor documentation edit.
2012-10-31 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y (want_regexp): Use as a bool, not as an int.
* field.c: Fix a comment.
* gawkapi.h: Add comment to include <errno.h>.
* symbol.c (load_symbols): ``No automatic aggregate initialization.''
Here too. Sigh again.
* gawkapi.h: Minor documentation edits.
2012-11-27 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (do_fflush): Make fflush() and fflush("") both
flush everything. See the comment in the code.
2012-10-28 Arnold D. Robbins <arnold@skeeve.com>
* Update to bison 2.6.4. Various files regenerated.
2012-10-27 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.h: Continuing the minor formatting / doc cleanups.
2012-10-26 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.h: Continuing the minor formatting / doc cleanups.
2012-10-24 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.h: Still more minor formatting / doc cleanups.
2012-10-23 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.h: More minor formatting / doc cleanups.
2012-10-21 Arnold D. Robbins <arnold@skeeve.com>
Fixes for z/OS from Dave Pitts.
* awk.h (assoc_list_flags): No trailing comma on last enum value.
* gawkapi.h (awk_valtype_t): Ditto.
* symbol.c (lookup): ``No automatic aggregate initialization.'' Sigh.
Unrelated:
* gawkapi.h: Minor formatting / doc cleanups.
2012-10-19 Arnold D. Robbins <arnold@skeeve.com>
If SYMTAB is used, make sure ENVIRON and PROCINFO get loaded too.
* awkgram.y (process_deferred): New function. Call it when program
is completely parsed.
(symtab_used): New variable.
(variable): Set it to true if SYMTAB is looked up.
* main.c (load_environ, load_procinfo): Make sure the routines are
only called once.
Unrelated fixes:
* awkgram.y (yylex): Check continue_allowed and break_allowed as
soon as they are seen in the scanner; the rules that check them
can not be reduced until after a token that allows them is seen,
leading to errors at execution time.
* interpret.h (Op_K_break, Op_K_continue, Op_jmp): Add asssertion
that pc->target_jmp is not NULL.
* symbol.c (lookup): Correct a comment.
2012-10-14 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.h (IOBUF_PUBLIC): Renamed awk_input_buf_t.
(struct iobuf_public): Renamed struct awk_input.
* awk.h: Adjust.
2012-10-13 Arnold D. Robbins <arnold@skeeve.com>
* Update to Automake 1.12.4. Various files regenerated.
2012-10-11 Arnold D. Robbins <arnold@skeeve.com>
* awk.h (dup_ent): New member for Node_param_list.
* symbol.c (install): For parameters, if this is a duplicate, chain
it off the original using the dup_ent pointer.
(remove_params): If there's a duplicate, remove it from the list.
* awk.h: Fix flags to have unique numeric values. Oops.
2012-10-10 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.h: Add considerably more documentation. Rearrange order
of functions in the struct to make more sense, grouping related
functions together in a more logical order.
* gawkapi.c: Adjust as needed.
* ext.c (make_builtin): Adjust for name change in struct member.
2012-10-05 Arnold D. Robbins <arnold@skeeve.com>
* mbsupport.h: Add a bunch of undefs for z/OS.
2012-10-04 Arnold D. Robbins <arnold@skeeve.com>
* TODO.xgawk: Update.
* awk.h (make_str_node): Removed macro.
(make_string): Modified to call make_str_node.
(r_make_str_node): Renamed to make_str_node.
* gawkapi.c: Changed r_make_str_node to make_str_node everywhere.
* node.c (make_str_node): Renamed from make_str_node.
Update to automake 1.12.4.
* Makefile.in, aclocal.m4, awklib/Makefile.in, doc/Makefile.in,
extension/Makefile.in, extension/aclocal.m4, test/Makefile.in:
Regenerated.
* interpret.h (Op_Subscript): Added lint warnings for FUNCTAB
and SYMTAB.
2012-10-02 Arnold D. Robbins <arnold@skeeve.com>
* awk.h (func_table): Declare.
* awkgram.y: If do_posix or do_traditional, then check for
delete on SYMTAB. Add check for delete on FUNCTAB, also.
* interpret.h (Op_Subscript): For FUNCTAB, return the element name
as its value too. Avoids lots of weirdness and allows indirect calls
after assignment from FUNCTAB["foo"] to work.
(Op_store_sub): Disallow assignment to elements of FUNCTAB.
(Op_indirect_func_all): Turn assert into check and fatal error.
* symbol.c (func_table): No longer static.
(lookup): If do_posix or do_traditional, skip the global table.
(release_all_vars): Clear func_table too.
2012-09-25 Arnold D. Robbins <arnold@skeeve.com>
First cut at SYMTAB and FUNCTAB. This does the following:
- Change symbol table handling to use gawk arrays.
- Store symbols in SYMTAB array and allow indirect access
through SYMTAB to variables, both getting and setting.
- List function names in FUNCTAB indexes; Values cannot be
used at the moment.
- No documentation yet.
* awk.h (Node_hashnode, hnext, hname, hlength, hcode, hvalue):
Removed, not needed any more.
(init_symbol_table, symbol_table): Add declarations.
* awkgram.y: Disallow delete on SYMTAB, fix warning for tawk
extension if traditional.
* eval.c (nodetypes): Remove Node_hashnode element.
* interpret.h (Op_subscript, Op_store_sub): Handle SYMTAB and go
through to the actual value.
* main.c (main): Init Nnull_string earlier. Add call to
init_symbol_table().
* profile.c (pp_str, pp_len): Change definitions.
(pp_next): New macro.
(pp_push, pp_pop): Adjust uses.
* symbol.c (variables): Removed.
(global_table, param_table, func_table, symbol_table,
installing_specials): New variables.
(lookup, make_params, install_params, remove_params, remove_symbol,
make_symbol, install, get_symbols, release_all_vars, append_symbol,
release_symbols, load_symbols): Rework logic considerably.
(init_symbol_table): New function.
2012-09-23 Arnold D. Robbins <arnold@skeeve.com>
`delete array' and `nextfile' are now in POSIX.
Thanks to Nathan Weeks <weeks@iastate.edu> for the
initiative and letting us know about it.
* awkgram.y: Make the right code changes for `delete array'
and `nextfile'.
(tokentab): Set flags to zero for nextfile.
2012-09-19 Arnold D. Robbins <arnold@skeeve.com>
* symbol.c (load_symbols): Zero out the new node. Prevents assertion
failure on PPC Mac OS X.
2012-09-14 Arnold D. Robbins <arnold@skeeve.com>
Allow read-only access to built-in variables from extensions.
* awk.h (NO_EXT_SET): New flag.
* gawkapi.c (api_sym_lookup, api_sym_update_real): Set flag if off
limits variable instead of failing. Adjust logic.
(api_sym_update_scalar, api_set_array_element, api_del_array_element,
api_release_flattened_array): Adjust logic.
* gawkapi.h: Adjust documentation.
Provide PROCINFO["identifiers"]. Undocumented for now.
* awk.h (load_symbols): Add declaration.
* awkgram.y (variable): Adjust comment formatting.
* main.c (main): Call load_symbols().
* symbol.c (load_symbols): New function.
2012-09-13 Arnold D. Robbins <arnold@skeeve.com>
* configure.ac: Determination of DYNAMIC adjusted. Hopefully is
smarter for z/OS.
2012-09-13 Dave Pitts <dpitts@cozx.com>
* awk.h: Add defines for z/OS for newer types.
2012-08-31 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.c: Wrap various bits in #ifdef DYNAMIC so that
gawk will compile on systems without dynamic loading.
2012-08-24 Arnold D. Robbins <arnold@skeeve.com>
Add version facility to API. Thanks to Manuel Collado
for the idea.
* awk.h (print_ext_versions): Declare.
Rearrange includes and decls to make more sense.
* gawkapi.h (register_ext_version): New API.
(dl_load_func): Add code for ext_version.
* gawkapi.c (api_register_ext_version, print_ext_versions):
New functions.
* main.c (do_version): New variable.
(optab): Set it for -v / --version.
(main): Set it in arg parsing switch. Call version() after the
extensions have been loaded.
2012-08-22 Arnold D. Robbins <arnold@skeeve.com>
Add output wrapper and two-way processor to extension API.
* awk.h (struct redirect): Replace output FILE * with awk_output_buf_t.
(register_output_wrapper, register_two_way_processor): Declare.
* builtin.c (efwrite): Adjust logic to use rp->output data and
functions if rp is not NULL. Remove redundant declaration of function.
(do_fflush, do_printf, do_print, do_print_rec): Same adjustment.
* ext.c (make_builtin): Adjust error messages.
* gawkapi.c (api_register_output_wrapper,
api_register_two_way_processor): New functions.
(sym_update_real): Adjust code formatting.
* gawkapi.h (awk_input_parser_t): Make next pointer awk_const.
(awk_output_buf_t, awk_two_way_processor_t): New structs.
(api_register_output_wrapper, api_register_two_way_processor): New APIs.
(dl_load_func): Allow for empty function table (NULL elements).
* io.c (find_output_wrapper, init_output_wrapper, find_two_processor,
gawk_fwrite, gawk_ferror, gawk_fflush, gawk_fclose): New functions.
(redirect): Call init_output_wrapper, find_output_wrapper as needed.
Adjust use of rp->fp to rp->output.fp and also function calls.
(close_rp, close_redir, flush_io): Same adjustment.
(two_way_open): Same adjustment. Call find_two_way_processor, and
find_output_wrapper, as needed.
2012-08-17 Arnold D. Robbins <arnold@skeeve.com>
* Update infrastructure: Automake 1.12.3 and bison 2.6.2.
2012-08-15 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c: Sync w/GNU grep.
2012-08-12 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.h: Make the versions enum constants instead of defines.
2012-08-11 Andrew J. Schorr <aschorr@telemetry-investments.com>
* awkgram.y (add_srcfile): It is now a fatal error to load the
same file with -f and -i (or @include).
* TODO.xgawk: Update to reflect this change.
2012-08-10 Arnold D. Robbins <arnold@skeeve.com>
* FUTURES, TODO.xgawk: Updates.
2012-08-08 Arnold D. Robbins <arnold@skeeve.com>
* configure.ac: Add -DNDEBUG to remove asserts if not developing.
* gawkapi.h: Document how to build up arrays.
* gawkapi.c (api_sym_update): For an array, pass the new cookie
back out to the extension.
* awk.h (IOBUF): Move struct stat into IOBUF_PUBLIC.
(os_isreadable): Change to take an IOBUF_PUBLIC.
* gawkapi.h (IOBUF_PUBLIC): Received struct stat.
(INVALID_HANDLE): Moves to here.
* io.c (iop_alloc): Stat the fd and fill in stat buf.
(iop_finish): Use passed in stat info.
2012-08-05 Arnold D. Robbins <arnold@skeeve.com>
* README.git: More stuff added.
2012-08-01 Arnold D. Robbins <arnold@skeeve.com>
* io.c (iop_finish): New function.
(iop_alloc): Add errno_val parameter. Move code into iop_finish.
Add large explanatory leading comment.
(after_beginfile): Rework logic. Check for input parser first, then
check for invalid iop.
(nextfile): Organize code better. Call iop_alloc then iop_finish.
(redirect): Call iop_alloc, find_input_parser, iop_finish.
(two_way_open): Call iop_alloc, find_input_parser, iop_finish.
(gawk_popen): Call iop_alloc, find_input_parser, iop_finish.
(find_input_parser): Set iop->valid if input parser takes control.
(get_a_record): Rework setting RT to use macros.
2012-07-29 Andrew J. Schorr <aschorr@telemetry-investments.com>
* awk.h (set_RT_to_null, set_RT): Removed.
* gawkapi.h (api_set_RT): Removed.
(get_record): Signature changed in input parser struct.
* gawkapi.c (api_set_RT): Removed.
* io.c (set_RT_to_null, set_RT): Removed.
(get_a_record): Adjustments for new API for input parser.
2012-07-29 Arnold D. Robbins <arnold@skeeve.com>
* awk.h (os_isreadable): Adjust declaration.
(struct iobuf): Add new member `valid'.
* io.c (iop_alloc): Remove do_input_parsers parameter, it's
always true. Adjust logic to set things to invalid if could not
find an input parser.
(after_beginfile): Use valid member to check if iobuf is valid.
Don't clear iop->errcode.
(nextfile): Adjust logic to clear errcode if valid is true and
also to update ERRNO.
(redirect): Check iop->valid and cleanup as necessary, including
setting ERRNO.
(two_way_open): Ditto.
(gawk_popen): Ditto.
(devopen): Remove check for directory.
2012-07-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
* io.c (find_input_parser): Issue a warning if take_control_of fails.
2012-07-27 Arnold D. Robbins <arnold@skeeve.com>
* awk.h (set_RT): Change to take a NODE * parameter.
* io.c (set_RT): Change to take a NODE * parameter.
* gawkapi.h: Change open hook to input parser in comment.
* gawkapi.c (api_set_RT): Adjust call to set_RT.
2012-07-26 Arnold D. Robbins <arnold@skeeve.com>
* awk.h (set_RT_to_null, set_RT): Declare functions.
(os_isreadable): Declare function.
* io.c (set_RT_to_null, set_RT): New functions.
(iop_close): Init ret to zero.
* gawkapi.c (api_register_input_parser): Check for null pointer.
(api_set_RT): New function.
* gawkapi.h (api_set_RT): New function.
2012-07-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
* gawkapi.h (IOBUF_PUBLIC): Document the get_record and close_func
API.
(awk_input_parser_t) Change can_take_file argument to const, and
document the API.
* io.c (get_a_record): Document that the caller initializes *errcode
to 0, and remote the test for non-NULL errcode.
2012-07-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
* gawkapi.c (api_sym_update_scalar): Fix some minor bugs. Was
not updating AWK_NUMBER when valref != 1. And strings were not
freeing MPFR values.
2012-07-25 Arnold D. Robbins <arnold@skeeve.com>
Start refactoring of IOBUF handling and turn "open hooks"
into "input parsers".
* awk.h (IOP_NOFREE_OBJ): Flag removed.
(register_input_parser): Renamed from register_open_hook.
* ext.c (load_ext): Make sure lib_name is not NULL.
* gawk_api.c (api_register_input_parser): Renamed from
api_register_open_hook.
* gawk_api.h (api_register_input_parser): Renamed from
api_register_open_hook. Rework structure to have "do you want it"
and "take control of it" functions.
* io.c (iop_alloc): Remove third argument which is IOBUF pointer.
Always malloc it. Remove use of IOP_NOFREE_OBJ everywhere.
(find_input_parser): Renamed from find_open_hook.
(nextfile): Don't use static IOBUF.
(iop_close): Call close_func first. Then close fd or remap it
if it's still not INVALID_HANDLE.
(register_input_parser): Renamed from register_open_hook.
Use a FIFO list and check if more than one parser will accept the
file. If so, fatal error.
2012-07-25 Andrew J. Schorr <aschorr@telemetry-investments.com>
* configure.ac: Instead of using acl_shlibext for the shared library
extension, define our own variable GAWKLIBEXT with a hack to work
correctly on Mac OS X.
* Makefile.am (SHLIBEXT): Use the value of GAWKLIBEXT instead of
acl_shlibext.
2012-07-24 Arnold D. Robbins <arnold@skeeve.com>
* configure.ac: Add crude but small hack to make plug-ins work
on Mac OS X.
2012-07-20 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.h: Rework table to not take up so much space.
* gawkapi.c (api_sym_update_scalar): Rework optimization code
to clean up the function.
2012-07-17 Andrew J. Schorr <aschorr@telemetry-investments.com>
* gawkapi.h: Add comments explaining new api_create_value and
api_release_value functions.
* gawkapi.c (sym_update_real): Allow updates with AWK_SCALAR and
AWK_VALUE_COOKIE types. After creating a regular variable,
remove the call to unref(node->var_value), since this is not
done elsewhere in the code (see, for example, main.c:init_vars).
If the update is for an existing variable, allow any val_type
except AWK_ARRAY (was previously disallowing AWK_SCALAR and
AWK_VALUE_COOKIE for no apparent reason).
(api_sym_update_scalar): The switch should return false for an
invalid val_type value, so change the AWK_ARRAY case to default.
(valid_subscript_type): Any scalar value is good, so accept any valid
type except AWK_ARRAY.
(api_create_value): Accept only AWK_NUMBER and AWK_STRING values.
Anything else should fail.
2012-07-17 Arnold D. Robbins <arnold@skeeve.com>
Speedup:
* awk.h (r_free_wstr): Renamed from free_wstr.
(free_wstr): Macro to test the WSTRCUR flag first.
* node.c (r_free_wstr): Renamed from free_wstr.
Support value cookies:
* gawkapi.h (awk_val_type_t): Add AWK_VALUE_COOKIE.
(awk_value_cookie_t): New type.
(awk_value_t): Support AWK_VALUE_COOKIE.
(api_create_value, api_release_value): New function pointers.
* gawkapi.c (awk_value_to_node, api_sym_update_scalar,
valid_subscript_type): Handle AWK_VALUE_COOKIE.
(api_create_value, api_release_value): New functions.
2012-07-16 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.c (awk_value_to_node): Support AWK_SCALAR.
(api_sym_update_scalar): Performance improvements.
2012-07-12 Arnold D. Robbins <arnold@skeeve.com>
Allow creation of constants. Thanks to John Haque for the
implementation concept.
* gawk_api.h (api_sym_constant): Create a constant.
* gawk_api.h (api_sym_update_real): Renamed from api_sym_update.
Add is_const paramater and do the right thing if true.
(api_sym_update, api_sym_constant): Call api_sym_update_real
in the correct way.
(set_constant): New function.
2012-07-11 Andrew J. Schorr <aschorr@telemetry-investments.com>
* gawkapi.h: Fix typo in comment.
(awk_value_t): Type for scalar_cookie should be awk_scalar_t,
not awk_array_t.
(gawk_api): Add new api_sym_lookup_scalar function.
(sym_lookup_scalar): New wrapper macro for api_sym_lookup_scalar hook.
* gawkapi.c (api_sym_lookup_scalar): New function for faster scalar
lookup.
(api_impl): Add entry for api_sym_lookup_scalar.
2012-07-11 Andrew J. Schorr <aschorr@telemetry-investments.com>
* gawkapi.c (awk_value_to_node): Change to a switch statement
so AWK_SCALAR or other invalid type is handled properly.
(valid_subscript_type): Test whether a value type is acceptable
for use as an array subscript (any scalar value will do).
(api_get_array_element, api_set_array_element, api_del_array_element):
Use new valid_subscript_type instead of restricting to string values.
2012-07-11 Arnold D. Robbins <arnold@skeeve.com>
Lots of API work.
* gawkapi.h: Function pointer members renamed api_XXXX and
macros adjusted. More documentation.
(awk_valtype_t): New AWK_SCALAR enum for scalar cookies.
(awk_scalar_t): New type.
(awk_value_t): New member scalar_cookie.
(api_sym_update_scalar): New API function.
(erealloc): New macro.
(make_const_string): New macro, renamed from dup_string.
(make_malloced_string): New macro, renamed from make_string.
(make_null_string): New inline function.
(dl_load_func): Add call to init routine through pointer if
not NULL.
* gawkapi.c (awk_value_to_node): Assume that string values came
from malloc.
(node_to_awk_value): Handle AWK_SCALAR.
(api_sym_update): Ditto.
(api_sym_update_scalar): New routine.
(api_get_array_element): Return false if the element doesn't exist.
Always unref the subscript.
(remove_element): New helper routine.
(api_del_array_element): Use it.
(api_release_flattened_array): Ditto.
(api_impl): Add the new routine.
2012-07-11 Andrew J. Schorr <aschorr@telemetry-investments.com>
* gawkapi.c (api_sym_update): Allow val_type to be AWK_UNDEFINED
for setting a variable to "", i.e. dupnode(Nnull_string).
2012-07-10 Andrew J. Schorr <aschorr@telemetry-investments.com>
* awkgram.y (add_srcfile): Lint warning message for a previously loaded
shared library should say "already loaded shared library" instead
of "already included source file".
2012-07-08 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.h (set_array_element): Use index + value instead
of element structure. Matches get_array_element.
(set_array_element_by_elem): New macro to use an element.
* gawkapi.c (api_set_array_element): Make the necessary adjustments.
2012-07-04 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y (tokentab): Remove limit on number of arguments
for "and", "or", and "xor".
* builtin.c (do_and, do_or, do_xor): Modify code to perform the
respective operation on any number of arguments. There must be
at least two.
2012-06-29 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.h: Improve the documentation of the return values
per Andrew Schorr.
2012-06-25 Arnold D. Robbins <arnold@skeeve.com>
* TODO.xgawk: Updated.
* awk.h (track_ext_func): Declared.
* awkgram.y (enum defref): Add option for extension function.
(struct fdesc): Add member for extension function.
(func_use): Handle extension function, mark as extension and defined.
(track_ext_func): New function.
(check_funcs): Update logic for extension functions.
* ext.c (make_builtin): Call track_ext_func.
2012-06-24 Andrew J. Schorr <aschorr@telemetry-investments.com>
* TODO.xgawk: Most of IOBUF has been hidden.
* gawkapi.h (IOBUF): Remove declaration (now back in awk.h).
(IOBUF_PUBLIC): Declare new structure defining subset of IOBUF fields
that should be exposed to extensions.
(gawk_api): Update register_open_hook argument from IOBUF to
IOBUF_PUBLIC.
* awk.h (IOBUF): Restore declaration with 5 fields moved to new
IOBUF_PUBLIC structure.
(register_open_hook): Update open_func argument from IOBUF to
IOBUF_PUBLIC.
* gawkapi.c (api_register_open_hook): Ditto.
* io.c (after_beginfile, nextfile, iop_close, gawk_pclose): Some fields
such as fd and name are now inside the IOBUF public structure.
(struct open_hook): Update open_func argument from IOBUF to
(register_open_hook): Ditto.
(find_open_hook): opaque now inside IOBUF_PUBLIC.
(iop_alloc): fd and name now in IOBUF_PUBLIC.
(get_a_record): If the get_record hook returns EOF, set the IOP_AT_EOF
flag. Access fd inside IOBUF_PUBLIC.
(get_read_timeout): File name now inside IOBUF_PUBLIC.
* interpret.h (r_interpret): File name now inside IOBUF_PUBLIC.
* ext.c (load_ext): No need to call return at the end of a void
function.
2012-06-24 Arnold D. Robbins <arnold@skeeve.com>
* ext.c (load_ext): Don't retun a value from a void function.
* gawkapi.c (api_set_array_element): Set up vname and parent_array.
2012-06-21 Arnold D. Robbins <arnold@skeeve.com>
More API and cleanup:
* awk.h (stopme): Make signature match other built-ins.
* awkgram.y (stopme): Make signature match other built-ins.
(regexp): Minor edit.
* gawkapi.c (api_set_argument): Remove unused variable.
Set parent_array field of array value.
* TODO.xgawk: Update some.
Remove extension() builtin.
* awk.h (do_ext): Removed.
(load_ext): Signature changed.
* awkgram.y (tokentab): Remove do_ext.
Change calls to do_ext.
* ext.c (load_ext): Make init function a constant.
* main.c (main): Change calls to do_ext.
2012-06-20 Arnold D. Robbins <arnold@skeeve.com>
Restore lost debugging function:
* awkgram.y (stopme): Restore long lost debugging function.
* awk.h (stopme): Add declaration.
API work:
* ext.c (get_argument): Make extern.
* awk.h (get_argument): Declare it.
* gawkapi.c (api_set_argument): Call it. Finish off the logic.
(api_get_argument): Refine logic to use get_argument.
* gawkapi.h (set_argument): New API.
2012-06-19 Arnold D. Robbins <arnold@skeeve.com>
Remove code duplication in gawkapi.c from msg.c:
* awk.h (err): Add `isfatal' first parameter.
* awkgram.y (err): Adjust all calls.
* msg.c (err): Adjust all calls. Move fatal code to here ...
(r_fatal): From here.
* gawkapi.c: Remove code duplication and adjust calls to `err'.
Handle deleting elements of flattened array:
* awk.h (get_argument): Remove declaration.
* ext.c (get_argument): Make static.
* gawkapi.h (awk_flat_array_t): Make opaque fields const. Add
more descriptive comments.
* gawkapi.c (release_flattened_array): Delete elements flagged
for deletion. Free the flattened array also.
Add additional debugging when developing:
* configure.ac: Add additional debugging flags.
* configure: Regenerated.
2012-06-18 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.h (get_array_element): Restore `wanted' paramater.
(awk_element_t): Use awk_value_t for index. Add awk_flat_array_t.
(flatten_array): Change signature to use awk_flat_array_t;
(release_flattened_array): Change signature to use awk_flat_array_t;
* gawkapi.c (api_sym_update): Handle case where variable exists already.
(api_get_array_element): Restore `wanted' paramater and pass it
on to node_to_awk_value.
(api_set_array_element): Revisse to match changed element type.
(api_flatten_array): Revise signature, implement.
(api_release_flattened_array): Revise signature, implement.
2012-06-17 Arnold D. Robbins <arnold@skeeve.com>
API Work:
* gawkapi.h (get_array_element): Remove `wanted' parameter.
(r_make_string): Comment the need for `api' and `ext_id' parameters.
* gawkapi.c (api_sym_update): Move checks to front.
Initial code for handling arrays. Still needs work.
(api_get_array_element): Implemented.
(api_set_array_element): Additional checking code.
(api_del_array_element): Implemented.
(api_create_array): Implemented.
(init_ext_api): Force do_xxx values to be 1 or 0.
(update_ext_api): Ditto.
2012-06-12 Arnold D. Robbins <arnold@skeeve.com>
API Work:
* gawkapi.h (awk_value_t): Restore union.
(get_curfunc_param): Renamed to get_argument. Return type changed
to awk_bool_t. Semantics better thought out and documented.
(awk_atexit, get_array_element): Return type now void.
(sym_lookup): Return type now void. Argument order rationalized.
* gawkapi.c (node_to_awk_value): Return type is now awk_bool_t.
Semantics now match table in gawkawpi.h.
(api_awk_atexit): Return type now void.
(api_sym_lookup): Return type is now awk_bool_t. Change parameter
order.
(api_get_array_element): Return type is now awk_bool_t.
Further API implementations and fixes for extension/testext.c:
* awk.h (final_exit): Add declaration.
* ext.c (load_ext): Change `func' to install_func.
* gawkapi.c: Add casts to void for id param in all functions.
(api_sym_update): Finish implementation.
(api_get_array_element): Start implementation.
(api_set_array_element): Add error checking.
(api_get_element_count): Add error checking, return the right value.
* main.c (main): Call final_exit instead of exit.
(arg_assign): Ditto.
* msg.c (final_exit): New routine to run the exit handlers and exit.
(gawk_exit): Call it.
* profile.c (dump_and_exit): Ditto.
2012-06-10 Andrew J. Schorr <aschorr@telemetry-investments.com>
* TODO.xgawk: Addition of time extension moved to "done" section.
2012-06-10 Andrew J. Schorr <aschorr@telemetry-investments.com>
* gawkapi.c (api_update_ERRNO_string): Treat boolean true as a request
for TRANSLATE, and false as DONT_TRANSLATE.
2012-06-06 Arnold D. Robbins <arnold@skeeve.com>
* cint_array.c (tree_print, leaf_print): Add additional casts
for printf warnings.
* awk.h (update_ext_api): Add declaration.
* gawkapi.c (update_ext_api): New function.
* eval.c (set_LINT): Call update_ext_api() at the end.
* gawkapi.h: Document that do_XXX could change on the fly.
* awk.h (run_ext_exit_handlers): Add declaration.
* msg.c (gawk_exit): Call it.
2012-06-05 Arnold D. Robbins <arnold@skeeve.com>
* ext.c (load_ext): Remove use of RTLD_GLOBAL. Not needed in new
scheme. Clean up error messages.
2012-06-04 Arnold D. Robbins <arnold@skeeve.com>
* configure.ac: Remove use of -export-dynamic for GCC.
* configure: Regenerated.
2012-05-30 Arnold D. Robbins <arnold@skeeve.com>
* main.c (is_off_limits_var): Minor coding style edit.
* gawkapi.c (awk_value_to_node): More cleanup.
(node_to_awk_value): Use `wanted' for decision making.
(api_sym_update): Start implementation. Needs more work.
General: More cleanup, comments.
* gawkapi.h (api_sym_update): Add additional comments.
2012-05-29 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.c (node_to_awk_value): Add third parameter indicating type
of value desired. Based on that, do force_string or force_number
to get the "other" type.
(awk_value_to_node): Clean up the code a bit.
(get_curfunc_param): Move forcing of values into node_to_awk_value.
(api_sym_lookup): Add third parameter indicating type of value wanted.
(api_get_array_element): Ditto.
* gawk_api.h: Additional comments and clarifications. Revise APIs
to take third 'wanted' argument as above.
(awk_value_t): No longer a union so that both values may be accessed.
All macros: Parenthesized the bodies.
* bootstrap.sh: Rationalize a bit.
2012-05-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
* Makefile.am (include_HEADERS): Add so gawkapi.h will be installed.
(base_sources): Add gawkapi.h so that it is in dist tarball.
* TODO.xgawk: Update.
* main.c (is_off_limits_var): Stop returning true for everything
except PROCINFO.
2012-05-25 Arnold D. Robbins <arnold@skeeve.com>
* main.c (is_off_limits_var): New function to check if a variable
is one that an extension function may not change.
* awk.h (is_off_limits_var): Declare it.
* gawkapi.c (api_sym_lookup): Use it.
* bootstrap.sh: Touch various files in the extension directory also.
2012-05-24 Andrew J. Schorr <aschorr@telemetry-investments.com>
* gawkapi.h (awk_param_type_t): Remove (use awk_valtype_t instead).
(awk_ext_func_t): Pass a result argument, and return an awk_value_t *.
(gawk_api.get_curfunc_param): Add a result argument.
(gawk_api.set_return_value): Remove obsolete function.
(gawk_api.sym_lookup, gawk_api.get_array_element): Add a result
argument.
(gawk_api.api_make_string, gawk_api.api_make_number): Remove hooks,
since access to gawk internal state is not required to do this.
(set_return_value): Remove obsolete macro.
(get_curfunc_param, sym_lookup, get_array_element): Add result argument.
(r_make_string, make_number): New static inline functions.
(make_string, dup_string): Revise macro definitions.
(dl_load_func): Remove global_api_p and global_ext_id args,
and fix SEGV by setting api prior to checking its version members.
(GAWK): Expand ifdef to include more stuff.
* gawkapi.c (node_to_awk_value): Add result argument.
(api_get_curfunc_param): Add result argument, and use awk_valtype_t.
(api_set_return_value): Remove obsolete function.
(awk_value_to_node): New global function to convert back into internal
format.
(api_add_ext_func): Simply call make_builtin.
(node_to_awk_value): Add result argument, and handle Node_val case.
(api_sym_lookup, api_get_array_element): Add result argument.
(api_set_array_element): Implement.
(api_make_string, api_make_number): Remove functions that belong on
client side.
(api_impl): Remove 3 obsolete entries.
* TODO.xgawk: Update to reflect progress.
* Makefile.am (base_sources): Add gawkapi.c.
* awk.h: Include gawkapi.h earlier.
(api_impl, init_ext_api, awk_value_to_node): Add declarations
so we can hook in new API.
(INSTRUCTION): Add new union type efptr for external functions.
(extfunc): New define for d.efptr.
(load_ext): Remove 3rd obj argument that was never used for anything.
(make_builtin): Change signature for new API.
* awkgram.y (load_library): Change 2nd argument to load_ext
from dlload to dl_load, and remove pointless 3rd argument.
* main.c (main): Call init_ext_api() before loading shared libraries.
Change 2nd argument to load_ext from dlload to dl_load, and remove
pointless 3rd argument.
* ext.c (do_ext): Remove pointless 3rd argument to load_ext.
(load_ext): Remove 3rd argument. Port to new API (change initialization
function signature). If initialization function fails, issue a warning
and return -1, else return 0.
(make_builtin): Port to new API.
* interpret.h (r_interpret): For Op_ext_builtin, call external functions
with an awk_value_t result buffer, and convert the returned value
to a NODE *. For Node_ext_func, code now in extfunc instead of builtin.
2012-05-21 Andrew J. Schorr <aschorr@telemetry-investments.com>
* configure.ac: Remove libtool, and call configure in the
extension subdirectory. Change pkgextensiondir to remove the
version number, since the new API has builtin version checks.
* TODO.xgawk: Update.
* ltmain.sh: Removed, since libtool no longer used here.
2012-05-19 Andrew J. Schorr <aschorr@telemetry-investments.com>
* TODO.xgawk: Update to reflect progress and new issues.
* main.c (main): Add -i (--include) option.
(usage): Ditto.
* awkgram.y (add_srcfile): Eliminate duplicates only for SRC_INC
and SRC_EXTLIB sources (i.e. -f duplicates should not be removed).
* io.c (find_source): Set DEFAULT_FILETYPE to ".awk" if not defined
elsewhere.
2012-05-15 Arnold D. Robbins <arnold@skeeve.com>
* awk.h: Include "gawkapi.h" to get IOBUF.
* gawkapi.h: Considerable updates.
* gawkapi.c: New file. Start at implementing the APIs.
2012-05-13 Andrew J. Schorr <aschorr@telemetry-investments.com>
* TODO.xgawk: Update to reflect recent discussions and deletion of
extension/xreadlink.[ch].
2012-05-11 Arnold D. Robbins <arnold@skeeve.com>
Sweeping change: Use `bool', `true', and `false' everywhere.
2012-04-09 Andrew J. Schorr <aschorr@telemetry-investments.com>
* eval.c (unset_ERRNO): Fix memory management bug -- need to use
dupnode with Nnull_string.
2012-04-08 Andrew J. Schorr <aschorr@telemetry-investments.com>
* Makefile.am (valgrind): Define VALGRIND instead of redefining AWK.
This allows test/Makefile.am to set up the command environment as
desired.
(valgrind-noleak): Ditto, plus set --leak-check=no instead of the
default summary setting.
2012-04-07 Andrew J. Schorr <aschorr@telemetry-investments.com>
* TODO.xgawk: Update to reflect progress.
2012-04-01 Andrew J. Schorr <aschorr@telemetry-investments.com>
* TODO.xgawk: Move valgrind-noleak item into "done" section.
* Makefile.am (valgrind-noleak): Add new valgrind rule that omits
the "--leak-check=full" option to help spot more serious problems.
2012-04-01 Andrew J. Schorr <aschorr@telemetry-investments.com>
* TODO.xgawk: Move ERRNO item into "done" section.
* awk.h (update_ERRNO, update_ERRNO_saved): Remove declarations.
(update_ERRNO_int, enum errno_translate, update_ERRNO_string,
unset_ERRNO): Add new declarations.
* eval.c (update_ERRNO_saved): Renamed to update_ERRNO_int.
(update_ERRNO_string, unset_ERRNO): New functions.
* ext.c (do_ext): Use new update_ERRNO_string function.
* io.c (ERRNO_node): Remove redundant extern declaration (in awk.h).
(after_beginfile, nextfile): Replace update_ERRNO() with
update_ERRNO_int(errno).
(inrec): Replace update_ERRNO_saved with update_ERRNO_int.
(do_close): Use new function update_ERRNO_string.
(close_redir, do_getline_redir, do_getline): Replace update_ERRNO_saved
with update_ERRNO_int.
2012-03-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
* TODO.xgawk: Update to reflect debate about how to support Cygwin
and other platforms that cannot link shared libraries with unresolved
references.
* awkgram.y (add_srcfile): Minor bug fix: reverse sense of test
added by Arnold in last patch.
* configure.ac: AC_DISABLE_STATIC must come before AC_PROG_LIBTOOL.
2012-03-26 Arnold D. Robbins <arnold@skeeve.com>
Some cleanups.
* awkgram.y (add_srcfile): Use whole messages, better for
translations.
* io.c (init_awkpath): Small style tweak.
* main.c (path_environ): Straighten out initial comment, fix
compiler warning by making `val' const char *.
2012-03-25 Andrew J. Schorr <aschorr@telemetry-investments.com>
* configure.ac (AC_DISABLE_STATIC): Add this to avoid building useless
static extension libraries.
2012-03-25 Andrew J. Schorr <aschorr@telemetry-investments.com>
* TODO.xgawk: New file listing completed and pending xgawk enhancements.
2012-03-24 Andrew J. Schorr <aschorr@telemetry-investments.com>
* io.c (path_info): Fix white space.
(pi_awkpath, pi_awklibpath): Avoid structure initializers.
(do_find_source): Eliminate pointless parentheses.
(find_source): Leave a space after "&".
* main.c (load_environ): Fix typo in comment.
2012-03-21 Andrew J. Schorr <aschorr@telemetry-investments.com>
* awkgram.y (LEX_LOAD): New token to support @load.
(grammar): Add rules to support @load.
(tokentab): Add "load".
(add_srcfile): Improve error message to distinguish between source files
and shared libraries.
(load_library): New function to load libraries specified with @load.
(yylex): Add support for LEX_LOAD (treated the same way as LEX_INCLUDE).
2012-03-20 Andrew J. Schorr <aschorr@telemetry-investments.com>
* Makefile.am (EXTRA_DIST): Remove extension.
(SUBDIRS): Add extension so libraries will be built.
(DEFS): Define DEFLIBPATH and SHLIBEXT so we can find shared libraries.
* awk.h (deflibpath): New extern declaration.
* configure.ac: Add support for building shared libraries by adding
AC_PROG_LIBTOOL and AC_SUBST for acl_shlibext and pkgextensiondir.
(AC_CONFIG_FILES): Add extension/Makefile.
* io.c (pi_awkpath, pi_awklibpath): New static structures to contain
path information.
(awkpath, max_pathlen): Remove static variables now inside pi_awkpath.
(init_awkpath): Operate on path_info structure to support both
AWKPATH and AWKLIBPATH. No need for max_path to be static, since
this should be called only once for each environment variable.
(do_find_source): Add a path_info arg to specify which path to search.
Check the try_cwd parameter to decide whether to search the current
directory (not desirable for AWKLIBPATH).
(find_source): Choose appropriate path_info structure based on value
of the is_extlib argument. Set EXTLIB_SUFFIX using SHLIBEXT define
instead of hardcoding ".so".
* main.c (path_environ): New function to add AWKPATH or AWKLIBPATH
to the ENVIRON array.
(load_environ): Call path_environ for AWKPATH and AWKLIBPATH.
2012-06-19 Arnold D. Robbins <arnold@skeeve.com>
* main.c (main): Do setlocale to "C" if --characters-as-bytes.
Thanks to "SP" <sp0sp0sp@gmail.com> for the bug report.
2012-05-09 Arnold D. Robbins <arnold@skeeve.com>
* configure.ac: Added AC_HEADER_STDBOOL
* awk.h, dfa.c, regex.c: Reworked to use results
of test and include missing_d/gawkbool.h.
2012-05-07 Arnold D. Robbins <arnold@skeeve.com>
* array.c (prnode): Add casts to void* for %p format.
* debug.c (print_instruction): Ditto.
* builtin.c: Fix %lf format to be %f everywhere.
Unrelated:
* replace.c: Don't include "config.h", awk.h gets it for us.
2012-05-04 Arnold D. Robbins <arnold@skeeve.com>
* getopt.c [DJGPP]: Change to __DJGPP__.
* mbsupport.h [DJGPP]: Change to __DJGPP__.
Unrelated:
* awk.h: Workarounds for _TANDEM_SOURCE.
2012-05-01 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c: Sync with GNU grep. RRI code now there, needed additional
change for gawk.
* configure.ac: Add check for stdbool.h.
* regex.c: Add check for if not have stdbool.h, then define the
bool stuff.
2012-04-27 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c: Sync with GNU grep.
* xalloc.h (xmemdup): Added, from grep, for dfa.c. Sigh.
2012-04-27 Arnold D. Robbins <arnold@skeeve.com>
Update to autoconf 2.69, automake 1.12.
* INSTALL, aclocal.m4, configh.in, depcomp, install-sh, missing,
mkinstalldirs, ylwrap: Updated.
* configure.ac (AC_TYPE_LONG_LONG_INT, AC_TYPE_UNSIGNED_LONG_LONG_INT,
AC_TYPE_INTMAX_T, AC_TYPE_UINTMAX_T): Renamed from gl_* versions.
* configure: Regenerated.
2012-04-24 Arnold D. Robbins <arnold@skeeve.com>
* cmd.h (dPrompt, commands_Prompt, eval_Prompt, dgawk_Prompt): Changed
to dbg_prompt, commands_prompt, eval_prompt, dgawk_prompt.
* debug.c: Ditto.
* command.y: Ditto. Some minor whitespace and comments cleanup.
2012-04-24 Arnold D. Robbins <arnold@skeeve.com>
io.c cleanup and some speedup for RS as regexp parsing.
* awk.h (Regexp): New members has_meta and maybe_long.
(enum redirval): Add redirect_none as value 0.
(remaybelong): Remove function declaration.
* awkgram.y: Use redirect_none instead of 0 for no redirect cases.
* io.c (go_getline_redir): Second arg now of type enum redirval.
Changed intovar into into_variable.
(comments and whitespace): Lots of general cleanup.
(socket_open): readle changed to read_len.
(two_way_open): Add additional calls to os_close_on_exec.
(rsrescan): Simplify code a bit and use RS->maybe_long.
* re.c (make_regexp): Set up new members in Regexp struct.
(remaybelong): Remove function.
(reisstring): Simplified code.
2012-04-16 Eli Zaretskii <eliz@gnu.org>
* io.c (read_with_timeout) [__MINGW32__]: Just call the blocking
'read', as 'select' is only available for sockets.
* mpfr.c (set_ROUNDMODE) [!HAVE_MPFR]: Renamed from set_RNDMODE.
* main.c (load_procinfo): Declare name[] also when HAVE_MPFR is
defined even though HAVE_GETGROUPS etc. are not.
2012-04-12 John Haque <j.eh@mchsi.com>
* array.c, awk.h, awkgram.y, builtin.c, command.y, debug.c,
field.c, mpfr.c, profile.c: Change RND_MODE to ROUND_MODE.
2012-04-11 John Haque <j.eh@mchsi.com>
* main.c (varinit): Change RNDMODE to ROUNDMODE.
2012-04-11 Arnold D. Robbins <arnold@skeeve.com>
* main.c: Change --arbitrary-precision to --bignum.
2012-04-02 John Haque <j.eh@mchsi.com>
Add support for arbitrary-precision arithmetic.
* mpfr.c: New file.
* awk.h (struct exp_node): Add union to handle different number types.
(MPFN, MPZN): New flag values.
(DO_MPFR, do_mpfr): New defines.
(PREC_node, RNDMODE_node): Add declarations.
(PRECISION, RND_MODE, MNR, MFNR, mpzval, do_ieee_fmt): Add declarations.
(make_number, str2number, format_val, cmp_numbers): Ditto.
(force_number): Change definition.
(Func_pre_exec, Func_post_exec): New typedefs.
(POP_NUMBER, TOP_NUMBER): Change definitions.
(get_number_ui, get_number_si, get_number_d, get_number_uj,
iszero, IEEE_FMT, mpg_float, mpg_integer, mpg_float,
mpg_integer): New defines.
* awkgram.y (tokentab): Add alternate function entries for MPFR/GMP.
(snode): Choose the appropriate function.
(negate_num): New function to negate a number.
(grammar): Use it.
(yylex): Adjust number handling code.
* array.c (value_info, asort_actual, sort_user_func): Adjust for
MPFR/GMP numbers.
(do_adump, indent): Minor changes.
(sort_up_index_number, sort_up_value_number, sort_up_value_type): Use
cmp_numbers() for numeric comparisons.
* builtin.c (mpz2mpfr): New function.
(format_tree): Adjust to handle MPFR and GMP numbers.
* eval.c (register_exec_hook): New function to manage interpreter hooks.
(num_exec_hook, pre_execute, post_execute): New and adjusted definitions.
(h_interpret): Renamed from debug_interpret.
(init_interpret): Changed to use the new name.
(flags2str): New entries for MPFN and MPZN.
(cmp_nodes): Reworked to use seperate routine for numeric comparisons.
(set_IGNORECASE, set_BINMODE, set_LINT, update_NR, update_FNR,
update_NF): Adjust code and some cleanup.
* field.c (rebuild_record): Field copying code reworked to handle
MPFR/GMP numbers.
(set_NF): Minor adjustment.
* io.c (INCREMENT_REC): New macro.
(inrec, do_getline): Use the new macro.
(nextfile, set_NR, set_FNR, get_read_timeout, pty_vs_pipe): Adjust code
to handle MPFR/GMP numbers.
* interpret.h (r_interpret): Adjust TOP_NUMBER/POP_NUMBER usage.
(EXEC_HOOK): New macro and definition.
(DEBUGGING): Removed.
* main.c (DEFAULT_PREC, DEFAULT_RNDMODE): New defines.
(opttab): New entry for option arbitrary-precision.
(main): Handle the new option.
(usage): Add to usage message.
(varinit): Add PREC and RNDMODE.
(load_procinfo): Install MPFR and GMP related items.
(version): Append MPFR and GMP versions to message.
* msg.c (err) : Adjust FNR handling with MPFR/GMP.
* node.c (r_format_val): Renamed from format_val.
(r_force_number): Return NODE * instead of AWKNUM.
(make_number, str2number, format_val, cmp_numpers: Defined and initialized.
(r_unref): Free MPFR/MPZ numbers.
(get_numbase): Renamed from isnondecimal and return the base.
(cmp_awknums): New function to compare two AWKNUMs.
* command.y (yylex): Adjust number handling code.
(grammar): Minor adjustments to handle negative numbers.
* debug.c (init_debug): New function.
(do_info, do_set_var, watchpoint_triggered, serialize,
initialize_watch_item, do_watch, print_watch_item): Minor adjustments.
(debug_pre_execute): Adjusted to handle MPFR and GMP numbers.
2012-04-09 Arnold D. Robbins <arnold@skeeve.com>
* INSTALL, config.guess, config.sub, depcomp, install-sh,
missing, mkinstalldirs, ylwrap: Update to latest from automake 1.11.4.
2012-04-08 Arnold D. Robbins <arnold@skeeve.com>
* Update various files to automake 1.11.4.
2012-03-30 Arnold D. Robbins <arnold@skeeve.com>
* configure.ac (GAWK_AC_NORETURN): Do as macro instead of inline.
2012-03-29 Arnold D. Robbins <arnold@skeeve.com>
* dfa.h, dfa.c: Sync with grep. Major cleanups and some changes
there.
* re.c (research): Pass size_t* to dfaexec to match type change.
* configure.ac (AH_VERBATIM[_Noreturn]): Added from Paul Eggert to
ease compiling.
(AC_INIT): Bump version.
* configure, configh.in, version.c: Regenerated.
2012-03-28 Arnold D. Robbins <arnold@skeeve.com>
* 4.0.1: Release tar ball made.
2012-03-28 Arnold D. Robbins <arnold@skeeve.com>
* getopt.c: Add DJGPP to list of platforms where it's ok
to include <stdlib.h>.
* awkgram.y, builtin.c, ext.c, mbsupport.h, re.c: Update
copyright year.
2012-03-21 Corinna Vinschen <vinschen@redhat.com>
* getopt.c: Add Cygwin to list of platforms where it's ok
to include <stdlib.h>.
2012-03-20 Arnold D. Robbins <arnold@skeeve.com>
Get new getopt to work on Linux and C90 compilers:
* getopt.c: Undef ELIDE_CODE for gawk.
(_getopt_internal_r): Init first.needs_free to 0. In test for -W
move executable code to after declarations for C90 compilers.
* getopt1.c: Undef ELIDE_CODE for gawk.
Minor bug fix with printf, thanks to John Haque:
* builtin.c (format_tree): Initialize base to zero at the top
of the while loop.
Getting next tar ball ready:
* configure.ac: Remove duplicate check for wcscoll. Thanks
to Stepan Kasal.
2012-03-16 Arnold D. Robbins <arnold@skeeve.com>
* getopt.c, getopt.h, getopt1.c, getopt_int.h, regcomp.c,
regex.c, regex.h, regex_internal.c, regex_internal.h,
regexec.c: Sync with GLIBC, what the heck.
2012-03-14 Eli Zaretskii <eliz@gnu.org>
* mbsupport.h (btowc): Change for non-DJGPP.
* re.c (dfaerror): Add call to exit for DJGPP.
2012-03-14 Arnold D. Robbins <arnold@skeeve.com>
* regex_internal.c (re_string_skip_chars): Fix calculation of
remain_len with m.b. chars. Thanks to Stanislav Brabec
<sbrabec@suse.cz>.
2012-02-28 Arnold D. Robbins <arnold@skeeve.com>
* main.c (init_groupset): Make `getgroups' failing a non-fatal
error. After all, what's the big deal? Should help on Plan 9.
2012-02-27 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c (parse_bracket_exp): Revert changes 2012-02-15 to stay
in sync with grep.
* dfa.h (dfarerror): Add __attribute__ from grep.
2012-02-15 Arnold D. Robbins <arnold@skeeve.com>
Fix warnings from GCC 4.6.2 -Wall option.
* awkgram.y (newline_eof): New function to replace body of
NEWLINE_EOF macro.
(yylex): Replace body of NEWLINE_EOF macro.
* dfa.c (parse_bracket_exp): Init variables to zero.
* ext.c (dummy, junk): Remove.
* regex_internal.c (re_string_reconstruct): Remove buf array. It was
set but not used.
2012-02-10 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c: Sync with GNU grep.
2012-02-07 Arnold D. Robbins <arnold@skeeve.com>
* main.c (main): Move init of `output_fp' to before parsing of
program so that error messages from msg.c don't dump core.
Thanks to Michael Haardt <michael@moria.de>.
2012-01-13 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c [is_valid_unibtye_character]: Fix from GNU grep to
bug reported by me from Scott Deifik for DJGPP.
2012-01-03 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c: Sync with GNU grep.
2012-01-02 Arnold D. Robbins <arnold@skeeve.com>
* io.c (Read_can_timeout, Read_timeout, Read_default_timeout):
Renamed to use lower case.
Other minor stylistic edits.
2012-01-01 John Haque <j.eh@mchsi.com>
* awk.h (struct iobuf): New entry read_func.
* io.c (Read_can_timeout, Read_timeout, Read_default_timeout):
New variables.
(init_io): New routine to initialize the variables.
(in_PROCINFO): New "clever" routine to parse elements with indices
seperated by a SUPSEP.
(get_read_timeout): New routine to read timeout value for an IOBUF.
(read_with_timeout): New routine to read from a fd with a timeout.
(pty_vs_pipe): Use in_PROCINFO().
(get_a_record): Set the timeout value and the read routine as necessary.
* main.c (main): Call init_io().
2011-12-31 Arnold D. Robbins <arnold@skeeve.com>
* profile_p.c: Remove the file.
* msg.c (err): Remove check for name being dgawk.
2011-12-31 Arnold D. Robbins <arnold@skeeve.com>
* awk.h [STREQ, STREQN]: Remove macros.
* awkgram.y, builtin.c, command.y, debug.c, eval.c,
io.c, msg.c: Change all uses to call strcmp, strncmp.
2011-12-28 Arnold D. Robbins <arnold@skeeve.com>
* int_array.c, str_array.c: Fix some compiler warnings 32/64
bit system differences.
2011-12-26 John Haque <j.eh@mchsi.com>
Merge gawk, pgawk and dgawk into a single executable gawk.
* awk.h (DO_PRETTY_PRINT, DO_PROFILE, DO_DEBUG,
do_pretty_print, do_debug): New defines.
(interpret): New variable, a pointer to an interpreter routine.
(enum exe_mode): Nuked.
* main.c (opttab): New options --pretty-print and --debug;
Remove option --command.
(usage): Update usage messages.
* interpret.h: New file.
* eval.c (r_interpret): Move to the new file.
(debug_interpret): New interpreter routine when debugging.
(init_interpret): New routine to initialize interpreter related
variables.
* eval_d.c, eval_p.c: Delete files.
* debug.c (interpret): Renamed to debug_prog.
(DEFAULT_PROMPT, DEFAULT_HISTFILE, DEFAULT_OPTFILE): Remove prefix 'd'.
* profile.c (init_profiling): Nuked.
* Makefile.am: Adjusted.
Add command line option --load for loading extensions.
* awk.h (srctype): Add new source type SRC_EXTLIB.
* ext.c(load_ext): New routine to load extension.
(do_ext): Adjust to use load_ext().
* main.c (opttab): Add new option --load.
(main): Call load_ext() to load extensions.
(usage): Add usage message for the new option.
* io.c (get_cwd): New routine.
(do_find_source): Use the new routine.
(find_source): Handle new type SRC_EXTLIB.
* awkgram.y (parse_program, next_sourcefile): Skip type SRC_EXTLIB.
(add_srcfile): Adjust call to find_source.
* debug.c (source_find): Same.
Unrelated:
* ext.c (get_argument): Fixed argument parsing.
* array.c (null_array_func): Reworked array routines for an empty array.
* str_array.c, int_array.c: Make GCC happy, use %u instead of %lu
printf formats.
* eval.c (node_Boolean): New array for TRUE and FALSE nodes.
(init_interpret): Create the new nodes.
(eval_condition): Add test for the new nodes.
(setup_frame): Disable tail-recursion optimization when profiling.
* interpret.h (r_interpret): Use the boolean nodes instead of making
new ones when needed.
2011-12-26 Arnold D. Robbins <arnold@skeeve.com>
Finish Rational Range Interpretation (!)
* dfa.c (match_mb_charset): Compare wide characters directly
instead of using wcscoll().
* regexec.c (check_node_accept_byte): Ditto.
Thanks to Paolo Bonzini for pointing these out.
2011-12-06 John Haque <j.eh@mchsi.com>
* debug.c (source_find): Fix misplaced call to efree.
* profile.c (redir2str): Add a missing comma in the redirtab array.
* eval.c (r_interpret): Disallow call to exit if currule is undefined.
This avoids the possiblity of running END blocks more than once when
used in a user-defined sorted-in comparision function.
* array.c (sort_user_func): Adjust appropriately.
2011-12-06 Arnold D. Robbins <arnold@skeeve.com>
* awk.h, mbsupport.h: Changes for MBS support on DJGPP
and z/OS.
* io.c: Disable pty support on z/OS.
2011-11-27 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c: Sync with GNU grep.
* dfa.h: Add _GL_ATTRIBUTE_PURE macro. Bleah.
2011-11-14 John Haque <j.eh@mchsi.com>
* debug.c (set_breakpoint_at): Fix problem with setting
breakpoints in a switch statement. Thanks to Giorgio Palandri
<giorgio.palandri@gmail.com> for the bug report.
2011-11-14 Arnold D. Robbins <arnold@skeeve.com>
* mbsupport.h: Add check for HAVE_BTOWC, per Pat Rankin.
2011-11-12 Eli Zaretskii <eliz@gnu.org>
* mbsupport.h: Additional glop for dfa.c in Windows environment.
2011-11-01 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c: Move glop for ! MBS_SUPPORT to ...
* mbsupport.h: ... here.
* replace.c: Include missing_d/wcmisc.c if ! MBS_SUPPORT.
* regex_internal.h: Move include of mbsupport.h up and add
additional checks to avoid inclusion of wctype.h and wchar.h.
2011-10-27 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (do_strftime): Per Pat Rankin, instead of casting
fclock, use a long variable and check for negative or overflow.
2011-10-25 Arnold D. Robbins <arnold@skeeve.com>
Merge with gawk_performance branch done. Additionally:
* cint_array.c, int_array.c, str_array.c: Fix compiler complaints
about printf formats (signed / unsigned vs. %d / %u).
* eval.c (setup_frame): Add a missing return value.
2011-10-25 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (dist-hook): Use `cd $(srcdir)/pc' so that
`make distcheck' works completely.
* builtin.c (do_strftime): Add cast to long int in check
for fclock < 0 for systems where time_t is unsigned (e.g., VMS).
2011-10-25 Stefano Lattarini <stefano.lattarini@gmail.com>
dist: generated file `version.c' is not removed by "make distclean"
* Makefile.am (distcleancheck_listfiles): Define to ignore the
generated `version.c' file.
2011-10-24 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c (wcscoll): Create for VMS.
* Makefile.am (dist-hook): Run sed scripts to make pc/config.h.
2011-10-24 Eli Zaretskii <eliz@gnu.org>
* builtin.c [HAVE_POPEN_H]: Include "popen.h".
* README.git: Update for pc/ systems.
2011-10-21 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (distcleancheck_listfiles): Added, per advice from
Stefano Lattarini <stefano.lattarini@gmail.com>.
* dfa.c: Additional faking of mbsupport for systems without it;
mainly VMS.
2011-10-21 Stefano Lattarini <stefano.lattarini@gmail.com>
* configure.ac (AM_C_PROTOTYPES): Remove call to this macro.
The comments in configure.ac said that the call to AM_C_PROTOTYPES
was needed for dfa.h, synced from GNU grep; but this statement is
not true anymore in grep since commit v2.5.4-24-g9b5e7d4 "replace
AC_CHECK_* with gnulib modules", dating back to 2009-11-26. Also,
the support for automatic de-ANSI-fication has been deprecated in
automake 1.11.2, and will be removed altogether in automake 1.12.
* vms/vms-conf.h (PROTOTYPES, __PROTOTYPES): Remove these #define,
they are not used anymore.
* pc/config.h (PROTOTYPES): Likewise.
2011-10-18 Dave Pitts <dpitts@cozx.com>
* dfa.c: Move some decls to the top of their functions for
C90 compilers.
2011-10-18 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (do_strftime): Add check for negative / overflowed
time_t value with fatal error. Thanks to Hermann Peifer
<peifer@gmx.eu> for the bug report.
* dfa.c (setbit_wc): Non-MBS version. Add a return false
since VMS compiler doesn't understand that abort doesn't return.
2011-10-10 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (do_sub): Init textlen to zero to avoid "may be
used unitialized" warning. Thanks to Corinna Vinschen for
pointing this out.
* eval.c (unwind_stack): Add parentheses around condition in while
to avoid overzealous warning from GCC.
2011-09-30 Eli Zaretskii <eliz@gnu.org>
* io.c (remap_std_file): Fix non-portable code that caused
redirected "print" to fail if a previous read from standard input
returned EOF. Reported by David Millis <tvtronix@yahoo.com>.
(remap_std_file): Per Eli's suggestion, removed the leading close
of oldfd and will let dup2 do the close for us.
2011-10-11 John Haque <j.eh@mchsi.com>
* symbol.c: Add licence notice.
* array.c (PREC_NUM, PREC_STR): Define as macros.
2011-10-09 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c: Sync with GNU grep.
2011-10-07 John Haque <j.eh@mchsi.com>
Tail recursion optimization.
* awkgram.y (grammar, mk_function): Recognize tail-recursive
calls.
* awk.h (tail_call, num_tail_calls): New defines.
* eval.c (setup_frame): Reuse function call stack for
tail-recursive calls.
(dump_fcall_stack): Reworked.
2011-10-04 Arnold D. Robbins <arnold@skeeve.com>
* awk.h, main.c (gawk_mb_cur_max): Make it a constant 1 when
MBS_SUPPORT isn't available to allow GCC dead code constant
expression computation and dead code elimination to help out.
2011-10-02 Arnold D. Robbins <arnold@skeeve.com>
* io.c (rsnullscan, get_a_record): Fix the cases where terminators
are incomplete when RS == "". Also fix the case where the new value
is shorter than the old one. Based on patch from Rogier
<rogier777@gmail.com> as submitted by Jeroen Schot
<schot@A-Eskwadraat.nl>.
2011-09-24 Arnold D. Robbins <arnold@skeeve.com>
* eval.c, io.c, re.c: Fix some spelling errors. Thanks to
Jeroen Schot <schot@A-Eskwadraat.nl>.
2011-09-21 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c, mbsupport.h: Sync with GNU grep. Large amount of changes
that remove many ifdefs, moving many conditions for multibyte
support into regular C code and relying GCC's dead code optimization
to elimnate code that won't be needed.
* dfa.c: For gawk, add a number of additional defines so that things
will compile if MBS_SUPPORT is 0.
* array.c, awk.h, awkgram.y, builtin.c, eval.c, field.c, main.c,
node.c, re.c: Change `#ifdef MBS_SUPPORT' to `#if MBS_SUPPORT'.
* awk.h, regex_internal.h: Move NO_MBSUPPORT handling to ...
* mbsupport.h: ...here.
2011-09-16 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c: Sync with GNU grep.
2011-09-08 John Haque <j.eh@mchsi.com>
Optimization for compound assignment, increment and
decrement operators; Avoid unref and make_number calls
when there is no extra references to the value NODE.
2011-09-03 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c: Sync with GNU grep.
2011-08-31 John Haque <j.eh@mchsi.com>
Grammar related changes: Simplify grammar for user-defined
functions and general cleanups.
* symbol.c: New file.
* awkgram.y: Move symbol table related routines to the
new file.
(rule, func_name, function_prologue, param_list): Reworked.
(install_function, check_params): Do all error checkings
for the function name and parameters before installing in
the symbol table.
(mk_function): Finalize function definition.
(func_install, append_param, dup_params): Nuked.
* symbol.c (make_params): allocate function parameter nodes
for the symbol table. Use the hash node as Node_param_list;
Saves a NODE for each parameter.
(install_params): Install function parameters into the symbol
table.
(remove_params): Remove parameters out of the symbol table.
* awk.h (parmlist, FUNC): Nuked.
(fparms): New define.
Dynamically loaded function parameters are now handled like
those for a builtin.
* awk.h (Node_ext_func, Op_ext_builtin): New types.
(Op_ext_func): Nuked.
* ext.c (make_builtin): Simplified.
(get_curfunc_arg_count): Nuked; Use the argument 'nargs' of
the extension function instead.
(get_argument, get_actual_argument): Adjust.
* eval.c (r_interpret): Update case Op_func_call for a dynamic
extension function. Handle the new opcode Op_ext_builtin.
* pprint (profile.c): Adjust.
Use a single variable to process gawk options.
* awk.h (do_flags): New variable.
(DO_LINT_INVALID, DO_LINT_ALL, DO_LINT_OLD, DO_TRADITIONAL,
DO_POSIX, DO_INTL, DO_NON_DEC_DATA, DO_INTERVALS,
DO_PROFILING, DO_DUMP_VARS, DO_TIDY_MEM,
DO_SANDBOX): New defines.
(do_traditional, do_posix, do_intervals, do_intl,
do_non_decimal_data, do_profiling, do_dump_vars,
do_tidy_mem, do_sandbox, do_lint,
do_lint_old): Defined as macros.
* main.c: Remove definitions of the do_XX variables. Add
do_flags definition.
* debug.c (execute_code, do_eval, parse_condition): Save
do_flags before executing/parsing and restore afterwards.
Nuke PERM flag. Always increment/decrement the reference
count for a Node_val. Simplifies macros and avoids
occassional memory leaks, specially in the debugger.
* awk.h (UPREF, DEREF, dupnode, unref): Simplified.
(mk_number): Nuked.
* (*.c): Increment the reference count of Nnull_string before
assigning as a value.
Revamped array handling mechanism for more speed and
less memory consumption.
* awk.h (union bucket_item, BUCKET): New definitions. Used as
bucket elements for the hash table implementations of arrays;
40% space saving in 32 bit x86.
(buckets, nodes, array_funcs, array_base, array_capacity,
xarray, alookup, aexists, aclear, aremove, alist,
acopy, adump, NUM_AFUNCS): New defines.
(array_empty): New macro to test for an empty array.
(assoc_lookup, in_array): Defined as macros.
(enum assoc_list_flags): New declaration.
(Node_ahash, NUMIND): Nuked.
* eval.c (r_interpret): Adjust cases Op_subscript,
Op_subscript_lhs, Op_store_var and Op_arrayfor_incr.
* node.c (dupnode, unref): Removed code related to Node_ahash.
* str_array.c: New file to handle array with string indices.
* int_array.c: New file to handle array with integer indices.
* cint_array.c: New file. Special handling of arrays with
(mostly) consecutive integer indices.
Memory pool management reworked to handle NODE and BUCKET.
* awk.h (struct block_item, BLOCK, block_id): New definitions.
(getblock, freeblock): New macros.
(getbucket, freebucket): New macros to allocate and deallocate
a BUCKET.
(getnode, freenode): Adjusted.
* node.c (more_nodes): Nuked.
(more_blocks): New routine to allocate blocks of memory.
2011-08-24 Arnold D. Robbins <arnold@skeeve.com>
Fix pty co-process communication on Ubuntu GNU/Linux.
* io.c: Add include of <sys/ioctl.h> to get definition of TIOCSCTTY.
(two_way_open): Move call for this ioctl to after setsid() call.
2011-08-23 Arnold D. Robbins <arnold@skeeve.com>
* regex_internal.c (re_string_fetch_byte_case ): Remove
__attribute((pure)) since it causes failures with gcc -O2
-fno-inline. Thanks to Neil Cahill <ncahill_alt@yahoo.com>
for reporting the bug.
2011-08-10 John Haque <j.eh@mchsi.com>
BEGINFILE/ENDFILE related code redone.
* awk.h (prev_frame_size, has_endfile, target_get_record,
target_newfile): New defines.
* awkgram.y (mk_program): Initialize has_endfile appropriately for
Op_get_record.
(parse_program): Initialize new jump targets for
Op_get_record and Op_newfile.
* eval.c (unwind_stack): Change argument to number of
items to be left in the stack. Adjust code.
(pop_fcall, pop_stack): New defines.
(setup_frame): Initialize prev_frame_size.
(exec_state, EXEC_STATE): New structure and typedef.
(exec_state_stack): New variable.
(push_exec_state, pop_exec_state): New functions to save and
later retrieve an execution state.
(r_interpret): Use the new functions and the defines in
cases Op_K_getline, Op_after_beginfile, Op_after_endfile,
Op_newfile and Op_K_exit.
* io.c (after_beginfile): When skipping a file using nextfile,
return zero in case there was an error opening the file.
(has_endfile): Nuke global variable.
(inrec): Add a second argument to pass errno to the calling
routine.
* debug.c (print_instruction): Update cases.
2011-08-10 Arnold D. Robbins <arnold@skeeve.com>
Fix (apparently long-standing) problem with FIELDWIDTHS.
Thanks to Johannes Meixner <jsmeix@suse.de>.
* field.c (set_FIELDWIDTHS): Adjust calculations.
Fix problem with FPAT, reported by "T. X. G." <leopardie333@yahoo.com>
* awk.h (Regexp): Add new member 'non_empty'.
* field.c (fpat_parse_field): Save/restore local variable non_empty
from member in Regexp struct.
2011-08-09 Arnold D. Robbins <arnold@skeeve.com>
Fix pty issue reported by "T. X. G." <leopardie333@yahoo.com>
* configure.ac: Check for setsid.
* awk.h: If not HAVE_SETSID define it as an empty macro.
* io.c (two_way_open): Call setsid if using pty's.
2011-07-29 Eli Zaretskii <eliz@gnu.org>
* builtin.c (format_tree): Rename small -> small_flag,
big -> big_flag, bigbig -> bigbig_flag. Solves compilation errors
when building Gawk with libsigsegv on MS-Windows, see
https://lists.gnu.org/archive/html/bug-gawk/2011-07/msg00029.html.
2011-07-28 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (do_sub): Revert to gawk 3.1 behavior for backslash
handling. It was stupid to think I could break compatibility.
Thanks to John Ellson <ellson@research.att.com> for raising
the issue.
2011-07-26 John Haque <j.eh@mchsi.com>
* eval.c (r_interpret): In cases Op_var_assign and Op_field_assign,
include Op_K_getline_redir in the test for skipping the routine.
2011-07-26 John Haque <j.eh@mchsi.com>
Fix handling of assign routines for 'getline var'.
Rework the previous fix for (g)sub.
* awk.h: New define assign_ctxt for use in Op_var_assign
and Op_field_assign opcodes. Remove define AFTER_ASSIGN.
* awkgram.y (snode, mk_getline): Initialize assign_ctxt.
* builtin.c (do_sub): Adjust to take only the first two
arguments.
* eval.c (r_interpret): In cases Op_var_assign and Op_field_assign,
skip the routine as appropriate. Adjust case Op_sub_builtin.
* main.c (get_spec_varname): New function.
* debug.c (print_instruction): Use the new function to get
special variable name.
2011-07-17 Arnold D. Robbins <arnold@skeeve.com>
* main.c (varinit): Mark FPAT as NON_STANDARD. Thanks to
Wolfgang Seeberg <wolfgang.seeberg@yahoo.com> for the report.
* Makefile.am (EXTRA_DIST): Add po/README, per advice from
Bruno Haible.
* dfa.c: Sync with GNU grep.
* xalloc.h (xzalloc): New function, from GNU grep, for dfa.c.
* README: Note that bug list is really a real mailing list.
2011-07-16 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (AUTOMAKE_OPTIONS): Removed.
* configure.ac (AM_INIT_AUTOMAKE): Removed dist-bzip2 option, on
advice from Karl Berry.
2011-07-15 John Haque <j.eh@mchsi.com>
* awk.h (Op_sub_builtin): New opcode.
(GSUB, GENSUB, AFTER_ASSIGN, LITERAL): New flags for
Op_sub_builtin.
* awkgram.y (struct tokentab): Change opcode to Op_sub_builtin
for sub, gsub and gensub.
(snode): Update processing of sub, gsub and gensub.
* builtin.c (do_sub, do_gsub, do_gensub): Nuke.
(sub_common): Renamed to do_sub. Relocate gensub argument
handling code from do_gensub to here; Simplify the code a
little bit.
* eval.c (r_interpret): Handle Op_sub_builtin. Avoid field
re-splitting or $0 rebuilding if (g)sub target string is
a field and no substitutions were done.
* pprint (profile.c): Add case for the new opcode.
* print_instruction (debug.c): Ditto.
Take out translation for errno strings; extensions will
need to use their own domain.
* awk.h (enum errno_translate): Removed.
(update_ERRNO_string): Remove second translate paramater.
* eval.c (update_ERRNO_string): Remove second translate paramater
and code that used it.
* gawkapi.h (api_update_ERRNO_string): Remove third translate
parameter.
* gawkapi.c (api_update_ERRNO_string): Remove third translate
paramater and change call to update_ERRNO_string.
* io.c (do_close): Fix call to update_ERRNO_string.
2011-07-15 Arnold D. Robbins <arnold@skeeve.com>
* awk.h: Typo fix: "loner" --> longer. Thanks to Nelson Beebe.
* builtin.c (efwrite): Fix flushing test back to what it was
in 3.1.8. Thanks to Strefil <strefil@yandex.ru> for the problem
report.
* configure.ac: Bump version to 4.0.0a for stable branch.
2011-06-24 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (EXTRA_DIST): Add ChangeLog.0.
* 4.0.0: Remake the tar ball.
2011-06-23 Arnold D. Robbins <arnold@skeeve.com>
* configure.ac: Update version to 4.0.0.
* configure: Regenerated.
* ChangeLog.0: Rotated ChangeLog into this file.
* ChangeLog: Created anew for gawk 4.0.0 and on.
* README: Bump version to 4.0.0.
* 4.0.0: Release tar ball made.
|