<div dir="ltr">+1 from me too. </div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Apr 12, 2015 at 4:33 AM, Ray Bellis <span dir="ltr"><<a href="mailto:Ray.Bellis@nominet.org.uk" target="_blank">Ray.Bellis@nominet.org.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">+1<br>
<br>
Every API that provides callbacks should allow a void* client data.<br>
<br>
It's essential for wrapping such APIs into languages like C++ where the client data can hold a pointer to "this".<br>
<br>
Ray<br>
<br>
Sent from my iPhone<br>
<div class="HOEnZb"><div class="h5"><br>
On 11 Apr 2015, at 23:48, "Hollenbeck, Scott" <<a href="mailto:shollenbeck@verisign.com">shollenbeck@verisign.com</a>> wrote:<br>
<br>
>> -----Original Message-----<br>
>> From: getdns-api [mailto:<a href="mailto:getdns-api-bounces@vpnc.org">getdns-api-bounces@vpnc.org</a>] On Behalf Of<br>
>> Willem Toorop<br>
>> Sent: Tuesday, April 07, 2015 10:34 AM<br>
>> To: <a href="mailto:getdns-api@vpnc.org">getdns-api@vpnc.org</a><br>
>> Subject: [getdns-api] Feedback wanted for<br>
>> getdns_context_set_update_callback function (was Re: Questions and<br>
>> Suggestions After Implementing PHP Language Bindings)<br>
>><br>
>> Dear All,<br>
>><br>
>> As Scott Hollenbeck has rightfully noticed (see quoted message below),<br>
>> the API is inconsistent in its use of user registered functions.<br>
>><br>
>> A request callback function provided with an asynchronous requests, is<br>
>> given alongside a (void *) user argument which will be passed when the<br>
>> callback is called. Similarly, user defined memory management<br>
>> functions<br>
>> accommodate a user argument (perhaps to point to a structure to help<br>
>> with memory book-keeping). In contrast, the<br>
>> getdns_context_set_context_update_callback does provide these means.<br>
>><br>
>> I propose to replace it with a new function that allows an user<br>
>> argument:<br>
>><br>
>> getdns_return_t<br>
>> getdns_context_set_update_callback(<br>
>> getdns_context *context,<br>
>> void *userarg,<br>
>> void (*value)(getdns_context *context,<br>
>> getdns_context_code_t changed_item,<br>
>> void *userarg)<br>
>> );<br>
>><br>
>> The new name is to keep the API backwards compatible. An<br>
>> implementation<br>
>> can provide the old symbol, though undocumented.<br>
>> What do you think?<br>
><br>
> Well, *I* certainly like this idea!<br>
><br>
> Scott<br>
><br>
> _______________________________________________<br>
> getdns-api mailing list<br>
> <a href="mailto:getdns-api@vpnc.org">getdns-api@vpnc.org</a><br>
<br>
_______________________________________________<br>
getdns-api mailing list<br>
<a href="mailto:getdns-api@vpnc.org">getdns-api@vpnc.org</a><br>
</div></div></blockquote></div><br></div>