1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 8109 8110 8111 8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 8183 8184 8185 8186 8187 8188 8189 8190 8191 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 8225 8226 8227 8228 8229 8230 8231 8232 8233 8234 8235 8236 8237 8238 8239 8240 8241 8242 8243 8244 8245 8246 8247 8248 8249 8250 8251 8252 8253 8254 8255 8256 8257 8258 8259 8260 8261 8262 8263 8264 8265 8266 8267 8268 8269 8270 8271 8272 8273 8274 8275 8276 8277 8278 8279 8280 8281 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297 8298 8299 8300 8301 8302 8303 8304 8305 8306 8307 8308 8309 8310 8311 8312 8313 8314 8315 8316 8317 8318 8319 8320 8321 8322 8323 8324 8325 8326 8327 8328 8329 8330 8331 8332 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 8349 8350 8351 8352 8353 8354 8355 8356 8357 8358 8359 8360 8361 8362 8363 8364 8365 8366 8367 8368 8369 8370 8371 8372 8373 8374 8375 8376 8377 8378 8379 8380 8381 8382 8383 8384 8385 8386 8387 8388 8389 8390 8391 8392 8393 8394 8395 8396 8397 8398 8399 8400 8401 8402 8403 8404 8405 8406 8407 8408 8409 8410 8411 8412 8413 8414 8415 8416 8417 8418 8419 8420 8421 8422 8423 8424 8425 8426 8427 8428 8429 8430 8431 8432 8433 8434 8435 8436 8437 8438 8439 8440 8441 8442 8443 8444 8445 8446 8447 8448 8449 8450 8451 8452 8453 8454 8455 8456 8457 8458 8459 8460 8461 8462 8463 8464 8465 8466 8467 8468 8469 8470 8471 8472 8473 8474 8475 8476 8477 8478 8479 8480 8481 8482 8483 8484 8485 8486 8487 8488 8489 8490 8491 8492 8493 8494 8495 8496 8497 8498 8499 8500 8501 8502 8503 8504 8505 8506 8507 8508 8509 8510 8511 8512 8513 8514 8515 8516 8517 8518 8519 8520 8521 8522 8523 8524 8525 8526 8527 8528 8529 8530 8531 8532 8533 8534 8535 8536 8537 8538 8539 8540 8541 8542 8543 8544 8545 8546 8547 8548 8549 8550 8551 8552 8553 8554 8555 8556 8557 8558 8559 8560 8561 8562 8563 8564 8565 8566 8567 8568 8569 8570 8571 8572 8573 8574 8575 8576 8577 8578 8579 8580 8581 8582 8583 8584 8585 8586 8587 8588 8589 8590 8591 8592 8593 8594 8595 8596 8597 8598 8599 8600 8601 8602 8603 8604 8605 8606 8607 8608 8609 8610 8611 8612 8613 8614 8615 8616 8617 8618 8619 8620 8621 8622 8623 8624 8625 8626 8627 8628 8629 8630 8631 8632 8633 8634 8635 8636 8637 8638 8639 8640 8641 8642 8643 8644 8645 8646 8647 8648 8649 8650 8651 8652 8653 8654 8655 8656 8657 8658 8659 8660 8661 8662 8663 8664 8665 8666 8667 8668 8669 8670 8671 8672 8673 8674 8675 8676 8677 8678 8679 8680 8681 8682 8683 8684 8685 8686 8687 8688 8689 8690 8691 8692 8693 8694 8695 8696 8697 8698 8699 8700 8701 8702 8703 8704 8705 8706 8707 8708 8709 8710 8711 8712 8713 8714 8715 8716 8717 8718 8719 8720 8721 8722 8723 8724 8725 8726 8727 8728 8729 8730 8731 8732 8733 8734 8735 8736 8737 8738 8739 8740 8741 8742 8743 8744 8745 8746 8747 8748 8749 8750 8751 8752 8753 8754 8755 8756 8757 8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843 8844 8845 8846 8847 8848 8849 8850 8851 8852 8853 8854 8855 8856 8857 8858 8859 8860 8861 8862 8863 8864 8865 8866 8867 8868 8869 8870 8871 8872 8873 8874 8875 8876 8877 8878 8879 8880 8881 8882 8883 8884 8885 8886 8887 8888 8889 8890 8891 8892 8893 8894 8895 8896 8897 8898 8899 8900 8901 8902 8903 8904 8905 8906 8907 8908 8909 8910 8911 8912 8913 8914 8915 8916 8917 8918 8919 8920 8921 8922 8923 8924 8925 8926 8927 8928 8929 8930 8931 8932 8933 8934 8935 8936 8937 8938 8939 8940 8941 8942 8943 8944 8945 8946 8947 8948 8949 8950 8951 8952 8953 8954 8955 8956 8957 8958 8959 8960 8961 8962 8963 8964 8965 8966 8967 8968 8969 8970 8971 8972 8973 8974 8975 8976 8977 8978 8979 8980 8981 8982 8983 8984 8985 8986 8987 8988 8989 8990 8991 8992 8993 8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025 9026 9027 9028 9029 9030 9031 9032 9033 9034 9035 9036 9037 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069 9070 9071 9072 9073 9074 9075 9076 9077 9078 9079 9080 9081 9082 9083 9084 9085 9086 9087 9088 9089 9090 9091 9092 9093 9094 9095 9096 9097 9098 9099 9100 9101 9102 9103 9104 9105 9106 9107 9108 9109 9110 9111 9112 9113 9114 9115 9116 9117 9118 9119 9120 9121 9122 9123 9124 9125 9126 9127 9128 9129 9130 9131 9132 9133 9134 9135 9136 9137 9138 9139 9140 9141 9142 9143 9144 9145 9146 9147 9148 9149 9150 9151 9152 9153 9154 9155 9156 9157 9158 9159 9160 9161 9162 9163 9164 9165 9166 9167 9168 9169 9170 9171 9172 9173 9174 9175 9176 9177 9178 9179 9180 9181 9182 9183 9184 9185 9186 9187 9188 9189 9190 9191 9192 9193 9194 9195 9196 9197 9198 9199 9200 9201 9202 9203 9204 9205 9206 9207 9208 9209 9210 9211 9212 9213 9214 9215 9216 9217 9218 9219 9220 9221 9222 9223 9224 9225 9226 9227 9228 9229 9230 9231 9232 9233 9234 9235 9236 9237 9238 9239 9240 9241 9242 9243 9244 9245 9246 9247 9248 9249 9250 9251 9252 9253 9254 9255 9256 9257 9258 9259 9260 9261 9262 9263 9264 9265 9266 9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 9281 9282 9283 9284 9285 9286 9287 9288 9289 9290 9291 9292 9293 9294 9295 9296 9297 9298 9299 9300 9301 9302 9303 9304 9305 9306 9307 9308 9309 9310 9311 9312 9313 9314 9315 9316 9317 9318 9319 9320 9321 9322 9323 9324 9325 9326 9327 9328 9329 9330 9331 9332 9333 9334 9335 9336 9337 9338 9339 9340 9341 9342 9343 9344 9345 9346 9347 9348 9349 9350 9351 9352 9353 9354 9355 9356 9357 9358 9359 9360 9361 9362 9363 9364 9365 9366 9367 9368 9369 9370 9371 9372 9373 9374 9375 9376 9377 9378 9379 9380 9381 9382 9383 9384 9385 9386 9387 9388 9389 9390 9391 9392 9393 9394 9395 9396 9397 9398 9399 9400 9401 9402 9403 9404 9405 9406 9407 9408 9409 9410 9411 9412 9413 9414 9415 9416 9417 9418 9419 9420 9421 9422 9423 9424 9425 9426 9427 9428 9429 9430 9431 9432 9433 9434 9435 9436 9437 9438 9439 9440 9441 9442 9443 9444 9445 9446 9447 9448 9449 9450 9451 9452 9453 9454 9455 9456 9457 9458 9459 9460 9461 9462 9463 9464 9465 9466 9467 9468 9469 9470 9471 9472 9473 9474 9475 9476 9477 9478 9479 9480 9481 9482 9483 9484 9485 9486 9487 9488 9489 9490 9491 9492 9493 9494 9495 9496 9497 9498 9499 9500 9501 9502 9503 9504 9505 9506 9507 9508 9509 9510 9511 9512 9513 9514 9515 9516 9517 9518 9519 9520 9521 9522 9523 9524 9525 9526 9527 9528 9529 9530 9531 9532 9533 9534 9535 9536 9537 9538 9539 9540 9541 9542 9543 9544 9545 9546 9547 9548 9549 9550 9551 9552 9553 9554 9555 9556 9557 9558 9559 9560 9561 9562 9563 9564 9565 9566 9567 9568 9569 9570 9571 9572 9573 9574 9575 9576 9577 9578 9579 9580 9581 9582 9583 9584 9585 9586 9587 9588 9589 9590 9591 9592 9593 9594 9595 9596 9597 9598 9599 9600 9601 9602 9603 9604 9605 9606 9607 9608 9609 9610 9611 9612 9613 9614 9615 9616 9617 9618 9619 9620 9621 9622 9623 9624 9625 9626 9627 9628 9629 9630 9631 9632 9633 9634 9635 9636 9637 9638 9639 9640 9641 9642 9643 9644 9645 9646 9647 9648 9649 9650 9651 9652 9653 9654 9655 9656 9657 9658 9659 9660 9661 9662 9663 9664 9665 9666 9667 9668 9669 9670 9671 9672 9673 9674 9675 9676 9677 9678 9679 9680 9681 9682 9683 9684 9685 9686 9687 9688 9689 9690 9691 9692 9693 9694 9695 9696 9697 9698 9699 9700 9701 9702 9703 9704 9705 9706 9707 9708 9709 9710 9711 9712 9713 9714 9715 9716 9717 9718 9719 9720 9721 9722 9723 9724 9725 9726 9727 9728 9729 9730 9731 9732 9733 9734 9735 9736 9737 9738 9739 9740 9741 9742 9743 9744 9745 9746 9747 9748 9749 9750 9751 9752 9753 9754 9755 9756 9757 9758 9759 9760 9761 9762 9763 9764 9765 9766 9767 9768 9769 9770 9771 9772 9773 9774 9775 9776 9777 9778 9779 9780 9781 9782 9783 9784 9785 9786 9787 9788 9789 9790 9791 9792 9793 9794 9795 9796 9797 9798 9799 9800 9801 9802 9803 9804 9805 9806 9807 9808 9809 9810 9811 9812 9813 9814 9815 9816 9817 9818 9819 9820 9821 9822 9823 9824 9825 9826 9827 9828 9829 9830 9831 9832 9833 9834 9835 9836 9837 9838 9839 9840 9841 9842 9843 9844 9845 9846 9847 9848 9849 9850 9851 9852 9853 9854 9855 9856 9857 9858 9859 9860 9861 9862 9863 9864 9865 9866 9867 9868 9869 9870 9871 9872 9873 9874 9875 9876 9877 9878 9879 9880 9881 9882 9883 9884 9885 9886 9887 9888 9889 9890 9891 9892 9893 9894 9895 9896 9897 9898 9899 9900 9901 9902 9903 9904 9905 9906 9907 9908 9909 9910 9911 9912 9913 9914 9915 9916 9917 9918 9919 9920 9921 9922 9923 9924 9925 9926 9927 9928 9929 9930 9931 9932 9933 9934 9935 9936 9937 9938 9939 9940 9941 9942 9943 9944 9945 9946 9947 9948 9949 9950 9951 9952 9953 9954 9955 9956 9957 9958 9959 9960 9961 9962 9963 9964 9965 9966 9967 9968 9969 9970 9971 9972 9973 9974 9975 9976 9977 9978 9979 9980 9981 9982 9983 9984 9985 9986 9987 9988 9989 9990 9991 9992 9993 9994 9995 9996 9997 9998 9999 10000 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049 10050 10051 10052 10053 10054 10055 10056 10057 10058 10059 10060 10061 10062 10063 10064 10065 10066 10067 10068 10069 10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163 10164 10165 10166 10167 10168 10169 10170 10171 10172 10173 10174 10175 10176 10177 10178 10179 10180 10181 10182 10183 10184 10185 10186 10187 10188 10189 10190 10191 10192 10193 10194 10195 10196 10197 10198 10199 10200 10201 10202 10203 10204 10205 10206 10207 10208 10209 10210 10211 10212 10213 10214 10215 10216 10217 10218 10219 10220 10221 10222 10223 10224 10225 10226 10227 10228 10229 10230 10231 10232 10233 10234 10235 10236 10237 10238 10239 10240 10241 10242 10243 10244 10245 10246 10247 10248 10249 10250 10251 10252 10253 10254 10255 10256 10257 10258 10259 10260 10261 10262 10263 10264 10265 10266 10267 10268 10269 10270 10271 10272 10273 10274 10275 10276 10277 10278 10279 10280 10281 10282 10283 10284 10285 10286 10287 10288 10289 10290 10291 10292 10293 10294 10295 10296 10297 10298 10299 10300 10301 10302 10303 10304 10305 10306 10307 10308 10309 10310 10311 10312 10313 10314 10315 10316 10317 10318 10319 10320 10321 10322 10323 10324 10325 10326 10327 10328 10329 10330 10331 10332 10333 10334 10335 10336 10337 10338 10339 10340 10341 10342 10343 10344 10345 10346 10347 10348 10349 10350 10351 10352 10353 10354 10355 10356 10357 10358 10359 10360 10361 10362 10363 10364 10365 10366 10367 10368 10369 10370 10371 10372 10373 10374 10375 10376 10377 10378 10379 10380 10381 10382 10383 10384 10385 10386 10387 10388 10389 10390 10391 10392 10393 10394 10395 10396 10397 10398 10399 10400 10401 10402 10403 10404 10405 10406 10407 10408 10409 10410 10411 10412 10413 10414 10415 10416 10417 10418 10419 10420 10421 10422 10423 10424 10425 10426 10427 10428 10429 10430 10431 10432 10433 10434 10435 10436 10437 10438 10439 10440 10441 10442 10443 10444 10445 10446 10447 10448 10449 10450 10451 10452 10453 10454 10455 10456 10457 10458 10459 10460 10461 10462 10463 10464 10465 10466 10467 10468 10469 10470 10471 10472 10473 10474 10475 10476 10477 10478 10479 10480 10481 10482 10483 10484 10485 10486 10487 10488 10489 10490 10491 10492 10493 10494 10495 10496 10497 10498 10499 10500 10501 10502 10503 10504 10505 10506 10507 10508 10509 10510 10511 10512 10513 10514 10515 10516 10517 10518 10519 10520 10521 10522 10523 10524 10525 10526 10527 10528 10529 10530 10531 10532 10533 10534 10535 10536 10537 10538 10539 10540 10541 10542 10543 10544 10545 10546 10547 10548 10549 10550 10551 10552 10553 10554 10555 10556 10557 10558 10559 10560 10561 10562 10563 10564 10565 10566 10567 10568 10569 10570 10571 10572 10573 10574 10575 10576 10577 10578 10579 10580 10581 10582 10583 10584 10585 10586 10587 10588 10589 10590 10591 10592 10593 10594 10595 10596 10597 10598 10599 10600 10601 10602 10603 10604 10605 10606 10607 10608 10609 10610 10611 10612 10613 10614 10615 10616 10617 10618 10619 10620 10621 10622 10623 10624 10625 10626 10627 10628 10629 10630 10631 10632 10633 10634 10635 10636 10637 10638 10639 10640 10641 10642 10643 10644 10645 10646 10647 10648 10649 10650 10651 10652 10653 10654 10655 10656 10657 10658 10659 10660 10661 10662 10663 10664 10665 10666 10667 10668 10669 10670 10671 10672 10673 10674 10675 10676 10677 10678 10679 10680 10681 10682 10683 10684 10685 10686 10687 10688 10689 10690 10691 10692 10693 10694 10695 10696 10697 10698 10699 10700 10701 10702 10703 10704 10705 10706 10707 10708 10709 10710 10711 10712 10713 10714 10715 10716 10717 10718 10719 10720 10721 10722 10723 10724 10725 10726 10727 10728 10729 10730 10731 10732 10733 10734 10735 10736 10737 10738 10739 10740 10741 10742 10743 10744 10745 10746 10747 10748 10749 10750 10751 10752 10753 10754 10755 10756 10757 10758 10759 10760 10761 10762 10763 10764 10765 10766 10767 10768 10769 10770 10771 10772 10773 10774 10775 10776 10777 10778 10779 10780 10781 10782 10783 10784 10785 10786 10787 10788 10789 10790 10791 10792 10793 10794 10795 10796 10797 10798 10799 10800 10801 10802 10803 10804 10805 10806 10807 10808 10809 10810 10811 10812 10813 10814 10815 10816 10817 10818 10819 10820 10821 10822 10823 10824 10825 10826 10827 10828 10829 10830 10831 10832 10833 10834 10835 10836 10837 10838 10839 10840 10841 10842 10843 10844 10845 10846 10847 10848 10849 10850 10851 10852 10853 10854 10855 10856 10857 10858 10859 10860 10861 10862 10863 10864 10865 10866 10867 10868 10869 10870 10871 10872 10873 10874 10875 10876 10877 10878 10879 10880 10881 10882 10883 10884 10885 10886 10887 10888 10889 10890 10891 10892 10893 10894 10895 10896 10897 10898 10899 10900 10901 10902 10903 10904 10905 10906 10907 10908 10909 10910 10911 10912 10913 10914 10915 10916 10917 10918 10919 10920 10921 10922 10923 10924 10925 10926 10927 10928 10929 10930 10931 10932 10933 10934 10935 10936 10937 10938 10939 10940 10941 10942 10943 10944 10945 10946 10947 10948 10949 10950 10951 10952 10953 10954 10955 10956 10957 10958 10959 10960 10961 10962 10963 10964 10965 10966 10967 10968 10969 10970 10971 10972 10973 10974 10975 10976 10977 10978 10979 10980 10981 10982 10983 10984 10985 10986 10987 10988 10989 10990 10991 10992 10993 10994 10995 10996 10997 10998 10999 11000 11001 11002 11003 11004 11005 11006 11007 11008 11009 11010 11011 11012 11013 11014 11015 11016 11017 11018 11019 11020 11021 11022 11023 11024 11025 11026 11027 11028 11029 11030 11031 11032 11033 11034 11035 11036 11037 11038 11039 11040 11041 11042 11043 11044 11045 11046 11047 11048 11049 11050 11051 11052 11053 11054 11055 11056 11057 11058 11059 11060 11061 11062 11063 11064 11065 11066 11067 11068 11069 11070 11071 11072 11073 11074 11075 11076 11077 11078 11079 11080 11081 11082 11083 11084 11085 11086 11087 11088 11089 11090 11091 11092 11093 11094 11095 11096 11097 11098 11099 11100 11101 11102 11103 11104 11105 11106 11107 11108 11109 11110 11111 11112 11113 11114 11115 11116 11117 11118 11119 11120 11121 11122 11123 11124 11125 11126 11127 11128 11129 11130 11131 11132 11133 11134 11135 11136 11137 11138 11139 11140 11141 11142 11143 11144 11145 11146 11147 11148 11149 11150 11151 11152 11153 11154 11155 11156 11157 11158 11159 11160 11161 11162 11163 11164 11165 11166 11167 11168 11169 11170 11171 11172 11173 11174 11175 11176 11177 11178 11179 11180 11181 11182 11183 11184 11185 11186 11187 11188 11189 11190 11191 11192 11193 11194 11195 11196 11197 11198 11199 11200 11201 11202 11203 11204 11205 11206 11207 11208 11209 11210 11211 11212 11213 11214 11215 11216 11217 11218 11219 11220 11221 11222 11223 11224 11225 11226 11227 11228 11229 11230 11231 11232 11233 11234 11235 11236 11237 11238 11239 11240 11241 11242 11243 11244 11245 11246 11247 11248 11249 11250 11251 11252 11253 11254 11255 11256 11257 11258 11259 11260 11261 11262 11263 11264 11265 11266 11267 11268 11269 11270 11271 11272 11273 11274 11275 11276 11277 11278 11279 11280 11281 11282 11283 11284 11285 11286 11287 11288 11289 11290 11291 11292 11293 11294 11295 11296 11297 11298 11299 11300 11301 11302 11303 11304 11305 11306 11307 11308 11309 11310 11311 11312 11313 11314 11315 11316 11317 11318 11319 11320 11321 11322 11323 11324 11325 11326 11327 11328 11329 11330 11331 11332 11333 11334 11335 11336 11337 11338 11339 11340 11341 11342 11343 11344 11345 11346 11347 11348 11349 11350 11351 11352 11353 11354 11355 11356 11357 11358 11359 11360 11361 11362 11363 11364 11365 11366 11367 11368 11369 11370 11371 11372 11373 11374 11375 11376 11377 11378 11379 11380 11381 11382 11383 11384 11385 11386 11387 11388 11389 11390 11391 11392 11393 11394 11395 11396 11397 11398 11399 11400 11401 11402 11403 11404 11405 11406 11407 11408 11409 11410 11411 11412 11413 11414 11415 11416 11417 11418 11419 11420 11421 11422 11423 11424 11425 11426 11427 11428 11429 11430 11431 11432 11433 11434 11435 11436 11437 11438 11439 11440 11441 11442 11443 11444 11445 11446 11447 11448 11449 11450 11451 11452 11453 11454 11455 11456 11457 11458 11459 11460 11461 11462 11463 11464 11465 11466 11467 11468 11469 11470 11471 11472 11473 11474 11475 11476 11477 11478 11479 11480 11481 11482 11483 11484 11485 11486 11487 11488 11489 11490 11491 11492 11493 11494 11495 11496 11497 11498 11499 11500 11501 11502 11503 11504 11505 11506 11507 11508 11509 11510 11511 11512 11513 11514 11515 11516 11517 11518 11519 11520 11521 11522 11523 11524 11525 11526 11527 11528 11529 11530 11531 11532 11533 11534 11535 11536 11537 11538 11539 11540 11541 11542 11543 11544 11545 11546 11547 11548 11549 11550 11551 11552 11553 11554 11555 11556 11557 11558 11559 11560 11561 11562 11563 11564 11565 11566 11567 11568 11569 11570 11571 11572 11573 11574 11575 11576 11577 11578 11579 11580 11581 11582 11583 11584 11585 11586 11587 11588 11589 11590 11591 11592 11593 11594 11595 11596 11597 11598 11599 11600 11601 11602 11603 11604 11605 11606 11607 11608 11609 11610 11611 11612 11613 11614 11615 11616 11617 11618 11619 11620 11621 11622 11623 11624 11625 11626 11627 11628 11629 11630 11631 11632 11633 11634 11635 11636 11637 11638 11639 11640 11641 11642 11643 11644 11645 11646 11647 11648 11649 11650 11651 11652 11653 11654 11655 11656 11657 11658 11659 11660 11661 11662 11663 11664 11665 11666 11667 11668 11669 11670 11671 11672 11673 11674 11675 11676 11677 11678 11679 11680 11681 11682 11683 11684 11685 11686 11687 11688 11689 11690 11691 11692 11693 11694 11695 11696 11697 11698 11699 11700 11701 11702 11703 11704 11705 11706 11707 11708 11709 11710 11711 11712 11713 11714 11715 11716 11717 11718 11719 11720 11721 11722 11723 11724 11725 11726 11727 11728 11729 11730 11731 11732 11733 11734 11735 11736 11737 11738 11739 11740 11741 11742 11743 11744 11745 11746 11747 11748 11749 11750 11751 11752 11753 11754 11755 11756 11757 11758 11759 11760 11761 11762 11763 11764 11765 11766 11767 11768 11769 11770 11771 11772 11773 11774 11775 11776 11777 11778 11779 11780 11781 11782 11783 11784 11785 11786 11787 11788 11789 11790 11791 11792 11793 11794 11795 11796 11797 11798 11799 11800 11801 11802 11803 11804 11805 11806 11807 11808 11809 11810 11811 11812 11813 11814 11815 11816 11817 11818 11819 11820 11821 11822 11823 11824 11825 11826 11827 11828 11829 11830 11831 11832 11833 11834 11835 11836 11837 11838 11839 11840 11841 11842 11843 11844 11845 11846 11847 11848 11849 11850 11851 11852 11853 11854 11855 11856 11857 11858 11859 11860 11861 11862 11863 11864 11865 11866 11867 11868 11869 11870 11871 11872 11873 11874 11875 11876 11877 11878 11879 11880 11881 11882 11883 11884 11885 11886 11887 11888 11889 11890 11891 11892 11893 11894 11895 11896 11897 11898 11899 11900 11901 11902 11903 11904 11905 11906 11907 11908 11909 11910 11911 11912 11913 11914 11915 11916 11917 11918 11919 11920 11921 11922 11923 11924 11925 11926 11927 11928 11929 11930 11931 11932 11933 11934 11935 11936 11937 11938 11939 11940 11941 11942 11943 11944 11945 11946 11947 11948 11949 11950 11951 11952 11953 11954 11955 11956 11957 11958 11959 11960 11961 11962 11963 11964 11965 11966 11967 11968 11969 11970 11971 11972 11973 11974 11975 11976 11977 11978 11979 11980 11981 11982 11983 11984 11985 11986 11987 11988 11989 11990 11991 11992 11993 11994 11995 11996 11997 11998 11999 12000 12001 12002 12003 12004 12005 12006 12007 12008 12009 12010 12011 12012 12013 12014 12015 12016 12017 12018 12019 12020 12021 12022 12023 12024 12025 12026 12027 12028 12029 12030 12031 12032 12033 12034 12035 12036 12037 12038 12039 12040 12041 12042 12043 12044 12045 12046 12047 12048 12049 12050 12051 12052 12053 12054 12055 12056 12057 12058 12059 12060 12061 12062 12063 12064 12065 12066 12067 12068 12069 12070 12071 12072 12073 12074 12075 12076 12077 12078 12079 12080 12081 12082 12083 12084 12085 12086 12087 12088 12089 12090 12091 12092 12093 12094 12095 12096 12097 12098 12099 12100 12101 12102 12103 12104 12105 12106 12107 12108 12109 12110 12111 12112 12113 12114 12115 12116 12117 12118 12119 12120 12121 12122 12123 12124 12125 12126 12127 12128 12129 12130 12131 12132 12133 12134 12135 12136 12137 12138 12139 12140 12141 12142 12143 12144 12145 12146 12147 12148 12149 12150 12151 12152 12153 12154 12155 12156 12157 12158 12159 12160 12161 12162 12163 12164 12165 12166 12167 12168 12169 12170 12171 12172 12173 12174 12175 12176 12177 12178 12179 12180 12181 12182 12183 12184 12185 12186 12187 12188 12189 12190 12191 12192 12193 12194 12195 12196 12197 12198 12199 12200 12201 12202 12203 12204 12205 12206 12207 12208 12209 12210 12211 12212 12213 12214 12215 12216 12217 12218 12219 12220 12221 12222 12223 12224 12225 12226 12227 12228 12229 12230 12231 12232 12233 12234 12235 12236 12237 12238 12239 12240 12241 12242 12243 12244 12245 12246 12247 12248 12249 12250 12251 12252 12253 12254 12255 12256 12257 12258 12259 12260 12261 12262 12263 12264 12265 12266 12267 12268 12269 12270 12271 12272 12273 12274 12275 12276 12277 12278 12279 12280 12281 12282 12283 12284 12285 12286 12287 12288 12289 12290 12291 12292 12293 12294 12295 12296 12297 12298 12299 12300 12301 12302 12303 12304 12305 12306 12307 12308 12309 12310 12311 12312 12313 12314 12315 12316 12317 12318 12319 12320 12321 12322 12323 12324 12325 12326 12327 12328 12329 12330 12331 12332 12333 12334 12335 12336 12337 12338 12339 12340 12341 12342 12343 12344 12345 12346 12347 12348 12349 12350 12351 12352 12353 12354 12355 12356 12357 12358 12359 12360 12361 12362 12363 12364 12365 12366 12367 12368 12369 12370 12371 12372 12373 12374 12375 12376 12377 12378 12379 12380 12381 12382 12383 12384 12385 12386 12387 12388 12389 12390 12391 12392 12393 12394 12395 12396 12397 12398 12399 12400 12401 12402 12403 12404 12405 12406 12407 12408 12409 12410 12411 12412 12413 12414 12415 12416 12417 12418 12419 12420 12421 12422 12423 12424 12425 12426 12427 12428 12429 12430 12431 12432 12433 12434 12435 12436 12437 12438 12439 12440 12441 12442 12443 12444 12445 12446 12447 12448 12449 12450 12451 12452 12453 12454 12455 12456 12457 12458 12459 12460 12461 12462 12463 12464 12465 12466 12467 12468 12469 12470 12471 12472 12473 12474 12475 12476 12477 12478 12479 12480 12481 12482 12483 12484 12485 12486 12487 12488 12489 12490 12491 12492 12493 12494 12495 12496 12497 12498 12499 12500 12501 12502 12503 12504 12505 12506 12507 12508 12509 12510 12511 12512 12513 12514 12515 12516 12517 12518 12519 12520 12521 12522 12523 12524 12525 12526 12527 12528 12529 12530 12531 12532 12533 12534 12535 12536 12537 12538 12539 12540 12541 12542 12543 12544 12545 12546 12547 12548 12549 12550 12551 12552 12553 12554 12555 12556 12557 12558 12559 12560 12561 12562 12563 12564 12565 12566 12567 12568 12569 12570 12571 12572 12573 12574 12575 12576 12577 12578 12579 12580 12581 12582 12583 12584 12585 12586 12587 12588 12589 12590 12591 12592 12593 12594 12595 12596 12597 12598 12599 12600 12601 12602 12603 12604 12605 12606 12607 12608 12609 12610 12611 12612 12613 12614 12615 12616 12617 12618 12619 12620 12621 12622 12623 12624 12625 12626 12627 12628 12629 12630 12631 12632 12633 12634 12635 12636 12637 12638 12639 12640 12641 12642 12643 12644 12645 12646 12647 12648 12649 12650 12651 12652 12653 12654 12655 12656 12657 12658 12659 12660 12661 12662 12663 12664 12665 12666 12667 12668 12669 12670 12671 12672 12673 12674 12675 12676 12677 12678 12679 12680 12681 12682 12683 12684 12685 12686 12687 12688 12689 12690 12691 12692 12693 12694 12695 12696 12697 12698 12699 12700 12701 12702 12703 12704 12705 12706 12707 12708 12709 12710 12711 12712 12713 12714 12715 12716 12717 12718 12719 12720 12721 12722 12723 12724 12725 12726 12727 12728 12729 12730 12731 12732 12733 12734 12735 12736 12737 12738 12739 12740 12741 12742 12743 12744 12745 12746 12747 12748 12749 12750 12751 12752 12753 12754 12755 12756 12757 12758 12759 12760 12761 12762 12763 12764 12765 12766 12767 12768 12769 12770 12771 12772 12773 12774 12775 12776 12777 12778 12779 12780 12781 12782 12783 12784 12785 12786 12787 12788 12789 12790 12791 12792 12793 12794 12795 12796 12797 12798 12799 12800 12801 12802 12803 12804 12805 12806 12807 12808 12809 12810 12811 12812 12813 12814 12815 12816 12817 12818 12819 12820 12821 12822 12823 12824 12825 12826 12827 12828 12829 12830 12831 12832 12833 12834 12835 12836 12837 12838 12839 12840 12841 12842 12843 12844 12845 12846 12847 12848 12849 12850 12851 12852 12853 12854 12855 12856 12857 12858 12859 12860 12861 12862 12863 12864 12865 12866 12867 12868 12869 12870 12871 12872 12873 12874 12875 12876 12877 12878 12879 12880 12881 12882 12883 12884 12885 12886 12887 12888 12889 12890 12891 12892 12893 12894 12895 12896 12897 12898 12899 12900 12901 12902 12903 12904 12905 12906 12907 12908 12909 12910 12911 12912 12913 12914 12915 12916 12917 12918 12919 12920 12921 12922 12923 12924 12925 12926 12927 12928 12929 12930 12931 12932 12933 12934 12935 12936 12937 12938 12939 12940 12941 12942 12943 12944 12945 12946 12947 12948 12949 12950 12951 12952 12953 12954 12955 12956 12957 12958 12959 12960 12961 12962 12963 12964 12965 12966 12967 12968 12969 12970 12971 12972 12973 12974 12975 12976 12977 12978 12979 12980 12981 12982 12983 12984 12985 12986 12987 12988 12989 12990 12991 12992 12993 12994 12995 12996 12997 12998 12999 13000 13001 13002 13003 13004 13005 13006 13007 13008 13009 13010 13011 13012 13013 13014 13015 13016 13017 13018 13019 13020 13021 13022 13023 13024 13025 13026 13027 13028 13029 13030 13031 13032 13033 13034 13035 13036 13037 13038 13039 13040 13041 13042 13043 13044 13045 13046 13047 13048 13049 13050 13051 13052 13053 13054 13055 13056 13057 13058 13059 13060 13061 13062 13063 13064 13065 13066 13067 13068 13069 13070 13071 13072 13073 13074 13075 13076 13077 13078 13079 13080 13081 13082 13083 13084 13085 13086 13087 13088 13089 13090 13091 13092 13093 13094 13095 13096 13097 13098 13099 13100 13101 13102 13103 13104 13105 13106 13107 13108 13109 13110 13111 13112 13113 13114 13115 13116 13117 13118 13119 13120 13121 13122 13123 13124 13125 13126 13127 13128 13129 13130 13131 13132 13133 13134 13135 13136 13137 13138 13139 13140 13141 13142 13143 13144 13145 13146 13147 13148 13149 13150 13151 13152 13153 13154 13155 13156 13157 13158 13159 13160 13161 13162 13163 13164 13165 13166 13167 13168 13169 13170 13171 13172 13173 13174 13175 13176 13177 13178 13179 13180 13181 13182 13183 13184 13185 13186 13187 13188 13189 13190 13191 13192 13193 13194 13195 13196 13197 13198 13199 13200 13201 13202 13203 13204 13205 13206 13207 13208 13209 13210 13211 13212 13213 13214 13215 13216 13217 13218 13219 13220 13221 13222 13223 13224 13225 13226 13227 13228 13229 13230 13231 13232 13233 13234 13235 13236 13237 13238 13239 13240 13241 13242 13243 13244 13245 13246 13247 13248 13249 13250 13251 13252 13253 13254 13255 13256 13257 13258 13259 13260 13261 13262 13263 13264 13265 13266 13267 13268 13269 13270 13271 13272 13273 13274 13275 13276 13277 13278 13279 13280 13281 13282 13283 13284 13285 13286 13287 13288 13289 13290 13291 13292 13293 13294 13295 13296 13297 13298 13299 13300 13301 13302 13303 13304 13305 13306 13307 13308 13309 13310 13311 13312 13313 13314 13315 13316 13317 13318 13319 13320 13321 13322 13323 13324 13325 13326 13327 13328 13329 13330 13331 13332 13333 13334 13335 13336 13337 13338 13339 13340 13341 13342 13343 13344 13345 13346 13347 13348 13349 13350 13351 13352 13353 13354 13355 13356 13357 13358 13359 13360 13361 13362 13363 13364 13365 13366 13367 13368 13369 13370 13371 13372 13373 13374 13375 13376 13377 13378 13379 13380 13381 13382 13383 13384 13385 13386 13387 13388 13389 13390 13391 13392 13393 13394 13395 13396 13397 13398 13399 13400 13401 13402 13403 13404 13405 13406 13407 13408 13409 13410 13411 13412 13413 13414 13415 13416 13417 13418 13419 13420 13421 13422 13423 13424 13425 13426 13427 13428 13429 13430 13431 13432 13433 13434 13435 13436 13437 13438 13439 13440 13441 13442 13443 13444 13445 13446 13447 13448 13449 13450 13451 13452 13453 13454 13455 13456 13457 13458 13459 13460 13461 13462 13463 13464 13465 13466 13467 13468 13469 13470 13471 13472 13473 13474 13475 13476 13477 13478 13479 13480 13481 13482 13483 13484 13485 13486 13487 13488 13489 13490 13491 13492 13493 13494 13495 13496 13497 13498 13499 13500 13501 13502 13503 13504 13505 13506 13507 13508 13509 13510 13511 13512 13513 13514 13515 13516 13517 13518 13519 13520 13521 13522 13523 13524 13525 13526 13527 13528 13529 13530 13531 13532 13533 13534 13535 13536 13537 13538 13539 13540 13541 13542 13543 13544 13545 13546 13547 13548 13549 13550 13551 13552 13553 13554 13555 13556 13557 13558 13559 13560 13561 13562 13563 13564 13565 13566 13567 13568 13569 13570 13571 13572 13573 13574 13575 13576 13577 13578 13579 13580 13581 13582 13583 13584 13585 13586 13587 13588 13589 13590 13591 13592 13593 13594 13595 13596 13597 13598 13599 13600 13601 13602 13603 13604 13605 13606 13607 13608 13609 13610 13611 13612 13613 13614 13615 13616 13617 13618 13619 13620 13621 13622 13623 13624 13625 13626 13627 13628 13629 13630 13631 13632 13633 13634 13635 13636 13637 13638 13639 13640 13641 13642 13643 13644 13645 13646 13647 13648 13649 13650 13651 13652 13653 13654 13655 13656 13657 13658 13659 13660 13661 13662 13663 13664 13665 13666 13667 13668 13669 13670 13671 13672 13673 13674 13675 13676 13677 13678 13679 13680 13681 13682 13683 13684 13685 13686 13687 13688 13689 13690 13691 13692 13693 13694 13695 13696 13697 13698 13699 13700 13701 13702 13703 13704 13705 13706 13707 13708 13709 13710 13711 13712 13713 13714 13715 13716 13717 13718 13719 13720 13721 13722 13723 13724 13725 13726 13727 13728 13729 13730 13731 13732 13733 13734 13735 13736 13737 13738 13739 13740 13741 13742 13743 13744 13745 13746 13747 13748 13749 13750 13751 13752 13753 13754 13755 13756 13757 13758 13759 13760 13761 13762 13763 13764 13765 13766 13767 13768 13769 13770 13771 13772 13773 13774 13775 13776 13777 13778 13779 13780 13781 13782 13783 13784 13785 13786 13787 13788 13789 13790 13791 13792 13793 13794 13795 13796 13797 13798 13799 13800 13801 13802 13803 13804 13805 13806 13807 13808 13809 13810 13811 13812 13813 13814 13815 13816 13817 13818 13819 13820 13821 13822 13823 13824 13825 13826 13827 13828 13829 13830 13831 13832 13833 13834 13835 13836 13837 13838 13839 13840 13841 13842 13843 13844 13845 13846 13847 13848 13849 13850 13851 13852 13853 13854 13855 13856 13857 13858 13859 13860 13861 13862 13863 13864 13865 13866 13867 13868 13869 13870 13871 13872 13873 13874 13875 13876 13877 13878 13879 13880 13881 13882 13883 13884 13885 13886 13887 13888 13889 13890 13891 13892 13893 13894 13895 13896 13897 13898 13899 13900 13901 13902 13903 13904 13905 13906 13907 13908 13909 13910 13911 13912 13913 13914 13915 13916 13917 13918 13919 13920 13921 13922 13923 13924 13925 13926 13927 13928 13929 13930 13931 13932 13933 13934 13935 13936 13937 13938 13939 13940 13941 13942 13943 13944 13945 13946 13947 13948 13949 13950 13951 13952 13953 13954 13955 13956 13957 13958 13959 13960 13961 13962 13963 13964 13965 13966 13967 13968 13969 13970 13971 13972 13973 13974 13975 13976 13977 13978 13979 13980 13981 13982 13983 13984 13985 13986 13987 13988 13989 13990 13991 13992 13993 13994 13995 13996 13997 13998 13999 14000 14001 14002 14003 14004 14005 14006 14007 14008 14009 14010 14011 14012 14013 14014 14015 14016 14017 14018 14019 14020 14021 14022 14023 14024 14025 14026 14027 14028 14029 14030 14031 14032 14033 14034 14035 14036 14037 14038 14039 14040 14041 14042 14043 14044 14045 14046 14047 14048 14049 14050 14051 14052 14053 14054 14055 14056 14057 14058 14059 14060 14061 14062 14063 14064 14065 14066 14067 14068 14069 14070 14071 14072 14073 14074 14075 14076 14077 14078 14079 14080 14081 14082 14083 14084 14085 14086 14087 14088 14089 14090 14091 14092 14093 14094 14095 14096 14097 14098 14099 14100 14101 14102 14103 14104 14105 14106 14107 14108 14109 14110 14111 14112 14113 14114 14115 14116 14117 14118 14119 14120 14121 14122 14123 14124 14125 14126 14127 14128 14129 14130 14131 14132 14133 14134 14135 14136 14137 14138 14139 14140 14141 14142 14143 14144 14145 14146 14147 14148 14149 14150 14151 14152 14153 14154 14155 14156 14157 14158 14159 14160 14161 14162 14163 14164 14165 14166 14167 14168 14169 14170 14171 14172 14173 14174 14175 14176 14177 14178 14179 14180 14181 14182 14183 14184 14185 14186 14187 14188 14189 14190 14191 14192 14193 14194 14195 14196 14197 14198 14199 14200 14201 14202 14203 14204 14205 14206 14207 14208 14209 14210 14211 14212 14213 14214 14215 14216 14217 14218 14219 14220 14221 14222 14223 14224 14225 14226 14227 14228 14229 14230 14231 14232 14233 14234 14235 14236 14237 14238 14239 14240 14241 14242 14243 14244 14245 14246 14247 14248 14249 14250 14251 14252 14253 14254 14255 14256 14257 14258 14259 14260 14261 14262 14263 14264 14265 14266 14267 14268 14269 14270 14271 14272 14273 14274 14275 14276 14277 14278 14279 14280 14281 14282 14283 14284 14285 14286 14287 14288 14289 14290 14291 14292 14293 14294 14295 14296 14297 14298 14299 14300 14301 14302 14303 14304 14305 14306 14307 14308 14309 14310 14311 14312 14313 14314 14315 14316 14317 14318 14319 14320 14321 14322 14323 14324 14325 14326 14327 14328 14329 14330 14331 14332 14333 14334 14335 14336 14337 14338 14339 14340 14341 14342 14343 14344 14345 14346 14347 14348 14349 14350 14351 14352 14353 14354 14355 14356 14357 14358 14359 14360 14361 14362 14363 14364 14365 14366 14367 14368 14369 14370 14371 14372 14373 14374 14375 14376 14377 14378 14379 14380 14381 14382 14383 14384 14385 14386 14387 14388 14389 14390 14391 14392 14393 14394 14395 14396 14397 14398 14399 14400 14401 14402 14403 14404 14405 14406 14407 14408 14409 14410 14411 14412 14413 14414 14415 14416 14417 14418 14419 14420 14421 14422 14423 14424 14425 14426 14427 14428 14429 14430 14431 14432 14433 14434 14435 14436 14437 14438 14439 14440 14441 14442 14443 14444 14445 14446 14447 14448 14449 14450 14451 14452 14453 14454 14455 14456 14457 14458 14459 14460 14461 14462 14463 14464 14465 14466 14467 14468 14469 14470 14471 14472 14473 14474 14475 14476 14477 14478 14479 14480 14481 14482 14483 14484 14485 14486 14487 14488 14489 14490 14491 14492 14493 14494 14495 14496 14497 14498 14499 14500 14501 14502 14503 14504 14505 14506 14507 14508 14509 14510 14511 14512 14513 14514 14515 14516 14517 14518 14519 14520 14521 14522 14523 14524 14525 14526 14527 14528 14529 14530 14531 14532 14533 14534 14535 14536 14537 14538 14539 14540 14541 14542 14543 14544 14545 14546 14547 14548 14549 14550 14551 14552 14553 14554 14555 14556 14557 14558 14559 14560 14561 14562 14563 14564 14565 14566 14567 14568 14569 14570 14571 14572 14573 14574 14575 14576 14577 14578 14579 14580 14581 14582 14583 14584 14585 14586 14587 14588 14589 14590 14591 14592 14593 14594 14595 14596 14597 14598 14599 14600 14601 14602 14603 14604 14605 14606 14607 14608 14609 14610 14611 14612 14613 14614 14615 14616 14617 14618 14619 14620 14621 14622 14623 14624 14625 14626 14627 14628 14629 14630 14631 14632 14633 14634 14635 14636 14637 14638 14639 14640 14641 14642 14643 14644 14645 14646 14647 14648 14649 14650 14651 14652 14653 14654 14655 14656 14657 14658 14659 14660 14661 14662 14663 14664 14665 14666 14667 14668 14669 14670 14671 14672 14673 14674 14675 14676 14677 14678 14679 14680 14681 14682 14683 14684 14685 14686 14687 14688 14689 14690 14691 14692 14693 14694 14695 14696 14697 14698 14699 14700 14701 14702 14703 14704 14705 14706 14707 14708 14709 14710 14711 14712 14713 14714 14715 14716 14717 14718 14719 14720 14721 14722 14723 14724 14725 14726 14727 14728 14729 14730 14731 14732 14733 14734 14735 14736 14737 14738 14739 14740 14741 14742 14743 14744 14745 14746 14747 14748 14749 14750 14751 14752 14753 14754 14755 14756 14757 14758 14759 14760 14761 14762 14763 14764 14765 14766 14767 14768 14769 14770 14771 14772 14773 14774 14775 14776 14777 14778 14779 14780 14781 14782 14783 14784 14785 14786 14787 14788 14789 14790 14791 14792 14793 14794 14795 14796 14797 14798 14799 14800 14801 14802 14803 14804 14805 14806 14807 14808 14809 14810 14811 14812 14813 14814 14815 14816 14817 14818 14819 14820 14821 14822 14823 14824 14825 14826 14827 14828 14829 14830 14831 14832 14833 14834 14835 14836 14837 14838 14839 14840 14841 14842 14843 14844 14845 14846 14847 14848 14849 14850 14851 14852 14853 14854 14855 14856 14857 14858 14859 14860 14861 14862 14863 14864 14865 14866 14867 14868 14869 14870 14871 14872 14873 14874 14875 14876 14877 14878 14879 14880 14881 14882 14883 14884 14885 14886 14887 14888 14889 14890 14891 14892 14893 14894 14895 14896 14897 14898 14899 14900 14901 14902 14903 14904 14905 14906 14907 14908 14909 14910 14911 14912 14913 14914 14915 14916 14917 14918 14919 14920 14921 14922 14923 14924 14925 14926 14927 14928 14929 14930 14931 14932 14933 14934 14935 14936 14937 14938 14939 14940 14941 14942 14943 14944 14945 14946 14947 14948 14949 14950 14951 14952 14953 14954 14955 14956 14957 14958 14959 14960 14961 14962 14963 14964 14965 14966 14967 14968 14969 14970 14971 14972 14973 14974 14975 14976 14977 14978 14979 14980 14981 14982 14983 14984 14985 14986 14987 14988 14989 14990 14991 14992 14993 14994 14995 14996 14997 14998 14999 15000 15001 15002 15003 15004 15005 15006 15007 15008 15009 15010 15011 15012 15013 15014 15015 15016 15017 15018 15019 15020 15021 15022 15023 15024 15025 15026 15027 15028 15029 15030 15031 15032 15033 15034 15035 15036 15037 15038 15039 15040 15041 15042 15043 15044 15045 15046 15047 15048 15049 15050 15051 15052 15053 15054 15055 15056 15057 15058 15059 15060 15061 15062 15063 15064 15065 15066 15067 15068 15069 15070 15071 15072 15073 15074 15075 15076 15077 15078 15079 15080 15081 15082 15083 15084 15085 15086 15087 15088 15089 15090 15091 15092 15093 15094 15095 15096 15097 15098 15099 15100 15101 15102 15103 15104 15105 15106 15107 15108 15109 15110 15111 15112 15113 15114 15115 15116 15117 15118 15119 15120 15121 15122 15123 15124 15125 15126 15127 15128 15129 15130 15131 15132 15133 15134 15135 15136 15137 15138 15139 15140 15141 15142 15143 15144 15145 15146 15147 15148 15149 15150 15151 15152 15153 15154 15155 15156 15157 15158 15159 15160 15161 15162 15163 15164 15165 15166 15167 15168 15169 15170 15171 15172 15173 15174 15175 15176 15177 15178 15179 15180 15181 15182 15183 15184 15185 15186 15187 15188 15189 15190 15191 15192 15193 15194 15195 15196 15197 15198 15199 15200 15201 15202 15203 15204 15205 15206 15207 15208 15209 15210 15211 15212 15213 15214 15215 15216 15217 15218 15219 15220 15221 15222 15223 15224 15225 15226 15227 15228 15229 15230 15231 15232 15233 15234 15235 15236 15237 15238 15239 15240 15241 15242 15243 15244 15245 15246 15247 15248 15249 15250 15251 15252 15253 15254 15255 15256 15257 15258 15259 15260 15261 15262 15263 15264 15265 15266 15267 15268 15269 15270 15271 15272 15273 15274 15275 15276 15277 15278 15279 15280 15281 15282 15283 15284 15285 15286 15287 15288 15289 15290 15291 15292 15293 15294 15295 15296 15297 15298 15299 15300 15301 15302 15303 15304 15305 15306 15307 15308 15309 15310 15311 15312 15313 15314 15315 15316 15317 15318 15319 15320 15321 15322 15323 15324 15325 15326 15327 15328 15329 15330 15331 15332 15333 15334 15335 15336 15337 15338 15339 15340 15341 15342 15343 15344 15345 15346 15347 15348 15349 15350 15351 15352 15353 15354 15355 15356 15357 15358 15359 15360 15361 15362 15363 15364 15365 15366 15367 15368 15369 15370 15371 15372 15373 15374 15375 15376 15377 15378 15379 15380 15381 15382 15383 15384 15385 15386 15387 15388 15389 15390 15391 15392 15393 15394 15395 15396 15397 15398 15399 15400 15401 15402 15403 15404 15405 15406 15407 15408 15409 15410 15411 15412 15413 15414 15415 15416 15417 15418 15419 15420 15421 15422 15423 15424 15425 15426 15427 15428 15429 15430 15431 15432 15433 15434 15435 15436 15437 15438 15439 15440 15441 15442 15443 15444 15445 15446 15447 15448 15449 15450 15451 15452 15453 15454 15455 15456 15457 15458 15459 15460 15461 15462 15463 15464 15465 15466 15467 15468 15469 15470 15471 15472 15473 15474 15475 15476 15477 15478 15479 15480 15481 15482 15483 15484 15485 15486 15487 15488 15489 15490 15491 15492 15493 15494 15495 15496 15497 15498 15499 15500 15501 15502 15503 15504 15505 15506 15507 15508 15509 15510 15511 15512 15513 15514 15515 15516 15517 15518 15519 15520 15521 15522 15523 15524 15525 15526 15527 15528 15529 15530 15531 15532 15533 15534 15535 15536 15537 15538 15539 15540 15541 15542 15543 15544 15545 15546 15547 15548 15549 15550 15551 15552 15553 15554 15555 15556 15557 15558 15559 15560 15561 15562 15563 15564 15565 15566 15567 15568 15569 15570 15571 15572 15573 15574 15575 15576 15577 15578 15579 15580 15581 15582 15583 15584 15585 15586 15587 15588 15589 15590 15591 15592 15593 15594 15595 15596 15597 15598 15599 15600 15601 15602 15603 15604 15605 15606 15607 15608 15609 15610 15611 15612 15613 15614 15615 15616 15617 15618 15619 15620 15621 15622 15623 15624 15625 15626 15627 15628 15629 15630 15631 15632 15633 15634 15635 15636 15637 15638 15639 15640 15641 15642 15643 15644 15645 15646 15647 15648 15649 15650 15651 15652 15653 15654 15655 15656 15657 15658 15659 15660 15661 15662 15663 15664 15665 15666 15667 15668 15669 15670 15671 15672 15673 15674 15675 15676 15677 15678 15679 15680 15681 15682 15683 15684 15685 15686 15687 15688 15689 15690 15691 15692 15693 15694 15695 15696 15697 15698 15699 15700 15701 15702 15703 15704 15705 15706 15707 15708 15709 15710 15711 15712 15713 15714 15715 15716 15717 15718 15719 15720 15721 15722 15723 15724 15725 15726 15727 15728 15729 15730 15731 15732 15733 15734 15735 15736 15737 15738 15739 15740 15741 15742 15743 15744 15745 15746 15747 15748 15749 15750 15751 15752 15753 15754 15755 15756 15757 15758 15759 15760 15761 15762 15763 15764 15765 15766 15767 15768 15769 15770 15771 15772 15773 15774 15775 15776 15777 15778 15779 15780 15781 15782 15783 15784 15785 15786 15787 15788 15789 15790 15791 15792 15793 15794 15795 15796 15797 15798 15799 15800 15801 15802 15803 15804 15805 15806 15807 15808 15809 15810 15811 15812 15813 15814 15815 15816 15817 15818 15819 15820 15821 15822 15823 15824 15825 15826 15827 15828 15829 15830 15831 15832 15833 15834 15835 15836 15837 15838 15839 15840 15841 15842 15843 15844 15845 15846 15847 15848 15849 15850 15851 15852 15853 15854 15855 15856 15857 15858 15859 15860 15861 15862 15863 15864 15865 15866 15867 15868 15869 15870 15871 15872 15873 15874 15875 15876 15877 15878 15879 15880 15881 15882 15883 15884 15885 15886 15887 15888 15889 15890 15891 15892 15893 15894 15895 15896 15897 15898 15899 15900 15901 15902 15903 15904 15905 15906 15907 15908 15909 15910 15911 15912 15913 15914 15915 15916 15917 15918 15919 15920 15921 15922 15923 15924 15925 15926 15927 15928 15929 15930 15931 15932 15933 15934 15935 15936 15937 15938 15939 15940 15941 15942 15943 15944 15945 15946 15947 15948 15949 15950 15951 15952 15953 15954 15955 15956 15957 15958 15959 15960 15961 15962 15963 15964 15965 15966 15967 15968 15969 15970 15971 15972 15973 15974 15975 15976 15977 15978 15979 15980 15981 15982 15983 15984 15985 15986 15987 15988 15989 15990 15991 15992 15993 15994 15995 15996 15997 15998 15999 16000 16001 16002 16003 16004 16005 16006 16007 16008 16009 16010 16011 16012 16013 16014 16015 16016 16017 16018 16019 16020 16021 16022 16023 16024 16025 16026 16027 16028 16029 16030 16031 16032 16033 16034 16035 16036 16037 16038 16039 16040 16041 16042 16043 16044 16045 16046 16047 16048 16049 16050 16051 16052 16053 16054 16055 16056 16057 16058 16059 16060 16061 16062 16063 16064 16065 16066 16067 16068 16069 16070 16071 16072 16073 16074 16075 16076 16077 16078 16079 16080 16081 16082 16083 16084 16085 16086 16087 16088 16089 16090 16091 16092 16093 16094 16095 16096 16097 16098 16099 16100 16101 16102 16103 16104 16105 16106 16107 16108 16109 16110 16111 16112 16113 16114 16115 16116 16117 16118 16119 16120 16121 16122 16123 16124 16125 16126 16127 16128 16129 16130 16131 16132 16133 16134 16135 16136 16137 16138 16139 16140 16141 16142 16143 16144 16145 16146 16147 16148 16149 16150 16151 16152 16153 16154 16155 16156 16157 16158 16159 16160 16161 16162 16163 16164 16165 16166 16167 16168 16169 16170 16171 16172 16173 16174 16175 16176 16177 16178 16179 16180 16181 16182 16183 16184 16185 16186 16187 16188 16189 16190 16191 16192 16193 16194 16195 16196 16197 16198 16199 16200 16201 16202 16203 16204 16205 16206 16207 16208 16209 16210 16211 16212 16213 16214 16215 16216 16217 16218 16219 16220 16221 16222 16223 16224 16225 16226 16227 16228 16229 16230 16231 16232 16233 16234 16235 16236 16237 16238 16239 16240 16241 16242 16243 16244 16245 16246 16247 16248 16249 16250 16251 16252 16253 16254 16255 16256 16257 16258 16259 16260 16261 16262 16263 16264 16265 16266 16267 16268 16269 16270 16271 16272 16273 16274 16275 16276 16277 16278 16279 16280 16281 16282 16283 16284 16285 16286 16287 16288 16289 16290 16291 16292 16293 16294 16295 16296 16297 16298 16299 16300 16301 16302 16303 16304 16305 16306 16307 16308 16309 16310 16311 16312 16313 16314 16315 16316 16317 16318 16319 16320 16321 16322 16323 16324 16325 16326 16327 16328 16329 16330 16331 16332 16333 16334 16335 16336 16337 16338 16339 16340 16341 16342 16343 16344 16345 16346 16347 16348 16349 16350 16351 16352 16353 16354 16355 16356 16357 16358 16359 16360 16361 16362 16363 16364 16365 16366 16367 16368 16369 16370 16371 16372 16373 16374 16375 16376 16377 16378 16379 16380 16381 16382 16383 16384 16385 16386 16387 16388 16389 16390 16391 16392 16393 16394 16395 16396 16397 16398 16399 16400 16401 16402 16403 16404 16405 16406 16407 16408 16409 16410 16411 16412 16413 16414 16415 16416 16417 16418 16419 16420 16421 16422 16423 16424 16425 16426 16427 16428 16429 16430 16431 16432 16433 16434 16435 16436 16437 16438 16439 16440 16441 16442 16443 16444 16445 16446 16447 16448 16449 16450 16451 16452 16453 16454 16455 16456 16457 16458 16459 16460 16461 16462 16463 16464 16465 16466 16467 16468 16469 16470 16471 16472 16473 16474 16475 16476 16477 16478 16479 16480 16481 16482 16483 16484 16485 16486 16487 16488 16489 16490 16491 16492 16493 16494 16495 16496 16497 16498 16499 16500 16501 16502 16503 16504 16505 16506 16507 16508 16509 16510 16511 16512 16513 16514 16515 16516 16517 16518 16519 16520 16521 16522 16523 16524 16525 16526 16527 16528 16529 16530 16531 16532 16533 16534 16535 16536 16537 16538 16539 16540 16541 16542 16543 16544 16545 16546 16547 16548 16549 16550 16551 16552 16553 16554 16555 16556 16557 16558 16559 16560 16561 16562 16563 16564 16565 16566 16567 16568 16569 16570 16571 16572 16573 16574 16575 16576 16577 16578 16579 16580 16581 16582 16583 16584 16585 16586 16587 16588 16589 16590 16591 16592 16593 16594 16595 16596 16597 16598 16599 16600 16601 16602 16603 16604 16605 16606 16607 16608 16609 16610 16611 16612 16613 16614 16615 16616 16617 16618 16619 16620 16621 16622 16623 16624 16625 16626 16627 16628 16629 16630 16631 16632 16633 16634 16635 16636 16637 16638 16639 16640 16641 16642 16643 16644 16645 16646 16647 16648 16649 16650 16651 16652 16653 16654 16655 16656 16657 16658 16659 16660 16661 16662 16663 16664 16665 16666 16667 16668 16669 16670 16671 16672 16673 16674 16675 16676 16677 16678 16679 16680 16681 16682 16683 16684 16685 16686 16687 16688 16689 16690 16691 16692 16693 16694 16695 16696 16697 16698 16699 16700 16701 16702 16703 16704 16705 16706 16707 16708 16709 16710 16711 16712 16713 16714 16715 16716 16717 16718 16719 16720 16721 16722 16723 16724 16725 16726 16727 16728 16729 16730 16731 16732 16733 16734 16735 16736 16737 16738 16739 16740 16741 16742 16743 16744 16745 16746 16747 16748 16749 16750 16751 16752 16753 16754 16755 16756 16757 16758 16759 16760 16761 16762 16763 16764 16765 16766 16767 16768 16769 16770 16771 16772 16773 16774 16775 16776 16777 16778 16779 16780 16781 16782 16783 16784 16785 16786 16787 16788 16789 16790 16791 16792 16793 16794 16795 16796 16797 16798 16799 16800 16801 16802 16803 16804 16805 16806 16807 16808 16809 16810 16811 16812 16813 16814 16815 16816 16817 16818 16819 16820 16821 16822 16823 16824 16825 16826 16827 16828 16829 16830 16831 16832 16833 16834 16835 16836 16837 16838 16839 16840 16841 16842 16843 16844 16845 16846 16847 16848 16849 16850 16851 16852 16853 16854 16855 16856 16857 16858 16859 16860 16861 16862 16863 16864 16865 16866 16867 16868 16869 16870 16871 16872 16873 16874 16875 16876 16877 16878 16879 16880 16881 16882 16883 16884 16885 16886 16887 16888 16889 16890 16891 16892 16893 16894 16895 16896 16897 16898 16899 16900 16901 16902 16903 16904 16905 16906 16907 16908 16909 16910 16911 16912 16913 16914 16915 16916 16917 16918 16919 16920 16921 16922 16923 16924 16925 16926 16927 16928 16929 16930 16931 16932 16933 16934 16935 16936 16937 16938 16939 16940 16941 16942 16943 16944 16945 16946 16947 16948 16949 16950 16951 16952 16953 16954 16955 16956 16957 16958 16959 16960 16961 16962 16963 16964 16965 16966 16967 16968 16969 16970 16971 16972 16973 16974 16975 16976 16977 16978 16979 16980 16981 16982 16983 16984 16985 16986 16987 16988 16989 16990 16991 16992 16993 16994 16995 16996 16997 16998 16999 17000 17001 17002 17003 17004 17005 17006 17007 17008 17009 17010 17011 17012 17013 17014 17015 17016 17017 17018 17019 17020 17021 17022 17023 17024 17025 17026 17027 17028 17029 17030 17031 17032 17033 17034 17035 17036 17037 17038 17039 17040 17041 17042 17043 17044 17045 17046 17047 17048 17049 17050 17051 17052 17053 17054 17055 17056 17057 17058 17059 17060 17061 17062 17063 17064 17065 17066 17067 17068 17069 17070 17071 17072 17073 17074 17075 17076 17077 17078 17079 17080 17081 17082 17083 17084 17085 17086 17087 17088 17089 17090 17091 17092 17093 17094 17095 17096 17097 17098 17099 17100 17101 17102 17103 17104 17105 17106 17107 17108 17109 17110 17111 17112 17113 17114 17115 17116 17117 17118 17119 17120 17121 17122 17123 17124 17125 17126 17127 17128 17129 17130 17131 17132 17133 17134 17135 17136 17137 17138 17139 17140 17141 17142 17143 17144 17145 17146 17147 17148 17149 17150 17151 17152 17153 17154 17155 17156 17157 17158 17159 17160 17161 17162 17163 17164 17165 17166 17167 17168 17169 17170 17171 17172 17173 17174 17175 17176 17177 17178 17179 17180 17181 17182 17183 17184 17185 17186 17187 17188 17189 17190 17191 17192 17193 17194 17195 17196 17197 17198 17199 17200 17201 17202 17203 17204 17205 17206 17207 17208 17209 17210 17211 17212 17213 17214 17215 17216 17217 17218 17219 17220 17221 17222 17223 17224 17225 17226 17227 17228 17229 17230 17231 17232 17233 17234 17235 17236 17237 17238 17239 17240 17241 17242 17243 17244 17245 17246 17247 17248 17249 17250 17251 17252 17253 17254 17255 17256 17257 17258 17259 17260 17261 17262 17263 17264 17265 17266 17267 17268 17269 17270 17271 17272 17273 17274 17275 17276 17277 17278 17279 17280 17281 17282 17283 17284 17285 17286 17287 17288 17289 17290 17291 17292 17293 17294 17295 17296 17297 17298 17299 17300 17301 17302 17303 17304 17305 17306 17307 17308 17309 17310 17311 17312 17313 17314 17315 17316 17317 17318 17319 17320 17321 17322 17323 17324 17325 17326 17327 17328 17329 17330 17331 17332 17333 17334 17335 17336 17337 17338 17339 17340 17341 17342 17343 17344 17345 17346 17347 17348 17349 17350 17351 17352 17353 17354 17355 17356 17357 17358 17359 17360 17361 17362 17363 17364 17365 17366 17367 17368 17369 17370 17371 17372 17373 17374 17375 17376 17377 17378 17379 17380 17381 17382 17383 17384 17385 17386 17387 17388 17389 17390 17391 17392 17393 17394 17395 17396 17397 17398 17399 17400 17401 17402 17403 17404 17405 17406 17407 17408 17409 17410 17411 17412 17413 17414 17415 17416 17417 17418 17419 17420 17421 17422 17423 17424 17425 17426 17427 17428 17429 17430 17431 17432 17433 17434 17435 17436 17437 17438 17439 17440 17441 17442 17443 17444 17445 17446 17447 17448 17449 17450 17451 17452 17453 17454 17455 17456 17457 17458 17459 17460 17461 17462 17463 17464 17465 17466 17467 17468 17469 17470 17471 17472 17473 17474 17475 17476 17477 17478 17479 17480 17481 17482 17483 17484 17485 17486 17487 17488 17489 17490 17491 17492 17493 17494 17495 17496 17497 17498 17499 17500 17501 17502 17503 17504 17505 17506 17507 17508 17509 17510 17511 17512 17513 17514 17515 17516 17517 17518 17519 17520 17521 17522 17523 17524 17525 17526 17527 17528 17529 17530 17531 17532 17533 17534 17535 17536 17537 17538 17539 17540 17541 17542 17543 17544 17545 17546 17547 17548 17549 17550 17551 17552 17553 17554 17555 17556 17557 17558 17559 17560 17561 17562 17563 17564 17565 17566 17567 17568 17569 17570 17571 17572 17573 17574 17575 17576 17577 17578 17579 17580 17581 17582 17583 17584 17585 17586 17587 17588 17589 17590 17591 17592 17593 17594 17595 17596 17597 17598 17599 17600 17601 17602 17603 17604 17605 17606 17607 17608 17609 17610 17611 17612 17613 17614 17615 17616 17617 17618 17619 17620 17621 17622 17623 17624 17625 17626 17627 17628 17629 17630 17631 17632 17633 17634 17635 17636 17637 17638 17639 17640 17641 17642 17643 17644 17645 17646 17647 17648 17649 17650 17651 17652 17653 17654 17655 17656 17657 17658 17659 17660 17661 17662 17663 17664 17665 17666 17667 17668 17669 17670 17671 17672 17673 17674 17675 17676 17677 17678 17679 17680 17681 17682 17683 17684 17685 17686 17687 17688 17689 17690 17691 17692 17693 17694 17695 17696 17697 17698 17699 17700 17701 17702 17703 17704 17705 17706 17707 17708 17709 17710 17711 17712 17713 17714 17715 17716 17717 17718 17719 17720 17721 17722 17723 17724 17725 17726 17727 17728 17729 17730 17731 17732 17733 17734 17735 17736 17737 17738 17739 17740 17741 17742 17743 17744 17745 17746 17747 17748 17749 17750 17751 17752 17753 17754 17755 17756 17757 17758 17759 17760 17761 17762 17763 17764 17765 17766 17767 17768 17769 17770 17771 17772 17773 17774 17775 17776 17777 17778 17779 17780 17781 17782 17783 17784 17785 17786 17787 17788 17789 17790 17791 17792 17793 17794 17795 17796 17797 17798 17799 17800 17801 17802 17803 17804 17805 17806 17807 17808 17809 17810 17811 17812 17813 17814 17815 17816 17817 17818 17819 17820 17821 17822 17823 17824 17825 17826 17827 17828 17829 17830 17831 17832 17833 17834 17835 17836 17837 17838 17839 17840 17841 17842 17843 17844 17845 17846 17847 17848 17849 17850 17851 17852 17853 17854 17855 17856 17857 17858 17859 17860 17861 17862 17863 17864 17865 17866 17867 17868 17869 17870 17871 17872 17873 17874 17875 17876 17877 17878 17879 17880 17881 17882 17883 17884 17885 17886 17887 17888 17889 17890 17891 17892 17893 17894 17895 17896 17897 17898 17899 17900 17901 17902 17903 17904 17905 17906 17907 17908 17909 17910 17911 17912 17913 17914 17915 17916 17917 17918 17919 17920 17921 17922 17923 17924 17925 17926 17927 17928 17929 17930 17931 17932 17933 17934 17935 17936 17937 17938 17939 17940 17941 17942 17943 17944 17945 17946 17947 17948 17949 17950 17951 17952 17953 17954 17955 17956 17957 17958 17959 17960 17961 17962 17963 17964 17965 17966 17967 17968 17969 17970 17971 17972 17973 17974 17975 17976 17977 17978 17979 17980 17981 17982 17983 17984 17985 17986 17987 17988 17989 17990 17991 17992 17993 17994 17995 17996 17997 17998 17999 18000 18001 18002 18003 18004 18005 18006 18007 18008 18009 18010 18011 18012 18013 18014 18015 18016 18017 18018 18019 18020 18021 18022 18023 18024 18025 18026 18027 18028 18029 18030 18031 18032 18033 18034 18035 18036 18037 18038 18039 18040 18041 18042 18043 18044 18045 18046 18047 18048 18049 18050 18051 18052 18053 18054 18055 18056 18057 18058 18059 18060 18061 18062 18063 18064 18065 18066 18067 18068 18069 18070 18071 18072 18073 18074 18075 18076 18077 18078 18079 18080 18081 18082 18083 18084 18085 18086 18087 18088 18089 18090 18091 18092 18093 18094 18095 18096 18097 18098 18099 18100 18101 18102 18103 18104 18105 18106 18107 18108 18109 18110 18111 18112 18113 18114 18115 18116 18117 18118 18119 18120 18121 18122 18123 18124 18125 18126 18127 18128 18129 18130 18131 18132 18133 18134 18135 18136 18137 18138 18139 18140 18141 18142 18143 18144 18145 18146 18147 18148 18149 18150 18151 18152 18153 18154 18155 18156 18157 18158 18159 18160 18161 18162 18163 18164 18165 18166 18167 18168 18169 18170 18171 18172 18173 18174 18175 18176 18177 18178 18179 18180 18181 18182 18183 18184 18185 18186 18187 18188 18189 18190 18191 18192 18193 18194 18195 18196 18197 18198 18199 18200 18201 18202 18203 18204 18205 18206 18207 18208 18209 18210 18211 18212 18213 18214 18215 18216 18217 18218 18219 18220 18221 18222 18223 18224 18225 18226 18227 18228 18229 18230 18231 18232 18233 18234 18235 18236 18237 18238 18239 18240 18241 18242 18243 18244 18245 18246 18247 18248 18249 18250 18251 18252 18253 18254 18255 18256 18257 18258 18259 18260 18261 18262 18263 18264 18265 18266 18267 18268 18269 18270 18271 18272 18273 18274 18275 18276 18277 18278 18279 18280 18281 18282 18283 18284 18285 18286 18287 18288 18289 18290 18291 18292 18293 18294 18295 18296 18297 18298 18299 18300 18301 18302 18303 18304 18305 18306 18307 18308 18309 18310 18311 18312 18313 18314 18315 18316 18317 18318 18319 18320 18321 18322 18323 18324 18325 18326 18327 18328 18329 18330 18331 18332 18333 18334 18335 18336 18337 18338 18339 18340 18341 18342 18343 18344 18345 18346 18347 18348 18349 18350 18351 18352 18353 18354 18355 18356 18357 18358 18359 18360 18361 18362 18363 18364 18365 18366 18367 18368 18369 18370 18371 18372 18373 18374 18375 18376 18377 18378 18379 18380 18381 18382 18383 18384 18385 18386 18387 18388 18389 18390 18391 18392 18393 18394 18395 18396 18397 18398 18399 18400 18401 18402 18403 18404 18405 18406 18407 18408 18409 18410 18411 18412 18413 18414 18415 18416 18417 18418 18419 18420 18421 18422 18423 18424 18425 18426 18427 18428 18429 18430 18431 18432 18433 18434 18435 18436 18437 18438 18439 18440 18441 18442 18443 18444 18445 18446 18447 18448 18449 18450 18451 18452 18453 18454 18455 18456 18457 18458 18459 18460 18461 18462 18463 18464 18465 18466 18467 18468 18469 18470 18471 18472 18473 18474 18475 18476 18477 18478 18479 18480 18481 18482 18483 18484 18485 18486 18487 18488 18489 18490 18491 18492 18493 18494 18495 18496 18497 18498 18499 18500 18501 18502 18503 18504 18505 18506 18507 18508 18509 18510 18511 18512 18513 18514 18515 18516 18517 18518 18519 18520 18521 18522 18523 18524 18525 18526 18527 18528 18529 18530 18531 18532 18533 18534 18535 18536 18537 18538 18539 18540 18541 18542 18543 18544 18545 18546 18547 18548 18549 18550 18551 18552 18553 18554 18555 18556 18557 18558 18559 18560 18561 18562 18563 18564 18565 18566 18567 18568 18569 18570 18571 18572 18573 18574 18575 18576 18577 18578 18579 18580 18581 18582 18583 18584 18585 18586 18587 18588 18589 18590 18591 18592 18593 18594 18595 18596 18597 18598 18599 18600 18601 18602 18603 18604 18605 18606 18607 18608 18609 18610 18611 18612 18613 18614 18615 18616 18617 18618 18619 18620 18621 18622 18623 18624 18625 18626 18627 18628 18629 18630 18631 18632 18633 18634 18635 18636 18637 18638 18639 18640 18641 18642 18643 18644 18645 18646 18647 18648 18649 18650 18651 18652 18653 18654 18655 18656 18657 18658 18659 18660 18661 18662 18663 18664 18665 18666 18667 18668 18669 18670 18671 18672 18673 18674 18675 18676 18677 18678 18679 18680 18681 18682 18683 18684 18685 18686 18687 18688 18689 18690 18691 18692 18693 18694 18695 18696 18697 18698 18699 18700 18701 18702 18703 18704 18705 18706 18707 18708 18709 18710 18711 18712 18713 18714 18715 18716 18717 18718 18719 18720 18721 18722 18723 18724 18725 18726 18727 18728 18729 18730 18731 18732 18733 18734 18735 18736 18737 18738 18739 18740 18741 18742 18743 18744 18745 18746 18747 18748 18749 18750 18751 18752 18753 18754 18755 18756 18757 18758 18759 18760 18761 18762 18763 18764 18765 18766 18767 18768 18769 18770 18771 18772 18773 18774 18775 18776 18777 18778 18779 18780 18781 18782 18783 18784 18785 18786 18787 18788 18789 18790 18791 18792 18793 18794 18795 18796 18797 18798 18799 18800 18801 18802 18803 18804 18805 18806 18807 18808 18809 18810 18811 18812 18813 18814 18815 18816 18817 18818 18819 18820 18821 18822 18823 18824 18825 18826 18827 18828 18829 18830 18831 18832 18833 18834 18835 18836 18837 18838 18839 18840 18841 18842 18843 18844 18845 18846 18847 18848 18849 18850 18851 18852 18853 18854 18855 18856 18857 18858 18859 18860 18861 18862 18863 18864 18865 18866 18867 18868 18869 18870 18871 18872 18873 18874 18875 18876 18877 18878 18879 18880 18881 18882 18883 18884 18885 18886 18887 18888 18889 18890 18891 18892 18893 18894 18895 18896 18897 18898 18899 18900 18901 18902 18903 18904 18905 18906 18907 18908 18909 18910 18911 18912 18913 18914 18915 18916 18917 18918 18919 18920 18921 18922 18923 18924 18925 18926 18927 18928 18929 18930 18931 18932 18933 18934 18935 18936 18937 18938 18939 18940 18941 18942 18943 18944 18945 18946 18947 18948 18949 18950 18951 18952 18953 18954 18955 18956 18957 18958 18959 18960 18961 18962 18963 18964 18965 18966 18967 18968 18969 18970 18971 18972 18973 18974 18975 18976 18977 18978 18979 18980 18981 18982 18983 18984 18985 18986 18987 18988 18989 18990 18991 18992 18993 18994 18995 18996 18997 18998 18999 19000 19001 19002 19003 19004 19005 19006 19007 19008 19009 19010 19011 19012 19013 19014 19015 19016 19017 19018 19019 19020 19021 19022 19023 19024 19025 19026 19027 19028 19029 19030 19031 19032 19033 19034 19035 19036 19037 19038 19039 19040 19041 19042 19043 19044 19045 19046 19047 19048 19049 19050 19051 19052 19053 19054 19055 19056 19057 19058 19059 19060 19061 19062 19063 19064 19065 19066 19067 19068 19069 19070 19071 19072 19073 19074 19075 19076 19077 19078 19079 19080 19081 19082 19083 19084 19085 19086 19087 19088 19089 19090 19091 19092 19093 19094 19095 19096 19097 19098 19099 19100 19101 19102 19103 19104 19105 19106 19107 19108 19109 19110 19111 19112 19113 19114 19115 19116 19117 19118 19119 19120 19121 19122 19123 19124 19125 19126 19127 19128 19129 19130 19131 19132 19133 19134 19135 19136 19137 19138 19139 19140 19141 19142 19143 19144 19145 19146 19147 19148 19149 19150 19151 19152 19153 19154 19155 19156 19157 19158 19159 19160 19161 19162 19163 19164 19165 19166 19167 19168 19169 19170 19171 19172 19173 19174 19175 19176 19177 19178 19179 19180 19181 19182 19183 19184 19185 19186 19187 19188 19189 19190 19191 19192 19193 19194 19195 19196 19197 19198 19199 19200 19201 19202 19203 19204 19205 19206 19207 19208 19209 19210 19211 19212 19213 19214 19215 19216 19217 19218 19219 19220 19221 19222 19223 19224 19225 19226 19227 19228 19229 19230 19231 19232 19233 19234 19235 19236 19237 19238 19239 19240 19241 19242 19243 19244 19245 19246 19247 19248 19249 19250 19251 19252 19253 19254 19255 19256 19257 19258 19259 19260 19261 19262 19263 19264 19265 19266 19267 19268 19269 19270 19271 19272 19273 19274 19275 19276 19277 19278 19279 19280 19281 19282 19283 19284 19285 19286 19287 19288 19289 19290 19291 19292 19293 19294 19295 19296 19297 19298 19299 19300 19301 19302 19303 19304 19305 19306 19307 19308 19309 19310 19311 19312 19313 19314 19315 19316 19317 19318 19319 19320 19321 19322 19323 19324 19325 19326 19327 19328 19329 19330 19331 19332 19333 19334 19335 19336 19337 19338 19339 19340 19341 19342 19343 19344 19345 19346 19347 19348 19349 19350 19351 19352 19353 19354 19355 19356 19357 19358 19359 19360 19361 19362 19363 19364 19365 19366 19367 19368 19369 19370 19371 19372 19373 19374 19375 19376 19377 19378 19379 19380 19381 19382 19383 19384 19385 19386 19387 19388 19389 19390 19391 19392 19393 19394 19395 19396 19397 19398 19399 19400 19401 19402 19403 19404 19405 19406 19407 19408 19409 19410 19411 19412 19413 19414 19415 19416 19417 19418 19419 19420 19421 19422 19423 19424 19425 19426 19427 19428 19429 19430 19431 19432 19433 19434 19435 19436 19437 19438 19439 19440 19441 19442 19443 19444 19445 19446 19447 19448 19449 19450 19451 19452 19453 19454 19455 19456 19457 19458 19459 19460 19461 19462 19463 19464 19465 19466 19467 19468 19469 19470 19471 19472 19473 19474 19475 19476 19477 19478 19479 19480 19481 19482 19483 19484 19485 19486 19487 19488 19489 19490 19491 19492 19493 19494 19495 19496 19497 19498 19499 19500 19501 19502 19503 19504 19505 19506 19507 19508 19509 19510 19511 19512 19513 19514 19515 19516 19517 19518 19519 19520 19521 19522 19523 19524 19525 19526 19527 19528 19529 19530 19531 19532 19533 19534 19535 19536 19537 19538 19539 19540 19541 19542 19543 19544 19545 19546 19547 19548 19549 19550 19551 19552 19553 19554 19555 19556 19557 19558 19559 19560 19561 19562 19563 19564 19565 19566 19567 19568 19569 19570 19571 19572 19573 19574 19575 19576 19577 19578 19579 19580 19581 19582 19583 19584 19585 19586 19587 19588 19589 19590 19591 19592 19593 19594 19595 19596 19597 19598 19599 19600 19601 19602 19603 19604 19605 19606 19607 19608 19609 19610 19611 19612 19613 19614 19615 19616 19617 19618 19619 19620 19621 19622 19623 19624 19625 19626 19627 19628 19629 19630 19631 19632 19633 19634 19635 19636 19637 19638 19639 19640 19641 19642 19643 19644 19645 19646 19647 19648 19649 19650 19651 19652 19653 19654 19655 19656 19657 19658 19659 19660 19661 19662 19663 19664 19665 19666 19667 19668 19669 19670 19671 19672 19673 19674 19675 19676 19677 19678 19679 19680 19681 19682 19683 19684 19685 19686 19687 19688 19689 19690 19691 19692 19693 19694 19695 19696 19697 19698 19699 19700 19701 19702 19703 19704 19705 19706 19707 19708 19709 19710 19711 19712 19713 19714 19715 19716 19717 19718 19719 19720 19721 19722 19723 19724 19725 19726 19727 19728 19729 19730 19731 19732 19733 19734 19735 19736 19737 19738 19739 19740 19741 19742 19743 19744 19745 19746 19747 19748 19749 19750 19751 19752 19753 19754 19755 19756 19757 19758 19759 19760 19761 19762 19763 19764 19765 19766 19767 19768 19769 19770 19771 19772 19773 19774 19775 19776 19777 19778 19779 19780 19781 19782 19783 19784 19785 19786 19787 19788 19789 19790 19791 19792 19793 19794 19795 19796 19797 19798 19799 19800 19801 19802 19803 19804 19805 19806 19807 19808 19809 19810 19811 19812 19813 19814 19815 19816 19817 19818 19819 19820 19821 19822 19823 19824 19825 19826 19827 19828 19829 19830 19831 19832 19833 19834 19835 19836 19837 19838 19839 19840 19841 19842 19843 19844 19845 19846 19847 19848 19849 19850 19851 19852 19853 19854 19855 19856 19857 19858 19859 19860 19861 19862 19863 19864 19865 19866 19867 19868 19869 19870 19871 19872 19873 19874 19875 19876 19877 19878 19879 19880 19881 19882 19883 19884 19885 19886 19887 19888 19889 19890 19891 19892 19893 19894 19895 19896 19897 19898 19899 19900 19901 19902 19903 19904 19905 19906 19907 19908 19909 19910 19911 19912 19913 19914 19915 19916 19917 19918 19919 19920 19921 19922 19923 19924 19925 19926 19927 19928 19929 19930 19931 19932 19933 19934 19935 19936 19937 19938 19939 19940 19941 19942 19943 19944 19945 19946 19947 19948 19949 19950 19951 19952 19953 19954 19955 19956 19957 19958 19959 19960 19961 19962 19963 19964 19965 19966 19967 19968 19969 19970 19971 19972 19973 19974 19975 19976 19977 19978 19979 19980 19981 19982 19983 19984 19985 19986 19987 19988 19989 19990 19991 19992 19993 19994 19995 19996 19997 19998 19999 20000 20001 20002 20003 20004 20005 20006 20007 20008 20009 20010 20011 20012 20013 20014 20015 20016 20017 20018 20019 20020 20021 20022 20023 20024 20025 20026 20027 20028 20029 20030 20031 20032 20033 20034 20035 20036 20037 20038 20039 20040 20041 20042 20043 20044 20045 20046 20047 20048 20049 20050 20051 20052 20053 20054 20055 20056 20057 20058 20059 20060 20061 20062 20063 20064 20065 20066 20067 20068 20069 20070 20071 20072 20073 20074 20075 20076 20077 20078 20079 20080 20081 20082 20083 20084 20085 20086 20087 20088 20089 20090 20091 20092 20093 20094 20095 20096 20097 20098 20099 20100 20101 20102 20103 20104 20105 20106 20107 20108 20109 20110 20111 20112 20113 20114 20115 20116 20117 20118 20119 20120 20121 20122 20123 20124 20125 20126 20127 20128 20129 20130 20131 20132 20133 20134 20135 20136 20137 20138 20139 20140 20141 20142 20143 20144 20145 20146 20147 20148 20149 20150 20151 20152 20153 20154 20155 20156 20157 20158 20159 20160 20161 20162 20163 20164 20165 20166 20167 20168 20169 20170 20171 20172 20173 20174 20175 20176 20177 20178 20179 20180 20181 20182 20183 20184 20185 20186 20187 20188 20189 20190 20191 20192 20193 20194 20195 20196 20197 20198 20199 20200 20201 20202 20203 20204 20205 20206 20207 20208 20209 20210 20211 20212 20213 20214 20215 20216 20217 20218 20219 20220 20221 20222 20223 20224 20225 20226 20227 20228 20229 20230 20231 20232 20233 20234 20235 20236 20237 20238 20239 20240 20241 20242 20243 20244 20245 20246 20247 20248 20249 20250 20251 20252 20253 20254 20255 20256 20257 20258 20259 20260 20261 20262 20263 20264 20265 20266 20267 20268 20269 20270 20271 20272 20273 20274 20275 20276 20277 20278 20279 20280 20281 20282 20283 20284 20285 20286 20287 20288 20289 20290 20291 20292 20293 20294 20295 20296 20297 20298 20299 20300 20301 20302 20303 20304 20305 20306 20307 20308 20309 20310 20311 20312 20313 20314 20315 20316 20317 20318 20319 20320 20321 20322 20323 20324 20325 20326 20327 20328 20329 20330 20331 20332 20333 20334 20335 20336 20337 20338 20339 20340 20341 20342 20343 20344 20345 20346 20347 20348 20349 20350 20351 20352 20353 20354 20355 20356 20357 20358 20359 20360 20361 20362 20363 20364 20365 20366 20367 20368 20369 20370 20371 20372 20373 20374 20375 20376 20377 20378 20379 20380 20381 20382 20383 20384 20385 20386 20387 20388 20389 20390 20391 20392 20393 20394 20395 20396 20397 20398 20399 20400 20401 20402 20403 20404 20405 20406 20407 20408 20409 20410 20411 20412 20413 20414 20415 20416 20417 20418 20419 20420 20421 20422 20423 20424 20425 20426 20427 20428 20429 20430 20431 20432 20433 20434 20435 20436 20437 20438 20439 20440 20441 20442 20443 20444 20445 20446 20447 20448 20449 20450 20451 20452 20453 20454 20455 20456 20457 20458 20459 20460 20461 20462 20463 20464 20465 20466 20467 20468 20469 20470 20471 20472 20473 20474 20475 20476 20477 20478 20479 20480 20481 20482 20483 20484 20485 20486 20487 20488 20489 20490 20491 20492 20493 20494 20495 20496 20497 20498 20499 20500 20501 20502 20503 20504 20505 20506 20507 20508 20509 20510 20511 20512 20513 20514 20515 20516 20517 20518 20519 20520 20521 20522 20523 20524 20525 20526 20527 20528 20529 20530 20531 20532 20533 20534 20535 20536 20537 20538 20539 20540 20541 20542 20543 20544 20545 20546 20547 20548 20549 20550 20551 20552 20553 20554 20555 20556 20557 20558 20559 20560 20561 20562 20563 20564 20565 20566 20567 20568 20569 20570 20571 20572 20573 20574 20575 20576 20577 20578 20579 20580 20581 20582 20583 20584 20585 20586 20587 20588 20589 20590 20591 20592 20593 20594 20595 20596 20597 20598 20599 20600 20601 20602 20603 20604 20605 20606 20607 20608 20609 20610 20611 20612 20613 20614 20615 20616 20617 20618 20619 20620 20621 20622 20623 20624 20625 20626 20627 20628 20629 20630 20631 20632 20633 20634 20635 20636 20637 20638 20639 20640 20641 20642 20643 20644 20645 20646 20647 20648 20649 20650 20651 20652 20653 20654 20655 20656 20657 20658 20659 20660 20661 20662 20663 20664 20665 20666 20667 20668 20669 20670 20671 20672 20673 20674 20675 20676 20677 20678 20679 20680 20681 20682 20683 20684 20685 20686 20687 20688 20689 20690 20691 20692 20693 20694 20695 20696 20697 20698 20699 20700 20701 20702 20703 20704 20705 20706 20707 20708 20709 20710 20711 20712 20713 20714 20715 20716 20717 20718 20719 20720 20721 20722 20723 20724 20725 20726 20727 20728 20729 20730 20731 20732 20733 20734 20735 20736 20737 20738 20739 20740 20741 20742 20743 20744 20745 20746 20747 20748 20749 20750 20751 20752 20753 20754 20755 20756 20757 20758 20759 20760 20761 20762 20763 20764 20765 20766 20767 20768 20769 20770 20771 20772 20773 20774 20775 20776 20777 20778 20779 20780 20781 20782 20783 20784 20785 20786 20787 20788 20789 20790 20791 20792 20793 20794 20795 20796 20797 20798 20799 20800 20801 20802 20803 20804 20805 20806 20807 20808 20809 20810 20811 20812 20813 20814 20815 20816 20817 20818 20819 20820 20821 20822 20823 20824 20825 20826 20827 20828 20829 20830 20831 20832 20833 20834 20835 20836 20837 20838 20839 20840 20841 20842 20843 20844 20845 20846 20847 20848 20849 20850 20851 20852 20853 20854 20855 20856 20857 20858 20859 20860 20861 20862 20863 20864 20865 20866 20867 20868 20869 20870 20871 20872 20873 20874 20875 20876 20877 20878 20879 20880 20881 20882 20883 20884 20885 20886 20887 20888 20889 20890 20891 20892 20893 20894 20895 20896 20897 20898 20899 20900 20901 20902 20903 20904 20905 20906 20907 20908 20909 20910 20911 20912 20913 20914 20915 20916 20917 20918 20919 20920 20921 20922 20923 20924 20925 20926 20927 20928 20929 20930 20931 20932 20933 20934 20935 20936 20937 20938 20939 20940 20941 20942 20943 20944 20945 20946 20947 20948 20949 20950 20951 20952 20953 20954 20955 20956 20957 20958 20959 20960 20961 20962 20963 20964 20965 20966 20967 20968 20969 20970 20971 20972 20973 20974 20975 20976 20977 20978 20979 20980 20981 20982 20983 20984 20985 20986 20987 20988 20989 20990 20991 20992 20993 20994 20995 20996 20997 20998 20999 21000 21001 21002 21003 21004 21005 21006 21007 21008 21009 21010 21011 21012 21013 21014 21015 21016 21017 21018 21019 21020 21021 21022 21023 21024 21025 21026 21027 21028 21029 21030 21031 21032 21033 21034 21035 21036 21037 21038 21039 21040 21041 21042 21043 21044 21045 21046 21047 21048 21049 21050 21051 21052 21053 21054 21055 21056 21057 21058 21059 21060 21061 21062 21063 21064 21065 21066 21067 21068 21069 21070 21071 21072 21073 21074 21075 21076 21077 21078 21079 21080 21081 21082 21083 21084 21085 21086 21087 21088 21089 21090 21091 21092 21093 21094 21095 21096 21097 21098 21099 21100 21101 21102 21103 21104 21105 21106 21107 21108 21109 21110 21111 21112 21113 21114 21115 21116 21117 21118 21119 21120 21121 21122 21123 21124 21125 21126 21127 21128 21129 21130 21131 21132 21133 21134 21135 21136 21137 21138 21139 21140 21141 21142 21143 21144 21145 21146 21147 21148 21149 21150 21151 21152 21153 21154 21155 21156 21157 21158 21159 21160 21161 21162 21163 21164 21165 21166 21167 21168 21169 21170 21171 21172 21173 21174 21175 21176 21177 21178 21179 21180 21181 21182 21183 21184 21185 21186 21187 21188 21189 21190 21191 21192 21193 21194 21195 21196 21197 21198 21199 21200 21201 21202 21203 21204 21205 21206 21207 21208 21209 21210 21211 21212 21213 21214 21215 21216 21217 21218 21219 21220 21221 21222 21223 21224 21225 21226 21227 21228 21229 21230 21231 21232 21233 21234 21235 21236 21237 21238 21239 21240 21241 21242 21243 21244 21245 21246 21247 21248 21249 21250 21251 21252 21253 21254 21255 21256 21257 21258 21259 21260 21261 21262 21263 21264 21265 21266 21267 21268 21269 21270 21271 21272 21273 21274 21275 21276 21277 21278 21279 21280 21281 21282 21283 21284 21285 21286 21287 21288 21289 21290 21291 21292 21293 21294 21295 21296 21297 21298 21299 21300 21301 21302 21303 21304 21305 21306 21307 21308 21309 21310 21311 21312 21313 21314 21315 21316 21317 21318 21319 21320 21321 21322 21323 21324 21325 21326 21327 21328 21329 21330 21331 21332 21333 21334 21335 21336 21337 21338 21339 21340 21341 21342 21343 21344 21345 21346 21347 21348 21349 21350 21351 21352 21353 21354 21355 21356 21357 21358 21359 21360 21361 21362 21363 21364 21365 21366 21367 21368 21369 21370 21371 21372 21373 21374 21375 21376 21377 21378 21379 21380 21381 21382 21383 21384 21385 21386 21387 21388 21389 21390 21391 21392 21393 21394 21395 21396 21397 21398 21399 21400 21401 21402 21403 21404 21405 21406 21407 21408 21409 21410 21411 21412 21413 21414 21415 21416 21417 21418 21419 21420 21421 21422 21423 21424 21425 21426 21427 21428 21429 21430 21431 21432 21433 21434 21435 21436 21437 21438 21439 21440 21441 21442 21443 21444 21445 21446 21447 21448 21449 21450 21451 21452 21453 21454 21455 21456 21457 21458 21459 21460 21461 21462 21463 21464 21465 21466 21467 21468 21469 21470 21471 21472 21473 21474 21475 21476 21477 21478 21479 21480 21481 21482 21483 21484 21485 21486 21487 21488 21489 21490 21491 21492 21493 21494 21495 21496 21497 21498 21499 21500 21501 21502 21503 21504 21505 21506 21507 21508 21509 21510 21511 21512 21513 21514 21515 21516 21517 21518 21519 21520 21521 21522 21523 21524 21525 21526 21527 21528 21529 21530 21531 21532 21533 21534 21535 21536 21537 21538 21539 21540 21541 21542 21543 21544 21545 21546 21547 21548 21549 21550 21551 21552 21553 21554 21555 21556 21557 21558 21559 21560 21561 21562 21563 21564 21565 21566 21567 21568 21569 21570 21571 21572 21573 21574 21575 21576 21577 21578 21579 21580 21581 21582 21583 21584 21585 21586 21587 21588 21589 21590 21591 21592 21593 21594 21595 21596 21597 21598 21599 21600 21601 21602 21603 21604 21605 21606 21607 21608 21609 21610 21611 21612 21613 21614 21615 21616 21617 21618 21619 21620 21621 21622 21623 21624 21625 21626 21627 21628 21629 21630 21631 21632 21633 21634 21635 21636 21637 21638 21639 21640 21641 21642 21643 21644 21645 21646 21647 21648 21649 21650 21651 21652 21653 21654 21655 21656 21657 21658 21659 21660 21661 21662 21663 21664 21665 21666 21667 21668 21669 21670 21671 21672 21673 21674 21675 21676 21677 21678 21679 21680 21681 21682 21683 21684 21685 21686 21687 21688 21689 21690 21691 21692 21693 21694 21695 21696 21697 21698 21699 21700 21701 21702 21703 21704 21705 21706 21707 21708 21709 21710 21711 21712 21713 21714 21715 21716 21717 21718 21719 21720 21721 21722 21723 21724 21725 21726 21727 21728 21729 21730 21731 21732 21733 21734 21735 21736 21737 21738 21739 21740 21741 21742 21743 21744 21745 21746 21747 21748 21749 21750 21751 21752 21753 21754 21755 21756 21757 21758 21759 21760 21761 21762 21763 21764 21765 21766 21767 21768 21769 21770 21771 21772 21773 21774 21775 21776 21777 21778 21779 21780 21781 21782 21783 21784 21785 21786 21787 21788 21789 21790 21791 21792 21793 21794 21795 21796 21797 21798 21799 21800 21801 21802 21803 21804 21805 21806 21807 21808 21809 21810 21811 21812 21813 21814 21815 21816 21817 21818 21819 21820 21821 21822 21823 21824 21825 21826 21827 21828 21829 21830 21831 21832 21833 21834 21835 21836 21837 21838 21839 21840 21841 21842 21843 21844 21845 21846 21847 21848 21849 21850 21851 21852 21853 21854 21855 21856 21857 21858 21859 21860 21861 21862 21863 21864 21865 21866 21867 21868 21869 21870 21871 21872 21873 21874 21875 21876 21877 21878 21879 21880 21881 21882 21883 21884 21885 21886 21887 21888 21889 21890 21891 21892 21893 21894 21895 21896 21897 21898 21899 21900 21901 21902 21903 21904 21905 21906 21907 21908 21909 21910 21911 21912 21913 21914 21915 21916 21917 21918 21919 21920 21921 21922 21923 21924 21925 21926 21927 21928 21929 21930 21931 21932 21933 21934 21935 21936 21937 21938 21939 21940 21941 21942 21943 21944 21945 21946 21947 21948 21949 21950 21951 21952 21953 21954 21955 21956 21957 21958 21959 21960 21961 21962 21963 21964 21965 21966 21967 21968 21969 21970 21971 21972 21973 21974 21975 21976 21977 21978 21979 21980 21981 21982 21983 21984 21985 21986 21987 21988 21989 21990 21991 21992 21993 21994 21995 21996 21997 21998 21999 22000 22001 22002 22003 22004 22005 22006 22007 22008 22009 22010 22011 22012 22013 22014 22015 22016 22017 22018 22019 22020 22021 22022 22023 22024 22025 22026 22027 22028 22029 22030 22031 22032 22033 22034 22035 22036 22037 22038 22039 22040 22041 22042 22043 22044 22045 22046 22047 22048 22049 22050 22051 22052 22053 22054 22055 22056 22057 22058 22059 22060 22061 22062 22063 22064 22065 22066 22067 22068 22069 22070 22071 22072 22073 22074 22075 22076 22077 22078 22079 22080 22081 22082 22083 22084 22085 22086 22087 22088 22089 22090 22091 22092 22093 22094 22095 22096 22097 22098 22099 22100 22101 22102 22103 22104 22105 22106 22107 22108 22109 22110 22111 22112 22113 22114 22115 22116 22117 22118 22119 22120 22121 22122 22123 22124 22125 22126 22127 22128 22129 22130 22131 22132 22133 22134 22135 22136 22137 22138 22139 22140 22141 22142 22143 22144 22145 22146 22147 22148 22149 22150 22151 22152 22153 22154 22155 22156 22157 22158 22159 22160 22161 22162 22163 22164 22165 22166 22167 22168 22169 22170 22171 22172 22173 22174 22175 22176 22177 22178 22179 22180 22181 22182 22183 22184 22185 22186 22187 22188 22189 22190 22191 22192 22193 22194 22195 22196 22197 22198 22199 22200 22201 22202 22203 22204 22205 22206 22207 22208 22209 22210 22211 22212 22213 22214 22215 22216 22217 22218 22219 22220 22221 22222 22223 22224 22225 22226 22227 22228 22229 22230 22231 22232 22233 22234 22235 22236 22237 22238 22239 22240 22241 22242 22243 22244 22245 22246 22247 22248 22249 22250 22251 22252 22253 22254 22255 22256 22257 22258 22259 22260 22261 22262 22263 22264 22265 22266 22267 22268 22269 22270 22271 22272 22273 22274 22275 22276 22277 22278 22279 22280 22281 22282 22283 22284 22285 22286 22287 22288 22289 22290 22291 22292 22293 22294 22295 22296 22297 22298 22299 22300 22301 22302 22303 22304 22305 22306 22307 22308 22309 22310 22311 22312 22313 22314 22315 22316 22317 22318 22319 22320 22321 22322 22323 22324 22325 22326 22327 22328 22329 22330 22331 22332 22333 22334 22335 22336 22337 22338 22339 22340 22341 22342 22343 22344 22345 22346 22347 22348 22349 22350 22351 22352 22353 22354 22355 22356 22357 22358 22359 22360 22361 22362 22363 22364 22365 22366 22367 22368 22369 22370 22371 22372 22373 22374 22375 22376 22377 22378 22379 22380 22381 22382 22383 22384 22385 22386 22387 22388 22389 22390 22391 22392 22393 22394 22395 22396 22397 22398 22399 22400 22401 22402 22403 22404 22405 22406 22407 22408 22409 22410 22411 22412 22413 22414 22415 22416 22417 22418 22419 22420 22421 22422 22423 22424 22425 22426 22427 22428 22429 22430 22431 22432 22433 22434 22435 22436 22437 22438 22439 22440 22441 22442 22443 22444 22445 22446 22447 22448 22449 22450 22451 22452 22453 22454 22455 22456 22457 22458 22459 22460 22461 22462 22463 22464 22465 22466 22467 22468 22469 22470 22471 22472 22473 22474 22475 22476 22477 22478 22479 22480 22481 22482 22483 22484 22485 22486 22487 22488 22489 22490 22491 22492 22493 22494 22495 22496 22497 22498 22499 22500 22501 22502 22503 22504 22505 22506 22507 22508 22509 22510 22511 22512 22513 22514 22515 22516 22517 22518 22519 22520 22521 22522 22523 22524 22525 22526 22527 22528 22529 22530 22531 22532 22533 22534 22535 22536 22537 22538 22539 22540 22541 22542 22543 22544 22545 22546 22547 22548 22549 22550 22551 22552 22553 22554 22555 22556 22557 22558 22559 22560 22561 22562 22563 22564 22565 22566 22567 22568 22569 22570 22571 22572 22573 22574 22575 22576 22577 22578 22579 22580 22581 22582 22583 22584 22585 22586 22587 22588 22589 22590 22591 22592 22593 22594 22595 22596 22597 22598 22599 22600 22601 22602 22603 22604 22605 22606 22607 22608 22609 22610 22611 22612 22613 22614 22615 22616 22617 22618 22619 22620 22621 22622 22623 22624 22625 22626 22627 22628 22629 22630 22631 22632 22633 22634 22635 22636 22637 22638 22639 22640 22641 22642 22643 22644 22645 22646 22647 22648 22649 22650 22651 22652 22653 22654 22655 22656 22657 22658 22659 22660 22661 22662 22663 22664 22665 22666 22667 22668 22669 22670 22671 22672 22673 22674 22675 22676 22677 22678 22679 22680 22681 22682 22683 22684 22685 22686 22687 22688 22689 22690 22691 22692 22693 22694 22695 22696 22697 22698 22699 22700 22701 22702 22703 22704 22705 22706 22707 22708 22709 22710 22711 22712 22713 22714 22715 22716 22717 22718 22719 22720 22721 22722 22723 22724 22725 22726 22727 22728 22729 22730 22731 22732 22733 22734 22735 22736 22737 22738 22739 22740 22741 22742 22743 22744 22745 22746 22747 22748 22749 22750 22751 22752 22753 22754 22755 22756 22757 22758 22759 22760 22761 22762 22763 22764 22765 22766 22767 22768 22769 22770 22771 22772 22773 22774 22775 22776 22777 22778 22779 22780 22781 22782 22783 22784 22785 22786 22787 22788 22789 22790 22791 22792 22793 22794 22795 22796 22797 22798 22799 22800 22801 22802 22803 22804 22805 22806 22807 22808 22809 22810 22811 22812 22813 22814 22815 22816 22817 22818 22819 22820 22821 22822 22823 22824 22825 22826 22827 22828 22829 22830 22831 22832 22833 22834 22835 22836 22837 22838 22839 22840 22841 22842 22843 22844 22845 22846 22847 22848 22849 22850 22851 22852 22853 22854 22855 22856 22857 22858 22859 22860 22861 22862 22863 22864 22865 22866 22867 22868 22869 22870 22871 22872 22873 22874 22875 22876 22877 22878 22879 22880 22881 22882 22883 22884 22885 22886 22887 22888 22889 22890 22891 22892 22893 22894 22895 22896 22897 22898 22899 22900 22901 22902 22903 22904 22905 22906 22907 22908 22909 22910 22911 22912 22913 22914 22915 22916 22917 22918 22919 22920 22921 22922 22923 22924 22925 22926 22927 22928 22929 22930 22931 22932 22933 22934 22935 22936 22937 22938 22939 22940 22941 22942 22943 22944 22945 22946 22947 22948 22949 22950 22951 22952 22953 22954 22955 22956 22957 22958 22959 22960 22961 22962 22963 22964 22965 22966 22967 22968 22969 22970 22971 22972 22973 22974 22975 22976 22977 22978 22979 22980 22981 22982 22983 22984 22985 22986 22987 22988 22989 22990 22991 22992 22993 22994 22995 22996 22997 22998 22999 23000 23001 23002 23003 23004 23005 23006 23007 23008 23009 23010 23011 23012 23013 23014 23015 23016 23017 23018 23019 23020 23021 23022 23023 23024 23025 23026 23027 23028 23029 23030 23031 23032 23033 23034 23035 23036 23037 23038 23039 23040 23041 23042 23043 23044 23045 23046 23047 23048 23049 23050 23051 23052 23053 23054 23055 23056 23057 23058 23059 23060 23061 23062 23063 23064 23065 23066 23067 23068 23069 23070 23071 23072 23073 23074 23075 23076 23077 23078 23079 23080 23081 23082 23083 23084 23085 23086 23087 23088 23089 23090 23091 23092 23093 23094 23095 23096 23097 23098 23099 23100 23101 23102 23103 23104 23105 23106 23107 23108 23109 23110 23111 23112 23113 23114 23115 23116 23117 23118 23119 23120 23121 23122 23123 23124 23125 23126 23127 23128 23129 23130 23131 23132 23133 23134 23135 23136 23137 23138 23139 23140 23141 23142 23143 23144 23145 23146 23147 23148 23149 23150 23151 23152 23153 23154 23155 23156 23157 23158 23159 23160 23161 23162 23163 23164 23165 23166 23167 23168 23169 23170 23171 23172 23173 23174 23175 23176 23177 23178 23179 23180 23181 23182 23183 23184 23185 23186 23187 23188 23189 23190 23191 23192 23193 23194 23195 23196 23197 23198 23199 23200 23201 23202 23203 23204 23205 23206 23207 23208 23209 23210 23211 23212 23213 23214 23215 23216 23217 23218 23219 23220 23221 23222 23223 23224 23225 23226 23227 23228 23229 23230 23231 23232 23233 23234 23235 23236 23237 23238 23239 23240 23241 23242 23243 23244 23245 23246 23247 23248 23249 23250 23251 23252 23253 23254 23255 23256 23257 23258 23259 23260 23261 23262 23263 23264 23265 23266 23267 23268 23269 23270 23271 23272 23273 23274 23275 23276 23277 23278 23279 23280 23281 23282 23283 23284 23285 23286 23287 23288 23289 23290 23291 23292 23293 23294 23295 23296 23297 23298 23299 23300 23301 23302 23303 23304 23305 23306 23307 23308 23309 23310 23311 23312 23313 23314 23315 23316 23317 23318 23319 23320 23321 23322 23323 23324 23325 23326 23327 23328 23329 23330 23331 23332 23333 23334 23335 23336 23337 23338 23339 23340 23341 23342 23343 23344 23345 23346 23347 23348 23349 23350 23351 23352 23353 23354 23355 23356 23357 23358 23359 23360 23361 23362 23363 23364 23365 23366 23367 23368 23369 23370 23371 23372 23373 23374 23375 23376 23377 23378 23379 23380 23381 23382 23383 23384 23385 23386 23387 23388 23389 23390 23391 23392 23393 23394 23395 23396 23397 23398 23399 23400 23401 23402 23403 23404 23405 23406 23407 23408 23409 23410 23411 23412 23413 23414 23415 23416 23417 23418 23419 23420 23421 23422 23423 23424 23425 23426 23427 23428 23429 23430 23431 23432 23433 23434 23435 23436 23437 23438 23439 23440 23441 23442 23443 23444 23445 23446 23447 23448 23449 23450 23451 23452 23453 23454 23455 23456 23457 23458 23459 23460 23461 23462 23463 23464 23465 23466 23467 23468 23469 23470 23471 23472 23473 23474 23475 23476 23477 23478 23479 23480 23481 23482 23483 23484 23485 23486 23487 23488 23489 23490 23491 23492 23493 23494 23495 23496 23497 23498 23499 23500 23501 23502 23503 23504 23505 23506 23507 23508 23509 23510 23511 23512 23513 23514 23515 23516 23517 23518 23519 23520 23521 23522 23523 23524 23525 23526 23527 23528 23529 23530 23531 23532 23533 23534 23535 23536 23537 23538 23539 23540 23541 23542 23543 23544 23545 23546 23547 23548 23549 23550 23551 23552 23553 23554 23555 23556 23557 23558 23559 23560 23561 23562 23563 23564 23565 23566 23567 23568 23569 23570 23571 23572 23573 23574 23575 23576 23577 23578 23579 23580 23581 23582 23583 23584 23585 23586 23587 23588 23589 23590 23591 23592 23593 23594 23595 23596 23597 23598 23599 23600 23601 23602 23603 23604 23605 23606 23607 23608 23609 23610 23611 23612 23613 23614 23615 23616 23617 23618 23619 23620 23621 23622 23623 23624 23625 23626 23627 23628 23629 23630 23631 23632 23633 23634 23635 23636 23637 23638 23639 23640 23641 23642 23643 23644 23645 23646 23647 23648 23649 23650 23651 23652 23653 23654 23655 23656 23657 23658 23659 23660 23661 23662 23663 23664 23665 23666 23667 23668 23669 23670 23671 23672 23673 23674 23675 23676 23677 23678 23679 23680 23681 23682 23683 23684 23685 23686 23687 23688 23689 23690 23691 23692 23693 23694 23695 23696 23697 23698 23699 23700 23701 23702 23703 23704 23705 23706 23707 23708 23709 23710 23711 23712 23713 23714 23715 23716 23717 23718 23719 23720 23721 23722 23723 23724 23725 23726 23727 23728 23729 23730 23731 23732 23733 23734 23735 23736 23737 23738 23739 23740 23741 23742 23743 23744 23745 23746 23747 23748 23749 23750 23751 23752 23753 23754 23755 23756 23757 23758 23759 23760 23761 23762 23763 23764 23765 23766 23767 23768 23769 23770 23771 23772 23773 23774 23775 23776 23777 23778 23779 23780 23781 23782 23783 23784 23785 23786 23787 23788 23789 23790 23791 23792 23793 23794 23795 23796 23797 23798 23799 23800 23801 23802 23803 23804 23805 23806 23807 23808 23809 23810 23811 23812 23813 23814 23815 23816 23817 23818 23819 23820 23821 23822 23823 23824 23825 23826 23827 23828 23829 23830 23831 23832 23833 23834 23835 23836 23837 23838 23839 23840 23841 23842 23843 23844 23845 23846 23847 23848 23849 23850 23851 23852 23853 23854 23855 23856 23857 23858 23859 23860 23861 23862 23863 23864 23865 23866 23867 23868 23869 23870 23871 23872 23873 23874 23875 23876 23877 23878 23879 23880 23881 23882 23883 23884 23885 23886 23887 23888 23889 23890 23891 23892 23893 23894 23895 23896 23897 23898 23899 23900 23901 23902 23903 23904 23905 23906 23907 23908 23909 23910 23911 23912 23913 23914 23915 23916 23917 23918 23919 23920 23921 23922 23923 23924 23925 23926 23927 23928 23929 23930 23931 23932 23933 23934 23935 23936 23937 23938 23939 23940 23941 23942 23943 23944 23945 23946 23947 23948 23949 23950 23951 23952 23953 23954 23955 23956 23957 23958 23959 23960 23961 23962 23963 23964 23965 23966 23967 23968 23969 23970 23971 23972 23973 23974 23975 23976 23977 23978 23979 23980 23981 23982 23983 23984 23985 23986 23987 23988 23989 23990 23991 23992 23993 23994 23995 23996 23997 23998 23999 24000 24001 24002 24003 24004 24005 24006 24007 24008 24009 24010 24011 24012 24013 24014 24015 24016 24017 24018 24019 24020 24021 24022 24023 24024 24025 24026 24027 24028 24029 24030 24031 24032 24033 24034 24035 24036 24037 24038 24039 24040 24041 24042 24043 24044 24045 24046 24047 24048 24049 24050 24051 24052 24053 24054 24055 24056 24057 24058 24059 24060 24061 24062 24063 24064 24065 24066 24067 24068 24069 24070 24071 24072 24073 24074 24075 24076 24077 24078 24079 24080 24081 24082 24083 24084 24085 24086 24087 24088 24089 24090 24091 24092 24093 24094 24095 24096 24097 24098 24099 24100 24101 24102 24103 24104 24105 24106 24107 24108 24109 24110 24111 24112 24113 24114 24115 24116 24117 24118 24119 24120 24121 24122 24123 24124 24125 24126 24127 24128 24129 24130 24131 24132 24133 24134 24135 24136 24137 24138 24139 24140 24141 24142 24143 24144 24145 24146 24147 24148 24149 24150 24151 24152 24153 24154 24155 24156 24157 24158 24159 24160 24161 24162 24163 24164 24165 24166 24167 24168 24169 24170 24171 24172 24173 24174 24175 24176 24177 24178 24179 24180 24181 24182 24183 24184 24185 24186 24187 24188 24189 24190 24191 24192 24193 24194 24195 24196 24197 24198 24199 24200 24201 24202 24203 24204 24205 24206 24207 24208 24209 24210 24211 24212 24213 24214 24215 24216 24217 24218 24219 24220 24221 24222 24223 24224 24225 24226 24227 24228 24229 24230 24231 24232 24233 24234 24235 24236 24237 24238 24239 24240 24241 24242 24243 24244 24245 24246 24247 24248 24249 24250 24251 24252 24253 24254 24255 24256 24257 24258 24259 24260 24261 24262 24263 24264 24265 24266 24267 24268 24269 24270 24271 24272 24273 24274 24275 24276 24277 24278 24279 24280 24281 24282 24283 24284 24285 24286 24287 24288 24289 24290 24291 24292 24293 24294 24295 24296 24297 24298 24299 24300 24301 24302 24303 24304 24305 24306 24307 24308 24309 24310 24311 24312 24313 24314 24315 24316 24317 24318 24319 24320 24321 24322 24323 24324 24325 24326 24327 24328 24329 24330 24331 24332 24333 24334 24335 24336 24337 24338 24339 24340 24341 24342 24343 24344 24345 24346 24347 24348 24349 24350 24351 24352 24353 24354 24355 24356 24357 24358 24359 24360 24361 24362 24363 24364 24365 24366 24367 24368 24369 24370 24371 24372 24373 24374 24375 24376 24377 24378 24379 24380 24381 24382 24383 24384 24385 24386 24387 24388 24389 24390 24391 24392 24393 24394 24395 24396 24397 24398 24399 24400 24401 24402 24403 24404 24405 24406 24407 24408 24409 24410 24411 24412 24413 24414 24415 24416 24417 24418 24419 24420 24421 24422 24423 24424 24425 24426 24427 24428 24429 24430 24431 24432 24433 24434 24435 24436 24437 24438 24439 24440 24441 24442 24443 24444 24445 24446 24447 24448 24449 24450 24451 24452 24453 24454 24455 24456 24457 24458 24459 24460 24461 24462 24463 24464 24465 24466 24467 24468 24469 24470 24471 24472 24473 24474 24475 24476 24477 24478 24479 24480 24481 24482 24483 24484 24485 24486 24487 24488 24489 24490 24491 24492 24493 24494 24495 24496 24497 24498 24499 24500 24501 24502 24503 24504 24505 24506 24507 24508 24509 24510 24511 24512 24513 24514 24515 24516 24517 24518 24519 24520 24521 24522 24523 24524 24525 24526 24527 24528 24529 24530 24531 24532 24533 24534 24535 24536 24537 24538 24539 24540 24541 24542 24543 24544 24545 24546 24547 24548 24549 24550 24551 24552 24553 24554 24555 24556 24557 24558 24559 24560 24561 24562 24563 24564 24565 24566 24567 24568 24569 24570 24571 24572 24573 24574 24575 24576 24577 24578 24579 24580 24581 24582 24583 24584 24585 24586 24587 24588 24589 24590 24591 24592 24593 24594 24595 24596 24597 24598 24599 24600 24601 24602 24603 24604 24605 24606 24607 24608 24609 24610 24611 24612 24613 24614 24615 24616 24617 24618 24619 24620 24621 24622 24623 24624 24625 24626 24627 24628 24629 24630 24631 24632 24633 24634 24635 24636 24637 24638 24639 24640 24641 24642 24643 24644 24645 24646 24647 24648 24649 24650 24651 24652 24653 24654 24655 24656 24657 24658 24659 24660 24661 24662 24663 24664 24665 24666 24667 24668 24669 24670 24671 24672 24673 24674 24675 24676 24677 24678 24679 24680 24681 24682 24683 24684 24685 24686 24687 24688 24689 24690 24691 24692 24693 24694 24695 24696 24697 24698 24699 24700 24701 24702 24703 24704 24705 24706 24707 24708 24709 24710 24711 24712 24713 24714 24715 24716 24717 24718 24719 24720 24721 24722 24723 24724 24725 24726 24727 24728 24729 24730 24731 24732 24733 24734 24735 24736 24737 24738 24739 24740 24741 24742 24743 24744 24745 24746 24747 24748 24749 24750 24751 24752 24753 24754 24755 24756 24757 24758 24759 24760 24761 24762 24763 24764 24765 24766 24767 24768 24769 24770 24771 24772 24773 24774 24775 24776 24777 24778 24779 24780 24781 24782 24783 24784 24785 24786 24787 24788 24789 24790 24791 24792 24793 24794 24795 24796 24797 24798 24799 24800 24801 24802 24803 24804 24805 24806 24807 24808 24809 24810 24811 24812 24813 24814 24815 24816 24817 24818 24819 24820 24821 24822 24823 24824 24825 24826 24827 24828 24829 24830 24831 24832 24833 24834 24835 24836 24837 24838 24839 24840 24841 24842 24843 24844 24845 24846 24847 24848 24849 24850 24851 24852 24853 24854 24855 24856 24857 24858 24859 24860 24861 24862 24863 24864 24865 24866 24867 24868 24869 24870 24871 24872 24873 24874 24875 24876 24877 24878 24879 24880 24881 24882 24883 24884 24885 24886 24887 24888 24889 24890 24891 24892 24893 24894 24895 24896 24897 24898 24899 24900 24901 24902 24903 24904 24905 24906 24907 24908 24909 24910 24911 24912 24913 24914 24915 24916 24917 24918 24919 24920 24921 24922 24923 24924 24925 24926 24927 24928 24929 24930 24931 24932 24933 24934 24935 24936 24937 24938 24939 24940 24941 24942 24943 24944 24945 24946 24947 24948 24949 24950 24951 24952 24953 24954 24955 24956 24957 24958 24959 24960 24961 24962 24963 24964 24965 24966 24967 24968 24969 24970 24971 24972 24973 24974 24975 24976 24977 24978 24979 24980 24981 24982 24983 24984 24985 24986 24987 24988 24989 24990 24991 24992 24993 24994 24995 24996 24997 24998 24999 25000 25001 25002 25003 25004 25005 25006 25007 25008 25009 25010 25011 25012 25013 25014 25015 25016 25017 25018 25019 25020 25021 25022 25023 25024 25025 25026 25027 25028 25029 25030 25031 25032 25033 25034 25035 25036 25037 25038 25039 25040 25041 25042 25043 25044 25045 25046 25047 25048 25049 25050 25051 25052 25053 25054 25055 25056 25057 25058 25059 25060 25061 25062 25063 25064 25065 25066 25067 25068 25069 25070 25071 25072 25073 25074 25075 25076 25077 25078 25079 25080 25081 25082 25083 25084 25085 25086 25087 25088 25089 25090 25091 25092
|
\documentclass[dvipdfmx]{book}
\newcommand{\VolumeName}{Volume 7: Axiom Hyperdoc}
\input{bookheader.tex}
\mainmatter
\setcounter{chapter}{0} % Chapter 1
\chapter{Overview}
This book covers 5 top level commands that make up the Axiom Hyperdoc
browser. The primary command is the hypertex command which can be run
as a standalone program to browse the Axiom documentation. It can also
be run by Axiom to enable lookup of information in the Axiom runtime.
\eject
\section{The Original Plan}
\begin{center}
The Original Hypertex Plan (courtesy of Scott Morrison)\\
\includegraphics[scale=1.00]{ps/hypertexplan.eps}
\end{center}
\section{External Variables}
Not mentioned elsewhere,
\begin{itemize}
\item the HTPATH shell variable, if set, is used
to resolve page path names.
\item the HTASCII shell variable, if set, is used to choose between
ascii and the IBM Code Page 850 character set.
See initScanner \ref{initScanner} on page~\pageref{initScanner}
\item the XENVIRONMENT shell variable, if set is used to find the X
database to merge, otherwise it uses .Xdefaults from the HOME directory.
See \ref{mergeDatabases} on page~\pageref{mergeDatabases}
\item NOFREE shell variable is supposed to turn off freeing memory.
See \ref{freePage} on page~\pageref{freePage}
\item SPADNUM shell variable is the number of the spad communication socket.
See \ref{sendPile} on page~\pageref{sendPile}
\end{itemize}
The Axiom user properties in \verb|$HOME/.Xdefaults.| can contain
these initialization names:
\begin{itemize}
\item Axiom.hyperdoc.FormGeometry
\item Axiom.hyperdoc.Geometry
\item Axiom.hyperdoc.ActiveColor
\item Axiom.hyperdoc.Background
\item Axiom.hyperdoc.EmphasizeColor
\item Axiom.hyperdoc.EmphasizeFont
\item Axiom.hyperdoc.Foreground
\item Axiom.hyperdoc.InputBackground
\item Axiom.hyperdoc.InputForeground
\item Axiom.hyperdoc.SpadColor
\item Axiom.hyperdoc.SpadFont
\item Axiom.hyperdoc.RmFont
\item Axiom.hyperdoc.TtFont
\item Axiom.hyperdoc.ActiveFont
\item Axiom.hyperdoc.AxiomFont
\item Axiom.hyperdoc.SpadFont
\item Axiom.hyperdoc.EmphasizeFont
\item Axiom.hyperdoc.BoldFont
\item Axiom.hyperdoc.Font
\end{itemize}
\section{hypertex}
\begin{verbatim}
Usage: hypertex [-s]
\end{verbatim}
\section{htsearch}
Construct a page with a menu of references to the word.
The syntax of the command is:
\begin{verbatim}
Usage: htsearch word
\end{verbatim}
\section{spadbuf}
\begin{verbatim}
Usage: spadbuf page_name [completion_files]
\end{verbatim}
\section{hthits}
\begin{verbatim}
Usage: hthits pattern htdb-file
\end{verbatim}
\section{ex2ht}
\begin{verbatim}
Usage: ex2ht exfile.ht ...
\end{verbatim}
\section{htadd}
HyperDoc database file manager
\begin{verbatim}
Usage: htadd [-s|-l|-f db-directory] [-d|-n] filenames
\end{verbatim}
\chapter{The hypertex language}
\begin{verbatim}
\$Data
\#
\%
\&
\,
\-
\/
\:
\[
\]
\_
\{
\}
\aleph
\aliascon#1#2
\aliascon{HomogeneousAggregate\&}{HOAGG-}
\allowbreak
\alpha
\argDef{"Axiom 2D"}
\asharp{}
\aspSectionNumber
\aspSectionTitle
\autobutt{BROWSEhelp}
\autobuttons
\autobuttLayout{\HelpButton{#1}}
\axiom
\axiom{ x + y + z = 8}
\axiomcommand{)lisp (defun f () (pprint "hello"))}
\axiomviewport
\axiomviewportasbutton
\axiomviewportbutton
\axiomxl{}
\axiomFunFromX
\axiomFunFrom{**}{Float}
\axiomFunX{declare}
\axiomFun{AND}
\axiomGlossSee{#1}{#2}
\axiomOpFrom{*}{QuadraticForm}
\axiomOpX
\axiomOp{#1!}
\axiomOp{*}
\axiomSig{Integer}{List Integer}
\axiomSyntax{()}
\axiomType{AbelianMonoid}
begin{array}{ccl} ... \end{array}
begin{page}{AlgebraPage}{Abstract Algebra}
...
\end{page}
\backslash
\baseLeftSkip
\baselineskip 10pt
\baselineskip
\beep
(Note: all begin and end items should be prefixed with a backslash)
begin{figXmpLines} ... end{figXmpLines}
begin{figure}[htbp] ... end{figure}
\beginImportant ... \endImportant
begin{items}[how wide am I] ... end{items}
begin{paste}{AssociationListXmpPageFull1}{AssociationListXmpPageEmpty1}
...
end{paste}
begin{patch}{AssociationListXmpPagePatch1} ... end{patch}
begin{picture}(183,252)(-125,0) ... end{picture}
begin{quotation} ... end{quotation}
begin{scroll} ... end{scroll}
begin{spadsrc} ... end{spadsrc}
begin{tabular}{ccc} ... end{tabular}
begin{texonly} ... end{texonly}
begin{verbatim} ... end {verbatim}
begin{xmpLines} ... end{xmpLines}
\begingroup ... \endgroup
\beginitems ... \enditems
\beginmenu ... \endmenu
\beginscroll ... \endscroll
\bf
\bgroup
\bigbreak
\blankline
\bmod
\bot
\bound{Data}
\boxvalue{b1}
\Browse{}
\bs{}
\bullet
\caption{Three-Dimensional Lighting Panel.}
\cdot
\cdots
\center
\centerline
\chapref{ugPackages}.{ugCategories}{12.12.}{Anonymous Categories} \Clef{}
\chi
\cite{gtz:gbpdpi}
\cleardoublepage
\command
\con
\conf
\controlbitmap
\ControlBitmap
\ControlBitmap{continue}
\coprod
\cos
\csch
\ddots
\def
\delta
\del
\displaystyle
\div
\dlink
\dom
\dot
\dots
\downarrow
\downlink{`Table'}{TableXmpPage}
\egroup
\ell
\else
\em
\emptyset
\end
\env{AXIOM}
\epsffile[0 0 295 295]{../ps/23dcola.ps}
\epsilon
\erf
\eta
\eth
\examplenumber
\exists
\ExitBitmap
\ExitBitmap{}
\exitbuttons
\ExitButton
\ExitButton{QuitPage}
\expr{1}
\exptypeindex{FortranCode}
\fakeAxiomFun{bubbleSort!}
\fbox{Boxed!}
\fi
\footnote
\forall
\frac{(x - 1)^2}{2}
\free{Data}
\frenchspacing
\funArgs{color}
\funSyntax{blue}
\Gallery{}
\gamma_{i,j}
\Gamma
\gdef
\generalFortranNumber
\generalFortranTitle
\geq
\glossSee
\gloss
\gotoevenpage
\GoBackToWork{}
\graphpaste{draw(cos(x*y),x=-3..3,y=-3..3)}
\hangafter=1
\hangindent=2pc
\hasreturn
\hbadness = 10001
\hbar
\hbox
\HDexptypeindex{Any}{ugTypesAnyNonePage}{2.6.}{The ``Any'' Domain}
\HDindex{list!association}{AssociationListXmpPage}{9.1}{AssociationList}
\HDsyscmdindex{abbreviation}{ugSysCmdcompilePage}{B.7.}{)compile}
\head{section}{Diversion: When Things Go Wrong}{ugIntProgDivTwo}
\head{subsection}{Arithmetic}{ugxCartenArith}
\helpbit{axes3D}
\HelpBitmap
\HelpBitmap{}
\HelpButton{#1}
\HelpButton{ugHyperPage}
\helppage{TestHelpPage}
\hidepaste
\horizontalline
\hspace
\htbitmap{f01qdf}
\htbitmap{great=}
\htbmdir{}
\htbmfile{pick}
\httex{At the end of the page}
\huge
\HyperName
\HyperName{}
\hyphenation
\ifcond
\ignore{Table}
\imath
\indent{0}
\indented
\indentrel{3}
\index{axiom}
\ind
\infty
\inputbitmap{/usr/include/X11/bitmaps/1x1}
\inputbox[1]{three}
\inputimage{{#1}.view/image}}
\inputpixmap
\inputstring{FindTopic}{15}{series}
\input{gallery/antoine.htex}
\int_{0}^{1}
\iota
\it
\item
\item[1. ]
\ixpt{}
\kappa
\keyword
\labelSpace{1.5pc}
\label{fig-clifalg}
\lambda
\Lambda
\lanb{}
\LangName
\Language{}
\large
\Large
\ldots
\le
\left
\leftarrow
\leq
\leqno(3)
\le
\lim_{x
\linebreak
\link
\Lisp{}
\lispcommand{Show Lisp definition}{(pprint (symbol-function 'HTXTESTPAGE))}
\lispdownlink{#1}{(|conPage| '|#2|)}
\lisplink{#1}{(|conOpPage| #2 '{#3})}}
\lispmemolink{Settings}{(|htSystemVariables|)}
\lispwindowlink{Link to it}{(HTXTESTPAGE "Hi there")}
\ll
\localinfo
\log
\mapsto
\marginpar
\mathOrSpad{1}
\mathop
\memolink{memolink to Actions menu}{HTXLinkTopPage}
\menudownlink{A Trigonometric Function of a Quadratic}{ExIntTrig}
\menuitemstyle{A.13. )history}}{ugSysCmdhistoryPage} }
\menulink{Number Theory}{NumberTheoryPage}
\menulispcommand{System Variables}{(|htsv|)}
\menulispdownlink{C02AFF}{(|c02aff|)}
\menulispwindowlink{Browse}{(|kSearch| "NagEigenPackage")}
\menumemolink{AXIOM Book}{UsersGuidePage}
\menuspadref
\menuunixcmd
\menuunixcommand{Edit}{xterm}
\menuunixlink{Reference}
\menuunixwindow{Link}{cat
\menuwindowlink{About AXIOM}{RootPageLogo}
\menuxmpref{CliffordAlgebra}
\mid
\mu
\nabla
\nabla}{
\nagDocumentationNumber
\nagDocumentationTitle
\nagLinkIntroNumber
\nagLinkIntroTitle
\nagLinkUsageNumber
\nagLinkUsageTitle
\nagTechnicalNumber
\nagTechnicalTitle
\naglib{}
\narrowDisplay
\narrower
\neg
\newcommand{\aliasdom}[2]{\lispdownlink{#1}{(|conPage| '|#2|)}}
\newcommand{\autobuttLayout}[1]{\centerline{#1}}}
\newcommand{\autobuttMaker}[1]{\autobuttLayout{\HelpButton{#1}}}
\newcommand{\riddlebuttons}[1]{\autobuttLayout{\link{\HelpBitmap}{#1}}}
\newline
\newpage
\newsearchresultentry
\newspadclient}[1]{xterm -n "#1" -e
\noOutputXtc
\noindent
\nolimits
\nolines
\nonLibAxiomType{?(Integer)},
\nonfrenchspacing
\not=
\notequal
\nu
\nugNagdNumber
\nugNagdTitle
\nullXtc
\nullspadcommand
\off
\omega
\on
\ops
\optArg{option}
\outdent{Sierpinsky's Tetrahedron}
\over
\pagename
\pageref{fig-quadform}
\par
\parallel
\parindent=1pc
\partial
\pastebutton{AssociationListXmpPageFull1}{\hidepaste}
\pastecommand
\pastegraph
\phi
\Phi
\Phi_n
\pi
\Pi
\pm
\pp
\pred{i}
\prime
\prod
\protect
\Psi
\psXtc
\pspadfun{drawRibbons}
\pspadtype{DataList}
\quad
\radiobox[0]{rthree}{sample}
\raggedright
\ranb{}
\ref{fig-clifalg}.
\ReturnBitmap
\ReturnBitmap{}
\returnbutton{homebutton}{ReturnPage}
\rho
\riddlebuttons
\right
\rightarrow
\rm
\sc
\searchresultentry
\searchwindow{Start Search}
\setcounter{chapter}{0}}{}
\sf
\showBlurb{AssociationList}
\showpaste
\sigma
\Sigma
\sim
\simplebox
\sin
\sloppy
\small
\smath{(k,t)}
\sp
\space{-1}
\spad{al}
\spadatt{commutative("*")}
\spadcmd{)abbreviation query}
\spadcommand{Data := Record(monthsOld : Integer, gender : String)}
\spadFileExt{}
\spadfun{solve}
\spadfunX{concat}
\spadfunFrom{table}{AssociationList}
\spadfunFromX{delete}{AssociationList}
\spadgloss{Category} == T}
\spadglossSee{Conversion}{conversion}
\spadgraph{draw(besselI(alpha, 5), alpha = -12..12, unit==[5,20])}
\spadignore{e.g.}
\spadkey{Join}
\spadop{**}
\spadopFrom{**}{RadicalCategory}
\spadpaste{Data := Record(monthsOld : Integer, gender : String) \bound{Data}}
\spadref
\spadsig{(Integer,Integer)}{Fraction(Integer)}
\spadSyntax{and}
\spadsys{)cd}
\spadsyscom{)set function cache}
\spadtype{AssociationList}
\spadvar
\spadviewportasbutton{mobius}
\special{psfile=../ps/3dvolume.ps}
\sqrt{1-2 t z+t^2}
\StdExitButton{}
\StdHelpButton{}
\stringvalue{FindTopic}
\subscriptIt{color}{1}
\subscriptText{Float}{yOffset}
\subsubsection{Arithmetic}
\sum_{m=a}^{b}
\surd
\syscmdindex{set hyperdoc browse exposure}
\syscom
\s
\tab
\tab{0}
\tab{-2}
\table
\tan
\tau
\texbreak
\texht{$L^m_n (z)$}
\texnewline
\theta
\thispage
\threedim{}
\times
\tiny
\top
\triangle
\tt
\twodim{}
\typeout{check this example}
\tab{5}
\TeX{}
\texht{Gr\"{o}bner}{Groebner}
\texht{Poincar\'e}{Poincare
\Theta
\ugAppGraphicsNumber
\ugAppGraphicsTitle
\ugAvailCLEFNumber
\ugAvailCLEFTitle
\ugAvailSnoopNumber
\ugAvailSnoopTitle
\ugBrowseCapitalizationConventionNumber
\ugBrowseCapitalizationConventionTitle
\ugBrowseCrossReferenceNumber
\ugBrowseCrossReferenceTitle
\ugBrowseDescriptionPageNumber
\ugBrowseDescriptionPageTitle
\ugBrowseDomainButtonsNumber
\ugBrowseDomainButtonsTitle
\ugBrowseDomainNumber
\ugBrowseDomainTitle
\ugBrowseGivingParametersNumber
\ugBrowseGivingParametersTitle
\ugBrowseMiscellaneousFeaturesNumber
\ugBrowseMiscellaneousFeaturesTitle
\ugBrowseNumber
\ugBrowseOptionsNumber
\ugBrowseOptionsTitle
\ugBrowseStartNumber
\ugBrowseStartTitle
\ugBrowseTitle
\ugBrowseViewsOfConstructorsNumber
\ugBrowseViewsOfConstructorsTitle
\ugBrowseViewsOfOperationsNumber
\ugBrowseViewsOfOperationsTitle
\ugCategoriesAndPackagesNumber
\ugCategoriesAndPackagesTitle
\ugCategoriesAttributesNumber
\ugCategoriesAttributesTitle
\ugCategoriesAxiomsNumber
\ugCategoriesAxiomsTitle
\ugCategoriesConditionalsNumber
\ugCategoriesConditionalsTitle
\ugCategoriesCorrectnessNumber
\ugCategoriesCorrectnessTitle
\ugCategoriesDefaultsNumber
\ugCategoriesDefaultsTitle
\ugCategoriesDefsNumber
\ugCategoriesDefsTitle
\ugCategoriesDocNumber
\ugCategoriesDocTitle
\ugCategoriesExportsNumber
\ugCategoriesExportsTitle
\ugCategoriesHierNumber
\ugCategoriesHierTitle
\ugCategoriesMembershipNumber
\ugCategoriesMembershipTitle
\ugCategoriesNumber
\ugCategoriesParametersNumber
\ugCategoriesParametersTitle
\ugCategoriesTitle
\ugDomainsAddDomainNumber
\ugDomainsAddDomainTitle
\ugDomainsAssertionsNumber
\ugDomainsAssertionsTitle
\ugDomainsAssertionsTitle
\ugDomainsBrowseNumber
\ugDomainsBrowseTitle
\ugDomainsCliffordNumber
\ugDomainsCliffordTitle
\ugDomainsCreatingNumber
\ugDomainsCreatingTitle
\ugDomainsDataListsNumber
\ugDomainsDataListsTitle
\ugDomainsDatabaseConstructorNumber
\ugDomainsDatabaseConstructorTitle
\ugDomainsDatabaseNumber
\ugDomainsDatabaseTitle
\ugDomainsDefaultsNumber
\ugDomainsDefaultsTitle
\ugDomainsDefsNumber
\ugDomainsDefsTitle
\ugDomainsDemoNumber
\ugDomainsDemoTitle
\ugDomainsDemoTitle
\ugDomainsExamplesNumber
\ugDomainsExamplesTitle
\ugDomainsMultipleRepsNumber
\ugDomainsMultipleRepsTitle
\ugDomainsNumber
\ugDomainsOriginsNumber
\ugDomainsOriginsTitle
\ugDomainsPuttingNumber
\ugDomainsPuttingTitle
\ugDomainsQueryEquationsNumber
\ugDomainsQueryEquationsTitle
\ugDomainsQueryLanguageNumber
\ugDomainsQueryLanguageTitle
\ugDomainsRepNumber
\ugDomainsRepTitle
\ugDomainsShortFormsNumber
\ugDomainsShortFormsTitle
\ugDomainsTitle
\ugDomainsTitle
\ugDomsinsDatabaseNumber
\ugDomsinsDatabaseTitle
\ugFantoineNumber
\ugFantoineTitle
\ugFconformalNumber
\ugFconformalTitle
\ugFdhtriNumber
\ugFdhtriTitle
\ugFimagesEightNumber
\ugFimagesEightTitle
\ugFimagesFiveNumber
\ugFimagesFiveTitle
\ugFimagesFiveTitle
\ugFimagesOneNumber
\ugFimagesOneTitle
\ugFimagesSevenNumber
\ugFimagesSevenTitle
\ugFimagesSixNumber
\ugFimagesSixTitle
\ugFimagesThreeNumber
\ugFimagesThreeTitle
\ugFimagesTwoNumber
\ugFimagesTwoTitle
\ugFntubeNumber
\ugFntubeTitle
\ugFscherkNumber
\ugFscherkTitle
\ugFtetraNumber
\ugFtetraTitle
\ugFtknotNumber
\ugFtknotTitle
\ugGraphClipNumber
\ugGraphClipTitle
\ugGraphColorNumber
\ugGraphColorPaletteNumber
\ugGraphColorPaletteTitle
\ugGraphColorPaletteTitle
\ugGraphColorTitle
\ugGraphColorTitle
\ugGraphCoordNumber
\ugGraphCoordTitle
\ugGraphCoordTitle
\ugGraphMakeObjectNumber
\ugGraphMakeObjectTitle
\ugGraphNumber
\ugGraphThreeDBuildNumber
\ugGraphThreeDBuildTitle
\ugGraphThreeDControlNumber
\ugGraphThreeDControlTitle
\ugGraphThreeDNumber
\ugGraphThreeDOptionsNumber
\ugGraphThreeDOptionsTitle
\ugGraphThreeDOptionsTitle
\ugGraphThreeDParNumber
\ugGraphThreeDParTitle
\ugGraphThreeDParmNumber
\ugGraphThreeDParmTitle
\ugGraphThreeDPlotNumber
\ugGraphThreeDPlotTitle
\ugGraphThreeDTitle
\ugGraphThreeDopsNumber
\ugGraphThreeDopsTitle
\ugGraphTitle
\ugGraphTitle
\ugGraphTwoDControlNumber
\ugGraphTwoDControlTitle
\ugGraphTwoDNumber
\ugGraphTwoDOptionsNumber
\ugGraphTwoDOptionsTitle
\ugGraphTwoDOptionsTitle
\ugGraphTwoDParNumber
\ugGraphTwoDParTitle
\ugGraphTwoDPlaneNumber
\ugGraphTwoDPlaneTitle
\ugGraphTwoDPlotNumber
\ugGraphTwoDPlotTitle
\ugGraphTwoDTitle
\ugGraphTwoDappendNumber
\ugGraphTwoDappendTitle
\ugGraphTwoDappendTitle
\ugGraphTwoDbuildNumber
\ugGraphTwoDbuildTitle
\ugGraphTwoDbuildTitle
\ugGraphTwoDopsNumber
\ugGraphTwoDopsTitle
\ugHyperButtonsNumber
\ugHyperButtonsTitle
\ugHyperExampleNumber
\ugHyperExampleTitle
\ugHyperHeadingsNumber
\ugHyperHeadingsTitle
\ugHyperInputNumber
\ugHyperInputTitle
\ugHyperInputTitle
\ugHyperKeysNumber
\ugHyperKeysTitle
\ugHyperNumber
\ugHyperResourcesNumber
\ugHyperResourcesTitle
\ugHyperScrollNumber
\ugHyperScrollTitle
\ugHyperSearchNumber
\ugHyperSearchTitle
\ugHyperTitle
\ugHyperTitle
\ugInOutAlgebraNumber
\ugInOutAlgebraTitle
\ugInOutFortranNumber
\ugInOutFortranTitle
\ugInOutInNumber
\ugInOutInTitle
\ugInOutInTitle
\ugInOutNumber
\ugInOutOutNumber
\ugInOutOutTitle
\ugInOutScriptNumber
\ugInOutScriptTitle
\ugInOutSpadprofNumber
\ugInOutSpadprofTitle
\ugInOutTeXNumber
\ugInOutTeXTitle
\ugInOutTitle
\ugIntProgColorArrNumber
\ugIntProgColorArrTitle
\ugIntProgColorNumber
\ugIntProgColorTitle
\ugIntProgCompFunsNumber
\ugIntProgCompFunsTitle
\ugIntProgCompFunsTitle
\ugIntProgDrawingNumber
\ugIntProgDrawingTitle
\ugIntProgFunctionsNumber
\ugIntProgFunctionsTitle
\ugIntProgNewtonNumber
\ugIntProgNewtonTitle
\ugIntProgNumber
\ugIntProgPLCNumber
\ugIntProgPLCTitle
\ugIntProgRibbonNumber
\ugIntProgRibbonTitle
\ugIntProgTitle
\ugIntProgTitle
\ugIntProgVecFieldsNumber
\ugIntProgVecFieldsTitle
\ugIntroArithmeticNumber
\ugIntroArithmeticTitle
\ugIntroAssignNumber
\ugIntroAssignTitle
\ugIntroAssignTitle
\ugIntroCalcDerivNumber
\ugIntroCalcDerivTitle
\ugIntroCalcDerivTitle
\ugIntroCalcLimitsNumber
\ugIntroCalcLimitsTitle
\ugIntroCalcLimitsTitle
\ugIntroCallFunNumber
\ugIntroCallFunTitle
\ugIntroCallFunTitle
\ugIntroCollectNumber
\ugIntroCollectTitle
\ugIntroCommentsNumber
\ugIntroCommentsTitle
\ugIntroConversionNumber
\ugIntroConversionTitle
\ugIntroDiffEqnsNumber
\ugIntroDiffEqnsTitle
\ugIntroExpressionsNumber
\ugIntroExpressionsTitle
\ugIntroGraphicsNumber
\ugIntroGraphicsTitle
\ugIntroIntegrateNumber
\ugIntroIntegrateTitle
\ugIntroLongNumber
\ugIntroLongTitle
\ugIntroMacrosNumber
\ugIntroMacrosTitle
\ugIntroNumber
\ugIntroNumbersNumber
\ugIntroNumbersTitle
\ugIntroNumbersTitle
\ugIntroNumber
\ugIntroPreviousNumber
\ugIntroPreviousTitle
\ugIntroSeriesNumber
\ugIntroSeriesTitle
\ugIntroSeriesTitle
\ugIntroSolutionNumber
\ugIntroSolutionTitle
\ugIntroStartNumber
\ugIntroStartTitle
\ugIntroSysCmmandsNumber
\ugIntroSysCmmandsTitle
\ugIntroTitle
\ugIntroTitle
\ugIntroTwoDimNumber
\ugIntroTwoDimTitle
\ugIntroTwoDimTitle
\ugIntroTypesNumber
\ugIntroTypesTitle
\ugIntroTypoNumber
\ugIntroTypoTitle
\ugIntroTypoTitle
\ugIntroVariablesNumber
\ugIntroVariablesTitle
\ugIntroVariablesTitle
\ugIntroYouNumber
\ugIntroYouTitle
\ugLangAssignNumber
\ugLangAssignTitle
\ugLangAssignTitle
\ugLangBlocksNumber
\ugLangBlocksTitle
\ugLangBlocksTitle
\ugLangIfNumber
\ugLangIfTitle
\ugLangIfTitle
\ugLangItsNumber
\ugLangItsTitle
\ugLangItsTitle
\ugLangLoopsBreakMoreNumber
\ugLangLoopsBreakMoreTitle
\ugLangLoopsBreakNumber
\ugLangLoopsBreakTitle
\ugLangLoopsBreakTitle
\ugLangLoopsBreakVsNumber
\ugLangLoopsBreakVsTitle
\ugLangLoopsCompIntNumber
\ugLangLoopsCompIntTitle
\ugLangLoopsForInNMNumber
\ugLangLoopsForInNMSNumber
\ugLangLoopsForInNMSTitle
\ugLangLoopsForInNMTitle
\ugLangLoopsForInNNumber
\ugLangLoopsForInNTitle
\ugLangLoopsForInNumber
\ugLangLoopsForInPredNumber
\ugLangLoopsForInPredTitle
\ugLangLoopsForInPredTitle
\ugLangLoopsForInTitle
\ugLangLoopsForInTitle
\ugLangLoopsForInXLNumber
\ugLangLoopsForInXLTitle
\ugLangLoopsIterateNumber
\ugLangLoopsIterateTitle
\ugLangLoopsNumber
\ugLangLoopsParNumber
\ugLangLoopsParTitle
\ugLangLoopsReturnNumber
\ugLangLoopsReturnTitle
\ugLangLoopsReturnTitle
\ugLangLoopsTitle
\ugLangLoopsTitle
\ugLangLoopsWhileNumber
\ugLangLoopsWhileTitle
\ugLangNumber
\ugLangStreamsPrimesNumber
\ugLangStreamsPrimesTitle
\ugLangTitle
\ugLogicalSearchesNumber
\ugLogicalSearchesTitle
\ugPackagesAbstractNumber
\ugPackagesAbstractTitle
\ugPackagesAbstractTitle
\ugPackagesCapsulesNumber
\ugPackagesCapsulesTitle
\ugPackagesCompilingNumber
\ugPackagesCompilingTitle
\ugPackagesCondsNumber
\ugPackagesCondsTitle
\ugPackagesCondsTitle
\ugPackagesDomsNumber
\ugPackagesDomsTitle
\ugPackagesHowNumber
\ugPackagesHowTitle
\ugPackagesInputFilesNumber
\ugPackagesInputFilesTitle
\ugPackagesNamesNumber
\ugPackagesNamesTitle
\ugPackagesNumber
\ugPackagesPackagesNumber
\ugPackagesPackagesTitle
\ugPackagesParametersNumber
\ugPackagesParametersTitle
\ugPackagesSyntaxNumber
\ugPackagesSyntaxTitle
\ugPackagesTitle
\ugPackagesTitle
\ugProblemDEQNumber
\ugProblemDEQTitle
\ugProblemDEQTitle
\ugProblemEigenNumber
\ugProblemEigenTitle
\ugProblemEigenTitle
\ugProblemFactorAlgNumber
\ugProblemFactorAlgTitle
\ugProblemFactorFFNumber
\ugProblemFactorFFTitle
\ugProblemFactorIntRatNumber
\ugProblemFactorIntRatTitle
\ugProblemFactorNumber
\ugProblemFactorRatFunNumber
\ugProblemFactorRatFunTitle
\ugProblemFactorTitle
\ugProblemFactorTitle
\ugProblemFiniteNumber
\ugProblemFiniteTitle
\ugProblemFiniteTitle
\ugProblemGaloisNumber
\ugProblemGaloisTitle
\ugProblemGaloisTitle
\ugProblemGeneticNumber
\ugProblemGeneticTitle
\ugProblemIdealNumber
\ugProblemIdealTitle
\ugProblemIntegrationNumber
\ugProblemIntegrationTitle
\ugProblemIntegrationTitle
\ugProblemLaplaceNumber
\ugProblemLaplaceTitle
\ugProblemLimitsNumber
\ugProblemLimitsTitle
\ugProblemLimitsTitle
\ugProblemLinPolEqnNumber
\ugProblemLinPolEqnTitle
\ugProblemLinPolEqnTitle
\ugProblemNumber
\ugProblemNumericNumber
\ugProblemNumericTitle
\ugProblemNumericTitle
\ugProblemSeriesNumber
\ugProblemSeriesTitle
\ugProblemSeriesTitle
\ugProblemSymRootNumber
\ugProblemSymRootTitle
\ugProblemTitle
\ugSysCmdNumber
\ugSysCmdOverviewNumber
\ugSysCmdOverviewTitle
\ugSysCmdTitle
\ugSysCmdTitle
\ugSysCmdabbreviationNumber
\ugSysCmdabbreviationTitle
\ugSysCmdabbreviationTitle
\ugSysCmdbootNumber
\ugSysCmdbootTitle
\ugSysCmdbootTitle
\ugSysCmdcdNumber
\ugSysCmdcdTitle
\ugSysCmdcdTitle
\ugSysCmdclearNumber
\ugSysCmdclearTitle
\ugSysCmdclearTitle
\ugSysCmdcloseNumber
\ugSysCmdcloseTitle
\ugSysCmdcloseTitle
\ugSysCmdcompileNumber
\ugSysCmdcompileTitle
\ugSysCmdcompileTitle
\ugSysCmddisplayNumber
\ugSysCmddisplayTitle
\ugSysCmddisplayTitle
\ugSysCmdeditNumber
\ugSysCmdeditTitle
\ugSysCmdeditTitle
\ugSysCmdfinNumber
\ugSysCmdfinTitle
\ugSysCmdfinTitle
\ugSysCmdframeNumber
\ugSysCmdframeTitle
\ugSysCmdframeTitle
\ugSysCmdhelpNumber
\ugSysCmdhelpTitle
\ugSysCmdhistoryNumber
\ugSysCmdhistoryTitle
\ugSysCmdhistoryTitle
\ugSysCmdlibraryNumber
\ugSysCmdlibraryTitle
\ugSysCmdlibraryTitle
\ugSysCmdlispNumber
\ugSysCmdlispTitle
\ugSysCmdlispTitle
\ugSysCmdloadNumber
\ugSysCmdloadTitle
\ugSysCmdltraceNumber
\ugSysCmdltraceTitle
\ugSysCmdltraceTitle
\ugSysCmdpquitNumber
\ugSysCmdpquitTitle
\ugSysCmdpquitTitle
\ugSysCmdquitNumber
\ugSysCmdquitTitle
\ugSysCmdquitTitle
\ugSysCmdreadNumber
\ugSysCmdreadTitle
\ugSysCmdreadTitle
\ugSysCmdsetNumber
\ugSysCmdsetTitle
\ugSysCmdsetTitle
\ugSysCmdshowNumber
\ugSysCmdshowTitle
\ugSysCmdshowTitle
\ugSysCmdspoolNumber
\ugSysCmdspoolTitle
\ugSysCmdspoolTitle
\ugSysCmdsynonymNumber
\ugSysCmdsynonymTitle
\ugSysCmdsystemNumber
\ugSysCmdsystemTitle
\ugSysCmdsystemTitle
\ugSysCmdtraceNumber
\ugSysCmdtraceTitle
\ugSysCmdtraceTitle
\ugSysCmdundoNumber
\ugSysCmdundoTitle
\ugSysCmdundoTitle
\ugSysCmdwhatNumber
\ugSysCmdwhatTitle
\ugSysCmdwhatTitle
\ugTwoTwoAldorNumber
\ugTwoTwoAldorTitle
\ugTwoTwoCCLNumber
\ugTwoTwoCCLTitle
\ugTwoTwoHyperdocNumber
\ugTwoTwoHyperdocTitle
\ugTwoTwoNAGLinkNumber
\ugTwoTwoNAGLinkTitle
\ugTwoTwoPolynomialsNumber
\ugTwoTwoPolynomialsTitle
\ugTypesAnyNoneNumber
\ugTypesAnyNoneTitle
\ugTypesAnyNoneTitle
\ugTypesBasicDomainConsNumber
\ugTypesBasicDomainConsTitle
\ugTypesBasicDomainConsTitle
\ugTypesBasicNumber
\ugTypesBasicTitle
\ugTypesBasicTitle
\ugTypesConvertNumber
\ugTypesConvertTitle
\ugTypesConvertTitle
\ugTypesDeclareNumber
\ugTypesDeclareTitle
\ugTypesDeclareTitle
\ugTypesExposeNumber
\ugTypesExposeTitle
\ugTypesExposeTitle
\ugTypesNumber
\ugTypesPkgCallNumber
\ugTypesPkgCallTitle
\ugTypesPkgCallTitle
\ugTypesRecordsNumber
\ugTypesRecordsTitle
\ugTypesRecordsTitle
\ugTypesResolveNumber
\ugTypesResolveTitle
\ugTypesResolveTitle
\ugTypesSubdomainsNumber
\ugTypesSubdomainsTitle
\ugTypesSubdomainsTitle
\ugTypesTitle
\ugTypesTitle
\ugTypesUnionsNumber
\ugTypesUnionsTitle
\ugTypesUnionsTitle
\ugTypesUnionsWOSelNumber
\ugTypesUnionsWOSelTitle
\ugTypesUnionsWOSelTitle
\ugTypesUnionsWSelNumber
\ugTypesUnionsWSelTitle
\ugTypesWritingAbbrNumber
\ugTypesWritingAbbrTitle
\ugTypesWritingAbbrTitle
\ugTypesWritingModesNumber
\ugTypesWritingModesTitle
\ugTypesWritingModesTitle
\ugTypesWritingMoreNumber
\ugTypesWritingMoreTitle
\ugTypesWritingNumber
\ugTypesWritingOneNumber
\ugTypesWritingOneTitle
\ugTypesWritingTitle
\ugTypesWritingZeroNumber
\ugTypesWritingZeroTitle
\ugUserAnonDeclareNumber
\ugUserAnonDeclareTitle
\ugUserAnonExampNumber
\ugUserAnonExampTitle
\ugUserAnonNumber
\ugUserAnonTitle
\ugUserAnonTitle
\ugUserBlocksNumber
\ugUserBlocksTitle
\ugUserBlocksTitle
\ugUserCacheNumber
\ugUserCacheTitle
\ugUserCacheTitle
\ugUserCompIntNumber
\ugUserCompIntTitle
\ugUserCompIntTitle
\ugUserDatabaseNumber
\ugUserDatabaseTitle
\ugUserDecOpersNumber
\ugUserDecOpersTitle
\ugUserDecUndecNumber
\ugUserDecUndecTitle
\ugUserDeclareNumber
\ugUserDeclareTitle
\ugUserDeclareTitle
\ugUserDelayNumber
\ugUserDelayTitle
\ugUserDelayTitle
\ugUserFreeLocalNumber
\ugUserFreeLocalTitle
\ugUserFreeLocalTitle
\ugUserFunMacNumber
\ugUserFunMacTitle
\ugUserIntroNumber
\ugUserIntroTitle
\ugUserMacrosNumber
\ugUserMacrosTitle
\ugUserMacrosTitle
\ugUserMakeNumber
\ugUserMakeTitle
\ugUserMakeTitle
\ugUserNumber
\ugUserOneNumber
\ugUserOneTitle
\ugUserPalNumber
\ugUserPalTitle
\ugUserPieceBasicNumber
\ugUserPieceBasicTitle
\ugUserPieceBasicTitle
\ugUserPieceNumber
\ugUserPiecePickingNumber
\ugUserPiecePickingTitle
\ugUserPiecePredNumber
\ugUserPiecePredTitle
\ugUserPiecePredTitle
\ugUserPieceTitle
\ugUserRecurNumber
\ugUserRecurTitle
\ugUserRecurTitle
\ugUserRulesNumber
\ugUserRulesTitle
\ugUserRulesTitle
\ugUserTitle
\ugUserTitle
\ugUserTriangleNumber
\ugUserTriangleTitle
\ugUserTriangleTitle
\ugUserUseNumber
\ugUserUseTitle
\ugUserUseTitle
\ugWhatsNewAsharpNumber
\ugWhatsNewAsharpTitle
\ugWhatsNewDocumentationNumber
\ugWhatsNewDocumentationTitle
\ugWhatsNewHyperDocNumber
\ugWhatsNewHyperDocTitle
\ugWhatsNewImportantNumber
\ugWhatsNewImportantTitle
\ugWhatsNewLanguageNumber
\ugWhatsNewLanguageTitle
\ugWhatsNewLibraryNumber
\ugWhatsNewLibraryTitle
\ugWhatsNewNumber
\ugWhatsNewTitle
\ugWhatsNewTwoTwoNumber
\ugWhatsNewTwoTwoTitle
\ugXdefaultsNumber
\ugXdefaultsTitle
\ugxCliffordComplexNumber
\ugxCliffordComplexTitle
\ugxCliffordDiracNumber
\ugxCliffordDiracTitle
\ugxCliffordExteriorNumber
\ugxCliffordExteriorTitle
\ugxCliffordQuaternNumber
\ugxCliffordQuaternTitle
\ugxFactoredArithNumber
\ugxFactoredArithTitle
\ugxFactoredDecompNumber
\ugxFactoredDecompTitle
\ugxFactoredExpandNumber
\ugxFactoredExpandTitle
\ugxFactoredNewNumber
\ugxFactoredNewTitle
\ugxFactoredVarNumber
\ugxFactoredVarTitle
\ugxFloatConvertNumber
\ugxFloatConvertTitle
\ugxFloatHilbertNumber
\ugxFloatHilbertTitle
\ugxFloatHilbertTitle
\ugxFloatIntroNumber
\ugxFloatIntroTitle
\ugxFloatOutputNumber
\ugxFloatOutputTitle
\ugxIntegerBasicNumber
\ugxIntegerBasicTitle
\ugxIntegerNTNumber
\ugxIntegerNTTitle
\ugxIntegerPrimesNumber
\ugxIntegerPrimesTitle
\ugxLinearOrdinaryDifferentialOperatorOneRatNumber
\ugxLinearOrdinaryDifferentialOperatorOneRatTitle
\ugxLinearOrdinaryDifferentialOperatorSeriesNumber
\ugxLinearOrdinaryDifferentialOperatorSeriesTitle
\ugxLinearOrdinaryDifferentialOperatorTwoConstNumber
\ugxLinearOrdinaryDifferentialOperatorTwoConstTitle
\ugxLinearOrdinaryDifferentialOperatorTwoMatrixNumber
\ugxLinearOrdinaryDifferentialOperatorTwoMatrixTitle
\ugxListAccessNumber
\ugxListAccessTitle
\ugxListChangeNumber
\ugxListChangeTitle
\ugxListCreateNumber
\ugxListCreateTitle
\ugxListDotNumber
\ugxListDotTitle
\ugxListOtherNumber
\ugxListOtherTitle
\ugxMatrixCreateNumber
\ugxMatrixCreateTitle
\ugxMatrixOpsNumber
\ugxMatrixOpsTitle
\ugxProblemDEQSeriesNumber
\ugxProblemDEQSeriesTitle
\ugxProblemDEQSeriesTitle
\ugxProblemFiniteConversionNumber
\ugxProblemFiniteConversionTitle
\ugxProblemFiniteCyclicNumber
\ugxProblemFiniteCyclicTitle
\ugxProblemFiniteExtensionFiniteNumber
\ugxProblemFiniteExtensionFiniteTitle
\ugxProblemFiniteExtensionFiniteTitle
\ugxProblemFiniteModulusNumber
\ugxProblemFiniteModulusTitle
\ugxProblemFiniteNormalNumber
\ugxProblemFiniteNormalTitle
\ugxProblemFinitePrimeNumber
\ugxProblemFinitePrimeTitle
\ugxProblemFinitePrimeTitle
\ugxProblemFiniteUtilityNumber
\ugxProblemFiniteUtilityTitle
\ugxProblemFiniteUtilityTitle
\ugxProblemLDEQClosedNumber
\ugxProblemLDEQClosedTitle
\ugxProblemLinSysNumber
\ugxProblemLinSysTitle
\ugxProblemNLDEQClosedNumber
\ugxProblemNLDEQClosedTitle
\ugxProblemOnePolNumber
\ugxProblemOnePolTitle
\ugxProblemOnePolTitle
\ugxProblemPolSysNumber
\ugxProblemPolSysTitle
\ugxProblemPolSysTitle
\ugxProblemSeriesArithmeticNumber
\ugxProblemSeriesArithmeticTitle
\ugxProblemSeriesBernoulliNumber
\ugxProblemSeriesBernoulliTitle
\ugxProblemSeriesCoefficientsNumber
\ugxProblemSeriesCoefficientsTitle
\ugxProblemSeriesConversionsNumber
\ugxProblemSeriesConversionsTitle
\ugxProblemSeriesConversionsTitle
\ugxProblemSeriesCreateNumber
\ugxProblemSeriesCreateTitle
\ugxProblemSeriesFormulaNumber
\ugxProblemSeriesFormulaTitle
\ugxProblemSeriesFormulaTitle
\ugxProblemSeriesFunctionsNumber
\ugxProblemSeriesFunctionsTitle
\ugxProblemSeriesFunctionsTitle
\ugxProblemSeriesSubstituteNumber
\ugxProblemSeriesSubstituteTitle
\ugxProblemSymRootAllNumber
\ugxProblemSymRootAllTitle
\ugxProblemSymRootAllTitle
\ugxProblemSymRootOneNumber
\ugxProblemSymRootOneTitle
\undocumented
\unind
\unixcommand{(Postscript)}{ghostview
\unixlink{Some file}
\unixwindow
\uparrow$
\UpBitmap{}
\upbutton{Click here}{UpPage}
\upsilon
\Upsilon
\userfun{bubbleSort2}
\varphi
\vbox
\verb+--+
\vertline
\viewport{/tmp/mobius}
\viewportasbutton{/tmp/mobius}
\void{}
\vskip .5
\vskip 1pc
\vskip 4pt
\vspace
\vspace{-25}
\windowid
\windowlink{ErrorPage}{ErrorPage}
\xdefault{Bld14}
\Xi
\xtc{
This is a \pspadtype{Record} type with age and gender fields.
}{
\spadpaste{Data := Record(monthsOld : Integer, gender : String) \bound{Data}}
}
\xmpLine{)set fun comp on}{}
\zag{1}{6}+
\zeta
\end{verbatim}
\chapter{Hypertex Call Graph}
This was generated by the GNU cflow program with the argument list.
Note that the line:NNNN numbers refer to the line in the code after
it has been tangled from this file.
\begin{verbatim}
cflow --emacs -l -n -b -T --omit-arguments hypertex.c
\end{verbatim}
\begin{verbatim}
;; This file is generated by GNU cflow 1.3. -*- cflow -*-
2 { 0} +-main() <int main () line:14475>
3 { 1} +-checkArguments() <void checkArguments () line:3041>
4 { 2} | +-fprintf()
5 { 2} | \-exit()
6 { 1} +-initHash() <void initHash () line:3014>
7 { 2} | +-hashInit() <void hashInit () line:2091>
8 { 3} | \-halloc() <char *halloc () line:2070>
9 { 4} | +-fopen()
10 { 4} | +-malloc()
11 { 4} | +-fprintf()
12 { 4} | +-sprintf()
13 { 4} | \-exit()
14 { 2} | +-stringEqual() <int stringEqual () line:2185>
15 { 3} | \-strcmp()
16 { 2} | +-stringHash() <int stringHash () line:2177>
17 { 2} | +-windowEqual() <int windowEqual () line:10409>
18 { 2} | \-windowCode() <int windowCode () line:10413>
19 { 1} +-parserInit() <void parserInit () line:2326>
20 { 2} | +-hashInit() <void hashInit () line:2091> [see 7]
21 { 2} | +-stringEqual() <int stringEqual () line:2185> [see 14]
22 { 2} | +-stringHash() <int stringHash () line:2177>
23 { 2} | +-halloc() <char *halloc () line:2070> [see 8]
24 { 2} | \-hashInsert() <void hashInsert () line:2104>
25 { 3} | +-halloc() <char *halloc () line:2070> [see 8]
26 { 3} | \-fprintf()
27 { 1} +-readHtDb() <void readHtDb () line:10428>
28 { 2} +-hashInit() <void hashInit () line:2091> [see 7]
29 { 2} +-stringEqual() <int stringEqual () line:2185> [see 14]
30 { 2} +-stringHash() <int stringHash () line:2177>
31 { 2} +-dbFileOpen() <FILE *dbFileOpen () line:2929>
32 { 3} | +-getenv()
33 { 3} | +-fprintf()
34 { 3} | +-exit()
35 { 3} | +-halloc() <char *halloc () line:2070> [see 8]
36 { 3} | +-strcpy()
37 { 3} | +-strcat()
38 { 3} | \-fopen()
39 { 2} +-readHtFile() <void readHtFile () line:10468>
40 { 3} | +-initScanner() <void initScanner () line:2343>
41 { 4} | | +-getenv()
42 { 4} | | \-strcmp()
43 { 3} | +-strlen()
44 { 3} | +-getc()
45 { 3} | +-getFilename() <int getFilename () line:10795>
46 { 4} | | +-getChar() <int getChar () line:2490>
47 { 5} | | | \-getChar1() <int getChar1 () line:2433>
48 { 6} | | | +-getc()
49 { 6} | | | +-get_int()
50 { 6} | | | +-spadErrorHandler()
| | | | <void spadErrorHandler () line:1864>
51 { 7} | | | | +-longjmp()
52 { 7} | | | | +-fprintf()
53 { 7} | | | | \-exit()
54 { 6} | | | +-get_string_buf()
55 { 6} | | | \-fprintf()
56 { 4} | | +-whitespace()
57 { 4} | | +-fprintf()
58 { 4} | | +-exit()
59 { 4} | | +-filedelim()
60 { 4} | | \-ungetChar() <void ungetChar () line:2400>
61 { 3} | +-allocString() <char *allocString () line:2189>
62 { 4} | +-halloc() <char *halloc () line:2070> [see 8]
63 { 4} | +-strlen()
64 { 4} | \-strcpy()
65 { 3} | +-strcpy()
66 { 3} | +-strcat()
67 { 3} | +-free()
68 { 3} | +-hashFind() <char *hashFind () line:2139>
69 { 3} | +-hashInsert() <void hashInsert () line:2104> [see 24]
70 { 3} | +-stat()
71 { 3} | +-sprintf()
72 { 3} | +-perror()
73 { 3} | +-exit()
74 { 3} | +-getToken() <int getToken () line:2535> (R)
75 { 4} | | +-strcpy()
76 { 4} | | +-free()
77 { 4} | | +-getChar() <int getChar () line:2490> [see 46]
78 { 4} | | +-whitespace()
79 { 4} | | +-ungetChar() <void ungetChar () line:2400> [see 60]
80 { 4} | | +-getToken() <int getToken () line:2535>
| | |(recursive: see 74) [see 74]
81 { 4} | | +-isalpha()
82 { 4} | | +-keywordType() <int keywordType () line:2865> (R)
83 { 5} | | +-hashFind() <char *hashFind () line:2139> [see 68]
84 { 5} | | +-beginType() <int beginType () line:2803> (R)
85 { 6} | | +-beType() <int beType () line:2735> (R)
86 { 7} | | +-getExpectedToken()
| | | <void getExpectedToken () line:2406> (R)
87 { 8} | | +-getToken()
| | | <int getToken () line:2535>
| | | (recursive: see 74) [see 74]
88 { 8} | | +-tokenName() <void tokenName () line:2204>
89 { 9} | | | +-strcpy()
90 { 9} | | | \-sprintf()
91 { 8} | | +-fprintf()
92 { 8} | | +-printPageAndFilename()
| | | <void printPageAndFilename () line:2286>
93 { 9} | | | +-sprintf()
94 { 9} | | | \-fprintf()
95 { 8} | | +-printNextTenTokens()
| | | <void printNextTenTokens () line:2313> (R)
96 { 9} | | | +-fprintf()
97 { 9} | | | +-getToken()
| | | | <int getToken () line:2535>
| | | | (recursive: see 74) [see 74]
98 { 9} | | | \-printToken() <void printToken () line:2276>
99 { 10} | | | +-printf()
100 { 10} | | | +-tokenName()
| | | <void tokenName () line:2204> [see 88]
101 { 10} | | | \-fflush()
102 { 8} | | +-longjmp()
103 { 8} | | \-exit()
104 { 7} | | \-strcmp()
105 { 6} | | +-fprintf()
106 { 6} | | +-printPageAndFilename()
| | | <void printPageAndFilename () line:2286> [see 92]
107 { 6} | | +-printNextTenTokens()
| | | <void printNextTenTokens () line:2313> (R) [see 95]
108 { 6} | | +-jump() <void jump () line:2196>
109 { 7} | | +-exit()
110 { 7} | | +-longjmp()
111 { 7} | | \-fprintf()
112 { 6} | | \-pushBeStack() <void pushBeStack () line:2689>
113 { 7} | | +-halloc() <char *halloc () line:2070> [see 8]
114 { 7} | | \-allocString()
| | <char *allocString () line:2189> [see 61]
115 { 5} | | \-endType() <int endType () line:2828> (R)
116 { 6} | | +-beType() <int beType () line:2735> (R) [see 85]
117 { 6} | | +-fprintf()
118 { 6} | | +-printPageAndFilename()
| | | <void printPageAndFilename () line:2286> [see 92]
119 { 6} | | +-printNextTenTokens()
| | | <void printNextTenTokens () line:2313> (R) [see 95]
120 { 6} | | +-jump() <void jump () line:2196> [see 108]
121 { 6} | | \-checkAndPopBeStack()
| | <void checkAndPopBeStack () line:2711> (R)
122 { 7} | | +-fprintf()
123 { 7} | | +-printPageAndFilename()
| | | <void printPageAndFilename () line:2286> [see 92]
124 { 7} | | +-printNextTenTokens()
| | | <void printNextTenTokens () line:2313>
| | | (R) [see 95]
125 { 7} | | +-jump() <void jump () line:2196> [see 108]
126 { 7} | | \-free()
127 { 4} | | +-isdigit()
128 { 4} | | \-delim()
129 { 3} | +-atoi()
130 { 3} | +-fprintf()
131 { 3} | +-ungetc()
132 { 3} | +-halloc() <char *halloc () line:2070> [see 8]
133 { 3} | +-strcmp()
134 { 3} | +-allocPatchstore()
| | <PatchStore *allocPatchstore () line:9668>
135 { 4} | | \-halloc() <char *halloc () line:2070> [see 8]
136 { 3} | \-freePatch() <void freePatch () line:9675>
137 { 4} | \-free()
138 { 2} +-fclose()
139 { 2} +-fprintf()
140 { 2} +-exit()
141 { 2} +-freeHash() <void freeHash () line:2160>
142 { 3} \-free()
143 { 2} \-freeString() <void freeString () line:9589>
144 { 3} \-freeIfNonNULL() <void freeIfNonNULL () line:9201>
145 { 4} \-free()
146 { 1} +-initializeWindowSystem()
| <void initializeWindowSystem () line:7819>
147 { 2} | +-XOpenDisplay()
148 { 2} | +-fprintf()
149 { 2} | +-exit()
150 { 2} | +-DefaultScreen()
151 { 2} | +-XGContextFromGC()
152 { 2} | +-DefaultGC()
153 { 2} | +-DefaultColormap()
154 { 2} | +-WhitePixel()
155 { 2} | +-XQueryColor()
156 { 2} | +-BlackPixel()
157 { 2} | +-XCreateBitmapFromData()
158 { 2} | +-RootWindow()
159 { 2} | +-XCreatePixmapCursor()
160 { 2} | +-XCreateFontCursor()
161 { 2} | +-ingItColorsAndFonts()
| | <void ingItColorsAndFonts () line:8206>
162 { 3} | | +-DefaultColormap()
163 { 3} | | +-initGroupStack() <void initGroupStack () line:7325>
164 { 4} | | | \-halloc() <char *halloc () line:2070> [see 8]
165 { 3} | | +-mergeDatabases() <void mergeDatabases () line:8427>
166 { 4} | | | +-XrmInitialize()
167 { 4} | | | +-strcpy()
168 { 4} | | | +-strcat()
169 { 4} | | | +-XrmGetFileDatabase()
170 { 4} | | | +-XrmMergeDatabases()
171 { 4} | | | +-XResourceManagerString()
172 { 4} | | | +-XrmGetStringDatabase()
173 { 4} | | | +-getenv()
174 { 4} | | | +-strlen()
175 { 4} | | | \-gethostname()
176 { 3} | | +-XrmGetResource()
177 { 3} | | +-strncpy()
178 { 3} | | +-strcpy()
179 { 3} | | +-loadFont() <void loadFont () line:8193>
180 { 4} | | +-XLoadQueryFont()
181 { 4} | | +-fprintf()
182 { 4} | | +-XQueryFont()
183 { 4} | | +-XGContextFromGC()
184 { 4} | | +-DefaultGC()
185 { 4} | | \-exit()
186 { 3} | | +-isIt850() <int isIt850 () line:8470>
187 { 4} | | +-XInternAtom()
188 { 4} | | +-XGetAtomName()
189 { 4} | | +-strcmp()
190 { 4} | | \-XFree()
191 { 3} | | +-DisplayPlanes()
192 { 3} | | +-BlackPixel()
193 { 3} | | +-WhitePixel()
194 { 3} | | +-getColor() <int getColor () line:8384>
195 { 4} | | | +-printf()
196 { 4} | | | +-strcpy()
197 { 4} | | | +-strcat()
198 { 4} | | | +-XrmGetResource()
199 { 4} | | | +-strncpy()
200 { 4} | | | +-XAllocNamedColor()
201 { 4} | | | \-fprintf()
202 { 3} | | \-makeColors()
203 { 2} | \-initText() <void initText () line:6865>
204 { 1} +-initKeyin() <void initKeyin () line:8876>
205 { 2} | +-getModifierMask()
| \ <unsigned int getModifierMask () line:8852>
206 { 3} | +-XGetModifierMapping()
207 { 3} | +-XKeysymToKeycode()
208 { 3} | \-XFreeModifiermap()
209 { 2} | +-XTextWidth()
210 { 2} | +-XGetDefault()
211 { 2} | +-halloc() <char *halloc () line:2070> [see 8]
212 { 2} | +-strlen()
213 { 2} | \-strcpy()
214 { 1} +-initTopWindow() <int initTopWindow () line:7871>
215 { 2} +-allocHdWindow() <HDWindow *allocHdWindow () line:9207>
216 { 3} +-halloc() <char *halloc () line:2070> [see 8]
217 { 3} +-initPageStructs() <void initPageStructs () line:3029>
218 { 3} +-hashInit() <void hashInit () line:2091> [see 7]
219 { 3} +-stringEqual() <int stringEqual () line:2185> [see 14]
220 { 3} +-stringHash() <int stringHash () line:2177>
221 { 3} +-hashCopyTable() <HashTable *hashCopyTable () line:2915>
222 { 4} +-halloc() <char *halloc () line:2070> [see 8]
223 { 4} \-hashCopyEntry()
<HashEntry *hashCopyEntry () line:2903> (R)
224 { 5} +-halloc() <char *halloc () line:2070> [see 8]
225 { 5} \-hashCopyEntry()
<HashEntry *hashCopyEntry () line:2903>
(recursive: see 223) [see 223]
226 { 3} \-makeSpecialPages() <void makeSpecialPages () line:10720>
227 { 4} +-hashInsert() <void hashInsert () line:2104> [see 24]
228 { 4} \-makeSpecialPage()
<HyperDocPage *makeSpecialPage () line:10708>
229 { 5} +-allocPage() <HyperDocPage *allocPage () line:9472>
230 { 6} +-halloc() <char *halloc () line:2070> [see 8]
231 { 6} \-allocString()
<char *allocString () line:2189> [see 61]
232 { 5} +-fprintf()
233 { 5} +-exit()
234 { 5} \-free()
235 { 2} +-allocPage() <HyperDocPage *allocPage () line:9472> [see 229]
236 { 2} +-hashFind() <char *hashFind () line:2139> [see 68]
237 { 2} +-fprintf()
238 { 2} +-exit()
239 { 2} +-openWindow() <void openWindow () line:8050>
240 { 3} | +-strcpy()
241 { 3} | +-XrmGetResource()
242 { 3} | +-strncpy()
243 { 3} | +-XGeometry()
244 { 3} | +-getBorderProperties()
| | <int getBorderProperties () line:8023>
245 { 4} | | +-atoi()
246 { 4} | | +-fprintf()
247 { 4} | | +-DisplayPlanes()
248 { 4} | | +-BlackPixel()
249 { 4} | | +-DefaultColormap()
250 { 4} | | \-getColor() <int getColor () line:8384> [see 194]
251 { 3} | +-XCreateSimpleWindow()
252 { 3} | +-RootWindow()
253 { 3} | +-WhitePixel()
254 { 3} | +-makeScrollBarWindows()
| | <void makeScrollBarWindows () line:12390>
255 { 4} | | +-fprintf()
256 { 4} | | +-exit()
257 { 4} | | +-XCreatePixmapFromBitmapData()
258 { 4} | | +-RootWindow()
259 { 4} | | +-DefaultDepth()
260 { 4} | | +-XCreateSimpleWindow()
261 { 4} | | \-XChangeWindowAttributes()
262 { 3} | +-makeTitleBarWindows()
| | <void makeTitleBarWindows () line:14315>
263 { 4} | | +-readTitleBarImages()
| | <void readTitleBarImages () line:14433>
264 { 5} | | +-getenv()
265 { 5} | | +-sprintf()
266 { 5} | | \-HTReadBitmapFile()
| | <XImage *HTReadBitmapFile () line:12233>
267 { 6} | | +-XCreateImage()
268 { 6} | | +-DefaultVisual()
269 { 6} | | +-zzopen()
270 { 6} | | +-fprintf()
271 { 6} | | +-exit()
272 { 6} | | +-readWandH() <int readWandH () line:12343>
273 { 7} | | | +-fgets()
274 { 7} | | | \-sscanf()
275 { 6} | | +-fgets()
276 { 6} | | +-readHot() <int readHot () line:12327>
277 { 7} | | | +-sscanf()
278 { 7} | | | \-fgets()
279 { 6} | | +-sscanf()
280 { 6} | | +-halloc() <char *halloc () line:2070> [see 8]
281 { 6} | | +-fscanf()
282 { 6} | | \-fclose()
283 { 4} | | +-XCreateSimpleWindow()
284 { 4} | | \-XChangeWindowAttributes()
285 { 3} | +-setNameAndIcon() <void setNameAndIcon () line:7996>
286 { 4} | | +-ch() <int ch () line:12776>
287 { 4} | | +-strlen()
288 { 4} | | +-XSetClassHint()
289 { 4} | | +-XStoreName()
290 { 4} | | +-XCreateBitmapFromData()
291 { 4} | | +-XSetWMHints()
292 { 4} | | \-XSetIconName()
293 { 3} | +-setSizeHints() <void setSizeHints () line:8091>
294 { 4} | | +-strcpy()
295 { 4} | | +-XGetGeometry()
296 { 4} | | +-getWindowPositionXY()
297 { 4} | | +-fprintf()
298 { 4} | | +-XrmGetResource()
299 { 4} | | +-strncpy()
300 { 4} | | +-XParseGeometry()
301 { 4} | | +-XGeometry()
302 { 4} | | +-getTitleBarMinimumSize()
| | <void getTitleBarMinimumSize () line:14470>
303 { 4} | | +-XSetNormalHints()
304 { 4} | | \-XFlush()
305 { 3} | +-XSelectInput()
306 { 3} | \-XDefineCursor()
307 { 2} +-getGCs() <void getGCs () line:8161>
308 { 3} | +-XCreateGC()
309 { 3} | +-XSetLineAttributes()
310 { 3} | +-XCreateBitmapFromData()
311 { 3} | +-RootWindow()
312 { 3} | +-XSetFont()
313 { 3} | +-XSetBackground()
314 { 3} | \-XSetForeground()
315 { 2} +-XMapWindow()
316 { 2} +-hashInsert() <void hashInsert () line:2104> [see 24]
317 { 2} +-changeText() <void changeText () line:8372>
318 { 3} +-XChangeGC()
319 { 3} \-XSetFont()
320 { 2} \-XChangeWindowAttributes()
321 { 1} +-fprintf()
322 { 1} +-exit()
323 { 1} +-bsdSignal()
324 { 1} +-sigusr2Handler() <void sigusr2Handler () line:2998>
325 { 1} +-sigcldHandler() <void sigcldHandler () line:3003>
326 { 2} \-wait()
327 { 1} +-makeServerConnections()
| <void makeServerConnections () line:3089>
328 { 2} | +-open_server()
329 { 2} | +-fprintf()
330 { 2} | +-atexit()
331 { 2} | +-cleanSocket() <void cleanSocket () line:3008>
332 { 3} | +-make_server_name()
333 { 3} | \-unlink()
334 { 2} | +-connect_to_local_server()
335 { 2} | \-exit()
336 { 1} +-ht2Input() <void ht2Input () line:7475>
337 { 2} | +-bsdSignal()
338 { 2} | +-allocHdWindow()
| | <HDWindow *allocHdWindow () line:9207> [see 215]
339 { 2} | +-initGroupStack()
| | <void initGroupStack () line:7325> [see 163]
340 { 2} | +-makeInputFileList() <void makeInputFileList () line:7670>
341 { 3} | +-makeInputFileName() <char *makeInputFileName () line:7494>
342 { 4} | +-strcpy()
343 { 4} | \-strlen()
344 { 3} | +-halloc() <char *halloc () line:2070> [see 8]
345 { 3} | +-strlen()
346 { 3} | \-strcpy()
347 { 2} | +-makeTheInputFile() <void makeTheInputFile () line:7516>
348 { 3} | +-makeInputFileName()
| | <char *makeInputFileName () line:7494> [see 341]
349 { 3} | +-inListAndNewer() <int inListAndNewer () line:7618>
350 { 4} | | +-strcmp()
351 { 4} | | +-strCopy() <char *strCopy () line:7612>
352 { 5} | | | +-halloc() <char *halloc () line:2070> [see 8]
353 { 5} | | | +-strlen()
354 { 5} | | | \-strcpy()
355 { 4} | | +-stat()
356 { 4} | | +-printf()
357 { 4} | | \-unlink()
358 { 3} | +-printf()
359 { 3} | +-setjmp()
360 { 3} | +-loadPage() <void loadPage () line:9758>
361 { 4} | | +-initScanner() <void initScanner () line:2343> [see 40]
362 { 4} | | \-formatPage() <HyperDocPage *formatPage () line:9805>
363 { 5} | | +-allocPage()
| | | <HyperDocPage *allocPage () line:9472> [see 229]
364 { 5} | | +-hashReplace() <char *hashReplace () line:2148>
365 { 5} | | +-findFp() <FILE *findFp () line:10878>
366 { 6} | | | +-hashFind() <char *hashFind () line:2139> [see 68]
367 { 6} | | | +-htFileOpen() <FILE *htFileOpen () line:2041>
368 { 7} | | | | +-buildHtFilename()
| | | | | <int buildHtFilename () line:1946>
369 { 8} | | | | | +-cwd()
370 { 8} | | | | | +-getcwd()
371 { 8} | | | | | +-strcpy()
372 { 8} | | | | | +-strcat()
373 { 8} | | | | | +-strlen()
374 { 8} | | | | | +-fprintf()
375 { 8} | | | | | +-exit()
376 { 8} | | | | | +-extendHT() <void extendHT () line:1938>
377 { 9} | | | | | | +-strpostfix() <int strpostfix () line:1928>
378 { 10} | | | | | | | \-strlen()
379 { 9} | | | | | | \-strcat()
380 { 8} | | | | | +-access()
381 { 8} | | | | | +-pathname() <int pathname () line:1913>
382 { 8} | | | | | +-getenv()
383 { 8} | | | | | +-halloc() <char *halloc () line:2070> [see 8]
384 { 8} | | | | | \-strcmp()
385 { 7} | | | | +-fprintf()
386 { 7} | | | | +-exit()
387 { 7} | | | | +-fopen()
388 { 7} | | | | \-perror()
389 { 6} | | | +-hashInsert() <void hashInsert () line:2104> [see 24]
390 { 6} | | | +-fseek()
391 { 6} | | | +-perror()
392 { 6} | | | \-longjmp()
393 { 5} | | +-allocString()
| | | <char *allocString () line:2189> [see 61]
394 { 5} | | \-parsePage() <void parsePage () line:9917>
395 { 6} | | +-initParsePage() <void initParsePage () line:9882>
396 { 7} | | | +-freeInputList() <void freeInputList () line:9620>
397 { 8} | | | +-freeInputItem()
| | | | <void freeInputItem () line:9613>
398 { 9} | | | | +-freeIfNonNULL()
| | | | | <void freeIfNonNULL () line:9201> [see 144]
399 { 9} | | | | +-freeLines() <void freeLines () line:9601>
400 { 10} | | | | | \-free()
401 { 9} | | | | \-XDestroyWindow()
402 { 8} | | | \-free()
403 { 7} | | | +-initTopGroup() <void initTopGroup () line:7392>
404 { 8} | | | | +-popGroupStack() <int popGroupStack () line:7294>
405 { 9} | | | | +-free()
406 { 9} | | | | \-changeText() <void changeText () line:8372>
| | | | [see 317]
407 { 8} | | | | \-changeText() <void changeText () line:8372>
| | | | [see 317]
408 { 7} | | | +-clearBeStack() <int clearBeStack () line:2700>
409 { 8} | | | \-free()
410 { 7} | | | +-hashInit() <void hashInit () line:2091> [see 7]
411 { 7} | | | +-windowEqual() <int windowEqual () line:10409>
412 { 7} | | | \-windowCode() <int windowCode () line:10413>
413 { 6} | | +-getExpectedToken()
| | | <void getExpectedToken () line:2406> (R) [see 86]
414 { 6} | | +-allocString()
| | | <char *allocString () line:2189> [see 61]
415 { 6} | | +-parseTitle() <void parseTitle () line:9833>
416 { 7} | | | +-PushMR() <void PushMR () line:9734>
417 { 8} | | | \-halloc() <char *halloc () line:2070> [see 8]
418 { 7} | | | +-getExpectedToken()
| | | <void getExpectedToken () line:2406> (R) [see 86]
419 { 7} | | | +-allocNode() <TextNode *allocNode () line:9265>
420 { 8} | | | \-halloc() <char *halloc () line:2070> [see 8]
421 { 7} | | | +-parseHyperDoc()
| | | <void parseHyperDoc () line:9938> (R)
422 { 8} | | | +-getToken() <int getToken () line:2535>
| | | | (R) [see 74]
423 { 8} | | | +-parseSpadsrc()
| | | <void parseSpadsrc () line:12034> (R)
424 { 9} | | | +-allocNode() <TextNode *allocNode () line:9265>
| | | | [see 419]
425 { 9} | | | +-getChar() <int getChar () line:2490> [see 46]
426 { 9} | | | +-parseVerbatim()
| | | <void parseVerbatim () line:11849>
427 { 10} | | | +-getChar()
| | | | <int getChar () line:2490> [see 46]
428 { 10} | | | +-resizeVbuf()
429 { 10} | | | +-new_verb_node()
430 { 10} | | | +-fprintf()
431 { 10} | | | +-longjmp()
432 { 10} | | | +-strlen()
433 { 10} | | | +-allocString()
| | | | <char *allocString () line:2189> [see 61]
434 { 10} | | | \-allocNode()
| | | <TextNode *allocNode () line:9265> [see 419]
435 { 9} | | | +-parseFromString()
| | | <void parseFromString () line:9823> (R)
436 { 10} | | | +-saveScannerState()
| | | <void saveScannerState () line:2361>
437 { 11} | | | \-halloc() <char *halloc () line:2070>
| | | [see 8]
438 { 10} | | | +-parseHyperDoc()
| | | | <void parseHyperDoc () line:9938>
| | | | (recursive: see 421) [see 421]
439 { 10} | | | \-restoreScannerState()
| | | <void restoreScannerState () line:2377>
440 { 11} | | | +-fprintf()
441 { 11} | | | +-exit()
442 { 11} | | | +-fseek()
443 { 11} | | | \-free()
444 { 9} | | | \-makeLinkWindow()
| | | <HyperLink *makeLinkWindow () line:10639>
445 { 10} | | | +-printToString()
| | | | <char *printToString () line:13497> (R)
446 { 11} | | | | +-printToString1()
| | | | <char *printToString1 () line:13504> (R)
447 { 12} | | | | +-storeChar()
448 { 12} | | | | +-checkCondition()
| | | | <int checkCondition () line:3217> (R)
449 { 13} | | | | +-hashFind()
| | | | | <char *hashFind () line:2139> [see 68]
450 { 13} | | | | +-strcmp()
451 { 13} | | | | +-send_int()
452 { 13} | | | | \-checkMemostack()
| | | | <int checkMemostack () line:3199>
453 { 14} | | | | +-printToString()
| | | | | <char *printToString () line:13497>
| | | | | (recursive: see 445) [see 445]
454 { 14} | | | | \-strcmp()
455 { 12} | | | | +-hashFind()
| | | | <char *hashFind () line:2139> [see 68]
456 { 12} | | | | +-fprintf()
457 { 12} | | | | +-exit()
458 { 12} | | | | +-returnItem()
| | | | | <InputItem *returnItem () line:8613>
459 { 13} | | | | | \-strcmp()
460 { 12} | | | | +-funnyUnescape()
461 { 12} | | | | +-atoi()
462 { 12} | | | | \-strlen()
463 { 11} | | | | \-resizeBuffer()
| | | | <char *resizeBuffer () line:9718>
464 { 12} | | | | +-halloc()
| | | | | <char *halloc () line:2070> [see 8]
465 { 12} | | | | +-memset()
466 { 12} | | | | +-memcpy()
467 { 12} | | | | \-free()
468 { 10} | | | +-hashFind()
| | | | <char *hashFind () line:2139> [see 68]
469 { 10} | | | +-printf()
470 { 10} | | | +-halloc()
| | | | <char *halloc () line:2070> [see 8]
471 { 10} | | | +-fprintf()
472 { 10} | | | +-exit()
473 { 10} | | | +-XCreateWindow()
474 { 10} | | | \-hashInsert()
| | | <void hashInsert () line:2104> [see 24]
475 { 8} | | | +-parseHelp()
| | | <void parseHelp () line:12211> (R)
476 { 9} | | | +-getToken()
| | | | <int getToken () line:2535> (R) [see 74]
477 { 9} | | | +-tokenName()
| | | | <void tokenName () line:2204> [see 88]
478 { 9} | | | +-fprintf()
479 { 9} | | | +-printPageAndFilename()
| | | | <void printPageAndFilename () line:2286>
| | | | [see 92]
480 { 9} | | | +-jump() <void jump () line:2196> [see 108]
481 { 9} | | | +-free()
482 { 9} | | | +-allocString()
| | | | <char *allocString () line:2189> [see 61]
483 { 9} | | | \-getInputString()
| | | <char *getInputString () line:10837> (R)
484 { 10} | | | +-allocNode()
| | | | <TextNode *allocNode () line:9265> [see 419]
485 { 10} | | | +-parseHyperDoc()
| | | | <void parseHyperDoc () line:9938>
| | | | (recursive: see 421) [see 421]
486 { 10} | | | +-printToString()
| | | | <char *printToString () line:13497>
| | | | (R) [see 445]
487 { 10} | | | \-freeNode() <void freeNode () line:9281> (R)
488 { 11} | | | +-freePastearea()
| | | | <void freePastearea () line:9572>
489 { 12} | | | | +-hashFind()
| | | | | <char *hashFind () line:2139> [see 68]
490 { 12} | | | | +-hashDelete()
| | | | | <void hashDelete () line:2118>
491 { 12} | | | | +-freePaste()
| | | | | <void freePaste () line:9539>
492 { 13} | | | | | +-freeGroupStack()
| | | | | | <void freeGroupStack () line:7429>
493 { 14} | | | | | | \-free()
494 { 13} | | | | | +-freeItemStack()
| | | | | | <void freeItemStack () line:8703>
495 { 14} | | | | | | \-free()
496 { 13} | | | | | +-freeNode()
| | | | | | <void freeNode () line:9281>
| | | | | | (recursive: see 487) [see 487]
497 { 13} | | | | | \-free()
498 { 12} | | | | \-freeIfNonNULL()
| | | | <void freeIfNonNULL () line:9201>
| | | | [see 144]
499 { 11} | | | +-freeNode() <void freeNode () line:9281>
| | | | (recursive: see 487) [see 487]
500 { 11} | | | +-freePastebutton()
| | | <void freePastebutton () line:9548>
501 { 12} | | | +-hashFind()
| | | | <char *hashFind () line:2139> [see 68]
502 { 12} | | | +-hashDelete()
| | | | <void hashDelete () line:2118> [see 490]
503 { 12} | | | +-freePaste()
| | | | <void freePaste () line:9539> [see 491]
504 { 12} | | | +-XDestroyWindow()
505 { 12} | | | \-freeIfNonNULL()
| | | <void freeIfNonNULL () line:9201>
| | | [see 144]
506 { 11} | | | +-freeIfNonNULL()
| | | | <void freeIfNonNULL () line:9201>
| | | | [see 144]
507 { 11} | | | +-deleteItem() <int deleteItem () line:8624>
508 { 12} | | | +-strcmp()
509 { 12} | | | +-currentItem()
| | | | <InputItem *currentItem () line:11291>
510 { 12} | | | +-freeInputItem()
| | | | <void freeInputItem () line:9613>
| | | | [see 397]
511 { 12} | | | +-free()
512 { 12} | | | \-fprintf()
513 { 11} | | | +-hashDelete()
| | | | <void hashDelete () line:2118> [see 490]
514 { 11} | | | +-XDestroyWindow()
515 { 11} | | | \-free()
516 { 8} | | | +-parsePaste() <void parsePaste () line:11365> (R)
517 { 9} | | | +-fprintf()
518 { 9} | | | +-printPageAndFilename()
| | | | <void printPageAndFilename () line:2286>
| | | | [see 92]
519 { 9} | | | +-jump() <void jump () line:2196> [see 108]
520 { 9} | | | +-getToken()
| | | | <int getToken () line:2535> (R) [see 74]
521 { 9} | | | +-printNextTenTokens()
| | | | <void printNextTenTokens () line:2313>
| | | | (R) [see 95]
522 { 9} | | | +-allocString()
| | | | <char *allocString () line:2189> [see 61]
523 { 9} | | | +-getInputString()
| | | | <char *getInputString () line:10837>
| | | | (R) [see 483]
524 { 9} | | | +-hashFind()
| | | | <char *hashFind () line:2139> [see 68]
525 { 9} | | | +-allocPasteNode()
| | | | <PasteNode *allocPasteNode () line:9656>
526 { 10} | | | | +-halloc() <char *halloc () line:2070> [see 8]
527 { 10} | | | | \-allocString()
| | | | <char *allocString () line:2189> [see 61]
528 { 9} | | | +-hashInsert()
| | | | <void hashInsert () line:2104> [see 24]
529 { 9} | | | +-currentItem()
| | | | <InputItem *currentItem () line:11291>
| | | | [see 509]
530 { 9} | | | +-getWhere() <int getWhere () line:10853>
531 { 10} | | | | +-getToken()
| | | | | <int getToken () line:2535> (R) [see 74]
532 { 10} | | | | \-strcmp()
533 { 9} | | | +-allocNode()
| | | | <TextNode *allocNode () line:9265> [see 419]
534 { 9} | | | \-parseHyperDoc()
| | | <void parseHyperDoc () line:9938>
| | | (recursive: see 421) [see 421]
535 { 8} | | | +-parsePastebutton()
| | | <void parsePastebutton () line:11445> (R)
536 { 9} | | | +-getToken()
| | | | <int getToken () line:2535> (R) [see 74]
537 { 9} | | | +-fprintf()
538 { 9} | | | +-printPageAndFilename()
| | | | <void printPageAndFilename () line:2286>
| | | | [see 92]
539 { 9} | | | +-printNextTenTokens()
| | | | <void printNextTenTokens () line:2313>
| | | | (R) [see 95]
540 { 9} | | | +-jump() <void jump () line:2196> [see 108]
541 { 9} | | | +-allocString()
| | | | <char *allocString () line:2189> [see 61]
542 { 9} | | | +-getInputString()
| | | | <char *getInputString () line:10837>
| | | | (R) [see 483]
543 { 9} | | | +-hashFind()
| | | | <char *hashFind () line:2139> [see 68]
544 { 9} | | | +-allocPasteNode()
| | | | <PasteNode *allocPasteNode () line:9656>
| | | | [see 525]
545 { 9} | | | +-hashInsert()
| | | | <void hashInsert () line:2104> [see 24]
546 { 9} | | | +-allocNode()
| | | | <TextNode *allocNode () line:9265> [see 419]
547 { 9} | | | +-parseHyperDoc()
| | | | <void parseHyperDoc () line:9938>
| | | | (recursive: see 421) [see 421]
548 { 9} | | | \-makePasteWindow()
| | | <HyperLink *makePasteWindow () line:10682>
549 { 10} | | | +-halloc() <char *halloc () line:2070> [see 8]
550 { 10} | | | +-fprintf()
551 { 10} | | | +-exit()
552 { 10} | | | +-XCreateWindow()
553 { 10} | | | \-hashInsert()
| | | <void hashInsert () line:2104> [see 24]
554 { 8} | | | +-endAPage() <void endAPage () line:10377>
555 { 9} | | | +-fprintf()
556 { 9} | | | +-printPageAndFilename()
| | | | <void printPageAndFilename () line:2286>
| | | | [see 92]
557 { 9} | | | +-jump() <void jump () line:2196> [see 108]
558 { 9} | | | \-PopMR() <void PopMR () line:9743>
559 { 10} | | | +-fprintf()
560 { 10} | | | +-exit()
561 { 10} | | | \-free()
562 { 8} | | | +-startFooter() <void startFooter () line:10352>
563 { 9} | | | +-fprintf()
564 { 9} | | | +-printPageAndFilename()
| | | | <void printPageAndFilename () line:2286>
| | | | [see 92]
565 { 9} | | | +-longjmp()
566 { 9} | | | +-PopMR() <void PopMR () line:9743> [see 558]
567 { 9} | | | +-linkScrollBars()
| | | | <void linkScrollBars () line:12640>
568 { 10} | | | | +-halloc() <char *halloc () line:2070> [see 8]
569 { 10} | | | | \-hashInsert()
| | | | <void hashInsert () line:2104> [see 24]
570 { 9} | | | +-PushMR() <void PushMR () line:9734> [see 416]
571 { 9} | | | \-allocNode()
| | | <TextNode *allocNode () line:9265> [see 419]
572 { 8} | | | +-startScrolling()
| | | <void startScrolling () line:10329>
573 { 9} | | | +-fprintf()
574 { 9} | | | +-longjmp()
575 { 9} | | | +-PopMR() <void PopMR () line:9743> [see 558]
576 { 9} | | | +-PushMR() <void PushMR () line:9734> [see 416]
577 { 9} | | | \-allocNode()
| | | <TextNode *allocNode () line:9265> [see 419]
578 { 8} | | | +-allocString()
| | | <char *allocString () line:2189> [see 61]
579 { 8} | | | +-parseNewcond() <void parseNewcond () line:11755>
580 { 9} | | | +-getExpectedToken()
| | | <void getExpectedToken () line:2406>
| | | (R) [see 86]
581 { 9} | | | +-strcpy()
582 { 9} | | | \-insertCond() <void insertCond () line:3172>
583 { 10} | | | +-hashFind()
| | | | <char *hashFind () line:2139> [see 68]
584 { 10} | | | +-fprintf()
585 { 10} | | | +-printPageAndFilename()
| | | | <void printPageAndFilename () line:2286>
| | | | [see 92]
586 { 10} | | | +-jump() <void jump () line:2196> [see 108]
587 { 10} | | | +-allocCondnode()
| | | | <CondNode *allocCondnode () line:9456>
588 { 11} | | | | \-halloc()
| | | | <char *halloc () line:2070> [see 8]
589 { 10} | | | +-halloc()
| | | | <char *halloc () line:2070> [see 8]
590 { 10} | | | +-strlen()
591 { 10} | | | +-strcpy()
592 { 10} | | | \-hashInsert()
| | | <void hashInsert () line:2104> [see 24]
593 { 8} | | | +-parseSetcond() <void parseSetcond () line:11765>
594 { 9} | | | +-getExpectedToken()
| | | <void getExpectedToken () line:2406>
| | | (R) [see 86]
595 { 9} | | | +-strcpy()
596 { 9} | | | \-changeCond() <void changeCond () line:3187>
597 { 10} | | | +-hashFind()
| | | | <char *hashFind () line:2139> [see 68]
598 { 10} | | | +-fprintf()
599 { 10} | | | +-free()
600 { 10} | | | +-halloc() <char *halloc () line:2070> [see 8]
601 { 10} | | | +-strlen()
602 { 10} | | | \-strcpy()
603 { 8} | | | +-parseVerbatim()
| | | <void parseVerbatim () line:11849> [see 426]
604 { 8} | | | +-parseIfcond()
| | | <void parseIfcond () line:11647> (R)
605 { 9} | | | +-fprintf()
606 { 9} | | | +-longjmp()
607 { 9} | | | +-exit()
608 { 9} | | | +-allocIfnode()
| | | | <IfNode *allocIfnode () line:9449>
609 { 10} | | | | \-halloc() <char *halloc () line:2070> [see 8]
610 { 9} | | | +-allocNode()
| | | | <TextNode *allocNode () line:9265> [see 419]
611 { 9} | | | +-parseCondnode()
| | | <void parseCondnode () line:11713>
612 { 10} | | | +-getToken()
| | | | <int getToken () line:2535> (R) [see 74]
613 { 10} | | | +-allocString()
| | | | <char *allocString () line:2189> [see 61]
614 { 10} | | | +-parseHasreturnto()
| | | | <void parseHasreturnto () line:11744>
615 { 11} | | | | +-allocNode()
| | | | | <TextNode *allocNode () line:9265>
| | | | | [see 419]
616 { 11} | | | | +-getExpectedToken()
| | | | | <void getExpectedToken () line:2406>
| | | | | (R) [see 86]
617 { 11} | | | | \-parseHyperDoc()
| | | | <void parseHyperDoc () line:9938>
| | | | (recursive: see 421) [see 421]
618 { 10} | | | +-tokenName()
| | | | <void tokenName () line:2204> [see 88]
619 { 10} | | | +-sprintf()
620 { 10} | | | \-tpderror() <void tpderror () line:2979>
621 { 11} | | | +-sprintf()
622 { 11} | | | +-fprintf()
623 { 11} | | | +-printPageAndFilename()
| | | | <void printPageAndFilename () line:2286>
| | | | [see 92]
624 { 11} | | | \-printNextTenTokens()
| | | <void printNextTenTokens () line:2313>
| | | (R) [see 95]
625 { 9} | | | +-parseHyperDoc()
| | | | <void parseHyperDoc () line:9938>
| | | | (recursive: see 421) [see 421]
626 { 9} | | | \-tokenName()
| | | <void tokenName () line:2204> [see 88]
627 { 8} | | | +-fprintf()
628 { 8} | | | +-longjmp()
629 { 8} | | | +-exit()
630 { 8} | | | +-parseMacro() <int parseMacro () line:9062> (R)
631 { 9} | | | +-allocNode()
| | | | <TextNode *allocNode () line:9265> [see 419]
632 { 9} | | | +-hashFind()
| | | | <char *hashFind () line:2139> [see 68]
633 { 9} | | | +-loadMacro() <char *loadMacro () line:8954>
634 { 10} | | | | +-saveScannerState()
| | | | | <void saveScannerState () line:2361>
| | | | | [see 436]
635 { 10} | | | | +-findFp()
| | | | | <FILE *findFp () line:10878> [see 365]
636 { 10} | | | | +-initScanner()
| | | | | <void initScanner () line:2343> [see 40]
637 { 10} | | | | +-getExpectedToken()
| | | | | <void getExpectedToken () line:2406>
| | | | | (R) [see 86]
638 { 10} | | | | +-strcmp()
639 { 10} | | | | +-fprintf()
640 { 10} | | | | +-longjmp()
641 { 10} | | | | +-getToken()
| | | | | <int getToken () line:2535> (R) [see 74]
642 { 10} | | | | +-number() <int number () line:8946>
643 { 11} | | | | | \-isdigit()
644 { 10} | | | | +-atoi()
645 { 10} | | | | +-scanHyperDoc()
| | | | | <void scanHyperDoc () line:8914>
646 { 11} | | | | | +-getToken()
| | | | | <int getToken () line:2535> (R) [see 74]
647 { 11} | | | | | +-fprintf()
648 { 11} | | | | | \-longjmp()
649 { 10} | | | | +-fseek()
650 { 10} | | | | +-halloc() <char *halloc () line:2070> [see 8]
651 { 10} | | | | +-getc()
652 { 10} | | | | \-restoreScannerState()
| | | | <void restoreScannerState () line:2377>
| | | | [see 439]
653 { 9} | | | +-getParameterStrings()
| | | | <void getParameterStrings () line:9098>
654 { 10} | | | | +-initParameterElem()
| | | | <ParameterList initParameterElem () line:9017>
655 { 11} | | | | | \-halloc() <char *halloc () line:2070>
| | | | | [see 8]
656 { 10} | | | | +-pushParameters()
| | | | | <int pushParameters () line:9034>
657 { 11} | | | | | +-fprintf()
658 { 11} | | | | | \-longjmp()
659 { 10} | | | | +-getToken()
| | | | | <int getToken () line:2535> (R) [see 74]
660 { 10} | | | | +-fprintf()
661 { 10} | | | | +-jump() <void jump () line:2196> [see 108]
662 { 10} | | | | +-getChar()
| | | | <int getChar () line:2490> [see 46]
663 { 10} | | | | +-longjmp()
664 { 10} | | | | +-numeric()
665 { 10} | | | | +-ungetChar()
| | | | <void ungetChar () line:2400> [see 60]
666 { 10} | | | | +-atoi()
667 { 10} | | | | +-strlen()
668 { 10} | | | | +-halloc() <char *halloc () line:2070> [see 8]
669 { 10} | | | | \-strcpy()
670 { 9} | | | +-parseFromString()
| | | | <void parseFromString () line:9823>
| | | | (R) [see 435]
671 { 9} | | | +-popParameters()
| | | | <int popParameters () line:9044>
672 { 10} | | | | \-free()
673 { 9} | | | +-fprintf()
674 { 9} | | | \-longjmp()
675 { 8} | | | +-parseEnv() <void parseEnv () line:12065>
676 { 9} | | | +-getExpectedToken()
| | | | <void getExpectedToken () line:2406>
| | | | (R) [see 86]
677 { 9} | | | +-getenv()
678 { 9} | | | +-fprintf()
679 { 9} | | | +-halloc() <char *halloc () line:2070> [see 8]
680 { 9} | | | +-strcpy()
681 { 9} | | | +-free()
682 { 9} | | | \-allocString()
| | | <char *allocString () line:2189> [see 61]
683 { 8} | | | +-windowId() <char *windowId () line:10417>
684 { 9} | | | +-sprintf()
685 { 9} | | | +-strlen()
686 { 9} | | | +-halloc() <char *halloc () line:2070> [see 8]
687 { 9} | | | \-strcpy()
688 { 8} | | | +-halloc() <char *halloc () line:2070> [see 8]
689 { 8} | | | +-strlen()
690 { 8} | | | +-sprintf()
691 { 8} | | | +-parseBeginItems()
| | | <void parseBeginItems () line:11779> (R)
692 { 9} | | | +-getToken()
| | | | <int getToken () line:2535> (R) [see 74]
693 { 9} | | | +-allocNode()
| | | | <TextNode *allocNode () line:9265> [see 419]
694 { 9} | | | +-parseHyperDoc()
| | | | <void parseHyperDoc () line:9938>
| | | | (recursive: see 421) [see 421]
695 { 9} | | | +-fprintf()
696 { 9} | | | +-printNextTenTokens()
| | | | <void printNextTenTokens () line:2313>
| | | | (R) [see 95]
697 { 9} | | | +-printPageAndFilename()
| | | | <void printPageAndFilename () line:2286>
| | | | [see 92]
698 { 9} | | | +-jump() <void jump () line:2196> [see 108]
699 { 9} | | | \-ungetToken() <void ungetToken () line:2427>
700 { 10} | | | \-allocString()
| | | <char *allocString () line:2189> [see 61]
701 { 8} | | | +-parseItem() <void parseItem () line:11807> (R)
702 { 9} | | | +-fprintf()
703 { 9} | | | +-printPageAndFilename()
| | | | <void printPageAndFilename () line:2286>
| | | | [see 92]
704 { 9} | | | +-printNextTenTokens()
| | | | <void printNextTenTokens () line:2313>
| | | | (R) [see 95]
705 { 9} | | | +-jump() <void jump () line:2196> [see 108]
706 { 9} | | | +-getToken()
| | | | <int getToken () line:2535> (R) [see 74]
707 { 9} | | | +-allocNode()
| | | | <TextNode *allocNode () line:9265> [see 419]
708 { 9} | | | +-parseHyperDoc()
| | | | <void parseHyperDoc () line:9938>
| | | | (recursive: see 421) [see 421]
709 { 9} | | | \-ungetToken()
| | | <void ungetToken () line:2427> [see 699]
710 { 8} | | | +-parseMitem() <void parseMitem () line:11839>
711 { 9} | | | +-fprintf()
712 { 9} | | | +-printPageAndFilename()
| | | | <void printPageAndFilename () line:2286>
| | | | [see 92]
713 { 9} | | | +-printNextTenTokens()
| | | | <void printNextTenTokens () line:2313>
| | | | (R) [see 95]
714 { 9} | | | \-jump() <void jump () line:2196> [see 108]
715 { 8} | | | +-parseValue1()
| | | <void parseValue1 () line:12091> (R)
716 { 9} | | | +-allocNode()
| | | | <TextNode *allocNode () line:9265> [see 419]
717 { 9} | | | +-getExpectedToken()
| | | | <void getExpectedToken () line:2406>
| | | | (R) [see 86]
718 { 9} | | | +-getInputString()
| | | | <char *getInputString () line:10837>
| | | | (R) [see 483]
719 { 9} | | | +-isNumber() <int isNumber () line:10772>
720 { 10} | | | | \-isdigit()
721 { 9} | | | +-fprintf()
722 { 9} | | | +-strcpy()
723 { 9} | | | \-allocString()
| | | <char *allocString () line:2189> [see 61]
724 { 8} | | | +-parseValue2()
| | | <void parseValue2 () line:12112> (R)
725 { 9} | | | +-allocNode()
| | | | <TextNode *allocNode () line:9265> [see 419]
726 { 9} | | | +-getExpectedToken()
| | | | <void getExpectedToken () line:2406>
| | | | (R) [see 86]
727 { 9} | | | +-getInputString()
| | | | <char *getInputString () line:10837>
| | | | (R) [see 483]
728 { 9} | | | +-isNumber()
| | | | <int isNumber () line:10772> [see 719]
729 { 9} | | | +-fprintf()
730 { 9} | | | +-strcpy()
731 { 9} | | | \-allocString()
| | | <char *allocString () line:2189> [see 61]
732 { 8} | | | +-pushGroupStack()
| | | | <void pushGroupStack () line:7312>
733 { 9} | | | | \-halloc() <char *halloc () line:2070> [see 8]
734 { 8} | | | +-allocNode()
| | | | <TextNode *allocNode () line:9265> [see 419]
735 { 8} | | | +-parseHyperDoc()
| | | | <void parseHyperDoc () line:9938>
| | | | (recursive: see 421) [see 421]
736 { 8} | | | +-popGroupStack()
| | | | <int popGroupStack () line:7294> [see 404]
737 { 8} | | | +-parseButton()
| | | | <void parseButton () line:11982> (R)
738 { 9} | | | | +-fprintf()
739 { 9} | | | | +-longjmp()
740 { 9} | | | | +-allocNode()
| | | | | <TextNode *allocNode () line:9265> [see 419]
741 { 9} | | | | +-getExpectedToken()
| | | | | <void getExpectedToken () line:2406>
| | | | | (R) [see 86]
742 { 9} | | | | +-parseHyperDoc()
| | | | | <void parseHyperDoc () line:9938>
| | | | | (recursive: see 421) [see 421]
743 { 9} | | | | \-makeLinkWindow()
| | | | <HyperLink *makeLinkWindow () line:10639>
| | | | [see 444]
744 { 8} | | | +-parseCommand()
| | | | <void parseCommand () line:11950> (R)
745 { 9} | | | | +-fprintf()
746 { 9} | | | | +-longjmp()
747 { 9} | | | | +-allocNode()
| | | | | <TextNode *allocNode () line:9265> [see 419]
748 { 9} | | | | +-getExpectedToken()
| | | | | <void getExpectedToken () line:2406>
| | | | | (R) [see 86]
749 { 9} | | | | +-parseHyperDoc()
| | | | | <void parseHyperDoc () line:9938>
| | | | | (recursive: see 421) [see 421]
750 { 9} | | | | \-makeLinkWindow()
| | | | <HyperLink *makeLinkWindow () line:10639>
| | | | [see 444]
751 { 8} | | | +-parseInputPix()
| | | | <void parseInputPix () line:11898> (R)
752 { 9} | | | | +-getExpectedToken()
| | | | | <void getExpectedToken () line:2406>
| | | | | (R) [see 86]
753 { 9} | | | | +-getInputString()
| | | | | <char *getInputString () line:10837>
| | | | | (R) [see 483]
754 { 9} | | | | +-allocString()
| | | | | <char *allocString () line:2189> [see 61]
755 { 9} | | | | +-DisplayPlanes()
756 { 9} | | | | +-strcpy()
757 { 9} | | | | +-strcat()
758 { 9} | | | | \-free()
759 { 8} | | | +-parseBox() <void parseBox () line:12176> (R)
760 { 9} | | | | +-allocNode()
| | | | | <TextNode *allocNode () line:9265> [see 419]
761 { 9} | | | | +-getExpectedToken()
| | | | | <void getExpectedToken () line:2406>
| | | | | (R) [see 86]
762 { 9} | | | | \-parseHyperDoc()
| | | | <void parseHyperDoc () line:9938>
| | | | (recursive: see 421) [see 421]
763 { 8} | | | +-parseMbox() <void parseMbox () line:12187> (R)
764 { 9} | | | | +-allocNode()
| | | | | <TextNode *allocNode () line:9265>
| | | | | [see 419]
765 { 9} | | | | +-getExpectedToken()
| | | | |<void getExpectedToken () line:2406>
| | | | |(R) [see 86]
766 { 9} | | | | \-parseHyperDoc()
| | | | <void parseHyperDoc () line:9938>
| | | | (recursive: see 421) [see 421]
767 { 8} | | | +-parseFree() <void parseFree () line:12198> (R)
768 { 9} | | | | +-allocNode()
| | | | | <TextNode *allocNode () line:9265> [see 419]
769 { 9} | | | | +-getExpectedToken()
| | | | | <void getExpectedToken () line:2406>
| | | | | (R) [see 86]
770 { 9} | | | | \-parseHyperDoc()
| | | | <void parseHyperDoc () line:9938>
| | | | (recursive: see 421) [see 421]
771 { 8} | | | +-parseCenterline()
| | | | <void parseCenterline () line:11932> (R)
772 { 9} | | | | +-allocNode()
| | | | | <TextNode *allocNode () line:9265> [see 419]
773 { 9} | | | | +-getExpectedToken()
| | | | | <void getExpectedToken () line:2406>
| | | | | (R) [see 86]
774 { 9} | | | | +-parseHyperDoc()
| | | | | <void parseHyperDoc () line:9938>
| | | | | (recursive: see 421) [see 421]
775 { 9} | | | | +-fprintf()
776 { 9} | | | | +-printPageAndFilename()
| | | | | <void printPageAndFilename () line:2286>
| | | | | [see 92]
777 { 9} | | | | +-printNextTenTokens()
| | | | | <void printNextTenTokens () line:2313>
| | | | | (R) [see 95]
778 { 9} | | | | \-longjmp()
779 { 8} | | | +-addDependencies()
| | | | <void addDependencies () line:10732> (R)
780 { 9} | | | | +-fprintf()
781 { 9} | | | | +-printPageAndFilename()
| | | | | <void printPageAndFilename () line:2286>
| | | | | [see 92]
782 { 9} | | | | +-exit()
783 { 9} | | | | +-allocNode()
| | | | | <TextNode *allocNode () line:9265> [see 419]
784 { 9} | | | | +-getExpectedToken()
| | | | | <void getExpectedToken () line:2406>
| | | | | (R) [see 86]
785 { 9} | | | | +-parseHyperDoc()
| | | | | <void parseHyperDoc () line:9938>
| | | | | (recursive: see 421) [see 421]
786 { 9} | | | | +-halloc() <char *halloc () line:2070> [see 8]
787 { 9} | | | | +-hashInit()
| | | | | <void hashInit () line:2091> [see 7]
788 { 9} | | | | +-stringEqual()
| | | | | <int stringEqual () line:2185> [see 14]
789 { 9} | | | | +-stringHash() <int stringHash () line:2177>
790 { 9} | | | | +-allocString()
| | | | | <char *allocString () line:2189> [see 61]
791 { 9} | | | | \-hashInsert()
| | | | <void hashInsert () line:2104> [see 24]
792 { 8} | | | +-parseSpadcommand()
| | | | <void parseSpadcommand () line:12018> (R)
793 { 9} | | | | +-getExpectedToken()
| | | | | <void getExpectedToken () line:2406>
| | | | | (R) [see 86]
794 { 9} | | | | +-allocNode()
| | | | | <TextNode *allocNode () line:9265> [see 419]
795 { 9} | | | | +-parseHyperDoc()
| | | | | <void parseHyperDoc () line:9938>
| | | | | (recursive: see 421) [see 421]
796 { 9} | | | | \-makeLinkWindow()
| | | | <HyperLink *makeLinkWindow () line:10639>
| | | | [see 444]
797 { 8} | | | +-parseTable() <void parseTable () line:12134> (R)
798 { 9} | | | | +-fprintf()
799 { 9} | | | | +-longjmp()
800 { 9} | | | | +-getExpectedToken()
| | | | | <void getExpectedToken () line:2406>
| | | | | (R) [see 86]
801 { 9} | | | | +-allocNode()
| | | | | <TextNode *allocNode () line:9265> [see 419]
802 { 9} | | | | +-getToken()
| | | | | <int getToken () line:2535> (R) [see 74]
803 { 9} | | | | +-parseHyperDoc()
| | | | | <void parseHyperDoc () line:9938>
| | | | | (recursive: see 421) [see 421]
804 { 9} | | | | +-tokenName()
| | | | | <void tokenName () line:2204> [see 88]
805 { 9} | | | | +-printPageAndFilename()
| | | | | <void printPageAndFilename () line:2286>
| | | | | [see 92]
806 { 9} | | | | +-jump() <void jump () line:2196> [see 108]
807 { 9} | | | | \-free()
808 { 8} | | | +-parseInputstring()
| | | | <void parseInputstring () line:10996> (R)
809 { 9} | | | | +-getExpectedToken()
| | | | | <void getExpectedToken () line:2406>
| | | | | (R) [see 86]
810 { 9} | | | | +-getInputString()
| | | | | <char *getInputString () line:10837>
| | | | | (R) [see 483]
811 { 9} | | | | +-allocString()
| | | | | <char *allocString () line:2189> [see 61]
812 { 9} | | | | +-atoi()
813 { 9} | | | | +-fprintf()
814 { 9} | | | | +-longjmp()
815 { 9} | | | | +-halloc() <char *halloc () line:2070> [see 8]
816 { 9} | | | | +-strlen()
817 { 9} | | | | +-strcpy()
818 { 9} | | | | +-initializeDefault()
| | | | | <void initializeDefault () line:10955>
819 { 10} | | | | | \-allocInputline()
| | | | | <LineStruct *allocInputline () line:9644>
820 { 11} | | | | | \-halloc()
| | | | | <char *halloc () line:2070> [see 8]
821 { 9} | | | | +-makeInputWindow()
| | | | <HyperLink *makeInputWindow () line:10900>
822 { 10} | | | | +-halloc() <char *halloc () line:2070> [see 8]
823 { 10} | | | | +-fprintf()
824 { 10} | | | | +-exit()
825 { 10} | | | | +-XCreateWindow()
826 { 10} | | | | +-XSelectInput()
827 { 10} | | | | \-hashInsert()
| | | | <void hashInsert () line:2104> [see 24]
828 { 9} | | | | \-insertItem() <void insertItem () line:11243>
829 { 8} | | | +-parseSimplebox()
| | | | <void parseSimplebox () line:11042> (R)
830 { 9} | | | | +-getToken()
| | | | | <int getToken () line:2535> (R) [see 74]
831 { 9} | | | | +-getExpectedToken()
| | | | | <void getExpectedToken () line:2406>
| | | | | (R) [see 86]
832 { 9} | | | | +-isNumber()
| | | | | <int isNumber () line:10772> [see 719]
833 { 9} | | | | +-fprintf()
834 { 9} | | | | +-printPageAndFilename()
| | | | | <void printPageAndFilename () line:2286>
| | | | | [see 92]
835 { 9} | | | | +-jump() <void jump () line:2196> [see 108]
836 { 9} | | | | +-strcmp()
837 { 9} | | | | +-tokenName()
| | | | | <void tokenName () line:2204> [see 88]
838 { 9} | | | | +-getInputString()
| | | | | <char *getInputString () line:10837>
| | | | | (R) [see 483]
839 { 9} | | | | +-hashFind()
| | | | | <char *hashFind () line:2139> [see 68]
840 { 9} | | | | +-allocInputbox()
| | | | | <InputBox *allocInputbox () line:9687>
841 { 10} | | | | | \-halloc() <char *halloc () line:2070> [see 8]
842 { 9} | | | | +-allocString()
| | | | | <char *allocString () line:2189> [see 61]
843 { 9} | | | | +-insertImageStruct()
| | | | | <ImageStruct *insertImageStruct () line:12365>
844 { 10} | | | | | +-hashFind()
| | | | | | <char *hashFind () line:2139> [see 68]
845 { 10} | | | | | +-HTReadBitmapFile()
| | | | | | <XImage *HTReadBitmapFile () line:12233>
| | | | | | [see 266]
846 { 10} | | | | | +-halloc() <char *halloc () line:2070> [see 8]
847 { 10} | | | | | +-strlen()
848 { 10} | | | | | +-sprintf()
849 { 10} | | | | | \-hashInsert()
| | | | | <void hashInsert () line:2104> [see 24]
850 { 9} | | | | +-max()
851 { 9} | | | | +-makeBoxWindow()
| | | | <HyperLink *makeBoxWindow () line:10929>
852 { 10} | | | | +-halloc() <char *halloc () line:2070> [see 8]
853 { 10} | | | | +-fprintf()
854 { 10} | | | | +-exit()
855 { 10} | | | | +-XCreateWindow()
856 { 10} | | | | +-XSelectInput()
857 { 10} | | | | \-hashInsert()
| | | | <void hashInsert () line:2104> [see 24]
858 { 9} | | | | +-halloc() <char *halloc () line:2070> [see 8]
859 { 9} | | | | +-hashInit()
| | | | | <void hashInit () line:2091> [see 7]
860 { 9} | | | | +-stringEqual()
| | | | | <int stringEqual () line:2185> [see 14]
861 { 9} | | | | +-stringHash() <int stringHash () line:2177>
862 { 9} | | | | \-hashInsert()
| | | | <void hashInsert () line:2104> [see 24]
863 { 8} | | | +-strcpy()
864 { 8} | | | +-strcat()
865 { 8} | | | +-parserError() <void parserError () line:10781>
866 { 9} | | | | +-fprintf()
867 { 9} | | | | +-getToken()
| | | | <int getToken () line:2535> (R) [see 74]
868 { 9} | | | | +-printToken()
| | | | <void printToken () line:2276> [see 98]
869 { 9} | | | | \-exit()
870 { 8} | | | +-getExpectedToken()
| | | <void getExpectedToken () line:2406>
| | | (R) [see 86]
871 { 8} | | | +-parseParameters()
| | | <void parseParameters () line:9182> (R)
872 { 9} | | | +-number() <int number () line:8946> [see 642]
873 { 9} | | | +-fprintf()
874 { 9} | | | +-longjmp()
875 { 9} | | | +-atoi()
876 { 9} | | | \-parseFromString()
| | | <void parseFromString () line:9823>
| | | (R) [see 435]
877 { 8} | | | +-parseRadiobox()
| | | <void parseRadiobox () line:11122> (R)
878 { 9} | | | +-getToken()
| | | | <int getToken () line:2535> (R) [see 74]
879 { 9} | | | +-getExpectedToken()
| | | | <void getExpectedToken () line:2406>
| | | | (R) [see 86]
880 { 9} | | | +-isNumber()
| | | | <int isNumber () line:10772> [see 719]
881 { 9} | | | +-fprintf()
882 { 9} | | | +-printPageAndFilename()
| | | | <void printPageAndFilename () line:2286>
| | | | [see 92]
883 { 9} | | | +-jump() <void jump () line:2196> [see 108]
884 { 9} | | | +-strcmp()
885 { 9} | | | +-tokenName()
| | | | <void tokenName () line:2204> [see 88]
886 { 9} | | | +-getInputString()
| | | | <char *getInputString () line:10837>
| | | | (R) [see 483]
887 { 9} | | | +-hashFind()
| | | | <char *hashFind () line:2139> [see 68]
888 { 9} | | | +-allocInputbox()
| | | | <InputBox *allocInputbox () line:9687>
| | | | [see 840]
889 { 9} | | | +-allocString()
| | | | <char *allocString () line:2189>
| | | | [see 61]
890 { 9} | | | +-addBoxToRbList()
| | | | <void addBoxToRbList () line:11206>
891 { 10} | | | | +-strcmp()
892 { 10} | | | | +-fprintf()
893 { 10} | | | | +-printPageAndFilename()
| | | | | <void printPageAndFilename () line:2286>
| | | | | [see 92]
894 { 10} | | | | +-jump() <void jump () line:2196> [see 108]
895 { 10} | | | | \-checkOthers()
| | | | <int checkOthers () line:11233>
896 { 9} | | | +-makeBoxWindow()
| | | | <HyperLink *makeBoxWindow () line:10929>
| | | | [see 851]
897 { 9} | | | +-halloc() <char *halloc () line:2070> [see 8]
898 { 9} | | | +-hashInit()
| | | | <void hashInit () line:2091> [see 7]
899 { 9} | | | +-stringEqual()
| | | | <int stringEqual () line:2185> [see 14]
900 { 9} | | | +-stringHash() <int stringHash () line:2177>
901 { 9} | | | \-hashInsert()
| | | <void hashInsert () line:2104> [see 24]
902 { 8} | | | +-parseRadioboxes()
| | | <void parseRadioboxes () line:11311> (R)
903 { 9} | | | +-allocRbs() <RadioBoxes *allocRbs () line:9695>
904 { 10} | | | | \-halloc() <char *halloc () line:2070> [see 8]
905 { 9} | | | +-getToken()
| | | | <int getToken () line:2535> (R) [see 74]
906 { 9} | | | +-tokenName()
| | | | <void tokenName () line:2204> [see 88]
907 { 9} | | | +-fprintf()
908 { 9} | | | +-printPageAndFilename()
| | | | <void printPageAndFilename () line:2286>
| | | | [see 92]
909 { 9} | | | +-jump() <void jump () line:2196> [see 108]
910 { 9} | | | +-allocString()
| | | | <char *allocString () line:2189> [see 61]
911 { 9} | | | +-getInputString()
| | | | <char *getInputString () line:10837>
| | | | (R) [see 483]
912 { 9} | | | +-alreadyThere()
| | | | <int alreadyThere () line:11301>
913 { 10} | | | | \-strcmp()
914 { 9} | | | +-free()
915 { 9} | | | +-insertImageStruct()
| | | |<ImageStruct *insertImageStruct () line:12365>
| | | |[see 843]
916 { 9} | | | \-max()
917 { 8} | | | +-parseReplacepage()
| | | | <void parseReplacepage () line:10402>
918 { 9} | | | | +-getExpectedToken()
| | | | | <void getExpectedToken () line:2406>
| | | | | (R) [see 86]
919 { 9} | | | | +-getToken()
| | | | | <int getToken () line:2535> (R) [see 74]
920 { 9} | | | | \-allocString()
| | | | <char *allocString () line:2189> [see 61]
921 { 8} | | | \-printPageAndFilename()
| | | <void printPageAndFilename () line:2286>
| | | [see 92]
922 { 7} | | | +-printToString()
| | | | <char *printToString () line:13497> (R) [see 445]
923 { 7} | | | +-XSetIconName()
924 { 7} | | | +-fprintf()
925 { 7} | | | +-printPageAndFilename()
| | | |<void printPageAndFilename () line:2286> [see 92]
926 { 7} | | | +-jump() <void jump () line:2196> [see 108]
927 { 7} | | | +-linkTitleBarWindows()
| | | | <void linkTitleBarWindows () line:14406>
928 { 8} | | | | +-halloc() <char *halloc () line:2070> [see 8]
929 { 8} | | | | \-hashInsert()
| | | | <void hashInsert () line:2104> [see 24]
930 { 7} | | | \-PopMR() <void PopMR () line:9743> [see 558]
931 { 6} | | \-parseHeader() <void parseHeader () line:9866>
932 { 7} | | +-PushMR() <void PushMR () line:9734> [see 416]
933 { 7} | | +-allocNode()
| | | <TextNode *allocNode () line:9265> [see 419]
934 { 7} | | \-parseHyperDoc()
| | <void parseHyperDoc () line:9938> (R) [see 421]
935 { 3} | \-makeInputFileFromPage()
| <void makeInputFileFromPage () line:7533>
936 { 4} | +-makeInputFileName()
| | <char *makeInputFileName () line:7494> [see 341]
937 { 4} | +-makePasteFileName()
| | <char *makePasteFileName () line:7505>
938 { 5} | | +-strcpy()
939 { 5} | | \-strlen()
940 { 4} | +-inListAndNewer()
| | <int inListAndNewer () line:7618> [see 349]
941 { 4} | +-fopen()
942 { 4} | +-fprintf()
943 { 4} | +-exit()
944 { 4} | +-sendLispCommand() <void sendLispCommand () line:13867>
945 { 5} | | +-connectSpad() <int connectSpad () line:1879>
946 { 6} | | +-fprintf()
947 { 6} | | +-LoudBeepAtTheUser()
948 { 6} | | \-connect_to_local_server()
949 { 5} | | +-send_int()
950 { 5} | | \-send_string()
951 { 4} | +-printToString()
| | <char *printToString () line:13497> (R) [see 445]
952 { 4} | +-allocString() <char *allocString () line:2189> [see 61]
953 { 4} | +-fflush()
954 { 4} | +-printPaste() <void printPaste () line:7762>
955 { 5} | | +-fprintf()
956 { 5} | | +-printPasteLine() <void printPasteLine () line:7680>
957 { 6} | | | \-putc()
958 { 5} | | +-getSpadOutput() <void getSpadOutput () line:7708>
959 { 6} | | | +-sendCommand() <void sendCommand () line:7739>
960 { 7} | | | | +-escapeString() <void escapeString () line:13877>
961 { 8} | | | | | \-funnyEscape()
962 { 7} | | | | +-sprintf()
963 { 7} | | | | +-sendLispCommand()
| | | | <void sendLispCommand () line:13867> [see 944]
964 { 7} | | | | +-getenv()
965 { 7} | | | | +-fopen()
966 { 7} | | | | +-fprintf()
967 { 7} | | | | \-fclose()
968 { 6} | | | +-get_int()
969 { 6} | | | +-get_string_buf()
970 { 6} | | | +-fprintf()
971 { 6} | | | \-unescapeString() <void unescapeString () line:13883>
972 { 7} | | | \-funnyUnescape()
973 { 5} | | \-fflush()
974 { 4} | +-printGraphPaste() <void printGraphPaste () line:7789>
975 { 5} | | +-fprintf()
976 { 5} | | +-printPasteLine()
| | | <void printPasteLine () line:7680> [see 956]
977 { 5} | | +-getGraphOutput() <void getGraphOutput () line:7720>
978 { 6} | | | +-sendCommand()
| | | | <void sendCommand () line:7739> [see 959]
979 { 6} | | | +-get_int()
980 { 6} | | | +-get_string_buf()
981 { 6} | | | +-unescapeString()
| | | | <void unescapeString () line:13883> [see 971]
982 { 6} | | | +-sprintf()
983 { 6} | | | \-sendLispCommand()
| | | <void sendLispCommand () line:13867> [see 944]
984 { 5} | | \-fflush()
985 { 4} | \-fclose()
986 { 2} | +-connectSpad() <int connectSpad () line:1879> [see 945]
987 { 2} | \-send_int()
988 { 1} +-makeRecord() <void makeRecord () line:7437>
989 { 2} | +-sendLispCommand()
| <void sendLispCommand () line:13867> [see 944]
990 { 2} | +-sprintf()
991 { 2} | +-fprintf()
992 { 2} | +-connectSpad() <int connectSpad () line:1879> [see 945]
993 { 2} | \-send_int()
994 { 1} +-verifyRecord() <void verifyRecord () line:7456>
995 { 2} | +-sendLispCommand()
| <void sendLispCommand () line:13867> [see 944]
996 { 2} | +-sprintf()
997 { 2} | +-fprintf()
998 { 2} | +-connectSpad() <int connectSpad () line:1879> [see 945]
999 { 2} | \-send_int()
1000 { 1} \-mainEventLoop() <void mainEventLoop () line:4552>
1001 { 2} +-setErrorHandlers() <void setErrorHandlers () line:5390>
1002 { 3} | +-XSetErrorHandler()
1003 { 3} | \-HyperDocErrorHandler()
| <int HyperDocErrorHandler () line:5375>
1004 { 4} | +-XGetErrorText()
1005 { 4} | +-fprintf()
1006 { 4} | \-exit()
1007 { 2} +-ConnectionNumber()
1008 { 2} +-pause()
1009 { 2} +-initCursorStates() <void initCursorStates () line:5363>
1010 { 3} +-hashMap() <void hashMap () line:2129>
1011 { 3} \-initCursorState() <void initCursorState () line:5350>
1012 { 4} +-XQueryPointer()
1013 { 4} +-findButtonInList()
| <HyperLink *findButtonInList () line:4929>
1014 { 4} \-changeCursor() <void changeCursor () line:5334>
1015 { 5} \-setCursor() <void setCursor () line:5324>
1016 { 6} +-XDefineCursor()
1017 { 6} \-XFlush()
1018 { 2} +-FD_ZERO()
1019 { 2} +-FD_CLR()
1020 { 2} +-FD_SET()
1021 { 2} +-XEventsQueued()
1022 { 2} +-XNextEvent()
1023 { 2} +-handleEvent() <void handleEvent () line:4622>
1024 { 3} | +-setWindow() <int setWindow () line:5155>
1025 { 4} | +-hashFind() <char *hashFind () line:2139> [see 68]
1026 { 4} | +-XQueryTree()
1027 { 4} | \-XFree()
1028 { 3} | +-handleMotionEvent() <void handleMotionEvent () line:5341>
1029 { 4} | +-findButtonInList()
| | <HyperLink *findButtonInList () line:4929> [see 1013]
1030 { 4} | \-changeCursor()
| <void changeCursor () line:5334> [see 1014]
1031 { 3} | +-makeBusyCursors() <void makeBusyCursors () line:5371>
1032 { 4} | +-hashMap() <void hashMap () line:2129> [see 1010]
1033 { 4} | \-makeBusyCursor() <void makeBusyCursor () line:5367>
1034 { 5} | \-changeCursor()
| <void changeCursor () line:5334> [see 1014]
1035 { 3} | +-XGetWindowAttributes()
1036 { 3} | +-displayPage() <void displayPage () line:9769>
1037 { 4} | +-XUnmapSubwindows()
1038 { 4} | +-XFlush()
1039 { 4} | +-setjmp()
1040 { 4} | +-freePage() <void freePage () line:9492>
1041 { 5} | +-freeNode() <void freeNode () line:9281> (R) [see 487]
1042 { 5} | +-freeButtonList() <void freeButtonList () line:9710>
1043 { 6} | | \-free()
1044 { 5} | +-freeHash() <void freeHash () line:2160> [see 141]
1045 { 5} | +-freeDepend() <void freeDepend () line:9593>
1046 { 6} | | \-freeIfNonNULL()
| | <void freeIfNonNULL () line:9201> [see 144]
1047 { 5} | +-dontFree() <void dontFree () line:9597>
1048 { 5} | +-freeInputBox() <void freeInputBox () line:9629>
1049 { 6} | | +-freeIfNonNULL()
| | <void freeIfNonNULL () line:9201> [see 144]
1050 { 6} | | \-free()
1051 { 5} | +-freeInputList()
| <void freeInputList () line:9620> [see 396]
1052 { 5} | +-freeRadioBoxes()
| <void freeRadioBoxes () line:9636> (R)
1053 { 6} | | +-freeRadioBoxes()
| <void freeRadioBoxes () line:9636>
| (recursive: see 1052) [see 1052]
1054 { 6} | | +-freeIfNonNULL()
| <void freeIfNonNULL () line:9201> [see 144]
1055 { 6} | | \-free()
1056 { 5} | \-free()
1057 { 4} | +-hashReplace() <char *hashReplace () line:2148> [see 364]
1058 { 4} | +-strcmp()
1059 { 4} | +-fprintf()
1060 { 4} | +-exit()
1061 { 4} | +-hashFind() <char *hashFind () line:2139> [see 68]
1062 { 4} | +-resetConnection() <void resetConnection () line:1897>
1063 { 5} | +-FD_CLR()
1064 { 5} | +-close()
1065 { 5} | \-connectSpad() <int connectSpad () line:1879> [see 945]
1066 { 4} | +-initScanner() <void initScanner () line:2343> [see 40]
1067 { 4} | +-formatPage()
| <HyperDocPage *formatPage () line:9805> [see 362]
1068 { 4} | \-showPage() <void showPage () line:4360>
1069 { 5} | +-initTopGroup()
| | <void initTopGroup () line:7392> [see 403]
1070 { 5} | +-XClearWindow()
1071 { 5} | +-freeButtonList()
| | <void freeButtonList () line:9710> [see 1042]
1072 { 5} | +-computeTitleExtent()
| | <void computeTitleExtent () line:6397>
1073 { 6} | | +-initTitleExtents()
| | <void initTitleExtents () line:6850>
1074 { 7} | | \-clearItemStack()
| | <void clearItemStack () line:8657>
1075 { 8} | | \-free()
1076 { 6} | | +-computeTextExtent()
| | | <void computeTextExtent () line:5580> (R)
1077 { 7} | | | +-endpastebuttonExtent()
| | | <void endpastebuttonExtent () line:6132>
1078 { 8} | | | +-textWidth() <int textWidth () line:6564>
1079 { 9} | | | +-punctuationWidth()
| | | <int punctuationWidth () line:6515>
1080 { 10} | | | +-strlen()
1081 { 10} | | | \-XTextWidth()
1082 { 9} | | | +-widthOfDash() <int widthOfDash () line:6551>
1083 { 10} | | | +-strlen()
1084 { 10} | | | \-XTextWidth()
1085 { 9} | | | +-verbatimWidth()
| | | <int verbatimWidth () line:6543>
1086 { 10} | | | +-strlen()
1087 { 10} | | | \-XTextWidth()
1088 { 9} | | | +-wordWidth() <int wordWidth () line:6535>
1089 { 10} | | | +-strlen()
1090 { 10} | | | \-XTextWidth()
1091 { 9} | | | +-pushActiveGroup()
| | | <void pushActiveGroup () line:7378>
1092 { 10} | | | +-pushGroupStack()
| | | | <void pushGroupStack () line:7312> [see 732]
1093 { 10} | | | \-changeText()
| | | <void changeText () line:8372> [see 317]
1094 { 9} | | | +-popGroupStack()
| | | <int popGroupStack () line:7294> [see 404]
1095 { 9} | | | +-inputStringWidth()
| | | <int inputStringWidth () line:6524>
1096 { 9} | | | +-pushSpadGroup()
| | | <void pushSpadGroup () line:7385>
1097 { 10} | | | +-pushGroupStack()
| | | | <void pushGroupStack () line:7312> [see 732]
1098 { 10} | | | \-changeText()
| | | <void changeText () line:8372> [see 317]
1099 { 9} | | | +-atoi()
1100 { 9} | | | +-pushGroupStack()
| | | <void pushGroupStack () line:7312> [see 732]
1101 { 9} | | | +-bfTopGroup() <void bfTopGroup () line:7359>
1102 { 10} | | | +-pushGroupStack()
| | | | <void pushGroupStack () line:7312> [see 732]
1103 { 10} | | | \-changeText()
| | | <void changeText () line:8372> [see 317]
1104 { 9} | | | +-emTopGroup() <void emTopGroup () line:7334>
1105 { 10} | | | | +-pushGroupStack()
| | | | | <void pushGroupStack () line:7312> [see 732]
1106 { 10} | | | | \-changeText()
| | | | <void changeText () line:8372> [see 317]
1107 { 9} | | | +-rmTopGroup() <void rmTopGroup () line:7342>
1108 { 10} | | | +-pushGroupStack()
| | | | <void pushGroupStack () line:7312> [see 732]
1109 { 10} | | | \-changeText()
| | | <void changeText () line:8372> [see 317]
1110 { 9} | | | +-insertBitmapFile()
| | | | <void insertBitmapFile () line:7131>
1111 { 10} | | | | +-hashFind()
| | | | | <char *hashFind () line:2139> [see 68]
1112 { 10} | | | | +-getenv()
1113 { 10} | | | | +-HTReadBitmapFile()
| | | | | <XImage *HTReadBitmapFile () line:12233>
| | | | | [see 266]
1114 { 10} | | | | +-halloc() <char *halloc () line:2070> [see 8]
1115 { 10} | | | | +-strlen()
1116 { 10} | | | | +-sprintf()
1117 { 10} | | | | \-hashInsert()
| | | | <void hashInsert () line:2104> [see 24]
1118 { 9} | | | \-insertPixmapFile()
| | | <void insertPixmapFile () line:7165>
1119 { 10} | | | +-hashFind()
| | | | <char *hashFind () line:2139> [see 68]
1120 { 10} | | | +-read_pixmap_file()
1121 { 10} | | | +-fprintf()
1122 { 10} | | | +-halloc() <char *halloc () line:2070> [see 8]
1123 { 10} | | | +-strlen()
1124 { 10} | | | +-sprintf()
1125 { 10} | | | +-hashInsert()
| | | | <void hashInsert () line:2104> [see 24]
1126 { 10} | | | \-plh() <int plh () line:7208>
1127 { 8} | | | +-textHeight() <int textHeight () line:6872>
1128 { 9} | | | \-textHeight1() <int textHeight1 () line:6877>
1129 { 10} | | | \-max()
1130 { 8} | | | +-startNewline() <void startNewline () line:6487>
1131 { 9} | | | \-centerNodes() <void centerNodes () line:6499>
1132 { 10} | | | \-Xvalue() <int Xvalue () line:7072> (R)
1133 { 11} | | | +-fprintf()
1134 { 11} | | | \-Xvalue()
| | | <int Xvalue () line:7072>
| | | (recursive: see 1132) [see 1132]
1135 { 8} | | | \-popGroupStack()
| | | <int popGroupStack () line:7294> [see 404]
1136 { 7} | | | +-computePasteExtent()
| | | <void computePasteExtent () line:6157>
1137 { 8} | | | \-startNewline()
| | | <void startNewline () line:6487> [see 1130]
1138 { 7} | | | +-startNewline()
| | | <void startNewline () line:6487> [see 1130]
1139 { 7} | | | +-computePastebuttonExtent()
| | | <void computePastebuttonExtent () line:6113>
1140 { 8} | | | +-pushActiveGroup()
| | | | <void pushActiveGroup () line:7378> [see 1091]
1141 { 8} | | | +-textWidth()
| | | | <int textWidth () line:6564> [see 1078]
1142 { 8} | | | \-startNewline()
| | | <void startNewline () line:6487> [see 1130]
1143 { 7} | | | +-computeIfcondExtent()
| | | <void computeIfcondExtent () line:5954>
1144 { 8} | | | +-pushGroupStack()
| | | | <void pushGroupStack () line:7312> [see 732]
1145 { 8} | | | +-computeTextExtent()
| | | | <void computeTextExtent () line:5580>
| | | | (recursive: see 1076) [see 1076]
1146 { 8} | | | +-checkCondition()
| | | | <int checkCondition () line:3217> (R) [see 448]
1147 { 8} | | | \-popGroupStack()
| | | <int popGroupStack () line:7294> [see 404]
1148 { 7} | | | +-endifExtent() <void endifExtent () line:5944>
1149 { 7} | | | +-popGroupStack()
| | | <int popGroupStack () line:7294> [see 404]
1150 { 7} | | | +-computePunctuationExtent()
| | | <void computePunctuationExtent () line:5423>
1151 { 8} | | | +-strlen()
1152 { 8} | | | +-XTextWidth()
1153 { 8} | | | +-totalWidth() <int totalWidth () line:6748>
1154 { 9} | | | +-XTextWidth()
1155 { 9} | | | \-strlen()
1156 { 8} | | | \-startNewline()
| | | <void startNewline () line:6487> [see 1130]
1157 { 7} | | | +-computeSpadsrctxtExtent()
| | | <void computeSpadsrctxtExtent () line:5522>
1158 { 8} | | | +-strlen()
1159 { 8} | | | \-startNewline()
| | | <void startNewline () line:6487> [see 1130]
1160 { 7} | | | +-computeWordExtent()
| | | <void computeWordExtent () line:5471>
1161 { 8} | | | +-strlen()
1162 { 8} | | | +-XTextWidth()
1163 { 8} | | | +-totalWidth()
| | | | <int totalWidth () line:6748> [see 1153]
1164 { 8} | | | \-startNewline()
| | | <void startNewline () line:6487> [see 1130]
1165 { 7} | | | +-computeVerbatimExtent()
| | | <void computeVerbatimExtent () line:5513>
1166 { 8} | | | \-strlen()
1167 { 7} | | | +-computeDashExtent()
| | | <void computeDashExtent () line:5535>
1168 { 8} | | | +-strlen()
1169 { 8} | | | +-XTextWidth()
1170 { 8} | | | +-totalWidth()
| | | | <int totalWidth () line:6748> [see 1153]
1171 { 8} | | | \-startNewline()
| | | <void startNewline () line:6487> [see 1130]
1172 { 7} | | | +-atoi()
1173 { 7} | | | +-computeCenterExtent()
| | | <void computeCenterExtent () line:6012>
1174 { 8} | | | +-startNewline()
| | | | <void startNewline () line:6487> [see 1130]
1175 { 8} | | | +-centerTopGroup()
| | | | <void centerTopGroup () line:7402>
1176 { 9} | | | | \-pushGroupStack()
| | | | <void pushGroupStack () line:7312> [see 732]
1177 { 8} | | | +-fprintf()
1178 { 8} | | | \-exit()
1179 { 7} | | | +-computeBoxExtent()
| | | <void computeBoxExtent () line:6275>
1180 { 8} | | | +-textWidth()
| | | | <int textWidth () line:6564> [see 1078]
1181 { 8} | | | \-startNewline()
| | | <void startNewline () line:6487> [see 1130]
1182 { 7} | | | +-computeMboxExtent()
| | | <void computeMboxExtent () line:6263>
1183 { 8} | | | +-textWidth()
| | | | <int textWidth () line:6564> [see 1078]
1184 { 8} | | | \-startNewline()
| | | <void startNewline () line:6487> [see 1130]
1185 { 7} | | | +-computeBeginItemsExtent()
| | | <void computeBeginItemsExtent () line:5900>
1186 { 8} | | | +-startNewline()
| | | | <void startNewline () line:6487> [see 1130]
1187 { 8} | | | +-pushItemStack()
| | | | <void pushItemStack () line:8647>
1188 { 9} | | | | \-halloc() <char *halloc () line:2070> [see 8]
1189 { 8} | | | +-computeTextExtent()
| | | | <void computeTextExtent () line:5580>
| | | | (recursive: see 1076) [see 1076]
1190 { 8} | | | \-textWidth()
| | | <int textWidth () line:6564> [see 1078]
1191 { 7} | | | +-popItemStack() <void popItemStack () line:8667>
1192 { 8} | | | +-fprintf()
1193 { 8} | | | \-free()
1194 { 7} | | | +-computeItemExtent()
| | | <void computeItemExtent () line:5931>
1195 { 8} | | | \-startNewline()
| | | <void startNewline () line:6487> [see 1130]
1196 { 7} | | | +-computeMitemExtent()
| | | <void computeMitemExtent () line:5937>
1197 { 8} | | | \-startNewline()
| | | <void startNewline () line:6487> [see 1130]
1198 { 7} | | | +-computeButtonExtent()
| | | <void computeButtonExtent () line:6059>
1199 { 8} | | | +-pushActiveGroup()
| | | | <void pushActiveGroup () line:7378> [see 1091]
1200 { 8} | | | +-textWidth()
| | | | <int textWidth () line:6564> [see 1078]
1201 { 8} | | | \-startNewline()
| | | <void startNewline () line:6487> [see 1130]
1202 { 7} | | | +-endbuttonExtent()
| | | <void endbuttonExtent () line:6081>
1203 { 8} | | | +-maxX() <int maxX () line:6996>
1204 { 9} | | | +-max()
1205 { 9} | | | +-wordWidth()
| | | | <int wordWidth () line:6535> [see 1088]
1206 { 9} | | | +-verbatimWidth()
| | | | <int verbatimWidth () line:6543> [see 1085]
1207 { 9} | | | +-punctuationWidth()
| | | | <int punctuationWidth () line:6515> [see 1079]
1208 { 9} | | | +-widthOfDash()
| | | | <int widthOfDash () line:6551> [see 1082]
1209 { 9} | | | +-atoi()
1210 { 9} | | | +-pushGroupStack()
| | | | <void pushGroupStack () line:7312> [see 732]
1211 { 9} | | | +-bfTopGroup()
| | | | <void bfTopGroup () line:7359> [see 1101]
1212 { 9} | | | +-emTopGroup()
| | | | <void emTopGroup () line:7334> [see 1104]
1213 { 9} | | | +-rmTopGroup()
| | | | <void rmTopGroup () line:7342> [see 1107]
1214 { 9} | | | +-popGroupStack()
| | | | <int popGroupStack () line:7294> [see 404]
1215 { 9} | | | +-insertBitmapFile()
| | | | <void insertBitmapFile () line:7131>
| | | | [see 1110]
1216 { 9} | | | \-insertPixmapFile()
| | | <void insertPixmapFile () line:7165>
| | | [see 1118]
1217 { 8} | | | +-textWidth()
| | | | <int textWidth () line:6564> [see 1078]
1218 { 8} | | | +-textHeight()
| | | | <int textHeight () line:6872> [see 1127]
1219 { 8} | | | +-startNewline()
| | | | <void startNewline () line:6487> [see 1130]
1220 { 8} | | | \-popGroupStack()
| | | <int popGroupStack () line:7294> [see 404]
1221 { 7} | | | +-computeSpadsrcExtent()
| | | <void computeSpadsrcExtent () line:6192>
1222 { 8} | | | +-pushSpadGroup()
| | | | <void pushSpadGroup () line:7385> [see 1096]
1223 { 8} | | | \-startNewline()
| | | <void startNewline () line:6487> [see 1130]
1224 { 7} | | | +-computeSpadcommandExtent()
| | | <void computeSpadcommandExtent () line:6167>
1225 { 8} | | | +-pushSpadGroup()
| | | | <void pushSpadGroup () line:7385> [see 1096]
1226 { 8} | | | +-textWidth()
| | | | <int textWidth () line:6564> [see 1078]
1227 { 8} | | | \-startNewline()
| | | <void startNewline () line:6487> [see 1130]
1228 { 7} | | | +-endSpadsrcExtent()
| | | <void endSpadsrcExtent () line:6237>
1229 { 8} | | | +-maxX() <int maxX () line:6996> [see 1203]
1230 { 8} | | | +-textWidth()
| | | | <int textWidth () line:6564> [see 1078]
1231 { 8} | | | +-textHeight()
| | | | <int textHeight () line:6872> [see 1127]
1232 { 8} | | | +-startNewline()
| | | | <void startNewline () line:6487> [see 1130]
1233 { 8} | | | \-popGroupStack()
| | | <int popGroupStack () line:7294> [see 404]
1234 { 7} | | | +-endSpadcommandExtent()
| | | <void endSpadcommandExtent () line:6211>
1235 { 8} | | | +-maxX() <int maxX () line:6996> [see 1203]
1236 { 8} | | | +-textWidth()
| | | | <int textWidth () line:6564> [see 1078]
1237 { 8} | | | +-textHeight()
| | | | <int textHeight () line:6872> [see 1127]
1238 { 8} | | | +-startNewline()
| | | | <void startNewline () line:6487> [see 1130]
1239 { 8} | | | \-popGroupStack()
| | | <int popGroupStack () line:7294> [see 404]
1240 { 7} | | | +-pushGroupStack()
| | | <void pushGroupStack () line:7312> [see 732]
1241 { 7} | | | +-insertBitmapFile()
| | | <void insertBitmapFile () line:7131> [see 1110]
1242 { 7} | | | +-computeImageExtent()
| | | <void computeImageExtent () line:6324>
1243 { 8} | | | +-startNewline()
| | | |<void startNewline () line:6487> [see 1130]
1244 { 8} | | | \-plh() <int plh () line:7208> [see 1126]
1245 { 7} | | | +-insertPixmapFile()
| | | <void insertPixmapFile () line:7165> [see 1118]
1246 { 7} | | | +-computeTableExtent()
| | | <void computeTableExtent () line:6341>
1247 { 8} | | | +-textWidth()
| | | | <int textWidth () line:6564> [see 1078]
1248 { 8} | | | +-startNewline()
| | | | <void startNewline () line:6487> [see 1130]
1249 { 8} | | | \-computeTextExtent()
| | | <void computeTextExtent () line:5580>
| | | (recursive: see 1076) [see 1076]
1250 { 7} | | | +-computeBfExtent()
| | | <void computeBfExtent () line:6025>
1251 { 8} | | | \-bfTopGroup()
| | | <void bfTopGroup () line:7359> [see 1101]
1252 { 7} | | | +-computeEmExtent()
| | | <void computeEmExtent () line:6033>
1253 { 8} | | | +-rmTopGroup()
| | | | <void rmTopGroup () line:7342> [see 1107]
1254 { 8} | | | \-emTopGroup()
| | | <void emTopGroup () line:7334> [see 1104]
1255 { 7} | | | +-computeItExtent()
| | | <void computeItExtent () line:6044>
1256 { 7} | | | +-computeRmExtent()
| | | <void computeRmExtent () line:6051>
1257 { 8} | | | \-rmTopGroup()
| | | <void rmTopGroup () line:7342> [see 1107]
1258 { 7} | | | +-computeInputExtent()
| | | <void computeInputExtent () line:5394>
1259 { 8} | | | +-startNewline()
| | | | <void startNewline () line:6487> [see 1130]
1260 { 8} | | | \-plh() <int plh () line:7208> [see 1126]
1261 { 7} | | | +-computeIrExtent()
| | | <void computeIrExtent () line:6297>
1262 { 8} | | | +-startNewline()
| | | | <void startNewline () line:6487> [see 1130]
1263 { 8} | | | \-plh() <int plh () line:7208> [see 1126]
1264 { 7} | | | +-bfTopGroup()
| | | <void bfTopGroup () line:7359> [see 1101]
1265 { 7} | | | \-fprintf()
1266 { 6} | | +-max()
1267 { 6} | | \-textHeight()
| | <int textHeight () line:6872> [see 1127]
1268 { 5} | +-computeHeaderExtent()
| | <void computeHeaderExtent () line:6410>
1269 { 6} | | +-initExtents() <void initExtents () line:6835>
1270 { 7} | | \-clearItemStack()
| | <void clearItemStack () line:8657> [see 1074]
1271 { 6} | | +-max()
1272 { 6} | | +-computeTextExtent()
| | | <void computeTextExtent () line:5580> (R) [see 1076]
1273 { 6} | | \-textHeight()
| | <int textHeight () line:6872> [see 1127]
1274 { 5} | +-computeFooterExtent()
| | <void computeFooterExtent () line:6437>
1275 { 6} | | +-initExtents()
| | | <void initExtents () line:6835> [see 1269]
1276 { 6} | | +-computeTextExtent()
| | | <void computeTextExtent () line:5580> (R) [see 1076]
1277 { 6} | | \-textHeight()
| | <int textHeight () line:6872> [see 1127]
1278 { 5} | +-computeScrollingExtent()
| | <void computeScrollingExtent () line:6459>
1279 { 6} | | +-initExtents()
| | | <void initExtents () line:6835> [see 1269]
1280 { 6} | | \-computeTextExtent()
| | <void computeTextExtent () line:5580> (R) [see 1076]
1281 { 5} | +-calculateScrollBarMeasures()
| | <void calculateScrollBarMeasures () line:12578>
1282 { 5} | +-getScrollBarMinimumSize()
| | <void getScrollBarMinimumSize () line:12771>
1283 { 5} | +-XConfigureWindow()
1284 { 5} | +-XMapWindow()
1285 { 5} | +-XUnmapWindow()
1286 { 5} | +-hideScrollBars() <void hideScrollBars () line:12764>
1287 { 6} | | \-XUnmapWindow()
1288 { 5} | +-popGroupStack()
| | <int popGroupStack () line:7294> [see 404]
1289 { 5} | +-showText() <void showText () line:12792>
1290 { 6} | +-visible()
1291 { 6} | +-strlen()
1292 { 6} | +-XDrawLine()
1293 { 6} | +-XDrawString()
1294 { 6} | +-above()
1295 { 6} | +-below()
1296 { 6} | +-pushGroupStack()
| | <void pushGroupStack () line:7312> [see 732]
1297 { 6} | +-ttTopGroup() <void ttTopGroup () line:7370>
1298 { 7} | | +-pushGroupStack()
| | <void pushGroupStack () line:7312> [see 732]
1299 { 7} | | \-changeText()
| | <void changeText () line:8372> [see 317]
1300 { 6} | +-popGroupStack()
| | <int popGroupStack () line:7294> [see 404]
1301 { 6} | +-lineTopGroup() <void lineTopGroup () line:7350>
1302 { 7} | +-pushGroupStack()
| | <void pushGroupStack () line:7312> [see 732]
1303 { 7} | \-changeText()
| <void changeText () line:8372> [see 317]
1304 { 6} | +-XDrawRectangle()
1305 { 6} | +-pix_visible()
1306 { 6} | +-showLink() <void showLink () line:13035>
1307 { 7} | +-XClearArea()
1308 { 7} | +-allocButtonList()
| | <ButtonList *allocButtonList () line:9702>
1309 { 8} | | \-halloc() <char *halloc () line:2070> [see 8]
1310 { 7} | +-pushActiveGroup()
| | <void pushActiveGroup () line:7378> [see 1091]
1311 { 7} | +-trailingSpace() <int trailingSpace () line:7122>
1312 { 8} | \-atoi()
1313 { 7} | \-rmTopGroup()
| <void rmTopGroup () line:7342> [see 1107]
1314 { 6} | +-showSpadcommand()
| <void showSpadcommand () line:13175>
1315 { 7} | +-pushSpadGroup()
| | <void pushSpadGroup () line:7385> [see 1096]
1316 { 7} | +-fprintf()
1317 { 7} | +-XConfigureWindow()
1318 { 7} | \-XMapWindow()
1319 { 6} | +-showPastebutton()
| <void showPastebutton () line:13117>
1320 { 7} | +-pushActiveGroup()
| | <void pushActiveGroup () line:7378> [see 1091]
1321 { 7} | +-trailingSpace()
| | <int trailingSpace () line:7122> [see 1311]
1322 { 7} | +-fprintf()
1323 { 7} | +-XConfigureWindow()
1324 { 7} | \-XMapWindow()
1325 { 6} | +-showPaste() <void showPaste () line:13100>
1326 { 7} | +-hashFind() <char *hashFind () line:2139> [see 68]
1327 { 7} | +-freeGroupStack()
| | <void freeGroupStack () line:7429> [see 492]
1328 { 7} | +-copyGroupStack()
| | <GroupItem *copyGroupStack () line:7407>
1329 { 8} | | \-halloc() <char *halloc () line:2070> [see 8]
1330 { 7} | +-freeItemStack()
| | <void freeItemStack () line:8703> [see 494]
1331 { 7} | \-copyItemStack()
| <ItemStack *copyItemStack () line:8681>
1332 { 8} | \-halloc() <char *halloc () line:2070> [see 8]
1333 { 6} | +-showImage() <void showImage () line:13195>
1334 { 7} | +-pix_visible()
1335 { 7} | +-XPutImage()
1336 { 7} | \-fprintf()
1337 { 6} | +-bfTopGroup()
| <void bfTopGroup () line:7359> [see 1101]
1338 { 6} | +-emTopGroup()
| <void emTopGroup () line:7334> [see 1104]
1339 { 6} | +-rmTopGroup()
| <void rmTopGroup () line:7342> [see 1107]
1340 { 6} | +-showInput() <void showInput () line:13133>
1341 { 7} | +-pix_visible()
1342 { 7} | +-XConfigureWindow()
1343 { 7} | +-XMapWindow()
1344 { 7} | +-XFlush()
1345 { 7} | \-drawInputsymbol()
| <void drawInputsymbol () line:3503>
1346 { 8} | +-XClearWindow()
1347 { 8} | +-XTextExtents()
1348 { 8} | +-XDrawString()
1349 { 8} | +-currentItem()
| | <InputItem *currentItem () line:11291> [see 509]
1350 { 8} | \-drawCursor() <void drawCursor () line:3571>
1351 { 9} | +-XTextExtents()
1352 { 9} | +-XFillRectangle()
1353 { 9} | \-XDrawString()
1354 { 6} | +-showSimpleBox() <void showSimpleBox () line:13154>
1355 { 7} | +-visible()
1356 { 7} | +-XConfigureWindow()
1357 { 7} | +-XMapWindow()
1358 { 7} | +-pick_box()
1359 { 7} | \-unpick_box()
1360 { 6} | +-LoudBeepAtTheUser()
1361 { 6} | \-fprintf()
1362 { 5} | +-showScrollBars() <void showScrollBars () line:12487>
1363 { 6} | | +-XConfigureWindow()
1364 { 6} | | +-XMapWindow()
1365 { 6} | | \-drawScroller3DEffects()
| | <void drawScroller3DEffects () line:12464>
1366 { 7} | | +-XClearWindow()
1367 { 7} | | +-XDrawLine()
1368 { 7} | | +-XSetBackground()
1369 { 7} | | \-XSetForeground()
1370 { 5} | +-drawScrollLines() <void drawScrollLines () line:12551>
1371 { 6} | +-lineTopGroup()
| <void lineTopGroup () line:7350> [see 1301]
1372 { 6} | +-XDrawLine()
1373 { 6} | +-tophalf()
1374 { 6} | +-bothalf()
1375 { 6} | \-popGroupStack()
| <int popGroupStack () line:7294> [see 404]
1376 { 5} | +-fprintf()
1377 { 5} | +-showTitleBar() <void showTitleBar () line:14345>
1378 { 6} | | +-pushActiveGroup()
| | <void pushActiveGroup () line:7378> [see 1091]
1379 { 6} | | +-XConfigureWindow()
1380 { 6} | | +-XMapWindow()
1381 { 6} | | +-XPutImage()
1382 { 6} | | +-popGroupStack()
| | <int popGroupStack () line:7294> [see 404]
1383 { 6} | | +-showText() <void showText () line:12792> [see 1289]
1384 { 6} | | +-lineTopGroup()
| | <void lineTopGroup () line:7350> [see 1301]
1385 { 6} | | \-XDrawLine()
1386 { 5} | \-XFlush()
1387 { 3} | +-exposePage() <void exposePage () line:4446>
1388 { 4} | | +-initTopGroup()
| | <void initTopGroup () line:7392> [see 403]
1389 { 4} | | +-showText() <void showText () line:12792> [see 1289]
1390 { 4} | | +-getScrollBarMinimumSize()
| | <void getScrollBarMinimumSize () line:12771> [see 1282]
1391 { 4} | | +-XUnmapWindow()
1392 { 4} | | +-hideScrollBars()
| | <void hideScrollBars () line:12764> [see 1286]
1393 { 4} | | +-showScrollBars()
| | <void showScrollBars () line:12487> [see 1362]
1394 { 4} | | +-drawScrollLines()
| | <void drawScrollLines () line:12551> [see 1370]
1395 { 4} | | +-showTitleBar()
| | <void showTitleBar () line:14345> [see 1377]
1396 { 4} | | \-XFlush()
1397 { 3} | +-XFlush()
1398 { 3} | +-clearExposures() <void clearExposures () line:5206>
1399 { 4} | +-XFlush()
1400 { 4} | \-XCheckTypedWindowEvent()
1401 { 3} | +-handleButton() <void handleButton () line:4952>
1402 { 4} | +-scrollUp() <void scrollUp () line:12660>
1403 { 5} | | +-changeWindowBackgroundPixmap()
| | <void changeWindowBackgroundPixmap () line:12783>
1404 { 6} | | +-XChangeWindowAttributes()
1405 { 6} | | \-XClearWindow()
1406 { 5} | | +-XCopyArea()
1407 { 5} | | +-XClearArea()
1408 { 5} | | \-scrollPage() <void scrollPage () line:4492>
1409 { 6} | | +-initTopGroup()
| | | <void initTopGroup () line:7392> [see 403]
1410 { 6} | | +-freeButtonList()
| | | <void freeButtonList () line:9710> [see 1042]
1411 { 6} | | +-XUnmapSubwindows()
1412 { 6} | | +-showText() <void showText () line:12792> [see 1289]
1413 { 6} | | +-moveScroller() <void moveScroller () line:12537>
1414 { 7} | | | +-XConfigureWindow()
1415 { 7} | | | \-drawScroller3DEffects()
| | | <void drawScroller3DEffects () line:12464>
| | | [see 1365]
1416 { 6} | | \-XFlush()
1417 { 4} | +-scrollDown() <void scrollDown () line:12699>
1418 { 5} | | +-changeWindowBackgroundPixmap()
| <void changeWindowBackgroundPixmap () line:12783>
| [see 1403]
1419 { 5} | | +-XCopyArea()
1420 { 5} | | +-XClearArea()
1421 { 5} | | \-scrollPage() <void scrollPage () line:4492> [see 1408]
1422 { 4} | +-getHyperLink() <HyperLink *getHyperLink () line:4942>
1423 { 5} | +-hashFind() <char *hashFind () line:2139> [see 68]
1424 { 5} | \-findButtonInList()
| <HyperLink *findButtonInList () line:4929> [see 1013]
1425 { 4} | +-pasteButton() <HyperDocPage *pasteButton () line:4890>
1426 { 5} | +-BeepAtTheUser()
1427 { 5} | +-parsePatch() <HyperDocPage *parsePatch () line:11495>
1428 { 6} | | +-printToString()
| | | <char *printToString () line:13497> (R) [see 445]
1429 { 6} | | +-hashFind() <char *hashFind () line:2139> [see 68]
1430 { 6} | | +-fprintf()
1431 { 6} | | +-BeepAtTheUser()
1432 { 6} | | +-loadPatch() <void loadPatch () line:11614>
1433 { 7} | | +-saveScannerState()
| | | <void saveScannerState () line:2361> [see 436]
1434 { 7} | | +-findFp() <FILE *findFp () line:10878> [see 365]
1435 { 7} | | +-initScanner()
| | | <void initScanner () line:2343> [see 40]
1436 { 7} | | +-getExpectedToken()
| | | <void getExpectedToken () line:2406> (R) [see 86]
1437 { 7} | | +-strcmp()
1438 { 7} | | +-fprintf()
1439 { 7} | | +-jump() <void jump () line:2196> [see 108]
1440 { 7} | | +-scanHyperDoc()
| | | <void scanHyperDoc () line:8914> [see 645]
1441 { 7} | | +-fseek()
1442 { 7} | | +-halloc() <char *halloc () line:2070> [see 8]
1443 { 7} | | +-getc()
1444 { 7} | | \-restoreScannerState()
| | <void restoreScannerState () line:2377> [see 439]
1445 { 6} | | +-issueServerpaste()
| | <int issueServerpaste () line:13787>
1446 { 7} | | +-connectSpad()
| | | <int connectSpad () line:1879> [see 945]
1447 { 7} | | +-switchFrames() <void switchFrames () line:13853>
1448 { 8} | | | +-fprintf()
1449 { 8} | | | \-send_int()
1450 { 7} | | +-send_int()
1451 { 7} | | +-printToString()
| | | <char *printToString () line:13497> (R) [see 445]
1452 { 7} | | \-send_string()
1453 { 6} | | +-issueUnixpaste() <int issueUnixpaste () line:13827>
1454 { 7} | | | +-printToString()
| | | <char *printToString () line:13497> (R) [see 445]
1455 { 7} | | | +-popen()
1456 { 7} | | | +-fprintf()
1457 { 7} | | | \-exit()
1458 { 6} | | +-exit()
1459 { 6} | | +-setjmp()
1460 { 6} | | +-freeNode()
| | | <void freeNode () line:9281> (R) [see 487]
1461 { 6} | | +-initParsePatch() <void initParsePatch () line:9904>
1462 { 7} | | | +-initTopGroup()
| | | | <void initTopGroup () line:7392> [see 403]
1463 { 7} | | | \-clearBeStack()
| | | <int clearBeStack () line:2700> [see 408]
1464 { 6} | | +-initPasteItem() <void initPasteItem () line:11262>
1465 { 6} | | +-getToken() <int getToken () line:2535> (R) [see 74]
1466 { 6} | | +-jump() <void jump () line:2196> [see 108]
1467 { 6} | | +-tokenName() <void tokenName () line:2204> [see 88]
1468 { 6} | | +-printPageAndFilename()
| | | <void printPageAndFilename () line:2286> [see 92]
1469 { 6} | | +-allocNode()
| | | <TextNode *allocNode () line:9265> [see 419]
1470 { 6} | | +-parseHyperDoc()
| | | <void parseHyperDoc () line:9938> (R) [see 421]
1471 { 6} | | +-free()
1472 { 6} | | +-repasteItem() <void repasteItem () line:11275>
1473 { 7} | | | \-currentItem()
| | | <InputItem *currentItem () line:11291> [see 509]
1474 { 6} | | \-pastePage() <void pastePage () line:4508>
1475 { 7} | | +-freeButtonList()
| | | <void freeButtonList () line:9710> [see 1042]
1476 { 7} | | +-XUnmapSubwindows()
1477 { 7} | | +-initTopGroup()
| | | <void initTopGroup () line:7392> [see 403]
1478 { 7} | | +-computeScrollingExtent()
| | | <void computeScrollingExtent () line:6459>
| | | [see 1278]
1479 { 7} | | +-calculateScrollBarMeasures()
| | | <void calculateScrollBarMeasures () line:12578>
| | | [see 1281]
1480 { 7} | | +-getScrollBarMinimumSize()
| | | <void getScrollBarMinimumSize () line:12771>
| | | [see 1282]
1481 { 7} | | +-XClearArea()
1482 { 7} | | +-XFlush()
1483 { 7} | | +-XClearWindow()
1484 { 7} | | +-showText()
| | | <void showText () line:12792> [see 1289]
1485 { 7} | | +-hideScrollBars()
| | | <void hideScrollBars () line:12764> [see 1286]
1486 { 7} | | +-XUnmapWindow()
1487 { 7} | | +-showScrollBars()
| | | <void showScrollBars () line:12487> [see 1362]
1488 { 7} | | \-drawScrollLines()
| | <void drawScrollLines () line:12551> [see 1370]
1489 { 5} | \-strcmp()
1490 { 4} | +-printToString()
| <char *printToString () line:13497> (R) [see 445]
1491 { 4} | +-hashFind() <char *hashFind () line:2139> [see 68]
1492 { 4} | +-helpForHyperDoc() <void helpForHyperDoc () line:4910>
1493 { 5} | +-strcmp()
1494 { 5} | +-allocString()
| | <char *allocString () line:2189> [see 61]
1495 { 5} | +-hashFind() <char *hashFind () line:2139> [see 68]
1496 { 5} | +-makeWindowLink() <void makeWindowLink () line:4872>
1497 { 6} | | \-initTopWindow()
| | <int initTopWindow () line:7871> [see 214]
1498 { 5} | \-BeepAtTheUser()
1499 { 4} | +-scrollScroller() <void scrollScroller () line:12734>
1500 { 5} | +-XClearWindow()
1501 { 5} | \-scrollPage() <void scrollPage () line:4492> [see 1408]
1502 { 4} | +-changeInputFocus() <void changeInputFocus () line:8538>
1503 { 5} | +-currentItem()
| | <InputItem *currentItem () line:11291> [see 509]
1504 { 5} | +-XConfigureWindow()
1505 { 5} | \-updateInputsymbol()
| <void updateInputsymbol () line:3534>
1506 { 6} | +-XTextExtents()
1507 { 6} | +-XClearArea()
1508 { 6} | +-XDrawString()
1509 { 6} | \-drawCursor()
| <void drawCursor () line:3571> [see 1350]
1510 { 4} | +-XConvertSelection()
1511 { 4} | +-XInternAtom()
1512 { 4} | +-toggleInputBox() <void toggleInputBox () line:8499>
1513 { 5} | +-unpick_box()
1514 { 5} | \-pick_box()
1515 { 4} | +-toggleRadioBox() <void toggleRadioBox () line:8512>
1516 { 5} | +-clearRbs() <void clearRbs () line:8528>
1517 { 6} | | \-unpick_box()
1518 { 5} | \-pick_box()
1519 { 4} | +-quitHyperDoc() <void quitHyperDoc () line:4750>
1520 { 5} | +-strcmp()
1521 { 5} | +-exitHyperDoc() <void exitHyperDoc () line:5122>
1522 { 6} | | +-freeHdWindow() <void freeHdWindow () line:9239>
1523 { 7} | | | +-free()
1524 { 7} | | | +-freeHash() <void freeHash () line:2160> [see 141]
1525 { 7} | | | +-dontFree() <void dontFree () line:9597>
1526 { 7} | | | +-freeCond() <void freeCond () line:9463>
1527 { 8} | | | | \-free()
1528 { 7} | | | +-freePage() <void freePage () line:9492> [see 1040]
1529 { 7} | | | \-XFreeGC()
1530 { 6} | | +-exit()
1531 { 6} | | +-hashDelete()
| | | <void hashDelete () line:2118> [see 490]
1532 { 6} | | +-XFlush()
1533 { 6} | | +-XCheckWindowEvent()
1534 { 6} | | \-XDestroyWindow()
1535 { 5} | +-hashFind() <char *hashFind () line:2139> [see 68]
1536 { 5} | +-fprintf()
1537 { 5} | \-displayPage()
| <void displayPage () line:9769> [see 1036]
1538 { 4} | +-returnlink() <HyperDocPage *returnlink () line:4831>
1539 { 5} | +-BeepAtTheUser()
1540 { 5} | \-killPage() <void killPage () line:4822>
1541 { 6} | +-hashDelete()
| | <void hashDelete () line:2118> [see 490]
1542 { 6} | +-killAxiomPage() <void killAxiomPage () line:4816>
1543 { 7} | | +-sprintf()
1544 { 7} | | \-sendLispCommand()
| | <void sendLispCommand () line:13867> [see 944]
1545 { 6} | \-freePage() <void freePage () line:9492> [see 1040]
1546 { 4} | +-uplink() <HyperDocPage *uplink () line:4853>
1547 { 5} | +-returnlink()
| | <HyperDocPage *returnlink () line:4831> [see 1538]
1548 { 5} | \-killPage() <void killPage () line:4822> [see 1540]
1549 { 4} | +-findPage() <HyperDocPage *findPage () line:4776>
1550 { 5} | | +-printToString()
| | <char *printToString () line:13497> (R) [see 445]
1551 { 5} | | +-hashFind() <char *hashFind () line:2139> [see 68]
1552 { 5} | | \-fprintf()
1553 { 4} | +-NotSpecial()
1554 { 4} | +-downlink() <void downlink () line:4799>
1555 { 5} | \-fprintf()
1556 { 4} | +-memolink() <void memolink () line:4806>
1557 { 5} | \-fprintf()
1558 { 4} | +-windowlinkHandler()
| <void windowlinkHandler () line:4862>
1559 { 5} | +-printToString()
| | <char *printToString () line:13497> (R) [see 445]
1560 { 5} | \-initTopWindow()
| <int initTopWindow () line:7871> [see 214]
1561 { 4} | +-lispwindowlinkHandler()
| <void lispwindowlinkHandler () line:4878>
1562 { 5} | +-initTopWindow()
| | <int initTopWindow () line:7871> [see 214]
1563 { 5} | \-issueServerCommand()
| <HyperDocPage *issueServerCommand () line:13740>
1564 { 6} | +-connectSpad()
| | <int connectSpad () line:1879> [see 945]
1565 { 6} | +-hashFind() <char *hashFind () line:2139> [see 68]
1566 { 6} | +-fprintf()
1567 { 6} | +-switchFrames()
| | <void switchFrames () line:13853> [see 1447]
1568 { 6} | +-send_int()
1569 { 6} | +-printToString()
| | <char *printToString () line:13497> (R) [see 445]
1570 { 6} | +-send_string()
1571 { 6} | \-parsePageFromSocket()
| <HyperDocPage *parsePageFromSocket () line:10261>
1572 { 7} | +-allocPage()
| | <HyperDocPage *allocPage () line:9472> [see 229]
1573 { 7} | +-initScanner()
| | <void initScanner () line:2343> [see 40]
1574 { 7} | +-hashInit() <void hashInit () line:2091> [see 7]
1575 { 7} | +-windowEqual() <int windowEqual () line:10409>
1576 { 7} | +-windowCode() <int windowCode () line:10413>
1577 { 7} | +-setjmp()
1578 { 7} | +-freePage() <void freePage () line:9492> [see 1040]
1579 { 7} | +-hashFind() <char *hashFind () line:2139> [see 68]
1580 { 7} | +-resetConnection()
| | <void resetConnection () line:1897> [see 1062]
1581 { 7} | +-parsePage()
| | <void parsePage () line:9917> [see 394]
1582 { 7} | +-hashReplace()
| | <char *hashReplace () line:2148> [see 364]
1583 { 7} | +-hashInsert()
| | <void hashInsert () line:2104> [see 24]
1584 { 7} | \-fprintf()
1585 { 4} | +-issueServerCommand()
| | <HyperDocPage *issueServerCommand () line:13740>
| | [see 1563]
1586 { 4} | +-exitHyperDoc()
| | <void exitHyperDoc () line:5122> [see 1521]
1587 { 4} | +-issueSpadcommand()
| <void issueSpadcommand () line:13251> (R)
1588 { 5} | +-connectSpad() <int connectSpad () line:1879> [see 945]
1589 { 5} | +-startUserBuffer() <void startUserBuffer () line:13348>
1590 { 6} | | +-getenv()
1591 { 6} | | +-sprintf()
1592 { 6} | | +-printToString()
| | | <char *printToString () line:13497> (R) [see 445]
1593 { 6} | | +-access()
1594 { 6} | | +-system()
1595 { 6} | | +-acceptMenuServerConnection()
| | | <void acceptMenuServerConnection () line:13446>
1596 { 7} | | | +-sselect()
1597 { 7} | | | +-perror()
1598 { 7} | | | +-FD_ISSET()
1599 { 7} | | | +-acceptMenuConnection()
| | | <Sock *acceptMenuConnection () line:13416>
1600 { 8} | | | +-halloc() <char *halloc () line:2070> [see 8]
1601 { 8} | | | +-accept()
1602 { 8} | | | +-perror()
1603 { 8} | | | +-get_socket_type()
1604 { 8} | | | +-fprintf()
1605 { 8} | | | \-FD_SET()
1606 { 7} | | | +-get_string()
1607 { 7} | | | +-hashFind() <char *hashFind () line:2139> [see 68]
1608 { 7} | | | \-strcmp()
1609 { 6} | | \-sleep()
1610 { 5} | +-send_int()
1611 { 5} | +-clearExecutionMarks()
| | <void clearExecutionMarks () line:13403>
1612 { 5} | +-issueSpadcommand()
| | <void issueSpadcommand () line:13251>
| | (recursive: see 1587) [see 1587]
1613 { 5} | +-issueDependentCommands()
| | <void issueDependentCommands () line:13297>
1614 { 6} | | +-hashFind() <char *hashFind () line:2139> [see 68]
1615 { 6} | | +-fprintf()
1616 { 6} | | +-issueSpadcommand()
| | | <void issueSpadcommand () line:13251>
| | | (recursive: see 1587) [see 1587]
1617 { 6} | | +-pause()
1618 { 6} | | \-sleep()
1619 { 5} | +-printToString()
| | <char *printToString () line:13497> (R) [see 445]
1620 { 5} | +-strlen()
1621 { 5} | +-sendPile() <void sendPile () line:13282>
1622 { 6} | | +-sprintf()
1623 { 6} | | +-getenv()
1624 { 6} | | +-fopen()
1625 { 6} | | +-fprintf()
1626 { 6} | | +-fclose()
1627 { 6} | | \-send_string()
1628 { 5} | +-send_string()
1629 { 5} | \-markAsExecuted() <void markAsExecuted () line:13327>
1630 { 6} | +-hashFind() <char *hashFind () line:2139> [see 68]
1631 { 6} | \-fprintf()
1632 { 4} | +-issueUnixlink()
| <HyperDocPage *issueUnixlink () line:13813>
1633 { 5} | +-printToString()
| | <char *printToString () line:13497> (R) [see 445]
1634 { 5} | +-popen()
1635 { 5} | +-fprintf()
1636 { 5} | +-exit()
1637 { 5} | +-bsdSignal()
1638 { 5} | +-parsePageFromUnixfd()
| | <HyperDocPage *parsePageFromUnixfd () line:10303>
1639 { 6} | | +-allocPage()
| | <HyperDocPage *allocPage () line:9472> [see 229]
1640 { 6} | | +-initScanner()
| | <void initScanner () line:2343> [see 40]
1641 { 6} | | +-hashInit() <void hashInit () line:2091> [see 7]
1642 { 6} | | +-windowEqual() <int windowEqual () line:10409>
1643 { 6} | | +-windowCode() <int windowCode () line:10413>
1644 { 6} | | +-setjmp()
1645 { 6} | | +-freePage() <void freePage () line:9492> [see 1040]
1646 { 6} | | +-hashFind() <char *hashFind () line:2139> [see 68]
1647 { 6} | | +-resetConnection()
| | <void resetConnection () line:1897> [see 1062]
1648 { 6} | | \-parsePage() <void parsePage () line:9917> [see 394]
1649 { 5} | \-sigusr2Handler()
| <void sigusr2Handler () line:2998> [see 324]
1650 { 4} | +-issueUnixcommand() <void issueUnixcommand () line:13800>
1651 { 5} | +-printToString()
| | <char *printToString () line:13497> (R) [see 445]
1652 { 5} | +-halloc() <char *halloc () line:2070> [see 8]
1653 { 5} | +-strlen()
1654 { 5} | +-strcpy()
1655 { 5} | +-system()
1656 { 5} | \-free()
1657 { 4} | \-displayPage() <void displayPage () line:9769> [see 1036]
1658 { 3} | +-XCheckTypedWindowEvent()
1659 { 3} | +-handleKey() <void handleKey () line:8713>
1660 { 4} | +-XLookupString()
1661 { 4} | +-scrollUpPage() <void scrollUpPage () line:12678>
1662 { 5} | | +-ch() <int ch () line:12776> [see 286]
1663 { 5} | | +-XClearWindow()
1664 { 5} | | \-scrollPage() <void scrollPage () line:4492> [see 1408]
1665 { 4} | +-scrollDownPage() <void scrollDownPage () line:12718>
1666 { 5} | | +-ch() <int ch () line:12776> [see 286]
1667 { 5} | | +-XClearWindow()
1668 { 5} | | \-scrollPage() <void scrollPage () line:4492> [see 1408]
1669 { 4} | +-quitHyperDoc()
| | <void quitHyperDoc () line:4750> [see 1519]
1670 { 4} | +-sprintf()
1671 { 4} | +-system()
1672 { 4} | +-hashFind() <char *hashFind () line:2139> [see 68]
1673 { 4} | +-fclose()
1674 { 4} | +-hashDelete() <void hashDelete () line:2118> [see 490]
1675 { 4} | +-halloc() <char *halloc () line:2070> [see 8]
1676 { 4} | +-hashInit() <void hashInit () line:2091> [see 7]
1677 { 4} | +-stringEqual() <int stringEqual () line:2185> [see 14]
1678 { 4} | +-stringHash() <int stringHash () line:2177>
1679 { 4} | +-makeSpecialPages()
| | <void makeSpecialPages () line:10720> [see 226]
1680 { 4} | +-readHtDb() <void readHtDb () line:10428> [see 27]
1681 { 4} | +-fprintf()
1682 { 4} | +-exit()
1683 { 4} | +-makeWindowLink()
| | <void makeWindowLink () line:4872> [see 1496]
1684 { 4} | +-prevInputFocus() <void prevInputFocus () line:8583>
1685 { 5} | +-currentItem()
| | <InputItem *currentItem () line:11291> [see 509]
1686 { 5} | +-BeepAtTheUser()
1687 { 5} | \-drawInputsymbol()
| <void drawInputsymbol () line:3503> [see 1345]
1688 { 4} | +-BeepAtTheUser()
1689 { 4} | +-nextInputFocus() <void nextInputFocus () line:8561>
1690 { 5} | +-currentItem()
| | <InputItem *currentItem () line:11291> [see 509]
1691 { 5} | +-BeepAtTheUser()
1692 { 5} | \-drawInputsymbol()
| <void drawInputsymbol () line:3503> [see 1345]
1693 { 4} | +-currentItem()
| | <InputItem *currentItem () line:11291> [see 509]
1694 { 4} | +-allocString() <char *allocString () line:2189> [see 61]
1695 { 4} | +-helpForHyperDoc()
| | <void helpForHyperDoc () line:4910> [see 1492]
1696 { 4} | +-scrollToFirstPage()
| | <void scrollToFirstPage () line:12690>
1697 { 5} | +-XClearWindow()
1698 { 5} | \-scrollPage() <void scrollPage () line:4492> [see 1408]
1699 { 4} | +-scrollUp() <void scrollUp () line:12660> [see 1402]
1700 { 4} | +-scrollDown() <void scrollDown () line:12699> [see 1417]
1701 { 4} | +-dialog() <void dialog () line:4239>
1702 { 5} | | +-currentItem()
| | | <InputItem *currentItem () line:11291> [see 509]
1703 { 5} | | +-BeepAtTheUser()
1704 { 5} | | +-enterNewLine() <void enterNewLine () line:4166>
1705 { 6} | | +-allocInputline()
| | | <LineStruct *allocInputline () line:9644> [see 819]
1706 { 6} | | +-toughEnter() <void toughEnter () line:4100>
1707 { 7} | | | +-allocInputline()
| | | | <LineStruct *allocInputline () line:9644>
| | | | [see 819]
1708 { 7} | | | \-incLineNumbers()
| | | <void incLineNumbers () line:3265>
1709 { 6} | | +-strncpy()
1710 { 6} | | \-redrawWin() <void redrawWin () line:3251>
1711 { 7} | | +-XUnmapSubwindows()
1712 { 7} | | +-XFlush()
1713 { 7} | | \-showPage() <void showPage () line:4360> [see 1068]
1714 { 5} | | +-addBufferToSym() <void addBufferToSym () line:3496>
1715 { 6} | | +-insertBuffer() <void insertBuffer () line:3409>
1716 { 7} | | | +-mystrncpy() <char *mystrncpy () line:3258>
1717 { 7} | | | +-clearCursorline()
| | | | <void clearCursorline () line:3393>
1718 { 8} | | | | +-XTextExtents()
1719 { 8} | | | | +-XClearArea()
1720 { 8} | | | | \-XDrawString()
1721 { 7} | | | +-drawCursor()
| | | | <void drawCursor () line:3571> [see 1350]
1722 { 7} | | | +-moveSymForward()
| | | | <int moveSymForward () line:3350> (R)
1723 { 8} | | | | +-moveSymForward()
| | | | | <int moveSymForward () line:3350>
| | | | | (recursive: see 1722) [see 1722]
1724 { 8} | | | | +-strncpy()
1725 { 8} | | | | +-allocInputline()
| | | | | <LineStruct *allocInputline () line:9644>
| | | | | [see 819]
1726 { 8} | | | | \-incLineNumbers()
| | | | <void incLineNumbers () line:3265> [see 1708]
1727 { 7} | | | +-strncpy()
1728 { 7} | | | +-allocInputline()
| | | | <LineStruct *allocInputline () line:9644>
| | | | [see 819]
1729 { 7} | | | +-incLineNumbers()
| | | | <void incLineNumbers () line:3265> [see 1708]
1730 { 7} | | | +-redrawWin()
| | | | <void redrawWin () line:3251> [see 1710]
1731 { 7} | | | \-updateInputsymbol()
| | | <void updateInputsymbol () line:3534> [see 1505]
1732 { 6} | | \-overwriteBuffer()
| | <void overwriteBuffer () line:3281>
1733 { 7} | | +-clearCursor() <void clearCursor () line:3692>
1734 { 8} | | | +-XTextExtents()
1735 { 8} | | | +-XClearArea()
1736 { 8} | | | \-XDrawString()
1737 { 7} | | +-allocInputline()
| | | <LineStruct *allocInputline () line:9644>
| | | [see 819]
1738 { 7} | | +-incLineNumbers()
| | | <void incLineNumbers () line:3265> [see 1708]
1739 { 7} | | +-XDrawString()
1740 { 7} | | +-drawCursor()
| | | <void drawCursor () line:3571> [see 1350]
1741 { 7} | | \-redrawWin()
| | <void redrawWin () line:3251> [see 1710]
1742 { 5} | | +-strlen()
1743 { 5} | | +-moveCursorHome() <void moveCursorHome () line:3601>
1744 { 6} | | | +-clearCursor()
| | <void clearCursor () line:3692> [see 1733]
1745 { 6} | | | \-drawCursor()
| | <void drawCursor () line:3571> [see 1350]
1746 { 5} | | +-deleteRestOfLine()
| | <void deleteRestOfLine () line:3763>
1747 { 6} | | +-decLineNumbers() <void decLineNumbers () line:3270>
1748 { 6} | | +-free()
1749 { 6} | | +-redrawWin() <void redrawWin () line:3251> [see 1710]
1750 { 6} | | +-BeepAtTheUser()
1751 { 6} | | +-decreaseLineNumbers()
| | | <void decreaseLineNumbers () line:3276>
1752 { 6} | | \-updateInputsymbol()
| | <void updateInputsymbol () line:3534> [see 1505]
1753 { 5} | | +-allocString()
| | <char *allocString () line:2189> [see 61]
1754 { 5} | | +-helpForHyperDoc()
| | <void helpForHyperDoc () line:4910> [see 1492]
1755 { 5} | | +-moveCursorUp() <void moveCursorUp () line:3670>
1756 { 6} | | +-BeepAtTheUser()
1757 { 6} | | +-clearCursor()
| | | <void clearCursor () line:3692> [see 1733]
1758 { 6} | | \-drawCursor()
| | <void drawCursor () line:3571> [see 1350]
1759 { 5} | | +-moveCursorDown() <void moveCursorDown () line:3650>
1760 { 6} | | +-BeepAtTheUser()
1761 { 6} | | +-clearCursor()
| | | <void clearCursor () line:3692> [see 1733]
1762 { 6} | | \-drawCursor()
| | <void drawCursor () line:3571> [see 1350]
1763 { 5} | | +-deleteChar() <void deleteChar () line:4095>
1764 { 6} | | +-deleteOneChar() <int deleteOneChar () line:4046>
1765 { 7} | | | +-moveRestBack() <char moveRestBack () line:3733>
1766 { 8} | | | | \-strncpy()
1767 { 7} | | | +-BeepAtTheUser()
1768 { 7} | | | +-deleteEoln() <void deleteEoln () line:3984>
1769 { 8} | | | | +-decLineNumbers()
| | | | | <void decLineNumbers () line:3270> [see 1747]
1770 { 8} | | | | +-free()
1771 { 8} | | | | +-redrawWin()
| | | | | <void redrawWin () line:3251> [see 1710]
1772 { 8} | | | | \-updateInputsymbol()
| | | | <void updateInputsymbol () line:3534> [see 1505]
1773 { 7} | | | \-strncpy()
1774 { 6} | | \-updateInputsymbol()
| | <void updateInputsymbol () line:3534> [see 1505]
1775 { 5} | | +-backOverChar() <void backOverChar () line:3979>
1776 { 6} | | +-moveBackOneChar() <int moveBackOneChar () line:3891>
1777 { 7} | | | +-moveRestBack()
| | | | <char moveRestBack () line:3733> [see 1765]
1778 { 7} | | | +-BeepAtTheUser()
1779 { 7} | | | +-backOverEoln() <void backOverEoln () line:3823>
1780 { 8} | | | | +-decLineNumbers()
| | | | | <void decLineNumbers () line:3270> [see 1747]
1781 { 8} | | | | +-free()
1782 { 8} | | | | +-redrawWin()
| | | | | <void redrawWin () line:3251> [see 1710]
1783 { 8} | | | | \-updateInputsymbol()
| | | | <void updateInputsymbol () line:3534> [see 1505]
1784 { 7} | | | +-strncpy()
1785 { 7} | | | +-decLineNumbers()
| | | | <void decLineNumbers () line:3270> [see 1747]
1786 { 7} | | | +-free()
1787 { 7} | | | +-redrawWin()
| | | | <void redrawWin () line:3251> [see 1710]
1788 { 7} | | | \-updateInputsymbol()
| | | <void updateInputsymbol () line:3534> [see 1505]
1789 { 6} | | \-updateInputsymbol()
| | <void updateInputsymbol () line:3534> [see 1505]
1790 { 5} | | +-moveCursorBackward()
| | <void moveCursorBackward () line:3709>
1791 { 6} | | +-BeepAtTheUser()
1792 { 6} | | +-clearCursor()
| | | <void clearCursor () line:3692> [see 1733]
1793 { 6} | | \-drawCursor()
| | <void drawCursor () line:3571> [see 1350]
1794 { 5} | | +-moveCursorForward()
| | <void moveCursorForward () line:3623>
1795 { 6} | | +-BeepAtTheUser()
1796 { 6} | | +-clearCursor()
| | | <void clearCursor () line:3692> [see 1733]
1797 { 6} | | \-drawCursor()
| | <void drawCursor () line:3571> [see 1350]
1798 { 5} | | +-updateInputsymbol()
| | <void updateInputsymbol () line:3534> [see 1505]
1799 { 5} | | \-moveCursorEnd() <void moveCursorEnd () line:3612>
1800 { 6} | | +-clearCursor()
| | | <void clearCursor () line:3692> [see 1733]
1801 { 6} | | \-drawCursor()
| | <void drawCursor () line:3571> [see 1350]
1802 { 4} | +-XFlush()
1803 { 4} | \-displayPage() <void displayPage () line:9769> [see 1036]
1804 { 3} | +-createWindow() <void createWindow () line:4733>
1805 { 4} | +-XGetWindowAttributes()
1806 { 4} | +-displayPage() <void displayPage () line:9769> [see 1036]
1807 { 4} | \-XSelectInput()
1808 { 3} | +-XInternAtom()
1809 { 3} | +-XGetWindowProperty()
1810 { 3} | +-addBufferToSym()
| <void addBufferToSym () line:3496> [see 1714]
1811 { 3} | \-XFree()
1812 { 2} +-select()
1813 { 2} +-FD_ISSET()
1814 { 2} +-get_int()
1815 { 2} +-setWindow() <int setWindow () line:5155> [see 1024]
1816 { 2} +-makeBusyCursors()
| <void makeBusyCursors () line:5371> [see 1031]
1817 { 2} +-getNewWindow() <void getNewWindow () line:5212>
1818 { 3} | +-get_int()
1819 { 3} | +-initTopWindow() <int initTopWindow () line:7871> [see 214]
1820 { 3} | +-initScanner() <void initScanner () line:2343> [see 40]
1821 { 3} | +-parsePageFromSocket()
| <HyperDocPage *parsePageFromSocket () line:10261>
| [see 1571]
1822 { 3} | +-XFlush()
1823 { 3} | +-get_string_buf()
1824 { 3} | +-fprintf()
1825 { 3} | +-initFormWindow() <int initFormWindow () line:7969>
1826 { 4} | | +-allocHdWindow() <HDWindow *allocHdWindow () line:9207>
| | | [see 215]
1827 { 4} | | +-openFormWindow() <void openFormWindow () line:7913>
1828 { 5} | | | +-strcpy()
1829 { 5} | | | +-XrmGetResource()
1830 { 5} | | | +-strncpy()
1831 { 5} | | | +-XGeometry()
1832 { 5} | | | +-getBorderProperties()
| | | | <int getBorderProperties () line:8023> [see 244]
1833 { 5} | | | +-XCreateSimpleWindow()
1834 { 5} | | | +-RootWindow()
1835 { 5} | | | +-WhitePixel()
1836 { 5} | | | +-BlackPixel()
1837 { 5} | | | +-makeScrollBarWindows()
| | | | <void makeScrollBarWindows () line:12390> [see 254]
1838 { 5} | | | +-makeTitleBarWindows()
| | | | <void makeTitleBarWindows () line:14315> [see 262]
1839 { 5} | | | +-setNameAndIcon()
| | | | <void setNameAndIcon () line:7996> [see 285]
1840 { 5} | | | +-XSelectInput()
1841 { 5} | | | +-XDefineCursor()
1842 { 5} | | | +-XSetNormalHints()
1843 { 5} | | | \-XFlush()
1844 { 4} | | +-windowWidth() <int windowWidth () line:7228>
1845 { 4} | | +-allocPage()
| | | <HyperDocPage *allocPage () line:9472> [see 229]
1846 { 4} | | +-hashFind() <char *hashFind () line:2139> [see 68]
1847 { 4} | | +-fprintf()
1848 { 4} | | +-getGCs() <void getGCs () line:8161> [see 307]
1849 { 4} | | +-hashInsert() <void hashInsert () line:2104> [see 24]
1850 { 4} | | \-XChangeWindowAttributes()
1851 { 3} | +-send_int()
1852 { 3} | +-computeFormPage() <void computeFormPage () line:7217>
1853 { 4} | | +-popGroupStack()
| | | <int popGroupStack () line:7294> [see 404]
1854 { 4} | | +-formHeaderExtent() <void formHeaderExtent () line:7240>
1855 { 5} | | | +-initExtents()
| | | | <void initExtents () line:6835> [see 1269]
1856 { 5} | | | \-computeTextExtent()
| | | <void computeTextExtent () line:5580> (R) [see 1076]
1857 { 4} | | +-formFooterExtent() <void formFooterExtent () line:7256>
1858 { 5} | | | +-initExtents()
| | | | <void initExtents () line:6835> [see 1269]
1859 { 5} | | | +-computeTextExtent()
| | | | <void computeTextExtent () line:5580> (R) [see 1076]
1860 { 5} | | | \-textHeight() <int textHeight () line:6872> [see 1127]
1861 { 4} | | +-formScrollingExtent()
| | | <void formScrollingExtent () line:7273>
1862 { 5} | | | +-initExtents()
| | | | <void initExtents () line:6835> [see 1269]
1863 { 5} | | | \-computeTextExtent()
| | | <void computeTextExtent () line:5580> (R) [see 1076]
1864 { 4} | | \-windowHeight() <int windowHeight () line:7232>
1865 { 3} | +-XMapWindow()
1866 { 3} | +-loadPage() <void loadPage () line:9758> [see 360]
1867 { 3} | +-hashFind() <char *hashFind () line:2139> [see 68]
1868 { 3} | +-displayPage() <void displayPage () line:9769> [see 1036]
1869 { 3} | +-clearExposures()
| | <void clearExposures () line:5206> [see 1398]
1870 { 3} | +-setWindow() <int setWindow () line:5155> [see 1024]
1871 { 3} | \-exitHyperDoc() <void exitHyperDoc () line:5122> [see 1521]
1872 { 2} \-serviceSessionSocket()
<void serviceSessionSocket () line:13837>
1873 { 3} +-get_int()
1874 { 3} +-closeClient() <void closeClient () line:13889>
1875 { 4} | \-free()
1876 { 3} \-fprintf()
\end{verbatim}
\chapter{include}
\label{include}
This chapter contains the include files. Unlike normal C programs
we replace the 'include' directive by the actual chunk from this
chapter. The results are that the include files never get written
to disk and the compiler never sees the include directive, resulting
in faster compile times.
The include files are collected from both the view* programs and
the low level C code that supports them, including libspad which,
in general, have the file extension of 'h1' rather than 'h'.
\section{include/actions.h}
\begin{chunk}{include/actions.h}
/* from bookvol7 chunk include/actions.h */
#define makeAViewport -1
/* Viewport Types */
#define view3DType 1
#define viewGraphType 2
#define view2DType 3
#define viewTubeType 4
/* 2D Viewport */
#define translate2D 0
#define scale2D 1
#define pointsOnOff 2
#define connectOnOff 3
#define spline2D 4
#define reset2D 5
#define hideControl2D 6
#define closeAll2D 7
#define axesOnOff2D 8
#define unitsOnOff2D 9
#define pick2D 10
#define drop2D 11
#define clear2D 12
#define ps2D 13
#define graph1 14
#define graph2 15
#define graph3 16
#define graph4 17
#define graph5 18
#define graph6 19
#define graph7 20
#define graph8 21
#define graph9 22
#define graphSelect1 23
#define graphSelect2 24
#define graphSelect3 25
#define graphSelect4 26
#define graphSelect5 27
#define graphSelect6 28
#define graphSelect7 29
#define graphSelect8 30
#define graphSelect9 31
#define query2D 32
#define zoom2Dx 33
#define zoom2Dy 34
#define translate2Dx 35
#define translate2Dy 36
#define maxButtons2D 37
#define graphStart 14 /* the index of graph1 */
#define graphSelectStart (graphStart+maxGraphs)
/* 3D Viewport */
#define controlButtonsStart3D 0
#define rotate 0
#define zoom 1
#define translate 2
#define render 3
#define hideControl 4
#define closeAll 5
#define axesOnOff 6
#define opaqueMesh 7
#define resetView 8
#define transparent 9
#define lighting 10
#define viewVolume 11
#define region3D 12
#define outlineOnOff 13
#define zoomx 14
#define zoomy 15
#define zoomz 16
#define originr 17
#define objectr 18
#define xy 19
#define xz 20
#define yz 21
#define smooth 22
#define saveit 23
#define bwColor 24
#define maxControlButtons3D 25
#define controlButtonsEnd3D (controlButtonsStart3D + maxControlButtons3D)
#define graphStart3D 25 /* the index of g1 */
#define graphSelectStart3D (graphStart3D+maxGraphs)
/* these should be maxControlButtons3D+1.. (be sure to modify view3d.spad) */
#define diagOnOff (maxControlButtons3D+1)
#define perspectiveOnOff (maxControlButtons3D+2)
#define clipRegionOnOff 66
#define clipSurfaceOnOff 67
#define query 11
/* misc */
#define spadPressedAButton 100 /* used for communications with the .AXIOM file */
#define colorDef 101
#define moveViewport 102
#define resizeViewport 103
#define changeTitle 104
#define showing2D 105
#define putGraph 106 /* for 2D */
#define getGraph 107 /* for 2D */
#define lightDef 108 /* for 3D */
#define translucenceDef 109 /* for 3D */
#define writeView 110 /* for both */
#define eyeDistanceData 111 /* for 3D */
#define axesColor2D 112 /* for 2D */
#define unitsColor2D 113 /* for 2D */
#define modifyPOINT 114 /* for 3D */
#define hitherPlaneData 116 /* for 3D */
\end{chunk}
\section{include/rgb.h}
\index{rgb.h}
\index{struct!RGB}
\index{RGB struct}
\index{struct!HSV}
\index{HSV struct}
\index{struct!HLS}
\index{HLS struct}
\begin{chunk}{include/rgb.h}
/* from bookvol7 chunk include/rgb.h */
typedef struct _RGB {
float r,g,b;
} RGB ;
typedef struct _HSV {
float h,s,v;
} HSV ;
typedef struct _HLS {
float h,l,s;
} HLS ;
\end{chunk}
\section{include/spadcolors.h}
\index{spadcolors.h}
\begin{chunk}{include/spadcolors.h}
/* from bookvol7 chunk include/spadcolors.h */
#define numOfColors 240
#define totalHuesConst 27
#define totalShadesConst 5
#define hueEnd 360
#define hueStep 12 /* hueEnd/totalHuesConst */
#define numPlanes 1
#define numColors 10
#define startColor 0
#define endColor startColor+numColors
#define colorStep (maxColors+1)/numColors
#define yes 1
#define no 0
#define smoothConst 50
#define saymem(a,b,c) saymemWithLine(a,b,c,0)
#define Colorcells 256 /* KF number of elements in permutation vector */
#define shade 5
#define saturation 0.8
extern int smoothHue;
extern Colormap colorMap;
extern int num;
#define maxColors DisplayCells(dsply,scrn)-1
\getchunk{include/rgb.h}
\end{chunk}
\section{include/addfile.h1}
\begin{chunk}{include/addfile.h1}
/* from bookvol7 chunk include/addfile.h1 */
extern FILE * db_file_open(char * db_file);
extern void extend_ht(char * name);
extern FILE * ht_file_open(char * fname , char * aname , char * name);
extern FILE * temp_file_open(char * temp_db_file);
#ifdef _ADDFILE_C
static int build_ht_filename(char * fname , char * aname , char * name);
static int pathname(char * name);
static int strpostfix(char * s , char * t);
#endif
\end{chunk}
\section{include/all-hyper-proto.h1}
\begin{chunk}{include/all-hyper-proto.h1}
/* from bookvol7 chunk include/all-hyper-proto.h1 */
\getchunk{include/addfile.h1}
\getchunk{include/readbitmap.h1}
\getchunk{include/dialog.h1}
\getchunk{include/cond.h1}
\getchunk{include/display.h1}
\getchunk{include/event.h1}
\getchunk{include/ex2ht.h1}
\getchunk{include/form-ext.h1}
\getchunk{include/extent1.h1}
\getchunk{include/extent2.h1}
\getchunk{include/halloc.h1}
\getchunk{include/group.h1}
\getchunk{include/hterror.h1}
\getchunk{include/htinp.h1}
\getchunk{include/hyper.h1}
\getchunk{include/initx.h1}
\getchunk{include/input.h1}
\getchunk{include/keyin.h1}
\getchunk{include/item.h1}
\getchunk{include/lex.h1}
\getchunk{include/parse.h1}
\getchunk{include/macro.h1}
\getchunk{include/parse-paste.h1}
\getchunk{include/parse-aux.h1}
\getchunk{include/parse-input.h1}
\getchunk{include/show-types.h1}
\getchunk{include/parse-types.h1}
\getchunk{include/scrollbar.h1}
\getchunk{include/titlebar.h1}
\getchunk{include/spadint.h1}
\getchunk{include/hash.h1}
\getchunk{include/mem.h1}
\end{chunk}
\section{include/bsdsignal.h}
\begin{chunk}{include/bsdsignal.h}
/* from bookvol7 chunk include/bsdsignal.h */
#ifndef _BSDSIGNAL_H_
#define _BSDSIGNAL_H_
#define RestartSystemCalls 1
#define DontRestartSystemCalls 0
typedef void (* SignalHandlerFunc)(int);
#endif /* _BSDSIGNAL */
\end{chunk}
\section{include/bsdsignal.h1}
\begin{chunk}{include/bsdsignal.h1}
/* from bookvol7 chunk include/bsdsignal.h1 */
extern SignalHandlerFunc bsdSignal(int , SignalHandlerFunc , int );
\end{chunk}
\section{include/com.h}
\begin{chunk}{include/com.h}
/* from bookvol7 chunk include/com.h */
#ifndef _COM_H_
#define _COM_H_
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#if defined(RIOSplatform)
#include <sys/select.h>
#endif
typedef struct {
int socket; /* socket number returned by "socket" call */
int type; /* socket type (AF_UNIX or AF_INET) */
int purpose; /* can be SessionManager, GraphicsServer, etc. */
int pid; /* process ID of connected socket */
int frame; /* spad interpreter frame (for interpreter windows) */
int remote_fd; /* file descriptor of remote socket */
union {
struct sockaddr u_addr;
struct sockaddr_in i_addr;
} addr;
char *host_name; /* name of foreign host if type == AF_INET */
} Sock;
#define MaxClients 150
/* possible socket types (purpose) */
#define SessionManager 1
#define ViewportServer 2
#define MenuServer 3
#define SessionIO 4
#define BaloonServer 5
#define InterpWindow 6
#define KillSpad 7
#define DebugWindow 8
#define Forker 9
#define AV 10 /*Simon's algebraic viewer */
#define Acknowledge 255
/* Timeout value for connection to remote socket */
#define Forever 0
/* Socket name for local AXIOM server and session manager */
#define SpadServer "/tmp/.d"
#define SessionServer "/tmp/.s"
#define SessionIOName "/tmp/.i"
#define MenuServerName "/tmp/.h"
#define ForkServerName "/tmp/.f"
#define MASK_SIZE (NBBY*sizeof(fd_set))
/* table of dedicated socket types */
extern Sock *purpose_table[];
extern Sock server[];
extern Sock clients[];
extern fd_set socket_mask;
extern fd_set server_mask;
/* Commands sent over the AXIOM session manager or menu socket */
#define CreateFrame 1
#define SwitchFrames 2
#define EndOfOutput 3
#define CallInterp 4
#define EndSession 5
#define LispCommand 6
#define SpadCommand 7
#define SendXEventToHyperTeX 8
#define QuietSpadCommand 9
#define CloseClient 10
#define QueryClients 11
#define QuerySpad 12
#define NonSmanSession 13
#define KillLispSystem 14
#define CreateFrameAnswer 50
/* Commands from AXIOM menu server to interpreter windows */
#define ReceiveInputLine 100
#define TestLine 101
#endif
\end{chunk}
\section{include/cond.h1}
\begin{chunk}{include/cond.h1}
/* from bookvol7 chunk include/cond.h1 */
extern void change_cond(char * label , char * newcond);
extern int check_condition(TextNode * node);
extern void insert_cond(char * label , char * cond);
#ifdef _COND_C
static int check_memostack(TextNode * node);
#endif
\end{chunk}
\section{include/cursor.h1}
\begin{chunk}{include/cursor.h1}
/* from bookvol7 chunk include/cursor.h1 */
extern int Cursor_shape(int );
\end{chunk}
\section{include/debug.h}
\begin{chunk}{include/debug.h}
/* from bookvol7 chunk include/debug.h */
/* redefine free */
/* #define free hfree*/
\end{chunk}
\section{include/dialog.h1}
\begin{chunk}{include/dialog.h1}
/* from bookvol7 chunk include/dialog.h1 */
extern void add_buffer_to_sym(char * buffer , InputItem * sym);
extern void dialog(XEvent * event , KeySym keysym , char * buffer);
extern void draw_inputsymbol(InputItem * sym);
extern void update_inputsymbol(InputItem * sym);
#ifdef _DIALOG_C
static void back_over_char(InputItem * sym);
static void back_over_eoln(InputItem * sym);
static void clear_cursor(InputItem * sym);
static void clear_cursorline(InputItem * sym);
static void dec_line_numbers(LineStruct * line);
static void decrease_line_numbers(LineStruct * line , int am);
static void delete_char(InputItem * sym);
static void delete_eoln(InputItem * sym);
static int delete_one_char(InputItem * sym);
static void delete_rest_of_line(InputItem * sym);
static void draw_cursor(InputItem * sym);
static void enter_new_line(InputItem * sym);
static void inc_line_numbers(LineStruct * line);
static void insert_buffer(char * buffer , InputItem * sym);
static int move_back_one_char(InputItem * sym);
static void move_cursor_backward(InputItem * sym);
static void move_cursor_down(InputItem * sym);
static void move_cursor_end(InputItem * sym);
static void move_cursor_forward(InputItem * sym);
static void move_cursor_home(InputItem * sym);
static void move_cursor_up(InputItem * sym);
static char move_rest_back(LineStruct * line , int size);
static int move_sym_forward(LineStruct * line, int num, int size,
InputItem * sym);
static char * mystrncpy(char * buff1 , char * buff2 , int n);
static void overwrite_buffer(char * buffer , InputItem * item);
static void redraw_win(void);
static void tough_enter(InputItem * sym);
#endif
\end{chunk}
\section{include/display.h1}
\begin{chunk}{include/display.h1}
/* from bookvol7 chunk include/display.h1 */
extern void expose_page(HyperDocPage * page);
extern void paste_page(TextNode * node);
extern void scroll_page(HyperDocPage * page);
extern void show_page(HyperDocPage * page);
\end{chunk}
\section{include/edible.h}
\begin{chunk}{include/edible.h}
/* from bookvol7 chunk include/edible.h */
extern int contNum;
extern struct termios childbuf; /** the childs normal operating termio ***/
/*** the terminals mapping of the function keys ***/
extern unsigned char _INTR, _QUIT, _ERASE, _KILL, _EOF, _EOL, _RES1, _RES2;
extern short INS_MODE ; /** Flag for insert mode **/
extern short ECHOIT; /** Flag for echoing **/
extern short PTY; /* A flag which lets me know whether or not I am
talking to a socket or a pty. If I am not
talking to a PTY then I have to do things like echo
back newlines, and send interuppts with an eoln
*/
/***************************************************************************
Here are the key mapping my routines need
****************************************************************************/
#define _ESC 0X1B /** A character sent before every arrow key ***/
#define _LBRACK 0X5B /** [ **/
#define _EOLN '\n' /** eoln **/
#define _CR 0X0D /** cr **/
#define _BLANK 0X20 /** blank **/
#define _BKSPC 0X08 /** backspace **/
#define _DEL 0X7F /** delete **/
#define _BELL 0X07 /*** ring the bell **/
#define _INT 0X7F /*** interrupt **/
#define _SQUASH 0X03 /** kill my process **/
#define _CNTRL_W 0X17 /** cntrl-w, to back up a word **/
#define _CARROT 0X5E /** circumflex **/
#define _TAB 0X09 /** tab forward **/
#ifndef WCT
#define _A 0X41 /** A **/
#define _B 0X42 /** B **/
#define _C 0X43 /** C **/
#define _D 0X44 /** D **/
#define _Z 0X5A /** Z **/
#define _H 0X48 /** H **/
#define _M 0X4D /** M **/
#define _x 0X78 /** x **/
#define _z 0X7A /*** z **/
#define _twiddle 0X7E /*** ~ **/
#define _P 0X50 /*** P **/
#define _1 0X31 /*** 1 **/
#define _2 0X32 /*** 2 **/
#define _3 0X33 /*** 3 **/
#define _4 0X34 /*** 4 **/
#define _5 0X35 /*** 5 **/
#define _6 0X36 /*** 6 **/
#define _7 0X37 /*** 7 **/
#define _8 0X38 /*** 8 **/
#define _9 0X39 /*** 9 **/
#define _0 0X30 /*** 0 **/
#define _q 0X71 /*** q **/
#endif
#define MAXLINE 1024 /** maximum chars. on a line ***/
#define MAXBUFF 64 /** maximum lines saved in the buffer
queue ***/
/*** Here are the constants for my three different modes. ******/
#define CLEFRAW 0
#define CLEFCANONICAL 1
#define CLEFCBREAK 2
extern int mode; /** One of the above # defines *****/
/** Here is the structure for storing bound pf-keys ***/
typedef struct Fkey
{
char *str;
short type;
} fkey;
extern fkey function_key[13] ; /** strings which replace function
keys when a key is hit ***/
extern char editorfilename[];
/**** Here are a bunch of constant, variable and function defs for edin.c */
#define UP 0 /** Tells the replace buffer command ***/
#define DOWN 1 /** to look up or down **/
#define inc(x) ((x+1)%MAXBUFF) /** returns the increment of the presented
pointer ***/
#define dec(x) ( ((x-1) < 0) ?(MAXBUFF - 1):(x-1))/** ibid for decrementing */
#define flip(x) (x?(x=0):(x=1)) /*** flip the bit ***/
/*
All the previous commands will now be stored in a double linked list.
This way when I type a command I just have to circle through this list
*/
typedef struct que_struct {
char buff[1024];
int flags[1024];
struct que_struct *prev, *next;
} QueStruct;
typedef struct wct {
char *fname;
off_t fsize;
time_t ftime;
char *fimage;
int wordc;
char **wordv;
struct wct *next;
} Wct;
typedef struct wix {
Wct *pwct;
int word;
} Wix;
extern QueStruct *ring;
extern QueStruct *current;
extern int ring_size;
extern int prev_check;
extern int MAXRING;
extern char buff[MAXLINE]; /** Buffers for collecting input and **/
extern int buff_flag[MAXLINE]; /** flags for whether buff chars
are printing
or non-printing **/
extern char in_buff[1024]; /** buffer for characters read until they are
processed **/
extern int num_read;
extern int num_proc; /** num chars processed after a read **/
extern int buff_pntr; /** present length of buff **/
extern int curr_pntr; /** the current position in buff **/
/** Here are a bunch of macros for edin.c. They are mostly just charcter
comparison stuff ***/
#define back_word(x) (((*(x) == _5) && (*(x+1) == _9) && \
(*(x+2) == _q))?(1):(0))
#define fore_word(x) (((*(x) == _6) && (*(x+1) == _8) && \
(*(x+2) == _q))?(1):(0))
#define alt_f1(x) (((*(x) == _3) && (*(x+1) == _7) && \
(*(x+2) == _q))?(1):(0))
#define cntrl_end(x) (((*(x) == _4) && (*(x+1) == _8) && \
(*(x+2) == _q))?(1):(0))
#define insert_toggle(x) (((*(x) == _3) && (*(x+1) == _9) && \
(*(x+2) == _q))?(1):(0))
#define end_key(x) (((*(x) == _4) && (*(x+1) == _6) && \
(*(x+2) == _q))?(1):(0))
#define control_char(x) \
(((x >= 0x01) && (x <= 0x1a))?(1):(0))
/***
Some global defs needed for emulating a pty. This was taken from guru.h
***/
/* Return an integer that is represented by a character string */
#define ciret(x) ((cintu.c4[0]=(x)[0]), (cintu.c4[1]=(x)[1]), \
(cintu.c4[2]=(x)[2]), (cintu.c4[3]=(x)[3]), cintu.i4)
/* move an integer (x) to a character string (y) */
#define icmove(x, y) ((cintu.i4=(x)), ((y)[0]=cintu.c4[0]), \
((y)[1]=cintu.c4[1]), ((y)[2]=cintu.c4[2]), \
((y)[3]=cintu.c4[3]))
/* Return an integer that may not be on an integer boundary */
#define iiret(x) ciret(((char *)&(x)))
/* Min of two expressions */
#define min(x, y) ((x)<(y)?(x):(y))
/* Max of two expressions */
#define max(x, y) ((x)>(y)?(x):(y))
\end{chunk}
\section{include/edible.h1}
\begin{chunk}{include/edible.h1}
/* from bookvol7 chunk include/edible.h1 */
extern void check_flip(void);
extern int main(int , char * []);
extern void catch_signals(void);
extern void init_parent(void);
extern void set_function_chars(void);
extern void hangup_handler(int );
extern void terminate_handler(int );
extern void interrupt_handler(int );
extern void child_handler(int );
extern void alarm_handler(int );
extern void flip_canonical(int );
extern void flip_raw(int );
extern void etc_get_next_line(char * , int * , int );
\end{chunk}
\section{include/edin.h1}
\begin{chunk}{include/edin.h1}
/* from bookvol7 chunk include/edin.h1 */
extern void init_reader(void);
extern void init_flag(int * , int );
extern void do_reading(void);
extern void send_line_to_child(void);
extern void insert_buff_nonprinting(int );
extern void prev_buff(void);
extern void next_buff(void);
extern void insert_buff_printing(int );
extern void insert_queue(void);
extern int convert_buffer(char * , char * , int * , int );
extern void init_buff(char * , int );
extern void forwardcopy(char * , char * , int );
extern void forwardflag_cpy(int * ,int * , int );
extern void flagcpy(int * , int * );
extern void flagncpy(int * , int * , int );
extern void send_function_to_child(void);
extern void send_buff_to_child(int );
\end{chunk}
\section{include/event.h1}
\begin{chunk}{include/event.h1}
/* from bookvol7 chunk include/event.h1 */
extern void exitHyperDoc(void );
extern void helpForHyperDoc(void );
extern void mainEventLoop(void );
extern void make_window_link(char * name);
extern void quitHyperDoc(void );
extern void get_new_window(void );
#ifdef _EVENT_C
static void set_cursor(HDWindow * window , Cursor state);
static void change_cursor(Cursor state , HDWindow * window);
static void create_window(void );
static void downlink(void );
static HyperDocPage * find_page(TextNode * node);
static void handle_button(int button , XButtonEvent * event);
static void handle_event(XEvent * event);
static void handle_motion_event(XMotionEvent * event);
static int HyperDocErrorHandler(Display * display , XErrorEvent * xe);
static void init_cursor_states(void );
static void killAxiomPage(HyperDocPage * page);
static void make_busy_cursor(HDWindow * window);
static void make_busy_cursors(void );
static void memolink(void );
static void set_error_handlers(void );
static int set_window(Window window);
static void clear_exposures(Window w);
static void kill_page(HyperDocPage * page);
static HyperDocPage * returnlink(void );
static HyperDocPage * uplink(void );
static void windowlink_handler(TextNode * node);
static void lispwindowlink_handler(HyperLink * link);
static HyperDocPage * paste_button(PasteNode * paste);
static HyperLink * findButtonInList(HDWindow * window , int x , int y);
static HyperLink * get_hyper_link(XButtonEvent * event);
static void init_cursor_state(HDWindow * window);
#endif
\end{chunk}
\section{include/ex2ht.h1}
\begin{chunk}{include/ex2ht.h1}
/* from bookvol7 chunk include/ex2ht.h1 */
extern int main(int argc , char * * argv);
extern void openCoverPage(void);
extern void exToHt(char * filename);
extern void closeCoverPage(void);
extern void addFile(char * filename);
extern void closeCoverFile(void);
extern char * allocString(char * s);
extern char * strPrefix(char * prefix , char * s);
extern char * getExTitle(FILE * inFile , char * line);
extern void emitCoverLink(char * name , char * title);
extern void emitHeader(FILE * outFile , char * pageName , char * pageTitle);
extern void emitMenuEntry(char * line , FILE * outFile);
extern void emitSpadCommand(char * line , char * prefix , FILE * outFile);
extern void emitFooter(FILE * outFile);
\end{chunk}
\section{include/extent1.h1}
\begin{chunk}{include/extent1.h1}
/* from bookvol7 chunk include/extent1.h1 */
extern void compute_header_extent(HyperDocPage * page);
extern void compute_footer_extent(HyperDocPage * page);
extern void compute_scrolling_extent(HyperDocPage * page);
extern void compute_title_extent(HyperDocPage * page);
extern void compute_text_extent(TextNode * node);
#ifdef _EXTENT1_C
static void compute_begin_items_extent(TextNode * node);
static void compute_bf_extent(TextNode * node);
static void compute_box_extent(TextNode * node);
static void compute_button_extent(TextNode * node);
static void compute_center_extent(TextNode * node);
static void compute_dash_extent(TextNode * node);
static void compute_em_extent(TextNode * node);
static void compute_ifcond_extent(TextNode * node);
static void compute_image_extent(TextNode * node);
static void compute_input_extent(TextNode * node);
static void compute_ir_extent(TextNode * node);
static void compute_it_extent(TextNode * node);
static void compute_item_extent(TextNode * node);
static void compute_mbox_extent(TextNode * node);
static void compute_mitem_extent(TextNode * node);
static void compute_paste_extent(TextNode * node);
static void compute_pastebutton_extent(TextNode * node);
static void compute_punctuation_extent(TextNode * node);
static void compute_rm_extent(TextNode * node);
static void compute_spadcommand_extent(TextNode * node);
static void compute_spadsrc_extent(TextNode * node);
static void compute_spadsrctxt_extent(TextNode * node);
static void compute_table_extent(TextNode * * node);
static void compute_verbatim_extent(TextNode * node);
static void compute_word_extent(TextNode * node);
static void end_spadcommand_extent(TextNode * node);
static void end_spadsrc_extent(TextNode * node);
static void endbutton_extent(TextNode * node);
static void endif_extent(TextNode * node);
static void endpastebutton_extent(TextNode * node);
#endif
\end{chunk}
\section{include/extent2.h1}
\begin{chunk}{include/extent2.h1}
/* from bookvol7 chunk include/extent2.h1 */
extern void init_extents(void );
extern void init_text(void );
extern void init_title_extents(HyperDocPage * page);
extern void insert_bitmap_file(TextNode * node);
extern void insert_pixmap_file(TextNode * node);
extern int max_x(TextNode * node , int Ender);
extern int plh(int height);
extern void start_newline(int distance , TextNode * node);
extern int text_height(TextNode * node , int Ender);
extern int text_width(TextNode * node , int Ender);
extern int total_width(TextNode * node , int Ender);
extern int trailing_space(TextNode * node);
#ifdef _EXTENT2_C
static void center_nodes(TextNode * begin_node , TextNode * end_node);
static int input_string_width(TextNode * node);
static int punctuation_width(TextNode * node);
static int text_height1(TextNode * node , int Ender);
static int verbatim_width(TextNode * node);
static int width_of_dash(TextNode * node);
static int word_width(TextNode * node);
static int x_value(TextNode * node);
#endif
\end{chunk}
\section{include/fnct-key.h1}
\begin{chunk}{include/fnct-key.h1}
/* from bookvol7 chunk include/fnct-key.h1 */
extern void set_editor_key(void);
extern void define_function_keys(void);
extern int get_key(int , char * );
extern int get_str(int , char * );
extern void null_fnct(int );
extern void handle_function_key(int , int );
\end{chunk}
\section{include/form-ext.h1}
\begin{chunk}{include/form-ext.h1}
/* from bookvol7 chunk include/form-ext.h1 */
extern void compute_form_page(HyperDocPage * page);
extern int window_width(int cols);
#ifdef _FORM_EXT_C
static int window_height(HyperDocPage * page);
static void form_header_extent(HyperDocPage * page);
static void form_footer_extent(HyperDocPage * page);
static void form_scrolling_extent(HyperDocPage * page);
#endif
\end{chunk}
\section{include/group.h1}
\begin{chunk}{include/group.h1}
/* from bookvol7 chunk include/group.h1 */
extern void bf_top_group(void );
extern GroupItem * copy_group_stack(void );
extern void em_top_group(void );
extern void free_group_stack(GroupItem * g);
extern void init_group_stack(void );
extern void init_top_group(void );
extern void line_top_group(void );
extern int pop_group_stack(void );
extern void push_active_group(void );
extern void push_group_stack(void );
extern void push_spad_group(void );
extern void rm_top_group(void );
extern void tt_top_group(void );
extern void center_top_group(void );
\end{chunk}
\section{include/halloc.h1}
\begin{chunk}{include/halloc.h1}
/* from bookvol7 chunk include/halloc.h1 */
extern char * halloc(int bytes , char * msg);
\end{chunk}
\section{include/hash.h}
\begin{chunk}{include/hash.h}
/* from bookvol7 chunk include/hash.h */
#ifndef _HASH_H_
#define _HASH_H_ 1
typedef struct hash_entry {
char *key; /* pointer to key data */
char *data; /* Pointer to entry */
struct hash_entry *next; /* Link to next entry */
} HashEntry;
typedef int (*EqualFunction)(void *,void *);
typedef int (*HashcodeFunction)(void *,int);
typedef void (*MappableFunction) (void *);
typedef void (*FreeFunction) (void *);
typedef struct {
HashEntry **table; /* the actual table */
int size; /* size of table */
int num_entries; /* number of elements in a hash table */
EqualFunction equal; /* equality predicate for keys */
HashcodeFunction hash_code; /* create hash code for a key */
} HashTable;
#endif
\end{chunk}
\section{include/hash.h1}
\begin{chunk}{include/hash.h1}
/* from bookvol7 chunk include/hash.h1 */
extern char * alloc_string(char * str);
extern HashEntry * hash_copy_entry(HashEntry * e);
extern HashTable * hash_copy_table(HashTable * table);
extern void hash_delete(HashTable * table , char * key);
extern char * hash_find(HashTable * table , char * key);
extern void hash_init(HashTable * table, int size, EqualFunction equal,
HashcodeFunction hash_code);
extern void free_hash(HashTable * table , FreeFunction free_fun);
extern void hash_insert(HashTable * table , char * data , char * key);
extern void hash_map(HashTable * table , MappableFunction func);
extern char * hash_replace(HashTable * table , char * data , char * key);
extern int string_equal(char * s1 , char * s2);
extern int string_hash(char * s , int size);
\end{chunk}
\section{include/htadd.h1}
\begin{chunk}{include/htadd.h1}
/* from bookvol7 chunk include/htadd.h1 */
extern int main(int argc , char * * argv);
#ifdef _HTADD_C
static void add_file(char * dbname , char * name , int fresh);
static void add_new_pages(FILE * temp_db, FILE * new_file,
char * addname, char * fullname);
static int build_db_filename(short flag , char * db_dir , char * dbfilename);
static void copy_file(char * f1 , char * f2);
static void delete_db(FILE * db , FILE * temp_db , char * name);
static int delete_file(char * dbname , char * name);
static void get_filename(void);
static void parse_args(char * * argv, char * db_dir,
char * * filenames, short * fl);
static void update_db(FILE * db, FILE * temp_db, FILE * new_file,
char * addname, char * fullname, int fresh);
static int writable(struct stat buff);
#endif
\end{chunk}
\section{include/hterror.h1}
\begin{chunk}{include/hterror.h1}
/* from bookvol7 chunk include/hterror.h1 */
extern void print_page_and_filename(void );
extern void jump(void );
extern void print_token(void );
extern void token_name(int type);
extern void print_next_ten_tokens(void );
extern void htperror(char * msg , int errno);
\end{chunk}
\section{include/hthits.h1}
\begin{chunk}{include/hthits.h1}
/* from bookvol7 chunk include/hthits.h1 */
extern void regerr(int code);
extern int main(int argc , char * * argv);
extern void cmdline(int argc , char * * argv);
extern void handleHtdb(void);
extern void badDB(void);
extern void handleFile(FILE * htdbFile);
extern void handleFilePages(char * fname , int pgc , PgInfo * pgv);
extern void handlePage(FILE * infile , PgInfo * pg);
extern void splitpage(char * buf , char * * ptitle , char * * pbody);
extern void untexbuf(register char * s);
extern void searchPage(char * pgname , char * pgtitle , char * pgbody);
extern void squirt(char * s , int n);
\end{chunk}
\section{include/htinp.h1}
\begin{chunk}{include/htinp.h1}
/* from bookvol7 chunk include/htinp.h1 */
extern void ht2_input(void );
extern void make_record(void );
extern void verify_record(void );
extern char * strCopy(char * s);
extern void print_paste_line(FILE * pfile , char * str);
extern void get_spad_output(FILE * pfile , char * command , int com_type);
extern void get_graph_output(char * command , char * pagename , int com_type);
#ifdef _HTINP_C
static void make_input_file_list(void );
static char * make_input_file_name(char * buf , char * filename);
static char * make_paste_file_name(char * buf , char * filename);
static void make_the_input_file(UnloadedPage * page);
static void make_input_file_from_page(HyperDocPage * page);
static int inListAndNewer(char * inputFile , char * htFile);
static void print_paste(FILE * pfile, char * realcom, char * command,
char * pagename, int com_type);
static void print_graph_paste(FILE * pfile, char * realcom, char * command,
char * pagename, int com_type);
static void send_command(char * command , int com_type);
#endif
\end{chunk}
\section{include/hyper.h1}
\begin{chunk}{include/hyper.h1}
/* from bookvol7 chunk include/hyper.h1 */
extern void sigusr2_handler(int sig);
extern void sigcld_handler(int sig);
extern void clean_socket(void);
extern int main(int argc , char * * argv);
extern void init_page_structs(HDWindow * w);
#ifdef _HYPER_C
static void init_hash(void);
static void make_server_connections(void);
static void check_arguments(void);
#endif
\end{chunk}
\section{include/initx.h1}
\begin{chunk}{include/initx.h1}
/* from bookvol7 chunk include/initx.h1 */
extern void change_text(int color , XFontStruct * font);
extern int init_form_window(char * name , int cols);
extern int init_top_window(char * name);
extern void initializeWindowSystem(void);
extern int is_it_850(XFontStruct * fontarg);
#ifdef _INITX_C
static void get_GCs(HDWindow * window);
static int get_border_properties(void);
static int get_color(char * name , char * class , int def , Colormap * map);
static void ingItColors_and_fonts(void);
static void load_font(XFontStruct * * font_info , char * fontname);
static void mergeDatabases(void);
static void open_form_window(void);
static void open_window(Window w);
static void set_name_and_icon(void);
static void set_size_hints(Window w);
#endif
\end{chunk}
\section{include/input.h1}
\begin{chunk}{include/input.h1}
/* from bookvol7 chunk include/input.h1 */
extern InputItem * return_item(char * name);
extern void fill_box(Window w , ImageStruct * image);
extern void toggle_input_box(HyperLink * link);
extern void toggle_radio_box(HyperLink * link);
extern void change_input_focus(HyperLink * link);
extern void next_input_focus(void);
extern void prev_input_focus(void);
extern int delete_item(char * name);
#ifdef _INPUT_C
static void clear_rbs(InputBox * list);
#endif
\end{chunk}
\section{include/item.h1}
\begin{chunk}{include/item.h1}
/* from bookvol7 chunk include/item.h1 */
extern void push_item_stack(void);
extern void clear_item_stack(void);
extern void pop_item_stack(void);
extern ItemStack * copy_item_stack(void);
extern void free_item_stack(ItemStack * is);
\end{chunk}
\section{include/keyin.h1}
\begin{chunk}{include/keyin.h1}
/* from bookvol7 chunk include/keyin.h1 */
extern void handle_key(XEvent * event);
extern void init_keyin(void);
\end{chunk}
\section{include/lex.h1}
\begin{chunk}{include/lex.h1}
/* from bookvol7 chunk include/lex.h1 */
extern int connect_spad(void);
extern void get_expected_token(int type);
extern void parser_init(void);
extern void init_scanner(void);
extern void save_scanner_state(void);
extern void restore_scanner_state(void);
extern void unget_char(int c);
extern int get_char(void);
extern void unget_token(void);
extern int get_token(void);
extern void push_be_stack(int type , char * id);
extern void check_and_pop_be_stack(int type , char * id);
extern int clear_be_stack(void);
extern int be_type(char * which);
extern int begin_type(void);
extern int end_type(void);
extern void reset_connection(void);
extern int spad_busy(void);
#ifdef _LEX_C
static int get_char1(void );
static void spad_error_handler(void );
static int keyword_type(void );
#endif
\end{chunk}
\section{include/macro.h1}
\begin{chunk}{include/macro.h1}
/* from bookvol7 chunk include/macro.h1 */
extern void scan_HyperDoc(void);
extern int number(char * str);
extern ParameterList init_parameter_elem(int number);
extern int push_parameters(ParameterList new);
extern int pop_parameters(void);
extern int parse_macro(void);
extern void parse_parameters(void);
#ifdef _MACRO_C
static char * load_macro(MacroStore * macro);
static void get_parameter_strings(int number , char * macro_name);
#endif
\end{chunk}
\section{include/mem.h1}
\begin{chunk}{include/mem.h1}
/* from bookvol7 chunk include/mem.h1 */
extern ButtonList * alloc_button_list(void);
extern CondNode * alloc_condnode(void);
extern HDWindow * alloc_hd_window(void);
extern IfNode * alloc_ifnode(void);
extern InputBox * alloc_inputbox(void);
extern LineStruct * alloc_inputline(int size);
extern TextNode * alloc_node(void);
extern HyperDocPage * alloc_page(char * name);
extern PasteNode * alloc_paste_node(char * name);
extern RadioBoxes * alloc_rbs(void);
extern void free_button_list(ButtonList * bl);
extern void free_hd_window(HDWindow * w);
extern void free_input_item(InputItem * sym , short des);
extern void free_input_list(InputItem * il);
extern void free_node(TextNode * node , short des);
extern void free_page(HyperDocPage * page);
extern void free_patch(PatchStore * p);
extern void free_string(char * str);
extern char * resizeBuffer(int size , char * oldBuf , int * oldSize);
extern PatchStore * alloc_patchstore(void);
#ifdef _MEM_C
static void free_cond(CondNode * cond);
static void free_depend(SpadcomDepend * sd);
static void free_lines(LineStruct * lines);
static void dont_free(void * link);
static void free_if_non_NULL(void * p);
static void free_input_box(InputBox * box);
static void free_paste(PasteNode * paste , short des);
static void free_pastearea(TextNode * node , short des);
static void free_pastebutton(TextNode * node , short des);
static void free_radio_boxes(RadioBoxes * radio);
#endif
\end{chunk}
\section{include/parse-aux.h1}
\begin{chunk}{include/parse-aux.h1}
/* from bookvol7 chunk include/parse-aux.h1 */
extern void add_dependencies(void );
extern FILE * find_fp(FilePosition fp);
extern char * get_input_string(void );
extern HyperLink * make_link_window(TextNode * link_node , int type , int isSubWin);
extern HyperLink * make_paste_window(PasteNode * paste);
extern void make_special_pages(HashTable * pageHashTable);
extern int window_code(Window * w , int size);
extern int window_equal(Window * w1 , Window * w2);
extern char * window_id(Window w);
extern void read_ht_db(HashTable * page_hash , HashTable * macro_hash , HashTable * patch_hash);
extern int get_filename(void);
extern int is_number(char * str);
extern void parser_error(char * str);
extern int get_where(void);
#ifdef _PARSE_AUX_C
static void read_ht_file(HashTable * page_hash , HashTable * macro_hash , HashTable * patch_hash , FILE * db_fp , char * db_file);
static HyperDocPage * make_special_page(int type , char * name);
#endif
\end{chunk}
\section{include/parse.h1}
\begin{chunk}{include/parse.h1}
/* from bookvol7 chunk include/parse.h1 */
extern void display_page(HyperDocPage * page);
extern void init_parse_patch(HyperDocPage * page);
extern void load_page(HyperDocPage * page);
extern void parse_HyperDoc(void );
extern void parse_from_string(char * str);
extern HyperDocPage * parse_page_from_socket(void );
extern HyperDocPage * parse_page_from_unixfd(void );
#ifdef _PARSE_C
static void end_a_page(void );
static HyperDocPage * format_page(UnloadedPage * ulpage);
static void parse_page(HyperDocPage * page);
static void parse_replacepage(void );
static void start_footer(void );
static void start_scrolling(void );
static void Push_MR(void );
static void Pop_MR(void );
static void parse_title(HyperDocPage * page);
static void parse_header(HyperDocPage * page);
static void init_parse_page(HyperDocPage * page);
#endif
\end{chunk}
\section{include/parse-input.h1}
\begin{chunk}{include/parse-input.h1}
/* from bookvol7 chunk include/parse-input.h1 */
extern HyperLink * make_input_window(InputItem * item);
extern HyperLink * make_box_window(InputBox * box , int type);
extern void initialize_default(InputItem * item , char * buff);
extern void parse_inputstring(void);
extern void parse_simplebox(void);
extern void parse_radiobox(void);
extern void init_paste_item(InputItem * item);
extern void repaste_item(void);
extern InputItem * current_item(void);
extern int already_there(char * name);
extern void parse_radioboxes(void);
#ifdef _PARSE_INPUT_C
static void insert_item(InputItem * item);
static void add_box_to_rb_list(char * name , InputBox * box);
static int check_others(InputBox * list);
#endif
\end{chunk}
\section{include/parse-paste.h1}
\begin{chunk}{include/parse-paste.h1}
/* from bookvol7 chunk include/parse-paste.h1 */
extern void parse_paste(void);
extern void parse_pastebutton(void);
extern HyperDocPage * parse_patch(PasteNode * paste);
#ifdef _PARSE_PASTE_C
static void load_patch(PatchStore * patch);
#endif
\end{chunk}
\section{include/parse-types.h1}
\begin{chunk}{include/parse-types.h1}
/* from bookvol7 chunk include/parse-types.h1 */
extern void parse_begin_items(void );
extern void parse_box(void );
extern void parse_button(void );
extern void parse_centerline(void );
extern void parse_command(void );
extern void parse_env(TextNode * node);
extern void parse_free(void );
extern void parse_help(void );
extern void parse_ifcond(void );
extern void parse_input_pix(void );
extern void parse_item(void );
extern void parse_mbox(void );
extern void parse_mitem(void );
extern void parse_newcond(void );
extern void parse_setcond(void );
extern void parse_spadcommand(TextNode * spad_node);
extern void parse_spadsrc(TextNode * spad_node);
extern void parse_table(void );
extern void parse_value1(void );
extern void parse_value2(void );
extern void parse_verbatim(int type);
#ifdef _PARSE_TYPES_C
static void parse_condnode(void );
static void parse_hasreturnto(void );
#endif
\end{chunk}
\section{include/pixmap.h1}
\begin{chunk}{include/pixmap.h1}
/* from bookvol7 chunk include/pixmap.h1 */
extern int file_exists(char * );
extern FILE * zzopen(char * , char * );
extern void write_pixmap_file(Display *, int, char *, Window, int, int,
int, int );
extern int read_pixmap_file(Display *, int, char *, XImage * *, int *, int * );
\end{chunk}
\section{include/prt.h1}
\begin{chunk}{include/prt.h1}
/* from bookvol7 chunk include/prt.h1 */
extern void myputchar(char );
extern void clear_buff(void);
extern void move_end(void);
extern void move_home(void);
extern void move_fore_word(void);
extern void move_back_word(void);
extern void delete_current_char(void);
extern void del_print(int , int );
extern void delete_to_end_of_line(void);
extern void delete_line(void);
extern void printbuff(int , int );
extern void ins_print(int , int );
extern void reprint(int );
extern void back_up(int );
extern void back_it_up(int );
extern void print_whole_buff(void);
extern void move_ahead(void);
extern void move_back(void);
extern void back_over_current_char(void);
\end{chunk}
\section{include/readbitmap.h1}
\begin{chunk}{include/readbitmap.h1}
/* from bookvol7 chunk include/readbitmap.h1 */
extern XImage * HTReadBitmapFile(Display * display, int screen,
char * filename, int * width, int * height);
extern ImageStruct * insert_image_struct(char * filename);
#ifdef _READBITMAP_C
static int read_hot(FILE * fd , char Line[] , int * x_hot , int * y_hot);
static int read_w_and_h(FILE * fd, unsigned int * width,
unsigned int * height);
#endif
\end{chunk}
\section{include/scrollbar.h1}
\begin{chunk}{include/scrollbar.h1}
/* from bookvol7 chunk include/scrollbar.h1 */
extern void calculateScrollBarMeasures(void );
extern void drawScrollLines(void );
extern void hideScrollBars(HDWindow * hdWindow);
extern void getScrollBarMinimumSize(int * width , int * height);
extern void linkScrollBars(void );
extern void makeScrollBarWindows(void );
extern void moveScroller(HDWindow * hdWindow);
extern void scrollDown(void );
extern void scrollDownPage(void );
extern void scrollScroller(XButtonEvent * event);
extern void scrollToFirstPage(void );
extern void scrollUp(void );
extern void scrollUpPage(void );
extern void showScrollBars(HDWindow * hdWindow);
#ifdef _SCROLLBAR_C
static int ch(int height);
static void changeWindowBackgroundPixmap(Window window , Pixmap pixmap);
static void drawScroller3DEffects(HDWindow * hdWindow, int x1, int y1,
int x2, int y2);
#endif
\end{chunk}
\section{include/show-types.h1}
\begin{chunk}{include/show-types.h1}
/* from bookvol7 chunk include/show-types.h1 */
extern void show_text(TextNode * node , int Ender);
#ifdef _SHOW_TYPES_C
static void show_image(TextNode * node , GC gc);
static void show_input(TextNode * node);
static void show_link(TextNode * node);
static void show_paste(TextNode * node);
static void show_pastebutton(TextNode * node);
static void show_simple_box(TextNode * node);
static void show_spadcommand(TextNode * node);
#endif
\end{chunk}
\section{include/sockio-c.h1}
\begin{chunk}{include/sockio-c.h1}
/* from bookvol7 chunk include/sockio-c.h1 */
extern int get_int(Sock * );
extern char * get_string(Sock * );
extern double get_float(Sock * );
extern Sock * connect_to_local_server(char * , int , int );
extern int sread(Sock * , char * , int , char * );
extern double plus_infinity(void );
extern double minus_infinity(void );
extern double NANQ(void );
extern void sigpipe_handler(int );
extern int wait_for_client_read(Sock * , char * , int , char * );
extern int wait_for_client_write(Sock * , char * , int , char * );
extern int swrite(Sock * , char * , int , char * );
extern int sselect(int , fd_set * , fd_set * , fd_set * , void * );
extern int fill_buf(Sock * , char * , int , char * );
extern int sock_get_int(int );
extern int get_ints(Sock * , int * , int );
extern int sock_get_ints(int , int * , int );
extern int send_int(Sock * , int );
extern int sock_send_int(int , int );
extern int send_ints(Sock * , int * , int );
extern int sock_send_ints(int , int * , int );
extern int send_string(Sock * , char * );
extern int send_string_len(Sock * , char * , int );
extern int sock_send_string(int , char * );
extern int sock_send_string_len(int , char * , int );
extern int send_strings(Sock * , char * * , int );
extern int sock_send_strings(int , char * * , int );
extern char * sock_get_string(int );
extern char * get_string_buf(Sock * , char * , int );
extern char * sock_get_string_buf(int , char * , int );
extern int get_strings(Sock * , char * * , int );
extern int sock_get_strings(int , char * * , int );
extern int send_float(Sock * , double );
extern int sock_send_float(int , double );
extern int send_sfloats(Sock * , float * , int );
extern int sock_send_sfloats(int , float * , int );
extern int send_floats(Sock * , double * , int );
extern int sock_send_floats(int , double * , int );
extern double sock_get_float(int );
extern int get_sfloats(Sock * , float * , int );
extern int sock_get_sfloats(int , float * , int );
extern int get_floats(Sock * , double * , int );
extern int sock_get_floats(int , double * , int );
extern int wait_for_client_kill(Sock * , int );
extern int sock_get_remote_fd(int );
extern int send_signal(Sock * , int );
extern int sock_send_signal(int , int );
extern int send_wakeup(Sock * );
extern int sock_send_wakeup(int );
extern Sock * connect_to_local_server_new(char * , int , int );
extern void remote_stdio(Sock * );
extern void init_purpose_table(void );
extern int make_server_number(void );
extern void close_socket(int , char * );
extern int make_server_name(char * , char * );
extern int open_server(char * );
extern int accept_connection(Sock * );
extern void get_socket_type(Sock * );
extern int sock_accept_connection(int );
extern void redirect_stdio(Sock * );
extern void init_socks(void );
extern int server_switch(void );
extern void flush_stdout(void );
extern void print_line(char * );
\end{chunk}
\section{include/spadbuf.h1}
\begin{chunk}{include/spadbuf.h1}
/* from bookvol7 chunk include/spadbuf.h1 */
extern int main(int argc , char * * argv);
#ifdef _SPADBUF_C
static void spadbuf_inter_handler(int sig);
static void spadbuf_function_chars(void);
static void interp_io(void);
static void init_parent(void);
#endif
\end{chunk}
\section{include/spadcolors.h1}
\begin{chunk}{include/spadcolors.h1}
/* from bookvol7 chunk include/spadcolors.h1 */
extern RGB HSVtoRGB(HSV );
extern RGB HLStoRGB(HLS );
extern float value(float , float , float );
extern int makeColors(Display * , int , Colormap * , unsigned long * * , int * );
extern int makePermVector(Display * , int , unsigned long * * );
extern int makeNewColorMap(Display * , Colormap , int );
extern unsigned long XPixelColor(int );
extern void FreePixels(Display * , Colormap , int );
extern int AllocCells(Display * , Colormap , int );
\end{chunk}
\section{include/spadint.h1}
\begin{chunk}{include/spadint.h1}
/* from bookvol7 chunk include/spadint.h1 */
extern HyperDocPage * issue_server_command(HyperLink * link);
extern HyperDocPage * issue_unixlink(TextNode * node);
extern char * print_to_string(TextNode * command);
extern void issue_spadcommand(HyperDocPage * page , TextNode * command ,
int immediate , int type);
extern Sock * accept_menu_connection(Sock * server_sock);
extern char * print_to_string1(TextNode * command , int * sizeBuf);
extern int issue_serverpaste(TextNode * command);
extern void issue_unixcommand(TextNode * node);
extern int issue_unixpaste(TextNode * node);
extern void service_session_socket(void);
extern void send_lisp_command(char * command);
extern void escape_string(char * s);
extern void unescape_string(char * s);
extern char * print_source_to_string1(TextNode * command , int * sizeBuf);
extern char * print_source_to_string(TextNode * command);
#ifdef _SPADINT_C
static void start_user_buffer(HyperDocPage * page);
static void clear_execution_marks(HashTable * depend_hash);
static void issue_dependent_commands(HyperDocPage * page, TextNode * command,
int type);
static void send_pile(Sock * sock , char * str);
static void mark_as_executed(HyperDocPage * page, TextNode * command,
int type);
static void accept_menu_server_connection(HyperDocPage * page);
static void switch_frames(void );
static void close_client(int pid);
#endif
\end{chunk}
\section{include/titlebar.h1}
\begin{chunk}{include/titlebar.h1}
/* from bookvol7 chunk include/titlebar.h1 */
extern void getTitleBarMinimumSize(int * width , int * height);
extern void linkTitleBarWindows(void);
extern void makeTitleBarWindows(void);
extern void showTitleBar(void);
#ifdef _TITLEBAR_C
static void readTitleBarImages(void);
#endif
\end{chunk}
\section{include/util.h1}
\begin{chunk}{include/util.h1}
/* from bookvol7 chunk include/util.h1 */
extern int checker(int , int , char * );
extern char * getmemWithLine(int , char * , int );
extern char * saymemWithLine(char * , int , int , int );
extern void myfree(void * , int );
extern XPoint getWindowPositionXY(Display * , Window );
extern XPoint getWindowSizeXY(Display * , Window );
\end{chunk}
\section{include/wct.h1}
\begin{chunk}{include/wct.h1}
/* from bookvol7 chunk include/wct.h1 */
extern time_t ftime(char * );
extern void fatal(char * , char * );
extern off_t fsize(char * );
extern Wix * scanWct(Wct * , char * );
extern void reintern1Wct(Wct * );
extern Wix * rescanWct(void);
extern void skimWct(Wct * );
extern void skim1Wct(Wct * );
extern void printTime(long * );
extern int skimString(char * , int , int , int );
extern int prChar(int );
extern Wct * reread1Wct(Wct * );
extern void sfatal(char * );
extern Wct * read1Wct(char * );
extern Wct * nconcWct(Wct * , Wct * );
extern void sortWct(Wct * );
extern void sort1Wct(Wct * );
extern int mystrcmp(const void * , const void * );
extern void burstWct(Wct * );
extern void burst1Wct(Wct * );
extern Wct * intern1Wct(char * );
extern void load_wct_file(char * );
extern void skim_wct(void);
extern void rescan_wct(void);
extern void find_wct(void);
\end{chunk}
\chapter{Shared Code}
\subsection{BeStruct}
\index{struct!BeStruct}
\index{BeStruct struct}
\begin{chunk}{BeStruct}
typedef struct be_struct {
int type;
char *id;
struct be_struct *next;
} BeStruct;
BeStruct *top_be_stack;
\end{chunk}
\section{Shared Code for file handling}
\subsection{strpostfix}
\index{shared!strpostfix}
\index{strpostfix shared}
\begin{chunk}{strpostfix}
static int strpostfix(char *s, char *t) {
int slen = strlen(s), tlen = strlen(t);
if (tlen > slen)
return 0;
while (tlen > 0)
if (s[--slen] != t[--tlen])
return 0;
return 1;
}
\end{chunk}
\subsection{extendHT}
If the filename does not end with the string ``.pamphlet'',
or ``.ht'', or ``.pht'', then add ``.ht'' as the default.
System pages live in the bookvol7.1.pamphlet file but user
pages can live in .ht files. The .pht files are the ``paste''
files which are cached results of computations available
when hyperdoc is running without Axiom.
For system pages we hand generate the paste files and add
them to the hyperdoc volume.
\index{shared!extendHT}
\index{extendHT shared}
\begin{chunk}{extendHT}
void extendHT(char *name) {
if (!strpostfix(name, ".pamphlet") &&
!strpostfix(name, ".ht") &&
!strpostfix(name, ".pht"))
strcat(name, ".ht");
return;
}
\end{chunk}
\subsection{buildHtFilename}
This procedure is sent a filename, and from it tries to build the full
filename, this it returns in the fullname variable. If the file is not
found, then it returns a -1. The fname is the fullpath name for the file,
including the .ht extension. The aname is the filename minus the added .ht
extension, and the pathname.
\index{shared!buildHtFilename}
\index{buildHtFilename shared}
\begin{chunk}{buildHtFilename}
static int buildHtFilename(char *fname, char *aname, char *name) {
char cdir[256];
char *c_dir;
char *HTPATH;
char *trace;
char *trace2;
int ht_file;
if (cwd(name)) {
/* user wants to use the current working directory */
c_dir = (char *) getcwd(cdir, 254);
strcpy(fname, c_dir);
/* Now add the rest of the filename */
strcat(fname, "/");
strcat(fname, &name[2]);
/** now copy the actual file name to addname **/
for (trace = &name[strlen(name)]; trace != name &&
(*trace != '/'); trace--);
if (trace == name) {
fprintf(stderr, "ht_open_file: Didn't expect a filename like %s\n",
name);
exit(-1);
}
trace++;
strcpy(aname, trace);
/** add the .ht extension if needed **/
extendHT(aname);
extendHT(fname);
/*fprintf(stderr,
"TPDHERE:ht_open_file:2: name=%s aname=%s fname=%s\n",
name,aname,fname); */
/* Now just try to access the file */
return (access(fname, R_OK));
}
else if (pathname(name)) {
/* filename already has the path specified */
strcpy(fname, name);
/** now copy the actual file name to addname **/
for (trace = &name[strlen(name)]; trace != name &&
(*trace != '/'); trace--);
if (trace == name) {
fprintf(stderr, "ht_open_file: Didn't expect a filename like %s\n",
name);
exit(-1);
}
trace++;
strcpy(aname, trace);
/** add the .ht extension if needed **/
extendHT(aname);
extendHT(fname);
/* Now just try to access the file */
return (access(fname, R_OK));
}
else {/** If not I am going to have to append path names to it **/
HTPATH = (char *) getenv("HTPATH");
if (HTPATH == NULL) {
/** The user does not have a HTPATH, so I will use the the directory
$AXIOM/doc as the default path ***/
char *spad = (char *) getenv("AXIOM");
if (spad == NULL) {
fprintf(stderr,
"htFileOpen:Cannot find ht data base: setenv HTPATH or AXIOM\n");
exit(-1);
}
HTPATH = (char *) halloc(1024 * sizeof(char), "HTPATH");
strcpy(HTPATH, spad);
strcat(HTPATH, "/doc");
}
/** Now that I have filled HTPATH, I should try to open a file by the
given name **/
strcpy(aname, name);
extendHT(aname);
for (ht_file = -1, trace2 = HTPATH;
ht_file == -1 && *trace2 != '\0';) {
for (trace = fname; *trace2 != '\0' && (*trace2 != ':');)
*trace++ = *trace2++;
*trace++ = '/';
*trace = 0;
if (!strcmp(fname, "./")) {
/** The person wishes me to check the current directory too **/
getcwd(fname, 256);
strcat(fname, "/");
}
if (*trace2)
trace2++;
strcat(fname, aname);
ht_file = access(fname, R_OK);
}
return (ht_file);
}
}
\end{chunk}
\subsection{pathname}
\index{shared!pathname}
\index{pathname shared}
\begin{chunk}{pathname}
static int pathname(char *name) {
while (*name)
if (*name++ == '/')
return 1;
return 0;
}
\end{chunk}
\subsection{htFileOpen}
This procedure opens the proper HT file
\index{htFileOpen!main}
\index{main htFileOpen}
\begin{chunk}{htFileOpen}
FILE *htFileOpen(char *fname, char *aname, char *name) {
FILE *ht_fp;
int ret_value;
ret_value = buildHtFilename(fname, aname, name);
if (ret_value == -1) {
fprintf(stderr, "htFileOpen: Unknown file %s\n", fname);
exit(-1);
}
ht_fp = fopen(fname, "r");
if (ht_fp == NULL) {
perror("htFileOpen");
exit(-1);
}
return (ht_fp);
}
\end{chunk}
\subsection{dbFileOpen}
This function is responsible for actually opening the database file. For the
moment it gets the \$AXIOM environment variable, and appends to it
``doc/ht.db'', and then opens it
Modified on 12/3/89 to take a second argument. This argument tells the
open routine whether it is reading the db file, or writing it. If writing
is true, then I should check to insure I have proper write access. -JMW
Modified again on 12/9/89 so that it now uses HTPATH as the path name. Now
it initially loads up the path name into a static variable. Then upon
every trip, it gets the next ht.db found. It returns NULL when no ht.db is
found. -JMW
\index{shared!dbFileOpen}
\index{dbFileOpen shared}
\begin{chunk}{dbFileOpen}
FILE *dbFileOpen(char *dbFile) {
static char *db_path_trace = NULL;
char *dbFile_trace;
FILE *db_fp;
char *spad;
/*
* The first time through is the only time this could be true. If so, then
* create the default HTPATH for gDatabasePath.
*/
/*fprintf(stderr,"addfile:dbFileOpen: entered dbFile=%s\n",dbFile);*/
if (gDatabasePath == NULL) {
gDatabasePath = (char *) getenv("HTPATH");
if (gDatabasePath == NULL) {
spad = (char *) getenv("AXIOM");
if (spad == NULL) {
fprintf(stderr,
"addfile:dbFileOpen: Cannot find ht data base path:\n");
exit(-1);
}
gDatabasePath = (char *) halloc(sizeof(char) * 1024, "dbFileOpen");
strcpy(gDatabasePath, spad);
strcat(gDatabasePath, "/doc");
}
db_path_trace = gDatabasePath;
}
/*fprintf(stderr,"addfile:dbFileOpen: db_path_trace=%s\n",db_path_trace);*/
/*
* Now Loop until I find one with okay filename
*/
for (db_fp = NULL; db_fp == NULL && *db_path_trace != '\0';) {
for (dbFile_trace = dbFile; *db_path_trace != ':' &&
*db_path_trace != '\0'; db_path_trace++)
*dbFile_trace++ = *db_path_trace;
*dbFile_trace = '\0';
strcat(dbFile_trace, "/ht.db");
/* fprintf(stderr,"addfile:dbFileOpen: dbFile_trace=%s\n",dbFile_trace); */
/* fprintf(stderr,"addfile:dbFileOpen: dbFile=%s\n",dbFile); */
db_fp = fopen(dbFile, "r");
if (*db_path_trace != '\0')
db_path_trace++;
}
/*
if (db_fp == NULL)
fprintf(stderr,"addfile:dbFileOpen: exit (null)\n");
else
fprintf(stderr,"addfile:dbFileOpen: exit opened\n");
*/
return (db_fp);
}
\end{chunk}
\subsection{tempFileOpen}
\index{shared!tempFileOpen}
\index{tempFileOpen shared}
\begin{chunk}{tempFileOpen}
FILE *tempFileOpen(char *temp_dbFile) {
FILE *temp_db_fp;
/** Just make the name and open it **/
strcpy(temp_dbFile, temp_dir);
strcat(temp_dbFile, "ht2.db" /* dbFileName */ );
temp_db_fp = fopen(temp_dbFile, "w");
if (temp_db_fp == NULL) {
perror("tempFileOpen");
exit(-1);
}
return temp_db_fp;
}
\end{chunk}
\section{Shared Code for Hash Table Handling}
\subsection{halloc}
Allocate memory and bomb if none left (HyperDoc alloc)
\index{shared!halloc}
\index{halloc shared}
\begin{chunk}{halloc}
char *halloc(int bytes, char *msg) {
static char buf[200];
char *result;
#ifdef DEBUG
static int first = 1;
if (first) {
fp = fopen("/tmp/hallocs", "w");
first = 0;
}
#endif
result = (char *) malloc(bytes);
#ifdef DEBUG
fprintf(fp, "%d\tAlocating %d Bytes for %s\n", result,bytes, msg);
#endif
if (result == NULL) {
sprintf(buf, "Ran out of memory allocating %s.\b", msg);
fprintf(stderr, "%s\n", buf);
exit(-1);
}
return result;
}
\end{chunk}
\subsection{hashInit}
Initialize a hash table.
\index{shared!hashInit}
\index{hashInit shared}
\begin{chunk}{hashInit}
void hashInit(HashTable *table, int size, EqualFunction equal,
HashcodeFunction hash_code) {
int i;
table->table =
(HashEntry **) halloc(size * sizeof(HashEntry *), "HashEntry");
for (i = 0; i < size; i++)
table->table[i] = NULL;
table->size = size;
table->equal = equal;
table->hash_code = hash_code;
table->num_entries = 0;
}
\end{chunk}
\subsection{freeHash}
\index{shared!freeHash}
\index{freeHash shared}
\begin{chunk}{freeHash}
void freeHash(HashTable *table, FreeFunction free_fun) {
if (table) {
int i;
for (i = 0; i < table->size; i++) {
HashEntry *e, *next;
for (e = table->table[i]; e != NULL;) {
next = e->next;
(*free_fun) (e->data);
(*e).data=0;
free(e);
e = next;
}
}
free(table->table);
}
}
\end{chunk}
\subsection{hashInsert}
Insert an entry into a hash table.
\index{shared!hashInsert}
\index{hashInsert shared}
\begin{chunk}{hashInsert}
void hashInsert(HashTable *table, char *data, char *key) {
HashEntry *entry = (HashEntry *) halloc(sizeof(HashEntry), "HashEntry");
int code;
entry->data = data;
entry->key = key;
code = (*table->hash_code) (key, table->size) % table->size;
#ifdef DEBUG
fprintf(stderr, "Hash value = %d\n", code);
#endif
entry->next = table->table[code];
table->table[code] = entry;
table->num_entries++;
}
\end{chunk}
\subsection{hashFind}
\index{shared!hashFind}
\index{hashFind shared}
\begin{chunk}{hashFind}
char *hashFind(HashTable *table, char *key) {
HashEntry *entry;
int code = table->hash_code(key, table->size) % table->size;
for (entry = table->table[code]; entry != NULL; entry = entry->next)
if ((*table->equal) (entry->key, key))
return entry->data;
return NULL;
}
\end{chunk}
\subsection{hashReplace}
\index{shared!hashReplace}
\index{hashReplace shared}
\begin{chunk}{hashReplace}
char *hashReplace(HashTable *table, char *data, char *key) {
HashEntry *entry;
int code = table->hash_code(key, table->size) % table->size;
for (entry = table->table[code]; entry != NULL; entry = entry->next)
if ((*table->equal) (entry->key, key)) {
entry->data = data;
return entry->data;
}
return NULL;
}
\end{chunk}
\subsection{hashDelete}
\index{shared!hashDelete}
\index{hashDelete shared}
\begin{chunk}{hashDelete}
void hashDelete(HashTable *table, char *key) {
HashEntry **entry;
int code = table->hash_code(key, table->size) % table->size;
for (entry = &table->table[code]; *entry != NULL; entry=&((*entry)->next))
if ((*table->equal) ((*entry)->key, key)) {
*entry = (*entry)->next;
table->num_entries--;
return;
}
}
\end{chunk}
\subsection{hashMap}
\index{shared!hashMap}
\index{hashMap shared}
\begin{chunk}{hashMap}
void hashMap(HashTable *table, MappableFunction func) {
int i;
HashEntry *e;
if (table == NULL)
return;
for (i = 0; i < table->size; i++)
for (e = table->table[i]; e != NULL; e = e->next)
(*func) (e->data);
}
\end{chunk}
\subsection{hashCopyEntry}
\index{shared!hashCopyEntry}
\index{hashCopyEntry shared}
\begin{chunk}{hashCopyEntry}
HashEntry *hashCopyEntry(HashEntry *e) {
HashEntry *ne;
if (e == NULL)
return e;
ne = (HashEntry *) halloc(sizeof(HashEntry), "HashEntry");
ne->data = e->data;
ne->key = e->key;
ne->next = hashCopyEntry(e->next);
return ne;
}
/* copy a hash table */
\end{chunk}
\subsection{hashCopyTable}
\index{shared!hashCopyTable}
\index{hashCopyTable shared}
\begin{chunk}{hashCopyTable}
HashTable *hashCopyTable(HashTable *table) {
HashTable *nt = (HashTable *) halloc(sizeof(HashTable), "copy hash table");
int i;
nt->size = table->size;
nt->num_entries = table->num_entries;
nt->equal = table->equal;
nt->hash_code = table->hash_code;
nt->table = (HashEntry **) halloc(nt->size * sizeof(HashEntry *),
"copy table");
for (i = 0; i < table->size; i++)
nt->table[i] = hashCopyEntry(table->table[i]);
return nt;
}
\end{chunk}
\subsection{stringHash}
Hash code function for strings.
\index{shared!stringHash}
\index{stringHash shared}
\begin{chunk}{stringHash}
int stringHash(char *s, int size) {
int c = 0;
char *p =s;
while (*p)
c += *p++;
return c % size;
}
\end{chunk}
\subsection{stringEqual}
Test strings for equality.
\index{shared!stringEqual}
\index{stringEqual shared}
\begin{chunk}{stringEqual}
int stringEqual(char *s1, char *s2) {
return (strcmp(s1, s2) == 0);
}
\end{chunk}
\subsection{allocString}
Make a fresh copy of the given string.
\index{shared!allocString}
\index{allocString shared}
\begin{chunk}{allocString}
char *allocString(char *str) {
char * result;
result = halloc(strlen(str)+1,"String");
strcpy(result,str);
return (result);
}
\end{chunk}
\section{Shared Code for Error Handling}
\subsection{jump}
\index{shared!jump}
\index{jump shared}
\begin{chunk}{jump}
void jump(void) {
if (gWindow == NULL)
exit(-1);
longjmp(jmpbuf, 1);
fprintf(stderr, "(HyperDoc) Long Jump failed, Exiting\n");
exit(-1);
}
\end{chunk}
\subsection{dumpToken}
We need a function to print the token object for debugging.
To use this function the caller provides its own name and the
token to be printed. For instance, a call would look like:
\begin{verbatim}
dumpToken("fnname",token)
\end{verbatim}
There is no return value.
\index{shared!dumpToken}
\index{dumpToken shared}
\begin{chunk}{dumpToken}
void dumpToken(char *caller, Token t) {
fprintf(stderr,"TPDHERE:%s:dumpToken type=%s id=%s\n",
caller,token_table[t.type],t.id);
}
\end{chunk}
\subsection{printPageAndFilename}
\index{shared!printPageAndFilename}
\index{printPageAndFilename shared}
\begin{chunk}{printPageAndFilename}
void printPageAndFilename(void) {
char obuff[128];
if (gPageBeingParsed->type == Normal) {
/*
* Now try to inform the user as close to possible where the error
* occurred
*/
sprintf(obuff,
"(HyperDoc) While parsing %s on line %d\n\tin the file %s\n",
gPageBeingParsed->name, line_number,
gPageBeingParsed->filename);
}
else if (gPageBeingParsed->type == SpadGen) {
sprintf(obuff, "While parsing %s from the Spad socket\n",
gPageBeingParsed->name);
}
else if (gPageBeingParsed->type == Unixfd) {
sprintf(obuff, "While parsing %s from a Unixpipe\n",
gPageBeingParsed->name);
}
else {
/* Unknown page type */
sprintf(obuff, "While parsing %s\n", gPageBeingParsed->name);
}
fprintf(stderr, "%s", obuff);
}
\end{chunk}
\subsection{printNextTenTokens}
\index{shared!printNextTenTokens}
\index{printNextTenTokens shared}
\begin{chunk}{printNextTenTokens}
void printNextTenTokens(void) {
int i;
int v;
fprintf(stderr, "Trying to print the next ten tokens\n");
for (i = 0; i < 10; i++) {
v = getToken();
if (v == EOF)
break;
printToken();
}
fprintf(stderr, "\n");
}
\end{chunk}
\subsection{printToken}
Print out a token value.
\index{shared!printToken}
\index{printToken shared}
\begin{chunk}{printToken}
void printToken(void) {
if (token.type == Word)
printf("%s ", token.id);
else {
tokenName(token.type);
printf("\\%s ", ebuffer);
}
fflush(stdout);
}
\end{chunk}
\subsection{tokenName}
\index{shared!tokenName}
\index{tokenName shared}
\begin{chunk}{tokenName}
void tokenName(int type) {
if (type <= NumberUserTokens)
strcpy(ebuffer, token_table[type]);
else {
switch (type) {
case Lbrace:
strcpy(ebuffer, "{");
break;
case Rbrace:
strcpy(ebuffer, "}");
break;
case Macro:
strcpy(ebuffer, token.id);
break;
case Group:
strcpy(ebuffer, "{");
break;
case Pound:
strcpy(ebuffer, "#");
break;
case Lsquarebrace:
strcpy(ebuffer, "[");
break;
case Rsquarebrace:
strcpy(ebuffer, "]");
break;
case Punctuation:
strcpy(ebuffer, token.id);
break;
case Dash:
strcpy(ebuffer, token.id);
break;
case Verbatim:
strcpy(ebuffer, "\\begin{verbatim}");
break;
case Scroll:
strcpy(ebuffer, "\\begin{scroll}");
break;
case Dollar:
strcpy(ebuffer, "$");
break;
case Percent:
strcpy(ebuffer, "%");
break;
case Carrot:
strcpy(ebuffer, "^");
break;
case Underscore:
strcpy(ebuffer, "_");
break;
case Tilde:
strcpy(ebuffer, "~");
break;
case Cond:
sprintf(ebuffer, "\\%s", token.id);
break;
case Icorrection:
strcpy(ebuffer, "\\/");
break;
case Paste:
strcpy(ebuffer, "\\begin{paste}");
break;
case Patch:
strcpy(ebuffer, "\\begin{patch}");
break;
default:
sprintf(ebuffer, " %d ", type);
}
/*return 1;*/
}
}
\end{chunk}
\subsection{htperror}
This is the error handling routine in AXIOM. The main routine is
called htperror(): arguments: msg - like perror it accepts an error
message to be printed errno - the errno which occurred. This is so an
appropriate error message can be printed.
The prints out the page name, and then the filename in which the error
occurred. If possible it also tries to print out the next ten tokens.
\index{shared!htperror}
\index{htperror shared}
\begin{chunk}{htperror}
void tpderror(char *msg, int errn) {
char obuff[256];
/* The first thing I do is create the error message */
if (errno <= Numerrors) {
sprintf(obuff, "%s:%s\n", msg, errmess[errno]);
}
else {
sprintf(obuff, "%s:\n", msg);
fprintf(stderr, "Unknown error type %d\n", errno);
}
fprintf(stderr, "%s", obuff);
printPageAndFilename();
printNextTenTokens();
}
\end{chunk}
\section{Shared Code for Lexical Analyzer}
Lexical analyzer stuff. Exported functions:
\begin{itemize}
\item parserInit() -- initialize the parser tables with keywords
\item initScanner() -- initialize scanner for reading a new page
\item getToken() -- sets the ``token'' variable to be the next token
in the current input stream
\item saveScannerState() -- save the current state of scanner so
that the scanner input mode may be switched
\item restoreScannerState() -- undo the saved state
\end{itemize}
Note: The scanner reads from four separate input locations depending on the
value of the variable ``inputType''. If this variable is:
\begin{itemize}
\item FromFile -- it read from the file pointed to by ``cfile''.
\item FromString -- It reads from the string ``inputString''.
\item FromSpadSocket -- It reads from the socket pointed to by spadSocket
\item FromFD -- It reads from a file descriptor
\end{itemize}
\subsection{parserInit}
Initialize the parser keyword hash table.
\index{shared!parserInit}
\index{parserInit shared}
\begin{chunk}{parserInit}
void parserInit(void) {
int i;
Token *toke;
/* First I initialize the hash table for the tokens */
hashInit(
&tokenHashTable,
TokenHashSize,
(EqualFunction)stringEqual,
(HashcodeFunction)stringHash);
for (i = 2; i <= NumberUserTokens; i++) {
toke = (Token *) halloc(sizeof(Token), "Token");
toke->type = i;
toke->id = token_table[i];
hashInsert(&tokenHashTable, (char *)toke, toke->id);
}
}
\end{chunk}
\subsection{initScanner}
\label{initScanner}
Initialize the lexical scanner to read from a file.
\index{shared!initScanner}
\index{initScanner shared}
\begin{chunk}{initScanner}
void initScanner(void) {
if (getenv("HTASCII")) {
useAscii = (strcmp(getenv("HTASCII"), "yes") == 0);
}
else {
if(gTtFontIs850==1) useAscii = 0;
else useAscii = 1;
}
keyword = 0;
last_ch = NoChar;
last_token = 0;
inputType = FromFile;
fpos = 0;
keyword_fpos = 0;
last_command = -1;
line_number = 1;
}
\end{chunk}
\subsection{saveScannerState}
These variables save the current state of scanner. Currently only one
level of saving is allowed. In the future we should allow nested saves.
\index{shared!saveScannerState}
\index{saveScannerState shared}
\begin{chunk}{saveScannerState}
void saveScannerState(void) {
StateNode *new_item=(StateNode *)halloc((sizeof(StateNode)), "StateNode");
new_item->page_start_fpos = page_start_fpos;
new_item->fpos = fpos;
new_item->keyword_fpos = keyword_fpos;
new_item->last_ch = last_ch;
new_item->last_token = last_token;
new_item->token = token;
new_item->inputType = inputType;
new_item->inputString = inputString;
new_item->cfile = cfile;
new_item->next = top_state_node;
new_item->keyword = keyword;
top_state_node = new_item;
}
\end{chunk}
\subsection{restoreScannerState}
Restore the saved scanner state.
\index{shared!restoreScannerState}
\index{restoreScannerState shared}
\begin{chunk}{restoreScannerState}
void restoreScannerState(void) {
StateNode *x = top_state_node;
if (top_state_node == NULL) {
fprintf(stderr, "Restore Scanner State: State empty\n");
exit(-1);
}
top_state_node = top_state_node->next;
page_start_fpos = x->page_start_fpos;
fpos = x->fpos;
keyword_fpos = x->keyword_fpos;
last_ch = x->last_ch;
last_token = x->last_token;
token = x->token;
inputType = x->inputType;
inputString = x->inputString;
cfile = x->cfile;
keyword = x->keyword;
if (cfile != NULL)
fseek(cfile, fpos + page_start_fpos, 0);
/** Once that is done, lets throw away some memory **/
free(x);
}
\end{chunk}
\subsection{ungetChar}
Return the character to the input stream.
\index{shared!ungetChar}
\index{ungetChar shared}
\begin{chunk}{ungetChar}
void ungetChar(int c) {
if (c == '\n')
line_number--;
last_ch = c;
}
\end{chunk}
\subsection{getChar}
\index{shared!getChar}
\index{getChar shared}
\begin{chunk}{getChar}
int getChar(void) {
int c;
c = getChar1();
if (useAscii) {
switch (c) {
case '':
c = '-';
break;
case '':
c = '+';
break;
case '':
c = '[';
break;
case '':
c = '+';
break;
case '':
c = '-';
break;
case '':
c = '+';
break;
case '':
c = '-';
break;
case '':
c = '+';
break;
case '':
c = ']';
break;
case '':
c = '+';
break;
case '':
c = '|';
break;
default:
break;
}
}
return c;
}
\end{chunk}
\subsection{getChar1}
Return the next character in the input stream.
\index{shared!getChar1}
\index{getChar1 shared}
\begin{chunk}{getChar1}
static int getChar1(void) {
int c;
int cmd;
if (last_ch != NoChar) {
c = last_ch;
last_ch = NoChar;
if (c == '\n')
line_number++;
return c;
}
switch (inputType) {
case FromUnixFD:
c = getc(unixfd);
if (c == '\n')
line_number++;
return c;
case FromString:
c = (*inputString ? *inputString++ : EOF);
if (c == '\n')
line_number++;
return c;
case FromFile:
c = getc(cfile);
fpos++;
if (c == '\n')
line_number++;
return c;
case FromSpadSocket:
AGAIN:
if (*inputString) {
/* this should never happen for the first character */
c = *inputString++;
if (c == '\n')
line_number++;
return c;
}
if (last_command == EndOfPage)
return EOF;
if (read_again == NULL) {
last_command = cmd = get_int(spadSocket);
if (cmd == EndOfPage)
return EOF;
#ifndef HTADD
if (cmd == SpadError)
spadErrorHandler();
#endif
}
read_again = get_string_buf(spadSocket, sock_buf, 1023);
/* this will be null if this is the last time*/
inputString = sock_buf;
goto AGAIN;
default:
fprintf(stderr, "Get Char: Unknown type of input: %d\n", inputType);
return -1;
}
}
\end{chunk}
\subsection{ungetToken}
Return current token to the input stream.
\index{shared!ungetToken}
\index{ungetToken shared}
\begin{chunk}{ungetToken}
void ungetToken(void) {
last_token = 1;
unget_toke.type = token.type;
unget_toke.id = allocString(token.id - 1);
}
\end{chunk}
\subsection{getToken}
\index{shared!getToken}
\index{getToken shared}
\begin{chunk}{getToken}
int getToken(void) {
int c, ws;
int nls = 0;
static int seen_white = 0;
static char buffer[1024];
char *buf = buffer;
if (last_token) {
last_token = 0;
token.type = unget_toke.type;
strcpy(buffer, unget_toke.id);
free(unget_toke.id);
token.id = buffer + 1;
if (token.type == EOF)
return EOF;
else
return 0;
}
seen_white = nls = 0;
do {
c = getChar();
ws = whitespace(c);
if (ws)
seen_white++;
if (c == '\n') {
if (nls) {
token.type = Par;
return 0;
}
else
nls++;
}
} while (ws);
/* first character of string indicates number of spaces before token */
if (!keyword)
*buf++ = seen_white;
else
*buf++ = 0;
keyword = 0;
if (inputType != FromSpadSocket && c == '%') {
while ((c = getChar()) != '\n' && c != EOF);
/* trying to fix the comment problem: a comment line forces words
on either side together*/
/* try returning the eol */
ungetChar(c);
return getToken();
}
if (inputType == FromFile && c == '$') {
token.type = Dollar;
return 0;
}
switch (c) {
case EOF:
token.type = -1;
return EOF;
case '\\':
keyword_fpos = fpos - 1;
c = getChar();
if (!isalpha(c)) {
*buf++ = c;
token.type = Word;
*buf = '\0';
seen_white = 0;
}
else {
do {
*buf++ = c;
} while ((c = getChar()) != EOF && isalpha(c));
ungetChar(c);
*buf = '\0';
keyword = 1;
token.id = buffer + 1;
return (keywordType());
}
break;
case '{':
token.type = Lbrace;
break;
case '}':
token.type = Rbrace;
break;
case '[':
token.type = Lsquarebrace;
*buf++ = c;
*buf = '\0';
token.id = buffer + 1;
break;
case ']':
token.type = Rsquarebrace;
*buf++ = c;
*buf = '\0';
token.id = buffer + 1;
break;
case '#':
token.type = Pound;
/*
* if I get a pound then what I do is parse until I get something
* that is not an integer
*/
c = getChar();
while (isdigit(c) && (c != EOF)) {
*buf++ = c;
c = getChar();
}
ungetChar(c);
*buf = '\0';
token.id = buffer + 1;
break;
case '`':
case '\'':
case ',':
case '.':
case '!':
case '?':
case '"':
case ':':
case ';':
token.type = Punctuation;
*buf++ = c;
*buf = '\0';
/** Now I should set the buffer[0] as my flag for whether I had
white-space in front of me, and whether I had white space
behind me **/
if (buffer[0])
buffer[0] = FRONTSPACE;
c = getChar();
if (whitespace(c))
buffer[0] |= BACKSPACE;
ungetChar(c);
token.id = buffer + 1;
break;
case '-':
do {
*buf++ = c;
} while (((c = getChar()) != EOF) && (c == '-'));
ungetChar(c);
*buf = '\0';
token.type = Dash;
token.id = buffer + 1;
break;
default:
do {
*buf++ = c;
} while ((c = getChar()) != EOF && !delim(c));
ungetChar(c);
*buf = '\0';
token.type = Word;
token.id = buffer + 1;
break;
}
// dumpToken("getToken",token);
return 0;
}
\end{chunk}
\subsection{pushBeStack}
\index{shared!pushBeStack}
\index{pushBeStack shared}
\begin{chunk}{pushBeStack}
void pushBeStack(int type,char * id) {
BeStruct *be = (BeStruct *) halloc(sizeof(BeStruct), "BeginENd stack");
if (gWindow != NULL) {
be->type = type;
be->next = top_be_stack;
be->id = allocString(id);
top_be_stack = be;
}
return;
}
\end{chunk}
\subsection{checkAndPopBeStack}
This routine pops the be stack and compares types. If they are
the same then I am okay and return a 1. Else I return a two and try to
print a meaningful message.
\index{shared!checkAndPopBeStack}
\index{checkAndPopBeStack shared}
\begin{chunk}{checkAndPopBeStack}
void checkAndPopBeStack(int type,char * id) {
BeStruct *x;
if (gWindow == NULL)
return;
if (top_be_stack == NULL) { /* tried to pop when I shouldn't have */
fprintf(stderr, "Unexpected \\end{%s} \n", token.id);
printPageAndFilename();
printNextTenTokens();
jump();
}
x = top_be_stack;
if (x->type == type) {
top_be_stack = top_be_stack->next;
free(x->id);
free(x);
return;
}
/* else I didn't have a match. Lets try to write a sensible message */
fprintf(stderr, "\\begin{%s} ended with \\end{%s} \n", x->id, id);
printPageAndFilename();
printNextTenTokens();
jump();
}
\end{chunk}
\subsection{clearBeStack}
\index{shared!clearBeStack}
\index{clearBeStack shared}
\begin{chunk}{clearBeStack}
int clearBeStack(void) {
BeStruct *x = top_be_stack, *y;
top_be_stack = NULL;
while (x != NULL) {
y = x->next;
free(x);
x = y;
}
return 1;
}
\end{chunk}
\subsection{beType}
\index{shared!beType}
\index{beType shared}
\begin{chunk}{beType}
int beType(char *which) {
Token store;
getExpectedToken(Lbrace);
getExpectedToken(Word);
switch (token.id[0]) {
case 't':
if (!strcmp(token.id, "titems")) {
token.type = Begintitems;
}
else {
return -1;
}
break;
case 'p':
if (!strcmp(token.id, "page")) {
token.type = Page;
}
else if (!strcmp(token.id, "paste")) {
token.type = Paste;
}
else if (!strcmp(token.id, "patch")) {
token.type = Patch;
}
else {
return -1;
}
break;
case 'v': /* possibly a verbatim mode */
if (!strcmp(token.id, "verbatim")) {
token.type = Verbatim;
}
else {
return -1;
}
break;
case 's': /* possibly a scroll mode */
if (!strcmp("scroll", token.id)) {
token.type = Beginscroll;
}
else if (!strcmp(token.id, "spadsrc")) {
token.type = Spadsrc;
}
else {
return -1;
}
break;
case 'i': /* possibly a item */
if (!strcmp("items", token.id)) {
token.type = Beginitems;
}
else {
return -1;
}
break;
default:
return -1;
}
store.type = token.type;
/* store.id = allocString(token.id); */
getExpectedToken(Rbrace);
token.type = store.type;
/*
* strcpy(token.id, store.id); free(store.id);
*/
return 0;
}
\end{chunk}
\subsection{beginType}
This routine parses a statement of the form \verb|\begin{word}|. Once it has
read the word it tries to assign it a type. Once that is done it sends
the word id, and the type to pushBeStack and then returns the type.
For the moment I cannot even going to use a hashTable, although in the
future this may be needed.
\index{shared!beginType}
\index{beginType shared}
\begin{chunk}{beginType}
int beginType(void) {
/*Token store;*/
int ret_val;
ret_val = beType("begin");
if (ret_val == -1) {
if (gWindow == NULL || gInVerbatim)
return 1;
else {
fprintf(stderr, "Unknown begin type \\begin{%s} \n", token.id);
printPageAndFilename();
printNextTenTokens();
jump();
}
}
else {
if (gWindow != NULL && !gInVerbatim && token.type != Verbatim
&& token.type != Spadsrc) {
/* Now here I should push the needed info and then get */
pushBeStack(token.type, token.id);
}
return 1;
}
return 1;
}
\end{chunk}
\subsection{endType}
This routine gets the end type just as the beginType routine does,
But then it checks to see if recieved the proper endType. By a clever
trick, the proper end type is 3000 + type. When environments this will
have to change.
\index{shared!endType}
\index{endType shared}
\begin{chunk}{endType}
int endType(void) {
int ret;
ret = beType("end");
if (ret == -1) {
/* unrecognized end token */
if (gWindow == NULL || gInVerbatim) {
return 1;
}
else {
fprintf(stderr, "Unknown begin type \\begin{%s} \n", token.id);
printPageAndFilename();
printNextTenTokens();
jump();
}
}
else {
if (gWindow != NULL && !gInVerbatim) {
checkAndPopBeStack(token.type, token.id);
token.type += 3000;
return 1;
}
else {
if (gWindow != NULL && ((gInVerbatim && token.type == Verbatim) ||
(gInSpadsrc && token.type == Spadsrc))) {
checkAndPopBeStack(token.type, token.id);
token.type += 3000;
return 1;
}
else {
token.type += 3000;
return 1;
}
}
}
return 1;
}
\end{chunk}
\subsection{keywordType}
\index{shared!keywordType}
\index{keywordType shared}
\begin{chunk}{keywordType}
int keywordType(void) {
Token *token_ent;
/* first check to see if it is a reserved token */
token_ent = (Token *) hashFind(&tokenHashTable, token.id);
if (token_ent != NULL) {
token.type = token_ent->type;
/*
* if I am a keyword I also have to check to see if I am a begin or
* an end
*/
if (token.type == Begin)
return beginType();
if (token.type == End)
return endType();
/* next check to see if it is a macro */
}
else if (gWindow != NULL) {
if (hashFind(gWindow->fMacroHashTable, token.id) != NULL)
token.type = Macro;
else if (gPageBeingParsed->box_hash != NULL &&
hashFind(gPageBeingParsed->box_hash, token.id) != NULL)
{
token.type = Boxcond;
}
else if (hashFind(gWindow->fCondHashTable, token.id) != NULL)
token.type = Cond;
else /* We have no idea what we've got */
token.type = Unkeyword;
}
else { /* We am probably in htadd so just return. It
* is only concerned with pages anyway */
token.type = Unkeyword;
}
return 0;
}
\end{chunk}
\subsection{getExpectedToken}
Read a token, and report a syntax error if it has the wrong type.
\index{shared!getExpectedToken}
\index{getExpectedToken shared}
\begin{chunk}{getExpectedToken}
void getExpectedToken(int type) {
getToken();
if (token.type != type) {
tokenName(type);
fprintf(stderr, "syntax error: expected a %s\n", ebuffer);
if (token.type == EOF) {
printPageAndFilename();
fprintf(stderr, "Unexpected EOF\n");
}
else {
tokenName(token.type);
fprintf(stderr, "not a %s\n", ebuffer);
printPageAndFilename();
printNextTenTokens();
}
longjmp(jmpbuf, 1);
fprintf(stderr, "Could not jump to Error Page\n");
exit(-1);
}
}
\end{chunk}
\subsection{spadErrorHandler}
\index{shared!spadErrorHandler}
\index{spadErrorHandler shared}
\begin{chunk}{spadErrorHandler}
static void spadErrorHandler(void) {
/* fprintf(stderr, "got a spad error\n"); */
longjmp(jmpbuf, 1);
fprintf(stderr, "(HyperDoc) Fatal Error: Could not jump to Error Page.\n");
exit(-1);
}
\end{chunk}
\subsection{resetConnection}
\index{shared!resetConnection}
\index{resetConnection shared}
\begin{chunk}{resetConnection}
void resetConnection(void) {
if (spadSocket) {
FD_CLR(spadSocket->socket, &socket_mask);
purpose_table[spadSocket->purpose] = NULL;
close(spadSocket->socket);
spadSocket->socket = 0;
spadSocket = NULL;
if (inputString)
inputString[0] = '\0';
read_again = 0;
str_len = 0;
still_reading = 0;
connectSpad();
}
}
\end{chunk}
\subsection{spadBusy}
Returns true if spad is currently computing.
\index{shared!spadBusy}
\index{spadBusy shared}
\begin{chunk}{spadBusy}
int spadBusy(void) {
if (sessionServer == NULL)
return 1;
send_int(sessionServer, QuerySpad);
return get_int(sessionServer);
}
/* connect to AXIOM , return 0 if succesful, 1 if not */
\end{chunk}
\subsection{connectSpad}
\index{shared!connectSpad}
\index{connectSpad shared}
\begin{chunk}{connectSpad}
int connectSpad(void) {
if (!MenuServerOpened) {
fprintf(stderr,"(HyperDoc) Warning: Not connected to AXIOM Server!\n");
LoudBeepAtTheUser();
return NotConnected;
}
if (spadSocket == NULL) {
spadSocket = connect_to_local_server(SpadServer, MenuServer, Forever);
if (spadSocket == NULL) {
fprintf(stderr,
"(HyperDoc) Warning: Could not connect to AXIOM Server!\n");
LoudBeepAtTheUser();
return NotConnected;
}
}
/* if (spadBusy()) return SpadBusy; */
return Connected;
}
\end{chunk}
\section{htadd shared code}
\index{htadd shared code}
\begin{chunk}{htadd shared code}
\getchunk{include/bsdsignal.h}
\getchunk{include/bsdsignal.h1}
\getchunk{include/sockio-c.h1}
#define cwd(n) ((n[0] == '.' && n[1] == '/')?(1):(0))
#define TokenHashSize 100
FILE *cfile; /* currently active file pointer */
char ebuffer[128];
long fpos; /* Position of pointer in file in characters */
short int gInSpadsrc = 0;
short int gInVerbatim;
HyperDocPage *gPageBeingParsed;
char *inputString; /* input string read when from_string is true */
int inputType; /* indicates where to read input */
jmp_buf jmpbuf;
int keyword; /* the last command was a keyword, or a group */
long keyword_fpos; /* fpos of beginning of most recent keyword */
int last_ch; /* last character read, for ungetChar */
int last_command; /* the last socket command */
int last_token; /* most recently read token for ungetToken */
int line_number;
long page_start_fpos; /* where the current pages fpos started */
char *read_again = 0;
char sock_buf[1024]; /* buffer for socket input */
Token token; /* most recently read token */
static HashTable tokenHashTable; /* hash table of parser tokens */
StateNode *top_state_node;
Token unget_toke;
FILE *unixfd;
int useAscii; /* should we translate graphics characters on the fly */
void printPageAndFilename(void);
void printNextTenTokens(void);
extern char *token_table[];
char *token_table[] = {
"", /* Dummy token name */
"word",
"page",
"lispcommandquit",
"bf",
"link",
"downlink",
"beginscroll",
"spadcommand",
"nolines",
"env",
"par",
"centerline",
"begin",
"beginitems",
"item",
"table",
"fbox",
"tab",
"space",
"indent",
"horizontalline",
"newline",
"enditems",
"returnbutton",
"memolink",
"upbutton",
"endscroll",
"thispage",
"returnto",
"free",
"bound",
"lisplink",
"unixlink",
"mbox",
"inputstring",
"stringvalue",
"spadlink",
"inputbitmap",
"inputpixmap",
"unixcommand",
"em",
"lispcommand",
"lispmemolink",
"lispdownlink",
"spadcall",
"spadcallquit",
"spaddownlink",
"spadmemolink",
"qspadcall",
"qspadcallquit",
"inputbox",
"radioboxes",
"boxvalue",
"vspace",
"hspace",
"newcommand",
"windowid",
"beep",
"quitbutton",
"begintitems",
"titem",
"end",
"it",
"sl",
"tt",
"rm",
"ifcond",
"else",
"fi",
"newcond",
"setcond" ,
"button",
"windowlink",
"haslisp",
"hasup",
"hasreturn",
"hasreturnto",
"lastwindow",
"endtitems",
"lispwindowlink",
"beginpile",
"endpile",
"nextline",
"pastebutton",
"color",
"helppage",
"patch",
"radiobox",
"ifrecond",
"math",
"mitem",
"pagename",
"examplenumber",
"replacepage",
"inputimage",
"spadgraph",
"indentrel",
"controlbitmap"
};
\getchunk{include/token.h}
\getchunk{spadErrorHandler}
\getchunk{spadBusy}
\getchunk{connectSpad}
\getchunk{resetConnection}
\getchunk{pathname}
\getchunk{BeStruct}
\getchunk{strpostfix}
\getchunk{extendHT}
\getchunk{buildHtFilename}
\getchunk{htFileOpen}
\getchunk{tempFileOpen}
\getchunk{halloc}
\getchunk{hashInit}
\getchunk{hashInsert}
\getchunk{hashDelete}
\getchunk{hashMap}
\getchunk{hashFind}
\getchunk{hashReplace}
\getchunk{freeHash}
\getchunk{stringHash}
\getchunk{stringEqual}
\getchunk{allocString}
\getchunk{jump}
\getchunk{tokenName}
\getchunk{printToken}
\getchunk{printPageAndFilename}
\getchunk{printNextTenTokens}
\getchunk{parserInit}
\getchunk{initScanner}
\getchunk{saveScannerState}
\getchunk{restoreScannerState}
\getchunk{ungetChar}
\getchunk{getExpectedToken}
\getchunk{ungetToken}
\getchunk{getChar1}
\getchunk{getChar}
\getchunk{getToken}
\getchunk{pushBeStack}
\getchunk{clearBeStack}
\getchunk{checkAndPopBeStack}
\getchunk{beType}
\getchunk{beginType}
\getchunk{endType}
\getchunk{keywordType}
\end{chunk}
\section{hypertex shared code}
\index{hypertex shared code}
\begin{chunk}{hypertex shared code}
\getchunk{include/bsdsignal.h}
\getchunk{include/bsdsignal.h1}
\getchunk{include/sockio-c.h1}
#define cwd(n) ((n[0] == '.' && n[1] == '/')?(1):(0))
#define TokenHashSize 100
FILE *cfile; /* currently active file pointer */
char ebuffer[128];
long fpos; /* Position of pointer in file in characters */
short int gInSpadsrc = 0;
short int gInVerbatim;
HyperDocPage *gPageBeingParsed;
char *inputString; /* input string read when from_string is true */
int inputType; /* indicates where to read input */
jmp_buf jmpbuf;
int keyword; /* the last command was a keyword, or a group */
long keyword_fpos; /* fpos of beginning of most recent keyword */
int last_ch; /* last character read, for ungetChar */
int last_command; /* the last socket command */
int last_token; /* most recently read token for ungetToken */
int line_number;
long page_start_fpos; /* where the current pages fpos started */
char *read_again = 0;
char sock_buf[1024]; /* buffer for socket input */
Token token; /* most recently read token */
static HashTable tokenHashTable; /* hash table of parser tokens */
StateNode *top_state_node;
Token unget_toke;
FILE *unixfd;
int useAscii; /* should we translate graphics characters on the fly */
void printPageAndFilename(void);
void printNextTenTokens(void);
extern char *token_table[];
char *token_table[] = {
"", /* Dummy token name */
"word",
"page",
"lispcommandquit",
"bf",
"link",
"downlink",
"beginscroll",
"spadcommand",
"nolines",
"env",
"par",
"centerline",
"begin",
"beginitems",
"item",
"table",
"fbox",
"tab",
"space",
"indent",
"horizontalline",
"newline",
"enditems",
"returnbutton",
"memolink",
"upbutton",
"endscroll",
"thispage",
"returnto",
"free",
"bound",
"lisplink",
"unixlink",
"mbox",
"inputstring",
"stringvalue",
"spadlink",
"inputbitmap",
"inputpixmap",
"unixcommand",
"em",
"lispcommand",
"lispmemolink",
"lispdownlink",
"spadcall",
"spadcallquit",
"spaddownlink",
"spadmemolink",
"qspadcall",
"qspadcallquit",
"inputbox",
"radioboxes",
"boxvalue",
"vspace",
"hspace",
"newcommand",
"windowid",
"beep",
"quitbutton",
"begintitems",
"titem",
"end",
"it",
"sl",
"tt",
"rm",
"ifcond",
"else",
"fi",
"newcond",
"setcond" ,
"button",
"windowlink",
"haslisp",
"hasup",
"hasreturn",
"hasreturnto",
"lastwindow",
"endtitems",
"lispwindowlink",
"beginpile",
"endpile",
"nextline",
"pastebutton",
"color",
"helppage",
"patch",
"radiobox",
"ifrecond",
"math",
"mitem",
"pagename",
"examplenumber",
"replacepage",
"inputimage",
"spadgraph",
"indentrel",
"controlbitmap"
};
\getchunk{include/token.h}
\getchunk{spadErrorHandler}
\getchunk{spadBusy}
\getchunk{connectSpad}
\getchunk{resetConnection}
\getchunk{pathname}
\getchunk{BeStruct}
\getchunk{strpostfix}
\getchunk{extendHT}
\getchunk{buildHtFilename}
\getchunk{htFileOpen}
\getchunk{tempFileOpen}
\getchunk{halloc}
\getchunk{hashInit}
\getchunk{hashInsert}
\getchunk{hashDelete}
\getchunk{hashMap}
\getchunk{hashFind}
\getchunk{hashReplace}
\getchunk{freeHash}
\getchunk{stringHash}
\getchunk{stringEqual}
\getchunk{allocString}
\getchunk{jump}
\getchunk{tokenName}
\getchunk{printToken}
\getchunk{printPageAndFilename}
\getchunk{printNextTenTokens}
\getchunk{parserInit}
\getchunk{initScanner}
\getchunk{saveScannerState}
\getchunk{restoreScannerState}
\getchunk{ungetChar}
\getchunk{getExpectedToken}
\getchunk{ungetToken}
\getchunk{getChar1}
\getchunk{getChar}
\getchunk{getToken}
\getchunk{pushBeStack}
\getchunk{clearBeStack}
\getchunk{checkAndPopBeStack}
\getchunk{beType}
\getchunk{beginType}
\getchunk{endType}
\getchunk{keywordType}
\end{chunk}
\chapter{Shared include files}
\section{debug.c}
\begin{chunk}{debug.c}
\getchunk{include/debug.h}
#ifdef free
#undef free
hfree(char *p) {
free(p);
}
#endif
\end{chunk}
\section{include/hyper.h}
The \verb|hypertex| function, of which this is the top level, is a browser
for Axiom information. It works off a database of pages. The pages are
stored in the \verb|$AXIOM/doc| subdirectory and there is
a key file called \verb|ht.db| in that subdirectory which contains
critical information about each page. If you add or delete pages you
must rerun the \verb|htadd| command.
(See the \verb|htadd| command in \verb|src/hyper/htadd.pamphlet|.)
Generally, if you add or delete pages you can recreate a proper
\verb|pages/ht.db| file by doing:
\begin{verbatim}
cd $AXIOM/doc
htadd -f pages -n pages/*
\end{verbatim}
The \verb|hypertex| function looks in \verb|$AXIOM/doc| by
default. This can be over-ridden by setting the \verb|HTPATH| shell
variable to point to the desired directory containing the pages and
the ht.db file.
\begin{chunk}{include/hyper.h}
/* from bookvol7 chunk include/hyper.h */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <limits.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xos.h>
\getchunk{include/com.h}
\getchunk{include/token.h}
\getchunk{include/hash.h}
#define boolean unsigned short int
#ifndef TRUE
#define TRUE ((boolean) 0x1)
#endif
#ifndef FALSE
#define FALSE ((boolean) 0x0)
#endif
/* Struct forward declarations */
struct text_node;
struct input_box;
struct input_window;
struct paste_node;
struct radio_boxes;
struct group_item;
#define Scrollupbutton 1
#define Scrolldownbutton 2
#define Noopbutton 6
#define Scrolling 1
#define Header 2
#define Footer 3
#define Title 4
extern int MenuServerOpened;
/* These are all the colors one can use in HyperDoc. */
extern int gActiveColor;
extern int gAxiomColor;
extern int gBackgroundColor;
extern int gBfColor;
extern int gControlBackgroundColor;
extern int gControlForegroundColor;
extern int gEmColor;
extern int gInputBackgroundColor;
extern int gInputForegroundColor;
extern int gItColor;
extern int gRmColor;
extern int gSlColor;
extern int gTtColor;
/* These are all the different fonts one can use in HyperDoc. */
extern XFontStruct *gActiveFont;
extern XFontStruct *gAxiomFont;
extern XFontStruct *gBfFont;
extern XFontStruct *gEmFont;
extern XFontStruct *gInputFont;
extern XFontStruct *gItFont;
extern XFontStruct *gRmFont;
extern XFontStruct *gSlFont;
extern XFontStruct *gTitleFont;
extern XFontStruct *gTtFont;
/** I am implementing a state node stack, this is the structure I store **/
typedef struct state_node {
int last_ch, last_token, inputType;
long fpos, keyword_fpos;
long page_start_fpos;
Token token;
char *inputString;
FILE *cfile;
int keyword;
struct state_node *next;
} StateNode;
/** pointer to the top of the state node graph **/
extern StateNode *top_state_node;
/* structure for a hyper text link */
typedef struct hyper_link {
int type; /* Memolink, Spadlink, Downlink etc. */
Window win; /* X11 window containing active area */
union {
struct text_node *node; /* ID of link to which link refers */
struct input_box *box;
struct input_window *string;
struct paste_node *paste; /* the paste node area */
} reference;
int x,y; /* relative position inside page */
} HyperLink;
typedef struct if_node {
struct text_node *cond; /* the condition nodes*/
struct text_node *thennode;
struct text_node *elsenode;
} IfNode;
typedef struct item_stack {
int indent;
int item_indent;
int in_item;
struct item_stack *next;
} ItemStack;
typedef struct paste_node {
char *name;
int where; /* where should I be parsing from? */
short int hasbutton;
short int haspaste;
struct group_item *group;
ItemStack *item_stack;
struct text_node *arg_node;
struct text_node *end_node;
struct text_node *begin_node;
struct input_window *paste_item;
} PasteNode;
/* Structure for formatted hypertext */
typedef struct text_node {
short type; /* type of node (text, link, etc.) */
int x,y, width, height; /* relative location on screen */
int space; /* was there space in front of me ? */
union {
char *text; /* piece of text to display */
struct text_node *node; /* argument text */
struct if_node *ifnode;
} data;
HyperLink *link; /* link for active text */
union {
Pixmap pm; /* pixmap for bit images */
XImage *xi; /* pixmap image */
} image;
struct text_node *next; /* next node in formatted text */
} TextNode;
/** Structure used to store pixmaps and bitmaps **/
typedef struct image_struct {
int width,height; /** It's width and height **/
union {
Pixmap pm;
XImage *xi;
} image;
char *filename; /** The filename used to reference it **/
} ImageStruct;
/* Structure for locating HyperDoc pages in a source file */
typedef struct {
char *name; /* file name */
long pos; /* position in file */
int ln; /* the line number */
} FilePosition;
/*** The structure needed for storing a macro **/
typedef struct macro_store {
short int loaded;
FilePosition fpos;
char *name;
char *macro_string;
short number_parameters;
} MacroStore;
/** Structure needed for storing a patch **/
typedef struct patch_store {
short int loaded;
FilePosition fpos;
char *name;
char *string;
} PatchStore;
/* Here are the structures needed for doing input to HyperDoc windows. */
typedef struct line_struct {
char *buffer;
int changed; /* Has the line changed */
int line_number;
int buff_pntr;
int len;
struct line_struct *prev, *next;
} LineStruct;
typedef struct input_window {
char *name; /* symbol name */
int size; /* the length of the window */
int cursor_x; /* x-coordinate for the cursor **/
int entered; /* tells me whether I have typed here before */
int num_lines; /* number of lines needed to store buffer */
LineStruct *lines;
LineStruct *curr_line; /* the current line on which the cursor */
Window win;
struct input_window *next;
} InputItem;
/* structure for storing input boxes **/
typedef struct input_box {
char *name;
ImageStruct *selected, *unselected;
short int picked;
struct input_box *next;
struct radio_boxes *rbs;
Window win;
} InputBox;
typedef struct radio_boxes {
char *name;
InputBox *boxes;
ImageStruct *selected, *unselected;
int width, height;
struct radio_boxes *next;
} RadioBoxes;
/* Structure for spadcommand dependencies hash table entries */
typedef struct spadcom_depend {
char *label; /* dependency label */
TextNode *spadcom; /* spadcommand defining the label */
short executed; /* true iff spadcommand has benn executed */
} SpadcomDepend;
typedef struct button_list {
int x0,y0,x1,y1;
HyperLink *link;
Window win;
struct button_list *next;
} ButtonList;
/* Stucture for unformatted hyper text page */
typedef struct hyperdoc_page {
short type; /* Normal, Quitbutton, Upbutton etc. */
char *name; /* ID of page */
char *filename; /* The name of the file for the page, or null*/
int scroll_off; /* The offset in the scrolling region */
int bot_scroll_margin; /* bottom of the scrolling region */
int top_scroll_margin; /* top of the scrolling region */
TextNode *title; /* the title of the page */
TextNode *header; /* formatted version of page */
TextNode *scrolling; /* Top of scrolling region */
TextNode *footer; /* top of non-scrolling region at bottom */
Sock *sock; /* socket connection for spad buffer */
HashTable *fLinkHashTable; /* active link hash table */
ButtonList *s_button_list; /* active buttons on page */
ButtonList *button_list; /* active buttons on page */
HashTable *depend_hash; /* Hash tables of spadcommand dependencies */
InputItem *input_list; /* List of input structures */
InputItem *currentItem; /* a pntr to the currently active item */
HashTable *box_hash; /* place where all the boxes are stored */
RadioBoxes *radio_boxes; /* a linked list of radio boxes */
short pageFlags; /* A list of flags for the page */
char *helppage; /* the name of the helppage */
} HyperDocPage;
/* Structure for an unloaded page */
typedef struct unloaded_page {
short type; /* indicator of unloaded page */
char *name; /* name of page */
FilePosition fpos; /* where to find the page */
} UnloadedPage;
/* Structure for a HyperDoc Window */
typedef struct {
Window fMainWindow; /* The main text field window. */
Window fScrollWindow; /* The scrolling area of the window */
Window fDisplayedWindow; /* The current window of the above two, */
/* being filled by display */
Window fScrollUpWindow; /* Window for scrolling up a line */
Window fScrollDownWindow; /* Window for scrolling down a line */
Window scrollbar; /* the window for scrolling */
Window scroller; /* the scroller window */
Window fTitleBarButton1; /* 1st titlebar bitmap button */
Window fTitleBarButton2; /* 2nd titlebar bitmap button */
Window fTitleBarButton3; /* 3rd titlebar bitmap button */
Window fTitleBarButton4; /* 4th titlebar bitmap button */
int fScrollerTopPos; /* where the top of the scroller is */
int fScrollerHeight; /* the height of the scroller */
int fScrollBarHeight; /* the height for the scrollbar */
int scrollwidth; /* the width of the scrolling area */
int scrollheight; /* the height of the scrolling area */
int scrollupy; /* Current y position of scroll up button */
int scrolldowny; /* Current y position of scroll down button */
int scrollbary; /* Current y position of teh scrollbar */
int scrollx; /* X coordinates for all of the above */
int border_width; /* Width of the border */
HyperDocPage *page; /* currently displayed page */
int width; /* in pixels */
int height; /* in pixels */
int columns; /* Width in chars, only setable for form pages */
HyperDocPage **fMemoStack; /* stack of memo links */
HyperDocPage **fDownLinkStack;/* stack of down links */
int *fDownLinkStackTop; /* stack of down links */
int fMemoStackIndex; /* memo stack pointer */
int fDownLinkStackIndex; /* downlink stack pointer */
HashTable *fWindowHashTable; /* hash table of active subwindows */
HashTable *fPageHashTable; /* hash table of HyperDoc pages */
HashTable *fPasteHashTable; /* hash table for paste in areas */
HashTable *fMacroHashTable; /* hash table of HyperDoc macros */
HashTable *fCondHashTable; /* hash table for values */
HashTable *fPatchHashTable; /* hash table for patch locations */
int fAxiomFrame; /* Axiom frame number initializing window */
GC fStandardGC; /* Graphics context for window */
GC fInputGC; /* Graphics context for the input windows */
GC fCursorGC; /* Graphics context for the cursors */
GC fControlGC; /* Graphics context for the buttons */
Cursor fDisplayedCursor; /* The currently displayed cursor */
} HDWindow;
/* Structure for identifying appropriate link hash tables */
typedef struct {
int code; /* code of active area */
HyperDocPage *page; /* page for which hash table applies */
} LinkHashID;
/*** Flags for the page ***/
#define NOLINES 0000001 /* Ibid, for the bottom of the page */
/* external variables and functions. See the source file for a description
of their purposes */
extern HashTable gSessionHashTable; /* hash table of HD windows */
extern HDWindow *gParentWindow; /* the parent window. The one that
* appears when you first start HD */
extern HyperLink *quitLink; /** a special link to the protected quit page **/
/* From hyper.c */
extern int gXScreenNumber;
extern Display *gXDisplay;
extern int gSwitch_to_mono;
extern unsigned long * spadColors;
extern int gIsEndOfOutput;
extern HDWindow *gWindow;
extern Sock *sessionServer;
extern Sock *spadSocket;
extern HashTable gFileHashTable;
extern HashTable gImageHashTable; /* A global hash table for images */
extern Cursor gNormalCursor; /* The normal mouse cursor */
extern Cursor gActiveCursor; /* The cursor in active regions */
extern Cursor gBusyCursor; /* The clock cursor for when I am busy */
extern int gIsAxiomServer; /* true iff HyperDoc is acting as an Axiom server*/
extern int gArgc; /* original argc from main */
extern char **gArgv; /* original argv from main */
/* from lex.c */
extern long fpos, keyword_fpos;
extern Token token;
extern int last_token, inputType, last_ch;
extern char *inputString;
extern FILE *cfile;
/* from input.c */
extern XImage *picked;
extern int picked_height;
extern int picked_width;
extern XImage *unpicked;
extern int unpicked_height;
extern int unpicked_width;
/* from display.c */
extern int line_height;
extern int need_scroll_up_button;
extern int scrolling;
extern int need_scroll_down_button;
extern int space_width;
#define NoChar -9999
#define temp_dir "/tmp/"
#define dbFileName "ht.db"
#define def_spad "/usr/local/axiom"
/* Types of HyperDoc pages */
#define UlUnknownPage 9993 /*I hate this hack, but I have to know whether*/
#define UnknownPage 9994 /*this page has been loaded or not. */
#define ErrorPage 9995
#define Unixfd 9996
#define SpadGen 9997
#define Normal 9998
#define UnloadedPageType 9999
/* Commands from Axiom */
#define EndOfPage 99
#define SendLine 98
#define StartPage 97 /* A normal HyperDoc page */
#define LinkToPage 96
#define PopUpPage 95 /* A pop-up page*/
#define PopUpNamedPage 94
#define KillPage 93
#define ReplacePage 92
#define ReplaceNamedPage 91
#define SpadError 90
/* Constants declaring size of page stacks */
#define MaxMemoDepth 25 /* max nesting level for memolinks */
#define MaxDownlinkDepth 50 /* max downlink nesting depth */
/* Constants defining the size of various hash tables */
#define PageHashSize 1000
#define FileHashSize 30
#define SessionHashSize 10
#define MacroHashSize 100
#define ImageHashSize 100
#define CondHashSize 100
#define BoxHashSize 20
#define PasteHashSize 100
#define PatchHashSize 100
/* A couple of macros for memo and down links */
#define need_up_button \
(gWindow->fMemoStackIndex ? gWindow->fDownLinkStackIndex >= \
gWindow->fDownLinkStackTop[gWindow->fMemoStackIndex-1] \
: gWindow->fDownLinkStackIndex)
#define need_return_button (gWindow->fMemoStackIndex)
#define need_help_button (gWindow->page->helppage != NULL)
#define max(x,y) ((x) > (y) ? (x) : (y))
#define pick_box(box) fillBox(box->win, box->selected)
#define unpick_box(box) fillBox(box->win, box->unselected)
#define TopLevelHelpPage "ugHyperPage"
#define NoMoreHelpPage "NoMoreHelpPage"
#define KeyDefsHelpPage "ugHyperKeysPage"
#define InputAreaHelpPage "ugHyperInputPage"
/* definitions for connecting to the Axiom server */
#define Connected 0
#define NotConnected 1
#define SpadBusy 2
/* some GUI-dependent stuff */
#define BeepAtTheUser() /* (XBell(gXDisplay, 5)) */
#define LoudBeepAtTheUser() /* (XBell(gXDisplay, 50)) */
#if defined(RTplatform) || defined(PS2platform) || defined(RIOSplatform) || defined(AIX370platform)
#define RmFontDefault "Rom14"
#define TtFontDefault "Erg14"
#define ActiveFontDefault "Bld14"
#define AxiomFontDefault "Erg14"
#define EmphasizeFontDefault "Itl14"
#define BoldFontDefault "Bld14"
#endif
#if defined(SUNplatform) || defined (SUN4OS5platform) || defined(SGIplatform) || defined (HP9platform) || defined(HP10platform) || defined (ALPHAplatform) || defined(LINUXplatform) || defined(MACOSXplatform) || defined(BSDplatform)
#define RmFontDefault "-adobe-courier-medium-r-normal--18-*-*-*-m-*-iso8859-1"
#define TtFontDefault "-adobe-courier-medium-r-normal--18-*-*-*-m-*-iso8859-1"
#define ActiveFontDefault "-adobe-courier-bold-r-normal--18-*-*-*-m-*-iso8859-1"
#define AxiomFontDefault "-adobe-courier-bold-o-normal--18-*-*-*-m-*-iso8859-1"
#define EmphasizeFontDefault "-adobe-courier-medium-o-normal--18-*-*-*-m-*-iso8859-1"
#define BoldFontDefault "-adobe-courier-bold-r-normal--18-*-*-*-m-*-iso8859-1"
#endif
typedef struct group_item {
int cur_color;
XFontStruct *cur_font;
int center;
struct group_item *next;
} GroupItem;
extern GroupItem *gTopOfGroupStack;
typedef struct cond_node {
char *label;
char *cond;
} CondNode;
typedef struct parameter_list_type {
char **list; /** The parameters in string form **/
short number; /** How many parameters are there **/
struct parameter_list_type *next;
} *ParameterList;
\end{chunk}
\chapter{The spadbuf function}
\section{spadbuf Call Graph}
This was generated by the GNU cflow program with the argument list.
Note that the line:NNNN numbers refer to the line in the code after
it has been tangled from this file.
\begin{verbatim}
cflow --emacs -l -n -b -T --omit-arguments spadbuf.c
\end{verbatim}
\begin{verbatim}
;; This file is generated by GNU cflow 1.3. -*- cflow -*-
2 { 0} +-main() <int main () line:150>
3 { 1} +-fopen()
4 { 1} +-fprintf()
5 { 1} +-exit()
6 { 1} +-load_wct_file()
7 { 1} +-skim_wct()
8 { 1} +-connect_to_local_server()
9 { 1} +-bsdSignal()
10 { 1} +-spadbufInterHandler() <void spadbufInterHandler () line:55>
11 { 2} \-send_signal()
12 { 1} +-send_string()
13 { 1} +-initParent() <void initParent () line:116>
14 { 2} | +-tcgetattr()
15 { 2} | +-perror()
16 { 2} | +-exit()
17 { 2} | +-tcsetattr()
18 { 2} | +-spadbufFunctionChars()
| | <void spadbufFunctionChars () line:59>
19 { 2} | \-Cursor_shape()
20 { 1} +-define_function_keys()
21 { 1} +-init_reader()
22 { 1} \-interpIO() <void interpIO () line:70>
23 { 2} +-FD_ZERO()
24 { 2} +-FD_SET()
25 { 2} +-sselect()
26 { 2} +-perror()
27 { 2} +-FD_ISSET()
28 { 2} +-sread()
29 { 2} +-write()
30 { 2} +-get_int()
31 { 2} +-exit()
32 { 2} +-get_string_buf()
33 { 2} +-strlen()
34 { 2} +-clear_buff()
35 { 2} +-do_reading()
36 { 2} \-read()
\end{verbatim}
\section{Constants and Headers}
\subsection{System includes}
\begin{chunk}{spadbuf}
#include <termios.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#include <signal.h>
\end{chunk}
\subsection{Local includes}
\begin{chunk}{spadbuf}
\getchunk{include/debug.h}
\getchunk{include/bsdsignal.h}
\getchunk{include/edible.h}
\getchunk{include/com.h}
\getchunk{include/spadbuf.h1}
\getchunk{include/bsdsignal.h1}
\getchunk{include/sockio-c.h1}
\getchunk{include/edin.h1}
\getchunk{include/wct.h1}
\getchunk{include/prt.h1}
\getchunk{include/cursor.h1}
\getchunk{include/fnct-key.h1}
\end{chunk}
\section{externs}
\begin{chunk}{spadbuf}
extern char in_buff[]; /* buffer for storing characters read
until they are processed */
extern char buff[]; /* Buffers for collecting input and */
extern int buff_flag[]; /* flags for whether buff chars
are printing or non-printing */
\end{chunk}
\section{local variables}
\begin{chunk}{spadbuf}
unsigned char _INTR, _QUIT, _ERASE, _KILL, _EOF, _EOL, _RES1, _RES2;
int contNum; /* do reading and all the other fun stuff
* depend on this for all there ioctl's */
int num_read;
/*
* Here are the term structures I need for setting and resetting the terminal
* characteristics.
*/
struct termios oldbuf; /* the initial settings */
struct termios canonbuf; /* set it to be canonical */
struct termios childbuf;
short INS_MODE; /* Flag for insert mode */
short ECHOIT; /* Flag for echoing */
short PTY;
int MODE; /* Am I in cbreak, raw, or canonical */
char in_buff[1024]; /* buffer for storing characters read
until they are processed */
char buff[MAXLINE]; /* Buffers for collecting input and */
int buff_flag[MAXLINE]; /* flags for whether buff chars
are printing or non-printing */
int (*old_handler) ();
Sock *session_sock, *menu_sock;
char *buff_name = NULL; /* name for the aixterm */
\end{chunk}
\section{Code}
This routine used to be used to send sigint onto spad, but now they go
through just fine on their own reinstated for AIX V3.2
\subsection{spadbufInterHandler}
\index{spadbuf!spadbufInterHandler}
\index{spadbufInterHandler spadbuf}
\begin{chunk}{spadbuf}
static void spadbufInterHandler(int sig) {
send_signal(session_sock, SIGUSR2);
}
\end{chunk}
\subsection{spadbufFunctionChars}
\index{spadbuf!spadbufFunctionChars}
\index{spadbufFunctionChars spadbuf}
\begin{chunk}{spadbuf}
static void spadbufFunctionChars(void) {
/** once I have that get the special characters ****/
_INTR = oldbuf.c_cc[VINTR];
_QUIT = oldbuf.c_cc[VQUIT];
_ERASE = oldbuf.c_cc[VERASE];
_KILL = oldbuf.c_cc[VKILL];
_EOF = oldbuf.c_cc[VEOF];
_EOL = oldbuf.c_cc[VEOL];
return;
}
\end{chunk}
\subsection{interpIO}
Act as terminal session for sock connected to stdin
and stdout of another process.
\index{spadbuf!interpIO}
\index{interpIO spadbuf}
\begin{chunk}{spadbuf}
static void interpIO(void) {
char buf[1024];
fd_set rd;
int len, command;
while (1) {
FD_ZERO(&rd);
FD_SET(menu_sock->socket, &rd);
FD_SET(session_sock->socket, &rd);
FD_SET(1, &rd);
len = sselect(FD_SETSIZE, &rd, 0, 0, NULL);
if (len == -1) {
perror("stdio select");
return;
}
if (FD_ISSET(session_sock->socket, &rd)) {
len = sread(session_sock, buf, 1024, "stdio");
if (len == -1)
return;
else {
write(1, buf, len);
}
}
if (FD_ISSET(menu_sock->socket, &rd)) {
command = get_int(menu_sock);
switch (command) {
case -1:
exit(0);
case ReceiveInputLine:
get_string_buf(menu_sock, in_buff, 1024);
num_read = strlen(in_buff);
clear_buff();
do_reading();
break;
case TestLine:
break;
default:
break;
}
}
if (FD_ISSET(1, &rd)) {
num_read = read(0, in_buff, 1024);
do_reading();
}
}
}
\end{chunk}
\subsection{}
\index{spadbuf!initParent}
\index{initParent spadbuf}
\begin{chunk}{spadbuf}
static void initParent(void) {
/** get the original termio settings, so I never have to check again **/
if (tcgetattr(0,&oldbuf) == -1) {
perror("Clef Trying to get terms initial settings");
exit(-1);
}
/** get the settings for my different modes ***/
if (tcgetattr(0,&canonbuf) == -1) {
perror("Clef Getting terminal settings");
exit(-1);
}
/*** set the buffer to read before an eoln is typed ***/
canonbuf.c_lflag &= ~(ICANON | ECHO | ISIG);
canonbuf.c_lflag |= ISIG;
/*** Accordingly tell it we want every character ***/
canonbuf.c_cc[VMIN] = 1; /* we want every character */
canonbuf.c_cc[VTIME] = 1; /* these may require tweaking */
if (tcsetattr(0, TCSAFLUSH, &canonbuf) == -1) {
perror("Spadbuf setting parent to canon");
exit(0);
}
/*
* This routine is in edin.c and sets the users preferences for function
* keys. In order to use it I have to set childbuf to be the same as
* oldbuf
*/
spadbufFunctionChars();
INS_MODE = 0;
ECHOIT = 1;
Cursor_shape(2);
}
\end{chunk}
\subsection{main}
Modified on 6/13/90 for the command line completion abiltities of
Since I am only calling this program from within spadint, I decided
that the usage should be.
\begin{verbatim}
spadbuf page_name [completion_ files]
\end{verbatim}
\index{spadbuf!main}
\index{main spadbuf}
\begin{chunk}{spadbuf}
int main(int argc,char ** argv) {
FILE *fopen();
if (argc < 2) {
fprintf(stderr, "Usage : spadbuf page_name [completion_files] \n");
exit(-1);
}
buff_name = *++argv;
while (*++argv) {
load_wct_file(*argv);
}
skim_wct();
session_sock=connect_to_local_server(SessionServer, InterpWindow, Forever);
menu_sock = connect_to_local_server(MenuServerName, InterpWindow, Forever);
bsdSignal(SIGINT, spadbufInterHandler,RestartSystemCalls);
/*
* set contNum so it is pointing down the socket to the childs
*/
contNum = session_sock->socket;
send_string(menu_sock, buff_name);
initParent();
define_function_keys();
init_reader();
PTY = 0;
interpIO();
return(1);
}
\end{chunk}
\chapter{The ex2ht function}
\section{ex2ht Call Graph}
This was generated by the GNU cflow program with the argument list.
Note that the line:NNNN numbers refer to the line in the code after
it has been tangled from this file.
\begin{verbatim}
cflow --emacs -l -n -b -T --omit-arguments ex2ht.c
\end{verbatim}
\begin{verbatim}
;; This file is generated by GNU cflow 1.3. -*- cflow -*-
2 { 0} +-main() <int main () line:180>
3 { 1} +-fprintf()
4 { 1} +-openCoverPage() <void openCoverPage () line:141>
5 { 2} | +-fopen()
6 { 2} | +-fprintf()
7 { 2} | \-exit()
8 { 1} +-exToHt() <void exToHt () line:47>
9 { 2} | +-fopen()
10 { 2} | +-fprintf()
11 { 2} | +-strcpy()
12 { 2} | +-strcat()
13 { 2} | +-strlen()
14 { 2} | +-allocString() <char *allocString () line:20>
15 { 3} | | +-malloc()
16 { 3} | | +-strlen()
17 { 3} | | \-strcpy()
18 { 2} | +-getExTitle() <char *getExTitle () line:36>
19 { 3} | +-fgets()
20 { 3} | +-strPrefix() <char *strPrefix () line:26>
21 { 3} | +-strlen()
22 { 3} | \-fprintf()
23 { 2} | +-emitCoverLink() <void emitCoverLink () line:161>
24 { 3} | | \-fprintf()
25 { 2} | +-emitHeader() <void emitHeader () line:103>
26 { 3} | | \-fprintf()
27 { 2} | +-fgets()
28 { 2} | +-strPrefix() <char *strPrefix () line:26> [see 20]
29 { 2} | +-emitMenuEntry() <void emitMenuEntry () line:112>
30 { 3} | | \-fprintf()
31 { 2} | +-emitSpadCommand() <void emitSpadCommand () line:125>
32 { 3} | | \-fprintf()
33 { 2} | +-emitFooter() <void emitFooter () line:108>
34 { 3} | | \-fprintf()
35 { 2} | +-fclose()
36 { 2} | +-stat()
37 { 2} | \-timercmp()
38 { 1} +-closeCoverPage() <void closeCoverPage () line:152>
39 { 2} \-fprintf()
40 { 1} +-addFile() <void addFile () line:165>
41 { 2} +-fopen()
42 { 2} +-fprintf()
43 { 2} +-exit()
44 { 2} +-getc()
45 { 2} +-putc()
46 { 2} +-fclose()
47 { 2} \-unlink()
48 { 1} \-closeCoverFile() <void closeCoverFile () line:156>
49 { 2} +-fclose()
50 { 2} \-utimes()
\end{verbatim}
\section{ex2ht Source Code}
The ex2ht command creates a cover page for structured HyperDoc example pages
\section{Constants and Headers}
\subsection{System includes}
\begin{chunk}{ex2ht}
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
\end{chunk}
\subsection{Local includes}
\begin{chunk}{ex2ht}
\getchunk{include/debug.h}
\getchunk{include/ex2ht.h1}
\end{chunk}
\section{defines}
\begin{chunk}{ex2ht}
#define MaxLineLength 512
#define MaxFiles 100
\end{chunk}
\section{local variables}
\begin{chunk}{ex2ht}
char *files[MaxFiles];
int numFiles = 0;
struct timeval latest_date[2] ={{0,0},{0,0}};
FILE *coverFile;
\end{chunk}
\section{Code}
\subsection{allocString}
\index{ex2ht!allocString}
\index{allocString ex2ht}
\begin{chunk}{ex2ht}
char *allocString(char *s) {
char *t = (char *) malloc(strlen(s) + 1);
strcpy(t, s);
return t;
}
\end{chunk}
\subsection{strPrefix}
\index{ex2ht!strPrefix}
\index{strPrefix ex2ht}
\begin{chunk}{ex2ht}
char *strPrefix(char *prefix, char *s) {
while (*prefix != '\0' && *prefix == *s) {
prefix++;
s++;
}
if (*prefix == '\0')
return s;
return NULL;
}
\end{chunk}
\subsection{getExTitle}
\index{ex2ht!getExTitle}
\index{getExTitle ex2ht}
\begin{chunk}{ex2ht}
char *getExTitle(FILE *inFile, char *line) {
char *title;
while (fgets(line, MaxLineLength, inFile) != NULL)
if ((title = strPrefix("% Title: ", line))) {
title[strlen(title) - 1] = '\0';
return title;
}
fprintf(stderr, "No Title title line in the file!\n");
return NULL;
}
\end{chunk}
\subsection{exToHt}
\index{ex2ht!exToHt}
\index{exToHt ex2ht}
\begin{chunk}{ex2ht}
void exToHt(char *filename) {
char line[MaxLineLength], *line2;
char *title, *pagename;
FILE *inFile = fopen(filename, "r");
FILE *outFile;
int len, i;
struct timeval tvp;
struct stat buf;
if (inFile == NULL) {
fprintf(stderr, "couldn't open %s for reading.\n", filename);
return;
}
strcpy(line, "Menu");
strcat(line, filename);
len = strlen(line);
for (i = 0; i < len; i++)
if (line[i] == '.') {
line[i] = '\0';
break;
}
outFile = fopen(line, "w");
if (outFile == NULL) {
fprintf(stderr, "couldn't open %s for writing.\n", line);
return;
}
pagename = allocString(line);
title = getExTitle(inFile, line);
if (title == NULL) {
return;
}
files[numFiles++] = pagename;
emitCoverLink(pagename, title);
emitHeader(outFile, pagename, title);
while (fgets(line, MaxLineLength, inFile) != NULL) {
if ((line2 = strPrefix("\\begin{page}{", line)))
emitMenuEntry(line2, outFile);
else if ((line2 = strPrefix("\\spadcommand{", line)))
emitSpadCommand(line2, "\\spadcommand{", outFile);
else if ((line2 = strPrefix("\\spadpaste{", line)))
emitSpadCommand(line2, "\\spadpaste{", outFile);
else if ((line2 = strPrefix("\\example{", line)))
emitSpadCommand(line2, "\\example{", outFile);
else if ((line2 = strPrefix("\\graphpaste{", line)))
emitSpadCommand(line2, "\\graphpaste{", outFile);
}
emitFooter(outFile);
fclose(inFile);
fclose(outFile);
stat(filename,&buf);
tvp.tv_sec =buf.st_mtime;
tvp.tv_usec =0;
if timercmp(&tvp,&latest_date[1],>){
latest_date[1].tv_sec=buf.st_mtime;
}
}
\end{chunk}
\subsection{emitHeader}
\index{ex2ht!emitHeader}
\index{emitHeader ex2ht}
\begin{chunk}{ex2ht}
void emitHeader(FILE *outFile, char *pageName, char *pageTitle) {
fprintf(outFile, "\\begin{page}{%s}{%s}\n", pageName, pageTitle);
fprintf(outFile, "\\beginscroll\\beginmenu\n");
}
\end{chunk}
\subsection{emitFooter}
\index{ex2ht!emitFooter}
\index{emitFooter ex2ht}
\begin{chunk}{ex2ht}
void emitFooter(FILE *outFile) {
fprintf(outFile, "\\endmenu\\endscroll\\end{page}\n");
}
\end{chunk}
\subsection{emitMenuEntry}
s is ``pageName\}\{title\}''
\index{ex2ht!emitMenuEntry}
\index{emitMenuEntry ex2ht}
\begin{chunk}{ex2ht}
void emitMenuEntry(char *line, FILE *outFile) {
char pageName[MaxLineLength], title[MaxLineLength];
char *p = pageName, *t = title;
while (*line != '}')
*p++ = *line++;
*p = '\0';
line++;
while (*line != '}')
*t++ = *line++;
*t = '\0';
fprintf(outFile, "\\menudownlink%s}{%s}\n", title, pageName);
}
\end{chunk}
\subsection{emitSpadCommand}
\index{ex2ht!emitSpadCommand}
\index{emitSpadCommand ex2ht}
\begin{chunk}{ex2ht}
void emitSpadCommand(char *line, char *prefix, FILE *outFile) {
int braceCount = 1;
char command[MaxLineLength], *t = command;
while (1) {
if (*line == '}')
braceCount--;
if (braceCount == 0)
break;
if (*line == '{')
braceCount++;
*t++ = *line++;
}
*t = '\0';
fprintf(outFile, "%s%s}\n", prefix, command);
}
\end{chunk}
\subsection{openCoverPage}
\index{ex2ht!openCoverPage}
\index{openCoverPage ex2ht}
\begin{chunk}{ex2ht}
void openCoverPage(void) {
coverFile = fopen("coverex.ht", "w");
if (coverFile == NULL) {
fprintf(stderr, "couldn't open coverex.ht for writing\n");
exit(-1);
}
fprintf(coverFile, "%% DO NOT EDIT! Created by ex2ht.\n\n");
fprintf(coverFile, "\\begin{page}{ExampleCoverPage}{Examples Of AXIOM Commands}\n");
fprintf(coverFile, "\\beginscroll\\table{\n");
}
\end{chunk}
\subsection{closeCoverPage}
\index{ex2ht!closeCoverPage}
\index{closeCoverPage ex2ht}
\begin{chunk}{ex2ht}
void closeCoverPage(void) {
fprintf(coverFile, "}\\endscroll\\end{page}\n\n");
}
\end{chunk}
\subsection{closeCoverFile}
\index{ex2ht!closeCoverFile}
\index{closeCoverFile ex2ht}
\begin{chunk}{ex2ht}
void closeCoverFile(void) {
fclose(coverFile);
utimes("coverex.ht",latest_date);
}
\end{chunk}
\subsection{emitCoverLink}
\index{ex2ht!emitCoverLink}
\index{emitCoverLink ex2ht}
\begin{chunk}{ex2ht}
void emitCoverLink(char *name, char *title) {
fprintf(coverFile, "{\\downlink{%s}{%s}}\n", title, name);
}
\end{chunk}
\subsection{addFile}
\index{ex2ht!addFile}
\index{addFile ex2ht}
\begin{chunk}{ex2ht}
void addFile(char *filename) {
FILE *file = fopen(filename, "r");
int c;
if (file == NULL) {
fprintf(stderr, "Couln't open %s for reading\n", filename);
exit(-1);
}
while ((c = getc(file)) != EOF)
putc(c, coverFile);
putc('\n', coverFile);
fclose(file);
unlink(filename);
}
\end{chunk}
\subsection{main}
\index{ex2ht!main}
\index{main ex2ht}
\begin{chunk}{ex2ht}
int main(int argc, char **argv){
int i;
if (argc == 1) {
fprintf(stderr, "usage: %s exfile.ht ...\n", argv[0]);
return (-1);
}
openCoverPage();
for (i = 1; i < argc; i++)
exToHt(argv[i]);
closeCoverPage();
for (i = 0; i < numFiles; i++)
addFile(files[i]);
closeCoverFile();
return 0;
}
\end{chunk}
\chapter{The htadd command}
\section{htadd Call Graph}
This was generated by the GNU cflow program with the argument list.
Note that the line:NNNN numbers refer to the line in the code after
it has been tangled from this file.
\begin{verbatim}
cflow --emacs -l -n -b -T --omit-arguments htadd.c
\end{verbatim}
\begin{verbatim}
;; This file is generated by GNU cflow 1.3. -*- cflow -*-
2 { 0} +-main() <int main () line:2528>
3 { 1} +-parseArgs() <void parseArgs () line:2188>
4 { 2} | +-strcmp()
5 { 2} | +-fprintf()
6 { 2} | +-exit()
7 { 2} | \-strcpy()
8 { 1} +-fprintf()
9 { 1} +-parserInit() <void parserInit () line:1611>
10 { 2} | +-hashInit() <void hashInit () line:1376>
11 { 3} | \-halloc() <char *halloc () line:1355>
12 { 4} | +-fopen()
13 { 4} | +-malloc()
14 { 4} | +-fprintf()
15 { 4} | +-sprintf()
16 { 4} | \-exit()
17 { 2} | +-stringEqual() <int stringEqual () line:1470>
18 { 3} | \-strcmp()
19 { 2} | +-stringHash() <int stringHash () line:1462>
20 { 2} | +-halloc() <char *halloc () line:1355> [see 11]
21 { 2} | \-hashInsert() <void hashInsert () line:1389>
22 { 3} | +-halloc() <char *halloc () line:1355> [see 11]
23 { 3} | \-fprintf()
24 { 1} +-buildDBFilename() <int buildDBFilename () line:2241>
25 { 2} +-getenv()
26 { 2} +-fprintf()
27 { 2} +-sprintf()
28 { 2} +-strcpy()
29 { 2} +-stat()
30 { 2} +-perror()
31 { 2} +-exit()
32 { 2} \-writable() <int writable () line:2224>
33 { 3} +-geteuid()
34 { 3} +-getegid()
35 { 3} \-fprintf()
36 { 1} +-unlink()
37 { 1} +-deleteFile() <int deleteFile () line:2473>
38 { 2} | +-strcpy()
39 { 2} | +-extendHT() <void extendHT () line:1223>
40 { 3} | | +-strpostfix() <int strpostfix () line:1213>
41 { 4} | | | \-strlen()
42 { 3} | | \-strcat()
43 { 2} | +-fopen()
44 { 2} | +-fprintf()
45 { 2} | +-tempFileOpen() <FILE *tempFileOpen () line:1343>
46 { 3} | | +-strcpy()
47 { 3} | | +-strcat()
48 { 3} | | +-fopen()
49 { 3} | | +-perror()
50 { 3} | | \-exit()
51 { 2} | +-deleteDB() <void deleteDB () line:2495>
52 { 3} | | +-initScanner() <void initScanner () line:1628>
53 { 4} | | +-getenv()
54 { 4} | | \-strcmp()
55 { 3} | | +-getChar() <int getChar () line:1775>
56 { 4} | | | \-getChar1() <int getChar1 () line:1718>
57 { 5} | | | +-getc()
58 { 5} | | | +-get_int()
59 { 5} | | | +-spadErrorHandler()
| | | | <void spadErrorHandler () line:1149>
60 { 6} | | | | +-longjmp()
61 { 6} | | | | +-fprintf()
62 { 6} | | | | \-exit()
63 { 5} | | | +-get_string_buf()
64 { 5} | | | \-fprintf()
65 { 3} | | +-getFilename() <void getFilename () line:2442>
66 { 4} | | | +-getChar() <int getChar () line:1775> [see 55]
67 { 4} | | | +-whitespace()
68 { 4} | | | +-fprintf()
69 { 4} | | | +-exit()
70 { 4} | | | +-filedelim()
71 { 4} | | | \-ungetChar() <void ungetChar () line:1685>
72 { 3} | | +-allocString() <char *allocString () line:1474>
73 { 4} | | +-halloc() <char *halloc () line:1355> [see 11]
74 { 4} | | +-strlen()
75 { 4} | | \-strcpy()
76 { 3} | | +-getToken() <int getToken () line:1820> (R)
77 { 4} | | | +-strcpy()
78 { 4} | | | +-free()
79 { 4} | | | +-getChar() <int getChar () line:1775> [see 55]
80 { 4} | | | +-whitespace()
81 { 4} | | | +-ungetChar() <void ungetChar () line:1685> [see 71]
82 { 4} | | | +-getToken() <int getToken () line:1820>
| | | | (recursive: see 76) [see 76]
83 { 4} | | | +-isalpha()
84 { 4} | | | +-keywordType() <int keywordType () line:2150> (R)
85 { 5} | | | +-hashFind() <char *hashFind () line:1424>
86 { 5} | | | +-beginType() <int beginType () line:2088> (R)
87 { 6} | | | +-beType() <int beType () line:2020> (R)
88 { 7} | | | +-getExpectedToken()
| | | | <void getExpectedToken () line:1691> (R)
89 { 8} | | | +-getToken() <int getToken () line:1820>
| | | | (recursive: see 76) [see 76]
90 { 8} | | | +-tokenName() <void tokenName () line:1489>
91 { 9} | | | | +-strcpy()
92 { 9} | | | | \-sprintf()
93 { 8} | | | +-fprintf()
94 { 8} | | | +-printPageAndFilename()
| | | | <void printPageAndFilename () line:1571>
95 { 9} | | | | +-sprintf()
96 { 9} | | | | \-fprintf()
97 { 8} | | | +-printNextTenTokens()
| | | | <void printNextTenTokens () line:1598> (R)
98 { 9} | | | | +-fprintf()
99 { 9} | | | | +-getToken() <int getToken () line:1820>
| | | | | (recursive: see 76) [see 76]
100 { 9} | | | | \-printToken() <void printToken () line:1561>
101 { 10} | | | | +-printf()
102 { 10} | | | | +-tokenName()
| | | | | <void tokenName () line:1489> [see 90]
103 { 10} | | | | \-fflush()
104 { 8} | | | +-longjmp()
105 { 8} | | | \-exit()
106 { 7} | | | \-strcmp()
107 { 6} | | | +-fprintf()
108 { 6} | | | +-printPageAndFilename()
| | | | <void printPageAndFilename () line:1571> [see 94]
109 { 6} | | | +-printNextTenTokens()
| | | | <void printNextTenTokens () line:1598> (R) [see 97]
110 { 6} | | | +-jump() <void jump () line:1481>
111 { 7} | | | +-exit()
112 { 7} | | | +-longjmp()
113 { 7} | | | \-fprintf()
114 { 6} | | | \-pushBeStack() <void pushBeStack () line:1974>
115 { 7} | | | +-halloc() <char *halloc () line:1355> [see 11]
116 { 7} | | | \-allocString()
| | | <char *allocString () line:1474> [see 72]
117 { 5} | | | \-endType() <int endType () line:2113> (R)
118 { 6} | | | +-beType() <int beType () line:2020> (R) [see 87]
119 { 6} | | | +-fprintf()
120 { 6} | | | +-printPageAndFilename()
| | | | <void printPageAndFilename () line:1571> [see 94]
121 { 6} | | | +-printNextTenTokens()
| | | | <void printNextTenTokens () line:1598> (R) [see 97]
122 { 6} | | | +-jump() <void jump () line:1481> [see 110]
123 { 6} | | | \-checkAndPopBeStack()
| | | <void checkAndPopBeStack () line:1996> (R)
124 { 7} | | | +-fprintf()
125 { 7} | | | +-printPageAndFilename()
| | | | <void printPageAndFilename () line:1571> [see 94]
126 { 7} | | | +-printNextTenTokens()
| | | | <void printNextTenTokens () line:1598> (R)
| | | | [see 97]
127 { 7} | | | +-jump() <void jump () line:1481> [see 110]
128 { 7} | | | \-free()
129 { 4} | | | +-isdigit()
130 { 4} | | | \-delim()
131 { 3} | | +-atoi()
132 { 3} | | +-strcmp()
133 { 3} | | +-fprintf()
134 { 3} | | +-putc()
135 { 3} | | \-free()
136 { 2} | +-fclose()
137 { 2} | +-copyFile() <void copyFile () line:2429>
138 { 3} | | +-fopen()
139 { 3} | | +-getc()
140 { 3} | | +-putc()
141 { 3} | | \-fclose()
142 { 2} | \-unlink()
143 { 1} \-addfile() <void addfile () line:2285>
144 { 2} +-htFileOpen() <FILE *htFileOpen () line:1326>
145 { 3} | +-buildHtFilename() <int buildHtFilename () line:1231>
146 { 4} | | +-cwd()
147 { 4} | | +-getcwd()
148 { 4} | | +-strcpy()
149 { 4} | | +-strcat()
150 { 4} | | +-strlen()
151 { 4} | | +-fprintf()
152 { 4} | | +-exit()
153 { 4} | | +-extendHT() <void extendHT () line:1223> [see 39]
154 { 4} | | +-access()
155 { 4} | | +-pathname() <int pathname () line:1198>
156 { 4} | | +-getenv()
157 { 4} | | +-halloc() <char *halloc () line:1355> [see 11]
158 { 4} | | \-strcmp()
159 { 3} | +-fprintf()
160 { 3} | +-exit()
161 { 3} | +-fopen()
162 { 3} | \-perror()
163 { 2} +-fopen()
164 { 2} +-fprintf()
165 { 2} +-exit()
166 { 2} +-tempFileOpen() <FILE *tempFileOpen () line:1343> [see 45]
167 { 2} +-updateDB() <void updateDB () line:2327>
168 { 3} | +-addNewPages() <void addNewPages () line:2378>
169 { 4} | +-stat()
170 { 4} | +-fprintf()
171 { 4} | +-initScanner() <void initScanner () line:1628> [see 52]
172 { 4} | +-getToken() <int getToken () line:1820> (R) [see 76]
173 { 4} | +-Special()
174 { 4} | +-ptype()
175 { 4} | +-exit()
176 { 4} | \-printf()
177 { 3} | +-initScanner() <void initScanner () line:1628> [see 52]
178 { 3} | +-getChar() <int getChar () line:1775> [see 55]
179 { 3} | +-getFilename() <void getFilename () line:2442> [see 65]
180 { 3} | +-allocString() <char *allocString () line:1474> [see 72]
181 { 3} | +-getToken() <int getToken () line:1820> (R) [see 76]
182 { 3} | +-atoi()
183 { 3} | +-strcmp()
184 { 3} | +-saveScannerState() <void saveScannerState () line:1646>
185 { 4} | | \-halloc() <char *halloc () line:1355> [see 11]
186 { 3} | +-restoreScannerState()
| <void restoreScannerState () line:1662>
187 { 4} | +-fprintf()
188 { 4} | +-exit()
189 { 4} | +-fseek()
190 { 4} | \-free()
191 { 3} | +-fprintf()
192 { 3} | +-putc()
193 { 3} | \-free()
194 { 2} +-fclose()
195 { 2} +-copyFile() <void copyFile () line:2429> [see 137]
196 { 2} \-unlink()
\end{verbatim}
The \verb|htadd| function can manipulate the database of hypertex pages.
To rebuild the hypertex database changes to the \verb|$AXIOM/doc|
subdirectory and type:
\begin{verbatim}
htadd -f pages -n pages/*
\end{verbatim}
This will create a file called \verb|pages/ht.db| which contains entries
similar to:
\begin{verbatim}
algebra.ht 1102052108
\page AlgebraPage 216 9
\page NumberTheoryPage 763 28
ALIST.ht 1102052108
\newcommand AssociationListXmpTitle 140 3
\newcommand AssociationListXmpNumber 195 4
\page AssociationListXmpPage 313 7
ALIST.pht 1102052108
\patch AssociationListXmpPagePatch1 0 1
\patch AssociationListXmpPageEmpty1 447 11
...
\end{verbatim}
\section{Constants and Headers}
\subsection{System includes}
\begin{chunk}{htadd}
#include <sys/stat.h>
#include <errno.h>
#include <setjmp.h>
#include <ctype.h>
\end{chunk}
\subsection{structs}
\begin{chunk}{htadd}
typedef struct toke { /* HyperDoc parser tokens */
int type; /* token type. One of those listed below */
char *id; /* string value if type == Identifier */
} Token;
\end{chunk}
\subsection{Local includes}
\begin{chunk}{htadd}
\getchunk{include/hyper.h}
\getchunk{include/htadd.h1}
\getchunk{include/addfile.h1}
\getchunk{include/halloc.h1}
\getchunk{include/hash.h1}
\getchunk{include/hterror.h1}
\getchunk{include/lex.h1}
\end{chunk}
\subsection{extern references}
\begin{chunk}{htadd}
extern HyperDocPage *gPageBeingParsed;
extern short int gInSpadsrc;
extern short int gInVerbatim;
extern int line_number; /* keeps track of which line a page starts on
* in a file. This way someone can start
* including a line number counter into
* HyperDoc. */
\end{chunk}
\subsection{defines}
\begin{chunk}{htadd}
#define Delete 1
#define System 2
#define Current 4
#define Named 8
#define ptype(c, t) (strcpy(c, t));
#define Special(t) (( t == Page || t == NewCommand || t == Patch )?(1):(0))
#define usage "usage: htadd [-s|-l|-f db-directory] [-d|-n] filenames"
#define special(c) ((c) == '{' || (c) == '}' || (c) == '#' || (c) == '%' || \
(c) == '\\' || (c) == '[' || (c) == ']' || (c) == '_' || \
(c) == ' ' || (c) == '$' || (c) == '~' || (c) == '^' || \
(c) == '&')
#define punctuation(c) ((c)== '`' || (c) == '\'' || (c) == ',' || \
(c) == '.' || (c) == '?' || (c) == '"' || \
(c) == ';' || (c) == ':' || (c) == '-')
#define whitespace(c) ((c) == ' ' || (c) == '\t' || (c) == '\n')
#define delim(c) \
(whitespace(c) || special(c) || punctuation(c))
#define filedelim(c) \
(whitespace(c))
\end{chunk}
\subsection{forward declarations}
\begin{chunk}{htadd}
static void updateDB(FILE *db, FILE *temp_db, FILE *new_file,
char *addname, char *fullname, int fresh);
static void addNewPages(FILE *temp_db, FILE *new_file,
char *addname, char *fullname);
static void copyFile(char *f1, char *f2);
static void getFilename(void);
static void deleteDB(FILE *db, FILE *temp_db, char *name);
FILE *htFileOpen(char *fname, char *aname, char *name);
FILE *tempFileOpen(char *temp_dbFile);
char *allocString(char *str);
void printNextTenTokens(void);
int getToken(void);
int keywordType(void);
\end{chunk}
\subsection{local variables}
\begin{chunk}{htadd}
int fresh = 0;
int MenuServerOpened;
int gTtFontIs850=0;
HDWindow *gWindow = NULL;
Display *gXDisplay;
int gXScreenNumber;
Sock *sessionServer = NULL;
Sock *spadSocket = NULL;
extern int still_reading;
extern int str_len;
\end{chunk}
\section{The Shared Code}
\begin{chunk}{htadd}
\getchunk{htadd shared code}
\end{chunk}
\section{Code}
\subsection{parseArgs}
This routine parses the command line arguments. It parses
the command line arguments. It returns a flag which tells the calling
routine what database file to use, and whether or not to delete files.
\index{htadd!parseArgs}
\index{parseArgs htadd}
\begin{chunk}{htadd}
static void parseArgs(char **argv, char *db_dir, char **filenames, short *fl) {
*fl = 0;
while (*++argv) {
if (!strcmp(*argv, "-d"))
*fl |= Delete;
else if (!strcmp(*argv, "-s")) {
if (*fl & Current || *fl & Named) {
fprintf(stderr, "%s\n", usage);
exit(-1);
}
*fl |= System;
}
else if (!strcmp(*argv, "-n")) {
fresh = 1;
}
else if (!strcmp(*argv, "-l")) {
if (*fl & System || *fl & Named) {
fprintf(stderr, "%s\n", usage);
exit(-1);
}
*fl |= Current;
}
else if (!strcmp(*argv, "-f")) {
if (*fl & System || *fl & Current) {
fprintf(stderr, "%s\n", usage);
exit(-1);
}
*fl |= Named;
strcpy(db_dir, *++argv);
}
else
*filenames++ = *argv;
}
*filenames = NULL;
}
\end{chunk}
\subsection{writable}
Check to see if the user has permission
\index{htadd!writable}
\index{writable htadd}
\begin{chunk}{htadd}
static int writable(struct stat buff) {
#ifdef DEBUG
unsigned short uid = geteuid(), gid = getegid();
fprintf(stderr, "Uid = %d and Gid = %d\n", uid, gid);
#endif
/*
* Checks the status structure sent against the user id, and goup id
*/
if ((buff.st_uid == geteuid()) && (buff.st_mode & S_IWUSR))
return 1;
else if ((buff.st_gid == getegid()) && (buff.st_mode & S_IWGRP))
return 1;
else if ((buff.st_mode & S_IWOTH))
return 1;
return 0;
}
\end{chunk}
\subsection{buildDBFilename}
This procedure builds the db filename. Subsequently, it is passed onto all
the add files that are called.
\index{htadd!buildDBFilename}
\index{buildDBFilename htadd}
\begin{chunk}{htadd}
static int buildDBFilename(short flag, char *db_dir, char *dbfilename) {
int ret_status;
struct stat buff;
char *SPAD;
char path[256];
if (flag & System) {
SPAD = (char *) getenv("AXIOM");
if (SPAD == NULL) {
fprintf(stderr,
"buildDBFilename: Defaulting on $AXIOM\n");
SPAD = (char *) def_spad;
}
sprintf(dbfilename, "%s/doc/%s", SPAD, dbFileName);
sprintf(path, "%s/doc", SPAD);
}
else if (flag & Named) {
sprintf(dbfilename, "%s/%s", db_dir, dbFileName);
strcpy(path, db_dir);
}
else { /* use the current directory */
sprintf(dbfilename, "./%s", dbFileName);
sprintf(path, "./");
}
/* fprintf(stderr,"htadd:buildDBFilename:dbfilename=%s\n",dbfilename);*/
/* Now see if I can write to the file */
ret_status = stat(dbfilename, &buff);
if (ret_status == -1) {
if (errno == ENOENT) {
/* If the file does not exist, then check it's path */
ret_status = stat(path, &buff);
}
if (ret_status == -1) {
perror("build_dbFile");
exit(-1);
}
}
/* check the status */
if (writable(buff))
return 1;
fprintf(stderr, "buildDBFilename: Database file name is not writable\n");
exit(-1);
return 0;
}
\end{chunk}
\subsection{addfile}
This procedure now works as follows:
\begin{enumerate}
\item It adds the files to the dbFile without full pathnames.\\
Two names are going to be used when adding a file -
\begin{itemize}
\item addname <-- The name without any paths
\item fullname <-- The name with a path prepended to it
\end{itemize}
\item If the user specifies a pathname, then it is the path name that
is used. If the user does not specify a path name, then possible
paths are found as follows:
\begin{itemize}
\item If the user has an environment variable HTPATH set, the
paths mentioned are used.
\item If not, then the \$AXIOM environment variable is used.
\end{itemize}
\end{enumerate}
\index{htadd!addfile}
\index{addfile htadd}
\begin{chunk}{htadd}
static void addfile(char *dbname, char *name, int fresh) {
char fullname[256];
char temp_dbFile[256];
FILE *db_fp = NULL;
FILE *temp_db_fp = NULL;
FILE *ht_fp = NULL;
char addname[100];
/*char *HTPATH;*/
/*char *trace;*/
/*char *spad;*/
/** First thing I should do is find the proper file and open it **/
ht_fp = htFileOpen(fullname, addname, name);
/*
* Now I should try to open the two database files. The one to work with,
* and the temporary one; Send it a 1 so it checks for write access
*/
if (fresh) {
if ((db_fp = fopen(dbname, "a")) == NULL) {
fprintf(stderr, "Can't open database: %s file for appending\n",
dbname);
exit(-1);
}
}
else {
if ((db_fp = fopen(dbname, "r")) == NULL) {
}
}
if (!fresh)
temp_db_fp = tempFileOpen(temp_dbFile);
/** Now actually update the file by adding the changes ***/
updateDB(db_fp, temp_db_fp, ht_fp, addname, fullname, fresh);
if (!fresh)
fclose(temp_db_fp);
fclose(ht_fp);
if (db_fp != NULL)
fclose(db_fp);
if (!fresh) {
copyFile(temp_dbFile, dbname);
unlink(temp_dbFile);
}
}
\end{chunk}
\subsection{updateDB}
\index{htadd!updateDB}
\index{updateDB htadd}
\begin{chunk}{htadd}
static void updateDB(FILE *db, FILE *temp_db, FILE *new_file,
char *addname, char *fullname, int fresh) {
/*fprintf(stderr,"TPDHERE:updateDB:addname=%s fullname=%s fresh=%d/n",
addname,fullname,fresh); */
char *fname;
int c, file_there = 0, mtime;
if (fresh) {
addNewPages(db, new_file, addname, fullname);
return;
}
if (db == NULL) {
addNewPages(temp_db, new_file, addname, fullname);
return;
}
initScanner();
cfile = db;
c = getChar();
do {
if (c == '\t') {
getFilename();
fname = allocString(token.id);
getToken();
mtime = atoi(token.id);
if (strcmp(fname, addname) == 0) {
saveScannerState();
addNewPages(temp_db, new_file, addname, fullname);
restoreScannerState();
file_there = 1;
while ((c = getChar()) != EOF) {
if (c == '\t')
break;
}
}
else {
fprintf(temp_db, "\t%s %d", fname, mtime);
while ((c = getChar()) != EOF) {
if (c == '\t')
break;
putc(c, temp_db);
}
}
free(fname);
}
else
c = getChar();
} while (c != EOF);
if (!file_there) {
addNewPages(temp_db, new_file, addname, fullname);
}
}
\end{chunk}
\subsection{addNewPages}
\index{htadd!addNewPages}
\index{addNewPages htadd}
\begin{chunk}{htadd}
static void addNewPages(FILE *temp_db, FILE *new_file,
char *addname, char *fullname) {
char type[15];
int pos;
int present_type;
int pages = 0;
struct stat fstats;
stat(fullname, &fstats);
fprintf(temp_db, "\t%s %d\n", addname, (int)fstats.st_mtime);
cfile = new_file;
initScanner();
while (getToken() != EOF) {
if (Special(token.type)) {
ptype(type, token.id);
present_type = token.type;
pos = keyword_fpos;
getToken();
if (token.type != Lbrace) {
fprintf(stderr,"missing left brace after a page, macro ");
fprintf(stderr,"or patch declaration\n In the file ");
fprintf(stderr,"%s on line %d\n", fullname, line_number);
exit(-1);
}
getToken();
if (present_type == Page && token.type != Word) {
fprintf(stderr, "missing page name after \\begin{page}\n");
fprintf(stderr,
"In the file %s on line %d\n", fullname, line_number);
exit(-1);
}
else if (present_type == Macro && token.type != Macro) {
fprintf(stderr, "Expected a \\macro name after newcommand, ");
fprintf(stderr,"got %s\n",token.id);
fprintf(stderr, "In the file %s on line %d\n",
fullname, line_number);
exit(-1);
}
else if (present_type == Patch && token.type != Word) {
fprintf(stderr, "Missing patch name after a \\begin{patch}\n");
fprintf(stderr, "In the file %s on line %d\n",
fullname, line_number);
exit(-1);
}
fprintf(temp_db, "\\%s %s %d %d\n", type,
token.id, pos, line_number);
pages++;
}
}
printf("Added %3d pages and/or macros from %s\n", pages, addname);
}
\end{chunk}
\subsection{copyFile}
\index{htadd!copyFile}
\index{copyFile htadd}
\begin{chunk}{htadd}
static void copyFile(char *f1, char *f2) {
FILE *fp1, *fp2;
int c;
fp1 = fopen(f1, "r");
fp2 = fopen(f2, "w");
while ((c = getc(fp1)) != EOF) {
putc(c, fp2);
}
fclose(fp2);
fclose(fp1);
}
\end{chunk}
\subsection{getFilename}
\index{htadd!getFilename}
\index{getFilename htadd}
\begin{chunk}{htadd}
static void getFilename(void) {
int c, ws;
static char buffer[256];
char *buf = buffer;
do {
keyword_fpos = fpos;
c = getChar();
ws = whitespace(c);
} while (ws);
switch (c) {
case EOF:
fprintf(stderr, "Error trying to read ht.db, unexpected EOF\n");
exit(-1);
case '%':
case '\\':
case '{':
case '}':
fprintf(stderr, "Error unexpexted character %c\n",c);
exit(-1);
default:
do {
*buf++ = c;
} while ((c = getChar()) != EOF && !filedelim(c));
ungetChar(c);
*buf = '\0';
token.type = Word;
token.id = buffer;
break;
}
}
\end{chunk}
\subsection{deleteFile}
\index{htadd!deleteFile}
\index{deleteFile htadd}
\begin{chunk}{htadd}
static int deleteFile(char *dbname, char *name) {
char temp_dbFile[256];
FILE *db_fp, *temp_db_fp;
char dname[256];
strcpy(dname, name);
extendHT(dname);
/* Open both the tmp database and the real one */
if ((db_fp = fopen(dbname, "r")) == NULL) {
fprintf(stderr, "database file is empty, nothing to delete\n");
return 1;
}
temp_db_fp = tempFileOpen(temp_dbFile);
/** Now actually update the file by deleting the pages */
deleteDB(db_fp, temp_db_fp, dname);
fclose(temp_db_fp);
if (db_fp != NULL)
fclose(db_fp);
copyFile(temp_dbFile, dbname);
unlink(temp_dbFile);
return 0;
}
\end{chunk}
\subsection{deleteDB}
\index{htadd!deleteDB}
\index{deleteDB htadd}
\begin{chunk}{htadd}
static void deleteDB(FILE *db, FILE *temp_db, char *name) {
char *fname;
int c/*, file_there = 0*/, mtime;
initScanner();
cfile = db;
c = getChar();
do {
if (c == '\t') {
getFilename();
fname = allocString(token.id);
getToken();
mtime = atoi(token.id);
if (strcmp(fname, name) == 0) {
while ((c = getChar()) != EOF) {
if (c == '\t')
break;
}
}
else {
fprintf(temp_db, "\t%s %d", fname, mtime);
while ((c = getChar()) != EOF) {
if (c == '\t')
break;
putc(c, temp_db);
}
}
free(fname);
}
else
c = getChar();
} while (c != EOF);
}
\end{chunk}
\subsection{main}
\index{htadd!main}
\index{main htadd}
\begin{chunk}{htadd}
int main(int argc, char **argv) {
/*int i;*/
char db_dir[256]; /* the directory where the db file is */
char dbfilename[256]; /* the database filename */
char *filenames[1000]; /* the files to be added */
char **fnames = filenames;
short flag; /* flag for deleting or adding */
parseArgs(argv, db_dir, filenames, &flag);
if (!filenames[0]) {
fprintf(stderr, "%s\n", usage);
return -1;
}
parserInit();
buildDBFilename(flag, db_dir, dbfilename);
if (fresh)
unlink(dbfilename);
if (flag & Delete)
while (*fnames)
deleteFile(dbfilename, *fnames++);
else
while (*fnames)
addfile(dbfilename, *fnames++, fresh);
return 0;
}
\end{chunk}
\chapter{The hthits function}
This source file implements HyperDoc's ability to scan files for a
given pattern. For that purpose it needs a ``regex'' for string
pattern matching.
This source file used to rely on \verb|<regexp.h>| which was
originally part of the X/Open System Interface and Headers Issue 2.
However, since then, it has been withdrawn and no longer always
available on newer platfroms. Consequently, we need to use a
different, portable regex library. The POSIX definition provides one,
namely through \verb|<regex.h>|. That is what we use now. Its
availability is tested at configure time.
\begin{verbatim}
hthits pattern htdb-file
\end{verbatim}
Scan HyperDoc files for a given pattern.
The output contains lines of the form:
\begin{verbatim}
page-name`title`n
\end{verbatim}
The title and body of each page are scanned but the name is not. It is
possible that the title matches but not any lines. The number of matches
in the page (n) is given last. (SMW Feb 91)
\section{hthits Call Graph}
This was generated by the GNU cflow program with the argument list.
Note that the line:NNNN numbers refer to the line in the code after
it has been tangled from this file.
\begin{verbatim}
cflow --emacs -l -n -b -T --omit-arguments hthits.c
\end{verbatim}
\begin{verbatim}
;; This file is generated by GNU cflow 1.3. -*- cflow -*-
2 { 0} +-main() <int main () line:279>
3 { 1} +-cmdline() <void cmdline () line:28>
4 { 2} | +-fprintf()
5 { 2} | \-exit()
6 { 1} +-regcomp()
7 { 1} \-handleHtdb() <void handleHtdb () line:38>
8 { 2} +-fopen()
9 { 2} +-badDB() <void badDB () line:269>
10 { 3} | +-fprintf()
11 { 3} | \-exit()
12 { 2} +-getc()
13 { 2} +-ungetc()
14 { 2} +-handleFile() <void handleFile () line:53>
15 { 3} | +-fgets()
16 { 3} | +-sscanf()
17 { 3} | +-stat()
18 { 3} | +-fprintf()
19 { 3} | +-exit()
20 { 3} | +-ftell()
21 { 3} | +-strncmp()
22 { 3} | +-free()
23 { 3} | +-malloc()
24 { 3} | +-fseek()
25 { 3} | +-strcmp()
26 { 3} | +-strncpy()
27 { 3} | +-badDB() <void badDB () line:269> [see 9]
28 { 3} | \-handleFilePages() <void handleFilePages () line:138>
29 { 4} | +-fopen()
30 { 4} | +-fprintf()
31 { 4} | +-exit()
32 { 4} | +-handlePage() <void handlePage () line:151>
33 { 5} | | +-free()
34 { 5} | | +-malloc()
35 { 5} | | +-fprintf()
36 { 5} | | +-exit()
37 { 5} | | +-fseek()
38 { 5} | | +-fread()
39 { 5} | | +-splitpage() <void splitpage () line:211>
40 { 6} | | | +-fprintf()
41 { 6} | | | \-exit()
42 { 5} | | +-untexbuf() <void untexbuf () line:240>
43 { 6} | | | \-isalpha()
44 { 5} | | +-printf()
45 { 5} | | \-searchPage() <void searchPage () line:179>
46 { 6} | | +-regexec()
47 { 6} | | +-printf()
48 { 6} | | +-squirt() <void squirt () line:197>
49 { 7} | | | \-printf()
50 { 6} | | \-strlen()
51 { 4} | \-fclose()
52 { 2} \-fclose()
\end{verbatim}
\section{Constants and Headers}
\subsection{System includes}
\begin{chunk}{hthits}
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <regex.h>
\end{chunk}
\subsection{defines}
\begin{chunk}{hthits}
#define MAX_HTDB_LINE 1024
#define MAX_ENTRY_TYPE 30 /* I.e. \page \newcommand \patch ... */
#define MAX_ENTRY_NAME 1024 /* E.g. DifferentialCalculusPage */
#define MAX_COMP_REGEX 1024
\end{chunk}
\subsection{structs}
\index{struct!PgInfo}
\index{PgInfo struct}
\begin{chunk}{hthits}
typedef struct pgInfo {
char name[MAX_ENTRY_NAME];
long start, size;
} PgInfo ;
\end{chunk}
\subsection{Local includes}
\begin{chunk}{hthits}
\getchunk{include/debug.h}
\getchunk{include/hthits.h1}
\end{chunk}
\subsection{local variables}
\begin{chunk}{hthits}
char *progName;
char *pattern;
char *htdbFName;
int gverifydates=0;
regex_t reg_pattern;
\end{chunk}
\subsection{cmdline}
\index{hthits!cmdline}
\index{cmdline hthits}
\begin{chunk}{hthits}
void cmdline(int argc,char ** argv) {
progName = argv[0];
if (argc != 3) {
fprintf(stderr, "Usage: %s pattern htdb-file\n", progName);
exit(1);
}
pattern = argv[1];
htdbFName = argv[2];
}
\end{chunk}
\subsection{handleHtdb}
\index{hthits!handleHtdb}
\index{handleHtdb hthits}
\begin{chunk}{hthits}
void handleHtdb(void) {
FILE *htdbFile;
int c;
htdbFile = fopen(htdbFName, "r");
if (htdbFile == NULL)
badDB();
while ((c = getc(htdbFile)) != EOF) {
if (c != '\t')
badDB();
ungetc(c, htdbFile);
handleFile(htdbFile);
}
fclose(htdbFile);
}
\end{chunk}
\subsection{handleFile}
\index{hthits!handleFile}
\index{handleFile hthits}
\begin{chunk}{hthits}
void handleFile(FILE *htdbFile) {
static PgInfo *pgInfoV = 0;
static int pgInfoC = 0;
char htdbLine[MAX_HTDB_LINE];
char htfname[MAX_HTDB_LINE];
time_t httime;
long htsize;
struct stat htstat;
long fstart, fend;
int rc, i, npages;
char entname[MAX_ENTRY_NAME], enttype[MAX_ENTRY_TYPE];
long entoffset, entlineno;
fgets(htdbLine, MAX_HTDB_LINE, htdbFile);
sscanf(htdbLine, " %s %ld", htfname, &httime);
/*
* 1. Verify file: get size and check modification time.
*/
rc = stat(htfname, &htstat);
if (rc == -1) {
fprintf(stderr, "%s: Cannot access %s\n", progName, htfname);
exit(1);
}
if (gverifydates && (htstat.st_mtime != httime)) {
fprintf(stderr, "%s: Out of date file %s\n", progName, htfname);
exit(1);
}
htsize = htstat.st_size;
/*
* 2. Count the pages in the file.
*/
npages = 0;
fstart = ftell(htdbFile);
fend = ftell(htdbFile);
while (fgets(htdbLine, MAX_HTDB_LINE, htdbFile) != NULL) {
if (htdbLine[0] == '\t')
break;
if (!strncmp(htdbLine, "\\page", 5))
npages++;
fend = ftell(htdbFile);
}
/*
* 3. Find offset and size of each \page (skipping \newcommands etc.)
*/
if (npages > pgInfoC) {
if (pgInfoV)
free(pgInfoV);
pgInfoC = npages;
pgInfoV = (PgInfo *)
malloc(npages * sizeof(PgInfo));
if (!pgInfoV) {
fprintf(stderr, "%s: out of memory\n", progName);
exit(1);
}
}
fseek(htdbFile, fstart, 0);
for (i = 0; fgets(htdbLine, MAX_HTDB_LINE, htdbFile) != NULL;) {
if (htdbLine[0] == '\t')
break;
sscanf(htdbLine, "%s %s %ld %ld",
enttype, entname, &entoffset, &entlineno);
if (i > 0 && pgInfoV[i - 1].size == -1)
pgInfoV[i - 1].size = entoffset - pgInfoV[i - 1].start;
if (!strcmp(enttype, "\\page")) {
strncpy(pgInfoV[i].name, entname, MAX_ENTRY_NAME);
pgInfoV[i].start = entoffset;
pgInfoV[i].size = -1;
i++;
}
}
if (i > 0 && pgInfoV[i - 1].size == -1)
pgInfoV[i - 1].size = htsize - pgInfoV[i - 1].start;
if (i != npages)
badDB();
/*
* 4. Position database input to read next file-description
*/
fseek(htdbFile, fend, 0);
/*
* 5. Process the pages of the file.
*/
handleFilePages(htfname, npages, pgInfoV);
}
\end{chunk}
\subsection{handleFilePages}
\index{hthits!handleFilePages}
\index{handleFilePages hthits}
\begin{chunk}{hthits}
void handleFilePages(char *fname, int pgc, PgInfo *pgv) {
FILE *infile;
int i;
infile = fopen(fname, "r");
if (infile == NULL) {
fprintf(stderr, "%s: Cannot read file %s\n", progName, fname);
exit(1);
}
for (i = 0; i < pgc; i++)
handlePage(infile, pgv + i);
fclose(infile);
}
\end{chunk}
\subsection{handlePage}
\index{hthits!handlePage}
\index{handlePage hthits}
\begin{chunk}{hthits}
void handlePage(FILE *infile,PgInfo * pg) {
static char *pgBuf = 0;
static int pgBufSize = 0;
char *title, *body;
if (pg->size > pgBufSize - 1) {
if (pgBuf)
free(pgBuf);
pgBufSize = pg->size + 20000;
pgBuf = (char *)malloc(pgBufSize);
if (!pgBuf) {
fprintf(stderr,"%s: Out of memory\n", progName);
exit(1);
}
}
fseek(infile, pg->start, 0);
fread(pgBuf, pg->size, 1, infile);
pgBuf[pg->size] = 0;
splitpage(pgBuf, &title, &body);
/*untexbuf(title);*/
untexbuf(body);
#ifdef DEBUG
printf("-------------- %s -------------\n%s", pg->name, pgBuf);
printf("============== %s =============\n", title);
printf("%s", body);
#endif
searchPage(pg->name, title, body);
}
\end{chunk}
\subsection{searchPage}
\index{hthits!searchPage}
\index{searchPage hthits}
\begin{chunk}{hthits}
void searchPage(char *pgname,char * pgtitle,char * pgbody) {
char *bodyrest;
regmatch_t match_pos;
int nhits = 0;
if (!regexec(®_pattern, pgtitle, 1, &match_pos, 0))
nhits++;
bodyrest = pgbody;
while (!regexec(®_pattern, bodyrest, 1, &match_pos, 0)) {
nhits++;
bodyrest += match_pos.rm_eo;
}
if (nhits) {
printf("\\newsearchresultentry{%d}{%s}",nhits, pgtitle);
squirt(pgname, strlen(pgname));
printf("\n");
}
}
\end{chunk}
\subsection{squirt}
Given string s and length n, output ` followed by the first n characters
of s with ` and newline converted to blanks. This function destructively
modifies s.
\index{hthits!squirt}
\index{squirt hthits}
\begin{chunk}{hthits}
void squirt(char *s, int n) {
register char *t, *e;
int c;
c = s[n];
for (t = s, e = s + n; t < e; t++)
if (*t == '`' || *t == '\n')
*t = ' ';
if (s[n] != 0) {
s[n] = 0;
}
printf("{%.*s}", n, s);
s[n] = c;
}
\end{chunk}
\subsection{splitpage}
Any newlines and separator characters in the title are changed to blanks.
\index{hthits!splitpage}
\index{splitpage hthits}
\begin{chunk}{hthits}
void splitpage(char *buf, char **ptitle, char **pbody) {
int n, depth, tno;
char *s;
switch (buf[1]) {
case 'p':
tno = 2;
break; /* \page{Name}{Title} */
case 'b':
tno = 3;
break; /* \begin{page}{Name}{Title} */
default:
fprintf(stderr, "%s: Invalid page format: %s\n", progName, buf);
exit(1);
}
n = 0;
depth = 0;
for (s = buf; *s; s++) {
if (*s == '{')
if (++depth == 1 && ++n == tno)
*ptitle = s + 1;
if (*s == '}')
if (depth-- == 1 && n == tno) {
*s = 0;
*pbody = s + 1;
break;
}
}
}
\end{chunk}
\subsection{untexbuf}
\index{hthits!untexbuf}
\index{untexbuf hthits}
\begin{chunk}{hthits}
void untexbuf(register char *s) {
register char *d = s;
while (*s)
switch (*s) {
case '\\':
*d++ = ' ';
s++;
if (*s != '%')
while (isalpha(*s))
s++;
break;
case '%':
*d++ = ' ';
s++;
while (*s && *s != '\n')
s++;
break;
case '{':
case '}':
case '#':
*d++ = ' ';
s++;
break;
default:
*d++ = *s++;
}
*d = 0;
}
\end{chunk}
\subsection{badDB}
\index{hthits!badDB}
\index{badDB hthits}
\begin{chunk}{hthits}
void badDB(void) {
fprintf(stderr, "%s: bad database file %s\n", progName, htdbFName);
exit(1);
}
\end{chunk}
\subsection{regerr}
\index{hthits!regerr}
\index{regerr hthits}
\begin{chunk}{hthits}
void regerr(int code) {
fprintf(stderr, "%s: regular expression error %d for \"%s\"\n",
progName, code, pattern);
}
\end{chunk}
\subsection{main}
\index{hthits!main}
\index{main hthits}
\begin{chunk}{hthits}
int main(int argc,char ** argv) {
cmdline(argc, argv);
regcomp(®_pattern, pattern, REG_NEWLINE);
handleHtdb();
return(0);
}
\end{chunk}
\chapter{The hypertex command}
This is the main module of the HyperDoc program. It contains the main
routine which initializes all the X stuff, and the tables. Then it passes
control over to the main event loop.
\index{hypertex}
\section{Constants and Headers}
\subsection{System includes}
\begin{chunk}{hypertex}
#ifdef SGIplatform
#include <bstring.h>
#endif
#include <ctype.h>
#include <fcntl.h>
#include <setjmp.h>
#include <signal.h>
#include <stdlib.h>
#include <sys/errno.h>
#include <sys/signal.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <X11/cursorfont.h>
#include <X11/keysym.h>
#include <X11/X.h>
#include <X11/Xatom.h>
#include <X11/Xresource.h>
\end{chunk}
\section{structs}
\begin{chunk}{hypertex}
typedef struct toke { /* HyperDoc parser tokens */
int type; /* token type. One of those listed below */
char *id; /* string value if type == Identifier */
} Token;
\end{chunk}
\subsection{Local includes}
\begin{chunk}{hypertex}
\getchunk{include/debug.h}
\getchunk{include/hyper.h}
\getchunk{include/all-hyper-proto.h1}
\getchunk{include/bsdsignal.h}
\getchunk{include/bsdsignal.h1}
\getchunk{include/hterror.h1}
\getchunk{include/pixmap.h1}
\getchunk{include/sockio-c.h1}
\getchunk{include/spadcolors.h}
\getchunk{include/spadcolors.h1}
\getchunk{include/util.h1}
\end{chunk}
\section{structs}
\begin{chunk}{hypertex}
typedef struct mr_stack {
/** The structure for storing parser mode and region **/
short int fParserMode;
short int fParserRegion;
struct mr_stack *fNext;
} MR_Stack;
typedef struct sock_list { /* linked list of Sock */
Sock Socket;
struct sock_list *next;
} Sock_List;
\end{chunk}
\section{defines}
\begin{chunk}{hypertex}
#define above(y) ((y) + gWindow->page->scroll_off < gWindow->page->top_scroll_margin)
#define AllMode 0
#define BACKCOLOR gControlBackgroundColor
#define below(y) ((y) + gWindow->page->scroll_off >= gWindow->page->bot_scroll_margin)
#define BITMAPDEPTH 1
#define bothalf(y) (y/2)
#define bottom_margin 15
#define box_space 3
#define box_width 3
#define BufferSlop 0
#define BUTTGC fControlGC
#define dash_width 5
#define dash_y 4
#define special(c) ((c) == '{' || (c) == '}' || (c) == '#' || (c) == '%' || \
(c) == '\\' || (c) == '[' || (c) == ']' || (c) == '_' || \
(c) == ' ' || (c) == '$' || (c) == '~' || (c) == '^' || \
(c) == '&')
#define punctuation(c) ((c)== '`' || (c) == '\'' || (c) == ',' || \
(c) == '.' || (c) == '?' || (c) == '"' || \
(c) == ';' || (c) == ':' || (c) == '-')
#define whitespace(c) ((c) == ' ' || (c) == '\t' || (c) == '\n')
#define delim(c) \
(whitespace(c) || special(c) || punctuation(c))
#define filedelim(c) \
(whitespace(c))
#define DependHashSize 20
#define end_page(t) ((t == Page || t == NewCommand ||t == Endpage)?1:0)
#define FORECOLOR gControlForegroundColor
#define funnyEscape(c) ((c) == '"' ? '\177' : ((c) == '\\' ? '\200' : c))
#define funnyUnescape(c) ((c) == '\177' ? '"' : ((c) == '\200' ? '\\' : c))
#define HTCONDNODE 1 /* unrecognized condition node */
#define htfhSize 100
#define ht_icon_width 40
#define ht_icon_height 40
#define ht_icon_x_hot -1
#define ht_icon_y_hot -1
static char ht_icon_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00,
0x00, 0xe7, 0x00, 0x00, 0x00, 0x00, 0xe7, 0xef, 0x7b, 0x3c, 0xe7, 0xff,
0xef, 0x7f, 0x7e, 0xff, 0xff, 0xe7, 0xef, 0xe7, 0xfe, 0xe7, 0x6e, 0xe7,
0xe7, 0xde, 0xe7, 0x7e, 0xe7, 0xff, 0x0e, 0xe7, 0x3c, 0xe7, 0x07, 0x0e,
0xe7, 0x3c, 0xf7, 0xcf, 0x0e, 0xf7, 0x18, 0x7f, 0xfe, 0x1f, 0x00, 0x1c,
0x3f, 0x7c, 0x1f, 0x00, 0x0e, 0x07, 0x00, 0x00, 0x00, 0x0f, 0x07, 0x00,
0x00, 0x00, 0x87, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x80, 0x7f, 0x00, 0x00, 0x00,
0x00, 0x77, 0x00, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x00, 0x77,
0x00, 0x00, 0x00, 0x00, 0x77, 0x3e, 0xdc, 0x00, 0x00, 0x77, 0x7f, 0xfe,
0x00, 0x00, 0xf7, 0xe3, 0xef, 0x00, 0x00, 0xf7, 0xe3, 0xc7, 0x00, 0x00,
0xf7, 0xe3, 0x07, 0x00, 0x00, 0xf7, 0xe3, 0x07, 0x00, 0x00, 0xf7, 0xe3,
0xcf, 0x00, 0x80, 0x7f, 0x7f, 0xfe, 0x00, 0x80, 0x3f, 0x3e, 0x7c, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
#define horiz_line_space 3
#define inter_line_space 5
#define inter_word_space 5
#define KEYTYPE 2 /* unrecognized keyword found in lex.c */
#define left_margin 20
#define LinkHashSize 25
#define MaxInputFiles 256
#define MAXLINE 256
#define min(x,y) ( (x<y)?(x):(y))
#define min_inter_column_space 10
#define mouseBitmap_width 16
#define mouseBitmap_height 16
#define mouseBitmap_x_hot 8
#define mouseBitmap_y_hot 0
static char mouseBitmap_bits[] = {
0x00, 0x01, 0x00, 0x01, 0x80, 0x02, 0x40, 0x04, 0xc0, 0x06, 0x20, 0x08,
0x20, 0x08, 0x30, 0x18, 0x50, 0x14, 0x58, 0x34, 0x90, 0x12, 0x20, 0x08,
0xc0, 0x47, 0x00, 0x21, 0x80, 0x10, 0x00, 0x0f};
#define mouseMask_width 16
#define mouseMask_height 16
static char mouseMask_bits[] = {
0x00, 0x01, 0x00, 0x01, 0x80, 0x03, 0xc0, 0x07, 0xc0, 0x07, 0xe0, 0x0f,
0xe0, 0x0f, 0xf0, 0x1f, 0xf0, 0x1f, 0xf8, 0x3f, 0xf0, 0x1f, 0xe0, 0x0f,
0xc0, 0x47, 0x00, 0x21, 0x80, 0x10, 0x00, 0x0f};
#define MIN_WINDOW_SIZE 300
#define new_verb_node() \
resizeVbuf(); \
*vb = '\0'; \
curr_node->data.text = allocString(vbuf); \
curr_node->next = allocNode(); \
curr_node = curr_node->next; \
curr_node->type = Newline; \
curr_node->next = allocNode(); \
curr_node = curr_node->next; \
curr_node->type = type; \
if (*end_string == '\n') es = end_string+1; \
else es = end_string; \
size = 0; \
vb = vbuf;
#define not_in_scroll (!(gDisplayRegion == Scrolling))
#define non_scroll_right_margin_space 20
#define NotSpecial(t) ((t == Quitbutton || t == Returnbutton || \
t == Upbutton || t == UnknownPage || \
t == UlUnknownPage || t == ErrorPage) ?(0):(1))
#define NoVerticalMode 1
#define numeric(c) ((c >= '0' && c <= '9')?1:0)
#define Numerrors 2
#define paragraph_space 30
#define pix_visible(y, h) \
(not_in_scroll || ((y) + gRegionOffset + gWindow->page->scroll_off - h + \
line_height < gWindow->page->bot_scroll_margin \
- gWindow->page->top_scroll_margin && \
(y) + gRegionOffset + gWindow->page->scroll_off >= 0))
#define resizeVbuf()\
if (size == vbuf_size) { \
vbuf = resizeBuffer(size + VbufSlop, vbuf, &vbuf_size); \
vb = vbuf + size; \
}
#define scroll_right_margin_space 40
#define scroll_top_margin top_margin
#define scrollingTopMargin 5
#define scrollbar_pix_width 3
#define scrollbar_pix_height 3
static char scrollbar_pix_bits[] = {0x00, 0x03, 0x00};
#define scroller_width 2
#define scroller_height 2
static char scroller_bits[] = {0x01, 0x02};
#define sdown3d_width 21
#define sdown3d_height 21
static char sdown3d_bits[] = {
0xaa, 0xaa, 0x0a, 0x55, 0x55, 0x15, 0x02, 0x00, 0x0c, 0x51, 0x55, 0x15,
0xaa, 0xaa, 0x0e, 0x51, 0x5f, 0x15, 0xaa, 0xae, 0x0e, 0x51, 0x5f, 0x15,
0xaa, 0xae, 0x0e, 0x51, 0x5f, 0x15, 0xea, 0xff, 0x0e, 0xd1, 0x7f, 0x15,
0xaa, 0xbf, 0x0e, 0x51, 0x5f, 0x15, 0xaa, 0xae, 0x0e, 0x51, 0x55, 0x15,
0xaa, 0xaa, 0x0e, 0x51, 0x55, 0x15, 0xfe, 0xff, 0x0f, 0x55, 0x55, 0x15,
0xaa, 0xaa, 0x0a};
#define sdown3dpr_width 21
#define sdown3dpr_height 21
static char sdown3dpr_bits[] = {
0xaa, 0xaa, 0x0a, 0x55, 0x55, 0x15, 0xfe, 0xff, 0x0f, 0x55, 0x55, 0x11,
0xae, 0xaa, 0x0a, 0x55, 0x55, 0x11, 0xae, 0xbe, 0x0a, 0x55, 0x5d, 0x11,
0xae, 0xbe, 0x0a, 0x55, 0x5d, 0x11, 0xae, 0xbe, 0x0a, 0xd5, 0xff, 0x11,
0xae, 0xff, 0x0a, 0x55, 0x7f, 0x11, 0xae, 0xbe, 0x0a, 0x55, 0x5d, 0x11,
0xae, 0xaa, 0x0a, 0x55, 0x55, 0x11, 0x06, 0x00, 0x08, 0x55, 0x55, 0x15,
0xaa, 0xaa, 0x0a};
#define sdown_width sdown3d_width
#define sdown_height sdown3d_height
#define sdown_bits sdown3d_bits
#define SimpleMode 2
#define spadcom_indent 30
#define stipple_width 4
#define stipple_height 4
#define storeChar(ch) if (sizeBuf) (*sizeBuf)++; else *c++ = (ch)
#define storeString(str) for (s=str;*s;s++) {storeChar(*s);}
#define sup3d_width 21
#define sup3d_height 21
static char sup3d_bits[] = {
0xaa, 0xaa, 0x0a, 0x55, 0x55, 0x15, 0x02, 0x00, 0x0c, 0x51, 0x55, 0x15,
0xaa, 0xaa, 0x0e, 0x51, 0x55, 0x15, 0xaa, 0xae, 0x0e, 0x51, 0x5f, 0x15,
0xaa, 0xbf, 0x0e, 0xd1, 0x7f, 0x15, 0xea, 0xff, 0x0e, 0x51, 0x5f, 0x15,
0xaa, 0xae, 0x0e, 0x51, 0x5f, 0x15, 0xaa, 0xae, 0x0e, 0x51, 0x5f, 0x15,
0xaa, 0xaa, 0x0e, 0x51, 0x55, 0x15, 0xfa, 0xff, 0x0f, 0x55, 0x55, 0x15,
0xaa, 0xaa, 0x0a};
#define sup3dpr_width 21
#define sup3dpr_height 21
static char sup3dpr_bits[] = {
0xaa, 0xaa, 0x0a, 0x55, 0x55, 0x15, 0xfe, 0xff, 0x0f, 0x55, 0x55, 0x11,
0xae, 0xaa, 0x0a, 0x55, 0x55, 0x11, 0xae, 0xaa, 0x0a, 0x55, 0x5d, 0x11,
0xae, 0xbe, 0x0a, 0x55, 0x7f, 0x11, 0xae, 0xff, 0x0a, 0xd5, 0xff, 0x11,
0xae, 0xbe, 0x0a, 0x55, 0x5d, 0x11, 0xae, 0xbe, 0x0a, 0x55, 0x5d, 0x11,
0xae, 0xbe, 0x0a, 0x55, 0x55, 0x11, 0x06, 0x00, 0x08, 0x55, 0x55, 0x15,
0xaa, 0xaa, 0x0a};
#define sup_width sup3d_width
#define sup_height sup3d_height
#define sup_bits sup3d_bits
#define term_punct_space 5
#define tophalf(y) ((y % 2 == 0)?(y/2):(y/2) + 1)
#define top_margin 5
#define visible(y, h) \
(not_in_scroll || ((y) + gRegionOffset + gWindow->page->scroll_off \
<= gWindow->scrollheight && \
(y) + gRegionOffset + gWindow->page->scroll_off - (h) >= 0))
#define VbufSlop 10
#define whitespace(c) ((c) == ' ' || (c) == '\t' || (c) == '\n')
\end{chunk}
\section{externs}
\begin{chunk}{hypertex}
extern FILE *cfile;
extern TextNode *curr_node;
extern TextNode *cur_spadcom; /* spad command being parsed *** */
extern char ebuffer[];
extern jmp_buf env;
extern int example_number;
extern int include_bf;
extern int indent;
extern int item_indent;
extern int item_space;
extern Window gActiveWindow;
extern int gBorderColor;
extern char *gDatabasePath;
extern short int gDisplayRegion;
extern boolean gEndedPage;
extern short int gExtentRegion;
extern short int gInAxiomCommand; /* true iff we are in a \spadcommand */
extern boolean gInButton;
extern short int gInDesc;
extern boolean gInIf;
extern short int gInItem; /* true iff we are in a \item */
extern boolean gInItems;
extern int gInInsertMode;
extern short int gInLine; /* true iff there have been words printed */
extern boolean gInOptional;
extern short int gInPaste;
extern short int gInSpadsrc;
extern short int gInTable;
extern short int gInVerbatim;
extern HashTable *gLinkHashTable; /* the hash table of active link windows */
extern TextNode *gLineNode;
extern int gNeedIconName;
extern HyperDocPage *gPageBeingParsed;
extern short int gParserMode;
extern short int gParserRegion;
extern int gRegionOffset;
extern int gScrollbarWidth;
extern short int gStringValueOk;
extern GroupItem *gTopOfGroupStack;
extern ItemStack *gTopOfItemStack;
extern int gTtFontIs850;
extern int gverify_dates;
#ifdef SUN4OS5platform
extern int gethostname(char *, int );
#endif
extern int in_cursor_height;
extern int in_cursor_width;
extern int in_cursor_y;
extern HashTable init_macro_hash;
extern HashTable init_page_hash;
extern HashTable init_patch_hash;
extern int in_next_event; /* true when in XNextEvent */
extern int input_file_count;
extern char **input_file_list;
extern jmp_buf jmpbuf;
extern int kill_spad;
extern int line_height; /* space between lines */
extern int line_number;
extern int make_input_file;
extern int make_patch_files;
extern unsigned int ModifiersMask;
extern int need_scroll_down_button;
extern int need_scroll_up_button;
extern int normal_textHeight; /* space between lines */
extern int out_cursor_height;
extern int out_cursor_width;
extern int out_cursor_y;
extern long page_start_fpos;/* tells the character position of the start
* of the page, needed to find the current
* position when restoring the scanner */
extern ParameterList parameters;
extern int past_line_height;
extern int present_line_height;
extern int received_window_request; /* true iff Spad wants a pop-up */
extern int right_margin;
extern int right_margin_space;
extern int scroll_bot;
extern int simple_box_width;
extern int space_width; /* the maximum width of a character */
extern int start_x;
extern int start_y;
extern int still_reading, str_len;
extern int text_x;
extern int text_y;
extern int twheight; /* the height for all windows in the title bar */
extern int twwidth; /* the width for all windows in the title bar */
extern unsigned int UnsupportedModMask;
extern int vbuff;
extern int word_off_height; /* the diff between text height and */
extern int yOff; /* y offset for scrolling regions */
\end{chunk}
\section{local variables}
\begin{chunk}{hypertex}
char *active_file_list[MaxInputFiles];
unsigned long bigmask= 0xffffffff;
char buf_for_record_commands[256];
extern FILE *cfile;
static int cur_height = 0;
HyperDocPage *cur_page;
TextNode *curr_node; /* current node being parsed. It is next one filled */
TextNode *cur_spadcom; /* The current AXIOM command */
jmp_buf env;
InputBox *end_rb_list;
char *errmess[] = {
"place holder",
"parsing condition node",
"unrecognized keyword" };
int example_number;
char *ExpectedBeginScroll =
"Parser Error: Unexpected new page, expecting a begin scroll\n";
char *ExpectedEndScroll =
"Parser Error: Unexpected new page, expected an end scroll\n";
HyperDocPage *formatpage;
int gActiveColor;
Cursor gActiveCursor; /* The cursor in active regions */
XFontStruct *gActiveFont;
Window gActiveWindow;
int gArgc;
char **gArgv;
int gAxiomColor;
XFontStruct *gAxiomFont;
int gBackgroundColor;
int gBfColor;
XFontStruct *gBfFont;
Cursor gBusyCursor; /* The clock cursor for when I am busy */
int gBorderColor; /* The Border Color */
int gControlBackgroundColor;
int gControlForegroundColor;
char *gDatabasePath = NULL;
short int gDisplayRegion = 0;
int gEmColor;
XFontStruct *gEmFont;
boolean gEndedPage;
short int gExtentRegion;
HashTable gFileHashTable; /* hash table of HyperDoc files */
HashTable gImageHashTable; /* hash table for images */
short int gInAxiomCommand; /* true iff we are in a \spadcommand */
boolean gInButton = FALSE;
short int gInDesc;
boolean gInIf = FALSE;
short int gInItem; /* true iff we are in a \item */
boolean gInItems = FALSE;
short int gInLine; /* true iff there have been words printed */
boolean gInOptional = FALSE;
int gInputBackgroundColor;
XFontStruct *gInputFont;
int gInputForegroundColor;
int gInInsertMode = 0;
short int gInPaste;
short int gInTable;
int gIsAxiomServer = 0; /* true iff HyperDoc is acting as an axiom server */
int gIsEndOfOutput; /* set to true when spad has finished output */
int gItColor;
XFontStruct *gItFont;
TextNode *gLineNode;
HashTable *gLinkHashTable; /* the hash table of active link windows */
int gmakeRecord_file= 0; /* true when making record files from ht */
int gNeedIconName = 0;
Cursor gNormalCursor; /* The normal mouse cursor */
HDWindow *gParentWindow =NULL; /* the parent window. The one that appears
* when you first start HyperDoc */
short int gParserMode; /* Parser mode flag */
short int gParserRegion; /* Parser Region flag scrolling etc */
int gRegionOffset = 0;
int gRmColor;
XFontStruct *gRmFont;
static HyperLink *gSavedInputAreaLink = NULL;
HashTable gSessionHashTable; /* hash table of HD windows */
int gSlColor;
short int gStringValueOk; /* is a string or box value ok */
XFontStruct *gSlFont;
int gSwitch_to_mono=0; /* 1 if at any time we don't have enough colors */
ItemStack *gTopOfItemStack = NULL;
GroupItem *gTopOfGroupStack = NULL;
int gTtFontIs850=0; /* IBM pagecode 850? */
int gverify_dates = 0; /* true when we want hypertex to verify ht.db dates */
int gverifyRecord_file = 0; /* true when verifying record files from ht */
XFontStruct *gTitleFont;
int gTtColor;
XFontStruct *gTtFont;
HDWindow *gWindow = NULL; /* the current window */
Display *gXDisplay;
int gXScreenNumber;
HashTable ht_gFileHashTable;
TextNode *if_node = NULL;
char *inactive_file_list[MaxInputFiles];
int include_bf = 0;
int in_cursor_height;
int in_cursor_width;
int in_cursor_y;
int indent;
HashTable init_macro_hash; /* initial hash table of HD macros */
HashTable init_page_hash; /* initial hash table of HD pages */
HashTable init_patch_hash; /* initial hash table of HD patches */
int in_next_event = 0; /* true when in XNextEvent */
int input_file_count;
char **input_file_list;
int item_indent;
int item_space;
int kill_spad = 0; /* kill spad when finished with paste file */
int line_height; /* space between lines */
TextNode *link_node = NULL;
int make_input_file = 0; /* true when making input files from ht */
int make_patch_files = 0; /* true when making patch files from ht */
static int maxXvalue = 0;
int MenuServerOpened = 1; /* connected to menu server */
unsigned int ModifiersMask = ShiftMask | LockMask | ControlMask
| Mod1Mask | Mod2Mask | Mod3Mask
| Mod4Mask | Mod5Mask;
int motion = 0;
int need_scroll_up_button;
int need_scroll_down_button;
int noop_count;
static char *noopfile = "noop3d.bitmap";
int normal_textHeight; /* space between lines */
int num_active_files = 0;
int num_inactive_files = 0;
int out_cursor_height;
int out_cursor_width;
int out_cursor_y;
ParameterList parameters = NULL;
TextNode *paste_node = NULL;
int past_line_height;
Sock_List *plSock = (Sock_List *) 0;
int present_line_height;
static char *protected_quit;
char *p2sBuf = NULL;
int p2sBufSize = 0;
InputBox *rb_list;
int received_window_request = 0;/* true iff Spad wants a pop-up */
XrmDatabase rDB;
char *replace_page; /* true if dynamic page is link to static one */
int ret_val; /* The return value from getToken */
int right_margin;
int right_margin_space;
Sock *spadSocket = (Sock *) 0; /* to_server socket for SpadServer */
HyperLink *quitLink; /** the global link to the quit page ***/
InputItem *save_item;
int scrn; /* used in spad_colors */
static Pixmap scrollbar_pix = 0;
int gScrollbarWidth = sup_width + 2;
int scroll_bot;
static Pixmap scroller = 0;
static Pixmap sdown = 0;
static Pixmap sdown_pressed = 0;
static GContext server_font;
Sock *sessionServer; /* socket connecting to session manager */
int simple_box_width;
int space_width; /* the maximum width of a character */
TextNode *spad_node = NULL;
unsigned long *spadColors;
int start_x;
int start_y;
Pixmap stipple;
static char stipple_bits[] = {0xff, 0xff, 0xff, 0xff};
static Pixmap sup = 0;
static int supheight = sup_height;
static Pixmap sup_pressed = 0;
static int supwidth = sup_width;
int text_x;
int text_y;
MR_Stack *top_mr_stack = NULL; /** Declaration for the stack **/
static XImage *tw1image = NULL;
static XImage *tw2image = NULL;
static XImage *tw3image = NULL;
static XImage *tw4image = NULL;
static XImage *noopimage = NULL;
static char *tw1file = "exit3d.bitmap";
static char *tw2file = "help3d.bitmap";
static char *tw3file = "home3d.bitmap";
static char *tw4file = "up3d.bitmap";
int twheight; /* the height for all windows in the title bar */
int twwidth; /* the width for all windows in the title bar */
unsigned int UnsupportedModMask = LockMask | ControlMask
| Mod1Mask | Mod2Mask | Mod3Mask
| Mod4Mask | Mod5Mask;
int word_off_height; /* the diff between text height and */
int yOff;
\end{chunk}
\section{The Shared Code}
\begin{chunk}{hypertex}
int windowEqual(Window *w1, Window *w2);
int windowCode(Window *w, int size);
CondNode *allocCondnode(void);
char *printToString(TextNode *command);
LineStruct *allocInputline(int size);
void updateInputsymbol(InputItem *sym);
static void drawCursor(InputItem *sym);
static void clearCursorline(InputItem *sym);
void showPage(HyperDocPage *page);
static void clearCursor(InputItem *sym);
static void handleEvent(XEvent * event);
static void createWindow(void);
HyperDocPage *issueServerCommand(HyperLink *link);
HyperDocPage *parsePatch(PasteNode *paste);
static void handleButton(int button, XButtonEvent * event);
HyperDocPage *issueUnixlink(TextNode *node);
static int setWindow(Window window);
static void clearExposures(Window w);
void getNewWindow(void);
HyperDocPage *parsePageFromSocket(void);
static void handleMotionEvent(XMotionEvent *event);
static void initCursorStates(void);
static void makeBusyCursor(HDWindow *window);
static void setErrorHandlers(void);
static void computeBeginItemsExtent(TextNode * node);
static void computeItemExtent(TextNode * node);
static void computeMitemExtent(TextNode *node);
static void endifExtent(TextNode *node);
static void computeIfcondExtent(TextNode *node);
static void computeCenterExtent(TextNode * node);
static void computeBfExtent(TextNode *node);
static void computeEmExtent(TextNode *node);
static void computeItExtent(TextNode *node);
static void computeRmExtent(TextNode *node);
static void computeButtonExtent(TextNode *node);
static void endbuttonExtent(TextNode *node);
static void computePastebuttonExtent(TextNode *node);
static void endpastebuttonExtent(TextNode *node);
static void computePasteExtent(TextNode *node);
static void computeSpadcommandExtent(TextNode *node);
static void computeSpadsrcExtent(TextNode *node);
static void endSpadcommandExtent(TextNode *node);
static void endSpadsrcExtent(TextNode *node);
static void computeMboxExtent(TextNode *node);
static void computeBoxExtent(TextNode *node);
static void computeIrExtent(TextNode *node);
static void computeImageExtent(TextNode *node);
static void computeTableExtent(TextNode **node);
void computeTitleExtent(HyperDocPage *page);
void computeHeaderExtent(HyperDocPage *page);
void computeFooterExtent(HyperDocPage * page);
void computeScrollingExtent(HyperDocPage *page);
void startNewline(int distance, TextNode * node);
static void centerNodes(TextNode * begin_node, TextNode * end_node);
static void makeBusyCursors(void);
void initExtents(void);
void initTitleExtents(HyperDocPage * page);
static int textHeight1(TextNode * node, int Ender);
static int Xvalue(TextNode * node);
void insertBitmapFile(TextNode * node);
void insertPixmapFile(TextNode * node);
void computeFormPage(HyperDocPage *page);
static int windowHeight(HyperDocPage *page);
static void formHeaderExtent(HyperDocPage *page);
static void formFooterExtent(HyperDocPage *page);
static void formScrollingExtent(HyperDocPage *page);
void pushGroupStack(void);
void emTopGroup(void);
void rmTopGroup(void);
void bfTopGroup(void);
void pushActiveGroup(void);
void pushSpadGroup(void);
void initTopGroup(void);
void centerTopGroup(void);
HDWindow *allocHdWindow(void);
static void makeTheInputFile(UnloadedPage *page);
static void makeInputFileFromPage(HyperDocPage *page);
static int inListAndNewer(char *inputFile, char *htFile);
static void makeInputFileList(void);
static void sendCommand(char *command,int com_type);
static void printPaste(FILE *pfile,char *realcom,char *command,
char *pagename,int com_type);
static void printGraphPaste(FILE *pfile,char *realcom,
char *command,char *pagename,int com_type);
HyperDocPage *allocPage(char *name);
static void setNameAndIcon(void);
static int getBorderProperties(void);
static void openWindow(Window w);
static void setSizeHints(Window w);
static void getGCs(HDWindow *window);
static void ingItColorsAndFonts(void);
void changeText(int color, XFontStruct *font);
static int getColor(char *name, char *class, int def, Colormap *map);
static void mergeDatabases(void);
void toggleInputBox(HyperLink *link);
static void clearRbs(InputBox *list);
void changeInputFocus(HyperLink *link);
void pushItemStack(void);
void clearItemStack(void);
void popItemStack(void);
void handleKey(XEvent *event);
FILE *findFp(FilePosition fp);
TextNode *allocNode(void);
static void getParameterStrings(int number,char * macro_name);
void toggleRadioBox(HyperLink *link);
void freeHdWindow(HDWindow *w);
static void dontFree(void *link);
static void freeCond(CondNode *cond);
void freePage(HyperDocPage *page);
static void freeDepend(SpadcomDepend *sd);
static void freeInputBox(InputBox *box);
static void freePastebutton(TextNode *node, short int des);
static void freePastearea(TextNode *node, short int des);
void freeInputItem(InputItem *sym, short int des);
void freeInputList(InputItem *il);
static void freeRadioBoxes(RadioBoxes *radio);
void freeButtonList(ButtonList *bl);
void loadPage(HyperDocPage *page);
static HyperDocPage *formatPage(UnloadedPage *ulpage);
void parseFromString(char *str);
static void parsePage(HyperDocPage *page);
void parseHyperDoc(void);
char *windowId(Window w);
static void startScrolling(void);
static void startFooter(void);
static void endAPage(void);
static void parseReplacepage(void);
void readHtDb(HashTable *page_hash, HashTable *macro_hash,
HashTable *patch_hash);
static void readHtFile(HashTable *page_hash, HashTable *macro_hash,
HashTable *patch_hash, FILE *db_fp, char *dbFile);
void makeSpecialPages(HashTable *pageHashTable);
void addDependencies(void);
void parserError(char *str);
void parseInputstring(void);
void parseSimplebox(void);
ImageStruct *insertImageStruct(char *filename);
static void addBoxToRbList(char *name,InputBox *box);
static int checkOthers(InputBox *list);
static void insertItem(InputItem *item);
void parsePaste(void);
void parsePastebutton(void);
static void loadPatch(PatchStore *patch);
void parseIfcond(void);
static void parseCondnode(void);
static void parseHasreturnto(void);
void parseNewcond(void);
void parseSetcond(void);
void parseBeginItems(void);
void parseItem(void);
void parseMitem(void);
void parseVerbatim(int type);
void parseInputPix(void);
void parseCenterline(void);
void parseCommand(void);
void parseButton(void);
void parseSpadcommand(TextNode *spad_node);
void parseSpadsrc(TextNode *spad_node);
void parseEnv(TextNode *node);
void parseValue1(void);
void parseValue2(void);
void parseTable(void);
void parseBox(void);
void parseMbox(void);
void parseFree(void);
void parseHelp(void);
static int readHot(FILE *fd,char Line[],int *x_hot,int *y_hot);
static int readWandH(FILE *fd,unsigned int *width,unsigned int *height);
static int ch(int height);
static void changeWindowBackgroundPixmap(Window window, Pixmap pixmap);
void showText(TextNode *node, int Ender);
static void showLink(TextNode *node);
static void showPaste(TextNode *node);
static void showPastebutton(TextNode *node);
static void showInput(TextNode *node);
static void showSimpleBox(TextNode *node);
static void showSpadcommand(TextNode *node);
static void showImage(TextNode *node, GC gc);
void issueSpadcommand(HyperDocPage *page, TextNode *command,
int immediate, int type);
static void sendPile(Sock *sock,char * str);
static void issueDependentCommands(HyperDocPage *page,
TextNode *command,int type);
static void markAsExecuted(HyperDocPage *page, TextNode *command,int type);
static void startUserBuffer(HyperDocPage *page);
static void clearExecutionMarks(HashTable *depend_hash);
Sock *acceptMenuConnection(Sock *server_sock);
static void acceptMenuServerConnection(HyperDocPage *page);
char *printToString1(TextNode *command,int * sizeBuf);
void issueUnixcommand(TextNode *node);
void serviceSessionSocket(void);
static void switchFrames(void);
void sendLispCommand(char *command);
void escapeString(char *s);
void unescapeString(char *s);
static void closeClient(int pid);
char *printSourceToString(TextNode *command);
char *printSourceToString1(TextNode *command,int * sizeBuf);
static void readTitleBarImages(void);
void displayPage(HyperDocPage *page);
void parseRadiobox(void);
void parseRadioboxes(void);
void dumpToken(char *caller, Token t);
void printNextTenTokens(void);
int getToken(void);
int keywordType(void);
int popGroupStack(void);
int initTopWindow(char *name);
int initFormWindow(char *name, int cols);
int totalWidth(TextNode * node, int Ender);
int textWidth(TextNode * node, int Ender);
int maxX(TextNode * node, int Ender);
int textHeight(TextNode * node, int Ender);
int isIt850(XFontStruct *fontarg);
int getFilename(void);
int issueServerpaste(TextNode *command);
int issueUnixpaste(TextNode *node);
char *vbuf = NULL;
int vbuf_size = 0;
\getchunk{hypertex shared code}
\getchunk{hashCopyEntry}
\getchunk{hashCopyTable}
\getchunk{dbFileOpen}
\getchunk{htperror}
\getchunk{dumpToken}
\end{chunk}
\section{Code}
\subsection{sigusr2Handler}
SIGUSR2 is raised by the spadbuf program when it is done with the current
command
\index{hypertex!sigusr2Handler}
\index{sigusr2Handler hypertex}
\begin{chunk}{hypertex}
void sigusr2Handler(int sig) {
gIsEndOfOutput = 1;
return ;
}
\end{chunk}
\subsection{sigcldHandler}
Why were we waiting after the child had already died?
Because we don't want zombies
\index{hypertex!sigcldHandler}
\index{sigcldHandler hypertex}
\begin{chunk}{hypertex}
void sigcldHandler(int sig) {
int x;
wait(&x);
}
\end{chunk}
\subsection{cleanSocket}
Clean up spad sockets on exit.
\index{hypertex!cleanSocket}
\index{cleanSocket hypertex}
\begin{chunk}{hypertex}
void cleanSocket(void) {
char name[256];
make_server_name(name, MenuServerName);
unlink(name);
}
\end{chunk}
\subsection{initHash}
Initializes the hash table for Files, and Windows
\index{hypertex!initHash}
\index{initHash hypertex}
\begin{chunk}{hypertex}
static void initHash(void) {
hashInit(&gFileHashTable,
FileHashSize,
(EqualFunction)stringEqual,
(HashcodeFunction) stringHash);
hashInit(&gSessionHashTable,
SessionHashSize,
(EqualFunction) windowEqual,
(HashcodeFunction) windowCode);
hashInit(&gImageHashTable,
ImageHashSize,
(EqualFunction) stringEqual,
(HashcodeFunction) stringHash);
}
\end{chunk}
\subsection{initPageStructs}
Initialize the HyperDoc page hierarchy data structures
\index{hypertex!initPageStructs}
\index{initPageStructs hypertex}
\begin{chunk}{hypertex}
void initPageStructs(HDWindow *w) {
int i;
w->fMemoStackIndex = 0;
for (i = 0; i < MaxMemoDepth; i++) {
w->fMemoStack[i] = NULL;
w->fDownLinkStackTop[i] = 0;
}
w->fDownLinkStackIndex = 0;
for (i = 0; i < MaxDownlinkDepth; i++)
w->fDownLinkStack[i] = NULL;
}
\end{chunk}
\subsection{checkArguments}
\index{hypertex!checkArguments}
\index{checkArguments hypertex}
\begin{chunk}{hypertex}
static void checkArguments(void) {
int i;
/*
* Now check the command line arguments, to see if I am supposed to be a
* server or not
*/
for (i = 1; i < gArgc; i++) {
if (gArgv[i][0] == '-')
switch (gArgv[i][1]) {
case 'p':
gverify_dates=1;
break;
case 's':
if (!MenuServerOpened) {
fprintf(stderr, "(HyperDoc) Server already in use.\n");
exit(-1);
}
gIsAxiomServer = 1;
break;
case 'i':
if (gArgv[i][2] == 'p')
make_patch_files = 1;
make_input_file = 1;
input_file_list = gArgv + i + 1;
input_file_count = gArgc - i - 1;
break;
case 'k':
kill_spad = 1;
break;
case 'r':
if (gArgv[i][2] == 'm')
gmakeRecord_file=1;
else if (gArgv[i][2] == 'v')
gverifyRecord_file=1;
else
fprintf(stderr, "(HyperDoc) v or m must follow -r\n");
input_file_list = gArgv + i + 1;
input_file_count = gArgc - i - 1;
break;
default:
fprintf(stderr, "(HyperDoc) Unexpected Command Line Argument ");
fprintf(stderr,"%s\n", gArgv[i]);
fprintf(stderr, " Usage: hypertex [-s]\n");
break;
}
}
}
\end{chunk}
\subsection{makeServerConnections}
\index{hypertex!makeServerConnections}
\index{makeServerConnections hypertex}
\begin{chunk}{hypertex}
static void makeServerConnections(void) {
int i, wait_time;
/*
* Try to open the menuserver socket, if I can not, then set a flag
*/
if (open_server(MenuServerName) == -2) {
fprintf(stderr, "(HyperDoc) Warning: Not connected to AXIOM Server!\n");
MenuServerOpened = 0;
}
else {
/* In order to allow hyperdoc restarts from the console we clean up
* the socket on exit */
atexit(&cleanSocket);
MenuServerOpened = 1;
}
/*
* If I have opened the MenuServer socket, then I should also try to open
* the SpadServer socket, so I can send stuff right to SPAD.
*/
if (MenuServerOpened) {
/*
* If I am a ht server, then I should not continue on unless I
* establish some sort of connection
*/
/*
* Modified on 11/20 so that it prints an error message every ten for
* ten tries at opeing the socket. If it fails all ten times, it
* gives up and exits.
*/
if (!gIsAxiomServer)
wait_time = 2;
else
wait_time = 1000;
for (i = 0, spadSocket = NULL; i < 2 && spadSocket == NULL; i++) {
spadSocket = connect_to_local_server(SpadServer,
MenuServer, wait_time);
if (gIsAxiomServer && spadSocket == NULL)
fprintf(stderr,
"(HyperDoc) Error opening AXIOM server. Retrying ...\n");
else
i = 11;
}
if (! spadSocket) {
fprintf(stderr, "(HyperDoc) Couldn't connect to AXIOM server!\n");
if (!gIsAxiomServer)
MenuServerOpened = 0;
else {
fprintf(stderr,"(HyperDoc) Cannot connect to AXIOM server\n");
exit(-1);
}
}
else {
/*
* Do the same thing for the SessionServer
*/
for (i = 0, sessionServer = NULL; i < 2 && sessionServer == NULL
; i++) {
sessionServer =
connect_to_local_server(SessionServer, MenuServer,
wait_time);
if (gIsAxiomServer && sessionServer == NULL) {
fprintf(stderr,
"(HyperDoc) Error opening SessionServer, Retrying ...\n");
}
else
i = 11;
}
if (sessionServer == NULL) {
fprintf(stderr, "(HyperDoc) Connection attempt to session ");
fprintf(stderr,"manager timed out.\n");
if (gIsAxiomServer) {
fprintf(stderr,
"(HyperDoc) Server unable to connect to session server\n");
exit(-1);
}
else {
MenuServerOpened = 0;
}
}
}
}
}
\end{chunk}
\section{Condition Handling}
\subsection{insertCond}
This routine creates a new cond node and inserts it into the
current cond table
\index{hypertex!insertCond}
\index{insertCond hypertex}
\begin{chunk}{hypertex}
void insertCond(char *label, char *cond) {
CondNode *condnode = (CondNode *) hashFind(gWindow->fCondHashTable, label);
if (condnode) {
fprintf(stderr, "Error: \\%s is declared twice \n", label);
printPageAndFilename();
jump();
}
condnode = allocCondnode();
condnode->label = halloc(strlen(label) + 1, "Condnode->label");
condnode->cond = halloc(strlen(cond) + 1, "Condnode->cond");
strcpy(condnode->label, label);
strcpy(condnode->cond, cond);
hashInsert(gWindow->fCondHashTable, (char *) condnode, condnode->label);
}
\end{chunk}
\subsection{changeCond}
\index{hypertex!changeCond}
\index{changeCond hypertex}
\begin{chunk}{hypertex}
void changeCond(char *label, char *newcond) {
CondNode *condnode = (CondNode *) hashFind(gWindow->fCondHashTable, label);
if (condnode == NULL) {
fprintf(stderr, "Error: Tried to set an uncreated cond %s\n", label);
}
else {
free(condnode->cond);
condnode->cond = halloc(strlen(newcond) + 1, "Condnode->cond");
strcpy(condnode->cond, newcond);
}
}
\end{chunk}
\subsection{checkMemostack}
\index{hypertex!checkMemostack}
\index{checkMemostack hypertex}
\begin{chunk}{hypertex}
static int checkMemostack(TextNode *node) {
char *buffer;
int stackp = gWindow->fMemoStackIndex;
int found = 0;
HyperDocPage *page;
buffer = printToString(node->data.node);
/*
* Once we have done that much, search down the stack for the
* proper page
*/
while (!found && stackp > 0) {
page = gWindow->fMemoStack[--stackp];
if (!strcmp(page->name, buffer))
found = 1;
}
return found;
}
\end{chunk}
\subsection{checkCondition}
Checks the condition presented and returns a 1 or a 0.
\index{hypertex!checkCondition}
\index{checkCondition hypertex}
\begin{chunk}{hypertex}
int checkCondition(TextNode *node) {
CondNode *cond;
InputBox *box;
int ret_val;
switch (node->type) {
case Cond:
cond = (CondNode *) hashFind(gWindow->fCondHashTable, node->data.text);
if (!strcmp("0", cond->cond))
return 0;
else
return 1;
case Boxcond:
box = (InputBox *) hashFind(gWindow->page->box_hash, node->data.text);
return (box->picked);
case Haslisp:
if (spadSocket != NULL) {
ret_val = send_int(spadSocket, TestLine);
return (ret_val + 1);
}
else
return 0;
case Hasup:
return need_up_button;
case Hasreturn:
return gWindow->fMemoStackIndex;
case Hasreturnto:
return (checkMemostack(node));
case Lastwindow:
return(gSessionHashTable.num_entries == 1 || gParentWindow == gWindow);
default:
return 0;
}
}
\end{chunk}
\section{Dialog Handling}
\subsection{redrawWin}
\index{hypertex!redrawWin}
\index{redrawWin hypertex}
\begin{chunk}{hypertex}
static void redrawWin(void) {
XUnmapSubwindows(gXDisplay, gWindow->fMainWindow);
XUnmapSubwindows(gXDisplay, gWindow->fScrollWindow);
XFlush(gXDisplay);
showPage(gWindow->page);
}
\end{chunk}
\subsection{mystrncpy}
Copies the characters from buff1 to buff2 starting at position
buff2+n and buff1+n
\index{hypertex!mystrncpy}
\index{mystrncpy hypertex}
\begin{chunk}{hypertex}
static char *mystrncpy(char *buff1, char *buff2, int n) {
int i;
for (i = n - 1; i >= 0; i--)
*(buff1 + i) = *(buff2 + i);
return buff2;
}
\end{chunk}
\subsection{incLineNumbers}
\index{hypertex!incLineNumbers}
\index{incLineNumbers hypertex}
\begin{chunk}{hypertex}
static void incLineNumbers(LineStruct *line) {
for (; line != NULL; line = line->next)
line->line_number++;
}
\end{chunk}
\subsection{decLineNumbers}
\index{hypertex!decLineNumbers}
\index{decLineNumbers hypertex}
\begin{chunk}{hypertex}
static void decLineNumbers(LineStruct *line) {
for (; line != NULL; line = line->next)
line->line_number--;
return;
}
\end{chunk}
\subsection{decreaseLineNumbers}
\index{hypertex!decreaseLineNumbers}
\index{decreaseLineNumbers hypertex}
\begin{chunk}{hypertex}
static void decreaseLineNumbers(LineStruct *line, int am) {
for (; line != NULL; line = line->next)
line->line_number -= am;
}
\end{chunk}
\subsection{overwriteBuffer}
\index{hypertex!overwriteBuffer}
\index{overwriteBuffer hypertex}
\begin{chunk}{hypertex}
static void overwriteBuffer(char *buffer, InputItem *item) {
LineStruct *newline;
LineStruct *addline = item->curr_line;
/*int bufflen = strlen(buffer);*/
int nl = 0;
int cursor_y;
int size = item->size;
/* add a single character */
cursor_y = (addline->line_number - 1) * line_height;
if (addline->buff_pntr == size) {
clearCursor(item);
if (addline->len <= size) {
nl = 1;
addline->buffer[size] = '_';
addline->buffer[size + 1] = 0;
addline->len = size + 1;
newline = (LineStruct *) allocInputline(size + 2);
newline->line_number = addline->line_number + 1;
incLineNumbers(addline->next);
newline->next = addline->next;
newline->prev = addline;
if (addline->next)
addline->next->prev = newline;
addline->next = newline;
item->num_lines++;
cursor_y += line_height;
item->curr_line = addline = newline;
}
else {
item->curr_line = addline = addline->next;
}
addline->len = 1;
addline->buff_pntr = 1;
addline->buffer[0] = buffer[0];
}
else {
addline->buffer[addline->buff_pntr] = buffer[0];
clearCursor(item);
if (++addline->buff_pntr > addline->len)
addline->len++;
}
/* now set up the current line */
if (item->curr_line->buff_pntr >= item->size &&
item->curr_line->next != NULL && !item->curr_line->next->len) {
/* I should actually be on the next line */
item->curr_line->buffer[item->size] = '_';
item->curr_line->len = item->size + 1;
XDrawString(gXDisplay, item->win, gWindow->fInputGC, start_x,
cursor_y + start_y,
addline->buffer,
addline->len);
item->curr_line = item->curr_line->next;
item->curr_line->buff_pntr = 0;
item->curr_line->changed = 1;
}
if (!nl) {
XDrawString(gXDisplay, item->win, gWindow->fInputGC, start_x,
cursor_y + start_y,
addline->buffer,
addline->len);
drawCursor(item);
}
else
redrawWin();
}
/*
*/
\end{chunk}
\subsection{moveSymForward}
This routine takes the current line and moves it num forward. The
only way I have to move any other lines forward is if this line has
length > size
\index{hypertex!moveSymForward}
\index{moveSymForward hypertex}
\begin{chunk}{hypertex}
static int moveSymForward(LineStruct *line, int num, int size,
InputItem *sym) {
LineStruct *newline;
int diff;
int nl = 0;
if (line->len > size) {
nl = moveSymForward(line->next, num, size, sym);
strncpy(line->next->buffer,
&line->buffer[sym->size - num], line->len);
strncpy(&line->buffer[num],
line->buffer, num);
line->changed = 1;
return nl;
}
else {
if (line->len + num > size) {
diff = line->len + num - size;
newline = allocInputline(size);
newline->len = diff;
newline->line_number = line->line_number++;
incLineNumbers(line->next);
sym->num_lines++;
newline->next = line->next;
newline->prev = line;
if (line->next)
line->next->prev = newline;
line->next = newline;
strncpy(newline->buffer, &line->buffer[size - diff], diff);
strncpy(&line->buffer[num], line->buffer, num);
line->buffer[size] = '_';
line->buffer[size + 1] = 0;
line->len = size + 1;
return 1;
}
else {
strncpy(&line->buffer[num], line->buffer, line->len);
line->len += num;
line->changed = 1;
return 0;
}
}
}
\end{chunk}
\subsection{clearCursorline}
\index{hypertex!clearCursorline}
\index{clearCursorline hypertex}
\begin{chunk}{hypertex}
static void clearCursorline(InputItem *sym) {
XCharStruct extents;
int dir, asc, des;
int cursor_y;
XTextExtents(gInputFont, sym->curr_line->buffer,
sym->curr_line->buff_pntr,
&dir, &asc, &des, &extents);
cursor_y = (sym->curr_line->line_number - 1) * line_height;
sym->cursor_x = start_x + extents.width;
XClearArea(gXDisplay, sym->win, sym->cursor_x, cursor_y,
gWindow->width, line_height, False);
XDrawString(gXDisplay, sym->win, gWindow->fInputGC, start_x,
cursor_y + start_y, sym->curr_line->buffer,
sym->curr_line->len);
}
\end{chunk}
\subsection{insertBuffer}
\index{hypertex!insertBuffer}
\index{insertBuffer hypertex}
\begin{chunk}{hypertex}
static void insertBuffer(char *buffer, InputItem *sym) {
/*int num = strlen(buffer);*/
LineStruct *line = sym->curr_line;
LineStruct *newline;
int nl = 0;
int size = sym->size;
if (line->len < size) {
/* they will all fit where I am so just copy them forward */
line->len++;
mystrncpy(&(line->buffer[line->buff_pntr + 1]),
&(line->buffer[line->buff_pntr]),
line->len - line->buff_pntr + 1);
line->buffer[line->buff_pntr] = buffer[0];
clearCursorline(sym);
line->buff_pntr++;
drawCursor(sym);
return;
}
if (line->len > sym->size) {
nl = moveSymForward(line->next, 1, size, sym);
if (line->buff_pntr > size) {
line->changed = 1;
line = line->next;
line->buffer[0] = buffer[0];
line->len++;
line->buff_pntr = 1;
line->changed = 1;
}
else {
line->next->buffer[0] = line->buffer[size - 1];
line->changed = 1;
strncpy(&line->buffer[line->buff_pntr + 1],
&line->buffer[line->buff_pntr], size - line->buff_pntr - 1);
line->buffer[line->buff_pntr++] = buffer[0];
line->changed = 1;
if (line->buff_pntr >= size) {
sym->curr_line = line->next;
sym->curr_line->buff_pntr = 0;
}
}
}
else {
nl = 1;
newline = allocInputline(size);
newline->line_number = line->line_number + 1;
incLineNumbers(line->next);
sym->num_lines++;
newline->next = line->next;
newline->prev = line;
if (line->next)
line->next->prev = newline;
line->next = newline;
/*
* was line->buff_pntr++;
*/
if (line->buff_pntr >= size) {
/* we are the leaders of the line */
newline->buff_pntr = 1;
newline->buffer[0] = buffer[0];
newline->len = 1;
sym->curr_line = newline;
}
else {
/* we are not the leaders */
newline->buffer[0] = line->buffer[size - 1];
newline->len = 1;
strncpy(&line->buffer[line->buff_pntr + 1],
&line->buffer[line->buff_pntr], size - line->buff_pntr);
if (line->buff_pntr < size - 1) {
line->buffer[line->buff_pntr++] = buffer[0];
}
else {
line->buffer[line->buff_pntr] = buffer[0];
newline->buff_pntr = 0;
sym->curr_line = newline;
}
}
line->buffer[size] = '_';
line->buffer[size + 1] = 0;
line->len = size + 1;
}
if (nl)
redrawWin();
else
updateInputsymbol(sym);
}
\end{chunk}
\subsection{addBufferToSym}
\index{hypertex!addBufferToSym}
\index{addBufferToSym hypertex}
\begin{chunk}{hypertex}
void addBufferToSym(char *buffer,InputItem *sym) {
if (gInInsertMode)
insertBuffer(buffer, sym);
else
overwriteBuffer(buffer, sym);
}
\end{chunk}
\subsection{drawInputsymbol}
\index{hypertex!drawInputsymbol}
\index{drawInputsymbol hypertex}
\begin{chunk}{hypertex}
void drawInputsymbol(InputItem *sym) {
int y_spot = start_y;
LineStruct *cline;
XCharStruct extents;
int dir, asc, des;
#if 0
int cursor_y;
cursor_y = (sym->curr_line->line_number - 1) * line_height;
#endif
XClearWindow(gXDisplay, sym->win);
XTextExtents(gInputFont, sym->curr_line->buffer,
sym->curr_line->buff_pntr,
&dir, &asc, &des, &extents);
sym->cursor_x = start_x + extents.width;
/*
* While the list of input strings is not NULL, I should just keep
* drawing them
*/
for (cline = sym->lines; cline != NULL;
cline = cline->next, y_spot += line_height) {
/* Now I should draw the initial string ** */
cline->changed = 0;
XDrawString(gXDisplay, sym->win, gWindow->fInputGC, start_x, y_spot,
cline->buffer,
cline->len);
}
if (gWindow->page->currentItem == sym)
drawCursor(sym);
}
\end{chunk}
\subsection{updateInputsymbol}
\index{hypertex!updateInputsymbol}
\index{updateInputsymbol hypertex}
\begin{chunk}{hypertex}
void updateInputsymbol(InputItem *sym) {
int y_spot = start_y;
LineStruct *cline;
XCharStruct extents;
int dir, asc, des;
/*int cleared = 0;*/
int clear_y;
int clear_width;
int clear_height;
#if 0
int cursor_y;
cursor_y = (sym->curr_line->line_number - 1) * line_height;
#endif
clear_width = (sym->size + 1) * gInputFont->max_bounds.width + 10;
clear_height = line_height;
clear_y = 0;
XTextExtents(gInputFont, sym->curr_line->buffer,
sym->curr_line->buff_pntr,
&dir, &asc, &des, &extents);
sym->cursor_x = start_x + extents.width;
/*
* While the list of input strings is not NULL, I should just keep
* drawing them
*/
for (cline = sym->lines; cline != NULL;
cline = cline->next, y_spot += line_height, clear_y += line_height)
/* Now I should draw the initial string ** */
if (cline->changed) {
cline->changed = 0;
XClearArea(gXDisplay, sym->win, 0, clear_y,
clear_width, clear_height, False);
XDrawString(gXDisplay, sym->win, gWindow->fInputGC, start_x,
y_spot, cline->buffer, cline->len);
}
drawCursor(sym);
}
\end{chunk}
\subsection{drawCursor}
\index{hypertex!drawCursor}
\index{drawCursor hypertex}
\begin{chunk}{hypertex}
static void drawCursor(InputItem *sym) {
int cursor_y;
XCharStruct extents;
int dir, asc, des;
cursor_y = (sym->curr_line->line_number - 1) * line_height;
XTextExtents(gInputFont, sym->curr_line->buffer,
sym->curr_line->buff_pntr,
&dir, &asc, &des, &extents);
sym->cursor_x = start_x + extents.width;
/* now draw the cursor */
if (gInInsertMode) {
XFillRectangle(gXDisplay, sym->win, gWindow->fInputGC,
sym->cursor_x,
out_cursor_y + cursor_y,
out_cursor_width,
out_cursor_height);
/* Now draw the character currently under the cursor */
XDrawString(gXDisplay, sym->win, gWindow->fCursorGC,
sym->cursor_x, cursor_y + start_y,
&sym->curr_line->buffer[sym->curr_line->buff_pntr],
1);
}
else
XFillRectangle(gXDisplay, sym->win, gWindow->fInputGC,
sym->cursor_x,
in_cursor_y + cursor_y,
in_cursor_width,
in_cursor_height);
}
\end{chunk}
\subsection{moveCursorHome}
\index{hypertex!moveCursorHome}
\index{moveCursorHome hypertex}
\begin{chunk}{hypertex}
static void moveCursorHome(InputItem *sym) {
LineStruct *trace = sym->curr_line;
/* now move the cursor to the beginning of the current line */
clearCursor(sym);
for (; trace && trace->prev && trace->prev->len > sym->size;)
trace = trace->prev;
sym->curr_line = trace;
trace->buff_pntr = 0;
drawCursor(sym);
}
\end{chunk}
\subsection{moveCursorEnd}
\index{hypertex!moveCursorEnd}
\index{moveCursorEnd hypertex}
\begin{chunk}{hypertex}
static void moveCursorEnd(InputItem *sym) {
LineStruct *trace = sym->curr_line;
/* now move the cursor to the beginning of the current line */
clearCursor(sym);
for (; trace && trace->next && trace->len > sym->size;)
trace = trace->next;
sym->curr_line = trace;
trace->buff_pntr = trace->len;
drawCursor(sym);
}
\end{chunk}
\subsection{void moveCursorForward}
\index{hypertex!void moveCursorForward}
\index{void moveCursorForward hypertex}
\begin{chunk}{hypertex}
static void moveCursorForward(InputItem *sym) {
if (sym->curr_line->buff_pntr == sym->curr_line->len &&
!sym->curr_line->next) {
BeepAtTheUser();
return;
}
if (sym->curr_line->buff_pntr == sym->curr_line->len ||
sym->curr_line->buff_pntr == sym->size - 1)
{
/* I have to move down to a new line */
if (sym->curr_line->next == NULL) {
/* now where to move */
BeepAtTheUser();
return;
}
/* move down line */
clearCursor(sym);
sym->curr_line = sym->curr_line->next;
sym->curr_line->buff_pntr = 0;
}
else {
clearCursor(sym);
sym->curr_line->buff_pntr++;
}
drawCursor(sym);
}
\end{chunk}
\subsection{moveCursorDown}
\index{hypertex!moveCursorDown}
\index{moveCursorDown hypertex}
\begin{chunk}{hypertex}
static void moveCursorDown(InputItem *sym) {
int bp = sym->curr_line->buff_pntr;
/*int size = sym->size;*/
LineStruct *trace;
/* get to the end of the current line */
for (trace = sym->curr_line; trace->len > sym->size; trace = trace->next)
;
if (!trace->next)
BeepAtTheUser();
else {
clearCursor(sym);
sym->curr_line = trace->next;
if (bp > sym->curr_line->len)
sym->curr_line->buff_pntr = sym->curr_line->len;
else
sym->curr_line->buff_pntr = bp;
drawCursor(sym);
}
}
\end{chunk}
\subsection{moveCursorUp}
\index{hypertex!moveCursorUp}
\index{moveCursorUp hypertex}
\begin{chunk}{hypertex}
static void moveCursorUp(InputItem *sym) {
int bp = sym->curr_line->buff_pntr;
/*int size = sym->size;*/
LineStruct *trace;
/* get to the end of the current line */
for (trace = sym->curr_line;
trace->prev && trace->prev->len > sym->size;
trace = trace->prev)
;
if (!trace->prev)
BeepAtTheUser();
else {
clearCursor(sym);
sym->curr_line = trace->prev;
if (bp > sym->curr_line->len)
sym->curr_line->buff_pntr = sym->curr_line->len;
else
sym->curr_line->buff_pntr = bp;
drawCursor(sym);
}
}
\end{chunk}
\subsection{clearCursor}
\index{hypertex!clearCursor}
\index{clearCursor hypertex}
\begin{chunk}{hypertex}
static void clearCursor(InputItem *sym) {
XCharStruct extents;
int dir, asc, des;
int cursor_y;
XTextExtents(gInputFont, sym->curr_line->buffer,
sym->curr_line->buff_pntr,
&dir, &asc, &des, &extents);
cursor_y = (sym->curr_line->line_number - 1) * line_height;
sym->cursor_x = start_x + extents.width;
XClearArea(gXDisplay, sym->win, sym->cursor_x, cursor_y,
in_cursor_width, line_height, False);
XDrawString(gXDisplay, sym->win, gWindow->fInputGC,
start_x, cursor_y + start_y,
sym->curr_line->buffer,
sym->curr_line->len);
}
\end{chunk}
\subsection{moveCursorBackward}
\index{hypertex!moveCursorBackward}
\index{moveCursorBackward hypertex}
\begin{chunk}{hypertex}
static void moveCursorBackward(InputItem *sym) {
if (sym->curr_line->buff_pntr == 0) {
if (sym->curr_line->prev == NULL) {
/* now where to move */
BeepAtTheUser();
return;
}
else {
clearCursor(sym);
/* move up to the previous line */
sym->curr_line = sym->curr_line->prev;
if (sym->curr_line->len > sym->size)
sym->curr_line->buff_pntr = sym->size - 1;
else
sym->curr_line->buff_pntr = sym->curr_line->len;
}
}
else { /* just slide back a char. on the current line */
clearCursor(sym);
sym->curr_line->buff_pntr--;
}
drawCursor(sym);
}
\end{chunk}
\subsection{moveRestBack}
\index{hypertex!moveRestBack}
\index{moveRestBack hypertex}
\begin{chunk}{hypertex}
static char moveRestBack(LineStruct *line, int size) {
char c = '\000';
if (line != NULL && line->len != 0)
c = line->buffer[0];
else
return c;
while (line->next != NULL && line->len > size) {
strncpy(line->buffer, &(line->buffer[1]), size - 1);
line->buffer[size - 1] = line->next->buffer[0];
line->changed = 1;
line = line->next;
}
/*
* once I get here I should be one the last line, so I can just copy all
* the characters back one and then return from whence I came
*/
if (line->len > 0) {
line->changed = 1;
if (line->len > 1)
strncpy(line->buffer, &(line->buffer[1]), line->len - 1);
line->buffer[--line->len] = 0;
if (line->len == 0) {
/* I have to fix the previous line */
line->prev->len = size;
line->prev->buffer[size] = 0;
}
}
return c;
}
\end{chunk}
\subsection{deleteRestOfLine}
\index{hypertex!deleteRestOfLine}
\index{deleteRestOfLine hypertex}
\begin{chunk}{hypertex}
static void deleteRestOfLine(InputItem *sym) {
LineStruct *curr_line = sym->curr_line;
LineStruct *line=NULL;
LineStruct *trash;
LineStruct *trace;
int num_changed = 0, i;
if (curr_line->len > sym->size) {
for (line = curr_line->next, num_changed = 0;
line != NULL && line->len > 0 && line->len > sym->size;
line = line->next, num_changed++) {
line->len = 0;
line->buffer[0] = 0;
line->changed = 1;
}
num_changed++;
}
if (num_changed == 0 && curr_line->buff_pntr == curr_line->len) {
if (curr_line->len == 0 && curr_line->next) {
curr_line->next->prev = curr_line->prev;
if (curr_line->prev)
curr_line->prev->next = curr_line->next;
else
sym->lines = curr_line->next;
decLineNumbers(curr_line->next);
sym->num_lines--;
sym->curr_line = curr_line->next;
sym->curr_line->buff_pntr = 0;
free(curr_line->buffer);
free(curr_line);
redrawWin();
}
else
BeepAtTheUser();
return;
}
curr_line->len = curr_line->buff_pntr;
/* curr_line->buffer[curr_line->len] = NULL; */
for (i = curr_line->len; i <= sym->size + 2; i++)
curr_line->buffer[i] = 0;
curr_line->changed = 1;
if (num_changed) {
/* I should get rid of all these lines */
trace = curr_line->next;
curr_line->next = line->next;
if (line->next)
line->next->prev = curr_line;
for (; trace && trace != line->next;) {
trash = trace;
trace = trace->next;
free(trash->buffer);
free(trash);
}
decreaseLineNumbers(curr_line->next, num_changed);
sym->num_lines -= num_changed;
redrawWin();
}
else
updateInputsymbol(sym);
}
\end{chunk}
\subsection{backOverEoln}
\index{hypertex!backOverEoln}
\index{backOverEoln hypertex}
\begin{chunk}{hypertex}
static void backOverEoln(InputItem *sym) {
/*
* This routine is very similar to a tough enter except it starts
* combining lines with sym->curr_line->pre
*/
char buff[1024];
LineStruct *trace;
LineStruct *last = NULL;
char *tr = buff;
int bp;
int size = sym->size;
/* copy all the stuff into the buffer */
for (trace = sym->curr_line;
trace->len > sym->size; trace = trace->next)
for (bp = 0; bp < size; bp++)
*tr++ = trace->buffer[bp];
/* copy the last line */
for (bp = 0; bp < trace->len; bp++)
*tr++ = trace->buffer[bp];
trace->len = 0;
*tr = 0;
/* Now that I have the buffer, let's put it back where it belongs. */
last = trace;
for (trace = sym->curr_line; trace != last; trace = trace->next);
trace = sym->curr_line = sym->curr_line->prev;
trace->buff_pntr = trace->len;
trace->changed = 1;
for (bp = trace->len, tr = buff; bp < size && *tr; bp++)
trace->buffer[bp] = *tr++;
if (!*tr) {
trace->len = bp;
}
else {
trace->len = size + 1;
trace->buffer[size] = '_';
trace->buffer[size + 1] = 0;
for (trace = trace->next; *tr;) {
for (bp = 0; bp < size && *tr; bp++)
trace->buffer[bp] = *tr++;
if (*tr) {
trace->len = size + 1;
trace->changed = 1;
trace->buffer[size + 1] = 0;
trace->buffer[size] = '_';
trace = trace->next;
}
else {
trace->len = bp;
trace->buffer[bp] = 0;
}
}
}
/* Now once I am here, let me see if I can bag a line */
if (last->len == 0) {
/* rid myself of this line */
last->prev->next = last->next;
if (last->next)
last->next->prev = last->prev;
decLineNumbers(last->next);
sym->num_lines--;
free(last->buffer);
free(last);
redrawWin();
}
else
updateInputsymbol(sym);
}
\end{chunk}
\subsection{moveBackOneChar}
\index{hypertex!moveBackOneChar}
\index{moveBackOneChar hypertex}
\begin{chunk}{hypertex}
static int moveBackOneChar(InputItem *sym) {
char c = '\000', d = '\000';
int dl = 0;
/* This routine moves all the characters back one */
LineStruct *line = sym->curr_line;
if (line->len > sym->size)
c = moveRestBack(line->next, sym->size);
line->changed = 1;
if (line->buff_pntr == 0) { /* I am at the front of the line */
if (line->prev == 0) {
BeepAtTheUser();
return 0;
}
else if (line->prev->len <= sym->size) {
backOverEoln(sym);
return 1;
}
else if (line->len > 0) {
d = line->buffer[0];
if (line->len <= sym->size) {
strncpy(line->buffer, &(line->buffer[1]), line->len - 1);
if (c == 0) {
line->len--;
line->buffer[line->len] = 0;
}
else
line->buffer[line->len - 1] = c;
}
else {
strncpy(line->buffer, &(line->buffer[1]), sym->size - 2);
if (c == 0) {
line->buffer[sym->size - 1] = 0;
line->len--;
}
else {
line->buffer[sym->size - 1] = c;
}
}
}
else {
/* the line is just going to be thrown away */
if (line->next)
line->next->prev = line->prev;
line->prev->next = line->next;
decLineNumbers(line->next);
sym->num_lines--;
free(line->buffer);
free(line);
dl = 1;
}
c = d;
sym->curr_line = line = line->prev;
line->changed = 1;
line->buff_pntr = sym->size;
}
if (line->len <= sym->size) {
strncpy(&line->buffer[line->buff_pntr - 1],
&(line->buffer[line->buff_pntr]),
line->len - line->buff_pntr);
if (c == 0)
line->buffer[--line->len] = 0;
else
line->buffer[line->len - 1] = c;
}
else {
strncpy(&(line->buffer[line->buff_pntr - 1]),
&(line->buffer[line->buff_pntr]),
sym->size - line->buff_pntr);
if (c == 0) {
line->buffer[sym->size - 1] = 0;
line->len = sym->size - 1;
}
else {
if (line->next->len == 0) {
line->buffer[sym->size] = 0;
line->len = sym->size;
}
line->buffer[sym->size - 1] = c;
}
}
line->buff_pntr--;
if (dl)
redrawWin();
else
updateInputsymbol(sym);
return 1;
}
\end{chunk}
\subsection{backOverChar}
\index{hypertex!backOverChar}
\index{backOverChar hypertex}
\begin{chunk}{hypertex}
static void backOverChar(InputItem *sym) {
if (moveBackOneChar(sym))
updateInputsymbol(sym);
}
\end{chunk}
\subsection{deleteEoln}
\index{hypertex!deleteEoln}
\index{deleteEoln hypertex}
\begin{chunk}{hypertex}
static void deleteEoln(InputItem *sym) {
/* much the same as back_over eoln except my perspective has changed */
char buff[1024];
LineStruct *trace;
LineStruct *last = 0;
char *tr = buff;
int bp;
int size = sym->size;
/* copy all the stuff into the buffer */
for (trace = sym->curr_line->next;
trace->len > sym->size; trace = trace->next)
for (bp = 0; bp < size; bp++)
*tr++ = trace->buffer[bp];
/* copy the last line */
for (bp = 0; bp < trace->len; bp++)
*tr++ = trace->buffer[bp];
trace->len = 0;
*tr = 0;
/* Now that I have the buffer, let's put it back where it belongs. */
last = trace;
trace = sym->curr_line;
trace->changed = 1;
for (bp = trace->len, tr = buff; bp < size && *tr; bp++)
trace->buffer[bp] = *tr++;
if (!*tr)
trace->len = bp;
else {
trace->len = size + 1;
trace->buffer[size] = '_';
trace->buffer[size + 1] = 0;
for (trace = trace->next; *tr;) {
for (bp = 0; bp < size && *tr; bp++)
trace->buffer[bp] = *tr++;
if (*tr) {
trace->len = size + 1;
trace->changed = 1;
trace->buffer[size + 1] = 0;
trace->buffer[size] = '_';
trace = trace->next;
}
else {
trace->len = bp;
trace->buffer[bp] = 0;
}
}
}
/* Now once I am here, let me see if I can bag a line */
if (last->len == 0) {
/* rid myself of this line */
last->prev->next = last->next;
if (last->next)
last->next->prev = last->prev;
decLineNumbers(last->next);
sym->num_lines--;
free(last->buffer);
free(last);
redrawWin();
}
else
updateInputsymbol(sym);
}
\end{chunk}
\subsection{deleteOneChar}
\index{hypertex!deleteOneChar}
\index{deleteOneChar hypertex}
\begin{chunk}{hypertex}
static int deleteOneChar(InputItem *sym) {
char c = '\000';
/* This routine moves all the characters back one */
LineStruct *line = sym->curr_line;
if (line->len > sym->size)
c = moveRestBack(line->next, sym->size);
if (c == 0 && line->len == line->buff_pntr) {
if (line->next == 0) {
BeepAtTheUser();
return 0;
}
else {
deleteEoln(sym);
return 1;
}
}
/*
* let me just try to do the copy and put the stupid character c if it
* exists at the end
*/
if (line->len <= sym->size) {
strncpy(&line->buffer[line->buff_pntr],
&(line->buffer[line->buff_pntr + 1]),
line->len - line->buff_pntr);
if (c == 0)
line->buffer[--line->len] = 0;
else
line->buffer[line->len - 1] = c;
}
else {
strncpy(&(line->buffer[line->buff_pntr]),
&(line->buffer[line->buff_pntr + 1]),
sym->size - line->buff_pntr);
if (c == 0) {
line->buffer[sym->size - 1] = 0;
line->len = sym->size - 1;
}
else {
if (line->next->len == 0) {
line->buffer[sym->size] = 0;
line->len = sym->size;
}
line->buffer[sym->size - 1] = c;
}
}
line->changed = 1;
return 1;
}
\end{chunk}
\subsection{deleteChar}
\index{hypertex!deleteChar}
\index{deleteChar hypertex}
\begin{chunk}{hypertex}
static void deleteChar(InputItem *sym) {
if (deleteOneChar(sym))
updateInputsymbol(sym);
}
\end{chunk}
\subsection{toughEnter}
This routine takes all the characters from the current cursor
on, and copies them into a temp buffer, from which they are recopied
back starting at the next line.
\index{hypertex!toughEnter}
\index{toughEnter hypertex}
\begin{chunk}{hypertex}
static void toughEnter(InputItem *sym) {
char buff[1024];
LineStruct *trace;
LineStruct *last = 0;
LineStruct *newline;
char *tr = buff;
int bp = sym->curr_line->buff_pntr;
int size = sym->size;
/* Copy the stuff from the current line */
for (; bp < size; bp++)
*tr++ = sym->curr_line->buffer[bp];
/* now get the stuff from the rest of the lines */
for (trace = sym->curr_line->next;
trace->len > sym->size; trace = trace->next)
for (bp = 0; bp < size; bp++)
*tr++ = trace->buffer[bp];
/* copy the last line */
for (bp = 0; bp < trace->len; bp++)
*tr++ = trace->buffer[bp];
*tr = 0;
/* Now that I have the buffer, let's put it back where it belongs. */
last = trace;
trace = sym->curr_line;
trace->len = trace->buff_pntr;
trace->buffer[trace->len] = 0;
trace->changed = 1;
tr = buff;
for (trace = trace->next; trace != last; trace = trace->next) {
for (bp = 0; bp < size; bp++)
trace->buffer[bp] = *tr++;
trace->len = size + 1;
trace->buffer[size + 1] = 0;
trace->buffer[size] = '_';
trace->changed = 1;
}
/* Once I am here, I should be able to copy this last line */
for (bp = 0; bp < size && *tr; bp++)
trace->buffer[bp] = *tr++;
trace->changed = 1;
/* If I still have more to copy, then do so onto a new line */
if (*tr) {
trace->len = size + 1;
trace->buffer[size + 1] = 0;
trace->buffer[size] = '_';
newline = allocInputline(size);
sym->num_lines++;
newline->line_number = last->line_number + 1;
incLineNumbers(newline->next);
for (bp = 0; *tr; bp++)
newline->buffer[bp] = *tr++;
newline->len = bp;
newline->next = last->next;
newline->prev = last;
last->next = newline;
if (newline->next)
newline->next->prev = newline;
}
else {
trace->len = bp;
trace->buffer[bp] = 0;
}
/* Last but not least change the curr_line */
sym->curr_line = sym->curr_line->next;
sym->curr_line->buff_pntr = 0;
}
\end{chunk}
\subsection{enterNewLine}
At this point the user has hit a return. Let me just be naive, and
take everything from the current spot on, and put it on a new line
\index{hypertex!enterNewLine}
\index{enterNewLine hypertex}
\begin{chunk}{hypertex}
static void enterNewLine(InputItem *sym) {
LineStruct *newline;
LineStruct *trace;
LineStruct *prev;
LineStruct *line = sym->curr_line;
int bp = line->buff_pntr;
int l = line->len;
int size = sym->size;
if (bp == 0) {
if (line->prev->len > size) {
/* just add a return to the end of the last line */
prev = line->prev;
prev->buffer[size] = 0;
prev->len = size;
prev->changed = 1;
}
else {
newline = allocInputline(size);
newline->next = sym->curr_line;
newline->prev = sym->curr_line->prev;
line->prev = newline;
sym->num_lines++;
if (newline->prev)
newline->prev->next = newline;
newline->len = newline->buff_pntr = 0;
newline->line_number = line->line_number;
if (sym->curr_line == sym->lines)
sym->lines = newline;
for (trace = newline->next; trace != 0; trace = trace->next)
trace->line_number++;
}
}
else if (bp == size &&
line->len > size) {
/* line->next; */
newline = allocInputline(size);
if (line->next)
line->next->prev = newline;
newline->prev = sym->curr_line;
line->next = newline;
newline->len = 0;
newline->buff_pntr = 0;
sym->num_lines++;
sym->curr_line = newline;
newline->line_number = newline->prev->line_number + 1;
for (trace = newline->next; trace != 0; trace = trace->next)
trace->line_number++;
}
else {
if (line->len > size)
toughEnter(sym);
else {
newline = allocInputline(size);
strncpy(newline->buffer, &sym->curr_line->buffer[bp], l - bp);
sym->curr_line->len = bp;
sym->curr_line->buffer[bp] = '\0';
newline->next = sym->curr_line->next;
if (sym->curr_line->next)
sym->curr_line->next->prev = newline;
newline->prev = sym->curr_line;
sym->curr_line->next = newline;
newline->len = l - bp;
newline->buff_pntr = 0;
sym->num_lines++;
sym->curr_line = newline;
newline->line_number = newline->prev->line_number + 1;
for (trace = newline->next; trace != 0; trace = trace->next)
trace->line_number++;
}
}
redrawWin();
}
\end{chunk}
\subsection{dialog}
\index{hypertex!dialog}
\index{dialog hypertex}
\begin{chunk}{hypertex}
void dialog(XEvent *event, KeySym keysym, char *buffer) {
InputItem *item;
item = gWindow->page->currentItem;
if (item == 0) {
if (!((keysym >= XK_Shift_L) && (keysym <= XK_Hyper_R)))
/** if something other than a modifier key was hit **/
BeepAtTheUser();
return;
}
/* First check if the user had hit an enter key */
if ((keysym == XK_Return) || (keysym == XK_KP_Enter))
enterNewLine(item);
/* Else did the user actual type a character I can understand */
else if (((keysym >= XK_KP_Space) && (keysym <= XK_KP_9))
|| ((keysym >= XK_space) && (keysym <= XK_asciitilde)))
{
/* only handle normal keys */
if (event->xkey.state & UnsupportedModMask)
BeepAtTheUser();
else
addBufferToSym(buffer, item);
}
else if ((keysym >= XK_Shift_L) && (keysym <= XK_Hyper_R))
;
/*
* do nothing, a modifier was hit
*/
else if ((keysym >= XK_F2) && (keysym <= XK_F35)) {
/*
* A function key was hit
*/
if (strlen(buffer) == 0)
BeepAtTheUser();
else
/* If I got characters then add it to the buffer */
addBufferToSym(buffer, item);
}
else
switch (keysym) {
case XK_Escape:
if (event->xkey.state & ModifiersMask)
BeepAtTheUser();
else {
moveCursorHome(item);
deleteRestOfLine(item);
}
break;
case XK_F1:
if (event->xkey.state & ModifiersMask)
BeepAtTheUser();
else {
gWindow->page->helppage = allocString(InputAreaHelpPage);
helpForHyperDoc();
}
break;
case XK_Up:
if (event->xkey.state & ModifiersMask)
BeepAtTheUser();
else
moveCursorUp(item);
break;
case XK_Down:
if (event->xkey.state & ModifiersMask)
BeepAtTheUser();
else
moveCursorDown(item);
break;
case XK_Delete:
if (event->xkey.state & ModifiersMask)
BeepAtTheUser();
else
deleteChar(item);
break;
case XK_BackSpace:
if (event->xkey.state & ModifiersMask)
BeepAtTheUser();
else
backOverChar(item);
break;
case XK_Left:
if (event->xkey.state & ModifiersMask)
BeepAtTheUser();
else
moveCursorBackward(item);
break;
case XK_Right:
if (event->xkey.state & ModifiersMask)
BeepAtTheUser();
else
moveCursorForward(item);
break;
case XK_Insert:
if (event->xkey.state & ModifiersMask)
BeepAtTheUser();
else {
gInInsertMode = ((gInInsertMode) ? (0) : (1));
item->curr_line->changed = 1;
updateInputsymbol(item);
}
break;
case XK_Home:
if (event->xkey.state & ModifiersMask)
BeepAtTheUser();
else
moveCursorHome(item);
break;
case XK_End:
if (event->xkey.state & ControlMask)
/* delete from here to the end of the line */
deleteRestOfLine(item);
else if (event->xkey.state & ModifiersMask)
BeepAtTheUser();
else
moveCursorEnd(item);
break;
default:
BeepAtTheUser();
break;
}
}
\end{chunk}
\section{Format and Display a page}
Display is performed in two steps. First the page is formatted
assuming that we have an infinitely long window. In this stage
we compute and store the coordinates of every text node. Next
the page is actually drawn on the screen. In this process we
use the value of page->y\_off as an offset into the scrolling
region to compute what is actually to be displayed on the page.
\subsection{showPage}
\index{hypertex!showPage}
\index{showPage hypertex}
\begin{chunk}{hypertex}
void showPage(HyperDocPage *page) {
XWindowChanges wc;
int doShowScrollBars = 1;
initTopGroup();
/* Clear the areas so we can rewrite the page */
XClearWindow(gXDisplay, gWindow->fMainWindow);
XClearWindow(gXDisplay, gWindow->fScrollWindow);
/* Free the active button list */
freeButtonList(page->s_button_list);
page->s_button_list = NULL;
freeButtonList(page->button_list);
page->button_list = NULL;
/* The compute the text extents */
computeTitleExtent(page);
computeHeaderExtent(page);
computeFooterExtent(page);
computeScrollingExtent(page);
/*
* Now that we have all the extents computed, reconfigure and map the
* scroll window
*/
if (page->scrolling) {
int width, height;
calculateScrollBarMeasures();
wc.x = 0;
wc.y = page->top_scroll_margin + scroll_top_margin;
wc.height = gWindow->scrollheight;
if (gWindow->page->scrolling->height <= gWindow->scrollheight) {
gWindow->page->scroll_off = 0;
wc.width = gWindow->width;
}
else
wc.width = gWindow->width - gScrollbarWidth;
getScrollBarMinimumSize(&width, &height);
if (height > wc.height) {
wc.height = gWindow->scrollheight = 1;
doShowScrollBars = 0;
}
else
gWindow->scrollwidth = wc.width;
if (doShowScrollBars) {
XConfigureWindow(gXDisplay, gWindow->fScrollWindow,
CWX | CWY | CWHeight | CWWidth, &wc);
XMapWindow(gXDisplay, gWindow->fScrollWindow);
}
else {
XUnmapWindow(gXDisplay, gWindow->fScrollWindow);
hideScrollBars(gWindow);
}
}
/* clear the group stack */
while (popGroupStack() >= 0)
;
/* Now start displaying all the text */
gWindow->fDisplayedWindow = gWindow->fMainWindow;
gRegionOffset = 0;
yOff = 0;
gDisplayRegion = Header;
showText(page->header->next, Endheader);
if (doShowScrollBars && page->scrolling) {
/* Show the footer */
if (page->footer->next) {
gDisplayRegion = Footer;
gRegionOffset = gWindow->page->bot_scroll_margin +
(!((gWindow->page->pageFlags & NOLINES)) ?
((int) line_height / 2) : (0));
showText(page->footer->next, Endfooter);
/* Show the scrolling region */
if (page->scrolling->next)
gDisplayRegion = Scrolling;
gRegionOffset = 0;
gWindow->fDisplayedWindow = gWindow->fScrollWindow;
yOff = gWindow->page->scroll_off;
showText(page->scrolling->next, Endscrolling);
showScrollBars(gWindow);
}
drawScrollLines();
}
if (gTopOfItemStack != NULL) {
fprintf(stderr, "warning: unbalanced \\beginitems .. \\enditems\n");
gTopOfItemStack = NULL;
}
showTitleBar();
XFlush(gXDisplay);
}
\end{chunk}
\subsection{exposePage}
\index{hypertex!exposePage}
\index{exposePage hypertex}
\begin{chunk}{hypertex}
void exposePage(HyperDocPage *page) {
int width, height, doShowScrollBars = 1;
initTopGroup();
/*
* Now start displaying all the text
*/
yOff = 0;
gWindow->fDisplayedWindow = gWindow->fMainWindow;
gRegionOffset = 0;
gDisplayRegion = Header;
showText(page->header->next, Endheader);
getScrollBarMinimumSize(&width, &height);
/*
* Now see If I have anything left to display
*/
if (page->scrolling) {
if (page->footer->next) {
gDisplayRegion = Footer;
gRegionOffset = gWindow->page->bot_scroll_margin +
(!((gWindow->page->pageFlags & NOLINES)) ?
((int) line_height / 2) : (0));
showText(page->footer->next, Endfooter);
}
if (height > gWindow->scrollheight) {
gWindow->scrollheight = 1;
doShowScrollBars = 0;
XUnmapWindow(gXDisplay, gWindow->fScrollWindow);
hideScrollBars(gWindow);
}
if (page->scrolling->next) {
gRegionOffset = page->top_scroll_margin;
gDisplayRegion = Scrolling;
gRegionOffset = 0;
gWindow->fDisplayedWindow = gWindow->fScrollWindow;
yOff = gWindow->page->scroll_off;
showText(page->scrolling->next, Endscrolling);
if (doShowScrollBars)
showScrollBars(gWindow);
}
if (doShowScrollBars)
drawScrollLines();
}
showTitleBar();
XFlush(gXDisplay);
}
\end{chunk}
\subsection{scrollPage}
\index{hypertex!scrollPage}
\index{scrollPage hypertex}
\begin{chunk}{hypertex}
void scrollPage(HyperDocPage *page) {
initTopGroup();
/* free the active button list */
freeButtonList(page->s_button_list);
page->s_button_list = NULL;
/** Clear the scrolling area */
XUnmapSubwindows(gXDisplay, gWindow->fScrollWindow);
gDisplayRegion = Scrolling;
gRegionOffset = 0;
gWindow->fDisplayedWindow = gWindow->fScrollWindow;
yOff = gWindow->page->scroll_off;
showText(page->scrolling->next, Endscrolling);
moveScroller(gWindow);
XFlush(gXDisplay);
}
\end{chunk}
\subsection{pastePage}
\index{hypertex!pastePage}
\index{pastePage hypertex}
\begin{chunk}{hypertex}
void pastePage(TextNode *node) {
int width, height;
int old_off = gWindow->page->scroll_off;
/* free the active button list */
freeButtonList(gWindow->page->s_button_list);
gWindow->page->s_button_list = NULL;
freeButtonList(gWindow->page->button_list);
gWindow->page->button_list = NULL;
XUnmapSubwindows(gXDisplay, gWindow->fScrollWindow);
initTopGroup();
/* recompute the extent of the scrolling region */
computeScrollingExtent(gWindow->page);
calculateScrollBarMeasures();
getScrollBarMinimumSize(&width, &height);
/* get ready to show the scrolling area */
gRegionOffset = 0;
yOff = gWindow->page->scroll_off;
gDisplayRegion = Scrolling;
gWindow->fDisplayedWindow = gWindow->fScrollWindow;
if (gWindow->page->scroll_off == old_off) {
XClearArea(gXDisplay, gWindow->fScrollWindow, 0,
node->y - line_height + gRegionOffset + yOff,
gWindow->width,
gWindow->scrollheight - node->y + line_height - yOff,
False);
XFlush(gXDisplay);
}
else
XClearWindow(gXDisplay, gWindow->fScrollWindow);
showText(gWindow->page->scrolling->next, Endscrolling);
XFlush(gXDisplay);
hideScrollBars(gWindow);
if (height > gWindow->scrollheight) {
gWindow->scrollheight = 1;
XUnmapWindow(gXDisplay, gWindow->fScrollWindow);
}
else {
showScrollBars(gWindow);
drawScrollLines();
/* moveScroller(); */
}
XFlush(gXDisplay);
}
\end{chunk}
\section{Event Handling}
This is the main X loop. It keeps grabbing events. Since the only way the
window can die is through an event, it never actually end. One of the
subroutines it calls is responsible for killing everything.
\subsection{mainEventLoop}
\index{hypertex!mainEventLoop}
\index{mainEventLoop hypertex}
\begin{chunk}{hypertex}
void mainEventLoop(void) {
XEvent event;
int Xcon;
fd_set rd, dum1, dum2;
motion = 0;
gActiveWindow = -1;
setErrorHandlers();
Xcon = ConnectionNumber(gXDisplay);
while (1) {
/*fprintf(stderr,"event:mainEventLoop: loop top\n");*/
while (gSessionHashTable.num_entries == 0)
pause();
/* XFlush(gXDisplay); */
if (!motion)
initCursorStates();
motion = 0;
if (!spadSocket == 0) {
FD_ZERO(&rd);
FD_ZERO(&dum1);
FD_ZERO(&dum2);
FD_CLR(0, &dum1);
FD_CLR(0, &dum2);
FD_CLR(0, &rd);
FD_SET(spadSocket->socket, &rd);
FD_SET(Xcon, &rd);
if (!sessionServer == 0) {
FD_SET(sessionServer->socket, &rd);
}
if (XEventsQueued(gXDisplay, QueuedAlready)) {
XNextEvent(gXDisplay, &event);
handleEvent(&event);
}
else {
select(FD_SETSIZE,(void *)&rd,(void *)&dum1,(void *)&dum2,NULL);
if (FD_ISSET(Xcon, &rd) ||
XEventsQueued(gXDisplay, QueuedAfterFlush)) {
XNextEvent(gXDisplay, &event);
handleEvent(&event);
}
else if (FD_ISSET
(spadSocket->socket, &rd))
/*
* Axiom Socket do what handleEvent does The 100 is
* $SpadStuff in hypertex.boot
*/
{
if (100 == get_int(spadSocket)) {
setWindow(gParentWindow->fMainWindow);
makeBusyCursors();
getNewWindow();
}
}
/*
* Session Socket Telling us about the death of a spadbuf
* (plus maybe more later) serviceSessionSocket in
* spadint.c
*/
else
if (sessionServer && FD_ISSET(sessionServer->socket, &rd)) {
serviceSessionSocket();
}
}
}
else {
XNextEvent(gXDisplay, &event);
handleEvent(&event);
}
}
}
\end{chunk}
\subsection{handleEvent}
\index{hypertex!handleEvent}
\index{handleEvent hypertex}
\begin{chunk}{hypertex}
static void handleEvent(XEvent * event) {
XWindowAttributes wa;
/* fprintf(stderr,"event:handleEvent entered\n");*/
setWindow(event->xany.window);
if (event->type == MotionNotify) {
/* fprintf(stderr,"event:handleEvent type=MotionNotify\n");*/
handleMotionEvent((XMotionEvent *)event);
motion = 1;
return;
}
makeBusyCursors();
switch (event->type) {
case DestroyNotify:
/* fprintf(stderr,"event:handleEvent type=DestroyNotify\n");*/
break;
case Expose:
/* fprintf(stderr,"event:handleEvent type=Expose\n");*/
XGetWindowAttributes(gXDisplay, gWindow->fMainWindow, &wa);
if ((gWindow->width == 0 && gWindow->height == 0) ||
(wa.width != gWindow->width || wa.height != gWindow->height)) {
gWindow->width = wa.width;
gWindow->height = wa.height;
displayPage(gWindow->page);
gWindow->fWindowHashTable = gWindow->page->fLinkHashTable;
}
else /** just redraw the thing **/
exposePage(gWindow->page);
XFlush(gXDisplay);
clearExposures(gWindow->fMainWindow);
clearExposures(gWindow->fScrollWindow);
break;
case ButtonPress:
/* fprintf(stderr,"event:handleEvent type=ButtonPress\n");*/
handleButton(event->xbutton.button, (XButtonEvent *)event);
XFlush(gXDisplay);
if (gWindow) {
while (XCheckTypedWindowEvent(gXDisplay, gWindow->fMainWindow,
Expose, event));
while (XCheckTypedWindowEvent(gXDisplay, gWindow->fScrollWindow,
Expose, event));
}
break;
case KeyPress:
/* fprintf(stderr,"event:handleEvent type=KeyPress\n");*/
handleKey(event);
if (gWindow) {
while (XCheckTypedWindowEvent(gXDisplay, gWindow->fMainWindow,
Expose, event));
while (XCheckTypedWindowEvent(gXDisplay, gWindow->fScrollWindow,
Expose, event));
}
break;
case MapNotify:
/* fprintf(stderr,"event:handleEvent type=MapNotify\n");*/
createWindow();
break;
case SelectionNotify:
/* fprintf(stderr,"event:handleEvent type=SelectionNotify\n");*/
/* this is in response to a previous request in an input area */
if ( gSavedInputAreaLink ) {
XSelectionEvent *pSelEvent;
Atom dataProperty;
pSelEvent = (XSelectionEvent *) event;
dataProperty = XInternAtom(gXDisplay, "PASTE_SELECTION", False);
/* change the input focus */
/* changeInputFocus(gSavedInputAreaLink); */
/* try to get the selection as a window property */
if ( pSelEvent->requestor == gWindow->fMainWindow &&
pSelEvent->selection == XA_PRIMARY &&
/* pSelEvent->time == CurrentTime && */
pSelEvent->target == XA_STRING &&
pSelEvent->property == dataProperty )
{
Atom actual_type;
int actual_format;
unsigned long nitems, leftover;
char *pSelection = NULL;
if (Success == XGetWindowProperty(gXDisplay,
gWindow->fMainWindow,
pSelEvent->property, 0L, 100000000L, True,
AnyPropertyType, &actual_type, &actual_format,
&nitems, &leftover, (unsigned char **) &pSelection) )
{
char *pBuffer;
InputItem *item = gSavedInputAreaLink->reference.string;
for (pBuffer = pSelection; *pBuffer; ++pBuffer)
addBufferToSym(pBuffer, item);
XFree(pSelection);
}
}
/* clear the link info */
gSavedInputAreaLink = NULL;
}
break;
default:
/* fprintf(stderr,"event:handleEvent type=default\n");*/
break;
}
}
\end{chunk}
\subsection{createWindow}
\index{hypertex!createWindow}
\index{createWindow hypertex}
\begin{chunk}{hypertex}
static void createWindow(void) {
XWindowAttributes wa;
XGetWindowAttributes(gXDisplay, gWindow->fMainWindow, &wa);
gWindow->width = wa.width;
gWindow->height = wa.height;
displayPage(gWindow->page);
gWindow->fWindowHashTable = gWindow->page->fLinkHashTable;
/* then select for the events I normally would like to catch */
XSelectInput(gXDisplay, gWindow->fMainWindow, ButtonPress | KeyPressMask |
PointerMotionMask |
ExposureMask /* | EnterWindowMask | LeaveWindowMask */ );
XSelectInput(gXDisplay, gWindow->fScrollWindow, ExposureMask);
}
/*
*/
\end{chunk}
\subsection{quitHyperDoc}
This routine is called when the quitbutton is hit. For the moment I am
just going to leave it all behind.
\index{hypertex!quitHyperDoc}
\index{quitHyperDoc hypertex}
\begin{chunk}{hypertex}
void quitHyperDoc(void) {
HyperDocPage *page;
if (gSessionHashTable.num_entries == 1 || gParentWindow == gWindow) {
if (!strcmp(gWindow->page->name, "ProtectedQuitPage")){
exitHyperDoc();
}
page =
(HyperDocPage *)hashFind(gWindow->fPageHashTable,"ProtectedQuitPage");
if (page == NULL) {
fprintf(stderr, "Unknown page name %s\n", "ProtectedQuitPage");
exitHyperDoc();
return;
}
if (gWindow->fDownLinkStackIndex == MaxDownlinkDepth)
fprintf(stderr, "exceeded maximum link nesting level\n");
else
gWindow->fDownLinkStack[gWindow->fDownLinkStackIndex++] =
gWindow->page;
gWindow->page = page;
displayPage(gWindow->page);
gWindow->fWindowHashTable = gWindow->page->fLinkHashTable;
}
else
exitHyperDoc();
}
\end{chunk}
\subsection{findPage}
findPage takes as an argument the HyperDoc for a page name and returns
the associated page.
\index{hypertex!findPage}
\index{findPage hypertex}
\begin{chunk}{hypertex}
static HyperDocPage *findPage(TextNode * node) {
char *page_name;
HyperDocPage *page;
/* try and find the page name */
page_name = printToString(node);
page = (HyperDocPage *) hashFind(gWindow->fPageHashTable, page_name);
if (page == NULL) {
/* try to find the unknown page */
page=(HyperDocPage *) hashFind(gWindow->fPageHashTable, "UnknownPage");
if (page == NULL) {
/* Yikes, Even that could not be found */
fprintf(stderr, "Unknown page name %s\n", page_name);
}
else {
if (page->type == UnloadedPageType)
page->type = UlUnknownPage;
else
page->type = UnknownPage;
}
}
return page;
}
\end{chunk}
\subsection{downlink}
Pushes a page onto the down link stack.
\index{hypertex!downlink}
\index{downlink hypertex}
\begin{chunk}{hypertex}
static void downlink(void) {
if (gWindow->fDownLinkStackIndex == MaxDownlinkDepth)
fprintf(stderr, "exceeded maximum link nesting level\n");
else
gWindow->fDownLinkStack[gWindow->fDownLinkStackIndex++] = gWindow->page;
}
\end{chunk}
\subsection{memolink}
\index{hypertex!memolink}
\index{memolink hypertex}
\begin{chunk}{hypertex}
static void memolink(void) {
if (gWindow->fMemoStackIndex == MaxMemoDepth)
fprintf(stderr, "exceeded maximum link nesting level\n");
else {
gWindow->fMemoStack[gWindow->fMemoStackIndex] = gWindow->page;
gWindow->fDownLinkStackTop[gWindow->fMemoStackIndex++] =
gWindow->fDownLinkStackIndex;
}
}
\end{chunk}
\subsection{killAxiomPage}
\index{hypertex!killAxiomPage}
\index{killAxiomPage hypertex}
\begin{chunk}{hypertex}
static void killAxiomPage(HyperDocPage * page) {
char command[512];
sprintf(command, "(|htpDestroyPage| '%s)", page->name);
sendLispCommand(command);
}
\end{chunk}
\subsection{killPage}
\index{hypertex!killPage}
\index{killPage hypertex}
\begin{chunk}{hypertex}
static void killPage(HyperDocPage * page) {
page->scroll_off = 0;
if (page->type == SpadGen) {
hashDelete(gWindow->fPageHashTable, page->name);
killAxiomPage(page);
freePage(page);
}
}
\end{chunk}
\subsection{returnlink}
Pops the memo stack.
\index{hypertex!returnlink}
\index{returnlink hypertex}
\begin{chunk}{hypertex}
static HyperDocPage *returnlink(void) {
int i;
if (gWindow->fMemoStackIndex == 0) {
BeepAtTheUser();
return NULL;
}
else {
killPage(gWindow->page);
for (i = gWindow->fDownLinkStackIndex - 1;
i >= gWindow->fDownLinkStackTop[gWindow->fMemoStackIndex - 1];
i--)
{
killPage(gWindow->fDownLinkStack[i]);
}
gWindow->fDownLinkStackIndex =
gWindow->fDownLinkStackTop[--gWindow->fMemoStackIndex];
return (gWindow->fMemoStack[gWindow->fMemoStackIndex]);
}
}
/* pops a page if it can from the downlink stack */
\end{chunk}
\subsection{uplink}
\index{hypertex!uplink}
\index{uplink hypertex}
\begin{chunk}{hypertex}
static HyperDocPage *uplink(void) {
if (gWindow->fDownLinkStackIndex == 0)
return returnlink();
else {
killPage(gWindow->page);
return (gWindow->fDownLinkStack[--gWindow->fDownLinkStackIndex]);
}
}
\end{chunk}
\subsection{windowlinkHandler}
\index{hypertex!windowlinkHandler}
\index{windowlinkHandler hypertex}
\begin{chunk}{hypertex}
static void windowlinkHandler(TextNode * node) {
char *page_name;
/* first try and find the page */
page_name = printToString(node);
if (initTopWindow(page_name) == -1) {
return;
}
/* gWindow->fWindowHashTable = gWindow->page->fLinkHashTable;*/
}
\end{chunk}
\subsection{makeWindowLink}
\index{hypertex!makeWindowLink}
\index{makeWindowLink hypertex}
\begin{chunk}{hypertex}
void makeWindowLink(char *name) {
if (initTopWindow(name) != -1)
{}/* gWindow->fWindowHashTable = gWindow->page->fLinkHashTable; */
}
\end{chunk}
\subsection{lispwindowlinkHandler}
Since we are popping up a new window, then we had better change all
the cursors right away. We won't get another chance at it.
\index{hypertex!lispwindowlinkHandler}
\index{lispwindowlinkHandler hypertex}
\begin{chunk}{hypertex}
static void lispwindowlinkHandler(HyperLink * link) {
if (initTopWindow(NULL) != -1) {
HyperDocPage *page = NULL;
int frame = gWindow->fAxiomFrame;
page = issueServerCommand(link);
gWindow->fAxiomFrame = frame;
gWindow->page = page;
/* gWindow->fWindowHashTable = gWindow->page->fLinkHashTable;*/
}
}
\end{chunk}
\subsection{pasteButton}
\index{hypertex!pasteButton}
\index{pasteButton hypertex}
\begin{chunk}{hypertex}
static HyperDocPage *pasteButton(PasteNode * paste) {
HyperDocPage *page = NULL;
int pastewhere=paste->where;
if ( paste->end_node ==NULL ||
paste->begin_node==NULL ||
paste->arg_node==NULL ) {
BeepAtTheUser();
return NULL;
}
page=parsePatch(paste);
/* paste has changed after this call so use pastewhere*/
if (pastewhere && page ) {
if (0 == strcmp(page->name, "ErrorPage"))
page = NULL;
}
else
BeepAtTheUser();
return page;
}
\end{chunk}
\subsection{helpForHyperDoc}
\index{hypertex!helpForHyperDoc}
\index{helpForHyperDoc hypertex}
\begin{chunk}{hypertex}
void helpForHyperDoc(void) {
HyperDocPage *page = NULL;
/* do not do anything if we are already at the "no more help" page */
if (0 == strcmp(gWindow->page->name, NoMoreHelpPage))
return;
/* if no help page recorded, use the standard "no more help" page */
if (!gWindow->page->helppage)
gWindow->page->helppage = allocString(NoMoreHelpPage);
/* if we are on the main help page, use "no more help" page */
if (0 == strcmp(gWindow->page->name, TopLevelHelpPage))
gWindow->page->helppage = allocString(NoMoreHelpPage);
page =
(HyperDocPage *)hashFind(gWindow->fPageHashTable,gWindow->page->helppage);
if (page)
makeWindowLink(gWindow->page->helppage);
else
BeepAtTheUser();
}
\end{chunk}
\subsection{findButtonInList}
\index{hypertex!findButtonInList}
\index{findButtonInList hypertex}
\begin{chunk}{hypertex}
static HyperLink *findButtonInList(HDWindow * window, int x, int y) {
ButtonList *bl;
if (!window || window->page->type == UnloadedPageType)
return NULL;
for (bl = window->page->s_button_list; bl != NULL; bl = bl->next)
if (x >= bl->x0 && x <= bl->x1 && y >= bl->y0 && y <= bl->y1)
return bl->link;
for (bl = window->page->button_list; bl != NULL; bl = bl->next)
if (x >= bl->x0 && x <= bl->x1 && y >= bl->y0 && y <= bl->y1)
return bl->link;
return NULL;
}
\end{chunk}
\subsection{getHyperLink}
\index{hypertex!getHyperLink}
\index{getHyperLink hypertex}
\begin{chunk}{hypertex}
static HyperLink *getHyperLink(XButtonEvent * event) {
HyperLink *l1, *l2;
l1 =
(HyperLink *)hashFind(gWindow->fWindowHashTable,(char *)&(event->window));
if (l1)
return l1;
l2 = findButtonInList(gWindow, event->x, event->y);
return l2;
}
\end{chunk}
\subsection{handleButton}
Handle a button pressed event. window is the subwindow in which the event
occured, and button is the button which was pressed.
\index{hypertex!handleButton}
\index{handleButton hypertex}
\begin{chunk}{hypertex}
static void handleButton(int button, XButtonEvent * event) {
HyperLink *link;
HyperDocPage *page = NULL;
char *page_name;
/* handle mouse wheel (Gregory Vanuxem) */
if (event->window == gWindow->fMainWindow ||
event->window == gWindow->fScrollWindow) {
if (button == 4) {
scrollUp();
return;
}
else if (button == 5) {
scrollDown();
return;
}
}
/* find page name from sub-window handle */
link = getHyperLink(event);
if (link == NULL) { /* user clicked on an inactive area */
/* BeepAtTheUser(); */ /* I always thought this was annoying. RSS */
return;
}
switch (link->type) {
case Pastebutton:
page = pasteButton(link->reference.paste);
break;
case Link:
page_name = printToString(link->reference.node);
page = (HyperDocPage *) hashFind(gWindow->fPageHashTable, page_name);
break;
case Helpbutton:
helpForHyperDoc();
page = NULL;
break;
case Scrollbar:
scrollScroller(event);
break;
case Scrollupbutton:
scrollUp();
break;
case Scrolldownbutton:
scrollDown();
break;
case Inputstring:
/* We must be changing input focus or getting a selection */
changeInputFocus(link);
if ( button == Button2 ) {
XConvertSelection(gXDisplay, XA_PRIMARY, XA_STRING,
XInternAtom(gXDisplay, "PASTE_SELECTION", False),
gWindow->fMainWindow, CurrentTime);
gSavedInputAreaLink = link;
}
break;
case SimpleBox:
page = NULL;
toggleInputBox(link);
break;
case Radiobox:
page = NULL;
toggleRadioBox(link);
break;
case Quitbutton:
quitHyperDoc();
break;
case Returnbutton: /* pop memo information */
page = returnlink();
break;
case Upbutton: /* pop downlink information */
page = uplink();
break;
case Downlink:
page = findPage(link->reference.node);
if (page && NotSpecial(page->type))
downlink();
break;
case Memolink:
page = findPage(link->reference.node);
if (page && NotSpecial(page->type))
memolink();
break;
case Windowlink:
page = findPage(link->reference.node);
if (page && NotSpecial(page->type)) {
windowlinkHandler(link->reference.node);
gNeedIconName = 1;
page = NULL;
}
break;
case Lispwindowlink:
lispwindowlinkHandler(link);
gNeedIconName = 1;
page = NULL;
break;
case LispMemoLink:
case Spadmemolink:
page = issueServerCommand(link);
if (page && NotSpecial(page->type))
memolink();
break;
case LispDownLink:
case Spaddownlink:
page = issueServerCommand(link);
if (page && NotSpecial(page->type))
downlink();
break;
case Spadlink:
case Lisplink:
page = issueServerCommand(link);
break;
case Lispcommand:
case Qspadcall:
case Spadcall:
page = issueServerCommand(link);
break;
case Lispcommandquit:
case Spadcallquit:
case Qspadcallquit:
page = issueServerCommand(link);
exitHyperDoc();
break;
case Spadcommand:
case Spadgraph:
case Spadsrc:
issueSpadcommand(gWindow->page, link->reference.node,
button == Button1, link->type);
break;
case Unixlink:
page = issueUnixlink(link->reference.node);
if (page && NotSpecial(page->type)) {
downlink();
}
break;
case Unixcommand:
issueUnixcommand(link->reference.node);
break;
default:
break;
}
if (page) {
switch (page->type) { /* check for special button types */
case Quitbutton:
exitHyperDoc();
return;
case Returnbutton:
gWindow->page = returnlink();
break;
case Upbutton:
gWindow->page = uplink();
break;
case ErrorPage:
case UnknownPage:
case UlUnknownPage:
if (page->type == UlUnknownPage)
page->type = UnloadedPageType;
downlink();
gWindow->page = page;
break;
default: /* a normal link */
gWindow->page = page;
break;
}
if (link->type != Pastebutton)
displayPage(gWindow->page);
/* reset the window hash */
gWindow->fWindowHashTable = gWindow->page->fLinkHashTable;
}
}
\end{chunk}
\subsection{exitHyperDoc}
\index{hypertex!exitHyperDoc}
\index{exitHyperDoc hypertex}
\begin{chunk}{hypertex}
void exitHyperDoc(void) {
XEvent event;
if (gSessionHashTable.num_entries == 1 || gParentWindow == gWindow) {
freeHdWindow(gWindow);
exit(0);
}
hashDelete(&gSessionHashTable, (char *)&gWindow->fMainWindow);
/*
* Now we quickly want to flush all the events associated with this
* window from existence
*/
XFlush(gXDisplay);
while (XCheckWindowEvent(gXDisplay,gWindow->fMainWindow,
bigmask,&event)) { }
while (XCheckWindowEvent(gXDisplay,gWindow->fScrollWindow,
bigmask,&event)) { }
while (XCheckWindowEvent(gXDisplay,gWindow->fDisplayedWindow,
bigmask,&event)) { }
while (XCheckWindowEvent(gXDisplay,gWindow->fScrollUpWindow,
bigmask,&event)) { }
while (XCheckWindowEvent(gXDisplay,gWindow->fScrollDownWindow,
bigmask, &event)) { }
while (XCheckWindowEvent(gXDisplay,gWindow->scrollbar,
bigmask,&event)) { }
while (XCheckWindowEvent(gXDisplay,gWindow->scroller,
bigmask,&event)) { }
XDestroyWindow(gXDisplay, gWindow->fMainWindow);
freeHdWindow(gWindow);
gWindow = NULL;
gActiveWindow = -1;
XFlush(gXDisplay);
}
\end{chunk}
\subsection{setWindow}
\index{hypertex!setWindow}
\index{setWindow hypertex}
\begin{chunk}{hypertex}
static int setWindow(Window window) {
Window root, parent, *children, grandparent,myarg;
HDWindow *htw;
unsigned int nchildren;
int st;
myarg=window;
nchildren = 0;
htw = (HDWindow *) hashFind(&gSessionHashTable, (char *)&myarg);
if (htw != NULL) {
gWindow = htw;
return 1;
}
st = XQueryTree(gXDisplay, myarg, &root, &parent, &children, &nchildren);
if (st==0) goto ERROR;
if (nchildren > 0)
XFree(children);
htw = (HDWindow *) hashFind(&gSessionHashTable, (char *)&parent);
if (htw != NULL) {
gWindow = htw;
return 1;
}
else {
/* check for a grandparent */
st = XQueryTree(gXDisplay, parent, &root, &grandparent,
&children, &nchildren);
if (st==0) goto ERROR;
if (nchildren > 0)
XFree(children);
htw = (HDWindow *) hashFind(&gSessionHashTable, (char *)&grandparent);
if (htw != NULL) {
gWindow = htw;
return 1;
}
}
/*
* fprintf(stderr, "window(%d) and it's parent(%d) aren't in
* gSessionHashTable\n", window, parent);
we never found that window. this happens if (not iff) we exit from
an unfocused non-main window under certain wm's and click-to-type.
the program returns here with the window handle that was just destroyed.
So let's set the global gWindow to the main window.
*/
ERROR:
gWindow=gParentWindow;
return 0;
}
/*
* This procedure whips thru the stack and clears all expose events for the
* given routine
*/
\end{chunk}
\subsection{clearExposures}
\index{hypertex!clearExposures}
\index{clearExposures hypertex}
\begin{chunk}{hypertex}
static void clearExposures(Window w) {
XEvent report;
XFlush(gXDisplay);
while (XCheckTypedWindowEvent(gXDisplay, w, Expose, &report));
}
\end{chunk}
\subsection{getNewWindow}
\index{hypertex!getNewWindow}
\index{getNewWindow hypertex}
\begin{chunk}{hypertex}
void getNewWindow(void) {
int val;
char buf[128];
int frame;
Window wid;
HDWindow *htw;
HyperDocPage *hpage;
/*
* If I am going to try and start a new window, then I should make sure I
* have a coonection to listen on
*
* BUT This code is entered when a socket selects
*
* if (spadSocket == NULL) { spadSocket =
* connect_to_local_server(SpadServer, MenuServer, 10); if (spadSocket
* == NULL) { fprintf(stderr, "getNewWindow: Couldn't Connect to
* SpadServer\n"); return -1; } }
*
*/
frame = get_int(spadSocket);
val = get_int(spadSocket);
switch (val) {
case StartPage:
initTopWindow(NULL);
val = get_int(spadSocket);
initScanner();
inputType = FromSpadSocket;
inputString = "";
gWindow->page = parsePageFromSocket();
gWindow->fAxiomFrame = frame;
XFlush(gXDisplay);
break;
case LinkToPage:
get_string_buf(spadSocket, buf, 128);
if (initTopWindow(buf) == -1) {
fprintf(stderr, "getNewWindow: Did not find page %s\n", buf);
/* return -1; */
}
gWindow->fAxiomFrame = frame;
break;
case PopUpPage:
val = get_int(spadSocket);
initFormWindow(NULL, val);
send_int(spadSocket, gWindow->fMainWindow);
initScanner();
inputType = FromSpadSocket;
inputString = "";
gWindow->page = parsePageFromSocket();
computeFormPage(gWindow->page);
XMapWindow(gXDisplay, gWindow->fMainWindow);
gWindow->fWindowHashTable = gWindow->page->fLinkHashTable;
gWindow->fAxiomFrame = frame;
XFlush(gXDisplay);
break;
case PopUpNamedPage:
val = get_int(spadSocket);
get_string_buf(spadSocket, buf, 128);
if (initFormWindow(buf, val) == -1) {
send_int(spadSocket, -1);
break;
}
loadPage(gWindow->page);
computeFormPage(gWindow->page);
XMapWindow(gXDisplay, gWindow->fMainWindow);
gWindow->fWindowHashTable = gWindow->page->fLinkHashTable;
gWindow->fAxiomFrame = frame;
XFlush(gXDisplay);
send_int(spadSocket, gWindow->fMainWindow);
/* fprintf(stderr, "Window Id was %d\n", gWindow->fMainWindow); */
break;
case ReplaceNamedPage:
wid = (Window) get_int(spadSocket);
get_string_buf(spadSocket, buf, 128);
htw = (HDWindow *) hashFind(&gSessionHashTable,(char *)&wid);
if (htw == NULL) break;
hpage = (HyperDocPage *) hashFind(gWindow->fPageHashTable, buf);
if (hpage == NULL) break;
gWindow = htw;
gWindow->page = hpage;
displayPage(gWindow->page);
gWindow->fWindowHashTable = gWindow->page->fLinkHashTable;
clearExposures(gWindow->fMainWindow);
clearExposures(gWindow->fScrollWindow);
XFlush(gXDisplay);
break;
case ReplacePage:
wid = (Window) get_int(spadSocket);
setWindow(wid);
initScanner();
inputType = FromSpadSocket;
inputString = "";
gWindow->page = parsePageFromSocket();
displayPage(gWindow->page);
gWindow->fWindowHashTable = gWindow->page->fLinkHashTable;
clearExposures(gWindow->fMainWindow);
clearExposures(gWindow->fScrollWindow);
XFlush(gXDisplay);
break;
case KillPage:
/* Here the user wishes to kill the page */
wid = (Window) get_int(spadSocket);
htw = (HDWindow *) hashFind(&gSessionHashTable,(char *)&wid);
if (htw !=NULL) {
gWindow = htw;
exitHyperDoc();
break;
}
break;
}
}
\end{chunk}
\subsection{setCursor}
\index{hypertex!setCursor}
\index{setCursor hypertex}
\begin{chunk}{hypertex}
static void setCursor(HDWindow *window,Cursor state) {
if (state == gBusyCursor)
XDefineCursor(gXDisplay, window->fMainWindow, gBusyCursor);
else if (state == gActiveCursor)
XDefineCursor(gXDisplay, window->fMainWindow, gActiveCursor);
else
XDefineCursor(gXDisplay, window->fMainWindow, gNormalCursor);
XFlush(gXDisplay);
}
\end{chunk}
\subsection{changeCursor}
\index{hypertex!changeCursor}
\index{changeCursor hypertex}
\begin{chunk}{hypertex}
static void changeCursor(Cursor state, HDWindow *window) {
if (window->fDisplayedCursor == state)
return;
window->fDisplayedCursor = state;
setCursor(window, state);
}
\end{chunk}
\subsection{handleMotionEvent}
\index{hypertex!handleMotionEvent}
\index{handleMotionEvent hypertex}
\begin{chunk}{hypertex}
static void handleMotionEvent(XMotionEvent *event) {
if (!gWindow)
return;
if (findButtonInList(gWindow, event->x, event->y) != NULL)
changeCursor(gActiveCursor, gWindow);
else
changeCursor(gNormalCursor, gWindow);
}
\end{chunk}
\subsection{initCursorState}
\index{hypertex!initCursorState}
\index{initCursorState hypertex}
\begin{chunk}{hypertex}
static void initCursorState(HDWindow *window) {
if (window) {
int x, y, rx, ry, but;
Window r, c;
XQueryPointer(gXDisplay, window->fMainWindow,
&r, &c, &rx, &ry, &x, &y,(unsigned int *) &but);
if (findButtonInList(window, x, y) != NULL)
changeCursor(gActiveCursor, window);
else
changeCursor(gNormalCursor, window);
}
}
\end{chunk}
\subsection{initCursorStates}
\index{hypertex!initCursorStates}
\index{initCursorStates hypertex}
\begin{chunk}{hypertex}
static void initCursorStates(void) {
hashMap(&gSessionHashTable,(MappableFunction) initCursorState);
}
\end{chunk}
\subsection{makeBusyCursor}
\index{hypertex!makeBusyCursor}
\index{makeBusyCursor hypertex}
\begin{chunk}{hypertex}
static void makeBusyCursor(HDWindow *window) {
changeCursor(gBusyCursor, window);
}
\end{chunk}
\subsection{makeBusyCursors}
\index{hypertex!makeBusyCursors}
\index{makeBusyCursors hypertex}
\begin{chunk}{hypertex}
static void makeBusyCursors(void) {
hashMap(&gSessionHashTable, (MappableFunction)makeBusyCursor);
}
\end{chunk}
\subsection{HyperDocErrorHandler}
\index{hypertex!HyperDocErrorHandler}
\index{HyperDocErrorHandler hypertex}
\begin{chunk}{hypertex}
static int HyperDocErrorHandler(Display *display, XErrorEvent *xe) {
if (xe->request_code != 15) {
char buf[1024];
XGetErrorText(display, xe->error_code, buf, sizeof(buf));
fprintf(stderr, "error code = %d\n", xe->error_code);
fprintf(stderr, "major op code = %d\n", xe->request_code);
fprintf(stderr, "minor op code = %d\n", xe->minor_code);
fprintf(stderr, "XID = %ld\n", xe->resourceid);
fprintf(stderr, "%s\n", buf);
if (xe->request_code != 15)
exit(-1);
}
return(0);
}
\end{chunk}
\subsection{setErrorHandlers}
\index{hypertex!setErrorHandlers}
\index{setErrorHandlers hypertex}
\begin{chunk}{hypertex}
static void setErrorHandlers(void) {
XSetErrorHandler(HyperDocErrorHandler);
}
\end{chunk}
\section{Line Extent Computation}
\subsection{computeInputExtent}
Computes the extent of the input string or box.
\index{hypertex!computeInputExtent}
\index{computeInputExtent hypertex}
\begin{chunk}{hypertex}
static void computeInputExtent(TextNode * node) {
InputItem *item;
int t_width;
int num_lines;
/* search the symbol table for the proper entry */
item = node->link->reference.string;
num_lines = item->num_lines;
/*
* Once we have gotten this far, we should just be able to calculate the
* width using the normal font
*/
t_width = (item->size + 1) * gInputFont->max_bounds.width + 10;
if (gInLine)
text_x += inter_word_space;
if (text_x + t_width > right_margin) {
startNewline(present_line_height, node);
text_x = indent;
}
node->x = text_x;
/* now figure out the height of the current window */
node->height = line_height * (num_lines);
node->y = text_y - line_height + node->height - 1;
if (node->height > present_line_height)
present_line_height = plh(node->height);
node->width = t_width;
gInLine = 1;
text_x += t_width;
}
\end{chunk}
\subsection{computePunctuationExtent}
\index{hypertex!computePunctuationExtent}
\index{computePunctuationExtent hypertex}
\begin{chunk}{hypertex}
static void computePunctuationExtent(TextNode * node) {
int twidth;
int nextwidth;
int incwidth;
node->height = normal_textHeight;
node->width = strlen(node->data.text);
incwidth = twidth = XTextWidth(gTopOfGroupStack->cur_font, node->data.text,
node->width);
/* always check to see if there was some space in front of us */
if (gInLine && (node->space & FRONTSPACE))
twidth += inter_word_space;
/*
* now calcualte the width of the next one if it needs to be considered
*/
if (!(node->space & BACKSPACE))
nextwidth = totalWidth(node->next, Endtokens);
else
nextwidth = 0;
if ((!(node->space & BACKSPACE)) &&
(text_x + twidth + nextwidth > right_margin) && gInLine) {
startNewline(present_line_height, node);
if (gInAxiomCommand) {
text_x = indent + spadcom_indent;
}
else
text_x = indent;
}
if (node->space & FRONTSPACE)
text_x += inter_word_space;
node->x = text_x;
/*
* Now try to see if we should leave space after myself. Always leave
* space when there is space
*/
if (node->space & BACKSPACE) {
switch (node->data.text[0]) {
case '.':
case '?':
case '!':
text_x += term_punct_space;
break;
}
}
text_x += incwidth;
node->y = text_y - word_off_height;
gInLine = 1;
}
\end{chunk}
\subsection{computeWordExtent}
\index{hypertex!computeWordExtent}
\index{computeWordExtent hypertex}
\begin{chunk}{hypertex}
static void computeWordExtent(TextNode * node) {
int twidth;
int nextwidth;
int incwidth;
node->height = normal_textHeight;
node->width = strlen(node->data.text);
incwidth = twidth = XTextWidth(gTopOfGroupStack->cur_font, node->data.text,
node->width);
/*
* Now if we should drop some space in front of me, then add it to twidth
*/
if (gInLine && node->space)
twidth += inter_word_space;
/*
* Now what we should do is find all the things after us that have no
* space in front and add there width on.
*/
nextwidth = totalWidth(node->next, Endtokens);
/*
* Should we start a new line?
*/
if (text_x + twidth + nextwidth > right_margin && gInLine) {
startNewline(present_line_height, node);
if (gInAxiomCommand) {
text_x = indent + spadcom_indent;
}
else
text_x = indent;
}
/*
* Now see if we am on the beginning of a line, and if not add some space
* if we need to
*/
if (gInLine && node->space)
text_x += inter_word_space;
node->x = text_x;
node->y = text_y - word_off_height;
text_x += incwidth;
gInLine = 1;
}
\end{chunk}
\subsection{computeVerbatimExtent}
\index{hypertex!computeVerbatimExtent}
\index{computeVerbatimExtent hypertex}
\begin{chunk}{hypertex}
static void computeVerbatimExtent(TextNode *node) {
node->height = normal_textHeight;
node->width = strlen(node->data.text);
node->x = text_x;
node->y = text_y - word_off_height;
gInLine = 1;
return;
}
\end{chunk}
\subsection{computeSpadsrctxtExtent}
\index{hypertex!computeSpadsrctxtExtent}
\index{computeSpadsrctxtExtent hypertex}
\begin{chunk}{hypertex}
static void computeSpadsrctxtExtent(TextNode *node) {
node->height = normal_textHeight;
node->width = strlen(node->data.text);
if (gInLine) {
startNewline(present_line_height, node);
text_x = indent;
}
node->x = text_x;
node->y = text_y - word_off_height;
gInLine = 1;
return;
}
\end{chunk}
\subsection{computeDashExtent}
\index{hypertex!computeDashExtent}
\index{computeDashExtent hypertex}
\begin{chunk}{hypertex}
static void computeDashExtent(TextNode *node) {
int num_dashes;
int twidth;
int nextwidth;
node->height = normal_textHeight;
num_dashes = strlen(node->data.text);
if (num_dashes > 1)
twidth = node->width = num_dashes * dash_width;
else
twidth = node->width = XTextWidth(gTopOfGroupStack->cur_font,
node->data.text, 1);
if (gInLine && node->space)
twidth += inter_word_space;
/*
* Now what we should do is find all the things after us that have no
* space in front and add there width on.
*/
nextwidth = totalWidth(node->next, Endtokens);
/*
* Should we start a new line?
*/
if (text_x + twidth + nextwidth > right_margin) {
startNewline(present_line_height, node);
if (gInAxiomCommand) {
text_x = indent + spadcom_indent;
}
else
text_x = indent;
}
/*
* Now see if we am on the beginning of a line, and if not add some space
* if we need to
*/
if (gInLine && node->space)
text_x += inter_word_space;
node->x = text_x;
if (num_dashes > 1)
node->y = text_y - dash_y;
else
node->y = text_y - word_off_height;
text_x += node->width;
gInLine = 1;
return;
}
\end{chunk}
\subsection{computeTextExtent}
\index{hypertex!computeTextExtent}
\index{computeTextExtent hypertex}
\begin{chunk}{hypertex}
void computeTextExtent(TextNode *node) {
for (; node != NULL; node = node->next) {
switch (node->type) {
case Endpastebutton:
endpastebuttonExtent(node);
break;
case Paste:
computePasteExtent(node);
break;
case Endpaste:
if (gInLine) {
startNewline(present_line_height, node);
text_x = indent;
}
break;
case Pastebutton:
computePastebuttonExtent(node);
break;
case Ifcond:
computeIfcondExtent(node);
break;
case Fi:
break;
case Endif:
if (if_node == NULL) {
return;
}
else
endifExtent(node);
break;
case Endcenter:
startNewline(present_line_height, node->next);
popGroupStack();
text_x = indent;
break;
case Pound:
case Macro:
/* check to see if we had space in front of me, if so add it */
if (node->space && gInLine)
text_x += inter_word_space;
break;
case Punctuation:
computePunctuationExtent(node);
break;
case Endmath:
break;
case Endverbatim:
if (gInLine) {
startNewline(present_line_height, node);
text_x = indent;
}
break;
case Spadsrctxt:
computeSpadsrctxtExtent(node);
break;
case Math:
computeWordExtent(node);
break;
case Verbatim:
computeVerbatimExtent(node);
break;
case WindowId:
case Word:
case Lsquarebrace:
case Rsquarebrace:
computeWordExtent(node);
break;
case Dash:
computeDashExtent(node);
break;
case HSpace:
node->height = line_height;
node->x = text_x;
node->y = text_y;
if (gInLine) {
text_x +=
(node->data.node != NULL ? atoi(node->data.node->data.text) : 1);
}
break;
case VSpace:
node->height = line_height;
node->x = text_x;
node->y = text_y + present_line_height;;
text_y +=
(node->data.node != NULL ? atoi(node->data.node->data.text) : 1) +
present_line_height;
past_line_height = (node->data.node != NULL ?
atoi(node->data.node->data.text) : 1)
+ present_line_height;
present_line_height = line_height;
break;
case Space:
node->height = line_height;
node->x = text_x;
node->y = text_y;
text_x += (gTopOfGroupStack->cur_font->max_bounds.width) *
(node->data.node != NULL ? atoi(node->data.node->data.text) : 1);
break;
case Tab:
node->height = line_height;
text_x = indent + (gTopOfGroupStack->cur_font->max_bounds.width) *
(node->data.node != NULL ? atoi(node->data.node->data.text) : 1);
gInLine = 0;
break;
case Par:
node->height = line_height;
if (gInItem)
text_x = indent;
else
text_x = indent + paragraph_space;
if (gInLine) {
startNewline(present_line_height, node);
}
break;
case Newline:
if (gInLine) {
startNewline(present_line_height, node);
text_x = indent;
}
break;
case Horizontalline:
if (gInLine) {
startNewline(present_line_height, node);
text_x = indent;
}
node->height = line_height;
gInLine = 0;
node->y = text_y - line_height / 2;
node->x = text_x;
startNewline(present_line_height, node);
break;
case Center:
computeCenterExtent(node);
break;
case Box:
computeBoxExtent(node);
break;
case Mbox:
computeMboxExtent(node);
break;
case Beginitems:
case Begintitems:
computeBeginItemsExtent(node);
break;
case Enditems:
case Endtitems:
popItemStack();
if (gInLine) {
startNewline(present_line_height, node);
}
text_x = indent;
break;
case Titem:
if (gInLine) {
startNewline(present_line_height, node);
}
text_x = indent - item_space;
break;
case Item:
computeItemExtent(node);
break;
case Mitem:
computeMitemExtent(node);
break;
case Upbutton:
case Returnbutton:
case Memolink:
case Downlink:
case Link:
case Windowlink:
computeButtonExtent(node);
break;
case Unixlink:
case Lisplink:
case Lispwindowlink:
case Spadcall:
case Spadcallquit:
case Qspadcall:
case Qspadcallquit:
case LispDownLink:
case LispMemoLink:
case Lispcommand:
case Lispcommandquit:
case Spadlink:
case Spaddownlink:
case Spadmemolink:
case Unixcommand:
computeButtonExtent(node);
break;
case Endbutton:
endbuttonExtent(node);
break;
case Endlink:
if (link_node == NULL)
return;
else
endbuttonExtent(node);
break;
case Spadsrc:
computeSpadsrcExtent(node);
break;
case Spadcommand:
case Spadgraph:
computeSpadcommandExtent(node);
break;
case Endspadsrc:
endSpadsrcExtent(node);
break;
case Endspadcommand:
endSpadcommandExtent(node);
break;
case Indent:
indent = left_margin +
atoi(node->data.node->data.text) *
(gTopOfGroupStack->cur_font->max_bounds.width);
if (!gInLine)
text_x = indent;
break;
case Indentrel:
indent += atoi(node->data.node->data.text) *
(gTopOfGroupStack->cur_font->max_bounds.width);
if (!gInLine)
text_x = indent;
break;
case Group:
pushGroupStack();
node->y = text_y;
if (gInLine && node->space)
text_x += inter_word_space;
break;
case Endgroup:
popGroupStack();
break;
case Tableitem:
pushGroupStack();
node->y = text_y;
if (gInLine && node->space)
text_x += inter_word_space;
break;
case Endtableitem:
popGroupStack();
return;
case Controlbitmap:
case Inputbitmap:
if (node->width == -1)
insertBitmapFile(node);
computeImageExtent(node);
break;
case Inputpixmap:
if (node->width == -1)
insertPixmapFile(node);
computeImageExtent(node);
break;
case Table:
computeTableExtent(&node);
break;
case BoldFace:
computeBfExtent(node);
break;
case Emphasize:
computeEmExtent(node);
break;
case It:
computeItExtent(node);
break;
case Rm:
case Sl:
case Tt:
computeRmExtent(node);
break;
case Inputstring:
computeInputExtent(node);
break;
case SimpleBox:
case Radiobox:
computeIrExtent(node);
break;
case Endbox:
text_x += box_width;
break;
case Endmacro:
case Endparameter:
break;
case Description:
bfTopGroup();
break;
case Enddescription:
popGroupStack();
if (gInDesc)
return;
break;
case Endscrolling:
/*
* What we should do here is if we am in the middle of a line, we
* should end it here an now.
*/
if (gInLine)
startNewline(present_line_height, node);
break;
case Noop:
noop_count++;
break;
case Endinputbox:
case Endheader:
case Endtitle:
case Endfooter:
case Rbrace:
case Free:
case Bound:
case Beep:
case 0:
break;
default:
fprintf(stderr, "computeTextExtent: Unknown node type %d\n",
node->type);
break;
}
}
}
\end{chunk}
\subsection{computeBeginItemsExtent}
\index{hypertex!computeBeginItemsExtent}
\index{computeBeginItemsExtent hypertex}
\begin{chunk}{hypertex}
static void computeBeginItemsExtent(TextNode * node) {
int store_x, store_y, lh;
/*
* This routine pushes the current item_stack, and then tries to set the
* item_indent, and the indent level. It checks for an optional argument
* to begin{items} and if found uses its width.
*/
if (gInLine) {
startNewline(present_line_height, node);
}
store_x = text_x, store_y = text_y, lh = present_line_height;
text_x = indent;
pushItemStack();
gInItem++;
item_indent = indent;
if (node->data.node != NULL) {
/* we have a desc */
gInDesc = 1;
computeTextExtent(node->data.node);
gInDesc = 0;
item_space = textWidth(node->data.node, Enddescription);
text_x = store_x;
text_y = store_y;
present_line_height = lh;
indent = item_indent + item_space;
}
else
indent = item_indent + 30;
gInLine = 0;
}
\end{chunk}
\subsection{computeItemExtent}
\index{hypertex!computeItemExtent}
\index{computeItemExtent hypertex}
\begin{chunk}{hypertex}
static void computeItemExtent(TextNode * node) {
if (gInLine)
startNewline(present_line_height, node);
text_x = item_indent;
}
\end{chunk}
\subsection{computeMitemExtent}
\index{hypertex!computeMitemExtent}
\index{computeMitemExtent hypertex}
\begin{chunk}{hypertex}
static void computeMitemExtent(TextNode *node) {
if (gInLine) {
startNewline(present_line_height, node);
}
text_x = item_indent;
}
\end{chunk}
\subsection{endifExtent}
\index{hypertex!endifExtent}
\index{endifExtent hypertex}
\begin{chunk}{hypertex}
static void endifExtent(TextNode *node) {
/*
* This node has the responsibilty for updating text_x and text_y so that
* they are the maxaimum width of teh else and then statements
*/
text_x = if_node->x;
text_y = if_node->y;
if_node = NULL;
}
\end{chunk}
\subsection{computeIfcondExtent}
This routine checks the value of the condition and swaps in the {\tt else}
or the {\tt then} depending.
\index{hypertex!computeIfcondExtent}
\index{computeIfcondExtent hypertex}
\begin{chunk}{hypertex}
static void computeIfcondExtent(TextNode *node) {
TextNode *condnode = node->data.ifnode->cond;
TextNode *tln = gLineNode;
int store_x = text_x, store_y = text_y, lh = present_line_height;
int then_x, then_y;
/*
* we have to compute the maximum width and height of the rest of the
* text and stuff
*/
pushGroupStack();
if (gInLine && node->space)
text_x += inter_word_space;
computeTextExtent(node->data.ifnode->thennode);
then_x = text_x;
then_y = text_y;
text_x = store_x;
text_y = store_y;
present_line_height = lh;
gLineNode = tln;
if (gInLine && node->space)
text_x += inter_word_space;
computeTextExtent(node->data.ifnode->elsenode);
/* Now choose the best one that is biggest and put it into ifnode */
if (then_y > text_y) {
node->y = then_y;
node->x = then_x;
}
else if (text_y > then_y) {
node->y = text_y;
node->x = text_x;
}
else if (text_x > then_x) {
node->y = text_y;
node->x = text_x;
}
else {
node->y = then_y;
node->x = then_x;
}
/* restore everything */
text_x = store_x;
text_y = store_y;
present_line_height = lh;
gLineNode = tln;
node->width = 0;
if_node = node;
if (gInLine && node->space)
text_x += inter_word_space;
if (checkCondition(condnode)) {
node->next = node->data.ifnode->thennode;
}
else {
node->next = node->data.ifnode->elsenode;
}
popGroupStack();
}
\end{chunk}
\subsection{computeCenterExtent}
\index{hypertex!computeCenterExtent}
\index{computeCenterExtent hypertex}
\begin{chunk}{hypertex}
static void computeCenterExtent(TextNode * node) {
if (gInLine)
startNewline(present_line_height, node);
centerTopGroup();
if (gLineNode)
text_x = indent;
else {
fprintf(stderr, "(HyperDoc) Internal error: unexpected state ");
fprintf(stderr, "in computeCenterExtent.\n");
exit(-1);
}
}
\end{chunk}
\subsection{computeBfExtent}
\index{hypertex!computeBfExtent}
\index{computeBfExtent hypertex}
\begin{chunk}{hypertex}
static void computeBfExtent(TextNode *node) {
if (gInLine && node->space)
text_x += inter_word_space;
node->x = text_x;
node->y = text_y;
bfTopGroup();
}
\end{chunk}
\subsection{computeEmExtent}
\index{hypertex!computeEmExtent}
\index{computeEmExtent hypertex}
\begin{chunk}{hypertex}
static void computeEmExtent(TextNode *node) {
if (gInLine && node->space)
text_x += inter_word_space;
node->x = text_x;
node->y = text_y;
if (gTopOfGroupStack->cur_font == gEmFont)
rmTopGroup();
else
emTopGroup();
}
\end{chunk}
\subsection{computeItExtent}
\index{hypertex!computeItExtent}
\index{computeItExtent hypertex}
\begin{chunk}{hypertex}
static void computeItExtent(TextNode *node) {
if (gInLine && node->space)
text_x += inter_word_space;
node->x = text_x;
node->y = text_y;
}
\end{chunk}
\subsection{computeRmExtent}
\index{hypertex!computeRmExtent}
\index{computeRmExtent hypertex}
\begin{chunk}{hypertex}
static void computeRmExtent(TextNode *node) {
if (gInLine && node->space)
text_x += inter_word_space;
node->x = text_x;
node->y = text_y;
rmTopGroup();
}
\end{chunk}
\subsection{computeButtonExtent}
\index{hypertex!computeButtonExtent}
\index{computeButtonExtent hypertex}
\begin{chunk}{hypertex}
static void computeButtonExtent(TextNode *node) {
int twidth;
/*int store_x = text_x;*/
/*int store_y = text_y;*/
/*int lh = present_line_height;*/
pushActiveGroup();
/* First see if we should leave a little space in front of myself * */
if (gInLine && node->space)
text_x += inter_word_space;
twidth = textWidth(node->next, Endbutton);
if (gInLine && node->space)
text_x += inter_word_space;
if (text_x + twidth > right_margin && gInLine) {
startNewline(present_line_height, node);
text_x = indent;
}
node->x = text_x;
node->y = text_y;
link_node = node;
}
\end{chunk}
\subsection{endbuttonExtent}
\index{hypertex!endbuttonExtent}
\index{endbuttonExtent hypertex}
\begin{chunk}{hypertex}
static void endbuttonExtent(TextNode *node) {
int temp;
int height;
int twidth;
int y;
int maxx;
maxx = maxX(link_node, Endbutton);
link_node->width = twidth = textWidth(link_node->next, Endbutton);
height = link_node->y;
temp = textHeight(link_node->next, Endbutton);
link_node->height = temp - link_node->y + line_height;
if (gInLine)
y = text_y;
else
y = text_y - past_line_height;
if (y > height) {
link_node->y = temp; /* height + link_node->height -
* normal_textHeight; */
link_node->width = maxx - indent;
if (gInLine) {
startNewline(present_line_height, node);
text_x = indent;
}
}
else {
link_node->width = twidth;
link_node->y = text_y + link_node->height - line_height;
}
popGroupStack();
link_node = NULL;
}
\end{chunk}
\subsection{computePastebuttonExtent}
\index{hypertex!computePastebuttonExtent}
\index{computePastebuttonExtent hypertex}
\begin{chunk}{hypertex}
static void computePastebuttonExtent(TextNode *node) {
int twidth;
pushActiveGroup();
/* First see if we should leave a little space in front of myself * */
if (gInLine && node->space)
text_x += inter_word_space;
twidth = textWidth(node->next, Endpastebutton);
if (gInLine && node->space)
text_x += inter_word_space;
if (text_x + twidth > right_margin && gInLine) {
startNewline(present_line_height, node);
text_x = indent;
}
node->x = text_x;
node->y = text_y;
paste_node = node;
return;
}
\end{chunk}
\subsection{endpastebuttonExtent}
\index{hypertex!endpastebuttonExtent}
\index{endpastebuttonExtent hypertex}
\begin{chunk}{hypertex}
static void endpastebuttonExtent(TextNode *node) {
int temp;
int height;
int twidth;
paste_node->width = twidth = textWidth(paste_node->next, Endpastebutton);
height = paste_node->y;
temp = textHeight(paste_node->next, Endpastebutton);
paste_node->height = temp - paste_node->y + line_height;
if (text_y > height) {
paste_node->y = temp;
paste_node->width = right_margin - indent;
if (gInLine) {
startNewline(present_line_height, node);
text_x = indent;
}
}
else {
paste_node->width = twidth;
paste_node->y = text_y + paste_node->height - line_height;
}
popGroupStack();
paste_node = NULL;
gInLine = 1;
}
\end{chunk}
\subsection{computePasteExtent}
\index{hypertex!computePasteExtent}
\index{computePasteExtent hypertex}
\begin{chunk}{hypertex}
static void computePasteExtent(TextNode *node) {
if (gInLine) {
startNewline(present_line_height, node);
text_x = indent;
}
node->x = text_x;
node->y = text_y;
node->height = line_height;
}
\end{chunk}
\subsection{computeSpadcommandExtent}
Compute the text extent of a spadcommand node.
\index{hypertex!computeSpadcommandExtent}
\index{computeSpadcommandExtent hypertex}
\begin{chunk}{hypertex}
static void computeSpadcommandExtent(TextNode *node) {
/*
* From now on if there is an example which will take over a line, then
* it will start and end with a newline
*/
/*int height;*/
int t_width;
/*int store_x = text_x;*/
/*int store_y = text_y;*/
/*int lh = present_line_height;*/
gInAxiomCommand = 1;
pushSpadGroup();
/* Check to see if we should space in front of myself */
if (gInLine && node->space)
text_x += inter_word_space;
t_width = textWidth(node->next, Endspadcommand);
if (gInLine && ((text_x + t_width) > right_margin)) {
startNewline(present_line_height, node);
text_x = indent;
}
node->x = text_x;
node->y = text_y;
spad_node = node;
}
\end{chunk}
\subsection{computeSpadsrcExtent}
\index{hypertex!computeSpadsrcExtent}
\index{computeSpadsrcExtent hypertex}
\begin{chunk}{hypertex}
static void computeSpadsrcExtent(TextNode *node) {
/*
* From now on if there is an example which will take over a line, then
* it will start and end with a newline
*/
/*int store_x = text_x;*/
/*int store_y = text_y;*/
/*int lh = present_line_height;*/
gInAxiomCommand = 1;
pushSpadGroup();
if (gInLine) {
startNewline(present_line_height, node);
text_x = indent;
}
node->x = text_x;
node->y = text_y;
spad_node = node;
}
\end{chunk}
\subsection{endSpadcommandExtent}
\index{hypertex!endSpadcommandExtent}
\index{endSpadcommandExtent hypertex}
\begin{chunk}{hypertex}
static void endSpadcommandExtent(TextNode *node) {
int temp;
int height;
int twidth;
int maxx;
/*int y = (gInLine) ? (text_y) : (text_y - past_line_height);*/
maxx = maxX(spad_node, Endspadcommand);
twidth = spad_node->width = textWidth(spad_node->next, Endspadcommand);
height = spad_node->y;
temp = textHeight(spad_node->next, Endspadcommand);
spad_node->height = temp - height + line_height;
if (text_y > height && gInLine) {
spad_node->y = temp;
spad_node->width = maxx - indent;
startNewline(present_line_height, node);
text_x = indent;
}
else {
spad_node->width = twidth;
spad_node->y = text_y - line_height + spad_node->height;
}
popGroupStack();
gInAxiomCommand = 0;
spad_node = NULL;
}
\end{chunk}
\subsection{endSpadsrcExtent}
\index{hypertex!endSpadsrcExtent}
\index{endSpadsrcExtent hypertex}
\begin{chunk}{hypertex}
static void endSpadsrcExtent(TextNode *node) {
int temp;
int height;
int twidth;
int maxx;
int y = (gInLine) ? (text_y) : (text_y - past_line_height);
maxx = maxX(spad_node, Endspadsrc);
twidth = spad_node->width = textWidth(spad_node->next, Endspadsrc);
height = spad_node->y;
temp = textHeight(spad_node->next, Endspadsrc);
spad_node->height = temp - height + line_height;
if (y > height && gInLine) {
spad_node->y = temp;
spad_node->width = maxx - indent;
startNewline(present_line_height, node);
text_x = indent;
}
else {
spad_node->width = twidth;
spad_node->y = text_y - line_height + spad_node->height;
}
popGroupStack();
gInAxiomCommand = 0;
spad_node = NULL;
}
\end{chunk}
\subsection{computeMboxExtent}
\index{hypertex!computeMboxExtent}
\index{computeMboxExtent hypertex}
\begin{chunk}{hypertex}
static void computeMboxExtent(TextNode *node) {
node->width = textWidth(node->next, Endmbox);
if (node->space)
text_x += inter_word_space;
if (text_x + node->width > right_margin) {
startNewline(present_line_height, node);
text_x = indent;
}
node->x = text_x;
node->y = text_y;
}
\end{chunk}
\subsection{computeBoxExtent}
\index{hypertex!computeBoxExtent}
\index{computeBoxExtent hypertex}
\begin{chunk}{hypertex}
static void computeBoxExtent(TextNode *node) {
int t_width;
/*
* First thing we do is see if we need to skip some space in front of the
* word
*/
if (gInLine && node->space)
text_x += inter_word_space;
/* Calculate the actual width of the box */
t_width = textWidth(node->next, Endbox) + 2 * box_width;
if (text_x + t_width > right_margin) {
startNewline(present_line_height, node);
text_x = indent;
}
node->x = text_x;
text_x = text_x + box_width;
node->y = text_y - 2;
node->width = t_width;
node->height = line_height - 2;
gInLine = 1;
}
\end{chunk}
\subsection{computeIrExtent}
\index{hypertex!computeIrExtent}
\index{computeIrExtent hypertex}
\begin{chunk}{hypertex}
static void computeIrExtent(TextNode *node) {
int t_width;
/*
* First thing we do is see if we need to skip some space in front of the
* word
*/
if (gInLine && node->space)
text_x += inter_word_space;
/* Calculate the actual width of the box */
t_width = node->width;
if (text_x + t_width > right_margin) {
startNewline(present_line_height, node);
text_x = indent;
}
node->x = text_x;
if (node->height > line_height) {
node->height = present_line_height
= plh(node->height + inter_line_space);
node->y = text_y + node->height - normal_textHeight;
}
else {
node->y = text_y - line_height + node->height;
}
gInLine = 1;
text_x += node->width;
}
\end{chunk}
\subsection{computeImageExtent}
Read a bitmap file into memory.
\index{hypertex!computeImageExtent}
\index{computeImageExtent hypertex}
\begin{chunk}{hypertex}
static void computeImageExtent(TextNode *node) {
if (text_x + node->width > right_margin) {
startNewline(present_line_height, node);
text_x = indent;
}
node->x = text_x;
if (node->height > line_height) {
present_line_height = plh(node->height + inter_line_space);
node->y = text_y + node->height - line_height;
}
else {
node->y = text_y - line_height + node->height;
}
text_x += node->width;
gInLine = 1;
}
\end{chunk}
\subsection{computeTableExtent}
Compute the coordinates of the entries in a table.
\index{hypertex!computeTableExtent}
\index{computeTableExtent hypertex}
\begin{chunk}{hypertex}
static void computeTableExtent(TextNode **node) {
int num_cols, num_lines;
int max_width = 0, node_width, col_width;
int x, y, num_entries = 0,/* n=0, */ screen_width, table_top;
TextNode *front = *node;
TextNode *tn;
gInTable = 1;
front->x = text_x;
front->y = text_y;
for (tn=front->next; tn->type != Endtable; num_entries++, tn = tn->next) {
/* Now we need to scan the table group by group */
node_width = textWidth(tn->next, Endtableitem);
if (node_width > max_width)
max_width = node_width;
/* Get to the beginning og the next group */
for (; tn->type != Endtableitem; tn = tn->next);
}
col_width = max_width + min_inter_column_space;
screen_width = gWindow->width - right_margin_space - indent;
num_cols = screen_width / col_width;
if (num_cols == 0)
num_cols = 1;
num_lines = num_entries / num_cols;
if (num_entries % num_cols != 0)
++num_lines;
if (gInLine) {
startNewline(present_line_height, *node);
}
table_top = text_y;
num_cols = num_entries / num_lines;
if (num_entries % num_lines != 0)
++num_cols;
col_width = screen_width / num_cols;
for (tn = front->next, x = 0; x < num_cols; x++)
for (y = 0; y < num_lines && tn->type != Endtable; y++) {
if (num_cols == 1 && y > 0)
text_y += line_height;
else
text_y = table_top + y * line_height;
text_x = indent + x * col_width;
gInLine = 0;
computeTextExtent(tn->next);
for (; tn->type != Endtableitem; tn = tn->next);
tn = tn->next;
}
front->height = num_lines * line_height;
front->width = screen_width;
text_x = indent;
if (num_cols == 1)
text_y += line_height;
else
text_y = table_top + front->height;
*node = tn;
gInLine = 0;
}
\end{chunk}
\subsection{computeTitleExtent}
\index{hypertex!computeTitleExtent}
\index{computeTitleExtent hypertex}
\begin{chunk}{hypertex}
void computeTitleExtent(HyperDocPage *page) {
right_margin_space = non_scroll_right_margin_space;
page->title->height = twheight + gWindow->border_width;
page->title->x = gWindow->border_width +
2 * twwidth + (int) gWindow->border_width / 2;
gLineNode = page->title->next;
initTitleExtents(page);
text_y = top_margin + line_height;
computeTextExtent(page->title->next);
page->title->height = max(textHeight(page->title->next, Endtitle),
twheight);
}
\end{chunk}
\subsection{computeHeaderExtent}
\index{hypertex!computeHeaderExtent}
\index{computeHeaderExtent hypertex}
\begin{chunk}{hypertex}
void computeHeaderExtent(HyperDocPage *page) {
/*
* Hopefully we will soon be able to actually compute the needed height
* for the header here
*/
int ty; /* UNUSED */
gExtentRegion = Header;
right_margin_space = non_scroll_right_margin_space;
initExtents();
ty = text_y = 3 * top_margin +
line_height + max(page->title->height, twheight);
gLineNode = page->header->next;
computeTextExtent(page->header->next);
page->header->height = textHeight(page->header->next, Endheader);
if (page->header->height) {
page->header->height += 1 / 2 * line_height;
page->top_scroll_margin = (gInLine) ? text_y : text_y-past_line_height;
if (!(page->pageFlags & NOLINES))
page->top_scroll_margin += (int) line_height / 2;
page->top_scroll_margin += gWindow->border_width + 2 * top_margin;
}
else {
page->top_scroll_margin = page->title->height + gWindow->border_width +
2 * scroll_top_margin;
}
}
\end{chunk}
\subsection{computeFooterExtent}
\index{hypertex!computeFooterExtent}
\index{computeFooterExtent hypertex}
\begin{chunk}{hypertex}
void computeFooterExtent(HyperDocPage * page) {
if (page->footer) {
gExtentRegion = Footer;
right_margin_space = non_scroll_right_margin_space;
initExtents();
present_line_height = line_height;
text_y = line_height;
gLineNode = page->footer->next;
computeTextExtent(page->footer->next);
page->footer->height = textHeight(page->footer->next, Endfooter);
if (page->footer->height) {
if ((!page->pageFlags & NOLINES))
page->footer->height += (int) line_height / 2;
page->bot_scroll_margin = gWindow->height -
page->footer->height - bottom_margin
- gWindow->border_width + top_margin;
}
else
page->bot_scroll_margin = gWindow->height;
}
}
\end{chunk}
\subsection{computeScrollingExtent}
\index{hypertex!computeScrollingExtent}
\index{computeScrollingExtent hypertex}
\begin{chunk}{hypertex}
void computeScrollingExtent(HyperDocPage *page) {
/* Check to see if there is a scrolling region */
if (!page->scrolling) {
return;
}
noop_count = 0;
/* If there is then compute all the proper locations */
gExtentRegion = Scrolling;
right_margin_space = non_scroll_right_margin_space + gScrollbarWidth;
initExtents();
text_y = line_height;
gLineNode = page->scrolling->next;
computeTextExtent(page->scrolling->next);
/*
* the following is an attempt to fix the bug where one cannot scroll
* down to a bitmap that is opened at the bottom of a page.
*/
/*
* TTT trial if(!gInLine)
*/
if (0) {
text_y = text_y - past_line_height;
}
else if (present_line_height > line_height)
text_y = text_y + present_line_height - line_height;
page->scrolling->height = text_y;
}
\end{chunk}
\subsection{startNewline}
The startNewline function updates the current header node, and also
allocates if needed memory for the next Line Header. It also assigns
the first TextNode on the line to the structure, because this is the
last time I will be able to do this.
\index{hypertex!startNewline}
\index{startNewline hypertex}
\begin{chunk}{hypertex}
void startNewline(int distance, TextNode * node) {
if (gLineNode != NULL) {
if (gTopOfGroupStack->center)
centerNodes(gLineNode, node);
gLineNode = node;
}
text_y += distance;
past_line_height = distance;
present_line_height = line_height;
gInLine = 0;
}
\end{chunk}
\subsection{centerNodes}
The centerNodes goes through and centers all the text between the two
given nodes.
\index{hypertex!centerNodes}
\index{centerNodes hypertex}
\begin{chunk}{hypertex}
static void centerNodes(TextNode * begin_node, TextNode * end_node) {
int begin_x, end_x, wmid_x, offset, mid_x;
TextNode *node;
end_x = text_x;
begin_x = Xvalue(begin_node);
mid_x = (int) (end_x + begin_x) / 2;
wmid_x = (int) (right_margin + indent) / 2;
if (mid_x > wmid_x)
offset = 0;
else
offset = wmid_x - mid_x;
for (node = begin_node; node != end_node; node = node->next)
if (node->x > 0)
node->x += offset;
}
\end{chunk}
\subsection{punctuationWidth}
\index{hypertex!punctuationWidth}
\index{punctuationWidth hypertex}
\begin{chunk}{hypertex}
static int punctuationWidth(TextNode * node) {
int twidth, width = strlen(node->data.text);
twidth = XTextWidth(gTopOfGroupStack->cur_font, node->data.text, width);
/* check to see if there was some space in front */
if (gInLine && (node->space & FRONTSPACE))
twidth += inter_word_space;
return twidth;
}
\end{chunk}
\subsection{inputStringWidth}
\index{hypertex!inputStringWidth}
\index{inputStringWidth hypertex}
\begin{chunk}{hypertex}
static int inputStringWidth(TextNode * node) {
InputItem *item;
int t_width;
/** search the symbol table for the proper entry **/
item = node->link->reference.string;
/** Once I have gotten this far, I should just be able to calculate
the width using the normal font **/
t_width = (item->size + 1) * gInputFont->max_bounds.width + 10;
return t_width;
}
\end{chunk}
\subsection{wordWidth}
\index{hypertex!wordWidth}
\index{wordWidth hypertex}
\begin{chunk}{hypertex}
static int wordWidth(TextNode * node) {
int twidth, len = strlen(node->data.text);
twidth = XTextWidth(gTopOfGroupStack->cur_font, node->data.text, len);
if (node->space & FRONTSPACE)
twidth += inter_word_space;
return twidth;
}
\end{chunk}
\subsection{verbatimWidth}
\index{hypertex!verbatimWidth}
\index{verbatimWidth hypertex}
\begin{chunk}{hypertex}
static int verbatimWidth(TextNode * node) {
int twidth, len = strlen(node->data.text);
twidth = XTextWidth(gTopOfGroupStack->cur_font, node->data.text, len);
if (node->space)
twidth += inter_word_space;
return twidth;
}
\end{chunk}
\subsection{widthOfDash}
\index{hypertex!widthOfDash}
\index{widthOfDash hypertex}
\begin{chunk}{hypertex}
static int widthOfDash(TextNode * node) {
int num_dashes, twidth;
num_dashes = strlen(node->data.text);
if (num_dashes > 1)
twidth = node->width = num_dashes * dash_width;
else
twidth = node->width = XTextWidth(gTopOfGroupStack->cur_font,
node->data.text, 1);
if (node->space)
twidth += inter_word_space;
return twidth;
}
\end{chunk}
\subsection{textWidth}
Return the gWindow->width in pixels of the given text node, when displayed
\index{hypertex!textWidth}
\index{textWidth hypertex}
\begin{chunk}{hypertex}
int textWidth(TextNode * node, int Ender) {
int twidth = 0, num_words;
for (num_words = 0; node != NULL; num_words++, node = node->next) {
if (Ender == Endtokens) {
if (node->type == Endtokens)
return twidth;
}
else if (node->type == Ender)
return twidth;
switch (node->type) {
case Macro:
case Pound:
if (node->space && gInLine)
twidth += inter_word_space;
break;
case Punctuation:
twidth += punctuationWidth(node);
break;
case Dash:
if (gInLine && node->space)
twidth += inter_word_space;
twidth += widthOfDash(node);
break;
case Verbatim:
case Spadsrctxt:
twidth += verbatimWidth(node);
break;
case Lsquarebrace:
case Rsquarebrace:
case Word:
twidth += wordWidth(node);
break;
case Box:
twidth += 2 * box_space;
break;
case Link:
case Downlink:
case Memolink:
case Windowlink:
case LispMemoLink:
case Lispwindowlink:
case Lisplink:
case Unixlink:
case Spadcall:
case Spadcallquit:
case Qspadcall:
case Qspadcallquit:
case LispDownLink:
case Lispcommand:
case Lispcommandquit:
case Spadlink:
case Spaddownlink:
case Spadmemolink:
case Unixcommand:
case Upbutton:
case Returnbutton:
case Description:
pushActiveGroup();
break;
case Endbutton:
case Endspadcommand:
case Enddescription:
popGroupStack();
break;
case Endlink:
popGroupStack();
break;
case Inputstring:
twidth += inputStringWidth(node);
break;
case SimpleBox:
case Radiobox:
twidth += node->width + ((node->space) ? inter_word_space : 0);
break;
case Spadcommand:
case Spadgraph:
pushSpadGroup();
break;
case VSpace:
break;
case HSpace:
twidth +=
(node->data.node != NULL ? atoi(node->data.node->data.text) : 1);
break;
case Space:
twidth += (gTopOfGroupStack->cur_font->max_bounds.width) *
(node->data.node != NULL ? atoi(node->data.node->data.text) : 1);
break;
case Tab:
twidth = (gTopOfGroupStack->cur_font->max_bounds.width) *
(node->data.node != NULL ? atoi(node->data.node->data.text) : 1);
break;
case Table:
twidth = gWindow->width - left_margin - right_margin_space;
break;
case Tableitem:
case Group:
twidth += (node->space) ? inter_word_space : 0;
pushGroupStack();
break;
case BoldFace:
if (node->space)
twidth += inter_word_space;
bfTopGroup();
break;
case Emphasize:
if (node->space)
twidth += inter_word_space;
if (gTopOfGroupStack->cur_font == gRmFont)
emTopGroup();
else
rmTopGroup();
break;
case It:
if (node->space)
twidth += inter_word_space;
emTopGroup();
break;
case Rm:
case Sl:
case Tt:
if (node->space)
twidth += inter_word_space;
rmTopGroup();
break;
case Endgroup:
popGroupStack();
break;
case Controlbitmap:
case Inputbitmap:
if (node->width == -1)
insertBitmapFile(node);
twidth += node->width;
break;
case Inputpixmap:
if (node->width == -1)
insertPixmapFile(node);
twidth += node->width;
break;
case Mbox:
case Indent:
case Endmacro:
case Free:
case Bound:
case Beep:
case Item:
case Titem:
case Beginitems:
case Noop:
case Endinputbox:
case Fi:
case Ifcond:
case Endif:
case Begintitems:
case Enditems:
case Endtitems:
case Endtableitem:
case Endtable:
case Endparameter:
case Endbox:
case Endheader:
case Endfooter:
case Endscrolling:
case Endverbatim:
case Endspadsrc:
break;
case Newline:
/* WOw, I guess I should ertunr a really big number */
twidth += gWindow->width;
break;
default:
/*
* fprintf(stderr, "Unknown nodetype %d in textWidth\n",
* node->type);
*/
break;
}
}
return twidth;
}
/*
*/
\end{chunk}
\subsection{totalWidth}
The totalWidth function traces through the nodes, until it finds a blank
space. It is used by computeWordExtent, and computePunctuation extent
to determine. How far we go before we actually see white space.
\index{hypertex!totalWidth}
\index{totalWidth hypertex}
\begin{chunk}{hypertex}
int totalWidth(TextNode * node, int Ender) {
int twidth = 0;
for (; (node != NULL); node = node->next) {
if (Ender == Endtokens) {
if (node->type >= Endtokens)
return twidth;
}
else if (node->type == Ender)
return twidth;
/*
* The first thing we check for is to see if there was space in front
* of the current node, if so we are done
*/
if (node->space)
return twidth;
/*** Else depending on the node type ***/
switch (node->type) {
case Noop:
case Endinputbox:
case Pound:
case Ifcond:
case Fi:
case Endif:
break;
case Rsquarebrace:
case Punctuation:
case Word:
case Dash:
twidth += XTextWidth(gTopOfGroupStack->cur_font, node->data.text,
strlen(node->data.text));
break;
case Box:
case Link:
case Downlink:
case Memolink:
case Windowlink:
case LispMemoLink:
case Lispwindowlink:
case Lisplink:
case Unixlink:
case Spadcall:
case Spadcallquit:
case Qspadcall:
case Qspadcallquit:
case LispDownLink:
case Lispcommand:
case Lispcommandquit:
case Spadlink:
case Spaddownlink:
case Spadmemolink:
case Unixcommand:
case Inputstring:
case SimpleBox:
case Radiobox:
case Upbutton:
case Returnbutton:
case Spadcommand:
case Spadgraph:
case VSpace:
case HSpace:
case Space:
case Table:
case Group:
case Controlbitmap:
case Inputbitmap:
case Inputpixmap:
case Free:
case Beep:
case Bound:
case Lsquarebrace:
case BoldFace:
case Emphasize:
case It:
case Rm:
case Sl:
case Tt:
case Newline:
case Verbatim:
case Spadsrctxt:
return twidth;
default:
break;
}
}
return twidth;
}
\end{chunk}
\subsection{initExtents}
The initExtents function initialize some text size variables
\index{hypertex!initExtents}
\index{initExtents hypertex}
\begin{chunk}{hypertex}
void initExtents(void) {
present_line_height = line_height;
gInLine = 0;
gInItem = 0;
gInAxiomCommand = 0;
item_indent = 0;
gInDesc = 0;
indent = left_margin;
text_x = indent;
gTopOfGroupStack->cur_font = gRmFont;
gTopOfGroupStack->cur_color = gRmColor;
right_margin = gWindow->width - right_margin_space;
clearItemStack();
}
\end{chunk}
\subsection{initTitleExtents}
The initTitleExtents function initialize some title text size variables.
\index{hypertex!initTitleExtents}
\index{initTitleExtents hypertex}
\begin{chunk}{hypertex}
void initTitleExtents(HyperDocPage * page) {
present_line_height = line_height;
gInLine = 0;
gInAxiomCommand = 0;
item_indent = 0;
gInDesc = 0;
indent = left_margin + page->title->x;
text_x = indent;
gTopOfGroupStack->cur_font = gRmFont;
gTopOfGroupStack->cur_color = gRmColor;
right_margin = gWindow->width - right_margin_space -
gWindow->border_width - 2 * twwidth;
clearItemStack();
}
\end{chunk}
\subsection{initText}
The initText function initialize some text size variables.
\index{hypertex!initText}
\index{initText hypertex}
\begin{chunk}{hypertex}
void initText(void) {
normal_textHeight = gRmFont->ascent + gRmFont->descent;
line_height = gRmFont->ascent + gRmFont->descent + inter_line_space;
word_off_height = line_height - normal_textHeight;
space_width = gRmFont->max_bounds.width;
}
\end{chunk}
\subsection{textHeight}
The textHeight function returns the height of a piece of formatted text
in pixels.
\index{hypertex!textHeight}
\index{textHeight hypertex}
\begin{chunk}{hypertex}
int textHeight(TextNode * node, int Ender) {
cur_height = 0;
return textHeight1(node, Ender);
}
\end{chunk}
\subsection{textHeight1}
The textHeight1 function is the recursive part of textHeight.
\index{hypertex!textHeight1}
\index{textHeight1 hypertex}
\begin{chunk}{hypertex}
static int textHeight1(TextNode * node, int Ender) {
for (; node != NULL; node = node->next) {
if (Ender == Endtokens) {
if (node->type > -Endtokens)
return cur_height;
}
else if (node->type == Ender)
return cur_height;
switch (node->type) {
case Center:
case Downlink:
case Link:
case Spadcommand:
case Spadgraph:
case Upbutton:
case Returnbutton:
case Windowlink:
case Memolink:
case Lispwindowlink:
case Lisplink:
case Unixlink:
case Spadcall:
case Spadcallquit:
case Qspadcall:
case Qspadcallquit:
case LispDownLink:
case LispMemoLink:
case Lispcommand:
case Lispcommandquit:
case Spadlink:
case Spaddownlink:
case Spadmemolink:
case Unixcommand:
case SimpleBox:
case Radiobox:
case Group:
case Box:
case Controlbitmap:
case Inputbitmap:
case Inputpixmap:
case Horizontalline:
case Punctuation:
case Lsquarebrace:
case Rsquarebrace:
case Word:
case Verbatim:
case Math:
case Spadsrctxt:
case Dash:
case Inputstring:
cur_height = max(node->y, cur_height);
break;
case Mbox:
case Macro:
case Pound:
case Emphasize:
case BoldFace:
case It:
case Rm:
case Sl:
case Tt:
case Endparameter:
case Description:
case Enddescription:
case Noop:
case Fi:
case Ifcond:
case Endif:
case Endinputbox:
case Tab:
case Newline:
case Space:
case VSpace:
case HSpace:
case Beginitems:
case Begintitems:
case Endtitems:
case Titem:
case Enditems:
case Endtable:
case Endtableitem:
case Item:
case Par:
case Beep:
case Free:
case Bound:
case Endgroup:
case Endcenter:
case Endbutton:
case Endmacro:
case Tableitem:
case Endlink:
case Endspadcommand:
case Indent:
case Indentrel:
case Endbox:
case Endmbox:
case Table:
case Endverbatim:
case Endmath:
case Spadsrc:
case Endspadsrc:
break;
case Beginscroll:
case Endscroll:
break;
case Endscrolling:
return cur_height;
default:
/*
* fprintf(stderr, "textHeight1: Unknown Node Type %d\n",
* node->type);
*/
break;
}
}
return cur_height;
}
\end{chunk}
\subsection{maxX}
The maxX function returns the height of a piece of formatted text in pixels.
\index{hypertex!maxX}
\index{maxX hypertex}
\begin{chunk}{hypertex}
int maxX(TextNode * node, int Ender) {
maxXvalue = 0;
for (; node != NULL; node = node->next) {
if (Ender == Endtokens) {
if (node->type >= Endtokens)
return maxXvalue;
}
else if (node->type == Ender)
return maxXvalue;
switch (node->type) {
case Lsquarebrace:
case Rsquarebrace:
case Word:
maxXvalue = max(maxXvalue, node->x + wordWidth(node));
break;
case Verbatim:
case Spadsrctxt:
maxXvalue = max(maxXvalue, node->x + verbatimWidth(node));
break;
case Punctuation:
maxXvalue = max(maxXvalue, node->x + punctuationWidth(node));
break;
case Dash:
maxXvalue = max(maxXvalue, node->x + widthOfDash(node));
break;
case HSpace:
maxXvalue = max(maxXvalue, node->x +
(node->data.node != NULL ? atoi(node->data.node->data.text) : 1));
break;
case Space:
maxXvalue =
max(maxXvalue, node->x +
(gTopOfGroupStack->cur_font->max_bounds.width) *
(node->data.node != NULL ? atoi(node->data.node->data.text) : 1));
break;
case Group:
pushGroupStack();
break;
case BoldFace:
bfTopGroup();
break;
case Emphasize:
if (gTopOfGroupStack->cur_font == gRmFont)
emTopGroup();
else
rmTopGroup();
break;
case It:
emTopGroup();
break;
case Rm:
case Sl:
case Tt:
rmTopGroup();
break;
case Endgroup:
popGroupStack();
break;
case Controlbitmap:
case Inputbitmap:
if (node->width == -1)
insertBitmapFile(node);
maxXvalue = max(maxXvalue, node->x + node->width);
break;
case Inputpixmap:
if (node->width == -1)
insertPixmapFile(node);
maxXvalue = max(maxXvalue, node->y + node->width);
break;
default:
break;
}
}
return cur_height;
}
\end{chunk}
\subsection{Xvalue}
\index{hypertex!Xvalue}
\index{Xvalue hypertex}
\begin{chunk}{hypertex}
static int Xvalue(TextNode * node) {
for (; node != NULL; node = node->next) {
switch (node->type) {
case Controlbitmap:
case Inputbitmap:
case Inputpixmap:
case Lsquarebrace:
case Rsquarebrace:
case Word:
case Verbatim:
case Spadsrctxt:
case Dash:
case Punctuation:
case VSpace:
case HSpace:
case Horizontalline:
case Box:
case Downlink:
case Link:
case Lispwindowlink:
case Lisplink:
case Unixlink:
case Spadcall:
case Spadcallquit:
case Qspadcall:
case Qspadcallquit:
case LispDownLink:
case LispMemoLink:
case Lispcommand:
case Lispcommandquit:
case Spadlink:
case Spaddownlink:
case Spadmemolink:
case Spadcommand:
case Spadgraph:
case Unixcommand:
case Space:
case SimpleBox:
case Radiobox:
return node->x;
default:
#ifdef DEBUG
fprintf(stderr, "Xvalue did not know x value of type %d\n", node->type);
#endif
return Xvalue(node->next);
}
}
return 0;
}
\end{chunk}
\subsection{trailingSpace}
The trailingSpace function computes the length of the trailing spaces
of a node.
\index{hypertex!trailingSpace}
\index{trailingSpace hypertex}
\begin{chunk}{hypertex}
int trailingSpace(TextNode * node) {
int space = 0;
for (; node->type < Endtokens; node = node->next);
if (node->type == Space)
space += inter_word_space *
(node->data.node != NULL ? atoi(node->data.node->data.text) : 1);
return space;
}
\end{chunk}
\subsection{insertBitmapFile}
The insertBitmapFile function reads a bitmap file into memory.
\index{hypertex!insertBitmapFile}
\index{insertBitmapFile hypertex}
\begin{chunk}{hypertex}
void insertBitmapFile(TextNode * node) {
char *filename = node->data.text;
int bm_width, bm_height;
XImage *im;
ImageStruct *image;
if (*filename == ' ')
filename++;
if (node->image.pm == 0) {
if (
((image = (ImageStruct *) hashFind(&gImageHashTable, filename))
== NULL) || (getenv("HTCACHE"))) {
/*
* read the bitmap if not already in memory or if the environment
* variable HTCACHE is set (NAG addition).
*/
im = HTReadBitmapFile(gXDisplay, gXScreenNumber, filename,
&bm_width, &bm_height);
/** now add the image to the gImageHashTable **/
image = (ImageStruct *) halloc(sizeof(ImageStruct), "ImageStruct");
image->image.xi = im;
image->width = image->image.xi->width;
image->height = image->image.xi->height;
image->filename =
(char *)halloc(sizeof(char) *strlen(filename)+1,"Image Filename");
/* strcpy(image->filename, filename); */
sprintf(image->filename, "%s", filename);
hashInsert(&gImageHashTable, (char *)image, image->filename);
}
node->width = image->width;
node->height = image->height;
node->image.xi = image->image.xi;
}
}
\end{chunk}
\subsection{insertPixmapFile}
The insertPixmapFile function reads a pixmap file into memory.
\index{hypertex!insertPixmapFile}
\index{insertPixmapFile hypertex}
\begin{chunk}{hypertex}
void insertPixmapFile(TextNode * node) {
char *filename = node->data.text;
int bm_width, bm_height, ret_val;
XImage *xi;
ImageStruct *image;
if (*filename == ' ')
filename++;
if (node->image.xi == 0) {
if ((image=(ImageStruct *)hashFind(&gImageHashTable, filename))==NULL) {
ret_val = read_pixmap_file(gXDisplay, gXScreenNumber, filename, &xi,
&bm_width, &bm_height);
switch (ret_val) {
case(-1):
gSwitch_to_mono = 1;
return;
case BitmapFileInvalid:
fprintf(stderr, "File %s contains invalid bitmap data\n",
filename);
return;
case BitmapOpenFailed:
fprintf(stderr, "couldn't open bitmap file %s\n", filename);
return;
case BitmapNoMemory:
fprintf(stderr, "not enough memory to store bitmap\n");
return;
}
image = (ImageStruct *) halloc(sizeof(ImageStruct), "ImageStruct");
image->width = bm_width;
image->height = bm_height;
image->filename = (char *)halloc(sizeof(char) *strlen(filename)+1,
"insert_pixmap--filename");
/* strcpy(image->filename, filename); */
sprintf(image->filename, "%s", filename);
image->image.xi = xi;
hashInsert(&gImageHashTable, (char *)image, image->filename);
}
node->width = image->width;
node->height = plh(image->height + inter_line_space);
node->image.xi = image->image.xi;
}
}
\end{chunk}
\subsection{plh}
The plh function calculates the closet value of line\_height > height.
\index{hypertex!plh}
\index{plh hypertex}
\begin{chunk}{hypertex}
int plh(int height) {
int rheight = height;
if (gExtentRegion == Scrolling) {
for (rheight = line_height; rheight < height; rheight += line_height)
;
}
return rheight;
}
\end{chunk}
\section{Handling forms}
A few routines used to help with form extents
\subsection{computeFormPage}
To solve the problem of improperly nested \verb|\em|, I will have to keep and
always initialize the top of the stack.
\index{hypertex!computeFormPage}
\index{computeFormPage hypertex}
\begin{chunk}{hypertex}
void computeFormPage(HyperDocPage *page) {
while (popGroupStack() >= 0);
/*
* The compute the text extents
*/
formHeaderExtent(page);
formFooterExtent(page);
formScrollingExtent(page);
gWindow->height = windowHeight(gWindow->page);
}
\end{chunk}
\subsection{windowWidth}
A simple function that returns the width needed to store show the number
of columns given.
\index{hypertex!windowWidth}
\index{windowWidth hypertex}
\begin{chunk}{hypertex}
int windowWidth(int cols) {
return (left_margin + cols * space_width + non_scroll_right_margin_space);
}
\end{chunk}
\subsection{windowHeight}
\index{hypertex!windowHeight}
\index{windowHeight hypertex}
\begin{chunk}{hypertex}
static int windowHeight(HyperDocPage *page) {
int temp;
temp = page->header->height + top_margin + bottom_margin;
if (page->scrolling)
temp += page->scrolling->height + page->footer->height;
return (temp);
}
\end{chunk}
\subsection{formHeaderExtent}
\index{hypertex!formHeaderExtent}
\index{formHeaderExtent hypertex}
\begin{chunk}{hypertex}
static void formHeaderExtent(HyperDocPage *page) {
/*
* Hopefully I will soon be able to actually compute the needed height
* for the header here
*/
gExtentRegion = Header;
right_margin_space = non_scroll_right_margin_space;
initExtents();
text_y = top_margin + line_height;
computeTextExtent(page->header->next);
page->header->height = (gInLine) ? text_y : text_y - past_line_height;
if (!(page->pageFlags & NOLINES))
page->header->height += (int) line_height / 2;
page->header->height += gWindow->border_width;
}
\end{chunk}
\subsection{formFooterExtent}
\index{hypertex!formFooterExtent}
\index{formFooterExtent hypertex}
\begin{chunk}{hypertex}
static void formFooterExtent(HyperDocPage *page) {
if (page->footer) {
gExtentRegion = Footer;
right_margin_space = non_scroll_right_margin_space;
initExtents();
computeTextExtent(page->footer->next);
/*
* I inserted the 2nd arg to textHeight below because it
* was missing. Perhaps there is a better value for it.
*/
page->footer->height = textHeight(page->footer->next,
page->footer->next->type);
if ((!page->pageFlags & NOLINES))
page->footer->height += (int) line_height / 2;
}
}
\end{chunk}
\subsection{formScrollingExtent}
\index{hypertex!formScrollingExtent}
\index{formScrollingExtent hypertex}
\begin{chunk}{hypertex}
static void formScrollingExtent(HyperDocPage *page) {
/*
* Check to see if there is a scrolling region
*/
if (page->scrolling) {
/*
* If there is then compute all the proper locations
*/
gExtentRegion = Scrolling;
right_margin_space = non_scroll_right_margin_space + gScrollbarWidth;
initExtents();
text_y = line_height;
computeTextExtent(page->scrolling->next);
if (!gInLine)
text_y = text_y - past_line_height;
else if (present_line_height > line_height)
text_y = text_y + present_line_height - line_height;
page->scrolling->height = text_y;
}
}
\end{chunk}
\section{Managing the HyperDoc group stack}
\subsection{popGroupStack}
This routine pops the top of the current group stack.
\index{hypertex!popGroupStack}
\index{popGroupStack hypertex}
\begin{chunk}{hypertex}
int popGroupStack(void) {
GroupItem *junk;
/*
* If the the stack has only a single item, then pop it anyway so the
* user can see the problem
*/
if (! gTopOfGroupStack->next)
return -1;
/* Else, Pop the thing */
junk = gTopOfGroupStack;
gTopOfGroupStack = gTopOfGroupStack->next;
junk->next = NULL;
free(junk);
/* Now change the font to the cur_font and the cur_color */
changeText(gTopOfGroupStack->cur_color, gTopOfGroupStack->cur_font);
return 1;
}
\end{chunk}
\subsection{pushGroupStack}
\index{hypertex!pushGroupStack}
\index{pushGroupStack hypertex}
\begin{chunk}{hypertex}
void pushGroupStack(void) {
/*
* This routine makes room by pushing a new item on the stack
*/
GroupItem *newgp;
newgp = (GroupItem *) halloc(sizeof(GroupItem), "Push Group Stack");
newgp->cur_font = gTopOfGroupStack->cur_font;
newgp->cur_color = gTopOfGroupStack->cur_color;
newgp->center = gTopOfGroupStack->center;
newgp->next = gTopOfGroupStack;
gTopOfGroupStack = newgp;
}
\end{chunk}
\subsection{initGroupStack}
\index{hypertex!initGroupStack}
\index{initGroupStack hypertex}
\begin{chunk}{hypertex}
void initGroupStack(void) {
gTopOfGroupStack =
(GroupItem *) halloc(sizeof(GroupItem), "Push Group Stack");
gTopOfGroupStack->center = 0;
gTopOfGroupStack->next = NULL;
gTopOfGroupStack->cur_color = 0;
gTopOfGroupStack->cur_font = NULL;
}
\end{chunk}
\subsection{emTopGroup}
\index{hypertex!emTopGroup}
\index{emTopGroup hypertex}
\begin{chunk}{hypertex}
void emTopGroup(void) {
if (! gTopOfGroupStack->next)
pushGroupStack();
gTopOfGroupStack->cur_color = gEmColor;
gTopOfGroupStack->cur_font = gEmFont;
changeText(gTopOfGroupStack->cur_color, gTopOfGroupStack->cur_font);
}
\end{chunk}
\subsection{rmTopGroup}
\index{hypertex!rmTopGroup}
\index{rmTopGroup hypertex}
\begin{chunk}{hypertex}
void rmTopGroup(void) {
if (! gTopOfGroupStack->next)
pushGroupStack();
gTopOfGroupStack->cur_color = gRmColor;
gTopOfGroupStack->cur_font = gRmFont;
changeText(gTopOfGroupStack->cur_color, gTopOfGroupStack->cur_font);
}
\end{chunk}
\subsection{lineTopGroup}
\index{hypertex!lineTopGroup}
\index{lineTopGroup hypertex}
\begin{chunk}{hypertex}
void lineTopGroup(void) {
if (! gTopOfGroupStack->next)
pushGroupStack();
gTopOfGroupStack->cur_color = gBorderColor;
gTopOfGroupStack->cur_font = gRmFont;
changeText(gTopOfGroupStack->cur_color, gTopOfGroupStack->cur_font);
}
\end{chunk}
\subsection{bfTopGroup}
\index{hypertex!bfTopGroup}
\index{bfTopGroup hypertex}
\begin{chunk}{hypertex}
void bfTopGroup(void) {
/*
* Just in case the person is tryin a \em without a grouping
*/
if (! gTopOfGroupStack->next)
pushGroupStack();
gTopOfGroupStack->cur_color = gBfColor;
gTopOfGroupStack->cur_font = gBfFont;
changeText(gTopOfGroupStack->cur_color, gTopOfGroupStack->cur_font);
}
\end{chunk}
\subsection{ttTopGroup}
\index{hypertex!ttTopGroup}
\index{ttTopGroup hypertex}
\begin{chunk}{hypertex}
void ttTopGroup(void) {
if (! gTopOfGroupStack->next)
pushGroupStack();
gTopOfGroupStack->cur_color = gTtColor;
gTopOfGroupStack->cur_font = gTtFont;
changeText(gTopOfGroupStack->cur_color, gTopOfGroupStack->cur_font);
}
\end{chunk}
\subsection{pushActiveGroup}
\index{hypertex!pushActiveGroup}
\index{pushActiveGroup hypertex}
\begin{chunk}{hypertex}
void pushActiveGroup(void) {
pushGroupStack();
gTopOfGroupStack->cur_font = gActiveFont;
gTopOfGroupStack->cur_color = gActiveColor;
changeText(gTopOfGroupStack->cur_color, gTopOfGroupStack->cur_font);
}
\end{chunk}
\subsection{pushSpadGroup}
\index{hypertex!pushSpadGroup}
\index{pushSpadGroup hypertex}
\begin{chunk}{hypertex}
void pushSpadGroup(void) {
pushGroupStack();
gTopOfGroupStack->cur_font = gAxiomFont;
gTopOfGroupStack->cur_color = gAxiomColor;
changeText(gTopOfGroupStack->cur_color, gTopOfGroupStack->cur_font);
}
\end{chunk}
\subsection{initTopGroup}
\index{hypertex!initTopGroup}
\index{initTopGroup hypertex}
\begin{chunk}{hypertex}
void initTopGroup(void) {
/* clear the group stack */
while (popGroupStack() >= 0)
;
/* then set the colors to be normal */
gTopOfGroupStack->cur_color = gRmColor;
gTopOfGroupStack->cur_font = gRmFont;
changeText(gTopOfGroupStack->cur_color, gTopOfGroupStack->cur_font);
}
\end{chunk}
\subsection{centerTopGroup}
\index{hypertex!centerTopGroup}
\index{centerTopGroup hypertex}
\begin{chunk}{hypertex}
void centerTopGroup(void) {
pushGroupStack();
gTopOfGroupStack->center = 1;
}
\end{chunk}
\subsection{copyGroupStack}
\index{hypertex!copyGroupStack}
\index{copyGroupStack hypertex}
\begin{chunk}{hypertex}
GroupItem *copyGroupStack(void) {
GroupItem *newgp = NULL;
GroupItem *first = NULL;
GroupItem *prev = NULL;
GroupItem *trace = gTopOfGroupStack;
while (trace) {
newgp = (GroupItem *) halloc(sizeof(GroupItem), "Copy Group Stack");
newgp->cur_font = trace->cur_font;
newgp->cur_color = trace->cur_color;
newgp->center = trace->center;
if (!first)
first = newgp;
else
prev->next = newgp;
prev = newgp;
trace = trace->next;
}
if (newgp)
newgp->next = NULL;
return first;
}
\end{chunk}
\subsection{freeGroupStack}
\index{hypertex!freeGroupStack}
\index{freeGroupStack hypertex}
\begin{chunk}{hypertex}
void freeGroupStack(GroupItem *g) {
GroupItem *trace = g;
while (trace) {
GroupItem *junk = trace;
trace = trace->next;
free(junk);
}
}
\end{chunk}
\section{Handle input, output, and Axiom communication}
\subsection{makeRecord}
\index{hypertex!makeRecord}
\index{makeRecord hypertex}
\begin{chunk}{hypertex}
void makeRecord(void) {
int i;
for (i=0;i<input_file_count;i++){
sendLispCommand("(|clearCmdCompletely|)");
sendLispCommand("(setq |$testingSystem| T)");
sendLispCommand("(setq |$printLoadMsgs| NIL)");
sendLispCommand("(setq |$BreakMode| '|resume|)");
sprintf(buf_for_record_commands,
"(|inputFile2RecordFile| '\"%s\")",input_file_list[i]);
fprintf(stderr,"%s\n",buf_for_record_commands);
sendLispCommand(buf_for_record_commands);
}
if (kill_spad){
i = connectSpad();
if (i != NotConnected && i != SpadBusy)
send_int(spadSocket, KillLispSystem);
}
}
\end{chunk}
\subsection{verifyRecord}
\index{hypertex!verifyRecord}
\index{verifyRecord hypertex}
\begin{chunk}{hypertex}
void verifyRecord(void) {
int i;
for (i=0;i<input_file_count;i++){
sendLispCommand("(|clearCmdCompletely|)");
sendLispCommand("(setq |$testingSystem| T)");
sendLispCommand("(setq |$printLoadMsgs| NIL)");
sendLispCommand("(setq |$BreakMode| '|resume|)");
sprintf(buf_for_record_commands,
"(|verifyRecordFile| '\"%s\")",input_file_list[i]);
fprintf(stderr,"%s\n",buf_for_record_commands);
sendLispCommand(buf_for_record_commands);
}
if (kill_spad) {
i = connectSpad();
if (i != NotConnected && i != SpadBusy)
send_int(spadSocket, KillLispSystem);
}
}
\end{chunk}
\subsection{ht2Input}
\index{hypertex!ht2Input}
\index{ht2Input hypertex}
\begin{chunk}{hypertex}
void ht2Input(void) {
HashTable *table;
HashEntry *entry;
int i;
bsdSignal(SIGUSR2, SIG_IGN,RestartSystemCalls);
gWindow = allocHdWindow();
initGroupStack();
table = gWindow->fPageHashTable;
makeInputFileList();
for (i = 0; i < table->size; i++)
for (entry = table->table[i]; entry != NULL; entry = entry->next)
makeTheInputFile((UnloadedPage *) entry->data);
if (kill_spad){
i = connectSpad();
if (i != NotConnected && i != SpadBusy)
send_int(spadSocket, KillLispSystem);
}
}
\end{chunk}
\subsection{makeInputFileName}
\index{hypertex!makeInputFileName}
\index{makeInputFileName hypertex}
\begin{chunk}{hypertex}
static char *makeInputFileName(char *buf, char *filename) {
char *b, *c;
strcpy(buf, filename);
for (b = buf + strlen(buf) - 1; b != buf && *b != '/'; b--);
if (b != buf)
b = b + 1;
for (c = b; *c != '.' || c[1] != 'h' || c[2] != 't'; c++);
strcpy(c, ".input");
return b;
}
\end{chunk}
\subsection{makePasteFileName}
\index{hypertex!makePasteFileName}
\index{makePasteFileName hypertex}
\begin{chunk}{hypertex}
static char *makePasteFileName(char *buf, char *filename) {
char *b, *c;
strcpy(buf, filename);
for (b = buf + strlen(buf) - 1; b != buf && *b != '/'; b--);
if (b != buf)
b = b + 1;
for (c = b; *c != '.' || c[1] != 'h' || c[2] != 't'; c++);
strcpy(c, ".pht");
return b;
}
\end{chunk}
\subsection{makeTheInputFile}
\index{hypertex!makeTheInputFile}
\index{makeTheInputFile hypertex}
\begin{chunk}{hypertex}
static void makeTheInputFile(UnloadedPage *page) {
char buf[1024], *b;
if (!page->fpos.name)
return;
b = makeInputFileName(buf, page->fpos.name);
if (inListAndNewer(b, page->fpos.name)) {
printf("parsing: %s\n", page->name);
if (setjmp(jmpbuf)) {
printf("Syntax error!\n");
}
else {
loadPage((HyperDocPage *)page);
makeInputFileFromPage(gWindow->page);
}
}
}
\end{chunk}
\subsection{makeInputFileFromPage}
\index{hypertex!makeInputFileFromPage}
\index{makeInputFileFromPage hypertex}
\begin{chunk}{hypertex}
static void makeInputFileFromPage(HyperDocPage *page) {
TextNode *node;
int starting_file = 1,/* i,*/ /*len,*/ ret_val;
char *buf, buf2[1024], buf3[1024];
char *b, *c, *com;
FILE *file = NULL;
FILE *pfile = NULL;
static HyperDocPage *op = NULL;
if (op == page)
return;
op = page;
if (page == NULL)
return;
b = makeInputFileName(buf2, page->filename);
c = makePasteFileName(buf3, page->filename);
if (inListAndNewer(b, page->filename)) {
/* open and prepare the input file */
file = fopen(b, "a");
if (file == NULL) {
fprintf(stderr, "couldn't open output file %s\n", b);
exit(-1);
}
fprintf(file, "\n-- Input for page %s\n", page->name);
fprintf(file, ")clear all\n\n");
for (node = page->scrolling; node != NULL; node = node->next)
if (node->type == Spadcommand || node->type == Spadgraph
|| node->type == Spadsrc) {
if (starting_file) {
example_number = 1;
if (make_patch_files) {
sendLispCommand("(|clearCmdAll|)");
sendLispCommand("(|resetWorkspaceVariables|)");
sendLispCommand("(setq $linelength 55)");
sendLispCommand("(|setOutputCharacters| '(default))");
sendLispCommand("(setq |$printLoadMsgs| NIL)");
sendLispCommand("(setq |$UserLevel| '|development|)");
}
if (make_patch_files) {
pfile = fopen(c, "a");
if (pfile == NULL) {
fprintf(stderr, "couldn't open output file %s\n", c);
exit(-1);
}
}
starting_file = 0;
}
else
example_number++;
buf = printToString(node->next);
com = allocString(buf);
fprintf(file, "%s\n", buf);
fflush(file);
fprintf(stderr, "writing:\t%s\n", buf);
include_bf = 1;
buf = printToString(node->next);
include_bf = 0;
if (make_patch_files) {
if (node->type == Spadcommand || node->type == Spadsrc)
printPaste(pfile, com, buf, page->name, node->type);
else
printGraphPaste(pfile, com, buf, page->name, node->type);
}
}
if (!starting_file && make_patch_files) {
ret_val = fclose(pfile);
if (ret_val == -1) {
fprintf(stderr, "couldn't close file %s\n", b);
exit(-1);
}
}
ret_val = fclose(file);
if (ret_val == -1) {
fprintf(stderr, "couldn't close file %s\n", b);
exit(-1);
}
}
}
\end{chunk}
\subsection{strCopy}
\index{hypertex!strCopy}
\index{strCopy hypertex}
\begin{chunk}{hypertex}
char *strCopy(char *s) {
char *b = halloc(strlen(s) + 1,"String");
strcpy(b, s);
return b;
}
\end{chunk}
\subsection{inListAndNewer}
\index{hypertex!inListAndNewer}
\index{inListAndNewer hypertex}
\begin{chunk}{hypertex}
static int inListAndNewer(char *inputFile, char *htFile) {
int ret_val, found = 0, i;
struct stat htBuf, inputBuf;
for (i = 0; i < num_active_files; i++) {
if (strcmp(active_file_list[i], inputFile) == 0) {
found = 1;
break;
}
}
if (found)
return 1;
found = 0;
for (i = 0; i < num_inactive_files; i++)
if (strcmp(inactive_file_list[i], inputFile) == 0) {
found = 1;
break;
}
if (found)
return 0;
found = 0;
for (i = 0; i < input_file_count; i++)
if (strcmp(input_file_list[i], inputFile) == 0) {
found = 1;
break;
}
if (!found) {
inactive_file_list[num_inactive_files++] = strCopy(inputFile);
return 0;
}
ret_val = stat(inputFile, &inputBuf);
if (ret_val == -1) {
active_file_list[num_active_files++] = input_file_list[i];
printf("making %s\n", inputFile);
return 1;
}
ret_val = stat(htFile, &htBuf);
if (ret_val == -1) {
inactive_file_list[num_inactive_files++] = strCopy(inputFile);
return 0;
}
ret_val = htBuf.st_mtime > inputBuf.st_mtime;
ret_val = 1;
if (ret_val) {
active_file_list[num_active_files++] = input_file_list[i];
printf("making %s\n", inputFile);
unlink(inputFile);
}
else
inactive_file_list[num_inactive_files++] = input_file_list[i];
return ret_val;
}
\end{chunk}
\subsection{makeInputFileList}
\index{hypertex!makeInputFileList}
\index{makeInputFileList hypertex}
\begin{chunk}{hypertex}
static void makeInputFileList(void) {
int i;
char buf[256], *name;
for (i = 0; i < input_file_count; i++) {
name = makeInputFileName(buf, input_file_list[i]);
input_file_list[i] = (char *)halloc(strlen(name) + 1,"Input Filename");
strcpy(input_file_list[i], name);
}
}
\end{chunk}
\subsection{printPasteLine}
\index{hypertex!printPasteLine}
\index{printPasteLine hypertex}
\begin{chunk}{hypertex}
void printPasteLine(FILE *pfile,char *str) {
char *free = "\\free", *bound = "\\bound", *f = free, *b = bound;
int justSaw = 0;
for (; *str; str++) {
if (*f == '\0')
justSaw = 2;
if (*b == '\0')
justSaw = 2;
if (*b == *str)
b++;
else
b = bound;
if (*f == *str)
f++;
else
f = free;
if (*str == '%' || *str == '{' || *str == '}' || *str == '#') {
if (*str == '{' && justSaw)
justSaw--;
else if (*str == '}' && justSaw)
justSaw--;
else
putc('\\', pfile);
}
putc(*str, pfile);
}
}
\end{chunk}
\subsection{getSpadOutput}
\index{hypertex!getSpadOutput}
\index{getSpadOutput hypertex}
\begin{chunk}{hypertex}
void getSpadOutput(FILE *pfile,char *command,int com_type) {
int n, i;
char buf[1024];
sendCommand(command, com_type);
n = get_int(spadSocket);
for (i = 0; i < n; i++) {
get_string_buf(spadSocket, buf, 1024);
fprintf(pfile, "%s\n", buf);
}
unescapeString(command);
}
\end{chunk}
\subsection{getGraphOutput}
THEMOS says: There is a problem here in that we issue the (|close|) and
then go on. If this is the last command ,we will soon send a SIGTERM and
the whole thing will collapse maybe BEFORE the writing out has finished.
Fix: Call a Lisp function that checks
(with \verb|\axiomOp{key}| ps and grep) the
health of the viewport. We do this after the (|close|).
\index{hypertex!getGraphOutput}
\index{getGraphOutput hypertex}
\begin{chunk}{hypertex}
void getGraphOutput(char *command,char *pagename,int com_type) {
int n, i;
char buf[1024];
sendCommand(command, com_type);
n = get_int(spadSocket);
for (i = 0; i < n; i++) {
get_string_buf(spadSocket, buf, 1024);
}
unescapeString(command);
sprintf(buf,
"(|processInteractive| '(|write| |%s| \"%s%d\" \"image\") NIL)", "%",
pagename, example_number);
sendLispCommand(buf);
sendLispCommand("(|setViewportProcess|)");
sendLispCommand("(|processInteractive| '(|close| (|%%| -3)) NIL)");
sendLispCommand("(|waitForViewport|)");
get_int(spadSocket);
}
\end{chunk}
\subsection{sendCommand}
\index{hypertex!sendCommand}
\index{sendCommand hypertex}
\begin{chunk}{hypertex}
static void sendCommand(char *command,int com_type) {
char buf[1024];
if (com_type != Spadsrc) {
escapeString(command);
sprintf(buf, "(|parseAndEvalToHypertex| '\"%s\")", command);
sendLispCommand(buf);
}
else {
FILE *f;
char name[512], str[512]/*, *c*/;
sprintf(name, "/tmp/hyper%s.input", getenv("SPADNUM"));
f = fopen(name, "w");
if (f == NULL) {
fprintf(stderr, "Can't open temporary input file %s\n", name);
return;
}
fprintf(f, "%s", command);
fclose(f);
sprintf(str, "(|parseAndEvalToHypertex| '\")read %s\")", name);
sendLispCommand(str);
}
}
\end{chunk}
\subsection{printPaste}
\index{hypertex!printPaste}
\index{printPaste hypertex}
\begin{chunk}{hypertex}
static void printPaste(FILE *pfile,char *realcom,char *command,
char *pagename,int com_type) {
fprintf(pfile, "\\begin{patch}{%sPatch%d}\n", pagename, example_number);
fprintf(pfile, "\\begin{paste}{%sFull%d}{%sEmpty%d}\n",
pagename, example_number, pagename, example_number);
fprintf(pfile, "\\pastebutton{%sFull%d}{\\hidepaste}\n",
pagename, example_number);
fprintf(pfile, "\\tab{5}\\spadcommand{");
printPasteLine(pfile, command);
fprintf(pfile, "}\n");
fprintf(pfile, "\\indentrel{3}\\begin{verbatim}\n");
getSpadOutput(pfile, realcom, com_type);
fprintf(pfile, "\\end{verbatim}\n");
fprintf(pfile, "\\indentrel{-3}\\end{paste}\\end{patch}\n\n");
fprintf(pfile, "\\begin{patch}{%sEmpty%d}\n", pagename, example_number);
fprintf(pfile, "\\begin{paste}{%sEmpty%d}{%sPatch%d}\n",
pagename, example_number, pagename, example_number);
fprintf(pfile, "\\pastebutton{%sEmpty%d}{\\showpaste}\n",
pagename, example_number);
fprintf(pfile, "\\tab{5}\\spadcommand{");
printPasteLine(pfile, command);
fprintf(pfile, "}\n");
fprintf(pfile, "\\end{paste}\\end{patch}\n\n");
fflush(pfile);
}
\end{chunk}
\subsection{printGraphPaste}
\index{hypertex!printGraphPaste}
\index{printGraphPaste hypertex}
\begin{chunk}{hypertex}
static void printGraphPaste(FILE *pfile,char *realcom,
char *command,char *pagename,int com_type) {
fprintf(pfile, "\\begin{patch}{%sPatch%d}\n", pagename, example_number);
fprintf(pfile, "\\begin{paste}{%sFull%d}{%sEmpty%d}\n",
pagename, example_number, pagename, example_number);
fprintf(pfile, "\\pastebutton{%sFull%d}{\\hidepaste}\n",
pagename, example_number);
fprintf(pfile, "\\tab{5}\\spadgraph{");
printPasteLine(pfile, command);
fprintf(pfile, "}\n");
fprintf(pfile, "\\center{\\unixcommand{\\inputimage{\\env{AXIOM}");
fprintf(pfile, "/doc/viewports/%s%d.view/image}}",
pagename,example_number);
fprintf(pfile, "{viewalone\\space{1} \\env{AXIOM}");
fprintf(pfile,"/doc/viewports/%s%d}}\n", pagename, example_number);
getGraphOutput(realcom, pagename, com_type);
fprintf(pfile, "\\end{paste}\\end{patch}\n\n");
fprintf(pfile, "\\begin{patch}{%sEmpty%d}\n", pagename, example_number);
fprintf(pfile, "\\begin{paste}{%sEmpty%d}{%sPatch%d}\n",
pagename, example_number, pagename, example_number);
fprintf(pfile, "\\pastebutton{%sEmpty%d}{\\showpaste}\n",
pagename, example_number);
fprintf(pfile, "\\tab{5}\\spadgraph{");
printPasteLine(pfile, command);
fprintf(pfile, "}\n");
fprintf(pfile, "\\end{paste}\\end{patch}\n\n");
fflush(pfile);
}
\end{chunk}
\section{X Window window initialization code}
Initialize the X Window System.
\subsection{initializeWindowSystem}
\index{hypertex!initializeWindowSystem}
\index{initializeWindowSystem hypertex}
\begin{chunk}{hypertex}
void initializeWindowSystem(void) {
char *display_name = NULL;
XColor fg, bg;
Colormap cmap;
Pixmap mousebits, mousemask;
/* fprintf(stderr,"initx:initializeWindowSystem:entered\n");*/
/* Try to open the display */
/* fprintf(stderr,"initx:initializeWindowSystem:XOpenDisplay\n");*/
if ((gXDisplay = XOpenDisplay(display_name)) == NULL) {
fprintf(stderr, "(HyperDoc) Cannot connect to the X11 server!\n");
exit(-1);
}
/* Get the screen */
/* fprintf(stderr,"initx:initializeWindowSystem:DefaultScreen\n");*/
gXScreenNumber = scrn = DefaultScreen(gXDisplay);
/* fprintf(stderr,"initx:initializeWindowSystem:XGContextFromGC\n");*/
server_font =XGContextFromGC(DefaultGC(gXDisplay, gXScreenNumber));
/* Get the cursors we need. */
/* fprintf(stderr,"initx:initializeWindowSystem:DefaultColormap\n");*/
cmap = DefaultColormap(gXDisplay, gXScreenNumber);
/* fprintf(stderr,"initx:initializeWindowSystem:WhitePixel\n");*/
fg.pixel = WhitePixel(gXDisplay,gXScreenNumber);
/* fprintf(stderr,"initx:initializeWindowSystem:XQueryColor\n");*/
XQueryColor(gXDisplay, cmap, &fg );
/* fprintf(stderr,"initx:initializeWindowSystem:BlackPixel\n");*/
bg.pixel = BlackPixel(gXDisplay,gXScreenNumber);
/* fprintf(stderr,"initx:initializeWindowSystem:XQueryColor2\n");*/
XQueryColor(gXDisplay, cmap, &bg );
/* fprintf(stderr,"initx:initializeWindowSystem:XCreateBitmapFromData 1\n");*/
mousebits = XCreateBitmapFromData(gXDisplay,
RootWindow(gXDisplay, gXScreenNumber),
mouseBitmap_bits, mouseBitmap_width,mouseBitmap_height);
/* fprintf(stderr,"initx:initializeWindowSystem:XCreateBitmapFromData 2\n");*/
mousemask = XCreateBitmapFromData(gXDisplay,
RootWindow(gXDisplay, gXScreenNumber),
mouseMask_bits, mouseMask_width,mouseMask_height);
/* fprintf(stderr,"initx:initializeWindowSystem:XCreateBitmapFromData 2\n");*/
gActiveCursor = XCreatePixmapCursor(gXDisplay,
mousebits, mousemask, &fg, &bg,
mouseBitmap_x_hot,mouseBitmap_y_hot);
/* fprintf(stderr,"initx:initializeWindowSystem:XCreateFontCursor\n");*/
gNormalCursor = XCreateFontCursor(gXDisplay, XC_left_ptr);
/* fprintf(stderr,"initx:initializeWindowSystem:XCreateFontCursor 2\n");*/
gBusyCursor = XCreateFontCursor(gXDisplay, XC_watch);
/* Now initialize all the colors and fonts */
/* fprintf(stderr,"initx:initializeWindowSystem:ingItColorsAndFonts\n");*/
ingItColorsAndFonts();
/* fprintf(stderr,"initx:initializeWindowSystem:initText\n");*/
initText();
/* fprintf(stderr,"initx:initializeWindowSystem:exited\n");*/
}
\end{chunk}
\subsection{initTopWindow}
This routine is responsible for initializing a HyperDoc Window. At this
point, all the fonts have been loaded, and X has been initialized. All I
need worry about is starting up the window, and creating some of its
children.
The initTopWindow function tries to start up a window with the page
name. If the page name is NULL, it doesn't try to find it in the Hash
Table, but rather just allocates a page of no name
\index{hypertex!initTopWindow}
\index{initTopWindow hypertex}
\begin{chunk}{hypertex}
int initTopWindow(char *name) {
HyperDocPage *page;
XSetWindowAttributes wa; /* The X attributes structure */
HDWindow *old_win = gWindow;
gWindow = allocHdWindow();
if (name == NULL) {
/** Then allocate an empty page, and assign it to gWindow->page */
page = allocPage((char *) NULL);
}
else {
/* Try to find the page in the page hash table */
page = (HyperDocPage *) hashFind(gWindow->fPageHashTable, name);
if (page == NULL) {
fprintf(stderr,
"(HyperDoc) Couldn\'t find page %s in page hash table \n",
name);
if (gParentWindow == NULL)
/* Gaak, This is a start up error */
exit(-1);
else {
gWindow = old_win;
return -1;
}
}
}
/* First allocate memory for the new window structure */
gWindow->page = page;
if (old_win == NULL)
openWindow(0);
else
openWindow(old_win->fMainWindow);
getGCs(gWindow);
XMapWindow(gXDisplay, gWindow->fMainWindow);
hashInsert(&gSessionHashTable, (char *)gWindow,
(char *) &gWindow->fMainWindow);
changeText(gRmColor, gRmFont);
wa.background_pixel = gBackgroundColor;
XChangeWindowAttributes(gXDisplay, gWindow->fMainWindow, CWBackPixel, &wa);
XChangeWindowAttributes(gXDisplay,gWindow->fScrollWindow,CWBackPixel,&wa);
return 1;
}
\end{chunk}
\subsection{openFormWindow}
Create and initialize a form HyperDoc window.
\index{hypertex!openFormWindow}
\index{openFormWindow hypertex}
\begin{chunk}{hypertex}
static void openFormWindow(void) {
int x, y, width, height;
unsigned int fwidth = 0, fheight = 0;
unsigned int xadder = 0, yadder = 0;
/*char *window_name = "HyperDoc";*/
/*char *icon_name = "HT";*/
XrmValue value;
char *str_type[50];
XSizeHints size_hints;
int userSpecified = 0;
char userdefaults[50], progdefaults[50];
strcpy(progdefaults, "=950x450+0+0");
if (XrmGetResource(rDB, "Axiom.hyperdoc.FormGeometry",
"Axiom.hyperdoc.FormGeometry", str_type, &value) == True)
{
strncpy(userdefaults, value.addr, (int) value.size);
userSpecified = 1;
}
else
strcpy(userdefaults, progdefaults);
XGeometry(gXDisplay, gXScreenNumber, userdefaults, progdefaults,
0, fwidth, fheight, xadder, yadder,
&x, &y, &width, &height);
gWindow->border_width = getBorderProperties();
gWindow->width = 1;
gWindow->height = 1;
gWindow->fMainWindow =
XCreateSimpleWindow(gXDisplay, RootWindow(gXDisplay, gXScreenNumber),
x, y, width, height, gWindow->border_width,
gBorderColor, WhitePixel(gXDisplay, gXScreenNumber));
gWindow->fScrollWindow =
XCreateSimpleWindow(gXDisplay, gWindow->fMainWindow, 1, 1, 1, 1, 0,
BlackPixel(gXDisplay, gXScreenNumber),
WhitePixel(gXDisplay, gXScreenNumber));
makeScrollBarWindows();
makeTitleBarWindows();
setNameAndIcon();
XSelectInput(gXDisplay, gWindow->fScrollWindow, PointerMotionMask);
XSelectInput(gXDisplay, gWindow->fMainWindow,
StructureNotifyMask | PointerMotionMask);
XDefineCursor(gXDisplay, gWindow->fMainWindow, gNormalCursor);
/* now give the window manager some hints */
size_hints.flags = 0;
size_hints.min_width = width;
size_hints.min_height = height;
size_hints.flags |= PMinSize;
size_hints.width = width;
size_hints.height = height;
size_hints.flags |= (userSpecified ? USSize : PSize);
size_hints.x = x;
size_hints.y = y;
size_hints.flags |= (userSpecified ? USPosition : PPosition);
XSetNormalHints(gXDisplay, gWindow->fMainWindow, &size_hints);
XFlush(gXDisplay);
}
\end{chunk}
\subsection{initFormWindow}
\index{hypertex!initFormWindow}
\index{initFormWindow hypertex}
\begin{chunk}{hypertex}
int initFormWindow(char *name, int cols) {
XSetWindowAttributes wa; /* The X attributes structure */
/* First allocate memory for the new window structure */
gWindow = allocHdWindow();
openFormWindow();
gWindow->width = windowWidth(cols);
if (name == NULL) {
/** Then allocate an empty page, and assign it to gWindow->page */
gWindow->page = allocPage((char *) NULL);
}
else {
/* Try to find the page in the page hash table */
gWindow->page=(HyperDocPage *)hashFind(gWindow->fPageHashTable, name);
if (gWindow->page == NULL) {
fprintf(stderr, "Couldn't find page %s\n", name);
return (-1);
}
}
getGCs(gWindow);
hashInsert(&gSessionHashTable, (char *)gWindow,
(char *) &gWindow->fMainWindow);
wa.background_pixel = gBackgroundColor;
XChangeWindowAttributes(gXDisplay, gWindow->fMainWindow, CWBackPixel, &wa);
XChangeWindowAttributes(gXDisplay,gWindow->fScrollWindow,CWBackPixel,&wa);
return 1;
}
\end{chunk}
\subsection{setNameAndIcon}
\index{hypertex!setNameAndIcon}
\index{setNameAndIcon hypertex}
\begin{chunk}{hypertex}
static void setNameAndIcon(void) {
char *icon_name = "HyperDoc";
char *s;
Pixmap icon_pixmap;
XWMHints wmhints;
XClassHint ch;
ch.res_name = "HyperDoc";
ch.res_class = gArgv[0];
for (s = gArgv[0] + strlen(gArgv[0]) - 1; s != gArgv[0]; s--) {
if (*s == '/') {
ch.res_class = s + 1;
break;
}
}
XSetClassHint(gXDisplay, gWindow->fMainWindow, &ch);
XStoreName(gXDisplay, gWindow->fMainWindow, "HyperDoc");
/* define and assign the pixmap for the icon */
icon_pixmap =
XCreateBitmapFromData(gXDisplay, gWindow->fMainWindow, ht_icon_bits,
ht_icon_width, ht_icon_height);
wmhints.icon_pixmap = icon_pixmap;
wmhints.flags = IconPixmapHint;
XSetWMHints(gXDisplay, gWindow->fMainWindow, &wmhints);
/* name the icon */
XSetIconName(gXDisplay, gWindow->fMainWindow, icon_name);
}
\end{chunk}
\subsection{getBorderProperties}
\index{hypertex!getBorderProperties}
\index{getBorderProperties hypertex}
\begin{chunk}{hypertex}
static int getBorderProperties(void) {
char *bwidth;
int bw;
Colormap cmap;
bwidth = "2";
if (bwidth == NULL)
bw = 1;
else {
bw = atoi(bwidth);
if (bw < 1) {
fprintf(stderr,
"%s: The line width value must be greater than zero\n",
"Axiom.hyperdoc");
bw = 1;
}
}
/* Now try to find the user preferred border color */
if (DisplayPlanes(gXDisplay, gXScreenNumber) == 1)
gBorderColor = BlackPixel(gXDisplay, gXScreenNumber);
else {
cmap = DefaultColormap(gXDisplay, gXScreenNumber);
gBorderColor = getColor("BorderColor", "Foreground",
BlackPixel(gXDisplay, gXScreenNumber), &cmap);
}
return bw;
}
\end{chunk}
\subsection{openWindow}
Create and initialize the HyperDoc window.
\index{hypertex!openWindow}
\index{openWindow hypertex}
\begin{chunk}{hypertex}
static void openWindow(Window w) {
int x = 0, y = 0;
/*int border_width = 2;*/
unsigned int width = 1;
unsigned int height = 1;
unsigned int fwidth = 0, fheight = 0;
unsigned int xadder = 0, yadder = 0;
char *str_type[50];
XrmValue value;
char userdefaults[50], progdefaults[50];
strcpy(progdefaults, "=700x450+0+0");
if (XrmGetResource(rDB, "Axiom.hyperdoc.Geometry",
"Axiom.hyperdoc.Geometry", str_type, &value) == True)
{
strncpy(userdefaults, value.addr, (int) value.size);
}
else
strcpy(userdefaults, progdefaults);
XGeometry(gXDisplay, gXScreenNumber, userdefaults, progdefaults,
0, fwidth, fheight, xadder, yadder,
&x, &y, ( int *)&width,( int *) &height);
gWindow->border_width = getBorderProperties();
gWindow->fMainWindow =
XCreateSimpleWindow(gXDisplay, RootWindow(gXDisplay, gXScreenNumber),
x, y, width, height, gWindow->border_width,
gBorderColor,
WhitePixel(gXDisplay, gXScreenNumber));
gWindow->fScrollWindow =
XCreateSimpleWindow(gXDisplay, gWindow->fMainWindow, 1, 1, 1, 1, 0,
gBorderColor, WhitePixel(gXDisplay, gXScreenNumber));
makeScrollBarWindows();
makeTitleBarWindows();
/* Now set all the little properties for the top level window */
setNameAndIcon();
setSizeHints(w);
XSelectInput(gXDisplay, gWindow->fScrollWindow, PointerMotionMask);
XSelectInput(gXDisplay, gWindow->fMainWindow,
StructureNotifyMask | PointerMotionMask);
XDefineCursor(gXDisplay, gWindow->fMainWindow, gNormalCursor);
}
\end{chunk}
\subsection{setSizeHints}
This routine gets and sets the size for a new window. If the w
paramter is null, it means that this is the initial window. Thus the
user preferences are checked. If this is not the first window, then
the window w is used as a guidline, and the new window is placed on
top of it.
\index{hypertex!setSizeHints}
\index{setSizeHints hypertex}
\begin{chunk}{hypertex}
static void setSizeHints(Window w) {
int x, y;
unsigned int width, height;
char userdefaults[50];
char progdefaults[50];
char *str_type[50];
unsigned int fwidth = 0, fheight = 0;
unsigned int xadder = 0, yadder = 0;
int geo = 0; /* return flag from XGetGeometry */
unsigned int depth, bw=0;
Window root;
XSizeHints size_hints;
XPoint xp;
XrmValue value;
size_hints.flags = 0;
strcpy(progdefaults, "=600x450+0+0");
if (w) {
/*
* The window should be queried for it's size and position. Then the
* new window should be given almost the same locations
*/
if (XGetGeometry(gXDisplay, w, &root, &x, &y, &width,
&height, &bw, &depth))
{
xp = getWindowPositionXY(gXDisplay, w);
x = xp.x + 40;
y = xp.y + 40;
if (x < 0)
x = 0;
if (y < 0)
y = 0;
size_hints.flags |= (USSize | USPosition);
}
else {
fprintf(stderr,
"(HyperDoc) Error Querying window configuration: %ld.\n", w);
x = y = 0;
width = 600;
height = 450;
size_hints.flags |= (PSize | PPosition);
}
}
else {
/* this is the first window, so lets try to find a nice spot for it */
if (XrmGetResource(rDB, "Axiom.hyperdoc.Geometry",
"Axiom.hyperdoc.Geometry",
str_type, &value) == True)
{
strncpy(userdefaults, value.addr, (int) value.size);
geo = XParseGeometry(userdefaults, &x, &y, &width, &height);
}
else
strcpy(userdefaults, progdefaults);
size_hints.flags |=(geo & (WidthValue | HeightValue)) ? USSize : PSize;
size_hints.flags |= (geo & (XValue | YValue)) ? USPosition : PPosition;
geo = XGeometry(gXDisplay, gXScreenNumber, userdefaults, progdefaults,
bw, fwidth, fheight, xadder, yadder,
&x, &y, (int *)&width, (int *)&height);
}
size_hints.x = x;
size_hints.y = y;
size_hints.width = width;
size_hints.height = height;
getTitleBarMinimumSize(&(size_hints.min_width), &(size_hints.min_height));
size_hints.flags |= PMinSize;
XSetNormalHints(gXDisplay, gWindow->fMainWindow, &size_hints);
/* just in case a hint isn't enough ... */
XFlush(gXDisplay);
}
\end{chunk}
\subsection{getGCs}
Create the graphics contexts to be used for all drawing operations.
\index{hypertex!getGCs}
\index{getGCs hypertex}
\begin{chunk}{hypertex}
static void getGCs(HDWindow *window) {
/*unsigned long valuemask = 0;*/
XGCValues values;
values.background = gBackgroundColor;
window->fStandardGC =
XCreateGC(gXDisplay, window->fMainWindow, GCBackground, &values);
XSetLineAttributes(gXDisplay, window->fStandardGC, window->border_width,
LineSolid, CapButt, JoinMiter);
/* create the stipple for the gc */
stipple = XCreateBitmapFromData(gXDisplay,
RootWindow(gXDisplay, gXScreenNumber),
stipple_bits, stipple_width, stipple_height);
values.background = gInputBackgroundColor;
values.foreground = gInputForegroundColor;
values.font = gInputFont->fid;
if (values.font == server_font )
window->fInputGC = XCreateGC(gXDisplay, window->fMainWindow,
GCBackground | GCForeground, &values);
else {
window->fInputGC = XCreateGC(gXDisplay, window->fMainWindow,
GCBackground | GCForeground | GCFont, &values);
}
window->fCursorGC = XCreateGC(gXDisplay, window->fMainWindow, 0, NULL);
if (values.font != server_font)
XSetFont(gXDisplay, window->fCursorGC, gInputFont->fid);
XSetBackground(gXDisplay, window->fCursorGC, gInputForegroundColor);
XSetForeground(gXDisplay, window->fCursorGC, gInputBackgroundColor);
window->fControlGC = XCreateGC(gXDisplay, window->fMainWindow, 0, NULL);
XSetBackground(gXDisplay, window->fControlGC, gControlBackgroundColor);
XSetForeground(gXDisplay, window->fControlGC, gControlForegroundColor);
}
\end{chunk}
\subsection{loadFont}
Load a font and store the information in the fontInfo parameter.
\index{hypertex!loadFont}
\index{loadFont hypertex}
\begin{chunk}{hypertex}
static void loadFont(XFontStruct **fontInfo, char *fontname) {
if ((*fontInfo = XLoadQueryFont(gXDisplay, fontname)) == NULL) {
fprintf(stderr, "(HyperDoc) Cannot load font %s ; using default.\n",
fontname);
if ((*fontInfo = XQueryFont(gXDisplay,
XGContextFromGC(DefaultGC(gXDisplay, gXScreenNumber)))) == NULL)
{
fprintf(stderr, "(HyperDoc) Cannot get default font ; exiting.\n");
exit(-1);
}
}
}
\end{chunk}
\subsection{ingItColorsAndFonts}
This routine initializes all the colors and fonts that the user wishes to
use. It checks for all the following properties in \verb|$HOME/.Xdefaults.|
\begin{itemize}
\item Axiom.hyperdoc.ActiveColor
\item Axiom.hyperdoc.Background
\item Axiom.hyperdoc.EmphasizeColor
\item Axiom.hyperdoc.EmphasizeFont
\item Axiom.hyperdoc.Foreground
\item Axiom.hyperdoc.InputBackground
\item Axiom.hyperdoc.InputForeground
\item Axiom.hyperdoc.SpadColor
\item Axiom.hyperdoc.SpadFont
\end{itemize}
\index{hypertex!ingItColorsAndFonts}
\index{ingItColorsAndFonts hypertex}
\begin{chunk}{hypertex}
static void ingItColorsAndFonts(void) {
char property[256];
char *prop = &property[0];
char *str_type[50];
XrmValue value;
Colormap cmap;
int ts;
/** get the color map for the display **/
/* fprintf(stderr,"initx:ingItColorsAndFonts:entered\n");*/
/* fprintf(stderr,"initx:ingItColorsAndFonts:DefaultColorMap\n");*/
cmap = DefaultColormap(gXDisplay, gXScreenNumber);
/* fprintf(stderr,"initx:ingItColorsAndFonts:initGroupStack\n");*/
initGroupStack();
/** then start getting the fonts **/
/* fprintf(stderr,"initx:ingItColorsAndFonts:mergeDatabases\n");*/
mergeDatabases();
/* fprintf(stderr,"initx:ingItColorsAndFonts:XrmGetResource\n");*/
if (XrmGetResource(rDB, "Axiom.hyperdoc.RmFont",
"Axiom.hyperdoc.Font", str_type, &value) == True)
(void) strncpy(prop, value.addr, (int) value.size);
else
(void) strcpy(prop, RmFontDefault);
/* fprintf(stderr,"initx:ingItColorsAndFonts:loadFont 1\n");*/
loadFont(&gRmFont, prop);
/* fprintf(stderr,"initx:ingItColorsAndFonts:loadFont 2\n");*/
loadFont(&gInputFont, prop);
/* fprintf(stderr,"initx:ingItColorsAndFonts:XrmGetResource 2\n");*/
if (XrmGetResource(rDB, "Axiom.hyperdoc.TtFont",
"Axiom.hyperdoc.Font", str_type, &value) == True)
(void) strncpy(prop, value.addr, (int) value.size);
else
(void) strcpy(prop, TtFontDefault);
/* fprintf(stderr,"initx:ingItColorsAndFonts:loadFont 3\n");*/
loadFont(&gTtFont, prop);
/* fprintf(stderr,"initx:ingItColorsAndFonts:isIt850\n");*/
gTtFontIs850=isIt850(gTtFont);
/* fprintf(stderr,"initx:ingItColorsAndFonts:XrmGetResource 5\n");*/
if (XrmGetResource(rDB, "Axiom.hyperdoc.ActiveFont",
"Axiom.hyperdoc.Font", str_type, &value) == True)
(void) strncpy(prop, value.addr, (int) value.size);
else
(void) strcpy(prop, ActiveFontDefault);
/* fprintf(stderr,"initx:ingItColorsAndFonts:loadFont 4\n");*/
loadFont(&gActiveFont, prop);
/* maintain backwards compatibility */
/* fprintf(stderr,"initx:ingItColorsAndFonts:XrmGetResource 6\n");*/
if (XrmGetResource(rDB, "Axiom.hyperdoc.AxiomFont",
"Axiom.hyperdoc.Font", str_type, &value) == True)
(void) strncpy(prop, value.addr, (int) value.size);
else {
if (XrmGetResource(rDB, "Axiom.hyperdoc.SpadFont",
"Axiom.hyperdoc.Font", str_type, &value) == True)
{
(void) strncpy(prop, value.addr, (int) value.size);
}
else {
(void) strcpy(prop, AxiomFontDefault);
}
}
/* fprintf(stderr,"initx:ingItColorsAndFonts:loadFont 5\n");*/
loadFont(&gAxiomFont, prop);
/* fprintf(stderr,"initx:ingItColorsAndFonts:XrmGetResource 7\n");*/
if (XrmGetResource(rDB, "Axiom.hyperdoc.EmphasizeFont",
"Axiom.hyperdoc.Font", str_type, &value) == True)
{
(void) strncpy(prop, value.addr, (int) value.size);
}
else {
(void) strcpy(prop, EmphasizeFontDefault);
}
/* fprintf(stderr,"initx:ingItColorsAndFonts:loadFont 6\n");*/
loadFont(&gEmFont, prop);
/* fprintf(stderr,"initx:ingItColorsAndFonts:XrmGetResource 8\n");*/
if (XrmGetResource(rDB, "Axiom.hyperdoc.BoldFont",
"Axiom.hyperdoc.Font", str_type, &value) == True)
{
(void) strncpy(prop, value.addr, (int) value.size);
}
else {
(void) strcpy(prop, BoldFontDefault);
}
/* fprintf(stderr,"initx:ingItColorsAndFonts:loadFont 7\n");*/
loadFont(&gBfFont, prop);
/*
* If we are on a monochrome screen, then we ignore user preferences, and
* set the foreground and background as I wish
*/
/* fprintf(stderr,"initx:ingItColorsAndFonts:DisplayPlanes\n");*/
if (DisplayPlanes(gXDisplay, gXScreenNumber) == 1) {
gActiveColor = gAxiomColor
= gControlBackgroundColor
= gInputBackgroundColor
= gBfColor
= gEmColor
= gRmColor
= gSlColor
= gTtColor
= BlackPixel(gXDisplay, gXScreenNumber);
gBackgroundColor = gInputForegroundColor
= gControlForegroundColor
= WhitePixel(gXDisplay, gXScreenNumber);
}
else {
/*
* If I have gotten here, then we must be on a color screen, so see
* what the user likes, and set it up
*/
/* fprintf(stderr,"initx:ingItColorsAndFonts:getColor 1\n");*/
gRmColor =
getColor("RmColor", "Foreground",
BlackPixel(gXDisplay, gXScreenNumber), &cmap);
/* fprintf(stderr,"initx:ingItColorsAndFonts:getColor 2\n");*/
gBackgroundColor =
getColor("Background", "Background",
WhitePixel(gXDisplay, gXScreenNumber), &cmap);
/* fprintf(stderr,"initx:ingItColorsAndFonts:getColor 3\n");*/
gActiveColor =
getColor("ActiveColor", "Foreground",
BlackPixel(gXDisplay, gXScreenNumber), &cmap);
/*
* for next two, I want name arg = class arg, ie do not want
* Background and Foreground.
*/
/* fprintf(stderr,"initx:ingItColorsAndFonts:getColor 4\n");*/
gControlBackgroundColor = getColor("ControlBackground",
"ControlBackground", WhitePixel(gXDisplay, gXScreenNumber), &cmap);
/* fprintf(stderr,"initx:ingItColorsAndFonts:getColor 5\n");*/
gControlForegroundColor = getColor("ControlForeground",
"ControlForeground", BlackPixel(gXDisplay, gXScreenNumber), &cmap);
/* maintain backwards compatibility */
/* fprintf(stderr,"initx:ingItColorsAndFonts:getColor 6\n");*/
gAxiomColor = getColor("AxiomColor", "Foreground", 0, &cmap);
/* fprintf(stderr,"initx:ingItColorsAndFonts:getColor 7\n");*/
if (gAxiomColor == 0)
gAxiomColor = getColor("SpadColor", "Foreground",
BlackPixel(gXDisplay, gXScreenNumber), &cmap);
/* fprintf(stderr,"initx:ingItColorsAndFonts:getColor 8\n");*/
gInputBackgroundColor =
getColor("InputBackground", "Foreground", gRmColor, &cmap);
/* fprintf(stderr,"initx:ingItColorsAndFonts:getColor 9\n");*/
gInputForegroundColor =
getColor("InputForeground", "Background", gBackgroundColor, &cmap);
/* fprintf(stderr,"initx:ingItColorsAndFonts:getColor 10\n");*/
gEmColor =
getColor("EmphasizeColor", "Foreground", gRmColor, &cmap);
/* fprintf(stderr,"initx:ingItColorsAndFonts:getColor 11\n");*/
gTtColor =
getColor("TtColor", "Foreground", gRmColor, &cmap);
/* fprintf(stderr,"initx:ingItColorsAndFonts:getColor 12\n");*/
gSlColor =
getColor("EmphasizeColor", "Foreground", gRmColor, &cmap);
/* fprintf(stderr,"initx:ingItColorsAndFonts:getColor 13\n");*/
gBfColor =
getColor("BoldColor", "Foreground", gRmColor, &cmap);
}
/* fprintf(stderr,"initx:ingItColorsAndFonts:makeColors\n");*/
makeColors(gXDisplay, gXScreenNumber, &cmap, &spadColors, &ts);
/*
* Now set the current color and font, so I never have to do it again
*/
gTopOfGroupStack->cur_color = gRmColor;
gTopOfGroupStack->cur_font = gRmFont;
/* fprintf(stderr,"initx:ingItColorsAndFonts:exited\n");*/
}
\end{chunk}
\subsection{changeText}
\index{hypertex!changeText}
\index{changeText hypertex}
\begin{chunk}{hypertex}
void changeText(int color, XFontStruct *font) {
if (font) {
XGCValues gcv;
gcv.foreground = color;
gcv.background = gBackgroundColor;
XChangeGC(gXDisplay, gWindow->fStandardGC,
GCForeground | GCBackground , &gcv);
if (font->fid != server_font)
XSetFont(gXDisplay, gWindow->fStandardGC, font->fid);
}
}
\end{chunk}
\subsection{getColor}
This routine checks the .Xdefaults file of the user for the
specified color. If found it allocates a place in the color map for it. If
not found, or if an error occurrs, it writes an error message, and
uses the given default value.
\index{hypertex!getColor}
\index{getColor hypertex}
\begin{chunk}{hypertex}
static int getColor(char *name, char *class, int def, Colormap *map) {
char fullname[256];
char fullclass[256];
char property[256];
char *prop = &property[0];
char *str_type[50];
XrmValue value;
int ret_val;
XColor color_def, color_db;
#ifdef DEBUG
printf("getColor: %s %s %d -> ", name, class, def);
#endif
strcpy(fullname, "Axiom.hyperdoc.");
strcat(fullname, name);
strcpy(fullclass,"Axiom.hyperdoc.");
strcat(fullclass,class);
if (XrmGetResource(rDB, fullname, fullclass, str_type, &value) == True) {
(void) strncpy(prop, value.addr, (int) value.size);
ret_val=XAllocNamedColor(gXDisplay, *map, prop, &color_def, &color_db);
if (ret_val) {
#ifdef DEBUG
printf("%d\n", color_def.pixel);
#endif
return (color_def.pixel);
}
else {
fprintf(stderr,
"(HyperDoc) Defaulting on color for %s. Unknown color is %s.\n",
name, prop);
#ifdef DEBUG
printf("%d\n", def);
#endif
return (def);
}
}
else {
#ifdef DEBUG
printf("%d\n", def);
#endif
return (def);
}
}
\end{chunk}
\subsection{mergeDatabases}
\label{mergeDatabases}
\index{hypertex!mergeDatabases}
\index{mergeDatabases hypertex}
\begin{chunk}{hypertex}
static void mergeDatabases(void) {
XrmDatabase homeDB, serverDB, applicationDB;
char filenamebuf[1024];
char *filename = &filenamebuf[0];
char *classname = "Axiom";
char name[255];
/* fprintf(stderr,"initx:mergeDatabases:entered\n");*/
/* fprintf(stderr,"initx:mergeDatabases:XrmInitialize\n");*/
(void) XrmInitialize();
(void) strcpy(name, "/usr/lib/X11/app-defaults/");
(void) strcat(name, classname);
/* fprintf(stderr,"initx:mergeDatabases:XrmGetFileDatabase name=%s\n",name);*/
applicationDB = XrmGetFileDatabase(name);
/* fprintf(stderr,"initx:mergeDatabases:XrmMergeDatabases\n");*/
(void) XrmMergeDatabases(applicationDB, &rDB);
/* fprintf(stderr,"initx:mergeDatabases:XrmGetStringDatabase\n");*/
if (XResourceManagerString(gXDisplay) != NULL) {
serverDB = XrmGetStringDatabase(XResourceManagerString(gXDisplay));
}
else {
(void) strcpy(filename, getenv("HOME"));
(void) strcat(filename, "/.Xdefaults");
/* fprintf(stderr,"initx:mergeDatabases:XrmGetFileDatase\n");*/
serverDB = XrmGetFileDatabase(filename);
}
/* fprintf(stderr,"initx:mergeDatabases:XrmMergeDatabases 2\n");*/
XrmMergeDatabases(serverDB, &rDB);
if (getenv("XENVIRONMENT") == NULL) {
int len;
(void) strcpy(filename, getenv("HOME"));
(void) strcat(filename, "/.Xdefaults-");
len = strlen(filename);
(void) gethostname(filename + len, 1024 - len);
}
else {
(void) strcpy(filename, getenv("XENVIRONMENT"));
}
/* fprintf(stderr,"initx:mergeDatabases:filename=%s\n",filename);*/
homeDB = XrmGetFileDatabase(filename);
/* fprintf(stderr,"initx:mergeDatabases:XrmMergeDatabases 3\n");*/
XrmMergeDatabases(homeDB, &rDB);
}
\end{chunk}
\subsection{isIt850}
\index{hypertex!isIt850}
\index{isIt850 hypertex}
\begin{chunk}{hypertex}
int isIt850(XFontStruct *fontarg) {
char *s;
int i,val;
static struct {
char *name;
Atom format;
Atom atom;
} proptbl = { "CHARSET_ENCODING", XA_ATOM };
proptbl.atom = XInternAtom(gXDisplay,proptbl.name,0);
for (i=0;i<fontarg->n_properties;i++)
{
if (fontarg->properties[i].name != proptbl.atom) continue;
/* return 1 if it is 850 */
s = XGetAtomName(gXDisplay,(Atom)fontarg->properties[i].card32);
val = !( strcmp("850",s) * strcmp("ibm-850",s));
XFree(s);
return( val );
}
return(0);
}
\end{chunk}
\section{Handling user page interaction}
\subsection{fillBox}
\index{hypertex!fillBox}
\index{fillBox hypertex}
\begin{chunk}{hypertex}
void fillBox(Window w,ImageStruct * image) {
XClearWindow(gXDisplay, w);
XPutImage(gXDisplay, w, gWindow->fControlGC,
image->image.xi, 0, 0, 0, 0,
image->width,
image->height);
}
\end{chunk}
\subsection{toggleInputBox}
\index{hypertex!toggleInputBox}
\index{toggleInputBox hypertex}
\begin{chunk}{hypertex}
void toggleInputBox(HyperLink *link) {
InputBox *box;
box = link->reference.box;
if (box->picked) {
box->picked = 0;
unpick_box(box);
}
else {
box->picked = 1;
pick_box(box);
}
}
\end{chunk}
\subsection{toggleRadioBox}
\index{hypertex!toggleRadioBox}
\index{toggleRadioBox hypertex}
\begin{chunk}{hypertex}
void toggleRadioBox(HyperLink *link) {
InputBox *box;
box = link->reference.box;
if (box->picked) {
/*
* box->picked = 0; unpick_box(box);
*/
}
else {
/* the first thing I do is clear his buddies */
clearRbs(box->rbs->boxes);
box->picked = 1;
pick_box(box);
}
}
\end{chunk}
\subsection{clearRbs}
\index{hypertex!clearRbs}
\index{clearRbs hypertex}
\begin{chunk}{hypertex}
static void clearRbs(InputBox *list) {
InputBox *trace = list;
while (trace && !trace->picked)
trace = trace->next;
if (trace != NULL) {
trace->picked = 0;
unpick_box(trace);
}
}
\end{chunk}
\subsection{changeInputFocus}
\index{hypertex!changeInputFocus}
\index{changeInputFocus hypertex}
\begin{chunk}{hypertex}
void changeInputFocus(HyperLink *link) {
InputItem *new_item = link->reference.string;
InputItem *old_item = gWindow->page->currentItem;
XWindowChanges wc;
/** first thing I should do is see if the user has clicked in the same
window that I am in ****/
if (old_item == new_item)
return;
/** Now change the current pointer **/
gWindow->page->currentItem = new_item;
/** Now I have to change the border width of the selected input window **/
wc.border_width = 1;
XConfigureWindow(gXDisplay, new_item->win,
CWBorderWidth,
&wc);
wc.border_width = 0;
XConfigureWindow(gXDisplay, new_item->win,
CWBorderWidth,
&wc);
updateInputsymbol(old_item);
updateInputsymbol(new_item);
}
\end{chunk}
\subsection{nextInputFocus}
\index{hypertex!nextInputFocus}
\index{nextInputFocus hypertex}
\begin{chunk}{hypertex}
void nextInputFocus(void) {
InputItem *old_item = gWindow->page->currentItem, *new_item, *trace;
if (gWindow->page->currentItem == NULL ||
(gWindow->page->currentItem->next == NULL
&& gWindow->page->currentItem == gWindow->page->input_list)) {
BeepAtTheUser();
return;
}
/*
* Now I should find the new item
*/
new_item = NULL;
trace = old_item->next;
if (trace == NULL)
new_item = gWindow->page->input_list;
else
new_item = trace;
gWindow->page->currentItem = new_item;
drawInputsymbol(old_item);
drawInputsymbol(new_item);
}
\end{chunk}
\subsection{prevInputFocus}
\index{hypertex!prevInputFocus}
\index{prevInputFocus hypertex}
\begin{chunk}{hypertex}
void prevInputFocus(void) {
InputItem *old_item = gWindow->page->currentItem, *new_item, *trace;
if (gWindow->page->currentItem == NULL) {
BeepAtTheUser();
return;
}
/*
* Now I should find the new item
*/
new_item = NULL;
trace = gWindow->page->input_list;
if (trace == old_item) {
/*
* I started at the front of the list, so move forward until I hit
* the end
*/
while (trace->next != NULL)
trace = trace->next;
new_item = trace;
}
else {
while (trace->next != old_item)
trace = trace->next;
new_item = trace;
}
gWindow->page->currentItem = new_item;
drawInputsymbol(old_item);
drawInputsymbol(new_item);
}
\end{chunk}
\subsection{returnItem}
\index{hypertex!returnItem}
\index{returnItem hypertex}
\begin{chunk}{hypertex}
InputItem *returnItem(char *name) {
InputItem *list;
list = gWindow->page->input_list;
while (list != NULL) {
if (!strcmp(name, list->name))
return list;
list = list->next;
}
return NULL;
}
\end{chunk}
\subsection{deleteItem}
\index{hypertex!deleteItem}
\index{deleteItem hypertex}
\begin{chunk}{hypertex}
int deleteItem(char *name) {
InputItem *list;
InputItem *prev = NULL;
list = gWindow->page->input_list;
while (list != NULL) {
if (!strcmp(name, list->name)) {
if (prev)
prev->next = list->next;
else
gWindow->page->input_list = list->next;
if (gWindow->page->currentItem == list)
gWindow->page->currentItem = gWindow->page->input_list;
freeInputItem(list, 1);
free(list);
return 1;
}
prev = list;
list = list->next;
}
fprintf(stderr, "Can't delete input item %s\n", name);
return 0;
}
\end{chunk}
\section{Manipulate the item stack}
\subsection{pushItemStack}
\index{hypertex!pushItemStack}
\index{pushItemStack hypertex}
\begin{chunk}{hypertex}
void pushItemStack(void) {
ItemStack *is = (ItemStack *) halloc(sizeof(ItemStack), "Item stack");
is->indent = indent;
is->item_indent = item_indent;
is->next = gTopOfItemStack;
is->in_item = gInItem;
gTopOfItemStack = is;
return;
}
\end{chunk}
\subsection{clearItemStack}
\index{hypertex!clearItemStack}
\index{clearItemStack hypertex}
\begin{chunk}{hypertex}
void clearItemStack(void) {
ItemStack *is = gTopOfItemStack, *chuck;
while (is != NULL) {
chuck = is;
is = is->next;
free(chuck);
}
return;
}
\end{chunk}
\subsection{popItemStack}
\index{hypertex!popItemStack}
\index{popItemStack hypertex}
\begin{chunk}{hypertex}
void popItemStack(void) {
ItemStack *chuck;
if (gTopOfItemStack == NULL) {
fprintf(stderr, "Tried to pop an empty item stack\n");
return;
}
chuck = gTopOfItemStack;
gTopOfItemStack = gTopOfItemStack->next;
indent = chuck->indent;
item_indent = chuck->item_indent;
gInItem = chuck->in_item;
free(chuck);
}
\end{chunk}
\subsection{copyItemStack}
\index{hypertex!copyItemStack}
\index{copyItemStack hypertex}
\begin{chunk}{hypertex}
ItemStack *copyItemStack(void) {
ItemStack *new = NULL;
ItemStack *prev = NULL;
ItemStack *trace = gTopOfItemStack;
ItemStack *first = NULL;
while (trace) {
new = (ItemStack *) halloc(sizeof(ItemStack), "Item stack");
new->indent = trace->indent;
new->item_indent = trace->item_indent;
new->in_item = gInItem;
if (!first)
first = new;
else
prev->next = new;
prev = new;
trace = trace->next;
}
if (new)
new->next = NULL;
return first;
}
\end{chunk}
\subsection{freeItemStack}
\index{hypertex!freeItemStack}
\index{freeItemStack hypertex}
\begin{chunk}{hypertex}
void freeItemStack(ItemStack *is) {
ItemStack *junk = NULL;
ItemStack *trace = is;
while (trace) {
junk = trace;
trace = trace->next;
free(junk);
}
}
\end{chunk}
\section{Keyboard handling}
\subsection{handleKey}
\index{hypertex!handleKey}
\index{handleKey hypertex}
\begin{chunk}{hypertex}
void handleKey(XEvent *event) {
char key_buffer[20];
int key_buffer_size = 20;
KeySym keysym;
XComposeStatus compstatus;
int charcount;
int display_again = 0;
char *name;
char *filename;
/*char *head = "echo htadd -l ";*/
/*char *blank1 = " ";*/
/*char *blank2 = " \n";*/
char buffer[180];
FILE *filehandle;
charcount = XLookupString((XKeyEvent *)event, key_buffer, key_buffer_size,
&keysym ,&compstatus);
key_buffer[charcount] = '\0';
switch (keysym) {
case XK_Prior:
case XK_F29:
scrollUpPage();
break;
case XK_Next:
case XK_F35:
scrollDownPage();
break;
case XK_F3:
case XK_F12:
quitHyperDoc();
break;
case XK_F5:
if (event->xkey.state & ShiftMask) {
name = gWindow->page->name;
filename = gWindow->page->filename;
sprintf(buffer, "htadd -l %s\n", filename);
system(buffer);
filehandle = (FILE *) hashFind(&gFileHashTable, filename);
fclose(filehandle);
hashDelete(&gFileHashTable, filename);
gWindow->fMacroHashTable =
(HashTable *) halloc(sizeof(HashTable), "macro hash");
hashInit(
gWindow->fMacroHashTable,
MacroHashSize,
(EqualFunction ) stringEqual,
(HashcodeFunction) stringHash);
gWindow->fPatchHashTable =
(HashTable *) halloc(sizeof(HashTable), "patch hash");
hashInit(
gWindow->fPatchHashTable,
PatchHashSize,
(EqualFunction ) stringEqual,
(HashcodeFunction) stringHash);
gWindow->fPasteHashTable =
(HashTable *) halloc(sizeof(HashTable), "paste hash");
hashInit(gWindow->fPasteHashTable,
PasteHashSize,
(EqualFunction ) stringEqual,
(HashcodeFunction) stringHash);
gWindow->fCondHashTable =
(HashTable *) halloc(sizeof(HashTable), "cond hash");
hashInit(
gWindow->fCondHashTable,
CondHashSize,
(EqualFunction ) stringEqual,
(HashcodeFunction) stringHash);
gWindow->fPageHashTable =
(HashTable *) halloc(sizeof(HashTable), "page hash");
hashInit(
gWindow->fPageHashTable,
PageHashSize,
(EqualFunction ) stringEqual,
(HashcodeFunction) stringHash);
makeSpecialPages(gWindow->fPageHashTable);
readHtDb(
gWindow->fPageHashTable,
gWindow->fMacroHashTable,
gWindow->fPatchHashTable);
gWindow->page = (HyperDocPage *) hashFind(gWindow->fPageHashTable, name);
if (gWindow->page == NULL) {
fprintf(stderr, "lose...gWindow->page for %s is null\n", name);
exit(-1);
}
display_again = 1;
}
break;
case XK_F9:
makeWindowLink(KeyDefsHelpPage);
break;
case XK_Tab:
if (event->xkey.state & ShiftMask)
prevInputFocus();
else if (event->xkey.state & ModifiersMask)
BeepAtTheUser();
else
nextInputFocus();
break;
case XK_Return:
if (!(event->xkey.state & ShiftMask)) {
nextInputFocus();
break;
}
/* next ones fall through to input area handling */
case XK_Escape:
if (!gWindow->page->currentItem)
break;
case XK_F1:
if (!gWindow->page->currentItem) {
gWindow->page->helppage = allocString(NoMoreHelpPage);
helpForHyperDoc();
break;
}
case XK_Home:
if (!gWindow->page->currentItem) {
scrollToFirstPage();
break;
}
case XK_Up:
if (!gWindow->page->currentItem) {
scrollUp();
break;
}
case XK_Down:
if (!gWindow->page->currentItem) {
scrollDown();
break;
}
default:
display_again = 0;
dialog(event, keysym, key_buffer);
XFlush(gXDisplay);
break;
}
if (display_again) {
displayPage(gWindow->page);
gWindow->fWindowHashTable = gWindow->page->fLinkHashTable;
}
}
\end{chunk}
\subsection{getModifierMask}
This routine returns the modifier mask associated to a key symbol.
\index{hypertex!getModifierMask}
\index{getModifierMask hypertex}
\begin{chunk}{hypertex}
static unsigned int getModifierMask(KeySym sym) {
unsigned int i, mask;
XModifierKeymap *mod;
KeyCode kcode;
const int masks[8] = {
ShiftMask, LockMask, ControlMask,
Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask
};
mod = XGetModifierMapping(gXDisplay);
kcode = XKeysymToKeycode(gXDisplay,sym);
if (mod) {
for (i = 0; i < (8 * mod->max_keypermod); i++){
if (!mod->modifiermap[i]) continue;
else if (kcode == mod->modifiermap[i]){
mask = masks[i / mod->max_keypermod];
XFreeModifiermap(mod);
return mask;
}
}
XFreeModifiermap(mod);
}
return 0;
}
\end{chunk}
\subsection{initKeyin}
This routine initializes some of the variables needed by the input
strings, and boxes.
\index{hypertex!initKeyin}
\index{initKeyin hypertex}
\begin{chunk}{hypertex}
void initKeyin(void) {
char *prop;
unsigned int nlm;
nlm = getModifierMask(XK_Num_Lock);
UnsupportedModMask &= ~nlm;
ModifiersMask &= ~nlm;
/*
* First set all the values for when the active cursor is in the window
*/
in_cursor_height = 2;
in_cursor_y = gInputFont->max_bounds.ascent +
gInputFont->max_bounds.descent;
in_cursor_width = gInputFont->max_bounds.width;
/*
* Now for when the cursor is empty
*/
out_cursor_height = gInputFont->max_bounds.ascent +
gInputFont->max_bounds.descent;
out_cursor_y = 2;
out_cursor_width = in_cursor_width;
start_x = 5;
start_y = gInputFont->max_bounds.ascent;
/*
* Find out How big I should make the simple boxes
*/
simple_box_width = XTextWidth(gInputFont, "X", 1) + 5;
prop = XGetDefault(gXDisplay, gArgv[0], "ProtectedQuit");
if (prop == NULL) {
protected_quit = (char *) halloc(strlen("ProtectedPage") + 1,
"protected_quit");
strcpy(protected_quit, "ProtectedPage");
}
else {
protected_quit = (char *) halloc(strlen(prop) + 1, "protected_quit");
strcpy(protected_quit, prop);
}
}
\end{chunk}
\section{Handle page macros}
\subsection{scanHyperDoc}
This routine keeps scanning until it reaches it pops off 1 more
right brace then left brace.
\index{hypertex!scanHyperDoc}
\index{scanHyperDoc hypertex}
\begin{chunk}{hypertex}
void scanHyperDoc(void) {
HDWindow *twin = gWindow;
int ret_val;
int number_of_left_braces = 1;
gWindow = NULL;
while (number_of_left_braces) {
ret_val = getToken();
if (ret_val == EOF && number_of_left_braces) {
fprintf(stderr, "Scan_Hypertex: Unexpected End of File\n");
longjmp(jmpbuf, 1);
}
switch (token.type) {
case Page:
fprintf(stderr, "scanHyperDoc: Unexpected Page Declaration\n");
break;
case NewCommand:
fprintf(stderr, "scanHyperDoc: Unexpected Macro Declaration\n");
break;
case Lbrace:
number_of_left_braces++;
break;
case Endpatch:
case Rbrace:
number_of_left_braces--;
break;
default:
break;
}
}
gWindow = twin;
}
\end{chunk}
\subsection{number}
\index{hypertex!number}
\index{number hypertex}
\begin{chunk}{hypertex}
int number(char *str) {
char *t = str;
while (*t)
if (!isdigit(*t++))
return 0;
return 1;
}
\end{chunk}
\subsection{loadMacro}
Parse a given macro given the pointer to the unloaded macro.
\index{hypertex!loadMacro}
\index{loadMacro hypertex}
\begin{chunk}{hypertex}
static char *loadMacro(MacroStore *macro) {
int ret_val;
long start_fpos;
int size = 0;
char *trace;
char *macro_buff;
saveScannerState();
cfile = findFp(macro->fpos);
initScanner();
/** First thing I should do is make sure that the name is correct ***/
getExpectedToken(NewCommand);
getExpectedToken(Lbrace);
getExpectedToken(Macro);
if (strcmp(token.id, macro->name)) {
/** WOW, Somehow I had the location of the wrong macro **/
fprintf(stderr, "Expected macro name %s got insted %s in loadMacro\n",
macro->name, token.id);
longjmp(jmpbuf, 1);
}
getExpectedToken(Rbrace);
/** Next I should check to see if I have any parameters **/
getToken();
if (token.type == Lsquarebrace) {
/** The person is telling me the number of macros he is going to use **/
getExpectedToken(Word);
if (!number(token.id)) {
fprintf(stderr, "loadMacro: Expected A Value Instead Got %s\n",
token.id);
longjmp(jmpbuf, 1);
}
/** if it is a number, then I should store it in the parameter number
member of the macro structure **/
macro->number_parameters = atoi(token.id);
#ifdef DEBUG
fprintf(stderr,
"The number of parameters is %d\n", macro->number_parameters);
#endif
getExpectedToken(Rsquarebrace);
getToken();
}
else
macro->number_parameters = 0;
/*** Now I should be able to check the token, and insure that I have read
a leftbrace, then the string will follow ****/
if (token.type != Lbrace) {
/** The macro is not in a group, uh oh **/
fprintf(stderr, "loadMacro:Expected a Left Brace got type %d\n",
token.type);
longjmp(jmpbuf, 1);
}
start_fpos = fpos;
scanHyperDoc();
ret_val = fseek(cfile, macro->fpos.pos + start_fpos, 0);
size = fpos - start_fpos;
macro_buff = (char *) halloc((size + 1) * sizeof(char), "Macro_buf");
for (size = 0, trace = macro_buff; size < fpos - (start_fpos) - 1; size++)
*trace++ = getc(cfile);
*trace = '\0';
macro->loaded = 1;
restoreScannerState();
return macro_buff;
}
\end{chunk}
\subsection{initParameterElem}
\index{hypertex!initParameterElem}
\index{initParameterElem hypertex}
\begin{chunk}{hypertex}
ParameterList initParameterElem(int number) {
ParameterList new;
int count;
/** allocate the space neeeded **/
new = (ParameterList) halloc(sizeof(struct parameter_list_type),
"ParameterList");
/** now allocate the memeory for the pointers to the parameters **/
if (number) {
new->list = (char **) halloc(number * sizeof(char *), "Parameter List");
/** initialize my pointers **/
for (count = 0; count < number; count++)
(new->list)[count] = NULL;
}
new->number = number;
return new;
}
\end{chunk}
\subsection{pushParameters}
\index{hypertex!pushParameters}
\index{pushParameters hypertex}
\begin{chunk}{hypertex}
int pushParameters(ParameterList new) {
if (new == NULL) {
fprintf(stderr, "Tried pushing a null list onto the parameter stack\n");
longjmp(jmpbuf, 1);
}
new->next = parameters;
parameters = new;
return 1;
}
\end{chunk}
\subsection{popParameters}
Simply pops the top of the parameter list, being good and freeing
all the memory.
\index{hypertex!popParameters}
\index{popParameters hypertex}
\begin{chunk}{hypertex}
int popParameters(void) {
ParameterList old;
int count;
if (!parameters) {
return 0;
}
old = parameters;
parameters = old->next;
/** Free the parameter text and pointers **/
if (old->number >0) {
for (count = 0; count < old->number; count++)
if ( (old->list)[count] ) free((char *) (old->list)[count]);
free(old->list);
}
free(old); /** free the parameter **/
return 1;
}
\end{chunk}
\subsection{parseMacro}
This routine loads a macro if needed, and then parses it from the string.
\index{hypertex!parseMacro}
\index{parseMacro hypertex}
\begin{chunk}{hypertex}
int parseMacro(void) {
MacroStore *macro;
int s;
curr_node->type = Macro;
curr_node->space = token.id[-1];
curr_node->next = allocNode();
curr_node = curr_node->next;
macro = (MacroStore *) hashFind(gWindow->fMacroHashTable, token.id);
if (macro != NULL) {
if (!macro->loaded)
macro->macro_string = loadMacro(macro);
getParameterStrings(macro->number_parameters, macro->name);
parseFromString(macro->macro_string);
if (gEndedPage) {
s = curr_node->type;
curr_node->type = Endmacro;
curr_node->next = allocNode();
curr_node = curr_node->next;
curr_node->type = s;
}
else
curr_node->type = Endmacro;
if (popParameters())
return 1;
else {
fprintf(stderr,
"parseMacro: Tried to pop an empty paramter stack\n");
longjmp(jmpbuf, 1);
}
}
else {
fprintf(stderr, "parseMacro: Unknown keyword %s\n", token.id);
longjmp(jmpbuf, 1);
}
}
\end{chunk}
\subsection{getParameterStrings}
\index{hypertex!getParameterStrings}
\index{getParameterStrings hypertex}
\begin{chunk}{hypertex}
static void getParameterStrings(int number,char * macro_name) {
static char buffer[4096];
char *buffer_pntr;
int count;
int lbrace_counter;
char c;
int size;
ParameterList new = initParameterElem(number);
int pnum;
char pnum_chars[5];
int pc;
if (!number) { /* nothing to be done */
pushParameters(new);
return;
}
for (count = 0; count < number; count++) {
getToken();
if (token.type != Lbrace) {
/** The macro is not in a group, uh oh **/
fprintf(stderr, "Wrong number of arguments to the macro %s\n",
macro_name);
jump();
}
for (lbrace_counter = 1, buffer_pntr = buffer;
lbrace_counter;) {
switch (c = getChar()) {
case EOF:
fprintf(stderr, "GetParameterStrings: Unexpected EOF\n");
longjmp(jmpbuf, 1);
case '}':
lbrace_counter--;
if (lbrace_counter)
*buffer_pntr++ = c;
break;
case '{':
lbrace_counter++;
*buffer_pntr++ = c;
break;
case '#':
/* uh oh, I have a paramter reference inside a paramter */
/* get the number */
if (parameters == NULL) {
*buffer_pntr++ = c;
break;
}
if (
((buffer_pntr > buffer + 1) &&
*(buffer_pntr - 1) == '\\' &&
*(buffer_pntr - 2) != '\\') ||
((buffer_pntr > buffer) &&
*(buffer_pntr - 1) == '\\')) {
/* I had a \# */
*buffer_pntr++ = c;
}
else {
c = getChar();
for (pc = 0; numeric(c); pc++) {
pnum_chars[pc] = c;
c = getChar();
}
ungetChar(c);
pnum_chars[pc] = '\0';
pnum = atoi(pnum_chars);
pc = 0;
/* Now copy the paramter */
while ((parameters->list)[pnum - 1][pc] != '\0')
*buffer_pntr++ = (parameters->list)[pnum - 1][pc++];
}
break;
default:
*buffer_pntr++ = c;
break;
}
}
*buffer_pntr = '\0';
/*** Now add it to the current parameter list **/
size = strlen(buffer) + 1;
new->list[count] = (char *) halloc(size, "Parameter Strings");
strcpy(new->list[count], buffer);
}
pushParameters(new);
return ;
}
\end{chunk}
\subsection{parseParameters}
\index{hypertex!parseParameters}
\index{parseParameters hypertex}
\begin{chunk}{hypertex}
void parseParameters(void) {
int value;
if (!number(token.id)) {
fprintf(stderr,
"Parse_parameter: Error Expected a number, got %s instead\n",
token.id);
longjmp(jmpbuf, 1);
}
if ((value = atoi(token.id)) > parameters->number) {
/** had a bad parameter number **/
fprintf(stderr,
"Parse_parameter: Had a bad parameter number %d\n", value);
longjmp(jmpbuf, 1);
}
parseFromString((parameters->list)[value - 1]);
curr_node->type = Endparameter;
return;
}
\end{chunk}
\section{Memory management routines}
\subsection{freeIfNonNULL}
\index{hypertex!freeIfNonNULL}
\index{freeIfNonNULL hypertex}
\begin{chunk}{hypertex}
static void freeIfNonNULL(void *p) {
if (p){
free(p);
}
}
\end{chunk}
\subsection{allocHdWindow}
Allocate an HDWindow Structure and initialize it.
\index{hypertex!allocHdWindow}
\index{allocHdWindow hypertex}
\begin{chunk}{hypertex}
HDWindow *allocHdWindow(void) {
HDWindow *w = (HDWindow *) halloc(sizeof(HDWindow), "HDWindow");
w->fMemoStack = (HyperDocPage **)
halloc(MaxMemoDepth * sizeof(HyperDocPage *), "Memo Stack");
w->fDownLinkStack = (HyperDocPage **)
halloc(MaxDownlinkDepth * sizeof(HyperDocPage *), "downlink stack");
w->fDownLinkStackTop =
(int *) halloc(MaxDownlinkDepth * sizeof(int), "top downlink stack");
w->fAxiomFrame = 0;
initPageStructs(w);
/* Now I initialize the hash tables for the page */
w->fCondHashTable = (HashTable *) halloc(sizeof(HashTable), "cond hash");
hashInit(
w->fCondHashTable,
CondHashSize,
(EqualFunction) stringEqual,
(HashcodeFunction) stringHash);
w->fPasteHashTable = (HashTable *) halloc(sizeof(HashTable), "paste hash");
hashInit(
w->fPasteHashTable,
PasteHashSize,
(EqualFunction) stringEqual,
(HashcodeFunction) stringHash);
w->fPageHashTable = hashCopyTable(&init_page_hash);
w->fPatchHashTable = hashCopyTable(&init_patch_hash);
w->fMacroHashTable = hashCopyTable(&init_macro_hash);
gWindow = w;
makeSpecialPages(w->fPageHashTable);
w->fDisplayedCursor = 0;
return w;
}
\end{chunk}
\subsection{freeHdWindow}
\index{hypertex!freeHdWindow}
\index{freeHdWindow hypertex}
\begin{chunk}{hypertex}
void freeHdWindow(HDWindow *w) {
if (w) {
free(w->fMemoStack);
free(w->fDownLinkStack);
free(w->fDownLinkStackTop);
/*
free(w->fWindowHashTable); will be taken care of by freeing
freeHash(w->fPageHashTable, freePage); below
cf freePage
*/
freeHash(w->fMacroHashTable, (FreeFunction)dontFree);
freeHash(w->fPasteHashTable, (FreeFunction)dontFree);
freeHash(w->fPatchHashTable, (FreeFunction)dontFree);
freeHash(w->fCondHashTable, (FreeFunction)freeCond);
freeHash(w->fPageHashTable, (FreeFunction)freePage);
free(w->fPageHashTable);
free(w->fPatchHashTable);
free(w->fMacroHashTable);
XFreeGC(gXDisplay, w->fStandardGC);
XFreeGC(gXDisplay, w->fInputGC);
XFreeGC(gXDisplay, w->fCursorGC);
XFreeGC(gXDisplay, w->fControlGC);
free(w);
}
}
\end{chunk}
\subsection{allocNode}
Allocate an empty text node.
\index{hypertex!allocNode}
\index{allocNode hypertex}
\begin{chunk}{hypertex}
TextNode *allocNode(void) {
TextNode *temp_node;
temp_node = (TextNode *) halloc(sizeof(TextNode), "Text Node");
temp_node->type = 0;
temp_node->space = 0;
temp_node->height = 0;
temp_node->width = 0;
temp_node->x = -1;
temp_node->y = -1;
temp_node->data.node = NULL;
temp_node->next = NULL;
temp_node->link = NULL;
temp_node->image.pm = 0;
return temp_node;
}
\end{chunk}
\subsection{freeNode}
\index{hypertex!freeNode}
\index{freeNode hypertex}
\begin{chunk}{hypertex}
void freeNode(TextNode *node, short int des) {
if (node == NULL)
return;
switch (node->type) {
case Paste:
freePastearea(node, des);
freeNode(node->next, des);
break;
case Pastebutton:
freePastebutton(node, des);
freeNode(node->next, des);
break;
case Ifcond:
freeNode(node->data.ifnode->cond, des);
freeNode(node->data.ifnode->thennode, des);
freeNode(node->data.ifnode->elsenode, des);
break;
case Dash:
case Lsquarebrace:
case Word:
case WindowId:
case Punctuation:
case Lbrace:
case Rbrace:
case SimpleBox:
case Verbatim:
case Math:
case Spadsrctxt:
case Spadsrc:
freeIfNonNULL(node->data.text);
freeNode(node->next, des);
break;
case Inputstring:
if (des)
deleteItem(node->data.text);
freeIfNonNULL(node->data.text);
freeNode(node->next, des);
break;
case It:
case Sl:
case Tt:
case Rm:
case Emphasize:
case Beep:
case BoldFace:
case Par:
case Newline:
case Horizontalline:
case Item:
case Beginscroll:
case Endscroll:
case Group:
case Table:
case Macro:
case Pound:
case Center:
case Box:
case Mbox:
case Tableitem:
case Scrollingnode:
case Headernode:
case Titlenode:
case Footernode:
case Controlbitmap:
case Fi:
case Description:
case Rsquarebrace:
case Endpaste:
case Endpastebutton:
freeNode(node->next, des);
break;
case Inputbitmap:
case Inputpixmap:
freeIfNonNULL(node->data.text);
freeNode(node->next, des);
break;
case Quitbutton:
case Helpbutton:
case Upbutton:
case Returnbutton:
if (des && node->link->win) {
hashDelete(gWindow->page->fLinkHashTable,(char *) &node->link->win);
XDestroyWindow(gXDisplay, node->link->win);
}
freeIfNonNULL(node->link);
freeNode(node->next, des);
break;
case Memolink:
case Downlink:
case Windowlink:
case Link:
case Lisplink:
case Lispwindowlink:
case Spadcall:
case Spadcallquit:
case LispMemoLink:
case Lispcommand:
case Lispcommandquit:
case LispDownLink:
case Unixlink:
case Spadlink:
case Spadmemolink:
case Spaddownlink:
case Unixcommand:
case Spadcommand:
case Spadgraph:
if (des && node->link->win) {
hashDelete(gWindow->page->fLinkHashTable,(char *) &node->link->win);
XDestroyWindow(gXDisplay, node->link->win);
}
/* TTT don't free the link before freeing nodes off it */
/* freeNode(node->link->reference.node);*/
freeIfNonNULL(node->link);
freeNode(node->next, des);
break;
case Free:
case Indent:
case Indentrel:
case HSpace:
case Space:
case VSpace:
case Button:
case Bound:
case Tab:
freeNode(node->next, des);
freeNode(node->data.node, des);
break;
case End:
case Endcenter:
case Endlink:
case Endgroup:
case Endbox:
case Endmbox:
case Endspadcommand:
case Endpix:
case Endmacro:
case Endparameter:
case Endtable:
case Endtableitem:
case Noop:
case Endinputbox:
case Enddescription:
case Endif:
case Endtitems:
case Enditems:
case Endverbatim:
case Endmath:
case Endspadsrc:
freeNode(node->next, des);
break;
case Endheader:
case Endtitle:
case Endfooter:
case Endscrolling:
case Endarg:
break;
case Endbutton:
case Beginitems:
freeIfNonNULL(node->data.text);
freeNode(node->next, des);
break;
default:
/* printf("don't know how to free type %d\n", node->type); */
return;
}
free(node);
}
\end{chunk}
\subsection{allocIfnode}
\index{hypertex!allocIfnode}
\index{allocIfnode hypertex}
\begin{chunk}{hypertex}
IfNode *allocIfnode(void) {
IfNode *tempif;
tempif = (IfNode *) halloc(sizeof(struct if_node), "IfNode");
tempif->thennode = tempif->elsenode = tempif->cond = NULL;
return tempif;
}
\end{chunk}
\subsection{allocCondnode}
\index{hypertex!allocCondnode}
\index{allocCondnode hypertex}
\begin{chunk}{hypertex}
CondNode *allocCondnode(void) {
CondNode *temp;
temp = (CondNode *) halloc(sizeof(struct cond_node), "Cond Node");
temp->cond = temp->label = NULL;
return temp;
}
\end{chunk}
\subsection{freeCond}
\index{hypertex!freeCond}
\index{freeCond hypertex}
\begin{chunk}{hypertex}
static void freeCond(CondNode *cond) {
if (cond) {
free(cond->label);
if (cond->cond)
free(cond->cond);
free(cond);
}
}
\end{chunk}
\subsection{allocPage}
Allocate a new HyperDoc page.
\index{hypertex!allocPage}
\index{allocPage hypertex}
\begin{chunk}{hypertex}
HyperDocPage *allocPage(char *name) {
HyperDocPage *page;
page = (HyperDocPage *) halloc(sizeof(HyperDocPage), "HyperDocPage");
page->name = name;
page->header = page->scrolling = page->footer = page->title = NULL;
page->scroll_off = 0;
page->sock = NULL;
page->box_hash = page->depend_hash = NULL;
page->fLinkHashTable =
(HashTable *) halloc(sizeof(HashTable), "Page->fLinkHashTable");
page->input_list = page->currentItem = NULL;
page->pageFlags = 0000000;
page->filename = NULL;
page->helppage = allocString(TopLevelHelpPage);
page->radio_boxes = NULL;
page->button_list = NULL;
page->s_button_list = NULL;
return page;
}
\end{chunk}
\subsection{freePage}
\label{freePage}
This routine now checks for an environment variable NOFREE. If found
it returns. At least, that's what the comment claims but I see no
code to implement this. It's not a bad idea though.
\index{hypertex!freePage}
\index{freePage hypertex}
\begin{chunk}{hypertex}
void freePage(HyperDocPage *page) {
if (page == NULL)
return;
switch (page->type) {
case UlUnknownPage:
case UnknownPage:
case ErrorPage:
case Unixfd:
case SpadGen:
case Normal:
/*
* if(page->name) free(page->name); if(page->filename)
* free(page->filename);
*/
freeNode(page->scrolling, 0);
freeNode(page->header, 0);
freeNode(page->footer, 0);
freeNode(page->title, 0);
freeButtonList(page->s_button_list);
freeButtonList(page->button_list);
/*
if (page->sock != NULL)
free(page->sock);
*/
freeHash(page->depend_hash, (FreeFunction)freeDepend);
/* TTT line below causes freeing of freed memory and freed memory reads
links should have been freed by the recursive freeNode's above
(cf.freeNode)
this is apparently because we are called from freeHdWindow
and we had made a call to free w->fWindowHashTable which is made
to point to the same thing so we do it HERE not THERE
*/
freeHash(page->fLinkHashTable, (FreeFunction)dontFree);
freeHash(page->box_hash, (FreeFunction)freeInputBox);
freeInputList(page->input_list);
freeRadioBoxes(page->radio_boxes);
free(page->helppage);
free(page);
break;
case UnloadedPageType:
break;
default:
/* fprintf(stderr, "Unknown Page type: %d\n", page->type); */
break;
}
}
\end{chunk}
\subsection{freePaste}
\index{hypertex!freePaste}
\index{freePaste hypertex}
\begin{chunk}{hypertex}
static void freePaste(PasteNode *paste, short int des) {
if (paste) {
freeGroupStack(paste->group);
freeItemStack(paste->item_stack);
freeNode(paste->arg_node, des);
free(paste);
}
}
\end{chunk}
\subsection{freePastebutton}
\index{hypertex!freePastebutton}
\index{freePastebutton hypertex}
\begin{chunk}{hypertex}
static void freePastebutton(TextNode *node, short int des) {
/*
* if I am freeing from within parse patch, then I have to do some
* special things first
*/
/* the following seems to be unused */
if (gActiveWindow == node->link->win)
gActiveWindow = -1;
if (des) {
PasteNode *paste;
paste = (PasteNode *) hashFind(gWindow->fPasteHashTable, node->data.text);
if (!paste->haspaste) {
/* squash this thing */
hashDelete(gWindow->fPasteHashTable, (char *)node->data.text);
freePaste(paste, des);
hashDelete(gWindow->page->fLinkHashTable,(char *) &node->link->win);
XDestroyWindow(gXDisplay, node->link->win);
}
else
paste->hasbutton = 0;
}
freeIfNonNULL(node->data.text);
}
\end{chunk}
\subsection{freePastearea}
\index{hypertex!freePastearea}
\index{freePastearea hypertex}
\begin{chunk}{hypertex}
static void freePastearea(TextNode *node, short int des) {
if (des) {
PasteNode *paste;
paste = (PasteNode *) hashFind(gWindow->fPasteHashTable, node->data.text);
if (paste) {
if (!paste->hasbutton) {
/* squash this thing */
hashDelete(gWindow->fPasteHashTable, node->data.text);
freePaste(paste, des);
}
else
paste->haspaste = 0;
}
}
freeIfNonNULL(node->data.text);
}
\end{chunk}
\subsection{freeString}
\index{hypertex!freeString}
\index{freeString hypertex}
\begin{chunk}{hypertex}
void freeString(char *str) {
freeIfNonNULL(str);
}
\end{chunk}
\subsection{freeDepend}
\index{hypertex!freeDepend}
\index{freeDepend hypertex}
\begin{chunk}{hypertex}
static void freeDepend(SpadcomDepend *sd) {
freeIfNonNULL((char *) sd);
}
\end{chunk}
\subsection{dontFree}
\index{hypertex!dontFree}
\index{dontFree hypertex}
\begin{chunk}{hypertex}
static void dontFree(void *link) {
return;
}
\end{chunk}
\subsection{freeLines}
\index{hypertex!freeLines}
\index{freeLines hypertex}
\begin{chunk}{hypertex}
static void freeLines(LineStruct *lines) {
if (lines->prev != NULL)
lines->prev->next = NULL;
while (lines != NULL) {
LineStruct *del;
del = lines;
lines = lines->next;
free(del->buffer);
free(del);
}
}
\end{chunk}
\subsection{freeInputItem}
\index{hypertex!freeInputItem}
\index{freeInputItem hypertex}
\begin{chunk}{hypertex}
void freeInputItem(InputItem *sym, short int des) {
freeIfNonNULL(sym->name);
freeLines(sym->lines);
if (des)
XDestroyWindow(gXDisplay, sym->win);
}
\end{chunk}
\subsection{freeInputList}
\index{hypertex!freeInputList}
\index{freeInputList hypertex}
\begin{chunk}{hypertex}
void freeInputList(InputItem *il) {
while (il) {
InputItem *trash = il;
il = il->next;
freeInputItem(trash, 0);
free(trash);
}
}
\end{chunk}
\subsection{freeInputBox}
\index{hypertex!freeInputBox}
\index{freeInputBox hypertex}
\begin{chunk}{hypertex}
static void freeInputBox(InputBox *box) {
if (box) {
freeIfNonNULL(box->name);
free(box);
}
}
\end{chunk}
\subsection{freeRadioBoxes}
\index{hypertex!freeRadioBoxes}
\index{freeRadioBoxes hypertex}
\begin{chunk}{hypertex}
static void freeRadioBoxes(RadioBoxes *radio) {
if (radio) {
freeRadioBoxes(radio->next);
freeIfNonNULL(radio->name);
free(radio);
}
}
\end{chunk}
\subsection{allocInputline}
\index{hypertex!allocInputline}
\index{allocInputline hypertex}
\begin{chunk}{hypertex}
LineStruct *allocInputline(int size) {
int i;
LineStruct *line =
(LineStruct *) halloc(sizeof(LineStruct), "Line Structure");
line->prev = line->next = NULL;
line->buffer = (char *) halloc(sizeof(char) * size + 2, "symbol buffer");
for (i = 0; i < size + 2; i++)
line->buffer[i] = 0;
line->buff_pntr = line->len = 0;
return line;
}
\end{chunk}
\subsection{allocPasteNode}
\index{hypertex!allocPasteNode}
\index{allocPasteNode hypertex}
\begin{chunk}{hypertex}
PasteNode *allocPasteNode(char *name) {
PasteNode *pastenode =
(PasteNode *) halloc(sizeof(PasteNode), "PasteNode");
pastenode->group = NULL;
pastenode->item_stack = NULL;
pastenode->arg_node = NULL;
pastenode->end_node = NULL;
pastenode->name = allocString(name);
pastenode->haspaste = pastenode->hasbutton = 0;
return pastenode;
}
\end{chunk}
\subsection{allocPatchstore}
\index{hypertex!allocPatchstore}
\index{allocPatchstore hypertex}
\begin{chunk}{hypertex}
PatchStore *allocPatchstore(void) {
PatchStore *p = (PatchStore *) halloc(sizeof(PatchStore), "PatchStore");
p->loaded = 0;
p->string = NULL;
return p;
}
\end{chunk}
\subsection{freePatch}
\index{hypertex!freePatch}
\index{freePatch hypertex}
\begin{chunk}{hypertex}
void freePatch(PatchStore *p) {
if (p) {
if (p->name)
free(p->name);
if (p->fpos.name)
free(p->fpos.name);
if (p->string)
free(p->string);
free(p);
}
}
\end{chunk}
\subsection{allocInputbox}
\index{hypertex!allocInputbox}
\index{allocInputbox hypertex}
\begin{chunk}{hypertex}
InputBox *allocInputbox(void) {
InputBox *box = (InputBox *) halloc(sizeof(InputBox), "InputBox");
box->picked = 0;
box->next = NULL;
box->rbs = NULL;
return box;
}
\end{chunk}
\subsection{allocRbs}
\index{hypertex!allocRbs}
\index{allocRbs hypertex}
\begin{chunk}{hypertex}
RadioBoxes *allocRbs(void) {
RadioBoxes *newrb = (RadioBoxes *) halloc(sizeof(RadioBoxes), "Radio Boxes");
newrb->next = NULL;
newrb->boxes = NULL;
return newrb;
}
\end{chunk}
\subsection{allocButtonList}
\index{hypertex!allocButtonList}
\index{allocButtonList hypertex}
\begin{chunk}{hypertex}
ButtonList *allocButtonList(void) {
ButtonList *newbl = (ButtonList *) halloc(sizeof(ButtonList), "Button List");
newbl->link = NULL;
newbl->x0 = newbl->y0 = newbl->x1 = newbl->y1 = 0;
newbl->next = NULL;
return newbl;
}
\end{chunk}
\subsection{freeButtonList}
\index{hypertex!freeButtonList}
\index{freeButtonList hypertex}
\begin{chunk}{hypertex}
void freeButtonList(ButtonList *bl) {
while (bl) {
ButtonList *nbl = bl->next;
free(bl);
bl = nbl;
}
}
\end{chunk}
\subsection{resizeBuffer}
Resizable static buffers.
\index{hypertex!resizeBuffer}
\index{resizeBuffer hypertex}
\begin{chunk}{hypertex}
char *resizeBuffer(int size, char *oldBuf, int *oldSize) {
char *newBuf;
int newSize;
if (size <= *oldSize)
return oldBuf;
newSize = size + BufferSlop;
newBuf = (char *) halloc(newSize,"Buffer");
memset(newBuf,'\0',newSize);
if (oldBuf) {
memcpy(newBuf, oldBuf, *oldSize);
free(oldBuf);
}
*oldSize = newSize;
return newBuf;
}
\end{chunk}
\section{Page parsing routines}
\subsection{PushMR}
\index{hypertex!PushMR}
\index{PushMR hypertex}
\begin{chunk}{hypertex}
static void PushMR(void) {
MR_Stack *newStackItem =
(MR_Stack *) halloc(sizeof(MR_Stack), "Mode Region Stack");
newStackItem->fParserMode = gParserMode;
newStackItem->fParserRegion = gParserRegion;
newStackItem->fNext = top_mr_stack;
top_mr_stack = newStackItem;
}
\end{chunk}
\subsection{PopMR}
\index{hypertex!PopMR}
\index{PopMR hypertex}
\begin{chunk}{hypertex}
static void PopMR(void) {
MR_Stack *old = top_mr_stack;
if (old == NULL) {
fprintf(stderr,
"(HyperDoc) Parser Error: Tried to pop empty MR Stack\n");
exit(-1);
}
else {
gParserMode = old->fParserMode;
gParserRegion = old->fParserRegion;
top_mr_stack = old->fNext;
free(old);
}
}
\end{chunk}
\subsection{loadPage}
\index{hypertex!loadPage}
\index{loadPage hypertex}
\begin{chunk}{hypertex}
void loadPage(HyperDocPage *page) {
if (page->type == UnloadedPageType) {
HyperDocPage *new_page;
initScanner();
new_page = formatPage((UnloadedPage *)page);
gWindow->page = new_page;
/* free(page); */
page = new_page;
}
}
\end{chunk}
\subsection{displayPage}
Display a HyperDoc page with the given name, parsing it if needed.
\index{hypertex!displayPage}
\index{displayPage hypertex}
\begin{chunk}{hypertex}
void displayPage(HyperDocPage *page) {
HyperDocPage *new_page;
XUnmapSubwindows(gXDisplay, gWindow->fMainWindow);
XUnmapSubwindows(gXDisplay, gWindow->fScrollWindow);
XFlush(gXDisplay);
if (setjmp(jmpbuf)) {
/*
* since I did not finish formatting the page, let me get rid of what
* I had
*/
freePage(formatpage);
/* Replace the buggy page with what I started with */
hashReplace(gWindow->fPageHashTable, (char *)page, formatpage->name);
if (!strcmp(formatpage->name, "ErrorPage")) {
fprintf(stderr, "(HyperDoc) Oops the error page is buggy\n");
exit(-1);
}
gWindow->page = page =
(HyperDocPage *) hashFind(gWindow->fPageHashTable, "ErrorPage");
if (page == NULL) {
fprintf(stderr, "(HyperDoc) No error page found, exiting\n");
exit(-1);
}
resetConnection();
}
if (page->type == UnloadedPageType || page->type == ErrorPage) {
/* Gack! (page should be a union!) */
initScanner();
new_page = formatPage((UnloadedPage *)page);
gWindow->page = new_page;
/* free(page); */
page = new_page;
}
showPage(page);
}
\end{chunk}
\subsection{formatPage}
Parse a given HyperDoc Page, from the top.
\index{hypertex!formatPage}
\index{formatPage hypertex}
\begin{chunk}{hypertex}
static HyperDocPage *formatPage(UnloadedPage *ulpage) {
/*int ret_val;*/
HyperDocPage *page = allocPage(ulpage->name);
/*
* In case of an error I will have to get at this page so I can free the
* waisted memory
*/
formatpage = page;
page->type = Normal;
hashReplace(gWindow->fPageHashTable, (char *)page, ulpage->name);
cfile = findFp(ulpage->fpos);
page->filename = allocString(ulpage->fpos.name);
parsePage(page);
return page;
}
/* parse the HyperDoc statements in the given string */
\end{chunk}
\subsection{parseFromString}
\index{hypertex!parseFromString}
\index{parseFromString hypertex}
\begin{chunk}{hypertex}
void parseFromString(char *str) {
saveScannerState();
last_ch = NoChar;
last_token = 0;
inputString = str;
inputType = FromString;
parseHyperDoc();
restoreScannerState();
}
\end{chunk}
\subsection{parseTitle}
\index{hypertex!parseTitle}
\index{parseTitle hypertex}
\begin{chunk}{hypertex}
static void parseTitle(HyperDocPage *page) {
TextNode *node;
PushMR();
gParserRegion = Title;
getExpectedToken(Lbrace);
node = allocNode();
page->title = node;
node->type = Titlenode;
node->next = allocNode();
node = node->next;
node->type = Center;
node->next = allocNode();
curr_node = node->next;
parseHyperDoc();
curr_node->type = Endcenter;
curr_node->next = allocNode();
curr_node = curr_node->next;
curr_node->type = Endtitle;
curr_node->next = NULL;
if (gNeedIconName) {
char *title = printToString(page->title);
XSetIconName(gXDisplay, gWindow->fMainWindow, title);
gNeedIconName = 0;
}
if (token.type != Rbrace) {
fprintf(stderr,"(HyperDoc) Parse title was expecting a closing brace\n");
printPageAndFilename();
jump();
}
linkTitleBarWindows();
PopMR();
}
\end{chunk}
\subsection{parseHeader}
\index{hypertex!parseHeader}
\index{parseHeader hypertex}
\begin{chunk}{hypertex}
static void parseHeader(HyperDocPage *page) {
TextNode *node;
PushMR();
gParserRegion = Header;
node = allocNode();
page->header = node;
node->type = Headernode;
node->next = allocNode();
curr_node = node->next;
parseHyperDoc();
}
/*
* parse a page from the top level
*/
\end{chunk}
\subsection{initParsePage}
Parse a page from the top level.
\index{hypertex!initParsePage}
\index{initParsePage hypertex}
\begin{chunk}{hypertex}
static void initParsePage(HyperDocPage *page) {
gEndedPage = gInDesc = gStringValueOk = gInIf =
gInButton = gInOptional = gInVerbatim = gInPaste = gInItems =
gInSpadsrc = FALSE;
example_number = 1;
cur_page = page;
gParserMode = AllMode;
/* Now I should set the input list to be null */
freeInputList(page->input_list);
page->input_list = page->currentItem = NULL;
initTopGroup();
clearBeStack();
cur_spadcom = NULL;
gLinkHashTable = page->fLinkHashTable;
hashInit(
gLinkHashTable,
LinkHashSize,
(EqualFunction) windowEqual,
(HashcodeFunction) windowCode);
gPageBeingParsed = page;
}
\end{chunk}
\subsection{initParsePatch}
\index{hypertex!initParsePatch}
\index{initParsePatch hypertex}
\begin{chunk}{hypertex}
void initParsePatch(HyperDocPage *page) {
gEndedPage = gInDesc = gStringValueOk = gInIf =
gInButton = gInOptional = gInVerbatim = gInPaste = gInItems =
gInSpadsrc = FALSE;
gParserMode = AllMode;
gParserRegion = Scrolling;
initTopGroup();
clearBeStack();
cur_spadcom = NULL;
gLinkHashTable = page->fLinkHashTable;
gPageBeingParsed = page;
}
\end{chunk}
\subsection{parsePage}
\index{hypertex!parsePage}
\index{parsePage hypertex}
\begin{chunk}{hypertex}
static void parsePage(HyperDocPage *page) {
initParsePage(page);
/* Get the name of the page */
getExpectedToken(Page);
getExpectedToken(Lbrace);
getExpectedToken(Word);
if (page->name == NULL)
page->name = allocString(token.id);
getExpectedToken(Rbrace);
/* parse the title */
gWindow->fDisplayedWindow = gWindow->fMainWindow;
parseTitle(page);
/*
* Now start parsing the header region
*/
parseHeader(page);
}
/*
*/
\end{chunk}
\subsection{parseHyperDoc}
The general HyperDoc parsing function. expects to see anything. This
function will parse until it sees either:
\begin{enumerate}
\item A new page starting
\item An end of file
\item a closing bracket ``\verb|}|''
\end{enumerate}
\index{hypertex!parseHyperDoc}
\index{parseHyperDoc hypertex}
\begin{chunk}{hypertex}
void parseHyperDoc(void) {
TextNode *node = NULL /*, *save_node = NULL, *arg_node = NULL*/ ;
for(;;) {
ret_val = getToken();
if (ret_val == EOF)
return;
switch (token.type) {
case Spadsrc:
parseSpadsrc(curr_node);
break;
case Helppage:
parseHelp();
break;
case Endpatch:
case Endpaste:
case Rbrace:
return;
case Paste:
parsePaste();
break;
case Pastebutton:
parsePastebutton();
break;
case Endpage:
case NewCommand:
case Page:
endAPage();
return;
case EndScroll:
token.type = Endscroll;
case Endscroll:
startFooter();
break;
case Beginscroll:
startScrolling();
break;
case Thispage: /* it really is just a word */
curr_node->type = Word;
curr_node->data.text = allocString(gPageBeingParsed->name);
break;
case Icorrection:
node->type = Noop;
break;
case Newcond:
parseNewcond();
break;
case Setcond:
parseSetcond();
break;
case Dollar:
parseVerbatim(Math);
break;
case Verbatim:
parseVerbatim(Verbatim);
break;
case Ifcond:
parseIfcond();
break;
case Fi:
if (gInIf)
return;
else {
curr_node->type = Noop;
/* Oops I had a problem parsing this puppy */
fprintf(stderr,"(HyperDoc) \\fi found without macthing if?\n");
longjmp(jmpbuf, 1);
fprintf(stderr, "(HyperDoc) Longjmp failed -- Exiting \n");
exit(-1);
}
case Else:
if (gInIf)
return;
else {
/* Oops I had a problem parsing this puppy */
curr_node->type = Noop;
fprintf(stderr,
"(HyperDoc) \\else found without macthing if?\n");
longjmp(jmpbuf, 1);
fprintf(stderr, "(HyperDoc) Longjmp failed -- Exiting \n");
exit(-1);
}
case Macro:
parseMacro();
break;
case Env:
/** In this case, get the environment value, and make it a word **/
parseEnv(curr_node);
break;
case WindowId:
curr_node->type = WindowId;
curr_node->space = token.id[-1];
curr_node->data.text = windowId(gWindow->fMainWindow);
break;
case Punctuation:
case Word:
case Lsquarebrace:
case Dash:
curr_node->type = token.type;
curr_node->space = token.id[-1];
curr_node->data.text = allocString(token.id);
break;
case Pagename:
{
char *str;
curr_node->type = Word;
curr_node->space = 0;
str = halloc(strlen(cur_page->name) + 1, "parse");
sprintf(str, "%s", cur_page->name);
curr_node->data.text = allocString(str);
break;
}
case Examplenumber:
{
char *str;
curr_node->type = Word;
curr_node->space = 0;
str = halloc(5, "parse");
sprintf(str, "%d", example_number);
curr_node->data.text = allocString(str);
break;
}
case Rsquarebrace:
if (gInOptional)
return;
else {
curr_node->type = token.type;
curr_node->space = token.id[-1];
curr_node->data.text = allocString(token.id);
}
break;
case EndTitems:
token.type = Endtitems;
case Endtitems:
if (gParserMode != AllMode) {
curr_node->type = Noop;
fprintf(stderr,
"(HyperDoc) Found a bad token %s\n", token_table[token.type]);
longjmp(jmpbuf, 1);
}
else {
curr_node->type = token.type;
break;
}
case EndItems:
token.type = Enditems;
case Enditems:
gInItems--;
case Horizontalline:
case Par:
case Newline:
case Titem:
if (gParserMode != AllMode) {
curr_node->type = Noop;
fprintf(stderr,
"(HyperDoc) Found a bad token %s\n", token_table[token.type]);
longjmp(jmpbuf, 1);
}
else {
curr_node->type = token.type;
break;
}
case Begintitems:
case Beginitems:
if (gParserMode != AllMode) {
curr_node->type = Noop;
fprintf(stderr,
"(HyperDoc) Found a bad token %s\n", token_table[token.type]);
longjmp(jmpbuf, 1);
}
else {
parseBeginItems();
break;
}
case Item:
parseItem();
break;
case Mitem:
parseMitem();
break;
case VSpace:
case Tab:
case HSpace:
case Indent:
case Indentrel:
parseValue1();
break;
case Space:
parseValue2();
break;
case Lbrace:
curr_node->type = Group;
curr_node->space = token.id[-1];
pushGroupStack();
node = allocNode();
curr_node->next = node;
curr_node = curr_node->next;
parseHyperDoc();
curr_node->type = Endgroup;
popGroupStack();
break;
case Upbutton:
case Returnbutton:
case Link:
case Downlink:
case Memolink:
case Windowlink:
parseButton();
break;
case Unixlink:
case LispMemoLink:
case LispDownLink:
case Lisplink:
case Lispcommand:
case Lispcommandquit:
case Spadlink:
case Spaddownlink:
case Spadmemolink:
case Unixcommand:
case Spadcall:
case Spadcallquit:
case Qspadcall:
case Qspadcallquit:
case Lispwindowlink:
parseCommand();
break;
case Controlbitmap:
case Inputbitmap:
case Inputpixmap:
case Inputimage:
parseInputPix();
break;
case Box:
parseBox();
break;
case Mbox:
parseMbox();
break;
case Free:
parseFree();
break;
case Center:
parseCenterline();
break;
case Bound:
addDependencies();
break;
case Spadcommand:
case Spadgraph:
parseSpadcommand(curr_node);
break;
case Table:
parseTable();
break;
case Beep:
case Emphasize:
case BoldFace:
case Rm:
case It:
case Tt:
case Sl:
curr_node->type = token.type;
curr_node->space = token.id[-1];
break;
case Inputstring:
parseInputstring();
break;
case SimpleBox:
parseSimplebox();
break;
case BoxValue:
case StringValue:
if (!gStringValueOk) {
strcpy(ebuffer,"(HyperDoc): Unexpected Value Command:");
strcat(ebuffer, token.id);
parserError(ebuffer);
curr_node->type = Noop;
longjmp(jmpbuf, 1);
}
curr_node->type = token.type;
curr_node->space = token.id[-1];
getExpectedToken(Lbrace);
getExpectedToken(Word);
curr_node->data.text = allocString(token.id);
getExpectedToken(Rbrace);
break;
case NoLines:
gPageBeingParsed->pageFlags |= NOLINES;
break;
case Pound:
curr_node->type = Pound;
curr_node->space = token.id[-1];
curr_node->next = allocNode();
curr_node = curr_node->next;
parseParameters();
break;
case Radiobox:
parseRadiobox();
break;
case Radioboxes:
parseRadioboxes();
break;
case Replacepage:
parseReplacepage();
break;
default:
fprintf(stderr,
"(HyperDoc) Keyword not currently supported: %s\n", token.id);
printPageAndFilename();
curr_node->type = Noop;
break;
}
if (gEndedPage)
return;
if (curr_node->type != Noop) {
node = allocNode();
curr_node->next = node;
curr_node = node;
}
}
}
\end{chunk}
\subsection{parsePageFromSocket}
Parse a page from a socket source.
\index{hypertex!parsePageFromSocket}
\index{parsePageFromSocket hypertex}
\begin{chunk}{hypertex}
HyperDocPage *parsePageFromSocket(void) {
HyperDocPage *page = allocPage((char *) NULL);
HyperDocPage *hpage;
initScanner();
inputType = FromSpadSocket;
inputString = "";
cur_spadcom = NULL;
gLinkHashTable = page->fLinkHashTable;
hashInit(
gLinkHashTable,
LinkHashSize,
(EqualFunction) windowEqual,
(HashcodeFunction) windowCode);
gPageBeingParsed = page;
replace_page = NULL;
if (setjmp(jmpbuf)) {
/* Ooops, somewhere I had an error */
freePage(page);
page = (HyperDocPage *) hashFind(gWindow->fPageHashTable, "ErrorPage");
resetConnection();
}
else {
parsePage(page);
page->type = SpadGen;
page->filename = NULL;
/* just for kicks, let me add this thing to the hash file */
hpage = (HyperDocPage *) hashFind(gWindow->fPageHashTable, page->name);
if (hpage)
hashReplace(gWindow->fPageHashTable, (char *)page, page->name);
else {
hashInsert(gWindow->fPageHashTable, (char *)page, page->name);
}
}
if (replace_page != NULL) {
freePage(page);
page = (HyperDocPage *)hashFind(gWindow->fPageHashTable, replace_page);
if (page == NULL)
fprintf(stderr, "(HyperDoc) Unknown page: %s\n", replace_page);
}
return page;
}
\end{chunk}
\subsection{parsePageFromUnixfd}
\index{hypertex!parsePageFromUnixfd}
\index{parsePageFromUnixfd hypertex}
\begin{chunk}{hypertex}
HyperDocPage *parsePageFromUnixfd(void) {
HyperDocPage *page = allocPage((char *) NULL);
initScanner();
inputType = FromUnixFD;
cur_spadcom = NULL;
gLinkHashTable = page->fLinkHashTable;
hashInit(
gLinkHashTable,
LinkHashSize,
(EqualFunction) windowEqual,
(HashcodeFunction) windowCode);
gPageBeingParsed = page;
if (setjmp(jmpbuf)) {
/* Ooops, somewhere I had an error */
freePage(page);
page = (HyperDocPage *) hashFind(gWindow->fPageHashTable, "ErrorPage");
resetConnection();
}
else {
parsePage(page);
page->type = Unixfd;
page->filename = NULL;
}
return page;
}
\end{chunk}
\subsection{startScrolling}
\index{hypertex!startScrolling}
\index{startScrolling hypertex}
\begin{chunk}{hypertex}
static void startScrolling(void) {
/*
* if I am here than I had a begin scroll. This means I should end the
* header, and then start parsing the footer
*/
if (gParserRegion != Header) {
curr_node->type = Noop;
fprintf(stderr,
"(HyperDoc) Parser Error: Unexpected BeginScrollFound\n");
longjmp(jmpbuf, 1);
fprintf(stderr, "(HyperDoc) Longjump failed exiting\n");
}
curr_node->type = Endheader;
curr_node->next = NULL;
PopMR();
PushMR();
gParserRegion = Scrolling;
gWindow->fDisplayedWindow = gWindow->fScrollWindow;
curr_node = allocNode();
gPageBeingParsed->scrolling = curr_node;
curr_node->type = Scrollingnode;
}
\end{chunk}
\subsection{startFooter}
\index{hypertex!startFooter}
\index{startFooter hypertex}
\begin{chunk}{hypertex}
static void startFooter(void) {
/*
* This ends the parsing of the scrolling region, and then starts to
* parse the footer
*/
if (gParserRegion != Scrolling) {
curr_node->type = Noop;
fprintf(stderr,
"(HyperDoc) Parser Error: Unexpected Endscroll Found\n");
printPageAndFilename();
longjmp(jmpbuf, 1);
fprintf(stderr, "(HyperDoc) Longjump failed exiting\n");
}
curr_node->type = Endscrolling;
curr_node->next = NULL;
PopMR();
linkScrollBars();
PushMR();
gParserRegion = Footer;
curr_node = allocNode();
curr_node->type = Footernode;
gPageBeingParsed->footer = curr_node;
gWindow->fDisplayedWindow = gWindow->fMainWindow;
}
\end{chunk}
\subsection{endAPage}
\index{hypertex!endAPage}
\index{endAPage hypertex}
\begin{chunk}{hypertex}
static void endAPage(void) {
if (gParserRegion == Scrolling) {
fprintf(stderr, "%s\n",
"(HyperDoc) endAPage: Unexpected End of Page occurred \
inside a \beginscroll");
printPageAndFilename();
jump();
}
gEndedPage = TRUE;
if (gParserRegion == Footer) {
/* the person had all the regions, I basically just have to leave */
curr_node->type = Endscrolling;
curr_node->next = NULL;
PopMR();
}
else if (gParserRegion == Header) {
/* person had a header. So just end it and return */
curr_node->type = Endheader;
curr_node->next = NULL;
PopMR();
gPageBeingParsed->scrolling = NULL;
gPageBeingParsed->footer = NULL;
}
}
\end{chunk}
\subsection{parseReplacepage}
\index{hypertex!parseReplacepage}
\index{parseReplacepage hypertex}
\begin{chunk}{hypertex}
static void parseReplacepage(void) {
getExpectedToken(Lbrace);
getToken();
replace_page = allocString(token.id);
getExpectedToken(Rbrace);
}
\end{chunk}
\subsection{windowEqual}
Hash functions for active link windows.
\index{hypertex!windowEqual}
\index{windowEqual hypertex}
\begin{chunk}{hypertex}
int windowEqual(Window *w1, Window *w2) {
return *w1 == *w2;
}
\end{chunk}
\subsection{windowCode}
Hash code for a window.
\index{hypertex!windowCode}
\index{windowCode hypertex}
\begin{chunk}{hypertex}
int windowCode(Window *w, int size) {
return (*w) % size;
}
\end{chunk}
\subsection{windowId}
\index{hypertex!windowId}
\index{windowId hypertex}
\begin{chunk}{hypertex}
char *windowId(Window w) {
char *ret;
char buff[32];
int length;
sprintf(buff, "%ld", w);
length = strlen(buff);
ret = (char *) halloc(length * sizeof(char) + 1, "windowid");
strcpy(ret, buff);
return (ret);
}
\end{chunk}
\subsection{readHtDb}
This procedure reads the ht database. It makes repeated calls to
dbFileOpen, and while the returned pointer is not null, it continues to
read the presented data base files.
\index{hypertex!readHtDb}
\index{readHtDb hypertex}
\begin{chunk}{hypertex}
void readHtDb(HashTable *page_hash, HashTable *macro_hash,
HashTable *patch_hash) {
FILE *db_fp;
char dbFile[256];
int i = 0;
gDatabasePath = NULL;
hashInit(
page_hash,
PageHashSize,
(EqualFunction) stringEqual,
(HashcodeFunction) stringHash);
hashInit(
macro_hash,
MacroHashSize,
(EqualFunction) stringEqual,
(HashcodeFunction) stringHash);
hashInit(
patch_hash,
PatchHashSize,
(EqualFunction) stringEqual,
(HashcodeFunction) stringHash);
/* Lets initialize the FileHashTable */
hashInit(
&ht_gFileHashTable,
htfhSize,
(EqualFunction) stringEqual,
(HashcodeFunction) stringHash);
while ((db_fp = dbFileOpen(dbFile)) != NULL) {
i++;
readHtFile(page_hash, macro_hash, patch_hash, db_fp, dbFile);
fclose(db_fp);
}
if (!i) {
fprintf(stderr,
"(HyperDoc) readHtDb: No %s file found\n", dbFileName);
exit(-1);
}
freeHash(&ht_gFileHashTable, (FreeFunction)freeString);
}
\end{chunk}
\subsection{readHtFile}
This procedure reads a single HyperDoc database file. It is passed an already
initilaized file pointer. It reads the whole file, updating the
page hash, or the macro hash only when a previous entry with the same name
is not found
\index{hypertex!readHtFile}
\index{readHtFile hypertex}
\begin{chunk}{hypertex}
static void readHtFile(HashTable *page_hash, HashTable *macro_hash,
HashTable *patch_hash, FILE *db_fp, char *dbFile) {
char filename[256];
char *fullname = filename;
UnloadedPage *page;
MacroStore *macro;
PatchStore *patch;
int pages = 0, c, mtime, ret_val;
struct stat fstats;
/*fprintf(stderr,"parse-aux:readHtFile: dp_file=%s\n",dbFile);*/
cfile = db_fp;
initScanner();
ret_val = strlen(dbFile) - 1;
for (; ret_val >= 0; ret_val--)
if (dbFile[ret_val] == '/') {
dbFile[ret_val] = '\0';
break;
}
c = getc(db_fp);
do {
if (c == '\t') {
getFilename();
fullname = allocString(token.id);
if (fullname[0] != '/') {
strcpy(filename, dbFile);
strcat(filename, "/");
strcat(filename, fullname);
free(fullname);
fullname = allocString(filename);
}
/*
* Until I get a filename that I have not seen before, just keep
* reading
*/
while (hashFind(&ht_gFileHashTable, fullname) != NULL) {
do {
c = getc(db_fp);
} while ((c != EOF) && (c != '\t'));
if (c == EOF)
return;
getFilename();
fullname = allocString(token.id);
if (fullname[0] != '/') {
strcpy(filename, dbFile);
strcat(filename, "/");
strcat(filename, fullname);
free(fullname);
fullname = allocString(filename);
}
}
/*fprintf(stderr,"parse-aux:readHtFile: fullname=%s\n",fullname);*/
/* If I got here, then I must have a good filename */
hashInsert(&ht_gFileHashTable, fullname, fullname);
ret_val = stat(fullname, &fstats);
if (ret_val == -1) {
char buffer[300];
sprintf(buffer,
"(HyperDoc) readHtDb: Unable To Open %s :", fullname);
perror(buffer);
exit(-1);
}
getToken();
mtime = atoi(token.id);
if (gverify_dates & (fstats.st_mtime > mtime)) {
fprintf(stderr,
"(HyperDoc) readHtFile: HyperDoc file %s has been updated\n",
fullname);
fprintf(stderr,
"(HyperDoc) Issue htadd %s to update database\n", fullname);
exit(-1);
}
while ((c = getc(db_fp)) != EOF) {
if (c == '\t')
break;
ungetc(c, db_fp);
getToken();
switch (token.type) {
case Page:
getToken();
/*
* now check to see if the page has already been
* loaded
*/
page = (UnloadedPage *) halloc(sizeof(UnloadedPage),
"UnloadedPage");
page->fpos.name = allocString(fullname);
page->name = allocString(token.id);
getToken();
if (hashFind(page_hash, page->name) != NULL) {
fprintf(stderr,
"(HyperDoc) Page name %s occurred twice\n",
page->name);
fprintf(stderr,
"(HyperDoc) The Version in %s is being ignored \n",
page->fpos.name);
free(page);
getToken();
break;
}
page->fpos.pos = atoi(token.id);
getToken();
page->fpos.ln = atoi(token.id);
page->type = UnloadedPageType;
hashInsert(page_hash, (char *)page, page->name);
pages++;
break;
case NewCommand:
getToken();
macro = (MacroStore *) halloc(sizeof(MacroStore),
"MacroStore");
macro->fpos.name = allocString(fullname);
macro->name = allocString(token.id);
macro->macro_string = NULL;
getToken();
if (hashFind(macro_hash, macro->name) != NULL) {
if (strcmp(macro->name, "localinfo") != 0) {
fprintf(stderr,
"(HyperDoc) Macro name %s occurred twice\n",
macro->name);
fprintf(stderr,
"(HyperDoc) The Version in %s is being ignored \n",
macro->fpos.name);
}
getToken();
free(macro);
break;
}
macro->fpos.pos = atoi(token.id);
getToken();
macro->fpos.ln = atoi(token.id);
macro->loaded = 0;
hashInsert(macro_hash, (char *)macro, macro->name);
break;
case Patch:
getToken();
patch = (PatchStore *) allocPatchstore();
patch->fpos.name = allocString(fullname);
patch->name = allocString(token.id);
getToken();
patch->fpos.pos = atoi(token.id);
getToken();
patch->fpos.ln = atoi(token.id);
if (hashFind(patch_hash, patch->name) != NULL) {
fprintf(stderr,
"(HyperDoc) Patch name %s occurred twice\n",
patch->name);
fprintf(stderr,
"(HyperDoc) The version in %s is being ignored \n",
patch->fpos.name);
freePatch(patch);
break;
}
hashInsert(patch_hash, (char *)patch, patch->name);
break;
default:
fprintf(stderr,
"(HyperDoc) readHtDb: Unknown type %s in ht.db\n",
token.id);
exit(-1);
break;
}
}
}
else
c = getc(db_fp);
} while (c != EOF);
/* fprintf(stderr,
"parse-aux:readHtFile:read %d pages from database\n", pages); */
}
\end{chunk}
\subsection{makeLinkWindow}
Create an unmapped input-only window for an active screen area.
\index{hypertex!makeLinkWindow}
\index{makeLinkWindow hypertex}
\begin{chunk}{hypertex}
HyperLink *makeLinkWindow(TextNode *link_node, int type, int isSubWin) {
HyperLink *link;
XSetWindowAttributes at;
if (make_input_file)
switch (type) {
case Downlink:
case Memolink:
case Windowlink:{
char *name;
HyperDocPage *p;
name = printToString(link_node);
p = (HyperDocPage *) hashFind(gWindow->fPageHashTable, name);
if (!p)
printf("undefined link to %s\n", name);
break;
}
}
else {
link = (HyperLink *) halloc(sizeof(HyperLink), "HyperLink");
if (link == NULL) {
fprintf(stderr,
"(HyperDoc) Ran out of memory allocating a hypertext link!\n");
exit(-1);
}
at.cursor = gActiveCursor;
at.event_mask = ButtonPress;
if (isSubWin)
link->win =
XCreateWindow(gXDisplay, gWindow->fDisplayedWindow, 0, 0,
100, 100, 0, 0, InputOnly, CopyFromParent,
CWEventMask | CWCursor, &at);
else
link->win = 0;
link->type = type;
link->x = link->y = 0;
link->reference.node = link_node;
hashInsert(gLinkHashTable, (char *)link,(char *)&link->win);
return link;
}
return 0;
}
\end{chunk}
\subsection{makePasteWindow}
\index{hypertex!makePasteWindow}
\index{makePasteWindow hypertex}
\begin{chunk}{hypertex}
HyperLink *makePasteWindow(PasteNode *paste) {
HyperLink *link;
XSetWindowAttributes at;
if (!make_input_file) {
link = (HyperLink *) halloc(sizeof(HyperLink), "HyperLink");
if (link == NULL) {
fprintf(stderr,
"(HyperDoc) Ran out of memory allocating a hypertext link!\n");
exit(-1);
}
at.cursor = gActiveCursor;
at.event_mask = ButtonPress;
link->win = XCreateWindow(gXDisplay, gWindow->fDisplayedWindow,
0, 0, 100, 100, 0,
0, InputOnly, CopyFromParent,
CWEventMask | CWCursor, &at);
link->type = Pastebutton;
link->x = link->y = 0;
link->reference.paste = paste;
hashInsert(gLinkHashTable, (char *)link,(char *) &link->win);
return link;
}
return 0;
}
\end{chunk}
\subsection{makeSpecialPage}
Create a HyperDoc page structure with the given type and name.
\index{hypertex!makeSpecialPage}
\index{makeSpecialPage hypertex}
\begin{chunk}{hypertex}
static HyperDocPage *makeSpecialPage(int type, char *name) {
HyperDocPage *page = allocPage(name);
if (page == NULL) {
fprintf(stderr, "(HyperDoc) Ran out of memory allocating page.\n");
exit(-1);
}
page->type = type;
free(page->fLinkHashTable);
page->fLinkHashTable = NULL;
return page;
}
\end{chunk}
\subsection{main}
Insert the special button page types into the page hash table.
\index{hypertex!main}
\index{main hypertex}
\begin{chunk}{hypertex}
void makeSpecialPages(HashTable *pageHashTable) {
hashInsert(pageHashTable,
(char *)makeSpecialPage(Quitbutton, "QuitPage"),
"QuitPage");
hashInsert(pageHashTable,
(char *)makeSpecialPage(Returnbutton, "ReturnPage"),
"ReturnPage");
hashInsert(pageHashTable,
(char *)makeSpecialPage(Upbutton, "UpPage"),
"UpPage");
}
\end{chunk}
\subsection{addDependencies}
Here is where I put the item into the pages linked list.
Parse the \verb|\bound{varlist}| command, and add vars to dependency table.
\index{hypertex!addDependencies}
\index{addDependencies hypertex}
\begin{chunk}{hypertex}
void addDependencies(void) {
TextNode *bound_node = curr_node;
TextNode *node;
SpadcomDepend *depend;
if (cur_spadcom == NULL) {
fprintf(stderr, "(HyperDoc) \\bound occuring outside a \\spadcom\n");
printPageAndFilename();
exit(-1);
}
curr_node->type = Bound;
curr_node->data.node = allocNode();
curr_node = curr_node->data.node;
getExpectedToken(Lbrace);
parseHyperDoc();
curr_node->type = Endarg;
curr_node = bound_node;
if (gPageBeingParsed->depend_hash == NULL) {
gPageBeingParsed->depend_hash =
(HashTable *) halloc(sizeof(HashTable), "Hash Table");
hashInit(
gPageBeingParsed->depend_hash,
DependHashSize,
(EqualFunction) stringEqual,
(HashcodeFunction) stringHash);
}
for (node = bound_node->data.node;
node->type != Endarg;
node = node->next) {
if (node->type == Word) {
depend =
(SpadcomDepend *) halloc(sizeof(SpadcomDepend), "SpadcomDepend");
depend->label = allocString(node->data.text);
depend->spadcom = cur_spadcom;
depend->executed = 0;
hashInsert(gPageBeingParsed->depend_hash, (char *)depend,
depend->label);
}
}
}
\end{chunk}
\subsection{isNumber}
Returns true iff the TextNode contains a single integer.
\index{hypertex!isNumber}
\index{isNumber hypertex}
\begin{chunk}{hypertex}
int isNumber(char * str) {
char *s;
for (s = str; *s != '\0'; s++) {
if (!(isdigit(*s) || *s == '-'))
return 0;
}
return 1;
}
\end{chunk}
\subsection{parserError}
This procedure is called by the parser when an error occurs. It prints
the error message, followed by the next 10 tokens to ease finding the
error for the user.
\index{hypertex!parserError}
\index{parserError hypertex}
\begin{chunk}{hypertex}
void parserError(char *str) {
int i, v;
fprintf(stderr, " %s\n", str);
fprintf(stderr, "Here are the next 10 tokens:\n");
for (i = 0; i < 10; i++) {
v = getToken();
if (v == EOF)
break;
printToken();
}
fprintf(stderr, "\n");
exit(-1);
}
\end{chunk}
\subsection{getFilename}
Advance token to the next token in the input stream.
\index{hypertex!getFilename}
\index{getFilename hypertex}
\begin{chunk}{hypertex}
int getFilename(void) {
int c, ws;
static int seen_white = 0; /*UNUSED */
static char buffer[256];
char *buf = buffer;
if (last_token) {
last_token = 0;
return 0;
}
do {
keyword_fpos = fpos;
c = getChar();
ws = whitespace(c);
if (ws)
seen_white = 1;
} while (ws);
switch (c) {
case EOF:
fprintf(stderr,
"(HyperDoc) Error trying to read %s, unexpected end-of-file.\n",
dbFileName);
exit(-1);
case '%':
case '\\':
case '{':
case '}':
fprintf(stderr, "(HyperDoc) Error unexpected character %c.\n",c);
exit(-1);
default:
do {
*buf++ = c;
} while ((c = getChar()) != EOF && !filedelim(c));
ungetChar(c);
*buf = '\0';
token.type = Word;
token.id = buffer;
seen_white = 0;
break;
}
return 1;
}
\end{chunk}
\subsection{getInputString}
\index{hypertex!getInputString}
\index{getInputString hypertex}
\begin{chunk}{hypertex}
char *getInputString(void) {
char *string;
TextNode *string_node,*save_node;
save_node = curr_node;
/* Get the nodes that make up the string */
string_node = allocNode();
curr_node = string_node;
parseHyperDoc();
curr_node->type = Endarg;
/* Once here we print to string to get the actual name */
string = printToString(string_node);
freeNode(string_node, 0);
curr_node=save_node;
return string;
}
\end{chunk}
\subsection{getWhere}
Tries to determine if there is an optional argument for where I should be
parsing from. If so it then tries to determine which.
\index{hypertex!getWhere}
\index{getWhere hypertex}
\begin{chunk}{hypertex}
int getWhere(void) {
int tw;
getToken();
if (token.type != Word)
return -1;
/* Now try to determine if it is a good type */
if (!strcmp(token.id, "lisp")) {
tw = FromSpadSocket;
}
else if (!strcmp(token.id, "unix")) {
tw = FromUnixFD;
}
else if (!strcmp(token.id, "ht")) {
tw = FromFile;
}
else {
return -1;
}
/* now check to see if I got a closing square brace */
getToken();
if (token.type != Rsquarebrace)
return -1;
return tw;
}
\end{chunk}
\subsection{findFp}
\index{hypertex!findFp}
\index{findFp hypertex}
\begin{chunk}{hypertex}
FILE *findFp(FilePosition fp) {
FILE *lfile;
char fullname[256], addname[256];
int ret_val;
/* find the source file in the file hash table, if not there, open it */
lfile = (FILE *) hashFind(&gFileHashTable, fp.name);
if (lfile == NULL) {
lfile = htFileOpen(fullname, addname, fp.name);
hashInsert(&gFileHashTable, (char *)lfile, fp.name);
}
/* seek to beginning fp.pos */
ret_val = fseek(lfile, fp.pos, 0);
if (ret_val == -1) {
perror("fseeking to a page");
longjmp(jmpbuf, 1);
}
/* now set some global values */
page_start_fpos = fp.pos;
line_number = fp.ln;
return lfile;
}
\end{chunk}
\section{Handle InputString, SimpleBox, RadioBox input}
\subsection{makeInputWindow}
\index{hypertex!makeInputWindow}
\index{makeInputWindow hypertex}
\begin{chunk}{hypertex}
HyperLink *makeInputWindow(InputItem * item) {
HyperLink *link;
XSetWindowAttributes at;
if (!make_input_file) {
link = (HyperLink *) halloc(sizeof(HyperLink), "HyperLink");
if (link == NULL) {
fprintf(stderr, "Ran out of memory allocating a hyper link!\n");
exit(-1);
}
at.cursor = gActiveCursor;
at.background_pixel = gInputBackgroundColor;
at.border_pixel = gActiveColor;
link->win =
XCreateWindow(gXDisplay, gWindow->fDisplayedWindow, 0, 0, 100, 100, 0,
0, InputOutput, CopyFromParent,
CWCursor | CWBackPixel | CWBorderPixel, &at);
XSelectInput(gXDisplay, link->win, ButtonPressMask);
link->type = Inputstring;
link->x = link->y = 0;
/** This way when I click in an input window, I need only use reference
to get a pointer to the item ***/
link->reference.string = item;
hashInsert(gLinkHashTable,(char *) link,(char *) &link->win);
return link;
}
return 0;
}
/* create an unmapped input window for boxes */
\end{chunk}
\subsection{makeBoxWindow}
\index{hypertex!makeBoxWindow}
\index{makeBoxWindow hypertex}
\begin{chunk}{hypertex}
HyperLink *makeBoxWindow(InputBox * box, int type) {
HyperLink *link = 0;
XSetWindowAttributes at;
if (!make_input_file) {
link = (HyperLink *) halloc(sizeof(HyperLink), "makeBoxWindow");
if (link == NULL) {
fprintf(stderr, "Ran out of memory allocating a hyper link!\n");
exit(-1);
}
at.cursor = gActiveCursor;
at.background_pixel = gInputBackgroundColor;
link->win = XCreateWindow(gXDisplay, gWindow->fDisplayedWindow,
0, 0, 100, 100, 0,
0, InputOutput, CopyFromParent,
CWCursor | CWBackPixel, &at);
XSelectInput(gXDisplay, link->win, ButtonPressMask);
link->type = type;
link->x = link->y = 0;
/** This way when I click in an input window, I need only use reference
to get a pointer to the item ***/
link->reference.box = box;
hashInsert(gLinkHashTable, (char *)link,(char *) &link->win);
}
return link;
}
\end{chunk}
\subsection{initializeDefault}
\index{hypertex!initializeDefault}
\index{initializeDefault hypertex}
\begin{chunk}{hypertex}
void initializeDefault(InputItem *item,char * buff) {
LineStruct *newline;
LineStruct *curr_line;
int size = item->size;
int bp;
item->curr_line = item->lines = allocInputline(size);
curr_line = item->lines;
item->num_lines = 1;
curr_line->line_number = 1;
/* while I still have lines to fill */
for (bp = 0; *buff;) {
if (*buff == '\n') {
curr_line->len = bp;
curr_line->buffer[bp] = 0;
newline = allocInputline(size);
newline->line_number = ++(item->num_lines);
curr_line->next = newline;
newline->prev = curr_line;
curr_line = newline;
bp = 0;
buff++;
}
else if (bp == size) {
curr_line->len = size + 1;
curr_line->buffer[size] = '_';
curr_line->buffer[size + 1] = 0;
newline = allocInputline(size);
newline->line_number = ++(item->num_lines);
curr_line->next = newline;
newline->prev = curr_line;
bp = 0;
curr_line = newline;
}
else {
curr_line->buffer[bp++] = *buff++;
}
}
curr_line->buff_pntr = curr_line->len = bp;
item->curr_line = curr_line;
}
\end{chunk}
\subsection{parseInputstring}
Parse the input string statement.
\index{hypertex!parseInputstring}
\index{parseInputstring hypertex}
\begin{chunk}{hypertex}
void parseInputstring(void) {
TextNode *input_node = curr_node;
char *name;
InputItem *item;
int size;
char *default_value;
gStringValueOk = 0;
/* first get the name */
input_node->type = token.type;
getExpectedToken(Lbrace);
name = getInputString();
input_node->data.text = allocString(name);
/* now get the width */
getExpectedToken(Lbrace);
getExpectedToken(Word);
getExpectedToken(Rbrace);
size = atoi(token.id);
if (size < 0) {
fprintf(stderr, "Illegal size in Input string\n");
longjmp(jmpbuf, 1);
}
/* get the default value */
getExpectedToken(Lbrace);
default_value = getInputString();
/** now I need to malloc space for the input stuff **/
item = (InputItem *) halloc(sizeof(InputItem), "InputItem");
/* Now store all the string info */
item->name = (char *)
halloc((strlen(input_node->data.text) + 1) * (sizeof(char)),
"parseInputstring");
strcpy(item->name, input_node->data.text);
item->size = size;
item->entered = 0;
item->next = NULL;
initializeDefault(item, default_value);
/** Now that I have all the structures made, lets make the window, and
add the item to the list ****/
input_node->link = makeInputWindow(item);
if (!make_input_file)
item->win = input_node->link->win; /* TTT */
insertItem(item);
gStringValueOk = 1;
curr_node = input_node;
return ;
}
\end{chunk}
\subsection{parseSimplebox}
\index{hypertex!parseSimplebox}
\index{parseSimplebox hypertex}
\begin{chunk}{hypertex}
void parseSimplebox(void) {
InputBox *box;
char *name;
short int picked = 0;
char *filename;
TextNode *input_box = curr_node;
gStringValueOk = 0;
/* set the type and space fields */
input_box->type = SimpleBox;
input_box->space = token.id[-1];
/* IS it selected? */
getToken();
if (token.type == Lsquarebrace) {
getExpectedToken(Word);
if (!isNumber(token.id)) {
fprintf(stderr,"parse_simple_box: Expected a value not %s\n", token.id);
printPageAndFilename();
jump();
}
else if (!strcmp(token.id, "1"))
picked = 1;
else if (!strcmp(token.id, "0"))
picked = 0;
else {
fprintf(stderr, "parse_simple_box: Unexpected Value %s\n", token.id);
printPageAndFilename();
jump();
}
getExpectedToken(Rsquarebrace);
getToken();
}
if (token.type != Lbrace) {
tokenName(token.type);
fprintf(stderr, "parse_inputbox was expecting a { not a %s\n", ebuffer);
printPageAndFilename();
jump();
}
name = getInputString();
if (gPageBeingParsed->box_hash && hashFind(gPageBeingParsed->box_hash, name)) {
fprintf(stderr, "Input box name %s is not unique \n", name);
printPageAndFilename();
jump();
}
box = allocInputbox();
box->name = allocString(name);
input_box->data.text = allocString(name);
box->picked = picked;
/* Get the filename for the selected and unselected bitmaps */
getExpectedToken(Lbrace);
filename = getInputString();
if (!make_input_file)
box->selected = insertImageStruct(filename);
getExpectedToken(Lbrace);
filename = getInputString();
if (!make_input_file) {
box->unselected = insertImageStruct(filename);
/* set the width and height for the maximaum of the two */
input_box->height = max(box->selected->height, box->unselected->height);
input_box->width = max(box->selected->width, box->unselected->width);
/* Make the window and stuff */
input_box->link = makeBoxWindow(box, SimpleBox);
box->win = input_box->link->win;
/* Now add the box to the box_has table for this window */
if (gPageBeingParsed->box_hash == NULL) {
gPageBeingParsed->box_hash = (HashTable *) halloc(sizeof(HashTable),
"Box Hash");
hashInit(
gPageBeingParsed->box_hash,
BoxHashSize,
(EqualFunction) stringEqual,
(HashcodeFunction) stringHash);
}
hashInsert(gPageBeingParsed->box_hash, (char *)box, box->name);
}
/* reset the curr_node and then return */
curr_node = input_box;
gStringValueOk = 1;
return;
}
\end{chunk}
\subsection{parseRadiobox}
\index{hypertex!parseRadiobox}
\index{parseRadiobox hypertex}
\begin{chunk}{hypertex}
void parseRadiobox(void) {
InputBox *box;
char *name;
char *group_name;
short int picked = 0;
TextNode *input_box = curr_node;
gStringValueOk = 0;
/* set the type and space fields */
input_box->type = Radiobox;
input_box->space = token.id[-1];
/* IS it selected? */
getToken();
if (token.type == Lsquarebrace) {
getExpectedToken(Word);
if (!isNumber(token.id)) {
fprintf(stderr,"parse_simple_box: Expected a value not %s\n", token.id);
printPageAndFilename();
jump();
}
else if (!strcmp(token.id, "1"))
picked = 1;
else if (!strcmp(token.id, "0"))
picked = 0;
else {
fprintf(stderr, "parse_simple_box: Unexpected Value %s\n", token.id);
printPageAndFilename();
jump();
}
getExpectedToken(Rsquarebrace);
getToken();
}
if (token.type != Lbrace) {
tokenName(token.type);
fprintf(stderr, "parse_inputbox was expecting a { not a %s\n", ebuffer);
printPageAndFilename();
jump();
}
name = getInputString();
if (gPageBeingParsed->box_hash && hashFind(gPageBeingParsed->box_hash, name)) {
fprintf(stderr, "Input box name %s is not unique \n", name);
printPageAndFilename();
jump();
}
box = allocInputbox();
box->name = allocString(name);
input_box->data.text = allocString(name);
box->picked = picked;
/* Now what I need to do is get the group name */
getToken();
if (token.type != Lbrace) {
tokenName(token.type);
fprintf(stderr, "parse_inputbox was expecting a { not a %s\n", ebuffer);
printPageAndFilename();
jump();
}
group_name = getInputString();
/*
* Now call a routine which searches the radio box list for the current
* group name, and if found adds this box to it
*/
addBoxToRbList(group_name, box);
input_box->width = box->rbs->width;
input_box->height = box->rbs->height;
/* Make the window and stuff */
input_box->link = makeBoxWindow(box, Radiobox);
if (!make_input_file)
box->win = input_box->link->win; /* TTT */
/* Now add the box to the box_has table for this window */
if (gPageBeingParsed->box_hash == NULL) {
gPageBeingParsed->box_hash = (HashTable *) halloc(sizeof(HashTable),
"Box Hash");
hashInit(
gPageBeingParsed->box_hash,
BoxHashSize,
(EqualFunction) stringEqual,
(HashcodeFunction) stringHash);
}
hashInsert(gPageBeingParsed->box_hash, (char *)box, box->name);
/* reset the curr_node and then return */
curr_node = input_box;
gStringValueOk = 1;
return;
}
\end{chunk}
\subsection{addBoxToRbList}
\index{hypertex!addBoxToRbList}
\index{addBoxToRbList hypertex}
\begin{chunk}{hypertex}
static void addBoxToRbList(char *name,InputBox *box) {
RadioBoxes *trace = gPageBeingParsed->radio_boxes;
InputBox *list;
/*int found = 0;*/
while (trace != NULL && strcmp(trace->name, name))
trace = trace->next;
if (!trace) {
fprintf(stderr, "Tried to add a radio box to a non-existent group %s\n",
name);
printPageAndFilename();
jump();
}
/* now add the box to the list */
list = trace->boxes;
box->next = list;
trace->boxes = box;
if (box->picked && checkOthers(box->next)) {
fprintf(stderr, "Only a single radio button can be picked\n");
printPageAndFilename();
box->picked = 0;
}
box->selected = trace->selected;
box->unselected = trace->unselected;
box->rbs = trace;
return;
}
\end{chunk}
\subsection{checkOthers}
\index{hypertex!checkOthers}
\index{checkOthers hypertex}
\begin{chunk}{hypertex}
static int checkOthers(InputBox *list) {
InputBox *trace = list;
while (trace != NULL && !trace->picked)
trace = trace->next;
if (trace != NULL)
return 1;
else
return 0;
}
\end{chunk}
\subsection{insertItem}
Inserts an item into the current input list.
\index{hypertex!insertItem}
\index{insertItem hypertex}
\begin{chunk}{hypertex}
static void insertItem(InputItem *item) {
InputItem *trace = gPageBeingParsed->input_list;
if (gPageBeingParsed->currentItem == NULL) {
gPageBeingParsed->currentItem = item;
}
if (trace == NULL) {
/** Insert at the front of the list **/
gPageBeingParsed->input_list = item;
return;
}
else {
/** find the end of the list **/
while (trace->next != NULL)
trace = trace->next;
trace->next = item;
return;
}
}
\end{chunk}
\subsection{initPasteItem}
{hypertex!initPasteItem}
\index{initPasteItem hypertex}
\begin{chunk}{hypertex}
void initPasteItem(InputItem *item) {
InputItem *trace = gPageBeingParsed->input_list;
if (!item) {
gPageBeingParsed->input_list = NULL;
gPageBeingParsed->currentItem = NULL;
save_item = NULL;
}
else {
save_item = item->next;
trace->next = NULL;
}
}
\end{chunk}
\subsection{repasteItem}
\index{hypertex!repasteItem}
\index{repasteItem hypertex}
\begin{chunk}{hypertex}
void repasteItem(void) {
InputItem *trace;
if (save_item) {
for (trace = gPageBeingParsed->input_list; trace && trace->next != NULL;
trace = trace->next);
if (trace) {
trace->next = save_item;
}
else {
gWindow->page->input_list = save_item;
gWindow->page->currentItem = save_item;
}
}
save_item = NULL;
}
\end{chunk}
\subsection{currentItem}
\index{hypertex!currentItem}
\index{currentItem hypertex}
\begin{chunk}{hypertex}
InputItem *currentItem(void) {
InputItem *trace = gPageBeingParsed->input_list;
if (trace) {
for (; trace->next != NULL; trace = trace->next);
return trace;
}
else
return NULL;
}
\end{chunk}
\subsection{alreadyThere}
\index{hypertex!alreadyThere}
\index{alreadyThere hypertex}
\begin{chunk}{hypertex}
int alreadyThere(char *name) {
RadioBoxes *trace = gPageBeingParsed->radio_boxes;
while (trace && strcmp(trace->name, name))
trace = trace->next;
if (trace)
return 1;
else
return 0;
}
\end{chunk}
\subsection{parseRadioboxes}
\index{hypertex!parseRadioboxes}
\index{parseRadioboxes hypertex}
\begin{chunk}{hypertex}
void parseRadioboxes(void) {
TextNode *return_node = curr_node;
RadioBoxes *newrb;
char *fname;
/* I really don't need this node, it just sets up some parsing stuff */
return_node->type = Noop;
newrb = allocRbs();
getToken();
if (token.type != Lbrace) {
tokenName(token.type);
fprintf(stderr, "\\radioboxes was expecting a name not %s\n", ebuffer);
printPageAndFilename();
jump();
}
newrb->name = allocString(getInputString());
/* quick search for the name in the current list */
if (alreadyThere(newrb->name)) {
free(newrb->name);
free(newrb);
fprintf(stderr, "Tried to redefine radioboxes %s\n", newrb->name);
printPageAndFilename();
jump();
}
/* now I have to get the selected and unslected bitmaps */
getToken();
if (token.type != Lbrace) {
tokenName(token.type);
fprintf(stderr, "\\radioboxes was expecting a name not %s\n", ebuffer);
printPageAndFilename();
jump();
}
fname = getInputString();
if (!make_input_file)
newrb->selected = insertImageStruct(fname);
getToken();
if (token.type != Lbrace) {
tokenName(token.type);
fprintf(stderr, "\\radioboxes was expecting a name not %s\n", ebuffer);
printPageAndFilename();
jump();
}
fname = getInputString();
if (!make_input_file) {
newrb->unselected = insertImageStruct(fname);
newrb->height = max(newrb->selected->height, newrb->unselected->height);
newrb->width = max(newrb->selected->width, newrb->unselected->width);
/* now add the thing to the current list of radio boxes */
}
newrb->next = gPageBeingParsed->radio_boxes;
gPageBeingParsed->radio_boxes = newrb;
curr_node = return_node;
return;
}
\end{chunk}
\section{Routines for paste-in areas}
\subsection{parsePaste}
\index{hypertex!parsePaste}
\index{parsePaste hypertex}
\begin{chunk}{hypertex}
void parsePaste(void) {
TextNode *pn = curr_node;
PasteNode *paste;
int where;
if (gParserRegion != Scrolling) {
fprintf(stderr,
"(HyperDoc) Paste areas are only allowed in the scrolling area:");
printPageAndFilename();
jump();
}
gInPaste++;
/* now I need to get the name */
getToken();
if (token.type != Lbrace) {
fprintf(stderr, "(HyperDoc) A paste area needs a name:\n");
printNextTenTokens();
printPageAndFilename();
jump();
}
pn->data.text = allocString(getInputString());
pn->type = Paste;
/*
* now see if there is already an entry in the hash_table for this thing,
* if not create it and put it there.
*/
paste = (PasteNode *) hashFind(gWindow->fPasteHashTable, pn->data.text);
if (paste == 0) {
paste = allocPasteNode(pn->data.text);
hashInsert(gWindow->fPasteHashTable, (char *)paste, paste->name);
}
else if (paste->haspaste) {
fprintf(stderr,
"(HyperDoc) Tried to redefine paste area %s\n", paste->name);
printPageAndFilename();
/* jump(); */
}
paste->haspaste = 1;
paste->paste_item = currentItem();
getToken();
if (token.type == Lsquarebrace) {
/* user wishes to specify a where to send the command */
where = getWhere();
if (where == -1) {
paste->where = -1;
fprintf(stderr,
"(HyperDoc) \\begin{paste} was expecting [lisp|unix|ht]\n");
printNextTenTokens();
printPageAndFilename();
jump();
}
else
paste->where = where;
getToken();
}
else
paste->where = FromFile;
/* now try to get the command argument or page name */
if (token.type != Lbrace) {
paste->where = 0;
fprintf(stderr,
"(HyperDoc) \\begin{paste} was expecting an argument\n");
printNextTenTokens();
printPageAndFilename();
jump();
}
paste->arg_node = allocNode();
curr_node = paste->arg_node;
parseHyperDoc();
curr_node->type = Endarg;
gWindow->fDisplayedWindow = gWindow->fScrollWindow;
/* Now try to find the displaying text */
pn->next = allocNode();
curr_node = pn->next;
parseHyperDoc();
curr_node->type = Endpaste;
paste->end_node = curr_node;
paste->begin_node = pn;
gInPaste--;
}
\end{chunk}
\subsection{parsePastebutton}
\index{hypertex!parsePastebutton}
\index{parsePastebutton hypertex}
\begin{chunk}{hypertex}
void parsePastebutton(void) {
PasteNode *paste;
TextNode *pb;
/*
* this routine parse a \pastebutton expression. The syntax is
* \pastebutton{name}
*/
pb = curr_node;
pb->type = Pastebutton;
/* first thing I should do is get the name */
getToken();
if (token.type != Lbrace) {
fprintf(stderr, "(HyperDoc) \\pastebutton needs a name\n");
printPageAndFilename();
printNextTenTokens();
jump();
}
pb->data.text = allocString(getInputString());
/*
* now I should see if the paste area has already been parsed, and if not
* I should create a spot in the hash table for it
*/
paste = (PasteNode *) hashFind(gWindow->fPasteHashTable, pb->data.text);
if (paste == 0) {
paste = allocPasteNode(pb->data.text);
hashInsert(gWindow->fPasteHashTable,(char *) paste, paste->name);
}
else if (paste->hasbutton) {
fprintf(stderr,
"(HyperDoc) Tried to redefine paste area %s\n", paste->name);
printPageAndFilename();
/* jump(); */
}
paste->hasbutton = 1;
/* Now we need to parse the HyperDoc and for the displayed text */
getToken();
if (token.type != Lbrace) {
fprintf(stderr, "(HyperDoc) \\pastebutton was expecting a { \n");
printPageAndFilename();
printNextTenTokens();
jump();
}
pb->next = allocNode();
curr_node = pb->next;
parseHyperDoc();
curr_node->type = Endpastebutton;
/* once that is done I need only make the window for this link */
pb->link = makePasteWindow(paste);
}
\end{chunk}
\subsection{parsePatch}
This routine is responsible for parsing a patch from a file. To do this I
guess er will initScanner, then parse, the parsed piece of text
will replace the current PasteNode which will be squashed down to
nothing, and then discarded.
\index{hypertex!parsePatch}
\index{parsePatch hypertex}
\begin{chunk}{hypertex}
HyperDocPage *parsePatch(PasteNode *paste) {
TextNode *new;
TextNode *end_node;
TextNode *begin_node;
TextNode *arg_node;
TextNode *throw;
TextNode *next_node;
InputItem *paste_item = paste->paste_item;
int where = paste->where;
GroupItem *g = paste->group;
ItemStack *is = paste->item_stack;
PatchStore *patch;
char *patch_name;
int ret_value = 1;
/* prepare to throw away the current paste node */
end_node = paste->end_node;
next_node = end_node->next;
begin_node = paste->begin_node;
arg_node = paste->arg_node;
throw = begin_node->next;
/* now read the new stuff and add it in between all this stuff */
switch (where) {
case FromFile:
patch_name = printToString(arg_node);
patch = (PatchStore *) hashFind(gWindow->fPatchHashTable, patch_name);
if (!patch) {
fprintf(stderr, "(HyperDoc) Unknown patch name %s\n", patch_name);
BeepAtTheUser();
return 0;
}
if (!patch->loaded)
loadPatch(patch);
inputType = FromString;
inputString = patch->string;
break;
case FromSpadSocket:
inputType = FromSpadSocket;
ret_value = issueServerpaste(arg_node);
if (ret_value < 0) {
paste->where = where;
paste->end_node = end_node;
paste->arg_node = arg_node;
paste->group = g;
paste->item_stack = is;
paste->haspaste = 1;
return 0;
}
break;
case FromUnixFD:
inputType = FromUnixFD;
issueUnixpaste(arg_node);
break;
default:
fprintf(stderr, "(HyperDoc) \\parsebutton error: Unknown where\n");
exit(-1);
break;
}
paste->where = 0;
paste->end_node = paste->arg_node = paste->begin_node = 0;
paste->group = 0;
paste->item_stack = 0;
paste->haspaste = 0;
paste->paste_item = 0;
/* set the jump buffer in case it is needed */
if (setjmp(jmpbuf)) {
/*** OOOPS, an error occurred ****/
fprintf(stderr, "(HyperDoc) Had an error parsing a patch: Goodbye!\n");
exit(-1);
}
end_node->next = 0;
freeNode(throw, 1);
initParsePatch(gWindow->page);
initPasteItem(paste_item);
getToken();
if (token.type != Patch) {
fprintf(stderr, "(HyperDoc) Pastebutton %s was expecting a patch\n",
paste->name);
jump();
}
if (inputType == FromString) {
getToken();
if (token.type != Lbrace) {
tokenName(token.type);
fprintf(stderr, "(HyperDoc) Unexpected %s \n", ebuffer);
printPageAndFilename();
jump();
}
getToken();
if (token.type != Word) {
tokenName(token.type);
fprintf(stderr, "(HyperDoc) Unexpected %s \n", ebuffer);
printPageAndFilename();
jump();
}
getToken();
if (token.type != Rbrace) {
tokenName(token.type);
fprintf(stderr, "(HyperDoc) Unexpected %s \n", ebuffer);
printPageAndFilename();
jump();
}
}
new = allocNode();
curr_node = new;
parseHyperDoc();
/* Once I am back, I need only reallign all the text structures */
curr_node->type = Noop;
curr_node->next = next_node;
begin_node->next = new;
begin_node->type = Noop;
free(begin_node->data.text);
begin_node->data.text = 0;
gWindow->fDisplayedWindow = gWindow->fScrollWindow;
repasteItem();
pastePage(begin_node);
/* so now I should just be able to disappear */
return gWindow->page;
}
\end{chunk}
\subsection{loadPatch}
\index{hypertex!loadPatch}
\index{loadPatch hypertex}
\begin{chunk}{hypertex}
static void loadPatch(PatchStore *patch) {
long start_fpos;
int size = 0;
int limsize;
char *trace;
saveScannerState();
cfile = findFp(patch->fpos);
initScanner();
/** First thing I should do is make sure that the name is correct ***/
start_fpos = fpos;
getExpectedToken(Patch);
getExpectedToken(Lbrace);
getExpectedToken(Word);
if (strcmp(token.id, patch->name)) {
/** WOW, Somehow I had the location of the wrong macro **/
fprintf(stderr,
"(HyperDoc) Expected patch name %s: got instead %s in loadPatch\n",
patch->name, token.id);
jump();
}
getExpectedToken(Rbrace);
scanHyperDoc();
fseek(cfile, patch->fpos.pos + start_fpos, 0);
limsize = fpos - start_fpos + 1;
patch->string =
(char *) halloc((limsize + 1) * sizeof(char), "Patch String");
for (size = 1, trace = patch->string; size < limsize; size++)
*trace++ = getc(cfile);
*trace = '\0';
patch->loaded = 1;
restoreScannerState();
}
\end{chunk}
\section{parsing routines for node types}
\subsection{parseIfcond}
\index{hypertex!parseIfcond}
\index{parseIfcond hypertex}
\begin{chunk}{hypertex}
void parseIfcond(void) {
TextNode *ifnode = curr_node;
TextNode *endif;
TextNode *condnode;
/*
* parse a conditional. At first I am just going to parse if
* <hypertext> fi
*/
if (gInIf) {
curr_node->type = Noop;
fprintf(stderr, "\\if found within \\if \n");
longjmp(jmpbuf, 1);
fprintf(stderr, "Longjump failed, Exiting\n");
exit(-1);
}
gInIf++;
curr_node->type = Ifcond;
curr_node->space = token.id[-1];
curr_node->data.ifnode = allocIfnode();
/* Now get the cond node I hope */
condnode = curr_node->data.ifnode->cond = allocNode();
curr_node = condnode;
parseCondnode();
endif = allocNode();
endif->type = Endif;
ifnode->data.ifnode->thennode = allocNode();
curr_node = ifnode->data.ifnode->thennode;
parseHyperDoc();
if (token.type == Fi) {
curr_node->type = Fi;
curr_node->next = endif;
ifnode->data.ifnode->elsenode = endif;
}
else if (token.type == Else) {
/* first finish up the then part */
curr_node->type = Fi;
curr_node->next = endif;
/* the go and parse the else part */
ifnode->data.ifnode->elsenode = allocNode();
curr_node = ifnode->data.ifnode->elsenode;
parseHyperDoc();
if (token.type != Fi) {
tokenName(token.type);
curr_node->type = Noop;
fprintf(stderr, "Expected a \\fi not a %s", ebuffer);
longjmp(jmpbuf, 1);
fprintf(stderr, "Longjump failed, Exiting\n");
exit(-1);
}
curr_node->type = Fi;
curr_node->next = endif;
}
else {
curr_node->type = Noop;
tokenName(token.type);
fprintf(stderr, "Expected a \\fi not a %s", ebuffer);
longjmp(jmpbuf, 1);
fprintf(stderr, "Longjump failed, Exiting\n");
exit(-1);
}
ifnode->next = ifnode->data.ifnode->thennode;
ifnode->width = -1; /* A flag for compute if extents */
curr_node = endif;
gInIf--;
}
\end{chunk}
\subsection{parseCondnode}
\index{hypertex!parseCondnode}
\index{parseCondnode hypertex}
\begin{chunk}{hypertex}
static void parseCondnode(void) {
getToken();
switch (token.type) {
case Cond:
curr_node->type = Cond;
curr_node->data.text = allocString(token.id);
break;
case Haslisp:
case Hasreturn:
case Lastwindow:
case Hasup:
curr_node->type = token.type;
break;
case Boxcond:
curr_node->type = Boxcond;
curr_node->data.text = allocString(token.id);
break;
case Hasreturnto:
parseHasreturnto();
break;
default:
{
char eb[128];
tokenName(token.type);
sprintf(eb, "Unexpected Token %s\n", eb);
tpderror(eb, HTCONDNODE);
}
break;
}
}
\end{chunk}
\subsection{parseHasreturnto}
\index{hypertex!parseHasreturnto}
\index{parseHasreturnto hypertex}
\begin{chunk}{hypertex}
static void parseHasreturnto(void) {
TextNode *hrt = curr_node, *arg_node = allocNode();
curr_node->type = Hasreturnto;
curr_node = arg_node;
getExpectedToken(Lbrace);
parseHyperDoc();
curr_node->type = Endarg;
hrt->data.node = arg_node;
curr_node = hrt;
}
\end{chunk}
\subsection{parseNewcond}
\index{hypertex!parseNewcond}
\index{parseNewcond hypertex}
\begin{chunk}{hypertex}
void parseNewcond(void) {
char label[256];
getExpectedToken(Lbrace);
getExpectedToken(Unkeyword);
strcpy(label, token.id);
getExpectedToken(Rbrace);
insertCond(label, "0");
curr_node->type = Noop;
}
\end{chunk}
\subsection{parseSetcond}
\index{hypertex!parseSetcond}
\index{parseSetcond hypertex}
\begin{chunk}{hypertex}
void parseSetcond(void) {
char label[256], cond[256];
getExpectedToken(Lbrace);
getExpectedToken(Cond);
strcpy(label, token.id);
getExpectedToken(Rbrace);
getExpectedToken(Lbrace);
getExpectedToken(Word);
strcpy(cond, token.id);
getExpectedToken(Rbrace);
changeCond(label, cond);
curr_node->type = Noop;
}
\end{chunk}
\subsection{parseBeginItems}
\index{hypertex!parseBeginItems}
\index{parseBeginItems hypertex}
\begin{chunk}{hypertex}
void parseBeginItems(void) {
TextNode *bi = curr_node;
/*
* This procedure parses a begin item. It sets the current
* node and sees if there is an optional argument for the itemspace
*/
bi->type = token.type;
getToken();
if (token.type == Lsquarebrace) {
bi->data.node = allocNode();
curr_node = bi->data.node;
gInOptional++;
parseHyperDoc();
gInOptional--;
curr_node->type = Enddescription;
if (token.type != Rsquarebrace) {
fprintf(stderr, "(HyperDoc) Optional arguments must end with ].\n");
printNextTenTokens();
printPageAndFilename();
jump();
}
curr_node = bi;
}
else
ungetToken();
gInItems++;
}
\end{chunk}
\subsection{parseItem}
\index{hypertex!parseItem}
\index{parseItem hypertex}
\begin{chunk}{hypertex}
void parseItem(void) {
if (!gInItems) {
fprintf(stderr, "\\item found outside an items environment\n");
printPageAndFilename();
printNextTenTokens();
jump();
}
curr_node->type = Item;
getToken();
if (token.type == Lsquarebrace) {
/* I should parse the optional argument */
curr_node->next = allocNode();
curr_node = curr_node->next;
curr_node->type = Description;
curr_node->next = allocNode();
curr_node = curr_node->next;
gInOptional++;
parseHyperDoc();
gInOptional--;
curr_node->type = Enddescription;
if (token.type != Rsquarebrace) {
fprintf(stderr, "(HyperDoc) Optional arguments must end with ].\n");
printNextTenTokens();
printPageAndFilename();
jump();
}
}
else {
ungetToken();
}
}
\end{chunk}
\subsection{parseMitem}
\index{hypertex!parseMitem}
\index{parseMitem hypertex}
\begin{chunk}{hypertex}
void parseMitem(void) {
if (!gInItems) {
fprintf(stderr, "\\mitem found outside an items environment\n");
printPageAndFilename();
printNextTenTokens();
jump();
}
curr_node->type = Mitem;
}
\end{chunk}
\subsection{parseVerbatim}
\index{hypertex!parseVerbatim}
\index{parseVerbatim hypertex}
\begin{chunk}{hypertex}
void parseVerbatim(int type) {
int size = 0, c;
char *end_string, *vb = vbuf, *es;
curr_node->type = type;
if (token.id[-1])
curr_node->space = 1;
if (type == Spadsrctxt) {
es = end_string = "\n\\end{spadsrc}";
}
else if (type == Math)
es = end_string = "$";
else
es = end_string = "\\end{verbatim}";
while ((c = getChar()) != EOF) {
resizeVbuf();
size++;
if (c == '\n') {
new_verb_node();
continue;
}
*vb++ = c;
if (*es++ != c)
es = end_string;
if (!*es)
break;
}
if (c == EOF) {
fprintf(stderr, "parseVerbatim: Unexpected EOF found\n");
longjmp(jmpbuf, 1);
}
resizeVbuf();
if (*end_string == '\n')
es = end_string + 1;
else
es = end_string;
vbuf[size - strlen(es)] = '\0';
if (*vbuf) {
curr_node->data.text = allocString(vbuf);
curr_node->next = allocNode();
curr_node = curr_node->next;
}
if (type == Spadsrctxt)
curr_node->type = Endspadsrc;
else if (type == Math)
curr_node->type = Endmath;
else
curr_node->type = Endverbatim;
}
\end{chunk}
\subsection{parseInputPix}
\index{hypertex!parseInputPix}
\index{parseInputPix hypertex}
\begin{chunk}{hypertex}
void parseInputPix(void) {
TextNode *pixnode;
char *filename;
pixnode = curr_node;
pixnode->type = token.type;
pixnode->space = token.id[-1];
pixnode->width = -1;
getExpectedToken(Lbrace);
filename = getInputString();
pixnode->data.text = allocString(filename);
curr_node = pixnode;
if (pixnode->type == Inputimage) {
char f[256];
char *p;
if ((gXDisplay && DisplayPlanes(gXDisplay, gXScreenNumber) == 1) ||
gSwitch_to_mono ==1) {
pixnode->type = Inputbitmap;
strcpy(f, pixnode->data.text);
strcat(f, ".bm");
p=pixnode->data.text;
pixnode->data.text = allocString(f);
free(p);
}
else {
pixnode->type = Inputpixmap;
strcpy(f, pixnode->data.text);
strcat(f, ".xpm");
p=pixnode->data.text;
pixnode->data.text = allocString(f);
free(p);
}
}
}
\end{chunk}
\subsection{parseCenterline}
\index{hypertex!parseCenterline}
\index{parseCenterline hypertex}
\begin{chunk}{hypertex}
void parseCenterline(void) {
curr_node->type = token.type;
curr_node->space = token.id[-1];
curr_node->width = -1;
curr_node->next = allocNode();
curr_node = curr_node->next;
getExpectedToken(Lbrace);
parseHyperDoc();
if (token.type != Rbrace) {
curr_node->type = Noop;
fprintf(stderr, "(HyperdDoc) \\centerline was expecting a }\n");
printPageAndFilename();
printNextTenTokens();
longjmp(jmpbuf, 1);
}
curr_node->type = Endcenter;
}
\end{chunk}
\subsection{parseCommand}
\index{hypertex!parseCommand}
\index{parseCommand hypertex}
\begin{chunk}{hypertex}
void parseCommand(void) {
TextNode *link_node, *save_node, *arg_node;
gInButton++;
if (gParserMode == SimpleMode) {
curr_node->type = Noop;
fprintf(stderr, "Parser Error token %s unexpected\n",
token_table[token.type]);
longjmp(jmpbuf, 1);
}
gStringValueOk = 1;
/* set the values for the current node */
curr_node->type = token.type;
curr_node->space = token.id[-1];
/* now parse for the label */
link_node = curr_node;
curr_node->next = allocNode();
curr_node = curr_node->next;
getExpectedToken(Lbrace);
parseHyperDoc();
curr_node->type = Endbutton;
save_node = curr_node;
arg_node = allocNode();
curr_node = arg_node;
getExpectedToken(Lbrace);
parseHyperDoc();
curr_node->type = Endarg;
link_node->link = makeLinkWindow(arg_node, link_node->type, 0);
gStringValueOk = 0;
curr_node = save_node;
gInButton--;
}
\end{chunk}
\subsection{parseButton}
\index{hypertex!parseButton}
\index{parseButton hypertex}
\begin{chunk}{hypertex}
void parseButton(void) {
TextNode *link_node, *save_node;
gInButton++;
if (gParserMode == SimpleMode) {
curr_node->type = Noop;
fprintf(stderr, "Parser Error token %s unexpected\n",
token_table[token.type]);
longjmp(jmpbuf, 1);
}
/* fill the node */
curr_node->type = token.type;
curr_node->space = token.id[-1];
/* the save the current node for creating the link and stuff */
link_node = curr_node;
/* then parse the label */
curr_node->next = allocNode();
curr_node = curr_node->next;
getExpectedToken(Lbrace);
parseHyperDoc();
curr_node->type = Endbutton;
/* now try to get the argument node */
save_node = curr_node;
getExpectedToken(Lbrace);
save_node->data.node = allocNode();
curr_node = save_node->data.node;
parseHyperDoc();
curr_node->type = Endarg;
/*
* buffer[0] = '\0'; printToString(arg_node, buffer + 1);
*/
link_node->link =
makeLinkWindow(save_node->data.node, link_node->type, 0);
curr_node = save_node;
gInButton--;
}
\end{chunk}
\subsection{parseSpadcommand}
\index{hypertex!parseSpadcommand}
\index{parseSpadcommand hypertex}
\begin{chunk}{hypertex}
void parseSpadcommand(TextNode *spad_node) {
example_number++;
gInButton++;
spad_node->type = token.type;
spad_node->space = token.id[-1];
getExpectedToken(Lbrace);
cur_spadcom = curr_node;
spad_node->next = allocNode();
curr_node = spad_node->next;
parseHyperDoc();
curr_node->type = Endspadcommand;
cur_spadcom = NULL;
spad_node->link = makeLinkWindow(spad_node->next, spad_node->type, 1);
gInButton--;
}
\end{chunk}
\subsection{parseSpadsrc}
\index{hypertex!parseSpadsrc}
\index{parseSpadsrc hypertex}
\begin{chunk}{hypertex}
void parseSpadsrc(TextNode *spad_node) {
char buf[512], *c = buf;
int ch, start_opts = 0;
/*TextNode *node = NULL;*/
example_number++;
gInButton++;
gInSpadsrc++;
spad_node->type = Spadsrc;
spad_node->space = token.id[-1];
cur_spadcom = curr_node;
spad_node->next = allocNode();
curr_node = spad_node->next;
do {
ch = getChar();
if (ch == ']')
start_opts = 0;
if (start_opts)
*c++ = ch;
if (ch == '[')
start_opts = 1;
} while (ch != '\n');
*c = '\0';
parseVerbatim(Spadsrctxt);
parseFromString(buf);
curr_node->type = Endspadsrc;
cur_spadcom = NULL;
spad_node->link = makeLinkWindow(spad_node->next, Spadsrc, 1);
gInButton--;
gInSpadsrc--;
}
\end{chunk}
\subsection{parseEnv}
\index{hypertex!parseEnv}
\index{parseEnv hypertex}
\begin{chunk}{hypertex}
void parseEnv(TextNode *node) {
char *env;
char buff[256];
char *buff_pntr = &buff[1];
int noEnv = 0;
getExpectedToken(Lbrace);
getExpectedToken(Word);
env = getenv(token.id);
if (env == NULL) {
/** The environment variable was not found **/
fprintf(stderr,
"(HyperDoc) Warning: environment variable \'%s\' was not found.\n",
token.id);
env = halloc(1, "string");
env[0] = '\0';
noEnv = 1;
}
buff[0] = token.id[-1];
strcpy(buff_pntr, env);
if (noEnv)
free(env);
node->data.text = allocString(buff_pntr);
node->type = Word;
getExpectedToken(Rbrace);
}
\end{chunk}
\subsection{parseValue1}
This parseValue routine accepts an empty \verb|{}| but makes it a zero
instead of a one. Thus \verb|\indent{}| is equivelant to \verb|\indent{0}|.
\index{hypertex!parseValue1}
\index{parseValue1 hypertex}
\begin{chunk}{hypertex}
void parseValue1(void) {
TextNode *value_node, *ocn = curr_node;
char *s;
curr_node->type = token.type;
curr_node->space = token.id[-1];
value_node = allocNode();
value_node->type = Word;
curr_node->data.node = value_node;
getExpectedToken(Lbrace);
s = getInputString();
if (!isNumber(s)) {
fprintf(stderr,
"Parser Error: parse for value was expecting a numeric value\n");
strcpy(value_node->data.text, "0");
}
else {
value_node->data.text = allocString(s);
}
curr_node = ocn;
}
\end{chunk}
\subsection{parseValue2}
This command accepts an empty argument command. Thus \verb|\space{}| is
equivelant \verb|\space{1}|
\index{hypertex!parseValue2}
\index{parseValue2 hypertex}
\begin{chunk}{hypertex}
void parseValue2(void) {
TextNode *value_node, *ocn = curr_node;
char *s;
curr_node->type = token.type;
curr_node->space = token.id[-1];
value_node = allocNode();
value_node->type = Word;
curr_node->data.node = value_node;
getExpectedToken(Lbrace);
s = getInputString();
if (!isNumber(s)) {
fprintf(stderr,
"Parser Error: parse for value was expecting a numeric value\n");
strcpy(value_node->data.text, "1");
}
else {
value_node->data.text = allocString(s);
}
curr_node = ocn;
}
\end{chunk}
\subsection{parseTable}
Parse a \verb|\table| command.
\index{hypertex!parseTable}
\index{parseTable hypertex}
\begin{chunk}{hypertex}
void parseTable(void) {
TextNode *tn = curr_node;
if (gParserMode != AllMode) {
curr_node->type = Noop;
fprintf(stderr, "Parser Error token %s unexpected\n",
token_table[token.type]);
longjmp(jmpbuf, 1);
}
curr_node->type = Table;
getExpectedToken(Lbrace);
curr_node->next = allocNode();
curr_node = curr_node->next;
getToken();
if (token.type == Lbrace) {
while (token.type != Rbrace) {
curr_node->type = Tableitem;
curr_node->next = allocNode();
curr_node = curr_node->next;
parseHyperDoc();
curr_node->type = Endtableitem;
curr_node->next = allocNode();
curr_node = curr_node->next;
getToken();
}
curr_node->type = Endtable;
}
else { /* a patch for SG for empty tables */
if (token.type != Rbrace) {
tokenName(token.type);
fprintf(stderr,
"Unexpected Token %s found while parsing a table\n",
ebuffer);
printPageAndFilename();
jump();
}
tn->type = Noop;
tn->next = NULL;
free(curr_node);
curr_node = tn;
}
}
\end{chunk}
\subsection{parseBox}
\index{hypertex!parseBox}
\index{parseBox hypertex}
\begin{chunk}{hypertex}
void parseBox(void) {
curr_node->type = token.type;
curr_node->space = token.id[-1];
curr_node->width = -1;
curr_node->next = allocNode();
curr_node = curr_node->next;
getExpectedToken(Lbrace);
parseHyperDoc();
curr_node->type = Endbox;
}
\end{chunk}
\subsection{parseMbox}
\index{hypertex!parseMbox}
\index{parseMbox hypertex}
\begin{chunk}{hypertex}
void parseMbox(void) {
curr_node->type = token.type;
curr_node->space = token.id[-1];
curr_node->width = -1;
curr_node->next = allocNode();
curr_node = curr_node->next;
getExpectedToken(Lbrace);
parseHyperDoc();
curr_node->type = Endbox;
}
\end{chunk}
\subsection{parseFree}
\index{hypertex!parseFree}
\index{parseFree hypertex}
\begin{chunk}{hypertex}
void parseFree(void) {
TextNode *freeNode = curr_node;
curr_node->type = token.type;
curr_node->space = token.id[-1];
curr_node->width = -1;
curr_node->data.node = allocNode();
curr_node = curr_node->data.node;
getExpectedToken(Lbrace);
parseHyperDoc();
curr_node->type = Endarg;
curr_node = freeNode;
}
\end{chunk}
\subsection{parseHelp}
\index{hypertex!parseHelp}
\index{parseHelp hypertex}
\begin{chunk}{hypertex}
void parseHelp(void) {
curr_node->type = Noop;
getToken();
if (token.type != Lbrace) {
tokenName(token.type);
fprintf(stderr,"\\helppage was expecting a { and not a %s\n", ebuffer);
printPageAndFilename();
jump();
}
/* before we clobber this pointer we better free the contents
(cf. allocPage) */
free(gPageBeingParsed->helppage);
gPageBeingParsed->helppage = allocString(getInputString());
if (token.type != Rbrace) {
tokenName(token.type);
fprintf(stderr, "\\helppage was expecting a } and not a %s\n",
ebuffer);
printPageAndFilename();
jump();
}
}
\end{chunk}
\section{Reading bitmaps}
\subsection{HTReadBitmapFile}
This file was produced by J.M. Wiley with some help from the bitmap editor
routine. It reads in a bitmap file, and calls XCreatePixmapFromBitmapData
to transform it into a Pixmap. He did this because the routine
XReadBitmapFile does not seeem to work too well (whatever that means).
\index{hypertex!HTReadBitmapFile}
\index{HTReadBitmapFile hypertex}
\begin{chunk}{hypertex}
XImage *HTReadBitmapFile(Display *display,int screen,char * filename,
int *width, int *height) {
XImage *image;
FILE *fd;
char Line[256], Buff[256];
int num_chars;
char *ptr;
int rch;
int version;
int padding, chars_line, file_chars_line, file_chars;
int bytes;
int x_hot, y_hot;
image = XCreateImage(display, DefaultVisual(display, screen), 1,
XYBitmap, 0, NULL, 0, 0, 8, 0);
(image)->byte_order = LSBFirst; /* byte_order */
(image)->bitmap_unit = 8; /* bitmap-unit */
(image)->bitmap_bit_order = LSBFirst; /* bitmap-bit-order */
if (!(fd = zzopen(filename, "r"))) {
fprintf(stderr, "ReadBitmapFile: File >%s< not found\n", filename);
exit(-1);
}
/*
* Once it is open, lets get the width and height
*/
if ((readWandH(fd,(unsigned int *)width,(unsigned int *) height)) < 0) {
fprintf(stderr, "ReadBitmapFile: Bad file format in %s\n", filename);
exit(-1);
}
/*
* Now get the next line, and see if it is hot spots or bits
*/
if (fgets(Line, MAXLINE, fd) == NULL) {
fprintf(stderr, "ReadBitmapFile: Bad file format in %s\n", filename);
exit(-1);
}
/*
* Now check the first character to see if it is a # or an s
*/
if (Line[0] == '#') {
if ((readHot(fd, Line, &x_hot, &y_hot)) < 0) {
fprintf(stderr, "ReadBitmapFile: Bad file format in %s\n", filename);
exit(-1);
}
}
(image)->width = *width;
(image)->height = *height;
/*
* figure out what version
*/
if (sscanf(Line, "static short %s = {", Buff) == 1)
version = 10;
else if (sscanf(Line, "static unsigned char %s = {", Buff) == 1)
version = 11;
else if (sscanf(Line, "static char %s = {", Buff) == 1)
version = 11;
else {
fprintf(stderr, "ReadBitmapFile: Bad file format in %s\n", filename);
exit(-1);
}
padding = 0;
if ((*width % 16) && ((*width % 16) < 9) && (version == 10))
padding = 1;
(image)->bytes_per_line = chars_line = (*width + 7) / 8;
file_chars_line = chars_line + padding;
num_chars = chars_line * (*height);
file_chars = file_chars_line * (*height);
(image)->data = (char *) halloc((image)->bytes_per_line * (image)->height,
"Read Pixmap--Image data");
/*
* Since we are just holding the first line of the declaration, we can
* just start reading from fd
*/
if (version == 10)
for (bytes = 0, ptr = (image)->data; bytes < file_chars; (bytes += 2)) {
if (fscanf(fd, " 0x%x%*[,}]%*[ \n]", &rch) != 1) {
fprintf(stderr, "ReadBitmapFile: Bad file format in %s\n", filename);
exit(-1);
}
*(ptr++) = rch & 0xff;
if (!padding || ((bytes + 2) % file_chars_line))
*(ptr++) = rch >> 8;
}
else
for (bytes=0, ptr = (image)->data; bytes < file_chars; bytes++, ptr++) {
if (fscanf(fd, " 0x%x%*[,}]%*[ \n]", &rch) != 1) {
fprintf(stderr, "ReadBitmapFile: Bad file format in %s\n", filename);
exit(-1);
}
*ptr = rch;
}
fclose(fd);
return image;
}
\end{chunk}
\subsection{readHot}
\index{hypertex!readHot}
\index{readHot hypertex}
\begin{chunk}{hypertex}
static int readHot(FILE *fd,char Line[],int *x_hot,int *y_hot) {
char Buff[256];
/*
* Works much the same as get width and height, just new variables
*/
if (sscanf(Line, "#define %s %d", Buff, x_hot) != 2)
return -1;
if (fgets(Line, MAXLINE, fd) == NULL)
return -1;
if (sscanf(Line, "#define %s %d", Buff, y_hot) != 2)
return -1;
if (fgets(Line, MAXLINE, fd) == NULL)
return -1;
return 1;
}
\end{chunk}
\subsection{readWandH}
\index{hypertex!readWandH}
\index{readWandH hypertex}
\begin{chunk}{hypertex}
static int readWandH(FILE *fd,unsigned int *width,unsigned int *height) {
char Line[256], Buff[256];
if (fgets(Line, MAXLINE, fd) == NULL)
return -1;
/*
* Once we have the line, scan it for the width
*/
if (sscanf(Line, "#define %s %d", Buff, width) != 2)
return -1;
/*
* Hopefully we have the width, now get the height the same way
*/
if (fgets(Line, MAXLINE, fd) == NULL)
return -1;
/*
* Once we have the line, scan it for the height
*/
if (sscanf(Line, "#define %s %d", Buff, height) != 2)
return -1;
return 1;
}
\end{chunk}
\subsection{insertImageStruct}
Read a bitmap file into memory.
\index{hypertex!insertImageStruct}
\index{insertImageStruct hypertex}
\begin{chunk}{hypertex}
ImageStruct *insertImageStruct(char *filename) {
int bm_width, bm_height;
XImage *im;
ImageStruct *image;
if (*filename == ' ')
filename++;
if ((image=(ImageStruct *) hashFind(&gImageHashTable, filename)) == NULL) {
im = HTReadBitmapFile(gXDisplay, gXScreenNumber, filename,
&bm_width, &bm_height);
/*
* now add the image to the gImageHashTable
*/
image = (ImageStruct *) halloc(sizeof(ImageStruct), "ImageStruct");
image->image.xi = im;
image->width = image->image.xi->width;
image->height = image->image.xi->height;
image->filename = (char *) halloc(sizeof(char) * strlen(filename) +1,
"insert_image--filename");
/* strcpy(image->filename, filename); */
sprintf(image->filename, "%s", filename);
hashInsert(&gImageHashTable,(char *) image, image->filename);
}
return image;
}
\end{chunk}
\section{Scrollbar handling routines}
The scrollbar is displayed on the side of the HyperDoc display, if needed.
It is composed of four windows
\begin{itemize}
\item fScrollUpWindow -- the arrowed box at the top of the scrollbar.
Scrolls the window up a line at a time.
\item fScrollDownWindow -- Located at the bottom of the window,
it is used to scroll down a single line at a time.
\item scrollbar -- this is the window which does the variable scrolling.
It houses the actual scroller.
\item scroller -- This is the scroller inside the scroll bar.
\end{itemize}
The procedure below, makes all these windows, and also makes three bitmaps,
\begin{itemize}
\item sup -- The up arrow for the fScrollUpWindow.
\item sdown -- the down arrow for the fScrollDownWindow.
\item scroller -- the scroller stipple.
\end{itemize}
It then fills the window with the proper Pixmap background.
The scrollbar and scroller works as follows. The size of the scroller is
calculated as
\begin{verbatim}
size of scroller size of visible text
----------------- === ------------------------------ .
size of scrollbar size of whole scrolling region
\end{verbatim}
The top of the scroller shows the relative position in the page of
the top of the scrolling region. This way the user knows how far
down the page he or she has moved.
When the user clicks in the scrollbar, the center of the
scroller, if possible, is placed at the point of the click.
See the routines
\begin{itemize}
\item showScrollBars -- to see how the scroll bars are actually realized.
\item moveScroller -- to see how the scroller is moved when the user scrolls
\end{itemize}
\subsection{makeScrollBarWindows}
\index{hypertex!makeScrollBarWindows}
\index{makeScrollBarWindows hypertex}
\begin{chunk}{hypertex}
void makeScrollBarWindows(void) {
XSetWindowAttributes at;
at.cursor = gActiveCursor;
at.event_mask = ButtonPress;
/** create the bitmaps **/
if (supwidth != sdown_width || supheight != sdown_height) {
fprintf(stderr,
"Scrollbar error, up and down pointers must have the same dimensions\n");
exit(-1);
}
if (sup == 0)
sup =
XCreatePixmapFromBitmapData(gXDisplay,
RootWindow(gXDisplay, gXScreenNumber), sup_bits, supwidth, supheight,
FORECOLOR, BACKCOLOR, DefaultDepth(gXDisplay, gXScreenNumber));
if (sdown == 0)
sdown =
XCreatePixmapFromBitmapData(gXDisplay,
RootWindow(gXDisplay, gXScreenNumber), sdown_bits, sdown_width,
sdown_height, FORECOLOR, BACKCOLOR,
DefaultDepth(gXDisplay, gXScreenNumber));
sup_pressed =
XCreatePixmapFromBitmapData(gXDisplay,
RootWindow(gXDisplay, gXScreenNumber), sup3dpr_bits, sup3dpr_width,
sup3dpr_height, FORECOLOR, BACKCOLOR,
DefaultDepth(gXDisplay, gXScreenNumber));
sdown_pressed =
XCreatePixmapFromBitmapData(gXDisplay,
RootWindow(gXDisplay, gXScreenNumber), sdown3dpr_bits,
sdown3dpr_width, sdown3dpr_height, FORECOLOR, BACKCOLOR,
DefaultDepth(gXDisplay, gXScreenNumber));
gWindow->fScrollUpWindow =
XCreateSimpleWindow(gXDisplay, gWindow->fMainWindow, 1, 1, supwidth,
supheight, gWindow->border_width, gBorderColor, BACKCOLOR);
gWindow->fScrollDownWindow =
XCreateSimpleWindow(gXDisplay, gWindow->fMainWindow, 1, 1, sdown_width,
sdown_height, gWindow->border_width, gBorderColor, BACKCOLOR);
gWindow->scrollbar =
XCreateSimpleWindow(gXDisplay, gWindow->fMainWindow, 1, 1, 1, 1,
gWindow->border_width, gBorderColor, BACKCOLOR);
gWindow->scroller =
XCreateSimpleWindow(gXDisplay, gWindow->scrollbar, 1, 1, 1, 1, 0,
gBorderColor, BACKCOLOR);
#ifdef DEBUG
fprintf(stderr, "Changing Window Attributes in scrollbar.c #2\n");
#endif
at.background_pixmap = sup;
XChangeWindowAttributes(gXDisplay, gWindow->fScrollUpWindow,
CWBackPixmap | CWEventMask | CWCursor, &at);
at.background_pixmap = sdown;
XChangeWindowAttributes(gXDisplay, gWindow->fScrollDownWindow,
CWBackPixmap | CWEventMask | CWCursor, &at);
XChangeWindowAttributes(gXDisplay, gWindow->scrollbar,
CWEventMask | CWCursor, &at);
if (scroller == 0)
scroller =
XCreatePixmapFromBitmapData(gXDisplay,
RootWindow(gXDisplay, gXScreenNumber), scroller_bits, scroller_width,
scroller_height, FORECOLOR, BACKCOLOR,
DefaultDepth(gXDisplay, gXScreenNumber));
if (scrollbar_pix == 0)
scrollbar_pix =
XCreatePixmapFromBitmapData(gXDisplay,
RootWindow(gXDisplay, gXScreenNumber), scrollbar_pix_bits,
scrollbar_pix_width, scrollbar_pix_height, FORECOLOR, BACKCOLOR,
DefaultDepth(gXDisplay, gXScreenNumber));
at.background_pixmap = scroller;
XChangeWindowAttributes(gXDisplay, gWindow->scroller,
CWBackPixmap | CWCursor, &at);
at.background_pixmap = scrollbar_pix;
XChangeWindowAttributes(gXDisplay, gWindow->scrollbar,
CWBackPixmap, &at);
}
\end{chunk}
\subsection{drawScroller3DEffects}
\index{hypertex!drawScroller3DEffects}
\index{drawScroller3DEffects hypertex}
\begin{chunk}{hypertex}
static void drawScroller3DEffects(HDWindow * hdWindow, int x1, int y1,
int x2, int y2) {
XClearWindow(gXDisplay, hdWindow->scroller);
/* draw right "black" line */
XDrawLine(gXDisplay, hdWindow->scroller, hdWindow->fControlGC,
x2 - 3, y1 + 2, x2 - 3, y2 - 3);
/* draw bottom "black" line */
XDrawLine(gXDisplay, hdWindow->scroller, hdWindow->fControlGC,
x1 + 2, y2 - 3, x2 - 3, y2 - 3);
/* flip foreground and background colors */
XSetBackground(gXDisplay, hdWindow->fControlGC, gControlForegroundColor);
XSetForeground(gXDisplay, hdWindow->fControlGC, gControlBackgroundColor);
/* draw top "white" line */
XDrawLine(gXDisplay, hdWindow->scroller, hdWindow->fControlGC,
x1 + 2, y1 + 2, x2 - 3, y1 + 2);
/* draw left "white" line */
XDrawLine(gXDisplay, hdWindow->scroller, hdWindow->fControlGC,
x1 + 2, y1 + 2, x1 + 2, y2 - 3);
/* reset colors */
XSetBackground(gXDisplay, hdWindow->fControlGC, gControlBackgroundColor);
XSetForeground(gXDisplay, hdWindow->fControlGC, gControlForegroundColor);
}
\end{chunk}
\subsection{showScrollBars}
\index{hypertex!showScrollBars}
\index{showScrollBars hypertex}
\begin{chunk}{hypertex}
void showScrollBars(HDWindow * hdWindow) {
XWindowChanges wc;
/*int src_x = 0, src_y = 0;*/
/*unsigned int width = supwidth, height = supheight;*/
/*int dest_x = 0, dest_y = 0;*/
/* see if we even need scroll bars */
if (hdWindow->page->scrolling->height <= hdWindow->scrollheight)
return;
wc.x = hdWindow->scrollx;
wc.y = hdWindow->scrollupy;
wc.height = supheight;
wc.width = supwidth;
XConfigureWindow(gXDisplay, hdWindow->fScrollUpWindow, CWX | CWY | CWHeight
| CWWidth, &wc);
wc.y = hdWindow->scrolldowny;
XConfigureWindow(gXDisplay, hdWindow->fScrollDownWindow,
CWX | CWY | CWHeight | CWWidth,
&wc);
wc.height = hdWindow->fScrollBarHeight;
wc.y = hdWindow->scrollbary;
XConfigureWindow(gXDisplay, hdWindow->scrollbar,
CWX | CWY | CWHeight | CWWidth,
&wc);
wc.x = 0;
wc.y = hdWindow->fScrollerTopPos;
wc.width = supwidth;
wc.height = hdWindow->fScrollerHeight;
XConfigureWindow(gXDisplay, hdWindow->scroller,
CWX | CWY | CWHeight | CWWidth,
&wc);
/*
* Now we map the windows, since the bitmaps are the backgrounds for the
* windows, we need to worry about redrawing them.
*/
XMapWindow(gXDisplay, hdWindow->fScrollUpWindow);
XMapWindow(gXDisplay, hdWindow->fScrollDownWindow);
XMapWindow(gXDisplay, hdWindow->scrollbar);
XMapWindow(gXDisplay, hdWindow->scroller);
drawScroller3DEffects(hdWindow, 0, 0, wc.width, wc.height);
}
/************************************************************************
Moves the scroller to its proper place within the scrollbar. It
calculates how far down the page we are, and then moves the scroller
accordingly
**************************************************************************/
\end{chunk}
\subsection{moveScroller}
Moves the scroller to it's proper place.
\index{hypertex!moveScroller}
\index{moveScroller hypertex}
\begin{chunk}{hypertex}
void moveScroller(HDWindow * hdWindow) {
XWindowChanges wc;
int t = (int) (hdWindow->fScrollBarHeight * (-hdWindow->page->scroll_off));
hdWindow->fScrollerTopPos = (int) (t / hdWindow->page->scrolling->height);
wc.x = 0;
wc.y = hdWindow->fScrollerTopPos;
wc.width = supwidth;
wc.height = hdWindow->fScrollerHeight;
XConfigureWindow(gXDisplay, hdWindow->scroller,
CWX | CWY | CWHeight | CWWidth,
&wc);
drawScroller3DEffects(hdWindow, 0, 0, wc.width, wc.height);
}
\end{chunk}
\subsection{drawScrollLines}
Checks the pageFlags to see if we need a top, or a bottom line.
These are the horizontal lines framing a scrolling region when the
scrolling region is not the entire window.
\index{hypertex!drawScrollLines}
\index{drawScrollLines hypertex}
\begin{chunk}{hypertex}
void drawScrollLines(void) {
if (!(gWindow->page->pageFlags & NOLINES)) {
lineTopGroup();
if (gWindow->page->header->height) {
XDrawLine(gXDisplay, gWindow->fMainWindow, gWindow->fStandardGC,
0,
gWindow->page->top_scroll_margin -
tophalf(gWindow->border_width) -
2 * scroll_top_margin,
gWindow->scrollwidth,
gWindow->page->top_scroll_margin -
tophalf(gWindow->border_width) -
2 * scroll_top_margin);
}
if (gWindow->page->footer->height) {
XDrawLine(gXDisplay, gWindow->fMainWindow, gWindow->fStandardGC,
0,
gWindow->page->bot_scroll_margin +
bothalf(gWindow->border_width) - 1,
gWindow->scrollwidth,
gWindow->page->bot_scroll_margin +
bothalf(gWindow->border_width) - 1);
}
popGroupStack();
}
}
\end{chunk}
\subsection{calculateScrollBarMeasures}
Calculates all the measures for the scrollbars.
\index{hypertex!calculateScrollBarMeasures}
\index{calculateScrollBarMeasures hypertex}
\begin{chunk}{hypertex}
void calculateScrollBarMeasures(void) {
int t;
/*
* The scrollhieght is the height of the scrolling region visible in the
* HT window. Notice how it is a multiple of line height. This was needed
* to make everything scroll nicely.
*/
gWindow->scrollheight = gWindow->page->bot_scroll_margin -
gWindow->page->top_scroll_margin - scroll_top_margin;
gWindow->scrollheight = gWindow->scrollheight -
gWindow->scrollheight % line_height;
/*
* Now do a quick check to see if I really need a scroll bar, and if not,
* just return right away
*/
if (gWindow->scrollheight >= gWindow->page->scrolling->height) {
gWindow->page->scroll_off = 0;
return;
}
/*
* The height of the scrollbar region, extends form the top page margin
* all the way to the bottom, excluding the room needed for the up and
* down windows
*/
gWindow->fScrollBarHeight = gWindow->page->bot_scroll_margin -
gWindow->page->top_scroll_margin - 2 * supheight -
2 * gWindow->border_width;
gWindow->scrollupy =
gWindow->page->top_scroll_margin - gWindow->border_width;
gWindow->scrollupy -= 2 * scroll_top_margin;
gWindow->scrolldowny = gWindow->page->bot_scroll_margin
- supheight - gWindow->border_width;
gWindow->scrollbary =
gWindow->scrollupy + supheight + gWindow->border_width;
gWindow->scrollx = gWindow->width - supwidth - gWindow->border_width;
/*
* the scroller height is calculated from the following formula
*
* fScrollerHeight scrollheight -------------- ==
* --------- ------------- fScrollBarHeight
* page->scrolling_height
*
*/
/** possible integer error correction **/
gWindow->fScrollerHeight = 1 + 2 * scroll_top_margin +
(int) (gWindow->fScrollBarHeight *
gWindow->scrollheight / gWindow->page->scrolling->height);
/*
* Check the scroll offset, to see if it is too Large
*/
if (-(gWindow->page->scroll_off) >
(gWindow->page->scrolling->height - gWindow->scrollheight))
gWindow->page->scroll_off =
-(gWindow->page->scrolling->height - gWindow->scrollheight);
/*
* Then move the top of the scroller to it's proper position
*/
gWindow->fScrollBarHeight += 2 * scroll_top_margin;
t = (int) (gWindow->fScrollBarHeight * (-gWindow->page->scroll_off));
gWindow->fScrollerTopPos = (int) (t / (gWindow->page->scrolling->height));
}
\end{chunk}
\subsection{linkScrollBars}
\index{hypertex!linkScrollBars}
\index{linkScrollBars hypertex}
\begin{chunk}{hypertex}
void linkScrollBars(void) {
HyperLink *uplink = (HyperLink *) halloc(sizeof(HyperLink), "HyperLink");
HyperLink *downlink = (HyperLink *) halloc(sizeof(HyperLink), "HyperLink");
HyperLink *barlink = (HyperLink *) halloc(sizeof(HyperLink), "HyperLink");
uplink->win = gWindow->fScrollUpWindow;
downlink->win = gWindow->fScrollDownWindow;
barlink->win = gWindow->scrollbar;
uplink->type = Scrollupbutton;
downlink->type = Scrolldownbutton;
barlink->type = Scrollbar;
barlink->x = barlink->y = 0;
uplink->x = uplink->y = 0;
downlink->x = downlink->y = 0;
uplink->reference.node = NULL;
downlink->reference.node = NULL;
hashInsert(gLinkHashTable, (char *)uplink,(char *) &uplink->win);
hashInsert(gLinkHashTable, (char *)barlink,(char *) &barlink->win);
hashInsert(gLinkHashTable, (char *)downlink,(char *) &downlink->win);
}
\end{chunk}
\subsection{scrollUp}
\index{hypertex!scrollUp}
\index{scrollUp hypertex}
\begin{chunk}{hypertex}
void scrollUp(void) {
if (gWindow->page->scroll_off == 0); /* BeepAtTheUser(); *//* The
* beeping annoyed me. RSS */
else {
changeWindowBackgroundPixmap(gWindow->fScrollUpWindow, sup_pressed);
gWindow->page->scroll_off += line_height; /* Scroll a line */
if (gWindow->page->scroll_off > 0)
gWindow->page->scroll_off = 0;
XCopyArea(gXDisplay, gWindow->fScrollWindow, gWindow->fScrollWindow,
gWindow->fStandardGC, 0, 0, gWindow->scrollwidth,
gWindow->scrollheight - line_height + 1, 0, line_height);
XClearArea(gXDisplay, gWindow->fScrollWindow, 0, 0,
gWindow->scrollwidth, line_height, False);
scrollPage(gWindow->page);
changeWindowBackgroundPixmap(gWindow->fScrollUpWindow, sup);
}
}
\end{chunk}
\subsection{scrollUpPage}
\index{hypertex!scrollUpPage}
\index{scrollUpPage hypertex}
\begin{chunk}{hypertex}
void scrollUpPage(void) {
if (gWindow->page->scroll_off == 0); /* BeepAtTheUser(); */
else {
/* Scroll a page */
gWindow->page->scroll_off += ch(gWindow->scrollheight) - line_height;
if (gWindow->page->scroll_off > 0)
gWindow->page->scroll_off = 0;
XClearWindow(gXDisplay, gWindow->fScrollWindow);
scrollPage(gWindow->page);
}
}
\end{chunk}
\subsection{scrollToFirstPage}
\index{hypertex!scrollToFirstPage}
\index{scrollToFirstPage hypertex}
\begin{chunk}{hypertex}
void scrollToFirstPage(void) {
if (gWindow->page->scroll_off == 0); /* BeepAtTheUser(); */
else {
gWindow->page->scroll_off = 0;
XClearWindow(gXDisplay, gWindow->fScrollWindow);
scrollPage(gWindow->page);
}
}
\end{chunk}
\subsection{scrollDown}
\index{hypertex!scrollDown}
\index{scrollDown hypertex}
\begin{chunk}{hypertex}
void scrollDown(void) {
if (-(gWindow->page->scroll_off) >=
(gWindow->page->scrolling->height - gWindow->scrollheight)) {
; /* BeepAtTheUser(); */
}
else {
changeWindowBackgroundPixmap(gWindow->fScrollDownWindow,sdown_pressed);
gWindow->page->scroll_off -= line_height; /* Scroll a line */
XCopyArea(gXDisplay, gWindow->fScrollWindow, gWindow->fScrollWindow,
gWindow->fStandardGC, 0, line_height, gWindow->scrollwidth,
gWindow->scrollheight - line_height + 1, 0, 0);
XClearArea(gXDisplay, gWindow->fScrollWindow, 0,
gWindow->scrollheight - line_height, gWindow->scrollwidth,
line_height, False);
scrollPage(gWindow->page);
changeWindowBackgroundPixmap(gWindow->fScrollDownWindow, sdown);
}
}
\end{chunk}
\subsection{scrollDownPage}
\index{hypertex!scrollDownPage}
\index{scrollDownPage hypertex}
\begin{chunk}{hypertex}
void scrollDownPage(void) {
if (gWindow->page->scrolling == NULL || (-(gWindow->page->scroll_off) >=
(gWindow->page->scrolling->height - gWindow->scrollheight))) {
; /* BeepAtTheUser(); */
}
else {
gWindow->page->scroll_off -= ch(gWindow->scrollheight) - line_height;
if (-(gWindow->page->scroll_off) >
(gWindow->page->scrolling->height - gWindow->scrollheight))
gWindow->page->scroll_off = -
(gWindow->page->scrolling->height - gWindow->scrollheight);
XClearWindow(gXDisplay, gWindow->fScrollWindow);
scrollPage(gWindow->page);
}
}
\end{chunk}
\subsection{scrollScroller}
This routine checks to see where in the window the button press
occured. It then tries to move the scroller so that the top of the
scroller is at the spot of the event
\index{hypertex!scrollScroller}
\index{scrollScroller hypertex}
\begin{chunk}{hypertex}
void scrollScroller(XButtonEvent * event) {
int y = event->y;
int top = y;
if (top < 0) {
top = 0;
if (gWindow->fScrollerTopPos == 0)
return;
gWindow->page->scroll_off = 0;
}
else if ((top + gWindow->fScrollerHeight) > gWindow->fScrollBarHeight) {
top = gWindow->fScrollBarHeight - gWindow->fScrollerHeight;
if (top == gWindow->fScrollerTopPos)
return;
gWindow->page->scroll_off =
-(gWindow->page->scrolling->height - gWindow->scrollheight);
gWindow->page->scroll_off -= gWindow->page->scroll_off % line_height;
}
else { /** top is in an ok spot **/
int t;
t = -(gWindow->page->scrolling->height) * top;
t = t / (gWindow->fScrollBarHeight);
if (gWindow->page->scroll_off == (t -= t % line_height))
return;
gWindow->page->scroll_off = t;
gWindow->fScrollerTopPos = top;
}
XClearWindow(gXDisplay, gWindow->fScrollWindow);
scrollPage(gWindow->page);
}
\end{chunk}
\subsection{hideScrollBars}
\index{hypertex!hideScrollBars}
\index{hideScrollBars hypertex}
\begin{chunk}{hypertex}
void hideScrollBars(HDWindow * hdWindow) {
XUnmapWindow(gXDisplay, hdWindow->fScrollDownWindow);
XUnmapWindow(gXDisplay, hdWindow->fScrollUpWindow);
XUnmapWindow(gXDisplay, hdWindow->scrollbar);
XUnmapWindow(gXDisplay, hdWindow->scroller);
}
\end{chunk}
\subsection{getScrollBarMinimumSize}
\index{hypertex!getScrollBarMinimumSize}
\index{getScrollBarMinimumSize hypertex}
\begin{chunk}{hypertex}
void getScrollBarMinimumSize(int *width, int *height) {
(*width) = sup_width + 4;
(*height) = sup_height + sdown_height + 5;
}
\end{chunk}
\subsection{ch}
\index{hypertex!ch}
\index{ch hypertex}
\begin{chunk}{hypertex}
static int ch(int height) {
int rem = height % line_height;
if (rem == 0)
return height;
return height - rem + line_height;
}
\end{chunk}
\subsection{changeWindowBackgroundPixmap}
\index{hypertex!changeWindowBackgroundPixmap}
\index{changeWindowBackgroundPixmap hypertex}
\begin{chunk}{hypertex}
static void changeWindowBackgroundPixmap(Window window, Pixmap pixmap) {
if (pixmap) {
XSetWindowAttributes at;
at.background_pixmap = pixmap;
XChangeWindowAttributes(gXDisplay, window, CWBackPixmap, &at);
XClearWindow(gXDisplay, window);
}
}
\end{chunk}
\section{Display text object}
/*
* Display the page whose extent has been computed, using the actual size of
* the window, and yOff to determine clipped areas
*/
\subsection{showText}
\index{hypertex!showText}
\index{showText hypertex}
\begin{chunk}{hypertex}
void showText(TextNode *node, int Ender) {
for (; node != NULL; node = node->next) {
switch (node->type) {
case 0:
case Beginitems:
case Begintitems:
case Bound:
case Center:
case Free:
case HSpace:
case Indent:
case Indentrel:
case Item:
case Macro:
case Mbox:
case Newline:
case Noop:
case Par:
case Pound:
case Rbrace:
case Space:
case Tab:
case Table:
case Titem:
case VSpace:
break;
case Dash:
case Fi:
case Ifcond:
if (visible(node->y, node->height)) {
if (strlen(node->data.text) > 1) {
XDrawLine(gXDisplay, gWindow->fDisplayedWindow,
gWindow->fStandardGC, node->x,
node->y + gRegionOffset + yOff -
gTopOfGroupStack->cur_font->descent - word_off_height,
node->x + node->width,
node->y + gRegionOffset + yOff - word_off_height -
gTopOfGroupStack->cur_font->descent);
}
else {
XDrawString(gXDisplay, gWindow->fDisplayedWindow,
gWindow->fStandardGC, node->x, node->y +
gRegionOffset - gTopOfGroupStack->cur_font->descent + yOff,
node->data.text, 1);
}
}
else {
if (above(node->y))
need_scroll_up_button = 1;
else if (below(node->y))
need_scroll_down_button = 1;
}
break;
case Lsquarebrace:
case Math:
case Punctuation:
case Rsquarebrace:
case Spadsrctxt:
case WindowId:
case Word:
if (visible(node->y, node->height))
XDrawString(gXDisplay, gWindow->fDisplayedWindow,
gWindow->fStandardGC, node->x, node->y +
gRegionOffset - gTopOfGroupStack->cur_font->descent + yOff,
node->data.text, node->width);
else {
if (above(node->y))
need_scroll_up_button = 1;
else if (below(node->y))
need_scroll_down_button = 1;
}
break;
case Verbatim:
pushGroupStack();
ttTopGroup();
if (visible(node->y, node->height))
XDrawString(gXDisplay, gWindow->fDisplayedWindow,
gWindow->fStandardGC, node->x, node->y +
gRegionOffset - gTopOfGroupStack->cur_font->descent + yOff,
node->data.text, node->width);
else {
if (above(node->y))
need_scroll_up_button = 1;
else if (below(node->y))
need_scroll_down_button = 1;
}
popGroupStack();
break;
case Horizontalline:
if (visible(node->y, node->height)) {
lineTopGroup();
XDrawLine(gXDisplay, gWindow->fDisplayedWindow,
gWindow->fStandardGC, 0, node->y + gRegionOffset + yOff,
gWindow->width, node->y + gRegionOffset + yOff);
popGroupStack();
}
else {
if (above(node->y))
need_scroll_up_button = 1;
else if (below(node->y))
need_scroll_down_button = 1;
}
break;
case Box:
if (visible(node->y, node->height))
XDrawRectangle(gXDisplay, gWindow->fDisplayedWindow,
gWindow->fStandardGC, node->x,
node->y + gRegionOffset + yOff - node->height,
node->width, node->height);
else {
if (above(node->y))
need_scroll_up_button = 1;
else if (below(node->y))
need_scroll_down_button = 1;
}
break;
case Downlink:
case Link:
case LispDownLink:
case LispMemoLink:
case Lispcommand:
case Lispcommandquit:
case Lisplink:
case Lispwindowlink:
case Memolink:
case Qspadcall:
case Qspadcallquit:
case Returnbutton:
case Spadcall:
case Spadcallquit:
case Spaddownlink:
case Spadlink:
case Spadmemolink:
case Unixcommand:
case Unixlink:
case Upbutton:
case Windowlink:
if (pix_visible(node->y, node->height))
showLink(node);
break;
case Spadcommand:
case Spadgraph:
case Spadsrc:
showSpadcommand(node);
break;
case Pastebutton:
if (visible(node->y, node->height))
showPastebutton(node);
break;
case Paste:
showPaste(node);
break;
case Group:
case Tableitem:
pushGroupStack();
break;
case Controlbitmap:
showImage(node, gWindow->fControlGC);
break;
case Inputbitmap:
showImage(node, gWindow->fStandardGC);
break;
case Inputpixmap:
showImage(node, gWindow->fStandardGC);
break;
case BoldFace:
bfTopGroup();
break;
case Emphasize:
if (gTopOfGroupStack->cur_font == gRmFont)
emTopGroup();
else
rmTopGroup();
break;
case It:
emTopGroup();
break;
case Sl:
case Rm:
rmTopGroup();
break;
case Tt:
ttTopGroup();
break;
case Inputstring:
showInput(node);
break;
case Radiobox:
case SimpleBox:
showSimpleBox(node);
break;
case Beep:
LoudBeepAtTheUser();
break;
case Description:
bfTopGroup();
break;
case Endspadsrc:
case Endspadcommand:
gInAxiomCommand = 1;
case Endtableitem:
case Enddescription:
case Endpastebutton:
case Endlink:
case Endbutton:
case Endgroup:
popGroupStack();
case Endverbatim:
case Endmath:
case Endbox:
case Endtable:
case Endmbox:
case Endparameter:
case Endpaste:
case Endinputbox:
case Endcenter:
case Endmacro:
case Endif:
case Endtitems:
case Enditems:
/*
* Now since I can show specific regions of the text, then at
* this point I should check to see if I am the end
*/
if (node->type == Ender)
return;
break;
case Endfooter:
case Endscrolling:
case Endheader:
case Endtitle:
/*
* regardless of what ender I have, I always terminate showing
* with one of these
*/
return;
default:
fprintf(stderr, "showText: Unknown Node Type %d\n", node->type);
break;
}
}
}
\end{chunk}
\subsection{showLink}
\index{hypertex!showLink}
\index{showLink hypertex}
\begin{chunk}{hypertex}
static void showLink(TextNode *node) {
XWindowChanges wc;
int active;
switch (node->type) {
case Upbutton:
if (!need_up_button) {
XClearArea(gXDisplay, gWindow->fDisplayedWindow, node->x,
node->y - node->height + gRegionOffset,
node->width, node->height, 0);
active = 0;
}
else
active = 1;
break;
case Returnbutton:
if (!need_return_button) {
XClearArea(gXDisplay, gWindow->fDisplayedWindow, node->x,
node->y - node->height + gRegionOffset,
node->width, node->height, 0);
active = 0;
}
else
active = 1;
break;
case Helpbutton:
if (!need_help_button) {
XClearArea(gXDisplay, gWindow->fDisplayedWindow, node->x,
node->y - node->height + gRegionOffset,
node->width, node->height, 0);
active = 0;
}
else
active = 1;
break;
default:
active = 1;
break;
}
if (active) {
ButtonList *bl = allocButtonList();
pushActiveGroup();
wc.x = node->x;
wc.y = node->y - node->height + yOff + gRegionOffset;
wc.height = node->height;
wc.width = node->width - trailingSpace(node->next);
bl->x0 = wc.x;
bl->y0 = wc.y;
bl->x1 = bl->x0 + wc.width;
bl->y1 = bl->y0 + wc.height;
bl->link = node->link;
if (!not_in_scroll) {
bl->y0 += gWindow->page->top_scroll_margin + scroll_top_margin;
bl->y1 += gWindow->page->top_scroll_margin + scroll_top_margin;
bl->next = gWindow->page->s_button_list;
gWindow->page->s_button_list = bl;
}
else {
bl->next = gWindow->page->button_list;
gWindow->page->button_list = bl;
}
}
else
rmTopGroup();
}
\end{chunk}
\subsection{showPaste}
\index{hypertex!showPaste}
\index{showPaste hypertex}
\begin{chunk}{hypertex}
static void showPaste(TextNode *node) {
PasteNode *paste;
if (!(paste = (PasteNode *) hashFind(gWindow->fPasteHashTable,
node->data.text)))
return;
/*
* Once I have got this far, then I had better save the current group
* stack and the item stack
*/
if (paste->group)
freeGroupStack(paste->group);
paste->group = (GroupItem *) copyGroupStack();
if (paste->item_stack)
freeItemStack(paste->item_stack);
paste->item_stack = (ItemStack *) copyItemStack();
}
\end{chunk}
\subsection{showPastebutton}
\index{hypertex!showPastebutton}
\index{showPastebutton hypertex}
\begin{chunk}{hypertex}
static void showPastebutton(TextNode *node) {
XWindowChanges wc;
pushActiveGroup();
wc.x = node->x;
wc.y = node->y - node->height + yOff + gRegionOffset;
wc.height = node->height;
wc.width = node->width - trailingSpace(node->next);
#ifdef DEBUG
fprintf(stderr, "Configure in showLink %d %d %d %d\n",
wc.x, wc.y, wc.width, wc.height);
#endif
XConfigureWindow(gXDisplay, node->link->win,
CWX | CWY | CWHeight | CWWidth, &wc);
XMapWindow(gXDisplay, node->link->win);
}
\end{chunk}
\subsection{showInput}
Display an input string window.
\index{hypertex!showInput}
\index{showInput hypertex}
\begin{chunk}{hypertex}
static void showInput(TextNode *node) {
XWindowChanges wc;
InputItem *item;
char *inpbuffer;
item = node->link->reference.string;
inpbuffer = item->curr_line->buffer;
wc.border_width = 0;
wc.x = node->x;
wc.y = node->y + gRegionOffset + yOff - node->height + 2;
wc.height = node->height - 2;
wc.width = node->width;
if (pix_visible(node->y, node->height)) {
XConfigureWindow(gXDisplay, node->link->win,
CWX | CWY | CWHeight | CWWidth | CWBorderWidth,
&wc);
XMapWindow(gXDisplay, node->link->win);
}
XFlush(gXDisplay);
drawInputsymbol(item);
}
\end{chunk}
\subsection{showSimpleBox}
\index{hypertex!showSimpleBox}
\index{showSimpleBox hypertex}
\begin{chunk}{hypertex}
static void showSimpleBox(TextNode *node) {
XWindowChanges wc;
InputBox *box;
/* first configure the box size properly */
box = node->link->reference.box;
wc.x = node->x;
wc.y = node->y + gRegionOffset + yOff - node->height;
wc.height = ((box->picked) ?
(box->selected->height) : (box->unselected->height));
wc.width = node->width;
if (visible(node->y + gTopOfGroupStack->cur_font->ascent, node->height)) {
XConfigureWindow(gXDisplay, node->link->win,
CWX | CWY | CWHeight | CWWidth, &wc);
XMapWindow(gXDisplay, node->link->win);
if (box->picked)
pick_box(box);
else
unpick_box(box);
}
}
\end{chunk}
\subsection{showSpadcommand}
Display a spad command node.
\index{hypertex!showSpadcommand}
\index{showSpadcommand hypertex}
\begin{chunk}{hypertex}
static void showSpadcommand(TextNode *node) {
XWindowChanges wc;
gInAxiomCommand = 1;
pushSpadGroup();
wc.x = node->x;
if (node->type == Spadsrc)
wc.y = node->y + gRegionOffset + yOff - 2 * node->height;
else
wc.y = node->y + gRegionOffset + yOff - node->height;
wc.height = node->height;
wc.width = node->width;
#ifdef DEBUG
fprintf(stderr, "Spadcommand configured %d x %d -- (%d, %d)\n",
wc.width, wc.height, wc.x, wc.y);
#endif
XConfigureWindow(gXDisplay, node->link->win,
CWX | CWY | CWHeight | CWWidth, &wc);
XMapWindow(gXDisplay, node->link->win);
}
\end{chunk}
\subsection{showImage}
Display a pixmap.
\index{hypertex!showImage}
\index{showImage hypertex}
\begin{chunk}{hypertex}
static void showImage(TextNode *node, GC gc) {
int src_x, src_y, src_width, src_height, dest_x, dest_y, ret_val;
if (!pix_visible(node->y, node->height))
return;
if (node->image.xi == NULL)
return;
dest_x = node->x;
src_x = 0;
src_y = 0;
dest_y = node->y + gRegionOffset - node->height + yOff;
need_scroll_up_button = 1;
if (node->width > (right_margin - node->x))
src_width = right_margin - node->x;
else
src_width = node->width;
if (gDisplayRegion != Scrolling) {
src_y = 0;
src_height = node->image.xi->height;
}
else {
/* I may have only a partial image */
if (dest_y < 0) { /* the top is cut off */
src_y = -dest_y;
dest_y = 0;
src_height = node->image.xi->height - src_y;
}
else if (dest_y + node->image.xi->height > gWindow->scrollheight) {
/* the bottom is cut off */
src_y = 0;
src_height = gWindow->scrollheight - dest_y;
}
else { /* the whole thing is visible */
src_y = 0;
src_height = node->image.xi->height;
}
}
ret_val = XPutImage(gXDisplay, gWindow->fDisplayedWindow, gc,
node->image.xi, src_x, src_y, dest_x, dest_y,
src_width, src_height);
switch (ret_val) {
case BadDrawable:
fprintf(stderr, "(HyperDoc: showImage) bad drawable\n");
break;
case BadGC:
fprintf(stderr, "(HyperDoc: showImage) bad GC");
break;
case BadMatch:
fprintf(stderr, "(HyperDoc: showImage) bad match");
break;
case BadValue:
fprintf(stderr, "(HyperDoc: showImage) bad value");
break;
}
}
\end{chunk}
\section{Axiom communication interface}
Still a problem with closeClient.
\subsection{issueSpadcommand}
Issue a AXIOM command to the buffer associated with a page.
\index{hypertex!issueSpadcommand}
\index{issueSpadcommand hypertex}
\begin{chunk}{hypertex}
void issueSpadcommand(HyperDocPage *page, TextNode *command,
int immediate, int type) {
char *buf;
int ret_val;
ret_val = connectSpad();
if (ret_val == NotConnected || ret_val == SpadBusy)
return;
if (page->sock == NULL)
startUserBuffer(page);
ret_val = send_int(page->sock, TestLine);
if (ret_val == -1) {
page->sock = NULL;
clearExecutionMarks(page->depend_hash);
issueSpadcommand(page, command, immediate, type);
return;
}
issueDependentCommands(page, command, type);
ret_val = send_int(page->sock, ReceiveInputLine);
buf = printToString(command);
if (immediate) {
buf[strlen(buf) + 1] = '\0';
buf[strlen(buf)] = '\n';
}
if (type == Spadsrc)
sendPile(page->sock, buf);
else
send_string(page->sock, buf);
markAsExecuted(page, command, type);
gIsEndOfOutput = 0;
}
\end{chunk}
\subsection{sendPile}
\label{sendPile}
\index{hypertex!sendPile}
\index{sendPile hypertex}
\begin{chunk}{hypertex}
static void sendPile(Sock *sock,char * str) {
FILE *f;
char name[512], command[512];
sprintf(name, "/tmp/hyper%s.input", getenv("SPADNUM"));
f = fopen(name, "w");
if (f == NULL) {
fprintf(stderr, "Can't open temporary input file %s\n", name);
return;
}
fprintf(f, "%s", str);
fclose(f);
sprintf(command, ")read %s\n", name);
send_string(sock, command);
}
\end{chunk}
\subsection{issueDependentCommands}
\index{hypertex!issueDependentCommands}
\index{issueDependentCommands hypertex}
\begin{chunk}{hypertex}
static void issueDependentCommands(HyperDocPage *page,
TextNode *command,int type) {
TextNode *node, *depend_label;
SpadcomDepend *depend;
int endType = (type == Spadcommand || type == Spadgraph) ?
(Endspadcommand) : (Endspadsrc);
for (node = command->next; node->type != endType;
node = node->next)
if (node->type == Free)
for (depend_label = node->data.node; depend_label != NULL;
depend_label = depend_label->next)
if (depend_label->type == Word) {
depend = (SpadcomDepend *)
hashFind(page->depend_hash, depend_label->data.text);
if (depend == NULL) {
fprintf(stderr,
"Error: dependency on undefined label: %s\n",
depend_label->data.text);
continue;
}
if (!depend->executed) {
issueSpadcommand(page, depend->spadcom->next, 1,
depend->spadcom->type);
while (!gIsEndOfOutput)
pause();
sleep(1);
}
}
}
\end{chunk}
\subsection{markAsExecuted}
\index{hypertex!markAsExecuted}
\index{markAsExecuted hypertex}
\begin{chunk}{hypertex}
static void markAsExecuted(HyperDocPage *page, TextNode *command,int type) {
TextNode *node, *depend_label;
SpadcomDepend *depend;
int endType = (type == Spadcommand || type == Spadgraph)
? (Endspadcommand) : (Endspadsrc);
for (node = command; node->type != endType; node = node->next)
if (node->type == Bound)
for (depend_label = node->data.node; depend_label != NULL;
depend_label = depend_label->next)
if (depend_label->type == Word) {
depend = (SpadcomDepend *)
hashFind(page->depend_hash, depend_label->data.text);
if (depend == NULL) {
fprintf(stderr, "No dependency entry for label: %s\n",
depend_label->data.text);
continue;
}
depend->executed = 1;
}
}
\end{chunk}
\subsection{startUserBuffer}
Start a spad buffer for the page associated with the give.
\index{hypertex!startUserBuffer}
\index{startUserBuffer hypertex}
\begin{chunk}{hypertex}
static void startUserBuffer(HyperDocPage *page) {
char buf[1024], *title;
char *SPAD;
char spadbuf[250];
char complfile[250];
int ret_val;
SPAD = (char *) getenv("AXIOM");
if (SPAD == NULL) {
sprintf(SPAD, "/spad/mnt/rios");
}
sprintf(spadbuf, "%s/lib/spadbuf", SPAD);
sprintf(complfile, "%s/lib/command.list", SPAD);
title = printToString(page->title);
if (access(complfile, R_OK) == 0)
/*
* TTT says : why not invoke with "-name axiomclient" and set any
* defaults in the usual way
*/
#ifdef RIOSplatform
sprintf(buf,
"aixterm -sb -sl 500 -name axiomclient -n '%s' -T '%s' -e %s %s %s&",
title, title, spadbuf, page->name, complfile);
else
sprintf(buf,
"aixterm -sb -sl 500 -name axiomclient -n '%s' -T '%s' -e %s %s&",
title, title, spadbuf, page->name);
#else
#ifdef SUNplatform
sprintf(buf,
"xterm -sb -sl 500 -name axiomclient -n '%s' -T '%s' -e %s %s %s&",
title, title, spadbuf, page->name, complfile);
else
sprintf(buf,
"xterm -sb -sl 500 -name axiomclient -n '%s' -T '%s' -e %s %s&",
title, title, spadbuf, page->name);
#else
sprintf(buf,
"xterm -sb -sl 500 -name axiomclient -n '%s' -T '%s' -e %s %s %s&",
title, title, spadbuf, page->name, complfile);
else
sprintf(buf,
"xterm -sb -sl 500 -name axiomclient -n '%s' -T '%s' -e %s '%s'&",
title, title, spadbuf, page->name);
#endif
#endif
ret_val = system(buf);
if (ret_val == -1 || ret_val == 127) {
/*
* perror("running the xterm spadbuf program"); exit(-1);
*/
}
acceptMenuServerConnection(page);
sleep(2);
}
\end{chunk}
\subsection{clearExecutionMarks}
Clears the execution marks in a hash table when a buffer has been killed.
\index{hypertex!clearExecutionMarks}
\index{clearExecutionMarks hypertex}
\begin{chunk}{hypertex}
static void clearExecutionMarks(HashTable *depend_hash) {
int i;
HashEntry *h;
SpadcomDepend *depend;
if (depend_hash == 0)
return;
for (i = 0; i < depend_hash->size; i++)
for (h = depend_hash->table[i]; h != NULL; h = h->next) {
depend = (SpadcomDepend *) h->data;
depend->executed = 0;
}
}
\end{chunk}
\subsection{acceptMenuConnection}
\index{hypertex!acceptMenuConnection}
\index{acceptMenuConnection hypertex}
\begin{chunk}{hypertex}
Sock *acceptMenuConnection(Sock *server_sock) {
int sock_fd;
Sock_List *pls;
/* Could only be InterpWindow */
pls = (Sock_List *) halloc(sizeof(Sock_List),"SockList");
sock_fd = accept(server_sock->socket, 0, 0);
if (sock_fd == -1) {
perror("session : accepting connection");
return 0;
}
(pls->Socket).socket = sock_fd;
get_socket_type((Sock *) pls);
#ifdef DEBUG
fprintf(stderr,
"session: accepted InterpWindow , fd = %d\n", sock_fd);
#endif
/* put new item at head of list */
if (plSock == (Sock_List *) 0) {
plSock = pls;
plSock->next = (Sock_List *) 0;
}
else {
pls->next = plSock;
plSock = pls;
}
/* need to maintain socket_mask since we roll our own accept */
FD_SET(plSock->Socket.socket, &socket_mask);
return (Sock *) plSock;
}
\end{chunk}
\subsection{acceptMenuServerConnection}
TTT thinks this code should just provide a Sock to the page. The only
client assumed is a spadbuf. Since spadbuf was invoked with the page
name, it just passes it back here as a check (\verb|get_string| line).
\index{hypertex!acceptMenuServerConnection}
\index{acceptMenuServerConnection hypertex}
\begin{chunk}{hypertex}
static void acceptMenuServerConnection(HyperDocPage *page) {
int ret_code/*, i*/;
fd_set rd;
Sock *sock;
char *buf_name;
HyperDocPage *npage;
if (page->sock != NULL)
return;
while (1) {
rd = server_mask;
ret_code = sselect(FD_SETSIZE, &rd, 0, 0, NULL);
if (ret_code == -1) {
perror("Session manager select");
continue;
}
if (server[1].socket > 0 && FD_ISSET(server[1].socket, &rd)) {
sock = acceptMenuConnection(server + 1);
if (sock == 0)
return;
if (sock->purpose == InterpWindow) {
buf_name = get_string(sock);
npage = (HyperDocPage *)
hashFind(gWindow->fPageHashTable, buf_name);
if (npage == NULL) {
/*
* Lets just try using the current page TTT doesn't know
* why this could be detrimental
*
* fprintf(stderr, "connecting spadbuf to unknown page:
* %s\n", buf_name);
*/
page->sock = sock;
return;
}
else {
/*
* For some reason npage and page may be different TTT
* thinks this happens when a dynamic page has the same
* name as an existing static page.
*/
npage->sock = sock;
page->sock = sock;
}
if (!strcmp(buf_name, page->name)) {
return;
}
}
}
}
}
\end{chunk}
\subsection{printToString}
This routine takes a text node and creates a string out of it. This is for
use with things such as spad commands. There are a very limited set of
node types it can handle, so be careful.
\index{hypertex!printToString}
\index{printToString hypertex}
\begin{chunk}{hypertex}
char *printToString(TextNode *command) {
int len = 0;
printToString1(command, &len);
p2sBuf = resizeBuffer(len, p2sBuf, &p2sBufSize);
return printToString1(command, NULL);
}
\end{chunk}
\subsection{printToString1}
\index{hypertex!printToString1}
\index{printToString1 hypertex}
\begin{chunk}{hypertex}
char *printToString1(TextNode *command,int * sizeBuf) {
char *c = p2sBuf;
char *s;
InputItem *item;
LineStruct *curr_line;
int lcount;
InputBox *box;
int num_spaces;
int count;
TextNode *node;
/*
* Init the stack of text nodes, things are pushed on here when I trace
* through a nodes data.node. This way I always no where my next is.
*/
for (node = command; node != NULL;) {
switch (node->type) {
case Newline:
storeChar('\n');
node = node->next;
break;
case Ifcond:
if (checkCondition(node->data.ifnode->cond))
node = node->data.ifnode->thennode;
else
node = node->data.ifnode->elsenode;
break;
case Endarg:
case Endspadcommand:
case Endspadsrc:
case Endpix:
storeChar('\0');
return p2sBuf;
case Endverbatim:
case Endif:
case Fi:
case Endmacro:
case Endparameter:
case Rbrace:
case Endgroup:
node = node->next;
break;
case Punctuation:
/*
* Simply copy the piece of text
*/
if (node->space & FRONTSPACE) { storeChar(' '); }
for (s = node->data.text; *s; s++) { storeChar(*s); }
node = node->next;
break;
case WindowId:
/*
* Simply copy the piece of text
*/
if (node->space) { storeChar(' '); }
for (s = node->data.text; *s; s++) { storeChar(*s); }
storeChar(' ');
node = node->next;
break;
case Verbatim:
case Spadsrctxt:
/*
* Simply copy the piece of text
*/
if (node->space) { storeChar(' '); }
for (s = node->data.text; *s; s++) { storeChar(*s); }
/*
* now add the eol
*/
/*
* if(node->next && node->next->type != Endspadsrc)
* storeChar('\n');
*/
node = node->next;
break;
case Dash:
case Rsquarebrace:
case Lsquarebrace:
case Word:
/*
* Simply copy the piece of text
*/
if (node->space) { storeChar(' '); }
for (s = node->data.text; *s; s++) { storeChar(*s); }
node = node->next;
break;
case BoxValue:
box =
(InputBox *) hashFind(gWindow->page->box_hash, node->data.text);
if (box == NULL) {
fprintf(stderr,
"printToString:Box %s Has no symbol table entry\n",
node->data.text);
exit(-1);
}
storeChar(' ');
if (box->picked) {
storeChar('t');
}
else {
storeChar('n');
storeChar('i');
storeChar('l');
}
node = node->next;
break;
case StringValue:
item = returnItem(node->data.text);
if (item != NULL) {
if (node->space) { storeChar(' '); }
curr_line = item->lines;
while (curr_line != NULL) {
for (lcount = 0,
s = curr_line->buffer; *s && lcount < item->size;
s++, lcount++) {
storeChar(funnyUnescape(*s));
}
if (curr_line->len <= item->size && curr_line->next) {
storeChar('\n');
}
curr_line = curr_line->next;
}
}
else if ((box = (InputBox *) hashFind(gWindow->page->box_hash,
node->data.text)) != NULL) {
if (node->space) { storeChar(' '); }
if (box->picked) {
storeChar('t');
}
else {
storeChar('n');
storeChar('i');
storeChar('l');
}
}
else {
fprintf(stderr, "Error, Symbol %s has no symbol table entry\n",
node->data.text);
exit(-1);
}
node = node->next;
break;
case Space:
num_spaces = (node->data.node != NULL ?
atoi(node->data.node->data.text) : 1);
for (count = 0; count < num_spaces; count++)
storeChar(' ');
node = node->next;
break;
case Titlenode:
case Endtitle:
case Center:
case Endcenter:
case BoldFace:
case Emphasize:
case Indentrel:
node = node->next;
break;
case Bound:
if (include_bf) {
int len, i;
TextNode *n2 = node->data.node;
storeChar('\\');
storeChar('b');
storeChar('o');
storeChar('u');
storeChar('n');
storeChar('d');
storeChar('{');
for (; n2->type != Endarg; n2 = n2->next) {
if (n2->type == Word) {
len = strlen(n2->data.text);
for (i = 0; i < len; i++)
storeChar(n2->data.text[i]);
storeChar(' ');
}
}
storeChar('}');
}
node = node->next;
break;
case Free:
if (include_bf) {
int len, i;
TextNode *n2 = node->data.node;
storeChar('\\');
storeChar('f');
storeChar('r');
storeChar('e');
storeChar('e');
storeChar('{');
for (; n2->type != Endarg; n2 = n2->next) {
if (n2->type == Word) {
len = strlen(n2->data.text);
for (i = 0; i < len; i++)
storeChar(n2->data.text[i]);
storeChar(' ');
}
}
storeChar('}');
}
node = node->next;
break;
case Macro:
node = node->next;
break;
case Pound:
if (node->space) { storeChar(' '); }
node = node->next;
break;
case Group:
node = node->next;
break;
case Indent:
num_spaces = (node->data.node != NULL ?
atoi(node->data.node->data.text) : 1);
for (count = 0; count < num_spaces; count++)
storeChar(' ');
node = node->next;
break;
default:
fprintf(stderr,
"printToString: Unrecognized Keyword Type %d\n",
node->type);
node=node->next;
break;
}
}
storeChar('\0');
return p2sBuf;
}
/*
* Send a lisp or spad command to the AXIOM server for execution , if
* type is link, then we wait for a HyperDoc card to be returned
*/
\end{chunk}
\subsection{issueServerCommand}
\index{hypertex!issueServerCommand}
\index{issueServerCommand hypertex}
\begin{chunk}{hypertex}
HyperDocPage *issueServerCommand(HyperLink *link) {
TextNode *command = (TextNode *) link->reference.node;
int ret_val;
char *buf;
HyperDocPage *page;
ret_val = connectSpad();
if (ret_val == NotConnected) {
page = (HyperDocPage *) hashFind(gWindow->fPageHashTable,
"SpadNotConnectedPage");
if (page == NULL)
fprintf(stderr, "No SpadNotConnectedPage found\n");
return page;
}
if (ret_val == SpadBusy) {
page = (HyperDocPage *) hashFind(gWindow->fPageHashTable,
"SpadBusyPage");
if (page == NULL)
fprintf(stderr, "No SpadBusyPage found\n");
return page;
}
switchFrames();
switch (link->type) {
case Qspadcall:
case Qspadcallquit:
case Spadlink:
case Spaddownlink:
case Spadmemolink:
send_int(spadSocket, QuietSpadCommand);
break;
case Spadcall:
case Spadcallquit:
send_int(spadSocket, SpadCommand);
break;
default:
send_int(spadSocket, LispCommand);
break;
}
buf = printToString(command);
send_string(spadSocket, buf);
if (link->type == Lispcommand || link->type == Spadcall
|| link->type == Spadcallquit || link->type == Qspadcallquit
|| link->type == Qspadcall || link->type == Lispcommandquit)
return NULL;
page = parsePageFromSocket();
return page;
}
\end{chunk}
\subsection{issueServerpaste}
\index{hypertex!issueServerpaste}
\index{issueServerpaste hypertex}
\begin{chunk}{hypertex}
int issueServerpaste(TextNode *command) {
char *buf;
int ret_val;
ret_val = connectSpad();
if (ret_val == NotConnected || ret_val == SpadBusy)
return 1;
switchFrames();
send_int(spadSocket, LispCommand);
buf = printToString(command);
send_string(spadSocket, buf);
return 1;
}
\end{chunk}
\subsection{issueUnixcommand}
\index{hypertex!issueUnixcommand}
\index{issueUnixcommand hypertex}
\begin{chunk}{hypertex}
void issueUnixcommand(TextNode *node) {
char *buf;
char *copy;
buf = printToString(node);
copy =(char *) halloc((strlen(buf)+2)*sizeof(char),"Unixcommand");
strcpy(copy,buf);
copy[strlen(buf) + 1] = '\0';
copy[strlen(buf)] = '&';
system(copy);
free(copy);
return;
}
\end{chunk}
\subsection{issueUnixlink}
\index{hypertex!issueUnixlink}
\index{issueUnixlink hypertex}
\begin{chunk}{hypertex}
HyperDocPage *issueUnixlink(TextNode *node) {
HyperDocPage *page;
char *buf;
buf = printToString(node);
if ((unixfd = popen(buf, "r")) == NULL) {
fprintf(stderr, "Error popening %s\n", buf);
exit(-1);
}
bsdSignal(SIGUSR2,SIG_IGN,0);
page = parsePageFromUnixfd();
bsdSignal(SIGUSR2,sigusr2Handler,0);
return page;
}
\end{chunk}
\subsection{issueUnixpaste}
\index{hypertex!issueUnixpaste}
\index{issueUnixpaste hypertex}
\begin{chunk}{hypertex}
int issueUnixpaste(TextNode *node) {
char *buf;
buf = printToString(node);
if ((unixfd = popen(buf, "r")) == NULL) {
fprintf(stderr, "Error popening %s\n", buf);
exit(-1);
}
return 1;
}
\end{chunk}
\subsection{serviceSessionSocket}
Called when sessionServer selects.
\index{hypertex!serviceSessionSocket}
\index{serviceSessionSocket hypertex}
\begin{chunk}{hypertex}
void serviceSessionSocket(void) {
int cmd, pid;
cmd = get_int(sessionServer);
switch (cmd) {
case CloseClient:
pid = get_int(sessionServer);
if (pid != -1)
closeClient(pid);
break;
default:
fprintf(stderr,
"(HyperDoc) Unknown command from SessionServer %d\n", cmd);
break;
}
}
\end{chunk}
\subsection{switchFrames}
Let spad know which frame to issue command via
\index{hypertex!switchFrames}
\index{switchFrames hypertex}
\begin{chunk}{hypertex}
static void switchFrames(void) {
if (sessionServer == NULL) {
fprintf(stderr, "(HyperDoc) No session manager connected!\n");
return;
}
if (gWindow->fAxiomFrame == -1) {
fprintf(stderr,
"(HyperDoc) No AXIOM frame associated with top level window!\n");
return;
}
send_int(sessionServer, SwitchFrames);
send_int(sessionServer, gWindow->fAxiomFrame);
}
\end{chunk}
\subsection{sendLispCommand}
\index{hypertex!sendLispCommand}
\index{sendLispCommand hypertex}
\begin{chunk}{hypertex}
void sendLispCommand(char *command) {
int ret_val;
ret_val = connectSpad();
if (ret_val == NotConnected || ret_val == SpadBusy) {
return;
}
send_int(spadSocket, LispCommand);
send_string(spadSocket, command);
}
\end{chunk}
\subsection{escapeString}
\index{hypertex!escapeString}
\index{escapeString hypertex}
\begin{chunk}{hypertex}
void escapeString(char *s) {
char *st;
for (st = s; *st; st++)
*st = funnyEscape(*st);
}
\end{chunk}
\subsection{unescapeString}
\index{hypertex!unescapeString}
\index{unescapeString hypertex}
\begin{chunk}{hypertex}
void unescapeString(char *s) {
char *st;
for (st = s; *st; st++)
*st = funnyUnescape(*st);
}
\end{chunk}
\subsection{closeClient}
\index{hypertex!closeClient}
\index{closeClient hypertex}
\begin{chunk}{hypertex}
static void closeClient(int pid) {
Sock_List *pSock, *locSock;
/*
* just need to drop the list item
*/
if (plSock == (Sock_List *) 0)
return;
/*
* first check head
*/
if ((plSock->Socket.pid == pid)) {
locSock = plSock;
if ((*plSock).next == (Sock_List *) 0) {
plSock = (Sock_List *) 0;
}
else {
plSock = plSock->next;
}
free(locSock);
}
/*
* now check the rest
*/
else {
for (pSock = plSock;
pSock->next != (Sock_List *) 0;
pSock = pSock->next)
if (pSock->next->Socket.pid == pid) {
locSock = pSock->next;
if (pSock->next->next == (Sock_List *) 0) {
pSock->next = (Sock_List *) 0;
}
else {
pSock->next = pSock->next->next;
}
free(locSock);
break;
}
}
}
\end{chunk}
\subsection{printSourceToString}
\index{hypertex!printSourceToString}
\index{printSourceToString hypertex}
\begin{chunk}{hypertex}
char *printSourceToString(TextNode *command) {
int len = 0;
printSourceToString1(command, &len);
p2sBuf = resizeBuffer(len, p2sBuf, &p2sBufSize);
return printSourceToString1(command, NULL);
}
\end{chunk}
\subsection{printSourceToString1}
\index{hypertex!printSourceToString1}
\index{printSourceToString1 hypertex}
\begin{chunk}{hypertex}
char *printSourceToString1(TextNode *command,int * sizeBuf) {
char *c = p2sBuf;
char *s;
InputItem *item;
LineStruct *curr_line;
int lcount;
InputBox *box;
int num_spaces;
int count;
TextNode *node;
/* print out HyperDoc source for what you see */
for (node = command; node != NULL;) {
switch (node->type) {
case Newline:
storeString("\\newline\n");
node = node->next;
break;
case Par:
storeString("\n\n");
node = node->next;
break;
case Indentrel:
storeString("\\indentrel{");
storeString(node->data.node->data.text);
storeChar('}');
node = node->next;
break;
case Tab:
storeString("\\tab{");
storeString(node->data.node->data.text);
storeChar('}');
node = node->next;
break;
case Ifcond:
if (checkCondition(node->data.ifnode->cond))
node = node->data.ifnode->thennode;
else
node = node->data.ifnode->elsenode;
break;
case Endarg:
case Endspadsrc:
case Endpix:
case Endbutton:
storeChar('}');
node = node->next;
break;
case Endverbatim:
case Endif:
case Fi:
case Endmacro:
case Endparameter:
case Rbrace:
node = node->next;
break;
case Punctuation:
/*
* Simply copy the piece of text
*/
if (node->space & FRONTSPACE) { storeChar(' '); }
for (s = node->data.text; *s; s++) { storeChar(*s); }
node = node->next;
break;
case WindowId:
storeString("\\windowid ");
node = node->next;
break;
case Verbatim:
case Spadsrctxt:
if (node->space) { storeChar(' '); }
for (s = node->data.text; *s; s++) { storeChar(*s); }
node = node->next;
break;
case Dash:
case Rsquarebrace:
case Lsquarebrace:
case Word:
if (node->space) { storeChar(' '); }
for (s = node->data.text; *s; s++) { storeChar(*s); }
node = node->next;
break;
case BoxValue:
box=(InputBox *)hashFind(gWindow->page->box_hash,node->data.text);
if (box == NULL) {
fprintf(stderr,
"printToString:Box %s Has no symbol table entry\n",
node->data.text);
exit(-1);
}
storeChar(' ');
if (box->picked) {
storeChar('t');
}
else {
storeChar('n');
storeChar('i');
storeChar('l');
}
node = node->next;
break;
case StringValue:
item = returnItem(node->data.text);
if (item != NULL) {
if (node->space) { storeChar(' '); }
curr_line = item->lines;
while (curr_line != NULL) {
for (lcount = 0, s = curr_line->buffer;
*s && lcount < item->size;
s++, lcount++) {
storeChar(funnyUnescape(*s));
}
if (curr_line->len <= item->size && curr_line->next) {
storeChar('\n');
}
curr_line = curr_line->next;
}
}
else if ((box = (InputBox *) hashFind(gWindow->page->box_hash,
node->data.text)) != NULL) {
if (node->space) { storeChar(' '); }
if (box->picked) {
storeChar('t');
}
else {
storeChar('n');
storeChar('i');
storeChar('l');
}
}
else {
fprintf(stderr, "Error, Symbol %s has no symbol table entry\n",
node->data.text);
exit(-1);
}
node = node->next;
break;
case Space:
num_spaces = (node->data.node != NULL ?
atoi(node->data.node->data.text) : 1);
for (count = 0; count < num_spaces; count++)
storeChar(' ');
node = node->next;
break;
case Emphasize:
storeString("\\em ");
node = node->next;
break;
case BoldFace:
storeString("\\bf ");
node = node->next;
break;
case Sl:
storeString("\\it ");
node = node->next;
break;
case Rm:
storeString("\\rm ");
node = node->next;
break;
case It:
storeString("\\it ");
node = node->next;
break;
case Tt:
storeString("\\tt ");
node = node->next;
break;
case Group:
/* skip {} */
if (node->next->type==Endgroup){
node=node->next->next;
break;
}
storeChar('{');
node = node->next;
break;
case Endgroup:
storeChar('}');
node = node->next;
break;
case Box:
storeString("\\box{");
node = node->next;
break;
case Endbox:
storeChar('}');
node = node->next;
break;
case Center:
storeString("\\center{");
node = node->next;
break;
case Endcenter:
storeString("}");
storeChar('\n');
node = node->next;
break;
case Titlenode:
case Endtitle:
node = node->next;
break;
case Bound:
{
TextNode *n2 = node->data.node;
storeString("\\bound{");
for (; n2->type != Endarg; n2 = n2->next) {
if (n2->type == Word) {
storeString(n2->data.text);
storeChar(' ');
}
}
storeChar('}');
}
node = node->next;
break;
case Free:
{
TextNode *n2 = node->data.node;
storeString("\\free{");
for (; n2->type != Endarg; n2 = n2->next) {
if (n2->type == Word) {
storeString(n2->data.text);
storeChar(' ');
}
}
storeChar('}');
}
node = node->next;
break;
case Macro:
storeChar(' ');
node = node->next;
break;
case Pound:
if (node->space) { storeChar(' '); }
node = node->next;
break;
case Indent:
num_spaces = (node->data.node != NULL ?
atoi(node->data.node->data.text) : 1);
for (count = 0; count < num_spaces; count++)
storeChar(' ');
node = node->next;
break;
case Inputbitmap:
storeString("\\inputbitmap{");
storeString(node->data.text);
storeString("}\n");
node = node->next;
break;
case Endscrolling:
storeString("\\end{scroll}\n");
node = node->next;
break;
case Scrollingnode:
storeString("\\begin{scroll}\n");
storeString("% This is the scrolling area\n");
node = node->next;
break;
case Horizontalline:
storeString("\\horizontalline\n");
node = node->next;
break;
case Endtable:
storeChar('}');
node = node->next;
break;
case Table:
storeString("\\table{");
node = node->next;
break;
case Tableitem:
storeChar('{');
node = node->next;
break;
case Endtableitem:
storeChar('}');
node = node->next;
break;
case Beginitems:
storeString("\\begin{items}");
node = node->next;
break;
case Item:
storeString("\n\\item");
node = node->next;
break;
case Enditems:
storeString("\n\\end{items}");
node = node->next;
break;
/*** LINKS ***/
/* all these guys are ended by Endbutton
we close the brace then */
case Spadlink:
storeString("\\fauxspadlink{");
node = node->next;
break;
case Unixlink:
storeString("\\fauxunixlink{");
node = node->next;
break;
case Lisplink:
storeString("\\fauxlisplink{");
node = node->next;
break;
case Link:
storeString("\\fauxlink{");
node = node->next;
break;
case LispDownLink:
storeString("\\fauxlispdownlink{");
node = node->next;
break;
case LispMemoLink:
storeString("\\fauxlispmemolink{");
node = node->next;
break;
case Memolink:
storeString("\\fauxmemolink{");
node = node->next;
break;
case Windowlink:
storeString("\\fauxwindowlink{");
node = node->next;
break;
case Downlink:
storeString("\\fauxdownlink{");
node = node->next;
break;
/** END OF LINKS **/
case Unixcommand:
storeString("\\unixcommand{");
node = node->next;
break;
case Lispcommand:
storeString("\\lispcommand{");
node = node->next;
break;
case Spadgraph:
storeString("\\spadgraph{");
node = node->next;
break;
case Spadcommand:
storeString("\\spadcommand{");
node = node->next;
break;
case Endspadcommand:
storeChar('}');
node = node->next;
break;
case Footernode:
storeString("% This is the footer\n");
node = node->next;
break;
case Endfooter:
storeString("% This is the end of the footer\n");
node = node->next;
break;
case Endheader:
storeString("% This is the end of the header\n");
node = node->next;
break;
case Headernode:
storeString("% This is the header\n");
node = node->next;
break;
default:
fprintf(stderr,
"printToString: Unrecognized Keyword Type %d\n",
node->type);
node=node->next;
break;
}
}
storeChar('\0');
return p2sBuf;
}
\end{chunk}
\section{Produce titlebar}
\subsection{makeTitleBarWindows}
\index{hypertex!makeTitleBarWindows}
\index{makeTitleBarWindows hypertex}
\begin{chunk}{hypertex}
void makeTitleBarWindows(void) {
XSetWindowAttributes at;
unsigned long valuemask = 0L;
/* read the images if we don't have them already */
if (tw1image == NULL)
readTitleBarImages();
/* set the window attributes */
at.cursor = gActiveCursor;
valuemask |= CWCursor;
at.event_mask = ButtonPress;
valuemask |= CWEventMask;
/* create the windows for the buttons */
gWindow->fTitleBarButton1 =
XCreateSimpleWindow(gXDisplay, gWindow->fMainWindow, 1, 1, twwidth,
twheight, 0, gBorderColor, BACKCOLOR);
XChangeWindowAttributes(gXDisplay,gWindow->fTitleBarButton1,valuemask,&at);
gWindow->fTitleBarButton2 =
XCreateSimpleWindow(gXDisplay, gWindow->fMainWindow, 1, 1, twwidth,
twheight, 0, gBorderColor, BACKCOLOR);
XChangeWindowAttributes(gXDisplay,gWindow->fTitleBarButton2,valuemask,&at);
gWindow->fTitleBarButton3 =
XCreateSimpleWindow(gXDisplay, gWindow->fMainWindow, 1, 1, twwidth,
twheight, 0, gBorderColor, BACKCOLOR);
XChangeWindowAttributes(gXDisplay,gWindow->fTitleBarButton3,valuemask,&at);
gWindow->fTitleBarButton4 =
XCreateSimpleWindow(gXDisplay, gWindow->fMainWindow, 1, 1, twwidth,
twheight, 0, gBorderColor, BACKCOLOR);
XChangeWindowAttributes(gXDisplay,gWindow->fTitleBarButton4,valuemask,&at);
}
\end{chunk}
\subsection{showTitleBar}
\index{hypertex!showTitleBar}
\index{showTitleBar hypertex}
\begin{chunk}{hypertex}
void showTitleBar(void) {
XWindowChanges wc;
int height, hbw = (int) gWindow->border_width / 2;
XImage *image;
/*
* the first thing we do is pop up all the windows and
* place them properly
*/
if (gWindow->page->title->height != twheight)
height = gWindow->page->title->height;
else
height = twheight;
pushActiveGroup();
/* configure and map button number 1 */
wc.x = 0;
wc.y = 0;
wc.height = twheight;
wc.width = twwidth;
XConfigureWindow(gXDisplay, gWindow->fTitleBarButton1,
CWX | CWY | CWHeight | CWWidth, &wc);
XMapWindow(gXDisplay, gWindow->fTitleBarButton1);
image = tw1image;
XPutImage(gXDisplay, gWindow->fTitleBarButton1, gWindow->BUTTGC,
image, 0, 0, 0, 0, image->width, image->height);
/* configure and map button number 2 */
wc.x += twwidth + gWindow->border_width;
XConfigureWindow(gXDisplay, gWindow->fTitleBarButton2,
CWX | CWY | CWHeight | CWWidth, &wc);
XMapWindow(gXDisplay, gWindow->fTitleBarButton2);
image = need_help_button ? tw2image : noopimage;
XPutImage(gXDisplay, gWindow->fTitleBarButton2, gWindow->BUTTGC,
image, 0, 0, 0, 0, image->width, image->height);
/* configure and map button number 4 */
wc.x = gWindow->width - twwidth;
XConfigureWindow(gXDisplay, gWindow->fTitleBarButton4,
CWX | CWY | CWHeight | CWWidth, &wc);
XMapWindow(gXDisplay, gWindow->fTitleBarButton4);
image = need_up_button ? tw4image : noopimage;
XPutImage(gXDisplay, gWindow->fTitleBarButton4, gWindow->BUTTGC,
image, 0, 0, 0, 0, image->width, image->height);
/* configure and map button number 3 */
wc.x = wc.x - twwidth - gWindow->border_width;
XConfigureWindow(gXDisplay, gWindow->fTitleBarButton3,
CWX | CWY | CWHeight | CWWidth, &wc);
XMapWindow(gXDisplay, gWindow->fTitleBarButton3);
image = need_return_button ? tw3image : noopimage;
XPutImage(gXDisplay, gWindow->fTitleBarButton3, gWindow->BUTTGC,
image, 0, 0, 0, 0, image->width, image->height);
gWindow->fDisplayedWindow = gWindow->fMainWindow;
gDisplayRegion = Title;
gRegionOffset = 0;
yOff = 0;
popGroupStack();
showText(gWindow->page->title->next, Endheader);
/* Now draw the box around the title */
lineTopGroup();
XDrawLine(gXDisplay, gWindow->fMainWindow, gWindow->fStandardGC, 0,
height + hbw, gWindow->width, height + hbw);
popGroupStack();
}
\end{chunk}
\subsection{linkTitleBarWindows}
\index{hypertex!linkTitleBarWindows}
\index{linkTitleBarWindows hypertex}
\begin{chunk}{hypertex}
void linkTitleBarWindows(void) {
HyperLink *tw1link = (HyperLink *) halloc(sizeof(HyperLink), "HyperLink"),
*tw2link = (HyperLink *) halloc(sizeof(HyperLink), "HyperLink"),
*tw3link = (HyperLink *) halloc(sizeof(HyperLink), "HyperLink"),
*tw4link = (HyperLink *) halloc(sizeof(HyperLink), "HyperLink");
tw1link->win = gWindow->fTitleBarButton1;
tw1link->type = Quitbutton;
tw1link->reference.node = NULL;
tw1link->x = tw1link->y = 0;
tw2link->win = gWindow->fTitleBarButton2;
tw2link->type = Helpbutton;
tw2link->reference.node = NULL;
tw2link->x = tw2link->y = 0;
tw3link->win = gWindow->fTitleBarButton3;
tw3link->type = Returnbutton;
tw3link->reference.node = NULL;
tw3link->x = tw3link->y = 0;
tw4link->win = gWindow->fTitleBarButton4;
tw4link->type = Upbutton;
tw4link->reference.node = NULL;
tw4link->x = tw4link->y = 0;
hashInsert(gLinkHashTable, (char *)tw1link,(char *) &tw1link->win);
hashInsert(gLinkHashTable, (char *)tw2link,(char *) &tw2link->win);
hashInsert(gLinkHashTable, (char *)tw3link,(char *) &tw3link->win);
hashInsert(gLinkHashTable, (char *)tw4link,(char *) &tw4link->win);
}
\end{chunk}
\subsection{readTitleBarImages}
\index{hypertex!readTitleBarImages}
\index{readTitleBarImages hypertex}
\begin{chunk}{hypertex}
static void readTitleBarImages(void) {
int w, h;
char filename[128];
char *axiomEnvVar = NULL;
axiomEnvVar = getenv("AXIOM");
if (axiomEnvVar)
sprintf(filename, "%s/doc/bitmaps/%s", axiomEnvVar, tw1file);
else
sprintf(filename, "%s", tw1file);
tw1image = HTReadBitmapFile(gXDisplay, gXScreenNumber, filename,
&twwidth, &twheight);
if (axiomEnvVar)
sprintf(filename, "%s/doc/bitmaps/%s", axiomEnvVar, tw2file);
else
sprintf(filename, "%s", tw2file);
tw2image = HTReadBitmapFile(gXDisplay, gXScreenNumber, filename, &w, &h);
twwidth = ((twwidth >= w) ? (twwidth) : (w));
if (axiomEnvVar)
sprintf(filename, "%s/doc/bitmaps/%s", axiomEnvVar, tw3file);
else
sprintf(filename, "%s", tw3file);
tw3image = HTReadBitmapFile(gXDisplay, gXScreenNumber, filename, &w, &h);
twwidth = ((twwidth >= w) ? (twwidth) : (w));
if (axiomEnvVar)
sprintf(filename, "%s/doc/bitmaps/%s", axiomEnvVar, tw4file);
else
sprintf(filename, "%s", tw4file);
tw4image = HTReadBitmapFile(gXDisplay, gXScreenNumber, filename, &w, &h);
twwidth = ((twwidth >= w) ? (twwidth) : (w));
if (axiomEnvVar)
sprintf(filename, "%s/doc/bitmaps/%s", axiomEnvVar, noopfile);
else
sprintf(filename, "%s", noopfile);
noopimage = HTReadBitmapFile(gXDisplay, gXScreenNumber, filename,
&twwidth, &twheight);
}
\end{chunk}
\subsection{getTitleBarMinimumSize}
\index{hypertex!getTitleBarMinimumSize}
\index{getTitleBarMinimumSize hypertex}
\begin{chunk}{hypertex}
void getTitleBarMinimumSize(int *width, int *height) {
(*width) = 4 * twwidth + 40;
(*height) = twheight + 2;
}
\end{chunk}
\subsection{main}
Initialize hash tables, signal handlers and windows, then call the main
event handling loop
\index{hypertex!main}
\index{main hypertex}
\begin{chunk}{hypertex}
int main(int argc, char **argv) {
int ret_status;
/* Initialize some global values */
/* fprintf(stderr,"hyper:main:entered\n");*/
gArgc = argc;
gArgv = argv;
gIsEndOfOutput = 1;
/* fprintf(stderr,"hyper:main:calling checkArguments\n");*/
checkArguments();
/* fprintf(stderr,"hyper:main:returned checkArguments\n");*/
/*
* initialize the hash tables for the files and the windows and images
*/
/* fprintf(stderr,"hyper:main:calling initHash\n");*/
initHash();
/* fprintf(stderr,"hyper:main:returned initHash\n");*/
/*
* initialize the parser keyword hash table
*/
/* fprintf(stderr,"hyper:main:calling parserInit\n");*/
parserInit();
/* fprintf(stderr,"hyper:main:returned parserInit\n");*/
/* fprintf(stderr,"hyper:main:calling readHtDb\n");*/
readHtDb(&init_page_hash, &init_macro_hash, &init_patch_hash);
/* fprintf(stderr,"hyper:main:returned readHtDb\n");*/
/*
* Now initialize x. This includes opening the display, setting the
* screen and display global values, and also gets all the fonts and
* colors we will need.
*/
if (!make_input_file && !gmakeRecord_file && !gverifyRecord_file) {
/* fprintf(stderr,"hyper:main:calling initializeWindowSystem\n");*/
initializeWindowSystem();
/* fprintf(stderr,"hyper:main:returned initializeWindowSystem\n");*/
/*
* Initialize some of the global values used by the input string
* routines
*/
/* fprintf(stderr,"hyper:main:calling initKeyin\n");*/
initKeyin();
/* fprintf(stderr,"hyper:main:returned initKeyin\n");*/
/*
* regardless of what else happened, we should always pop up an
* initial window.
*/
/* fprintf(stderr,"hyper:main:calling initTopWindow\n");*/
ret_status = initTopWindow("RootPage");
/* fprintf(stderr,"hyper:main:returned initTopWindow\n");*/
gParentWindow = gWindow;
if (ret_status == -1) {
fprintf(stderr,
"(HyperDoc) Could not find RootPage for top-level window.\n");
exit(-1);
}
/*
* Tell it how to handle the user defined signals I may get
*/
bsdSignal(SIGUSR2, sigusr2Handler,RestartSystemCalls);
bsdSignal(SIGUSR1, SIG_IGN,RestartSystemCalls);
bsdSignal(SIGCHLD, sigcldHandler,RestartSystemCalls);
bsdSignal(SIGINT, SIG_IGN,RestartSystemCalls);
/*
* Now go to the main event loop. I will never return, so just end
* the main routine after that
*/
/*
* make an input file if requested
*/
}
else {
/*
* Try to establish all the socket connections I need. If I am an
* gIsAxiomServer and the routine fails, it will exit for me
*/
/* fprintf(stderr,"hyper:main:in else case\n");*/
/* fprintf(stderr,"hyper:main:calling makeServerConnections\n");*/
makeServerConnections();
/* fprintf(stderr,"hyper:main:returned makeServerConnections\n");*/
if (make_input_file) ht2Input();
if (gmakeRecord_file) makeRecord();
if (gverifyRecord_file) verifyRecord();
exit(0);
}
/*
* Try to establish all the socket connections I need. If I am an
* gIsAxiomServer and the routine fails, it will exit for me
*/
/* fprintf(stderr,"hyper:main:calling makeServerConnections\n");*/
makeServerConnections();
/* fprintf(stderr,"hyper:main:returned makeServerConnections\n");*/
/* fprintf(stderr,"hyper:main:calling mainEventLoop\n");*/
mainEventLoop();
/* fprintf(stderr,"hyper:main:returned mainEventLoop\n");*/
return 0;
}
\end{chunk}
\chapter{The htsearch script}
Construct a page with a menu of references to the word.
The syntax of the command is:
\begin{verbatim}
htsearch word
\end{verbatim}
\begin{chunk}{htsearch}
#!/bin/sh
htbindir=$AXIOM/lib
htpagedir=$AXIOM/doc
if test -z "$1"
then
echo ""|$htbindir/presea case=1 -
else
( cd $htpagedir; $htbindir/hthits "$1" $htpagedir/ht.db | sort -r -n -k 1.22 | $htbindir/presea case=0 expr="$1" -)
fi
\end{chunk}
\chapter{The presea script}
This is part of 'presea' which is is run on output
of 'hthits'. 'hthits' outputs looks like:
\begin{verbatim}
\newsearchresultentry{1}{Asp24 Example Code}{Asp24ExampleCode}
\newsearchresultentry{1}{Asp27 Example Code}{Asp27ExampleCode}
....
\end{verbatim}
after splitting on ``\{'' the first field is \verb|'\newsearchresultentry'|
and the second is number of occurences of search term in the page. The
test for \verb|'j >= 2'| is just to tolerate garbage. presea is supposed
to count the number of matches and put it in the header for search
results. The previous version reported no matches in the header.
This used to read:
\begin{verbatim}
a[n] = $0;
n=n+1;
j=split($0,b,"{");
m=m+substr(b[j],1,length(b[j])-1);
\end{verbatim}
\begin{chunk}{presea}
#!/bin/awk -f
BEGIN {n=0;m=0
}
{
a[n] = $0;
n=n+1;
j=split($0,b,"{");
if (j >= 2)
m=m+substr(b[2],1,length(b[2])-1);
}
END {
printf ("\\begin{page}{staticsearchpage}");
if (case==1)
printf ("{No matches found}\n")
else if ( n==0 || m==0 )
printf ("{No matches found for {\\em %s}}\n",expr)
else
printf ("{%d matches found in %d pages for {\\em %s}}\n",m,n,expr);
printf ("Matches\\tab{8}in Page\n");
printf "\\beginscroll\n";
printf "\\beginmenu\n";
for(i=0;i<n;i++) printf ("%s\n",a[i]);
printf "\\endmenu\n";
printf "\\endscroll\n";
printf "\\end{page}\n";
}
\end{chunk}
\section{token.h}
\begin{chunk}{include/token.h}
/*
Here are a couple of flags added for whitespace stuff. They tell
punctuation if there was space in front of it or not
*/
#define FRONTSPACE 0001
#define BACKSPACE 0002
/*
User tokens. ie, these can be found on a page
*/
#define Word 1
#define Page 2
#define Lispcommandquit 3
#define BoldFace 4
#define Link 5
#define Downlink 6
#define Beginscroll 7
#define Spadcommand 8
#define NoLines 9
#define Env 10
#define Par 11
#define Center 12
#define Begin 13
#define Beginitems 14
#define Item 15
#define Table 16
#define Box 17
#define Tab 18
#define Space 19
#define Indent 20
#define Horizontalline 21
#define Newline 22
#define Enditems 23
#define Returnbutton 24
#define Memolink 25
#define Upbutton 26
#define Endscroll 27
#define Thispage 28
#define Returnto 29
#define Free 30
#define Bound 31
#define Lisplink 32
#define Unixlink 33
#define Mbox 34
#define Inputstring 35
#define StringValue 36
#define Spadlink 37
#define Inputbitmap 38
#define Inputpixmap 39
#define Unixcommand 40
#define Emphasize 41
#define Lispcommand 42
#define LispMemoLink 43
#define LispDownLink 44
#define Spadcall 45
#define Spadcallquit 46
#define Spaddownlink 47
#define Spadmemolink 48
#define Qspadcall 49
#define Qspadcallquit 50
#define SimpleBox 51
#define Radioboxes 52
#define BoxValue 53
#define VSpace 54
#define HSpace 55
#define NewCommand 56
#define WindowId 57
#define Beep 58
#define Quitbutton 59
#define Begintitems 60
#define Titem 61
#define End 62
#define It 63
#define Sl 64
#define Tt 65
#define Rm 66
#define Ifcond 67
#define Else 68
#define Fi 69
#define Newcond 70
#define Setcond 71
#define Button 72
#define Windowlink 73
#define Haslisp 74
#define Hasup 75
#define Hasreturn 76
#define Hasreturnto 77
#define Lastwindow 78
#define Endtitems 79
#define Lispwindowlink 80
#define Beginpile 81
#define Endpile 82
#define Nextline 83
#define Pastebutton 84
#define Color 85
#define Helppage 86
#define Patch 87
#define Radiobox 88
#define ifrecond 89
#define Math 90
#define Mitem 91
#define Pagename 92
#define Examplenumber 93
#define Replacepage 94
#define Inputimage 95
#define Spadgraph 96
#define Indentrel 97
#define Controlbitmap 98
#define NumberUserTokens 98
/* places from which input may be read */
#define FromFile 1
#define FromString 2
#define FromSpadSocket 3
#define FromUnixFD 4
extern FILE *unixfd;
/*
* Here are the system tokens. These are used internally to help
* with parsing and displaying of text
*/
#define SystemTokens 1001
#define Lbrace 1001
#define Rbrace 1002
#define Macro 1003
#define Group 1004
#define Scrollbar 1005
#define Pound 1006
#define Lsquarebrace 1007
#define Rsquarebrace 1008
#define Punctuation 1009
#define Dash 1010
#define Tableitem 1011
#define Scrollingnode 1012
#define Headernode 1013
#define Footernode 1014
#define Verbatim 1015
#define Scroll 1016
#define Dollar 1017
#define Percent 1018
#define Carrot 1019
#define Underscore 1020
#define Tilde 1021
#define Cond 1022
#define Noop 1023
#define Description 1024
#define Icorrection 1025
#define Boxcond 1026
#define Unkeyword 1027
#define Titlenode 1028
#define Paste 1029
#define Spadsrc 1030
#define Helpbutton 1031
#define Spadsrctxt 1032
/*
* Here are the tokens used to mark the end to some sort of group of
* tokens. ie, the tokens found in a centerline command
*/
#define Endtokens 2000
#define End1 2001
#define End2 2002
#define Endbutton 2003
#define Endlink 2004
#define Endheader 2005
#define Endfooter 2006
#define Endscrolling 2007
#define Endgroup 2008
#define Endarg 2009
#define Endbox 2010
#define Endmbox 2011
#define Endspadcommand 2012
#define Endpix 2013
#define Endmacro 2014
#define Endparameter 2015
#define Endtable 2016
#define Endtableitem 2017
#define End3 2018
#define Endif 2019
#define Enddescription 2020
#define Endinputbox 2021
#define Endtitle 2022
#define Endpastebutton 2023
#define Endtypes 3000
#define Endpage 3002
#define EndScroll 3007/* use S because Endscroll is already a keyword */
#define Endcenter 3012
#define EndItems 3014 /* use I because Enditems is already a keyword */
#define EndTitems 3060 /* Ibid for the T */
#define Endpatch 3087
#define Endverbatim 4015
#define Endmath 4016
#define Endpaste 4029
#define Endspadsrc 4030
\end{chunk}
\chapter{The Bitmaps}
\section{ht\_icon}
\begin{chunk}{hticon}
#define ht_icon_width 40
#define ht_icon_height 40
#define ht_icon_x_hot -1
#define ht_icon_y_hot -1
static char ht_icon_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00,
0x00, 0xe7, 0x00, 0x00, 0x00, 0x00, 0xe7, 0xef, 0x7b, 0x3c, 0xe7, 0xff,
0xef, 0x7f, 0x7e, 0xff, 0xff, 0xe7, 0xef, 0xe7, 0xfe, 0xe7, 0x6e, 0xe7,
0xe7, 0xde, 0xe7, 0x7e, 0xe7, 0xff, 0x0e, 0xe7, 0x3c, 0xe7, 0x07, 0x0e,
0xe7, 0x3c, 0xf7, 0xcf, 0x0e, 0xf7, 0x18, 0x7f, 0xfe, 0x1f, 0x00, 0x1c,
0x3f, 0x7c, 0x1f, 0x00, 0x0e, 0x07, 0x00, 0x00, 0x00, 0x0f, 0x07, 0x00,
0x00, 0x00, 0x87, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x80, 0x7f, 0x00, 0x00, 0x00,
0x00, 0x77, 0x00, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x00, 0x77,
0x00, 0x00, 0x00, 0x00, 0x77, 0x3e, 0xdc, 0x00, 0x00, 0x77, 0x7f, 0xfe,
0x00, 0x00, 0xf7, 0xe3, 0xef, 0x00, 0x00, 0xf7, 0xe3, 0xc7, 0x00, 0x00,
0xf7, 0xe3, 0x07, 0x00, 0x00, 0xf7, 0xe3, 0x07, 0x00, 0x00, 0xf7, 0xe3,
0xcf, 0x00, 0x80, 0x7f, 0x7f, 0xfe, 0x00, 0x80, 0x3f, 0x3e, 0x7c, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
\end{chunk}
\section{exit.bitmap}
\begin{chunk}{exit.bitmap}
#define exit_width 60
#define exit_height 30
#define exit_x_hot -1
#define exit_y_hot -1
static char exit_bits[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xcf, 0x3f,
0xcf, 0x03, 0xc0, 0xff, 0x3f, 0x00, 0x8e, 0x3f, 0x8e, 0x03, 0x80, 0xff,
0x3f, 0x00, 0x1e, 0x1f, 0x8f, 0x07, 0x80, 0xff, 0x3f, 0xfe, 0x1f, 0x1f,
0x8f, 0x7f, 0xfc, 0xff, 0x3f, 0xfe, 0x3f, 0x8e, 0x8f, 0x7f, 0xfc, 0xff,
0x3f, 0xfe, 0x3f, 0x8e, 0x8f, 0x7f, 0xfc, 0xff, 0x3f, 0xfe, 0x7f, 0xc4,
0x8f, 0x7f, 0xfc, 0xff, 0x3f, 0xfe, 0x7f, 0xc4, 0x8f, 0x7f, 0xfc, 0xff,
0x3f, 0xfe, 0xff, 0xe0, 0x8f, 0x7f, 0xfc, 0xff, 0x3f, 0x80, 0xff, 0xe0,
0x8f, 0x7f, 0xfc, 0xff, 0x3f, 0x00, 0xff, 0xf1, 0x8f, 0x7f, 0xfc, 0xff,
0x3f, 0x00, 0xff, 0xf1, 0x8f, 0x7f, 0xfc, 0xff, 0x3f, 0xfe, 0xff, 0xe0,
0x8f, 0x7f, 0xfc, 0xff, 0x3f, 0xfe, 0xff, 0xe0, 0x8f, 0x7f, 0xfc, 0xff,
0x3f, 0xfe, 0x7f, 0xc4, 0x8f, 0x7f, 0xfc, 0xff, 0x3f, 0xfe, 0x7f, 0xc4,
0x8f, 0x7f, 0xfc, 0xff, 0x3f, 0xfe, 0x3f, 0x8e, 0x8f, 0x7f, 0xfc, 0xff,
0x3f, 0xfe, 0x3f, 0x8e, 0x8f, 0x7f, 0xfc, 0xff, 0x3f, 0xfe, 0x1f, 0x1f,
0x8f, 0x7f, 0xfc, 0xff, 0x3f, 0x00, 0x1f, 0x1f, 0x8f, 0x7f, 0xfc, 0xff,
0x3f, 0x00, 0x8e, 0x3f, 0x8e, 0x7f, 0xfc, 0xff, 0x7f, 0x00, 0x9e, 0x7f,
0x9e, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
\end{chunk}
\section{help2.bitmap}
\begin{chunk}{help2.bitmap}
#define help2_width 60
#define help2_height 30
#define help2_x_hot -1
#define help2_y_hot -1
static char help2_bits[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x9f, 0x9f, 0x07, 0xf0,
0xfc, 0x0f, 0xf0, 0xff, 0x1f, 0x1f, 0x07, 0xe0, 0xf8, 0x0f, 0xe0, 0xff,
0x1f, 0x1f, 0x07, 0xe0, 0xf8, 0x0f, 0xc0, 0xff, 0x1f, 0x1f, 0xc7, 0xff,
0xf8, 0x8f, 0x87, 0xff, 0x1f, 0x1f, 0xc7, 0xff, 0xf8, 0x8f, 0x8f, 0xff,
0x1f, 0x1f, 0xc7, 0xff, 0xf8, 0x8f, 0x8f, 0xff, 0x1f, 0x1f, 0xc7, 0xff,
0xf8, 0x8f, 0x8f, 0xff, 0x1f, 0x1f, 0xc7, 0xff, 0xf8, 0x8f, 0x8f, 0xff,
0x1f, 0x1f, 0xc7, 0xff, 0xf8, 0x8f, 0x8f, 0xff, 0x1f, 0x00, 0x07, 0xf8,
0xf8, 0x8f, 0x87, 0xff, 0x1f, 0x00, 0x07, 0xf0, 0xf8, 0x0f, 0xc0, 0xff,
0x1f, 0x00, 0x07, 0xf0, 0xf8, 0x0f, 0xe0, 0xff, 0x1f, 0x1f, 0xc7, 0xff,
0xf8, 0x0f, 0xf0, 0xff, 0x1f, 0x1f, 0xc7, 0xff, 0xf8, 0x8f, 0xff, 0xff,
0x1f, 0x1f, 0xc7, 0xff, 0xf8, 0x8f, 0xff, 0xff, 0x1f, 0x1f, 0xc7, 0xff,
0xf8, 0x8f, 0xff, 0xff, 0x1f, 0x1f, 0xc7, 0xff, 0xf8, 0x8f, 0xff, 0xff,
0x1f, 0x1f, 0xc7, 0xff, 0xf8, 0x8f, 0xff, 0xff, 0x1f, 0x1f, 0xc7, 0xff,
0xf8, 0x8f, 0xff, 0xff, 0x1f, 0x1f, 0x07, 0xf0, 0x00, 0x8f, 0xff, 0xff,
0x1f, 0x1f, 0x07, 0xe0, 0x00, 0x8e, 0xff, 0xff, 0x3f, 0x3f, 0x0f, 0xe0,
0x01, 0x9c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
\end{chunk}
\section{return3.bitmap}
\begin{chunk}{return3.bitmap}
#define return3_width 60
#define return3_height 30
#define return3_x_hot -1
#define return3_y_hot -1
static char return3_bits[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x9f, 0x9f, 0x0f, 0xf8,
0xfc, 0x79, 0x00, 0xff, 0x1f, 0x1f, 0x07, 0xf0, 0xf8, 0x71, 0x00, 0xfe,
0x1f, 0x1f, 0x07, 0xe0, 0xf0, 0x70, 0x00, 0xfe, 0x1f, 0x1f, 0xc7, 0xe3,
0xf0, 0x70, 0xfc, 0xff, 0x1f, 0x1f, 0xc7, 0xe3, 0xf0, 0x70, 0xfc, 0xff,
0x1f, 0x1f, 0xc7, 0xe3, 0x60, 0x70, 0xfc, 0xff, 0x1f, 0x1f, 0xc7, 0xe3,
0x60, 0x70, 0xfc, 0xff, 0x1f, 0x1f, 0xc7, 0xe3, 0x00, 0x70, 0xfc, 0xff,
0x1f, 0x1f, 0xc7, 0xe3, 0x08, 0x71, 0xfc, 0xff, 0x1f, 0x00, 0xc7, 0xe3,
0x08, 0x71, 0x80, 0xff, 0x1f, 0x00, 0xc7, 0xe3, 0x98, 0x71, 0x00, 0xff,
0x1f, 0x00, 0xc7, 0xe3, 0x98, 0x71, 0x00, 0xff, 0x1f, 0x1f, 0xc7, 0xe3,
0xf8, 0x71, 0xfc, 0xff, 0x1f, 0x1f, 0xc7, 0xe3, 0xf8, 0x71, 0xfc, 0xff,
0x1f, 0x1f, 0xc7, 0xe3, 0xf8, 0x71, 0xfc, 0xff, 0x1f, 0x1f, 0xc7, 0xe3,
0xf8, 0x71, 0xfc, 0xff, 0x1f, 0x1f, 0xc7, 0xe3, 0xf8, 0x71, 0xfc, 0xff,
0x1f, 0x1f, 0xc7, 0xe3, 0xf8, 0x71, 0xfc, 0xff, 0x1f, 0x1f, 0xc7, 0xe3,
0xf8, 0x71, 0xfc, 0xff, 0x1f, 0x1f, 0x07, 0xe0, 0xf8, 0x71, 0x00, 0xff,
0x1f, 0x1f, 0x0f, 0xe0, 0xf8, 0x71, 0x00, 0xfe, 0x3f, 0x3f, 0x1f, 0xf0,
0xf9, 0xf3, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
\end{chunk}
\section{up3.bitmap}
\begin{chunk}{up3.bitmap}
#define up3_width 60
#define up3_height 30
static char up3_bits[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff,
0xff, 0xff, 0x7f, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00,
0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0xff,
0xff, 0xff, 0x01, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xe0, 0xff, 0xff, 0xff,
0xff, 0xff, 0x3f, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xe0, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
\end{chunk}
\section{noop.bitmap}
\begin{chunk}{noop.bitmap}
#define noop_width 60
#define noop_height 30
#define noop_x_hot -1
#define noop_y_hot -1
static char noop_bits[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
\end{chunk}
\section{exit3d.bitmap}
\begin{chunk}{exit3d.bitmap}
#define exit3d.bitmap_width 60
#define exit3d.bitmap_height 30
static char exit3d.bitmap_bits[] = {
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x0a, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c,
0x51, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x07, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0x0e, 0x51, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x07,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x0e, 0xd1, 0xff, 0x55, 0x55,
0x5d, 0x55, 0x55, 0x07, 0xaa, 0xff, 0xaa, 0xaa, 0xbe, 0xaa, 0xaa, 0x0e,
0xd1, 0xd7, 0x55, 0x55, 0x5f, 0xd5, 0x55, 0x07, 0xaa, 0xab, 0xaa, 0xaa,
0xae, 0xea, 0xaa, 0x0e, 0xd1, 0x57, 0x55, 0x55, 0x55, 0xf5, 0x55, 0x07,
0xaa, 0xab, 0xaa, 0xaa, 0xaa, 0xea, 0xaa, 0x0e, 0xd1, 0x77, 0x7d, 0x5f,
0x5f, 0xfd, 0x5f, 0x07, 0xaa, 0xbf, 0xbe, 0xae, 0xbe, 0xfa, 0xaf, 0x0e,
0xd1, 0x7f, 0x7d, 0x57, 0x5d, 0xf5, 0x55, 0x07, 0xaa, 0xab, 0xfa, 0xab,
0xbe, 0xea, 0xaa, 0x0e, 0xd1, 0x57, 0xf5, 0x55, 0x5d, 0xf5, 0x55, 0x07,
0xaa, 0xab, 0xea, 0xab, 0xbe, 0xea, 0xaa, 0x0e, 0xd1, 0x57, 0xd5, 0x57,
0x5d, 0xf5, 0x55, 0x07, 0xaa, 0xab, 0xea, 0xaf, 0xbe, 0xea, 0xaa, 0x0e,
0xd1, 0xd7, 0x75, 0x5f, 0x5d, 0xf5, 0x55, 0x07, 0xaa, 0xff, 0xba, 0xbe,
0xbe, 0xea, 0xaf, 0x0e, 0xd1, 0xff, 0x7d, 0x5f, 0x7f, 0xd5, 0x57, 0x07,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x0e, 0x51, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x07, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x0e,
0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x05};
\end{chunk}
\section{help3d.bitmap}
\begin{chunk}{help3d.bitmap}
#define help3d.bitmap_width 60
#define help3d.bitmap_height 30
static char help3d.bitmap_bits[] = {
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x0a, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x07, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c,
0x51, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x07, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0x0e, 0x51, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x07,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x0e, 0xd1, 0xf7, 0x55, 0x55,
0x5f, 0x55, 0x55, 0x07, 0xaa, 0xeb, 0xaa, 0xaa, 0xbe, 0xaa, 0xaa, 0x0e,
0xd1, 0xf7, 0x55, 0x55, 0x5d, 0x55, 0x55, 0x07, 0xaa, 0xeb, 0xaa, 0xaa,
0xbe, 0xaa, 0xaa, 0x0e, 0xd1, 0xf7, 0x55, 0x55, 0x5d, 0x55, 0x55, 0x07,
0xaa, 0xeb, 0xaa, 0xaa, 0xbe, 0xaa, 0xaa, 0x0e, 0xd1, 0xf7, 0xf5, 0x57,
0x5d, 0xdd, 0x57, 0x07, 0xaa, 0xff, 0xfa, 0xaf, 0xbe, 0xfa, 0xaf, 0x0e,
0xd1, 0xff, 0x7d, 0x5f, 0x5d, 0x7d, 0x5f, 0x07, 0xaa, 0xeb, 0xbe, 0xae,
0xbe, 0xba, 0xbe, 0x0e, 0xd1, 0xf7, 0xfd, 0x5f, 0x5d, 0x7d, 0x5d, 0x07,
0xaa, 0xeb, 0xfe, 0xaf, 0xbe, 0xba, 0xbe, 0x0e, 0xd1, 0xf7, 0x5d, 0x55,
0x5d, 0x7d, 0x5d, 0x07, 0xaa, 0xeb, 0xbe, 0xaa, 0xbe, 0xba, 0xbe, 0x0e,
0xd1, 0xf7, 0x7d, 0x5d, 0x5d, 0x7d, 0x5f, 0x07, 0xaa, 0xeb, 0xfa, 0xaf,
0xbe, 0xfa, 0xaf, 0x0e, 0xd1, 0xf7, 0xf5, 0x57, 0x7f, 0xfd, 0x57, 0x07,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xba, 0xaa, 0x0e, 0x51, 0x55, 0x55, 0x55,
0x55, 0x7d, 0x55, 0x07, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xba, 0xaa, 0x0e,
0xf9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x05};
\end{chunk}
\section{home3d.bitmap}
\begin{chunk}{home3d.bitmap}
#define home3d.bitmap_width 60
#define home3d.bitmap_height 30
static char home3d.bitmap_bits[] = {
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x05, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0x0e, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x0e, 0x51, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x07, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x0e,
0x51, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x07, 0xaa, 0xef, 0xab, 0xaa,
0xaa, 0xaa, 0xaa, 0x0e, 0x51, 0xd7, 0x55, 0x55, 0x55, 0x55, 0x55, 0x07,
0xaa, 0xef, 0xab, 0xaa, 0xaa, 0xaa, 0xaa, 0x0e, 0x51, 0xd7, 0x55, 0x55,
0x55, 0x55, 0x55, 0x07, 0xaa, 0xef, 0xab, 0xaa, 0xaa, 0xaa, 0xaa, 0x0e,
0x51, 0xd7, 0x55, 0x55, 0x55, 0x55, 0x55, 0x07, 0xaa, 0xef, 0xeb, 0xaf,
0xbb, 0xeb, 0xaf, 0x0e, 0x51, 0xff, 0xf5, 0xdf, 0xff, 0xf7, 0x5f, 0x07,
0xaa, 0xff, 0xfb, 0xae, 0xbb, 0xfb, 0xbe, 0x0e, 0x51, 0xd7, 0x7d, 0xdd,
0xff, 0x7f, 0x5d, 0x07, 0xaa, 0xef, 0xbb, 0xbe, 0xbb, 0xfb, 0xbf, 0x0e,
0x51, 0xd7, 0x7d, 0xdd, 0xff, 0xff, 0x5f, 0x07, 0xaa, 0xef, 0xbb, 0xbe,
0xbb, 0xbb, 0xaa, 0x0e, 0x51, 0xd7, 0x7d, 0xdd, 0xff, 0x7f, 0x55, 0x07,
0xaa, 0xef, 0xfb, 0xae, 0xbb, 0xfb, 0xba, 0x0e, 0x51, 0xd7, 0xf5, 0xdf,
0xff, 0xf7, 0x5f, 0x07, 0xaa, 0xef, 0xeb, 0xaf, 0xbb, 0xeb, 0xaf, 0x0e,
0x51, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x07, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0x0e, 0x51, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x07,
0xfa, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x07, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x0a};
\end{chunk}
\section{up3d.bitmap}
\begin{chunk}{up3d.bitmap}
#define up3_width 60
#define up3_height 30
static char up3_bits[] = {
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x0a, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c,
0x51, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x07, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0x0e, 0x51, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x07,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x0e, 0x51, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x07, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x0e,
0x51, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x07, 0xaa, 0xaa, 0xaa, 0xfa,
0xab, 0xaa, 0xaa, 0x0e, 0x51, 0x55, 0x55, 0xfd, 0x57, 0x55, 0x55, 0x07,
0xaa, 0xaa, 0xaa, 0xff, 0xbf, 0xaa, 0xaa, 0x0e, 0x51, 0x55, 0xd5, 0xff,
0x7f, 0x55, 0x55, 0x07, 0xaa, 0xaa, 0xfa, 0xff, 0xff, 0xab, 0xaa, 0x0e,
0x51, 0x55, 0xfd, 0xff, 0xff, 0x57, 0x55, 0x07, 0xaa, 0xaa, 0xaa, 0xff,
0xbf, 0xaa, 0xaa, 0x0e, 0x51, 0x55, 0xd5, 0xff, 0x7f, 0x55, 0x55, 0x07,
0xaa, 0xaa, 0xaa, 0xff, 0xbf, 0xaa, 0xaa, 0x0e, 0x51, 0x55, 0xd5, 0xff,
0x7f, 0x55, 0x55, 0x07, 0xaa, 0xaa, 0xaa, 0xff, 0xbf, 0xaa, 0xaa, 0x0e,
0x51, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x07, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0x0e, 0x51, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x07,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x0e, 0x51, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x07, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x0e,
0xf9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x05};
\end{chunk}
\section{noop3d.bitmap}
\begin{chunk}{noop3d.bitmap}
#define noop_width 60
#define noop_height 30
static char noop_bits[] = {
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x0a, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c,
0x51, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x07, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0x0e, 0x51, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x07,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x0e, 0x51, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x07, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x0e,
0x51, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x07, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0x0e, 0x51, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x07,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x0e, 0x51, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x07, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x0e,
0x51, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x07, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0x0e, 0x51, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x07,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x0e, 0x51, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x07, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x0e,
0x51, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x07, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0x0e, 0x51, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x07,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x0e, 0x51, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x07, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x0e,
0xf9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x05};
\end{chunk}
\eject
\begin{thebibliography}{99}
\bibitem{1} nothing
\end{thebibliography}
\end{document}
\end{chunk}
\chapter{Makefile}
\begin{chunk}{*}
BOOK=${SPD}/books/bookvol7.pamphlet
WORK=${OBJ}/${SYS}/hyper
IN=${SPD}/books
# this is where to put the various commands
OUTBIN= ${MNT}/${SYS}/bin
OUTLIB= ${MNT}/${SYS}/lib
# this is where the include files live
INC= ${SRC}/include
# this is where we hid the libspad library
LIB= ${OBJ}/${SYS}/lib
HYPER=${MNT}/${SYS}/doc
CFLAGS= ${CCF}
LDFLAGS= -L${LIB} -lspad ${LDF} -lX11 -lXpm
LIBS = ${LIB}/sockio-c.o ${LIB}/bsdsignal.o
SPADBUF_LIBS=${LIBS} ${LIB}/wct.o ${LIB}/edin.o ${LIB}/prt.o \
${LIB}/cursor.o ${LIB}/fnct-key.o
HYPER_LIBS=${LIBS} ${LIB}/pixmap.o ${LIB}/spadcolors.o ${LIB}/util.o
all: announce ${OUTLIB}/spadbuf ${OUTLIB}/ex2ht ${OUTBIN}/htadd \
${OUTLIB}/hthits \
${OUTBIN}/htsearch ${OUTLIB}/presea ${OUTBIN}/hypertex \
${HYPER}/axbook ${HYPER}/bigbayou.png ${HYPER}/doctitle.png finish
@cp -pr ${IN}/bitmaps ${HYPER}
@ echo 0 finished ${BOOK}
announce:
@ echo ==========================
@ echo Making hyperdoc bookvol7
@ echo ==========================
finish:
@ echo ==========================
@ echo Finish hyperdoc bookvol7
@ echo ==========================
${OUTLIB}/spadbuf: ${BOOK}
@ echo 1 making ${OUTLIB}/spadbuf from ${BOOK}
@ (cd ${WORK} ; \
echo '(tangle "${BOOK}" "spadbuf" "spadbuf.c")' | \
${OBJ}/${SYS}/bin/lisp ; \
${CC} -I${INC} ${CFLAGS} spadbuf.c -o ${OUTLIB}/spadbuf ${LDFLAGS} )
${OUTLIB}/ex2ht: ${BOOK}
@ echo 2 making ${OUTLIB}/ex2ht from ${BOOK}
@ (cd ${WORK} ; \
echo '(tangle "${BOOK}" "ex2ht" "ex2ht.c")' | \
${OBJ}/${SYS}/bin/lisp ; \
${CC} -I${INC} ${CFLAGS} ex2ht.c -o ${OUTLIB}/ex2ht ${LDFLAGS} )
${OUTBIN}/htadd: ${BOOK}
@ echo 3 making ${OUTBIN}/htadd from ${BOOK}
@ (cd ${WORK} ; \
echo '(tangle "${BOOK}" "htadd" "htadd.c")' | \
${OBJ}/${SYS}/bin/lisp ; \
${CC} -I${INC} ${CFLAGS} htadd.c -o ${OUTBIN}/htadd ${LDFLAGS} )
${OUTLIB}/hthits: ${BOOK}
@ echo 4 making ${OUTBIN}/hthits from ${BOOK}
@ (cd ${WORK} ; \
echo '(tangle "${BOOK}" "hthits" "hthits.c")' | \
${OBJ}/${SYS}/bin/lisp ; \
${CC} -I${INC} ${CFLAGS} hthits.c -o ${OUTLIB}/hthits ${LDFLAGS} )
${OUTBIN}/htsearch: ${BOOK}
@echo 5 making ${OUTBIN}/htsearch from ${BOOK}
@ echo '(tangle "${BOOK}" "htsearch" "${OUTBIN}/htsearch")' | \
${OBJ}/${SYS}/bin/lisp
@chmod a+x ${OUTBIN}/htsearch
${OUTLIB}/presea: ${BOOK}
@echo 6 making ${OUTLIB}/presea from ${BOOK}
@ echo '(tangle "${BOOK}" "presea" "${OUTLIB}/presea")' | \
${OBJ}/${SYS}/bin/lisp
@chmod a+x ${OUTLIB}/presea
${OUTBIN}/hypertex: ${BOOK}
@ echo 7 ${OUTBIN}/hypertex from ${BOOK}
@ (cd ${WORK} ; \
echo '(tangle "${BOOK}" "hypertex" "hypertex.c")' | \
${OBJ}/${SYS}/bin/lisp ; \
${CC} -I${INC} ${CFLAGS} hypertex.c -o ${OUTBIN}/hypertex \
${LDFLAGS} -lX11 -lm -L${LIB} )
${HYPER}/bigbayou.png: ${IN}/ps/bigbayou.png
@ echo 8 making ${HYPER}/bigbayou.png from ${IN}/bigbayou.png
@ cp ${IN}/ps/bigbayou.png ${HYPER}/bigbayou.png
${HYPER}/doctitle.png: ${IN}/ps/doctitle.png
@ echo 9 making ${HYPER}/doctitle.png from ${IN}/doctitle.png
@ cp ${IN}/ps/doctitle.png ${HYPER}/doctitle.png
${HYPER}/axbook: ${IN}/axbook.tgz
@ echo 10 making ${HYPER}/axbook/xhtml from ${IN}/axbook.tgz
@( cd ${HYPER} ; tar -zxf ${IN}/axbook.tgz )
\end{chunk}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{Bibliography}
\bibliographystyle{axiom}
\bibliography{axiom}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{Index}
\printindex
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
|