diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2015-05-03 19:11:57 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2015-05-03 19:26:39 +0200 |
commit | 134a627130a732f6315d323895365dd59fab95c5 (patch) | |
tree | 8c1b128b3f5e1ffe58d5791a68c4b31962d2f49b /common.c | |
parent | 1e3a27369080c6f189fd0d8d5151f23ec082a61f (diff) | |
download | xK-134a627130a732f6315d323895365dd59fab95c5.tar.gz xK-134a627130a732f6315d323895365dd59fab95c5.tar.xz xK-134a627130a732f6315d323895365dd59fab95c5.zip |
degesch: finish /set
One bug remaining to make it work.
Diffstat (limited to 'common.c')
-rw-r--r-- | common.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -1385,6 +1385,20 @@ end: return object; } +/// Clone an item. Schema assignments aren't retained. +struct config_item_ * +config_item_clone (struct config_item_ *self) +{ + // Oh well, it saves code + struct str tmp; + str_init (&tmp); + config_item_write (self, false, &tmp); + struct config_item_ *result = + config_item_parse (tmp.str, tmp.len, true, NULL); + str_free (&tmp); + return result; +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // XXX: this thing is ugly in concept |