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