1 2021-01-29 Theppitak Karoonboonyanan <theppitak@gmail.com>
6 2021-01-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
8 Update library versioning
10 * configure.ac: Bump library versioning to reflect API addition.
12 2021-01-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
14 Rename trie_byte_strlen() to trie_char_strsize().
16 The object of the function is TrieChar string. Let's keep
17 that semantics in the name.
19 * datrie/trie-string.h, datrie/trie-string.c
20 (trie_byte_strlen -> trie_char_strsize):
21 - Rename the function.
22 * datrie/tail.c (tail_get_serialized_size, tail_serialize):
23 - Replace trie_byte_strlen() calls with the new name.
25 2021-01-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
27 Revise test_serialization.
29 * tests/test_serialization.c (-trie_enum_mark_rec):
30 - Drop unused callback function.
31 * tests/test_serialization (main):
32 - Drop unused 'is_failed' variable.
33 - "%Ilu" -> "%lu" printf format.
34 - Rearrange error handling in stack unwinding style.
35 - Add '\n' to printf messages.
36 - Free 'trieSerializedData'.
38 We're not moving to C99 yet, but the declaration amid code is
39 too useful to remove. And it's just in the test code, not in
40 the main source. So we still allow it.
42 2021-01-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
44 Get rid of <unistd.h> include in the new test.
46 * tests/test_serialization.c (main):
47 - Replace unlink() calls with remove() from <stdio.h> and drop
50 2021-01-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
52 Adjust file-internal function declarations.
55 (parse_int16_be, serialize_int32_be, serialize_int16_be):
56 - Re-declare functions as static.
57 * datrie/fileutils.c (parse_int16_be):
58 - Make the 'buff' arg const pointer.
60 - Remove some blank lines in source.
62 2021-01-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
66 * datrie/tail.h (Tail typedef):
67 - Fix comment (Double-array -> Tail).
69 2021-01-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
74 * datrie/trie-string.c:
82 * tests/test_serialization.c:
83 - Use space before left parenthesis.
84 - Use old-style C comments.
85 - Remove trailing spaces.
88 2021-01-23 KOLANICH <KOLANICH@users.noreply.github.com>
90 Added serialization of the trie into a memory buffer.
93 (file_write_int32, +serialize_int32,
94 file_write_int16, +serialize_int16,
95 file_read_int32, +parse_int32_be,
96 file_read_int16, +parse_int16_be):
97 - Split binary read/write operations into separate functions.
98 * datrie/fileutils.h, datrie/fileutils.c
99 (+serialize_int32_be_incr, +serialize_int16_be_incr):
100 - Add serialization utility functions with pointer advancement.
101 * datrie/trie-string.h, datrie/trie-string.c
103 - Add utility method for calculating TrieChar string size in bytes.
105 * datrie/alpha-map-private.h, datrie/alpha-map.c
106 (+alpha_map_get_serialized_size, +alpha_map_serialize_bin):
107 - Add AlphaMap serialization methods.
108 * datrie/darray.h, datrie/darray.c
109 (+da_get_serialized_size, +da_serialize):
110 - Add DArray serialization methods.
111 * datrie/tail.h, datrie/tail.c
112 (+tail_get_serialized_size, +tail_serialize):
113 - Add Tail serialization methods.
114 * datrie/trie.h, datrie/trie.c
115 (+trie_get_serialized_size, +trie_serialize):
116 - Add Trie serialization methods.
117 * datrie/libdatrie.map, datrie/libdatrie.def:
118 - Add export symbols for Trie serialization.
120 * tests/Makefile.am, +tests/test_serialization.c:
121 - Add serialization test.
125 2021-01-22 Theppitak Karoonboonyanan <theppitak@gmail.com>
127 Get rid of <unistd.h> include.
129 * tests/test_file.c (main):
130 - Replace unlink() calls with remove() from <stdio.h> and drop
131 <unistd.h> include, fixing build issue on Windows.
133 Addressing Windows build issue differently from what proposed by
134 @fanc999 in pull request #15. Thanks @fanc999 for first raising this.
136 2021-01-15 Theppitak Karoonboonyanan <theppitak@gmail.com>
138 Use TRIE_CHAR_TERM in TAIL I/O methods.
140 * datrie/tail.c (tail_fwrite):
141 - Replace strlen() with trie_char_strlen() on suffix,
142 which is TrieChar string.
143 * datrie/tail.c (tail_fread):
144 - Append TRIE_CHAR_TERM, rather than literal zero,
145 as suffix terminator.
147 2021-01-15 Theppitak Karoonboonyanan <theppitak@gmail.com>
149 Use TRIE_CHAR_TERM in TrieIterator methods.
151 * datrie/trie.c (trie_iterator_get_key):
152 - Replace strlen() with trie_char_strlen() on tail_str,
153 which is TrieChar string.
154 - Check tail_str termination against TRIE_CHAR_TERM, not zero.
156 2021-01-14 Theppitak Karoonboonyanan <theppitak@gmail.com>
158 Fix wrong TRIE_CHAR_TERM semantics.
160 * datrie/trie.h (trie_state_is_terminal):
161 - Test for terminal state using zero AlphaChar.
162 TRIE_CHAR_TERM is a TrieChar, although it's also accidentally zero.
164 2021-01-14 Theppitak Karoonboonyanan <theppitak@gmail.com>
166 Reduce loops in alpha_map_recalc_work_area().
168 * datrie/alpha-map.c (alpha_map_recalc_work_area):
169 - Instead of pre-filling trie-to-alpha map with errors
170 and setting valid cells afterward, just fill error cells
171 left after valid cells are done. Then, finally set
174 2021-01-10 Theppitak Karoonboonyanan <theppitak@gmail.com>
176 Rewrite AlphaMap recalc.
178 * datrie/alpha-map.c (alpha_map_recalc_work_area):
179 Rewrite alpha-to-trie & trie-to-alpha maps recalculation
180 - For clearer relation between the two maps
181 - To allow other TRIE_CHAR_TERM values than zero
183 2021-01-09 Theppitak Karoonboonyanan <theppitak@gmail.com>
185 Use TRIE_CHAR_TERM macro instead of zero.
188 (alpha_map_char_to_trie, alpha_map_char_to_trie_str):
189 * datrie/trie.c (trie_branch_in_branch, trie_branch_in_tail):
190 * datrie/tail.c (tail_walk_str, tail_walk_char):
191 - Use TRIE_CHAR_TERM instead of hard-wired zero when working
192 with raw trie string termination.
193 * datrie/trie-string.c (trie_string_terminate):
194 - Append TRIE_CHAR_TERM instead of simply delegating to
197 2021-01-09 Theppitak Karoonboonyanan <theppitak@gmail.com>
199 Share static trie string functions internally.
201 * datrie/trie-string.h, datrie/trie-string.c, datrie/tail.c
202 (tc_strlen -> trie_char_strlen, tc_strdup -> trie_char_strdup):
203 - Move private functions in tail.c to trie-string.[ch],
204 with new full names under new "static trie string" section.
205 - Check/assign string terminator using TRIE_CHAR_TERM
207 * datrie/tail.c (tail_set_suffix):
208 - Call the new trie_char_strdup() instead of tc_strdup().
209 * datrie/alpha-map.c (alpha_map_trie_to_char_str):
210 - Call trie_char_strlen() instead of strlen().
212 2021-01-06 Theppitak Karoonboonyanan <theppitak@gmail.com>
214 Get rid of char semantics from TrieChar
216 * datrie/trie.c (trie_branch_in_branch, trie_branch_in_tail):
217 - Check null TrieChar with int zero instead of char.
219 2021-01-05 Theppitak Karoonboonyanan <theppitak@gmail.com>
221 Use proper #include form in installed header.
223 * datrie/alpha-map.h:
224 - Use angle quotes form instead of double quotes in #include.
226 2021-01-05 Theppitak Karoonboonyanan <theppitak@gmail.com>
228 Fix some documentations.
230 * datrie/trie.c (trie_is_dirty):
231 - Adjust wording to make clear the file is out of sync,
232 not the other way around.
233 * datrie/trie.c (trie_store, trie_store_if_absent):
234 - Fix typo in the description of 'key' parameter.
235 * datrie/trie.c (trie_store_if_absent):
236 - Minor wording adjustment (inserted, not appended).
238 2020-12-30 Theppitak Karoonboonyanan <theppitak@gmail.com>
240 Fix isspace() arg problem on NetBSD.
242 * tools/trietool.c (command_add_list, string_trim):
243 - Cast char to unsigned char before passing to isspace().
245 Thanks Sean <scole_mail@gmx.com> for the report via a personal mail.
247 2019-12-20 Theppitak Karoonboonyanan <theppitak@gmail.com>
249 Use GitHub issue tracker as bug report address.
252 - Replace bug report e-mail address with GitHub issue tracker URL.
254 2019-08-05 Theppitak Karoonboonyanan <theppitak@gmail.com>
256 Stop installing README.migration
258 It's supposed to be internal document now.
261 - Remove README.migration from doc_DATA.
263 2019-01-21 Theppitak Karoonboonyanan <theppitak@gmail.com>
265 Fix cross-compiling issue caused by AC_FUNC_MALLOC
268 - Replace AC_FUNC_MALLOC with AC_CHECK_FUNCS([malloc]),
269 as we don't rely on GNU's malloc(0) behavior.
271 Thanks Vanessa McHale for the report. Closes: #11
273 2018-11-23 Theppitak Karoonboonyanan <theppitak@gmail.com>
275 Fix wrong key listing in byte trie
277 * tests/Makefile.am, +tests/test_byte_list.c:
279 * datrie/alpha-map.c (alpha_map_recalc_work_area):
280 - Index trie_to_alpha_map[] using TrieIndex, not TrieChar type,
281 to prevent overflow upon incrementing over 0xff.
282 - Drop tc variable and just reuse trie_last.
284 Thanks @legale for the report.
287 https://github.com/tlwg/libdatrie/issues/9
289 2018-06-19 Theppitak Karoonboonyanan <theppitak@gmail.com>
292 - Bump library revision to reflect code changes.
295 === Version 0.2.12 ===
297 2018-06-19 Theppitak Karoonboonyanan <theppitak@gmail.com>
302 - Update document URL to HTTPS
304 2018-06-14 Theppitak Karoonboonyanan <theppitak@gmail.com>
306 Cast (wchar_t *) to fix warnings in tests
308 "%ls" printf() format requires (wchar_t *) [aka int *] arg.
309 So, let's cast (AlphaChar *) [aka unsigned int *] to satisfy it.
312 * tests/test_iterator.c:
313 * tests/test_store-retrieve.c:
315 * tests/test_nonalpha.c:
316 * tests/test_null_trie.c:
317 - Add <wchar.h> include, for wchar_t type
318 - Cast "%ls" args from (AlphaChar *) to (wchar_t *)
320 2018-06-06 Theppitak Karoonboonyanan <theppitak@gmail.com>
322 Avoid non-ANSI C snprintf()
324 * tools/trietool.c (+full_path, prepare_trie, close_trie):
325 - Instead of preparing full path name with snprintf(), which is
326 non-ANSI, and still risks path name trimming, do it with
327 size-calculated malloc().
328 - free() it as needed.
330 2018-06-04 Theppitak Karoonboonyanan <theppitak@gmail.com>
332 Fix sscanf() string format
334 * tools/trietool.c (prepare_trie):
335 - Define b, e as unsigned int, as required by "%x" format.
336 Fixing warning from '-Wformat=' gcc option.
338 2018-06-04 Theppitak Karoonboonyanan <theppitak@gmail.com>
340 Fix compiler warnings in tests
342 * tests/test_byte_alpha.c (main):
343 * tests/test_file.c (main):
344 * tests/test_iterator.c (main):
345 * tests/test_nonalpha.c (main):
346 * tests/test_null_trie.c (main):
347 * tests/test_store-retrieve.c (main):
348 * tests/test_term_state.c (main):
349 * tests/test_walk.c (main):
350 - Declare main function with 'main (void)'.
351 Fixing warning from '-Wstrict-prototypes' gcc option.
352 * tests/test_walk.c (main):
353 - Split long string, which required C90 compilers.
354 Fixing warning from '-Woverlength-strings' gcc option.
356 2018-06-04 Theppitak Karoonboonyanan <theppitak@gmail.com>
358 Duplicate TrieChar string in more portable manner
360 * datrie/tail.c (tail_set_suffix, +tc_strdup, +tc_strlen):
361 - Replace cast strdup() with crafted implementation,
362 allowing TrieChar to be of larger size than char.
363 Fixing warning from '-Wint-to-pointer-cast' gcc option.
365 2018-06-04 Theppitak Karoonboonyanan <theppitak@gmail.com>
369 * tools/trietool.c (usage):
370 - Split help message which was too long and required C90 compiler.
371 Caught by '-Woverlength-strings' gcc option.
373 2018-06-04 Theppitak Karoonboonyanan <theppitak@gmail.com>
375 Remove unused byte, word, dword typedefs
377 These are likely to conflict with other uses.
379 * datrie/typedefs.h (-byte, -word, -dword):
380 - Remove the unused typedefs
382 Thanks Peter Moulder for the patch.
384 2018-06-04 Theppitak Karoonboonyanan <theppitak@gmail.com>
386 Rename TRUE/FALSE in Bool enum to avoid clash
388 Some other header file may have already define TRUE/FALSE.
390 * datrie/typedefs.h (Bool):
391 - Rename FALSE, TRUE to DA_FALSE, DA_TRUE respectively,
392 and define FALSE, TRUE macros only if they haven't been defined.
394 Thanks Peter Moulder for the patch.
396 2018-06-04 Theppitak Karoonboonyanan <theppitak@gmail.com>
398 Declare argument-less functions with "(void)"
400 "f()" declaration form is K&R style, specifying that no information
401 about the number or types of parameters is supplied. This caused
402 warnings on '-Wstrict-prototypes' gcc option.
404 * datrie/alpha-map.h, datrie/alpha-map.c (alpha_map_new):
405 * datrie/darray.h, datrie/darray.c (da_new, symbols_new):
406 * datrie/tail.h, datrie/tail.c (tail_new):
407 * tests/utils.h, tests/utils.c (en_alpha_map_new, en_trie_new):
408 - Use "(void)" form in declaration
409 - Also use "(void)" form in definition, for consistency
411 Thanks Peter Moulder for the initial patch.
413 2018-05-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
415 Remove duplicate include
418 - Remove duplicate include <config.h>
420 2018-04-23 Theppitak Karoonboonyanan <theppitak@gmail.com>
422 Add missing include in test
424 * tests/test_byte_alpha.c:
425 - Add missing include for utils.h
427 2018-04-23 Theppitak Karoonboonyanan <theppitak@gmail.com>
430 - Bump library revision to reflect code changes.
433 === Version 0.2.11 ===
435 2018-04-21 Theppitak Karoonboonyanan <theppitak@gmail.com>
437 Fix reported segfault on full-range alpha map
439 * tests/Makefile.am, +tests/test_byte_alpha.c:
441 * datrie/alpha-map.c (alpha_map_recalc_work_area()):
442 - Redeclare trie_last as TrieIndex, to prevent overflow.
444 Thanks Xiao Wang for the report, and @nevermatch for the analysis.
447 https://github.com/tlwg/libdatrie/issues/6
449 2018-03-29 Theppitak Karoonboonyanan <theppitak@gmail.com>
451 Fix trie_state_get_data() at a prefix key
453 When getting data from a state which terminates a key that is
454 a prefix of another key, a terminator should be tried, so it
455 jumps from DA to TAIL, where we can get the data.
457 * tests/Makefile.am, +tests/test_term_state.c:
458 - Add a test case with {'ab', 'abc'} dictionary, which fails previous
459 code when retrieving data for key 'ab'.
460 * datrie/trie.c (trie_state_get_data()):
461 - Instead of simply checking for leaf state, which only caught a state
462 in TAIL, also try walking with a terminator when still in DA.
463 - Replace 'leaf state' with 'terminal state' in documentation,
465 - Also return error on null state pointer.
467 Thanks Filip Pytloun from the pytries project for the initial patch.
469 2017-09-06 Theppitak Karoonboonyanan <theppitak@gmail.com>
471 Revise description about search time complexity
474 - Clarify that search time is O(m), where m is the key length,
475 instead of O(1), while still claim that it's independent of
479 https://github.com/tlwg/libdatrie/issues/4
481 2016-12-14 Theppitak Karoonboonyanan <theppitak@gmail.com>
483 Include git-version-gen in tarball
486 - Add build-aux/git-version-gen to EXTRA_DIST.
488 2016-09-21 Theppitak Karoonboonyanan <theppitak@gmail.com>
490 Fix iconv() return value checking.
492 * tools/trietool.c (conv_to_alpha):
493 - Check iconv() return value against (size_t) -1, rather than
494 for its negativity, as size_t can be unsigned.
496 Thanks Daniel Macks for the report on Issue #3.
497 https://github.com/tlwg/libdatrie/issues/3
499 2016-09-21 Theppitak Karoonboonyanan <theppitak@gmail.com>
501 Use versioning based on Git snapshot.
504 - Add dist-hook to generate VERSION file on tarball generation.
505 * +build-aux/git-version-gen:
506 - Add script to generate version based on 'git describe'
507 if in git tree, or using VERSION file if in release tarball.
509 - Call git-version-gen to get package version.
511 2015-10-20 Theppitak Karoonboonyanan <theppitak@gmail.com>
514 - Bump library revision to reflect code changes.
516 * NEWS, configure.ac:
517 === Version 0.2.10 ===
519 2015-10-13 Theppitak Karoonboonyanan <theppitak@gmail.com>
521 Optimize AlphaMap mapping.
523 alpha_map_char_to_trie() is called everywhere before trie state
524 transition. It's an important bottleneck.
526 We won't change the persistent AlphaMap structure, but will add
527 pre-calculated lookup tables for use at run-time.
529 * datrie/alpha-map.c (struct _AlphaMap):
530 - Add members for alpha-to-trie and trie-to-alpha lookup tables.
531 * datrie/alpha-map.c (alpha_map_new, alpha_map_free):
532 - Initialize & free the tables properly.
533 * datrie/alpha-map.c (alpha_map_add_range -> alpha_map_add_range_only
534 + alpha_map_recalc_work_area):
535 - Split alpha_map_add_range() API into two parts: adding the range
536 as usual and recalculate the lookup tables.
537 * datrie/alpha-map.c (alpha_map_clone, alpha_map_fread_bin):
538 - Call alpha_map_add_range_only() repeatedly before calling
539 alpha_map_recalc_work_area() once.
540 * datrie/alpha-map.c (alpha_map_char_to_trie, alpha_map_trie_to_char):
541 - Look up the pre-calculated tables instead of calculating on
544 This appears to save time by 14.6% for total alpha_char_to_trie()
545 calls and even lower its bottleneck rank by 1 rank on a libthai
546 test case. It reduces 0.2% run time of the total libthai test case.
548 Note that the time saved would be even more in case of multiple
549 uncontinuous alphabet ranges, at the expense of more memory used.
551 2015-08-18 Theppitak Karoonboonyanan <theppitak@gmail.com>
553 Fix doxygen version checking.
556 - Correctly compare doxygen versions. Simple expr comparison
557 didn't work with version 1.8.10.
559 Thanks Petr Gajdos <pgajdos@suse.cz> for the patch.
561 2015-06-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
563 * datrie/tail.c (tail_set_suffix):
564 - Catch strdup() failure.
566 2015-06-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
568 * configure.ac: Post-release version suffix added.
570 2015-05-03 Theppitak Karoonboonyanan <theppitak@gmail.com>
572 * NEWS, configure.ac:
573 === Version 0.2.9 ===
575 2015-05-03 Theppitak Karoonboonyanan <theppitak@gmail.com>
577 Use relative paths for symlinks.
579 * tools/Makefile.am, man/Makefile.am:
580 - Use relative paths for symlinks to avoid confusion in
581 installation with DESTDIR.
583 2015-05-03 Theppitak Karoonboonyanan <theppitak@gmail.com>
585 Also install symlink for old trietool.
588 - Add hooks to install/uninstall symlink for old man page.
590 2015-05-02 Theppitak Karoonboonyanan <theppitak@gmail.com>
593 - Bump library revision to reflect code changes.
595 2015-04-29 Theppitak Karoonboonyanan <theppitak@gmail.com>
597 Bump doxygen required version.
600 - Bump doxygen required version to 1.8.8, according to recent
603 2015-04-21 Theppitak Karoonboonyanan <theppitak@gmail.com>
605 Fix infinite loop on empty trie iteration.
607 * tests/Makefile.am, +tests/test_null_trie.c:
608 - Add test case for empty trie iteration.
610 * datrie/darray.c (da_first_separate):
611 - Fix error condition after loop ending.
613 Thanks Sergei Lebedev <sergei.a.lebedev@gmail.com> for the report
616 Original report: https://github.com/kmike/datrie/issues/17
618 2015-04-12 Theppitak Karoonboonyanan <theppitak@gmail.com>
620 Document about alphabet size.
623 - Add to doc comment a description on the alphabet size limit
624 and the mapped raw codes.
626 Thanks edgehogapp for the suggestion.
627 https://groups.google.com/forum/#!topic/thai-linux-foss-devel/U-O__IfviQ0
629 2015-04-11 Theppitak Karoonboonyanan <theppitak@gmail.com>
631 Clarify Symbols' struct & methods.
633 * datrie/darray.c (struct _Symbols):
634 - Use TRIE_CHAR_MAX + 1 instead of hard-coded value for symbols[]
637 Thanks edgehogapp for the suggestion.
638 https://groups.google.com/forum/#!topic/thai-linux-foss-devel/U-O__IfviQ0
640 * datrie/darray.h, datrie/darray.c (symbols_new, symbols_add):
641 - Hide symbols_new() and symbols_add() for internal use.
643 2015-03-06 Theppitak Karoonboonyanan <theppitak@gmail.com>
648 - Updated for doxygen 1.8.8 with 'doxygen -u'.
650 2015-03-02 Theppitak Karoonboonyanan <theppitak@gmail.com>
652 Catch realloc failure.
654 * datrie/tail.c (tail_alloc_block):
655 - Check realloc() result on t->tails reallocation and return
656 failure code if failed.
657 * datrie/tail.c (tail_add_suffix):
658 - Check return value from tail_alloc_block() and return failure
660 - Update documentation.
662 2015-03-02 Theppitak Karoonboonyanan <theppitak@gmail.com>
664 Catch realloc failure.
666 * datrie/darray.c (da_extend_pool):
667 - Check realloc() result on d->cells reallocation and handle
670 2015-02-27 Theppitak Karoonboonyanan <theppitak@gmail.com>
672 Catch malloc failure.
674 * datrie/tail.c (tail_fread):
675 - Check malloc() result on suffix string and exit properly.
677 2015-02-26 Theppitak Karoonboonyanan <theppitak@gmail.com>
679 More micro-optimization with LIKELY/UNLIKELY.
681 * datrie/alpha-map.c (alpha_map_char_to_trie, alpha_map_trie_to_char):
682 - Use UNLIKELY() when checking for NUL character.
684 2015-02-10 Theppitak Karoonboonyanan <theppitak@gmail.com>
686 Fix 'make distcheck' failure.
689 - Remove doxygen db file on clean.
691 2015-02-10 Theppitak Karoonboonyanan <theppitak@gmail.com>
693 More update of my e-mail address.
696 - Update my e-mail address.
698 2015-02-10 Theppitak Karoonboonyanan <theppitak@gmail.com>
700 Rename trietool-0.2 utility to trietool.
705 - Rename bin target from trietool-0.2 to trietool.
706 - Add hooks to install/uninstall symlink with old name.
707 * man/Makefile.am, man/trietool-0.2.1 -> man/trietool.1:
708 - Rename & update manpage accordingly.
710 2015-02-06 Theppitak Karoonboonyanan <theppitak@gmail.com>
712 Micro-optimize with likely/unlikely hints.
714 * datrie/trie-private.h:
715 - Add LIKELY() and UNLIKELY() macros based on compiler extension.
717 (alpha_map_new, alpha_map_clone, alpha_map_fread_bin,
718 alpha_map_add_range, alpha_map_char_to_trie_str,
719 alpha_map_trie_to_char_str):
721 (symbols_new, da_new, da_fread, da_get_base, da_get_check,
722 da_set_base, da_set_check, da_insert_branch, da_find_free_base,
724 * datrie/dstring.c (dstring_new, dstring_ensure_space):
726 (tail_new, tail_fread, tail_get_suffix, tail_set_suffix,
727 tail_get_data, tail_set_data, tail_walk_str, tail_walk_char):
729 (trie_new, trie_fread, trie_enumerate, trie_state_new,
730 trie_state_walk, trie_state_is_walkable, trie_iterator_new):
731 - Use LIKELY() and UNLIKELY() where it is known to be so, mostly
732 for one-time initialization and failure handling.
733 * datrie/alpha-map.c, datrie/tail.c, datrie/tail.c:
734 - These are the files that need to include trie-private.h
737 Callgrind says it does help speed up a little bit.
739 2015-02-05 Theppitak Karoonboonyanan <theppitak@gmail.com>
741 Disable timestamp in Doxygen-generated doc.
744 - Set HTML_TIMESTAMP to NO to make the document reproducible.
745 (reported by Debian Reproducible)
747 2015-02-01 Theppitak Karoonboonyanan <theppitak@gmail.com>
749 * configure.ac: [Belated] post-release version suffix added.
751 2015-02-01 Theppitak Karoonboonyanan <theppitak@gmail.com>
753 Update my e-mail address everywhere.
755 * AUTHORS, configure.ac, datrie/*.[ch], tests/*.[ch],
757 - Replace all mentionings of my e-mail address with the gmail one.
759 2015-02-01 Theppitak Karoonboonyanan <theppitak@gmail.com>
761 Fix binary file opening on Windows.
763 * datrie/trie.c (trie_new_from_file, trie_save):
764 - Add "b" to fopen() modes, so the binary file is opened properly
767 Thanks phongphan.p for the report and initial patch.
769 2014-01-10 Theppitak Karoonboonyanan <thep@linux.thai.net>
772 - Bump library revision to reflect code changes.
774 * NEWS, configure.ac:
775 === Version 0.2.8 ===
777 2014-01-09 Theppitak Karoonboonyanan <thep@linux.thai.net>
779 Improve documentation.
782 - Refine descriptions of data types.
783 * datrie/trie.c (trie_iterator_new):
784 - Fix typo on trie_root() mentioning.
785 * datrie/trie.c (trie_store, trie_store_if_absent):
787 * datrie/alpha-map.h, datrie/trie.h:
788 - Add detailed description of AlphaMap and Trie types.
790 2014-01-08 Theppitak Karoonboonyanan <thep@linux.thai.net>
792 Clarify message in test_nonalpha.
794 * tests/test_nonalpha.c (main):
795 - Clarify message on false key duplication.
797 2014-01-08 Theppitak Karoonboonyanan <thep@linux.thai.net>
799 Add test on keys with non-alphabet input chars.
801 * tests/Makefile.am, +tests/test_nonalpha.c:
802 - Add test to ensure that operations on keys with non-alphabet
805 2014-01-08 Theppitak Karoonboonyanan <thep@linux.thai.net>
807 Fail trie operations on non-alphabet inputs.
809 alpha_map_char_to_trie() tried to return TRIE_CHAR_MAX to indicate
810 out-of-range error. But this value is indeed valid in trie operations.
811 Doing so could allow false key duplication when different non-alphabet
812 chars and TRIE_CHAR_MAX itself were all mapped to TRIE_CHAR_MAX.
813 So, let's fail all trie operations on non-alphabet input chars.
815 * datrie/alpha-map-private.h, datrie/alpha-map.c
816 (alpha_map_char_to_trie):
817 - Make alpha_map_char_to_trie return TrieIndex type, using
818 TRIE_INDEX_MAX to indicate out-of-range error.
819 This allows TRIE_CHAR_MAX to be returned as a valid output.
820 * datrie/alpha-map.c (alpha_map_char_to_trie_str):
821 - Fail if alpha_map_char_to_trie() returns error code.
822 * datrie/trie.c (trie_retrieve, trie_store_conditionally, trie_delete,
823 trie_state_walk, trie_state_is_walkable):
824 - Check return value from alpha_map_char_to_trie() and return
825 failure status on error.
826 - Also cast TrieIndex return values to TrieChar on function calls.
828 Thanks Naoki Youshinaga for the suggestion.
830 2014-01-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
832 Check for NULL result from AlphaMap string funcs.
834 * datrie/trie.c (trie_store_conditionally):
835 - Return failure on NULL alpha_map_char_to_trie_str().
837 2014-01-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
839 Return NULL on allocation errors in AlphaMap funcs.
842 (alpha_map_char_to_trie_str, alpha_map_trie_to_char_str):
843 - Return NULL on malloc() error.
845 2014-01-03 Theppitak Karoonboonyanan <thep@linux.thai.net>
847 Fix edge case with TRIE_CHAR_MAX as TrieChar.
849 The trie input char with value TRIE_CHAR_MAX (255), was always
850 skipped by double-array algorithms. Let's include it.
852 * datrie/darray.c (da_has_children, da_output_symbols,
853 da_relocate_base, da_first_separate, da_next_separate):
854 - Include the last char in trie char iterations.
856 * datrie/darray.c (da_first_separate, da_next_separate):
857 - Declare characters as TrieIndex type instead of TrieChar,
858 to prevent infinite loop due to unsigned char overflow.
860 Thanks Naoki Youshinaga for the report, test case, and analysis.
862 2013-10-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
864 Fix comiler warnings in tests.
866 * tests/test_walk.c (main):
867 - Remove unused var i;
868 - Remove extra printf() args.
869 * tests/test_iterator.c:
870 - Add missing #include for free().
871 * tests/test_walk.c (walk_dict), tests/utils.c (dict_src):
872 - Cast string literals to (AlphaChar *) to fix signedness
875 2013-10-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
877 * configure.ac: Post-release version suffix added.
879 2013-10-22 Theppitak Karoonboonyanan <thep@linux.thai.net>
881 * NEWS, configure.ac:
882 === Version 0.2.7.1 ===
884 2013-10-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
886 * configure.ac: Bump library versioning to reflect API addition.
887 (Change missing in previous release)
889 2013-10-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
891 * configure.ac: Post-release version suffix added.
893 2013-10-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
895 * NEWS, configure.ac:
896 === Version 0.2.7 ===
898 2013-10-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
900 Add missing distributed file.
903 - Add utils.h to distribution.
905 2013-10-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
907 Reorder tests from primitive to applied.
910 - Test walk & iterator before store-retrieve & file.
912 2013-10-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
914 Write a test suite for trie walk.
919 2013-10-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
921 Write a test suite for trie store/retrieval.
923 * tests/utils.h, tests/utils.c (+dict_src_n_entries):
924 - Add function to get total entries in dict_src[].
925 * tests/test_store-retrieve.c (main):
928 2013-10-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
930 Fix messages in test_iterator.
932 * tests/test_iterator.c (main):
933 - s/file/trie/. No file is written or read in this test.
935 2013-10-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
937 Skip further iteration tests if key is NULL.
939 * tests/test_iterator.c (main):
940 - Insert 'continue' if trie_iterator_get_key() returns NULL.
942 2013-10-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
944 Document availibility of alpha_char_strcmp()
946 * datrie/alpha-map.c (alpha_char_strcmp):
947 - Document that it's available since 0.2.7.
949 2013-10-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
951 Write a test for trie iterator.
953 * tests/test_iterator.c:
954 - Write test suite for trie iterator.
956 2013-10-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
958 Add skeleton test suites & a test for file I/O.
960 * configure.ac, Makefile.am, +tests/, +tests/Makefile.am:
961 - Add tests/ dir to the build system.
962 * +tests/utils.h, +tests/utils.c:
963 * +tests/test_file.c:
964 * +tests/test_iterator.c:
965 * +tests/test_store-retrieve.c:
966 * +tests/test_walk.c:
967 - Add skeleton for test suites.
968 * tests/utils.h, tests/utils.c, tests/test_file.c:
969 - Write test suite for file I/O.
971 2013-10-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
973 Add alpha_char_strcmp() API.
975 * datrie/alpha-map.h, datrie/alpha-map.c (+alpha_char_strcmp):
976 - Add alpha_char_strcmp() declaration & body.
977 * datrie/libdatrie.def, datrie/libdatrie.map:
978 - Add alpha_char_strcmp symbols.
980 2013-10-16 Theppitak Karoonboonyanan <thep@linux.thai.net>
982 Add missing info in alpha_map_add_range() doc.
984 * datrie/alpha-map.c (alpha_map_add_range):
985 - Add documentation on return value.
987 2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
989 Fix build for Visual Studio on Windows.
991 * datrie/dstring.c (dstring_append, dstring_append_string,
992 dstring_append_char, dstring_terminate):
993 - Cast (void *) pointers to (char *) before calculating offsets,
996 Thanks Gabi Davar for the report and fix (via Mikhail Korobov
997 <kmike84@gmail.com>).
999 2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
1001 Check for doxygen required version.
1004 - When doxygen-doc is enabled, also check doxygen version.
1006 2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
1008 Fix doxygen warning.
1011 - doxygen no longer ships with the FreeSans font. Just drop it.
1013 2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
1018 - Updated with 'doxygen -u'.
1020 2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
1022 Fix compiler warnings.
1023 * datrie/trie-string.c (trie_string_append_string):
1024 * datrie/trie.c (trie_iterator_get_key):
1025 - Cast strlen() args from (const TrieChar *) to (const char *),
1026 to fix signedness mismatch warnings.
1028 2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
1030 Fix automake warnings.
1032 * datrie/Makefile.am, tools/Makefile.am:
1033 - Replace deprecated INCLUDES with AM_CPPFLAGS.
1035 2013-09-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
1037 * configure.ac: Post-release version suffix added.
1039 2013-01-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
1041 * NEWS, configure.ac:
1042 === Version 0.2.6 ===
1044 2013-01-22 Theppitak Karoonboonyanan <thep@linux.thai.net>
1046 Use xz compression for release tarball.
1049 - Specify "dist-xz no-dist-gzip" options to AM_INIT_AUTOMAKE.
1051 2012-08-06 Theppitak Karoonboonyanan <thep@linux.thai.net>
1053 Improve AlphaMap range merging.
1055 * datrie/alpha-map.c (alpha_map_add_range):
1056 - Also try to merge adjacent ranges. Otherwise, adding one by one
1057 character will result in linear search on alphabet set.
1059 Thanks Mikhail Korobov <kmike84@gmail.com> for the report.
1061 2012-08-05 Theppitak Karoonboonyanan <thep@linux.thai.net>
1063 Migrate trie_enumerate() to the new TrieIterator.
1065 This improves performance by 10%, and recursion stacks are also
1068 * datrie/trie.c (trie_enumerate):
1069 - Replace da_enumerate() call with TrieIterator loop.
1070 * datrie/trie.c (-trie_da_enum_func, -_TrieEnumData):
1071 * datrie/darray.h, datrie/darray.c
1072 (-da_enumerate, -da_get_transition_key, -DAEnumFunc,
1073 -da_enumerate_recursive):
1074 - Drop now-unused codes.
1076 2012-08-05 Theppitak Karoonboonyanan <thep@linux.thai.net>
1078 Optimize key calculation for TrieIterator.
1080 * datrie/Makefile.am +datrie/dstring.h +datrie/dstring-private.h
1081 +datrie/dstring.c +datrie/trie-string.h +datrie/trie-string.c:
1082 - Add dynamic string classes DString and TrieString.
1084 - (TrieIterator): Add "key" dynamic trie string member for
1085 incrementally gathering the key while iterating.
1086 - Initialize "key" member to NULL on construction. Only allocate and
1087 free it on branching root states.
1088 * datrie/darray.h, datrie/darray.c
1089 (da_first_separate, da_next_separate):
1090 - Instead of allocating memory for return string, accept a dynamic
1091 string object and update it while traversing.
1092 * datrie/trie.c (trie_iterator_next):
1093 - For branching state, create the "key" dynamic string object on
1094 first iteration and pass it to da_first_separate() and
1095 da_next_separate() along the iterations.
1096 * datrie/trie.c (trie_iterator_get_key):
1097 - Replace the total key reconstruction by da_get_transition_key()
1098 with simple string catenation of the dynamic "key" and the suffix
1100 * datrie/darray.h, datrie/darray.c (da_get_transition_key):
1101 - Adjust to use dynamic string instead of total allocation.
1102 * datrie/darray.c (da_enumerate_recursive):
1103 - Adjust the da_get_transition_key() call accordingly.
1105 Thanks Mikhail Korobov <kmike84@gmail.com> for the suggested approach
1106 and for profiling check.
1108 2012-07-31 Theppitak Karoonboonyanan <thep@linux.thai.net>
1110 Add TrieIterator and its operations.
1112 * datrie/trie.h, datrie/trie.c
1113 (+trie_iterator_new, +trie_iterator_free, +trie_iterator_next,
1114 +trie_iterator_get_key, +trie_iterator_get_data):
1115 - Add TrieIterator class and its methods.
1116 * datrie/libdatrie.def, datrie/libdatrie.map:
1117 - Add the new export symbols.
1118 * datrie/darray.h, datrie/darray.c
1119 (da_get_state_key -> da_get_transition_key):
1120 - Adjust da_get_state_key() from getting transition key from root
1121 to getting from arbitrary ancestor.
1122 * datrie/darray.h, datrie/darray.c
1123 (+da_first_separate, +da_next_separate):
1124 - Add internal functions for iterating from one separate node to
1125 another in double-array structure.
1127 Thanks Mikhail Korobov <kmike84@gmail.com> for the use case suggestion.
1129 2012-07-30 Theppitak Karoonboonyanan <thep@linux.thai.net>
1131 * doc/Doxyfile.in: Upgrade to doxygen 1.8.1.2 format.
1133 2012-07-29 Theppitak Karoonboonyanan <thep@linux.thai.net>
1135 * datrie/trie.c: Reformat source.
1137 2012-07-29 Theppitak Karoonboonyanan <thep@linux.thai.net>
1139 * datrie/trie.h, datrie/trie.c (trie_state_walkable_chars):
1142 2012-07-27 Theppitak Karoonboonyanan <thep@linux.thai.net>
1144 Add new API trie_state_walkable_chars() to allow breadth-first
1147 * datrie/darray.h, datrie/darray.c:
1148 - Move da_output_symbols() to darray.h, to be called by the new
1150 - Move the Symbols class to darray.h, as required by
1151 da_output_symbols().
1152 * datrie/trie.h, datrie/trie.c (+trie_state_walkable_chars):
1153 - Add the new public function.
1154 * datrie/libdatrie.map, datrie/libdatrie.def:
1155 - Add the new symbol to export maps.
1157 - Update library versioning to reflect API addition.
1159 2012-07-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
1161 * darray/darray.c (da_has_children): Accept (const DArray *) arg.
1163 2012-07-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
1165 * datrie/darray.c (da_has_children, da_output_symbols,
1167 Calculate max_c candidate using num_cells - base instead of
1168 TRIE_INDEX_MAX - base, to prevent more unnecessary loops.
1170 2012-07-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
1172 * datrie/trie.c (trie_state_get_data):
1173 Check if the state is leaf, not just suffix, before getting data.
1175 Thanks Mikhail Korobov <kmike84@gmail.com> for the report.
1177 2012-07-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
1179 * datrie/tail.h, datrie/tail.c:
1180 * datrie/alpha-map.c:
1181 * datrie/trie.h, datrie/trie.c:
1182 * datrie/darray.c: Remove trailing spaces.
1184 2012-07-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
1186 * datrie/tail.c (tail_get_suffix): Fix function documentation.
1188 Thanks Mikhail Korobov <kmike84@gmail.com> for the report.
1190 2012-07-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
1192 * datrie/darray.c, datrie/tail.c:
1193 - Don't include <stdint.h> when compiled with MSVC, as the header is
1194 missing there, and SIZE_MAX is provided in some other header.
1196 Thanks Mikhail Korobov <kmike84@gmail.com> for the report.
1198 2012-07-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
1200 * configure.ac: Post-release version suffix added.
1202 2011-11-04 Theppitak Karoonboonyanan <thep@linux.thai.net>
1204 * NEWS, configure.ac:
1205 === Version 0.2.5 ===
1207 2011-08-04 Theppitak Karoonboonyanan <thep@linux.thai.net>
1209 * datrie/alpha-map.h: Add missing 'extern "C"' for export functions
1210 to fix problem with C++ compiler.
1211 Thanks Aurimas ÄŒernius <aurisc4@gmail.com> for the patch.
1213 2011-03-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
1215 * configure.ac: Post-release version suffix added.
1216 * datrie/trie.h: Add missing documentation for "user_data" parameter
1219 2010-06-30 Theppitak Karoonboonyanan <thep@linux.thai.net>
1221 * NEWS, configure.ac:
1222 === Version 0.2.4 ===
1224 2010-06-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1226 * datrie/alpha-map-private.h, datrie/alpha-map.c:
1227 * datrie/darray.h, datrie/darray.c:
1228 * datrie/tail.h, datrie/tail.c:
1229 * datrie/trie.c (trie_fread, trie_fwrite):
1230 Rename *_read() and *_write() functions to *_fread() and *_fwrite(),
1231 for consistency with the trie_f{read,write}() function.
1233 2010-06-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1235 Add trie_fread() and trie_fwrite() interfaces for reading/writing trie
1236 data from an open file. Thanks NIIBE Yutaka <gniibe@fsij.org> for the
1239 * datrie/trie.h (trie_fread, trie_fwrite): Add new API declarations.
1240 * datrie/trie.c (trie_new_from_file, trie_fread, trie_save,
1242 Refactor open file handling of trie_new_from_file() and trie_save()
1243 into trie_fread() and trie_fwrite(), and make the old functions
1244 do file opening/closing as wrappers to them.
1245 * datrie/libdatrie.def, datrie/libdatrie.map: Add symbol exports.
1247 2010-06-27 Theppitak Karoonboonyanan <thep@linux.thai.net>
1249 * datrie/trie.c (trie_store_if_absent): Document that it's available
1251 * datrie/libdatrie.def, datrie/libdatrie.map: Add symbol exports for
1252 trie_store_if_absent().
1253 * ChangeLog: Fix file locations in previous log.
1255 2010-06-24 Theppitak Karoonboonyanan <thep@linux.thai.net>
1257 Add trie_store_if_absent() interface to avoid race condition in
1258 multi-thread applications. Thanks Dan Searle <dan.searle@censornet.com>
1261 * datrie/trie.h (trie_store_if_absent): Add new API declaration.
1262 * datrie/trie.c (trie_store_if_absent, trie_store,
1263 trie_store_conditionally):
1264 Refactor trie_store() into trie_store_conditionally() with extra arg
1265 is_overwrite, and make the two public functions mere wrappers to it.
1266 * configure.ac: Bump library version according to the added symbol.
1268 2010-03-01 Theppitak Karoonboonyanan <thep@linux.thai.net>
1270 * datrie/trie.c (trie_save): Do not return before closing file.
1271 Thanks to Xu Jiandong for the report.
1273 2010-03-01 Theppitak Karoonboonyanan <thep@linux.thai.net>
1275 * configure.ac: Post-release version suffix added.
1277 2010-02-27 Theppitak Karoonboonyanan <thep@linux.thai.net>
1279 * configure.ac: Bump library revision.
1280 * NEWS, configure.ac:
1281 === Version 0.2.3 ===
1283 2010-02-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
1285 * datrie/*.h, datrie/*.c: Add my e-mail address to license header.
1287 2010-02-24 Theppitak Karoonboonyanan <thep@linux.thai.net>
1289 * datrie/*.h, datrie/*.c: Add license header to every source file.
1291 2010-02-23 Theppitak Karoonboonyanan <thep@linux.thai.net>
1293 Move documentation from *.h to *.c, so libdatrie developers have the
1294 doc at hand. Users can still read the doxygen-generated doc BTW.
1296 * datrie/alpha-map.h:
1297 * datrie/alpha-map.c:
1303 * datrie/tail.c: Move doc comments from *.h to *.c.
1304 * doc/Doxyfile.in: Add alpha-map.c, trie.c to INPUT.
1305 * doc/Makefile.am: Add *.c to doxygen.stamp dependency.
1307 2010-02-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
1309 * datrie/darray.c (da_read), datrie/tail.c (tail_read):
1310 Protect against possible integer overflow on malicious trie file.
1312 2010-02-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
1314 * configure.ac: Post-release version suffix added.
1316 Be more robust against corrupted trie files.
1317 * datrie/alpha-map.c (alpha_map_read_bin):
1318 * datrie/darray.c (da_read):
1319 * datrie/tail.c (tail_read):
1320 - Check all returns from file_read_*() and clean up properly on
1322 - Adjust existing clean up codes to the new structure
1324 2009-04-29 Theppitak Karoonboonyanan <thep@linux.thai.net>
1326 * configure.ac: Bump library revision.
1327 * NEWS, configure.ac:
1328 === Version 0.2.2 ===
1330 2009-04-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1332 * configure.ac: Check $datrie_cv_have_version_script against "yes",
1333 not "1", so symbol versioning works on GNU ld again.
1335 2009-04-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1337 * datrie/trie.c (trie_state_copy): Use bitwise copy instead of
1340 2009-04-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
1342 * configure.ac: Adjust variable name datrie_cv_have_version_script.
1344 2009-04-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
1346 Support locale charset query with libcharset, for mac and mingw.
1347 [Thanks Beamer User for the report.]
1349 * configure.ac: Check for locale_charset() from libiconv and
1350 nl_langinfo(CODESET) from libc. If neither is present, ask user to
1351 install GNU libiconv.
1352 * tools/trietool.c (init_iconv): Use locale_charset() to query locale
1353 charset if possible, fall back to nl_langinfo(CODESET) otherwise.
1355 2009-04-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
1357 Support alternative iconv implemetations.
1358 [Thanks cwt for the report.]
1360 * configure.ac: Check for GNU libconv or native libiconv if system libc
1361 doesn't have iconv().
1362 * tools/Makefile.am: Add ICONV_LIBS to linker options.
1364 2009-04-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
1366 Fall back to libtool for linkers that do not support -version-script.
1367 [Thanks bact' for the report. Thanks cwt for the test.]
1369 * configure.ac: Check whether linker supports -version-script.
1370 * datrie/Makefile.am, +datrie/libdatrie.def:
1371 Apply -version-script flag only when linker supports it. Otherwise,
1372 fall back to the old method based on libtool -export-symbols flag.
1374 2009-04-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
1376 * configure.ac: Post-release version suffix added.
1377 * configure.ac (AC_CONFIG_MACRO_DIR), Makefile.am (ACLOCAL_AMFLAGS):
1378 Add m4 dir as automake includes, as required by the new libtool.
1379 [Thanks cwt for the report and test.]
1381 2009-04-05 Theppitak Karoonboonyanan <thep@linux.thai.net>
1383 * configure.ac: Bump library revision.
1384 * NEWS, configure.ac:
1385 === Version 0.2.1 ===
1387 2009-04-05 Theppitak Karoonboonyanan <thep@linux.thai.net>
1389 * datrie-0.2.pc.in: Remove blank Requires: line.
1391 2009-04-03 Theppitak Karoonboonyanan <thep@linux.thai.net>
1393 * datrie/alpha-map.h, datrie/trie.h: Revise documentation.
1395 2009-04-03 Theppitak Karoonboonyanan <thep@linux.thai.net>
1397 * datrie/fileutils.h, datrie/fileutils.c
1398 (make_full_path, file_open, file_length): Remove unused codes.
1399 * datrie/triedefs.h (TrieIOMode): Remove unused typedef.
1401 2009-04-01 Theppitak Karoonboonyanan <thep@linux.thai.net>
1403 * datrie/Makefile.am, datrie/libdatrie.def -> datrie/libdatrie.map:
1404 Replace libtool symbol exports with symbol versioning, to ease
1405 upgrading across SONAME.
1407 2009-03-31 Theppitak Karoonboonyanan <thep@linux.thai.net>
1411 * tools/trietool.c (conv_to_alpha): Cast 'out_p' pointer before
1413 * tools/trietool.c (command_add_list, command_delete_list):
1414 Make sure 'saved_conv' is initialized before use.
1415 * datrie/trie.c (trie_new_from_file): Remove unused 'alt_map' var.
1417 2009-03-31 Theppitak Karoonboonyanan <thep@linux.thai.net>
1419 * configura.ac: Post-release version suffix added.
1421 * datrie/trie.h (trie_save): Document parameter 'path'.
1422 * doc/Doxygen.in: Update format to doxygen 1.5.8.
1424 2009-03-24 Theppitak Karoonboonyanan <thep@linux.thai.net>
1426 * NEWS, configure.ac:
1427 === Version 0.2.0 ===
1429 2009-03-24 Theppitak Karoonboonyanan <thep@linux.thai.net>
1431 * Makefile.am, +README.migration:
1432 Add migration documentation.
1434 2008-12-29 Theppitak Karoonboonyanan <thep@linux.thai.net>
1436 * datrie/alpha-map.c (alpha_map_char_to_trie, alpha_map_trie_to_char):
1437 Tighten the loop for more readability, plus eliminating one duplicated
1440 2008-12-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1442 * datrie/datrie.c (da_get_base, da_get_check, da_set_base,
1444 Revert lower bound checks. It's no use checking too much for internal
1447 2008-12-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1449 * datrie/trie.h, datrie/trie.c, datrie/libdatrie.def
1450 (trie_state_is_leaf, +trie_state_is_single):
1451 - Introduce a new state condition: single. A single state is a state
1452 in a single path, with no other branch til its leaf.
1453 - Redefine trie_state_is_leaf() as a macro based on it and
1454 trie_state_is_terminal().
1456 2008-12-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
1458 * datrie/trie.h, datrie/trie.c, datrie/libdatrie.def (trie_state_copy):
1459 Add a new API function for trie state reuse support.
1461 2008-12-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
1463 * tools/trietool.c (conv_to_alpha): Use 'unsigned char' instead of
1464 'uint8'. Better not tie to datrie internal notations too much.
1466 2008-12-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
1468 * configure.ac: Post-release version bump.
1470 * tools/trietool.c (conv_to_alpha): Use uint8 to access data bytes
1471 instead of char, to fix char signedness bug.
1473 2008-12-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
1475 * NEWS, configure.ac:
1476 === Version 0.1.99.2 ===
1478 2008-12-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
1480 * man/Makefile.am, man/trietool.1 -> man/trietool-0.2.1:
1481 Rename 'trietool' man page to 'trietool-0.2', according to the
1482 corrsponding binary.
1484 2008-12-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
1486 * tools/Makefile.am: Rename 'trietool' program to 'trietool-0.2',
1487 to allow co-existence with datrie 0.1.x.
1489 2008-12-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
1491 * datrie/darray.c (da_read):
1492 * datrie/tail.c (tail_read):
1493 Restore file pointer on signature check failure.
1495 2008-12-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
1497 * man/trietool.1: Document that no more than 255 alphabets are allowed.
1499 2008-12-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
1501 Ensure that ranges in AlphaMap are always sorted and don't overlap.
1503 * datrie/alpha-map.c (struct _AlphaMap, alpha_map_new):
1504 - Remove 'last_range' member
1505 * datrie/alpha-map.c (alpha_map_add_range):
1506 - Check if the new range overlaps existing ranges and merge them
1509 2008-12-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
1511 * configure.ac: Post-release version bump.
1512 * configure.ac, Makefile.am, datrie.pc.in -> datrie-0.2.pc.in:
1513 Rename pkg-config file, to allow co-existence with datrie 0.1.x.
1515 2008-12-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
1517 * NEWS, configure.ac:
1518 === Version 0.1.99.1 ===
1520 2008-12-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
1522 * man/trietool.1: Update document
1523 - Trie is now stored in a single '*.tri' file
1524 - The alphabet map is renamed from '*.sbm' to '*.abm'
1525 - Mention Unicode, instead of single-byte character domain
1526 - Document the options for 'add-list' and 'delete-list' commands
1527 - Adjust troff formatting commands
1529 2008-12-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
1531 * tools/trietool.c (prepare_trie):
1532 - Try to read alphabet map from '*.abm' instead of '*.sbm'
1534 2008-12-11 Theppitak Karoonboonyanan <thep@linux.thai.net>
1536 Allow specifying character encoding for word list file.
1538 * tools/trietool.c (command_add_list, command_delete_list):
1539 - Add '-e|--encoding ENC' option which temporarily override locale's
1540 codeset for character conversion
1541 * tools/trietool.c (usage):
1542 - Update usage message accordingly
1544 2008-12-09 Theppitak Karoonboonyanan <thep@linux.thai.net>
1546 Use const where possible + general clean-ups.
1548 * datrie/alpha-map-private.h, datrie/alpha-map.c (alpha_map_write_bin):
1549 * datrie/alpha-map.h, datrie/alpha-map.c (alpha_map_clone):
1550 * datrie/alpha-map.c (alpha_map_get_total_ranges):
1551 - Accept (const AlphaMap *) arg
1552 * datrie/alpha-map.c (alpha_map_char_to_trie_str):
1553 - Rename 'alphabet_str' to 'trie_str', to be more sensible
1555 * datrie/darray.h, datrie/darray.c (da_write, da_walk, da_enumerate):
1557 (da_output_symbols, da_get_state_key, da_enumerate_recursive):
1558 - Accept (const DArray *) arg
1559 * datrie/darray.h, datrie/darray.c (da_free):
1560 - Made void function, instead of int
1561 * datrie/darray.c (da_new):
1562 - Set CHECK[0] = d->num_cells, to be more clear
1563 * datrie/darray.c (da_write, da_extend_pool):
1564 - Update CHECK[0] whenever DArray::num_cells is changed, instead of
1565 just setting it before writing; so da_write() can now accept
1566 (const DArray *) arg
1568 * datrie/tail.h, datrie/tail.c
1569 (tail_write, tail_get_data, tail_walk_str, tail_walk_char):
1570 - Accept (const Tail *) arg
1571 * datrie/tail.h, datrie/tail.c (tail_free):
1572 - Made void function, instead of int
1574 * datrie/trie.c (struct _TrieState, struct _TrieEnumData):
1575 - 'trie' member is now const pointer
1576 * datrie/trie.h, datrie/trie.c
1577 (trie_new, trie_is_dirty, trie_retrieve, trie_enumerate, trie_root):
1578 * datrie/trie.c (trie_state_new):
1579 - Accept (const Trie *) arg
1581 2008-12-09 Theppitak Karoonboonyanan <thep@linux.thai.net>
1583 Unicode (UCS-4) character support.
1585 * datrie/triedefs.h (AlphaChar):
1586 - unsigned char -> uint32
1588 * datrie/alpha-map.h, datrie/alpha-map.c, datrie/libdatrie.def:
1589 - Export alpha_char_strlen() utility routine
1592 (ProgEnv, init_conv, conv_to_alpha, conv_from_alpha, close_conv):
1593 - Add routines for converting characters between locale (LC_CTYPE)
1595 * tools/trietool.c (main):
1596 - Initialize and close conversion routines
1598 (command_add, command_add_list, command_delete, command_delete_list,
1599 command_query, list_enum_func, command_list):
1600 - Convert character encodings between I/O and trie
1602 2008-12-09 Theppitak Karoonboonyanan <thep@linux.thai.net>
1604 * datrie/trie.c (trie_retrieve, trie_store):
1605 - Use (AlphaChar *), not (TrieChar *), as key pointer type
1607 2008-12-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
1609 * datrie/trie.c (trie_retrieve):
1610 - Remove unused var 'len'
1611 - Compare AlphaChar with integer zero rather than '\0'
1613 2008-12-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
1615 Adjust APIs for in-memory trie support.
1617 * datrie/trie.c (struct _Trie):
1618 - Remove 'file' member; now trie is detached from file; file is
1619 closed after loading, and reopened when saving
1620 * datrie/trie.h, datrie/trie.c (trie_new):
1621 - Add public APIs: trie_new(), for non-file usage
1622 - One can still save it to file with trie_save(), BTW
1623 * datrie/trie.h, datrie/trie.c (trie_open, trie_new_from_file):
1624 - Rename trie_open() to trie_new_from_file() and make it accept only
1625 one pathname parameter, instead of separated dir and name
1626 - Alphabet map is now mandatory, rather than optional
1627 * datrie/trie.h, datrie/trie.c (trie_close, trie_free):
1628 - Rename trie_close() to trie_free() and do not bother with saving
1630 * datrie/trie.h, datrie/trie.c (trie_save):
1631 - Accept file path argument and open the file for saving
1632 * datrie/trie.h, datrie/trie.c (trie_is_dirty):
1633 - Add public API: trie_is_dirty() for client to determine whether
1636 * datrie/alpha-map-private.h:
1637 - Separate internal APIs from public
1638 * datrie/alpha-map.h, datrie/alpha-map.c:
1639 - Promote alpha_map_new() and alpha_map_add_range() to public;
1640 they are now needed by trie_new()
1641 - Remove alpha_map_open()
1642 - Add public API: alpha_map_clone()
1643 - Document public APIs
1645 * datrie/darray.h, datrie/darray.c (da_new):
1646 - Add internal API: da_new() needed by trie_new()
1647 - Code migrated from new-file case in da_read()
1648 * datrie/darray.c (da_read):
1649 - No longer handle new file; read failure means an error
1651 * datrie/tail.h, datrie/tail.c (tail_new):
1652 - Add internal API: tail_new() needed by trie_new()
1653 - Code migrated from new-file case in tail_read()
1654 * datrie/tail.c (TAIL_SIGNATURE):
1655 - Update TAIL_SIGNATURE to harmonize with other data parts
1656 * datrie/tail.c (tail_read):
1657 - No longer handle new file; read failure means an error
1659 * tools/trietool.c (prepare_trie, close_trie):
1660 - Add helper function for openning and closing trie
1661 * tools/trietool.c (main):
1662 - Open and close trie with prepare_trie() and close_trie()
1664 * datrie/Makefile.am:
1665 - Install alpha-map.h as public header
1666 - Add alpha-map-private.h to source list
1667 * datrie/libdatrie.def:
1668 - Update exported symbols
1670 2008-12-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
1672 Rename AlphaMap functions to be more logical.
1674 * datrie/alpha-map.c, datrie/alpha-map.h: Rename functions
1675 - alpha_map_char_to_alphabet -> alpha_map_char_to_trie
1676 - alpha_map_alphabet_to_char -> alpha_map_trie_to_char
1677 - alpha_map_char_to_alphabet_str -> alpha_map_char_to_trie_str
1678 - alpha_map_alphabet_to_char_str -> alpha_map_trie_to_char_str
1680 * datrie/trie.c (trie_retrieve, trie_store, trie_delete,
1681 trie_da_enum_func, trie_state_walk, trie_state_is_walkable):
1682 - Call the AlphaMap functions with the new names
1684 2008-12-07 Theppitak Karoonboonyanan <thep@linux.thai.net>
1686 Merge SBTrie alphabet mapping feature into Trie.
1688 * datrie/triedefs.h (AlphaChar):
1689 - Add AlphaChar typedef, as well as ALPHA_CHAR_ERROR macro
1690 (moved from UniChar type in datrie/alpha-map.h)
1692 * datrie/alpha-map.c (alpha_char_strlen):
1693 - Add string length function for alphabet string
1694 * datrie/alpha-map.c (struct _AlphaRange):
1695 - Use AlphaChar type instead of UniChar for begin, end members
1696 * datrie/alpha-map.c (alpha_map_get_total_ranges):
1697 - Add range count private method
1698 * datrie/alpha-map.c (alpha_map_add_range):
1699 - Add private method for adding range (refactored from
1701 * datrie/alpha-map.c (alpha_map_open):
1702 - Call alpha_map_add_range() to add range, instead of doing low-level
1704 * datrie/alpha-map.c, datrie/alpha-map.h
1705 (alpha_map_read_bin, alpha_map_write_bin):
1706 - Add methods for binary format I/O
1707 * datrie/alpha-map.c, datrie/alpha-map.h
1708 (alpha_map_char_to_alphabet, alpha_map_alphabet_to_char):
1709 - Accept and return AlphaChar, instead of UniChar
1710 * datrie/alpha-map.c, datrie/alpha-map.h
1711 (alpha_map_char_to_alphabet_str, alpha_map_alphabet_to_char_str):
1712 - Add public methods for mapping strings (migrated from
1713 sb_map_char_to_alphabet_str and sb_map_alphabet_to_char_str in
1716 * datrie/trie.c (struct _Trie):
1717 - Add alpha_map member
1718 * datrie/trie.c (trie_open):
1719 - Add code to read AlphaMap data block, and prefer text-formatted
1721 - Defer Trie object allocation to after file openning
1722 * datrie/trie.c (trie_close):
1723 - Free alpha_map member
1724 * datrie/trie.c (trie_save):
1725 - Add code to write AlphaMap data block
1726 * datrie/trie.c, datrie/trie.h (trie_retrieve, trie_store, trie_delete,
1727 trie_da_enum_func, trie_state_walk, trie_state_is_walkable):
1728 - Adjust function prototypes to accept AlphaChar instead of TrieChar
1729 - Add mapping between alphabet and trie character code
1730 * datrie/trie.h (TrieEnumFunc):
1731 - Adjust function typedef to accept AlphaChar instead of TrieChar
1733 * datrie/Makefile.am:
1734 - Remove sb-trie.c and sb-trie.h from source/header list
1735 * datrie/libdatrie.def:
1736 - Remove sb_trie symbols
1739 - Call trie_* functions instead of sb_trie_*
1741 2008-12-03 Theppitak Karoonboonyanan <thep@linux.thai.net>
1743 Adjust file format by catenating *.br and *.tl data into a single
1746 * datrie/trie.c (struct _Trie):
1747 - Add 'file' and 'is_dirty' members
1748 * datrie/trie.c (trie_open):
1749 - Open the file and call da_read() and tail_read() to load data
1750 portions, instead of openning separate files
1751 * datrie/trie.c (trie_close):
1752 - Do the saving stuff and free DArray and Tail data, instead of
1753 separately closing them; then finally close the file
1754 * datrie/trie.c (trie_save):
1755 - Write file portions with da_write() and tail_write() instead of
1756 saving to separate files
1757 - Handle the 'is_dirty' stuffs
1758 * datrie/trie.c (trie_store, trie_branch_in_branch, trie_delete):
1759 - Set the 'is_dirty' flag
1761 * datrie/darray.h: Change prototypes for internal APIs whose
1762 functionalities are to be reduced:
1763 - da_open(path, name, mode) -> da_read(FILE*)
1764 - da_close(DArray*) -> da_free(DArray*)
1765 - da_save(DArray*) -> da_write(DArray*, FILE*)
1767 * datrie/darray.c (struct_DArray):
1768 - Drop 'file' and 'is_dirty' members
1769 * datrie/darray.c (da_open -> da_read):
1770 - Accept (FILE *) argument and drop file openning/closing codes
1771 - Store number of cells at CHECK[0], so double-array data size can
1772 determined without depending on file size
1773 - Do not allocate DArray object until needed
1774 - Drop 'is_dirty' stuffs
1775 * datrie/darray.c (da_close -> da_free):
1776 - Remove file stuffs; just free memory
1777 * datrie/darray.c (da_save -> da_write):
1778 - Accept (FILE *) argument and use it instead of DArray::file
1779 - Ensure CHECK[0] stores the number of cells
1780 - Drop 'is_dirty' stuffs
1781 * datrie/darray.c (da_set_base, da_set_check):
1782 - Drop 'is_dirty' stuffs
1784 * datrie/tail.h: Change prototypes for internal APIs whose
1785 functionalities are to be reduced:
1786 - tail_open(path, name, mode) -> tail_read(FILE*)
1787 - tail_close(Tail*) -> tail_free(Tail*)
1788 - tail_save(Tail*) -> tail_write(Tail*, FILE*)
1790 * datrie/tail.c (struct _Tail):
1791 - Drop 'file' and 'is_dirty' members
1792 * datrie/tail.c (tail_open -> tail_read):
1793 - Accept (FILE *) argument and drop file openning/closing codes
1794 - Check for new file from read failure, rather than file size
1795 - Do not allocate Tail object until needed
1796 - Drop 'is_dirty' stuffs
1797 * datrie/tail.c (tail_close -> tail_free):
1798 - Remove file stuffs; just free memory
1799 * datrie/tail.c (tail_save -> tail_write):
1800 - Accept (FILE *) argument and use it instead of Tail::file
1801 - Drop 'is_dirty' stuffs
1802 * datrie/tail.c (tail_set_suffix, tail_set_data, tail_free_block):
1803 - Drop 'is_dirty' stuffs
1805 2008-12-01 Theppitak Karoonboonyanan <thep@linux.thai.net>
1807 Get rid of the weird TrieIndexInt intermediate type, by checking
1808 ranges instead. (Changes merged from r_0_1_x-branch)
1810 * datrie/darray.c: Remove typedef for TrieIndexInt.
1811 * datrie/darray.c (da_check_free_cell, da_extend_pool):
1812 - Accept normal TrieIndex arg instead of TrieIndexInt
1813 * datrie/datrie.c (da_insert_branch):
1814 - Define 'base', 'next' vars as TrieIndex instead of TrieIndexInt
1815 - Check overflow for 'next' before checking if the cell is free
1816 * datrie/datrie.c (da_find_free_base):
1817 - Define 's' var as TrieIndex instead of TrieIndexInt
1818 * datrie/datrie.c (da_fit_symbols):
1819 - Check overflow for (base + sym) before checking if the cell is free
1820 * datrie/datrie.c (da_get_base, da_get_check, da_set_base,
1822 - Also check lower bound for index range
1824 2008-11-27 Theppitak Karoonboonyanan <thep@linux.thai.net>
1826 First changes to break ABI for larger trie index.
1828 * datrie/triedefs.h: Redefine TrieIndex and TrieData as int32.
1829 Update TRIE_INDEX_MAX accordingly.
1830 * datrie/darray.c (da_open, da_save): Redefine DA_SIGNATURE.
1831 Read/write 32-bit data in headers.
1832 * datrie/darray.c (da_has_children, da_output_symbols,
1834 Declare characters as TrieIndex instead of uint16.
1835 * datrie/tail.c (tail_open, tail_save): Redefine TAIL_SIGNATURE.
1836 Read/write 32-bit data in headers. Use 16-bit length for each block.
1837 * configure.ac: Bump up library version to 1.0.0.
1839 2008-06-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
1841 * man/trietool.1: Use troff .in command to indent text, fixing warning
1842 from 'groff --warnings'. Thanks Debian's lintian.
1844 2008-06-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
1846 * datrie/tail.c (tail_set_suffix):
1847 * datrie/sb-trie.c (sb_map_char_to_alphabet_str):
1848 Fix GCC warnings about char signedness.
1850 2008-01-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1852 * configure.in: Bump the library revision.
1854 === Version 0.1.3 ===
1856 2008-01-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1858 * man/trietool.1: Add documentation for the SBM file.
1860 2008-01-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1862 * README: Fix my name in the reference.
1864 2008-01-10 Theppitak Karoonboonyanan <thep@linux.thai.net>
1866 * datrie/tail.c (tail_set_suffix): Fix bug for the case in which
1867 suffix argument and tail's suffix overlap. Bug report and patch by
1868 shepmaster in http://linux.thai.net/node/102.
1870 2008-01-10 Theppitak Karoonboonyanan <thep@linux.thai.net>
1872 * datrie/sb-trie.c (sb_trie_root): Return NULL pointer, rather than
1873 FALSE. Bug reported by shepmaster in http://linux.thai.net/node/101.
1875 2007-10-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
1877 * datrie/libdatrie.def: List only symbols in plain format, for Mac
1878 build. Thanks Vee Satayamas for the report.
1880 * datrie/Makefile.am: Add libdatrie.def as libdatrie_la_DEPENDENCIES.
1882 2007-08-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1884 * doc/Doxyfile.in: Only generate doc for public API.
1886 2007-08-28 Theppitak Karoonboonyanan <thep@linux.thai.net>
1888 * doc/Makefile.am, doc/Doxyfile.in: Revert API man pages generation
1889 and installation. Update Doxyfile format to doxygen 1.5.3.
1891 2007-08-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
1893 * man/trietool.1: Escape some minus signs. Mark a variable italic.
1894 Thanks debian's lintian.
1896 2007-08-26 Theppitak Karoonboonyanan <thep@linux.thai.net>
1898 * configure.ac: Post-release version bump.
1900 2007-08-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
1902 * configure.ac: Bump lib revision.
1904 === Version 0.1.2 ===
1906 2007-08-25 Theppitak Karoonboonyanan <thep@linux.thai.net>
1908 * datrie/Makefile.am, +datrie/trie-private.h (MIN_VAL, MAX_VAL):
1910 * datrie/darray.c (da_output_symbols): Adjust loop boundary to be more
1912 * "-------------" (da_has_children, da_relocate_base): Apply the same
1913 loop pattern to prevent out-of-range accesses.
1915 2007-08-24 Theppitak Karoonboonyanan <thep@linux.thai.net>
1917 * datrie/darray.c (da_output_symbols): Do not try to test symbols
1918 beyond trie index range. Fixes segfault for trietool list command.
1920 2007-08-19 Theppitak Karoonboonyanan <thep@linux.thai.net>
1922 Handle double array index overflow.
1924 * datrie/triedefs.h (TRIE_INDEX_MAX): Define maximum index value.
1925 * datrie/darray.c (TrieIndexInt): Define type for immediate values, so
1926 overflow can be detected.
1927 * "-------------" (da_extend_pool): Return success/failure status.
1928 Accept TrieIndexInt argument for overflow detection.
1929 * "-------------" (da_check_free_cell): False when extending fails.
1930 Accept TrieIndexInt argument for overflow detection.
1931 * "-------------" (da_find_free_base): Return error on failure.
1932 * "-------------" (da_insert_branch): Return error on failure.
1933 * datrie/trie.c (trie_branch_in_branch, trie_branch_in_tail): Check
1934 for failure from da_insert_branch() and return the status.
1935 * datrie/darray.{c,h} (da_prune_upto, da_prune): Add da_prune_upto(),
1936 for rolling back partial operation in trie_branch_in_branch().
1937 Redefine da_prune() in terms of da_prune_upto().
1939 2007-08-16 Theppitak Karoonboonyanan <thep@linux.thai.net>
1941 * datrie/darray.c (da_open, da_find_free_base): Use DA_POOL_BEGIN
1942 macro instead of hard-coded number. Remove unused DA_EXTENDING_STEPS.
1944 2007-05-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
1946 * datrie/sb-trie.c (sb_trie_close, sb_trie_save, sb_trie_retrieve,
1947 sb_trie_store, sb_trie_enumerate, sb_trie_root, sb_trie_state_clone,
1948 sb_trie_state_free, sb_trie_state_rewind, sb_trie_state_walk,
1949 sb_trie_state_is_walkable, sb_trie_state_is_terminal,
1950 sb_trie_state_is_leaf, sb_trie_state_get_data):
1951 Guard against NULL pointers in functions. Thanks to Neutron Soutmun
1952 for bug report and initial patch.
1954 2007-04-06 Theppitak Karoonboonyanan <thep@linux.thai.net>
1956 * doc/Makefile.am: Add install-man target. Also install/uninstall
1957 doxygen-generated man pages.
1959 2007-03-27 Theppitak Karoonboonyanan <thep@linux.thai.net>
1961 * configure.ac (LT_CURRENT, LT_REVISION, LT_AGE),
1962 datrie/Makefile.am (libdatrie_la_LDFLAGS), +datrie/libdatrie.def:
1963 Add library version info. Limit exported symbols with -export-symbols
1964 flag. Always pass -no-undefined flag.
1966 * configure.ac: Add Win32 DLL building support.
1968 2006-11-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
1970 * datrie/fileutils.{c,h} (file_read_int32, file_write_int32): Add
1971 int32 read/write functions.
1973 * datrie/fileutils.c (file_read_int16, file_write_int16): Use unsigned
1974 char buffer instead of and-ing with 0xff, in accordance with int32
1975 functions. (Thanks to Vee Satayamas for suggestion).
1977 2006-10-13 Theppitak Karoonboonyanan <thep@linux.thai.net>
1979 * configure.ac: Post-release version bump.
1981 2006-10-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
1984 === Version 0.1.1 ===
1986 2006-10-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
1988 * configure.ac, Makefile.am, +man/Makefile.am, +man/trietool.1:
1989 Add manpage for trietool (moved from debian/).
1991 2006-10-11 Theppitak Karoonboonyanan <thep@linux.thai.net>
1993 Fixed compiler warnings.
1995 * datrie/sb-trie.c (sb_map_alphabet_to_char_str):
1996 * datrie/tail.c (tail_open, tail_save, tail_set_suffix):
1997 * datrie/trie.c (trie_da_enum_func): Cast pointers to get rid of
1998 compiler warnings about char signedness.
2000 * tools/trietool.c (list_enum_func): Return value on exit.
2002 2006-09-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
2004 * configure.ac: Post-release version bump.
2006 2006-09-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
2008 * NEWS, configure.ac:
2009 === Version 0.1.0 ===
2011 2006-09-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
2013 * README: Filled in.
2015 2006-09-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
2017 * datrie/triedefs.h, datrie/trie.h, datrie/sb-trie.h: Included headers
2018 using system header forms in installed headers.
2020 * datrie/Makefile.am (INCLUDES): Added include flag to ensure it
2021 compiles without prior installation.
2023 2006-09-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
2025 * datrie/alpha-map.c (alpha_map_char_to_alphabet,
2026 alpha_map_alphabet_to_char): Made sure terminator is always mapped
2029 2006-09-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
2031 * datrie/darray.{h,c} (da_is_walkable),
2032 datrie/tail.{h,c} (tail_is_walkable_char): Made the tiny functions
2033 inline (i.e. macros), for tiny performance gain.
2035 2006-09-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
2037 * datrie/sb-trie.{h,c} (+sb_trie_state_is_walkable): Added walkability
2040 * datrie/sb-trie.h (sb_trie_state_is_terminal, sb_trie_state_is_leaf),
2041 datrie/trie.h (trie_state_is_terminal, trie_state_is_leaf): Fixed typo
2042 for "\brief" doxygen tag.
2044 2006-09-02 Theppitak Karoonboonyanan <thep@linux.thai.net>
2046 * datrie/trie.{h,c} (trie_state_is_terminal, +trie_state_is_walkable):
2047 Changed trie_state_is_terminal() into a generic walkability test, and
2048 made itself a specialized macro calling the function.
2050 2006-08-31 Theppitak Karoonboonyanan <thep@linux.thai.net>
2052 * datrie/darray.{h,c} (+da_is_walkable),
2053 datrie/tail.{h,c} (+tail_is_walkable_char),
2054 datrie/trie.c (tail_state_is_terminal): <Optimization> Tested
2055 walkability by peeking, instead of trying with a cloned state.
2057 * datrie/tail.{h,c} (tail_walk_char): Removed redundant const in
2060 2006-08-29 Theppitak Karoonboonyanan <thep@linux.thai.net>
2062 * datrie/trie.h, datrie/sb-trie.h: Wrapped extern "C" in public
2063 headers for compiling with C++ code.
2065 2006-08-22 Theppitak Karoonboonyanan <thep@linux.thai.net>
2067 * tools/trietool.c (decode_command): Exited with proper return values.
2069 * tools/trietool.c (command_add_list): Removed warning on missing data
2070 for keys. This would be normal for data-less dictionaries.
2072 2006-08-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
2074 * datrie/trie.{h,c} (trie_state_rewind),
2075 datrie/sb-trie.{h,c} (sb_trie_state_rewind): Added API to rewind a
2076 trie state to root, so users do not need to reallocate to do so.
2078 2006-08-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
2080 * datrie/alpha-map.c (alpha_map_open, alpha_map_new): Better used a
2081 dedicated function to initialize the map.
2083 2006-08-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
2085 * datrie/alpha-map.c (alpha_map_open): Initialized map list before
2086 using. Also skipped mal-formed input lines.
2088 * tools/trietool.c (command_add_list): Removed duplicated return.
2090 2006-08-21 Theppitak Karoonboonyanan <thep@linux.thai.net>
2092 * configure.ac, Makefile.am, +datrie.pc.in: Added pkgconfig file.
2094 2006-08-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
2096 * datrie/sb-trie.{h,c} (sb_trie_state_is_terminal),
2097 datrie/trie.{h,c} (trie_state_is_terminal, trie_state_is_leaf):
2098 Added API for terminal node check and distinguish it from leaf node.
2099 (Terminal node can be in either branch or tail, while leaf can only
2102 2006-08-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
2104 * datrie/Makefile.am (pkginclude_HEADERS): Installed sb-trie.h.
2106 * datrie/sb-trie.h: Fixed file name in doxygen tag.
2108 2006-08-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
2110 * datrie/Makefile.am, +datrie/alpha-map.{h,c}, +datrie/sb-trie.{h,c}:
2111 Added alphabet map to map between character set and trie alphabet
2112 codes. Also added SBTrie wrapper for 8-bit character sets.
2114 * datrie/triedefs.h (TRIE_CHAR_MAX): Changed to 255, to fit char type.
2116 * datrie/trie.{h,c} (trie_state_walk): Removed unnecessary const in
2119 * tools/trietool.c: Used SBTrie instead of plain Trie.
2121 2006-08-20 Theppitak Karoonboonyanan <thep@linux.thai.net>
2123 * datrie/fileutils.c (file_read_int16): Fixed bitwise calculation. The
2124 second byte should be masked to get rid of possible sign bits
2125 introduced by type conversion.
2127 2006-08-19 Theppitak Karoonboonyanan <thep@linux.thai.net>
2129 * datrie/fileutils.c (file_read_int16, file_write_int16): Used shift
2130 operations to serialize int, eliminating dependency on <arpa/inet.h>.
2131 Thanks Vee Satayamas for the suggestion.
2133 2006-08-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
2135 * datrie/trie.c (trie_retrieve, trie_store, trie_delete): Always walk
2136 the null-terminator in tail. Otherwise, comparison with shorter key
2137 will terminate at separate node.
2139 2006-08-18 Theppitak Karoonboonyanan <thep@linux.thai.net>
2141 * datrie/darray.c (find_free_base): Extended pool before getting
2144 * tools/trietool.c (command_add_list): Let tab and comma be field
2145 delimitors, rather than white spaces in general.
2147 * tools/trietool.c (list_enum_func): Do not pad space when printing
2150 2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
2152 * configure.ac, Makefile.am, +doc/Makefile.am, +doc/Doxyfile.in:
2153 Generated document using doxygen.
2155 2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
2157 * datrie/darray.c (da_prune, da_num_children -> da_has_children):
2158 Just checked whether a node has at least one child, instead of
2159 counting children and comparing with zero, as a small optimization.
2161 2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
2163 * tools/trietool.c (command_add_list, command_delete_list):
2166 2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
2168 * datrie/trie.{h,c} (trie_enumerate), datrie/darray.{h,c}
2169 (da_enumerate, da_enumerate_recursive, da_get_state_key): Added key
2172 * tools/trietool.c (command_list): Implemented.
2174 2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
2176 * datrie/trie.{h,c} (trie_delete), datrie/darray.{h,c} (da_prune,
2177 da_num_children), datrie/tail.{h,c} (tail_delete): Added key deletion
2180 * datrie/tail.c (tail_save): Guarded against null suffix.
2182 * tools/trietool.c (command_delete): Implemented.
2184 2006-08-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
2186 * datrie/darray.c (da_find_free_base): Made sure the free cell for
2187 first symbol is beyond header cells. Also repeatedly extended the pool
2188 until a free cell is found, in case free list is restarted.
2190 2006-08-16 Theppitak Karoonboonyanan <thep@linux.thai.net>
2192 * datrie/fileutils.c (file_open): Created new file only if it does not
2195 * datrie/trie.c (trie_branch_in_branch): Also set data for tail block.
2197 * datrie/trie.c (trie_branch_in_tail): Do not free the const suffix
2198 block, fixing double free bug.
2200 * datrie/darray.c (da_insert_branch): Covered the case of negative
2201 base, for branching from a separate node.
2203 * tools/trietool.c (command_add): Removed debug message.
2205 2006-08-16 Theppitak Karoonboonyanan <thep@linux.thai.net>
2207 * configure.ac, Makefile.am, +tools/Makefile.am, +tools/trietool.c:
2208 Added trietool utility.
2210 * datrie/darray.c (da_get_free_list): Fixed typo in macro name.
2212 * datrie/datrie.c (da_extend_pool): Updated num_cells immediately
2213 after realloc(), to let the cell accesses pass boundary checks.
2215 * datrie/tail.c (tail_get_suffix, tail_set_suffix, tail_alloc_block,
2216 tail_free_block, tail_get_data, tail_set_data, tail_walk_str,
2217 tail_walk_char): Started tail blocks indexing from 1 (defined as
2218 TAIL_START_BLOCKNO macro) rather than 0, because we use signed values
2219 to distinguish pointers in darray.
2221 * datrie/tail.{c,h} (tail_get_suffix), datrie/trie.c
2222 (trie_branch_in_tail): Made tail_get_suffix return const pointer.
2224 * datrie/darray.c (da_close, da_save), datrie/tail.c (tail_close,
2225 tail_save): Checked errors and returned appropriate codes.
2227 * datrie/trie.c (trie_open): Checked errors on files openning and
2228 resumed appropriately.
2230 2006-08-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
2232 * datrie/Makefile.am, +datrie/fileutils.c: Added fileutils.c for
2233 implementation of file utility functions.
2235 * datrie/fileutils.{c,h}, datrie/darray.c (da_open), datrie/tail.c
2236 (tail_open): Adjusted file_read_int{8,16} API so error can be checked.
2238 2006-08-15 Theppitak Karoonboonyanan <thep@linux.thai.net>
2240 * datrie/Makefile.am, +datrie/tail.c, datrie/tail.h: Added tail.c for
2241 trie suffix implementation. Adjusted some API to not require size_t.
2243 * datrile/fileutils.h: Added more functions required by tail.c.
2245 * datrie/trie.c (trie_branch_in_tail): Added check for null suffix.
2247 2006-08-14 Theppitak Karoonboonyanan <thep@linux.thai.net>
2249 * datrie/Makefile.am, +datrie/darray.c, +datrie/fileutils.h:
2250 Added darray.c for double-array structure implementation, and
2251 fileutils.h declarations for keeping file manipulation functions.
2253 * datrie/triedefs.h: Added TRIE_CHAR_MAX constant for alphabet
2254 enumeration. Changed TRIE_INDEX_ERROR to 0, as negative number has its
2257 2006-08-12 Theppitak Karoonboonyanan <thep@linux.thai.net>
2259 * === First import the project ===