1
0
mirror of https://git.savannah.gnu.org/git/gperf.git synced 2025-12-02 21:19:24 +00:00

Rename some long options.

This commit is contained in:
Bruno Haible
2003-01-31 15:03:15 +00:00
parent b0faccc7ef
commit ef37a53d73
5 changed files with 31 additions and 16 deletions

View File

@@ -1,5 +1,11 @@
2002-11-16 Bruno Haible <bruno@clisp.org> 2002-11-16 Bruno Haible <bruno@clisp.org>
* src/options.cc (Options::long_usage): Rename options -H, -N, -l, -G.
(long_options): Add --hash-function-name, --lookup-function-name,
--compare-lengths.
* doc/gperf.texi (Output Details): Rename options -H, -N, -l, -G.
* tests/test-6.exp: Update.
* src/options.cc (DEFAULT_DELIMITERS): Remove newline. * src/options.cc (DEFAULT_DELIMITERS): Remove newline.
* src/options.cc (Options::long_usage): Change default --delimiters. * src/options.cc (Options::long_usage): Change default --delimiters.
* doc/gperf.texi (Input Details): Likewise. * doc/gperf.texi (Input Details): Likewise.

6
NEWS
View File

@@ -3,6 +3,12 @@ New in 2.8:
* Added option -m/--multiple-iterations that reduces the size of the * Added option -m/--multiple-iterations that reduces the size of the
generated table. generated table.
* Added option --output that allows to specify the output file name. * Added option --output that allows to specify the output file name.
* Some options have been renamed:
--hash-fn-name=NAME --> --hash-function-name=NAME
--lookup-fn-name=NAME --> --lookup-function-name=NAME
--compare-strlen --> --compare-lengths
--global --> --global-table
The older variants are still supported for backward compatibility.
* If the input file is given by name, the output file will now contain * If the input file is given by name, the output file will now contain
#line directives referring to the input file. #line directives referring to the input file.
* Bug fixes. * Bug fixes.

View File

@@ -653,13 +653,13 @@ should start with a comma. By default, the emitted code will
zero-initialize structure members following @var{slot-name}. zero-initialize structure members following @var{slot-name}.
@item -H @var{hash-function-name} @item -H @var{hash-function-name}
@itemx --hash-fn-name=@var{hash-function-name} @itemx --hash-function-name=@var{hash-function-name}
Allows you to specify the name for the generated hash function. Default Allows you to specify the name for the generated hash function. Default
name is @samp{hash}. This option permits the use of two hash tables in name is @samp{hash}. This option permits the use of two hash tables in
the same file. the same file.
@item -N @var{lookup-function-name} @item -N @var{lookup-function-name}
@itemx --lookup-fn-name=@var{lookup-function-name} @itemx --lookup-function-name=@var{lookup-function-name}
Allows you to specify the name for the generated lookup function. Allows you to specify the name for the generated lookup function.
Default name is @samp{in_word_set}. This option permits completely Default name is @samp{in_word_set}. This option permits completely
automatic generation of perfect hash functions, especially when multiple automatic generation of perfect hash functions, especially when multiple
@@ -684,7 +684,7 @@ 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 @item -l
@itemx --compare-strlen @itemx --compare-lengths
Compare keyword lengths before trying a string comparison. This option Compare keyword lengths before trying a string comparison. This option
is mandatory for binary comparisons (@pxref{Binary Strings}). It also might is mandatory for binary comparisons (@pxref{Binary Strings}). It also might
cut down on the number of string comparisons made during the lookup, since cut down on the number of string comparisons made during the lookup, since
@@ -718,7 +718,7 @@ beginning of the code. By default, this is not done; the user must
include this header file himself to allow compilation of the code. include this header file himself to allow compilation of the code.
@item -G @item -G
@itemx --global @itemx --global-table
Generate the static table of keywords as a static global variable, Generate the static table of keywords as a static global variable,
rather than hiding it inside of the lookup function (which is the rather than hiding it inside of the lookup function (which is the
default behavior). default behavior).

View File

