From 6d1d4d0a5506dce90c833ef8dd141058fea3c33a Mon Sep 17 00:00:00 2001 From: bigfoot547 Date: Mon, 25 Dec 2023 06:05:40 -0600 Subject: [WIP] Add instances still need to do the following: - check if the folder exists - try and find some way to canonicalize the path name --- src/l2su.h | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'src/l2su.h') diff --git a/src/l2su.h b/src/l2su.h index 13df852..1746a53 100644 --- a/src/l2su.h +++ b/src/l2su.h @@ -4,14 +4,33 @@ #include "command.h" #include "instance.h" +#include + struct l2_user_paths { const char *config; const char *data; }; -struct { +struct tag_l2_state_t { struct l2_user_paths paths; - struct l2_instance *instances; -} l2_state; + + /* eventually instances and other stuff will be stored in a hash table or something, + * but for now a doubly-linked list accomplishes our goals */ + struct l2_instance *instance_head; + struct l2_instance *instance_tail; +}; + +extern struct tag_l2_state_t l2_state; + +/* homecooked string methods */ +char *l2_launcher_strapp(char *target, const char *src); + +/* launcher utilities */ +char *l2_launcher_find_config_path(void); +char *l2_launcher_find_data_path(void); + +int l2_launcher_open_config(const char *path, int flags, mode_t mode); + +int l2_launcher_mkdir_parents(const char *path); #endif /* include guard */ -- cgit v1.2.3-70-g09d2