aboutsummaryrefslogtreecommitdiff
path: root/doc/rev2.txt
blob: 1feda120af03c40b5ae7c9918daedf6363a6543d (plain) (blame)
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
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524

------------
From: /usr/tody/ Thu 18:35:41 29-Dec-83
Package: system
Title: software release notices (revisions)
 
Task 'revisions' added to the system package.  Please use to record all
revisions and modifications to a released package.  It is not necessary
to record revisions to a package which is still under development and has
not yet been released.

Usage is very similar to 'bugmail'.  Type 'rev' to read all revision notices
added since your last 'rev'.  Type 'rev package_name' to add a revision notice
for the named package.  Note that '~e' can be typed while entering a revision
notice to edit the text that has been entered, just as '~v' is used in the UNIX
mail utility.

------------
From: /usr/tody/ Thu 18:41:47 29-Dec-83
Package: cl
Title: config change
 
Stack size increased from 1000 to 4000.  Note that scripts are compiled onto
the stack, hence lots of stack space is needed to run large, nested scripts.
If you see a message something like "pc exceeds topcs", that means that the
control stack has overflowed; report it with bugmail system.

------------
From: /usr/tody/ Thu 19:14:32 29-Dec-83
Package: system
Title: tail
 
The task 'tail' has been modified to permit negative 'nlines'.  If nlines is
positive (default), the last nlines lines of the file are printed.  If nlines
is negative, the first nlines lines are skipped, then the remainder of the
file is printed.

------------
From: /usr/tody/ Mon 16:33:01 02-Jan-84
Package: softools
Title: syntax bug in spp fixed
 
The SPP would not recognize BEGIN and END statements unless they were
all alone on a line, i.e., comments were not permitted on the same line.
Edited lexical definition of XPP (xpp.l) and remade XPP.

------------
From: /usr/tody/ Mon 19:06:20 02-Jan-84
Package: system
Title: full sysgen
 
I did a full sysgen of the system today; the system libraries, the CL,
the SPP compiler, and the SYSTEM package were all recompiled.  The value
of SZ_FNAME has been increased from 33 to 63, the value of SZ_PATHNAME
from 81 to 127.  Several minor bugs were discovered in the process
(some of this stuff has not been recompiled for months and months).

------------
From: /usr/tody/ Mon 19:09:48 02-Jan-84
Package: system
Title: system errors
 
The system error handling code has been extensively revised.  The error code
is now stored in the system error message file (lib$syserrmsg) on the same
line as the message.  For example,

	572 Out of memory

whereas before we had

	Out of memory

and where the error code is defined in <syserr.h> as

	define SYS_MFULL 572

This increases the reliability of message fetch significantly, and makes
it easy to leave lots of space for new messages, and to add new messages.

A companion routine to "SYSERR (errcode)" was also added.  The new routine
"SYSERRS (errcode, string)" looks up the error message string in the
system error message file and concatenates the user supplied string, 
producing an error message of the form "errmsg (string)".  The FILERR
routine is similar but I have never felt that it should be used outside
the FIO package, and I have replaced all non file i/o references to FILERR
with calls to SYSERRS.  Additional routines, i.e., SYSERRI, may be added
in the future if needed.

Any changes to the error codes in <syserr.h> require a full sysgen, which
is why I waited until now to make this revision.

------------
From: /usr/valdes/iraf/ Thu 10:17:56 05-Jan-84
Package: xtools
Title: Bug fix in ranges
 
The routine decode_ranges in ranges.x had a bug which did not allow proper
decoding.  This bug has been fixed.  If any further problems are noted
please check with me.  The old version of ranges has been (temporarily)
saved as ranges.old.x.

------------
From: /usr/valdes/iraf/ Fri 11:06:02 06-Jan-84
Package: xtools
Title: Bug fix in ranges
 
decode_ranges
Additional info about bug fix in procedure decode_ranges in file ranges.x.

The old version had incorrect braces.  It turned everything into
a range.  Thus, "1, 4, 7" became "1 - 4, 7 - MAXINT"
It also did not skip arbitrary delimiters after a '-'.  Thus, "1 -, 8"
would be wrong.

Old version:
	    # Get last limit of current range.
	    # Skip delimiters
	    while (IS_WHITE(str[ip]) || str[ip] == ',')
		ip = ip + 1
	    if (str[ip] == '-') {
		ip = ip + 1
		if (ctoi (str, ip, last) == 0)
		    last = MAX_INT
--->	    } else if (IS_DIGIT(str[ip])) {		# ,-n,
		if (ctoi (str, ip, last) == 0)		# can't happen
		    return (ERR)
	    } else
		last = first

The new version recognizes all the following cases:
"1, 3 5" = 1, 3, and 5
"- 6" = 1 through 6
"-" = 1 through MAX_INT
"1 ,, -, 7 , 9 -" = 1 through 7 and 9 through MAX_INT.
"1 - END" = 1 through MAX_INT

The most useful form is "-" to denote all values.

New version:

	    # Get last limit of current range.
	    # Skip delimiters
	    while (IS_WHITE(str[ip]) || str[ip] == ',')
		ip = ip + 1
	    if (str[ip] == '-') {
--->	        while (IS_WHITE(str[ip]) || str[ip] == ',' || str[ip] == '-')
		    ip = ip + 1
		if (str[ip] == EOS)
		    last = MAX_INT
--->		else if (IS_DIGIT(str[ip])) {
		    if (ctoi (str, ip, last) == 0)
--->		        last = MAX_INT
--->		} else
--->		    return (ERR)
	    } else
		last = first

------------
From: /usr/tody/ Fri 17:43:07 06-Jan-84
Package: cl
Title: logout procedure
 
The system logout script no longer attempts to delete the graphics
descriptor files if they do not exist, avoiding the warning message issued
by delete in verify mode.

------------
From: /usr/tody/ Fri 18:37:48 06-Jan-84
Package: system
Title: new software development tools
 
The softools package is now available.  Currently, the package contains only
two programs, MAKE and XCOMPILE.  Make talks directly to the UNIX make,
sending zero, one, or two arguments on to the UNIX make without modification.
This version of make will someday be replaced by a completely IRAF version.

XCOMPILE is more sophisticated, attempting to provide a machine independent
compiler function at the CL level.  Usage is as follows:

	xcompile (files)

The following hidden parameters are provided:

        files = file1,file2     list of files to be compiled or linked
   (xcompiler = xxc)            name of OS compiler program
 (output_file = first)          name of executable output file
    (optimize = yes)            run the object code optimizer
(compile_only = no)             produce only object modules
     (fortran = no)             keep fortran source
   (libraries = none)           list of user libraries to be referenced
     (osflags = none)           OS compiler flags
       (debug = no)             print but do not execute OS command
     (verbose = no)             print OS command for verification
       (fname = )               
      (syscmd = xxc -F -O file1 file2 -ldeboor -lxtools) 
   (file_list = /usr/irafx/tmp/xcr027809) 
        (mode = ql)             

Usage is straightforward and should be obvious to the experienced CL user,
given the above param declarations.  There is one restriction; if a file
template is used, it should reference only files in the current directory.
Files in other directories should be referenced only by an OS pathname.
Libraries are referenced as a simple quoted list, i.e.,

	xc file.x, lib='deboor,xtools'

Special OS compiler flags may be passed via the osflags parameter, as in

	xc "file1,file2", os = '-S'

If no output file is named and linking is to occur, the name of the process
file is taken from the name of the first file referenced by the files template.

------------
From: /usr/tody/ Sat 12:45:03 07-Jan-84
Package: system
Title: 'bad mode spec' bug fixed
 
I finally tracked down the bug that was causing the 'bad mode spec'
warning message on exit from a package.  After a lengthy and abstruse
examination of the CL code, guess what it turned out to be -- the mode
parameter in the parameter file was actually bad!!  The moral of the story
is, try not to overlook the obvious when tracking down a bug.  Mode params
are treated a bit differently than other params by the CL, and I was assuming
that there was a bug having to do with that difference.

------------
From: /usr/tody/ Wed 09:19:51 11-Jan-84
Package: system
Title: stdimage modified
 
The device "iis70" has been renamed "iism70" throughout the system.
In particular, the environment definition stdimage has been changed to iism70.

------------
From: /usr/tody/ Wed 09:38:22 11-Jan-84
Package: system
Title: magtape deallocation at logout time
 
Bug fix; the device was being deallocated within IRAF but not within
UNIX, when automatically deallocated at logout time.  Replaced task
"_mtdeallocate" by "deallocate" in lib$cllogout.cl.

------------
From: /usr/tody/ Wed 22:00:17 11-Jan-84
Package: imio
Title: imdelete added
 
The "imdelete(imagefile)" procedure has been added to the IMIO interface.
Use this to delete imagefiles, rather than "delete(imagefile)", which
currently leaves headerless pixel storage files lying about.

------------
From: /usr/valdes/iraf/ Fri 10:49:39 20-Jan-84
Package: xtools
Title: New ranges
 
The range parsing procedures have been rewritten, improved, and documented.
The main change is that the syntax allows both ranges and steps.  Thus,
to select every third number in the range 1 to 15 the range string is
1-15x3 or -15x3.  The documentation is in the source text and also
in the subdirectory doc.  In addition to the original procedures--
decode_range and get_next_number -- a new procedure -- is_in_range --
returns a boolean value for whether the specified number is in the
range array.

------------
From: /usr/tody/ Wed 18:13:02 25-Jan-84
Package: system
Title: llsq library
 
Lawson's and Hanson's linear least squares routines have been compiled and
installed in the system library as the library "llsq".  Reference the library
on the xcompile command line as "lib=llsq".  See me for documentation.
Minor modifications to the software were necessary to remove i/o, and the
only record of the modifications is in the book describing the routines.

------------
From: /usr/tody/ Thu 13:53:38 26-Jan-84
Package: system
Title: exception handlers
 
The call given for a user exception handler in the crib sheet was in error
and has been fixed.  A handler should return the entry point address of the
next handler to be executed, or the magic value X_IGNORE, as the second
argument rather than as the function value.  The correct call is thus

	procedure user_exception_handler (exception, next_handler)

	begin
		(handle exception)
		next_handler = (old_handler or X_IGNORE)
	end

This is posted with a call of the form shown below.  The value of
"old_handler" must be passed to the user handler to be returned as shown
above when the exception is handled.

	call xwhen (exception, user_exception_handler, old_handler)

In general, handlers should be chained by saving the old_handler address
and passing it back to the system in each handler.  This is the only way
that all handlers can be called when an exception occurs.

    In addition to the error in the crib sheet, there was a bug in ZXWHEN
which prevented chaining; this has been fixed and a new sysgen performed.

------------
From: /usr/tody/ Thu 14:24:08 26-Jan-84
Package: imio
Title: bug in immap fixed
 
The variable "mode" (the file access mode) was being used in place of
"acmode" (the image access mode) in several places, preventing special
image access mode NEW_COPY from being recognized.  Sections of the code
for new copy images were therefore unreachable.  Mode was changed to acmode
in several places, but the code has not yet been tested in NEW_COPY mode.

------------
From: /usr/tody/ Sun 12:58:32 29-Jan-84
Package: fio,system
Title: file deletion
 
It is now an error to attempt to delete a nonexistent file (previously,
such an attempt was silently ignored).

------------
From: /usr/tody/ Mon 11:14:00 30-Jan-84
Package: system
Title: bug in errcode()
 
The old errcode() procedure would return status OK if an error condition
was not actually in effect, making it unusable in error handlers.
Errcode now returns the integer error code of the last error posted.
Whenever an IFERR block is entered, the error code is cleared, i.e.,
set to OK.  The system error codes are defined in <syserr.h>.

------------
From: /usr/tody/ Mon 20:58:46 30-Jan-84
Package: system,clio,softools
Title: bug in "xcompile"
 
Several mods were made to fix a bug in xcompile.  The bug was caused by
"files", called by xcompile to expand the list of files to be compiled or
linked.  Files would always sort the file list; this was improper since
the first file has a special significance (it provides the default root
name of the output executable file).  Revs:

    (1)	FILES and PATHNAMES were modified by the addition of the hidden
	parameter "sort", type boolean, default value "yes".

    (2)	CLIO was modified by the addition of the procedure CLPOPNU (open
	list unsorted) to the usual CLPOPN[IS].

    (3)	XCOMPILE no longer sorts either the files list or the libraries
	list.

------------
From: /usr/tody/ Tue 22:19:50 31-Jan-84
Package: system
Title: error recovery: file cleanup
 
The file cleanup routine, called during error recovery, did not know the
difference between a "string" (sprintf or stropen) file and a normal file.
When error recovery occurred while a string was opened as a file, the
message "No write permission on file (StringFile)" would be given, misleading
one as to the the cause of the error.  Fio$fio_cleanup.x was modified so
that it merely closes a string file, rather than trying to flush the output,
close, and sometimes delete the file.

------------
From: /usr/tody/ Fri 19:42:28 03-Feb-84
Package: fio
Title: byte-oriented i/o
 
The following procedures have been added to the FIO interface:

		areadb (fd, buffer, maxbytes, byte_offset)
	       awriteb (fd, buffer, nbytes, byte_offset)
       nbytes = awaitb (fd)

The old AREAD, AWRITE, and AWAIT are still available, are unchanged, and should
continue to be used for programs which can work in units of chars.  The new
routines are identical except that they are byte-oriented, like the device
z-routines.  Using these routines, byte-oriented asynchronous block i/o can
now be done in a device independent manner (i.e., as opposed to calling the
z-routines directly), with full error checking.

------------
From: /usr/tody/ Sun 12:06:41 05-Feb-84
Package: system, tty
Title: New TTY package installed
 
A completely new version of the TTY package has been installed, supplanting
the old interface.  The new version interfaces directly to the UNIX termcap
file, which will be exported with IRAF.  The termcap file concisely describes
the characteristics of many terminals, and is in wide use.  This interface
change is not upward compatible; all programs which used the old TTY
interface must be modified.

The system is configured for a system defined default terminal when you log
onto the CL (i.e., the VT100 on our systems).  Default values are provided for
the following variables in the CL environment:

	terminal	termcap name of terminal in use (i.e., vt100)
	ttybaud		baud rate for the terminal (9600)
	ttynlines	number of lines on the screen (24)
	ttyncols	number of chars per line (80)
	termcap		filename of termcap file (dev$termcap)
	printer		termcap name of default printer (i.e., imagen)

PAGE, CLEAR, LPRINT, DELETE, etc. all use the new device independent TTY
interface.  All programs which print tabular data on the terminal, i.e., ?,
lparam, etc.  in the CL, use the environment variable ttyncols to format
the table.  The line printer facilities are described in a separate revision
notice.

If you are using a terminal other than the system default, system.stty
should be used to select the terminal.  The command

	stty tek4012

for example, would change the values of the TTY environment variables
as required for the Tektronix 4012 series terminals.  The command
"stty baud=1200" would tell the system that the baud rate is 1200,
for example when working over a modem (the system must know the baud
rate to be able to generate delays).  STTY without any arguments prints
the terminal status.

The TTY interface is described in tty$TTY.hlp, where tty="sys$tty/".

------------
From: /usr/tody/ Sun 12:36:20 05-Feb-84
Package: system
Title: line printer interface
 
The LPRINT task is now installed.  LPRINT provides a device independent
line-printer interface.

usage:
	lprint (files)

params:
        files = *.x             list of files to be printed
      (device = printer)        name of output device
      (map_cc = yes)            make unknown control chars printable
      (header = yes)            enable printing of header on each page
        (mode = ql)             

examples:
	program | lprint	# direct output of program to printer
	lprint "*.x,*.cl"	# make package source listing

If called with a file list, Lprint by default prints each file starting
on a new page and breaks pages, putting a one-line header at the top of
each page (like the UNIX pr).  If used in a pipe, Lprint copies lines
of text to the printer, but does not break pages or print headers.  Escape
sequences are still mapped, however.  Page breaks and headers may be
disabled with the hidden parameter lprint.header.

The following control characters have a special significance in text input
to Lprint (also to TYPE):

	FF=formfeed		advance to new page
	SO=<ctrl/n>		begin standout mode
	SI=<ctrl/o>		end standout mode

The TTY interface is used to translate such directives as required for the
device.  Programs like HELP, MANPAGE, and LROFF insert these three directives
into output text to break pages and embolden text in a device independent
fashion.  TTY is also used to determine whether tabs must be expanded, to
define the number of lines per printer page, the number of chars per line
(long lines are broken), and so on.

The parameter lprint.device determines the printer device to be used.  If
the value is the string "printer", the system defined default printer device
is used (defined in the environment).  Some other printer may be explicitly
named if desired.  For a printer to be accessible, there must be a termcap entry
for the device, and the device must be installed in the ZOPNLP printer device
table.  The devices currently installed are "imagen" and "versatec".  Output
for both devices is currently spooled and printed asynchronously.

Low level interface routines installed in this release include the line
printer z-routines (os$zfiolp.c), and the device FIO open procedure LPOPEN,
source in "sys$system/lpopen.x".

------------
From: /usr/tody/ Sun 13:02:54 05-Feb-84
Package: fio
Title: bug fixes
 
The following bugs|restrictions were found and fixed in the process of
installing and testing the new TTY interface and LPRINT program:

    (1)	If a binary file is opened in APPEND mode, and the file does
	not exist, one will be created and opened for WRITE_ONLY access.
	Previously, the file had to exist be be opened for appending.
	This bug did not pertain to text files, which have a different
	interface.

    (2)	AREADB/AWRITEB: if file is a streaming (sequential only) file,
	the offset parameter passed to the z-routine is now guaranteed
	to be zero.  The old routines were passing the offset argument
	from FIO (which is nonzero) on the z-routine unchanged, and the
	z-routine would perform an illegal seek (ignored on a streaming
	device, but would cause a write error for the printer).

------------
From: /usr/tody/ Thu 19:35:24 09-Feb-84
Package: os
Title: debug routine added to memory allocator
 
