00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #pragma once
00026 #ifndef OSCAP_DEBUG_PRIV_H_
00027 #define OSCAP_DEBUG_PRIV_H_
00028
00029 #include "util.h"
00030 #include "public/debug.h"
00031
00032 OSCAP_HIDDEN_START;
00033
00034 #ifndef oscap_dprintf
00035 #if defined(NDEBUG)
00036 # define oscap_dprintf(...) while(0)
00037 #else
00038 # include <stddef.h>
00039 # include <stdarg.h>
00040 void __oscap_dprintf(const char *, const char *, size_t, const char *, ...);
00041 # define oscap_dprintf(...) __oscap_dprintf (__FILE__, __PRETTY_FUNCTION__, __LINE__, __VA_ARGS__)
00042 #endif
00043 #endif
00044
00045
00046 #ifndef NDEBUG
00047 #include <stdlib.h>
00048 extern int __debuglog_level;
00049 # define debug(l) if ((__debuglog_level = (__debuglog_level == -1 ? atoi (getenv (OSCAP_DEBUG_LEVEL_ENV) == NULL ? "0" : getenv (OSCAP_DEBUG_LEVEL_ENV)) : __debuglog_level)) && __debuglog_level >= (l))
00050 #else
00051 # define debug(l) if (0)
00052 #endif
00053
00054 #define oscap_dlprintf(l, ...) do { debug(l) { oscap_dprintf(__VA_ARGS__); }} while(0)
00055
00056 OSCAP_HIDDEN_END;
00057
00058 #endif
00059