[getdns-api] changes to signatures of data helper functions
willem at nlnetlabs.nl
Fri Sep 20 05:25:21 MST 2013
Op 10-09-13 21:21, Wiley, Glen schreef:
> I'd like to change the signatures for the non-trivial data type helper
> functions to include the context so that we will have access to the
> user defined allocators. For example
> getdns_return_t getdns_list_copy(getdns_context_t context, struct
> getdns_list *srclist, struct getdns_list **dstlist);
> getdns_return_t getdns_dict_get_names(getdns_context_t context, struct
> getdns_dict *dict, struct getdns_list **answer);
> What do folks think?
The structures representing lists and dicts could have an internal
reference to context themselves and pass it on to the newly created
lists and dicts. As long as the dicts and lists involved are created by
the lookup functions (which have the context argument) this will be
okay. It does not work when dicts and lists need to be created
separately, for example to specify extensions. Thus the
getdns_list_create and getdns_dict_create would need a context argument.
Though, I actually think it would be better if setting the custom memory
management functions should be implementation specific, just like
setting the event base is.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the getdns-api