NAME
gperf - generate a perfect hash function from a key set
SYNOPSIS
ggppeerrff [OPTION]... [INPUT-FILE]
DESCRIPTION
GNU 'gperf' generates perfect hash functions.
If a long option shows an argument as mandatory, then it is mandatory for the equivalent short option also. OOuuttppuutt ffiillee llooccaattiioonn::--oouuttppuutt-ffiillee=FILE Write output to specified file.
The results are written to standard output if no output file is speci-
fied or if it is -.
IInnppuutt ffiillee iinntteerrpprreettaattiioonn::-ee, --ddeelliimmiitteerrss=DELIMITER-LIST
Allow user to provide a string containing delimiters used to separate keywords from their attributes. Default is ",".-tt, --ssttrruucctt-ttyyppee
Allows the user to include a structured type declaration forgenerated code. Any text before %% is considered part of the
type declaration. Key words and additional fields may follow this, one group of fields per line.--iiggnnoorree-ccaassee
Consider upper and lower case ASCII characters as equivalent. Note that locale dependent case mappings are ignored. LLaanngguuaaggee ffoorr tthhee oouuttppuutt ccooddee::-LL, --llaanngguuaaggee=LANGUAGE-NAME
Generates code in the specified language. Languages handled arecurrently C++, ANSI-C, C, and KR-C. The default is C.
DDeettaaiillss iinn tthhee oouuttppuutt ccooddee::-KK, --sslloott-nnaammee=NAME
Select name of the keyword component in the keyword structure.-FF, --iinniittiiaalliizzeerr-ssuuffffiixx=INITIALIZERS
Initializers for additional components in the keyword structure.-HH, --hhaasshh-ffuunnccttiioonn-nnaammee=NAME
Specify name of generated hash function. Default is 'hash'.-NN, --llooookkuupp-ffuunnccttiioonn-nnaammee=NAME
Specify name of generated lookup function. Default name is 'inwordset'.-ZZ, --ccllaassss-nnaammee=NAME
Specify name of generated C++ class. Default name is 'Per-
fectHash'.-77, --sseevveenn-bbiitt
Assume 7-bit characters.
-ll, --ccoommppaarree-lleennggtthhss
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.-cc, --ccoommppaarree-ssttrrnnccmmpp
Generate comparison code using strncmp rather than strcmp.-CC, --rreeaaddoonnllyy-ttaabblleess
Make the contents of generated lookup tables constant, i.e., readonly.-EE, --eennuumm
Define constant values using an enum local to the lookup func-
tion rather than with defines.-II, --iinncclluuddeess
Include the necessary system include fileat the beginning of the code. -GG, --gglloobbaall-ttaabbllee
Generate the static table of keywords as a static global vari-
able, rather than hiding it inside of the lookup function (which is the default behavior).-PP, --ppiicc
Optimize the generated table for inclusion in shared libraries. This reduces the startup time of programs using a shared library containing the generated code.-QQ, --ssttrriinngg-ppooooll-nnaammee=NAME
Specify name of string pool generated by option --ppiicc. Default
name is 'stringpool'.--nnuullll-ssttrriinnggss
Use NULL strings instead of empty strings for empty keyword ta-
ble entries.-WW, --wwoorrdd-aarrrraayy-nnaammee=NAME
Specify name of word list array. Default name is 'wordlist'.-SS, --sswwiittcchh=COUNT
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 COUNT argument determines how many switch statements are generated. A value of 1 generates 1 switch containing all the elements, avalue of 2 generates 2 tables with 1/2 the elements in each ta-
ble, etc. If COUNT is very large, say 1000000, the generated C code does a binary search.-TT, --oommiitt-ssttrruucctt-ttyyppee
Prevents the transfer of the type declaration to the output file. Use this option if the type is already defined elsewhere. AAllggoorriitthhmm eemmppllooyyeedd bbyy ggppeerrff::-kk, --kkeeyy-ppoossiittiioonnss=KEYS
Select the key positions used in the hash function. The allow-
able choices range between 1-255, inclusive. The positions are
separated by commas, ranges may be used, and key positions mayoccur in any order. Also, the meta-character '*' causes the
generated hash function to consider ALL key positions, and $
indicates the "final character" of a key, e.g., $,1,2,4,6-10.
-DD, --dduupplliiccaatteess
Handle keywords that hash to duplicate values. This is useful for certain highly redundant keyword sets.-mm, --mmuullttiippllee-iitteerraattiioonnss=ITERATIONS
Perform multiple choices of the -ii and -jj values, and choose the
best results. This increases the running time by a factor of ITERATIONS but does a good job minimizing the generated table size.-ii, --iinniittiiaall-aassssoo=N
Provide an initial value for the associate values array. Default is 0. Setting this value larger helps inflate the size of the final table.-jj, --jjuummpp=JUMP-VALUE
Affects the "jump value", i.e., how far to advance the associ-
ated character value upon collisions. Must be an odd number, default is 5.-nn, --nnoo-ssttrrlleenn
Do not include the length of the keyword when computing the hash function.-rr, --rraannddoomm
Utilizes randomness to initialize the associated values table.-ss, --ssiizzee-mmuullttiippllee=N
Affects the size of the generated hash table. The numeric argu-
ment N indicates "how many times larger or smaller" the associ-
ated value range should be, in relationship to the number of keys, e.g. a value of 3 means "allow the maximum associated value to be about 3 times larger than the number of input keys". Conversely, a value of 1/3 means "make the maximum associated value about 3 times smaller than the number of input keys". Alarger table should decrease the time required for an unsuccess-
ful search, at the expense of extra table space. Default value is 1. IInnffoorrmmaattiivvee oouuttppuutt::-hh, --hheellpp
Print this message.-vv, --vveerrssiioonn
Print the gperf version number.
-dd, --ddeebbuugg
Enables the debugging option (produces verbose output to the standard error). AUTHOR Written by Douglas C. Schmidt and Bruno Haible.REPORTING BUGS
Report bugs to
COPYRIGHT. Copyright (C) 1989-1998, 2000-2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.SEE ALSO
The full documentation for ggppeerrff is maintained as a Texinfo manual. If the iinnffoo and ggppeerrff programs are properly installed at your site, the command iinnffoo ggppeerrff should give you access to the complete manual.GNU gperf 3.0.1 June 2003 GPERF(1)