Annotation of othersrc/dist/cdk/debug.c, revision 1.1
1.1 ! garbled 1: #include <cdk.h>
! 2:
! 3: /*
! 4: * $Author: tom $
! 5: * $Date: 2000/02/18 23:20:55 $
! 6: * $Revision: 1.9 $
! 7: */
! 8:
! 9: FILE *CDKDEBUG;
! 10:
! 11:
! 12: /*
! 13: * This starts debugging for CDK.
! 14: */
! 15: FILE *startCDKDebug (char *filename)
! 16: {
! 17: char *defFile = "cdkdebug.log";
! 18:
! 19: /* Check if the filename is null. */
! 20: if (filename == 0)
! 21: {
! 22: filename = defFile;
! 23: }
! 24:
! 25: /* Try to open the file. */
! 26: return ( fopen (filename, "w") );
! 27: }
! 28:
! 29: /*
! 30: * This writes a message to the debug file.
! 31: */
! 32: void writeCDKDebugMessage (FILE *fd, char *filename, char *function, int line, char *message)
! 33: {
! 34: /* Print the message as long as the file pointer is not null. */
! 35: if (fd != 0)
! 36: {
! 37: fprintf (fd, "%s::%s (Line %d) %s\n", filename, function, line, message);
! 38: }
! 39: }
! 40:
! 41: /*
! 42: * This turns off the debugging for CDK.
! 43: */
! 44: void stopCDKDebug (FILE *fd)
! 45: {
! 46: if (fd != 0)
! 47: {
! 48: fclose (fd);
! 49: }
! 50: }
CVSweb <webmaster@jp.NetBSD.org>