diff options
Diffstat (limited to 'include/bh/file.h')
| -rw-r--r-- | include/bh/file.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/include/bh/file.h b/include/bh/file.h new file mode 100644 index 0000000..7718c80 --- /dev/null +++ b/include/bh/file.h @@ -0,0 +1,37 @@ +#ifndef BHLIB_FILE_H +#define BHLIB_FILE_H + +#include "io.h" + +typedef struct bh_file_s bh_file_t; + +bh_file_t *bh_file_new(const char *path, + const char *mode); + +void bh_file_free(bh_file_t *file); + +size_t bh_file_read(bh_file_t *file, + char *buffer, + size_t size); + +size_t bh_file_write(bh_file_t *file, + const char *buffer, + size_t size); + +void bh_file_flush(bh_file_t *file); + +void bh_file_seek(bh_file_t *file, + bh_off_t pos, + int dir); + +bh_off_t bh_file_tell(bh_file_t *file); + +bh_off_t bh_file_available(bh_file_t *file); + +int bh_file_error(bh_file_t *file); + +int bh_file_eof(bh_file_t *file); + +void bh_file_clear(bh_file_t *file); + +#endif /* BHLIB_FILE_H */ |
