MAGICUTILS(3)

NAME
magicutils - collection of utility procedures in -lmagicutils

SYNOPSIS
cc -I~cad/src/magic/include ~cad/src/magic/lib/libmagicutils.a
cc -I~cad/src/magic/include ~cad/src/magic/lib/libmagictrace.a
cc -I~cad/src/magic/include -pg ~cad/src/magic/lib/libmagicutils_p.a
cc -I~cad/src/magic/include -pg ~cad/src/magic/lib/libmagictrace_p.a
(replace ~cad with the home directory of the user cad).

MainExit(code) int code;

TxError(fmt, va_alist) char *fmt; va_dcl;

char *TxGetLine(buf, len) char *buf; int len;

DESCRIPTION
The two libraries libmagicutils.a and libmagictrace.a include all of the procedures from the utils 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.

To use these libraries, you should compile your programs with the flag -I~cad/src/magic/include (to search the Magic include directory for needed .h files). The documentation for the various pieces of the libraries lists which .h files are needed for which procedures.

Three default procedures are defined for the library but can be replaced by your own procedures if you so wish. The procedures are MainExit, which has the same semantics as exit(3) but can be replaced by your own procedure by that name to do additional cleanup, TxError, which is like fprintf(stderr, fmt, args), where args can be zero or more arguments, just as in fprintf(3), and finally TxGetLine, which is like fgets(buf, len, stdin). The library versions of these procedures only get pulled in if you haven't defined them yourself.

Versions exist of both libraries with profiling (-pg) enabled; these are libmagicutils_p.a and libmagictrace_p.a.

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)