1 /* 2 * JDebug.h 3 * 4 * Debugging routines and definitions, typically empty when compiling without the -Ddebug option. 5 * 6 * Copyright (C) 2002-2011 Joris Heirbaut 7 * 8 * This file is part of JojoDiff. 9 * 10 * JojoDiff is free software: you can redistribute it and/or modify 11 * it under the terms of the GNU General Public License as published by 12 * the Free Software Foundation, either version 3 of the License, or 13 * (at your option) any later version. 14 * 15 * This program is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU General Public License for more details. 19 * 20 * You should have received a copy of the GNU General Public License 21 * along with this program. If not, see <http://www.gnu.org/licenses/>. 22 */ 23 24 #ifndef JDEBUG_H_ 25 #define JDEBUG_H_ 26 27 #include <stdio.h> 28 29 #include "JDefs.h" 30 31 /** 32 * Debug constants 33 */ 34 #if debug 35 #define AreWeHere fprintf(stderr, "test\n") ; fflush(stderr) ; 36 37 #define DBGHSH 0 // Debug Hash -dhsh 38 #define DBGAHD 1 // Debug Ahead -dahd 39 #define DBGCMP 2 // Debug Compare -dcmp 40 #define DBGPRG 3 // Debug Progress -dprg 41 #define DBGBUF 4 // Debug Ahead Buffer -dbuf 42 #define DBGAHH 5 // Debug Ahead Hash -dahh 43 #define DBGHSK 6 // Debug ufHshNxt -dahh 44 #define DBGBKT 7 // Debug ufFabSek -dbkt 45 #define DBGRED 8 // Debug ufFabGet -dred 46 #define DBGMCH 9 // Debug ufMch... -dmch 47 #define DBGDST 10 // Debug Hashtable distribution -ddst 48 #else 49 #define AreWeHere ; 50 #endif 51 52 /* 53 * Inlined debugging routines 54 */ 55 class JDebug { 56 public: 57 static FILE *stddbg; /* Debug output to stderr or stdout */ 58 59 #if debug 60 static int gbDbg[16]; 61 #endif 62 }; 63 64 #endif /* JDEBUG_H_ */ 65