1 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.022.
2 .TH GPERF "1" "September 2000" "GNU gperf 2.7.2" FSF
4 gperf \- generate a perfect hash function from a key set
7 [\fIOPTION\fR]... [\fIINPUT-FILE\fR]
9 GNU `gperf' generates perfect hash functions.
11 If a long option shows an argument as mandatory, then it is mandatory
12 for the equivalent short option also.
13 .SS "Input file interpretation:"
15 \fB\-e\fR, \fB\-\-delimiters\fR=\fIDELIMITER\-LIST\fR
16 Allow user to provide a string containing delimiters
17 used to separate keywords from their attributes.
20 \fB\-t\fR, \fB\-\-struct\-type\fR
21 Allows the user to include a structured type
22 declaration for generated code. Any text before %%
23 is considered part of the type declaration. Key
24 words and additional fields may follow this, one
25 group of fields per line.
26 .SS "Language for the output code:"
28 \fB\-L\fR, \fB\-\-language\fR=\fILANGUAGE\-NAME\fR
29 Generates code in the specified language. Languages
30 handled are currently C++, ANSI-C, C, and KR-C. The
32 .SS "Details in the output code:"
34 \fB\-K\fR, \fB\-\-slot\-name\fR=\fINAME\fR
35 Select name of the keyword component in the keyword
38 \fB\-F\fR, \fB\-\-initializer\-suffix\fR=\fIINITIALIZERS\fR
39 Initializers for additional components in the keyword
42 \fB\-H\fR, \fB\-\-hash\-fn\-name\fR=\fINAME\fR
43 Specify name of generated hash function. Default is
46 \fB\-N\fR, \fB\-\-lookup\-fn\-name\fR=\fINAME\fR
47 Specify name of generated lookup function. Default
48 name is `in_word_set'.
50 \fB\-Z\fR, \fB\-\-class\-name\fR=\fINAME\fR
51 Specify name of generated C++ class. Default name is
54 \fB\-7\fR, \fB\-\-seven\-bit\fR
55 Assume 7-bit characters.
57 \fB\-c\fR, \fB\-\-compare\-strncmp\fR
58 Generate comparison code using strncmp rather than
61 \fB\-C\fR, \fB\-\-readonly\-tables\fR
62 Make the contents of generated lookup tables
63 constant, i.e., readonly.
65 \fB\-E\fR, \fB\-\-enum\fR
66 Define constant values using an enum local to the
67 lookup function rather than with defines.
69 \fB\-I\fR, \fB\-\-includes\fR
70 Include the necessary system include file <string.h>
71 at the beginning of the code.
73 \fB\-G\fR, \fB\-\-global\fR
74 Generate the static table of keywords as a static
75 global variable, rather than hiding it inside of the
76 lookup function (which is the default behavior).
78 \fB\-W\fR, \fB\-\-word\-array\-name\fR=\fINAME\fR
79 Specify name of word list array. Default name is
82 \fB\-S\fR, \fB\-\-switch\fR=\fICOUNT\fR
83 Causes the generated C code to use a switch
84 statement scheme, rather than an array lookup table.
85 This can lead to a reduction in both time and space
86 requirements for some keyfiles. The COUNT argument
87 determines how many switch statements are generated.
88 A value of 1 generates 1 switch containing all the
89 elements, a value of 2 generates 2 tables with 1/2
90 the elements in each table, etc. If COUNT is very
91 large, say 1000000, the generated C code does a
94 \fB\-T\fR, \fB\-\-omit\-struct\-type\fR
95 Prevents the transfer of the type declaration to the
96 output file. Use this option if the type is already
98 .SS "Algorithm employed by gperf:"
100 \fB\-k\fR, \fB\-\-key\-positions\fR=\fIKEYS\fR
101 Select the key positions used in the hash function.
102 The allowable choices range between 1-126, inclusive.
103 The positions are separated by commas, ranges may be
104 used, and key positions may occur in any order.
105 Also, the meta-character '*' causes the generated
106 hash function to consider ALL key positions, and $
107 indicates the ``final character'' of a key, e.g.,
110 \fB\-l\fR, \fB\-\-compare\-strlen\fR
111 Compare key lengths before trying a string
112 comparison. This helps cut down on the number of
113 string comparisons made during the lookup.
115 \fB\-D\fR, \fB\-\-duplicates\fR
116 Handle keywords that hash to duplicate values. This
117 is useful for certain highly redundant keyword sets.
119 \fB\-f\fR, \fB\-\-fast\fR=\fIITERATIONS\fR
120 Generate the gen-perf.hash function ``fast''. This
121 decreases gperf's running time at the cost of
122 minimizing generated table size. The numeric
123 argument represents the number of times to iterate
124 when resolving a collision. `0' means ``iterate by
125 the number of keywords''.
127 \fB\-i\fR, \fB\-\-initial\-asso\fR=\fIN\fR
128 Provide an initial value for the associate values
129 array. Default is 0. Setting this value larger helps
130 inflate the size of the final table.
132 \fB\-j\fR, \fB\-\-jump\fR=\fIJUMP\-VALUE\fR
133 Affects the ``jump value'', i.e., how far to advance
134 the associated character value upon collisions. Must
135 be an odd number, default is 5.
137 \fB\-n\fR, \fB\-\-no\-strlen\fR
138 Do not include the length of the keyword when
139 computing the hash function.
141 \fB\-o\fR, \fB\-\-occurrence\-sort\fR
142 Reorders input keys by frequency of occurrence of
143 the key sets. This should decrease the search time
146 \fB\-r\fR, \fB\-\-random\fR
147 Utilizes randomness to initialize the associated
150 \fB\-s\fR, \fB\-\-size\-multiple\fR=\fIN\fR
151 Affects the size of the generated hash table. The
152 numeric argument N indicates ``how many times larger
153 or smaller'' the associated value range should be,
154 in relationship to the number of keys, e.g. a value
155 of 3 means ``allow the maximum associated value to
156 be about 3 times larger than the number of input
157 keys.'' Conversely, a value of \fB\-3\fR means ``make the
158 maximum associated value about 3 times smaller than
159 the number of input keys. A larger table should
160 decrease the time required for an unsuccessful
161 search, at the expense of extra table space. Default
163 .SS "Informative output:"
165 \fB\-h\fR, \fB\-\-help\fR
168 \fB\-v\fR, \fB\-\-version\fR
169 Print the gperf version number.
171 \fB\-d\fR, \fB\-\-debug\fR
172 Enables the debugging option (produces verbose
173 output to the standard error).
175 Report bugs to <bug-gnu-utils@gnu.org>.
177 The full documentation for
179 is maintained as a Texinfo manual. If the
183 programs are properly installed at your site, the command
187 should give you access to the complete manual.