File: xtrap.h

package info (click to toggle)
sendmail 8.18.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,268 kB
  • sloc: ansic: 106,906; perl: 7,504; sh: 5,488; makefile: 888
file content (38 lines) | stat: -rw-r--r-- 833 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
 * Copyright (c) 2000-2001 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: xtrap.h,v 1.8 2013-11-22 20:51:32 ca Exp $
 */

/*
**  scaffolding for testing exception handler code
*/

#ifndef SM_XTRAP_H
# define SM_XTRAP_H

# include <sm/debug.h>
# include <sm/exc.h>

extern SM_ATOMIC_UINT_T SmXtrapCount;
extern SM_DEBUG_T SmXtrapDebug;
extern SM_DEBUG_T SmXtrapReport;

# if SM_DEBUG_CHECK
#  define sm_xtrap_check() (++SmXtrapCount == sm_debug_level(&SmXtrapDebug))
# else
#  define sm_xtrap_check() (0)
# endif

# define sm_xtrap_raise_x(exc) \
		if (sm_xtrap_check()) \
		{ \
			sm_exc_raise_x(exc); \
		} else

#endif /* ! SM_XTRAP_H */