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
|
2025-11-25 Theppitak Karoonboonyanan <theppitak@gmail.com>
* NEWS:
=== Version 0.2.14 ===
2025-11-25 Theppitak Karoonboonyanan <theppitak@gmail.com>
Update library versioning
* configure.ac: Bump library revision to reflect code change.
2025-11-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
Check Doxygen version without autoconf-archive.
* configure.ac:
- Check Doxygen version using AS_VERSION_COMPARE from within
autoconf instead of AX_COMPARE_VERSION from autoconf-archive.
* INSTALL:
- Drop autoconf-archive requirement from documentation.
2025-11-22 Theppitak Karoonboonyanan <theppitak@gmail.com>
Update Doxyfile for doxygen 1.9.8.
* doc/Doxyfile.in:
- Apply 'doxygen -u'.
* configure.ac:
- Bump doxygen required version.
2025-05-25 Theppitak Karoonboonyanan <theppitak@gmail.com>
Mark UNLIKELY for a malloc failure check.
* datrie/dstring.c (dstring_new):
- Mark a malloc() result check with UNLIKELY().
2025-05-25 Theppitak Karoonboonyanan <theppitak@gmail.com>
Add missing #include for the last commit.
* datrie/trie-string.c:
- Include "trie-private.h" for the UNLIKELY() macro.
2025-05-25 Theppitak Karoonboonyanan <theppitak@gmail.com>
Add checks for malloc() failures.
* datrie/trie-string.c (trie_char_strdup):
* datrie/trie.c (trie_iterator_get_key):
- Check and return NULL on malloc() failures.
Thanks Peng Wu <@epico@github.com> for the report.
Closes: #20.
2025-05-24 John Hein <@jhgit@github.com>
Fix 'undefined symbol: locale_charset' failure.
* configure.ac:
- Link with -liconv when locale_charset() is found in libiconv,
which is true since libiconv 1.17.
Closes: #25.
2025-05-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
Fix parallel test failure.
* tests/test_file.c:
* tests/test_serialization.c:
- Make TRIE_FILENAME unique for each test, to avoid operation
on the same file in parrallel test.
Thanks @enter-github-username@github.com for the report.
Closes: #28.
2025-05-15 Theppitak Karoonboonyanan <theppitak@gmail.com>
Fix "make --shuffle=reverse" failure.
See Debian #1105545 for the report.
* tools/Makefile.am:
- Make sure $(bindir) exists before installing old program
symlink.
2021-10-17 Theppitak Karoonboonyanan <theppitak@gmail.com>
Check fread() result in serialization test.
* tests/test_serialization.c (main):
- Check fread() return value when reading back the serialized
trie file. (Caught by -Wunused-result when building deb.)
2021-08-31 Theppitak Karoonboonyanan <theppitak@gmail.com>
Fix PAPER_TYPE in Doxyfile.
* doc/Doxyfile.in:
- Fix invalid PAPER_TYPE 'a4wide' to 'a4'.
2021-08-31 Theppitak Karoonboonyanan <theppitak@gmail.com>
Update Doxyfile for doxygen 1.9.1.
* doc/Doxyfile.in:
- Apply 'doxygen -u'.
* configure.ac:
- Bump doxygen required version.
2021-08-31 Theppitak Karoonboonyanan <theppitak@gmail.com>
Fix documentation typo.
* datrie/trie.h (TrieEnumFunc):
- Fix 'data' param to 'key_data' in doc comment.
2021-08-31 Theppitak Karoonboonyanan <theppitak@gmail.com>
Apply 'autoupdate' for autoconf 2.71
* configure.ac:
- Quote m4 strings in AC_INIT() parameters.
- Replace AC_CONFIG_HEADER() with AC_CONFIG_HEADERS().
- Replace AC_PROG_LIBTOOL with LT_INIT. With this, drop
AC_LIBTOOL_WIN32_DLL, as we haven't really declared
dllexport anywhere yet.
- Replace obsolete AC_LIBTOOL_LINKER_OPTION() with
_LT_LINKER_OPTION(). Also quote an m4 string.
- Replace obsolete AC_TRY_COMPILE() with AC_COMPILE_IFELSE().
Use AC_LANG_PROGRAM() as 'autoupdate' suggests.
- Drop AC_HEADER_STDC as 'autoupdate' suggests.
- Replace deprecated AC_HELP_STRING() with AS_HELP_STRING().
- Update AC_PREREQ() from 2.59 to 2.71.
2021-02-08 Theppitak Karoonboonyanan <theppitak@gmail.com>
Provide our own version of INSTALL instruction.
* INSTALL:
- Explain simple installation steps and build requirements.
This is to address a frequently found issue when
'autoconf-archive' is missing, like in issue #17, issue #18.
2021-01-29 Theppitak Karoonboonyanan <theppitak@gmail.com>
* NEWS:
=== Version 0.2.13 ===
2021-01-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
Update library versioning
* configure.ac: Bump library versioning to reflect API addition.
2021-01-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
Rename trie_byte_strlen() to trie_char_strsize().
The object of the function is TrieChar string. Let's keep
that semantics in the name.
* datrie/trie-string.h, datrie/trie-string.c
(trie_byte_strlen -> trie_char_strsize):
- Rename the function.
* datrie/tail.c (tail_get_serialized_size, tail_serialize):
- Replace trie_byte_strlen() calls with the new name.
2021-01-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
Revise test_serialization.
* tests/test_serialization.c (-trie_enum_mark_rec):
- Drop unused callback function.
* tests/test_serialization (main):
- Drop unused 'is_failed' variable.
- "%Ilu" -> "%lu" printf format.
- Rearrange error handling in stack unwinding style.
- Add '\n' to printf messages.
- Free 'trieSerializedData'.
We're not moving to C99 yet, but the declaration amid code is
too useful to remove. And it's just in the test code, not in
the main source. So we still allow it.
2021-01-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
Get rid of <unistd.h> include in the new test.
* tests/test_serialization.c (main):
- Replace unlink() calls with remove() from <stdio.h> and drop
<unistd.h> include.
2021-01-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
Adjust file-internal function declarations.
* datrie/fileutils.c
(parse_int16_be, serialize_int32_be, serialize_int16_be):
- Re-declare functions as static.
* datrie/fileutils.c (parse_int16_be):
- Make the 'buff' arg const pointer.
* datrie/fileutils.c:
- Remove some blank lines in source.
2021-01-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
Fix documentation.
* datrie/tail.h (Tail typedef):
- Fix comment (Double-array -> Tail).
2021-01-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
Cosmetic changes.
* datrie/fileutils.c:
* datrie/trie-string.c:
* datrie/alpha-map.c:
* datrie/darray.h:
* datrie/darray.c:
* datrie/tail.h:
* datrie/tail.c:
* datrie/trie.c:
* tools/trie-tool.c:
* tests/test_serialization.c:
- Use space before left parenthesis.
- Use old-style C comments.
- Remove trailing spaces.
- Re-wrap lines.
2021-01-23 KOLANICH <KOLANICH@users.noreply.github.com>
Added serialization of the trie into a memory buffer.
* datrie/fileutils.c
(file_write_int32, +serialize_int32,
file_write_int16, +serialize_int16,
file_read_int32, +parse_int32_be,
file_read_int16, +parse_int16_be):
- Split binary read/write operations into separate functions.
* datrie/fileutils.h, datrie/fileutils.c
(+serialize_int32_be_incr, +serialize_int16_be_incr):
- Add serialization utility functions with pointer advancement.
* datrie/trie-string.h, datrie/trie-string.c
(+trie_byte_strlen):
- Add utility method for calculating TrieChar string size in bytes.
* datrie/alpha-map-private.h, datrie/alpha-map.c
(+alpha_map_get_serialized_size, +alpha_map_serialize_bin):
- Add AlphaMap serialization methods.
* datrie/darray.h, datrie/darray.c
(+da_get_serialized_size, +da_serialize):
- Add DArray serialization methods.
* datrie/tail.h, datrie/tail.c
(+tail_get_serialized_size, +tail_serialize):
- Add Tail serialization methods.
* datrie/trie.h, datrie/trie.c
(+trie_get_serialized_size, +trie_serialize):
- Add Trie serialization methods.
* datrie/libdatrie.map, datrie/libdatrie.def:
- Add export symbols for Trie serialization.
* tests/Makefile.am, +tests/test_serialization.c:
- Add serialization test.
Pull Request #12.
2021-01-22 Theppitak Karoonboonyanan <theppitak@gmail.com>
Get rid of <unistd.h> include.
* tests/test_file.c (main):
- Replace unlink() calls with remove() from <stdio.h> and drop
<unistd.h> include, fixing build issue on Windows.
Addressing Windows build issue differently from what proposed by
@fanc999 in pull request #15. Thanks @fanc999 for first raising this.
2021-01-15 Theppitak Karoonboonyanan <theppitak@gmail.com>
Use TRIE_CHAR_TERM in TAIL I/O methods.
* datrie/tail.c (tail_fwrite):
- Replace strlen() with trie_char_strlen() on suffix,
which is TrieChar string.
* datrie/tail.c (tail_fread):
- Append TRIE_CHAR_TERM, rather than literal zero,
as suffix terminator.
2021-01-15 Theppitak Karoonboonyanan <theppitak@gmail.com>
Use TRIE_CHAR_TERM in TrieIterator methods.
* datrie/trie.c (trie_iterator_get_key):
- Replace strlen() with trie_char_strlen() on tail_str,
which is TrieChar string.
- Check tail_str termination against TRIE_CHAR_TERM, not zero.
2021-01-14 Theppitak Karoonboonyanan <theppitak@gmail.com>
Fix wrong TRIE_CHAR_TERM semantics.
* datrie/trie.h (trie_state_is_terminal):
- Test for terminal state using zero AlphaChar.
TRIE_CHAR_TERM is a TrieChar, although it's also accidentally zero.
2021-01-14 Theppitak Karoonboonyanan <theppitak@gmail.com>
Reduce loops in alpha_map_recalc_work_area().
* datrie/alpha-map.c (alpha_map_recalc_work_area):
- Instead of pre-filling trie-to-alpha map with errors
and setting valid cells afterward, just fill error cells
left after valid cells are done. Then, finally set
TRIE_CHAR_TERM cell.
2021-01-10 Theppitak Karoonboonyanan <theppitak@gmail.com>
Rewrite AlphaMap recalc.
* datrie/alpha-map.c (alpha_map_recalc_work_area):
Rewrite alpha-to-trie & trie-to-alpha maps recalculation
- For clearer relation between the two maps
- To allow other TRIE_CHAR_TERM values than zero
2021-01-09 Theppitak Karoonboonyanan <theppitak@gmail.com>
Use TRIE_CHAR_TERM macro instead of zero.
* datrie/alpha-map.c
(alpha_map_char_to_trie, alpha_map_char_to_trie_str):
* datrie/trie.c (trie_branch_in_branch, trie_branch_in_tail):
* datrie/tail.c (tail_walk_str, tail_walk_char):
- Use TRIE_CHAR_TERM instead of hard-wired zero when working
with raw trie string termination.
* datrie/trie-string.c (trie_string_terminate):
- Append TRIE_CHAR_TERM instead of simply delegating to
dstring_terminate().
2021-01-09 Theppitak Karoonboonyanan <theppitak@gmail.com>
Share static trie string functions internally.
* datrie/trie-string.h, datrie/trie-string.c, datrie/tail.c
(tc_strlen -> trie_char_strlen, tc_strdup -> trie_char_strdup):
- Move private functions in tail.c to trie-string.[ch],
with new full names under new "static trie string" section.
- Check/assign string terminator using TRIE_CHAR_TERM
instead of zero.
* datrie/tail.c (tail_set_suffix):
- Call the new trie_char_strdup() instead of tc_strdup().
* datrie/alpha-map.c (alpha_map_trie_to_char_str):
- Call trie_char_strlen() instead of strlen().
2021-01-06 Theppitak Karoonboonyanan <theppitak@gmail.com>
Get rid of char semantics from TrieChar
* datrie/trie.c (trie_branch_in_branch, trie_branch_in_tail):
- Check null TrieChar with int zero instead of char.
2021-01-05 Theppitak Karoonboonyanan <theppitak@gmail.com>
Use proper #include form in installed header.
* datrie/alpha-map.h:
- Use angle quotes form instead of double quotes in #include.
2021-01-05 Theppitak Karoonboonyanan <theppitak@gmail.com>
Fix some documentations.
* datrie/trie.c (trie_is_dirty):
- Adjust wording to make clear the file is out of sync,
not the other way around.
* datrie/trie.c (trie_store, trie_store_if_absent):
- Fix typo in the description of 'key' parameter.
* datrie/trie.c (trie_store_if_absent):
- Minor wording adjustment (inserted, not appended).
2020-12-30 Theppitak Karoonboonyanan <theppitak@gmail.com>
Fix isspace() arg problem on NetBSD.
* tools/trietool.c (command_add_list, string_trim):
- Cast char to unsigned char before passing to isspace().
Thanks Sean <scole_mail@gmx.com> for the report via a personal mail.
2019-12-20 Theppitak Karoonboonyanan <theppitak@gmail.com>
Use GitHub issue tracker as bug report address.
* configure.ac:
- Replace bug report e-mail address with GitHub issue tracker URL.
2019-08-05 Theppitak Karoonboonyanan <theppitak@gmail.com>
Stop installing README.migration
It's supposed to be internal document now.
* Makefile.am:
- Remove README.migration from doc_DATA.
2019-01-21 Theppitak Karoonboonyanan <theppitak@gmail.com>
Fix cross-compiling issue caused by AC_FUNC_MALLOC
* configure.ac:
- Replace AC_FUNC_MALLOC with AC_CHECK_FUNCS([malloc]),
as we don't rely on GNU's malloc(0) behavior.
Thanks Vanessa McHale for the report. Closes: #11
2018-11-23 Theppitak Karoonboonyanan <theppitak@gmail.com>
Fix wrong key listing in byte trie
* tests/Makefile.am, +tests/test_byte_list.c:
- Add test case
* datrie/alpha-map.c (alpha_map_recalc_work_area):
- Index trie_to_alpha_map[] using TrieIndex, not TrieChar type,
to prevent overflow upon incrementing over 0xff.
- Drop tc variable and just reuse trie_last.
Thanks @legale for the report.
Closes: #9
https://github.com/tlwg/libdatrie/issues/9
2018-06-19 Theppitak Karoonboonyanan <theppitak@gmail.com>
* configure.ac:
- Bump library revision to reflect code changes.
* NEWS:
=== Version 0.2.12 ===
2018-06-19 Theppitak Karoonboonyanan <theppitak@gmail.com>
Use HTTPS in URL
* README:
- Update document URL to HTTPS
2018-06-14 Theppitak Karoonboonyanan <theppitak@gmail.com>
Cast (wchar_t *) to fix warnings in tests
"%ls" printf() format requires (wchar_t *) [aka int *] arg.
So, let's cast (AlphaChar *) [aka unsigned int *] to satisfy it.
* tests/test_walk.c:
* tests/test_iterator.c:
* tests/test_store-retrieve.c:
* tests/test_file.c:
* tests/test_nonalpha.c:
* tests/test_null_trie.c:
- Add <wchar.h> include, for wchar_t type
- Cast "%ls" args from (AlphaChar *) to (wchar_t *)
2018-06-06 Theppitak Karoonboonyanan <theppitak@gmail.com>
Avoid non-ANSI C snprintf()
* tools/trietool.c (+full_path, prepare_trie, close_trie):
- Instead of preparing full path name with snprintf(), which is
non-ANSI, and still risks path name trimming, do it with
size-calculated malloc().
- free() it as needed.
2018-06-04 Theppitak Karoonboonyanan <theppitak@gmail.com>
Fix sscanf() string format
* tools/trietool.c (prepare_trie):
- Define b, e as unsigned int, as required by "%x" format.
Fixing warning from '-Wformat=' gcc option.
2018-06-04 Theppitak Karoonboonyanan <theppitak@gmail.com>
Fix compiler warnings in tests
* tests/test_byte_alpha.c (main):
* tests/test_file.c (main):
* tests/test_iterator.c (main):
* tests/test_nonalpha.c (main):
* tests/test_null_trie.c (main):
* tests/test_store-retrieve.c (main):
* tests/test_term_state.c (main):
* tests/test_walk.c (main):
- Declare main function with 'main (void)'.
Fixing warning from '-Wstrict-prototypes' gcc option.
* tests/test_walk.c (main):
- Split long string, which required C90 compilers.
Fixing warning from '-Woverlength-strings' gcc option.
2018-06-04 Theppitak Karoonboonyanan <theppitak@gmail.com>
Duplicate TrieChar string in more portable manner
* datrie/tail.c (tail_set_suffix, +tc_strdup, +tc_strlen):
- Replace cast strdup() with crafted implementation,
allowing TrieChar to be of larger size than char.
Fixing warning from '-Wint-to-pointer-cast' gcc option.
2018-06-04 Theppitak Karoonboonyanan <theppitak@gmail.com>
Split long string
* tools/trietool.c (usage):
- Split help message which was too long and required C90 compiler.
Caught by '-Woverlength-strings' gcc option.
2018-06-04 Theppitak Karoonboonyanan <theppitak@gmail.com>
Remove unused byte, word, dword typedefs
These are likely to conflict with other uses.
* datrie/typedefs.h (-byte, -word, -dword):
- Remove the unused typedefs
Thanks Peter Moulder for the patch.
2018-06-04 Theppitak Karoonboonyanan <theppitak@gmail.com>
Rename TRUE/FALSE in Bool enum to avoid clash
Some other header file may have already define TRUE/FALSE.
* datrie/typedefs.h (Bool):
- Rename FALSE, TRUE to DA_FALSE, DA_TRUE respectively,
and define FALSE, TRUE macros only if they haven't been defined.
Thanks Peter Moulder for the patch.
2018-06-04 Theppitak Karoonboonyanan <theppitak@gmail.com>
Declare argument-less functions with "(void)"
"f()" declaration form is K&R style, specifying that no information
about the number or types of parameters is supplied. This caused
warnings on '-Wstrict-prototypes' gcc option.
* datrie/alpha-map.h, datrie/alpha-map.c (alpha_map_new):
* datrie/darray.h, datrie/darray.c (da_new, symbols_new):
* datrie/tail.h, datrie/tail.c (tail_new):
* tests/utils.h, tests/utils.c (en_alpha_map_new, en_trie_new):
- Use "(void)" form in declaration
- Also use "(void)" form in definition, for consistency
Thanks Peter Moulder for the initial patch.
2018-05-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
Remove duplicate include
* tools/trietool.c:
- Remove duplicate include <config.h>
2018-04-23 Theppitak Karoonboonyanan <theppitak@gmail.com>
Add missing include in test
* tests/test_byte_alpha.c:
- Add missing include for utils.h
2018-04-23 Theppitak Karoonboonyanan <theppitak@gmail.com>
* configure.ac:
- Bump library revision to reflect code changes.
* NEWS:
=== Version 0.2.11 ===
2018-04-21 Theppitak Karoonboonyanan <theppitak@gmail.com>
Fix reported segfault on full-range alpha map
* tests/Makefile.am, +tests/test_byte_alpha.c:
- Add test case
* datrie/alpha-map.c (alpha_map_recalc_work_area()):
- Redeclare trie_last as TrieIndex, to prevent overflow.
Thanks Xiao Wang for the report, and @nevermatch for the analysis.
Closes: #6
https://github.com/tlwg/libdatrie/issues/6
2018-03-29 Theppitak Karoonboonyanan <theppitak@gmail.com>
Fix trie_state_get_data() at a prefix key
When getting data from a state which terminates a key that is
a prefix of another key, a terminator should be tried, so it
jumps from DA to TAIL, where we can get the data.
* tests/Makefile.am, +tests/test_term_state.c:
- Add a test case with {'ab', 'abc'} dictionary, which fails previous
code when retrieving data for key 'ab'.
* datrie/trie.c (trie_state_get_data()):
- Instead of simply checking for leaf state, which only caught a state
in TAIL, also try walking with a terminator when still in DA.
- Replace 'leaf state' with 'terminal state' in documentation,
for more clarity.
- Also return error on null state pointer.
Thanks Filip Pytloun from the pytries project for the initial patch.
2017-09-06 Theppitak Karoonboonyanan <theppitak@gmail.com>
Revise description about search time complexity
* README:
- Clarify that search time is O(m), where m is the key length,
instead of O(1), while still claim that it's independent of
database size.
This closes #4.
https://github.com/tlwg/libdatrie/issues/4
2016-12-14 Theppitak Karoonboonyanan <theppitak@gmail.com>
Include git-version-gen in tarball
* Makefile.am:
- Add build-aux/git-version-gen to EXTRA_DIST.
2016-09-21 Theppitak Karoonboonyanan <theppitak@gmail.com>
Fix iconv() return value checking.
* tools/trietool.c (conv_to_alpha):
- Check iconv() return value against (size_t) -1, rather than
for its negativity, as size_t can be unsigned.
Thanks Daniel Macks for the report on Issue #3.
https://github.com/tlwg/libdatrie/issues/3
2016-09-21 Theppitak Karoonboonyanan <theppitak@gmail.com>
Use versioning based on Git snapshot.
* Makefile.am:
- Add dist-hook to generate VERSION file on tarball generation.
* +build-aux/git-version-gen:
- Add script to generate version based on 'git describe'
if in git tree, or using VERSION file if in release tarball.
* configure.ac:
- Call git-version-gen to get package version.
2015-10-20 Theppitak Karoonboonyanan <theppitak@gmail.com>
* configure.ac:
- Bump library revision to reflect code changes.
* NEWS, configure.ac:
=== Version 0.2.10 ===
2015-10-13 Theppitak Karoonboonyanan <theppitak@gmail.com>
Optimize AlphaMap mapping.
alpha_map_char_to_trie() is called everywhere before trie state
transition. It's an important bottleneck.
We won't change the persistent AlphaMap structure, but will add
pre-calculated lookup tables for use at run-time.
* datrie/alpha-map.c (struct _AlphaMap):
- Add members for alpha-to-trie and trie-to-alpha lookup tables.
* datrie/alpha-map.c (alpha_map_new, alpha_map_free):
- Initialize & free the tables properly.
* datrie/alpha-map.c (alpha_map_add_range -> alpha_map_add_range_only
+ alpha_map_recalc_work_area):
- Split alpha_map_add_range() API into two parts: adding the range
as usual and recalculate the lookup tables.
* datrie/alpha-map.c (alpha_map_clone, alpha_map_fread_bin):
- Call alpha_map_add_range_only() repeatedly before calling
alpha_map_recalc_work_area() once.
* datrie/alpha-map.c (alpha_map_char_to_trie, alpha_map_trie_to_char):
- Look up the pre-calculated tables instead of calculating on
every call.
This appears to save time by 14.6% for total alpha_char_to_trie()
calls and even lower its bottleneck rank by 1 rank on a libthai
test case. It reduces 0.2% run time of the total libthai test case.
Note that the time saved would be even more in case of multiple
uncontinuous alphabet ranges, at the expense of more memory used.
2015-08-18 Theppitak Karoonboonyanan <theppitak@gmail.com>
Fix doxygen version checking.
* configure.ac:
- Correctly compare doxygen versions. Simple expr comparison
didn't work with version 1.8.10.
Thanks Petr Gajdos <pgajdos@suse.cz> for the patch.
2015-06-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
* datrie/tail.c (tail_set_suffix):
- Catch strdup() failure.
2015-06-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
* configure.ac: Post-release version suffix added.
2015-05-03 Theppitak Karoonboonyanan <theppitak@gmail.com>
* NEWS, configure.ac:
=== Version 0.2.9 ===
2015-05-03 Theppitak Karoonboonyanan <theppitak@gmail.com>
Use relative paths for symlinks.
* tools/Makefile.am, man/Makefile.am:
- Use relative paths for symlinks to avoid confusion in
installation with DESTDIR.
2015-05-03 Theppitak Karoonboonyanan <theppitak@gmail.com>
Also install symlink for old trietool.
* man/Makefile.am:
- Add hooks to install/uninstall symlink for old man page.
2015-05-02 Theppitak Karoonboonyanan <theppitak@gmail.com>
* configure.ac:
- Bump library revision to reflect code changes.
2015-04-29 Theppitak Karoonboonyanan <theppitak@gmail.com>
Bump doxygen required version.
* configure.ac:
- Bump doxygen required version to 1.8.8, according to recent
Doxyfile update.
2015-04-21 Theppitak Karoonboonyanan <theppitak@gmail.com>
Fix infinite loop on empty trie iteration.
* tests/Makefile.am, +tests/test_null_trie.c:
- Add test case for empty trie iteration.
* datrie/darray.c (da_first_separate):
- Fix error condition after loop ending.
Thanks Sergei Lebedev <sergei.a.lebedev@gmail.com> for the report
via personal mail.
Original report: https://github.com/kmike/datrie/issues/17
2015-04-12 Theppitak Karoonboonyanan <theppitak@gmail.com>
Document about alphabet size.
* datrie/trie.h:
- Add to doc comment a description on the alphabet size limit
and the mapped raw codes.
Thanks edgehogapp for the suggestion.
https://groups.google.com/forum/#!topic/thai-linux-foss-devel/U-O__IfviQ0
2015-04-11 Theppitak Karoonboonyanan <theppitak@gmail.com>
Clarify Symbols' struct & methods.
* datrie/darray.c (struct _Symbols):
- Use TRIE_CHAR_MAX + 1 instead of hard-coded value for symbols[]
array size.
Thanks edgehogapp for the suggestion.
https://groups.google.com/forum/#!topic/thai-linux-foss-devel/U-O__IfviQ0
* datrie/darray.h, datrie/darray.c (symbols_new, symbols_add):
- Hide symbols_new() and symbols_add() for internal use.
2015-03-06 Theppitak Karoonboonyanan <theppitak@gmail.com>
Update Doxyfile.
* doc/Doxyfile.in:
- Updated for doxygen 1.8.8 with 'doxygen -u'.
2015-03-02 Theppitak Karoonboonyanan <theppitak@gmail.com>
Catch realloc failure.
* datrie/tail.c (tail_alloc_block):
- Check realloc() result on t->tails reallocation and return
failure code if failed.
* datrie/tail.c (tail_add_suffix):
- Check return value from tail_alloc_block() and return failure
code if failed.
- Update documentation.
2015-03-02 Theppitak Karoonboonyanan <theppitak@gmail.com>
Catch realloc failure.
* datrie/darray.c (da_extend_pool):
- Check realloc() result on d->cells reallocation and handle
failure properly.
2015-02-27 Theppitak Karoonboonyanan <theppitak@gmail.com>
Catch malloc failure.
* datrie/tail.c (tail_fread):
- Check malloc() result on suffix string and exit properly.
2015-02-26 Theppitak Karoonboonyanan <theppitak@gmail.com>
More micro-optimization with LIKELY/UNLIKELY.
* datrie/alpha-map.c (alpha_map_char_to_trie, alpha_map_trie_to_char):
- Use UNLIKELY() when checking for NUL character.
2015-02-10 Theppitak Karoonboonyanan <theppitak@gmail.com>
Fix 'make distcheck' failure.
* doc/Makefile.am:
- Remove doxygen db file on clean.
2015-02-10 Theppitak Karoonboonyanan <theppitak@gmail.com>
More update of my e-mail address.
* man/trietool.1:
- Update my e-mail address.
2015-02-10 Theppitak Karoonboonyanan <theppitak@gmail.com>
Rename trietool-0.2 utility to trietool.
* configure.ac:
- Check for ln -s
* tools/Makefile.am:
- Rename bin target from trietool-0.2 to trietool.
- Add hooks to install/uninstall symlink with old name.
* man/Makefile.am, man/trietool-0.2.1 -> man/trietool.1:
- Rename & update manpage accordingly.
2015-02-06 Theppitak Karoonboonyanan <theppitak@gmail.com>
Micro-optimize with likely/unlikely hints.
* datrie/trie-private.h:
- Add LIKELY() and UNLIKELY() macros based on compiler extension.
* datrie/alpha-map.c
(alpha_map_new, alpha_map_clone, alpha_map_fread_bin,
alpha_map_add_range, alpha_map_char_to_trie_str,
alpha_map_trie_to_char_str):
* datrie/darray.c
(symbols_new, da_new, da_fread, da_get_base, da_get_check,
da_set_base, da_set_check, da_insert_branch, da_find_free_base,
da_extend_pool):
* datrie/dstring.c (dstring_new, dstring_ensure_space):
* datrie/tail.c
(tail_new, tail_fread, tail_get_suffix, tail_set_suffix,
tail_get_data, tail_set_data, tail_walk_str, tail_walk_char):
* datrie/trie.c
(trie_new, trie_fread, trie_enumerate, trie_state_new,
trie_state_walk, trie_state_is_walkable, trie_iterator_new):
- Use LIKELY() and UNLIKELY() where it is known to be so, mostly
for one-time initialization and failure handling.
* datrie/alpha-map.c, datrie/tail.c, datrie/tail.c:
- These are the files that need to include trie-private.h
because of this.
Callgrind says it does help speed up a little bit.
2015-02-05 Theppitak Karoonboonyanan <theppitak@gmail.com>
Disable timestamp in Doxygen-generated doc.
* doc/Doxyfile.in:
- Set HTML_TIMESTAMP to NO to make the document reproducible.
(reported by Debian Reproducible)
2015-02-01 Theppitak Karoonboonyanan <theppitak@gmail.com>
* configure.ac: [Belated] post-release version suffix added.
2015-02-01 Theppitak Karoonboonyanan <theppitak@gmail.com>
Update my e-mail address everywhere.
* AUTHORS, configure.ac, datrie/*.[ch], tests/*.[ch],
tools/trietool.c:
- Replace all mentionings of my e-mail address with the gmail one.
2015-02-01 Theppitak Karoonboonyanan <theppitak@gmail.com>
Fix binary file opening on Windows.
* datrie/trie.c (trie_new_from_file, trie_save):
- Add "b" to fopen() modes, so the binary file is opened properly
on Windows.
Thanks phongphan.p for the report and initial patch.
2014-01-10 Theppitak Karoonboonyanan <thep@linux.thai.net>
* configure.ac:
- Bump library revision to reflect code changes.
* NEWS, configure.ac:
=== Version 0.2.8 ===
2014-01-09 Theppitak Karoonboonyanan <thep@linux.thai.net>
Improve documentation.
* datrie/triedefs.h:
- Refine descriptions of data types.
* datrie/trie.c (trie_iterator_new):
- Fix typo on trie_root() mentioning.
* datrie/trie.c (trie_store, trie_store_if_absent):
- Adjust wording.
* datrie/alpha-map.h, datrie/trie.h:
- Add detailed description of AlphaMap and Trie types.
2014-01-08 Theppitak Karoonboonyanan <thep@linux.thai.net>
Clarify message in test_nonalpha.
* tests/test_nonalpha.c (main):
- Clarify message on false key duplication.
2014-01-08 Theppitak Karoonboonyanan <thep@linux.thai.net>
Add test on keys with non-alphabet input chars.
* tests/Makefile.am, +tests/test_nonalpha.c:
- Add test to ensure that operations on keys with non-alphabet
input chars fail.
2014-01-08 Theppitak Karoonboonyanan <thep@linux.thai.net>
Fail trie operations on non-alphabet inputs.
alpha_map_char_to_trie() tried to return TRIE_CHAR_MAX to indicate
out-of-range error. But this value is indeed valid in trie operations.
Doing so could allow false key duplication when different non-alphabet
chars and TRIE_CHAR_MAX itself were all mapped to TRIE_CHAR_MAX.
So, let's fail all trie operations on non-alphabet input chars.
* datrie/alpha-map-private.h, datrie/alpha-map.c
(alpha_map_char_to_trie):
- Make alpha_map_char_to_trie return TrieIndex type, using
TRIE_INDEX_MAX to indicate out-of-range error.
This allows TRIE_CHAR_MAX to be returned as a valid output.
* datrie/alpha-map.c (alpha_map_char_to_trie_str):
- Fail if alpha_map_char_to_trie() returns error code.
* datrie/trie.c (trie_retrieve, trie_store_conditionally, trie_delete,
trie_state_walk, trie_state_is_walkable):
- Check return value from alpha_map_char_to_trie() and return
failure status on error.
- Also cast TrieIndex return values to TrieChar on function calls.
Thanks Naoki Youshinaga for the suggestion.
2014-01-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
Check for NULL result from AlphaMap string funcs.
* datrie/trie.c (trie_store_conditionally):
- Return failure on NULL alpha_map_char_to_trie_str().
2014-01-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
Return NULL on allocation errors in AlphaMap funcs.
* datrie/alpha-map.c
(alpha_map_char_to_trie_str, alpha_map_trie_to_char_str):
- Return NULL on malloc() error.
2014-01-03 Theppitak Karoonboonyanan <thep@linux.thai.net>
Fix edge case with TRIE_CHAR_MAX as TrieChar.
The trie input char with value TRIE_CHAR_MAX (255), was always
skipped by double-array algorithms. Let's include it.
* datrie/darray.c (da_has_children, da_output_symbols,
da_relocate_base, da_first_separate, da_next_separate):
- Include the last char in trie char iterations.
* datrie/darray.c (da_first_separate, da_next_separate):
- Declare characters as TrieIndex type instead of TrieChar,
to prevent infinite loop due to unsigned char overflow.
Thanks Naoki Youshinaga for the report, test case, and analysis.
2013-10-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
Fix comiler warnings in tests.
* tests/test_walk.c (main):
- Remove unused var i;
- Remove extra printf() args.
* tests/test_iterator.c:
- Add missing #include for free().
* tests/test_walk.c (walk_dict), tests/utils.c (dict_src):
- Cast string literals to (AlphaChar *) to fix signedness
differences.
2013-10-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
* configure.ac: Post-release version suffix added.
2013-10-22 Theppitak Karoonboonyanan <thep@linux.thai.net>
* NEWS, configure.ac:
=== Version 0.2.7.1 ===
2013-10-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
* configure.ac: Bump library versioning to reflect API addition.
(Change missing in previous release)
2013-10-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
* configure.ac: Post-release version suffix added.
2013-10-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
* NEWS, configure.ac:
=== Version 0.2.7 ===
2013-10-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
Add missing distributed file.
* tests/Makefile.am:
- Add utils.h to distribution.
2013-10-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
Reorder tests from primitive to applied.
* tests/Makefile.am:
- Test walk & iterator before store-retrieve & file.
2013-10-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
Write a test suite for trie walk.
* tests/test_walk.c:
- Write test code.
2013-10-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
Write a test suite for trie store/retrieval.
* tests/utils.h, tests/utils.c (+dict_src_n_entries):
- Add function to get total entries in dict_src[].
* tests/test_store-retrieve.c (main):
- Write test code.
2013-10-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
Fix messages in test_iterator.
* tests/test_iterator.c (main):
- s/file/trie/. No file is written or read in this test.
2013-10-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
Skip further iteration tests if key is NULL.
* tests/test_iterator.c (main):
- Insert 'continue' if trie_iterator_get_key() returns NULL.
2013-10-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
Document availibility of alpha_char_strcmp()
* datrie/alpha-map.c (alpha_char_strcmp):
- Document that it's available since 0.2.7.
2013-10-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
Write a test for trie iterator.
* tests/test_iterator.c:
- Write test suite for trie iterator.
2013-10-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
Add skeleton test suites & a test for file I/O.
* configure.ac, Makefile.am, +tests/, +tests/Makefile.am:
- Add tests/ dir to the build system.
* +tests/utils.h, +tests/utils.c:
* +tests/test_file.c:
* +tests/test_iterator.c:
* +tests/test_store-retrieve.c:
* +tests/test_walk.c:
- Add skeleton for test suites.
* tests/utils.h, tests/utils.c, tests/test_file.c:
- Write test suite for file I/O.
2013-10-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
Add alpha_char_strcmp() API.
* datrie/alpha-map.h, datrie/alpha-map.c (+alpha_char_strcmp):
- Add alpha_char_strcmp() declaration & body.
* datrie/libdatrie.def, datrie/libdatrie.map:
- Add alpha_char_strcmp symbols.
2013-10-16 Theppitak Karoonboonyanan <thep@linux.thai.net>
Add missing info in alpha_map_add_range() doc.
* datrie/alpha-map.c (alpha_map_add_range):
- Add documentation on return value.
2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
Fix build for Visual Studio on Windows.
* datrie/dstring.c (dstring_append, dstring_append_string,
dstring_append_char, dstring_terminate):
- Cast (void *) pointers to (char *) before calculating offsets,
for portability.
Thanks Gabi Davar for the report and fix (via Mikhail Korobov
<kmike84@gmail.com>).
2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
Check for doxygen required version.
* configure.ac:
- When doxygen-doc is enabled, also check doxygen version.
2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
Fix doxygen warning.
* doc/Doxyfile.in:
- doxygen no longer ships with the FreeSans font. Just drop it.
2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
Update Doxyfile.
* doc/Doxyfile.in:
- Updated with 'doxygen -u'.
2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
Fix compiler warnings.
* datrie/trie-string.c (trie_string_append_string):
* datrie/trie.c (trie_iterator_get_key):
- Cast strlen() args from (const TrieChar *) to (const char *),
to fix signedness mismatch warnings.
2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
Fix automake warnings.
* datrie/Makefile.am, tools/Makefile.am:
- Replace deprecated INCLUDES with AM_CPPFLAGS.
2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
* configure.ac: Post-release version suffix added.
2013-01-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
* NEWS, configure.ac:
=== Version 0.2.6 ===
2013-01-22 Theppitak Karoonboonyanan <thep@linux.thai.net>
Use xz compression for release tarball.
* configure.ac:
- Specify "dist-xz no-dist-gzip" options to AM_INIT_AUTOMAKE.
2012-08-06 Theppitak Karoonboonyanan <thep@linux.thai.net>
Improve AlphaMap range merging.
* datrie/alpha-map.c (alpha_map_add_range):
- Also try to merge adjacent ranges. Otherwise, adding one by one
character will result in linear search on alphabet set.
Thanks Mikhail Korobov <kmike84@gmail.com> for the report.
2012-08-05 Theppitak Karoonboonyanan <thep@linux.thai.net>
Migrate trie_enumerate() to the new TrieIterator.
This improves performance by 10%, and recursion stacks are also
eliminated.
* datrie/trie.c (trie_enumerate):
- Replace da_enumerate() call with TrieIterator loop.
* datrie/trie.c (-trie_da_enum_func, -_TrieEnumData):
* datrie/darray.h, datrie/darray.c
(-da_enumerate, -da_get_transition_key, -DAEnumFunc,
-da_enumerate_recursive):
- Drop now-unused codes.
2012-08-05 Theppitak Karoonboonyanan <thep@linux.thai.net>
Optimize key calculation for TrieIterator.
* datrie/Makefile.am +datrie/dstring.h +datrie/dstring-private.h
+datrie/dstring.c +datrie/trie-string.h +datrie/trie-string.c:
- Add dynamic string classes DString and TrieString.
* datrie/trie.c:
- (TrieIterator): Add "key" dynamic trie string member for
incrementally gathering the key while iterating.
- Initialize "key" member to NULL on construction. Only allocate and
free it on branching root states.
* datrie/darray.h, datrie/darray.c
(da_first_separate, da_next_separate):
- Instead of allocating memory for return string, accept a dynamic
string object and update it while traversing.
* datrie/trie.c (trie_iterator_next):
- For branching state, create the "key" dynamic string object on
first iteration and pass it to da_first_separate() and
da_next_separate() along the iterations.
* datrie/trie.c (trie_iterator_get_key):
- Replace the total key reconstruction by da_get_transition_key()
with simple string catenation of the dynamic "key" and the suffix
string.
* datrie/darray.h, datrie/darray.c (da_get_transition_key):
- Adjust to use dynamic string instead of total allocation.
* datrie/darray.c (da_enumerate_recursive):
- Adjust the da_get_transition_key() call accordingly.
Thanks Mikhail Korobov <kmike84@gmail.com> for the suggested approach
and for profiling check.
2012-07-31 Theppitak Karoonboonyanan <thep@linux.thai.net>
Add TrieIterator and its operations.
* datrie/trie.h, datrie/trie.c
(+trie_iterator_new, +trie_iterator_free, +trie_iterator_next,
+trie_iterator_get_key, +trie_iterator_get_data):
- Add TrieIterator class and its methods.
* datrie/libdatrie.def, datrie/libdatrie.map:
- Add the new export symbols.
* datrie/darray.h, datrie/darray.c
(da_get_state_key -> da_get_transition_key):
- Adjust da_get_state_key() from getting transition key from root
to getting from arbitrary ancestor.
* datrie/darray.h, datrie/darray.c
(+da_first_separate, +da_next_separate):
- Add internal functions for iterating from one separate node to
another in double-array structure.
Thanks Mikhail Korobov <kmike84@gmail.com> for the use case suggestion.
2012-07-30 Theppitak Karoonboonyanan <thep@linux.thai.net>
* doc/Doxyfile.in: Upgrade to doxygen 1.8.1.2 format.
2012-07-29 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/trie.c: Reformat source.
2012-07-29 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/trie.h, datrie/trie.c (trie_state_walkable_chars):
Reformat source.
2012-07-27 Theppitak Karoonboonyanan <thep@linux.thai.net>
Add new API trie_state_walkable_chars() to allow breadth-first
traversal.
* datrie/darray.h, datrie/darray.c:
- Move da_output_symbols() to darray.h, to be called by the new
function.
- Move the Symbols class to darray.h, as required by
da_output_symbols().
* datrie/trie.h, datrie/trie.c (+trie_state_walkable_chars):
- Add the new public function.
* datrie/libdatrie.map, datrie/libdatrie.def:
- Add the new symbol to export maps.
* configure.ac:
- Update library versioning to reflect API addition.
2012-07-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
* darray/darray.c (da_has_children): Accept (const DArray *) arg.
2012-07-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/darray.c (da_has_children, da_output_symbols,
da_relocate_base):
Calculate max_c candidate using num_cells - base instead of
TRIE_INDEX_MAX - base, to prevent more unnecessary loops.
2012-07-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/trie.c (trie_state_get_data):
Check if the state is leaf, not just suffix, before getting data.
Thanks Mikhail Korobov <kmike84@gmail.com> for the report.
2012-07-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/tail.h, datrie/tail.c:
* datrie/alpha-map.c:
* datrie/trie.h, datrie/trie.c:
* datrie/darray.c: Remove trailing spaces.
2012-07-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/tail.c (tail_get_suffix): Fix function documentation.
Thanks Mikhail Korobov <kmike84@gmail.com> for the report.
2012-07-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/darray.c, datrie/tail.c:
- Don't include <stdint.h> when compiled with MSVC, as the header is
missing there, and SIZE_MAX is provided in some other header.
Thanks Mikhail Korobov <kmike84@gmail.com> for the report.
2012-07-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
* configure.ac: Post-release version suffix added.
2011-11-04 Theppitak Karoonboonyanan <thep@linux.thai.net>
* NEWS, configure.ac:
=== Version 0.2.5 ===
2011-08-04 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/alpha-map.h: Add missing 'extern "C"' for export functions
to fix problem with C++ compiler.
Thanks Aurimas ÄŒernius <aurisc4@gmail.com> for the patch.
2011-03-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
* configure.ac: Post-release version suffix added.
* datrie/trie.h: Add missing documentation for "user_data" parameter
in TrieEnumFunc.
2010-06-30 Theppitak Karoonboonyanan <thep@linux.thai.net>
* NEWS, configure.ac:
=== Version 0.2.4 ===
2010-06-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/alpha-map-private.h, datrie/alpha-map.c:
* datrie/darray.h, datrie/darray.c:
* datrie/tail.h, datrie/tail.c:
* datrie/trie.c (trie_fread, trie_fwrite):
Rename *_read() and *_write() functions to *_fread() and *_fwrite(),
for consistency with the trie_f{read,write}() function.
2010-06-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
Add trie_fread() and trie_fwrite() interfaces for reading/writing trie
data from an open file. Thanks NIIBE Yutaka <gniibe@fsij.org> for the
suggestion.
* datrie/trie.h (trie_fread, trie_fwrite): Add new API declarations.
* datrie/trie.c (trie_new_from_file, trie_fread, trie_save,
trie_fwrite):
Refactor open file handling of trie_new_from_file() and trie_save()
into trie_fread() and trie_fwrite(), and make the old functions
do file opening/closing as wrappers to them.
* datrie/libdatrie.def, datrie/libdatrie.map: Add symbol exports.
2010-06-27 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/trie.c (trie_store_if_absent): Document that it's available
since 0.2.4.
* datrie/libdatrie.def, datrie/libdatrie.map: Add symbol exports for
trie_store_if_absent().
* ChangeLog: Fix file locations in previous log.
2010-06-24 Theppitak Karoonboonyanan <thep@linux.thai.net>
Add trie_store_if_absent() interface to avoid race condition in
multi-thread applications. Thanks Dan Searle <dan.searle@censornet.com>
for the suggestion.
* datrie/trie.h (trie_store_if_absent): Add new API declaration.
* datrie/trie.c (trie_store_if_absent, trie_store,
trie_store_conditionally):
Refactor trie_store() into trie_store_conditionally() with extra arg
is_overwrite, and make the two public functions mere wrappers to it.
* configure.ac: Bump library version according to the added symbol.
2010-03-01 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/trie.c (trie_save): Do not return before closing file.
Thanks to Xu Jiandong for the report.
2010-03-01 Theppitak Karoonboonyanan <thep@linux.thai.net>
* configure.ac: Post-release version suffix added.
2010-02-27 Theppitak Karoonboonyanan <thep@linux.thai.net>
* configure.ac: Bump library revision.
* NEWS, configure.ac:
=== Version 0.2.3 ===
2010-02-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/*.h, datrie/*.c: Add my e-mail address to license header.
2010-02-24 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/*.h, datrie/*.c: Add license header to every source file.
2010-02-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
Move documentation from *.h to *.c, so libdatrie developers have the
doc at hand. Users can still read the doxygen-generated doc BTW.
* datrie/alpha-map.h:
* datrie/alpha-map.c:
* datrie/trie.h:
* datrie/trie.c:
* datrie/darray.h:
* datrie/darray.c:
* datrie/tail.h:
* datrie/tail.c: Move doc comments from *.h to *.c.
* doc/Doxyfile.in: Add alpha-map.c, trie.c to INPUT.
* doc/Makefile.am: Add *.c to doxygen.stamp dependency.
2010-02-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/darray.c (da_read), datrie/tail.c (tail_read):
Protect against possible integer overflow on malicious trie file.
2010-02-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
* configure.ac: Post-release version suffix added.
Be more robust against corrupted trie files.
* datrie/alpha-map.c (alpha_map_read_bin):
* datrie/darray.c (da_read):
* datrie/tail.c (tail_read):
- Check all returns from file_read_*() and clean up properly on
failures
- Adjust existing clean up codes to the new structure
2009-04-29 Theppitak Karoonboonyanan <thep@linux.thai.net>
* configure.ac: Bump library revision.
* NEWS, configure.ac:
=== Version 0.2.2 ===
2009-04-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
* configure.ac: Check $datrie_cv_have_version_script against "yes",
not "1", so symbol versioning works on GNU ld again.
2009-04-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/trie.c (trie_state_copy): Use bitwise copy instead of
member-wise.
2009-04-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
* configure.ac: Adjust variable name datrie_cv_have_version_script.
2009-04-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
Support locale charset query with libcharset, for mac and mingw.
[Thanks Beamer User for the report.]
* configure.ac: Check for locale_charset() from libiconv and
nl_langinfo(CODESET) from libc. If neither is present, ask user to
install GNU libiconv.
* tools/trietool.c (init_iconv): Use locale_charset() to query locale
charset if possible, fall back to nl_langinfo(CODESET) otherwise.
2009-04-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
Support alternative iconv implemetations.
[Thanks cwt for the report.]
* configure.ac: Check for GNU libconv or native libiconv if system libc
doesn't have iconv().
* tools/Makefile.am: Add ICONV_LIBS to linker options.
2009-04-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
Fall back to libtool for linkers that do not support -version-script.
[Thanks bact' for the report. Thanks cwt for the test.]
* configure.ac: Check whether linker supports -version-script.
* datrie/Makefile.am, +datrie/libdatrie.def:
Apply -version-script flag only when linker supports it. Otherwise,
fall back to the old method based on libtool -export-symbols flag.
2009-04-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
* configure.ac: Post-release version suffix added.
* configure.ac (AC_CONFIG_MACRO_DIR), Makefile.am (ACLOCAL_AMFLAGS):
Add m4 dir as automake includes, as required by the new libtool.
[Thanks cwt for the report and test.]
2009-04-05 Theppitak Karoonboonyanan <thep@linux.thai.net>
* configure.ac: Bump library revision.
* NEWS, configure.ac:
=== Version 0.2.1 ===
2009-04-05 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie-0.2.pc.in: Remove blank Requires: line.
2009-04-03 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/alpha-map.h, datrie/trie.h: Revise documentation.
2009-04-03 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/fileutils.h, datrie/fileutils.c
(make_full_path, file_open, file_length): Remove unused codes.
* datrie/triedefs.h (TrieIOMode): Remove unused typedef.
2009-04-01 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/Makefile.am, datrie/libdatrie.def -> datrie/libdatrie.map:
Replace libtool symbol exports with symbol versioning, to ease
upgrading across SONAME.
2009-03-31 Theppitak Karoonboonyanan <thep@linux.thai.net>
Fix gcc warnings.
* tools/trietool.c (conv_to_alpha): Cast 'out_p' pointer before
comparing.
* tools/trietool.c (command_add_list, command_delete_list):
Make sure 'saved_conv' is initialized before use.
* datrie/trie.c (trie_new_from_file): Remove unused 'alt_map' var.
2009-03-31 Theppitak Karoonboonyanan <thep@linux.thai.net>
* configura.ac: Post-release version suffix added.
* datrie/trie.h (trie_save): Document parameter 'path'.
* doc/Doxygen.in: Update format to doxygen 1.5.8.
2009-03-24 Theppitak Karoonboonyanan <thep@linux.thai.net>
* NEWS, configure.ac:
=== Version 0.2.0 ===
2009-03-24 Theppitak Karoonboonyanan <thep@linux.thai.net>
* Makefile.am, +README.migration:
Add migration documentation.
2008-12-29 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/alpha-map.c (alpha_map_char_to_trie, alpha_map_trie_to_char):
Tighten the loop for more readability, plus eliminating one duplicated
check.
2008-12-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/datrie.c (da_get_base, da_get_check, da_set_base,
da_set_check)):
Revert lower bound checks. It's no use checking too much for internal
code.
2008-12-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/trie.h, datrie/trie.c, datrie/libdatrie.def
(trie_state_is_leaf, +trie_state_is_single):
- Introduce a new state condition: single. A single state is a state
in a single path, with no other branch til its leaf.
- Redefine trie_state_is_leaf() as a macro based on it and
trie_state_is_terminal().
2008-12-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/trie.h, datrie/trie.c, datrie/libdatrie.def (trie_state_copy):
Add a new API function for trie state reuse support.
2008-12-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
* tools/trietool.c (conv_to_alpha): Use 'unsigned char' instead of
'uint8'. Better not tie to datrie internal notations too much.
2008-12-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
* configure.ac: Post-release version bump.
* tools/trietool.c (conv_to_alpha): Use uint8 to access data bytes
instead of char, to fix char signedness bug.
2008-12-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
* NEWS, configure.ac:
=== Version 0.1.99.2 ===
2008-12-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
* man/Makefile.am, man/trietool.1 -> man/trietool-0.2.1:
Rename 'trietool' man page to 'trietool-0.2', according to the
corrsponding binary.
2008-12-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
* tools/Makefile.am: Rename 'trietool' program to 'trietool-0.2',
to allow co-existence with datrie 0.1.x.
2008-12-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/darray.c (da_read):
* datrie/tail.c (tail_read):
Restore file pointer on signature check failure.
2008-12-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
* man/trietool.1: Document that no more than 255 alphabets are allowed.
2008-12-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
Ensure that ranges in AlphaMap are always sorted and don't overlap.
* datrie/alpha-map.c (struct _AlphaMap, alpha_map_new):
- Remove 'last_range' member
* datrie/alpha-map.c (alpha_map_add_range):
- Check if the new range overlaps existing ranges and merge them
as necessary.
2008-12-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
* configure.ac: Post-release version bump.
* configure.ac, Makefile.am, datrie.pc.in -> datrie-0.2.pc.in:
Rename pkg-config file, to allow co-existence with datrie 0.1.x.
2008-12-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
* NEWS, configure.ac:
=== Version 0.1.99.1 ===
2008-12-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
* man/trietool.1: Update document
- Trie is now stored in a single '*.tri' file
- The alphabet map is renamed from '*.sbm' to '*.abm'
- Mention Unicode, instead of single-byte character domain
- Document the options for 'add-list' and 'delete-list' commands
- Adjust troff formatting commands
2008-12-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
* tools/trietool.c (prepare_trie):
- Try to read alphabet map from '*.abm' instead of '*.sbm'
2008-12-11 Theppitak Karoonboonyanan <thep@linux.thai.net>
Allow specifying character encoding for word list file.
* tools/trietool.c (command_add_list, command_delete_list):
- Add '-e|--encoding ENC' option which temporarily override locale's
codeset for character conversion
* tools/trietool.c (usage):
- Update usage message accordingly
2008-12-09 Theppitak Karoonboonyanan <thep@linux.thai.net>
Use const where possible + general clean-ups.
* datrie/alpha-map-private.h, datrie/alpha-map.c (alpha_map_write_bin):
* datrie/alpha-map.h, datrie/alpha-map.c (alpha_map_clone):
* datrie/alpha-map.c (alpha_map_get_total_ranges):
- Accept (const AlphaMap *) arg
* datrie/alpha-map.c (alpha_map_char_to_trie_str):
- Rename 'alphabet_str' to 'trie_str', to be more sensible
* datrie/darray.h, datrie/darray.c (da_write, da_walk, da_enumerate):
* datrie/darray.c
(da_output_symbols, da_get_state_key, da_enumerate_recursive):
- Accept (const DArray *) arg
* datrie/darray.h, datrie/darray.c (da_free):
- Made void function, instead of int
* datrie/darray.c (da_new):
- Set CHECK[0] = d->num_cells, to be more clear
* datrie/darray.c (da_write, da_extend_pool):
- Update CHECK[0] whenever DArray::num_cells is changed, instead of
just setting it before writing; so da_write() can now accept
(const DArray *) arg
* datrie/tail.h, datrie/tail.c
(tail_write, tail_get_data, tail_walk_str, tail_walk_char):
- Accept (const Tail *) arg
* datrie/tail.h, datrie/tail.c (tail_free):
- Made void function, instead of int
* datrie/trie.c (struct _TrieState, struct _TrieEnumData):
- 'trie' member is now const pointer
* datrie/trie.h, datrie/trie.c
(trie_new, trie_is_dirty, trie_retrieve, trie_enumerate, trie_root):
* datrie/trie.c (trie_state_new):
- Accept (const Trie *) arg
2008-12-09 Theppitak Karoonboonyanan <thep@linux.thai.net>
Unicode (UCS-4) character support.
* datrie/triedefs.h (AlphaChar):
- unsigned char -> uint32
* datrie/alpha-map.h, datrie/alpha-map.c, datrie/libdatrie.def:
- Export alpha_char_strlen() utility routine
* tools/trietool.c
(ProgEnv, init_conv, conv_to_alpha, conv_from_alpha, close_conv):
- Add routines for converting characters between locale (LC_CTYPE)
codeset and UCS-4
* tools/trietool.c (main):
- Initialize and close conversion routines
* tools/trietool.c
(command_add, command_add_list, command_delete, command_delete_list,
command_query, list_enum_func, command_list):
- Convert character encodings between I/O and trie
2008-12-09 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/trie.c (trie_retrieve, trie_store):
- Use (AlphaChar *), not (TrieChar *), as key pointer type
2008-12-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/trie.c (trie_retrieve):
- Remove unused var 'len'
- Compare AlphaChar with integer zero rather than '\0'
2008-12-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
Adjust APIs for in-memory trie support.
* datrie/trie.c (struct _Trie):
- Remove 'file' member; now trie is detached from file; file is
closed after loading, and reopened when saving
* datrie/trie.h, datrie/trie.c (trie_new):
- Add public APIs: trie_new(), for non-file usage
- One can still save it to file with trie_save(), BTW
* datrie/trie.h, datrie/trie.c (trie_open, trie_new_from_file):
- Rename trie_open() to trie_new_from_file() and make it accept only
one pathname parameter, instead of separated dir and name
- Alphabet map is now mandatory, rather than optional
* datrie/trie.h, datrie/trie.c (trie_close, trie_free):
- Rename trie_close() to trie_free() and do not bother with saving
any more
* datrie/trie.h, datrie/trie.c (trie_save):
- Accept file path argument and open the file for saving
* datrie/trie.h, datrie/trie.c (trie_is_dirty):
- Add public API: trie_is_dirty() for client to determine whether
saving is needed
* datrie/alpha-map-private.h:
- Separate internal APIs from public
* datrie/alpha-map.h, datrie/alpha-map.c:
- Promote alpha_map_new() and alpha_map_add_range() to public;
they are now needed by trie_new()
- Remove alpha_map_open()
- Add public API: alpha_map_clone()
- Document public APIs
* datrie/darray.h, datrie/darray.c (da_new):
- Add internal API: da_new() needed by trie_new()
- Code migrated from new-file case in da_read()
* datrie/darray.c (da_read):
- No longer handle new file; read failure means an error
* datrie/tail.h, datrie/tail.c (tail_new):
- Add internal API: tail_new() needed by trie_new()
- Code migrated from new-file case in tail_read()
* datrie/tail.c (TAIL_SIGNATURE):
- Update TAIL_SIGNATURE to harmonize with other data parts
* datrie/tail.c (tail_read):
- No longer handle new file; read failure means an error
* tools/trietool.c (prepare_trie, close_trie):
- Add helper function for openning and closing trie
* tools/trietool.c (main):
- Open and close trie with prepare_trie() and close_trie()
* datrie/Makefile.am:
- Install alpha-map.h as public header
- Add alpha-map-private.h to source list
* datrie/libdatrie.def:
- Update exported symbols
2008-12-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
Rename AlphaMap functions to be more logical.
* datrie/alpha-map.c, datrie/alpha-map.h: Rename functions
- alpha_map_char_to_alphabet -> alpha_map_char_to_trie
- alpha_map_alphabet_to_char -> alpha_map_trie_to_char
- alpha_map_char_to_alphabet_str -> alpha_map_char_to_trie_str
- alpha_map_alphabet_to_char_str -> alpha_map_trie_to_char_str
* datrie/trie.c (trie_retrieve, trie_store, trie_delete,
trie_da_enum_func, trie_state_walk, trie_state_is_walkable):
- Call the AlphaMap functions with the new names
2008-12-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
Merge SBTrie alphabet mapping feature into Trie.
* datrie/triedefs.h (AlphaChar):
- Add AlphaChar typedef, as well as ALPHA_CHAR_ERROR macro
(moved from UniChar type in datrie/alpha-map.h)
* datrie/alpha-map.c (alpha_char_strlen):
- Add string length function for alphabet string
* datrie/alpha-map.c (struct _AlphaRange):
- Use AlphaChar type instead of UniChar for begin, end members
* datrie/alpha-map.c (alpha_map_get_total_ranges):
- Add range count private method
* datrie/alpha-map.c (alpha_map_add_range):
- Add private method for adding range (refactored from
alpha_map_open())
* datrie/alpha-map.c (alpha_map_open):
- Call alpha_map_add_range() to add range, instead of doing low-level
code
* datrie/alpha-map.c, datrie/alpha-map.h
(alpha_map_read_bin, alpha_map_write_bin):
- Add methods for binary format I/O
* datrie/alpha-map.c, datrie/alpha-map.h
(alpha_map_char_to_alphabet, alpha_map_alphabet_to_char):
- Accept and return AlphaChar, instead of UniChar
* datrie/alpha-map.c, datrie/alpha-map.h
(alpha_map_char_to_alphabet_str, alpha_map_alphabet_to_char_str):
- Add public methods for mapping strings (migrated from
sb_map_char_to_alphabet_str and sb_map_alphabet_to_char_str in
datrie/sb-trie.c)
* datrie/trie.c (struct _Trie):
- Add alpha_map member
* datrie/trie.c (trie_open):
- Add code to read AlphaMap data block, and prefer text-formatted
*.sbm if exists
- Defer Trie object allocation to after file openning
* datrie/trie.c (trie_close):
- Free alpha_map member
* datrie/trie.c (trie_save):
- Add code to write AlphaMap data block
* datrie/trie.c, datrie/trie.h (trie_retrieve, trie_store, trie_delete,
trie_da_enum_func, trie_state_walk, trie_state_is_walkable):
- Adjust function prototypes to accept AlphaChar instead of TrieChar
- Add mapping between alphabet and trie character code
* datrie/trie.h (TrieEnumFunc):
- Adjust function typedef to accept AlphaChar instead of TrieChar
* datrie/Makefile.am:
- Remove sb-trie.c and sb-trie.h from source/header list
* datrie/libdatrie.def:
- Remove sb_trie symbols
* tools/trietool.c:
- Call trie_* functions instead of sb_trie_*
2008-12-03 Theppitak Karoonboonyanan <thep@linux.thai.net>
Adjust file format by catenating *.br and *.tl data into a single
*.tri file.
* datrie/trie.c (struct _Trie):
- Add 'file' and 'is_dirty' members
* datrie/trie.c (trie_open):
- Open the file and call da_read() and tail_read() to load data
portions, instead of openning separate files
* datrie/trie.c (trie_close):
- Do the saving stuff and free DArray and Tail data, instead of
separately closing them; then finally close the file
* datrie/trie.c (trie_save):
- Write file portions with da_write() and tail_write() instead of
saving to separate files
- Handle the 'is_dirty' stuffs
* datrie/trie.c (trie_store, trie_branch_in_branch, trie_delete):
- Set the 'is_dirty' flag
* datrie/darray.h: Change prototypes for internal APIs whose
functionalities are to be reduced:
- da_open(path, name, mode) -> da_read(FILE*)
- da_close(DArray*) -> da_free(DArray*)
- da_save(DArray*) -> da_write(DArray*, FILE*)
* datrie/darray.c (struct_DArray):
- Drop 'file' and 'is_dirty' members
* datrie/darray.c (da_open -> da_read):
- Accept (FILE *) argument and drop file openning/closing codes
- Store number of cells at CHECK[0], so double-array data size can
determined without depending on file size
- Do not allocate DArray object until needed
- Drop 'is_dirty' stuffs
* datrie/darray.c (da_close -> da_free):
- Remove file stuffs; just free memory
* datrie/darray.c (da_save -> da_write):
- Accept (FILE *) argument and use it instead of DArray::file
- Ensure CHECK[0] stores the number of cells
- Drop 'is_dirty' stuffs
* datrie/darray.c (da_set_base, da_set_check):
- Drop 'is_dirty' stuffs
* datrie/tail.h: Change prototypes for internal APIs whose
functionalities are to be reduced:
- tail_open(path, name, mode) -> tail_read(FILE*)
- tail_close(Tail*) -> tail_free(Tail*)
- tail_save(Tail*) -> tail_write(Tail*, FILE*)
* datrie/tail.c (struct _Tail):
- Drop 'file' and 'is_dirty' members
* datrie/tail.c (tail_open -> tail_read):
- Accept (FILE *) argument and drop file openning/closing codes
- Check for new file from read failure, rather than file size
- Do not allocate Tail object until needed
- Drop 'is_dirty' stuffs
* datrie/tail.c (tail_close -> tail_free):
- Remove file stuffs; just free memory
* datrie/tail.c (tail_save -> tail_write):
- Accept (FILE *) argument and use it instead of Tail::file
- Drop 'is_dirty' stuffs
* datrie/tail.c (tail_set_suffix, tail_set_data, tail_free_block):
- Drop 'is_dirty' stuffs
2008-12-01 Theppitak Karoonboonyanan <thep@linux.thai.net>
Get rid of the weird TrieIndexInt intermediate type, by checking
ranges instead. (Changes merged from r_0_1_x-branch)
* datrie/darray.c: Remove typedef for TrieIndexInt.
* datrie/darray.c (da_check_free_cell, da_extend_pool):
- Accept normal TrieIndex arg instead of TrieIndexInt
* datrie/datrie.c (da_insert_branch):
- Define 'base', 'next' vars as TrieIndex instead of TrieIndexInt
- Check overflow for 'next' before checking if the cell is free
* datrie/datrie.c (da_find_free_base):
- Define 's' var as TrieIndex instead of TrieIndexInt
* datrie/datrie.c (da_fit_symbols):
- Check overflow for (base + sym) before checking if the cell is free
* datrie/datrie.c (da_get_base, da_get_check, da_set_base,
da_set_check)):
- Also check lower bound for index range
2008-11-27 Theppitak Karoonboonyanan <thep@linux.thai.net>
First changes to break ABI for larger trie index.
* datrie/triedefs.h: Redefine TrieIndex and TrieData as int32.
Update TRIE_INDEX_MAX accordingly.
* datrie/darray.c (da_open, da_save): Redefine DA_SIGNATURE.
Read/write 32-bit data in headers.
* datrie/darray.c (da_has_children, da_output_symbols,
da_relocate_base):
Declare characters as TrieIndex instead of uint16.
* datrie/tail.c (tail_open, tail_save): Redefine TAIL_SIGNATURE.
Read/write 32-bit data in headers. Use 16-bit length for each block.
* configure.ac: Bump up library version to 1.0.0.
2008-06-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
* man/trietool.1: Use troff .in command to indent text, fixing warning
from 'groff --warnings'. Thanks Debian's lintian.
2008-06-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/tail.c (tail_set_suffix):
* datrie/sb-trie.c (sb_map_char_to_alphabet_str):
Fix GCC warnings about char signedness.
2008-01-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
* configure.in: Bump the library revision.
* NEWS:
=== Version 0.1.3 ===
2008-01-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
* man/trietool.1: Add documentation for the SBM file.
2008-01-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
* README: Fix my name in the reference.
2008-01-10 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/tail.c (tail_set_suffix): Fix bug for the case in which
suffix argument and tail's suffix overlap. Bug report and patch by
shepmaster in http://linux.thai.net/node/102.
2008-01-10 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/sb-trie.c (sb_trie_root): Return NULL pointer, rather than
FALSE. Bug reported by shepmaster in http://linux.thai.net/node/101.
2007-10-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/libdatrie.def: List only symbols in plain format, for Mac
build. Thanks Vee Satayamas for the report.
* datrie/Makefile.am: Add libdatrie.def as libdatrie_la_DEPENDENCIES.
2007-08-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
* doc/Doxyfile.in: Only generate doc for public API.
2007-08-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
* doc/Makefile.am, doc/Doxyfile.in: Revert API man pages generation
and installation. Update Doxyfile format to doxygen 1.5.3.
2007-08-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
* man/trietool.1: Escape some minus signs. Mark a variable italic.
Thanks debian's lintian.
2007-08-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
* configure.ac: Post-release version bump.
2007-08-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
* configure.ac: Bump lib revision.
* NEWS:
=== Version 0.1.2 ===
2007-08-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/Makefile.am, +datrie/trie-private.h (MIN_VAL, MAX_VAL):
Add utility macros.
* datrie/darray.c (da_output_symbols): Adjust loop boundary to be more
overflow-safe.
* "-------------" (da_has_children, da_relocate_base): Apply the same
loop pattern to prevent out-of-range accesses.
2007-08-24 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/darray.c (da_output_symbols): Do not try to test symbols
beyond trie index range. Fixes segfault for trietool list command.
2007-08-19 Theppitak Karoonboonyanan <thep@linux.thai.net>
Handle double array index overflow.
* datrie/triedefs.h (TRIE_INDEX_MAX): Define maximum index value.
* datrie/darray.c (TrieIndexInt): Define type for immediate values, so
overflow can be detected.
* "-------------" (da_extend_pool): Return success/failure status.
Accept TrieIndexInt argument for overflow detection.
* "-------------" (da_check_free_cell): False when extending fails.
Accept TrieIndexInt argument for overflow detection.
* "-------------" (da_find_free_base): Return error on failure.
* "-------------" (da_insert_branch): Return error on failure.
* datrie/trie.c (trie_branch_in_branch, trie_branch_in_tail): Check
for failure from da_insert_branch() and return the status.
* datrie/darray.{c,h} (da_prune_upto, da_prune): Add da_prune_upto(),
for rolling back partial operation in trie_branch_in_branch().
Redefine da_prune() in terms of da_prune_upto().
2007-08-16 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/darray.c (da_open, da_find_free_base): Use DA_POOL_BEGIN
macro instead of hard-coded number. Remove unused DA_EXTENDING_STEPS.
2007-05-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/sb-trie.c (sb_trie_close, sb_trie_save, sb_trie_retrieve,
sb_trie_store, sb_trie_enumerate, sb_trie_root, sb_trie_state_clone,
sb_trie_state_free, sb_trie_state_rewind, sb_trie_state_walk,
sb_trie_state_is_walkable, sb_trie_state_is_terminal,
sb_trie_state_is_leaf, sb_trie_state_get_data):
Guard against NULL pointers in functions. Thanks to Neutron Soutmun
for bug report and initial patch.
2007-04-06 Theppitak Karoonboonyanan <thep@linux.thai.net>
* doc/Makefile.am: Add install-man target. Also install/uninstall
doxygen-generated man pages.
2007-03-27 Theppitak Karoonboonyanan <thep@linux.thai.net>
* configure.ac (LT_CURRENT, LT_REVISION, LT_AGE),
datrie/Makefile.am (libdatrie_la_LDFLAGS), +datrie/libdatrie.def:
Add library version info. Limit exported symbols with -export-symbols
flag. Always pass -no-undefined flag.
* configure.ac: Add Win32 DLL building support.
2006-11-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/fileutils.{c,h} (file_read_int32, file_write_int32): Add
int32 read/write functions.
* datrie/fileutils.c (file_read_int16, file_write_int16): Use unsigned
char buffer instead of and-ing with 0xff, in accordance with int32
functions. (Thanks to Vee Satayamas for suggestion).
2006-10-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
* configure.ac: Post-release version bump.
2006-10-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
* NEWS:
=== Version 0.1.1 ===
2006-10-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
* configure.ac, Makefile.am, +man/Makefile.am, +man/trietool.1:
Add manpage for trietool (moved from debian/).
2006-10-11 Theppitak Karoonboonyanan <thep@linux.thai.net>
Fixed compiler warnings.
* datrie/sb-trie.c (sb_map_alphabet_to_char_str):
* datrie/tail.c (tail_open, tail_save, tail_set_suffix):
* datrie/trie.c (trie_da_enum_func): Cast pointers to get rid of
compiler warnings about char signedness.
* tools/trietool.c (list_enum_func): Return value on exit.
2006-09-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
* configure.ac: Post-release version bump.
2006-09-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
* NEWS, configure.ac:
=== Version 0.1.0 ===
2006-09-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
* README: Filled in.
2006-09-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/triedefs.h, datrie/trie.h, datrie/sb-trie.h: Included headers
using system header forms in installed headers.
* datrie/Makefile.am (INCLUDES): Added include flag to ensure it
compiles without prior installation.
2006-09-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/alpha-map.c (alpha_map_char_to_alphabet,
alpha_map_alphabet_to_char): Made sure terminator is always mapped
with character 0.
2006-09-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/darray.{h,c} (da_is_walkable),
datrie/tail.{h,c} (tail_is_walkable_char): Made the tiny functions
inline (i.e. macros), for tiny performance gain.
2006-09-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/sb-trie.{h,c} (+sb_trie_state_is_walkable): Added walkability
test wrapper.
* datrie/sb-trie.h (sb_trie_state_is_terminal, sb_trie_state_is_leaf),
datrie/trie.h (trie_state_is_terminal, trie_state_is_leaf): Fixed typo
for "\brief" doxygen tag.
2006-09-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/trie.{h,c} (trie_state_is_terminal, +trie_state_is_walkable):
Changed trie_state_is_terminal() into a generic walkability test, and
made itself a specialized macro calling the function.
2006-08-31 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/darray.{h,c} (+da_is_walkable),
datrie/tail.{h,c} (+tail_is_walkable_char),
datrie/trie.c (tail_state_is_terminal): <Optimization> Tested
walkability by peeking, instead of trying with a cloned state.
* datrie/tail.{h,c} (tail_walk_char): Removed redundant const in
parameter.
2006-08-29 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/trie.h, datrie/sb-trie.h: Wrapped extern "C" in public
headers for compiling with C++ code.
2006-08-22 Theppitak Karoonboonyanan <thep@linux.thai.net>
* tools/trietool.c (decode_command): Exited with proper return values.
* tools/trietool.c (command_add_list): Removed warning on missing data
for keys. This would be normal for data-less dictionaries.
2006-08-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/trie.{h,c} (trie_state_rewind),
datrie/sb-trie.{h,c} (sb_trie_state_rewind): Added API to rewind a
trie state to root, so users do not need to reallocate to do so.
2006-08-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/alpha-map.c (alpha_map_open, alpha_map_new): Better used a
dedicated function to initialize the map.
2006-08-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/alpha-map.c (alpha_map_open): Initialized map list before
using. Also skipped mal-formed input lines.
* tools/trietool.c (command_add_list): Removed duplicated return.
2006-08-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
* configure.ac, Makefile.am, +datrie.pc.in: Added pkgconfig file.
2006-08-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/sb-trie.{h,c} (sb_trie_state_is_terminal),
datrie/trie.{h,c} (trie_state_is_terminal, trie_state_is_leaf):
Added API for terminal node check and distinguish it from leaf node.
(Terminal node can be in either branch or tail, while leaf can only
be in tail.)
2006-08-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/Makefile.am (pkginclude_HEADERS): Installed sb-trie.h.
* datrie/sb-trie.h: Fixed file name in doxygen tag.
2006-08-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/Makefile.am, +datrie/alpha-map.{h,c}, +datrie/sb-trie.{h,c}:
Added alphabet map to map between character set and trie alphabet
codes. Also added SBTrie wrapper for 8-bit character sets.
* datrie/triedefs.h (TRIE_CHAR_MAX): Changed to 255, to fit char type.
* datrie/trie.{h,c} (trie_state_walk): Removed unnecessary const in
character argument.
* tools/trietool.c: Used SBTrie instead of plain Trie.
2006-08-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/fileutils.c (file_read_int16): Fixed bitwise calculation. The
second byte should be masked to get rid of possible sign bits
introduced by type conversion.
2006-08-19 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/fileutils.c (file_read_int16, file_write_int16): Used shift
operations to serialize int, eliminating dependency on <arpa/inet.h>.
Thanks Vee Satayamas for the suggestion.
2006-08-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/trie.c (trie_retrieve, trie_store, trie_delete): Always walk
the null-terminator in tail. Otherwise, comparison with shorter key
will terminate at separate node.
2006-08-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/darray.c (find_free_base): Extended pool before getting
exhausted.
* tools/trietool.c (command_add_list): Let tab and comma be field
delimitors, rather than white spaces in general.
* tools/trietool.c (list_enum_func): Do not pad space when printing
key data.
2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
* configure.ac, Makefile.am, +doc/Makefile.am, +doc/Doxyfile.in:
Generated document using doxygen.
2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/darray.c (da_prune, da_num_children -> da_has_children):
Just checked whether a node has at least one child, instead of
counting children and comparing with zero, as a small optimization.
2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
* tools/trietool.c (command_add_list, command_delete_list):
Implemented.
2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/trie.{h,c} (trie_enumerate), datrie/darray.{h,c}
(da_enumerate, da_enumerate_recursive, da_get_state_key): Added key
enumeration method.
* tools/trietool.c (command_list): Implemented.
2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/trie.{h,c} (trie_delete), datrie/darray.{h,c} (da_prune,
da_num_children), datrie/tail.{h,c} (tail_delete): Added key deletion
method.
* datrie/tail.c (tail_save): Guarded against null suffix.
* tools/trietool.c (command_delete): Implemented.
2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/darray.c (da_find_free_base): Made sure the free cell for
first symbol is beyond header cells. Also repeatedly extended the pool
until a free cell is found, in case free list is restarted.
2006-08-16 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/fileutils.c (file_open): Created new file only if it does not
exist.
* datrie/trie.c (trie_branch_in_branch): Also set data for tail block.
* datrie/trie.c (trie_branch_in_tail): Do not free the const suffix
block, fixing double free bug.
* datrie/darray.c (da_insert_branch): Covered the case of negative
base, for branching from a separate node.
* tools/trietool.c (command_add): Removed debug message.
2006-08-16 Theppitak Karoonboonyanan <thep@linux.thai.net>
* configure.ac, Makefile.am, +tools/Makefile.am, +tools/trietool.c:
Added trietool utility.
* datrie/darray.c (da_get_free_list): Fixed typo in macro name.
* datrie/datrie.c (da_extend_pool): Updated num_cells immediately
after realloc(), to let the cell accesses pass boundary checks.
* datrie/tail.c (tail_get_suffix, tail_set_suffix, tail_alloc_block,
tail_free_block, tail_get_data, tail_set_data, tail_walk_str,
tail_walk_char): Started tail blocks indexing from 1 (defined as
TAIL_START_BLOCKNO macro) rather than 0, because we use signed values
to distinguish pointers in darray.
* datrie/tail.{c,h} (tail_get_suffix), datrie/trie.c
(trie_branch_in_tail): Made tail_get_suffix return const pointer.
* datrie/darray.c (da_close, da_save), datrie/tail.c (tail_close,
tail_save): Checked errors and returned appropriate codes.
* datrie/trie.c (trie_open): Checked errors on files openning and
resumed appropriately.
2006-08-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/Makefile.am, +datrie/fileutils.c: Added fileutils.c for
implementation of file utility functions.
* datrie/fileutils.{c,h}, datrie/darray.c (da_open), datrie/tail.c
(tail_open): Adjusted file_read_int{8,16} API so error can be checked.
2006-08-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/Makefile.am, +datrie/tail.c, datrie/tail.h: Added tail.c for
trie suffix implementation. Adjusted some API to not require size_t.
* datrile/fileutils.h: Added more functions required by tail.c.
* datrie/trie.c (trie_branch_in_tail): Added check for null suffix.
2006-08-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
* datrie/Makefile.am, +datrie/darray.c, +datrie/fileutils.h:
Added darray.c for double-array structure implementation, and
fileutils.h declarations for keeping file manipulation functions.
* datrie/triedefs.h: Added TRIE_CHAR_MAX constant for alphabet
enumeration. Changed TRIE_INDEX_ERROR to 0, as negative number has its
own meaning.
2006-08-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
* === First import the project ===
|