remove FILE dependency
[compress.git] / debug.h
1 #ifndef __DEBUG_H__
2 #define __DEBUG_H__
3
4 #include <stdio.h>
5 #include "fprintf.h"
6
7 /* constants */
8
9 #define COMPRESS 1
10 #define DECOMPRESS 2
11
12 #define NB_CHARS 256
13
14 #define DEBUG 4
15 #define INFO 3
16 #define WARNING 2
17 #define ERROR 1
18
19 /* macros */
20
21 #define CEIL(x, y) (((x) + (y) - 1) / (y))
22 #define MIN(x, y) (((x) < (y)) ? (x) : (y))
23 #define MAX(x, y) (((x) > (y)) ? (x) : (y))
24 #define VERBOSE(level, statement...) do { if (level <= verbose) { statement; } } while(0)
25 #define PRINTF(args...) do { myfprintf (stdout, args); fflush (stdout); } while (0)
26
27 /* gobal variables */
28
29 extern int verbose;
30
31 #endif /* __DEBUG_H__ */
32
33 /* vim: set ts=4 sw=4 et */