From 2323ca6c9ec3c8ee76b9acf13745b80b92952a6a Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 18 Mar 2019 23:47:45 +0100 Subject: Add struct, import caching, binop ops etc --- include/std/file.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/std/file.h') 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); -- cgit v1.2.3