From 23a4b8e6c43da3f1dbfb743193a38a2317fa98ae Mon Sep 17 00:00:00 2001 From: Richard Aas Date: Mon, 19 Oct 2015 09:21:13 +0000 Subject: [PATCH] added odict_entry_del() --- include/re_odict.h | 1 + src/odict/entry.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/include/re_odict.h b/include/re_odict.h index 2abdc67..60941b2 100644 --- a/include/re_odict.h +++ b/include/re_odict.h @@ -39,6 +39,7 @@ int odict_debug(struct re_printf *pf, const struct odict *o); int odict_entry_add(struct odict *o, const char *key, enum odict_type type, ...); +void odict_entry_del(struct odict *o, const char *key); int odict_entry_debug(struct re_printf *pf, const struct odict_entry *e); bool odict_type_iscontainer(enum odict_type type); diff --git a/src/odict/entry.c b/src/odict/entry.c index fa04aa9..fb6431a 100644 --- a/src/odict/entry.c +++ b/src/odict/entry.c @@ -106,6 +106,12 @@ int odict_entry_add(struct odict *o, const char *key, } +void odict_entry_del(struct odict *o, const char *key) +{ + mem_deref((struct odict_entry *)odict_lookup(o, key)); +} + + int odict_entry_debug(struct re_printf *pf, const struct odict_entry *e) { int err;