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