1 2018-04-23 Theppitak Karoonboonyanan <theppitak@gmail.com>
4 - Bump library revision to reflect code changes.
9 2018-04-21 Theppitak Karoonboonyanan <theppitak@gmail.com>
11 Fix reported segfault on full-range alpha map
13 * tests/Makefile.am, +tests/test_byte_alpha.c:
15 * datrie/alpha-map.c (alpha_map_recalc_work_area()):
16 - Redeclare trie_last as TrieIndex, to prevent overflow.
18 Thanks Xiao Wang for the report, and @nevermatch for the analysis.
21 https://github.com/tlwg/libdatrie/issues/6
23 2018-03-29 Theppitak Karoonboonyanan <theppitak@gmail.com>
25 Fix trie_state_get_data() at a prefix key
27 When getting data from a state which terminates a key that is
28 a prefix of another key, a terminator should be tried, so it
29 jumps from DA to TAIL, where we can get the data.
31 * tests/Makefile.am, +tests/test_term_state.c:
32 - Add a test case with {'ab', 'abc'} dictionary, which fails previous
33 code when retrieving data for key 'ab'.
34 * datrie/trie.c (trie_state_get_data()):
35 - Instead of simply checking for leaf state, which only caught a state
36 in TAIL, also try walking with a terminator when still in DA.
37 - Replace 'leaf state' with 'terminal state' in documentation,
39 - Also return error on null state pointer.
41 Thanks Filip Pytloun from the pytries project for the initial patch.
43 2017-09-06 Theppitak Karoonboonyanan <theppitak@gmail.com>
45 Revise description about search time complexity
48 - Clarify that search time is O(m), where m is the key length,
49 instead of O(1), while still claim that it's independent of
53 https://github.com/tlwg/libdatrie/issues/4
55 2016-12-14 Theppitak Karoonboonyanan <theppitak@gmail.com>
57 Include git-version-gen in tarball
60 - Add build-aux/git-version-gen to EXTRA_DIST.
62 2016-09-21 Theppitak Karoonboonyanan <theppitak@gmail.com>
64 Fix iconv() return value checking.
66 * tools/trietool.c (conv_to_alpha):
67 - Check iconv() return value against (size_t) -1, rather than
68 for its negativity, as size_t can be unsigned.
70 Thanks Daniel Macks for the report on Issue #3.
71 https://github.com/tlwg/libdatrie/issues/3
73 2016-09-21 Theppitak Karoonboonyanan <theppitak@gmail.com>
75 Use versioning based on Git snapshot.
78 - Add dist-hook to generate VERSION file on tarball generation.
79 * +build-aux/git-version-gen:
80 - Add script to generate version based on 'git describe'
81 if in git tree, or using VERSION file if in release tarball.
83 - Call git-version-gen to get package version.
85 2015-10-20 Theppitak Karoonboonyanan <theppitak@gmail.com>
88 - Bump library revision to reflect code changes.
91 === Version 0.2.10 ===
93 2015-10-13 Theppitak Karoonboonyanan <theppitak@gmail.com>
95 Optimize AlphaMap mapping.
97 alpha_map_char_to_trie() is called everywhere before trie state
98 transition. It's an important bottleneck.
100 We won't change the persistent AlphaMap structure, but will add
101 pre-calculated lookup tables for use at run-time.
103 * datrie/alpha-map.c (struct _AlphaMap):
104 - Add members for alpha-to-trie and trie-to-alpha lookup tables.
105 * datrie/alpha-map.c (alpha_map_new, alpha_map_free):
106 - Initialize & free the tables properly.
107 * datrie/alpha-map.c (alpha_map_add_range -> alpha_map_add_range_only
108 + alpha_map_recalc_work_area):
109 - Split alpha_map_add_range() API into two parts: adding the range
110 as usual and recalculate the lookup tables.
111 * datrie/alpha-map.c (alpha_map_clone, alpha_map_fread_bin):
112 - Call alpha_map_add_range_only() repeatedly before calling
113 alpha_map_recalc_work_area() once.
114 * datrie/alpha-map.c (alpha_map_char_to_trie, alpha_map_trie_to_char):
115 - Look up the pre-calculated tables instead of calculating on
118 This appears to save time by 14.6% for total alpha_char_to_trie()
119 calls and even lower its bottleneck rank by 1 rank on a libthai
120 test case. It reduces 0.2% run time of the total libthai test case.
122 Note that the time saved would be even more in case of multiple
123 uncontinuous alphabet ranges, at the expense of more memory used.
125 2015-08-18 Theppitak Karoonboonyanan <theppitak@gmail.com>
127 Fix doxygen version checking.
130 - Correctly compare doxygen versions. Simple expr comparison
131 didn't work with version 1.8.10.
133 Thanks Petr Gajdos <pgajdos@suse.cz> for the patch.
135 2015-06-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
137 * datrie/tail.c (tail_set_suffix):
138 - Catch strdup() failure.
140 2015-06-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
142 * configure.ac: Post-release version suffix added.
144 2015-05-03 Theppitak Karoonboonyanan <theppitak@gmail.com>
146 * NEWS, configure.ac:
147 === Version 0.2.9 ===
149 2015-05-03 Theppitak Karoonboonyanan <theppitak@gmail.com>
151 Use relative paths for symlinks.
153 * tools/Makefile.am, man/Makefile.am:
154 - Use relative paths for symlinks to avoid confusion in
155 installation with DESTDIR.
157 2015-05-03 Theppitak Karoonboonyanan <theppitak@gmail.com>
159 Also install symlink for old trietool.
162 - Add hooks to install/uninstall symlink for old man page.
164 2015-05-02 Theppitak Karoonboonyanan <theppitak@gmail.com>
167 - Bump library revision to reflect code changes.
169 2015-04-29 Theppitak Karoonboonyanan <theppitak@gmail.com>
171 Bump doxygen required version.
174 - Bump doxygen required version to 1.8.8, according to recent
177 2015-04-21 Theppitak Karoonboonyanan <theppitak@gmail.com>
179 Fix infinite loop on empty trie iteration.
181 * tests/Makefile.am, +tests/test_null_trie.c:
182 - Add test case for empty trie iteration.
184 * datrie/darray.c (da_first_separate):
185 - Fix error condition after loop ending.
187 Thanks Sergei Lebedev <sergei.a.lebedev@gmail.com> for the report
190 Original report: https://github.com/kmike/datrie/issues/17
192 2015-04-12 Theppitak Karoonboonyanan <theppitak@gmail.com>
194 Document about alphabet size.
197 - Add to doc comment a description on the alphabet size limit
198 and the mapped raw codes.
200 Thanks edgehogapp for the suggestion.
201 https://groups.google.com/forum/#!topic/thai-linux-foss-devel/U-O__IfviQ0
203 2015-04-11 Theppitak Karoonboonyanan <theppitak@gmail.com>
205 Clarify Symbols' struct & methods.
207 * datrie/darray.c (struct _Symbols):
208 - Use TRIE_CHAR_MAX + 1 instead of hard-coded value for symbols[]
211 Thanks edgehogapp for the suggestion.
212 https://groups.google.com/forum/#!topic/thai-linux-foss-devel/U-O__IfviQ0
214 * datrie/darray.h, datrie/darray.c (symbols_new, symbols_add):
215 - Hide symbols_new() and symbols_add() for internal use.
217 2015-03-06 Theppitak Karoonboonyanan <theppitak@gmail.com>
222 - Updated for doxygen 1.8.8 with 'doxygen -u'.
224 2015-03-02 Theppitak Karoonboonyanan <theppitak@gmail.com>
226 Catch realloc failure.
228 * datrie/tail.c (tail_alloc_block):
229 - Check realloc() result on t->tails reallocation and return
230 failure code if failed.
231 * datrie/tail.c (tail_add_suffix):
232 - Check return value from tail_alloc_block() and return failure
234 - Update documentation.
236 2015-03-02 Theppitak Karoonboonyanan <theppitak@gmail.com>
238 Catch realloc failure.
240 * datrie/darray.c (da_extend_pool):
241 - Check realloc() result on d->cells reallocation and handle
244 2015-02-27 Theppitak Karoonboonyanan <theppitak@gmail.com>
246 Catch malloc failure.
248 * datrie/tail.c (tail_fread):
249 - Check malloc() result on suffix string and exit properly.
251 2015-02-26 Theppitak Karoonboonyanan <theppitak@gmail.com>
253 More micro-optimization with LIKELY/UNLIKELY.
255 * datrie/alpha-map.c (alpha_map_char_to_trie, alpha_map_trie_to_char):
256 - Use UNLIKELY() when checking for NUL character.
258 2015-02-10 Theppitak Karoonboonyanan <theppitak@gmail.com>
260 Fix 'make distcheck' failure.
263 - Remove doxygen db file on clean.
265 2015-02-10 Theppitak Karoonboonyanan <theppitak@gmail.com>
267 More update of my e-mail address.
270 - Update my e-mail address.
272 2015-02-10 Theppitak Karoonboonyanan <theppitak@gmail.com>
274 Rename trietool-0.2 utility to trietool.
279 - Rename bin target from trietool-0.2 to trietool.
280 - Add hooks to install/uninstall symlink with old name.
281 * man/Makefile.am, man/trietool-0.2.1 -> man/trietool.1:
282 - Rename & update manpage accordingly.
284 2015-02-06 Theppitak Karoonboonyanan <theppitak@gmail.com>
286 Micro-optimize with likely/unlikely hints.
288 * datrie/trie-private.h:
289 - Add LIKELY() and UNLIKELY() macros based on compiler extension.
291 (alpha_map_new, alpha_map_clone, alpha_map_fread_bin,
292 alpha_map_add_range, alpha_map_char_to_trie_str,
293 alpha_map_trie_to_char_str):
295 (symbols_new, da_new, da_fread, da_get_base, da_get_check,
296 da_set_base, da_set_check, da_insert_branch, da_find_free_base,
298 * datrie/dstring.c (dstring_new, dstring_ensure_space):
300 (tail_new, tail_fread, tail_get_suffix, tail_set_suffix,
301 tail_get_data, tail_set_data, tail_walk_str, tail_walk_char):
303 (trie_new, trie_fread, trie_enumerate, trie_state_new,
304 trie_state_walk, trie_state_is_walkable, trie_iterator_new):
305 - Use LIKELY() and UNLIKELY() where it is known to be so, mostly
306 for one-time initialization and failure handling.
307 * datrie/alpha-map.c, datrie/tail.c, datrie/tail.c:
308 - These are the files that need to include trie-private.h
311 Callgrind says it does help speed up a little bit.
313 2015-02-05 Theppitak Karoonboonyanan <theppitak@gmail.com>
315 Disable timestamp in Doxygen-generated doc.
318 - Set HTML_TIMESTAMP to NO to make the document reproducible.
319 (reported by Debian Reproducible)
321 2015-02-01 Theppitak Karoonboonyanan <theppitak@gmail.com>
323 * configure.ac: [Belated] post-release version suffix added.
325 2015-02-01 Theppitak Karoonboonyanan <theppitak@gmail.com>
327 Update my e-mail address everywhere.
329 * AUTHORS, configure.ac, datrie/*.[ch], tests/*.[ch],
331 - Replace all mentionings of my e-mail address with the gmail one.
333 2015-02-01 Theppitak Karoonboonyanan <theppitak@gmail.com>
335 Fix binary file opening on Windows.
337 * datrie/trie.c (trie_new_from_file, trie_save):
338 - Add "b" to fopen() modes, so the binary file is opened properly
341 Thanks phongphan.p for the report and initial patch.
343 2014-01-10 Theppitak Karoonboonyanan <thep@linux.thai.net>
346 - Bump library revision to reflect code changes.
348 * NEWS, configure.ac:
349 === Version 0.2.8 ===
351 2014-01-09 Theppitak Karoonboonyanan <thep@linux.thai.net>
353 Improve documentation.
356 - Refine descriptions of data types.
357 * datrie/trie.c (trie_iterator_new):
358 - Fix typo on trie_root() mentioning.
359 * datrie/trie.c (trie_store, trie_store_if_absent):
361 * datrie/alpha-map.h, datrie/trie.h:
362 - Add detailed description of AlphaMap and Trie types.
364 2014-01-08 Theppitak Karoonboonyanan <thep@linux.thai.net>
366 Clarify message in test_nonalpha.
368 * tests/test_nonalpha.c (main):
369 - Clarify message on false key duplication.
371 2014-01-08 Theppitak Karoonboonyanan <thep@linux.thai.net>
373 Add test on keys with non-alphabet input chars.
375 * tests/Makefile.am, +tests/test_nonalpha.c:
376 - Add test to ensure that operations on keys with non-alphabet
379 2014-01-08 Theppitak Karoonboonyanan <thep@linux.thai.net>
381 Fail trie operations on non-alphabet inputs.
383 alpha_map_char_to_trie() tried to return TRIE_CHAR_MAX to indicate
384 out-of-range error. But this value is indeed valid in trie operations.
385 Doing so could allow false key duplication when different non-alphabet
386 chars and TRIE_CHAR_MAX itself were all mapped to TRIE_CHAR_MAX.
387 So, let's fail all trie operations on non-alphabet input chars.
389 * datrie/alpha-map-private.h, datrie/alpha-map.c
390 (alpha_map_char_to_trie):
391 - Make alpha_map_char_to_trie return TrieIndex type, using
392 TRIE_INDEX_MAX to indicate out-of-range error.
393 This allows TRIE_CHAR_MAX to be returned as a valid output.
394 * datrie/alpha-map.c (alpha_map_char_to_trie_str):
395 - Fail if alpha_map_char_to_trie() returns error code.
396 * datrie/trie.c (trie_retrieve, trie_store_conditionally, trie_delete,
397 trie_state_walk, trie_state_is_walkable):
398 - Check return value from alpha_map_char_to_trie() and return
399 failure status on error.
400 - Also cast TrieIndex return values to TrieChar on function calls.
402 Thanks Naoki Youshinaga for the suggestion.
404 2014-01-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
406 Check for NULL result from AlphaMap string funcs.
408 * datrie/trie.c (trie_store_conditionally):
409 - Return failure on NULL alpha_map_char_to_trie_str().
411 2014-01-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
413 Return NULL on allocation errors in AlphaMap funcs.
416 (alpha_map_char_to_trie_str, alpha_map_trie_to_char_str):
417 - Return NULL on malloc() error.
419 2014-01-03 Theppitak Karoonboonyanan <thep@linux.thai.net>
421 Fix edge case with TRIE_CHAR_MAX as TrieChar.
423 The trie input char with value TRIE_CHAR_MAX (255), was always
424 skipped by double-array algorithms. Let's include it.
426 * datrie/darray.c (da_has_children, da_output_symbols,
427 da_relocate_base, da_first_separate, da_next_separate):
428 - Include the last char in trie char iterations.
430 * datrie/darray.c (da_first_separate, da_next_separate):
431 - Declare characters as TrieIndex type instead of TrieChar,
432 to prevent infinite loop due to unsigned char overflow.
434 Thanks Naoki Youshinaga for the report, test case, and analysis.
436 2013-10-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
438 Fix comiler warnings in tests.
440 * tests/test_walk.c (main):
441 - Remove unused var i;
442 - Remove extra printf() args.
443 * tests/test_iterator.c:
444 - Add missing #include for free().
445 * tests/test_walk.c (walk_dict), tests/utils.c (dict_src):
446 - Cast string literals to (AlphaChar *) to fix signedness
449 2013-10-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
451 * configure.ac: Post-release version suffix added.
453 2013-10-22 Theppitak Karoonboonyanan <thep@linux.thai.net>
455 * NEWS, configure.ac:
456 === Version 0.2.7.1 ===
458 2013-10-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
460 * configure.ac: Bump library versioning to reflect API addition.
461 (Change missing in previous release)
463 2013-10-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
465 * configure.ac: Post-release version suffix added.
467 2013-10-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
469 * NEWS, configure.ac:
470 === Version 0.2.7 ===
472 2013-10-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
474 Add missing distributed file.
477 - Add utils.h to distribution.
479 2013-10-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
481 Reorder tests from primitive to applied.
484 - Test walk & iterator before store-retrieve & file.
486 2013-10-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
488 Write a test suite for trie walk.
493 2013-10-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
495 Write a test suite for trie store/retrieval.
497 * tests/utils.h, tests/utils.c (+dict_src_n_entries):
498 - Add function to get total entries in dict_src[].
499 * tests/test_store-retrieve.c (main):
502 2013-10-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
504 Fix messages in test_iterator.
506 * tests/test_iterator.c (main):
507 - s/file/trie/. No file is written or read in this test.
509 2013-10-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
511 Skip further iteration tests if key is NULL.
513 * tests/test_iterator.c (main):
514 - Insert 'continue' if trie_iterator_get_key() returns NULL.
516 2013-10-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
518 Document availibility of alpha_char_strcmp()
520 * datrie/alpha-map.c (alpha_char_strcmp):
521 - Document that it's available since 0.2.7.
523 2013-10-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
525 Write a test for trie iterator.
527 * tests/test_iterator.c:
528 - Write test suite for trie iterator.
530 2013-10-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
532 Add skeleton test suites & a test for file I/O.
534 * configure.ac, Makefile.am, +tests/, +tests/Makefile.am:
535 - Add tests/ dir to the build system.
536 * +tests/utils.h, +tests/utils.c:
537 * +tests/test_file.c:
538 * +tests/test_iterator.c:
539 * +tests/test_store-retrieve.c:
540 * +tests/test_walk.c:
541 - Add skeleton for test suites.
542 * tests/utils.h, tests/utils.c, tests/test_file.c:
543 - Write test suite for file I/O.
545 2013-10-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
547 Add alpha_char_strcmp() API.
549 * datrie/alpha-map.h, datrie/alpha-map.c (+alpha_char_strcmp):
550 - Add alpha_char_strcmp() declaration & body.
551 * datrie/libdatrie.def, datrie/libdatrie.map:
552 - Add alpha_char_strcmp symbols.
554 2013-10-16 Theppitak Karoonboonyanan <thep@linux.thai.net>
556 Add missing info in alpha_map_add_range() doc.
558 * datrie/alpha-map.c (alpha_map_add_range):
559 - Add documentation on return value.
561 2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
563 Fix build for Visual Studio on Windows.
565 * datrie/dstring.c (dstring_append, dstring_append_string,
566 dstring_append_char, dstring_terminate):
567 - Cast (void *) pointers to (char *) before calculating offsets,
570 Thanks Gabi Davar for the report and fix (via Mikhail Korobov
571 <kmike84@gmail.com>).
573 2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
575 Check for doxygen required version.
578 - When doxygen-doc is enabled, also check doxygen version.
580 2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
585 - doxygen no longer ships with the FreeSans font. Just drop it.
587 2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
592 - Updated with 'doxygen -u'.
594 2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
596 Fix compiler warnings.
597 * datrie/trie-string.c (trie_string_append_string):
598 * datrie/trie.c (trie_iterator_get_key):
599 - Cast strlen() args from (const TrieChar *) to (const char *),
600 to fix signedness mismatch warnings.
602 2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
604 Fix automake warnings.
606 * datrie/Makefile.am, tools/Makefile.am:
607 - Replace deprecated INCLUDES with AM_CPPFLAGS.
609 2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
611 * configure.ac: Post-release version suffix added.
613 2013-01-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
615 * NEWS, configure.ac:
616 === Version 0.2.6 ===
618 2013-01-22 Theppitak Karoonboonyanan <thep@linux.thai.net>
620 Use xz compression for release tarball.
623 - Specify "dist-xz no-dist-gzip" options to AM_INIT_AUTOMAKE.
625 2012-08-06 Theppitak Karoonboonyanan <thep@linux.thai.net>
627 Improve AlphaMap range merging.
629 * datrie/alpha-map.c (alpha_map_add_range):
630 - Also try to merge adjacent ranges. Otherwise, adding one by one
631 character will result in linear search on alphabet set.
633 Thanks Mikhail Korobov <kmike84@gmail.com> for the report.
635 2012-08-05 Theppitak Karoonboonyanan <thep@linux.thai.net>
637 Migrate trie_enumerate() to the new TrieIterator.
639 This improves performance by 10%, and recursion stacks are also
642 * datrie/trie.c (trie_enumerate):
643 - Replace da_enumerate() call with TrieIterator loop.
644 * datrie/trie.c (-trie_da_enum_func, -_TrieEnumData):
645 * datrie/darray.h, datrie/darray.c
646 (-da_enumerate, -da_get_transition_key, -DAEnumFunc,
647 -da_enumerate_recursive):
648 - Drop now-unused codes.
650 2012-08-05 Theppitak Karoonboonyanan <thep@linux.thai.net>
652 Optimize key calculation for TrieIterator.
654 * datrie/Makefile.am +datrie/dstring.h +datrie/dstring-private.h
655 +datrie/dstring.c +datrie/trie-string.h +datrie/trie-string.c:
656 - Add dynamic string classes DString and TrieString.
658 - (TrieIterator): Add "key" dynamic trie string member for
659 incrementally gathering the key while iterating.
660 - Initialize "key" member to NULL on construction. Only allocate and
661 free it on branching root states.
662 * datrie/darray.h, datrie/darray.c
663 (da_first_separate, da_next_separate):
664 - Instead of allocating memory for return string, accept a dynamic
665 string object and update it while traversing.
666 * datrie/trie.c (trie_iterator_next):
667 - For branching state, create the "key" dynamic string object on
668 first iteration and pass it to da_first_separate() and
669 da_next_separate() along the iterations.
670 * datrie/trie.c (trie_iterator_get_key):
671 - Replace the total key reconstruction by da_get_transition_key()
672 with simple string catenation of the dynamic "key" and the suffix
674 * datrie/darray.h, datrie/darray.c (da_get_transition_key):
675 - Adjust to use dynamic string instead of total allocation.
676 * datrie/darray.c (da_enumerate_recursive):
677 - Adjust the da_get_transition_key() call accordingly.
679 Thanks Mikhail Korobov <kmike84@gmail.com> for the suggested approach
680 and for profiling check.
682 2012-07-31 Theppitak Karoonboonyanan <thep@linux.thai.net>
684 Add TrieIterator and its operations.
686 * datrie/trie.h, datrie/trie.c
687 (+trie_iterator_new, +trie_iterator_free, +trie_iterator_next,
688 +trie_iterator_get_key, +trie_iterator_get_data):
689 - Add TrieIterator class and its methods.
690 * datrie/libdatrie.def, datrie/libdatrie.map:
691 - Add the new export symbols.
692 * datrie/darray.h, datrie/darray.c
693 (da_get_state_key -> da_get_transition_key):
694 - Adjust da_get_state_key() from getting transition key from root
695 to getting from arbitrary ancestor.
696 * datrie/darray.h, datrie/darray.c
697 (+da_first_separate, +da_next_separate):
698 - Add internal functions for iterating from one separate node to
699 another in double-array structure.
701 Thanks Mikhail Korobov <kmike84@gmail.com> for the use case suggestion.
703 2012-07-30 Theppitak Karoonboonyanan <thep@linux.thai.net>
705 * doc/Doxyfile.in: Upgrade to doxygen 1.8.1.2 format.
707 2012-07-29 Theppitak Karoonboonyanan <thep@linux.thai.net>
709 * datrie/trie.c: Reformat source.
711 2012-07-29 Theppitak Karoonboonyanan <thep@linux.thai.net>
713 * datrie/trie.h, datrie/trie.c (trie_state_walkable_chars):
716 2012-07-27 Theppitak Karoonboonyanan <thep@linux.thai.net>
718 Add new API trie_state_walkable_chars() to allow breadth-first
721 * datrie/darray.h, datrie/darray.c:
722 - Move da_output_symbols() to darray.h, to be called by the new
724 - Move the Symbols class to darray.h, as required by
726 * datrie/trie.h, datrie/trie.c (+trie_state_walkable_chars):
727 - Add the new public function.
728 * datrie/libdatrie.map, datrie/libdatrie.def:
729 - Add the new symbol to export maps.
731 - Update library versioning to reflect API addition.
733 2012-07-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
735 * darray/darray.c (da_has_children): Accept (const DArray *) arg.
737 2012-07-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
739 * datrie/darray.c (da_has_children, da_output_symbols,
741 Calculate max_c candidate using num_cells - base instead of
742 TRIE_INDEX_MAX - base, to prevent more unnecessary loops.
744 2012-07-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
746 * datrie/trie.c (trie_state_get_data):
747 Check if the state is leaf, not just suffix, before getting data.
749 Thanks Mikhail Korobov <kmike84@gmail.com> for the report.
751 2012-07-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
753 * datrie/tail.h, datrie/tail.c:
754 * datrie/alpha-map.c:
755 * datrie/trie.h, datrie/trie.c:
756 * datrie/darray.c: Remove trailing spaces.
758 2012-07-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
760 * datrie/tail.c (tail_get_suffix): Fix function documentation.
762 Thanks Mikhail Korobov <kmike84@gmail.com> for the report.
764 2012-07-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
766 * datrie/darray.c, datrie/tail.c:
767 - Don't include <stdint.h> when compiled with MSVC, as the header is
768 missing there, and SIZE_MAX is provided in some other header.
770 Thanks Mikhail Korobov <kmike84@gmail.com> for the report.
772 2012-07-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
774 * configure.ac: Post-release version suffix added.
776 2011-11-04 Theppitak Karoonboonyanan <thep@linux.thai.net>
778 * NEWS, configure.ac:
779 === Version 0.2.5 ===
781 2011-08-04 Theppitak Karoonboonyanan <thep@linux.thai.net>
783 * datrie/alpha-map.h: Add missing 'extern "C"' for export functions
784 to fix problem with C++ compiler.
785 Thanks Aurimas ÄŒernius <aurisc4@gmail.com> for the patch.
787 2011-03-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
789 * configure.ac: Post-release version suffix added.
790 * datrie/trie.h: Add missing documentation for "user_data" parameter
793 2010-06-30 Theppitak Karoonboonyanan <thep@linux.thai.net>
795 * NEWS, configure.ac:
796 === Version 0.2.4 ===
798 2010-06-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
800 * datrie/alpha-map-private.h, datrie/alpha-map.c:
801 * datrie/darray.h, datrie/darray.c:
802 * datrie/tail.h, datrie/tail.c:
803 * datrie/trie.c (trie_fread, trie_fwrite):
804 Rename *_read() and *_write() functions to *_fread() and *_fwrite(),
805 for consistency with the trie_f{read,write}() function.
807 2010-06-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
809 Add trie_fread() and trie_fwrite() interfaces for reading/writing trie
810 data from an open file. Thanks NIIBE Yutaka <gniibe@fsij.org> for the
813 * datrie/trie.h (trie_fread, trie_fwrite): Add new API declarations.
814 * datrie/trie.c (trie_new_from_file, trie_fread, trie_save,
816 Refactor open file handling of trie_new_from_file() and trie_save()
817 into trie_fread() and trie_fwrite(), and make the old functions
818 do file opening/closing as wrappers to them.
819 * datrie/libdatrie.def, datrie/libdatrie.map: Add symbol exports.
821 2010-06-27 Theppitak Karoonboonyanan <thep@linux.thai.net>
823 * datrie/trie.c (trie_store_if_absent): Document that it's available
825 * datrie/libdatrie.def, datrie/libdatrie.map: Add symbol exports for
826 trie_store_if_absent().
827 * ChangeLog: Fix file locations in previous log.
829 2010-06-24 Theppitak Karoonboonyanan <thep@linux.thai.net>
831 Add trie_store_if_absent() interface to avoid race condition in
832 multi-thread applications. Thanks Dan Searle <dan.searle@censornet.com>
835 * datrie/trie.h (trie_store_if_absent): Add new API declaration.
836 * datrie/trie.c (trie_store_if_absent, trie_store,
837 trie_store_conditionally):
838 Refactor trie_store() into trie_store_conditionally() with extra arg
839 is_overwrite, and make the two public functions mere wrappers to it.
840 * configure.ac: Bump library version according to the added symbol.
842 2010-03-01 Theppitak Karoonboonyanan <thep@linux.thai.net>
844 * datrie/trie.c (trie_save): Do not return before closing file.
845 Thanks to Xu Jiandong for the report.
847 2010-03-01 Theppitak Karoonboonyanan <thep@linux.thai.net>
849 * configure.ac: Post-release version suffix added.
851 2010-02-27 Theppitak Karoonboonyanan <thep@linux.thai.net>
853 * configure.ac: Bump library revision.
854 * NEWS, configure.ac:
855 === Version 0.2.3 ===
857 2010-02-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
859 * datrie/*.h, datrie/*.c: Add my e-mail address to license header.
861 2010-02-24 Theppitak Karoonboonyanan <thep@linux.thai.net>
863 * datrie/*.h, datrie/*.c: Add license header to every source file.
865 2010-02-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
867 Move documentation from *.h to *.c, so libdatrie developers have the
868 doc at hand. Users can still read the doxygen-generated doc BTW.
870 * datrie/alpha-map.h:
871 * datrie/alpha-map.c:
877 * datrie/tail.c: Move doc comments from *.h to *.c.
878 * doc/Doxyfile.in: Add alpha-map.c, trie.c to INPUT.
879 * doc/Makefile.am: Add *.c to doxygen.stamp dependency.
881 2010-02-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
883 * datrie/darray.c (da_read), datrie/tail.c (tail_read):
884 Protect against possible integer overflow on malicious trie file.
886 2010-02-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
888 * configure.ac: Post-release version suffix added.
890 Be more robust against corrupted trie files.
891 * datrie/alpha-map.c (alpha_map_read_bin):
892 * datrie/darray.c (da_read):
893 * datrie/tail.c (tail_read):
894 - Check all returns from file_read_*() and clean up properly on
896 - Adjust existing clean up codes to the new structure
898 2009-04-29 Theppitak Karoonboonyanan <thep@linux.thai.net>
900 * configure.ac: Bump library revision.
901 * NEWS, configure.ac:
902 === Version 0.2.2 ===
904 2009-04-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
906 * configure.ac: Check $datrie_cv_have_version_script against "yes",
907 not "1", so symbol versioning works on GNU ld again.
909 2009-04-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
911 * datrie/trie.c (trie_state_copy): Use bitwise copy instead of
914 2009-04-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
916 * configure.ac: Adjust variable name datrie_cv_have_version_script.
918 2009-04-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
920 Support locale charset query with libcharset, for mac and mingw.
921 [Thanks Beamer User for the report.]
923 * configure.ac: Check for locale_charset() from libiconv and
924 nl_langinfo(CODESET) from libc. If neither is present, ask user to
925 install GNU libiconv.
926 * tools/trietool.c (init_iconv): Use locale_charset() to query locale
927 charset if possible, fall back to nl_langinfo(CODESET) otherwise.
929 2009-04-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
931 Support alternative iconv implemetations.
932 [Thanks cwt for the report.]
934 * configure.ac: Check for GNU libconv or native libiconv if system libc
935 doesn't have iconv().
936 * tools/Makefile.am: Add ICONV_LIBS to linker options.
938 2009-04-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
940 Fall back to libtool for linkers that do not support -version-script.
941 [Thanks bact' for the report. Thanks cwt for the test.]
943 * configure.ac: Check whether linker supports -version-script.
944 * datrie/Makefile.am, +datrie/libdatrie.def:
945 Apply -version-script flag only when linker supports it. Otherwise,
946 fall back to the old method based on libtool -export-symbols flag.
948 2009-04-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
950 * configure.ac: Post-release version suffix added.
951 * configure.ac (AC_CONFIG_MACRO_DIR), Makefile.am (ACLOCAL_AMFLAGS):
952 Add m4 dir as automake includes, as required by the new libtool.
953 [Thanks cwt for the report and test.]
955 2009-04-05 Theppitak Karoonboonyanan <thep@linux.thai.net>
957 * configure.ac: Bump library revision.
958 * NEWS, configure.ac:
959 === Version 0.2.1 ===
961 2009-04-05 Theppitak Karoonboonyanan <thep@linux.thai.net>
963 * datrie-0.2.pc.in: Remove blank Requires: line.
965 2009-04-03 Theppitak Karoonboonyanan <thep@linux.thai.net>
967 * datrie/alpha-map.h, datrie/trie.h: Revise documentation.
969 2009-04-03 Theppitak Karoonboonyanan <thep@linux.thai.net>
971 * datrie/fileutils.h, datrie/fileutils.c
972 (make_full_path, file_open, file_length): Remove unused codes.
973 * datrie/triedefs.h (TrieIOMode): Remove unused typedef.
975 2009-04-01 Theppitak Karoonboonyanan <thep@linux.thai.net>
977 * datrie/Makefile.am, datrie/libdatrie.def -> datrie/libdatrie.map:
978 Replace libtool symbol exports with symbol versioning, to ease
979 upgrading across SONAME.
981 2009-03-31 Theppitak Karoonboonyanan <thep@linux.thai.net>
985 * tools/trietool.c (conv_to_alpha): Cast 'out_p' pointer before
987 * tools/trietool.c (command_add_list, command_delete_list):
988 Make sure 'saved_conv' is initialized before use.
989 * datrie/trie.c (trie_new_from_file): Remove unused 'alt_map' var.
991 2009-03-31 Theppitak Karoonboonyanan <thep@linux.thai.net>
993 * configura.ac: Post-release version suffix added.
995 * datrie/trie.h (trie_save): Document parameter 'path'.
996 * doc/Doxygen.in: Update format to doxygen 1.5.8.
998 2009-03-24 Theppitak Karoonboonyanan <thep@linux.thai.net>
1000 * NEWS, configure.ac:
1001 === Version 0.2.0 ===
1003 2009-03-24 Theppitak Karoonboonyanan <thep@linux.thai.net>
1005 * Makefile.am, +README.migration:
1006 Add migration documentation.
1008 2008-12-29 Theppitak Karoonboonyanan <thep@linux.thai.net>
1010 * datrie/alpha-map.c (alpha_map_char_to_trie, alpha_map_trie_to_char):
1011 Tighten the loop for more readability, plus eliminating one duplicated
1014 2008-12-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1016 * datrie/datrie.c (da_get_base, da_get_check, da_set_base,
1018 Revert lower bound checks. It's no use checking too much for internal
1021 2008-12-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1023 * datrie/trie.h, datrie/trie.c, datrie/libdatrie.def
1024 (trie_state_is_leaf, +trie_state_is_single):
1025 - Introduce a new state condition: single. A single state is a state
1026 in a single path, with no other branch til its leaf.
1027 - Redefine trie_state_is_leaf() as a macro based on it and
1028 trie_state_is_terminal().
1030 2008-12-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
1032 * datrie/trie.h, datrie/trie.c, datrie/libdatrie.def (trie_state_copy):
1033 Add a new API function for trie state reuse support.
1035 2008-12-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
1037 * tools/trietool.c (conv_to_alpha): Use 'unsigned char' instead of
1038 'uint8'. Better not tie to datrie internal notations too much.
1040 2008-12-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
1042 * configure.ac: Post-release version bump.
1044 * tools/trietool.c (conv_to_alpha): Use uint8 to access data bytes
1045 instead of char, to fix char signedness bug.
1047 2008-12-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
1049 * NEWS, configure.ac:
1050 === Version 0.1.99.2 ===
1052 2008-12-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
1054 * man/Makefile.am, man/trietool.1 -> man/trietool-0.2.1:
1055 Rename 'trietool' man page to 'trietool-0.2', according to the
1056 corrsponding binary.
1058 2008-12-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
1060 * tools/Makefile.am: Rename 'trietool' program to 'trietool-0.2',
1061 to allow co-existence with datrie 0.1.x.
1063 2008-12-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
1065 * datrie/darray.c (da_read):
1066 * datrie/tail.c (tail_read):
1067 Restore file pointer on signature check failure.
1069 2008-12-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
1071 * man/trietool.1: Document that no more than 255 alphabets are allowed.
1073 2008-12-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
1075 Ensure that ranges in AlphaMap are always sorted and don't overlap.
1077 * datrie/alpha-map.c (struct _AlphaMap, alpha_map_new):
1078 - Remove 'last_range' member
1079 * datrie/alpha-map.c (alpha_map_add_range):
1080 - Check if the new range overlaps existing ranges and merge them
1083 2008-12-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
1085 * configure.ac: Post-release version bump.
1086 * configure.ac, Makefile.am, datrie.pc.in -> datrie-0.2.pc.in:
1087 Rename pkg-config file, to allow co-existence with datrie 0.1.x.
1089 2008-12-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
1091 * NEWS, configure.ac:
1092 === Version 0.1.99.1 ===
1094 2008-12-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
1096 * man/trietool.1: Update document
1097 - Trie is now stored in a single '*.tri' file
1098 - The alphabet map is renamed from '*.sbm' to '*.abm'
1099 - Mention Unicode, instead of single-byte character domain
1100 - Document the options for 'add-list' and 'delete-list' commands
1101 - Adjust troff formatting commands
1103 2008-12-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
1105 * tools/trietool.c (prepare_trie):
1106 - Try to read alphabet map from '*.abm' instead of '*.sbm'
1108 2008-12-11 Theppitak Karoonboonyanan <thep@linux.thai.net>
1110 Allow specifying character encoding for word list file.
1112 * tools/trietool.c (command_add_list, command_delete_list):
1113 - Add '-e|--encoding ENC' option which temporarily override locale's
1114 codeset for character conversion
1115 * tools/trietool.c (usage):
1116 - Update usage message accordingly
1118 2008-12-09 Theppitak Karoonboonyanan <thep@linux.thai.net>
1120 Use const where possible + general clean-ups.
1122 * datrie/alpha-map-private.h, datrie/alpha-map.c (alpha_map_write_bin):
1123 * datrie/alpha-map.h, datrie/alpha-map.c (alpha_map_clone):
1124 * datrie/alpha-map.c (alpha_map_get_total_ranges):
1125 - Accept (const AlphaMap *) arg
1126 * datrie/alpha-map.c (alpha_map_char_to_trie_str):
1127 - Rename 'alphabet_str' to 'trie_str', to be more sensible
1129 * datrie/darray.h, datrie/darray.c (da_write, da_walk, da_enumerate):
1131 (da_output_symbols, da_get_state_key, da_enumerate_recursive):
1132 - Accept (const DArray *) arg
1133 * datrie/darray.h, datrie/darray.c (da_free):
1134 - Made void function, instead of int
1135 * datrie/darray.c (da_new):
1136 - Set CHECK[0] = d->num_cells, to be more clear
1137 * datrie/darray.c (da_write, da_extend_pool):
1138 - Update CHECK[0] whenever DArray::num_cells is changed, instead of
1139 just setting it before writing; so da_write() can now accept
1140 (const DArray *) arg
1142 * datrie/tail.h, datrie/tail.c
1143 (tail_write, tail_get_data, tail_walk_str, tail_walk_char):
1144 - Accept (const Tail *) arg
1145 * datrie/tail.h, datrie/tail.c (tail_free):
1146 - Made void function, instead of int
1148 * datrie/trie.c (struct _TrieState, struct _TrieEnumData):
1149 - 'trie' member is now const pointer
1150 * datrie/trie.h, datrie/trie.c
1151 (trie_new, trie_is_dirty, trie_retrieve, trie_enumerate, trie_root):
1152 * datrie/trie.c (trie_state_new):
1153 - Accept (const Trie *) arg
1155 2008-12-09 Theppitak Karoonboonyanan <thep@linux.thai.net>
1157 Unicode (UCS-4) character support.
1159 * datrie/triedefs.h (AlphaChar):
1160 - unsigned char -> uint32
1162 * datrie/alpha-map.h, datrie/alpha-map.c, datrie/libdatrie.def:
1163 - Export alpha_char_strlen() utility routine
1166 (ProgEnv, init_conv, conv_to_alpha, conv_from_alpha, close_conv):
1167 - Add routines for converting characters between locale (LC_CTYPE)
1169 * tools/trietool.c (main):
1170 - Initialize and close conversion routines
1172 (command_add, command_add_list, command_delete, command_delete_list,
1173 command_query, list_enum_func, command_list):
1174 - Convert character encodings between I/O and trie
1176 2008-12-09 Theppitak Karoonboonyanan <thep@linux.thai.net>
1178 * datrie/trie.c (trie_retrieve, trie_store):
1179 - Use (AlphaChar *), not (TrieChar *), as key pointer type
1181 2008-12-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
1183 * datrie/trie.c (trie_retrieve):
1184 - Remove unused var 'len'
1185 - Compare AlphaChar with integer zero rather than '\0'
1187 2008-12-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
1189 Adjust APIs for in-memory trie support.
1191 * datrie/trie.c (struct _Trie):
1192 - Remove 'file' member; now trie is detached from file; file is
1193 closed after loading, and reopened when saving
1194 * datrie/trie.h, datrie/trie.c (trie_new):
1195 - Add public APIs: trie_new(), for non-file usage
1196 - One can still save it to file with trie_save(), BTW
1197 * datrie/trie.h, datrie/trie.c (trie_open, trie_new_from_file):
1198 - Rename trie_open() to trie_new_from_file() and make it accept only
1199 one pathname parameter, instead of separated dir and name
1200 - Alphabet map is now mandatory, rather than optional
1201 * datrie/trie.h, datrie/trie.c (trie_close, trie_free):
1202 - Rename trie_close() to trie_free() and do not bother with saving
1204 * datrie/trie.h, datrie/trie.c (trie_save):
1205 - Accept file path argument and open the file for saving
1206 * datrie/trie.h, datrie/trie.c (trie_is_dirty):
1207 - Add public API: trie_is_dirty() for client to determine whether
1210 * datrie/alpha-map-private.h:
1211 - Separate internal APIs from public
1212 * datrie/alpha-map.h, datrie/alpha-map.c:
1213 - Promote alpha_map_new() and alpha_map_add_range() to public;
1214 they are now needed by trie_new()
1215 - Remove alpha_map_open()
1216 - Add public API: alpha_map_clone()
1217 - Document public APIs
1219 * datrie/darray.h, datrie/darray.c (da_new):
1220 - Add internal API: da_new() needed by trie_new()
1221 - Code migrated from new-file case in da_read()
1222 * datrie/darray.c (da_read):
1223 - No longer handle new file; read failure means an error
1225 * datrie/tail.h, datrie/tail.c (tail_new):
1226 - Add internal API: tail_new() needed by trie_new()
1227 - Code migrated from new-file case in tail_read()
1228 * datrie/tail.c (TAIL_SIGNATURE):
1229 - Update TAIL_SIGNATURE to harmonize with other data parts
1230 * datrie/tail.c (tail_read):
1231 - No longer handle new file; read failure means an error
1233 * tools/trietool.c (prepare_trie, close_trie):
1234 - Add helper function for openning and closing trie
1235 * tools/trietool.c (main):
1236 - Open and close trie with prepare_trie() and close_trie()
1238 * datrie/Makefile.am:
1239 - Install alpha-map.h as public header
1240 - Add alpha-map-private.h to source list
1241 * datrie/libdatrie.def:
1242 - Update exported symbols
1244 2008-12-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
1246 Rename AlphaMap functions to be more logical.
1248 * datrie/alpha-map.c, datrie/alpha-map.h: Rename functions
1249 - alpha_map_char_to_alphabet -> alpha_map_char_to_trie
1250 - alpha_map_alphabet_to_char -> alpha_map_trie_to_char
1251 - alpha_map_char_to_alphabet_str -> alpha_map_char_to_trie_str
1252 - alpha_map_alphabet_to_char_str -> alpha_map_trie_to_char_str
1254 * datrie/trie.c (trie_retrieve, trie_store, trie_delete,
1255 trie_da_enum_func, trie_state_walk, trie_state_is_walkable):
1256 - Call the AlphaMap functions with the new names
1258 2008-12-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
1260 Merge SBTrie alphabet mapping feature into Trie.
1262 * datrie/triedefs.h (AlphaChar):
1263 - Add AlphaChar typedef, as well as ALPHA_CHAR_ERROR macro
1264 (moved from UniChar type in datrie/alpha-map.h)
1266 * datrie/alpha-map.c (alpha_char_strlen):
1267 - Add string length function for alphabet string
1268 * datrie/alpha-map.c (struct _AlphaRange):
1269 - Use AlphaChar type instead of UniChar for begin, end members
1270 * datrie/alpha-map.c (alpha_map_get_total_ranges):
1271 - Add range count private method
1272 * datrie/alpha-map.c (alpha_map_add_range):
1273 - Add private method for adding range (refactored from
1275 * datrie/alpha-map.c (alpha_map_open):
1276 - Call alpha_map_add_range() to add range, instead of doing low-level
1278 * datrie/alpha-map.c, datrie/alpha-map.h
1279 (alpha_map_read_bin, alpha_map_write_bin):
1280 - Add methods for binary format I/O
1281 * datrie/alpha-map.c, datrie/alpha-map.h
1282 (alpha_map_char_to_alphabet, alpha_map_alphabet_to_char):
1283 - Accept and return AlphaChar, instead of UniChar
1284 * datrie/alpha-map.c, datrie/alpha-map.h
1285 (alpha_map_char_to_alphabet_str, alpha_map_alphabet_to_char_str):
1286 - Add public methods for mapping strings (migrated from
1287 sb_map_char_to_alphabet_str and sb_map_alphabet_to_char_str in
1290 * datrie/trie.c (struct _Trie):
1291 - Add alpha_map member
1292 * datrie/trie.c (trie_open):
1293 - Add code to read AlphaMap data block, and prefer text-formatted
1295 - Defer Trie object allocation to after file openning
1296 * datrie/trie.c (trie_close):
1297 - Free alpha_map member
1298 * datrie/trie.c (trie_save):
1299 - Add code to write AlphaMap data block
1300 * datrie/trie.c, datrie/trie.h (trie_retrieve, trie_store, trie_delete,
1301 trie_da_enum_func, trie_state_walk, trie_state_is_walkable):
1302 - Adjust function prototypes to accept AlphaChar instead of TrieChar
1303 - Add mapping between alphabet and trie character code
1304 * datrie/trie.h (TrieEnumFunc):
1305 - Adjust function typedef to accept AlphaChar instead of TrieChar
1307 * datrie/Makefile.am:
1308 - Remove sb-trie.c and sb-trie.h from source/header list
1309 * datrie/libdatrie.def:
1310 - Remove sb_trie symbols
1313 - Call trie_* functions instead of sb_trie_*
1315 2008-12-03 Theppitak Karoonboonyanan <thep@linux.thai.net>
1317 Adjust file format by catenating *.br and *.tl data into a single
1320 * datrie/trie.c (struct _Trie):
1321 - Add 'file' and 'is_dirty' members
1322 * datrie/trie.c (trie_open):
1323 - Open the file and call da_read() and tail_read() to load data
1324 portions, instead of openning separate files
1325 * datrie/trie.c (trie_close):
1326 - Do the saving stuff and free DArray and Tail data, instead of
1327 separately closing them; then finally close the file
1328 * datrie/trie.c (trie_save):
1329 - Write file portions with da_write() and tail_write() instead of
1330 saving to separate files
1331 - Handle the 'is_dirty' stuffs
1332 * datrie/trie.c (trie_store, trie_branch_in_branch, trie_delete):
1333 - Set the 'is_dirty' flag
1335 * datrie/darray.h: Change prototypes for internal APIs whose
1336 functionalities are to be reduced:
1337 - da_open(path, name, mode) -> da_read(FILE*)
1338 - da_close(DArray*) -> da_free(DArray*)
1339 - da_save(DArray*) -> da_write(DArray*, FILE*)
1341 * datrie/darray.c (struct_DArray):
1342 - Drop 'file' and 'is_dirty' members
1343 * datrie/darray.c (da_open -> da_read):
1344 - Accept (FILE *) argument and drop file openning/closing codes
1345 - Store number of cells at CHECK[0], so double-array data size can
1346 determined without depending on file size
1347 - Do not allocate DArray object until needed
1348 - Drop 'is_dirty' stuffs
1349 * datrie/darray.c (da_close -> da_free):
1350 - Remove file stuffs; just free memory
1351 * datrie/darray.c (da_save -> da_write):
1352 - Accept (FILE *) argument and use it instead of DArray::file
1353 - Ensure CHECK[0] stores the number of cells
1354 - Drop 'is_dirty' stuffs
1355 * datrie/darray.c (da_set_base, da_set_check):
1356 - Drop 'is_dirty' stuffs
1358 * datrie/tail.h: Change prototypes for internal APIs whose
1359 functionalities are to be reduced:
1360 - tail_open(path, name, mode) -> tail_read(FILE*)
1361 - tail_close(Tail*) -> tail_free(Tail*)
1362 - tail_save(Tail*) -> tail_write(Tail*, FILE*)
1364 * datrie/tail.c (struct _Tail):
1365 - Drop 'file' and 'is_dirty' members
1366 * datrie/tail.c (tail_open -> tail_read):
1367 - Accept (FILE *) argument and drop file openning/closing codes
1368 - Check for new file from read failure, rather than file size
1369 - Do not allocate Tail object until needed
1370 - Drop 'is_dirty' stuffs
1371 * datrie/tail.c (tail_close -> tail_free):
1372 - Remove file stuffs; just free memory
1373 * datrie/tail.c (tail_save -> tail_write):
1374 - Accept (FILE *) argument and use it instead of Tail::file
1375 - Drop 'is_dirty' stuffs
1376 * datrie/tail.c (tail_set_suffix, tail_set_data, tail_free_block):
1377 - Drop 'is_dirty' stuffs
1379 2008-12-01 Theppitak Karoonboonyanan <thep@linux.thai.net>
1381 Get rid of the weird TrieIndexInt intermediate type, by checking
1382 ranges instead. (Changes merged from r_0_1_x-branch)
1384 * datrie/darray.c: Remove typedef for TrieIndexInt.
1385 * datrie/darray.c (da_check_free_cell, da_extend_pool):
1386 - Accept normal TrieIndex arg instead of TrieIndexInt
1387 * datrie/datrie.c (da_insert_branch):
1388 - Define 'base', 'next' vars as TrieIndex instead of TrieIndexInt
1389 - Check overflow for 'next' before checking if the cell is free
1390 * datrie/datrie.c (da_find_free_base):
1391 - Define 's' var as TrieIndex instead of TrieIndexInt
1392 * datrie/datrie.c (da_fit_symbols):
1393 - Check overflow for (base + sym) before checking if the cell is free
1394 * datrie/datrie.c (da_get_base, da_get_check, da_set_base,
1396 - Also check lower bound for index range
1398 2008-11-27 Theppitak Karoonboonyanan <thep@linux.thai.net>
1400 First changes to break ABI for larger trie index.
1402 * datrie/triedefs.h: Redefine TrieIndex and TrieData as int32.
1403 Update TRIE_INDEX_MAX accordingly.
1404 * datrie/darray.c (da_open, da_save): Redefine DA_SIGNATURE.
1405 Read/write 32-bit data in headers.
1406 * datrie/darray.c (da_has_children, da_output_symbols,
1408 Declare characters as TrieIndex instead of uint16.
1409 * datrie/tail.c (tail_open, tail_save): Redefine TAIL_SIGNATURE.
1410 Read/write 32-bit data in headers. Use 16-bit length for each block.
1411 * configure.ac: Bump up library version to 1.0.0.
1413 2008-06-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
1415 * man/trietool.1: Use troff .in command to indent text, fixing warning
1416 from 'groff --warnings'. Thanks Debian's lintian.
1418 2008-06-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
1420 * datrie/tail.c (tail_set_suffix):
1421 * datrie/sb-trie.c (sb_map_char_to_alphabet_str):
1422 Fix GCC warnings about char signedness.
1424 2008-01-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1426 * configure.in: Bump the library revision.
1428 === Version 0.1.3 ===
1430 2008-01-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1432 * man/trietool.1: Add documentation for the SBM file.
1434 2008-01-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1436 * README: Fix my name in the reference.
1438 2008-01-10 Theppitak Karoonboonyanan <thep@linux.thai.net>
1440 * datrie/tail.c (tail_set_suffix): Fix bug for the case in which
1441 suffix argument and tail's suffix overlap. Bug report and patch by
1442 shepmaster in http://linux.thai.net/node/102.
1444 2008-01-10 Theppitak Karoonboonyanan <thep@linux.thai.net>
1446 * datrie/sb-trie.c (sb_trie_root): Return NULL pointer, rather than
1447 FALSE. Bug reported by shepmaster in http://linux.thai.net/node/101.
1449 2007-10-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
1451 * datrie/libdatrie.def: List only symbols in plain format, for Mac
1452 build. Thanks Vee Satayamas for the report.
1454 * datrie/Makefile.am: Add libdatrie.def as libdatrie_la_DEPENDENCIES.
1456 2007-08-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1458 * doc/Doxyfile.in: Only generate doc for public API.
1460 2007-08-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1462 * doc/Makefile.am, doc/Doxyfile.in: Revert API man pages generation
1463 and installation. Update Doxyfile format to doxygen 1.5.3.
1465 2007-08-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
1467 * man/trietool.1: Escape some minus signs. Mark a variable italic.
1468 Thanks debian's lintian.
1470 2007-08-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
1472 * configure.ac: Post-release version bump.
1474 2007-08-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
1476 * configure.ac: Bump lib revision.
1478 === Version 0.1.2 ===
1480 2007-08-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
1482 * datrie/Makefile.am, +datrie/trie-private.h (MIN_VAL, MAX_VAL):
1484 * datrie/darray.c (da_output_symbols): Adjust loop boundary to be more
1486 * "-------------" (da_has_children, da_relocate_base): Apply the same
1487 loop pattern to prevent out-of-range accesses.
1489 2007-08-24 Theppitak Karoonboonyanan <thep@linux.thai.net>
1491 * datrie/darray.c (da_output_symbols): Do not try to test symbols
1492 beyond trie index range. Fixes segfault for trietool list command.
1494 2007-08-19 Theppitak Karoonboonyanan <thep@linux.thai.net>
1496 Handle double array index overflow.
1498 * datrie/triedefs.h (TRIE_INDEX_MAX): Define maximum index value.
1499 * datrie/darray.c (TrieIndexInt): Define type for immediate values, so
1500 overflow can be detected.
1501 * "-------------" (da_extend_pool): Return success/failure status.
1502 Accept TrieIndexInt argument for overflow detection.
1503 * "-------------" (da_check_free_cell): False when extending fails.
1504 Accept TrieIndexInt argument for overflow detection.
1505 * "-------------" (da_find_free_base): Return error on failure.
1506 * "-------------" (da_insert_branch): Return error on failure.
1507 * datrie/trie.c (trie_branch_in_branch, trie_branch_in_tail): Check
1508 for failure from da_insert_branch() and return the status.
1509 * datrie/darray.{c,h} (da_prune_upto, da_prune): Add da_prune_upto(),
1510 for rolling back partial operation in trie_branch_in_branch().
1511 Redefine da_prune() in terms of da_prune_upto().
1513 2007-08-16 Theppitak Karoonboonyanan <thep@linux.thai.net>
1515 * datrie/darray.c (da_open, da_find_free_base): Use DA_POOL_BEGIN
1516 macro instead of hard-coded number. Remove unused DA_EXTENDING_STEPS.
1518 2007-05-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
1520 * datrie/sb-trie.c (sb_trie_close, sb_trie_save, sb_trie_retrieve,
1521 sb_trie_store, sb_trie_enumerate, sb_trie_root, sb_trie_state_clone,
1522 sb_trie_state_free, sb_trie_state_rewind, sb_trie_state_walk,
1523 sb_trie_state_is_walkable, sb_trie_state_is_terminal,
1524 sb_trie_state_is_leaf, sb_trie_state_get_data):
1525 Guard against NULL pointers in functions. Thanks to Neutron Soutmun
1526 for bug report and initial patch.
1528 2007-04-06 Theppitak Karoonboonyanan <thep@linux.thai.net>
1530 * doc/Makefile.am: Add install-man target. Also install/uninstall
1531 doxygen-generated man pages.
1533 2007-03-27 Theppitak Karoonboonyanan <thep@linux.thai.net>
1535 * configure.ac (LT_CURRENT, LT_REVISION, LT_AGE),
1536 datrie/Makefile.am (libdatrie_la_LDFLAGS), +datrie/libdatrie.def:
1537 Add library version info. Limit exported symbols with -export-symbols
1538 flag. Always pass -no-undefined flag.
1540 * configure.ac: Add Win32 DLL building support.
1542 2006-11-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
1544 * datrie/fileutils.{c,h} (file_read_int32, file_write_int32): Add
1545 int32 read/write functions.
1547 * datrie/fileutils.c (file_read_int16, file_write_int16): Use unsigned
1548 char buffer instead of and-ing with 0xff, in accordance with int32
1549 functions. (Thanks to Vee Satayamas for suggestion).
1551 2006-10-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
1553 * configure.ac: Post-release version bump.
1555 2006-10-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
1558 === Version 0.1.1 ===
1560 2006-10-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
1562 * configure.ac, Makefile.am, +man/Makefile.am, +man/trietool.1:
1563 Add manpage for trietool (moved from debian/).
1565 2006-10-11 Theppitak Karoonboonyanan <thep@linux.thai.net>
1567 Fixed compiler warnings.
1569 * datrie/sb-trie.c (sb_map_alphabet_to_char_str):
1570 * datrie/tail.c (tail_open, tail_save, tail_set_suffix):
1571 * datrie/trie.c (trie_da_enum_func): Cast pointers to get rid of
1572 compiler warnings about char signedness.
1574 * tools/trietool.c (list_enum_func): Return value on exit.
1576 2006-09-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
1578 * configure.ac: Post-release version bump.
1580 2006-09-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
1582 * NEWS, configure.ac:
1583 === Version 0.1.0 ===
1585 2006-09-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
1587 * README: Filled in.
1589 2006-09-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
1591 * datrie/triedefs.h, datrie/trie.h, datrie/sb-trie.h: Included headers
1592 using system header forms in installed headers.
1594 * datrie/Makefile.am (INCLUDES): Added include flag to ensure it
1595 compiles without prior installation.
1597 2006-09-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
1599 * datrie/alpha-map.c (alpha_map_char_to_alphabet,
1600 alpha_map_alphabet_to_char): Made sure terminator is always mapped
1603 2006-09-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
1605 * datrie/darray.{h,c} (da_is_walkable),
1606 datrie/tail.{h,c} (tail_is_walkable_char): Made the tiny functions
1607 inline (i.e. macros), for tiny performance gain.
1609 2006-09-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
1611 * datrie/sb-trie.{h,c} (+sb_trie_state_is_walkable): Added walkability
1614 * datrie/sb-trie.h (sb_trie_state_is_terminal, sb_trie_state_is_leaf),
1615 datrie/trie.h (trie_state_is_terminal, trie_state_is_leaf): Fixed typo
1616 for "\brief" doxygen tag.
1618 2006-09-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
1620 * datrie/trie.{h,c} (trie_state_is_terminal, +trie_state_is_walkable):
1621 Changed trie_state_is_terminal() into a generic walkability test, and
1622 made itself a specialized macro calling the function.
1624 2006-08-31 Theppitak Karoonboonyanan <thep@linux.thai.net>
1626 * datrie/darray.{h,c} (+da_is_walkable),
1627 datrie/tail.{h,c} (+tail_is_walkable_char),
1628 datrie/trie.c (tail_state_is_terminal): <Optimization> Tested
1629 walkability by peeking, instead of trying with a cloned state.
1631 * datrie/tail.{h,c} (tail_walk_char): Removed redundant const in
1634 2006-08-29 Theppitak Karoonboonyanan <thep@linux.thai.net>
1636 * datrie/trie.h, datrie/sb-trie.h: Wrapped extern "C" in public
1637 headers for compiling with C++ code.
1639 2006-08-22 Theppitak Karoonboonyanan <thep@linux.thai.net>
1641 * tools/trietool.c (decode_command): Exited with proper return values.
1643 * tools/trietool.c (command_add_list): Removed warning on missing data
1644 for keys. This would be normal for data-less dictionaries.
1646 2006-08-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
1648 * datrie/trie.{h,c} (trie_state_rewind),
1649 datrie/sb-trie.{h,c} (sb_trie_state_rewind): Added API to rewind a
1650 trie state to root, so users do not need to reallocate to do so.
1652 2006-08-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
1654 * datrie/alpha-map.c (alpha_map_open, alpha_map_new): Better used a
1655 dedicated function to initialize the map.
1657 2006-08-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
1659 * datrie/alpha-map.c (alpha_map_open): Initialized map list before
1660 using. Also skipped mal-formed input lines.
1662 * tools/trietool.c (command_add_list): Removed duplicated return.
1664 2006-08-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
1666 * configure.ac, Makefile.am, +datrie.pc.in: Added pkgconfig file.
1668 2006-08-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
1670 * datrie/sb-trie.{h,c} (sb_trie_state_is_terminal),
1671 datrie/trie.{h,c} (trie_state_is_terminal, trie_state_is_leaf):
1672 Added API for terminal node check and distinguish it from leaf node.
1673 (Terminal node can be in either branch or tail, while leaf can only
1676 2006-08-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
1678 * datrie/Makefile.am (pkginclude_HEADERS): Installed sb-trie.h.
1680 * datrie/sb-trie.h: Fixed file name in doxygen tag.
1682 2006-08-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
1684 * datrie/Makefile.am, +datrie/alpha-map.{h,c}, +datrie/sb-trie.{h,c}:
1685 Added alphabet map to map between character set and trie alphabet
1686 codes. Also added SBTrie wrapper for 8-bit character sets.
1688 * datrie/triedefs.h (TRIE_CHAR_MAX): Changed to 255, to fit char type.
1690 * datrie/trie.{h,c} (trie_state_walk): Removed unnecessary const in
1693 * tools/trietool.c: Used SBTrie instead of plain Trie.
1695 2006-08-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
1697 * datrie/fileutils.c (file_read_int16): Fixed bitwise calculation. The
1698 second byte should be masked to get rid of possible sign bits
1699 introduced by type conversion.
1701 2006-08-19 Theppitak Karoonboonyanan <thep@linux.thai.net>
1703 * datrie/fileutils.c (file_read_int16, file_write_int16): Used shift
1704 operations to serialize int, eliminating dependency on <arpa/inet.h>.
1705 Thanks Vee Satayamas for the suggestion.
1707 2006-08-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
1709 * datrie/trie.c (trie_retrieve, trie_store, trie_delete): Always walk
1710 the null-terminator in tail. Otherwise, comparison with shorter key
1711 will terminate at separate node.
1713 2006-08-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
1715 * datrie/darray.c (find_free_base): Extended pool before getting
1718 * tools/trietool.c (command_add_list): Let tab and comma be field
1719 delimitors, rather than white spaces in general.
1721 * tools/trietool.c (list_enum_func): Do not pad space when printing
1724 2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
1726 * configure.ac, Makefile.am, +doc/Makefile.am, +doc/Doxyfile.in:
1727 Generated document using doxygen.
1729 2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
1731 * datrie/darray.c (da_prune, da_num_children -> da_has_children):
1732 Just checked whether a node has at least one child, instead of
1733 counting children and comparing with zero, as a small optimization.
1735 2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
1737 * tools/trietool.c (command_add_list, command_delete_list):
1740 2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
1742 * datrie/trie.{h,c} (trie_enumerate), datrie/darray.{h,c}
1743 (da_enumerate, da_enumerate_recursive, da_get_state_key): Added key
1746 * tools/trietool.c (command_list): Implemented.
1748 2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
1750 * datrie/trie.{h,c} (trie_delete), datrie/darray.{h,c} (da_prune,
1751 da_num_children), datrie/tail.{h,c} (tail_delete): Added key deletion
1754 * datrie/tail.c (tail_save): Guarded against null suffix.
1756 * tools/trietool.c (command_delete): Implemented.
1758 2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
1760 * datrie/darray.c (da_find_free_base): Made sure the free cell for
1761 first symbol is beyond header cells. Also repeatedly extended the pool
1762 until a free cell is found, in case free list is restarted.
1764 2006-08-16 Theppitak Karoonboonyanan <thep@linux.thai.net>
1766 * datrie/fileutils.c (file_open): Created new file only if it does not
1769 * datrie/trie.c (trie_branch_in_branch): Also set data for tail block.
1771 * datrie/trie.c (trie_branch_in_tail): Do not free the const suffix
1772 block, fixing double free bug.
1774 * datrie/darray.c (da_insert_branch): Covered the case of negative
1775 base, for branching from a separate node.
1777 * tools/trietool.c (command_add): Removed debug message.
1779 2006-08-16 Theppitak Karoonboonyanan <thep@linux.thai.net>
1781 * configure.ac, Makefile.am, +tools/Makefile.am, +tools/trietool.c:
1782 Added trietool utility.
1784 * datrie/darray.c (da_get_free_list): Fixed typo in macro name.
1786 * datrie/datrie.c (da_extend_pool): Updated num_cells immediately
1787 after realloc(), to let the cell accesses pass boundary checks.
1789 * datrie/tail.c (tail_get_suffix, tail_set_suffix, tail_alloc_block,
1790 tail_free_block, tail_get_data, tail_set_data, tail_walk_str,
1791 tail_walk_char): Started tail blocks indexing from 1 (defined as
1792 TAIL_START_BLOCKNO macro) rather than 0, because we use signed values
1793 to distinguish pointers in darray.
1795 * datrie/tail.{c,h} (tail_get_suffix), datrie/trie.c
1796 (trie_branch_in_tail): Made tail_get_suffix return const pointer.
1798 * datrie/darray.c (da_close, da_save), datrie/tail.c (tail_close,
1799 tail_save): Checked errors and returned appropriate codes.
1801 * datrie/trie.c (trie_open): Checked errors on files openning and
1802 resumed appropriately.
1804 2006-08-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
1806 * datrie/Makefile.am, +datrie/fileutils.c: Added fileutils.c for
1807 implementation of file utility functions.
1809 * datrie/fileutils.{c,h}, datrie/darray.c (da_open), datrie/tail.c
1810 (tail_open): Adjusted file_read_int{8,16} API so error can be checked.
1812 2006-08-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
1814 * datrie/Makefile.am, +datrie/tail.c, datrie/tail.h: Added tail.c for
1815 trie suffix implementation. Adjusted some API to not require size_t.
1817 * datrile/fileutils.h: Added more functions required by tail.c.
1819 * datrie/trie.c (trie_branch_in_tail): Added check for null suffix.
1821 2006-08-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
1823 * datrie/Makefile.am, +datrie/darray.c, +datrie/fileutils.h:
1824 Added darray.c for double-array structure implementation, and
1825 fileutils.h declarations for keeping file manipulation functions.
1827 * datrie/triedefs.h: Added TRIE_CHAR_MAX constant for alphabet
1828 enumeration. Changed TRIE_INDEX_ERROR to 0, as negative number has its
1831 2006-08-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
1833 * === First import the project ===