xref: /freebsd-12.1/contrib/ipfilter/lib/debug.c (revision 7a0a89d2)
1 /*	$FreeBSD$	*/
2 
3 /*
4  * Copyright (C) 2000-2001 by Darren Reed.
5  *
6  * See the IPFILTER.LICENCE file for details on licencing.
7  *
8  * $Id: debug.c,v 1.6.4.1 2006/06/16 17:20:57 darrenr Exp $
9  */
10 
11 #if defined(__STDC__)
12 # include <stdarg.h>
13 #else
14 # include <varargs.h>
15 #endif
16 #include <stdio.h>
17 
18 #include "ipt.h"
19 #include "opts.h"
20 
21 
22 #ifdef	__STDC__
23 void	debug(char *fmt, ...)
24 #else
25 void	debug(fmt, va_alist)
26 char *fmt;
27 va_dcl
28 #endif
29 {
30 	va_list pvar;
31 
32 	va_start(pvar, fmt);
33 
34 	if (opts & OPT_DEBUG)
35 		vprintf(fmt, pvar);
36 	va_end(pvar);
37 }
38