1 GNU `gperf' generates perfect hash functions.
3 Usage: ../src/gperf [OPTION]... [INPUT-FILE]
5 If a long option shows an argument as mandatory, then it is mandatory
6 for the equivalent short option also.
8 Input file interpretation:
9 -e, --delimiters=DELIMITER-LIST
10 Allow user to provide a string containing delimiters
11 used to separate keywords from their attributes.
13 -t, --struct-type Allows the user to include a structured type
14 declaration for generated code. Any text before %%
15 is considered part of the type declaration. Key
16 words and additional fields may follow this, one
17 group of fields per line.
19 Language for the output code:
20 -L, --language=LANGUAGE-NAME
21 Generates code in the specified language. Languages
22 handled are currently C++, ANSI-C, C, and KR-C. The
25 Details in the output code:
26 -K, --slot-name=NAME Select name of the keyword component in the keyword
28 -H, --hash-fn-name=NAME
29 Specify name of generated hash function. Default is
31 -N, --lookup-fn-name=NAME
32 Specify name of generated lookup function. Default
33 name is `in_word_set'.
34 -Z, --class-name=NAME Specify name of generated C++ class. Default name is
36 -7, --seven-bit Assume 7-bit characters.
37 -c, --compare-strncmp Generate comparison code using strncmp rather than
39 -C, --readonly-tables Make the contents of generated lookup tables
40 constant, i.e., readonly.
41 -E, --enum Define constant values using an enum local to the
42 lookup function rather than with defines.
43 -I, --includes Include the necessary system include file <string.h>
44 at the beginning of the code.
45 -G, --global Generate the static table of keywords as a static
46 global variable, rather than hiding it inside of the
47 lookup function (which is the default behavior).
48 -W, --word-array-name=NAME
49 Specify name of word list array. Default name is
51 -S, --switch=COUNT Causes the generated C code to use a switch
52 statement scheme, rather than an array lookup table.
53 This can lead to a reduction in both time and space
54 requirements for some keyfiles. The COUNT argument
55 determines how many switch statements are generated.
56 A value of 1 generates 1 switch containing all the
57 elements, a value of 2 generates 2 tables with 1/2
58 the elements in each table, etc. If COUNT is very
59 large, say 1000000, the generated C code does a
61 -T, --omit-struct-type
62 Prevents the transfer of the type declaration to the
63 output file. Use this option if the type is already
66 Algorithm employed by gperf:
67 -k, --key-positions=KEYS
68 Select the key positions used in the hash function.
69 The allowable choices range between 1-126, inclusive.
70 The positions are separated by commas, ranges may be
71 used, and key positions may occur in any order.
72 Also, the meta-character '*' causes the generated
73 hash function to consider ALL key positions, and $
74 indicates the ``final character'' of a key, e.g.,
76 -l, --compare-strlen Compare key lengths before trying a string
77 comparison. This helps cut down on the number of
78 string comparisons made during the lookup.
79 -D, --duplicates Handle keywords that hash to duplicate values. This
80 is useful for certain highly redundant keyword sets.
81 -f, --fast=ITERATIONS Generate the gen-perf.hash function ``fast''. This
82 decreases gperf's running time at the cost of
83 minimizing generated table size. The numeric
84 argument represents the number of times to iterate
85 when resolving a collision. `0' means ``iterate by
86 the number of keywords''.
87 -i, --initial-asso=N Provide an initial value for the associate values
88 array. Default is 0. Setting this value larger helps
89 inflate the size of the final table.
90 -j, --jump=JUMP-VALUE Affects the ``jump value'', i.e., how far to advance
91 the associated character value upon collisions. Must
92 be an odd number, default is 5.
93 -n, --no-strlen Do not include the length of the keyword when
94 computing the hash function.
95 -o, --occurrence-sort Reorders input keys by frequency of occurrence of
96 the key sets. This should decrease the search time
98 -r, --random Utilizes randomness to initialize the associated
100 -s, --size-multiple=N Affects the size of the generated hash table. The
101 numeric argument N indicates ``how many times larger
102 or smaller'' the associated value range should be,
103 in relationship to the number of keys, e.g. a value
104 of 3 means ``allow the maximum associated value to
105 be about 3 times larger than the number of input
106 keys.'' Conversely, a value of -3 means ``make the
107 maximum associated value about 3 times smaller than
108 the number of input keys. A larger table should
109 decrease the time required for an unsuccessful
110 search, at the expense of extra table space. Default
114 -h, --help Print this message.
115 -v, --version Print the gperf version number.
116 -d, --debug Enables the debugging option (produces verbose
117 output to the standard error).
119 Report bugs to <bug-gnu-utils@gnu.org>.