/*
* Copyright (c) 2000, 2001, 2003 Proofpoint, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*
* $Id: debug.h,v 1.17 2013-11-22 20:51:31 ca Exp $
*/
/*
** libsm debugging and tracing
** See libsm/debug.html for documentation.
*/
#ifndef SM_DEBUG_H
# define SM_DEBUG_H
/*
** abstractions for printing trace messages
*/
extern SM_FILE_T *
sm_debug_file __P((void));
extern void
extern void
extern void
sm_debug_close __P((void));
/*
** abstractions for setting and testing debug activation levels
*/
extern void
sm_debug_addsettings_x __P((const char *));
extern void
sm_debug_addsetting_x __P((const char *, int));
extern const char SmDebugMagic[];
struct sm_debug
{
/*
** debug_level is the activation level of this debug
** object. Level 0 means no debug activity.
** It is initialized to SM_DEBUG_UNKNOWN, which indicates
** that the true value is unknown. If debug_level ==
** SM_DEBUG_UNKNOWN, then the access functions will look up
** its true value in the internal table of debug settings.
*/
/*
** debug_name is the name used to reference this SM_DEBUG
** structure via the sendmail -d option.
*/
char *debug_name;
/*
** debug_desc is a literal character string of the form
** "@(#)$Debug: <name> - <short description> $"
*/
char *debug_desc;
/*
** We keep a linked list of initialized SM_DEBUG structures
** so that when sm_debug_addsetting is called, we can reset
** them all back to the uninitialized state.
*/
};
# ifndef SM_DEBUG_CHECK
# endif /* ! SM_DEBUG_CHECK */
# if SM_DEBUG_CHECK
/*
** This macro is cleverly designed so that if the debug object is below
** the specified level, then the only overhead is a single comparison
** (except for the first time this macro is invoked).
*/
# else /* SM_DEBUG_CHECK */
# endif /* SM_DEBUG_CHECK */
extern bool
extern int
SmDebugMagic, \
name, \
desc, \
NULL}
#endif /* ! SM_DEBUG_H */