1
0
mirror of https://git.savannah.gnu.org/git/gperf.git synced 2025-12-02 13:09:22 +00:00

Slightly reorganize command line options help.

This commit is contained in:
Bruno Haible
2003-01-29 12:31:42 +00:00
parent f54d310530
commit 3aff1fd64f
4 changed files with 27 additions and 18 deletions

View File

@@ -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> 2002-11-12 Bruno Haible <bruno@clisp.org>
* src/options.h (Output::get_output_file_name): New method. * src/options.h (Output::get_output_file_name): New method.

View File

@@ -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 default in versions of @code{gperf} earlier than 2.7; now the default is
to support 8-bit and multibyte characters. 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 @item -c
@itemx --compare-strncmp @itemx --compare-strncmp
Generates C code that uses the @code{strncmp} function to perform 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 selected byte positions exceeding the keyword length are simply not
referenced in the hash function. 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 @item -D
@itemx --duplicates @itemx --duplicates
@cindex Duplicates @cindex Duplicates

View File

@@ -137,6 +137,11 @@ Options::long_usage (FILE * stream) const
" 'Perfect_Hash'.\n"); " 'Perfect_Hash'.\n");
fprintf (stream, fprintf (stream,
" -7, --seven-bit Assume 7-bit characters.\n"); " -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, fprintf (stream,
" -c, --compare-strncmp Generate comparison code using strncmp rather than\n" " -c, --compare-strncmp Generate comparison code using strncmp rather than\n"
" strcmp.\n"); " strcmp.\n");
@@ -187,10 +192,6 @@ Options::long_usage (FILE * stream) const
" indicates the \"final character\" of a key, e.g.,\n" " indicates the \"final character\" of a key, e.g.,\n"
" $,1,2,4,6-10.\n", " $,1,2,4,6-10.\n",
Positions::MAX_KEY_POS); 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, fprintf (stream,
" -D, --duplicates Handle keywords that hash to duplicate values. This\n" " -D, --duplicates Handle keywords that hash to duplicate values. This\n"
" is useful for certain highly redundant keyword sets.\n"); " is useful for certain highly redundant keyword sets.\n");

View File

@@ -42,6 +42,10 @@ Details in the output code:
-Z, --class-name=NAME Specify name of generated C++ class. Default name is -Z, --class-name=NAME Specify name of generated C++ class. Default name is
'Perfect_Hash'. 'Perfect_Hash'.
-7, --seven-bit Assume 7-bit characters. -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 -c, --compare-strncmp Generate comparison code using strncmp rather than
strcmp. strcmp.
-C, --readonly-tables Make the contents of generated lookup tables -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 $ hash function to consider ALL key positions, and $
indicates the "final character" of a key, e.g., indicates the "final character" of a key, e.g.,
$,1,2,4,6-10. $,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 -D, --duplicates Handle keywords that hash to duplicate values. This
is useful for certain highly redundant keyword sets. is useful for certain highly redundant keyword sets.
-f, --fast=ITERATIONS Generate the gen-perf.hash function "fast". This -f, --fast=ITERATIONS Generate the gen-perf.hash function "fast". This