.\" -*-nroff-*-
.de VS
.sp 1
-.RS 5
+.RS
.nf
.ft B
..
.RE
.sp 1
..
-.TH sym 3mLib "8 May 1999" mLib
+.TH sym 3 "8 May 1999" mLib
.SH NAME
sym \- symbol table manager
+.\" @sym_create
+.\" @sym_destroy
+.\" @sym_find
+.\" @sym_remove
+.\" @sym_mkiter
+.\" @sym_next
+.\"
+.\" @SYM_NAME
+.\"
.SH SYNOPSIS
.nf
.B "#include <mLib/sym.h>"
After initialization, the table contains no entries.
.PP
Initializing a symbol table involves allocating some memory. If this
-allocation failes, an
+allocation fails, an
.B EXC_NOMEM
exception is raised.
.PP
It does both lookup and creation, depending on its arguments. To do its
job, it needs to know the following bits of information:
.TP
-.I t
+.BI "sym_table *" t
A pointer to a symbol table to manipulate.
.TP
-.I n
+.BI "const char *" n
The address of the
.I key
to look up or create. Usually this will be a simple text string,
although it can actually be any arbitrary binary data.
.TP
-.I l
+.BI "long " l
The length of the key. If this is \-1,
.B sym_find
assumes that the key is a null-terminated string, and calculates its
length itself.
.TP
-.I sz
+.BI "size_t " sz
The size of the value block to allocate if the key could not be found.
If this is zero, no value is allocated, and a null pointer is returned
to indicate an unsuccessful lookup.
.TP
-.I f
+.BI "unsigned *" f
The address of a `found' flag to set. This is an output parameter. On
exit,
.B sym_find
That ought to be enough examples to be getting on with.
.SH CAVEATS
The symbol table manager requires the suballocator (see
-.BR sub (3mLib)
+.BR sub (3)
for details). You must ensure that
.B sub_init
has been called before using any symbol tables in your program.
actually). Every time a symbol is found, its block is promoted to the
front of its bin chain so it gets found faster next time.
.SH SEE ALSO
-.BR sub (3mLib).
+.BR sub (3),
+.BR mLib (3).
.SH AUTHOR
Mark Wooding, <mdw@nsict.org>