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;