Open SCAP Library

debug_priv.h

Go to the documentation of this file.
00001 
00005 /*
00006  * Copyright 2011 Red Hat Inc., Durham, North Carolina.
00007  * All Rights Reserved.
00008  *
00009  * This library is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU Lesser General Public
00011  * License as published by the Free Software Foundation; either
00012  * version 2.1 of the License, or (at your option) any later version.
00013  *
00014  * This library is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017  * Lesser General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU Lesser General Public
00020  * License along with this library; if not, write to the Free Software
00021  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022  *
00023  * Authors:
00024  *       Daniel Kopecek <dkopecek@redhat.com>
00025  *       Peter Vrabec <pvrabec@redhat.com>
00026  */
00027 
00028 #pragma once
00029 #ifndef OSCAP_DEBUG_PRIV_H_
00030 #define OSCAP_DEBUG_PRIV_H_
00031 
00032 #include <assert.h>
00033 #include <stdlib.h>
00034 #include <stddef.h>
00035 #include <stdarg.h>
00036 #include "util.h"
00037 #include "public/oscap_debug.h"
00038 
00039 OSCAP_HIDDEN_START;
00040 
00041 #define OSCAP_DEBUGOBJ_SEXP 1
00042 
00043 #ifndef _A
00044 #define _A(x) assert(x)
00045 #endif
00046 
00047 
00048 # define __dlprintf_wrapper(l, ...) __oscap_dlprintf (l, __FILE__, __PRETTY_FUNCTION__, __LINE__, 0, __VA_ARGS__)
00049 
00061 void __oscap_dlprintf(int level, const char *file, const char *fn, size_t line, int delta_indent, const char *fmt, ...);
00062 
00068 # define oscap_dlprintf(l, ...) __dlprintf_wrapper (l, __VA_ARGS__)
00069 
00070 void __oscap_debuglog_object (const char *file, const char *fn, size_t line, int objtype, void *obj);
00071 
00072 # define dO(type, obj) __oscap_debuglog_object(__FILE__, __PRETTY_FUNCTION__, __LINE__, type, obj)
00073 
00074 
00075 #define dI(...) oscap_dlprintf(DBG_I, __VA_ARGS__)
00076 #define dW(...) oscap_dlprintf(DBG_W, __VA_ARGS__)
00077 #define dE(...) oscap_dlprintf(DBG_E, __VA_ARGS__)
00078 #define dD(...) oscap_dlprintf(DBG_D, __VA_ARGS__)
00079 
00080 #define dIndent(indent_change) __oscap_dlprintf(DBG_I, __FILE__, __PRETTY_FUNCTION__, __LINE__, indent_change, NULL)
00081 
00082 OSCAP_HIDDEN_END;
00083 
00084 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines