summaryrefslogtreecommitdiff
path: root/source/kit/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/kit/file.c')
-rw-r--r--source/kit/file.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/source/kit/file.c b/source/kit/file.c
index b9fabe2..fd24390 100644
--- a/source/kit/file.c
+++ b/source/kit/file.c
@@ -30,7 +30,7 @@ static int is_delim(char c) {
return c == '/' || c == '\\';
}
-static kit_string_t kit_get_env_(char *name, kit_allocator_t alloc) {
+static kit_string_t kit_get_env_(char *name, kit_allocator_t *alloc) {
char *val = getenv(name);
ptrdiff_t size = val != NULL ? (ptrdiff_t) strlen(val) : 0;
@@ -46,7 +46,7 @@ static kit_string_t kit_get_env_(char *name, kit_allocator_t alloc) {
return result;
}
-kit_string_t kit_path_norm(kit_str_t path, kit_allocator_t alloc) {
+kit_string_t kit_path_norm(kit_str_t path, kit_allocator_t *alloc) {
str_t parent = SZ("..");
ptrdiff_t i, i1, j;
@@ -103,7 +103,7 @@ kit_string_t kit_path_norm(kit_str_t path, kit_allocator_t alloc) {
}
kit_string_t kit_path_join(kit_str_t left, kit_str_t right,
- kit_allocator_t alloc) {
+ kit_allocator_t *alloc) {
ptrdiff_t left_size = left.size;
ptrdiff_t right_size = right.size;
char *right_values = right.values;
@@ -129,7 +129,7 @@ kit_string_t kit_path_join(kit_str_t left, kit_str_t right,
return joined;
}
-kit_string_t kit_path_user(kit_allocator_t alloc) {
+kit_string_t kit_path_user(kit_allocator_t *alloc) {
kit_string_t user = kit_get_env_(KIT_ENV_HOME, alloc);
if (user.size == 0) {
DA_RESIZE(user, 1);
@@ -139,7 +139,7 @@ kit_string_t kit_path_user(kit_allocator_t alloc) {
return user;
}
-kit_string_t kit_path_cache(kit_allocator_t alloc) {
+kit_string_t kit_path_cache(kit_allocator_t *alloc) {
kit_string_t cache, user;
#if defined(_WIN32) && !defined(__CYGWIN__)
@@ -307,8 +307,8 @@ kit_status_t kit_file_remove_folder(kit_str_t path) {
#endif
}
-kit_status_t kit_file_remove_recursive(kit_str_t path,
- kit_allocator_t alloc) {
+kit_status_t kit_file_remove_recursive(kit_str_t path,
+ kit_allocator_t *alloc) {
int type = kit_path_type(path);
ptrdiff_t i;
@@ -409,8 +409,8 @@ kit_file_info_t kit_file_info(kit_str_t path) {
return result;
}
-kit_path_list_t kit_file_enum_folder(kit_str_t path,
- kit_allocator_t alloc) {
+kit_path_list_t kit_file_enum_folder(kit_str_t path,
+ kit_allocator_t *alloc) {
PREPARE_PATH_BUF_;
kit_path_list_t result = { .status = KIT_OK };