Commit patch to not break on spaces.
[bowtie.git] / mm.h
1 #ifndef MM_H_
2 #define MM_H_
3
4 /**
5  * mm.h:
6  *
7  * Defines that make it easier to handle files in the two different MM
8  * contexts: i.e. on Linux and Mac where MM is supported and POSIX I/O
9  * functions work as expected, and on Windows where MM is not supported
10  * and where there isn't POSIX I/O,
11  */
12
13 #ifdef BOWTIE_MM
14 #define MM_FILE_CLOSE(x) if(x > 3) { close(x); }
15 #define MM_READ_RET ssize_t
16 #define MM_READ read
17 #define MM_SEEK lseek
18 #define MM_FILE int
19 #define MM_FILE_INIT -1
20 #else
21 #define MM_FILE_CLOSE(x) if(x != NULL) { fclose(x); }
22 #define MM_READ_RET size_t
23 #define MM_READ(file, dest, sz) fread(dest, 1, sz, file)
24 #define MM_SEEK fseek
25 #define MM_FILE FILE*
26 #define MM_FILE_INIT NULL
27 #endif
28
29 #endif /* MM_H_ */