remove most external function calls (except io)
[compress.git] / debug.h
1 #ifndef __DEBUG_H__
2 #define __DEBUG_H__
3
4 #include <stdio.h>
5
6 /* constants */
7
8 #define COMPRESS 1
9 #define DECOMPRESS 2
10
11 #define NB_CHARS 256
12 #define BUFFER_SIZE 4096
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 { fprintf (stdout, args); fflush (stdout); } while (0)
26
27 /* gobal variables */
28
29 extern int verbose;
30
31 #endif /* __DEBUG_H__ */
32
33 // vim: ts=4 sw=4 et