diff --git a/spec/example-all-functions.c b/spec/example-all-functions.c index 598fec14..632bd4de 100644 --- a/spec/example-all-functions.c +++ b/spec/example-all-functions.c @@ -27,16 +27,16 @@ getdns_transport_t transportarg; getdns_append_name_t appendnamearg; getdns_data_type * datatypeptrarg; -struct getdns_bindata ** bindataptrarg; -struct getdns_dict * dictarg; -struct getdns_bindata * bindataarg; -struct getdns_list * listarg; -struct getdns_dict ** dictptrarg; -struct getdns_list ** listptrarg; +getdns_bindata ** bindataptrarg; +getdns_dict * dictarg; +getdns_bindata * bindataarg; +getdns_list * listarg; +getdns_dict ** dictptrarg; +getdns_list ** listptrarg; size_t sizetarg; size_t * sizetptrarg; -struct getdns_context *contextarg = NULL; +getdns_context *contextarg = NULL; uint8_t uint8arg; uint16_t uint16arg; uint32_t uint32arg; @@ -55,7 +55,7 @@ void * extendedreallocfunctionarg(void* userarg, void* foo, size_t bar) {UNUSED_PARAM(userarg); UNUSED_PARAM(foo); UNUSED_PARAM(bar); return NULL; } void extendeddeallocfunctionarg(void* userarg, void* foo) {UNUSED_PARAM(userarg); UNUSED_PARAM(foo);} -void setcallbackfunctionarg(struct getdns_context *foo1, getdns_context_code_t foo2) +void setcallbackfunctionarg(getdns_context *foo1, getdns_context_code_t foo2) {UNUSED_PARAM(foo1);UNUSED_PARAM(foo2);} int main() diff --git a/spec/example-reverse.c b/spec/example-reverse.c index de1a58da..4f5c7751 100644 --- a/spec/example-reverse.c +++ b/spec/example-reverse.c @@ -8,9 +8,9 @@ #define UNUSED_PARAM(x) ((void)(x)) /* Set up the callback function, which will also do the processing of the results */ -void this_callbackfn(struct getdns_context *this_context, +void this_callbackfn(getdns_context *this_context, uint16_t this_callback_type, - struct getdns_dict *this_response, + getdns_dict *this_response, void *this_userarg, getdns_transaction_t this_transaction_id) { @@ -29,34 +29,34 @@ void this_callbackfn(struct getdns_context *this_context, getdns_dict_destroy(this_response); return; } - struct getdns_list *replies_tree; + getdns_list *replies_tree; this_ret = getdns_dict_get_list(this_response, "replies_tree", &replies_tree); // Ignore any error size_t num_replies; this_ret = getdns_list_get_length(replies_tree, &num_replies); // Ignore any error /* Go through each reply */ for ( size_t reply_count = 0; reply_count < num_replies; ++reply_count) { - struct getdns_dict * this_reply; + getdns_dict * this_reply; this_ret = getdns_list_get_dict(replies_tree, reply_count, &this_reply); // Ignore any error /* Just print the address */ - struct getdns_list* reply_answers; + getdns_list* reply_answers; this_ret = getdns_dict_get_list(this_reply, "answer", &reply_answers); // Ignore any error size_t num_answers; this_ret = getdns_list_get_length(reply_answers, &num_answers); // Ignore any error /* Go through each answer */ for ( size_t answer_count = 0; answer_count < num_answers; ++answer_count) { - struct getdns_dict * this_rr; + getdns_dict * this_rr; this_ret = getdns_list_get_dict(reply_answers, answer_count, &this_rr); /* Get the RDATA type */ uint32_t this_type; this_ret = getdns_dict_get_int(this_rr, "type", &this_type); // Ignore any error if (this_type == GETDNS_RRTYPE_PTR) { - struct getdns_dict *this_rdata; + getdns_dict *this_rdata; this_ret = getdns_dict_get_dict(this_rr, "rdata", &this_rdata); // Ignore any error - struct getdns_bindata * this_dname; + getdns_bindata * this_dname; this_ret = getdns_dict_get_bindata(this_rdata, "rdata_raw", &this_dname); char *this_dname_str = getdns_convert_dns_name_to_fqdn((char *)this_dname->data); printf("The dname is %s\n", this_dname_str); @@ -77,7 +77,7 @@ void this_callbackfn(struct getdns_context *this_context, int main() { /* Create the DNS context for this call */ - struct getdns_context *this_context = NULL; + getdns_context *this_context = NULL; getdns_return_t context_create_return = getdns_context_create(&this_context, 1); if (context_create_return != GETDNS_RETURN_GOOD) { @@ -95,12 +95,12 @@ int main() } (void)getdns_extension_set_libevent_base(this_context, this_event_base); /* Set up the getdns call */ - struct getdns_dict * this_addr_to_look_up = getdns_dict_create(); + getdns_dict * this_addr_to_look_up = getdns_dict_create(); // TODO: check the return value above - struct getdns_bindata this_type = { 4, (void *)"IPv4" }; + getdns_bindata this_type = { 4, (void *)"IPv4" }; getdns_return_t this_ret = getdns_dict_set_bindata(this_addr_to_look_up, "address_type", &this_type); UNUSED_PARAM(this_ret); - struct getdns_bindata this_ipv4_addr = { 4, (void *)"\x08\x08\x08\x08" }; + getdns_bindata this_ipv4_addr = { 4, (void *)"\x08\x08\x08\x08" }; this_ret = getdns_dict_set_bindata(this_addr_to_look_up, "address_data", &this_ipv4_addr); char* this_userarg = "somestring"; // Could add things here to help identify this call getdns_transaction_t this_transaction_id = 0; diff --git a/spec/example-simple-answers.c b/spec/example-simple-answers.c index 8c0b446d..1866543c 100644 --- a/spec/example-simple-answers.c +++ b/spec/example-simple-answers.c @@ -8,9 +8,9 @@ #define UNUSED_PARAM(x) ((void)(x)) /* Set up the callback function, which will also do the processing of the results */ -void this_callbackfn(struct getdns_context *this_context, +void this_callbackfn(getdns_context *this_context, getdns_callback_type_t this_callback_type, - struct getdns_dict *this_response, + getdns_dict *this_response, void *this_userarg, getdns_transaction_t this_transaction_id) { @@ -28,7 +28,7 @@ void this_callbackfn(struct getdns_context *this_context, getdns_dict_destroy(this_response); return; } - struct getdns_list * just_the_addresses_ptr; + getdns_list * just_the_addresses_ptr; this_ret = getdns_dict_get_list(this_response, "just_address_answers", &just_the_addresses_ptr); if (this_ret != GETDNS_RETURN_GOOD) // This check is really not needed, but prevents a compiler error under "pedantic" { @@ -41,10 +41,10 @@ void this_callbackfn(struct getdns_context *this_context, /* Go through each record */ for ( size_t rec_count = 0; rec_count < num_addresses; ++rec_count ) { - struct getdns_dict * this_address; + getdns_dict * this_address; this_ret = getdns_list_get_dict(just_the_addresses_ptr, rec_count, &this_address); // Ignore any error /* Just print the address */ - struct getdns_bindata * this_address_data; + getdns_bindata * this_address_data; this_ret = getdns_dict_get_bindata(this_address, "address_data", &this_address_data); // Ignore any error char *this_address_str = getdns_display_ip_address(this_address_data); printf("The address is %s\n", this_address_str); @@ -61,7 +61,7 @@ void this_callbackfn(struct getdns_context *this_context, int main() { /* Create the DNS context for this call */ - struct getdns_context *this_context = NULL; + getdns_context *this_context = NULL; getdns_return_t context_create_return = getdns_context_create(&this_context, 1); if (context_create_return != GETDNS_RETURN_GOOD) { diff --git a/spec/example-synchronous.c b/spec/example-synchronous.c index 463a7e61..4095388b 100644 --- a/spec/example-synchronous.c +++ b/spec/example-synchronous.c @@ -9,7 +9,7 @@ int main() { getdns_return_t this_ret; /* Holder for all function returns */ /* Create the DNS context for this call */ - struct getdns_context *this_context = NULL; + getdns_context *this_context = NULL; getdns_return_t context_create_return = getdns_context_create(&this_context, 1); if (context_create_return != GETDNS_RETURN_GOOD) { @@ -20,7 +20,7 @@ int main() const char * this_name = "www.example.com"; uint8_t this_request_type = GETDNS_RRTYPE_A; /* Get the A and AAAA records */ - struct getdns_dict * this_extensions = getdns_dict_create(); + getdns_dict * this_extensions = getdns_dict_create(); this_ret = getdns_dict_set_int(this_extensions, "return_both_v4_and_v6", GETDNS_EXTENSION_TRUE); if (this_ret != GETDNS_RETURN_GOOD) { @@ -29,7 +29,7 @@ int main() getdns_context_destroy(this_context); return(GETDNS_RETURN_GENERIC_ERROR); } - struct getdns_dict * this_response = NULL; + getdns_dict * this_response = NULL; /* Make the call */ getdns_return_t dns_request_return = getdns_general_sync(this_context, this_name, this_request_type, @@ -55,17 +55,17 @@ int main() getdns_context_destroy(this_context); return(GETDNS_RETURN_GENERIC_ERROR); } - struct getdns_list * just_the_addresses_ptr; + getdns_list * just_the_addresses_ptr; this_ret = getdns_dict_get_list(this_response, "just_address_answers", &just_the_addresses_ptr); // Ignore any error size_t num_addresses; this_ret = getdns_list_get_length(just_the_addresses_ptr, &num_addresses); // Ignore any error /* Go through each record */ for ( size_t rec_count = 0; rec_count < num_addresses; ++rec_count ) { - struct getdns_dict * this_address; + getdns_dict * this_address; this_ret = getdns_list_get_dict(just_the_addresses_ptr, rec_count, &this_address); // Ignore any error /* Just print the address */ - struct getdns_bindata * this_address_data; + getdns_bindata * this_address_data; this_ret = getdns_dict_get_bindata(this_address, "address_data", &this_address_data); // Ignore any error char *this_address_str = getdns_display_ip_address(this_address_data); printf("The address is %s\n", this_address_str); diff --git a/spec/example-tree.c b/spec/example-tree.c index 485b0d7d..f815baee 100644 --- a/spec/example-tree.c +++ b/spec/example-tree.c @@ -8,9 +8,9 @@ #define UNUSED_PARAM(x) ((void)(x)) /* Set up the callback function, which will also do the processing of the results */ -void this_callbackfn(struct getdns_context *this_context, +void this_callbackfn(getdns_context *this_context, getdns_callback_type_t this_callback_type, - struct getdns_dict *this_response, + getdns_dict *this_response, void *this_userarg, getdns_transaction_t this_transaction_id) { @@ -29,7 +29,7 @@ void this_callbackfn(struct getdns_context *this_context, return; } /* Find all the answers returned */ - struct getdns_list * these_answers; + getdns_list * these_answers; this_ret = getdns_dict_get_list(this_response, "replies_tree", &these_answers); if (this_ret == GETDNS_RETURN_NO_SUCH_DICT_NAME) { @@ -42,20 +42,20 @@ void this_callbackfn(struct getdns_context *this_context, /* Go through each answer */ for ( size_t rec_count = 0; rec_count < num_answers; ++rec_count ) { - struct getdns_dict * this_record; + getdns_dict * this_record; this_ret = getdns_list_get_dict(these_answers, rec_count, &this_record); // Ignore any error /* Get the answer section */ - struct getdns_list * this_answer; + getdns_list * this_answer; this_ret = getdns_dict_get_list(this_record, "answer", &this_answer); // Ignore any error /* Get each RR in the answer section */ size_t num_rrs; this_ret = getdns_list_get_length(this_answer, &num_rrs); for ( size_t rr_count = 0; rr_count < num_rrs; ++rr_count ) { - struct getdns_dict *this_rr = NULL; + getdns_dict *this_rr = NULL; this_ret = getdns_list_get_dict(this_answer, rr_count, &this_rr); // Ignore any error /* Get the RDATA */ - struct getdns_dict * this_rdata = NULL; + getdns_dict * this_rdata = NULL; this_ret = getdns_dict_get_dict(this_rr, "rdata", &this_rdata); // Ignore any error /* Get the RDATA type */ uint32_t this_type; @@ -63,7 +63,7 @@ void this_callbackfn(struct getdns_context *this_context, /* If it is type A or AAAA, print the value */ if (this_type == GETDNS_RRTYPE_A) { - struct getdns_bindata * this_a_record = NULL; + getdns_bindata * this_a_record = NULL; this_ret = getdns_dict_get_bindata(this_rdata, "ipv4_address", &this_a_record); if (this_ret == GETDNS_RETURN_NO_SUCH_DICT_NAME) { @@ -78,7 +78,7 @@ void this_callbackfn(struct getdns_context *this_context, } else if (this_type == GETDNS_RRTYPE_AAAA) { - struct getdns_bindata * this_aaaa_record = NULL; + getdns_bindata * this_aaaa_record = NULL; this_ret = getdns_dict_get_bindata(this_rdata, "ipv6_address", &this_aaaa_record); if (this_ret == GETDNS_RETURN_NO_SUCH_DICT_NAME) { @@ -104,7 +104,7 @@ void this_callbackfn(struct getdns_context *this_context, int main() { /* Create the DNS context for this call */ - struct getdns_context *this_context = NULL; + getdns_context *this_context = NULL; getdns_return_t context_create_return = getdns_context_create(&this_context, 1); if (context_create_return != GETDNS_RETURN_GOOD) { diff --git a/spec/getdns-0.399.tgz b/spec/getdns-0.399.tgz deleted file mode 100644 index 60f6d493..00000000 Binary files a/spec/getdns-0.399.tgz and /dev/null differ diff --git a/spec/getdns-0.400.tgz b/spec/getdns-0.400.tgz new file mode 100644 index 00000000..682db345 Binary files /dev/null and b/spec/getdns-0.400.tgz differ diff --git a/spec/getdns_core_only.c b/spec/getdns_core_only.c index c86b4425..ca69a26e 100644 --- a/spec/getdns_core_only.c +++ b/spec/getdns_core_only.c @@ -9,10 +9,10 @@ int main(){ return(0); } getdns_return_t getdns_general( - struct getdns_context *context, + getdns_context *context, const char *name, uint16_t request_type, - struct getdns_dict *extensions, + getdns_dict *extensions, void *userarg, getdns_transaction_t *transaction_id, getdns_callback_t callback @@ -22,9 +22,9 @@ UNUSED_PARAM(transaction_id); UNUSED_PARAM(callback); return GETDNS_RETURN_GOOD; getdns_return_t getdns_address( - struct getdns_context *context, + getdns_context *context, const char *name, - struct getdns_dict *extensions, + getdns_dict *extensions, void *userarg, getdns_transaction_t *transaction_id, getdns_callback_t callback @@ -34,9 +34,9 @@ UNUSED_PARAM(transaction_id); UNUSED_PARAM(callback); return GETDNS_RETURN_GOOD; getdns_return_t getdns_hostname( - struct getdns_context *context, - struct getdns_dict *address, - struct getdns_dict *extensions, + getdns_context *context, + getdns_dict *address, + getdns_dict *extensions, void *userarg, getdns_transaction_t *transaction_id, getdns_callback_t callback @@ -46,9 +46,9 @@ UNUSED_PARAM(transaction_id); UNUSED_PARAM(callback); return GETDNS_RETURN_GOOD; getdns_return_t getdns_service( - struct getdns_context *context, + getdns_context *context, const char *name, - struct getdns_dict *extensions, + getdns_dict *extensions, void *userarg, getdns_transaction_t *transaction_id, getdns_callback_t callback @@ -58,14 +58,14 @@ UNUSED_PARAM(transaction_id); UNUSED_PARAM(callback); return GETDNS_RETURN_GOOD; getdns_return_t getdns_context_create( - struct getdns_context **context, + getdns_context **context, int set_from_os ) { UNUSED_PARAM(context); UNUSED_PARAM(set_from_os); return GETDNS_RETURN_GOOD; } getdns_return_t getdns_context_create_with_memory_functions( - struct getdns_context **context, + getdns_context **context, int set_from_os, void *(*malloc)(size_t), void *(*realloc)(void *, size_t), @@ -77,7 +77,7 @@ getdns_context_create_with_memory_functions( getdns_return_t getdns_context_create_with_extended_memory_functions( - struct getdns_context **context, + getdns_context **context, int set_from_os, void *userarg, void *(*malloc)(void *userarg, size_t), @@ -90,109 +90,109 @@ getdns_context_create_with_extended_memory_functions( void getdns_context_destroy( - struct getdns_context *context + getdns_context *context ) { UNUSED_PARAM(context); } getdns_return_t getdns_cancel_callback( - struct getdns_context *context, + getdns_context *context, getdns_transaction_t transaction_id ) { UNUSED_PARAM(context); UNUSED_PARAM(transaction_id); return GETDNS_RETURN_GOOD; } getdns_return_t getdns_general_sync( - struct getdns_context *context, + getdns_context *context, const char *name, uint16_t request_type, - struct getdns_dict *extensions, - struct getdns_dict **response + getdns_dict *extensions, + getdns_dict **response ) { UNUSED_PARAM(context); UNUSED_PARAM(name); UNUSED_PARAM(request_type); UNUSED_PARAM(extensions); UNUSED_PARAM(response); return GETDNS_RETURN_GOOD; } getdns_return_t getdns_address_sync( - struct getdns_context *context, + getdns_context *context, const char *name, - struct getdns_dict *extensions, - struct getdns_dict **response + getdns_dict *extensions, + getdns_dict **response ) { UNUSED_PARAM(context); UNUSED_PARAM(name); UNUSED_PARAM(extensions); UNUSED_PARAM(response); return GETDNS_RETURN_GOOD; } getdns_return_t getdns_hostname_sync( - struct getdns_context *context, - struct getdns_dict *address, - struct getdns_dict *extensions, - struct getdns_dict **response + getdns_context *context, + getdns_dict *address, + getdns_dict *extensions, + getdns_dict **response ) { UNUSED_PARAM(context); UNUSED_PARAM(address); UNUSED_PARAM(extensions); UNUSED_PARAM(response); return GETDNS_RETURN_GOOD; } getdns_return_t getdns_service_sync( - struct getdns_context *context, + getdns_context *context, const char *name, - struct getdns_dict *extensions, - struct getdns_dict **response + getdns_dict *extensions, + getdns_dict **response ) { UNUSED_PARAM(context); UNUSED_PARAM(name); UNUSED_PARAM(extensions); UNUSED_PARAM(response); return GETDNS_RETURN_GOOD; } void getdns_free_sync_request_memory( - struct getdns_dict *response + getdns_dict *response ) { UNUSED_PARAM(response); } -getdns_return_t getdns_list_get_length(const struct getdns_list *this_list, size_t *answer) +getdns_return_t getdns_list_get_length(const getdns_list *this_list, size_t *answer) { UNUSED_PARAM(this_list); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; } -getdns_return_t getdns_list_get_data_type(const struct getdns_list *this_list, size_t index, getdns_data_type *answer) +getdns_return_t getdns_list_get_data_type(const getdns_list *this_list, size_t index, getdns_data_type *answer) { UNUSED_PARAM(this_list); UNUSED_PARAM(index); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; } -getdns_return_t getdns_list_get_dict(const struct getdns_list *this_list, size_t index, struct getdns_dict **answer) +getdns_return_t getdns_list_get_dict(const getdns_list *this_list, size_t index, getdns_dict **answer) { UNUSED_PARAM(this_list); UNUSED_PARAM(index); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; } -getdns_return_t getdns_list_get_list(const struct getdns_list *this_list, size_t index, struct getdns_list **answer) +getdns_return_t getdns_list_get_list(const getdns_list *this_list, size_t index, getdns_list **answer) { UNUSED_PARAM(this_list); UNUSED_PARAM(index); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; } -getdns_return_t getdns_list_get_bindata(const struct getdns_list *this_list, size_t index, struct getdns_bindata **answer) +getdns_return_t getdns_list_get_bindata(const getdns_list *this_list, size_t index, getdns_bindata **answer) { UNUSED_PARAM(this_list); UNUSED_PARAM(index); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; } -getdns_return_t getdns_list_get_int(const struct getdns_list *this_list, size_t index, uint32_t *answer) +getdns_return_t getdns_list_get_int(const getdns_list *this_list, size_t index, uint32_t *answer) { UNUSED_PARAM(this_list); UNUSED_PARAM(index); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; } -getdns_return_t getdns_dict_get_names(const struct getdns_dict *this_dict, struct getdns_list **answer) +getdns_return_t getdns_dict_get_names(const getdns_dict *this_dict, getdns_list **answer) { UNUSED_PARAM(this_dict); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; } -getdns_return_t getdns_dict_get_data_type(const struct getdns_dict *this_dict, const char *name, getdns_data_type *answer) +getdns_return_t getdns_dict_get_data_type(const getdns_dict *this_dict, const char *name, getdns_data_type *answer) { UNUSED_PARAM(this_dict); UNUSED_PARAM(name); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; } -getdns_return_t getdns_dict_get_dict(const struct getdns_dict *this_dict, const char *name, struct getdns_dict **answer) +getdns_return_t getdns_dict_get_dict(const getdns_dict *this_dict, const char *name, getdns_dict **answer) { UNUSED_PARAM(this_dict); UNUSED_PARAM(name); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; } -getdns_return_t getdns_dict_get_list(const struct getdns_dict *this_dict, const char *name, struct getdns_list **answer) +getdns_return_t getdns_dict_get_list(const getdns_dict *this_dict, const char *name, getdns_list **answer) { UNUSED_PARAM(this_dict); UNUSED_PARAM(name); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; } -getdns_return_t getdns_dict_get_bindata(const struct getdns_dict *this_dict, const char *name, struct getdns_bindata **answer) +getdns_return_t getdns_dict_get_bindata(const getdns_dict *this_dict, const char *name, getdns_bindata **answer) { UNUSED_PARAM(this_dict); UNUSED_PARAM(name); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; } -getdns_return_t getdns_dict_get_int(const struct getdns_dict *this_dict, const char *name, uint32_t *answer) +getdns_return_t getdns_dict_get_int(const getdns_dict *this_dict, const char *name, uint32_t *answer) { UNUSED_PARAM(this_dict); UNUSED_PARAM(name); UNUSED_PARAM(answer); return GETDNS_RETURN_GOOD; } -struct getdns_list * getdns_list_create() +getdns_list * getdns_list_create() { return NULL; } -struct getdns_list * getdns_list_create_with_context( - struct getdns_context *context +getdns_list * getdns_list_create_with_context( + getdns_context *context ) { UNUSED_PARAM(context); return NULL; } -struct getdns_list * getdns_list_create_with_memory_functions( +getdns_list * getdns_list_create_with_memory_functions( void *(*malloc)(size_t), void *(*realloc)(void *, size_t), void (*free)(void *) @@ -200,7 +200,7 @@ struct getdns_list * getdns_list_create_with_memory_functions( { UNUSED_PARAM(malloc); UNUSED_PARAM(realloc); UNUSED_PARAM(free); return NULL; } -struct getdns_list * getdns_list_create_with_extended_memory_functions( +getdns_list * getdns_list_create_with_extended_memory_functions( void *userarg, void *(*malloc)(void *userarg, size_t), void *(*realloc)(void *userarg, void *, size_t), @@ -210,30 +210,30 @@ struct getdns_list * getdns_list_create_with_extended_memory_functions( UNUSED_PARAM(malloc); UNUSED_PARAM(realloc); UNUSED_PARAM(free); return NULL; } -void getdns_list_destroy(struct getdns_list *this_list) +void getdns_list_destroy(getdns_list *this_list) { UNUSED_PARAM(this_list); } -getdns_return_t getdns_list_set_dict(struct getdns_list *this_list, size_t index, const struct getdns_dict *child_dict) +getdns_return_t getdns_list_set_dict(getdns_list *this_list, size_t index, const getdns_dict *child_dict) { UNUSED_PARAM(this_list); UNUSED_PARAM(index); UNUSED_PARAM(child_dict); return GETDNS_RETURN_GOOD; } -getdns_return_t getdns_list_set_list(struct getdns_list *this_list, size_t index, const struct getdns_list *child_list) +getdns_return_t getdns_list_set_list(getdns_list *this_list, size_t index, const getdns_list *child_list) { UNUSED_PARAM(this_list); UNUSED_PARAM(index); UNUSED_PARAM(child_list); return GETDNS_RETURN_GOOD; } -getdns_return_t getdns_list_set_bindata(struct getdns_list *this_list, size_t index, const struct getdns_bindata *child_bindata) +getdns_return_t getdns_list_set_bindata(getdns_list *this_list, size_t index, const getdns_bindata *child_bindata) { UNUSED_PARAM(this_list); UNUSED_PARAM(index); UNUSED_PARAM(child_bindata); return GETDNS_RETURN_GOOD; } -getdns_return_t getdns_list_set_int(struct getdns_list *this_list, size_t index, uint32_t child_uint32) +getdns_return_t getdns_list_set_int(getdns_list *this_list, size_t index, uint32_t child_uint32) { UNUSED_PARAM(this_list); UNUSED_PARAM(index); UNUSED_PARAM(child_uint32); return GETDNS_RETURN_GOOD; } -struct getdns_dict * getdns_dict_create() +getdns_dict * getdns_dict_create() { return NULL; } -struct getdns_dict * getdns_dict_create_with_context( - struct getdns_context *context +getdns_dict * getdns_dict_create_with_context( + getdns_context *context ) { UNUSED_PARAM(context); return NULL; } -struct getdns_dict * getdns_dict_create_with_memory_functions( +getdns_dict * getdns_dict_create_with_memory_functions( void *(*malloc)(size_t), void *(*realloc)(void *, size_t), void (*free)(void *) @@ -241,7 +241,7 @@ struct getdns_dict * getdns_dict_create_with_memory_functions( { UNUSED_PARAM(malloc); UNUSED_PARAM(realloc); UNUSED_PARAM(free); return NULL; } -struct getdns_dict * getdns_dict_create_with_extended_memory_functions( +getdns_dict * getdns_dict_create_with_extended_memory_functions( void *userarg, void *(*malloc)(void *userarg, size_t), void *(*realloc)(void *userarg, void *, size_t), @@ -251,27 +251,27 @@ struct getdns_dict * getdns_dict_create_with_extended_memory_functions( UNUSED_PARAM(malloc); UNUSED_PARAM(realloc); UNUSED_PARAM(free); return NULL; } -void getdns_dict_destroy(struct getdns_dict *this_dict) +void getdns_dict_destroy(getdns_dict *this_dict) { UNUSED_PARAM(this_dict); } -getdns_return_t getdns_dict_set_dict(struct getdns_dict *this_dict, const char *name, const struct getdns_dict *child_dict) +getdns_return_t getdns_dict_set_dict(getdns_dict *this_dict, const char *name, const getdns_dict *child_dict) { UNUSED_PARAM(this_dict); UNUSED_PARAM(name); UNUSED_PARAM(child_dict); return GETDNS_RETURN_GOOD; } -getdns_return_t getdns_dict_set_list(struct getdns_dict *this_dict, const char *name, const struct getdns_list *child_list) +getdns_return_t getdns_dict_set_list(getdns_dict *this_dict, const char *name, const getdns_list *child_list) { UNUSED_PARAM(this_dict); UNUSED_PARAM(name); UNUSED_PARAM(child_list); return GETDNS_RETURN_GOOD; } -getdns_return_t getdns_dict_set_bindata(struct getdns_dict *this_dict, const char *name, const struct getdns_bindata *child_bindata) +getdns_return_t getdns_dict_set_bindata(getdns_dict *this_dict, const char *name, const getdns_bindata *child_bindata) { UNUSED_PARAM(this_dict); UNUSED_PARAM(name); UNUSED_PARAM(child_bindata); return GETDNS_RETURN_GOOD; } -getdns_return_t getdns_dict_set_int(struct getdns_dict *this_dict, const char *name, uint32_t child_uint32) +getdns_return_t getdns_dict_set_int(getdns_dict *this_dict, const char *name, uint32_t child_uint32) { UNUSED_PARAM(this_dict); UNUSED_PARAM(name); UNUSED_PARAM(child_uint32); return GETDNS_RETURN_GOOD; } -getdns_return_t getdns_dict_remove_name(struct getdns_dict *this_dict, const char *name) +getdns_return_t getdns_dict_remove_name(getdns_dict *this_dict, const char *name) { UNUSED_PARAM(this_dict); UNUSED_PARAM(name); return GETDNS_RETURN_GOOD; } getdns_return_t getdns_convert_dns_name_to_fqdn( - const struct getdns_bindata *dns_name_wire_fmt, + const getdns_bindata *dns_name_wire_fmt, char **fqdn_as_string ) { UNUSED_PARAM(dns_name_wire_fmt); UNUSED_PARAM(fqdn_as_string); return GETDNS_RETURN_GOOD; } @@ -279,7 +279,7 @@ getdns_convert_dns_name_to_fqdn( getdns_return_t getdns_convert_fqdn_to_dns_name( const char *fqdn_as_string, - struct getdns_bindata **dns_name_wire_fmt + getdns_bindata **dns_name_wire_fmt ) { UNUSED_PARAM(fqdn_as_string); UNUSED_PARAM(dns_name_wire_fmt); return GETDNS_RETURN_GOOD; } @@ -297,9 +297,9 @@ getdns_convert_alabel_to_ulabel( getdns_return_t getdns_validate_dnssec( - struct getdns_list *record_to_validate, - struct getdns_list *bundle_of_support_records, - struct getdns_list *trust_anchor_rdatas + getdns_list *record_to_validate, + getdns_list *bundle_of_support_records, + getdns_list *trust_anchor_rdatas ) { UNUSED_PARAM(record_to_validate); UNUSED_PARAM(bundle_of_support_records); UNUSED_PARAM(trust_anchor_rdatas); return GETDNS_RETURN_GOOD; } @@ -307,33 +307,33 @@ return GETDNS_RETURN_GOOD; } char * getdns_pretty_print_dict( - const struct getdns_dict *some_dict + const getdns_dict *some_dict ) { UNUSED_PARAM(some_dict); return NULL; } char * getdns_display_ip_address( - const struct getdns_bindata *bindata_of_ipv4_or_ipv6_address + const getdns_bindata *bindata_of_ipv4_or_ipv6_address ) { UNUSED_PARAM(bindata_of_ipv4_or_ipv6_address); return NULL; } getdns_return_t getdns_context_set_context_update_callback( - struct getdns_context *context, - void (*value)(struct getdns_context *context, getdns_context_code_t changed_item) + getdns_context *context, + void (*value)(getdns_context *context, getdns_context_code_t changed_item) ) { UNUSED_PARAM(context); UNUSED_PARAM(value); return GETDNS_RETURN_GOOD; } getdns_return_t getdns_context_set_resolution_type( - struct getdns_context *context, + getdns_context *context, getdns_resolution_t value ) { UNUSED_PARAM(context); UNUSED_PARAM(value); return GETDNS_RETURN_GOOD; } getdns_return_t getdns_context_set_namespaces( - struct getdns_context *context, + getdns_context *context, size_t namespace_count, getdns_namespace_t *namespaces ) @@ -342,105 +342,105 @@ return GETDNS_RETURN_GOOD; } getdns_return_t getdns_context_set_dns_transport( - struct getdns_context *context, + getdns_context *context, getdns_transport_t value ) { UNUSED_PARAM(context); UNUSED_PARAM(value); return GETDNS_RETURN_GOOD; } getdns_return_t getdns_context_set_limit_outstanding_queries( - struct getdns_context *context, + getdns_context *context, uint16_t limit ) { UNUSED_PARAM(context); UNUSED_PARAM(limit); return GETDNS_RETURN_GOOD; } getdns_return_t getdns_context_set_timeout( - struct getdns_context *context, + getdns_context *context, uint64_t timeout ) { UNUSED_PARAM(context); UNUSED_PARAM(timeout); return GETDNS_RETURN_GOOD; } getdns_return_t getdns_context_set_follow_redirects( - struct getdns_context *context, + getdns_context *context, getdns_redirects_t value ) { UNUSED_PARAM(context); UNUSED_PARAM(value); return GETDNS_RETURN_GOOD; } getdns_return_t getdns_context_set_dns_root_servers( - struct getdns_context *context, - struct getdns_list *addresses + getdns_context *context, + getdns_list *addresses ) { UNUSED_PARAM(context); UNUSED_PARAM(addresses); return GETDNS_RETURN_GOOD; } getdns_return_t getdns_context_set_append_name( - struct getdns_context *context, + getdns_context *context, getdns_append_name_t value ) { UNUSED_PARAM(context); UNUSED_PARAM(value); return GETDNS_RETURN_GOOD; } getdns_return_t getdns_context_set_suffix( - struct getdns_context *context, - struct getdns_list *value + getdns_context *context, + getdns_list *value ) { UNUSED_PARAM(context); UNUSED_PARAM(value); return GETDNS_RETURN_GOOD; } getdns_return_t getdns_context_set_dnssec_trust_anchors( - struct getdns_context *context, - struct getdns_list *value + getdns_context *context, + getdns_list *value ) { UNUSED_PARAM(context); UNUSED_PARAM(value); return GETDNS_RETURN_GOOD; } getdns_return_t getdns_context_set_dnssec_allowed_skew( - struct getdns_context *context, + getdns_context *context, unsigned int value ) { UNUSED_PARAM(context); UNUSED_PARAM(value); return GETDNS_RETURN_GOOD; } getdns_return_t getdns_context_set_upstream_recursive_servers( - struct getdns_context *context, - struct getdns_list *upstream_list + getdns_context *context, + getdns_list *upstream_list ) { UNUSED_PARAM(context); UNUSED_PARAM(upstream_list); return GETDNS_RETURN_GOOD; } getdns_return_t getdns_context_set_edns_maximum_udp_payload_size( - struct getdns_context *context, + getdns_context *context, uint16_t value ) { UNUSED_PARAM(context); UNUSED_PARAM(value); return GETDNS_RETURN_GOOD; } getdns_return_t getdns_context_set_edns_extended_rcode( - struct getdns_context *context, + getdns_context *context, uint8_t value ) { UNUSED_PARAM(context); UNUSED_PARAM(value); return GETDNS_RETURN_GOOD; } getdns_return_t getdns_context_set_edns_version( - struct getdns_context *context, + getdns_context *context, uint8_t value ) { UNUSED_PARAM(context); UNUSED_PARAM(value); return GETDNS_RETURN_GOOD; } getdns_return_t getdns_context_set_edns_do_bit( - struct getdns_context *context, + getdns_context *context, uint8_t value ) { UNUSED_PARAM(context); UNUSED_PARAM(value); return GETDNS_RETURN_GOOD; } getdns_return_t getdns_context_set_memory_functions( - struct getdns_context *context, + getdns_context *context, void *(*malloc) (size_t), void *(*realloc) (void *, size_t), void (*free) (void *) @@ -451,7 +451,7 @@ getdns_context_set_memory_functions( getdns_return_t getdns_context_set_extended_memory_functions( - struct getdns_context *context, + getdns_context *context, void *userarg, void *(*malloc)(void *userarg, size_t sz), void *(*realloc)(void *userarg, void *ptr, size_t sz), @@ -464,7 +464,7 @@ getdns_context_set_extended_memory_functions( getdns_return_t getdns_extension_set_libevent_base( - struct getdns_context *context, + getdns_context *context, struct event_base *this_event_base ) { UNUSED_PARAM(context); UNUSED_PARAM(this_event_base); return GETDNS_RETURN_GOOD; } diff --git a/spec/getdns_core_only.h b/spec/getdns_core_only.h index 389dd753..9bcab902 100644 --- a/spec/getdns_core_only.h +++ b/spec/getdns_core_only.h @@ -1,4 +1,4 @@ -/* Created at 2014-02-19-10-58-16*/ +/* Created at 2014-02-19-15-06-22*/ #ifndef GETDNS_H #define GETDNS_H @@ -314,89 +314,89 @@ typedef enum getdns_callback_type_t { #define GETDNS_RCODE_BADTRUNC 22 /* Various typedefs */ -struct getdns_context; +typedef struct getdns_context getdns_context; typedef uint64_t getdns_transaction_t; typedef enum getdns_data_type { t_dict, t_list, t_int, t_bindata } getdns_data_type; -struct getdns_bindata { +typedef struct getdns_bindata { size_t size; uint8_t *data; -}; -struct getdns_dict; -struct getdns_list; +} getdns_bindata; +typedef struct getdns_dict getdns_dict; +typedef struct getdns_list getdns_list; /* Helper functions for data structures */ /* Lists: get the length, get the data_type of the value at a given position, and get the data at a given position */ -getdns_return_t getdns_list_get_length(const struct getdns_list *this_list, size_t *answer); -getdns_return_t getdns_list_get_data_type(const struct getdns_list *this_list, size_t index, getdns_data_type *answer); -getdns_return_t getdns_list_get_dict(const struct getdns_list *this_list, size_t index, struct getdns_dict **answer); -getdns_return_t getdns_list_get_list(const struct getdns_list *this_list, size_t index, struct getdns_list **answer); -getdns_return_t getdns_list_get_bindata(const struct getdns_list *this_list, size_t index, struct getdns_bindata **answer); -getdns_return_t getdns_list_get_int(const struct getdns_list *this_list, size_t index, uint32_t *answer); +getdns_return_t getdns_list_get_length(const getdns_list *this_list, size_t *answer); +getdns_return_t getdns_list_get_data_type(const getdns_list *this_list, size_t index, getdns_data_type *answer); +getdns_return_t getdns_list_get_dict(const getdns_list *this_list, size_t index, getdns_dict **answer); +getdns_return_t getdns_list_get_list(const getdns_list *this_list, size_t index, getdns_list **answer); +getdns_return_t getdns_list_get_bindata(const getdns_list *this_list, size_t index, getdns_bindata **answer); +getdns_return_t getdns_list_get_int(const getdns_list *this_list, size_t index, uint32_t *answer); /* Dicts: get the list of names, get the data_type of the value at a given name, and get the data at a given name */ -getdns_return_t getdns_dict_get_names(const struct getdns_dict *this_dict, struct getdns_list **answer); -getdns_return_t getdns_dict_get_data_type(const struct getdns_dict *this_dict, const char *name, getdns_data_type *answer); -getdns_return_t getdns_dict_get_dict(const struct getdns_dict *this_dict, const char *name, struct getdns_dict **answer); -getdns_return_t getdns_dict_get_list(const struct getdns_dict *this_dict, const char *name, struct getdns_list **answer); -getdns_return_t getdns_dict_get_bindata(const struct getdns_dict *this_dict, const char *name, struct getdns_bindata **answer); -getdns_return_t getdns_dict_get_int(const struct getdns_dict *this_dict, const char *name, uint32_t *answer); +getdns_return_t getdns_dict_get_names(const getdns_dict *this_dict, getdns_list **answer); +getdns_return_t getdns_dict_get_data_type(const getdns_dict *this_dict, const char *name, getdns_data_type *answer); +getdns_return_t getdns_dict_get_dict(const getdns_dict *this_dict, const char *name, getdns_dict **answer); +getdns_return_t getdns_dict_get_list(const getdns_dict *this_dict, const char *name, getdns_list **answer); +getdns_return_t getdns_dict_get_bindata(const getdns_dict *this_dict, const char *name, getdns_bindata **answer); +getdns_return_t getdns_dict_get_int(const getdns_dict *this_dict, const char *name, uint32_t *answer); /* Lists: create, destroy, and set the data at a given position */ -struct getdns_list * getdns_list_create(); -struct getdns_list * getdns_list_create_with_context( - struct getdns_context *context +getdns_list * getdns_list_create(); +getdns_list * getdns_list_create_with_context( + getdns_context *context ); -struct getdns_list * getdns_list_create_with_memory_functions( +getdns_list * getdns_list_create_with_memory_functions( void *(*malloc)(size_t), void *(*realloc)(void *, size_t), void (*free)(void *) ); -struct getdns_list * getdns_list_create_with_extended_memory_functions( +getdns_list * getdns_list_create_with_extended_memory_functions( void *userarg, void *(*malloc)(void *userarg, size_t), void *(*realloc)(void *userarg, void *, size_t), void (*free)(void *userarg, void *) ); -void getdns_list_destroy(struct getdns_list *this_list); -getdns_return_t getdns_list_set_dict(struct getdns_list *this_list, size_t index, const struct getdns_dict *child_dict); -getdns_return_t getdns_list_set_list(struct getdns_list *this_list, size_t index, const struct getdns_list *child_list); -getdns_return_t getdns_list_set_bindata(struct getdns_list *this_list, size_t index, const struct getdns_bindata *child_bindata); -getdns_return_t getdns_list_set_int(struct getdns_list *this_list, size_t index, uint32_t child_uint32); +void getdns_list_destroy(getdns_list *this_list); +getdns_return_t getdns_list_set_dict(getdns_list *this_list, size_t index, const getdns_dict *child_dict); +getdns_return_t getdns_list_set_list(getdns_list *this_list, size_t index, const getdns_list *child_list); +getdns_return_t getdns_list_set_bindata(getdns_list *this_list, size_t index, const getdns_bindata *child_bindata); +getdns_return_t getdns_list_set_int(getdns_list *this_list, size_t index, uint32_t child_uint32); /* Dicts: create, destroy, and set the data at a given name */ -struct getdns_dict * getdns_dict_create(); -struct getdns_dict * getdns_dict_create_with_context( - struct getdns_context *context +getdns_dict * getdns_dict_create(); +getdns_dict * getdns_dict_create_with_context( + getdns_context *context ); -struct getdns_dict * getdns_dict_create_with_memory_functions( +getdns_dict * getdns_dict_create_with_memory_functions( void *(*malloc)(size_t), void *(*realloc)(void *, size_t), void (*free)(void *) ); -struct getdns_dict * getdns_dict_create_with_extended_memory_functions( +getdns_dict * getdns_dict_create_with_extended_memory_functions( void *userarg, void *(*malloc)(void *userarg, size_t), void *(*realloc)(void *userarg, void *, size_t), void (*free)(void *userarg, void *) ); -void getdns_dict_destroy(struct getdns_dict *this_dict); -getdns_return_t getdns_dict_set_dict(struct getdns_dict *this_dict, const char *name, const struct getdns_dict *child_dict); -getdns_return_t getdns_dict_set_list(struct getdns_dict *this_dict, const char *name, const struct getdns_list *child_list); -getdns_return_t getdns_dict_set_bindata(struct getdns_dict *this_dict, const char *name, const struct getdns_bindata *child_bindata); -getdns_return_t getdns_dict_set_int(struct getdns_dict *this_dict, const char *name, uint32_t child_uint32); -getdns_return_t getdns_dict_remove_name(struct getdns_dict *this_dict, const char *name); +void getdns_dict_destroy(getdns_dict *this_dict); +getdns_return_t getdns_dict_set_dict(getdns_dict *this_dict, const char *name, const getdns_dict *child_dict); +getdns_return_t getdns_dict_set_list(getdns_dict *this_dict, const char *name, const getdns_list *child_list); +getdns_return_t getdns_dict_set_bindata(getdns_dict *this_dict, const char *name, const getdns_bindata *child_bindata); +getdns_return_t getdns_dict_set_int(getdns_dict *this_dict, const char *name, uint32_t child_uint32); +getdns_return_t getdns_dict_remove_name(getdns_dict *this_dict, const char *name); /* Callback arguments */ typedef void (*getdns_callback_t)( - struct getdns_context *context, + getdns_context *context, getdns_callback_type_t callback_type, - struct getdns_dict *response, + getdns_dict *response, void *userarg, getdns_transaction_t transaction_id); @@ -404,120 +404,120 @@ typedef void (*getdns_callback_t)( getdns_return_t getdns_general( - struct getdns_context *context, - const char *name, - uint16_t request_type, - struct getdns_dict *extensions, - void *userarg, - getdns_transaction_t *transaction_id, - getdns_callback_t callbackfn + getdns_context *context, + const char *name, + uint16_t request_type, + getdns_dict *extensions, + void *userarg, + getdns_transaction_t *transaction_id, + getdns_callback_t callbackfn ); getdns_return_t getdns_address( - struct getdns_context *context, - const char *name, - struct getdns_dict *extensions, - void *userarg, - getdns_transaction_t *transaction_id, - getdns_callback_t callbackfn + getdns_context *context, + const char *name, + getdns_dict *extensions, + void *userarg, + getdns_transaction_t *transaction_id, + getdns_callback_t callbackfn ); getdns_return_t getdns_hostname( - struct getdns_context *context, - struct getdns_dict *address, - struct getdns_dict *extensions, - void *userarg, - getdns_transaction_t *transaction_id, - getdns_callback_t callbackfn + getdns_context *context, + getdns_dict *address, + getdns_dict *extensions, + void *userarg, + getdns_transaction_t *transaction_id, + getdns_callback_t callbackfn ); getdns_return_t getdns_service( - struct getdns_context *context, - const char *name, - struct getdns_dict *extensions, - void *userarg, - getdns_transaction_t *transaction_id, - getdns_callback_t callbackfn + getdns_context *context, + const char *name, + getdns_dict *extensions, + void *userarg, + getdns_transaction_t *transaction_id, + getdns_callback_t callbackfn ); getdns_return_t getdns_context_create( - struct getdns_context **context, - int set_from_os + getdns_context **context, + int set_from_os ); getdns_return_t getdns_context_create_with_memory_functions( - struct getdns_context **context, - int set_from_os, - void *(*malloc)(size_t), - void *(*realloc)(void *, size_t), - void (*free)(void *) + getdns_context **context, + int set_from_os, + void *(*malloc)(size_t), + void *(*realloc)(void *, size_t), + void (*free)(void *) ); getdns_return_t getdns_context_create_with_extended_memory_functions( - struct getdns_context **context, - int set_from_os, - void *userarg, - void *(*malloc)(void *userarg, size_t), - void *(*realloc)(void *userarg, void *, size_t), - void (*free)(void *userarg, void *) + getdns_context **context, + int set_from_os, + void *userarg, + void *(*malloc)(void *userarg, size_t), + void *(*realloc)(void *userarg, void *, size_t), + void (*free)(void *userarg, void *) ); void getdns_context_destroy( - struct getdns_context *context + getdns_context *context ); getdns_return_t getdns_cancel_callback( - struct getdns_context *context, - getdns_transaction_t transaction_id + getdns_context *context, + getdns_transaction_t transaction_id ); getdns_return_t getdns_general_sync( - struct getdns_context *context, - const char *name, - uint16_t request_type, - struct getdns_dict *extensions, - struct getdns_dict **response + getdns_context *context, + const char *name, + uint16_t request_type, + getdns_dict *extensions, + getdns_dict **response ); getdns_return_t getdns_address_sync( - struct getdns_context *context, - const char *name, - struct getdns_dict *extensions, - struct getdns_dict **response + getdns_context *context, + const char *name, + getdns_dict *extensions, + getdns_dict **response ); getdns_return_t getdns_hostname_sync( - struct getdns_context *context, - struct getdns_dict *address, - struct getdns_dict *extensions, - struct getdns_dict **response + getdns_context *context, + getdns_dict *address, + getdns_dict *extensions, + getdns_dict **response ); getdns_return_t getdns_service_sync( - struct getdns_context *context, - const char *name, - struct getdns_dict *extensions, - struct getdns_dict **response + getdns_context *context, + const char *name, + getdns_dict *extensions, + getdns_dict **response ); getdns_return_t getdns_convert_dns_name_to_fqdn( - const struct getdns_bindata *dns_name_wire_fmt, + const getdns_bindata *dns_name_wire_fmt, char **fqdn_as_string ); getdns_return_t getdns_convert_fqdn_to_dns_name( const char *fqdn_as_string, - struct getdns_bindata **dns_name_wire_fmt + getdns_bindata **dns_name_wire_fmt ); char * @@ -532,139 +532,139 @@ getdns_convert_alabel_to_ulabel( getdns_return_t getdns_validate_dnssec( - struct getdns_list *record_to_validate, - struct getdns_list *bundle_of_support_records, - struct getdns_list *trust_anchor_rdatas + getdns_list *record_to_validate, + getdns_list *bundle_of_support_records, + getdns_list *trust_anchor_records ); char * getdns_pretty_print_dict( - const struct getdns_dict *some_dict + const getdns_dict *some_dict ); char * getdns_display_ip_address( - const struct getdns_bindata *bindata_of_ipv4_or_ipv6_address + const getdns_bindata *bindata_of_ipv4_or_ipv6_address ); getdns_return_t getdns_context_set_context_update_callback( - struct getdns_context *context, - void (*value)(struct getdns_context *context, getdns_context_code_t changed_item) + getdns_context *context, + void (*value)(getdns_context *context, getdns_context_code_t changed_item) ); getdns_return_t getdns_context_set_resolution_type( - struct getdns_context *context, - getdns_resolution_t value + getdns_context *context, + getdns_resolution_t value ); getdns_return_t getdns_context_set_namespaces( - struct getdns_context *context, - size_t namespace_count, - getdns_namespace_t *namespaces + getdns_context *context, + size_t namespace_count, + getdns_namespace_t *namespaces ); getdns_return_t getdns_context_set_dns_transport( - struct getdns_context *context, - getdns_transport_t value + getdns_context *context, + getdns_transport_t value ); getdns_return_t getdns_context_set_limit_outstanding_queries( - struct getdns_context *context, - uint16_t limit + getdns_context *context, + uint16_t limit ); getdns_return_t getdns_context_set_timeout( - struct getdns_context *context, - uint64_t timeout + getdns_context *context, + uint64_t timeout ); getdns_return_t getdns_context_set_follow_redirects( - struct getdns_context *context, - getdns_redirects_t value + getdns_context *context, + getdns_redirects_t value ); getdns_return_t getdns_context_set_dns_root_servers( - struct getdns_context *context, - struct getdns_list *addresses + getdns_context *context, + getdns_list *addresses ); getdns_return_t getdns_context_set_append_name( - struct getdns_context *context, - getdns_append_name_t value + getdns_context *context, + getdns_append_name_t value ); getdns_return_t getdns_context_set_suffix( - struct getdns_context *context, - struct getdns_list *value + getdns_context *context, + getdns_list *value ); getdns_return_t getdns_context_set_dnssec_trust_anchors( - struct getdns_context *context, - struct getdns_list *value + getdns_context *context, + getdns_list *value ); getdns_return_t getdns_context_set_dnssec_allowed_skew( - struct getdns_context *context, - uint32_t value + getdns_context *context, + uint32_t value ); getdns_return_t getdns_context_set_upstream_recursive_servers( - struct getdns_context *context, - struct getdns_list *upstream_list + getdns_context *context, + getdns_list *upstream_list ); getdns_return_t getdns_context_set_edns_maximum_udp_payload_size( - struct getdns_context *context, - uint16_t value + getdns_context *context, + uint16_t value ); getdns_return_t getdns_context_set_edns_extended_rcode( - struct getdns_context *context, - uint8_t value + getdns_context *context, + uint8_t value ); getdns_return_t getdns_context_set_edns_version( - struct getdns_context *context, - uint8_t value + getdns_context *context, + uint8_t value ); getdns_return_t getdns_context_set_edns_do_bit( - struct getdns_context *context, - uint8_t value + getdns_context *context, + uint8_t value ); getdns_return_t getdns_context_set_memory_functions( - struct getdns_context *context, - void *(*malloc) (size_t), - void *(*realloc) (void *, size_t), - void (*free) (void *) + getdns_context *context, + void *(*malloc) (size_t), + void *(*realloc) (void *, size_t), + void (*free) (void *) ); getdns_return_t getdns_context_set_extended_memory_functions( - struct getdns_context *context, - void *userarg, - void *(*malloc)(void *userarg, size_t sz), - void *(*realloc)(void *userarg, void *ptr, size_t sz), - void (*free)(void *userarg, void *ptr) + getdns_context *context, + void *userarg, + void *(*malloc)(void *userarg, size_t sz), + void *(*realloc)(void *userarg, void *ptr, size_t sz), + void (*free)(void *userarg, void *ptr) ); #ifdef __cplusplus diff --git a/spec/getdns_libevent.h b/spec/getdns_libevent.h index 1baa4395..70c3f9e1 100644 --- a/spec/getdns_libevent.h +++ b/spec/getdns_libevent.h @@ -4,6 +4,6 @@ /* For libevent, which we are using for these examples */ getdns_return_t getdns_extension_set_libevent_base( - struct getdns_context *context, - struct event_base *this_event_base + getdns_context *context, + struct event_base *this_event_base ); diff --git a/spec/index.html b/spec/index.html index 34e4327c..f03a6617 100644 --- a/spec/index.html +++ b/spec/index.html @@ -140,13 +140,13 @@ href="mailto:paul.hoffman@vpnc.org">paul.hoffman@vpnc.org.)

