Go to the first, previous, next, last section, table of contents.
- `-K key name'
-
This option is only useful when option `-t' has been given.
By default, the program assumes the structure component identifier for
the keyword is `name'. This option allows an arbitrary choice of
identifier for this component, although it still must occur as the first
field in your supplied
struct
.
- `-H hash function name'
-
Allows you to specify the name for the generated hash function. Default
name is `hash'. This option permits the use of two hash tables in the
same file.
- `-N lookup function name'
-
Allows you to specify the name for the generated lookup function.
Default name is `in_word_set'. This option permits completely automatic
generation of perfect hash functions, especially when multiple generated
hash functions are used in the same application.
- `-Z class name'
-
This option is only useful when option `-L C++' has been given.
It allows you to specify the name of generated C++ class. Default name is
Perfect_Hash
.
- `-7'
-
This option specifies that all strings that will be passed as arguments
to the generated hash function and the generated lookup function will
solely consist of 7-bit ASCII characters (characters in the range 0..127).
(Note that the ANSI C functions
isalnum
and isgraph
do
not guarantee that a character is in this range. Only an explicit
test like `c >= 'A' && c <= 'Z'' guarantees this.) This was the
default in earlier versions of gperf
; now the default is to assume
8-bit characters.
- `-c'
-
Generates C code that uses the
strncmp
function to perform
string comparisons. The default action is to use strcmp
.
- `-C'
-
Makes the contents of all generated lookup tables constant, i.e.,
"readonly". Many compilers can generate more efficient code for this
by putting the tables in readonly memory.
- `-E'
-
Define constant values using an enum local to the lookup function rather
than with #defines. This also means that different lookup functions can
reside in the same file. Thanks to James Clark
<[email protected]>
.
- `-I'
-
Include the necessary system include file,
<string.h>
, at the
beginning of the code. By default, this is not done; the user must
include this header file himself to allow compilation of the code.
- `-G'
-
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 hash table array name'
-
Allows you to specify the name for the generated array containing the
hash table. Default name is `wordlist'. This option permits the
use of two hash tables in the same file, even when the option `-G'
is given.
- `-S total switch statements'
-
Causes the generated C code to use a
switch
statement scheme,
rather than an array lookup table. This can lead to a reduction in both
time and space requirements for some keyfiles. The argument to this
option determines how many switch
statements are generated. A
value of 1 generates 1 switch
containing all the elements, a
value of 2 generates 2 tables with 1/2 the elements in each
switch
, etc. This is useful since many C compilers cannot
correctly generate code for large switch
statements. This option
was inspired in part by Keith Bostic's original C program.
- `-T'
-
Prevents the transfer of the type declaration to the output file. Use
this option if the type is already defined elsewhere.
- `-p'
-
This option is supported for compatibility with previous releases of
gperf
. It does not do anything.
Go to the first, previous, next, last section, table of contents.