]> git.ipfire.org Git - thirdparty/squid.git/blob - snmplib/snmplib_debug.c
SourceFormat: enforcement
[thirdparty/squid.git] / snmplib / snmplib_debug.c
1 #include "config.h"
2 #if HAVE_STDIO_H
3 #include <stdio.h>
4 #endif
5 #if HAVE_SYS_TYPES_H
6 #include <sys/types.h>
7 #endif
8 #include <stdarg.h>
9
10 #include "snmp_debug.h"
11
12 void (*snmplib_debug_hook) (int, char *,...) = NULL;
13
14 extern void
15 snmplib_debug(int lvl, const char *fmt,...)
16 {
17 char buf[BUFSIZ];
18 va_list args;
19 va_start(args, fmt);
20
21 if (snmplib_debug_hook != NULL) {
22 vsnprintf(buf, BUFSIZ, fmt, args);
23 snmplib_debug_hook(lvl, buf);
24 } else {
25 vfprintf(stderr, fmt, args);
26 }
27 va_end(args);
28 }