summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2003-01-29 12:31:42 +0000
committerBruno Haible <bruno@clisp.org>2003-01-29 12:31:42 +0000
commit3aff1fd64fdbf04ec108e989e342a66f353892c5 (patch)
tree89ca9babfe35db2bdfe49921bb1e31e4a3d05f37
parentf54d310530bf4e5c66deefe1ffe0b21f35a72162 (diff)
downloadgperf-3aff1fd64fdbf04ec108e989e342a66f353892c5.tar.gz
Slightly reorganize command line options help.
-rw-r--r--ChangeLog7
-rw-r--r--doc/gperf.texi22
-rw-r--r--src/options.cc9
-rw-r--r--tests/test-6.exp7
4 files changed, 27 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index a932ac1..797b3a0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2002-11-16 Bruno Haible <bruno@clisp.org>
+
+ * doc/gperf.texi: Move description of option -l from section
+ Algorithmic Details to section Output Details.
+ * src/options.cc (Options::long_usage): Likewise.
+ * tests/test-6.exp: Update.
+
2002-11-12 Bruno Haible <bruno@clisp.org>
* src/options.h (Output::get_output_file_name): New method.
diff --git a/doc/gperf.texi b/doc/gperf.texi
index bbf9fb3..52fb95e 100644
--- a/doc/gperf.texi
+++ b/doc/gperf.texi
@@ -683,6 +683,17 @@ test like @samp{c >= 'A' && c <= 'Z'} guarantees this.) This was the
default in versions of @code{gperf} earlier than 2.7; now the default is
to support 8-bit and multibyte characters.
+@item -l
+@itemx --compare-strlen
+Compare keyword lengths before trying a string comparison. This option
+is mandatory for binary comparisons (@pxref{Binary Strings}). It also might
+cut down on the number of string comparisons made during the lookup, since
+keywords with different lengths are never compared via @code{strcmp}.
+However, using @samp{-l} might greatly increase the size of the
+generated C code if the lookup table range is large (which implies that
+the switch option @samp{-S} is not enabled), since the length table
+contains as many elements as there are entries in the lookup table.
+
@item -c
@itemx --compare-strncmp
Generates C code that uses the @code{strncmp} function to perform
@@ -767,17 +778,6 @@ with length less than the indicated byte positions work properly, since
selected byte positions exceeding the keyword length are simply not
referenced in the hash function.
-@item -l
-@itemx --compare-strlen
-Compare keyword lengths before trying a string comparison. This might cut
-down on the number of string comparisons made during the lookup, since
-keywords with different lengths are never compared via @code{strcmp}.
-However, using @samp{-l} might greatly increase the size of the
-generated C code if the lookup table range is large (which implies that
-the switch option @samp{-S} is not enabled), since the length table
-contains as many elements as there are entries in the lookup table.
-This option is mandatory for binary comparisons (@pxref{Binary Strings}).
-
@item -D
@itemx --duplicates
@cindex Duplicates
diff --git a/src/options.cc b/src/options.cc
index aed4af2..dd901ed 100644
--- a/src/options.cc
+++ b/src/options.cc
@@ -138,6 +138,11 @@ Options::long_usage (FILE * stream) const
fprintf (stream,
" -7, --seven-bit Assume 7-bit characters.\n");
fprintf (stream,
+ " -l, --compare-strlen Compare key lengths before trying a string\n"
+ " comparison. This is necessary if the keywords\n"
+ " contain NUL bytes. It also helps cut down on the\n"
+ " number of string comparisons made during the lookup.\n");
+ fprintf (stream,
" -c, --compare-strncmp Generate comparison code using strncmp rather than\n"
" strcmp.\n");
fprintf (stream,
@@ -188,10 +193,6 @@ Options::long_usage (FILE * stream) const
" $,1,2,4,6-10.\n",
Positions::MAX_KEY_POS);
fprintf (stream,
- " -l, --compare-strlen Compare key lengths before trying a string\n"
- " comparison. This helps cut down on the number of\n"
- " string comparisons made during the lookup.\n");
- fprintf (stream,
" -D, --duplicates Handle keywords that hash to duplicate values. This\n"
" is useful for certain highly redundant keyword sets.\n");
fprintf (stream,
diff --git a/tests/test-6.exp b/tests/test-6.exp
index 856390b..75c2ee3 100644
--- a/tests/test-6.exp
+++ b/tests/test-6.exp
@@ -42,6 +42,10 @@ Details in the output code:
-Z, --class-name=NAME Specify name of generated C++ class. Default name is
'Perfect_Hash'.
-7, --seven-bit Assume 7-bit characters.
+ -l, --compare-strlen Compare key lengths before trying a string
+ comparison. This is necessary if the keywords
+ contain NUL bytes. It also helps cut down on the
+ number of string comparisons made during the lookup.
-c, --compare-strncmp Generate comparison code using strncmp rather than
strcmp.
-C, --readonly-tables Make the contents of generated lookup tables
@@ -81,9 +85,6 @@ Algorithm employed by gperf:
hash function to consider ALL key positions, and $
indicates the "final character" of a key, e.g.,
$,1,2,4,6-10.
- -l, --compare-strlen Compare key lengths before trying a string
- comparison. This helps cut down on the number of
- string comparisons made during the lookup.
-D, --duplicates Handle keywords that hash to duplicate values. This
is useful for certain highly redundant keyword sets.
-f, --fast=ITERATIONS Generate the gen-perf.hash function "fast". This