getdns_return_t getdns_general( - struct getdns_context *context, - const char *name, - uint16_t request_type, - struct getdns_dict *extensions, - void *userarg, - getdns_transaction_t *transaction_id, - getdns_callback_t callbackfn + getdns_context *context, + const char *name, + uint16_t request_type, + getdns_dict *extensions, + void *userarg, + getdns_transaction_t *transaction_id, + getdns_callback_t callbackfn );
@@ -208,12 +208,12 @@ href="#ReturnCodes">later in this document.

getdns_return_t getdns_address( - struct getdns_context *context, - const char *name, - struct getdns_dict *extensions, - void *userarg, - getdns_transaction_t *transaction_id, - getdns_callback_t callbackfn + getdns_context *context, + const char *name, + getdns_dict *extensions, + void *userarg, + getdns_transaction_t *transaction_id, + getdns_callback_t callbackfn );
@@ -236,12 +236,12 @@ getdns_address(
getdns_return_t getdns_hostname( - struct getdns_context *context, - struct getdns_dict *address, - struct getdns_dict *extensions, - void *userarg, - getdns_transaction_t *transaction_id, - getdns_callback_t callbackfn + getdns_context *context, + getdns_dict *address, + getdns_dict *extensions, + void *userarg, + getdns_transaction_t *transaction_id, + getdns_callback_t callbackfn );
@@ -253,12 +253,12 @@ or "IPv6" (which are case-sensitive)) and address_data (whose value
getdns_return_t getdns_service( - struct getdns_context *context, - const char *name, - struct getdns_dict *extensions, - void *userarg, - getdns_transaction_t *transaction_id, - getdns_callback_t callbackfn + getdns_context *context, + const char *name, + getdns_dict *extensions, + void *userarg, + getdns_transaction_t *transaction_id, + getdns_callback_t callbackfn );
@@ -277,9 +277,9 @@ returned an error, in which case the callback function is never called.

as follows:

typedef void (*getdns_callback_t)( - struct getdns_context *context, + getdns_context *context, getdns_callback_type_t callback_type, - struct getdns_dict *response, + getdns_dict *response, void *userarg, getdns_transaction_t transaction_id);
@@ -324,8 +324,8 @@ that affect how DNS calls are made. For most applications, a default context is
getdns_return_t getdns_context_create( - struct getdns_context **context, - int set_from_os + getdns_context **context, + int set_from_os );
@@ -335,20 +335,20 @@ want set_from_os set to 1.

getdns_return_t getdns_context_create_with_memory_functions( - struct getdns_context **context, - int set_from_os, - void *(*malloc)(size_t), - void *(*realloc)(void *, size_t), - void (*free)(void *) + getdns_context **context, + int set_from_os, + void *(*malloc)(size_t), + void *(*realloc)(void *, size_t), + void (*free)(void *) ); getdns_return_t getdns_context_create_with_extended_memory_functions( - struct getdns_context **context, - int set_from_os, - void *userarg, - void *(*malloc)(void *userarg, size_t), - void *(*realloc)(void *userarg, void *, size_t), - void (*free)(void *userarg, void *) + getdns_context **context, + int set_from_os, + void *userarg, + void *(*malloc)(void *userarg, size_t), + void *(*realloc)(void *userarg, void *, size_t), + void (*free)(void *userarg, void *) );
@@ -357,7 +357,7 @@ using this context, use the function:

void getdns_context_destroy( - struct getdns_context *context + getdns_context *context );
@@ -374,8 +374,8 @@ all of the needed cleanup is done and callbacks are made.

getdns_return_t getdns_cancel_callback( - struct getdns_context *context, - getdns_transaction_t transaction_id + getdns_context *context, + getdns_transaction_t transaction_id );
@@ -455,38 +455,38 @@ same as the response returned in the callback if you had used the async version
getdns_return_t getdns_general_sync( - struct getdns_context *context, - const char *name, - uint16_t request_type, - struct getdns_dict *extensions, - struct getdns_dict **response + getdns_context *context, + const char *name, + uint16_t request_type, + getdns_dict *extensions, + getdns_dict **response );
getdns_return_t getdns_address_sync( - struct getdns_context *context, - const char *name, - struct getdns_dict *extensions, - struct getdns_dict **response + getdns_context *context, + const char *name, + getdns_dict *extensions, + getdns_dict **response );
getdns_return_t getdns_hostname_sync( - struct getdns_context *context, - struct getdns_dict *address, - struct getdns_dict *extensions, - struct getdns_dict **response + getdns_context *context, + getdns_dict *address, + getdns_dict *extensions, + getdns_dict **response );
getdns_return_t getdns_service_sync( - struct getdns_context *context, - const char *name, - struct getdns_dict *extensions, - struct getdns_dict **response + getdns_context *context, + const char *name, + getdns_dict *extensions, + getdns_dict **response );
@@ -495,7 +495,7 @@ free the memory from its internal pool.

void
 getdns_dict_destroy(
-  struct getdns_dict     *response
+  getdns_dict  *response
 );
 
@@ -525,21 +525,21 @@ name-value pairs in a dict is not important.
/* Lists: get the length, get the data_type of the value at a given position, and get the data at a given position */ -getdns_return_t getdns_list_get_length(const struct getdns_list *this_list, size_t *answer); -getdns_return_t getdns_list_get_data_type(const struct getdns_list *this_list, size_t index, getdns_data_type *answer); -getdns_return_t getdns_list_get_dict(const struct getdns_list *this_list, size_t index, struct getdns_dict **answer); -getdns_return_t getdns_list_get_list(const struct getdns_list *this_list, size_t index, struct getdns_list **answer); -getdns_return_t getdns_list_get_bindata(const struct getdns_list *this_list, size_t index, struct getdns_bindata **answer); -getdns_return_t getdns_list_get_int(const struct getdns_list *this_list, size_t index, uint32_t *answer); +getdns_return_t getdns_list_get_length(const getdns_list *this_list, size_t *answer); +getdns_return_t getdns_list_get_data_type(const getdns_list *this_list, size_t index, getdns_data_type *answer); +getdns_return_t getdns_list_get_dict(const getdns_list *this_list, size_t index, getdns_dict **answer); +getdns_return_t getdns_list_get_list(const getdns_list *this_list, size_t index, getdns_list **answer); +getdns_return_t getdns_list_get_bindata(const getdns_list *this_list, size_t index, getdns_bindata **answer); +getdns_return_t getdns_list_get_int(const getdns_list *this_list, size_t index, uint32_t *answer); /* Dicts: get the list of names, get the data_type of the value at a given name, and get the data at a given name */ -getdns_return_t getdns_dict_get_names(const struct getdns_dict *this_dict, struct getdns_list **answer); -getdns_return_t getdns_dict_get_data_type(const struct getdns_dict *this_dict, const char *name, getdns_data_type *answer); -getdns_return_t getdns_dict_get_dict(const struct getdns_dict *this_dict, const char *name, struct getdns_dict **answer); -getdns_return_t getdns_dict_get_list(const struct getdns_dict *this_dict, const char *name, struct getdns_list **answer); -getdns_return_t getdns_dict_get_bindata(const struct getdns_dict *this_dict, const char *name, struct getdns_bindata **answer); -getdns_return_t getdns_dict_get_int(const struct getdns_dict *this_dict, const char *name, uint32_t *answer); +getdns_return_t getdns_dict_get_names(const getdns_dict *this_dict, getdns_list **answer); +getdns_return_t getdns_dict_get_data_type(const getdns_dict *this_dict, const char *name, getdns_data_type *answer); +getdns_return_t getdns_dict_get_dict(const getdns_dict *this_dict, const char *name, getdns_dict **answer); +getdns_return_t getdns_dict_get_list(const getdns_dict *this_dict, const char *name, getdns_list **answer); +getdns_return_t getdns_dict_get_bindata(const getdns_dict *this_dict, const char *name, getdns_bindata **answer); +getdns_return_t getdns_dict_get_int(const getdns_dict *this_dict, const char *name, uint32_t *answer);

All of these helper getter functions return GETDNS_RETURN_GOOD if the call is successful. @@ -566,49 +566,49 @@ you need to create a dict. The requisite functions are:

/* Lists: create, destroy, and set the data at a given position */ -struct getdns_list * getdns_list_create(); -struct getdns_list * getdns_list_create_with_context( - struct getdns_context *context +getdns_list * getdns_list_create(); +getdns_list * getdns_list_create_with_context( + getdns_context *context ); -struct getdns_list * getdns_list_create_with_memory_functions( +getdns_list * getdns_list_create_with_memory_functions( void *(*malloc)(size_t), void *(*realloc)(void *, size_t), void (*free)(void *) ); -struct getdns_list * getdns_list_create_with_extended_memory_functions( +getdns_list * getdns_list_create_with_extended_memory_functions( void *userarg, void *(*malloc)(void *userarg, size_t), void *(*realloc)(void *userarg, void *, size_t), void (*free)(void *userarg, void *) ); -void getdns_list_destroy(struct getdns_list *this_list); -getdns_return_t getdns_list_set_dict(struct getdns_list *this_list, size_t index, const struct getdns_dict *child_dict); -getdns_return_t getdns_list_set_list(struct getdns_list *this_list, size_t index, const struct getdns_list *child_list); -getdns_return_t getdns_list_set_bindata(struct getdns_list *this_list, size_t index, const struct getdns_bindata *child_bindata); -getdns_return_t getdns_list_set_int(struct getdns_list *this_list, size_t index, uint32_t child_uint32); +void getdns_list_destroy(getdns_list *this_list); +getdns_return_t getdns_list_set_dict(getdns_list *this_list, size_t index, const getdns_dict *child_dict); +getdns_return_t getdns_list_set_list(getdns_list *this_list, size_t index, const getdns_list *child_list); +getdns_return_t getdns_list_set_bindata(getdns_list *this_list, size_t index, const getdns_bindata *child_bindata); +getdns_return_t getdns_list_set_int(getdns_list *this_list, size_t index, uint32_t child_uint32); /* Dicts: create, destroy, and set the data at a given name */ -struct getdns_dict * getdns_dict_create(); -struct getdns_dict * getdns_dict_create_with_context( - struct getdns_context *context +getdns_dict * getdns_dict_create(); +getdns_dict * getdns_dict_create_with_context( + getdns_context *context ); -struct getdns_dict * getdns_dict_create_with_memory_functions( +getdns_dict * getdns_dict_create_with_memory_functions( void *(*malloc)(size_t), void *(*realloc)(void *, size_t), void (*free)(void *) ); -struct getdns_dict * getdns_dict_create_with_extended_memory_functions( +getdns_dict * getdns_dict_create_with_extended_memory_functions( void *userarg, void *(*malloc)(void *userarg, size_t), void *(*realloc)(void *userarg, void *, size_t), void (*free)(void *userarg, void *) ); -void getdns_dict_destroy(struct getdns_dict *this_dict); -getdns_return_t getdns_dict_set_dict(struct getdns_dict *this_dict, const char *name, const struct getdns_dict *child_dict); -getdns_return_t getdns_dict_set_list(struct getdns_dict *this_dict, const char *name, const struct getdns_list *child_list); -getdns_return_t getdns_dict_set_bindata(struct getdns_dict *this_dict, const char *name, const struct getdns_bindata *child_bindata); -getdns_return_t getdns_dict_set_int(struct getdns_dict *this_dict, const char *name, uint32_t child_uint32); -getdns_return_t getdns_dict_remove_name(struct getdns_dict *this_dict, const char *name); +void getdns_dict_destroy(getdns_dict *this_dict); +getdns_return_t getdns_dict_set_dict(getdns_dict *this_dict, const char *name, const getdns_dict *child_dict); +getdns_return_t getdns_dict_set_list(getdns_dict *this_dict, const char *name, const getdns_list *child_list); +getdns_return_t getdns_dict_set_bindata(getdns_dict *this_dict, const char *name, const getdns_bindata *child_bindata); +getdns_return_t getdns_dict_set_int(getdns_dict *this_dict, const char *name, uint32_t child_uint32); +getdns_return_t getdns_dict_remove_name(getdns_dict *this_dict, const char *name);

Lists are extended with the getdns_list_set_ calls with the index set to the @@ -639,7 +639,7 @@ results that have been validated with DNSSEC, you might use:

 /* . . . */
-struct getdns_dict * this_extensions = getdns_dict_create();
+getdns_dict * this_extensions = getdns_dict_create();
 this_ret = getdns_dict_set_int(this_extensions, "dnssec_return_only_secure", GETDNS_EXTENSION_TRUE);
 /* . . . Do some processing with the extensions and results . . . */
 /* Remember to clean up memory*/
@@ -1127,14 +1127,14 @@ string in FQDN format to bytes in DNS format.

getdns_return_t getdns_convert_dns_name_to_fqdn( - const struct getdns_bindata *dns_name_wire_fmt, + const getdns_bindata *dns_name_wire_fmt, char **fqdn_as_string ); getdns_return_t getdns_convert_fqdn_to_dns_name( const char *fqdn_as_string, - struct getdns_bindata **dns_name_wire_fmt + getdns_bindata **dns_name_wire_fmt );
@@ -1145,17 +1145,17 @@ The caller is responsible of disposing these allocations with free.

5.1 A Few Needed Definitions

-
struct getdns_context; +
typedef struct getdns_context getdns_context; typedef uint64_t getdns_transaction_t; typedef enum getdns_data_type { t_dict, t_list, t_int, t_bindata } getdns_data_type; -struct getdns_bindata { +typedef struct getdns_bindata { size_t size; uint8_t *data; -}; -struct getdns_dict; -struct getdns_list; +} getdns_bindata; +typedef struct getdns_dict getdns_dict; +typedef struct getdns_list getdns_list;

5.2 Return Codes

@@ -1484,9 +1484,9 @@ function.

#define UNUSED_PARAM(x) ((void)(x)) /* Set up the callback function, which will also do the processing of the results */ -void this_callbackfn(struct getdns_context *this_context, +void this_callbackfn(getdns_context *this_context, getdns_callback_type_t this_callback_type, - struct getdns_dict *this_response, + getdns_dict *this_response, void *this_userarg, getdns_transaction_t this_transaction_id) { @@ -1504,7 +1504,7 @@ function.

getdns_dict_destroy(this_response); return; } - struct getdns_list * just_the_addresses_ptr; + getdns_list * just_the_addresses_ptr; this_ret = getdns_dict_get_list(this_response, "just_address_answers", &just_the_addresses_ptr); if (this_ret != GETDNS_RETURN_GOOD) // This check is really not needed, but prevents a compiler error under "pedantic" { @@ -1517,10 +1517,10 @@ function.

/* Go through each record */ for ( size_t rec_count = 0; rec_count < num_addresses; ++rec_count ) { - struct getdns_dict * this_address; + getdns_dict * this_address; this_ret = getdns_list_get_dict(just_the_addresses_ptr, rec_count, &this_address); // Ignore any error /* Just print the address */ - struct getdns_bindata * this_address_data; + getdns_bindata * this_address_data; this_ret = getdns_dict_get_bindata(this_address, "address_data", &this_address_data); // Ignore any error char *this_address_str = getdns_display_ip_address(this_address_data); printf("The address is %s\n", this_address_str); @@ -1537,7 +1537,7 @@ function.

int main() { /* Create the DNS context for this call */ - struct getdns_context *this_context = NULL; + getdns_context *this_context = NULL; getdns_return_t context_create_return = getdns_context_create(&this_context, 1); if (context_create_return != GETDNS_RETURN_GOOD) { @@ -1602,9 +1602,9 @@ their TTLs.

#define UNUSED_PARAM(x) ((void)(x)) /* Set up the callback function, which will also do the processing of the results */ -void this_callbackfn(struct getdns_context *this_context, +void this_callbackfn(getdns_context *this_context, getdns_callback_type_t this_callback_type, - struct getdns_dict *this_response, + getdns_dict *this_response, void *this_userarg, getdns_transaction_t this_transaction_id) { @@ -1623,7 +1623,7 @@ their TTLs.

return; } /* Find all the answers returned */ - struct getdns_list * these_answers; + getdns_list * these_answers; this_ret = getdns_dict_get_list(this_response, "replies_tree", &these_answers); if (this_ret == GETDNS_RETURN_NO_SUCH_DICT_NAME) { @@ -1636,20 +1636,20 @@ their TTLs.

/* Go through each answer */ for ( size_t rec_count = 0; rec_count < num_answers; ++rec_count ) { - struct getdns_dict * this_record; + getdns_dict * this_record; this_ret = getdns_list_get_dict(these_answers, rec_count, &this_record); // Ignore any error /* Get the answer section */ - struct getdns_list * this_answer; + getdns_list * this_answer; this_ret = getdns_dict_get_list(this_record, "answer", &this_answer); // Ignore any error /* Get each RR in the answer section */ size_t num_rrs; this_ret = getdns_list_get_length(this_answer, &num_rrs); for ( size_t rr_count = 0; rr_count < num_rrs; ++rr_count ) { - struct getdns_dict *this_rr = NULL; + getdns_dict *this_rr = NULL; this_ret = getdns_list_get_dict(this_answer, rr_count, &this_rr); // Ignore any error /* Get the RDATA */ - struct getdns_dict * this_rdata = NULL; + getdns_dict * this_rdata = NULL; this_ret = getdns_dict_get_dict(this_rr, "rdata", &this_rdata); // Ignore any error /* Get the RDATA type */ uint32_t this_type; @@ -1657,7 +1657,7 @@ their TTLs.

/* If it is type A or AAAA, print the value */ if (this_type == GETDNS_RRTYPE_A) { - struct getdns_bindata * this_a_record = NULL; + getdns_bindata * this_a_record = NULL; this_ret = getdns_dict_get_bindata(this_rdata, "ipv4_address", &this_a_record); if (this_ret == GETDNS_RETURN_NO_SUCH_DICT_NAME) { @@ -1672,7 +1672,7 @@ their TTLs.

} else if (this_type == GETDNS_RRTYPE_AAAA) { - struct getdns_bindata * this_aaaa_record = NULL; + getdns_bindata * this_aaaa_record = NULL; this_ret = getdns_dict_get_bindata(this_rdata, "ipv6_address", &this_aaaa_record); if (this_ret == GETDNS_RETURN_NO_SUCH_DICT_NAME) { @@ -1698,7 +1698,7 @@ their TTLs.

int main() { /* Create the DNS context for this call */ - struct getdns_context *this_context = NULL; + getdns_context *this_context = NULL; getdns_return_t context_create_return = getdns_context_create(&this_context, 1); if (context_create_return != GETDNS_RETURN_GOOD) { @@ -1755,7 +1755,7 @@ callback function, add a check for the DNSSEC status. It shows how to add two extensions to the extensions argument of the call.

-struct getdns_dict * this_extensions = getdns_dict_create();
+getdns_dict * this_extensions = getdns_dict_create();
 this_ret = getdns_dict_set_int(this_extensions, "return_both_v4_and_v6", GETDNS_EXTENSION_TRUE);
 this_ret = getdns_dict_set_int(this_extensions, "dnssec_return_status", GETDNS_EXTENSION_TRUE);
 . . .
@@ -1795,7 +1795,7 @@ as it is for the synchronous example, it is just done in main().

{ getdns_return_t this_ret; /* Holder for all function returns */ /* Create the DNS context for this call */ - struct getdns_context *this_context = NULL; + getdns_context *this_context = NULL; getdns_return_t context_create_return = getdns_context_create(&this_context, 1); if (context_create_return != GETDNS_RETURN_GOOD) { @@ -1806,7 +1806,7 @@ as it is for the synchronous example, it is just done in main().

const char * this_name = "www.example.com"; uint8_t this_request_type = GETDNS_RRTYPE_A; /* Get the A and AAAA records */ - struct getdns_dict * this_extensions = getdns_dict_create(); + getdns_dict * this_extensions = getdns_dict_create(); this_ret = getdns_dict_set_int(this_extensions, "return_both_v4_and_v6", GETDNS_EXTENSION_TRUE); if (this_ret != GETDNS_RETURN_GOOD) { @@ -1815,7 +1815,7 @@ as it is for the synchronous example, it is just done in main().

getdns_context_destroy(this_context); return(GETDNS_RETURN_GENERIC_ERROR); } - struct getdns_dict * this_response = NULL; + getdns_dict * this_response = NULL; /* Make the call */ getdns_return_t dns_request_return = getdns_general_sync(this_context, this_name, this_request_type, @@ -1841,17 +1841,17 @@ as it is for the synchronous example, it is just done in main().

getdns_context_destroy(this_context); return(GETDNS_RETURN_GENERIC_ERROR); } - struct getdns_list * just_the_addresses_ptr; + getdns_list * just_the_addresses_ptr; this_ret = getdns_dict_get_list(this_response, "just_address_answers", &just_the_addresses_ptr); // Ignore any error size_t num_addresses; this_ret = getdns_list_get_length(just_the_addresses_ptr, &num_addresses); // Ignore any error /* Go through each record */ for ( size_t rec_count = 0; rec_count < num_addresses; ++rec_count ) { - struct getdns_dict * this_address; + getdns_dict * this_address; this_ret = getdns_list_get_dict(just_the_addresses_ptr, rec_count, &this_address); // Ignore any error /* Just print the address */ - struct getdns_bindata * this_address_data; + getdns_bindata * this_address_data; this_ret = getdns_dict_get_bindata(this_address, "address_data", &this_address_data); // Ignore any error char *this_address_str = getdns_display_ip_address(this_address_data); printf("The address is %s\n", this_address_str); @@ -1883,9 +1883,9 @@ as it is for the synchronous example, it is just done in main().

#define UNUSED_PARAM(x) ((void)(x)) /* Set up the callback function, which will also do the processing of the results */ -void this_callbackfn(struct getdns_context *this_context, +void this_callbackfn(getdns_context *this_context, uint16_t this_callback_type, - struct getdns_dict *this_response, + getdns_dict *this_response, void *this_userarg, getdns_transaction_t this_transaction_id) { @@ -1904,34 +1904,34 @@ as it is for the synchronous example, it is just done in main().

getdns_dict_destroy(this_response); return; } - struct getdns_list *replies_tree; + getdns_list *replies_tree; this_ret = getdns_dict_get_list(this_response, "replies_tree", &replies_tree); // Ignore any error size_t num_replies; this_ret = getdns_list_get_length(replies_tree, &num_replies); // Ignore any error /* Go through each reply */ for ( size_t reply_count = 0; reply_count < num_replies; ++reply_count) { - struct getdns_dict * this_reply; + getdns_dict * this_reply; this_ret = getdns_list_get_dict(replies_tree, reply_count, &this_reply); // Ignore any error /* Just print the address */ - struct getdns_list* reply_answers; + getdns_list* reply_answers; this_ret = getdns_dict_get_list(this_reply, "answer", &reply_answers); // Ignore any error size_t num_answers; this_ret = getdns_list_get_length(reply_answers, &num_answers); // Ignore any error /* Go through each answer */ for ( size_t answer_count = 0; answer_count < num_answers; ++answer_count) { - struct getdns_dict * this_rr; + getdns_dict * this_rr; this_ret = getdns_list_get_dict(reply_answers, answer_count, &this_rr); /* Get the RDATA type */ uint32_t this_type; this_ret = getdns_dict_get_int(this_rr, "type", &this_type); // Ignore any error if (this_type == GETDNS_RRTYPE_PTR) { - struct getdns_dict *this_rdata; + getdns_dict *this_rdata; this_ret = getdns_dict_get_dict(this_rr, "rdata", &this_rdata); // Ignore any error - struct getdns_bindata * this_dname; + getdns_bindata * this_dname; this_ret = getdns_dict_get_bindata(this_rdata, "rdata_raw", &this_dname); char *this_dname_str = getdns_convert_dns_name_to_fqdn((char *)this_dname->data); printf("The dname is %s\n", this_dname_str); @@ -1952,7 +1952,7 @@ as it is for the synchronous example, it is just done in main().

int main() { /* Create the DNS context for this call */ - struct getdns_context *this_context = NULL; + getdns_context *this_context = NULL; getdns_return_t context_create_return = getdns_context_create(&this_context, 1); if (context_create_return != GETDNS_RETURN_GOOD) { @@ -1970,12 +1970,12 @@ as it is for the synchronous example, it is just done in main().

} (void)getdns_extension_set_libevent_base(this_context, this_event_base); /* Set up the getdns call */ - struct getdns_dict * this_addr_to_look_up = getdns_dict_create(); + getdns_dict * this_addr_to_look_up = getdns_dict_create(); // TODO: check the return value above - struct getdns_bindata this_type = { 4, (void *)"IPv4" }; + getdns_bindata this_type = { 4, (void *)"IPv4" }; getdns_return_t this_ret = getdns_dict_set_bindata(this_addr_to_look_up, "address_type", &this_type); UNUSED_PARAM(this_ret); - struct getdns_bindata this_ipv4_addr = { 4, (void *)"\x08\x08\x08\x08" }; + getdns_bindata this_ipv4_addr = { 4, (void *)"\x08\x08\x08\x08" }; this_ret = getdns_dict_set_bindata(this_addr_to_look_up, "address_data", &this_ipv4_addr); char* this_userarg = "somestring"; // Could add things here to help identify this call getdns_transaction_t this_transaction_id = 0; @@ -2032,9 +2032,9 @@ getdns_convert_alabel_to_ulabel( can use the getdns_validate_dnssec() helper function.

getdns_return_t getdns_validate_dnssec( - struct getdns_list *record_to_validate, - struct getdns_list *bundle_of_support_records, - struct getdns_list *trust_anchor_rdatas + getdns_list *record_to_validate, + getdns_list *bundle_of_support_records, + getdns_list *trust_anchor_records );

@@ -2048,7 +2048,7 @@ The function returns one of GETDNS_DNSSEC_SECURE, GETDNS_DNSS

char * getdns_pretty_print_dict( - const struct getdns_dict *some_dict + const getdns_dict *some_dict );

This returns a string that is the nicely-formatted version @@ -2057,7 +2057,7 @@ of the dict and all of the named elements in it.

char * getdns_display_ip_address( - const struct getdns_bindata *bindata_of_ipv4_or_ipv6_address + const getdns_bindata *bindata_of_ipv4_or_ipv6_address );

This returns a string that is the nicely-formatted version @@ -2125,8 +2125,8 @@ success or GETDNS_RETURN_CONTEXT_UPDATE_FAIL for a failure to updat

getdns_return_t getdns_context_set_context_update_callback( - struct getdns_context *context, - void (*value)(struct getdns_context *context, getdns_context_code_t changed_item) + getdns_context *context, + void (*value)(getdns_context *context, getdns_context_code_t changed_item) );

The value is a pointer to the callback function that will be called when any context is changed. Such changes might be from automatic @@ -2141,8 +2141,8 @@ specifies which of the context changed; the context codes are listed

getdns_return_t getdns_context_set_resolution_type( - struct getdns_context *context, - getdns_resolution_t value + getdns_context *context, + getdns_resolution_t value );

Specifies whether DNS queries are performed with nonrecurive lookups or as a stub resolver. The value is GETDNS_RESOLUTION_RECURSING or @@ -2159,9 +2159,9 @@ return GETDNS_RETURN_CONTEXT_UPDATE_FAIL.

getdns_return_t getdns_context_set_namespaces( - struct getdns_context *context, - size_t namespace_count, - getdns_namespace_t *namespaces + getdns_context *context, + size_t namespace_count, + getdns_namespace_t *namespaces );

The namespaces array contains an ordered list of namespaces that will be queried. @@ -2184,8 +2184,8 @@ default is determined by the OS.

getdns_return_t getdns_context_set_dns_transport( - struct getdns_context *context, - getdns_transport_t value + getdns_context *context, + getdns_transport_t value );

Specifies what transport is used for DNS lookups. The value is @@ -2197,8 +2197,8 @@ The value is

getdns_return_t getdns_context_set_limit_outstanding_queries( - struct getdns_context *context, - uint16_t limit + getdns_context *context, + uint16_t limit );

Specifies limit the number of outstanding DNS queries. The API will block itself from sending more queries if it is about to exceed @@ -2209,8 +2209,8 @@ the number of outstanding DNS queries is unlimited.

getdns_return_t getdns_context_set_timeout( - struct getdns_context *context, - uint64_t timeout + getdns_context *context, + uint64_t timeout );

Specifies number of milliseconds the API will wait for request to return. The default is not specified.

@@ -2220,8 +2220,8 @@ The default is not specified.

getdns_return_t getdns_context_set_follow_redirects( - struct getdns_context *context, - getdns_redirects_t value + getdns_context *context, + getdns_redirects_t value );

Specifies whether or not DNS queries follow redirects. The value is GETDNS_REDIRECTS_FOLLOW for normal @@ -2232,8 +2232,8 @@ through CNAME and DNAME to return the CNAME or DNAME, not the eventual target. getdns_return_t getdns_context_set_dns_root_servers( - struct getdns_context *context, - struct getdns_list *addresses + getdns_context *context, + getdns_list *addresses );

The list contains dicts that are addresses to be used for looking up top-level domains; the default is the list of "normal" IANA root servers. Each dict in the list @@ -2245,8 +2245,8 @@ either "IPv4" or "IPv6") and address_data (whose value is a bindata

getdns_return_t getdns_context_set_append_name( - struct getdns_context *context, - getdns_append_name_t value + getdns_context *context, + getdns_append_name_t value );

Specifies whether to append a suffix to the query string before the API starts resolving a name. @@ -2260,8 +2260,8 @@ whether or not to append the suffix given by getdns_context_set_suffix getdns_return_t getdns_context_set_suffix( - struct getdns_context *context, - struct getdns_list *value + getdns_context *context, + getdns_list *value );

The value is a list of bindatas that are strings that are to be appended based on getdns_context_set_append_name; the default is an

getdns_return_t getdns_context_set_dnssec_trust_anchors( - struct getdns_context *context, - struct getdns_list *value + getdns_context *context, + getdns_list *value );

The value is a list of bindatas that are the DNSSEC trust anchors. The default is the trust anchors from the IANA root. The trust anchors @@ -2287,8 +2287,8 @@ are expressed as RDATAs from DNSKEY resource records.

getdns_return_t getdns_context_set_dnssec_allowed_skew( - struct getdns_context *context, - uint32_t value + getdns_context *context, + uint32_t value );

The value is the number of seconds of skew that is allowed in either direction when checking an RRSIG's Expiration and Inception fields. The default @@ -2307,8 +2307,8 @@ must do its own DNSSEC processing, possibly with the getdns_validate_dnsse

getdns_return_t getdns_context_set_upstream_recursive_servers( - struct getdns_context *context, - struct getdns_list *upstream_list + getdns_context *context, + getdns_list *upstream_list );

The list of dicts define where a stub resolver will send queries. Each dict contains at least two names: address_type (whose value is a bindata; it is currently either @@ -2326,8 +2326,8 @@ These come from RFC 2671.

getdns_return_t getdns_context_set_edns_maximum_udp_payload_size( - struct getdns_context *context, - uint16_t value + getdns_context *context, + uint16_t value );

The value is between 512 and 65535; the default is 512.

@@ -2335,8 +2335,8 @@ is 512.

getdns_return_t getdns_context_set_edns_extended_rcode( - struct getdns_context *context, - uint8_t value + getdns_context *context, + uint8_t value );

The value is between 0 and 255; the default is 0.

@@ -2344,8 +2344,8 @@ is 0.

getdns_return_t getdns_context_set_edns_version( - struct getdns_context *context, - uint8_t value + getdns_context *context, + uint8_t value );

The value is between 0 and 255; the default is 0.

@@ -2353,8 +2353,8 @@ is 0.

getdns_return_t getdns_context_set_edns_do_bit( - struct getdns_context *context, - uint8_t value + getdns_context *context, + uint8_t value );

The value is between 0 and 1; the default is 0.

@@ -2364,10 +2364,10 @@ is 0.

getdns_return_t getdns_context_set_memory_functions( - struct getdns_context *context, - void *(*malloc) (size_t), - void *(*realloc) (void *, size_t), - void (*free) (void *) + getdns_context *context, + void *(*malloc) (size_t), + void *(*realloc) (void *, size_t), + void (*free) (void *) );

The given memory management functions will be used for creating the response dicts. The response dicts inherit the custom memory management functions from the context and will deallocate themselves (and their members) with the custom deallocator. @@ -2376,11 +2376,11 @@ By default, the system malloc, re

getdns_return_t getdns_context_set_extended_memory_functions( - struct getdns_context *context, - void *userarg, - void *(*malloc)(void *userarg, size_t sz), - void *(*realloc)(void *userarg, void *ptr, size_t sz), - void (*free)(void *userarg, void *ptr) + getdns_context *context, + void *userarg, + void *(*malloc)(void *userarg, size_t sz), + void *(*realloc)(void *userarg, void *ptr, size_t sz), + void (*free)(void *userarg, void *ptr) );

The given extended memory management functions will be used for creating the response dicts. The value of userarg argument will be passed to the custom malloc, realloc, and free. @@ -2428,7 +2428,7 @@ The response dicts inherit the custom memory management functions and the value

9. The Generated Files

-

There is a tarball that includes the .h files, +

There is a tarball that includes the .h files, the examples, and so on. The examples all make, even though there is no API implementation, based on a pseudo-implementation in the tarball; see make-examples-PLATFORM.sh. Note that this currently builds fine on the Macintosh and Ubuntu; help is definitely appreciated on making the build process