snmplib_debug.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
3  *
4  * Squid software is distributed under GPLv2+ license and includes
5  * contributions from numerous individuals and organizations.
6  * Please see the COPYING and CONTRIBUTORS files for details.
7  */
8 
9 #include "squid.h"
10 
11 #if HAVE_SYS_TYPES_H
12 #include <sys/types.h>
13 #endif
14 #include <stdarg.h>
15 
16 #include "snmp_debug.h"
17 
18 void (*snmplib_debug_hook) (int, char *,...) = NULL;
19 
20 extern void
21 snmplib_debug(int lvl, const char *fmt,...)
22 {
23  char buf[BUFSIZ];
24  va_list args;
25  va_start(args, fmt);
26 
27  if (snmplib_debug_hook != NULL) {
28  vsnprintf(buf, BUFSIZ, fmt, args);
29  snmplib_debug_hook(lvl, buf);
30  } else {
31  vfprintf(stderr, fmt, args);
32  }
33  va_end(args);
34 }
35 
void snmplib_debug(int lvl, const char *fmt,...)
Definition: snmplib_debug.c:21
#define BUFSIZ
Definition: defines.h:20
void const char * buf
Definition: stub_helper.cc:16
bool SIGHDLR int STUB void int
Definition: stub_tools.cc:68
void(* snmplib_debug_hook)(int, char *,...)
Definition: snmplib_debug.c:18
#define NULL
Definition: types.h:166

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors