summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2003-01-31 15:03:15 +0000
committerBruno Haible <bruno@clisp.org>2003-01-31 15:03:15 +0000
commitef37a53d732206d047aad6ffffa9ea88b1dbb2c3 (patch)
tree169c4ba14c531442dd3162f760c9cd72963c71e9
parentb0faccc7ef435f9c0713f5369bbfdae16525360b (diff)
downloadgperf-ef37a53d732206d047aad6ffffa9ea88b1dbb2c3.tar.gz
Rename some long options.
-rw-r--r--ChangeLog6
-rw-r--r--NEWS6
-rw-r--r--doc/gperf.texi8
-rw-r--r--src/options.cc19
-rw-r--r--tests/test-6.exp8
5 files changed, 31 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 2481ad0..1fd6014 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
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 (Options::long_usage): Change default --delimiters.
* doc/gperf.texi (Input Details): Likewise.
diff --git a/NEWS b/NEWS
index 97cf035..7b58f64 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,12 @@ New in 2.8:
* Added option -m/--multiple-iterations that reduces the size of the
generated table.
* 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
#line directives referring to the input file.
* Bug fixes.
diff --git a/doc/gperf.texi b/doc/gperf.texi
index cc39f30..84fa53b 100644
--- a/doc/gperf.texi
+++ b/doc/gperf.texi
@@ -653,13 +653,13 @@ should start with a comma. By default, the emitted code will
zero-initialize structure members following @var{slot-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
name is @samp{hash}. This option permits the use of two hash tables in
the same file.
@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.
Default name is @samp{in_word_set}. This option permits completely
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.
@item -l
-@itemx --compare-strlen
+@itemx --compare-lengths
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
@@ -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.
@item -G
-@itemx --global
+@itemx --global-table
Generate the static table of keywords as a static global variable,
rather than hiding it inside of the lookup function (which is the
default behavior).
diff --git a/src/options.cc b/src/options.cc
index c38adae..887bc8b 100644
--- a/src/options.cc
+++ b/src/options.cc
@@ -125,11 +125,11 @@ Options::long_usage (FILE * stream) const
" Initializers for additional components in the keyword\n"
" structure.\n");
fprintf (stream,
- " -H, --hash-fn-name=NAME\n"
+ " -H, --hash-function-name=NAME\n"
" Specify name of generated hash function. Default is\n"
" 'hash'.\n");
fprintf (stream,
- " -N, --lookup-fn-name=NAME\n"
+ " -N, --lookup-function-name=NAME\n"
" Specify name of generated lookup function. Default\n"
" name is 'in_word_set'.\n");
fprintf (stream,
@@ -138,7 +138,7 @@ 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"
+ " -l, --compare-lengths 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");
@@ -155,7 +155,7 @@ Options::long_usage (FILE * stream) const
" -I, --includes Include the necessary system include file <string.h>\n"
" at the beginning of the code.\n");
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"
" lookup function (which is the default behavior).\n");
fprintf (stream,
@@ -538,20 +538,23 @@ static const struct option long_options[] =
{ "language", required_argument, NULL, 'L' },
{ "slot-name", required_argument, NULL, 'K' },
{ "initializer-suffix", required_argument, NULL, 'F' },
- { "hash-fn-name", required_argument, NULL, 'H' },
- { "lookup-fn-name", required_argument, NULL, 'N' },
+ { "hash-fn-name", required_argument, NULL, 'H' }, /* backward compatibility */
+ { "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' },
{ "seven-bit", no_argument, NULL, '7' },
{ "compare-strncmp", no_argument, NULL, 'c' },
{ "readonly-tables", no_argument, NULL, 'C' },
{ "enum", no_argument, NULL, 'E' },
{ "includes", no_argument, NULL, 'I' },
- { "global", no_argument, NULL, 'G' },
+ { "global-table", no_argument, NULL, 'G' },
{ "word-array-name", required_argument, NULL, 'W' },
{ "switch", required_argument, NULL, 'S' },
{ "omit-struct-type", no_argument, NULL, 'T' },
{ "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' },
{ "fast", required_argument, NULL, 'f' },
{ "initial-asso", required_argument, NULL, 'i' },
diff --git a/tests/test-6.exp b/tests/test-6.exp
index f73a9a5..6985dd9 100644
--- a/tests/test-6.exp
+++ b/tests/test-6.exp
@@ -33,16 +33,16 @@ Details in the output code:
-F, --initializer-suffix=INITIALIZERS
Initializers for additional components in the keyword
structure.
- -H, --hash-fn-name=NAME
+ -H, --hash-function-name=NAME
Specify name of generated hash function. Default is
'hash'.
- -N, --lookup-fn-name=NAME
+ -N, --lookup-function-name=NAME
Specify name of generated lookup function. Default
name is 'in_word_set'.
-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
+ -l, --compare-lengths 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.
@@ -54,7 +54,7 @@ Details in the output code:
lookup function rather than with defines.
-I, --includes Include the necessary system include file <string.h>
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
lookup function (which is the default behavior).
-W, --word-array-name=NAME