summaryrefslogtreecommitdiff
path: root/upb/handlers.c
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2019-01-12 19:12:57 -0800
committerJoshua Haberman <jhaberman@gmail.com>2019-01-12 19:12:57 -0800
commit48863ea0be94ea3d3d61206ad7ce9ead206770fa (patch)
tree9c4b647586ecb7c52fa56f8cef26301027ec5ae7 /upb/handlers.c
parentd2f9bec5c6f3c34362cf13e35e11d3dbc7888a32 (diff)
A lot more tests are working now.
Diffstat (limited to 'upb/handlers.c')
-rw-r--r--upb/handlers.c11
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;
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback