diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2019-01-12 19:12:57 -0800 |
---|---|---|
committer | Joshua Haberman <jhaberman@gmail.com> | 2019-01-12 19:12:57 -0800 |
commit | 48863ea0be94ea3d3d61206ad7ce9ead206770fa (patch) | |
tree | 9c4b647586ecb7c52fa56f8cef26301027ec5ae7 /upb/handlers.c | |
parent | d2f9bec5c6f3c34362cf13e35e11d3dbc7888a32 (diff) |
A lot more tests are working now.
Diffstat (limited to 'upb/handlers.c')
-rw-r--r-- | upb/handlers.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/upb/handlers.c b/upb/handlers.c index fd81b03..ba27b98 100644 --- a/upb/handlers.c +++ b/upb/handlers.c @@ -286,6 +286,10 @@ const upb_handlers *upb_handlers_getsubhandlers_sel(const upb_handlers *h, const upb_msgdef *upb_handlers_msgdef(const upb_handlers *h) { return h->msg; } +bool upb_handlers_addcleanup(upb_handlers *h, void *p, upb_handlerfree *func) { + return upb_handlercache_addcleanup(h->cache, p, func); +} + upb_handlertype_t upb_handlers_getprimitivehandlertype(const upb_fielddef *f) { switch (upb_fielddef_type(f)) { case UPB_TYPE_INT32: @@ -470,12 +474,13 @@ void upb_handlercache_free(upb_handlercache *cache) { upb_gfree(cache); } -bool upb_handlers_addcleanup(upb_handlers *h, void *p, upb_handlerfree *func) { +bool upb_handlercache_addcleanup(upb_handlercache *c, void *p, + upb_handlerfree *func) { bool ok; - if (upb_inttable_lookupptr(&h->cache->cleanup_, p, NULL)) { + if (upb_inttable_lookupptr(&c->cleanup_, p, NULL)) { return false; } - ok = upb_inttable_insertptr(&h->cache->cleanup_, p, upb_value_fptr(func)); + ok = upb_inttable_insertptr(&c->cleanup_, p, upb_value_fptr(func)); UPB_ASSERT(ok); return true; } |