247b141d641955757d7a70ad9175273b3450432d
[collectd.git] / src / utils_debug.h
1 /**
2  * collectd - src/utils_debug.h
3  * Copyright (C) 2005  Niki W. Waibel
4  *
5  * This program is free software; you can redistribute it and/
6  * or modify it under the terms of the GNU General Public Li-
7  * cence as published by the Free Software Foundation; either
8  * version 2 of the Licence, or any later version.
9  *
10  * This program is distributed in the hope that it will be use-
11  * ful, but WITHOUT ANY WARRANTY; without even the implied war-
12  * ranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13  * See the GNU General Public Licence for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * Licence along with this program; if not, write to the Free
17  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
18  * USA.
19  *
20  * Author:
21  *   Niki W. Waibel <niki.waibel@gmx.net>
22 **/
23
24 #if !COLLECTD_UTILS_DEBUG_H
25 #define COLLECTD_UTILS_DEBUG_H 1
26
27 #define DBG(...) cu_debug(__FILE__, __LINE__, __func__, \
28         __VA_ARGS__)
29
30 #define DBG_STARTFILE(...) cu_debug_startfile(__FILE__, __LINE__, \
31         __func__, __VA_ARGS__)
32 #define DBG_STOPFILE(...) cu_debug_stopfile(__FILE__, __LINE__, \
33         __func__, __VA_ARGS__)
34
35 #define DBG_RESETFILE(file) cu_debug_resetfile(__FILE__, __LINE__, __func__, \
36         filename)
37
38 void cu_debug(const char *file, int line, const char *func,
39         const char *format, ...);
40
41 int cu_debug_startfile(const char *file, int line, const char *func,
42         const char *format, ...);
43 int cu_debug_stopfile(const char *file, int line, const char *func,
44         const char *format, ...);
45
46 int cu_debug_resetfile(const char *file, int line, const char *func,
47         const char *filename);
48
49 #endif /* !COLLECTD_UTILS_DEBUG_H */
50