[getdns-api] API review - working with dicts,lists, and bindata

Goyal, Neel ngoyal at verisign.com
Thu Jan 30 09:26:19 MST 2014


This is commentary on sections 3.1.3 and 3.2 related to dicts/lists/bindata in reference to Bob Steagall’s review of the getdns API - http://www.vpnc.org/pipermail/getdns-api/2014-January/000229.html


Bob proposes a rename of functions related to dictionary and list element accessors.  A small sample includes:

getdns_list_create => getdns_create_list
getdns_list_set_dict => getdns_set_list_element_as_dict
getdns_list_get_dict => getdns_get_list_element_as_dict

getdns_dict_set_list => getdns_set_dict_element_as_list

I like the proposed name changes as it makes it clearer what is happening to the datastructure being modified.  It also feels more readable to me.

Section 3.2 proposes adding a couple of helpers for working with bindatas.  Specifically something like:

getdns_set_list_element_as_bindata_2
(
 getdns_list_t this_list,
 size_t index,
 uint8_t* bindata_content,
 size_t bindata_size
);

I like the thought and have no problem including them in the core (though I dislike the _2 suffix).  This relates to the discussion in http://www.vpnc.org/pipermail/getdns-api/2014-January/000219.html - it is possible that we can create a utility library that operates on top of the getdns spec and exposes some of these entry points for the user without affecting the core, and then gradually bring them in as needed.

That said, these functions are trivial for us to implement in the core right now, so maybe it is worth pulling them in.

Thoughts?

“This message (including any attachments) is intended only for the use of the individual or entity to which it is addressed, and may contain information that is non-public, proprietary, privileged, confidential and exempt from disclosure under applicable law or may be constituted as attorney work product. If you are not the intended recipient, you are hereby notified that any use, dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this message in error, notify sender immediately and delete this message immediately.”
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vpnc.org/pipermail/getdns-api/attachments/20140130/27f662dc/attachment.html>


More information about the getdns-api mailing list