Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.5 KiB

  1. // Name: Mohsin Ahmed
  2. // Email: [email protected]
  3. // Date: Fri Jan 24 10:33:54 1997
  4. // File: d:/nt/PRIVATE/net/sockets/tcpsvcs/lpd/trace.c
  5. // Synopsis: Too many bugs, need to keep track in the field.
  6. // Notes: Redefines all macros in debug.h to log everything.
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9. #include <io.h>
  10. #include <ctype.h>
  11. #include <time.h> // for ctime
  12. #include <string.h>
  13. #include <stdarg.h> // for va_list.
  14. #include <assert.h> // for assert.
  15. #include <windef.h>
  16. #include <winbase.h> // for OutputDebugString.
  17. #include "lpdstruc-x.h"
  18. #ifndef _TRACE_H_
  19. #define _TRACE_H_ 1
  20. #define MOSH_LOG_FILE "%windir%\\system32\\spool\\" "lpd.log"
  21. #define MODULE "lpd"
  22. #define LEN_DbgPrint 1000
  23. extern FILE* LogFile;
  24. extern char LogFileName[];
  25. FILE * beginlogging( char * FileName );
  26. FILE * stoplogging( FILE * LogFile );
  27. int logit( char * format, ... );
  28. void LogTime( void );
  29. #ifdef DBG
  30. #define DEBUG_PRINT(S) DbgPrint S
  31. #define LOGIT(S) logit S
  32. #define LOGTIME LogTime()
  33. #undef LPD_DEBUG
  34. #define LPD_DEBUG( S ) logit( S )
  35. #undef DBG_TRACEIN
  36. #define DBG_TRACEIN( fn ) logit( "Entering %s\n", fn )
  37. #undef DBG_TRACEOUT
  38. #define DBG_TRACEOUT( fn ) logit( "Leaving %s\n", fn )
  39. #else
  40. #define DEBUG_PRINT(S) /* Nothing */
  41. #define LOGIT(S) /* Nothing */
  42. #define LOGTIME /* Nothing */
  43. #endif
  44. #endif // _TRACE_H_