diff options
| author | 2023-12-26 04:53:54 -0600 | |
|---|---|---|
| committer | 2023-12-26 04:53:54 -0600 | |
| commit | 838b1269ac2eba5110dece8c17b468343a4f73ee (patch) | |
| tree | 9044e11c8204d2ca67def739d5ae692e79c617fe /src/instance.c | |
| parent | add instance remove (diff) | |
implement remaining commands (but badly)
TODO: refactor and sanitize inputs more
Diffstat (limited to 'src/instance.c')
| -rw-r--r-- | src/instance.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/instance.c b/src/instance.c index 148f71d..ca80a45 100644 --- a/src/instance.c +++ b/src/instance.c @@ -123,6 +123,16 @@ int l2_instance_del_instance(struct l2_instance *inst) return INSTANCE_SUCCESS; } +int l2_instance_rename_instance(struct l2_instance *inst, const char *newname) +{ + char *nn = strdup(newname); + if (!nn) return INSTANCE_ERRNO; + + free((char *)inst->name); + inst->name = nn; + return INSTANCE_SUCCESS; +} + /* internal utilities */ int l2_instance__load_all_from_object(json_t *obj) |