A routine ZMEMCK has been added to the OS package to aid in debugging
programs which use dynamic memory.  The operation of ZMEMCK is highly
system dependent.  In the current implementation, the UNIX memory allocator
keeps a list of memory regions (malloc'ed buffers and other areas).
ZMEMCK traverses the list and prints the address and size in bytes (both
in octal) of each region, and tells whether or not the region is "busy"
(in use) or not.  Only regions which have been released with "mfree"
will show up as not busy.  If memory is corrupted, the list will be
trashed near the area of memory where the buffer overflow or underflow
occurred.  SALLOC stack segments show up in the list as regions with
a length of 4004 (octal) bytes.

------------
From: /usr/tody/ Sun 20:33:43 12-Feb-84
Package: system,memio,os
Title: bug fixes: malloc,realloc
 
The MALLOC and REALLOC routines were checking for an ERR return,
while the OS routine ZMALOC and ZRALOC were returning the NULL pointer in
the event of an error.  I added a third argument "status" to each z-routine,
returning OK or ERR, and changed malloc and realloc to properly check
the status parameter.

------------
From: /usr/tody/ Mon 13:17:56 13-Feb-84
Package: fio
Title: asynchronous i/o
 
Awrite/await bug: file size was being incremented by await when called after
a write.  Ok, but the FIO buffer offset was being used by await to determine
the final offset as boffset+nbytes_written.  This meant that FIO could not
keep track of the file size when writing a file using only awrite/await.

I moved the updating of the file size into awrite, deleting it from await.
This is ok since it is an error if fewer bytes are written than requested.
A couple new test programs can be found in debug$afio.x.

------------
From: /usr/tody/ Tue 09:52:36 14-Feb-84
Package: cl
Title: radix intrinsic function
 
RADIX has been changed to format the operand as an unsigned integer for
non decimal output bases.  Thus, "radix(-1,10)" produces "-1" as output,
whereas "radix(-1,8)" produces something like "37777777777".

------------
From: /usr/tody/ Wed 15:48:27 15-Feb-84
Package: fio
Title: stropen bug fix
 
Stropen had a bug when opening a string with read access.  There was a loop
in the routine which searched for the EOS; the loop was infinite because
the input pointer was not being bumped.  Fixed and did a new sysgen.

------------
From: /usr/tody/ Thu 16:28:44 16-Feb-84
Package: softools
Title: lroff utility installed
 
A preliminary version of the lroff utility has been installed
in the Softools package.  This version does not break pages and
print page headers, but it is useful nonetheless.  This is the
new version of Lroff, including support for standout mode, and
numbered section headers.

The Troff font change escapes \fB, \fI, and \fR are recognized in help text.
The .nh or .NH directive is used for numbered sections.  Output must be
passed through type, page, or lprint to make the font changes
"visible".  The control chars SO (control-N) and SI (control-O) may be
inserted in text to be processed by one of the above output programs to turn
standout mode on and off.  Processing of control directives is under
control of the new TTY interface and is quite device independent.

------------
From: /usr/tody/ Fri 00:05:03 17-Feb-84
Package: system
Title: lprint modified
 
Several hidden params were added to lprint.  By default, pages are broken
only if the standard input is not redirected, i.e., if one or named files
are to be printed.  It is now possible to explicitly specify that pages
are to be broken or not broken.  If reading from the standard input,
a file name label string may be given, else the file name will appear as
"STDIN".

------------
From: /usr/tody/ Tue 19:55:57 21-Feb-84
Package: fmtio
Title: gctol, lexnum mods
 
The following modifications were made to the FMTIO routines gctol and
lexnum:

    (1)	GCTOL would only recognize the B and X suffixes (for octal and
	hex numbers) if the suffix chars were in lower case.  The procedure
	now recognizes the suffixes in either case.

    (2)	LEXNUM is a lexical analysis routine which figures out whether a
	string is an IRAF number, and if so, what kind (octal, decimal, real,
	etc).  The calling sequence is "lexnum (numstr, ip, nchars)".
	Formerly, the IP arg was input only.  Lexnum was changed to always
	advance IP over any leading whitespace, so that the routine can
	be used to find the start of a token as well as decide whether or
	not it is a number.

------------
From: /usr/tody/ Tue 20:03:01 21-Feb-84
Package: softools
Title: YACC compiler compiler now available for SPP
 
The Yacc compiler has been modified to produce parsers in the SPP language,
and is now installed in softools (this was done because the prototype image
calculator needs a parser, as will the database tools, etc.)  This is a full
implementation, and an SPP parser can be every bit as sophisticated as a C
parser, with a parser token value stack of arbitrary structures, the usual
error recovery tools, and so on.  In combination with the Lexnum lexical
analysis routine (used to build lexical analysers), it is straightforward
to build compilers for sophisticated applications programs.

The standard Yacc documentation remains valid; a list of differences in the
SPP version are given in "softools$yacc/README".  A complete working example
of an SPP/Yacc algebraic desk calculator is given in "yacc/debug/dc.y".
This example resembles that given in the Yacc reference manual.

------------
From: /usr/davis/ Wed 13:15:40 22-Feb-84
Package: dataio
Title: mtexamine
 
The task mtexamine has been installed in the dataio package. Documentation
can be found in mtexamine.hlp.

------------
From: /usr/davis/ Wed 13:24:33 22-Feb-84
Package: dataio
Title: rfits, pdsread, rcamera
 
A bug was found and fixed in the error handling code of rfits, pdsread
and rcamera. When an error occurred in reading a tape file the
routines returned control to the main program without closing the file
in which the error was encountered. Any attempt to process the next
tape file in the list resulted in a "doubly_opened magtape" error
and an abort.

------------
From: /usr/tody/ Sun 13:12:12 26-Feb-84
Package: system
Title: hidden param added to type, page
 
The hidden parameter "device", default value "terminal", has been added to
the parameter files for the TYPE and PAGE utilities.  This parameter may be
used to specify that output be processed according to a termcap entry other
than that for the terminal.  I also added a termcap entry for the pseudodevice
"text", which is a device with no capabilities at all (i.e., the capabilities
of the final device are unknown).  This is useful for removing standout mode
escapes from Lroff output, producing a pure text file as output.  When
producing output for a device which cannot overstrike, embolden, etc., TTY
renders standout mode as upper case.  Thus, to remove the standout mode
escapes from Lroff output, saving the result in a text file which can be
printed on any device or system:

	lroff file | type device=text, > textfile

------------
From: /usr/tody/ Wed 22:26:43 29-Feb-84
Package: system
Title: name of LOC function changed to ZLOC
 
The names of the LOC and LOCC functions (OS pkg) have been changed to
ZLOC and ZLOCC, to eliminate a library conflict with the NCAR function LOC.
Hopefully all references in the sys and pkg directory systems have been
found and modified.  As far as I know, these functions have only been used
in system code thus far, so I doubt if anyone's code will be affected.

------------
From: /usr/tody/ Fri 22:14:43 02-Mar-84
Package: softools
Title: xcompile modification
 
The XCOMPILE utility has been modified to permit compilation of Fortran
source files without checking for undeclared variables and functions.
The old version would complain about undeclared variables, and stop the
compilation, whether the source file was SPP or F77.  Now the checking
is only done for SPP sources.

------------
From: /usr/tody/ Mon 17:41:11 05-Mar-84
Package: memio
Title: bug discovered and fixed
 
Woops.. I missed a few occurrences of the function LOC in MEMIO (recall the
recent name change to ZLOC).  Did not cause any problems because the old
object module for LOC was still in the system library, and would get
linked in in any case.  Fixed memio routines; will leave old loc in library
until I am sure all occurences of the old function have been changed.

------------
From: /usr/tody/ Mon 18:44:02 05-Mar-84
Package: softools
Title: bug fix in XCOMPILE
 
XCOMPILE had the following bug: if asked to compile a nonexistent file "file.x"
when there was a file "file.f" in the directory, it would proceed to add the
file "file.f" to its list of intermediate Fortran files to be deleted, and
then delete the user's Fortran source!  The program has been modified to check
for the existence of files.  If a file does not exist, a warning is issued,
and the file name is not added to any of the internal lists.

------------
From: /usr/tody/ Wed 18:58:58 07-Mar-84
Package: system
Title: magtape allocation bug fix
 
The allocate task has been smartened up to determine when the drive has
been allocated outside of IRAF.  If the OS error message "mt? already
allocated to..." appears, the IRAF system will no longer think that it
has successfully allocated the drive.  Related mods: rewinding has been
made an option under control of a hidden param to deallocate.  The argument
"rewind_tape" has been added to the argument list of the "mtdeallocate"
procedure in MTIO, and a sysgen performed.

------------
From: /usr/tody/ Wed 21:16:28 07-Mar-84
Package: system
Title: match speeded up
 
The pattern matching utility 'match' was noticeably slow when searching large
files or lists of files.  I have speeded it up some by treating searching for
an alphanumeric string as a special case.  A new pattern matching utility,
STRSEARCH, calling sequence identical to STRMATCH and PATMATCH, has been
added to FMTIO for searching for substrings that do not use metacharacters.
MATCH examines the pattern you give it and automatically determines the
most efficient searching procedure to use.  A new hidden param 'metacharacters',
default =yes, was added to permit disabling pattern matching metacharacters
entirely.

Comparative timings of the three procedures, searching for a simple string
in a list of 5000 full length lines:

	strsearch	 9.4 sec, cpu
	strmatch	43.5 sec
	patmatch	66.1 sec

Real timings, searching for a simple string in a 3711 line Fortran program:

	old 'match'	20.5 sec, cpu
	new 'match'	 7.8 sec
	unix 'grep'	 4.3 sec
	unix 'egrep'	 2.8 sec

Hmm...  Looks like we still have a ways to go, but a significant improvement
nonetheless. 

------------
From: /usr/tody/ Sun 17:28:25 11-Mar-84
Package: system
Title: LPRINT no longer spools versatec output
 
LPRINT has been modified to write directly to the versatec (like the UNIX
VPR), rather than writing a spool file and disposing of it to the printer
when closed.  This is desirable for making listings, in which case it is
inefficient to spool the output.  If spooling of versatec output is desired,
run LPRINT with device=lpr; this is the versatec with spooling.  Note that
in IRAF, pipes are a spooling mechanism (because they are temp files),
so spooling with device lpr is generally not necessary.

------------
From: /usr/tody/ Tue 15:22:34 13-Mar-84
Package: fio
Title: 'access' modified
 
The behavior of 'access' for the null string and for the standard files
has been modified slightly.  The behavior for ordinary files is unchanged.
The new behavior is as follows:

	yes/no = access (fname, mode, type)

If fname is the null string or a string containing only whitespace, access
returns NO (the file is not accessible).  If fname is one of STDIN, STDOUT,
etc., and the mode and type are given as zero, the function returns YES.
If the mode and type arguments are given and a standard stream is named,
the mode and type must agree with those given by FSTATI or the function will
return NO.  Thus, "STDIN" always exists, is accessible with mode READ_ONLY,
is of type BINARY_FILE when a task is run from the CL, and TEXT_FILE when
run in debug mode.

------------
From: /usr/tody/ Wed 19:58:26 14-Mar-84
Package: fio
Title: tempfiles
 
Previously if a tempfile were opened with mode TEMP_FILE and deleted
explicitly before task termination, the system would print a warning
message when it found (during the file cleanup which occurs at task
termination time) that it could not delete the file.  File "fio$fsvtfn.x"
was modified to silently ignore files in the tempfile list which do
not exist at fio cleanup time.

------------
From: /usr/tody/ Wed 20:44:30 14-Mar-84
Package: clio
Title: clcmd now flushes STDOUT
 
The clcmd procedure, used by system utilities to send commands to the
CL, was modified to flush the standard output before sending the command.


------------
From: /usr/davis/ Thu 14:51:22 15-Mar-84
Package: dataio
Title: rcardimage, wcardimage mods
 
Rcardimage and wcardimage can now read and write EBCDIC cardimage tapes
as well as ASCII tapes.

------------
From: /usr/tody/ Thu 22:55:09 15-Mar-84
Package: vops
Title: bug fix in acht_b.c, efficiency enhancement in achtb_.c.
 
Fixed a bug in the ".. to unsigned byte" type conversion vector primitives.
The npix argument, used as a loop counter, is a pointer variable and the
pointer was being used as the loop counter rather than the array length,
causing the output array to be overrun.  While I was at it, I also modified
achtb_ to put the loop counter in a register for greater efficiency.

------------
From: /usr/davis/ Fri 15:32:29 16-Mar-84
Package: dataio
Title: task reblock
 
The task reblock has been added to the dataio package. Reblock can be
used to copy tape or disk files, optionally changing the blocking factor,
padding blocks and/or records or changing the density in the case of a
tape file.  See directory /usr/irafx/pkg/dataio/reblock for documentation.

------------
From: /usr/tody/ Fri 17:46:57 16-Mar-84
Package: imio
Title: imunmap bug fix
 
When unmapping a new image which had never been written into, IMUNMAP
would attempt to close the pixel storage file even though it had never
been written into.  The close is no longer attempted unless the pixel
storage file is open.

------------
From: /usr/davis/ Mon 14:56:31 19-Mar-84
Package: dataio
Title: rfits bugfix
 
A bug in reading FITS files with long headers has been fixed. FITS
header parameters with unknown keywords were being added to the user
area of the IRAF image header. However insufficient space was being
allocated to accomodate the EOS on the character string  and the
buffer would occasionally overflow.

------------
From: /usr/davis/ Mon 15:07:44 19-Mar-84
Package: dataio
Title: rfits mods
 
Rfits now applies bscale and bzero to the integers on tape. If no output
data type is specified rfits selects one based on the bits per pixel on
tape and bscale and bzero. Rfits now initializes the coordinate trans-
formation parameters.

------------
From: /usr/tody/ Tue 19:40:19 20-Mar-84
Package: system
Title: eprintf now flushes the standard output
 
A call to flush STDOUT has been added to EPRINTF, so that warning messages
will be synchronized with interactive output.  Note that writing to STDERR,
however (i.e. with putline), does not flush STDOUT.

------------
From: /usr/tody/ Sat 11:14:54 24-Mar-84
Package: fmtio
Title: lexnum did not recognize indefs
 
The LEXNUM procedure, used to lexically analyse a string to determine
if it is a number, did not recognize the special number "INDEF".
It now returns the token LEX_REAL when given INDEF as input.  This bug
was discovered when trying to read a list containing indefinites using
SCANR or SCAND.  The scan routines (and GCTOD) will now interpret INDEF
as a legal number with the value INDEFR, INDEFD, etc. depending on the
datatype requested.

------------
From: /usr/tody/ Sat 21:08:47 24-Mar-84
Package: fmtio
Title: printf was not autoscaling properly
 
The printf routines, when presented with a number which will not fit within
the given field width, are supposed to automatically decrease the precision
until the number fits, and if that fails, print out the number anyway in a
larger field (as opposed to printing "******" which is silly in a language
with free format i/o).  This was not working when printing reals, i.e.,
"%10g" would result in ********** when printing a very large or very small
number, because a real in E format would not fit in a field width of 10
using the default precision (7 digits).  The bug has been fixed and a format
of %Ng should work without overflowing the field for any N >= 7.

------------
From: /usr/tody/ Sun 22:55:37 25-Mar-84
Package: system
Title: package reorganization
 
The ultimate decomposition of the IMAGES package into subpackages has not
yet been defined.  As a first step, the following changes have been made:

    [1]	The graphics utilities have been moved out of images into a new
	system package called PLOT.

    [2] A new images subpackage called TV has been created to hold all
	programs having to do with the image display.  The package name
	TV is reasonably descriptive and has an unambiguous abbreviation.

The utilities in the TV package have been reworked somewhat to more closely
resemble their expected final form.  Type "help tv" for a brief description
of the contents of the package.

------------
From: /usr/tody/ Sun 23:06:25 25-Mar-84
Package: plot
Title: new package PLOT
 
Testing of the new plotting utilities introduced last week has now been
completed, and the three utilities are fully up.  Note that new parameters
have been added to CONTOUR and SURFACE to give more control over the plot
(floor and ceiling levels can be specified, the number of contours can be
specified, and so on).

GRAPH can now overplot several curves (lists or image sections), compute
projections, draw dashed lines, log scale the axes, annotate plots, and lots
more.  Manual pages for all these utilities will be available soon.

------------
From: /usr/tody/ Mon 00:08:33 26-Mar-84
Package: plot
Title: handy-dandy routines for plotting lines and columns of images
 
Versions of the ever popular Forth/Camera routines PROW, PROWS, PCOL,
and PCOLS have been added to the PLOT package.  These are implemented
as scripts calling GRAPH.  GRAPH itself should be called if you want
to do anything fancy.

------------
From: /usr/tody/ Mon 10:08:34 26-Mar-84
Package: utilities
Title: utilities package online
 
The UTILITIES package has been brought online.  UCASE and LCASE were moved
from the LISTS package into utilities.  We are in the process of adding
TRANSLIT, DETAB, ENTAB, PRECESS, and AIRMASS.

------------
From: /usr/davis/ Mon 17:10:45 26-Mar-84
Package: dataio
Title: tasks txtbin, bintxt
 
The tasks txtbin and bintxt have been added to the dataio package.
Bintxt converts binary files containing only text to text files
and txtbin does the inverse.

------------
From: /usr/tody/ Mon 23:20:16 26-Mar-84
Package: softools
Title: new task MKMANPAGE
 
A new utility MKMANPAGE is available in softools.  Use as follows:

	mkman taskname

This copies the manual page template into the new file "taskname.hlp",
leaving you in the editor ready to fill in the blanks.

------------
From: /usr/davis/ Tue 13:15:17 27-Mar-84
Package: utilities
Title: task translit
 
The task translit has been added to the utilities package. Translit can
be used to delete or replace characters in text file(s). Documentation
in translit.hlp in the utilities directory.

------------
From: /usr/davis/ Tue 16:31:16 27-Mar-84
Package: utilities
Title: tasks detab, entab
 
Tasks detab and entab have been added to the utilities package. See
detab.hlp and entab.hlp for documentation.

------------
From: /usr/tody/ Wed 19:25:49 28-Mar-84
Package: system
Title: HELP moved to system; package LOCAL added to root
 
The HELP program has been moved into the system package, with the new
package LOCAL taking its place.  LOCAL provides a place for users or
remote sites to add their own software, without having to modify the
system itself.  It also provides a way to get software into the system
so that people can use it, without having to meet the strict standards
required for mainline software.

------------
From: /usr/tody/ Wed 19:29:25 28-Mar-84
Package: local
Title: new utility URAND
 
A new utility program URAND (uniform random number generator) has been
added to the UTILITIES package.  URAND is particularly useful for generating
lists to test software.  Try the example given in the manual page.

------------
From: /usr/tody/ Thu 01:27:13 29-Mar-84
Package: os
Title: zfpath modified
 
The calling sequence for the ZFPATH primitive has been changed from

	call zfpath (fname, pathname, maxch, status)
to
	call zfpath (fname, pathname, maxch, isdir, status)

If the "isdir" argument is XYES, the pathname returned by the primitive
will be a directory name, suitable for prepending to a file name to
generate a pathame for the file (i.e., on UNIX, the directory pathname
will have a '/' as the last character).

------------
From: /usr/tody/ Thu 01:30:38 29-Mar-84
Package: system
Title: copy, rename modified; movefiles added
 
The COPY and RENAME tasks in the system package have long been tricky
to use, because it was hard to predict when there had to be a $ in a
directory name.  These programs have been smartened up so that they
will always know when a file is a directory.  For example,

	copy files, '.'

will suffice to copy the named files to the current directory on our
UNIX systems.

	copy file, lib

would make a copy "lib" of the file "file", while

	copy files, lib

would copy the named files to the lib$ directory (provided there is more
than one file matching the template).

RENAME can no longer be used to move a list of files to another directory;
use MOVEFILES for that function instead.  If RENAME is called with a list
of files, the default action is to change the root name of each file:

	rename 'task.*', newtask

might be used to change 'task.cl' to 'newtask.cl', and 'task.par' to
'newtask.par', all in the same command.  A hidden param makes it possible
to change the extension instead.  If a single file is named, it is
simply renamed.

MOVEFILES moves the named files to the destination directory.  The destination
must be a directory or it will abort.  A command like

	move '*.x', name

will move the file the subdirectory 'name' if there is one; otherwise the
program looks for a logical directory 'name$' and if it finds one, moves
the files there (but not across file systems at present).

------------
From: /usr/davis/ Thu 15:33:40 29-Mar-84
Package: xtools
Title: gstrsettab bugfix
 
Gstrsettab has been fixed so that it will accept an arbitrary first tabstop
and tab size.

------------
From: /usr/tody/ Thu 22:26:21 29-Mar-84
Package: cl
Title: fix to avoid deadlock when killing a nonexistent process
 
The CL would sometimes get into a strange state where, in response to
a ctrl/c interrupt, it would try to kill a process which had already
been killed.  Deadlock would occur waiting for the nonexistent process
to die; additional interrupts would only result in more attempts to kill
the nonexistent process.  To be honest, I do not understand why this
happens in the first place, but nonetheless the OSKILL primitive has
been modified to detect and avoid this kind of deadlock.

------------
From: /usr/tody/ Wed 10:03:36 04-Apr-84
Package: fmtio
Title: LEXNUM did not recognize INDEF at the end of a line
 
LEXNUM was using streq to compare its input with "INDEF", thus the test
would return false if the input string was longer than 5 characters.
Replaced the call to streq with one to strncmp.  Indefinites should now
be properly recognized in formatted input.

------------
From: /usr/tody/ Fri 11:25:31 06-Apr-84
Package: plot
Title: bug in graphics output to batch devices
 
We have been experiencing intermittent failures of the graphics programs
when writing to the batch devices (versatec, imagen).  The problem has
been traced to the system metacode translators (Jan's Fortran programs),
which evidently create temporary files in the current directory.  I modified
the IRAF interface to these routines to call them from /tmp, so that
the graphics software will not abort when used in someone else's directory.

------------
From: /usr/tody/ Thu 16:15:00 12-Apr-84
Package: fio
Title: bug fix: stderr was being directed to stdgraph output
 
The recent addition of the pseudofile STDGRAPH introduced a bug into
file i/o causing the standard error output to be directed to STDGRAPH
instead of STDERR.  The current CL does not differentiate between STDOUT
and STDGRAPH for output, so the ultimate effect was to direct STDERR to
the same destination as STDOUT.  The file clio.clstdio.x was edited to
fix the bug (a missing goto after the entry point for the pseudofile
stderr was causing control to pass to the entry point for stdgraph).

------------
From: /usr/tody/ Tue 16:39:09 17-Apr-84
Package: imio
Title: readwrite access to an image trashes the user area
 
When opening an existing image for read write access, specifying the
size of the user area as zero (because it does not need to be used by
the calling program) IMIO would read only the standard header, but
would then write out the full header at imunmap time.  The user area
would thus be overwritten with uninitialized data.  Immap was modified
to record the amount of header data actually read if opening an existing
image, and imunmap was modified to write only that amount out when updating
the header.

------------
From: /usr/tody/ Tue 16:43:55 17-Apr-84
Package: mii
Title: bug fix in miipak
 
The wrong array was being byte swapped in the call to bswaps.  A simple
error, fixed by replacing the name of the unpacked data array (spp) by
the name of the packed array (mii).

------------
From: /usr/tody/ Thu 20:05:06 26-Apr-84
Package: vops
Title: bug in ARAV, the rejection average procedure
 
A bug in ARAV caused all pixels to be rejected in the first iteration
(it was never tested and never worked).

------------
From: /usr/tody/ Fri 13:41:26 27-Apr-84
Package: system
Title: "sleep" task added to system package
 
The new task system.sleep provides a means for generating delays.  The
single integer argument specifies the number of seconds of delay desired.

------------
From: /usr/tody/ Tue 22:03:33 01-May-84
Package: imio
Title: bug fixes
 
Problems were reported accessing images of more than 2 dimensions: the data
was not being written into the image properly.  The problem turned out to be
the routine which calculates the char offset into the image given the coords
of a line.  The routine would use the size of axis 3 in the calculation when
it was supposed to be using 2.  It would also use 2 when it was supposed to
be using 1, but we have not seen it up until now because the test images have
all been square.  All programs which access images of 2 or more dimensions
should be relinked.

A second problem, reported some time ago, was also fixed.  Imdelete would
crash when trying to delete an image with a zero length header.  Problem was
lack of a return statement or error checking in immap after call to imerr;
added return statement and it works fine now when there is a header read
error.

------------
From: /usr/davis/ Mon 13:12:38 07-May-84
Package: dataio
Title: pdsread mods
 
For the sake of uniformity the pdsread task in dataio has been renamed
rpds. Rpds now calculates the minimum and maximum data values in the
pds image and enters them in the header.

------------
From: /usr/davis/ Mon 13:41:38 07-May-84
Package: dataio
Title: rcamera mods
 
Rcamera now calculates the maximum and minimum data values in the camera
image and inserts these values in the IRAF image header.

------------
From: /usr/davis/ Mon 16:21:05 07-May-84
Package: dataio
Title: rfits mods
 
Rfits in the dataio package now calculates the data minimum and maximum
values and puts these in the IRAF image header.

------------
From: /usr/valdes/iraf/ Tue 10:52:31 08-May-84
Package: system
Title: interpolator routine
 
The image interpolator library /usr/irafx/math/interp has a clget routine
to select one of the interpolator types.  The routine is called
clginterp.

	interpolator_type = clginterp (param)

	char	param[ARB]

The CL request the parameter param, which is a string type parameter.
The string is interpreted into one of the interpolator types in interpdef.h.
The possible strings including abbreviations are:

	nearest
	linear
	3rd order poly
	5th order poly
	cubic spline

This routine is implemented using clgwrd and will set an error condition
if the input string does not match any of the allowed strings.

------------
From: /usr/davis/ Thu 17:58:52 10-May-84
Package: dataio
Title: FITS writer
 
Task wfits has been added to the dataio package.

------------
From: /usr/tody/ Fri 09:07:24 11-May-84
Package: system
Title: count would not read from STDIN
 
Count would no longer read from the standard input because of a recent change
to ACCESS.  Deleted all the file type checking from COUNT; now it counts each
file in the list whether or not it is a text file, just like any other utility
which operates on a list of files.

------------
From: /usr/tody/ Fri 10:06:11 11-May-84
Package: images
Title: imdelete now works in verify mode
 
The IMDELETE utility has been modified to fix a bug in verify mode.
The code was using the old TTY routines and had to be modified to
open and close the termcap database.  While I was at it, I modified the
SYSTEM.DELETE program to only access the termcap database in verify
mode, making noninteractive deletes more efficient.

------------
From: /usr/davis/ Wed 09:58:49 16-May-84
Package: dataio
Title: rcamera bugfix
 
A bug in rcamera resulting in picture that were shifted left one column
has been fixed. The problem was that rcamera was reading the first data
value as the last header value causing all the pixels to be offset by one.

------------
From: /usr/tody/ Fri 11:41:18 18-May-84
Package: fio
Title: file fault bug fix
 
FIO divides a binary file up into a sequence of segments the size of the file
buffer.  When seeking to the very last char in a segment, FFAULT would fault
in the next segment, and then write the first char of data into the char
preceeding the first char of the buffer, overwriting the MEMIO header word.
When the buffer was subsequently deallocated MEMIO would detect the overwrite
and a fatal error would result.  There was no problem when seeking (faulting)
to any other char in a segment.

------------
From: /usr/tody/ Mon 10:21:25 21-May-84
Package: math
Title: bevington library installed
 
The Bevington library has been installed in lib$ for our scientific users.
The limit on the number of datapoints the REGRES procedure can handle has
been increased from 100 to 1000 points.  These routines should not be used
in serious software.

------------
From: /usr/tody/ Thu 13:15:47 24-May-84
Package: softools
Title: bug fix in SPP compiler
 
When called with the -F flag followed by one or more filenames and then
some libraries, i.e.,

	xcompile file.x, fort+, lib=library

which is translated to

	xc -F file.x -llibrary

the compiler would not set the -o file because by the time it saw "file.x"
it thought it should only make the fortran.  Fixed so that it always sets
the -o file if it sees a filename.

------------
From: /usr/tody/ Sat 12:47:10 26-May-84
Package: system
Title: handy type coercion functions for booleans
 
We often need to convert the return value from procedures like clgetb
into one of the integer values YES or NO, and vice versa.  To make this
easier I have added the following functions to the system:

	bool	= itob (integer_value)
	int	= btoi (boolean_value)

------------
From: /usr/tody/ Sat 12:58:24 26-May-84
Package: system
Title: database package renamed
 
The DATABASE package has been renamed DBMS (for database management system,
as in all the trade journals).  This yields a package prefix of "db>" for
the package, and makes it possible to abbreviate DATAIO.

------------
From: /usr/tody/ Sat 16:55:06 26-May-84
Package: system
Title: enhancements to HELP
 
The HELP utility now handles paging of multiple help blocks or source files
(option op=source) properly.  The original program would pause at the end
of every screen of text but not at the end of every help block or file.
The program also discriminates now between the "more" prompt at the end of
a screen of text and that at the end of a block or file.  If one answers
no to the "more" prompt at the end of a screen, the rest of the block or file
in question is skipped, i.e., the program advances to the next block or file.
If no is given in response to the prompt at the end of a block or file,
HELP quits.

Help blocks with multiple keywords are now handled a bit differently too.
A single help block may be referenced by several keywords in the help
directory; the same block will be printed regardless of which keyword the
user enters.  Previously HELP would always use the first keyword as the
title name, producing an identical manual page regardless of the keyword
requested.  Now the program prints a manual page named for the keyword
requested; and it just so happens that several keywords are linked to the
same manual page.  An entry is made in the printed manual for each keyword
so that the user does not have to know what keyword to look under to find
the documentation.

------------
From: /usr/tody/ Tue 20:28:04 29-May-84
Package: system
Title: more enhancements to HELP
 
The following enhancements have been made to the HELP utility:

    [1]	Help now generates "manual page" style output, if the standard
	output is redirected and pagination is enabled.  Just pipe the
	Help output to Page or Lprint and Help will generate manpage
	output by default.  A command such as

		help 'package.*' | lprint

	will print all of the manual pages for the named package.

    [2]	Help can now be run on a file or files not installed in the help
	database.  This is useful for developmental packages, for
	specifications documents, and so on.  The "file_template" switch,
	if enabled, causes the template to be interpreted as a filename
	template rather than as a module name template.  For example,

		help doc$crib.hlp, f+ | lprint

	will print the current version of the crib sheet on the line printer.

------------
From: /usr/davis/ Mon 08:35:51 18-Jun-84
Package: dataio
Title: reblock bugfix
 
Reblock was not appending the tape file number to the input file correctly when
the parameter file list contained only a single entry.

------------
From: /usr/tody/ Tue 11:38:41 19-Jun-84
Package: vops
Title: call to error removed from the ACHT routines
 
The call to "error" has been removed from the ACHT routines so that they can
be called from Fortran programs (they are used in the new Fortran simple
interface to IRAF images).  If an ACHT routine is called to convert to an
unknown datatype it does nothing.  This is in keeping with the convention
that the string operators, vector operators, formatted i/o operators, and
math library routines be purely numerical procedures.

------------
From: /usr/tody/ Sat 16:33:03 23-Jun-84
Package: vops
Title: interface modification
 
The calling sequence of the ABAV (block average) vector operator has been
changed and the code has been internally modified.  The new calling sequence
is
	abav[silrdx] (a, b, nblocks, npix_per_block)

and partial blocks are not permitted.  Computation of the block sum is
carried out in enough precision internally to guarantee that there will be
no problems with overflow for the integer types.

------------
From: /usr/tody/ Sat 21:46:08 23-Jun-84
Package: imio
Title: bug fix in IMIO
 
When opening a new or new copy image the image dimensions were not getting
copied into the internal array IM_SVLEN, used in the IMIO code where the
full (non-section) image dimensions are required.  IMIOFF was modified to
set this array when the dimensions of a new image are processed.

------------
From: /usr/tody/ Sun 18:41:04 24-Jun-84
Package: memio
Title: error checking added to SALLOC
 
The SALLOC procedure will now detect a bad datatype code (arg 3), producing
a fatal error.

------------
From: /usr/tody/ Tue 10:41:20 26-Jun-84
Package: system
Title: minor mod to RENAME
 
RENAME has been modified so that it queries for the old filename(s) before
the new name(s).  The order of the queries now agrees with the order of the
positional parameters.

------------
From: /usr/hammond/iraf/ Tue 16:53:24 26-Jun-84
Package: dataio
Title: new task installed: rrcopy
 
Task "rrcopy" has been installed in the dataio package.  This task will
read IPPS rasters stored on rcopy tapes and convert the rasters to IRAF
images.  A rcopy format disk file can also be converted.

------------
From: /usr/hammond/iraf/ Tue 16:56:37 26-Jun-84
Package: local
Title: new task installed: fields
 
Task "fields" has been installed in the local package.  This task is a
list processing tool used to extract whitespace separated fields from
the specified files. 

------------

------------
From: /usr/davis/ Wed 08:31:28 27-Jun-84
Package: dataio
Title: new parameter in dataio readers
 
It is now possible to specify a tape file number offset in the dataio
tasks rpds, rfits, rcamera and rcardimage. The readers will begin begin
numbering the output files at "offset + tape file number" instead of
"tape file number as before". The offset parameter is useful in cases
where one wishes to maintain the same root output file name but read
from a different tape.

------------
From: /usr/tody/ Thu 17:49:07 28-Jun-84
Package: fio
Title: file fault now zero-fills on a write-only file
 
The file fault procedure was modified to zero the file buffer when
faulting "in" a block on a write only file.  Previously the contents
of the file buffer were uninitialized and if the buffer was not completely
written into, garbage would be written out to the file.

------------
From: /usr/tody/ Mon 14:49:47 02-Jul-84
Package: help
Title: bug fixes in HELP
 
The following two bug fixes were made to the HELP utility:

    [1]	File mode will now find unnamed help blocks, i.e., blocks
	beginning with a ".help" not followed by a keyword.

    [2]	Help block name keywords may now contain underscore as well
	as alphanumeric characters.

------------
From: /usr/tody/ Mon 14:52:40 02-Jul-84
Package: fio, imio
Title: optimization
 
A number of small mods were made to FIO and IMIO to enchance efficiency.
No interface changes were involved.

------------
From: /usr/tody/ Tue 14:20:23 03-Jul-84
Package: fio
Title: whitespace in filenames, numbered files
 
The filename mapping procedure now deletes trailing whitespace from a
filename.  It no longer maps numbered files, hence numbered files may
now be referenced just like any other file.

------------
From: /usr/tody/ Wed 16:44:53 04-Jul-84
Package: images
Title: improvements to IMHEADER utility
 
The IMHEADER utility program now accepts filename templates, and hence can be
used to print the headers of a list of images.  There is both a long and a
short form.  The name of the pixel storage file is printed, along with a note
telling whether or not the file exists.

------------
From: /usr/tody/ Thu 19:27:24 12-Jul-84
Package: spp
Title: buffer space in compiler increased
 
The size of the dynamic memory area in the RPP phase of the SPP compiler
has been increased to avoid the "in dsget: out of memory" compiler errors
we have been getting occasionally.

------------
From: /usr/tody/ Thu 19:38:04 12-Jul-84
Package: plot
Title: GRAPH can now put image title on a plot
 
If the parameter graph.title is set to "@imtitle" and the first operand in
the list of operands to be graphed is an image, GRAPH will now use the title
of the first image as the plot title.  This has been changed to be the default
action.

------------
From: /usr/tody/ Thu 22:12:43 12-Jul-84
Package: plot
Title: variable line widths
 
The plotting interface to the versatec has been changed to permit variable
line widths.  The appearance of plots on the versatec is much improved,
particularly the contour plots.  Try it!

------------
From: /usr/tody/ Fri 21:21:38 13-Jul-84
Package: plot
Title: new parameter for CONTOUR
 
A new hidden parameter has been added to CONTOUR permitting a zero point
shift to be applied to the data before plotting.  This makes it easy to
adjust the percentage of dashed (negative) contour lines in the plot.

------------
From: /usr/tody/ Thu 16:51:39 19-Jul-84
Package: plot
Title: minor mods and bug fixes
 
CONTOUR and SURFACE will now print a warning message if used to operate
on a very large subraster; possibly the user did not know about image
sections or forgot to use one.  The warning message can be disabled with
the hidden parameter "verbose".  GRAPH had a bug (now fixed) introduced by
the recent mod to use the image title as the default plot title.  If called
to graph a list from the standard input, GRAPH would try to immap the input
operand (STDIN) and would discover that it was not an image, which is fine,
but then there would be no data left to plot since STDIN is sequential.

------------
From: /usr/tody/ Fri 10:41:45 20-Jul-84
Package: cl
Title: new _curpack builtin
 
A new builtin task "_curpack" has been added to the language package in the CL.
The function of this task is to print the name of the current package.  Used by
HELP to order searches of the help database.

------------
From: /usr/tody/ Sun 22:41:02 22-Jul-84
Package: mkmanpage
Title: now supports both CL format and SPP (procedure) formats
 
The MKMANPAGE utility can now be used to generate manual page templates 
for both CL programs and library procedures.  Do an lparam for additional
details.

------------
From: /usr/tody/ Sun 22:43:44 22-Jul-84
Package: xtools
Title: cleanup
 
The XTOOLS package has been reorganized and the code cleaned up somewhat.
The package is now online in HELP too.  The CLGINTERP routine has been
moved from math$interp into XTOOLS.

------------
From: /usr/tody/ Sun 22:46:07 22-Jul-84
Package: help
Title: new relase of the HELP program
 
The HELP program has undergone a major revision.  Highlights include
pre-compilation of the help database, improved error diagnostics,
a much larger help database, and speedy response (but it still takes
forever to spawn the process the first time).  Details will follow soon.
Try "help '*.', op=dir" or softools.hdbexamine for a peek at the database.

------------
From: /usr/tody/ Mon 19:28:52 23-Jul-84
Package: cl
Title: dictionary size increased, process cache more efficient
 
We had a dictionary overrun recently so I doubled the size of the CL
dictionary (which is currently fixed in size at startup time) from 7500 ints
to 15000 ints (60 Kb).  This will permit more complex CL scripts to be run.
The stack area is also fixed in size but judging from the report I heard
it was the dictionary which was being overrun.

While I was at it I made a mod to improve the efficiency of the process
cache.  The process cache is no longer flushed when a command is sent to
the OS with a "!" escape.  The improvement in response should be significant.
The process cache is still flushed by CHDIR or when the environment list
is modified.  Both of these cases will be fixed in the future as well.

The builtin command FLPRCACHE has been added to flush the process cache.
An explicit command to flush the process cache has been added to XCOMPILE
and MAKE to avoid a UNIX abort while trying to rebuild a process which is
sitting in the cache.  There may be other times when this is a problem,
however; beware that the executable file is protected while the process is
running, and that an occasional "flpr" may be necessary to explicitly flush
the cache.  The inconvience should be minor compared to the significant
improvement in response we should see for commonly used commands like dir,
clear, etc.

In particular, the following will not work when a process is running:

    - The file cannot be written into, e.g., by COPY or even by
	the UNIX "cp".

    - The process can be run under the debugger, but you cannot set
	a breakpoint (cannot write into the executable file which
	is mapped into memory).

Beware of these sorts of problems, it can be hard to figure out what is
going on!

Finally, a new intrinsic function STRIDX was added.  Function is similar
to the program interface version.  The EDIT script was recoded to use this
function, eliminating the use of a temporary file and speeding up EDIT a bit
(we still have a ways to go, though).
math/bevington/*.f
	Changed illegal unix style continuation in several Fortran files to
	Fortran continuation.

math/llsq/sva.f
	Fixed hollerith fields of format statements at end of procedure.

sys/clio/zfiocl.x
	Variable 'nchars' was multiply declared.

sys/clio/clgfil.x
	This file (and the FNTGFN code) was completely rewritten as noted
	elsewhere in the revs notices.

sys/fio/filopn.x
	The VFN (mapping file) was being opened with read write access even
	when the file was to be opened read only.  This would cause an
	unnecessary delay when multiple users would try to read from the
	same file at the same time.

sys/fio/vfnmap.x
	Variable file_exists was never used in vfnmap due to the commenting
	out of the .zmd file code.  The declaration was commented out as well.

sys/fio/fcopy.x
	The call to fmkcopy would fail when the input file was a standard
	stream.  Changed to use fstdfile() to test for a standard file,
	calling fmkcopy only if not a standard file.

sys/fio/vfntrans.x
	Escape character processing was mapping \X into X for all X, causing
	file.\X extensions to in effect not be escaped (a later routine would
	map the extension).  Changed to allow escaping of the $ metacharacter
	but no other, i.e., \$ maps to $ without logical directory expansion,
	but \X maps to \X for all X != $.

sys/fmtio/fmtstr.x
sys/fmtio/strtbl.x
	Did away with the experimental ; in argument lists, using ',' instead.
	This feature turned out not be useful and has been deleted from the
	SPP language.

sys/fmtio/strtbl.x
	Modified to use STRSRT to sort the field list.

sys/fmtio/fmt_setcol.x
sys/fmtio/fprfmt.x
	Deleted declaration for unused variable 'i'.

sys/gio/glabax/glbverify.x
	Deleted commented out code used to test if log scaling made sense.
	The associated function gt_linearity() was declared but never used,
	causing a warning message.

sys/gio/gtickr.x
	Similar problem with variable 'nticks'.

sys/gio/nspp/mcscale.x
	min/max type mismatch fixed.

sys/gio/cursor/grccommand.x
	The unreachable code should have disappeard with the completion
	of all the grccommand options, hence this routine was not changed.

sys/gio/nsppkern/pwry.for
	This routine was deleted when the new character generator was
	intalled recently, hence the illegal \\ in fortran problem is gone.

sys/mtio/mtupdlock.x
	Could cause no write perm problem on tmp$ as temporary file name
	"tmp$mtlok1234ll" was too long for VMS and would cause a mapping
	file reference.  Changed the "mtlock" to "mt" to eliminate the
	mapping file reference.  This is supposed to be a low level routine
	(it is called by a FIO device driver) hence full filename mapping
	is not desired here.

sys/mtio/rewind.x
	This was changed in the VMS version of IRAF because the SIRM
	specified a channel number for the argument to ZZRWMT, rather than
	the unit number used in the code.  No changes were made as it
	is the SIRM which is in error.  REWIND takes as argument a drive
	name such as "mta", rather than the file descriptor of an open file.

		call rewind ("mta")
	
	This permits rewinding of a drive which is not open, and
	forbids rewinding of a drive which IS open.  This consistent with
	the philosophy of MTIO in which MTOPEN can only be used to access
	a single file at a time.  It is not safe to assume that a tape
	drive can be rewound while opened to a particular file on the tape;
	this does not work on some systems (e.g., AOS, at least as of 2
	years ago).

sys/libc/mathc.c
lib/libc/libc.h,math.h
	Found a way to eliminate the extra procedure call without adding
	VMS dependence.  The LIBC stuff is nearly machine independent and
	we should strive to keep it so.  The (&(x),&(y)) construct used
	here (where x and y may be constants) is nonstandard C and should
	be avoided.

sys/libc/cfchdr.c
	In the VMS version XOK was always returned since FCHDIR does not
	return a function value.  This is not right because FCHDIR takes
	an error action if it cannot change the directory.  I modified
	c_fchdir() to error check FCHDIR and return ERR if an error occurs.
	CHDIR in builtin.c checks for this function value.

sys/libc/free.c
	Reference to 'ptr' changed to 'buf'.

sys/tty/ttyctrl.x
	Remove declaration for unused variable 'i'.  There were other
	modifications to the TTY files as a result of the recent effort
	to eliminate unix like filenames from the system directories.

pkg/softools/boot/spp
	Many changes here.  The missing argument in errchk.f was fixed
	a long time ago.  There was also a missing argument in xppcode.c.
	The 'elusive rpp bug' (jiand problem) was fixed some time ago.
	Other changes for reordering declarations were reported in the
	revs notices recently.

pkg/softools/boot/spp/rpp/rpprat/lndict.r
pkg/softools/boot/spp/rpp/rpprat/outstr.r
	The declarations for 'cupper' were deleted in the VMS version to
	avoid a 'declareed but never used' warning message from the 
	compiler.  This was an error because the integer function cupper()
	is conditionally used in the body of the procedure if a switch
	definition is defined in the rpp include file.  I replaced the
	declaration but put a conditional compilation around it to that
	it would be declared only if used.

pkg/cl/exec.c
	There was a typo: operator '*' used where '&' was intended.
	This was fixed some time ago but not recorded.

pkg/cl/builtin.c
	The error checking of the return value from c_fchdir was removed
	in the VMS version due to a related change to c_fchdir().  I left
	the error checking in for the reasons noted above.

pkg/cl/pfiles.c
	The operator '&&' was used where '&' was intended, resulting in a
	nasty bug in pfcopyback().  The weak typing in C strikes again.

sys/fmtio/parg.x
	Changed the default precision of a %f from 1 decimal places to
	full precision.  The former default was causing numbers such as
	"0.01" to be printed as "0.0".

dev/graphcap
	Added entries for vt100s,vt240,vt240o,vt100so from the VMS graphcap.

dev/termcap
	Added entries for printronix,qms from the VMS graphcap.

dev/
	Added files edt.ed, emacs.ed.

lib/cl.par
	Made cosmetic changes as in the VMS version.

lib/cllogout.cl
	Commented out automatic magtape deallocation as in VMS.  This has
	caused problems for users multiply logged in, and greatly slows
	down logout as well.

lib/clpackage.cl
	Added SET defs for "language", "showall", and "editor".  Added 
	a "lexmodes = yes" to make command mode the default.

lib/login.cl
	Did NOT add the statement

	    set logfile = uparm$logfile"

	because the logfile name is controlled by a CL parameter rather than
	by an environment name.  I do not understand why this set stmt was
	present in the default VMS login.cl file.

lig/make.h
	Added a CFLAGS macro and a .c.o entry which uses it.

lib/libc/ctype.h
	Added #ifdef vms condtional to define "vms_ctype_defs" as a globalvalue.
	Presumably this is necessary for the VMS C compiler to be able to link
	in the initialization module ctype.o from the library.

lib/libc/iraf.h
	Added a def "UNIX42BSD" to specify the exact version of UNIX used on
	the host system.  Not yet used anywhere.

lib/libc/kernel.h
	Modifed plotter table entries for the NSPP devices to submit the
	rasterization tasks as a reduced priority (UNIX only).

lib/libc/[kx]names.h
	Not modified - VMS needs a different version of these files.

lib/libc/spp.h
	Changed define of INDEFL for VMS, added VFN definitions.

lib/libc/stdio.h
	Modified getchar(), putchar() macros to use fgetc() and fputc().
	Don't know why this is necessary on VMS, but it cannot hurt and
	these routines are used too infrequently for it to be worth worrying
	about efficiency.

pkg/help/
pkg/help/lroff/
	There were a number of changes recently to make structure definitions
	more portable, to eliminate ENTRY statements, and to avoid type
	mismatches in argument lists.

pkg/help/lroff/lroff.hlp
	The documentation for ".in" incorrectly specifed the action as move
	to col "n+1".  Changed to move to "current+n".

pkg/language/
	Moved in the entire VMS version of this directory to capture the
	new manual pages therein.  Deleted the junk file "words" from the
	root directory.

pkg/lists/
	Added the SDAS task "columns" to the package.  Some source changes
	were required, in particular the task was installed int the x_lists.e
	executable to save disk space.  Not tested.

pkg/lists/words.x
	The variable last_nscan was incorrectly declared to be a function.

sys/gio/stdgraph/stg[gr]cur.x
sys/gio/stdgraph/stginit.x
sys/gio/cursor/grccmd.x
	A new cursor mode option ":.cursor N" was added to allow the user
	to select the logical device cursor to be used for cursor mode input.
	The cursor may also be selected under program control by using GSETI
	to set the desired cursor number and then calling GSCUR to set both
	the cursor number and position.  The kernel will continue to use the
	indicated cursor so long as cursor reads request cursor number 0;
	this is always the case for cursor mode cursor reads.  For cursor
	selection to work for STDGRAPH devices, the graphcap entry for RC
	should be implemented as a case statement, with logical cursor numbers
	of 1, 2, etc (see the entry for the device "vt640" for an example).

sys/dev/graphcap.vt640
sys/gio/stdgraph
sys/gio/cursor
	More changes were required to support setting of logical cursors in
	cursor mode.  Setting a logical cursor with :.cursor now locks the
	logical cursor until unlocked by a subsequent ":.cur 0" or ":.init",
	i.e., the locked cursor N will always be referenced regardless of
	the cursor number specified in a GIO call.

	In the process of debugging this feature a bug was discovered in
	the stdgraph encoder.  The encoder case statement ($1..$2..$$) was
	not being processed correctly.

sys/pkg/plot
	A new task SHOWCAP was added to the PLOT package.  SHOWCAP is used
	to interactively inspect and check out graphcap entries.  Complex
	graphcap entries can be encoded and the output dumped in ASCII
	(rather than graphically) to verify that the correct codes will be
	are are being sent to the terminal.  The task is implemented as an
	interactive interpreter and is self documenting.

	SHOWCAP accesses the graphcap database like any graphics task, hence
	any errors in the links to the database should be detectable by running
	SHOWCAP.  It may be necessary to relink both SHOWCAP and the CL to
	make sure that both are using the same version of tty$cacheg.dat.
	Graphcap entries may be cached in object form in libsys.a by running
	the task MKTTYDATA in package softools, then rebuilding libsys.a.

sys/osb/bytmov.s
sys/vops/lz/amov.s
	The VAX memory copy instruction AMOVC3 cannot move more than 65K bytes
	in a single call.  All routines which use this instruction were
	modified to check for very large blocks and to call AMOVC3 repeatedly
	to copy such blocks in 65K or smaller segments.

sys/etc/symtab/*		***** NEW PACKAGE!! *****
	A new system package SYMTAB was added to the system library libsys.
	SYMTAB is a very general and efficient symbol table package for use
	in IRAF system utilities, applications, and other places (possibly in
	HELP for faster help database searches, or a future version of the CL
	which implements macro expansion).

sys/etc/environ.x
	The hash function used in the environment package was replaced by the
	function used in the new SYMTAB package, which is simpler and better.

pkg/softools/*
	This entire package has diverged so far from the UNIX version that I
	have decided (for the present) to support two completely different
	implementations of the SOFTOOLS tasks, one for VMS and one for
	other systems.  At some point this package will have to be cleaned
	up and the existing (gawdawful) code thrown away.

sys/fio/fmkdir.x
pkg/system/mkdir.x
sys/libc/cfmkdir.c
	A new library procedure FMKDIR was added to the FIO package for
	creating new directories.  A new task MKDIR was added to the system
	package to provide the same facility at the CL level.  The FMKDIR
	procedure was added to xnames.h and a new procedure c_fmkdir()
	was added to the C runtime library.

pkg/system/edit.*
	The edit script was changed to pick up the name of the editor from
	the environment, rather than from a parameter.  This permits use of
	a single global variable to select the editor everywhere.

pkg/system/lprint.x
	For reasons I don't understand (despite the comments in the code)
	the VMS version of this task insists on a separate LPOPEN call
	for each INPUT file to be printed.  This does not make any sense -
	it should not matter to the LP driver where the input is coming
	from, or how many files input is coming from.  Furthermore, printing
	each file as a separate VMS print job (presumably with a separate
	job header etc.) is a drastic change to the LPRINT utility which would
	render it unusable for making listings of packages (a directory full
	of files).  The typical command to print a full listing of a package
	is "lprint *.x,*.h,*.com": these files must be submitted to the system
	as a single print job.

	I will check into this further when testing the merged system.

pkg/system/stty.cl
	Modified to permit setting the baud rate, screen size, etc. on the
	same command line when the terminal type is set.  STTY with no
	arguments shows the status; STTY with any combination of arguments
	sets the arguments.  The VMS version of this mod was not quite
	right, by the way, because hidden parameters are not counted in
	$nargs.  Hence a "stty baud=1200" has $nargs=0 (no positional args),
	and "stty baud=1200" was being treated the same as "stty".

	Note: STTY should not be used in the login.cl file because it is
	slow (it has to spawn the system process to access termcap).  Use
	explicit SET statements in the login.cl file instead, leaving STTY
	for the interactive user.

sys/Makelib
sys/gio/Makelib
	Added entries for the system libraries libcur.a (cursor mode) and
	libstg.a (the stdgraph kernel).  These libraries are required to
	link the CL hence are installed in the system library.  I did not
	add the library libgkt.a (NSPP kernel) because it is really just
	a "pkg.a" type library, and is not used outside of the package.
	Updating of this package shoud done by some sort of make facility,
	since MKLIB cannot link and install the process.

sys/fmtio/cto[il].x
	I agree that CTOI and CTOL should have the same semantics and that
	neither should call GCTOL, which is different.  Rather than
	implement CTOI as a call to CTOL I have simply duplicated the same
	code in both CTOI and CTOL.  One does not really save any memory
	by having CTOI call CTOL because mostly likely a process will only
	link in one or the other, and it will almost always be CTOI which
	gets used.  If CTOI calls CTOL then the result is something which
	not only runs slower but which requires MORE core memory.  CTOI, by
	the way, was originally implemented as a call to GCTOL (like CTOL).
	I wanted something simple and fast (formatted i/o is the slowest
	thing around), hence I don't like the extra procedure call in this
	context, even though I admit it is better software engineering (more
	structured).

	I noticed in the VMS CTOL that the "if (str[ip] == 'I')" was
	commented out, presumably because the code works the same whether
	it is there or not.  The reason it is there is for efficiency -
	it is much faster to compare two integers and branch than to
	call an external procedure like STRNCMP.  The test for 'I' eliminates
	the call to STRNCMP in virtually all calls to CTOL, since indefinite
	numbers are rare.

	By the way, I noticed that the new version of CTOI did use the new
	IS_INDEF macros, which indicates that somebody out there in VMS land
	reads the revs notices pretty carefully.  Good show.

sys/fmtio/*
	All occurrences of (NNN == INDEF_) were replaced by equivalent
	IS_INDEF constructs.  Probably still a lot of the old constructs
	left in the other parts of the system.

sys/libc/ato[il].c
	These LIBC procedures were NOT converted to calls to CTOI and CTOL.
	Formatted i/o is a major consumer of cpu cycles and the original
	C versions of ATOI and ATOL are optimal C code.  The VMS version
	of ATOI has to pack the numeric string, call CTOI which calls CTOL
	which makes an unnecessary call to STRNCMP - 5 procedure calls where
	formerly there was only one.  The amount of memory saved is not
	enough to be worth modifying an existing, functional library procedure,
	even if it did not make things slower.

sys/libc/calloc.c
	The type coercion (char *)NULL added here and elsewhere is strange -
	UNIX lint accepts just a NULL which is a legal pointer value in C
	(see K&R pg. 192 and the example on pg. 97).  The type coercion
	added is probably harmless but should not be necessary - does the
	VMS C compiler issue a warning message or something?  If not and
	the message is only from VMS lint, then we should leave the NULL
	as is.  I suspect that the VMS C does not realize that 0 is a special
	number in C and is complaining about an integer to pointer assignment.
	If that is the case, the problem is with the VMS C compiler and the
	code should not be changed (unless we are forced to do something
	because the compiler treats the "error" as fatal).

sys/libc/cclose.c
	Added error checking and function value.

sys/libc/cnvtime.c
	Move c_cnvdate out into a separate file.

sys/libc/cenvget.c (and elsewhere)
	It is common in C sources at many sites to declare C functions as
	follows

		typespec
		function_name (arglist)

	rather than as

		typespec function_name (arglist)

	This is done because [1] there are software tools, e.g., a cross
	reference utility, which can only recognize a function declaration
	of the first form, and [2] when editing the file, a "beginning of line"
	pattern match will find the function declaration (rather than every
	call to the function plus the declaration for the procedure itself).
	The C syntax is so subtle that without this convention it is difficult
	to find things in C source files containing many functions.

	If C had a PROCEDURE keyword like SPP then I would use the second
	form, but since it does not and the ^func style is common in UNIX
	land, I would like to keep things as in the first example.

sys/libc/cenvget.c (and elsewhere)
	I did not change the

		if (...)
		    return (a);
		else
		    return (b);

	constructs to the form

		if (...)
		    return (a);
		return (b);

	The first form is more readable and does not bother UNIX lint.  Modern
	compilers are smart enough to compile the same code in either case,
	hence there is no efficiency gain in the second form.  If the VMS C
	compiler or lint complains it is in error and should be fixed (rather
	than IRAF).

sys/libc/cerror.c
	Moved each procedure into a separate file.  Added NCHARS as in VMS
	version.  Went one step further and changed all the "return(strlen())"
	to "return (nchars)" since we now have the NCHARS.

sys/libc/cread.c,cwrite.c
	Did not replace the calls to c_erract and c_error by direct calls
	to the SPP ERRACT and ERROR procedures.  Since errors rarely occur
	doing so does nothing to make the code go faster; no memory is
	saved since c_erract is very small (5 longwords) and its size is
	offset by the extra code needed to call the Fortran procedures by
	reference.  Also the code is prettier if the C binding is used.

pkg/dataio/imtext/*
	This task was found to be extremely inefficient and the output code
	(ascii encoding) was rewritten, speeding the task up by more than a
	factor of 10.

sys/fio/putline.x
	In the process of profiling the optimized version of WTEXTIMAGE it
	was discovered that text file i/o is now dominating the timings (the
	output text file is enormous).  Examination of PUTLINE revealed that
	it could be optimized substantially, hence the procedure was largely
	rewritten.  This is a major output procedure hence is worth careful
	coding.  I rewrote PUTLINE, speeding it up by more than a factor of 2.

sys/os/zfiotx.c
	Examination of the UNIX version of ZPUTTX revealed some considerable
	inefficiencies.  Every character was being compared to newline even
	when it was known in advance that this was not necessary.  Characters
	were being output one at a time with PUTC.  I moved the test for
	newline outside the loop, making a loop where newline is checked for
	and another where it is not.  In the latter case data is now output
	in a block without using PUTC.

sys/libc/cxwhen.c
	Moved c_xgmes() out into a separate file.

sys/libc/fclose.c,fflush.c,fopen.c,etc.
	Modified to make direct calls to the SPP procedures (as in the VMS
	version) to eliminate the slight overhead involved in the extra call
	to the procedures of the C binding.

sys/libc/*
	Did not modify these routines to use FGETC,FPUTC rather than GETC,PUTC,
	since the inline macros are more efficient.  Why was this changed for
	VMS?  If it was to save a little memory I think that is a bad tradeoff,
	the amount of memory saved is insignificant and cpu cycles are usually
	in shorter supply.

sys/libc/system.c
	Eliminated the call to c_oscmd to avoid an unnecessary and redundant
	string unpack/pack operation.

sys/osb/*.c
	A number of procedures were changed in the VMS version of the system,
	converting register variable declarations to register argument
	declarations.  I did not keep these mods as the resultant code is the
	same in either case and I prefer the former style.

sys/etc/main.x
	A variable was placed in a fake common to defeat optimizations by
	the VMS fortran compiler that would cause failure in a future magic
	return from ZSVJMP during error recovery (a very subtle bug found
	by Jay T. at STScI, after a great effort).

sys/etc/qsort.x
	The array argument x[nelem] where X and NELEM are both arguments would
	cause a VMS Fortran runtime error when QSORT was called with NELEM=0
	(I am surprised that the compiler makes such a check at runtime).  X is
	now dimensioned ARB hence this error should no longer occur, even if
	QSORT is called to sort an array of length 0.  I did not add the test
	for NELEM==0 since the routine as written will work for this limiting
	case (the array X will never be referenced).

sys/fio/rename.x
	A change was made to this routine to force the host system dependent
	mapped filename to come out a certain way.  I did not keep the rev
	because FIO does not guarantee that a filename will be mapped in a
	certain way, and the external world should not depend upon names always
	being mapped in a certain way.  A change which would slow down rename
	by a factor of two is not justified.

sys/fio/vfnmap.x
	A number of changes were made here to fix bugs which were independently
	fixed on our UNIX system.  In particular there was a bug where a null
	length mapping file would be created when a VFN was opened for updating
	but no update ever occurred.  I fixed that independently some time ago
	(apparently with fewer changes) and will wait and test my version of 
	the routine on VMS.

sys/fio/vfntrans.x
	It was not correct to remove the handling of \ escapes completely in
	the routine which expands logical directory names.  The problem was
	fixed by having \$ map to $ as before (allowing $ in filenames), but
	having all \C map to \C rather than C, preserving escaped filename
	extensions.

sys/fio/isdir.x
	I did not add this routine to FIO, but may do so at some time in the
	future if it proves useful enough (the name would have to be changed).
	It was improper for the Makefile in IMAGES to refer to the routine
	directly in the SYSTEM package, since SYSTEM is a package and not a
	library (I was not aware of the reference to ISDIR in the IMAGES
	makefile).  The solution for the present is to duplicate the code in
	both packages.  There are an infinite number of routines that could
	be added to the system libraries; the libraries must be kept small to
	be comprehensible by programmers, hence I never add a procedure to a
	library until it becomes clear that it is best to do so.

sys/fio/fseti.x
sys/fio/fset.h
sys/os/zfiomt.c [UNIX]
	A new fset option F_VALIDATE was added.  This is used to validate the
	contents of the active FIO buffer after a read error, in order to
	try to recover at least part of the record.  The caller must tell
	FIO how many chars to validate.  The next read will return the contents
	of the buffer.  The UNIX magtape driver routine ZZRDMT was also modified
	to backspace a record and retry the read if a read error occurs.  The
	output buffer (usually the FIO buffer) is zeroed prior to the retry
	to avoid garbage data in the buffer if error recovery is attempted.
	My thinking is that the magtape drive will get partially through a
	dma transfer, detect a parity error, and then abort the rest of the
	dma transfer, in which case at least part of the buffer should be
	valid.

		# If a read error occurs validate whatever is in the buffer
		# and repeat the read, returning data from the validated
		# buffer w/o any more io.

		iferr (status = read (magtape, outbuf, maxchars)) {
		    call fseti (magtape, F_VALIDATE, record_length_in_chars)
		    status = read (magtape, outbuf, maxchars)
		}

	The caller must know the expected record length for this type of
	error recovery to be successful.

---------------------------
CL2 integration
Phase 1: quick onceover of code and first compile.
---------------------------

Moved in new CL wholesale.
Deleted all junk files.
Inspected Makefile; looked up to date.

Tried to compile the CL.  Died on first file, "cl.x" (would not compile on
UNIX for some reason - I did not investigate).  Looked therein and horror of
horrors, a hacked version of the IRAF Main.  I do not want to support two
versions of this very important procedure, so I deleted the hacked version
so that The Real One will be pulled in from libsys.

It looks like the hacked version of the iraf main was used to avoid the
reference to the library routine "cmain" in LIBC (a funny library reference
was required to link this module which perhaps caused problems on VMS).
I guess a better solution is needed, but it must not involve a second copy
of the iraf main.  Doing so violates the LIBC interface, resulting in possible
failure of the CL whenever changes are made to the iraf VOS.

Second try.

Lots of error messages, shown below.  Actions taken to fix each bug are shown
in parenthesis.

	*.c: CLDEBUG redefined everywhere
(-DCLDEBUG compiler flag removed in UNIX Makefile)

	grammar.y: 120: RETURN redefined
	./lexyy.c: 3: BEGIN redefined
	./ytab.h: 22: RETURN redefined
	(etc)
(RETURN is also defined as an opcode in opcodes.h.  BEGIN is an internal
(definition produced by YACC.  Solution was to use Y_ consistently for all
(tokens in the parser.  Incidentally, RETURN is also defined in eparam.h.
(Should have been called CR there, since CR is the standard ASCII name for
(that key).

	linker unsatisfied external: _AMOVI
(The CL used to have a C function called "amovi" in main.c.  This was removed
(in the VMS version and a direct call to the VOS procedure AMOVI substituted
(instead, presumably in reponse to a library conflict on VMS caused by VMS
(not distinguishing between C and Fortran externals in libraries.  This is a
(violation of the LIBC interface; I solved the problem by changing the name
(of the C function to "cl_amovi".)
(
(NOTE: the fact that we are doing this at all (playing with the ZSVJMP vector)
(is a subtle violation of the LIBC interface, more serious than the use of
(amovi, and should be changed (this one is my fault)).

	"gram.c", line 1116:
	    warning: struct/union or struct/union pointer required
(typo: misplaced parenthesis in statement 'curr = coderef(curr->c_args);'
(should have been 'curr = coderef(curr)->c_args;')

	"eparam.c", line 311:
	    warning: illegal combination of pointer and integer, op =

It was not obvious what was causing this error, but I decided to postpone that
for the moment to clean up the EPARAM code.  This code stands out in the CL
like a sore thumb, as it is written in a style completely different than the
rest of the CL (and at odds with the iraf standard).  Even worse, the style
is not consistent as if several people with different coding styles had worked
on the code.  Now that the code is written and people other than the original
author(s) have to maintain it, it must conform to the rest of the CL.

(busy reworking eparam)
	Added call to c_ttycdes to ttyexit() to close tty descriptor.
	    Old code was allocating a new tty descriptor on every call,
	    never returning old ones.
	Replaced environment variables "standout" and "showall" by
	    the single variable "epinit".  A name such as "standout"
	    has no obvious association with EPARAM and could easily
	    conflict with other names.  For example, use SET declaration
	    "set epinit = nostandout showall" to disable standout and
	    enable showall.  Additional parameters can easily be added
	    without cluttering the environment list.  Usage is consistent
	    with "cminit", used to init cursor mode.
	Simplified the code a bit in various spots; some pretty messy
	    stuff in there (admittedly the rest of the CL is messy too).
	    Obviously will have to check this when I get it running again
	    against the original version to see if it operates mostly the
	    same.
	Added "ehinit" to give user control over EHIST.  Current parameters
	    [no]standout, bol, eol.

(now for edcap.c)
	Warning message is now printed if editor is named for which an
	    edcap file cannot be found.
	Input EDCAP format for keystrokes generalized.  Now supports the more
	    readable ^X, \[befnrt] formats as well as octal escapes.

	GRIPE: The string editing facility is really tied into its use in
	    EPARAM and EHIST, with all sorts of changes occurring internally
	    to the values of global variables used by the calling program.
	    The string editor should have been coded as a self-contained,
	    general purpose subroutine that modifies a string using the EDCAP
	    screen editor interface.

(edcap.c and eparam.c now cleaned up and compile with no errors.  I am familiar
(with them now and ready to tune them when the CL runs (from looking at the
(code I am sure that some tuning will be necessary).  The rest of the new
(code looks pretty good, with the exception of numerous ELSE clauses which
(are not connected to the preceding ifs.  Try again to make the CL...)
	
	CL runs!  Sill getting compile time warning messages, however.
	The warning messages are as follows (numerous occurrences in several
	files):

	    "globals.c", lines 45-97
		warning: illegal combination of pointer and integer, op =

	The problem is statements like

		char array[] = "string";

	which get converted by XSTR into

		char array[] = (&xstr[N]);

	This causes our compiler to issue a warning message and seems like
	rather a dangerous construct (I am not even sure it is even legal).
	The following is however ok:

		char *array = (&xstr[N]);

	I converted a few of the array[] to *array to avoid this class of
	problem.  The EDCAP initialization remained a problem; the question
	is, is XSTR worth all this?  It makes the compile go MUCH slower,
	but how much memory does it really save?

	no xstr	text	data	bss	dec	hex
		267264	56320	115556	439140	6b364
	xstr	text	data	bss	dec	hex
		267264	55296	114832	437392	6ac90
			-----   ------  ------
			 1024      724    1748

	For less than 2K I don't think its worth it.  Bye bye xstr, at least
	for now.  For comparison, here is CL1.x (current version, no eparm):

		text	data	bss	dec	hex
	cl1.x	237568	49152	109744	396464	60cb0

	There was a time once when the CL fit in a 64K partition.  Now the
	CL grows by almost 64K every time we add a new feature!

--------------------------
Phase 2: Test and tune CL2

history.c
	Removed the "#ifdef ST" dealing with the logfile.  Put a compile time
	switch called SHARELOG in config.h.  Define this when history.c is
	compiled if logfile sharing amongst processes is desired.

BUG - system package is not getting defined at cl startup time
	parser never sees the 'package' statement in system.cl

	Found it - in decl.c, the procedure procscript() tries to seek to the
	beginning of the current line with the statement

		fseek (fp, ftell(fp), 0L);

	This is illegal in UNIX and in IRAF too, since LIBC emulates UNIX
	with very few exceptions.  What this does is seek to the current
	position in the file; the file pointer is not moved.  I think the VMS
	kernel has a bug.  The original SIRM specified that ZNOTTX returns
	the offset of the current line, rather than of the next line;
	I changed that long ago to be consistent with UNIX and other systems
	and sent you all some mail noting the change.

	How many occurrences of this bug are there?

	    decl.c:	fseek(fp, ftell(fp), 0L);
	    decl.c:		fseek (fp, posit, 0L);

	Only two in CL.  Fixed; will fix VMS kernel later.

BUG - in eparam.  Eparam is not catching interrupts.  When an interrupt occurs
	eparam is simply interrupted, leaving the terminal with echoing turned
	off in raw mode, reverse video, etc.  Evidently the VMS text file
	driver is turning off interrupts in raw mode, i.e., returning <ctrl/c>
	to the program as a character rather than generating an interrupt.
	Eparam 'knows' this and hence does not post an interrupt handler.

	The easiest fix is to change the UNIX text file driver to behave the
	same way in raw mode.  The problem is that editors generally work in
	raw mode but do need to be able to catch interrupts.  There are some
	subtle problems to be solved to provide a nice interface that does
	all this.  I will make the following changes to the kernels to fix
	the problem.

*********************************************************************
Kernel change

    [1]	The terminal is placed in raw mode when ZGETTX receives a request
	to read 1 character (rather than, e.g., SZ_LINE characters).
	In raw mode echoing is turned off, control codes are not mapped
	by the OS driver (e.g. CR to newline on UNIX systems), *interrupt
	is disabled and the interrupt code or codes are returned like
	any other control characters*, and each character is returned as
	it is typed, one at a time.

    [2] Raw mode is terminated when any of the following events occur:

	    - When a ZGETTX call is issued to read more than a single
	      character.

	    - When a special escape sequence is "output" with ZPUTTX.
	      The sequence is arbitrary and should be chosen such that
	      it does not conflict with the sequences used by the terminal.
	      The sequence is only recognized when passed as a record,
	      i.e., ZPUTTX checks for the sequence only if called to write
	      exactly the number of characters in the sequence.  The sequence
	      is recognized and filtered out whether or not raw mode is in
	      effect.  The actual escape sequence selected is "\e-rAw"
	      (5 characters) where \e signifies ESC (escape).

	Output of a newline no longer disables raw mode.  This eliminates the
	need to scan the output for occurrences of newline when raw mode is
	in effect.


Raw mode is turned on and off by the character count, rather than by a
control function, so that the terminal interface may be totally data driven.
The result of a data driven mode switch is that a process may easily command
raw mode in a remote process or on a remote node in a network, without
complex special control codes.
*********************************************************************


os/zfiotx.c (UNIX)
	Changed to disable interrupts during raw mode.

sys/fio/fseti.x
	If the operand FD is STDIN  fseti(fd,F_RAW,NO)  will now send the
	sequence \e-rAw to STDOUT followed by a flush to immediately turn
	raw mode off.  If FD != STDIN but has write permission than the
	sequence is sent to FD.

lib/chars.h
	Added a new define called INTCHAR to define the interrupt character
	for SPP programs.

sys/gio/stdgraph/stgrcur.x
	Will now terminate the cursor read when INTCHAR is received.  The old
	interrupt handler was left in for the time being.  Also added a
	putline call to write two null to the terminal after turning raw mode
	off with FSETI, to physically turn raw mode off in case the CL is
	interrupted before normal iraf i/o to the terminal occurs.

pkg/cl/builtin.c
	Removed the ifdef vms around the beep, clear, etc. tasks.  For the
	moment the ifdef remains for the magtape allocation code but I will
	get rid of that soon too.

pkg/system/
	Removed the beep, clear, sleep, and time tasks from this package since
	they have been moved into the CL language task.

pkg/cl/edcap.c
	Changed show_edithelp to sort the command list and print it in two
	column format using STRTBL (like the package menus).  This makes it
	easier to find commands in the list, and duplicate entries (e.g.,
	several different ways of moving down) appear in the same place in
	the table.

pkg/cl/eparam.c
	Displaying a large parameter set seemed slow, particularly when
	toggling back and forth between the help screen and the parameters.
	I tried to speed it up by optimizing the e_display_key routine to
	output fewer characters; helped only a little.  The name of
	E_DISPLAY_KEY was changed to E_DRAWKEY to avoid a name conflict with
	E_DISPLAY on systems that only keep 7 or 8 characters of a C identifier.

pkg/cl/eparam.c
	The action EPARAM takes when incorrect input is entered is as follows
	(integer value entered for a boolean parameter):

	    [1] message is printed at bottom of screen, says respond with
		yes or no.
	    [2] I type anything.
	    [3] Screen is repainted, then immediately repainted again,
		leaving the cursor positioned to the first parameter even
		though I was several parameters into the set.

	I tried this on both the (unchanged) VMS system and on the UNIX version
	of CL2, with the same results.  Certainly this must not be the way
	errors are supposed to be handled.

	I changed the error handling code to print the error message at the
	bottom of the screen and ring the bell (IRAF uses the bell to bring
	errors to the attention of the user), leaving the cursor at the
	former keyline so that a different value can be entered.  The error
	message is limited to one line of text.

(EPARAM seems to work pretty well now, although I have yet to test the rarely
(used features - multiline prompts, arrays, etc.  Now lets have a look at
(EHIST).


History Editor
------------------------------------

    I added an environment variable EHINIT to initialize the history editor,
with "standout", "nostandout", "bol", and "eol" forming the set of currently
recognized switches.  If EHINIT is not defined at all then history editing
is turned off and the old CSH style history mechanism is in effect.
The history editor is quite useful for its most common function - editing one
line command blocks - but has some serious limitations, as noted below.
Please note that despite all the criticism recorded here, I feel that the
current history editor fulfills its primary function admirably and am quite
happy with it.

The current history editor has two major problems: [1] it cannot emulate VI,
and [2], it is not useful for editing multiline command blocks.  The editor
as coded knows that is an "insert mode" editor, rather than a "command mode"
editor or an editor which supports both modes.  Hence I can prepare an EDCAP
file for part of VI but the commands never get executed, since they are not
escape sequences.  There is no mechanism for switching between command and
insert mode, which VI requires.  In VI one types "i", "a", "A", "o", "O",
"cw", "r", "s", etc. to insert, add, or change characters.  Escape is used
to terminate insert mode and return to command mode.  The current string
editor is always in insert mode (it doesn't know about modes).  In VI there
is no undelete char, word, line, etc.  Instead there is the much more powerful
"undo", which undoes the last modify command, no matter what kind of operation
it was.

Despite the fact that ehist cannot emulate VI, I was able to prepare an insert
mode, control code type EDCAP file called "dev$vi.ed" which is easy for VI
users to learn to use but which does not emulate VI.  This is acceptable for
editing single line history records.

Editing of multiline command blocks does not work well enough to be useful.
True VI emulation is a must for this type of application.  The help feature
does not work for history editing.  Upon returning from help the current
line is drawn in the middle of the help text; if editing a command block,
only that one line is drawn and the rest of the block is editable but not
displayed.  Tabs are common in command blocks but are not handled correctly
by the editor (they are treated as spaces - I added a klude fix to map them
into spaces so that at least the cursor will be positioned correctly).

It would be nice if the command block to be edited could be printed at the
current position rather than at the bottom of the screen, although I realize
there are technical problems in doing this.  Relative rather than absolute
cursor motions should solve the problem and are more efficient than absolute
cursor addressing.

My impression from using the history editor and studying the code is that it
may have been a mistake to try to use the same editor for both EPARAM and
EHISTORY.  The parameter editor is really quite a different beast, more of
a forms editor than a text editor.  All that is really needed for EPARAM are
cursor motions and field replacement (and the help facility).

I would like eventually to have a history editor which emulates VI and and be
used to edit multiline command blocks.  We should strip the current EPARAM
code down, producing a compact package which is used only to edit CL parameter
sets.  A general screen editing facility should be generated from scratch
which has no ties whatsoever to EPARAM (it could be called by EPARAM to edit
withing a single field - parameter value- if desired, but not to navigate
about a parameter set).  The screen editor subroutine, e.g., SCREDIT, would
take as input a sequence of chars and produce a sequence of chars as output,
using a self contained screen editing capability to perform the transformation.

	scredit (in, out, start, editor)

	int	in, out		# input and output file descriptors
	char	start[]		# defines initial cursor position
	char	editor[]	# editor language to be used

Here, IN and OUT are FIO file descriptors which in the case of the CL would
be associated with memory resident strings with STROPEN.  START is a string
symbolically defining the position within the file (line, column) to which
the cursor is initially to be positioned.  Without further study I cannot say
whether the same code should be used to support both command mode and insert
mode editor languages, or whether two separate codes should be used internally.

The SCREDIT facility should be coded in SPP and placed in a system library
since it would be self contained and usable in any program, e.g., in a portable
IRAF text editor, or in a DBIO table editor.

I suggest we leave EPARAM and EHIST much as they are now, for the moment.
I will add the string editor subroutine to the program interface as part
of the DBIO implementation.  When this becomes available, the EPARAM and EHIST
code will be restructured to use the new facilities, and we will also be able
to start providing screen editing in the user interfaces to various IRAF
programs.  In particular, we will then have a simple but useful text editor
as part of IRAF, usable on all IRAF systems (probably limited to small files,
e.g., < 100K) and usable to edit files resident on remote nodes accessed by
the kernel server (this is a problem we currently face with our network here).
---------------------------------------------------

Now we proceed on to the language features.

1. Packages, Tasks, Parameters

    The CL handling of these checks out ok as far as I could determine.
I tried package loading and unloading, verified that package list was as it
should be, storage is being freed as it should be.  The naming syntax
package.task.param.p_field works as it used to.  Parameters may be used in
expressions and set in assigment statements as they used to.  Have not yet
retested parameter indirection, but we have packages that use it so will
find out soon.


2. Expressions

    Simple expressions worked fine, however I did find some problems with
the more subtle forms; these are discussed below in the context of bug fixes.


3. Control Flow

    A goto with an undeclared label causes an access violation.  Trying to
declare the label (with syntax "label:") caused a syntax error.  FOR, BREAK,
NEXT check out.  Haven't checked SWITCH CASE yet.


4. Procedures

    I could not get procedures to work at all, at least when entered
interactively from the terminal.  Perhaps I will try again later, but this
feature is not needed at this point and I have little time.  I always get
the message "illegal variable defn's".  Typing in a procedure with null
arglist and no declarations caused "illegal parser state" after the "begin".
The declaration "int procedure junk()" was a syntax error.

    By the way, there are two reduce/reduce warnings in the grammar.  In case
I don't have time to look into these, I should point out that these usually
indicate a serious problem in the grammar.  Shift/reduce conflicts on the
other hand are normal and are no problem provided the precedences have been
defined properly.
-------------------------------------

pkg/cl/gram.c
	The following statements would fail with a syntax error:

		= gcur		# cl parameter - global graphics cursor

	I can see that the recent introduction of declarations forces us to
	reserve the type specifiers as keywords, else a declaration would
	look like a task statement.  I could not bring myself to change the
	name of either the datatype "gcur" or the global cursor parameter
	of the same name, so I built the damn things into the grammar.
	I hate to do that but we would have a poorer user interface if we
	used different names in the two contexts.  Having to reference
	"cl.gcur" is not acceptable.  The keywords "gcur" and "imcur" are
	now recognized in expressions, permitting both "= gcur" and statements
	like "print (gcur // 'abc')".  The form "gcur=" is however not
	permitted.

sys/clio/clreqpar.x
	Changed the form of a runtime parameter request from "param=" to
	"=param".  Perhaps we can do away with the former type of statement
	at some point, as it is no longer used anywhere.  This was changed
	at this time so that the CL will receive "=gcur" requests rather
	than "gcur=" requests; the latter form will now cause a syntax error
	since gcur is a keyword marking the start of a variable declaration.

pkg/cl/grammar.y
	The declarations syntax looks more complex than it ought to be.
	The parser now has twice as many states as it used to.  This is not
	necessarily a problem but could indicate a "syntax error" prone
	grammar and/or a slow grammar.  The last time I profiled the CL the
	parser turned out to be the biggest consumer of cpu cycles.
	Just turn on yydebug and see how many states it visits to parse a
	trivial statement and you will see why.

	NOTES on the grammar:

	    [1] The form of an initializer should be "var = const" or
		"var = { key=value [, key=value] }", i.e., there should
		always be an '=' following the variable or array specifier
		if there are any initializations, whether or not these
		are compound.

		Always using '=' for initializations should simplify the
		grammar, in addition to making the CL consistent with C
		and SPP+.

		------------------------------------------------------------
		[Added Later]	On second thought I am not sure about this
		one.  I can see why the current syntax was chosen - it is
		because the initializer is a list of assignments rather than
		values as in C.  The syntax is that of a structure with
		initializers for the individual elements, although it does 
		not look like it when entered all on one line, e.g.:

		int param {
			default	= 0,			(alias ??)
			min	= 0,
			max	= 1,
			prompt	= "prompt"
		}

		I missed that earlier - I guess the syntax chosen is the best
		after all.
		------------------------------------------------------------

	    [2] I note that "char" is being used to declare string variables.
		This seems wrong; char is an integer datatype in SPP, as in C.
		There should be an explicit "string" typespec corresponding
		to type "s" in the parameter files.  Note that SPP also has
		a string type.  Syntax, e.g.,

			string alpha = "text"			(1)
			string beta[5] = { "a", "b", "c" }	(2)
			char zeta[100] = "text"			(3)

		In case (1) the length of the alpha string variable is the
		default, e.g., 64 chars.  In case (2) BETA is an array of
		strings, each of the default length.  In case (3) ZETA is
		a conventional character array as in SPP or C
		(****** but the actual amount of storage allocated should
		(****** be 101 chars, as in SPP).

	    [3] It looked like the grammar included some support for array
		constants, e.g.,

			int	array[n];

			array = (1,2,3,4)			(1)

		or
			userproc (a, b, (1,2,3,4), c, de)	(2)

		Case (1) assigns an array constant expression to an array
		variable.  Case (2) passes such a constant in an argument
		list.  If you folks are already doing that, congratulations,
		it is a great idea.  By the way, can the N in "[n]" be a
		runtime variable or an argument, if "array" is a local variable?

		If we are going to support arrays and expressions involving
		arrays in the language (and we already do), then clearly we
		need to support array valued constants as well.

--------------------------------------
Run time testing
--------------------------------------

pkg/cl/builtin.c
	Put checking for error status return back in chdir.
	Deleted all the _static in the procedure declarations.  Why bother?
	Static procedures have caused portability problems, and as long as the
	iraf procedure naming convention is followed (using a package prefix),
	there should be no problem with name collisions with other externals.
	Using static procedure names has one very real disadvantage, namely
	you cannot debug these procedures normally with the debugger since
	the symbol table info aint there no mo.

pkg/cl/opcodes.c
	Deleted all the "_static" and the #ifdef vms.  Add an "o_" prefix
	to all the opcode function names to avoid name collisions with other
	externals.

pkg/cl/config.h
	Deleted the #ifdef vms definition for _static.

lib/libc/libc.h
	No change, just some comments while checking up on LIBC due to a bug.
	There were a couple of things in the VMS libc which I did not keep:
	defines for u_upkstr,u_upksize (not used anywhere, defined locally
	in c_sppstr), and an #ifdef vms to define import_xnames.  I suspect
	the latter was just because someone got lazy - in any event, iraf
	standard does not permit nested includes since I feel include file
	dependencies are potentially very dangerous and should be evident
	from looking at a file.  Also, by avoiding nested includes, it is
	easy to prepare the list of dependency files for the Makelib files.

sys/fio/fstati.x
	Was erroneously using "fp" rather than "ffp" when returning the value
	of F_MAXBUFSIZE.

sys/mtio/*
sys/os/zfiomt.c [UNIX]
	The datatype of the "drive" argument to the MTIO zz-routines ZZOPMT
	and ZZRWMT was changed from integer to character string.  This is
	consistent with all of the other ZOPEN procedures, and provides more
	flexibility in how the drive is named.  The magtape naming convention
	was also changed slightly to reflect this change, e.g., if the magtape
	is named as

		mta.1600[3]

	then file three of magtape unit A will be opened at 1600 bpi.  The
	former syntax was "mta1600[3]".  The significance of the new syntax
	is that everything between the "mt" and the "." (or EOS) comprises
	the DRIVE string sent to the kernel to access a drive.  The contents
	of the DRIVE string are therefore no longer constrained to be "a",
	"b", "c", etc. and the string may be used to convey additional
	information.

	In particular (and this is the primary reason for the change), the
	drive string may now contain a node name prefix, permitting use of
	a drive on a remote node.  For example, to reference logical unix A
	on node "draco" (drive "draco@a") either of the following will work:

		mtdraco@a.1600[3]
		mt.draco@a.1600[3]

	The syntax "draco@mta.1600[3]" would have been more pleasing and
	more consistent with node names in filenames, but the original MTIO
	specifications guaranteed that magtape names passed to MTOPEN must
	begin with the prefix "mt", hence the former syntax was chosen.
	Note that the usual magtape references "mta", "mtb", etc. are still
	recognized (the "." delimiter after the "mt" is optional).

--------------------------------------------------------------------------
KERNEL CHANGES

sys/os/zfiomt.c
	Change the "drive" argument of procedures ZZOPMT and ZZRWMT from an
	integer to a string.  Change device table accordingly to permit
	table lookup via string match.  Use of "a", "b", etc. for logical
	drives on a node is still recommended for consistency, although
	additional flexibility is now possible.
--------------------------------------------------------------------------


sys/osb/mii.x
	Moved each procedure in this file into its own file to avoid loading
	the whole thing in each image.  Modified the low level routines 
	MIIPAK16, etc. to be self contained so that they can be called by
	the user rather than load the entire package.  This involved moving
	the byte swapping code into these lower level procedures.

sys/osb/bytmov.c
	This routine had a bug which was never discovered since we use an
	assembler version instead on the VAX.  Rewritten to eliminate the bug.

sys/gio/gopen.c
dev/graphcap
	Added device "stdvdm" (alias "vdm") to the graphcap.  VDM is the virtual
	device metafile, used to spool graphics output in a file.  GOPEN was
	modified to accept "vdm" as an abbreviation for "stdvdm" and to use
	a default file ("uparm$vdm") if stdvdm is not defined in the
	environment.

sys/gio/stdgraph/*
	Replaced all calls to TTYCTRL with calls to STG_CTRL, to permit use
	of graphcap encode/decode instructions in all graphcap entries.

sys/etc/onentry.x
	Bkg filename was not being packed before call to ZOPNTX.  Noticed this
	in passing; the standard onentry has never been tested as a means for
	running iraf tasks in the background.

-------------------------------------------------------------------------------
Commencing installation of networking software (package KI)
The KI is a sysgen option, not required for operation of iraf.
-------------------------------------------------------------------------------

sys/ki/
	Added package KI (the kernel interface).

sys/os/zfioks.c
	Added a new device driver ZFIOKS, the kernel server device driver.
	This driver is the iraf interface to the networking facilities
	provided by the host system.

sys/cl/prcache.c
	Changed the names of the CONNECT and DISCONNECT procedures to PR_CONNECT
	and PR_DISCONNECT.  The unix networking system library includes a
	connect procedure, causing a library conflict.

lib/knet.h
lib/libc/knames.h
sys/*/*.x
	Added <knet.h> to LIB and added includes of this file to all VOS
	procedures which do kernel i/o.  Added a KNET section to the C include
	file <libc/knames.h>.  These two include files determine whether or
	not a system is to be configured with networking capabilities.
	A system can be configured without networking simply by defined
	"NOKNET" before knames.h is loaded in a C file and by commenting out
	the defines in <knet.h>.

sys/etc/main.x
	The inchan, outchan, device, etc. arguments passed to the IRAF Main
	by ZMAIN refer to the real kernel; if networking is used these must
	refer to the kernel interface instead.  A subroutine call was added
	to map these values is networking is in use.  This was done in such
	a way that the kernel itself did not have to be modified.  One of the
	goals of the kernel interface design was that the KI shall require no
	modifications to the kernel beyond the addition of the ZFIOKS driver.

sys/etc/envnext.x,environ.x,Makelib
	Two new procedures env_first and env_next were added to the environ
	package to permit traversal of the environment list by external
	programs.

sys/etc/envscan.x
	Changed to use stropen to open the input string as a file, so that
	a string buffer containing many set statements may be processed in
	a single call.

sys/fio/getline.x
	Getline was assuming that ZGETTX returns an EOS delimited string;
	this just happened to be the case with the unix kernel, but is not
	required by the si specs.  Changed to EOS delimit the string using
	the count returned by zgettx.

sys/libc/ckimapc.c
	Added ki_mapchan to LIBC to permit recovery of the host system channel
	code or pid and node name in the CL, e.g., for "prcache" output.
	Note that when the KI is in use KI channel numbers are returned to
	the VOS rather than OS channel numbers.

pkg/cl/prcache.c
	Modified the prcache output display to print both the OS pid in both
	decimal and hex and the node name.  The display formatting was
	improved to eliminate the blank area associated with the hex number.
	This code will work the same whether or not the system is configured
	with networking enabled.

	The information now printed for each process in the cache is the
	following:

		[v] node@pid(pidX)	bits  processname

	where V is the VOS pid (a small integer, typically one digit), NODE is
	the name of the node on which the process is running, PID is the host
	pid in decimal, PIDx is the host pid in hex, BITS are the process
	status bits (hibernating, running, etc.), and PROCESSNAME is the
	name of the process.  A process may be flushed or locked by referencing
	either the number V or the name of a task in the process.

dev/graphcap,termcap
	Added a new kernel string type parameter DD to the entry for each
	plotter or printer.  This string is passed to the device driver at
	device open time and replaces the device tables formerly given in
	kernel.h (and should replace the table used in VMS as well).

	The scenario is as follows: the device open procedure GOPEN, LPOPEN,
	etc. (or a graphics kernel such as the NSPP kernel) calls TTY to fetch
	the graphcap or termcap entry for the device.  The value of the
	parameter DD is obtained and passed as the "osfn" argument to the
	device open Z-routine, e.g, ZOPNPL or ZOPNLP.

	The syntax of the DD entry is determined by the device driver.  For the
	existing drivers I have adopted the following syntax:

		:DD=node@device,string,string,...:

	where the comma delimiter may be any character, the value being set by
	the first alphanumeric character following the device name.  The colon
	character : may not be used in the entry, of course, because it is a
	termcap metacharacter.  The node name and delimiter are optional and
	are removed from the string by the kernel interface; the z-routine sees
	only the characters following the node delimter character @.

	The two logical nodes names "plot" and "print" are reserved for use to
	identify the node to be used to process graphics output or print text.
	The graphcap entries, for example, usually reference the "plot" node,
	e.g., ":DD=plot@versatec,...".  The plot node is identified in the host
	name table dev$host (see KI documentation).  If no node has the alias
	"plot", the default node will be used instead, e.g., the local node.

sys/tty
	Given the above revision, it is no longer necessary to place any system
	level information in the environment entries for devices - nobody made
	use of that capability in any case.  The name parsing code in TTY is
	however harmless and will be left in for the time being (in fact I
	extended the syntax for some reason before adopting the graphcap type
	solution).

sys/gio/nsppkern
	Added support for the DD parameter.  The value of this parameter is
	now passed to ZOPNPL at device open time; formerly only the device
	name string was passed.

pkg/system/lprint.x
	Ditto; added support for DD parameter.

pkg/images/display/tv/iisopen.x
pkg/images/display/new/iism70/iisopen.x
	(throwaway or prototype interfaces).  Added explicit node reference
	for the IIS so that the affected programs will work on all NOAO nodes.
	This is good enough for these interfaces since they are due to be
	replaced later this year.  The only change required was to replace
	the (explicit UNIX) pathname "/dev/iis" with "lyra@/dev/iis".

lib/libc/kernel.h [UNIX]
	The device tables for the plotter and printer devices were deleted
	since this information has been moved to graphcap and termcap.

	[Probably there should be printcap, rather than putting the printers]
	[in termcap, but that can wait...				    ]


-----------------------------------------------------------------------------
KERNEL CHANGE

sys/os/zfiopl.c [UNIX]
sys/os/zfiolp.c [UNIX]
	Kernel drivers rewritten to obtain plotter information from the ZOPN
	argument rather than from the kernel.h table.
-----------------------------------------------------------------------------

sys/tty/ttyopen.x
	In the process of revising graphcap and termcap I found and removed
	several unnecessary restrictions on the termcap format.  Blank lines
	are now permitted, a capability entry may now extend over several lines
	and each line need no longer begin with a colon (leading whitespace on
	each line is omitted), and the colon character may be included in an
	entry via a conventional backslash escape \:.  For some reason the
	original UNIX termcap format was more restrictive but I see no reason
	to preserve these restrictions.

sys/gio/cursor
	If the system failed to open a plotter subkernel during a :.snap the
	graphics system would be left in a bad state.  This would usually
	happen when the user entered an invalid device name for the snap output.
	Cursor mode will now recover properly from such an error.

pkg/cl/builtin.c
	Reinstalled builtin task "gflush"; this was lost when the new CL was
	installed.

pkg/cl/errs.c
	Reinstalled call to XER_RESET in errs.c to initialize the error stack
	when error recovery takes place (necessary since the iraf main is not
	being allowed to do error recovery).  There should be a LIBC mechanism
	for doing this.

pkg/cl/edcap.c
	Had to turn off raw mode to print the editor keystrokes because UNIX
	disables output processing of the newlines when in raw mode.  IRAF
	kernel drivers which have to do such output processing themselves
	should also disable such processing when in raw mode, like UNIX.

pkg/cl/main.c
	Added a call to gflush to the shutdown procedure to flush graphics
	output and terminate any graphics subkernels when the user logs out.

pkg/cl/lexicon.c
	Added some context mode logic to recognize [] as command mode
	metacharacters only when they occur on the left hand side of an
	assignment statement.  Hence an array reference such as

		v[4] = 123

	is legal in command mode, as is

		contour m74[*:8,*:8]

	A reference to an array element on the right hand side of an assignment
	is legal since the rhs is interpreted in compute mode.  An array
	reference in an argument list or expression must be parenthesized to
	be recognized as such, like *, /, etc.

sys/gio/cursor/grcpage.x
	The help cursor mode feature used to display a "[hit return to
	continue]" message at the end of the help screen.  This has been
	changed to a more informative message which includes prompts for
	the hidden keystrokes - in particular it is now easy to get cursor
	mode help.

sys/etc/main.x
sys/clio/clcache.x
sys/fmtio/clscan.x
	Added parameter caching to CLIO.  The iraf main now permits parameters
	to be set on the command line when a task in invoked.  If a parameter
	is set on the command line when the task is invoked then CLIO will
	automatically satisfy all CLGET requests with the cached value of the
	parameter without generating a query.

	This is useful for tasks that have many (dozens of) parameters, since
	all of the parameters with values set at task invocation time (e.g.,
	hidden params or params set on the command line) can be cached,
	greatly reducing the number of runtime queries to the CL and speeding
	task execution.  This might save several seconds of clock time when
	executing a task with a couple of dozen parameters, since handshaking
	over the IPC is expensive.

	Parameter cacheing is implemented in CLIO using the new SYMTAB package,
	providing efficient hash table lookup.  This was probably not necessary
	but I computed the object size overhead associated with using SYMTAB
	and it probably only adds 1K or so (SYMTAB is compact).

	The iraf main command line syntax now permits both i/o redirection and
	parameter set arguments of the form param=value and param[+-].
	Whitespace delimits arguments.  Newline may be escaped for multiline
	command blocks.

	For example:

		taskname 3 < $ 6 > mc\
		param1=value\
		param2+

	This executes task "taskname" indicating that the stdin (pseudofile 3)
	has been redirected in the parent (dummy $ filename), stdgraph (6)
	is to be redirected by the iraf main to the file "mc", the value
	of the parameter param1 is to be set to "value" (may be quoted) and
	the value of param2 is to be set to "yes".  In the case of a task with
	many static parameters the CL will pass a command consisting of many
	lines, but it takes only one IPC packet for the entire command block
	hence all the parameters are set with no additional expense.

	-----------------------------------------------------------------------
	*** N O T E ***
	None of this changes the semantics of CLIO in the slightest and the
	changes are all internal.  Note however that as soon as the revisions
	are made in the CL all executables will have to be relinked before
	they can be used with the new CL, or a syntax error will occur due to
	the multiline command blocks.
	-----------------------------------------------------------------------

pkg/cl/exec.c
	Modified task execution via pr_connect() to support parameter cacheing.
	The startup command is now a multiline command, hence all old
	executables must be relinked.  I expect that runtime parameter cacheing
	will be a significant optimization, noticeable even for tasks with
	only a half dozen or so arguments.

pkg/cl/cl.x
pkg/cl/main.c
	Modified to eliminate the reference to the LIBC procedure "c_main",
	used to provide the ONENTRY procedure to gain control during process
	startup.  I moved the ONENTRY into cl.x instead, elimating the funny
	backwards linking used formerly.  The new configuration is straight-
	forward and should be portable.

	At some point I would like to replace this construct by an emulation
	of the K&R C main, i.e., with argc,argv.  This would not be difficult
	and would make it much easier to port C programs to the IRAF
	environment.  XC and MKLIB, for example, could be nice UNIX/C programs
	(actually iraf programs internally) callable from either the host system
	or the CL.  This has been attempted in the VMS version of softools but
	we do not have a good interface yet.

pkg/cl/main.c
	There has been a bug in the system for some time now that goes like
	this: [1] interrupt, nothing happens; [2] interrupt again, CL complains
	about unknown task `xmit', goes through error recovery; [3] IPC
	protocol is trashed and syntax error occurs at next attempt to run
	a task in the affected subprocess, [4] flpr and get write to IPC error
	from child.  I suspect this is due to the way PRPSIO (pseudofile i/o)
	handles the input buffer; the buffer pointers are not updated until
	sometime after the "xmit" command was first read, and an interrupt in
	between states causes the XMIT directive to be read as data by the CL.
	The fix was however not to modify PRPSIO, but to call F_CANCEL on the
	t_in and t_out to the subprocess in ONINT when X_INT is sent to the
	subprocess.

pkg/cl/prcache.c
	In pr_connect, the call to fprintf to format and output the startup
	command to the subprocess was replaced by calls to fputc and fputs.
	Fprintf has a builtin limit on the size of a %s string which could be
	a problem in this application (due to the long list of parameter
	assignments).  Also, the flexibility of fprintf is not needed and
	fputs is more efficient.

pkg/cl/eparam.c
	Recall that in raw mode, no output processing is performed hence
	newlines are not converted into crlf.  Modified the repaint code
	to output \r\n instead of \n (switch to raw mode could also have
	been used).

pkg/cl/history.c
	This code was assuming "ehistory" whenever a command beginning with
	"ehi" was entered, regardless of the characters following the "ehi".
	Hence a command such as "ehinit" would cause ehistory to be run
	instead.  Changed to do a rigorous match.  Any abbreviation is
	permitted, including "e", hence ehistory is a very privledged command
	indeed (I guess that is what was intended, else the normal minimum
	match would have been used instead).

sys/ki/*
lib/chars.h
	The network node delimiter was changed from @ to !, in response to a
	request from STScI.  Either metacharacter will do just as well, but
	! is a bit easier for a touch typist to type, is used for similar
	purposes in other networking software, but is not used in filenames
	on any of our major host systems.

sys/fio/fntgfn.x
	Removed the code for the !...! escape notation.  The decision has been
	made to not implement filename escapes using this notation.
	Conventional backslash escapes will be used instead; the code for this
	is already largely in place and all we really need to do is test it.

pkg/system/edit.cl
	Tried to write a version of the editor script which uses the new array
	stuff to manipulate filename strings.  I entered the declaration

		char	fname[80]

	to define a character array for holding filename.  Turns out the CL
	understood an array of 80 strings, each of some default length.
	This is supposed to be compatible with SPP? (see notes on string
	variables earlier).

	Dropped out into the CL to try some things interactively, since it was
	clear I do not understand the new features.  Typed a "cl" to push a
	new context on the stack; made some declarations; when I typed "bye"
	I expected the variables to go away but they did not.  Should have.
	Tried it again with integer decls and those went away at the bye.
	Cannot redeclare a variable within a block; I understand why but should
	be able to.

	First decl or so worked but then I got a segmentation violation in
	strcmp from paramfind.  Did not look into it, perhaps it is a bug I
	introduced into the CL.  Repeated the experiment somewhat differently
	and it worked fine.

	Logged out and back in to initialize things (ugh).  Typed "char ss"
	to get a char array.  Tried "ss = 'abcdef'; =ss" which worked as
	expected.  Tried "=ss[3]" and it printed the entire string, rather
	than just one char.  Also, if the [3] is a string rather than char
	index, it should have given an out of bounds error.

	Perhaps it was my own undoing (although I don't think I changed much
	that could cause such problems), but even without the bugs I think
	we have a serious problem here.  We need to resolve the syntax and
	semantics of these new features before they are released for people
	to use.

	Here it is:

		char	fname[80]
		int	i1, i2

		while (fscan (file_list, fname) != EOF) {
		    # Determine starting and ending indices of filename.
		    i1 = 1
		    for (i2=1;  fname[i2] != 0;  i2=i2+1)
			if (fname[i2] == '!') 
			    i1 = i2 + 1
		    fname = substr (fname, i1, i2)

		    # Call host system editor. (wanted to use fname[i1]
		    # in arglist but didn't dare).

		    print ("!!", editor, " ", osflags, " ", fname) | cl
		}

	(and I still haven't figured out how to strip node prefixes from
	pathnames in the editor).

----------------------------------------------------------------------------
Snapshot of system sent to STScI
----------------------------------------------------------------------------

dev/graphcap
	Set the multifile count parameter MF to one for the dicomed.
	The default MF count (16) was causing overflow of the scratch area
	since the dicomed frames can be very large.

pkg/cl/main.c
pkg/cl/history.c
	A bus error would occur during CL logout when attempting to close the
	logfile.  Removed the "ifdef ST" stuff in main.c (when !ST close_logfile
	was being closed without the logfile name argument, causing the crash).
	Also added error checking and a warning message to the open logfile
	code in history.c, in case the logfile cannot be opened.

sys/os/zfioks.c [UNIX]
	The kernel server device driver was modified to post a handler for
	X_IPC and X_INT during a read or write on a KS channel.  If one of these
	signals occurs while reading or writing a KS channel the signal is
	caught and converted into an i/o error (status ERR) on the channel.

sys/os/zfioks.c [UNIX]
	The KS driver was further modified to use the user login to authenticate
	on a remote node (formerly a fixed public login was used).  The login
	name and password are taken from a file ".irafhosts" in the user's home
	directory on the local node.  If this file is not found a similar file
	in dev$ is read to obtain the name of a public login.  The user may
	instruct the system to query for the password rather than risk placing
	their password in their .irafhosts file, even though the .irafhosts file
	would normally be read protected.

	The format of the .irafhosts file is as follows:

		alias1 alias2 ... aliasN  :  loginname password
		    (etc.)

	If the host alias "*" is encountered the login name and password given
	in that record are used.  If the password "?" is encountered the actual
	password is obtained by querying the user terminal (this will fail for
	a batch job).  Comments lines and blank lines are permitted.

	Since this mechanism is implemented at the OS device driver level it
	is considered to be machine dependent, although it expected that a
	similar mechanism will be used on non-UNIX IRAF hosts.

sys/fio/fwatio.x
	Modified to mark the file buffer empty if an error occurs on a file
	write.  If this is not done then close() will try again to flush the
	buffer during error recovery, possibly causing error recursion.

sys/ki/kbzard.x
	Fixed a typo, ks_awrite was being called where ks_await was intended.

sys/fio/awaitb.x
	The fill code, used to pad reads out to an integral number of chars,
	was being executed even if zawait returned ERR.

sys/ki/kbzcls.x
sys/ki/ktzcls.x
	Modified to not return a close status of ERR if the error bit is set on
	the kernel server channel.  Close is called during error recovery, and
	close would post a second error before the error message associated with
	the original read or write error was output.

sys/ki/ksawait.x
	In the event of an i/o error on the kernel server channel, was setting
	the error bit on the channel when it should have been calling ki_error()
	instead.  Because of this the error recovery designed into the KI was
	not being exercised.

sys/ki/kghost.x
	The syntax of the host name table was changed to a better form which
	is also closer to the form of the irafhosts file.  Formerly the format
	of a line was

		node@server_startup : alias1 alias2 ... aliasN

	This was changed to

		alias1 alias2 ... aliasN : node@server_startup 

	This is more logical since the server startup string is logically a
	function of the node names.  It is also simpler because the startup
	string is delimited by EOL rather than colon, hence it is no longer
	necessary to escape colons to include them in the startup string.

(Rebuilt the image display task and tried it over the ethernet - worked as  )
(advertised.  Speed is only slightly slower than a direct connection.	    )


		*******************************************
		***	            EDIT		***
		*** decent editor interface surfaces !! ***
		*******************************************

pkg/cl/builtin.c
pkg/system/system.cl
	Since the old edit.cl script converts vfn's into pathnames, and
	pathnames now include nodenames, it is no longer possible with the
	current script to edit files not in the current directory.  The edit
	script is glacially slow in any case, and offers a poor interface
	to the host editor.  EDIT has been changed to a builtin task with no
	parameter file.  The editor name is taken from the environment.

	The argument list is a list of strings.  Each argument string is
	filtered through FMAPFN to convert VFN's into OSFN's, and then
	appended to the OSCMD string with a leading space.  Most non-filename
	strings are unaffected by the filename mapping, hence system dependent
	arguments can be passed through to the host editor.  Most importantly,
	this interface allows the editor to be called up about as fast as an
	OS escape or even a host command language call.

	To edit a list of files (note each file is a separate argument, unlike
	most iraf commands):

		cl> ed file1 file2 file3

	To edit via a template:

		cl> ed *.x

	Note that this template is merely a string to the editor interface,
	i.e., it is expanded by the host editor rather than by IRAF.  Filename
	mapping is passing the character * on through unchanged - it is not
	a VFN metachararacter.  This is fast and (at least on UNIX) is a much
	better interface to the host editor, since the host editor will retain
	its context when called once to edit a set of files, but will lose its
	context when called N times to edit N files.

pkg/cl/builtin.c
	A new task BACK has been added to the language package.  BACK is used
	in conjunction with CHDIR (aka cd) to return to the previous default
	directory.  BACK;BACK toggles between two directories.

sys/libc/cfpath.c
	Added C_FPATHNAME to the LIBC interface (req'd by BACK).

	NOTE -- It would be useful to be able to define "cd" as "chdir",
	"pd" as "back", "pwd" as "cd;back", etc., etc., in one's login.cl
	file.  Given that we now have string pushback in FIO (ungetline)
	and general hashed symbol table facilities (SYMTAB), little work
	remains to implement DEFINE in the CL.  Note that SYMTAB maintains
	its database in a position independent form suitable for passing
	to bkg CLs.

	BUT -- The semantics of the CL define facility, in particular the
	scoping rules, have yet to be worked out.

pkg/system/system.cl
pkg/system/help/*
pkg/help (defunct)
	Moved the HELP directories from pkg$ to pkg$system.  Merged x_help.e
	into x_system.e.  Hence, one executable now contains all of the
	system tasks required by the typical user.  The intention is that
	the x_system.e process be locked in the process cache upon login.
	HELP, DIRECTORY, TYPE, PAGE, etc. will then be perpetually available
	without having to do a process spawn (although on a busy system
	considerable pagein may be required if the process has been idle for
	a while).

	TODO -- Rework HELP to use the new SYMTAB package to maintain the
	help database.  This will greatly speed up the database search,
	the main efficiency bottleneck remaining in HELP.

	TODO -- All VMS IRAF process should have a large page fault cluster
	(and large working set size) to decrease pagein time, due to the large
	text segments involved.  Shared libraries would be even better...

lib/login.cl
	Added commands to the default login.cl file to spawn the system proc
	and lock it into the process cache (leaving 3 open slots).  Also
	cached pfiles for directory, help, type, and page.  In combination
	with runtime parameter cacheing and the fast edit this should produce
	a noticeably faster system.

	NOTE -- The MKIRAF host system task should use (does use on UNIX) this
	default login.cl file as input.  When the new version of the system is
	released we should request that all users run MKIRAF to insure that
	all the new goodies are functional and that the user's old parameter
	files do not cause problems.  When installing a new version of the
	system it is possible for a user's obsolete parameter file to test
	as newer than the package parameter file, since the user's pfile is
	updated continually.  This can cause a task to abort myseriously with
	no obvious connection to the pfile.

pkg/system/doc/*.hlp
	Changed all manual pages to reflect the recent change to command
	mode as the default input mode of the CL.  The SYNTAX of the command
	in the USAGE section is given formally using parens, commas, and
	square brackets (for optional args).  This is arguable; perhaps the
	parenthesis and commas should be dropped from the syntax.  Only the
	positional arguments are shown in the command syntax.  The EXAMPLES
	are given in command mode and typical abbreviations are permitted.

	(The System seemed noticeably more responsive when editing all these
	(help files.)

	NOTE -- The new manual pages in the language package are written
	in style inconsistent with that of the rest of IRAF (not SDAS).
	They should either be brought into conformance with the rest of the
	system, the standard manual page format should be amended, or some
	combination of the above.

	NOTE -- All manual pages for the IRAF applications packages will be
	updated within the next couple of weeks.

BUG IN CL PARSER
	While not strictly speaking a bug, this is a serious problem.  The
	CL recognizes "for", "next", etc. as keywords regardless of their
	position in the input text.  Use of these strings as parameter or
	task name abbreviations or as data strings causes an EXTREMELY subtle
	syntax error, which most users will be unable to cope with.  Perhaps
	some additional context sensitivity in the lexical input is required.

pkg/cl/history.c
	Using the existence of the "ehinit" environment variable to trigger
	automatic editing of the recalled command is incorrect.  If the user
	does not wish to verify and/or edit when using the normal history
	mechanism, they should still be able to define EHINIT to set the
	parameters for EHISTORY.  The solution was to change the history
	code to autoedit recalled history records only if "ehinit" is defined
	and the switch "verify" is included in its value string, e.g.,

		set ehinit = "nostandout eol verify"

	If autoedit is not desired the verify keyword may be omitted, or
	alternatively "noverify" may be substituted.

pkg/cl/history.c
	A long standing bug in the history mechanism was fixed.  The bug would
	cause a history record to be trashed every now and then; the record
	would print as garbage and would be unrecoverable.  The cause of the
	bug was the fetch_history() function, which was unaware that it was
	reading from a circular buffer.

sys/gio/cursor/prpsio.x
	Fixed a horrendous bug in PRPSIO that I am sure has been there for
	months (the bug is still present in the old system; I have been working
	at the system level for ages so was not aware of it).  The bug would
	cause the CL to hang up during error recovery following an interrupt
	of a subprocess.  It would be necessary to interrupt twice and then
	flush the process from the cache, because the IPC protocol would be
	trashed.

BUG (unresolved)
	Twice now the CL has gotten into a funny state where it can no longer
	map any filename.  This bug is NOT present in the old system.  I have
	not been able to trace the bug down yet (it does not happen very often),
	but it is quite serious as the user must log out when it occurs.
	The symptoms are misleading; it appears to be a bug with FILEWAIT but
	in fact it is more serious.

pkg/softools/make.cl
	Changed to set IRAFDIR rather than IRAFLIB, since the makefiles now
	build all pathnames using IRAFDIR.

BUG (unresolved)
	Once again, when a subprocess died, the CL (which was reading from the
	process) was fed garbage input in the form of a single letter duplicated
	many times.  The lexical analyzer, given this input, tries to build a
	very long identifier token and overflows its token buffer, corrupting
	memory.  This is awkward to fix since the standard LEX lexical analyser
	does not do bounds checking.  The best solution is probably to not use
	LEX, but use a hand crafted lexical analyzer for compute mode (we are
	already using one for command mode).  YACC is useful, but LEX is 
	generally not worthwhile for production software.

	NOTE: Infinite error recursion occurs when a parser error occurs
	causing error restart.  The ERRLEV variable in main.c, used to detect
	error recursion, is cleared just before the parser is called under
	the assumption that error restart has completed.  I have yet to find
	any surefire way to detect and prevent error recursion.

sys/os/zfmkdr.c [UNIX]
	The MODEBITS are improper for a directory file.  Replaced with a
	mode value suitable for a directory file on UNIX.

----------------------------------------------------------------------------
Snapshot of system sent to ST.
Identical snapshot (minus binaries) saved in lyra!/tmp2/tody (for diffs).
----------------------------------------------------------------------------

sys/mtio/mtgetpos.x
	The pointer "drive" was not being dereferenced as "Memc[drive]" in
	two procedure calls.

sys/ki/kopdpr.x
	The node name of the second filename argument "bkgfile" was not
	being stripped before the call to zopdpr to spawn a detached process
	(e.g., bkg cl) on the local node.

sys/mtio/*.x,Makelib
sys/os/zfiomt.c
sys/ki/(kiextnode.x,kzopmt.x,kignode.x)
	The revised MTIO was tested and a number of bugs were found and fixed.
	Since I already had to do that I went ahead and changed the drive name
	syntax to

		node ! mt...

	The explicit test for a "mt" prefix to determine if a file is a MTIO
	file or not (as is currently done in many of the DATAIO programs) is
	now considered a violation of the MTIO interface.  A new integer
	function MTFILE has been added to the interface to perform this test
	without need to build explicit knowledge of the filename syntax into an
	applications program.

		YES|NO = mtfile (filename)

--------------
26 Aug 85

sys/gio/cursor/prpsio.x
	When reading 0 chars from a stream, would return 0 as function value.
	Changed to return EOF when 0 chars are read, since that is what the
	caller expects.

sys/mtio/mtalloc.x,mtdealloc.x
	These routines were not dereferencing the pointer "drive".

--------------
27 Aug 85

sys/ki/kzwrmt.x
	Was calling zawrbf when it should have been calling kzwrmt.

sys/etc/(sysid.x,gethost.x,Makelib)
	Added GETHOST; high level interface to zghost.
	Added SYSID, used to format labels for various type of output,
	    e.g., plots.  Returns a string which identifies the version of IRAF,
	    the user, the host machine, and the time and date.
	SYSID should be used routinely to label science plots and other output.

sys/etc/envscan.x
	Envscan would truncate the value string at the first whitespace
	encountered, even if the value string was quoted.  This bug has been
	lying there undiscovered since the code was first written.

sys/fio/fmapfn.x
sys/fio/vfnmap.x
	Modified FMAPFN to return a legal host system filename if the file
	resides on the local node, i.e., the node name is stripped from the
	osfn if the file is local.  FPATHNAME should be called if an absolute
	pathname, including node prefix, is desired.  The packing action of
	vfnmap was a nuisance here.  Vfnmap was split into two procedures,
	vfnmap (unchanged) and vfnmapu (vfnmap w/o packing of the osfn).
	Fmapfn now calls vfnmapu to get an unpacked OS filename.  (this packing
	and unpacking is of course a mess - everything should be unpacked until
	the kernel is called).

	[This bug was discovered when trying to edit with "ed lib$*.h" - the  ]
	[resultant unix command was "vi lyra!/tmp3/unix/lib/*.h" which would  ]
	[have worked were it not for the node prefix.			      ]

---------------------
28 Aug 85

sys/mtio/mtfilspec.x
	The generalized magtape name syntax turns out not to be quite upward
	compatible with the orignal syntax.  An old name such as "mta1600"
	must be given as "mta.1600".  There is no good reason to subject the
	users to such a forced change in the syntax, hence mtfilspec.x was
	changed to be compatible with the old syntax while still permitting
	general drive name strings.  The new rule is: [1] if the first character
	following the "mt" is a letter, the drive name is a sequence of letters
	delimited by the first nonalpha; [2] if the first character following
	the mt is not a letter, it is taken to be the drive name delimiter
	character and characters are accumulated until the delimiter is
	reached.

	The result is the obvious syntax, e.g.:

		mta,  mta1600,  mta1600[1],  (etc.)	# local node
	or
		node!mta,  node!mta1600			# remote node

sys/os/doc/os.hd
	An error in the pathname for the logical directory doc was preventing
	access to the OS manual pages via help.

	USAGE NOTE - When you recompile the help database you must flush the
	system task (containing HELP) from the process cache before the
	changes take effect (the old database may still be in a buffer in
	the process memory).

sys/fio/fwtacc.x
	The file wait code was not correctly testing (via FINFO) for a file's
	permanent access permissions before entering the wait loop to wait
	for access to the file.

lib/finfo.h
	Added defines for the file permission bits.

sys/clio/clcache.x
	If a task has no pfile the CL will send its command line arguments
	on in the command line passed to the IRAF main using the parameter
	names "$1", "$2", etc.  Modified parameter cacheing to support this
	type of parameter to avoid unnecessary CL queries.

-------------------
29 Aug 85

sys/imio/imrdpx.x
sys/imio/imwrpx.x
	The computation of the max physical pixel index, used to check for
	an out of bounds reference, was in error.

--------------------
30 Aug 85

sys/imio/db/idbpstr.x
	A ficticious image header parameter "IM_NAXIS" was being set when
	IM_NDIM was clearly intended.

sys/tty/ttyputs.x
	AND was being called with an argument of type CHAR.

-----------------
3 Sep 85

-------------------------------------------------------------------------------
TODO * TODO * TODO * TODO * TODO * TODO * TODO * TODO * TODO * TODO * TODO
-------------------------------------------------------------------------------
	This is a continuation of a bug report given earlier.  I plan to fix
	this sometime in Sep-Oct before releasing the new system (on UNIX)
	for general use.

	The bug is the syntax error caused by use of reserved keywords in
	expressions and argument lists.  This happens with "gcur", "for",
	"next", "min", "max", etc., etc.  The solution is to add context
	sensitivity to crackident(), the function used to turn idents into
	keywords.  When the parser recognizes a statement it will push a
	new context and the lexical analyzer (crackident in this case) will
	change its actions accordingly.


BUG (cl)
	=gcur aborts with an `EOF while evaluating expression' when EOF is
	returned in a cursor read.  Should just return "EOF".  I fixed this
	already in the old system and will transfer the fix to the new CL.


----------------
08 Sep 85

sys/fio/awaitb.x
sys/fio/await.x
	This is not really a bug, but a logical inconsistency.  AWAIT, when
	called after an AREAD has completed, is supposed to zero fill the
	last char of data if the number of bytes read was not enough to fill
	a char.  The filling operation was being performed in AWAITB instead
	of AWAIT, but it does not make any sense for the byte oriented routine
	to be zero filling chars.  The zero fill code was moved from AWAITB
	to AWAIT.

-----------------------
17 Sep 85

lib/fio.h
fseti.x
prpsio.x
	Raw mode to the terminal from a subprocess via the CL was not working,
	it was never being turned on in PRPSIO.  Added code to turn raw mode
	on and off to PRPSIO.  Moved define for RAWOFF from fseti.x to fio.h
	so that it could be used both in fseti.x and prpsio.x.  (tested)

sys/gio/gki/gkigetwcs.x
sys/gio/cursor/gtrctrl.x
	Discovered that APPEND mode (gopen) was never tested.  In append mode
	the subprocess reads the world coord information back from the CL via
	the PSIOCTRL pseudofile.  gki_getwcs had a bug; I also changed the
	operation to return the WCS data without a header on the process CLIN,
	which is easier than trying to return a SETWCS instruction via the
	pseudofile, as the GIO specs state.  Only system code uses the GETWCS
	instruction so this mod should not affect any existing software.

-----------------------
20 Sep 85

sys/etc/main.x
	The main was calling clc_mark once and then calling clc_free after
	each task call to free storage, without doing another mark.  This
	is illegal because clc_mark calls STMARK which creates a marker
	in the symbol table.  STFREE frees this marker; calling STFREE
	again without another STMARK causes whatever was at the marker
	position to be used as if it were a marker, causing the symbol
	table pointers to be corrupted.  The solution was to add a call
	to mark after the call to free in the main, e.g.,

		call clc_free (clc_marker)
		call clc_mark (clc_marker)


------------------------
27 Sep 85

pkg/softools/mktags.x
	A new task MKTAGS was added to the softools package.  This task will
	find all procedures declared in a set of files, printing either
	[1] a sorted listing giving for each procedure the name, source
	file, line in the file, and the declaration, or [2] a "tags" database
	file, used by VI to edit procedures rather than files.


------------------------
8 Oct 85

sys/clio/gexfls.x
	This file was moved from GIO to CLIO to avoid a library conflict.
	The object module is referenced by code in libsys but formerly it
	was archived in libex, which is searched before libsys at link time.

sys/tty/ttyputs.x
	PUTC was being called to write the value returned by the integer
	function AND, causing an integer argument to be passed to a procedure
	expecting a short integer argument.  Changed the PUTC to PUTCI.

------------------------
9 Oct 85

sys/vops/absu.x
sys/vops/Makefile
sys/vops/vops.men
sys/vops/vops.syn
sys/vops/ak/Makelib
	Added a new vector operator ABSU for block-summing a vector (like a
	block average but not normalized).

pkg/cl/config.h
	The size of the CL dictionary was increased from 15000 to 20000 due
	to dictionary overflow in a large script.

pkg/cl/exec.c
	The parameter cacheing code would pass the ")param" literal value of
	an indirect parameter, rather than the value of the referenced
	parameter.  Changed to not cache parameters which are indirect.

pkg/cl/opcodes.c
	When testing the previous bug fix the CL crashed in debug mode due
	to an invalid OT_STRING test inside an if(cldebug) block in procedure
	o_inspect.  Changed to ((p_type&OT_BASIC)==OT_STRING) which should
	fix the problem.

-----------------------
13 Oct 85

sys/ki/irafks.x
	The kernel server would die on a segmentation violation when it
	received a garbage datagram, due to lack of error checking on the
	p_sbuflen parameter used to unpack the text buffer.  Added a min(SZ_SBUF
	to prevent this.

sys/fio/fredir.x
	Added a subprocedure FREDIRO which is like FREDIR, but redirects a
	stream onto an already opened stream. (10/23)

sys/os/zoscmd.c		[UNIX]
	Minor changes.  Will print error message if stream cannot be
	redirected.  Uses fork instead of vfork when possible for a
	little more speed.  Moved some code to before the fork in the
	hopes of making the apparent ZOSCMD related bug go away; I cannot
	find anything wrong with the code nor make it fail in tests.

sys/os/zpanic.c		[UNIX]
	Panic shutdown messages from bkg jobs are now echoed on the console
	to provide a permanent record.

sys/os/zmain.c		[UNIX]
	SIGTSTP is now ignored in bkg processes.  Hopefully this will prevent
	bkg jobs from being suspended when the CL is suspended.

sys/os/zmain.c		[UNIX]
	Bkg processes are now spawned at a reduced priority.

sys/os/zoscmd.c		[UNIX]
	The local files of the parent were being inherited by the child (SH),
	causing OS commands to fail unpredictably due to no more file
	descriptors.  Added FCNTL calls to close files >=3 if exec succeeds.
	(10/31)

sys/osb/f77pak.f
	OP was not getting set if the loop terminated without seeing the EOS.
	(11/4)
----------
Thu Nov  1 21:23:16 MST 1984

1. CL Modifications

    A new version of the system has been released on all three 4.2 BSD UNIX
vaxes at NOAO.  The system has undergone major revisions, primarily to
remove UNIX dependencies in preparation for the port to VMS.  A number
of enhancements have also been made in the process.  Those modifications
or extensions of most interest to the user are summarized below.

1.1 Process Cache:

    The process cache is the key to good interactive response.  While the
operation of the process cache is completely automated and need not be
understood, the sophisticated user can obtain improved interactive response
by tuning the cache.

	prcache			show what is in the cache
	prcache task [,task]	lock a task in the cache
	flprcache		flush cache (except locked tasks)
	flprcache task [,task]	unlock a task and remove from cache
    
Where "task" is the name of a logical task, e.g. "directory".
When task A is present (locked) in the cache all tasks present in
the same physical process as task A are also cached (locked).
If one locks too many processes in the cache deadlock will occur.  
Flushing a task from the cache initializes the process and may
fix certain classes of bugs.

The process cache is no longer flushed when the current directory
is changed, when the environment changes (except when a
redefinition is uncovered by a bye), or when a task aborts.


1.2 Background Jobs:

    Background jobs are submitted by appending & to the command line,
as has always been the case.  There is a limit on the number of
bkg jobs that can be running at any one time (currently 4).

	cmd &			run command "cmd" in the background
	jobs			show status of background jobs
	service			service a query from the last bkg job
				    submitted
	service N		service a query from job N
	kill N [,M,...]		kill job number N

A bkg job needing service (waiting for parameter input) will
timeout and abort after a set period of time (currently 3 hours).


1.3 I/O Redirection:

    Is now compatible with the cshell, e.g., >& to redirect both the
standard output and the standard error output, ditto |& and >>&.
The standard error output of an OS escape issued from a script
task or subprocess is now redirected properly, hence output from
XC and MAKE may be spooled.


1.4 OS Escapes:

    !command	Now sends "command" to the shell defined by the UNIX
		environment variable SHELL or to /bin/sh if SHELL is
		not found.  The cshell user can therefore now issue

			! cmd >& spool &

		from within the CL.

    !!command	Always sends the command to the Bourne shell (/bin/sh).


1.5 Timing Tasks

    The cpu and clock time consumed by a compiled task may now be
measured by prefixing the task name with a $, e.g.:

	set | $sort | $match tty | $count

The times given are measured by the IRAF Main and hence do not
include the overhead of process initiation if it occurs.  This
feature is currently only available for external compiled tasks.
It is not currently available for script tasks, intrinsic
functions, or builtin tasks.


1.6 Package Loading and Logout

    The original package loading protocol has returned without the
drawbacks of the original.  When you type the name of a package
the package will become the "current package" (first package
searched when looking for a task), the prompt will change to
reflect the new current package, and a "bye" will be necessary
to return to the package.  It is no longer necessary to issue
a whole series of "bye" commands to log out of the CL, just
type "logout".

	packages		name the packages currently loaded
	??			print menus for all loaded packages
	?sys			print menu for (e.g.) package 'sys'

A package is "loaded" by typing its name, making the tasks
therein known to the CL.  Any number of packages may be 
simultaneously loaded and referenced without continually
changing the "current package".

Programmers: use the new "clbye" in package script tasks in
place of "cl" if the "cl" is the last command in the file,
i.e., if there is no epilogue.  This saves a file descriptor.
The function of "clbye" is otherwise completely identical to
that of "cl".


1.7 The Null File, Standard Streams

    IRAF now has a null file, known as "dev$null".  This is useful
for discarding the output of commands.  The null file may be
referenced anywhere an IRAF filename may be used.  The special
files "STDIN", "STDOUT", and "STDERR" are also quite useful.
These reference the standard i/o streams of the task in which
they are found but may be used wherever an ordinary filename
would be used, including in compiled programs.


2. C Runtime Library

3. New Process Control Facilities

4. Environment Facilities

5. Error Recovery

6. File I/O Modifications

7. Formatted I/O Modifications

8. Bit and Byte Primitives

9. Vector Operators

10. Kernel Modifications

11. Configuration Control Procedures


### Revision 1.1 Wed Oct 31 23:29:14 MST 1984 

------------
From: /u2/valdes/iraf/ Fri 13:49:39 02-Nov-84
Package: system
Title: WIDSOUT: dataio and multispec packages
 
The task 'toiids' in the multispec package has been moved to the
dataio package and renamed 'widsout'.  It converts IRAF images to
IDSOUT text format.  It is complementary to 'ridsout'.

------------
From: /u2/valdes/iraf/ Fri 13:54:22 02-Nov-84
Package: plot
Title: _imaxes
 
The task _imaxes, used in scripts dealing with the sizes and number of
dimensions in images, has been moved from the plot package to the images
package.  The plot package automatically loads the images package now.
The reason for this change is that there are possible uses for _imaxes
in scripts, particularly in the imred package, which also use many of
the images tasks but rarely need any of the plot tasks.

------------
From: /u2/valdes/iraf/ Fri 13:58:48 02-Nov-84
Package: images
Title: imcopy and imtransform
 
The tasks imcopy and imtransform have been generalized to allow
multiple input and output image templates.  The parameter names
are input and output respectively.  Each image in the input list
is matched, in order, with each image name in the output list.  If
the input image and output image are the same then the operation
is performed to a temporary file in tmp$ and, when the operation is complete,
the temporary file replaces the input image.  Image sections are allowed
in the input list and are ignored in the output list.  For simple
uses these tasks work just as they did before (except for the change
in the parameter names).  This system is also used in imlinefit.

A help entry is now available for imcopy.

------------
From: /u2/valdes/iraf/ Fri 14:05:18 02-Nov-84
Package: generic
Title: new tasks colbckgrnd and chimages
 
The new tasks colbckgrnd and chimages have been added.  Colbckgrnd is
a companion to linebckgrnd.  They apply imlinefit to determine and
subtract a line by line or column by column background for the specified
images.  They supply a generalized form of a function available on the
CYBER.  The task chimages is a script application of imcopy and imtransform
suitable for in place modifications of images.  This task can trim, flip,
rotate, transpose, and subsample a list of images.  The default function
can be set by the user to always perform the same function on the images
(such as a standard trim and rotation).  Help entries are available for
these and other generic tasks.

------------
From: /u2/valdes/iraf/ Tue 13:13:00 06-Nov-84
Package: images
Title: shiftlines
 
A new task, shiftlines, is available in the images package.  It shifts
image lines by a specified amount.  There are five choices for the
image interpolation and two choices for boundary extension.  See
the help page for further information.

------------
From: /u2/davis/ Thu 16:30:26 08-Nov-84
Package: curfit
Title: curfit mods
 
A piecewise linear (SPLINE1) polynomial fitting function has been added
to the CURFIT package. A new routine CVSET can take coefficients derived
external to the CURFIT package and store them in the curve descriptor
for use by the CVEVAL and CVVECTOR routines.

------------
From: /u2/davis/ Thu 16:35:58 08-Nov-84
Package: local
Title: Imsurfit installed in local
 
A new task, IMSURFIT, which fits surfaces to IRAF images has been
added to the local package. See manual pages for more documentation.

------------
From: /u2/valdes/iraf/ Fri 10:12:52 09-Nov-84
Package: multispec
Title: New parameter in findpeaks
 
A new parameter, edge, was added to the task findpeaks.  This parameter
specifies a minimum distance to the edge of the image for peaks found.

------------
From: /u2/tody/ Sun 21:29:59 11-Nov-84
Package: cl
Title: parameter indirection, enumerated values
 
Two new features affecting parameter access have been added to the CL,
parameter indirection and enumeration of the legal types of a string valued
parameter.

1. Parameter Indirection

    Parameter indirection allows a parameter to take any combination of its
value, minimum, or maximum fields from another parameter.  Indirection is
signalled by an '@' prefixed field in the parameter file, e.g.,

	order,i,h,@param

specifies that the value of parameter "order" is the value of the parameter
"param", which is located by the usual search path (task, package, cl).
More general forms include

	order,i,h,@task.param
and
	order,i,h,@pack.task.param.field

The taskname of the current package my be specified by the shorthand name "_",
e.g.:

	order,i,h,@_.order

states that the default value of the task parameter "order" defaults to the
same value as the package parameter of the same name.

Minimum and maximum fields may be specified in the same fashion, e.g.:

	alpha,i,h,5
	beta,i,h,10,@alpha

Indirection may be overridden permanently via an assignment statement or
temporarily on the command line.


1.1 Caveats

    Indirection requires string storage for the p_value, p_minimum, and
p_maximum fields of a parameter.  String storage for these fields is
allocated only if indirection is specified in the parameter file (except
for the value field of a string parameter which is always allocated string
storage of SZ_FNAME chars).  In general a parameter may not be made indirect
after loading the parameter file.

Multiple indirection is permitted.  Infinite recursion will occur if a
field of a parameter indirectly references itself.  A field of a parameter
may indirectly reference another field of the same parameter.

Implementing parameter indirection was surprisingly difficult and involved
substantial modifications to the CL.  The most common cases have been
tested but further bugs caused by these modifications can be expected to
turn up.


2. Enumerating the Values of a Parameter

    The legal values of a string type parameter may now be enumerated in
the parameter file.  For example,

	device,s,a,"mta","mta|mtb|tty"
or
	order,s,a,"5","3|5|7"

The CL will accept only values enumerated in the list found in the p_minimum
field.  Minimum match abbreviations are permitted, with the CL always
returning the full value of the matched substring.  While enumeration of
values is currently supported only for string valued parameters, integer
values may be stored as strings (with restrictions on the use of such a
parameter in CL expressions) as shown in the example above.

------------
From: /u2/tody/ Sun 22:23:42 11-Nov-84
Package: cl
Title: parameter file names in UPARM
 
The underscore has been omitted from the parameter file names stored in
the UPARM directory.  Old parameter files can no longer be referenced and
the contents of the UPARM should therefore be deleted.

------------
From: /u2/tody/ Sun 22:26:34 11-Nov-84
Package: cl
Title: command mode versus compute mode in the CL
 
A new lexical analyzer has been added to the CL to permit a more terse
mode for entering simple commands.  The CL now distinguishes between two
distinct modes of command input, known as "command mode" and "compute mode".


1. Command Mode

    Command mode is useful when interactively entering commands because it is
the most terse mode of input.  There are few special characters, most strings
do not have to be quoted, and command arguments are delimited by whitespace
rather than commas.  Command mode is permitted only when working interactively,
i.e., it is turned off when running a script task or an external compiled
task.  The features of command mode are summarized below:

    o	Unquoted strings may contain any nonwhite character except "'\(|><{};=#.
	The characters !^&+- may be embedded in strings but are recognized as
	the OS escape, history metacharacter, etc. when the occur in the
	obvious context.

    o	Whitespace delimits arguments, not comma.  Commas may be embedded
   	within argument strings.  For example,

		delete	file1,file2,file.* v+

	would delete all files matching the template given as the first
	argument with verification enabled.

    o	The sequence \c is replaced by the character c.  A lone \ at the end
	of a line causes continuation on the next line.  Quotes may also be
	used to escape characters but a quoted string is a distinct token
	(e.g. argument or value).

    o	The OS escape need no longer appear at the beginning of an input line
	of text, e.g., sequences such as "time;!w" are now permitted.  Newline
	may be escaped when building up long OS escape commands.  When not used
	to escape newline the escape character is left alone, i.e., \c equates
	to \c.  An unescaped newline marks the end of the command.

    o	A string constant appearing on the righthand side of an assignment
	statement need not be quoted.  Only the simple assignment statement
	is recognized in command mode (i.e., += etc are not recognized).

The command mode syntax is consistent with the that of many command languages,
including the UNIX shell and cshell, and VMS DCL.


2. Compute Mode

    The original command form of the CL is now known as "compute mode".
In compute mode arguments must be delimited by commas and general expressions
are recognized.  Compute mode is automatically entered in any of the following
circumstances:

    o	Within parentheses.  Compute mode expressions may be embedded within
	command mode commands.

    o	Within braces.  Command mode is turned off in a compound statement,
	e.g. within the body of a while loop.

    o	Within scripts or when executing an external compiled task.  Command
	mode may not be used within a script; the old compute mode scripts
	need not be changed.

    o	When the CL parameter "lexmodes" is set to NO.  This is currently the
	default since command mode is not fully tested and the documentation 
	all pertains to compute mode.


3. CL Syntax

    The grammar (syntax) of the CL is the same for both command and compute
mode.  Mode switching is implemented by two separate lexical analysis filters.
The lexical filter to be used depends on the runtime context and is selected
upon entry to a command block.

The only change to the grammar of the CL made to implement command mode was
the elimination of the need to quote a string constant appearing on the right
side of an assignment statement.  String constants appearing in assignment
statements within braces ({}) must be quoted regardless of the lexical mode
of the CL.  Conversely, a parameter name appearing on the righthand side
of an assignment statement outside of a block must be enclosed in parenthesis
to be interpreted as a parameter name rather than as a string constant.

This change affects any existing CL scripts which assign a parameter to a
parameter outside of a brace delimited block.  Within a block the syntax
and lexical form of the CL is that of a conventional programming language.


### Revision 1.1 Mon Nov 12 04:42:52 MST 1984 


### Revision 1.2 Tue Nov 13 04:10:28 MST 1984 

------------
From: /u2/tody/ Wed 10:42:07 14-Nov-84
Package: system
Title: help for the system package
 
Thanks to Richard Wolff, manual pages have been installed for the tasks
in the system package.

------------
From: /u2/tody/ Wed 20:46:43 14-Nov-84
Package: plot
Title: graph mods
 
The x-clipping feature lost during the switch to the new system has been
restored.  If xautoscale is turned off and ux1,ux2 are set to points within
the plot, no data is plotted to the left or right of the window.

The default value of the parameter "title" has been changed from "@imtitle"
to simply "imtitle".  The @ was causing parameter indirection with the
result that graph could not find the parameter "imtitle".

This points out a serious weakness of the parameter indirection scheme; the
value of a parameter may no longer begin with an @ as a normal character.
On the other hand it is nice to be able to respond to a query with @param.
This will have to be resolved at some point, hence the current scheme for
implementing parameter indirection must be regarded as experimental.  We are
committed to having the capability, but how it is implemented may change.

------------
From: /u2/tody/ Wed 20:54:07 14-Nov-84
Package: cl
Title: bug fixes
 
The bug involving INDEF's in parameter files has been fixed.  The new MAGNIFY
task and others like now work properly again.  Beware that if you ran any of
these tasks while the bug was active, the parameter file may have to be
unlearned.

------------
From: /u2/tody/ Wed 20:56:30 14-Nov-84
Package: system
Title: allocate, deallocate bug fixes
 
The system tasks allocate and deallocate had two bugs related to the system
modifications made last weekend.  They should be working properly now.

------------
From: /u2/tody/ Wed 22:57:26 14-Nov-84
Package: cl
Title: cl bug fixes
 
The following CL bug fixes have been made.  Examples of statements that
formerly did not work are shown.


Bugs in the new lexical analyzer (lexmodes=yes):

    [1]	spawning background tasks (& at end of line), e.g.,

		make >& spool &

    [2] what is a number, e.g.,

		x = .5

    [3] the ? and ?? tasks work again.  ? anywhere but at the beginning
	of a statement is not special, i.e., ? can be embedded in strings.


Assignment statement bugs:

    [1]	both of the following would formerly fail:

		s1 = [*:16,-*]
	and
		s1 = identifier

Other:

    [1] An invalid CD or CHDIR is no longer passed to a child process.
	This turned out to be a kernel bug rather than a CL bug, but
	should not affect processes other than the CL.

------------
From: /u2/tody/ Tue 22:02:07 20-Nov-84
Package: fio
Title: freadp, fwritep added
 
The two i/o procedures FREADP and FWRITEP have been added to FIO to support
direct access by IMIO of pixel data in the FIO buffers.  These new procedures
are useful in operations where performance is critical, but usage is a bit
tricky hence their use in applications code is not recommended.

	 charp = freadp (fd, offset, nchars)
	charp = fwritep (fd, offset, nchars)

Both routines cause the FIO buffer to be filled with the file buffer sized
file block containing the portion of the file starting at "offset" and
extending for "nchars" chars.  The referenced segment must fall entirely
within a file buffer.  An error action is taken if offset+nchars falls
at a point outside the file buffer, or if the segment referenced is beyond
BOF or EOF.  A char pointer to the first char of data is returned as the
function value.  The referenced data must be used before FIO reuses the
file buffer for a different region of the file.

Successive calls to data segments lying within a single large buffer, i.e.,
which do not result in a file fault, cost about 180 microseconds per call
for FREADP and 240 microseconds per call for FWRITEP on the VAX 11/750.
No seek is required since the file offset is included in the call.

------------
From: /u2/tody/ Tue 22:19:22 20-Nov-84
Package: plot
Title: plot expansion in GRAPH
 
The modifications to GRAPH made to permit proper autoscaling in Y when
specifiying an X subrange of data to be plotted were lost in the disk
crash over the weekend.  This mod has been repeated and plots should be
properly scaled when GRAPH is used to expand a portion of a plot.

------------
From: /u2/valdes/iraf/ Thu 17:37:39 06-Dec-84
Package: images
Title: Enhancements to imarith
 
Imarith has been greatly enhanced.  The enhancements are in performance,
flexibility, and use of lists for operands and resultant images.
Performance has been enhanced by providing type specific operators
to perform the operation in any desired datatype.  If the calculation
datatype matches the operand and result pixel datatypes then no
datatype conversions are performed and the operation is particularly
efficient.  The flexibility enhancement allows the user to select the
pixel datatype of the resultant image(s) and the calculation datatype(s).
Specially recognized datatypes allow defaulting to the datatype of
highest precedence from the operand images or to the datatype of
either operand.  The list enhancement allows either operand to be
a list of images and constants (they can even be mixed).  The
result parameter can also be a list of images.  The number of
operand elements can be either one (in which case it is used repeatedly)
or match the number of elements in the result list (in which case
the elements are match one-to-one).

It is also possible to have the result image match one of the operand
images (apart from sections).  In this case the operation is performed
to a temporary image and, when completed successfully, the temporary image
replaces the operand image being overwritten.

There are options to print the operations being performed as diagnositics
and to print the operations without performing the operation for debugging.

------------
From: /u2/valdes/iraf/ Thu 17:47:55 06-Dec-84
Package: images
Title: Enhancements to imcopy
 
Imcopy has been enhanced to use general image template lists.  The
number of input images can be either one (in which case the input
image is repeatedly copied to each element of the output list) or
or match the number of output images (in which case the image lists
are matched one-to-one).  If the input image and output images are the
same (except for sections) then the copy is performed to a temporary
image and, when completed successfully, the temporary image replaces
the original input image.

------------
From: /u2/tody/ Fri 18:09:13 07-Dec-84
Package: imio
Title: optimized version of IMIO installed
 
Testing of the optimized version of IMIO has been completed and the new
interface installed.  The optimizations improve the efficiency of line by
line i/o, the most common type if i/o to images.  In short, the overhead
required to access the pixels will be minimal provided no image section is
given, datatype conversion is not necessary, there is only one input line
buffer, boundary extension is not in use, bad pixels are not being set to
INDEF, etc.  If all these conditions are true IMIO can skip a lot of code
and the pointer returned by a get/put line or section call will point
directly into the FIO buffer, eliminating a memory to memory copy.  If any
of the fancy IMIO options are used additional expense will of course be
incurred.  There is little difference in the timings for the integer and real
datatypes.

All modifications to IMIO were internal to the interface, hence only relinking
is necessary to take advantage of the increased efficiency provided by the new
interface.  The IMAGES and TV packages have been relinked.  Loading a 512**2
type short image into the image display now takes only 2-3 cpu seconds in
the simplest case (ztran=none).  Clock time for this image load operation is
still a minimum of 10-12 seconds due to the limitations imposed by the UNIX
file system.  Image arithmetic operations typically require several cpu seconds
per operation.  The inefficiencies of the UNIX file system will be overcome when
a low level IRAF static file driver is implemented for 4.2BSD UNIX in coming
months.

------------
From: /u2/tody/ Fri 19:04:42 07-Dec-84
Package: imio
Title: image sections
 
Minor changes have been made to the image section code in IMIO to make the
section notation more deterministic and to remove unecessary restrictions on
the use of sections.  A section of the form [5] no longer refers to the
highest physical dimension of the image; this was nondeterministic and
required advance knowledge of the dimensionality of the image.  In the new
release of IMIO the number of dimensions referenced in an image section need
not match the number of physical dimensions in the image.  If too few
dimensions are specified in the section then the higher dimensions will be
set to 1.  If too many dimensions are specified then the higher dimensions
must be set 1 explicitly or it is an error.

For example, if A is a 2-dim image, A[10:20] is equivalent to A[10:20,1],
i.e., the section is 1-dim.  If B is 1-dim B[*,1] is a legal section but
B[*,2] is not.

------------
From: /u2/tody/ Fri 19:12:41 07-Dec-84
Package: libsys
Title: error recursion
 
A bug has been fixed in etc$xerfmt.x which would cause error recursion when
error recovery occurred under certain circumstances.  The error recovery
code was calling ENVGETS, which takes an error action under certain
cirumstances, causing error recursion.  The call to ENVGETS was replaced
by a call to ENVFIND which is functionally identical but does not query or
abort if it cannot find an environment variable.

------------
From: /u2/tody/ Sat 14:41:37 08-Dec-84
Package: lprint
Title: bug fix
 
The bug which caused LPRINT to output garbage following the normal text has
been fixed for the second time.  Evidently this bug fix was lost in the disk
crash in November.

------------
From: /u2/tody/ Sat 14:44:32 08-Dec-84
Package: libsys
Title: process control bug fix
 
Error checking was missing in PROPEN, used to open a connected subprocess.
This would cause a segmentation violation in the CL when trying to open
a nonexistent executable process file.

------------
From: /u2/hammond/iraf/ Mon 10:58:21 10-Dec-84
Package: dataio
Title: wtextimage installed
 
Task wtextimage has been installed in the dataio package for converting
IRAF images to text files.  The text file written consists of an optional
FITS header followed by the pixel values.

------------
From: /u2/tody/ Mon 17:16:57 10-Dec-84
Package: cl
Title: flprcache bug fix
 
The flprcache (flush process cache) task had a bug that caused it to flush
only the top process from the cache.  The corrected function is to flush
all processes not locked in the cache (locked processes can be flushed if
a flag is set to break the locks).

This bug may have been responsible for background jobs leaving dreg processes
running after termination of the bkg CL.

------------
From: /u2/tody/ Wed 10:33:48 12-Dec-84
Package: images
Title: new package IMDEBUG
 
A new subpackage IMDEBUG has been added to IMAGES.  This is a slightly
cleanup version of the image i/o debugging tasks formerly stored with the
IMIO source.  Tasks MKTEST and CUBE are particularly useful for testing
image operators.  No param files or manual pages are presently available
for these routines.

------------
From: /u2/tody/ Wed 17:45:55 12-Dec-84
Package: IMIO
Title: bug fix
 
The new (optimized) version of IMIO had a bug which was not discovered and
fixed until today.  The bug would cause image sections to be ignored (in
effect).


------------
From: /u2/tody/ Wed 17:48:47 12-Dec-84
Package: images
Title: IMCOPY can now mosaic images
 
IMCOPY has been modified to permit use of an image section on the output
image, which must be an existing image if a section is used.  The input
image or image section will be copied into the output section.  Both
sections must be the same size.  This facility is particularly useful for
mosaicing images, i.e., placing several small images into a larger image
to form a single large image.

------------
From: /u2/tody/ Tue 15:35:41 18-Dec-84
Package: libbev
Title: bug fix in regres.f
 
The Bevington library procedure REGRES had an error in the Fortran source
(a * that should have been a **) causing the coefficient errors to be
computed incorrectly.  The bug has been fixed and the task POLYFIT in
local relinked to use the new version of the library.

------------
From: /u2/tody/ Thu 21:09:02 20-Dec-84
Package: fio
Title: filename mapping bug fix
 
The FIO filename mapping code had a bug which caused the mapping file (used
for long filenames) to be corrupted when deleting a file with a name too
long for the host OS.  The mapping file would be unreadable with a checksum
error following the deletion.  The file vfnmap.x was modified in two places
to fix this bug.  This bug was discovered by the guys at STScI in the
process of testing the new VMS version of IRAF.

------------
From: /u2/tody/ Thu 21:12:16 20-Dec-84
Package: system
Title: obscure bug in the IRAF Main
 
The IRAF Main, when passed a command using i/o redirection on the command
line, would include the newline in the filename used for redirection.
The code which extracts the filename was modified to recognize newline as
a filename delimiter.

------------
From: /u2/tody/ Mon 13:42:05 24-Dec-84
Package: fio
Title: bug fix in the filename mapping code
 
The filename mapping package had a bug causing the mapping file to be left
open when opened for writing but never modified.  Procedure vfnclose in
file fio$vfnmap.x was modified to close and unlock the mapping file in
this case, as well as when it is modified and has to be rewritten.

------------
From: /u2/tody/ Mon 15:20:45 24-Dec-84
Package: spp
Title: portability problems with INDEF
 
Equality comparisions of the form

	if (pixval == INDEF)
	    ...

involve a comparison of two floating point numbers for equality and hence may
not be portable to some machines or to some compilers.  The following macro
has been added to the SPP language definitions to make such constructs more
portable:

	bool = IS_INDEFt (value)

where the "t" stands for one of the standard type suffixes.  One such macro
is provided for each data type, e.g., IS_INDEFS, IS_INDEFR, and so on.  The
macro IS_INDEF with no type suffix is equivalent to IS_INDEFR.  All programs
which make equality comparisons involving indefinites should eventually be
converted to use these new constructs.


### Revision 1.3 Mon Dec 24 22:13:31 MST 1984 

------------
From: /u2/valdes/iraf/ Thu 10:58:27 27-Dec-84
Package: local
Title: imreplace
 
Imreplace has been changed in several ways:

1.  There is no output file.  The replacement operation is done in place.
2.  The input images may have sections to select the part of the image to
    be operated upon.  This eliminates the need for the column parameters.
3.  The lower and upper limits are hidden parameters.
4.  The operation is more efficient.

------------
From: /u2/tody/ Wed 19:30:38 02-Jan-85
Package: fmtio
Title: procedure CTOR added
 
A new procedure CTOR has been added to FMTIO.  This procedure merely calls
CTOD and is provided for the sake of convenience, to avoid having to deal
with double precision numbers in simple conversions.

------------
From: /u2/tody/ Thu 18:54:36 03-Jan-85
Package: images
Title: magnify parameter file replaced
 
The parameter file for the task MAGNIFY somehow got filled with zeros.
I copied the version of the file from /u2/valdes/iraf/images into
pkg$images.

------------
From: valdes$iraf/ Fri 17:42:46 04-Jan-85
Package: images
Title: magnify
 
Magnify has been fixed.  The bug dealt with changing

delta = (x2 - x1 ) / (npix - 1)

to

delta = (x2 - x1 + 1) / npix

------------
From: /u2/tody/ Fri 21:06:39 04-Jan-85
Package: system
Title: new system functions
 
Two new system functions, LOCPR and LOCVA, have been added to the ETC package.
These integer functions are more convenient to use than the subroutines ZLOCPR
and ZLOCVA, and they eliminate the need to call the kernel routines directly
in the higher level packages.  Use of these new functions should probably be
restricted primarily to system code.

------------
From: valdes$iraf/ Thu 15:25:53 10-Jan-85
Package: images
Title: imstatistics
 
When using a large number of pixels the accumulation of the sum of the
pixel values and the sum of the squares of the pixel values may suffer
from roundoff error.  This causes the standard deviation to be zero when
the true standard deviation is less than a percent of the mean.  This
has been improved by changing to accumulation in double precision.

------------
From: /u2/tody/ Fri 12:38:59 11-Jan-85
Package: system
Title: removal of filename restriction in IRAF Main
 
The IRAF Main formerly restricted filenames in the context

	task > filename

to only those filename beginning with a letter.  This prevented the use
of pathnames such as ../filename.  The restriction has been removed and
now the filename may contain any characters except whitespace, newline,
or the redirection characters.

------------
From: /u2/tody/ Mon 10:43:09 14-Jan-85
Package: system
Title: GIO installed
 
The new GIO (graphics i/o) interface has been installed in a system library.
Up to date documentation is available in gio$Gio.hlp.  GIO is functional in
the sense that the library is complete and programs written to use GIO can
be compiled and run.  The CL has not yet been modified to interactively
interpret GIO metacode, however, so GIO can only be used at present to spool
metacode into a file.  Metacode produced in this fashion can be decoded with
the GKIDECODE task in "gio$stdgraph/x_kernel.e" for debugging purposes.
The task STDGRAPH in the same process is a mockup of the stdgraph kernel,
and may be used (noninteractively) to make crude plots on the terminal from
GIO metacode.


### Revision 1.4 Tue Jan 15 04:57:57 MST 1985 

------------
From: valdes$iraf/ Wed 17:45:04 16-Jan-85
Package: images
Title: new output type for imlinefit
 
A new output type for imlinefit has been added.  The output type is called
normfit.  It outputs the fitted line normalized to have a unit mean.  This
is used to generate calibration corrections; for slit profiles in longslit
spectroscopy in particular.  Also the output pixel type is now always real.

------------
From: /u2/tody/ Wed 18:15:15 16-Jan-85
Package: cl
Title: bug affecting list structured parameters
 
A bug fix has been made to 'paramset' to permit setting the filename of a
non-string datatype list structured parameter.  This bug was the source
of the problems experienced earlier this week with NORMALIZE and NORMFLAT
(generic package).

------------
From: /u2/tody/ Mon 23:09:30 21-Jan-85
Package: system
Title: error recovery bug fixes
 
I spent several hours tracking down several of the "bugs" that have been
annoying us when interrupting subprocesses.  Specifically, a task will now
stop spewing out output immediately when interrupted, and interrupt should
no longer get stuck off.

Software modifications:

    [1]	etc$main.x
	Added an fseti call to cancel STDOUT during error recovery.

    [2]	cl$pfiles.c
	Failure to write pfile was a fatal error for some reason; changed it
	to an internal error.

    [3]	cl$main.c
	Calls added to the ONINT interrupt handler for the case interrupt
	of a subprocess:

	    c_fseti to cancel stdout
	    c_prredir to redirect stdin, stdout, stdgraph to 0.  This causes
		etc$prfilbuf to ignore pseudofile directives buffered in
		IPC at the time the interrupt occurs.

    [4]	fio$fseti.x
	The F_CANCEL code in fseti formerly did an LNOTE, LSEEK before
	and after clearing the buffer, to preserve the file offset.
	Removed these to force iop to point to beginning of buffer if
	i/o cancelled.

    [5]	cl$prcache.c
	If a process was interrupted during startup IPC would be trashed,
	causing endless "IRAF Main: unknown task name" errors from the
	subprocess.  Make the call to c_propen in cl$prcache.c a critical
	section to prevent interrupt of the child process until startup
	is completed (a critical section is a section of code which is
	uninterruptable).  The effect of this is noticeable: a ctrl/c typed
	immediately after entering a command which causes a process to be
	spawned will be ignored.

	In the process of fixing this one I discovered a flaw in the
	exception handling code, which is patterned after the UNIX "signal"
	facilities.  The idea was that one could call

		xwhen (signal, newhandler, oldhandler)
		    ....
		xwhen (signal, oldhandler, junk)

	with some code in between, and the oldhander would be restored by
	the second call.  This does not work if the code in between calls
	XWHEN for the same signal.

    [6]	os$zxwhen.c
	A bkg process is spawned with SIGINT disabled.  ZXWHEN would check
	to see if the signal was disabled when posting a new one.  If the
	signal was disabled it would ignore the posting and leave the signal
	disabled.  The bug occurred when ZXWHEN was called to disable the
	signal temporarily to protect a critical section; once turned off
	a handler could never be posted.  Added a "first_time" flag to make
	the test only in the first call to SIGNAL for SIGINT.


Zombie processes are still occuring.  I found and fixed a bug some time ago
which may have solved this problem, but many tasks have yet to be relinked
and hence the fix has not been propagated.  I will relink the whole system
when the visitors currently using the system finish their reductions.

------------
From: valdes$iraf/ Tue 09:04:28 22-Jan-85
Package: images
Title: New task blkaverage
 
A new task specifically for block averaging two dimensional images has
been added.

------------
From: valdes$iraf/ Tue 09:07:32 22-Jan-85
Package: images
Title: Bug fix in sigl2
 
A bug in the sigl2 package for image block averaging and linear interpolation
has been fixed.  The partial blocks at the ends of the image were not
being truncated so that the code was trying to read outside the image.
This package is used in magnify and display.

------------
From: valdes$iraf/ Thu 17:33:02 24-Jan-85
Package: local
Title: fixpix
 
A new task called fixpix has been added to the local package.  It
replaces pixels in a set of bad pixel regions by linear interpolation
from nearby pixels.  The bad pixel regions are specified via a file
(which may be STDIN) by lines of four coordinates consisting of the
first and last columns and the first and last lines of the bad region.
The direction of interpolation is determined by the shape of the region;
i.e. it interpolates across the narrower dimension of the bad region.
This task should be very useful in imred type applications for detectors
with consistent bad full and partial columns and lines.

------------
From: /u2/tody/ Thu 20:25:18 24-Jan-85
Package: system
Title: more bug fixes
 
Many bug fixes have been made in the past two days to make the system more
reliable, particularly where error recovery is concerned.  A summary of
the software revisions follows.

    [1]	fio$xerputc.x
	Would overrun buffer if called repeatedly without a newline terminator.
	Modified to flush buffer when it fills, even if newline not seen.
	Buffer overrun was supposed to be impossible, but it turned out it
	could happen during error recursion.

    [2]	etc$erract.x
	More logic was added to improve the heuristic for detecting error
	recursion.

    [3]	cl$builtin.c
	The CLERROR procedure was modified to pop the last task off the
	control stack.  Both BYE and ERROR signal task termination.  It is
	necessary to pop the task to keep KILLTASK from sending X_INT to
	interrupt a task which has already terminated, if the task is an
	external executable.

    [4]	os$zxwhen.c (UNIX kernel)
	The SIGTERM signal was getting blocked after the first exception,
	causing the process to become uninterruptable.  For some reason
	UNIX identifies the signal as SIGINT in the argument list of the
	exception handler, even though it is the SIGTERM signal which
	was caught.  The handler would unblock SIGINT rather than SIGTERM,
	leaving SIGTERM blocked.

    [5]	cl$errs.c
	The ONINT cl interrupt handler is now reposted whenever CL_ERROR is
	called.  This is necessary as CL_ERROR might be called while interrupts
	are disabled in a critical section.  Additional logic was added to
	detect error recursion.  The tests for an error occurring during
	process startup or shutdown were moved to the beginning of the
	procedure.

    [6]	etc$main.x
	Modified to block interrupts during process startup, to prevent
	loss of sync of the IPC protocol.  Added F_CANCEL calls for the
	standard streams during error recovery.  Added a call to repost
	the standard exception handlers during error recovery (this will
	reenable interrupts if error recovery takes place while interrupts
	are blocked).

    [7]	cl$exec.c
	The test to prevent "bye" from logging out of the CL was not working
	due to a precedence error in the test for a bkg CL.  The CL will once
	again print the "use 'logout' ..." message if one accidentally types
	"bye" in the CL menu.

    [8]	cl$main.c
	The ZDOJMP jump buffer of the IRAF Main is now restored when the CL
	main exits, in case an error occurs during process shutdown.
	A bug was fixed which would cause the LOGGINGOUT flag to be cleared
	when EXECUTE was called to process the logout.cl file.
	New routines INTR_DISABLE, INTR_ENABLE were added to make it
	convenient to protect critical sections of CL code.

    [9]	cl$prcache.c
	The STDGRAPH stream of a task is now initialized to STDOUT by
	default when an external task is connected.

   [10] cl$pfiles.c
	Writing a parameter file is now a critical section to prevent
	learning of truncated parameter files.

   [11]	cl$bkg.c
	The command to be executed in the background is now saved in the
	bkg file header to permit spying on what the task is doing with
	the octal dump program.  Use PS to get the pathname of the bkgfile
	and then "od -c" to print the first few bytes of the file.

   [12] cl$bkg.c
	Various critical sections were identified and protected.
	The filenames of the bkg query files are now generated and deleted
	at bkg job spawn time, just in case there are any dreg files left
	over in uparm from a previous bkg job.  If this were to happen
	JOBS might print a misleading status for the job.

   [13] fio$ delete.x, falloc.x, fmkcopy.x, frename.x, filopn.x
	All code segments that have the VFN database opened for writing
	are now critical sections, and all error checking in these sections
	is done explicitly.  This is necessary to prevent an interrupt from
	corrupting the mapping file, to ensure that the lock on the mapping
	file is removed, and to ensure that the mapping file is closed by
	the process so that the same or another process does not block waiting
	for access to the file.

   [14]	fio$rename.x
	RENAME will now copy the file and delete the original if the ZFRNAM
	(move) operation fails, allowing files to be renamed to different
	filesystems.

   [15]	os$zoscmd.c (UNIX kernel)
	Will now trap interrupts and kill the OS command and then the parent
	process.

------------
From: /u2/tody/ Sat 19:27:06 26-Jan-85
Package: os
Title: zfsubd smartened up
 
The ZFSUBD kernel procedure, used to add a subdirectory to a pathname to
produce the pathname of the subdirectory, has been smartened up to back up
a pathname when the subdirectory is given as "..".  Thus, if the current
directory is "/iraf/sys/fio/" and the subdirectory is "..", the output
pathname will be "/iraf/sys/" rather than "/iraf/sys/fio/../".  The second
form is a legal UNIX pathname equivalent to the first, but it is less
efficient to evaluate and would lead to long pathnames and eventual overflow
of a filename buffer.

------------
From: /u2/tody/ Sat 20:31:59 26-Jan-85
Package: fio
Title: filename mapping bug discovered
 
A filename mapping bug (file fio$vfntrans.x, procedure vfn_translate) has
been discovered and fixed.  The bug would cause sometimes cause a subdirectory
name to appear twice in the mapped filename.  I discovered it when the
filename ".." was mapped to "../..", but the same bug could be expected for
ordinary subdirectory names as well, provided they were recognizable as
subdirectory names and appeared as the last field in a filename.

------------
From: /u2/tody/ Sat 20:41:08 26-Jan-85
Package: imio
Title: modification date was not getting initialized
 
A bug causing the image modification date to not be initialized at image
create time has been discovered and fixed.  The symptom was that the
modify date would show up as zero (=1970).  Tests for invalid minimum and
maximum pixel values would consequently fail since an invalid limits time
would also be set to zero, which would not test as older than the modify
date.

------------
From: /u2/tody/ Sat 20:44:07 26-Jan-85
Package: images
Title: new task MINMAX installed
 
A new task named MINMAX has been added to the IMAGES package.  The new task
is used to compute or recompute the mininum and maximum pixel values in an
image or set of images.  The computed values may be printed, used to update
the image header, or accessed from a CL script.

------------
From: /u2/tody/ Mon 21:26:43 28-Jan-85
Package: imio
Title: error recovery bugfix in IMMAP
 
The IMMAP procedure would not always close the header file when taking an error
action, e.g., when the file opened turned out to not be an image header.

------------
From: /u2/tody/ Mon 21:30:26 28-Jan-85
Package: images
Title: prettyprinting of title strings in IMHEADER
 
The IMHEADER task will now strip trailing newlines and whitespace from
title strings, printing the final string with a single newline.  This
results in a consistent looking title regardless of the DATAIO reader
used to create the image (some readers blank fill to 80 columns, others
add an unneeded newline).

------------
From: valdes$iraf/ Wed 14:52:04 30-Jan-85
Package: images
Title: imsum replaces imaverage
 
The task imaverage has been replaced by the task imsum.  This new task provides
several improvements.

1.  The sum of the input images is provided.
2.  The average of the input images is provided.
3.  The median of the input images is provided.
4.  The output pixel datatype is selectable and defaults to the appropriate
    highest precedence datatype of the input images.
5.  The calculation type is selectable and defaults to the appropriate
    highest precedence datatype of the input images.
6.  When all images are of the same datatype and the calculation is done
    in the same type then this operation is particularly efficient.

------------
From: /u2/tody/ Thu 19:13:33 31-Jan-85
Package: images
Title: new task IMGETS added
 
The new task IMGETS has been added to the IMAGES package.  The new task is
used to get parameters by name from the image header.  The function of the
task is not expected to be greatly affected by the upcoming DBIO mods.
IMGETS returns the value of the parameter as a string in the parameter
"imgets.value".

To coerce this string into some other datatype, e.g., int or real, reference
it in an expression with the either the "int" or "real" type coercion function
(as in F77), e.g.:

	cl> imgets image HA
	cl> = real (imgets.value)
	5.67544
	cl>

Note that the DATAIO readers tend to write the instrument parameters in the
header with upper case names, and you must get the case right.  Use IMHEADER
to list the image parameters if there is a problem.  The following standard
image header parameters may also be accessed with IMGETS:

	       name		       datatype

	pixtype				string
	ndim				int
	len[1], len[2], etc.		int
	min				real
	max				real
	title				string
	pixfile				string

------------
From: /u2/tody/ Thu 19:21:34 31-Jan-85
Package: images
Title: task IMHEADER modified
 
The IMHEADER task has been modified to print the "user area" of an image
header, if nonempty.  The user area should be formatted as a string buffer
containing newline delimited entries of the form "keyword = value" for this
to work properly.

------------
From: /u2/tody/ Thu 19:58:17 31-Jan-85
Package: imio
Title: changes to IMMAP
 
The IMMAP procedure in IMIO has undergone the following modifications to 
support IMGETS, etc:

    [1]	When opening an existing image or a new image, space is always
	allocated for a minimum size user area of 2880 struct units,
	regardless of the value given in the argument list (a larger space
	is allocated if the argument is larger than 2880).  The purpose for
	allocating the extra space is to permit automatic reading of the
	user area regardless of the size given in the argument list, in case
	the image is subsequently referenced in a NEW_COPY mode call to
	IMMAP.

    [2] IMMAP will no longer abort if the size of the user area is different
	than that specified in the argument list.

The choice of 2880 struct units is arbitrary but since this code is expected
to be replaced shortly, I did the easy thing.  The changes should not affect
any existing code.

------------
From: /u2/davis/ Fri 09:03:49 01-Feb-85
Package: dataio
Title: rcamera mods
 
RCAMERA has been modified to read old 9-track camera format where tape files
contained multiple images. A new parameter image_list has been added so the
user can specify which images to extract from a file. The camera header
parameters are now stored in the user area.

------------
From: /u2/tody/ Fri 18:22:40 01-Feb-85
Package: vops
Title: modifications and additions to the VOPS package
 

The following VOPS procedures have been modified:

    [1]	ASOK - selection of Kth smallest element in a vector.
	Calling sequence changed to eliminate the internal vector copy,
	modifying the single vector argument in place.  The procedure was
	tested and a bug found and fixed.

    [2] AMED - median of a vector
	Calling sequence changed to eliminate the internal vector copy,
	modifying the single vector argument in place.  Calls ASOK.  The cases
	npix=1,2,3 were optimized.

    [3] ALTR - general linear transformation of a vector
	Calling sequence modified to add a new constant making the
	transformation completely general, i.e.,

		call altri (a, b, npix, k1, k2, k3)
		b[i] = (a[i] + k1) * k2 + k3

	Examination of the optimized assembler source for the routines actually
	installed in the library showed that the installed routines named ALTRS
	and ALTRR were actually performing the function of AMAPS and AMAPR.
	The names of the assembler versions were changed to AMAP.  A search of
	all IRAF source files showed that the modified vector operators were
	used only in the DISPLAY program, which was also modified.


The following new vector operators were added:

    [1] ALTA - linear transformation via add and multiply
	A variant of ALTR:  b[i] = (a[i] + k1) * k2

    [2] ALTM - linear transformation via multiply and add
	A variant of ALTR:  b[i] = (a[i] * k1) + k2

    [3] AMED3 - vector median of three vectors
	Calculates the vector median of three input vectors, i.e., each
	point in the output vector is the median of the corresponding three
	points in the input vectors.

    [4] AMED4 - vector median of four vectors
	Calculates the vector median of four input vectors.

    [5] AMED5 - vector median of five vectors
	Calculates the vector median of five input vectors.

------------
From: valdes$iraf/ Fri 18:36:01 01-Feb-85
Package: images
Title: Task linefit replace imlinefit
 
The task imlinefit has been replaced by an improved version call linefit.
The improvements are:

1.  Ability to specify the output columns.
2.  Pixels rejected from the fit may or may not be replaced when computing
    the output image lines.
3.  The fitted points may be subsampled by binning them and taking the average
    of the column positions as the ordinates and the median as the abscissas
    for each bin.
4.  The task efficiency has been somewhat enhanced.  Greater efficiency
    enhancements are expected shortly.

The tasks linebckgrnd, colbckgrnd, lineflat, and colflat in the generic
package have been changed to use the new task.

------------
From: /u2/tody/ Sat 14:18:03 02-Feb-85
Package: cl
Title: recent minor modifications
 
The following modifications were recently made to the CL:

    [1]	It was discovered that SCAN and FSCAN would recognize comma as a
	field delimiter in addition to whitespace.  While this might
	occasionally be useful, it prevents the scanning of lists wherein
	the fields contain embedded commas, e.g., image sections.
	The scanner has been modified to recognize only whitespace as the
	field delimiter.

	Todo: recognize quoted string fields.  Add formatted scan capability
	to permit more complex scans.

    [2] The iofinish procedure (exec.c), called when a task finishes, would
	take an error action if an attempt was made to close one of the
	standard streams.  This interferred with the use of the special "files"
	"STDIN", "STDOUT", and "STDERR".  The checking has been removed.
	The checking was put in back when the CL was interfaced to UNIX, which
	will physically close a standard stream if you tell it to.  The IRAF
	i/o system works differently and the checking is no longer necessary.

------------
From: /u2/tody/ Sun 15:58:00 03-Feb-85
Package: os
Title: interrupting a command sent to the OS
 
The ZOSCMD kernel procedure has been modified in an attempt to fix the
bug that occurs sometimes when "edit" is interrupted.  Interrupting a
command like "edit" at just the right point would sometimes leave both
the foreground CL and the forked child CL reading from the terminal at
the same time.  The theory is that this occurs when the FORK system call
is interrupted, a definite possibility since a fork can take a while
for a process as large as the CL.  Interrupts are now disabled before
the fork and reset in the child process before the execl.  The parent CL
is now uninterruptable upon entry to the fork and until the child exits.

I have given up on the attempt to kill a tree of child subprocesses when
an interrupt occurs as there does not seem to be any way to do this in
UNIX (e.g., a kill of a "make" command entered from the CL).  It is easy
to kill the process at the root of the tree, but the children of that
process continue to run.  Using process groups it is possible to kill all
processes in the tree but unfortunately the CL and all processes except
the CSH are killed too.  Perhaps examination of the CSH source will uncover
a way to do this properly.

------------
From: /u2/tody/ Sun 16:11:45 03-Feb-85
Package: softools
Title: mklib buffers changed
 
The MKLIB buffers have been increased by a factor of two to accommodate
larger libraries.  The recent additions to VOPS overflowed the old buffers
(which were set to hold 1000 object modules).

------------
From: /u2/tody/ Sun 19:10:34 03-Feb-85
Package: tty
Title: logical device names
 
The TTY package has been modified to permit logical device names containing
optional subunit, frame, etc. information in addition to the root TERMCAP or
GRAPHCAP name for the device.  This feature is most useful when any of several
units of a device may be accessed, all of which have the same termcap or
graphcap entry.  Thus, for example, we might have devices "versatec.1" and
"versatec.2".

The format and contents of any subfields are device or installation dependent
(the extra fields are passed on to and interpreted by a kernel).  All we
require is that the fields be set off from the root device name by a special
character.  To make such distinctions possible the root device name may contain
only characters chosen from the set [a-zA-Z0-9_+_].

------------
From: /u2/tody/ Mon 22:25:48 18-Feb-85
Package: libc
Title: bug fix to FILBUF in the C runtime library
 
I discovered that a section of code originally put into the FILBUF procedure
in the C runtime library for debugging purposes was never removed.  Two lines
of code were deleted and the library updated.
rev

------------
From: /u2/tody/ Thu 02:33:09 21-Feb-85
Package: os
Title: new devices added
 
Two new logical printer devices were added to kernel.h, "vup" and "vdown",
used to select either the upstairs or downstairs versatec printers.  The
names are the same as used in the UNIX commands vpr, lpr, etc.  A new
plotter device named "dicomed" was added to the system to facilitate debugging
the NSPP kernel, although the host system metacode translator is not yet
installed.

------------
From: /u2/davis/ Fri 15:22:12 01-Mar-85
Package: curfit
Title: curfit mods
 
The CURFIT package has been revised. The routines should now run faster.
A new routine cvacpts has been added (see help facilities).

------------
From: /u2/tody/ Tue 20:14:02 05-Mar-85
Package: system
Title: new task GRIPE installed; BUGMAIL deleted.
 
Following a suggestion from STScI (no doubt under the influence of AIPS)
I have replaced the old, little used BUGMAIL task by a new task named
GRIPE.  GRIPE writes into the file "doc$gripesfile", which anyone can
read, and in addition sends each gripe directly to a designated IRAF
person, currently me, to insure that the GRIPE is read promptly.  Please
feel free to post gripes using the new task to ensure that they get
recorded properly.

------------
From: valdes$iraf/ Thu 11:47:13 14-Mar-85
Package: images
Title: Changes to imcopy
 
Imcopy has been changed as follows:

1.  The output name may be a directory in which case the input images are
copied to the directory.

2.  A verbose option has been added to print each copy operation as it
occurs.

3.  The choice of copying one file to several output files never really
worked and is now not allowed.  Thus, the input is a list of images and
the output must be a list of matching images (the number of input and output
images must be the same) or a single directory.

This task now is similar to the file copy except that the file copy does
not allow matching lists of input and output files.  The help page has
been updated.

------------
From: valdes$iraf/ Tue 18:11:20 19-Mar-85
Package: xtools$imt.x
Title: image template enhancement
 
Tasks which accept image templates (most of those in images and longslit)
may now concatenate strings and templates to form new image names.  This
is particularly useful for forming new output image names based on the
image names in the input image template.  The concatenation operator is
the double slash (//).  Some examples are:

	image			->	image
	image*			->	image1, image2, etc.
	image*[1,*]		->	image1[1,*], image2[1,*], etc.
	image*//.1		->	image1.1, image2.1, etc.
	new//image*//.bck	->	newimage1.bck, newimage2.bck, etc.
	image01\[0-5]		->	image010, image011, ..., image015

To test the image template expansion use the task "sections".
This change is effected in the imt.x procedures in the xtools package.

------------
From: /u2/tody/ Tue 21:35:46 19-Mar-85
Package: osb
Title: string conversion between fortran and spp
 
Two subroutines have been added to the OSB package (the bit and byte primitives)
for converting to and from SPP and Fortran strings.  The new routines are named
F77PAK and F77UPK.  Usage is very similar to the existing STRPAK and STRUPK,
used to convert to and from SPP and C strings.  Unfortunately there is no
standard specifying the representation of strings in different languages, and
all three of the IRAF languages do in fact represent strings differently.

	f77pak (sppstr, f77str, maxch)
	f77upk (f77str, sppstr, maxch)

Note that these routines are only callable from a Fortran subprogram since
there is no (machine independent) way in SPP or C to declare a Fortran string
type argument (the only exception is the use of *" for Fortran character
constant arguments in SPP).

------------
From: /u2/tody/ Sat 14:47:18 23-Mar-85
Package: vops
Title: histogram vector operator added to the VOPS package
 
A new vector operator ahgm[csilrd] has been added to the VOPS package.
The function of this new operator is to accumulate the histogram of a
series of input vectors in the integer histogram output array.

	ahgm_ (data, npix, hgm, nbins, z1, z2)

The range of the histogram is from greyscale values Z1 to Z2.  Pixels with
values outside the range Z1 to Z2 are excluded from the histogram.

------------
From: /u2/tody/ Sat 17:24:55 23-Mar-85
Package: images
Title: graphics added to the imhistogram task
 
The imhistogram task in the images package has been rewritten to use GIO.
The default action is now to compute and plot the histogram of an image
on the standard graphics output.  The histogram may optionally be output
as a list.

------------
From: /u2/tody/ Sun 18:28:56 31-Mar-85
Package: cl, etc.
Title: recent mods
 
A bug in the ABS function was fixed.  In recent weeks many changes have
occurred in that portion of the graphics system resident in the CL, i.e.,
the cursor read code, workstation transformation, pseudofile i/o, subkernel
control, and the stdgraph kernel.  Virtually all of the revisions have been
isolated to the graphics subsystem.  These revisions were not documented
since the graphics subsystem was actively being installed and tested.  Now
that the graphics subsystem is stable I will begin to record revisions to
the subsystem.

Nearly all of the GIO modifications/additions were in the following new
directories:

	sys$gio			GIO library
	sys$gio/glabax		axis labelling and drawing
	sys$gio/gki		graphics kernel interface
	sys$gio/cursor		cursor mode, pseudofile i/o, subkernels
	sys$gio/stdgraph	the stdgraph kernel
	sys$gio/nspp		the nspp kernel
	pkg$plot		task implot added

soon to be added:

	sys$gio/gkslib		gks emulation
	sys$gio/ncarutil	ncar/gks utilities
	sys$gio/display		generic image display kernel

The CL must now be linked with the libraries libcur.a (cursor) and libstg.a
(the stdgraph kernel).  Changes to the CL itself were minor; the QUERY
procedure in modes.c was modified to read the cursor for gcur and imcur
type parameters.  Minor modifications were required wherever the word STDGRAPH
appeared in the old CL.  CL_ERROR was modified to call C_XONERR during
error recovery to give the i/o system a chance to clean things up (e.g.,
turn off graphics mode).

In addition to the graphics directories, minor changes were required in the
FIO, CLIO, and ETC directories.  A new (internal) file type SPOOL_FILE was
added to FIO to support the wierd i/o required by the graphics system.
A new fset parameter was added to find out how man chars remain to be read
in the file buffer.  CLOPEN and ZARDPS in CLIO were completely rewritten to
permit bidirectional i/o on the graphics streams and to add support for all
three graphics streams.  A new stream PSIOCTRL was added; this is used by GIO
to send control instructions to connect subkernels to graphics streams, save
and restore WCS, and so on.  CLOPEN will now direct graphics output to the
null file if a task is run standalone, thus preventing garbage from being
written to the terminal in debug mode.

------------
From: /u2/davis/ Mon 16:26:44 01-Apr-85
Package: images
Title: imsurfit
 
The task imsurfit have been moved from the local to the images
directory. New parameters to permit pixel rejection and region
growing have been addded. The user has the option of fitting selected
columns, rows, subsections or a border around the image.

------------
From: /u2/tody/ Wed 15:56:57 03-Apr-85
Package: cl
Title: parameter indirection
 
The metacharacter used to indicate parameter indirection has been changed
from @ to ) to eliminate confusion with list file indirection in a filename
template.  For example, try setting the CL parameter "s1" to ")version",
i.e., and the command "=s1" will cause the value of "version" to be printed.

------------
From: /u2/tody/ Wed 15:59:39 03-Apr-85
Package: vops
Title: additions to VOPS
 
Two new vector operators have been added to the VOPS package.  The ACNV
operator convolves a data vector with a kernel of the same datatype.
The ACNVR operator is similar but the kernel is always of type real.

	acnv[silrd] (a, b, npix, kernel, kpix)
       acnvr[silrd] (a, b, npix, kernel, kpix)

where
	a[]		pixel array of length npix+kpix-1
	b[]		pixel array of length npix (output, accumulated)
	kernel[]	convolution kernel, type pixel or real

For kpix=5, b[1] would be set to b[1] plus the dot product of the 5 point
kernel and the 5 points a[1:5].  The one dimensional convolution operators
may easily be used to implement higher dimensional convolutions.


### Revision 1.5 Wed Apr  3 23:59:56 MST 1985 

------------
From: /u2/tody/ Sun 17:30:28 07-Apr-85
Package: system
Title: miscellaneous bug fixes
 
A number of bug fixes were made to the system following written bug reports
from STScI (for the VMS port) and CTIO (for the AOS port).  All bugs reported
by STScI were fixed with the exception of the asynchronous file i/o bug,
which will be easier to track down later when we have a system with asynch.
i/o.  In particular the SPP bug which caused '&&' to be replaced by 'jiand'
has been fixed, hence it will no longer be necessary to use the typed functions
andi(), etc. in the VMS version of the system.  The same bug would have cropped
up in AOS.

The bugs reported by STScI are summarized in their report, which is reproduced
below.  I have added comments enclosed in brackets, i.e., [[ ... ]].

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
From stsci Thu Jan 17 08:30:15 1985
Received: by lyra.noao.UUCP (4.12/4.7)
	id AA10600; Thu, 17 Jan 85 08:30:03 mst
Date: Thu, 17 Jan 85 08:30:03 mst
From: stsci (Space Telescope )
Message-Id: <8501171530.AA10600@lyra.noao.UUCP>
To: tody
Status: R

			------------------------
			NOTES file for IRAF (VMS)
			------------------------


Contents:
		1.	Bugs 

		2.	Portability Considerations

		3.	Source file name changes


-------------------------------------------------------------------------------


1.	Bugs 

	/pkg/cl/bkg.c
		In rbkgfile(), following fix:
			... fgets (set, fp) ...    	TO
			... fgets (set, SZ_LINE, fp) ...

	/sys/libc/qsort.c	--	qcmp()    -->  (*qcmp)()
	/sys/libc/cfilbuf.c	--	filbuf()  -->  (*filbuf)()

	/sys/vops/advz.x	--	'$t' missing for generic function
	/sys/vops/advz*.x	--	procedure advz[idx...]

						(extra files ?)
	/sys/vops/ak/aif*.x	--	aiftrrr.x
	/sys/vops/ak/aff*.x	--	afftrxx.x,  afftxrr.x,  afftxxx.x
	/sys/vops/ak/acjgx.x	--	acjgxx.x

	/sys/fio/fdebug.x	--	"int and()" statement missing
	/sys/fio/fputtx.x	--	"int and()" statement missing
	/sys/fio/fgetfd.x	--	"int or()"  statement missing

	/pkg/cl/pfiles.c	--	pfcopyback()
		'pt' was going NULL before 'pf' in a for loop check;
		was changed to check for 'pt' being NULL instead of 'pf'

	/pkg/cl/builtin.c, binop.c, bkg.c, history.c, lexicon.c,
		debug.c, errs.c, exec.c, pfiles.c

		problem getting to next task by doing  'tp++'; due to VMS
		alignment of structures.  Fixed with a macro definition in
		/pkg/cl/task.h  for "next_task()", namely:

		#define  next_task(tp)  \
			((struct task *)((unsigned)tp + (TASKSIZ * BPI)))
		#define  prevtask  next_task(currentask)

[[ not fixed; will be fixed when CL2 is merged (dct) ]]


	/pkg/help/lroff/output.x --	references constant MAX_INT
					"include <mach.h>" statement missing

	/pkg/lists/tokens.x	--	last_nscan() --> last_nscan

	SPP/RPP compiler bug	--

			define  and  jiand	(e.g. in <iraf.h>)

			if (x == FIVE  &&  y == SIX) ...	(SPP)
			if (x == FIVE  &   y == SIX) ...	(RPP)
			if (x .eq. 5  .jiand.  y .eq. 6) ...	(FORTRAN)

		only occurs when a macro is replaced before the '&&', 
		in this case FIVE.

[[ see spp/rpp/rpprat/pbstr.r for fix ]]

	/sys/fio/vfnmap.x
		vfnunmap() -- when an OS extension was (un)mapped to a null
			      IRAF extension, the character count returned
			      was not right:
				(e.g.)	doc.dir --> doc   but nchars = 7
                              This caused problems later on in the directory
	                      task of the system package.
			The fix:
					...   {
				vfn[extn_offset-1] = EOS
				op = extn_offset - 1		<-- was missing
			        }	...

	/sys/fio/vfntrans.x
		filename mapping for directories sometimes doesn't work;
			sys$  -->  drb4:[irafx.sys]sys   instead of
				   drb4:[irafx.sys]
		made a quick fix in zopdir() and zfchdr() to deal with this
		for now; can't seem to locate the exact problem in vfntrans.x

[[ this was fixed sometime ago ]]

	/sys/fio/vfnmap.x
		When deleting a file and the parameter subfiles=yes, and
		no mapping file is currently in directory, a null mapping
		file is (sometimes) created.  Then doing a system.directory 
		fails when trying to read this null mapping file.

		E.g.  cl> delete aaabbb.ccc
			subfiles=yes (default .par file)

			delete() is called with 'aaabbb.ccc' and then
				'aaabbb.ccc.zsf', which is degenerate;
				therefore, if a mapping file doesn't 
				exist, it is created.

		Haven't fixed this yet; not sure about the best way to go.
		Some simple suggestions:

		  --	Could somehow figure out whether the file is being
			added or deleted (i.e. was vfnmap() called from 
			vfnadd() or vfndel()?).  

		  --	Or, whenever a mapping file is created, it has the 
			appropriate header info in it rather than being null?  

		  --	Or, some special case of reading null mapping files?

[[ the mapping file is now deleted if it contains no filenames ]]

	/sys/etc/environ.x
		env_hash()  
			return (sum**2 / CONSTANT)

		causes integer overflow on VMS; changed to:  (for now)
			return ( int( float(sum) / CONSTANT * float(sum) ) )

[[ changed to sum / constant * sum ]]

	arithmetic overflows:
		/sys/etc/urand.x  and  others...

		These seem to occur in a few places, sometimes purposely.
		An easy VMS fix is to use "FORTRAN/NOCHECK file", but it's
		a pain to have to remember which files need this special
		treatment.

[[ no action; overflow in URAND is not supposed to happen ]]

	/sys/fio/
		Seems to be a bug in the file i/o related to writing 
		asynchronously to binary files.  In VMS, this is REALLY
		asynchronous, and it caused problems when trying to write
		the help database;  making VMS do it synchronously (like
		UNIX) fixed the problem, for now anyway.

		It may be that a single buffer is being played with between
		the write and the wait;  at least that's what it looks like
		in some of the binary files that were written -- there were
		missing blocks and misaligned data, which were there when
		displayed on the terminal.  

		I don't think it's a problem with RMS, since double buffering
		was used to test the binary file driver, with success.

[[ no action ]]

	/pkg/system/directory.x
		- call strcat ("$", Memc[template])    -->
 		  call strcat ("$", Memc[template], SZ_FNAME)

		- should sort and output the file name list ONLY 
				if (nfiles > 0)
		  otherwise, an "adjustable array error" occurs in qsort()
		  (i.e. an array with dimension of 0 is passed to qsort,
		        causing VMS to complain)


-------------------------------------------------------------------------------


2.	Portability Considerations


	(life would be easier if most source files and include files did
	 not need to be mapped ... especially C source files)
	
			--	no underscores
			--	only alphanumeric
			--	case insensitive (i.e. lower case)
			--	(9 chars).(3 chars)

	(Notes: Some source file names and references to include files
		had to be changed to create the filename mapping in the 
		first place, see list below.  

		This is not so crucial now, since XC and XPP have been
		written/modified to handle filename mapping.  But, it
		still does cause problems when making bug fixes to source
		files with degenerate names and trying to keep track of
		them with RCS.  Of course, 99% of the mapping problems will
		disappear with VMS V4.0.)

[[ I am considering eliminating all nonportable filenames in the system    ]]
[[ directories, though not in the applications directories.  This would    ]]
[[ make it easier to move the system software, and once the system is up   ]]
[[ the system itself would map the filenames in the applications programs. ]]

	also, directories should be case insensitive:
		/sys/vops/AK	-->  ak
		/sys/vops/LZ	-->  lz

[[ subdirectory names in VOPS, IMIO changed to lower case ]]

	sys/libc/cfilbuf.c	--	filbuf  -->  vfilbuf (VMS)
					since 'FILBUF' gets translated to
					'filbuf' on VMS, not 'filbuf_', 
					which causes a conflict:
						FILBUF and (*filbuf)()


	SPP coding conventions that cause problems for VMS FORTRAN compiler:

[[ the following are all bugs, not SPP features; all have been fixed ]]

	a)  multiple declarations, e.g.

			int  ip
			   ...
			int  ip, this, that

	    files:	/sys/fmtio/ctoi.x
			/sys/fmtio/sscan.x
			/sys/fmtio/chdeposit.x
			/pkg/system/sort.x

	b)  'real' function, e.g.

		real (dval, 0)  -->  real (dval, 0.0)
			/sys/fmtio/gctod.x

	c)  array declarations in procedures, e.g.

		procedure proc1 (array, count)
		type  array (count)
		int   count		# should be BEFORE array declaration
					# (tries to use 'count' as a REAL)
			/sys/fmtio/patmatch.x
			/pkg/utilities/t_translit.x
						makeset(), filset()

