-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcsv.h
39 lines (32 loc) · 995 Bytes
/
csv.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*****************************************************************************/
/** Lector de ficheros CSV para DIV2 **/
/** **/
/** Macros para la generación del log de CSV **/
/*****************************************************************************/
#ifndef __CSV_H_
#define __CSV_H_
#ifdef CSV_DEBUG
#define CSV_LOG_FILE "csv.log"
#define INIT_LOG() FILE* ferr = NULL
#define OPEN_LOG() ferr = div_fopen(CSV_LOG_FILE, "a")
#define LPRINT(STR) \
if (ferr != NULL) { \
fprintf(ferr, STR); \
}
#define LPRINTF(STR, VAL) \
if (ferr != NULL) { \
fprintf(ferr, STR, VAL); \
}
#define CLOSE_LOG() \
if (ferr != NULL) { \
div_fclose(ferr); \
}
#else
#define INIT_LOG()
#define OPEN_LOG()
#define LPRINT(STR)
#define LPRINTF(STR, VAL)
#define CLOSE_LOG()
#endif
#endif
/* vim: set ts=2 sw=2 tw=0 et fileencoding=cp858 :*/