diff options
Diffstat (limited to 'file_use.h')
-rw-r--r-- | file_use.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/file_use.h b/file_use.h new file mode 100644 index 0000000..fe7cc08 --- /dev/null +++ b/file_use.h @@ -0,0 +1,40 @@ +#ifndef __LIBUTILS_FILE_USE_H +#define __LIBUTILS_FILE_USE_H + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "debug.h" + +#define F_FILE_NONE 0 +#define F_FILE_READ 1 +#define F_FILE_WRITE 2 +#define F_FILE_RW 3 + +#define F_SEEK_CUR SEEK_CUR +#define F_SEEK_END SEEK_END +#define F_SEEK_SET SEEK_SET + +//simple file using things +typedef struct f_file +{ + FILE *fid; + int flags; + long size; + int seek; +} f_file; + +void f_file_null( f_file* ); +int f_file_seek( f_file*, long, int ); +size_t f_file_read( f_file*, size_t, void* ); +//f_file_read_bl(); +int f_file_size( f_file* ); +size_t f_file_write( f_file*, size_t, void* ); +//f_file_write_bl(); +f_file* f_file_open( const char*, int ); +int f_file_close( f_file* ); +//f_file_flush(); +//f_file_mmap(); + +#endif |