pam_pkcs11
0.6.10
src
common
debug.h
Go to the documentation of this file.
1
/*
2
* PKCS #11 PAM Login Module
3
* Copyright (C) 2003 Mario Strasser <mast@gmx.net>,
4
*
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
9
*
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
14
*
15
* $Id$
16
*/
17
24
#ifndef __DEBUG_H_
25
#define __DEBUG_H_
26
27
#ifdef HAVE_CONFIG_H
28
#include <config.h>
29
#endif
30
31
#ifndef DEBUG
32
33
#warning "Debugging is completely disabled!"
34
#define DBG
35
#define DBG1
36
#define DBG2
37
#define DBG3
38
#define DBG4
39
#define DBG5
40
41
#define ERR
42
#define ERR1
43
#define ERR2
44
#define ERR3
45
#define ERR4
46
#define ERR5
47
48
#else
49
50
/*
51
#define DBG(f, ...) debug_print(1, __FILE__, __LINE__, f, ## __VA_ARGS__)
52
*/
53
/* this syntax is redundant in GCC, just used to avoid warns in -pedantic */
54
#define DBG(f) debug_print(1, __FILE__, __LINE__, f )
55
#define DBG1(f,a) debug_print(1, __FILE__, __LINE__, f , a )
56
#define DBG2(f,a,b) debug_print(1, __FILE__, __LINE__, f , a , b )
57
#define DBG3(f,a,b,c) debug_print(1, __FILE__, __LINE__, f , a , b , c )
58
#define DBG4(f,a,b,c,d) debug_print(1, __FILE__, __LINE__, f , a , b , c , d )
59
#define DBG5(f,a,b,c,d,e) debug_print(1, __FILE__, __LINE__, f , a , b , c , d , e )
60
61
#define ERR(f) debug_print(-1, __FILE__, __LINE__, f )
62
#define ERR1(f,a) debug_print(-1, __FILE__, __LINE__, f , a )
63
#define ERR2(f,a,b) debug_print(-1, __FILE__, __LINE__, f , a , b )
64
#define ERR3(f,a,b,c) debug_print(-1, __FILE__, __LINE__, f , a , b , c )
65
#define ERR4(f,a,b,c,d) debug_print(-1, __FILE__, __LINE__, f , a , b , c , d )
66
#define ERR5(f,a,b,c,d,e) debug_print(-1, __FILE__, __LINE__, f , a , b , c , d , e )
67
68
#ifndef __DEBUG_C_
69
#define DEBUG_EXTERN extern
70
#else
71
#define DEBUG_EXTERN
72
#endif
73
78
DEBUG_EXTERN
void
set_debug_level
(
int
level);
79
84
DEBUG_EXTERN
int
get_debug_level
(
void
);
85
98
DEBUG_EXTERN
void
debug_print
(
int
level,
const
char
*file,
int
line,
const
char
*format, ...)
99
#if defined __GNUC__
100
__attribute__((format(printf, 4, 5)))
101
#endif
102
;
103
104
#undef DEBUG_EXTERN
105
106
#endif
/* DEBUG */
107
108
#endif
/* __DEBUG_H_ */
get_debug_level
DEBUG_EXTERN int get_debug_level(void)
get_debug_level() Returns the current debug level.
set_debug_level
DEBUG_EXTERN void set_debug_level(int level)
set_debug_level() Sets the current debug level.
debug_print
DEBUG_EXTERN void debug_print(int level, const char *file, int line, const char *format,...)
debug_print() prints the given message
DEBUG_EXTERN
#define DEBUG_EXTERN
Definition:
debug.h:69
Generated by
1.8.18