1 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23.
2 .TH GPERF "1" "May 2007" "GNU gperf 3.0.3" 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 "Output file location:"
15 \fB\-\-output\-file\fR=\fIFILE\fR Write output to specified file.
17 The results are written to standard output if no output file is specified
19 .SS "Input file interpretation:"
21 \fB\-e\fR, \fB\-\-delimiters\fR=\fIDELIMITER\-LIST\fR
22 Allow user to provide a string containing delimiters
23 used to separate keywords from their attributes.
26 \fB\-t\fR, \fB\-\-struct\-type\fR
27 Allows the user to include a structured type
28 declaration for generated code. Any text before %%
29 is considered part of the type declaration. Key
30 words and additional fields may follow this, one
31 group of fields per line.
33 \fB\-\-ignore\-case\fR
34 Consider upper and lower case ASCII characters as
35 equivalent. Note that locale dependent case mappings
37 .SS "Language for the output code:"
39 \fB\-L\fR, \fB\-\-language\fR=\fILANGUAGE\-NAME\fR
40 Generates code in the specified language. Languages
41 handled are currently C++, ANSI-C, C, and KR-C. The
43 .SS "Details in the output code:"
45 \fB\-K\fR, \fB\-\-slot\-name\fR=\fINAME\fR
46 Select name of the keyword component in the keyword
49 \fB\-F\fR, \fB\-\-initializer\-suffix\fR=\fIINITIALIZERS\fR
50 Initializers for additional components in the keyword
53 \fB\-H\fR, \fB\-\-hash\-function\-name\fR=\fINAME\fR
54 Specify name of generated hash function. Default is
57 \fB\-N\fR, \fB\-\-lookup\-function\-name\fR=\fINAME\fR
58 Specify name of generated lookup function. Default
59 name is 'in_word_set'.
61 \fB\-Z\fR, \fB\-\-class\-name\fR=\fINAME\fR
62 Specify name of generated C++ class. Default name is
65 \fB\-7\fR, \fB\-\-seven\-bit\fR
66 Assume 7-bit characters.
68 \fB\-l\fR, \fB\-\-compare\-lengths\fR
69 Compare key lengths before trying a string
70 comparison. This is necessary if the keywords
71 contain NUL bytes. It also helps cut down on the
72 number of string comparisons made during the lookup.
74 \fB\-c\fR, \fB\-\-compare\-strncmp\fR
75 Generate comparison code using strncmp rather than
78 \fB\-C\fR, \fB\-\-readonly\-tables\fR
79 Make the contents of generated lookup tables
80 constant, i.e., readonly.
82 \fB\-E\fR, \fB\-\-enum\fR
83 Define constant values using an enum local to the
84 lookup function rather than with defines.
86 \fB\-I\fR, \fB\-\-includes\fR
87 Include the necessary system include file <string.h>
88 at the beginning of the code.
90 \fB\-G\fR, \fB\-\-global\-table\fR
91 Generate the static table of keywords as a static
92 global variable, rather than hiding it inside of the
93 lookup function (which is the default behavior).
95 \fB\-P\fR, \fB\-\-pic\fR
96 Optimize the generated table for inclusion in shared
97 libraries. This reduces the startup time of programs
98 using a shared library containing the generated code.
100 \fB\-Q\fR, \fB\-\-string\-pool\-name\fR=\fINAME\fR
101 Specify name of string pool generated by option \fB\-\-pic\fR.
102 Default name is 'stringpool'.
104 \fB\-\-null\-strings\fR
105 Use NULL strings instead of empty strings for empty
106 keyword table entries.
108 \fB\-W\fR, \fB\-\-word\-array\-name\fR=\fINAME\fR
109 Specify name of word list array. Default name is
112 \fB\-\-length\-table\-name\fR=\fINAME\fR
113 Specify name of length table array. Default name is
116 \fB\-S\fR, \fB\-\-switch\fR=\fICOUNT\fR
117 Causes the generated C code to use a switch
118 statement scheme, rather than an array lookup table.
119 This can lead to a reduction in both time and space
120 requirements for some keyfiles. The COUNT argument
121 determines how many switch statements are generated.
122 A value of 1 generates 1 switch containing all the
123 elements, a value of 2 generates 2 tables with 1/2
124 the elements in each table, etc. If COUNT is very
125 large, say 1000000, the generated C code does a
128 \fB\-T\fR, \fB\-\-omit\-struct\-type\fR
129 Prevents the transfer of the type declaration to the
130 output file. Use this option if the type is already
132 .SS "Algorithm employed by gperf:"
134 \fB\-k\fR, \fB\-\-key\-positions\fR=\fIKEYS\fR
135 Select the key positions used in the hash function.
136 The allowable choices range between 1-255, inclusive.
137 The positions are separated by commas, ranges may be
138 used, and key positions may occur in any order.
139 Also, the meta-character '*' causes the generated
140 hash function to consider ALL key positions, and $
141 indicates the "final character" of a key, e.g.,
144 \fB\-D\fR, \fB\-\-duplicates\fR
145 Handle keywords that hash to duplicate values. This
146 is useful for certain highly redundant keyword sets.
148 \fB\-m\fR, \fB\-\-multiple\-iterations\fR=\fIITERATIONS\fR
149 Perform multiple choices of the \fB\-i\fR and \fB\-j\fR values,
150 and choose the best results. This increases the
151 running time by a factor of ITERATIONS but does a
152 good job minimizing the generated table size.
154 \fB\-i\fR, \fB\-\-initial\-asso\fR=\fIN\fR
155 Provide an initial value for the associate values
156 array. Default is 0. Setting this value larger helps
157 inflate the size of the final table.
159 \fB\-j\fR, \fB\-\-jump\fR=\fIJUMP\-VALUE\fR
160 Affects the "jump value", i.e., how far to advance
161 the associated character value upon collisions. Must
162 be an odd number, default is 5.
164 \fB\-n\fR, \fB\-\-no\-strlen\fR
165 Do not include the length of the keyword when
166 computing the hash function.
168 \fB\-r\fR, \fB\-\-random\fR
169 Utilizes randomness to initialize the associated
172 \fB\-s\fR, \fB\-\-size\-multiple\fR=\fIN\fR
173 Affects the size of the generated hash table. The
174 numeric argument N indicates "how many times larger
175 or smaller" the associated value range should be,
176 in relationship to the number of keys, e.g. a value
177 of 3 means "allow the maximum associated value to
178 be about 3 times larger than the number of input
179 keys". Conversely, a value of 1/3 means "make the
180 maximum associated value about 3 times smaller than
181 the number of input keys". A larger table should
182 decrease the time required for an unsuccessful
183 search, at the expense of extra table space. Default
185 .SS "Informative output:"
187 \fB\-h\fR, \fB\-\-help\fR
190 \fB\-v\fR, \fB\-\-version\fR
191 Print the gperf version number.
193 \fB\-d\fR, \fB\-\-debug\fR
194 Enables the debugging option (produces verbose
195 output to the standard error).
197 Written by Douglas C. Schmidt and Bruno Haible.
199 Report bugs to <bug-gnu-gperf@gnu.org>.
201 Copyright \(co 1989-1998, 2000-2004, 2006-2007 Free Software Foundation, Inc.
203 This is free software; see the source for copying conditions. There is NO
204 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
206 The full documentation for
208 is maintained as a Texinfo manual. If the
212 programs are properly installed at your site, the command
216 should give you access to the complete manual.