From cdea6b0e8c1e51c9962f73e183a3bd72ed63b40f Mon Sep 17 00:00:00 2001 From: Louie S Date: Sun, 6 Nov 2022 14:53:23 -0800 Subject: Restructure repository --- unix/cache.c | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 unix/cache.c (limited to 'unix/cache.c') diff --git a/unix/cache.c b/unix/cache.c deleted file mode 100644 index efd7cdf..0000000 --- a/unix/cache.c +++ /dev/null @@ -1,35 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include "../include/cache.h" -#include "../include/read_cfg.h" - -char *get_cache_path(bool create){ - char *path = malloc(sizeof(char) * BUF_LEN); - char *home = getenv("HOME"); - - assert(path != NULL); - - if(home == NULL){ - printf("Failed to save cache data: HOME is not set\n"); - free(path); - return NULL; - } - - //if create is asserted, build the path to the file - if(create){ - sprintf(path, "%s%c.cache%c", home, sep, sep); - mkdir(path, 0755); - - sprintf(path, "%s%c.cache%ctml%c", home, sep, sep, sep); - mkdir(path, 0755); - } - - sprintf(path, "%s%c.cache%ctml%cdata.bin", home, sep, sep, sep); - - return path; -} -- cgit