1 2015-10-20 Theppitak Karoonboonyanan <theppitak@gmail.com>
4 - Bump library revision to reflect code changes.
9 2015-10-13 Theppitak Karoonboonyanan <theppitak@gmail.com>
11 Optimize AlphaMap mapping.
13 alpha_map_char_to_trie() is called everywhere before trie state
14 transition. It's an important bottleneck.
16 We won't change the persistent AlphaMap structure, but will add
17 pre-calculated lookup tables for use at run-time.
19 * datrie/alpha-map.c (struct _AlphaMap):
20 - Add members for alpha-to-trie and trie-to-alpha lookup tables.
21 * datrie/alpha-map.c (alpha_map_new, alpha_map_free):
22 - Initialize & free the tables properly.
23 * datrie/alpha-map.c (alpha_map_add_range -> alpha_map_add_range_only
24 + alpha_map_recalc_work_area):
25 - Split alpha_map_add_range() API into two parts: adding the range
26 as usual and recalculate the lookup tables.
27 * datrie/alpha-map.c (alpha_map_clone, alpha_map_fread_bin):
28 - Call alpha_map_add_range_only() repeatedly before calling
29 alpha_map_recalc_work_area() once.
30 * datrie/alpha-map.c (alpha_map_char_to_trie, alpha_map_trie_to_char):
31 - Look up the pre-calculated tables instead of calculating on
34 This appears to save time by 14.6% for total alpha_char_to_trie()
35 calls and even lower its bottleneck rank by 1 rank on a libthai
36 test case. It reduces 0.2% run time of the total libthai test case.
38 Note that the time saved would be even more in case of multiple
39 uncontinuous alphabet ranges, at the expense of more memory used.
41 2015-08-18 Theppitak Karoonboonyanan <theppitak@gmail.com>
43 Fix doxygen version checking.
46 - Correctly compare doxygen versions. Simple expr comparison
47 didn't work with version 1.8.10.
49 Thanks Petr Gajdos <pgajdos@suse.cz> for the patch.
51 2015-06-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
53 * datrie/tail.c (tail_set_suffix):
54 - Catch strdup() failure.
56 2015-06-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
58 * configure.ac: Post-release version suffix added.
60 2015-05-03 Theppitak Karoonboonyanan <theppitak@gmail.com>
65 2015-05-03 Theppitak Karoonboonyanan <theppitak@gmail.com>
67 Use relative paths for symlinks.
69 * tools/Makefile.am, man/Makefile.am:
70 - Use relative paths for symlinks to avoid confusion in
71 installation with DESTDIR.
73 2015-05-03 Theppitak Karoonboonyanan <theppitak@gmail.com>
75 Also install symlink for old trietool.
78 - Add hooks to install/uninstall symlink for old man page.
80 2015-05-02 Theppitak Karoonboonyanan <theppitak@gmail.com>
83 - Bump library revision to reflect code changes.
85 2015-04-29 Theppitak Karoonboonyanan <theppitak@gmail.com>
87 Bump doxygen required version.
90 - Bump doxygen required version to 1.8.8, according to recent
93 2015-04-21 Theppitak Karoonboonyanan <theppitak@gmail.com>
95 Fix infinite loop on empty trie iteration.
97 * tests/Makefile.am, +tests/test_null_trie.c:
98 - Add test case for empty trie iteration.
100 * datrie/darray.c (da_first_separate):
101 - Fix error condition after loop ending.
103 Thanks Sergei Lebedev <sergei.a.lebedev@gmail.com> for the report
106 Original report: https://github.com/kmike/datrie/issues/17
108 2015-04-12 Theppitak Karoonboonyanan <theppitak@gmail.com>
110 Document about alphabet size.
113 - Add to doc comment a description on the alphabet size limit
114 and the mapped raw codes.
116 Thanks edgehogapp for the suggestion.
117 https://groups.google.com/forum/#!topic/thai-linux-foss-devel/U-O__IfviQ0
119 2015-04-11 Theppitak Karoonboonyanan <theppitak@gmail.com>
121 Clarify Symbols' struct & methods.
123 * datrie/darray.c (struct _Symbols):
124 - Use TRIE_CHAR_MAX + 1 instead of hard-coded value for symbols[]
127 Thanks edgehogapp for the suggestion.
128 https://groups.google.com/forum/#!topic/thai-linux-foss-devel/U-O__IfviQ0
130 * datrie/darray.h, datrie/darray.c (symbols_new, symbols_add):
131 - Hide symbols_new() and symbols_add() for internal use.
133 2015-03-06 Theppitak Karoonboonyanan <theppitak@gmail.com>
138 - Updated for doxygen 1.8.8 with 'doxygen -u'.
140 2015-03-02 Theppitak Karoonboonyanan <theppitak@gmail.com>
142 Catch realloc failure.
144 * datrie/tail.c (tail_alloc_block):
145 - Check realloc() result on t->tails reallocation and return
146 failure code if failed.
147 * datrie/tail.c (tail_add_suffix):
148 - Check return value from tail_alloc_block() and return failure
150 - Update documentation.
152 2015-03-02 Theppitak Karoonboonyanan <theppitak@gmail.com>
154 Catch realloc failure.
156 * datrie/darray.c (da_extend_pool):
157 - Check realloc() result on d->cells reallocation and handle
160 2015-02-27 Theppitak Karoonboonyanan <theppitak@gmail.com>
162 Catch malloc failure.
164 * datrie/tail.c (tail_fread):
165 - Check malloc() result on suffix string and exit properly.
167 2015-02-26 Theppitak Karoonboonyanan <theppitak@gmail.com>
169 More micro-optimization with LIKELY/UNLIKELY.
171 * datrie/alpha-map.c (alpha_map_char_to_trie, alpha_map_trie_to_char):
172 - Use UNLIKELY() when checking for NUL character.
174 2015-02-10 Theppitak Karoonboonyanan <theppitak@gmail.com>
176 Fix 'make distcheck' failure.
179 - Remove doxygen db file on clean.
181 2015-02-10 Theppitak Karoonboonyanan <theppitak@gmail.com>
183 More update of my e-mail address.
186 - Update my e-mail address.
188 2015-02-10 Theppitak Karoonboonyanan <theppitak@gmail.com>
190 Rename trietool-0.2 utility to trietool.
195 - Rename bin target from trietool-0.2 to trietool.
196 - Add hooks to install/uninstall symlink with old name.
197 * man/Makefile.am, man/trietool-0.2.1 -> man/trietool.1:
198 - Rename & update manpage accordingly.
200 2015-02-06 Theppitak Karoonboonyanan <theppitak@gmail.com>
202 Micro-optimize with likely/unlikely hints.
204 * datrie/trie-private.h:
205 - Add LIKELY() and UNLIKELY() macros based on compiler extension.
207 (alpha_map_new, alpha_map_clone, alpha_map_fread_bin,
208 alpha_map_add_range, alpha_map_char_to_trie_str,
209 alpha_map_trie_to_char_str):
211 (symbols_new, da_new, da_fread, da_get_base, da_get_check,
212 da_set_base, da_set_check, da_insert_branch, da_find_free_base,
214 * datrie/dstring.c (dstring_new, dstring_ensure_space):
216 (tail_new, tail_fread, tail_get_suffix, tail_set_suffix,
217 tail_get_data, tail_set_data, tail_walk_str, tail_walk_char):
219 (trie_new, trie_fread, trie_enumerate, trie_state_new,
220 trie_state_walk, trie_state_is_walkable, trie_iterator_new):
221 - Use LIKELY() and UNLIKELY() where it is known to be so, mostly
222 for one-time initialization and failure handling.
223 * datrie/alpha-map.c, datrie/tail.c, datrie/tail.c:
224 - These are the files that need to include trie-private.h
227 Callgrind says it does help speed up a little bit.
229 2015-02-05 Theppitak Karoonboonyanan <theppitak@gmail.com>
231 Disable timestamp in Doxygen-generated doc.
234 - Set HTML_TIMESTAMP to NO to make the document reproducible.
235 (reported by Debian Reproducible)
237 2015-02-01 Theppitak Karoonboonyanan <theppitak@gmail.com>
239 * configure.ac: [Belated] post-release version suffix added.
241 2015-02-01 Theppitak Karoonboonyanan <theppitak@gmail.com>
243 Update my e-mail address everywhere.
245 * AUTHORS, configure.ac, datrie/*.[ch], tests/*.[ch],
247 - Replace all mentionings of my e-mail address with the gmail one.
249 2015-02-01 Theppitak Karoonboonyanan <theppitak@gmail.com>
251 Fix binary file opening on Windows.
253 * datrie/trie.c (trie_new_from_file, trie_save):
254 - Add "b" to fopen() modes, so the binary file is opened properly
257 Thanks phongphan.p for the report and initial patch.
259 2014-01-10 Theppitak Karoonboonyanan <thep@linux.thai.net>
262 - Bump library revision to reflect code changes.
264 * NEWS, configure.ac:
265 === Version 0.2.8 ===
267 2014-01-09 Theppitak Karoonboonyanan <thep@linux.thai.net>
269 Improve documentation.
272 - Refine descriptions of data types.
273 * datrie/trie.c (trie_iterator_new):
274 - Fix typo on trie_root() mentioning.
275 * datrie/trie.c (trie_store, trie_store_if_absent):
277 * datrie/alpha-map.h, datrie/trie.h:
278 - Add detailed description of AlphaMap and Trie types.
280 2014-01-08 Theppitak Karoonboonyanan <thep@linux.thai.net>
282 Clarify message in test_nonalpha.
284 * tests/test_nonalpha.c (main):
285 - Clarify message on false key duplication.
287 2014-01-08 Theppitak Karoonboonyanan <thep@linux.thai.net>
289 Add test on keys with non-alphabet input chars.
291 * tests/Makefile.am, +tests/test_nonalpha.c:
292 - Add test to ensure that operations on keys with non-alphabet
295 2014-01-08 Theppitak Karoonboonyanan <thep@linux.thai.net>
297 Fail trie operations on non-alphabet inputs.
299 alpha_map_char_to_trie() tried to return TRIE_CHAR_MAX to indicate
300 out-of-range error. But this value is indeed valid in trie operations.
301 Doing so could allow false key duplication when different non-alphabet
302 chars and TRIE_CHAR_MAX itself were all mapped to TRIE_CHAR_MAX.
303 So, let's fail all trie operations on non-alphabet input chars.
305 * datrie/alpha-map-private.h, datrie/alpha-map.c
306 (alpha_map_char_to_trie):
307 - Make alpha_map_char_to_trie return TrieIndex type, using
308 TRIE_INDEX_MAX to indicate out-of-range error.
309 This allows TRIE_CHAR_MAX to be returned as a valid output.
310 * datrie/alpha-map.c (alpha_map_char_to_trie_str):
311 - Fail if alpha_map_char_to_trie() returns error code.
312 * datrie/trie.c (trie_retrieve, trie_store_conditionally, trie_delete,
313 trie_state_walk, trie_state_is_walkable):
314 - Check return value from alpha_map_char_to_trie() and return
315 failure status on error.
316 - Also cast TrieIndex return values to TrieChar on function calls.
318 Thanks Naoki Youshinaga for the suggestion.
320 2014-01-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
322 Check for NULL result from AlphaMap string funcs.
324 * datrie/trie.c (trie_store_conditionally):
325 - Return failure on NULL alpha_map_char_to_trie_str().
327 2014-01-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
329 Return NULL on allocation errors in AlphaMap funcs.
332 (alpha_map_char_to_trie_str, alpha_map_trie_to_char_str):
333 - Return NULL on malloc() error.
335 2014-01-03 Theppitak Karoonboonyanan <thep@linux.thai.net>
337 Fix edge case with TRIE_CHAR_MAX as TrieChar.
339 The trie input char with value TRIE_CHAR_MAX (255), was always
340 skipped by double-array algorithms. Let's include it.
342 * datrie/darray.c (da_has_children, da_output_symbols,
343 da_relocate_base, da_first_separate, da_next_separate):
344 - Include the last char in trie char iterations.
346 * datrie/darray.c (da_first_separate, da_next_separate):
347 - Declare characters as TrieIndex type instead of TrieChar,
348 to prevent infinite loop due to unsigned char overflow.
350 Thanks Naoki Youshinaga for the report, test case, and analysis.
352 2013-10-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
354 Fix comiler warnings in tests.
356 * tests/test_walk.c (main):
357 - Remove unused var i;
358 - Remove extra printf() args.
359 * tests/test_iterator.c:
360 - Add missing #include for free().
361 * tests/test_walk.c (walk_dict), tests/utils.c (dict_src):
362 - Cast string literals to (AlphaChar *) to fix signedness
365 2013-10-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
367 * configure.ac: Post-release version suffix added.
369 2013-10-22 Theppitak Karoonboonyanan <thep@linux.thai.net>
371 * NEWS, configure.ac:
372 === Version 0.2.7.1 ===
374 2013-10-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
376 * configure.ac: Bump library versioning to reflect API addition.
377 (Change missing in previous release)
379 2013-10-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
381 * configure.ac: Post-release version suffix added.
383 2013-10-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
385 * NEWS, configure.ac:
386 === Version 0.2.7 ===
388 2013-10-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
390 Add missing distributed file.
393 - Add utils.h to distribution.
395 2013-10-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
397 Reorder tests from primitive to applied.
400 - Test walk & iterator before store-retrieve & file.
402 2013-10-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
404 Write a test suite for trie walk.
409 2013-10-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
411 Write a test suite for trie store/retrieval.
413 * tests/utils.h, tests/utils.c (+dict_src_n_entries):
414 - Add function to get total entries in dict_src[].
415 * tests/test_store-retrieve.c (main):
418 2013-10-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
420 Fix messages in test_iterator.
422 * tests/test_iterator.c (main):
423 - s/file/trie/. No file is written or read in this test.
425 2013-10-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
427 Skip further iteration tests if key is NULL.
429 * tests/test_iterator.c (main):
430 - Insert 'continue' if trie_iterator_get_key() returns NULL.
432 2013-10-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
434 Document availibility of alpha_char_strcmp()
436 * datrie/alpha-map.c (alpha_char_strcmp):
437 - Document that it's available since 0.2.7.
439 2013-10-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
441 Write a test for trie iterator.
443 * tests/test_iterator.c:
444 - Write test suite for trie iterator.
446 2013-10-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
448 Add skeleton test suites & a test for file I/O.
450 * configure.ac, Makefile.am, +tests/, +tests/Makefile.am:
451 - Add tests/ dir to the build system.
452 * +tests/utils.h, +tests/utils.c:
453 * +tests/test_file.c:
454 * +tests/test_iterator.c:
455 * +tests/test_store-retrieve.c:
456 * +tests/test_walk.c:
457 - Add skeleton for test suites.
458 * tests/utils.h, tests/utils.c, tests/test_file.c:
459 - Write test suite for file I/O.
461 2013-10-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
463 Add alpha_char_strcmp() API.
465 * datrie/alpha-map.h, datrie/alpha-map.c (+alpha_char_strcmp):
466 - Add alpha_char_strcmp() declaration & body.
467 * datrie/libdatrie.def, datrie/libdatrie.map:
468 - Add alpha_char_strcmp symbols.
470 2013-10-16 Theppitak Karoonboonyanan <thep@linux.thai.net>
472 Add missing info in alpha_map_add_range() doc.
474 * datrie/alpha-map.c (alpha_map_add_range):
475 - Add documentation on return value.
477 2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
479 Fix build for Visual Studio on Windows.
481 * datrie/dstring.c (dstring_append, dstring_append_string,
482 dstring_append_char, dstring_terminate):
483 - Cast (void *) pointers to (char *) before calculating offsets,
486 Thanks Gabi Davar for the report and fix (via Mikhail Korobov
487 <kmike84@gmail.com>).
489 2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
491 Check for doxygen required version.
494 - When doxygen-doc is enabled, also check doxygen version.
496 2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
501 - doxygen no longer ships with the FreeSans font. Just drop it.
503 2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
508 - Updated with 'doxygen -u'.
510 2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
512 Fix compiler warnings.
513 * datrie/trie-string.c (trie_string_append_string):
514 * datrie/trie.c (trie_iterator_get_key):
515 - Cast strlen() args from (const TrieChar *) to (const char *),
516 to fix signedness mismatch warnings.
518 2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
520 Fix automake warnings.
522 * datrie/Makefile.am, tools/Makefile.am:
523 - Replace deprecated INCLUDES with AM_CPPFLAGS.
525 2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
527 * configure.ac: Post-release version suffix added.
529 2013-01-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
531 * NEWS, configure.ac:
532 === Version 0.2.6 ===
534 2013-01-22 Theppitak Karoonboonyanan <thep@linux.thai.net>
536 Use xz compression for release tarball.
539 - Specify "dist-xz no-dist-gzip" options to AM_INIT_AUTOMAKE.
541 2012-08-06 Theppitak Karoonboonyanan <thep@linux.thai.net>
543 Improve AlphaMap range merging.
545 * datrie/alpha-map.c (alpha_map_add_range):
546 - Also try to merge adjacent ranges. Otherwise, adding one by one
547 character will result in linear search on alphabet set.
549 Thanks Mikhail Korobov <kmike84@gmail.com> for the report.
551 2012-08-05 Theppitak Karoonboonyanan <thep@linux.thai.net>
553 Migrate trie_enumerate() to the new TrieIterator.
555 This improves performance by 10%, and recursion stacks are also
558 * datrie/trie.c (trie_enumerate):
559 - Replace da_enumerate() call with TrieIterator loop.
560 * datrie/trie.c (-trie_da_enum_func, -_TrieEnumData):
561 * datrie/darray.h, datrie/darray.c
562 (-da_enumerate, -da_get_transition_key, -DAEnumFunc,
563 -da_enumerate_recursive):
564 - Drop now-unused codes.
566 2012-08-05 Theppitak Karoonboonyanan <thep@linux.thai.net>
568 Optimize key calculation for TrieIterator.
570 * datrie/Makefile.am +datrie/dstring.h +datrie/dstring-private.h
571 +datrie/dstring.c +datrie/trie-string.h +datrie/trie-string.c:
572 - Add dynamic string classes DString and TrieString.
574 - (TrieIterator): Add "key" dynamic trie string member for
575 incrementally gathering the key while iterating.
576 - Initialize "key" member to NULL on construction. Only allocate and
577 free it on branching root states.
578 * datrie/darray.h, datrie/darray.c
579 (da_first_separate, da_next_separate):
580 - Instead of allocating memory for return string, accept a dynamic
581 string object and update it while traversing.
582 * datrie/trie.c (trie_iterator_next):
583 - For branching state, create the "key" dynamic string object on
584 first iteration and pass it to da_first_separate() and
585 da_next_separate() along the iterations.
586 * datrie/trie.c (trie_iterator_get_key):
587 - Replace the total key reconstruction by da_get_transition_key()
588 with simple string catenation of the dynamic "key" and the suffix
590 * datrie/darray.h, datrie/darray.c (da_get_transition_key):
591 - Adjust to use dynamic string instead of total allocation.
592 * datrie/darray.c (da_enumerate_recursive):
593 - Adjust the da_get_transition_key() call accordingly.
595 Thanks Mikhail Korobov <kmike84@gmail.com> for the suggested approach
596 and for profiling check.
598 2012-07-31 Theppitak Karoonboonyanan <thep@linux.thai.net>
600 Add TrieIterator and its operations.
602 * datrie/trie.h, datrie/trie.c
603 (+trie_iterator_new, +trie_iterator_free, +trie_iterator_next,
604 +trie_iterator_get_key, +trie_iterator_get_data):
605 - Add TrieIterator class and its methods.
606 * datrie/libdatrie.def, datrie/libdatrie.map:
607 - Add the new export symbols.
608 * datrie/darray.h, datrie/darray.c
609 (da_get_state_key -> da_get_transition_key):
610 - Adjust da_get_state_key() from getting transition key from root
611 to getting from arbitrary ancestor.
612 * datrie/darray.h, datrie/darray.c
613 (+da_first_separate, +da_next_separate):
614 - Add internal functions for iterating from one separate node to
615 another in double-array structure.
617 Thanks Mikhail Korobov <kmike84@gmail.com> for the use case suggestion.
619 2012-07-30 Theppitak Karoonboonyanan <thep@linux.thai.net>
621 * doc/Doxyfile.in: Upgrade to doxygen 1.8.1.2 format.
623 2012-07-29 Theppitak Karoonboonyanan <thep@linux.thai.net>
625 * datrie/trie.c: Reformat source.
627 2012-07-29 Theppitak Karoonboonyanan <thep@linux.thai.net>
629 * datrie/trie.h, datrie/trie.c (trie_state_walkable_chars):
632 2012-07-27 Theppitak Karoonboonyanan <thep@linux.thai.net>
634 Add new API trie_state_walkable_chars() to allow breadth-first
637 * datrie/darray.h, datrie/darray.c:
638 - Move da_output_symbols() to darray.h, to be called by the new
640 - Move the Symbols class to darray.h, as required by
642 * datrie/trie.h, datrie/trie.c (+trie_state_walkable_chars):
643 - Add the new public function.
644 * datrie/libdatrie.map, datrie/libdatrie.def:
645 - Add the new symbol to export maps.
647 - Update library versioning to reflect API addition.
649 2012-07-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
651 * darray/darray.c (da_has_children): Accept (const DArray *) arg.
653 2012-07-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
655 * datrie/darray.c (da_has_children, da_output_symbols,
657 Calculate max_c candidate using num_cells - base instead of
658 TRIE_INDEX_MAX - base, to prevent more unnecessary loops.
660 2012-07-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
662 * datrie/trie.c (trie_state_get_data):
663 Check if the state is leaf, not just suffix, before getting data.
665 Thanks Mikhail Korobov <kmike84@gmail.com> for the report.
667 2012-07-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
669 * datrie/tail.h, datrie/tail.c:
670 * datrie/alpha-map.c:
671 * datrie/trie.h, datrie/trie.c:
672 * datrie/darray.c: Remove trailing spaces.
674 2012-07-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
676 * datrie/tail.c (tail_get_suffix): Fix function documentation.
678 Thanks Mikhail Korobov <kmike84@gmail.com> for the report.
680 2012-07-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
682 * datrie/darray.c, datrie/tail.c:
683 - Don't include <stdint.h> when compiled with MSVC, as the header is
684 missing there, and SIZE_MAX is provided in some other header.
686 Thanks Mikhail Korobov <kmike84@gmail.com> for the report.
688 2012-07-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
690 * configure.ac: Post-release version suffix added.
692 2011-11-04 Theppitak Karoonboonyanan <thep@linux.thai.net>
694 * NEWS, configure.ac:
695 === Version 0.2.5 ===
697 2011-08-04 Theppitak Karoonboonyanan <thep@linux.thai.net>
699 * datrie/alpha-map.h: Add missing 'extern "C"' for export functions
700 to fix problem with C++ compiler.
701 Thanks Aurimas ÄŒernius <aurisc4@gmail.com> for the patch.
703 2011-03-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
705 * configure.ac: Post-release version suffix added.
706 * datrie/trie.h: Add missing documentation for "user_data" parameter
709 2010-06-30 Theppitak Karoonboonyanan <thep@linux.thai.net>
711 * NEWS, configure.ac:
712 === Version 0.2.4 ===
714 2010-06-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
716 * datrie/alpha-map-private.h, datrie/alpha-map.c:
717 * datrie/darray.h, datrie/darray.c:
718 * datrie/tail.h, datrie/tail.c:
719 * datrie/trie.c (trie_fread, trie_fwrite):
720 Rename *_read() and *_write() functions to *_fread() and *_fwrite(),
721 for consistency with the trie_f{read,write}() function.
723 2010-06-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
725 Add trie_fread() and trie_fwrite() interfaces for reading/writing trie
726 data from an open file. Thanks NIIBE Yutaka <gniibe@fsij.org> for the
729 * datrie/trie.h (trie_fread, trie_fwrite): Add new API declarations.
730 * datrie/trie.c (trie_new_from_file, trie_fread, trie_save,
732 Refactor open file handling of trie_new_from_file() and trie_save()
733 into trie_fread() and trie_fwrite(), and make the old functions
734 do file opening/closing as wrappers to them.
735 * datrie/libdatrie.def, datrie/libdatrie.map: Add symbol exports.
737 2010-06-27 Theppitak Karoonboonyanan <thep@linux.thai.net>
739 * datrie/trie.c (trie_store_if_absent): Document that it's available
741 * datrie/libdatrie.def, datrie/libdatrie.map: Add symbol exports for
742 trie_store_if_absent().
743 * ChangeLog: Fix file locations in previous log.
745 2010-06-24 Theppitak Karoonboonyanan <thep@linux.thai.net>
747 Add trie_store_if_absent() interface to avoid race condition in
748 multi-thread applications. Thanks Dan Searle <dan.searle@censornet.com>
751 * datrie/trie.h (trie_store_if_absent): Add new API declaration.
752 * datrie/trie.c (trie_store_if_absent, trie_store,
753 trie_store_conditionally):
754 Refactor trie_store() into trie_store_conditionally() with extra arg
755 is_overwrite, and make the two public functions mere wrappers to it.
756 * configure.ac: Bump library version according to the added symbol.
758 2010-03-01 Theppitak Karoonboonyanan <thep@linux.thai.net>
760 * datrie/trie.c (trie_save): Do not return before closing file.
761 Thanks to Xu Jiandong for the report.
763 2010-03-01 Theppitak Karoonboonyanan <thep@linux.thai.net>
765 * configure.ac: Post-release version suffix added.
767 2010-02-27 Theppitak Karoonboonyanan <thep@linux.thai.net>
769 * configure.ac: Bump library revision.
770 * NEWS, configure.ac:
771 === Version 0.2.3 ===
773 2010-02-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
775 * datrie/*.h, datrie/*.c: Add my e-mail address to license header.
777 2010-02-24 Theppitak Karoonboonyanan <thep@linux.thai.net>
779 * datrie/*.h, datrie/*.c: Add license header to every source file.
781 2010-02-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
783 Move documentation from *.h to *.c, so libdatrie developers have the
784 doc at hand. Users can still read the doxygen-generated doc BTW.
786 * datrie/alpha-map.h:
787 * datrie/alpha-map.c:
793 * datrie/tail.c: Move doc comments from *.h to *.c.
794 * doc/Doxyfile.in: Add alpha-map.c, trie.c to INPUT.
795 * doc/Makefile.am: Add *.c to doxygen.stamp dependency.
797 2010-02-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
799 * datrie/darray.c (da_read), datrie/tail.c (tail_read):
800 Protect against possible integer overflow on malicious trie file.
802 2010-02-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
804 * configure.ac: Post-release version suffix added.
806 Be more robust against corrupted trie files.
807 * datrie/alpha-map.c (alpha_map_read_bin):
808 * datrie/darray.c (da_read):
809 * datrie/tail.c (tail_read):
810 - Check all returns from file_read_*() and clean up properly on
812 - Adjust existing clean up codes to the new structure
814 2009-04-29 Theppitak Karoonboonyanan <thep@linux.thai.net>
816 * configure.ac: Bump library revision.
817 * NEWS, configure.ac:
818 === Version 0.2.2 ===
820 2009-04-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
822 * configure.ac: Check $datrie_cv_have_version_script against "yes",
823 not "1", so symbol versioning works on GNU ld again.
825 2009-04-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
827 * datrie/trie.c (trie_state_copy): Use bitwise copy instead of
830 2009-04-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
832 * configure.ac: Adjust variable name datrie_cv_have_version_script.
834 2009-04-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
836 Support locale charset query with libcharset, for mac and mingw.
837 [Thanks Beamer User for the report.]
839 * configure.ac: Check for locale_charset() from libiconv and
840 nl_langinfo(CODESET) from libc. If neither is present, ask user to
841 install GNU libiconv.
842 * tools/trietool.c (init_iconv): Use locale_charset() to query locale
843 charset if possible, fall back to nl_langinfo(CODESET) otherwise.
845 2009-04-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
847 Support alternative iconv implemetations.
848 [Thanks cwt for the report.]
850 * configure.ac: Check for GNU libconv or native libiconv if system libc
851 doesn't have iconv().
852 * tools/Makefile.am: Add ICONV_LIBS to linker options.
854 2009-04-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
856 Fall back to libtool for linkers that do not support -version-script.
857 [Thanks bact' for the report. Thanks cwt for the test.]
859 * configure.ac: Check whether linker supports -version-script.
860 * datrie/Makefile.am, +datrie/libdatrie.def:
861 Apply -version-script flag only when linker supports it. Otherwise,
862 fall back to the old method based on libtool -export-symbols flag.
864 2009-04-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
866 * configure.ac: Post-release version suffix added.
867 * configure.ac (AC_CONFIG_MACRO_DIR), Makefile.am (ACLOCAL_AMFLAGS):
868 Add m4 dir as automake includes, as required by the new libtool.
869 [Thanks cwt for the report and test.]
871 2009-04-05 Theppitak Karoonboonyanan <thep@linux.thai.net>
873 * configure.ac: Bump library revision.
874 * NEWS, configure.ac:
875 === Version 0.2.1 ===
877 2009-04-05 Theppitak Karoonboonyanan <thep@linux.thai.net>
879 * datrie-0.2.pc.in: Remove blank Requires: line.
881 2009-04-03 Theppitak Karoonboonyanan <thep@linux.thai.net>
883 * datrie/alpha-map.h, datrie/trie.h: Revise documentation.
885 2009-04-03 Theppitak Karoonboonyanan <thep@linux.thai.net>
887 * datrie/fileutils.h, datrie/fileutils.c
888 (make_full_path, file_open, file_length): Remove unused codes.
889 * datrie/triedefs.h (TrieIOMode): Remove unused typedef.
891 2009-04-01 Theppitak Karoonboonyanan <thep@linux.thai.net>
893 * datrie/Makefile.am, datrie/libdatrie.def -> datrie/libdatrie.map:
894 Replace libtool symbol exports with symbol versioning, to ease
895 upgrading across SONAME.
897 2009-03-31 Theppitak Karoonboonyanan <thep@linux.thai.net>
901 * tools/trietool.c (conv_to_alpha): Cast 'out_p' pointer before
903 * tools/trietool.c (command_add_list, command_delete_list):
904 Make sure 'saved_conv' is initialized before use.
905 * datrie/trie.c (trie_new_from_file): Remove unused 'alt_map' var.
907 2009-03-31 Theppitak Karoonboonyanan <thep@linux.thai.net>
909 * configura.ac: Post-release version suffix added.
911 * datrie/trie.h (trie_save): Document parameter 'path'.
912 * doc/Doxygen.in: Update format to doxygen 1.5.8.
914 2009-03-24 Theppitak Karoonboonyanan <thep@linux.thai.net>
916 * NEWS, configure.ac:
917 === Version 0.2.0 ===
919 2009-03-24 Theppitak Karoonboonyanan <thep@linux.thai.net>
921 * Makefile.am, +README.migration:
922 Add migration documentation.
924 2008-12-29 Theppitak Karoonboonyanan <thep@linux.thai.net>
926 * datrie/alpha-map.c (alpha_map_char_to_trie, alpha_map_trie_to_char):
927 Tighten the loop for more readability, plus eliminating one duplicated
930 2008-12-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
932 * datrie/datrie.c (da_get_base, da_get_check, da_set_base,
934 Revert lower bound checks. It's no use checking too much for internal
937 2008-12-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
939 * datrie/trie.h, datrie/trie.c, datrie/libdatrie.def
940 (trie_state_is_leaf, +trie_state_is_single):
941 - Introduce a new state condition: single. A single state is a state
942 in a single path, with no other branch til its leaf.
943 - Redefine trie_state_is_leaf() as a macro based on it and
944 trie_state_is_terminal().
946 2008-12-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
948 * datrie/trie.h, datrie/trie.c, datrie/libdatrie.def (trie_state_copy):
949 Add a new API function for trie state reuse support.
951 2008-12-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
953 * tools/trietool.c (conv_to_alpha): Use 'unsigned char' instead of
954 'uint8'. Better not tie to datrie internal notations too much.
956 2008-12-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
958 * configure.ac: Post-release version bump.
960 * tools/trietool.c (conv_to_alpha): Use uint8 to access data bytes
961 instead of char, to fix char signedness bug.
963 2008-12-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
965 * NEWS, configure.ac:
966 === Version 0.1.99.2 ===
968 2008-12-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
970 * man/Makefile.am, man/trietool.1 -> man/trietool-0.2.1:
971 Rename 'trietool' man page to 'trietool-0.2', according to the
974 2008-12-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
976 * tools/Makefile.am: Rename 'trietool' program to 'trietool-0.2',
977 to allow co-existence with datrie 0.1.x.
979 2008-12-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
981 * datrie/darray.c (da_read):
982 * datrie/tail.c (tail_read):
983 Restore file pointer on signature check failure.
985 2008-12-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
987 * man/trietool.1: Document that no more than 255 alphabets are allowed.
989 2008-12-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
991 Ensure that ranges in AlphaMap are always sorted and don't overlap.
993 * datrie/alpha-map.c (struct _AlphaMap, alpha_map_new):
994 - Remove 'last_range' member
995 * datrie/alpha-map.c (alpha_map_add_range):
996 - Check if the new range overlaps existing ranges and merge them
999 2008-12-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
1001 * configure.ac: Post-release version bump.
1002 * configure.ac, Makefile.am, datrie.pc.in -> datrie-0.2.pc.in:
1003 Rename pkg-config file, to allow co-existence with datrie 0.1.x.
1005 2008-12-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
1007 * NEWS, configure.ac:
1008 === Version 0.1.99.1 ===
1010 2008-12-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
1012 * man/trietool.1: Update document
1013 - Trie is now stored in a single '*.tri' file
1014 - The alphabet map is renamed from '*.sbm' to '*.abm'
1015 - Mention Unicode, instead of single-byte character domain
1016 - Document the options for 'add-list' and 'delete-list' commands
1017 - Adjust troff formatting commands
1019 2008-12-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
1021 * tools/trietool.c (prepare_trie):
1022 - Try to read alphabet map from '*.abm' instead of '*.sbm'
1024 2008-12-11 Theppitak Karoonboonyanan <thep@linux.thai.net>
1026 Allow specifying character encoding for word list file.
1028 * tools/trietool.c (command_add_list, command_delete_list):
1029 - Add '-e|--encoding ENC' option which temporarily override locale's
1030 codeset for character conversion
1031 * tools/trietool.c (usage):
1032 - Update usage message accordingly
1034 2008-12-09 Theppitak Karoonboonyanan <thep@linux.thai.net>
1036 Use const where possible + general clean-ups.
1038 * datrie/alpha-map-private.h, datrie/alpha-map.c (alpha_map_write_bin):
1039 * datrie/alpha-map.h, datrie/alpha-map.c (alpha_map_clone):
1040 * datrie/alpha-map.c (alpha_map_get_total_ranges):
1041 - Accept (const AlphaMap *) arg
1042 * datrie/alpha-map.c (alpha_map_char_to_trie_str):
1043 - Rename 'alphabet_str' to 'trie_str', to be more sensible
1045 * datrie/darray.h, datrie/darray.c (da_write, da_walk, da_enumerate):
1047 (da_output_symbols, da_get_state_key, da_enumerate_recursive):
1048 - Accept (const DArray *) arg
1049 * datrie/darray.h, datrie/darray.c (da_free):
1050 - Made void function, instead of int
1051 * datrie/darray.c (da_new):
1052 - Set CHECK[0] = d->num_cells, to be more clear
1053 * datrie/darray.c (da_write, da_extend_pool):
1054 - Update CHECK[0] whenever DArray::num_cells is changed, instead of
1055 just setting it before writing; so da_write() can now accept
1056 (const DArray *) arg
1058 * datrie/tail.h, datrie/tail.c
1059 (tail_write, tail_get_data, tail_walk_str, tail_walk_char):
1060 - Accept (const Tail *) arg
1061 * datrie/tail.h, datrie/tail.c (tail_free):
1062 - Made void function, instead of int
1064 * datrie/trie.c (struct _TrieState, struct _TrieEnumData):
1065 - 'trie' member is now const pointer
1066 * datrie/trie.h, datrie/trie.c
1067 (trie_new, trie_is_dirty, trie_retrieve, trie_enumerate, trie_root):
1068 * datrie/trie.c (trie_state_new):
1069 - Accept (const Trie *) arg
1071 2008-12-09 Theppitak Karoonboonyanan <thep@linux.thai.net>
1073 Unicode (UCS-4) character support.
1075 * datrie/triedefs.h (AlphaChar):
1076 - unsigned char -> uint32
1078 * datrie/alpha-map.h, datrie/alpha-map.c, datrie/libdatrie.def:
1079 - Export alpha_char_strlen() utility routine
1082 (ProgEnv, init_conv, conv_to_alpha, conv_from_alpha, close_conv):
1083 - Add routines for converting characters between locale (LC_CTYPE)
1085 * tools/trietool.c (main):
1086 - Initialize and close conversion routines
1088 (command_add, command_add_list, command_delete, command_delete_list,
1089 command_query, list_enum_func, command_list):
1090 - Convert character encodings between I/O and trie
1092 2008-12-09 Theppitak Karoonboonyanan <thep@linux.thai.net>
1094 * datrie/trie.c (trie_retrieve, trie_store):
1095 - Use (AlphaChar *), not (TrieChar *), as key pointer type
1097 2008-12-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
1099 * datrie/trie.c (trie_retrieve):
1100 - Remove unused var 'len'
1101 - Compare AlphaChar with integer zero rather than '\0'
1103 2008-12-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
1105 Adjust APIs for in-memory trie support.
1107 * datrie/trie.c (struct _Trie):
1108 - Remove 'file' member; now trie is detached from file; file is
1109 closed after loading, and reopened when saving
1110 * datrie/trie.h, datrie/trie.c (trie_new):
1111 - Add public APIs: trie_new(), for non-file usage
1112 - One can still save it to file with trie_save(), BTW
1113 * datrie/trie.h, datrie/trie.c (trie_open, trie_new_from_file):
1114 - Rename trie_open() to trie_new_from_file() and make it accept only
1115 one pathname parameter, instead of separated dir and name
1116 - Alphabet map is now mandatory, rather than optional
1117 * datrie/trie.h, datrie/trie.c (trie_close, trie_free):
1118 - Rename trie_close() to trie_free() and do not bother with saving
1120 * datrie/trie.h, datrie/trie.c (trie_save):
1121 - Accept file path argument and open the file for saving
1122 * datrie/trie.h, datrie/trie.c (trie_is_dirty):
1123 - Add public API: trie_is_dirty() for client to determine whether
1126 * datrie/alpha-map-private.h:
1127 - Separate internal APIs from public
1128 * datrie/alpha-map.h, datrie/alpha-map.c:
1129 - Promote alpha_map_new() and alpha_map_add_range() to public;
1130 they are now needed by trie_new()
1131 - Remove alpha_map_open()
1132 - Add public API: alpha_map_clone()
1133 - Document public APIs
1135 * datrie/darray.h, datrie/darray.c (da_new):
1136 - Add internal API: da_new() needed by trie_new()
1137 - Code migrated from new-file case in da_read()
1138 * datrie/darray.c (da_read):
1139 - No longer handle new file; read failure means an error
1141 * datrie/tail.h, datrie/tail.c (tail_new):
1142 - Add internal API: tail_new() needed by trie_new()
1143 - Code migrated from new-file case in tail_read()
1144 * datrie/tail.c (TAIL_SIGNATURE):
1145 - Update TAIL_SIGNATURE to harmonize with other data parts
1146 * datrie/tail.c (tail_read):
1147 - No longer handle new file; read failure means an error
1149 * tools/trietool.c (prepare_trie, close_trie):
1150 - Add helper function for openning and closing trie
1151 * tools/trietool.c (main):
1152 - Open and close trie with prepare_trie() and close_trie()
1154 * datrie/Makefile.am:
1155 - Install alpha-map.h as public header
1156 - Add alpha-map-private.h to source list
1157 * datrie/libdatrie.def:
1158 - Update exported symbols
1160 2008-12-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
1162 Rename AlphaMap functions to be more logical.
1164 * datrie/alpha-map.c, datrie/alpha-map.h: Rename functions
1165 - alpha_map_char_to_alphabet -> alpha_map_char_to_trie
1166 - alpha_map_alphabet_to_char -> alpha_map_trie_to_char
1167 - alpha_map_char_to_alphabet_str -> alpha_map_char_to_trie_str
1168 - alpha_map_alphabet_to_char_str -> alpha_map_trie_to_char_str
1170 * datrie/trie.c (trie_retrieve, trie_store, trie_delete,
1171 trie_da_enum_func, trie_state_walk, trie_state_is_walkable):
1172 - Call the AlphaMap functions with the new names
1174 2008-12-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
1176 Merge SBTrie alphabet mapping feature into Trie.
1178 * datrie/triedefs.h (AlphaChar):
1179 - Add AlphaChar typedef, as well as ALPHA_CHAR_ERROR macro
1180 (moved from UniChar type in datrie/alpha-map.h)
1182 * datrie/alpha-map.c (alpha_char_strlen):
1183 - Add string length function for alphabet string
1184 * datrie/alpha-map.c (struct _AlphaRange):
1185 - Use AlphaChar type instead of UniChar for begin, end members
1186 * datrie/alpha-map.c (alpha_map_get_total_ranges):
1187 - Add range count private method
1188 * datrie/alpha-map.c (alpha_map_add_range):
1189 - Add private method for adding range (refactored from
1191 * datrie/alpha-map.c (alpha_map_open):
1192 - Call alpha_map_add_range() to add range, instead of doing low-level
1194 * datrie/alpha-map.c, datrie/alpha-map.h
1195 (alpha_map_read_bin, alpha_map_write_bin):
1196 - Add methods for binary format I/O
1197 * datrie/alpha-map.c, datrie/alpha-map.h
1198 (alpha_map_char_to_alphabet, alpha_map_alphabet_to_char):
1199 - Accept and return AlphaChar, instead of UniChar
1200 * datrie/alpha-map.c, datrie/alpha-map.h
1201 (alpha_map_char_to_alphabet_str, alpha_map_alphabet_to_char_str):
1202 - Add public methods for mapping strings (migrated from
1203 sb_map_char_to_alphabet_str and sb_map_alphabet_to_char_str in
1206 * datrie/trie.c (struct _Trie):
1207 - Add alpha_map member
1208 * datrie/trie.c (trie_open):
1209 - Add code to read AlphaMap data block, and prefer text-formatted
1211 - Defer Trie object allocation to after file openning
1212 * datrie/trie.c (trie_close):
1213 - Free alpha_map member
1214 * datrie/trie.c (trie_save):
1215 - Add code to write AlphaMap data block
1216 * datrie/trie.c, datrie/trie.h (trie_retrieve, trie_store, trie_delete,
1217 trie_da_enum_func, trie_state_walk, trie_state_is_walkable):
1218 - Adjust function prototypes to accept AlphaChar instead of TrieChar
1219 - Add mapping between alphabet and trie character code
1220 * datrie/trie.h (TrieEnumFunc):
1221 - Adjust function typedef to accept AlphaChar instead of TrieChar
1223 * datrie/Makefile.am:
1224 - Remove sb-trie.c and sb-trie.h from source/header list
1225 * datrie/libdatrie.def:
1226 - Remove sb_trie symbols
1229 - Call trie_* functions instead of sb_trie_*
1231 2008-12-03 Theppitak Karoonboonyanan <thep@linux.thai.net>
1233 Adjust file format by catenating *.br and *.tl data into a single
1236 * datrie/trie.c (struct _Trie):
1237 - Add 'file' and 'is_dirty' members
1238 * datrie/trie.c (trie_open):
1239 - Open the file and call da_read() and tail_read() to load data
1240 portions, instead of openning separate files
1241 * datrie/trie.c (trie_close):
1242 - Do the saving stuff and free DArray and Tail data, instead of
1243 separately closing them; then finally close the file
1244 * datrie/trie.c (trie_save):
1245 - Write file portions with da_write() and tail_write() instead of
1246 saving to separate files
1247 - Handle the 'is_dirty' stuffs
1248 * datrie/trie.c (trie_store, trie_branch_in_branch, trie_delete):
1249 - Set the 'is_dirty' flag
1251 * datrie/darray.h: Change prototypes for internal APIs whose
1252 functionalities are to be reduced:
1253 - da_open(path, name, mode) -> da_read(FILE*)
1254 - da_close(DArray*) -> da_free(DArray*)
1255 - da_save(DArray*) -> da_write(DArray*, FILE*)
1257 * datrie/darray.c (struct_DArray):
1258 - Drop 'file' and 'is_dirty' members
1259 * datrie/darray.c (da_open -> da_read):
1260 - Accept (FILE *) argument and drop file openning/closing codes
1261 - Store number of cells at CHECK[0], so double-array data size can
1262 determined without depending on file size
1263 - Do not allocate DArray object until needed
1264 - Drop 'is_dirty' stuffs
1265 * datrie/darray.c (da_close -> da_free):
1266 - Remove file stuffs; just free memory
1267 * datrie/darray.c (da_save -> da_write):
1268 - Accept (FILE *) argument and use it instead of DArray::file
1269 - Ensure CHECK[0] stores the number of cells
1270 - Drop 'is_dirty' stuffs
1271 * datrie/darray.c (da_set_base, da_set_check):
1272 - Drop 'is_dirty' stuffs
1274 * datrie/tail.h: Change prototypes for internal APIs whose
1275 functionalities are to be reduced:
1276 - tail_open(path, name, mode) -> tail_read(FILE*)
1277 - tail_close(Tail*) -> tail_free(Tail*)
1278 - tail_save(Tail*) -> tail_write(Tail*, FILE*)
1280 * datrie/tail.c (struct _Tail):
1281 - Drop 'file' and 'is_dirty' members
1282 * datrie/tail.c (tail_open -> tail_read):
1283 - Accept (FILE *) argument and drop file openning/closing codes
1284 - Check for new file from read failure, rather than file size
1285 - Do not allocate Tail object until needed
1286 - Drop 'is_dirty' stuffs
1287 * datrie/tail.c (tail_close -> tail_free):
1288 - Remove file stuffs; just free memory
1289 * datrie/tail.c (tail_save -> tail_write):
1290 - Accept (FILE *) argument and use it instead of Tail::file
1291 - Drop 'is_dirty' stuffs
1292 * datrie/tail.c (tail_set_suffix, tail_set_data, tail_free_block):
1293 - Drop 'is_dirty' stuffs
1295 2008-12-01 Theppitak Karoonboonyanan <thep@linux.thai.net>
1297 Get rid of the weird TrieIndexInt intermediate type, by checking
1298 ranges instead. (Changes merged from r_0_1_x-branch)
1300 * datrie/darray.c: Remove typedef for TrieIndexInt.
1301 * datrie/darray.c (da_check_free_cell, da_extend_pool):
1302 - Accept normal TrieIndex arg instead of TrieIndexInt
1303 * datrie/datrie.c (da_insert_branch):
1304 - Define 'base', 'next' vars as TrieIndex instead of TrieIndexInt
1305 - Check overflow for 'next' before checking if the cell is free
1306 * datrie/datrie.c (da_find_free_base):
1307 - Define 's' var as TrieIndex instead of TrieIndexInt
1308 * datrie/datrie.c (da_fit_symbols):
1309 - Check overflow for (base + sym) before checking if the cell is free
1310 * datrie/datrie.c (da_get_base, da_get_check, da_set_base,
1312 - Also check lower bound for index range
1314 2008-11-27 Theppitak Karoonboonyanan <thep@linux.thai.net>
1316 First changes to break ABI for larger trie index.
1318 * datrie/triedefs.h: Redefine TrieIndex and TrieData as int32.
1319 Update TRIE_INDEX_MAX accordingly.
1320 * datrie/darray.c (da_open, da_save): Redefine DA_SIGNATURE.
1321 Read/write 32-bit data in headers.
1322 * datrie/darray.c (da_has_children, da_output_symbols,
1324 Declare characters as TrieIndex instead of uint16.
1325 * datrie/tail.c (tail_open, tail_save): Redefine TAIL_SIGNATURE.
1326 Read/write 32-bit data in headers. Use 16-bit length for each block.
1327 * configure.ac: Bump up library version to 1.0.0.
1329 2008-06-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
1331 * man/trietool.1: Use troff .in command to indent text, fixing warning
1332 from 'groff --warnings'. Thanks Debian's lintian.
1334 2008-06-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
1336 * datrie/tail.c (tail_set_suffix):
1337 * datrie/sb-trie.c (sb_map_char_to_alphabet_str):
1338 Fix GCC warnings about char signedness.
1340 2008-01-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1342 * configure.in: Bump the library revision.
1344 === Version 0.1.3 ===
1346 2008-01-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1348 * man/trietool.1: Add documentation for the SBM file.
1350 2008-01-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1352 * README: Fix my name in the reference.
1354 2008-01-10 Theppitak Karoonboonyanan <thep@linux.thai.net>
1356 * datrie/tail.c (tail_set_suffix): Fix bug for the case in which
1357 suffix argument and tail's suffix overlap. Bug report and patch by
1358 shepmaster in http://linux.thai.net/node/102.
1360 2008-01-10 Theppitak Karoonboonyanan <thep@linux.thai.net>
1362 * datrie/sb-trie.c (sb_trie_root): Return NULL pointer, rather than
1363 FALSE. Bug reported by shepmaster in http://linux.thai.net/node/101.
1365 2007-10-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
1367 * datrie/libdatrie.def: List only symbols in plain format, for Mac
1368 build. Thanks Vee Satayamas for the report.
1370 * datrie/Makefile.am: Add libdatrie.def as libdatrie_la_DEPENDENCIES.
1372 2007-08-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1374 * doc/Doxyfile.in: Only generate doc for public API.
1376 2007-08-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1378 * doc/Makefile.am, doc/Doxyfile.in: Revert API man pages generation
1379 and installation. Update Doxyfile format to doxygen 1.5.3.
1381 2007-08-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
1383 * man/trietool.1: Escape some minus signs. Mark a variable italic.
1384 Thanks debian's lintian.
1386 2007-08-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
1388 * configure.ac: Post-release version bump.
1390 2007-08-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
1392 * configure.ac: Bump lib revision.
1394 === Version 0.1.2 ===
1396 2007-08-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
1398 * datrie/Makefile.am, +datrie/trie-private.h (MIN_VAL, MAX_VAL):
1400 * datrie/darray.c (da_output_symbols): Adjust loop boundary to be more
1402 * "-------------" (da_has_children, da_relocate_base): Apply the same
1403 loop pattern to prevent out-of-range accesses.
1405 2007-08-24 Theppitak Karoonboonyanan <thep@linux.thai.net>
1407 * datrie/darray.c (da_output_symbols): Do not try to test symbols
1408 beyond trie index range. Fixes segfault for trietool list command.
1410 2007-08-19 Theppitak Karoonboonyanan <thep@linux.thai.net>
1412 Handle double array index overflow.
1414 * datrie/triedefs.h (TRIE_INDEX_MAX): Define maximum index value.
1415 * datrie/darray.c (TrieIndexInt): Define type for immediate values, so
1416 overflow can be detected.
1417 * "-------------" (da_extend_pool): Return success/failure status.
1418 Accept TrieIndexInt argument for overflow detection.
1419 * "-------------" (da_check_free_cell): False when extending fails.
1420 Accept TrieIndexInt argument for overflow detection.
1421 * "-------------" (da_find_free_base): Return error on failure.
1422 * "-------------" (da_insert_branch): Return error on failure.
1423 * datrie/trie.c (trie_branch_in_branch, trie_branch_in_tail): Check
1424 for failure from da_insert_branch() and return the status.
1425 * datrie/darray.{c,h} (da_prune_upto, da_prune): Add da_prune_upto(),
1426 for rolling back partial operation in trie_branch_in_branch().
1427 Redefine da_prune() in terms of da_prune_upto().
1429 2007-08-16 Theppitak Karoonboonyanan <thep@linux.thai.net>
1431 * datrie/darray.c (da_open, da_find_free_base): Use DA_POOL_BEGIN
1432 macro instead of hard-coded number. Remove unused DA_EXTENDING_STEPS.
1434 2007-05-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
1436 * datrie/sb-trie.c (sb_trie_close, sb_trie_save, sb_trie_retrieve,
1437 sb_trie_store, sb_trie_enumerate, sb_trie_root, sb_trie_state_clone,
1438 sb_trie_state_free, sb_trie_state_rewind, sb_trie_state_walk,
1439 sb_trie_state_is_walkable, sb_trie_state_is_terminal,
1440 sb_trie_state_is_leaf, sb_trie_state_get_data):
1441 Guard against NULL pointers in functions. Thanks to Neutron Soutmun
1442 for bug report and initial patch.
1444 2007-04-06 Theppitak Karoonboonyanan <thep@linux.thai.net>
1446 * doc/Makefile.am: Add install-man target. Also install/uninstall
1447 doxygen-generated man pages.
1449 2007-03-27 Theppitak Karoonboonyanan <thep@linux.thai.net>
1451 * configure.ac (LT_CURRENT, LT_REVISION, LT_AGE),
1452 datrie/Makefile.am (libdatrie_la_LDFLAGS), +datrie/libdatrie.def:
1453 Add library version info. Limit exported symbols with -export-symbols
1454 flag. Always pass -no-undefined flag.
1456 * configure.ac: Add Win32 DLL building support.
1458 2006-11-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
1460 * datrie/fileutils.{c,h} (file_read_int32, file_write_int32): Add
1461 int32 read/write functions.
1463 * datrie/fileutils.c (file_read_int16, file_write_int16): Use unsigned
1464 char buffer instead of and-ing with 0xff, in accordance with int32
1465 functions. (Thanks to Vee Satayamas for suggestion).
1467 2006-10-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
1469 * configure.ac: Post-release version bump.
1471 2006-10-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
1474 === Version 0.1.1 ===
1476 2006-10-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
1478 * configure.ac, Makefile.am, +man/Makefile.am, +man/trietool.1:
1479 Add manpage for trietool (moved from debian/).
1481 2006-10-11 Theppitak Karoonboonyanan <thep@linux.thai.net>
1483 Fixed compiler warnings.
1485 * datrie/sb-trie.c (sb_map_alphabet_to_char_str):
1486 * datrie/tail.c (tail_open, tail_save, tail_set_suffix):
1487 * datrie/trie.c (trie_da_enum_func): Cast pointers to get rid of
1488 compiler warnings about char signedness.
1490 * tools/trietool.c (list_enum_func): Return value on exit.
1492 2006-09-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
1494 * configure.ac: Post-release version bump.
1496 2006-09-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
1498 * NEWS, configure.ac:
1499 === Version 0.1.0 ===
1501 2006-09-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
1503 * README: Filled in.
1505 2006-09-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
1507 * datrie/triedefs.h, datrie/trie.h, datrie/sb-trie.h: Included headers
1508 using system header forms in installed headers.
1510 * datrie/Makefile.am (INCLUDES): Added include flag to ensure it
1511 compiles without prior installation.
1513 2006-09-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
1515 * datrie/alpha-map.c (alpha_map_char_to_alphabet,
1516 alpha_map_alphabet_to_char): Made sure terminator is always mapped
1519 2006-09-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
1521 * datrie/darray.{h,c} (da_is_walkable),
1522 datrie/tail.{h,c} (tail_is_walkable_char): Made the tiny functions
1523 inline (i.e. macros), for tiny performance gain.
1525 2006-09-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
1527 * datrie/sb-trie.{h,c} (+sb_trie_state_is_walkable): Added walkability
1530 * datrie/sb-trie.h (sb_trie_state_is_terminal, sb_trie_state_is_leaf),
1531 datrie/trie.h (trie_state_is_terminal, trie_state_is_leaf): Fixed typo
1532 for "\brief" doxygen tag.
1534 2006-09-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
1536 * datrie/trie.{h,c} (trie_state_is_terminal, +trie_state_is_walkable):
1537 Changed trie_state_is_terminal() into a generic walkability test, and
1538 made itself a specialized macro calling the function.
1540 2006-08-31 Theppitak Karoonboonyanan <thep@linux.thai.net>
1542 * datrie/darray.{h,c} (+da_is_walkable),
1543 datrie/tail.{h,c} (+tail_is_walkable_char),
1544 datrie/trie.c (tail_state_is_terminal): <Optimization> Tested
1545 walkability by peeking, instead of trying with a cloned state.
1547 * datrie/tail.{h,c} (tail_walk_char): Removed redundant const in
1550 2006-08-29 Theppitak Karoonboonyanan <thep@linux.thai.net>
1552 * datrie/trie.h, datrie/sb-trie.h: Wrapped extern "C" in public
1553 headers for compiling with C++ code.
1555 2006-08-22 Theppitak Karoonboonyanan <thep@linux.thai.net>
1557 * tools/trietool.c (decode_command): Exited with proper return values.
1559 * tools/trietool.c (command_add_list): Removed warning on missing data
1560 for keys. This would be normal for data-less dictionaries.
1562 2006-08-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
1564 * datrie/trie.{h,c} (trie_state_rewind),
1565 datrie/sb-trie.{h,c} (sb_trie_state_rewind): Added API to rewind a
1566 trie state to root, so users do not need to reallocate to do so.
1568 2006-08-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
1570 * datrie/alpha-map.c (alpha_map_open, alpha_map_new): Better used a
1571 dedicated function to initialize the map.
1573 2006-08-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
1575 * datrie/alpha-map.c (alpha_map_open): Initialized map list before
1576 using. Also skipped mal-formed input lines.
1578 * tools/trietool.c (command_add_list): Removed duplicated return.
1580 2006-08-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
1582 * configure.ac, Makefile.am, +datrie.pc.in: Added pkgconfig file.
1584 2006-08-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
1586 * datrie/sb-trie.{h,c} (sb_trie_state_is_terminal),
1587 datrie/trie.{h,c} (trie_state_is_terminal, trie_state_is_leaf):
1588 Added API for terminal node check and distinguish it from leaf node.
1589 (Terminal node can be in either branch or tail, while leaf can only
1592 2006-08-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
1594 * datrie/Makefile.am (pkginclude_HEADERS): Installed sb-trie.h.
1596 * datrie/sb-trie.h: Fixed file name in doxygen tag.
1598 2006-08-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
1600 * datrie/Makefile.am, +datrie/alpha-map.{h,c}, +datrie/sb-trie.{h,c}:
1601 Added alphabet map to map between character set and trie alphabet
1602 codes. Also added SBTrie wrapper for 8-bit character sets.
1604 * datrie/triedefs.h (TRIE_CHAR_MAX): Changed to 255, to fit char type.
1606 * datrie/trie.{h,c} (trie_state_walk): Removed unnecessary const in
1609 * tools/trietool.c: Used SBTrie instead of plain Trie.
1611 2006-08-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
1613 * datrie/fileutils.c (file_read_int16): Fixed bitwise calculation. The
1614 second byte should be masked to get rid of possible sign bits
1615 introduced by type conversion.
1617 2006-08-19 Theppitak Karoonboonyanan <thep@linux.thai.net>
1619 * datrie/fileutils.c (file_read_int16, file_write_int16): Used shift
1620 operations to serialize int, eliminating dependency on <arpa/inet.h>.
1621 Thanks Vee Satayamas for the suggestion.
1623 2006-08-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
1625 * datrie/trie.c (trie_retrieve, trie_store, trie_delete): Always walk
1626 the null-terminator in tail. Otherwise, comparison with shorter key
1627 will terminate at separate node.
1629 2006-08-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
1631 * datrie/darray.c (find_free_base): Extended pool before getting
1634 * tools/trietool.c (command_add_list): Let tab and comma be field
1635 delimitors, rather than white spaces in general.
1637 * tools/trietool.c (list_enum_func): Do not pad space when printing
1640 2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
1642 * configure.ac, Makefile.am, +doc/Makefile.am, +doc/Doxyfile.in:
1643 Generated document using doxygen.
1645 2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
1647 * datrie/darray.c (da_prune, da_num_children -> da_has_children):
1648 Just checked whether a node has at least one child, instead of
1649 counting children and comparing with zero, as a small optimization.
1651 2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
1653 * tools/trietool.c (command_add_list, command_delete_list):
1656 2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
1658 * datrie/trie.{h,c} (trie_enumerate), datrie/darray.{h,c}
1659 (da_enumerate, da_enumerate_recursive, da_get_state_key): Added key
1662 * tools/trietool.c (command_list): Implemented.
1664 2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
1666 * datrie/trie.{h,c} (trie_delete), datrie/darray.{h,c} (da_prune,
1667 da_num_children), datrie/tail.{h,c} (tail_delete): Added key deletion
1670 * datrie/tail.c (tail_save): Guarded against null suffix.
1672 * tools/trietool.c (command_delete): Implemented.
1674 2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
1676 * datrie/darray.c (da_find_free_base): Made sure the free cell for
1677 first symbol is beyond header cells. Also repeatedly extended the pool
1678 until a free cell is found, in case free list is restarted.
1680 2006-08-16 Theppitak Karoonboonyanan <thep@linux.thai.net>
1682 * datrie/fileutils.c (file_open): Created new file only if it does not
1685 * datrie/trie.c (trie_branch_in_branch): Also set data for tail block.
1687 * datrie/trie.c (trie_branch_in_tail): Do not free the const suffix
1688 block, fixing double free bug.
1690 * datrie/darray.c (da_insert_branch): Covered the case of negative
1691 base, for branching from a separate node.
1693 * tools/trietool.c (command_add): Removed debug message.
1695 2006-08-16 Theppitak Karoonboonyanan <thep@linux.thai.net>
1697 * configure.ac, Makefile.am, +tools/Makefile.am, +tools/trietool.c:
1698 Added trietool utility.
1700 * datrie/darray.c (da_get_free_list): Fixed typo in macro name.
1702 * datrie/datrie.c (da_extend_pool): Updated num_cells immediately
1703 after realloc(), to let the cell accesses pass boundary checks.
1705 * datrie/tail.c (tail_get_suffix, tail_set_suffix, tail_alloc_block,
1706 tail_free_block, tail_get_data, tail_set_data, tail_walk_str,
1707 tail_walk_char): Started tail blocks indexing from 1 (defined as
1708 TAIL_START_BLOCKNO macro) rather than 0, because we use signed values
1709 to distinguish pointers in darray.
1711 * datrie/tail.{c,h} (tail_get_suffix), datrie/trie.c
1712 (trie_branch_in_tail): Made tail_get_suffix return const pointer.
1714 * datrie/darray.c (da_close, da_save), datrie/tail.c (tail_close,
1715 tail_save): Checked errors and returned appropriate codes.
1717 * datrie/trie.c (trie_open): Checked errors on files openning and
1718 resumed appropriately.
1720 2006-08-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
1722 * datrie/Makefile.am, +datrie/fileutils.c: Added fileutils.c for
1723 implementation of file utility functions.
1725 * datrie/fileutils.{c,h}, datrie/darray.c (da_open), datrie/tail.c
1726 (tail_open): Adjusted file_read_int{8,16} API so error can be checked.
1728 2006-08-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
1730 * datrie/Makefile.am, +datrie/tail.c, datrie/tail.h: Added tail.c for
1731 trie suffix implementation. Adjusted some API to not require size_t.
1733 * datrile/fileutils.h: Added more functions required by tail.c.
1735 * datrie/trie.c (trie_branch_in_tail): Added check for null suffix.
1737 2006-08-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
1739 * datrie/Makefile.am, +datrie/darray.c, +datrie/fileutils.h:
1740 Added darray.c for double-array structure implementation, and
1741 fileutils.h declarations for keeping file manipulation functions.
1743 * datrie/triedefs.h: Added TRIE_CHAR_MAX constant for alphabet
1744 enumeration. Changed TRIE_INDEX_ERROR to 0, as negative number has its
1747 2006-08-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
1749 * === First import the project ===