snmplib_debug.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2023 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
18void (*snmplib_debug_hook) (int, char *,...) = NULL;
19
20extern void
21snmplib_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
#define BUFSIZ
Definition: defines.h:20
void(* snmplib_debug_hook)(int, char *,...)
Definition: snmplib_debug.c:18
void snmplib_debug(int lvl, const char *fmt,...)
Definition: snmplib_debug.c:21
int unsigned int
Definition: stub_fd.cc:19
#define NULL
Definition: types.h:145

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors