aboutsummaryrefslogtreecommitdiff
path: root/src/dxvk.c
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2020-08-18 23:58:16 +0200
committerJan200101 <sentrycraft123@gmail.com>2020-08-18 23:58:16 +0200
commitd53109eaa890ab807b66961a89291cea3cd3c003 (patch)
treea62382b32014266f5aecb6f639d0962bb1682bf0 /src/dxvk.c
parent1753e2b151cbb4af75a4e9ea61720b3704b03805 (diff)
downloadpolecat-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.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/dxvk.c b/src/dxvk.c
index c5ac1d0..3ef429c 100644
--- a/src/dxvk.c
+++ b/src/dxvk.c
@@ -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