DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

(gperf.info.gz) Output Details

Info Catalog (gperf.info.gz) Output Language (gperf.info.gz) Options (gperf.info.gz) Algorithmic Details
 
 Options for fine tuning Details in the Output Code
 ==================================================
 
 `-K KEY-NAME'
 `--slot-name=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'.
 
 `-F INITIALIZERS'
 `--initializer-suffix=INITIALIZERS'
      This option is only useful when option `-t' has been given.  It
      permits to specify initializers for the structure members following
      KEY NAME in empty hash table entries.  The list of initializers
      should start with a comma.  By default, the emitted code will
      zero-initialize structure members following KEY NAME.
 
 `-H HASH-FUNCTION-NAME'
 `--hash-fn-name=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'
 `--lookup-fn-name=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'
 `--class-name=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'
 `--seven-bit'
      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 versions of `gperf'
      earlier than 2.7; now the default is to assume 8-bit characters.
 
 `-c'
 `--compare-strncmp'
      Generates C code that uses the `strncmp' function to perform
      string comparisons.  The default action is to use `strcmp'.
 
 `-C'
 `--readonly-tables'
      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'
 `--enum'
      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
      `<jjc@ai.mit.edu>'.
 
 `-I'
 `--includes'
      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'
 `--global'
      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'
 `--word-array-name=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'
 `--switch=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'
 `--omit-struct-type'
      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.
 
Info Catalog (gperf.info.gz) Output Language (gperf.info.gz) Options (gperf.info.gz) Algorithmic Details
automatically generated byinfo2html