Debian Codegraph @

subprojects/gperf/ChangeLog

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