chiark / gitweb /
Import buf from Catacomb; split out the dstr bits, and throw away the mp and
[mLib] / man / unihash-mkstatic.1
CommitLineData
18756bee 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
12unihash-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
29The
30.B unihash-mkstatic
31program constructs tables for efficient universal hashing (see
32.BR unihash (3)).
33It will produce the table as either an array defined in a C source file
34or as an initializer macro defined in a C header file.
35.SS "Options"
36The program accepts no non-option arguments. The options are as
37follows.
38.TP
39.B "\-h, \-\-help"
40Print a help message to standard output and exit successfully.
41.TP
42.B "\-v, \-\-version"
43Print the program's version number to standard output and exit
44successfully.
45.TP
46.B "\-u, \-\-usage"
47Print a one-line usage summary to standard output and exit successfully.
48.TP
49.B "\-c, \-\-c-source"
50Produce a C source file which exports a symbol naming the array, instead
51of a C header file.
52.TP
53.BI "\-s, \-\-symbol=" symbol
54Name the table
55.IR symbol .
56This is the name of the macro defined by a header file, or the array
57exported by a C source. The default macro name is
58.BR UHI_INIT ;
59the default array name is
60.BR uhi .
61.TP
62.BI "\-i, \-\-include=" header
63Request that generated C source include the named
64.I header
65file. Inserts a
66line of the form
67.PP
68.nf
69.BI " #include """ header """"
70.fi
71.IP
72at the top of the generated C source. The default is not to include
73.BR <mLib/unihash.h> ,
74which is necessary to declare the
75.B unihash_info
76type. This option does nothing without the
77.B \-c
78option.
79.TP
80.BI "\-g, \-\-guard=" macro
81Use the named
82.I macro
83as a guard against multiple inclusion of the generated header file.
84Inserts a pair of lines of the form
85.PP
86.nf
87.BI " #ifndef " macro
88.BI " #define " macro
89.fi
90.IP
91at the top of the generated header, and a line
92.PP
93.nf
94.BI " #endif"
95.fi
96.IP
97at the end. The default guard macro name is built from the output file
98name specified with
99.B \-o
100by uppercasing all alphabetic characters in the name and replacing
101nonalphanumeric characters by underscores
102.RB ` _ '.
103This option does nothing with the
104.B \-c
105option.
106.TP
107.BI "\-k, \-\-key=" key
108Specifies the hashing key as an integer. Note that if you want to
109specify the key in hexadecimal, you must prefix it with
110.BR 0x .
111The default key is
112.BR 0xe07e5bd1 ,
113which 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"
9b5ac6ff 119Mark Wooding, <mdw@distorted.org.uk>
18756bee 120