[[ all such arrays that I could find are now dimensioned ARB ]]

	and(), or(), not()  -->  andi(), ori(), noti() ???
		lots of references in /sys/fio/ to these procedures 
		(added them for VMS, using andi(),...)
	xor()  referenced in  /sys/vops/...axorki.x
		(added xor() for VMS, using xori())

	FIO
		file mode "APPEND" -- create the file if non-existent??
		UNIX (and now VMS) do this automatically, but system
		reference document isn't clear about this.  Without this
		feature,  /pkg/system/bugmail.cl and revisions.cl  don't work.

[[ kernel should create nonexistent file opened in APPEND mode ]]

	I/O drivers
		ZMAIN passes the EPA of the read driver to IRAF_MAIN() ...

		This is OK in UNIX (and VMS, for now), but may have cases 
		where I/O is to different devices and the drivers are NOT 
		compatible.  (I don't know enough of the internals of 
		other operating systems to say for sure that this is a
		problem, but it seems like it could be.)

		Eg.   STDIN from a file and STDOUT to terminal

		If the file and terminal drivers are incompatible, then
		things won't work.  We may eventually have some problems
		in this area with VMS, especially if we start to support
		some network I/O access.  Eventually, we may store the
		actual read/write function in the channel structure and 
		check it whenever a read/write function is called; that is,
		override the higher level IRAF I/O at the kernel level.

