new upstream release (3.3.0); modify package compatibility for Stretch
[ossec-hids.git] / src / headers / debug_op.h
1 /* Copyright (C) 2009 Trend Micro Inc.
2  * All right reserved.
3  *
4  * This program is a free software; you can redistribute it
5  * and/or modify it under the terms of the GNU General Public
6  * License (version 2) as published by the FSF - Free Software
7  * Foundation
8  */
9
10 /* Functions to generate debug/verbose/err reports
11  *
12  * We have two debug levels (1 and 2), a verbose mode and an error function
13  *
14  * To see these messages, use the "-d","-v" options (or "-d" twice to see debug2)
15  * The merror is printed by default when an important error occurs
16  */
17
18 #ifndef __DEBUG_H
19 #define __DEBUG_H
20
21 #ifndef __GNUC__
22 #define __attribute__(x)
23 #endif
24
25 void debug1(const char *msg, ...) __attribute__((format(printf, 1, 2))) __attribute__((nonnull));
26 void debug2(const char *msg, ...) __attribute__((format(printf, 1, 2))) __attribute__((nonnull));
27 void merror(const char *msg, ...) __attribute__((format(printf, 1, 2))) __attribute__((nonnull));
28 void verbose(const char *msg, ...) __attribute__((format(printf, 1, 2))) __attribute__((nonnull));
29 void print_out(const char *msg, ...) __attribute__((format(printf, 1, 2))) __attribute__((nonnull));
30 void log2file(const char *msg, ... ) __attribute__((format(printf, 1, 2))) __attribute__((nonnull));
31 void ErrorExit(const char *msg, ...) __attribute__((format(printf, 1, 2))) __attribute__((nonnull)) __attribute__ ((noreturn));
32
33 /* Use these three functions to set when you
34  * enter in debug, chroot or daemon mode
35  */
36 void nowDebug(void);
37 void nowChroot(void);
38 void nowDaemon(void);
39
40 int isChroot(void);
41
42 /* Debug analysisd */
43 #ifdef DEBUGAD
44 #define DEBUG_MSG(x,y,z) verbose(x,y,z)
45 #else
46 #define DEBUG_MSG(x,y,z)
47 #endif /* end debug analysisd */
48
49 #endif /* __DEBUG_H */
50