diff options
author | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-08-11 23:00:26 +1000 |
---|---|---|
committer | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-08-11 23:00:26 +1000 |
commit | b03bde3d412148cd573f5f14012cdd270f309947 (patch) | |
tree | 848af582079a60787cc5a5f8138e7ca6d508f2ee /src/platform/path.c | |
parent | 48a703e52490cb52fd32e54e3e37f7e70462a267 (diff) |
starting work on immediate mode drawing
Diffstat (limited to 'src/platform/path.c')
-rw-r--r-- | src/platform/path.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/src/platform/path.c b/src/platform/path.c deleted file mode 100644 index f43d954..0000000 --- a/src/platform/path.c +++ /dev/null @@ -1,35 +0,0 @@ -#include "path.h" - -#include <stdlib.h> -#include <string.h> -#include "mem.h" -#include "str.h" - -#if defined(CEL_PLATFORM_LINUX) || defined(CEL_PLATFORM_MAC) -#include <libgen.h> -path_opt path_parent(arena* a, const char* path) { - // Duplicate the string because dirname doesnt like const literals - char* path_copy = arena_alloc(a, strlen(path) + 1); - strcpy(path_copy, path); - char* path_dirname = dirname(path_copy); - return (path_opt){ .path = Str8_cstr_view(path_dirname), .has_value = true }; -} -#endif -#ifdef CEL_PLATFORM_WINDOWS -#include <shlwapi.h> -#include <windows.h> -#pragma comment(lib, "Shlwapi.lib") - -path_opt path_parent(arena* a, const char* path) { - // Duplicate the string because PathRemoveFileSpec mutates in-place - size_t len = strlen(path) + 1; - char* path_copy = arena_alloc(a, len); - strcpy_s(path_copy, len, path); - - if (PathRemoveFileSpecA(path_copy)) { - return (path_opt){ .path = Str8_cstr_view(path_copy), .has_value = true }; - } else { - return (path_opt){ .has_value = false }; - } -} -#endif |