Replace char * with Str8 in cpath dirup

This commit is contained in:
2025-02-22 22:09:04 +00:00
parent d9314fb41e
commit dbedcb3100
3 changed files with 149 additions and 121 deletions

View File

@@ -2,6 +2,7 @@
#define CPATH_H
#include "aliases.h"
#include "mem_allocator.h"
#include "platform.h"
#include "str8.h"
@@ -17,8 +18,8 @@ BEGIN_C_LINKAGE
#error "Unrecognised platform"
#endif
#define wapp_cpath_dirname(DST, PATH) dirup(DST, 1, PATH)
#define wapp_cpath_dirup(DST, COUNT, PATH) dirup(DST, COUNT, PATH)
#define wapp_cpath_dirname(ALLOCATOR, PATH) dirup(ALLOCATOR, PATH, 1)
#define wapp_cpath_dirup(ALLOCATOR, PATH, COUNT) dirup(ALLOCATOR, PATH, COUNT)
enum {
CPATH_JOIN_SUCCESS = 0,
@@ -28,7 +29,7 @@ enum {
};
u32 wapp_cpath_join_path(Str8 *dst, const Str8List *parts);
void dirup(char *dst, u64 levels, const char *path);
Str8 *dirup(const Allocator *allocator, Str8RO *path, u64 levels);
#ifdef __cplusplus
END_C_LINKAGE