Add xterm-256color as a valid terminal.
[eco.git] / debug.c
blob03fe68c171292d2ae5e7afa1d3c48327f5bf26d1
1 /*
2 * Copyright (C) 2008 Diego Hernan Borghetti.
3 * Eco
4 */
6 #include <stdio.h>
7 #include <stdarg.h>
10 #ifdef WITH_DEBUG
12 /* debug file. */
13 FILE *_dbg_fp= NULL;
15 #endif
17 void e_debug_init(void)
19 #ifdef WITH_DEBUG
20 _dbg_fp= fopen("eco.debug", "w");
21 if (_dbg_fp)
22 setvbuf(_dbg_fp, NULL, _IONBF, 0);
23 #endif
26 void e_debug_end(void)
28 #ifdef WITH_DEBUG
29 if (_dbg_fp) {
30 fclose(_dbg_fp);
31 _dbg_fp= NULL;
33 #endif
36 void e_debug_printf(char *fmt, ...)
38 #ifdef WITH_DEBUG
39 va_list ap;
41 if (!_dbg_fp)
42 return;
44 va_start(ap, fmt);
45 vfprintf(_dbg_fp, fmt, ap);
46 va_end(ap);
47 #endif