diff options
Diffstat (limited to 'TAO/tao/debug.h')
-rw-r--r-- | TAO/tao/debug.h | 115 |
1 files changed, 0 insertions, 115 deletions
diff --git a/TAO/tao/debug.h b/TAO/tao/debug.h deleted file mode 100644 index 75f456e45c3..00000000000 --- a/TAO/tao/debug.h +++ /dev/null @@ -1,115 +0,0 @@ -// $Id$ - -// This may look like C, but it's really -*- C++ -*- - -// ============================================================================ -// -// = LIBRARY -// TAO -// -// = FILENAME -// debug.h -// -// = DESCRIPTION -// debug/trace support. -// -// = AUTHOR -// Copyright 1994-1995 by Sun Microsystems Inc. -// -// ============================================================================ - -#if !defined (TAO_DEBUG_H) -#define TAO_DEBUG_H - -// These are global to simplify is use by other code, very much in -// particular by getopt and related argument-parsing code -// -// THREADING NOTE: don't set them except in an unthreaded environment -// such as process initialization. They're treated as immutable. - -// 0 to ??; higher == more -extern TAO_Export u_int TAO_debug_level; - -// debug messages on (1) or off (0) -extern TAO_Export u_int TAO_orbdebug; - -// set by getopt -extern TAO_Export char *TAO_debug_filter; - -// These are just simple 0, 1, and 2 argument messages that will -// appear when debugging's enabled, regardless of category. They also -// just compile out painlessly. - -#if defined (DEBUG) -#include <stdio.h> -#include <errno.h> -#include <string.h> - -// 1, 2, 3 argument messages -- generic -#define dmsg(s) { if (TAO_debug_level) dmsg_v (s); } -#define dmsg1(s,a1) { if (TAO_debug_level) dmsg_v (s, a1); } -#define dmsg2(s,a1,a2) { if (TAO_debug_level) dmsg_v (s, a1, a2); } - -// dump CORBA_Exception, if any, with id tag -#define dexc(env,s) { if (TAO_debug_level && env.exception ()) \ - _dmsg_x (env, s); } - -// dump POSIX error indication, if any, with ID tag -#define dperror(str) { if (TAO_debug_level) dmsg_v ("%s: %s", \ - str, strerror (errno)); } - -// dump socket error indication, if any, with ID tag -#if defined (_WINSOCKAPI_) -#define dsockerr(s) { if (TAO_debug_level) dmsg_v ("%s: winsock error %d", \ - s, WSAGetLastError()); } -#else -#define dsockerr(s) dperror(s) -#endif /* _WINSOCKAPI_ */ - -#else /* !DEBUG */ -#define dmsg(s) { } -#define dmsg1(s,a1) { } -#define dmsg2(s,a1,a2) { } - -#define dexc(env, s) { } -#define dperror(s) { } -#define dsockerr(s) { } -#endif /* DEBUG */ - -// These don't compile out; you must #ifdef them. This is done -// intentionally since CPP macros have severe limits, and varargs _(or -// lack thereof) is one of them. - -#if defined (DEBUG) - -// This is like an fprintf statement except the filter is a set of -// characters (string). If TAO_debug_level is nonzero and any -// characters in that string are in the "TAO_debug_filter" string, the -// message is then printed. Assign thosee characters as needed. - -extern void TAO_Export dmsg_filter (const char *filter, - const char *fmt, - ...); - -// Filter according to TAO_debug_level instead of category. (For -// speed, test against TAO_debug_level directly.) - -extern void TAO_Export dmsg_filter (u_int level, - const char *fmt, - ...); - -// General varargs debug message printer, no filtering - -extern void TAO_Export dmsg_v (const char *fmt, - ...); -extern void TAO_Export _dmsg_x (CORBA_Environment &env, - const char *info); -extern void TAO_Export dmsg_opaque (char *label, - u_char *buffer, - u_long len); -extern void TAO_Export dmsg_opaque_full (char *label, - const u_char *buffer, - u_long len); -#endif /* DEBUG */ - -#endif /* TAO_DEBUG_H */ |