1 2018-06-19 Theppitak Karoonboonyanan <theppitak@gmail.com>
4 - Bump library revision to reflect code changes.
9 2018-06-19 Theppitak Karoonboonyanan <theppitak@gmail.com>
14 - Update document URL to HTTPS
16 2018-06-14 Theppitak Karoonboonyanan <theppitak@gmail.com>
18 Cast (wchar_t *) to fix warnings in tests
20 "%ls" printf() format requires (wchar_t *) [aka int *] arg.
21 So, let's cast (AlphaChar *) [aka unsigned int *] to satisfy it.
24 * tests/test_iterator.c:
25 * tests/test_store-retrieve.c:
27 * tests/test_nonalpha.c:
28 * tests/test_null_trie.c:
29 - Add <wchar.h> include, for wchar_t type
30 - Cast "%ls" args from (AlphaChar *) to (wchar_t *)
32 2018-06-06 Theppitak Karoonboonyanan <theppitak@gmail.com>
34 Avoid non-ANSI C snprintf()
36 * tools/trietool.c (+full_path, prepare_trie, close_trie):
37 - Instead of preparing full path name with snprintf(), which is
38 non-ANSI, and still risks path name trimming, do it with
39 size-calculated malloc().
40 - free() it as needed.
42 2018-06-04 Theppitak Karoonboonyanan <theppitak@gmail.com>
44 Fix sscanf() string format
46 * tools/trietool.c (prepare_trie):
47 - Define b, e as unsigned int, as required by "%x" format.
48 Fixing warning from '-Wformat=' gcc option.
50 2018-06-04 Theppitak Karoonboonyanan <theppitak@gmail.com>
52 Fix compiler warnings in tests
54 * tests/test_byte_alpha.c (main):
55 * tests/test_file.c (main):
56 * tests/test_iterator.c (main):
57 * tests/test_nonalpha.c (main):
58 * tests/test_null_trie.c (main):
59 * tests/test_store-retrieve.c (main):
60 * tests/test_term_state.c (main):
61 * tests/test_walk.c (main):
62 - Declare main function with 'main (void)'.
63 Fixing warning from '-Wstrict-prototypes' gcc option.
64 * tests/test_walk.c (main):
65 - Split long string, which required C90 compilers.
66 Fixing warning from '-Woverlength-strings' gcc option.
68 2018-06-04 Theppitak Karoonboonyanan <theppitak@gmail.com>
70 Duplicate TrieChar string in more portable manner
72 * datrie/tail.c (tail_set_suffix, +tc_strdup, +tc_strlen):
73 - Replace cast strdup() with crafted implementation,
74 allowing TrieChar to be of larger size than char.
75 Fixing warning from '-Wint-to-pointer-cast' gcc option.
77 2018-06-04 Theppitak Karoonboonyanan <theppitak@gmail.com>
81 * tools/trietool.c (usage):
82 - Split help message which was too long and required C90 compiler.
83 Caught by '-Woverlength-strings' gcc option.
85 2018-06-04 Theppitak Karoonboonyanan <theppitak@gmail.com>
87 Remove unused byte, word, dword typedefs
89 These are likely to conflict with other uses.
91 * datrie/typedefs.h (-byte, -word, -dword):
92 - Remove the unused typedefs
94 Thanks Peter Moulder for the patch.
96 2018-06-04 Theppitak Karoonboonyanan <theppitak@gmail.com>
98 Rename TRUE/FALSE in Bool enum to avoid clash
100 Some other header file may have already define TRUE/FALSE.
102 * datrie/typedefs.h (Bool):
103 - Rename FALSE, TRUE to DA_FALSE, DA_TRUE respectively,
104 and define FALSE, TRUE macros only if they haven't been defined.
106 Thanks Peter Moulder for the patch.
108 2018-06-04 Theppitak Karoonboonyanan <theppitak@gmail.com>
110 Declare argument-less functions with "(void)"
112 "f()" declaration form is K&R style, specifying that no information
113 about the number or types of parameters is supplied. This caused
114 warnings on '-Wstrict-prototypes' gcc option.
116 * datrie/alpha-map.h, datrie/alpha-map.c (alpha_map_new):
117 * datrie/darray.h, datrie/darray.c (da_new, symbols_new):
118 * datrie/tail.h, datrie/tail.c (tail_new):
119 * tests/utils.h, tests/utils.c (en_alpha_map_new, en_trie_new):
120 - Use "(void)" form in declaration
121 - Also use "(void)" form in definition, for consistency
123 Thanks Peter Moulder for the initial patch.
125 2018-05-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
127 Remove duplicate include
130 - Remove duplicate include <config.h>
132 2018-04-23 Theppitak Karoonboonyanan <theppitak@gmail.com>
134 Add missing include in test
136 * tests/test_byte_alpha.c:
137 - Add missing include for utils.h
139 2018-04-23 Theppitak Karoonboonyanan <theppitak@gmail.com>
142 - Bump library revision to reflect code changes.
145 === Version 0.2.11 ===
147 2018-04-21 Theppitak Karoonboonyanan <theppitak@gmail.com>
149 Fix reported segfault on full-range alpha map
151 * tests/Makefile.am, +tests/test_byte_alpha.c:
153 * datrie/alpha-map.c (alpha_map_recalc_work_area()):
154 - Redeclare trie_last as TrieIndex, to prevent overflow.
156 Thanks Xiao Wang for the report, and @nevermatch for the analysis.
159 https://github.com/tlwg/libdatrie/issues/6
161 2018-03-29 Theppitak Karoonboonyanan <theppitak@gmail.com>
163 Fix trie_state_get_data() at a prefix key
165 When getting data from a state which terminates a key that is
166 a prefix of another key, a terminator should be tried, so it
167 jumps from DA to TAIL, where we can get the data.
169 * tests/Makefile.am, +tests/test_term_state.c:
170 - Add a test case with {'ab', 'abc'} dictionary, which fails previous
171 code when retrieving data for key 'ab'.
172 * datrie/trie.c (trie_state_get_data()):
173 - Instead of simply checking for leaf state, which only caught a state
174 in TAIL, also try walking with a terminator when still in DA.
175 - Replace 'leaf state' with 'terminal state' in documentation,
177 - Also return error on null state pointer.
179 Thanks Filip Pytloun from the pytries project for the initial patch.
181 2017-09-06 Theppitak Karoonboonyanan <theppitak@gmail.com>
183 Revise description about search time complexity
186 - Clarify that search time is O(m), where m is the key length,
187 instead of O(1), while still claim that it's independent of
191 https://github.com/tlwg/libdatrie/issues/4
193 2016-12-14 Theppitak Karoonboonyanan <theppitak@gmail.com>
195 Include git-version-gen in tarball
198 - Add build-aux/git-version-gen to EXTRA_DIST.
200 2016-09-21 Theppitak Karoonboonyanan <theppitak@gmail.com>
202 Fix iconv() return value checking.
204 * tools/trietool.c (conv_to_alpha):
205 - Check iconv() return value against (size_t) -1, rather than
206 for its negativity, as size_t can be unsigned.
208 Thanks Daniel Macks for the report on Issue #3.
209 https://github.com/tlwg/libdatrie/issues/3
211 2016-09-21 Theppitak Karoonboonyanan <theppitak@gmail.com>
213 Use versioning based on Git snapshot.
216 - Add dist-hook to generate VERSION file on tarball generation.
217 * +build-aux/git-version-gen:
218 - Add script to generate version based on 'git describe'
219 if in git tree, or using VERSION file if in release tarball.
221 - Call git-version-gen to get package version.
223 2015-10-20 Theppitak Karoonboonyanan <theppitak@gmail.com>
226 - Bump library revision to reflect code changes.
228 * NEWS, configure.ac:
229 === Version 0.2.10 ===
231 2015-10-13 Theppitak Karoonboonyanan <theppitak@gmail.com>
233 Optimize AlphaMap mapping.
235 alpha_map_char_to_trie() is called everywhere before trie state
236 transition. It's an important bottleneck.
238 We won't change the persistent AlphaMap structure, but will add
239 pre-calculated lookup tables for use at run-time.
241 * datrie/alpha-map.c (struct _AlphaMap):
242 - Add members for alpha-to-trie and trie-to-alpha lookup tables.
243 * datrie/alpha-map.c (alpha_map_new, alpha_map_free):
244 - Initialize & free the tables properly.
245 * datrie/alpha-map.c (alpha_map_add_range -> alpha_map_add_range_only
246 + alpha_map_recalc_work_area):
247 - Split alpha_map_add_range() API into two parts: adding the range
248 as usual and recalculate the lookup tables.
249 * datrie/alpha-map.c (alpha_map_clone, alpha_map_fread_bin):
250 - Call alpha_map_add_range_only() repeatedly before calling
251 alpha_map_recalc_work_area() once.
252 * datrie/alpha-map.c (alpha_map_char_to_trie, alpha_map_trie_to_char):
253 - Look up the pre-calculated tables instead of calculating on
256 This appears to save time by 14.6% for total alpha_char_to_trie()
257 calls and even lower its bottleneck rank by 1 rank on a libthai
258 test case. It reduces 0.2% run time of the total libthai test case.
260 Note that the time saved would be even more in case of multiple
261 uncontinuous alphabet ranges, at the expense of more memory used.
263 2015-08-18 Theppitak Karoonboonyanan <theppitak@gmail.com>
265 Fix doxygen version checking.
268 - Correctly compare doxygen versions. Simple expr comparison
269 didn't work with version 1.8.10.
271 Thanks Petr Gajdos <pgajdos@suse.cz> for the patch.
273 2015-06-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
275 * datrie/tail.c (tail_set_suffix):
276 - Catch strdup() failure.
278 2015-06-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
280 * configure.ac: Post-release version suffix added.
282 2015-05-03 Theppitak Karoonboonyanan <theppitak@gmail.com>
284 * NEWS, configure.ac:
285 === Version 0.2.9 ===
287 2015-05-03 Theppitak Karoonboonyanan <theppitak@gmail.com>
289 Use relative paths for symlinks.
291 * tools/Makefile.am, man/Makefile.am:
292 - Use relative paths for symlinks to avoid confusion in
293 installation with DESTDIR.
295 2015-05-03 Theppitak Karoonboonyanan <theppitak@gmail.com>
297 Also install symlink for old trietool.
300 - Add hooks to install/uninstall symlink for old man page.
302 2015-05-02 Theppitak Karoonboonyanan <theppitak@gmail.com>
305 - Bump library revision to reflect code changes.
307 2015-04-29 Theppitak Karoonboonyanan <theppitak@gmail.com>
309 Bump doxygen required version.
312 - Bump doxygen required version to 1.8.8, according to recent
315 2015-04-21 Theppitak Karoonboonyanan <theppitak@gmail.com>
317 Fix infinite loop on empty trie iteration.
319 * tests/Makefile.am, +tests/test_null_trie.c:
320 - Add test case for empty trie iteration.
322 * datrie/darray.c (da_first_separate):
323 - Fix error condition after loop ending.
325 Thanks Sergei Lebedev <sergei.a.lebedev@gmail.com> for the report
328 Original report: https://github.com/kmike/datrie/issues/17
330 2015-04-12 Theppitak Karoonboonyanan <theppitak@gmail.com>
332 Document about alphabet size.
335 - Add to doc comment a description on the alphabet size limit
336 and the mapped raw codes.
338 Thanks edgehogapp for the suggestion.
339 https://groups.google.com/forum/#!topic/thai-linux-foss-devel/U-O__IfviQ0
341 2015-04-11 Theppitak Karoonboonyanan <theppitak@gmail.com>
343 Clarify Symbols' struct & methods.
345 * datrie/darray.c (struct _Symbols):
346 - Use TRIE_CHAR_MAX + 1 instead of hard-coded value for symbols[]
349 Thanks edgehogapp for the suggestion.
350 https://groups.google.com/forum/#!topic/thai-linux-foss-devel/U-O__IfviQ0
352 * datrie/darray.h, datrie/darray.c (symbols_new, symbols_add):
353 - Hide symbols_new() and symbols_add() for internal use.
355 2015-03-06 Theppitak Karoonboonyanan <theppitak@gmail.com>
360 - Updated for doxygen 1.8.8 with 'doxygen -u'.
362 2015-03-02 Theppitak Karoonboonyanan <theppitak@gmail.com>
364 Catch realloc failure.
366 * datrie/tail.c (tail_alloc_block):
367 - Check realloc() result on t->tails reallocation and return
368 failure code if failed.
369 * datrie/tail.c (tail_add_suffix):
370 - Check return value from tail_alloc_block() and return failure
372 - Update documentation.
374 2015-03-02 Theppitak Karoonboonyanan <theppitak@gmail.com>
376 Catch realloc failure.
378 * datrie/darray.c (da_extend_pool):
379 - Check realloc() result on d->cells reallocation and handle
382 2015-02-27 Theppitak Karoonboonyanan <theppitak@gmail.com>
384 Catch malloc failure.
386 * datrie/tail.c (tail_fread):
387 - Check malloc() result on suffix string and exit properly.
389 2015-02-26 Theppitak Karoonboonyanan <theppitak@gmail.com>
391 More micro-optimization with LIKELY/UNLIKELY.
393 * datrie/alpha-map.c (alpha_map_char_to_trie, alpha_map_trie_to_char):
394 - Use UNLIKELY() when checking for NUL character.
396 2015-02-10 Theppitak Karoonboonyanan <theppitak@gmail.com>
398 Fix 'make distcheck' failure.
401 - Remove doxygen db file on clean.
403 2015-02-10 Theppitak Karoonboonyanan <theppitak@gmail.com>
405 More update of my e-mail address.
408 - Update my e-mail address.
410 2015-02-10 Theppitak Karoonboonyanan <theppitak@gmail.com>
412 Rename trietool-0.2 utility to trietool.
417 - Rename bin target from trietool-0.2 to trietool.
418 - Add hooks to install/uninstall symlink with old name.
419 * man/Makefile.am, man/trietool-0.2.1 -> man/trietool.1:
420 - Rename & update manpage accordingly.
422 2015-02-06 Theppitak Karoonboonyanan <theppitak@gmail.com>
424 Micro-optimize with likely/unlikely hints.
426 * datrie/trie-private.h:
427 - Add LIKELY() and UNLIKELY() macros based on compiler extension.
429 (alpha_map_new, alpha_map_clone, alpha_map_fread_bin,
430 alpha_map_add_range, alpha_map_char_to_trie_str,
431 alpha_map_trie_to_char_str):
433 (symbols_new, da_new, da_fread, da_get_base, da_get_check,
434 da_set_base, da_set_check, da_insert_branch, da_find_free_base,
436 * datrie/dstring.c (dstring_new, dstring_ensure_space):
438 (tail_new, tail_fread, tail_get_suffix, tail_set_suffix,
439 tail_get_data, tail_set_data, tail_walk_str, tail_walk_char):
441 (trie_new, trie_fread, trie_enumerate, trie_state_new,
442 trie_state_walk, trie_state_is_walkable, trie_iterator_new):
443 - Use LIKELY() and UNLIKELY() where it is known to be so, mostly
444 for one-time initialization and failure handling.
445 * datrie/alpha-map.c, datrie/tail.c, datrie/tail.c:
446 - These are the files that need to include trie-private.h
449 Callgrind says it does help speed up a little bit.
451 2015-02-05 Theppitak Karoonboonyanan <theppitak@gmail.com>
453 Disable timestamp in Doxygen-generated doc.
456 - Set HTML_TIMESTAMP to NO to make the document reproducible.
457 (reported by Debian Reproducible)
459 2015-02-01 Theppitak Karoonboonyanan <theppitak@gmail.com>
461 * configure.ac: [Belated] post-release version suffix added.
463 2015-02-01 Theppitak Karoonboonyanan <theppitak@gmail.com>
465 Update my e-mail address everywhere.
467 * AUTHORS, configure.ac, datrie/*.[ch], tests/*.[ch],
469 - Replace all mentionings of my e-mail address with the gmail one.
471 2015-02-01 Theppitak Karoonboonyanan <theppitak@gmail.com>
473 Fix binary file opening on Windows.
475 * datrie/trie.c (trie_new_from_file, trie_save):
476 - Add "b" to fopen() modes, so the binary file is opened properly
479 Thanks phongphan.p for the report and initial patch.
481 2014-01-10 Theppitak Karoonboonyanan <thep@linux.thai.net>
484 - Bump library revision to reflect code changes.
486 * NEWS, configure.ac:
487 === Version 0.2.8 ===
489 2014-01-09 Theppitak Karoonboonyanan <thep@linux.thai.net>
491 Improve documentation.
494 - Refine descriptions of data types.
495 * datrie/trie.c (trie_iterator_new):
496 - Fix typo on trie_root() mentioning.
497 * datrie/trie.c (trie_store, trie_store_if_absent):
499 * datrie/alpha-map.h, datrie/trie.h:
500 - Add detailed description of AlphaMap and Trie types.
502 2014-01-08 Theppitak Karoonboonyanan <thep@linux.thai.net>
504 Clarify message in test_nonalpha.
506 * tests/test_nonalpha.c (main):
507 - Clarify message on false key duplication.
509 2014-01-08 Theppitak Karoonboonyanan <thep@linux.thai.net>
511 Add test on keys with non-alphabet input chars.
513 * tests/Makefile.am, +tests/test_nonalpha.c:
514 - Add test to ensure that operations on keys with non-alphabet
517 2014-01-08 Theppitak Karoonboonyanan <thep@linux.thai.net>
519 Fail trie operations on non-alphabet inputs.
521 alpha_map_char_to_trie() tried to return TRIE_CHAR_MAX to indicate
522 out-of-range error. But this value is indeed valid in trie operations.
523 Doing so could allow false key duplication when different non-alphabet
524 chars and TRIE_CHAR_MAX itself were all mapped to TRIE_CHAR_MAX.
525 So, let's fail all trie operations on non-alphabet input chars.
527 * datrie/alpha-map-private.h, datrie/alpha-map.c
528 (alpha_map_char_to_trie):
529 - Make alpha_map_char_to_trie return TrieIndex type, using
530 TRIE_INDEX_MAX to indicate out-of-range error.
531 This allows TRIE_CHAR_MAX to be returned as a valid output.
532 * datrie/alpha-map.c (alpha_map_char_to_trie_str):
533 - Fail if alpha_map_char_to_trie() returns error code.
534 * datrie/trie.c (trie_retrieve, trie_store_conditionally, trie_delete,
535 trie_state_walk, trie_state_is_walkable):
536 - Check return value from alpha_map_char_to_trie() and return
537 failure status on error.
538 - Also cast TrieIndex return values to TrieChar on function calls.
540 Thanks Naoki Youshinaga for the suggestion.
542 2014-01-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
544 Check for NULL result from AlphaMap string funcs.
546 * datrie/trie.c (trie_store_conditionally):
547 - Return failure on NULL alpha_map_char_to_trie_str().
549 2014-01-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
551 Return NULL on allocation errors in AlphaMap funcs.
554 (alpha_map_char_to_trie_str, alpha_map_trie_to_char_str):
555 - Return NULL on malloc() error.
557 2014-01-03 Theppitak Karoonboonyanan <thep@linux.thai.net>
559 Fix edge case with TRIE_CHAR_MAX as TrieChar.
561 The trie input char with value TRIE_CHAR_MAX (255), was always
562 skipped by double-array algorithms. Let's include it.
564 * datrie/darray.c (da_has_children, da_output_symbols,
565 da_relocate_base, da_first_separate, da_next_separate):
566 - Include the last char in trie char iterations.
568 * datrie/darray.c (da_first_separate, da_next_separate):
569 - Declare characters as TrieIndex type instead of TrieChar,
570 to prevent infinite loop due to unsigned char overflow.
572 Thanks Naoki Youshinaga for the report, test case, and analysis.
574 2013-10-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
576 Fix comiler warnings in tests.
578 * tests/test_walk.c (main):
579 - Remove unused var i;
580 - Remove extra printf() args.
581 * tests/test_iterator.c:
582 - Add missing #include for free().
583 * tests/test_walk.c (walk_dict), tests/utils.c (dict_src):
584 - Cast string literals to (AlphaChar *) to fix signedness
587 2013-10-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
589 * configure.ac: Post-release version suffix added.
591 2013-10-22 Theppitak Karoonboonyanan <thep@linux.thai.net>
593 * NEWS, configure.ac:
594 === Version 0.2.7.1 ===
596 2013-10-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
598 * configure.ac: Bump library versioning to reflect API addition.
599 (Change missing in previous release)
601 2013-10-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
603 * configure.ac: Post-release version suffix added.
605 2013-10-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
607 * NEWS, configure.ac:
608 === Version 0.2.7 ===
610 2013-10-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
612 Add missing distributed file.
615 - Add utils.h to distribution.
617 2013-10-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
619 Reorder tests from primitive to applied.
622 - Test walk & iterator before store-retrieve & file.
624 2013-10-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
626 Write a test suite for trie walk.
631 2013-10-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
633 Write a test suite for trie store/retrieval.
635 * tests/utils.h, tests/utils.c (+dict_src_n_entries):
636 - Add function to get total entries in dict_src[].
637 * tests/test_store-retrieve.c (main):
640 2013-10-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
642 Fix messages in test_iterator.
644 * tests/test_iterator.c (main):
645 - s/file/trie/. No file is written or read in this test.
647 2013-10-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
649 Skip further iteration tests if key is NULL.
651 * tests/test_iterator.c (main):
652 - Insert 'continue' if trie_iterator_get_key() returns NULL.
654 2013-10-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
656 Document availibility of alpha_char_strcmp()
658 * datrie/alpha-map.c (alpha_char_strcmp):
659 - Document that it's available since 0.2.7.
661 2013-10-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
663 Write a test for trie iterator.
665 * tests/test_iterator.c:
666 - Write test suite for trie iterator.
668 2013-10-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
670 Add skeleton test suites & a test for file I/O.
672 * configure.ac, Makefile.am, +tests/, +tests/Makefile.am:
673 - Add tests/ dir to the build system.
674 * +tests/utils.h, +tests/utils.c:
675 * +tests/test_file.c:
676 * +tests/test_iterator.c:
677 * +tests/test_store-retrieve.c:
678 * +tests/test_walk.c:
679 - Add skeleton for test suites.
680 * tests/utils.h, tests/utils.c, tests/test_file.c:
681 - Write test suite for file I/O.
683 2013-10-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
685 Add alpha_char_strcmp() API.
687 * datrie/alpha-map.h, datrie/alpha-map.c (+alpha_char_strcmp):
688 - Add alpha_char_strcmp() declaration & body.
689 * datrie/libdatrie.def, datrie/libdatrie.map:
690 - Add alpha_char_strcmp symbols.
692 2013-10-16 Theppitak Karoonboonyanan <thep@linux.thai.net>
694 Add missing info in alpha_map_add_range() doc.
696 * datrie/alpha-map.c (alpha_map_add_range):
697 - Add documentation on return value.
699 2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
701 Fix build for Visual Studio on Windows.
703 * datrie/dstring.c (dstring_append, dstring_append_string,
704 dstring_append_char, dstring_terminate):
705 - Cast (void *) pointers to (char *) before calculating offsets,
708 Thanks Gabi Davar for the report and fix (via Mikhail Korobov
709 <kmike84@gmail.com>).
711 2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
713 Check for doxygen required version.
716 - When doxygen-doc is enabled, also check doxygen version.
718 2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
723 - doxygen no longer ships with the FreeSans font. Just drop it.
725 2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
730 - Updated with 'doxygen -u'.
732 2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
734 Fix compiler warnings.
735 * datrie/trie-string.c (trie_string_append_string):
736 * datrie/trie.c (trie_iterator_get_key):
737 - Cast strlen() args from (const TrieChar *) to (const char *),
738 to fix signedness mismatch warnings.
740 2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
742 Fix automake warnings.
744 * datrie/Makefile.am, tools/Makefile.am:
745 - Replace deprecated INCLUDES with AM_CPPFLAGS.
747 2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
749 * configure.ac: Post-release version suffix added.
751 2013-01-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
753 * NEWS, configure.ac:
754 === Version 0.2.6 ===
756 2013-01-22 Theppitak Karoonboonyanan <thep@linux.thai.net>
758 Use xz compression for release tarball.
761 - Specify "dist-xz no-dist-gzip" options to AM_INIT_AUTOMAKE.
763 2012-08-06 Theppitak Karoonboonyanan <thep@linux.thai.net>
765 Improve AlphaMap range merging.
767 * datrie/alpha-map.c (alpha_map_add_range):
768 - Also try to merge adjacent ranges. Otherwise, adding one by one
769 character will result in linear search on alphabet set.
771 Thanks Mikhail Korobov <kmike84@gmail.com> for the report.
773 2012-08-05 Theppitak Karoonboonyanan <thep@linux.thai.net>
775 Migrate trie_enumerate() to the new TrieIterator.
777 This improves performance by 10%, and recursion stacks are also
780 * datrie/trie.c (trie_enumerate):
781 - Replace da_enumerate() call with TrieIterator loop.
782 * datrie/trie.c (-trie_da_enum_func, -_TrieEnumData):
783 * datrie/darray.h, datrie/darray.c
784 (-da_enumerate, -da_get_transition_key, -DAEnumFunc,
785 -da_enumerate_recursive):
786 - Drop now-unused codes.
788 2012-08-05 Theppitak Karoonboonyanan <thep@linux.thai.net>
790 Optimize key calculation for TrieIterator.
792 * datrie/Makefile.am +datrie/dstring.h +datrie/dstring-private.h
793 +datrie/dstring.c +datrie/trie-string.h +datrie/trie-string.c:
794 - Add dynamic string classes DString and TrieString.
796 - (TrieIterator): Add "key" dynamic trie string member for
797 incrementally gathering the key while iterating.
798 - Initialize "key" member to NULL on construction. Only allocate and
799 free it on branching root states.
800 * datrie/darray.h, datrie/darray.c
801 (da_first_separate, da_next_separate):
802 - Instead of allocating memory for return string, accept a dynamic
803 string object and update it while traversing.
804 * datrie/trie.c (trie_iterator_next):
805 - For branching state, create the "key" dynamic string object on
806 first iteration and pass it to da_first_separate() and
807 da_next_separate() along the iterations.
808 * datrie/trie.c (trie_iterator_get_key):
809 - Replace the total key reconstruction by da_get_transition_key()
810 with simple string catenation of the dynamic "key" and the suffix
812 * datrie/darray.h, datrie/darray.c (da_get_transition_key):
813 - Adjust to use dynamic string instead of total allocation.
814 * datrie/darray.c (da_enumerate_recursive):
815 - Adjust the da_get_transition_key() call accordingly.
817 Thanks Mikhail Korobov <kmike84@gmail.com> for the suggested approach
818 and for profiling check.
820 2012-07-31 Theppitak Karoonboonyanan <thep@linux.thai.net>
822 Add TrieIterator and its operations.
824 * datrie/trie.h, datrie/trie.c
825 (+trie_iterator_new, +trie_iterator_free, +trie_iterator_next,
826 +trie_iterator_get_key, +trie_iterator_get_data):
827 - Add TrieIterator class and its methods.
828 * datrie/libdatrie.def, datrie/libdatrie.map:
829 - Add the new export symbols.
830 * datrie/darray.h, datrie/darray.c
831 (da_get_state_key -> da_get_transition_key):
832 - Adjust da_get_state_key() from getting transition key from root
833 to getting from arbitrary ancestor.
834 * datrie/darray.h, datrie/darray.c
835 (+da_first_separate, +da_next_separate):
836 - Add internal functions for iterating from one separate node to
837 another in double-array structure.
839 Thanks Mikhail Korobov <kmike84@gmail.com> for the use case suggestion.
841 2012-07-30 Theppitak Karoonboonyanan <thep@linux.thai.net>
843 * doc/Doxyfile.in: Upgrade to doxygen 1.8.1.2 format.
845 2012-07-29 Theppitak Karoonboonyanan <thep@linux.thai.net>
847 * datrie/trie.c: Reformat source.
849 2012-07-29 Theppitak Karoonboonyanan <thep@linux.thai.net>
851 * datrie/trie.h, datrie/trie.c (trie_state_walkable_chars):
854 2012-07-27 Theppitak Karoonboonyanan <thep@linux.thai.net>
856 Add new API trie_state_walkable_chars() to allow breadth-first
859 * datrie/darray.h, datrie/darray.c:
860 - Move da_output_symbols() to darray.h, to be called by the new
862 - Move the Symbols class to darray.h, as required by
864 * datrie/trie.h, datrie/trie.c (+trie_state_walkable_chars):
865 - Add the new public function.
866 * datrie/libdatrie.map, datrie/libdatrie.def:
867 - Add the new symbol to export maps.
869 - Update library versioning to reflect API addition.
871 2012-07-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
873 * darray/darray.c (da_has_children): Accept (const DArray *) arg.
875 2012-07-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
877 * datrie/darray.c (da_has_children, da_output_symbols,
879 Calculate max_c candidate using num_cells - base instead of
880 TRIE_INDEX_MAX - base, to prevent more unnecessary loops.
882 2012-07-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
884 * datrie/trie.c (trie_state_get_data):
885 Check if the state is leaf, not just suffix, before getting data.
887 Thanks Mikhail Korobov <kmike84@gmail.com> for the report.
889 2012-07-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
891 * datrie/tail.h, datrie/tail.c:
892 * datrie/alpha-map.c:
893 * datrie/trie.h, datrie/trie.c:
894 * datrie/darray.c: Remove trailing spaces.
896 2012-07-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
898 * datrie/tail.c (tail_get_suffix): Fix function documentation.
900 Thanks Mikhail Korobov <kmike84@gmail.com> for the report.
902 2012-07-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
904 * datrie/darray.c, datrie/tail.c:
905 - Don't include <stdint.h> when compiled with MSVC, as the header is
906 missing there, and SIZE_MAX is provided in some other header.
908 Thanks Mikhail Korobov <kmike84@gmail.com> for the report.
910 2012-07-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
912 * configure.ac: Post-release version suffix added.
914 2011-11-04 Theppitak Karoonboonyanan <thep@linux.thai.net>
916 * NEWS, configure.ac:
917 === Version 0.2.5 ===
919 2011-08-04 Theppitak Karoonboonyanan <thep@linux.thai.net>
921 * datrie/alpha-map.h: Add missing 'extern "C"' for export functions
922 to fix problem with C++ compiler.
923 Thanks Aurimas ÄŒernius <aurisc4@gmail.com> for the patch.
925 2011-03-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
927 * configure.ac: Post-release version suffix added.
928 * datrie/trie.h: Add missing documentation for "user_data" parameter
931 2010-06-30 Theppitak Karoonboonyanan <thep@linux.thai.net>
933 * NEWS, configure.ac:
934 === Version 0.2.4 ===
936 2010-06-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
938 * datrie/alpha-map-private.h, datrie/alpha-map.c:
939 * datrie/darray.h, datrie/darray.c:
940 * datrie/tail.h, datrie/tail.c:
941 * datrie/trie.c (trie_fread, trie_fwrite):
942 Rename *_read() and *_write() functions to *_fread() and *_fwrite(),
943 for consistency with the trie_f{read,write}() function.
945 2010-06-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
947 Add trie_fread() and trie_fwrite() interfaces for reading/writing trie
948 data from an open file. Thanks NIIBE Yutaka <gniibe@fsij.org> for the
951 * datrie/trie.h (trie_fread, trie_fwrite): Add new API declarations.
952 * datrie/trie.c (trie_new_from_file, trie_fread, trie_save,
954 Refactor open file handling of trie_new_from_file() and trie_save()
955 into trie_fread() and trie_fwrite(), and make the old functions
956 do file opening/closing as wrappers to them.
957 * datrie/libdatrie.def, datrie/libdatrie.map: Add symbol exports.
959 2010-06-27 Theppitak Karoonboonyanan <thep@linux.thai.net>
961 * datrie/trie.c (trie_store_if_absent): Document that it's available
963 * datrie/libdatrie.def, datrie/libdatrie.map: Add symbol exports for
964 trie_store_if_absent().
965 * ChangeLog: Fix file locations in previous log.
967 2010-06-24 Theppitak Karoonboonyanan <thep@linux.thai.net>
969 Add trie_store_if_absent() interface to avoid race condition in
970 multi-thread applications. Thanks Dan Searle <dan.searle@censornet.com>
973 * datrie/trie.h (trie_store_if_absent): Add new API declaration.
974 * datrie/trie.c (trie_store_if_absent, trie_store,
975 trie_store_conditionally):
976 Refactor trie_store() into trie_store_conditionally() with extra arg
977 is_overwrite, and make the two public functions mere wrappers to it.
978 * configure.ac: Bump library version according to the added symbol.
980 2010-03-01 Theppitak Karoonboonyanan <thep@linux.thai.net>
982 * datrie/trie.c (trie_save): Do not return before closing file.
983 Thanks to Xu Jiandong for the report.
985 2010-03-01 Theppitak Karoonboonyanan <thep@linux.thai.net>
987 * configure.ac: Post-release version suffix added.
989 2010-02-27 Theppitak Karoonboonyanan <thep@linux.thai.net>
991 * configure.ac: Bump library revision.
992 * NEWS, configure.ac:
993 === Version 0.2.3 ===
995 2010-02-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
997 * datrie/*.h, datrie/*.c: Add my e-mail address to license header.
999 2010-02-24 Theppitak Karoonboonyanan <thep@linux.thai.net>
1001 * datrie/*.h, datrie/*.c: Add license header to every source file.
1003 2010-02-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
1005 Move documentation from *.h to *.c, so libdatrie developers have the
1006 doc at hand. Users can still read the doxygen-generated doc BTW.
1008 * datrie/alpha-map.h:
1009 * datrie/alpha-map.c:
1015 * datrie/tail.c: Move doc comments from *.h to *.c.
1016 * doc/Doxyfile.in: Add alpha-map.c, trie.c to INPUT.
1017 * doc/Makefile.am: Add *.c to doxygen.stamp dependency.
1019 2010-02-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
1021 * datrie/darray.c (da_read), datrie/tail.c (tail_read):
1022 Protect against possible integer overflow on malicious trie file.
1024 2010-02-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
1026 * configure.ac: Post-release version suffix added.
1028 Be more robust against corrupted trie files.
1029 * datrie/alpha-map.c (alpha_map_read_bin):
1030 * datrie/darray.c (da_read):
1031 * datrie/tail.c (tail_read):
1032 - Check all returns from file_read_*() and clean up properly on
1034 - Adjust existing clean up codes to the new structure
1036 2009-04-29 Theppitak Karoonboonyanan <thep@linux.thai.net>
1038 * configure.ac: Bump library revision.
1039 * NEWS, configure.ac:
1040 === Version 0.2.2 ===
1042 2009-04-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1044 * configure.ac: Check $datrie_cv_have_version_script against "yes",
1045 not "1", so symbol versioning works on GNU ld again.
1047 2009-04-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1049 * datrie/trie.c (trie_state_copy): Use bitwise copy instead of
1052 2009-04-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
1054 * configure.ac: Adjust variable name datrie_cv_have_version_script.
1056 2009-04-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
1058 Support locale charset query with libcharset, for mac and mingw.
1059 [Thanks Beamer User for the report.]
1061 * configure.ac: Check for locale_charset() from libiconv and
1062 nl_langinfo(CODESET) from libc. If neither is present, ask user to
1063 install GNU libiconv.
1064 * tools/trietool.c (init_iconv): Use locale_charset() to query locale
1065 charset if possible, fall back to nl_langinfo(CODESET) otherwise.
1067 2009-04-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
1069 Support alternative iconv implemetations.
1070 [Thanks cwt for the report.]
1072 * configure.ac: Check for GNU libconv or native libiconv if system libc
1073 doesn't have iconv().
1074 * tools/Makefile.am: Add ICONV_LIBS to linker options.
1076 2009-04-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
1078 Fall back to libtool for linkers that do not support -version-script.
1079 [Thanks bact' for the report. Thanks cwt for the test.]
1081 * configure.ac: Check whether linker supports -version-script.
1082 * datrie/Makefile.am, +datrie/libdatrie.def:
1083 Apply -version-script flag only when linker supports it. Otherwise,
1084 fall back to the old method based on libtool -export-symbols flag.
1086 2009-04-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
1088 * configure.ac: Post-release version suffix added.
1089 * configure.ac (AC_CONFIG_MACRO_DIR), Makefile.am (ACLOCAL_AMFLAGS):
1090 Add m4 dir as automake includes, as required by the new libtool.
1091 [Thanks cwt for the report and test.]
1093 2009-04-05 Theppitak Karoonboonyanan <thep@linux.thai.net>
1095 * configure.ac: Bump library revision.
1096 * NEWS, configure.ac:
1097 === Version 0.2.1 ===
1099 2009-04-05 Theppitak Karoonboonyanan <thep@linux.thai.net>
1101 * datrie-0.2.pc.in: Remove blank Requires: line.
1103 2009-04-03 Theppitak Karoonboonyanan <thep@linux.thai.net>
1105 * datrie/alpha-map.h, datrie/trie.h: Revise documentation.
1107 2009-04-03 Theppitak Karoonboonyanan <thep@linux.thai.net>
1109 * datrie/fileutils.h, datrie/fileutils.c
1110 (make_full_path, file_open, file_length): Remove unused codes.
1111 * datrie/triedefs.h (TrieIOMode): Remove unused typedef.
1113 2009-04-01 Theppitak Karoonboonyanan <thep@linux.thai.net>
1115 * datrie/Makefile.am, datrie/libdatrie.def -> datrie/libdatrie.map:
1116 Replace libtool symbol exports with symbol versioning, to ease
1117 upgrading across SONAME.
1119 2009-03-31 Theppitak Karoonboonyanan <thep@linux.thai.net>
1123 * tools/trietool.c (conv_to_alpha): Cast 'out_p' pointer before
1125 * tools/trietool.c (command_add_list, command_delete_list):
1126 Make sure 'saved_conv' is initialized before use.
1127 * datrie/trie.c (trie_new_from_file): Remove unused 'alt_map' var.
1129 2009-03-31 Theppitak Karoonboonyanan <thep@linux.thai.net>
1131 * configura.ac: Post-release version suffix added.
1133 * datrie/trie.h (trie_save): Document parameter 'path'.
1134 * doc/Doxygen.in: Update format to doxygen 1.5.8.
1136 2009-03-24 Theppitak Karoonboonyanan <thep@linux.thai.net>
1138 * NEWS, configure.ac:
1139 === Version 0.2.0 ===
1141 2009-03-24 Theppitak Karoonboonyanan <thep@linux.thai.net>
1143 * Makefile.am, +README.migration:
1144 Add migration documentation.
1146 2008-12-29 Theppitak Karoonboonyanan <thep@linux.thai.net>
1148 * datrie/alpha-map.c (alpha_map_char_to_trie, alpha_map_trie_to_char):
1149 Tighten the loop for more readability, plus eliminating one duplicated
1152 2008-12-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1154 * datrie/datrie.c (da_get_base, da_get_check, da_set_base,
1156 Revert lower bound checks. It's no use checking too much for internal
1159 2008-12-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1161 * datrie/trie.h, datrie/trie.c, datrie/libdatrie.def
1162 (trie_state_is_leaf, +trie_state_is_single):
1163 - Introduce a new state condition: single. A single state is a state
1164 in a single path, with no other branch til its leaf.
1165 - Redefine trie_state_is_leaf() as a macro based on it and
1166 trie_state_is_terminal().
1168 2008-12-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
1170 * datrie/trie.h, datrie/trie.c, datrie/libdatrie.def (trie_state_copy):
1171 Add a new API function for trie state reuse support.
1173 2008-12-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
1175 * tools/trietool.c (conv_to_alpha): Use 'unsigned char' instead of
1176 'uint8'. Better not tie to datrie internal notations too much.
1178 2008-12-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
1180 * configure.ac: Post-release version bump.
1182 * tools/trietool.c (conv_to_alpha): Use uint8 to access data bytes
1183 instead of char, to fix char signedness bug.
1185 2008-12-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
1187 * NEWS, configure.ac:
1188 === Version 0.1.99.2 ===
1190 2008-12-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
1192 * man/Makefile.am, man/trietool.1 -> man/trietool-0.2.1:
1193 Rename 'trietool' man page to 'trietool-0.2', according to the
1194 corrsponding binary.
1196 2008-12-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
1198 * tools/Makefile.am: Rename 'trietool' program to 'trietool-0.2',
1199 to allow co-existence with datrie 0.1.x.
1201 2008-12-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
1203 * datrie/darray.c (da_read):
1204 * datrie/tail.c (tail_read):
1205 Restore file pointer on signature check failure.
1207 2008-12-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
1209 * man/trietool.1: Document that no more than 255 alphabets are allowed.
1211 2008-12-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
1213 Ensure that ranges in AlphaMap are always sorted and don't overlap.
1215 * datrie/alpha-map.c (struct _AlphaMap, alpha_map_new):
1216 - Remove 'last_range' member
1217 * datrie/alpha-map.c (alpha_map_add_range):
1218 - Check if the new range overlaps existing ranges and merge them
1221 2008-12-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
1223 * configure.ac: Post-release version bump.
1224 * configure.ac, Makefile.am, datrie.pc.in -> datrie-0.2.pc.in:
1225 Rename pkg-config file, to allow co-existence with datrie 0.1.x.
1227 2008-12-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
1229 * NEWS, configure.ac:
1230 === Version 0.1.99.1 ===
1232 2008-12-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
1234 * man/trietool.1: Update document
1235 - Trie is now stored in a single '*.tri' file
1236 - The alphabet map is renamed from '*.sbm' to '*.abm'
1237 - Mention Unicode, instead of single-byte character domain
1238 - Document the options for 'add-list' and 'delete-list' commands
1239 - Adjust troff formatting commands
1241 2008-12-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
1243 * tools/trietool.c (prepare_trie):
1244 - Try to read alphabet map from '*.abm' instead of '*.sbm'
1246 2008-12-11 Theppitak Karoonboonyanan <thep@linux.thai.net>
1248 Allow specifying character encoding for word list file.
1250 * tools/trietool.c (command_add_list, command_delete_list):
1251 - Add '-e|--encoding ENC' option which temporarily override locale's
1252 codeset for character conversion
1253 * tools/trietool.c (usage):
1254 - Update usage message accordingly
1256 2008-12-09 Theppitak Karoonboonyanan <thep@linux.thai.net>
1258 Use const where possible + general clean-ups.
1260 * datrie/alpha-map-private.h, datrie/alpha-map.c (alpha_map_write_bin):
1261 * datrie/alpha-map.h, datrie/alpha-map.c (alpha_map_clone):
1262 * datrie/alpha-map.c (alpha_map_get_total_ranges):
1263 - Accept (const AlphaMap *) arg
1264 * datrie/alpha-map.c (alpha_map_char_to_trie_str):
1265 - Rename 'alphabet_str' to 'trie_str', to be more sensible
1267 * datrie/darray.h, datrie/darray.c (da_write, da_walk, da_enumerate):
1269 (da_output_symbols, da_get_state_key, da_enumerate_recursive):
1270 - Accept (const DArray *) arg
1271 * datrie/darray.h, datrie/darray.c (da_free):
1272 - Made void function, instead of int
1273 * datrie/darray.c (da_new):
1274 - Set CHECK[0] = d->num_cells, to be more clear
1275 * datrie/darray.c (da_write, da_extend_pool):
1276 - Update CHECK[0] whenever DArray::num_cells is changed, instead of
1277 just setting it before writing; so da_write() can now accept
1278 (const DArray *) arg
1280 * datrie/tail.h, datrie/tail.c
1281 (tail_write, tail_get_data, tail_walk_str, tail_walk_char):
1282 - Accept (const Tail *) arg
1283 * datrie/tail.h, datrie/tail.c (tail_free):
1284 - Made void function, instead of int
1286 * datrie/trie.c (struct _TrieState, struct _TrieEnumData):
1287 - 'trie' member is now const pointer
1288 * datrie/trie.h, datrie/trie.c
1289 (trie_new, trie_is_dirty, trie_retrieve, trie_enumerate, trie_root):
1290 * datrie/trie.c (trie_state_new):
1291 - Accept (const Trie *) arg
1293 2008-12-09 Theppitak Karoonboonyanan <thep@linux.thai.net>
1295 Unicode (UCS-4) character support.
1297 * datrie/triedefs.h (AlphaChar):
1298 - unsigned char -> uint32
1300 * datrie/alpha-map.h, datrie/alpha-map.c, datrie/libdatrie.def:
1301 - Export alpha_char_strlen() utility routine
1304 (ProgEnv, init_conv, conv_to_alpha, conv_from_alpha, close_conv):
1305 - Add routines for converting characters between locale (LC_CTYPE)
1307 * tools/trietool.c (main):
1308 - Initialize and close conversion routines
1310 (command_add, command_add_list, command_delete, command_delete_list,
1311 command_query, list_enum_func, command_list):
1312 - Convert character encodings between I/O and trie
1314 2008-12-09 Theppitak Karoonboonyanan <thep@linux.thai.net>
1316 * datrie/trie.c (trie_retrieve, trie_store):
1317 - Use (AlphaChar *), not (TrieChar *), as key pointer type
1319 2008-12-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
1321 * datrie/trie.c (trie_retrieve):
1322 - Remove unused var 'len'
1323 - Compare AlphaChar with integer zero rather than '\0'
1325 2008-12-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
1327 Adjust APIs for in-memory trie support.
1329 * datrie/trie.c (struct _Trie):
1330 - Remove 'file' member; now trie is detached from file; file is
1331 closed after loading, and reopened when saving
1332 * datrie/trie.h, datrie/trie.c (trie_new):
1333 - Add public APIs: trie_new(), for non-file usage
1334 - One can still save it to file with trie_save(), BTW
1335 * datrie/trie.h, datrie/trie.c (trie_open, trie_new_from_file):
1336 - Rename trie_open() to trie_new_from_file() and make it accept only
1337 one pathname parameter, instead of separated dir and name
1338 - Alphabet map is now mandatory, rather than optional
1339 * datrie/trie.h, datrie/trie.c (trie_close, trie_free):
1340 - Rename trie_close() to trie_free() and do not bother with saving
1342 * datrie/trie.h, datrie/trie.c (trie_save):
1343 - Accept file path argument and open the file for saving
1344 * datrie/trie.h, datrie/trie.c (trie_is_dirty):
1345 - Add public API: trie_is_dirty() for client to determine whether
1348 * datrie/alpha-map-private.h:
1349 - Separate internal APIs from public
1350 * datrie/alpha-map.h, datrie/alpha-map.c:
1351 - Promote alpha_map_new() and alpha_map_add_range() to public;
1352 they are now needed by trie_new()
1353 - Remove alpha_map_open()
1354 - Add public API: alpha_map_clone()
1355 - Document public APIs
1357 * datrie/darray.h, datrie/darray.c (da_new):
1358 - Add internal API: da_new() needed by trie_new()
1359 - Code migrated from new-file case in da_read()
1360 * datrie/darray.c (da_read):
1361 - No longer handle new file; read failure means an error
1363 * datrie/tail.h, datrie/tail.c (tail_new):
1364 - Add internal API: tail_new() needed by trie_new()
1365 - Code migrated from new-file case in tail_read()
1366 * datrie/tail.c (TAIL_SIGNATURE):
1367 - Update TAIL_SIGNATURE to harmonize with other data parts
1368 * datrie/tail.c (tail_read):
1369 - No longer handle new file; read failure means an error
1371 * tools/trietool.c (prepare_trie, close_trie):
1372 - Add helper function for openning and closing trie
1373 * tools/trietool.c (main):
1374 - Open and close trie with prepare_trie() and close_trie()
1376 * datrie/Makefile.am:
1377 - Install alpha-map.h as public header
1378 - Add alpha-map-private.h to source list
1379 * datrie/libdatrie.def:
1380 - Update exported symbols
1382 2008-12-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
1384 Rename AlphaMap functions to be more logical.
1386 * datrie/alpha-map.c, datrie/alpha-map.h: Rename functions
1387 - alpha_map_char_to_alphabet -> alpha_map_char_to_trie
1388 - alpha_map_alphabet_to_char -> alpha_map_trie_to_char
1389 - alpha_map_char_to_alphabet_str -> alpha_map_char_to_trie_str
1390 - alpha_map_alphabet_to_char_str -> alpha_map_trie_to_char_str
1392 * datrie/trie.c (trie_retrieve, trie_store, trie_delete,
1393 trie_da_enum_func, trie_state_walk, trie_state_is_walkable):
1394 - Call the AlphaMap functions with the new names
1396 2008-12-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
1398 Merge SBTrie alphabet mapping feature into Trie.
1400 * datrie/triedefs.h (AlphaChar):
1401 - Add AlphaChar typedef, as well as ALPHA_CHAR_ERROR macro
1402 (moved from UniChar type in datrie/alpha-map.h)
1404 * datrie/alpha-map.c (alpha_char_strlen):
1405 - Add string length function for alphabet string
1406 * datrie/alpha-map.c (struct _AlphaRange):
1407 - Use AlphaChar type instead of UniChar for begin, end members
1408 * datrie/alpha-map.c (alpha_map_get_total_ranges):
1409 - Add range count private method
1410 * datrie/alpha-map.c (alpha_map_add_range):
1411 - Add private method for adding range (refactored from
1413 * datrie/alpha-map.c (alpha_map_open):
1414 - Call alpha_map_add_range() to add range, instead of doing low-level
1416 * datrie/alpha-map.c, datrie/alpha-map.h
1417 (alpha_map_read_bin, alpha_map_write_bin):
1418 - Add methods for binary format I/O
1419 * datrie/alpha-map.c, datrie/alpha-map.h
1420 (alpha_map_char_to_alphabet, alpha_map_alphabet_to_char):
1421 - Accept and return AlphaChar, instead of UniChar
1422 * datrie/alpha-map.c, datrie/alpha-map.h
1423 (alpha_map_char_to_alphabet_str, alpha_map_alphabet_to_char_str):
1424 - Add public methods for mapping strings (migrated from
1425 sb_map_char_to_alphabet_str and sb_map_alphabet_to_char_str in
1428 * datrie/trie.c (struct _Trie):
1429 - Add alpha_map member
1430 * datrie/trie.c (trie_open):
1431 - Add code to read AlphaMap data block, and prefer text-formatted
1433 - Defer Trie object allocation to after file openning
1434 * datrie/trie.c (trie_close):
1435 - Free alpha_map member
1436 * datrie/trie.c (trie_save):
1437 - Add code to write AlphaMap data block
1438 * datrie/trie.c, datrie/trie.h (trie_retrieve, trie_store, trie_delete,
1439 trie_da_enum_func, trie_state_walk, trie_state_is_walkable):
1440 - Adjust function prototypes to accept AlphaChar instead of TrieChar
1441 - Add mapping between alphabet and trie character code
1442 * datrie/trie.h (TrieEnumFunc):
1443 - Adjust function typedef to accept AlphaChar instead of TrieChar
1445 * datrie/Makefile.am:
1446 - Remove sb-trie.c and sb-trie.h from source/header list
1447 * datrie/libdatrie.def:
1448 - Remove sb_trie symbols
1451 - Call trie_* functions instead of sb_trie_*
1453 2008-12-03 Theppitak Karoonboonyanan <thep@linux.thai.net>
1455 Adjust file format by catenating *.br and *.tl data into a single
1458 * datrie/trie.c (struct _Trie):
1459 - Add 'file' and 'is_dirty' members
1460 * datrie/trie.c (trie_open):
1461 - Open the file and call da_read() and tail_read() to load data
1462 portions, instead of openning separate files
1463 * datrie/trie.c (trie_close):
1464 - Do the saving stuff and free DArray and Tail data, instead of
1465 separately closing them; then finally close the file
1466 * datrie/trie.c (trie_save):
1467 - Write file portions with da_write() and tail_write() instead of
1468 saving to separate files
1469 - Handle the 'is_dirty' stuffs
1470 * datrie/trie.c (trie_store, trie_branch_in_branch, trie_delete):
1471 - Set the 'is_dirty' flag
1473 * datrie/darray.h: Change prototypes for internal APIs whose
1474 functionalities are to be reduced:
1475 - da_open(path, name, mode) -> da_read(FILE*)
1476 - da_close(DArray*) -> da_free(DArray*)
1477 - da_save(DArray*) -> da_write(DArray*, FILE*)
1479 * datrie/darray.c (struct_DArray):
1480 - Drop 'file' and 'is_dirty' members
1481 * datrie/darray.c (da_open -> da_read):
1482 - Accept (FILE *) argument and drop file openning/closing codes
1483 - Store number of cells at CHECK[0], so double-array data size can
1484 determined without depending on file size
1485 - Do not allocate DArray object until needed
1486 - Drop 'is_dirty' stuffs
1487 * datrie/darray.c (da_close -> da_free):
1488 - Remove file stuffs; just free memory
1489 * datrie/darray.c (da_save -> da_write):
1490 - Accept (FILE *) argument and use it instead of DArray::file
1491 - Ensure CHECK[0] stores the number of cells
1492 - Drop 'is_dirty' stuffs
1493 * datrie/darray.c (da_set_base, da_set_check):
1494 - Drop 'is_dirty' stuffs
1496 * datrie/tail.h: Change prototypes for internal APIs whose
1497 functionalities are to be reduced:
1498 - tail_open(path, name, mode) -> tail_read(FILE*)
1499 - tail_close(Tail*) -> tail_free(Tail*)
1500 - tail_save(Tail*) -> tail_write(Tail*, FILE*)
1502 * datrie/tail.c (struct _Tail):
1503 - Drop 'file' and 'is_dirty' members
1504 * datrie/tail.c (tail_open -> tail_read):
1505 - Accept (FILE *) argument and drop file openning/closing codes
1506 - Check for new file from read failure, rather than file size
1507 - Do not allocate Tail object until needed
1508 - Drop 'is_dirty' stuffs
1509 * datrie/tail.c (tail_close -> tail_free):
1510 - Remove file stuffs; just free memory
1511 * datrie/tail.c (tail_save -> tail_write):
1512 - Accept (FILE *) argument and use it instead of Tail::file
1513 - Drop 'is_dirty' stuffs
1514 * datrie/tail.c (tail_set_suffix, tail_set_data, tail_free_block):
1515 - Drop 'is_dirty' stuffs
1517 2008-12-01 Theppitak Karoonboonyanan <thep@linux.thai.net>
1519 Get rid of the weird TrieIndexInt intermediate type, by checking
1520 ranges instead. (Changes merged from r_0_1_x-branch)
1522 * datrie/darray.c: Remove typedef for TrieIndexInt.
1523 * datrie/darray.c (da_check_free_cell, da_extend_pool):
1524 - Accept normal TrieIndex arg instead of TrieIndexInt
1525 * datrie/datrie.c (da_insert_branch):
1526 - Define 'base', 'next' vars as TrieIndex instead of TrieIndexInt
1527 - Check overflow for 'next' before checking if the cell is free
1528 * datrie/datrie.c (da_find_free_base):
1529 - Define 's' var as TrieIndex instead of TrieIndexInt
1530 * datrie/datrie.c (da_fit_symbols):
1531 - Check overflow for (base + sym) before checking if the cell is free
1532 * datrie/datrie.c (da_get_base, da_get_check, da_set_base,
1534 - Also check lower bound for index range
1536 2008-11-27 Theppitak Karoonboonyanan <thep@linux.thai.net>
1538 First changes to break ABI for larger trie index.
1540 * datrie/triedefs.h: Redefine TrieIndex and TrieData as int32.
1541 Update TRIE_INDEX_MAX accordingly.
1542 * datrie/darray.c (da_open, da_save): Redefine DA_SIGNATURE.
1543 Read/write 32-bit data in headers.
1544 * datrie/darray.c (da_has_children, da_output_symbols,
1546 Declare characters as TrieIndex instead of uint16.
1547 * datrie/tail.c (tail_open, tail_save): Redefine TAIL_SIGNATURE.
1548 Read/write 32-bit data in headers. Use 16-bit length for each block.
1549 * configure.ac: Bump up library version to 1.0.0.
1551 2008-06-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
1553 * man/trietool.1: Use troff .in command to indent text, fixing warning
1554 from 'groff --warnings'. Thanks Debian's lintian.
1556 2008-06-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
1558 * datrie/tail.c (tail_set_suffix):
1559 * datrie/sb-trie.c (sb_map_char_to_alphabet_str):
1560 Fix GCC warnings about char signedness.
1562 2008-01-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1564 * configure.in: Bump the library revision.
1566 === Version 0.1.3 ===
1568 2008-01-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1570 * man/trietool.1: Add documentation for the SBM file.
1572 2008-01-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1574 * README: Fix my name in the reference.
1576 2008-01-10 Theppitak Karoonboonyanan <thep@linux.thai.net>
1578 * datrie/tail.c (tail_set_suffix): Fix bug for the case in which
1579 suffix argument and tail's suffix overlap. Bug report and patch by
1580 shepmaster in http://linux.thai.net/node/102.
1582 2008-01-10 Theppitak Karoonboonyanan <thep@linux.thai.net>
1584 * datrie/sb-trie.c (sb_trie_root): Return NULL pointer, rather than
1585 FALSE. Bug reported by shepmaster in http://linux.thai.net/node/101.
1587 2007-10-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
1589 * datrie/libdatrie.def: List only symbols in plain format, for Mac
1590 build. Thanks Vee Satayamas for the report.
1592 * datrie/Makefile.am: Add libdatrie.def as libdatrie_la_DEPENDENCIES.
1594 2007-08-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1596 * doc/Doxyfile.in: Only generate doc for public API.
1598 2007-08-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1600 * doc/Makefile.am, doc/Doxyfile.in: Revert API man pages generation
1601 and installation. Update Doxyfile format to doxygen 1.5.3.
1603 2007-08-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
1605 * man/trietool.1: Escape some minus signs. Mark a variable italic.
1606 Thanks debian's lintian.
1608 2007-08-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
1610 * configure.ac: Post-release version bump.
1612 2007-08-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
1614 * configure.ac: Bump lib revision.
1616 === Version 0.1.2 ===
1618 2007-08-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
1620 * datrie/Makefile.am, +datrie/trie-private.h (MIN_VAL, MAX_VAL):
1622 * datrie/darray.c (da_output_symbols): Adjust loop boundary to be more
1624 * "-------------" (da_has_children, da_relocate_base): Apply the same
1625 loop pattern to prevent out-of-range accesses.
1627 2007-08-24 Theppitak Karoonboonyanan <thep@linux.thai.net>
1629 * datrie/darray.c (da_output_symbols): Do not try to test symbols
1630 beyond trie index range. Fixes segfault for trietool list command.
1632 2007-08-19 Theppitak Karoonboonyanan <thep@linux.thai.net>
1634 Handle double array index overflow.
1636 * datrie/triedefs.h (TRIE_INDEX_MAX): Define maximum index value.
1637 * datrie/darray.c (TrieIndexInt): Define type for immediate values, so
1638 overflow can be detected.
1639 * "-------------" (da_extend_pool): Return success/failure status.
1640 Accept TrieIndexInt argument for overflow detection.
1641 * "-------------" (da_check_free_cell): False when extending fails.
1642 Accept TrieIndexInt argument for overflow detection.
1643 * "-------------" (da_find_free_base): Return error on failure.
1644 * "-------------" (da_insert_branch): Return error on failure.
1645 * datrie/trie.c (trie_branch_in_branch, trie_branch_in_tail): Check
1646 for failure from da_insert_branch() and return the status.
1647 * datrie/darray.{c,h} (da_prune_upto, da_prune): Add da_prune_upto(),
1648 for rolling back partial operation in trie_branch_in_branch().
1649 Redefine da_prune() in terms of da_prune_upto().
1651 2007-08-16 Theppitak Karoonboonyanan <thep@linux.thai.net>
1653 * datrie/darray.c (da_open, da_find_free_base): Use DA_POOL_BEGIN
1654 macro instead of hard-coded number. Remove unused DA_EXTENDING_STEPS.
1656 2007-05-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
1658 * datrie/sb-trie.c (sb_trie_close, sb_trie_save, sb_trie_retrieve,
1659 sb_trie_store, sb_trie_enumerate, sb_trie_root, sb_trie_state_clone,
1660 sb_trie_state_free, sb_trie_state_rewind, sb_trie_state_walk,
1661 sb_trie_state_is_walkable, sb_trie_state_is_terminal,
1662 sb_trie_state_is_leaf, sb_trie_state_get_data):
1663 Guard against NULL pointers in functions. Thanks to Neutron Soutmun
1664 for bug report and initial patch.
1666 2007-04-06 Theppitak Karoonboonyanan <thep@linux.thai.net>
1668 * doc/Makefile.am: Add install-man target. Also install/uninstall
1669 doxygen-generated man pages.
1671 2007-03-27 Theppitak Karoonboonyanan <thep@linux.thai.net>
1673 * configure.ac (LT_CURRENT, LT_REVISION, LT_AGE),
1674 datrie/Makefile.am (libdatrie_la_LDFLAGS), +datrie/libdatrie.def:
1675 Add library version info. Limit exported symbols with -export-symbols
1676 flag. Always pass -no-undefined flag.
1678 * configure.ac: Add Win32 DLL building support.
1680 2006-11-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
1682 * datrie/fileutils.{c,h} (file_read_int32, file_write_int32): Add
1683 int32 read/write functions.
1685 * datrie/fileutils.c (file_read_int16, file_write_int16): Use unsigned
1686 char buffer instead of and-ing with 0xff, in accordance with int32
1687 functions. (Thanks to Vee Satayamas for suggestion).
1689 2006-10-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
1691 * configure.ac: Post-release version bump.
1693 2006-10-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
1696 === Version 0.1.1 ===
1698 2006-10-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
1700 * configure.ac, Makefile.am, +man/Makefile.am, +man/trietool.1:
1701 Add manpage for trietool (moved from debian/).
1703 2006-10-11 Theppitak Karoonboonyanan <thep@linux.thai.net>
1705 Fixed compiler warnings.
1707 * datrie/sb-trie.c (sb_map_alphabet_to_char_str):
1708 * datrie/tail.c (tail_open, tail_save, tail_set_suffix):
1709 * datrie/trie.c (trie_da_enum_func): Cast pointers to get rid of
1710 compiler warnings about char signedness.
1712 * tools/trietool.c (list_enum_func): Return value on exit.
1714 2006-09-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
1716 * configure.ac: Post-release version bump.
1718 2006-09-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
1720 * NEWS, configure.ac:
1721 === Version 0.1.0 ===
1723 2006-09-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
1725 * README: Filled in.
1727 2006-09-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
1729 * datrie/triedefs.h, datrie/trie.h, datrie/sb-trie.h: Included headers
1730 using system header forms in installed headers.
1732 * datrie/Makefile.am (INCLUDES): Added include flag to ensure it
1733 compiles without prior installation.
1735 2006-09-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
1737 * datrie/alpha-map.c (alpha_map_char_to_alphabet,
1738 alpha_map_alphabet_to_char): Made sure terminator is always mapped
1741 2006-09-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
1743 * datrie/darray.{h,c} (da_is_walkable),
1744 datrie/tail.{h,c} (tail_is_walkable_char): Made the tiny functions
1745 inline (i.e. macros), for tiny performance gain.
1747 2006-09-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
1749 * datrie/sb-trie.{h,c} (+sb_trie_state_is_walkable): Added walkability
1752 * datrie/sb-trie.h (sb_trie_state_is_terminal, sb_trie_state_is_leaf),
1753 datrie/trie.h (trie_state_is_terminal, trie_state_is_leaf): Fixed typo
1754 for "\brief" doxygen tag.
1756 2006-09-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
1758 * datrie/trie.{h,c} (trie_state_is_terminal, +trie_state_is_walkable):
1759 Changed trie_state_is_terminal() into a generic walkability test, and
1760 made itself a specialized macro calling the function.
1762 2006-08-31 Theppitak Karoonboonyanan <thep@linux.thai.net>
1764 * datrie/darray.{h,c} (+da_is_walkable),
1765 datrie/tail.{h,c} (+tail_is_walkable_char),
1766 datrie/trie.c (tail_state_is_terminal): <Optimization> Tested
1767 walkability by peeking, instead of trying with a cloned state.
1769 * datrie/tail.{h,c} (tail_walk_char): Removed redundant const in
1772 2006-08-29 Theppitak Karoonboonyanan <thep@linux.thai.net>
1774 * datrie/trie.h, datrie/sb-trie.h: Wrapped extern "C" in public
1775 headers for compiling with C++ code.
1777 2006-08-22 Theppitak Karoonboonyanan <thep@linux.thai.net>
1779 * tools/trietool.c (decode_command): Exited with proper return values.
1781 * tools/trietool.c (command_add_list): Removed warning on missing data
1782 for keys. This would be normal for data-less dictionaries.
1784 2006-08-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
1786 * datrie/trie.{h,c} (trie_state_rewind),
1787 datrie/sb-trie.{h,c} (sb_trie_state_rewind): Added API to rewind a
1788 trie state to root, so users do not need to reallocate to do so.
1790 2006-08-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
1792 * datrie/alpha-map.c (alpha_map_open, alpha_map_new): Better used a
1793 dedicated function to initialize the map.
1795 2006-08-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
1797 * datrie/alpha-map.c (alpha_map_open): Initialized map list before
1798 using. Also skipped mal-formed input lines.
1800 * tools/trietool.c (command_add_list): Removed duplicated return.
1802 2006-08-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
1804 * configure.ac, Makefile.am, +datrie.pc.in: Added pkgconfig file.
1806 2006-08-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
1808 * datrie/sb-trie.{h,c} (sb_trie_state_is_terminal),
1809 datrie/trie.{h,c} (trie_state_is_terminal, trie_state_is_leaf):
1810 Added API for terminal node check and distinguish it from leaf node.
1811 (Terminal node can be in either branch or tail, while leaf can only
1814 2006-08-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
1816 * datrie/Makefile.am (pkginclude_HEADERS): Installed sb-trie.h.
1818 * datrie/sb-trie.h: Fixed file name in doxygen tag.
1820 2006-08-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
1822 * datrie/Makefile.am, +datrie/alpha-map.{h,c}, +datrie/sb-trie.{h,c}:
1823 Added alphabet map to map between character set and trie alphabet
1824 codes. Also added SBTrie wrapper for 8-bit character sets.
1826 * datrie/triedefs.h (TRIE_CHAR_MAX): Changed to 255, to fit char type.
1828 * datrie/trie.{h,c} (trie_state_walk): Removed unnecessary const in
1831 * tools/trietool.c: Used SBTrie instead of plain Trie.
1833 2006-08-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
1835 * datrie/fileutils.c (file_read_int16): Fixed bitwise calculation. The
1836 second byte should be masked to get rid of possible sign bits
1837 introduced by type conversion.
1839 2006-08-19 Theppitak Karoonboonyanan <thep@linux.thai.net>
1841 * datrie/fileutils.c (file_read_int16, file_write_int16): Used shift
1842 operations to serialize int, eliminating dependency on <arpa/inet.h>.
1843 Thanks Vee Satayamas for the suggestion.
1845 2006-08-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
1847 * datrie/trie.c (trie_retrieve, trie_store, trie_delete): Always walk
1848 the null-terminator in tail. Otherwise, comparison with shorter key
1849 will terminate at separate node.
1851 2006-08-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
1853 * datrie/darray.c (find_free_base): Extended pool before getting
1856 * tools/trietool.c (command_add_list): Let tab and comma be field
1857 delimitors, rather than white spaces in general.
1859 * tools/trietool.c (list_enum_func): Do not pad space when printing
1862 2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
1864 * configure.ac, Makefile.am, +doc/Makefile.am, +doc/Doxyfile.in:
1865 Generated document using doxygen.
1867 2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
1869 * datrie/darray.c (da_prune, da_num_children -> da_has_children):
1870 Just checked whether a node has at least one child, instead of
1871 counting children and comparing with zero, as a small optimization.
1873 2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
1875 * tools/trietool.c (command_add_list, command_delete_list):
1878 2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
1880 * datrie/trie.{h,c} (trie_enumerate), datrie/darray.{h,c}
1881 (da_enumerate, da_enumerate_recursive, da_get_state_key): Added key
1884 * tools/trietool.c (command_list): Implemented.
1886 2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
1888 * datrie/trie.{h,c} (trie_delete), datrie/darray.{h,c} (da_prune,
1889 da_num_children), datrie/tail.{h,c} (tail_delete): Added key deletion
1892 * datrie/tail.c (tail_save): Guarded against null suffix.
1894 * tools/trietool.c (command_delete): Implemented.
1896 2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
1898 * datrie/darray.c (da_find_free_base): Made sure the free cell for
1899 first symbol is beyond header cells. Also repeatedly extended the pool
1900 until a free cell is found, in case free list is restarted.
1902 2006-08-16 Theppitak Karoonboonyanan <thep@linux.thai.net>
1904 * datrie/fileutils.c (file_open): Created new file only if it does not
1907 * datrie/trie.c (trie_branch_in_branch): Also set data for tail block.
1909 * datrie/trie.c (trie_branch_in_tail): Do not free the const suffix
1910 block, fixing double free bug.
1912 * datrie/darray.c (da_insert_branch): Covered the case of negative
1913 base, for branching from a separate node.
1915 * tools/trietool.c (command_add): Removed debug message.
1917 2006-08-16 Theppitak Karoonboonyanan <thep@linux.thai.net>
1919 * configure.ac, Makefile.am, +tools/Makefile.am, +tools/trietool.c:
1920 Added trietool utility.
1922 * datrie/darray.c (da_get_free_list): Fixed typo in macro name.
1924 * datrie/datrie.c (da_extend_pool): Updated num_cells immediately
1925 after realloc(), to let the cell accesses pass boundary checks.
1927 * datrie/tail.c (tail_get_suffix, tail_set_suffix, tail_alloc_block,
1928 tail_free_block, tail_get_data, tail_set_data, tail_walk_str,
1929 tail_walk_char): Started tail blocks indexing from 1 (defined as
1930 TAIL_START_BLOCKNO macro) rather than 0, because we use signed values
1931 to distinguish pointers in darray.
1933 * datrie/tail.{c,h} (tail_get_suffix), datrie/trie.c
1934 (trie_branch_in_tail): Made tail_get_suffix return const pointer.
1936 * datrie/darray.c (da_close, da_save), datrie/tail.c (tail_close,
1937 tail_save): Checked errors and returned appropriate codes.
1939 * datrie/trie.c (trie_open): Checked errors on files openning and
1940 resumed appropriately.
1942 2006-08-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
1944 * datrie/Makefile.am, +datrie/fileutils.c: Added fileutils.c for
1945 implementation of file utility functions.
1947 * datrie/fileutils.{c,h}, datrie/darray.c (da_open), datrie/tail.c
1948 (tail_open): Adjusted file_read_int{8,16} API so error can be checked.
1950 2006-08-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
1952 * datrie/Makefile.am, +datrie/tail.c, datrie/tail.h: Added tail.c for
1953 trie suffix implementation. Adjusted some API to not require size_t.
1955 * datrile/fileutils.h: Added more functions required by tail.c.
1957 * datrie/trie.c (trie_branch_in_tail): Added check for null suffix.
1959 2006-08-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
1961 * datrie/Makefile.am, +datrie/darray.c, +datrie/fileutils.h:
1962 Added darray.c for double-array structure implementation, and
1963 fileutils.h declarations for keeping file manipulation functions.
1965 * datrie/triedefs.h: Added TRIE_CHAR_MAX constant for alphabet
1966 enumeration. Changed TRIE_INDEX_ERROR to 0, as negative number has its
1969 2006-08-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
1971 * === First import the project ===