627d9096d09461358bf28211564b118854d5b474
[platform/upstream/libdatrie.git] / ChangeLog
1 2018-04-23  Theppitak Karoonboonyanan  <theppitak@gmail.com>
2
3         * configure.ac:
4           - Bump library revision to reflect code changes.
5
6         * NEWS:
7         === Version 0.2.11 ===
8
9 2018-04-21  Theppitak Karoonboonyanan  <theppitak@gmail.com>
10
11         Fix reported segfault on full-range alpha map
12
13         * tests/Makefile.am, +tests/test_byte_alpha.c:
14           - Add test case
15         * datrie/alpha-map.c (alpha_map_recalc_work_area()):
16           - Redeclare trie_last as TrieIndex, to prevent overflow.
17
18         Thanks Xiao Wang for the report, and @nevermatch for the analysis.
19
20         Closes: #6
21         https://github.com/tlwg/libdatrie/issues/6
22
23 2018-03-29  Theppitak Karoonboonyanan  <theppitak@gmail.com>
24
25         Fix trie_state_get_data() at a prefix key
26
27         When getting data from a state which terminates a key that is
28         a prefix of another key, a terminator should be tried, so it
29         jumps from DA to TAIL, where we can get the data.
30
31         * tests/Makefile.am, +tests/test_term_state.c:
32           - Add a test case with {'ab', 'abc'} dictionary, which fails previous
33             code when retrieving data for key 'ab'.
34         * datrie/trie.c (trie_state_get_data()):
35           - Instead of simply checking for leaf state, which only caught a state
36             in TAIL, also try walking with a terminator when still in DA.
37           - Replace 'leaf state' with 'terminal state' in documentation,
38             for more clarity.
39           - Also return error on null state pointer.
40
41         Thanks Filip Pytloun from the pytries project for the initial patch.
42
43 2017-09-06  Theppitak Karoonboonyanan  <theppitak@gmail.com>
44
45         Revise description about search time complexity
46
47         * README:
48           - Clarify that search time is O(m), where m is the key length,
49             instead of O(1), while still claim that it's independent of
50             database size.
51
52         This closes #4.
53         https://github.com/tlwg/libdatrie/issues/4
54
55 2016-12-14  Theppitak Karoonboonyanan  <theppitak@gmail.com>
56
57         Include git-version-gen in tarball
58
59         * Makefile.am:
60           - Add build-aux/git-version-gen to EXTRA_DIST.
61
62 2016-09-21  Theppitak Karoonboonyanan  <theppitak@gmail.com>
63
64         Fix iconv() return value checking.
65
66         * tools/trietool.c (conv_to_alpha):
67           - Check iconv() return value against (size_t) -1, rather than
68             for its negativity, as size_t can be unsigned.
69
70         Thanks Daniel Macks for the report on Issue #3.
71         https://github.com/tlwg/libdatrie/issues/3
72
73 2016-09-21  Theppitak Karoonboonyanan  <theppitak@gmail.com>
74
75         Use versioning based on Git snapshot.
76
77         * Makefile.am:
78           - Add dist-hook to generate VERSION file on tarball generation.
79         * +build-aux/git-version-gen:
80           - Add script to generate version based on 'git describe'
81             if in git tree, or using VERSION file if in release tarball.
82         * configure.ac:
83           - Call git-version-gen to get package version.
84
85 2015-10-20  Theppitak Karoonboonyanan  <theppitak@gmail.com>
86
87         * configure.ac:
88           - Bump library revision to reflect code changes.
89
90         * NEWS, configure.ac:
91         === Version 0.2.10 ===
92
93 2015-10-13  Theppitak Karoonboonyanan  <theppitak@gmail.com>
94
95         Optimize AlphaMap mapping.
96
97         alpha_map_char_to_trie() is called everywhere before trie state
98         transition. It's an important bottleneck.
99
100         We won't change the persistent AlphaMap structure, but will add
101         pre-calculated lookup tables for use at run-time.
102
103         * datrie/alpha-map.c (struct _AlphaMap):
104           - Add members for alpha-to-trie and trie-to-alpha lookup tables.
105         * datrie/alpha-map.c (alpha_map_new, alpha_map_free):
106           - Initialize & free the tables properly.
107         * datrie/alpha-map.c (alpha_map_add_range -> alpha_map_add_range_only
108           + alpha_map_recalc_work_area):
109           - Split alpha_map_add_range() API into two parts: adding the range
110             as usual and recalculate the lookup tables.
111         * datrie/alpha-map.c (alpha_map_clone, alpha_map_fread_bin):
112           - Call alpha_map_add_range_only() repeatedly before calling
113             alpha_map_recalc_work_area() once.
114         * datrie/alpha-map.c (alpha_map_char_to_trie, alpha_map_trie_to_char):
115           - Look up the pre-calculated tables instead of calculating on
116             every call.
117
118         This appears to save time by 14.6% for total alpha_char_to_trie()
119         calls and even lower its bottleneck rank by 1 rank on a libthai
120         test case. It reduces 0.2% run time of the total libthai test case.
121
122         Note that the time saved would be even more in case of multiple
123         uncontinuous alphabet ranges, at the expense of more memory used.
124
125 2015-08-18  Theppitak Karoonboonyanan  <theppitak@gmail.com>
126
127         Fix doxygen version checking.
128
129         * configure.ac:
130           - Correctly compare doxygen versions. Simple expr comparison
131             didn't work with version 1.8.10.
132
133         Thanks Petr Gajdos <pgajdos@suse.cz> for the patch.
134
135 2015-06-24  Theppitak Karoonboonyanan  <theppitak@gmail.com>
136
137         * datrie/tail.c (tail_set_suffix):
138           - Catch strdup() failure.
139
140 2015-06-24  Theppitak Karoonboonyanan  <theppitak@gmail.com>
141
142         * configure.ac: Post-release version suffix added.
143
144 2015-05-03  Theppitak Karoonboonyanan  <theppitak@gmail.com>
145
146         * NEWS, configure.ac:
147         === Version 0.2.9 ===
148
149 2015-05-03  Theppitak Karoonboonyanan  <theppitak@gmail.com>
150
151         Use relative paths for symlinks.
152
153         * tools/Makefile.am, man/Makefile.am:
154           - Use relative paths for symlinks to avoid confusion in
155             installation with DESTDIR.
156
157 2015-05-03  Theppitak Karoonboonyanan  <theppitak@gmail.com>
158
159         Also install symlink for old trietool.
160
161         * man/Makefile.am:
162           - Add hooks to install/uninstall symlink for old man page.
163
164 2015-05-02  Theppitak Karoonboonyanan  <theppitak@gmail.com>
165
166         * configure.ac:
167           - Bump library revision to reflect code changes.
168
169 2015-04-29  Theppitak Karoonboonyanan  <theppitak@gmail.com>
170
171         Bump doxygen required version.
172
173         * configure.ac:
174           - Bump doxygen required version to 1.8.8, according to recent
175             Doxyfile update.
176
177 2015-04-21  Theppitak Karoonboonyanan  <theppitak@gmail.com>
178
179         Fix infinite loop on empty trie iteration.
180
181         * tests/Makefile.am, +tests/test_null_trie.c:
182           - Add test case for empty trie iteration.
183
184         * datrie/darray.c (da_first_separate):
185           - Fix error condition after loop ending.
186
187         Thanks Sergei Lebedev <sergei.a.lebedev@gmail.com> for the report
188         via personal mail.
189
190         Original report: https://github.com/kmike/datrie/issues/17
191
192 2015-04-12  Theppitak Karoonboonyanan  <theppitak@gmail.com>
193
194         Document about alphabet size.
195
196         * datrie/trie.h:
197           - Add to doc comment a description on the alphabet size limit
198             and the mapped raw codes.
199
200         Thanks edgehogapp for the suggestion.
201         https://groups.google.com/forum/#!topic/thai-linux-foss-devel/U-O__IfviQ0
202
203 2015-04-11  Theppitak Karoonboonyanan  <theppitak@gmail.com>
204
205         Clarify Symbols' struct & methods.
206
207         * datrie/darray.c (struct _Symbols):
208           - Use TRIE_CHAR_MAX + 1 instead of hard-coded value for symbols[]
209             array size.
210
211         Thanks edgehogapp for the suggestion.
212         https://groups.google.com/forum/#!topic/thai-linux-foss-devel/U-O__IfviQ0
213
214         * datrie/darray.h, datrie/darray.c (symbols_new, symbols_add):
215           - Hide symbols_new() and symbols_add() for internal use.
216
217 2015-03-06  Theppitak Karoonboonyanan  <theppitak@gmail.com>
218
219         Update Doxyfile.
220
221         * doc/Doxyfile.in:
222           - Updated for doxygen 1.8.8 with 'doxygen -u'.
223
224 2015-03-02  Theppitak Karoonboonyanan  <theppitak@gmail.com>
225
226         Catch realloc failure.
227
228         * datrie/tail.c (tail_alloc_block):
229           - Check realloc() result on t->tails reallocation and return
230             failure code if failed.
231         * datrie/tail.c (tail_add_suffix):
232           - Check return value from tail_alloc_block() and return failure
233             code if failed.
234           - Update documentation.
235
236 2015-03-02  Theppitak Karoonboonyanan  <theppitak@gmail.com>
237
238         Catch realloc failure.
239
240         * datrie/darray.c (da_extend_pool):
241           - Check realloc() result on d->cells reallocation and handle
242             failure properly.
243
244 2015-02-27  Theppitak Karoonboonyanan  <theppitak@gmail.com>
245
246         Catch malloc failure.
247
248         * datrie/tail.c (tail_fread):
249           - Check malloc() result on suffix string and exit properly.
250
251 2015-02-26  Theppitak Karoonboonyanan  <theppitak@gmail.com>
252
253         More micro-optimization with LIKELY/UNLIKELY.
254
255         * datrie/alpha-map.c (alpha_map_char_to_trie, alpha_map_trie_to_char):
256           - Use UNLIKELY() when checking for NUL character.
257
258 2015-02-10  Theppitak Karoonboonyanan  <theppitak@gmail.com>
259
260         Fix 'make distcheck' failure.
261
262         * doc/Makefile.am:
263           - Remove doxygen db file on clean.
264
265 2015-02-10  Theppitak Karoonboonyanan  <theppitak@gmail.com>
266
267         More update of my e-mail address.
268
269         * man/trietool.1:
270           - Update my e-mail address.
271
272 2015-02-10  Theppitak Karoonboonyanan  <theppitak@gmail.com>
273
274         Rename trietool-0.2 utility to trietool.
275
276         * configure.ac:
277           - Check for ln -s
278         * tools/Makefile.am:
279           - Rename bin target from trietool-0.2 to trietool.
280           - Add hooks to install/uninstall symlink with old name.
281         * man/Makefile.am, man/trietool-0.2.1 -> man/trietool.1:
282           - Rename & update manpage accordingly.
283
284 2015-02-06  Theppitak Karoonboonyanan  <theppitak@gmail.com>
285
286         Micro-optimize with likely/unlikely hints.
287
288         * datrie/trie-private.h:
289           - Add LIKELY() and UNLIKELY() macros based on compiler extension.
290         * datrie/alpha-map.c
291           (alpha_map_new, alpha_map_clone, alpha_map_fread_bin,
292            alpha_map_add_range, alpha_map_char_to_trie_str,
293            alpha_map_trie_to_char_str):
294         * datrie/darray.c
295           (symbols_new, da_new, da_fread, da_get_base, da_get_check,
296            da_set_base, da_set_check, da_insert_branch, da_find_free_base,
297            da_extend_pool):
298         * datrie/dstring.c (dstring_new, dstring_ensure_space):
299         * datrie/tail.c
300           (tail_new, tail_fread, tail_get_suffix, tail_set_suffix,
301            tail_get_data, tail_set_data, tail_walk_str, tail_walk_char):
302         * datrie/trie.c
303           (trie_new, trie_fread, trie_enumerate, trie_state_new,
304            trie_state_walk, trie_state_is_walkable, trie_iterator_new):
305           - Use LIKELY() and UNLIKELY() where it is known to be so, mostly
306             for one-time initialization and failure handling.
307         * datrie/alpha-map.c, datrie/tail.c, datrie/tail.c:
308           - These are the files that need to include trie-private.h
309             because of this.
310
311         Callgrind says it does help speed up a little bit.
312
313 2015-02-05  Theppitak Karoonboonyanan  <theppitak@gmail.com>
314
315         Disable timestamp in Doxygen-generated doc.
316
317         * doc/Doxyfile.in:
318           - Set HTML_TIMESTAMP to NO to make the document reproducible.
319             (reported by Debian Reproducible)
320
321 2015-02-01  Theppitak Karoonboonyanan  <theppitak@gmail.com>
322
323         * configure.ac: [Belated] post-release version suffix added.
324
325 2015-02-01  Theppitak Karoonboonyanan  <theppitak@gmail.com>
326
327         Update my e-mail address everywhere.
328
329         * AUTHORS, configure.ac, datrie/*.[ch], tests/*.[ch],
330           tools/trietool.c:
331           - Replace all mentionings of my e-mail address with the gmail one.
332
333 2015-02-01  Theppitak Karoonboonyanan  <theppitak@gmail.com>
334
335         Fix binary file opening on Windows.
336
337         * datrie/trie.c (trie_new_from_file, trie_save):
338           - Add "b" to fopen() modes, so the binary file is opened properly
339             on Windows.
340
341           Thanks phongphan.p for the report and initial patch.
342
343 2014-01-10  Theppitak Karoonboonyanan  <thep@linux.thai.net>
344
345         * configure.ac:
346           - Bump library revision to reflect code changes.
347
348         * NEWS, configure.ac:
349         === Version 0.2.8 ===
350
351 2014-01-09  Theppitak Karoonboonyanan  <thep@linux.thai.net>
352
353         Improve documentation.
354
355         * datrie/triedefs.h:
356           - Refine descriptions of data types.
357         * datrie/trie.c (trie_iterator_new):
358           - Fix typo on trie_root() mentioning.
359         * datrie/trie.c (trie_store, trie_store_if_absent):
360           - Adjust wording.
361         * datrie/alpha-map.h, datrie/trie.h:
362           - Add detailed description of AlphaMap and Trie types.
363
364 2014-01-08  Theppitak Karoonboonyanan  <thep@linux.thai.net>
365
366         Clarify message in test_nonalpha.
367
368         * tests/test_nonalpha.c (main):
369           - Clarify message on false key duplication.
370
371 2014-01-08  Theppitak Karoonboonyanan  <thep@linux.thai.net>
372
373         Add test on keys with non-alphabet input chars.
374
375         * tests/Makefile.am, +tests/test_nonalpha.c:
376           - Add test to ensure that operations on keys with non-alphabet
377             input chars fail.
378
379 2014-01-08  Theppitak Karoonboonyanan  <thep@linux.thai.net>
380
381         Fail trie operations on non-alphabet inputs.
382
383         alpha_map_char_to_trie() tried to return TRIE_CHAR_MAX to indicate
384         out-of-range error. But this value is indeed valid in trie operations.
385         Doing so could allow false key duplication when different non-alphabet
386         chars and TRIE_CHAR_MAX itself were all mapped to TRIE_CHAR_MAX.
387         So, let's fail all trie operations on non-alphabet input chars.
388
389         * datrie/alpha-map-private.h, datrie/alpha-map.c
390           (alpha_map_char_to_trie):
391           - Make alpha_map_char_to_trie return TrieIndex type, using
392             TRIE_INDEX_MAX to indicate out-of-range error.
393             This allows TRIE_CHAR_MAX to be returned as a valid output.
394         * datrie/alpha-map.c (alpha_map_char_to_trie_str):
395           - Fail if alpha_map_char_to_trie() returns error code.
396         * datrie/trie.c (trie_retrieve, trie_store_conditionally, trie_delete,
397           trie_state_walk, trie_state_is_walkable):
398           - Check return value from alpha_map_char_to_trie() and return
399             failure status on error.
400           - Also cast TrieIndex return values to TrieChar on function calls.
401
402         Thanks Naoki Youshinaga for the suggestion.
403
404 2014-01-07  Theppitak Karoonboonyanan  <thep@linux.thai.net>
405
406         Check for NULL result from AlphaMap string funcs.
407
408         * datrie/trie.c (trie_store_conditionally):
409           - Return failure on NULL alpha_map_char_to_trie_str().
410
411 2014-01-07  Theppitak Karoonboonyanan  <thep@linux.thai.net>
412
413         Return NULL on allocation errors in AlphaMap funcs.
414
415         * datrie/alpha-map.c
416           (alpha_map_char_to_trie_str, alpha_map_trie_to_char_str):
417           - Return NULL on malloc() error.
418
419 2014-01-03  Theppitak Karoonboonyanan  <thep@linux.thai.net>
420
421         Fix edge case with TRIE_CHAR_MAX as TrieChar.
422
423         The trie input char with value TRIE_CHAR_MAX (255), was always
424         skipped by double-array algorithms. Let's include it.
425
426         * datrie/darray.c (da_has_children, da_output_symbols,
427           da_relocate_base, da_first_separate, da_next_separate):
428           - Include the last char in trie char iterations.
429
430         * datrie/darray.c (da_first_separate, da_next_separate):
431           - Declare characters as TrieIndex type instead of TrieChar,
432             to prevent infinite loop due to unsigned char overflow.
433
434         Thanks Naoki Youshinaga for the report, test case, and analysis.
435
436 2013-10-25  Theppitak Karoonboonyanan  <thep@linux.thai.net>
437
438         Fix comiler warnings in tests.
439
440         * tests/test_walk.c (main):
441           - Remove unused var i;
442           - Remove extra printf() args.
443         * tests/test_iterator.c:
444           - Add missing #include for free().
445         * tests/test_walk.c (walk_dict), tests/utils.c (dict_src):
446           - Cast string literals to (AlphaChar *) to fix signedness
447             differences.
448
449 2013-10-25  Theppitak Karoonboonyanan  <thep@linux.thai.net>
450
451         * configure.ac: Post-release version suffix added.
452
453 2013-10-22  Theppitak Karoonboonyanan  <thep@linux.thai.net>
454
455         * NEWS, configure.ac:
456         === Version 0.2.7.1 ===
457
458 2013-10-21  Theppitak Karoonboonyanan  <thep@linux.thai.net>
459
460         * configure.ac: Bump library versioning to reflect API addition.
461         (Change missing in previous release)
462
463 2013-10-21  Theppitak Karoonboonyanan  <thep@linux.thai.net>
464
465         * configure.ac: Post-release version suffix added.
466
467 2013-10-21  Theppitak Karoonboonyanan  <thep@linux.thai.net>
468
469         * NEWS, configure.ac:
470         === Version 0.2.7 ===
471
472 2013-10-21  Theppitak Karoonboonyanan  <thep@linux.thai.net>
473
474         Add missing distributed file.
475
476         * tests/Makefile.am:
477           - Add utils.h to distribution.
478
479 2013-10-20  Theppitak Karoonboonyanan  <thep@linux.thai.net>
480
481         Reorder tests from primitive to applied.
482
483         * tests/Makefile.am:
484           - Test walk & iterator before store-retrieve & file.
485
486 2013-10-20  Theppitak Karoonboonyanan  <thep@linux.thai.net>
487
488         Write a test suite for trie walk.
489
490         * tests/test_walk.c:
491           - Write test code.
492
493 2013-10-18  Theppitak Karoonboonyanan  <thep@linux.thai.net>
494
495         Write a test suite for trie store/retrieval.
496
497         * tests/utils.h, tests/utils.c (+dict_src_n_entries):
498           - Add function to get total entries in dict_src[].
499         * tests/test_store-retrieve.c (main):
500           - Write test code.
501
502 2013-10-18  Theppitak Karoonboonyanan  <thep@linux.thai.net>
503
504         Fix messages in test_iterator.
505
506         * tests/test_iterator.c (main):
507           - s/file/trie/. No file is written or read in this test.
508
509 2013-10-18  Theppitak Karoonboonyanan  <thep@linux.thai.net>
510
511         Skip further iteration tests if key is NULL.
512
513         * tests/test_iterator.c (main):
514           - Insert 'continue' if trie_iterator_get_key() returns NULL.
515
516 2013-10-17  Theppitak Karoonboonyanan  <thep@linux.thai.net>
517
518         Document availibility of alpha_char_strcmp()
519
520         * datrie/alpha-map.c (alpha_char_strcmp):
521           - Document that it's available since 0.2.7.
522
523 2013-10-17  Theppitak Karoonboonyanan  <thep@linux.thai.net>
524
525         Write a test for trie iterator.
526
527         * tests/test_iterator.c:
528           - Write test suite for trie iterator.
529
530 2013-10-17  Theppitak Karoonboonyanan  <thep@linux.thai.net>
531
532         Add skeleton test suites & a test for file I/O.
533
534         * configure.ac, Makefile.am, +tests/, +tests/Makefile.am:
535           - Add tests/ dir to the build system.
536         * +tests/utils.h, +tests/utils.c:
537         * +tests/test_file.c:
538         * +tests/test_iterator.c:
539         * +tests/test_store-retrieve.c:
540         * +tests/test_walk.c:
541           - Add skeleton for test suites.
542         * tests/utils.h, tests/utils.c, tests/test_file.c:
543           - Write test suite for file I/O.
544
545 2013-10-17  Theppitak Karoonboonyanan  <thep@linux.thai.net>
546
547         Add alpha_char_strcmp() API.
548
549         * datrie/alpha-map.h, datrie/alpha-map.c (+alpha_char_strcmp):
550           - Add alpha_char_strcmp() declaration & body.
551         * datrie/libdatrie.def, datrie/libdatrie.map:
552           - Add alpha_char_strcmp symbols.
553
554 2013-10-16  Theppitak Karoonboonyanan  <thep@linux.thai.net>
555
556         Add missing info in alpha_map_add_range() doc.
557
558         * datrie/alpha-map.c (alpha_map_add_range):
559           - Add documentation on return value.
560
561 2013-09-23  Theppitak Karoonboonyanan  <thep@linux.thai.net>
562
563         Fix build for Visual Studio on Windows.
564
565         * datrie/dstring.c (dstring_append, dstring_append_string,
566           dstring_append_char, dstring_terminate):
567           - Cast (void *) pointers to (char *) before calculating offsets,
568             for portability.
569
570         Thanks Gabi Davar for the report and fix (via Mikhail Korobov
571         <kmike84@gmail.com>).
572
573 2013-09-23  Theppitak Karoonboonyanan  <thep@linux.thai.net>
574
575         Check for doxygen required version.
576
577         * configure.ac:
578           - When doxygen-doc is enabled, also check doxygen version.
579
580 2013-09-23  Theppitak Karoonboonyanan  <thep@linux.thai.net>
581
582         Fix doxygen warning.
583
584         * doc/Doxyfile.in:
585           - doxygen no longer ships with the FreeSans font. Just drop it.
586
587 2013-09-23  Theppitak Karoonboonyanan  <thep@linux.thai.net>
588
589         Update Doxyfile.
590
591         * doc/Doxyfile.in:
592           - Updated with 'doxygen -u'.
593
594 2013-09-23  Theppitak Karoonboonyanan  <thep@linux.thai.net>
595
596         Fix compiler warnings.
597         * datrie/trie-string.c (trie_string_append_string):
598         * datrie/trie.c (trie_iterator_get_key):
599           - Cast strlen() args from (const TrieChar *) to (const char *),
600             to fix signedness mismatch warnings.
601
602 2013-09-23  Theppitak Karoonboonyanan  <thep@linux.thai.net>
603
604         Fix automake warnings.
605
606         * datrie/Makefile.am, tools/Makefile.am:
607           - Replace deprecated INCLUDES with AM_CPPFLAGS.
608
609 2013-09-23  Theppitak Karoonboonyanan  <thep@linux.thai.net>
610
611         * configure.ac: Post-release version suffix added.
612
613 2013-01-23  Theppitak Karoonboonyanan  <thep@linux.thai.net>
614
615         * NEWS, configure.ac:
616         === Version 0.2.6 ===
617
618 2013-01-22  Theppitak Karoonboonyanan  <thep@linux.thai.net>
619
620         Use xz compression for release tarball.
621
622         * configure.ac:
623           - Specify "dist-xz no-dist-gzip" options to AM_INIT_AUTOMAKE.
624
625 2012-08-06  Theppitak Karoonboonyanan  <thep@linux.thai.net>
626
627         Improve AlphaMap range merging.
628
629         * datrie/alpha-map.c (alpha_map_add_range):
630           - Also try to merge adjacent ranges. Otherwise, adding one by one
631             character will result in linear search on alphabet set.
632
633         Thanks Mikhail Korobov <kmike84@gmail.com> for the report.
634
635 2012-08-05  Theppitak Karoonboonyanan  <thep@linux.thai.net>
636
637         Migrate trie_enumerate() to the new TrieIterator.
638
639         This improves performance by 10%, and recursion stacks are also
640         eliminated.
641
642         * datrie/trie.c (trie_enumerate):
643           - Replace da_enumerate() call with TrieIterator loop.
644         * datrie/trie.c (-trie_da_enum_func, -_TrieEnumData):
645         * datrie/darray.h, datrie/darray.c
646           (-da_enumerate, -da_get_transition_key, -DAEnumFunc,
647            -da_enumerate_recursive):
648           - Drop now-unused codes.
649
650 2012-08-05  Theppitak Karoonboonyanan  <thep@linux.thai.net>
651
652         Optimize key calculation for TrieIterator.
653
654         * datrie/Makefile.am +datrie/dstring.h +datrie/dstring-private.h
655           +datrie/dstring.c +datrie/trie-string.h +datrie/trie-string.c:
656           - Add dynamic string classes DString and TrieString.
657         * datrie/trie.c:
658           - (TrieIterator): Add "key" dynamic trie string member for
659             incrementally gathering the key while iterating.
660           - Initialize "key" member to NULL on construction. Only allocate and
661             free it on branching root states.
662         * datrie/darray.h, datrie/darray.c
663           (da_first_separate, da_next_separate):
664           - Instead of allocating memory for return string, accept a dynamic
665             string object and update it while traversing.
666         * datrie/trie.c (trie_iterator_next):
667           - For branching state, create the "key" dynamic string object on
668             first iteration and pass it to da_first_separate() and
669             da_next_separate() along the iterations.
670         * datrie/trie.c (trie_iterator_get_key):
671           - Replace the total key reconstruction by da_get_transition_key()
672             with simple string catenation of the dynamic "key" and the suffix
673             string.
674         * datrie/darray.h, datrie/darray.c (da_get_transition_key):
675           - Adjust to use dynamic string instead of total allocation.
676         * datrie/darray.c (da_enumerate_recursive):
677           - Adjust the da_get_transition_key() call accordingly.
678
679         Thanks Mikhail Korobov <kmike84@gmail.com> for the suggested approach
680         and for profiling check.
681
682 2012-07-31  Theppitak Karoonboonyanan  <thep@linux.thai.net>
683
684         Add TrieIterator and its operations.
685
686         * datrie/trie.h, datrie/trie.c
687           (+trie_iterator_new, +trie_iterator_free, +trie_iterator_next,
688            +trie_iterator_get_key, +trie_iterator_get_data):
689           - Add TrieIterator class and its methods.
690         * datrie/libdatrie.def, datrie/libdatrie.map:
691           - Add the new export symbols.
692         * datrie/darray.h, datrie/darray.c
693           (da_get_state_key -> da_get_transition_key):
694           - Adjust da_get_state_key() from getting transition key from root
695             to getting from arbitrary ancestor.
696         * datrie/darray.h, datrie/darray.c
697           (+da_first_separate, +da_next_separate):
698           - Add internal functions for iterating from one separate node to
699             another in double-array structure.
700
701         Thanks Mikhail Korobov <kmike84@gmail.com> for the use case suggestion.
702
703 2012-07-30  Theppitak Karoonboonyanan  <thep@linux.thai.net>
704
705         * doc/Doxyfile.in: Upgrade to doxygen 1.8.1.2 format.
706
707 2012-07-29  Theppitak Karoonboonyanan  <thep@linux.thai.net>
708
709         * datrie/trie.c: Reformat source.
710
711 2012-07-29  Theppitak Karoonboonyanan  <thep@linux.thai.net>
712
713         * datrie/trie.h, datrie/trie.c (trie_state_walkable_chars):
714         Reformat source.
715
716 2012-07-27  Theppitak Karoonboonyanan  <thep@linux.thai.net>
717
718         Add new API trie_state_walkable_chars() to allow breadth-first
719         traversal.
720
721         * datrie/darray.h, datrie/darray.c:
722           - Move da_output_symbols() to darray.h, to be called by the new
723             function.
724           - Move the Symbols class to darray.h, as required by
725             da_output_symbols().
726         * datrie/trie.h, datrie/trie.c (+trie_state_walkable_chars):
727           - Add the new public function.
728         * datrie/libdatrie.map, datrie/libdatrie.def:
729           - Add the new symbol to export maps.
730         * configure.ac:
731           - Update library versioning to reflect API addition.
732
733 2012-07-26  Theppitak Karoonboonyanan  <thep@linux.thai.net>
734
735         * darray/darray.c (da_has_children): Accept (const DArray *) arg.
736
737 2012-07-26  Theppitak Karoonboonyanan  <thep@linux.thai.net>
738
739         * datrie/darray.c (da_has_children, da_output_symbols,
740           da_relocate_base):
741         Calculate max_c candidate using num_cells - base instead of
742         TRIE_INDEX_MAX - base, to prevent more unnecessary loops.
743
744 2012-07-26  Theppitak Karoonboonyanan  <thep@linux.thai.net>
745
746         * datrie/trie.c (trie_state_get_data):
747         Check if the state is leaf, not just suffix, before getting data.
748
749         Thanks Mikhail Korobov <kmike84@gmail.com> for the report.
750
751 2012-07-25  Theppitak Karoonboonyanan  <thep@linux.thai.net>
752
753         * datrie/tail.h, datrie/tail.c:
754         * datrie/alpha-map.c:
755         * datrie/trie.h, datrie/trie.c:
756         * datrie/darray.c: Remove trailing spaces.
757
758 2012-07-13  Theppitak Karoonboonyanan  <thep@linux.thai.net>
759
760         * datrie/tail.c (tail_get_suffix): Fix function documentation.
761
762         Thanks Mikhail Korobov <kmike84@gmail.com> for the report.
763
764 2012-07-13  Theppitak Karoonboonyanan  <thep@linux.thai.net>
765
766         * datrie/darray.c, datrie/tail.c:
767           - Don't include <stdint.h> when compiled with MSVC, as the header is
768             missing there, and SIZE_MAX is provided in some other header.
769
770         Thanks Mikhail Korobov <kmike84@gmail.com> for the report.
771
772 2012-07-13  Theppitak Karoonboonyanan  <thep@linux.thai.net>
773
774         * configure.ac: Post-release version suffix added.
775
776 2011-11-04  Theppitak Karoonboonyanan  <thep@linux.thai.net>
777
778         * NEWS, configure.ac:
779         === Version 0.2.5 ===
780
781 2011-08-04  Theppitak Karoonboonyanan  <thep@linux.thai.net>
782
783         * datrie/alpha-map.h: Add missing 'extern "C"' for export functions
784         to fix problem with C++ compiler.
785         Thanks Aurimas ÄŒernius <aurisc4@gmail.com> for the patch.
786
787 2011-03-13  Theppitak Karoonboonyanan  <thep@linux.thai.net>
788
789         * configure.ac: Post-release version suffix added.
790         * datrie/trie.h: Add missing documentation for "user_data" parameter
791         in TrieEnumFunc.
792
793 2010-06-30  Theppitak Karoonboonyanan  <thep@linux.thai.net>
794
795         * NEWS, configure.ac:
796         === Version 0.2.4 ===
797
798 2010-06-28  Theppitak Karoonboonyanan  <thep@linux.thai.net>
799
800         * datrie/alpha-map-private.h, datrie/alpha-map.c:
801         * datrie/darray.h, datrie/darray.c:
802         * datrie/tail.h, datrie/tail.c:
803         * datrie/trie.c (trie_fread, trie_fwrite):
804         Rename *_read() and *_write() functions to *_fread() and *_fwrite(),
805         for consistency with the trie_f{read,write}() function.
806
807 2010-06-28  Theppitak Karoonboonyanan  <thep@linux.thai.net>
808
809         Add trie_fread() and trie_fwrite() interfaces for reading/writing trie
810         data from an open file. Thanks NIIBE Yutaka <gniibe@fsij.org> for the
811         suggestion.
812
813         * datrie/trie.h (trie_fread, trie_fwrite): Add new API declarations.
814         * datrie/trie.c (trie_new_from_file, trie_fread, trie_save,
815           trie_fwrite):
816         Refactor open file handling of trie_new_from_file() and trie_save()
817         into trie_fread() and trie_fwrite(), and make the old functions
818         do file opening/closing as wrappers to them.
819         * datrie/libdatrie.def, datrie/libdatrie.map: Add symbol exports.
820
821 2010-06-27  Theppitak Karoonboonyanan  <thep@linux.thai.net>
822
823         * datrie/trie.c (trie_store_if_absent): Document that it's available
824         since 0.2.4.
825         * datrie/libdatrie.def, datrie/libdatrie.map: Add symbol exports for
826         trie_store_if_absent().
827         * ChangeLog: Fix file locations in previous log.
828
829 2010-06-24  Theppitak Karoonboonyanan  <thep@linux.thai.net>
830
831         Add trie_store_if_absent() interface to avoid race condition in
832         multi-thread applications. Thanks Dan Searle <dan.searle@censornet.com>
833         for the suggestion.
834
835         * datrie/trie.h (trie_store_if_absent): Add new API declaration.
836         * datrie/trie.c (trie_store_if_absent, trie_store,
837           trie_store_conditionally):
838         Refactor trie_store() into trie_store_conditionally() with extra arg
839         is_overwrite, and make the two public functions mere wrappers to it.
840         * configure.ac: Bump library version according to the added symbol.
841
842 2010-03-01  Theppitak Karoonboonyanan  <thep@linux.thai.net>
843
844         * datrie/trie.c (trie_save): Do not return before closing file.
845         Thanks to Xu Jiandong for the report.
846
847 2010-03-01  Theppitak Karoonboonyanan  <thep@linux.thai.net>
848
849         * configure.ac: Post-release version suffix added.
850
851 2010-02-27  Theppitak Karoonboonyanan  <thep@linux.thai.net>
852
853         * configure.ac: Bump library revision.
854         * NEWS, configure.ac:
855         === Version 0.2.3 ===
856
857 2010-02-25  Theppitak Karoonboonyanan  <thep@linux.thai.net>
858
859         * datrie/*.h, datrie/*.c: Add my e-mail address to license header.
860
861 2010-02-24  Theppitak Karoonboonyanan  <thep@linux.thai.net>
862
863         * datrie/*.h, datrie/*.c: Add license header to every source file.
864
865 2010-02-23  Theppitak Karoonboonyanan  <thep@linux.thai.net>
866
867         Move documentation from *.h to *.c, so libdatrie developers have the
868         doc at hand. Users can still read the doxygen-generated doc BTW.
869
870         * datrie/alpha-map.h:
871         * datrie/alpha-map.c:
872         * datrie/trie.h:
873         * datrie/trie.c:
874         * datrie/darray.h:
875         * datrie/darray.c:
876         * datrie/tail.h:
877         * datrie/tail.c: Move doc comments from *.h to *.c.
878         * doc/Doxyfile.in: Add alpha-map.c, trie.c to INPUT.
879         * doc/Makefile.am: Add *.c to doxygen.stamp dependency.
880
881 2010-02-20  Theppitak Karoonboonyanan  <thep@linux.thai.net>
882
883         * datrie/darray.c (da_read), datrie/tail.c (tail_read):
884         Protect against possible integer overflow on malicious trie file.
885
886 2010-02-20  Theppitak Karoonboonyanan  <thep@linux.thai.net>
887
888         * configure.ac: Post-release version suffix added.
889
890         Be more robust against corrupted trie files.
891         * datrie/alpha-map.c (alpha_map_read_bin):
892         * datrie/darray.c (da_read):
893         * datrie/tail.c (tail_read):
894           - Check all returns from file_read_*() and clean up properly on
895             failures
896           - Adjust existing clean up codes to the new structure
897
898 2009-04-29  Theppitak Karoonboonyanan  <thep@linux.thai.net>
899
900         * configure.ac: Bump library revision.
901         * NEWS, configure.ac:
902         === Version 0.2.2 ===
903
904 2009-04-28  Theppitak Karoonboonyanan  <thep@linux.thai.net>
905
906         * configure.ac: Check $datrie_cv_have_version_script against "yes",
907         not "1", so symbol versioning works on GNU ld again.
908
909 2009-04-28  Theppitak Karoonboonyanan  <thep@linux.thai.net>
910
911         * datrie/trie.c (trie_state_copy): Use bitwise copy instead of
912         member-wise.
913
914 2009-04-15  Theppitak Karoonboonyanan  <thep@linux.thai.net>
915
916         * configure.ac: Adjust variable name datrie_cv_have_version_script.
917
918 2009-04-14  Theppitak Karoonboonyanan  <thep@linux.thai.net>
919
920         Support locale charset query with libcharset, for mac and mingw.
921         [Thanks Beamer User for the report.]
922
923         * configure.ac: Check for locale_charset() from libiconv and
924         nl_langinfo(CODESET) from libc. If neither is present, ask user to
925         install GNU libiconv.
926         * tools/trietool.c (init_iconv): Use locale_charset() to query locale
927         charset if possible, fall back to nl_langinfo(CODESET) otherwise.
928
929 2009-04-14  Theppitak Karoonboonyanan  <thep@linux.thai.net>
930
931         Support alternative iconv implemetations.
932         [Thanks cwt for the report.]
933
934         * configure.ac: Check for GNU libconv or native libiconv if system libc
935         doesn't have iconv().
936         * tools/Makefile.am: Add ICONV_LIBS to linker options.
937
938 2009-04-13  Theppitak Karoonboonyanan  <thep@linux.thai.net>
939
940         Fall back to libtool for linkers that do not support -version-script.
941         [Thanks bact' for the report. Thanks cwt for the test.]
942
943         * configure.ac: Check whether linker supports -version-script.
944         * datrie/Makefile.am, +datrie/libdatrie.def:
945         Apply -version-script flag only when linker supports it. Otherwise,
946         fall back to the old method based on libtool -export-symbols flag.
947
948 2009-04-13  Theppitak Karoonboonyanan  <thep@linux.thai.net>
949
950         * configure.ac: Post-release version suffix added.
951         * configure.ac (AC_CONFIG_MACRO_DIR), Makefile.am (ACLOCAL_AMFLAGS):
952         Add m4 dir as automake includes, as required by the new libtool.
953         [Thanks cwt for the report and test.]
954
955 2009-04-05  Theppitak Karoonboonyanan  <thep@linux.thai.net>
956
957         * configure.ac: Bump library revision.
958         * NEWS, configure.ac:
959         === Version 0.2.1 ===
960
961 2009-04-05  Theppitak Karoonboonyanan  <thep@linux.thai.net>
962
963         * datrie-0.2.pc.in: Remove blank Requires: line.
964
965 2009-04-03  Theppitak Karoonboonyanan  <thep@linux.thai.net>
966
967         * datrie/alpha-map.h, datrie/trie.h: Revise documentation.
968
969 2009-04-03  Theppitak Karoonboonyanan  <thep@linux.thai.net>
970
971         * datrie/fileutils.h, datrie/fileutils.c
972         (make_full_path, file_open, file_length): Remove unused codes.
973         * datrie/triedefs.h (TrieIOMode): Remove unused typedef.
974
975 2009-04-01  Theppitak Karoonboonyanan  <thep@linux.thai.net>
976
977         * datrie/Makefile.am, datrie/libdatrie.def -> datrie/libdatrie.map:
978         Replace libtool symbol exports with symbol versioning, to ease
979         upgrading across SONAME.
980
981 2009-03-31  Theppitak Karoonboonyanan  <thep@linux.thai.net>
982
983         Fix gcc warnings.
984
985         * tools/trietool.c (conv_to_alpha): Cast 'out_p' pointer before
986         comparing.
987         * tools/trietool.c (command_add_list, command_delete_list):
988         Make sure 'saved_conv' is initialized before use.
989         * datrie/trie.c (trie_new_from_file): Remove unused 'alt_map' var.
990
991 2009-03-31  Theppitak Karoonboonyanan  <thep@linux.thai.net>
992
993         * configura.ac: Post-release version suffix added.
994
995         * datrie/trie.h (trie_save): Document parameter 'path'.
996         * doc/Doxygen.in: Update format to doxygen 1.5.8.
997
998 2009-03-24  Theppitak Karoonboonyanan  <thep@linux.thai.net>
999
1000         * NEWS, configure.ac:
1001         === Version 0.2.0 ===
1002
1003 2009-03-24  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1004
1005         * Makefile.am, +README.migration:
1006         Add migration documentation.
1007
1008 2008-12-29  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1009
1010         * datrie/alpha-map.c (alpha_map_char_to_trie, alpha_map_trie_to_char):
1011         Tighten the loop for more readability, plus eliminating one duplicated
1012         check.
1013
1014 2008-12-28  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1015
1016         * datrie/datrie.c (da_get_base, da_get_check, da_set_base,
1017         da_set_check)):
1018         Revert lower bound checks. It's no use checking too much for internal
1019         code.
1020
1021 2008-12-28  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1022
1023         * datrie/trie.h, datrie/trie.c, datrie/libdatrie.def
1024         (trie_state_is_leaf, +trie_state_is_single):
1025           - Introduce a new state condition: single. A single state is a state
1026             in a single path, with no other branch til its leaf.
1027           - Redefine trie_state_is_leaf() as a macro based on it and
1028             trie_state_is_terminal().
1029
1030 2008-12-26  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1031
1032         * datrie/trie.h, datrie/trie.c, datrie/libdatrie.def (trie_state_copy):
1033         Add a new API function for trie state reuse support.
1034
1035 2008-12-15  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1036
1037         * tools/trietool.c (conv_to_alpha): Use 'unsigned char' instead of
1038         'uint8'. Better not tie to datrie internal notations too much.
1039
1040 2008-12-15  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1041
1042         * configure.ac: Post-release version bump.
1043
1044         * tools/trietool.c (conv_to_alpha): Use uint8 to access data bytes
1045         instead of char, to fix char signedness bug.
1046
1047 2008-12-15  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1048
1049         * NEWS, configure.ac:
1050         === Version 0.1.99.2 ===
1051
1052 2008-12-15  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1053
1054         * man/Makefile.am, man/trietool.1 -> man/trietool-0.2.1:
1055         Rename 'trietool' man page to 'trietool-0.2', according to the
1056         corrsponding binary.
1057
1058 2008-12-14  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1059
1060         * tools/Makefile.am: Rename 'trietool' program to 'trietool-0.2',
1061         to allow co-existence with datrie 0.1.x.
1062
1063 2008-12-14  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1064
1065         * datrie/darray.c (da_read):
1066         * datrie/tail.c (tail_read):
1067         Restore file pointer on signature check failure.
1068
1069 2008-12-14  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1070
1071         * man/trietool.1: Document that no more than 255 alphabets are allowed.
1072
1073 2008-12-13  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1074
1075         Ensure that ranges in AlphaMap are always sorted and don't overlap.
1076
1077         * datrie/alpha-map.c (struct _AlphaMap, alpha_map_new):
1078           - Remove 'last_range' member
1079         * datrie/alpha-map.c (alpha_map_add_range):
1080           - Check if the new range overlaps existing ranges and merge them
1081             as necessary.
1082
1083 2008-12-13  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1084
1085         * configure.ac: Post-release version bump.
1086         * configure.ac, Makefile.am, datrie.pc.in -> datrie-0.2.pc.in:
1087         Rename pkg-config file, to allow co-existence with datrie 0.1.x.
1088
1089 2008-12-12  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1090
1091         * NEWS, configure.ac:
1092         === Version 0.1.99.1 ===
1093
1094 2008-12-12  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1095
1096         * man/trietool.1: Update document
1097           - Trie is now stored in a single '*.tri' file
1098           - The alphabet map is renamed from '*.sbm' to '*.abm'
1099           - Mention Unicode, instead of single-byte character domain
1100           - Document the options for 'add-list' and 'delete-list' commands
1101           - Adjust troff formatting commands
1102
1103 2008-12-12  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1104
1105         * tools/trietool.c (prepare_trie):
1106           - Try to read alphabet map from '*.abm' instead of '*.sbm'
1107
1108 2008-12-11  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1109
1110         Allow specifying character encoding for word list file.
1111
1112         * tools/trietool.c (command_add_list, command_delete_list):
1113           - Add '-e|--encoding ENC' option which temporarily override locale's
1114             codeset for character conversion
1115         * tools/trietool.c (usage):
1116           - Update usage message accordingly
1117
1118 2008-12-09  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1119
1120         Use const where possible + general clean-ups.
1121
1122         * datrie/alpha-map-private.h, datrie/alpha-map.c (alpha_map_write_bin):
1123         * datrie/alpha-map.h, datrie/alpha-map.c (alpha_map_clone):
1124         * datrie/alpha-map.c (alpha_map_get_total_ranges):
1125           - Accept (const AlphaMap *) arg
1126         * datrie/alpha-map.c (alpha_map_char_to_trie_str):
1127           - Rename 'alphabet_str' to 'trie_str', to be more sensible
1128
1129         * datrie/darray.h, datrie/darray.c (da_write, da_walk, da_enumerate):
1130         * datrie/darray.c
1131           (da_output_symbols, da_get_state_key, da_enumerate_recursive):
1132           - Accept (const DArray *) arg
1133         * datrie/darray.h, datrie/darray.c (da_free):
1134           - Made void function, instead of int
1135         * datrie/darray.c (da_new):
1136           - Set CHECK[0] = d->num_cells, to be more clear
1137         * datrie/darray.c (da_write, da_extend_pool):
1138           - Update CHECK[0] whenever DArray::num_cells is changed, instead of
1139             just setting it before writing; so da_write() can now accept
1140             (const DArray *) arg
1141
1142         * datrie/tail.h, datrie/tail.c
1143           (tail_write, tail_get_data, tail_walk_str, tail_walk_char):
1144           - Accept (const Tail *) arg
1145         * datrie/tail.h, datrie/tail.c (tail_free):
1146           - Made void function, instead of int
1147
1148         * datrie/trie.c (struct _TrieState, struct _TrieEnumData):
1149           - 'trie' member is now const pointer
1150         * datrie/trie.h, datrie/trie.c
1151           (trie_new, trie_is_dirty, trie_retrieve, trie_enumerate, trie_root):
1152         * datrie/trie.c (trie_state_new):
1153           - Accept (const Trie *) arg
1154
1155 2008-12-09  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1156
1157         Unicode (UCS-4) character support.
1158
1159         * datrie/triedefs.h (AlphaChar):
1160           - unsigned char -> uint32
1161
1162         * datrie/alpha-map.h, datrie/alpha-map.c, datrie/libdatrie.def:
1163           - Export alpha_char_strlen() utility routine
1164
1165         * tools/trietool.c
1166           (ProgEnv, init_conv, conv_to_alpha, conv_from_alpha, close_conv):
1167           - Add routines for converting characters between locale (LC_CTYPE)
1168             codeset and UCS-4
1169         * tools/trietool.c (main):
1170           - Initialize and close conversion routines
1171         * tools/trietool.c
1172           (command_add, command_add_list, command_delete, command_delete_list,
1173           command_query, list_enum_func, command_list):
1174           - Convert character encodings between I/O and trie
1175
1176 2008-12-09  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1177
1178         * datrie/trie.c (trie_retrieve, trie_store):
1179           - Use (AlphaChar *), not (TrieChar *), as key pointer type
1180
1181 2008-12-07  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1182
1183         * datrie/trie.c (trie_retrieve):
1184           - Remove unused var 'len'
1185           - Compare AlphaChar with integer zero rather than '\0'
1186
1187 2008-12-07  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1188
1189         Adjust APIs for in-memory trie support.
1190
1191         * datrie/trie.c (struct _Trie):
1192           - Remove 'file' member; now trie is detached from file; file is
1193             closed after loading, and reopened when saving
1194         * datrie/trie.h, datrie/trie.c (trie_new):
1195           - Add public APIs: trie_new(), for non-file usage
1196           - One can still save it to file with trie_save(), BTW
1197         * datrie/trie.h, datrie/trie.c (trie_open, trie_new_from_file):
1198           - Rename trie_open() to trie_new_from_file() and make it accept only
1199             one pathname parameter, instead of separated dir and name
1200           - Alphabet map is now mandatory, rather than optional
1201         * datrie/trie.h, datrie/trie.c (trie_close, trie_free):
1202           - Rename trie_close() to trie_free() and do not bother with saving
1203             any more
1204         * datrie/trie.h, datrie/trie.c (trie_save):
1205           - Accept file path argument and open the file for saving
1206         * datrie/trie.h, datrie/trie.c (trie_is_dirty):
1207           - Add public API: trie_is_dirty() for client to determine whether
1208             saving is needed
1209
1210         * datrie/alpha-map-private.h:
1211           - Separate internal APIs from public
1212         * datrie/alpha-map.h, datrie/alpha-map.c:
1213           - Promote alpha_map_new() and alpha_map_add_range() to public;
1214             they are now needed by trie_new()
1215           - Remove alpha_map_open()
1216           - Add public API: alpha_map_clone()
1217           - Document public APIs
1218
1219         * datrie/darray.h, datrie/darray.c (da_new):
1220           - Add internal API: da_new() needed by trie_new()
1221           - Code migrated from new-file case in da_read()
1222         * datrie/darray.c (da_read):
1223           - No longer handle new file; read failure means an error
1224
1225         * datrie/tail.h, datrie/tail.c (tail_new):
1226           - Add internal API: tail_new() needed by trie_new()
1227           - Code migrated from new-file case in tail_read()
1228         * datrie/tail.c (TAIL_SIGNATURE):
1229           - Update TAIL_SIGNATURE to harmonize with other data parts
1230         * datrie/tail.c (tail_read):
1231           - No longer handle new file; read failure means an error
1232
1233         * tools/trietool.c (prepare_trie, close_trie):
1234           - Add helper function for openning and closing trie
1235         * tools/trietool.c (main):
1236           - Open and close trie with prepare_trie() and close_trie()
1237
1238         * datrie/Makefile.am:
1239           - Install alpha-map.h as public header
1240           - Add alpha-map-private.h to source list
1241         * datrie/libdatrie.def:
1242           - Update exported symbols
1243
1244 2008-12-07  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1245
1246         Rename AlphaMap functions to be more logical.
1247
1248         * datrie/alpha-map.c, datrie/alpha-map.h: Rename functions
1249           - alpha_map_char_to_alphabet -> alpha_map_char_to_trie
1250           - alpha_map_alphabet_to_char -> alpha_map_trie_to_char
1251           - alpha_map_char_to_alphabet_str -> alpha_map_char_to_trie_str
1252           - alpha_map_alphabet_to_char_str -> alpha_map_trie_to_char_str
1253
1254         * datrie/trie.c (trie_retrieve, trie_store, trie_delete,
1255           trie_da_enum_func, trie_state_walk, trie_state_is_walkable):
1256           - Call the AlphaMap functions with the new names
1257
1258 2008-12-07  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1259
1260         Merge SBTrie alphabet mapping feature into Trie.
1261
1262         * datrie/triedefs.h (AlphaChar):
1263           - Add AlphaChar typedef, as well as ALPHA_CHAR_ERROR macro
1264             (moved from UniChar type in datrie/alpha-map.h)
1265
1266         * datrie/alpha-map.c (alpha_char_strlen):
1267           - Add string length function for alphabet string
1268         * datrie/alpha-map.c (struct _AlphaRange):
1269           - Use AlphaChar type instead of UniChar for begin, end members
1270         * datrie/alpha-map.c (alpha_map_get_total_ranges):
1271           - Add range count private method
1272         * datrie/alpha-map.c (alpha_map_add_range):
1273           - Add private method for adding range (refactored from
1274             alpha_map_open())
1275         * datrie/alpha-map.c (alpha_map_open):
1276           - Call alpha_map_add_range() to add range, instead of doing low-level
1277             code
1278         * datrie/alpha-map.c, datrie/alpha-map.h
1279           (alpha_map_read_bin, alpha_map_write_bin):
1280           - Add methods for binary format I/O
1281         * datrie/alpha-map.c, datrie/alpha-map.h
1282           (alpha_map_char_to_alphabet, alpha_map_alphabet_to_char):
1283           - Accept and return AlphaChar, instead of UniChar
1284         * datrie/alpha-map.c, datrie/alpha-map.h
1285           (alpha_map_char_to_alphabet_str, alpha_map_alphabet_to_char_str):
1286           - Add public methods for mapping strings (migrated from
1287             sb_map_char_to_alphabet_str and sb_map_alphabet_to_char_str in
1288             datrie/sb-trie.c)
1289
1290         * datrie/trie.c (struct _Trie):
1291           - Add alpha_map member
1292         * datrie/trie.c (trie_open):
1293           - Add code to read AlphaMap data block, and prefer text-formatted
1294             *.sbm if exists
1295           - Defer Trie object allocation to after file openning
1296         * datrie/trie.c (trie_close):
1297           - Free alpha_map member
1298         * datrie/trie.c (trie_save):
1299           - Add code to write AlphaMap data block
1300         * datrie/trie.c, datrie/trie.h (trie_retrieve, trie_store, trie_delete,
1301           trie_da_enum_func, trie_state_walk, trie_state_is_walkable):
1302           - Adjust function prototypes to accept AlphaChar instead of TrieChar
1303           - Add mapping between alphabet and trie character code
1304         * datrie/trie.h (TrieEnumFunc):
1305           - Adjust function typedef to accept AlphaChar instead of TrieChar
1306
1307         * datrie/Makefile.am:
1308           - Remove sb-trie.c and sb-trie.h from source/header list
1309         * datrie/libdatrie.def:
1310           - Remove sb_trie symbols
1311
1312         * tools/trietool.c:
1313           - Call trie_* functions instead of sb_trie_*
1314
1315 2008-12-03  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1316
1317         Adjust file format by catenating *.br and *.tl data into a single
1318         *.tri file.
1319
1320         * datrie/trie.c (struct _Trie):
1321           - Add 'file' and 'is_dirty' members
1322         * datrie/trie.c (trie_open):
1323           - Open the file and call da_read() and tail_read() to load data
1324             portions, instead of openning separate files
1325         * datrie/trie.c (trie_close):
1326           - Do the saving stuff and free DArray and Tail data, instead of
1327             separately closing them; then finally close the file
1328         * datrie/trie.c (trie_save):
1329           - Write file portions with da_write() and tail_write() instead of
1330             saving to separate files
1331           - Handle the 'is_dirty' stuffs
1332         * datrie/trie.c (trie_store, trie_branch_in_branch, trie_delete):
1333           - Set the 'is_dirty' flag
1334
1335         * datrie/darray.h: Change prototypes for internal APIs whose
1336         functionalities are to be reduced:
1337           - da_open(path, name, mode) -> da_read(FILE*)
1338           - da_close(DArray*) -> da_free(DArray*)
1339           - da_save(DArray*) -> da_write(DArray*, FILE*)
1340
1341         * datrie/darray.c (struct_DArray):
1342           - Drop 'file' and 'is_dirty' members
1343         * datrie/darray.c (da_open -> da_read):
1344           - Accept (FILE *) argument and drop file openning/closing codes
1345           - Store number of cells at CHECK[0], so double-array data size can
1346             determined without depending on file size
1347           - Do not allocate DArray object until needed
1348           - Drop 'is_dirty' stuffs
1349         * datrie/darray.c (da_close -> da_free):
1350           - Remove file stuffs; just free memory
1351         * datrie/darray.c (da_save -> da_write):
1352           - Accept (FILE *) argument and use it instead of DArray::file
1353           - Ensure CHECK[0] stores the number of cells
1354           - Drop 'is_dirty' stuffs
1355         * datrie/darray.c (da_set_base, da_set_check):
1356           - Drop 'is_dirty' stuffs
1357
1358         * datrie/tail.h: Change prototypes for internal APIs whose
1359         functionalities are to be reduced:
1360           - tail_open(path, name, mode) -> tail_read(FILE*)
1361           - tail_close(Tail*) -> tail_free(Tail*)
1362           - tail_save(Tail*) -> tail_write(Tail*, FILE*)
1363
1364         * datrie/tail.c (struct _Tail):
1365           - Drop 'file' and 'is_dirty' members
1366         * datrie/tail.c (tail_open -> tail_read):
1367           - Accept (FILE *) argument and drop file openning/closing codes
1368           - Check for new file from read failure, rather than file size
1369           - Do not allocate Tail object until needed
1370           - Drop 'is_dirty' stuffs
1371         * datrie/tail.c (tail_close -> tail_free):
1372           - Remove file stuffs; just free memory
1373         * datrie/tail.c (tail_save -> tail_write):
1374           - Accept (FILE *) argument and use it instead of Tail::file
1375           - Drop 'is_dirty' stuffs
1376         * datrie/tail.c (tail_set_suffix, tail_set_data, tail_free_block):
1377           - Drop 'is_dirty' stuffs
1378
1379 2008-12-01  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1380
1381         Get rid of the weird TrieIndexInt intermediate type, by checking
1382         ranges instead. (Changes merged from r_0_1_x-branch)
1383
1384         * datrie/darray.c: Remove typedef for TrieIndexInt.
1385         * datrie/darray.c (da_check_free_cell, da_extend_pool):
1386           - Accept normal TrieIndex arg instead of TrieIndexInt
1387         * datrie/datrie.c (da_insert_branch):
1388           - Define 'base', 'next' vars as TrieIndex instead of TrieIndexInt
1389           - Check overflow for 'next' before checking if the cell is free
1390         * datrie/datrie.c (da_find_free_base):
1391           - Define 's' var as TrieIndex instead of TrieIndexInt
1392         * datrie/datrie.c (da_fit_symbols):
1393           - Check overflow for (base + sym) before checking if the cell is free
1394         * datrie/datrie.c (da_get_base, da_get_check, da_set_base,
1395         da_set_check)):
1396           - Also check lower bound for index range
1397
1398 2008-11-27  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1399
1400         First changes to break ABI for larger trie index.
1401
1402         * datrie/triedefs.h: Redefine TrieIndex and TrieData as int32.
1403         Update TRIE_INDEX_MAX accordingly.
1404         * datrie/darray.c (da_open, da_save): Redefine DA_SIGNATURE.
1405         Read/write 32-bit data in headers.
1406         * datrie/darray.c (da_has_children, da_output_symbols,
1407         da_relocate_base):
1408         Declare characters as TrieIndex instead of uint16.
1409         * datrie/tail.c (tail_open, tail_save): Redefine TAIL_SIGNATURE.
1410         Read/write 32-bit data in headers. Use 16-bit length for each block.
1411         * configure.ac: Bump up library version to 1.0.0.
1412
1413 2008-06-21  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1414
1415         * man/trietool.1: Use troff .in command to indent text, fixing warning
1416         from 'groff --warnings'. Thanks Debian's lintian.
1417
1418 2008-06-21  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1419
1420         * datrie/tail.c (tail_set_suffix):
1421         * datrie/sb-trie.c (sb_map_char_to_alphabet_str):
1422         Fix GCC warnings about char signedness.
1423
1424 2008-01-28  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1425
1426         * configure.in: Bump the library revision.
1427         * NEWS:
1428         === Version 0.1.3 ===
1429
1430 2008-01-28  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1431
1432         * man/trietool.1: Add documentation for the SBM file.
1433
1434 2008-01-28  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1435
1436         * README: Fix my name in the reference.
1437
1438 2008-01-10  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1439
1440         * datrie/tail.c (tail_set_suffix): Fix bug for the case in which
1441         suffix argument and tail's suffix overlap. Bug report and patch by
1442         shepmaster in http://linux.thai.net/node/102.
1443
1444 2008-01-10  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1445
1446         * datrie/sb-trie.c (sb_trie_root): Return NULL pointer, rather than
1447         FALSE. Bug reported by shepmaster in http://linux.thai.net/node/101.
1448
1449 2007-10-17  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1450
1451         * datrie/libdatrie.def: List only symbols in plain format, for Mac
1452         build. Thanks Vee Satayamas for the report.
1453
1454         * datrie/Makefile.am: Add libdatrie.def as libdatrie_la_DEPENDENCIES.
1455
1456 2007-08-28  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1457
1458         * doc/Doxyfile.in: Only generate doc for public API.
1459
1460 2007-08-28  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1461
1462         * doc/Makefile.am, doc/Doxyfile.in: Revert API man pages generation
1463         and installation. Update Doxyfile format to doxygen 1.5.3.
1464
1465 2007-08-26  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1466
1467         * man/trietool.1: Escape some minus signs. Mark a variable italic.
1468         Thanks debian's lintian.
1469
1470 2007-08-26  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1471
1472         * configure.ac: Post-release version bump.
1473
1474 2007-08-25  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1475
1476         * configure.ac: Bump lib revision.
1477         * NEWS:
1478         === Version 0.1.2 ===
1479
1480 2007-08-25  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1481
1482         * datrie/Makefile.am, +datrie/trie-private.h (MIN_VAL, MAX_VAL):
1483         Add utility macros.
1484         * datrie/darray.c (da_output_symbols): Adjust loop boundary to be more
1485         overflow-safe.
1486         * "-------------" (da_has_children, da_relocate_base): Apply the same
1487         loop pattern to prevent out-of-range accesses.
1488
1489 2007-08-24  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1490
1491         * datrie/darray.c (da_output_symbols): Do not try to test symbols
1492         beyond trie index range. Fixes segfault for trietool list command.
1493
1494 2007-08-19  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1495
1496         Handle double array index overflow.
1497
1498         * datrie/triedefs.h (TRIE_INDEX_MAX): Define maximum index value.
1499         * datrie/darray.c (TrieIndexInt): Define type for immediate values, so
1500         overflow can be detected.
1501         * "-------------" (da_extend_pool): Return success/failure status.
1502         Accept TrieIndexInt argument for overflow detection.
1503         * "-------------" (da_check_free_cell): False when extending fails.
1504         Accept TrieIndexInt argument for overflow detection.
1505         * "-------------" (da_find_free_base): Return error on failure.
1506         * "-------------" (da_insert_branch): Return error on failure.
1507         * datrie/trie.c (trie_branch_in_branch, trie_branch_in_tail): Check
1508         for failure from da_insert_branch() and return the status.
1509         * datrie/darray.{c,h} (da_prune_upto, da_prune): Add da_prune_upto(),
1510         for rolling back partial operation in trie_branch_in_branch().
1511         Redefine da_prune() in terms of da_prune_upto().
1512
1513 2007-08-16  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1514
1515         * datrie/darray.c (da_open, da_find_free_base): Use DA_POOL_BEGIN
1516         macro instead of hard-coded number. Remove unused DA_EXTENDING_STEPS.
1517
1518 2007-05-12  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1519
1520         * datrie/sb-trie.c (sb_trie_close, sb_trie_save, sb_trie_retrieve,
1521         sb_trie_store, sb_trie_enumerate, sb_trie_root, sb_trie_state_clone,
1522         sb_trie_state_free, sb_trie_state_rewind, sb_trie_state_walk,
1523         sb_trie_state_is_walkable, sb_trie_state_is_terminal,
1524         sb_trie_state_is_leaf, sb_trie_state_get_data):
1525         Guard against NULL pointers in functions. Thanks to Neutron Soutmun
1526         for bug report and initial patch.
1527
1528 2007-04-06  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1529
1530         * doc/Makefile.am: Add install-man target. Also install/uninstall
1531         doxygen-generated man pages.
1532
1533 2007-03-27  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1534
1535         * configure.ac (LT_CURRENT, LT_REVISION, LT_AGE),
1536         datrie/Makefile.am (libdatrie_la_LDFLAGS), +datrie/libdatrie.def:
1537         Add library version info. Limit exported symbols with -export-symbols
1538         flag. Always pass -no-undefined flag.
1539
1540         * configure.ac: Add Win32 DLL building support.
1541
1542 2006-11-02  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1543
1544         * datrie/fileutils.{c,h} (file_read_int32, file_write_int32): Add
1545         int32 read/write functions.
1546
1547         * datrie/fileutils.c (file_read_int16, file_write_int16): Use unsigned
1548         char buffer instead of and-ing with 0xff, in accordance with int32
1549         functions. (Thanks to Vee Satayamas for suggestion).
1550
1551 2006-10-13  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1552
1553         * configure.ac: Post-release version bump.
1554
1555 2006-10-12  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1556
1557         * NEWS:
1558         === Version 0.1.1 ===
1559
1560 2006-10-12  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1561
1562         * configure.ac, Makefile.am, +man/Makefile.am, +man/trietool.1:
1563         Add manpage for trietool (moved from debian/).
1564
1565 2006-10-11  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1566
1567         Fixed compiler warnings.
1568
1569         * datrie/sb-trie.c (sb_map_alphabet_to_char_str):
1570         * datrie/tail.c (tail_open, tail_save, tail_set_suffix):
1571         * datrie/trie.c (trie_da_enum_func): Cast pointers to get rid of
1572         compiler warnings about char signedness.
1573
1574         * tools/trietool.c (list_enum_func): Return value on exit.
1575
1576 2006-09-18  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1577
1578         * configure.ac: Post-release version bump.
1579
1580 2006-09-18  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1581
1582         * NEWS, configure.ac:
1583         === Version 0.1.0 ===
1584
1585 2006-09-17  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1586
1587         * README: Filled in.
1588
1589 2006-09-02  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1590
1591         * datrie/triedefs.h, datrie/trie.h, datrie/sb-trie.h: Included headers
1592         using system header forms in installed headers.
1593
1594         * datrie/Makefile.am (INCLUDES): Added include flag to ensure it
1595         compiles without prior installation.
1596
1597 2006-09-02  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1598
1599         * datrie/alpha-map.c (alpha_map_char_to_alphabet,
1600         alpha_map_alphabet_to_char): Made sure terminator is always mapped
1601         with character 0.
1602
1603 2006-09-02  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1604
1605         * datrie/darray.{h,c} (da_is_walkable),
1606         datrie/tail.{h,c} (tail_is_walkable_char): Made the tiny functions
1607         inline (i.e. macros), for tiny performance gain.
1608
1609 2006-09-02  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1610
1611         * datrie/sb-trie.{h,c} (+sb_trie_state_is_walkable): Added walkability
1612         test wrapper.
1613
1614         * datrie/sb-trie.h (sb_trie_state_is_terminal, sb_trie_state_is_leaf),
1615         datrie/trie.h (trie_state_is_terminal, trie_state_is_leaf): Fixed typo
1616         for "\brief" doxygen tag.
1617
1618 2006-09-02  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1619
1620         * datrie/trie.{h,c} (trie_state_is_terminal, +trie_state_is_walkable):
1621         Changed trie_state_is_terminal() into a generic walkability test, and
1622         made itself a specialized macro calling the function.
1623
1624 2006-08-31  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1625
1626         * datrie/darray.{h,c} (+da_is_walkable),
1627         datrie/tail.{h,c} (+tail_is_walkable_char),
1628         datrie/trie.c (tail_state_is_terminal): <Optimization> Tested
1629         walkability by peeking, instead of trying with a cloned state.
1630
1631         * datrie/tail.{h,c} (tail_walk_char): Removed redundant const in
1632         parameter.
1633
1634 2006-08-29  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1635
1636         * datrie/trie.h, datrie/sb-trie.h: Wrapped extern "C" in public
1637         headers for compiling with C++ code.
1638
1639 2006-08-22  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1640
1641         * tools/trietool.c (decode_command): Exited with proper return values.
1642
1643         * tools/trietool.c (command_add_list): Removed warning on missing data
1644         for keys. This would be normal for data-less dictionaries.
1645
1646 2006-08-21  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1647
1648         * datrie/trie.{h,c} (trie_state_rewind),
1649         datrie/sb-trie.{h,c} (sb_trie_state_rewind): Added API to rewind a
1650         trie state to root, so users do not need to reallocate to do so.
1651
1652 2006-08-21  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1653
1654         * datrie/alpha-map.c (alpha_map_open, alpha_map_new): Better used a
1655         dedicated function to initialize the map.
1656
1657 2006-08-21  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1658
1659         * datrie/alpha-map.c (alpha_map_open): Initialized map list before
1660         using. Also skipped mal-formed input lines.
1661
1662         * tools/trietool.c (command_add_list): Removed duplicated return.
1663
1664 2006-08-21  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1665
1666         * configure.ac, Makefile.am, +datrie.pc.in: Added pkgconfig file.
1667
1668 2006-08-20  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1669
1670         * datrie/sb-trie.{h,c} (sb_trie_state_is_terminal),
1671         datrie/trie.{h,c} (trie_state_is_terminal, trie_state_is_leaf):
1672         Added API for terminal node check and distinguish it from leaf node.
1673         (Terminal node can be in either branch or tail, while leaf can only
1674         be in tail.)
1675
1676 2006-08-20  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1677
1678         * datrie/Makefile.am (pkginclude_HEADERS): Installed sb-trie.h.
1679
1680         * datrie/sb-trie.h: Fixed file name in doxygen tag.
1681
1682 2006-08-20  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1683
1684         * datrie/Makefile.am, +datrie/alpha-map.{h,c}, +datrie/sb-trie.{h,c}:
1685         Added alphabet map to map between character set and trie alphabet
1686         codes. Also added SBTrie wrapper for 8-bit character sets.
1687
1688         * datrie/triedefs.h (TRIE_CHAR_MAX): Changed to 255, to fit char type.
1689
1690         * datrie/trie.{h,c} (trie_state_walk): Removed unnecessary const in
1691         character argument.
1692
1693         * tools/trietool.c: Used SBTrie instead of plain Trie.
1694
1695 2006-08-20  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1696
1697         * datrie/fileutils.c (file_read_int16): Fixed bitwise calculation. The
1698         second byte should be masked to get rid of possible sign bits
1699         introduced by type conversion.
1700
1701 2006-08-19  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1702
1703         * datrie/fileutils.c (file_read_int16, file_write_int16): Used shift
1704         operations to serialize int, eliminating dependency on <arpa/inet.h>.
1705         Thanks Vee Satayamas for the suggestion.
1706
1707 2006-08-18  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1708
1709         * datrie/trie.c (trie_retrieve, trie_store, trie_delete): Always walk
1710         the null-terminator in tail. Otherwise, comparison with shorter key 
1711         will terminate at separate node.
1712
1713 2006-08-18  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1714
1715         * datrie/darray.c (find_free_base): Extended pool before getting
1716         exhausted.
1717
1718         * tools/trietool.c (command_add_list): Let tab and comma be field
1719         delimitors, rather than white spaces in general.
1720
1721         * tools/trietool.c (list_enum_func): Do not pad space when printing
1722         key data.
1723
1724 2006-08-17  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1725         
1726         * configure.ac, Makefile.am, +doc/Makefile.am, +doc/Doxyfile.in:
1727         Generated document using doxygen.
1728
1729 2006-08-17  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1730
1731         * datrie/darray.c (da_prune, da_num_children -> da_has_children):
1732         Just checked whether a node has at least one child, instead of
1733         counting children and comparing with zero, as a small optimization.
1734
1735 2006-08-17  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1736
1737         * tools/trietool.c (command_add_list, command_delete_list):
1738         Implemented.
1739
1740 2006-08-17  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1741
1742         * datrie/trie.{h,c} (trie_enumerate), datrie/darray.{h,c}
1743         (da_enumerate, da_enumerate_recursive, da_get_state_key): Added key
1744         enumeration method.
1745
1746         * tools/trietool.c (command_list): Implemented.
1747
1748 2006-08-17  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1749
1750         * datrie/trie.{h,c} (trie_delete), datrie/darray.{h,c} (da_prune,
1751         da_num_children), datrie/tail.{h,c} (tail_delete): Added key deletion
1752         method.
1753
1754         * datrie/tail.c (tail_save): Guarded against null suffix.
1755
1756         * tools/trietool.c (command_delete): Implemented.
1757
1758 2006-08-17  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1759
1760         * datrie/darray.c (da_find_free_base): Made sure the free cell for 
1761         first symbol is beyond header cells. Also repeatedly extended the pool
1762         until a free cell is found, in case free list is restarted.
1763
1764 2006-08-16  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1765
1766         * datrie/fileutils.c (file_open): Created new file only if it does not
1767         exist.
1768
1769         * datrie/trie.c (trie_branch_in_branch): Also set data for tail block.
1770
1771         * datrie/trie.c (trie_branch_in_tail): Do not free the const suffix
1772         block, fixing double free bug.
1773
1774         * datrie/darray.c (da_insert_branch): Covered the case of negative
1775         base, for branching from a separate node.
1776
1777         * tools/trietool.c (command_add): Removed debug message.
1778
1779 2006-08-16  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1780
1781         * configure.ac, Makefile.am, +tools/Makefile.am, +tools/trietool.c:
1782         Added trietool utility.
1783
1784         * datrie/darray.c (da_get_free_list): Fixed typo in macro name.
1785
1786         * datrie/datrie.c (da_extend_pool): Updated num_cells immediately 
1787         after realloc(), to let the cell accesses pass boundary checks.
1788
1789         * datrie/tail.c (tail_get_suffix, tail_set_suffix, tail_alloc_block,
1790         tail_free_block, tail_get_data, tail_set_data, tail_walk_str,
1791         tail_walk_char): Started tail blocks indexing from 1 (defined as
1792         TAIL_START_BLOCKNO macro) rather than 0, because we use signed values
1793         to distinguish pointers in darray.
1794
1795         * datrie/tail.{c,h} (tail_get_suffix), datrie/trie.c
1796         (trie_branch_in_tail): Made tail_get_suffix return const pointer.
1797
1798         * datrie/darray.c (da_close, da_save), datrie/tail.c (tail_close,
1799         tail_save): Checked errors and returned appropriate codes.
1800
1801         * datrie/trie.c (trie_open): Checked errors on files openning and
1802         resumed appropriately.
1803
1804 2006-08-15  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1805
1806         * datrie/Makefile.am, +datrie/fileutils.c: Added fileutils.c for
1807         implementation of file utility functions.
1808
1809         * datrie/fileutils.{c,h}, datrie/darray.c (da_open), datrie/tail.c
1810         (tail_open): Adjusted file_read_int{8,16} API so error can be checked.
1811
1812 2006-08-15  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1813
1814         * datrie/Makefile.am, +datrie/tail.c, datrie/tail.h: Added tail.c for
1815         trie suffix implementation. Adjusted some API to not require size_t.
1816
1817         * datrile/fileutils.h: Added more functions required by tail.c.
1818
1819         * datrie/trie.c (trie_branch_in_tail): Added check for null suffix.
1820
1821 2006-08-14  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1822
1823         * datrie/Makefile.am, +datrie/darray.c, +datrie/fileutils.h:
1824         Added darray.c for double-array structure implementation, and 
1825         fileutils.h declarations for keeping file manipulation functions.
1826
1827         * datrie/triedefs.h: Added TRIE_CHAR_MAX constant for alphabet
1828         enumeration. Changed TRIE_INDEX_ERROR to 0, as negative number has its
1829         own meaning.
1830
1831 2006-08-12  Theppitak Karoonboonyanan  <thep@linux.thai.net>
1832
1833         * === First import the project ===