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