[getdns-api] additional helper functions for bindata

Paul Hoffman paul.hoffman at vpnc.org
Tue Jan 7 15:36:26 MST 2014

On Jan 7, 2014, at 12:35 PM, Wiley, Glen <gwiley at verisign.com> wrote:

> We received feedback as a result of an internal hackathon that included:
> I used src/example/example-hostname.c as my guide and was confused by this line for a short while:
> struct getdns_bindata this_type = { 5, (void *)"IPv4" };
> It took me a while to realize 5 was the length of "IPv4". Maybe there could be a helper function to populate a bindata. For example:
> struct getdns_bindata this_type;
> getdns_bindata_set(&this_type, "IPv4", sizeof("IPv4"));
> or
> getdns_bindata_set_from_str(&this_type, "IPv4");
> What do folks think of adding one of these to the specification?

The latter seems more understandable, and seems fine. What do others think?

--Paul Hoffman

More information about the getdns-api mailing list