Imported Upstream version 2.5.1
[ossec-hids.git] / src / headers / debug_op.h
1 /* @(#) $Id$ */
2
3 /* Copyright (C) 2009 Trend Micro Inc.
4  * All right reserved.
5  *
6  * This program is a free software; you can redistribute it
7  * and/or modify it under the terms of the GNU General Public
8  * License (version 2) as published by the FSF - Free Software
9  * Foundation
10  */
11
12
13 /* Part of the OSSEC HIDS
14  * Available at http://www.ossec.net
15  */
16
17 /* Functions to generate debug/verbose/err reports.
18  * Right now, we have two debug levels: 1,2,
19  * a verbose mode and a error (merror) function.
20  * To see these messages, use the "-d","-v" options
21  * (or "-d" twice to see debug2). The merror is printed
22  * by default when an important error occur.
23  * */
24
25 #ifndef __DEBUG_H
26
27 #define __DEBUG_H
28
29 #ifndef __GNUC__
30 #define __attribute__(x)
31 #endif
32
33 void debug1(const char *msg,...) __attribute__((format(printf, 1, 2)));
34
35 void debug2(const char *msg,...) __attribute__((format(printf, 1, 2)));
36
37 void merror(const char *msg,...) __attribute__((format(printf, 1, 2)));
38
39 void verbose(const char *msg,...) __attribute__((format(printf, 1, 2)));
40
41 void print_out(const char *msg,...) __attribute__((format(printf, 1, 2)));
42
43 void log2file(const char * msg,... ) __attribute__((format(printf, 1, 2)));
44
45 void ErrorExit(const char *msg,...) __attribute__((format(printf, 1, 2)));
46
47
48 /* Use these three functions to set when you
49  * enter in debug, chroot or daemon mode
50  */
51 void nowDebug();
52
53 void nowChroot();
54
55 void nowDaemon();
56
57 int isChroot();
58
59 /* Debug analysisd */
60 #ifdef DEBUGAD 
61     #define DEBUG_MSG(x,y,z) verbose(x,y,z)
62 #else
63     #define DEBUG_MSG(x,y,z)
64 #endif /* end debug analysisd */
65
66 #endif