Build libpakrd with cmake instead of using it as prebuilt library

This commit is contained in:
abdelrahman committed 2023-11-05 19:15:56 +00:00
1 parent c5dd826c66
commit 2de3e9b4df
12 files changed
+442 -15

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
#ifndef PATH_UTILS_H
#define PATH_UTILS_H
#include "aliases.h"
#define NUMPARTS(...) \
(sizeof((const char *[]){"", __VA_ARGS__}) / sizeof(const char *) - 1)
#define JOIN_PATH(DST, ...) join_path(DST, NUMPARTS(__VA_ARGS__), __VA_ARGS__)
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);
#endif // !PATH_UTILS_H