diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-09-20 22:20:54 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-09-20 22:20:54 +0200 |
commit | 2c6ce788d039ac5aed91955b0be5640bf1318ef5 (patch) | |
tree | 6e78dbb9113d67b3a210a5d1c9630229d4c8ab58 /ast.h | |
parent | 37daee3aaad91536fc57e01e50f44319ee494ee3 (diff) |
treewide: rework extended type handling
Register prototype object directly together with the type instead of
setting it manually whenever an extended type value is instantiated.
This also allows freeing the various prototype objects in dlopened
modules.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'ast.h')
-rw-r--r-- | ast.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -101,6 +101,7 @@ struct ut_state { struct ut_extended_type { const char *name; + struct json_object *proto; void (*free)(void *); }; @@ -128,8 +129,8 @@ struct json_object *ut_new_object(struct json_object *proto); struct json_object *ut_new_double(double v); struct json_object *ut_new_null(void); -bool ut_register_extended_type(const char *name, void (*freefn)(void *)); -struct json_object *ut_set_extended_type(struct json_object *v, struct json_object *proto, const char *name, void *data); +bool ut_register_extended_type(const char *name, struct json_object *proto, void (*freefn)(void *)); +struct json_object *ut_set_extended_type(struct json_object *v, const char *name, void *data); void **ut_get_extended_type(struct json_object *val, const char *name); void *ParseAlloc(void *(*mfunc)(size_t)); |