1/* $FreeBSD: stable/11/contrib/ipfilter/lib/verbose.c 255332 2013-09-06 23:11:19Z cy $ */
| 1/* $FreeBSD: stable/11/contrib/ipfilter/lib/verbose.c 369186 2021-01-31 04:32:46Z cy $ */
|
2 3/* 4 * Copyright (C) 2012 by Darren Reed. 5 * 6 * See the IPFILTER.LICENCE file for details on licencing. 7 * 8 * $Id$ 9 */ 10
| 2 3/* 4 * Copyright (C) 2012 by Darren Reed. 5 * 6 * See the IPFILTER.LICENCE file for details on licencing. 7 * 8 * $Id$ 9 */ 10
|
11#if defined(__STDC__)
| |
12# include <stdarg.h>
| 11# include <stdarg.h>
|
13#else 14# include <varargs.h> 15#endif
| |
16#include <stdio.h> 17 18#include "ipf.h" 19#include "opts.h" 20 21
| 12#include <stdio.h> 13 14#include "ipf.h" 15#include "opts.h" 16 17
|
22#if defined(__STDC__)
| |
23void verbose(int level, char *fmt, ...)
| 18void verbose(int level, char *fmt, ...)
|
24#else 25void verbose(level, 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_VERBOSE) 35 vprintf(fmt, pvar); 36 va_end(pvar); 37} 38 39
| 19{ 20 va_list pvar; 21 22 va_start(pvar, fmt); 23 24 if (opts & OPT_VERBOSE) 25 vprintf(fmt, pvar); 26 va_end(pvar); 27} 28 29
|
40#if defined(__STDC__)
| |
41void ipfkverbose(char *fmt, ...)
| 30void ipfkverbose(char *fmt, ...)
|
42#else 43void ipfkverbose(fmt, va_alist) 44 char *fmt; 45 va_dcl 46#endif
| |
47{ 48 va_list pvar; 49 50 va_start(pvar, fmt); 51 52 if (opts & OPT_VERBOSE) 53 verbose(0x1fffffff, fmt, pvar); 54 va_end(pvar); 55}
| 31{ 32 va_list pvar; 33 34 va_start(pvar, fmt); 35 36 if (opts & OPT_VERBOSE) 37 verbose(0x1fffffff, fmt, pvar); 38 va_end(pvar); 39}
|