diff options
Diffstat (limited to 'nebu/include/filesystem/nebu_file_io.h')
-rw-r--r-- | nebu/include/filesystem/nebu_file_io.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/nebu/include/filesystem/nebu_file_io.h b/nebu/include/filesystem/nebu_file_io.h new file mode 100644 index 0000000..bc12d36 --- /dev/null +++ b/nebu/include/filesystem/nebu_file_io.h @@ -0,0 +1,20 @@ +#ifndef NEBU_FILE_IO_H +#define NEBU_FILE_IO_H +/* this is a small wrapper around the basic file io functions, + ie open, close, read, gets */ + +#ifdef FILE_IO_ZLIB +#include <zlib.h> +typedef gzFile file_handle; +#else +#include <stdio.h> +typedef FILE* file_handle; +#endif + +file_handle file_open(const char *path, const char *mode); +int file_close(file_handle file); + +int file_read(file_handle file, void* data, unsigned int size); +char* file_gets(file_handle file, char* data, unsigned int size); + +#endif |