aboutsummaryrefslogtreecommitdiff
path: root/include/std/file.h
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-03-18 23:47:45 +0100
committerdec05eba <dec05eba@protonmail.com>2020-07-25 14:36:46 +0200
commit2323ca6c9ec3c8ee76b9acf13745b80b92952a6a (patch)
tree93013237dbcb0fa96ceb5f3c026fd040aff464cf /include/std/file.h
parent5a93c32a59775cd1be4b4f450e8230016b434366 (diff)
Add struct, import caching, binop ops etc
Diffstat (limited to 'include/std/file.h')
-rw-r--r--include/std/file.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/std/file.h b/include/std/file.h
index 120e7bb..c6753fd 100644
--- a/include/std/file.h
+++ b/include/std/file.h
@@ -4,6 +4,7 @@
#include "misc.h"
#include "types.h"
#include "buffer_view.h"
+#include "buffer.h"
/* Return bool_true if you want to continue scanning, otherwise return bool_false */
typedef bool (*scan_dir_callback_func)(const char *filepath, int filepath_length, void *userdata);
@@ -31,7 +32,10 @@ CHECK_RESULT int mapped_file_init(MappedFile *self, const char *filepath, Mapped
CHECK_RESULT int mapped_file_deinit(MappedFile *self);
#endif
+/* @data will be allocated with am_malloc, should be deallocated with am_free */
CHECK_RESULT int read_whole_file(const char *filepath, char **data, usize *size);
+/* @result_path will be allocated with am_malloc, should be deallocated with am_free */
+CHECK_RESULT int file_get_canonical_path(const char *filepath, char **result_path, usize *result_path_size);
BufferView file_get_parent_directory(BufferView filepath);
BufferView file_get_name(BufferView filepath);