diff options
author | Jan200101 <sentrycraft123@gmail.com> | 2020-08-18 23:58:16 +0200 |
---|---|---|
committer | Jan200101 <sentrycraft123@gmail.com> | 2020-08-18 23:58:16 +0200 |
commit | d53109eaa890ab807b66961a89291cea3cd3c003 (patch) | |
tree | a62382b32014266f5aecb6f639d0962bb1682bf0 /src/dxvk.c | |
parent | 1753e2b151cbb4af75a4e9ea61720b3704b03805 (diff) | |
download | polecat-d53109eaa890ab807b66961a89291cea3cd3c003.tar.gz polecat-d53109eaa890ab807b66961a89291cea3cd3c003.zip |
first part of a proper lutris implementation and cleanup0.1.4
- remove all old build platform related variables
- change behavior of clean
- change tabs into spaces
- make XDG fetching method static
- replace strcpy and cat with strn alternative with proper bounds checking
- add cache dir
- reenable dxvk and download from ram
- completely rework lutris fetching and convert it into an interal struct
- only show http errors in debug
- add sanity checks to methods with possible NULL return
- change extracting methods to extract tar from ram
Diffstat (limited to 'src/dxvk.c')
-rw-r--r-- | src/dxvk.c | 23 |
1 files changed, 21 insertions, 2 deletions
@@ -2,10 +2,13 @@ #include <string.h> #include <json.h> #include <libgen.h> +#include <linux/limits.h> #include "dxvk.h" #include "net.h" +#include "tar.h" #include "common.h" +#include "config.h" const static struct Command dxvk_commands[] = { { .name = "install", .func = dxvk_install, .description = "download and install a dxvk version" }, @@ -52,11 +55,27 @@ int dxvk_install(int argc, char** argv) json_object_object_get_ex(version, "browser_download_url", &assets); char* name = basename((char*)json_object_get_string(assets)); + struct MemoryStruct* tar; + + char datadir[PATH_MAX]; + getDataDir(datadir, sizeof(datadir)); + makeDir(datadir); printf("Downloading %s", json_object_get_string(assets)); - downloadFile(json_object_get_string(assets), name); - printf("\nDone\n"); + //downloadFile(json_object_get_string(assets), name); + tar = downloadToRam(json_object_get_string(assets)); + + printf("Extracting %s\n", name); + + extract(tar, datadir); + + printf("Done\n"); + + free(tar->memory); + free(tar); } + + json_object_put(runner); } } else |