aboutsummaryrefslogtreecommitdiff
path: root/include/bh/file.h
diff options
context:
space:
mode:
authorMikhail Romanko <me@blankhex.com>2024-04-23 23:45:43 +0300
committerMikhail Romanko <me@blankhex.com>2024-04-23 23:45:43 +0300
commit692b5b42974e2f81dc4ad708a4593b1e8cb2bd3d (patch)
treeb7eec97f4a12e0090b9421e7dfe8a6116b7ef4d8 /include/bh/file.h
parentec499b6cfc3fe196757d4467ca044b5915198d45 (diff)
downloadbhlib-old-692b5b42974e2f81dc4ad708a4593b1e8cb2bd3d.tar.gz
Sync to the latest version.
Can be broken or partially implemented.
Diffstat (limited to 'include/bh/file.h')
-rw-r--r--include/bh/file.h37
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 */