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