From d24f350950ba8684ea4e5dbf973a0db9ac25e962 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Sat, 21 Nov 2020 12:24:47 +0100 Subject: add basic variable related attributes to the installer struct --- src/lutris.c | 3 +++ src/lutris.h | 24 +++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) 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 #include #include #include @@ -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 #include 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; }; -- cgit v1.2.3