remove FILE dependency
[compress.git] / debug.h
CommitLineData
c9987f3b
LM
1#ifndef __DEBUG_H__
2#define __DEBUG_H__
3
d3dbaf98 4#include <stdio.h>
5f83300c 5#include "fprintf.h"
d3dbaf98 6
c9987f3b
LM
7/* constants */
8
9#define COMPRESS 1
10#define DECOMPRESS 2
11
12#define NB_CHARS 256
c9987f3b
LM
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)
5e0c5bc8 25#define PRINTF(args...) do { myfprintf (stdout, args); fflush (stdout); } while (0)
c9987f3b
LM
26
27/* gobal variables */
28
29extern int verbose;
30
31#endif /* __DEBUG_H__ */
32
5f83300c 33/* vim: set ts=4 sw=4 et */