@@ -125,11 +125,11 @@ Options::long_usage (FILE * stream) const
" Initializers for additional components in the keyword\n" " Initializers for additional components in the keyword\n"
" structure.\n"); " structure.\n");
fprintf (stream, fprintf (stream,
" -H, --hash-fn-name=NAME\n" " -H, --hash-function-name=NAME\n"
" Specify name of generated hash function. Default is\n" " Specify name of generated hash function. Default is\n"
" 'hash'.\n"); " 'hash'.\n");
fprintf (stream, fprintf (stream,
" -N, --lookup-fn-name=NAME\n" " -N, --lookup-function-name=NAME\n"
" Specify name of generated lookup function. Default\n" " Specify name of generated lookup function. Default\n"
" name is 'in_word_set'.\n"); " name is 'in_word_set'.\n");
fprintf (stream, fprintf (stream,
@@ -138,7 +138,7 @@ Options::long_usage (FILE * stream) const
fprintf (stream, fprintf (stream,
" -7, --seven-bit Assume 7-bit characters.\n"); " -7, --seven-bit Assume 7-bit characters.\n");
fprintf (stream, fprintf (stream,
" -l, --compare-strlen Compare key lengths before trying a string\n" " -l, --compare-lengths Compare key lengths before trying a string\n"
" comparison. This is necessary if the keywords\n" " comparison. This is necessary if the keywords\n"
" contain NUL bytes. It also helps cut down on the\n" " contain NUL bytes. It also helps cut down on the\n"
" number of string comparisons made during the lookup.\n"); " number of string comparisons made during the lookup.\n");
@@ -155,7 +155,7 @@ Options::long_usage (FILE * stream) const
" -I, --includes Include the necessary system include file <string.h>\n" " -I, --includes Include the necessary system include file <string.h>\n"
" at the beginning of the code.\n"); " at the beginning of the code.\n");
fprintf (stream, fprintf (stream,
" -G, --global Generate the static table of keywords as a static\n" " -G, --global-table Generate the static table of keywords as a static\n"
" global variable, rather than hiding it inside of the\n" " global variable, rather than hiding it inside of the\n"
" lookup function (which is the default behavior).\n"); " lookup function (which is the default behavior).\n");
fprintf (stream, fprintf (stream,
@@ -538,20 +538,23 @@ static const struct option long_options[] =
{ "language", required_argument, NULL, 'L' }, { "language", required_argument, NULL, 'L' },
{ "slot-name", required_argument, NULL, 'K' }, { "slot-name", required_argument, NULL, 'K' },
{ "initializer-suffix", required_argument, NULL, 'F' }, { "initializer-suffix", required_argument, NULL, 'F' },
{ "hash-fn-name", required_argument, NULL, 'H' }, { "hash-fn-name", required_argument, NULL, 'H' }, /* backward compatibility */
{ "lookup-fn-name", required_argument, NULL, 'N' }, { "hash-function-name", required_argument, NULL, 'H' },
{ "lookup-fn-name", required_argument, NULL, 'N' }, /* backward compatibility */
{ "lookup-function-name", required_argument, NULL, 'N' },
{ "class-name", required_argument, NULL, 'Z' }, { "class-name", required_argument, NULL, 'Z' },
{ "seven-bit", no_argument, NULL, '7' }, { "seven-bit", no_argument, NULL, '7' },
{ "compare-strncmp", no_argument, NULL, 'c' }, { "compare-strncmp", no_argument, NULL, 'c' },
{ "readonly-tables", no_argument, NULL, 'C' }, { "readonly-tables", no_argument, NULL, 'C' },
{ "enum", no_argument, NULL, 'E' }, { "enum", no_argument, NULL, 'E' },
{ "includes", no_argument, NULL, 'I' }, { "includes", no_argument, NULL, 'I' },
{ "global", no_argument, NULL, 'G' }, { "global-table", no_argument, NULL, 'G' },
{ "word-array-name", required_argument, NULL, 'W' }, { "word-array-name", required_argument, NULL, 'W' },
{ "switch", required_argument, NULL, 'S' }, { "switch", required_argument, NULL, 'S' },
{ "omit-struct-type", no_argument, NULL, 'T' }, { "omit-struct-type", no_argument, NULL, 'T' },
{ "key-positions", required_argument, NULL, 'k' }, { "key-positions", required_argument, NULL, 'k' },
{ "compare-strlen", no_argument, NULL, 'l' }, { "compare-strlen", no_argument, NULL, 'l' }, /* backward compatibility */
{ "compare-lengths", no_argument, NULL, 'l' },
{ "duplicates", no_argument, NULL, 'D' }, { "duplicates", no_argument, NULL, 'D' },
{ "fast", required_argument, NULL, 'f' }, { "fast", required_argument, NULL, 'f' },
{ "initial-asso", required_argument, NULL, 'i' }, { "initial-asso", required_argument, NULL, 'i' },

View File

@@ -33,16 +33,16 @@ Details in the output code:
-F, --initializer-suffix=INITIALIZERS -F, --initializer-suffix=INITIALIZERS
Initializers for additional components in the keyword Initializers for additional components in the keyword
structure. structure.
-H, --hash-fn-name=NAME -H, --hash-function-name=NAME
Specify name of generated hash function. Default is Specify name of generated hash function. Default is
'hash'. 'hash'.
-N, --lookup-fn-name=NAME -N, --lookup-function-name=NAME
Specify name of generated lookup function. Default Specify name of generated lookup function. Default
name is 'in_word_set'. name is 'in_word_set'.
-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 -l, --compare-lengths Compare key lengths before trying a string
comparison. This is necessary if the keywords comparison. This is necessary if the keywords
contain NUL bytes. It also helps cut down on the contain NUL bytes. It also helps cut down on the
number of string comparisons made during the lookup. number of string comparisons made during the lookup.
@@ -54,7 +54,7 @@ Details in the output code:
lookup function rather than with defines. lookup function rather than with defines.
-I, --includes Include the necessary system include file <string.h> -I, --includes Include the necessary system include file <string.h>
at the beginning of the code. at the beginning of the code.
-G, --global Generate the static table of keywords as a static -G, --global-table Generate the static table of keywords as a static
global variable, rather than hiding it inside of the global variable, rather than hiding it inside of the
lookup function (which is the default behavior). lookup function (which is the default behavior).
-W, --word-array-name=NAME -W, --word-array-name=NAME