diff options
| author | 2023-12-25 06:05:40 -0600 | |
|---|---|---|
| committer | 2023-12-25 06:05:40 -0600 | |
| commit | 6d1d4d0a5506dce90c833ef8dd141058fea3c33a (patch) | |
| tree | 12a95579dbf04c4310e5b42ad8cae399d81f1189 /src/instance.h | |
| parent | initial commit (diff) | |
[WIP] Add instances
still need to do the following:
- check if the folder exists
- try and find some way to canonicalize the path name
Diffstat (limited to 'src/instance.h')
| -rw-r--r-- | src/instance.h | 22 |
1 files changed, 18 insertions, 4 deletions
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 */ |
