ChangeLog revision 58551
158551SkrisSat May 2 12:31:51 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de> 218214Speter 358551Skris * src/version.cc (version_string): Remove the "(C++ version)" suffix. 458551Skris It's redundant: the early C versions of gperf are called cperf. 558551Skris Reported by Karl Berry. 658551Skris * src/option.cc (Options::operator()): Trim the output of "gperf -v". 758551Skris 858551SkrisThu Apr 16 13:22:16 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de> 958551Skris 1058551Skris * lib/Makefile.in, src/Makefile.in: Don't use $(TARGET_ARCH). 1158551Skris Solaris "make" sets it to a value not understood by "cc". 1258551Skris 1358551SkrisWed Apr 15 23:52:14 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de> 1458551Skris 1558551Skris * lib/Makefile.in, src/Makefile.in: Don't use implicit rules. Don't 1658551Skris use $<. AIX "make" and OSF/1 "make" have problems with both. 1758551Skris * src/gen-perf.cc, src/key-list.cc: Cast free() argument to char*, 1858551Skris otherwise it doesn't compile on SunOS 4. 1958551Skris * src/key-list.h: Declare structs outside of other declarations, 2058551Skris needed for OSF/1 cxx 5.5. 2158551Skris * lib/getopt.h: Use prototypes if __STDC__ || __cplusplus. 2258551Skris Don't give a prototype for getopt(), to avoid error on SunOS 4. 2358551Skris * lib/getopt.c: Declare strncmp, to avoid warnings. 2458551Skris 2558551SkrisTue Apr 14 23:24:07 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de> 2658551Skris 2758551Skris * lib/GetOpt.{h,cc}: Remove files. 2858551Skris * lib/getopt.{h,c}, lib/getopt1.c: New files, from GNU libc. 2958551Skris * lib/configure.in (AC_INIT): Search for hash.cc, not GetOpt.cc. 3058551Skris * lib/Makefile.in (OBJECTS): Remove GetOpt.o, add getopt.o, getopt1.o. 3158551Skris (getopt.o, getopt1.o, hash.o): Use explicit building rules. Some 3258551Skris "make"s don't support to have both implicit rules for "%.o : %.c" 3358551Skris and "%.o : %.cc" in the same Makefile. 3458551Skris * lib/hash.{h,cc}: Remove #pragma; there are no templates here. 3558551Skris * src/option.h (Options::usage): Remove. 3658551Skris (Options::short_usage, Options::long_usage): Declare. 3758551Skris * src/option.cc (Options::usage): Remove. 3858551Skris (Options::short_usage, Options::long_usage): New functions. 3958551Skris (long_options): New array. 4058551Skris (Options::operator()): Use getopt_long instead of GetOpt::operator(), 4158551Skris change all references to GetOpt members. 4258551Skris 4358551Skris * src/std-err.{h,cc}: Remove files. 4458551Skris * src/gen-perf.cc, src/key-list.cc, list-node.cc, new.cc, options.cc: 4558551Skris Call fprintf(stderr) instead of Std_Err::report_error(). 4658551Skris * src/key-list.h, src/list-node.h, src/options.h: Don't use class 4758551Skris Std_Err any more. 4858551Skris * src/option.cc (program_name): New variable. 4958551Skris * src/Makefile.in: Remove STD_ERR_H. 5058551Skris (OBJECTS): Remove std-err.o. 5158551Skris 5258551SkrisMon Mar 23 01:03:35 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de> 5358551Skris 5458551Skris * aclocal.m4, {lib,src,tests}/configure.in: Remove CL_CC_WORKS and 5558551Skris CL_CXX_WORKS, already contained in autoconf 2.12. 5658551Skris 5758551Skris * src/gen-perf.cc, src/key-list.cc: Move some code from 5858551Skris Gen_Perf::Gen_Perf() to Key_List::output(). 5958551Skris * src/Makefile.in: Update dependencies. 6058551Skris 6158551Skris * src/options.{h,cc}: Remove option "-p". 6258551Skris * src/key-list.cc (Key_List::set_output_types): Rewrite. 6358551Skris (default_array_type, default_return_type): Remove. 6458551Skris * src/key-list.cc: Adjust "const" handling. 6558551Skris + With option "-t" [TYPE], don't emit wrong code if there is no 6658551Skris space before the struct's opening brace. 6758551Skris 6858551SkrisSun Mar 22 16:59:15 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de> 6958551Skris 7058551Skris * src/key-list.{h,cc}: Completely reorganized the output routines. 7158551Skris Rewrote from scratch the output_switch() function. Use classes 7258551Skris (Output_Constants, Output_Expr, Output_Compare) for abstraction. 7358551Skris In particular: 7458551Skris + Don't emit trailing whitespace and spurious blank lines. 7558551Skris + Adjust indentation of the arrays. 7658551Skris + Don't emit commas at the end of array initializers and 7758551Skris struct initializers. 7858551Skris + With option "-l" [LENTABLE], compare the length before 7958551Skris fetching the word from memory. 8058551Skris + With option "-S" [SWITCH], emit the comparison code just once, 8158551Skris not once in every switch statement. 8258551Skris + With option "-S" [SWITCH], choose the right switch statement 8358551Skris through a binary search, not a linear search. 8458551Skris + With option "-S" [SWITCH], emit straightforward comparisons 8558551Skris instead of switch statements with just one "case" label. 8658551Skris + With options "-S -p -t" [SWITCH, POINTER, TYPE], don't emit 8758551Skris spurious empty elements at the beginning of the wordlist array. 8858551Skris + With option "-D" [DUP] and not option "-S" [SWITCH], if there 8958551Skris is no more room for duplicate entries in the lookup array, 9058551Skris don't call `assert (i != 0)'. Instead, make the array larger :-) 9158551Skris + With option "-D" [DUP], if there are no duplicates, don't 9258551Skris automatically fall back to the non-"-D" algorithm. If the user 9358551Skris wants the non-"-D" algorithm, he can just not specify "-D". 9458551Skris + With option "-D" [DUP] and either options "-p -t" [POINTER, TYPE] 9558551Skris or not option "-S" [SWITCH], don't emit spurious empty elements 9658551Skris at the beginning of the wordlist array. 9758551Skris + With option "-D" [DUP], simplify the detection and processing 9858551Skris of duplicate entries in the lookup array. 9958551Skris + With options "-D -l" [DUP, LENTABLE] and not option "-S" [SWITCH], 10058551Skris don't forget to emit the lengthtable array. 10158551Skris + With options "-D -l -S" [DUP, LENTABLE, SWITCH], don't forget to 10258551Skris compare the lengths before comparing the strings. 10358551Skris 10458551Skris * src/gen-perf.cc: No need to include <assert.h>. 10558551Skris * src/options.cc: Likewise. 10658551Skris 10758551Skris * src/options.cc: Don't use `errno' after freopen failed. 10858551Skris * src/std-err.cc: `report_error' doesn't call strerror(errno) any 10958551Skris more. No need to include <string.h> and <errno.h>. 11058551Skris 11158551Skris * tests/Makefile.in (check-*): Any difference between .exp and .out 11258551Skris is a failure. Don't ignore whitespace differences. 11358551Skris 11458551Skris * tests/Makefile.in (check-lang-syntax): Add some more checks. 11558551Skris 11658551SkrisFri Mar 20 00:54:54 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de> 11758551Skris 11858551Skris * tests/jscript.gperf: Renamed from tests/javascript.gperf, because 11958551Skris of Minix and SVR2 14-character filename limit. 12058551Skris * src/key-list.cc (output_string): New function. 12158551Skris (Key_List::output_switch, Key_List::output_keyword_table): Call it. 12258551Skris 12358551Skris * src/options.{h,icc,cc} (get_wordlist_name): New function. Add 12458551Skris option -W. 12558551Skris * src/key-list.cc (Key_List::output_switch, 12658551Skris Key_List::output_keyword_table, Key_List::output_lookup_function): 12758551Skris Use it. 12858551Skris Patch from William Bader <wbader@CSEE.Lehigh.Edu>. 12958551Skris 13058551Skris * src/version.cc: Bump version number directly from 2.5 to 2.7, 13158551Skris because Schmidt's last release from 1991 carries version number 2.6. 13258551Skris 13358551SkrisTue Jul 30 00:02:39 1991 Douglas C. Schmidt (schmidt at net4.ics.uci.edu) 13458551Skris 13558551Skris * Fixed a small bug in the Key_List::output_keyword_table routine 13658551Skris that caused an extra newline to be printed if there where no 13758551Skris leading blank entries... (who cares, right?!) 13858551Skris 13958551SkrisMon Jul 29 22:05:40 1991 Douglas C. Schmidt (schmidt at net4.ics.uci.edu) 14058551Skris 14158551Skris * Modified the handling of the -E (emit enums rather than 14258551Skris #defines) option in conjunction with the -G option. Now, if -G 14358551Skris and -E are given the enums are generated outside the lookup 14458551Skris function, rather than within it! 14558551Skris 14658551SkrisMon Apr 8 18:17:04 1991 Doug Schmidt (schmidt at net4.ics.uci.edu) 14758551Skris 14858551Skris * Yucko, there was a bug in the handling of -c (and of course the 14958551Skris new -I command in key-list.cc). Apparently when I added the 15058551Skris super-duper hack that provided support for duplicate keys I 15158551Skris forgot to update the strcmp output... 15258551Skris 15358551SkrisMon Mar 9 02:19:04 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de> 15458551Skris 15558551Skris * Moved the documentation to doc/, put the stuff borrowed from 15658551Skris libg++ into lib/. 15758551Skris * Rewrote all Makefile.in's for better compliance with GNU standards. 15858551Skris * Autoconf based configuration. Rewrote all configure.in's. Added 15958551Skris aclocal.m4, with macros from CLISP and CLN. Added Makefile.devel. 16058551Skris * src/depend: Removed. Dependencies are now in src/Makefile.in. 16158551Skris 16258551Skris * src/bool-array.icc: New file, contains inline functions, from both 16358551Skris src/bool-array.h and src/bool-array.cc. 16458551Skris * src/options.icc: New file, contains inline functions, from both 16558551Skris src/options.h and src/options.cc. 16658551Skris * src/read-line.icc: New file, contains inline functions, from both 16758551Skris src/read-line.h and src/read-line.cc. 16858551Skris 16958551Skris * src/bool-array.h: Don't include <std.h>. 17058551Skris * src/bool-array.cc: Include <string.h>. 17158551Skris * src/gen-perf.cc: No need to include <ctype.h>. Don't include 17258551Skris <_G_config.h>. 17358551Skris * src/hash-table.cc: Don't include <std.h> and <builtin.h>. Include 17458551Skris <string.h> and lib/hash.h instead. 17558551Skris * src/iterator.cc: Don't include <std.h>. 17658551Skris * src/key-list.cc: Don't include <builtin.h>. Include <string.h> and 17758551Skris <stdlib.h> instead. 17858551Skris * src/list-node.cc: Don't include <std.h>. Include <stdlib.h> instead. 17958551Skris Remove `index' hack. 18058551Skris * src/main.cc: Don't include <_G_config.h>. 18158551Skris * src/new.cc: Don't include <std.h>. Include <stdlib.h> instead. 18258551Skris * src/options.cc: Don't include <builtin.h>. Include <string.h> and 18358551Skris <stdlib.h> instead. 18458551Skris * src/read-line.cc: Don't include <builtin.h>. Include <stdlib.h> 18558551Skris instead. 18658551Skris * src/std-err.cc: Don't include <std.h>. Include <string.h> (for Irix). 18758551Skris * src/vectors.h: No need to include <stdio.h>. 18858551Skris * src/version.cc: No need to include <stdio.h>. 18958551Skris 19058551Skris * src/bool-array.h: Change `STORAGE_TYPE' from int to unsigned int. 19158551Skris * src/bool-array.{h,cc}: Change type of `Bool_Array::size' from int 19258551Skris to unsigned int. 19358551Skris * src/bool-array.{h,cc}: Change type of `Bool_Array::init' argument 19458551Skris from STORAGE_TYPE to unsigned int. 19558551Skris * src/gen-perf.{h,cc}: Change two `Gen_Perf::compute_disjoint_union' 19658551Skris argument types from `char *' to `const char *'. 19758551Skris * src/iterator.h: Change type of `Iterator::str' and argument of 19858551Skris `Iterator::Iterator' from `char *' to `const char *'. 19958551Skris * src/iterator.cc: Cast to `unsigned char' before calling `isdigit'. 20058551Skris * src/key-list.{h,cc}: Change type of `Key_List::array_type', 20158551Skris `Key_List::return_type', `Key_List::struct_tag', 20258551Skris `Key_List::include_src', `default_array_type', `default_return_type' 20358551Skris and return type of `Key_List::get_array_type', 20458551Skris `Key_List::get_special_input', `Key_List::save_include_src' from 20558551Skris `char *' to `const char *'. 20658551Skris * src/key-list.cc: Change "pretty gross" assignment. 20758551Skris * src/key-list.cc: Don't use `alloca', HP-UX CC lacks it. 20858551Skris * lib/GetOpt.cc: Likewise. 20958551Skris * src/key-list.cc (merge): Use iteration instead of recursion. 21058551Skris * src/list-node.{h,cc}: Change type of `List_Node::key', 21158551Skris `List_Node::rest', `List_Node::char_set' from `char *' to 21258551Skris `const char *'. 21358551Skris * src/new.cc: Don't use BUFSIZ. Conditionalize the throw() declaration. 21458551Skris * src/read-line.h: Don't use BUFSIZ. 21558551Skris * src/read-line.cc: Make CHUNK_SIZE a constant, and use allocate the 21658551Skris buffers on the stack by default. Use memcpy for copying buffers. 21758551Skris Include <string.h>. 21858551Skris * src/read-line.icc (get_line): Use iteration instead of tail recursion. 21958551Skris Don't call ungetc(EOF,stdin). 22058551Skris * src/std-err.{h,cc}: Change type of `Std_Err::program_name' and of 22158551Skris argument `Std_Err::report_error' from `char *' to `const char *'. 22258551Skris * src/std-err.cc: `report_error' doesn't call `exit' any more. All 22358551Skris callers changed to do that themselves. 22458551Skris * src/trace.h: Make constructor/destructor calls non-inline. 22558551Skris 22658551Skris * src/key-list.cc (output_hash_function): If option[CPLUSPLUS], 22758551Skris always make the hash function inline. 22858551Skris (output): Declare the hash function inline, with the right name. 22958551Skris * src/options.{h,cc}, src/gen-perf.cc, src/key-list.cc: Remove 23058551Skris options -g, making it on by default. Remove option -a. Instead, 23158551Skris introduce "-L KR-C", "-L C", "-L ANSI-C", "-L C++". 23258551Skris * src/options.{h,cc}, src/key-list.cc: Add option -I. 23358551Skris * src/key-list.cc: Don't emit "const" if compiling in mode "-L KR-C". 23458551Skris * src/key-list.cc: Don't emit a comma at the end of an enum list. 23558551Skris * src/main.cc: Remove COUNT_TIME code. 23658551Skris * src/vectors.h, src/key-list.cc, src/options.cc, src/list-node.cc: 23758551Skris ALPHA_SIZE defaults to 256 now. Add option -7. 23858551Skris 23958551Skris * tests/javascript.gperf: New file. 24058551Skris * tests/jstest*.gperf, tests/validate: New tests. 24158551Skris 24258551SkrisSat Jan 31 01:38:11 1998 Alexandre Oliva <oliva@dcc.unicamp.br> 24358551Skris 24458551Skris * src/Makefile.in ($(TARGETPROG)): Add $(CFLAGS). 24558551Skris 24658551SkrisWed Jan 28 01:56:00 1998 Manfred Hollstein <manfred@s-direktnet.de> 24758551Skris 24858551Skris * configure.in (package_makefile_rules_frag): New and 24958551Skris redirect stderr from ${srcdir}/config.shared to 25058551Skris ${package_makefile_rules_frag}. 25158551Skris * src/configure.in: Ditto. 25258551Skris * tests/configure.in: Ditto. 25358551Skris 25458551SkrisFri Jan 23 08:00:41 1998 H.J. Lu (hjl@gnu.org) 25558551Skris 25658551Skris * gperf.texi (@ichapter): Changed to @chapter. 25758551Skris 25858551SkrisWed Jan 14 09:16:48 1998 H.J. Lu (hjl@gnu.org) 25958551Skris 26058551Skris * src/key-list.cc, src/key-list.h (Key_List::strcspn): Don't 26158551Skris define if strcspn is defined. 26258551Skris 26358551SkrisFri Jan 24 13:23:47 1997 Mike Stump <mrs@cygnus.com> 26458551Skris 26558551Skris * src/new.cc (operator delete): Add the exception specification. 26658551Skris 26758551SkrisMon Feb 5 19:29:16 1996 Per Bothner <bothner@kalessin.cygnus.com> 26858551Skris 26958551Skris * src/read-line.cc (Read_Line::readln_aux): Handle EOF if last line 27058551Skris has a length which is an exact multiple of CHUNK_SIZE. (Used to throw 27158551Skris away the line's contents.) From Bruno Haible <haible@ilog.ilog.fr>. 27258551Skris * src/Makefile.in ($(TARGETPROG)): Add -lm to link line. 27358551Skris 27458551SkrisTue Jun 11 13:43:50 1996 Brendan Kehoe <brendan@lisa.cygnus.com> 27558551Skris 27658551Skris * src/list-node.cc (List_Node): Reorder init of nodes to 27758551Skris match declaration order. 27858551Skris * src/hash-table.cc (Hash_Table): Likewise. 27958551Skris 28058551SkrisTue Oct 10 16:37:28 1995 Mike Stump <mrs@cygnus.com> 28158551Skris 28258551Skris * src/new.cc: Since malloc/delete are not paired, we cannot call 28358551Skris free. 28458551Skris 28558551SkrisWed Jan 4 12:40:14 1995 Per Bothner <bothner@kalessin.cygnus.com> 28658551Skris 28758551Skris * src/Makefile.in ($(TARGETPROG)): Link with $(LDFLAGS). 28858551Skris Patch from John Interrante <interran@uluru.stanford.edu>. 28958551Skris 29058551SkrisSat Nov 5 19:12:48 1994 Jason Merrill (jason@phydeaux.cygnus.com) 29158551Skris 29258551Skris * src/Makefile.in (LIBS): Remove. 29358551Skris 29458551SkrisTue Oct 18 17:51:14 1994 Per Bothner <bothner@kalessin.cygnus.com> 29558551Skris 29658551Skris * src/std-err.cc: Use stderror, instead of the non-standard 29758551Skris sys_nerr and sys_errlist. 29858551Skris 29958551SkrisSat Sep 17 22:02:13 1994 Per Bothner (bothner@kalessin.cygnus.com) 30058551Skris 30158551Skris * src/key-list.cc (output_hash_function): 30258551Skris Patch from William Bader <wbader@CSEE.Lehigh.Edu>. 30358551Skris 30458551SkrisFri Jul 15 09:38:11 1994 Per Bothner (bothner@cygnus.com) 30558551Skris 30658551Skris * src/std-err.cc: #include <errno.h>, and only declare 30758551Skris extern int errno if errno is not a macro. 30858551Skris 30958551SkrisMon May 30 17:29:34 1994 Per Bothner (bothner@kalessin.cygnus.com) 31058551Skris 31158551Skris * Makefile.in (src_all, install): Make sure to add '/' after 31258551Skris `pwd` in $rootme, as expected by FLAGS_TO_PASS. 31358551Skris 31458551SkrisWed May 11 00:47:22 1994 Jason Merrill (jason@deneb.cygnus.com) 31558551Skris 31658551Skris Make libg++ build with gcc -ansi -pedantic-errors 31758551Skris * src/options.h: Lose commas at end of enumerator lists. 31858551Skris 31958551SkrisSun Dec 5 19:16:40 1993 Brendan Kehoe (brendan@lisa.cygnus.com) 32058551Skris 32158551Skris * src/hash-table.cc (Hash_Table::~Hash_Table): Don't pass an 32258551Skris argument to fprintf, since it's not expecting one. 32358551Skris 32458551SkrisFri Nov 26 19:03:18 1993 Per Bothner (bothner@kalessin.cygnus.com) 32558551Skris 32658551Skris * src/list-node.cc: #undef index, for the sake of broken NeXT, 32758551Skris 32858551SkrisThu Nov 4 11:16:03 1993 Per Bothner (bothner@kalessin.cygnus.com) 32958551Skris 33058551Skris * Makefile.in (install): Use INSTALL_DATA for gperf.1. 33158551Skris 33258551SkrisMon Oct 25 18:40:51 1993 Per Bothner (bothner@kalessin.cygnus.com) 33358551Skris 33458551Skris * src/key-list.cc (Key_List::read_keys): Use POW macro 33558551Skris to increase hash table size to power of 2. 33658551Skris 33758551Skris * options.h (LARGE_STACK_ARRAYS): New flag. Defaults to zero. 33858551Skris * gen-perf.cc, key-list.cc, read-line.cc: 33958551Skris Only stack-allocate large arrays if LARGE_STACK_ARRAYS is set. 34058551Skris * main.cc (main): Only call setrlimit (RLIMIT_STACK, ...) 34158551Skris if LARGE_STACK_ARRAYS. 34258551Skris 34358551SkrisMon Oct 4 17:45:08 1993 Per Bothner (bothner@kalessin.cygnus.com) 34458551Skris 34558551Skris * src/gen-perf.cc: Always use ANSI rand/srand instead of BSDisms. 34658551Skris 34758551SkrisWed Aug 18 12:19:53 1993 Per Bothner (bothner@kalessin.cygnus.com) 34858551Skris 34958551Skris * Makefile.in (src_all): Make less verbose output. 35058551Skris 35158551SkrisFri May 28 14:01:18 1993 Per Bothner (bothner@rtl.cygnus.com) 35258551Skris 35358551Skris * src/gen-perf.cc (Gen_Perf::change): Don't use gcc-specific 35458551Skris 2-operand conditional expression. 35558551Skris * src/key-list.cc (Key_List::output_lookup_array): 35658551Skris Don't use variable-size stack arrays, unless compiled by g++. 35758551Skris 35858551SkrisTue May 4 14:08:44 1993 Per Bothner (bothner@cygnus.com) 35958551Skris 36058551Skris Changes (mostly from Peter Schauer) to permit compilation 36158551Skris using cfront 3.0 and otherwise be ARM-conforming. 36258551Skris * src/key-list.h: class Key_List must use public derivation 36358551Skris of base class Std_Err (because Gen_Perf::operator() in gen-perf.cc 36458551Skris calls Std_Err::report_error). 36558551Skris * src/gen-perf.cc (Gen_Perf::affects_prev), src/hash-table.cc 36658551Skris (Hash_Table::operator()): Don't use gcc-specific 2-operand 36758551Skris conditional expression. 36858551Skris * src/iterator.cc (Iterator::operator()): Don't use gcc-specific 36958551Skris range construct in case label. 37058551Skris * key-list.cc (Key_List::output_lookup_array, Key_List::read_keys), 37158551Skris src/gen-perf.cc (Gen_Perf::operator(), src/read-line.cc 37258551Skris (Read_Line::readln_aux): If not gcc, don't allocate 37358551Skris variable-sized arrays on stack. 37458551Skris * src/new.cc (operator new): Argument type should be size_t. 37558551Skris * key-list.cc (Key_List::output_lookup_array, Key_List::read_keys), 37658551Skris new/cc (::operator new): Don't use non-standard >?= operator. 37758551Skris 37858551SkrisTue Apr 27 20:11:30 1993 Per Bothner (bothner@cygnus.com) 37958551Skris 38058551Skris * src/Makefile.in: Define TARGETPROG, and use it. 38158551Skris 38258551SkrisMon Apr 19 00:29:18 1993 Per Bothner (bothner@cygnus.com) 38358551Skris 38458551Skris * Makefile.in, configure.in: Re-vamped configure scheme. 38558551Skris * gperf.texinfo: Renamed to gperf.texi. 38658551Skris * src/bool-array.{h,cc}: ANSIfy bzero->memset. 38758551Skris 38858551SkrisSat Jan 30 20:21:28 1993 Brendan Kehoe (brendan@lisa.cygnus.com) 38958551Skris 39058551Skris * tests/Makefile.in (mostlyclean): Also delete aout, cout, m3out, 39158551Skris pout, and preout. 39258551Skris 39358551SkrisTue Dec 29 08:58:17 1992 Ian Lance Taylor (ian@cygnus.com) 39458551Skris 39558551Skris * Makefile.in: pass $(FLAGS_TO_PASS) to all calls to make. 39658551Skris (FLAGS_TO_PASS): added INSTALL, INSTALL_DATA, INSTALL_PROGRAM. 39758551Skris 39858551SkrisMon Dec 21 18:46:46 1992 Per Bothner (bothner@rtl.cygnus.com) 39958551Skris 40058551Skris * tests/expected.* renamed to *.exp to fit in 14 chars. 40158551Skris * tests/Makefile.in: Update accordingly. 40258551Skris Also rename output.* to *.out. 40358551Skris * src/Makefile.in (clean): Remove gperf program. 40458551Skris 40558551SkrisWed Dec 9 14:33:34 1992 Per Bothner (bothner@cygnus.com) 40658551Skris 40758551Skris * src/hash-table.cc, src/bool-array.h: ANSIfy bzero->memset. 40858551Skris 40958551SkrisThu Dec 3 19:34:12 1992 Per Bothner (bothner@cygnus.com) 41058551Skris 41158551Skris * Makefile.in (distclean, realclean): Don't delete 41258551Skris Makefile before recursing. 41358551Skris 41458551SkrisFri Nov 6 13:41:49 1992 Per Bothner (bothner@rtl.cygnus.com) 41558551Skris 41658551Skris * key-list.{h,cc}: Remove MAX_INT (and similar) constant 41758551Skris fields from Key_List class, and use INT_MAX (etc) from limits.h. 41858551Skris * key-list.{h,cc}, options.{h,cc}, vectors.h: Removed all 41958551Skris uses of initialized const fields, as they are non-standard 42058551Skris - and their use was easy to do away with. Mostly, just 42158551Skris made the constants static non-fields in the .cc file. 42258551Skris 42358551SkrisMon Nov 2 13:10:11 1992 Per Bothner (bothner@cygnus.com) 42458551Skris 42558551Skris * tests/Makefile.in: When generating cinset.c, don't pass -C, 42658551Skris since -C assumes an ANSI compiler. Add the -C flag (with -a) 42758551Skris when generating test.out.3 instead. 42858551Skris * tests/expected.out.3: Update accordingly. 42958551Skris 43058551SkrisWed Aug 12 11:47:54 1992 Per Bothner (bothner@cygnus.com) 43158551Skris 43258551Skris * Makefile.in: Factor out common flags into $(FLAGS_TO_PASS). 43358551Skris * Makefile.in: 'install-info' depends on gperf.info. 43458551Skris 43558551SkrisMon Aug 10 11:39:52 1992 Ian Lance Taylor (ian@dumbest.cygnus.com) 43658551Skris 43758551Skris * Makefile.in, src/Makefile.in: always create installation 43858551Skris directories. 43958551Skris 44058551SkrisMon Jul 20 15:33:21 1992 Mike Stump (mrs@cygnus.com) 44158551Skris 44258551Skris * src/new.cc (operator new): Add cast from void * to char *, 44358551Skris since it is not a standard conversion. 44458551Skris 44558551SkrisWed Jun 17 16:25:30 1992 Per Bothner (bothner@rtl.cygnus.com) 44658551Skris 44758551Skris * src/gen-perf.cc: #include <_G_config.h> for _G_SYSV. 44858551Skris * src/key-list.cc: alloca() hair. 44958551Skris * src/main.cc (main): Only call getrlimit if _G_HAVE_SYS_RESOURCE. 45058551Skris * Makefile,in, {src,test}/Makefile.in: Fix *clean rules. 45158551Skris 45258551SkrisFri May 29 13:21:13 1992 Per Bothner (bothner@rtl.cygnus.com) 45358551Skris 45458551Skris * src/gen-perf.cc: Replace USG -> _G_SYSV. 45558551Skris 45658551SkrisThu May 14 13:58:36 1992 Per Bothner (bothner@rtl.cygnus.com) 45758551Skris 45858551Skris * src/Makefile.in: Don't pass obsolete flag -DUNLIMIT_STACK. 45958551Skris * tests/Makefile.in (clean): Fix. 46058551Skris 46158551SkrisSat Mar 7 00:03:56 1992 K. Richard Pixley (rich@rtl.cygnus.com) 46258551Skris 46358551Skris * gperf.texinfo: added menu item hook. 46458551Skris 46558551SkrisWed Feb 26 18:04:40 1992 K. Richard Pixley (rich@cygnus.com) 46658551Skris 46758551Skris * Makefile.in, configure.in: removed traces of namesubdir, 46858551Skris -subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced 46958551Skris copyrights to '92, changed some from Cygnus to FSF. 47058551Skris 47158551SkrisSun Jan 26 19:21:58 1992 Per Bothner (bothner at cygnus.com) 47258551Skris 47358551Skris * tests/Makefile.in: Use re-directed stdin instead of file 47458551Skris name in argv. This allows us to remove the filename 47558551Skris from the output, the expected output, and hence the diffs. 47658551Skris (Note that the input file is in $(srcdir), which we cannot 47758551Skris place in the expected out files.) 47858551Skris * tests/expected.out.[1235]: Edit out input filename, 47958551Skris to match new output. 48058551Skris 48158551SkrisThu Jun 28 16:17:27 1990 Doug Schmidt (schmidt at brilliant) 48258551Skris 48358551Skris * Wow, first fix on the new job! There was a dumb error 48458551Skris in Key_List::output_lookup_function, where I printed the 48558551Skris string "&wordlist[key]" instead of the correct "&wordlist[index]". 48658551Skris 48758551Skris * Added a couple of #ifdefs for USG support. 48858551Skris 48958551SkrisSun Jun 3 17:16:36 1990 Doug Schmidt (schmidt at crimee.ics.uci.edu) 49058551Skris 49158551Skris * Updated the version number to 2.5 and sent to Doug Lea for release 49258551Skris with the latest GNU libg++. 49358551Skris 49458551Skris * Changed the error handling when a keyword file cannot be opened 49558551Skris (now calls perror). 49658551Skris 49758551SkrisWed May 30 14:49:40 1990 Doug Schmidt (schmidt at crimee.ics.uci.edu) 49858551Skris 49958551Skris * Instrumented the source code with trace statements automagically 50058551Skris inserted using my new automated trace instrumentation tool! 50158551Skris 50258551SkrisWed May 9 11:47:41 1990 Doug Schmidt (schmidt at siam.ics.uci.edu) 50358551Skris 50458551Skris * Really fixed the previous bug. Turns out that a small amount 50558551Skris of logic had to be duplicated to handle static links that occur 50658551Skris as part of dynamic link chains. What a pain!!! 50758551Skris 50858551SkrisTue May 8 23:11:44 1990 Doug Schmidt (schmidt at siam.ics.uci.edu) 50958551Skris 51058551Skris * Fixed a stupid bug in Key_List::output_lookup_array that was 51158551Skris causing incorrect counts to be generated when there were both 51258551Skris static and dynamic links occurring for the same hash value. 51358551Skris Also simplified the code that performs the logic in this routine. 51458551Skris 51558551SkrisMon Apr 30 17:37:24 1990 Doug Schmidt (schmidt at crimee.ics.uci.edu) 51658551Skris 51758551Skris * Fixed stupid bug in Key_List::output_lookup_array that was 51858551Skris making the generated lookup[] array contain `chars' even 51958551Skris when the values stored in the chars are greater than 127! 52058551Skris 52158551Skris * Changed the behavior of the -G (global table) option so that it 52258551Skris will output the `length[]' array in the global scope along with 52358551Skris the `word_list[]' array. 52458551Skris 52558551Skris * Fixed a stupid bug in Key_List::output_lookup_function that 52658551Skris would always output the complicated `duplicate-handling' lookup 52758551Skris logic, even when there were no duplicates in the input! 52858551Skris 52958551Skris * Yikes, had to modify a bunch of stuff in key-list.cc to correctly 53058551Skris handle duplicate entries. Changed the generated code so that 53158551Skris the MIN_HASH_VALUE is no longer subtracted off when calculating 53258551Skris the hash value for a keyword. This required changing some other 53358551Skris code by substituting MAX_HASH_VALUE for TOTAL_KEYS in several places. 53458551Skris Finally, this means that the generated tables may contain leading 53558551Skris null entries, but I suppose it is better to trade-off space to get 53658551Skris faster performance... 53758551Skris 53858551SkrisMon Mar 26 13:08:43 1990 Doug Schmidt (schmidt at crimee.ics.uci.edu) 53958551Skris 54058551Skris * Updated version number to 2.4 to reflect the latest changes. 54158551Skris 54258551Skris * Changed the main program so that it always prints out gperf's 54358551Skris execution timings to the generated output file. 54458551Skris 54558551SkrisSun Mar 25 12:39:30 1990 Doug Schmidt (schmidt at crimee.ics.uci.edu) 54658551Skris 54758551Skris * Added the -Z option so that users can specify the name of the 54858551Skris generated class explicitly. Updated documentation to reflect 54958551Skris this change. 55058551Skris 55158551Skris * Modified the generated C++ class interface so that the functions 55258551Skris are declared static (to remove the overhead of passing the `this' 55358551Skris pointer). This means that operator()() can no longer be used, 55458551Skris since it only works on non-static member functions. 55558551Skris Also changed things so that there is no constructor (why waste 55658551Skris the extra call, when it doesn't do anything, eh?) 55758551Skris 55858551Skris * Modified the behavior of Key_List::output when the -L C++ option 55958551Skris is enabled. Previously the code generated use const data members 56058551Skris to record MIN_WORD_LENGTH, MIN_HASH_VALUE, etc. However, as 56158551Skris pointed out by James Clark this may result in suboptimal behavior 56258551Skris on the part of C++ compilers that can't inline these values. 56358551Skris Therefore, the new behavior is identical to what happens with 56458551Skris -L C, i.e., either #defines or function-specific enums are used. 56558551Skris Why sacrifice speed for some abstract notion of `code purity?' ;-) 56658551Skris 56758551SkrisTue Mar 6 18:17:42 1990 Doug Schmidt (schmidt at crimee.ics.uci.edu) 56858551Skris 56958551Skris * Added the -E option that defines constant values using an enum 57058551Skris local to the lookup function rather than with #defines. This 57158551Skris also means that different lookup functions can reside in the 57258551Skris same file. Thanks to James Clark (jjc@ai.mit.edu). 57358551Skris 57458551SkrisSat Mar 3 20:19:00 1990 Doug Schmidt (schmidt at zola.ics.uci.edu) 57558551Skris 57658551Skris * Added a special case to key_list::output_switch that doesn't 57758551Skris generate extra comparisons when the `-S' is given an argument 57858551Skris of 1 (the normal case). This should speed up the generated 57958551Skris code output a tad... 58058551Skris 58158551SkrisFri Feb 23 14:21:28 1990 Doug Schmidt (schmidt at zola.ics.uci.edu) 58258551Skris 58358551Skris * Renamed all instances of member function get_keysig_size 58458551Skris to get_max_keysig_size, since this is more precise... 58558551Skris 58658551Skris * Changed all occurrences of charset to keysig (stands for ``key 58758551Skris signature'') to reflect the new naming convention used in the 58858551Skris USENIX paper. 58958551Skris 59058551SkrisThu Feb 22 11:28:36 1990 Doug Schmidt (schmidt at crimee.ics.uci.edu) 59158551Skris 59258551Skris * Changed the name of the generated associated values table from 59358551Skris asso_value to asso_values to reflect conventions in the USENIX 59458551Skris C++ paper. 59558551Skris 59658551SkrisThu Feb 15 23:29:03 1990 Doug Schmidt (schmidt at zola.ics.uci.edu) 59758551Skris 59858551Skris * Updated the gperf.texinfo file to fix some formatting problems 59958551Skris that had crept in since last time. 60058551Skris 60158551SkrisWed Feb 14 23:27:24 1990 Doug Schmidt (schmidt at zola.ics.uci.edu) 60258551Skris 60358551Skris * Fixed stupid bug in key-list.cc (get_special_input), wher 60458551Skris gperf replaced each '%' with the succeeding character. 60558551Skris 60658551Skris * Added support for multiple target language generation. Currently 60758551Skris handled languages are C and C++, with C as the default. Updated 60858551Skris documentation and option handler to reflect the changes. 60958551Skris 61058551Skris * Added a global destructor to new.cc and removed the #ifdef, since 61158551Skris the bloody thing now works with libg++. 61258551Skris 61358551SkrisMon Feb 14 13:00:00 1990 Doug Schmidt (schmidt at zola.ics.uci.edu) 61458551Skris 61558551Skris * Found out that my gperf paper was accepted at the upcoming 61658551Skris USENIX C++ Conference in San Francisco. Yow! 61758551Skris 61858551SkrisTue Jan 30 09:00:29 1990 Doug Schmidt (schmidt at zola.ics.uci.edu) 61958551Skris 62058551Skris * #ifdef'd out the new.cc memory allocator, since there are 62158551Skris problems with this and the libg++ stuff. 62258551Skris 62358551Skris * Changed key-list.h so that class Vectors is a public (rather 62458551Skris than private) base class for class Key_List. The previous 62558551Skris form was illegal C++, but wasn't being caught by the old 62658551Skris g++ compiler. Should work now... ;-) 62758551Skris 62858551SkrisSun Dec 10 14:08:23 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 62958551Skris 63058551Skris * Added several changes from rfg@ics.uci.edu. These changes 63158551Skris help to automate the build process. 63258551Skris 63358551SkrisWed Nov 15 15:49:33 1989 Doug Schmidt (schmidt at zola.ics.uci.edu) 63458551Skris 63558551Skris * Removed conditional compilation for GATHER_STATISTICS. There's 63658551Skris really no good reason to avoid collecting this info at run-time, 63758551Skris since that section of code is *hardly* the bottleneck... ;-) 63858551Skris 63958551Skris * Simplified the C output routines in Key_List::set_output_types 64058551Skris and Key_List::output_keyword_table a bit in order to 64158551Skris speed-up and clean up the code generation. 64258551Skris 64358551Skris * Modified function Key_List::get_special_input so that it does 64458551Skris not try to `delete' a buffer that turned out to be too short. 64558551Skris This is important since the new memory management scheme 64658551Skris does not handle deletions. However, adding a small amount of 64758551Skris garbage won't hurt anything, since we generally don't do this 64858551Skris operation more than a couple times *at most*! 64958551Skris 65058551Skris * Created a new file (new.cc) which includes my own overloaded 65158551Skris operator new. This function should dramatically reduce the 65258551Skris number of calls to malloc since it grabs large chunks and 65358551Skris doles them out in small pieces. As a result of this change 65458551Skris the class-specific `operator new' was removed from class List_Node. 65558551Skris 65658551SkrisTue Nov 14 21:45:30 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 65758551Skris 65858551Skris * Continued to refine the great hack. The latest trick is to 65958551Skris try and replace most uses of dynamic memory (i.e., calls to 66058551Skris new) with uses of gcc dynamic arrays (i.e., an alloca solution). 66158551Skris This makes life much easier for the overall process-size, since 66258551Skris it reduces the amount of overhead for memory management. As a 66358551Skris side-effect from this change there is no reason to have the 66458551Skris Bool_Array::dispose member function, so it's outta here! 66558551Skris 66658551Skris * Fixed a stupid bug that was an disaster waiting to happen... 66758551Skris Instead of making the boolean array large enough to index 66858551Skris max_hash_value it was only large enough to index max_hash_value 66958551Skris - 1. Once again, an off-by-one mistake in C/C++!!!! 67058551Skris 67158551SkrisMon Nov 13 19:38:27 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 67258551Skris 67358551Skris * Added the final great hack! This allows us to generate hash tables 67458551Skris for near-perfect hash functions that contain duplicates, *without* 67558551Skris having to use switch statements! Since many compilers die on large 67658551Skris switch statements this feature is essential. Furthermore, it appears 67758551Skris that the generated code is often *smaller* than that put out by 67858551Skris compilers, even though a large, sparse array must be created. 67958551Skris Here's the general idea: 68058551Skris 68158551Skris a. Generate the wordlist as a contiguous block of keywords, 68258551Skris just as before when using a switch statement. This 68358551Skris wordlist *must* be sorted by hash value. 68458551Skris 68558551Skris b. Generate the lookup array, which is an array of signed 68658551Skris {chars,shorts,ints}, (which ever allows full coverage of 68758551Skris the wordlist dimensions). If the value v, where v = 68858551Skris lookup[hash(str,len)], is >= 0 and < TOTAL_KEYWORDS, then we 68958551Skris simply use this result as a direct access into the wordlist 69058551Skris array to snag the keyword for comparison. 69158551Skris 69258551Skris c. Otherwise, if v is < -TOTAL_KEYWORDS or > TOTAL_KEYWORDS 69358551Skris this is an indication that we'll need to search through 69458551Skris some number of duplicates hash values. Using a hash 69558551Skris linking scheme we'd then index into a different part of 69658551Skris the hash table that provides the starting index and total 69758551Skris length of the duplicate entries to find via linear search! 69858551Skris 69958551SkrisSun Nov 12 13:48:10 1989 Doug Schmidt (schmidt at zola.ics.uci.edu) 70058551Skris 70158551Skris * Simplified Key_List::output_min_max considerably by recognizing 70258551Skris that since the keyword list was already sorted by hash value finding 70358551Skris the min and max values is trivial! 70458551Skris 70558551Skris * Improved the debugging diagnostics considerably in classes Key_List, 70658551Skris Hash_Table, and Gen_Perf. 70758551Skris 70858551Skris * Modified the `-s' option so that a negative argument is now 70958551Skris interpreted to mean `allow the maximum associated value to be 71058551Skris about x times *smaller* than the number of input keys.' This 71158551Skris should help prevent massive explosion of generated hash table 71258551Skris size for large keysets. 71358551Skris 71458551SkrisSat Nov 11 11:31:13 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 71558551Skris 71658551Skris * Added a field in class Key_List that counts the total number 71758551Skris of duplicate keywords, both static and dynamic. 71858551Skris 71958551Skris * Added a new member function Bool_Array that deletes the dynamic 72058551Skris memory allocated to Bool_Array::storage_array. This space may 72158551Skris be needed for subsequent options, so it made sense to free it as 72258551Skris soon as possible... 72358551Skris 72458551Skris * Renamed file/class Alpha_Vectors to Vectors, to avoid problems 72558551Skris with 14 character length filenames on SYSV. Also changed file 72658551Skris adapredefined.gperf to adadefs.gperf in the ./tests directory. 72758551Skris 72858551Skris * Modified class Options by changing the member function 72958551Skris Options::total_positions to Options::get_charset_size and 73058551Skris Options::set_charset_size. These two routines now either return 73118214Speter the total charset size *or* the length of the largest keyword 73218214Speter if the user specifies the -k'*' (ALLCHARS) option. This change 73318214Speter cleans up client code. 73418214Speter 73558551Skris * Merged all the cperf changes into gperf. 73658551Skris 73718214Speter * Made sure to explicitly initialize perfect.fewest_collisions to 73818214Speter 0. 73918214Speter 74018214Speter * Cleaned up some loose ends noticed by Nels Olson. 74118214Speter 1. Removed `if (collisions <= perfect.fewest_collisions)' 74258551Skris from Gen_Perf::affects_prev since it was superfluous. 74318214Speter 2. Removed the fields best_char_value and best_asso_value 74458551Skris from Gen_Perf. There were also unnecessary. 74558551Skris 3. Fixed a braino in the Bool_Array::bool_array_reset 74618214Speter function. Since iteration numbers can never be zero 74718214Speter the `if (bool_array.iteration_number++ == 0)' must be 74818214Speter `if (++bool_array.iteration_number == 0).' 74958551Skris 4. Modified Std_Err::report_error so that it correctly handles 75018214Speter "%%". 75118214Speter 75218214Speter * It is important to note that -D no longer enables -S. 75318214Speter There is a good reason for this change, which will become 75418214Speter manifested in the next release... (suspense!). 75518214Speter 75658551Skris * Made some subtle changes to Key_List::print_switch so that if finally 75718214Speter seems to work correctly. Needs more stress testing, however... 75818214Speter 75958551Skris * Made a major change to the Key_List::print_switch function. 76018214Speter The user can now specify the number of switch statements to generate 76118214Speter via an argument to the -S option, i.e., -S1 means `generate 1 76218214Speter switch statement with all keywords in it,' -S2 means generate 76318214Speter 2 switch statements with 1/2 the elements in each one, etc. 76418214Speter Hopefully this will fix the problem with C compilers not being 76518214Speter able to generate code for giant switch statements (but don't 76618214Speter hold your breath!) 76718214Speter 76858551Skris * Changed Key_List::length function to Key_List::keyword_list_length. 76918214Speter 77018214Speter * Added a feature to main.c that prints out the starting wall-clock 77118214Speter time before the program begins and prints out the ending wall-clock 77218214Speter time when the program is finished. 77318214Speter 77458551Skris * Added the GATHER_STATISTICS code in hash-table.c so we can 77518214Speter keep track of how well double hashing is doing. Eventually, 77618214Speter GATHER_STATISTICS will be added so that all instrumentation 77718214Speter code can be conditionally compiled in. 77818214Speter 77958551Skris * Fixed a stupid bug in Key_List::print_switch routine. This 78018214Speter was necessary to make sure the generated switch statement worked 78118214Speter correctly when *both* `natural,' i.e., static links and dynamic 78218214Speter links, i.e., unresolved duplicates, hash to the same value. 78318214Speter 78458551Skris * Modified Bool_Array::~Bool_Array destructor so that 78518214Speter it now frees the bool_array.storage_array when it is no longer 78618214Speter needed. Since this array is generally very large it makes sense 78718214Speter to return the memory to the freelist when it is no longer in use. 78818214Speter 78958551Skris * Changed the interface to constructor Hash_Table::Hash_Table. This 79058551Skris constructor now passed a pointer to a power-of-two sized buffer that 79158551Skris serve as storage for the hash table. Although this weakens information 79218214Speter hiding a little bit it greatly reduces dynamic memory fragmentation, 79318214Speter since we can now obtain the memory via a call to alloca, rather 79458551Skris than malloc. This change modified Key_List::read_keys calling 79518214Speter interface. 79618214Speter 79718214Speter * Since alloca is now being used more aggressively a conditional 79858551Skris compilation section was added in main.c. Taken from GNU GCC, 79958551Skris this code gets rid of any avoidable limit on stack size so that 80058551Skris alloca does not fail. It is only used if the -DRLIMIT_STACK 80158551Skris symbol is defined when gperf is compiled. 80218214Speter 80318214Speter * Added warnings in option.c so that user's would be informed 80418214Speter that -r superceeds -i on the command-line. 80518214Speter 80658551Skris * Rewrote Gen_Perf::affects_prev. First, the code structure 80718214Speter was cleaned up considerably (removing the need for a dreaded 80858551Skris goto!). Secondly, a major change occurred so that Gen_Perf::affects_prev 80918214Speter returns FALSE (success) when fewest_hits gets down to whatever 81018214Speter it was after inserting the previous key (instead of waiting for 81118214Speter it to reach 0). In other words, it stops trying if it can 81218214Speter resolve the new collisions added by a key, even if there are 81318214Speter still other old, unresolved collisions. This modification was 81418214Speter suggested by Nels Olson and seems to *greatly* increase the 81518214Speter speed of gperf for large keyfiles. Thanks Nels! 81618214Speter 81758551Skris * In a similar vein, inside the Gen_Perf::change routine 81818214Speter the variable `perfect.fewest_collisions is no longer initialized 81918214Speter with the length of the keyword list. Instead it starts out at 82018214Speter 0 and is incremented by 1 every time change () is called. 82118214Speter The rationale for this behavior is that there are times when a 82218214Speter collision causes the number of duplicates (collisions) to 82318214Speter increase by a large amount when it would presumably just have 82418214Speter gone up by 1 if none of the asso_values were changed. That is, 82518214Speter at the beginning of change(), you could initialize fewest_hits 82618214Speter to 1+(previous value of fewest_hits) instead of to the number of 82718214Speter keys. Thanks again, Nels. 82818214Speter 82958551Skris * Replaced alloca with new in the Gen_Perf::change function. 83018214Speter This should eliminate some overhead at the expense of a little 83118214Speter extra memory that is never reclaimed. 83218214Speter 83358551Skris * Renamed Gen_Perf::merge_sets to Gen_Perf::compute_disjoint_union 83418214Speter to reflect the change in behavior. 83518214Speter 83618214Speter * Added the -e option so users can supply a string containing 83718214Speter the characters used to separate keywords from their attributes. 83818214Speter The default behavior is ",\n". 83918214Speter 84018214Speter * Removed the char *uniq_set field from LIST_NODE and modified 84118214Speter uses of uniq_set in perfect.c and keylist.c. Due to changes 84258551Skris to Gen_Perf::compute_disjoint_sets this field was no longer 84358551Skris necessary, and its removal makes the program smaller and 84458551Skris potentially faster. 84518214Speter 84618214Speter * Added lots of changes/fixes suggested by Nels Olson 84718214Speter (umls.UUCP!olson@mis.ucsf.edu). In particular: 84858551Skris 1. Changed Bool_Array so that it would dynamically create 84918214Speter an array of unsigned shorts rather than ints if the 85018214Speter LO_CAL symbol was defined during program compilation. 85118214Speter This cuts the amount of dynamic memory usage in half, 85218214Speter which is important for large keyfile input. 85318214Speter 2. Added some additional debugging statements that print extra 85418214Speter info to stderr when the -d option is enabled. 85558551Skris 3. Fixed a really stupid bug in Key_List::print_switch 85658551Skris A right paren was placed at the wrong location, which broke 85758551Skris strlen (). 85818214Speter 4. Fixed a subtle problem with printing case values when keylinks 85918214Speter appear. The logic failed to account for the fact that there 86018214Speter can be keylinks *and* regular node info also! 86158551Skris 5. Changed the behavior of Key_List::read_keys so that it would 86258551Skris honor -D unequivocally, i.e., it doesn't try to turn off dup 86358551Skris handling if the user requests it, even if there are no 86458551Skris immediate links in the keyfile input. 86518214Speter 6. Modified the -j option so that -j 0 means `try random values 86618214Speter when searching for a way to resolve collisions.' 86758551Skris 7. Added a field `num_done' to the Gen_Perf struct. This is used 86818214Speter to report information collected when trying to resolve 86918214Speter hash collisions. 87018214Speter 8. Modified the merge_sets algorithm to perform a disjoint 87118214Speter union of two multisets. This ensures that subsequent 87258551Skris processing in Gen_Perf::affect_prev doesn't 87318214Speter waste time trying to change an associated value that is 87418214Speter shared between two conflicting keywords. 87558551Skris 9. Modified Gen_Perf::affects_prev so that it doesn't try 87658551Skris random jump values unless the -j 0 option is enabled. 87758551Skris 10. Fixed a silly bug in Gen_Perf::change. This problem caused 87858551Skris gperf to seg fault when the -k* option was given and the 87958551Skris keyfile file had long keywords. 88058551Skris 88158551SkrisSun Oct 29 00:18:55 1989 Doug Schmidt (schmidt at siam.ics.uci.edu) 88218214Speter 88358551Skris * Modified class-specific new operations for Read_Line and 88458551Skris List_Node so they don't fail if SIZE is larger than twice 88558551Skris the previous buffer size. Note we double buffer size 88658551Skris everytime the previous buffer runs out, as a heuristic 88758551Skris to reduce future calls to malloc. 88818214Speter 88958551SkrisSun Oct 22 13:49:43 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 89058551Skris 89158551Skris * Updated gperf version number to 2.0. Send to Doug Lea for 89258551Skris incorporation into the long-awaited `official' libg++ 1.36 89358551Skris release! 89458551Skris 89558551Skris * Thanks to Nels Olson a silly bug in Gen_Perf::change () 89658551Skris was fixed. This problem caused gperf to seg fault when 89758551Skris the -k* option was given and the keyfile file had long 89858551Skris keywords. 89958551Skris 90058551Skris * Modified Key_List::print_hash_function so that it output 90158551Skris max_hash_value + 1 (rather than just max_hash_value) for 90258551Skris any associated value entries that don't correspond to 90358551Skris keyword charset characters. This should speed up rejection 90458551Skris of non-keyword strings a little in some cases. 90558551Skris 90658551SkrisSat Oct 21 19:28:36 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu) 90758551Skris 90858551Skris * Fixed Key_List::print_hash_function so that it no longer output 90958551Skris things like `return 0 + ...' Although this probably gets 91058551Skris optimized away by even the worst C compilers there isn't any 91158551Skris point tempting fate... ;-) 91258551Skris 91358551Skris * Fixed class List_Node's constructor so that it wouldn't a priori 91458551Skris refuse to consider trying to hash keys whose length is less 91558551Skris than the smallest user-specified key position. It turns out 91658551Skris this is not a problem unless the user also specifies the -n 91758551Skris (NOLENGTH) option, in which case such keys most likely 91858551Skris don't have a prayer of being hashed correctly! 91958551Skris 92058551Skris * Changed the name of the generated lookup table from `Hash_Table' 92158551Skris to `asso_value' to be consistent with the gperf paper. 92258551Skris 92358551SkrisTue Oct 17 14:19:48 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 92458551Skris 92558551Skris * Added a flag GATHER_STATISTICS in the Makefile. If defined 92658551Skris during compilation this turns on certain collection facilities 92758551Skris that track the performance of gperf during its execution. In 92858551Skris particular, I want to see how many collisions occur for the 92958551Skris double hashing Hash_Table. 93058551Skris 93158551Skris * Added a safety check so that we don't screw up if the total 93258551Skris number of `resets' of the Bool_Array exceeds MAX_INT. Since 93358551Skris this number is around 2^31 it is unlikely that this would ever 93458551Skris occur for most input, but why take the risk? 93558551Skris 93658551Skris * Changed the behavior for the -a (ANSI) option so that the 93718214Speter generated prototypes use int rather than size_t for the LEN 93818214Speter parameter. It was too ugly having to #include <stddef.h> all 93918214Speter over the place... 94018214Speter 94158551SkrisMon Oct 16 11:00:35 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu) 94258551Skris 94358551Skris * Continued to work on the gperf paper for the USENIX C++ 94458551Skris conference. At some point this will be merged back into 94558551Skris the gperf documentation... 94658551Skris 94758551SkrisSat Oct 14 20:29:43 1989 Doug Schmidt (schmidt at siam.ics.uci.edu) 94858551Skris 94918214Speter * Added a majorly neat hack to Bool_Array, suggested by rfg. 95018214Speter The basic idea was to throw away the Ullman array technique. 95118214Speter The Ullman array was used to remove the need to reinitialize all 95218214Speter the Bool_Array elements to zero everytime we needed to determine 95318214Speter whether there were duplicate hash values in the keyword list. 95418214Speter The current trick uses an `iteration number' scheme, which takes 95518214Speter about 1/3 the space and reduces the overall program running a 95618214Speter time by about 20 percent for large input! The hack works as 95718214Speter follows: 95818214Speter 95958551Skris 1. Dynamically allocation 1 boolean array of size k. 96018214Speter 2. Initialize the boolean array to zeros, and consider the first 96118214Speter iteration to be iteration 1. 96218214Speter 2. Then on all subsequent iterations we `reset' the bool array by 96318214Speter kicking the iteration count by 1. 96418214Speter 3. When it comes time to check whether a hash value is currently 96518214Speter in the boolean array we simply check its index location. If 96618214Speter the value stored there is *not* equal to the current iteration 96718214Speter number then the item is clearly *not* in the set. In that 96818214Speter case we assign the iteration number to that array's index 96918214Speter location for future reference. Otherwise, if the item at 97018214Speter the index location *is* equal to the iteration number we've 97118214Speter found a duplicate. No muss, no fuss! 97258551Skris 97358551SkrisMon Oct 2 12:30:54 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 97418214Speter 97558551Skris * Changed some consts in options.h to enumerals, since g++ 97658551Skris doesn't seem to like them at the moment! 97718214Speter 97858551SkrisSat Sep 30 12:55:24 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 97918214Speter 98058551Skris * Fixed a stupid bug in Key_List::print_hash_function that manifested 98158551Skris itself if the `-k$' option was given (i.e., only use the key[length] 98258551Skris character in the hash function). 98358551Skris 98418214Speter * Added support for the -C option. This makes the contents of 98518214Speter all generated tables `readonly'. 98618214Speter 98718214Speter * Changed the handling of generated switches so that there is 98818214Speter only one call to str[n]?cmp. This *greatly* reduces the size of 98918214Speter the generated assembly code on all compilers I've seen. 99018214Speter 99118214Speter * Fixed a subtle bug that occurred when the -l and -S option 99218214Speter was given. Code produced looked something like: 99318214Speter 99418214Speter if (len != key_len || !strcmp (s1, resword->name)) return resword; 99518214Speter 99618214Speter which doesn't make any sense. Clearly, this should be: 99718214Speter 99818214Speter if (len == key_len && !strcmp (s1, resword->name)) return resword; 99918214Speter 100058551SkrisTue Sep 26 10:36:50 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 100118214Speter 100258551Skris * Changed class Read_Line's definition so that it no longer 100358551Skris needs to know about the buffering scheme used to speed up 100458551Skris dynamic memory allocation of input keywords and their 100558551Skris associated attributes. This means that operator new is no longer 100658551Skris a friend of Read_Line. 100718214Speter 100858551SkrisMon Sep 25 23:17:10 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu) 100958551Skris 101058551Skris * Decided that Obstacks had too much overhead, so they were 101158551Skris removed in favor of super-efficient, low-overhead buffered 101258551Skris storage allocation hacks in Read_Line and List_Node. 101358551Skris 101458551Skris * No longer try to inline functions that g++ complains about 101558551Skris (Key_List::Merge and Key_List::Merge_Sort). 101658551Skris 101758551SkrisSun Sep 24 13:11:24 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 101858551Skris 101958551Skris * Changed classes Read_Line and List_Node to use Obstacks in order 102058551Skris to cache memory allocation for keyword strings and List_Nodes. 102158551Skris 102258551Skris * Continued to experiment with inheritance schemes. 102358551Skris 102458551Skris * Added a new file `alpha.h', that declares static data shared 102558551Skris (i.e., inherited) between classes List_Node and Key_List. 102658551Skris 102758551SkrisTue Sep 12 16:14:41 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 102858551Skris 102958551Skris * Made numerous changes to incorporate multiple inheritance in 103058551Skris gperf. 103158551Skris 103258551SkrisWed Aug 16 23:04:08 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 103358551Skris 103458551Skris * Added the -DCOMPILER_FIXED flag to the ./src/Makefile. This 103558551Skris implies that people trying to compile gperf need to have a 103658551Skris working version of the new g++ compiler (1.36.0). 103758551Skris 103858551Skris * Removed some extra spaces that were being added in the generated 103958551Skris C code. 104058551Skris 104118214SpeterMon Jul 24 17:09:46 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 104218214Speter 104318214Speter * Fixed PRINT_HASH_FUNCTION and PRINT_LOOKUP_FUNCTION in keylist.c 104418214Speter so that the generated functions take an unsigned int length argument. 104518214Speter If -a is enabled the prototype is (const char *str, size_t len). 104618214Speter 104718214SpeterFri Jul 21 13:06:15 1989 Doug Schmidt (schmidt at zola.ics.uci.edu) 104818214Speter 104958551Skris * Fixed a typo in PRINT_KEYWORD_TABLE in keylist.cc that prevented 105058551Skris the indentation from working correctly. 105158551Skris 105218214Speter * Fixed a horrible typo in PRINT_KEYWORD_TABLE in keylist.cc 105318214Speter that prevented links from being printed correctly. 105418214Speter 105558551SkrisTue Jul 18 16:04:31 1989 Doug Schmidt (schmidt at zola.ics.uci.edu) 105658551Skris 105758551Skris * Fixed up readline.cc and readline.h so that they work OK 105858551Skris with g++ compilers that aren't completely up-to-date. 105958551Skris If symbol COMPILER_FIXED is defined then the behavior 106058551Skris that works on my more recent version of g++ is enabled. 106158551Skris 106218214SpeterSun Jul 9 17:53:28 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 106318214Speter 106418214Speter * Changed the ./tests subdirectory Makefile so that it 106518214Speter uses $(CC) instead of gcc. 106618214Speter 106758551SkrisSun Jul 2 21:52:15 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 106818214Speter 106918214Speter * Fixed a number of subtle bugs that occurred when -S was 107018214Speter combined with various and sundry options. 107118214Speter 107218214Speter * Added the -G option, that makes the generated keyword table 107318214Speter a global static variable, rather than hiding it inside 107418214Speter the lookup function. This allows other functions to directly 107518214Speter access the contents in this table. 107618214Speter 107718214Speter * Added the "#" feature, that allows comments inside the keyword 107858551Skris list from the input file. Comment handling takes place in readline.c. 107958551Skris This simplifies the code and reduces the number of malloc calls. 108018214Speter 108118214Speter * Also added the -H option (user can give the name of the hash 108218214Speter function) and the -T option (prevents the transfer of the type decl 108318214Speter to the output file, which is useful if the type is already defined 108418214Speter elsewhere). 108518214Speter 108658551SkrisThu Jun 22 20:39:39 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 108718214Speter 108858551Skris * Modified many classes so that they would inherit Std_Err as 108958551Skris a base class. This makes things more abstract... 109018214Speter 109158551SkrisFri Jun 16 14:23:00 1989 Doug Schmidt (schmidt at zola.ics.uci.edu) 109218214Speter 109318214Speter * Modified the -f (FAST) option. This now takes an argument. 109418214Speter The argument corresponds to the number of iterations used 109518214Speter to resolve collisions. -f 0 uses the length of the 109618214Speter keyword list (which is what -f did before). This makes 109718214Speter life much easier when dealing with large keyword files. 109818214Speter 109958551SkrisTue Jun 6 17:53:27 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 110018214Speter 110118214Speter * Added the -c (comparison) option. Enabling this 110218214Speter will use the strncmp function for string comparisons. 110318214Speter The default is to use strcmp. 110418214Speter 110558551Skris * Fixed a typo in key_list.cc (PRINT_SWITCH). This caused 110658551Skris faulty C code to be generated when the -D, -p, and -t 110758551Skris options were all enabled. 110818214Speter 110958551SkrisThu May 25 14:07:21 1989 Doug Schmidt (schmidt at siam.ics.uci.edu) 111018214Speter 111158551Skris * Once again, changed class Read_Line to overload global operator 111258551Skris new. Hopefully, this will work...! 111358551Skris 111458551SkrisSun May 21 01:51:45 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu) 111558551Skris 111658551Skris * Modified Key_List::print_hash_function () so that it properly 111758551Skris formats the associated values in the hash table according to 111858551Skris the maximum number of digits required to represent the largest 111958551Skris value. 112058551Skris 112158551Skris * Removed the named return value from class Hash_Table's 112258551Skris operator (), since this causes a seg fault when -O is enabled. 112358551Skris No sense tripping subtle g++ bugs if we don't have to.... ;-) 112458551Skris 112558551Skris * Removed the operator new hack from Read_Line, since this seemed 112658551Skris to create horrible bus error problems. 112758551Skris 112858551Skris * Changed many class member functions and data members to be `static', 112958551Skris if they don't manipulate this! 113018214Speter 113158551SkrisFri May 12 23:06:56 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 113218214Speter 113358551Skris * Changed class Std_Err to use static member functions, a la 113458551Skris Ada or Modula 2. This eliminates the need for an explicit 113558551Skris error-handler class object. 113618214Speter 113758551Skris * Added the ``named return value'' feature to Hash_Table::operator () 113858551Skris and Bool_Array::operator [], just for the heck of it.... ;-) 113918214Speter 114058551Skris * Changed the previous hack in Read_Line so that we now use 114158551Skris the overloaded global `new' instead of NEW_STRING! 114218214Speter 114358551SkrisWed May 3 17:36:55 1989 Doug Schmidt (schmidt at zola.ics.uci.edu) 114418214Speter 114518214Speter * Updated to version 1.7. This reflects the recent major changes 114618214Speter and the new C port. 114718214Speter 114858551Skris * Modified the GNU getopt.cc routine to have a class-based interface. 114918214Speter 115058551Skris * Fixed a typo in Perfect.cc ~Perfect that prevented the actual maximum 115158551Skris hash table size from being printed (maybe the stream classes 115258551Skris weren't so bad after all.... ;-). 115358551Skris 115418214Speter * Added support for the -f option. This generates the perfect 115518214Speter hash function ``fast.'' It reduces the execution time of 115618214Speter gperf, at the cost of minimizing the range of hash values. 115718214Speter 115818214SpeterTue May 2 16:23:29 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu) 115918214Speter 116058551Skris * Added an efficiency hack to Read_Line. Instead of making 116158551Skris a call to operator NEW (a.k.a. malloc) for each input string 116258551Skris a new member function NEW_STRING stores a large buffer from 116358551Skris which new strings are carved out, growing the buffer if 116458551Skris necessary. It might be useful to add this throughout the 116558551Skris program.... 116618214Speter 116758551Skris * Removed all unnecessary calls to DELETE. If the program is about 116858551Skris to exit it is silly to waste time freeing memory. 116958551Skris 117058551Skris * Added the GNU getopt program to the distribution. This makes 117158551Skris GPERF portable to systems that don't include getopt in libc. 117258551Skris 117358551Skris * Added a strcspn member to class Key_List. This also increases 117458551Skris portability. 117558551Skris 117658551Skris * Added the get_include_src function from keylist.c as a member 117758551Skris function in class Key_List. Hopefully every function is 117858551Skris now associated with a class. This aids abstraction and 117958551Skris modularity. 118058551Skris 118118214Speter * Ported gperf to C. From now on both K&R C and GNU G++ versions 118258551Skris will be supported. There will be two ChangeLog files, one 118358551Skris for each version of the program. 118418214Speter 118558551SkrisMon May 1 16:41:45 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 118658551Skris 118758551Skris * Fixed a bug with -k'*'. This now prints out *all* the cases 118858551Skris up to the length of the longest word in the keyword set. 118958551Skris 119058551SkrisSun Apr 30 12:15:25 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu) 119158551Skris 119258551Skris * Removed all use of the stream classes. Too ugly, slow, and 119358551Skris not handled by the c++-mode formatter.... 119458551Skris 119558551Skris * Modified the handling of links (i.e., keywords that have 119658551Skris identical hash values as other keywords). This should 119758551Skris speed up hash function generation for keyword sets with 119858551Skris many duplicate entries. The trick is to treat duplicate 119958551Skris values as equivalence classes, so that each set of duplicate 120058551Skris values is represented only once in the main list processing. 120158551Skris 120258551Skris * Fixed some capitialization typos and indentations mistakes in 120358551Skris Key_List::print_hash_function. 120458551Skris 120558551SkrisSat Apr 29 12:04:03 1989 Doug Schmidt (schmidt at zola.ics.uci.edu) 120658551Skris 120758551Skris * Fixed a typo/logico in Key_List::print_switch that prevented 120858551Skris the last keyword in the keyword list to be print out. This 120958551Skris requires further examination..... 121058551Skris 121158551Skris * Fixed a stupid bug in List_Node::List_node. If the -k'*' option 121258551Skris was enabled the KEY_SET string wasn't getting terminated with 121358551Skris '\0'! 121458551Skris 121558551SkrisFri Apr 28 12:38:35 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 121658551Skris 121758551Skris * Renamed strexp.h and strexp.cc to iterator.h and iterator.cc. 121858551Skris Also changed the strexp class to iterator. Continued to work 121958551Skris on style... 122058551Skris 122158551Skris * Updated the version number to 1.6. This reflects all the 122258551Skris recent changes. 122358551Skris 122458551SkrisThu Apr 27 00:14:51 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 122558551Skris 122658551Skris * Added the -D option that properly handles keyword sets that 122758551Skris contain duplicate hash values. 122858551Skris 122958551Skris * Continued the stylistic changes. Added the #pragma once 123058551Skris directive to all the *.h files. Removed all #defines and 123158551Skris replaced them with static consts. Also moved the key_sort 123258551Skris routine from options.cc into the options class as a 123358551Skris member function. 123458551Skris 123558551SkrisMon Apr 3 13:26:55 1989 Doug Schmidt (schmidt at zola.ics.uci.edu) 123658551Skris 123758551Skris * Made massive stylistic changes to bring source code into 123858551Skris conformance with GNU style guidelines. 123958551Skris 124058551SkrisThu Mar 30 23:28:45 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu) 124158551Skris 124258551Skris * Fixed up the output routines so that they generate code 124358551Skris corresponding to the GNU style guidelines. 124458551Skris 124558551SkrisSat Mar 11 13:12:37 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 124658551Skris 124758551Skris * Fixed Stderr constructors so that they wouldn't try to 124858551Skris use the base class initializer syntax for the static 124958551Skris class variable Program_Name. G++ 1.34 is stricter in 125058551Skris enforcing the rules! 125158551Skris 125258551SkrisFri Mar 10 11:24:14 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 125358551Skris 125458551Skris * Removed -v and ``| more'' from the Makefile to keep rfg happy... 125558551Skris 125658551SkrisThu Mar 2 12:37:30 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu) 125758551Skris 125858551Skris * Sent latest GNU gperf version 1.5 to Doug Lea for inclusion 125958551Skris into libg++ 1.34. Note that there is a small bug with 126058551Skris the new %{ ... %} source inclusion facility, since it doesn't 126158551Skris understand comments and will barf if %{ or %} appear nested 126258551Skris inside the outermost delimiters. This is too trivial of 126358551Skris a defect to fix at the moment... 126458551Skris 126558551SkrisTue Feb 28 11:19:58 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 126658551Skris 126758551Skris * Added the -K option, which allows the user to provide a 126858551Skris alternative name for the keyword structure component. 126958551Skris The default is still ``name.'' 127058551Skris 127158551Skris * Added the LEX and YACC-like ability to include arbitrary 127258551Skris text at the beginning of the generated C source code output. 127358551Skris This required two new functions Get_Special_Input, 127458551Skris Key_List::Save_Include_Src; 127558551Skris 127658551Skris * Fixed memory allocation bug in Key_List::Set_Types. 127758551Skris Variable Return_Type needs 1 additional location 127858551Skris to store the "*" if the -p option is used. 127958551Skris 128058551Skris * Added code to NULL terminate both Struct_Tag and Return_Type, 128158551Skris *after* the strncpy (stupid mistake). 128258551Skris 128358551SkrisMon Feb 27 14:39:51 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 128458551Skris 128558551Skris * Added a new option -N. This allows the user to specify the 128658551Skris name to be used for the generated lookup function. The 128758551Skris default name is still ``in_word_set.'' This makes it 128858551Skris possible to completely automate the perfect hash function 128958551Skris generation process! 129058551Skris 129158551SkrisMon Feb 20 23:33:14 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 129258551Skris 129358551Skris * Corrected the Hash_Table::operator () function so that 129458551Skris *it* is responsible for deciding when a new key has the 129558551Skris same signature as a previously seen key. The key length 129658551Skris information is now used internally to this function to 129758551Skris decide whether to add to the hash table those keys with 129858551Skris the same key sets, but different lengths. Before, this 129958551Skris was handled by the Key_List::Read_Keys function. However, 130058551Skris this failed to work for certain duplicate keys, since 130158551Skris they weren't being entered into the hash table properly. 130258551Skris 130358551SkrisSun Feb 19 16:02:51 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 130458551Skris 130558551Skris * Modified class Options by moving the enum Option_Type out 130658551Skris of the class. This is to satisfy the new enumeration 130758551Skris scope rules in C++. 130858551Skris 130958551SkrisSun Jan 15 15:12:09 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu) 131058551Skris 131158551Skris * Incremented the version number upto 1.4 to reflect the new 131258551Skris options that affect the generated code. Send the new 131358551Skris distribution off to Michael for use with g++ 1.33. 131458551Skris 131558551Skris * Added a fix to Key_List::Read_Keys so that it checks for links 131658551Skris properly when the -n option is used. Previously, it didn't 131758551Skris catch obvious links, which caused it to spend large amount 131858551Skris of time searching for a solution that could never occur! 131958551Skris 132058551Skris * Modified the Key_List data structure to record *both* the 132158551Skris minimum and the maximum key lengths. This information 132258551Skris is now computed in Key_List::Read_Keys, and thus 132358551Skris Key_List::Print_Min_Max doesn't need to bother. 132458551Skris 132558551Skris * Modifed the key position iterator scheme in options.cc to 132658551Skris eliminate the need for member function Options::Advance. 132758551Skris Now, the Options::Get function performs the advancement 132858551Skris automatically, obviating the need for an extra function call. 132958551Skris 133058551Skris * Added the new function Options::Print_Options, to print out 133158551Skris the user-specified command line options to generated C 133258551Skris output file. 133358551Skris 133458551Skris * Added a new function, Key_List::Print_Keylength_Table, 133558551Skris which creates a table of lengths for use in speeding 133658551Skris up the keyword search. This also meant that a new 133758551Skris option, -l (LENTABLE) is recognized. It controls 133858551Skris whether the length table is printed and the comparison 133958551Skris made in the generated function ``in_word_set.'' 134058551Skris 134158551Skris * Added a comment at the top of the generated C code 134258551Skris output file that tells what version of gperf was used. 134358551Skris Next, I'll also dump out the command line options 134458551Skris as a comment too. Thanks to Michael Tiemann for the 134558551Skris feedback on this. 134658551Skris 134758551Skris * Fixed the -n option to make it work correctly with 134858551Skris other parts of the program (most notably the Perfect::Hash 134958551Skris function and the computation of minimum and maximum lengths. 135058551Skris 135158551SkrisFri Jan 13 21:25:27 1989 Doug Schmidt (schmidt at siam.ics.uci.edu) 135258551Skris 135358551Skris * Realized the the need to add a test that will enable 135458551Skris optimziation of the generated C code in the ``hash'' function 135558551Skris by checking whether all the requested key positions are 135658551Skris guaranteed to exist due to the comparison in `in_word_set.'' 135758551Skris I'll put this in soon.... 135858551Skris 135958551SkrisThu Jan 12 20:09:21 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 136058551Skris 136158551Skris * Added pascal, modula3, and modula2 tests inputs to the 136258551Skris Makefile 136358551Skris 136458551Skris * Recognised that there is a bug with the -n option. However 136558551Skris I'm too busy to fix it properly, right now. The problem 136658551Skris is that the generated #define end up being 0, since that's 136758551Skris my hack to make -n work. This needs complete rethinking! 136858551Skris 136958551SkrisTue Jan 10 00:08:16 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu) 137058551Skris 137158551Skris * Added a new option, -n, that instructs gperf to not use the 137258551Skris length of an identifier when computing the hash functions. 137358551Skris I'm not sure how useful this is! 137458551Skris 137558551Skris * Retransmitted the distribution to rocky.oswego.edu. Hopefully, 137658551Skris this will work! 137758551Skris 137858551Skris * Began fixing the indentation and capitalization to conform 137958551Skris to the GNU coding guidelines. 138058551Skris 138158551SkrisMon Jan 9 22:23:18 1989 Doug Schmidt (schmidt at pompe.ics.uci.edu) 138258551Skris 138358551Skris * Fixed horrible bug in Read_Line::Readln_Aux. This was 138458551Skris a subtle and pernicous off-by-1 error, that overwrote 138558551Skris past the last character of the input string buffer. I 138658551Skris think this fault was killing the vax! 138758551Skris 138858551Skris * Yow, fixed an oversight in List_Node::List_Node, where the 138958551Skris pointer field Next was uninitialized. Luckily, the new routine 139058551Skris seems to return 0 filled objects the first time through! 139158551Skris 139258551SkrisSun Jan 8 13:43:14 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu) 139358551Skris 139458551Skris * Modified the ``key linked'' diagnostic in Key_List::Read_Keys 139558551Skris to be more helpful and easy to read. 139658551Skris 139758551Skris * Fixed the List_Node::List_Node so that it would ignore trailing 139858551Skris fields if the -t option was not enabled. 139958551Skris 140058551Skris * Moved the List_Node declarations out of keylist.h and 140158551Skris into a file of its own, called listnode.cc and listnode.h 140258551Skris Made Set_Sort a member function of class List_Node. 140358551Skris 140458551Skris * Massively updated the documentation in the gperf.texinfo file. 140558551Skris 140658551Skris * Polished off the major revision to the print functions, 140758551Skris added a few new tests in the Makefile to check for the 140858551Skris validity of the program and ftp'ed the entire distribution 140958551Skris off to Doug Lea for libg++. ( changed it to 141058551Skris 1.3 to reflect the major changes with the generated 141158551Skris C code ). 141258551Skris 141358551Skris * Fixed Key_List::Print_Switch to deal with the -p and -t options. 141458551Skris This meant that the ``still-born'' function Key_List:: 141558551Skris Print_Type_Switch was superflous, so I removed it. 141658551Skris Also, removed the restriction in Option that the -p and 141758551Skris -t options couldn't be used simultaneously. 141858551Skris 141958551Skris * Modified List_Node::List_Node, to perform only 1 call to 142058551Skris ``new'' when dynamically allocating memory for the Key_Set 142158551Skris and the Uniq_Set. 142258551Skris 142358551SkrisSat Jan 7 14:10:51 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu) 142458551Skris 142558551Skris * Fixed a big bug with the new policy of nesting the 142658551Skris wordlist inside of generated function ``in_word_set.'' 142758551Skris I'd forgotten to declare the wordlist array as static! 142858551Skris ( arrgh ). 142958551Skris 143058551Skris * Added a new function Key_List::Set_Types, that figures out 143158551Skris the return type for generated function ``in_word_set,'' 143258551Skris the user-defined ``struct tag,'' if one is used, and also 143358551Skris formates the array type for the static local array. 143458551Skris 143558551Skris * Changed the print routines to take advantage of the 143658551Skris new -p option. 143758551Skris 143858551Skris * Began adding the hooks to allow the return of a pointer 143958551Skris to a user defined struct location from the generated 144058551Skris ``in_word_set'' function instead of the current 0 or 1 144158551Skris return value. Created function Key_List::Print_Type_Switch 144258551Skris and added option -p to class Option, allowing the user to 144358551Skris request generation of the aforementioned pointers returned 144458551Skris instead of booleans. 144558551Skris 144658551Skris * Put in checks in class Option to make sure that -S and -t 144758551Skris options are not used simultaneously. This restriction 144858551Skris will be removed in subsequent releases, once I decide on 144958551Skris a clean way to implement it. 145058551Skris 145158551Skris * Sent version 1.2 to Doug Lea for possible inclusion into 145258551Skris the libg++ distribution. 145358551Skris 145458551Skris * Moved the static word_list array inside the generated function 145558551Skris in_word_set. This supports better data hiding. 145658551Skris 145758551Skris * Added a texinfo file, gperf.texinfo 145858551Skris 145958551Skris * Revised the Makefile to cleanup the droppings from texinfo 146058551Skris and changed the name of gperf.cc and gperf.h to perfect.cc 146158551Skris and perfect.h. 146258551Skris 146358551SkrisFri Jan 6 13:04:45 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu) 146458551Skris 146558551Skris * Implemented the switch statement output format. Much better 146658551Skris for large datasets in terms of space used. 146758551Skris 146858551Skris * Added new functions to break up the Key_List::Output function. 146958551Skris Functions added were Key_List::Print_Switch, Key_List::Print_Min_Max, 147058551Skris Key_List::Print_Keyword_Table, Key_List::Print_Hash_Function, 147158551Skris and Key_List::Print_Lookup_Function. This simplifies the 147258551Skris big mess in Key_List::Output considerably! 147358551Skris 147458551Skris * Added switch statement option to Options, which potentially 147558551Skris trades time for space in the generated lookup code. 147658551Skris 147758551SkrisThu Jan 5 22:46:34 1989 Doug Schmidt (schmidt at siam.ics.uci.edu) 147858551Skris 147958551Skris * Released version 1.1 148058551Skris 148158551Skris * Fixed a bug with Gperf::Merge_Set, it was skipping letters shared 148258551Skris between the Set_1 and Set_2. 148358551Skris 148458551Skris * Added the optimal min/max algorithm in Key_List::Output. This 148558551Skris runs in O ( 3n/2 ), rather than O ( 2n ) time. 148658551Skris 148758551Skris * Changed Gperf::Sort_Set to use insertion sort, rather than 148858551Skris bubble sort. 148958551Skris 149058551Skris * Added a check in Key_List::Output for the special case where 149158551Skris the keys used are 1,$. It is possible to generate more 149258551Skris efficient C code in this case. 1493