summaryrefslogtreecommitdiffstats
path: root/collection/elapi_debug.h
blob: 5515a92ce4c075140c8dbbf2b634e2da4a9bf857 (plain)
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
50
51
52
53
54
55
56
57
58
59
60
61
/*
    ELAPI

    Internal debugging header file.

    Copyright (C) Dmitri Pal <dpal@redhat.com> 2009

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef ELAPI_DEBUG_H
#define ELAPI_DEBUG_H

#ifdef ELAPI_LOG_DEBUG
#include <stdio.h>
#endif

#ifdef ELAPI_LOG_DEBUG
#define DEBUG_STRING(message,str) printf("[DEBUG] %23s (%4d) %s %s\n",__FILE__,__LINE__,message,str);
#else
#define DEBUG_STRING(message,str) ;
#endif

#ifdef ELAPI_LOG_DEBUG
#define DEBUG_NUMBER(message,number) printf("[DEBUG] %23s (%4d) %s %lu\n",__FILE__,__LINE__,message,(unsigned long int)(number));
#else
#define DEBUG_NUMBER(message,number) ;
#endif

#ifdef ELAPI_LOG_DEBUG
#define DEBUG_DOUBLE(message,number) printf("[DEBUG] %23s (%4d) %s %e\n",__FILE__,__LINE__,message,(double)(number));
#else
#define DEBUG_DOUBLE(message,number) ;
#endif

#ifdef ELAPI_LOG_DEBUG
#define DEBUG_ASSERT(expression) expression ? ; : printf("ASSERTION FAILED\n");
#else
#define DEBUG_ASSERT(expression) ;
#endif

#ifdef  ELAPI_LOG_DEBUG 
#ifdef      ELAPI_TOOLS_H
#define         DEBUG_COLLECTION(collection) debug_collection(collection,ELAPI_TRAVERSE_DEFAULT);
#else
#define         DEBUG_COLLECTION(collection) ;
#endif
#else
#define     DEBUG_COLLECTION(collection) ;
#endif

#endif