Namespace the path functions

This commit is contained in:
Abdelrahman Said 2024-02-24 14:47:18 +00:00
parent fc951c8bd8
commit d5c19e2c58

View File

@ -6,13 +6,12 @@
#define NUMPARTS(...) \ #define NUMPARTS(...) \
(sizeof((const char *[]){"", __VA_ARGS__}) / sizeof(const char *) - 1) (sizeof((const char *[]){"", __VA_ARGS__}) / sizeof(const char *) - 1)
#define JOIN_PATH(DST, ...) join_path(DST, NUMPARTS(__VA_ARGS__), __VA_ARGS__) #define wapp_join_path(DST, ...) \
join_path(DST, NUMPARTS(__VA_ARGS__), __VA_ARGS__)
#define wapp_dirname(DST, PATH) dirup(DST, 1, PATH)
#define wapp_dirup(DST, COUNT, PATH) dirup(DST, COUNT, PATH)
void join_path(char *dst, u64 count, ...); void join_path(char *dst, u64 count, ...);
#define DIRNAME(DST, PATH) dirup(DST, 1, PATH)
#define DIRUP(DST, COUNT, PATH) dirup(DST, COUNT, PATH)
void dirup(char *dst, u64 levels, const char *path); void dirup(char *dst, u64 levels, const char *path);
#endif // !PATH_UTILS_H #endif // !PATH_UTILS_H