| 1 | .\" nroff |
| 2 | .ie t \{\ |
| 3 | . ds ss \s8\u |
| 4 | . ds se \d\s0 |
| 5 | .\} |
| 6 | .el \{\ |
| 7 | . ds ss ^ |
| 8 | . ds se |
| 9 | .\} |
| 10 | .TH unihash-mkstatic 1 "14 December 2003" "Straylight/Edgeware" "mLib utilities library" |
| 11 | .SH NAME |
| 12 | unihash-mkstatic \- construct tables for universal hashing |
| 13 | .SH SYNOPSIS |
| 14 | .B unihash-mkstatic |
| 15 | .RB [ \-c ] |
| 16 | .RB [ \-s |
| 17 | .IR symbol ] |
| 18 | .RB [ \-i |
| 19 | .IR header ] |
| 20 | .RB [ \-g |
| 21 | .IR macro ] |
| 22 | .br |
| 23 | \c |
| 24 | .RB [ \-k |
| 25 | .IR key ] |
| 26 | .RB [ \-o |
| 27 | .IR filename ] |
| 28 | .SH DESCRIPTION |
| 29 | The |
| 30 | .B unihash-mkstatic |
| 31 | program constructs tables for efficient universal hashing (see |
| 32 | .BR unihash (3)). |
| 33 | It will produce the table as either an array defined in a C source file |
| 34 | or as an initializer macro defined in a C header file. |
| 35 | .SS "Options" |
| 36 | The program accepts no non-option arguments. The options are as |
| 37 | follows. |
| 38 | .TP |
| 39 | .B "\-h, \-\-help" |
| 40 | Print a help message to standard output and exit successfully. |
| 41 | .TP |
| 42 | .B "\-v, \-\-version" |
| 43 | Print the program's version number to standard output and exit |
| 44 | successfully. |
| 45 | .TP |
| 46 | .B "\-u, \-\-usage" |
| 47 | Print a one-line usage summary to standard output and exit successfully. |
| 48 | .TP |
| 49 | .B "\-c, \-\-c-source" |
| 50 | Produce a C source file which exports a symbol naming the array, instead |
| 51 | of a C header file. |
| 52 | .TP |
| 53 | .BI "\-s, \-\-symbol=" symbol |
| 54 | Name the table |
| 55 | .IR symbol . |
| 56 | This is the name of the macro defined by a header file, or the array |
| 57 | exported by a C source. The default macro name is |
| 58 | .BR UHI_INIT ; |
| 59 | the default array name is |
| 60 | .BR uhi . |
| 61 | .TP |
| 62 | .BI "\-i, \-\-include=" header |
| 63 | Request that generated C source include the named |
| 64 | .I header |
| 65 | file. Inserts a |
| 66 | line of the form |
| 67 | .PP |
| 68 | .nf |
| 69 | .BI " #include """ header """" |
| 70 | .fi |
| 71 | .IP |
| 72 | at the top of the generated C source. The default is not to include |
| 73 | .BR <mLib/unihash.h> , |
| 74 | which is necessary to declare the |
| 75 | .B unihash_info |
| 76 | type. This option does nothing without the |
| 77 | .B \-c |
| 78 | option. |
| 79 | .TP |
| 80 | .BI "\-g, \-\-guard=" macro |
| 81 | Use the named |
| 82 | .I macro |
| 83 | as a guard against multiple inclusion of the generated header file. |
| 84 | Inserts a pair of lines of the form |
| 85 | .PP |
| 86 | .nf |
| 87 | .BI " #ifndef " macro |
| 88 | .BI " #define " macro |
| 89 | .fi |
| 90 | .IP |
| 91 | at the top of the generated header, and a line |
| 92 | .PP |
| 93 | .nf |
| 94 | .BI " #endif" |
| 95 | .fi |
| 96 | .IP |
| 97 | at the end. The default guard macro name is built from the output file |
| 98 | name specified with |
| 99 | .B \-o |
| 100 | by uppercasing all alphabetic characters in the name and replacing |
| 101 | nonalphanumeric characters by underscores |
| 102 | .RB ` _ '. |
| 103 | This option does nothing with the |
| 104 | .B \-c |
| 105 | option. |
| 106 | .TP |
| 107 | .BI "\-k, \-\-key=" key |
| 108 | Specifies the hashing key as an integer. Note that if you want to |
| 109 | specify the key in hexadecimal, you must prefix it with |
| 110 | .BR 0x . |
| 111 | The default key is |
| 112 | .BR 0xe07e5bd1 , |
| 113 | which is, as far as the author knows, as good as any other fixed value. |
| 114 | .TP |
| 115 | .SH "SEE ALSO" |
| 116 | .BR crc-mktab (1), |
| 117 | .BR unihash (3). |
| 118 | .SH "AUTHOR" |
| 119 | Mark Wooding, <mdw@distorted.org.uk> |
| 120 | |