1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676
|
/* C K C D E B . H */
/*
Sat Sep 19 15:22:06 2020
NOTE TO CONTRIBUTORS: This file, and all the other C-Kermit files, must be
compatible with C preprocessors that support only #ifdef, #else, #endif,
#define, and #undef. Please do not use #if, logical operators, or other
later-model preprocessor features in any of the portable C-Kermit modules.
You can, of course, use these constructions in platform-specific modules
when you know they are supported.
*/
/*
This file is included by all C-Kermit modules, including the modules
that aren't specific to Kermit (like the command parser and the ck?tio and
ck?fio modules). It should be included BEFORE any other C-Kermit header
files. It specifies format codes for debug(), tlog(), and similar
functions, and includes any necessary definitions to be used by all C-Kermit
modules, and also includes some feature selection compile-time switches, and
also system- or compiler-dependent definitions, plus #includes and prototypes
required by all C-Kermit modules.
*/
/*
Author: Frank da Cruz <fdc@columbia.edu>,
Columbia University Academic Information Systems, New York City.
Copyright (C) 1985, 2020,
Trustees of Columbia University in the City of New York.
All rights reserved. See the C-Kermit COPYING.TXT file or the
copyright text in the ckcmai.c module for disclaimer and permissions.
*/
/*
Etymology: The name of this file means "C-Kermit Common-C-Language Debugging
Header", because originally it contained only the formats (F000-F111) for
the debug() and tlog() functions. Since then it has grown to include all
material required by all other C-Kermit modules, including the non-Kermit
specific ones. In other words, this is the one header file that is
guaranteed to be included by all C-Kermit source modules.
*/
#ifndef CKCDEB_H /* Don't include me more than once. */
#define CKCDEB_H
#ifdef OS2
#include "ckoker.h"
#else /* OS2 */
/* Unsigned numbers */
#ifndef USHORT
#define USHORT unsigned short
#endif /* USHORT */
#ifndef UINT
#define UINT unsigned int
#endif /* UINT */
#ifndef ULONG
#define ULONG unsigned long
#endif /* ULONG */
#endif /* OS2 */
#ifdef MACOSX10 /* Mac OS X 1.0 */
#ifndef MACOSX /* implies Mac OS X */
#define MACOSX
#endif /* MACOSX */
#endif /* MACOSX10 */
#ifdef MACOSX /* Mac OS X */
#ifndef BSD44 /* implies 4.4 BSD */
#define BSD44
#endif /* BSD44 */
#endif /* MACOSX */
#ifdef SCO_OSR505 /* SCO 3.2v5.0.5 */
#ifndef SCO_OSR504 /* implies SCO 3.2v5.0.4 */
#define SCO_OSR504
#endif /* SCO_OSR504 */
#endif /* SCO_OSR505 */
#ifdef SCO_OSR504 /* SCO 3.2v5.0.4 */
#ifndef CK_SCOV5 /* implies SCO 3.2v5.0 */
#define CK_SCOV5
#endif /* CK_SCOV5 */
#include <sys/types.h> /* To sidestep header-file mess */
#endif /* SCO_OSR504 */
#ifdef CK_SCOV5
#ifndef ANYSCO
#define ANYSCO
#endif /* ANYSCO */
#endif /* CK_SCOV5 */
#ifdef UNIXWARE
#ifndef ANYSCO
#define ANYSCO
#endif /* ANYSCO */
#endif /* UNIXWARE */
#ifndef MINIX /* Minix versions */
#ifdef MINIX315
#define MINIX
#else
#ifdef MINIX3
#define MINIX
#else
#ifdef MINIX2
#define MINIX
#endif /* MINIX2 */
#endif /* MINIX3 */
#endif /* MINIX315 */
#endif /* MINIX */
#ifdef CK_SCO32V4 /* SCO 3.2v4 */
#ifndef ANYSCO
#define ANYSCO
#endif /* ANYSCO */
#ifndef XENIX
#define XENIX
#endif /* XENIX */
#ifndef SVR3
#define SVR3
#endif /* SVR3 */
#ifndef DIRENT
#define DIRENT
#endif /* DIRENT */
#ifndef RENAME
#define RENAME
#endif /* RENAME */
#ifndef SVR3JC
#define SVR3JC
#endif /* SVR3JC */
#ifndef CK_RTSCTS
#define CK_RTSCTS
#endif /* CK_RTSCTS */
#ifndef PID_T
#define PID_T pid_t
#endif /* PID_T */
#ifndef PWID_T
#define PWID_T int
#endif /* PWID_T */
#endif /* CK_SCO32V4 */
#ifdef NOICP /* If no command parser */
#ifndef NOSPL /* Then no script language either */
#define NOSPL
#endif /* NOSPL */
#ifndef NOCSETS /* Or characer sets */
#define NOCSETS
#endif /* NOCSETS */
#ifndef NOFTP /* Or FTP client */
#define NOFTP
#endif /* NOFTP */
#endif /* NOICP */
/* Built-in makefile entries */
#ifdef SOLARIS11 /* Solaris 11 implies 10 */
#ifndef SOLARIS10
#define SOLARIS10
#endif /* SOLARIS10 */
#endif /* SOLARIS11 */
#ifdef SOLARIS10 /* Solaris 10 implies 9 */
#ifndef SOLARIS9
#define SOLARIS9
#endif /* SOLARIS9 */
#endif /* SOLARIS10 */
#ifdef SOLARIS9 /* Solaris 9 implies 8 */
#ifndef SOLARIS8
#define SOLARIS8
#endif /* SOLARIS8 */
#endif /* SOLARIS9 */
#ifdef SOLARIS8 /* Solaris 8 implies 7 */
#ifndef SOLARIS7
#define SOLARIS7
#endif /* SOLARIS7 */
#endif /* SOLARIS8 */
#ifdef SOLARIS7 /* Solaris 7 implies 2.6 */
#ifndef SOLARIS26
#define SOLARIS26
#endif /* SOLARIS26 */
#endif /* SOLARIS7 */
#ifdef SOLARIS26 /* Solaris 2.6 implies 2.5 */
#ifndef SOLARIS25
#define SOLARIS25
#endif /* SOLARIS25 */
#endif /* SOLARIS26 */
#ifdef SOLARIS25 /* Solaris 2.5 implies Solaris */
#ifndef SOLARIS
#define SOLARIS
#endif /* SOLARIS */
#ifndef POSIX /* And POSIX */
#define POSIX
#endif /* POSIX */
#ifndef CK_WREFRESH /* And this (curses) */
#define CK_WREFRESH
#endif /* CK_WREFRESH */
#endif /* SOLARIS25 */
#ifdef SOLARIS24 /* Solaris 2.4 implies Solaris */
#ifndef SOLARIS
#define SOLARIS
#endif /* SOLARIS */
#endif /* SOLARIS24 */
#ifdef SOLARIS /* Solaris gets "POSIX" RTS/CTS API */
#ifdef POSIX
#ifndef POSIX_CRTSCTS
#define POSIX_CRTSCTS
#endif /* POSIX_CRTSCTS */
#endif /* POSIX */
#ifndef SVR4
#define SVR4
#endif /* SVR4 */
#ifndef STERMIOX
#define STERMIOX
#endif /* STERMIOX */
#ifndef SELECT
#define SELECT
#endif /* SELECT */
#ifndef FNFLOAT
#define FNFLOAT
#endif /* FNFLOAT */
#ifndef DIRENT
#define DIRENT
#endif /* DIRENT */
#ifndef BIGBUFOK
#define BIGBUFOK
#endif /* BIGBUFOK */
#ifndef CK_NEWTERM
#define CK_NEWTERM
#endif /* CK_NEWTERM */
#endif /* SOLARIS */
#ifdef SUN4S5 /* Sun-4 System V environment */
#ifndef SVR3 /* implies System V R3 or later */
#define SVR3
#endif /* SVR3 */
#endif /* SUN4S5 */
#ifdef SUNOS41 /* SUNOS41 implies SUNOS4 */
#ifndef SUNOS4
#define SUNOS4
#endif /* SUNOS4 */
#endif /* SUNOS41 */
#ifdef SUN4S5 /* Sun-4 System V environment */
#ifndef SVR3 /* implies System V R3 or later */
#define SVR3
#endif /* SVR3 */
#endif /* SUN4S5 */
#ifdef SUNOS41 /* SUNOS41 implies SUNOS4 */
#ifndef SUNOS4
#define SUNOS4
#endif /* SUNOS4 */
#endif /* SUNOS41 */
#ifdef SUNOS4 /* Built-in SUNOS4 makefile entry */
#ifndef UNIX
#define UNIX
#endif /* UNIX */
#ifndef BSD4
#define BSD4
#endif /* BSD4 */
#ifndef NOSETBUF
#define NOSETBUF
#endif /* NOSETBUF */
#ifndef DIRENT
#define DIRENT
#endif /* DIRENT */
#ifndef NONET
#ifndef TCPSOCKET
#define TCPSOCKET
#endif /* TCPSOCKET */
#endif /* NONET */
#ifndef SAVEDUID
#define SAVEDUID
#endif /* SAVEDUID */
#ifndef DYNAMIC
#define DYNAMIC
#endif /* DYNAMIC */
#endif /* SUNOS4 */
#ifdef SOLARIS /* Built in makefile entry */
#ifndef NOSETBUF /* for Solaris 2.x */
#define NOSETBUF
#endif /* NOSETBUF */
#ifndef NOCURSES
#ifndef CK_CURSES
#define CK_CURSES
#endif /* CK_CURSES */
#endif /* NOCURSES */
#ifndef CK_NEWTERM
#define CK_NEWTERM
#endif /* CK_NEWTERM */
#ifndef DIRENT
#define DIRENT
#endif /* DIRENT */
#ifndef NONET
#ifndef TCPSOCKET
#define TCPSOCKET
#endif /* TCPSOCKET */
#endif /* NONET */
#ifndef UNIX
#define UNIX
#endif /* UNIX */
#ifndef SVR4
#define SVR4
#endif /* SVR4 */
#ifndef HADDRLIST
#define HADDRLIST
#endif /* HADDRLIST */
#ifndef STERMIOX
#define STERMIOX
#endif /* STERMIOX */
#ifndef SELECT
#define SELECT
#endif /* SELECT */
#ifndef DYNAMIC
#define DYNAMIC
#endif /* DYNAMIC */
#ifndef NOUUCP
#ifndef HDBUUCP
#define HDBUUCP
#endif /* HDBUUCP */
#endif /* NOUUCP */
#endif /* SOLARIS */
/* Features that can be eliminated from a no-file-transfer version */
#ifdef NOXFER
#ifndef NOFTP
#define NOFTP
#endif /* NOFTP */
#ifndef OS2
#ifndef NOCURSES /* Fullscreen file-transfer display */
#define NOCURSES
#endif /* NOCURSES */
#endif /* OS2 */
#ifndef NOCKXYZ /* XYZMODEM support */
#define NOCKXYZ
#endif /* NOCKXYZ */
#ifndef NOCKSPEED /* Ctrl-char unprefixing */
#define NOCKSPEED
#endif /* NOCKSPEED */
#ifndef NOSERVER /* Server mode */
#define NOSERVER
#endif /* NOSERVER */
#ifndef NOCKTIMERS /* Dynamic packet timers */
#define NOCKTIMERS
#endif /* NOCKTIMERS */
#ifndef NOPATTERNS /* File-type patterns */
#define NOPATTERNS
#endif /* NOPATTERNS */
#ifndef NOSTREAMING /* Streaming */
#define NOSTREAMING
#endif /* NOSTREAMING */
#ifndef NOIKSD /* Internet Kermit Service */
#define NOIKSD
#endif /* NOIKSD */
#ifndef NOPIPESEND /* Sending from pipes */
#define NOPIPESEND
#endif /* NOPIPESEND */
#ifndef NOAUTODL /* Autodownload */
#define NOAUTODL
#endif /* NOAUTODL */
#ifndef NOMSEND /* MSEND */
#define NOMSEND
#endif /* NOMSEND */
#ifndef NOTLOG /* Transaction logging */
#define NOTLOG
#endif /* NOTLOG */
#ifndef NOCKXXCHAR /* Packet character doubling */
#define NOCKXXCHAR
#endif /* NOCKXXCHAR */
#endif /* NOXFER */
#ifdef NOICP /* No Interactive Command Parser */
#ifndef NODIAL /* Implies No DIAL command */
#define NODIAL
#endif /* NODIAL */
#ifndef NOCKXYZ /* and no external protocols */
#define NOCKXYZ
#endif /* NOCKXYZ */
#endif /* NOICP */
#ifndef NOIKSD
#ifdef IKSDONLY
#ifndef IKSD
#define IKSD
#endif /* IKSD */
#ifndef NOLOCAL
#define NOLOCAL
#endif /* NOLOCAL */
#ifndef NOPUSH
#define NOPUSH
#endif /* NOPUSH */
#ifndef TNCODE
#define TNCODE
#endif /* TNCODE */
#ifndef TCPSOCKET
#define TCPSOCKET
#endif /* TCPSOCKET */
#ifndef NETCONN
#define NETCONN
#endif /* NETCONN */
#ifdef SUNX25
#undef SUNX25
#endif /* SUNX25 */
#ifdef IBMX25
#undef IBMX25
#endif /* IBMX25 */
#ifdef STRATUSX25
#undef STRATUSX25
#endif /* STRATUSX25 */
#ifdef CK_NETBIOS
#undef CK_NETBIOS
#endif /* CK_NETBIOS */
#ifdef SUPERLAT
#undef SUPERLAT
#endif /* SUPERLAT */
#ifdef NPIPE
#undef NPIPE
#endif /* NPIPE */
#ifdef NETFILE
#undef NETFILE
#endif /* NETFILE */
#ifdef NETCMD
#undef NETCMD
#endif /* NETCMD */
#ifdef NETPTY
#undef NETPTY
#endif /* NETPTY */
#ifdef RLOGCODE
#undef RLOGCODE
#endif /* RLOGCODE */
#ifdef NETDLL
#undef NETDLL
#endif /* NETDLL */
#ifndef NOSSH
#undef NOSSH
#endif /* NOSSH */
#ifndef NOFORWARDX
#define NOFORWARDX
#endif /* NOFORWARDX */
#ifndef NOBROWSER
#define NOBROWSER
#endif /* NOBROWSER */
#ifndef NOHTTP
#define NOHTTP
#endif /* NOHTTP */
#ifndef NOFTP
#define NOFTP
#endif /* NOFTP */
#ifndef NO_COMPORT
#define NO_COMPORT
#endif /* NO_COMPORT */
#endif /* IKSDONLY */
#endif /* NOIKSD */
/* Features that can be eliminated from a remote-only version */
#ifdef NOLOCAL
#ifndef NOFTP
#define NOFTP
#endif /* NOFTP */
#ifndef NOHTTP
#define NOHTTP
#endif /* NOHTTP */
#ifndef NOSSH
#define NOSSH
#endif /* NOSSH */
#ifndef NOTERM
#define NOTERM
#endif /* NOTERM */
#ifndef NOCURSES /* Fullscreen file-transfer display */
#define NOCURSES
#endif /* NOCURSES */
#ifndef NODIAL
#define NODIAL
#endif /* NODIAL */
#ifndef NOSCRIPT
#define NOSCRIPT
#endif /* NOSCRIPT */
#ifndef NOSETKEY
#define NOSETKEY
#endif /* NOSETKEY */
#ifndef NOKVERBS
#define NOKVERBS
#endif /* NOKVERBS */
#ifndef NOXMIT
#define NOXMIT
#endif /* NOXMIT */
#ifdef CK_CURSES
#undef CK_CURSES
#endif /* CK_CURSES */
#ifndef IKSDONLY
#ifndef NOAPC
#define NOAPC
#endif /* NOAPC */
#ifndef NONET
#define NONET
#endif /* NONET */
#endif /* IKSDONLY */
#endif /* NOLOCAL */
#ifdef NONET
#ifdef NETCONN
#undef NETCONN
#endif /* NETCONN */
#ifdef TCPSOCKET
#undef TCPSOCKET
#endif /* TCPSOCKET */
#ifndef NOTCPOPTS
#define NOTCPOPTS
#endif /* NOTCPOPTS */
#ifdef SUNX25
#undef SUNX25
#endif /* SUNX25 */
#ifdef IBMX25
#undef IBMX25
#endif /* IBMX25 */
#ifdef STRATUSX25
#undef STRATUSX25
#endif /* STRATUSX25 */
#ifdef CK_NETBIOS
#undef CK_NETBIOS
#endif /* CK_NETBIOS */
#ifdef SUPERLAT
#undef SUPERLAT
#endif /* SUPERLAT */
#ifdef NPIPE
#undef NPIPE
#endif /* NPIPE */
#ifdef NETFILE
#undef NETFILE
#endif /* NETFILE */
#ifdef NETCMD
#undef NETCMD
#endif /* NETCMD */
#ifdef NETPTY
#undef NETPTY
#endif /* NETPTY */
#ifdef RLOGCODE
#undef RLOGCODE
#endif /* RLOGCODE */
#ifdef NETDLL
#undef NETDLL
#endif /* NETDLL */
#ifndef NOSSH
#define NOSSH
#endif /* NOSSH */
#ifndef NOFTP
#define NOFTP
#endif /* NOFTP */
#ifndef NOHTTP
#define NOHTTP
#endif /* NOHTTP */
#ifndef NOBROWSER
#define NOBROWSER
#endif /* NOBROWSER */
#ifndef NOFORWARDX
#define NOFORWARDX
#endif /* NOFORWARDX */
#endif /* NONET */
#ifdef IKSDONLY
#ifdef SUNX25
#undef SUNX25
#endif /* SUNX25 */
#ifdef IBMX25
#undef IBMX25
#endif /* IBMX25 */
#ifdef STRATUSX25
#undef STRATUSX25
#endif /* STRATUSX25 */
#ifdef CK_NETBIOS
#undef CK_NETBIOS
#endif /* CK_NETBIOS */
#ifdef SUPERLAT
#undef SUPERLAT
#endif /* SUPERLAT */
#ifdef NPIPE
#undef NPIPE
#endif /* NPIPE */
#ifdef NETFILE
#undef NETFILE
#endif /* NETFILE */
#ifdef NETCMD
#undef NETCMD
#endif /* NETCMD */
#ifdef NETPTY
#undef NETPTY
#endif /* NETPTY */
#ifdef RLOGCODE
#undef RLOGCODE
#endif /* RLOGCODE */
#ifdef NETDLL
#undef NETDLL
#endif /* NETDLL */
#ifndef NOSSH
#define NOSSH
#endif /* NOSSH */
#ifndef NOHTTP
#define NOHTTP
#endif /* NOHTTP */
#ifndef NOBROWSER
#define NOBROWSER
#endif /* NOBROWSER */
#endif /* IKSDONLY */
/*
Note that none of the above precludes TNCODE, which can be defined in
the absence of TCPSOCKET, etc, to enable server-side Telnet negotation.
*/
#ifndef TNCODE /* This is for the benefit of */
#ifdef TCPSOCKET /* modules that might need TNCODE */
#define TNCODE /* not all of ckcnet.h... */
#endif /* TCPSOCKET */
#endif /* TNCODE */
#ifndef NETCONN
#ifdef TCPSOCKET
#define NETCONN
#endif /* TCPSOCKET */
#endif /* NETCONN */
#ifndef DEFPAR /* Default parity */
#define DEFPAR 0 /* Must be here because it is used */
#endif /* DEFPAR */ /* by all classes of modules */
#ifdef NT
#ifndef OS2ORWIN32
#define OS2ORWIN32
#endif /* OS2ORWIN32 */
#ifndef OS2
#define WIN32ONLY
#endif /* OS2 */
#endif /* NT */
#ifdef OS2 /* For OS/2 debugging */
#ifndef OS2ORWIN32
#define OS2ORWIN32
#endif /* OS2ORWIN32 */
#ifdef NT
#define NOCRYPT
#include <windows.h>
#define NTSIG
#else /* NT */
#define OS2ONLY
#include <os2def.h>
#endif /* NT */
#ifndef OS2ORUNIX
#define OS2ORUNIX
#endif /* OS2ORUNIX */
#ifndef OS2ORVMS
#define OS2ORVMS
#endif /* OS2ORVMS */
#endif /* OS2 */
#include <stdio.h> /* Begin by including this. */
#include <ctype.h> /* and this. */
#ifdef VMS
#include <types.h> /* Ensure off_t. */
#include "ckvrms.h" /* Get NAMDEF NAMX_C_MAXRSS. */
#endif /* def VMS */
/* System-type compilation switches */
#ifdef FT21 /* Fortune For:Pro 2.1 implies 1.8 */
#ifndef FT18
#define FT18
#endif /* FT18 */
#endif /* FT21 */
#ifdef __bsdi__
#ifndef BSDI
#define BSDI
#endif /* BSDI */
#endif /* __bsdi__ */
#ifdef AIXPS2 /* AIXPS2 implies AIX370 */
#ifndef AIX370
#define AIX370
#endif /* AIX370 */
#endif /* AIXPS2 */
#ifdef AIX370 /* AIX PS/2 or 370 implies BSD4 */
#ifndef BSD4
#define BSD4
#endif /* BSD4 */
#endif /* AIX370 */
#ifdef AIXESA /* AIX/ESA implies BSD4.4 */
#ifndef BSD44
#define BSD44
#endif /* BSD44 */
#endif /* AIXESA */
#ifdef AIX53 /* AIX53 implies AIX52 */
#ifndef AIX52
#define AIX52
#endif /* AIX52 */
#endif /* AIX53 */
#ifdef AIX52 /* AIX52 implies AIX51 */
#ifndef AIX51
#define AIX51
#endif /* AIX51 */
#endif /* AIX52 */
#ifdef AIX51 /* AIX51 implies AIX50 */
#ifndef AIX50
#define AIX50
#endif /* AIX50 */
#endif /* AIX51 */
#ifdef AIX50 /* AIX50 implies AIX45 */
#ifndef AIX45
#define AIX45
#endif /* AIX45 */
#endif /* AIX50 */
#ifdef AIX45 /* AIX45 implies AIX44 */
#ifndef AIX44
#define AIX44
#endif /* AIX44 */
#endif /* AIX45 */
#ifdef AIX44 /* AIX44 implies AIX43 */
#ifndef AIX43
#define AIX43
#endif /* AIX43 */
#endif /* AIX44 */
#ifdef AIX43 /* AIX43 implies AIX42 */
#ifndef AIX42
#define AIX42
#endif /* AIX42 */
#endif /* AIX43 */
#ifdef AIX42 /* AIX42 implies AIX41 */
#ifndef AIX41
#define AIX41
#endif /* AIX41 */
#endif /* AIX42 */
#ifdef SV68R3V6 /* System V/68 R32V6 implies SVR3 */
#ifndef SVR3
#define SVR3
#endif /* SVR3 */
#endif /* SV68R3V6 */
#ifdef SV88R32 /* System V/88 R32 implies SVR3 */
#ifndef SVR3
#define SVR3
#endif /* SVR3 */
#endif /* SV88R32 */
#ifdef DGUX540 /* DG UX 5.40 implies Sys V R 4 */
#ifndef SVR4
#define SVR4
#endif /* SVR4 */
#endif /* DGUX540 */
#ifndef DGUX
#ifdef DGUX540 /* DG/UX 5.40 implies DGUX */
#define DGUX
#else
#ifdef DGUX430 /* So does DG/UX 4.30 */
#define DGUX
#endif /* DGUX430 */
#endif /* DGUX540 */
#endif /* DGUX */
#ifdef IRIX65 /* IRIX 6.5 implies IRIX 6.4 */
#ifndef IRIX64
#define IRIX64
#endif /* IRIX64 */
#endif /* IRIX65 */
#ifdef IRIX64 /* IRIX 6.4 implies IRIX 6.2 */
#ifndef BSD44ORPOSIX
#define BSD44ORPOSIX /* for ckutio's benefit */
#endif /* BSD44ORPOSIX */
#ifndef IRIX62
#define IRIX62
#endif /* IRIX62 */
#endif /* IRIX64 */
#ifdef IRIX62 /* IRIX 6.2 implies IRIX 6.0 */
#ifndef IRIX60
#define IRIX60
#endif /* IRIX60 */
#endif /* IRIX62 */
#ifdef IRIX60 /* IRIX 6.0 implies IRIX 5.1 */
#ifndef IRIX51
#define IRIX51
#endif /* IRIX51 */
#ifndef IRIX52 /* And IRIX 5.2 (for hwfc) */
#define IRIX52
#endif /* IRIX52 */
#endif /* IRIX60 */
#ifndef IRIX /* IRIX 4.0 or greater implies IRIX */
#ifdef IRIX64
#define IRIX
#else
#ifdef IRIX62
#define IRIX
#else
#ifdef IRIX60
#define IRIX
#else
#ifdef IRIX51
#define IRIX
#else
#ifdef IRIX40
#define IRIX
#endif /* IRIX40 */
#endif /* IRIX51 */
#endif /* IRIX60 */
#endif /* IRIX62 */
#endif /* IRIX64 */
#endif /* IRIX */
#ifdef MIPS /* MIPS System V environment */
#ifndef SVR3 /* implies System V R3 or later */
#define SVR3
#endif /* SVR3 */
#endif /* MIPS */
#ifdef HPUX9 /* HP-UX 9.x */
#ifndef SVR3
#define SVR3
#endif /* SVR3 */
#ifndef HPUX
#define HPUX
#endif /* HPUX */
#ifndef HPUX9PLUS
#define HPUX9PLUS
#endif /* HPUX9PLUS */
#endif /* HPUX9 */
#ifdef HPUX10 /* HP-UX 10.x */
#ifndef HPUX1010 /* If anything higher is defined */
#ifdef HPUX1020 /* define HPUX1010 too. */
#define HPUX1010
#endif /* HPUX1020 */
#ifdef HPUX1030
#define HPUX1010
#endif /* HPUX1030 */
#endif /* HPUX1010 */
#ifdef HPUX1100 /* HP-UX 11.00 implies 10.10 */
#ifndef HPUX1010
#define HPUX1010
#endif /* HPUX1010 */
#endif /* HPUX1100 */
#ifndef SVR4
#define SVR4
#endif /* SVR4 */
#ifndef HPUX
#define HPUX
#endif /* HPUX */
#ifndef HPUX9PLUS
#define HPUX9PLUS
#endif /* HPUX9PLUS */
#endif /* HPUX10 */
#ifdef QNX /* QNX Software Systems Inc */
#ifndef POSIX /* QNX 4.0 or later is POSIX */
#define POSIX
#endif /* POSIX */
#ifndef __386__ /* Comes in 16-bit and 32-bit */
#define __16BIT__
#define CK_QNX16
#else
#define __32BIT__
#define CK_QNX32
#endif /* __386__ */
#endif /* QNX */
/*
4.4BSD is a mixture of System V R4, POSIX, and 4.3BSD.
*/
#ifdef BSD44 /* 4.4 BSD */
#ifndef SVR4 /* BSD44 implies SVR4 */
#define SVR4
#endif /* SVR4 */
#ifndef NOSETBUF /* NOSETBUF is safe */
#define NOSETBUF
#endif /* NOSETBUF */
#ifndef DIRENT /* Uses <dirent.h> */
#define DIRENT
#endif /* DIRENT */
#endif /* BSD44 */
#ifdef OPENBSD /* OpenBSD might or might not */
#ifndef __OpenBSD__ /* have this defined... */
#define __OpenBSD__
#endif /* __OpenBSD__ */
#endif /* OPENBSD */
#ifdef SVR3 /* SVR3 implies ATTSV */
#ifndef ATTSV
#define ATTSV
#endif /* ATTSV */
#endif /* SVR3 */
#ifdef SVR4 /* SVR4 implies ATTSV */
#ifndef ATTSV
#define ATTSV
#endif /* ATTSV */
#ifndef SVR3 /* ...as well as SVR3 */
#define SVR3
#endif /* SVR3 */
#endif /* SVR4 */
#ifdef OXOS
#ifndef ATTSV
#define ATTSV /* OXOS implies ATTSV */
#endif /* ! ATTSV */
#define SW_ACC_ID /* access() wants privs on */
#define kill priv_kill /* kill() wants privs on */
#ifndef NOSETBUF
#define NOSETBUF /* NOSETBUF is safe */
#endif /* ! NOSETBUF */
#endif /* OXOS */
#ifdef UTSV /* UTSV implies ATTSV */
#ifndef ATTSV
#define ATTSV
#endif /* ATTSV */
#endif /* UTSV */
#ifdef XENIX /* XENIX implies ATTSV */
#ifndef ATTSV
#define ATTSV
#endif /* ATTSV */
#endif /* XENIX */
#ifdef AUX /* AUX implies ATTSV */
#ifndef ATTSV
#define ATTSV
#endif /* ATTSV */
#endif /* AUX */
#ifdef ATT7300 /* ATT7300 implies ATTSV */
#ifndef ATTSV
#define ATTSV
#endif /* ATTSV */
#endif /* ATT7300 */
#ifdef ATT6300 /* ATT6300 implies ATTSV */
#ifndef ATTSV
#define ATTSV
#endif /* ATTSV */
#endif /* ATT6300 */
#ifdef HPUX /* HPUX implies ATTSV */
#ifndef ATTSV
#define ATTSV
#endif /* ATTSV */
#endif /* HPUX */
#ifdef ISIII /* ISIII implies ATTSV */
#ifndef ATTSV
#define ATTSV
#endif /* ATTSV */
#endif /* ISIII */
#ifdef NEXT33 /* NEXT33 implies NEXT */
#ifndef NEXT
#define NEXT
#endif /* NEXT */
#endif /* NEXT33 */
#ifdef NEXT /* NEXT implies BSD4 */
#ifndef BSD4
#define BSD4
#endif /* BSD4 */
#endif /* NEXT */
#ifdef BSD41 /* BSD41 implies BSD4 */
#ifndef BSD4
#define BSD4
#endif /* BSD4 */
#endif /* BSD41 */
#ifdef BSD43 /* BSD43 implies BSD4 */
#ifndef BSD4
#define BSD4
#endif /* BSD4 */
#endif /* BSD43 */
#ifdef BSD4 /* BSD4 implies ANYBSD */
#ifndef ANYBSD
#define ANYBSD
#endif /* ANYBSD */
#endif /* BSD4 */
#ifdef BSD29 /* BSD29 implies ANYBSD */
#ifndef ANYBSD
#define ANYBSD
#endif /* ANYBSD */
#endif /* BSD29 */
#ifdef ATTSV /* ATTSV implies UNIX */
#ifndef UNIX
#define UNIX
#endif /* UNIX */
#endif /* ATTSV */
#ifdef ANYBSD /* ANYBSD implies UNIX */
#ifndef UNIX
#define UNIX
#endif /* UNIX */
#endif /* ANYBSD */
#ifdef POSIX /* POSIX implies UNIX */
#ifndef UNIX
#define UNIX
#endif /* UNIX */
#ifndef DIRENT /* and DIRENT, i.e. <dirent.h> */
#ifndef SDIRENT
#define DIRENT
#endif /* SDIRENT */
#endif /* DIRENT */
#ifndef NOFILEH /* POSIX doesn't use <sys/file.h> */
#define NOFILEH
#endif /* NOFILEH */
#endif /* POSIX */
#ifdef V7
#ifndef UNIX
#define UNIX
#endif /* UNIX */
#endif /* V7 */
#ifdef COHERENT
#ifndef UNIX
#define UNIX
#endif /* UNIX */
#ifdef COMMENT
#ifndef NOCURSES
#define NOCURSES
#endif /* NOCURSES */
#endif /* COMMENT */
#endif /* COHERENT */
#ifdef MINIX
#ifndef UNIX
#define UNIX
#endif /* UNIX */
#endif /* MINIX */
/*
The symbol SVORPOSIX is defined for both AT&T and POSIX compilations
to make it easier to select items that System V and POSIX have in common,
but which BSD, V7, etc, do not have.
*/
#ifdef ATTSV
#ifndef SVORPOSIX
#define SVORPOSIX
#endif /* SVORPOSIX */
#endif /* ATTSV */
#ifdef POSIX
#ifndef SVORPOSIX
#define SVORPOSIX
#endif /* SVORPOSIX */
#endif /* POSIX */
/*
The symbol SVR4ORPOSIX is defined for both AT&T System V R4 and POSIX
compilations to make it easier to select items that System V R4 and POSIX
have in common, but which BSD, V7, and System V R3 and earlier, etc, do
not have.
*/
#ifdef POSIX
#ifndef SVR4ORPOSIX
#define SVR4ORPOSIX
#endif /* SVR4ORPOSIX */
#endif /* POSIX */
#ifdef SVR4
#ifndef SVR4ORPOSIX
#define SVR4ORPOSIX
#endif /* SVR4ORPOSIX */
#endif /* SVR4 */
/*
The symbol BSD44ORPOSIX is defined for both 4.4BSD and POSIX compilations
to make it easier to select items that 4.4BSD and POSIX have in common,
but which System V, BSD, V7, etc, do not have.
*/
#ifdef BSD44
#ifndef BSD44ORPOSIX
#define BSD44ORPOSIX
#endif /* BSD44ORPOSIX */
#endif /* BSD44 */
#ifdef POSIX
#ifndef BSD44ORPOSIX
#define BSD44ORPOSIX
#endif /* BSD44ORPOSIX */
#endif /* POSIX */
#ifdef UNIX /* For items common to OS/2 and UNIX */
#ifndef OS2ORUNIX
#define OS2ORUNIX
#endif /* OS2ORUNIX */
#endif /* UNIX */
#ifdef UNIX /* For items common to VMS and UNIX */
#define VMSORUNIX
#else
#ifdef VMS
#define VMSORUNIX
#ifndef OS2ORVMS
#define OS2ORVMS
#endif /* OS2ORVMS */
#endif /* VMS */
#endif /* UNIX */
#ifndef UNIXOROSK /* UNIX or OS-9 (or OS-9000) */
#ifdef UNIX
#define UNIXOROSK
#else
#ifdef OSK
#define UNIXOROSK
#endif /* OSK */
#endif /* UNIX */
#endif /* UNIXOROSK */
#ifndef OSKORUNIX
#ifdef UNIXOROSK
#define OSKORUNIX
#endif /* UNIXOROSK */
#endif /* OSKORUNIX */
#ifdef OS2
#define CK_ANSIC /* OS/2 supports ANSIC and more extensions */
#endif /* OS2 */
#ifdef OSF50 /* Newer OSF/1 versions imply older ones */
#ifndef OSF40
#define OSF40
#endif /* OSF40 */
#endif /* OSF50 */
#ifdef OSF40
#ifndef OSF32
#define OSF32
#endif /* OSF32 */
#endif /* OSF40 */
#ifdef OSF32
#ifndef OSF30
#define OSF30
#endif /* OSF30 */
#endif /* OSF32 */
#ifdef OSF30
#ifndef OSF20
#define OSF20
#endif /* OSF20 */
#endif /* OSF30 */
#ifdef OSF20
#ifndef OSF10
#define OSF10
#endif /* OSF10 */
#endif /* OSF20 */
#ifdef __DECC /* For DEC Alpha VMS or OSF/1 */
#ifndef CK_ANSIC
#define CK_ANSIC /* Even with /stand=vaxc, need ansi */
#endif /* CKANSIC */
#ifndef SIG_V
#define SIG_V /* and signal type is VOID */
#endif /* SIG_V */
#ifndef CK_ANSILIBS
#define CK_ANSILIBS /* (Martin Zinser, Feb 1995) */
#endif /* CK_ANSILIBS */
#ifndef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 1
#endif /* _POSIX_C_SOURCE */
#endif /* __DECC */
#ifdef VMS
#ifdef __ia64 /* VMS on Itanium */
#ifndef VMSI64
#define VMSI64
#endif /* VMSI64 */
#endif /* __ia64 */
#ifndef VMS64BIT /* 64-bit VMS on Itanium or Alpha */
#ifdef __ia64
#define VMS64BIT
#else
#ifdef __ALPHA
#define VMS64BIT
#endif /* __ia64 */
#endif /* __ALPHA */
#endif /* VMS64BIT */
#endif /* VMS */
#ifdef apollo /* May be ANSI-C, check further */
#ifdef __STDCPP__
#define CK_ANSIC /* Yes, this is real ANSI-C */
#define SIG_V
#else
#define NOANSI /* Nope, not ANSI */
#undef __STDC__ /* Even though it say it is! */
#define SIG_I
#endif /* __STDCPP__ */
#endif /* apollo */
#ifdef POSIX /* -DPOSIX on cc command line */
#ifndef _POSIX_SOURCE /* Implies _POSIX_SOURCE */
#define _POSIX_SOURCE
#endif /* _POSIX_SOURCE */
#endif /* POSIX */
/*
ANSI C? That is, do we have function prototypes, new-style
function declarations, and parameter type checking and coercion?
*/
#ifdef MAC /* MPW C is ANSI */
#ifndef NOANSI
#ifndef CK_ANSIC
#define CK_ANSIC
#endif /* CK_ANSIC */
#endif /* NOANSI */
#endif /* MAC */
#ifdef STRATUS /* Stratus VOS */
#ifndef CK_ANSIC
#define CK_ANSIC
#endif /* CK_ANSIC */
#ifndef NOSTAT
#define NOSTAT
#endif /* NOSTAT */
#endif /* STRATUS */
#ifndef NOANSI
#ifdef __STDC__ /* __STDC__ means ANSI C */
#ifndef CK_ANSIC
#define CK_ANSIC
#endif /* CK_ANSIC */
#endif /* __STDC__ */
#endif /* NOANSI */
/*
_PROTOTYP() is used for forward declarations of functions so we can have
parameter and return value type checking if the compiler offers it.
__STDC__ should be defined by the compiler only if function prototypes are
allowed. Otherwise, we get old-style forward declarations. Our own private
CK_ANSIC symbol tells whether we use ANSI C prototypes. To force use of
ANSI prototypes, include -DCK_ANSIC on the cc command line. To disable the
use of ANSI prototypes, include -DNOANSI.
*/
#ifdef CK_ANSIC
#define _PROTOTYP( func, parms ) func parms
#else /* Not ANSI C */
#define _PROTOTYP( func, parms ) func()
#endif /* CK_ANSIC */
#ifndef OS2
#ifdef NOLOGIN /* NOLOGIN implies NOIKSD */
#ifndef NOIKSD
#define NOIKSD
#endif /* NOIKSD */
#endif /* NOLOGIN */
#endif /* OS2 */
#ifdef NOIKSD /* Internet Kermit Service Daemon */
#ifndef OS2
#ifndef NOPRINTFSUBST
#define NOPRINTFSUBST
#endif /* NOPRINTFSUBST */
#endif /* OS2 */
#ifndef NOLOGIN
#define NOLOGIN
#endif /* NOLOGIN */
#ifndef NOSYSLOG
#define NOSYSLOG
#endif /* NOSYSLOG */
#ifndef NOWTMP
#define NOWTMP
#endif /* NOWTMP */
#else
#ifndef IKSD
#ifdef OS2ORUNIX /* Platforms where IKSD is supported */
#define IKSD
#endif /* OS2ORUNIX */
#endif /* IKSD */
#endif /* NOIKSD */
#ifdef IKSD /* IKSD options... */
#ifndef IKSDCONF /* IKSD configuration file */
#ifdef UNIX
#define IKSDCONF "/etc/iksd.conf"
#else
#ifdef OS2
#define IKSDCONF "iksd.ksc"
#endif /* OS2 */
#endif /* UNIX */
#endif /* IKSDCONF */
#ifndef NOIKSDB
#ifndef IKSDB /* IKSD database */
#ifdef UNIX
#define IKSDB
#define IK_LCKTRIES 16 /* How many times to try to get lock */
#define IK_LCKSLEEP 1 /* How long to sleep between tries */
#define IK_LOCKFILE "iksd.lck" /* Database lockfilename */
#define IK_DBASEDIR "/var/log/" /* Database directory */
#define IK_DBASEFIL "iksd.db" /* Database filename */
#else /* UNIX */
#ifdef OS2
#define IKSDB
#ifndef NOFTRUNCATE /* ftruncate() not available */
#define NOFTRUNCATE
#endif /* NOFTRUNCATE */
#define IK_LCKTRIES 16 /* How many times to try to get lock */
#define IK_LCKSLEEP 1 /* How long to sleep between tries */
#define IK_LOCKFILE "iksd.lck" /* DB lockfilename (in systemroot) */
#define IK_DBASEFIL "iksd.db" /* Database filename */
#endif /* OS2 */
#endif /* UNIX */
#endif /* IKSDB */
#endif /* NOIKSDB */
#endif /* IKSD */
/*
Substitutes for printf() and friends used in IKS to compensate for
lack of a terminal driver, mainly to supply CR after LF.
*/
#ifndef NOPRINTFSUBST
#ifdef MAC
/*
* The MAC doesn't use standard stdio routines.
*/
#undef getchar
#define getchar() mac_getchar()
#undef putchar
#define putchar(c) mac_putchar(c)
#define printf mac_printf
#define perror mac_perror
#define puts mac_puts
extern int mac_putchar (int c);
extern int mac_puts (const char *string);
extern int mac_printf(const char *, ...);
extern int mac_getchar (void);
#endif /* MAC */
#ifdef OS2
#define printf Vscrnprintf
#define fprintf Vscrnfprintf
extern int Vscrnprintf(const char *, ...);
extern int Vscrnprintw(const char *, ...);
extern int Vscrnfprintf(FILE *, const char *, ...);
#ifdef putchar
#undef putchar
#endif /* putchar */
#define putchar(x) Vscrnprintf("%c",x)
#define perror(x) Vscrnperror(x)
#endif /* OS2 */
#ifndef CKWART_C
#ifdef UNIX
#ifndef pdp11
#ifndef CKXPRINTF
#define CKXPRINTF
#endif /* CKXPRINTF */
#endif /* pdp11 */
#endif /* UNIX */
#endif /* CKWART_C */
#endif /* NOPRINTFSUBST */
#ifdef CKXPRINTF
#define printf ckxprintf
#define fprintf ckxfprintf
#ifdef CK_ANSIC
_PROTOTYP(int ckxprintf,(const char *, ...));
#ifdef NEXT
_PROTOTYP(void ckxperror,(const char *));
#else
#ifdef CK_SCOV5
_PROTOTYP(void ckxperror,(const char *));
#else
_PROTOTYP(int ckxperror,(const char *));
#endif /* CK_SCOV5 */
#endif /* NEXT */
_PROTOTYP(int ckxfprintf,(FILE *, const char *, ...));
#endif /* CK_ANSIC */
#ifdef putchar
#undef putchar
#endif /* putchar */
#define putchar(x) ckxprintf("%c",x)
#ifdef putc
#undef putc
#endif /* putc */
#define putc(a,b) ckxfprintf(b,"%c",a)
#define perror(x) ckxperror(x)
#endif /* CKXPRINTF */
/*
Altos-specific items: 486, 586, 986 models...
*/
#ifdef A986
#define M_VOID
#define void int
#define CHAR char
#define SIG_I
#endif /* A986 */
/* Signal handling */
#ifdef QNX
#ifndef CK_POSIX_SIG
#define CK_POSIX_SIG
#endif /* CK_POSIX_SIG */
#endif /* QNX */
/*
void type, normally available only in ANSI compilers.
The HP-UX exception (for its "bundled" non-ANSI C compiler)
is known to be valid back to HP-UX 6.5.
Adjustments might be needed for earlier HP-UX versions.
*/
#ifndef VOID /* Used throughout all C-Kermit */
#ifdef CK_ANSIC /* modules... */
#define VOID void
#else
#ifdef HPUX
#define VOID void
#else
#define VOID int
#endif /* HPUX */
#endif /* CK_ANSIC */
#endif /* VOID */
/*
Exactly the same as VOID but for use in contexts where the VOID symbol
conflicts some header-file definition. This is needed for the section
of ckuusx.c that provides C-Kermit's curses interface, roughly the
second half of ckuusx.c.
*/
#ifndef CKVOID
#ifdef CK_ANSIC
#define CKVOID void
#else
#ifdef HPUX
#define CKVOID void
#else
#define CKVOID int
#endif /* HPUX */
#endif /* CK_ANSIC */
#endif /* CKVOID */
/* Const type */
#ifndef CONST
#ifdef OSK
#ifdef _UCC
#define CONST const
#else
#define CONST
#endif /* _UCC */
#else /* !OSK */
#ifdef CK_SCO32V4
#define CONST
#else
#ifdef CK_ANSIC
#define CONST const
#else
#define CONST
#endif /* CK_ANSIC */
#endif /* CK_SCO32V4 */
#endif /* OSK */
#endif /* CONST */
/* Signal type */
#ifndef SIG_V /* signal() type, if not def'd yet */
#ifndef SIG_I
#ifdef OS2
#define SIG_V
#else
#ifdef POSIX
#define SIG_V
#else
#ifdef SVR3 /* System V R3 and later */
#define SIG_V
#else
#ifdef SUNOS4 /* SUNOS V 4.0 and later */
#ifndef sun386
#define SIG_V
#else
#define SIG_I
#endif /* sun386 */
#else
#ifdef NEXT /* NeXT */
#define SIG_V
#else
#ifdef AIX370
#include <signal.h>
#define SIG_V
#define SIGTYP __SIGVOID /* AIX370 */
#else
#ifdef STRATUS /* Stratus VOS */
#define SIG_V
#else
#ifdef MAC
#define SIGTYP long
#define SIG_I
#ifndef MPW33
#define SIG_IGN 0
#endif /* MPW33 */
#define SIGALRM 1
#ifndef MPW33
#define SIGINT 2
#endif /* MPW33 */
#else /* Everything else */
#define SIG_I
#endif /* MAC */
#endif /* STRATUS */
#endif /* AIX370 */
#endif /* NEXT */
#endif /* SUNOS4 */
#endif /* SVR3 */
#endif /* POSIX */
#endif /* OS2 */
#endif /* SIG_I */
#endif /* SIG_V */
#ifdef SIG_I
#define SIGRETURN return(0)
#ifndef SIGTYP
#define SIGTYP int
#endif /* SIGTYP */
#endif /* SIG_I */
#ifdef SIG_V
#define SIGRETURN return
#ifndef SIGTYP
#define SIGTYP void
#endif /* SIGTYP */
#endif /* SIG_V */
#ifdef NT
#ifndef SIGTYP
#define SIGTYP void
#endif /* SIGTYP */
#endif /* NT */
#ifndef SIGTYP
#define SIGTYP int
#endif /* SIGTYP */
#ifndef SIGRETURN
#define SIGRETURN return(0)
#endif /* SIGRETURN */
#ifdef CKNTSIG
/* This does not work, so don't use it. */
#define signal ckntsignal
SIGTYP (*ckntsignal(int type, SIGTYP (*)(int)))(int);
#endif /* CKNTSIG */
/* We want all characters to be unsigned if the compiler supports it */
#ifdef KUI
#ifdef CHAR
#undef CHAR
#endif /* CHAR */
#define CHAR unsigned char
#else
#ifdef PROVX1
typedef char CHAR;
/* typedef long LONG; */
typedef int void;
#else
#ifdef MINIX
typedef unsigned char CHAR;
#else
#ifdef V7
typedef char CHAR;
#else
#ifdef C70
typedef char CHAR;
/* typedef long LONG; */
#else
#ifdef BSD29
typedef char CHAR;
/* typedef long LONG; */
#else
#ifdef datageneral
#define CHAR unsigned char /* 3.22 compiler */
#else
#ifdef HPUX
#define CHAR unsigned char
#else
#ifdef OS2
#ifdef NT
#define CHAR unsigned char
#else /* NT */
#ifdef CHAR
#undef CHAR
#endif /* CHAR */
typedef unsigned char CHAR;
#endif /* NT */
#else /* OS2 */
#ifdef VMS
typedef unsigned char CHAR;
#else
#ifdef CHAR
#undef CHAR
#endif /* CHAR */
typedef unsigned char CHAR;
#endif /* VMS */
#endif /* OS2 */
#endif /* HPUX */
#endif /* datageneral */
#endif /* BSD29 */
#endif /* C70 */
#endif /* V7 */
#endif /* MINIX */
#endif /* PROVX1 */
#endif /* KUI */
union ck_short { /* Mainly for Unicode */
USHORT x_short;
CHAR x_char[2];
};
#ifdef MAC /* Macintosh file routines */
#ifndef CKWART_C /* But not in "wart"... */
#ifdef feof
#undef feof
#endif /* feof */
#define feof mac_feof
#define rewind mac_rewind
#define fgets mac_fgets
#define fopen mac_fopen
#define fclose mac_fclose
int mac_feof();
void mac_rewind();
char *mac_fgets();
FILE *mac_fopen();
int mac_fclose();
#endif /* CKCPRO_W */
#endif /* MAC */
/*
Systems whose mainline modules have access to the communication-line
file descriptor, ttyfd.
*/
#ifndef CK_TTYFD
#ifdef UNIX
#define CK_TTYFD
#else
#ifdef OS2
#define CK_TTYFD
#else
#ifdef VMS
#define CK_TTYFD
#endif /* VMS */
#endif /* OS2 */
#endif /* UNIX */
#endif /* CK_TTYFD */
/* Systems where we can get our own process ID */
#ifndef CK_PID
#ifdef UNIX
#define CK_PID
#endif /* UNIX */
#ifdef OS2
#define CK_PID
#endif /* OS2 */
#ifdef VMS
#define CK_PID
#endif /* VMS */
#endif /* CK_PID */
/* Systems that support the Microsoft Telephony API (TAPI) */
#ifndef NODIAL
#ifndef CK_TAPI
#ifdef NT
#define CK_TAPI
#endif /* NT */
#endif /* CK_TAPI */
#endif /* NODIAL */
#ifndef NONZXPAND
#ifndef NZXPAND
#ifdef OS2ORUNIX
#define NZXPAND
#else
#ifdef VMS
#define NZXPAND
#else
#ifdef datageneral
#define NZXPAND
#else
#ifdef OSK
#define NZXPAND
#endif /* OSK */
#endif /* datageneral */
#endif /* VMS */
#endif /* OS2ORUNIX */
#endif /* NZXPAND */
#else
#ifdef NZXPAND
#undef NZXPAND
#endif /* NZXPAND */
#endif /* NONZXPAND */
/* nzxpand() option flags */
#define ZX_FILONLY 1 /* Match only regular files */
#define ZX_DIRONLY 2 /* Match only directories */
#define ZX_RECURSE 4 /* Descend through directory tree */
#define ZX_MATCHDOT 8 /* Match "dot files" */
#define ZX_NOBACKUP 16 /* Don't match "backup files" */
#define ZX_NOLINKS 32 /* Don't follow symlinks */
#ifndef NZXPAND
#define nzxpand(a,b) zxpand(a)
#endif /* NZXPAND */
#ifndef NOZXREWIND
#ifndef ZXREWIND /* Platforms that have zxrewind() */
#ifdef OS2ORUNIX
#define ZXREWIND
#else
#ifdef VMS
#define ZXREWIND
#else
#ifdef datageneral
#define ZXREWIND
#else
#ifdef OSK
#define ZXREWIND
#else
#ifdef STRATUS
#define ZXREWIND
#endif /* STRATUS */
#endif /* OSK */
#endif /* datageneral */
#endif /* VMS */
#endif /* OS2ORUNIX */
#endif /* ZXREWIND */
#else
#ifdef ZXREWIND
#undef ZXREWIND
#endif /* ZXREWIND */
#endif /* NOZXREWIND */
/* Temporary-directory-for-RECEIVE feature ... */
/* This says whether we have the isdir() function defined. */
#ifdef UNIX /* UNIX has it */
#ifndef CK_TMPDIR
#ifndef pdp11
#define CK_TMPDIR
#define TMPDIRLEN 256
#endif /* pdp11 */
#endif /* CK_TMPDIR */
#endif /* UNIX */
#ifdef VMS /* VMS too */
#ifndef CK_TMPDIR
#define CK_TMPDIR
#define TMPDIRLEN 256
#endif /* CK_TMPDIR */
#endif /* VMS */
#ifdef OS2 /* OS two too */
#ifndef CK_TMPDIR
#define CK_TMPDIR
#define TMPDIRLEN 129
#endif /* CK_TMPDIR */
#endif /* OS2 */
#ifdef STRATUS /* Stratus VOS too. */
#ifndef CK_TMPDIR
#define CK_TMPDIR
#define TMPDIRLEN 256
#endif /* CK_TMPDIR */
#endif /* STRATUS */
#ifdef OSK /* OS-9 too */
#ifndef CK_TMPDIR
#define CK_TMPDIR
#define TMPDIRLEN 256
#endif /* CK_TMPDIR */
#endif /* OSK */
#ifdef datageneral /* AOS/VS too */
#ifndef CK_TMPDIR
#define CK_TMPDIR
#define TMPDIRLEN 256
#endif /* CK_TMPDIR */
#endif /* datageneral */
#ifdef CK_TMPDIR /* Needs command parser */
#ifdef NOICP
#undef CK_TMPDIR
#endif /* NOICP */
#endif /* CK_TMPDIR */
/* Whether to include <time.h> or <sys/time.h> */
#ifndef NOTIMEH /* <time.h> */
#ifndef TIMEH
#define TIMEH
#endif /* TIMEH */
#endif /* NOTIMEH */
#ifndef NOSYSTIMEH /* <sys/time.h> */
#ifndef SYSTIMEH
#ifdef UNIX /* UNIX */
#ifdef SVORPOSIX /* System V or POSIX... */
#ifdef M_UNIX
#define SYSTIMEH
#else
#ifdef SCO_32V4
#define SYSTIMEH
#else
#ifdef OXOS
#define SYSTIMEH
#else
#ifdef BSD44
#define SYSTIMEH
#else
#ifdef __linux__
#define SYSTIMEH
#else
#ifdef AIXRS
#ifndef AIX41
#define SYSTIMEH
#endif /* AIX41 */
#else
#ifdef IRIX60
#define SYSTIMEH
#else
#ifdef I386IX
#define SYSTIMEH
#else
#ifdef SV68R3V6
#define SYSTIMEH
#endif /* SV68R3V6 */
#endif /* I386IX */
#endif /* IRIX60 */
#endif /* AIXRS */
#endif /* __linux__ */
#endif /* BSD44 */
#endif /* OXOS */
#endif /* SCO_32V4 */
#endif /* M_UNIX */
#else /* Not SVORPOSIX */
#ifndef BELLV10 /* All but these... */
#ifndef PROVX1
#ifndef V7
#ifndef BSD41
#ifndef COHERENT
#define SYSTIMEH
#endif /* COHERENT */
#endif /* BSD41 */
#endif /* V7 */
#endif /* PROVX1 */
#endif /* BELLV10 */
#endif /* SVORPOSIX */
#endif /* UNIX */
#endif /* SYSTIMEH */
#endif /* NOSYSTIMEH */
#ifndef NOSYSTIMEBH /* <sys/timeb.h> */
#ifndef SYSTIMEBH
#ifdef OSF
#define SYSTIMEBH
#else
#ifdef COHERENT
#define SYSTIMEBH
#else
#ifdef BSD41
#define SYSTIMEBH
#else
#ifdef BSD29
#define SYSTIMEBH
#else
#ifdef TOWER1
#define SYSTIMEBH
#else
#ifdef FT21
#define SYSTIMEBH
#else
#ifdef BELLV10
#define SYSTIMEBH
#endif /* BELLV10 */
#endif /* FT21 */
#endif /* TOWER1 */
#endif /* BSD29 */
#endif /* BSD41 */
#endif /* COHERENT */
#endif /* OSF */
#endif /* SYSTIMEBH */
#endif /* NOSYSTIMEBH */
/*
Debug and transaction logging is included automatically unless you define
NODEBUG or NOTLOG. Do this if you want to save the space and overhead.
(Note, in version 4F these definitions changed from "{}" to the null string
to avoid problems with semicolons after braces, as in: "if (x) tlog(this);
else tlog(that);"
*/
#ifndef NODEBUG
#ifndef DEBUG
#define DEBUG
#endif /* DEBUG */
#else
#ifdef DEBUG
#undef DEBUG
#endif /* DEBUG */
#endif /* NODEBUG */
#ifdef NOTLOG
#ifdef TLOG
#undef TLOG
#endif /* TLOG */
#else /* NOTLOG */
#ifndef TLOG
#define TLOG
#endif /* TLOG */
#endif /* NOTLOG */
/* debug() macro style selection. */
#ifdef VMS
#ifndef IFDEBUG
#define IFDEBUG
#endif /* IFDEBUG */
#endif /* VMS */
#ifdef MAC
#ifndef IFDEBUG
#define IFDEBUG
#endif /* IFDEBUG */
#endif /* MAC */
#ifdef OS2
#ifndef IFDEBUG
#define IFDEBUG
#endif /* IFDEBUG */
#endif /* OS2 */
#ifdef OXOS /* tst is faster than jsr */
#ifndef IFDEBUG
#define IFDEBUG
#endif /* IFDEBUG */
#endif /* OXOS */
#ifndef CKCMAI
extern int deblog;
extern int debok;
extern int debxlen;
extern int matchdot;
extern int tt_bell;
#endif /* CKCMAI */
#ifdef OS2
_PROTOTYP( void bleep, (short) );
#else /* OS2 */
#define bleep(x) if(tt_bell)putchar('\07')
#endif /* OS2 */
#ifndef BEOSORBEBOX
#ifdef BEBOX /* This was used only for DR7 */
#define BEOSORBEBOX
#else
#ifdef BEOS /* This is used for BeOS 4.x */
#define BEOSORBEBOX
#endif /* BEOS */
#endif /* BEBOX */
#endif /* BEOSORBEBOX */
#ifdef NOICP
#ifdef TLOG
#undef TLOG
#endif /* TLOG */
#endif /* NOICP */
/* Formats for debug() and tlog() */
#define F000 0
#define F001 1
#define F010 2
#define F011 3
#define F100 4
#define F101 5
#define F110 6
#define F111 7
#ifdef __linux__
#ifndef LINUX
#define LINUX
#endif /* LINUX */
#ifdef __ANDROID__
#ifndef ANDROID
#define ANDROID
#endif /* ANDROID */
#endif /* __ANDROID__ */
#endif /* __linux__ */
/* Platforms where small size is needed */
#ifdef pdp11
#define CK_SMALL
#endif /* pdp11 */
/* Can we use realpath()? */
#ifndef NOREALPATH
#ifdef pdp11
#define NOREALPATH
#endif /* pdp11 */
#endif /* NOREALPATH */
#ifndef NOREALPATH
#ifdef UNIX
#ifdef HPUX5
#define NOREALPATH
#else
#ifdef HPUX6
#define NOREALPATH
#else
#ifdef HPUX7
#define NOREALPATH
#else
#ifdef HPUX8
#define NOREALPATH
#else
#ifdef SV68R3V6
#define NOREALPATH
#else
#ifdef XENIX
#define NOREALPATH
#else
#ifdef CK_SCO32V4
#define NOREALPATH
#else
#ifdef CK_SCOV5
#define NOREALPATH
#else
#ifdef OSF32
#define NOREALPATH
#else
#ifdef OSF30
#define NOREALPATH
#else
#ifdef ultrix
#define NOREALPATH
#else
#ifdef COHERENT
#define NOREALPATH
#endif /* COHERENT */
#endif /* ultrix */
#endif /* OSF30 */
#endif /* OSF32 */
#endif /* CK_SCOV5 */
#endif /* CK_SCO32V4 */
#endif /* XENIX */
#endif /* SV68R3V6 */
#endif /* HPUX8 */
#endif /* HPUX7 */
#endif /* HPUX6 */
#endif /* HPUX5 */
#endif /* NOREALPATH */
#ifndef NOREALPATH
#ifndef CKREALPATH
#define CKREALPATH
#endif /* NOREALPATH */
#endif /* CKREALPATH */
#endif /* UNIX */
#ifdef CKREALPATH
#ifdef OS2ORUNIX
#ifndef CKROOT
#define CKROOT
#endif /* CKROOT */
#endif /* OS2ORUNIX */
#endif /* CKREALPATH */
/* CKSYMLINK should be set only if we can use readlink() */
#ifdef UNIX
#ifndef NOSYMLINK
#ifndef CKSYMLINK
#define CKSYMLINK
#endif /* NOSYMLINK */
#endif /* CKSYMLINK */
#endif /* UNIX */
/* Platforms where we can use lstat() instead of stat() (for symlinks) */
/* This should be set only if both lstat() and readlink() are available */
#ifndef NOLSTAT
#ifndef NOSYMLINK
#ifndef USE_LSTAT
#ifdef UNIX
#ifdef CKSYMLINK
#ifdef SVR4 /* SVR4 has lstat() */
#define USE_LSTAT
#else
#ifdef BSD42 /* 4.2BSD and 4.3BSD have it */
#define USE_LSTAT /* This should include old HPUXs */
#else
#ifdef BSD44 /* 4.4BSD has it */
#define USE_LSTAT
#else
#ifdef LINUX /* LINUX has it */
#define USE_LSTAT
#else
#ifdef SUNOS4 /* SunOS has it */
#define USE_LSTAT
#endif /* SUNOS4 */
#endif /* LINUX */
#endif /* BSD44 */
#endif /* BSD42 */
#endif /* SVR4 */
#endif /* CKSYMLINK */
#endif /* UNIX */
#endif /* USE_LSTAT */
#endif /* NOSYMLINK */
#endif /* NOLSTAT */
#ifdef NOLSTAT
#ifdef USE_LSTAT
#undef USE_LSTAT
#endif /* USE_LSTAT */
#endif /* NOLSTAT */
#ifndef NOTTYLOCK /* UNIX systems that have ttylock() */
#ifndef USETTYLOCK
#ifdef AIXRS /* AIX 3.1 and later */
#define USETTYLOCK
#else
#ifdef USE_UU_LOCK /* FreeBSD or other with uu_lock() */
#define USETTYLOCK
#else
/*
Prior to 8.0.299 Alpha.08 this was HAVE_BAUDBOY which was added for
Red Hat 7.2 in May 2003 but which is no longer supported in Debian and
OpenSuse (at least).
*/
#ifdef HAVE_LOCKDEV
#define USETTYLOCK
#endif /* HAVE_LOCKDEV */
#endif /* USE_UU_LOCK */
#endif /* AIXRS */
#endif /* USETTYLOCK */
#endif /* NOTTYLOCK */
/* This could become more inclusive.. Solaris 10, HP-UX 11, AIX 5.3... */
#ifndef HAVE_SNPRINTF /* Safe to use snprintf() */
#ifdef HAVE_OPENPTY
#define HAVE_SNPRINTF
#endif /* HAVE_OPENPTY */
#endif /* HAVE_SNPRINTF */
/* Kermit feature selection */
#ifndef NOSPL
#ifndef NOCHANNELIO /* Channel-based file i/o package */
#ifndef CKCHANNELIO
#ifdef UNIX
#define CKCHANNELIO
#else
#ifdef OS2
#define CKCHANNELIO
#else
#ifdef VMS
#define CKCHANNELIO
#else
#ifdef STRATUS
#define CKCHANNELIO
#endif /* STRATUS */
#endif /* VMS */
#endif /* OS2 */
#endif /* UNIX */
#endif /* CKCHANNELIO */
#endif /* NOCHANNELIO */
#endif /* NOSPL */
#ifndef NOCKEXEC /* EXEC command */
#ifndef NOPUSH
#ifndef CKEXEC
#ifdef UNIX /* UNIX can do it */
#define CKEXEC
#endif /* UNIX */
#endif /* CKEXEC */
#endif /* NOPUSH */
#endif /* NOCKEXEC */
#ifndef NOFAST /* Fast Kermit protocol by default */
#ifndef CK_FAST
#ifdef UNIX
#define CK_FAST
#else
#ifdef VMS
#define CK_FAST
#else
#ifdef OS2
#define CK_FAST
#endif /* OS2 */
#endif /* VMS */
#endif /* UNIX */
#endif /* CK_FAST */
#endif /* NOFAST */
#ifdef UNIX /* Transparent print */
#ifndef NOXPRINT
#ifndef XPRINT
#define XPRINT
#endif /* XPRINT */
#endif /* NOXPRINT */
#endif /* UNIX */
#ifndef NOHWPARITY /* Hardware parity */
#ifndef HWPARITY
#ifdef SVORPOSIX /* System V or POSIX can have it */
#define HWPARITY
#else
#ifdef SUNOS41 /* SunOS 4.1 can have it */
#define HWPARITY
#else
#ifdef OS2 /* K95 can have it */
#define HWPARITY
#endif /* OS2 */
#endif /* SUNOS41 */
#endif /* SVORPOSIX */
#endif /* HWPARITY */
#endif /* NOHWPARITY */
#ifndef NOSTOPBITS /* Stop-bit selection */
#ifndef STOPBITS
#ifdef OS2ORUNIX
/* In Unix really this should only be if CSTOPB is defined. */
/* But we don't know that yet. */
#define STOPBITS
#else
#ifdef TN_COMPORT
#define STOPBITS
#endif /* TN_COMPORT */
#endif /* OS2ORUNIX */
#endif /* STOPBITS */
#endif /* NOSTOPBITS */
#ifdef UNIX
#ifndef NETCMD /* Can SET NETWORK TYPE COMMAND */
#define NETCMD
#endif /* NETCMD */
#endif /* UNIX */
/* Pty support, nonportable, available on a case-by-case basis */
#ifndef NOPTY
#ifdef NEXT /* NeXTSTEP (tested on 3.1)*/
#define NETPTY
#else
#ifdef CK_SCOV5 /* SCO OSR5 (tested on 5.0.5)*/
#define NETPTY
#else
#ifdef QNX /* QNX (tested on 4.25) */
#define NETPTY
#else
#ifdef SINIX /* Sinix (tested on 5.42) */
#define NETPTY
#else
#ifdef DGUX540 /* DG/UX 5.4++ (tested on 5.4R4.11) */
#define NETPTY
#else
#ifdef OSF32 /* Digital Unix 3.2 */
#define NETPTY
#else
#ifdef OSF40 /* Digital Unix 4.0 / Tru64 */
#define NETPTY
#else
#ifdef IRIX60 /* IRIX 6.0 (not earlier) */
#define NETPTY
#else
#ifdef HPUX10 /* HPUX 10.00 or later */
#define NETPTY
#ifndef HAVE_PTYTRAP
#define HAVE_PTYTRAP
#endif /* HAVE_PTYTRAP */
#else
#ifdef HPUX9 /* HPUX 9.00 (not earlier) */
#define NETPTY
#ifndef HAVE_PTYTRAP
#define HAVE_PTYTRAP
#endif /* HAVE_PTYTRAP */
#else
#ifdef BSD44 /* BSD44, {Net,Free,Open}BSD */
#define NETPTY
#else
#ifdef BSDI /* BSDI/OS (tested in 4) */
#define NETPTY
#else
#ifdef SOLARIS /* Solaris (tested in 2.5) */
#define NETPTY
#else
#ifdef UW7 /* Unixware 7 */
#define NETPTY
#else
#ifdef SUNOS41 /* SunOS (tested in 4.1.3) */
#define NETPTY
#else
#ifdef AIX41 /* AIX 4.1 and later */
#define NETPTY
#else
#ifdef LINUX /* Linux */
#define NETPTY
#endif /* LINUX */
#endif /* AIX41 */
#endif /* SUNOS41 */
#endif /* UW7 */
#endif /* SOLARIS */
#endif /* BSDI */
#endif /* BSD44 */
#endif /* HPUX9 */
#endif /* HPUX10 */
#endif /* IRIX60 */
#endif /* OSF40 */
#endif /* OSF32 */
#endif /* DGUX540 */
#endif /* SINIX */
#endif /* QNX */
#endif /* CK_SCOV5 */
#endif /* NEXT */
#else /* NOPTY */
#ifdef NETPTY
#undef NETPTY
#endif /* NETPTY */
#endif /* NOPTY */
#ifdef NETPTY /* NETCMD required for NETPTY */
#ifndef NETCMD
#define NETCMD
#endif /* NETCMD */
#ifndef NO_OPENPTY /* Can use openpty() */
#ifndef HAVE_OPENPTY
#ifdef __linux__
#define HAVE_OPENPTY
#else
#ifdef __FreeBSD__
#define HAVE_OPENPTY
#else
#ifdef __OpenBSD__
#define HAVE_OPENPTY
#else
#ifdef __NetBSD__
#define HAVE_OPENPTY
#include <util.h>
#else
#ifdef MACOSX10
#define HAVE_OPENPTY
#endif /* MACOSX10 */
#endif /* __NetBSD__ */
#endif /* __OpenBSD__ */
#endif /* __FreeBSD__ */
#endif /* __linux__ */
#endif /* HAVE_OPENPTY */
#endif /* NO_OPENPTY */
/*
This needs to be expanded and checked.
The makefile assumes the library (at least for all linuxes)
is always libutil but I've only verified it for a few.
If a build fails because
*/
#ifdef HAVE_OPENPTY
#ifdef __linux__
#include <pty.h>
#else
#ifdef __NetBSD__
#include <util.h>
#else
#ifdef __OpenBSD__
#include <util.h>
#else
#ifdef __FreeBSD__
#include <libutil.h>
#else
#ifdef MACOSX
#include <util.h>
#else
#ifdef QNX
#include <unix.h>
#endif /* QNX */
#endif /* MACOSX */
#endif /* __FreeBSD__ */
#endif /* __OpenBSD__ */
#endif /* __NetBSD__ */
#endif /* __linux__ */
#endif /* HAVE_OPENPTY */
#endif /* NETPTY */
#ifndef CK_UTSNAME /* Can we call uname()? */
#ifdef VMS
#define CK_UTSNAME
#else
#ifdef OS2
#define CK_UTSNAME
#else
#ifdef POSIX /* It's in POSIX.1 */
#define CK_UTSNAME
#else
#ifdef SUNOS41 /* It's in SunOS 4.1 */
#define CK_UTSNAME
#else
#ifdef AIXRS /* It's in AIX */
#define CK_UTSNAME
#else
#ifdef SVR4 /* It's in SVR4 (but not SVR3) */
#define CK_UTSNAME
#else
#ifdef HPUX /* It's in HP-UX 5.00 and later */
#define CK_UTSNAME
#else
#ifdef OSF /* It's in OSF/1 / Digital UNIX */
#define CK_UTSNAME
#else
#ifdef CK_SCOV5
#define CK_UTSNAME
#endif /* CK_SCOV5 */
#endif /* OSF */
#endif /* HPUX */
#endif /* SVR4 */
#endif /* AIXRS */
#endif /* SUNOS41 */
#endif /* POSIX */
#endif /* OS2 */
#endif /* VMS */
#endif /* CK_UTSNAME */
/* This section for anything that might use floating-point */
/* If the following causes trouble use -DFLOAT=float on the command line */
#ifdef NOSPL
#ifdef FNFLOAT
#undef FNFLOAT
#endif /* FNFLOAT */
#ifdef CKFLOAT
#undef CKFLOAT
#endif /* CKFLOAT */
#endif /* NOSPL */
#ifndef NOFLOAT
#ifndef CKFLOAT
#ifdef __alpha
/* Don't use double on 64-bit platforms -- bad things happen */
#define CKFLOAT float
#define CKFLOAT_S "float"
#else
#define CKFLOAT double
#define CKFLOAT_S "double"
#endif /* __alpha */
#endif /* CKFLOAT */
#ifndef NOGFTIMER /* Floating-point timers */
#ifndef GFTIMER
#ifdef UNIX /* For UNIX */
#define GFTIMER
#endif /* UNIX */
#ifdef VMS /* VMS */
#ifndef OLD_VMS /* 5.0 and later */
#define GFTIMER
#endif /* OLD_VMS */
#endif /* VMS */
#ifdef OS2 /* And K95 */
#define GFTIMER
#endif /* OS2 */
#ifdef STRATUS /* And Stratus VOS */
#define GFTIMER
#endif /* STRATUS */
#endif /* GFTIMER */
#endif /* NOGFTIMER */
#ifndef NOSPL
#ifndef FNFLOAT /* Floating-point math functions */
#ifdef VMS /* defined by default in VMS */
#define FNFLOAT
#else
#ifdef OS2 /* and K95 */
#define FNFLOAT
#endif /* OS2 */
#endif /* VMS */
#endif /* FNFLOAT */
#endif /* NOSPL */
#else /* NOFLOAT is defined */
#ifdef CKFLOAT
#undef CKFLOAT
#endif /* CKFLOAT */
#ifdef GFTIMER
#undef GFTIMER
#endif /* GFTIMER */
#ifdef FNFLOAT
#undef FNFLOAT
#endif /* FNFLOAT */
#endif /* NOFLOAT */
#ifdef GFTIMER /* Fraction of second to use when */
#ifndef GFMINTIME /* elapsed time is <= 0 */
#define GFMINTIME 0.005
#endif /* GFMINTIME */
#endif /* GFTIMER */
#ifndef CKCMAI
extern long ztmsec, ztusec; /* Fraction of sec of current time */
#endif /* CKCMAI */
#ifndef NOUNPREFIXZERO /* Allow unprefixing of NUL (0) */
#ifndef UNPREFIXZERO /* in file-transfer packets */
#define UNPREFIXZERO
#endif /* UNPREFIXZERO */
#endif /* NOUNPREFIXZERO */
#ifdef CK_SMALL
#define NOCAL /* Calibrate */
#endif /* CK_SMALL */
#ifndef NOPATTERNS /* Filetype matching patterns */
#ifndef PATTERNS
#ifndef VMS
#ifndef CK_SMALL
#define PATTERNS
#endif /* CK_SMALL */
#endif /* VMS */
#endif /* PATTERNS */
#endif /* NOPATTERNS */
#ifndef NOCAL
#ifndef CALIBRATE
#define CALIBRATE
#endif /* CALIBRATE */
#else
#ifdef CALIBRATE
#undef CALIBRATE
#endif /* CALIBRATE */
#endif /* NOCAL */
#ifndef NORECURSE /* Recursive directory traversal */
#ifndef RECURSIVE
#ifdef VMS
#define RECURSIVE
#else
#ifdef OS2ORUNIX
#ifndef CK_SMALL
#define RECURSIVE
#endif /* CK_SMALL */
#else
#ifdef STRATUS
#define RECURSIVE
#else
#ifdef OSK
#define RECURSIVE
#endif /* OSK */
#endif /* STRATUS */
#endif /* OS2ORUNIX */
#endif /* VMS */
#endif /* RECURSIVE */
#endif /* NORECURSE */
#ifndef CK_SMALL /* Enable file-transfer tuning code */
#ifndef CKTUNING /* in which more code is added */
#ifndef NOTUNING /* to avoid function calls, etc */
#define CKTUNING
#endif /* NOTUNING */
#endif /* CKTUNING */
#endif /* CK_SMALL */
#ifndef NOURL /* Parse URLs in SET HOST, etc */
#define CK_URL
#define NO_FTP_AUTH /* No auth "ftp" / "anonymous" */
#endif /* NOURL */
#ifndef NOTRIGGER
#ifndef CK_TRIGGER /* Trigger string to exit CONNECT */
#ifdef OS2ORUNIX /* OK for UNIX and K95 */
#define CK_TRIGGER
#else
#ifdef VMS /* and VMS */
#define CK_TRIGGER
#else
#ifdef datageneral /* and AOS/VS */
#define CK_TRIGGER
#endif /* datageneral */
#endif /* OS2ORUNIX */
#endif /* VMS */
#endif /* CK_TRIGGER */
#endif /* NOTRIGGER */
#ifdef CK_TRIGGER
#define TRIGGERS 8 /* How many triggers allowed */
#endif /* CK_TRIGGER */
#ifndef XLIMITS /* CONNECT limits */
#ifdef OS2
#define XLIMITS
#endif /* OS2 */
#endif /* XLIMITS */
#ifdef NOFRILLS
#ifndef NOBROWSER
#define NOBROWSER
#endif /* NOBROWSER */
#ifndef NOFTP
#define NOFTP
#endif /* NOFTP */
#endif /* NOFRILLS */
#ifndef NOHTTP /* HTTP features need... */
#ifdef NOICP /* an interactive command parser */
#define NOHTTP
#endif /* NOICP */
#ifndef VMS
#ifndef OS2ORUNIX /* K95 or UNIX (because of */
#define NOHTTP /* time functions, time_t, etc) */
#endif /* OS2ORUNIX */
#endif /* VMS */
#endif /* NOHTTP */
#ifndef NONET
#ifdef TCPSOCKET
/* The HTTP code is not very portable, so it must be asked for with -DCKHTTP */
#ifndef NOHTTP
#ifndef CKHTTP
#ifdef SUNOS4 /* We can use it in SunOS */
#define CKHTTP
#endif /* SUNOS4 */
#ifdef SOLARIS /* And in Solaris */
#define CKHTTP
#endif /* SOLARIS */
#ifdef LINUX /* And Linux */
#define CKHTTP
#endif /* LINUX */
#ifdef HPUX10 /* And HP-UX 10 and above */
#define CKHTTP
#endif /* HPUX10 */
#ifdef OS2 /* And in K-95 */
#define CKHTTP
#endif /* OS2 */
#ifdef AIX41 /* In AIX 4.1 and higher */
#define CKHTTP
#endif /* AIX41 */
#ifdef UNIXWARE /* In Unixware 2.1 and higher */
#define CKHTTP /* and probably also in 1.x and 2.0 */
#endif /* UNIXWARE */
#ifdef CK_SCOV5
#define CKHTTP
#endif /* CK_SCOV5 */
#ifdef OSF /* And in OSF Digital UNIX/True 64 */
#define CKHTTP
#endif /* OSF */
#ifdef ultrix /* And in Ultrix Mips */
#ifdef mips
#define CKHTTP
#endif /* mips */
#endif /* ultrix */
#ifdef __NetBSD__ /* NetBSD */
#define CKHTTP
#endif /* __NetBSD__ */
#ifdef __FreeBSD__
#define CKHTTP
#endif /* __FreeBSD__ */
#ifdef __OpenBSD__
#define CKHTTP
#endif /* __OpenBSD__ */
/* Add more here... */
#endif /* CKHTTP */
#ifndef CKHTTP /* If CKHTTP not defined yet */
#define NOHTTP /* then define NOHTTP */
#endif /* CKHTTP */
#endif /* NOHTTP */
#ifdef NETCONN /* Special "network" types... */
#ifndef NOLOCAL
#ifdef OS2
#ifndef NETFILE
#define NETFILE
#endif /* NETFILE */
#ifndef NOPUSH
#ifndef NETCMD
#define NETCMD
#endif /* NETCMD */
#endif /* NOPUSH */
#ifdef NT
#ifndef NETDLL
#define NETDLL
#endif /* NETDLL */
#endif /* NT */
#endif /* OS2 */
#endif /* NOLOCAL */
#endif /* NETCONN */
#ifndef NOFTP
#ifndef SYSFTP
#ifndef NEWFTP
#ifdef OS2ORUNIX
#define NEWFTP
#endif /* OS2ORUNIX */
#endif /* NEWFTP */
#endif /* SYSFTP */
#endif /* NOFTP */
#ifndef NOFTP
#ifdef NEWFTP
#ifdef SYSFTP
#undef SYSFTP
#endif /* SYSFTP */
#else /* NEWFTP */
#ifndef SYSFTP
#define SYSFTP
#endif /* SYSFTP */
#endif /* NEWFTP */
#else /* NOFTP */
#ifdef NEWFTP
#undef NEWFTP
#endif /* NEWFTP */
#ifdef SYSFTP
#undef SYSFTP
#endif /* SYSFTP */
#endif /* NOFTP */
#ifndef NOBROWSER
#ifdef UNIX
#ifndef BROWSER
#ifndef NOPUSH
#define BROWSER
#endif /* NOPUSH */
#endif /* BROWSER */
#endif /* UNIX */
#ifdef OS2
#ifndef BROWSER
#ifndef NOPUSH
#define BROWSER
#endif /* NOPUSH */
#endif /* BROWSER */
#endif /* OS2 */
#else
#ifdef BROWSER
#undef BROWSER
#endif /* BROWSER */
#endif /* NOBROWSER */
#else /* TCPSOCKET */
#ifndef NOHTTP /* HTTP requires TCPSOCKET */
#define NOHTTP
#endif /* NOHTTP */
#endif /* TCPSOCKET */
#endif /* NONET */
#ifdef TCPSOCKET
#ifndef NOCKGETFQHOST
#ifdef __ia64__
#define NOCKGETFQHOST
#else /* __ia64__ */
#ifdef SV68
#define NOCKGETFQHOST
#else
#ifdef HPUXPRE65
#define NOCKGETFQHOST
#endif /* HPUXPRE65 */
#endif /* SV68 */
#endif /* __ia64 */
#endif /* NOCKGETFQHOST */
/*
Regarding System V/68 (SV68) (from Gerry Belanger, Oct 2002):
1) The gethostbyname() appears to return the actual host IP
address in the hostent struct, instead of the expected pointer
to the address. Hence the bogus address in the bcopy/memcopy.
This is despite the header agreeing with our expectations.
2) the expected argument swap between bcopy and memcopy
did not happen. What grief this might cause, I know not.
*/
#endif /* TCPSOCKET */
#ifdef TCPSOCKET
#ifdef OS2ONLY
#ifndef NOSOCKS
#define NOSOCKS
#endif /* NOSOCKS */
#endif /* OS2ONLY */
#ifdef NOSOCKS
#ifdef CK_SOCKS
#undef CK_SOCKS
#endif /* CK_SOCKS */
#ifdef CK_SOCKS5
#undef CK_SOCKS5
#endif /* CK_SOCKS5 */
#else /* NOSOCKS */
#ifdef NT
#ifndef CK_SOCKS
#define CK_SOCKS
#endif /* CK_SOCKS */
#endif /* NT */
#ifdef CK_SOCKS5 /* CK_SOCKS5 implies CK_SOCKS */
#ifndef CK_SOCKS
#define CK_SOCKS
#endif /* CK_SOCKS */
#endif /* CK_SOCKS5 */
#endif /* NOSOCKS */
#endif /* TCPSOCKET */
#ifdef TNCODE
#ifndef CK_AUTHENTICATION
#ifdef OS2
#ifdef _M_PPC
#define NO_KERBEROS
#define NO_SRP
#else /* _M_PPC */
#ifndef NO_SSL
#define CK_SSL
/* #define SSLDLL */ /* OpenSSL included at link time now - [jt] 2013/11/21 */
#endif /* NO_SSL */
#endif /* _M_PPC */
#ifndef NO_KERBEROS
#define CK_KERBEROS
#define KRB4
#define KRB5
#define KRB524
#define KRB524_CONV
#ifdef NT
#ifndef _M_PPC
#ifndef _M_ALPHA
#ifndef NO_SSL_KRB5
#define SSL_KRB5
#endif /* NO_SSL_KRB5 */
#endif /* _M_ALPHA */
#endif /* _M_PPC */
#endif /* NT */
#endif /* NO_KERBEROS */
#ifndef NO_SRP
#define CK_SRP
#endif /* NO_SRP */
#define CK_AUTHENTICATION
#endif /* OS2 */
#endif /* CK_AUTHENTICATION */
#ifdef CK_AUTHENTICATION /* Encryption must have Auth */
#ifndef CK_ENCRYPTION
#ifndef NO_ENCRYPTION
#ifdef OS2
#define CK_ENCRYPTION
#define CK_DES
#define CK_CAST
#endif /* OS2 */
#endif /* NO_ENCRYPTION */
#endif /* CK_ENCRYPTION */
#endif /* CK_AUTHENTICATION */
#ifdef NO_AUTHENTICATION /* Allow authentication to be */
#ifdef CK_AUTHENTICATION /* disabled in NT and OS/2 */
#undef CK_AUTHENTICATION
#endif /* CK_AUTHENTICATION */
#ifdef CK_KERBEROS
#undef CK_KERBEROS
#endif /* CK_KERBEROS */
#ifdef CK_SRP
#undef CK_SRP
#endif /* CK_SRP */
#ifdef CK_ENCRYPTION
#undef CK_ENCRYPTION
#endif /* CK_ENCRYPTION */
#endif /* NO_AUTHENTICATION */
#ifdef NO_ENCRYPTION /* Allow encryption to be */
#ifdef CK_ENCRYPTION /* disabled in NT and OS/2 */
#undef CK_ENCRYPTION
#endif /* CK_ENCRYPTION */
#endif /* NO_ENCRYPTION */
#ifdef CK_KERBEROS /* Disable funcs not yet supported with Heimdal */
#ifdef KRB5
#ifndef HEIMDAL
#define KRB5_U2U
#endif /* HEIMDAL */
#endif /* KRB5 */
#endif /* CK_KERBEROS */
/*
SSH section. NOSSH disables any form of SSH support.
If NOSSH is not defined (or implied by NONET, NOLOCAL, etc)
then SSHBUILTIN is defined for K95 and SSHCMD is defined for UNIX.
Then, if either SSHBUILTIN or SSHCMD is defined, ANYSSH is also defined.
*/
#ifndef NOSSH
#ifndef NO_SSL
#ifdef OS2ONLY
#define NOSSH
#endif /* OS2ONLY */
#ifdef NT
#ifndef CK_SSL
#define NOSSH
#endif /* CK_SSL */
#endif /* NT */
#else /* NO_SSL */
#define NOSSH
#endif /* NO_SSL */
#endif /* NOSSH */
#ifdef NOSSH /* NOSSH */
#ifdef SSHBUILTIN /* undefines any SSH selctors */
#undef SSHBUILTIN
#endif /* SSHBUILTIN */
#ifdef SFTP_BUILTIN
#undef SFTP_BUILTIN
#endif /* SFTP_BUILTIN */
#ifdef SSHCMD
#undef SSHCMD
#endif /* SSHCMD */
#ifdef ANYSSH
#undef ANYSSH
#endif /* ANYSSH */
#else /* Not NOSSH */
#ifndef NOLOCAL
#ifdef OS2
#ifndef SSHBUILTIN
#define SSHBUILTIN
#endif /* SSHBUILTIN */
#else /* Not OS2 */
#ifdef UNIX
#ifndef SSHCMD
#ifdef NETPTY
#ifndef NOPUSH
#define SSHCMD
#endif /* NOPUSH */
#endif /* NETPTY */
#endif /* SSHCMD */
#endif /* UNIX */
#endif /* OS2 */
#ifndef ANYSSH
#ifdef SSHBUILTIN
#define ANYSSH
#ifdef SSHCMD
#undef SSHCMD
#endif /* SSHCMD */
#else /* SSHBUILTIN */
#ifdef SSHCMD
#define ANYSSH
#endif /* SSHCMD */
#endif /* SSHBUILTIN */
#endif /* ANYSSH */
#endif /* NOLOCAL */
#endif /* NOSSH */
/* This is in case #ifdef SSH is used anywhere in the K95 modules */
#ifdef OS2
#ifdef SSHBUILTIN
#ifndef SSH
#define SSH
#endif /* SSH */
#endif /* SSHBUILTIN */
#endif /* OS2 */
#ifdef CK_AUTHENTICATION
#define CK_SECURITY
#else
#ifdef CK_SSL
#define CK_AUTHENTICATION
#define CK_SECURITY
#endif /* CK_SSL */
#endif /* CK_AUTHENTICATION */
/* Environment stuff */
#ifndef OS2ORUNIX
#ifndef NOPUTENV
#define NOPUTENV
#endif /* NOPUTENV */
#endif /* OS2ORUNIX */
#ifndef CK_ENVIRONMENT
#ifdef OS2
#define CK_ENVIRONMENT
#else
#ifdef UNIX
#define CK_ENVIRONMENT
#else
#ifdef STRATUS
#define CK_ENVIRONMENT
#else
#ifdef VMS
#define CK_ENVIRONMENT
#endif /* VMS */
#endif /* STRATUS */
#endif /* UNIX */
#endif /* OS2 */
#endif /* CK_ENVIRONMENT */
#ifndef NOSNDLOC /* RFC 779 SEND LOCATION */
#ifndef CK_SNDLOC
#define CK_SNDLOC
#endif /* CK_SNDLOC */
#endif /* NOSNDLOC */
#ifndef NOXDISPLOC /* RFC 1096 XDISPLOC */
#ifndef CK_XDISPLOC
#define CK_XDISPLOC
#endif /* CK_XDISPLOC */
#endif /* NOXDISPLOC */
#ifndef NOFORWARDX
#ifndef NOPUTENV
#ifndef NOSELECT
#ifndef CK_FORWARD_X
#ifdef CK_AUTHENTICATION
#ifndef OS2ONLY
#define CK_FORWARD_X
#endif /* OS2ONLY */
#endif /* CK_AUTHENTICATION */
#endif /* CK_FORWARD_X */
#endif /* NOSELECT */
#endif /* NOPUTENV */
#endif /* NOFORWARDX */
#ifndef NO_COMPORT
#ifdef TCPSOCKET
#ifndef TN_COMPORT
#define TN_COMPORT
#endif /* TN_COMPORT */
#endif /* TCPSOCKET */
#endif /* NO_COMPORT */
#endif /* TNCODE */
#ifndef NOXFER
#ifndef NOCTRLZ /* Allow SET FILE EOF CTRL-Z */
#ifndef CK_CTRLZ
#ifdef OS2ORUNIX
#define CK_CTRLZ
#endif /* OS2ORUNIX */
#endif /* CK_CTRLZ */
#endif /* NOCTRLZ */
#endif /* NOXFER */
#ifndef NOPERMS /* File permissions in A packets */
#ifndef CK_PERMS
#ifdef UNIX
#define CK_PERMS
#else
#ifdef VMS
#define CK_PERMS
#endif /* VMS */
#endif /* UNIX */
#endif /* CK_PERMS */
#endif /* NOPERMS */
#ifdef CK_PERMS
#define CK_PERMLEN 24 /* Max length of sys-dependent perms */
#endif /* CK_PERMS */
#ifdef UNIX /* NOSETBUF for everybody */
#ifndef NOSETBUF
#ifndef USE_SETBUF /* This is the escape clause */
#define NOSETBUF
#endif /* USE_SETBUF */
#endif /* NOSETBUF */
#endif /* UNIX */
#ifndef USE_STRERROR /* Whether to use strerror() */
#ifdef pdp11
#define USE_STRERROR
#endif /* pdp11 */
#endif /* USE_STRERROR */
#ifdef VMS /* Features for all VMS builds */
#ifndef NOJC
#define NOJC
#endif /* NOJC */
#ifndef NOSETBUF
#define NOSETBUF
#endif /* NOSETBUF */
#ifndef DYNAMIC
#define DYNAMIC
#endif /* DYNAMIC */
#ifndef NOCURSES
#ifndef CK_CURSES
#define CK_CURSES
#endif /* CK_CURSES */
#endif /* NOCURSES */
#endif /* VMS */
#ifndef NOCKTIMERS /* Dynamic timeouts */
#ifndef CK_TIMERS
#define CK_TIMERS
#endif /* CK_TIMERS */
#endif /* NOCKTIMERS */
#define CK_SPEED /* Control-prefix removal */
#ifdef NOCKSPEED
#undef CK_SPEED
#endif /* NOCKSPEED */
#ifndef NOCKXXCHAR
#ifndef CKXXCHAR
#ifdef UNIX
#define CKXXCHAR
#else
#ifdef OS2
#define CKXXCHAR
#endif /* OS2 */
#endif /* UNIX */
#endif /* CKXXCHAR */
#endif /* NOCKXXCHAR */
#ifdef MAC /* For Macintosh, no escape */
#define NOPUSH /* to operating system */
#endif /* MAC */
/* Systems where we can call zmkdir() to create directories. */
#ifndef CK_MKDIR
#ifndef NOMKDIR
#ifdef UNIX
#ifndef pdp11
#define CK_MKDIR
#endif /* pdp11 */
#endif /* UNIX */
#ifdef OS2
#define CK_MKDIR
#endif /* OS2 */
#ifdef VMS
#define CK_MKDIR
#endif /* VMS */
#ifdef STRATUS
#define CK_MKDIR
#endif /* STRATUS */
#ifdef OSK
#define CK_MKDIR
#endif /* OSK */
#ifdef datageneral
#define CK_MKDIR
#endif /* datageneral */
#endif /* CK_MKDIR */
#endif /* NOMKDIR */
#ifdef NOMKDIR /* Allow for command-line override */
#ifdef CK_MKDIR
#undef CK_MKDIR
#endif /* CK_MKDIR */
#endif /* NOMKDIR */
/* Systems for which we can enable the REDIRECT command automatically */
/* As of 6.0.193, it should work for all UNIX... */
#ifndef NOREDIRECT
#ifndef CK_REDIR
#ifdef UNIX
#define CK_REDIR
#endif /* UNIX */
#ifdef OS2 /* As well as OS/2 and friends... */
#define CK_REDIR
#endif /* OS2 */
#endif /* CK_REDIR */
#endif /* NOREDIRECT */
#ifdef NOPUSH /* But... REDIRECT command is not */
#ifdef CK_REDIR /* allowed if NOPUSH is defined. */
#undef CK_REDIR
#endif /* CK_REDIR */
#ifdef NETCMD /* Nor is SET NET COMMAND */
#undef NETCMD
#endif /* NETCMD */
#ifdef NETPTY
#undef NETPTY
#endif /* NETPTY */
#endif /* NOPUSH */
#ifndef PEXITSTAT /* \v(pexitstat) variable defined */
#ifdef OS2ORUNIX
#define PEXITSTAT
#else
#ifdef VMS
#define PEXITSTAT
#endif /* VMS */
#endif /* OS2ORUNIX */
#endif /* PEXITSTAT */
/* The following allows automatic enabling of REDIRECT to be overridden... */
#ifdef NOREDIRECT
#ifdef NETCMD
#undef NETCMD
#endif /* NETCMD */
#ifdef NETPTY
#undef NETPTY
#endif /* NETPTY */
#ifdef CK_REDIR
#undef CK_REDIR
#endif /* CK_REDIR */
#endif /* NOREDIRECT */
#ifdef NONETCMD
#ifdef NETCMD
#undef NETCMD
#endif /* NETCMD */
#ifdef NETPTY
#undef NETPTY
#endif /* NETPTY */
#endif /* NONETCMD */
#ifdef CK_REDIR
_PROTOTYP( int ttruncmd, (char *) );
#endif /* CK_REDIR */
/* Use built-in DIRECTORY command */
#ifndef NOMYDIR
#ifndef DOMYDIR
#ifdef UNIXOROSK
#define DOMYDIR
#else
#ifdef OS2
#define DOMYDIR
#else
#ifdef VMS
#define DOMYDIR
#endif /* VMS */
#endif /* OS2 */
#endif /* UNIXOROSK */
#endif /* DOMYDIR */
#endif /* NOMYDIR */
/* Sending from and receiving to commands/pipes */
#ifndef PIPESEND
#ifdef UNIX
#define PIPESEND
#endif /* UNIX */
#ifdef OS2
#define PIPESEND
#endif /* OS2 */
#endif /* PIPESEND */
#ifdef PIPESEND
#ifdef NOPIPESEND
#undef PIPESEND
#endif /* NOPIPESEND */
#ifdef NOPUSH
#undef PIPESEND
#endif /* NOPUSH */
#endif /* PIPESEND */
#ifdef NOPUSH
#ifdef BROWSER
#undef BROWSER
#endif /* BROWSER */
#endif /* NOPUSH */
/* Versions where we support the RESEND command */
#ifndef NOXFER
#ifndef NORESEND
#ifndef CK_RESEND
#ifdef UNIX
#ifndef pdp11
#define CK_RESEND
#endif /* pdp11 */
#endif /* UNIX */
#ifdef VMS
#define CK_RESEND
#endif /* VMS */
#ifdef OS2
#define CK_RESEND
#endif /* OS2 */
#ifdef AMIGA
#define CK_RESEND
#endif /* AMIGA */
#ifdef datageneral
#define CK_RESEND
#endif /* datageneral */
#ifdef STRATUS
#define CK_RESEND
#endif /* STRATUS */
#ifdef OSK
#define CK_RESEND
#endif /* OSK */
#endif /* CK_RESEND */
#endif /* NORESEND */
#endif /* NOXFER */
/* Systems implementing "Doomsday Kermit" protocol ... */
#ifndef DOOMSDAY
#ifdef UNIX
#define DOOMSDAY
#else
#ifdef VMS
#define DOOMSDAY
#else
#ifdef OS2
#define DOOMSDAY
#else
#ifdef STRATUS
#define DOOMSDAY
#endif /* STRATUS */
#endif /* OS2 */
#endif /* VMS */
#endif /* UNIX */
#endif /* DOOMSDAY */
/* Systems where we want the Thermometer to be used for fullscreen */
#ifdef OS2
#ifndef CK_PCT_BAR
#define CK_PCT_BAR
#endif /* CK_PCT_BAR */
#endif /* OS2 */
/* Systems where we have a REXX command */
#ifdef OS2
#ifdef __32BIT__
#ifndef NOREXX
#define CK_REXX
#endif /* NOREXX */
#endif /* __32BIT__ */
#endif /* OS2 */
/* Platforms that have a ZCHKPID function */
#ifdef OS2ORUNIX
#define ZCHKPID
#endif /* OS2ORUNIX */
#ifndef ZCHKPID
/* If we can't check pids then we have treat all pids as active & valid. */
#define zchkpid(x) 1
#endif /* ZCHKPID */
/* Systems that have a ZRENAME function */
#define ZRENAME /* They all do */
/* Systems that have a ZCOPY function */
#ifndef ZCOPY
#ifdef VMS
#define ZCOPY
#else
#ifdef OS2
#define ZCOPY
#else
#ifdef UNIX
#define ZCOPY
#else
#ifdef STRATUS
#define ZCOPY
#endif /* STRATUS */
#endif /* UNIX */
#endif /* OS2 */
#endif /* VMS */
#endif /* ZCOPY */
/* Systems that have ttgwsiz() (they all should but they don't) */
#ifndef NOTTGWSIZ
#ifndef CK_TTGWSIZ
#ifdef UNIX
#define CK_TTGWSIZ
#else
#ifdef VMS
#define CK_TTGWSIZ
#else
#ifdef OS2
#define CK_TTGWSIZ
#else
#ifdef OSK
#define CK_TTGWSIZ
#endif /* OSK */
#endif /* OS2 */
#endif /* VMS */
#endif /* UNIX */
#endif /* CK_TTGWSIZ */
#endif /* NOTTGWSIZ */
#ifdef NOTTGWSIZ
#ifdef CK_TTGWSIZ
#undef CK_TTGWSIZ
#endif /* CK_TTGWSIZ */
#endif /* NOTTGWSIZ */
#ifdef OS2
/* OS/2 C-Kermit features not available in 16-bit version... */
#ifdef OS2ONLY
#ifndef __32BIT__
#ifndef NOLOCAL
#ifdef PCFONTS /* PC Font support */
#undef PCFONTS
#endif /* PCFONTS */
#ifdef NPIPE /* Named Pipes communication */
#undef NPIPE
#endif /* NPIPE */
#ifdef CK_NETBIOS /* NETBIOS communication */
#undef CK_NETBIOS
#endif /* CK_NETBIOS */
#ifdef OS2MOUSE /* Mouse */
#undef OS2MOUSE
#endif /* OS2MOUSE */
#ifdef OS2PM /* Presentation Manager */
#undef OS2PM
#endif /* OS2PM */
#endif /* NOLOCAL */
#ifdef CK_REXX /* Rexx */
#undef CK_REXX
#endif /* CK_REXX */
#endif /* __32BIT__ */
#endif /* OS2ONLY */
/* OS/2 C-Kermit features not available in Windows NT version... */
#ifdef NT
#ifdef PCFONTS /* PC Font support */
#undef PCFONTS
#endif /* PCFONTS */
#ifdef OS2PM /* Presentation Manager */
#undef OS2PM
#endif /* OS2PM */
#ifdef CK_REXX /* Rexx */
#undef CK_REXX
#endif /* CK_REXX */
#endif /* NT */
#endif /* OS2 */
/*
Systems that have select().
This is used for both msleep() and for read-buffer checking in in_chk().
*/
#define CK_SLEEPINT 250 /* milliseconds - set this to something that
divides evenly into 1000 */
#ifndef SELECT
#ifndef NOSELECT
#ifdef __linux__
#define SELECT
#else
#ifdef SUNOS4
#define SELECT
#else
#ifdef NEXT
#define SELECT
#else
#ifdef RTAIX
#define SELECT
#else
#ifdef HPUX
/*
Not really. I think it's only in HP-UX 7.0 and later, except it's also
in earlier versions that have TCP/IP installed. Override this default
in particular HP-UX makefile entries by adding -DNOSELECT, as in (e.g.)
the HP-UX 6.5 ones.
*/
#define SELECT
#else
#ifdef AIXRS
#define SELECT
#else
#ifdef BSD44
#define SELECT
#else
#ifdef BSD4
#define SELECT
#else
#ifdef OXOS
#define SELECT
#else
#ifdef OS2
#define SELECT
#else
#ifdef BEBOX
#define SELECT
#endif /* BEBOX */
#endif /* OS2 */
#endif /* OXOS */
#endif /* BSD4 */
#endif /* BSD44 */
#endif /* AIXRS */
#endif /* HPUX */
#endif /* RTAIX */
#endif /* NEXT */
#endif /* __linux__ */
#endif /* SUNOS4 */
#endif /* NOSELECT */
#endif /* SELECT */
/*
The following section moved here from ckcnet.h in 6.1 because select()
is now used for non-networking purposes.
*/
/* On HP-9000/500 HP-UX 5.21 this stuff is not defined in any header file */
#ifdef hp9000s500
#ifndef NEEDSELECTDEFS
#define NEEDSELECTDEFS
#endif /* NEEDSELECTDEFS */
#endif /* hp9000s500 */
#ifdef NEEDSELECTDEFS
typedef long fd_mask;
#ifndef NBBY
#define NBBY 8
#endif /* NBBY */
#ifndef FD_SETSIZE
#define FD_SETSIZE 32
#endif /* FD_SETSIZE */
#ifndef NFDBITS
#define NFDBITS (sizeof(fd_mask) * NBBY)
#endif /* NFDBITS */
#ifndef howmany
#define howmany(x,y) (((x)+((y)-1))/(y))
#endif /* howmany */
typedef struct fd_set {
fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
} fd_set;
#ifndef FD_SET
#define FD_SET(n,p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
#endif /* FD_SET */
#ifndef FD_CLR
#define FD_CLR(n,p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
#endif /* FD_CLR */
#ifndef FD_ISSET
#define FD_ISSET(n,p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
#endif /* FD_ISSET */
#ifndef FD_COPY
#define FD_COPY(f,t) (bcopy(f,t,sizeof(*(f)))
#endif /* FD_COPY */
#ifndef FD_ZERO
#define FD_ZERO(p) bzero((char *)(p),sizeof(*(p)))
#endif /* FD_ZERO */
#endif /* NEEDSELECTDEFS */
/*
CK_NEED_SIG is defined if the system cannot check the console to
to see if characters are waiting. This is used during local-mode file
transfer to interrupt the transfer, refresh the screen display, etc.
If CK_NEED_SIG is defined, then file-transfer interruption characters
have to be preceded a special character, e.g. the SIGQUIT character.
CK_NEED_SIG should be defined if the conchk() function is not operational.
*/
#ifdef NOPOLL /* For overriding CK_POLL definition */
#ifdef CK_POLL
#undef CK_POLL
#endif /* CK_POLL */
#endif /* NOPOLL */
#ifndef CK_POLL /* If we don't have poll() */
#ifndef RDCHK /* And we don't have rdchk() */
#ifndef SELECT /* And we don't have select() */
#ifdef ATTSV
#ifndef aegis
#ifndef datageneral
#ifndef OXOS
#define CK_NEED_SIG
#endif /* OXOS */
#endif /* datageneral */
#endif /* aegis */
#endif /* ATTSV */
#ifdef POSIX
#ifndef CK_NEED_SIG
#define CK_NEED_SIG
#endif /* CK_NEED_SIG */
#endif /* POSIX */
#endif /* SELECT */
#endif /* RDCHK */
#endif /* CK_POLL */
#ifdef HPUX /* HP-UX has select() */
#ifdef CK_NEED_SIG
#undef CK_NEED_SIG
#endif /* CK_NEED_SIG */
#endif /* HPUX */
#ifdef AIXRS /* AIX has select() */
#ifdef CK_NEED_SIG
#undef CK_NEED_SIG
#endif /* CK_NEED_SIG */
#endif /* AIXRS */
#ifdef BSD44 /* 4.4BSD has FIONREAD */
#ifdef CK_NEED_SIG
#undef CK_NEED_SIG
#endif /* CK_NEED_SIG */
#endif /* BSD44 */
#ifdef QNX /* QNX has FIONREAD and select() */
#ifdef CK_NEED_SIG
#undef CK_NEED_SIG
#endif /* CK_NEED_SIG */
#endif /* QNX */
#ifdef COHERENT
#ifndef NOTIMEZONE
#define NOTIMEZONE
#endif /* NOTIMEZONE */
#endif /* COHERENT */
#ifdef UNIX
#ifndef HAVE_TZ /* Can we use struct timezone? */
#ifndef NOTIMEZONE
#ifdef PTX
#define NOTIMEZONE
#else
#ifndef SELECT
#ifdef COHERENT
#define NOTIMEZONE
#else
#ifdef BELLV10
#define NOTIMEZONE
#endif /* BELLV10 */
#endif /* COHERENT */
#endif /* SELECT */
#endif /* PTX */
#endif /* NOTIMEZONE */
#endif /* HAVE_TZ */
#ifndef NOTIMEVAL /* Can we use struct timeval? */
#ifndef HAVE_TV
#define HAVE_TV
#endif /* HAVE_TV */
#endif /* NOTIMEVAL */
#ifndef NOTIMEZONE
#ifndef HAVE_TZ
#define HAVE_TZ
#endif /* HAVE_TZ */
#endif /* NOTIMEZONE */
#endif /* UNIX */
#ifdef SCO32
#ifdef HAVE_TV
#undef HAVE_TV
#endif /* HAVE_TV */
#ifdef HAVE_TZ
#undef HAVE_TZ
#endif /* HAVE_TZ */
#ifndef NOTIMEVAL
#define NOTIMEVAL
#endif /* NOTIMEVAL */
#ifndef NOTIMEZONE
#define NOTIMEZONE
#endif /* NOTIMEZONE */
#endif /* SCO32 */
#ifdef ATT7300
#ifdef HAVE_TV
#undef HAVE_TV
#endif /* HAVE_TV */
#ifdef HAVE_TZ
#undef HAVE_TZ
#endif /* HAVE_TZ */
#ifndef NOTIMEVAL
#define NOTIMEVAL
#endif /* NOTIMEVAL */
#ifndef NOTIMEZONE
#define NOTIMEZONE
#endif /* NOTIMEZONE */
#endif /* ATT7300 */
/*
Automatic parity detection.
This actually implies a lot more now: length-driven packet reading,
"Doomsday Kermit" IBM Mainframe file transfer through 3270 data streams, etc.
*/
#ifdef UNIX /* For Unix */
#ifndef NOPARSEN
#define PARSENSE
#endif /* NOPARSEN */
#endif /* UNIX */
#ifdef VMS /* ... and VMS */
#ifndef NOPARSEN
#define PARSENSE
#endif /* NOPARSEN */
#ifdef __GNUC__
#define VMSGCC
#endif /* __GNUC__ */
#endif /* VMS */
#ifdef MAC /* and Macintosh */
#ifndef NOPARSEN
#define PARSENSE
#endif /* NOPARSEN */
#endif /* MAC */
#ifdef STRATUS /* and Stratus VOS */
#ifndef NOPARSEN
#define PARSENSE
#endif /* NOPARSEN */
#endif /* STRATUS */
#ifdef OS2 /* and OS/2, finally */
#ifndef NOPARSEN
#define PARSENSE
#endif /* NOPARSEN */
#endif /* OS2 */
#ifndef NODYNAMIC /* DYNAMIC is default for UNIX */
#ifndef DYNAMIC /* as of C-Kermit 7.0 */
#ifdef UNIX
#define DYNAMIC
#endif /* UNIX */
#endif /* DYNAMIC */
#endif /* NODYNAMIC */
#ifdef DYNAMIC /* If DYNAMIC is defined */
#define DCMDBUF /* then also define this. */
#endif /* DYNAMIC */
#ifndef CK_LBRK /* Can send Long BREAK */
#ifdef UNIX /* (everybody but OS-9) */
#define CK_LBRK
#endif /* UNIX */
#ifdef VMS
#define CK_LBRK
#endif /* VMS */
#ifdef datageneral
#define CK_LBRK
#endif /* datageneral */
#ifdef GEMDOS
#define CK_LBRK
#endif /* GEMDOS */
#ifdef OS2
#define CK_LBRK
#endif /* OS2 */
#ifdef AMIGA
#define CK_LBRK
#endif /* AMIGA */
#ifdef STRATUS
#define CK_LBRK
#endif /* STRATUS */
#endif /* CK_LBRK */
/* Carrier treatment */
/* These are defined here because they are shared by the system dependent */
/* and the system independent modules. */
#define CAR_OFF 0 /* Off: ignore carrier always. */
#define CAR_ON 1 /* On: heed carrier always, except during DIAL. */
#define CAR_AUT 2 /* Auto: heed carrier, but only if line is declared */
/* to be a modem line, and only during CONNECT. */
/* And more generically (for use with any ON/OFF/AUTO feature) */
#define CK_OFF 0
#define CK_ON 1
#define CK_AUTO 2
#ifndef NOLOCAL
/*
Serial interface speeds available.
As of C-Kermit 6.1 there is a new method to get the supported
speeds, which obviates the need for all the craziness below. At runtime,
just call the new ttspdlist() routine to get a list of supported speeds.
Then the user interface module can build a keyword table or menu from it.
*/
#ifndef TTSPDLIST
#ifdef UNIX /* For now, only for UNIX */
#ifndef OLINUXHISPEED /* But not systems with hacks for */
#ifndef MINIX /* high speeds, like 110 = 115200 */
#define TTSPDLIST
#endif /* MINIX */
#endif /* OLINUXHISPEED */
#else
#ifdef VMS
#define TTSPDLIST /* VMS gets it too */
#endif /* VMS */
#endif /* UNIX */
#endif /* TTSPDLIST */
#ifndef NODIAL /* Hangup by modem command */
#ifndef NOMDMHUP
#ifndef MDMHUP
#define MDMHUP
#endif /* MDMHUP */
#endif /* NOMDMHUP */
#endif /* NODIAL */
#ifdef NOSPL
#ifndef NOLOGDIAL /* Connection log needs mjd(), etc. */
#define NOLOGDIAL
#endif /* NOLOGDIAL */
#endif /* NOSPL */
#ifdef pdp11
#define NOLOGDIAL
#endif /* pdp11 */
#ifndef NOLOGDIAL /* Connection log */
#ifndef CXLOGFILE
#define CXLOGFILE "CX.LOG" /* Default connection log file name */
#endif /* CXLOGFILE */
#ifndef CKLOGDIAL
#ifndef CK_SMALL
#define CKLOGDIAL
#define CXLOGBUFL 1024 /* Connection log record buffer size */
#endif /* CK_SMALL */
#endif /* NOLOGDIAL */
#endif /* CKLOGDIAL */
#endif /* NOLOCAL */
#ifdef NOTTSPDLIST /* Except if NOTTSPDLIST is defined */
#ifdef TTSPDLIST
#undef TTSPDLIST
#endif /* TTSPDLIST */
#endif /* NOTTSPDLIST */
#ifdef TTSPDLIST
_PROTOTYP( long * ttspdlist, (void) );
#else /* TTSPDLIST not defined */
/*
We must use a long and convoluted series of #ifdefs that have to be kept in
sync with the code in the ck?tio.c module.
We assume that everybody supports: 0, 110, 300, 600, 1200, 2400, 4800, and
9600 bps. Symbols for other speeds are defined here. You can also add
definitions on the CC command lines. These definitions affect the SET SPEED
keyword table, and are not necessarily usable in the system-dependent
speed-setting code in the ck?tio.c modules, which depends on system-specific
symbols like (in UNIX) B19200. In other words, just defining it doesn't
mean it'll work -- you also have to supply the supporting code in ttsspd()
and ttgspd() in ck?tio.c.
The symbols have the form BPS_xxxx, where xxxx is the speed in bits per
second, or (for bps values larger than 9999) thousands of bps followed by K.
The total symbol length should be 8 characters or less. Some values are
enabled automatically below. You can disable a particular value by defining
NOB_xxxx on the CC command line.
*/
#ifndef NOB_50
#define BPS_50 /* 50 bps */
#endif
#ifndef NOB_75
#define BPS_75 /* 75 bps */
#endif
#ifndef NOB7512
#ifdef ANYBSD
#define BPS_7512 /* 75/1200 Split Speed */
#endif /* ANYBSD */
#endif /* NOB7512 */
#ifndef NOB134
#ifdef SOLARIS25
#define BPS_134
#else
#undef BPS_134 /* 134.5 bps (IBM 2741) */
#endif /* BPS_134 */
#endif /* NOB134 */
#ifndef NOB_150
#define BPS_150 /* 150 bps */
#endif
#ifndef NOB_200
#define BPS_200 /* 200 bps */
#endif
#ifndef NOB_1800
#ifdef MAC
#define BPS_1800 /* 1800 bps */
#else
#ifdef SOLARIS25
#define BPS_1800
#endif
#endif
#endif
#ifndef NOB_3600
#ifndef SOLARIS25
#define BPS_3600 /* 3600 bps */
#endif
#endif
#ifndef NOB_7200
#ifndef SOLARIS25
#define BPS_7200 /* 7200 bps */
#endif /* SOLARIS25 */
#endif
#ifndef NOB_14K
#ifdef BSD44
#define BPS_14K /* 14400 bps */
#else
#ifdef OS2
#define BPS_14K
#else
#ifdef NEXT
#define BPS_14K
#else
#ifdef MAC
#define BPS_14K
#else
#ifdef AMIGA
#define BPS_14K
#endif /* AMIGA */
#endif /* MAC */
#endif /* NEXT */
#endif /* OS2 */
#endif /* BSD44 */
#endif /* NOB_14K */
#ifndef NOB_19K
#define BPS_19K /* 19200 bps */
#endif
#ifndef NOB_28K
#ifdef BSD44
#define BPS_28K
#else
#ifdef OS2
#define BPS_28K
#else
#ifdef NEXT
#define BPS_28K /* 28800 bps */
#else
#ifdef MAC
#define BPS_28K /* 28800 bps */
#endif /* MAC */
#endif /* NEXT */
#endif /* OS2 */
#endif /* BSD44 */
#endif /* NOB_28K */
#ifndef NOB_38K
#define BPS_38K /* 38400 bps */
#endif
#ifndef NOB_57K
#ifdef Plan9
#define BPS_57K
#else
#ifdef SOLARIS25
#define BPS_57K
#else
#ifdef VMS
#define BPS_57K /* 57600 bps */
#else
#ifdef OS2
#define BPS_57K
#else
#ifdef __linux__
#define BPS_57K
#else
#ifdef HPUX
#define BPS_57K
#else
#ifdef NEXT
#define BPS_57K
#else
#ifdef __386BSD__
#define BPS_57K
#else
#ifdef __FreeBSD__
#define BPS_57K
#else
#ifdef __NetBSD__
#define BPS_57K
#else
#ifdef MAC
#define BPS_57K
#else
#ifdef QNX
#define BPS_57K
#else
#ifdef BEOSORBEBOX
#define BPS_57K
#else
#ifdef IRIX62
#define BPS_57K
#else
#ifdef SCO_OSR504
#define BPS_57K
#else
#ifdef BSDI2
#define BPS_57K
#endif /* BSDI2 */
#endif /* SCO_OSR504 */
#endif /* IRIX62 */
#endif /* BEOSORBEBOX */
#endif /* QNX */
#endif /* MAC */
#endif /* __NetBSD__ */
#endif /* __FreeBSD__ */
#endif /* __386BSD__ */
#endif /* NEXT */
#endif /* HPUX */
#endif /* __linux__ */
#endif /* OS2 */
#endif /* VMS */
#endif /* SOLARIS25 */
#endif /* Plan9 */
#endif /* NOB_57K */
#ifndef NOB_76K
#ifdef BSDI2
#define BPS_76K
#endif /* BSDI2 */
#ifdef Plan9
#define BPS_76K
#endif /* Plan9 */
#ifdef SOLARIS25
#define BPS_76K
#endif /* SOLARIS25 */
#ifdef VMS
#define BPS_76K /* 76800 bps */
#endif /* VMS */
#ifdef OS2
#ifdef __32BIT__
#define BPS_76K
#endif /* __32BIT__ */
#endif /* OS2 */
#ifdef QNX
#define BPS_76K
#endif /* QNX */
#ifdef IRIX62
#define BPS_76K
#endif /* IRIX62 */
#ifdef SCO_OSR504
#define BPS_76K
#endif /* SCO_OSR504 */
#endif /* NOB_76K */
#ifndef NOB_115K
#ifdef BSDI2
#define BPS_115K
#endif /* BSDI2 */
#ifdef Plan9
#define BPS_115K
#endif /* Plan9 */
#ifdef SOLARIS25
#define BPS_115K
#endif /* SOLARIS25 */
#ifdef VMS
#define BPS_115K /* 115200 bps */
#else
#ifdef QNX
#define BPS_115K
#else
#ifdef HPUX
#define BPS_115K
#else
#ifdef __linux__
#define BPS_115K
#else
#ifdef __386BSD__
#define BPS_115K
#else
#ifdef __FreeBSD__
#define BPS_115K
#else
#ifdef __NetBSD__
#define BPS_115K
#else
#ifdef OS2
#ifdef __32BIT__
#define BPS_115K
#endif /* __32BIT__ */
#else
#ifdef BEOSORBEBOX
#define BPS_115K
#else
#ifdef IRIX62
#define BPS_115K
#else
#ifdef SCO_OSR504
#define BPS_115K
#endif /* SCO_OSR504 */
#endif /* IRIX62 */
#endif /* BEOSORBEBOX */
#endif /* OS2 */
#endif /* __NetBSD__ */
#endif /* __FreeBSD__ */
#endif /* __386BSD__ */
#endif /* __linux__ */
#endif /* HPUX */
#endif /* QNX */
#endif /* VMS */
#endif /* NOB_115K */
#ifndef NOB_230K /* 230400 bps */
#ifdef BSDI2
#define BPS_230K
#else
#ifdef SCO_OSR504
#define BPS_230K
#else
#ifdef __linux__
#define BPS_230K
#else
#ifdef SOLARIS25
#define BPS_230K
#else
#ifdef OS2
#ifdef __32BIT__
#define BPS_230K
#endif /* __32BIT__ */
#else
#undef BPS_230K
#endif /* OS2 */
#endif /* SOLARIS25 */
#endif /* __linux__ */
#endif /* SCO_OSR504 */
#endif /* BSDI2 */
#endif /* NOB_230K */
#ifndef NOB_460K /* 460800 bps */
#ifdef SCO_OSR504
#define BPS_460K
#else
#ifdef __linux__
#define BPS_460K
#else
#ifdef OS2
#ifdef __32BIT__
#define BPS_460K
#endif /* __32BIT__ */
#else
#undef BPS_460K
#endif /* __linux__ */
#endif /* SCO_OSR504 */
#endif /* OS2 */
#endif /* NOB_460K */
#ifndef NOB_921K /* 921600 bps */
#ifdef SCO_OSR504
#define BPS_921K
#endif /* SCO_OSR504 */
#endif /* NOB_921K */
#ifdef BPS_921K /* Maximum speed defined */
#define MAX_SPD 921600L
#else
#ifdef BPS_460K
#define MAX_SPD 460800L
#else
#ifdef BPS_230K
#define MAX_SPD 230400L
#else
#ifdef BPS_115K
#define MAX_SPD 115200L
#else
#ifdef BPS_76K
#define MAX_SPD 76800L
#else
#ifdef BPS_57K
#define MAX_SPD 57600L
#else
#ifdef BPS_38K
#define MAX_SPD 38400L
#else
#ifdef BPS_28K
#define MAX_SPD 28800L
#else
#ifdef BPS_19K
#define MAX_SPD 19200L
#else
#ifdef BPS_14K
#define MAX_SPD 14400L
#else
#define MAX_SPD 9600L
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif /* TTSPDLIST */
#ifndef CONGSPD /* Systems that can call congspd() */
#ifdef UNIX
#define CONGSPD
#endif /* UNIX */
#ifdef VMS
#define CONGSPD
#endif /* VMS */
#ifdef STRATUS
#define CONGSPD
#endif /* STRATUS */
#endif /* CONGSPD */
/* Types of flow control available */
#define CK_XONXOFF /* Everybody can do this, right? */
#ifdef AMIGA /* Commodore Amiga */
#define CK_RTSCTS /* has RTS/CTS */
#endif /* AMIGA */
#ifdef SUN4S5 /* SunOS in System V environment */
#define CK_RTSCTS
#else /* SunOS 4.0/4.1 in BSD environment */
#ifdef SUNOS4 /* SunOS 4.0+later supports RTS/CTS */
#ifdef SUNOS41 /* Easy in 4.1 and later */
#define CK_RTSCTS
#else /* Harder in 4.0 */
#ifndef __GNUC__ /* (see tthflow() in ckutio.c) */
#ifndef GNUC
#define CK_RTSCTS /* Only if not using GNU gcc */
#endif /* __GNUC__ */
#endif /* GNUC */
#endif /* SUNOS41 */
#endif /* SUNOS4 */
#endif /* SUN4S5 */
#ifdef BSD44 /* And in 4.4 BSD, including BSDI */
#define CK_RTSCTS
#endif /* BSD44 */
#ifdef TERMIOX /* Sys V R4 <termiox.h> */
#ifndef CK_RTSCTS
#define CK_RTSCTS
#endif /* CK_RTSCTS */
#ifndef CK_DTRCD
#define CK_DTRCD
#endif /* CK_DTRCD */
#else
#ifdef STERMIOX /* Sys V R4 <sys/termiox.h> */
#ifndef CK_RTSCTS
#define CK_RTSCTS
#endif /* CK_RTSCTS */
#ifndef CK_DTRCD
#define CK_DTRCD
#endif /* CK_DTRCD */
#endif /* STERMIOX */
#endif /* TERMIOX */
#ifdef OXOS /* Olivetti X/OS R2 struct termios */
#define CK_RTSCTS /* Ditto. */
#define CK_DTRCD
#endif /* OXOS */
#ifdef AIXRS /* RS/6000 with AIX 3.x */
#define CK_RTSCTS /* Has its own peculiar method... */
#endif /* AIXRS */
#ifdef __linux__ /* Linux */
#define CK_RTSCTS
#endif /* __linux__ */
/*
Hardware flow control is not defined in POSIX.1. Nevertheless, a certain
style API for hardware flow control, using tcsetattr() and the CRTSCTS
bit(s), seems to be gaining currency on POSIX-based UNIX systems. The
following code defines the symbol POSIX_CRTSCTS for such systems.
*/
#ifdef CK_RTSCTS
#ifdef __bsdi__ /* BSDI, a.k.a. BSD/386 */
#define POSIX_CRTSCTS
#endif /* __bsdi__ */
#ifdef __linux__ /* Linux */
#define POSIX_CRTSCTS
#endif /* __linux__ */
#ifdef __NetBSD__ /* NetBSD */
#define POSIX_CRTSCTS
#endif /* __NetBSD__ */
#ifdef __OpenBSD__
#define POSIX_CRTSCTS
#endif /* __OpenBSD__ */
#ifdef BEOSORBEBOX /* BeBOX */
#define POSIX_CRTSCTS
/* BEBOX defines CRTSFL as (CTSFLOW & RTSFLOW) */
#define CRTSCTS CRTSFL
#endif /* BEOSORBEBOX */
#ifdef IRIX52 /* IRIX 5.2 and later */
#define POSIX_CRTSCTS
#define CRTSCTS CNEW_RTSCTS /* See <sys/termios.h> */
#endif /* IRIX52 */
#endif /* CK_RTSCTS */
/* Implementations that have implemented the ttsetflow() function. */
#ifndef CK_TTSETFLOW
#ifdef UNIX
#define CK_TTSETFLOW
#endif /* UNIX */
#ifdef OS2
#define CK_TTSETFLOW
#endif /* OS2 */
#endif /* CK_TTSETFLOW */
#ifdef CK_TTSETFLOW
_PROTOTYP( int ttsetflow, (int) );
#endif /* CK_TTSETFLOW */
/*
Systems where we can expand tilde at the beginning of file or directory names
*/
#ifdef POSIX
#ifndef DTILDE
#define DTILDE
#endif /* DTILDE */
#endif /* POSIX */
#ifdef BSD4
#ifndef DTILDE
#define DTILDE
#endif /* DTILDE */
#endif /* BSD4 */
#ifdef ATTSV
#ifndef DTILDE
#define DTILDE
#endif /* DTILDE */
#endif /* ATTSV */
#ifdef OSK
#ifndef DTILDE
#define DTILDE
#endif /* DTILDE */
#endif /* OSK */
#ifdef HPUX /* I don't know why this is */
#ifndef DTILDE /* necessary, since -DHPUX */
#define DTILDE /* automatically defines ATTSV */
#endif /* DTILDE */ /* (see above) ... */
#endif /* HPUX */
/*
This is mainly for the benefit of ckufio.c (UNIX and OS/2 file support).
Systems that have an atomic rename() function, so we don't have to use
link() and unlink().
*/
#ifdef POSIX
#ifndef RENAME
#define RENAME
#endif /* RENAME */
#endif /* POSIX */
#ifdef OS2
#ifndef RENAME
#define RENAME
#endif /* RENAME */
#endif /* OS2 */
#ifdef SUNOS41
#ifndef RENAME
#define RENAME
#endif /* RENAME */
#endif /* SUNOS41 */
#ifdef SVR4
#ifndef RENAME
#define RENAME
#endif /* RENAME */
#endif /* SVR4 */
#ifdef AIXRS
#ifndef RENAME
#define RENAME
#endif /* RENAME */
#endif /* AIXRS */
#ifdef BSD44
#ifndef RENAME
#define RENAME
#endif /* RENAME */
#endif /* BSD44 */
#ifdef NORENAME /* Allow for compile-time override */
#ifdef RENAME
#undef RENAME
#endif /* RENAME */
#endif /* NORENAME */
#ifdef STRATUS /* Stratus VOS */
#ifndef RENAME
#define RENAME
#endif /* RENAME */
#endif /* STRATUS */
/* Line delimiter for text files */
/*
If the system uses a single character for text file line delimitation,
define NLCHAR to the value of that character. For text files, that
character will be converted to CRLF upon output, and CRLF will be converted
to that character on input during text-mode (default) packet operations.
*/
#ifdef MAC /* Macintosh */
#define NLCHAR 015
#else
#ifdef OSK /* OS-9/68K */
#define NLCHAR 015
#else /* All Unix-like systems */
#define NLCHAR 012
#endif /* OSK */
#endif /* MAC */
/*
At this point, if there's a system that uses ordinary CRLF line
delimitation AND the C compiler actually returns both the CR and
the LF when doing input from a file, then #undef NLCHAR.
*/
#ifdef OS2 /* OS/2 */
#undef NLCHAR
#endif /* OS2 */
#ifdef GEMDOS /* Atari ST */
#undef NLCHAR
#endif /* GEMDOS */
/*
VMS file formats are so complicated we need to do all the conversion
work in the CKVFIO module, so we tell the rest of C-Kermit not to fiddle
with the bytes.
*/
#ifdef vms
#undef NLCHAR
#endif /* vms */
/* The device name of a job's controlling terminal */
/* Special for VMS, same for all Unixes (?), not used by Macintosh */
#ifdef BEOS
#define CTTNAM dftty
#else
#ifdef vms
#define CTTNAM "SYS$INPUT:" /* (4 Jan 2002) Was TT: */
#else
#ifdef datageneral
#define CTTNAM "@output"
#else
#ifdef OSK
extern char myttystr[];
#define CTTNAM myttystr
#else
#ifdef OS2
#define CTTNAM "con"
#else
#ifdef UNIX
#define CTTNAM "/dev/tty"
#else
#ifdef GEMDOS
#define CTTNAM "aux:"
#else
#ifdef STRATUS
extern char myttystr[];
#define CTTNAM myttystr
#else /* Anyone else... */
#define CTTNAM "stdout" /* This is a kludge used by Mac */
#endif /* STRATUS */
#endif /* GEMDOS */
#endif /* UNIX */
#endif /* OS2 */
#endif /* OSK */
#endif /* datageneral */
#endif /* vms */
#endif /* BEOS */
#ifndef HAVECTTNAM
#ifdef UNIX
#define HAVECTTNAM
#else
#ifdef VMS
#define HAVECTTNAM
#endif /* VMS */
#endif /* UNIX */
#endif /* HAVECTTNAM */
#ifndef ZFCDAT /* zfcdat() function available? */
#ifdef UNIX
#define ZFCDAT
#else
#ifdef STRATUS
#define ZFCDAT
#else
#ifdef GEMDOS
#define ZFCDAT
#else
#ifdef AMIGA
#define ZFCDAT
#else
#ifdef OS2
#define ZFCDAT
#else
#ifdef datageneral
#define ZFCDAT
#else
#ifdef VMS
#define ZFCDAT
#endif /* VMS */
#endif /* datageneral */
#endif /* OS2 */
#endif /* AMIGA */
#endif /* GEMDOS */
#endif /* STRATUS */
#endif /* UNIX */
#endif /* ZFCDAT */
#ifdef SUNS4S5
#define tolower _tolower
#define toupper _toupper
#endif /* SUNS4S5 */
/* Error number */
#ifdef _CRAY
#ifdef _CRAYCOM /* Cray Computer Corp. */
extern int errno;
#else /* _CRAYCOM */
#include <errno.h> /* Cray Research UNICOS defines */
/* errno as a function. */
#endif /* _CRAYCOM */ /* OK for UNICOS 6.1 and 7.0. */
#else /* _CRAY */
#ifdef STRATUS /* Stratus VOS */
#include <errno.h>
#else /* not STRATUS */
#ifndef VMS
#ifndef OS2
#ifdef __GLIBC__
/*
"glibc uses threads, kermit uses glibc; errno access is in Thread Local
Storage (TLS) from glibc-3.2.2. ...a thread specific errno is being run in
thread local storage relative to the %gs segment register, so some means to
revector gets/puts needs to be done." - Jeff Johnson, Red Hat, Feb 2003.
*/
#include <errno.h>
#else
/*
The following declaration would cause problems for VMS and OS/2, in which
errno is an "extern volatile int noshare"... NOTE: by now (2007) the
following is an anachronism and should be the execption rather than the
rule.
*/
extern int errno;
#endif /* __GLIBC__ */
#endif /* OS2 */
#endif /* VMS */
#endif /* STRATUS */
#endif /* _CRAY */
#ifdef UNIX /* Catch-all so we can have */
#ifndef ESRCH /* access to error mnemonics */
#include <errno.h> /* in all modules - 2007/08/25 */
#endif /* ESRCH */
#endif /* UNIX */
#ifdef pdp11 /* Try to make some space on PDP-11 */
#ifndef NODIAL
#define NODIAL
#endif /* NODIAL */
#ifndef NOCURSES
#define NOCURSES
#endif /* NOCURSES */
#ifndef NOBIGBUF
#define NOBIGBUF
#endif /* NOBIGBUF */
#endif /* pdp11 */
#ifndef NOBIGBUF
#ifndef BIGBUFOK /* Platforms with lots of memory */
#ifdef QNX /* QNX */
#ifndef QNX16 /* But not 16-bit versions */
#define BIGBUFOK
#endif /* QNX16 */
#endif /* QNX */
#ifdef BSD44
#define BIGBUFOK
#endif /* BSD44 */
#ifdef STRATUS /* Stratus VOS */
#define BIGBUFOK
#endif /* STRATUS */
#ifdef sparc /* SPARC processors */
#define BIGBUFOK
#endif /* sparc */
#ifdef mips /* MIPS processors */
#define BIGBUFOK
#endif /* mips */
#ifdef HPUX9 /* HP-UX 9.x */
#define BIGBUFOK
#endif /* HPUX9 */
#ifdef HPUX10 /* HP-UX 10.0 PA-RISC */
#define BIGBUFOK
#endif /* HPUX10 */
#ifdef NEXT /* NeXTSTEP */
#ifdef mc68000 /* on NEXT platforms... */
#define BIGBUFOK
#endif /* mc68000 */
#endif /* NEXT */
#ifdef LINUX /* Linux from 1998 on should be OK */
#ifndef BIGBUFOK
#define BIGBUFOK
#endif /* BIGBUFOK */
#endif /* LINUX */
#ifdef OS2 /* 32-bit OS/2 2.x and above */
#ifdef __32BIT__
#define BIGBUFOK
#endif /* __32BIT__ */
#ifdef NT
#define BIGBUFOK
#endif /* NT */
#endif /* OS2 */
#ifdef Plan9 /* Plan 9 is OK */
#define BIGBUFOK
#endif /* Plan9 */
#ifdef VMS /* Any VMS is OK */
#ifndef BIGBUFOK
#define BIGBUFOK
#endif /* BIGBUFOK */
#endif /* VMS */
#ifdef __alpha /* DEC 64-bit Alpha, e.g. OSF/1 */
#ifndef BIGBUFOK /* Might already be defined for VMS */
#define BIGBUFOK
#endif /* BIGBUFOK */
#endif /* __alpha */
#ifdef sgi /* SGI with IRIX 4.0 or later */
#ifndef BIGBUFOK
#define BIGBUFOK
#endif /* BIGBUFOK */
#endif /* sgi */
#ifdef AIXRS /* AIX on RISC */
#define BIGBUFOK
#endif /* AIXRS */
#ifdef CK_SCOV5 /* SCO OSR5 */
#ifndef BIGBUFOK
#define BIGBUFOK
#endif /* BIGBUFOK */
#endif /* CK_SCOV5 */
#ifdef SOLARIS /* Solaris x86 */
#ifndef BIGBUFOK
#define BIGBUFOK
#endif /* BIGBUFOK */
#endif /* SOLARIS */
#endif /* BIGBUFOK */
#endif /* NOBIGBUF */
#ifdef CK_SMALL
#ifdef BIGBUFOK
#undef BIGBUFOK
#endif /* BIGBUFOK */
#endif /* CK_SMALL */
/* If "memory is no problem" then this improves performance */
#ifdef DEBUG
#ifdef BIGBUFOK
#ifndef IFDEBUG
#define IFDEBUG
#endif /* IFDEBUG */
#endif /* BIGBUFOK */
#endif /* DEBUG */
/* File System Defaults */
#ifndef UIDBUFLEN /* Length of User ID */
#ifdef OS2
#define UIDBUFLEN 256
#else /* OS2 */
#ifdef BIGBUFOK
#define UIDBUFLEN 256
#else
#define UIDBUFLEN 64
#endif /* BIGBUFOK */
#endif /* OS2 */
#endif /* UIDBUFLEN */
#ifdef UNIX
#ifdef PROVX1
#define MAXWLD 50
#else
#ifdef pdp11
#define MAXWLD 50
#else
#ifdef BIGBUFOK
#define MAXWLD 102400
#else
#define MAXWLD 1024
#endif /* BIGBUFOK */
#endif /* pdp11 */
#endif /* PROVX1 */
#else
#ifdef VMS
#define MAXWLD 102400 /* Maximum wildcard filenames */
#else
#ifdef datageneral
#define MAXWLD 500
#else
#ifdef STRATUS
#define MAXWLD 5000
#endif /* STRATUS */
#endif /* datageneral */
#endif /* VMS */
#endif /* UNIX */
#ifdef VMS
#define DBLKSIZ 512
#define DLRECL 512
#else
#define DBLKSIZ 0
#define DLRECL 0
#endif /* VMS */
/* Communication device / network host name length */
#ifdef BIGBUFOK
#define TTNAMLEN 512
#else
#ifdef MAC
#define TTNAMLEN 256
#else
#ifndef CK_SMALL
#define TTNAMLEN 128
#else
#define TTNAMLEN 80
#endif /* CK_SMALL */
#endif /* MAC */
#endif /* BIGBUFOK */
/* Program return codes for DECUS C and UNIX (VMS uses UNIX codes) */
#ifdef decus
#define GOOD_EXIT IO_NORMAL
#define BAD_EXIT IO_ERROR
#else
#define GOOD_EXIT 0
#define BAD_EXIT 1
#endif /* decus */
/* Special hack for Fortune, which doesn't have <sys/file.h>... */
#ifdef FT18
#define FREAD 0x01
#define FWRITE 0x10
#endif /* FT18 */
/* Special hack for OS-9/68k */
#ifdef OSK
#ifndef _UCC
#define SIGALRM 30 /* May always cancel I/O */
#endif /* _UCC */
#define SIGARB 1234 /* Arbitrary for I/O */
SIGTYP (*signal())();
#endif /* OSK */
#ifdef MINIX
#ifdef putchar
#undef putchar
#endif /* putchar */
#define putchar(c) (putc(c,stdout)!=EOF)&&fflush(stdout)
#endif /* MINIX */
#ifdef datageneral /* Data General AOS/VS */
#ifdef putchar
#undef putchar
#endif /* putchar */
#define putchar(c) conoc(c)
#endif /* datageneral */
/* Escape/quote character used by the command parser */
#define CMDQ '\\'
/* Symbols for RS-232 modem signals */
#define KM_FG 1 /* Frame ground */
#define KM_TXD 2 /* Transmit */
#define KM_RXD 3 /* Receive */
#define KM_RTS 4 /* Request to Send */
#define KM_CTS 5 /* Clear to Send */
#define KM_DSR 6 /* Data Set Ready */
#define KM_SG 7 /* Signal ground */
#define KM_DCD 8 /* Carrier Detect */
#define KM_DTR 20 /* Data Terminal Ready */
#define KM_RI 22 /* Ring Indication */
/* Bit mask values for modem signals */
#define BM_CTS 0001 /* Clear to send (From DCE) */
#define BM_DSR 0002 /* Dataset ready (From DCE) */
#define BM_DCD 0004 /* Carrier (From DCE) */
#define BM_RNG 0010 /* Ring Indicator (From DCE) */
#define BM_DTR 0020 /* Data Terminal Ready (From DTE) */
#define BM_RTS 0040 /* Request to Send (From DTE) */
/* Codes for full duplex flow control */
#define FLO_NONE 0 /* None */
#define FLO_XONX 1 /* Xon/Xoff (soft) */
#define FLO_RTSC 2 /* RTS/CTS (hard) */
#define FLO_DTRC 3 /* DTR/CD (hard) */
#define FLO_ETXA 4 /* ETX/ACK (soft) */
#define FLO_STRG 5 /* String-based (soft) */
#define FLO_DIAL 6 /* DIALing kludge */
#define FLO_DIAX 7 /* Cancel dialing kludge */
#define FLO_DTRT 8 /* DTR/CTS (hard) */
#define FLO_KEEP 9 /* Keep, i.e. don't touch or change */
#define FLO_AUTO 10 /* Figure out automatically */
/* Types of connections */
#define CXT_REMOTE 0 /* Remote mode - no connection */
#define CXT_DIRECT 1 /* Direct serial connection */
#define CXT_MODEM 2 /* Modem dialout */
#define CXT_TCPIP 3 /* TCP/IP - Telnet, Rlogin, etc */
#define CXT_X25 4 /* X.25 peer-to-peer */
#define CXT_DECNET 5 /* DECnet (CTERM, etc) */
#define CXT_LAT 6 /* LAT */
#define CXT_NETBIOS 7 /* NETBIOS */
#define CXT_NPIPE 8 /* Named Pipe */
#define CXT_PIPE 9 /* Pipe, Command, PTY, DLL, etc */
#define CXT_SSH 10 /* SSH */
#define CXT_MAX 10 /* Highest connection type */
/* Autodownload Detection Options */
#define ADL_PACK 0 /* Auto-Download detect packet */
#define ADL_STR 1 /* Auto-Download detect string */
/* And finally... */
#ifdef COMMENT /* Make sure this is NOT defined! */
#undef COMMENT
#endif /* COMMENT */
/* zstr zattr filinfo were here (moved to top for DECC 5 Jun 2000) */
#ifndef ZFNQFP /* Versions that have zfnqfp() */
#ifdef UNIX
#define ZFNQFP
#else
#ifdef VMS
#define ZFNQFP
#else
#ifdef OS2
#define ZFNQFP
#else
#ifdef datageneral
#define ZFNQFP
#else
#ifdef STRATUS
#define ZFNQFP
#endif /* STRATUS */
#endif /* datageneral */
#endif /* OS2 */
#endif /* VMS */
#endif /* UNIX */
struct zfnfp {
int len; /* Length of full pathname */
char * fpath; /* Pointer to full pathname */
char * fname; /* Pointer to name part */
};
#endif /* ZFNQFP */
/* Systems that support FILE TYPE LABELED */
#ifdef VMS
#define CK_LABELED
#else
#ifdef OS2
#ifdef __32BIT__
#ifndef NT
#define CK_LABELED
#endif /* NT */
#endif /* __32BIT__ */
#endif /* OS2 */
#endif /* VMS */
/* LABELED FILE options bitmask */
#ifdef VMS /* For VMS */
#define LBL_NAM 1 /* Ignore incoming name if set */
#define LBL_PTH 2 /* Use complete path if set */
#define LBL_ACL 4 /* Preserve ACLs if set */
#define LBL_BCK 8 /* Preserve backup date if set */
#define LBL_OWN 16 /* Preserve ownership if set */
#else
#ifdef OS2 /* Ditto for OS/2 */
#define LBL_NOR 0x0000 /* Normal file */
#define LBL_ARC 0x0020 /* Archive */
#define LBL_DIR 0x0010 /* Directory */
#define LBL_HID 0x0002 /* Hidden file */
#define LBL_RO 0x0001 /* Read only file */
#define LBL_SYS 0x0004 /* System file */
#define LBL_EXT 0x0040 /* Extended */
#endif /* OS2 */
#endif /* VMS */
/*
Data types. First the header file for data types so we can pick up the
types used for pids, uids, and gids. Override this section by putting
-DCKTYP_H=xxx on the command line to specify the header file where your
system defines these types.
*/
#ifndef STRATUS
#ifdef __ALPHA
#ifdef MULTINET
#define CK_TGV_AXP
#endif /* MULTINET */
#endif /* __ALPHA */
#ifdef CK_TGV_AXP /* Alpha, VMS, MultiNet */
/*
Starting in DECC 5.0, <stdlib.h> no longer includes <types.h>.
But before that an elaborate workaround is required, which results in
including <types.h> sometimes but not others, evidently depending on whether
<types.h> protects itself against multiple inclusion, which in turn probably
differentiates between DECC <types.h> and TGV <types.h>. Unfortunately I
don't remember the details. (fdc, 25 Oct 96)
*/
#ifdef COMMENT
/*
Previously the test here was for DEC version prior to 4.0, but since the
test involved an "#if" statement, it was not portable and broke some non-VMS
builds. In any case, condition was never satisfied, so the result of
commenting this section out is the same as the previous "#if" condition.
*/
#ifndef __TYPES_LOADED
#define __TYPES_LOADED /* Work around bug in .h files */
#endif /* __TYPES_LOADED */
#endif /* COMMENT */
#include <sys/types.h>
#ifdef IF_DOT_H
#ifndef MULTINET
#include <if.h> /* Needed to put up u_int typedef */
#endif /* MULTINET */
#else /* IF_DOT_H */
#ifdef NEEDUINT
typedef unsigned int u_int;
#endif /* NEEDUINT */
#endif /* IF_DOT_H */
#else /* !CK_TGV_AXP */
#ifdef OSK /* OS-9 */
#include <types.h>
#else /* General case, not OS-9 */
#ifndef CKTYP_H
#ifndef VMS
#ifndef MAC
#ifndef AMIGA
#define CKTYP_H <sys/types.h>
#endif /* AMIGA */
#endif /* MAC */
#endif /* VMS */
#endif /* CKTYP_H */
#ifdef GEMDOS
#undef CKTYP_H
#include <types.h>
#endif /* GEMDOS */
#ifdef OS2
#undef CKTYP_H
#include <sys/types.h>
#endif /* OS2 */
#ifdef CKTYP_H /* Include it. */
#ifdef COHERENT /* Except for COHERENT */
#include <unistd.h>
#include <sys/types.h>
#else
#ifdef datageneral /* AOS/VS */
#include <sys/types.h>
#else /* All others */
#ifdef __bsdi__ /* BSDI */
#ifdef POSIX
#undef _POSIX_SOURCE
#endif /* POSIX */
#endif /* __bsdi__ */
#include CKTYP_H
#ifdef __bsdi__
#ifdef POSIX
#define _POSIX_SOURCE
#endif /* POSIX */
#endif /* __bsdi__ */
#endif /* datageneral */
#endif /* COHERENT */
#endif /* CKTYP_H */
#endif /* OSK */
#endif /* CK_TGV_AXP */
#endif /* STRATUS */ /* End of types.h section */
/*
File lengths and offsets. This section is expected to grow as we
support long files on 32-bit platforms. We want this data type to be
signed because so many functions return either a file size or a negative
value to indicate an error.
*/
#ifndef CK_OFF_T
#ifdef OS2
#ifdef NT
#define CK_OFF_T __int64
#else
#define CK_OFF_T long
#endif /* NT */
#endif /* OS2 */
#endif /* CK_OFF_T */
/* FreeBSD and OpenBSD set off_t to the appropriate size unconditionally */
#ifndef CK_OFF_T
#ifdef __FreeBSD__
#define CK_OFF_T off_t
#else
#ifdef __OpenBSD__
#define CK_OFF_T off_t
#endif /* __OpenBSD__ */
#endif /* __FreeBSD__ */
#endif /* CK_OFF_T */
/* 32-bit platforms that support long files thru "transitional interface" */
/* These include Linux, Solaris, NetBSD... */
#ifdef AIXRS
#ifdef _LARGE_FILES
#ifndef CK_OFF_T
#define CK_OFF_T off_t
#endif /* CK_OFF_T */
#endif /* _LARGE_FILES */
#endif /* AIXRS */
#ifdef _LARGEFILE_SOURCE
#ifndef CK_OFF_T
#define CK_OFF_T off_t
#endif /* CK_OFF_T */
#ifdef IRIX
#define CKFSEEK(a,b,c) fseek64(a,b,c)
#define CKFTELL(a) ftell64(a)
#else /* IRIX */
#define CKFSEEK(a,b,c) fseeko(a,b,c)
#define CKFTELL(a) ftello(a)
#endif /* IRIX */
#else /* Not _LARGEFILE_SOURCE */
#define CKFSEEK(a,b,c) fseek(a,b,c)
#define CKFTELL(a) ftell(a)
/* See below the next section for the catch-all case */
#endif /* _LARGEFILE_SOURCE */
/* 32-bit or 64-bit platforms */
/* CK_64BIT is a compile-time symbol indicating a true 64-bit build */
/* meaning that longs and pointers are 64 bits */
#ifndef VMS /* VMS Alpha and IA64 are 32-bit! */
#ifndef CK_64BIT
#ifdef _LP64 /* Solaris */
#define CK_64BIT
#else
#ifdef __LP64__ /* MacOS X 10.4 (or _LP64,__ppc64__) */
#define CK_64BIT
#else
#ifdef __arch64__ /* gcc alpha, sparc */
#define CK_64BIT
#else
#ifdef __alpha /* Alpha decc (or __ALPHA) */
#define CK_64BIT
#else
#ifdef __amd64 /* AMD x86_64 */
#define CK_64BIT
#else
#ifdef __x86_64 /* AMD/Intel x86_64 */
#define CK_64BIT
#else
#ifdef __ia64 /* Intel IA64 */
#ifndef HPUX
#define CK_64BIT
#endif /* HPUX */
#endif /* __ia64 */
#endif /* __x86_64 */
#endif /* __amd64 */
#endif /* __alpha */
#endif /* __arch64__ */
#endif /* __LP64__ */
#endif /* _LP64 */
#endif /* CK_64BIT */
#endif /* VMS */
#ifndef CK_OFF_T
#ifdef CK_64BIT
#define CK_OFF_T off_t /* This has to be signed */
#else /* CK_64BIT */
#define CK_OFF_T long /* Signed */
#endif /* CK_64BIT */
#endif /* CK_OFF_T */
#ifndef TLOG
#define tlog(a,b,c,d)
#else
#ifndef CKCMAI
/* Debugging included. Declare debug log flag in main program only. */
extern int tralog, tlogfmt;
#endif /* CKCMAI */
_PROTOTYP(VOID dotlog,(int, char *, char *, CK_OFF_T));
#define tlog(a,b,c,d) if (tralog && tlogfmt) dotlog(a,b,c,(CK_OFF_T)d)
_PROTOTYP(VOID doxlog,(int, char *, CK_OFF_T, int, int, char *));
#endif /* TLOG */
#ifndef DEBUG
/* Compile all the debug() statements away. Saves a lot of space and time. */
#define debug(a,b,c,d)
#define ckhexdump(a,b,c)
/* Now define the debug() macro. */
#else /* DEBUG */
_PROTOTYP(int dodebug,(int,char *,char *,CK_OFF_T));
_PROTOTYP(int dohexdump,(CHAR *,CHAR *,int));
#ifdef IFDEBUG
/* Use this form to avoid function calls: */
#ifdef COMMENT
#define debug(a,b,c,d) if (deblog) dodebug(a,b,(char *)(c),(CK_OFF_T)(d))
#define ckhexdump(a,b,c) if (deblog) dohexdump((CHAR *)(a),(CHAR *)(b),c)
#else
#ifdef CK_ANSIC
#define debug(a,b,c,d) \
((void)(deblog?dodebug(a,b,(char *)(c),(CK_OFF_T)(d)):0))
#define ckhexdump(a,b,c) \
((void)(deblog?dohexdump((CHAR *)(a),(CHAR *)(b),c):0))
#else
#define debug(a,b,c,d) (deblog?dodebug(a,b,(char *)(c),(CK_OFF_T)(d)):0)
#define ckhexdump(a,b,c) (deblog?dohexdump((CHAR *)(a),(CHAR *)(b),c):0)
#endif /* CK_ANSIC */
#endif /* COMMENT */
#else /* IFDEBUG */
/* Use this form to save space: */
#define debug(a,b,c,d) dodebug(a,b,(char *)(c),(CK_OFF_T)(d))
#define ckhexdump(a,b,c) dohexdump((CHAR *)(a),(CHAR *)(b),c)
#endif /* IFDEBUG */
#endif /* DEBUG */
/* Structure definitions for Kermit file attributes */
/* All strings come as pointer and length combinations */
/* Empty string (or for numeric variables, -1) = unused attribute. */
struct zstr { /* string format */
int len; /* length */
char *val; /* value */
};
struct zattr { /* Kermit File Attribute structure */
CK_OFF_T lengthk; /* (!) file length in K */
struct zstr type; /* (") file type (text or binary) */
struct zstr date; /* (#) file creation date yyyymmdd[ hh:mm[:ss]] */
struct zstr creator; /* ($) file creator id */
struct zstr account; /* (%) file account */
struct zstr area; /* (&) area (e.g. directory) for file */
struct zstr password; /* (') password for area */
long blksize; /* (() file blocksize */
struct zstr xaccess; /* ()) file access: new, supersede, append, warn */
struct zstr encoding; /* (*) encoding (transfer syntax) */
struct zstr disp; /* (+) disposition (mail, message, print, etc) */
struct zstr lprotect; /* (,) protection (local syntax) */
struct zstr gprotect; /* (-) protection (generic syntax) */
struct zstr systemid; /* (.) ID for system of origin */
struct zstr recfm; /* (/) record format */
struct zstr sysparam; /* (0) system-dependent parameter string */
CK_OFF_T length; /* (1) exact length on system of origin */
struct zstr charset; /* (2) transfer syntax character set */
#ifdef OS2
struct zstr longname; /* OS/2 longname if applicable */
#endif /* OS2 */
struct zstr reply; /* This goes last, used for attribute reply */
};
/* Kermit file information structure */
struct filinfo {
int bs; /* Blocksize */
int cs; /* Character set */
long rl; /* Record length */
int org; /* Organization */
int fmt; /* Record format */
int cc; /* Carriage control */
int typ; /* Type (text/binary) */
int dsp; /* Disposition */
char *os_specific; /* OS-specific attributes */
#ifdef OS2
unsigned long int lblopts; /* LABELED FILE options bitmask */
#else
int lblopts;
#endif /* OS2 */
};
/*
Data type for pids. If your system uses a different type, put something
like -DPID_T=pid_t on command line, or override here.
*/
#ifndef PID_T
#define PID_T int
#endif /* PID_T */
/*
Data types for uids and gids. Same deal as for pids.
Wouldn't be nice if there was a preprocessor test to find out if a
typedef existed?
*/
#ifdef VMS
/* Not used in VMS so who cares */
#define UID_T int
#define GID_T int
#endif /* VMS */
#ifdef POSIX
/* Or would it be better (or worse?) to use _POSIX_SOURCE here? */
#ifndef UID_T
#define UID_T uid_t
#endif /* UID_T */
#ifndef GID_T
#define GID_T gid_t
#endif /* GID_T */
#else /* Not POSIX */
#ifdef SVR4
/* SVR4 and later have uid_t and gid_t. */
/* SVR3 and earlier use int, or unsigned short, or.... */
#ifndef UID_T
#define UID_T uid_t
#endif /* UID_T */
#ifndef GID_T
#define GID_T gid_t
#endif /* GID_T */
#else /* Not SVR4 */
#ifdef BSD43
#ifndef UID_T
#define UID_T uid_t
#endif /* UID_T */
#ifndef GID_T
#define GID_T gid_t
#endif /* GID_T */
#else /* Not BSD43 */
/* Default these to int for older UNIX versions */
#ifndef UID_T
#define UID_T int
#endif /* UID_T */
#ifndef GID_T
#define GID_T int
#endif /* GID_T */
#endif /* BSD43 */
#endif /* SVR4 */
#endif /* POSIX */
/*
getpwuid() arg type, which is not necessarily the same as UID_T,
e.g. in SCO UNIX SVR3, it's int.
*/
#ifndef PWID_T
#define PWID_T UID_T
#endif /* PWID_T */
#ifdef CK_REDIR
#ifdef NEXT
#define MACHWAIT
#else
#ifdef MACH
#define MACHWAIT
#endif /* MACH */
#endif /* NEXT */
#ifdef MACHWAIT /* WAIT_T argument for wait() */
#include <sys/wait.h>
#define CK_WAIT_H
typedef union wait WAIT_T;
#else
#ifdef POSIX
#ifdef OSF
/* OSF wait.h defines BSD wait if _BSD is defined so hide _BSD from wait.h */
#ifdef _BSD
#define CK_OSF_BSD
#undef _BSD
#endif /* _BSD */
#endif /* OSF */
#include <sys/wait.h>
#define CK_WAIT_H
#ifndef WAIT_T
typedef int WAIT_T;
#endif /* WAIT_T */
#ifdef CK_OSF_BSD /* OSF/1: Restore _BSD definition */
#define _BSD
#undef CK_OSF_BSD
#endif /* CK_OSF_BSD */
#else /* !POSIX */
typedef int WAIT_T;
#endif /* POSIX */
#endif /* MACHWAIT */
#else
typedef int WAIT_T;
#endif /* CK_REDIR */
/* Assorted other blah_t's handled here... */
#ifndef SIZE_T
#define SIZE_T size_t
#endif /* SIZE_T */
/* Forward declarations of system-dependent functions callable from all */
/* C-Kermit modules. */
/* File-related functions from system-dependent file i/o module */
#ifndef CKVFIO_C
/* For some reason, this does not agree with DEC C */
_PROTOTYP( int zkself, (void) );
#endif /* CKVFIO_C */
_PROTOTYP( int zopeni, (int, char *) );
_PROTOTYP( int zopeno, (int, char *, struct zattr *, struct filinfo *) );
_PROTOTYP( int zclose, (int) );
#ifndef MAC
_PROTOTYP( int zchin, (int, int *) );
#endif /* MAC */
_PROTOTYP( int zxin, (int, char *, int) );
_PROTOTYP( int zsinl, (int, char *, int) );
_PROTOTYP( int zinfill, (void) );
_PROTOTYP( int zsout, (int, char*) );
_PROTOTYP( int zsoutl, (int, char*) );
_PROTOTYP( int zsoutx, (int, char*, int) );
_PROTOTYP( int zchout, (int, char) );
_PROTOTYP( int zoutdump, (void) );
_PROTOTYP( int zsyscmd, (char *) );
_PROTOTYP( int zshcmd, (char *) );
#ifdef UNIX
_PROTOTYP( int zsetfil, (int, int) );
_PROTOTYP( int zchkpid, (unsigned long) );
#endif /* UNIX */
#ifdef CKEXEC
_PROTOTYP( VOID z_exec, (char *, char **, int) );
#endif /* CKEXEC */
_PROTOTYP( int chkfn, (int) );
_PROTOTYP( CK_OFF_T zchki, (char *) );
#ifdef VMSORUNIX
_PROTOTYP( CK_OFF_T zgetfs, (char *) );
#else
#ifdef OS2
_PROTOTYP( CK_OFF_T zgetfs, (char *) );
#else
#define zgetfs(a) zchki(a)
#endif /* OS2 */
#endif /* VMSORUNIX */
_PROTOTYP( int iswild, (char *) );
_PROTOTYP( int isdir, (char *) );
_PROTOTYP( int zchko, (char *) );
_PROTOTYP( int zdelet, (char *) );
_PROTOTYP( VOID zrtol, (char *,char *) );
_PROTOTYP( VOID zltor, (char *,char *) );
_PROTOTYP( VOID zstrip, (char *,char **) );
#ifdef VMS
_PROTOTYP( char * zrelname, (char *, char *) );
#endif /* VMS */
_PROTOTYP( int zchdir, (char *) );
_PROTOTYP( char * zhome, (void) );
_PROTOTYP( char * zgtdir, (void) );
_PROTOTYP( int zxcmd, (int, char *) );
#ifndef MAC
_PROTOTYP( int zclosf, (int) );
#endif /* MAC */
#ifdef NZXPAND
#ifdef OS2
/* [jt] 2013/11/21 - CHAR/char conflict between K95 and others */
_PROTOTYP( int nzxpand, (CHAR *, int) );
#else
_PROTOTYP( int nzxpand, (char *, int) );
#endif /* OS2 */
#else /* NZXPAND */
_PROTOTYP( int zxpand, (char *) );
#endif /* NZXPAND */
_PROTOTYP( int znext, (char *) );
#ifdef ZXREWIND
_PROTOTYP( int zxrewind, (void) );
#endif /* ZXREWIND */
_PROTOTYP( int zchkspa, (char *, CK_OFF_T) );
_PROTOTYP( VOID znewn, (char *, char **) );
_PROTOTYP( int zrename, (char *, char *) );
_PROTOTYP( int zcopy, (char *, char *) );
_PROTOTYP( int zsattr, (struct zattr *) );
_PROTOTYP( int zfree, (char *) );
_PROTOTYP( char * zfcdat, (char *) );
_PROTOTYP( int zstime, (char *, struct zattr *, int) );
#ifdef CK_PERMS
_PROTOTYP( char * zgperm, (char *) );
_PROTOTYP( char * ziperm, (char *) );
#endif /* CK_PERMS */
_PROTOTYP( int zmail, (char *, char *) );
_PROTOTYP( int zprint, (char *, char *) );
_PROTOTYP( char * tilde_expand, (char *) );
_PROTOTYP( int zmkdir, (char *) ) ;
_PROTOTYP( int zfseek, (CK_OFF_T) ) ;
#ifdef ZFNQFP
_PROTOTYP( struct zfnfp * zfnqfp, (char *, int, char * ) ) ;
#else
#define zfnqfp(a,b,c) ckstrncpy(c,a,b)
#endif /* ZFNQFP */
_PROTOTYP( int zvuser, (char *) ) ;
_PROTOTYP( int zvpass, (char *) ) ;
_PROTOTYP( VOID zvlogout, (void) ) ;
#ifdef OS2
_PROTOTYP( int os2setlongname, ( char * fn, char * ln ) ) ;
_PROTOTYP( int os2getlongname, ( char * fn, char ** ln ) ) ;
_PROTOTYP( int os2rexx, ( char *, char *, int ) ) ;
_PROTOTYP( int os2rexxfile, ( char *, char *, char *, int) ) ;
_PROTOTYP( int os2geteas, (char *) ) ;
_PROTOTYP( int os2seteas, (char *) ) ;
_PROTOTYP( char * get_os2_vers, (void) ) ;
_PROTOTYP( int do_label_send, (char *) ) ;
_PROTOTYP( int do_label_recv, (void) ) ;
#ifdef OS2MOUSE
_PROTOTYP( unsigned long os2_mouseon, (void) );
_PROTOTYP( unsigned long os2_mousehide, (void) );
_PROTOTYP( unsigned long os2_mouseshow, (void) );
_PROTOTYP( unsigned long os2_mouseoff, (void) );
_PROTOTYP( void os2_mouseevt, (void *) );
_PROTOTYP( int mousebuttoncount, (void));
#endif /* OS2MOUSE */
#endif /* OS2 */
/* Functions from system-dependent terminal i/o module */
_PROTOTYP( int ttopen, (char *, int *, int, int) ); /* tty functions */
#ifndef MAC
_PROTOTYP( int ttclos, (int) );
#endif /* MAC */
_PROTOTYP( int tthang, (void) );
_PROTOTYP( int ttres, (void) );
_PROTOTYP( int ttpkt, (long, int, int) );
#ifndef MAC
_PROTOTYP( int ttvt, (long, int) );
#endif /* MAC */
_PROTOTYP( int ttsspd, (int) );
_PROTOTYP( long ttgspd, (void) );
_PROTOTYP( int ttflui, (void) );
_PROTOTYP( int ttfluo, (void) );
_PROTOTYP( int ttpushback, (CHAR *, int) );
_PROTOTYP( int ttpeek, (void) );
_PROTOTYP( int ttgwsiz, (void) );
_PROTOTYP( int ttchk, (void) );
_PROTOTYP( int ttxin, (int, CHAR *) );
_PROTOTYP( int ttxout, (CHAR *, int) );
_PROTOTYP( int ttol, (CHAR *, int) );
_PROTOTYP( int ttoc, (char) );
_PROTOTYP( int ttinc, (int) );
_PROTOTYP( int ttscarr, (int) );
_PROTOTYP( int ttgmdm, (void) );
_PROTOTYP( int ttsndb, (void) );
_PROTOTYP( int ttsndlb, (void) );
#ifdef UNIX
_PROTOTYP( char * ttglckdir, (void) );
#endif /* UNIX */
#ifdef PARSENSE
#ifdef UNIX
_PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
#else
#ifdef VMS
_PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
#else
#ifdef STRATUS
_PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
#else
#ifdef OS2
_PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
#else
#ifdef OSK
_PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
#else
_PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR) );
#endif /* OSK */
#endif /* OS2 */
#endif /* STRATUS */
#endif /* VMS */
#endif /* UNIX */
#else /* ! PARSENSE */
_PROTOTYP( int ttinl, (CHAR *, int, int, CHAR) );
#endif /* PARSENSE */
/* XYZMODEM support */
/*
CK_XYZ enables the various commands and data structures.
XYZ_INTERNAL means these protocols are built-in; if not defined,
then they are external. XYZ_DLL is used to indicate a separate
loadable library containing the XYZmodem protocol code.
*/
#ifdef pdp11 /* No room for this in PDP-11 */
#define NOCKXYZ
#endif /* pdp11 */
#ifndef NOCKXYZ /* Alternative protocols */
#ifndef CK_XYZ
#ifdef UNIX
#define CK_XYZ
#else
#ifdef OS2
#define CK_XYZ
#ifndef NOXYZDLL
#define XYZ_INTERNAL /* Internal and DLL */
#define XYZ_DLL
#endif /* NOXYZDLL */
#endif /* OS2 */
#endif /* UNIX */
#endif /* CK_XYZ */
#endif /* NOCKXYZ */
#ifdef XYZ_INTERNAL /* This ensures that XYZ_INTERNAL */
#ifndef CK_XYZ /* is defined only if CK_XYZ is too */
#undef XYZ_INTERNAL
#endif /* CK_XYZ */
#endif /* XYZ_INTERNAL */
#ifdef XYZ_DLL /* This ensures XYZ_DLL is defined */
#ifndef XYZ_INTERNAL /* only if XYZ_INTERNAL is too */
#undef XYZ_DLL
#endif /* XYZ_INTERNAL */
#endif /* XYZ_DLL */
/* Console functions */
_PROTOTYP( int congm, (void) );
#ifdef COMMENT
_PROTOTYP( VOID conint, (SIGTYP (*)(int, int), SIGTYP (*)(int, int)) );
#else
_PROTOTYP( VOID conint, (SIGTYP (*)(int), SIGTYP (*)(int)) );
#endif /* COMMENT */
_PROTOTYP( VOID connoi, (void) );
_PROTOTYP( int concb, (char) );
#ifdef CONGSPD
_PROTOTYP( long congspd, (void) );
#endif /* CONGSPD */
_PROTOTYP( int conbin, (char) );
_PROTOTYP( int conres, (void) );
_PROTOTYP( int conoc, (char) );
_PROTOTYP( int conxo, (int, char *) );
_PROTOTYP( int conol, (char *) );
_PROTOTYP( int conola, (char *[]) );
_PROTOTYP( int conoll, (char *) );
_PROTOTYP( int conchk, (void) );
_PROTOTYP( int coninc, (int) );
_PROTOTYP( char * conkbg, (void) );
_PROTOTYP( int psuspend, (int) );
_PROTOTYP( int priv_ini, (void) );
_PROTOTYP( int priv_on, (void) );
_PROTOTYP( int priv_off, (void) );
_PROTOTYP( int priv_can, (void) );
_PROTOTYP( int priv_chk, (void) );
_PROTOTYP( int priv_opn, (char *, int) );
_PROTOTYP( int sysinit, (void) ); /* Misc Kermit functions */
_PROTOTYP( int syscleanup, (void) );
_PROTOTYP( int msleep, (int) );
_PROTOTYP( VOID rtimer, (void) );
_PROTOTYP( int gtimer, (void) );
#ifdef GFTIMER
_PROTOTYP( VOID rftimer, (void) );
_PROTOTYP( CKFLOAT gftimer, (void) );
#endif /* GFTIMER */
_PROTOTYP( VOID ttimoff, (void) );
_PROTOTYP( VOID ztime, (char **) );
_PROTOTYP( int parchk, (CHAR *, CHAR, int) );
_PROTOTYP( VOID doexit, (int, int) );
_PROTOTYP( int askmore, (void) );
_PROTOTYP( VOID fatal, (char *) );
_PROTOTYP( VOID fatal2, (char *, char *) );
#ifdef VMS
_PROTOTYP( int ck_cancio, (void) );
#endif /* VMS */
/* Key mapping support */
#ifdef NOICP
#ifndef NOSETKEY
#define NOSETKEY
#endif /* NOSETKEY */
#endif /* NOICP */
#ifdef MAC
#ifndef NOSETKEY
#define NOSETKEY
#endif /* NOSETKEY */
#endif /* MAC */
_PROTOTYP( int congks, (int) );
#ifdef OS2
/* OS2 requires these definitions even if SET KEY is not being supported */
#define KMSIZE 8916
typedef ULONG KEY;
typedef CHAR *MACRO;
extern int wideresult;
#else /* Not OS2 */
#ifndef NOSETKEY
/*
Catch-all for systems where we don't know how to read keyboard scan
codes > 255.
*/
#define KMSIZE 256
/* Note: CHAR (i.e. unsigned char) is very important here. */
typedef CHAR KEY;
typedef CHAR * MACRO;
#define congks coninc
#endif /* NOSETKEY */
#endif /* OS2 */
#ifndef OS2
#ifndef NOKVERBS /* No \Kverbs unless... */
#define NOKVERBS
#endif /* NOKVERBS */
#endif /* OS2 */
#ifndef NOKVERBS
#ifdef OS2
/*
Note: this value chosen to be bigger than PC BIOS key modifier bits,
but still fit in 16 bits without affecting sign.
As of K95 1.1.5, this no longer fits in 16 bits, good thing we are 32 bit.
*/
#define F_MACRO 0x2000 /* Bit indicating a macro indice */
#define IS_MACRO(x) (x & F_MACRO)
#define F_KVERB 0x4000 /* Bit indicating a keyboard verb */
#define IS_KVERB(x) (x & F_KVERB) /* Test this bit */
#endif /* OS2 */
#endif /* NOKVERBS */
#define F_ESC 0x8000 /* Bit indicating ESC char combination */
#define IS_ESC(x) (x & F_ESC)
#define F_CSI 0x10000 /* Bit indicating CSI char combination */
#define IS_CSI(x) (x & F_CSI)
#ifdef NOSPL /* This might be overkill.. */
#ifndef NOKVERBS /* Not all \Kverbs require */
#define NOKVERBS /* the script programming language. */
#endif /* NOKVERBS */
#ifndef NOTAKEARGS
#define NOTAKEARGS
#endif /* NOTAKEARGS */
#endif /* NOSPL */
/*
Function prototypes for system and library functions.
*/
#ifdef _POSIX_SOURCE
#ifndef VMS
#ifndef MAC
#define CK_ANSILIBS
#endif /* MAC */
#endif /* VMS */
#endif /* _POSIX_SOURCE */
#ifdef NEXT
#define CK_ANSILIBS
#endif /* NEXT */
#ifdef SVR4
#define CK_ANSILIBS
#endif /* SVR4 */
#ifdef STRATUS /* Stratus VOS uses ANSI libraries */
#define CK_ANSILIBS
#endif /* STRATUS */
#ifdef OS2
#define CK_ANSILIBS
#ifndef NOCURSES
#define MYCURSES
#endif /* NOCURSES */
#define CK_RTSCTS
#ifdef __IBMC__
#define S_IFMT 0xF000
#define timezone _timezone
#endif /* __IBMC__ */
#include <fcntl.h>
#include <io.h>
#ifdef __EMX__
#ifndef __32BIT__
#define __32BIT__
#endif /* __32BIT__ */
#include <sys/timeb.h>
#else /* __EMX__ */
#include <direct.h>
#undef SIGALRM
#ifndef SIGUSR1
#define SIGUSR1 7
#endif /* SIGUSR1 */
#define SIGALRM SIGUSR1
_PROTOTYP( unsigned alarm, (unsigned) );
_PROTOTYP( unsigned sleep, (unsigned) );
#endif /* __EMX__ */
_PROTOTYP( unsigned long zdskspace, (int) );
_PROTOTYP( int zchdsk, (int) );
_PROTOTYP( int conincraw, (int) );
_PROTOTYP( int ttiscom, (int f) );
_PROTOTYP( int IsFileNameValid, (char *) );
_PROTOTYP( void ChangeNameForFAT, (char *) );
_PROTOTYP( char *GetLoadPath, (void) );
#endif /* OS2 */
/* Fullscreen file transfer display items... */
#ifndef NOCURSES
#ifdef CK_NCURSES /* CK_NCURSES implies CK_CURSES */
#ifndef CK_CURSES
#define CK_CURSES
#endif /* CK_CURSES */
#endif /* CK_NCURSES */
#ifdef MYCURSES /* MYCURSES implies CK_CURSES */
#ifndef CK_CURSES
#define CK_CURSES
#endif /* CK_CURSES */
#endif /* MYCURSES */
#endif /* NOCURSES */
#ifdef NOCURSES
#ifdef CK_CURSES
#undef CK_CURSES
#endif /* CK_CURSES */
#ifndef NODISPLAY
#define NODISPLAY
#endif /* NODISPLAY */
#endif /* NOCURSES */
#ifdef CK_CURSES
/*
The CK_WREFRESH symbol is defined if the curses library provides
clearok() and wrefresh() functions, which are used in repainting
the screen.
*/
#ifdef NOWREFRESH /* Override CK_WREFRESH */
#ifdef CK_WREFRESH /* If this is defined, */
#undef CK_WREFRESH /* undefine it. */
#endif /* CK_WREFRESH */
#else /* !NOWREFRESH */ /* No override... */
#ifndef CK_WREFRESH /* If CK_WREFRESH not defined */
/*
Automatically define it for systems known to have it ...
*/
#ifdef VMS /* DEC (Open)VMS has it */
#define CK_WREFRESH
#else
#ifdef ultrix /* DEC ULTRIX has it */
#else
#ifdef SVR3 /* System V has it */
#define CK_WREFRESH
#else
#ifdef BSD44 /* 4.4 BSD has it */
#define CK_WREFRESH
#else
#ifdef NEXT /* Define it for NeXTSTEP */
#define CK_WREFRESH
#else
#ifdef SUNOS4 /* SunOS 4.x... */
#define CK_WREFRESH
#else
#ifdef SOLARIS25 /* Solaris 2.5 and later */
#define CK_WREFRESH
#else
#ifdef AIXRS /* RS/6000 AIX ... */
#define CK_WREFRESH
#else
#ifdef RTAIX /* RT PC AIX ... */
#define CK_WREFRESH
#else
#ifdef OSF /* DEC OSF/1 ... */
#define CK_WREFRESH
/* Add more here, or just define CK_WREFRESH on the CC command line... */
#endif /* OSF */
#endif /* RTAIX */
#endif /* AIXRS */
#endif /* SOLARIS25 */
#endif /* SUNOS4 */
#endif /* NEXT */
#endif /* BSD44 */
#endif /* SVR3 */
#endif /* ultrix */
#endif /* VMS */
#else /* CK_WREFRESH is defined */
/* This is within an ifdef CK_CURSES block. The following is not needed */
#ifndef CK_CURSES /* CK_WREFRESH implies CK_CURSES */
#define CK_CURSES
#endif /* CK_CURSES */
#endif /* CK_WREFRESH */
#endif /* NOWREFRESH */
#ifndef TRMBUFL
#ifdef BIGBUFOK
#define TRMBUFL 16384
#else
#ifdef DYNAMIC
#define TRMBUFL 8192
#else
#define TRMBUFL 1024
#endif /* BIGBUFOK */
#endif /* DYNAMIC */
#endif /* TRMBUFL */
#endif /* CK_CURSES */
/*
Whether to use ckmatch() in all its glory for C-Shell-like patterns.
If CKREGEX is NOT defined, all but * and ? matching are removed from
ckmatch(). NOTE: Defining CKREGEX does not necessarily mean that ckmatch()
regexes are used for filename matching. That depends on whether zxpand()
in ck?fio.c calls ckmatch(). NOTE 2: REGEX is a misnomer -- these are not
regular expressions in the computer-science sense (in which, e.g. "a*b"
matches 0 or more 'a' characters followed by 'b') but patterns (in which
"a*b" matches 'a' followed by 0 or more non-b characters, followed by b).
*/
#ifndef NOCKREGEX
#ifndef CKREGEX
#define CKREGEX
#endif /* CKREGEX */
#endif /* NOCKREGEX */
/* Learned-script feature */
#ifndef NOLEARN
#ifdef NOSPL
#define NOLEARN
#else
#ifdef NOLOCAL
#define NOLEARN
#endif /* NOLOCAL */
#endif /* NOSPL */
#endif /* NOLEARN */
#ifdef NOLEARN
#ifdef CKLEARN
#undef CKLEARN
#endif /* CKLEARN */
#else /* !NOLEARN */
#ifndef CKLEARN
#ifdef OS2ORUNIX
/* In UNIX this can work only with ckucns.c builds */
#define CKLEARN
#else
#ifdef VMS
#define CKLEARN
#endif /* VMS */
#endif /* OS2ORUNIX */
#endif /* CKLEARN */
#endif /* NOLEARN */
#ifdef CKLEARN
#ifndef LEARNBUFSIZ
#define LEARNBUFSIZ 128
#endif /* LEARNBUFSIZ */
#endif /* CKLEARN */
#ifndef IKSDONLY
#ifndef CKTIDLE /* Pseudo-keepalive in CONNECT */
#ifdef OS2 /* In K95 */
#define CKTIDLE
#else
#ifdef UNIX /* In UNIX but only ckucns versions */
#ifndef NOLEARN
#ifndef NOSELECT
#define CKTIDLE
#endif /* NOSELECT */
#endif /* NOLEARN */
#endif /* UNIX */
#endif /* OS2 */
#endif /* CKTIDLE */
#endif /* IKSDONLY */
#ifdef CK_ANSILIBS
/*
String library functions.
For ANSI C, get prototypes from <string.h>.
Otherwise, skip the prototypes.
*/
#include <string.h>
/*
Prototypes for other commonly used library functions, such as
malloc, free, getenv, atol, atoi, and exit. Otherwise, no prototypes.
*/
#include <stdlib.h>
#ifdef DIAB /* DIAB DS90 */
/* #include <commonC.h> */
#include <sys/wait.h>
#define CK_WAIT_H
#ifdef COMMENT
extern void exit(int status);
extern void _exit(int status);
extern int uname(struct utsname *name);
#endif /* COMMENT */
extern int chmod(char *path, int mode);
extern int ioctl(int fildes, int request, ...);
extern int rdchk(int ttyfd);
extern int nap(int m);
#ifdef COMMENT
extern int getppid(void);
#endif /* COMMENT */
extern int _filbuf(FILE *stream);
extern int _flsbuf(char c,FILE *stream);
#endif /* DIAB */
/*
Prototypes for UNIX functions like access, alarm, chdir, sleep, fork,
and pause. Otherwise, no prototypes.
*/
#ifdef VMS
#include <signal.h> /* SMS: sleep() for old (V4.0-000) DEC C. */
#include <unixio.h>
#include <unixlib.h> /* SMS: getpid() for old (V4.0-000) DEC C. */
#endif /* VMS */
#ifdef NEXT
#ifndef NEXT33
#include <libc.h>
#endif /* NEXT33 */
#else /* NoT NeXT */
#ifndef AMIGA
#ifndef OS2
#ifdef STRATUS
#include <c_utilities.h>
#else /* !STRATUS */
#ifndef OSKXXC
#include <unistd.h>
#endif /* OSKXXC */
#ifdef HAVE_CRYPT_H
#include <crypt.h>
#endif /* HAVE_CRYPT_H */
#endif /* STRATUS */
#endif /* OS2 */
#endif /* AMIGA */
#endif /* NEXT */
#else /* Not ANSI libs... */
#ifdef MAC
#include <String.h>
#include <StdLib.h>
#endif /* MAC */
#ifdef HPUX
#ifndef HPUXPRE65
#include <unistd.h>
#endif /* HPUXPRE65 */
#endif /* HPUX */
#ifdef SUNOS41
#include <unistd.h>
#include <stdlib.h>
#else
#ifndef MAC
/*
It is essential that these are declared correctly!
Which is not always easy. Take malloc() for instance ...
*/
#ifdef PYRAMID
#ifdef SVR4
#ifdef __STDC__
#define SIZE_T_MALLOC
#endif /* __STDC__ */
#endif /* SVR4 */
#endif /* PYRAMID */
/*
Maybe some other environments need the same treatment for malloc.
If so, define SIZE_T_MALLOC for them here or in compiler CFLAGS.
*/
#ifdef SIZE_T_MALLOC
_PROTOTYP( void * malloc, (size_t) );
#else
_PROTOTYP( char * malloc, (unsigned int) );
#endif /* SIZE_T_MALLOC */
_PROTOTYP( char * getenv, (char *) );
_PROTOTYP( long atol, (char *) );
#endif /* !MAC */
#endif /* SUNOS41 */
#endif /* CK_ANSILIBS */
/*
<sys/param.h> generally picks up NULL, MAXPATHLEN, and MAXNAMLEN
and seems to present on all Unixes going back at least to SCO Xenix
with the exception(s) noted.
*/
#ifndef NO_PARAM_H /* 2001-11-03 */
#ifndef UNIX /* Non-Unixes don't have it */
#define NO_PARAM_H
#else
#ifdef TRS16 /* Tandy Xenix doesn't have it */
#define NO_PARAM_H
#endif /* TRS16 */
#endif /* UNIX */
#endif /* NO_PARAM_H */
#ifndef NO_PARAM_H
#ifndef INCL_PARAM_H
#define INCL_PARAM_H
#endif /* INCL_PARAM_H */
#include <sys/param.h>
#endif /* NO_PARAM_H */
#ifndef NULL /* In case NULL is still not defined */
#define NULL 0L
/* or #define NULL 0 */
/* or #define NULL ((char *) 0) */
/* or #define NULL ((void *) 0) */
#endif /* NULL */
/* Macro to differentiate "" from NULL (to avoid comparisons with literals) */
#ifndef isemptystring
#define isemptystring(s) ((s?(*s?0:1):0))
#endif /* isemptystring */
/* Maximum length for a fully qualified filename, not counting \0 at end. */
/*
This is a rough cut, and errs on the side of being too big. We don't
want to pull in hundreds of header files looking for many and varied
symbols, for fear of introducing unnecessary conflicts.
*/
#ifndef CKMAXPATH
#ifdef VMS /* VMS may have bad (small, ODS2) */
#define CKMAXPATH NAMX_C_MAXRSS /* PATH_MAX, so use NAMX_C_MAXRSS. */
#else /* def VMS */
#ifdef MAXPATHLEN /* (it probably isn't) */
#define CKMAXPATH MAXPATHLEN
#else
#ifdef PATH_MAX /* POSIX */
#define CKMAXPATH PATH_MAX
#else /* def PATH_MAX */
#ifdef MAC
#define CKMAXPATH 63
#else /* def MAC */
#ifdef pdp11
#define CKMAXPATH 255
#else /* def pdp11 */
#ifdef UNIX /* Even though some are way less... */
#define CKMAXPATH 1024
#else /* def UNIX */
#ifdef STRATUS
#define CKMAXPATH 256 /* == $MXPL from PARU.H */
#else /* def STRATUS */
#ifdef datageneral
#define CKMAXPATH 256 /* == $MXPL from PARU.H */
#else /* def datageneral */
#define CKMAXPATH 255
#endif /* def STRATUS [else] */
#endif /* def datageneral [else] */
#endif /* def UNIX [else] */
#endif /* def pdp11 [else] */
#endif /* def MAC [else] */
#endif /* def PATH_MAX [else] */
#endif /* def MAXPATHLEN [else] */
#endif /* def VMS [else] */
#endif /* ndef CKMAXPATH */
/* Maximum length for the name of a tty device */
#ifndef DEVNAMLEN
#define DEVNAMLEN CKMAXPATH
#endif /* DEVNAMLEN */
/* Directory (path segment) separator */
/* Not fully general - Tricky for VMS, Amiga, ... */
#ifndef DIRSEP
#ifdef UNIX
#define DIRSEP '/'
#define STRDIRSEP "/"
#define ISDIRSEP(c) ((c)=='/')
#else
#ifdef OS2
#define DIRSEP '/'
#define STRDIRSEP "/"
#define ISDIRSEP(c) ((c)=='/'||(c)=='\\')
#else
#ifdef datageneral
#define DIRSEP ':'
#define STRDIRSEP ":"
#define ISDIRSEP(c) (((c)==':')||((c)=='^')||((c)=='='))
#else
#ifdef STRATUS
#define DIRSEP '>'
#define ISDIRSEP(c) ((c)=='>')
#else
#ifdef VMS
#define DIRSEP ']' /* (not really) */
#define ISDIRSEP(c) ((c)==']'||(c)==':')
#else
#ifdef MAC
#define DIRSEP ':'
#define ISDIRSEP(c) ((c)==':')
#else
#ifdef AMIGA
#define STRDIRSEP "/"
#define ISDIRSEP(c) ((c)=='/'||(c)==':')
#else
#ifdef GEMDOS
#define DIRSEP '\\'
#define STRDIRSEP "\\"
#define ISDIRSEP(c) ((c)=='\\'||(c)==':')
#else
#define DIRSEP '/'
#define STRDIRSEP "/"
#define ISDIRSEP(c) ((c)=='/')
#endif /* GEMDOS */
#endif /* AMIGA */
#endif /* MAC */
#endif /* VMS */
#endif /* STRATUS */
#endif /* datageneral */
#endif /* OS2 */
#endif /* UNIX */
#endif /* DIRSEP */
/* FILE package parameters */
#ifdef pdp11
#define NOCHANNELIO
#else
#ifndef CKMAXOPEN
#ifdef QNX
#define CKMAXOPEN 390
#else
#ifdef VMS
#define CKMAXOPEN 64
#else
#ifdef OPEN_MAX
#define CKMAXOPEN OPEN_MAX
#else
#ifdef FOPEN_MAX
#define CKMAXOPEN FOPEN_MAX
#else
#define CKMAXOPEN 64
#endif /* FOPEN_MAX */
#endif /* OPEN_MAX */
#endif /* VMS */
#endif /* QNX */
#endif /* CKMAXOPEN */
/* Maximum channels for FOPEN = CKMAXOPEN minus logs, stdio, etc */
#ifndef Z_MINCHAN
#define Z_MINCHAN 16
#endif /* Z_MINCHAN */
#ifndef Z_MAXCHAN
#define Z_MAXCHAN (CKMAXOPEN-ZNFILS-5)
#endif /* Z_MAXCHAN */
#endif /* pdp11 */
/* New-format nzltor() and nzrtol() functions that handle pathnames */
#ifndef NZLTOR
#ifdef UNIX
#define NZLTOR
#else
#ifdef VMS
#define NZLTOR
#else
#ifdef OS2
#define NZLTOR
#else
#ifdef STRATUS
#define NZLTOR
#endif /* STRATUS */
#endif /* OS2 */
#endif /* VMS */
#endif /* UNIX */
#endif /* NZLTOR */
#ifdef NZLTOR
_PROTOTYP( VOID nzltor, (char *, char *, int, int, int) );
_PROTOTYP( VOID nzrtol, (char *, char *, int, int, int) );
#endif /* NZLTOR */
/* Implementations with a zrmdir() function */
#ifndef ZRMDIR
#ifdef OS2
#define ZRMDIR
#else /* OS2 */
#ifdef UNIX
#define ZRMDIR
#else
#ifdef VMS
#define ZRMDIR
#else /* VMS */
#ifdef STRATUS
#define ZRMDIR
#endif /* STRATUS */
#endif /* VMS */
#endif /* UNIX */
#endif /* OS2 */
#endif /* ZRMDIR */
#ifdef ZRMDIR
_PROTOTYP( int zrmdir, (char *) );
#endif /* ZRMDIR */
#ifndef FILECASE
#ifdef UNIXOROSK
#define FILECASE 1
#else
#define FILECASE 0
#endif /* UNIXOROSK */
#ifndef CKCMAI
extern int filecase;
#endif /* CKCMAI */
#endif /* FILECASE */
/* Funny names for library functions department... */
#ifdef ZILOG
#define setjmp setret
#define longjmp longret
#define jmp_buf ret_buf
#define getcwd curdir
#endif /* ZILOG */
#ifdef STRATUS
/* The C-runtime conflicts with things we do in Stratus VOS ckltio.c ... */
#define printf vosprtf
_PROTOTYP( int vosprtf, (char *fmt, ...) );
#define perror(txt) printf("%s\n", txt)
/* char_varying is a string type from PL/I that VOS uses extensively */
#define CV char_varying
#endif /* STRATUS */
#ifdef NT
extern int OSVer;
#define isWin95() (OSVer==VER_PLATFORM_WIN32_WINDOWS)
#else
#define isWin95() (0)
#endif /* NT */
#ifndef BPRINT
#ifdef OS2
#define BPRINT
#endif /* OS2 */
#endif /* BPRINT */
#ifndef SESLIMIT
#ifdef OS2
#define SESLIMIT
#endif /* OS2 */
#endif /* SESLIMIT */
#ifndef NOTERM
#ifndef PCTERM
#ifdef NT
#define PCTERM
#endif /* NT */
#endif /* PCTERM */
#endif /* NOTERM */
#ifdef BEOSORBEBOX
#define query ckquery
#endif /* BEOSORBEBOX */
#ifndef PTYORPIPE /* NETCMD and/or NETPTY defined */
#ifdef NETCMD
#define PTYORPIPE
#else
#ifdef NETPTY
#define PTYORPIPE
#endif /* NETPTY */
#endif /* NETCMD */
#endif /* PTYORPIPE */
/* mktemp() and mkstemp() */
#ifndef NOMKTEMP
#ifndef MKTEMP
#ifdef OS2ORUNIX
#define MKTEMP
#endif /* OS2ORUNIX */
#endif /* MKTEMP */
#ifdef MKTEMP
#ifndef NOMKSTEMP
#ifndef MKSTEMP
#ifdef BSD44
#define MKSTEMP
#else
#ifdef __linux__
#define MKSTEMP
#endif /* __linux__ */
#endif /* BSD44 */
#endif /* MKSTEMP */
#endif /* NOMKSTEMP */
#endif /* MKTEMP */
#endif /* NOMKTEMP */
/* Platforms that have memcpy() -- only after all headers included */
#ifndef USE_MEMCPY
#ifdef VMS
#define USE_MEMCPY
#else
#ifdef NEXT
#define USE_MEMCPY
#else
#ifdef OS2
#define USE_MEMCPY
#else
#ifdef __linux__
#define USE_MEMCPY
#else
#ifdef SOLARIS
#define USE_MEMCPY
#else
#ifdef SUNOS4
#define USE_MEMCPY
#else
#ifdef AIXRS
#define USE_MEMCPY
#else
#ifdef HPUX
#define USE_MEMCPY
#else
#ifdef POSIX
#define USE_MEMCPY
#else
#ifdef SVR4
#define USE_MEMCPY
#else
#ifdef OSF
#define USE_MEMCPY
#else
#ifdef datageneral
#define USE_MEMCPY
#else
#ifdef STRATUS
#define USE_MEMCPY
#endif /* STRATUS */
#endif /* datageneral */
#endif /* OSF */
#endif /* SVR4 */
#endif /* POSIX */
#endif /* HPUX */
#endif /* AIXRS */
#endif /* SUNOS4 */
#endif /* SOLARIS */
#endif /* __linux__ */
#endif /* OS2 */
#endif /* NEXT */
#endif /* VMS */
#endif /* USE_MEMCPY */
#ifndef USE_MEMCPY
#define memcpy(a,b,c) ckmemcpy((a),(b),(c))
#else
#ifdef CK_SCO32V4
/* Because the prototype isn't picked up in the normal header files */
_PROTOTYP( void *memcpy, (void *, const void *, size_t));
#endif /* CK_SCO32V4 */
#endif /* USE_MEMCPY */
/* User authentication for IKS -- So far K95 and UNIX only */
#ifdef NOICP
#ifndef NOLOGIN
#define NOLOGIN
#endif /* NOLOGIN */
#endif /* NOICP */
#ifndef NOLOGIN
#ifdef OS2ORUNIX
#ifndef CK_LOGIN
#define CK_LOGIN
#ifndef NOSHADOW
#ifdef CK_SCOV5
#define CK_SHADOW
#endif /* CK_SCOV5 */
#endif /* NOSHADOW */
#endif /* CK_LOGIN */
#ifdef NT
#define NTCREATETOKEN
#endif /* NT */
#endif /* OS2ORUNIX */
#else /* NOLOGIN */
#ifdef CK_LOGIN
#undef CK_LOGIN
#endif /* CK_LOGIN */
#endif /* NOLOGIN */
#ifdef OS2
#define CKSPINNER
#endif /* OS2 */
#ifdef CK_LOGIN /* Telnet protocol required */
#ifndef TNCODE /* for login to IKSD. */
#define TNCODE
#endif /* TNCODE */
#endif /* CK_LOGIN */
#ifdef CK_AUTHENTICATION
#ifdef NOSENDUID
#undef NOSENDUID
#endif /* NOSENDUID */
#endif /* CK_AUTHENTICATION */
#ifdef TNCODE /* Should TELNET send user ID? */
#ifndef NOSENDUID
#ifndef CKSENDUID
#define CKSENDUID
#endif /* CKSENDUID */
#endif /* NOSENDUID */
#endif /* TNCODE */
/* UNIX platforms that don't have getusershell() */
#ifdef UNIX
#ifndef NOGETUSERSHELL
#ifdef IRIX
#define NOGETUSERSHELL
#else
#ifdef PTX
#define NOGETUSERSHELL
#else
#ifdef AIXRS
#define NOGETUSERSHELL
#else
#ifdef SINIX
#define NOGETUSERSHELL
#else
#ifdef UNIXWARE
#define NOGETUSERSHELL
#else
#ifdef COHERENT
#define NOGETUSERSHELL
#endif /* COHERENT */
#endif /* UNIXWARE */
#endif /* SINIX */
#endif /* AIXRS */
#endif /* PTX */
#endif /* IRIX */
#endif /* NOGETUSERSHELL */
#endif /* UNIX */
#ifdef CK_LOGIN
#ifdef NT
#ifndef NOSYSLOG
#ifndef CKSYSLOG
#define CKSYSLOG
#endif /* CKSYSLOG */
#endif /* NOSYSLOG */
#endif /* NT */
#ifdef UNIX
#ifndef NOSYSLOG
#ifndef CKSYSLOG
#define CKSYSLOG
#endif /* CKSYSLOG */
#endif /* NOSYSLOG */
#ifndef NOWTMP
#ifndef CKWTMP
#define CKWTMP
#endif /* CKWTMP */
#endif /* NOWTMP */
#ifndef NOGETUSERSHELL
#ifndef GETUSERSHELL
#define GETUSERSHELL
#endif /* GETUSERSHELL */
#endif /* NOGETUSERSHELL */
#endif /* UNIX */
_PROTOTYP( int ckxlogin, (CHAR *, CHAR *, CHAR *, int));
_PROTOTYP( int ckxlogout, (VOID));
#endif /* CK_LOGIN */
#ifndef NOZLOCALTIME /* zlocaltime() available. */
#ifdef OS2ORUNIX
#define ZLOCALTIME
_PROTOTYP( char * zlocaltime, (char *) );
#endif /* OS2ORUNIX */
#endif /* NOZLOCALTIME */
#ifdef CKSYSLOG /* Syslogging levels */
#define SYSLG_NO 0 /* No logging */
#define SYSLG_LI 1 /* Login/out */
#define SYSLG_DI 2 /* Dialing out */
#define SYSLG_AC 3 /* Making any kind of connection */
#define SYSLG_PR 4 /* Protocol Operations */
#define SYSLG_FC 5 /* File creation */
#define SYSLG_FA 6 /* File reading */
#define SYSLG_CM 7 /* Top-level commands */
#define SYSLG_CX 8 /* All commands */
#define SYSLG_DB 9 /* Debug */
#define SYSLGMAX 9 /* Highest level */
#define SYSLG_DF SYSLG_FA /* Default level */
/* Logging function */
_PROTOTYP(VOID cksyslog,(int, int, char *, char *, char *));
#endif /* CKSYSLOG */
#ifndef CKCMAI
extern int ckxlogging, ckxsyslog, ikdbopen;
#endif /* CKCMAI */
#ifndef CK_KEYTAB
#define CK_KEYTAB
/* Keyword Table Template */
/* Note: formerly defined in ckucmd.h but now more widely used */
struct keytab { /* Keyword table */
char *kwd; /* Pointer to keyword string */
int kwval; /* Associated value */
int flgs; /* Flags (as defined above) */
};
#endif /* CK_KEYTAB */
#ifdef UNIX
_PROTOTYP( int isalink, (char *));
#endif /* UNIX */
#ifdef NETPTY
_PROTOTYP( int do_pty, (int *, char *, int));
_PROTOTYP( VOID end_pty, (void));
#endif /* NETPTY */
#ifdef CKROOT
_PROTOTYP( int zsetroot, (char *) );
_PROTOTYP( char * zgetroot, (void) );
_PROTOTYP( int zinroot, (char *) );
#endif /* CKROOT */
/* Local Echo Buffer prototypes */
_PROTOTYP( VOID le_init, (void) );
_PROTOTYP( VOID le_clean, (void));
_PROTOTYP( int le_inbuf, (void));
_PROTOTYP( int le_putstr, (CHAR *));
_PROTOTYP( int le_puts, (CHAR *, int));
_PROTOTYP( int le_putchar, (CHAR));
_PROTOTYP( int le_getchar, (CHAR *));
/* #ifndef NOHTTP */
#ifndef NOCMDATE2TM
#ifndef CMDATE2TM
#ifdef OS2ORUNIX
#define CMDATE2TM
#endif /* OS2ORUNIX */
#ifdef VMS
#define CMDATE2TM
#endif /* VMS */
#endif /* CMDATE2TM */
#endif /* NOCMDATE2TM */
#ifndef NOLOCALE
#ifdef BSD44ORPOSIX
#ifndef NO_NL_LANGINFO
#ifndef HAVE_LOCALE
#define HAVE_LOCALE
#include <locale.h>
#endif /* HAVE_LOCALE */
#endif /* NO_NL_LANGINFO */
#endif /* BSD44ORPOSIX */
#endif /* NOLOCALE */
#ifdef CMDATE2TM
_PROTOTYP( struct tm * cmdate2tm, (char *,int));
#endif /* CMDATE2TM */
/* #endif */ /* NOHTTP */
#ifndef NOSETTIME /* This would be set in CFLAGS */
#ifdef SVR4ORPOSIX /* Defined in IEEE 1003.1-1996 */
#ifndef UTIMEH /* and in SVID for SVR4 */
#define UTIMEH
#endif /* UTIMEH */
#else /* SVR4ORPOSIX */
#ifdef OSF /* Verified by Lucas Hart */
#ifndef UTIMEH
#define UTIMEH
#endif /* UTIMEH */
#else /* OSF */
#ifdef SUNOS41 /* Verified by Lucas Hart */
#ifndef UTIMEH
#define UTIMEH
#endif /* UTIMEH */
#else /* SUNOS41 */
#ifdef OS2
#ifndef SYSUTIMEH
#define SYSUTIMEH
#endif /* SYSUTIMEH */
#else /* OS2 */
#ifdef VMS
#ifndef UTIMEH
#define UTIMEH
#endif /* UTIMEH */
#endif /* VMS */
#endif /* OS2 */
#endif /* SUNOS41 */
#endif /* OSF */
#endif /* SVR4ORPOSIX */
#endif /* NOSETTIME */
#ifdef NEWFTP
_PROTOTYP( int ftpisconnected, (void));
_PROTOTYP( int ftpisloggedin, (void));
_PROTOTYP( int ftpissecure, (void));
#endif /* NEWFTP */
_PROTOTYP( int readpass, (char *, char *, int));
_PROTOTYP( int readtext, (char *, char *, int));
#ifdef OS2
_PROTOTYP(int ck_auth_loaddll, (VOID));
_PROTOTYP(int ck_auth_unloaddll, (VOID));
#endif /* OS2 */
#ifdef NT
_PROTOTYP(DWORD ckGetLongPathname,(LPCSTR lpFileName,
LPSTR lpBuffer, DWORD cchBuffer));
#endif /* NT */
#include "ckclib.h"
/* End of ckcdeb.h */
#endif /* CKCDEB_H */
|