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
|
Description: Fixes dfor Werror=implicit-function-declaration
Bug-Origin: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1075664
Author: Alastair McKinstry <mckinstry@debian.org>
Last-Updated: 2024-08-09
Forwarded: no
--- a/src/lib/c/mkerrmsg.c
+++ b/src/lib/c/mkerrmsg.c
@@ -44,13 +44,15 @@
#include <stdio.h>
#include <string.h>
+char *gets(char *s);
+
#ifndef lint
static char *rcsid ="$Id: mkerrmsg.c,v 2.5.4.1 1993/03/10 19:44:19 steve Exp $";
static char *afsid ="$__Header$";
#endif
-main()
+int main(int argc, char **argv)
{
char line[1024], dstr[30], estr[30];
char *cp;
--- a/src/lib/c/cgm/cgmi.c
+++ b/src/lib/c/cgm/cgmi.c
@@ -251,7 +251,7 @@
/*
* Get point parameters.
*/
-mi_point(mi, points, npoint)
+void mi_point(mi, points, npoint)
mf_cgmi *mi;
Gpoint *points;
int npoint;
--- a/src/lib/fortran/error.fc
+++ b/src/lib/fortran/error.fc
@@ -39,6 +39,7 @@
#include <stdio.h>
#include <string.h>
#include "xgks.h"
+#include "gks_implem.h"
#include "fortxgks.h"
#ifndef lint
@@ -60,6 +61,7 @@
* See also: ANSI standard p. 195
*/
/*FORTRAN*/
+int
geclks()
{
debug(("emergency close gks \n"));
@@ -85,7 +87,7 @@
*
* See also: ANSI standard p. 195
*/
-gerrorhand(errnr, fctid, efp)
+int gerrorhand(errnr, fctid, efp)
Gint errnr;
Gerrmap fctid;
Gfile *efp;
--- a/src/lib/c/xgks.h
+++ b/src/lib/c/xgks.h
@@ -1499,6 +1499,9 @@
#define GTH_CENTER GTH_CENTRE
#define GCOLOR GCOLOUR
+Gint ginqcolorrep (Gint wsid, Gint idx, Gqtype type, Gcobundl *rep);
+Gint ginqcolourrep (Gint wsid, Gint idx, Gqtype type, Gcobundl *rep);
+
#define ginqcolorfacil ginqcolourfacil
#define ginqcolorrep ginqcolourrep
#define ginqcolorindices ginqcolourindices
@@ -1537,7 +1540,14 @@
# define PROTO(x) ()
#endif
+extern Gint gerrorhand PROTO((Gint errnr, Gerrmap fctid, Gfile *efp));
+
extern void gescsetbackingstore PROTO((Gint ws, Gint i));
extern void gescsetprogname PROTO((Gchar *name));
+/* Added prototypes */
+void WindowMapping(int map_it);
+int gescsetdcsize(Gint ws_id, Gpoint size);
+void xProcessEvents(void);
+
#endif
--- a/src/lib/c/gks_implem.h
+++ b/src/lib/c/gks_implem.h
@@ -63,4 +63,380 @@
#include "event.h"
#include "metafile.h"
+/* We now enable -Werror=implicit-function-declaration on Debian
+ * so we need to include these prototypes.
+ * Not necessarily the exported API
+ */
+
+Gint gopenws (Gint wsid,const Gchar *connection,const Gchar *ws_type);
+Gint gclosews (Gint wsid);
+Gint gclearws (Gint wsid, Gclrflag control_flag);
+Gint gopengks (Gfile *err_file, Glong memory);
+Gint gclosegks (void);
+Gint gsetasf (Gasfs *asf);
+Gint gsetcolorrep (Gint wsid, Gint idx, Gcobundl *rep);
+Gint ginqcolorrep (Gint wsid, Gint idx, Gqtype type, Gcobundl *rep);
+Gint ginqcolorindices (Gint wsid, Gintlist *indices);
+Gint ginqcolorfacil (Gchar *ws_type, Gcofac *fac);
+Gint ginqpredcolorrep (Gchar *ws_type, Gint index, Gcobundl *rep);
+Gint gactivatews (Gint wsid);
+Gint gdeactivatews (Gint wsid);
+Gint gsetwindow (Gint trans, Glimit *window);
+Gint gsetviewport (Gint trans, Glimit *viewport);
+Gint gsetviewportinputpri (Gint trans, Gint ref_trans, Gvpri priority);
+Gint gselntran (Gint trans);
+Gint gsetclip (Gclip ind);
+Gint gsetwswindow (Gint wsid, Glimit *window);
+Gint gsetwsviewport (Gint wsid, Glimit *viewport);
+Gint gevaltran (Gpoint *ppoint, Gpoint *pshift, Gfloat angle, Gpoint *pscale, Gcsw coord, Gfloat result[2][3]);
+Gint gaccumtran (Gfloat segtran[2][3], Gpoint *ppoint, Gpoint *pshift, Gfloat angle, Gpoint *pscale, Gcsw coord, Gfloat result[2][3]);
+Gint gemergencyclosegks (void);
+Gint gerrorhand (Gint errnum, Gerrmap funcname, Gfile *perrfile);
+Gint gerrorlog (Gint errnum, Gerrmap funcname, Gfile *perrfile);
+Gint gpolyline (Gint num_pts, Gpoint *pts);
+Gint gsetlineind (Gint idx);
+Gint gsetlinetype (Gint type);
+Gint gsetlinewidth (Gfloat width);
+Gint gsetlinecolorind (Gint idx);
+Gint gsetlinerep (Gint wsid, Gint idx, Glnbundl *rep);
+Gint gcreateseg (Gint name);
+Gint gcloseseg (void);
+Gint grenameseg (Gint old, Gint new);
+Gint gdelseg (Gint name);
+Gint gdelsegws (Gint wsid, Gint name);
+Gint gsetsegattr (Gint name, Gsegattr *segattr);
+Gint gsetpickid (Gint pick_id);
+Gint gassocsegws (Gint wsid, Gint seg_id);
+Gint gcopysegws (Gint wsid, Gint seg_id);
+Gint ginsertseg (Gint seg_id, Gfloat segtran[2][3]);
+Gint gredrawsegws (Gint wsid);
+Gint ginqmodsegattr (Gchar *ws_type, Gmodseg *dyn);
+Gint ginqnameopenseg (Gint *seg);
+Gint ginqsegattr (Gsegattr *segattr);
+Gint ginqassocws (Gint seg, Gintlist *asswk);
+Gint ginqsegnames (Gintlist *segs);
+Gint ginqsegnamesws (Gint wsid, Gintlist *segs);
+Gint ginqnumsegpri (Gchar *ws_type, Gint *numpri);
+Gint ginqcurpickid (Gint *pickid);
+Gint gpolymarker (Gint num_pts, Gpoint *pts);
+Gint gsetmarkersize (Gfloat size);
+Gint gsetmarkertype (Gint type);
+Gint gsetmarkercolorind (Gint color);
+Gint gsetmarkerind (Gint idx);
+Gint gsetmarkerrep (Gint wsid, Gint idx, Gmkbundl *rep);
+Gint gfillarea (Gint num_pts, Gpoint *pts);
+Gint gsetfillcolorind (Gint color);
+Gint gsetfillind (Gint idx);
+Gint gsetfillintstyle (Gflinter style);
+Gint gsetfillrep (Gint wsid, Gint idx, Gflbundl *rep);
+Gint gsetfillstyleind (Gint idx);
+Gint gsetpatrep (Gint wsid, Gint idx, Gptbundl *rep);
+Gint gcellarray (Grect *rect, Gipoint *dim, Gint row, Gint *color);
+Gint ginitloc (Gint wsid, Gint dev, Gloc *init, Gint pet, Glimit *area, Glocrec *record);
+Gint gsetlocmode (Gint wsid, Gint dev, Gimode mode, Gesw echo);
+Gint greqloc (Gint wsid, Gint dev, Gqloc *response);
+Gint gsampleloc (Gint wsid, Gint dev, Gloc *response);
+Gint ginqlocst (Gint wsid, Gint dev, Gqtype type, Glocst *state);
+Gint ginqdefloc (Gchar *type, Gint dev, Gdefloc *data);
+Gint gawaitevent (Gfloat timeout, Gevent *event);
+Gint gflushevents (Gint wsid, Giclass class, Gint dev);
+Gint ginqinputoverflow (Gqueue *overflow);
+Gint ginqmoreevents (Gsimultev *events);
+Gint ggetloc (Gloc *response);
+Gint ggetstroke (Gstroke *response);
+Gint ggetchoice (Gchoice *response);
+Gint ggetpick (Gpick *response);
+Gint ggetval (Gfloat *response);
+Gint ggetstring (Gchar *response);
+Gint gupdatews (Gint wsid, Gregen regenflag);
+Gint gsetcharexpan (Gfloat expansion);
+Gint gsetcharheight (Gfloat height);
+Gint gsetcharspace (Gfloat spacing);
+Gint gsetcharup (Gpoint *up_vector);
+Gint gsettextalign (Gtxalign *txalign);
+Gint gsettextcolorind (Gint color);
+Gint gsettextfontprec (Gtxfp *txfp);
+Gint gsettextind (Gint idx);
+Gint gsettextpath (Gtxpath path);
+Gint gsettextrep (Gint wsid, Gint idx, Gtxbundl *bundle);
+Gint gtext (Gpoint *at, Gchar *string);
+Gint ginqtextextent (Gint wsid, Gpoint position, Gchar *string, Gextent *extent);
+Gint gsetdeferst (Gint wsid, Gdefmode deferral_mode, Girgmode regen_mode);
+Gint ginitchoice (Gint wsid, Gint dev, Gchoice *init, Gint pet, Glimit *area, Gchoicerec *record);
+Gint gsetchoicemode (Gint wsid, Gint dev, Gimode mode, Gesw echo);
+Gint greqchoice (Gint wsid, Gint dev, Gchoice *response);
+Gint gsamplechoice (Gint wsid, Gint dev, Gchoice *response);
+Gint ginqchoicest (Gint wsid, Gint dev, Gchoicest *state);
+Gint ginqdefchoice (Gchar *type, Gint dev, Gdefchoice *data);
+Gint ginitpick (Gint wsid, Gint dev, Gpick *init, Gint pet, Glimit *area, Gpickrec *record);
+Gint gsetpickmode (Gint wsid, Gint dev, Gimode mode, Gesw echo);
+Gint greqpick (Gint wsid, Gint dev, Gpick *response);
+Gint gsamplepick (Gint wsid, Gint dev, Gpick *response);
+Gint ginqpickst (Gint wsid, Gint dev, Gqtype type, Gpickst *state);
+Gint ginqdefpick (Gchar *type, Gint dev, Gdefpick *data);
+Gint ginitval (Gint wsid, Gint dev, Gfloat init, Gint pet, Glimit *area, Gvalrec *record);
+Gint gsetvalmode (Gint wsid, Gint dev, Gimode mode, Gesw echo);
+Gint greqval (Gint wsid, Gint dev, Gqval *response);
+Gint gsampleval (Gint wsid, Gint dev, Gfloat *response);
+Gint ginqvalst (Gint wsid, Gint dev, Gvalst *state);
+Gint ginqdefval (Gchar *type, Gint dev, Gdefval *data);
+Gint ginitstring (Gint wsid, Gint dev, Gchar *init, Gint pet, Glimit *area, Gstringrec *record);
+Gint gsetstringmode (Gint wsid, Gint dev, Gimode mode, Gesw echo);
+Gint greqstring (Gint wsid, Gint dev, Gqstring *response);
+Gint gsamplestring (Gint wsid, Gint dev, Gchar *response);
+Gint ginqstringst (Gint wsid, Gint dev, Gstringst *state);
+Gint ginqdefstring (Gchar *type, Gint dev, Gdefstring *data);
+Gint ginitstroke (Gint wsid, Gint dev, Gstroke *init, Gint pet, Glimit *area, Gstrokerec *record);
+Gint gsetstrokemode (Gint wsid, Gint dev, Gimode mode, Gesw echo);
+Gint greqstroke (Gint wsid, Gint dev, Gqstroke *response);
+Gint gsamplestroke (Gint wsid, Gint dev, Gstroke *response);
+Gint ginqstrokest (Gint wsid, Gint dev, Gqtype type, Gstrokest *state);
+Gint ginqdefstroke (Gchar *type, Gint dev, Gdefstroke *data);
+Gint ginqlinefacil (Gchar *ws_type, Glnfac *fac);
+Gint ginqpredlinerep (Gchar *ws_type, Gint idx, Glnbundl *rep);
+Gint ginqlineindices (Gint wsid, Gintlist *idxlist);
+Gint ginqlinerep (Gint wsid, Gint idx, Gqtype type, Glnbundl *rep);
+Gint ginqmarkerfacil (Gchar *ws_type, Gmkfac *fac);
+Gint ginqpredmarkerrep (Gchar *ws_type, Gint idx, Gmkbundl *rep);
+Gint ginqmarkerindices (Gint wsid, Gintlist *idxlist);
+Gint ginqmarkerrep (Gint wsid, Gint idx, Gqtype type, Gmkbundl *rep);
+Gint ginqfillfacil (Gchar *ws_type, Gflfac *fac);
+Gint ginqpredfillrep (Gchar *ws_type, Gint idx, Gflbundl *rep);
+Gint ginqfillindices (Gint wsid, Gintlist *idxlist);
+Gint ginqfillrep (Gint wsid, Gint idx, Gqtype type, Gflbundl *rep);
+Gint ginqpatfacil (Gchar *ws_type, Gint *fac);
+Gint ginqpredpatrep (Gchar *ws_type, Gint idx, Gptbundl *rep);
+Gint ginqpatindices (Gint wsid, Gintlist *idxlist);
+Gint ginqpatrep (Gint wsid, Gint idx, Gqtype type, Gptbundl *rep);
+Gint gmessage (Gint wsid, Gchar *string);
+Gint gescinqxattr (Gint wsid, Display **dpy, Window *win, GC *gc);
+void gescsetbackingstore (Gint wsid, Gint i);
+void gescsetprogname (char *name);
+Gint gescsetcolormask (Gint wsid, unsigned long mask);
+Gint gescsetdcsize (Gint wsid, Gpoint size);
+Gint gescstoreprimi (Gint wsid, Gstore store);
+Gint gescredrawnotify (Gint wsid, Gint (*funcp)(Gint wsid, Gredraw who));
+Gint ginqtextfacil (Gchar *ws_type, Gtxfac *fac);
+Gint ginqpredtextrep (Gchar *ws_type, Gint idx, Gtxbundl *rep);
+Gint ginqtextindices (Gint wsid, Gintlist *idxlist);
+Gint ginqtextrep (Gint wsid, Gint idx, Gqtype type, Gtxbundl *rep);
+Gint ginqavailwstypes (Gstrlist *wstypes);
+Gint ginqdisplayspacesize (Gchar *ws_type, Gdspsize *dspsz);
+Gint ginqwscategory (Gchar *ws_type, Gwscat *cat);
+Gint ginqwsclass (Gchar *ws_type, Gwsclass *class);
+Gint ginqmodwsattr (Gchar *ws_type, Gmodws *dyn);
+Gint ginqdefdeferst (Gchar *ws_type, Gdefer *def);
+Gint ginqmaxwssttables (Gchar *ws_type, Gwstables *tables);
+Gint ginqnumavailinput (Gchar *ws_type, Gnumdev *num);
+Gint ginqwsconntype (Gint wsid, Gwsct *ct);
+Gint ginqwsst (Gint wsid, Gwsstate *state);
+Gint ginqwsdeferupdatest (Gint wsid, Gwsdus *du);
+Gint ginqopst (Gos *state);
+Gint ginqlevelgks (Glevel *lev);
+Gint ginqwsmaxnum (Gwsmax *maxws);
+Gint ginqopenws (Gintlist *wsids);
+Gint ginqactivews (Gintlist *wsids);
+Gint ginqprimattr (Gpriattr *primattr);
+Gint ginqindivattr (Gindattr *indivattr);
+Gint ginqcurntrannum (Gint *tran);
+Gint ginqntrannum (Gintlist *tranlist);
+Gint ginqntran (Gint num, Gwstran *tran);
+Gint ginqclip (Gcliprec *clipping);
+Gint ginqmaxntrannum (Gint *maxtran);
+Gint ginqwstran (Gint wsid, Gwsti *wstran);
+Gint ginqpixelarraydim (Gint wsid, Grect *rect, Gipoint *dim);
+Gint ginqpixelarray (Gint wsid, Gpoint *point, Gipoint *dimen, Gpxarray *pxarr);
+Gint ginqpixel (Gint wsid, Gpoint *ppoint, Gint *pix);
+Gint gwritegksm (Gint wsid, Gint type, Gint length, Gchar *data);
+Gint ggetgksm (Gint wsid, Ggksmit *result);
+Gint greadgksm (Gint wsid, Gint length, Gchar *record);
+Gint ginterpret (Ggksmit *recInfo, Gchar *data);
+
+int g_gdp(Gint npoints, Gpoint *points, Gint function,
+ Ggdprec *data);
+
+int gerlog_(int *errnr, int *fctid, int *lun);
+int gerhnd_(int *errnr, int *fctid, int *errfil);
+int ginqavailgdp(Gchar *type,Ggdplist *gdps);
+int gprecc(int il,int *ia,int rl,float *ra,int sl,int *lstr,char **str,int mldr,int *errind,int *ldr,char *datarec);
+void perr(int i, char *s);
+
+#if 0
+Gint ginqclip (Gcliprec *clipping);
+Gint ginqcolourindices(Gint ws_id, Gintlist *indices);
+Gint gsetcolourrep(Gint ws_id,Gint idx, Gcobundl *rep);
+Gint gsetcolorrep(Gint ws_id,Gint idx, Gcobundl *rep);
+
+
+
+int gopenws(Gint ws_id , const Gchar * connection ,
+ const Gchar * ws_type);
+int gclosews(Gint ws_id);
+int gactivatews(Gint ws_id);
+int gdeactivatews(Gint ws_id);
+int gclearws(Gint ws_id , Gclrflag control_flag);
+int gredrawsegws(Gint ws_id);
+int gupdatews(Gint ws_id, Gregen regenflag);
+int gsetdeferst(Gint ws_id, Gdefmode deferral_mode,
+ Girgmode regen_mode);
+int gpolyline(Gint num_pts, Gpoint *pts);
+int gpolymarker(Gint num_pts, Gpoint *pts);
+int gfillarea(Gint num_pts, Gpoint *pts);
+/*int gcellarray(xgks_Grect *rect, Gipoint *dim, Gint row,
+ Gint *colour); */
+int gsetlineind(Gint idx);
+int gsetlinetype(Gint type);
+int gsetlinewidth(Gfloat width);
+int gsetlinecolourind(Gint idx);
+int gsetmarkerind(Gint idx);
+int gsetmarkertype(Gint type);
+int gsetmarkersize(Gfloat size);
+int gsetmarkercolourind(Gint colour);
+int gsettextind(Gint idx);
+int gsettextfontprec(Gtxfp *txfp);
+int gflushevents(Gint ws_id,Giclass class,Gint dev);
+void gescsetbackingstore(Gint ws, Gint i);
+void gescsetprogname(Gchar *name);
+
+int gcloseseg(void);
+
+Gint gsetpatsize(Gpoint *siz);
+Gint gsetfillind(Gint idx);
+Gint gsetfillstyleind(Gint idx);
+Gint gsettextcolourind(Gint colour);
+Gint gsettextpath(Gtxpath path);
+Gint gsetfillintstyle(Gflinter style);
+Gint gsetfillcolourind(Gint colour);
+Gint gsetpatrefpt(Gpoint *ref);
+Gint gsetpickid(Gint pick_id);
+Gint gcreateseg(Gint name);
+Gint gdelseg(Gint name);
+Gint gsettextalign(Gtxalign *txalign);
+Gint grenameseg(Gint old,Gint new);
+Gint ginqsegattr(Gsegattr *segattr);
+Gint gmessage(Gint ws_id,Gchar *string);
+Gint gsetsegattr(Gint name,Gsegattr *segattr);
+Gint gtext(Gpoint *at,Gchar *string);
+Gint gsetcharexpan(Gfloat expansion);
+Gint gsetcharspace(Gfloat spacing);
+Gint gsetasf(Gasfs *asf);
+Gint gsetlinerep(Gint ws_id,Gint idx,Glnbundl *rep);
+Gint gsetmarkerrep(Gint ws_id,Gint idx,Gmkbundl *rep);
+Gint gsettextrep(Gint ws_id,Gint idx,Gtxbundl *bundle);
+Gint gsetfillrep(Gint ws_id,Gint idx,Gflbundl *rep);
+Gint gsetpatrep(Gint ws_id,Gint idx,Gptbundl *rep);
+Gint gsetwswindow(Gint ws_id,Glimit *window);
+Gint gsetwsviewport(Gint ws_id,Glimit *viewport);
+Gint gsetwindow(Gint trans,Glimit *window);
+#endif
+
+int PSmoSetLandscape(Metafile *mf);
+Gint gsetpatsize(Gpoint *siz);
+Gint gsetpatrefpt(Gpoint *ref);
+int XgksXDrawLines(Display *dpy,Drawable win,GC gc,XPoint *xpts,int npts,int mode);
+Gint XgksFindNTransNpts(int num,Gpoint *ndcpts,Gint *ntrans,Gpoint *wcpts);
+int xXgksInqTextExtent(WS_STATE_PTR ws,TEXT_ST *tx,Gpoint ndc_points[5]);
+void XgksUpdatePrimiBound(OUT_PRIMI *primi,Glimit *bound);
+void XgksProcessPrimi(OUT_PRIMI *primi);
+void XgksOutputToWs(OUT_PRIMI *primi);
+void XgksMiniMax(Glimit *bound,Gpoint *pt);
+void XgksAppendWsPrimi(OUT_PRIMI *primi);
+void XgksAppendSegClip(void);
+void XgksAppendWsClip(Glimit *rec);
+int xXgksHighLight(WS_STATE_PTR ws,Gpoint bd[5]);
+void XgksGReDrawWs(WS_STATE_PTR ws);
+void XgksReDrawSeg(WS_STATE_PTR ws,Gint seg_id);
+void XgksReDrawSegWs(WS_STATE_PTR ws);
+int xXgksClearWs(WS_STATE_PTR wk);
+void XgksInsertPrimi(OUT_PRIMI **insert_pt,OUT_PRIMI *elm);
+void XgksUnpendPendingTrans(WS_STATE_PTR ws);
+void XgksReDrawWs(WS_STATE_PTR ws,OUT_PRIMI *primi);
+void XgksUpdateWsSegList(WS_STATE_PTR ws);
+void XgksReDrawSegWs(WS_STATE_PTR ws);
+void XgksWsWinInterset(WS_STATE_PTR ws,Glimit *v,Glimit *clip);
+int xXgksPolyMarker(WS_STATE_PTR ws,PMARK_ST *pmk_ptr);
+int xXgksFillArea(WS_STATE_PTR ws,FILL_AREA_ST *fill_ptr);
+int xXgksCloseWs(WS_STATE_PTR ws);
+Gint xXgksOpenWs(WS_STATE_PTR wk);
+void XgksDeletePrimi(OUT_PRIMI *head,OUT_PRIMI **insert_pt);
+int xXgksCellarray(WS_STATE_PTR ws,CELL_ARRAY_ST *cell_ptr);
+void XgksInitIDev(WS_STATE_ENTRY *ws);
+void XgksInitWssTrans(WS_STATE_PTR ws);
+void XgksIDevDelete(WS_STATE_ENTRY *ws);
+void XgksDeleteAllSeg(WS_STATE_PTR ws);
+Gint xXgksOpenWs(WS_STATE_PTR wk);
+int xXgksText(WS_STATE_PTR ws,TEXT_ST *tx);
+int xXgksMesg(WS_STATE_PTR ws,MESG_ST *mesg);
+void XgksInitWssPmarkers(WS_STATE_PTR ws);
+int xXgksPolyLine(WS_STATE_PTR ws, PLINE_ST *plin_ptr);
+void xXgksUpdateClip(WS_STATE_PTR ws);
+void XgksInitWssPlines(WS_STATE_PTR ws);
+int XgksInitWssFillArea(WS_STATE_PTR ws);
+void XgksDrawToWs(WS_STATE_PTR ws,OUT_PRIMI *primi);
+int XgksInsertMesgPrimi(WS_STATE_PTR ws,OUT_PRIMI *primi);
+void XgksCleanUpWsSegList(WS_STATE_PTR ws);
+void XgksInitGksAsf(void);
+void XgksInitGksPlines(void);
+void XgksInitGksPmarkers(void);
+void XgksInitGksFillArea(void);
+void XgksInitWssText(WS_STATE_PTR ws);
+void XgksInitGksSegments(void);
+void XgksInitGksText(void);
+void XgksInitGksTrans(void);
+void XgksComputeVec(Gpoint *up_vec, Gpoint *base_vec);
+int XgksSIGIO_OFF(Display *dpy);
+int XgksSIGIO_ON(Display *dpy);
+int xXgksXReDrawWs(WS_STATE_PTR ws);
+void XgksXReDrawWs (WS_STATE_PTR ws);
+int sockspgrp(int fd,pid_t pid);
+int sockasync(int fd, int yes);
+int sio_on(void (*handler)());
+int sio_off(void);
+void XgksIDevDisable(WS_STATE_ENTRY *ws);
+void xXgksUpdateTrans(WS_STATE_PTR ws);
+void XgksIProcessXEvent(XEvent *xev,WS_STATE_ENTRY *ws);
+void XgksIDevEnable(WS_STATE_ENTRY *ws);
+void xXgksSetForeground(Display *dpy, GC gc,unsigned long fg);
+void xXgksSetFillAreaClipRectangles(Display *dpy,GC gc,WS_STATE_PTR ws,XRectangle *rectangle);
+void xXgksSetLineAttributes(Display *dpy,GC gc, unsigned int line_width,int line_style,int cap_style,int join_style);
+void xXgksSetStipple(Display *dpy,GC gc,Pixmap stipple);
+void xXgksSetFillStyle(Display *dpy,GC gc,int fill_style);
+void xXgksSetTile(Display *dpy,GC gc,Pixmap tile);
+void XcCopy(WS_STATE_PTR toWs,WS_STATE_PTR fromWs);
+void xXgksSetDashes(Display *dpy,GC gc,WS_STATE_PTR ws, Gint i);
+void xXgksSetPlineClipRectangles(Display *dpy,GC gc,WS_STATE_PTR ws,XRectangle *rectangle);
+void XgksDrawMarkers(Display *dpy,Window win,GC gc,XPoint *pe,int n,int type,float s);
+void xXgksSetPmarkerClipRectangles(Display *dpy,GC gc,WS_STATE_PTR ws,XRectangle *rectangle);
+void xXgksSetTextClipRectangles(Display *dpy,GC gc,WS_STATE_PTR ws,XRectangle *rectangle);
+int XgksMoDeactivateWs(WS_STATE_PTR ws);
+void XgksProcessPrimi(OUT_PRIMI *primi);
+int XgksAwaitEvent(WS_STATE_ENTRY **wslist,int nws, double timeout);
+int XgksEnqueueEvent(Gint ws,Gint dev, Giclass class,char *data, int event_id);
+int xXgksSetColourRep(WS_STATE_PTR ws,int idx,Gcobundl *rep);
+int xXgksInqColourRep(WS_STATE_PTR ws,int idx,Gqtype type, Gcobundl *rep);
+int XgksMaxColours(char *server);
+void XgksReDrawSegWs(WS_STATE_PTR ws);
+void XgksUpdateWsClip(WS_STATE_PTR ws,Glimit *bound);
+int XgksChoUpdatePrompt(WS_STATE_ENTRY *ws,INPUT_DEV *idev,PromptStatus pstate,XMotionEvent *xmev,int event_id);
+int XgksLocUpdatePrompt(WS_STATE_ENTRY *ws,INPUT_DEV *idev,PromptStatus pstate,Gpoint *newdcpt,XMotionEvent *xmev,int event_id);
+int XgksPicUpdatePrompt(WS_STATE_ENTRY *ws,INPUT_DEV *idev,Gpoint *newdcpt,XMotionEvent *xmev,int event_id);
+int XgksStrUpdatePrompt(WS_STATE_ENTRY *ws,INPUT_DEV *idev,PromptStatus pstate,XKeyPressedEvent *xev,int event_id);
+int XgksStkUpdatePrompt(WS_STATE_ENTRY *ws,INPUT_DEV *idev,PromptStatus pstate,Gpoint *newdcpt,XMotionEvent *xmev,int event_id);
+int XgksValUpdatePrompt(WS_STATE_ENTRY *ws,INPUT_DEV *idev,PromptStatus pstate,Gpoint *newdcpt,XMotionEvent *xmev, int event_id);
+void XgksPicDelete(WS_STATE_ENTRY *ws,INPUT_DEV *idev);
+void XgksLocDelete(WS_STATE_ENTRY *ws,INPUT_DEV *idev);
+void XgksStrDelete(WS_STATE_ENTRY *ws,INPUT_DEV *idev);
+void XgksStkDelete(WS_STATE_ENTRY *ws,INPUT_DEV *idev);
+void XgksChoDelete(WS_STATE_ENTRY *ws,INPUT_DEV *idev);
+void XgksValDelete(WS_STATE_ENTRY *ws,INPUT_DEV *idev);
+int xXgksInqPixelarrayDim(WS_STATE_PTR ws,Grect *rect,Gipoint *dim);
+int xXgksInqPixel(WS_STATE_PTR ws,Gpoint *ppoint,Gint *pix);
+int xXgksInqPixelarray(WS_STATE_PTR ws,Gpoint *point,Gipoint *dim, Gpxarray *pxarr);
+Bool XgksFindNTrans(Gpoint *ndcpt,Gloc *gloc);
+void XgksProcessClip(Glimit *rec);
+void XgksSetLineAttrMo(WS_STATE_PTR ws,Glnattr *lnattr);
+void XgksSetMarkAttrMo(WS_STATE_PTR ws,Gmkattr *mkattr);
+void XgksSetTextAttrMo(WS_STATE_PTR ws,Gtxattr *txattr,CHATTR *chattr);
+void XgksSetFillPatAttrMo(WS_STATE_PTR ws,Gflattr *flattr,PTATTR *ptattr);
+
#endif /* XGKS_GKS_IMPLEM_H not defined */
--- a/src/lib/c/colours.c
+++ b/src/lib/c/colours.c
@@ -41,6 +41,7 @@
#include "udposix.h"
#include <stdlib.h>
+#include <string.h>
#include "gks_implem.h"
/* LINTLIBRARY */
@@ -67,6 +68,7 @@
*
* See also: ANSI Standard p.105
*/
+Gint
gsetcolourrep(ws_id, idx, rep)
Gint ws_id;
Gint idx;
@@ -146,6 +148,7 @@
*
* See also: ANSI Standard p.164
*/
+Gint
ginqcolourrep(ws_id, idx, type, rep)
Gint ws_id;
Gint idx;
@@ -219,6 +222,7 @@
*
* See also: ANSI Standard p.164
*/
+Gint
ginqcolourindices(ws_id, indices)
Gint ws_id;
Gintlist *indices;
@@ -258,6 +262,7 @@
*
* See also: ANSI Standard p.180
*/
+Gint
ginqcolourfacil(ws_type, fac)
Gchar *ws_type;
Gcofac *fac;
@@ -294,7 +299,8 @@
static Display *CprevDpy = NULL;
static int Cncolours = 0;
static XColor *Xcolours = NULL;
-
+
+Gint
ginqpredcolourrep(ws_type, index, rep)
Gchar *ws_type;
Gint index;
@@ -427,6 +433,7 @@
* find the number of colour table entries supported by an X server.
* returns the number of entries or -1 if the server does not respond.
*/
+int
XgksMaxColours(server)
char *server;
{
--- a/src/lib/c/wslist.h
+++ b/src/lib/c/wslist.h
@@ -422,4 +422,13 @@
unsigned long PixelValue));
extern int XcEnd PROTO((WS_STATE_PTR XcWs));
+/* Added prototypes */
+int GIFFlush(Metafile *mf, char *filename);
+int GIFFlusht0(Metafile *mf, char *filename);
+int GIFFlusht1(Metafile *mf, char *filename);
+void GIFresize(WS_STATE_PTR ws, Gpoint size);
+void PSresize(WS_STATE_PTR ws, Gpoint size);
+void XgksDrawSegToWs(WS_STATE_PTR);
+
+
#endif /* WSLIST_H not defined */
--- a/src/lib/c/cgm/cgmo.c
+++ b/src/lib/c/cgm/cgmo.c
@@ -879,7 +879,7 @@
assert(IS_IN_PICTURE(cgmo[ii]));
- if (ginqcolourrep(cgmo[ii]->ws->ws_id, 0, GSET, &rep) == OK) {
+ if (ginqcolorrep(cgmo[ii]->ws->ws_id, 0, GSET, &rep) == OK) {
mo_header(PIC_DESCRIPTOR_CL, BACKCOLR_ID);
mo_direct_color(cgmo+ii, 1, &rep);
mo_flush(cgmo+ii, 1, 0);
--- a/src/lib/c/x/xopws.c
+++ b/src/lib/c/x/xopws.c
@@ -164,7 +164,7 @@
/*
* Insure a connection to the display.
*/
- static
+static int
InsureConn(wk)
WS_STATE_PTR wk;
{
@@ -218,7 +218,7 @@
* Indicate whether a boolean resource is set. Returns -1 if the
* resource doesn't exist, 0 if it's false, and 1 if it's true.
*/
- static int
+static int
BoolResource(prog, name, class, rDB)
char *prog; /* program name */
char *name; /* resource name */
@@ -260,7 +260,7 @@
/*
* Create an XGKS window -- with all its associated attributes.
*/
- static
+static int
CreateWindow(name, rDB, wk)
char *name; /* program name */
XrmDatabase rDB; /* resource database */
@@ -662,7 +662,7 @@
* Initialize our local resource manager. Taken from "X11R4/contrib/
* examples/OReilly/Xlib/basecalc/basecalc.c".
*/
- static
+ static int
InitDefaults(name, dpy, rDB)
char *name; /* name of application */
Display *dpy;
@@ -708,7 +708,7 @@
*
* NB: Document any changes to the following algorithm in xgks.3.
*/
- static
+ static int
GetUsersDatabase(prog, rDB, dpy)
char *prog;
XrmDatabase *rDB; /* resource database */
@@ -817,6 +817,7 @@
/*
* xXgksClearWs(wk) --- clear the corresponding x-window
*/
+int
xXgksClearWs(wk)
WS_STATE_PTR wk;
{
@@ -835,6 +836,7 @@
/*
* xXgksCloseWs(ws) --- close the corresponding x-window
*/
+int
xXgksCloseWs(ws)
WS_STATE_PTR ws;
{
@@ -857,6 +859,7 @@
/*
* xXgksHighLight(ws, bd) --- heighlight a primitive
*/
+int
xXgksHighLight(ws, bd)
Gpoint bd[5];
WS_STATE_PTR ws;
--- a/src/lib/c/x/xpmarker.c
+++ b/src/lib/c/x/xpmarker.c
@@ -52,6 +52,7 @@
#endif
+int
xXgksPolyMarker(ws, pmk_ptr)
WS_STATE_PTR ws;
PMARK_ST *pmk_ptr;
@@ -165,6 +166,7 @@
/*
* Output polymarkers
*/
+void
XgksDrawMarkers(dpy, win, gc, pe, n, type, s)
Display *dpy;
Window win;
--- a/src/lib/c/x/xtext.c
+++ b/src/lib/c/x/xtext.c
@@ -45,6 +45,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <unistd.h>
#include <math.h>
#include "gks_implem.h"
#include "font.h"
@@ -95,7 +96,7 @@
static int xMultMatrix();
- static
+static void
xComputeText(ws, tx)
WS_STATE_PTR ws;
TEXT_ST *tx;
@@ -186,6 +187,7 @@
* Note: this function will output tabs, form feeds, line feeds, and like
* control characters as a special symbol.
*/
+int
xXgksText(ws, tx)
WS_STATE_PTR ws;
TEXT_ST *tx;
@@ -501,7 +503,7 @@
*
* returns nothing.
*/
- static
+static int
xPlotStrokeChar(cvp)
struct vcharst *cvp;
{
@@ -671,7 +673,7 @@
* a matrix is an array of six REALs which specify the first two columns
* of a 3x3 2D transformation matrix.
*/
- static
+ static int
xIdentityMatrix(m)
Gfloat m[];
{
@@ -730,7 +732,7 @@
#endif /* TDEBUG defined */
- static
+ static int
xTransMatrix(m, tx, ty)
Gfloat m[];
Gfloat tx, ty;
@@ -746,7 +748,7 @@
}
- static
+ static int
xCopyMatrix(dest, src)
Gfloat dest[], src[];
{
@@ -761,7 +763,7 @@
/*
* matrix multiply: a * b = c
*/
- static
+ static int
xMultMatrix(a, b, c)
Gfloat a[], b[], c[];
{
@@ -792,7 +794,7 @@
#endif /* TDEBUG defined */
- static
+ static int
ck_ranges(cdef, Xmin, Xmax, Ymin, Ymax)
struct vcharst *cdef;
Gfloat *Xmin, *Xmax, *Ymin, *Ymax;
@@ -825,7 +827,7 @@
}
- static
+ static int
ApplyMatrix(m, in, out)
Gfloat m[];
Gpoint *in, *out;
@@ -840,6 +842,7 @@
* xXgksInqTextExtent () -- X's text inquire extent routine
*
*/
+int
xXgksInqTextExtent(ws, tx, ndc_points)
WS_STATE_PTR ws;
TEXT_ST *tx;
@@ -1286,7 +1289,7 @@
#define MAX(a, b) (((a)>(b))?(a):(b))
-
+int
xXgksMesg(ws, mesg)
WS_STATE_PTR ws;
MESG_ST *mesg;
--- a/src/lib/c/act_ws.c
+++ b/src/lib/c/act_ws.c
@@ -54,7 +54,7 @@
* XgksNoActiveWs() - return 1 if no open workstations are active
* else return 0;
*/
- static
+ static int
XgksNoActiveWs()
{
Gint i;
@@ -76,7 +76,7 @@
* return INVALID if there's no empty slot
*
*/
- static
+ static int
XgksAllocActiveWs (ws_id,ws)
Gint ws_id;
WS_STATE_PTR ws;
@@ -129,7 +129,7 @@
*
* See also: ANSI standard p.76
*/
-
+int
gactivatews(ws_id)
Gint ws_id;
{
@@ -182,6 +182,7 @@
*
* See also: ANSI standard p.76
*/
+int
gdeactivatews(ws_id)
Gint ws_id;
{
--- a/src/lib/c/x/xupdate.c
+++ b/src/lib/c/x/xupdate.c
@@ -57,7 +57,7 @@
static char rcsid[] = "$Id: xupdate.c,v 2.5.4.1 1993/03/10 19:44:27 steve Exp $";
#endif
-
+void
xXgksUpdateTrans(ws)
WS_STATE_PTR ws;
{
@@ -131,6 +131,7 @@
* in X pixel-space from the transformed boundaries of the GKS clip window.
* space.
*/
+void
xXgksUpdateClip(ws)
WS_STATE_PTR ws;
{
--- a/src/lib/c/choice.c
+++ b/src/lib/c/choice.c
@@ -69,6 +69,7 @@
#define MenuPadV 4
#define MenuPadH MenuPadV
+int
ginitchoice(ws_id, dev, init, pet, area, record)
Gint ws_id;
Gint dev;
@@ -331,6 +332,7 @@
* returns: 0, 7, 20, 25, 38, 140, 143
*/
+int
gsetchoicemode(ws_id, dev, mode, echo)
Gint ws_id;
Gint dev;
@@ -447,6 +449,7 @@
*
* returns: 0, 7, 20, 25, 38, 140, 141
*/
+int
greqchoice(ws_id, dev, response)
Gint ws_id;
Gint dev;
@@ -569,6 +572,7 @@
*
* returns: 0, 7, 20, 25, 38, 140, 142
*/
+int
gsamplechoice(ws_id, dev, response)
Gint ws_id;
Gint dev;
@@ -622,6 +626,7 @@
*
* See Also: ANSI Standard p.168
*/
+int
ginqchoicest(ws_id, dev, state)
Gint ws_id;
Gint dev;
@@ -711,6 +716,7 @@
*
* See Also: ANSI Standard p.187
*/
+int
ginqdefchoice(type, dev, data)
Gchar *type;
Gint dev;
@@ -785,7 +791,7 @@
((str) != NULL) ? strlen(str) : 0); \
)
-
+int
XgksChoUpdatePrompt(ws, idev, pstate, xmev, event_id)
WS_STATE_ENTRY *ws;
INPUT_DEV *idev;
@@ -976,6 +982,7 @@
/*
* Delete all structures used to maintain a choice logical input device.
*/
+void
XgksChoDelete(ws, idev)
WS_STATE_ENTRY *ws;
INPUT_DEV *idev;
--- a/src/lib/c/escape.c
+++ b/src/lib/c/escape.c
@@ -55,6 +55,7 @@
/*
* INQUIRE X ATTRIBUTES
*/
+int
gescinqxattr(ws_id, dpy, win, gc)
Gint ws_id;
Display **dpy;
@@ -96,6 +97,7 @@
* Gint ws_id; workstation identifier.
* unsigned long mask; the desired colour plane mask.
*/
+int
gescsetcolourmask(ws_id, mask)
Gint ws_id;
unsigned long mask;
@@ -132,6 +134,7 @@
* Gint ws_id; workstation identifier.
* Gpoint size; the size of workstation DC space.
*/
+int
gescsetdcsize(ws_id, size)
Gint ws_id;
Gpoint size;
@@ -193,6 +196,7 @@
* Gint ws_id; workstation identifier.
* Gstore store;
*/
+int
gescstoreprimi(ws_id, store)
Gint ws_id;
Gstore store;
@@ -230,6 +234,7 @@
* Gint ws_id; workstation identifier.
* Gint (*funcp)(); the pointer of redraw notifying function.
*/
+int
gescredrawnotify(ws_id, funcp)
Gint ws_id;
Gint (*funcp) ();
--- a/src/lib/c/gdp.c
+++ b/src/lib/c/gdp.c
@@ -49,6 +49,7 @@
* See also: ANSI standard p.181
*
*/
+int
ginqavailgdp(type, gdps)
Gchar *type; /* workstation type */
Ggdplist *gdps; /* OUT list of GDP's */
@@ -90,6 +91,7 @@
*
*/
/*ARGSUSED*/
+int
ginqgdp(type, function, fac)
Gchar *type;
Gint function;
@@ -128,6 +130,7 @@
* names (notably under NeXTOS). Hence, we have both the Fortran and C ggdp()
* functions call this one.
*/
+int
g_gdp(npoints, points, function, data)
Gint npoints; /* number of points */
Gpoint *points; /* points array */
--- a/src/lib/c/fillarea.c
+++ b/src/lib/c/fillarea.c
@@ -36,7 +36,7 @@
* fillarea.c - functions and data for gks fill areas.
* gfillarea ()
* gsetfillcolourind ()
- * gsetfillind ()
+gsetfillind * gsetfillind ()
* gsetfillintstyle ()
* gsetfillrep ()
* gsetfillstyleind ()
@@ -70,6 +70,7 @@
/*
* XgksInitGksFillArea: initialise gks state list fill area stuff
*/
+void
XgksInitGksFillArea()
{
xgks_state.gks_flattr.fill = 1; /* fill index */
@@ -92,6 +93,7 @@
* XgksInitWssFillArea(ws) - send predefined attributes and Bundle index to
* newly opened workstation ws;
*/
+int
XgksInitWssFillArea(ws)
WS_STATE_PTR ws;
{
@@ -136,6 +138,7 @@
*
* See Also: ANSI Standard p.83
*/
+Gint
gfillarea(num_pts, pts)
Gint num_pts;
Gpoint *pts;
@@ -192,6 +195,7 @@
*
* See Also: ANSI Standard p.98
*/
+Gint
gsetfillcolourind(colour)
Gint colour;
{
@@ -220,6 +224,7 @@
*
* See Also: ANSI Standard p.96
*/
+Gint
gsetfillind(idx)
Gint idx;
{
@@ -249,6 +254,7 @@
*
* See Also: ANSI Standard p.96
*/
+Gint
gsetfillintstyle(style)
Gflinter style;
{
@@ -280,6 +286,7 @@
*
* See Also: ANSI Standard p.103
*/
+Gint
gsetfillrep(ws_id, idx, rep)
Gint ws_id;
Gint idx;
@@ -344,6 +351,7 @@
*
* See Also: ANSI Standard p.97
*/
+Gint
gsetfillstyleind(idx)
Gint idx;
{
@@ -373,6 +381,7 @@
* See Also: ANSI Standard p.98
*/
+Gint
gsetpatrefpt(ref)
Gpoint *ref;
{
@@ -398,6 +407,7 @@
*
* See Also: ANSI Standard p.98
*/
+Gint
gsetpatsize(siz)
Gpoint *siz;
{
@@ -431,6 +441,7 @@
*
* See Also: ANSI Standard p.104
*/
+Gint
gsetpatrep(ws_id, idx, rep)
Gint ws_id;
Gint idx;
--- a/src/lib/c/gerhnd.fc
+++ b/src/lib/c/gerhnd.fc
@@ -41,6 +41,9 @@
#include "xgks.h"
#include "../fortran/fortxgks.h"
+
+int gerlog_(int *errnr, int *fctid, int *lun);
+
FILE *errfp = NULL; /* error file */
@@ -56,6 +59,7 @@
* See also: ANSI standard p. 195
*/
/*FORTRAN*/
+int
gerhnd(int *errnr, int *fctid, int *errfil)
{
FC_NAME(gerlog)(errnr, fctid, errfil);
--- a/src/lib/c/event.c
+++ b/src/lib/c/event.c
@@ -62,6 +62,7 @@
* enqueue an event. Memory pointed to by data must be malloc'ed by the
* caller but NOT freeed.
*/
+int
XgksEnqueueEvent(ws, dev, class, data, event_id)
Gint ws;
Gint dev;
@@ -223,6 +224,7 @@
*
* Returns: 0, 7, 20, 25, 38, 140, 147
*/
+int
gflushevents(ws_id, class, dev)
Gint ws_id;
Giclass class;
@@ -283,6 +285,7 @@
*
* Returns: 0, 7, 148, 149
*/
+int
ginqinputoverflow(overflow)
Gqueue *overflow;
{
@@ -302,6 +305,7 @@
*
* Errors: 0, 7
*/
+int
ginqmoreevents(events)
Gsimultev *events;
{
@@ -329,6 +333,7 @@
*
* returns 0, 7, 150
*/
+int
ggetloc(response)
Gloc *response;
{
@@ -354,6 +359,7 @@
*
* returns 0, 7, 150
*/
+int
ggetstroke(response)
Gstroke *response;
{
@@ -380,6 +386,7 @@
*
* returns 0, 7, 150
*/
+int
ggetchoice(response)
Gchoice *response;
{
@@ -405,6 +412,7 @@
*
* returns 0, 7, 150
*/
+int
ggetpick(response)
Gpick *response;
{
@@ -430,6 +438,7 @@
*
* returns 0, 7, 150
*/
+int
ggetval(response)
Gfloat *response;
{
@@ -455,6 +464,7 @@
*
* returns 0, 7, 150
*/
+int
ggetstring(response)
Gchar *response;
{
--- a/src/lib/c/deferral_ws.c
+++ b/src/lib/c/deferral_ws.c
@@ -59,6 +59,7 @@
*
* See also: ANSI standard p.79
*/
+int
gsetdeferst(ws_id, deferral_mode, regen_mode)
Gint ws_id;
Gdefmode deferral_mode;
--- a/src/lib/c/gks_error.c
+++ b/src/lib/c/gks_error.c
@@ -62,7 +62,7 @@
*
* See also: Ansi standard p. 193
*/
-gemergencyclosegks()
+int gemergencyclosegks(void)
{
int i;
@@ -91,6 +91,7 @@
/*
* ERROR LOGGING
*/
+int
gerrorlog(errnum, funcname, perrfile)
Gint errnum; /* number for the error that was
* detected. */
--- a/src/lib/c/input.c
+++ b/src/lib/c/input.c
@@ -61,6 +61,7 @@
/*
* Initialise the input device list
*/
+void
XgksInitIDev(ws)
WS_STATE_ENTRY *ws;
{
@@ -88,6 +89,7 @@
* This routine will free up all memory assoicated with input device structure
*
*/
+void
XgksIDevDelete(ws)
WS_STATE_ENTRY *ws;
{
@@ -176,6 +178,7 @@
*
* XEvent can be one of: MotionNotify
*/
+void
XgksIProcessXEvent(xev, ws)
XEvent *xev;
WS_STATE_ENTRY *ws;
@@ -354,8 +357,9 @@
* Basically, just get their prompts off the screen so that GKS can
* produce some output.
*/
-static DisCount = 0;
+static int DisCount = 0;
+void
XgksIDevDisable(ws)
WS_STATE_ENTRY *ws;
{
@@ -452,6 +456,7 @@
/*
* Enable all input devices for a given workstation.
*/
+void
XgksIDevEnable(ws)
WS_STATE_ENTRY *ws;
{
--- a/src/lib/c/pick.c
+++ b/src/lib/c/pick.c
@@ -80,6 +80,7 @@
*
* See Also: ANSI Standard p.127
*/
+int
ginitpick(ws_id, dev, init, pet, area, record)
Gint ws_id, dev, pet;
Gpick *init;
@@ -162,6 +163,7 @@
*
* See Also: ANSI Standard p.130
*/
+int
gsetpickmode(ws_id, dev, mode, echo)
Gint ws_id, dev;
Gimode mode;
@@ -244,6 +246,7 @@
*
* See Also: ANSI Standard p.134
*/
+int
greqpick(ws_id, dev, response)
Gint ws_id, dev;
Gpick *response;
@@ -353,6 +356,7 @@
*
* See Also: ANSI Standard p.137
*/
+int
gsamplepick(ws_id, dev, response)
Gint ws_id, dev;
Gpick *response;
@@ -413,6 +417,7 @@
*
* See Also: ANSI Standard p.169
*/
+int
ginqpickst(ws_id, dev, type, state)
Gint ws_id, dev;
Gqtype type;
@@ -477,6 +482,7 @@
*
* See Also: ANSI Standard p.188
*/
+int
ginqdefpick(type, dev, data)
Gchar *type;
Gint dev;
@@ -527,6 +533,7 @@
/*
* XgksPicUpdatePrompt - update the locator prompt
*/
+int
XgksPicUpdatePrompt(ws, idev, newdcpt, xmev, event_id)
WS_STATE_ENTRY *ws;
INPUT_DEV *idev;
@@ -617,6 +624,7 @@
* BUT, BUT not the pointer to the structure itself
* calling program still needs that
*/
+void
XgksPicDelete(ws, idev)
WS_STATE_ENTRY *ws;
INPUT_DEV *idev;
--- a/src/lib/c/stroke.c
+++ b/src/lib/c/stroke.c
@@ -124,6 +124,7 @@
*
* See Also: ANSI Standard p.121
*/
+int
ginitstroke(ws_id, dev, init, pet, area, record)
Gint ws_id;
Gint dev;
@@ -335,6 +336,7 @@
*
* See Also: ANSI Standard p.129
*/
+int
gsetstrokemode(ws_id, dev, mode, echo)
Gint ws_id;
Gint dev;
@@ -425,6 +427,7 @@
*
* See Also: ANSI Standard p.132
*/
+Gint
greqstroke(ws_id, dev, response)
Gint ws_id;
Gint dev;
@@ -556,6 +559,7 @@
*
* See Also: ANSI Standard p.135
*/
+Gint
gsamplestroke(ws_id, dev, response)
Gint ws_id;
Gint dev;
@@ -620,6 +624,7 @@
*
* See Also: ANSI Standard p.167
*/
+Gint
ginqstrokest(ws_id, dev, type, state)
Gint ws_id;
Gint dev;
@@ -683,6 +688,7 @@
*
* See Also: ANSI Standard p.186
*/
+Gint
ginqdefstroke(type, dev, data)
Gchar *type;
Gint dev;
@@ -730,6 +736,7 @@
/*
* XgksStkUpdatePrompt - update the stroke prompt
*/
+int
XgksStkUpdatePrompt(ws, idev, pstate, newdcpt, xmev, event_id)
WS_STATE_ENTRY *ws;
INPUT_DEV *idev;
@@ -934,6 +941,7 @@
/*
* free all memory associate with a stroke logical input device
*/
+void
XgksStkDelete(ws, idev)
WS_STATE_ENTRY *ws;
INPUT_DEV *idev;
@@ -987,6 +995,7 @@
* and be able to erase it without leaving trash behind. So... this
* function will make multiple calls to XDrawLine.
*/
+int
XgksXDrawLines(dpy, win, gc, xpts, npts, mode)
Display *dpy;
Drawable win;
--- a/src/lib/c/x/xport.c
+++ b/src/lib/c/x/xport.c
@@ -94,6 +94,7 @@
* Register the SIGIO signal-handler. This routine is non-portable because
* not every platform has SIGIO.
*/
+int
sio_on(handler)
void (*handler)();
{
@@ -120,6 +121,7 @@
* Ignore SIGIO signals. This routine is non-portable because
* not every platform has SIGIO.
*/
+int
sio_off()
{
#ifdef SIGIO
@@ -143,6 +145,7 @@
* Set the process-group ID of a socket. This routine is non-portable because
* not every platform has sockets.
*/
+int
sockspgrp(fd, pid)
int fd;
pid_t pid;
@@ -162,6 +165,7 @@
* Make I/O on a socket asynchronous or not. This routine is non-portable
* because not every platform has sockets.
*/
+int
sockasync(fd, yes)
int fd;
int yes;
--- a/src/lib/c/valuator.c
+++ b/src/lib/c/valuator.c
@@ -164,6 +164,7 @@
*
* See Also: ANSI Standard p.123
*/
+int
ginitval(ws_id, dev, init, pet, area, record)
Gint ws_id, dev, pet;
Gfloat init;
@@ -269,6 +270,7 @@
*
* See Also: ANSI Standard p.129
*/
+int
gsetvalmode(ws_id, dev, mode, echo)
Gint ws_id, dev;
Gimode mode;
@@ -363,6 +365,7 @@
*
* See Also: ANSI Standard p.133
*/
+int
greqval(ws_id, dev, response)
Gint ws_id, dev;
Gqval *response;
@@ -477,6 +480,7 @@
*
* See Also: ANSI Standard p.136
*/
+int
gsampleval(ws_id, dev, response)
Gint ws_id, dev;
Gfloat *response;
@@ -530,6 +534,7 @@
*
* See Also: ANSI Standard p.168
*/
+int
ginqvalst(ws_id, dev, state)
Gint ws_id, dev;
Gvalst *state;
@@ -619,6 +624,7 @@
*
* See Also: ANSI Standard p.186
*/
+int
ginqdefval(type, dev, data)
Gchar *type;
Gint dev;
@@ -707,6 +713,7 @@
/*
* XgksValUpdatePrompt - update the locator prompt
*/
+int
XgksValUpdatePrompt(ws, idev, pstate, newdcpt, xmev, event_id)
WS_STATE_ENTRY *ws;
INPUT_DEV *idev;
@@ -873,6 +880,7 @@
* BUT, BUT not the pointer to the structure itself
* calling program still needs that
*/
+void
XgksValDelete(ws, idev)
WS_STATE_ENTRY *ws;
INPUT_DEV *idev;
--- a/src/lib/c/locator.c
+++ b/src/lib/c/locator.c
@@ -58,6 +58,7 @@
* Returns: 0, 7, 25, 38, 51, 60, 64, 65, 80, 83, 85, 93, 140, 141, 144, 145,
* 300, 2000
*/
+int
ginitloc(ws_id, dev, init, pet, area, record)
Gint ws_id; /* workstation identifier */
Gint dev; /* locator device number */
@@ -384,6 +385,7 @@
*
* Returns: 0, 7, 25, 38, 140, 300, 2000
*/
+int
gsetlocmode(ws_id, dev, mode, echo)
Gint ws_id; /* workstation identifier */
Gint dev; /* locator device number */
@@ -485,6 +487,7 @@
*
* Returns: 0, 7, 20, 25, 38, 140, 141, 300
*/
+int
greqloc(ws_id, dev, response)
Gint ws_id; /* workstation identifier */
Gint dev; /* locator device number */
@@ -607,6 +610,7 @@
*
* returns 0=ok or 7, 20, 25, 38, 140, 142
*/
+int
gsampleloc(ws_id, dev, response)
Gint ws_id; /* workstation identifier */
Gint dev; /* locator device number */
@@ -658,6 +662,7 @@
* Errors: 0, 7, 20, 25, 38, 140, 2000
*
*/
+int
ginqlocst(ws_id, dev, type, state)
Gint ws_id; /* workstation identifier */
Gint dev; /* locator device number */
@@ -720,6 +725,7 @@
* data->pets.integers are malloc'ed by GKS;
* it is the user's responsibility to free these structures.
*/
+int
ginqdefloc(type, dev, data)
Gchar *type; /* worsktation type string */
Gint dev; /* locator device number */
@@ -773,6 +779,7 @@
/*
* XgksLocUpdatePrompt - update the locator prompt
*/
+int
XgksLocUpdatePrompt(ws, idev, pstate, newdcpt, xmev, event_id)
WS_STATE_ENTRY *ws;
INPUT_DEV *idev;
@@ -1049,6 +1056,7 @@
/*
* free all memory associate with a locator logical input device
*/
+void
XgksLocDelete(ws, idev)
WS_STATE_ENTRY *ws;
INPUT_DEV *idev;
--- a/src/lib/c/string.c
+++ b/src/lib/c/string.c
@@ -140,6 +140,7 @@
*
* Returns: 0, 7, 20, 25, 38, 51, 140, 141, 144, 145, 146, 152, 300
*/
+Gint
ginitstring(ws_id, dev, init, pet, area, record)
Gint ws_id;
Gint dev;
@@ -219,6 +220,7 @@
*
* Returns: 0, 7, 20, 25, 38, 140, 143, 500
*/
+Gint
gsetstringmode(ws_id, dev, mode, echo)
Gint ws_id;
Gint dev;
@@ -280,6 +282,7 @@
*
* Returns: 0, 7, 20, 25, 38, 140, 141
*/
+Gint
greqstring(ws_id, dev, response)
Gint ws_id;
Gint dev;
@@ -355,6 +358,7 @@
* large as the buffer size specified in the call to ginitstring() or
* the default size DEF_STR_BUFSIZ.
*/
+Gint
gsamplestring(ws_id, dev, response)
Gint ws_id;
Gint dev;
@@ -400,6 +404,7 @@
*
* NOTE: state->string is malloc'ed by GKS and must be freed by the user.
*/
+Gint
ginqstringst(ws_id, dev, state)
Gint ws_id;
Gint dev;
@@ -445,6 +450,7 @@
*
* Errors: 0, 8, 22, 23, 38, 140
*/
+Gint
ginqdefstring(type, dev, data)
Gchar *type;
Gint dev;
@@ -496,6 +502,7 @@
/*
* XgksStrUpdatePrompt
*/
+int
XgksStrUpdatePrompt(ws, idev, pstate, xev, event_id)
/* PTR c1133 */
WS_STATE_ENTRY *ws;
@@ -724,6 +731,7 @@
/*
* Delete all structures used to maintain a string logical input device.
*/
+void
XgksStrDelete(ws, idev)
WS_STATE_ENTRY *ws;
INPUT_DEV *idev;
--- a/src/lib/c/inqpixel.c
+++ b/src/lib/c/inqpixel.c
@@ -45,6 +45,7 @@
#include "gks_implem.h"
+Gint
ginqpixelarraydim(ws_id, rect, dim)
Gint ws_id;
Grect *rect;
@@ -85,6 +86,7 @@
*
* See also: ANSI standard p.191
*/
+Gint
ginqpixelarray(ws_id, point, dimen, pxarr)
Gint ws_id;
Gpoint *point;
@@ -128,6 +130,7 @@
*
* See also: ANSI standard p.191
*/
+Gint
ginqpixel(ws_id, ppoint, pix)
Gint ws_id;
Gpoint *ppoint;
--- a/src/lib/c/x/xinqpixel.c
+++ b/src/lib/c/x/xinqpixel.c
@@ -56,6 +56,7 @@
* Grect *rect; rectangele pointer.
* Gipoint *dim; OUT dimensions of the pixel array.
*/
+int
xXgksInqPixelarrayDim(ws, rect, dim)
WS_STATE_PTR ws; /* workstation */
Grect *rect; /* rectangle of region of interest */
@@ -92,6 +93,7 @@
* Gpxarray *pxarr; OUT pixel array.
*
*/
+int
xXgksInqPixelarray(ws, point, dim, pxarr)
WS_STATE_PTR ws; /* workstation */
Gpoint *point; /* WC origin of desired pixel-array */
@@ -243,6 +245,7 @@
* Gint *pix; OUT pixel colour.
*
*/
+int
xXgksInqPixel(ws, ppoint, pix)
WS_STATE_PTR ws; /* workstation */
Gpoint *ppoint; /* desired-pixel position in WC */
--- a/src/lib/c/inqfillareas.c
+++ b/src/lib/c/inqfillareas.c
@@ -59,6 +59,7 @@
*
* See also: ANSI standard p.177
*/
+Gint
ginqfillfacil(ws_type, fac)
Gchar *ws_type;
Gflfac *fac;
@@ -108,6 +109,7 @@
*
* See also: ANSI standard p.178
*/
+Gint
ginqpredfillrep(ws_type, idx, rep)
Gchar *ws_type;
Gint idx;
@@ -142,6 +144,7 @@
*
* See also: ANSI standard p.161
*/
+Gint
ginqfillindices(ws_id, idxlist)
Gint ws_id;
Gintlist *idxlist;
@@ -184,6 +187,7 @@
* See also: ANSI standard p.162
*/
/*ARGSUSED*/
+Gint
ginqfillrep(ws_id, idx, type, rep)
Gint ws_id;
Gint idx;
@@ -225,6 +229,7 @@
*
* See also: ANSI standard p.179
*/
+Gint
ginqpatfacil(ws_type, fac)
Gchar *ws_type;
Gint *fac;
@@ -253,6 +258,7 @@
*
* See also: ANSI standard p.179
*/
+Gint
ginqpredpatrep(ws_type, idx, rep)
Gchar *ws_type;
Gint idx;
@@ -292,6 +298,7 @@
*
* See also: ANSI standard p.162
*/
+Gint
ginqpatindices(ws_id, idxlist)
Gint ws_id;
Gintlist *idxlist;
@@ -334,6 +341,7 @@
* See also: ANSI standard p.152
*/
/*ARGSUSED*/
+Gint
ginqpatrep(ws_id, idx, type, rep)
Gint ws_id;
Gint idx;
--- a/src/lib/c/inquiries.c
+++ b/src/lib/c/inquiries.c
@@ -62,6 +62,7 @@
/*
* INQUIRE OPERATING STATE VALUE
*/
+int
ginqopst(state)
Gos *state;
{
@@ -78,6 +79,7 @@
/*
* INQUIRE LEVEL OF GKS
*/
+int
ginqlevelgks(lev)
Glevel *lev;
{
@@ -96,6 +98,7 @@
*
* errors 0, 8
*/
+int
ginqwsmaxnum(maxws)
Gwsmax *maxws;
{
@@ -120,6 +123,7 @@
*
* errors 0, 8
*/
+int
ginqopenws(wsids)
Gintlist *wsids;
{
@@ -153,6 +157,7 @@
*
* errors 0, 8
*/
+int
ginqactivews(wsids)
Gintlist *wsids;
{
@@ -188,6 +193,7 @@
*
* errors 0, 8
*/
+int
ginqprimattr(primattr)
Gpriattr *primattr;
{
@@ -218,6 +224,7 @@
*
* errors 0, 8.
*/
+int
ginqindivattr(indivattr)
Gindattr *indivattr;
{
--- a/src/lib/c/inqtransform.c
+++ b/src/lib/c/inqtransform.c
@@ -59,6 +59,7 @@
*
* See also: ANSI Standard p.147
*/
+int
ginqcurntrannum(tran)
Gint *tran;
{
@@ -83,6 +84,7 @@
*
* See also: ANSI Standard p.147
*/
+int
ginqntrannum(tranlist)
Gintlist *tranlist;
{
@@ -115,6 +117,7 @@
*
* See also: ANSI Standard p.148
*/
+int
ginqntran(num, tran)
Gint num;
Gwstran *tran;
@@ -142,6 +145,7 @@
*
* See also: ANSI Standard p.148
*/
+int
ginqclip(clipping)
Gcliprec *clipping;
{
@@ -179,6 +183,7 @@
*
* See also: ANSI Standard p.144
*/
+int
ginqmaxntrannum(maxtran)
Gint *maxtran;
{
@@ -208,6 +213,7 @@
*
* See also: ANSI Standard p.162
*/
+int
ginqwstran(ws_id, wstran)
Gint ws_id;
Gwsti *wstran;
--- a/src/lib/c/inqWDT.c
+++ b/src/lib/c/inqWDT.c
@@ -61,6 +61,7 @@
*
* See Also: ANSI Standard p.145
*/
+Gint
ginqavailwstypes(wstypes)
Gstrlist *wstypes;
{
@@ -91,6 +92,7 @@
*
* See Also: ANSI Standard p.171
*/
+Gint
ginqdisplayspacesize(ws_type, dspsz)
Gchar *ws_type;
Gdspsize *dspsz;
@@ -129,6 +131,7 @@
*
* See Also: ANSI Standard p.170
*/
+Gint
ginqwscategory(ws_type, cat)
Gchar *ws_type;
Gwscat *cat;
@@ -173,6 +176,7 @@
*
* See Also: ANSI Standard p.171
*/
+Gint
ginqwsclass(ws_type, class)
Gchar *ws_type;
Gwsclass *class;
@@ -207,6 +211,7 @@
*
* See Also: ANSI Standard p.172
*/
+Gint
ginqmodwsattr(ws_type, dyn)
Gchar *ws_type;
Gmodws *dyn;
@@ -243,6 +248,7 @@
*
* See Also: ANSI Standard p.173
*/
+Gint
ginqdefdeferst(ws_type, def)
Gchar *ws_type;
Gdefer *def;
@@ -276,6 +282,7 @@
*
* See Also: ANSI Standard p.182
*/
+Gint
ginqmaxwssttables(ws_type, tables)
Gchar *ws_type;
Gwstables *tables;
@@ -315,6 +322,7 @@
*
* See Also: ANSI Standard p.184
*/
+Gint
ginqnumavailinput(ws_type, num)
Gchar *ws_type;
Gnumdev *num;
@@ -358,6 +366,7 @@
*
* See Also: ANSI Standard p.153
*/
+Gint
ginqwsconntype(ws_id, ct)
Gint ws_id;
Gwsct *ct;
@@ -397,6 +406,7 @@
*
* See Also: ANSI Standard p.153
*/
+Gint
ginqwsst(ws_id, state)
Gint ws_id;
Gwsstate *state;
@@ -436,6 +446,7 @@
*
* See Also: ANSI Standard p.154
*/
+Gint
ginqwsdeferupdatest(ws_id, du)
Gint ws_id;
Gwsdus *du;
--- a/src/lib/c/text.c
+++ b/src/lib/c/text.c
@@ -74,6 +74,7 @@
/*
* XgksInitGksText -- gks state list text stuff
*/
+void
XgksInitGksText()
{
xgks_state.gks_txattr.text = 1; /* text indx */
@@ -117,6 +118,7 @@
* XgksInitWssText(ws) - send the current INDIVIDUAL attributes and BUNDLE
* index to the newly opened workstation ws.
*/
+void
XgksInitWssText(ws)
WS_STATE_PTR ws;
{
@@ -145,6 +147,7 @@
*
* See Also: ANSI Standard p.93
*/
+Gint
gsetcharexpan(expansion)
Gfloat expansion;
{
@@ -176,6 +179,7 @@
*
* Note : gks_chattr.chwidth is also set here to "height"
*/
+Gint
gsetcharheight(height)
Gfloat height;
{
@@ -206,6 +210,7 @@
*
* See Also: ANSI Standard p.94
*/
+Gint
gsetcharspace(spacing)
Gfloat spacing;
{
@@ -235,6 +240,7 @@
* (in this implementation to, 1.0) at a right angle in the clockwise direction
* to the value specified by the parameter
*/
+int
gsetcharup(up_vector)
Gpoint *up_vector;
{
@@ -278,6 +284,7 @@
*
* Note: horizontal is not saying it is NORMAL to be LEFT of CENTRE.
*/
+Gint
gsettextalign(txalign)
Gtxalign *txalign;
{
@@ -313,6 +320,7 @@
*
* See Also: ANSI Standard p.94
*/
+Gint
gsettextcolourind(colour)
Gint colour;
{
@@ -344,6 +352,7 @@
*
* See Also: ANSI Standard p.93
*/
+Gint
gsettextfontprec(txfp)
Gtxfp *txfp;
{
@@ -377,6 +386,7 @@
*
* See Also: ANSI Standard p.92
*/
+Gint
gsettextind(idx)
Gint idx;
{
@@ -406,6 +416,7 @@
*
* See Also: ANSI Standard p.95
*/
+Gint
gsettextpath(path)
Gtxpath path;
{
@@ -437,6 +448,7 @@
*
* See Also: ANSI Standard p.102
*/
+Gint
gsettextrep(ws_id, idx, bundle)
Gint ws_id;
Gint idx;
@@ -499,6 +511,7 @@
* NOTE : These vectors contain information of both direction and
* magnitude
*/
+void
XgksComputeVec(up_vec, base_vec)
Gpoint *up_vec, *base_vec;
{
@@ -546,6 +559,7 @@
* See Also: ANSI Standard p.83
*
*/
+Gint
gtext(at, string)
Gpoint *at;
Gchar *string;
@@ -607,6 +621,7 @@
*
* See also: ANSI standard p.158
*/
+Gint
ginqtextextent(ws_id, position, string, extent)
Gint ws_id;
Gpoint position;
--- a/src/lib/c/segments.c
+++ b/src/lib/c/segments.c
@@ -1051,7 +1051,7 @@
*
* Will redraw the workstation if necessary
*/
- static
+static int
XgksDelAssocWs(seg, ws_id)
SEG_STATE_PTR seg;
Gint ws_id;
@@ -1173,7 +1173,7 @@
* XgksSetHighLight(ws, seg) setting/unsetting segment highlight on
* specified workstations.
*/
- static
+static void
XgksSetHighLight(ws, seg)
WS_STATE_PTR ws;
SEG_STATE_PTR seg;
@@ -1216,7 +1216,7 @@
* XgksOutputSeg (ws, seg) Output all primitive in the seg->primi_list to
* ws.
*/
- static
+static void
XgksOutputSeg(ws, seg)
WS_STATE_PTR ws;
SEG_STATE_PTR seg;
@@ -1245,7 +1245,7 @@
*
* NOTE: This function will not redraw on WISS (that is if WISS, skip )
*/
- static
+static void
XgksReDrawAssocWs(seg)
SEG_STATE_PTR seg;
{
@@ -1269,7 +1269,7 @@
* ->vis: if old != new return TRUE
* ->pri: if different return TRUE
*/
- static
+ static int
XgksIrgNec(old, new)
Gsegattr *old, *new;
{
@@ -1293,7 +1293,7 @@
/*
* XgksNewSeg() - will return a pointer to an empty segment structure
*/
- static SEG_STATE_PTR
+static SEG_STATE_PTR
XgksNewSeg()
{
SEG_STATE_PTR new;
@@ -1329,7 +1329,7 @@
* XgksInstallSeg(seg) -
* SEG_STATE_PTR seg install seg-> into the segment state hash table
*/
- static
+static void
XgksInstallSeg(seg)
SEG_STATE_PTR seg;
{
@@ -1342,7 +1342,7 @@
* XgksNewWsSeg() allocate memory for workstation segment list return
* pointer to the entry
*/
- static WS_SEG_LIST *
+static WS_SEG_LIST *
XgksNewWsSeg()
{
WS_SEG_LIST *new;
@@ -1361,7 +1361,7 @@
* The lowest possible priority is 0. The highest priority is 1. c1032
*
*/
- static
+static void
XgksInsertWsSeg(ws, seg_id)
WS_STATE_PTR ws;
Gint seg_id;
@@ -1387,7 +1387,7 @@
* INVALID if undefined
* else return the name of the deleted segment
*/
- static
+static int
XgksDeleteWsSeg(ws, seg_id)
WS_STATE_PTR ws;
Gint seg_id;
@@ -1410,7 +1410,7 @@
* XgksRenameWsSeg (ws, old, new) - rename the segment name in ws->seglist
*
*/
- static
+static void
XgksRenameWsSeg(ws, old, new)
WS_STATE_PTR ws;
Gint old, new;
@@ -1458,6 +1458,7 @@
/*
* XgksInitGksSegments() - utility function to initialize GKS segment data.
*/
+void
XgksInitGksSegments()
{
Gint i;
@@ -1478,6 +1479,7 @@
*
* See Also: ANSI Standard p.111
*/
+int
gcreateseg(name)
Gint name;
{
@@ -1535,6 +1537,7 @@
*
* See Also: ANSI Standard p.111
*/
+int
gcloseseg()
{
/* STEP 1: check for errors */
@@ -1563,6 +1566,7 @@
*
* See also: ANSI standard p.111
*/
+int
grenameseg(old, new)
Gint old, new;
{
@@ -1619,6 +1623,7 @@
*
* See Also: ANSI Standard p.112
*/
+int
gdelseg(name)
Gint name;
{
@@ -1675,6 +1680,7 @@
*
* See Also: ANSI Standard p.112
*/
+int
gdelsegws(ws_id, name)
Gint ws_id;
Gint name;
@@ -1736,6 +1742,7 @@
* detectability : .. same .. (ANSI standard p117)
* priority : 7, 120, 122, 126 (ANSI standard p117)
*/
+int
gsetsegattr(name, segattr)
Gint name;
Gsegattr *segattr;
@@ -1836,6 +1843,7 @@
*
* See Also: ANSI Standard p.99
*/
+int
gsetpickid(pick_id)
Gint pick_id;
{
@@ -1866,6 +1874,7 @@
*
* See also: ANSI standard p.113
*/
+Gint
gassocsegws(ws_id, seg_id)
Gint ws_id, seg_id;
{
@@ -1962,6 +1971,7 @@
*
* See also: ANSI standard p.113
*/
+Gint
gcopysegws(ws_id, seg_id)
Gint ws_id, seg_id;
{
@@ -2053,6 +2063,7 @@
*
* See also: ANSI standard p.114
*/
+Gint
ginsertseg(seg_id, segtran)
Gint seg_id;
Gfloat segtran[2][3];
@@ -2138,6 +2149,7 @@
*
* See also: ANSI standard p.77
*/
+Gint
gredrawsegws(ws_id)
Gint ws_id;
{
@@ -2208,6 +2220,7 @@
* XgksDeleteAllSeg (ws) delete all segments from the workstation
*
*/
+void
XgksDeleteAllSeg(ws)
WS_STATE_PTR ws;
{
@@ -2286,6 +2299,7 @@
* clip->rec; else build one with value = clip->rec
* append to list.
*/
+void
XgksAppendSegClip()
{
SEG_STATE_PTR seg;
@@ -2398,6 +2412,7 @@
* this function should only be called be re-draw
* initialted.
*/
+void
XgksReDrawSeg(ws, seg_id)
WS_STATE_PTR ws;
Gint seg_id;
@@ -2430,6 +2445,7 @@
/*
* XgksShowPick -- bound or unbound the picked segment for 1 second
*/
+void
XgksShowPick(ws, seg)
WS_STATE_PTR ws;
SEG_STATE_PTR seg;
@@ -2545,6 +2561,7 @@
* Do gredrawsegws() - with no error checking and no MO output
*
*/
+void
XgksReDrawSegWs(ws)
WS_STATE_PTR ws;
{
@@ -2563,6 +2580,7 @@
}
+void
XgksSetLineAttrMo(ws, lnattr)
WS_STATE_PTR ws;
Glnattr *lnattr;
@@ -2573,7 +2591,7 @@
XgksMoSetGraphicAttrOnWs(ws, 24, lnattr->bundl.colour);
}
-
+void
XgksSetMarkAttrMo(ws, mkattr)
WS_STATE_PTR ws;
Gmkattr *mkattr;
@@ -2584,7 +2602,7 @@
XgksMoSetGraphicAttrOnWs(ws, 28, mkattr->bundl.colour);
}
-
+void
XgksSetTextAttrMo(ws, txattr, chattr)
WS_STATE_PTR ws;
Gtxattr *txattr;
@@ -2606,6 +2624,7 @@
}
+void
XgksSetFillPatAttrMo(ws, flattr, ptattr)
WS_STATE_PTR ws;
Gflattr *flattr;
@@ -2633,6 +2652,7 @@
*
* See Also: ANSI Standard p.184
*/
+Gint
ginqmodsegattr(ws_type, dyn)
Gchar *ws_type;
Gmodseg *dyn;
@@ -2672,6 +2692,7 @@
*
* See Also: ANSI Standard p.151
*/
+Gint
ginqnameopenseg(seg)
Gint *seg;
{
@@ -2694,6 +2715,7 @@
*
* See Also: ANSI Standard p.189
*/
+Gint
ginqsegattr(segattr)
Gsegattr *segattr;
{
@@ -2727,6 +2749,7 @@
*
* See Also: ANSI Standard p.189
*/
+Gint
ginqassocws(seg, asswk)
Gint seg;
Gintlist *asswk;
@@ -2769,6 +2792,7 @@
*
* See Also: ANSI Standard p.152
*/
+Gint
ginqsegnames(segs)
Gintlist *segs;
{
@@ -2824,6 +2848,7 @@
*
* See Also: ANSI Standard p.166
*/
+Gint
ginqsegnamesws(ws_id, segs)
Gint ws_id;
Gintlist *segs;
@@ -2869,6 +2894,7 @@
*
* See Also: ANSI Standard p.183
*/
+Gint
ginqnumsegpri(ws_type, numpri)
Gchar *ws_type;
Gint *numpri;
@@ -2901,6 +2927,7 @@
*
* See Also: ANSI Standard p.148
*/
+Gint
ginqcurpickid(pickid)
Gint *pickid;
{
--- a/src/lib/c/inqtext.c
+++ b/src/lib/c/inqtext.c
@@ -62,6 +62,7 @@
*
* See also: ANSI standard p.171
*/
+Gint
ginqtextfacil(ws_type, fac)
Gchar *ws_type;
Gtxfac *fac;
@@ -114,7 +115,7 @@
*
* See also: ANSI standard p.171
*/
-
+Gint
ginqpredtextrep(ws_type, idx, rep)
Gchar *ws_type;
Gint idx;
@@ -155,6 +156,7 @@
*
* See also: ANSI standard p.152
*/
+Gint
ginqtextindices(ws_id, idxlist)
Gint ws_id;
Gintlist *idxlist;
@@ -203,6 +205,7 @@
* See also: ANSI standard p.152
*/
/*ARGSUSED*/
+Gint
ginqtextrep(ws_id, idx, type, rep)
Gint ws_id;
Gint idx;
--- a/src/lib/c/aspect_flags.c
+++ b/src/lib/c/aspect_flags.c
@@ -56,6 +56,7 @@
*
* See Also: ANSI Standard p.101
*/
+Gint
gsetasf(asf)
Gasfs *asf;
{
@@ -87,6 +88,7 @@
/*
* XgksInitGksAsf() - give gks_asfs the value GINDIVIDUAL.
*/
+void
XgksInitGksAsf()
{
xgks_state.gks_lnattr.type = GINDIVIDUAL;
--- a/src/lib/c/inqpolylines.c
+++ b/src/lib/c/inqpolylines.c
@@ -62,6 +62,7 @@
*
* See also: ANSI standard p.173
*/
+Gint
ginqlinefacil(ws_type, fac)
Gchar *ws_type;
Glnfac *fac;
@@ -115,6 +116,7 @@
*
* See also: ANSI standard p.171
*/
+Gint
ginqpredlinerep(ws_type, idx, rep)
Gchar *ws_type;
Gint idx;
@@ -153,6 +155,7 @@
*
* See also: ANSI standard p.154
*/
+Gint
ginqlineindices(ws_id, idxlist)
Gint ws_id;
Gintlist *idxlist;
@@ -201,6 +204,7 @@
* See also: ANSI standard p.152
*/
/*ARGSUSED*/
+Gint
ginqlinerep(ws_id, idx, type, rep)
Gint ws_id;
Gint idx;
--- a/src/lib/c/transforms.c
+++ b/src/lib/c/transforms.c
@@ -149,7 +149,8 @@
/*
* XgksInitGksTrans -- initialise gks state list transformation stuff
*/
-XgksInitGksTrans()
+void
+XgksInitGksTrans(void)
{
Gint i; /* Loop counter */
Glimit tmp; /* temporary limit variable */
@@ -198,6 +199,7 @@
* XgksInitWssTrans(ws) -- initialize workstation transformation stuff
* WS_STATE_PTR ws;
*/
+void
XgksInitWssTrans(ws)
WS_STATE_PTR ws;
{
@@ -242,6 +244,7 @@
*
* See also: ANSI Standard p.107
*/
+Gint
gsetwindow(trans, window)
Gint trans;
Glimit *window;
@@ -290,6 +293,7 @@
*
* See also: ANSI Standard p.107
*/
+Gint
gsetviewport(trans, viewport)
Gint trans;
Glimit *viewport;
@@ -345,6 +349,7 @@
*
* See also: ANSI Standard p.107
*/
+Gint
gsetviewportinputpri(trans, ref_trans, priority)
Gint trans, ref_trans;
Gvpri priority;
@@ -397,6 +402,7 @@
*
* See also: ANSI Standard p.108
*/
+Gint
gselntran(trans)
Gint trans;
{
@@ -429,6 +435,7 @@
*
* See also: ANSI Standard p.108
*/
+Gint
gsetclip(ind)
Gclip ind;
{
@@ -460,6 +467,7 @@
*
* See also: ANSI Standard p.109
*/
+Gint
gsetwswindow(ws_id, window)
Gint ws_id;
Glimit *window;
@@ -521,6 +529,7 @@
* <current.v> are always the same.
*/
+Gint
gsetwsviewport(ws_id, viewport)
Gint ws_id;
Glimit *viewport;
@@ -572,6 +581,7 @@
* current.
* WS_STATE_PTR ws;
*/
+void
XgksUnpendPendingTrans(ws)
WS_STATE_PTR ws;
{
@@ -655,6 +665,7 @@
* and world coordinates associated with the viewport that ALL ndcpts
* appears in, taking account for the veiwport priority.
*/
+Gint
XgksFindNTransNpts(num, ndcpts, ntrans, wcpts)
int num; /* Number of points */
Gpoint *ndcpts; /* those points in NDC space */
@@ -729,6 +740,7 @@
*
* this is done on ALL openedws[]
*/
+void
XgksUpdateWsClip(ws, bound)
WS_STATE_PTR ws;
Glimit *bound;
@@ -746,6 +758,7 @@
* WS_STATE_PTR ws;
* Glimit *v, *clip
*/
+void
XgksWsWinInterset(ws, v, clip)
WS_STATE_PTR ws;
Glimit *v, *clip;
@@ -805,6 +818,7 @@
*
* see also : ANSI Standard p.193
*/
+Gint
gevaltran(ppoint, pshift, angle, pscale, coord, result)
Gpoint *ppoint; /* pointer to the reference point */
Gpoint *pshift; /* Shift vector, w.r.t reference
@@ -893,6 +907,7 @@
*
* see also : ANSI Standard p.193
*/
+Gint
gaccumtran(segtran, ppoint, pshift, angle, pscale, coord, result)
Gfloat segtran[2][3]; /* input segment transformation */
Gpoint *ppoint; /* pointer to the reference point */
--- a/src/lib/c/x/xcolours.c
+++ b/src/lib/c/x/xcolours.c
@@ -175,7 +175,7 @@
if (XcMap_malloc(map, size))
{
/* Initialize mapping table. */
- register i;
+ register int i;
for (i = 0; i < map->length; ++i)
map->Xpixels[i] = map->GKSindexes[i] = i;
@@ -476,6 +476,7 @@
*
* @return 0 if and only if failure.
*/
+int
XcInit(ws)
WS_STATE_PTR ws; /* the GKS workstation (in/out) */
{
@@ -560,6 +561,7 @@
* 0 Error
* 1 Success
*/
+Gint
XcSetColour(ws, GKSindex, GKSrep)
WS_STATE_PTR ws; /* the GKS workstation */
Gint GKSindex; /* GKS color-index */
@@ -653,6 +655,7 @@
* OUTPUT: Success flag and modified workstation structure with NULL mapping-
* tables.
*/
+int
XcEnd(ws)
WS_STATE_PTR ws; /* the GKS workstation */
{
--- a/src/lib/c/x/xcellarray.c
+++ b/src/lib/c/x/xcellarray.c
@@ -54,6 +54,7 @@
#endif
+int
xXgksCellarray(ws, cell_ptr)
WS_STATE_PTR ws;
CELL_ARRAY_ST *cell_ptr;
--- a/src/lib/c/inqpmarker.c
+++ b/src/lib/c/inqpmarker.c
@@ -62,6 +62,7 @@
*
* See also: ANSI standard p.171
*/
+Gint
ginqmarkerfacil(ws_type, fac)
Gchar *ws_type;
Gmkfac *fac;
@@ -111,6 +112,7 @@
*
* See also: ANSI standard p.171
*/
+Gint
ginqpredmarkerrep(ws_type, idx, rep)
Gchar *ws_type;
Gint idx;
@@ -149,6 +151,7 @@
*
* See also: ANSI standard p.152
*/
+Gint
ginqmarkerindices(ws_id, idxlist)
Gint ws_id;
Gintlist *idxlist;
@@ -197,6 +200,7 @@
* See also: ANSI standard p.152
*/
/*ARGSUSED*/
+Gint
ginqmarkerrep(ws_id, idx, type, rep)
Gint ws_id;
Gint idx;
--- a/src/lib/c/x/xSet.c
+++ b/src/lib/c/x/xSet.c
@@ -45,6 +45,7 @@
#endif
+void
xXgksSetForeground(dpy, gc, fg)
Display *dpy;
GC gc;
@@ -54,6 +55,7 @@
}
+void
xXgksSetLineAttributes(dpy, gc, line_width, line_style, cap_style, join_style)
Display *dpy;
GC gc;
@@ -66,6 +68,7 @@
}
+void
xXgksSetStipple(dpy, gc, stipple)
Display *dpy;
GC gc;
@@ -75,6 +78,7 @@
}
+void
xXgksSetDashes(dpy, gc, ws, i)
Display *dpy;
GC gc;
@@ -86,7 +90,7 @@
}
-
+void
xXgksSetTile(dpy, gc, tile)
Display *dpy;
GC gc;
@@ -96,6 +100,7 @@
}
+void
xXgksSetClipMask(dpy, gc, pixmap)
Display *dpy;
GC gc;
@@ -105,6 +110,7 @@
}
+void
xXgksSetPlineClipRectangles(dpy, gc, ws, rectangle)
Display *dpy;
GC gc;
@@ -121,6 +127,7 @@
}
+void
xXgksSetPmarkerClipRectangles(dpy, gc, ws, rectangle)
Display *dpy;
GC gc;
@@ -137,6 +144,7 @@
}
+void
xXgksSetFillAreaClipRectangles(dpy, gc, ws, rectangle)
Display *dpy;
GC gc;
@@ -153,6 +161,7 @@
}
+void
xXgksSetTextClipRectangles(dpy, gc, ws, rectangle)
Display *dpy;
GC gc;
@@ -169,6 +178,7 @@
}
+void
xXgksSetFillStyle(dpy, gc, fill_style)
Display *dpy;
GC gc;
--- a/src/lib/c/open_ws.c
+++ b/src/lib/c/open_ws.c
@@ -60,7 +60,7 @@
* return TRUE if there is at least one open ws
* else return FALSE
*/
- static
+ static int
XgksOneOpenWs()
{
Gint i;
@@ -104,7 +104,7 @@
*
* set the entry in openedws[].ws_id = ws_id of gkslist to corresponding ptr
*/
- static
+ static int
XgksSetWsPtr(ws_id, ws)
Gint ws_id;
WS_STATE_PTR ws;
@@ -129,7 +129,7 @@
*
* return INVALID if there's no empty slot
*/
- static
+ static int
XgksAllocNewWs(ws_id)
Gint ws_id;
{
@@ -196,10 +196,11 @@
*
* See also: ANSI standard p.74
*/
+Gint
gopenws(ws_id, connection, ws_type)
Gint ws_id;
- Gchar *connection;
- Gchar *ws_type;
+ const Gchar *connection;
+ const Gchar *ws_type;
{
WS_STATE_PTR ws; /* workstation state list */
EWSTYPE ewstype; /* corresponding enum-valued ws_type */
@@ -323,6 +324,7 @@
*
* See also: ANSI standard p.75
*/
+Gint
gclosews(ws_id)
Gint ws_id;
{
@@ -431,6 +433,7 @@
*
* See also: ANSI standard p.77
*/
+Gint
gclearws(ws_id, control_flag)
Gint ws_id;
Gclrflag control_flag;
@@ -551,6 +554,7 @@
* XgksXReDrawWs (ws)
* WS_STATE_PTR ws; this is an X initiated redraw.
*/
+void
XgksXReDrawWs(ws)
WS_STATE_PTR ws;
{
@@ -601,6 +605,7 @@
*
* --Steve Emmerson 11/20/91
*/
+void
XgksGReDrawWs(ws)
WS_STATE_PTR ws;
{
@@ -663,6 +668,7 @@
* workstations
*
*/
+void
XgksOutputToWs(primi)
OUT_PRIMI *primi;
{
@@ -690,6 +696,7 @@
*
* Will not disable any input devices
*/
+void
XgksReDrawWs(ws, primi)
WS_STATE_PTR ws;
OUT_PRIMI *primi;
@@ -740,6 +747,7 @@
*
* Well disable all input devices before output and Enable them AFTER output
*/
+void
XgksDrawToWs(ws, primi)
WS_STATE_PTR ws;
OUT_PRIMI *primi;
@@ -791,6 +799,7 @@
* segment list
*
*/
+void
XgksAppendWsPrimi(primi)
OUT_PRIMI *primi;
{
@@ -816,6 +825,7 @@
* if yes, update clip.rec to cliprec.rec, else
* append a new CLIP_REC to the list
*/
+void
XgksAppendWsClip(rec)
Glimit *rec;
{
--- a/src/lib/c/x/xfillarea.c
+++ b/src/lib/c/x/xfillarea.c
@@ -52,6 +52,7 @@
#endif
+int
xXgksFillArea(ws, fill_ptr)
WS_STATE_PTR ws;
FILL_AREA_ST *fill_ptr;
--- a/src/lib/c/x/xpline.c
+++ b/src/lib/c/x/xpline.c
@@ -197,7 +197,7 @@
} /* input points loop */
}
-
+int
xXgksPolyLine(ws, plin_ptr)
WS_STATE_PTR ws;
PLINE_ST *plin_ptr;
--- a/src/lib/c/polylines.c
+++ b/src/lib/c/polylines.c
@@ -65,7 +65,8 @@
/*
* XgksInitGksPlines() -- initialise gks state table polyline stuff
*/
-XgksInitGksPlines()
+void
+XgksInitGksPlines(void)
{
xgks_state.gks_lnattr.line = 1; /* line indx */
xgks_state.gks_lnattr.type = GINDIVIDUAL; /* type ASF */
@@ -82,6 +83,7 @@
/*
* XgksInitWssPlines(ws) - Initialize workstation line bundle talbe
*/
+void
XgksInitWssPlines(ws)
WS_STATE_PTR ws;
{
@@ -111,6 +113,7 @@
*
* See also: ANSI standard p.82
*/
+Gint
gpolyline(num_pts, pts)
Gint num_pts;
Gpoint *pts;
@@ -166,6 +169,7 @@
*
* See also: ANSI Standard p.89
*/
+Gint
gsetlineind(idx)
Gint idx;
{
@@ -195,6 +199,7 @@
*
* See also: ANSI Standard p.89
*/
+Gint
gsetlinetype(type)
Gint type;
{
@@ -224,6 +229,7 @@
*
* See also: ANSI Standard p.90
*/
+Gint
gsetlinewidth(width)
Gfloat width;
{
@@ -253,6 +259,7 @@
*
* See also: ANSI Standard p.90
*/
+Gint
gsetlinecolourind(idx)
Gint idx;
{
@@ -283,6 +290,7 @@
*
* See also: ANSI Standard p.100
*/
+Gint
gsetlinerep(ws_id, idx, rep)
Gint ws_id;
Gint idx;
--- a/src/lib/c/open_gks.c
+++ b/src/lib/c/open_gks.c
@@ -76,6 +76,7 @@
*
* See also: Ansi standard p. 74
*/
+int
gopengks(err_file, memory)
Gfile *err_file;
/*ARGSUSED*/
@@ -110,6 +111,7 @@
*
* See also: ANSI standard p.74
*/
+int
gclosegks()
{
/* check for proper state */
--- a/src/lib/c/cellarray.c
+++ b/src/lib/c/cellarray.c
@@ -61,6 +61,7 @@
*
* See also: ANSI standard p.85
*/
+int
gcellarray(rect, dim, row, colour)
Grect *rect;
Gipoint *dim;
--- a/src/lib/c/ggdp.c
+++ b/src/lib/c/ggdp.c
@@ -26,6 +26,7 @@
*
* See also: ANSI standard p.86
*/
+int
ggdp(npoints, points, function, data)
Gint npoints; /* number of points */
Gpoint *points; /* points array */
--- a/src/lib/c/message.c
+++ b/src/lib/c/message.c
@@ -73,6 +73,7 @@
*
* See also: ANSI standard p.80
*/
+Gint
gmessage(ws_id, string)
Gint ws_id;
Gchar *string;
--- a/src/port/acsite.m4
+++ b/src/port/acsite.m4
@@ -2120,7 +2120,7 @@
cat << UD_EOF_CONFTEST_C > conftest.c
changequote(<<,>>)dnl
#include <stdio.h>
-main()
+int main(int argc, char **argv)
{
return readsub((char*)NULL) ? 0 : 1;
}
--- a/src/lib/c/polymarkers.c
+++ b/src/lib/c/polymarkers.c
@@ -65,6 +65,7 @@
/*
* XgksInitGksPmarkers-- initialise gks state list polymarker stuff
*/
+void
XgksInitGksPmarkers()
{
xgks_state.gks_mkattr.mark = 1; /* mark indx */
@@ -83,6 +84,7 @@
* XgksInitWssPmarkers(ws) - send the current INDIVIDUAL attributes and BUNDLE
* index to the newly opened workstation ws.
*/
+void
XgksInitWssPmarkers(ws)
WS_STATE_PTR ws;
{
@@ -112,6 +114,7 @@
*
* See Also: ANSI Standard p.82
*/
+Gint
gpolymarker(num_pts, pts)
Gint num_pts;
Gpoint *pts;
@@ -167,6 +170,7 @@
*
* See Also: ANSI Standard p.92
*/
+Gint
gsetmarkersize(size)
Gfloat size;
{
@@ -195,6 +199,7 @@
*
* See Also: ANSI Standard p.91
*/
+Gint
gsetmarkertype(type)
Gint type;
{
@@ -223,6 +228,7 @@
*
* See Also: ANSI Standard p.92
*/
+Gint
gsetmarkercolourind(colour)
Gint colour;
{
@@ -251,6 +257,7 @@
*
* See Also: ANSI Standard p.91
*/
+Gint
gsetmarkerind(idx)
Gint idx;
{
@@ -281,6 +288,7 @@
*
* See Also: ANSI Standard p.101
*/
+Gint
gsetmarkerrep(ws_id, idx, rep)
Gint ws_id;
Gint idx;
--- a/src/lib/c/prmgr.c
+++ b/src/lib/c/prmgr.c
@@ -102,6 +102,7 @@
* primitive with the text for the new one, because
* there should only be one message in the list.
*/
+int
XgksInsertMesgPrimi(ws, primi)
WS_STATE_PTR ws;
OUT_PRIMI *primi;
@@ -156,6 +157,7 @@
* for the list and copy content of elm over.
* OUT_PRIMI *insert_pt insertion point on the primitive list
*/
+void
XgksInsertPrimi(insert_pt, elm)
OUT_PRIMI **insert_pt, *elm;
{
@@ -175,6 +177,7 @@
* and will "FREE" all memory associated with them.
* Set head to NULL
*/
+void
XgksDeletePrimi(head, insert_pt)
OUT_PRIMI *head, **insert_pt;
{
@@ -204,6 +207,7 @@
* to to open segment or should it be append to ws non
* segment primitive list
*/
+void
XgksProcessPrimi(primi)
OUT_PRIMI *primi;
{
@@ -232,6 +236,7 @@
* corresponding x-calls, they are merely there for
* redraw purpose
*/
+void
XgksProcessClip(rec)
Glimit *rec;
{
@@ -247,6 +252,7 @@
* XgksPrimiDump (head)
*
*/
+void
XgksPrimiDump(head)
OUT_PRIMI *head;
{
@@ -267,6 +273,7 @@
*
* NOTE : everything is in NDC space
*/
+void
XgksUpdatePrimiBound(primi, bound)
OUT_PRIMI *primi;
Glimit *bound;
@@ -319,6 +326,7 @@
* bound.ymax if pt.y > bound->ymax
* bound.ymin if pt.y < bound->ymin
*/
+void
XgksMiniMax(bound, pt)
Glimit *bound;
Gpoint *pt;
--- a/src/lib/c/update.c
+++ b/src/lib/c/update.c
@@ -56,6 +56,7 @@
*
* See also: ANSI standard p.78
*/
+int
gupdatews(ws_id, regenflag)
Gint ws_id;
Gregen regenflag;
--- a/src/lib/fortran/control.fc
+++ b/src/lib/fortran/control.fc
@@ -55,6 +55,7 @@
#include <limits.h>
#include "xgks.h"
#include "gks_defines.h"
+#include "gks_implem.h"
#include "fortxgks.h"
#ifdef lint
--- a/src/lib/fortran/finqpixel.fc
+++ b/src/lib/fortran/finqpixel.fc
@@ -41,6 +41,7 @@
#include "udposix.h"
#include <stdlib.h>
#include "xgks.h"
+#include "gks_implem.h"
#include "fortxgks.h"
#ifndef lint
--- a/src/lib/fortran/inputevent.fc
+++ b/src/lib/fortran/inputevent.fc
@@ -50,6 +50,7 @@
#include <stdlib.h>
#include <string.h>
#include "xgks.h"
+#include "gks_implem.h"
#include "fortxgks.h"
#ifdef lint
--- a/src/lib/fortran/inputinit.fc
+++ b/src/lib/fortran/inputinit.fc
@@ -51,6 +51,7 @@
#include <stdlib.h>
#include <string.h>
#include "xgks.h"
+#include "gks_implem.h"
#include "fortxgks.h"
#include "pdrutils.h"
@@ -90,6 +91,7 @@
* See also: ANSI standard p.74
*/
/*FORTRAN*/
+void
ginlc(
int *wkid,
int *lcdnr,
@@ -229,6 +231,7 @@
* See also: ANSI standard p.74
*/
/*FORTRAN*/
+void
ginsk(
int *wkid,
int *skdnr,
@@ -420,6 +423,7 @@
* See also: ANSI standard p.74
*/
/*FORTRAN*/
+void
ginvl(
int *wkid,
int *vldnr,
@@ -492,6 +496,7 @@
* See also: ANSI standard p.74
*/
/*FORTRAN*/
+void
ginch(
int *wkid,
int *chdnr,
@@ -606,6 +611,7 @@
* See also: ANSI standard p.74
*/
/*FORTRAN*/
+void
ginpk(
int *wkid,
int *pkdnr,
@@ -677,6 +683,7 @@
* See also: ANSI standard
*/
/*FORTRAN*/
+void
ginst(
int *wkid,
int *stdnr,
@@ -745,6 +752,7 @@
* See also: ANSI standard
*/
/*FORTRAN*/
+void
ginsts(
int *wkid,
int *stdnr,
--- a/src/lib/fortran/escapes.fc
+++ b/src/lib/fortran/escapes.fc
@@ -94,6 +94,7 @@
* See also: ANSI standard p.80
*/
/*FORTRAN*/
+void
gessdc(int *wsid, float *xsize, float *ysize)
{
Gpoint dcsize;
@@ -116,6 +117,7 @@
* See also: ANSI standard p.80
*/
/*FORTRAN*/
+void
gessrp(int *wsid, int *store)
{
STOREAGEFLAG(*store, errgescstoreprimi);
@@ -133,6 +135,7 @@
*
*/
/*FORTRAN*/
+void
gessrn(int *wsid, int (*func)())
{
(void) gescredrawnotify(*wsid, func);
@@ -145,6 +148,7 @@
* char *conid - server connection identifier
*/
/*FORTRAN*/
+void
gescid(
char *conid
)
--- a/src/lib/fortran/inputmode.fc
+++ b/src/lib/fortran/inputmode.fc
@@ -46,6 +46,7 @@
#include "udposix.h"
#include <stdlib.h>
#include "xgks.h"
+#include "gks_implem.h"
#include "fortxgks.h"
#ifndef lint
--- a/src/lib/fortran/inputreq.fc
+++ b/src/lib/fortran/inputreq.fc
@@ -49,6 +49,7 @@
#include <stdlib.h>
#include <string.h>
#include "xgks.h"
+#include "gks_implem.h"
#include "fortxgks.h"
#ifdef lint
--- a/src/lib/fortran/inputsamp.fc
+++ b/src/lib/fortran/inputsamp.fc
@@ -48,6 +48,7 @@
#include <stdlib.h>
#include <string.h>
#include "xgks.h"
+#include "gks_implem.h"
#include "fortxgks.h"
#ifdef lint
--- a/src/lib/fortran/inqerrlist.fc
+++ b/src/lib/fortran/inqerrlist.fc
@@ -40,6 +40,7 @@
#include "udposix.h"
#include <stdlib.h>
#include "xgks.h"
+#include "gks_implem.h"
#include "fortxgks.h"
#ifndef lint
--- a/src/lib/fortran/inqgksdesc.fc
+++ b/src/lib/fortran/inqgksdesc.fc
@@ -41,6 +41,7 @@
#include "udposix.h"
#include <stdlib.h>
#include "xgks.h"
+#include "gks_implem.h"
#include "fortxgks.h"
#ifndef lint
--- a/src/lib/fortran/inqgkslist.fc
+++ b/src/lib/fortran/inqgkslist.fc
@@ -74,6 +74,7 @@
#include "udposix.h"
#include <stdlib.h>
#include "xgks.h"
+#include "gks_implem.h"
#include "fortxgks.h"
#ifndef lint
--- a/src/lib/fortran/inqseglist.fc
+++ b/src/lib/fortran/inqseglist.fc
@@ -40,6 +40,7 @@
#include "udposix.h"
#include <stdlib.h>
#include "xgks.h"
+#include "gks_implem.h"
#include "fortxgks.h"
#ifndef lint
--- a/src/lib/fortran/inqstate.fc
+++ b/src/lib/fortran/inqstate.fc
@@ -39,6 +39,7 @@
#include "udposix.h"
#include <stdlib.h>
#include "xgks.h"
+#include "gks_implem.h"
#include "fortxgks.h"
#ifndef lint
--- a/src/lib/fortran/inqwsdesc.fc
+++ b/src/lib/fortran/inqwsdesc.fc
@@ -59,6 +59,7 @@
#include <stdlib.h>
#include <string.h>
#include "xgks.h"
+#include "gks_implem.h"
#include "fortxgks.h"
#ifdef lint
--- a/src/lib/fortran/inqwslist.fc
+++ b/src/lib/fortran/inqwslist.fc
@@ -53,6 +53,7 @@
#include <stdlib.h>
#include <string.h>
#include "xgks.h"
+#include "gks_implem.h"
#include "fortxgks.h"
#ifdef lint
--- a/src/lib/fortran/meta.fc
+++ b/src/lib/fortran/meta.fc
@@ -41,6 +41,7 @@
#include "udposix.h"
#include <stdlib.h>
#include "xgks.h"
+#include "gks_implem.h"
#include "fortxgks.h"
#ifndef lint
--- a/src/lib/fortran/output.fc
+++ b/src/lib/fortran/output.fc
@@ -46,6 +46,7 @@
#include <string.h>
#include <stdlib.h>
#include "xgks.h"
+#include "gks_implem.h"
#include "fortxgks.h"
#ifdef lint
--- a/src/lib/fortran/rep.fc
+++ b/src/lib/fortran/rep.fc
@@ -44,6 +44,7 @@
#include <stddef.h>
#include <stdlib.h>
#include "xgks.h"
+#include "gks_implem.h"
#include "fortxgks.h"
#ifdef lint
--- a/src/lib/fortran/segattr.fc
+++ b/src/lib/fortran/segattr.fc
@@ -43,6 +43,7 @@
#include "udposix.h"
#include <stdlib.h>
#include "xgks.h"
+#include "gks_implem.h"
#include "fortxgks.h"
#ifndef lint
--- a/src/lib/fortran/segment.fc
+++ b/src/lib/fortran/segment.fc
@@ -46,6 +46,7 @@
#include "udposix.h"
#include <stdlib.h>
#include "xgks.h"
+#include "gks_implem.h"
#include "fortxgks.h"
#ifndef lint
--- a/src/lib/fortran/transform.fc
+++ b/src/lib/fortran/transform.fc
@@ -44,6 +44,7 @@
#include "udposix.h"
#include <stdlib.h>
#include "xgks.h"
+#include "gks_implem.h"
#include "fortxgks.h"
#ifndef lint
--- a/src/lib/fortran/utils.fc
+++ b/src/lib/fortran/utils.fc
@@ -41,6 +41,7 @@
#include <stdlib.h>
#include <string.h>
#include "xgks.h"
+#include "gks_implem.h"
#include "fortxgks.h"
#include "pdrutils.h"
--- a/src/lib/fortran/wsioutattr.fc
+++ b/src/lib/fortran/wsioutattr.fc
@@ -43,6 +43,7 @@
#include "udposix.h"
#include <stdlib.h>
#include "xgks.h"
+#include "gks_implem.h"
#include "fortxgks.h"
#ifndef lint
--- a/src/fontdb/mkfont.c
+++ b/src/fontdb/mkfont.c
@@ -40,6 +40,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
--- a/src/progs/defcolors.c
+++ b/src/progs/defcolors.c
@@ -41,6 +41,7 @@
#include "udposix.h"
#include "xgks.h"
+#include "gks_implem.h"
#include <string.h>
#include "demo.h"
--- a/src/progs/font.c
+++ b/src/progs/font.c
@@ -41,9 +41,11 @@
#include "udposix.h"
#include <stdlib.h> /* for atof() */
#include <stdio.h>
+#include <unistd.h>
#include <string.h>
#include <ctype.h>
#include "xgks.h"
+#include "gks_implem.h"
#include "demo.h"
Gint ws_id = 1;
@@ -53,6 +55,8 @@
Glimit wsw;
Glimit wsv;
+void test_font(int nfonts);
+void SetColor(int hash);
static int
show_font(font)
@@ -111,7 +115,7 @@
return 1;
}
-
+int
main(argc, argv)
int argc;
char *argv[];
@@ -212,7 +216,7 @@
return 0;
}
-
+void
perr(i, s)
int i;
char *s;
@@ -230,6 +234,7 @@
};
+void
test_font(nfonts)
int nfonts;
{
@@ -283,6 +288,7 @@
}
+void
SetColor(hash)
Gint hash;
{
--- a/src/progs/hanoi.c
+++ b/src/progs/hanoi.c
@@ -47,8 +47,11 @@
#include <string.h>
#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
#include <math.h>
#include <xgks.h>
+#include "gks_implem.h"
#include "demo.h"
#define TOWERSPC 9.0
@@ -60,12 +63,28 @@
*/
static int n = 5;
+/*
+ * tower data structures and manipulation
+ */
+
+Gfloat tcount[3] = {0.2, 0.2, 0.2};
+
+int towers[3][10] =
+ {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
+
+int towerx[3] = {0, 0, 0};
+
+Gpoint pathpts[4] = {{0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}};
+
/*
* Set up the color table.
*/
- static void
+void
SetColor(id)
+ int id;
{
Gcobundl rep;
@@ -122,122 +141,10 @@
return;
}
-
-main(argc, argv)
- int argc;
- char *argv[];
-{
- Gint ws_id = 1;
- Gint mo_id = 3;
- Glimit WsWindow;
- char *conn = (char *) NULL;
- char *mo_path = "hanoi.gksm";
- int c;
- extern char *optarg;
- extern int optind;
-
- WsWindow.xmin = 0.0;
- WsWindow.xmax = 1.0;
- WsWindow.ymin = 0.0;
- WsWindow.ymax = 0.8;
-
- while ((c = getopt(argc, argv, "d:n:o:")) != -1) {
- switch (c) {
- case 'd':
- conn = optarg;
- break;
- case 'n':
- n = atoi(optarg);
- break;
- case 'o':
- mo_path = optarg;
- break;
- }
- }
-
- gopengks(stdout, 0);
-
- gopenws(ws_id, conn, conn);
- gopenws(mo_id, mo_path, "MO");
-
- gactivatews(ws_id);
- gactivatews(mo_id);
-
- SetColor(ws_id);
- SetColor(mo_id);
-
- gsetwswindow(ws_id, &WsWindow);
- gsetwswindow(mo_id, &WsWindow);
-
- title();
-
- /*
- * solve the problem
- */
- inittower(n);
- f(n, 0, 1, 2);
-
- /*
- * close workstation and GKS
- */
- WaitForBreak(ws_id);
- gdeactivatews(mo_id);
- gdeactivatews(ws_id);
- gclosews(mo_id);
- gclosews(ws_id);
- gclosegks();
-
- return 0;
-}
-
-
-/*
- * transfer n disks from tower a to tower b using c as a spare
- *
- * transfer n-1 from a to c using b
- * move 1 from a to b
- * transfer n-1 from c to b using a
- */
-f(n, a, b, c)
- int n;
- int a;
- int b;
- int c;
-{
- if (n == 0)
- return;
-
- f(n - 1, a, c, b);
- movedisk(a, b);
- f(n - 1, c, b, a);
-}
-
-
-box(l)
- Glimit *l;
-{
- Gpoint pts[5];
-
-#define e 0.01
-
- pts[0].x = l->xmin + e;
- pts[0].y = l->ymin + e;
- pts[1].x = l->xmin + e;
- pts[1].y = l->ymax - e;
- pts[2].x = l->xmax - e;
- pts[2].y = l->ymax - e;
- pts[3].x = l->xmax - e;
- pts[3].y = l->ymin + e;
- pts[4].x = l->xmin + e;
- pts[4].y = l->ymin + e;
- gsetfillcolorind(WHITE);
- gfillarea(5, pts);
-}
-
-
/*
* print title across top of page
*/
+void
title()
{
Gpoint p;
@@ -282,90 +189,7 @@
gtext(&p, "Tower of Hanoi");
}
-
-/*
- * initialize towers with all disks on tower 0.
- */
-inittower(n)
- int n;
-{
- Glimit Window;
- Glimit Viewport;
- int i;
-
- Window.xmin = 0.0;
- Window.xmax = WINDWD;
- Window.ymin = 0.0;
- Window.ymax = WINDHT;
-
- Viewport.xmin = 0.1;
- Viewport.xmax = 0.9;
- Viewport.ymin = 0.06;
- Viewport.ymax = 0.54;
-
- gsetwindow(1, &Window);
- gsetviewport(1, &Viewport);
- border(0.0, WINDWD, 0.0, WINDHT);
-
- for (i = n; i > 0; i--)
- placedisk(0, i);
-}
-
-
-/*
- * tower data structures and manipulation
- */
-
-Gfloat tcount[3] = {0.2, 0.2, 0.2};
-
-int towers[3][10] =
- {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
-
-int towerx[3] = {0, 0, 0};
-
-
-movedisk(a, b)
-{
- int diskno;
-
- path(a, b);
- diskno = DiskRemove(a);
- unpath();
- placedisk(b, diskno);
-}
-
-
-placedisk(tower, diskno)
- int tower, diskno;
-{
- gsetfillcolorind(diskno);
- gsetfillintstyle(GSOLID);
-
- disk(diskno, TOWERSPC * (1 + tower) - (Gfloat) (diskno) /
- 2.0, tcount[tower]);
- tcount[tower] += (Gfloat) diskno;
- pushdisk(tower, diskno);
-}
-
-
-DiskRemove(tower)
- int tower;
-{
- int diskno;
-
- diskno = popdisk(tower);
- gsetfillcolorind(0);
- gsetfillintstyle(GSOLID);
-
- tcount[tower] -= (Gfloat) diskno;
- disk(diskno,
- TOWERSPC * (1 + tower) - (Gfloat) (diskno) / 2.0, tcount[tower]);
- return diskno;
-}
-
-
+void
disk(diskno, x, y)
int diskno;
Gfloat x, y;
@@ -388,14 +212,36 @@
gfillarea(4, pts);
}
+int
+popdisk(tower)
+ int tower;
+{
-Gpoint pathpts[4] = {{0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}};
+ towerx[tower]--;
+ return towers[tower][towerx[tower]];
+}
+int
+DiskRemove(tower)
+ int tower;
+{
+ int diskno;
+
+ diskno = popdisk(tower);
+ gsetfillcolorind(0);
+ gsetfillintstyle(GSOLID);
+
+ tcount[tower] -= (Gfloat) diskno;
+ disk(diskno,
+ TOWERSPC * (1 + tower) - (Gfloat) (diskno) / 2.0, tcount[tower]);
+ return diskno;
+}
/*
* draw a line from top disk of tower a to top of screen, then over
* to tower b.
*/
+void
path(a, b)
int a, b;
{
@@ -414,14 +260,95 @@
gpolyline(4, pathpts);
}
-
+void
unpath()
{
gsetlinecolorind(0);
gpolyline(4, pathpts);
}
+void
+pushdisk(tower, diskno)
+ int tower, diskno;
+{
+ towers[tower][towerx[tower]] = diskno;
+ towerx[tower]++;
+}
+
+void
+placedisk(tower, diskno)
+ int tower, diskno;
+{
+ gsetfillcolorind(diskno);
+ gsetfillintstyle(GSOLID);
+
+ disk(diskno, TOWERSPC * (1 + tower) - (Gfloat) (diskno) /
+ 2.0, tcount[tower]);
+ tcount[tower] += (Gfloat) diskno;
+ pushdisk(tower, diskno);
+}
+void
+movedisk(a, b)
+ int a, b;
+{
+ int diskno;
+
+ path(a, b);
+ diskno = DiskRemove(a);
+ unpath();
+ placedisk(b, diskno);
+}
+
+/*
+ * transfer n disks from tower a to tower b using c as a spare
+ *
+ * transfer n-1 from a to c using b
+ * move 1 from a to b
+ * transfer n-1 from c to b using a
+ */
+void
+f(n, a, b, c)
+ int n;
+ int a;
+ int b;
+ int c;
+{
+ if (n == 0)
+ return;
+
+ f(n - 1, a, c, b);
+ movedisk(a, b);
+ f(n - 1, c, b, a);
+}
+
+
+
+
+void
+box(l)
+ Glimit *l;
+{
+ Gpoint pts[5];
+
+#define e 0.01
+
+ pts[0].x = l->xmin + e;
+ pts[0].y = l->ymin + e;
+ pts[1].x = l->xmin + e;
+ pts[1].y = l->ymax - e;
+ pts[2].x = l->xmax - e;
+ pts[2].y = l->ymax - e;
+ pts[3].x = l->xmax - e;
+ pts[3].y = l->ymin + e;
+ pts[4].x = l->xmin + e;
+ pts[4].y = l->ymin + e;
+ gsetfillcolorind(WHITE);
+ gfillarea(5, pts);
+}
+
+
+void
border(x1, x2, y_1, y2)
Gfloat x1, x2, y_1, y2;
{
@@ -445,18 +372,115 @@
}
-pushdisk(tower, diskno)
- int tower, diskno;
+/*
+ * initialize towers with all disks on tower 0.
+ */
+void
+inittower(n)
+ int n;
{
- towers[tower][towerx[tower]] = diskno;
- towerx[tower]++;
+ Glimit Window;
+ Glimit Viewport;
+ int i;
+
+ Window.xmin = 0.0;
+ Window.xmax = WINDWD;
+ Window.ymin = 0.0;
+ Window.ymax = WINDHT;
+
+ Viewport.xmin = 0.1;
+ Viewport.xmax = 0.9;
+ Viewport.ymin = 0.06;
+ Viewport.ymax = 0.54;
+
+ gsetwindow(1, &Window);
+ gsetviewport(1, &Viewport);
+ border(0.0, WINDWD, 0.0, WINDHT);
+
+ for (i = n; i > 0; i--)
+ placedisk(0, i);
}
-popdisk(tower)
- int tower;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+int main(argc, argv)
+ int argc;
+ char *argv[];
{
+ Gint ws_id = 1;
+ Gint mo_id = 3;
+ Glimit WsWindow;
+ char *conn = (char *) NULL;
+ char *mo_path = "hanoi.gksm";
+ int c;
+ extern char *optarg;
+ extern int optind;
- towerx[tower]--;
- return towers[tower][towerx[tower]];
+ WsWindow.xmin = 0.0;
+ WsWindow.xmax = 1.0;
+ WsWindow.ymin = 0.0;
+ WsWindow.ymax = 0.8;
+
+ while ((c = getopt(argc, argv, "d:n:o:")) != -1) {
+ switch (c) {
+ case 'd':
+ conn = optarg;
+ break;
+ case 'n':
+ n = atoi(optarg);
+ break;
+ case 'o':
+ mo_path = optarg;
+ break;
+ }
+ }
+
+ gopengks(stdout, 0);
+
+ gopenws(ws_id, conn, conn);
+ gopenws(mo_id, mo_path, "MO");
+
+ gactivatews(ws_id);
+ gactivatews(mo_id);
+
+ SetColor(ws_id);
+ SetColor(mo_id);
+
+ gsetwswindow(ws_id, &WsWindow);
+ gsetwswindow(mo_id, &WsWindow);
+
+ title();
+
+ /*
+ * solve the problem
+ */
+ inittower(n);
+ f(n, 0, 1, 2);
+
+ /*
+ * close workstation and GKS
+ */
+ WaitForBreak(ws_id);
+ gdeactivatews(mo_id);
+ gdeactivatews(ws_id);
+ gclosews(mo_id);
+ gclosews(ws_id);
+ gclosegks();
+
+ return 0;
}
+
--- a/src/progs/demo.h
+++ b/src/progs/demo.h
@@ -55,7 +55,7 @@
#define MEDIUMGRAY BEIGE
static
-WaitForBreak( ws_id )
+int WaitForBreak( ws_id )
Gint ws_id;
{
Gchoice init;
--- a/src/progs/mi.c
+++ b/src/progs/mi.c
@@ -41,7 +41,9 @@
#include "udposix.h"
#include <stdlib.h>
#include <stdio.h>
+#include <unistd.h>
#include "xgks.h"
+#include "gks_implem.h"
#include "demo.h"
#define CLEAR_WORKSTATION 1
@@ -51,6 +53,7 @@
#define MO_WSID 3 /* Output Metafile workstation ID */
+int
main(argc, argv)
int argc;
char *argv[];
--- a/src/progs/pline.c
+++ b/src/progs/pline.c
@@ -42,9 +42,10 @@
#include <stdlib.h>
#include <stdio.h>
#include "xgks.h"
+#include "gks_implem.h"
#include <stdlib.h>
- static
+int
WaitForBreak(wsid)
Gint wsid;
{
@@ -67,42 +68,9 @@
}
-main(argc, argv)
- /*ARGSUSED*/
- int argc;
- char *argv[];
-{
- Gint ws_id = 1;
- Gint result;
-
- if ((result = gopengks(stdout, 0)) != 0)
- perr(result, "...open_gks");
-
- if ((result = gopenws(ws_id, argv[1], argv[1])) != 0)
- perr(result, "...open_ws");
-
- if ((result = gactivatews(ws_id)) != 0)
- perr(result, "...activate_ws");
-
- test_pline(ws_id);
-
- (void) fprintf(stderr, "Done, press break...\n");
-
- WaitForBreak(1);
-
- if ((result = gdeactivatews(ws_id)) != 0)
- perr(result, "...deactivate_ws");
-
- if ((result = gclosews(ws_id)) != 0)
- perr(result, "...close_ws");
-
- if ((result = gclosegks()) != 0)
- perr(result, "...close_gks");
-
- return 0;
-}
+void
perr(i, s)
int i;
char *s;
@@ -147,7 +115,7 @@
int lntbl[] = {GLN_LDASH, GLN_DDOTDASH, GLN_SDASH, GLN_SOLID,
GLN_DASH, GLN_DOT, GLN_DOTDASH};
-
+void
test_pline(ws_id)
Gint ws_id;
{
@@ -207,3 +175,39 @@
gpolyline(2, lpts);
}
}
+
+int
+main(argc, argv)
+ /*ARGSUSED*/
+ int argc;
+ char *argv[];
+{
+ Gint ws_id = 1;
+ Gint result;
+
+ if ((result = gopengks(stdout, 0)) != 0)
+ perr(result, "...open_gks");
+
+ if ((result = gopenws(ws_id, argv[1], argv[1])) != 0)
+ perr(result, "...open_ws");
+
+ if ((result = gactivatews(ws_id)) != 0)
+ perr(result, "...activate_ws");
+
+ test_pline(ws_id);
+
+ (void) fprintf(stderr, "Done, press break...\n");
+
+ WaitForBreak(1);
+
+ if ((result = gdeactivatews(ws_id)) != 0)
+ perr(result, "...deactivate_ws");
+
+ if ((result = gclosews(ws_id)) != 0)
+ perr(result, "...close_ws");
+
+ if ((result = gclosegks()) != 0)
+ perr(result, "...close_gks");
+
+ return 0;
+}
--- a/src/progs/pmark.c
+++ b/src/progs/pmark.c
@@ -42,9 +42,9 @@
#include <stdio.h>
#include <string.h>
#include "xgks.h"
+#include "gks_implem.h"
-
- static
+ int
WaitForBreak(ws_id)
Gint ws_id;
{
@@ -71,47 +71,7 @@
Gint result;
-main(argc, argv)
- int argc;
- char *argv[];
-{
- Gchar *conn = (char *) NULL;
- Gint i;
-
- for (i = 1; i < argc; i++) {
- if (strchr(argv[i], ':'))
- conn = argv[i];
- }
-
- if ((result = gopengks(stdout, 0)) != 0)
- perr(result, "...open_gks");
-
- if ((result = gopenws(ws_id, conn, conn)) != 0)
- perr(result, "...open_ws");
-
- if ((result = gactivatews(ws_id)) != 0)
- perr(result, "...activate_ws");
-
- test_pmark();
-
- (void) fprintf(stderr, "Done, press break...\n");
-
- WaitForBreak(1);
-
- if ((result = gdeactivatews(ws_id)) != 0)
- perr(result, "...deactivate_ws");
-
- if ((result = gclosews(ws_id)) != 0)
- perr(result, "...close_ws");
-
- if ((result = gclosegks()) != 0)
- perr(result, "...close_gks");
- (void) fprintf(stdout, "after close_gks\n");
-
- return 0;
-}
-
-
+void
perr(i, s)
int i;
char *s;
@@ -171,6 +131,7 @@
};
+void
test_pmark()
{
Gpoint tpt, pt;
@@ -229,3 +190,44 @@
}
}
}
+
+int
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ Gchar *conn = (char *) NULL;
+ Gint i;
+
+ for (i = 1; i < argc; i++) {
+ if (strchr(argv[i], ':'))
+ conn = argv[i];
+ }
+
+ if ((result = gopengks(stdout, 0)) != 0)
+ perr(result, "...open_gks");
+
+ if ((result = gopenws(ws_id, conn, conn)) != 0)
+ perr(result, "...open_ws");
+
+ if ((result = gactivatews(ws_id)) != 0)
+ perr(result, "...activate_ws");
+
+ test_pmark();
+
+ (void) fprintf(stderr, "Done, press break...\n");
+
+ WaitForBreak(1);
+
+ if ((result = gdeactivatews(ws_id)) != 0)
+ perr(result, "...deactivate_ws");
+
+ if ((result = gclosews(ws_id)) != 0)
+ perr(result, "...close_ws");
+
+ if ((result = gclosegks()) != 0)
+ perr(result, "...close_gks");
+ (void) fprintf(stdout, "after close_gks\n");
+
+ return 0;
+}
|