@@@ much mess, mostly manpages
[mLib] / hash / unihash-mkstatic.1.in
CommitLineData
18756bee 1.\" nroff
c4ccbbf9
MW
2.\"
3.\" Manual for universal hashing table generator
4.\"
5.\" (c) 2003, 2005, 2007, 2009, 2019, 2024 Straylight/Edgeware
6.\"
7.
8.\"----- Licensing notice ---------------------------------------------------
9.\"
10.\" This file is part of the mLib utilities library.
11.\"
12.\" mLib is free software: you can redistribute it and/or modify it under
13.\" the terms of the GNU Library General Public License as published by
14.\" the Free Software Foundation; either version 2 of the License, or (at
15.\" your option) any later version.
16.\"
17.\" mLib is distributed in the hope that it will be useful, but WITHOUT
18.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
20.\" License for more details.
21.\"
22.\" You should have received a copy of the GNU Library General Public
23.\" License along with mLib. If not, write to the Free Software
24.\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
25.\" USA.
26.
27.\"--------------------------------------------------------------------------
28.so ../defs.man \" @@@PRE@@@
29.
30.\"--------------------------------------------------------------------------
18756bee 31.TH unihash-mkstatic 1 "14 December 2003" "Straylight/Edgeware" "mLib utilities library"
c4ccbbf9
MW
32.
33.\"--------------------------------------------------------------------------
18756bee 34.SH NAME
35unihash-mkstatic \- construct tables for universal hashing
c4ccbbf9
MW
36.
37.\"--------------------------------------------------------------------------
18756bee 38.SH SYNOPSIS
c4ccbbf9 39.
18756bee 40.B unihash-mkstatic
3e7267bf 41.RB [ \-Cc ]
18756bee 42.RB [ \-s
43.IR symbol ]
44.RB [ \-i
45.IR header ]
46.RB [ \-g
47.IR macro ]
48.br
49 \c
50.RB [ \-k
51.IR key ]
52.RB [ \-o
53.IR filename ]
c4ccbbf9
MW
54.
55.\"--------------------------------------------------------------------------
18756bee 56.SH DESCRIPTION
c4ccbbf9 57.
18756bee 58The
59.B unihash-mkstatic
60program constructs tables for efficient universal hashing (see
61.BR unihash (3)).
62It will produce the table as either an array defined in a C source file
63or as an initializer macro defined in a C header file.
c4ccbbf9 64.
18756bee 65.SS "Options"
66The program accepts no non-option arguments. The options are as
67follows.
68.TP
69.B "\-h, \-\-help"
70Print a help message to standard output and exit successfully.
71.TP
72.B "\-v, \-\-version"
73Print the program's version number to standard output and exit
74successfully.
75.TP
76.B "\-u, \-\-usage"
77Print a one-line usage summary to standard output and exit successfully.
78.TP
3e7267bf
MW
79.B "\-C, \-\-const"
80When producing C source (the
81.B \-c
82option), rather than a header, define the table to be
83.BR const .
84.TP
18756bee 85.B "\-c, \-\-c-source"
86Produce a C source file which exports a symbol naming the array, instead
87of a C header file.
88.TP
89.BI "\-s, \-\-symbol=" symbol
90Name the table
91.IR symbol .
92This is the name of the macro defined by a header file, or the array
93exported by a C source. The default macro name is
94.BR UHI_INIT ;
95the default array name is
96.BR uhi .
97.TP
98.BI "\-i, \-\-include=" header
c4ccbbf9 99.RS
d4efbcd9 100Request that generated C source include the named
18756bee 101.I header
102file. Inserts a
103line of the form
18756bee 104.IP
c4ccbbf9
MW
105.BI "#include """ header """"
106.PP
18756bee 107at the top of the generated C source. The default is not to include
108.BR <mLib/unihash.h> ,
109which is necessary to declare the
110.B unihash_info
111type. This option does nothing without the
112.B \-c
113option.
c4ccbbf9 114.RE
18756bee 115.TP
116.BI "\-g, \-\-guard=" macro
c4ccbbf9 117.RS
18756bee 118Use the named
119.I macro
120as a guard against multiple inclusion of the generated header file.
121Inserts a pair of lines of the form
18756bee 122.IP
18756bee 123.nf
c4ccbbf9
MW
124.BI "#ifndef " macro
125.BI "#define " macro
18756bee 126.fi
c4ccbbf9
MW
127.PP
128at the top of the generated header, and a line
18756bee 129.IP
c4ccbbf9
MW
130.BI "#endif"
131.PP
18756bee 132at the end. The default guard macro name is built from the output file
133name specified with
134.B \-o
135by uppercasing all alphabetic characters in the name and replacing
d4efbcd9 136nonalphanumeric characters by underscores
18756bee 137.RB ` _ '.
138This option does nothing with the
139.B \-c
140option.
c4ccbbf9 141.RE
18756bee 142.TP
143.BI "\-k, \-\-key=" key
144Specifies the hashing key as an integer. Note that if you want to
145specify the key in hexadecimal, you must prefix it with
146.BR 0x .
147The default key is
148.BR 0xe07e5bd1 ,
149which is, as far as the author knows, as good as any other fixed value.
c4ccbbf9
MW
150.
151.\"--------------------------------------------------------------------------
18756bee 152.SH "SEE ALSO"
c4ccbbf9 153.
18756bee 154.BR crc-mktab (1),
155.BR unihash (3).
c4ccbbf9
MW
156.
157.\"--------------------------------------------------------------------------
18756bee 158.SH "AUTHOR"
c4ccbbf9 159.
9b5ac6ff 160Mark Wooding, <mdw@distorted.org.uk>
c4ccbbf9
MW
161.
162.\"----- That's all, folks --------------------------------------------------