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/instance.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'src/instance.h') diff --git a/src/instance.h b/src/instance.h index b0be665..e7e5943 100644 --- a/src/instance.h +++ b/src/instance.h @@ -5,12 +5,26 @@ struct l2_instance { uuid_t uuid; - char *name; - char *path; + const char *name; + const char *path; + + struct l2_instance *next; + struct l2_instance *prev; +}; + +enum { + INSTANCE_SUCCESS, /* instance operation succeeded */ + INSTANCE_ERRNO, /* instance operation failed (error code in errno) */ + INSTANCE_EJSON, /* instance operation failed (JSON error) */ + INSTANCE_EFORMAT /* instance file is malformed */ }; -void l2_instance_load(void); +/* load all instances (must be called after initialization) */ +int l2_instance_load_all(void); + +int l2_instance_save_all(void); -void l2_instance_save(void); +int l2_instance_add_instance(const struct l2_instance *inst); +int l2_instance_del_instance(struct l2_instance *inst); #endif /* include guard */ -- cgit v1.2.3-70-g09d2