home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / include / xp_trace.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.4 KB  |  71 lines

  1. /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. #ifndef _XP_Trace_
  20. #define _XP_Trace_
  21.  
  22. #include <stdarg.h>
  23.  
  24. #ifdef __cplusplus
  25.  
  26. #if defined(_WINDOWS) && !defined(DEBUG)
  27. inline void FE_Trace( const char *msg ) {}                    /* implemented by the platform */
  28. inline void XP_Trace( const char *format, ... ) {}
  29. inline void XP_Trace1( const char *format, ... ) {}            /* XP_Trace without the newline */
  30. inline void XP_TraceV( const char *msg, va_list args ) {}    /* varargs XP_Trace without the newline */
  31. #else
  32. extern "C" void FE_Trace( const char * );                    /* implemented by the platform */
  33. extern "C" void XP_Trace( const char *, ... );
  34. extern "C" void XP_Trace1( const char *, ... );                /* XP_Trace without the newline */
  35. extern "C" void XP_TraceV( const char *msg, va_list args );    /* varargs XP_Trace without the newline */
  36. #if defined(XP_MAC)
  37. extern "C" void XP_TraceInit(void);
  38. #endif    /* XP_MAC */
  39. #endif /* _WINDOWS && !DEBUG */
  40.  
  41. #else
  42.  
  43. void FE_Trace( const char * );                                /* implemented by the platform */
  44. void XP_Trace( const char *, ... );
  45. void XP_Trace1( const char *, ... );                        /* XP_Trace without the newline */
  46. void XP_TraceV( const char *msg, va_list args );            /* varargs XP_Trace without the newline */
  47.  
  48. #if defined(XP_MAC)
  49. extern void XP_TraceInit(void);
  50. #endif
  51.  
  52. #endif /* __cplusplus */
  53.  
  54.  
  55. #ifdef DEBUG
  56.  
  57. #define XP_TRACE(MESSAGE)        XP_Trace MESSAGE
  58. #define XP_TRACE1(MESSAGE)        XP_Trace1 MESSAGE
  59. #define XP_LTRACE(FLAG,LEVEL,MESSAGE) \
  60.     do { if (FLAG >= (LEVEL)) XP_Trace MESSAGE; } while (0)
  61.  
  62. #else
  63.  
  64. #define XP_TRACE(MESSAGE)        ((void) (MESSAGE))
  65. #define XP_TRACE1(MESSAGE)        ((void) (MESSAGE))
  66. #define XP_LTRACE(FLAG,LEVEL,MESSAGE)    ((void) (MESSAGE))
  67.  
  68. #endif
  69.  
  70. #endif /* _XP_Trace_ */
  71.