.\" -*-nroff-*-
-.TH trace 3 "21 October 1999" "Straylight/Edgeware" "mLib utilities library"
-.SH "NAME"
-trace \- configurable tracing output
+.\"
+.\" Manual for tracing
+.\"
+.\" (c) 1999, 2001, 2005, 2009, 2017, 2023, 2024 Straylight/Edgeware
+.\"
+.
+.\"----- Licensing notice ---------------------------------------------------
+.\"
+.\" This file is part of the mLib utilities library.
+.\"
+.\" mLib is free software: you can redistribute it and/or modify it under
+.\" the terms of the GNU Library General Public License as published by
+.\" the Free Software Foundation; either version 2 of the License, or (at
+.\" your option) any later version.
+.\"
+.\" mLib is distributed in the hope that it will be useful, but WITHOUT
+.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+.\" License for more details.
+.\"
+.\" You should have received a copy of the GNU Library General Public
+.\" License along with mLib. If not, write to the Free Software
+.\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+.\" USA.
+.
+.\"--------------------------------------------------------------------------
+.so ../defs.man \" @@@PRE@@@
+.
+.\"--------------------------------------------------------------------------
+.TH trace 3mLib "21 October 1999" "Straylight/Edgeware" "mLib utilities library"
.\" @trace
.\" @trace_block
.\" @trace_on
.\" @NTRACE
.\" @T
.\" IF_TRACING
+.
+.\"--------------------------------------------------------------------------
+.SH "NAME"
+trace \- configurable tracing output
+.
+.\"--------------------------------------------------------------------------
.SH "SYNOPSIS"
+.
.nf
.B "#include <mLib/trace.h>"
.PP
.BI T( statements\fR... )
.BI "IF_TRACING(unsigned " l ", " statements\fR... )
.fi
+.
+.\"--------------------------------------------------------------------------
.SH "DESCRIPTION"
+.
The
.B <mLib/trace.h>
header declares some functions and macros for handling trace output.
message level and the overall tracing level is nonzero. The idea is
that the programmer assigns a different bit to each group of trace
messages, and allows a user to select which ones are wanted.
+.
.SS "Producing trace output"
The basic function is
.BR trace .
in order, the message level, a pointer to the header string for the hex
dump, the base address of the block to dump, and the size of the block
in bytes.
+.
.SS "Configuring trace output"
The tracing destination is set with the function
.BR trace_on :
.B trace_custom
and passing a function which will write a buffer of data somewhere
sensible.
+.
.SS "Parsing user trace options"
The function
.B traceopt
.I bad
mask to prevent access to secret information when running setuid, or to
zero when not.
+.
.SS "Macro support for tracing"
The tracing macros are intended to make insertion of tracing information
unobtrusive and painless. If the
level is set such that the message will be printed, the code in the
second argument is executed. If code is being compiled without tracing,
of course, the entire contents of the macro is ignored.
+.
+.\"--------------------------------------------------------------------------
.SH "SEE ALSO"
+.
.BR mLib (3).
+.
+.\"--------------------------------------------------------------------------
.SH "AUTHOR"
+.
Mark Wooding, <mdw@distorted.org.uk>
+.
+.\"----- That's all, folks --------------------------------------------------