[[ this is unlikely to be a problem and can be fixed at kernel level if nec ]]

	zardlp() function referenced in  /sys/etc/lpopen.x ??
		(added dummy function for VMS)

[[ no action ]]

	modf()  function used in  /pkg/cl/unop.c
		was missing from /sys/libc/
		(added  modf.mar  to /sys/os/ for VMS)

[[ call to modf deleted; modf.mar should be removed from kernel ]]

-------------------------------------------------------------------------------


3.	Source file name changes


	/pkg/softools/boot/spp/xpp/xpp_main.c  -->  xppmain.c

[[ removed underscore in C file name ]]

	Necessary for file name mapping:

		/sys/memio/ty_size.dat  -->  tysize.dat

		/sys/memio/coerce.x, salloc.x, sizeof.x
			include "ty_size.dat"  -->  include "tysize.dat"


[[ used "include <lib$szdtype.dat>" ]]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


In addition, Nelson Zarate at CTIO reported the following minor bugs which
I have fixed.  The AOS port is only just beginning.  Once again a lot of
code compiled with only a few errors.

    [1] libc$cfredir.c
	redundant "int fd" declaration.

    [2] libc$cfilbuf.c, libc$qsort.c
	pointer to function returning pointer to int problem
    
    [3] softools$boot/spp/rpp/rppfor/indent.f77
	local variable LOGICO redefining common variable of the same name.

    [4] softools$boot/spp/rpp/ratlibf/catsub.f
	array argument declaration out of order, as reported by ST in
	other parts of the system.

    [5] softools$boot/spp/rpp/ratlibc/ create.c,open.c
	reference to UNIX stdio hidden structure field _file.  Replaced
	by use of "fileno(fp)".


