From 838b1269ac2eba5110dece8c17b468343a4f73ee Mon Sep 17 00:00:00 2001 From: bigfoot547 Date: Tue, 26 Dec 2023 04:53:54 -0600 Subject: implement remaining commands (but badly) TODO: refactor and sanitize inputs more --- src/instance.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/instance.c') 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) -- cgit v1.2.3-70-g09d2