aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2020-11-21 12:24:47 +0100
committerJan200101 <sentrycraft123@gmail.com>2020-11-21 12:24:47 +0100
commitd24f350950ba8684ea4e5dbf973a0db9ac25e962 (patch)
tree99d3894f1fac6572da04a06146443cbc9923b0d0
parent7b3ee49b6aa5bcff2b46987ebc8d9cd46b9e5ac1 (diff)
downloadpolecat-d24f350950ba8684ea4e5dbf973a0db9ac25e962.tar.gz
polecat-d24f350950ba8684ea4e5dbf973a0db9ac25e962.zip
add basic variable related attributes to the installer struct
-rw-r--r--src/lutris.c3
-rw-r--r--src/lutris.h24
2 files changed, 26 insertions, 1 deletions
diff --git a/src/lutris.c b/src/lutris.c
index a3caa3d..18703d6 100644
--- a/src/lutris.c
+++ b/src/lutris.c
@@ -1,4 +1,5 @@
+#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <linux/limits.h>
@@ -231,6 +232,8 @@ struct script_t lutris_getInstaller(char* installername)
installer.files = NULL;
installer.filecount = 0;
installer.error = NONE;
+ installer.variables = NULL;
+ installer.variablecount = 0;
if (installername)
{
diff --git a/src/lutris.h b/src/lutris.h
index 2142303..3dfcef2 100644
--- a/src/lutris.h
+++ b/src/lutris.h
@@ -1,6 +1,7 @@
#ifndef LUTRIS_H
#define LUTRIS_H
+#include <stddef.h>
#include <json.h>
enum keyword {
@@ -68,7 +69,7 @@ enum runner_t {
/*
* a list of all available runners could be fetched from lutris
* but we keep a local copy of all supported runners
- * to reduce the ammount of API calls needed
+ * to reduce the amount of API calls needed
*/
static const char runnerStr[RUNNERMAX][0xF] =
{
@@ -98,6 +99,21 @@ struct file_t {
char* url;
};
+enum value_type_t {
+ string,
+ function
+};
+
+struct list_t {
+ char* key;
+ enum value_type_t type;
+ union
+ {
+ char* str;
+ void (*func)();
+ } value;
+};
+
// my best attempt at representing a Lutris installer as a struct
struct script_t {
char* name;
@@ -106,10 +122,16 @@ struct script_t {
char* description;
char* notes;
char* wine;
+
struct directive_t** directives;
size_t directivecount;
+
struct file_t** files;
size_t filecount;
+
+ struct list_t** variables;
+ size_t variablecount;
+
enum errors error;
};