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
|
2024-12-31 Sergey Poznyakoff <gray@gnu.org>
Version 2.12
2024-11-01 Sergey Poznyakoff <gray@gnu.org>
Remove a left-over file
2024-10-30 Sergey Poznyakoff <gray@gnu.org>
Bugfixes
* doc/Makefile.am: Fix EXTRA_DIST
* modules/gcide/gcide.c (gcide_run_idxgcide): Fix memory overrun.
2024-10-22 Sergey Poznyakoff <gray@gnu.org>
gcide: lock index file while reindexing
This updates commit 8495600e8d.
* doc/dico.texi: Document changes.
* modules/gcide/gcide.c (gcide_run_idxgcide): New function.
Replaces run_idxgcide. The value of the fd parameter, unless
0 or negative, will be passed to the indexer via the -# option.
(gcide_db_reindex): New function.
(reload_if_changed): Use gcide_db_reindex.
(gcide_match, gcide_define): Lock the index file while collecting
matches.
* modules/gcide/gcide.h (gcide_idx_file_open): Change prototype.
(gcide_idx_lock, gcide_idx_unlock)
(gcide_idx_reopen, gcide_idx_fileno): New protos.
* modules/gcide/idx.c (gcide_idx_lock, gcide_idx_unlock)
(gcide_idx_reopen, gcide_idx_fileno): New functions.
(gcide_idx_file_open): Take additional argument specifying if the
index should be opened in read-write mode.
* modules/gcide/idxgcide-cli.opt: New option -#.
* modules/gcide/idxgcide.l (main): Optionally operate on an opened
file descriptor.
* modules/gcide/tests/autoidx.at: Change expected diagnostic message.
Update grecs
2024-10-21 Sergey Poznyakoff <gray@gnu.org>
idxgcide: trim whitespace around headwords
* include/dico/utf8.h (utf8_mbtowc),
(utf8_space_elim,utf8_space_trim): New protos.
(utf8_iter_isspace): New function.
* lib/utf8.c (utf8_iter_err_p): Bugfix.
* lib/utf8_is_space.c (utf8_space_elim,utf8_space_trim): New functions.
* modules/gcide/idxgcide.l (flush_headwords): Trim leading and trailing
whitespace from the headwords.
2024-10-20 Sergey Poznyakoff <gray@gnu.org>
gcide indexing: don't mark <altname> as primary.
gcide indexer: make sure proper headwords are sorted first.
* modules/gcide/gcide.c (gcide_open_idx): Try to recreate index file
if it has wrong version.
* modules/gcide/gcide.h (GCIDE_IDX_VERSION): New define.
(gcide_idx_header): New field: ihdr_version.
(gcide_ref): New field: ref_primary.
* modules/gcide/idx.c (gcide_idx_file_open): Change calling sequence.
Return integer error code.
* modules/gcide/idxgcide.l (refcmp): Ensure primary headword entries
appear before cross-references.
(flush_headwords): Initialize the ref_primary field.
Scanner: mark hw, asp, altname, and decf as primary headwords.
2024-10-19 Sergey Poznyakoff <gray@gnu.org>
Rewrite doc generation
2024-10-17 Sergey Poznyakoff <gray@gnu.org>
gcide: compress whitespace when handling references in http
* doc/dico.texi: Document changes.
* modules/gcide/gcide.c (cb_x_text): Remove nested tags, preserving
their content. Compress repeating whitespace characters (including
<br/) to a single space.
* modules/gcide/idxgcide.l: Compress whitespace when collecting
reference.
gcide: improve indexing
* modules/gcide/gcide.c: Handle <cref> tags.
* modules/gcide/idxgcide-cli.opt: The --debug option takes optional
argument, specifying set of letters (i.e. file suffixes), for which to
enable debugging.
* modules/gcide/idxgcide.l: Index text between <col> tags.
2024-10-16 Sergey Poznyakoff <gray@gnu.org>
gcide: Fix formatting of <er> tags with embedded newlines in html mode
This improves commit d65faac032.
* modules/gcide/gcide.c (print_html_er): Allow for embedded newlines.
* modules/gcide/gcide.h (SIZE_MAX): Move definition from markup.l
2024-09-04 Sergey Poznyakoff <gray@gnu.org>
Update FSF address where applicable
2024-06-02 Sergey Poznyakoff <gray@gnu.org>
Minor changes
Update DISTFILES
Introduce input converters.
Input converter is a special function used to convert input word
before performing a look-up. Converters can be useful, for example,
to allow users to input words in transliteration. An example converter
is provided, that converts text from latin transliteration to Greek.
* dicod/database.c (dicod_database_init): Resolve input converters.
(dicod_database_match, dicod_database_define): Convert input prior
to look up.
* dicod/dicod.h (dicod_database): New field: "conv".
* dicod/main.c (kwd_database): New keyword "conv".
* include/dico/Makefile.am: Add conv.h.
* include/dico/conv.h: New file.
* lib/Makefile.am: Add conv.c
* lib/conv.c: New file.
* modules/greek_kbd/Makefile.am: New file.
* modules/greek_kbd/greek_kbd.c: New file.
* modules/greek_kbd/tests/.gitignore: New file.
* modules/greek_kbd/tests/Makefile.am: New file.
* modules/greek_kbd/tests/atlocal.in: New file.
* modules/greek_kbd/tests/testsuite.at: New file.
* NEWS: Document changes.
* doc/dico.texi: Likewise.
2024-05-21 Sergey Poznyakoff <gray@gnu.org>
gcide: special handling for <pre> tag.
gcide: bugfixes
* modules/gcide/markup.l: Backtrack token_end after yyless.
(pop_tag): Downcase the tag before use.
gcide: enclose source in an additional span
gcide: translate <q> to <blockquote>
gcide: in html mode, translate <er> to <a>
dicod: avoid inserting extra newlines if reported content-type is not text/plain
* dicod/dicod.h (CONTENT_TYPE_HEADER): New define.
* dicod/ostream.c (ostream_write): Keep track of the newline state.
Stuff the dot only at the line beginning.
(print_headers): Set transport stream depending
on Content-Transport-Encoding and Content-Type.
* modules/gcide/gcide.c (print_text_closure): Remove skip field.
gcide: fix extra double-quotes around class name in pr
2024-05-20 Sergey Poznyakoff <gray@gnu.org>
gcide: optionally output results in html
* include/dico/list.h (dico_iterator_last)
(dico_iterator_insert_before)
(dico_iterator_insert_after): New protos.
* lib/list.c (_iterator_advance): Initialize "advanced" field with
a negative value if current pointer was moved to the previous element.
(dico_iterator_last): New function.
(dico_iterator_next,dico_iterator_prev)
(dico_iterator_item): Examine the value of advanced.
(dico_iterator_insert_before)
(dico_iterator_insert_after): New functions.
(_dico_list_prepend): Bugfix. Update the prev pointer of the
prior head element.
* modules/gcide/gcide.c (GCIDE_HTML): New flag.
(gcide_init_db): New flag "html" enables html output.
(output_def): Output results in plaintext or html, depending on the
value of html flag.
* modules/gcide/gcide.h (gcide_tag_alloc, gcide_tag_free)
(gcide_is_tag): New protos.
* modules/gcide/markup.l (gcide_tag_alloc, gcide_tag_free)
(gcide_is_tag): New functions.
(gcide_markup_parse): Fixup <as> tags.
* modules/gcide/tests/degcide.c (print_text): Change handling of
<as> blocks.
2024-05-19 Sergey Poznyakoff <gray@gnu.org>
gcide: improve textual representation of <q> and <rj>
2024-05-18 Sergey Poznyakoff <gray@gnu.org>
gcide: improve textual representation of GCIDE entries.
* NEWS: Update.
* modules/gcide/gcide.c (tag_printer): Change signature. Accept a
pointer to struct print_closure as 2nd argument.
(print_closure): New field: newline.
(print_*): Update accordingly. Set print_closure.newline to reflect
the number of consecutive \n characters emitted at the end of output.
Ensure there is exactly one empty line between each pair of block tags.
* modules/gcide/gcide.h (gcide_tag): Move the "delete" field out of the
union to the main structure fields.
* modules/gcide/markup.l: Don't ignore <p>,</p> tags.
* modules/gcide/tests/dict/CIDE.D: Fix the markup.
* modules/gcide/tests/def00.at: Update.
* modules/gcide/tests/def01.at: Update.
* modules/gcide/tests/def02.at: Update.
* modules/gcide/tests/def04.at: Update.
* modules/gcide/tests/def05.at: Update.
* modules/gcide/tests/def06.at: Update.
* modules/gcide/tests/degcide.c: Don't output newline as the first character.
Minor fix
* scripts/gcider: Ensure consistent copyright year information.
Bugfix
* scripts/gcider (readdefns): Unstuff reply lines
2024-05-12 Sergey Poznyakoff <gray@gnu.org>
gcide: allow for embedded newlines in dictionary entries.
Currently each entry in the dictionary corpus is written as a single
physical line, which makes it difficult to edit and diff it. This
commit changes the scanner to accept arbitrary newlines. Newline
characters in the input are handled as "soft" whitespace: they are
converted to horizontal space characters or removed, depending on
their placement.
* include/dico/list.h (dico_list_reduce_t): New data type.
(dico_list_reduce): New prototype.
* lib/list.c (dico_list_reduce): New function.
* modules/gcide/ent.c: Remove "br": it is handled in the scanner.
* modules/gcide/gcide.c: Rewrite definition output functions.
* modules/gcide/gcide.h (gcide_content_nl, gcide_content_br): New
element types.
(gcide_is_block_tag): New proto.
* modules/gcide/markup.l: Handle "<br/", "[<source>" and
"</source>]" specially.
(gcide_is_block_tag): New function.
(gcide_markup_parse): Fix-up the use of "soft" whitespace.
* modules/gcide/tests/degcide.c: Update output functions.
* modules/gcide/tests/def00.at: Update expected output.
* modules/gcide/tests/def01.at: Likewise.
* modules/gcide/tests/def02.at: Likewise.
* modules/gcide/tests/def04.at: Likewise.
* modules/gcide/tests/def05.at: Likewise.
* modules/gcide/tests/def06.at: Likewise.
* modules/gcide/tests/dict/CIDE.C: Add missing whitespace.
gcide: minor change
Housekeeping: whitespace cleanup
2024-05-11 Sergey Poznyakoff <gray@gnu.org>
Housekeeping: update copyright years
gcide: Rewrite definition output. Better way to represent <a> tags in text format.
gcide: minor improvement
* gcide.h (gcide_tag): Move tag_parmc and tag_parmv to the union.
Rename the latter to v.
All uses changed.
gcide: fix typo
2024-05-10 Sergey Poznyakoff <gray@gnu.org>
Minor fix
* modules/gcide/markup.l (GRK): Remove superfluous state.
gcide scanner: better handling of special cases
* modules/gcide/markup.l: Use exclusive states GRK, PR, HW for
greek transliteratiin, pronounciation marker, and headword,
correspondingly.
Include accent and syllabification markers in pronunciation.
New rules for catching various special cases.
Provide a catch-all default rule.
* modules/gcide/tests/def06.at: Update.
* modules/gcide/tests/markup.at: Update.
Minor improvement in gcide scanner
* modules/gcide/markup.l: Attempt to read as much characters as
available at once.
2024-05-09 Sergey Poznyakoff <gray@gnu.org>
gcide: further improvements in parser diagnostic
* modules/gcide/gcide.h (gcide_content_unspecified): Replace with
gcide_content_top.
(TAG_HAS_NAME): Remove.
* modules/gcide/markup.l: Revamp tag allocation and manipulation
functions.
Add new rule to catch malformed tags or entities.
* modules/gcide/gcide.c: Update.
* modules/gcide/tests/degcide.c: Update.
* modules/gcide/tests/dict/CIDE.A: Fix unclosed tag.
2024-05-07 Sergey Poznyakoff <gray@gnu.org>
gcide: correctly parse tags with parameters
* modules/gcide/markup.l: Rewrite tag matching rules.
2024-05-06 Sergey Poznyakoff <gray@gnu.org>
gcide: improve parser diagnostic; don't require whitespace before closing comment delimiter
* modules/gcide/gcide.h (gcide_locus): New struct.
(gcide_tag): New field: offset.
(gcide_markup_parse): Change signature.
* modules/gcide/markup.l (base_locus, textstart_offset)
(endtaglen): New static variables.
(LOCUS_FILE, LOCUS_OFF): New macros.
(text_add_str): Set textstart_offset.
(alloc_tag,append_tag): Set tag->offset.
(pop_tag): Diagnose unclosed tags.
(flush_text_segment): New function.
(gcide_markup_parse): Take pointer to
initial locus as argument.
(lexer): include full location in diagnostic messages.
Use flush_text_segment to flush the collected text data.
Don't require whitespace character before closing comment
delimiter.
* modules/gcide/gcide.c: Update calls to gcide_markup_parse.
* modules/gcide/tests/degcide.c: New option -c, --check.
Update call to gcide_markup_parse.
Minor fixes in test CIDE corpus
gcide: add more entities
What is listed in webchar.txt, is as a matter of fact, an "ideal" set
of entities. Existing GCIDE corpus files contain more. This change
adds all entities that were found in the corpus.
2024-05-05 Sergey Poznyakoff <gray@gnu.org>
Fix allocation checks
* modules/gcide/markup.l: Fix allocation checks. Complements
partial fix inadvertenly pushed with previous commit.
Fix greek transliteration testcase (see f6ac4188)
gcide: new option: "watch"
* NEWS: Document changes.
* doc/dico.texi: Document the watch option.
* modules/gcide/Makefile.am: Add watcher.c
* modules/gcide/gcide.c (GCIDE_WATCHER,GCIDE_IDX_FAIL): New files.
(gcide_db): New field: watcher.
(free_db): Close the watcher.
(gcide_open_idx): Close existing index first.
(gcide_init_db): New option: "watch". Create watcher if it is set.
(reload_if_changed): New function.
(gcide_match, gcide_define): Call reload_if_changed. Return NULL
if it fails.
* modules/gcide/gcide.h (WATCHER): New typedef.
[WITH_INOTIFY] (watcher_setup, watcher_close)
(watcher_is_modified): Declare prototypes.
[!WITH_INOTIFY] (watcher_setup, watcher_close)
(watcher_is_modified): New macros.
* modules/gcide/module.ac: New file.
* modules/gcide/watcher.c: New file.
2024-05-04 Sergey Poznyakoff <gray@gnu.org>
Fix greek transliteration in gcide.
* modules/gcide/grk.c: Fix meaning of "h`
Minor change in dicoweb.
* dicoweb/views.py: Escape html entities in the server response
prior to processing it.
New gcide entity
* modules/gcide/ent.c: New entity "segno", in anticipation of the
upcoming change in GCIDE.
2024-04-30 Sergey Poznyakoff <gray@gnu.org>
Support two rarely used gcide entities
* modules/gcide/ent.c: Define "nabla" and (a substitute for) "dele"
entities.
2024-04-29 Sergey Poznyakoff <gray@gnu.org>
Update NEWS
2024-04-23 Sergey Poznyakoff <gray@gnu.org>
Minor fix
* modules/gcide/ent.c: Fix definition of Eacute
2024-04-12 Sergey Poznyakoff <gray@gnu.org>
Remove some leftover files
bootstrap: implement the --force option
2024-04-12 Wojciech Polak <polak@gnu.org>
Update Dicoweb
* Switch to Python 3.11+ with type hints
* Upgrade Django to version 4.2
* Improve desktop and mobile views using HTML5
* Implement a dark mode
* Use Poetry and pyproject.toml
* Integrate Pylint and Mypy for development
* Implement various fixes and improvements
2024-04-12 Sergey Poznyakoff <gray@gnu.org>
gcide: fix markup test
2024-04-11 Sergey Poznyakoff <gray@gnu.org>
idxgcide: whitespace cleanup
Skip duplicated headwords in idxgcide.
* modules/gcide/idxgcide.l (flush_headwords): Sort headwords. Skip
duplicated ones.
Fix more gcide entities
Add missing gcide typographic entity
* modules/gcide/ent.c (gcide_entity): Add ycr - Y with breve
2023-10-17 Sergey Poznyakoff <gray@gnu.org>
Don't install pp-setup if alternative preprocessor is requested.
* configure.boot (DEFAULT_PP_SETUP): New variable.
* dicod/Makefile.am (inc_DATA: Use DEFAULT_PP_SETUP.
Fix the testsuite (always use --no-preprocessor)
2023-05-12 Sergey Poznyakoff <gray@gnu.org>
Upgrade gnulib.
Version 2.11.90
Rewrite pcre support using pcre2
* NEWS: Document changes.
* modules/pcre/Makefile.am: Use libpcre2-8
* modules/pcre/module.ac: Detect presence of libpcre2 and its
headers.
* modules/pcre/pcre.c: Rewrite using pcre2.
* modules/pcre/tests/.gitignore: New file.
* modules/pcre/tests/Makefile.am: New file.
* modules/pcre/tests/atlocal.in: New file.
* modules/pcre/tests/dicod.cfin: New file.
* modules/pcre/tests/pcre00.at: New file.
* modules/pcre/tests/pcre01.at: New file.
* modules/pcre/tests/pcre02.at: New file.
* modules/pcre/tests/testsuite.at: New file.
* modules/pcre/tests/dict.out: New file.
2023-05-11 Sergey Poznyakoff <gray@gnu.org>
Remove use of obsolete gethostby* functions
* configure.boot: Remove check for gethostbyaddr
* dico/autologin.c (hostcmp): Rewrite using getaddrinfo.
* dicod/accesslog.c (sockaddr_to_hostname): Rewrite using getnameinfo.
* xdico/xhostname.c (xdico_local_hostname): : Rewrite using getaddrinfo.
Use newer autotools
* configure.boot: Remove uses of obsolete autoconf macros.
Require autoconf 2.71 and automake 1.16.5.
* gint: Upgrade module.
* grecs: Upgrade module.
* am/gsasl.m4: Remove uses of obsolete autoconf macros.
* modules/ldap/module.ac: Likewise.
* modules/pam/module.ac: Likewise.
* modules/pcre/module.ac: Likewise.
* modules/python/module.ac: Likewise.
* modules/wordnet/module.ac: Likewise.
* dicod/dicod.c: Remove uses of RETSIGTYPE.
* dicod/server.c: Likewise.
* dicod/main.c: Use grecs_preprocess instead of the
withdrawn grecs_preproc_run.
* dicod/tests/apop.at: Quote user-db label in the configuration
file.
* dicod/tests/help01.at: Likewise.
* dicod/tests/vis00.at: Likewise.
* dicod/tests/vis01.at: Likewise.
* dicod/tests/vis02.at: Likewise.
* include/testsuite.inc (DICOD_RUN): Disable configuration
preprocessing.
* po/POTFILES.in: Remove references to non-existing source files.
2023-01-22 Sergey Poznyakoff <gray@gnu.org>
Update copyright years
Document extensions and corresponding capabilities
2023-01-21 Sergey Poznyakoff <gray@gnu.org>
Fix puszcza bug 595
This also fixes various unrelated reference counting errors
* modules/python/python.c (PySelectionKey): New field: key_alloc.
(_PySelectionKey_dealloc): Deallocate key if key_alloc is set.
(_python_selector): Initialize key_alloc to 0,
(struct python_result): New field: arg
(_make_python_result): Take three argument. Initialize arg.
(do_match): Allocate key and store it in PySelectionKey.
Mark it with key_alloc=1.
Don't decrement py_args refcount too early.
(mod_define,mod_output_result)
(mod_result_headers): Fix reference counting errors.
(mod_free_result): Decrement gres->arg reference counter.
Remove unused local variables in python.c
2022-08-05 Sergey Poznyakoff <gray@gnu.org>
Fix GCIDE indexer
It has been noted that <hw> is occasionally used within entries
as a font marker, instead of <altname> or <xex>. Recent GCIDE
corpus contains quite a number of such uses.
This commit enables idxgcide to cope with it by using <ent> tag
to mark the beginning of a dictionary entry. This position is
then adjusted when first <hw> or <mhw> is seen and remains in
effect for all remaining occurrences of <hw> in this entry.
* modules/gcide/idxgcide.l (at_ent): New variable.
(SET_HWPOS): New macro.
(BEGIN_HEADWORD): Use SET_HWPOS.
Update grammar.
* modules/gcide/tests/dict/CIDE.A: Insert <ent> tags.
* modules/gcide/tests/dict/CIDE.B: Likewise.
* modules/gcide/tests/dict/CIDE.C: Likewise.
* modules/gcide/tests/dict/CIDE.D: Likewise.
* modules/gcide/tests/dict/CIDE.E: Likewise.
* modules/gcide/tests/dict/CIDE.F: Likewise.
* modules/gcide/tests/dict/CIDE.G: Likewise.
* modules/gcide/tests/dict/CIDE.H: Likewise.
* modules/gcide/tests/dict/CIDE.I: Likewise.
* modules/gcide/tests/dict/CIDE.J: Likewise.
* modules/gcide/tests/dict/CIDE.K: Likewise.
* modules/gcide/tests/dict/CIDE.L: Likewise.
* modules/gcide/tests/dict/CIDE.M: Likewise.
* modules/gcide/tests/dict/CIDE.N: Likewise.
* modules/gcide/tests/dict/CIDE.O: Likewise.
* modules/gcide/tests/dict/CIDE.P: Likewise.
* modules/gcide/tests/dict/CIDE.Q: Likewise.
* modules/gcide/tests/dict/CIDE.R: Likewise.
* modules/gcide/tests/dict/CIDE.S: Likewise.
* modules/gcide/tests/dict/CIDE.T: Likewise.
* modules/gcide/tests/dict/CIDE.U: Likewise.
* modules/gcide/tests/dict/CIDE.V: Likewise.
* modified: modules/gcide/tests/dict/CIDE.W
* modified: modules/gcide/tests/dict/CIDE.X
* modified: modules/gcide/tests/dict/CIDE.Y
* modified: modules/gcide/tests/dict/CIDE.Z
2021-04-27 Sergey Poznyakoff <gray@gnu.org>
Version 2.11
2021-04-25 Sergey Poznyakoff <gray@gnu.org>
Fix gcide scanner
* modules/gcide/markup.l (YY_INPUT): Increment input_buf.
Fix searches in gcider
Fix the Greek transliteration testsuite to follow d21d7c4c
Fix printflike definitions
* maint/printflike: Remove stray characters.
Update THANKS file
gcide: fix in greek transliteration
* modules/gcide/grk.c: Fix transliteration of iota perispomeni with
diaeresis.
2021-04-24 Sergey Poznyakoff <gray@gnu.org>
Bugfix
* dicod/commands.c (_show_database): Don't bail out if unable to
encode the description.
Remove support for Python 2.x
2021-01-08 Sergey Poznyakoff <gray@gnu.org>
Upgrade submodules. Version 2.10.90.
* NEWS: Version 2.10.90
* configure.boot: Version 2.10.90. Raise autoconf, automake, and
gettext requirements.
* grecs: Upgrade to b0cbc54209de4c631952005b122ce09f84866700.
* gnulib: Upgrade to v0.1-4336-gbdae9a5
* include/xdico.h: Define GNULIB_XALLOC_DIE and include xalloc.h.
See the comment for the reason.
* xdico/gnu/Makefile.am: Define GNULIB_XALLOC_DIE.
* xdico/xalloc-die.c (xalloc-die): Call abort to avoid a 'noreturn'
warning.
* dico/dico-priv.h: Don't include xalloc.h
* dicod/dicod.h: Likewise.
* dicod/tests/apopauth.c: Likewise.
* xdico/iputil.c: Likewise.
* xdico/timer.c: Likewise.
* xdico/userprivs.c: Likewise.
* xdico/xhostname.c: Likewise.
* xdico/xscript.c: Likewise.
* xdico/xtkn.c: Likewise.
* xdico/xutil.c: Likewise.
2021-01-06 Sergey Poznyakoff <gray@gnu.org>
Update copyright years
2020-09-07 Sergey Poznyakoff <gray@gnu.org>
Fix compilation with python >=3.8
* modules/python/module.ac: Try python-config --libs --embed first.
2020-09-04 Sergey Poznyakoff <gray@gnu.org>
Version 2.10
2020-09-03 Sergey Poznyakoff <gray@gnu.org>
Create po/LINGUAS during bootstrap
This fixes the bug introduced by 4da4ddea3a.
* bootstrap (po_sync): Create the LINGUAS list.
New option --update-po.
2020-06-14 Sergey Poznyakoff <gray@gnu.org>
Use grecs with wordsplit v1.1
2020-05-19 Ahmed El-Mahmoudy <aelmahmoudy@users.sourceforge.net>
Minor fix
* dicod/dicod.h: Add missing extern qualifiers.
* include/dico/markup.h: Likewise.
2019-08-25 Sergey Poznyakoff <gray@gnu.org>
Bugfix
* lib/utf8.c (utf8_iter0): Switch to error state if utf8_char_width
returned 0
2019-07-10 Sergey Poznyakoff <gray@gnu.org>
Switch to grecs eb66a000
2019-04-24 Sergey Poznyakoff <gray@gnu.org>
Version 2.9
2019-03-29 Sergey Poznyakoff <gray@gnu.org>
Use AC_SYS_LARGEFILE to detect large file support status
Previously, that was done implicitly by gnulib. After 4da4ddea3a,
it is necessary to do so explicitly, to avoid make sure library
and apps use off_t of the same width.
* configure.boot: Use AC_SYS_LARGEFILE
2019-03-10 Sergey Poznyakoff <gray@gnu.org>
Version 2.8.90
2019-03-06 Sergey Poznyakoff <gray@gnu.org>
New configure variable: DEFAULT_PIDFILE_NAME
Allows the user to override the default pidfile location for dicod
Suggested in https://puszcza.gnu.org.ua/bugs/?419
* configure.boot (DEFAULT_PIDFILE_NAME): New variable
* dicod/Makefile.am (AM_CPPFLAGS): Define DEFAULT_PIDFILE_NAME
* dicod/main.c (pidfile_name): Change initialization
2019-02-26 Sergey Poznyakoff <gray@gnu.org>
Version 2.8
2019-02-22 Sergey Poznyakoff <gray@gnu.org>
Avoid introducing gnulib dependencies to libdico
After pulling updates from gnulib, it was discovered that it had added
an unwanted dependency to the libdico. The dependency was added b
redefining fseek to rpl_fseek in the config.h. Of course, that's quite
OK for user programs and in fact that's one of the purposes of gnulib,
so it's doing its job all right. However, this kind of depedencies is
not acceptable in installable libraries, such as libdico.
There are two ways of fixing this: (1) by including libgnu to the
libdico, or (2) by creating pristine (i.e. stripped of any gnulib
stuff) version of config.h and using it in the library sources.
The first approach was used in mailutils for the libmu_aux convenience
library. However, in dico I wouldn't like to introduce additional
dependencies to the installable libraries and modules, therefore
second approach has been chosen.
Two separare configuration headers are introduced:
include/prog/config.h
Configuration header with gnulib dependencies. It is used by
libxdico, and user-space programs: dico, dicod, idxgcide and
some test programs.
include/lib/config.h
Pristine header, free from any gnulib additions. It is used by all
installable libraries, including dicod modules.
In order to create pristine header, bootstrap uses specially prepared
temporary edition of configure.ac, which is stripped off any gl_.*
statements.
This approach introduces additional difficulties. The two header files
are of course listed in the AC_CONFIG_HEADERS statement in
configure.ac. Autotools give precedence to the first one. It is the
only file for which autoheader creates the .h.in template. Further,
automake creates in each Makefile.am the DEFAULT_INCLUDES statement,
which lists the directory part of the first header, and this value is
used in the compiler command line. This means that to include the
pristine header, its path prefix needs to be specified.
To avoid this, the nostdinc option is passed to AM_INIT_AUTOMAKE.
As a side effect, it makes it impossible to build libltdl in the
recursive mode (although its Makefile.am pretends otherwise). Thus,
libltdl is built in nonrecursive mode from the main Makefile.am.
Similar problem occurs with the gnulib itself, although in this case
its bootstrapping tool provides sufficient mechanisms to help overcome
it. Gnulib is built as a sub-library of libxdico. As a side effect,
the libextra library is no longer needed.
Another side effect is that the rewritten bootstrap script made it
possible to use gnulib-tool directly, instead of using
gnulib/build-aux/bootstrap wrapper.
Following bugs are fixed by this change:
https://puszcza.gnu.org.ua/bugs/?416
https://puszcza.gnu.org.ua/bugs/?417
https://puszcza.gnu.org.ua/bugs/?418
Almost all files in the project are affected by this change. However,
some changes are pure bugfixes. These are:
* lib/mergesort.c (mergesort): Rename to dico_mergesort to avoid name
clash on Free and OpenBSD.
* lib/stream.c (dico_stream_getdelim): Fix memory reallocation
algorithm.
* lib/utf8.c (utf8_wc_strstr): Reset errno to 0.
* lib/libi18n.c: Don't depend on gnu/configmake.h
* modules/wordnet/module.ac: Move definition of WORDNET_COND out of
conditional context. This fixes the functionality of the
configure --without-wordnet option.
Some obsolete and unused files have been removed. These are:
* include/gjdict.xbm
* lib/bushu.dat
* lib/bushu.h
* lib/cursor.xbm
* lib/jiscvt.c
* makedict/
Main set of changes is:
* bootstrap: Mostly rewritten as described above.
* GNUmakefile: New file for the ease of maintenance.
* maint/bootstrap.mk: New file.
* gnulib.modules: Moved to maint/
* maint/printflike: New file. Lists printf-like functions for gettext.
* configure.boot: Use AC_CONFIG_HEADERS with two header files.
Use nostdinc option to AM_INIT_AUTOMAKE.
(LTDL_INIT): Use nonrecursive option.
(DICO_PROG_CONFIG,DICO_LIB_CONFIG)
(DICO_PROG_INCLUDES,DICO_MODULE_INCLUDES): New substitution variables.
(GRECS_HOST_PROJECT_INCLUDES): Fix value.
(COND_LIBDICOSASL): New conditional.
* Makefile.am: Build libltdl.
* lib/Makefile.am: Move convenience libraries to another
directory. Build only libdico.
* dico/Makefile.am: Fix LDADD and includes.
* dicod/Makefile.am: Likewise.
* dicod/tests/Makefile.am: Likewise.
* lib/tests/Makefile.am: Likewise.
* modules/*/Makefile.am: Likewise.
The directory struture is reorganized and the sources of convenience
libraries moved to a separate directory:
* xdico/Makefile.am: New file
* xdico/appi18n.c
* xdico/gsaslstr.c
* xdico/iputil.c
* xdico/timer.c
* xdico/userprivs.c
* xdico/xalloc-die.c
* xdico/xhostname.c
* xdico/xscript.c
* xdico/xstream.c
* xdico/xtkn.c
* xdico/xutil.c: All moved from lib
* xdico/gnu/Makefile.am: New file.
* xdico/gnu: Gnulib sources imported to this directory.
2019-02-19 Sergey Poznyakoff <gray@gnu.org>
Fix the definition of GRECS_HOST_PROJECT_LDADD
Version 2.7.90
2019-02-18 Sergey Poznyakoff <gray@gnu.org>
Make sure gnulib dependencies are satisfied when linking grecs testsuite
* configure.boot (GRECS_HOST_PROJECT_LDADD): Define new variable.
* grecs: Upgrade.
Modify utf8 iterator to correctly handle non-zero-terminated strings.
* include/dico/utf8.h (utf8_iterator): New fields: length, err, end.
(utf8_iter_err_p,utf8_iter_init): New prototype.
* lib/utf8.c (utf8_iter0): Add boundary checking. Set end and error
flags as appropriate.
(utf8_iter_err_p): Rewrite.
(utf8_iter_err_p): New function.
(utf8_iter_init): New function.
(utf8_iter_first): Rewrite using utf8_iter_init.
(utf8_iter_next): Update length.
* lib/linetrimstr.c (_linetrimstr_find_end): Don't assume zero-terminated
string.
* modules/dict.org/dictorg.c (revert_word): Likewise.
* modules/outline/outline.c (revert_word): Likewise.
Fix out-of-boundary memory access in metaphone2 encoder.
* modules/metaphone2/metaphone2.c (looking_at,ISVOWEL): Implement
additional boundary checking.
All uses changed.
2019-02-17 Sergey Poznyakoff <gray@gnu.org>
Fix attempted access to deallocated memory
* lib/list.c (_dico_list_remove_item): Free entry after accessing
its fields.
2018-11-15 Sergey Poznyakoff <gray@gnu.org>
Upgrade grecs
In particular, this fixes the test 71 (now 72), which incorrectly
pulled a variable from the environment, instead of from the command
line.
2018-09-25 Sergey Poznyakoff <gray@gnu.org>
Version 2.7
Include customized version of pp-setup
Minor fixes
* configure.boot: Move check for libz to the proper file.
* modules/dict.org/Makefile.am (dictorg_la_LIBADD): Link with -lz
unconditionally.
* modules/dict.org/dictorg.h: Use libz unconditionally.
* modules/dict.org/dictstr.c: Likewise.
* modules/dict.org/module.ac: Require libz and zlib.h
* modules/guile/guile.c: Remove unused variable.
Update docs
dictorg: preserve leading whitespace in index entries
2018-09-24 Sergey Poznyakoff <gray@gnu.org>
Minor change
* modules/dict.org/tests/db/GNUmakefile: Rename to dict.mk
dicod: report markup types on startup only if the "markup" capability is requested
2018-09-22 Sergey Poznyakoff <gray@gnu.org>
Fix spurious memory deallocation in guile module; upgrade grecs
2018-09-19 Sergey Poznyakoff <gray@gnu.org>
Version 2.6.95
2018-09-18 Sergey Poznyakoff <gray@gnu.org>
Bugfixes. Add testsuite for the dictorg module
* lib/bsearch.c (dico_bsearch): Bugfix.
* modules/dict.org/Makefile.am (SUBDIRS): Add tests
* modules/dict.org/dictorg.c (suffix_match): Bugfixes.
* modules/dict.org/module.ac: Build tests/db/Makefile.
New files:
* modules/dict.org/tests/.gitignore
* modules/dict.org/tests/Makefile.am
* modules/dict.org/tests/allchars.at
* modules/dict.org/tests/alnum.at
* modules/dict.org/tests/atlocal.in
* modules/dict.org/tests/db/deaccent.awk
* modules/dict.org/tests/db/ell-num.dict
* modules/dict.org/tests/db/ell-num.index
* modules/dict.org/tests/db/ell-num.lst
* modules/dict.org/tests/db/ell-num_mime.dict
* modules/dict.org/tests/db/ell-num_mime.index
* modules/dict.org/tests/db/eng-num.dict
* modules/dict.org/tests/db/eng-num.index
* modules/dict.org/tests/db/eng-num.lst
* modules/dict.org/tests/db/eng-num_allchars.dict
* modules/dict.org/tests/db/eng-num_allchars.index
* modules/dict.org/tests/db/x-num.awk
* modules/dict.org/tests/define.at
* modules/dict.org/tests/prefix.at
* modules/dict.org/tests/showdb.at
* modules/dict.org/tests/showinfo.at
* modules/dict.org/tests/suffix.at
* modules/dict.org/tests/testsuite.at
* modules/dict.org/tests/word.at
* modules/dict.org/tests/db/eng-num.txt
* modules/dict.org/tests/db/num-ell.dict
* modules/dict.org/tests/db/num-ell.index
* modules/dict.org/tests/db/num-ell.info
* modules/dict.org/tests/db/num-ell.txt
* modules/dict.org/tests/db/num-eng.dict
* modules/dict.org/tests/db/num-eng.index
* modules/dict.org/tests/db/num-eng.info
* modules/dict.org/tests/db/num-eng.txt
* modules/dict.org/tests/db/num-x.awk
* modules/dict.org/tests/exact.at
* modules/dict.org/tests/ovdefmime.at
* modules/dict.org/tests/ovdefnomime.at
* modules/dict.org/tests/ovexact.at
* modules/dict.org/tests/ovshowdb.at
* modules/dict.org/tests/vdefine.at
* modules/dict.org/tests/vexact.at
* modules/dict.org/tests/vshowdb.at
* modules/dict.org/tests/db/GNUmakefile
* modules/dict.org/tests/db/Makefile.am
* modules/dict.org/tests/db/ell-num.info
* modules/dict.org/tests/db/ell-num.txt
* modules/dict.org/tests/db/eng-num.info
2018-09-17 Sergey Poznyakoff <gray@gnu.org>
dictorg: bugfix
* modules/dict.org/dictorg.c (uniq_comp): Fix comparison.
(common_match): Give the third argument to compare.
* modules/dict.org/Makefile.am (dictorg_la_SOURCES): Remove data.c
* modules/dict.org/data.c: Remove unused file.
2018-09-16 Sergey Poznyakoff <gray@gnu.org>
utf8_compare: new general-purpose comparator function
* lib/utf8.c (utf8_strcmp_cc)
(utf8_strcmp_alnumspace_cc,utf8_strcmp_alnumspace)
(utf8_strcasecmp_alnumspace): Remove
(utf8_compare): New function.
(utf8_strcmp,utf8_strcasecmp)
(utf8_strncasecmp): Rewrite as a wrapper over utf8_compare
* include/dico/utf8.h: Update protos.
* modules/dict.org/dictorg.c: Use new utf comparators.
2018-09-15 Sergey Poznyakoff <gray@gnu.org>
Uniform error reporting.
Provide own binary search and sort functions.
* lib/bsearch.c: New file.
* lib/mergesort.c: New file.
* include/dico/list.h (dico_list_comp_t): Change signature.
(dico_list_set_comparator)
(dico_list_intersect, dico_list_intersect_p)
(_dico_list_locate, _dico_list_remove): Change signature.
(dico_list_set_comparator_data)
(dico_list_get_comparator_data): New protos.
* lib/list.c (dico_list)<comp_data>: New member.
(dico_list_set_comparator)
(dico_list_intersect, dico_list_intersect_p)
(_dico_list_locate, _dico_list_remove): Change signature.
(dico_list_set_comparator_data)
(dico_list_get_comparator_data): New functions.
* lib/Makefile.am: Raise library version number.
* dico/saslauth.c: Reflect the above changes.
* dicod/acl.c: Likewise.
* dicod/alias.c: Likewise.
* dicod/capa.c: Likewise.
* dicod/commands.c: Likewise.
* dicod/gsasl.c: Likewise.
* dicod/lang.c: Likewise.
* dicod/main.c: Likewise.
* dicod/virtual.c: Likewise.
* include/dico/strat.h: Likewise.
* include/dico/util.h: Likewise.
* lib/assoc.c: Likewise.
* lib/markup.c: Likewise.
* lib/strat.c: Likewise.
* lib/tests/listop.c: Likewise.
* lib/udb.c: Likewise.
* modules/gcide/gcide.c: Likewise.
* modules/wordnet/wordnet.c: Likewise.
* modules/dict.org/dictorg.c: Use appropriate comparisons in uniq_comp
and compare_entry_ptr.
dictorg: Fix unique headword selection
* modules/dict.org/dictorg.c (uniq_comp): New function.
(common_match,suffix_match): Use uniq_comp to select headwords.
(exact_match): Disable unique selector.
2018-09-13 Sergey Poznyakoff <gray@gnu.org>
Version 2.6.94
dictorg: select comparison algorithm depending on the database settings
* include/dico/list.h (dico_list_head, dico_list_tail): New protos.
* include/dico/utf8.h (utf8_strcmp_cc)
(utf8_strcmp)
(utf8_strcmp_alnumspace_cc)
(utf8_strcmp_alnumspace)
(utf8_strcasecmp_alnumspace)
(utf8_table_check)
(utf8_wc_is_alnum, utf8_wc_is_space): New protos.
* lib/utf8_is_alnum.c: New file.
* lib/utf8_is_space.c: New file.
* lib/Makefile.am: Add new files.
* lib/list.c (dico_list_head, dico_list_tail): New functions.
* lib/utf8.c (utf8_strcmp_cc)
(utf8_strcmp)
(utf8_strcmp_alnumspace_cc)
(utf8_strcmp_alnumspace)
(utf8_strcasecmp_alnumspace)
(utf8_table_check)
(utf8_wc_is_alnum, utf8_wc_is_space): New functions.
* modules/dict.org/dictorg.c: Revert 84e5fa19.
(mod_init_db): Initialize database flags.
(all): Select comparator depending on the flag_allchars and
flag_casesensitive flag.
2018-09-12 Sergey Poznyakoff <gray@gnu.org>
Version 2.6.93
Redo the virtual database support.
* include/dico/types.h (dicod_database_t): New typedef.
(DICO_CAPA_OUTPUT_ALL): Remove flag.
(dico_result_output_all): Remove method.
(dico_result_db): New method.
* include/dico/types.h (dicod_database_t): New typedef.
(DICO_CAPA_OUTPUT_ALL): Remove flag.
(dico_result_output_all): Remove method.
(dico_result_db): New method.
* dicod/result.c: New file.
* dicod/Makefile.am (dicod_SOURCES): Add result.c
* dicod/database.c (dicod_database_match)
(dicod_database_define): Return dicod_db_result_t *
(dicod_database_result_count)
(dicod_database_compare_count)
(dicod_database_result_free)
(dicod_database_result_output)
(dicod_database_mime_header): Remove. Use the corresponding
dicod_db_result_ family functions instead.
* dicod/dicod.h (dicod_db_result_t): New data type.
(dicod_db_result_alloc,dicod_db_result_free)
(dicod_db_result_count,dicod_db_result_compare_count)
(dicod_db_result_output)
(dicod_db_result_mime_header)
(dicod_db_result_db): New protos.
(dicod_database_match)
(dicod_database_define): Return dicod_db_result_t *
* dicod/loader.c: Use new functions.
* dicod/virtual.c: Rewrite.
* dicod/tests/Makefile.am: Add new tests.
* dicod/tests/echo.c: New open keyword "prefix".
* dicod/tests/testsuite.at: Add new tests.
* dicod/tests/virt01.at: New file.
* dicod/tests/virt02.at: New file.
* dicod/tests/virt03.at: New file.
* dicod/tests/virt04.at: New file.
2018-09-11 Sergey Poznyakoff <gray@gnu.org>
Update NEWS
Fix eventual memory leak introduced by the previous change
virtual db: implement dico_db_info and dico_db_descr methods
Support for old dictord special index keywords (prefixed with "00database")
* NEWS: Version 2.6.92
* configure.boot: Version 2.6.92
* modules/dict.org/dictorg.c (parse_index_entry): Translate old
special entries (00database prefix) into new ones (00-database- prefix).
* modules/dict.org/dictorg.h (DICTORG_ALT_ENTRY_PREFIX)
(DICTORG_ALT_ENTRY_PREFIX_LEN): New define.
2018-09-10 Sergey Poznyakoff <gray@gnu.org>
Improve 07a88216
Output appropriate MIME headers after each 151 reply. Report
actual db name, if the database is invisible, and the name of
the virtual db otherwise.
* dicod/dicod.h (dicod_database_print_definitions): New proto.
* dicod/loader.c (module_init); Check for dico_result_output_all.
(dicod_database_print_definitions): New function.
(print_definitions): Rewrite using it or the dico_result_output_all
module method, if DICO_CAPA_OUTPUT_ALL is set.
* dicod/virtual.c (virtual_output_result): Remove.
(virtual_output): New method.
(virtual_result_headers): Remove.
* include/dico/types.h (DICO_CAPA_OUTPUT_ALL): New capability.
(dico_database_module) <dico_result_output_all>: New method.
Version 2.6.91
Correctly display MIME headers read from the underlying db in virtual db
* NEWS: Update.
* doc/libdico.texi: Update.
* dicod/database.c (dicod_database_mime_header): Use temporary storage
to preserve original header in case of failure.
* dicod/virtual.c (dico_result_headers): Implement function.
* include/dico/assoc.h (dico_assoc_count): New function.
* lib/assoc.c (dico_assoc_count): New function.
2018-09-07 Sergey Poznyakoff <gray@gnu.org>
Improve backward compatibility (follow-up to 954d267b)
Restore the signature of dico_init_db. Provide an extended initialization
function dico_init_db_ext.
* include/dico/types.h (DICO_CAPA_INIT_EXT): New capability.
(dico_database_module) <dico_init_db>: Restore the signature.
<dico_init_db_ext>: New method.
* dicod/database.c (dicod_database_init): Call extended init method
of DICO_CAPA_INIT_EXT capability is set.
* dicod/loader.c (module_init): Ensure dico_init_db_ext is defined if
DICO_CAPA_INIT_EXT capability is set.
* dicod/virtual.c (dico_init_db_ext): Use this method.
* dicod/main.c (set_database): Remove the now unnecessary assertion.
* dicod/tests/echo.c: Revert 1c5682ae
* modules/dict.org/dictorg.c: Likewise.
* modules/gcide/gcide.c: Likewise.
* modules/guile/guile.c: Likewise.
* modules/outline/outline.c: Likewise.
* modules/python/python.c: Likewise.
* modules/python/python2.c: Likewise.
* modules/template/module.c: Likewise.
* modules/wordnet/wordnet.c: Likewise.
Exclude virtual databases from * and ! lookups
* include/dico/types.h (DICO_DBF_DEFAULT)
(DICO_DBF_VIRTUAL): New defines.
(dico_database_module)<dico_db_flags>: New member.
* dicod/database.c (dicod_database_flags): New function.
* dicod/dicod.c (open_databases): Set database flags after successful
open.
* dicod/dicod.h (database_is_virtual): New function.
* dicod/loader.c (dicod_word_first)
(dicod_word_all): Exclude virtual databases.
* dicod/virtual.c: Implement dico_db_flags
2018-09-06 Sergey Poznyakoff <gray@gnu.org>
Graceful handling of unsupported response content types in dicoweb
* NEWS: Document changes
* dicoweb/settings-sample.py (ONERROR): New setting.
* dicoweb/views.py: Handle unsupported content types depending on
ONERROR['UNHANDLED_CONTENT_TYPE']
2018-09-05 Sergey Poznyakoff <gray@gnu.org>
Minor fix
Support for building with WordNet on debian-based systems
* NEWS: Document the --with-libWN option.
* doc/dico.texi: Likewise.
* modules/wordnet/module.ac: New option --with-libWN
* modules/wordnet/Makefile.am: Use @WORDNET_LIB@ substitution instead
of the hardcoded "WN".
* modules/wordnet/wordnet.c: Minor changes.
* modules/gcide/gcide.c: Minord changes.
Fix init_db decalaration in all modules
Implement virtual databases.
* dicod/virtual.c: New file.
* dicod/Makefile.am (dicod_SOURCES): Add virtual.c
* dicod/database.c (dicod_database_init): Pass db->extra to
dico_init_db method.
* dicod/dicod.h (option_mime): New extern.
(dicod_builtin_module_init)
(database_session_visibility): New protos.
(virtual_builtin_module): New extern.
* dicod/loader.c (dicod_builtin_module_init): New function.
* dicod/main.c: New database configuration setting: "database".
Configures component database for virtual databases.
* dicod/ostream.c (option_mime): Remove extern. Now defined in dicod.h
* dicod/tests/echo.c (echo_init_db): Change signature.
* include/dico/types.h (dico_init_db): Change signature. Takes an extra
argument now.
* modules/template/module.c: Update.
* doc/dico.texi: Document new features.
* NEWS: Version 2.6.90. Document changes.
* configure.boot: Version 2.6.90
2018-09-04 Sergey Poznyakoff <gray@gnu.org>
Re-organize the set of database function calls.
2018-09-03 Sergey Poznyakoff <gray@gnu.org>
New option to administratively define the visibility of a database.
* dicod/dicod.h (dicod_database) <session_visible>: New member.
(database_visible_p): Remove macro.
(database_is_visible): New function.
* dicod/loader.c: Update.
* dicod/main.c (set_database): Initialize .visible.
(kwd_database): New statement "visible".
(check_db_visibility): Set session_visible.
Minor stylistic change
Fix misplaced AM_CONDITIONAL
* modules/python/module.ac: Move PYTHON3_COND out of the
conditional context
Read MIME headers from the database, if possible.
* dicod/loader.c (dicod_open_database): Load mime headers from the
database, if available.
* include/dico/types.h (DICO_MODULE_VERSION): Raise to 3
(dico_database_module) <dico_mime_header>: New member,
* modules/dict.org/dictorg.c: Define mod_mime_header function.
* modules/dict.org/dictorg.h (DICTORG_ENTRY_MIME_HEADER): New define.
* modules/gcide/gcide.c (gcide_result_headers): Remove.
* modules/guile/guile.c: Implement dico_db_mime_header.
Fix checks for proper lists.
* modules/outline/outline.c: Likewise.
* modules/python/python.c: Likewise.
* modules/python/python2.c: Likewise.
* modules/template.py (db_mime_header): New method.
* modules/template.scm (db-mime-header): New defun.
* examples/Makefile.am (EXTRA_DIST): Remove textdict2.py
* examples/textdict.py: Rewrite for both Python 2.7 and 3.x
* examples/textdict2.py: Remove.
* examples/devdict.out: Add MIME section.
* examples/listdict.scm: Support MIME section in the input file.
Make sure all ports work in UTF-8.
(result-headers): Force quoted-printable encoding if the article
contains non-ASCII characters.
* examples/numerals-cz.txt: Add mime section
* examples/numerals-pl.ldb: Add mime section
* modules/guile/tests/Makefile.am (TESTSUITE_AT): Add mime.at and mime2.at
* modules/guile/tests/dicod.cfin: Require mime capability.
* modules/guile/tests/mime.at: New file.
* modules/guile/tests/mime2.at: New file.
* modules/guile/tests/showinfo.at: Minor fix
* modules/guile/tests/testsuite.at: Include new tests.
* modules/outline/tests/Makefile.am: Add new tests.
* modules/outline/tests/dicod.cfin: Require mime capability.
* modules/outline/tests/mime.at: New file.
* modules/outline/tests/testsuite.at: Inlcude new tests.
* modules/python/tests/Makefile.am: Add new tests.
* modules/python/tests/dicod.cfin: Require mime capability.
* modules/python/tests/mime.at: New file.
* modules/python/tests/testsuite.at: Include new tests.
2018-09-02 Sergey Poznyakoff <gray@gnu.org>
docs: describe mime-headers.
2018-09-01 Sergey Poznyakoff <gray@gnu.org>
dicoweb: Fix handling of text/html content type.
* app/python/mediawiki.py: Fix python 3 compatibility.
* dicoweb/views.py (index): set format_html to true if Content-Type
is text/html
2018-08-27 Sergey Poznyakoff <gray@gnu.org>
Version 2.6
* NEWS: Update.
* configure.boot: Raise version number.
* DISTFILES: New file.
* Makefile.am (dist-hook): Add only files explicitly listed in DISTFILES.
* app/python/.gitignore: New file.
* app/python/DISTFILES: New file.
* app/python/README: New file.
* app/python/dicod.conf.in: New file.
* app/python/mediawiki.py: Fix the initial comment
* app/python/requirements.txt: New file.
* dicoweb/requirements.txt: Require wikitrans 1.2 or later.
2018-08-26 Sergey Poznyakoff <gray@gnu.org>
Rewrite mediawiki.py to work with both Python versions
* app/python/mediawiki.py: Rewritten to work with Python 2.7 and 3.x
* app/python/mediawiki2.py: Remove
Minor fix
2018-08-20 Sergey Poznyakoff <gray@gnu.org>
Minor fixes in manpages
Minor fixes
dicoweb: Fix Python 3 compatibility
Remove the phased-out "wit" submodule. Use wikitrans instead.
* .gitmodules: Remove the wit submodule
* app/python/wit: Delete
* app/python/mediawiki.py: Use wikitrans.
* app/python/mediawiki2.py: Use wikitrans.
* dicoweb/INSTALL: Update.
* dicoweb/dicoclient/dicoclient.py: Use wikitrans.
Fix python 3 compatibility.
* dicoweb/dicoclient/__init__.py: Fix python 3 compatibility.
* dicoweb/requirements.txt: Rewrite.
* dicoweb/templates/base.html: Likewise.
* dicoweb/templates/index.html: Likewise.
* dicoweb/views.py: Likewise.
* dicoweb/wsgi.virtualenv.py: Remove
* dicoweb/settings-sample.py: Remove deprecated statements.
2018-08-13 Sergey Poznyakoff <gray@gnu.org>
Bugfix in python configuration code
* modules/python/module.ac: Use $PYTHON_CONFIG instead of hardcoding
python-config name.
2018-08-05 Sergey Poznyakoff <gray@gnu.org>
Upgrade gint
2018-07-30 Sergey Poznyakoff <gray@gnu.org>
Rewrite mediawiki.py for Python 3
* app/python/mediawiki.py: Rewrite for Python 3
* app/python/mediawiki2.py: Copy of the Python 2 implementation
Upgrade wit
2018-07-25 Sergey Poznyakoff <gray@gnu.org>
Minor improvement in bootstrap
Version 2.5.90
Support for Python 3
* examples/Makefile.am (EXTRA_DIST): Add textdict2.py
* examples/textdict2.py: Renamed from textdict.py
* examples/textdict.py: Rewrite for Python 3
* modules/python/Makefile.am (python_la_SOURCES): Add python.c or
python2.c, depending on Python version.
* modules/python/module.ac (PYTHON3_COND): New conditional.
* modules/python/python2.c: Renamed from old python.c (for Python 2)
* modules/python/python.c: Rewrite for Python 3
* modules/python/tests/Makefile.am (PY2_SUF): New variable.
(.cfin.conf): Replace ~py2~
* modules/python/tests/dicod.cfin: Use textdict~py2~ as init-script
2018-06-03 Sergey Poznyakoff <gray@gnu.org>
Support for Guile 2.2.0; drop support for earlier Guile versions
2018-01-28 Sergey Poznyakoff <gray@gnu.org>
Version 2.5
2018-01-25 Sergey Poznyakoff <gray@gnu.org.ua>
Version 2.4.90
dictorg: add support for four-column index files.
* modules/dict.org/dictorg.h (index_entry): New member: orig.
* modules/dict.org/dictorg.c (parse_index_entry): Accept four-column
input.
(free_index_entry): Free the orig value.
Update copyright years
2017-01-02 Sergey Poznyakoff <gray@gnu.org>
Happy GNU Year
2016-11-21 Sergey Poznyakoff <gray@gnu.org>
Version 2.4
Fix some warnings
* grecs: Upgrade
* dicod/main.c (set_supp_group): Avoid casting gid_t to void*
* lib/userprivs.c (switch_to_privs): Change accordingly
* dicod/lev.c: Avoid casting int to void*
Update documentation re WordNet
2016-11-15 Sergey Poznyakoff <gray@gnu.org>
Fix typo in doc/Makefile.am
2016-11-12 Sergey Poznyakoff <gray@gnu.org>
WordNet-related changes.
* README: Document how to rebuild WordNet to produce position-independent
code, suitable for linking with Dico.
* modules/wordnet/wordnet.c: Trivial patch.
2016-11-11 Sergey Poznyakoff <gray@gnu.org.ua>
dico: accept UNIX socket as argument to open
* dico/connect.c (dict_connect): Accept UNIX socket pathname as
argument. Improve error checking.
* dico/func.c (ds_open): If one argument given, it can be a socket
pathname.
* doc/dico.texi: Document changes to the "open" command.
2016-10-29 Sergey Poznyakoff <gray@gnu.org>
Bugfix
* include/dico/markup.h (dico_markup_type): Fix declaration.
* THANKS: Update
Fix coredump in gcide.
The coredump occurred when the requested headword matched the
entry at the start of the index page.
* modules/gcide/idx.c (gcide_idx_locate): Fix improper dereference.
* modules/gcide/tests/Makefile.am: Add def06.at
* modules/gcide/tests/testsuite.at: Include def06.at
2016-08-12 Sergey Poznyakoff <gray@gnu.org>
I18n-related fixes
Reported by Rafael Fontenelle
* dicod/acl.c: Fix mistyped translators marker.
* po/POTFILES.in: Add files from grecs
* THANKS: Updated.
2016-08-09 Sergey Poznyakoff <gray@gnu.org.ua>
Version 2.3
* NEWS: Raise the version number.
* configure.boot: Likewise.
Minor fixes
* dicod/cmdline.opt: Remove stray dot from docstring.
* lib/jiscvt.c (convert): Add missing typecast.
* modules/guile/guile.c (scm_dico_strat_select_p): Fix
eventual use of uninitialized variable (if key is a plain
string).
* modules/python/python.c: Minor changes
2016-08-05 Sergey Poznyakoff <gray@gnu.org.ua>
Minor fixes
Improve module unit testing
* grecs: Update.
* dico/cmdline.opt: fix the style of option descriptions
* dicod/cmdline.opt (--test option): Rename to --runtest (-r).
Stop further processing after this option.
* dicod/loader.c (dicod_module_test): Fix comment.
* dicod/main.c: Ignore configuration file if in unit testing
mode.
* doc/dico.texi: Document unit testing mode.
* doc/dicod.8in: Likewise.
* modules/metaphone2/tests/build.at: Fix dicod arguments.
* modules/metaphone2/tests/comp01.at: Likewise.
* modules/metaphone2/tests/comp02.at: Likewise.
* modules/metaphone2/tests/encode.at: Likewise.
Fix metaphone2/tests/build.at
Bugfixes
* bootstrap (run): Properly capture stderr
* dicod/main.c (keywords): Mark string values as GRECS_CONST.
* modules/metaphone2/tests/testsuite.at (DICOD_TEST): New macro.
* modules/metaphone2/tests/comp00.at: Use DICOD_TEST. Ignore
config file, if present.
* modules/metaphone2/tests/comp01.at: Likewise.
* modules/metaphone2/tests/comp02.at: Likewise.
* modules/metaphone2/tests/encode.at: Likewise.
2016-08-05 Sergey Poznyakoff <gray@gnu.org>
Update copyright years
2016-08-04 Sergey Poznyakoff <gray@gnu.org.ua>
Implement Double Metaphone matching strategy
* dicod/loader.c (dicod_module_test): Revert order of arguments:
unit test arguments go first, optionally followed by -- and module
initialization parameters.
* modules/metaphone2/Makefile.am: New file.
* modules/metaphone2/metaphone2.c: New file.
* modules/metaphone2/tests/Makefile.am: New file.
* modules/metaphone2/tests/dicod.cfin: New file.
* modules/metaphone2/tests/comp00.at: New file.
* modules/metaphone2/tests/comp01.at: New file.
* modules/metaphone2/tests/comp02.at: New file.
* modules/metaphone2/tests/encode.at: New file.
* modules/metaphone2/tests/match00.at: New file.
* modules/metaphone2/tests/testsuite.at: New file.
* NEWS: Update.
* doc/dico.texi: Update.
Improve creation of new module framework by bootstrap
* bootstrap: Read the list of files that form a module from
modules/template/README.
* modules/.gitignore: Don't ignore all Makefile.am's
* modules/stub.am (EXTRA_DIST): Add template/README and <TEMPLATE>.
* modules/template.am: Rename to modules/template/Makefile.am
* modules/template/README: New file.
* modules/template.c: Rename to modules/template/module.c
* modules/template/tests/Makefile.am: New file.
* modules/template/tests/atlocal.in: New file.
* modules/template/tests/testsuite.at: New file.
2016-08-03 Sergey Poznyakoff <gray@gnu.org.ua>
Improve modules/template.c
2016-08-02 Sergey Poznyakoff <gray@gnu.org.ua>
New operation mode: module test
* dicod/cmdline.opt: New options: --test and --load-dir
* dicod/dicod.h (MODE_TEST): New mode.
(get_options): Change signature.
* dicod/loader.c (dicod_module_test): New function.
* dicod/main.c (config_parse): In test mode, allow
for non-existing configuration file.
(main): Handle test mode.
* include/dico/types.h (DICO_MODULE_VERSION): Raise to 2.
(dico_database_module) <dico_run_test>: New member.
* modules/substr/substr.c: Support module test
Determine the highest-numbered open file descriptor.
* dicod/dicod.h (getmaxfd): Remove macro.
* dicod/server.c (getmaxfd): New function.
2016-08-01 Sergey Poznyakoff <gray@gnu.org.ua>
Document UTF-8 functions.
* doc/libdico.texi: Document UTF-8 and related functions.
* lib/utf8.c: Set consistent error codes.
Fix soundex implementation.
* lib/soundex.c: Use American Soundex.
* lib/tests/soundex.c: New test program.
* modules/outline/tests/soundex.at: Fix expected output.
* lib/tests/soundex.at: New testcase.
* lib/tests/Makefile.am: Add new testcase.
* lib/tests/testsuite.at: Likewise.
Improve substring search function
* lib/utf8.c (utf8_wc_strpat): Remove.
(utf8_wc_strstr): If unable to allocate KMP border table
fall back to brute force algorithm.
* include/dico/utf8.h (utf8_wc_strpat): Remove.
* doc/libdico.texi: Remove utf8_wc_strpat
* lib/tests/wcstrstr.at: Check corner cases.
* modules/substr/substr.c" Use utf8_wc_strstr (reverts
b9a48eae).
2016-07-31 Sergey Poznyakoff <gray@gnu.org>
Rename modinc to bootstrap.
* modinc: Rename to bootstrap.
* bootstrap: Add generic bootstrapping code.
* stub.ac: Rename to configure.boot.
* Makefile.am: Fix EXTRA_DIST
* README-hacking: Document bootstrap.
2016-07-31 Sergey Poznyakoff <gray@gnu.org.ua>
Bugfix
* modules/pcre/module.ac: Fix DICO_CHECK_LIB arguments
(cda4f4b9 added : in wrong place).
Upgrade grecs
* grecs: Pull latest commit.
* dicod/main.c (config_init): Set GRECS_OPTION_QUOTED_STRING_CONCAT
option.
* dicod/accesslog.c: Use %td specifier to print ptrdiff_t values.
* dicod/server.c (handle_connection): Return meaningful status
in single_process mode.
* modules/gcide/idxgcide.l: Set option noinput.
* modules/gcide/markup.l: Likewise.
Use Knuth-Morris-Pratt algorithm for substing look-ups
* include/dico/utf8.h (utf8_wc_strpat): New proto.
* lib/utf8.c (utf8_wc_strpat): New function.
(utf8_wc_strstr): Rewrite as a wrapper over utf8_wc_strpat.
* lib/tests/utf8.c: Use %td specifier to print ptrdiff_t values.
* doc/libdico.texi: Document string-matching functions.
* lib/tests/wcstrstr.at: Add more tests.
* modules/substr/substr.c (substr_sel): Use utf8_wc_strpat.
Improve modinc
* modinc: Provide explicit construct for multiline expansion.
* modules/stub.am: Use the new construct for HEADING expansion.
* stub.ac: Likewise.
2016-07-31 Sergey Poznyakoff <gray@gnu.org>
Minor fixes
* dicod/tests/echo.c: Avoid pointer-to-integer conversions.
* modinc: Fix docs.
* modules/pcre/module.ac: Make sure -lpcre is not added to LIBS.
2016-07-31 Sergey Poznyakoff <gray@gnu.org.ua>
Fix doc generation.
Default Config file applied to all output formats, which is wrong.
Use a dedicated configuration file for html output formats, and
defaults for the rest.
* doc/Makefile.am (GENDOCS): Add html-specific configuration file.
* doc/Config: Rename to doc/html.init (with changes).
* doc/gendocs.sh: New option --no-copy-images
Minor fixes
Minor changes
Use Texinfo 5 for building documentation
* doc/Config: Rewrite for texi2any
* doc/Makefile.am: Use Makeinfo 5 instead of texi2html
* doc/dico.texi: Minor changes.
* doc/gendocs.sh: New file.
* doc/gendocs_template: Ps is not built
* imprimatur: Upgrade.
* modinc: Minor change.
2016-07-31 Sergey Poznyakoff <gray@gnu.org>
Bugfix
* lib/utf8.c (utf8_wc_to_mbstr): Fix stack overflow
2016-07-31 Sergey Poznyakoff <gray@gnu.org.ua>
Add libgnu as a submodule
* gnulib: New module.
* .gitignore: Update.
* bootstrap: Rewrite from scratch.
* gnulib.modules: Remove deprecated modules.
* bootstrap.conf: Rename to gnulibinit.conf
* modules/.gitignore: New file.
* dico/Makefile.am: Link to libgnu.la, instead of libgnu.a
* dicod/Makefile.am: Likewise.
* dicod/tests/Makefile.am: Likewise.
* makedict/Makefile.am: Likewise.
* modules/gcide/Makefile.am: Likewise.
* stub.ac: Minor change.
2016-07-31 Sergey Poznyakoff <gray@gnu.org>
Update
* modules/stub.am: (EXTRA_DIST): Add template.am
2016-07-31 Sergey Poznyakoff <gray@gnu.org.ua>
Provide a utility for adding module into autoconf structure.
* .gitignore: Add configure.ac
* Makefile.am (EXTRA_DIST): Add stub.ac and modinc
* bootstrap: Obtain package name from stub.ac
* bootstrap.conf: Call modinc
* configure.ac: Remove.
* stub.ac: New file.
* modinc: New file.
* modules/dict.org/Makefile.am (EXTRA_DIST): add module.ac
* modules/dict.org/module.ac: New file.
* modules/guile/Makefile.am (EXTRA_DIST): add module.ac
* modules/guile/module.ac: New file.
* modules/ldap/Makefile.am (EXTRA_DIST): add module.ac
* modules/ldap/module.ac: New file.
* modules/pam/Makefile.am (EXTRA_DIST): add module.ac
* modules/pam/module.ac: New file.
* modules/pcre/Makefile.am (EXTRA_DIST): add module.ac
* modules/pcre/module.ac: New file.
* modules/python/Makefile.am (EXTRA_DIST): add module.ac
* modules/python/module.ac: New file.
* modules/wordnet/Makefile.am (EXTRA_DIST): add module.ac
* modules/wordnet/module.ac: New file.
* modules/Makefile.am: Remove.
* modules/stub.am: New file.
* modules/template.am: New file.
* modules/template.c: Use modinc macro variable to create
struct dico_database_module.
2016-07-28 Sergey Poznyakoff <gray@gnu.org>
Bugfix
* modules/gcide/idxgcide.l (main): Initialize ipg_header.
Minor fixes.
* configure.ac: Make sure -lpcre is not added to LIBS.
* dicod/tests/echo.c: Avoid pointer-to-integer conversions.
2015-09-29 Sergey Poznyakoff <gray@gnu.org>
Fix default port in dico client
* dico/connect.c (dict_connect): Select default port if url->port
is not set.
2015-03-15 Wojciech Polak <polak@gnu.org>
Add Python 3 support via Six.
2014-10-19 Wojciech Polak <polak@gnu.org>
Update Dicoweb for Django 1.5+
2014-10-04 Sergey Poznyakoff <gray@gnu.org>
Update NEWS
2014-10-01 Sergey Poznyakoff <gray@gnu.org.ua>
Fix compatibility with guile 1.8
* examples/listdict.scm: Use (ice-9 syncase) if Guile major
version is 1.
* modules/guile/Makefile.am (EXTRA_DIST): Remove guile.x. Always
create it during the build. Add it to CLEANFILES.
2014-09-30 Wojciech Polak <polak@gnu.org>
Add wsgi.virtualenv.py
2014-09-28 Sergey Poznyakoff <gray@gnu.org>
Add manpages.
* configure.ac (DEFAULT_INCLUDE_DIR)
(DEFAULT_VERSION_INCLUDE_DIR): New variables.
* dicod/Makefile.am (AM_CPPFLAGS): Use new variables.
* dicod/cmdline.opt: Fix argument name for the --debug option.
* dicod/main.c (set_user): Treat +NUM as UID number.
(set_supp_group): Treat +NUM as GID number.
* doc/.gitignore: Add new generated files.
* doc/Makefile.am: Add manpages.
* doc/dico.texi: Update.
* doc/dico.1: New file.
* doc/dicod.8in: New file.
* doc/dicod.conf.5in: New file.
2014-09-26 Sergey Poznyakoff <gray@gnu.org>
Document IPv6 support.
* NEWS: Updated.
* doc/dico.texi: Document all ways of specifying sockets
to listen on.
2014-09-25 Sergey Poznyakoff <gray@gnu.org>
Fix VPATH builds
* grecs: Upgrade
Various fixes.
* dico/shell.c (_command_completion): Fix type of the first parameter.
(shell_init): Remove typecast.
* lib/tests/utf8.c: Fix format specifiers.
* modules/dict.org/dictorg.c (init_suffix_index): Redo freeing loop.
* modules/gcide/Makefile.am: Refer to libgcide.la without leading ./,
to fix compilation with BSD Make.
* modules/gcide/gcide.c (gcide_init_db): Avoid using old-style GNU
member specification.
* modules/gcide/idx.c (_cache_promote): Fix type of the counter.
* modules/outline/outline.c (init_suffix_index): Redo freeing loop.
IPv6 support.
* grecs: Upgrade.
* configure.ac (GRECS_SETUP): Request sockaddr-list.
* include/dico/types.h (DICO_DICT_PORT_STR): New constant.
(dico_url) <port>: Change type to char *. All uses changed.
* include/dico/url.h (ip_hostname, get_ipaddr)
(str2port): Remove obsolete functions and data types.
* include/appi18n.h (appi18n_init): New proto.
* dicod/accesslog.c: Add typecasts to struct sockaddr*. Fix
format string conversions.
* dicod/acl.c (acl_value): New union.
(acl_entry) <sockaddrs>: Rename to values. Holds acl_value entries now.
(_parse_sockaddr): Remove.
(_parse_acl_value): New function. Use grecs CIDRs to represent ACL entries.
(_check_sockaddr): Replace with _check_value. All uses updated.
* dicod/alias.c (alias_hasher): Fix signature.
* dicod/dicod.c: Add typecasts to struct sockaddr*.
* dicod/dicod.h (client_addr): Change type to sockaddr_storage.
* dicod/ident.c (query_ident_name): Remove unused variable.
* dicod/loader.c: Minor fix.
* dicod/main.c (cb_dico_sockaddr_list): Use grecs sockaddr-list support.
* dicod/server.c (address_family_to_domain): Add IPv6 support.
(client_addr): Change type to struct sockaddr_storage. All uses changed.
* dico/cmdline.opt: Update.
* dico/connect.c (dict_connect): Rewrite using getaddrinfo.
* dico/dico-priv.h (source_addr): Change type to char*.
(shell_banner): New proto.
* dico/dico.c (source_addr): Change type to char*.
(fixup_url): dico_url.port member is char *.
* dico/func.c: dico_url.port member is char *.
* lib/iputil.c (ip_hostname, get_ipaddr)
(str2port): Remove obsolete functions.
(sockaddr_to_str): Add IPv6 support.
* lib/url.c (url_get_host): Allocate memory for url.port
(dico_url_destroy): Free port.
* lib/logstream.c: Minor fixes.
* lib/qp.c: Likewise.
* modules/gcide/markup.l: Likewise.
2014-09-21 Sergey Poznyakoff <gray@gnu.org>
Fix Guile deprecation mesages; modify guile module testsuite for Guile 2.x
* modules/guile/guile.c (guile_safe_exec)
(guile_call_proc): Use scm_c_with_throw_handler for Guile 2.0 and newer.
* examples/listdict.scm: (ice-9 syncase) no longer needed.
* include/testsuite.inc (DICOD_RUN): Take stderr filter as an
optional second argument.
* modules/guile/tests/define.at: Filter out Guile compiler messages from
stderr.
* modules/guile/tests/exact.at: Likewise.
* modules/guile/tests/lev.at: Likewise.
* modules/guile/tests/prefix.at: Likewise.
* modules/guile/tests/showdb.at: Likewise.
* modules/guile/tests/showinfo.at: Likewise.
* modules/guile/tests/showlang.at: Likewise.
* modules/guile/tests/suffix.at: Likewise.
Minor fixes.
* configure.ac (AM_INIT_AUTOMAKE): Add subdir-objects
* dicod/acl.c (acl_hasher): Fix argument types.
* lib/timer.c (timer_hasher): Likewise.
2014-09-18 Wojciech Polak <polak@gnu.org>
Minor Dicoweb updates.
2014-01-11 Wojciech Polak <polak@gnu.org>
Minor Dicoweb changes.
2013-12-19 Sergey Poznyakoff <gray@gnu.org>
Fix dico/ in accordance with c1f6dc71
2013-12-18 Sergey Poznyakoff <gray@gnu.org.ua>
Version 2.2.90
Update .gitignore files
Update submodules and build system
* bootstrap (gnulib_extra_files): Remove "missing".
* configure.ac: Require libtool 2.4 and gettext 0.18
* dicod/cmdline.opt: Use the program_version option.
* dicod/dicod.h (program_version): New extern.
* gint: Upgrade.
* grecs: Upgrade.
* lib/levenshtein.c (dico_levenshtein_distance): Avoid
assigning dist at each iteration.
* dico/Makefile.am: Use AM_CPPFLAGS instead of INCLUDES.
* dicod/Makefile.am: Likewise.
* dicod/tests/Makefile.am: Likewise.
* lib/Makefile.am: Likewise.
* lib/tests/Makefile.am: Likewise.
* makedict/Makefile.am: Likewise.
* modules/dict.org/Makefile.am: Likewise.
* modules/gcide/Makefile.am: Likewise.
* modules/gcide/tests/Makefile.am: Likewise.
* modules/guile/Makefile.am: Likewise.
* modules/ldap/Makefile.am: Likewise.
* modules/nprefix/Makefile.am: Likewise.
* modules/outline/Makefile.am: Likewise.
* modules/pam/Makefile.am: Likewise.
* modules/pcre/Makefile.am: Likewise.
* modules/python/Makefile.am: Likewise.
* modules/stratall/Makefile.am: Likewise.
* modules/substr/Makefile.am: Likewise.
* modules/word/Makefile.am: Likewise.
* modules/wordnet/Makefile.am: Likewise.
2013-04-09 Wojciech Polak <polak@gnu.org>
Support Django 1.5.
2013-03-08 Wojciech Polak <polak@gnu.org>
PEP8 code formatting changes.
Update Dicoweb for Django 1.4+
Add requirements.txt file for PIP.
2013-03-02 Wojciech Polak <polak@gnu.org>
Dicoweb: Add CSS for mobile devices.
2012-07-15 Sergey Poznyakoff <gray@gnu.org.ua>
Upgrade imprimatur.
2012-03-04 Sergey Poznyakoff <gray@gnu.org.ua>
Implement info/descr for gcide.
* NEWS: Update.
* doc/dico.texi: Update.
* include/dico/util.h (dico_string_trim): Add missing proto.
* modules/gcide/gcide.c (gcide_info, gcide_descr): Implement
info and description methods.
* modules/gcide/tests/dict/INFO: New file.
* modules/gcide/tests/Makefile.am (TESTSUITE_AT): Add descr.at and
info.at.
* modules/gcide/tests/testsuite.at: Include descr.at and info.at
* modules/gcide/tests/dicod.cfin: Remove description.
* modules/gcide/tests/descr.at: New test case.
* modules/gcide/tests/info.at: New test case.
* modules/gcide/tests/def00.at: Update.
* modules/gcide/tests/def01.at: Update.
* modules/gcide/tests/def02.at: Update.
* modules/gcide/tests/def03.at: Update.
* modules/gcide/tests/def04.at: Update.
* modules/gcide/tests/def05.at: Update.
* scripts/Makefile.am: Exempt gcider from standard options check.
2012-03-03 Sergey Poznyakoff <gray@gnu.org.ua>
Version 2.2
* NEWS: Update.
* configure.ac: Version 2.2
Remove DBM autodetection.
* doc/dico.texi: Update.
* doc/gendocs_template: Update.
* scripts/gcider: Update.
* grecs: Upgrade.
* lib/tests/Makefile.am (LDADD): Add $(LIBINTL).
* lib/utf8.c [!ENODATA]: Define ENODATA.
* modules/gcide/Makefile.am (gcide_la_LIBADD): Add @LTLIBINTL@.
(idxgcide_LDADD): Add @LIBINTL@
(INCLUDES): Add gnu
* modules/gcide/gcide.c" Include signal.h
* modules/gcide/tests/Makefile.am (degcide_LDADD)
(greek_LDADD): Add @LIBINTL@
* modules/nprefix/tests/dict.out: Use only lowercase headwords.
Improve SASL authentication.
* dico/saslauth.c: Make sure authentication is attempted
only if the server offers SASL.
(authctx): New struct.
(match_capa,getauthcontext)
(freeauthcontext): New functions.
(saslauth0): Change signature: take authctx as 3rd arg.
(saslauth): Return AUTH_CONT if SASL is not available or
none of its methods matches those implemented on the client
side.
* dicod/main.c (user_db_config): Fix the source location copy.
(init_user_db): Clear sasl_enable if no user database is configured.
(main): Call register_sasl after init_user_db so that the above
change takes effect.
* dicod/server.c (dicod_server): Don't try to remove pidfile
in foreground mode.
* doc/proto.texi: Minor fix.
2012-03-02 Sergey Poznyakoff <gray@gnu.org.ua>
Update docs.
Improve the documentation.
2012-02-28 Sergey Poznyakoff <gray@gnu.org.ua>
Minor changes
* README: Update.
* examples/numerals-cz.txt: Change initial comment.
* examples/numerals-pl.ldb: Likewise.
* scripts/gcider: Handle broken pipe and partial reads graciously.
gcide: recreate index if any of the corpus files change.
* modules/gcide/gcide.c (gcide_db) <latest_change>: New member.
(gcide_check_files): Fill in db->latest_change.
(gcide_access_idx): New function. Check index file availability
and timestamp.
(gcide_open_idx): Use gcide_access_idx to determine whether to
create the index.
2012-02-27 Sergey Poznyakoff <gray@gnu.org.ua>
Update docs. Fix a bug in python.
* doc/dico.texi: Finish main part.
* modules/python/python.c (strat_select_method): Fix docstring.
(dico_register_strat): Bugfix: reversed sense of a conditional.
(mod_init_db): Declare DICO_SELECT_* constants.
(mod_match): Fix memory leaks. Remove useless call to strat->sel,
which is called by dico_key_deinit implicitly.
Minor bugfixes in gcide.
* modules/gcide/ent.c: Add missing entities (dagger, dag, para, etc.)
* modules/gcide/gcide.c (GCIDE_DBGLEX): New flag.
(gcide_init_db): New flag debug-lex.
(output_def): If GCIDE_DBGLEX is set, enable lexer debugging.
* modules/gcide/gcide.h (TAG_HAS_NAME): New macro.
(gcide_markup_debug): Remove extern.
(gcide_markup_parse): Takes three arguments.
* modules/gcide/idxgcide.l: Tags and entities can contain uppercase
letters.
* modules/gcide/markup.l: Likewise.
Define more yy* symbols.
(pop_tag): Fix coredump on encountering improperly nested tag.
(gcide_markup_debug): Remove.
(gcide_markup_parse): Take three arguments. All uses updated.
Improve docs.
* doc/strat.texi: New file. Describes available match strategies.
* doc/Makefile.am: Add strat.texi
* doc/dico.texi: New appendix "Available Strategies".
2012-02-25 Sergey Poznyakoff <gray@gnu.org.ua>
Bugfixes.
* dicod/accesslog.c (access_log_status): If "last" begins with a
dot, advance 2 characters (complements 61ed04af).
* scripts/gcider: Don't clear the tearOff option.
(setupvisual): Add hotkeys to menu. Fix column configuration
(saveconf): Save geometry. Don't save non-existing variables.
(main): Restore main window geometry.
Minor cleanup
* configure.ac: New option --with-tk. Do not "build" gcider
if Tcl/Tk is not available.
* scripts/Makefile.am: Likewise.
* scripts/gcider (setupvisual): Add necessary rowconfigures.
2012-02-23 Sergey Poznyakoff <gray@gnu.org.ua>
Upgrade grecs
gcide: fix search in index page
* modules/gcide/idx.c (gcide_idx_locate): Revamp the backtracking
loop.
gcide: support --help and --version command line options.
2012-02-20 Sergey Poznyakoff <gray@gnu.org.ua>
Minor changes
* NEWS: Document gcider.
* scripts/gcider (helpbox): Bind scrolling actions to kbd.
(about): Bind CR and ESC keys.
(gcide_configure): Add "help" button.
2012-02-19 Sergey Poznyakoff <gray@gnu.org.ua>
More changes in gcider.
* scripts/gcider: Create GCIDE.IDX in the configuration directory
by default, but provide an option to change this. Close current
connection before opening new one.
gcider: fix semantics of prev/next
Document gcider.
Improve gcider interface.
Provide buttons for moving within input history; clear selection
in entry parts of comboboxes when selecting a prior value into
them.
2012-02-18 Sergey Poznyakoff <gray@gnu.org.ua>
gcider: limit the history size; other minor changes.
Bugfix in the gcide module.
* modules/gcide/idx.c (gcide_idx_locate): Fix backtracking.
Improve gcider interface.
* scripts/gcider: Provide a documentation (manual) window.
Add status line.
Use short strategy names in the strategy combobox, except for the
".", which is rendered as "Default". When hovering over the
strategy popdown, print full description of a higlighted strategy
in the status line.
* doc/dico.texi: Update.
2012-02-13 Sergey Poznyakoff <gray@gnu.org.ua>
gcider: add window titles.
Add gcider to distribution
2012-02-12 Sergey Poznyakoff <gray@gnu.org.ua>
gcider: configure appearance, save its settings to the config
2012-02-11 Sergey Poznyakoff <gray@gnu.org.ua>
gcider: implement input widget popup menu.
2012-02-09 Sergey Poznyakoff <gray@gnu.org.ua>
gcider: improve article presentation.
* scripts/gcider (readdefns): Remove curly braces surrounding
cross references.
Implement CR<=>CRLF translation stream.
* lib/stream.c (_stream_flush_buffer): Fix full buffering.
(dico_stream_read): Break from the loop if level remains zero
after filling the buffer.
(dico_stream_writeln): Write a single \n at end of line.
* TODO: Update.
* dicod/dicod.c: End lines with a single \n. The \r is added
automatically by the transport stream.
(dicod_inetd): Use dicod_iostream to create transport stream.
(dicod_iostream): New function.
* dicod/dicod.h (dicod_iostream): New proto.
* dicod/ostream.c (print_headers): End lines with a single \n.
The \r is added automatically by the transport stream.
Install dico_linetrim_stream here.
* dicod/server.c (handle_connection): Use dicod_iostream to create
transport stream. End lines with a single \n.
* include/dico/stream.h (dico_crlf_stream): New proto.
* dicod/auth.c: End lines with a single \n. The \r is added
automatically by the transport stream.
* dicod/commands.c: Likewise.
* dicod/gsasl.c: Likewise
* dicod/lang.c: Likewise
* dicod/lev.c: Likewise
* dicod/loader.c: Likewise
* dicod/markup.c: Likewise
* dicod/mime.c: Likewise
* dicod/xidle.c: Likewise
* dicod/xversion.c: Likewise
* lib/fltstream.c: Likewise
* lib/Makefile.am (libdico_la_SOURCES): Add crlfstr.c
* lib/crlfstr.c: New file.
* lib/tests/Makefile.am (noinst_PROGRAMS): Add crlftool
(TESTSUITE_AT): Add crlf tests.
* lib/tests/crlftool.c: New file.
* lib/tests/crlf00.at: New test case.
* lib/tests/crlf01.at: New test case.
* lib/tests/crlf02.at: New test case.
* lib/tests/crlf03.at: New test case.
* lib/tests/crlf04.at: New test case.
* lib/tests/crlf05.at: New test case.
* lib/tests/testsuite.at: Include crlf tests.
dicod: make sure output lines are no longer than 1024 UTF-8 characters.
* dicod/ostream.c (dicod_ostream_create): Use linetrim stream as
transport.
* include/dico/stream.h (DICO_IOCTL_SET_LINELEN)
(DICO_IOCTL_GET_LINELEN): New ioctls.
(dico_linetrim_stream): New function.
* lib/Makefile.am (libdico_la_SOURCES): Add linetrimstr.c
* lib/linetrimstr.c: New file. Implementation of "line triming" stream.
* lib/tests/Makefile.am: Add new tests.
* lib/tests/linetrim.c: New file.
* lib/tests/lntrim00.at: New file.
* lib/tests/lntrim01.at: New file.
* lib/tests/lntrim02.at: New file.
* lib/tests/lntrim03.at: New file.
* lib/tests/testsuite.at: Include new tests.
2012-02-07 Sergey Poznyakoff <gray@gnu.org.ua>
gcider: add text tags
Minor changes in gcider.
Implement a standalone Tk-based viewer for GCIDE
* scripts/gcider: New file.
2012-02-05 Sergey Poznyakoff <gray@gnu.org.ua>
Implement PAM authentication.
* configure.ac: Check for PAM libraries and headers.
Build modules/pam/Makefile.
* dicod/gsasl.c (cb_validate): Call dico_udb_check_password first,
and dico_udb_get_password if it is not implemented.
* include/dico/udb.h (dico_udb_def)<_db_check_password>: New
member.
(dico_udb_check_password): New function.
* lib/udb.c (dico_udb) <_db_check_password>: New member.
(dico_udb_check_password): New function.
(dico_udb_get_password): Initialize _db_check_password.
* modules/Makefile.am [PAM_COND]: Define PAM_DIR
(SUBDIRS): Add $PAM_DIR.
* modules/pam/Makefile.am: New file.
* modules/pam/pam.c: New file.
* NEWS: Update.
* README: Update.
* doc/dico.texi: Document PAM.
Bugfixes.
* dicod/main.c (user_db_config): Allocate copies of file name
for cfg->locus.beg.file and cfg->locus.end.file.
* modules/nprefix/nprefix.c: Include string.h
* dicod/server.c (dicod_server): Ignore user/group settings if not
running as root.
2012-02-04 Sergey Poznyakoff <gray@gnu.org.ua>
Update docs.
2012-02-03 Sergey Poznyakoff <gray@gnu.org.ua>
gcide: Minor changes.
* modules/gcide/idxgcide.l: Count initial double vertical bar as
start of entry.
Index <conf> and <conjf> entries.
* modules/gcide/tests/def02.at: Reflect the recent changes.
gcide: Fix some UTF-8 entities.
2012-02-02 Sergey Poznyakoff <gray@gnu.org.ua>
New dicod option -D (define symbol).
* dicod/cmdline.opt: Handle the -D (--define) option.
* doc/dico.texi: Document it.
gcide: further improvements.
* modules/gcide/ent.c: Add new entities.
* modules/gcide/idxgcide.l: Index <decf> entries.
2012-01-31 Sergey Poznyakoff <gray@gnu.org.ua>
Bugfix in word module.
* modules/word/word.c (first_sel,last_sel): Return 0 if the
dictionary word is empty.
Implement the nprefix strategy.
* configure.ac: Configure the nprefix module.
* NEWS: Document nprefix.
* doc/dico.texi: Likewise.
* modules/Makefile.am (SUBDIRS): Add nprefix.
* modules/nprefix/Makefile.am: New file.
* modules/nprefix/nprefix.c: New file.
* modules/nprefix/tests/Makefile.am: New file.
* modules/nprefix/tests/atlocal.in: New file.
* modules/nprefix/tests/dicod.cfin: New file.
* modules/nprefix/tests/dict.out: New file.
* modules/nprefix/tests/np00.at: New file.
* modules/nprefix/tests/np01.at: New file.
* modules/nprefix/tests/np02.at: New file.
* modules/nprefix/tests/np03.at: New file.
* modules/nprefix/tests/np04.at: New file.
* modules/nprefix/tests/testsuite.at: New file.
* modules/nprefix/tests/.gitignore: New file.
Implement "first" and "last" matching strategies.
* modules/word/word.c: Implement new strategies.
* NEWS: Document new strategies.
* doc/dico.texi: Likewise.
* modules/word/tests/dicod.cfin: Load dict.out
* modules/word/tests/dict.out: New file.
* modules/word/tests/first.at: New file.
* modules/word/tests/last.at: New file.
* modules/word/tests/word.at: New file.
* modules/word/tests/Makefile.am: Add new files. Change ~dictdir~.
* modules/word/tests/testsuite.at: Include new files.
Document the pcre module.
Accept CLIENT command without arguments.
Update the docs.
Bugfix
* dicod/commands.c (dicod_client): The CLIENT command takes any
number of arguments.
2012-01-30 Sergey Poznyakoff <gray@gnu.org.ua>
Update for gcide 0.51
* modules/gcide/ent.c: Handle <oacute/, <ldquo/ and <rdquo/.
* modules/gcide/idxgcide.l: <ent> tag triggers flush_headwords.
2012-01-29 Sergey Poznyakoff <gray@gnu.org.ua>
Test the basic dicod functionality.
* configure.ac: Define LIBDICOSASL to absolute path.
Initialize tests in dicod.
* dicod/Makefile.am (SUBDIRS): Add tests.
* include/testsuite.inc (AT_SKIP_TEST,DICO_VERSION)
(DICOD_RUN): New defines.
* dicod/tests/Makefile.am: New file.
* dicod/tests/atlocal.in: New file.
* dicod/tests/group: New file.
* dicod/tests/passwd: New file.
* dicod/tests/startup.at: New file.
* dicod/tests/alias.at: New file.
* dicod/tests/apop.at: New file.
* dicod/tests/apopauth.c: New file.
* dicod/tests/def.at: New file.
* dicod/tests/descr.at: New file.
* dicod/tests/echo.c: New file.
* dicod/tests/help00.at: New file.
* dicod/tests/help01.at: New file.
* dicod/tests/help02.at: New file.
* dicod/tests/help03.at: New file.
* dicod/tests/info.at: New file.
* dicod/tests/match.at: New file.
* dicod/tests/nodef.at: New file.
* dicod/tests/nomatch.at: New file.
* dicod/tests/showdb.at: New file.
* dicod/tests/showstrat.at: New file.
* dicod/tests/testsuite.at: New file.
* dicod/tests/vis00.at: New file.
* dicod/tests/vis01.at: New file.
* dicod/tests/vis02.at: New file.
Upgrate grecs.
Minor fixes in dicod.
* dicod/acl.c (acl_entry) <dflt>: New member.
(_acl_check): Handle dflt specially.
(dicod_acl_create,parse_acl_line): allocate a copy of member
field in loci.
(_parse_from): Accept the traditional "from any" clause.
* dicod/commands.c (dicod_show_server): Dont print timing if
timing_option is not set.
Fix the docs.
* dico/cmdline.opt: Use the gnupackage option to include web
URL into the help output.
* dicod/cmdline.opt: Likewise.
* doc/dico.texi: Improve some wording.
2012-01-28 Sergey Poznyakoff <gray@gnu.org.ua>
Document wordnet module.
Minor changes.
* modules/gcide/gcide.c (run_idxgcide): Fix error diagnostics.
(gcide_open_idx): don't try to open the index file if idxgcide
has failed.
2012-01-27 Sergey Poznyakoff <gray@gnu.org.ua>
Fix handling of double vertical bar (\'d8) in GCIDE database.
* modules/gcide/idxgcide.l: Allow for \'d8 between <p> and <hw>.
Ignore it elsewhere.
* modules/gcide/tests/Makefile.am: Add new tests.
* modules/gcide/tests/def02.at: New file.
* modules/gcide/tests/def03.at: New file.
* modules/gcide/tests/def04.at: New file.
* modules/gcide/tests/def05.at: New file.
* modules/gcide/tests/dict/CIDE.A: Add double bar to a headword.
* modules/gcide/tests/testsuite.at: Include new tests.
2012-01-26 Sergey Poznyakoff <gray@gnu.org.ua>
Update .gitignore.
Remove a stray file.
Add Emacs mode markers and keywords to test cases.
Fixes in gcide indexing algorithm. Add module tests.
* modules/gcide/gcide.c (run_idxgcide): Fix idxgcide invocation.
* modules/gcide/idx.c (gcide_idx_file_close): Avoid coredump on
NULL argument.
* modules/gcide/idxgcide.l (i): Rename to letno. All uses updated.
(flush_headwords): Update headword_position even if headword is empty.
(yywrap): Call flush_headwords; reset headword_position to 0.
(main): Remove unnecessary call to flush_headwords, now that is handled
by yywrap.
* modules/gcide/tests/Makefile.am: Add new tests.
* modules/gcide/tests/atlocal.in (PATH): Update.
(DICTDIR,IDXDIR): New variables.
* modules/gcide/tests/all.at: New testcase.
* modules/gcide/tests/autoidx.at: New testcase.
* modules/gcide/tests/def00.at: New testcase.
* modules/gcide/tests/def01.at: New testcase.
* modules/gcide/tests/define.at: New testcase.
* modules/gcide/tests/exact.at: New testcase.
* modules/gcide/tests/idx.at: New testcase.
* modules/gcide/tests/prefix.at: New testcase.
* modules/gcide/tests/testsuite.at: Include new tests.
* modules/gcide/tests/dicod.cfin: New file.
* modules/gcide/tests/dict/CIDE.A: New file.
* modules/gcide/tests/dict/CIDE.B: New file.
* modules/gcide/tests/dict/CIDE.C: New file.
* modules/gcide/tests/dict/CIDE.D: New file.
* modules/gcide/tests/dict/CIDE.E: New file.
* modules/gcide/tests/dict/CIDE.F: New file.
* modules/gcide/tests/dict/CIDE.G: New file.
* modules/gcide/tests/dict/CIDE.H: New file.
* modules/gcide/tests/dict/CIDE.I: New file.
* modules/gcide/tests/dict/CIDE.J: New file.
* modules/gcide/tests/dict/CIDE.K: New file.
* modules/gcide/tests/dict/CIDE.L: New file.
* modules/gcide/tests/dict/CIDE.M: New file.
* modules/gcide/tests/dict/CIDE.N: New file.
* modules/gcide/tests/dict/CIDE.O: New file.
* modules/gcide/tests/dict/CIDE.P: New file.
* modules/gcide/tests/dict/CIDE.Q: New file.
* modules/gcide/tests/dict/CIDE.R: New file.
* modules/gcide/tests/dict/CIDE.S: New file.
* modules/gcide/tests/dict/CIDE.T: New file.
* modules/gcide/tests/dict/CIDE.U: New file.
* modules/gcide/tests/dict/CIDE.V: New file.
* modules/gcide/tests/dict/CIDE.W: New file.
* modules/gcide/tests/dict/CIDE.X: New file.
* modules/gcide/tests/dict/CIDE.Y: New file.
* modules/gcide/tests/dict/CIDE.Z: New file.
* dicod/gsasl.c (callback): Comment out spurious diagnostics.
Test gcide markup and Greek transliteration.
* configure.ac: Configure gcide tests.
* modules/gcide/tests/.gitignore: Update.
* modules/gcide/tests/Makefile.am: Add test cases.
* modules/gcide/tests/atlocal.in: New file.
* modules/gcide/tests/degcide.c: Change command line handling.
Use the same output algorithm as in gcide.c
* modules/gcide/tests/greek.at: New file.
* modules/gcide/tests/markup.at: New file.
* modules/gcide/tests/nopr.at: New file.
* modules/gcide/tests/testsuite.at: New file.
* dicod/cmdline.opt: Minor change.
2012-01-25 Sergey Poznyakoff <gray@gnu.org.ua>
gcide: add an option to suppress <pr> blocks.
* modules/gcide/ent.c: Recognize <and/ and <or/
* modules/gcide/gcide.c GCIDE_NOPR): New define.
(gcide_db)<flags>: New member.
(gcide_init_db): New option "suppress-pr"
(GOF_IGNORE): New flag.
(GOF_AS): Change constant.
(print_text): Suppress text output if GOF_IGNORE is set.
Set it if <pr> is encountered and GCIDE_NOPR flag is set.
(output_def): Initialize clos.flags with the value from db->flags.
* doc/dico.texi: Update.
Minor fix.
Update NEWS.
Update the docs.
Test built-in strategies.
* modules/outline/tests/Makefile.am (TESTSUITE_AT): Add new test files.
* modules/outline/tests/testsuite.at: Inlcude new tests.
* modules/outline/tests/dlev.at: New file.
* modules/outline/tests/dnlev.at: New file.
* modules/outline/tests/nlev.at: New file.
* modules/outline/tests/re.at: New file.
* modules/outline/tests/regexp.at: New file.
* modules/outline/tests/soundex.at: New file.
Add tests for the strategies "word", "substr" and "all".
Update auxiliary files.
Remove top-level tests dir.
* Makefile.am: Remove tests.
* configure.ac: Likewise.
* examples/Makefile.am: Add glossary.scm
* tests/glossary.scm: Move to examples
* tests/.gitignore: Remove.
* tests/Makefile.am: Remove.
* tests/dicod.cfin: Remove.
Add python module test.
* configure.ac: Configure python testdir.
* examples/Makefile.am: Add new files.
* tests/example.text: Move to examples/numerals-cz.txt
* tests/example.py: Move to examples/textdict.py
* modules/python/Makefile.am (SUBDIRS): Add tests.
* modules/python/tests/Makefile.am: New file.
* modules/python/tests/atlocal.in: New file.
* modules/python/tests/define.at: New file.
* modules/python/tests/dicod.cfin: New file.
* modules/python/tests/exact.at: New file.
* modules/python/tests/lev.at: New file.
* modules/python/tests/prefix.at: New file.
* modules/python/tests/showdb.at: New file.
* modules/python/tests/showinfo.at: New file.
* modules/python/tests/showlang.at: New file.
* modules/python/tests/testsuite.at: New file.
Add Levenshtein strategy tests.
* modules/guile/tests/Makefile.am: Add lev.at
* modules/guile/tests/lev.at: New file.
* modules/guile/tests/testsuite.at: Include lev.at
* modules/outline/tests/Makefile.am: Add lev.at
* modules/outline/tests/lev.at: New file.
* modules/outline/tests/testsuite.at: Add lev.at
Add guile tests.
* configure.ac: Configure guile tests.
* examples/listdict.scm: Minor change.
* modules/guile/Makefile.am (SUBDIR): Add tests.
* modules/guile/tests/.gitignore: New file.
* modules/guile/tests/Makefile.am: New file.
* modules/guile/tests/define.at: New file.
* modules/guile/tests/dicod.cfin: New file.
* modules/guile/tests/exact.at: New file.
* modules/guile/tests/prefix.at: New file.
* modules/guile/tests/showdb.at: New file.
* modules/guile/tests/showinfo.at: New file.
* modules/guile/tests/showlang.at: New file.
* modules/guile/tests/suffix.at: New file.
* modules/guile/tests/testsuite.at: New file.
Add outline tests.
* Makefile.am (SUBDIRS): Add examples.
* am/testdir.m4: New file.
* configure.ac: Configure examples/Makefile.am and outline test dir.
* tests/devils.out: Move to examples/devdict.out.
* tests/example.scm: Move to examples/listdict.scm.
* tests/example.db: Move to examples/numerals-pl.ldb
* examples/Makefile.am: New file.
* include/Makefile.am (noinst_HEADERS): Add testsuite.inc
* include/testsuite.inc: New file.
* lib/tests/Makefile.am: Minor change.
* lib/tests/atlocal.in: Likewise.
* modules/outline/Makefile.am (SUBDIRS): Add tests.
* modules/outline/tests/.gitignore: New file.
* modules/outline/tests/Makefile.am: New file.
* modules/outline/tests/atlocal.in: New file.
* modules/outline/tests/define.at: New file.
* modules/outline/tests/dicod.cfin: New file.
* modules/outline/tests/exact.at: New file.
* modules/outline/tests/prefix.at: New file.
* modules/outline/tests/showdb.at: New file.
* modules/outline/tests/showinfo.at: New file.
* modules/outline/tests/showlang.at: New file.
* modules/outline/tests/testsuite.at: New file.
Add tests for list operations.
* include/dico/list.h (dico_list_push): Push to the list tail.
* lib/list.c (dico_list_pop): Pop from the tail.
* lib/tests/.gitignore: Update.
* lib/tests/Makefile.am (noinst_PROGRAMS): Add listop.
(TESTSUITE_AT): Add list.at
* lib/tests/itrsh.c: New file.
* lib/tests/itrsh.h: New file.
* lib/tests/list.at: New file.
* lib/tests/listop.c: New file.
* lib/tests/testsuite.at: Inlcude list.at
2012-01-24 Sergey Poznyakoff <gray@gnu.org.ua>
Improvements in gcide and wordnet modules.
* modules/gcide/gcide.c (print_text): Translate <er> tag to {...}.
* modules/wordnet/wordnet.c (WNDB_MERGE_DEFS): New define.
(wndb) <flags>: New member.
(wn_option) <printer>: Change signature.
(wn_init_db): New boolean option merge-defs instructs module to
merge all available definitions into one.
(wn_output_result,wn_result_count): Handle WNDB_MERGE_DEFS flag.
Bugfix
* lib/list.c (dico_list_pop): Fix return from uninitialized variable.
Cleanup in wordnet code.
2012-01-23 Sergey Poznyakoff <gray@gnu.org.ua>
Start writing a testsuite.
* configure.ac: Add lib/tests.
* include/dico/utf8.h (utf8_toupper,utf8_tolower): Change signature.
* lib/Makefile.am (SUBDIRS): New variable.
* lib/utf8.c (utf8_strncasecmp): Fix boundary control.
(utf8_wc_strncmp,utf8_wc_strncasecmp): Likewise.
(utf8_toupper,utf8_tolower): Change signature.
* lib/tests/.gitignore: New file.
* lib/tests/Makefile.am: New file.
* lib/tests/atlocal.in: New file.
* lib/tests/strcasecmp.at: New file.
* lib/tests/strlen.at: New file.
* lib/tests/strncasecmp.at: New file.
* lib/tests/testsuite.at: New file.
* lib/tests/tolower.at: New file.
* lib/tests/toupper.at: New file.
* lib/tests/utf8.c: New file.
* lib/tests/wcstrcasecmp.at: New file.
* lib/tests/wcstrchr.at: New file.
* lib/tests/wcstrcmp.at: New file.
* lib/tests/wcstrncasecmp.at: New file.
* lib/tests/wcstrncmp.at: New file.
* lib/tests/wcstrstr.at: New file.
* tests/levtest.c: move to lib/tests/levtest.c
* lib/tests/dlev00.at: New file.
* lib/tests/dlev01.at: New file.
* lib/tests/lev00.at: New file.
* lib/tests/lev01.at: New file.
Add new utf8 functions.
* lib/utf8.c (utf8_wc_strncmp,utf8_wc_strncasecmp): New functions.
* include/dico/utf8.h: Update.
Provide default selectors for "exact", "prefix" and "suffix" strategies
* dicod/dicod.c: Provide default selectors for "exact","prefix"
and "suffix" strategies.
* modules/dict.org/dictorg.c (_match_simple): Take matcher as
argument.
(mod_match): Use default strategy mapper only if the module does not
provide such strategy.
* modules/outline/outline.c: Likewise.
* modules/wordnet/wordnet.c: Likewise.
2012-01-22 Sergey Poznyakoff <gray@gnu.org.ua>
wordnet: change processing of defines.
* modules/wordnet/wordnet.c (wndb) <search>: Remove.
<optc,optv>: New members.
(wn_free_db): Free wndb->optv.
(wn_option): New struct.
(wn_optlist): New variable.
(wn_init_db): Change option parsing.
(defn): New struct.
(result): Rewrite. All uses changed.
(wn_create_match_result): Take a pointer to struct wndb as argument.
(wn_is_defined): New function.
(wn_foreach_db): Rewrite. Change signature. All uses changed.
(wn_define): Rewrite.
(format_defn): New function.
(format_synset): Remove.
(wn_output_result): Rewrite result_define part.
Improve dico_list API.
* include/dico/list.h (dico_iterator_remove_current): void.
* lib/list.c (dico_iterator_remove_current): Change return type.
Call _dico_list_remove_item to do the job.
(_dico_list_remove_item): New static.
(_dico_list_remove): Call _dico_list_remove_item.
2012-01-21 Sergey Poznyakoff <gray@gnu.org.ua>
Add wordnet module.
* configure.ac: New option --with-wordnet.
* modules/Makefile.am [WORDNET_COND] (WORDNET_DIR): New variable.
(SUBDIRS): Add WORDNET_DIR.
* modules/wordnet/Makefile.am: New file.
* modules/wordnet/wordnet.c: New file.
Fix dico_list_insert_sorted.
* lib/list.c (_dico_list_insert_sorted): Fix coredump.
If flags are set and the matching item is already in the list, return
EEXIST.
2012-01-20 Sergey Poznyakoff <gray@gnu.org.ua>
gcide: support <xtil> tags.
2012-01-19 Sergey Poznyakoff <gray@gnu.org.ua>
Update the docs.
Assorted fixes.
* dicod/main.c (main): Call dicod_log_setup after config_parse, so that
configuration settings take effect.
* modules/gcide/idxgcide-cli.opt: --dry-run implies --verbose.
2012-01-18 Sergey Poznyakoff <gray@gnu.org.ua>
Bugfixes.
* dicod/Makefile.am: Restore incdir.
* dicod/server.c (open_sockets): Fix default sockaddr initialization.
gcide: Fix umlauts, remove CRs.
* modules/gcide/ent.c: Fix umlauts ("xum", not "xuml")
* modules/gcide/markup.l: Remove CRs.
Bugfix
* modules/gcide/gcide.c (gcide_output_result): Fix match output.
Improve idxgcide command line interface.
* modules/gcide/.gitignore: Update.
* modules/gcide/Makefile.am (idxgcide_SOURCES): Add idxgcide-cli.h
Build it from idxgcide-cli.opt.
(idxgcide_LDADD): Add libgnu and libxdico.
* modules/gcide/idxgcide-cli.opt: New file.
* modules/gcide/idxgcide.l: Include idxgcide-cli.h, use
get_options for command line parsing.
* po/POTFILES.in: Add files from modules/gcide.
Improve greek transliterator.
* configure.ac: Build modules/gcide/tests/Makefile.
* modules/gcide/Makefile.am (SUBDIRS): Add tests.
* modules/gcide/ent.c: Add digamma.
* modules/gcide/gcide.c (print_text): Fix output of quotes.
* modules/gcide/grk.c: Add more sequences.
* modules/gcide/markup.l: Fix handling of comments.
* modules/gcide/degcide.c: Move to tests.
* modules/gcide/greek.c: Likewise.
* modules/gcide/tests/exgrk.c: New file.
Convert Greek transliteration back to Greek. Remove markup when printing definitions.
* modules/gcide/Makefile.am (libgcide_la_SOURCES): Add grk.c
(noinst_PROGRAMS): Add greek.
* modules/gcide/ent.c: Fix a typo.
* modules/gcide/gcide.c (output_def): Convert markup to plain text.
* modules/gcide/gcide.h (gcide_grk_to_utf8): New proto.
* modules/gcide/grk.c: New file.
* modules/gcide/greek.c: New file.
* modules/gcide/markup.l: Preserve ["*'] in <grk> tags.
Implement GCIDE markup parser.
* lib/list.c (dico_list_pop): Return NULL if the list is empty.
* modules/gcide/Makefile.am (libgcide_la_SOURCES): Add markup.l
* modules/gcide/degcide.c: New file.
* modules/gcide/markup.l: New file.
* modules/gcide/gcide.h: Include dico.h
(gcide_content_type): New enum.
(gcide_tag,gcide_parse_tree): New structs.
(gcide_markup_debug): New extern.
(gcide_markup_parse,gcide_parse_tree_free)
(gcide_parse_tree_inorder): New functions.
2012-01-17 Sergey Poznyakoff <gray@gnu.org.ua>
Allow simple-statement form for load-module.
* dicod/main.c (load_module_cb): Accept simple statement form with
string or list as argument.
* NEWS: Document new usage.
* doc/dico.texi: Likewise.
* tests/dicod.cfin: Use new syntax.
* README: Update.
gcide: handle entities in headwords.
* modules/gcide/ent.c: Bugfixes.
* modules/gcide/idxgcide.l: Handle <../ entities in headwords.
Report unknown entities.
gcide: support alternative headwords.
* modules/gcide/idxgcide.l (endtag): New variable.
(headword): Remove global.
(flush_headwords): Initialize headword.
(BEGIN_HEADWORD): New macro.
<lex rules>: Handle asp and altname tags.
(main): Call flush_headwords unconditionally.
2012-01-16 Sergey Poznyakoff <gray@gnu.org.ua>
Add GCIDE support.
* configure.ac (AC_CONFIG_FILES): Add modules/gcide/Makefile.
* modules/Makefile.am (SUBDIRS): Add gcide.
* modules/gcide/.gitignore: New file.
* modules/gcide/Makefile.am: New file.
* modules/gcide/gcide.c: New file.
* modules/gcide/gcide.h: New file.
* modules/gcide/idx.c: New file.
* modules/gcide/idxgcide.l: New file.
* modules/gcide/webchr.c: New file.
* modules/gcide/ent.c: New file.
* modules/template.c: Bugfixes.
2012-01-14 Sergey Poznyakoff <gray@gnu.org.ua>
Updates.
* THANKS: Update.
* modules/template.c: Add result_headers method.
* modules/template.scm: Likewise.
2012-01-13 Sergey Poznyakoff <gray@gnu.org.ua>
Assorted fixes.
* modules/ldap/ldap.c (_dico_ldap_expand_user): Use wordsplit.
* grecs: Upgrade.
* doc/dico.texi: Update.
2012-01-10 Sergey Poznyakoff <gray@gnu.org.ua>
Minor change.
* dicod/main.c (config_parse): Exit if grecs_error_count is gt 0.
Minor change
Raise version number to 2.1.90; Other housekeeping.
* NEWS: Raise version number.
* configure.ac: Likewise.
* doc/Makefile.am (check-options): Fix second regexp.
* doc/dico.texi: Use @WRITEME to mark empty nodes.
* doc/rendition.texi: Delete (complements 50c7e46c).
Use wordsplit instead of dico_argcv.
* dico/autologin.c (parse_autologin): Rewrite using wordsplit.
* dico/dico-priv.h: Include wordsplit.h
* dicod/dicod.h: Likewise.
* dico/saslauth.c (get_implemented_mechs): Use wordsplit.
* dico/shell.c (_command_completion): Likewise.
* dicod/gsasl.c (register_sasl): Likewise.
* dicod/loader.c (dicod_load_module): Likewise.
* dicod/main.c (set_dict_handler): Likewise.
* modules/guile/guile.c (guile_load): Likewise.
* modules/ldap/ldap.c (db_open): Likewise.
* modules/guile/Makefile.am (INCLUDES): Add @GRECS_INCLUDES@
* modules/ldap/Makefile.am: Likewise.
* modules/outline/Makefile.am: Likewise.
* modules/outline/outline.c (outline_lang): Likewise.
Incorporate Grecs into libdico.
* grecs: Update.
* configure.ac (GRECS_SETUP): Use the "shared" option.
* lib/Makefile.am (libdico_la_LIBADD): Incorporate libgrecs
* dico/Makefile.am (LDADD): Remove @GRECS_LDADD@.
* dicod/Makefile.am: Likewise.
Minor changes.
* grecs: Update.
* po/POTFILES.in: Update.
Install pp-setup from Grecs.
* configure.ac (GRECS_SETUP): Use std-pp-setup option.
* dicod/Makefile.am: Remove pp-setup.
* dicod/pp-setup: Remove.
2012-01-09 Sergey Poznyakoff <gray@gnu.org.ua>
Use Grecs instead of the built-in configuration parser.
Grecs is a convenience library for parsing sructured configuration files.
It derived from the dicod and wydawca parsers in 2009. It has already
reached stable status and is now used by quite a few other projects.
* .gitmodules: Add Grecs
* Makefile.am: Likewise.
* configure.ac: Likewise.
* dico/Makefile.am (LDADD,INCLUDES): Add Grecs.
* dico/cmdline.opt (OPTIONS_BEGIN): Rewrite.
* dicod/Makefile.am (dicod_SOURCES): Remove pp.c, config-format.c,
config-gram.y and config-lex.l. Add lint.c
* dicod/acl.c: Use Grecs.
* dicod/alias.c (alias)<kw>: Remove const.
<locus>: Change type.
(alias_install): Allocate kw.
* dicod/cmdline.opt (OPTIONS_BEGIN): Rewrite.
* dicod/config-format.c: Remove.
* dicod/config-gram.y: Remove.
* dicod/config-lex.l: Remove.
* dicod/lint.c: New file.
* dicod/dicod.h: Remove configuration parser types and definitions.
* dicod/gsasl.c (cmp_names): List contains now pointers to strings.
* dicod/loader.c (_add_load_dir): Likewise.
* dicod/main.c: Rewrite configuration parser using Grecs.
* dicod/server.c (open_sockets): Operate on grecs_sockaddr structs.
* gnulib.modules (gitlog-to-changelog): Remove.
* include/appi18n.h: Redefine _ and N_ only if necessary.
* utils/Makefile.am (EXTRA_DIST): Remove getopt.m4
* utils/getopt.m4: Remove.
* README-hacking: Update.
Implement "word" matching strategy.
* configure.ac: Build modules/word/Makefile.
* modules/Makefile.am (SUBDIRS): Add word.
* modules/word/Makefile.am: New file.
* modules/word/word.c: New file.
* doc/dico.texi: Document new module.
Move UTF-8 tokenizer to libdico.
* lib/tokenize.c: Rewrite.
* lib/xtkn.c: New file.
* lib/Makefile.am (libdico_la_SOURCES): Add tokenize.c
(libxdico_a_SOURCES): Remove tokenize.c, add xtkn.c.
* include/dico.h: Include dico/tokenize.h
* include/dico/tokenize.h: New file.
* include/dico/Makefile.am (pkginclude_HEADERS): Add tokenize.h
* include/xdico.h: Remove xdico tokenizer interface.
(xdico_tokenize_string): New proto.
* dico/connect.c (_result_parse_def): Use new tokenizer.
* dico/shell.c (parse_script_file): Likewise.
* dicod/dicod.c (dicod_loop): Likewise.
* dicod/config-lex.l (unescape_to_obstack): Use dico_unquote_char.
Happy GNU Year
2011-10-08 Sergey Poznyakoff <gray@gnu.org.ua>
Use Imprimatur to check the docs.
* .gitmodules: Add imprimatur.
* Makefile.am (ACLOCAL_AMFLAGS,SUBDIRS): Add imprimatur.
* configure.ac: Call IMPRIMATUR_INIT.
* doc/Makefile.am: Use imprimatur. Drop files that are
no longer necessary.
* doc/check-docs.sh: Delete.
* doc/mastermenu.el: Delete.
* doc/untabify.el: Delete
* doc/dico.texi: Fix sentence spacing, use @: where appropriate.
* doc/strftime.texi: Likewise.
2011-02-15 Sergey Poznyakoff <gray@gnu.org.ua>
Bugfixes.
* configure.ac (AC_CHECK_HEADERS): Check for sys/socket.h and socket.h.
* dicod/Makefile.am: Add $(AM_V_GEN) where needed.
* tests/Makefile.am: Likewise.
* dicod/main.c (main): Flush capabilities after loading all modules and
configuring authentication database. Take care not to switch to syslog
if --lint was given.
2010-11-13 Sergey Poznyakoff <gray@gnu.org.ua>
Minor changes.
New strategy: pcre (perl-compatible regex).
* am/lib.m4: New file
* configure.ac: Check for libpcre.
* modules/pcre/Makefile.am: New file.
* modules/pcre/pcre.c: New file.
* modules/Makefile.am [PCRE_COND] (PCRE_DIR): Initialize to pcre.
(SUBDIRS): Add $(PCRE_DIR).
2010-11-13 Wojciech Polak <polak@gnu.org>
Switch to Django's cache framework (from direct Memcached).
* dicoweb/dicoclient/dicoclient.py: Minor code changes.
* dicoweb/dicoclient/dicoshell.py: Likewise.
* dicoweb/settings-sample.py: Add sample CACHE_BACKEND.
* dicoweb/views.py: Use Django's cache framework.
2010-11-13 Sergey Poznyakoff <gray@gnu.org.ua>
Minor fix.
* dicod/regex.c (basic_flags): Remove REG_EXTENDED.
2010-08-19 Sergey Poznyakoff <gray@gnu.org.ua>
Partially revert commit c4db582a8c.
As reported by Ahmed, it actually broke the previous solution.
See http://mail.gnu.org.ua/mailman/listarchive/bug-dico/last/msg00000.html,
for details.
2010-08-01 Wojciech Polak <polak@gnu.org>
Add "robots" meta value depending on the context.
* dicoweb/templates/base.html: Add page.robots.
* dicoweb/views.py: Set "robots" value.
2010-07-10 Wojciech Polak <polak@gnu.org>
Minor changes in mediawiki.py.
2010-07-10 Sergey Poznyakoff <gray@gnu.org.ua>
Minor fix.
* app/python/mediawiki.py: Enforce utf-8 encoding.
2010-07-07 Sergey Poznyakoff <gray@gnu.org.ua>
Version 2.1
* NEWS, README, THANKS: Update.
* configure.ac: Raise version number.
* lib/Makefile.am (libdico_la_LDFLAGS): Update.
Minor change
* modules/python/python.c: Fix indentation.
Improve mediawiki matching.
* app/python/mediawiki.py (match_word): Use strat selector,
if it is available. Return sorted results. Make sure the
[0] of the result is 'match' (to avoid misinterpreting
eventual match results for the word 'define').
Minor changes
* NEWS: Update.
* modules/template.scm (match-word): Fix definition.
* po/POTFILES.in: Add new files.
* tests/Makefile.am (EXTRA_DIST): Add example.py
2010-07-02 Sergey Poznyakoff <gray@gnu.org.ua>
Version 2.0.92
* configure.ac, NEWS: Version 2.0.92
* doc/dico.texi: Document LDAP.
* dicod/main.c: Minor fix.
Fix typos in debugging messages.
Use encrypted passwords for authentication, if the underlying GSASL mechanism allows that.
* configure.ac: Cjeck for crypt.h and -lcrypt.
* dicod/ckpass.c: New file.
* dicod/Makefile.am (dicod_SOURCES): Add ckpass.c
* dicod/dicod.h (dicod_check_password): New proto.
* dicod/gsasl.c (cb_validate): Use dicod_check_password
instead of comparing plaintext passwords.
* dicod/ident.c (decode64_buf): Remove.
(ident_decrypt): Use dico_base64_decode.
* dicod/main.c (user_db_config): Don't attempt to
open uninitialized database.
* gnulib.modules: Add crypto/sha1
* include/dico/filter.h (dico_base64_decode)
(dico_base64_encode, dico_base64_input): Change signature.
(dico_qp_decode, dico_qp_encode): Remove.
* lib/base64.c (dico_base64_input): Rewrite.
(dico_base64_decode): Rename to static _flt_base64_decode.
(dico_base64_encode): Rename to static _flt_base64_encode.
(dico_base64_decode,dico_base64_encode): New functions.
* lib/qp.c (dico_qp_decode, dico_qp_encode): Static.
2010-07-01 Sergey Poznyakoff <gray@gnu.org.ua>
Bugfix
* modules/ldap/ldap.c (db_get_groups): Fix typo.
Implement LDAP user database.
* configure.ac: Check for openldap.
* dicod/Makefile.am (dicod_SOURCES): Remove udb.c
* dicod/udb.c: Move to lib (with changes).
* dicod/auth.c: Update calls to dico_udb_ * functions.
* dicod/gsasl.c: Likewise.
* dicod/dbtext.c (dbtext_open): Add 3rd parameter.
(text_udb_def): Change type.
* dicod/dicod.h (udb_def): Remove struct.
(dicod_user_db_t)
(user_db, udb_init, udb_create, udb_open)
(udb_close, udb_get_password, udb_get_groups)
(udp_define): Remove. See dico/udb.h
* dicod/loader.c (dicod_load_module): Minor fix.
* dicod/main.c (user_db): Change data type.
(kwd_user_db): New keyword "options".
(user_db_config): Do not create user database at
once, wait untill the modules have been loaded.
(init_user_db): New function.
(main): Call init_user_db.
* dicod/ostream.c (ostream_write): Remove unused
variable.
* include/dico.h: Include udb.h
* include/dico/Makefile.am (pkginclude_HEADERS): Add udb.h
* lib/Makefile.am (libdico_la_SOURCES): Add udb.c.
* modules/Makefile.am [LDAP_COND] (LDAP_DIR): New variable.
(SUBDIRS): Add LDAP_DIR
* modules/ldap/ldap.c: New file.
* modules/ldap/Makefile.am: New file.
2010-06-30 Sergey Poznyakoff <gray@gnu.org.ua>
Allow the use of an external strategy as the default one.
* dicod/main.c (default_strategy_name): New variable.
(set_defstrat): Remove.
(keywords): Change handling of the default-strategy statement.
(main): Set default strategy after all modules have been loaded,
to allow for using external strategies.
2010-06-29 Sergey Poznyakoff <gray@gnu.org.ua>
Update docs.
2010-06-28 Sergey Poznyakoff <gray@gnu.org.ua>
Minor fix.
* am/gsasl.m4: Use AC_CACHE_VAL instead of AC_CACHE_CHECK.
2010-06-27 Sergey Poznyakoff <gray@gnu.org.ua>
* configure.ac: Distribute bz2 and xz tarballs.
Improve the previous commit.
* include/dico/strat.h (dico_key): New struct.
(dico_key_deinit, dico_key_init)
(dico_key_match): New proto.
* include/dico/types.h (dico_select_key): Moved to
strat.h as dico_key, with edits.
(dico_select_t): Change signature.
* lib/key.c: New file.
* lib/Makefile.am (libdico_la_SOURCES): Add key.c
* modules/dict.org/dictorg.c: Reflect recent changes.
Use dico_key_* functions.
* modules/guile/guile.c: Likewise.
(dico-key?, dico-key->word, dico-make-key): New functions.
* modules/outline/outline.c: Reflect recent changes.
Use dico_key_* functions.
* modules/python/python.c: Reflect recent changes.
Use dico_key_* functions.
* dicod/dicod.c (soundex_sel): Reflect recent changes.
* dicod/lev.c (lev_sel): Likewise.
* dicod/regex.c (regex_sel): Likewise.
* modules/stratall/stratall.c: Likewise.
* modules/substr/substr.c: Likewise.
* app/python/mediawiki.py (match_word): Likewise.
* tests/example.scm: Likewise.
* tests/dicod.cfin: Load stratall and substr.
Change strategy selector calling convention.
Strategy selectors often need to keep selection specific data, i.e.
such data that remain in effect (although not necessarily invariant)
between DICO_SELECT_BEGIN and DICO_SELECT_END calls. These data do
not belong to the strategy itself, therefore it is necessary to introduce
a specific data type for them.
An example of a strategy that uses this approach is regexp, which needs to
store the compiled expression somewhere.
* dicod/dicod.c (soundex_sel): Change signature. Use
key->call_data to keep call-specific data.
* dicod/lev.c (lev_sel): Likewise.
* dicod/regex.c (regex_sel): Likewise.
* include/dico/types.h (dico_select_key): New struct.
(dico_select_t): Change signature. Take struct dico_select_key *
as 2nd arg.
* modules/dict.org/dictorg.c (_match_all): Rewrite to use new
calling sequence.
* modules/guile/guile.c (_guile_select_key_tag): New tag.
(dico_scm_from_select_key): New function.
(_guile_select_key_free, _guile_select_key_print): New methods.
(_guile_init_select_key): New function.
(dico-select-key?, dico-select-key-word): New functions.
(dico-strat-select?): Key is either a string or a selection key.
(_guile_selector): Rewrite to use new calling sequence.
(mod_match): Likewise.
* modules/outline/outline.c (outline_match_all): Rewrite to use new
calling sequence.
* modules/python/python.c (PySelectionKey): New object.
(strat_select_method): Rewrite to use new
calling sequence.
(_python_selector): Likewise.
(mod_match): Likewise.
* modules/stratall/stratall.c (all_sel): Rewrite to use new
calling sequence.
* modules/substr/substr.c (substr_sel): Likewise.
* tests/example.py (match_word): 3rd arg is a selection key.
* tests/example.scm (match-selector): 3rd arg is a selection key.
(match-word): Update.
Move Guile support to gint.
* am/guile.m4: Remove
* gint: New module.
* bootstrap.conf: Unconditionally call git submodules.
* Makefile.am: Use gint.
* configure.ac: Likewise.
* modules/guile/Makefile.am: Likewise.
* modules/guile/guile.c: Use SCM_DEFINE_PUBLIC everywhere.
(_guile_init_funcs): Include guile.x instead of declaring the
stuff manually.
(all functions): Use lowercase parameter names. Refer to them
in docstrings using @var.
* modules/guile/.gitignore: New file.
Bugfixes.
* include/dico/utf8.h (utf8_wc_strchr)
(utf8_wc_strchr_ci, utf8_wc_strstr): Fix return types.
* lib/utf8.c: Likewise.
Improve conditional module builds.
* configure.ac (GUILE_COND,PYTHON_COND): New conditionals.
(BUILD_DICO_GUILE_MODULES)
(BUILD_DICO_PYTHON_MODULES): Remove.
* modules/Makefile.am [GUILE_COND]: Define GUILE_DIR.
[PYTHON_COND]: Define PYTHON_DIR.
(SUBDIRS): add $(GUILE_DIR) and $(PYTHON_DIR) instead
of the literal dirs.
* modules/guile/Makefile.am: Define mod_LTLIBRARIES unconditionally.
* modules/python/Makefile.am: Likewise.
Implement `substr' strategy. Re-implement the `all' strategy as a module.
* configure.ac: Version 2.0.91
(AC_CONFIG_FILES): Add Makefiles in modules/stratall/
and modules/substr.
* NEWS: Version 2.0.91
* dicod/dicod.c: Remove the built-in `all' strategy.
* dicod/loader.c (dicod_load_module0): If DICO_CAPA_NODB
capability is set, the module must have only the dico_init
method.
(dicod_init_database): Prohibit the use of DICO_CAPA_NODB
modules.
* include/dico/types.h (DICO_CAPA_NODB): New capability.
* include/dico/utf8.h (utf8_wc_strchr, utf8_wc_strchr_ci)
(utf8_wc_strstr, utf8_wc_strupper)
(utf8_wc_strlower): New prototypes.
* lib/utf8.c (utf8_wc_strchr, utf8_wc_strchr_ci)
(utf8_wc_strstr, utf8_wc_strupper)
(utf8_wc_strlower): New functions.
* modules/Makefile.am (SUBDIRS): Add stratall and substr.
* modules/stratall/Makefile.am: New file.
* modules/stratall/stratall.c: New file.
* modules/substr/Makefile.am: New file.
* modules/substr/substr.c: New file.
* tests/dicod.cfin: Use prepend-load-path.
Bugfixes.
* modules/guile/guile.c (scm_dico_strat_select_p): Swap
key and word arguments in a call to sel.
* modules/python/python.c (strat_select_method): Likewise.
* tests/example.scm: Use srfi-1.
Use filter-map instead of mapcan.
(match-selector): : Swap key and word arguments in a call to
dico-strat-select?
2010-06-26 Sergey Poznyakoff <gray@gnu.org.ua>
New configuration statement "prepend-load-path".
* dicod/dicod.h (prepend_load_path): New extern.
* dicod/loader.c (dicod_loader_init): Add prepend_load_path
before DICO_MODDIR.
* dicod/main.c (prepend_load_path): New variable.
(keywords)<prepend-load-path>: New keyword.
* NEWS, doc/dico.texi: Update.
Fix counting output octets in dicod.
* include/dico/stream.h (DICO_IOCTL_BYTES_IN)
(DICO_IOCTL_BYTES_OUT): New ioctls.
* lib/stream.c (dico_stream_bytes_in)
(dico_stream_bytes_out): First try ioctl. If it
fails, return bytes_in (bytes_out).
* lib/fltstream.c (filter_flush): Reset level to 0.
(filter_ioctl): New function.
(filter_stream_create): Set ioctl method.
* lib/gsaslstr.c (_gsasl_ioctl): New function.
(dico_gsasl_stream): Set ioctl method.
* lib/xscript.c (transcript_ioctl): Handle
DICO_IOCTL_BYTES_IN and DICO_IOCTL_BYTES_OUT.
* dicod/loader.c (dicod_match_word_db)
(dicod_match_word_all, print_definitions): Update total_bytes_out.
* dicod/ostream.c (ostream)<nout>: New member.
(ostream_write): Don't modify total_bytes_out.
(ostream_ioctl): New function.
(dicod_ostream_create): Initialize nout to the number of octets
output so far by the transport stream.
Set ioctl method.
2010-06-25 Sergey Poznyakoff <gray@gnu.org.ua>
Bugfixes.
* dicod/loader.c (dicod_load_module0): Save handle.
* lib/stream.c (dico_stream_seek, dico_stream_read)
(dico_stream_write): Return immediately if the stream
is in permanent error state.
* lib/xscript.c (transcript_close): Close both underlying
streams.
2010-05-24 Sergey Poznyakoff <gray@gnu.org.ua>
Speed up output procedure in dictorg.
Provide a general-purpose mechanism to address iterators by item
number in O(|n-pos|) time.
* include/dico/list.h (dico_iterator_prev)
(dico_iterator_item, dico_iterator_position): New prototypes.
* lib/list.c (list_entry) <prev>: New member.
(iterator) <pos>: New member.
(dico_iterator_position): New function.
(_iterator_increase_pos): New static.
(dico_iterator_first): Initialize pos to 0.
(dico_iterator_next): Increase pos.
(dico_iterator_prev,dico_iterator_item): New function.
(_dico_list_append): Initialize ep->prev.
(_dico_list_prepend): Initialize ep->prev. Call
_iterator_increase_pos to tell iterators to update their recorded positions.
(_dico_list_remove): Rewrite removal code using next & prev pointers.
(_dico_list_insert_sorted): Update next & prev pointers.
Call _iterator_increase_pos.
* modules/dict.org/dictorg.h (result) <itr>: New member.
* modules/dict.org/dictorg.c (common_match)
(suffix_match, _match_all): Initialize itr.
(mod_output_result): Use iterator to avoid rescanning the list
on each call.
(mod_free_result): Destroy the iterator.
* lib/utf8.c (utf8_strcasecmp, utf8_strncasecmp): Break the loop if
alen or blen is zero. This means that one of the operands is not
utf8, but try to return meaningful value anyway.
2010-05-23 Sergey Poznyakoff <gray@gnu.org.ua>
Housekeeping work.
* NEWS: Document new features and bugfixes.
* dico/.gitignore, tests/.gitignore: Update.
2010-05-23 Wojciech Polak <polak@gnu.org>
Improve Dicoweb.
* dicoweb/dicoclient/dicoclient.py (define): Allow for empty
descriptions in response.
* dicoweb/static/opensearch.xml: Move to templates and make it dynamic.
* dicoweb/views.py (opensearch): Add view.
2010-05-23 Sergey Poznyakoff <gray@gnu.org.ua>
Filter out duplicate matches.
* include/dico/list.h (DICO_LIST_COMPARE_HEAD)
(DICO_LIST_COMPARE_TAIL): New define.
(dico_list_set_flags)
(dico_list_get_flags): New proto.
* lib/list.c (dico_list)<flags>: New member.
(dico_list_create): Initialize flags.
(dico_list_set_flags)
(dico_list_get_flags): New functions.
(_dico_list_append,_dico_list_prepend): New auxiliary
functions.
(dico_list_append,dico_list_prepend): Rewrite. Use
flags to define whether to compare the data with
the tail (head). Set errno to EEXIST and return 1
if attempting to add a duplicate entry.
(_dico_list_insert_sorted): Use _dico_list_append and
_dico_list_prepend instead of their public counterparts.
* modules/dict.org/dictorg.c (common_match): Take additional
argument that defines whether duplicate entries should be
filtered out. All callers updated.
(suffix_match,_match_all): Filter out duplicates.
(mod_define): Call common with unique=0.
2010-05-23 Wojciech Polak <polak@gnu.org>
Minor Dicoweb changes.
* dicoweb/settings.py: Rename to settings-sample.py
* dicoweb/static/dicoweb.js: Bugfix.
* dicoweb/static/dicoweb.css: Minor changes.
* dicoweb/templates/base.html: Likewise.
* dicoweb/templates/index.html: Likewise.
2010-05-23 Sergey Poznyakoff <gray@gnu.org.ua>
Minor fixes.
* configure.ac: Version 2.0.90
Call gl_INIT before checking for data types.
Check for socklen_t.
* NEWS: Version 2.0.90
* dico/connect.c (dict_auth): Return 1 if everything else
fails.
* dico/dico-priv.h (print_version, print_version_only): New protos.
* dicod/dicod.h (server_addrlen, client_addrlen): Change type to
socklen_t.
* dicod/server.c (dicod_server): Change type of addrlen to
socklen_t.
* include/dico/utf8.h (utf8_char_width, utf8_iter_first)
(utf8_wctomb, utf8_symcmp, utf8_symcasecmp, utf8_strcasecmp)
(utf8_strncasecmp): Use (unqualified) char in argument lists.
All uses updated.
* lib/utf8.c: Likewise.
* dico/lookup.c: Silence gcc warnings about diff in signedness.
* dicod/ident.c: Likewise.
* lib/tokenize.c: Likewise.
* lib/xstream.c: Likewise.
* modules/dict.org/dictorg.c: Likewise.
* modules/dict.org/dictstr.c: Likewise.
* modules/outline/outline.c: Likewise.
* modules/guile/guile.c: Remove unused functions and variables.
* utils/getopt.m4 (print_help): Avoid gcc warning about condition
always true.
Fix indentation in lib/utf8.c
Avoid using fixed-size buffer in dictorg.c.
Fixes bug reported by Marc Dequènes (debian #582708).
* modules/dict.org/dictorg.c (read_index): Use dico stream instead
of FILE to avoid using fixed-size buffer.
Fix improper handling of conversion errors in levenshtein.c (debian #582692)
* include/dico/utf8.h (utf8_mbstr_to_wc)
(utf8_mbstr_to_norm_wc): Change signature.
* lib/utf8.c (utf8_mbstr_to_wc)
(utf8_mbstr_to_norm_wc): Take additional return argument.
Return error code. All callers updated.
* lib/levenshtein.c (dico_levenshtein_distance): conv
returns non-zero (not necessarily negative) value on errors.
Minor fixes.
* include/dico/strat.h (dico_get_default_strategy): Remove const
from return type.
* lib/strat.c (dico_get_default_strategy): Likewise.
* lib/fdstream.c (fd_seek): Fix error condition.
* lib/fltstream.c (filter_write): Return error code.
* lib/stream.c (dico_stream_read_unbuffered): Initialize rc.
2010-05-01 Sergey Poznyakoff <gray@gnu.org.ua>
Bugfixes.
* dicod/main.c: Fix recursive invocation.
* dicod/pp.c (preprocess_config): Terminate debugging message with a \n.
2010-04-07 Wojciech Polak <polak@gnu.org>
Minor fix.
* dicoweb/views.py: Fix the list of accepted languages.
2010-03-29 Sergey Poznyakoff <gray@gnu.org.ua>
Minor fix.
* doc/dico.texi: Fix typos and improper uses of @pxref.
2010-03-26 Sergey Poznyakoff <gray@gnu.org.ua>
Normalize exit codes.
* gnulib.modules: Add sysexits
* lib/xalloc-die.c: Exit with code EX_OSERR.
* utils/getopt.m4 (GETOPT): Provide optional `opterr' argument.
* dicod/cmdline.opt (get_options): Exit with EX_USAGE in
case of unhandled option.
* dicod/config-lex.l: Move includes to the '%top' block.
Define YY_EXIT_FAILURE.
* dicod/dicod.c (sig_alarm): Exit with EXIT_TIMEOUT.
* dicod/dicod.h: Include sysexits.h.
* dicod/main.c (main): Normalize exit codes.
* dicod/pp.c: Likewise.
* dicod/server.c: Normalize exit codes.
(print_status): Handle 'time out' exit code separately.
Print informational message.
* doc/dico.texi (Exit Codes): New section.
* NEWS: Update.
2010-03-14 Sergey Poznyakoff <gray@gnu.org.ua>
Do not use deprecated/internal Guile features.
* am/guile.m4 (MU_CHECK_GUILE): Remove leftovers
from pre-1.8 times.
Check for SCM_DEVAL_P, SCM_BACKTRACE_P,
SCM_RECORD_POSITIONS_P and SCM_RESET_DEBUG_MODE,
define GUILE_DEBUG_MACROS if all these are available.
Check for scm_t_off (Guile 1.9)
* modules/guile/guile.c (apply_data): New struct.
(apply_catch_body): New function.
(eval_catch_body): Remove.
(guile_call_proc): Use apply_catch_body as body.
![HAVE_SCM_T_OFF]: Define scm_t_off.
(_make_dico_port): Rewrite using scm_new_port_table_entry.
(_dico_port_seek): Change prototype. Second arg is scm_t_off.
(mod_init)[GUILE_DEBUG_MACROS]: Protect the use of
SCM_DEVAL_P and friends.
(all functions): Use scm_from_locale_string instead
of the deprecated scm_makfrom0str.
2010-03-09 Sergey Poznyakoff <gray@gnu.org.ua>
Keep namespace clean.
* modules/dict.org/crc.h: Prefix all function
names with `dicod_' to avoid name clashes.
2010-01-02 Sergey Poznyakoff <gray@gnu.org.ua>
Update copyright years.
Happy GNU Year!
2009-11-05 Wojciech Polak <polak@gnu.org>
Improve mediawiki.py
* app/python/mediawiki.py: Drop ns_mediawiki usage.
2009-10-29 Sergey Poznyakoff <gray@gnu.org.ua>
Fix doc/Commit
* doc/Commit (gray_print_section): Output anchors before
chapter/section/etc. titles, so that the heading menu in
monolithic document works properly.
2009-10-23 Sergey Poznyakoff <gray@gnu.org.ua>
Documentation fixes.
* Config: New file.
* doc/Makefile.am: Make manual a phony target.
Add man-tar rule.
* doc/dico.texi: Minor changes to improve html
output.
* doc/gendocs_template: Rewrite for the new site
design.
2009-10-18 Wojciech Polak <polak@gnu.org>
Simplify dicoweb.wsgi.
2009-10-16 Wojciech Polak <polak@gnu.org>
Simplify dicoweb settings.
* dicoweb/settings.py: Automatically determine paths.
2009-10-14 Sergey Poznyakoff <gray@gnu.org.ua>
Fix ACL code.
* dicod/acl.c (_parse_sockaddr): Fix netmask calculation.
(_check_sockaddr): Fix comparison for AF_INET.
2009-09-27 Sergey Poznyakoff <gray@gnu.org.ua>
Minor changes
* Makefile.am: Update ChangeLog rule
* configure.ac: Require autoconf 2.63, automake 1.11.
Enable silent rules.
* dico/connect.c (dict_match): Properly handle successful return
from XLEV command.
2009-03-29 Sergey Poznyakoff <gray@gnu.org.ua>
Version 2.0
* configure.ac: Version 2.0
* Makefile.am (make-ChangeLog): Remove rule
* NEWS, README: Update.
* doc/dico.texi: Update.
2009-03-28 Sergey Poznyakoff <gray@gnu.org.ua>
Minor fix
2009-03-14 Sergey Poznyakoff <gray@gnu.org.ua>
Minor fixes
2009-03-09 Sergey Poznyakoff <gray@gnu.org.ua>
Use git:// url for wit
Various organizational changes
* bootstrap.conf: Init and update wit submodule.
* configure.ac: Version 1.99.97
(AC_INIT): Spell full name as 'GNU dico' (lowercase), in order to help
the `po' machinery recognize the project as official GNU one
(po/Makefile.in.in uses a primitive `grep 'GNU @PROJECT@' ../*', so
actually any file containing this string would do).
* NEWS: Update.
* Makefile.am (SUBDIRS): Remove makedict. It is not yet needed.
(EXTRA_DIST): Add app and dicoweb.
* po/POTFILES.in: Remove makedict.
* dicod/acl.c: Provide a translators comment.
* modules/dict.org/dictorg.c: Fix typo.
2009-03-08 Wojciech Polak <polak@gnu.org>
Add mediawiki.py -- a Python module for a remote access to Wikipedia.
Add Dicoweb -- a web search interface.
2009-01-13 Sergey Poznyakoff <gray@gnu.org.ua>
Change documentation license to GFDLv1.3+
2008-12-20 Sergey Poznyakoff <gray@gnu.org.ua>
Minor fix.
* dico/cmdline.opt: Fix --sasl and --nosasl definitions.
Remove --strats alias. Use --strat(egies) instead.
2008-12-19 Sergey Poznyakoff <gray@gnu.org.ua>
Fix qp
Base64 fix.
* lib/base64.c (dico_base64_encode): Fix calculation of the number of
consumed bytes.
Fix filter encoding.
* include/dico/filter.h (filter_xcode_t): Remove last two parameters.
Filter stream is now responsible for keeping track of line widths.
(dico_base64_decode,dico_base64_encode)
(dico_qp_decode,dico_qp_encode): Update.
* lib/base64.c (dico_base64_decode): Remove line_max and pline_len.
(dico_base64_encode): Likewise.
(dico_base64_stream_create): Set minimal input length to 3.
It is valid for encoding. Decoding remains a fixme.
* lib/qp.c (dico_qp_decode, dico_qp_encode): Remove last two parameters.
* lib/fltstream.c (struct filter_stream): New members inbuf and inlevel.
(filter_flush): New function. Keep track of line lengths.
(filter_write0): New function.
(filter_write,filter_wr_flush): Rewrite using filter_flush.
(filter_stream_destroy): New method.
(filter_stream_create): Initialize inbuf and inlevel.
* dicod/ident.c: Update call to dico_base64_decode.
2008-12-18 Wojciech Polak <polak@gnu.org>
Implement dico_result_headers in Python module.
* modules/python/python.c (_assoc_to_dict, _dict_to_assoc,
mod_result_headers): New functions.
* modules/template.py (result_headers): New optional method.
2008-12-17 Sergey Poznyakoff <gray@gnu.org.ua>
Allow modules to return or modify MIME headers for definition results.
* dicod/loader.c (print_definitions): Use mp->dico_result_headers
to get headers from the module.
(mime_headers_cb): Allow 8bit encoding.
* dicod/ostream.c: Handle 8bit encoding.
* include/dico/assoc.h (dico_assoc_clear, dico_assoc_dup): New prototypes.
* include/dico/list.h (dico_list_clear): New prototype.
* include/dico/types.h (struct dico_database_module): New method
dico_result_headers.
* lib/assoc.c (dico_assoc_clear, dico_assoc_dup): New functions.
(_dico_assoc_find_n): Allow for assoc==NULL.
(dico_assoc_destroy): Likewise.
* lib/header.c (dico_header_parse): Allow for text==NULL.
* lib/list.c (dico_list_clear): New function.
(dico_list_destroy): Use dico_list_clear.
(dico_iterator_remove_current): Bugfix: use default comparator.
* modules/guile/guile.c: Implement dico_result_headers.
* tests/example.scm: Likewise.
2008-12-16 Sergey Poznyakoff <gray@gnu.org.ua>
Rewamp list and assoc support. Keep MIME headers in an assoc list.
* include/dico/assoc.h (struct dico_assoc): Key is const
(DICO_ASSOC_CI, DICO_ASSOC_MULT): New defines.
(dico_assoc_append,dico_assoc_find_n): New functions.
(dico_assoc_iterator, dico_assoc_remove_n): New functions.
(dico_header_parse): New function.
* include/dico/list.h (dico_list_destroy): Change signature.
(dico_list_set_free_item)
(dico_list_set_comparator,dico_list_get_comparator): New functions.
(dico_list_insert_sorted): Change signature.
(dico_list_locate,dico_list_remove): Change signature.
(_dico_list_locate): New function.
(dico_iterator_create): Rename to dico_list_iterator
(dico_iterator_remove_current): Change signature and return type.
* dico/strat.h (dico_strat_name_cmp): Change signature.
(dico_strat_free): New proto.
* dico/types.h (dico_assoc_list_t): New type.
* include/xdico.h (xdico_assoc_append, xdico_assoc_add): New protos.
* lib/header.c: New file.
* lib/Makefile.am (libdico_la_SOURCES): Add header.c
* lib/assoc.c: Major rewrite.
* lib/list.c: Associate free_item and compare_item functions with the list.
* dicod/dicod.h (dicod_database_t): Remove content_type and
content_transfer_encoding. Change type of mime_headers to
dico_assoc_list_t.
(CONTENT_TRANSFER_ENCODING_HEADER): New define.
(dicod_ostream_create): Takes two arguments.
* dicod/ostream.c: Rewrite using dico_assoc_list_t for headers.
* dicod/main.c: Update calls to list/assoc functions.
(kwd_load_module): Remove content-type and content-transfer-encoding.
Load mime-headers through a callback, with checking.
* dicod/commands.c: Update calls to dicod_ostream_create.
* dicod/lang.c: Likewise.
* dicod/loader.c: Likewise.
* dico/autologin.c: Update calls to list/assoc functions.
* dico/connect.c: Likewise.
* dico/saslauth.c: Likewise.
* dicod/accesslog.c: Likewise.
* dicod/acl.c: Likewise.
* dicod/alias.c: Likewise.
* dicod/auth.c: Likewise.
* dicod/capa.c: Likewise.
* dicod/config-gram.y: Likewise.
* dicod/dbtext.c: Likewise.
* dicod/dicod.c: Likewise.
* dicod/gsasl.c: Likewise.
* dicod/markup.c: Likewise.
* dicod/pp.c: Likewise.
* dicod/udb.c: Likewise.
* lib/markup.c: Likewise.
* lib/strat.c: Likewise.
* lib/url.c: Likewise.
* lib/userprivs.c: Likewise.
* lib/utf8.c: Likewise.
* modules/dict.org/dictorg.c: Likewise.
* modules/outline/outline.c: Likewise.
2008-11-30 Sergey Poznyakoff <gray@gnu.org.ua>
Fix output in mime mode.
* dicod/config-lex.l: Ignore m4 line statemens appearing within
a here-doc.
* dicod/loader.c (outproc_t): New argument "data"
(dicod_word_first, dicod_word_all): Likewise
(dicod_match_word_db, dicod_match_word_first): Update calls to lower-level
functions.
(dicod_match_word_all): Create a separate output stream.
(print_matches): Do not create ostream for each
database.
2008-11-29 Sergey Poznyakoff <gray@gnu.org.ua>
Allow to pass additional headers for MIME output
* dicod/dicod.h (struct dicod_database): New member mime_headers
(dicod_ostream_create): Change signature
* dicod/main.c (kwd_database): New keyword "mime-headers"
* dicod/ostream.c (struct ostream): New member "headers".
(print_headers): Print ostream->headers, if given.
(dicod_ostream_create): Initialize ostream->headers.
* dicod/commands.c, dicod/lang.c, dicod/loader.c: Update calls to
dicod_ostream_create.
* doc/dico.texi: Minor changes.
2008-11-28 Sergey Poznyakoff <gray@gnu.org.ua>
Bugfix
* dicod/commands.c (dicod_show_server): Avoid passing NULL server_info
to stream_write_multiline
(dicod_status): Add a space before 'No timing data available'
2008-10-31 Sergey Poznyakoff <gray@gnu.org.ua>
Fix precedence of '*' in language statements (both config and module)
Improvements in Python module
* modules/python/python.c (dico_methods): Typecast to shut up a
gcc warning.
(_tuple_to_langlist, mod_lang): Handle lists. Be more strict at
checking. Add more diagnostics.
* tests/example.py (class DicoModule): New member langlist.
New method lang.
* tests/example.text: Add language definitions.
Allow to use * as a synonym to empty list (meaning "all languages")
* dicod/config-lex.l: Add * to symbols allowed in non-quoted strings.
* dicod/dicod.h (dicod_any_lang_list_p): New prototype.
* dicod/loader.c (dicod_any_lang_list_p): New function.
(dicod_get_database_languages): "*" is equvalent to empty list.
* dicod/main.c (fix_lang_list): Likewise.
2008-10-25 Sergey Poznyakoff <gray@gnu.org.ua>
Merge branch 'master' of ssh://git.gnu.org.ua/gitroot/dico
* modules/guile/guile.c (mod_lang): Fix return value
2008-10-24 Wojciech Polak <polak@gnu.org>
Implement dico_db_lang in Python module.
* modules/python/python.c (_tuple_to_langlist, mod_lang): New functions.
* modules/template.py (lang): New optional method.
2008-10-24 Sergey Poznyakoff <gray@gnu.org.ua>
Bugfixes.
* dicod/main.c (fix_lang_list): Disable dico_db_lang if
at least one of language lists is given in the config.
* modules/guile/guile.c (mod_lang): Fix return value.
2008-10-19 Sergey Poznyakoff <gray@gnu.org.ua>
* dicod/config-gram.y: Allow for empty lists.
2008-10-18 Sergey Poznyakoff <gray@gnu.org.ua>
Further improvement of language extensions.
* dicod/dicod.h (DICOD_DBF_LANG): New define.
(struct dicod_database): Replace lang with langlist[2] (languages from -> to).
(dicod_lang_check, dicod_get_database_languages): Change proto.
(dicod_langlist_copy): New proto.
* dicod/lang.c (dicod_lang_preferences): Remove.
(dicod_lang_lazy_prefs, dicod_lang_prefs): New variables.
(dicod_lang_check): Change arguments.
(dicod_lang, dicod_show_lang_pref, dicod_show_lang_info): Implement using
new preference system.
* dicod/loader.c (dicod_langlist_copy): New function.
(dicod_get_database_languages): Change signature.
* dicod/main.c (fix_lang_list): Change signature.
(main): Call fix_lang_list for both langlist parts.
(kwd_database): Replace languages with languages-from/languages-to.
(dicod_database_free): Reflect changes to struct dicod_database.
* include/dico/types.h (struct dico_database_module):
Change arguments and return type of dico_db_lang.
* modules/guile/guile.c: Update
* modules/outline/outline.c: Update
* modules/template.c: Update.
* modules/template.scm: Update.
* tests/example.db: Update.
Implement language extensions.
* dicod/lang.c: New file.
* dicod/Makefile.am: Add lang.c
* dicod/dicod.h (struct dicod_database): New member lang.
(DICOD_MAXPARAM_INF): New define.
(register_lang, dicod_lang_check): New prototypes.
(dicod_get_database_languages): New prototype.
* dicod/loader.c (dicod_get_database_languages): New function.
* dicod/main.c (set_database): Create and fixup language list.
(kwd_database): New keyword 'languages'.
(check_db_visibility): Use dicod_lang_check to determine if the
database is visible.
(dicod_database_free): Free lang list.
(main): Call register_lang.
* dicod/commands.c (dicod_handle_command): Allow maxparam to be
DICOD_MAXPARAM_INF, in which case any number of parameters, greater than
minparam, is allowed.
* dicod/capa.c (dicod_capa_flush): Take a NULL terminated
array of commands to declare.
* dicod/auth.c, dicod/lev.c, dicod/markup.c, dicod/mime.c,
dicod/xidle.c, dicod/xversion.c: Update definitions of cmd to match
changes in dicod/capa.c.
* include/dico/list.h (dico_list_t, dico_iterator_t): Move to types.
* include/dico/types.h (struct dico_database_module): New member dico_db_lang.
* include/xdico.h (dicod_free_item): New prototype.
* lib/xutil.c (dicod_free_item): New function.
* modules/dict.org/dictorg.c (dictorg module): Reserve a slot for dico_db_lang.
* modules/python/python.c (dictorg module): Reserve a slot for dico_db_lang.
* modules/guile/guile.c: Implement dico_db_lang.
Use scm_to_locale_string instead of deprecated scm_i_string_chars.
* outline/outline.c: Implement dico_db_lang.
* modules/template.c: Implement dico_db_lang.
* modules/template.scm: Implement dico_db_lang.
* tests/devils.out: Add Languages section.
* tests/example.db: Add language definition.
* tests/example.scm (db:get): New rule 'lang'
(lang): New function.
(example-init): Init "lang"
2008-10-09 Sergey Poznyakoff <gray@gnu.org.ua>
Allow to override some settings from the command line.
* dicod/cmdline.opt: New options --transcript and --no-transcript.
(get_options): Take three arguments.
* dicod/dicod.h (get_options): Take three arguments.
* dicod/main.c (init_conf_override, apply_conf_override): New functions.
(main): Use conf_override to override some configuration
statements from the command line.
2008-09-30 Sergey Poznyakoff <gray@gnu.org.ua>
Fix UTF-8 handling in SHOW DB output.
* dicod/commands.c (_show_database): Use utf8_quote, not quotearg.
* include/dico/utf8.h (utf8_wc_to_mbstr): Change prototype.
(utf8_quote, utf8_wc_quote): New functions.
* lib/utf8.c (utf8_quote, utf8_wc_quote): New functions.
(utf8_wc_to_mbstr): Change signature.
(utf8_mbstr_to_wc): fix indentation.
* modules/dict.org/dictstr.c (stream_get16, stream_get32): Static.
Reflect available markup types in capability string.
* dicod/dicod.h (markup_flush_capa): New function.
* dicod/main.c (main): Call markup_flush_capa.
* dicod/markup.c (markup_flush_capa): New function.
* lib/markup.c (dico_markup_valid_name_p): New function.
(dico_markup_register): Enforce valid markup names.
* modules/guile/guile.c (dico-register-markup): Reflect changes to
the return value of dico_markup_register.
Minor fixes.
* dicod/config-lex.l: Improve "stray character" diagnostics.
* include/dico/strat.h (struct dico_strategy): Add comments.
2008-09-28 Wojciech Polak <polak@gnu.org>
Changes to Python module.
* modules/python/python.c (dico_register_markup,
dico_current_markup): New functions.
2008-09-28 Sergey Poznyakoff <gray@gnu.org.ua>
Implement html output in examples.
* lib/markup.c (dico_markup_register): Store a copy of the string.
* modules/guile/guile.c (_guile_strategy_create): Remove.
(dico-register-markup, dico-current-markup): New functions.
* tests/example.scm (output): Implement rudimentary html output.
Implement experimental OPTION MARKUP command.
* dicod/markup.c: New file
* dicod/Makefile.am (dicod_SOURCES): Add markup.c
* dicod/dicod.h (register_markup): New function.
* dicod/main.c (main): Call register_markup.
* include/dico/markup.h: New file
* include/dico/Makefile.am (pkginclude_HEADERS): Add markup.h
* include/dico/types.h: Minor formatting changes.
* include/dico.h: Include dico/markup.h
* lib/markup.c: New file
* lib/Makefile.am (libdico_la_SOURCES): Add markup.c
2008-09-24 Wojciech Polak <polak@gnu.org>
Improve stdout capture in Python module.
* modules/python/python.c (_capture_stdout_info): New function.
2008-09-24 Sergey Poznyakoff <gray@gnu.org.ua>
Bugfix
* modules/guile/guile.c (mod_init): Move call to dico_parseopt to after
Guile initialization.
2008-09-23 Sergey Poznyakoff <gray@gnu.org.ua>
Minor fix
Changes to Guile module.
* modules/guile/guile.c (mod_init_db): Accept init-script,
init-args and init-fun options.
* tests/dicod.cfin (numerals): Rename to plnum.
(cznum): New database.
* tests/example.scm (open-module): Reflect changes to guile.c
* tests/example.text: Use Czech numerals, to discern from example.db
* doc/dico.texi: Update.
Various changes.
* NEWS: Update version number.
* README: Mention Python.
* configure.ac: Raise version number to 1.99.96.
Check for python-config.
Define BUILD_DICO_GUILE_MODULES and BUILD_DICO_PYTHON_MODULES,
instead of the corresponding _DIRs.
* doc/dico.texi: Mention Python. Provide a placeholder for a new section.
* doc/libdico.texi (utf8_mbstr_to_norm_wc): New deftypefn
* modules/Makefile.am (SUBDIRS): Unconditionally list guile and python
* modules/guile/Makefile.am: Build if BUILD_DICO_GUILE_MODULES is defined.
(AM_LDFLAGS): Add -rpath to force libtool build a shared library.
* modules/python/Makefile.am: Build if BUILD_DICO_PYTHON_MODULES is defined.
(AM_LDFLAGS): Add -rpath to force libtool build a shared library.
* modules/dict.org/dictorg.c, modules/guile/guile.c,
modules/python/python.c: Mark all functions as static.
* lib/levenshtein.c (dico_levenshtein_distance): Fix Damerau part (again).
* tests/levtest.c: New file.
* tests/Makefile.am (noinst_PROGRAMS): Add levtest.
* tests/example.py: New file. * tests/example.text: New file. * AUTHORS: Add Wojciech.
2008-09-22 Wojciech Polak <polak@gnu.org>
Add Python support.
* configure.ac: Check for Python.
* modules/Makefile.am (SUBDIRS): Add python.
* modules/python/Makefile.am: New file.
* modules/python/python.c: New file. Python module.
* modules/template.py: New file. A Python module template.
2008-09-21 Sergey Poznyakoff <gray@gnu.org.ua>
Update
Minor fix
2008-09-20 Sergey Poznyakoff <gray@gnu.org.ua>
Minor fix.
* dicod/loader.c (dicod_load_module0): Use lt_dlopenadvise and set `global'
advise.
2008-09-19 Sergey Poznyakoff <gray@gnu.org.ua>
Improve dico_parseopt.
* include/dico/parseopt.h (DICO_PARSEOPT_PARSE_ARGV0)
(DICO_PARSEOPT_PERMUTE): New macros.
* lib/parseopt.c (dico_parseopt): Take two additional arguments: flags and
pindex. Return index of the first non-optional argument in *pindex.
Use flags to modify the operation.
* modules/dict.org/dictorg.c: Update calls to dico_parseopt.
* modules/guile/guile.c: Likewise.
* doc/libdico.texi: Update.
2008-09-12 Sergey Poznyakoff <gray@gnu.org.ua>
Bugfix
* dicod/config-lex.l: Make sure stray characters are displayed correctly
in diagnostic messages.
2008-09-10 Sergey Poznyakoff <gray@gnu.org.ua>
Update devdict.out
Update.
* doc/dico.texi: Document the strategy statement.
* tests/devils.out: Minor fix.
2008-09-08 Sergey Poznyakoff <gray@gnu.org.ua>
Bugfix.
* lib/argcv.c (argcv_quoted_length): Set *quote if input string
has zero length.
Bugfix.
* .gitignore: Remove po
* modules/dict.org/dictorg.c (compare_prefix): Do not match strings shorter
than the requested prefix.
(common_match, suffix_match, _match_all): Ignore reserved words, if requested.
2008-09-07 Sergey Poznyakoff <gray@gnu.org.ua>
Fix Damerau-Levenshtein strategy, implement new strategies.
* dicod/lev.c: Implement "normalized" Levenshtein and Damerau-Levenshtein
strategies, i.e. such that assume equality between runs of whitespace
characters, no matter what their length.
* include/dico/utf8.h (DICO_LEV_NORM, DICO_LEV_DAMERAU): New defines.
(utf8_mbstr_to_norm_wc) New function.
* lib/levenshtein.c (dico_levenshtein_distance): Fix Damerau-Levenshtein
algorithm. Change semantics of the 3rd argument.
* lib/utf8.c (utf8_mbstr_to_norm_wc): New function.
2008-09-06 Sergey Poznyakoff <gray@gnu.org.ua>
Bugfix
* lib/strat.c (dico_strategy_create): Fill allocated memory with zeros.
2008-08-31 Sergey Poznyakoff <gray@gnu.org.ua>
Allow to restrict the use of default matches that may cause considerable strain on the server (e.g. MATCH * prefix "").
* NEWS, configure.ac: Version 1.99.95
* dico/func.c (check_disconnect): Remove duplicate condition.
* dicod/Makefile.am (dicod_SOURCES): Add stratcl.c
* dicod/stratcl.c: New file.
* dicod/config-gram.y (string_to_unsigned): Additional argument `locus'.
All callers updated.
* dicod/dicod.c: New exterimental strategy `all'.
* dicod/dicod.h (string_to_unsigned): New proto.
(enum cmp_op): New data type.
(stratcl_add_word, stratcl_add_cmp)
(stratcl_add_disable, stratcl_check_word): New functions.
* dicod/loader.c (dicod_word_first, dicod_word_all): Check if this word is
allowed for searches using this strategy.
* dicod/main.c (flush_strat_forward_fn, destroy_strat_forward_fn)
(flush_strat_forward, strategy_cb, strategy_deny_all_cb)
(strategy_deny_word_cb, strategy_deny_length)
(strategy_deny_length_lt_cb, strategy_deny_length_le_cb)
(strategy_deny_length_gt_cb, strategy_deny_length_ge_cb)
(strategy_deny_length_eq_cb, strategy_deny_length_ne_cb): New functions.
(kwd_strategy): New configuration keywords: deny-all, deny-worddeny-word,
deny-length-lt, deny-length-le, deny-length-gt, deny-length-ge,
deny-length-eq, deny-length-ne.
(keywords): New block statement: strategy
(main): Call flush_strat_forward
* dico/strat.h (struct dico_strategy): New member: stratcl
(dico_strat_name_cmp): New function.
(dico_strategy_create): New function.
* lib/strat.c (strat_name_cmp): Rename to dico_strat_name_cmp. Make global.
(dico_strategy_create): New function.
(dico_strategy_dup): Use dico_strategy_create.
2008-08-11 Sergey Poznyakoff <gray@gnu.org.ua>
Improve security when using anonymous authentication.
* dicod/dicod.h (sasl_anon_groups): New declaration.
* dicod/gsasl.c (sasl_anon_groups): New variable.
(struct sasl_data): New data type.
(sasl_auth): Pass a pointer to struct sasl_data to gsasl callback as a hook.
Make sure group info for anonymous users is not searched in the user database.
Use sasl_anon_groups instead.
(cb_validate, callback): Adopt the change of hook data type.
* dicod/main.c (kwd_sasl): sasl-disable-mechanism and sasl-enable-mechanism
renamed to disable-mechanism and enable-mechanism, respectively.
(anon-group): New statement.
2008-08-10 Sergey Poznyakoff <gray@gnu.org.ua>
Bugfix.
* configure.ac: Call AM_ICONV before AM_GNU_GETTEXT.
2008-08-09 Sergey Poznyakoff <gray@gnu.org.ua>
Version 1.99.94
Bugfix.
* dico/saslauth.c (callback): Handle GSASL_ANONYMOUS_TOKEN.
Bugfixes.
* dicod/dicod.h (sasl_realm): New declaration.
* dico/saslauth.c (callback): Add missing callbacks.
* dicod/gsasl.c (sasl_realm): New variable.
(callback): Add missing callbacks.
* dicod/main.c (kwd_sasl): New keyword `realm'.
Improve SASL configurability.
* dicod/config-gram.y (string_to_bool): Make extern.
* dicod/dicod.h (string_to_bool): New prototype.
(sasl_enable, sasl_enabled_mech, sasl_service): New declarations.
* dicod/gsasl.c (sasl_enable, sasl_enabled_mech, sasl_service): New variables.
(disabled_mechanism_p): A mechanism state is controlled by two lists:
sasl_enabled_mech and sasl_disabled_mech.
(callback): sasl_service keeps service name.
(init_sasl_1): Initialize sasl_service.
(register_sasl): sasl_enable controls whether SASL is enabled.
* dicod/main.c: New configuration file block statement `sasl'.
Remove debugging hooks
Bugfixes in SASL-related code.
* dico/saslauth.c (selectmech): Do not use _free_el to deallocate
elements of impl. This avoids duplicate calls to free.
(sasl_free_data): Do nothing if *pdata is NULL.
* dicod/gsasl.c (callback): Fix coredump.
* lib/xutil.c (xdico_sasl_capa_match_p): Use c_strcasecmp.
Finish implementing GSASL streams.
* include/gsaslstr.h: New file.
* include/Makefile.am: Add gsaslstr.h.
* configure.ac: Require gettext 0.17
Define BUILD_LIBDICOSASL and LIBDICOSASL if SASL is required.
* dico/Makefile.am, dicod/Makefile.am: Link with LIBDICOSASL.
* dico/connect.c, lib/xscript.c: Use new IOCTL codes.
* dico/saslauth.c: Include gsaslstr.h
(do_gsasl_auth): Insert GSASL stream on success.
* dicod/commands.c (dicod_remove_command): New function.
* dicod/dicod.c (replace_io_stream): New function.
(dicod_loop): I/O stream is static variable instead of the automatic, so
that authentication functions can reset it.
* dicod/dicod.h (replace_io_stream, dicod_remove_command): New variables.
* dicod/gsasl.c: Include gsaslstr.h
(sasl_auth): Call gsasl_finish on failure.
(dicod_saslauth): Insert GSASL stream on success.
* include/dico/diag.h (DICO_DBG_CTL_SET_FILE)
(DICO_DBG_CTL_SET_LINE, DICO_DBG_CTL_SET_TS): Remove.
* include/dico/stream.h (DICO_IOCTL_GET_TRANSPORT)
(DICO_IOCTL_SET_TRANSPORT)
(DICO_DBG_CTL_SET_FILE, DICO_DBG_CTL_SET_LINE)
(DICO_DBG_CTL_SET_TS): New defines.
* include/xdico.h (XSCRIPT_CTL_GET_TRANSPORT)
(XSCRIPT_CTL_SET_TRANSPORT): Remove.
* lib/Makefile.am (noinst_LIBRARIES): Add @BUILD_LIBDICOSASL@
* lib/gsaslstr.c (struct g_buf): New member pos.
(g_buf_ptr, g_buf_level, g_buf_drop): Take into account pos.
(g_buf_advance): New macro.
(_gsasl_read): Fix buffering.
(dico_gsasl_stream): Set line buffering.
(insert_gsasl_stream): New function.
* lib/stream.c (dico_stream_read): If the stream is line buffered,
break the reading loop after receiving a newline character.
2008-08-06 Sergey Poznyakoff <gray@gnu.org.ua>
Implement GSASL stream.
* lib/gsaslstr.c: New file.
* lib/Makefile.am (libdico_la_SOURCES): Add gsaslstr.c.
Remove obsolete linebuf code.
* include/dico/lbuf.h, lib/linebuf.c: Remove.
* include/dico/Makefile.am, include/dico.h: Remove lbuf.h
* lib/Makefile.am: Remove linebuf.c
* dicod/dicod.c, dicod/server.c: Remove duplicate calls to dico_stream_set_buffer.
* lib/dbgstream.c: Include sys/time.h
2008-08-04 Sergey Poznyakoff <gray@gnu.org.ua>
Update docs
Improve server debugging.
* dicod/dicod.c (dicod_loop): Log session start and end if debug level is set.
* dicod/dicod.h (debug_level): Remove. Declared in xdico.h.
* dicod/main.c (debug_source_info, debug_stream): New variables.
(main): Initialize debug_stream.
* dicod/pp.c: Use debugging macros.
* dicod/server.c (handle_connection): Remove an outdated fixme comment.
* dicod/cmdline.opt (source-info): New option.
Minor fix.
* dicod/server.c (handle_connection): Move call to query ident_name to ...
* dicod/dicod.c (dicod_loop): ... here
Fix AUTH I/O in dicod.
* dicod/accesslog.c: New directive %d.
* dicod/dicod.h (ident_timeout): New declaration.
* dicod/ident.c: Use non-blocking I/O.
* dicod/main.c (ident_timeout): New global variable.
(keywords): New keyword ident-timeout.
* dicod/udb.c (udb_open): Do not coredump on NULL argument.
* doc/dico.texi: Reflect recent changes.
* THANKS: Reformat for GNU standards.
2008-08-02 Sergey Poznyakoff <gray@gnu.org.ua>
Improve debugging.
* dico/connect.c (dict_read_reply): Remove superfluous call to XDICO_DEBUG.
* dico/dico-priv.h (ds_verbose): New prototype.
* dico/func.c (ds_verbose): New function.
* dico/shell.c (verbose): New command.
(filename): const.
(script_diag, parse_script_file): Minor fix.
Improve debugging.
* lib/dbgstream.c: Include microseconds in timing output.
Merge branch 'master' of ssh://git.gnu.org.ua/gitroot/dico
Improve debugging.
* dico/cmdline.opt: New option --time-stamp.
* include/dico/diag.h (DICO_DBG_CTL_SET_TS): New define.
* lib/dbgstream.c: Optionally print timestamp information.
Add more debugging to the client.
* configure.ac, NEWS: Version 1.99.93
* lib/dbgstream.c: New file.
* lib/Makefile.am (libdico_la_SOURCES): Add dbgstream.c.
* dico/autologin.c, dico/connect.c, dico/dico.c, dico/lookup.c,
dico/saslauth.c,
* include/dico/diag.h (dico_dbg_stream_create): New prototype.
(DICO_DBG_CTL_SET_FILE, DICO_DBG_CTL_SET_LINE): New defines.
(DICO_DEBUG_SINFO): New macro.
* lib/xscript.c (transcript_ioctl): Fix typo.
* include/xdico.h (XSCRIPT_CLT_GET_TRANSPORT)
(XSCRIPT_CLT_SET_TRANSPORT):
(debug_level, debug_source_info, debug_stream): New declarations.
(XDICO_DEBUG)
(XDICO_DEBUG_F1 through XDICO_DEBUG_F4): New macros.
* dico/cmdline.opt: New options --verbose (-v) and --source-info.
2008-07-31 Sergey Poznyakoff <gray@gnu.org.ua>
Add po
* po/.gitignore: New file.
* po/POTFILES.in: New file.
2008-07-30 Sergey Poznyakoff <gray@gnu.org.ua>
Bugfix
* dicod/ident.c (query_ident_name): Return NULL if bind failed.
* dicod/server.c (handle_connection): Move the call to query_ident_name
to a proper place.
2008-07-28 Sergey Poznyakoff <gray@gnu.org.ua>
Dico is dubbed GNU package
2008-07-24 Sergey Poznyakoff <gray@gnu.org.ua>
Version 1.99.92
Update docs.
* README: Update.
* doc/dico.texi: Update.
Finish SASL support.
* dico/autologin.c (parse_autologin): Support for new
keywords: realm, service and host.
* dico/cmdline.opt: New options --sasl, --nosasl.
* dico/connect.c (dict_auth): Rewrite authention to avoid dependency from
"auth" capability.
(auth_cred_free): Free new auth_cred members.
(get_credentials): Rename to auth_cred_get, make global.
* dico/dico-priv.h (struct auth_cred): New fields service, realm and
hostname.
(GETCRED_OK, GETCRED_FAIL, GETCRED_NOAUTH): New defines.
(auth_cred_get, auth_cred_free): New prototypes.
(set_bool): Change return type to int.
(ds_sasl): New prototype.
(saslauth): Change signature.
* dico/func.c (set_bool): Change return type to int.
(ds_sasl): New function.
* dico/saslauth.c (callback): Use new auth_cred members.
(saslauth): Rename to saslauth0.
(saslauth, sasl_enable, sasl_enabled_p): New functions.
* dico/shell.c: Add `sasl' command.
* dicod/main.c (get_full_hostname): Moved to libxdico.
* include/xdico.h (xdico_local_hostname): New prototype.
* lib/Makefile.am (libxdico_a_SOURCES): Add xhostname.c.
Minor fix.
Implement SASL in client.
* dico/saslauth.c: New file.
* dico/Makefile.am (dico_SOURCES): Add saslauth.c
* dico/autologin.c (parse_autologin): Bugfix.
* dico/connect.c (dict_auth): Rename to apop_auth.
(dict_auth): New function.
(get_credentials): Fill cred with zeros.
(dict_connect): Initialize obstack before eventual authentication.
* dico/dico-priv.h (AUTH_OK, AUTH_FAIL, AUTH_CONT): New defines.
(saslauth): New proto.
* dico/func.c (ds_show_info): Remove unused variable.
* dicod/dicod.h (struct dicod_command): Rename nparam to minparam. Add new
member maxparam.
* dicod/auth.c, dicod/commands.c, dicod/lev.c, dicod/mime.c,
dicod/xidle.c, dicod/xversion.c: Reflect changes to struct
dicod_command.
* dicod/gsasl.c (send_challenge): Do not send zero-length data (don't know
if I'm right here).
(get_sasl_response): Bugfixes.
(sasl_auth): Prevent coredump.
(callback): Fix.
(xlate_mech_to_capa): Move to libxdico.
* include/xdico.h (xdico_sasl_mech_to_capa)
(xdico_sasl_capa_match_p): New protos.
* lib/stream.c (dico_stream_read_unbuffered): Return EIO if stream has hit
EOF and user does not check for the number of bytes read.
* lib/utf8.c (strlen): Remove. How did it get there???
* lib/xutil.c (xdico_sasl_mech_to_capa)
(xdico_sasl_capa_match_p): New functions.
2008-07-23 Sergey Poznyakoff <gray@gnu.org.ua>
Implement SASL framework (unfinished).
* am/gsasl.m4: Enable GSASL by default, if available.
Export GSASL_LIBS.
* configure.ac: Check for gsasl.
Display a configuration summary before exiting.
* dicod/gsasl.c: New file.
* dicod/Makefile.am (dicod_SOURCES): Add gsasl.c
(LDADD): Add GSASL_LIBS.
* dicod/dicod.h (get_input_line, register_sasl): New functions.
(sasl_disabled_mech): New extern.
* dicod/main.c (keywords): New keyword sasl-disable-mechanism.
(main): Call register_sasl.
* dico/Makefile.am (LDADD): Add GSASL_LIBS
* dico/dico-priv.h (struct auth_cred): New fields sasl and mech.
(AUTOLOGIN_MECH): New define.
* dico/autologin.c (parse_autologin): Rewrite to allow for multi-line
statements. Handle new auth_cred fields.
2008-07-22 Sergey Poznyakoff <gray@gnu.org.ua>
Minor changes.
* dico/dico-priv.h, dico/func.c (ds_show_info): New function.
* dico/pager.c: Setting pager to "-" disables it.
* dico/shell.c (funtab): Add info command.
* dico.texi: Update.
* doc/libdico.texi (utf8_strbytelen): Remove.
* lib/tokenize.c, lib/utf8.c, lib/xstream.c: Use strlen instead of
the removed utf8_strbytelen.
Minor fix
Check the spelling
Improve autologin mode.
* configure.ac (--with-netrc-file): Rename to --with-autologin-file.
(DEFAULT_NETRC_NAME): Rename to DEFAULT_AUTOLOGIN_FILE.
* dico/connect.c (get_credentials): Consult session-specific autologin first,
the default one afterwards.
Return a three-state value.
All callers updated.
* dico/dico-priv.h (AUTOLOGIN_USERNAME, AUTOLOGIN_PASSWORD)
(AUTOLOGIN_NOAUTH): New defines.
(parse_netrc): Rename to parse_autologin.
* dico/netrc.c: Rename to dico/autologin.c
(parse_netrc): Rename to parse_autologin. Return additional information
in *pflags.
Support `noauth' keyword.
* doc/dico.texi: Finish documenting dico.
2008-07-21 Sergey Poznyakoff <gray@gnu.org.ua>
Minor change.
* dico/connect.c, dico/dico-priv.h (ds_tilde_expand): New function.
* dico/func.c (ds_autologin): Perform tilde expansion.
* doc/dico.texi, doc/libdico.texi: Update.
Fix history handling in Dico and provide a couple of new commands.
* dico/connect.c (dict_connect): Initialize conn->fd.
* dico/dico-priv.h (struct dict_connection): Add fd member to be
able to select on it.
(ds_pager): New prototype.
* dico/func.c (check_disconnect): New function.
(ensure_connection): Call check_disconnect first.
* dico/pager.c (ds_pager): New function.
(create_pager_stream): Prefer internal pager setting over the environment
variable.
* dico/shell.c: Fix history handling.
(prompt, pager): New commands.
* doc/dico.texi: Document interactive mode.
Implement command history.
* dico/shell.c: Implement history commands.
2008-07-19 Sergey Poznyakoff <gray@gnu.org.ua>
Update
I18n.
* include/.gitignore: New file.
* include/Xaw.h: Remove.
* include/appi18n.h, include/libi18n.h,
lib/appi18n.c, lib/libi18n.c: New files.
* .gitignore: Add po
* Makefile.am (SUBDIRS): Add po
* NEWS: Update.
* bootstrap.conf: I18n
* configure.ac: Check for gettext.
(AC_CONFIG_FILES): Add po/Makefile.in
Link gnu/gettext.h to include.
* dico/dico-priv.h: Include appi18n.h
* dico/dico.c (main): Call appi18n_init
* dicod/Makefile.am (LDADD): Add LIBINTL
(INCLUDES): Add -I../gnu
* dicod/dicod.h: Include appi18n.h
dicod/main.c (main): Call appi18n_init
* include/Makefile.am (noinst_HEADERS): Add appi18n.h and libi18n.h
* include/dico/diag.h, lib/diag.c (dico_die): format argument is const.
* include/xdico.h (appi18n_init): New prototype.
* lib/Makefile.am (INCLUDES): Add -I../gnu
(libdico_la_SOURCES): Add libi18n.c
(libxdico_a_SOURCES): Add appi18n.c
* lib/iostr.c, lib/parseopt.c, lib/userprivs.c: Include libi18n.h.
Call _dico_libi18n_init.
* lib/xstream.c: Include libi18n.h.
* makedict/makedict.h: Include appi18n.h
(main): Call appi18n_init
* modules/dict.org/Makefile.am (INCLUDES): Add -I$(top_builddir)/include
* modules/guile/Makefile.am: Likewise.
* modules/outline/Makefile.am: Likewise.
* modules/dict.org/dictorg.h: Include appi18n.h
* modules/guile/guile.c: Likewise.
* modules/outline/outline: Likewise.
Bugfix.
* dico/connect.c (get_credentials): Avoid freeing the result from getpass.
2008-07-18 Sergey Poznyakoff <gray@gnu.org.ua>
Bugfix.
* doc/dico.c (fixup_url): Use xdico_assign_string to initialize host.
2008-07-17 Sergey Poznyakoff <gray@gnu.org.ua>
Minor fixes.
* dico/cmdline.opt: Reword the docstring for --levdist and --quiet.
* dico/connect.c (get_credentials): Ask for password if it is not given.
* doc/dico.texi: Begin documenting dico client.
* doc/libdico.texi (url): Update.
* gnulib.modules: Require getpass-gnu
* lib/url.c (url_get_user): Allow `;' to delimit username and password, as
requested by RFC2229.
(url_parse_dico_request): /d-type urls do not have :strat part.
Minor change.
* dico-priv.h, func.c, shell.c (script_error)
(script_warning): Remove unused first argument.
Add `--quite' option and `quiet' initialization command.
* dico/cmdline.opt: New option --quiet.
* dico/dico-priv.h (quiet_option): New declaration.
(set_bool): New prototype.
* dico/dico.c (quiet_option): New variable.
* dico/shell.c (helptext): New variable.
(funtab): New command `quiet'.
(ds_prefix): Exclude # from allowed characters for command prefix.
(ds_help): Improve output.
(_command_generator): Skip commands without documentation strings.
Improve matching.
* dico/connect.c (dict_result_free): Allow for null argument.
* dico/dico-priv.h (struct dict_connection): New member match_result.
(dict_run_single_command): Change type to void.
(ensure_connection, ds_define_nth): New prototypes.
* dico/func.c (ds_match): Store match result in conn->match_result.
If no argument, or an empty argument is given, re-display previous
result. Prefix a list of matches from the same database with the
database name. Prefix each match with its ordinal number, so it
can be picked up using it later.
(ds_define_nth): New function.
* dico/lookup.c (print_reply): Make extern. Discern 'no match' from other
replies.
(print_match_result): New function.
* dico/shell.c
(parse_script_file): A single number means define the Nth element from the
previous match.
Improve readline completion in the client.
* dico/connect.c (dict_transcript): New function.
(dict_connect): Use dict_transcript.
(dict_define, dict_match): Fix second argument in call to dict_result_create.
* dico/dico-priv.h (struct dict_connection): New members `transcript',
`db_result', and `strat_result'.
(struct funtab): New type (from shell.c).
(dict_transcript, print_result)
(find_funtab, dict_completion_matches)
(ds_compl_database, ds_compl_strategy): New prototypes.
* dico/func.c (get_list): New function.
(ensure_connection): Get and cache database and strategy information.
(ds_compl_strategy, ds_compl_database): New functions.
(ds_transcript): Actually toggle transcript.
(ds_show_db, ds_show_strat): Show cached results.
* dico/lookup.c (print_result): Make extern.
* dico/shell.c (struct funtab): Move definition to dico-priv.h
(funtab): Imitialize completion functions.
(ds_help): Minor fix.
(parse_script_file): Pass the complete input line to default
define and match.
(_command_completion): Rewrite.
(dict_completion_matches): New function.
* include/dico/stream.h (dico_stream_set_ioctl)
(dico_stream_ioctl): New prototypes.
* include/xdico.h (XSCRIPT_CLT_GET_TRANSPORT)
(XSCRIPT_CLT_SET_TRANSPORT): New define.
* lib/stream.c (struct dico_stream): New field `ctl'.
(dico_stream_set_ioctl): New function.
(dico_stream_flush): Don't coredump if stream is NULL.
(dico_stream_ioctl): New function.
* lib/xscript.c (transcript_flush): Return immediately if transport is NULL.
(xdico_transcript_stream_create): Install ioctl handler.
Minor change.
* dico/func.c: Ensure the connection is opened before
sending commands to the server.
2008-07-16 Sergey Poznyakoff <gray@gnu.org.ua>
Minor changes.
* dico/dico-priv.h (dict_define, dict_match)
(dict_run_single_command): New prototypes.
(ds_show_db, ds_show_strat): New prototypes.
* dico/func.c (ds_show_db, ds_show_strat): New functions.
* dico/lookup.c (dict_lookup_url): Call dict_conn_close.
(dict_run_single_command): New function.
(dict_single_command): Read final response code.
* dico/shell.c: New commands ls and ld.
Update .gitignores
Implement general-purpose result structure.
* dico/connect.c (dict_connect): Always initialize stk.
(dict_define, dict_match): New functions.
(dict_multiline_reply): Remove second arg. Do not push current
buf on stack.
(dict_result_create, dict_result_free): New functions.
(dict_conn_close): Reflect changes to the connection structure.
* dico/dico-priv.h (struct match_result)
(struct define_result, dict_result): New data types.
(struct dict_connection): New fields levdist, last_result. Remove
stk_init. Document all fields.
(dict_result_create, dict_result_free): New prototypes.
(dict_conn_last_result): New macro.
* dico/lookup.c (print_definitions): Remove.
(print_multiline): Remove.
(print_result): New function.
(dict_lookup): Rewrite using new result functions.
Add informational functions.
* dico/dico-priv.h, dico/func.c, dico/shell.c: Implement
version and warranty commands.
* utils/getopt.m4 (print_version_only): New function.
Minor change.
* dico/dico-priv.h, dico/func.c, dico/shell.c (ds_distance): New function.
* dico/lookup.c (dict_lookup): Bugfix.
Implement match and defines in shell mode.
* dico/dico-priv.h, dico/lookup.c (dict_lookup): Rename to dict_word.
(dict_lookup): New function.
(ds_define, ds_match): New functions.
* dico/dico.c: Update uses of dict_lookup
* dico/func.c (ds_define, ds_match): New functions.
* dico/shell.c : Improve help output.
(cmdprefix): Do not initialize. This lets init scripts use
commands without leading prefix.
(parse_script_file): Use shortcuts for define and match.
Provide an interactive dico shell.
* configure.ac: Check for readline.
* dico/func.c, dico/shell.c: New files.
* dico/Makefile.am (dico_SOURCES): Add them.
(LDADD): Add $READLINE_LIBS.
* dico/cmdline.opt: Use xdico_assign_string to initialize string values.
* dico/connect.c (get_homedir): Change to extern.
* dico/dico-priv.h: Add new prototypes.
* dico/dico.c (fixup_url): Use xdico_assign_string to initialize string values.
(main): Call parse_init_scripts.
Switch to shell mode if no arguments given.
* dico/netrc.c (skipws): Change to extern.
* dicod/config-lex.l (unquote_char, quote_char): Move to the library.
All uses changed.
* dicod/dicod.c (tokenize_input): Move to the library. All uses changed.
* include/dico/utf8.h: Include ctype.h.
* include/xdico.h (xdico_unquote_char, xdico_quote_char):
(xdico_tokenize_begin, xdico_tokenize_end, xdico_tokenize_input): New protos.
* lib/tokenize.c: New file.
* lib/Makefile.am (libxdico_a_SOURCES): Add tokenize.c
* utils/getopt.m4 (print_version): Change to extern.
Remove superfluous 'Written by' clause.
Minor change.
* lib/assoc.c, lib/util.c, lib/xlat.c, lib/xutil.c: Fix copyright headers.
2008-07-15 Sergey Poznyakoff <gray@gnu.org.ua>
Handle .netrc file in dico. Some minor improvements.
* configure.ac: New option --with-netrc-file
* dico/Makefile.am (dico_SOURCES): Add netrc.c.
* dico/netrc.c: New file.
* dico/cmdline.opt: The --strategy option implies --match.
New option --autologin.
* dico/connect.c (dict_auth): Take struct auth_cred * as its second argument.
(dict_connect): If an autologin file is given, consult it for user credentials.
* dico/dico-priv.h (struct auth_cred): New data type.
(user, key): Replace with default_cred. All uses updated.
(autologin_file): New declaration.
* dico/dico.c (main): Report a warning if incorrect number of arguments is
given.
* dicod/commands.c (_show_database, _show_strategy): Quote descriptions.
* dicod/dicod.h: Include quotearg.h.
* dicod/main.c (main): Set default quoting style.
Provide a default dict server address.
* configure.ac (DEFAULT_DICT_SERVER): New variable.
* dico/Makefile.am (AM_CPPFLAGS): Define DEFAULT_DICT_SERVER
* dico/dico.c (fixup_url): Use DEFAULT_DICT_SERVER, if no server was specified.
Implement --levdist option.
* dico/cmdline.opt: New option --levdist.
* dico/dico-priv.h (levenshtein_threshold): New declaration.
* dico/dico.c (levenshtein_threshold): New variable.
* dico/lookup.c (dict_lookup_url): Set Levenshtein distance, if supported.
Bugfix.
* utils/getopt.m4 (OPTION): Quote invocation of `prep'.
Bugfix.
* dico/lookup.c (dict_lookup_url): Fix slot allocation for MATCH command.
2008-07-14 Sergey Poznyakoff <gray@gnu.org.ua>
Implement authentication.
* README, TODO: Update.
* dico/cmdline.opt: Handle --noauth option.
* dico/connect.c (parse_initial_reply): Fix storing of the msgid.
* dict_connect: Authenticate if necessary.
* dico/dico-priv.h (noauth_option): New declaration.
* dico/dico.c (noauth_option): New variable.
Bugfix
* util/getopt.m4 (OPTION): Apply prep to DOCSTRING here, instead of in BEGIN.
Bugfix
Forgottent to add.
* lib/xstream.c: New file.
Implement command-line version of dico.
* dicod/fdio.c: Move ...
* lib/fdiostr.c: ... there.
* dicod/xscript.c: Move ...
* lib/xscript.c: ... there.
* dicod/Makefile.am, lib/Makefile.am: Reflect the move.
* dico/connect.c: New file.
* dico/lookup.c: New file.
* dico/pager.c: New file.
* lib/xstream.c: New file.
* dico/Makefile.am (dico_SOURCES): Add connect.c, lookup.c, pager.c
* dico/cmdline.opt: New options --source and --transcript.
(get_options): Do not intialize *index.
* dico/dico-priv.h: Add new prototypes.
(host, port, database, strategy): Replace by dico_url.
* dico/dico.c (host, port, database, strategy): Replace by dico_url.
(transcript, source_addr): New globals.
(main): Add missing implementations.
* dicod/config-gram.y, dicod/server.c: Use DICO_DICT_PORT instead of DICT_PORT.
* dicod/dicod.c (stream_writez, stream_printf)
(stream_write_multiline): Move to lib/xstream.c
* icod/dicod.h (DICT_PORT): Remove.
(fd_stream_create, stream_writez, stream_printf)
(stream_write_multiline): Remove.
* dicod/loader.c (dicod_word_first): Bugfix: break on the first non-empty result.
* gnulib.modules: Add quote and quotearg.
* include/dico/stream.h (dico_fd_stream_create): Change signature.
(dico_fd_io_stream_create): New proto.
* include/dico/types.h (DICO_DICT_PORT): New define.
* include/xdico.h (xdico_transcript_stream_create, stream_writez)
(stream_printf, stream_write_multiline): New protos.
* lib/url.c: Fix copyright header.
* utils/getopt.m4 (GETOPT): Fix handling of 3rd argument.
Rename dico/main.c
* dico/main.c: Rename to ...
* dico/dico.c: ... this.
* dico/Makefile.am: Reflect the rename.
Minor additions to the client.
* dico/cmdline.opt: Initialize dico globals.
* dico/dico-priv.h (enum dico_client_mode): New type.
(DICO_CLIENT_ID): New define.
(host, port, database, strategy, user)
(key, client, req, mode): New declarations.
* dico/main.c (host, port, database, strategy, user)
(key, client, req, mode): New variables.
(dico_lookup): New function placeholder.
(main): Call dico_lookup.
Improve URL parsing.
* include/dico/url.h (DICO_REQUEST_DEFINE, DICO_REQUEST_MATCH): New defines.
(struct dico_request): New data type.
(struct dico_url): Add port and request.
* lib/url.c: Parse `dict://' urls.
(url_get_host,url_get_user): Bug fix.
(url_get_passwd): Remove.
(dico_url_destroy): Free the request.
Bugfix.
* lib/logstream.c (dico_log_stream_create): Remove unused variable.
* utils/getopt.m4: Remove debugging comments.
2008-07-13 Sergey Poznyakoff <gray@gnu.org.ua>
Start writing dico client.
* dico/Makefile.am, dico/cmdline.opt, dico/dico-priv.h,
dico/main.c: New files.
* Makefile.am, configure.ac: Add dico subdirectory.
* lib/logstream.c (dico_log_stream_create): Bugfix.
* utils/getopt.m4: Allow to define aliases for the options.
* dicod/cmdline.opt: Add c-mode marker for Emacs.
2008-07-09 Sergey Poznyakoff <gray@gnu.org.ua>
Cleanup
* configure.ac: Remove unnecessary variables.
* makedict/Makefile.am, makedict/main.c: Remove INPUTDICTPATH and DICTPATH defines.
* modules/guile/guile.c (silent_close_port): Remove unused function.
Remove unnecessary directories and files.
* client, fonts: Removed
* utils/bdfextract.pl, utils/mkbushufont.awk
* utils/Makefile.am: Remove bdfextract.pl and mkbushufont.awk.
Fix documentation.
* doc/libdico.texi: Fix erroneous deftypefns.
2008-07-08 Sergey Poznyakoff <gray@gnu.org.ua>
Minor fix.
* doc/libdico.texi: Fix incorrect deftypefn usage.
Minor improvement.
* dicod/Makefile.am (dicod_SOURCES): Add xidle.c and xversion.c
* dicod/cmdline.opt (OPTIONS_BEGIN): Fix canonical program name.
* dicod/dicod.h (register_xidle, register_xversion): New prototypes.
* dicod/main.c (dicod_xversion, register_xversion): Move to a separate file.
(main): Call register_xidle.
* dicod/xidle.c: New file. Implementation of XIDLE command.
* dicod/xversion.c: New file. Implementation of XVERSION command.
* doc/dico.texi (inactivity-timeout): Add an anchor.
* doc/proto.texi: Document XIDLE command.
2008-07-06 Sergey Poznyakoff <gray@gnu.org.ua>
Move dico log streams to the library. Redirect guile errors to logs.
* dicod/logstr.c: Rename to ...
* lib/logstream.c: ... this.
(log_stream_create): Rename to dico_log_stream_create.
* dicod/Makefile.am (dicod_SOURCES): Remove logstr.c.
* dicod/dicod.c (dicod_loop): Use dico_log_stream_create.
* dicod/dicod.h (log_stream_create): Remove proto.
* doc/libdico.texi (diag): Add a template for dico_log_stream_create.
* include/dico/diag.h (dico_log_stream_create): New prototype.
* lib/Makefile.am (libdico_la_SOURCES): add logstream.c.
* modules/guile/guile.c: Implement `log ports'.
(guile_exit_script, guile_outfile): Remove.
(init_option): Remove unused option `exit-script'.
Remove `outfile' option.
(mod_init): Call _guile_init_dico_log_port; Redirect current output and
error ports to log.
* bootstrap.conf: Mention make ChangeLog in the template.
2008-07-04 Sergey Poznyakoff <gray@gnu.org.ua>
Add .bootstrap to .gitignore
Reorganize docs.
* doc/Makefile.am (dico_TEXINFOS): Add libdico.texi
* doc/libdico.texi: New file.
* doc/dico.texi: Minor changes.
Use dico_free_db method.
* dicod/dicod.c, dicod/dicod.h (dicod_server_cleanup): New function.
* dicod/loader.c (dicod_free_database): Fix return value.
* dicod/main.c (main): Call dicod_server_cleanup when dicod_inetd finishes.
* dicod/server.c (dicod_server): Call dicod_server_cleanup before terminating.
* doc/dico.texi: Update.
Minor changes.
* doc/Makefile.am: Remove leftover references to dictd.
Remove leftovers of dictd.h
2008-07-03 Sergey Poznyakoff <gray@gnu.org.ua>
Minor changes.
* README: Minor changes.
Minor changes.
* doc/dico.texi: Minor changes.
Rename dictd to dicod.
Documentation.
* doc/dico.texi, doc/proto.texi: Start documenting C API. Resolve several
pending xrefs.
Namespace cleanup.
* dictd/dictd.h, dictd/loader.c, include/dico/types.h,
modules/dict.org/dictorg.c, modules/guile/guile.c,
modules/outline/outline.c, modules/template.c: Rename `dico_handler_module'
to `dico_database_module'. Prefix its members with `dico_', instead
of `module_'.
* dictd/loader.c (dictd_close_database): Initialize return value to 0.
Work on documentation.
* dictd/main.c (kwd_user_db): Rename `get-password' to `password-resource',
and `get-groups' to `group-resource'.
* doc/dico.texi: Document authentication.
Housekeeping.
* configure.ac, NEWS, README: Change bug-reporting email.
* dictd/dictd.c (dictd_close_databases): Remove duplicated function.
(close_databases): issue a log notice if dictd_close_database returns failure.
* doc/dico.texi: Update.
Housekeeping.
* doc/Makefile.am (check-options): Improve rule.
* doc/check-docs.sh: Squeeze repeated newlines in sed output.
Untabify docs.
2008-07-02 Sergey Poznyakoff <gray@gnu.org.ua>
Work on documentation and examples.
* dictd/commands.c: Bugfix.
* doc/dico.texi: Describe an example Guile module.
* modules/Makefile.am: Rename `sample' to `template'.
* modules/sample.scm, modules/sample.c: Rename to ...
* modules/template.scm, modules/template.c: ... this.
* tests/dictd.cfin: Add database definitions for an example Guile module.
* tests/glossary.scm (mapcan): Do not export.
2008-06-28 Sergey Poznyakoff <gray@gnu.org.ua>
Minor change.
* dictd/server.c (handle_connection): Return textual replies to the client
if its IP is not allowed to connect and if the server is not able to fork.
Improve docs.
* doc/dico.texi: Create master menu.
* doc/proto.texi: Minor changes.
Improve docs.
* doc/dico.texi: Spell-check. Resolve hanging xrefs.
* doc/proto.texi: Completed.
Improve docs.
* doc/Makefile.am (dico_TEXINFOS): Add proto.texi.
(check-unrevised rule): Scan all texinfo sources.
* doc/dico.texi (Dictionary Server Protocol): New appendix.
* doc/proto.texi: New file.
Bugfixes.
* lib/mapstream.c (_mapfile_open): Fix computing open flags.
* lib/stream.c (dico_stream_close, dico_stream_destroy): Be robust in
case of NULL arguments.
Improve --config-help output.
* dictd/config-format.c (format_simple_statement): Do not output superfluous <>
delimiters.
2008-06-27 Sergey Poznyakoff <gray@gnu.org.ua>
Bugfix.
* modules/dict.org/dictstr.c (_dict_read_dzip): Fix length calculation.
Add a sample Guile module.
* tests/glossary.scm: New file
Pass command line arguments to the Guile init script.
* doc/dico.texi (Guile API): Document init-args.
* modules/guile/guile.c (init-args): New initialization parameter.
(load_path_handler, guile_load): Pass command line to the init script.
(dico-strat-select?): Bugfix: swap 2nd and 3rd arguments to the selector.
(guile_init_args): New variable.
Improve docs.
* doc/dico.texi: Document Guile API and Dico Scheme Primitives.
2008-06-25 Sergey Poznyakoff <gray@gnu.org.ua>
Minimize number of comparisons in suffix strategy.
* modules/dict.org/dictorg.c (compare_entry_ptr): New function.
(suffix_match): Quicksort the result entries. Remove duplicates.
Minor changes.
* Makefile.am (ChangeLog rules): Remove eventual '<unknown>' markers.
* modules/dict.org/dictorg.c (init_suffix_index): Run qsort only once.
Minor fixes
2008-06-23 Sergey Poznyakoff <gray@gnu.org.ua>
Implement command aliasing.
* dictd/Makefile.am (dictd_SOURCES): Add alias.c
* dictd/alias.c: New file.
* dictd/commands.c (dictd_handle_command): Expand aliases.
* dictd/dictd.h (alias_install, alias_expand): New prototypes.
* dictd/main.c (allow_cb, deny_cb, apply_acl_cb, set_user)
(set_supp_group, set_mode, set_log_facility, set_dict_handler)
(enable_capability, set_defstrat): Improve error handling.
(alias_cb): New function.
(keywords): New keyword `alias'.
* tests/dictd.cfin: Define some aliases and document them.
* doc/dico.texi: Document aliasing support.
Documentation.
* doc/dico.texi: Update docs for Guile module.
2008-06-22 Sergey Poznyakoff <gray@gnu.org.ua>
Bugfix.
* dictd/server.c (dictd_server): Remove pidfile before terminating.
Documentation.
* TODO: Update.
* doc/dico.texi: Document guile module.
* modules/Makefile.am (EXTRA_DIST): Add sample.scm
* modules/sample.scm: New file.
* modules/sample.c: Update.
* modules/guile/guile.c: Minor fix in a docstring.
2008-06-21 Sergey Poznyakoff <gray@gnu.org.ua>
Fix keeping track of input line numbers.
* dictd/config-lex.l: Fixup line numbers obtained from m4 #line directives.
* dictd/pp.c: Output information used for the above fixup.
* dictd/dictd.h (parse_line_cpp, parse_line): Remove prototypes.
(install_text): New prototype.
Allow to create Scheme matching strategies.
* modules/guile/guile.c (dico-register-strat): New function.
2008-06-17 Sergey Poznyakoff <gray@gnu.org.ua>
Bugfixes.
* guile/guile.c (dico-strat-default?): Fix a typo.
(init_vtab): Check for SCM_EOL
(mod_init): Move constistency checking to mod_init_db.
(mod_init_db): Fix the call to init_vtab.
Add consistency checking. Attempt to diagnose all missing virtual functions.
Provide a way for modules to tell if a default strategy is being used. Fix visibilty of symbols in guile.c
* include/dico/strat.h (struct dico_strategy): New field is_default.
(dico_strategy_is_default_p): New macro.
* include/dico/types.h (dico_strategy_t): Change into a typedef.
* lib/strat.c (default_strategy): Remove const qualifier.e
(dico_strategy_find): Remove const qualifier from the return type.
(dico_set_default_strategy): Clear/set strat->is_default as appropriate.
* modules/guile/guile.c (struct _guile_strategy): Remove const qualifier.
(dico-strat-description): Fix mistyped Scheme name.
(dico-strat-default?): New function.
(_guile_init_funcs): Explicitly export all Scheme interfaces.
(mod_init_db): Fix inconsistent return type.
2008-06-16 Sergey Poznyakoff <gray@gnu.org.ua>
Minor fixes.
* modules/guile/guile.c: Minor fixes.
Use virtual function tables. A database is allowed to have its own interface functions.
* modules/guile/guile.c (guile_call_proc): Change type of the second argument.
All callers updated.
(guile_init_fun): New variable.
(guile_proc_name): Change all underscores to dashes.
(guile_proc): Remove.
(guile_vtab): New type, instead of it.
(global_vtab): New variable.
(init_vtab): New function.
(init_option): Remove function name options. Add `init-fun' option.
(mod_init): Initialize global_vtab.
(mod_init_db): Initialize database vtab.
(mod_match, mod_define, mod_output_result, mod_result_count)
(mod_compare_count, mod_free_result): Store pointer to the db in the result.
2008-06-15 Sergey Poznyakoff <gray@gnu.org.ua>
Revert c665e5de094d4. Was not worth the candles.
* dictd/dictd.h (dictd_module_t): Remove.
(dictd_module_instance_t): Move there significant fields from dictd_module_t.
* dictd/loader.c: Update all uses of the above.
* include/dico/types.h (dico_instance_t): Remove.
(DICO_CAPA_MULTI_INSTANCE): Remove.
(module_init,module_init_db): Revert changes.
* modules/dict.org/dictorg.c: Revert changes.
* modules/guile/guile.c: Likewise.
* modules/outline/outline.c: Likewise.
2008-06-14 Sergey Poznyakoff <gray@gnu.org.ua>
Minor fix.
* modules/guile/guile.c (mod_close, mod_get_text)
(mod_match, mod_define): Remove superfluous dbname argument.
Allow several module instances to be used simultaneously.
* include/dico/types.h (DICO_CAPA_NONE, DICO_CAPA_DEFAULT)
(DICO_CAPA_MULTI_INSTANCE): New macros.
(dico_handler_module.capabilities): New field.
(dico_handler_module.module_init): Change prototype.
(dico_handler_module.module_init_db): Change prototype.
(dico_instance_t): New typedef.
* dict.org/dictorg.c: Reflect changes to include/dico/types.h.
* modules/guile/guile.c: Likewise.
* modules/outline/outline.c: Likewise.
* dictd/config-gram.y (process_ident): Fix error message.
* dictd/dictd.c: Rename dictd_handler_t to dictd_module_instance_t.
* dictd/dictd.h (handler_list): Rename to modinst_list.
(dictd_handler_type): Remove.
(dictd_module_t): New data type.
(dictd_module_instance_t): New data type.
(dictd_handler_t): Remove.
(dictd_database): Rename `mod' to `mod_handle'.
Remove `handler'. Add `instance'.
(database_remove_dependent, dictd_load_module): Change prototypes.
* dictd/loader.c (dictd_load_module0): Use table of modules.
Pass a pointer to instance handle to module_init.
(dictd_load_module): Change argument type.
(dictd_init_database): Pass instance handle to module_init_db.
(dictd_open_database, dictd_close_database)
(dictd_free_database, dictd_get_database_descr)
(dictd_get_database_info, dictd_word_first)
(dictd_word_all, print_matches, dictd_match_word_db)
(print_definitions, dictd_define_word_db): Reflect changes to the internal structure.
* dictd/main.c (handler_list): Rename to modinst_list.
Remove `handler' keyword. Use `load-module' instead.
* tests/dictd.cfin (handler): Rename to `load-module'.
* doc/dico.texi: Update.
2008-06-13 Sergey Poznyakoff <gray@gnu.org.ua>
Documentation improvements.
* doc/dico.texi: Document Outline and Dictorg modules.
* README, TODO: Minor changes.
2008-06-12 Sergey Poznyakoff <gray@gnu.org.ua>
Documentation improvements.
* dictd/cmdline.opt: Fix docstrings.
* doc/macros.texi (opsummary): Generate a comment.
* doc/Makefile.am (check-options): Use generated comment as a sed anchor to retrieve the list of documented options.
* doc/dico.texi: Resolve some FIXMEs, document operation modes, etc.
Various improvements.
* dictd/dictd.h (DICTD_LOGGING_ENVAR): New macro.
(dictd_log_pre_setup, dictd_log_encode_envar, run_lint): New prototypes.
* dictd/main.c (kwd_database, keywords): Rename apply-acl to visibility-acl.
(dictd_log_pre_setup, dictd_log_encode_envar): New functions.
(main): Call dictd_log_pre_setup.
* dictd/pp.c (run_lint): New function.
* dictd/server.c (pre_restart_lint, pre_restart_lint_internal): New functions.
(server_loop): Restart only if configuration passes lint.
* doc/dico.texi: Document security settings and database visibility.
Use ACLs to control incoming connections.
* dictd/config-lex.l (isemptystr): Allow only ; after the delimiter.
* dictd/dictd.h (connect_acl): New extern.
* dictd/main.c (connect_acl): New global.
* dictd/server.c (handle_connection): Use connect_acl to determine wheter to allow connection.
* doc/dico.texi: Document ACLs
Finish ACLs.
* dictd/acl.c (struct acl_entry): New member acl.
(_parse_sub_acl): New function.
(_parse_group, _parse_acl, _acl_check): Allow sub-acls.
(dictd_acl_check): Second argument gives default result.
* dictd/auth.c (dictd_auth): Call check_db_visibility.
(init_auth_data): Call reset_db_visibility.
* dictd/dictd.c (dictd_loop): Call reset_db_visibility.
* dictd/dictd.h (dictd_acl_check): Change signature.
(struct dictd_database): Remove require_auth and groups.
Add new members acl and visible.
(show_sys_info, ssi_group_list): Remove declarations.
(check_db_visibility, reset_db_visibility): New functions.
(database_visible_p): New macro.
* dictd/main.c (ssi_group_list): Remove.
(require_auth): Remove.
(global_acl): New global.
(apply_acl_cb): New function.
(kwd_database): Remove require-auth and groups. Add apply-acl.
(set_show_sys_info): Remove.
(keywords): Remove sys-info-groups and require-auth. Add apply-acl.
(reset_db_visibility, check_db_visibility): New functions.
(database_visible_p): Remove.
* tests/dictd.cfin: Fix here-document syntax.
Begin implementing ACLs.
* dictd/acl.c: New file.
* dictd/Makefile.am (dictd_SOURCES): Add acl.c
* dictd/config-gram.y: Allow multiple values after ident.
Alsways require a semicolon after MSTRING.
* dictd/config-lex.l (isemptystr): Change signature. Allow semicolon or comma after the EOT delimiter.
(multiline_begin): Fix calculation of the delimiter length.
* dictd/dictd.h (TYPE_ARRAY): New define.
(config_value_t): New member arg.
(dictd_acl_t): New data type.
(dictd_acl_create, dictd_acl_check, dictd_acl_install)
(dictd_acl_lookup): New functions.
(ssi_mode): Remove.
(show_sys_info): Fix declaration.
* dictd/main.c (show_sys_info): Change type.
(kwd_acl): New keywords.
(set_show_sys_info): Argument to show-sys-info is an ACL name.
(keywords): New statement `acl'.
(show_sys_info_p): Rewrite using dictd_acl_check.
* dictd/ident.c (query_ident_name): Remove unused variable.
2008-06-09 Sergey Poznyakoff <gray@gnu.org.ua>
Improve docs.
* dictd/main.c: Add check for valid transfer encoding.
* doc/dico.texi: Add summary contents, document `database' statement,
finish `Preprocessing' section.
Improve docs.
* doc/dico.texi: Document pragmatic comments, database modules, tuning and preporcessing.
2008-06-08 Sergey Poznyakoff <gray@gnu.org.ua>
Improve docs.
* dictd/lev.c (register_lev): Rename command to XLEV to match the capability name.
* doc/dico.texi: Document logging, access logs, global configuration and capability.
* doc/strftime.texi: Resolve @FIXME-pxref.
Improve the docs.
* dictd/accesslog.c: Fix a typo.
* doc/dico.texi: Update.
2008-06-07 Sergey Poznyakoff <gray@gnu.org.ua>
Improve the docs.
* doc/dico.texi: Update.
More fixes.
* dictd/Makefile.am (AM_CFLAGS): Define LOCALSTATEDIR.
* dictd/main.c (pidfile_name): Change the default.
(max_children): Provide the default value.
(keywords): Fix typo in docstring.
Minor improvement.
* dictd/config-gram.y (string_to_sockaddr): Allow to use a hostname
without port or a port without hostname.
Improve configuration parser.
* dictd/config-gram.y (string rule): Add IDENT.
(config_diag, config_warning): New functions.
(config_error): Rewrite using config_diag.
* dictd/config-lex.l: Do not require identifier to appear on a new line.
Fix '\newline' escapes.
Issue error message if stray characters appear in input.
Issue warnings if undefined escape sequence is used.
* dictd/dictd.h (config_warning): New prototype.
Minor changes.
* README: Improve.
* doc/dico.texi: Improve structure.
* configure.ac (LOG_FACILITY): Allow argument in lowercase. Default to LOG_DAEMON.
* dictd/main.c (keywords): Fix typo.
2008-06-06 Sergey Poznyakoff <gray@gnu.org.ua>
Work on documentation structure.
* dictd/main.c (config_help): Change docstring.
* doc/dico.texi: Documentation framework.
2008-06-05 Sergey Poznyakoff <gray@gnu.org.ua>
Minor changes.
* dictd/accesslog.c (alog_conf_hostname): Print actual server IP address.
* dictd/commands.c (dictd_status): Print `dictd' timer.
* doc/Makefile.am (dico_TEXINFOS): Add strftime.texi
* doc/strftime.texi: New file.
* doc/dico.texi: Use makeinfo auto-sectioning capability.
2008-06-03 Sergey Poznyakoff <gray@gnu.org.ua>
Improve access log output.
* dictd/accesslog.c (print_str): Output a dash if fmt is NULL.
All callers updated.
* dictd/main.c (main): Set dico_argcv_quoting_style to hex. This helps keep access log compatible with Apache and existing log analyzer software.
* include/dico/argcv.h (dico_argcv_quoting_style): New enum and global variable.
* lib/argcv.c (argcv_quoting_style): New global variable.
(argcv_quoted_length, argcv_quote_copy): Take into account argcv_quoting_style.
Inplement identity check (RFC 1413).
* dictd/Makefile.am (dictd_SOURCES): Add ident.c
* dictd/ident.c: New file.
* dictd/accesslog.c: Implement %l
* dictd/auth.c (init_auth_data): Reset identity_name.
* dictd/dictd.h (identity_check, identity_name, ident_keyfile): New externs.
(query_ident_name): New proto.
* dictd/main.c (identity_check, identity_name, ident_keyfile): New variables.
(keywords): New keywords `identity-check' and `ident-keyfile'.
* dictd/server.c (handle_connection): Run identity check if required.
* gnulib.modules: Add crypto/des.
Implement more format specs in access log.
* dictd/accesslog.c (sockaddr_to_hostname, sockaddr_to_portname): New functions.
(alog_remote_ip): Use sockaddr_to_hostname.
(alog_local_ip): Print actual IP of the server that handled the request.
(alog_remote_host): Use sockaddr_to_hostname.
(alog_server_port): Implement.
* dictd/dictd.c (dictd_inetd): Initialize server_addr and server_addrlen.
* dictd/dictd.h (UINTMAX_STRSIZE_BOUND): New define.
(server_addr, server_addrlen): New externs.
* dictd/server.c (struct dictd_server): New data type.
(fdtab): Replace with srvtab.
(fdcount): Rename to srvcount.
(server_addr, server_addrlen): New variables.
(handle_connection): Change argument semantics.
Initialize server_addr and server_addrlen.
Minor fix.
* include/xdico.h (timer_get_temp): Remove.
* lib/timer.c: Likewise.
* dictd/commands.c: Use timer_stop instead of timer_get_temp
Implement more access log specifiers.
* dictd/accesslog.c (add_instr): Fill allocated memory with 0s.
(alog_response_size,alog_response_size_clf,alog_time_ms)
(alog_process_time): Implement.
(free_cache): Bugfix. P was used uninitialized.
* dictd/commands.c (dictd_status): Free the temporary timer.
(dictd_match, dictd_define): Initialize total_bytes_out.
* dictd/dictd.h: Include inttostr.h
(total_bytes_out): New extern.
* dictd/loader.c (dictd_match_word_db, dictd_define_word_db): Add missing calls
to access_log_status.
* dictd/ostream.c (total_bytes_out): New variable.
(ostream_write): Update total_bytes_out. Return a meaningful error code.
* include/dico/stream.h (dico_stream_bytes_in, dico_stream_bytes_out): New prototypes.
* lib/stream.c (struct dico_stream): Remove `offset'. Add new fields `bytes_in' and `bytes_out'.
(dico_stream_open, dico_stream_read_unbuffered)
(dico_stream_write_unbuffered): Update bytes_in and bytes_out.
(dico_stream_bytes_in, dico_stream_bytes_out): New functions.
* lib/timer.c (timer_hasher, timer_compare): Use case-insensitive comparison.
(DIFFTIME): Make sure the result is double.
2008-06-02 Sergey Poznyakoff <gray@gnu.org.ua>
Implement access log file.
* dictd/Makefile.am (dictd_SOURCES): Add accesslog.c
* dictd/accesslog.c: New file.
* dictd/auth.c (init_auth_data): Free client_id.
* dictd/commands.c (dictd_status): Assign client_id.
(dictd_match, dictd_define): Call access_log.
* dictd/dictd.c (dictd_inetd): Initialize client_addr and client_addrlen.
(dictd_loop): Call access_log_free_cache when finished.
* dictd/dictd.h (client_id, access_log_format, access_log_file)
(client_addr, client_addrlen): New externs.
(get_full_hostname): New proto.
(access_log_status, access_log, compile_access_log)
(access_log_free_cache): New protos.
* dictd/loader.c (dictd_word_first, dictd_word_first, dictd_word_all)
(dictd_match_word_db): Call access_log functions.
* dictd/main.c (client_id): New global variable.
(keywords): New statements access-log-format and access-log-file.
(get_full_hostname): Change return variable, remove static qualifier.
(main): Update call to get_full_hostname, call compile_access_log.
* dictd/server.c (client_addr, client_addrlen): New variables.
(handle_connection): Initialize client_addr and client_addrlen.
* dictd/xscript.c (transcript_flush): New function.
* gnulib.modules: Add fprintftime.
* include/xdico.h (xdico_assign_string): New proto.
* lib/xutil.c (xdico_assign_string): New function.
* tests/dictd.cfin: Configure timing output and access log.
2008-05-31 Sergey Poznyakoff <gray@gnu.org.ua>
Minor fix.
* dictd/pp.c: Fix indentation.
(try_file): Bugfix.
Preprocess the configuration file.
* configure.ac (--without-preprocessor): New option.
(DEFAULT_PREPROCESSOR): New variable.
* dictd/pp-setup: New file.
* dictd/pp.c: New file.
* dictd/Makefile.am (dictd_SOURCES): Add pp.c
(AM_CFLAGS): Add -DDEFAULT_VERSION_INCLUDE_DIR, -DDEFAULT_INCLUDE_DIR,
-DDEFAULT_PREPROCESSOR
(EXTRA_DIST): Add pp-setup.
(inc_DATA): New var. Add $(PP_SETUP_FILE)
* dictd/cmdline.opt: New options --syslog, -E, --preprocessor,
--no-preprocessor, --include-dir.
* dictd/config-lex.l (fillbuf, ctx_lookup, push_source, pop_source)
(get_file_name, config_include): Remove.
(YY_INPUT): Change definition.
(config_lex_begin): Rewrite using preprocessor interface.
(config_lex_end): Empty placeholder.
* dictd/dictd.h (getmaxfd): New macro (from server.c).
(preprocessor, debug_level, debug_level_str): New externs.
(MODE_PREPROC): New constant.
(dictd_log_setup, include_path_setup, add_include_dir, parse_line_cpp)
(parse_line, pp_init, pp_done, preprocess_config, pp_make_argcv)
(pp_extrn_start, pp_extrn_shutdown, pp_fill_buffer): New protos.
* dictd/server.c (getmaxfd): Move to dictd.h.
* dictd/main.c (debug_level, debug_level_str): New variables.
(dictd_log_setup): New function.
(main): Call include_path_setup. Handle mode == MODE_PREPROC.
* include/dico/argcv.h (dico_argcv_string): 2nd arg is const.
* lib/argcv.c: Likewise.
* include/dico/diag.h (dico_invocation_name): New extern.
* lib/diag.c (dico_invocation_name): New variable.
(dico_set_program_name): Set dico_invocation_name.
Minor fix.
* config-lex.l: \f is a white-space char.
Namespace cleanup.
* dictd/dictd.h (gd_locus_t): Rename to dictd_locus_t.
* dictd/config-gram.y: Likewise.
* dictd/config-lex.l: Likewise.
* dictd/main.c: Likewise.
* dictd/udb.c: Likewise.
Minor fix.
* dictd/main.c (main): Use log_facility in openlog.
Implement STATUS command.
* dictd/commands.c (dictd_quit): Use report_current_timing.
(dictd_status): New function.
(command_tab): Bind dictd_status to STATUS command.
* dictd/dictd.h (num_defines, num_matches, num_compares): Remove.
(struct dico_stat): New data type.
(current_stat, total_stat): New externs.
(report_timing): Change signature.
(report_current_timing): New function, to be used instead of report_timing.
* dictd/loader.c: Use report_current_timing.
* dictd/stat.c (num_defines, num_matches, num_compares): Remove.
(current_stat, total_stat): New variables.
report_timing): Rewrite for general purpose usage.
(report_current_timing): New function.
Minor fix in guile module.
* modules/guile/guile.c (argv_to_scm): Quote each element.
(mod_open): Open function takes variable number of arguments.
2008-05-30 Sergey Poznyakoff <gray@gnu.org.ua>
Improve module interface.
* dictd/dictd.c (init_databases): Call dictd_init_database.
(dictd_close_databases, open_databases, close_databases): New functions.
(dictd_loop): Begin with open_databases and end with close_databases.
* dictd/dictd.h (ictd_open_database_handler)
(dictd_close_database_handler): Removed.
(dictd_init_database, dictd_open_database)
(dictd_close_database, dictd_free_database): New protos.
* dictd/loader.c (MODULE_ASSERT): New macro.
(dictd_load_module0): Improve error diagnostic and cosistency
checks.
(dictd_open_database_handler): Remove.
(dictd_init_database): New function.
(dictd_close_database_handler): Remove.
(dictd_close_database): New function.
(dictd_free_database): New function.
* include/dico/types.h (dico_handler_module.version): Change type to unsigned.
(module_open): Change signature
(module_init_db, module_free_db): New functions.
* lib/stream.c (stream_flush_buffer): Fix typo.
* modules/dict.org/dictorg.c: Rewrite for new interface.
* modules/guile/guile.c: Rewrite for new interface.
* modules/outline/outline.c: Rewrite for new interface.
Bugfix.
* lib/stream.c (_stream_buffer_full_p, _stream_flush_buffer): Fix handling of
line buffers.
2008-05-29 Sergey Poznyakoff <gray@gnu.org.ua>
Minor improvements.
* modules/guile/guile.c (_dico_port_close): Call scm_gc_free.
(_dico_port_free): Return 0.
(mod_open): Return value of #f or '() means failure.
2008-05-28 Sergey Poznyakoff <gray@gnu.org.ua>
Improve docs.
* THANKS, TODO: Update.
* dictd/config-format.c: Place a newline before each statement, except
ones appearing immediately after an opening curly brace.
(format_statement_array): Take an extra argument, specifying whether to
begin the output with a newline.
* dictd/dictd.h (format_statement_array): Change prototype.
(format_docstring): New prototype.
* dictd/main.c (config_help): Output an initial heading.
Introduce interface version numbering.
* include/dico/types.h (DICO_MODULE_VERSION): New define
(struct dico_handler_module): New field `version'.
* modules/dict.org/dictorg.c: Set interface version number.
* modules/guile/guile.c: Likewise.
* modules/outline/outline.c: Likewise.
* modules/sample.c: Likewise.
* lib/Makefile.am (libdico_la_LDFLAGS): Define version-info.
Finished guile.c
* lib/stream.c (_stream_flush_buffer): Second argument instructs whether to
flush all buffer contents in case of line buffers. All callers updated.
* modules/guile/guile.c (dico-strat-selector?, dico-strat-select?)
(dico-strat-name, dico-strat-descriprion): New Scheme functions.
(_guile_init_funcs): New function.
(guile_proc_name): New variable.
(mod_init): Call _guile_init_funcs. Improve error diagnostics.
(mod_match): Call strategy selector if supplied.
Minor change.
* README: Update.
Guile module almost finished.
* modules/guile/guile.c: Implement mod_define, mod_match, and the rest of
mod_ interfaces.
2008-05-27 Sergey Poznyakoff <gray@gnu.org.ua>
Develope guile.c
* am/guile.m4: Require Guile 1.8
(_stream_fill_buffer): Return a meaningful error code.
* modules/guile/guile.c: Implement mod_init, mod_open, mod_close, mod_info
and mod_descr.
Bugfixes.
* bootstrap: Obtain aclocal arguments from Makefile.am
* gnulib.modules (xgetdomainname): New module.
* lib/stream.c (dico_stream_read_unbuffered): Return EIO if less than
size bytes were read and pread is NULL.
Add a placeholder for Guile module.
* Makefile.am (ACLOCAL_AMFLAGS): Add am.
* configure.ac: Check for guile.
* am/gsasl.m4, am/guile.m4: New files.
* modules/guile/Makefile.am, modules/guile/guile.c: New files.
2008-05-26 Sergey Poznyakoff <gray@gnu.org.ua>
Minor change.
* README-hacking (Debugging): New section.
* utils/gud-wrapper: New function.
Speed up connection startup in daemon mode.
* dictd/dictd.c (dictd_loop): Remove call to dictd_server_init.
(dictd_inetd): Fix arguments to dico_stream_set_buffer.
* dictd/dictd.h (dictd_server_init.): New proto.
* dictd/main.c (main): Call dictd_server_init here.
* dictd/server.c (handle_connectiond): Fix arguments to dico_stream_set_buffer.
* include/dico/types.h (DICO_MAX_BUFFER): New define.
Improve stat info.
* dictd/commands.c (dictd_show_server): Show additional statistics about
the server.
* dictd/dictd.c (dictd_loop): Do not close and destroy the stream, leave
it for the caller.
* dictd/dictd.h (total_forks): New extern.
(ssi_mode): New enum.
(show_sys_info, ssi_group_list): New externs.
* dictd/main.c (show_sys_info, ssi_group_list): New globals.
(show-sys-info, sys-info-groups): New config file statements.
(show_sys_info_p, get_full_hostname): New function.
(main): Init "server" timer.
* dictd/server.c (total_forks): New global.
(register_child): Increase total_forks.
(stop_all, stop_children): Do nothing if childtab is NULL.
(handle_connection): Destroy the stream after dictd_loop terminates.
* include/xdico.h (timer_get_temp): New proto.
* lib/timer.c (timer_get_temp): New function.
* modules/dict.org/dictorg.c (printdef): Improve error checking.
Bugfix.
* modules/dict.org/dictstr.c (_dict_read_dzip): Update str->offset.
Do not show 00-database entries, unless a special option is given.
* modules/dict.org/dictorg.c (show_dictorg_entries): New global.
(show-dictorg-entries): New command line option.
(mod_open): Set show_dictorg_entries.
(RESERVED_WORD): New macro.
(mod_match, mod_define): Use the value of db->show_dictorg_entries
to decide whether to show dict.org service entries.
* modules/dict.org/dictorg.h (struct dictdb): New field `show_dictorg_entries'.
Compile dictorg even if zlib is not found.
* configure.ac: Bugfix.
* modules/dict.org/dictorg.h: Include zlib.h conditionally.
* modules/dict.org/dictstr.c: Conditionally compile libz-related code.
Implement DZIP format.
* README: Update.
* modules/dict.org/dictstr.c (struct _dict_chunk_cache): New field `size'.
All references updated.
(struct _dict_stream): New field `buffer'. All references updated.
(cache_get): Implement.
(get_chunk_num): Remove.
(_dict_destroy): Free buffer and deinitialize inflation engine.
(_dict_open): Compute chunk offsets after header_length has been fixed up.
(_dict_read_dzip): Implement.
Bugfix
* lib/stream.c (dico_stream_write): Initialize bufp.
Minor fix.
* modules/dict.org/dictorg.c (_dict_seek_text, _dict_seek_gzip): Fix
erroneous return type.
Preparatory work for DZIP support.
* modules/dict.org/dictorg.c (free_db): Close and destroy stream.
* modules/dict.org/dictorg.h: Include stdint.h
(GZ_OS_): New defines.
(dict_stream_create): Change signature. All callers changed.
* modules/dict.org/dictstr.c (DE_UNSUPPORTED_VERSION, DE_BAD_HEADER)
(DE_GZIP_SEEK): New defines.
(struct _dict_chunk, struct _dict_chunk_cache): New data types.
(struct _dict_stream): Add dzip-related fields.
(cache_create_chunk, cache_alloc, cache_destroy, cache_promote)
(cache_get, get_chunk_num): New functions.
(_dict_open, _dict_read, _dict_seek): Handle dzip format.
(_dict_strerror): Handle new error code.s
(_dict_read_dzip): New placeholder.
(_dict_seek_dzip): New function.
(dict_stream_create): Take two arguments.
Change signatures of stream I/O functions.
* include/dico/stream.h (dico_stream_read_unbuffered)
(dico_stream_write_unbuffered)
(dico_stream_read, dico_stream_write): buf argument is void*, not char*.
(dico_stream_getdelim): New function.
* lib/stream.c: Likewise.
(dico_stream_seek): Clear eof marker.
Bugfix in dictorg module.
* modules/dict.org/dictorg.c (suffix_match): Fix lost entry.
Bugfix in outline module.
* modules/outline/outline.c (outline_match0): Fix coredump.
Minor improvement in dictorg module.
* modules/dict.org/dictorg.c: Implement trim-ws option.
Silent compiler warnings.
* dictd/config-gram.y, dictd/dictd.h, dictd/main.c, lib/jiscvt.c, lib/utf8.c,
makedict/index.c, makedict/makedict.h, modules/outline/outline.c: Avoid
compiler warnings.
* dictd/logstr.c, dictd/ostream.c, dictd/xscript.c, include/dico/stream.h,
lib/fdstream.c, lib/fltstream.c, lib/iostr.c,
lib/stream.c: dico_stream_write takes const char * buffer.
Delay setting capabilities until the end of config parsing.
* dictd/capa.c (dictd_capa_register): Move actual initialization to dictd_capa_flush.
(dictd_capa_flush): New function.
* dictd/cmdline.opt: New option --lint (-t).
* dictd/dictd.h (config_lint_option): New extern.
* dictd/main.c (config_lint_option): New global.
(main): Call dictd_capa_flush. Exit immediately if config_lint_option is set.
Provide library functions for parsing module command lines.
* include/dico.h: Include dico/parseopt.h.
* include/dico/Makefile.am (pkginclude_HEADERS): Add parseopt.h
* include/dico/parseopt.h: New file.
* lib/Makefile.am (libdico_la_SOURCES): Add parseopt.c.
* lib/parseopt.c: New file. Ported from pam-modules.
* modules/dict.org/dictorg.c (mod_init, mod_open): Use dico_parseopt to
parse command line.
(free_db): Free suf_index.
Minor improvement.
* modules/dict.org/dictorg.c (mod_open): Additional option "sort" forces sortin of the index.
Bugfixes.
* dictd/commands.c (_show_database): Print "" if the database description is NULL.
* dictd/loader.c (print_definitions): Likewise.
* modules/dict.org/dictorg.c (parse_index_entry): Use \t as a field separator.
(_match_simple): Fix coredump.
2008-05-25 Sergey Poznyakoff <gray@gnu.org.ua>
Another minor update.
* utils/bdfextract.pl: Fix bitmasks.
Minor update for completeness sake.
* utils/Makefile.am: Remove revbits.
* utils/revbits.c: Remove.
* utils/bdfextract.pl: Compute reversed bit string in place.
* utils/mkbushufont.awk: Compute reversed bit string in place.
Keep namespace clean.
* include/dico/types.h (ARRAY_SIZE): Rename to DICO_ARRAY_SIZE.
* dictd/config-gram.y: Likewise.
* dictd/dictd.c: Likewise.
* modules/dict.org/dictorg.c: Likewise.
* modules/outline/outline.c: Likewise.
Implement `size' method in streams.
* include/dico/stream.h (dico_stream_set_size, dico_stream_size): New functions.
* lib/fdstream.c (fd_size, dico_fd_stream_create): Implement size method.
* lib/mapstream.c (_mapfile_size, dico_mapfile_stream_create): Implement size method.
* lib/stream.c (struct dico_stream): New member size.
(dico_stream_set_size, dico_stream_size): New functions.
Avoid building programs whose requisite libraries are missing.
* configure.ac: Remove leftover --with-log-facility option.
Detect presence of libz.
Do not abort if no Berkeley DB is found.
Set BUILD_JDICT_PROGS substitution variable if libdb is found.
(check_bdb): Make sure -ldb does not make it into LIBS.
* dictd/Makefile.am (INCLUDES): Remove DB_INCLUDES
(LDADD): Remove DB_LIBS.
* makedict/Makefile.am (bin_PROGRAMS): Set to @BUILD_JDICT_PROGS@
* modules/dict.org/Makefile.am (dictorg_la_LIBADD): Replace -lz with @LIBZ@
Initial implementation of dict.org format.
* README: Update.
* include/dico/stream.h (dico_stream_seek): New prototype.
(dico_mapfile_stream_create): New prototype.
* lib/Makefile.am (libdico_la_SOURCES): Add mapstream.c.
* lib/mapstream.c: New file.
* lib/list.c (dico_list_insert_sorted): Bugfix: increase count when
adding a new entry.
* lib/stream.c (all functions): Return a meaningful error code.
(dico_stream_strerror): Bugfix.
(dico_stream_seek): Implement.
* modules/dict.org/Makefile.am (dictorg_la_SOURCES): Add dictstr.c.
* modules/dict.org/dictstr.c: New file.
* modules/dict.org/dictorg.c: Implement full functionality.
* modules/dict.org/dictorg.h: Include zlib.h. Add dict.org format definitions.
2008-05-23 Sergey Poznyakoff <gray@gnu.org.ua>
MInor fix.
* lib/fltstream.c (filter_wr_flush): Make sure the output is terminated with
CRLF.
Merge branch 'master' of ssh://gray@git.gnu.org.ua/gitroot/dico
./F
2008-05-20 Sergey Poznyakoff <gray@gnu.org.ua>
Update the docs.
* README, README-hacking: Update.
2008-05-19 Sergey Poznyakoff <gray@gnu.org.ua>
Add modules/dict.org/data.c
Add modules/dict.org/crc.c
Minor change.
* modules/dict.org/Makefile.am (dictorg_la_SOURCES): Add crc.c and data.c
(noinst_HEADERS): New variable. Add crc.h and dictorg.h
* modules/dict.org/crc.h: New file.
* modules/dict.org/dictorg.h: New file.
* modules/dict.org/dictorg.c: Move includes and data definitions to
dictorg.h
* include/dico/util.h: New file * lib/xutil.c: Renamed from util.c (make_full_file_name): Rewrite using dico_full_file_name. * lib/util.c: New file. * include/dico.h: Include dico/util.h * include/dico/Makefile.am (pkginclude_HEADERS): Add util.h. * include/dico/filter.h (dico_base64_input): New prototype. * lib/Makefile.am (libdico_la_SOURCES): Add util.c (libxdico_a_SOURCES): Remove util.c, add xutil.c * lib/base64.c (b64_input): Rename to dico_base64_input. All callers changed. * modules/dict.org/dictorg.c: Implement mod_init and, partially, mod_open. Parse index file.
Fix coredump in outline module.
* modules/outline/outline.c (outline_define): Fix coredump on missing
definitions.
2008-05-18 Sergey Poznyakoff <gray@gnu.org.ua>
Add session transcript feature.
* dictd/logstr.c: New file.
* dictd/xscript.c: New file
* dictd/Makefile.am (dictd_SOURCES): Add logstr.c and xscript.c
* dictd/dictd.c (dictd_loop): Set up session transcript, if requested.
* dictd/dictd.h (transcript): New declaration.
(transcript_stream_create, log_stream_create): New proto.
* dictd/main.c (transcript): New variable.
(keywords): New keyword "transcript".
Implement suffix matching strategy.
* outline/outline.c (struct entry): New fields: length and peer.
(struct outline_file): New field suf_index.
(alloc_entry): Set length and wordlen.
(suffix_match): New function.
(strat_tab): Add suffix_match.
(revert_word, init_suffix_index): New functions.
(exact_match, prefix_match): Initialize x.length and x.wordlen. Set result
type to result_match;
(compare_entry_ptr): New function.
(outline_close): Free suf_index.
(outline_define): Set result type to result_define.
Re-create the test dictionary.
* tests/devils.out: Re-create.
2008-05-17 Sergey Poznyakoff <gray@gnu.org.ua>
Provide a macro for the size of a soundex buffer.
* include/dico/utf8.h (DICO_SOUNDEX_SIZE): New macro.
* dictd/dictd.c (soundex_sel): Use DICO_SOUNDEX_SIZE macro.
* lib/soundex.c (dico_soundex): Use DICO_SOUNDEX_SIZE macro.
Minor change
* Makefile.am (ChangeLog): Append Local variables section.
2008-05-16 Sergey Poznyakoff <gray@gnu.org.ua>
Add a framework for dict.org module.
* modules/dict.org: New directory.
* modules/dict.org/Makefile.am, modules/dict.org/dictorg.c
* modules/sample.c: New file.
* configure.ac, modules/Makefile.am: Add modules/dict.org.
* dictd/Makefile.am (dictd_SOURCES): Add stat.c * dictd/stat.c: New file. * dictd/commands.c, dictd/dictd.c: Use begin_timing/report_timing. * dictd/dictd.h (num_defines, num_matches, num_compares): New globals. (begin_timing, report_timing): New prototypes. * dictd/loader.c (print_timing): Remove. Use begin_timing/report_timing for stat output. Use module_compare_count to retrieve number of comparisons. * modules/outline/outline.c: Keep track of the number of comparisons. Provide module_compare_count method.
Report overall timing.
* dictd/commands.c (dictd_quit): Print timing information.
* dictd/dictd.c (dictd_loop): Start timer.
Minor change.
* tests/devils.out: Fix typos.
Implement Soundex strategy.
* lib/soundex.c: New file
* lib/Makefile.am (libdico_la_SOURCES): Add soundex.c.
* dictd/dictd.c (dictd_init_strategies): Add soundex.
* include/dico/utf8.h (dico_soundex): New proto.
Implement regex strategies.
* dictd/regex.c: New file.
* dictd/Makefile.am (dictd_SOURCES): Add regex.c
* dictd/loader.c (dictd_load_module0): Update.
(dictd_word_first, dictd_word_all, dictd_word_db): Use new dico_strategy_t type.
(ictd_match_word_first, ictd_match_word_all): Likewise.
* dictd/commands.c, dictd/dictd.c, lib/strat.c,
modules/outline/outline.c: Use new dico_strategy_t type.
* dictd/config-gram.y (config_error): Correctly handle locus->file == NULL.
* dictd/dictd.h (register_lev, register_regex): New functions.
* dictd/lev.c (lev_sel): Use new signature.
* dictd/main.c (main): Call register_regex.
* include/dico/strat.h: Move typedef to types.h
Use new dico_strategy_t type in prototypes
* include/dico/types.h (dico_select_t): Change signature.
(struct dico_handler_module.module_match_all): Remove.
(struct dico_handler_module.module_match): Take const dico_strategy_t strat as
the 2nd argument.
2008-05-15 Sergey Poznyakoff <gray@gnu.org.ua>
Minor fixes.
* dictd/loader.c (print_matches): Quote the word. This is not required by
the RFC, but some clients (kdict) expect it.
* dictd/server.c (dictd_server): Fix copy-n-paste errors.
Implement Levenshtein and Damerau-Levenshtein match strategies.
* dictd/lev.c: New file.
* dictd/Makefile.am (dictd_SOURCES): Add lev.c.
* dictd/commands.c (dictd_match): Update calls to dictd_match_* functions.
* dictd/dictd.h (struct dictd_database.mod): Fix type.
(dictd_match_word_db, dictd_match_word_first)
(dictd_define_word_db): Change type of `strat'.
(DICTD_DEFAULT_STRATEGY): Define to "lev".
* dictd/loader.c (dictd_load_module0): Bail out if the module does not define
mandatory methods.
(dictd_word_first, dictd_word_all)
(dictd_match_word_db, dictd_match_word_all): Change type of `strat'.
* dictd/main.c: Call register_lev.
* include/dico/types.h: New file.
* include/dico/Makefile.am (pkginclude_HEADERS): Add types.h
* include/dico.h: Move all definitions to dico/types.h. Include it.
(dico_handle_t, dico_result_t): Change typedefs to help improve compilation
diagnostics.
* include/dico/diag.h: Include dico/types.h, instead of sys/types.h.
(DICO_PRINTFLIKE): Remove redefinition.
* include/dico/strat.h: Include dico/types.h, instead of sys/types.h.
(struct dico_strategy): New members `sel' and `closure'.
* lib/strat.c (dico_strategy_dup): Handle new fields.
* include/dico/stream.h (dico_linebuf_t, dico_stream_t): Move to dico/types.h
* include/dico/utf8.h (dico_levenshtein_distance): First two arguments are
const.
* lib/levenshtein.c: Likewise.
* modules/outline/outline.c: Implement module_match_all.
Minor change.
* include/dico/utf8.h, lib/utf8.c: Fix a typo.
Improve UTF-8 functions. Add a function for computing levenshtein distance.
* lib/levenshtein.c: New file.
* lib/Makefile.am (libdico_la_SOURCES): Add levenshtein.c
* dico/utf8.h (utf8_symcmp, utf8_symcasecmp, utf8_strcasecmp)
(utf8_strncasecmp,utf8_mbstr_to_wc)
(dico_levenshtein_distance): New prototypes.
* lib/utf8.c (utf8_symcmp, utf8_symcasecmp, utf8_strcasecmp)
(utf8_strncasecmp,utf8_mbstr_to_wc): New functions.
* modules/outline/outline.c: Use utf8 comparitors.
Add ChangeLog rule. Use fmt to split long lines in ChangeLog
Move diagnostics functions to libdico.
* include/dico/diag.h: New file
* lib/diag.c: Prefix all global symbols with dico_. All uses updated.
* lib/Makefile.am (libxdico_a_SOURCES): Remove diag.c
(libdico_la_SOURCES): Add diag.c
* include/dico.h: Include dico/diag.h
* include/dico/Makefile.am (pkginclude_HEADERS): Add diag.h
* modules/outline/outline.c: Use dico_log instead of syslog.
2008-05-14 Sergey Poznyakoff <gray@gnu.org.ua>
Discontinue ChangeLog, use git log to regenerate it when making a distribution.
* .gitignore: Add ChangeLog
* ChangeLog: Rename to ChangeLog.2008
* Makefile.am (EXTRA_DIST): Add ChangeLog.2008
(make-ChangeLog): New rule.
(dist-hook): New rule.
* bootstrap.conf: Create a placeholder for ChangeLog.
* gnulib.modules: Add gitlog-to-changelog
2008-05-13 Sergey Poznyakoff <gray@gnu.org.ua>
Minor changes.
* doc/Makefile.am: Add check-options rule
* doc/gjdict.texi: New file.
* utils/Makefile.am: Remove helpcmp.pl
* utils/helpcmp.pl: Remove.
Introduce a documentation framework:
* doc/.gitignore, doc/Makefile.am, doc/check-docs.sh,
doc/dico.texi, doc/fdl.texi, doc/gendocs_template,
doc/macros.texi, doc/mastermenu.el, doc/rendition.texi,
doc/untabify.el: New files.
* Makefile.am (SUBDIRS): Add doc.
* configure.ac (RENDITION): New subst variable.
(AC_CONFIG_FILES): Add doc/Makefile.
Implement quoted-printable encoding.
* lib/Makefile.am (libdico_la_SOURCES): Add qp.c
* lib/qp.c: New file. Implementation of quoted-printable
encoding/decoding.
* lib/fltstream.c (dico_codec_stream_create): New function.
* dictd/ostream.c (print_headers): Use dico_codec_stream_create to
create encoder stream.
* include/dico/filter.h (dico_codec_stream_create)
(dico_qp_stream_create,dico_qp_decode<dico_qp_encode): New
functions.
* dictd/main.c (database_remove_dependent): Use
dictd_database_free.
Implement a framework for various encodings in mime mode; implement base64 encoding.
* include/dico/filter.h: New file.
* lib/base64.c: New file.
* lib/fltstream.c: New file.
* dictd/commands.c: Update calls to dictd_ostream_create.
* dictd/loader.c: Update calls to dictd_ostream_create.
* dictd/dictd.h (struct dictd_database): New members: content_type
and content_transfer_encoding.
(dictd_ostream_create): Take two additional arguments.
* dictd/fdio.c: Update calls to dico_stream_create.
* dictd/main.c (keywords): New keywords `content-type',
`content-transfer-encoding'.
* dictd/ostream.c (struct ostream): New members: flags, type, and
encoding.
(print_headers): New function.
(ostream_write): Call print_headers.
(ostream_flush, ostream_destroy): New functions.
(dictd_ostream_create): Take two more arguments, specifying the
content type and encoding to be used.
* include/dico.h: Include dico/filter.h
* include/dico/Makefile.am (pkginclude_HEADERS): Add filter.h
* include/dico/stream.h (dico_stream_create): Change signature.
* lib/Makefile.am (libdico_la_SOURCES): Add base64.c and
fltstream.c.
* lib/linebuf.c (dico_linebuf_flush): Initialize rc.
* lib/list.c: Fix copyright header.
* lib/stream.c (dico_stream_create): Take one more argument.
(dico_stream_flush): Call stream->flush, if not NULL.
(dico_stream_destroy): Call stream->destroy, if not NULL.
* modules/outline/outline.c (outline_output_result): Fix return
value.
2008-05-12 Sergey Poznyakoff <gray@gnu.org.ua>
Implement OPTION MIME.
* README: Update.
* dictd/Makefile.am (dictd_SOURCES): Add mime.c, ostream.c.
* dictd/dictd.h (register_mime, dictd_ostream_create): New
prototypes.
* dictd/loader.c (print_matches, print_definitions): Use ostream
for output.
* dictd/commands.c (dictd_help, dictd_show_info)
(dictd_show_databases, dictd_show_strategies)
(dictd_show_strategies): Use ostream for output.
* dictd/main.c (main): Call register_mime.
* tests/dictd.cfin: Request mime capability.
* lib/stream.c (dico_stream_read_unbuffered)
(dico_stream_write_unbuffered): Return 1 and set errno to ENOSYS
if the underlying method is NULL.
Implement authentication and database authorization.
* dictd/auth.c (auth): Set user_name and user_groups.
(init_auth_data): New function.
* dictd/commands.c (dictd_show_info): Use database_count and
database_iterate instead of dico_list_ functions.
* dictd/dbtext.c (dbtext_get_groups): Store groups in a list.
* dictd/dictd.c (dictd_loop): Call init_auth_data before
returning.
* dictd/dictd.h (user_name, user_groups): New globals.
(struct dictd_database): New fields: require_auth and groups.
(database_count, database_iterate, database_visible_p): New
prototypes.
(struct udb_def._db_get_groups): Change signature.
(udb_get_groups): Change signature.
(init_auth_data): New function.
* dictd/loader.c (dictd_word_first, dictd_word_all): Ignore
databases that are not visible.
(dictd_define_word_db): Restore accidentally deleted call to
mp->module_define.
* dictd/main.c (require_auth, user_name, user_groups): New
variables.
(kwd_database): New keywords: `require-auth' and `groups'.
(keywords): New keyword `require-auth'.
(database_visible_p, database_count, database_iterate): New
functions.
(cmp_database_name): Ignore invisible databases.
(struct dictd_user_db._db_get_groups): Change signature.
(udb_get_groups): Change signature.
* include/dico/list.h (dico_list_intersect_p): New function.
* lib/list.c (dico_list_intersect_p): New function.
* modules/outline/outline.c (compare_prefix): Bugfix.
* tests/devils.out (PRECIPITATE): Remove duplicate entry.
Optionally print timing information for match and define commands.
* dictd/commands.c (dictd_match): Resolve strategy before passing
it to the handler module.
* dictd/dictd.h (timing_option): New global.
* dictd/loader.c (print_timing): New function.
(dictd_word_first, dictd_word_all, dictd_match_word_db)
(dictd_match_word_first, dictd_match_word_all)
(dictd_define_word_db, dictd_define_word_first)
(dictd_define_word_all): Optionally print timing information.
* dictd/main.c (timing_option): New global.
(keywords): New statement `timing'.
* gnulib.modules: Add gettimeofday.
* include/xdico.h (xdico_timer_t): New data type.
(timer_get, timer_start, timer_stop, timer_reset)
(timer_get_real, timer_get_user, timer_get_system)
(timer_format_time): New functions.
* lib/Makefile.am (libxdico_a_SOURCES): Add timer.c
* lib/timer.c: New file.
Implement prefix matches
Update
Implement working outline module. Add example data and configuration, for testing.
* dictd/loader.c (dictd_word_all): Bugfix
(print_matches): Fix output.
(print_definitions): Remove optional ': text follows' part, as it
seems to confuse some clients (notably, kdict).
* include/dico.h: Include dico/utf8.h
* include/dico/utf8.h: New file.
* include/xdico.h (utf8_*): Move to dico/utf8.h
* lib/Makefile.am (libdico_la_SOURCES): Add utf8.c.
(libxdico_la_SOURCES): Remove utf8.c.
* lib/utf8.c: Do not include xalloc.h and xdico.h, include dico.h
instead.
(utf8_wc_strdup): Use calloc.
(utf8_wc_to_mbstr): Do not use logmsg.
* modules/outline/outline.c: Working implementation.
* tests/.gitignore, tests/Makefile.am, tests/devils.out,
tests/dictd.cfin
* Makefile.am (SUBDIRS): Add tests.
* configure.ac (AC_CONFIG_FILES): Add tests/Makefile.am
2008-05-11 Sergey Poznyakoff <gray@gnu.org.ua>
Provide a generalized framework for ! and * (matches and defines).
* dictd/commands.c (dictd_match): Handle ! and *.
* dictd/dictd.h (dictd_match_word): Remove.
(dictd_match_word_db, dictd_match_word_first)
(dictd_match_word_all): New functions.
* dictd/loader.c (dictd_word_first, dictd_word_all): New functions.
(dictd_match_word): Rename to
dictd_match_word_db.
(dictd_match_word_first,dictd_match_word_all): New functions.
(dictd_define_word_first, dictd_define_word_all): Rewrite using
dictd_word_first and dictd_word_all.
Provide a framework for ! and * searches.
* dictd/commands.c (dictd_define): Implement ! and * searches.
* dictd/dictd.h (dictd_define_word): Remove.
(dictd_define_word_db, dictd_define_word_first)
(dictd_define_word_all): New prototypes.
* dictd/loader.c (print_definitions): New function.
(dictd_define_word): Rename to dictd_define_word_db; use
print_definitions.
(dictd_define_word_first, dictd_define_word_all): New functions.
Provide a default strategy.
* dictd/dictd.c (init_strategies): Rename to dictd_init_strategies.
(dictd_server_init): Remove call to init_strategies, it is done in
main. Ensure that a default strategy is set.
* dictd/dictd.h (DICTD_DEFAULT_STRATEGY): New define.
(dictd_init_strategies): New prototype.
* dictd/main.c: Fix typos in diagnostics messages.
(keywords): New statement `default-strategy'.
(main): Call dictd_init_strategies.
* include/dico/strat.h (dico_set_default_strategy)
(dico_get_default_strategy): New prototypes.
* lib/strat.c (dico_set_default_strategy)
(dico_get_default_strategy): New functions.
2008-05-10 Sergey Poznyakoff <gray@gnu.org.ua>
Initial implementation of MATCH and DEFINE.
* README: Update.
* dictd/commands.c: Initial implementation of MATCH and DEFINE
commands.
* dictd/dictd.c (init_strategies): Always define the "prefix"
strategy.
* dictd/dictd.h (dictd_match_word, dictd_define_word): New
functions.
* dictd/fdio.c (fd_close): Don't raise error on closing descr -1.
* dictd/loader.c (dictd_get_database_descr)
(dictd_get_database_info): Bugfix.
(dictd_match_word, dictd_define_word): New functions.
* include/dico.h (dico_result_t): New data type.
(struct dico_handler_module): Change signatures of module_match
and module_define. Add new methods: module_output_result,
module_result_count, module_free_result.
* modules/outline/outline.c: Reflect changes to struct
dico_handler_module.
2008-05-07 Sergey Poznyakoff <gray@gnu.org.ua>
Bugfix.
* dictd/dictd.c (tokenize_input): Correctly handle quoted arguments.
Rewrite interface to strategies.
* include/dico/strat.h: New file.
* include/dico/Makefile.am (pkginclude_HEADERS): Add strat.h
* lib/strat.c: New file.
* lib/Makefile.am (libdico_la_SOURCES): Add strat.c
* dictd/dictd.c (init_databases): Remove querying for supported
strategies.
(init_strategies): New function.
(dictd_server_init): Call init_strategies.
* dictd/commands.c (dictd_show_strategies): Use new interface to
strategies.
* dictd/dictd.h (dictd_database_t): Remove stratc and stratv.
* dictd/loader.c (strat_name_cmp, add_strategies)
(dictd_database_get_strats): Remove.
* dictd/main.c (strategy_list): Remove.
(dictd_database_free): Remove references to stratc and stratv.
* include/dico.h: Include dico/strat.h
(dico_strategy_t): Move definition to dico/strat.h
(struct dico_handler_module): Remove module_strats.
* outline/outline.c (outline_strats): Remove. Register strategies
in outline_init.
Implement SHOW STRAT. Begin writing `outline' handler module.
* modules: New directory.
* modules/Makefile.am: New file.
* modules/outline: New directory.
* modules/outline/Makefile.am: New file.
* modules/outline/outline.c: New file.
* Makefile.am (SUBDIRS): Add modules.
* configure.ac (AC_CONFIG_FILES): Add modules, modules/outline
* dictd/commands.c (_show_database, dictd_show_info): Use data
returned by the backend module, if not configured in the database
structure.
(dictd_show_strategies): New function.
(command_tab): Implement show strat.
* dictd/dictd.c (init_databases): Initialize strategy list.
* dictd/dictd.h (strategy_list): New declaration.
(dictd_get_database_descr, dictd_free_database_descr)
(dictd_get_database_info, dictd_free_database_info): New
prototypes.
* dictd/loader.c (_add_load_dir): Bugfix.
(add_strategies, strat_name_cmp): New functions.
(dictd_database_get_strats): Rewrite using new version of
module_strats.
(dictd_get_database_descr, dictd_free_database_descr)
(dictd_get_database_info, dictd_free_database_info): New
functions.
(dictd_match_word): New placeholder.
* dictd/main.c (strategy_list): New variable.
* include/dico.h (dico_strategy_t): New data type.
(dico_handler_module): New members module_db_info and
module_db_descr.
(module_strats, module_define): Change signature.
* lib/list.c: Initialize p with zeroes.
Add loader.c
* README: Update
* configure.ac: Require libtool 2.2.5a
(DICO_MODDIR): Define
* dictd/loader.c: New file.
* dictd/Makefile.am: Add loader.c.
* dictd/dictd.h (dictd_loader_init): New proto.
* dictd/main.c (main): Call dictd_loader_init.
2008-05-06 Sergey Poznyakoff <gray@gnu.org.ua>
Initialize databases.
* dictd/dictd.c (init_databases): New function.
(dictd_server_init): Call init_databases.
* dictd/dictd.h (struct dictd_dictionary): New fields: mod, argc,
argv.
(dictd_open_dictionary_handler): New proto.
* dictd/loader.c (dictd_open_dictionary_handler): New function.
* dictd/main.c (set_dico_handler): Rename to set_dict_handler (fix
a typo). Intialize command, argc and argv.
Load modules.
* dictd/commands.c (dictd_show_databases): Return 554 response if
no databases are configured.
* dictd/dictd.c (dictd_loop): Load all configured handlers.
* dictd/dictd.h: Include ltdl.h
(handler_list, dictionary_list): Add declarations.
(dictd_handler_t): New fields: module and handle.
(dictionary_remove_dependent, dictd_load_module): New proto.
* dictd/loader.c (dictd_load_module): New function.
* dictd/main.c (dictionary_remove_dependent): New function.
* dictd/udb.c (udb_create): Improve error diagnostics.
* include/dico.h: Include dico/argcv.h
(DICO_EXPORT): New define.
(dico_handle_t, struct dico_handler_module): New declarations.
* include/dico/Makefile.am (pkginclude_HEADERS): Add argcv.h.
* include/dico/argcv.h: New file.
* include/dico/list.h (dico_iterator_remove_current): Change
return type.
* lib/Makefile.am (libdico_la_SOURCES): add argcv.c
* lib/argcv.c: New file.
* lib/list.c, lib/url.c: Fix dummy errors.
Forgot to add with the previous commit
Provide an installable library and header files for dico database modules.
* include/dico/Makefile.am: New file.
* include/dico/assoc.h: New file.
* include/dico/list.h: New file.
* include/dico/url.h: New file.
* include/dico/xlat.h: New file.
* include/xdico.h: New file.
* include/dico.h: Rewrite. Installable header.
* include/Makefile.am (pkginclude_HEADERS): New var.
Add SUBDIRS.
* dictd/linebuf.c: Move to ...
* lib/linebuf.c: ... this (with mods).
* dictd/stream.c: Move to ...
* lib/stream.c: ... this (with mods).
* lib/Makefile.am (lib_LTLIBRARIES): New installable library
libdico.la.
(noinst_LIBRARIES): New library libxdico.
* lib/assoc.c, lib/list.c, lib/url.c: Avoid using xalloc calls,
instead return error status and set errno.
* lib/diag.c, lib/iputil.c, lib/userprivs.c, lib/utf8.c,
lib/xalloc-die.c: Include xdico.h
* lib/util.c: Likewise.
(xdico_list_create, xdico_iterator_create, xdico_list_append)
(xdico_list_prepend, xdico_assoc_create, xdico_assoc_add): New
functions.
* .gitignore: Update.
* configure.ac (AC_CONFIG_FILES): Add include/dico/Makefile
* dictd/Makefile.am (dictd_SOURCES): Remove linebuf.c and
stream.c.
(LDADD): Add libxdico.a, libdico.la
* dictd/auth.c, dictd/capa.c, dictd/commands.c, dictd/config-gram.y,
dictd/dictd.c, dictd/dictd.h, dictd/fdio.c, dictd/main.c,
dictd/server.c, dictd/udb.c: Reflect changes to the namespace.
* makedict/Makefile.am (LDADD): Add libxdico.a, libdico.la
* makedict/makedict.h: Include xdico.h
Add loader.c
* README: Update
* configure.ac: Require libtool 2.2.5a
(DICO_MODDIR): Define
* dictd/loader.c: New file.
* dictd/Makefile.am: Add loader.c.
* dictd/dictd.h (dictd_loader_init): New proto.
* dictd/main.c (main): Call dictd_loader_init.
Local Variables:
mode: change-log
version-control: never
buffer-read-only: t
End:
|