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
|
/* Curses.c, the good stuff
*
* Copyright (c) 1994-1996 William Setzer
*
* You may distribute under the terms of the Artistic License, as
* specified in the README file.
*/
#include "c-config.h"
#include "pCurses.h"
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#ifdef __PDCURSES__
#undef SP
#endif
#define C_XS_VERSION 1.02
typedef WINDOW *Curses;
typedef SCREEN *Screen;
/*
* Begin support variables and functions
*/
static char *c_function;
static int c_win, c_x, c_arg;
#define C_OPT_MV (c_x ? c_domove(win, ST(c_x-1), ST(c_x)) : OK)
#define CI_OPT_MV_AND(X) (ERR == C_OPT_MV ? ERR : X)
#define CP_OPT_MV_AND(X) (ERR == C_OPT_MV ? NULL : X)
#define CV_OPT_MV_AND(X) if (ERR != C_OPT_MV) { X; }
static void
c_countargs(fn, nargs, base)
char *fn;
int nargs;
{
switch (nargs - base)
{
case 0: c_x = 0; c_win = 0; c_arg = 0; break;
case 1: c_x = 0; c_win = 1; c_arg = 1; break;
case 2: c_x = 1; c_win = 0; c_arg = 2; break;
case 3: c_x = 2; c_win = 1; c_arg = 3; break;
default: croak("Curses function '%s' called with too %s arguments", fn,
nargs < base ? "few" : "many");
}
c_function = fn;
}
static void
c_exactargs(fn, nargs, base)
char *fn;
int nargs;
{
if (nargs != base)
croak("Curses function '%s' called with too %s arguments", fn,
nargs < base ? "few" : "many" );
}
static int
c_domove(win, sv_y, sv_x)
Curses win;
SV *sv_y;
SV *sv_x;
{
int y = (int)SvIV(sv_y);
int x = (int)SvIV(sv_x);
return wmove(win, y, x);
}
static Curses
c_sv2Curses(sv, argnum)
SV *sv;
int argnum;
{
if (sv_isa(sv, "Curses")) { return (Curses)SvIV((SV*)SvRV(sv)); }
if (argnum >= 0)
croak("argument %d to Curses function '%s' is not a Curses window",
argnum, c_function);
else
croak("argument is not a Curses window");
}
static Screen
c_sv2Screen(sv, argnum)
SV *sv;
int argnum;
{
if (sv_isa(sv, "Curses::Screen")) { return (Screen)SvIV((SV*)SvRV(sv)); }
if (argnum >= 0)
croak("argument %d to Curses function '%s' is not a Curses screen",
argnum, c_function);
else
croak("argument is not a Curses screen");
}
/* Fix cast to do the "right thing" for characters bigger than 128.
* Shame on me for being ASCII-centric. Thanks to
* win@incom.rhein-main.de (Winfried Koenig).
*/
static chtype
c_sv2chtype(sv)
SV *sv;
{
if (SvPOK(sv)) {
char *tmp = SvPV(sv,na);
return (chtype)(unsigned char)tmp[0];
}
return (chtype)SvIV(sv);
}
static void
c_chtype2sv(sv, ch)
SV *sv;
chtype ch;
{
if (ch == ERR || ch > 255) { sv_setiv(sv, (IV)ch); }
else {
char tmp[2];
tmp[0] = (char)ch;
tmp[1] = (char)0;
sv_setpv(sv, tmp);
}
}
static void
c_not_there(fn)
char *fn;
{
croak("Curses function '%s' is not defined by your vendor", fn);
}
/*
* Begin Curses functions
*/
XS(XS_Curses_addch)
{
dXSARGS;
#ifdef C_ADDCH
c_countargs("addch", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
chtype ch = c_sv2chtype(ST(c_arg));
int ret = CI_OPT_MV_AND( waddch(win, ch) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("addch");
#endif
XSRETURN(1);
}
XS(XS_Curses_addchnstr)
{
dXSARGS;
#ifdef C_ADDCHNSTR
c_countargs("addchnstr", items, 2);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
chtype *str = (chtype *)SvPV(ST(c_arg),na);
int n = (int)SvIV(ST(c_arg+1));
int ret = CI_OPT_MV_AND( waddchnstr(win, str, n) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("addchnstr");
#endif
XSRETURN(1);
}
XS(XS_Curses_addchstr)
{
dXSARGS;
#ifdef C_ADDCHSTR
c_countargs("addchstr", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
chtype *str = (chtype *)SvPV(ST(c_arg),na);
int ret = CI_OPT_MV_AND( waddchstr(win, str) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("addchstr");
#endif
XSRETURN(1);
}
XS(XS_Curses_addnstr)
{
dXSARGS;
#ifdef C_ADDNSTR
c_countargs("addnstr", items, 2);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
char * str = (char *)SvPV(ST(c_arg),na);
int n = (int)SvIV(ST(c_arg+1));
int ret = CI_OPT_MV_AND( waddnstr(win, str, n) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("addnstr");
#endif
XSRETURN(1);
}
XS(XS_Curses_addstr)
{
dXSARGS;
#ifdef C_ADDSTR
c_countargs("addstr", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
char * str = (char *)SvPV(ST(c_arg),na);
int ret = CI_OPT_MV_AND( waddstr(win, str) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("addstr");
#endif
XSRETURN(1);
}
XS(XS_Curses_attroff)
{
dXSARGS;
#ifdef C_ATTROFF
c_countargs("attroff", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
chtype attrs = c_sv2chtype(ST(c_arg));
int ret = CI_OPT_MV_AND( wattroff(win, attrs) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("attroff");
#endif
XSRETURN(1);
}
XS(XS_Curses_attron)
{
dXSARGS;
#ifdef C_ATTRON
c_countargs("attron", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
chtype attrs = c_sv2chtype(ST(c_arg));
int ret = CI_OPT_MV_AND( wattron(win, attrs) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("attron");
#endif
XSRETURN(1);
}
XS(XS_Curses_attrset)
{
dXSARGS;
#ifdef C_ATTRSET
c_countargs("attrset", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
chtype attrs = c_sv2chtype(ST(c_arg));
int ret = CI_OPT_MV_AND( wattrset(win, attrs) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("attrset");
#endif
XSRETURN(1);
}
XS(XS_Curses_baudrate)
{
dXSARGS;
#ifdef C_BAUDRATE
c_exactargs("baudrate", items, 0);
{
int ret = baudrate();
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("baudrate");
#endif
XSRETURN(1);
}
XS(XS_Curses_beep)
{
dXSARGS;
#ifdef C_BEEP
c_exactargs("beep", items, 0);
{
int ret = beep();
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("beep");
#endif
XSRETURN(1);
}
XS(XS_Curses_bkgd)
{
dXSARGS;
#ifdef C_BKGD
c_countargs("bkgd", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
chtype ch = c_sv2chtype(ST(c_arg));
int ret = CI_OPT_MV_AND( wbkgd(win, ch) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("bkgd");
#endif
XSRETURN(1);
}
XS(XS_Curses_bkgdset)
{
dXSARGS;
#ifdef C_BKGDSET
c_countargs("bkgdset", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
chtype ch = c_sv2chtype(ST(c_arg));
CV_OPT_MV_AND( wbkgdset(win, ch) );
}
#else
c_not_there("bkgdset");
#endif
XSRETURN(1);
}
XS(XS_Curses_border)
{
dXSARGS;
#ifdef C_BORDER
c_countargs("border", items, 8);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
chtype ls = c_sv2chtype(ST(c_arg));
chtype rs = c_sv2chtype(ST(c_arg+1));
chtype ts = c_sv2chtype(ST(c_arg+2));
chtype bs = c_sv2chtype(ST(c_arg+3));
chtype tl = c_sv2chtype(ST(c_arg+4));
chtype tr = c_sv2chtype(ST(c_arg+5));
chtype bl = c_sv2chtype(ST(c_arg+6));
chtype br = c_sv2chtype(ST(c_arg+7));
int ret = CI_OPT_MV_AND( wborder(win, ls, rs, ts, bs, tl,
tr, bl, br) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("border");
#endif
XSRETURN(1);
}
XS(XS_Curses_box)
{
dXSARGS;
#ifdef C_BOX
c_countargs("box", items, 2);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
chtype v = c_sv2chtype(ST(c_arg));
chtype h = c_sv2chtype(ST(c_arg+1));
int ret = CI_OPT_MV_AND( box(win, v, h) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("box");
#endif
XSRETURN(1);
}
XS(XS_Curses_can_change_color)
{
dXSARGS;
#ifdef C_CAN_CHANGE_COLOR
c_exactargs("can_change_color", items, 0);
{
int ret = can_change_color();
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("can_change_color");
#endif
XSRETURN(1);
}
XS(XS_Curses_cbreak)
{
dXSARGS;
#ifdef C_CBREAK
c_exactargs("cbreak", items, 0);
{
#ifdef C_INTCBREAK
int ret = cbreak();
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
#endif
#ifdef C_VOIDCBREAK
cbreak();
#endif
}
#else
c_not_there("cbreak");
#endif
XSRETURN(1);
}
XS(XS_Curses_clear)
{
dXSARGS;
#ifdef C_CLEAR
c_countargs("clear", items, 0);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int ret = CI_OPT_MV_AND( wclear(win) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("clear");
#endif
XSRETURN(1);
}
XS(XS_Curses_clearok)
{
dXSARGS;
#ifdef C_CLEAROK
c_countargs("clearok", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int bf = (int)SvIV(ST(c_arg));
int ret = CI_OPT_MV_AND( clearok(win, bf) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("clearok");
#endif
XSRETURN(1);
}
XS(XS_Curses_clrtobot)
{
dXSARGS;
#ifdef C_CLRTOBOT
c_countargs("clrtobot", items, 0);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int ret = CI_OPT_MV_AND( wclrtobot(win) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("clrtobot");
#endif
XSRETURN(1);
}
XS(XS_Curses_clrtoeol)
{
dXSARGS;
#ifdef C_CLRTOEOL
c_countargs("clrtoeol", items, 0);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int ret = CI_OPT_MV_AND( wclrtoeol(win) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("clrtoeol");
#endif
XSRETURN(1);
}
XS(XS_Curses_color_content)
{
dXSARGS;
#ifdef C_COLOR_CONTENT
c_exactargs("color_content", items, 4);
{
short color = (short)SvIV(ST(0));
short * r = (short *)SvPV(ST(1),na);
short * g = (short *)SvPV(ST(2),na);
short * b = (short *)SvPV(ST(3),na);
int ret = color_content(color, r, g, b);
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("color_content");
#endif
XSRETURN(1);
}
XS(XS_Curses_COLOR_PAIR)
{
dXSARGS;
#ifdef C_COLOR_PAIR
c_exactargs("COLOR_PAIR", items, 1);
{
int n = (int)SvIV(ST(0));
int ret = COLOR_PAIR(n);
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("COLOR_PAIR");
#endif
XSRETURN(1);
}
XS(XS_Curses_copywin)
{
dXSARGS;
#ifdef C_COPYWIN
c_exactargs("copywin", items, 9);
{
Curses win1 = c_sv2Curses(ST(0), 0);
Curses win2 = c_sv2Curses(ST(1), 1);
int sminr = (int)SvIV(ST(2));
int sminc = (int)SvIV(ST(3));
int dminr = (int)SvIV(ST(4));
int dminc = (int)SvIV(ST(5));
int dmaxr = (int)SvIV(ST(6));
int dmaxc = (int)SvIV(ST(7));
int overl = (int)SvIV(ST(8));
int ret = copywin(win1, win2, sminr, sminc, dminr, dminc, dmaxr,
dmaxc, overl);
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("copywin");
#endif
XSRETURN(1);
}
XS(XS_Curses_delch)
{
dXSARGS;
#ifdef C_DELCH
c_countargs("delch", items, 0);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int ret = CI_OPT_MV_AND( wdelch(win) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("delch");
#endif
XSRETURN(1);
}
XS(XS_Curses_deleteln)
{
dXSARGS;
#ifdef C_DELETELN
c_countargs("deleteln", items, 0);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int ret = CI_OPT_MV_AND( wdeleteln(win) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("deleteln");
#endif
XSRETURN(1);
}
XS(XS_Curses_delwin)
{
dXSARGS;
#ifdef C_DELWIN
c_countargs("delwin", items, 0);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int ret = CI_OPT_MV_AND( delwin(win) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("delwin");
#endif
XSRETURN(1);
}
XS(XS_Curses_derwin)
{
dXSARGS;
#ifdef C_DERWIN
c_countargs("derwin", items, 4);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int nline = (int)SvIV(ST(c_arg));
int ncol = (int)SvIV(ST(c_arg+1));
int begy = (int)SvIV(ST(c_arg+2));
int begx = (int)SvIV(ST(c_arg+3));
Curses ret = CP_OPT_MV_AND( derwin(win, nline, ncol, begy, begx) );
ST(0) = sv_newmortal();
sv_setref_pv(ST(0), "Curses", (void*)ret);
}
#else
c_not_there("derwin");
#endif
XSRETURN(1);
}
XS(XS_Curses_doupdate)
{
dXSARGS;
#ifdef C_DOUPDATE
c_exactargs("doupdate", items, 0);
{
int ret = doupdate();
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("doupdate");
#endif
XSRETURN(1);
}
XS(XS_Curses_echo)
{
dXSARGS;
#ifdef C_ECHO
c_exactargs("echo", items, 0);
{
#ifdef C_INTECHO
int ret = echo();
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
#endif
#ifdef C_VOIDECHO
echo();
#endif
}
#else
c_not_there("echo");
#endif
XSRETURN(1);
}
XS(XS_Curses_echochar)
{
dXSARGS;
#ifdef C_ECHOCHAR
c_countargs("echochar", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
chtype ch = c_sv2chtype(ST(c_arg));
int ret = CI_OPT_MV_AND( wechochar(win, ch) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("echochar");
#endif
XSRETURN(1);
}
XS(XS_Curses_endwin)
{
dXSARGS;
#ifdef C_ENDWIN
c_exactargs("endwin", items, 0);
{
int ret = endwin();
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("endwin");
#endif
XSRETURN(1);
}
XS(XS_Curses_erase)
{
dXSARGS;
#ifdef C_ERASE
c_countargs("erase", items, 0);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int ret = CI_OPT_MV_AND( werase(win) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("erase");
#endif
XSRETURN(1);
}
XS(XS_Curses_erasechar)
{
dXSARGS;
#ifdef C_ERASECHAR
c_exactargs("erasechar", items, 0);
{
char ret = erasechar();
ST(0) = sv_newmortal();
sv_setpvn(ST(0), (char *)&ret, 1);
}
#else
c_not_there("erasechar");
#endif
XSRETURN(1);
}
XS(XS_Curses_flash)
{
dXSARGS;
#ifdef C_FLASH
c_exactargs("flash", items, 0);
{
int ret = flash();
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("flash");
#endif
XSRETURN(1);
}
XS(XS_Curses_flushinp)
{
dXSARGS;
#ifdef C_FLUSHINP
c_exactargs("flushinp", items, 0);
{
int ret = flushinp();
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("flushinp");
#endif
XSRETURN(1);
}
XS(XS_Curses_flusok)
{
dXSARGS;
#ifdef C_FLUSOK
c_countargs("flusok", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int bf = (int)SvIV(ST(c_arg));
flusok(win, bf);
}
#else
c_not_there("flusok");
#endif
XSRETURN(1);
}
XS(XS_Curses_getattrs)
{
dXSARGS;
#ifdef C_GETATTRS
c_countargs("getattrs", items, 0);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int ret = CI_OPT_MV_AND( getattrs(win) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("getattrs");
#endif
XSRETURN(1);
}
XS(XS_Curses_getbegyx)
{
dXSARGS;
#ifdef C_GETBEGYX
c_countargs("getbegyx", items, 2);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int y, x;
getbegyx(win, y, x);
sv_setiv(ST(c_arg), (IV)y);
sv_setiv(ST(c_arg+1), (IV)x);
}
#else
c_not_there("getbegyx");
#endif
XSRETURN(1);
}
XS(XS_Curses_getbkgd)
{
dXSARGS;
#ifdef C_GETBKGD
c_countargs("getbkgd", items, 0);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int ret = CI_OPT_MV_AND( getbkgd(win) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("getbkgd");
#endif
XSRETURN(1);
}
XS(XS_Curses_getcap)
{
dXSARGS;
#ifdef C_GETCAP
c_exactargs("getcap", items, 1);
{
char * term = (char *)SvPV(ST(0),na);
char * ret = (char *)getcap(term);
ST(0) = sv_newmortal();
sv_setpv((SV*)ST(0), ret);
}
#else
c_not_there("getcap");
#endif
XSRETURN(1);
}
XS(XS_Curses_getch)
{
dXSARGS;
#ifdef C_GETCH
c_countargs("getch", items, 0);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
chtype ret = CI_OPT_MV_AND( wgetch(win) );
ST(0) = sv_newmortal();
c_chtype2sv(ST(0), ret);
}
#else
c_not_there("getch");
#endif
XSRETURN(1);
}
XS(XS_Curses_getmaxyx)
{
dXSARGS;
#ifdef C_GETMAXYX
c_countargs("getmaxyx", items, 2);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int y, x;
getmaxyx(win, y, x);
sv_setiv(ST(c_arg), (IV)y);
sv_setiv(ST(c_arg+1), (IV)x);
}
#else
c_not_there("getmaxyx");
#endif
XSRETURN(1);
}
XS(XS_Curses_getnstr)
{
dXSARGS;
#ifdef C_GETNSTR
c_countargs("getnstr", items, 2);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int n = (int)SvIV(ST(c_arg+1));
char * str = (char *)sv_grow(ST(c_arg),n+1);
int ret = CI_OPT_MV_AND( wgetnstr(win, str, n) );
if (ret != ERR)
{
SvCUR(ST(c_arg)) = strlen(str);
SvPOK_only(ST(c_arg));
*SvEND(ST(c_arg)) = '\0';
}
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("getnstr");
#endif
XSRETURN(1);
}
XS(XS_Curses_getparyx)
{
dXSARGS;
#ifdef C_GETPARYX
c_countargs("getparyx", items, 2);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int y, x;
getparyx(win, y, x);
sv_setiv(ST(c_arg), (IV)y);
sv_setiv(ST(c_arg+1), (IV)x);
}
#else
c_not_there("getparyx");
#endif
XSRETURN(1);
}
/* 250 bytes is a WAG: they could still overflow the buffer */
XS(XS_Curses_getstr)
{
dXSARGS;
#ifdef C_GETSTR
c_countargs("getstr", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
char * str = sv_grow(ST(c_arg), 250);
int ret = CI_OPT_MV_AND( wgetstr(win, str) );
if (ret != ERR)
{
SvCUR(ST(c_arg)) = strlen(str);
SvPOK_only(ST(c_arg));
*SvEND(ST(c_arg)) = '\0';
}
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("getstr");
#endif
XSRETURN(1);
}
XS(XS_Curses_gettmode)
{
dXSARGS;
#ifdef C_GETTMODE
c_exactargs("gettmode", items, 0);
{
int ret = gettmode();
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("gettmode");
#endif
XSRETURN(1);
}
XS(XS_Curses_getyx)
{
dXSARGS;
#ifdef C_GETYX
c_countargs("getyx", items, 2);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int y, x;
getyx(win, y, x);
sv_setiv(ST(c_arg), (IV)y);
sv_setiv(ST(c_arg+1), (IV)x);
}
#else
c_not_there("getyx");
#endif
XSRETURN(1);
}
XS(XS_Curses_halfdelay)
{
dXSARGS;
#ifdef C_HALFDELAY
c_exactargs("halfdelay", items, 1);
{
int t = (int)SvIV(ST(0));
int ret = halfdelay(t);
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("halfdelay");
#endif
XSRETURN(1);
}
XS(XS_Curses_has_colors)
{
dXSARGS;
#ifdef C_HAS_COLORS
c_exactargs("has_colors", items, 0);
{
int ret = has_colors();
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("has_colors");
#endif
XSRETURN(1);
}
XS(XS_Curses_has_ic)
{
dXSARGS;
#ifdef C_HAS_IC
c_exactargs("has_ic", items, 0);
{
int ret = has_ic();
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("has_ic");
#endif
XSRETURN(1);
}
XS(XS_Curses_has_il)
{
dXSARGS;
#ifdef C_HAS_IL
c_exactargs("has_il", items, 0);
{
int ret = has_il();
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("has_il");
#endif
XSRETURN(1);
}
XS(XS_Curses_hline)
{
dXSARGS;
#ifdef C_HLINE
c_countargs("hline", items, 2);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
chtype ch = c_sv2chtype(ST(c_arg));
int n = (int)SvIV(ST(c_arg+1));
int ret = CI_OPT_MV_AND( whline(win, ch, n) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("hline");
#endif
XSRETURN(1);
}
XS(XS_Curses_idcok)
{
dXSARGS;
#ifdef C_IDCOK
c_countargs("idcok", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int bf = (int)SvIV(ST(c_arg));
idcok(win, bf);
}
#else
c_not_there("idcok");
#endif
XSRETURN(1);
}
XS(XS_Curses_idlok)
{
dXSARGS;
#ifdef C_IDLOK
c_countargs("idlok", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int bf = (int)SvIV(ST(c_arg));
#ifdef C_INTIDLOK
int ret = CI_OPT_MV_AND( idlok(win, bf) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
#endif
#ifdef C_VOIDIDLOK
CV_OPT_MV_AND( idlok(win, bf) );
#endif
}
#else
c_not_there("idlok");
#endif
XSRETURN(1);
}
XS(XS_Curses_immedok)
{
dXSARGS;
#ifdef C_IMMEDOK
c_countargs("immedok", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int bf = (int)SvIV(ST(c_arg));
immedok(win, bf);
}
#else
c_not_there("immedok");
#endif
XSRETURN(1);
}
XS(XS_Curses_inch)
{
dXSARGS;
#ifdef C_INCH
c_countargs("inch", items, 0);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
chtype ret = CI_OPT_MV_AND( winch(win) );
ST(0) = sv_newmortal();
c_chtype2sv(ST(0), ret);
}
#else
c_not_there("inch");
#endif
XSRETURN(1);
}
XS(XS_Curses_inchnstr)
{
dXSARGS;
#ifdef C_INCHNSTR
c_countargs("inchnstr", items, 2);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int n = (int)SvIV(ST(c_arg+1));
chtype *str = (chtype *)sv_grow(ST(c_arg), (n+1)*sizeof(chtype));
int ret = CI_OPT_MV_AND( winchnstr(win, str, n) );
/* We should probably try to terminate `str' here, but there's
* no real way to tell when we're at the end. So we just hope.
*/
if (ret != ERR)
{
SvCUR(ST(c_arg)) = (n+1) * sizeof(chtype);
SvPOK_only(ST(c_arg));
}
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("inchnstr");
#endif
XSRETURN(1);
}
/* 250 bytes is a WAG: they could still overflow the buffer */
XS(XS_Curses_inchstr)
{
dXSARGS;
#ifdef C_INCHSTR
c_countargs("inchstr", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
chtype *str = (chtype *)sv_grow(ST(c_arg),250 * sizeof(chtype));
int ret = CI_OPT_MV_AND( winchstr(win, str) );
/* We should probably try to terminate `str' here, but there's
* no real way to tell when we're at the end. So we just hope.
*/
if (ret != ERR)
{
SvCUR(ST(c_arg)) = 250 * sizeof(chtype);
SvPOK_only(ST(c_arg));
}
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("inchstr");
#endif
XSRETURN(1);
}
XS(XS_Curses_initscr)
{
dXSARGS;
#ifdef C_INITSCR
c_exactargs("initscr", items, 0);
{
Curses ret = initscr();
ST(0) = sv_newmortal();
sv_setref_pv(ST(0), "Curses", (void*)ret);
}
#else
c_not_there("initscr");
#endif
XSRETURN(1);
}
XS(XS_Curses_init_color)
{
dXSARGS;
#ifdef C_INIT_COLOR
c_exactargs("init_color", items, 4);
{
short color = (short)SvIV(ST(0));
short r = (short)SvIV(ST(1));
short g = (short)SvIV(ST(2));
short b = (short)SvIV(ST(3));
int ret = init_color(color, r, g, b);
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("init_color");
#endif
XSRETURN(1);
}
XS(XS_Curses_init_pair)
{
dXSARGS;
#ifdef C_INIT_PAIR
c_exactargs("init_pair", items, 3);
{
short pair = (short)SvIV(ST(0));
short f = (short)SvIV(ST(1));
short b = (short)SvIV(ST(2));
int ret = init_pair(pair, f, b);
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("init_pair");
#endif
XSRETURN(1);
}
XS(XS_Curses_innstr)
{
dXSARGS;
#ifdef C_INNSTR
c_countargs("innstr", items, 2);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
char * str = (char *)SvPV(ST(c_arg),na);
int n = (int)SvIV(ST(c_arg+1));
int ret = CI_OPT_MV_AND( winnstr(win, str, n) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("innstr");
#endif
XSRETURN(1);
}
XS(XS_Curses_insch)
{
dXSARGS;
#ifdef C_INSCH
c_countargs("insch", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
chtype ch = c_sv2chtype(ST(c_arg));
int ret = CI_OPT_MV_AND( winsch(win, ch) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("insch");
#endif
XSRETURN(1);
}
XS(XS_Curses_insdelln)
{
dXSARGS;
#ifdef C_INSDELLN
c_countargs("insdelln", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int id = (int)SvIV(ST(c_arg));
int ret = CI_OPT_MV_AND( winsdelln(win, id) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("insdelln");
#endif
XSRETURN(1);
}
XS(XS_Curses_insertln)
{
dXSARGS;
#ifdef C_INSERTLN
c_countargs("insertln", items, 0);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int ret = CI_OPT_MV_AND( winsertln(win) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("insertln");
#endif
XSRETURN(1);
}
XS(XS_Curses_insnstr)
{
dXSARGS;
#ifdef C_INSNSTR
c_countargs("insnstr", items, 2);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int n = (int)SvIV(ST(c_arg+1));
char * str = sv_grow(ST(c_arg),n+1);
int ret = CI_OPT_MV_AND( winsnstr(win, str, n) );
if (ret != ERR)
{
SvCUR(ST(c_arg)) = strlen(str);
SvPOK_only(ST(c_arg));
*SvEND(ST(c_arg)) = '\0';
}
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("insnstr");
#endif
XSRETURN(1);
}
XS(XS_Curses_insstr)
{
dXSARGS;
#ifdef C_INSSTR
c_countargs("insstr", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
char * str = (char *)SvPV(ST(c_arg),na);
int ret = CI_OPT_MV_AND( winsstr(win, str) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("insstr");
#endif
XSRETURN(1);
}
/* 250 bytes is a WAG: they could still overflow the buffer */
XS(XS_Curses_instr)
{
dXSARGS;
#ifdef C_INSTR
c_countargs("instr", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
char * str = (char *)sv_grow(ST(c_arg), 250);
int ret = CI_OPT_MV_AND( winstr(win, str) );
if (ret != ERR)
{
SvCUR(ST(c_arg)) = strlen(str);
SvPOK_only(ST(c_arg));
*SvEND(ST(c_arg)) = '\0';
}
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("instr");
#endif
XSRETURN(1);
}
XS(XS_Curses_intrflush)
{
dXSARGS;
#ifdef C_INTRFLUSH
c_countargs("intrflush", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int bf = (int)SvIV(ST(c_arg));
int ret = CI_OPT_MV_AND( intrflush(win, bf) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("intrflush");
#endif
XSRETURN(1);
}
XS(XS_Curses_isendwin)
{
dXSARGS;
#ifdef C_ISENDWIN
c_exactargs("isendwin", items, 0);
{
int ret = isendwin();
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("isendwin");
#endif
XSRETURN(1);
}
XS(XS_Curses_is_linetouched)
{
dXSARGS;
#ifdef C_IS_LINETOUCHED
c_countargs("is_linetouched", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int line = (int)SvIV(ST(c_arg));
int ret = CI_OPT_MV_AND( is_linetouched(win, line) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("is_linetouched");
#endif
XSRETURN(1);
}
XS(XS_Curses_is_wintouched)
{
dXSARGS;
#ifdef C_IS_WINTOUCHED
c_countargs("is_wintouched", items, 0);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int ret = CI_OPT_MV_AND( is_wintouched(win) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("is_wintouched");
#endif
XSRETURN(1);
}
XS(XS_Curses_keyname)
{
dXSARGS;
#ifdef C_KEYNAME
c_exactargs("keyname", items, 1);
{
int k = (int)SvIV(ST(0));
char * ret = keyname(k);
ST(0) = sv_newmortal();
sv_setpv((SV*)ST(0), ret);
}
#else
c_not_there("keyname");
#endif
XSRETURN(1);
}
XS(XS_Curses_keypad)
{
dXSARGS;
#ifdef C_KEYPAD
c_countargs("keypad", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int bf = (int)SvIV(ST(c_arg));
int ret = keypad(win, bf);
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("keypad");
#endif
XSRETURN(1);
}
XS(XS_Curses_killchar)
{
dXSARGS;
#ifdef C_KILLCHAR
c_exactargs("killchar", items, 0);
{
char ret = killchar();
ST(0) = sv_newmortal();
sv_setpvn(ST(0), (char *)&ret, 1);
}
#else
c_not_there("killchar");
#endif
XSRETURN(1);
}
XS(XS_Curses_leaveok)
{
dXSARGS;
#ifdef C_LEAVEOK
c_countargs("leaveok", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int bf = (int)SvIV(ST(c_arg));
int ret = CI_OPT_MV_AND( leaveok(win, bf) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("leaveok");
#endif
XSRETURN(1);
}
XS(XS_Curses_longname)
{
dXSARGS;
#ifdef C_LONGNAME
/* there are two versions of longname */
/* one has 0 args, one has 2 */
#ifdef C_LONG0ARGS
c_exactargs("longname", items, 0);
{
char * ret = longname();
#endif
#ifdef C_LONG2ARGS
c_exactargs("longname", items, 2);
{
char * a = (char *)SvPV(ST(0),na);
char * b = (char *)SvPV(ST(1),na);
char * ret = longname(a, b);
#endif
ST(0) = sv_newmortal();
sv_setpv((SV*)ST(0), ret);
}
#else
c_not_there("longname");
#endif
XSRETURN(1);
}
XS(XS_Curses_meta)
{
dXSARGS;
#ifdef C_META
c_countargs("meta", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int bf = (int)SvIV(ST(c_arg));
int ret = meta(win, bf);
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("meta");
#endif
XSRETURN(1);
}
XS(XS_Curses_move)
{
dXSARGS;
#ifdef C_MOVE
c_countargs("move", items, 2);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int y = (int)SvIV(ST(c_arg));
int x = (int)SvIV(ST(c_arg+1));
int ret = CI_OPT_MV_AND( wmove(win, y, x) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("move");
#endif
XSRETURN(1);
}
XS(XS_Curses_mvcur)
{
dXSARGS;
#ifdef C_MVCUR
c_exactargs("mvcur", items, 4);
{
int a = (int)SvIV(ST(0));
int b = (int)SvIV(ST(1));
int c = (int)SvIV(ST(2));
int d = (int)SvIV(ST(3));
int ret = mvcur(a, b, c, d);
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("mvcur");
#endif
XSRETURN(1);
}
XS(XS_Curses_mvwin)
{
dXSARGS;
#ifdef C_MVWIN
c_countargs("mvwin", items, 2);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int by = (int)SvIV(ST(c_arg));
int bx = (int)SvIV(ST(c_arg+1));
int ret = CI_OPT_MV_AND( mvwin(win, by, bx) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("mvwin");
#endif
XSRETURN(1);
}
XS(XS_Curses_newpad)
{
dXSARGS;
#ifdef C_NEWPAD
c_exactargs("newpad", items, 2);
{
int l = (int)SvIV(ST(0));
int c = (int)SvIV(ST(1));
Curses ret = newpad(l, c);
ST(0) = sv_newmortal();
sv_setref_pv(ST(0), "Curses", (void*)ret);
}
#else
c_not_there("newpad");
#endif
XSRETURN(1);
}
XS(XS_Curses_newwin)
{
dXSARGS;
#ifdef C_NEWWIN
c_exactargs("newwin", items, 4);
{
int nlines = (int)SvIV(ST(0));
int ncols = (int)SvIV(ST(1));
int begy = (int)SvIV(ST(2));
int begx = (int)SvIV(ST(3));
Curses ret = newwin(nlines, ncols, begy, begx);
ST(0) = sv_newmortal();
sv_setref_pv(ST(0), "Curses", (void*)ret);
}
#else
c_not_there("newwin");
#endif
XSRETURN(1);
}
XS(XS_Curses_nl)
{
dXSARGS;
#ifdef C_NL
c_exactargs("nl", items, 0);
{
#ifdef C_INTNL
int ret = nl();
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
#endif
#ifdef C_VOIDNL
nl();
#endif
}
#else
c_not_there("nl");
#endif
XSRETURN(1);
}
XS(XS_Curses_nocbreak)
{
dXSARGS;
#ifdef C_NOCBREAK
c_exactargs("nocbreak", items, 0);
{
#ifdef C_INTNOCBREAK
int ret = nocbreak();
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
#endif
#ifdef C_VOIDNOCBREAK
cbreak();
#endif
}
#else
c_not_there("nocbreak");
#endif
XSRETURN(1);
}
XS(XS_Curses_nodelay)
{
dXSARGS;
#ifdef C_NODELAY
c_countargs("nodelay", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int bf = (int)SvIV(ST(c_arg));
int ret = CI_OPT_MV_AND( nodelay(win, bf) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("nodelay");
#endif
XSRETURN(1);
}
XS(XS_Curses_noecho)
{
dXSARGS;
#ifdef C_NOECHO
c_exactargs("noecho", items, 0);
{
#ifdef C_INTNOECHO
int ret = noecho();
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
#endif
#ifdef C_VOIDNOECHO
noecho();
#endif
}
#else
c_not_there("noecho");
#endif
XSRETURN(1);
}
XS(XS_Curses_nonl)
{
dXSARGS;
#ifdef C_NONL
c_countargs("nonl", items, 0);
{
#ifdef C_INTNONL
int ret = nonl();
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
#endif
#ifdef C_VOIDNONL
nonl();
#endif
}
#else
c_not_there("nonl");
#endif
XSRETURN(1);
}
XS(XS_Curses_noqiflush)
{
dXSARGS;
#ifdef C_NOQIFLUSH
c_countargs("noqiflush", items, 0);
{
noqiflush();
}
#else
c_not_there("noqiflush");
#endif
XSRETURN(1);
}
XS(XS_Curses_noraw)
{
dXSARGS;
#ifdef C_NORAW
c_exactargs("noraw", items, 0);
{
#ifdef C_INTRAW
int ret = noraw();
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
#endif
#ifdef C_VOIDRAW
noraw();
#endif
}
#else
c_not_there("noraw");
#endif
XSRETURN(1);
}
XS(XS_Curses_notimeout)
{
dXSARGS;
#ifdef C_NOTIMEOUT
c_countargs("notimeout", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int bf = (int)SvIV(ST(c_arg));
int ret = CI_OPT_MV_AND( notimeout(win, bf) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("notimeout");
#endif
XSRETURN(1);
}
XS(XS_Curses_noutrefresh)
{
dXSARGS;
#ifdef C_NOUTREFRESH
c_countargs("noutrefresh", items, 0);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int ret = CI_OPT_MV_AND( wnoutrefresh(win) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("noutrefresh");
#endif
XSRETURN(1);
}
XS(XS_Curses_overlay)
{
dXSARGS;
#ifdef C_OVERLAY
c_exactargs("overlay", items, 2);
{
Curses win1 = c_sv2Curses(ST(0), 0);
Curses win2 = c_sv2Curses(ST(1), 1);
int ret = overlay(win1, win2);
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("overlay");
#endif
XSRETURN(1);
}
XS(XS_Curses_overwrite)
{
dXSARGS;
#ifdef C_OVERWRITE
c_exactargs("overwrite", items, 2);
{
Curses win1 = c_sv2Curses(ST(0), 0);
Curses win2 = c_sv2Curses(ST(1), 1);
int ret = overwrite(win1, win2);
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("overwrite");
#endif
XSRETURN(1);
}
XS(XS_Curses_pair_content)
{
dXSARGS;
#ifdef C_PAIR_CONTENT
c_exactargs("pair_content", items, 3);
{
short color = (short)SvIV(ST(0));
short * f = (short *)SvPV(ST(1),na);
short * b = (short *)SvPV(ST(2),na);
int ret = pair_content(color, f, b);
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("pair_content");
#endif
XSRETURN(1);
}
XS(XS_Curses_PAIR_NUMBER)
{
dXSARGS;
#ifdef C_PAIR_NUMBER
c_exactargs("PAIR_NUMBER", items, 1);
{
chtype a = c_sv2chtype(ST(0));
int ret = PAIR_NUMBER(a);
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("PAIR_NUMBER");
#endif
XSRETURN(1);
}
XS(XS_Curses_pechochar)
{
dXSARGS;
#ifdef C_PECHOCHAR
c_exactargs("pechochar", items, 2);
{
Curses pad = c_sv2Curses(ST(0), 0);
chtype ch = c_sv2chtype(ST(1));
int ret = pechochar(pad, ch);
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("pechochar");
#endif
XSRETURN(1);
}
XS(XS_Curses_pnoutrefresh)
{
dXSARGS;
#ifdef C_PNOUTREFRESH
c_exactargs("pnoutrefresh", items, 7);
{
Curses win = c_sv2Curses(ST(0), 0);
int pminr = (int)SvIV(ST(1));
int pminc = (int)SvIV(ST(2));
int sminr = (int)SvIV(ST(3));
int sminc = (int)SvIV(ST(4));
int smaxr = (int)SvIV(ST(5));
int smaxc = (int)SvIV(ST(6));
int ret = pnoutrefresh(win, pminr, pminc, sminr, sminc,
smaxr, smaxc);
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("pnoutrefresh");
#endif
XSRETURN(1);
}
XS(XS_Curses_prefresh)
{
dXSARGS;
#ifdef C_PREFRESH
c_exactargs("prefresh", items, 7);
{
Curses win = c_sv2Curses(ST(0), 0);
int pminr = (int)SvIV(ST(1));
int pminc = (int)SvIV(ST(2));
int sminr = (int)SvIV(ST(3));
int sminc = (int)SvIV(ST(4));
int smaxr = (int)SvIV(ST(5));
int smaxc = (int)SvIV(ST(6));
int ret = prefresh(win, pminr, pminc, sminr, sminc,
smaxr, smaxc);
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("prefresh");
#endif
XSRETURN(1);
}
XS(XS_Curses_qiflush)
{
dXSARGS;
#ifdef C_QIFLUSH
c_countargs("qiflush", items, 0);
{
noqiflush();
}
#else
c_not_there("qiflush");
#endif
XSRETURN(1);
}
XS(XS_Curses_raw)
{
dXSARGS;
#ifdef C_RAW
c_exactargs("raw", items, 0);
{
#ifdef C_INTRAW
int ret = raw();
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
#endif
#ifdef C_VOIDRAW
raw();
#endif
}
#else
c_not_there("raw");
#endif
XSRETURN(1);
}
XS(XS_Curses_refresh)
{
dXSARGS;
#ifdef C_REFRESH
c_countargs("refresh", items, 0);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int ret = CI_OPT_MV_AND( wrefresh(win) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("refresh");
#endif
XSRETURN(1);
}
XS(XS_Curses_resetty)
{
dXSARGS;
#ifdef C_RESETTY
c_exactargs("resetty", items, 0);
{
resetty();
}
#else
c_not_there("resetty");
#endif
XSRETURN(1);
}
XS(XS_Curses_savetty)
{
dXSARGS;
#ifdef C_SAVETTY
c_exactargs("savetty", items, 0);
{
savetty();
}
#else
c_not_there("savetty");
#endif
XSRETURN(1);
}
XS(XS_Curses_scrl)
{
dXSARGS;
#ifdef C_SCRL
c_countargs("scrl", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int n = (int)SvIV(ST(c_arg));
int ret = wscrl(win, n);
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("scrl");
#endif
XSRETURN(1);
}
XS(XS_Curses_scroll)
{
dXSARGS;
#ifdef C_SCROLL
c_countargs("scroll", items, 0);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int ret = CI_OPT_MV_AND( scroll(win) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("scroll");
#endif
XSRETURN(1);
}
XS(XS_Curses_scrollok)
{
dXSARGS;
#ifdef C_SCROLLOK
c_countargs("scrollok", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int bf = (int)SvIV(ST(c_arg));
int ret = CI_OPT_MV_AND( scrollok(win, bf) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("scrollok");
#endif
XSRETURN(1);
}
XS(XS_Curses_setscrreg)
{
dXSARGS;
#ifdef C_SETSCRREG
c_countargs("setscrreg", items, 2);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int t = (int)SvIV(ST(c_arg));
int b = (int)SvIV(ST(c_arg+1));
int ret = CI_OPT_MV_AND( wsetscrreg(win, t, b) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("setscrreg");
#endif
XSRETURN(1);
}
XS(XS_Curses_setterm)
{
dXSARGS;
#ifdef C_SETTERM
c_exactargs("setterm", items, 1);
{
char * str = (char *)SvPV(ST(0),na);
int ret = setterm(str);
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("setterm");
#endif
XSRETURN(1);
}
XS(XS_Curses_slk_clear)
{
dXSARGS;
#ifdef C_SLK_CLEAR
c_exactargs("slk_clear", items, 0);
{
int ret = slk_clear();
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("slk_clear");
#endif
XSRETURN(1);
}
XS(XS_Curses_slk_init)
{
dXSARGS;
#ifdef C_SLK_INIT
c_exactargs("slk_init", items, 1);
{
int labfmt = (int)SvIV(ST(0));
int ret = slk_init(labfmt);
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("slk_init");
#endif
XSRETURN(1);
}
XS(XS_Curses_slk_label)
{
dXSARGS;
#ifdef C_SLK_LABEL
c_exactargs("slk_label", items, 1);
{
int labnum = (int)SvIV(ST(0));
char * ret = slk_label(labnum);
ST(0) = sv_newmortal();
sv_setpv((SV*)ST(0), ret);
}
#else
c_not_there("slk_label");
#endif
XSRETURN(1);
}
XS(XS_Curses_slk_noutrefresh)
{
dXSARGS;
#ifdef C_SLK_NOUTREFRESH
c_exactargs("slk_noutrefresh", items, 0);
{
int ret = slk_noutrefresh();
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("slk_noutrefresh");
#endif
XSRETURN(1);
}
XS(XS_Curses_slk_refresh)
{
dXSARGS;
#ifdef C_SLK_REFRESH
c_exactargs("slk_refresh", items, 0);
{
int ret = slk_refresh();
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("slk_refresh");
#endif
XSRETURN(1);
}
XS(XS_Curses_slk_restore)
{
dXSARGS;
#ifdef C_SLK_RESTORE
c_exactargs("slk_restore", items, 0);
{
int ret = slk_restore();
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("slk_restore");
#endif
XSRETURN(1);
}
XS(XS_Curses_slk_set)
{
dXSARGS;
#ifdef C_SLK_SET
c_exactargs("slk_set", items, 3);
{
int labnum = (int)SvIV(ST(0));
char * label = (char *)SvPV(ST(1),na);
int labfmt = (int)SvIV(ST(2));
int ret = slk_set(labnum, label, labfmt);
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("slk_set");
#endif
XSRETURN(1);
}
XS(XS_Curses_slk_touch)
{
dXSARGS;
#ifdef C_SLK_TOUCH
c_exactargs("slk_touch", items, 0);
{
int ret = slk_touch();
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("slk_touch");
#endif
XSRETURN(1);
}
/* I'm *not* going to provide another option for a char *standend() */
XS(XS_Curses_standend)
{
dXSARGS;
#ifdef C_STANDEND
c_countargs("standend", items, 0);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int ret = (int) CI_OPT_MV_AND( wstandend(win) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("standend");
#endif
XSRETURN(1);
}
XS(XS_Curses_standout)
{
dXSARGS;
#ifdef C_STANDOUT
c_countargs("standout", items, 0);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int ret = (int) CI_OPT_MV_AND( wstandout(win) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("standout");
#endif
XSRETURN(1);
}
XS(XS_Curses_start_color)
{
dXSARGS;
#ifdef C_START_COLOR
c_exactargs("start_color", items, 0);
{
int ret = start_color();
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("start_color");
#endif
XSRETURN(1);
}
XS(XS_Curses_subpad)
{
dXSARGS;
#ifdef C_SUBPAD
c_exactargs("subpad", items, 5);
{
Curses win = c_sv2Curses(ST(0), 0);
int nlines = (int)SvIV(ST(1));
int ncols = (int)SvIV(ST(2));
int begy = (int)SvIV(ST(3));
int begx = (int)SvIV(ST(4));
Curses ret = subpad(win, nlines, ncols, begy, begx);
ST(0) = sv_newmortal();
sv_setref_pv(ST(0), "Curses", (void*)ret);
}
#else
c_not_there("subpad");
#endif
XSRETURN(1);
}
XS(XS_Curses_subwin)
{
dXSARGS;
#ifdef C_SUBWIN
c_countargs("subwin", items, 4);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int nline = (int)SvIV(ST(c_arg));
int ncol = (int)SvIV(ST(c_arg+1));
int begy = (int)SvIV(ST(c_arg+2));
int begx = (int)SvIV(ST(c_arg+3));
Curses ret = CP_OPT_MV_AND( subwin(win, nline, ncol, begy, begx) );
ST(0) = sv_newmortal();
sv_setref_pv(ST(0), "Curses", (void*)ret);
}
#else
c_not_there("subwin");
#endif
XSRETURN(1);
}
XS(XS_Curses_syncok)
{
dXSARGS;
#ifdef C_SYNCOK
c_countargs("syncok", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int bf = (int)SvIV(ST(c_arg));
int ret = CI_OPT_MV_AND( syncok(win, bf) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("syncok");
#endif
XSRETURN(1);
}
XS(XS_Curses_timeout)
{
dXSARGS;
#ifdef C_TIMEOUT
c_countargs("timeout", items, 1);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int tm = (int)SvIV(ST(c_arg));
wtimeout(win, tm);
}
#else
c_not_there("timeout");
#endif
XSRETURN(1);
}
XS(XS_Curses_touchline)
{
dXSARGS;
#ifdef C_TOUCHLINE
/* there are two versions of touchline */
/* one has 4 args, one has 3 */
#ifdef C_TOUCH3ARGS
c_countargs("touchline", items, 2);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int start = (int)SvIV(ST(c_arg));
int count = (int)SvIV(ST(c_arg+1));
int ret = CI_OPT_MV_AND( touchline(win, start, count) );
#endif
#ifdef C_TOUCH4ARGS
c_countargs("touchline", items, 3);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int y = (int)SvIV(ST(c_arg));
int sx = (int)SvIV(ST(c_arg+1));
int ex = (int)SvIV(ST(c_arg+2));
int ret = CI_OPT_MV_AND( touchline(win, y, sx, ex) );
#endif
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("touchline");
#endif
XSRETURN(1);
}
XS(XS_Curses_touchln)
{
dXSARGS;
#ifdef C_TOUCHLN
c_countargs("touchln", items, 3);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int start = (int)SvIV(ST(c_arg));
int count = (int)SvIV(ST(c_arg+1));
int change = (int)SvIV(ST(c_arg+2));
int ret = CI_OPT_MV_AND( wtouchln(win, start, count, change) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("touchln");
#endif
XSRETURN(1);
}
XS(XS_Curses_touchoverlap)
{
dXSARGS;
#ifdef C_TOUCHOVERLAP
c_exactargs("touchoverlap", items, 2);
{
Curses win1 = c_sv2Curses(ST(0), 0);
Curses win2 = c_sv2Curses(ST(1), 1);
int ret = touchoverlap(win1, win2);
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("touchoverlap");
#endif
XSRETURN(1);
}
XS(XS_Curses_touchwin)
{
dXSARGS;
#ifdef C_TOUCHWIN
c_countargs("touchwin", items, 0);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
int ret = CI_OPT_MV_AND( touchwin(win) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("touchwin");
#endif
XSRETURN(1);
}
XS(XS_Curses_typeahead)
{
dXSARGS;
#ifdef C_TYPEAHEAD
c_exactargs("typeahead", items, 1);
{
int fd = (int)SvIV(ST(0));
int ret = typeahead(fd);
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("typeahead");
#endif
XSRETURN(1);
}
XS(XS_Curses_unctrl)
{
dXSARGS;
#ifdef C_UNCTRL
c_exactargs("unctrl", items, 1);
{
chtype ch = c_sv2chtype(ST(0));
char * ret = unctrl(ch);
ST(0) = sv_newmortal();
sv_setpv((SV*)ST(0), ret);
}
#else
c_not_there("unctrl");
#endif
XSRETURN(1);
}
XS(XS_Curses_ungetch)
{
dXSARGS;
#ifdef C_UNGETCH
c_exactargs("ungetch", items, 1);
{
int ch = (int)SvIV(ST(0));
int ret = ungetch(ch);
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("ungetch");
#endif
XSRETURN(1);
}
XS(XS_Curses_vline)
{
dXSARGS;
#ifdef C_VLINE
c_countargs("vline", items, 2);
{
Curses win = c_win ? c_sv2Curses(ST(0), 0) : stdscr;
chtype ch = c_sv2chtype(ST(c_arg));
int n = (int)SvIV(ST(c_arg+1));
int ret = CI_OPT_MV_AND( wvline(win, ch, n) );
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
#else
c_not_there("vline");
#endif
XSRETURN(1);
}
/* Screen stuff */
/* Contributed by Santeri Paavolainen <sjpaavol@cc.helsinki.fi> */
XS(XS_Curses_newterm)
{
dXSARGS;
#ifdef C_NEWTERM
c_exactargs("newterm", items, 3);
{
char * term;
FILE * out = IoIFP(sv_2io(ST(1)));
FILE * in = IoIFP(sv_2io(ST(2)));
Screen ret;
/* The 'term' parameter must be null terminated */
if (ST(0) != &sv_undef)
term = (char *)SvPV(ST(0),na);
else
term = NULL;
ret = newterm(term, out, in);
ST(0) = sv_newmortal();
sv_setref_pv(ST(0), "Curses::Screen", (void *)ret);
}
#else
c_not_there("newterm");
#endif
XSRETURN(1);
}
XS(XS_Curses_set_term)
{
dXSARGS;
#ifdef C_SET_TERM
c_countargs("set_term", items, 1);
{
Screen scr = c_sv2Screen(ST(0), 0);
Screen ret = set_term(scr);
ST(0) = sv_newmortal();
sv_setref_pv(ST(0), "Curses::Screen", (void *) ret);
}
#else
c_not_there("set_term");
#endif
XSRETURN(1);
}
/* Tied stuff */
XS(XS_Curses_Vars_TIESCALAR)
{
dXSARGS;
c_exactargs("TIESCALAR", items, 2);
{
char * pack = (char *)SvPV(ST(0),na);
int n = (int)SvIV(ST(1));
ST(0) = sv_newmortal();
sv_setref_iv(ST(0), pack, n);
}
XSRETURN(1);
}
XS(XS_Curses_Vars_FETCH)
{
dXSARGS;
c_exactargs("FETCH", items, 1);
{
int n = (int)SvIV(SvRV((SV*)ST(0)));
char * b = 0;
ST(0) = sv_newmortal();
switch (n)
{
case 1: sv_setiv(ST(0), (IV)LINES); break;
case 2: sv_setiv(ST(0), (IV)COLS); break;
case 3: sv_setref_pv(ST(0), "Curses", (void*)stdscr); break;
case 4: sv_setref_pv(ST(0), "Curses", (void*)curscr); break;
case 5: b = "ttytype"; break;
case 6: b = "Def_term"; break;
case 7: b = "My_term"; break;
default: croak("Curses::Vars::FETCH called with bad index");
/* NOTREACHED */
}
if (b)
croak("Curses does not support curses variable '%s', used", b);
}
XSRETURN(1);
}
XS(XS_Curses_Vars_STORE)
{
dXSARGS;
c_exactargs("STORE", items, 2);
{
int n = (int)SvIV((SV*)SvRV(ST(0)));
SV * val = ST(1);
char * b = 0;
switch (n)
{
case 1: LINES = (int)SvIV(val); break;
case 2: COLS = (int)SvIV(val); break;
case 3: stdscr = c_sv2Curses(val, -1); break;
case 4: curscr = c_sv2Curses(val, -1); break;
case 5: b = "ttytype"; break;
case 6: b = "Def_term"; break;
case 7: b = "My_term"; break;
default:
croak("Curses::Vars::STORE called with bad index");
/* NOTREACHED */
}
if (b)
croak("Curses does not support curses variable '%s', used", b);
ST(0) = &sv_yes;
}
XSRETURN(1);
}
XS(XS_Curses_Vars_DESTROY)
{
dXSARGS;
c_exactargs("DESTROY", items, 1);
{
SV * rv = ST(0);
ST(0) = &sv_yes;
}
XSRETURN(1);
}
XS(XS_Curses_stdscr)
{
dXSARGS;
c_exactargs("stdscr", items, 0);
{
ST(0) = sv_newmortal();
sv_setref_pv(ST(0), "Curses", (void*)stdscr);
}
XSRETURN(1);
}
XS(XS_Curses_curscr)
{
dXSARGS;
c_exactargs("curscr", items, 0);
{
ST(0) = sv_newmortal();
sv_setref_pv(ST(0), "Curses", (void*)curscr);
}
XSRETURN(1);
}
XS(XS_Curses_LINES)
{
dXSARGS;
c_exactargs("LINES", items, 0);
{
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)LINES);
}
XSRETURN(1);
}
XS(XS_Curses_COLS)
{
dXSARGS;
c_exactargs("COLS", items, 0);
{
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)COLS);
}
XSRETURN(1);
}
XS(XS_Curses_XS_VERSION)
{
dXSARGS;
ST(0) = sv_newmortal();
sv_setnv(ST(0), (double)C_XS_VERSION);
XSRETURN(1);
}
XS(XS_Curses_constant)
{
dXSARGS;
c_exactargs("constant", items, 2);
{
char * name = (char *)SvPV(ST(0),na);
int arg = (int)SvIV(ST(1));
int ret;
switch (arg)
{
#ifdef ERR
case 1: ret = ERR; break;
#endif
#ifdef OK
case 2: ret = OK; break;
#endif
#ifdef ACS_BLOCK
case 3: ret = ACS_BLOCK; break;
#endif
#ifdef ACS_BOARD
case 4: ret = ACS_BOARD; break;
#endif
#ifdef ACS_BTEE
case 5: ret = ACS_BTEE; break;
#endif
#ifdef ACS_BULLET
case 6: ret = ACS_BULLET; break;
#endif
#ifdef ACS_CKBOARD
case 7: ret = ACS_CKBOARD; break;
#endif
#ifdef ACS_DARROW
case 8: ret = ACS_DARROW; break;
#endif
#ifdef ACS_DEGREE
case 9: ret = ACS_DEGREE; break;
#endif
#ifdef ACS_DIAMOND
case 10: ret = ACS_DIAMOND; break;
#endif
#ifdef ACS_HLINE
case 11: ret = ACS_HLINE; break;
#endif
#ifdef ACS_LANTERN
case 12: ret = ACS_LANTERN; break;
#endif
#ifdef ACS_LARROW
case 13: ret = ACS_LARROW; break;
#endif
#ifdef ACS_LLCORNER
case 14: ret = ACS_LLCORNER; break;
#endif
#ifdef ACS_LRCORNER
case 15: ret = ACS_LRCORNER; break;
#endif
#ifdef ACS_LTEE
case 16: ret = ACS_LTEE; break;
#endif
#ifdef ACS_PLMINUS
case 17: ret = ACS_PLMINUS; break;
#endif
#ifdef ACS_PLUS
case 18: ret = ACS_PLUS; break;
#endif
#ifdef ACS_RARROW
case 19: ret = ACS_RARROW; break;
#endif
#ifdef ACS_RTEE
case 20: ret = ACS_RTEE; break;
#endif
#ifdef ACS_S1
case 21: ret = ACS_S1; break;
#endif
#ifdef ACS_S9
case 22: ret = ACS_S9; break;
#endif
#ifdef ACS_TTEE
case 23: ret = ACS_TTEE; break;
#endif
#ifdef ACS_UARROW
case 24: ret = ACS_UARROW; break;
#endif
#ifdef ACS_ULCORNER
case 25: ret = ACS_ULCORNER; break;
#endif
#ifdef ACS_URCORNER
case 26: ret = ACS_URCORNER; break;
#endif
#ifdef ACS_VLINE
case 27: ret = ACS_VLINE; break;
#endif
#ifdef A_ALTCHARSET
case 28: ret = A_ALTCHARSET; break;
#endif
#ifdef A_ATTRIBUTES
case 29: ret = A_ATTRIBUTES; break;
#endif
#ifdef A_BLINK
case 30: ret = A_BLINK; break;
#endif
#ifdef A_BOLD
case 31: ret = A_BOLD; break;
#endif
#ifdef A_CHARTEXT
case 32: ret = A_CHARTEXT; break;
#endif
#ifdef A_COLOR
case 33: ret = A_COLOR; break;
#endif
#ifdef A_DIM
case 34: ret = A_DIM; break;
#endif
#ifdef A_INVIS
case 35: ret = A_INVIS; break;
#endif
#ifdef A_NORMAL
case 36: ret = A_NORMAL; break;
#endif
#ifdef A_PROTECT
case 37: ret = A_PROTECT; break;
#endif
#ifdef A_REVERSE
case 38: ret = A_REVERSE; break;
#endif
#ifdef A_STANDOUT
case 39: ret = A_STANDOUT; break;
#endif
#ifdef A_UNDERLINE
case 40: ret = A_UNDERLINE; break;
#endif
#ifdef COLOR_BLACK
case 41: ret = COLOR_BLACK; break;
#endif
#ifdef COLOR_BLUE
case 42: ret = COLOR_BLUE; break;
#endif
#ifdef COLOR_CYAN
case 43: ret = COLOR_CYAN; break;
#endif
#ifdef COLOR_GREEN
case 44: ret = COLOR_GREEN; break;
#endif
#ifdef COLOR_MAGENTA
case 45: ret = COLOR_MAGENTA; break;
#endif
#ifdef COLOR_RED
case 46: ret = COLOR_RED; break;
#endif
#ifdef COLOR_WHITE
case 47: ret = COLOR_WHITE; break;
#endif
#ifdef COLOR_YELLOW
case 48: ret = COLOR_YELLOW; break;
#endif
#ifdef KEY_A1
case 49: ret = KEY_A1; break;
#endif
#ifdef KEY_A3
case 50: ret = KEY_A3; break;
#endif
#ifdef KEY_B2
case 51: ret = KEY_B2; break;
#endif
#ifdef KEY_BACKSPACE
case 52: ret = KEY_BACKSPACE; break;
#endif
#ifdef KEY_BEG
case 53: ret = KEY_BEG; break;
#endif
#ifdef KEY_BREAK
case 54: ret = KEY_BREAK; break;
#endif
#ifdef KEY_BTAB
case 55: ret = KEY_BTAB; break;
#endif
#ifdef KEY_C1
case 56: ret = KEY_C1; break;
#endif
#ifdef KEY_C3
case 57: ret = KEY_C3; break;
#endif
#ifdef KEY_CANCEL
case 58: ret = KEY_CANCEL; break;
#endif
#ifdef KEY_CATAB
case 59: ret = KEY_CATAB; break;
#endif
#ifdef KEY_CLEAR
case 60: ret = KEY_CLEAR; break;
#endif
#ifdef KEY_CLOSE
case 61: ret = KEY_CLOSE; break;
#endif
#ifdef KEY_COMMAND
case 62: ret = KEY_COMMAND; break;
#endif
#ifdef KEY_COPY
case 63: ret = KEY_COPY; break;
#endif
#ifdef KEY_CREATE
case 64: ret = KEY_CREATE; break;
#endif
#ifdef KEY_CTAB
case 65: ret = KEY_CTAB; break;
#endif
#ifdef KEY_DC
case 66: ret = KEY_DC; break;
#endif
#ifdef KEY_DL
case 67: ret = KEY_DL; break;
#endif
#ifdef KEY_DOWN
case 68: ret = KEY_DOWN; break;
#endif
#ifdef KEY_EIC
case 69: ret = KEY_EIC; break;
#endif
#ifdef KEY_END
case 70: ret = KEY_END; break;
#endif
#ifdef KEY_ENTER
case 71: ret = KEY_ENTER; break;
#endif
#ifdef KEY_EOL
case 72: ret = KEY_EOL; break;
#endif
#ifdef KEY_EOS
case 73: ret = KEY_EOS; break;
#endif
#ifdef KEY_EXIT
case 74: ret = KEY_EXIT; break;
#endif
#ifdef KEY_F0
case 75: ret = KEY_F0; break;
#endif
#ifdef KEY_FIND
case 76: ret = KEY_FIND; break;
#endif
#ifdef KEY_HELP
case 77: ret = KEY_HELP; break;
#endif
#ifdef KEY_HOME
case 78: ret = KEY_HOME; break;
#endif
#ifdef KEY_IC
case 79: ret = KEY_IC; break;
#endif
#ifdef KEY_IL
case 80: ret = KEY_IL; break;
#endif
#ifdef KEY_LEFT
case 81: ret = KEY_LEFT; break;
#endif
#ifdef KEY_LL
case 82: ret = KEY_LL; break;
#endif
#ifdef KEY_MARK
case 83: ret = KEY_MARK; break;
#endif
#ifdef KEY_MAX
case 84: ret = KEY_MAX; break;
#endif
#ifdef KEY_MESSAGE
case 85: ret = KEY_MESSAGE; break;
#endif
#ifdef KEY_MIN
case 86: ret = KEY_MIN; break;
#endif
#ifdef KEY_MOVE
case 87: ret = KEY_MOVE; break;
#endif
#ifdef KEY_NEXT
case 88: ret = KEY_NEXT; break;
#endif
#ifdef KEY_NPAGE
case 89: ret = KEY_NPAGE; break;
#endif
#ifdef KEY_OPEN
case 90: ret = KEY_OPEN; break;
#endif
#ifdef KEY_OPTIONS
case 91: ret = KEY_OPTIONS; break;
#endif
#ifdef KEY_PPAGE
case 92: ret = KEY_PPAGE; break;
#endif
#ifdef KEY_PREVIOUS
case 93: ret = KEY_PREVIOUS; break;
#endif
#ifdef KEY_PRINT
case 94: ret = KEY_PRINT; break;
#endif
#ifdef KEY_REDO
case 95: ret = KEY_REDO; break;
#endif
#ifdef KEY_REFERENCE
case 96: ret = KEY_REFERENCE; break;
#endif
#ifdef KEY_REFRESH
case 97: ret = KEY_REFRESH; break;
#endif
#ifdef KEY_REPLACE
case 98: ret = KEY_REPLACE; break;
#endif
#ifdef KEY_RESET
case 99: ret = KEY_RESET; break;
#endif
#ifdef KEY_RESTART
case 100: ret = KEY_RESTART; break;
#endif
#ifdef KEY_RESUME
case 101: ret = KEY_RESUME; break;
#endif
#ifdef KEY_RIGHT
case 102: ret = KEY_RIGHT; break;
#endif
#ifdef KEY_SAVE
case 103: ret = KEY_SAVE; break;
#endif
#ifdef KEY_SBEG
case 104: ret = KEY_SBEG; break;
#endif
#ifdef KEY_SCANCEL
case 105: ret = KEY_SCANCEL; break;
#endif
#ifdef KEY_SCOMMAND
case 106: ret = KEY_SCOMMAND; break;
#endif
#ifdef KEY_SCOPY
case 107: ret = KEY_SCOPY; break;
#endif
#ifdef KEY_SCREATE
case 108: ret = KEY_SCREATE; break;
#endif
#ifdef KEY_SDC
case 109: ret = KEY_SDC; break;
#endif
#ifdef KEY_SDL
case 110: ret = KEY_SDL; break;
#endif
#ifdef KEY_SELECT
case 111: ret = KEY_SELECT; break;
#endif
#ifdef KEY_SEND
case 112: ret = KEY_SEND; break;
#endif
#ifdef KEY_SEOL
case 113: ret = KEY_SEOL; break;
#endif
#ifdef KEY_SEXIT
case 114: ret = KEY_SEXIT; break;
#endif
#ifdef KEY_SF
case 115: ret = KEY_SF; break;
#endif
#ifdef KEY_SFIND
case 116: ret = KEY_SFIND; break;
#endif
#ifdef KEY_SHELP
case 117: ret = KEY_SHELP; break;
#endif
#ifdef KEY_SHOME
case 118: ret = KEY_SHOME; break;
#endif
#ifdef KEY_SIC
case 119: ret = KEY_SIC; break;
#endif
#ifdef KEY_SLEFT
case 120: ret = KEY_SLEFT; break;
#endif
#ifdef KEY_SMESSAGE
case 121: ret = KEY_SMESSAGE; break;
#endif
#ifdef KEY_SMOVE
case 122: ret = KEY_SMOVE; break;
#endif
#ifdef KEY_SNEXT
case 123: ret = KEY_SNEXT; break;
#endif
#ifdef KEY_SOPTIONS
case 124: ret = KEY_SOPTIONS; break;
#endif
#ifdef KEY_SPREVIOUS
case 125: ret = KEY_SPREVIOUS; break;
#endif
#ifdef KEY_SPRINT
case 126: ret = KEY_SPRINT; break;
#endif
#ifdef KEY_SR
case 127: ret = KEY_SR; break;
#endif
#ifdef KEY_SREDO
case 128: ret = KEY_SREDO; break;
#endif
#ifdef KEY_SREPLACE
case 129: ret = KEY_SREPLACE; break;
#endif
#ifdef KEY_SRESET
case 130: ret = KEY_SRESET; break;
#endif
#ifdef KEY_SRIGHT
case 131: ret = KEY_SRIGHT; break;
#endif
#ifdef KEY_SRSUME
case 132: ret = KEY_SRSUME; break;
#endif
#ifdef KEY_SSAVE
case 133: ret = KEY_SSAVE; break;
#endif
#ifdef KEY_SSUSPEND
case 134: ret = KEY_SSUSPEND; break;
#endif
#ifdef KEY_STAB
case 135: ret = KEY_STAB; break;
#endif
#ifdef KEY_SUNDO
case 136: ret = KEY_SUNDO; break;
#endif
#ifdef KEY_SUSPEND
case 137: ret = KEY_SUSPEND; break;
#endif
#ifdef KEY_UNDO
case 138: ret = KEY_UNDO; break;
#endif
#ifdef KEY_UP
case 139: ret = KEY_UP; break;
#endif
default:
croak("Curses constant '%s' is not defined by your vendor", name);
}
ST(0) = sv_newmortal();
sv_setiv(ST(0), (IV)ret);
}
XSRETURN(1);
}
XS(boot_Curses)
{
int i;
dXSARGS;
char* file = __FILE__;
newXS("Curses::addch", XS_Curses_addch, file);
newXS("Curses::addchnstr", XS_Curses_addchnstr, file);
newXS("Curses::addchstr", XS_Curses_addchstr, file);
newXS("Curses::addnstr", XS_Curses_addnstr, file);
newXS("Curses::addstr", XS_Curses_addstr, file);
newXS("Curses::attroff", XS_Curses_attroff, file);
newXS("Curses::attron", XS_Curses_attron, file);
newXS("Curses::attrset", XS_Curses_attrset, file);
newXS("Curses::baudrate", XS_Curses_baudrate, file);
newXS("Curses::beep", XS_Curses_beep, file);
newXS("Curses::bkgd", XS_Curses_bkgd, file);
newXS("Curses::bkgdset", XS_Curses_bkgdset, file);
newXS("Curses::border", XS_Curses_border, file);
newXS("Curses::box", XS_Curses_box, file);
newXS("Curses::can_change_color", XS_Curses_can_change_color, file);
newXS("Curses::cbreak", XS_Curses_cbreak, file);
newXS("Curses::clear", XS_Curses_clear, file);
newXS("Curses::clearok", XS_Curses_clearok, file);
newXS("Curses::clrtobot", XS_Curses_clrtobot, file);
newXS("Curses::clrtoeol", XS_Curses_clrtoeol, file);
newXS("Curses::color_content", XS_Curses_color_content, file);
newXS("Curses::COLOR_PAIR", XS_Curses_COLOR_PAIR, file);
newXS("Curses::copywin", XS_Curses_copywin, file);
newXS("Curses::delch", XS_Curses_delch, file);
newXS("Curses::deleteln", XS_Curses_deleteln, file);
newXS("Curses::delwin", XS_Curses_delwin, file);
newXS("Curses::derwin", XS_Curses_derwin, file);
newXS("Curses::doupdate", XS_Curses_doupdate, file);
newXS("Curses::echo", XS_Curses_echo, file);
newXS("Curses::echochar", XS_Curses_echochar, file);
newXS("Curses::endwin", XS_Curses_endwin, file);
newXS("Curses::erase", XS_Curses_erase, file);
newXS("Curses::erasechar", XS_Curses_erasechar, file);
newXS("Curses::flash", XS_Curses_flash, file);
newXS("Curses::flushinp", XS_Curses_flushinp, file);
newXS("Curses::flusok", XS_Curses_flusok, file);
newXS("Curses::getattrs", XS_Curses_getattrs, file);
newXS("Curses::getbegyx", XS_Curses_getbegyx, file);
newXS("Curses::getbkgd", XS_Curses_getbkgd, file);
newXS("Curses::getcap", XS_Curses_getcap, file);
newXS("Curses::getch", XS_Curses_getch, file);
newXS("Curses::getmaxyx", XS_Curses_getmaxyx, file);
newXS("Curses::getnstr", XS_Curses_getnstr, file);
newXS("Curses::getparyx", XS_Curses_getparyx, file);
newXS("Curses::getstr", XS_Curses_getstr, file);
newXS("Curses::gettmode", XS_Curses_gettmode, file);
newXS("Curses::getyx", XS_Curses_getyx, file);
newXS("Curses::halfdelay", XS_Curses_halfdelay, file);
newXS("Curses::has_colors", XS_Curses_has_colors, file);
newXS("Curses::has_ic", XS_Curses_has_ic, file);
newXS("Curses::has_il", XS_Curses_has_il, file);
newXS("Curses::hline", XS_Curses_hline, file);
newXS("Curses::idcok", XS_Curses_idcok, file);
newXS("Curses::idlok", XS_Curses_idlok, file);
newXS("Curses::immedok", XS_Curses_immedok, file);
newXS("Curses::inch", XS_Curses_inch, file);
newXS("Curses::inchnstr", XS_Curses_inchnstr, file);
newXS("Curses::inchstr", XS_Curses_inchstr, file);
newXS("Curses::initscr", XS_Curses_initscr, file);
newXS("Curses::init_color", XS_Curses_init_color, file);
newXS("Curses::init_pair", XS_Curses_init_pair, file);
newXS("Curses::innstr", XS_Curses_innstr, file);
newXS("Curses::insch", XS_Curses_insch, file);
newXS("Curses::insdelln", XS_Curses_insdelln, file);
newXS("Curses::insertln", XS_Curses_insertln, file);
newXS("Curses::insnstr", XS_Curses_insnstr, file);
newXS("Curses::insstr", XS_Curses_insstr, file);
newXS("Curses::instr", XS_Curses_instr, file);
newXS("Curses::intrflush", XS_Curses_intrflush, file);
newXS("Curses::isendwin", XS_Curses_isendwin, file);
newXS("Curses::is_linetouched", XS_Curses_is_linetouched, file);
newXS("Curses::is_wintouched", XS_Curses_is_wintouched, file);
newXS("Curses::keyname", XS_Curses_keyname, file);
newXS("Curses::keypad", XS_Curses_keypad, file);
newXS("Curses::killchar", XS_Curses_killchar, file);
newXS("Curses::leaveok", XS_Curses_leaveok, file);
newXS("Curses::longname", XS_Curses_longname, file);
newXS("Curses::meta", XS_Curses_meta, file);
newXS("Curses::move", XS_Curses_move, file);
newXS("Curses::mvcur", XS_Curses_mvcur, file);
newXS("Curses::mvwin", XS_Curses_mvwin, file);
newXS("Curses::newpad", XS_Curses_newpad, file);
newXS("Curses::newwin", XS_Curses_newwin, file);
newXS("Curses::nl", XS_Curses_nl, file);
newXS("Curses::nocbreak", XS_Curses_nocbreak, file);
newXS("Curses::nodelay", XS_Curses_nodelay, file);
newXS("Curses::noecho", XS_Curses_noecho, file);
newXS("Curses::nonl", XS_Curses_nonl, file);
newXS("Curses::noqiflush", XS_Curses_noqiflush, file);
newXS("Curses::noraw", XS_Curses_noraw, file);
newXS("Curses::notimeout", XS_Curses_notimeout, file);
newXS("Curses::noutrefresh", XS_Curses_noutrefresh, file);
newXS("Curses::overlay", XS_Curses_overlay, file);
newXS("Curses::overwrite", XS_Curses_overwrite, file);
newXS("Curses::pair_content", XS_Curses_pair_content, file);
newXS("Curses::PAIR_NUMBER", XS_Curses_PAIR_NUMBER, file);
newXS("Curses::pechochar", XS_Curses_pechochar, file);
newXS("Curses::pnoutrefresh", XS_Curses_pnoutrefresh, file);
newXS("Curses::prefresh", XS_Curses_prefresh, file);
newXS("Curses::qiflush", XS_Curses_qiflush, file);
newXS("Curses::raw", XS_Curses_raw, file);
newXS("Curses::refresh", XS_Curses_refresh, file);
newXS("Curses::resetty", XS_Curses_resetty, file);
newXS("Curses::savetty", XS_Curses_savetty, file);
newXS("Curses::scrl", XS_Curses_scrl, file);
newXS("Curses::scroll", XS_Curses_scroll, file);
newXS("Curses::scrollok", XS_Curses_scrollok, file);
newXS("Curses::setscrreg", XS_Curses_setscrreg, file);
newXS("Curses::setterm", XS_Curses_setterm, file);
newXS("Curses::slk_clear", XS_Curses_slk_clear, file);
newXS("Curses::slk_init", XS_Curses_slk_init, file);
newXS("Curses::slk_label", XS_Curses_slk_label, file);
newXS("Curses::slk_noutrefresh", XS_Curses_slk_noutrefresh, file);
newXS("Curses::slk_refresh", XS_Curses_slk_refresh, file);
newXS("Curses::slk_restore", XS_Curses_slk_restore, file);
newXS("Curses::slk_set", XS_Curses_slk_set, file);
newXS("Curses::slk_touch", XS_Curses_slk_touch, file);
newXS("Curses::standend", XS_Curses_standend, file);
newXS("Curses::standout", XS_Curses_standout, file);
newXS("Curses::start_color", XS_Curses_start_color, file);
newXS("Curses::subpad", XS_Curses_subpad, file);
newXS("Curses::subwin", XS_Curses_subwin, file);
newXS("Curses::syncok", XS_Curses_syncok, file);
newXS("Curses::timeout", XS_Curses_timeout, file);
newXS("Curses::touchline", XS_Curses_touchline, file);
newXS("Curses::touchln", XS_Curses_touchln, file);
newXS("Curses::touchoverlap", XS_Curses_touchoverlap, file);
newXS("Curses::touchwin", XS_Curses_touchwin, file);
newXS("Curses::typeahead", XS_Curses_typeahead, file);
newXS("Curses::unctrl", XS_Curses_unctrl, file);
newXS("Curses::ungetch", XS_Curses_ungetch, file);
newXS("Curses::vline", XS_Curses_vline, file);
newXS("Curses::newterm", XS_Curses_newterm, file);
newXS("Curses::set_term", XS_Curses_set_term, file);
newXS("Curses::constant", XS_Curses_constant, file);
newXS("Curses::curscr", XS_Curses_curscr, file);
newXS("Curses::stdscr", XS_Curses_stdscr, file);
newXS("Curses::LINES", XS_Curses_LINES, file);
newXS("Curses::COLS", XS_Curses_COLS, file);
newXS("Curses::XS_VERSION", XS_Curses_XS_VERSION, file);
newXS("Curses::Vars::DESTROY", XS_Curses_Vars_DESTROY, file);
newXS("Curses::Vars::FETCH", XS_Curses_Vars_FETCH, file);
newXS("Curses::Vars::STORE", XS_Curses_Vars_STORE, file);
newXS("Curses::Vars::TIESCALAR", XS_Curses_Vars_TIESCALAR, file);
/* traceon(); */
ST(0) = &sv_yes;
XSRETURN(1);
}
|