### Revision 1.6 Mon Apr  8 22:27:58 MST 1985 

------------
From: /u2/tody/ Wed 10:15:40 10-Apr-85
Package: softools
Title: bug in the SPP compiler
 
A bug was fixed in the first pass of the SPP compiler as a result of the
effort to get IRAF running on the Jupiter supermicro system at JPL.  The
bug would cause a spurious "too many strings" error to occur during the
processing of a large number of include files.

------------
From: /u2/tody/ Mon 21:44:33 15-Apr-85
Package: sys
Title: use of ENTRY statement considered harmful
 
In trying to port IRAF to the Jupiter / 4.2BSD system I found that the
F77 compiler on that system could not compile ENTRY statements.  This is
not the first time I have had trouble with compilers and entry statements,
hence I was forced to conclude that use of such statements compromises the
portability of our software, despite the fact that entry statements are
part of the Fortran 77 standard.  I have removed all the entry statements
from the files in the sys$ directories (the system libraries), and am in
the process of removing them from HELP and XTOOLS (the latter so that I can
compile the images package).  Hereafter the use of ENTRY statements in
SPP or Fortran code in IRAF is discouraged.

------------
From: /u2/tody/ Thu 00:21:31 25-Apr-85
Package: gio
Title: new version of NSPP kernel installed
 
