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