1 /* Public Domain Curses */
5 RCSID("$Id: debug.c,v 1.7 2008/07/13 16:08:18 wmcbrine Exp $")
7 /*man-start**************************************************************
14 void PDC_debug(const char *, ...);
17 traceon() and traceoff() toggle the recording of debugging
18 information to the file "trace". Although not standard, similar
19 functions are in some other curses implementations.
21 PDC_debug() is the function that writes to the file, based on
22 whether traceon() has been called. It's used from the PDC_LOG()
25 Portability X/Open BSD SYS V
30 **man-end****************************************************************/
33 #include <sys/types.h>
36 bool pdc_trace_on
= FALSE
;
38 void PDC_debug(const char *fmt
, ...)
48 /* open debug log file append */
50 dbfp
= fopen("trace", "a");
54 "PDC_debug(): Unable to open debug log file\n");
59 strftime(hms
, 9, "%H:%M:%S", localtime(&now
));
60 fprintf(dbfp
, "At: %8.8ld - %s ", (long) clock(), hms
);
63 vfprintf(dbfp
, fmt
, args
);
71 PDC_LOG(("traceon() - called\n"));
78 PDC_LOG(("traceoff() - called\n"));