The latest version of the NSPP/GIO kernel has been installed.  This version
differs from the previous one primarily in the way it handles put cell array.

------------
From: /u2/tody/ Thu 00:22:52 25-Apr-85
Package: clio,gio
Title: nasty bug found and fixed
 
The nasty bug that was keeping cursor mode SNAP from working has finally
been found and fixed.  The recent removal of ENTRY statements caused this
bug (a memory overwrite bug) to resurface as a cascade of "Warning: cannot
delete file" messages when writing to STDPLOT or PSIOCTRL (bug reported by
both Dyer and Suzanne).  In this form it was straightforward to find and fix.
The bug dates back to the addition of the pseudofiles STDIMAGE, STDPLOT, and
PSIOCTRL to the pseudofile i/o code in CLIO.  The parameter defining the
number of pseudofiles was not increased to allow for these new files,
causing a write off the end of an array.

All graphics applications programs should be relinked to capture the bug
fix.  All such programs are currently overwriting either part of the FIO or
environment list data structures, depending on how they are being used.

------------
From: /u2/tody/ Thu 11:11:36 25-Apr-85
Package: softools
Title: XCOMPILE enhancement
 
The XC task will now produce, by default, an output executable file with
extension ".e", unless the output file name is explicitly set on the command
line with the "-o" switch.

