| 1 | #ifndef __DEBUG_H__ |
| 2 | #define __DEBUG_H__ |
| 3 | |
| 4 | /* constants */ |
| 5 | |
| 6 | #define COMPRESS 1 |
| 7 | #define DECOMPRESS 2 |
| 8 | |
| 9 | #define NB_CHARS 256 |
| 10 | |
| 11 | #define DEBUG 4 |
| 12 | #define INFO 3 |
| 13 | #define WARNING 2 |
| 14 | #define ERROR 1 |
| 15 | |
| 16 | /* macros */ |
| 17 | |
| 18 | #define CEIL(x, y) (((x) + (y) - 1) / (y)) |
| 19 | #define MIN(x, y) (((x) < (y)) ? (x) : (y)) |
| 20 | #define MAX(x, y) (((x) > (y)) ? (x) : (y)) |
| 21 | #define VERBOSE(level, statement...) do { if (level <= verbose) { statement; } } while(0) |
| 22 | |
| 23 | /* gobal variables */ |
| 24 | |
| 25 | extern int verbose; |
| 26 | |
| 27 | #endif /* __DEBUG_H__ */ |
| 28 | |
| 29 | /* vim: set ts=4 sw=4 et */ |