chiark / gitweb /
Makefile: Ship versioncmp.in.
[mLib] / trace.h
diff --git a/trace.h b/trace.h
index 1e02a269fc06074f24c08eef600fdd4395b47e58..9f61fc157b5f0e20c5adc981c68f09f636e5c27a 100644 (file)
--- a/trace.h
+++ b/trace.h
@@ -1,13 +1,13 @@
 /* -*-c-*-
  *
- * $Id: trace.h,v 1.4 1999/10/22 22:39:52 mdw Exp $
+ * $Id: trace.h,v 1.7 2004/04/08 01:36:13 mdw Exp $
  *
  * Tracing functions for debugging
  *
  * (c) 1998 Straylight/Edgeware
  */
 
-/*----- Licensing notice --------------------------------------------------* 
+/*----- Licensing notice --------------------------------------------------*
  *
  * This file is part of the mLib utilities library.
  *
  * 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.
  */
 
-/*----- Revision history --------------------------------------------------*
- *
- * $Log: trace.h,v $
- * Revision 1.4  1999/10/22 22:39:52  mdw
- * New documented interface for tracing.
- *
- * Revision 1.3  1999/05/06 19:51:35  mdw
- * Reformatted the LGPL notice a little bit.
- *
- * Revision 1.2  1999/05/05 18:50:31  mdw
- * Change licensing conditions to LGPL.
- *
- * Revision 1.1.1.1  1998/06/17 23:44:42  mdw
- * Initial version of mLib
- *
- */
-
-#ifndef TRACE_H
-#define TRACE_H
+#ifndef MLIB_TRACE_H
+#define MLIB_TRACE_H
 
 #ifdef __cplusplus
   extern "C" {
@@ -105,6 +88,21 @@ extern void trace_block(unsigned /*l*/, const char */*s*/,
 
 extern void trace_on(FILE */*fp*/, unsigned /*l*/);
 
+/* --- @trace_custom@ --- *
+ *
+ * Arguments:  @void (*func)(const char *buf, size_t sz, void *v)@ =
+ *                     output function
+ *             @void *v@ = magic handle to give to function
+ *
+ * Returns:    ---
+ *
+ * Use:                Sets up a custom trace handler.
+ */
+
+extern void trace_custom(void (*/*func*/)(const char */*buf*/,
+                                         size_t /*sz*/, void */*v*/),
+                        void */*v*/);
+
 /* --- @trace_level@ --- *
  *
  * Arguments:  @unsigned l@ = trace level to set
@@ -129,7 +127,7 @@ extern unsigned tracing(void);
 
 /* --- @traceopt@ --- *
  *
- * Arguments:  @trace_opt *t@ = pointer to trace options table
+ * Arguments:  @const trace_opt *t@ = pointer to trace options table
  *             @const char *p@ = option string supplied by user
  *             @unsigned f@ = initial tracing flags
  *             @unsigned bad@ = forbidden tracing flags
@@ -141,7 +139,7 @@ extern unsigned tracing(void);
  *             `?' character, a help message is displayed.
  */
 
-extern unsigned traceopt(trace_opt */*t*/, const char */*p*/,
+extern unsigned traceopt(const trace_opt */*t*/, const char */*p*/,
                         unsigned /*f*/, unsigned /*bad*/);
 
 /*----- Tracing macros ----------------------------------------------------*/