------------
From: /u2/tody/ Thu 22:22:50 25-Apr-85
Package: graphcap
Title: dicomed device entry
 
The graphcap entry for the dicomed device has been modifed to use the NSPP
kernel, allowing it to drive the physical dicomed device.  Formerly the
output was directed to the gkidecode kernel since the low level code was
not then working.

------------
From: /u2/tody/ Thu 22:24:51 25-Apr-85
Package: gio
Title: cursor mode enhancements
 
1. Snap

    The SNAP function in cursor mode is now fully functional.  The cursor mode
snap makes a hardcopy of the graphics on your screen on a batch plotter, e.g.,
the imagen or versatec.  This gives a much higher resolution plot then is
achievable with a video hardcopy device, and of course snap works from any
graphics terminal.  The snap will work at any magnification and will capture
key A style axes, T or D text and lines, etc.  Syntax is

	:.snap [device]

where [device], if absent, defaults to stdplot or to the device currently
connected to the STDPLOT graphics stream, if any (type :.sh to check the
status of the streams).  For example,

	:.sn imagen

makes a snap on the imagen, and

	:.sn

is the shortest form of the command.  It takes only a fraction of a second
to make a snap, but it may take several minutes for it to appear on the
plotter.  Versatec snaps are much more expensive to generate than imagen
ones due to the need to digitize the plots (but the versatec makes prettier
plots).  Avoid generating a lot of snaps to the versatec all at once, or you
will swamp the VAX with "vplot" rasterization tasks.  SNAP does a frame
advance after each snap, hence there is no buffering of the last snap in
the kernel, as is the case for ordinary output to STDPLOT.


With the implementation of SNAP cursor mode is now fully functional.  I do
plan, however, to add a DISPOSE function to flush the last plot out of
STDPLOT.  There are also still some bugs in the cursor mode code waiting
to be fixed, e.g., =gcur before any graphics does not currently work,
nor does it work after a :.init.  The backup and undo commands, used to
discard graphics instructions, do not always erase the graphics at present
(a full screen redraw will however show that the line or text string is
gone).


2. Waitpage

    The [hit return to continue] wait is now implemented as a text mode
getline rather than as a cursor read.  The cursor read would cause a switch
to graphics mode, blanking the text memory on some terminals (giving the
user no chance to read the text).


------------
From: /u2/tody/ Thu 22:42:47 25-Apr-85
Package: gio
Title: nspp kernel
 
The NSPP kernel will now generate lines of different widths.  More precisely,
linewidths less than 1.5 are drawn in "low" intensity, and everything else
is drawn in "high" intensity.  By default, the axes and tick labels of a plot
are drawn in high intensity and the data in low intensity.  Variable lien
widths are not currently supported for the imagen and dicomed.

------------
From: /u2/tody/ Fri 17:38:19 26-Apr-85
Package: gio
Title: more bug fixes
 
The "write to IPC with no reader" bug, which would formerly appear at logout
after a write to a plotter device, has been fixed.  The bug was in the IRAF
Main, i.e., file etc$main.x.  GIO calls ONEXIT to post a procedure which
is supposed to shutdown the graphics system at process exit.  The procedure
posted by ONEXIT was not getting called, however, until the main called
the FIO cleanup procedure, which would close down the graphics kernel
rudely, causing the error messages.  The main has been modifed to call the
ONEXIT procedures before cleaning up FIO.

Typing "=gcur" at login, before generating any graphics, now works.  The
graphics kernel was being opened but the open workstation command was not
being sent to the kernel, hence an attempt to read the cursor would cause
EOF to be returned.

A new builtin task called GFLUSH has been added to the CL package language.
This may be called to flush any graphics buffered in STDPLOT to the plotter.

------------
From: /u2/tody/ Sat 15:12:41 27-Apr-85
Package: gio
Title: new command .gflush
 
A new : escape ":.gflush" has been added to the cursor mode escapes.  This is
the cursor mode equivalent of the "gflush" command in the CL, permitting
disposal of plotter output from within cursor mode w/o having to exit to the
CL.

------------
From: /u2/tody/ Mon 09:40:45 29-Apr-85
Package: fmtio/str
Title: string sorting utility
 
A new procedure has been added to the STR subpackage of FMTIO for sorting
arrays of strings.

	strsrt (strp, sbuf, nstr)

	int	strp[ARB]		# array of indices of strings
	pointer	sbuf			# pointer to string buffer
	int	nstr			# number of strings

Sorting is carried out by permutation of the indices of the strings in STRP.
String storage is in SBUF.

------------
From: /u2/davis/ Mon 11:05:43 29-Apr-85
Package: dataio
Title: rfits,wfits mods
 
WFITS will now store the IRAF image name in the FITS parameter IRAFNAME.
RFITS will optionally restore image files to disk with the old IRAF name
if the parameter oldirafname is set. A new parameter scale has been added
to RFITS. If the scale switch is set to no RFITS will dump the FITS integers
directly to tape regardless of the value of bscale and bzero. Otherwise
RFITS will check the bscale and bzero factors before deciding whether or
not to scale the data.

------------
From: /u2/tody/ Mon 22:48:03 29-Apr-85
Package: fmtio
Title: bug fix in patmatch
 
PATMATCH was found to be grossly inefficient for a match at the beginning
of a line, and was optimized accordingly.

------------
From: /u2/davis/ Tue 14:31:06 30-Apr-85
Package: images
Title: new 2-D shift operator
 
A new task IMSHIFT has been added to the images package. IMSHIFT will shift
an image by fractional pixel shifts in both x and y using a set of 2-D
interpolation routines. See the help file for more info.

------------
From: /u2/tody/ Mon 22:36:38 06-May-85
Package: cl
Title: bug fix affecting i/o redirection
 
A bug was discovered that would cause commands of the form

	task < file

to fail.  In such a case, the CL would open "file" as a binary file rather
than as a text file, causing every other character to be discarded on our
machine.  The bug was due to a typo in exec.c with the operator "*" typed
when "&" was meant (see the code which sets the STDINB flag).

------------
From: valdes$iraf/ Wed 16:13:37 08-May-85
Package: imred
Title: bias package
 
There has been a great deal of confusion about removing bias from CCD
images.  This has led to use of several different IRAF operators for
this purpose.  In particular a contant bias subtraction and a line-by-line
bias subtraction have been used.  Neither of these is correct.  The bias
does vary (at least for some detectors) so a constant is not appropriate.
However, line-by-line subtraction introduces noise because the bias
variations are expected to be low frequency.  After discussion with George
Jacoby and Roger Davies the following approach seems to be the correct one.
For this discussion assume that the bias region occupies a set of columns.
Average the bias columns to produce an average bias column.  Fit a function
of the line number to the average bias column.  Subtract this average function
from each column of the image.  Note that this method encompasses the constant
bias and high frequency line-by-line subtraction with a suitable choice
of the fitting function (i.e. a polynomial of order 1 or a very high
order function respectively).

I have implemented this algorithm using the general curve fit package with
interactive extensions.  In the imred package there is a package called
bias.  In the bias package are two tasks colbias and linebias.  Help
information is available for these tasks.  Because trimming of the bias
region and unwanted portions of the image is very commonly desired
and can result in considerable savings in execution time these tasks
provide for specifying a "trim" region to be bias subtracted and output.
The tasks can be run non-interactively, interactively, or partially
interactive and partially non-interactive.

I would like to remove the following tasks from the imred.generic package:

dcbias, btt, chimages, biassub

If there are no objections I will do this in a week or so.

------------
From: /u2/tody/ Wed 23:50:51 08-May-85
Package: plot
Title: additions to IMPLOT task
 
The IMPLOT task has been modified to generate a two line plot title, the first
line of which tells whether the plot is a line or column plot, gives the line
or column number (or numbers in the case of an average), and gives the image
name.  The image title appears on the second line.

The :l and :c commands now permit a second numeric argument.  If two numeric
arguments are given, the indicated range of lines or columns will be averaged.

------------
From: valdes$iraf/ Thu 14:27:51 09-May-85
Package: curfit
Title: New stat procedures
 
Two procedure have been added to the curfit package.  These are
CVSTATI and CVSTATR.  They are used to get parameters from the
curfit package.  The parameter macro values are defined in curfit.h.
The parameters currently defined are:

define	CVTYPE		1	# curve type
define	CVORDER		2	# order
define	CVNSAVE		3	# Length of save buffer
define	CVXMIN		4	# minimum ordinate
define	CVXMAX		5	# maximum ordinate

Primary usages are to get the length of the buffer needed for a CVSAVE
and to determine the properties of a curve which has been restored
by a CVRESTORE.

------------
From: /u2/tody/ Thu 18:07:47 09-May-85
Package: images
Title: minor mod to HEDIT
 
The interactive verification feature of HEDIT has been slightly modified
since some users turned out to be confused by the original way things were
done.  One can now respond to the field update query with either "yes" or
"no", in addition to explicitly entering a new value string.  Either "yes",
"y", or carriage return serves to accept the prompted value.

A editing sequence involving many images can now be terminated prematurely
by typing "q" in response to the "update header" query given after all
fields in a particular image have been edited.  The task will exit
immediately without editing the remaining images.

------------
From: /u2/tody/ Thu 22:12:31 09-May-85
Package: imio
Title: new release of IMIO installed
 
A new release of IMIO was installed in the system on 29 April.  The major
changes in the new version of IMIO are summarized below.

    [1]	IMIO now has the ability to perform (optionally) automatic boundary
   	 extension to satisfy out of bounds pixel references.

    [2] A preliminary database interface has been added to IMIO.  Image headers
	are now variable length and use only the amount of disk space required
	to store the header (excluding byte packing).

    [3] Two new database utility tasks HEDIT and HSELECT have been added to
	the IMAGES package.  Both use the new library subroutine EVEXPR,
	now installed in the FMTIO package.

The new release of IMIO is upward compatible with previous versions and should
require no changes to or even recompilation of existing code.  The basic image
header structure is unchanged hence existing images and image headers are still
accessible.  Copying of old images still on disk with IMCOPY may however be
desirable to reduce disk consumption (the old headers were wasteful of storage).

This release of IMIO introduces some database tools and concepts which
should help us understand the role the DBIO interface and DBMS package will
play in image processing applications in the near future.  The current database
interface has serious functional limitations and is inefficient for operations
which operate upon entire databases (e.g., the select operation), but does
provide a basic and much needed image database capability.


1. Modifications to the Current Interface

1.1 Boundary extension

    Automatic boundary extension is useful in applications such as filtering
via convolution, since the convolution kernel will extend beyond the boundary
of the image when near the boundary, and in applications which operate upon
subrasters, for the same reason.  When reading from an image with boundary
extension in effect, IMIO will generate artificial values for the out of bounds
pixels using one of the techniques listed below.  When writing to an image
with boundary extension in effect, the out of bounds pixels are discarded.

By default, an out of bounds pixel reference will result in an error message
from IMIO.  Consider an image line of length 5 pixels.  The statement

	buf = imgs1r (im, -1, 7)

references out of bounds by 2 pixels on either end of the image line,
referencing a total of 5+2+2=9 pixels.  If boundary extension is enabled
and the get section completes successfully then  Memr[buf]  will reference
the pixel at X = -1, and  Memr[buf+2]  will reference the first inbounds
pixel.

When an image is first opened zero pixels of boundary extension are
selected, and any out of bounds references will result in an error.
To enable boundary extension  imseti  must be called on the open
image to specify the number of pixels of boundary extension permitted
before an out of bounds error occurs.
 
        include <imset.h>
        call imseti (im, IM_NBNDRYPIX, 2)
 
If boundary extension is enabled the type of boundary extension desired
should also be set.  The possibilities are defined in  <imset.h>  and
are summarized below.

 
        BT_CONSTANT     return constant if out of bounds
        BT_NEAREST      return nearest boundary pixel
        BT_REFLECT      reflect back into image
        BT_WRAP         wrap around to other side
        BT_PROJECT      project about boundary
 
		Types of Boundary Extension 


The type of boundary extension is set with the imset parameter IM_TYBNDRY.
If the BT_CONSTANT option is selected the constant value should be set with
an  imseti  or  imsetr  call to set the parameter IM_BNDRYPIXVAL.
Boundary extension works for images of any dimension up to 7 (the current
IMIO limit).  A single IM_NBNDRYPIX value is used for all dimensions.
This value is used only for bounds checking, hence the value should be set
to the maximum out of bounds reference expected for any dimension.
Larger values do not "cost more" than small ones.  An actual out of bounds
reference is however more expensive than an inbounds reference.


1.2 Image Database Interface

    The image database interface is the IMIO interface to the database
containing the image headers.  In this implementation the image header is
a variable length binary structure.  The first, fixed format, part of the
image header contains the standard fields in binary and is fixed in size.
This is followed by the so called "user area", a string buffer containing
a sequence of variable length, newline delimited FITS format keyword=value
header cards.  When an image is opened a large user area is allocated to permit
the addition of new parameters without filling up the buffer.  When the
header is subsequently updated on disk only as much disk space is used as
is needed to store the actual header.

The new header format is upwards compatible with the old image header format,
hence old images and programs do not have to be modified to use the latest
release of IMIO.  In the future image headers will be maintained under DBIO,
but the routines in the image header database interface described in this
section are not exected to change.  The actual disk format of images will of
course change when we switch over to the DBIO headers.  While the physical
storage format of header will change completely under DBIO, the logical schema
will change very little, i.e., our mental picture of an image header will be
much as it is now.  The main difference will be the consolidation of many
images into a few files, and real support in the image header for bad pixels,
history, and coordinate transformations.  In addition a number of restrictions
on the "user fields" will be lifted, the remaining distinctions between the
standard and user fields will disappear, and database operations will be much
more efficient than they are now.


1.2.1 Library Procedures

    The IMIO library procedures comprising the current image database interface
are summarized in the table below.
 

       value = imget[bcsilrd_] (im, field)
                        imgstr (im, field, outstr, maxch)
               imput[bcsilrd_] (im, field, value)
                        impstr (im, field, value)
               imadd[bcsilrd_] (im, field, def_value)
                        imastr (im, field, def_value)
                        imaddf (im, field, datatype)
                        imdelf (im, field)
                  y/n = imaccf (im, field)

             list = imofnl[su] (im, template)
           nchars/EOF = imgnfn (list, fieldname, maxch)
                        imcfnl (list)

where
	pointer	im, list
	char[]	field, outstr, datatype, template, fieldname
 

		 Image Database Interface Procedures 


New parameters will typically be added to the image header with either
one of the typed  imadd  procedures or with the lower level  imaddf 
procedure.

The former procedures permit the parameter to be created and the value
initialized all in one call, while the latter only creates the parameter.
In addition, the typed  imadd  procedures may be used to update the values
of existing parameters, i.e., it is not considered an error if the parameter
already exists.  The principal limitation of the typed procedures is that
they may only be used to add or set parameters of a standard datatype.
The  imaddf  procedure will permit creation of parameters with more
descriptive datatypes (abstract datatypes or domains) when the interface is
recut upon DBIO.  There is no support in the current interface for domains.

The value of any parameter may be fetched with one of the  imget  functions.
Be careful not to confuse  imgets  with  imgstr (or  imputs  with  impstr )
when fetching or storing the string value of a field .  Full automatic type
conversion is provided.  Any field may be read or written as a string,
and the usual type conversions are permitted for the numeric datatypes.

The  imaccf  function may be used (like the FIO  access  procedure)
to determine whether a field exists.  Fields are deleted with  imdelf ;
it is an error to attempt to delete a nonexistent field.

The field name list procedures  imofnl[su] ,  imgnfn , and  imcfnl  procedures
are similar to the familiar file template facilities, except that the @file
notation is not supported.  The template is expanded upon an image header
rather than a directory.  Unsorted lists are the most useful for image header
fields.  If sorting is enabled each comma delimited pattern in the template
is sorted separately, rather than globally sorting the entire template after
expansion.  Minimum match is permitted when expanding the template, another
difference from file templates.  Only actual, full length field names are
placed in the output list.


1.2.2 Standard Fields

    The database interface may be used to access any field of the image header,
including the following standard fields.  Note that the nomenclature has been
changed slightly to make it more consistent with FITS.  Additional standard
fields will be defined in the future.  These names and their usage may change
in the next release of IMIO.

 
	  keyword     type                 description
 
        i_ctime         l       time of image creation
        i_history       s       history string buffer
        i_limtime       l       time when limits (minmax) were last updated
        i_maxpixval     r       maximum pixel value
        i_minpixval     r       minimum pixel value
        i_mtime         l       time of last modify
        i_naxis         i       number of axes (dimensionality)
        i_naxis[1-7]    l       length of an axis ("i_naxis1", etc.)
        i_pixfile       s       pixel storage file
        i_pixtype       i       pixel datatype (SPP integer code)
        i_title         s       title string
 


The names of the standard fields share an "i_" prefix to reduce the possibility
of collisions with user field names, to identify the standard fields in
sorted listings, to allow use of pattern matching to discriminate between the
standard fields and user fields, and so on.  For the convenience of the user,
the "i_" prefix may be omitted provided the resultant name does not match the
name of a user parameter.  It is however recommended that the full name be
used in all applications software.


1.2.3 Restrictions

    The use of FITS format as the internal format for storing fields in this
version of the interface places restrictions on the size of field names and
of the string value of string valued parameters.  Field names are currently
limited to eight characters or less and case is ignored (since FITS requires
upper case).  The eight character limit does not apply to the standard fields.
String values are limited to at most 68 characters.  If put string is passed
a longer string it will be silently truncated.  Trailing whitespace and
newlines are chopped when a string value is read.


2. Database Utility Tasks

    Two image database utility tasks have been implemented,  hedit  and
hselect.   Hedit  is the so called header editor, used to modify, add, or
delete selected fields of selected images.  The  hselect  task is used to
select images that satisfy a selection criteria given as a boolean
expression, printing a subset of the fields of these images on the
standard output in list form.

Both of these tasks gain most of their power from use of the  evexpr 
utility procedure, now available in FMTIO.  The  evexpr  procedure takes
as input an algebraic expression (character string), parses and evaluates
the expression, and returns as output the value of the expression.

 
	include <evexpr.h>
	pointer	evexpr()

	o = evexpr (expr, getop, ufcn)

where
	o	Is a pointer to an operand structure
	expr	Is a character string
	getop	Is either NULL or the  locpr  address
		  of a user supplied procedure called during
		  expression evaluation to get the value of
		  an external operand.
	ufcn	Is either NULL or the  locpr  address
		  of a user supplied procedure called during
		  expression evaluation to satisfy a call to
		  an external function.
 

The operand structure is defined in  <evexpr.h> .  The best documentation
currently available for the operators and functions provided by  evexpr 
will be found in the manual page(s) for  hedit .  Additional documentation
will be found with the sources.  The expression evaluation procedure is
probably the single largest procedure in the system (in terms of kilobytes
added to an executable) and should not be used unless it is needed, but it can
greatly increase the power of a task in the right application.

------------
From: /u2/tody/ Fri 20:32:55 10-May-85
Package: gio
Title: spooling of plotter output
 
Plotter output is now spooled many plots to a metafile rather than being
processed to the plotter a plot at a time.  You will no longer get a plot
out immediately after a cursor mode snap.  Spooling many plots into a single
metafile is much more efficient, reduces the load on the system, and produces
more pleasing output since the plots will come out on successive pages of
paper as a single print job (with no wasted paper).  All plotter output is
spooled, e.g., cursor mode snaps, plots written to devices such as "stdplot",
"vup", "imagen", etc., and plots written to the dicomed (e.g., by crtpict).
Versatec plots are also now more closely centered on a page (formerly part
of the plot would be in the perforations between pages of paper).

The spooled plotter output will be disposed of to the plotter device when
any of the following events occur:

    [1]	When you type the command "gflush" in the CL, or enter colon escape
	":.gflush" while in cursor mode.  A ":.init" will also do it.

    [2] When you log off.

    [3] When the graphics device assigned to the stream STDPLOT changes.
	This happens when a new device name is assigned to the "device"
	parameter of a graphics task which writes to STDPLOT, or when
	you make a "snap" on a different device.
    
    [4] When the "maximum frame count" for a device is exceeded.  This can
	be specified individually for the different plotter devices, with
	the default value currently being 16 frames per metafile.  This is
	enough frames to make things efficient, but not so many that we
	run out of disk space or lose everything in a system crash.

If the system should crash before plotter output is disposed of to the system,
the metafile should still be intact in the /tmp directory (e.g., "/tmp/gvp...")
and may be disposed of manually with a command such as the following (this
would plot on the upstairs versatec):

	plotX -Tver -W=3 /tmp/gvp* | plot -Tver -M75 -Pvup

These comments apply only to the plotter devices.  The plotter (NSPP) devices
currently supported are the following:

	calcomp
	dicomed
	imagen
	versatec
	vdown
	vup

------------
From: /u2/tody/ Sat 00:23:44 11-May-85
Package: gio
Title: bug fix, log scaling, etc.
 
A serious bug in pseudofile i/o to STDPLOT (gio$cursor/prpsio.x) was preventing
plots written to STDPLOT by a task from being sent properly to the NSPP kernel.
This was fixed and in addition, the following enhancements were made:

    [1]	Log ticks are now labelled as powers of 10 rather than in linear units,
	i.e., as a 10 followed by the exponent one half character higher.

    [2] The EPSILON tolerance test in FP_EQUAL[DR] and FP_NORM[DR] was relaxed
	to 10*EPSILON to make these routines useful in real life situations
	where there is typically a small accumulation of error to be allowed
	for.

------------
From: /u2/tody/ Sun 20:19:38 12-May-85
Package: plot
Title: graphics kernels added to PLOT package
 
The three existing graphics kernels have been added to the PLOT package as
the following tasks:

	gkidecode
	stdgraph
	stdplot

