]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - contrib/gperf/ChangeLog
MFC r368207,368607:
[FreeBSD/stable/10.git] / contrib / gperf / ChangeLog
1 2007-04-30  Brendan Kehoe  <brendan@zen.org>
2
3         * gperf-3.0.3 released.
4         * src/version.cc: Bump to 3.0.3.
5         * tests/*.exp: Bump to 3.0.3 in header.
6         * doc/gperf.1: Regenerate with gperf 3.0.3.
7
8 2007-04-06  Bruno Haible  <bruno@clisp.org>
9
10         Improve support for mingw.
11         * tests/Makefile.in (check-c, check-ada, check-modula3, check-pascal,
12         check-lang-utf8, check-lang-ucs2): Remove '\r' from output before diff.
13         (POSTPROCESS_FOR_MINGW): New variable.
14         (check-test): Use it to postprocess output before diff.
15
16 2007-04-04  Bruno Haible  <bruno@clisp.org>
17
18         Support for newer GNU standards.
19         * doc/configure.ac (mandir): Remove assignment.
20         * doc/Makefile.in (datarootdir): New variable.
21         (docdir, dvidir, psdir, pdfdir, htmldir): Use value determined by
22         autoconf.
23         * configure.ac: Require autoconf >= 2.60.
24         * doc/configure.ac: Likewise.
25         * lib/configure.ac: Likewise.
26         * src/configure.ac: Likewise.
27         * tests/configure.ac: Likewise.
28         * configure: Regenerated with autoconf-2.61.
29         * doc/configure: Likewise.
30         * lib/configure: Likewise.
31         * src/configure: Likewise.
32         * tests/configure: Likewise.
33         * src/config.h.in: Likewise.
34         * src/config.h.msvc: Likewise.
35         * src/config.h_vms: Likewise.
36
37 2007-04-04  Bruno Haible  <bruno@clisp.org>
38
39         * doc/Makefile.in (MAKEINFO): Disable also the LC_MESSAGES and LC_ALL
40         environment variables.
41
42 2007-04-04  Bruno Haible  <bruno@clisp.org>
43
44         * configure.ac: Renamed from configure.in.
45         * doc/configure.ac: Renamed from doc/configure.in.
46         * lib/configure.ac: Renamed from lib/configure.in.
47         * src/configure.ac: Renamed from src/configure.in.
48         * tests/configure.ac: Renamed from tests/configure.in.
49         * Makefile.devel: Update.
50         * INSTALL: Update.
51
52 2007-03-31  Bruno Haible  <bruno@clisp.org>
53
54         * tests/test.c (in_word_set): New declaration.
55         * tests/test2.c (in_word_set): Likewise.
56
57 2007-03-31  Bruno Haible  <bruno@clisp.org>
58
59         * src/options.cc (Options::parse_options): Bump copyright year.
60
61 2007-03-31  Bruno Haible  <bruno@clisp.org>
62
63         * doc/gperf.texi: Fix typo.
64
65 2007-03-31  Bruno Haible  <bruno@clisp.org>
66
67         Change generated code after the meaning of __inline is changed in
68         GCC 4.3.
69         * src/output.cc (Output::output_lookup_function): Emit an inline
70         marker that also works with gcc-4.3 in c99 or gnu99 mode.
71         * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp,
72         tests/cplusplus.exp, tests/gpc.exp, tests/incomplete.exp,
73         tests/java.exp, tests/languages.exp, tests/modula2.exp,
74         tests/objc.exp, tests/permut2.exp, tests/permut3.exp,
75         tests/permutc2.exp, tests/test-4.exp: Update.
76         Reported by Bruce Korb <Bruce.Korb@gmail.com>.
77
78 2006-06-29  Brendan Kehoe  <brendan@zen.org>
79
80         * gperf-3.0.2 released.
81
82         * doc/Makefile.in (all): No longer depend on dvi.
83
84 2006-01-22  Brendan Kehoe  <brendan@zen.org>
85
86         * doc/gperf.texi: Update copyright to be 1989-2006.
87         (UPDATED): Change to 22 January 2006.
88         * doc/gperf.1 (TH): Fix date.
89         * configure.in: Update copyright years.
90         * configure: Regenerate.
91         * src/Makefile.in: Update copyright years.
92
93         * doc/gperf.{dvi,ps,pdf}: Regenerated by manually invoking tex
94         instead of trying to use texi2dvi, whose run of etex ends up
95         actually always running pdfetex, thus always recreating gperf.pdf.
96
97 2006-01-13  Brendan Kehoe  <brendan@zen.org>
98
99         * NEWS: Add note about #line directive fix.
100         * doc/gperf.1: Regenerate with Makefile.devel.
101
102         * doc/gperf.texi (UPDATED): Correct to be today.
103         * doc: Regenerated by doing make in a configured tree.
104         Requires makeinfo, texi2dvi, texi2pdf, and texi2html.
105
106         * configure.in: Add AC_OBJEXT and AC_EXEEXT.
107         * lib/Makefile.in (OBJEXT): Define for subst.
108         (OBJECTS): Use $(OBJEXT) instead of '.o'.
109         * src/Makefile.in: Make dependencies use $(OBJEXT).
110         (OBJEXT, EXEEXT): Define for subst.
111         (TARGETPROG): Add $(EXEEXT).
112         (OBJECTS): Use $(OBJEXT) instead of '.o'.
113         (clean): Remove *.$(OBJEXT) instead of *.o.
114
115 2006-01-13  Bruno Haible  <bruno@clisp.org>
116
117         Fix #line directives for filenames containing backslashes.
118         * src/output.cc (output_line_directive): New function.
119         (output_keyword_entry, Output::output): Use it.
120         Reported by Alexander <alexander.me@gmail.com>.
121
122         * src/options.cc (Options::parse_options): Update years in --version
123         output.
124
125 2005-08-29  Brendan Kehoe  <brendan@zen.org>
126
127         * src/keyword.cc: Tweak comment to avoid nesting.
128
129 2005-08-27  Bruno Haible  <bruno@clisp.org>
130
131         Fix missing ranlib detection when cross-compiling.
132         * aclocal.m4 (CL_PROG_RANLIB): Remove macro.
133         * lib/configure.in: Use AC_PROG_RANLIB instead of CL_PROG_RANLIB.
134
135 2005-07-30  Bruno Haible  <bruno@clisp.org>
136
137         * src/version.cc: Bump version number to 3.0.2.
138         * doc/gperf.texi: Likewise.
139         * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp,
140         tests/cplusplus.exp, tests/gpc.exp, tests/incomplete.exp,
141         tests/java.exp, tests/languages.exp, tests/modula2.exp,
142         tests/objc.exp, tests/permut2.exp, tests/permut3.exp,
143         tests/permutc2.exp, tests/test-4.exp: Update.
144
145 2005-07-30  Bruno Haible  <bruno@clisp.org>
146
147         * src/positions.h: Add forward declarations of friend classes.
148         Needed for compilation with g++ 4.0.
149
150 2004-08-22  Bruno Haible  <bruno@clisp.org>
151
152         * tests/Makefile.in (check-lang-syntax): Add test for the
153         --length-table-name option.
154         * tests/test-6.exp: Update.
155
156 2004-08-21  Bruce Lilly <blilly@erols.com>
157
158         * src/input.cc (Input::read_input): Accept length-table-name
159         declaration.
160         * src/options.h (Options::get_lengthtable_name,
161         Options::set_lengthtable_name): New declarations.
162         (Options): Add field _lengthtable_name.
163         * src/options.icc (Options::get_lengthtable_name): New inline method.
164         * src/options.cc (DEFAULT_LENGTHTABLE_NAME): New constant.
165         (Options::long_usage): Document --length-table-name option.
166         (Options::Options): Initialize _lengthtable_name field.
167         (Options::~Options): Update.
168         (Options::set_lengthtable_name): New method.
169         (long_options): Add option --length-table-name.
170         (Options::parse_options): Implement --length-table-name option.
171         * src/output.cc (Output::output_keylength_table, output_switch_case,
172         Output::output_lookup_function_body): Use option.get_lengthtable_name.
173         * doc/gperf.texi (Gperf Declarations): Document %define
174         length-table-name.
175         (Output Details): Document --length-table-name option.
176
177 2003-06-12  Bruno Haible  <bruno@clisp.org>
178
179         * gperf-3.0.1 released.
180
181         * src/version.cc: Bump version number to 3.0.1.
182         * doc/gperf.texi: Likewise.
183         * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp,
184         tests/cplusplus.exp, tests/gpc.exp, tests/incomplete.exp,
185         tests/java.exp, tests/languages.exp, tests/modula2.exp,
186         tests/objc.exp, tests/permut2.exp, tests/permut3.exp,
187         tests/permutc2.exp, tests/test-4.exp: Update.
188
189 2003-05-31  Bruno Haible  <bruno@clisp.org>
190
191         * doc/gperf.texi (User-supplied Struct): Mention the possibility of an
192         abbreviated struct declaration.
193         * src/input.cc (Input::read_input): Support struct declarations of the
194         form "struct foo;".
195         * tests/incomplete.gperf: New file.
196         * tests/incomplete.exp: New file.
197         * tests/Makefile.in (check-test): Check incomplete.gperf too.
198         Reported by Rob Leslie <rob@mars.org>.
199
200 2003-05-20  Bruno Haible  <bruno@clisp.org>
201
202         * doc/Makefile.in (gperf.ps): Don't use $< in a target rule.
203
204 2003-05-27  Bruno Haible  <bruno@clisp.org>
205
206         * Makefile.vms (CC): Correct value.
207         (getopt.obj, getopt1.obj, getline.obj, hash.obj): Don't set
208         HAVE_CONFIG_H.
209
210 2003-05-17  Bruno Haible  <bruno@clisp.org>
211
212         * Makefile.msvc (DEBUGFLAGS): New variable.
213         (gperf.exe): Use it, and MFLAGS too.
214
215 2003-05-08  Bruno Haible  <bruno@clisp.org>
216
217         * gperf-3.0 released.
218
219 2003-05-07  Bruno Haible  <bruno@clisp.org>
220
221         * src/version.cc: Bump version number to 3.0.
222         * doc/gperf.texi: Likewise.
223         * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp,
224         tests/cplusplus.exp, tests/gpc.exp, tests/java.exp,
225         tests/languages.exp, tests/modula2.exp, tests/objc.exp,
226         tests/permut2.exp, tests/permut3.exp, tests/permutc2.exp,
227         tests/test-4.exp: Update.
228
229         * src/configure.in: Fix AC_INIT argument.
230
231         * Makefile.devel (configure, lib/configure, src/configure,
232         tests/configure, doc/configure): Use the newest autoconf.
233         (src/config.h.in): Use the newest autoheader.
234
235 2003-05-03  Bruno Haible  <bruno@clisp.org>
236
237         * doc/gperf.texi: Use two spaces as sentence separator, as recommended
238         by the texinfo manual.
239
240 2003-04-12  Bruno Haible  <bruno@clisp.org>
241
242         * doc/configure.in (mandir): Change default value.
243         * doc/Makefile.in (docdir): Use datadir instead of prefix.
244         * Makefile.msvc (datadir): New variable.
245         (mandir, docdir): Use it instead of prefix.
246         (install, installdirs): Update.
247         * Makefile.vms (datadir): New variable.
248         (mandir, docdir): Use it instead of prefix.
249         (install, installdirs): Update.
250
251 2003-04-12  Bruno Haible  <bruno@clisp.org>
252
253         * README.vms: New file.
254         * Makefile.vms: New file.
255         * Makefile.devel (src/config.h_vms): New rule.
256         (all): Depend on it.
257
258 2003-03-19  Bruno Haible  <bruno@clisp.org>
259
260         * src/input.cc (Input::read_input): Ignore comments at the beginning
261         of the declarations section.
262         * doc/gperf.texi (Controls for GNU indent): New section.
263         Reported by Bruce Lilly <blilly@erols.com>.
264
265 2003-03-19  Bruno Haible  <bruno@clisp.org>
266
267         * src/output.cc (Output::output_hash_function): Avoid lint warning if
268         not all arguments of the hash function are used. Avoid lint warning
269         for fallthrough in switch.
270         * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp,
271         tests/cplusplus.exp, tests/java.exp, tests/languages.exp,
272         tests/modula2.exp, tests/objc.exp: All /*FALLTHROUGH*/ to expected
273         output.
274         Reported by Bruce Lilly <blilly@erols.com>.
275
276 2003-03-01  Bruno Haible  <bruno@clisp.org>
277
278         * src/options.h (Options::set_initializer_suffix): New declaration.
279         * src/options.cc (Options::set_initializer_suffix): New method.
280         * src/input.cc (Input::read_input): Recognize %define
281         initializer-suffix.
282         * doc/gperf.texi (Gperf Declarations): Document %define
283         initializer-suffix.
284         * NEWS: Update.
285
286 2003-02-26  Bruno Haible  <bruno@clisp.org>
287
288         * Makefile.msvc: New file.
289         * README.woe32: New file.
290         * Makefile.devel (all): Depend on src/config.h.msvc.
291         (src/config.h.msvc): New rule.
292
293 2003-01-07  Bruno Haible  <bruno@clisp.org>
294
295         * src/input.h (Input::_charset_dependent): New field.
296         * src/input.cc (Input::read_input): Also set _charset_dependent.
297         * src/main.cc (main): Pass _charset_dependent from Input to Output.
298         * src/output.h (Output::Output): Add charset_dependent argument.
299         (Output::_charset_dependent): New field.
300         * src/output.cc (Output::Output): Add charset_dependent argument.
301         (Output::output): Provoke a compilation error if the execution
302         character set doesn't match the expectations.
303         * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp,
304         tests/cplusplus.exp, tests/gpc.exp, tests/java.exp,
305         tests/languages.exp, tests/modula2.exp, tests/objc.exp,
306         tests/permut2.exp, tests/permut3.exp, tests/permutc2.exp,
307         tests/test-4.exp: Update.
308
309         * src/options.cc (Options::long_usage): Change bug report address to
310         <bug-gnu-gperf@gnu.org>.
311         * tests/test-6.exp: Update.
312
313         * src/output.cc (USE_DOWNCASE_TABLE): New macro.
314         (output_upperlower_table): New function.
315         (output_upperlower_strcmp, output_upperlower_strncmp,
316         output_upperlower_memcmp): Emit gperf_downcase array accesses.
317         (Output::output): Call output_upperlower_table.
318         * tests/permutc2.exp: Update.
319
320         * src/keyword-list.icc (KeywordExt_List::rest): Use a portable cast.
321         (Only in GCC a cast of an lvalue is an lvalue.)
322
323 2003-01-01  Bruno Haible  <bruno@clisp.org>
324
325         * src/options.cc (Options::parse_options): Update copyright year.
326
327         * doc/gperf.texi (@author): Add me.
328
329         * src/options.h (NULLSTRINGS): New enum value.
330         (Options::get_stringpool_name, Options::set_stringpool_name): New
331         method declarations.
332         (Options::_stringpool_name): New field.
333         * src/options.icc (Options::get_stringpool_name): New method.
334         * src/options.cc (DEFAULT_STRINGPOOL_NAME): New variable.
335         (Options::long_usage): Document -Q and --null-strings.
336         (Options::Options): Initialize _stringpool_name.
337         (Options::~Options): Output _stringpool_name, NULLSTRINGS values too.
338         (Options::set_stringpool_name): New method.
339         (long_options): Add options --string-pool-name, --null-strings.
340         (Options::parse_options): Implement options -P, -Q and --null-strings.
341         * src/input.cc (Input::read_input): Recognize declarations %pic,
342         %define string-pool-name, %null-strings.
343         * src/output.h (Output::output_string_pool,
344         Output::output_lookup_pools): New method declarations.
345         (Output::_wordlist_eltype): New field.
346         * src/output.cc (Output::output_keylength_table): Trivial
347         simplification.
348         (Output::output_string_pool): New method.
349         (output_keyword_entry): Add stringpool_index argument. For SHAREDLIB,
350         use struct offsets.
351         (output_keyword_blank_entries): For SHAREDLIB, use -1 instead of "".
352         (Output::output_keyword_table): Use _wordlist_eltype instead of
353         _struct_tag. Compute stringpool_index for output_keyword_entry.
354         (Output::output_lookup_pools): New method.
355         (Output::output_lookup_function_body): Use _wordlist_eltype instead of
356         _struct_tag. For SHAREDLIB, use "+ stringpool" to convert offsets to
357         strings. Use "o >= 0" to test for nonempty table entry.
358         (Output::output_lookup_function): Call output_lookup_pools.
359         (Output::output): Initialize _wordlist_eltype. Call
360         output_lookup_pools.
361         * tests/jstest4.gperf: New file.
362         * tests/test-6.exp: Update.
363         * tests/Makefile.in (check-lang-syntax): Drop test of -p. Add tests of
364         -P and -Q.
365         * doc/gperf.texi (User-supplied Struct): Mention that first field has
366         to be of type 'int' if -P is given.
367         (Gperf Declarations): Document %pic, %define string-pool-name,
368         %null-strings.
369         (Output Details): Update description of option -P. Document options -Q
370         and --null-strings.
371
372         * tests/Makefile.in (check-link-c, check-ada, check-pascal,
373         check-test): Omit option -p.
374         * tests/c-parse.exp: Regenerated.
375         * tests/chill.exp: Regenerated.
376         * tests/cplusplus.exp: Regenerated.
377         * tests/gpc.exp: Regenerated.
378         * tests/java.exp: Regenerated.
379         * tests/objc.exp: Regenerated.
380         * tests/test-4.exp: Regenerated.
381
382         * src/output.cc (Output::output_lookup_function_body): Omit the
383         multicompare code section and its variables when it is not used.
384         * tests/chill.exp: Regenerated.
385
386         * src/output.c (Output_Compare::output_firstchar_comparison): New
387         method.
388         (Output_Compare_Strcmp::output_comparison,
389         Output_Compare_Strncmp::output_comparison,
390         Output_Compare_Memcmp::output_comparison): Use it.
391         * tests/permutc2.exp: Update.
392
393         * tests/smtp.gperf: New file, based on a contribution by Bruce Lilly.
394         * tests/Makefile.in (check-smtp): New rule.
395         (check): Depend on it.
396         (clean): Update.
397
398 2002-12-12  Bruno Haible  <bruno@clisp.org>
399
400         * src/search.h (Search::init_selchars_tuple,
401         Search::count_duplicates_tuple): Add alpha_unify argument.
402         (Search::count_duplicates_tuple): New method declaration.
403         * src/search.cc (Search::init_selchars_tuple,
404         Search::count_duplicates_tuple): Add alpha_unify argument.
405         (Search::find_positions): Update.
406         (Search::count_duplicates_tuple): New method.
407         (Search::count_duplicates_multiset): Free temp alpha_unify vector.
408         (Search::find_alpha_inc): Call count_duplicates_tuple.
409
410         * src/configure.in: Add test for stack-allocated variable-size arrays.
411         * src/config.h.in: Regenerated.
412         * src/search.cc: Include config.h.
413         (DYNAMIC_ARRAY, FREE_DYNAMIC_ARRAY): New macros.
414         (Search::find_alpha_inc, Search::count_possible_collisions,
415         Search::find_asso_values): Use them.
416         * src/Makefile.in (search.o): Depend on config.h.
417
418         * src/search.h (Search::keyword_list_length, Search::max_key_length,
419         Search::get_max_keysig_size, Search::prepare): Remove declarations.
420         (Search::prepare): Renamed from Search::preprepare.
421         (Search::_max_selchars_length): New field.
422         * src/search.cc (Search::prepare): Renamed from Search::preprepare.
423         (Search::prepare_asso_values): Merged with old Search::prepare.
424         Initialize _max_selchars_length.
425         (Search::keyword_list_length): Remove function. Use _list_len instead.
426         (Search::max_key_length): Remove function. Use _max_key_len instead.
427         (Search::get_max_keysig_size): Remove function. Use
428         _max_selchars_length instead.
429         (Search::count_possible_collisions, Search::find_asso_values): Update.
430         (Search::find_good_asso_values): Call just prepare_asso_values.
431         (Search::~Search): Update.
432
433         * src/output.h (Output::output_asso_values_ref): New declaration.
434         * src/output.cc (char_to_index): Remove variable.
435         (Output::output_asso_values_ref): New function.
436         (Output::output_hash_function): Use it.
437         (Output::output): Update.
438
439         * src/positions.h (Positions::is_useall, Positions::set_useall,
440         Positions::iterator, Positions::reviterator): New method declarations.
441         (Positions::_useall): New field.
442         (PositionIterator): Make constructor private. Add a constructor and a
443         copy constructor.
444         (PositionIterator::remaining): New declaration.
445         (PositionReverseIterator): Make constructor private. Add a constructor
446         and a copy constructor.
447         (PositionReverseIterator::remaining): New declaration.
448         (PositionReverseIterator::_minindex): New field.
449         * src/positions.icc (Positions::Positions): Initialize _useall.
450         (Positions::operator=): Likewise.
451         (Positions::is_useall, Positions::set_useall): New methods.
452         (Positions::sort): Do nothing if _useall is set.
453         (Positions::iterator, Positions::reviterator): New methods.
454         (PositionIterator::PositionIterator): New constructor.
455         (PositionIterator::remaining): New method.
456         (PositionReverseIterator::PositionReverseIterator): New constructor.
457         (PositionReverseIterator::next): Use _minindex as bound.
458         (PositionReverseIterator::remaining): New method.
459         * src/positions.cc (Positions::add, Positions::remove): Reset the
460         useall flag.
461         (Positions::print): Handle the useall case.
462         * src/options.h (ALLCHARS): Remove.
463         * src/options.cc (Options::~Options): Update.
464         (Options::parse_options): Use Positions::set_useall().
465         * src/keyword.h (KeywordExt::init_selchars_tuple,
466         KeywordExt::init_selchars_multiset, KeywordExt::init_selchars_low):
467         Remove use_all_chars argument.
468         * src/keyword.cc (KeywordExt::init_selchars_low): Remove use_all_chars
469         argument. Tell the position iterator to stop at _allchars_length.
470         Remove special case code for -k'*'.
471         (KeywordExt::init_selchars_tuple, KeywordExt::init_selchars_multiset):
472         Remove use_all_chars argument.
473         * src/search.h (Search::init_selchars_tuple): Remove use_all_chars
474         argument.
475         (Search::init_selchars_multiset): Likewise.
476         * src/search.cc (Search::init_selchars_tuple): Remove use_all_chars
477         argument.
478         (Search::count_duplicates_tuple, Search::find_positions): Update.
479         (Search::compute_alpha_unify): Remove special case code for -k'*'.
480         (Search::init_selchars_multiset): Remove use_all_chars argument.
481         (Search::count_duplicates_multiset): Update.
482         (Search::find_alpha_inc): Remove special case code for -k'*'.
483         (Search::prepare): Update.
484         (Search::get_max_keysig_size): Update.
485         * src/output.cc (Output::output_hash_function): Remove special case
486         code for -k'*'.
487         * tests/chill.exp: Regenerated.
488
489 2002-12-11  Bruno Haible  <bruno@clisp.org>
490
491         Change the positions to be 0-based, instead of 1-based.
492         * src/positions.h (Positions::LASTCHAR): Set to -1.
493         (Positions::MAX_SIZE): New constant.
494         (Positions::pointer): Change return type.
495         (Positions::_positions): Change element type.
496         (PositionIterator::EOS, PositionReverseIterator::EOS): Set to -2.
497         * src/positions.icc (Positions::pointer): Change return type.
498         (Positions::sort): Update.
499         * src/positions.cc (Positions::contains, Positions::add,
500         Positions::remove): Update.
501         (Positions::print): Update. Fix off-by-one bug.
502         * src/options.cc (Options::~Options): Update.
503         (Options::parse_options): Set BAD_VALUE to -3. Update.
504         * src/keyword.cc (KeywordExt::init_selchars_low): Update.
505         * src/search.cc (Search::find_positions, Search::compute_alpha_unify,
506         Search::find_alpha_inc): Update.
507         * src/output.cc (Output::output_hash_function): Update. Don't emit
508         a 'case' statement right after 'default:'.
509         * tests/c-parse.exp: Regenerated.
510         * tests/charsets.exp: Regenerated.
511         * tests/cplusplus.exp: Regenerated.
512         * tests/java.exp: Regenerated.
513         * tests/languages.exp: Regenerated.
514         * tests/modula2.exp: Regenerated.
515         * tests/objc.exp: Regenerated.
516
517 2002-12-10  Bruno Haible  <bruno@clisp.org>
518
519         * src/options.h: Reorder enum values.
520         (Options::short_usage, Options::long_usage): Make static.
521         * src/options.cc (Options::short_usage); No longer print a monster
522         usage line.
523         (Options::print_options): Improve output of options like
524         --key-positions=1,2,$.
525         (Options::~Options): Update.
526
527         * src/options.h (UPPERLOWER): New enum value.
528         * src/options.cc (Options::long_usage): Document option --ignore-case.
529         (Options::~Options): Update.
530         (long_options): Add option --ignore-case.
531         (Options::parse_options): Handle option --ignore-case.
532         * src/input.cc (Input::read_input): Recognize option %ignore-case.
533         * src/keyword.h (KeywordExt::init_selchars_tuple,
534         KeywordExt::init_selchars_multiset, KeywordExt::init_selchars_low):
535         Add alpha_unify argument.
536         * src/keyword.cc (KeywordExt::init_selchars_low): Add alpha_unify
537         argument.
538         (KeywordExt::init_selchars_tuple): Add alpha_unify argument.
539         (KeywordExt::init_selchars_multiset): Add alpha_unify argument.
540         * src/search.h (Search::compute_alpha_size,
541         Search::compute_alpha_unify): New declarations.
542         (Search::init_selchars_multiset): Add alpha_unify argument.
543         (Search::_alpha_unify): New field.
544         * src/search.cc (Search::compute_alpha_size,
545         Search::compute_alpha_unify): New functions.
546         (Search::init_selchars_tuple): Update.
547         (Search::find_positions): Temporarily set _alpha_unify. Perform a
548         case insensitive comparison if needed.
549         (Search::init_selchars_multiset): Add alpha_unify argument.
550         (Search::count_duplicates_multiset): Call compute_alpha_unify.
551         (Search::find_alpha_inc): Temporarily set _alpha_unify. At the end,
552         set _alpha_size and _alpha_unify.
553         (Search::prepare): Update. Don't compute _alpga_size here.
554         (Search::optimize): Propagate unified asso_values.
555         (Search::~Search) Delete _alpha_unify.
556         * src/output.cc (output_upperlower_strcmp, output_upperlower_strncmp,
557         output_upperlower_memcmp): New functions.
558         (Output_Compare_Strcmp::output_comparison,
559         Output_Compare_Strncmp::output_comparison,
560         Output_Compare_Memcmp::output_comparison): Use the case-insensitive
561         comparison function if --ignore-case was given.
562         (Output::output): Emit the auxiliary case-insensitive comparison
563         function if needed.
564         * tests/permutc2.gperf, tests/permutc2.exp: New files.
565         * tests/Makefile.in (check-test): Also check permutc2.gperf.
566         * tests/test-6.exp: Update.
567         * doc/gperf.texi (Gperf Declarations): Document %ignore-case.
568         (Input Details): Document option --ignore-case.
569         * NEWS: Update.
570
571         * src/search.cc (Search::optimize): Fill unused asso_values[] entries
572         with a large value.
573         * src/output.h (Output::Output): Remove occurrences argument.
574         (Output::_occurrences): Remove field.
575         * src/output.cc (Output::Output): Remove occurrences argument.
576         (Output::output_hash_function): Ignore _occurrences.
577         * src/main.cc (main): Don't pass the _occurrences to Output.
578
579         * src/search.cc (Search::preprepare): Exit if keywords contain
580         out-of-range characters.
581
582         * src/search.cc (for): Define so as to avoid errors with old compilers.
583
584         * src/options.h (SHAREDLIB): New enum value.
585         * src/options.cc (Options::short_usage): Mention option -P.
586         (Options::long_usage): Document option -P.
587         (long_options): Add option --pic.
588         (Options::parse_options): Handle option -P/--pic.
589         * src/output.cc (output_keyword_blank_entries): When SHAREDLIB is
590         specified, emit NULL pointers instead of "".
591         (Output::output_lookup_function_body): When SHAREDLIB is specified
592         and SWITCH and DUP and not specified, test the table entry against
593         NULL before the string comparison.
594         * tests/test-6.exp: Update.
595         * doc/gperf.texi (Output Details): Document option -P.
596         * NEWS: Update.
597         Suggested by Ulrich Drepper.
598
599 2002-12-08  Bruno Haible  <bruno@clisp.org>
600
601         * tests/permut2.gperf, tests/permut2.exp: New files.
602         * tests/permut3.gperf, tests/permut3.exp: New files.
603         * tests/charsets.gperf: New file, from Bruce Lilly.
604         * tests/charsets.exp: New file.
605         * tests/languages.gperf: New file, from Bruce Lilly.
606         * tests/languages.exp: New file.
607         * Makefile.in (check-test): Test them all.
608
609         Completely new asso_values search algorithm.
610         * src/search.h (Search::compute_occurrence, Search::clear_determined,
611         Search::set_determined, Search::already_determined, Search::reorder):
612         Remove functions.
613         (Search::init_asso_values, Search::sort_by_occurrence,
614         Search::compute_occurrence, Search::sort_by_occurrence,
615         Search::has_collisions, Search::collision_prior_to): Remove functions.
616         (Search::compute_partition, Search::count_possible_collisions,
617         Search::unchanged_partition): New method declarations.
618         (Search::_determined): Remove field.
619         * src/search.cc (Search::prepare): Don't initialize _determined.
620         (Search::compute_occurrence, greater_by_occurrence,
621         Search::clear_determined, Search::set_determined,
622         Search::already_determined, Search::reorder): Remove functions.
623         (Search::init_asso_values, compute_disjoint_union,
624         Search::sort_by_occurrence, Search::compute_occurrence,
625         Search::sort_by_occurrence, Search::has_collisions,
626         Search::collision_prior_to): Remove functions.
627         (StackEntry): Remove class.
628         (EquivalenceClass, Step): New classes.
629         (equals, Search::compute_partition, delete_partition,
630         Search::count_possible_collisions, Search::unchanged_partition): New
631         functions.
632         (Search::find_asso_values): Completely rewritten.
633         (Search::find_good_asso_values): Don't call reorder().
634         (Search::~Search): Don't free _determined.
635         * src/keyword.h (KeywordExt::_occurrence): Remove field.
636         * src/options.h (ORDER, FAST, OPT_CHOICE): Remove enum values.
637         (Options::_iterations): Remove field.
638         * src/options.icc (Options::get_iterations): Remove method.
639         * src/options.cc (Options::long_usage): Remove mention of -f and -o.
640         (Options::Options): Don't initialize _iterations.
641         (Options::~Options): Update.
642         (Options::parse_options): Do nothing for options -f, -o, -O.
643         * doc/gperf.texi: (Contributors): Update.
644         (Algorithmic Details): Remove options -f and -o. Update description
645         of option -s.
646         * tests/c-parse.exp, tests/chill.exp, tests/cplusplus.exp,
647         tests/gpc.exp, tests/java.exp, tests/modula2.exp, tests/objc.exp,
648         tests/test-4.exp): Regenerated, smaller than before.
649         * tests/test-6.exp: Update.
650         * NEWS: Update.
651
652 2002-12-08  Bruno Haible  <bruno@clisp.org>
653
654         * src/search.h (Search::_alpha_size): Change type to 'unsigned int'.
655         (Search::_asso_value_max): Likewise.
656         * src/search.cc (Search::prepare_asso_values): Update.
657         (Search::init_asso_values): Update.
658         (Search::~Search): Update.
659         * src/output.h (Output::Output): Change alpha_size type to
660         'unsigned int'.
661         (Output::_alpha_size): Change type to 'unsigned int'.
662         * src/output.cc (Output::Output): Change alpha_size type to
663         'unsigned int'.
664         (Output::output_hash_function): Update.
665
666 2002-12-07  Bruno Haible  <bruno@clisp.org>
667
668         * src/options.h (OPT_CHOICE): New enum value.
669         * src/options.cc (Options::~Options): Update.
670         (long_options): New option --optimized-collision-resolution.
671         (Options::parse_options): Accept option -O.
672         * src/search.h (Search::sort_by_occurrence): Change argument to
673         'unsigned int'.
674         (Search::compute_occurrence, Search::sort_by_occurrence): New method
675         declarations.
676         * src/search.cc (Search::sort_by_occurrence): Change argument to
677         'unsigned int'.
678         (Search::compute_occurrence, Search::sort_by_occurrence): New methods.
679         (Search::find_asso_values): Implement OPT_CHOICE. More debugging
680         output.
681
682         * src/search.cc (Search::prepare_asso_values) [DEBUG]: Also print
683         the keyword list in order.
684         (Search::find_asso_values) [DEBUG]: Upon failure, print the union_set.
685
686         * src/options.h (Options::get_size_multiple): Change return type to
687         float.
688         (Options::_size_multiple): Change type to float.
689         * src/options.icc (Options::get_size_multiple): Change return type to
690         float.
691         * src/options.cc (Options::long_usage): Update description of option
692         -s.
693         (Options::~Options): Update.
694         (Options::parse_options): For option -s, accept a fraction.
695         * src/search.cc (Search::prepare_asso_values): Use get_size_multiple
696         as it is.
697         * tests/test-6.exp: Update.
698         * doc/gperf.texi (Algorithmic Details): Update description of option
699         -s.
700
701 2002-12-04  Bruno Haible  <bruno@clisp.org>
702
703         Improve debugging output.
704         * src/hash-table.h (Hash_Table::dump): New method.
705         * src/hash-table.cc (Hash_Table::dump): New method, extracted from
706         destructor.
707         (Hash_Table::~Hash_Table): No longer print the contents.
708         * src/positions.h (PositionReverseIterator): New class.
709         * src/positions.icc (PositionReverseIterator::PositionReverseIterator,
710         PositionReverseIterator::next): New methods.
711         * src/search.cc (Search::find_positions): If debugging, print the
712         result.
713         (Search::find_alpha_inc): If debugging, print the result.
714         (Search::prepare): Explicitly dump the hash table's contents here.
715
716         Portability fixes.
717         * src/positions.h (Positions::LASTCHAR, Positions::MAX_KEY_POS,
718         PositionIterator::EOS): Define as compile-time constants using enum.
719         * src/bool-array.cc (Bool_Array::~Bool_Array): Remove const qualifier
720         of pointer to be deleted.
721         * src/input.cc (Input::~Input): Likewise.
722         * src/keyword.cc (KeywordExt::delete_selchars): Likewise.
723         * src/main.cc (main): Likewise.
724         * src/hash-table.cc (Hash_Table::~Hash_Table): Limit scope of 'for'
725         variables.
726         * src/search.cc (Search::prepare_asso_values): Use a static_cast to
727         convert from time_t to long. This is possible because ISO C 99 says
728         time_t is a numeric type.
729
730 2002-11-20  Bruno Haible  <bruno@clisp.org>
731
732         * src/search.cc (Search::find_asso_values): Avoid gcc warnings about
733         uninitialized variables.
734
735         Implement backtracking.
736         * src/search.h (Search::has_collisions): Renamed from
737         Search::less_collisions. Return a boolean.
738         * src/search.cc (Search::has_collisions): Renamed from
739         Search::less_collisions. Return a boolean.
740         (StackEntry): Remove field _collisions_so_far.
741         (Search::find_asso_values): Backtrack when encountering an unresolved
742         collision. Assume collisions_so_far is always zero.
743         (Search::optimize): Exit if there are accidental duplicates at the end.
744         * src/output.cc (Output::num_hash_values): Simply return the list
745         length.
746         (Output::output_keylength_table): Remove handling of accidental
747         duplicates.
748         (Output::output_keyword_table, Output::output_lookup_array): Likewise.
749         (output_switch_case, output_switches): Likewise.
750         * doc/gperf.texi (Algorithmic Details): Adjust description of options
751         -D, -f, -o, -r.
752         (Bugs): Remove note about missing backtracking.
753         (Projects): Likewise.
754
755 2002-11-19  Bruno Haible  <bruno@clisp.org>
756
757         Prepare for backtracking.
758         * src/search.h (Search::try_asso_value, Search::change_some_asso_value):
759         Remove declarations.
760         (Search::less_collisions, Search::collision_prior_to): New declarations.
761         (Search::_fewest_collisions, Search::_union_set, Search::_num_done):
762         Remove fields.
763         * src/search.cc (Search::prepare_asso_values): Don't initialize
764         _union_set.
765         (Search::try_asso_value, Search::change_some_asso_value): Remove
766         methods.
767         (Search::less_collisions, Search::collision_prior_to): New methods.
768         (StackEntry): New class.
769         (Search::find_asso_values): Reorganized to use pseudo-recursion.
770         (Search::~Search): Don't free _union_set.
771
772         * src/search.h (Search::find_good_asso_values): New declaration.
773         * src/search.cc: Add comments about the basic structure of the
774         algorithm.
775         (Search::find_positions): Move the option[POSITIONS] test to here.
776         (Search::find_good_asso_values): New method, extracted from
777         Search::optimize.
778         (Search::optimize): Remove option[POSITIONS] test. Call
779         find_good_asso_values.
780
781 2002-11-17  Bruno Haible  <bruno@clisp.org>
782
783         * src/options.cc (Options::parse_options): Include copyright notice
784         and authors in --version output.
785
786         Avoid artificial duplicates.
787         * src/keyword.h (KeywordExt::init_selchars_tuple): New declaration.
788         (KeywordExt::init_selchars_multiset): Renamed from
789         KeywordExt::init_selchars.
790         (KeywordExt::init_selchars_low): New declaration.
791         * src/keyword.cc (KeywordExt::init_selchars_low): Renamed from
792         KeywordExt::init_selchars. Add alpha_inc argument. Remove sorting.
793         (KeywordExt::init_selchars_tuple): New method.
794         (KeywordExt::init_selchars_multiset): New method, replaces
795         KeywordExt::init_selchars.
796         * src/search.h (Search::init_selchars_tuple): Renamed from
797         Search::init_selchars.
798         (Search::count_duplicates_tuple): Renamed from Search::count_duplicates.
799         (Search::init_selchars_multiset, Search::count_duplicates_multiset,
800         Search::find_alpha_inc): New declarations.
801         (Search::_alpha_inc): New field.
802         (Search::_alpha_size, Search::_occurrences, Search::_asso_values,
803         Search::_determined): Make non-const.
804         * src/search.cc (Search::Search): Don't initialize _key_positions,
805         _alpha_size, _occurrences, _asso_values, _determined here.
806         (Search::init_selchars_tuple): Renamed from Search::init_selchars.
807         (Search::count_duplicates_tuple): Renamed from Search::count_duplicates.
808         (Search::find_positions): Update.
809         (Search::init_selchars_multiset, Search::count_duplicates_multiset,
810         Search::find_alpha_inc): New methods.
811         (Search::prepare): Move preprepare, find_positions calls away.
812         Initialize _alpha_size, _occurrences, _asso_values, _determined here.
813         (Search::optimize): Call preprepare, find_positions here. Initialize
814         _key_positions here.
815         (Search::~Search): Deallocate _alpha_inc.
816         * src/output.cc (Output::Output): Add alpha_inc argument.
817         (Output::output_hash_function): Use _alpha_inc.
818         * src/output.h (Output::Output): Add alpha_inc argument.
819         (Output::_alpha_inc): New field.
820         * src/main.cc (main): Pass _alpha_inc from Search to Output.
821         * tests/chill.exp: Update.
822         * doc/gperf.texi (Algorithmic Details): Remove description of
823         artificial duplicates.
824
825         * src/keyword.h (KeywordExt::_selchars): Change type to
826         'const unsigned int *'.
827         * src/keyword.cc (sort_char_set): Change argument type to
828         'unsigned int *'.
829         (KeywordExt::init_selchars): Update.
830         * src/search.h (Search::sort_by_occurrence): Change argument type to
831         'unsigned int *'.
832         (Search::try_asso_value): Change argument type to 'unsigned int'.
833         (Search::_union_set): Change type to 'unsigned int *'.
834         * src/search.cc (Search::prepare, Search::compute_occurrence,
835         Search::set_determined, Search::already_determined,
836         Search::prepare_asso_values, Search::compute_hash): Update.
837         (compute_disjoint_union): Change argument types to 'unsigned int *'.
838         (Search::sort_by_occurrence): Likewise.
839         (Search::try_asso_value): Change argument type to 'unsigned int'.
840         (Search::change_some_asso_value, Search::~Search): Update.
841         * src/hash-table.cc (Hash_Table::~Hash_Table, Hash_Table::equal,
842         Hash_Table::insert): Update.
843
844         * src/positions.h: New file, extracted from options.h.
845         * src/positions.icc: New file, extracted from options.icc.
846         * src/positions.cc: New file, extracted from options.cc.
847         * src/options.h: Include positions.h. Move classes Positions and
848         PositionsIterator away.
849         * src/options.icc: Move classes Positions and PositionsIterator away.
850         * src/options.cc: Move class Positions away.
851         * src/keyword.cc: Include positions.h instead of options.h.
852         * src/output.h: Include positions.h instead of options.h.
853         * src/search.h: Include positions.h instead of options.h.
854         * src/Makefile.in (OBJECTS): Add positions.o.
855         (POSITIONS_H): New variable.
856         (OPTIONS_H, SEARCH_H, OUTPUT_H, keyword.o): Use it.
857         (positions.o): New rule.
858
859         * src/options.h (POSITIONS): New enum value.
860         (Positions::Positions): New copy constructor.
861         (Positions::operator=, Positions::contains, Position::add,
862         Positions::remove, Positions::print): New method declaration.
863         (Options::get_max_keysig_size): Remove method.
864         * src/options.icc (Positions::Positions): New copy constructor.
865         (Positions::operator=): New method.
866         (Options::get_max_keysig_size): Remove method.
867         * src/options.cc (Options::Options): Initialize _key_positions
868         trivially.
869         (Options::parse_options): Option -k sets POSITIONS.
870         (Positions::contains, Positions::add, Positions::remove,
871         Positions::print): New methods.
872         * src/hash-table.cc (Hash_Table::~Hash_Table): Compute the field
873         width explicitly, instead of using Options::get_max_keysig_size.
874         * src/keyword.h (KeywordExt::init_selchars): Add arguments
875         use_all_chars, positions.
876         (KeywordExt::delete_selchars): New declaration.
877         * src/keyword.cc (KeywordExt::init_selchars): Add arguments
878         use_all_chars, positions. Remove error message if there are no key
879         positions.
880         (KeywordExt::delete_selchars): New method.
881         * src/search.h: Include options.h.
882         (Search::preprepare, Search::init_selchars, Search::delete_selchars,
883         Search::count_duplicates, Search::find_positions): New declarations.
884         (Search::_key_positions): New field.
885         * src/search.cc (Search::Search): Initialize _key_positions.
886         (Search::preprepare, Search::init_selchars, Search::delete_selchars,
887         Search::count_duplicates, Search::find_positions): New functions.
888         (Search::prepare): Call preprepare and find_positions. Tweak error
889         message.
890         (Search::get_max_keysig_size): Use _key_positions instead of
891         option.get_key_positions().
892         (Search::optimize): Tweak error message.
893         * src/output.h: Include options.h.
894         (Output::Output): Add Positions argument.
895         (Output::_key_positions): New field.
896         * src/output.cc (Output::Output): Add Positions argument.
897         (Output::output_hash_function): Omit the table if there are no
898         positions at all. Use _key_positions instead of
899         option.get_key_positions().
900         (Output::output): Output the computed positions as a comment.
901         * src/main.cc (main): Pass the Positions from Searcher to Output.
902         * src/Makefile.in (SEARCH_H, OUTPUT_H): Include OPTIONS_H.
903         * tests/Makefile.in (check-test): Pass key positions explicitly.
904         * tests/gpc.exp: Update.
905         * tests/test-4.exp: Update.
906         * doc/gperf.texi (Algorithmic Details): Mention that -k is not needed
907         usually.
908
909 2002-11-16  Bruno Haible  <bruno@clisp.org>
910
911         * src/options.h (Options::get_slot_name): Renamed from
912         Options::get_key_name.
913         (Options::set, Options::set_language, Options::set_total_switches,
914         Options::set_function_name, Options::set_slot_name,
915         Options::set_class_name, Options::set_hash_name,
916         Options::set_wordlist_name, Options::set_delimiters): New method
917         declarations.
918         (Options::_language): New field.
919         (Options::_slot_name): Renamed from Options::_key_name.
920         * src/options.icc (Options::set): New method.
921         (Options::get_slot_name): Renamed from Options::get_key_name.
922         * src/options.cc (DEFAULT_FUNCTION_NAME): Renamed from DEFAULT_NAME.
923         (DEFAULT_SLOT_NAME): Renamed from DEFAULT_NAME.
924         (Options::Options): Initialize _language. Update.
925         (Options::~Options): Update.
926         (Options::set_language, Options::set_total_switches,
927         Options::set_function_name, Options::set_slot_name,
928         Options::set_class_name, Options::set_hash_name,
929         Options::set_wordlist_name, Options::set_delimiters): New methods.
930         (Options::parse_options): Call set_language. Update.
931         * src/input.cc (is_declaration, is_declaration_with_arg,
932         is_define_declaration): New functions.
933         (Input::read_input): Accept %DECL declarations.
934         * src/output.cc (Output::output_lookup_function_body): Update.
935         * doc/gperf.texi (Declarations): Add new subnodes.
936         (User-supplied Struct, Gperf Declarations, C Code Inclusion): New
937         nodes.
938         (Keywords, Output Format, Binary Strings, Options): Mention %
939         declarations as being equivalent to the command line options.
940
941         * src/options.cc (Options::long_usage): Rename options -H, -N, -l, -G.
942         (long_options): Add --hash-function-name, --lookup-function-name,
943         --compare-lengths.
944         * doc/gperf.texi (Output Details): Rename options -H, -N, -l, -G.
945         * tests/test-6.exp: Update.
946
947         * src/options.cc (DEFAULT_DELIMITERS): Remove newline.
948         * src/options.cc (Options::long_usage): Change default --delimiters.
949         * doc/gperf.texi (Input Details): Likewise.
950         * tests/test-6.exp: Update.
951
952         * doc/gperf.texi: Move description of option -l from section
953         Algorithmic Details to section Output Details.
954         * src/options.cc (Options::long_usage): Likewise.
955         * tests/test-6.exp: Update.
956
957 2002-11-12  Bruno Haible  <bruno@clisp.org>
958
959         * src/options.h (Output::get_output_file_name): New method.
960         (Output::_output_file_name): New field.
961         * src/options.icc (Options::get_output_file_name): New method.
962         * src/options.cc (Options::long_usage): Document option --output-file.
963         (Options::Options): Initialize _output_file_name.
964         (long_options): Add --output-file.
965         (Options::parse_options): Handle it.
966         * src/main.cc (main): Open the output file if given by name.
967         * doc/gperf.texi (Output File): New section.
968         * tests/test-6.exp: Update.
969
970 2002-11-10  Bruno Haible  <bruno@clisp.org>
971
972         * src/input.cc (pretty_input_file_name): New function.
973         (read_input): Use it in all error and warning messages.
974
975         * src/keyword.h (Keyword::_lineno): New field.
976         * src/input.h (Input::_struct_decl_lineno): New field.
977         * src/input.cc (Input::read_input): Set _struct_decl_lineno. Fill
978         each keyword's _lineno field.
979         * src/main.cc (main): Pass _struct_decl_lineno from Input to Output.
980         * src/output.h (Output::Output) Add struct_decl_lineno argument.
981         (Output::_struct_decl_lineno): New field.
982         * src/output.cc (Output::Output) Add struct_decl_lineno argument.
983         (output_keyword_entry): Emit #line directive before table entry.
984         (Output::output): Emit #line directive before _struct_decl.
985
986         Fix memory leaks.
987         * src/keyword.h (empty_string): New declaration.
988         * src/keyword.cc (empty_string): New variable.
989         * src/input.h (Input::_input): Make public.
990         (Input::_input_end): New field.
991         * src/input.cc (read_input): When removing leading whitespace from
992         struct_decl, reallocate it. For rest, use empty_string instead of "".
993         Set _input_end.
994         (Input::~Input): Delete _struct_decl, _struct_tag, _return_type.
995         * src/search.cc (Search::prepare): When removing an element from
996         the keyword list, delete the list node.
997         (Search::~Search): Delete _occurrences, _asso_values.
998         * src/main.cc (main): Between Search::~Search and Input::~Input,
999         destroy the keyword list.
1000
1001         Rewrite the input routines.
1002         * src/input.h: Don't include read-line.h.
1003         (Input): Don't inherit from class Read_Line.
1004         (Input::read_keys, Input::strcspn, Input::set_output_types,
1005         Input::get_array_type, Input::save_include_src,
1006         Input::get_special_input): Remove declarations.
1007         (Input::read_input): New declaration.
1008         (Input::_struct_decl): Renamed from Input::_array_type.
1009         (Input::_verbatim_declarations): Renamed from Input::_include_src.
1010         (Input::_verbatim_code): Replaces Input::_additional_code.
1011         * src/input.cc: Completely rewritten.
1012         * src/output.h (Output::Output): Update the verbatim_* arguments.
1013         (Output::_struct_decl): Renamed from Output::_array_type.
1014         (Output::_verbatim_declarations): Renamed from Output::_include_src.
1015         (Output::_verbatim_code): Replaces Output::_additional_code.
1016         * src/output.cc (Output::Output): Update the verbatim_* arguments.
1017         (Output::output): Output the verbatim_* code pieces with #line.
1018         * src/main.cc (main): Call Input::read_input instead of
1019         Input::read_keys. Update Output::Output arguments.
1020         * src/read-line.h: Remove file.
1021         * src/read-line.cc, src/read-line.icc: Remove files.
1022         * src/Makefile.in (OBJECTS): Remove read-line.o.
1023         (READ_LINE_H): Remove variable.
1024         (INPUT_H): Update.
1025         (read-line.o): Remove rule.
1026         * doc/gperf.texi (Declarations): Correct the example.
1027         (Keywords): Mention that lines starting with % are forbidden here.
1028         * tests/c-parse.exp: Update.
1029         * tests/cplusplus.exp: Update.
1030         * tests/gpc.exp: Update.
1031         * tests/java.exp: Update.
1032         * tests/objc.exp: Update.
1033         * tests/test-4.exp: Update.
1034
1035         * src/options.h (Options::get_input_file_name): New declaration.
1036         (Options::_input_file_name): New field.
1037         * src/options.icc (Options::get_input_file_name): New method.
1038         * src/options.cc (Options::Options): Initialize _input_file_name.
1039         (Options::parse_options): Don't open input file, only store it in
1040         _input_file_name.
1041         * src/main.cc (main): Open input file here.
1042         Print an error message upon write error on the output file.
1043
1044         Upgrade to autoconf-2.52.
1045         * configure.in: Use AC_CONFIG_SUBDIRS instead of AC_OUTPUT_SUBDIRS.
1046         * Makefile.devel (configure, lib/configure, src/configure,
1047         tests/configure, doc/configure): Use autoconf-2.52.
1048
1049 2002-11-09  Bruno Haible  <bruno@clisp.org>
1050
1051         * doc/gperf.texi: Talk about "bytes" instead of "characters". Talk
1052         about "keywords", not "keys". Talk about "input file", not "keyfile".
1053         (@menu): Fix a menu entry.
1054         (Contributors): Don't mention cperf.
1055         (Motivation): Fix an off-by-one error in the definition of "minimal".
1056         Mention GNU Java. Recommend http URL instead of anonymous ftp.
1057         (Search Structures): Mention GNU Java.
1058         (Output Format): Drop reference to node 'Implementation'.
1059         (Output Details): Talk about "slot-name" instead of "key name".
1060         (Algorithmic Details): Talk about "selected byte positons", not
1061         "key positions". Upper limit is now 255. Explain a third reason
1062         why duplicates can occur. Describe negative effects of
1063         --occurrence-sort.
1064         (Implementation): Remove chapter.
1065
1066 2002-11-07  Bruno Haible  <bruno@clisp.org>
1067
1068         * src/bool-array.cc (Bool_Array::~Bool_Array): Free _storage_array.
1069         * src/search.cc (Search::~Search): Free _union_set, _determined.
1070
1071         * tests/Makefile.in (check-test): Don't redirect stderr.
1072
1073 2002-11-05  Bruno Haible  <bruno@clisp.org>
1074
1075         * src/keyword-list.h (mergesort_list): New declarations.
1076         * src/keyword-list.cc (Keyword_Comparison): New type.
1077         (merge, mergesort_list): New functions, moved here from search.cc.
1078         * src/search.h (Search::merge, Search::merge_sort): Remove methods.
1079         (Search::_occurrence_sort, Search::_hash_sort): Remove fields.
1080         * src/search.cc (Search::merge, Search::merge_sort): Remove methods.
1081         (greater_by_occurrence, less_by_hash_value): New functions.
1082         (Search::reorder, Search::sort): Use mergesort_list.
1083
1084 2002-11-04  Bruno Haible  <bruno@clisp.org>
1085
1086         * src/options.h (Options::_asso_iterations): New field.
1087         (Options::get_asso_iterations): New method declaration.
1088         * src/options.icc (Options::get_asso_iterations): New method.
1089         * src/options.cc (Options::short_usage): Mention j<jump> and m<num>.
1090         (Options::long_usage): Document option -m.
1091         (Options::Options): Initialize _asso_iterations.
1092         (Options::~Options): Print _asso_iterations too.
1093         (long_options): Add --multiple-iterations.
1094         (Options::parse_options): Handle option -m.
1095         * src/keyword-list.h (copy_list, delete_list): New declarations.
1096         * src/keyword-list.cc (copy_list, delete_list): New functions.
1097         * src/search.h (Search::_initial_asso_value, Search::_jump): New fields.
1098         * src/search.cc (Search::prepare_asso_values): Initialize
1099         _initial_asso_value and _jump here.
1100         (Search::init_asso_values): Use _initial_asso_value.
1101         (Search::try_asso_value): Use _jump.
1102         (Search::optimize): If option -m was given, iterate over different
1103         values for _initial_asso_value and _jump.
1104         * doc/gperf.texi (Algorithmic Details): Document option -m.
1105         * tests/test-6.exp: Update.
1106
1107 2002-11-03  Bruno Haible  <bruno@clisp.org>
1108
1109         Bug fix: When option -j 0 was used without option -r, the output was
1110         not random.
1111         * src/search.h (Search::prepare_asso_values): New method declaration.
1112         * src/search.cc (Search::prepare_asso_values): New method, extracted
1113         from Search::init_asso_values. Call srand also when "-j 0" was given.
1114         (Search::optimize): Call prepare_asso_values().
1115
1116         * src/hash-table.h (Hash_Table::_ignore_length, Hash_Table::equal):
1117         Declare as const.
1118         * src/hash-table.cc (Hash_Table::equal): Declare as const.
1119         * src/input.h (Input::_factory): Declare as const.
1120         * src/keyword-list.h (Keyword_List::first, KeywordExt_List::first):
1121         Declare as const.
1122         * src/keyword-list.icc (Keyword_List::first, KeywordExt_List::first):
1123         Declare as const.
1124         * src/output.h (Output::num_hash_values, Output::output_constants,
1125         Output::output_hash_function, Output::output_keylength_table,
1126         Output::output_keyword_table, Output::output_lookup_array,
1127         Output::output_lookup_tables, Output::output_lookup_function_body,
1128         Output::output_lookup_function, Output::_array_type,
1129         Output::_additional_code, Output::_include_src, Output::_total_keys,
1130         Output::_total_duplicates, Output::_max_key_len, Output::_min_key_len):
1131         Declare as const.
1132         * src/output.cc (Output::num_hash_values, Output::output_constants,
1133         Output::output_hash_function, Output::output_keylength_table,
1134         Output::output_keyword_table, Output::output_lookup_array,
1135         Output::output_lookup_tables, Output::output_lookup_function_body,
1136         Output::output_lookup_function): Declare as const.
1137         * src/search.h (Search::merge, Search::merge_sort,
1138         Search::compute_occurrence, Search::already_determined,
1139         Search::keyword_list_length, Search::max_key_length,
1140         Search::get_max_keysig_size, Search::compute_hash,
1141         Search::sort_by_occurrence): Declare as const.
1142         * src/search.cc (Search::merge, Search::merge_sort,
1143         Search::compute_occurrence, Search::already_determined,
1144         Search::keyword_list_length, Search::max_key_length,
1145         Search::get_max_keysig_size, Search::compute_hash,
1146         Search::sort_by_occurrence): Declare as const.
1147
1148         * src/output.cc (Output::output): Set char_to_index to a cast in all
1149         cases. Avoids gcc warnings on the generated code.
1150
1151         * src/output.cc (Output_Enum): Prepend an underscore to field names.
1152         (Output_Expr1): Likewise.
1153         (Output::output_hash_function): Simplify the special case for "-k 1,$".
1154
1155         * src/search.h (Search::init_asso_values, Search::find_asso_values):
1156         New declarations.
1157         (Search::try_asso_value): Renamed from Search::affects_prev.
1158         (Search::change_some_asso_value): Renamed from Search::change.
1159         (Search::set_asso_max, Search::get_asso_max): Remove methods.
1160         (Search::_union_set): New field.
1161         * src/search.cc (Search::init_asso_values): New method, extracted
1162         from Search::optimize.
1163         (Search::try_asso_value): Renamed from Search::affects_prev. Take the
1164         iteration count as argument.
1165         (Search::change_some_asso_value): Renamed from Search::change. Don't
1166         make union_set static. Don't increment _fewest_collisions here.
1167         (Search::find_asso_values): New method, extracted from
1168         Search::optimize.
1169         (Search::optimize); Update.
1170
1171         * src/search.h (Search::compute_hash): Renamed from Search::hash.
1172         (Search::compute_disjoint_union): Remove declaration.
1173         (Search::sort_by_occurrence): Renamed from Search::sort_set.
1174         * src/search.cc (Search::compute_hash): Renamed from Search::hash.
1175         (compute_disjoint_union): Renamed from Search::compute_disjoint_union.
1176         (Search::sort_by_occurrence): Renamed from Search::sort_set.
1177         (Search::change): Simplify loop.
1178
1179         * src/search.h (Search::clear_determined): New declaration.
1180         * src/search.cc (Search::clear_determined): New method.
1181         (Search::already_determined): Optimize.
1182         (Search::reorder): Even when the next keyword after the current one
1183         is completely determined, move all determined keywords after the
1184         current one.
1185
1186         Compute the occurrences after removal of duplicates, not before.
1187         * src/keyword.h (KeywordExt::init_selchars): Remove occurrences
1188         argument.
1189         * src/keyword.cc (KeywordExt::init_selchars): Likewise.
1190         * src/search.cc (Search::prepare): Reorder the code. Compute the
1191         occurrences after removal of duplicates.
1192         (Search::merge_sort): Optimize the loop.
1193         (Search::compute_occurrence): Renamed from Search::get_occurrence.
1194         * src/search.h (Search::compute_occurrence): Renamed from
1195         Search::get_occurrence.
1196         * tests/chill.exp: Regenerated.
1197
1198         Bug fix: The hash table could fail to detect duplicates, between
1199         keywords of different length, when option -n (option[NOLENGTH]) was
1200         given.
1201         * src/hash-table.h (Hash_Table::Hash_Table): Pass table size, not
1202         vector and vector size as arguments.
1203         (Hash_Table::_log_size): New field.
1204         (Hash_Table::equal): New declaration.
1205         * src/hash-table.cc (size_factor): New variable.
1206         (Hash_Table::Hash_Table): Pass table size, not vector and vector size
1207         as arguments. Allocate the vector here.
1208         (Hash_Table::~Hash_Table): Deallocate the vector here.
1209         (Hash_Table::equal): New function.
1210         (Hash_Table::insert): Use it. Don't use item->_allchars_length for the
1211         increment if _ignore_length is true.
1212         * src/search.cc (TABLE_MULTIPLE): Remove variable.
1213         (Search::prepare): Update.
1214
1215 2002-11-02  Bruno Haible  <bruno@clisp.org>
1216
1217         Provide documentation also in PDF format.
1218         * doc/Makefile.in (pdfdir, TEXI2PDF): New variables.
1219         (all): Depend on pdf.
1220         (pdf, gperf.pdf): New rules.
1221         (maintainer-clean): Remove the PDF file.
1222
1223         * src/keyword-list.icc: New file, extracted from keyword-list.h.
1224         * src/keyword-list.h: Include keyword-list.icc. Move inline methods
1225         to there.
1226         * src/keyword-list.cc: Include keyword-list.icc.
1227         * src/Makefile.in (KEYWORD_LIST_H): Add keyword-list.icc.
1228
1229         * lib/hashpjw.h (hashpjw): Change argument type to 'unsigned char *'.
1230         * lib/hash.cc (hashpjw): Likewise.
1231         * src/keyword.icc: New file.
1232         * src/keyword.h: Include keyword.icc.
1233         (KeywordExt::_selchars): Change type to 'unsigned char *'.
1234         * src/keyword.cc: Include keyword.icc.
1235         (Keyword::Keyword, KeywordExt::KeywordExt): Move to keyword.icc.
1236         (sort_char_set): Change argument type to 'unsigned char *'.
1237         (KeywordExt::init_selchars): Update.
1238         * src/search.h (Search::compute_disjoint_union): Change argument types
1239         to 'unsigned char *'.
1240         (Search::sort_set): Likewise.
1241         (Search::affects_prev): Change argument type to 'unsigned char'.
1242         * src/search.cc (Search::prepare): Initialize _duplicate_link here.
1243         (Search::get_occurrence, Search::set_determined,
1244         Search::already_determined, Search::hash): Update.
1245         (Search::compute_disjoint_union): Change argument types to
1246         'unsigned char *'.
1247         (Search::sort_set): Likewise.
1248         (Search::affects_prev): Change argument type to 'unsigned char'.
1249         (Search::change): Update.
1250         * src/Makefile.in (KEYWORD_H): Add keyword.icc.
1251
1252         * src/options.cc (Options::parse_options): Fix error message.
1253
1254         * src/read-line.h (Read_Line::Read_Line): Make FILE* argument
1255         mandatory. Move body to read-line.icc.
1256         * src/read-line.icc (Read_Line::Read_Line): New constructor.
1257         * src/input.h (Input::Input): Add FILE* argument.
1258         * src/input.cc (Input::Input): Likewise.
1259         * src/main.cc (main): Pass stdin to Input constructor.
1260
1261         * src/options.h (DEFAULTCHARS): Remove.
1262         (Positions::MAX_KEY_POS): Set to 255.
1263         (Positions::_positions): Increase array size.
1264         (PositionIterator::EOS): Set to -1.
1265         (PositionIterator::_index): Change type to 'unsigned int'.
1266         * src/options.icc (Positions::Positions): Don't store
1267         PositionIterator::EOS.
1268         (PositionIterator::next): Produce PositionIterator::EOS here.
1269         * src/options.cc (Options::long_usage): Use MAX_KEY_POS, not
1270         MAX_KEY_POS-1.
1271         (PositionStringParser): Rename field _size to _in_range. Rename
1272         field _curr_value to _range_curr_value. Rename field _upper_bound
1273         to _range_upper_bound.
1274         (PositionStringParser::nextPosition): Comments.
1275         (Options::Options): Update.
1276         (Options::~Options): Update.
1277         (long_options): Use NULL, not 0.
1278         (Options::parse_options): Set BAD_VALUE to -2; -1 is now EOS. Bug fix:
1279         Check against array overflow when more than MAX_KEY_POS positions are
1280         given. Don't store PositionIterator::EOS.
1281         Check against extra arguments before opening the input file.
1282         * src/output.cc (Output::output_hash_function): Change test which
1283         was for option[DEFAULTCHARS].
1284         * tests/test-6.exp: Update.
1285
1286         * src/options.h (Options::get_delimiters): Renamed from
1287         Options::get_delimiter.
1288         * src/options.icc (Options::get_delimiters): Renamed from
1289         Options::get_delimiter.
1290         * src/input.cc (Input::read_keys): Update.
1291
1292         Bug fix.
1293         * src/options.cc (Options::print_options): Escape backquote inside
1294         double-quoted strings.
1295
1296         Bug fix.
1297         * src/keyword.cc (KeywordExt::init_selchars): Avoid comparison with
1298         uninitialized member variable. Found with 'valgrind'.
1299
1300         * src/version.cc: Include version.h.
1301         * src/Makefile.in (OBJECTS): Reorder.
1302         (KEYWORD_H, KEYWORD_LIST_H, INPUT_H, SEARCH_H, OUTPUT_H): New
1303         variables.
1304         (HASH_TABLE_H): Update.
1305         (options.o, read-line.o, keyword.o, keyword-list.o, input.o, search.o,
1306         output.o, main.o): Update dependencies.
1307
1308         * src/vectors.h: Remove file.
1309         * src/vectors.cc: Remove file.
1310         * src/search.h: Don't include vectors.h.
1311         (Search): Don't inherit from Vectors. New fields _alpha_size,
1312         _occurrences, _asso_values.
1313         (Search::_determined, Search::get_occurrence, Search::set_determined,
1314         Search::already_determined, Search::hash, Search::sort_set): Make
1315         nonstatic.
1316         * src/search.cc (Search::Search): Initialize _alpha_size, _occurrences,
1317         _asso_values, _determined.
1318         (Search::optimize, Search::~Search): Update.
1319         * src/output.h: Don't include vectors.h.
1320         (Output): Remove field _v. New fields _alpha_size, _occurrences,
1321         _asso_values.
1322         (Output::Output): Replace Vectors* argument with alpha_size,
1323         occurrences, asso_values.
1324         * src/output.cc (Output::Output): Replace Vectors* argument with
1325         alpha_size, occurrences, asso_values.
1326         (Output::output_hash_function): Update.
1327         * src/main.cc (main): Don't set Vectors::ALPHA_SIZE.
1328         Pass _alpha_size, _occurrences, _asso_values from Search to Output.
1329         * src/keyword.h: Don't include vectors.h.
1330         * src/Makefile.in (OBJECTS): Remove vectors.o.
1331         (VECTORS_H): Remove variable.
1332         (vectors.o): Remove rule.
1333
1334         * src/search.h: New file, combines src/key-list.h, src/gen-perf.h.
1335         * src/search,cc: New file, combines src/key-list.cc, src/gen-perf.cc.
1336         * src/key-list.h: Remove file.
1337         * src/key-list.cc: Remove file.
1338         * src/gen-perf.h: Remove file.
1339         * src/gen-perf.cc: Remove file.
1340         * src/main.cc (KeywordExt_Factory): Moved here from gen-perf.cc.
1341         (main): Inline some code from gen-perf.cc.
1342         * src/keyword.h (KeywordExt::init_selchars): Take the occurrences
1343         vector as argument.
1344         * src/keyword.cc (KeywordExt::init_selchars): Take the occurrences
1345         vector as argument.
1346         * src/input.cc (Input::set_output_types): Initialize _array_type,
1347         _return_type, _struct_tag.
1348         (Input::read_keys): Initialize _additional_code.
1349         * src/Makefile.in (OBJECTS): Add search.o.
1350         Remove key-list.o, gen-perf.o.
1351         (KEY_LIST_H, GEN_PERF_H): Remove variables.
1352         (gen-perf.o, key-list.o): Remove rules.
1353         (search.o): New rule.
1354
1355         * *, */*: Update copyright notice to GPL version 2.
1356
1357         * src/keyword-list.h (Keyword_List): New class.
1358         (KeywordExt_List): Inherit from it.
1359         * src/keyword-list.cc (Keyword_List::Keyword_List): New constructor.
1360         (KeywordExt_List::KeywordExt_List): Update.
1361         * src/input.h (Input::Input): Add Keyword_Factory argument.
1362         (Input::_factory): New field.
1363         (Input::_head): Change type to Keyword_List*.
1364         (Input::parse_line): New declaration.
1365         * src/input.cc (Input::Input): New constructor.
1366         (Input::parse_line): Renamed from parse_line. Use the _factory.
1367         (Input::read_keys): Update.
1368         * src/key-list.cc (KeywordExt_Factory): New class.
1369         (Key_List::read_keys): Pass a KeywordExt_Factory as Input constructor
1370         argument.
1371
1372         Avoid g++ -Wold-style-cast warnings.
1373         * src/bool-array.icc: Use new-style casts.
1374         * src/gen-perf.cc: Likewise.
1375         * src/input.cc: Likewise.
1376         * src/key-list.cc: Likewise.
1377         * src/keyword.cc: Likewise.
1378         * src/options.cc: Likewise.
1379         * src/output.cc: Likewise.
1380         * src/hash-table.cc: Likewise. Remove (char *) cast in memset argument.
1381
1382         * src/keyword-list.h (KeywordExt_List): Don't inherit from KeywordExt.
1383         (KeywordExt_List::KeywordExt_List): Take a KeywordExt* as argument.
1384         (KeywordExt_List::_car): New field.
1385         (KeywordExt_List::first): Use it.
1386         * src/keyword-list.cc (KeywordExt_List::KeywordExt_List): Take a
1387         KeywordExt* as argument.
1388         * src/input.cc (parse_line): Create the KeywordExt separately.
1389
1390         Start using bool.
1391         * src/bool-array.h (Bool_Array::set_bit): Change return type to bool.
1392         * src/bool-array.icc (Bool_Array::set_bit): Likewise.
1393         * src/gen-perf.h (Gen_Perf::affects_prev): Likewise.
1394         * src/gen-perf.cc (Gen_Perf::affects_prev): Likewise.
1395         * src/hash-table.h (Hash_Table::_ignore_length): Change type to bool.
1396         (Hash_Table::Hash_Table): Change 3rd argument type to bool.
1397         * src/hash-table.cc (Hash_Table::Hash_Table): Likewise.
1398         * src/input.h (Input::_additional_code): Change type to bool.
1399         * src/input.cc (Input::read_keys): Update.
1400         * src/key-list.h (Key_List::_occurrence_sort, Key_List::_hash_sort,
1401         Key_List::_additional_code): Change type to bool.
1402         (Key_List::_determined): Change element type to bool.
1403         (Key_List::already_determined): Change return type to bool.
1404         * src/key-list.cc (Key_List::_determined): Change element type to bool.
1405         (Key_List::set_determined): Update.
1406         (Key_List::already_determined): Change return type to bool.
1407         (Key_List::reorder, Key_List::sort, Key_List::Key_List): Update.
1408         * src/options.h (Positions::sort): Change return type to bool.
1409         (Options::operator[]): Likewise.
1410         * src/options.icc (Positions::sort): Change return type to bool.
1411         (Options::operator[]): Likewise.
1412         * src/output.h (Output::Output): Change 5th argument type to bool.
1413         (Output::_additional_code): Change type to bool.
1414         * src/output.cc (Output::Output): Change 5th argument type to bool.
1415
1416 2002-10-16  Bruno Haible  <bruno@clisp.org>
1417
1418         * src/*.h: Align all member names at column 24.
1419
1420 2002-10-15  Bruno Haible  <bruno@clisp.org>
1421
1422         * src/input.h: New file.
1423         * src/input.cc: New file, extracted from key-list.cc.
1424         * src/key-list.h (Key_List): Don't inherit from Read_Line.
1425         (Key_List::get_special_input,
1426         Key_List::save_include_src, Key_List::get_array_type,
1427         Key_List::strcspn, Key_List::set_output_types): Remove methods.
1428         * src/key-list.cc (Key_List::get_special_input,
1429         Key_List::save_include_src, Key_List::get_array_type,
1430         Key_List::strcspn, Key_List::set_output_types, parse_line): Move to
1431         src/input.cc.
1432         (Key_List::read_keys): Use Input::read_keys.
1433         (Key_List::Key_List): Update.
1434         * src/gen-perf.cc: Update.
1435         * src/Makefile.in (OBJECTS): Add input.o.
1436         (input.o): New rule.
1437
1438 2002-10-14  Bruno Haible  <bruno@clisp.org>
1439
1440         * src/options.cc: Don't include "vector.h".
1441         (Options::parse_options): Don't initialize Vectors::ALPHA_SIZE here.
1442         * src/vectors.cc (Vectors::ALPHA_SIZE): Don't initialize here.
1443         * src/gen-perf.cc (Gen_Perf::Gen_Perf): Initialize Vectors::ALPHA_SIZE.
1444
1445         * src/options.h (Positions): New class.
1446         (PositionIterator): New class.
1447         (Options::parse_options): Renamed from Options::operator().
1448         (Options::get_asso_max, Options::set_asso_max): Move to class Key_List.
1449         (Options::reset, Options::get): Remove, replaced by class
1450         PositionIterator.
1451         (Options::get_initial_asso_value): Renamed from Options::initial_value.
1452         (Options::key_sort): Remove, replaced by Positions::sort.
1453         (Options): Make all fields and methods non-static.
1454         * src/options.icc (Positions::Positions, Positions::operator[],
1455         Positions::get_size, Positions::pointer, Positions::set_size,
1456         Positions::sort, PositionIterator::PositionIterator,
1457         PositionIterator::next): New methods.
1458         (Options::get_initial_asso_value): Renamed from Options::initial_value.
1459         (Options::get_size_multiple): New method.
1460         (Options::get_key_positions): New method.
1461         (Options::get_max_keysig_size): Implement using _key_positions.
1462         * src/options.cc (Options::long_usage): Split big string into small
1463         pieces.
1464         (PositionStringParser): Prefix field names with _.
1465         (Options::Options): Update.
1466         (Options::~Options): Fix explanation of of _size_multiple. Don't print
1467         _key_positions if it is effectively ignored.
1468         (Options::parse_options): Renamed from Options::operator(). Update.
1469         * src/key-list.h (Key_List): New field _size. New methods get_asso_max,
1470         set_asso_max, get_max_keysig_size.
1471         * src/key-list.cc (Key_List::read_keys): Don't make side effects on
1472         options.
1473         (Key_List::dump): Use Key_List::get_max_keysig_size() instead of
1474         Options::get_max_keysig_size().
1475         (Key_List::get_max_keysig_size): New function.
1476         * src/hash-table.cc (Hash_Table::~Hash_Table): Compute the field
1477         width on the fly if option[ALLCHARS].
1478         * src/gen-perf.cc (Gen_Perf::Gen_Perf): Update,
1479         Use Options::get_size_multiple() instead of Options::get_asso_max().
1480         Use Key_List::get_asso_max() instead of Options::get_asso_max(). Use
1481         Key_List::get_max_keysig_size() instead of
1482         Options::get_max_keysig_size().
1483         (Gen_Perf::affects_prev): Likewise.
1484         (Gen_Perf::change): Likewise.
1485         * src/keyword.cc: Update.
1486         * src/main.cc: Update.
1487         * src/output.cc: Update.
1488         * tests/test-6.exp: Update.
1489
1490 2002-10-13  Bruno Haible  <bruno@clisp.org>
1491
1492         * src/bool-array.*: Some polishing.
1493
1494         * src/options.h (Options::operator=, Options::operator!=): Remove
1495         unused methods.
1496         * src/options.icc (Options::operator=, Options::operator!=): Remove.
1497
1498         * src/*.h: Prefix all field names with _.
1499         * src/*.cc, src/*.icc: Update.
1500
1501         * src/*: Simplify declarations of functions without arguments.
1502
1503 2002-10-04  Bruno Haible  <bruno@clisp.org>
1504
1505         * src/output.h: New file, extracted from key-list.h.
1506         * src/output.cc: New file, extracted from key-list.cc.
1507         * src/key-list.h (Key_List): Make some fields protected. Move output
1508         routines to src/output.h.
1509         * src/key-list.cc: Move output routines to src/output.cc.
1510         * src/gen-perf.cc (Gen_Perf::doit_all): Use class Output.
1511         * src/Makefile.in (OBJECTS): Add output.o.
1512         (output.o): New rule.
1513
1514 2002-10-03  Bruno Haible  <bruno@clisp.org>
1515
1516         * src/iterator.h: Remove file.
1517         * src/iterator.cc: Remove file.
1518         * src/options.cc: (PositionStringParser): New class, taken from old
1519         iterator.cc.
1520         * src/Makefile.in (OBJECTS): Remove iterator.o.
1521         (ITERATOR_H): Remove variable.
1522         (iterator.o): Remove rule.
1523
1524         * src/keyword-list.h: New file.
1525         * src/keyword-list.cc: New file.
1526         * src/list-node.h: Remove file.
1527         * src/list-node.cc: Remove file.
1528         * src/keyword.h (KeywordExt::init_selchars): New declaration.
1529         * src/keyword.cc (sort_char_set, KeywordExt::init_selchars): New, from
1530         old list-node.cc.
1531         * src/gen-perf.cc: Replace List_Node by KeywordExt or KeywordExt_List,
1532         as appropriate.
1533         * src/hash-table.h: Likewise.
1534         * src/key-list.h: Likewise.
1535         * src/key-list.cc: Likewise.
1536         * src/Makefile.in (OBJECTS): Remove list-node.o, add keyword-list.o.
1537         (LIST_NODE_H): Remove macro.
1538         (list-node.o): Remove rule.
1539         (keyword-list.o): New rule.
1540
1541         * src/keyword.h (KeywordExt): New class.
1542         * src/keyword.cc (KeywordExt): New constructor.
1543         * src/list-node.h (List_Node): Inherit from KeywordExt.
1544         * src/list-node.cc: Update.
1545         * src/gen-perf.cc: Update.
1546         * src/hash-table.cc: Update.
1547         * src/key-list.cc: Update.
1548         (output_keyword_entry): Change argument type to KeywordExt*.
1549
1550         * src/keyword.h: New file.
1551         * src/keyword.cc: New file.
1552         * src/list-node.h (List_Node): Extend Keyword.
1553         * src/list-node.cc: Update.
1554         * src/gen-perf.cc: Update.
1555         * src/hash-table.cc: Update.
1556         * src/key-list.cc: Update.
1557         * src/Makefile.in (OBJECTS): Add keyword.o.
1558         (keyword.o): New rule.
1559
1560         * src/key-list.cc (Key_List::read_keys): Allocate the memory for the
1561         hash table using 'new'.
1562         (Key_List::output_lookup_array): Allocate the memory for the duplicates
1563         array using 'new'.
1564         * src/options.h (LARGE_STACK_ARRAYS): Remove definition.
1565         * src/main.cc (main): Remove setrlimit call.
1566         * src/configure.in: Don't test for unistd.h, sys/time.h,
1567         sys/resource.h, getrlimit, setrlimit.
1568
1569         * src/bool-array.h (Bool_Array): Make all members non-static.
1570         Add an argument to the constructor. Remove init(), rename reset() to
1571         clear(), rename find() to set_bit().
1572         * src/bool-array.icc: Move init() code into the constructor.
1573         Rename reset() to clear(), rename find() to set_bit().
1574         * src/gen-perf.h (Gen_Perf): Add collision_detector member.
1575         * src/gen-perf.cc: Update.
1576
1577         * src/gen-perf.h (Gen_Perf::doit_all): Renamed from
1578         Gen_Perf::operator ().
1579         * src/gen-perf.cc (Gen_Perf::doit_all): Renamed from
1580         Gen_Perf::operator ().
1581         * src/main.cc: Update.
1582
1583         * src/read-line.h (Read_Line::read_next_line): Renamed from
1584         Read_Line::get_line.
1585         * src/read-line.icc: Likewise.
1586         * src/read-line.cc: Update.
1587         * src/key-list.cc: Update.
1588
1589         * lib/getline.h: New file.
1590         * lib/getline.cc: New file.
1591         * lib/Makefile.in (OBJECTS): Add getline.o.
1592         (getline.o): New rule.
1593         * src/read-line.h (Read_Line::readln_aux): Remove declaration.
1594         * src/read-line.cc (Read_Line::readln_aux): Remove function.
1595         * src/read-line.icc (Read_Line::get_line): Use ::get_line.
1596         * src/options.h (LARGE_STACK): Remove macro.
1597
1598         * src/bool-array.h (STORAGE_TYPE): Remove type.
1599         Use 'unsigned int' instead of STORAGE_TYPE.
1600         * src/bool-array.cc: Likewise.
1601         * src/bool-array.icc: Likewise.
1602         * src/gen-perf.cc: Likewise.
1603
1604         * src/new.cc: Remove file.
1605         * src/Makefile.in (OBJECTS): Remove new.o.
1606         (new.o): Remove rule.
1607         * src/configure.in: Remove test for HAVE_THROW_DECL.
1608         * acconfig.h: Remove file.
1609
1610         * src/trace.h: Remove file.
1611         * src/trace.cc: Remove file.
1612         * src/Makefile.in (OBJECTS): Remove trace.o.
1613         (TRACE_H): Remove variable.
1614         (trace.o): Remove rule.
1615         Update all dependencies.
1616         * src/bool-array.h, src/bool-array.cc, src/bool-array.icc: Don't use T.
1617         * src/gen-perf.cc: Likewise.
1618         * src/hash-table.cc: Likewise.
1619         * src/iterator.cc: Likewise.
1620         * src/key-list.cc: Likewise.
1621         * src/list-node.cc: Likewise.
1622         * src/main.cc: Likewise.
1623         * src/new.cc: Likewise.
1624         * src/options.h, src/options.cc, src/options.icc: Likewise.
1625         * src/read-line.h, src/read-line.cc, src/read-line.icc: Likewise.
1626
1627         * tests/Makefile.in: Use gperf option -I, to avoid gcc-3.x warnings.
1628         * tests/test.c: Don't use gets(), to avoid warnings.
1629
1630 2001-08-02  Bruno Haible  <bruno@linuix.math.u-bordeaux.fr>
1631
1632         * doc/gperf.texi: Change bug report address to <bug-gnu-gperf@gnu.org>.
1633         * README: Updated.
1634
1635 2000-12-18  Bruno Haible  <bruno@linuix.math.u-bordeaux.fr>
1636
1637         * src/configure.in: Add check for rand() in libm. Needed for BeOS.
1638         * src/Makefile.in (LIBS): Use @GPERF_LIBM@ instead of hardwiring -lm.
1639
1640 2000-11-20  Bruno Haible  <bruno@linuix.math.u-bordeaux.fr>
1641
1642         * doc/help2man: Update to version 1.23.
1643
1644 2000-09-26  Bruno Haible  <bruno@linuix.math.u-bordeaux.fr>
1645
1646         * gperf-2.7.2 released.
1647
1648         * doc/gperf.texi: Add a second bug report address
1649           <gperf-bugs@lists.sourceforge.net>.
1650         * README: Updated.
1651
1652 2000-08-28  Bruno Haible  <bruno@linuix.math.u-bordeaux.fr>
1653
1654         * lib/getopt.h (struct option): Use "const" also when compiling in
1655           C++ mode. Avoids warnings from Sun CC and HP-UX aCC.
1656
1657         * doc/Makefile.in (docdir): Change from $(datadir)/doc/@PACKAGE@ to
1658           $(prefix)/doc/@PACKAGE@, following the newest GNU standards.
1659
1660 2000-08-20  Bruno Haible  <bruno@linuix.math.u-bordeaux.fr>
1661
1662         * src/version.cc: Bump version number to 2.7.2.
1663         * doc/gperf.texi: Likewise.
1664
1665         * doc/texinfo.tex: Update to post-texinfo-4.0 version. @code in the
1666           title page now chooses a larger font. The overall layout of the
1667           text is denser.
1668
1669         * AUTHORS: New file.
1670
1671         * tests/Makefile.in (all): Add check-lang-utf8 and check-lang-ucs2.
1672           (check-lang-utf8, check-lang-ucs2): New targets.
1673           (clean): Remove lu8out and lu2out.
1674         * tests/lang-utf8.gperf, tests/lang-utf8.exp: New files.
1675         * tests/lang-ucs2.gperf, tests/test2.c, tests/lang-ucs2.in,
1676           tests/lang-ucs2.exp: New files.
1677
1678         Allow the use of embedded NULs in keys.
1679         * lib/hash.h (hashpjw): Add a length argument.
1680         * lib/hash.cc (hashpjw): Likewise. Don't stop when encountering a NUL
1681           character.
1682         * src/hash-table.h (Hash_Table constructor): Add ignore_len argument.
1683           (Hash_Table::ignore_length): New field.
1684           (Hash_Table::insert): Renamed from Hash_Table::operator(). Remove
1685           ignore_length argument.
1686         * src/hash-table.cc (NIL): Remove macro.
1687           (Hash_Table constructor): Add ignore_len argument. Use it to
1688           initialize ignore_length.
1689           (Hash_Table destructor): Specify explicit length of char_set and
1690           key.
1691           (Hash_Table::insert): Renamed from Hash_Table::operator(). Remove
1692           ignore_length argument. Pass explicit length to hashpjw. Compare
1693           char_set using memcmp, not strcmp.
1694         * src/list-node.h (List_Node): Rename field length to key_length.
1695           New field char_set_length.
1696           (List_Node constructor): Accept key and rest, not the entire line.
1697         * src/list-node.cc (List_Node constructor): Accept key and rest, not
1698           the entire line. Don't NUL terminate key and char_set. Specify
1699           explicit length of key. Initialize char_set_length field.
1700         * src/key-list.cc: Include <ctype.h>.
1701           (parse_line): New function.
1702           (Key_List::read_keys): Call parse_line instead of new List_Node.
1703           Pass option[NOLENGTH] to Hash_Table constructor, not
1704           Hash_Table::insert. Specify explicit length of key and char_set.
1705           (Key_List::get_occurrence): Use explicit length of char_set.
1706           (Key_List::set_determined): Likewise.
1707           (Key_List::already_determined): Likewise.
1708           (output_string): Add length argument. Output unprintable characters
1709           using octal escape sequence.
1710           (output_keyword_entry): Use explicit length of key.
1711           (Key_List::output_lookup_array): Specify explicit length of key.
1712           (output_switch_case): Likewise.
1713           (Key_List::dump): Likewise.
1714         * src/gen-perf.h (Gen_Perf::compute_disjoint_union): Add two length
1715           arguments.
1716         * src/gen-perf.cc (Gen_Perf::compute_disjoint_union): Likewise. Don't
1717           stop when encountering NUL characters. Don't NUL terminate the
1718           result.
1719           (Gen_Perf::hash): Use explicit length of char_set.
1720           (Gen_Perf::change): Specify explicit length of key.
1721         * doc/gperf.texi: Document it.
1722
1723         * doc/help2man: New file, help2man version 1.022.
1724         * Makefile.devel (all): Add doc/gperf.1.
1725           (doc/gperf.1): New target.
1726         * doc/gperf.1: Automatically generated.
1727
1728         * mkinstalldirs: New file, from automake-1.4, grep-2.4.1, guile-1.4,
1729           libtool-1.3.3, make-3.79.1, tar-1.13.
1730         * src/Makefile.in (MKINSTALLDIRS): New variable.
1731           (install, installdirs): Use it instead of mkdir.
1732         * doc/Makefile.in (MKINSTALLDIRS): New variable.
1733           (install, installdirs): Use it instead of mkdir.
1734
1735         * INSTALL: Update.
1736
1737 2000-08-19  Bruno Haible  <bruno@linuix.math.u-bordeaux.fr>
1738
1739         * src/key-list.cc (Output_Compare_Memcmp): New class.
1740           (Key_List::output_lookup_function): When option -l is given, use
1741           memcmp instead of strcmp or strncmp.
1742
1743         * doc/gperf.texi: The bug report address is <bug-gnu-utils@gnu.org>.
1744           The download address is ftp.gnu.org. Remove mention of -a and -g
1745           options (now nops). Explain effect of -c option.
1746
1747         * doc/configure.in (PACKAGE): New variable.
1748         * doc/Makefile.in (datadir, docdir): New variables.
1749           (dvidir, htmldir): Change values.
1750           (install, installdirs): Update.
1751
1752         * src/configure.in: Rename cache variable gp_cxx_throw_decl to
1753           gp_cv_cxx_throw_decl.
1754
1755         * src/key-list.cc (Key_List::output_hash_function): When outputting
1756           __inline, take advantage of C++ compilers which have inline.
1757
1758         * src/key-list.cc (Output_Compare_Strncmp::output_comparison):
1759           After the call to strncmp, verify that expr2 is not longer than
1760           `len'.
1761           Reported by Carlo Wood <carlo@runaway.xs4all.nl>.
1762
1763         * src/key-list.cc (Key_List::output_lookup_function_body): Avoid
1764           emitting the loop for dealing with duplicates if
1765           total_duplicates == 0.
1766
1767         * src/key-list.cc (Key_List::read_keys): Don't accept an empty key.
1768
1769         * src/Makefile.in (install, installdirs, uninstall): Respect
1770           $(DESTDIR).
1771         * doc/Makefile.in (install, installdirs, uninstall): Likewise.
1772
1773         * src/options.cc (Options::print_options): Escape the arguments which
1774           contain special characters.
1775
1776         * tests/c-parse.gperf: Updated from gcc-2.95.2/gcc/c-parse.gperf.
1777         * tests/objc.gperf: New file, from gcc-2.95.2/gcc/objc/objc.gperf.
1778         * tests/chill.gperf: New file, from gcc-2.95.2/gcc/ch/gperf.
1779         * tests/cplusplus.gperf: New file, from gcc-2.95.2/gcc/cp/gxx.gperf.
1780         * tests/gplus.gperf: Remove file.
1781         * tests/java.gperf: New file, from gcc-2.95.2/gcc/java/keyword.gperf.
1782         * tests/Makefile: Check them all.
1783         * tests/c-parse.exp: Renamed from tests/test-1.exp.
1784         * tests/modula2.exp: Renamed from tests/test-2.exp.
1785         * tests/cplusplus.exp: Renamed from tests/test-3.exp.
1786         * tests/gpc.exp: Renamed from tests/test-5.exp.
1787
1788         * src/key-list.cc (output_switch_case): Add trailing semicolon to
1789           lengthptr assignment line. Fixes bug with -D and -S.
1790           From Reini Urban <rurban@sbox.tu-graz.ac.at>. Also reported by
1791           David Hunter.
1792         * tests/Makefile.in (check-lang-syntax): Perform each test with -D
1793           once without and once with duplicates.
1794
1795         * src/key-list.cc (output_keyword_entry): Avoid outputting a struct
1796           initializer of the form {"key",}.
1797
1798         * src/iterator.cc: Don't include <stream.h>.
1799           From Michael Deutschmann <ldeutsch@mail.netshop.net>.
1800
1801         * tests/Makefile.in (VALIDATE, check-lang-syntax): Use $(srcdir) where
1802           appropriate.
1803           Reported by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
1804
1805         * tests/validate: Don't run -traditional tests by default.
1806
1807         * src/main.cc (main): Check for write error on stdout before returning.
1808
1809         * src/Makefile.in (LDFLAGS): New definition, to catch the value given
1810           at configure time.
1811
1812         Make the structure initializers customizable. Based on a patch by
1813         Kaveh R. Ghazi <ghazi@caip.rutgers.edu>.
1814         * src/options.h (Options::get_initializer_suffix,
1815           Options::initializer_suffix): New declarations.
1816         * src/options.icc (Options::get_initializer_suffix): New function.
1817         * src/options.cc (DEFAULT_INITIALIZER_SUFFIX): New constant.
1818           (Options::initializer_suffix): New variable.
1819           (Options::short_usage): Document option "-F".
1820           (Options::long_usage): Document option "-F".
1821           (Options constructor): Initialize initializer_suffix.
1822           (Options destructor): Dump initializer_suffix.
1823           (long_options): Add option "-F".
1824           (Options::operator()): Accept option "-F". Sets initializer_suffix.
1825         * src/key-list.cc (output_keyword_blank_entries): Output
1826           initializer_suffix.
1827         * doc/gperf.texi: Document option "-F".
1828
1829         * COPYING: Replace with GPL version 2 (with new FSF address and Y2K
1830           safe year format).
1831
1832         * doc/gpl.texinfo: New file.
1833         * doc/gperf.texi: Document it.
1834         * doc/Makefile.in (gperf.info, gperf.dvi, gperf.html, gperf_toc.html):
1835           Update dependencies.
1836
1837         * doc/Makefile.in (MAKEINFO): Unset LANG while running makeinfo.
1838
1839 1998-05-20  Bruno Haible  <bruno@linuix.mathematik.uni-karlsruhe.de>
1840
1841         * doc/Makefile.in (gperf.dvi, clean): Remove gperf.cps.
1842           (install, installdirs, uninstall): Don't install gperf.dvi. The
1843           info and HTML documentations are sufficient for on-line use, and
1844           users who wish to print the documentation (in PS or DVI format)
1845           can do this directly off the source distribution.
1846           (DVIPS): Use "-D600" instead of "-Pljfour", for portability.
1847
1848 1998-05-20  Akim Demaille  <demaille@inf.enst.fr>
1849
1850         * doc/gperf.texi: Many modifications:
1851           (Output Format): Declare `hash' and `in_word_set' as functions.
1852           (Concept Index): New section.
1853           (Title page): Use standard presentation.
1854           (Top): Use @top instead of @unnumbered so that automatic master
1855           update works.
1856           (Motivation): Avoid spaces in @var.
1857           (Options): Use the standard name ``Invoking ...''.
1858           (Options): Declare also the long form of the options.
1859           (Options): Remove redundant @itemize when @table is used.
1860
1861 1998-05-08  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
1862
1863         * aclocal.m4 (CL_PROG_INSTALL): Set cl_cv_path_install, not
1864           ac_cv_path_install.
1865
1866 Sat May  2 13:20:54 1998  Bruno Haible  <bruno@linuix.mathematik.uni-karlsruhe.de>
1867
1868         * gperf-2.7 released.
1869
1870 Sat May  2 12:31:51 1998  Bruno Haible  <bruno@linuix.mathematik.uni-karlsruhe.de>
1871
1872         * src/version.cc (version_string): Remove the "(C++ version)" suffix.
1873           It's redundant: the early C versions of gperf are called cperf.
1874           Reported by Karl Berry.
1875         * src/option.cc (Options::operator()): Trim the output of "gperf -v".
1876
1877 Thu Apr 16 13:22:16 1998  Bruno Haible  <bruno@linuix.mathematik.uni-karlsruhe.de>
1878
1879         * lib/Makefile.in, src/Makefile.in: Don't use $(TARGET_ARCH).
1880           Solaris "make" sets it to a value not understood by "cc".
1881
1882 Wed Apr 15 23:52:14 1998  Bruno Haible  <bruno@linuix.mathematik.uni-karlsruhe.de>
1883
1884         * lib/Makefile.in, src/Makefile.in: Don't use implicit rules. Don't
1885           use $<. AIX "make" and OSF/1 "make" have problems with both.
1886         * src/gen-perf.cc, src/key-list.cc: Cast free() argument to char*,
1887           otherwise it doesn't compile on SunOS 4.
1888         * src/key-list.h: Declare structs outside of other declarations,
1889           needed for OSF/1 cxx 5.5.
1890         * lib/getopt.h: Use prototypes if __STDC__ || __cplusplus.
1891           Don't give a prototype for getopt(), to avoid error on SunOS 4.
1892         * lib/getopt.c: Declare strncmp, to avoid warnings.
1893
1894 Tue Apr 14 23:24:07 1998  Bruno Haible  <bruno@linuix.mathematik.uni-karlsruhe.de>
1895
1896         * lib/GetOpt.{h,cc}: Remove files.
1897         * lib/getopt.{h,c}, lib/getopt1.c: New files, from GNU libc.
1898         * lib/configure.in (AC_INIT): Search for hash.cc, not GetOpt.cc.
1899         * lib/Makefile.in (OBJECTS): Remove GetOpt.o, add getopt.o, getopt1.o.
1900           (getopt.o, getopt1.o, hash.o): Use explicit building rules. Some
1901           "make"s don't support to have both implicit rules for "%.o : %.c"
1902           and "%.o : %.cc" in the same Makefile.
1903         * lib/hash.{h,cc}: Remove #pragma; there are no templates here.
1904         * src/option.h (Options::usage): Remove.
1905           (Options::short_usage, Options::long_usage): Declare.
1906         * src/option.cc (Options::usage): Remove.
1907           (Options::short_usage, Options::long_usage): New functions.
1908           (long_options): New array.
1909           (Options::operator()): Use getopt_long instead of GetOpt::operator(),
1910           change all references to GetOpt members.
1911
1912         * src/std-err.{h,cc}: Remove files.
1913         * src/gen-perf.cc, src/key-list.cc, list-node.cc, new.cc, options.cc:
1914           Call fprintf(stderr) instead of Std_Err::report_error().
1915         * src/key-list.h, src/list-node.h, src/options.h: Don't use class
1916           Std_Err any more.
1917         * src/option.cc (program_name): New variable.
1918         * src/Makefile.in: Remove STD_ERR_H.
1919           (OBJECTS): Remove std-err.o.
1920
1921 Mon Mar 23 01:03:35 1998  Bruno Haible  <bruno@linuix.mathematik.uni-karlsruhe.de>
1922
1923         * aclocal.m4, {lib,src,tests}/configure.in: Remove CL_CC_WORKS and
1924           CL_CXX_WORKS, already contained in autoconf 2.12.
1925
1926         * src/gen-perf.cc, src/key-list.cc: Move some code from
1927           Gen_Perf::Gen_Perf() to Key_List::output().
1928         * src/Makefile.in: Update dependencies.
1929
1930         * src/options.{h,cc}: Remove option "-p".
1931         * src/key-list.cc (Key_List::set_output_types): Rewrite.
1932           (default_array_type, default_return_type): Remove.
1933         * src/key-list.cc: Adjust "const" handling.
1934           + With option "-t" [TYPE], don't emit wrong code if there is no
1935             space before the struct's opening brace.
1936
1937 Sun Mar 22 16:59:15 1998  Bruno Haible  <bruno@linuix.mathematik.uni-karlsruhe.de>
1938
1939         * src/key-list.{h,cc}: Completely reorganized the output routines.
1940           Rewrote from scratch the output_switch() function. Use classes
1941           (Output_Constants, Output_Expr, Output_Compare) for abstraction.
1942           In particular:
1943           + Don't emit trailing whitespace and spurious blank lines.
1944           + Adjust indentation of the arrays.
1945           + Don't emit commas at the end of array initializers and
1946             struct initializers.
1947           + With option "-l" [LENTABLE], compare the length before
1948             fetching the word from memory.
1949           + With option "-S" [SWITCH], emit the comparison code just once,
1950             not once in every switch statement.
1951           + With option "-S" [SWITCH], choose the right switch statement
1952             through a binary search, not a linear search.
1953           + With option "-S" [SWITCH], emit straightforward comparisons
1954             instead of switch statements with just one "case" label.
1955           + With options "-S -p -t" [SWITCH, POINTER, TYPE], don't emit
1956             spurious empty elements at the beginning of the wordlist array.
1957           + With option "-D" [DUP] and not option "-S" [SWITCH], if there
1958             is no more room for duplicate entries in the lookup array,
1959             don't call `assert (i != 0)'. Instead, make the array larger :-)
1960           + With option "-D" [DUP], if there are no duplicates, don't
1961             automatically fall back to the non-"-D" algorithm. If the user
1962             wants the non-"-D" algorithm, he can just not specify "-D".
1963           + With option "-D" [DUP] and either options "-p -t" [POINTER, TYPE]
1964             or not option "-S" [SWITCH], don't emit spurious empty elements
1965             at the beginning of the wordlist array.
1966           + With option "-D" [DUP], simplify the detection and processing
1967             of duplicate entries in the lookup array.
1968           + With options "-D -l" [DUP, LENTABLE] and not option "-S" [SWITCH],
1969             don't forget to emit the lengthtable array.
1970           + With options "-D -l -S" [DUP, LENTABLE, SWITCH], don't forget to
1971             compare the lengths before comparing the strings.
1972
1973         * src/gen-perf.cc: No need to include <assert.h>.
1974         * src/options.cc: Likewise.
1975
1976         * src/options.cc: Don't use `errno' after freopen failed.
1977         * src/std-err.cc: `report_error' doesn't call strerror(errno) any
1978           more. No need to include <string.h> and <errno.h>.
1979
1980         * tests/Makefile.in (check-*): Any difference between .exp and .out
1981           is a failure. Don't ignore whitespace differences.
1982
1983         * tests/Makefile.in (check-lang-syntax): Add some more checks.
1984
1985 Fri Mar 20 00:54:54 1998  Bruno Haible  <bruno@linuix.mathematik.uni-karlsruhe.de>
1986
1987         * tests/jscript.gperf: Renamed from tests/javascript.gperf, because
1988           of Minix and SVR2 14-character filename limit.
1989         * src/key-list.cc (output_string): New function.
1990           (Key_List::output_switch, Key_List::output_keyword_table): Call it.
1991
1992         * src/options.{h,icc,cc} (get_wordlist_name): New function. Add
1993           option -W.
1994         * src/key-list.cc (Key_List::output_switch,
1995           Key_List::output_keyword_table, Key_List::output_lookup_function):
1996           Use it.
1997         Patch from William Bader <wbader@CSEE.Lehigh.Edu>.
1998
1999         * src/version.cc: Bump version number directly from 2.5 to 2.7,
2000           because Schmidt's last release from 1991 carries version number 2.6.
2001
2002 Tue Jul 30 00:02:39 1991  Douglas C. Schmidt  (schmidt at net4.ics.uci.edu)
2003
2004         * Fixed a small bug in the Key_List::output_keyword_table routine
2005           that caused an extra newline to be printed if there where no
2006           leading blank entries... (who cares, right?!)
2007
2008 Mon Jul 29 22:05:40 1991  Douglas C. Schmidt  (schmidt at net4.ics.uci.edu)
2009
2010         * Modified the handling of the -E (emit enums rather than
2011           #defines) option in conjunction with the -G option.  Now, if -G
2012           and -E are given the enums are generated outside the lookup
2013           function, rather than within it!
2014
2015 Mon Apr  8 18:17:04 1991  Doug Schmidt  (schmidt at net4.ics.uci.edu)
2016
2017         * Yucko, there was a bug in the handling of -c (and of course the
2018           new -I command in key-list.cc).  Apparently when I added the
2019           super-duper hack that provided support for duplicate keys I
2020           forgot to update the strcmp output...
2021
2022 Mon Mar  9 02:19:04 1998  Bruno Haible  <bruno@linuix.mathematik.uni-karlsruhe.de>
2023
2024         * Moved the documentation to doc/, put the stuff borrowed from
2025           libg++ into lib/.
2026         * Rewrote all Makefile.in's for better compliance with GNU standards.
2027         * Autoconf based configuration. Rewrote all configure.in's. Added
2028           aclocal.m4, with macros from CLISP and CLN. Added Makefile.devel.
2029         * src/depend: Removed. Dependencies are now in src/Makefile.in.
2030
2031         * src/bool-array.icc: New file, contains inline functions, from both
2032           src/bool-array.h and src/bool-array.cc.
2033         * src/options.icc: New file, contains inline functions, from both
2034           src/options.h and src/options.cc.
2035         * src/read-line.icc: New file, contains inline functions, from both
2036           src/read-line.h and src/read-line.cc.
2037
2038         * src/bool-array.h: Don't include <std.h>.
2039         * src/bool-array.cc: Include <string.h>.
2040         * src/gen-perf.cc: No need to include <ctype.h>. Don't include
2041           <_G_config.h>.
2042         * src/hash-table.cc: Don't include <std.h> and <builtin.h>. Include
2043           <string.h> and lib/hash.h instead.
2044         * src/iterator.cc: Don't include <std.h>.
2045         * src/key-list.cc: Don't include <builtin.h>. Include <string.h> and
2046           <stdlib.h> instead.
2047         * src/list-node.cc: Don't include <std.h>. Include <stdlib.h> instead.
2048           Remove `index' hack.
2049         * src/main.cc: Don't include <_G_config.h>.
2050         * src/new.cc: Don't include <std.h>. Include <stdlib.h> instead.
2051         * src/options.cc: Don't include <builtin.h>. Include <string.h> and
2052           <stdlib.h> instead.
2053         * src/read-line.cc: Don't include <builtin.h>. Include <stdlib.h>
2054           instead.
2055         * src/std-err.cc: Don't include <std.h>. Include <string.h> (for Irix).
2056         * src/vectors.h: No need to include <stdio.h>.
2057         * src/version.cc: No need to include <stdio.h>.
2058
2059         * src/bool-array.h: Change `STORAGE_TYPE' from int to unsigned int.
2060         * src/bool-array.{h,cc}: Change type of `Bool_Array::size' from int
2061           to unsigned int.
2062         * src/bool-array.{h,cc}: Change type of `Bool_Array::init' argument
2063           from STORAGE_TYPE to unsigned int.
2064         * src/gen-perf.{h,cc}: Change two `Gen_Perf::compute_disjoint_union'
2065           argument types from `char *' to `const char *'.
2066         * src/iterator.h: Change type of `Iterator::str' and argument of
2067           `Iterator::Iterator' from `char *' to `const char *'.
2068         * src/iterator.cc: Cast to `unsigned char' before calling `isdigit'.
2069         * src/key-list.{h,cc}: Change type of `Key_List::array_type',
2070           `Key_List::return_type', `Key_List::struct_tag',
2071           `Key_List::include_src', `default_array_type', `default_return_type'
2072           and return type of `Key_List::get_array_type',
2073           `Key_List::get_special_input', `Key_List::save_include_src' from
2074           `char *' to `const char *'.
2075         * src/key-list.cc: Change "pretty gross" assignment.
2076         * src/key-list.cc: Don't use `alloca', HP-UX CC lacks it.
2077         * lib/GetOpt.cc: Likewise.
2078         * src/key-list.cc (merge): Use iteration instead of recursion.
2079         * src/list-node.{h,cc}: Change type of `List_Node::key',
2080           `List_Node::rest', `List_Node::char_set' from `char *' to
2081           `const char *'.
2082         * src/new.cc: Don't use BUFSIZ. Conditionalize the throw() declaration.
2083         * src/read-line.h: Don't use BUFSIZ.
2084         * src/read-line.cc: Make CHUNK_SIZE a constant, and use allocate the
2085           buffers on the stack by default. Use memcpy for copying buffers.
2086           Include <string.h>.
2087         * src/read-line.icc (get_line): Use iteration instead of tail recursion.
2088           Don't call ungetc(EOF,stdin).
2089         * src/std-err.{h,cc}: Change type of `Std_Err::program_name' and of
2090           argument `Std_Err::report_error' from `char *' to `const char *'.
2091         * src/std-err.cc: `report_error' doesn't call `exit' any more. All
2092           callers changed to do that themselves.
2093         * src/trace.h: Make constructor/destructor calls non-inline.
2094
2095         * src/key-list.cc (output_hash_function): If option[CPLUSPLUS],
2096           always make the hash function inline.
2097           (output): Declare the hash function inline, with the right name.
2098         * src/options.{h,cc}, src/gen-perf.cc, src/key-list.cc: Remove
2099           options -g, making it on by default. Remove option -a. Instead,
2100           introduce "-L KR-C", "-L C", "-L ANSI-C", "-L C++".
2101         * src/options.{h,cc}, src/key-list.cc: Add option -I.
2102         * src/key-list.cc: Don't emit "const" if compiling in mode "-L KR-C".
2103         * src/key-list.cc: Don't emit a comma at the end of an enum list.
2104         * src/main.cc: Remove COUNT_TIME code.
2105         * src/vectors.h, src/key-list.cc, src/options.cc, src/list-node.cc:
2106           ALPHA_SIZE defaults to 256 now. Add option -7.
2107
2108         * tests/javascript.gperf: New file.
2109         * tests/jstest*.gperf, tests/validate: New tests.
2110
2111 Sat Jan 31 01:38:11 1998  Alexandre Oliva <oliva@dcc.unicamp.br>
2112
2113         * src/Makefile.in ($(TARGETPROG)): Add $(CFLAGS).
2114
2115 Wed Jan 28 01:56:00 1998  Manfred Hollstein  <manfred@s-direktnet.de>
2116
2117         * configure.in (package_makefile_rules_frag): New and
2118         redirect stderr from ${srcdir}/config.shared to
2119         ${package_makefile_rules_frag}.
2120         * src/configure.in: Ditto.
2121         * tests/configure.in: Ditto.
2122
2123 Fri Jan 23 08:00:41 1998  H.J. Lu  (hjl@gnu.org)
2124
2125         * gperf.texi (@ichapter): Changed to @chapter.
2126
2127 Wed Jan 14 09:16:48 1998  H.J. Lu  (hjl@gnu.org)
2128
2129         * src/key-list.cc, src/key-list.h (Key_List::strcspn): Don't
2130         define if strcspn is defined.
2131
2132 Fri Jan 24 13:23:47 1997  Mike Stump  <mrs@cygnus.com>
2133
2134         * src/new.cc (operator delete): Add the exception specification.
2135
2136 Mon Feb  5 19:29:16 1996  Per Bothner  <bothner@kalessin.cygnus.com>
2137
2138         * src/read-line.cc (Read_Line::readln_aux):  Handle EOF if last line
2139         has a length which is an exact multiple of CHUNK_SIZE.  (Used to throw
2140         away the line's contents.)  From Bruno Haible <haible@ilog.ilog.fr>.
2141         * src/Makefile.in ($(TARGETPROG)):  Add -lm to link line.
2142
2143 Tue Jun 11 13:43:50 1996  Brendan Kehoe  <brendan@lisa.cygnus.com>
2144
2145         * src/list-node.cc (List_Node): Reorder init of nodes to
2146         match declaration order.
2147         * src/hash-table.cc (Hash_Table): Likewise.
2148
2149 Tue Oct 10 16:37:28 1995  Mike Stump  <mrs@cygnus.com>
2150
2151         * src/new.cc: Since malloc/delete are not paired, we cannot call
2152         free.
2153
2154 Wed Jan  4 12:40:14 1995  Per Bothner  <bothner@kalessin.cygnus.com>
2155
2156         * src/Makefile.in ($(TARGETPROG)):  Link with $(LDFLAGS).
2157         Patch from John Interrante <interran@uluru.stanford.edu>.
2158
2159 Sat Nov  5 19:12:48 1994  Jason Merrill  (jason@phydeaux.cygnus.com)
2160
2161         * src/Makefile.in (LIBS): Remove.
2162
2163 Tue Oct 18 17:51:14 1994  Per Bothner  <bothner@kalessin.cygnus.com>
2164
2165         * src/std-err.cc:  Use stderror, instead of the non-standard
2166         sys_nerr and sys_errlist.
2167
2168 Sat Sep 17 22:02:13 1994  Per Bothner  (bothner@kalessin.cygnus.com)
2169
2170         * src/key-list.cc (output_hash_function):
2171         Patch from William Bader <wbader@CSEE.Lehigh.Edu>.
2172
2173 Fri Jul 15 09:38:11 1994  Per Bothner  (bothner@cygnus.com)
2174
2175         * src/std-err.cc:  #include <errno.h>, and only declare
2176         extern int errno if errno is not a macro.
2177
2178 Mon May 30 17:29:34 1994  Per Bothner  (bothner@kalessin.cygnus.com)
2179
2180         * Makefile.in (src_all, install):  Make sure to add '/' after
2181         `pwd` in $rootme, as expected by FLAGS_TO_PASS.
2182
2183 Wed May 11 00:47:22 1994  Jason Merrill  (jason@deneb.cygnus.com)
2184
2185         Make libg++ build with gcc -ansi -pedantic-errors
2186         * src/options.h: Lose commas at end of enumerator lists.
2187
2188 Sun Dec  5 19:16:40 1993  Brendan Kehoe  (brendan@lisa.cygnus.com)
2189
2190         * src/hash-table.cc (Hash_Table::~Hash_Table): Don't pass an
2191         argument to fprintf, since it's not expecting one.
2192
2193 Fri Nov 26 19:03:18 1993  Per Bothner  (bothner@kalessin.cygnus.com)
2194
2195         * src/list-node.cc:  #undef index, for the sake of broken NeXT,
2196
2197 Thu Nov  4 11:16:03 1993  Per Bothner  (bothner@kalessin.cygnus.com)
2198
2199         * Makefile.in (install):  Use INSTALL_DATA for gperf.1.
2200
2201 Mon Oct 25 18:40:51 1993  Per Bothner  (bothner@kalessin.cygnus.com)
2202
2203         * src/key-list.cc (Key_List::read_keys):  Use POW macro
2204         to increase hash table size to power of 2.
2205
2206         * options.h (LARGE_STACK_ARRAYS):  New flag.  Defaults to zero.
2207         * gen-perf.cc, key-list.cc, read-line.cc:       
2208         Only stack-allocate large arrays if LARGE_STACK_ARRAYS is set.
2209         * main.cc (main):  Only call setrlimit (RLIMIT_STACK, ...)
2210         if LARGE_STACK_ARRAYS.
2211
2212 Mon Oct  4 17:45:08 1993  Per Bothner  (bothner@kalessin.cygnus.com)
2213
2214         * src/gen-perf.cc:  Always use ANSI rand/srand instead of BSDisms.
2215
2216 Wed Aug 18 12:19:53 1993  Per Bothner  (bothner@kalessin.cygnus.com)
2217
2218         * Makefile.in (src_all):  Make less verbose output.
2219
2220 Fri May 28 14:01:18 1993  Per Bothner  (bothner@rtl.cygnus.com)
2221
2222         * src/gen-perf.cc (Gen_Perf::change):  Don't use gcc-specific
2223         2-operand conditional expression.
2224         * src/key-list.cc (Key_List::output_lookup_array):
2225         Don't use variable-size stack arrays, unless compiled by g++.
2226
2227 Tue May  4 14:08:44 1993  Per Bothner  (bothner@cygnus.com)
2228
2229         Changes (mostly from Peter Schauer) to permit compilation
2230         using cfront 3.0 and otherwise be ARM-conforming.
2231         * src/key-list.h:  class Key_List must use public derivation
2232         of base class Std_Err (because Gen_Perf::operator() in gen-perf.cc
2233         calls Std_Err::report_error).
2234         * src/gen-perf.cc (Gen_Perf::affects_prev), src/hash-table.cc
2235         (Hash_Table::operator()):  Don't use gcc-specific 2-operand
2236         conditional expression.
2237         * src/iterator.cc (Iterator::operator()):  Don't use gcc-specific
2238         range construct in case label.
2239         * key-list.cc (Key_List::output_lookup_array, Key_List::read_keys),
2240         src/gen-perf.cc (Gen_Perf::operator(), src/read-line.cc
2241         (Read_Line::readln_aux):  If not gcc, don't allocate
2242         variable-sized arrays on stack.
2243         * src/new.cc (operator new):  Argument type should be size_t.
2244         * key-list.cc (Key_List::output_lookup_array, Key_List::read_keys),
2245         new/cc (::operator new): Don't use non-standard >?= operator.
2246
2247 Tue Apr 27 20:11:30 1993  Per Bothner  (bothner@cygnus.com)
2248
2249         * src/Makefile.in:  Define TARGETPROG, and use it.
2250
2251 Mon Apr 19 00:29:18 1993  Per Bothner  (bothner@cygnus.com)
2252
2253         * Makefile.in, configure.in:  Re-vamped configure scheme.
2254         * gperf.texinfo:  Renamed to gperf.texi.
2255         * src/bool-array.{h,cc}:  ANSIfy bzero->memset.
2256
2257 Sat Jan 30 20:21:28 1993  Brendan Kehoe  (brendan@lisa.cygnus.com)
2258
2259         * tests/Makefile.in (mostlyclean): Also delete aout, cout, m3out,
2260         pout, and preout.
2261
2262 Tue Dec 29 08:58:17 1992  Ian Lance Taylor  (ian@cygnus.com)
2263
2264         * Makefile.in: pass $(FLAGS_TO_PASS) to all calls to make.
2265         (FLAGS_TO_PASS): added INSTALL, INSTALL_DATA, INSTALL_PROGRAM.
2266
2267 Mon Dec 21 18:46:46 1992  Per Bothner  (bothner@rtl.cygnus.com)
2268
2269         * tests/expected.* renamed to *.exp to fit in 14 chars.
2270         * tests/Makefile.in:  Update accordingly.
2271         Also rename output.* to *.out.
2272         * src/Makefile.in (clean):  Remove gperf program.
2273
2274 Wed Dec  9 14:33:34 1992  Per Bothner  (bothner@cygnus.com)
2275
2276         * src/hash-table.cc, src/bool-array.h: ANSIfy bzero->memset.
2277
2278 Thu Dec  3 19:34:12 1992  Per Bothner  (bothner@cygnus.com)
2279
2280         * Makefile.in (distclean, realclean): Don't delete
2281         Makefile before recursing.
2282
2283 Fri Nov  6 13:41:49 1992  Per Bothner  (bothner@rtl.cygnus.com)
2284
2285         * key-list.{h,cc}:  Remove MAX_INT (and similar) constant
2286         fields from Key_List class, and use INT_MAX (etc) from limits.h.
2287         * key-list.{h,cc}, options.{h,cc}, vectors.h:  Removed all
2288         uses of initialized const fields, as they are non-standard
2289         - and their use was easy to do away with.  Mostly, just
2290         made the constants static non-fields in the .cc file.
2291
2292 Mon Nov  2 13:10:11 1992  Per Bothner  (bothner@cygnus.com)
2293
2294         * tests/Makefile.in:  When generating cinset.c, don't pass -C,
2295         since -C assumes an ANSI compiler.  Add the -C flag (with -a)
2296         when generating test.out.3 instead.
2297         * tests/expected.out.3:  Update accordingly.
2298
2299 Wed Aug 12 11:47:54 1992  Per Bothner  (bothner@cygnus.com)
2300
2301         * Makefile.in:  Factor out common flags into $(FLAGS_TO_PASS).
2302         * Makefile.in:  'install-info' depends on gperf.info.
2303
2304 Mon Aug 10 11:39:52 1992  Ian Lance Taylor  (ian@dumbest.cygnus.com)
2305
2306         * Makefile.in, src/Makefile.in: always create installation
2307         directories.
2308
2309 Mon Jul 20 15:33:21 1992  Mike Stump  (mrs@cygnus.com)
2310
2311         * src/new.cc (operator new):  Add cast from void * to char *,
2312         since it is not a standard conversion.
2313
2314 Wed Jun 17 16:25:30 1992  Per Bothner  (bothner@rtl.cygnus.com)
2315
2316         * src/gen-perf.cc:  #include <_G_config.h> for _G_SYSV.
2317         * src/key-list.cc:  alloca() hair.
2318         * src/main.cc (main):  Only call getrlimit if _G_HAVE_SYS_RESOURCE.
2319         * Makefile,in, {src,test}/Makefile.in:  Fix *clean rules.
2320
2321 Fri May 29 13:21:13 1992  Per Bothner  (bothner@rtl.cygnus.com)
2322
2323         * src/gen-perf.cc:  Replace USG -> _G_SYSV.
2324
2325 Thu May 14 13:58:36 1992  Per Bothner  (bothner@rtl.cygnus.com)
2326
2327         * src/Makefile.in:  Don't pass obsolete flag -DUNLIMIT_STACK.
2328         * tests/Makefile.in (clean): Fix.
2329
2330 Sat Mar  7 00:03:56 1992  K. Richard Pixley  (rich@rtl.cygnus.com)
2331
2332         * gperf.texinfo: added menu item hook.
2333
2334 Wed Feb 26 18:04:40 1992  K. Richard Pixley  (rich@cygnus.com)
2335
2336         * Makefile.in, configure.in: removed traces of namesubdir,
2337           -subdirs, $(subdir), $(unsubdir), some rcs triggers.  Forced
2338           copyrights to '92, changed some from Cygnus to FSF.
2339
2340 Sun Jan 26 19:21:58 1992  Per Bothner  (bothner at cygnus.com)
2341
2342         * tests/Makefile.in:  Use re-directed stdin instead of file
2343         name in argv.  This allows us to remove the filename
2344         from the output, the expected output, and hence the diffs.
2345         (Note that the input file is in $(srcdir), which we cannot
2346         place in the expected out files.)
2347         * tests/expected.out.[1235]:  Edit out input filename,
2348         to match new output.
2349
2350 Thu Jun 28 16:17:27 1990  Doug Schmidt  (schmidt at brilliant)
2351
2352         * Wow, first fix on the new job!  There was a dumb error
2353           in Key_List::output_lookup_function, where I printed the
2354           string "&wordlist[key]" instead of the correct "&wordlist[index]".
2355           
2356         * Added a couple of #ifdefs for USG support.
2357                 
2358 Sun Jun  3 17:16:36 1990  Doug Schmidt  (schmidt at crimee.ics.uci.edu)
2359
2360         * Updated the version number to 2.5 and sent to Doug Lea for release
2361           with the latest GNU libg++.
2362
2363         * Changed the error handling when a keyword file cannot be opened
2364           (now calls perror).
2365
2366 Wed May 30 14:49:40 1990  Doug Schmidt  (schmidt at crimee.ics.uci.edu)
2367
2368         * Instrumented the source code with trace statements automagically
2369           inserted using my new automated trace instrumentation tool!
2370
2371 Wed May  9 11:47:41 1990  Doug Schmidt  (schmidt at siam.ics.uci.edu)
2372
2373         * Really fixed the previous bug.  Turns out that a small amount
2374           of logic had to be duplicated to handle static links that occur
2375           as part of dynamic link chains.  What a pain!!!
2376
2377 Tue May  8 23:11:44 1990  Doug Schmidt  (schmidt at siam.ics.uci.edu)
2378
2379         * Fixed a stupid bug in Key_List::output_lookup_array that was
2380           causing incorrect counts to be generated when there were both
2381           static and dynamic links occurring for the same hash value.
2382           Also simplified the code that performs the logic in this routine.
2383
2384 Mon Apr 30 17:37:24 1990  Doug Schmidt  (schmidt at crimee.ics.uci.edu)
2385
2386         * Fixed stupid bug in Key_List::output_lookup_array that was
2387           making the generated lookup[] array contain `chars' even
2388           when the values stored in the chars are greater than 127!
2389
2390         * Changed the behavior of the -G (global table) option so that it
2391           will output the `length[]' array in the global scope along with
2392           the `word_list[]' array.
2393
2394         * Fixed a stupid bug in Key_List::output_lookup_function that
2395           would always output the complicated `duplicate-handling' lookup
2396           logic, even when there were no duplicates in the input!
2397
2398         * Yikes, had to modify a bunch of stuff in key-list.cc to correctly
2399           handle duplicate entries.  Changed the generated code so that
2400           the MIN_HASH_VALUE is no longer subtracted off when calculating
2401           the hash value for a keyword.  This required changing some other
2402           code by substituting MAX_HASH_VALUE for TOTAL_KEYS in several places.
2403           Finally, this means that the generated tables may contain leading 
2404           null entries, but I suppose it is better to trade-off space to get 
2405           faster performance...
2406
2407 Mon Mar 26 13:08:43 1990  Doug Schmidt  (schmidt at crimee.ics.uci.edu)
2408
2409         * Updated version number to 2.4 to reflect the latest changes.
2410
2411         * Changed the main program so that it always prints out gperf's
2412           execution timings to the generated output file.
2413           
2414 Sun Mar 25 12:39:30 1990  Doug Schmidt  (schmidt at crimee.ics.uci.edu)
2415
2416         * Added the -Z option so that users can specify the name of the
2417           generated class explicitly.  Updated documentation to reflect
2418           this change.
2419           
2420         * Modified the generated C++ class interface so that the functions
2421           are declared static (to remove the overhead of passing the `this'
2422           pointer).  This means that operator()() can no longer be used,
2423           since it only works on non-static member functions.
2424           Also changed things so that there is no constructor (why waste
2425           the extra call, when it doesn't do anything, eh?)
2426
2427         * Modified the behavior of Key_List::output when the -L C++ option
2428           is enabled.  Previously the code generated use const data members
2429           to record MIN_WORD_LENGTH, MIN_HASH_VALUE, etc.  However, as
2430           pointed out by James Clark this may result in suboptimal behavior
2431           on the part of C++ compilers that can't inline these values.
2432           Therefore, the new behavior is identical to what happens with
2433           -L C, i.e., either #defines or function-specific enums are used.
2434           Why sacrifice speed for some abstract notion of `code purity?' ;-)
2435
2436 Tue Mar  6 18:17:42 1990  Doug Schmidt  (schmidt at crimee.ics.uci.edu)
2437
2438         * Added the -E option that defines constant values using an enum
2439           local to the lookup function rather than with #defines.  This
2440           also means that different lookup functions can reside in the
2441           same file.  Thanks to James Clark (jjc@ai.mit.edu). 
2442
2443 Sat Mar  3 20:19:00 1990  Doug Schmidt  (schmidt at zola.ics.uci.edu)
2444
2445         * Added a special case to key_list::output_switch that doesn't
2446           generate extra comparisons when the `-S' is given an argument
2447           of 1 (the normal case).  This should speed up the generated
2448           code output a tad...
2449
2450 Fri Feb 23 14:21:28 1990  Doug Schmidt  (schmidt at zola.ics.uci.edu)
2451
2452         * Renamed all instances of member function get_keysig_size
2453           to get_max_keysig_size, since this is more precise...
2454
2455         * Changed all occurrences of charset to keysig (stands for ``key
2456           signature'') to reflect the new naming convention used in the 
2457           USENIX paper.
2458
2459 Thu Feb 22 11:28:36 1990  Doug Schmidt  (schmidt at crimee.ics.uci.edu)
2460
2461         * Changed the name of the generated associated values table from
2462           asso_value to asso_values to reflect conventions in the USENIX
2463           C++ paper.
2464
2465 Thu Feb 15 23:29:03 1990  Doug Schmidt  (schmidt at zola.ics.uci.edu)
2466
2467         * Updated the gperf.texinfo file to fix some formatting problems
2468           that had crept in since last time.
2469
2470 Wed Feb 14 23:27:24 1990  Doug Schmidt  (schmidt at zola.ics.uci.edu)
2471
2472         * Fixed stupid bug in key-list.cc (get_special_input), wher
2473           gperf replaced each '%' with the succeeding character.
2474
2475         * Added support for multiple target language generation.  Currently
2476           handled languages are C and C++, with C as the default.  Updated
2477           documentation and option handler to reflect the changes.
2478
2479         * Added a global destructor to new.cc and removed the #ifdef, since
2480           the bloody thing now works with libg++.
2481
2482 Mon Feb 14 13:00:00 1990  Doug Schmidt  (schmidt at zola.ics.uci.edu)
2483
2484         * Found out that my gperf paper was accepted at the upcoming
2485           USENIX C++ Conference in San Francisco.  Yow!
2486
2487 Tue Jan 30 09:00:29 1990  Doug Schmidt  (schmidt at zola.ics.uci.edu)
2488
2489         * #ifdef'd out the new.cc memory allocator, since there are
2490           problems with this and the libg++ stuff.
2491
2492         * Changed key-list.h so that class Vectors is a public (rather
2493           than private) base class for class Key_List.  The previous
2494           form was illegal C++, but wasn't being caught by the old
2495           g++ compiler.  Should work now... ;-)
2496
2497 Sun Dec 10 14:08:23 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
2498
2499         * Added several changes from rfg@ics.uci.edu.  These changes
2500           help to automate the build process.
2501
2502 Wed Nov 15 15:49:33 1989  Doug Schmidt  (schmidt at zola.ics.uci.edu)
2503
2504         * Removed conditional compilation for GATHER_STATISTICS.  There's
2505           really no good reason to avoid collecting this info at run-time,
2506           since that section of code is *hardly* the bottleneck... ;-)
2507
2508         * Simplified the C output routines in Key_List::set_output_types
2509           and Key_List::output_keyword_table a bit in order to
2510           speed-up and clean up the code generation.
2511
2512         * Modified function Key_List::get_special_input so that it does
2513           not try to `delete' a buffer that turned out to be too short.
2514           This is important since the new memory management scheme
2515           does not handle deletions.  However, adding a small amount of
2516           garbage won't hurt anything, since we generally don't do this
2517           operation more than a couple times *at most*!
2518
2519         * Created a new file (new.cc) which includes my own overloaded
2520           operator new.  This function should dramatically reduce the
2521           number of calls to malloc since it grabs large chunks and
2522           doles them out in small pieces.  As a result of this change
2523           the class-specific `operator new' was removed from class List_Node.
2524
2525 Tue Nov 14 21:45:30 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
2526
2527         * Continued to refine the great hack.  The latest trick is to
2528           try and replace most uses of dynamic memory (i.e., calls to
2529           new) with uses of gcc dynamic arrays (i.e., an alloca solution).
2530           This makes life much easier for the overall process-size, since 
2531           it reduces the amount of overhead for memory management.  As a
2532           side-effect from this change there is no reason to have the
2533           Bool_Array::dispose member function, so it's outta here!
2534
2535         * Fixed a stupid bug that was an disaster waiting to happen...
2536           Instead of making the boolean array large enough to index
2537           max_hash_value it was only large enough to index max_hash_value
2538           - 1.  Once again, an off-by-one mistake in C/C++!!!!
2539
2540 Mon Nov 13 19:38:27 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
2541
2542         * Added the final great hack!  This allows us to generate hash tables
2543           for near-perfect hash functions that contain duplicates, *without*
2544           having to use switch statements!  Since many compilers die on large
2545           switch statements this feature is essential.  Furthermore, it appears
2546           that the generated code is often *smaller* than that put out by
2547           compilers, even though a large, sparse array must be created.
2548           Here's the general idea:
2549
2550              a. Generate the wordlist as a contiguous block of keywords, 
2551                 just as before when using a switch statement.  This
2552                 wordlist *must* be sorted by hash value. 
2553
2554              b. Generate the lookup array, which is an array of signed
2555                 {chars,shorts,ints}, (which ever allows full coverage of
2556                 the wordlist dimensions).  If the value v, where v =
2557                 lookup[hash(str,len)], is >= 0 and < TOTAL_KEYWORDS, then we
2558                 simply use this result as a direct access into the wordlist 
2559                 array to snag the keyword for comparison.  
2560
2561              c. Otherwise, if v is < -TOTAL_KEYWORDS or > TOTAL_KEYWORDS
2562                 this is an indication that we'll need to search through
2563                 some number of duplicates hash values.  Using a hash
2564                 linking scheme we'd then index into a different part of
2565                 the hash table that provides the starting index and total
2566                 length of the duplicate entries to find via linear search!
2567
2568 Sun Nov 12 13:48:10 1989  Doug Schmidt  (schmidt at zola.ics.uci.edu)
2569
2570         * Simplified Key_List::output_min_max considerably by recognizing
2571           that since the keyword list was already sorted by hash value finding 
2572           the min and max values is trivial!
2573
2574         * Improved the debugging diagnostics considerably in classes Key_List,
2575           Hash_Table, and Gen_Perf.
2576
2577         * Modified the `-s' option so that a negative argument is now 
2578           interpreted to mean `allow the maximum associated value to be
2579           about x times *smaller* than the number of input keys.'  This
2580           should help prevent massive explosion of generated hash table
2581           size for large keysets.
2582
2583 Sat Nov 11 11:31:13 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
2584
2585         * Added a field in class Key_List that counts the total number
2586           of duplicate keywords, both static and dynamic.
2587
2588         * Added a new member function Bool_Array that deletes the dynamic
2589           memory allocated to Bool_Array::storage_array.  This space may
2590           be needed for subsequent options, so it made sense to free it as
2591           soon as possible...
2592           
2593         * Renamed file/class Alpha_Vectors to Vectors, to avoid problems
2594           with 14 character length filenames on SYSV.  Also changed file
2595           adapredefined.gperf to adadefs.gperf in the ./tests directory.
2596
2597         * Modified class Options by changing the member function
2598           Options::total_positions to Options::get_charset_size and
2599           Options::set_charset_size.  These two routines now either return
2600           the total charset size *or* the length of the largest keyword
2601           if the user specifies the -k'*' (ALLCHARS) option.  This change
2602           cleans up client code.
2603
2604         * Merged all the cperf changes into gperf.
2605         
2606         * Made sure to explicitly initialize perfect.fewest_collisions to
2607           0.
2608
2609         * Cleaned up some loose ends noticed by Nels Olson.
2610           1.  Removed `if (collisions <= perfect.fewest_collisions)'
2611               from Gen_Perf::affects_prev since it was superfluous.
2612           2.  Removed the fields best_char_value and best_asso_value
2613               from Gen_Perf.  There were also unnecessary.
2614           3.  Fixed a braino in the Bool_Array::bool_array_reset
2615               function.  Since iteration numbers can never be zero
2616               the `if (bool_array.iteration_number++ == 0)' must be
2617               `if (++bool_array.iteration_number == 0).'
2618           4.  Modified Std_Err::report_error so that it correctly handles
2619               "%%".
2620
2621         * It is important to note that -D no longer enables -S.
2622           There is a good reason for this change, which will become
2623           manifested in the next release... (suspense!).
2624
2625         * Made some subtle changes to Key_List::print_switch so that if finally
2626           seems to work correctly.  Needs more stress testing, however...
2627
2628         * Made a major change to the Key_List::print_switch function.
2629           The user can now specify the number of switch statements to generate
2630           via an argument to the -S option, i.e., -S1 means `generate 1
2631           switch statement with all keywords in it,' -S2 means generate
2632           2 switch statements with 1/2 the elements in each one, etc.
2633           Hopefully this will fix the problem with C compilers not being
2634           able to generate code for giant switch statements (but don't
2635           hold your breath!)
2636
2637         * Changed Key_List::length function to Key_List::keyword_list_length.
2638
2639         * Added a feature to main.c that prints out the starting wall-clock
2640           time before the program begins and prints out the ending wall-clock
2641           time when the program is finished.
2642
2643         * Added the GATHER_STATISTICS code in hash-table.c so we can
2644           keep track of how well double hashing is doing.  Eventually,
2645           GATHER_STATISTICS will be added so that all instrumentation
2646           code can be conditionally compiled in.
2647
2648         * Fixed a stupid bug in Key_List::print_switch routine.  This
2649           was necessary to make sure the generated switch statement worked
2650           correctly when *both* `natural,' i.e., static links and dynamic
2651           links, i.e., unresolved duplicates, hash to the same value.
2652
2653         * Modified Bool_Array::~Bool_Array destructor so that
2654           it now frees the bool_array.storage_array when it is no longer
2655           needed.  Since this array is generally very large it makes sense
2656           to return the memory to the freelist when it is no longer in use.
2657
2658         * Changed the interface to constructor Hash_Table::Hash_Table.  This 
2659           constructor now passed a pointer to a power-of-two sized buffer that 
2660           serve as storage for the hash table.  Although this weakens information
2661           hiding a little bit it greatly reduces dynamic memory fragmentation,
2662           since we can now obtain the memory via a call to alloca, rather
2663           than malloc.  This change modified Key_List::read_keys calling
2664           interface.
2665
2666         * Since alloca is now being used more aggressively a conditional
2667           compilation section was added in main.c. Taken from GNU GCC,
2668           this code gets rid of any avoidable limit on stack size so that
2669           alloca does not fail.  It is only used if the -DRLIMIT_STACK
2670           symbol is defined when gperf is compiled. 
2671
2672         * Added warnings in option.c so that user's would be informed
2673           that -r superceeds -i on the command-line.
2674           
2675         * Rewrote Gen_Perf::affects_prev.  First, the code structure
2676           was cleaned up considerably (removing the need for a dreaded
2677           goto!).  Secondly, a major change occurred so that Gen_Perf::affects_prev
2678           returns FALSE (success) when fewest_hits gets down to whatever
2679           it was after inserting the previous key (instead of waiting for
2680           it to reach 0).  In other words, it stops trying if it can
2681           resolve the new collisions added by a key, even if there are
2682           still other old, unresolved collisions.  This modification was
2683           suggested by Nels Olson and seems to *greatly* increase the
2684           speed of gperf for large keyfiles.  Thanks Nels!
2685
2686         * In a similar vein, inside the Gen_Perf::change routine 
2687           the variable `perfect.fewest_collisions is no longer initialized
2688           with the length of the keyword list.  Instead it starts out at
2689           0 and is incremented by 1 every time change () is called.
2690           The rationale for this behavior is that there are times when a
2691           collision causes the number of duplicates (collisions) to
2692           increase by a large amount when it would presumably just have
2693           gone up by 1 if none of the asso_values were changed.  That is,
2694           at the beginning of change(), you could initialize fewest_hits
2695           to 1+(previous value of fewest_hits) instead of to the number of
2696           keys.  Thanks again, Nels.
2697
2698         * Replaced alloca with new in the Gen_Perf::change function.
2699           This should eliminate some overhead at the expense of a little
2700           extra memory that is never reclaimed.
2701
2702         * Renamed Gen_Perf::merge_sets to Gen_Perf::compute_disjoint_union
2703           to reflect the change in behavior.
2704
2705         * Added the -e option so users can supply a string containing
2706           the characters used to separate keywords from their attributes.
2707           The default behavior is ",\n".
2708
2709         * Removed the char *uniq_set field from LIST_NODE and modified
2710           uses of uniq_set in perfect.c and keylist.c.  Due to changes
2711           to Gen_Perf::compute_disjoint_sets this field was no longer
2712           necessary, and its removal makes the program smaller and
2713           potentially faster. 
2714           
2715         * Added lots of changes/fixes suggested by Nels Olson
2716           (umls.UUCP!olson@mis.ucsf.edu).  In particular:
2717           1.  Changed Bool_Array so that it would dynamically create
2718               an array of unsigned shorts rather than ints if the 
2719               LO_CAL symbol was defined during program compilation.
2720               This cuts the amount of dynamic memory usage in half,
2721               which is important for large keyfile input.
2722           2.  Added some additional debugging statements that print extra
2723               info to stderr when the -d option is enabled.
2724           3.  Fixed a really stupid bug in Key_List::print_switch
2725               A right paren was placed at the wrong location, which broke
2726               strlen ().
2727           4.  Fixed a subtle problem with printing case values when keylinks
2728               appear.  The logic failed to account for the fact that there
2729               can be keylinks *and* regular node info also!
2730           5.  Changed the behavior of Key_List::read_keys so that it would
2731               honor -D unequivocally, i.e., it doesn't try to turn off dup
2732               handling if the user requests it, even if there are no
2733               immediate links in the keyfile input. 
2734           6.  Modified the -j option so that -j 0 means `try random values
2735               when searching for a way to resolve collisions.'
2736           7.  Added a field `num_done' to the Gen_Perf struct.  This is used
2737               to report information collected when trying to resolve
2738               hash collisions.
2739           8.  Modified the merge_sets algorithm to perform a disjoint
2740               union of two multisets.  This ensures that subsequent
2741               processing in Gen_Perf::affect_prev doesn't
2742               waste time trying to change an associated value that is
2743               shared between two conflicting keywords.
2744           9.  Modified Gen_Perf::affects_prev so that it doesn't try
2745               random jump values unless the -j 0 option is enabled.
2746           10. Fixed a silly bug in Gen_Perf::change.  This problem caused
2747               gperf to seg fault when the -k* option was given and the
2748               keyfile file had long keywords.
2749         
2750 Sun Oct 29 00:18:55 1989  Doug Schmidt  (schmidt at siam.ics.uci.edu)
2751
2752         * Modified class-specific new operations for Read_Line and
2753           List_Node so they don't fail if SIZE is larger than twice
2754           the previous buffer size.  Note we double buffer size
2755           everytime the previous buffer runs out, as a heuristic
2756           to reduce future calls to malloc.
2757
2758 Sun Oct 22 13:49:43 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
2759
2760         * Updated gperf version number to 2.0.  Send to Doug Lea for
2761           incorporation into the long-awaited `official' libg++ 1.36
2762           release! 
2763
2764         * Thanks to Nels Olson a silly bug in Gen_Perf::change ()
2765           was fixed.  This problem caused gperf to seg fault when
2766           the -k* option was given and the keyfile file had long
2767           keywords.
2768           
2769         * Modified Key_List::print_hash_function so that it output
2770           max_hash_value + 1 (rather than just max_hash_value) for
2771           any associated value entries that don't correspond to
2772           keyword charset characters.  This should speed up rejection
2773           of non-keyword strings a little in some cases.
2774
2775 Sat Oct 21 19:28:36 1989  Doug Schmidt  (schmidt at crimee.ics.uci.edu)
2776
2777         * Fixed Key_List::print_hash_function so that it no longer output
2778           things like `return 0 + ...'  Although this probably gets
2779           optimized away by even the worst C compilers there isn't any
2780           point tempting fate... ;-)
2781
2782         * Fixed class List_Node's constructor so that it wouldn't a priori
2783           refuse to consider trying to hash keys whose length is less
2784           than the smallest user-specified key position.  It turns out
2785           this is not a problem unless the user also specifies the -n
2786           (NOLENGTH) option, in which case such keys most likely
2787           don't have a prayer of being hashed correctly!
2788
2789         * Changed the name of the generated lookup table from `Hash_Table'
2790           to `asso_value' to be consistent with the gperf paper.
2791
2792 Tue Oct 17 14:19:48 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
2793
2794         * Added a flag GATHER_STATISTICS in the Makefile.  If defined
2795           during compilation this turns on certain collection facilities
2796           that track the performance of gperf during its execution.  In
2797           particular, I want to see how many collisions occur for the
2798           double hashing Hash_Table.
2799
2800         * Added a safety check so that we don't screw up if the total
2801           number of `resets' of the Bool_Array exceeds MAX_INT.  Since
2802           this number is around 2^31 it is unlikely that this would ever
2803           occur for most input, but why take the risk?
2804
2805         * Changed the behavior for the -a (ANSI) option so that the
2806           generated prototypes use int rather than size_t for the LEN 
2807           parameter.  It was too ugly having to #include <stddef.h> all
2808           over the place...
2809
2810 Mon Oct 16 11:00:35 1989  Doug Schmidt  (schmidt at crimee.ics.uci.edu)
2811
2812         * Continued to work on the gperf paper for the USENIX C++
2813           conference.  At some point this will be merged back into
2814           the gperf documentation...
2815
2816 Sat Oct 14 20:29:43 1989  Doug Schmidt  (schmidt at siam.ics.uci.edu)
2817
2818         * Added a majorly neat hack to Bool_Array, suggested by rfg.
2819           The basic idea was to throw away the Ullman array technique.
2820           The Ullman array was used to remove the need to reinitialize all 
2821           the Bool_Array elements to zero everytime we needed to determine
2822           whether there were duplicate hash values in the keyword list.  
2823           The current trick uses an `iteration number' scheme, which takes
2824           about 1/3 the space and reduces the overall program running a 
2825           time by about 20 percent for large input!  The hack works as 
2826           follows:
2827           
2828           1. Dynamically allocation 1 boolean array of size k.
2829           2. Initialize the boolean array to zeros, and consider the first
2830              iteration to be iteration 1.
2831           2. Then on all subsequent iterations we `reset' the bool array by
2832              kicking the iteration count by 1. 
2833           3. When it comes time to check whether a hash value is currently
2834              in the boolean array we simply check its index location.  If
2835              the value stored there is *not* equal to the current iteration
2836              number then the item is clearly *not* in the set.  In that
2837              case we assign the iteration number to that array's index
2838              location for future reference.  Otherwise, if the item at
2839              the index location *is* equal to the iteration number we've
2840              found a duplicate.  No muss, no fuss!
2841              
2842 Mon Oct  2 12:30:54 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
2843
2844         * Changed some consts in options.h to enumerals, since g++
2845           doesn't seem to like them at the moment!
2846
2847 Sat Sep 30 12:55:24 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
2848
2849         * Fixed a stupid bug in Key_List::print_hash_function that manifested
2850           itself if the `-k$' option was given (i.e., only use the key[length]
2851           character in the hash function).
2852
2853         * Added support for the -C option.  This makes the contents of
2854           all generated tables `readonly'.
2855
2856         * Changed the handling of generated switches so that there is
2857           only one call to str[n]?cmp.  This *greatly* reduces the size of
2858           the generated assembly code on all compilers I've seen.
2859
2860         * Fixed a subtle bug that occurred when the -l and -S option
2861           was given.  Code produced looked something like:
2862
2863           if (len != key_len || !strcmp (s1, resword->name)) return resword;
2864
2865           which doesn't make any sense.  Clearly, this should be:
2866
2867           if (len == key_len && !strcmp (s1, resword->name)) return resword;
2868
2869 Tue Sep 26 10:36:50 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
2870
2871         * Changed class Read_Line's definition so that it no longer
2872           needs to know about the buffering scheme used to speed up 
2873           dynamic memory allocation of input keywords and their
2874           associated attributes.  This means that operator new is no longer
2875           a friend of Read_Line.
2876
2877 Mon Sep 25 23:17:10 1989  Doug Schmidt  (schmidt at crimee.ics.uci.edu)
2878
2879         * Decided that Obstacks had too much overhead, so they were
2880           removed in favor of super-efficient, low-overhead buffered
2881           storage allocation hacks in Read_Line and List_Node.
2882
2883         * No longer try to inline functions that g++ complains about
2884           (Key_List::Merge and Key_List::Merge_Sort).
2885
2886 Sun Sep 24 13:11:24 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
2887
2888         * Changed classes Read_Line and List_Node to use Obstacks in order
2889           to cache memory allocation for keyword strings and List_Nodes.
2890           
2891         * Continued to experiment with inheritance schemes.
2892         
2893         * Added a new file `alpha.h', that declares static data shared
2894           (i.e., inherited) between classes List_Node and Key_List.
2895
2896 Tue Sep 12 16:14:41 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
2897
2898         * Made numerous changes to incorporate multiple inheritance in 
2899           gperf.
2900
2901 Wed Aug 16 23:04:08 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
2902
2903         * Added the -DCOMPILER_FIXED flag to the ./src/Makefile.  This
2904           implies that people trying to compile gperf need to have a
2905           working version of the new g++ compiler (1.36.0).
2906
2907         * Removed some extra spaces that were being added in the generated
2908           C code.
2909
2910 Mon Jul 24 17:09:46 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
2911
2912         * Fixed PRINT_HASH_FUNCTION and PRINT_LOOKUP_FUNCTION in keylist.c
2913           so that the generated functions take an unsigned int length argument.
2914           If -a is enabled the prototype is (const char *str, size_t len).
2915
2916 Fri Jul 21 13:06:15 1989  Doug Schmidt  (schmidt at zola.ics.uci.edu)
2917
2918         * Fixed a typo in PRINT_KEYWORD_TABLE in keylist.cc that prevented
2919           the indentation from working correctly.
2920
2921         * Fixed a horrible typo in PRINT_KEYWORD_TABLE in keylist.cc
2922           that prevented links from being printed correctly.
2923
2924 Tue Jul 18 16:04:31 1989  Doug Schmidt  (schmidt at zola.ics.uci.edu)
2925
2926         * Fixed up readline.cc and readline.h so that they work OK
2927           with g++ compilers that aren't completely up-to-date.
2928           If symbol COMPILER_FIXED is defined then the behavior
2929           that works on my more recent version of g++ is enabled.
2930
2931 Sun Jul  9 17:53:28 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
2932
2933         * Changed the ./tests subdirectory Makefile so that it 
2934           uses $(CC) instead of gcc.
2935
2936 Sun Jul  2 21:52:15 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
2937
2938         * Fixed a number of subtle bugs that occurred when -S was
2939           combined with various and sundry options.
2940
2941         * Added the -G option, that makes the generated keyword table
2942           a global static variable, rather than hiding it inside
2943           the lookup function.  This allows other functions to directly
2944           access the contents in this table.
2945
2946         * Added the "#" feature, that allows comments inside the keyword
2947           list from the input file. Comment handling takes place in readline.c.  
2948           This simplifies the code and reduces the number of malloc calls.
2949           
2950         * Also added the -H option (user can give the name of the hash
2951           function) and the -T option (prevents the transfer of the type decl
2952           to the output file, which is useful if the type is already defined
2953           elsewhere).
2954
2955 Thu Jun 22 20:39:39 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
2956
2957         * Modified many classes so that they would inherit Std_Err as
2958           a base class.  This makes things more abstract...
2959
2960 Fri Jun 16 14:23:00 1989  Doug Schmidt  (schmidt at zola.ics.uci.edu)
2961
2962         * Modified the -f (FAST) option.  This now takes an argument.
2963           The argument corresponds to the number of iterations used
2964           to resolve collisions.  -f 0 uses the length of the
2965           keyword list (which is what -f did before).  This makes
2966           life much easier when dealing with large keyword files.
2967
2968 Tue Jun  6 17:53:27 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
2969
2970         * Added the -c (comparison) option.  Enabling this
2971           will use the strncmp function for string comparisons.
2972           The default is to use strcmp.
2973
2974         * Fixed a typo in key_list.cc (PRINT_SWITCH).  This caused
2975           faulty C code to be generated when the -D, -p, and -t
2976           options were all enabled.
2977
2978 Thu May 25 14:07:21 1989  Doug Schmidt  (schmidt at siam.ics.uci.edu)
2979
2980         * Once again, changed class Read_Line to overload global operator
2981           new.  Hopefully, this will work...!
2982
2983 Sun May 21 01:51:45 1989  Doug Schmidt  (schmidt at crimee.ics.uci.edu)
2984
2985         * Modified Key_List::print_hash_function () so that it properly
2986           formats the associated values in the hash table according to
2987           the maximum number of digits required to represent the largest
2988           value.
2989
2990         * Removed the named return value from class Hash_Table's
2991           operator (), since this causes a seg fault when -O is enabled.
2992           No sense tripping subtle g++ bugs if we don't have to.... ;-)
2993
2994         * Removed the operator new hack from Read_Line, since this seemed
2995           to create horrible bus error problems.
2996                     
2997         * Changed many class member functions and data members to be `static', 
2998           if they don't manipulate this!
2999           
3000 Fri May 12 23:06:56 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
3001
3002         * Changed class Std_Err to use static member functions, a la
3003           Ada or Modula 2.  This eliminates the need for an explicit
3004           error-handler class object.
3005
3006         * Added the ``named return value'' feature to Hash_Table::operator ()
3007           and Bool_Array::operator [], just for the heck of it.... ;-)
3008
3009         * Changed the previous hack in Read_Line so that we now use
3010           the overloaded global `new' instead of NEW_STRING!
3011
3012 Wed May  3 17:36:55 1989  Doug Schmidt  (schmidt at zola.ics.uci.edu)
3013
3014         * Updated to version 1.7.  This reflects the recent major changes
3015           and the new C port.
3016
3017         * Modified the GNU getopt.cc routine to have a class-based interface.
3018
3019         * Fixed a typo in Perfect.cc ~Perfect that prevented the actual maximum
3020           hash table size from being printed (maybe the stream classes
3021           weren't so bad after all.... ;-).
3022
3023         * Added support for the -f option.  This generates the perfect
3024           hash function ``fast.''  It reduces the execution time of
3025           gperf, at the cost of minimizing the range of hash values.
3026
3027 Tue May  2 16:23:29 1989  Doug Schmidt  (schmidt at crimee.ics.uci.edu)
3028
3029         * Added an efficiency hack to Read_Line.  Instead of making
3030           a call to operator NEW (a.k.a. malloc) for each input string
3031           a new member function NEW_STRING stores a large buffer from
3032           which new strings are carved out, growing the buffer if
3033           necessary.  It might be useful to add this throughout the
3034           program....
3035
3036         * Removed all unnecessary calls to DELETE.  If the program is about
3037           to exit it is silly to waste time freeing memory.
3038
3039         * Added the GNU getopt program to the distribution.  This makes
3040           GPERF portable to systems that don't include getopt in libc.
3041           
3042         * Added a strcspn member to class Key_List.  This also increases
3043           portability.
3044
3045         * Added the get_include_src function from keylist.c as a member
3046           function in class Key_List.  Hopefully every function is 
3047           now associated with a class.  This aids abstraction and
3048           modularity.
3049
3050         * Ported gperf to C.  From now on both K&R C and GNU G++ versions
3051           will be supported.  There will be two ChangeLog files, one
3052           for each version of the program.
3053
3054 Mon May  1 16:41:45 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
3055
3056         * Fixed a bug with -k'*'.  This now prints out *all* the cases
3057           up to the length of the longest word in the keyword set.
3058
3059 Sun Apr 30 12:15:25 1989  Doug Schmidt  (schmidt at crimee.ics.uci.edu)
3060
3061         * Removed all use of the stream classes.  Too ugly, slow, and
3062           not handled by the c++-mode formatter....
3063
3064         * Modified the handling of links (i.e., keywords that have
3065           identical hash values as other keywords).  This should 
3066           speed up hash function generation for keyword sets with
3067           many duplicate entries.  The trick is to treat duplicate
3068           values as equivalence classes, so that each set of duplicate
3069           values is represented only once in the main list processing.
3070
3071         * Fixed some capitialization typos and indentations mistakes in 
3072           Key_List::print_hash_function.
3073
3074 Sat Apr 29 12:04:03 1989  Doug Schmidt  (schmidt at zola.ics.uci.edu)
3075
3076         * Fixed a typo/logico in Key_List::print_switch that prevented
3077           the last keyword in the keyword list to be print out.  This
3078           requires further examination.....
3079
3080         * Fixed a stupid bug in List_Node::List_node.  If the -k'*' option
3081           was enabled the KEY_SET string wasn't getting terminated with
3082           '\0'!
3083
3084 Fri Apr 28 12:38:35 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
3085
3086         * Renamed strexp.h and strexp.cc to iterator.h and iterator.cc.
3087           Also changed the strexp class to iterator.  Continued to work
3088           on style...
3089
3090         * Updated the version number to 1.6.  This reflects all the 
3091           recent changes.
3092
3093 Thu Apr 27 00:14:51 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
3094
3095         * Added the -D option that properly handles keyword sets that
3096           contain duplicate hash values.
3097
3098         * Continued the stylistic changes.  Added the #pragma once
3099           directive to all the *.h files.  Removed all #defines and
3100           replaced them with static consts.  Also moved the key_sort
3101           routine from options.cc into the options class as a 
3102           member function.
3103
3104 Mon Apr  3 13:26:55 1989  Doug Schmidt  (schmidt at zola.ics.uci.edu)
3105
3106         * Made massive stylistic changes to bring source code into
3107           conformance with GNU style guidelines.
3108
3109 Thu Mar 30 23:28:45 1989  Doug Schmidt  (schmidt at crimee.ics.uci.edu)
3110
3111         * Fixed up the output routines so that they generate code
3112           corresponding to the GNU style guidelines.
3113
3114 Sat Mar 11 13:12:37 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
3115
3116         * Fixed Stderr constructors so that they wouldn't try to
3117           use the base class initializer syntax for the static 
3118           class variable Program_Name.  G++ 1.34 is stricter in
3119           enforcing the rules!
3120
3121 Fri Mar 10 11:24:14 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
3122
3123         * Removed -v and ``| more'' from the Makefile to keep rfg happy...
3124
3125 Thu Mar  2 12:37:30 1989  Doug Schmidt  (schmidt at crimee.ics.uci.edu)
3126
3127         * Sent latest GNU gperf version 1.5 to Doug Lea for inclusion
3128           into libg++ 1.34.  Note that there is a small bug with
3129           the new %{ ... %} source inclusion facility, since it doesn't
3130           understand comments and will barf if %{ or %} appear nested
3131           inside the outermost delimiters.  This is too trivial of
3132           a defect to fix at the moment...
3133
3134 Tue Feb 28 11:19:58 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
3135
3136         * Added the -K option, which allows the user to provide a
3137           alternative name for the keyword structure component.
3138           The default is still ``name.''
3139
3140         * Added the LEX and YACC-like ability to include arbitrary
3141           text at the beginning of the generated C source code output.
3142           This required two new functions Get_Special_Input, 
3143           Key_List::Save_Include_Src;
3144
3145         * Fixed memory allocation bug in Key_List::Set_Types.
3146           Variable Return_Type needs 1 additional location
3147           to store the "*" if the -p option is used.
3148           
3149         * Added code to NULL terminate both Struct_Tag and Return_Type,
3150           *after* the strncpy (stupid mistake).
3151           
3152 Mon Feb 27 14:39:51 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
3153
3154         * Added a new option -N.  This allows the user to specify the
3155           name to be used for the generated lookup function.  The
3156           default name is still ``in_word_set.''  This makes it
3157           possible to completely automate the perfect hash function
3158           generation process!
3159
3160 Mon Feb 20 23:33:14 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
3161
3162         * Corrected the Hash_Table::operator () function so that
3163           *it* is responsible for deciding when a new key has the
3164           same signature as a previously seen key.  The key length 
3165           information is now used internally to this function to
3166           decide whether to add to the hash table those keys with
3167           the same key sets, but different lengths.  Before, this
3168           was handled by the Key_List::Read_Keys function.  However,
3169           this failed to work for certain duplicate keys, since
3170           they weren't being entered into the hash table properly.
3171
3172 Sun Feb 19 16:02:51 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
3173
3174         * Modified class Options by moving the enum Option_Type out
3175           of the class.  This is to satisfy the new enumeration
3176           scope rules in C++.
3177
3178 Sun Jan 15 15:12:09 1989  Doug Schmidt  (schmidt at crimee.ics.uci.edu)
3179
3180         * Incremented the version number upto 1.4 to reflect the new 
3181           options that affect the generated code.  Send the new 
3182           distribution off to Michael for use with g++ 1.33.
3183
3184         * Added a fix to Key_List::Read_Keys so that it checks for links
3185           properly when the -n option is used.  Previously, it didn't
3186           catch obvious links, which caused it to spend large amount
3187           of time searching for a solution that could never occur!
3188
3189         * Modified the Key_List data structure to record *both* the 
3190           minimum and the maximum key lengths.  This information
3191           is now computed in Key_List::Read_Keys, and thus 
3192           Key_List::Print_Min_Max doesn't need to bother.
3193
3194         * Modifed the key position iterator scheme in options.cc to
3195           eliminate the need for member function Options::Advance.
3196           Now, the Options::Get function performs the advancement
3197           automatically, obviating the need for an extra function call.
3198
3199         * Added the new function Options::Print_Options, to print out
3200           the user-specified command line options to generated C
3201           output file.
3202
3203         * Added a new function, Key_List::Print_Keylength_Table,
3204           which creates a table of lengths for use in speeding
3205           up the keyword search.  This also meant that a new
3206           option, -l (LENTABLE) is recognized.  It controls 
3207           whether the length table is printed and the comparison
3208           made in the generated function ``in_word_set.''
3209
3210         * Added a comment at the top of the generated C code
3211           output file that tells what version of gperf was used.
3212           Next, I'll also dump out the command line options
3213           as a comment too.  Thanks to Michael Tiemann for the
3214           feedback on this.
3215
3216         * Fixed the -n option to make it work correctly with
3217           other parts of the program (most notably the Perfect::Hash
3218           function and the computation of minimum and maximum lengths.
3219
3220 Fri Jan 13 21:25:27 1989  Doug Schmidt  (schmidt at siam.ics.uci.edu)
3221
3222         * Realized the the need to add a test that will enable
3223           optimziation of the generated C code in the ``hash'' function
3224           by checking whether all the requested key positions are
3225           guaranteed to exist due to the comparison in `in_word_set.''
3226           I'll put this in soon....
3227
3228 Thu Jan 12 20:09:21 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
3229
3230         * Added pascal, modula3, and modula2 tests inputs to the 
3231           Makefile
3232         
3233         * Recognised that there is a bug with the -n option.  However
3234           I'm too busy to fix it properly, right now.  The problem 
3235           is that the generated #define end up being 0, since that's
3236           my hack to make -n work.  This needs complete rethinking!
3237
3238 Tue Jan 10 00:08:16 1989  Doug Schmidt  (schmidt at crimee.ics.uci.edu)
3239
3240         * Added a new option, -n, that instructs gperf to not use the
3241           length of an identifier when computing the hash functions.
3242           I'm not sure how useful this is!
3243           
3244         * Retransmitted the distribution to rocky.oswego.edu.  Hopefully,
3245           this will work!
3246
3247         * Began fixing the indentation and capitalization to conform
3248           to the GNU coding guidelines.
3249
3250 Mon Jan  9 22:23:18 1989  Doug Schmidt  (schmidt at pompe.ics.uci.edu)
3251
3252         * Fixed horrible bug in Read_Line::Readln_Aux.  This was
3253           a subtle and pernicous off-by-1 error, that overwrote
3254           past the last character of the input string buffer.  I
3255           think this fault was killing the vax!
3256
3257         * Yow, fixed an oversight in List_Node::List_Node, where the
3258           pointer field Next was uninitialized.  Luckily, the new routine
3259           seems to return 0 filled objects the first time through!
3260
3261 Sun Jan  8 13:43:14 1989  Doug Schmidt  (schmidt at crimee.ics.uci.edu)
3262
3263         * Modified the ``key linked'' diagnostic in Key_List::Read_Keys
3264           to be more helpful and easy to read.
3265
3266         * Fixed the List_Node::List_Node so that it would ignore trailing
3267           fields if the -t option was not enabled.
3268
3269         * Moved the List_Node declarations out of keylist.h and
3270           into a file of its own, called listnode.cc and listnode.h
3271           Made Set_Sort a member function of class List_Node.
3272
3273         * Massively updated the documentation in the gperf.texinfo file.
3274         
3275         * Polished off the major revision to the print functions,
3276           added a few new tests in the Makefile to check for the
3277           validity of the program and ftp'ed the entire distribution
3278           off to Doug Lea for libg++. ( changed it to
3279           1.3 to reflect the major changes with the generated
3280           C code ).
3281
3282         * Fixed Key_List::Print_Switch to deal with the -p and -t options.
3283           This meant that the ``still-born'' function Key_List::
3284           Print_Type_Switch was superflous, so I removed it.
3285           Also, removed the restriction in Option that the -p and
3286           -t options couldn't be used simultaneously.
3287
3288         * Modified List_Node::List_Node, to perform only 1 call to 
3289           ``new'' when dynamically allocating memory for the Key_Set
3290           and the Uniq_Set.
3291
3292 Sat Jan  7 14:10:51 1989  Doug Schmidt  (schmidt at glacier.ics.uci.edu)
3293
3294         * Fixed a big bug with the new policy of nesting the
3295           wordlist inside of generated function ``in_word_set.''
3296           I'd forgotten to declare the wordlist array as static!
3297           ( arrgh ).
3298
3299         * Added a new function Key_List::Set_Types, that figures out
3300           the return type for generated function ``in_word_set,''
3301           the user-defined ``struct tag,'' if one is used, and also
3302           formates the array type for the static local array.
3303
3304         * Changed the print routines to take advantage of the
3305           new -p option.
3306
3307         * Began adding the hooks to allow the return of a pointer
3308           to a user defined struct location from the generated
3309           ``in_word_set'' function instead of the current 0 or 1
3310           return value.  Created function Key_List::Print_Type_Switch
3311           and added option -p to class Option, allowing the user to 
3312           request generation of the aforementioned pointers returned 
3313           instead of booleans.
3314
3315         * Put in checks in class Option to make sure that -S and -t
3316           options are not used simultaneously.  This restriction
3317           will be removed in subsequent releases, once I decide on
3318           a clean way to implement it.
3319
3320         * Sent version 1.2 to Doug Lea for possible inclusion into
3321           the libg++ distribution.
3322           
3323         * Moved the static word_list array inside the generated function
3324           in_word_set.  This supports better data hiding.
3325
3326         * Added a texinfo file, gperf.texinfo
3327           
3328         * Revised the Makefile to cleanup the droppings from texinfo
3329           and changed the name of gperf.cc and gperf.h to perfect.cc
3330           and perfect.h.
3331
3332 Fri Jan  6 13:04:45 1989  Doug Schmidt  (schmidt at crimee.ics.uci.edu)
3333
3334         * Implemented the switch statement output format.  Much better
3335           for large datasets in terms of space used.
3336
3337         * Added new functions to break up the Key_List::Output function.
3338           Functions added were Key_List::Print_Switch, Key_List::Print_Min_Max,
3339           Key_List::Print_Keyword_Table, Key_List::Print_Hash_Function,
3340           and Key_List::Print_Lookup_Function.  This simplifies the
3341           big mess in Key_List::Output considerably!
3342           
3343         * Added switch statement option to Options, which potentially 
3344           trades time for space in the generated lookup code.
3345
3346 Thu Jan  5 22:46:34 1989  Doug Schmidt  (schmidt at siam.ics.uci.edu)
3347
3348         * Released version 1.1
3349         
3350         * Fixed a bug with Gperf::Merge_Set, it was skipping letters shared
3351           between the Set_1 and Set_2.
3352
3353         * Added the optimal min/max algorithm in Key_List::Output.  This
3354           runs in O ( 3n/2 ), rather than O ( 2n ) time.
3355
3356         * Changed Gperf::Sort_Set to use insertion sort, rather than
3357           bubble sort.
3358         
3359         * Added a check in Key_List::Output for the special case where
3360           the keys used are 1,$.  It is possible to generate more
3361           efficient C code in this case.