.TH MAGICUTILS 3
.UC 4
.SH NAME
magicutils \- collection of utility procedures in -lmagicutils

.SH SYNOPSIS
.B cc
.B -I\fI~cad\fB/src/magic/include
...
.B \fI~cad\fB/src/magic/lib/libmagicutils.a
.br
.B cc
.B -I\fI~cad\fB/src/magic/include
...
.B \fI~cad\fB/src/magic/lib/libmagictrace.a
.br
.B cc
.B -I\fI~cad\fB/src/magic/include
.B -pg
...
.B \fI~cad\fB/src/magic/lib/libmagicutils_p.a
.br
.B cc
.B -I\fI~cad\fB/src/magic/include
.B -pg
...
.B \fI~cad\fB/src/magic/lib/libmagictrace_p.a
.br
\fR(replace \fI~cad\fR with the home directory of the user \fBcad\fR).
.PP
.B MainExit(code)
.B int code;
.PP
.B TxError(fmt, va_alist)
.B char *fmt;
.B va_dcl;
.PP
.B char *TxGetLine(buf, len)
.B char *buf;
.B int len;

.SH DESCRIPTION
The two libraries \fIlibmagicutils.a\fR and \fIlibmagictrace.a\fR
include all of the procedures from the \fIutils\fR module used
internally by the Magic layout system.  The first
library is for normal use; the second library is for use with the
tracing option of the new memory allocator.
See the documentation on the individual pieces of the library
for details of the procedures they contain.
.PP
To use these libraries, you should compile your programs
with the flag \fB-I\fI~cad\fB/src/magic/include\fR (to
search the Magic include directory for needed \fB.h\fR files).
The documentation for the various pieces of the libraries
lists which \fB.h\fR files are needed for which procedures.
.PP
Three default procedures are defined for the library but can be
replaced by your own procedures if you so wish.
The procedures are \fIMainExit\fR, which has the same semantics
as \fIexit\fR\|(3) but can be replaced by your own procedure
by that name to do additional cleanup,
\fITxError\fR, which is like \fIfprintf(stderr,\ fmt,\ args)\fR,
where \fIargs\fR can be zero or more arguments, just as in
\fIfprintf\fR\|(3),
and finally \fITxGetLine\fR, which is like \fIfgets(buf,\ len,\ stdin\fR).
The library versions of these procedures only get pulled in if
you haven't defined them yourself.
.PP
Versions exist of both libraries with profiling (\fB-pg\fR)
enabled; these are \fIlibmagicutils_p.a\fR and
\fIlibmagictrace_p.a\fR.

.SH "SEE ALSO"
magic(1), dqueue(3), geometry(3), hash(3), heap(3), list(3), malloc(3), 
path(3), runstats(3), set(3) show(3) stack(3), string(3)