aboutsummaryrefslogtreecommitdiffstats
path: root/bwbasic.h
blob: 57854d58f27b7d57a514582b09cb86622b5c750d (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
/***************************************************************
  
        bwbasic.h       Header File
                        for Bywater BASIC Interpreter
  
                        Copyright (c) 1993, Ted A. Campbell
                        Bywater Software
  
                        email: tcamp@delphi.com
  
        Copyright and Permissions Information:
  
        All U.S. and international rights are claimed by the author,
        Ted A. Campbell.
  
   This software is released under the terms of the GNU General
   Public License (GPL), which is distributed with this software
   in the file "COPYING".  The GPL specifies the terms under
   which users may copy and use the software in this distribution.
  
   A separate license is available for commercial distribution,
   for information on which you should contact the author.
  
***************************************************************/

/*---------------------------------------------------------------*/
/* NOTE: Modifications marked "JBV" were made by Jon B. Volkoff, */
/* 11/1995 (eidetics@cerf.net).                                  */
/*                                                               */
/* Those additionally marked with "DD" were at the suggestion of */
/* Dale DePriest (daled@cadence.com).                            */
/*                                                               */
/* Version 3.00 by Howard Wulf, AF5NE                            */
/*                                                               */
/* Version 3.10 by Howard Wulf, AF5NE                            */
/*                                                               */
/* Version 3.20 by Howard Wulf, AF5NE                            */
/*                                                               */
/*---------------------------------------------------------------*/


#define   TRUE     -1
#define   FALSE     0
#define   NDEBUG    1

#include         <assert.h>
#include         <ctype.h>
#include         <errno.h>
#include         <float.h>
#include         <limits.h>
#include         <locale.h>
#include         <math.h>
#include         <setjmp.h>
#include         <signal.h>
#include         <stdarg.h>
#include         <stddef.h>
#include         <stdio.h>
#include         <stdlib.h>
#include         <string.h>
#include         <time.h>


/***************************************************************
  
                          Definitions
  
***************************************************************/

/***************************************************************
  
            Define Major Hardware Implementation
           
            TTY is the default implementation.
            It is the most minimal, but the most
            universal hardware implementation.
           
            If you use TTY then check the settings
            in bwx_tty.c for your system.
         
  
***************************************************************/



/*
**
**  Here is where you should #include any implementation 
**  specific files to #define your preferences
** 
**
#include "bwb_user.h"
**
**
**
**
*/

/*
**
** Attempt to detect the Operating System
**
*/
#if defined(HAVE_UNIX)
/*
**
** UNIX-style Operating Systems
**
*/
#elif defined(HAVE_MSDOS)
/*
**
** MSDOS-style Operating Systems
**
*/
#elif defined(HAVE_CMS)
/*
**
** GCC 3 for CMS on Hercules
**
*/
#elif defined(HAVE_MVS)
/*
**
** GCC 3 for MVS on Hercules
**
*/
#elif defined(__CMS__)

#define HAVE_CMS TRUE

#elif defined(__MVS__)

#define HAVE_MVS TRUE

#elif defined(_DOS)

#define HAVE_MSDOS  TRUE

#elif defined(_WIN16)

#define HAVE_MSDOS  TRUE

#elif defined(_WIN32)

#define HAVE_MSDOS  TRUE

#elif defined(_WIN64)

#define HAVE_MSDOS  TRUE

#elif defined(__unix__)

#define HAVE_UNIX TRUE

#elif defined(__unix)

#define HAVE_UNIX TRUE

#elif defined(__APPLE__)

#define HAVE_UNIX TRUE

#elif defined(__MACH__)

#define HAVE_UNIX TRUE

#elif defined(__BORLANDC__)

#define HAVE_MSDOS  TRUE

#elif defined(__DMC__)

#define HAVE_MSDOS  TRUE

#elif defined(__WATCOM__)

#define HAVE_MSDOS  TRUE

#else
/*
**
** Unable to detect the operaating syystem
**
*/
#endif

/*-------------------------------------------------------------
                ENVIRONMENT specific configuration                
-------------------------------------------------------------*/

#if HAVE_UNIX
/*
**
** UNIX-style Operating Systems
**
*/
/* 
**
** If I understand correctly, my development environment is
** GCC 4.9 for Linux via CCTools for Android in a BusyBox 
** environment under a Java simulation of an ARM processor 
** on a Barnes & Noble $69 Nook Tablet.  What could possibly 
** go wrong?   When you finish laughing, it actually works.
** 
** I compile with: gcc -ansi -o bwbasic bw*.c
**
*/
#include <unistd.h>
#include <sys/stat.h>

#ifndef   DIRECTORY_CMDS
#define   DIRECTORY_CMDS     TRUE
#endif /* DIRECTORY_CMDS */

#ifndef   MKDIR_ONE_ARG
#define   MKDIR_ONE_ARG      FALSE
#endif /* MKDIR_ONE_ARG */

#ifndef   PERMISSIONS
#define   PERMISSIONS        0x0644
#endif /* PERMISSIONS */

#ifndef   DEF_EDITOR
#define   DEF_EDITOR         "nano"
#endif /* DEF_EDITOR */

#ifndef   HAVE_UNIX_GCC
#if       __GNUC__
#define   HAVE_UNIX_GCC      TRUE
#else
#define   HAVE_UNIX_GCC      FALSE
#endif /* __GNUC__ */
#endif /* HAVE_UNIX_GCC */

#endif /* HAVE_UNIX */

/*-----------------------------------------------------------*/

#if HAVE_MSDOS
/*
**
** MSDOS-style Operating Systems
**
*/
#if       __WATCOM__
#include  <direct.h>             /* OpenWatcom 1.9 for DOS */
#else
#include  <dir.h>                /* all others */
#endif /* __WATCOM__ */

#ifndef   DIRECTORY_CMDS
#define   DIRECTORY_CMDS     TRUE
#endif /* DIRECTORY_CMDS */

#ifndef   MKDIR_ONE_ARG
#define   MKDIR_ONE_ARG      TRUE
#endif /* MKDIR_ONE_ARG */

#ifndef   PERMISSIONS
#define   PERMISSIONS        0
#endif /* PERMISSIONS */

#ifndef   DEF_EDITOR
#define   DEF_EDITOR         "edit"
#endif /* DEF_EDITOR */

#ifndef   DEF_FILES
#define   DEF_FILES          "dir /w"
#endif /* DEF_FILES */

#ifndef   HAVE_UNIX_GCC
#define   HAVE_UNIX_GCC      FALSE
#endif /* HAVE_UNIX_GCC */

#endif /* HAVE_MSDOS */

/*-----------------------------------------------------------*/

#if       HAVE_CMS
/*
**
** GCC 3 for CMS on Hercules
**
*/
#include "bwd_six.h"

#ifndef   PROFILENAME
#define   PROFILENAME        "PROFILE BAS"
#endif /* PROFILENAME */

#if       FALSE
/*
**
** bwBASIC 3.10:  OPTION STDERR "LPRINT OUT"
**
*/
#ifndef   LPRINTFILENAME
#define   LPRINTFILENAME     "LPRINT OUT"
#endif /* LPRINTFILENAME */
#endif /* FALSE */

#if       FALSE
/*
**
** bwBASIC 3.10:  OPTION STDERR "ERROR OUT"
**
*/
#ifndef   ERRFILE
#define   ERRFILE            "ERROR OUT"
#endif /* ERRFILE */
#endif /* FALSE */

#if       FALSE
/*
**
** bwBASIC 3.20:  OPTION PROMPT "bwBASIC:" + CHR$(10)
**
*/
#ifndef   DEF_PROMPT
#define   DEF_PROMPT         "bwBASIC:\n"
#endif /* DEF_PROMPT */
#endif /* FALSE */

#ifndef   DEF_EXTENSION
#define   DEF_EXTENSION      " BAS"
#endif /* DEF_EXTENSION */

#ifndef   DIRECTORY_CMDS
#define   DIRECTORY_CMDS     FALSE
#endif /* DIRECTORY_CMDS */

#ifndef   HAVE_UNIX_GCC
#define   HAVE_UNIX_GCC      FALSE
#endif /* HAVE_UNIX_GCC */

#endif /* HAVE_CMS */

/*---------------------------------------------------------------*/

#ifdef    HAVE_MVS
/*
**
** GCC 3 for MVS on Hercules
**
*/
#include "bwd_six.h"

#ifndef   PROFILENAME
#define   PROFILENAME        "dd:profile"
#endif /* PROFILENAME */

#if       FALSE
/*
**
** bwBASIC 3.10:  OPTION STDERR "dd:lprint"
**
*/
#ifndef   LPRINTFILENAME
#define   LPRINTFILENAME     "dd:lprint"
#endif /* LPRINTFILENAME */
#endif /* FALSE */

#if       FALSE
/*
**
** bwBASIC 3.10:  OPTION STDERR "dd:errout"
**
*/
#ifndef   ERRFILE
#define   ERRFILE            "dd:errout"
#endif /* ERRFILE */
#endif /* FALSE */

#if       FALSE
/*
**
** bwBASIC 3.20:  OPTION PROMPT "bwBASIC:" + CHR$(10)
**
*/
#ifndef   DEF_PROMPT
#define   DEF_PROMPT         "bwBASIC:\n"
#endif /* DEF_PROMPT */
#endif /* FALSE */

#ifndef   DEF_EXTENSION
#define   DEF_EXTENSION      ""
#endif /* DEF_EXTENSION */

#ifndef   DIRECTORY_CMDS
#define   DIRECTORY_CMDS     FALSE
#endif /* DIRECTORY_CMDS */

#ifndef   HAVE_UNIX_GCC
#define   HAVE_UNIX_GCC      FALSE
#endif /* HAVE_UNIX_GCC */

#endif /* HAVE_MVS */


/***************************************************************
  
         This ends the section of definitions that
         users of bwBASIC might want to specify. 
         The following are internally defined.
        
         Note that you might want to #define the default
         FILES command and the default EDITOR above.
  
***************************************************************/



/*
**
**
**           If you want to change any of these values, 
**           then you should #define them above.
**
**
*/

#ifndef   HAVE_UNIX_GCC
/*
** TRUE:
** sleep() is an intrinsic C functions in GCC using -ansi 
** FALSE:
** sleep() is defined in bwb_int.c to do nothing 
**
*/
#define   HAVE_UNIX_GCC      FALSE
#endif /* HAVE_UNIX_GCC */

#ifndef   PROFILE
/*
**
** TRUE:
** automatically execute PROFILENAME line-by-line before parsing command line parameters
** FALSE:
** do not automatically execute PROFILENAME
**
*/
#define   PROFILE            TRUE
#endif /* PROFILE */

#ifndef   PROFILENAME
/* 
**
** Filename for PROFILE, only used when PROFILE == TRUE 
** This file contains the various OPTION commands
**
*/
#define   PROFILENAME        "profile.bas"
#endif /* PROFILENAME */

#if       FALSE
/*
**
** bwBASIC 3.10: OPTION STDERR "err.out" 
** bwBASIC 3.10: OPTION STDERR "LPRINT.OUT" 
**
*/
#ifndef   REDIRECT_STDERR
/*
**
** redirect STDERR
**
*/
#define   REDIRECT_STDERR    FALSE
#endif /* REDIRECT_STDERR */
#ifndef   ERRFILE
/*
**
** Filename for redirected stderr
**
*/
#define   ERRFILE            "err.out"
#endif /* ERRFILE */
#ifndef   LPRINTFILENAME
/*
**
** Filename for LPRINT output
**
*/
#define   LPRINTFILENAME     "LPRINT.OUT"
#endif /* LPRINTFILENAME */
#endif /* FALSE */

#ifndef   DIRECTORY_CMDS
/*
**
** enable MKDIR, CHDIR, RMDIR 
**
*/
#define   DIRECTORY_CMDS      TRUE
#endif /* DIRECTORY_CMDS */

#ifndef   MKDIR_ONE_ARG
/*
**
** TRUE if your mkdir has one argument
** only used when DIRECTORY_CMDS == TRUE 
**
*/
#define   MKDIR_ONE_ARG       FALSE
#endif /* MKDIR_ONE_ARG */

#ifndef   PERMISSIONS
/* 
** 
** permissions to set in a Unix-type system
** only used when MKDIR_ONE_ARG == FALSE 
**
*/
#define   PERMISSIONS        0x0644
#endif /* PERMISSIONS */

#if       FALSE
/*
**
** bwBASIC 3.20: OPTION PROMPT "bwBASIC: "
**
*/
#ifndef   DEFVNAME_PROMPT
/*
**
** variable name for PROMPT
**
*/
#define   DEFVNAME_PROMPT     "BWB.PROMPT$"
#endif /* DEFVNAME_PROMPT */
#endif /* FALSE */

#ifndef   DEF_PROMPT
/*
**
** default value for OPTION PROMPT
**
*/
#define   DEF_PROMPT          "bwBASIC: "
#endif /* DEF_PROMPT */

#ifndef   DEF_EXTENSION
/*
**
** default value for OPTION EXTENSION 
**
*/
#define   DEF_EXTENSION          ".bas"
#endif /* DEF_EXTENSION */

#if       FALSE
/* 
**
** bwBASIC 3.20: OPTION EDIT "vi" 
**
*/
#ifndef   DEFVNAME_EDITOR
/*
**
** variable name for EDIT command
**
*/
#define   DEFVNAME_EDITOR    "BWB.EDITOR$"
#endif /* DEFVNAME_EDITOR */
#endif /* FALSE */

#ifndef   DEF_EDITOR
/*
**
** default value for OPTION EDIT
**
**/
#define   DEF_EDITOR          "vi"
#endif /* DEF_EDITOR */

#if FALSE
/*
**
** bwBASIC 3.20: OPTION FILES "ls -Fx"
**
*/
#ifndef   DEFVNAME_FILES
/*
**
** variable name for FILES command
**
*/
#define   DEFVNAME_FILES      "BWB.FILES$"
#endif /* DEFVNAME_FILES */
#endif /* FALSE */

#ifndef   DEF_FILES
/*
**
** default value for OPTION FILES 
**
*/
#define   DEF_FILES           "ls -Fx"
#endif /* DEF_FILES */

#if       FALSE
/*
**
** bwBASIC 3.20: not used 
**
*/
#ifndef   DEFVNAME_COLORS
/* 
**
** variable name for COLORS 
**
*/
#define   DEFVNAME_COLORS     "BWB.COLORS"
#endif /* DEFVNAME_COLORS */
#ifndef   DEF_COLORS
/*
**
** default value for COLORS 
**
*/
#define   DEF_COLORS          256
#endif /* DEF_COLORS */
#endif /* FALSE */

#if       FALSE
/*
**
** bwBASIC 3.20: not used 
**
*/
#ifndef   DEFVNAME_IMPL
/*
**
** variable name for IMPLEMENTATION 
**
*/
#define   DEFVNAME_IMPL      "BWB.IMPLEMENTATION$"
#endif /* DEFVNAME_IMPL */
#ifndef   IMP_IDSTRING
/*
**
** default value for IMPLEMENTATION 
**
*/
#define   IMP_IDSTRING       "TTY"
#endif /* IMP_IDSTRING */
#endif /* FALSE */

#if       FALSE
/*
**
** bwBASIC 3.20: OPTION RENUM "renum" 
**
*/
#ifndef   DEFVNAME_RENUM
/*
**
** variable name for RENUM command 
**
*/
#define   DEFVNAME_RENUM     "BWB.RENUM$"
#endif /* DEFVNAME_RENUM */
#endif /* FALSE */

#ifndef   DEF_RENUM
/*
**
** default value for OPTION RENUM 
**
*/
#define   DEF_RENUM          "renum"
#endif /* DEF_RENUM */

#ifndef   EXECLEVELS
/*
**
** maximum EXEC stack levels
** only used to prevent run away recursion, such as:
** 100 GOSUB 100 
**
*/
#define   EXECLEVELS         255
#endif /* EXECLEVELS */

#ifndef   MAX_DIMS
/*
**
** maximum number of array dimensions 
**
*/
#define   MAX_DIMS           3
#endif /* MAX_DIMS */

#if       FALSE
/*
**
** bwBASIC 3.10: not used 
**
*/
#ifndef   ESTACKSIZE
/*
**
** maximum number of elements in expression stack 
**
*/
#define   ESTACKSIZE         64
#endif /* ESTACKSIZE */
#endif /* FALSE */

/*
** ============================================================
**
**
**           UNLESS YOU ARE WORKING ON THE INTERNALS, 
**                 YOU SHOULD NOT GO BEYOND HERE.
**         CHANGING ANY OF THESE VALUES IS NOT SUPPORTED.
**
** ============================================================
*/



/*
The relationship of numeric values is REQUIRED to be:
  
  MAXDBL >= MAXSNG >= MAXCUR >= MAXLNG >= MAXINT > MAXLEN >= MAXBYT > 0
  MINDBL <= MINSNG <= MINCUR <= MINLNG <= MININT < 0
  MINLEN == MINBYT == MINDEV == 0
  
  MAXDEV >  0
  MAXBYT == 255 
  MAXINT >= 32000
  MININT <= -32000
  MAXSNG >= 1E37
  MINSNG <= -1E37
*/

/*

   switch( TypeCode )
   {
   case ByteTypeCode:
      break;
   case IntegerTypeCode:
      break;
   case LongTypeCode:
      break;
   case CurrencyTypeCode:
      break;
   case SingleTypeCode:
      break;
   case DoubleTypeCode:
      break;
   case StringTypeCode:
      break;
   default:
      { WARN_INTERNAL_ERROR; return ...; }
   }

*/


/*-------------------------------------------------------------
                        BASIC BYTE
                        OPTION PUNCT BYTE "~"
-------------------------------------------------------------*/
#ifndef   ByteTypeCode
typedef unsigned char ByteType;
#define   MINBYT                     0
#define   MAXBYT                     ( UCHAR_MAX )
#define   ByteTypeCode               '1'
#endif /* ByteTypeCode */

/*-------------------------------------------------------------
                        BASIC INTEGER
                        OPTION PUNCT INTEGER "%"
-------------------------------------------------------------*/
#ifndef   IntegerTypeCode
typedef int IntegerType;
#define   MININT                     ( INT_MIN    )
#define   MAXINT                     ( INT_MAX    )
/*
**
** minimum USER line number
** must be > 0
**
*/
#define   MINLIN                     1
/*
**
** maximum USER line number
** must be < MAXINT 
**
*/
#define   MAXLIN                     ( MAXINT - 1 )
/*
**
** number of digits for line numbers
** line numbers 1 to 99999 use 5 digits
**
*/
#define   LineNumberDigits           5
/*
**
** default maximum line length, must be < MAXINT 
** OPTION LINE 255
**
*/
#define   MAX_LINE_LENGTH           255
#define   IntegerTypeCode            '2'
#endif /* IntegerTypeCode */

/*-------------------------------------------------------------
                        BASIC LONG
                        OPTION PUNCT LONG "&"
-------------------------------------------------------------*/
#ifndef   LongTypeCode
typedef long LongType;
#define   MINLNG                     ( LONG_MIN )
#define   MAXLNG                     ( LONG_MAX )

#define   HexScanFormat          "%lx%n"
#define   OctScanFormat          "%lo%n"
#define   LongTypeCode               '3'
#endif /* LongTypeCode */

/*-------------------------------------------------------------
                        BASIC CURRENCY
                        OPTION PUNCT CURRENCY "@"
-------------------------------------------------------------*/
#ifndef   CurrencyTypeCode
/*
**
** Deprecated, to be removed in bwBASIC 3.30
**
*/
typedef long CurrencyType;
#define   MINCUR                     ( LONG_MIN )
#define   MAXCUR                     ( LONG_MAX )
#define   CurrencyTypeCode           '4'
#endif /* CurrencyTypeCode */

/*-------------------------------------------------------------
                        BASIC SINGLE
                        OPTION PUNCT SINGLE "!"
-------------------------------------------------------------*/
#ifndef   SingleTypeCode
typedef float SingleType;
#define   MINSNG                     ( -FLT_MAX )
#define   MAXSNG                     (  FLT_MAX )
#define   SingleTypeCode             '5'
#endif /* SingleTypeCode */

/*-------------------------------------------------------------
                        BASIC DOUBLE
                        OPTION PUNCT DOUBLE "#"
-------------------------------------------------------------*/
#ifndef   DoubleTypeCode
typedef double DoubleType;
#define   MINDBL                     ( -DBL_MAX )
#define   MAXDBL                     (  DBL_MAX )
#define   DecScanFormat           "%lg%n"
#define   DoubleTypeCode              '6'
#endif /* DoubleTypeCode */

/*-------------------------------------------------------------
                        BASIC STRING
                        OPTION PUNCT STRING "$"
-------------------------------------------------------------*/
#ifndef   StringTypeCode
/*
**
** minimum length of a BASIC string
** must be zero
**
*/
#define   MINLEN                    0
/*
**
** maximum length of a BASIC string
** must be < MAXINT
*/
#define   MAXLEN                    255
#define   StringTypeCode            '7'
#endif /* StringTypeCode */


/*-------------------------------------------------------------
                        BASIC DEVICE
-------------------------------------------------------------*/
#ifndef   MINDEV
/*
** 
** minimum numbwe of OPEN files
** must be zero
**
*/
#define   MINDEV                     0
#endif /* MINDEV */

#ifndef   MAXDEV
/*
** 
** maximum numbwe of OPEN files
** not counting stdin, stdout, stderr
**
*/
#define   MAXDEV                     ( FOPEN_MAX - 3 )
#endif /* MAXDEV */

#if       FALSE
/* 
**
** bwBASIC 3.20: OPTION PUNCT FILENUM "#" 
**
*/
#ifndef   FileNumberPrefix
#define   FileNumberPrefix           '#'
#endif /* FileNumberPrefix */
#endif /* FALSE */


/*-------------------------------------------------------------
                        BASIC MISCELLANEOUS
-------------------------------------------------------------*/


#ifndef   NameLengthMax
/*
**
** maximum BASIC keyword length
** Applies to ALL keywords in BASIC, incuding:
** variables, functions, subroutines, commands and labels.
**
*/
#define   NameLengthMax           40
#endif /* NameLengthMax */

#ifndef   SIGNIFICANT_DIGITS
/* 
** 
** default setting for OPTION DIGITS
** minimum is 6 for BASIC 
** OPTION DIGITS 6
**
*/
#define   SIGNIFICANT_DIGITS     6
#endif /* SIGNIFICANT_DIGITS */

#ifndef   EXPONENT_DIGITS
/*
**
** number of exrad digits
** minimum value is 2 for BASIC 
**
*/
#if       (DBL_MAX_10_EXP) < 100
/*
**
** Exponenet range is within 1E-99 to 1E+99
** ANSI C89 requires at least 1E-37 to 1E+37 
**
*/
#define   EXPONENT_DIGITS        2
#elif     (DBL_MAX_10_EXP) < 1000
/*
**
** Exponenet range is within 1E-999 to 1E+999
** includes ANSI/IEEE Std 754-1985 
**
*/
#define   EXPONENT_DIGITS        3
#elif     (DBL_MAX_10_EXP) < 10000
/*
**
** Exponenet range is within 1E-9999 to 1E+9999
**
*/
#define   EXPONENT_DIGITS        4
#elif     (DBL_MAX_10_EXP) < 100000
/*
**
** Exponenet range is within 1E-99999 to 1E+99999
**
*/
#define   EXPONENT_DIGITS        5
#else
/*
**
** Exponenet range is within 1E-999999 to 1E+999999
**
*/
#define   EXPONENT_DIGITS        6
#endif
#endif /* EXPONENT_DIGITS */

#ifndef   ZONE_WIDTH
/*
**
** default setting for OPTION ZONE
** ECMA-55, Section 14.4 
**
*/
#define   ZONE_WIDTH ( SIGNIFICANT_DIGITS + EXPONENT_DIGITS + 6 )
#endif /* ZONE_WIDTH */

#ifndef   MINIMUM_DIGITS
/*
**
** minimum setting for OPTION DIGITS 
**
*/
#define   MINIMUM_DIGITS         1
#endif /* MINIMUM_DIGITS */

#ifndef   MAXIMUM_DIGITS
/*
**
** maximum setting for OPTION DIGITS 
**
*/
#define   MAXIMUM_DIGITS         ( DBL_DIG )
#endif /* MAXIMUM_DIGITS */

#ifndef   MINIMUM_SCALE
/*
**
** minimum setting for OPTION SCALE
** zero disables scaling 
**
*/
#define   MINIMUM_SCALE          0
#endif /* MINIMUM_SCALE */

#ifndef   MAXIMUM_SCALE
/*
** 
** maximum setting for OPTION SCALE 
**
*/
#define   MAXIMUM_SCALE          ( DBL_DIG )
#endif /* MAXIMUM_SCALE */

#ifndef   MINIMUM_ZONE
/* 
**
** minimum setting for OPTION ZONE 
**
*/
#define   MINIMUM_ZONE           1
#endif /* MINIMUM_ZONE */

#ifndef   MAXIMUM_ZONE
/* 
**
** maximum setting for OPTION ZONE 
**
*/
#define   MAXIMUM_ZONE           79
#endif /* MAXIMUM_ZONE */

#ifndef   NUMLEN
/* 
**
** small buffer for converting numbers to strings
** FormatBasicNumber, sprintf("%f"), sprintf("%d") and so on 
**
*/
#define   NUMLEN                 64
#endif /* NUMLEN */

#ifndef   MAX_ERR_LENGTH
/*
**
** maximum length of ERROR$ 
**
*/
#define   MAX_ERR_LENGTH          63
#endif /* MAX_ERR_LENGTH */

#ifndef   MIN
/* 
**
** minimum of two numbers 
**
*/
#define   MIN( X, Y )            ( (X) < (Y) ? (X) : (Y) )
#endif /* MIN */

#ifndef   MAX
/*
**
** maximum of two numbers 
**
*/
#define   MAX( X, Y )            ( (X) > (Y) ? (X) : (Y) )
#endif /* MAX */

#if       FALSE
/*
**
** bwBASIC 3.20: not used 
**
*/
#ifndef   PRN_SPC
/*
**
** internal code for SPC(X), next character is X.
**
*/
#define   PRN_SPC                0x01
#endif /* PRN_SPC */
#endif /* FALSE */

#if       FALSE
/*
**
** bwBASIC 3.20: not used 
**
*/
#ifndef   PRN_TAB
/*
**
** internal code for TAB(X), next character is X.
**
*/
#define   PRN_TAB                0x02
#endif /* PRN_TAB */
#endif /* FALSE */

#ifndef   NulChar
/*
**
** the character that terminates a C string, commonly CHR$(0)
**
*/
#define   NulChar                 '\0'        /* NUL */
#endif /* NulChar */

#ifndef   THE_PRICE_IS_RIGHT
/* 
**
** enable various simple techinques to improve execution speed  
**
*/
#define   THE_PRICE_IS_RIGHT      TRUE
#endif /* THE_PRICE_IS_RIGHT */

#ifndef   MAINTAINER_BUFFER_LENGTH
/*
**
** The length of buffers for MAINTINER commands
**
**/
#define   MAINTAINER_BUFFER_LENGTH       1023
#endif /* MAINTAINER_BUFFER_LENGTH */

/*-------------------------------------------------------------
                        FUNCTION PARAMETER TYPES
-------------------------------------------------------------*/
/* 
** Bit 0 is the first parameter, bit 31 is the 32nd parameter.  
** If the parameter is a string then the bit is set.
** If the parameter is a number then the bit is clear.
*/
typedef unsigned long ParamBitsType;

#ifndef   MAX_FARGS
#define   MAX_FARGS  ( sizeof( ParamBitsType ) * CHAR_BIT / 1 )
#endif /* MAX_FARGS */


#define PSTR( N )              ( 1 << ( N - 1 ) )        /* STRING parameter # 1 is bit 0 SET */
#define PNUM( N )              ( 0              )        /* NUMBER parameter # 1 is bit 0 CLR */
#define PNONE                  ( 0              )        /* function has no parameters */

#define P1STR PSTR(1)
#define P2STR PSTR(2)
#define P3STR PSTR(3)
#define P4STR PSTR(4)

#define P1NUM PNUM(1)
#define P2NUM PNUM(2)
#define P3NUM PNUM(3)
#define P4NUM PNUM(4)


/*-------------------------------------------------------------
                        FUNCTION PARAMETER TESTS
-------------------------------------------------------------*/
/* 
** Nibble 0 is the first parameter, 
** Nibble 7 is the 8th parameter.  
** Each nibble is P1ANY and so on. 
*/
typedef unsigned long ParamTestType;
#define MAX_TESTS  ( sizeof( ParamTestType ) * CHAR_BIT / 4 )

/*            0x87654321 <- Parameter Number (max # of Range-Checked parameters to INTRINSIC functions is 8) */
#define P1ERR 0X00000000        /* INTERNAL ERROR */
#define P1ANY 0X00000001        /* X is any valid number    , A$ is any valid string      */
#define P1BYT 0x00000002        /* MIN_BYT  <= X <= MAX_BYT , LEN(A$) >= sizeof(char)     */
#define P1INT 0x00000003        /* SHRT_MIN <= X <= SHRT_MAX, LEN(A$) >= sizeof(int)      */
#define P1LNG 0x00000004        /* LONG_MIN <= X <= LONG_MAX, LEN(A$) >= sizeof(long)     */
#define P1CUR 0x00000005        /* LONG_MIN <= X <= LONG_MAX, LEN(A$) >= sizeof(long)     */
#define P1FLT 0x00000006        /* MIN_FLT  <= X <= MAX_FLT , LEN(A$) >= sizeof(float)    */
#define P1DBL 0x00000007        /* MIN_DBL  <= X <= MAX_DBL , LEN(A$) >= sizeof(double)   */
#define P1DEV 0x00000008        /* RESERVED                 , RESERVED                    */
#define P1LEN 0x00000009        /* MIN_STR  <= X <= MAX_STR , RESERVED                    */
#define P1POS 0x0000000A        /* MIN_STR  <  X <= MAX_STR , RESERVED                    */
#define P1COM 0x0000000B        /* X in (1,2,3,4) COMx      , RESERVED                    */
#define P1LPT 0x0000000C        /* X in (0,1,2,3) PRN,LPTx  , RESERVED                    */
#define P1GTZ 0x0000000D        /* X  >    0                , RESERVED                    */
#define P1GEZ 0x0000000E        /* X  >=   0                , RESERVED                    */
#define P1NEZ 0x0000000F        /* X  <>   0                , RESERVED                    */

#define P2ERR (P1ERR << 4)
#define P2ANY (P1ANY << 4)
#define P2BYT (P1BYT << 4)
#define P2INT (P1INT << 4)
#define P2LNG (P1LNG << 4)
#define P2CUR (P1CUR << 4)
#define P2FLT (P1FLT << 4)
#define P2DBL (P1DBL << 4)
#define P2DEV (P1DEV << 4)
#define P2LEN (P1LEN << 4)
#define P2POS (P1POS << 4)
#define P2COM (P1COM << 4)
#define P2LPT (P1LPT << 4)
#define P2GTZ (P1GTZ << 4)
#define P2GEZ (P1GEZ << 4)
#define P2NEZ (P1NEZ << 4)

#define P3ERR (P1ERR << 8)
#define P3ANY (P1ANY << 8)
#define P3BYT (P1BYT << 8)
#define P3INT (P1INT << 8)
#define P3LNG (P1LNG << 8)
#define P3CUR (P1CUR << 8)
#define P3FLT (P1FLT << 8)
#define P3DBL (P1DBL << 8)
#define P3DEV (P1DEV << 8)
#define P3LEN (P1LEN << 8)
#define P3POS (P1POS << 8)
#define P3COM (P1COM << 8)
#define P3LPT (P1LPT << 8)
#define P3GTZ (P1GTZ << 8)
#define P3GEZ (P1GEZ << 8)
#define P3NEZ (P1NEZ << 8)

#define P4ERR (P1ERR << 12)
#define P4ANY (P1ANY << 12)
#define P4BYT (P1BYT << 12)
#define P4INT (P1INT << 12)
#define P4LNG (P1LNG << 12)
#define P4CUR (P1CUR << 12)
#define P4FLT (P1FLT << 12)
#define P4DBL (P1DBL << 12)
#define P4DEV (P1DEV << 12)
#define P4LEN (P1LEN << 12)
#define P4POS (P1POS << 12)
#define P4COM (P1COM << 12)
#define P4LPT (P1LPT << 12)
#define P4GTZ (P1GTZ << 12)
#define P4GEZ (P1GEZ << 12)
#define P4NEZ (P1NEZ << 12)





/***************************************************************
  
                       Structures
  
***************************************************************/

/*-------------------------------------------------------------
                        OPTION VERSION bitmask
-------------------------------------------------------------*/
typedef unsigned long OptionVersionType;        /* upto 32 BASIC dialects */

/*-------------------------------------------------------------
                        Result of attempt to parse
-------------------------------------------------------------*/
typedef enum
{
  RESULT_UNPARSED = 1,
  RESULT_ERROR,
  RESULT_SUCCESS
} ResultType;

/*-------------------------------------------------------------
                        STRINGS
-------------------------------------------------------------*/
struct StringStructure
{
  size_t length;                /* length of string */
  char *sbuffer;                /* pointer to string buffer */
};
typedef struct StringStructure StringType;


/*-------------------------------------------------------------
                        VARIABLES
-------------------------------------------------------------*/
union ValuePtrUnion
{
  DoubleType *Number;                /* memory for number */
  StringType *String;                /* memory for string */
};
typedef union ValuePtrUnion ValuePtrType;

struct VariableStructure
{
  struct VariableStructure *next;      /* next variable in chain */
  char name[NameLengthMax + 1];        /* name */
  ValuePtrType Value;                  /* memory for values */
  size_t array_units;                  /* total number of units of memory */
  int LBOUND[MAX_DIMS];                /* lower bound for each dimension */
  int UBOUND[MAX_DIMS];                /* upper bound for each dimension */
  int VINDEX[MAX_DIMS];                /* current index in each dimension */
  int dimensions;                      /* number of dimensions, 0 == scalar */
  unsigned char VariableFlags;         /* VARIABLE_... */
  char VariableTypeCode;               /* StringTypeCode and so on */
};
typedef struct VariableStructure VariableType;
#define VAR_IS_STRING( v ) ( v->VariableTypeCode == StringTypeCode )
/* VariableFlags */
#define VARIABLE_RESERVED_01 0x01        /* reserved for future use */
#define VARIABLE_RESERVED_02 0x02        /* reserved for future use */
#define VARIABLE_RESERVED_04 0x04        /* reserved for future use */
#define VARIABLE_CONSTANT    0x08        /* CONST variable: value cannot be changed again */
#define VARIABLE_VIRTUAL     0x10        /* VIRTUAL variable: values are stored in disk file */
#define VARIABLE_DISPLAY     0x20        /* DSP variable: display every assignment */
#define VARIABLE_PRESET      0x40        /* preset variable: CLEAR should not delete */
#define VARIABLE_COMMON      0x80        /* COMMON variable: available to CHAINed program */


/*-------------------------------------------------------------
                        LINES
-------------------------------------------------------------*/
struct LineStructure
{
  struct LineStructure *next;      /* pointer to next line in chain */
  struct LineStructure *OtherLine; /* pointer to other line in loops */
  char *buffer;                    /* buffer to hold the line */
  int number;                      /* line number */
  int position;                    /* current position in line */
  int cmdnum;                      /* C_... */
  int Startpos;                    /* start of rest of line read from buffer */
  int Indention;                   /* structure command indention level */
  int IncludeLevel;                /* %INCLUDE file level */
  unsigned char LineFlags;         /* LINE_... */
};
typedef struct LineStructure LineType;
/* LineFlags */
#define LINE_EXECUTED        0x01        /* line was executed */
#define LINE_NUMBERED        0x02        /* line was manually numbered */
#define LINE_BREAK           0x04        /* BREAK line */
#define LINE_USER            0x08        /* USER line executing from console */
#define LINE_RESERVED_10     0x10        /* reserved for future use */
#define LINE_RESERVED_20     0x20        /* reserved for future use */
#define LINE_RESERVED_40     0x40        /* reserved for future use */
#define LINE_RESERVED_80     0x80        /* reserved for future use */


/*-------------------------------------------------------------
               USER FUNCTIONS, SUBS and LABELS
-------------------------------------------------------------*/
struct UserFunctionStructure
{
  struct UserFunctionStructure *next;
  char *name;
  char ReturnTypeCode;                    /* StringTypeCode and so on */
  unsigned char ParameterCount;           /* 0..MAX_FARGS, 255 == VARIANT (...) */
  ParamBitsType ParameterTypes;           /* parameter signature, must hold MAX_FARGS bits */
  LineType *line;                         /* points to the FUNCTION, SUB, or LABEL line */
  int startpos;                           /* starting position in line */
  VariableType *local_variable;           /* local variables for this function or sub */
  OptionVersionType OptionVersionBitmask; /* OPTION VERSION bitmask */
};
typedef struct UserFunctionStructure UserFunctionType;


/*-------------------------------------------------------------
                      INTRINSIC FUNCTIONS
-------------------------------------------------------------*/
struct IntrinsicFunctionStructure
{
  const int FunctionID;                      /* F_... */
  const char *Syntax;                        /* the syntax of the function */
  const char *Description;                   /* the description of the function */
  const char *Name;                          /* the name of the function, such as "MID$" */
  const char ReturnTypeCode;                 /* StringTypeCode and so on */
  const unsigned char ParameterCount;        /* 0..MAX_FARGS, 255 == VARIANT (...) */
  const ParamBitsType ParameterTypes;        /* parameter signature, holds MAX_FARGS bits */
  const ParamTestType ParameterTests;        /* parameter checks, must hold 8 nibbles, only first 8 parameters */
  OptionVersionType OptionVersionBitmask;    /* OPTION VERSION bitmask */
};
typedef struct IntrinsicFunctionStructure IntrinsicFunctionType;
extern IntrinsicFunctionType IntrinsicFunctionTable[ /* NUM_FUNCTIONS */ ];
extern const size_t NUM_FUNCTIONS;


/*-------------------------------------------------------------
                        INTRINSIC COMMANDS
-------------------------------------------------------------*/
struct CommandStructure
{
  const int CommandID;                     /* C_... */
  const char *Syntax;                      /* the syntax of the command */
  const char *Description;                 /* the description of the command */
  const char *name;                        /* the name of the command, such as "PRINT" */
  OptionVersionType OptionVersionBitmask;  /* OPTION VERSION bitmask */
};
typedef struct CommandStructure CommandType;
extern CommandType IntrinsicCommandTable[ /* NUM_COMMANDS  */ ];
extern const size_t NUM_COMMANDS;


/*-------------------------------------------------------------
                        FILES
-------------------------------------------------------------*/
struct FileStructure
{
  struct FileStructure *next;
  int FileNumber;              /* 1-based file number used to OPEN the file ( 0 for SYSIN/SYSOUT, -1 for SYSPRN */
  int DevMode;                 /* DEVMODE_... */
  int width;                   /* 1-based width for OUTPUT and APPEND; reclen for RANDOM; not used for INPUT or BINARY */
  int col;                     /* 1-based current column for OUTPUT and APPEND */
  int row;                     /* 1-based current row for OUTPUT and APPEND */
  int EOF_LineNumber;          /* IF END # filenumber THEN EOF_linenumber */
  FILE *cfp;                   /* C file pointer for this device */
  char *buffer;                /* pointer to character buffer for RANDOM */
  char delimit;                /* DELIMIT for READ and WRITE */
  char *FileName;              /* File Name */
};
typedef struct FileStructure FileType;
/* DevMode */
#define DEVMODE_CLOSED     0x00
#define DEVMODE_INPUT      0x01
#define DEVMODE_OUTPUT     0x02
#define DEVMODE_RANDOM     0x04
#define DEVMODE_APPEND     0x08
#define DEVMODE_VIRTUAL    0x10
#define DEVMODE_BINARY     0x20
#define DEVMODE_X40        0x40 /* reserved for future use */
#define DEVMODE_X80        0x80 /* reserved for future use */
#define DEVMODE_READ    (DEVMODE_INPUT  | DEVMODE_RANDOM                  | DEVMODE_BINARY )
#define DEVMODE_WRITE   (DEVMODE_OUTPUT | DEVMODE_RANDOM | DEVMODE_APPEND | DEVMODE_BINARY )


/*-------------------------------------------------------------
                        FIELDS in a RANDOM file
-------------------------------------------------------------*/
struct FieldStructure
{
  /* only used for RANDOM files in dialects with a FIELD command */
  struct FieldStructure *next;
  FileType *File;
  int FieldOffset;
  int FieldLength;
  VariableType *Var;
  int VINDEX[MAX_DIMS];                /* current position in array */
};
typedef struct FieldStructure FieldType;


/*-------------------------------------------------------------
                        VIRTUAL VARIABLES
-------------------------------------------------------------*/
struct VirtualStructure
{
  /* only used for VIRTUAL variables in dialects with a DIM # command */
  struct VirtualStructure *next;
  int FileNumber;                /* note: the file can be opened AFTER the variable is declared */
  size_t FileOffset;             /* byte offset from the beginning of the file */
  int FileLength;                /* sizeof( DoubleType ) or Fixed String Length */
  VariableType *Variable;        /* the variable */
};
typedef struct VirtualStructure VirtualType;


/*-------------------------------------------------------------
                        STACK
-------------------------------------------------------------*/
struct StackStructure
{
  struct StackStructure *next;
  LineType *line;                /* line for execution */
  int ExecCode;                  /* EXEC_... */
  VariableType *local_variable;  /* local variables of FUNCTION and variable of FOR */
  DoubleType for_step;           /* STEP value of FOR */
  DoubleType for_target;         /* TO value of FOR */
  LineType *LoopTopLine;         /* top line of FOR, DO, WHILE, UNTIL */
  int OnErrorGoto;               /* ON ERROR GOTO line */
};
typedef struct StackStructure StackType;
/* ExecCode */
#define EXEC_NORM        0
#define EXEC_GOSUB       1
#define EXEC_FOR         2
#define EXEC_FUNCTION    3
#define EXEC_POPPED      4


/*-------------------------------------------------------------
                        VERSION
-------------------------------------------------------------*/
struct VersionStructure
{
  const char *Name;                /* OPTION VERSION name$ */
  const OptionVersionType OptionVersionValue;        /* ( D64 ,...) */
  const char *ID;                  /* ("D64",...) */
  const char *Description;         /* short description of this dialect */
  const char *ReferenceTitle;      /* Reference document */
  const char *ReferenceAuthor;     /* Reference document */
  const char *ReferenceCopyright;  /* Reference document */
  const char *ReferenceURL1;       /* Reference document */
  const char *ReferenceURL2;       /* Reference document */
  unsigned short OptionFlags;
  int OptionReclenInteger;         /* OPTION RECLEN      integer: Default RANDOM record length */
  int OptionBaseInteger;           /* OPTION BASE        integer: Default lower bound for arrays */
  char *OptionDateFormat;          /* OPTION DATE        format$: strftime() format for DATE$ */
  char *OptionTimeFormat;          /* OPTION TIME        format$: strftime() format for TIME$ */
  char OptionStringChar;           /* OPTION STRING        char$: Suffix for StringTypeCode  , commonly '$' */
  char OptionDoubleChar;           /* OPTION DOUBLE        char$: Suffix for DoubleTypeCode  , commonly '#' */
  char OptionSingleChar;           /* OPTION SINGLE        char$: Suffix for SingleTypeCode  , commonly '!' */
  char OptionCurrencyChar;         /* OPTION CURRENCY      char$: Suffix for CurrencyTypeCode, commonly '@' */
  char OptionLongChar;             /* OPTION LONG          char$: Suffix for LongTypeCode    , commonly '&' */
  char OptionIntegerChar;          /* OPTION INTEGER       char$: Suffix for IntegerTypeCode , commonly '%' */
  char OptionByteChar;             /* OPTION BYTE          char$: Suffix for ByteTypeCode    , commonly '~' */
  char OptionQuoteChar;            /* OPTION QUOTE         char$: Quote, commonly a double-quote */
  char OptionCommentChar;          /* OPTION COMMENT       char$: Comment, commonly a single-quote */
  char OptionStatementChar;        /* OPTION STATEMENT     char$: Statement Seperator, commonly ':' */
  char OptionPrintChar;            /* OPTION PRINT         char$: PRINT Statement, commonly '?' */
  char OptionInputChar;            /* OPTION INPUT         char$: INPUT Statement, commonly '!' */
  char OptionImageChar;            /* OPTION IMAGE         char$: IMAGE Statement, commonly ':' */
  char OptionLparenChar;           /* OPTION LPAREN        char$: Left Parenthesis, commonly '(' */
  char OptionRparenChar;           /* OPTION RPAREN        char$: Right Parenthesis, commonly ')' */
  char OptionFilenumChar;          /* OPTION FILENUM       char$: File Number, commonly '#' */
  char OptionAtChar;               /* OPTION AT            char$: PRINT AT, commonly '@' */
  char OptionUsingDigit;           /* OPTION USING DIGIT   char$: PRINT USING Digit placeholder, commonly '#' */
  char OptionUsingComma;           /* OPTION USING COMMA   char$: PRINT USING Comma, such as thousands and millions, commonly ',' */
  char OptionUsingPeriod;          /* OPTION USING PERIOD  char$: PRINT USING Period, such as between dollars and cents, commonly '.' */
  char OptionUsingPlus;            /* OPTION USING PLUS    char$: PRINT USING Plus  sign, positive value, commonly '+' */
  char OptionUsingMinus;           /* OPTION USING MINUS   char$: PRINT USING Minus sign, negative value, commonly '-' */
  char OptionUsingExrad;           /* OPTION USING EXRAD   char$: PRINT USING Exponential format, commonly '^' */
  char OptionUsingDollar;          /* OPTION USING DOLLAR  char$: PRINT USING Currency symbol, such as dollar, commonly '$' */
  char OptionUsingFiller;          /* OPTION USING FILLER  char$: PRINT USING Filler, such as payroll checks, commonly '*' */
  char OptionUsingLiteral;         /* OPTION USING LITERAL char$: PRINT USING Literal, commonly '_' */
  char OptionUsingFirst;           /* OPTION USING FIRST   char$: PRINT USING First character of a string, commonly '!' */
  char OptionUsingAll;             /* OPTION USING ALL     char$: PRINT USING All of a string, commonly '&' */
  char OptionUsingLength;          /* OPTION USING LENGTH  char$: PRINT USING Length of a string, commonly '%' */
};
typedef struct VersionStructure VersionType;
extern VersionType bwb_vertable[ /* NUM_VERSIONS  */ ];        /* table of predefined versions  */
extern const size_t NUM_VERSIONS;        /* upto 32 BASIC dialects */
/* OptionVersionValue */
#define B15 (1UL<< 0)                /* Bywater    */
#define S70 (1UL<< 1)                /* CALL/360   */
#define C77 (1UL<< 2)                /* CBASIC-II  */
#define D64 (1UL<< 3)                /* Dartmouth  */
#define E78 (1UL<< 4)                /* ECMA-55    */
#define E86 (1UL<< 5)                /* ECMA-116   */
#define G74 (1UL<< 6)                /* GCOS       */
#define HB1 (1UL<< 7)                /* Handbook1  */
#define HB2 (1UL<< 8)                /* Handbook2  */
#define H80 (1UL<< 9)                /* Heath      */
#define G65 (1UL<<10)                /* Mark-I     */
#define G67 (1UL<<11)                /* Mark-II    */
#define M80 (1UL<<12)                /* MBASIC     */
#define D73 (1UL<<13)                /* PDP-8      */
#define D70 (1UL<<14)                /* PDP-11     */
#define R86 (1UL<<15)                /* RBASIC     */
#define D71 (1UL<<16)                /* RSTS-11    */
#define I70 (1UL<<17)                /* System/360 */
#define I73 (1UL<<18)                /* System/370 */
#define T80 (1UL<<19)                /* TRS-80     */
#define V09 (1UL<<20)                /* Vintage    */
#define T79 (1UL<<21)                /* XBASIC     */
#define H14 (1UL<<22)                /* Haart      */
#define B93 (1UL<<23)                /* Bywater-2  */

/* OptionFlags */
#define OPTION_STRICT_ON      0x0001        /* Do NOT allow implicit DIM */
#define OPTION_ANGLE_DEGREES  0x0002        /* Use degrees instead of radians */
#define OPTION_BUGS_ON        0x0004        /* ON ... , FOR ..., VAL("X") */
#define OPTION_LABELS_ON      0x0008        /* Labels allowed */
#define OPTION_COMPARE_TEXT   0x0010        /* Case-Insensitive string comparison */
#define OPTION_BUGS_BOOLEAN   0x0020        /* Boolean returns 1 or 0 instead of bitwise */
#define OPTION_COVERAGE_ON    0x0040        /* track BASIC lines actually executed */
#define OPTION_TRACE_ON       0x0080        /* dump BASIC stack trace when FATAL error */
#define OPTION_ERROR_GOSUB    0X0100        /* error causes GOSUB instead of GOTO */
#define OPTION_EXPLICIT_ON    0x0200        /* all variables must be declared via DIM */
#define OPTION_ANGLE_GRADIANS 0x0400        /* Use gradians instead of radians */
#define OPTION_RESERVED_0800  0x0800        /* reserved for future use */
#define OPTION_RESERVED_1000  0x1000        /* reserved for future use */
#define OPTION_RESERVED_2000  0x2000        /* reserved for future use */
#define OPTION_RESERVED_4000  0x4000        /* reserved for future use */
#define OPTION_RESERVED_8000  0x8000        /* reserved for future use */
#define IS_CHAR( X, Y ) ( (X) == (Y) && (Y) != NulChar )        /* used with the Option...Char settings */


/*-------------------------------------------------------------
                        VARIANT
-------------------------------------------------------------*/
struct VariantStructure
{
  char VariantTypeCode;   /* StringTypeCode and so on, NulChar == unknown */
  DoubleType Number;      /* only when VariamtTypeCode != StringTypeCode */
  size_t Length;          /* only when VariantTypeCode == StringTypeCode */
  char *Buffer;           /* only when VariantTypeCode == StringTypeCode */
};
typedef struct VariantStructure VariantType;
#define CLEAR_VARIANT( X ) bwb_memset( (X), 0, sizeof( VariantType ) )
#define RELEASE_VARIANT( X ) if( (X)->Buffer != NULL ) { free( (X)->Buffer ); (X)->Buffer = NULL; (X)->Length = 0; }
/* 
any routine changing the TypeCode is required to calloc() or free() the Buffer, 
this is checked by is_string_type() and is_number_type() in bwb_exp.c 
*/


/*-------------------------------------------------------------
                        GLOBAL
-------------------------------------------------------------*/
struct GlobalStruct
{
  /* these values are not changed by OPTION VERSION */
  jmp_buf mark;                        /* break_handler() jumps here */
  int program_run;                     /* has the command-line program been run? */
  VersionType *CurrentVersion;         /* OPTION VERSION */
  LineType *ThisLine;                  /* currently executing line */
  int IsScanRequired;                  /* TRUE == program needs to be rescanned */
  int IsTraceOn;                       /* TRUE == TRON, FALSE == TROFF */
  int IsInteractive;                   /* always TRUE */
  int IsCommandLineFile;               /* TRUE == executing a program from the Operating System command line */
  int IsErrorPending;                  /* TRUE == ERR, ERL and ERROR$ have been set */
  int IsTimerOn;                       /* TRUE == ON TIMER ... GOSUB ... enabled */
  int IsPrinter;                       /* CBASIC-II: LPRINTER sets to TRUE, CONSOLE sets to FALSE */
  int LPRINT_NULLS;                    /* LPRINT_FILE_NUMBER */
  int SCREEN_ROWS;                     /* CONSOLE_FILE_NUMBER */
  int AutomaticLineNumber;             /* AUTO */
  int AutomaticLineIncrement;          /* AUTO */
  int LastInputCount;                  /* 0 == none */
  int LastLineNumber;                  /* LIST, LLIST */
  int LastFileNumber;                  /* 0 == none */
  int StartTimeInteger;                /* seconds after midnight when RUN was executed */
  int NextValidLineNumber;             /* verify line number order */
  int StackDepthInteger;               /* stack depth count */
  LineType *DataLine;                  /* current DATA line for READ */
  int DataPosition;                    /* current position in DataLine */
  int ERR;                             /* ERR */
  LineType *ERL;                       /* ERL */
  char *ERROR4;                        /* ERROR$ */
  DoubleType LastDeterminant;          /* 0 == error */
  DoubleType RESIDUE;                  /* for RBASIC's RESIDUE function */
  FILE *ExternalInputFile;             /* --TAPE tapefile.inp */
  int OnTimerLineNumber;               /* ON TIMER ... GOSUB ... */
  DoubleType OnTimerCount;             /* ON TIMER ... GOSUB ... */
  DoubleType OnTimerExpires;           /* ON TIMER ... GOSUB ... */
  LineType *ContinueLine;              /* CONT */
  int IncludeLevel;                    /* %INCLUDE */
  DoubleType OptionSleepDouble;        /* OPTION SLEEP    double  */
  int OptionIndentInteger;             /* OPTION INDENT   integer */
  int OptionTerminalType;              /* OPTION TERMINAL type    */
  int OptionRoundType;                 /* OPTION ROUND    type    */
  char *OptionEditString;              /* OPTION EDIT     string$ */
  char *OptionFilesString;             /* OPTION FILES    string$ */
  char *OptionRenumString;             /* OPTION RENUM    string$ */
  char *OptionPromptString;            /* OPTION PROMPT   string$ */
  char *OptionExtensionString;         /* OPTION EXTENSION string$ */
  int OptionScaleInteger;              /* OPTION SCALE    integer */
  int OptionDigitsInteger;             /* OPTION DIGITS   integer */
  int OptionZoneInteger;               /* OPTION ZONE     integer */
  LineType *StartMarker;               /* BASIC program starting marker */
  LineType *UserMarker;                /* USER (immediate mode) starting marker */
  LineType *EndMarker;                 /* ending marker for both StartMarker and UserMarker */
  char *MaxLenBuffer;                  /* MAXLEN, for bwb_exp.c */
  char *NumLenBuffer;                  /* NUMLEN, for FormatBasicNumber(), sprintf("%d") and so on */
  char *ConsoleOutput;                 /* MAX_LINE_LENGTH, usually prompts and error messages */
  char *ConsoleInput;                  /* MAX_LINE_LENGTH, usually console and INPUT */
  VariableType *VariableHead;          /* USER Variable list */
  UserFunctionType *UserFunctionHead;  /* USER function-sub-label list */
  StackType *StackHead;                /* USER Stack list */
  FileType *FileHead;                  /* USER file list (not SYSIN, SYSOUT, or SYSPRN) */
  FieldType *FieldHead;                /* USER field list */
  VirtualType *VirtualHead;            /* USER Virtual cross-reference list */
  FileType *SYSIN;                     /* FileNumber = 0, INPUT, usually stdin, OPTION SYSIN  */
  FileType *SYSOUT;                    /* FileNumber = 0, PRINT, usually stdout, OPTION SYSOUT */
  FileType *SYSPRN;                    /* FileNumber < 0, LPRINT, usually stderr, OPTION SYSPRN */
  FileType *CurrentFile;               /* current file for PRINT or INPUT */
  char *UseParameterString;            /* CHAIN ... USE */
  int DefaultVariableType[26];         /* VariableTypeCode, A-Z */
#if THE_PRICE_IS_RIGHT
  int CommandStart[26];                /* IntrinsicCommandTable->name[0], A-Z */
  int IntrinsicFunctionStart[26];      /* IntrinsicFunctionTable->name[0], A-Z */
#endif                                 /* THE_PRICE_IS_RIGHT */
  char *COMMAND4[10];                  /* command line parameters, COMMAND$(0-9) */
  char *ProgramFilename;               /* last BASIC program filename */
};
typedef struct GlobalStruct GlobalType;
extern GlobalType *My;

#define PARAM_NUMBER   *argn->Value.Number
#define PARAM_LENGTH    argn->Value.String->length
#define PARAM_BUFFER    argn->Value.String->sbuffer
#define RESULT_NUMBER  *argv->Value.Number
#define RESULT_BUFFER   argv->Value.String->sbuffer
#define RESULT_LENGTH   argv->Value.String->length


/***************************************************************
  
                    Compiler Specific Prototypes
  
***************************************************************/


#if __WATCOM__
/*
**
** OpenWatcom 1.9 for DOS does not declare putenv()
**
*/
extern int putenv (const char *buffer);
#endif /*  __WATCOM__ */

#if HAVE_UNIX_GCC
/*
**
** sleep() is an intrinsic C functions in GCC using -ansi 
**
*/
#else
/*
**
** sleep() is defined in bwb_int.c to do nothing 
**
*/
extern unsigned int sleep (unsigned int X);
#endif /* HAVE_UNIX_GCC */

#ifndef isnan
#define isnan(x) (x != x)
#endif

#ifndef isinf
#define isinf(x) (!isnan(x) && isnan(x - x))
#endif

/***************************************************************
  
                      Function Prototypes
  
***************************************************************/

/*-------------------------------------------------------------
                        BASIC COMMANDS
-------------------------------------------------------------*/
extern LineType *bwb_APPEND (LineType * l);
extern LineType *bwb_AS (LineType * L);
extern LineType *bwb_AUTO (LineType * L);
extern LineType *bwb_BACKSPACE (LineType * Line);
extern LineType *bwb_BREAK (LineType * l);
extern LineType *bwb_BUILD (LineType * L);
extern LineType *bwb_BYE (LineType * l);
extern LineType *bwb_CALL (LineType * l);
extern LineType *bwb_CASE (LineType * l);
extern LineType *bwb_CASE_ELSE (LineType * l);
extern LineType *bwb_CHAIN (LineType * l);
extern LineType *bwb_CHANGE (LineType * l);
extern LineType *bwb_CLEAR (LineType * l);
extern LineType *bwb_CLOAD (LineType * Line);
extern LineType *bwb_CLOAD8 (LineType * l);
extern LineType *bwb_CLOSE (LineType * Line);
extern LineType *bwb_CLR (LineType * l);
extern LineType *bwb_CMDS (LineType * l);
extern LineType *bwb_COMMON (LineType * l);
extern LineType *bwb_CONSOLE (LineType * l);
extern LineType *bwb_CONST (LineType * L);
extern LineType *bwb_CONT (LineType * l);
extern LineType *bwb_CONTINUE (LineType * l);
extern LineType *bwb_COPY (LineType * Line);
extern LineType *bwb_CREATE (LineType * l);
extern LineType *bwb_CSAVE (LineType * Line);
extern LineType *bwb_CSAVE8 (LineType * l);
extern LineType *bwb_DATA (LineType * Line);
extern LineType *bwb_DEC (LineType * L);
extern LineType *bwb_DEF (LineType * l);
extern LineType *bwb_DEF8LBL (LineType * l);
extern LineType *bwb_DEFBYT (LineType * l);
extern LineType *bwb_DEFCUR (LineType * l);
extern LineType *bwb_DEFDBL (LineType * l);
extern LineType *bwb_DEFINT (LineType * l);
extern LineType *bwb_DEFLNG (LineType * l);
extern LineType *bwb_DEFSNG (LineType * l);
extern LineType *bwb_DEFSTR (LineType * l);
extern LineType *bwb_DELETE (LineType * l);
extern LineType *bwb_DELIMIT (LineType * l);
extern LineType *bwb_DIM (LineType * l);
extern LineType *bwb_DISPLAY (LineType * Line);
extern LineType *bwb_DO (LineType * l);
extern LineType *bwb_DOS (LineType * l);
extern LineType *bwb_DSP (LineType * l);
extern LineType *bwb_EDIT (LineType * Line);
extern LineType *bwb_ELSE (LineType * l);
extern LineType *bwb_ELSEIF (LineType * l);
extern LineType *bwb_END (LineType * l);
extern LineType *bwb_END_FUNCTION (LineType * l);
extern LineType *bwb_END_IF (LineType * l);
extern LineType *bwb_END_SELECT (LineType * l);
extern LineType *bwb_END_SUB (LineType * l);
extern LineType *bwb_ERASE (LineType * l);
extern LineType *bwb_EXCHANGE (LineType * l);
extern LineType *bwb_EXIT (LineType * l);
extern LineType *bwb_EXIT_DO (LineType * l);
extern LineType *bwb_EXIT_FOR (LineType * l);
extern LineType *bwb_EXIT_FUNCTION (LineType * l);
extern LineType *bwb_EXIT_REPEAT (LineType * l);
extern LineType *bwb_EXIT_SUB (LineType * l);
extern LineType *bwb_EXIT_WHILE (LineType * l);
extern LineType *bwb_FEND (LineType * l);
extern LineType *bwb_FIELD (LineType * l);
extern LineType *bwb_FILE (LineType * l);
extern LineType *bwb_FILES (LineType * l);
extern LineType *bwb_FLEX (LineType * l);
extern LineType *bwb_FNCS (LineType * l);
extern LineType *bwb_FNEND (LineType * l);
extern LineType *bwb_FOR (LineType * l);
extern LineType *bwb_FUNCTION (LineType * l);
extern LineType *bwb_GET (LineType * Line);
extern LineType *bwb_GO (LineType * L);
extern LineType *bwb_GOODBYE (LineType * l);
extern LineType *bwb_GOSUB (LineType * l);
extern LineType *bwb_GOTO (LineType * l);
extern LineType *bwb_GO_SUB (LineType * l);
extern LineType *bwb_GO_TO (LineType * l);
extern LineType *bwb_HELP (LineType * l);
extern LineType *bwb_IF (LineType * l);
extern LineType *bwb_IF8THEN (LineType * l);
extern LineType *bwb_IF_END (LineType * l);
extern LineType *bwb_IF_MORE (LineType * l);
extern LineType *bwb_IMAGE (LineType * L);
extern LineType *bwb_INC (LineType * L);
extern LineType *bwb_INPUT (LineType * Line);
extern LineType *bwb_INPUT_LINE (LineType * Line);
extern LineType *bwb_LET (LineType * L);
extern LineType *bwb_LINE (LineType * Line);
extern LineType *bwb_LINE_INPUT (LineType * Line);
extern LineType *bwb_LIST (LineType * l);
extern LineType *bwb_LISTNH (LineType * l);
extern LineType *bwb_LLIST (LineType * l);
extern LineType *bwb_LOAD (LineType * Line);
extern LineType *bwb_LOCAL (LineType * l);
extern LineType *bwb_LOOP (LineType * l);
extern LineType *bwb_LPRINT (LineType * l);
extern LineType *bwb_LPRINTER (LineType * l);
extern LineType *bwb_LPT (LineType * l);
extern LineType *bwb_LSET (LineType * l);
extern LineType *bwb_MAINTAINER (LineType * l);
extern LineType *bwb_MAINTAINER_CMDS (LineType * l);
extern LineType *bwb_MAINTAINER_CMDS_HTML (LineType * l);
extern LineType *bwb_MAINTAINER_CMDS_ID (LineType * l);
extern LineType *bwb_MAINTAINER_CMDS_MANUAL (LineType * l);
extern LineType *bwb_MAINTAINER_CMDS_SWITCH (LineType * l);
extern LineType *bwb_MAINTAINER_CMDS_TABLE (LineType * l);
extern LineType *bwb_MAINTAINER_DEBUG (LineType * l);
extern LineType *bwb_MAINTAINER_DEBUG_OFF (LineType * l);
extern LineType *bwb_MAINTAINER_DEBUG_ON (LineType * l);
extern LineType *bwb_MAINTAINER_FNCS (LineType * l);
extern LineType *bwb_MAINTAINER_FNCS_HTML (LineType * l);
extern LineType *bwb_MAINTAINER_FNCS_ID (LineType * l);
extern LineType *bwb_MAINTAINER_FNCS_MANUAL (LineType * l);
extern LineType *bwb_MAINTAINER_FNCS_SWITCH (LineType * l);
extern LineType *bwb_MAINTAINER_FNCS_TABLE (LineType * l);
extern LineType *bwb_MAINTAINER_MANUAL (LineType * l);
extern LineType *bwb_MAINTAINER_STACK (LineType * l);
extern LineType *bwb_MARGIN (LineType * l);
extern LineType *bwb_MAT (LineType * l);
extern LineType *bwb_MAT_GET (LineType * Line);
extern LineType *bwb_MAT_INPUT (LineType * Line);
extern LineType *bwb_MAT_PRINT (LineType * l);
extern LineType *bwb_MAT_PUT (LineType * l);
extern LineType *bwb_MAT_READ (LineType * Line);
extern LineType *bwb_MAT_WRITE (LineType * l);
extern LineType *bwb_MERGE (LineType * l);
extern LineType *bwb_MID4 (LineType * l);
extern LineType *bwb_MON (LineType * l);
extern LineType *bwb_NAME (LineType * l);
extern LineType *bwb_NEW (LineType * l);
extern LineType *bwb_NEXT (LineType * l);
extern LineType *bwb_OF (LineType * L);
extern LineType *bwb_OLD (LineType * Line);
extern LineType *bwb_ON (LineType * l);
extern LineType *bwb_ON_ERROR (LineType * l);
extern LineType *bwb_ON_ERROR_GOSUB (LineType * l);
extern LineType *bwb_ON_ERROR_GOTO (LineType * l);
extern LineType *bwb_ON_ERROR_RESUME (LineType * l);
extern LineType *bwb_ON_ERROR_RESUME_NEXT (LineType * l);
extern LineType *bwb_ON_ERROR_RETURN (LineType * l);
extern LineType *bwb_ON_ERROR_RETURN_NEXT (LineType * l);
extern LineType *bwb_ON_TIMER (LineType * l);
extern LineType *bwb_OPEN (LineType * l);
extern LineType *bwb_OPTION (LineType * l);
extern LineType *bwb_OPTION_ANGLE (LineType * l);
extern LineType *bwb_OPTION_ANGLE_DEGREES (LineType * l);
extern LineType *bwb_OPTION_ANGLE_GRADIANS (LineType * l);
extern LineType *bwb_OPTION_ANGLE_RADIANS (LineType * l);
extern LineType *bwb_OPTION_ARITHMETIC (LineType * l);
extern LineType *bwb_OPTION_ARITHMETIC_DECIMAL (LineType * l);
extern LineType *bwb_OPTION_ARITHMETIC_FIXED (LineType * l);
extern LineType *bwb_OPTION_ARITHMETIC_NATIVE (LineType * l);
extern LineType *bwb_OPTION_PUNCT_AT (LineType * l);
extern LineType *bwb_OPTION_BASE (LineType * l);
extern LineType *bwb_OPTION_BUGS (LineType * l);
extern LineType *bwb_OPTION_BUGS_BOOLEAN (LineType * l);
extern LineType *bwb_OPTION_BUGS_OFF (LineType * l);
extern LineType *bwb_OPTION_BUGS_ON (LineType * l);
extern LineType *bwb_OPTION_PUNCT_BYTE (LineType * l);
extern LineType *bwb_OPTION_PUNCT_COMMENT (LineType * l);
extern LineType *bwb_OPTION_COMPARE (LineType * l);
extern LineType *bwb_OPTION_COMPARE_BINARY (LineType * l);
extern LineType *bwb_OPTION_COMPARE_DATABASE (LineType * l);
extern LineType *bwb_OPTION_COMPARE_TEXT (LineType * l);
extern LineType *bwb_OPTION_COVERAGE (LineType * l);
extern LineType *bwb_OPTION_COVERAGE_OFF (LineType * l);
extern LineType *bwb_OPTION_COVERAGE_ON (LineType * l);
extern LineType *bwb_OPTION_PUNCT_CURRENCY (LineType * l);
extern LineType *bwb_OPTION_DATE (LineType * l);
extern LineType *bwb_OPTION_DIGITS (LineType * l);
extern LineType *bwb_OPTION_DISABLE (LineType * l);
extern LineType *bwb_OPTION_DISABLE_COMMAND (LineType * l);
extern LineType *bwb_OPTION_DISABLE_FUNCTION (LineType * l);
extern LineType *bwb_OPTION_DISABLE_OPERATOR (LineType * l);
extern LineType *bwb_OPTION_PUNCT_DOUBLE (LineType * l);
extern LineType *bwb_OPTION_EDIT (LineType * l);
extern LineType *bwb_OPTION_ENABLE (LineType * l);
extern LineType *bwb_OPTION_ENABLE_COMMAND (LineType * l);
extern LineType *bwb_OPTION_ENABLE_FUNCTION (LineType * l);
extern LineType *bwb_OPTION_ENABLE_OPERATOR (LineType * l);
extern LineType *bwb_OPTION_ERROR (LineType * l);
extern LineType *bwb_OPTION_ERROR_GOSUB (LineType * l);
extern LineType *bwb_OPTION_ERROR_GOTO (LineType * l);
extern LineType *bwb_OPTION_EXPLICIT (LineType * l);
extern LineType *bwb_OPTION_PUNCT_FILENUM (LineType * l);
extern LineType *bwb_OPTION_FILES (LineType * l);
extern LineType *bwb_OPTION_PUNCT_IMAGE (LineType * l);
extern LineType *bwb_OPTION_IMPLICIT (LineType * l);
extern LineType *bwb_OPTION_INDENT (LineType * l);
extern LineType *bwb_OPTION_PUNCT_INPUT (LineType * l);
extern LineType *bwb_OPTION_PUNCT_INTEGER (LineType * l);
extern LineType *bwb_OPTION_LABELS (LineType * l);
extern LineType *bwb_OPTION_LABELS_OFF (LineType * l);
extern LineType *bwb_OPTION_LABELS_ON (LineType * l);
extern LineType *bwb_OPTION_PUNCT_LONG (LineType * l);
extern LineType *bwb_OPTION_PUNCT_LPAREN (LineType * l);
extern LineType *bwb_OPTION_PUNCT_PRINT (LineType * l);
extern LineType *bwb_OPTION_PROMPT (LineType * l);
extern LineType *bwb_OPTION_PUNCT_QUOTE (LineType * l);
extern LineType *bwb_OPTION_RECLEN (LineType * l);
extern LineType *bwb_OPTION_RENUM (LineType * l);
extern LineType *bwb_OPTION_ROUND (LineType * l);
extern LineType *bwb_OPTION_ROUND_BANK (LineType * l);
extern LineType *bwb_OPTION_ROUND_MATH (LineType * l);
extern LineType *bwb_OPTION_ROUND_TRUNCATE (LineType * l);
extern LineType *bwb_OPTION_PUNCT_RPAREN (LineType * l);
extern LineType *bwb_OPTION_SCALE (LineType * l);
extern LineType *bwb_OPTION_PUNCT_SINGLE (LineType * l);
extern LineType *bwb_OPTION_SLEEP (LineType * l);
extern LineType *bwb_OPTION_PUNCT_STATEMENT (LineType * l);
extern LineType *bwb_OPTION_STDERR (LineType * l);
extern LineType *bwb_OPTION_STDIN (LineType * l);
extern LineType *bwb_OPTION_STDOUT (LineType * l);
extern LineType *bwb_OPTION_STRICT (LineType * l);
extern LineType *bwb_OPTION_STRICT_OFF (LineType * l);
extern LineType *bwb_OPTION_STRICT_ON (LineType * l);
extern LineType *bwb_OPTION_PUNCT_STRING (LineType * l);
extern LineType *bwb_OPTION_TERMINAL (LineType * l);
extern LineType *bwb_OPTION_TERMINAL_ADM (LineType * l);
extern LineType *bwb_OPTION_TERMINAL_ANSI (LineType * l);
extern LineType *bwb_OPTION_TERMINAL_NONE (LineType * l);
extern LineType *bwb_OPTION_TIME (LineType * l);
extern LineType *bwb_OPTION_TRACE (LineType * l);
extern LineType *bwb_OPTION_TRACE_OFF (LineType * l);
extern LineType *bwb_OPTION_TRACE_ON (LineType * l);
extern LineType *bwb_OPTION_USING (LineType * l);
extern LineType *bwb_OPTION_USING_ALL (LineType * l);
extern LineType *bwb_OPTION_USING_COMMA (LineType * l);
extern LineType *bwb_OPTION_USING_DIGIT (LineType * l);
extern LineType *bwb_OPTION_USING_DOLLAR (LineType * l);
extern LineType *bwb_OPTION_USING_EXRAD (LineType * l);
extern LineType *bwb_OPTION_USING_FILLER (LineType * l);
extern LineType *bwb_OPTION_USING_FIRST (LineType * l);
extern LineType *bwb_OPTION_USING_LENGTH (LineType * l);
extern LineType *bwb_OPTION_USING_LITERAL (LineType * l);
extern LineType *bwb_OPTION_USING_MINUS (LineType * l);
extern LineType *bwb_OPTION_USING_PERIOD (LineType * l);
extern LineType *bwb_OPTION_USING_PLUS (LineType * l);
extern LineType *bwb_OPTION_VERSION (LineType * l);
extern LineType *bwb_OPTION_ZONE (LineType * l);
extern LineType *bwb_PAUSE (LineType * l);
extern LineType *bwb_PDEL (LineType * l);
extern LineType *bwb_POP (LineType * l);
extern LineType *bwb_PRINT (LineType * l);
extern LineType *bwb_PTP (LineType * l);
extern LineType *bwb_PTR (LineType * l);
extern LineType *bwb_PUT (LineType * Line);
extern LineType *bwb_QUIT (LineType * l);
extern LineType *bwb_READ (LineType * Line);
extern LineType *bwb_RECALL (LineType * l);
extern LineType *bwb_REM (LineType * L);
extern LineType *bwb_RENAME (LineType * l);
extern LineType *bwb_RENUM (LineType * Line);
extern LineType *bwb_RENUMBER (LineType * Line);
extern LineType *bwb_REPEAT (LineType * l);
extern LineType *bwb_REPLACE (LineType * Line);
extern LineType *bwb_RESET (LineType * Line);
extern LineType *bwb_RESTORE (LineType * Line);
extern LineType *bwb_RESUME (LineType * l);
extern LineType *bwb_RETURN (LineType * l);
extern LineType *bwb_RSET (LineType * l);
extern LineType *bwb_RUN (LineType * L);
extern LineType *bwb_RUNNH (LineType * L);
extern LineType *bwb_SAVE (LineType * l);
extern LineType *bwb_SCRATCH (LineType * l);
extern LineType *bwb_SELECT (LineType * l);
extern LineType *bwb_SELECT_CASE (LineType * l);
extern LineType *bwb_STEP (LineType * L);
extern LineType *bwb_STOP (LineType * l);
extern LineType *bwb_STORE (LineType * l);
extern LineType *bwb_SUB (LineType * l);
extern LineType *bwb_SUBEND (LineType * l);
extern LineType *bwb_SUBEXIT (LineType * l);
extern LineType *bwb_SUB_END (LineType * l);
extern LineType *bwb_SUB_EXIT (LineType * l);
extern LineType *bwb_SWAP (LineType * l);
extern LineType *bwb_SYSTEM (LineType * l);
extern LineType *bwb_TEXT (LineType * l);
extern LineType *bwb_THEN (LineType * L);
extern LineType *bwb_TIMER (LineType * l);
extern LineType *bwb_TIMER_OFF (LineType * l);
extern LineType *bwb_TIMER_ON (LineType * l);
extern LineType *bwb_TIMER_STOP (LineType * l);
extern LineType *bwb_TLOAD (LineType * Line);
extern LineType *bwb_TO (LineType * L);
extern LineType *bwb_TRACE (LineType * l);
extern LineType *bwb_TRACE_OFF (LineType * l);
extern LineType *bwb_TRACE_ON (LineType * l);
extern LineType *bwb_TSAVE (LineType * Line);
extern LineType *bwb_TTY (LineType * l);
extern LineType *bwb_TTY_IN (LineType * l);
extern LineType *bwb_TTY_OUT (LineType * l);
extern LineType *bwb_UNTIL (LineType * l);
extern LineType *bwb_USE (LineType * l);
extern LineType *bwb_VARS (LineType * l);
extern LineType *bwb_vector (LineType * l);
extern LineType *bwb_WEND (LineType * l);
extern LineType *bwb_WHILE (LineType * l);
extern LineType *bwb_WRITE (LineType * l);
extern LineType *bwb_OPTION_PUNCT (LineType * l);
extern LineType *bwb_OPTION_EXTENSION (LineType * l);

/*-------------------------------------------------------------
                        INTERNALS
-------------------------------------------------------------*/
extern int binary_get_put (VariableType * Variable, int IsPUT);
extern int buff_is_eol (char *buffer, int *position);
extern int buff_peek_array_dimensions (char *buffer, int *position,
                                       int *n_params);
extern int buff_peek_char (char *buffer, int *position, char find);
extern int buff_peek_EqualChar (char *buffer, int *position);
extern int buff_peek_LparenChar (char *buffer, int *position);
extern int buff_peek_QuoteChar (char *buffer, int *position);
#if FALSE /* kepp this ... */
extern int buff_peek_word (char *buffer, int *position, char *find);
#endif
extern int buff_read_array_dimensions (char *buffer, int *position,
                                       int *n_params, int params[]);
extern int buff_read_array_redim (char *buffer, int *position,
                                  int *dimensions, int LBOUND[],
                                  int UBOUND[]);
extern ResultType buff_read_decimal_constant (char *buffer, int *position,
                                              VariantType * X,
                                              int IsConsoleInput);
extern int buff_read_expression (char *buffer, int *position,
                                 VariantType * X);
extern ResultType buff_read_hexadecimal_constant (char *buffer, int *position,
                                                  VariantType * X,
                                                  int IsConsoleInput);
extern int buff_read_index_item (char *buffer, int *position, int Index,
                                 int *Value);
extern int buff_read_integer_expression (char *buffer, int *position,
                                         int *Value);
extern int buff_read_label (char *buffer, int *position, char *label);
extern int buff_read_letter_sequence (char *buffer, int *position, char *head,
                                      char *tail);
extern int buff_read_line_number (char *buffer, int *position, int *linenum);
extern int buff_read_line_sequence (char *buffer, int *position, int *head,
                                    int *tail);
extern VariableType *buff_read_matrix (char *buffer, int *position);
extern int buff_read_numeric_expression (char *buffer, int *position,
                                         DoubleType * Value);
extern ResultType buff_read_octal_constant (char *buffer, int *position,
                                            VariantType * X,
                                            int IsConsoleInput);
extern VariableType *buff_read_scalar (char *buffer, int *position);
extern int buff_read_string_expression (char *buffer, int *position,
                                        char **Value);
extern char buff_read_type_declaration (char *buffer, int *position);
extern int buff_read_varname (char *buffer, int *position, char *varname);
extern int buff_skip_AtChar (char *buffer, int *position);
extern int buff_skip_char (char *buffer, int *position, char find);
extern int buff_skip_CommaChar (char *buffer, int *position);
extern void buff_skip_eol (char *buffer, int *position);
extern int buff_skip_EqualChar (char *buffer, int *position);
extern int buff_skip_FilenumChar (char *buffer, int *position);
extern int buff_skip_LparenChar (char *buffer, int *position);
extern int buff_skip_MinusChar (char *buffer, int *position);
extern int buff_skip_PlusChar (char *buffer, int *position);
extern int buff_skip_RparenChar (char *buffer, int *position);
extern int buff_skip_SemicolonChar (char *buffer, int *position);
extern char buff_skip_seperator (char *buffer, int *position);
extern void buff_skip_spaces (char *buffer, int *position);
extern int buff_skip_StarChar (char *buffer, int *position);
extern int buff_skip_word (char *buffer, int *position, char *find);
extern void bwb_clrexec (void);
extern void bwb_decexec (void);
extern void bwb_execline (void);
extern void bwb_fclose (FILE * file);
extern void bwb_file_open (char A, int x, char *B, int y);
extern int bwb_fload (char *FileName);
extern int bwb_freeline (LineType * l);
extern int bwb_incexec (void);
extern int bwb_isalnum (int C);
extern int bwb_isalpha (int C);
#if FALSE /* keep this ... */
extern int bwb_iscntrl (int C);
#endif
extern int bwb_isdigit (int C);
extern int bwb_isgraph (int C);
#if FALSE /* keep this ... */
extern int bwb_islower (int C);
#endif
extern int bwb_isprint (int C);
extern int bwb_ispunct (int C);
#if FALSE /* keep this ... */
extern int bwb_isspace (int C);
#endif
#if FALSE /* keep this ... */
extern int bwb_isupper (int C);
#endif
extern int bwb_isxdigit (int C);
extern int bwb_is_eof (FILE * fp);
extern void bwb_mainloop (void);
#if FALSE /* keep this ... */
extern void *bwb_memchr (const void *s, int c, size_t n);
#endif
extern int bwb_memcmp (const void *s1, const void *s2, size_t n);
extern void *bwb_memcpy (void *s1, const void *s2, size_t n);
#if FALSE /* keep this ... */
extern void *bwb_memmove (void *s1, const void *s2, size_t n);
#endif
extern void *bwb_memset (void *s, int c, size_t n);
extern LineType *bwb_option_punct_char (LineType * l, char *c);
extern LineType *bwb_option_range_integer (LineType * l, int *Integer,
                                           int MinVal, int MaxVal);
extern double bwb_rint (double x);
extern int bwb_scan (void);
extern char *bwb_strcat (char *s1, const char *s2);
extern char *bwb_strchr (const char *s, int c);
extern int bwb_strcmp (const char *s1, const char *s2);
extern char *bwb_strcpy (char *s1, const char *s2);
extern char *bwb_strdup (char *s);
extern char *bwb_strdup2 (char *s, char *t);
extern int bwb_stricmp (const char *s1, const char *s2);
extern size_t bwb_strlen (const char *s);
#if FALSE /* keep this ... */
extern char *bwb_strncat (char *s1, const char *s2, size_t n);
#endif
#if FALSE /* keep this ... */
extern int bwb_strncmp (const char *s1, const char *s2, size_t n);
#endif
extern char *bwb_strncpy (char *s1, const char *s2, size_t n);
extern int bwb_strnicmp (const char *s1, const char *s2, size_t n);
extern char *bwb_strrchr (const char *s, int c);
extern int bwb_tolower (int C);
extern int bwb_toupper (int C);
extern void bwb_xnew (LineType * l);
extern void bwx_CLS (void);
extern void bwx_COLOR (int Fore, int Back);
extern int bwx_Error (int ERR, char *ErrorMessage);
extern int bwx_input (char *prompt, int IsDisplayQuestionMark, char *answer,
                      int MaxLen);
extern void bwx_LOCATE (int Row, int Col);
extern void bwx_STOP (int IsShowMessage);
extern void bwx_terminate (void);
extern DoubleType bwx_TIMER (DoubleType Seconds);
extern char Char_to_TypeCode (char C);
extern void CleanLine (char *buffer);
extern void clear_virtual_by_file (int FileNumber);
extern void Determinant (VariableType * v);
extern void DumpAllCommandHtmlTable (FILE * file);
extern void DumpAllCommandSwitchStatement (FILE * file);
extern void DumpAllCommandSyntax (FILE * file, int IsXref,
                                  OptionVersionType OptionVersionValue);
extern void DumpAllCommandTableDefinitions (FILE * file);
extern void DumpAllCommandUniqueID (FILE * file);
extern void DumpAllFuctionTableDefinitions (FILE * file);
extern void DumpAllFunctionHtmlTable (FILE * file);
extern void DumpAllFunctionSwitch (FILE * file);
extern void DumpAllFunctionSyntax (FILE * file, int IsXref,
                                   OptionVersionType OptionVersionValue);
extern void DumpAllFunctionUniqueID (FILE * file);
extern void DumpAllOperatorSyntax (FILE * file, int IsXref,
                                   OptionVersionType OptionVersionValue);
extern void DumpHeader (FILE * file);
extern void DumpOneCommandSyntax (FILE * file, int IsXref, int n);
extern void DumpOneFunctionSyntax (FILE * file, int IsXref, int n);
extern void DumpOneOperatorSyntax (FILE * file, int IsXref, int n);
extern void field_close_file (FileType * File);
extern void field_free_variable (VariableType * Var);
extern void field_get (FileType * File);
extern void field_put (FileType * File);
extern void file_clear (FileType * F);
extern FileType *file_new (void);
extern int file_next_number (void);
extern FileType *find_file_by_name (char *FileName);
extern FileType *find_file_by_number (int FileNumber);
extern LineType *find_line_number (int number);
extern void FixDescription (FILE * file, const char *left, const char *right);
extern void FormatBasicNumber (DoubleType Input, char *Output);
extern int GetOnError (void);
extern void IntrinsicFunctionDefinitionCheck (IntrinsicFunctionType * f);
extern void IntrinsicFunctionSyntax (IntrinsicFunctionType * f, char *Syntax);
extern void IntrinsicFunctionUniqueID (IntrinsicFunctionType * f,
                                       char *UniqueID);
extern VariableType *IntrinsicFunction_deffn (int argc, VariableType * argv,
                                              UserFunctionType * f);
extern VariableType *IntrinsicFunction_execute (int argc, VariableType * argv,
                                                IntrinsicFunctionType * f);
extern IntrinsicFunctionType *IntrinsicFunction_find_exact (char *name,
                                                            int
                                                            ParameterCount,
                                                            ParamBitsType
                                                            ParameterTypes);
extern int IntrinsicFunction_init (void);
extern int IntrinsicFunction_name (char *name);
extern int InvertMatrix (VariableType * vOut, VariableType * vIn);
extern int IsLastKeyword (LineType * l, char *Keyword);
extern int IsLike (char *buffer, int *buffer_count, int buffer_Length,
                   char *pattern, int *pattern_count, int pattern_Length);
extern int is_empty_string (char *Buffer);
extern int line_is_eol (LineType * line);
#if FALSE /* kepp this ... */
extern int line_peek_array_dimensions (LineType * line, int *n_params);
#endif
#if FALSE /* kepp this ... */
extern int line_peek_char (LineType * line, char find);
#endif
extern int line_peek_EqualChar (LineType * line);
extern int line_peek_LparenChar (LineType * line);
extern int line_peek_QuoteChar (LineType * line);
#if FALSE /* kepp this ... */
extern int line_peek_word (LineType * line, char *find);
#endif
#if FALSE /* kepp this ... */
extern int line_read_array_dimensions (LineType * line, int *n_params,
                                       int params[]);
#endif
extern int line_read_array_redim (LineType * line, int *dimensions,
                                  int LBOUND[], int UBOUND[]);
extern int line_read_expression (LineType * line, VariantType * X);
extern int line_read_index_item (LineType * line, int Index, int *Value);
extern int line_read_integer_expression (LineType * line, int *Value);
extern int line_read_label (LineType * line, char *label);
extern int line_read_letter_sequence (LineType * line, char *head,
                                      char *tail);
extern int line_read_line_number (LineType * line, int *linenum);
extern int line_read_line_sequence (LineType * line, int *head, int *tail);
extern VariableType *line_read_matrix (LineType * line);
extern int line_read_numeric_expression (LineType * line, DoubleType * Value);
extern VariableType *line_read_scalar (LineType * line);
extern int line_read_string_expression (LineType * line, char **Value);
extern char line_read_type_declaration (LineType * line);
extern int line_read_varname (LineType * line, char *varname);
extern int line_skip_AtChar (LineType * line);
extern int line_skip_char (LineType * line, char find);
extern int line_skip_CommaChar (LineType * line);
extern void line_skip_eol (LineType * line);
extern int line_skip_EqualChar (LineType * line);
extern int line_skip_FilenumChar (LineType * line);
extern int line_skip_LparenChar (LineType * line);
extern int line_skip_MinusChar (LineType * line);
extern int line_skip_PlusChar (LineType * line);
extern int line_skip_RparenChar (LineType * line);
extern int line_skip_SemicolonChar (LineType * line);
extern char line_skip_seperator (LineType * line);
extern void line_skip_spaces (LineType * line);
extern int line_skip_StarChar (LineType * line);
extern int line_skip_word (LineType * line, char *find);
extern void line_start (LineType * l);
extern int main (int argc, char **argv);
extern VariableType *mat_find (char *name);
extern int NumberValueCheck (ParamTestType ParameterTests, DoubleType X);
extern void OptionVersionSet (int i);
extern void ResetConsoleColumn (void);
extern void SetOnError (int LineNumber);
extern void SortAllCommands (void);
extern void SortAllFunctions (void);
extern void SortAllOperators (void);
extern int StringLengthCheck (ParamTestType ParameterTests, int s);
extern int str_btob (StringType * d, StringType * s);
extern int str_cmp (StringType * a, StringType * b);
extern int str_match (char *A, int A_Length, char *B, int B_Length,
                      int I_Start);
extern char TypeCode_to_Char (char TypeCode);
extern int UserFunction_add (LineType * l);
extern int UserFunction_addlocalvar (UserFunctionType * f, VariableType * v);
extern UserFunctionType *UserFunction_find_exact (char *name,
                                                  unsigned char
                                                  ParameterCount,
                                                  ParamBitsType
                                                  ParameterTypes);
extern int UserFunction_init (void);
extern int UserFunction_name (char *name);
extern int VarTypeIndex (char C);
extern VariableType *var_chain (VariableType * argv);
extern void var_CLEAR (void);
extern int var_delcvars (void);
extern VariableType *var_find (char *name, int dimensions, int IsImplicit);
extern VariableType *var_free (VariableType * variable);
extern int var_get (VariableType * variable, VariantType * variant);
extern int var_init (void);
extern int var_make (VariableType * variable, char TypeCode);
extern char var_nametype (char *name);
extern VariableType *var_new (char *name, char TypeCode);
extern int var_set (VariableType * variable, VariantType * variant);


/*-------------------------------------------------------------
                        COMMANDS (CommandID)
-------------------------------------------------------------*/
#define C_DEF8LBL                       -1        /* DEF*LBL                        */
/* COMMANDS */
#define C_APPEND                         1 /* APPEND                         */
#define C_AS                             2 /* AS                             */
#define C_AUTO                           3 /* AUTO                           */
#define C_BACKSPACE                      4 /* BACKSPACE                      */
#define C_BREAK                          5 /* BREAK                          */
#define C_BUILD                          6 /* BUILD                          */
#define C_BYE                            7 /* BYE                            */
#define C_CALL                           8 /* CALL                           */
#define C_CASE                           9 /* CASE                           */
#define C_CASE_ELSE                     10 /* CASE ELSE                      */
#define C_CHAIN                         11 /* CHAIN                          */
#define C_CHANGE                        12 /* CHANGE                         */
#define C_CLEAR                         13 /* CLEAR                          */
#define C_CLOAD                         14 /* CLOAD                          */
#define C_CLOAD8                        15 /* CLOAD*                         */
#define C_CLOSE                         16 /* CLOSE                          */
#define C_CLR                           17 /* CLR                            */
#define C_CMDS                          18 /* CMDS                           */
#define C_COMMON                        19 /* COMMON                         */
#define C_CONSOLE                       20 /* CONSOLE                        */
#define C_CONST                         21 /* CONST                          */
#define C_CONT                          22 /* CONT                           */
#define C_CONTINUE                      23 /* CONTINUE                       */
#define C_COPY                          24 /* COPY                           */
#define C_CREATE                        25 /* CREATE                         */
#define C_CSAVE                         26 /* CSAVE                          */
#define C_CSAVE8                        27 /* CSAVE*                         */
#define C_DATA                          28 /* DATA                           */
#define C_DEC                           29 /* DEC                            */
#define C_DEF                           30 /* DEF                            */
#define C_DEFBYT                        31 /* DEFBYT                         */
#define C_DEFCUR                        32 /* DEFCUR                         */
#define C_DEFDBL                        33 /* DEFDBL                         */
#define C_DEFINT                        34 /* DEFINT                         */
#define C_DEFLNG                        35 /* DEFLNG                         */
#define C_DEFSNG                        36 /* DEFSNG                         */
#define C_DEFSTR                        37 /* DEFSTR                         */
#define C_DELETE                        38 /* DELETE                         */
#define C_DELIMIT                       39 /* DELIMIT                        */
#define C_DIM                           40 /* DIM                            */
#define C_DISPLAY                       41 /* DISPLAY                        */
#define C_DO                            42 /* DO                             */
#define C_DOS                           43 /* DOS                            */
#define C_DSP                           44 /* DSP                            */
#define C_EDIT                          45 /* EDIT                           */
#define C_ELSE                          46 /* ELSE                           */
#define C_ELSEIF                        47 /* ELSEIF                         */
#define C_END                           48 /* END                            */
#define C_END_FUNCTION                  49 /* END FUNCTION                   */
#define C_END_IF                        50 /* END IF                         */
#define C_END_SELECT                    51 /* END SELECT                     */
#define C_END_SUB                       52 /* END SUB                        */
#define C_ERASE                         53 /* ERASE                          */
#define C_EXCHANGE                      54 /* EXCHANGE                       */
#define C_EXIT                          55 /* EXIT                           */
#define C_EXIT_DO                       56 /* EXIT DO                        */
#define C_EXIT_FOR                      57 /* EXIT FOR                       */
#define C_EXIT_FUNCTION                 58 /* EXIT FUNCTION                  */
#define C_EXIT_REPEAT                   59 /* EXIT REPEAT                    */
#define C_EXIT_SUB                      60 /* EXIT SUB                       */
#define C_EXIT_WHILE                    61 /* EXIT WHILE                     */
#define C_FEND                          62 /* FEND                           */
#define C_FIELD                         63 /* FIELD                          */
#define C_FILE                          64 /* FILE                           */
#define C_FILES                         65 /* FILES                          */
#define C_FLEX                          66 /* FLEX                           */
#define C_FNCS                          67 /* FNCS                           */
#define C_FNEND                         68 /* FNEND                          */
#define C_FOR                           69 /* FOR                            */
#define C_FUNCTION                      70 /* FUNCTION                       */
#define C_GET                           71 /* GET                            */
#define C_GO                            72 /* GO                             */
#define C_GO_SUB                        73 /* GO SUB                         */
#define C_GO_TO                         74 /* GO TO                          */
#define C_GOODBYE                       75 /* GOODBYE                        */
#define C_GOSUB                         76 /* GOSUB                          */
#define C_GOTO                          77 /* GOTO                           */
#define C_HELP                          78 /* HELP                           */
#define C_IF                            79 /* IF                             */
#define C_IF_END                        80 /* IF END                         */
#define C_IF_MORE                       81 /* IF MORE                        */
#define C_IF8THEN                       82 /* IF*THEN                        */
#define C_IMAGE                         83 /* IMAGE                          */
#define C_INC                           84 /* INC                            */
#define C_INPUT                         85 /* INPUT                          */
#define C_INPUT_LINE                    86 /* INPUT LINE                     */
#define C_LET                           87 /* LET                            */
#define C_LINE                          88 /* LINE                           */
#define C_LINE_INPUT                    89 /* LINE INPUT                     */
#define C_LIST                          90 /* LIST                           */
#define C_LISTNH                        91 /* LISTNH                         */
#define C_LLIST                         92 /* LLIST                          */
#define C_LOAD                          93 /* LOAD                           */
#define C_LOCAL                         94 /* LOCAL                          */
#define C_LOOP                          95 /* LOOP                           */
#define C_LPRINT                        96 /* LPRINT                         */
#define C_LPRINTER                      97 /* LPRINTER                       */
#define C_LPT                           98 /* LPT                            */
#define C_LSET                          99 /* LSET                           */
#define C_MAINTAINER                   100 /* MAINTAINER                     */
#define C_MAINTAINER_CMDS              101 /* MAINTAINER CMDS                */
#define C_MAINTAINER_CMDS_HTML         102 /* MAINTAINER CMDS HTML           */
#define C_MAINTAINER_CMDS_ID           103 /* MAINTAINER CMDS ID             */
#define C_MAINTAINER_CMDS_MANUAL       104 /* MAINTAINER CMDS MANUAL         */
#define C_MAINTAINER_CMDS_SWITCH       105 /* MAINTAINER CMDS SWITCH         */
#define C_MAINTAINER_CMDS_TABLE        106 /* MAINTAINER CMDS TABLE          */
#define C_MAINTAINER_DEBUG             107 /* MAINTAINER DEBUG               */
#define C_MAINTAINER_DEBUG_OFF         108 /* MAINTAINER DEBUG OFF           */
#define C_MAINTAINER_DEBUG_ON          109 /* MAINTAINER DEBUG ON            */
#define C_MAINTAINER_FNCS              110 /* MAINTAINER FNCS                */
#define C_MAINTAINER_FNCS_HTML         111 /* MAINTAINER FNCS HTML           */
#define C_MAINTAINER_FNCS_ID           112 /* MAINTAINER FNCS ID             */
#define C_MAINTAINER_FNCS_MANUAL       113 /* MAINTAINER FNCS MANUAL         */
#define C_MAINTAINER_FNCS_SWITCH       114 /* MAINTAINER FNCS SWITCH         */
#define C_MAINTAINER_FNCS_TABLE        115 /* MAINTAINER FNCS TABLE          */
#define C_MAINTAINER_MANUAL            116 /* MAINTAINER MANUAL              */
#define C_MAINTAINER_STACK             117 /* MAINTAINER STACK               */
#define C_MARGIN                       118 /* MARGIN                         */
#define C_MAT                          119 /* MAT                            */
#define C_MAT_GET                      120 /* MAT GET                        */
#define C_MAT_INPUT                    121 /* MAT INPUT                      */
#define C_MAT_PRINT                    122 /* MAT PRINT                      */
#define C_MAT_PUT                      123 /* MAT PUT                        */
#define C_MAT_READ                     124 /* MAT READ                       */
#define C_MAT_WRITE                    125 /* MAT WRITE                      */
#define C_MERGE                        126 /* MERGE                          */
#define C_MID4                         127 /* MID$                           */
#define C_MON                          128 /* MON                            */
#define C_NAME                         129 /* NAME                           */
#define C_NEW                          130 /* NEW                            */
#define C_NEXT                         131 /* NEXT                           */
#define C_OF                           132 /* OF                             */
#define C_OLD                          133 /* OLD                            */
#define C_ON                           134 /* ON                             */
#define C_ON_ERROR                     135 /* ON ERROR                       */
#define C_ON_ERROR_GOSUB               136 /* ON ERROR GOSUB                 */
#define C_ON_ERROR_GOTO                137 /* ON ERROR GOTO                  */
#define C_ON_ERROR_RESUME              138 /* ON ERROR RESUME                */
#define C_ON_ERROR_RESUME_NEXT         139 /* ON ERROR RESUME NEXT           */
#define C_ON_ERROR_RETURN              140 /* ON ERROR RETURN                */
#define C_ON_ERROR_RETURN_NEXT         141 /* ON ERROR RETURN NEXT           */
#define C_ON_TIMER                     142 /* ON TIMER                       */
#define C_OPEN                         143 /* OPEN                           */
#define C_OPTION                       144 /* OPTION                         */
#define C_OPTION_ANGLE                 145 /* OPTION ANGLE                   */
#define C_OPTION_ANGLE_DEGREES         146 /* OPTION ANGLE DEGREES           */
#define C_OPTION_ANGLE_GRADIANS        147 /* OPTION ANGLE GRADIANS          */
#define C_OPTION_ANGLE_RADIANS         148 /* OPTION ANGLE RADIANS           */
#define C_OPTION_ARITHMETIC            149 /* OPTION ARITHMETIC              */
#define C_OPTION_ARITHMETIC_DECIMAL    150 /* OPTION ARITHMETIC DECIMAL      */
#define C_OPTION_ARITHMETIC_FIXED      151 /* OPTION ARITHMETIC FIXED        */
#define C_OPTION_ARITHMETIC_NATIVE     152 /* OPTION ARITHMETIC NATIVE       */
#define C_OPTION_BASE                  153 /* OPTION BASE                    */
#define C_OPTION_BUGS                  154 /* OPTION BUGS                    */
#define C_OPTION_BUGS_BOOLEAN          155 /* OPTION BUGS BOOLEAN            */
#define C_OPTION_BUGS_OFF              156 /* OPTION BUGS OFF                */
#define C_OPTION_BUGS_ON               157 /* OPTION BUGS ON                 */
#define C_OPTION_COMPARE               158 /* OPTION COMPARE                 */
#define C_OPTION_COMPARE_BINARY        159 /* OPTION COMPARE BINARY          */
#define C_OPTION_COMPARE_DATABASE      160 /* OPTION COMPARE DATABASE        */
#define C_OPTION_COMPARE_TEXT          161 /* OPTION COMPARE TEXT            */
#define C_OPTION_COVERAGE              162 /* OPTION COVERAGE                */
#define C_OPTION_COVERAGE_OFF          163 /* OPTION COVERAGE OFF            */
#define C_OPTION_COVERAGE_ON           164 /* OPTION COVERAGE ON             */
#define C_OPTION_DATE                  165 /* OPTION DATE                    */
#define C_OPTION_DIGITS                166 /* OPTION DIGITS                  */
#define C_OPTION_DISABLE               167 /* OPTION DISABLE                 */
#define C_OPTION_DISABLE_COMMAND       168 /* OPTION DISABLE COMMAND         */
#define C_OPTION_DISABLE_FUNCTION      169 /* OPTION DISABLE FUNCTION        */
#define C_OPTION_DISABLE_OPERATOR      170 /* OPTION DISABLE OPERATOR        */
#define C_OPTION_EDIT                  171 /* OPTION EDIT                    */
#define C_OPTION_ENABLE                172 /* OPTION ENABLE                  */
#define C_OPTION_ENABLE_COMMAND        173 /* OPTION ENABLE COMMAND          */
#define C_OPTION_ENABLE_FUNCTION       174 /* OPTION ENABLE FUNCTION         */
#define C_OPTION_ENABLE_OPERATOR       175 /* OPTION ENABLE OPERATOR         */
#define C_OPTION_ERROR                 176 /* OPTION ERROR                   */
#define C_OPTION_ERROR_GOSUB           177 /* OPTION ERROR GOSUB             */
#define C_OPTION_ERROR_GOTO            178 /* OPTION ERROR GOTO              */
#define C_OPTION_EXPLICIT              179 /* OPTION EXPLICIT                */
#define C_OPTION_EXTENSION             180 /* OPTION EXTENSION               */
#define C_OPTION_FILES                 181 /* OPTION FILES                   */
#define C_OPTION_IMPLICIT              182 /* OPTION IMPLICIT                */
#define C_OPTION_INDENT                183 /* OPTION INDENT                  */
#define C_OPTION_LABELS                184 /* OPTION LABELS                  */
#define C_OPTION_LABELS_OFF            185 /* OPTION LABELS OFF              */
#define C_OPTION_LABELS_ON             186 /* OPTION LABELS ON               */
#define C_OPTION_PROMPT                187 /* OPTION PROMPT                  */
#define C_OPTION_PUNCT                 188 /* OPTION PUNCT                   */
#define C_OPTION_PUNCT_AT              189 /* OPTION PUNCT AT                */
#define C_OPTION_PUNCT_BYTE            190 /* OPTION PUNCT BYTE              */
#define C_OPTION_PUNCT_COMMENT         191 /* OPTION PUNCT COMMENT           */
#define C_OPTION_PUNCT_CURRENCY        192 /* OPTION PUNCT CURRENCY          */
#define C_OPTION_PUNCT_DOUBLE          193 /* OPTION PUNCT DOUBLE            */
#define C_OPTION_PUNCT_FILENUM         194 /* OPTION PUNCT FILENUM           */
#define C_OPTION_PUNCT_IMAGE           195 /* OPTION PUNCT IMAGE             */
#define C_OPTION_PUNCT_INPUT           196 /* OPTION PUNCT INPUT             */
#define C_OPTION_PUNCT_INTEGER         197 /* OPTION PUNCT INTEGER           */
#define C_OPTION_PUNCT_LONG            198 /* OPTION PUNCT LONG              */
#define C_OPTION_PUNCT_LPAREN          199 /* OPTION PUNCT LPAREN            */
#define C_OPTION_PUNCT_PRINT           200 /* OPTION PUNCT PRINT             */
#define C_OPTION_PUNCT_QUOTE           201 /* OPTION PUNCT QUOTE             */
#define C_OPTION_PUNCT_RPAREN          202 /* OPTION PUNCT RPAREN            */
#define C_OPTION_PUNCT_SINGLE          203 /* OPTION PUNCT SINGLE            */
#define C_OPTION_PUNCT_STATEMENT       204 /* OPTION PUNCT STATEMENT         */
#define C_OPTION_PUNCT_STRING          205 /* OPTION PUNCT STRING            */
#define C_OPTION_RECLEN                206 /* OPTION RECLEN                  */
#define C_OPTION_RENUM                 207 /* OPTION RENUM                   */
#define C_OPTION_ROUND                 208 /* OPTION ROUND                   */
#define C_OPTION_ROUND_BANK            209 /* OPTION ROUND BANK              */
#define C_OPTION_ROUND_MATH            210 /* OPTION ROUND MATH              */
#define C_OPTION_ROUND_TRUNCATE        211 /* OPTION ROUND TRUNCATE          */
#define C_OPTION_SCALE                 212 /* OPTION SCALE                   */
#define C_OPTION_SLEEP                 213 /* OPTION SLEEP                   */
#define C_OPTION_STDERR                214 /* OPTION STDERR                  */
#define C_OPTION_STDIN                 215 /* OPTION STDIN                   */
#define C_OPTION_STDOUT                216 /* OPTION STDOUT                  */
#define C_OPTION_STRICT                217 /* OPTION STRICT                  */
#define C_OPTION_STRICT_OFF            218 /* OPTION STRICT OFF              */
#define C_OPTION_STRICT_ON             219 /* OPTION STRICT ON               */
#define C_OPTION_TERMINAL              220 /* OPTION TERMINAL                */
#define C_OPTION_TERMINAL_ADM          221 /* OPTION TERMINAL ADM            */
#define C_OPTION_TERMINAL_ANSI         222 /* OPTION TERMINAL ANSI           */
#define C_OPTION_TERMINAL_NONE         223 /* OPTION TERMINAL NONE           */
#define C_OPTION_TIME                  224 /* OPTION TIME                    */
#define C_OPTION_TRACE                 225 /* OPTION TRACE                   */
#define C_OPTION_TRACE_OFF             226 /* OPTION TRACE OFF               */
#define C_OPTION_TRACE_ON              227 /* OPTION TRACE ON                */
#define C_OPTION_USING                 228 /* OPTION USING                   */
#define C_OPTION_USING_ALL             229 /* OPTION USING ALL               */
#define C_OPTION_USING_COMMA           230 /* OPTION USING COMMA             */
#define C_OPTION_USING_DIGIT           231 /* OPTION USING DIGIT             */
#define C_OPTION_USING_DOLLAR          232 /* OPTION USING DOLLAR            */
#define C_OPTION_USING_EXRAD           233 /* OPTION USING EXRAD             */
#define C_OPTION_USING_FILLER          234 /* OPTION USING FILLER            */
#define C_OPTION_USING_FIRST           235 /* OPTION USING FIRST             */
#define C_OPTION_USING_LENGTH          236 /* OPTION USING LENGTH            */
#define C_OPTION_USING_LITERAL         237 /* OPTION USING LITERAL           */
#define C_OPTION_USING_MINUS           238 /* OPTION USING MINUS             */
#define C_OPTION_USING_PERIOD          239 /* OPTION USING PERIOD            */
#define C_OPTION_USING_PLUS            240 /* OPTION USING PLUS              */
#define C_OPTION_VERSION               241 /* OPTION VERSION                 */
#define C_OPTION_ZONE                  242 /* OPTION ZONE                    */
#define C_PAUSE                        243 /* PAUSE                          */
#define C_PDEL                         244 /* PDEL                           */
#define C_POP                          245 /* POP                            */
#define C_PRINT                        246 /* PRINT                          */
#define C_PTP                          247 /* PTP                            */
#define C_PTR                          248 /* PTR                            */
#define C_PUT                          249 /* PUT                            */
#define C_QUIT                         250 /* QUIT                           */
#define C_READ                         251 /* READ                           */
#define C_RECALL                       252 /* RECALL                         */
#define C_REM                          253 /* REM                            */
#define C_RENAME                       254 /* RENAME                         */
#define C_RENUM                        255 /* RENUM                          */
#define C_RENUMBER                     256 /* RENUMBER                       */
#define C_REPEAT                       257 /* REPEAT                         */
#define C_REPLACE                      258 /* REPLACE                        */
#define C_RESET                        259 /* RESET                          */
#define C_RESTORE                      260 /* RESTORE                        */
#define C_RESUME                       261 /* RESUME                         */
#define C_RETURN                       262 /* RETURN                         */
#define C_RSET                         263 /* RSET                           */
#define C_RUN                          264 /* RUN                            */
#define C_RUNNH                        265 /* RUNNH                          */
#define C_SAVE                         266 /* SAVE                           */
#define C_SCRATCH                      267 /* SCRATCH                        */
#define C_SELECT                       268 /* SELECT                         */
#define C_SELECT_CASE                  269 /* SELECT CASE                    */
#define C_STEP                         270 /* STEP                           */
#define C_STOP                         271 /* STOP                           */
#define C_STORE                        272 /* STORE                          */
#define C_SUB                          273 /* SUB                            */
#define C_SUB_END                      274 /* SUB END                        */
#define C_SUB_EXIT                     275 /* SUB EXIT                       */
#define C_SUBEND                       276 /* SUBEND                         */
#define C_SUBEXIT                      277 /* SUBEXIT                        */
#define C_SWAP                         278 /* SWAP                           */
#define C_SYSTEM                       279 /* SYSTEM                         */
#define C_TEXT                         280 /* TEXT                           */
#define C_THEN                         281 /* THEN                           */
#define C_TIMER                        282 /* TIMER                          */
#define C_TIMER_OFF                    283 /* TIMER OFF                      */
#define C_TIMER_ON                     284 /* TIMER ON                       */
#define C_TIMER_STOP                   285 /* TIMER STOP                     */
#define C_TLOAD                        286 /* TLOAD                          */
#define C_TO                           287 /* TO                             */
#define C_TRACE                        288 /* TRACE                          */
#define C_TRACE_OFF                    289 /* TRACE OFF                      */
#define C_TRACE_ON                     290 /* TRACE ON                       */
#define C_TSAVE                        291 /* TSAVE                          */
#define C_TTY                          292 /* TTY                            */
#define C_TTY_IN                       293 /* TTY IN                         */
#define C_TTY_OUT                      294 /* TTY OUT                        */
#define C_UNTIL                        295 /* UNTIL                          */
#define C_USE                          296 /* USE                            */
#define C_VARS                         297 /* VARS                           */
#define C_WEND                         298 /* WEND                           */
#define C_WHILE                        299 /* WHILE                          */
#define C_WRITE                        300 /* WRITE                          */


/*-------------------------------------------------------------
                        FUNCTIONS (FunctionID)
-------------------------------------------------------------*/

/* FUNCTIONS */
#define F_ABS_X_N                        1 /* N  = ABS( X )                  */
#define F_ACOS_X_N                       2 /* N  = ACOS( X )                 */
#define F_ACS_X_N                        3 /* N  = ACS( X )                  */
#define F_ACSD_X_N                       4 /* N  = ACSD( X )                 */
#define F_ACSG_X_N                       5 /* N  = ACSG( X )                 */
#define F_ANGLE_X_Y_N                    6 /* N  = ANGLE( X, Y )             */
#define F_ARCCOS_X_N                     7 /* N  = ARCCOS( X )               */
#define F_ARCSIN_X_N                     8 /* N  = ARCSIN( X )               */
#define F_ARCTAN_X_N                     9 /* N  = ARCTAN( X )               */
#define F_ARGC_N                        10 /* N  = ARGC                      */
#define F_ARGT4_X_S                     11 /* S$ = ARGT$( X )                */
#define F_ARGV_X_N                      12 /* N  = ARGV( X )                 */
#define F_ARGV4_X_S                     13 /* S$ = ARGV$( X )                */
#define F_ASC_A_N                       14 /* N  = ASC( A$ )                 */
#define F_ASC_A_X_N                     15 /* N  = ASC( A$, X )              */
#define F_ASCII_A_N                     16 /* N  = ASCII( A$ )               */
#define F_ASIN_X_N                      17 /* N  = ASIN( X )                 */
#define F_ASN_X_N                       18 /* N  = ASN( X )                  */
#define F_ASND_X_N                      19 /* N  = ASND( X )                 */
#define F_ASNG_X_N                      20 /* N  = ASNG( X )                 */
#define F_ATAN_X_N                      21 /* N  = ATAN( X )                 */
#define F_ATN_X_N                       22 /* N  = ATN( X )                  */
#define F_ATND_X_N                      23 /* N  = ATND( X )                 */
#define F_ATNG_X_N                      24 /* N  = ATNG( X )                 */
#define F_BASE_N                        25 /* N  = BASE                      */
#define F_BIN4_X_S                      26 /* S$ = BIN$( X )                 */
#define F_BIN4_X_Y_S                    27 /* S$ = BIN$( X, Y )              */
#define F_CATALOG_N                     28 /* N  = CATALOG                   */
#define F_CATALOG_A_N                   29 /* N  = CATALOG( A$ )             */
#define F_CCUR_X_N                      30 /* N  = CCUR( X )                 */
#define F_CDBL_X_N                      31 /* N  = CDBL( X )                 */
#define F_CEIL_X_N                      32 /* N  = CEIL( X )                 */
#define F_CHAR_X_Y_S                    33 /* S$ = CHAR( X, Y )              */
#define F_CHAR4_X_S                     34 /* S$ = CHAR$( X )                */
#define F_CHDIR_A_N                     35 /* N  = CHDIR( A$ )               */
#define F_CHR_X_S                       36 /* S$ = CHR( X )                  */
#define F_CHR4_X_S                      37 /* S$ = CHR$( X )                 */
#define F_CIN_X_N                       38 /* N  = CIN( X )                  */
#define F_CINT_X_N                      39 /* N  = CINT( X )                 */
#define F_CLG_X_N                       40 /* N  = CLG( X )                  */
#define F_CLK_X_N                       41 /* N  = CLK( X )                  */
#define F_CLK_X_S                       42 /* S$ = CLK( X )                  */
#define F_CLK4_S                        43 /* S$ = CLK$                      */
#define F_CLNG_X_N                      44 /* N  = CLNG( X )                 */
#define F_CLOG_X_N                      45 /* N  = CLOG( X )                 */
#define F_CLOSE_N                       46 /* N  = CLOSE                     */
#define F_CLOSE_X_N                     47 /* N  = CLOSE( X )                */
#define F_CLS_N                         48 /* N  = CLS                       */
#define F_CNTRL_X_Y_N                   49 /* N  = CNTRL( X, Y )             */
#define F_CODE_A_N                      50 /* N  = CODE( A$ )                */
#define F_COLOR_X_Y_N                   51 /* N  = COLOR( X, Y )             */
#define F_COMMAND4_S                    52 /* S$ = COMMAND$                  */
#define F_COMMAND4_X_S                  53 /* S$ = COMMAND$( X )             */
#define F_COS_X_N                       54 /* N  = COS( X )                  */
#define F_COSD_X_N                      55 /* N  = COSD( X )                 */
#define F_COSG_X_N                      56 /* N  = COSG( X )                 */
#define F_COSH_X_N                      57 /* N  = COSH( X )                 */
#define F_COT_X_N                       58 /* N  = COT( X )                  */
#define F_COUNT_N                       59 /* N  = COUNT                     */
#define F_CSC_X_N                       60 /* N  = CSC( X )                  */
#define F_CSH_X_N                       61 /* N  = CSH( X )                  */
#define F_CSNG_X_N                      62 /* N  = CSNG( X )                 */
#define F_CUR_X_Y_S                     63 /* S$ = CUR( X, Y )               */
#define F_CVC_A_N                       64 /* N  = CVC( A$ )                 */
#define F_CVD_A_N                       65 /* N  = CVD( A$ )                 */
#define F_CVI_A_N                       66 /* N  = CVI( A$ )                 */
#define F_CVL_A_N                       67 /* N  = CVL( A$ )                 */
#define F_CVS_A_N                       68 /* N  = CVS( A$ )                 */
#define F_DAT4_S                        69 /* S$ = DAT$                      */
#define F_DATE_N                        70 /* N  = DATE                      */
#define F_DATE4_S                       71 /* S$ = DATE$                     */
#define F_DATE4_X_S                     72 /* S$ = DATE$( X )                */
#define F_DEG_N                         73 /* N  = DEG                       */
#define F_DEG_X_N                       74 /* N  = DEG( X )                  */
#define F_DEGREE_N                      75 /* N  = DEGREE                    */
#define F_DEGREE_X_N                    76 /* N  = DEGREE( X )               */
#define F_DET_N                         77 /* N  = DET                       */
#define F_DIGITS_X_N                    78 /* N  = DIGITS( X )               */
#define F_DIGITS_X_Y_N                  79 /* N  = DIGITS( X, Y )            */
#define F_DIM_N                         80 /* N  = DIM( ... )                */
#define F_DPEEK_X_N                     81 /* N  = DPEEK( X )                */
#define F_DPOKE_X_Y_N                   82 /* N  = DPOKE( X, Y )             */
#define F_EDIT4_A_X_S                   83 /* S$ = EDIT$( A$, X )            */
#define F_ENVIRON_A_N                   84 /* N  = ENVIRON( A$ )             */
#define F_ENVIRON4_A_S                  85 /* S$ = ENVIRON$( A$ )            */
#define F_EOF_X_N                       86 /* N  = EOF( X )                  */
#define F_EPS_X_N                       87 /* N  = EPS( X )                  */
#define F_ERL_N                         88 /* N  = ERL                       */
#define F_ERR_N                         89 /* N  = ERR                       */
#define F_ERR4_S                        90 /* S$ = ERR$                      */
#define F_ERRL_N                        91 /* N  = ERRL                      */
#define F_ERRN_N                        92 /* N  = ERRN                      */
#define F_ERROR_X_N                     93 /* N  = ERROR( X )                */
#define F_ERROR_X_A_N                   94 /* N  = ERROR( X, A$ )            */
#define F_ERROR4_S                      95 /* S$ = ERROR$                    */
#define F_EXAM_X_N                      96 /* N  = EXAM( X )                 */
#define F_EXEC_A_N                      97 /* N  = EXEC( A$ )                */
#define F_EXF_N                         98 /* N  = EXF( ... )                */
#define F_EXP_X_N                       99 /* N  = EXP( X )                  */
#define F_FALSE_N                      100 /* N  = FALSE                     */
#define F_FETCH_X_N                    101 /* N  = FETCH( X )                */
#define F_FILEATTR_X_Y_N               102 /* N  = FILEATTR( X, Y )          */
#define F_FILES_N                      103 /* N  = FILES                     */
#define F_FILES_A_N                    104 /* N  = FILES( A$ )               */
#define F_FILL_X_Y_N                   105 /* N  = FILL( X, Y )              */
#define F_FIX_X_N                      106 /* N  = FIX( X )                  */
#define F_FLOAT_X_N                    107 /* N  = FLOAT( X )                */
#define F_FLOW_N                       108 /* N  = FLOW                      */
#define F_FP_X_N                       109 /* N  = FP( X )                   */
#define F_FRAC_X_N                     110 /* N  = FRAC( X )                 */
#define F_FRE_N                        111 /* N  = FRE                       */
#define F_FRE_A_N                      112 /* N  = FRE( A$ )                 */
#define F_FRE_X_N                      113 /* N  = FRE( X )                  */
#define F_FREE_N                       114 /* N  = FREE                      */
#define F_FREE_X_N                     115 /* N  = FREE( X )                 */
#define F_FREE_A_N                     116 /* N  = FREE( A$ )                */
#define F_FREEFILE_N                   117 /* N  = FREEFILE                  */
#define F_GET_X_N                      118 /* N  = GET( X )                  */
#define F_GET_X_Y_N                    119 /* N  = GET( X, Y )               */
#define F_GRAD_N                       120 /* N  = GRAD                      */
#define F_GRADIAN_N                    121 /* N  = GRADIAN                   */
#define F_HCS_X_N                      122 /* N  = HCS( X )                  */
#define F_HEX_A_N                      123 /* N  = HEX( A$ )                 */
#define F_HEX4_X_S                     124 /* S$ = HEX$( X )                 */
#define F_HEX4_X_Y_S                   125 /* S$ = HEX$( X, Y )              */
#define F_HOME_N                       126 /* N  = HOME                      */
#define F_HSN_X_N                      127 /* N  = HSN( X )                  */
#define F_HTN_X_N                      128 /* N  = HTN( X )                  */
#define F_INCH4_S                      129 /* S$ = INCH$                     */
#define F_INDEX_A_B_N                  130 /* N  = INDEX( A$, B$ )           */
#define F_INITIALIZE_N                 131 /* N  = INITIALIZE                */
#define F_INKEY4_S                     132 /* S$ = INKEY$                    */
#define F_INP_X_N                      133 /* N  = INP( X )                  */
#define F_INPUT4_X_S                   134 /* S$ = INPUT$( X )               */
#define F_INPUT4_X_Y_S                 135 /* S$ = INPUT$( X, Y )            */
#define F_INSTR_A_B_N                  136 /* N  = INSTR( A$, B$ )           */
#define F_INSTR_A_B_X_N                137 /* N  = INSTR( A$, B$, X )        */
#define F_INSTR_X_A_B_N                138 /* N  = INSTR( X, A$, B$ )        */
#define F_INT_X_N                      139 /* N  = INT( X )                  */
#define F_INT5_X_N                     140 /* N  = INT%( X )                 */
#define F_IP_X_N                       141 /* N  = IP( X )                   */
#define F_KEY_S                        142 /* S$ = KEY                       */
#define F_KEY4_S                       143 /* S$ = KEY$                      */
#define F_KILL_A_N                     144 /* N  = KILL( A$ )                */
#define F_LBOUND_N                     145 /* N  = LBOUND( ... )             */
#define F_LCASE4_A_S                   146 /* S$ = LCASE$( A$ )              */
#define F_LEFT_A_X_S                   147 /* S$ = LEFT( A$, X )             */
#define F_LEFT4_A_X_S                  148 /* S$ = LEFT$( A$, X )            */
#define F_LEN_A_N                      149 /* N  = LEN( A$ )                 */
#define F_LGT_X_N                      150 /* N  = LGT( X )                  */
#define F_LIN_X_S                      151 /* S$ = LIN( X )                  */
#define F_LN_X_N                       152 /* N  = LN( X )                   */
#define F_LNO_X_N                      153 /* N  = LNO( X )                  */
#define F_LOC_X_N                      154 /* N  = LOC( X )                  */
#define F_LOCATE_X_Y_N                 155 /* N  = LOCATE( X, Y )            */
#define F_LOCK_X_N                     156 /* N  = LOCK( X )                 */
#define F_LOF_X_N                      157 /* N  = LOF( X )                  */
#define F_LOG_X_N                      158 /* N  = LOG( X )                  */
#define F_LOG10_X_N                    159 /* N  = LOG10( X )                */
#define F_LOG2_X_N                     160 /* N  = LOG2( X )                 */
#define F_LOGE_X_N                     161 /* N  = LOGE( X )                 */
#define F_LOWER4_A_S                   162 /* S$ = LOWER$( A$ )              */
#define F_LPOS_N                       163 /* N  = LPOS                      */
#define F_LTRIM4_A_S                   164 /* S$ = LTRIM$( A$ )              */
#define F_LTW_X_N                      165 /* N  = LTW( X )                  */
#define F_LWIDTH_X_N                   166 /* N  = LWIDTH( X )               */
#define F_MATCH_A_B_X_N                167 /* N  = MATCH( A$, B$, X )        */
#define F_MAX_A_B_S                    168 /* S$ = MAX( A$, B$ )             */
#define F_MAX_X_Y_N                    169 /* N  = MAX( X, Y )               */
#define F_MAXBYT_N                     170 /* N  = MAXBYT                    */
#define F_MAXCUR_N                     171 /* N  = MAXCUR                    */
#define F_MAXDBL_N                     172 /* N  = MAXDBL                    */
#define F_MAXDEV_N                     173 /* N  = MAXDEV                    */
#define F_MAXINT_N                     174 /* N  = MAXINT                    */
#define F_MAXLEN_N                     175 /* N  = MAXLEN                    */
#define F_MAXLEN_A_N                   176 /* N  = MAXLEN( A$ )              */
#define F_MAXLNG_N                     177 /* N  = MAXLNG                    */
#define F_MAXLVL_N                     178 /* N  = MAXLVL                    */
#define F_MAXNUM_N                     179 /* N  = MAXNUM                    */
#define F_MAXSNG_N                     180 /* N  = MAXSNG                    */
#define F_MEM_N                        181 /* N  = MEM                       */
#define F_MID_A_X_S                    182 /* S$ = MID( A$, X )              */
#define F_MID_A_X_Y_S                  183 /* S$ = MID( A$, X, Y )           */
#define F_MID4_A_X_S                   184 /* S$ = MID$( A$, X )             */
#define F_MID4_A_X_Y_S                 185 /* S$ = MID$( A$, X, Y )          */
#define F_MIN_X_Y_N                    186 /* N  = MIN( X, Y )               */
#define F_MIN_A_B_S                    187 /* S$ = MIN( A$, B$ )             */
#define F_MINBYT_N                     188 /* N  = MINBYT                    */
#define F_MINCUR_N                     189 /* N  = MINCUR                    */
#define F_MINDBL_N                     190 /* N  = MINDBL                    */
#define F_MINDEV_N                     191 /* N  = MINDEV                    */
#define F_MININT_N                     192 /* N  = MININT                    */
#define F_MINLNG_N                     193 /* N  = MINLNG                    */
#define F_MINNUM_N                     194 /* N  = MINNUM                    */
#define F_MINSNG_N                     195 /* N  = MINSNG                    */
#define F_MKC4_X_S                     196 /* S$ = MKC$( X )                 */
#define F_MKD4_X_S                     197 /* S$ = MKD$( X )                 */
#define F_MKDIR_A_N                    198 /* N  = MKDIR( A$ )               */
#define F_MKI4_X_S                     199 /* S$ = MKI$( X )                 */
#define F_MKL4_X_S                     200 /* S$ = MKL$( X )                 */
#define F_MKS4_X_S                     201 /* S$ = MKS$( X )                 */
#define F_MOD_X_Y_N                    202 /* N  = MOD( X, Y )               */
#define F_NAME_A_B_N                   203 /* N  = NAME( A$, B$ )            */
#define F_NAME_N                       204 /* N  = NAME( ... )               */
#define F_NOFLOW_N                     205 /* N  = NOFLOW                    */
#define F_NOTRACE_N                    206 /* N  = NOTRACE                   */
#define F_NULL_X_N                     207 /* N  = NULL( X )                 */
#define F_NUM_N                        208 /* N  = NUM                       */
#define F_NUM_A_N                      209 /* N  = NUM( A$ )                 */
#define F_NUM4_X_S                     210 /* S$ = NUM$( X )                 */
#define F_OCT4_X_S                     211 /* S$ = OCT$( X )                 */
#define F_OCT4_X_Y_S                   212 /* S$ = OCT$( X, Y )              */
#define F_OPEN_A_X_B_N                 213 /* N  = OPEN( A$, X, B$ )         */
#define F_OPEN_A_X_B_Y_N               214 /* N  = OPEN( A$, X, B$, Y )      */
#define F_ORD_A_N                      215 /* N  = ORD( A$ )                 */
#define F_OUT_X_Y_N                    216 /* N  = OUT( X, Y )               */
#define F_PAD_X_N                      217 /* N  = PAD( X )                  */
#define F_PAUSE_X_N                    218 /* N  = PAUSE( X )                */
#define F_PDL_X_N                      219 /* N  = PDL( X )                  */
#define F_PEEK_X_N                     220 /* N  = PEEK( X )                 */
#define F_PI_N                         221 /* N  = PI                        */
#define F_PI_X_N                       222 /* N  = PI( X )                   */
#define F_PIN_X_N                      223 /* N  = PIN( X )                  */
#define F_POKE_X_Y_N                   224 /* N  = POKE( X, Y )              */
#define F_POS_N                        225 /* N  = POS                       */
#define F_POS_X_N                      226 /* N  = POS( X )                  */
#define F_POS_A_B_N                    227 /* N  = POS( A$, B$ )             */
#define F_POS_A_B_X_N                  228 /* N  = POS( A$, B$, X )          */
#define F_PRECISION_X_N                229 /* N  = PRECISION( X )            */
#define F_PTR_N                        230 /* N  = PTR( ... )                */
#define F_PUT_X_N                      231 /* N  = PUT( X )                  */
#define F_PUT_X_Y_N                    232 /* N  = PUT( X, Y )               */
#define F_RAD_N                        233 /* N  = RAD                       */
#define F_RAD_X_N                      234 /* N  = RAD( X )                  */
#define F_RADIAN_N                     235 /* N  = RADIAN                    */
#define F_RAN_N                        236 /* N  = RAN                       */
#define F_RAN_X_N                      237 /* N  = RAN( X )                  */
#define F_RANDOM_N                     238 /* N  = RANDOM                    */
#define F_RANDOM_X_N                   239 /* N  = RANDOM( X )               */
#define F_RANDOMIZE_N                  240 /* N  = RANDOMIZE                 */
#define F_RANDOMIZE_X_N                241 /* N  = RANDOMIZE( X )            */
#define F_REMAINDER_X_Y_N              242 /* N  = REMAINDER( X, Y )         */
#define F_RENAME_A_B_N                 243 /* N  = RENAME( A$, B$ )          */
#define F_REPEAT4_X_A_S                244 /* S$ = REPEAT$( X, A$ )          */
#define F_REPEAT4_X_Y_S                245 /* S$ = REPEAT$( X, Y )           */
#define F_RESET_N                      246 /* N  = RESET                     */
#define F_RESIDUE_N                    247 /* N  = RESIDUE                   */
#define F_RIGHT_A_X_S                  248 /* S$ = RIGHT( A$, X )            */
#define F_RIGHT4_A_X_S                 249 /* S$ = RIGHT$( A$, X )           */
#define F_RMDIR_A_N                    250 /* N  = RMDIR( A$ )               */
#define F_RND_N                        251 /* N  = RND                       */
#define F_RND_X_N                      252 /* N  = RND( X )                  */
#define F_ROUND_X_Y_N                  253 /* N  = ROUND( X, Y )             */
#define F_RTRIM4_A_S                   254 /* S$ = RTRIM$( A$ )              */
#define F_SCALE_X_N                    255 /* N  = SCALE( X )                */
#define F_SEC_X_N                      256 /* N  = SEC( X )                  */
#define F_SEEK_X_N                     257 /* N  = SEEK( X )                 */
#define F_SEEK_X_Y_N                   258 /* N  = SEEK( X, Y )              */
#define F_SEG_X_N                      259 /* N  = SEG( X )                  */
#define F_SEG_A_X_Y_S                  260 /* S$ = SEG( A$, X, Y )           */
#define F_SEG4_A_X_Y_S                 261 /* S$ = SEG$( A$, X, Y )          */
#define F_SGN_X_N                      262 /* N  = SGN( X )                  */
#define F_SHELL_A_N                    263 /* N  = SHELL( A$ )               */
#define F_SIN_X_N                      264 /* N  = SIN( X )                  */
#define F_SIND_X_N                     265 /* N  = SIND( X )                 */
#define F_SING_X_N                     266 /* N  = SING( X )                 */
#define F_SINH_X_N                     267 /* N  = SINH( X )                 */
#define F_SIZE_A_N                     268 /* N  = SIZE( A$ )                */
#define F_SIZE_N                       269 /* N  = SIZE( ... )               */
#define F_SLEEP_X_N                    270 /* N  = SLEEP( X )                */
#define F_SNH_X_N                      271 /* N  = SNH( X )                  */
#define F_SPA_X_S                      272 /* S$ = SPA( X )                  */
#define F_SPACE_X_S                    273 /* S$ = SPACE( X )                */
#define F_SPACE4_X_S                   274 /* S$ = SPACE$( X )               */
#define F_SPC_X_S                      275 /* S$ = SPC( X )                  */
#define F_SQR_X_N                      276 /* N  = SQR( X )                  */
#define F_SQRT_X_N                     277 /* N  = SQRT( X )                 */
#define F_STR_X_Y_S                    278 /* S$ = STR( X, Y )               */
#define F_STR4_X_S                     279 /* S$ = STR$( X )                 */
#define F_STRING_X_Y_S                 280 /* S$ = STRING( X, Y )            */
#define F_STRING4_X_A_S                281 /* S$ = STRING$( X, A$ )          */
#define F_STRING4_X_Y_S                282 /* S$ = STRING$( X, Y )           */
#define F_STRIP4_A_S                   283 /* S$ = STRIP$( A$ )              */
#define F_STUFF_X_Y_N                  284 /* N  = STUFF( X, Y )             */
#define F_TAB_X_S                      285 /* S$ = TAB( X )                  */
#define F_TAN_X_N                      286 /* N  = TAN( X )                  */
#define F_TAND_X_N                     287 /* N  = TAND( X )                 */
#define F_TANG_X_N                     288 /* N  = TANG( X )                 */
#define F_TANH_X_N                     289 /* N  = TANH( X )                 */
#define F_TI_N                         290 /* N  = TI                        */
#define F_TI4_S                        291 /* S$ = TI$                       */
#define F_TIM_N                        292 /* N  = TIM                       */
#define F_TIM_X_N                      293 /* N  = TIM( X )                  */
#define F_TIME_N                       294 /* N  = TIME                      */
#define F_TIME_X_N                     295 /* N  = TIME( X )                 */
#define F_TIME4_S                      296 /* S$ = TIME$                     */
#define F_TIME4_X_S                    297 /* S$ = TIME$( X )                */
#define F_TIMER_N                      298 /* N  = TIMER                     */
#define F_TOP_N                        299 /* N  = TOP                       */
#define F_TRACE_N                      300 /* N  = TRACE                     */
#define F_TRACE_X_N                    301 /* N  = TRACE( X )                */
#define F_TRIM4_A_S                    302 /* S$ = TRIM$( A$ )               */
#define F_TROFF_N                      303 /* N  = TROFF                     */
#define F_TRON_N                       304 /* N  = TRON                      */
#define F_TRUE_N                       305 /* N  = TRUE                      */
#define F_TRUNCATE_X_Y_N               306 /* N  = TRUNCATE( X, Y )          */
#define F_UBOUND_N                     307 /* N  = UBOUND( ... )             */
#define F_UCASE4_A_S                   308 /* S$ = UCASE$( A$ )              */
#define F_UNLOCK_X_N                   309 /* N  = UNLOCK( X )               */
#define F_UNSAVE_A_N                   310 /* N  = UNSAVE( A$ )              */
#define F_UPPER4_A_S                   311 /* S$ = UPPER$( A$ )              */
#define F_USR_N                        312 /* N  = USR( ... )                */
#define F_USR0_N                       313 /* N  = USR0( ... )               */
#define F_USR1_N                       314 /* N  = USR1( ... )               */
#define F_USR2_N                       315 /* N  = USR2( ... )               */
#define F_USR3_N                       316 /* N  = USR3( ... )               */
#define F_USR4_N                       317 /* N  = USR4( ... )               */
#define F_USR5_N                       318 /* N  = USR5( ... )               */
#define F_USR6_N                       319 /* N  = USR6( ... )               */
#define F_USR7_N                       320 /* N  = USR7( ... )               */
#define F_USR8_N                       321 /* N  = USR8( ... )               */
#define F_USR9_N                       322 /* N  = USR9( ... )               */
#define F_UUF_N                        323 /* N  = UUF( ... )                */
#define F_VAL_A_N                      324 /* N  = VAL( A$ )                 */
#define F_VARPTR_N                     325 /* N  = VARPTR( ... )             */
#define F_VTAB_X_N                     326 /* N  = VTAB( X )                 */
#define F_WAIT_X_N                     327 /* N  = WAIT( X )                 */
#define F_WAIT_X_Y_N                   328 /* N  = WAIT( X, Y )              */
#define F_WAIT_X_Y_Z_N                 329 /* N  = WAIT( X, Y, Z )           */
#define F_WIDTH_X_N                    330 /* N  = WIDTH( X )                */
#define F_WIDTH_X_Y_N                  331 /* N  = WIDTH( X, Y )             */
#define F_ZONE_X_N                     332 /* N  = ZONE( X )                 */
#define F_ZONE_X_Y_N                   333 /* N  = ZONE( X, Y )              */

/*-------------------------------------------------------------
                        WARNINGS
-------------------------------------------------------------*/
#define WARN_CLEAR                           bwx_Error(  0, NULL )
#define WARN_NEXT_WITHOUT_FOR                bwx_Error(  1, NULL )
#define WARN_SYNTAX_ERROR                    bwx_Error(  2, NULL )
#define WARN_RETURN_WITHOUT_GOSUB            bwx_Error(  3, NULL )
#define WARN_OUT_OF_DATA                     bwx_Error(  4, NULL )
#define WARN_ILLEGAL_FUNCTION_CALL           bwx_Error(  5, NULL )
#define WARN_OVERFLOW                        bwx_Error(  6, NULL )
#define WARN_OUT_OF_MEMORY                   bwx_Error(  7, NULL )
#define WARN_UNDEFINED_LINE                  bwx_Error(  8, NULL )
#define WARN_SUBSCRIPT_OUT_OF_RANGE          bwx_Error(  9, NULL )
#define WARN_REDIMENSION_ARRAY               bwx_Error( 10, NULL )
#define WARN_DIVISION_BY_ZERO                bwx_Error( 11, NULL )
#define WARN_ILLEGAL_DIRECT                  bwx_Error( 12, NULL )
#define WARN_TYPE_MISMATCH                   bwx_Error( 13, NULL )
#define WARN_OUT_OF_STRING_SPACE             bwx_Error( 14, NULL )
#define WARN_STRING_TOO_LONG                 bwx_Error( 15, NULL )
#define WARN_STRING_FORMULA_TOO_COMPLEX      bwx_Error( 16, NULL )
#define WARN_CANT_CONTINUE                   bwx_Error( 17, NULL )
#define WARN_UNDEFINED_USER_FUNCTION         bwx_Error( 18, NULL )
#define WARN_NO_RESUME                       bwx_Error( 19, NULL )
#define WARN_RESUME_WITHOUT_ERROR            bwx_Error( 20, NULL )
#define WARN_UNPRINTABLE_ERROR               bwx_Error( 21, NULL )
#define WARN_MISSING_OPERAND                 bwx_Error( 22, NULL )
#define WARN_LINE_BUFFER_OVERFLOW            bwx_Error( 23, NULL )
#define WARN_FOR_WITHOUT_NEXT                bwx_Error( 26, NULL )
#define WARN_BAD_DATA                        bwx_Error( 27, NULL )        /* NEW in bwBASIC 3.20 */
#define WARN_UNASSIGNED_28                   bwx_Error( 28, NULL )
#define WARN_WHILE_WITHOUT_WEND              bwx_Error( 29, NULL )
#define WARN_WEND_WITHOUT_WHILE              bwx_Error( 30, NULL )
#define WARN_EXIT_FUNCTION_WITHOUT_FUNCTION  bwx_Error( 31, NULL )
#define WARN_END_FUNCTION_WITHOUT_FUNCTION   bwx_Error( 32, NULL )
#define WARN_EXIT_SUB_WITHOUT_SUB            bwx_Error( 33, NULL )
#define WARN_END_SUB_WITHOUT_SUB             bwx_Error( 34, NULL )
#define WARN_EXIT_FOR_WITHOUT_FOR            bwx_Error( 35, NULL )
#define WARN_FIELD_OVERFLOW                  bwx_Error( 50, NULL )
#define WARN_INTERNAL_ERROR                  bwx_Error( 51, NULL )
#define WARN_BAD_FILE_NUMBER                 bwx_Error( 52, NULL )
#define WARN_FILE_NOT_FOUND                  bwx_Error( 53, NULL )
#define WARN_BAD_FILE_MODE                   bwx_Error( 54, NULL )
#define WARN_FILE_ALREADY_OPEN               bwx_Error( 55, NULL )
#define WARN_UNASSIGNED_56                   bwx_Error( 56, NULL )
#define WARN_DISK_IO_ERROR                   bwx_Error( 57, NULL )
#define WARN_FILE_ALREADY_EXISTS             bwx_Error( 58, NULL )
#define WARN_UNASSIGNED_59                   bwx_Error( 59, NULL )
#define WARN_UNASSIGNED_60                   bwx_Error( 60, NULL )
#define WARN_DISK_FULL                       bwx_Error( 61, NULL )
#define WARN_INPUT_PAST_END                  bwx_Error( 62, NULL )
#define WARN_BAD_RECORD_NUMBER               bwx_Error( 63, NULL )
#define WARN_BAD_FILE_NAME                   bwx_Error( 64, NULL )
#define WARN_UNASSIGNED_65                   bwx_Error( 65, NULL )
#define WARN_DIRECT_STATEMENT_IN_FILE        bwx_Error( 66, NULL )
#define WARN_TOO_MANY_FILES                  bwx_Error( 67, NULL )
#define WARN_UNASSIGNED_68                   bwx_Error( 68, NULL )
#define WARN_VARIABLE_NOT_DECLARED           bwx_Error( 70, NULL )
#define WARN_ADVANCED_FEATURE                bwx_Error( 73, NULL )




/* EOF */
Un proyecto texto-plano.xyz