hash/unihash.c: Replace a dynamic assertion with a static one.
[mLib] / hash / 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
3e7267bf 15.RB [ \-Cc ]
18756bee 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
3e7267bf
MW
49.B "\-C, \-\-const"
50When producing C source (the
51.B \-c
52option), rather than a header, define the table to be
53.BR const .
54.TP
18756bee 55.B "\-c, \-\-c-source"
56Produce a C source file which exports a symbol naming the array, instead
57of a C header file.
58.TP
59.BI "\-s, \-\-symbol=" symbol
60Name the table
61.IR symbol .
62This is the name of the macro defined by a header file, or the array
63exported by a C source. The default macro name is
64.BR UHI_INIT ;
65the default array name is
66.BR uhi .
67.TP
68.BI "\-i, \-\-include=" header
d4efbcd9 69Request that generated C source include the named
18756bee 70.I header
71file. Inserts a
72line of the form
73.PP
74.nf
75.BI " #include """ header """"
76.fi
77.IP
78at the top of the generated C source. The default is not to include
79.BR <mLib/unihash.h> ,
80which is necessary to declare the
81.B unihash_info
82type. This option does nothing without the
83.B \-c
84option.
85.TP
86.BI "\-g, \-\-guard=" macro
87Use the named
88.I macro
89as a guard against multiple inclusion of the generated header file.
90Inserts a pair of lines of the form
91.PP
92.nf
93.BI " #ifndef " macro
94.BI " #define " macro
95.fi
96.IP
97at the top of the generated header, and a line
98.PP
99.nf
100.BI " #endif"
101.fi
102.IP
103at the end. The default guard macro name is built from the output file
104name specified with
105.B \-o
106by uppercasing all alphabetic characters in the name and replacing
d4efbcd9 107nonalphanumeric characters by underscores
18756bee 108.RB ` _ '.
109This option does nothing with the
110.B \-c
111option.
112.TP
113.BI "\-k, \-\-key=" key
114Specifies the hashing key as an integer. Note that if you want to
115specify the key in hexadecimal, you must prefix it with
116.BR 0x .
117The default key is
118.BR 0xe07e5bd1 ,
119which is, as far as the author knows, as good as any other fixed value.
120.TP
121.SH "SEE ALSO"
122.BR crc-mktab (1),
123.BR unihash (3).
124.SH "AUTHOR"
9b5ac6ff 125Mark Wooding, <mdw@distorted.org.uk>
18756bee 126