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