/* -*-c-*-
*
- * $Id: trace.c,v 1.4 1999/05/19 20:27:11 mdw Exp $
+ * $Id: trace.c,v 1.5 1999/10/22 22:39:52 mdw Exp $
*
* Tracing functions for debugging
*
/*----- Revision history --------------------------------------------------*
*
* $Log: trace.c,v $
+ * Revision 1.5 1999/10/22 22:39:52 mdw
+ * New documented interface for tracing.
+ *
* Revision 1.4 1999/05/19 20:27:11 mdw
* Change naming to match newer mLib conventions.
*
/*----- Private state information -----------------------------------------*/
static FILE *tracefp = 0; /* Where does debugging go? */
-static unsigned int tracelvl = 0; /* How much tracing gets done? */
+static unsigned tracelvl = 0; /* How much tracing gets done? */
/*----- Functions provided ------------------------------------------------*/
/* --- @trace@ --- *
*
- * Arguments: @unsigned int l@ = trace level for output
+ * Arguments: @unsigned l@ = trace level for output
* @const char *f@ = a @printf@-style format string
* @...@ = other arguments
*
* Use: Reports a message to the trace output.
*/
-void trace(unsigned int l, const char *f, ...)
+void trace(unsigned l, const char *f, ...)
{
va_list ap;
if ((l & tracing()) == 0)
/* --- @trace_block@ --- *
*
- * Arguments: @unsigned int l@ = trace level for output
+ * Arguments: @unsigned l@ = trace level for output
* @const char *s@ = some header string to write
* @const void *b@ = pointer to a block of memory to dump
* @size_t sz@ = size of the block of memory
* Use: Dumps the contents of a block to the trace output.
*/
-void trace_block(unsigned int l, const char *s, const void *b, size_t sz)
+void trace_block(unsigned l, const char *s, const void *b, size_t sz)
{
const unsigned char *p = b;
size_t i;
/* --- @trace_on@ --- *
*
* Arguments: @FILE *fp@ = a file to trace on
- * @unsigned int l@ = trace level to set
+ * @unsigned l@ = trace level to set
*
* Returns: ---
*
* Use: Enables tracing to a file.
*/
-void trace_on(FILE *fp, unsigned int l)
+void trace_on(FILE *fp, unsigned l)
{
tracefp = fp;
if (!tracelvl)
/* --- @trace_setLevel@ --- *
*
- * Arguments: @unsigned int l@ = trace level to set
+ * Arguments: @unsigned l@ = trace level to set
*
* Returns: ---
*
* Use: Sets the tracing level.
*/
-void trace_setLevel(unsigned int l)
+void trace_setLevel(unsigned l)
{
tracelvl = l;
}
* Use: Informs the caller whether tracing is enabled.
*/
-unsigned int tracing(void)
+unsigned tracing(void)
{
return (tracefp ? tracelvl : 0u);
}