These tasks are used to process metacode, either from a file or from the
standard input (e.g., from a pipe).  At present, however, there is no way
to redirect a graphics stream on the command line.

In the process of installing these tasks the name of the old NSPP task was
changed to STDPLOT.  These tasks will already be useful for metacode
translation.  In the future the CL i/o redirection syntax will be extended
to permit redirection of graphics output, e.g.,

	plottask arg arg | stdplot dev=vup cell+

------------
From: /u2/tody/ Thu 10:08:43 16-May-85
Package: gio
Title: degenerate windows
 
If a window (world coordinate system) is degenerate in either axis GIO will
now increase the upper limit of the window in steps of EPSILON until there
is enough separation between the edges of the window to define the coordinate
system.  Formerly GIO would take an error action ("no range in [XY]") when
given a degenerate coordinate system.

------------
From: valdes$iraf/ Fri 13:37:34 17-May-85
Package: lib
Title: Subdirectory for include files of xtools
 
To keep the lib directory managable we plan to make subdirectories of
lib available as standard search places for include files and libraries.
As a start include files for the xtools procedures have been placed in
the subdirectory xtools.  Currently these include files must be
reference with an OS path name.  This will change later to be OS
independent.  The usage (in UNIX) is:

	include	<xtools/icfit.h>

------------
From: valdes$iraf/ Fri 13:42:33 17-May-85
Package: xtools
Title: New xtools
 
Three packages of xtools have been added to xtools.  These packages are
in subdirectories of xtools.  The new xtools are as follows.

ranges (rg_ prefix procedures):

     A ranges package using : as the range delimiter (like image sections)
and without steps.  It contains tools for parsing ranges, merging ranges,
ordering ranges, packing and unpacking arrays, and doing median and averaging
of sets of points within ranges.  It is used in the icfit tools and in
some of the longslit tasks.  Indirectly through icfit it is used in a number
of other tasks.

gtools (gt_ prefix procedures):

    Graphics tools.  These tools provide for printing help files in response
to : cursor commands, paging (clearing the terminal) text, and tools to use
a structure containing window and axis transformation parameters.  These
tools are used in icfit and indirectly through icfit in a number of tasks.

icfit (ic_ and icg_ prefix procedures):

    Interactive curve fitting.  These tools provide a somewhat higher level
interface to the curfit math package.  It has been designed to be efficient
and to use a set of standard parameters (sample points, median and subsample
averaging, functions, orders, deviant point rejection, and rejection growing.
A subset of the package provides an interactive GIO interface.  These tools
are used in linefit, lineclean, identify, response, illumination, background,
linebias, colbias, lineflat, colflat, linebckgrnd, and colbckgrnd in the
images, longslit, bias, and generic packages.  A good example of usage is
t_linefit.x in the images package.

     The source code is moderately well commented but there is little other
documentation as yet.  Include files for the various set and get calls are
in lib$xtools.  If you have any interest in using them see Frank Valdes.

------------
From: valdes$iraf/ Fri 13:44:31 17-May-85
Package: images
Title: Linefit and lineclean
 
The linefit task has been changed again.  It now has interactive graphics
options and is greatly simplified.  The previous version tried to do too
many things and was difficult to understand.  The new task fits image
lines and creates output images with the fit, the difference or residuals,
or the ratio of the image values to the fit values.  Cleaning of deviant
pixels has been moved to the task lineclean (though elimination of bad
points from the fits is still available).  There is no minimum
division threshold and no output column selection.  It uses the icfit
tools for interactively setting the fitting parameters.

A new task lineclean has been added to use curve fitting to detect and
replace deviant pixels.  It is similar to linefit and uses the same icfit
tools and interactive fitting parameter approach.

These tasks are also used in the generic scripts lineflat, colflat,
Linebckgrnd, and colbckgrnd.

------------
From: valdes$iraf/ Fri 13:45:48 17-May-85
Package: generic
Title: Changes
 
The generic package has been revised.  The tasks dcbias, chimages, btt,
and biassub have been removed.  Note that bias strip corrections are
available in the imred.bias package.  The tasks lineflat, colflat,
linebckgrnd, and colbckgrnd have been changed to use the new linefit
task in the images package.

------------
From: valdes$iraf/ Fri 16:20:06 17-May-85
Package: icfit
Title: Help for interactive graphics in icfit package
 
Help for the cursor mode keys and colon commands in the interactive
graphics of the icfit package is available as ichelp.  This package
is used in numerous tasks and this help page is relevent to all these
tasks: linefit, lineclean, colbias, linebias, colflat, lineflat, linebckgrnd,
colbckgrnd, identify, response, illumination, background.

------------
From: /u2/tody/ Wed 17:48:07 29-May-85
Package: clpackage
Title: revision of the root package (clpackage)
 
The DTOI package has been moved from the root to IMRED, where it more
properly belongs.  The SDAS package has been added to the root and will
eventually contain the applications software from our friends at the
Space Telescope.

------------
From: /u2/tody/ Thu 00:57:22 30-May-85
Package: plot
Title: IMPLOT enhancements
 
A new keystroke 'e' has been added to IMPLOT to permit plot expansion with a
completely redrawn box (makes a prettier plot than the 'E' and 'A' keystrokes
in cursor mode).  Two new colon escapes ":x x1 x2" and ":y y1 y2" have been
added to permit fixing of the plot scale in X or Y, disabling autoscaling.
A bug was fixed which was preventing log scaling from working.  The ? help
text was moved out into the file "plot$implot.keys".  The manual page was
updated.

------------
From: /u2/tody/ Thu 17:45:52 30-May-85
Package: clio,fio
Title: filename templates
 
The filename template expansion code has been rewritten with the results
outlined below.  The external specifications of the packages involved have
not changed.

    [1]	Sorting, if enabled, is now done only when expanding a pattern rather
	than globally over the entire template.  Thus a template such as

		*.h,*.x

	will be expanded with all the .h files first in alphabetical order,
	followed by all the .x files in alphabetical order.  File lists are
	no longer sorted, e.g., forms "a,b,c", and "@filelist".

    [2] Template expansion is now substantially more efficient.  One result
	of this is that directory listings are now somewhat faster.

    [3] The new routine CLPREW has been added to the CLGFIL package.  The
	new entry point may be used to rewind the file list.

    [4] An OS escape syntax has been added to permit "quoting" if OS filenames
	containing template metacharacters, e.g., $ and [].  Anything enclosed
	by OS escape characters, e.g., '!', is treated as a filename string.
	Hence, templates such as
		
		!vmsdir$file!,!drb0:[dir]file!
	or
		!vmsfile

	are now permitted.  The only effect of the ! are to turn metacharacters
	off and back on; beyond that the ! are just stripped out.

    [5] A new "buffered" FNT package has been added, to permit convenient
	filename template expansion for templates not necessarily bound to
	CL string parameters.
		
	Procedures:

		fntopnb - Expand template, open a buffered filename list
		fntclsb - Close buffered list
		fntgfnb - Get next filename from buffered list
		fntlenb - Get number of filenames in a buffered list
		fntrewb - Rewind the list

	Calling sequences:

		 list = fntopnb (template, sortflag)
			fntclsb (list)
	   nchars|EOF = fntgfnb (list, outstr, maxch)
	       nfiles = fntlenb (list)
			fntrewb (list)

	These entry points are provided only for extra flexibility.  The old
	CLPOPN[ISU] should continue to be used for the common case when the
	template is a CL parameter, or when the list is associated with the
	standard input, which might be redirected.


In other changes, the CLGFIL sources in CLIO have become somewhat smaller and
simpler.  A couple include files were removed from CLIO.  The FNT package was
moved from CLIO to FIO.

------------
From: /u2/tody/ Thu 18:19:17 30-May-85
Package: gio
Title: bug fix to polymarker in NSPP kernel
 
The polymarker function in the NSPP kernel turned out to be the same as
polyline; was changed to draw points rather than vectors.

------------
From: /u2/tody/ Fri 20:12:34 31-May-85
Package: gio
Title: gio bug fix
 
The GINIT procedure was using an invalid struct pointer to initialize the
current text attribute structure.

------------
From: /u2/tody/ Fri 20:14:09 31-May-85
Package: hedit,imio
Title: bug fix involving addition of parameters to image headers
 
The image database interface routines in IMIO were not properly adding
new parameters to image headers.  There were a couple of bugs, i.e.,
the newline of the new record was being overwritten with a blank, and
the datatypes of string and numeric fields were not being set properly.
A bug was also fixed in HEDIT that would cause a cryptic "parameter not found"
message when attempting to "add" (edit) an existing image header parameter.
HEDIT will now invoke the edit function when an attempt is made to add
a parameter to an image that already contains such a parameter.

------------
From: /u2/tody/ Sat 20:07:58 01-Jun-85
Package: gio
Title: new font installed in NSPP kernel
 
The original character font of the NSPP kernel has been replaced by a new
font from NCAR/GKS.  The new font is generally better than the old one,
particularly the lower case letters and certain digits, although there
appear to be certain characters in the new font which could stand some
tweaking (i.e., the characters ";:#").  Roman, bold, and italic versions
of the new font are available via gseti-G_TXFONT and \f[RIB] escape sequences
in text strings.

------------
From: /u2/tody/ Sun 18:37:36 02-Jun-85
Package: gio
Title: postprocessing of metacode files
 
The graphics kernels have been modified to permit processing of metacode
files which do not contain the open workstation instruction.  Such metafiles
are commonly produced by the ":.write" command in cursor mode.

------------
From: /u2/tody/ Sun 18:39:53 02-Jun-85
Package: gio
Title: new NSPP device "tek" added
 
A new graphics device using the NSPP kernel has been added.  The new device,
named "tek", is useful for interactively inspecting fully vectorized plots
such as would they would appear on the imagen, versatec, dicomed, or other
NSPP devices.  In particular, character generation is done by the NSPP
kernel rather than by the graphics terminal.

------------
From: /u2/tody/ Mon 15:49:33 03-Jun-85
Package: gio
Title: text generation in the STDGRAPH kernel
 
The text generator developed for the NSPP kernel has been installed also in
the STDGRAPH kernel.  The "normal" text quality for the stdgraph kernel is
whatever is provided by the hardware character generator on the graphics
terminal.  Hardware character generation will be used if the text quality
(G_TXQUALITY) is normal or low; the software character generator is selected
if the quality is set to medium or high.  Software character generation
permits arbitrarily sized characters with arbitrary up vectors, making it
possible to prepare plots just as they will appear on when drawn on a plotter
device which does not have hardware character generation.  The new character
generator also fixes errors in string justification present in the old
kernel.  Strings will now be justified correctly regardless of the text
quality.

The text quality may be selected by setting the G_TXQUALITY parameter before
calling GTEXT.  When working interactively, however, it will be easier to
override the runtime quality attribute by setting the text quality in
cursor mode.  A new cursor mode command ".txquality" has been added for
this purpose.  For example, after drawing a plot with hardware character
generation and while in cursor mode, type ":.txq h" followed by a 0 to
redraw the plot using software character generation.  The "T" keystroke
may be used to interactively draw characters and inspect the font, etc.

------------
From: /u2/tody/ Mon 15:59:27 03-Jun-85
Package: cl
Title: error handling bug fix
 
A bug has been fixed in the CL affecting error handling.  When error recovery
takes place while within an IFERR in SPP, e.g., after a <ctrl/c> when the
CL has called a system service which uses error handling, it is necessary
to reinitialize the error handling system.  In normal programs this is done
by the error restart code in the IRAF Main, but since the CL has its own
error recovery code it must perform the reinitialization itself during
error recovery.

------------
From: /u2/tody/ Mon 16:35:51 03-Jun-85
Package: gio
Title: character size adjusted
 
Ideally the size 1.0 character should be the same size in NDC units on all
graphics devices, otherwise text which is scaled relative to the size 1
character will come out a different size on the different devices.  The NSPP
devices turned out to have character sizes some 20% bigger than the normal
character size for the VT640, our reference graphics device.  The hardware
character size of the VT640 could of course not be changed, so I adjusted
the character size in the graphcap entry of each NSPP device to make it agree
with the VT640/4012.

As as result of this change default size characters on plots will now appear
both taller and narrower than before (note that the aspect ratio of a plotter
device is different than that of the terminal).  An entirely reasonable plot
still results.  If precise control over the character size is desired, the
character size may in NDC units may be set explicitly, rather than scaling
relative to the device size-1 character.  There is currently no way to change
the aspect ratio of a character, since only one size parameter is used for
both axes (this is consistent with GKS).

------------
From: /u2/tody/ Mon 18:51:33 03-Jun-85
Package: gio
Title: error checking of ":.snap"
 
The cursor mode command ":.snap" now checks for an error when trying to open
the snap device, printing a warning message if there is a problem rather than
going through error recovery.

------------
From: /u2/tody/ Tue 22:51:26 04-Jun-85
Package: gio
Title: bug fix affecting log scaling
 
A case turned up in which glabax would fail to log scale correctly.  The
step size between minor ticks was so small that the next major tick
would never be reached, resulting in an infinite loop.  This bug has been
fixed and the log scaling code has been extensively tested.

------------
From: /u2/tody/ Wed 15:51:50 05-Jun-85
Package: cl
Title: bug fix in CL
 
The internal CL function "breakout" breaks a long form parameter name into
fields, returning a pointer to each field (a long form parameter name is
"task.param" or "package.task.param").  In order to return a pointer to an
EOS delimited string the routine overwrites the periods in the input string
with EOS, returning a pointer to each substring (needless to say, not a good
practice).  A bug was found and fixed involving the use of the breakout
procedure in the run time opcode procedures.  When such a procedure is
passed an operand which is compiled into the dictionary, the first call to
breakout was modifying the input operand but functioning successfully.
In the second call the same input operand was passed (but modified in the
first call), hence the bug.  I added a new procedure called "breakcopy"
which calls breakout on a local copy of the input operand.  All calls to
the breakout function in the CL were examined and parcelled into three
cases: [1] breakout called on a local copy, no changes; [2] reentrant call
to breakcopy possible, routine changed to make local copy of operand and
call breakout directly; and [3] simple reference to a nonlocal operand,
call to breakout replaced by equivalent call to breakcopy.  Most changes
were of the latter type and occurred in the file opcodes.c.

------------
From: /u2/tody/ Wed 16:06:37 05-Jun-85
Package: fio
Title: bug fix in binary file i/o
 
The procedure FWATIO was modified to mark the FIO buffer inactive regardless
of the status returned by an i/o transfer to the buffer.  Formerly the
routine would not mark the buffer inactive following an i/o transfer
which returned an error.  This would cause the error to "stick" when trying
to read the file (and probably when trying to write it too).

------------
From: /u2/tody/ Wed 19:03:06 05-Jun-85
Package: library
Title: mathematical constants
 
A new file <math.h> has been installed in the system library.  This file 
contains definitions of various constants and macros useful in numerical
applications.

------------
From: /u2/tody/ Thu 20:27:16 06-Jun-85
Package: fmtio
Title: bug fix in CTOWRD (hence also CTOTOK, GARGTOK)
 
The CTOWRD procedure was recognizing newline as a word delimiter even when
the "word" in question was a quoted string or character constant.  Since
newlines are permitted in strings and character constants this was an error.
CTOWRD is called by both CTOTOK and GARGTOK, hence the bug affected both
of these routines as well.

------------
From: /u2/tody/ Fri 11:44:20 07-Jun-85
Package: spp
Title: pointer conversions in structures
 
Several macros have been added to <iraf.h> to facilitate pointer conversions
within structure definitions.  These macros convert a struct pointer into a
pointer to some other datatype, e.g., to reference a field of a structure.

	P2C(p)		*(struct) -> *char
	P2S(p)		*(struct) -> *short
	P2L(p)		*(struct) -> *long
	P2D(p)		*(struct) -> *double
	P2X(p)		*(struct) -> *complex

By definition pointer to struct is equivalent to a pointer to int hence there
is no conversion for integer fields.  Also by definition int and real occupy
the same amount of storage, hence pointer conversions are not necessary to
reference fields of type real.  Since an SPP pointer is implemented as an
integer it may be stored in an integer field within a structure (we are taking
liberties within struct declarations that should not be taken in regular code).

Sufficient storage should be allocated for each CHAR or SHORT field of a
structure to permit variations in the actual size of a char or short on the
host machine.  Allocate one full struct unit for each storage element of
type char, short, int, long, or real.  Allocate two struct units per double
or complex element.  When storing character strings in a structure, dimension
the string odd and allow one extra char for the EOS.  Double and complex fields
must have double alignment with the pointer to the start of the structure,
i.e., a double or complex field must be placed at an offset of 0, 2, 4, etc.
struct units from the start of the structure.

Example:

	define	LEN_ASTRUCT	(10+40+40)
	define	SZ_NAME		39

	define	A_FD		Memi[$1]
	define	A_STATUS	Memi[$1+1]
	define	A_SCALE		Memd[P2D($1+2)]
	define	A_OFFSET	Memd[P2D($1+4)]
				# (extra space)
	define	A_NAME1		Memc[P2C($1+10)]
	define	A_NAME2		Memc[P2C($1+50)]


Note that the offset into the structure is always given in struct units.
It is good practice to allow extra space for expansion.  Likewise it is
advisable to place char storage at the end of the structure to allow for
expansion without having to recompute the offsets of the scalar fields.

If these rules are followed the resulting structure definitions should be
portable to most or all IRAF host machines without change.

------------
From: /u2/tody/ Sun 22:31:53 09-Jun-85
Package: fmtio
Title: new procedures added to the strings package
 
Two new procedures have been added to the strings subpackage of FMTIO.  The
new procedures, more general versions of the old routines STRIDX and STRLDX,
are called STRIDXS and STRLDXS and differ from the original routines in that
the first argument is a string defining a set of characters to be searched
for, rather than a single character.

	index =  stridx (ch, str)	# first occurrence of CH in STR
	index = stridxs (set, str)	# first occurrence of SET[i] in STR
	index =  strldx (ch, str)	# last occurrence of CH in STR
	index = stridxs (set, str)	# last occurrence of SET[i] in STR

I have been thinking of adding these procedures for some time since there
have been numerous occasions on which they would have been useful.  The addition
of the new routines at this particular time was prompted by the redefinition
of a character constant as an integer value.  The following statement is now
illegal since the first argument is an integer rather than char scalar:

	ip = stridx ('a', str)		# BAD!!

Rather than define a char variable to convert this into a legal statement,
the following form may be used instead:

	ip = stridxs ("a", str)

------------
From: /u2/tody/ Sun 22:42:40 09-Jun-85
Package: spp
Title: revision to the SPP language standard
 
The original standard for the SPP language, which has remained unchanged since
its first definition several years ago, defined a character constant (e.g., 'a')
as a numeric constant of type CHAR.  It has recently become apparent that
the SPP language can be simplified by redefining the character constant as an
integer constant.  With this new definition the following are all legal
integer constants, equating to 32 decimal:

	32
	40B
	20X
	' '

Likewise, the following are all equivalent to the decimal integer 49 (SPP
specifies that characters are represented internally in ASCII):

	49
	61B
	31X
	'0' + 1
	TO_DIGIT(1)

This change requires that all existing code which uses character constants
in argument lists be changed, since it is illegal to pass an integer argument
to a procedure expecting an argument of type char.  A complete list of all
such (newly) illegal statements has been prepared by automatic means and
the affected code is in the process of being revised.

------------
From: /u2/tody/ Mon 19:23:58 10-Jun-85
Package: fio
Title: new routines added to FIO
 
Two new procedures PUTCI and GETCI have been added to the FIO interface.
These are integer versions of the old procedures PUTC and GETC.

	ch/EOF = getci (fd, ch)		# int fd, ch, getci()
		 putci (fd, ch)

	ch/EOF =  getc (fd, ch)		# int fd; char ch, getc()
		  putc (fd, ch)

The new routines are functionally identical to the old ones but eliminate
the char scalar argument and function value (which can cause portability
problems).  PUTCI is particularly useful for the output of character
constants, e.g.:

	call putci (fd, '\n')

This is certainly a kludge, but both types of procedures are useful depending
on the application, and the revision is upwards compatible.  In the ideal
world a better solution would be for SPP to accept either char or integer
scalar arguments but always pass an integer in the argument list, like C.
This is beyond the capabilities of the current preprocessor because it does
not parse expressions and keep track of their datatypes.

------------
From: /u2/tody/ Tue 09:53:06 11-Jun-85
Package: fmtio
Title: argument datatype changed in DTOC, XTOC
 
The datatype of the "format" argument to DTOC and XTOC has been changed from
CHAR to INT, since the actual argument in typical calls is usually an explicit
character constant, e.g., 'f', 'e', or 'g'.

------------
From: /u2/tody/ Tue 13:19:28 11-Jun-85
Package: system
Title: minor revisions to match argument types
 
Approximately 75 lines of code were modified to match argument datatypes
(char to char, int to int) as a result of the recent change in the SPP
language standard.  The count of number of lines of code modified does not
include numerous related modifications made in declarations, etc.  Some of
the affected routines were quite old and were cleaned up and made more
efficient in the process.  Most of the changes were procedure name changes,
e.g.:

	putc -> putci
	stridx -> stridxs

The following files were affected.


PKG:
	utilities
		decod_tablst.x t_translit.x
	help/lroff
		breakline.x center.x justify.x lroff.x section.x
		do_ls.x output.x skiplines.x
	help
		prblkhdr.x hbgetblk.x hbgetblk.x hinput.x
		manout.x manout.x manout.x modtemp.x
	images
		imheader.x hedit.x
		imdebug/dump.x
		tv/display zopnim.x
	softools/yacc/debug
		ytab.x(dc.y)
	system
		page.x directory.x match.x beep.x
	plot
		graph.x

SYS:
	clio
		clcmd.x	zfiocl.x
	fmtio
		ctocc.x dtoc.x xtoc.x strtbl.x fmtstr.x parg.x
	gio
		nspp/encode.x stdgraph/stgencode.x glabax/glbtitle.x
		cursor/(rcursor.x,grcstatus.x,grccommand.x)
	debug
		realio.x nop.x clio.x strings.x fio.x fio2.x words.x plot.x
	mtio
		mtgetpos.x
	tty
		ttyputline.x ttyinit.x debug.x
	etc
		erract.x sys_ptime.x x_debug.x envlist.x propen.x main.x
		xerstmt.x
	fio
		x_debug.x, fchdir.x vfntrans.x
	imio
		immap.x db/imgetb.x db/imaddf.x db/imdelf.x
	fmtio
		chrupr.x chrlwr.x dtoc.x fpradv.x patmatch.x pargx.x
	mtio
		mtposition.x mtdevlist.x
	tty
		ttyputline.x


For the most part the modifications were trivial and should not cause any
problems.  Routines where were more heavily modifed include the pattern
matching code in FMTIO and the character output code in LROFF (HELP).

------------
From: valdes$iraf/ Thu 10:29:36 13-Jun-85
Package: xtools
Title: Simple text database tools
 
Some simple text database tools have been added to the xtools library.
Some help text under the name dttext is available through the help task.
The source code is in dttext.x in the xtools directory.  These tools are
useful for keeping multiple database text entries in one file.  These tools
are in use in the longslit package.

------------
From: /u2/tody/ Fri 13:26:57 14-Jun-85
Package: spp
Title: SPP compiler revisions
 
The first pass of the SPP compiler, i.e., the C program XPP, has been
modified as follows:

    [1]	A new file "decl.c" was added containing a package of routines for
	parsing argument lists and declaration statements.  As arguments and
	declarations are parsed each argument or local variable is added to
	an internal symbol table.  When a procedure has been fully processed
	a code generation routine is called to output the RPP declarations
	required by the second pass.

	Declarations are output in the following order: (1) scalar arguments,
	(2) array arguments, (3) local variables, (4) miscellaneous
	declarations (commons, errchk, etc.), (5) switch variables and string
	array names, (6) data statements.  This ordering is independent of
	the order in which these items occur in the source.  The output
	ordering is as required by Fortran.

	This revision was made to permit correct generation of Fortran code
	for the following type of case, which is quite common in IRAF:

		procedure alpha (fd, x, xlen)

		pointer	im
		real	x[xlen]
		int	xlen

		begin


	Previously the Fortran generated for this procedure would have
	declared the OUTSTR array and then the MAXCH scalar.  This is illegal
	Fortran because the length argument XLEN would be used to dimension
	X before being declared as an integer argument; some compilers would
	accept such a construct and compile it correctly, while others would
	conclude that XLEN was a real by applying the autotyping convention of
	Fortran.  This is no longer a problem because SPP will reorder the
	argument list to suit Fortran.

    [2] In addition to reordering argument lists, the new code will also
	detect multiple declarations of the same identifier, printing a
	warning message for each such case found.

    [3] XPP (the first pass of the preprocessor) now prints the name of each
	procedure as it is processed, in addition to the name of each file
	processed.  This gives the user more feedback on the progress of the
	compile, particularly when a large file is being compiled on a slow
	machine.  Typically the filename will appear, then there will be a
	delay while all the header includes are read in, then the individual
	procedures in the file will be processed, then there will be a delay
	while RPP is called to generate the Fortran output file.

Related changes were required in the lexical analyzer (file xpp.l) and in the
file xppcode.c.  In particular the way in which context sensitivity is handled
was completely changed, removing all of the old context variables and replacing
them with a single multistate variable named "context".  Additional buffering
was added (the symbol table and another buffer for miscellaneous declarations),
hence now an entire procedure is buffered internally before any output is
generated.  Comments are no longer passed to RPP.  By stripping comments and
optimizing character output the performance of XPP was improved by 25%.

------------
From: tody$ Fri 21:48:40 14-Jun-85
Package: vops
Title: precision of VOPS projection functions increased
 
The VOPS function procedures ASSQ, ASUM, and ADOT have been changed to
accumulate the sum of squares, sum, or dot product as a variable of type
real, double, or complex depending upon the datatype of the procedure.
The function value was also changed to return a floating point value of
the correct precision.  Formerly both the sum and the function value
were of type PIXEL, making the procedures of little value for integer
vectors.

------------
From: tody$ Sun 21:13:22 16-Jun-85
Package: system
Title: filename changes
 
All files in the lib$ and sys$ directories (excluding lib$xtools) with names
longer than 9 characters or which contained underscore characters were renamed.
This eliminates the need to mess with filename mapping (except for filename
extensions) when bootstraping the system on a foreign host.  There is no need
to do the same thing for the applications packages since the IRAF VOS will
handle the filename mapping once the core system is up.

------------
From: tody$ Sun 21:17:32 16-Jun-85
Package: math
Title: nonportable constructs fixed in math packages
 
The bevington fortran sources had nonstandard UNIX continuation (& in col 1).
This was changed to Fortran standard continuation (char in col 6).
The file llsq/sva.f was found to have errors in the hollerith format
statements at the end of the file.  The version of the file from VMS IRAF
was substituted for the UNIX version, after verifying that the only
differences were in the format statements.  Neither library has been
recompiled as yet.

------------
From: /u2/tody/ Thu 19:34:06 20-Jun-85
Package: cl
Title: logout change, bug fix
 
The CL will no longer automatically deallocate magtape drives when logging
out.  This greatly speeds up logout and permits the same user to logout
of a second CL while the first still has a tape drive allocated (formerly
the drive would be deallocated).

Since deallocation is no longer automatic, people will inevitably forget
to deallocate the tape drive.  The next user to attempt to allocate the
drive will get a "drive already allocated" error message, even if the user
has deallocated the drive at the host system level.  When this occurs
delete the file "dev$mta.lok" or "dev$mtb.lok", making certain by first
typing the file that it is not in use.  If this file does not exist IRAF
assumes that the drive can be allocated to someone else.  The file MUST
exist while a drive is being accessed.

A recent bug fix has been made which will probably cure the bug which has
been causing parameter values to be overwritten with garbage when a task
exits.

------------
From: tody$ Thu 19:42:41 20-Jun-85
Package: gio
Title: graphics kernels
 
Recently all filenames in the iraf VOS were changed which were longer than
9 characters or which contained underscores.  Some runtime files were affected,
in particular the graphics kernels, "lib$x_stdplot.e" and "lib$x_stdgraph.e".
These are now named "lib$xstdplot.e" and "lib$xstdgraph.e".

The system tasks spawned by the graphics kernels when "gflush" is typed
are now submitted with a reduced priority of 4.

------------
From: tody$ Thu 19:42:41 20-Jun-85
Package: system
Title: merge

A merge of the VMS and UNIX versions of IRAF is in progress.  A number of
changes have been made which have not yet been recorded by revisions notices.
These will be summarized when the merge is complete.


------------
From: valdes$iraf/ Mon 14:11:37 01-Jul-85
Package: generic
Title: Changes to lineflat and colflat
 
The task lineflat for creating flat fields by ratioing the image lines
by function fits to the image lines has been changed.  It used to be
a simple script calling the task linefit in the images package.  Now it
it is a complied task which is similar to linefit.  This allowed the
addition of a new parameter specific to the flat field problem.  The
new parameter is call minflat.  If the fitted value is less than the
value of this parameter the flat field value is set to unity.

The task colflat used to be a script calling linefit.  Now it calls lineflat
and, hence, has the minflat parameter.

------------
From: valdes$iraf/ Tue 16:49:50 02-Jul-85
Package: gtools
Title: Expanded gtools structure
 
The gtools structure has been expanded to include a title, xlabel, and
ylabel.  The call gtlabax in place of glabax will call glabax with the
appropriate strings.  If the gtools pointer is null then glabax will
be called with no strings.  The initialization is null strings.
Calls to gt_sets and gt_gets are used to set and get the strings
with the parameters GTTITLE, GTXLABEL, and GTYLABEL from gtools.h.
gt_colon has also been modified to respond to :title, :xlabel, and
:ylabel.  These changes do not affect any code except those which
use the colon parameters title, xlabel, and ylabel.

------------
From: valdes$iraf/ Mon 15:28:57 08-Jul-85
Package: images
Title: New magnify
 
The magnify task has been rewritten using the new two dimensional interpolation
and boundary extension packages.  Thus, magnify will now do true two
dimensional interpolation.  The block averaging aspect of the old magnify
has been eliminated (use blkaverage first if desired).

------------
From: valdes$iraf/ Tue 14:18:36 09-Jul-85
Package: local
Title: New task imfunction
 
A new task called imfunction has been added to the local package.  It
applies a function to the input pixel values to produce an output image.
Currently only the log (base 10) function is available but other functions
can easily be added.  This task differs from imarith in that imarith is
a binary operator and imfunction is a unary operator.

------------
From: /u2/davis/ Fri 15:25:04 12-Jul-85
Package: dataio
Title: rcamera mod
 
RCAMERA now writes the total time since last readout, and the total shutter
open time in the IRAF image header as well as the integration time.

------------
From: /u2/davis/ Wed 11:51:13 17-Jul-85
Package: images
Title: shiftlines bug
 
Shiftlines was not calculating the fractional pixel shifts correctly in
the case of boundary extension. Instead it was shifting by the nearest
integer, i.e 1 if shift=1.5.

------------
From: /u2/davis/ Mon 09:32:44 22-Jul-85
Package: dataio
Title: rfits mod
 
The parameters blank has been added to the RFITS task. Blank values in the
FITS image will be replaced in the IRAF image by the user defined quantity
blank. Appropriate type conversion will be performed on blank. For example
if blank = -1.5 and the output image type is real, blank pixels will have
the value -1.5; if the output image type is integer, blank pixel values will
have the value -1.

------------
From: valdes$iraf/ Mon 14:15:47 29-Jul-85
Package: images
Title: Changes
 
1.  The task revisions has been added to page revisions to the images
package.  The intent is that each package will have a revisions task.
Note that this means there may be multiple tasks named revisions loaded
at one time.  Typing revisions alone will give the revisions for the
current package.  To get the system revisions type system.revisions.

2.  A new task called fit1d replaces linefit.  It is essentially the same
as linefit except for an extra parameter "axis" which selects the axis along
which the functions are to be fit.  Axis 1 is lines and axis 2 is columns.
The advantages of this change are:

	a.  Column fitting can now be done without transposing the image.
	    This allows linefit to be used with image sections along
	    both axes.
	b.  For 1D images there is no prompt for the line number.

------------
From: valdes$iraf/ Mon 14:17:40 29-Jul-85
Package: generic
Title: Changes
 
July 26, 1985:

1.  Help page available for flat1d.

2.  Background has been modified to use new fit1d task.  It now does
column backgrounds without transposes and allows image sections.
------
July 25, 1985:

1.  A new task called flat1d replaces lineflat and colflat.  It is
essentially the same as lineflat except for an extra parameter "axis"
which selects the axis along which the 1D functions are to be fit.
Axis 1 is lines and axis 2 is columns.  The advantages of this change are:

	a.  Column fitting is done without transposing the image.
	b.  The colflat script using image transpositions would not
	    work the same as lineflat when used with sections.  Now
	    it is possible to mosaic several flat fields as need with
	    multiple slits or apertures.
	c.  Because no transpose is needed and it is not a script
	    flat1d should work faster than colflat.
	d.  The prompts for interactive fitting are now correct when
	    doing column fits.
------
July 23, 1985:

1.  The task revisions has been added to page revisions to the generic
package.  The intent is that each package will have a revisions task.
Note that this means there may be multiple tasks named revisions loaded
at one time.  Typing revisions alone will give the revisions for the
current package.  To get the system revisions type system.revisions.

2.  The tasks linebckgrnd and colbckgrnd have been combined into one
task with the extra hidden parameter "axis".  With axis=1 the task
is the same as linebckgrnd and with axis=2 the task is the same as
colbckgrnd.