]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/ipfilter/lib/verbose.c
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / ipfilter / lib / verbose.c
1 /*      $FreeBSD$       */
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>
13 #else
14 # include <varargs.h>
15 #endif
16 #include <stdio.h>
17
18 #include "ipf.h"
19 #include "opts.h"
20
21
22 #if defined(__STDC__)
23 void    verbose(int level, char *fmt, ...)
24 #else
25 void    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
40 #if defined(__STDC__)
41 void    ipfkverbose(char *fmt, ...)
42 #else
43 void    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 }