[8937874] | 1 | /* debug.h |
---|
[d1b1380] | 2 | * SURVEX debugging info control macros |
---|
[fa42426] | 3 | * Copyright (C) 1993-1996,2001,2002 Olly Betts |
---|
[846746e] | 4 | * |
---|
[89231c4] | 5 | * This program is free software; you can redistribute it and/or modify |
---|
| 6 | * it under the terms of the GNU General Public License as published by |
---|
| 7 | * the Free Software Foundation; either version 2 of the License, or |
---|
| 8 | * (at your option) any later version. |
---|
[846746e] | 9 | * |
---|
| 10 | * This program is distributed in the hope that it will be useful, |
---|
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
[89231c4] | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 13 | * GNU General Public License for more details. |
---|
[846746e] | 14 | * |
---|
[89231c4] | 15 | * You should have received a copy of the GNU General Public License |
---|
| 16 | * along with this program; if not, write to the Free Software |
---|
| 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
[d1b1380] | 18 | */ |
---|
| 19 | |
---|
[5792f52] | 20 | /*#define DEBUG_INVALID 1*/ |
---|
| 21 | |
---|
[d1b1380] | 22 | #ifndef DEBUG_H |
---|
[5792f52] | 23 | #define DEBUG_H |
---|
[d1b1380] | 24 | #include "useful.h" |
---|
[fa42426] | 25 | #include "message.h" /* for fatalerror() */ |
---|
[d1b1380] | 26 | |
---|
| 27 | /* turn periodic calls to validate() checks on/off */ |
---|
[2c0a0cf] | 28 | #ifndef VALIDATE |
---|
| 29 | # define VALIDATE 0 |
---|
| 30 | #endif |
---|
[d1b1380] | 31 | |
---|
| 32 | /* turn on dumping of network data structure (lots of output) */ |
---|
[2c0a0cf] | 33 | #ifndef DUMP_NETWORK |
---|
| 34 | # define DUMP_NETWORK 0 |
---|
| 35 | #endif |
---|
[d1b1380] | 36 | |
---|
| 37 | /* elaborate if data structure becomes invalid */ |
---|
| 38 | #ifndef DEBUG_INVALID |
---|
| 39 | # define DEBUG_INVALID 0 |
---|
| 40 | #endif |
---|
| 41 | |
---|
[8937874] | 42 | /* macro to report detected bug */ |
---|
[5792f52] | 43 | #ifdef DEBUG_INVALID |
---|
[8937874] | 44 | # define BUG(M) BLK(fputsnl(__FILE__":"STRING(__LINE__)": "M, STDERR);\ |
---|
| 45 | fatalerror(/*Bug in program detected! Please report this to the authors*/11);) |
---|
[d1b1380] | 46 | #else |
---|
[8937874] | 47 | # define BUG(M) fatalerror(/*Bug in program detected! Please report this to the authors*/11) |
---|
[d1b1380] | 48 | #endif |
---|
| 49 | |
---|
| 50 | /* assert macro, which calls BUG() if it fails */ |
---|
[4c07c51] | 51 | #define SVX_ASSERT(E) if (E) {} else BUG("assert("#E") failed") |
---|
[d1b1380] | 52 | |
---|
| 53 | /* assert macro, which calls BUG() if it fails */ |
---|
[4c07c51] | 54 | #define SVX_ASSERT2(E, M) if (E) {} else BUG("assert("#E") failed - "M) |
---|
[d1b1380] | 55 | |
---|
| 56 | /* datain.c */ |
---|
| 57 | |
---|
| 58 | /* general debugging info */ |
---|
| 59 | #define DEBUG_DATAIN 0 |
---|
| 60 | /* more (older) debugging info */ |
---|
| 61 | #define DEBUG_DATAIN_1 0 |
---|
| 62 | |
---|
| 63 | /* network.c */ |
---|
| 64 | |
---|
| 65 | /* print info generally useful for debugging */ |
---|
| 66 | #define PRINT_NETBITS 0 |
---|
| 67 | /* puts '+' for legs 'inside' big (>3) nodes */ |
---|
| 68 | #define SHOW_INTERNAL_LEGS 0 |
---|
| 69 | |
---|
| 70 | /* matrix.c */ |
---|
| 71 | |
---|
| 72 | /* print out the matrices */ |
---|
| 73 | #define PRINT_MATRICES 0 |
---|
| 74 | /* display info about where we are in algorithm */ |
---|
| 75 | #define DEBUG_MATRIX 0 |
---|
| 76 | /* print out bumf as matrix is built from network */ |
---|
| 77 | #define DEBUG_MATRIX_BUILD 0 |
---|
| 78 | |
---|
| 79 | #endif |
---|