diff options
Diffstat (limited to 'include/std/file.h')
-rw-r--r-- | include/std/file.h | 4 |
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); |