From 0b6d610ea548b8645c14496a4bf2a5c2952c1dfc Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Fri, 8 Nov 2013 18:39:06 -0800 Subject: [PATCH] Get rid of response_length in synchroneous funcs --- src/example/example_synchronous.c | 3 +-- src/getdns/getdns.h | 12 ++++-------- src/sync.c | 14 +++++++------- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/src/example/example_synchronous.c b/src/example/example_synchronous.c index 772af527..4d070ad2 100644 --- a/src/example/example_synchronous.c +++ b/src/example/example_synchronous.c @@ -46,7 +46,6 @@ main() const char *this_name = "www.example.com"; uint8_t this_request_type = GETDNS_RRTYPE_A; struct getdns_dict *this_response = NULL; - uint32_t this_response_length; getdns_return_t this_ret; /* Create the DNS context for this call */ @@ -73,7 +72,7 @@ main() /* Make the call */ getdns_return_t dns_request_return = getdns_general_sync(this_context, this_name, this_request_type, - this_extensions, &this_response_length, &this_response); + this_extensions, &this_response); /* free the extensions */ getdns_dict_destroy(this_extensions); if (dns_request_return == GETDNS_RETURN_BAD_DOMAIN_NAME) { diff --git a/src/getdns/getdns.h b/src/getdns/getdns.h index ed8ebeff..745bb3f5 100644 --- a/src/getdns/getdns.h +++ b/src/getdns/getdns.h @@ -726,7 +726,6 @@ getdns_cancel_callback(getdns_context_t context, * @param name the ASCII based domain name to lookup * @param request_type RR type for the query, e.g. GETDNS_RR_TYPE_NS * @param extensions dict data structures, NULL to use no extensions - * @param response_length response length * @param response response * @return GETDNS_RETURN_GOOD on success */ @@ -735,14 +734,13 @@ getdns_general_sync(getdns_context_t context, const char *name, uint16_t request_type, struct getdns_dict *extensions, - uint32_t * response_length, struct getdns_dict **response); + struct getdns_dict **response); /** * retrieve address assigned to a DNS name * @param context pointer to a previously created context to be used for this call * @param name the ASCII based domain name to lookup * @param extensions dict data structures, NULL to use no extensions - * @param response_length response length * @param response response * @return GETDNS_RETURN_GOOD on success @@ -751,14 +749,13 @@ getdns_return_t getdns_address_sync(getdns_context_t context, const char *name, struct getdns_dict *extensions, - uint32_t * response_length, struct getdns_dict **response); + struct getdns_dict **response); /** * retrieve hostname assigned to an IP address * @param context pointer to a previously created context to be used for this call * @param address the address to look up * @param extensions dict data structures, NULL to use no extensions - * @param response_length response length * @param response response * @return GETDNS_RETURN_GOOD on success */ @@ -766,14 +763,13 @@ getdns_return_t getdns_hostname_sync(getdns_context_t context, struct getdns_dict *address, struct getdns_dict *extensions, - uint32_t * response_length, struct getdns_dict **response); + struct getdns_dict **response); /** * retrieve a service assigned to a DNS name * @param context pointer to a previously created context to be used for this call * @param name the ASCII based domain name to lookup * @param extensions dict data structures, NULL to use no extensions - * @param response_length response length * @param response response * @return GETDNS_RETURN_GOOD on success */ @@ -781,7 +777,7 @@ getdns_return_t getdns_service_sync(getdns_context_t context, const char *name, struct getdns_dict *extensions, - uint32_t * response_length, struct getdns_dict **response); + struct getdns_dict **response); void getdns_free_sync_request_memory(struct getdns_dict *response); diff --git a/src/sync.c b/src/sync.c index 955a57ed..d812bb27 100644 --- a/src/sync.c +++ b/src/sync.c @@ -59,7 +59,7 @@ getdns_general_sync(getdns_context_t context, const char *name, uint16_t request_type, struct getdns_dict *extensions, - uint32_t * response_length, struct getdns_dict **response) + struct getdns_dict **response) { getdns_return_t response_status; @@ -79,7 +79,7 @@ getdns_return_t getdns_address_sync(getdns_context_t context, const char *name, struct getdns_dict * extensions, - uint32_t * response_length, struct getdns_dict ** response) + struct getdns_dict ** response) { int cleanup_extensions = 0; if (!extensions) { @@ -91,7 +91,7 @@ getdns_address_sync(getdns_context_t context, getdns_return_t result = getdns_general_sync(context, name, GETDNS_RRTYPE_A, - extensions, response_length, response); + extensions, response); if (cleanup_extensions) { getdns_dict_destroy(extensions); } @@ -102,7 +102,7 @@ getdns_return_t getdns_hostname_sync(getdns_context_t context, struct getdns_dict * address, struct getdns_dict * extensions, - uint32_t * response_length, struct getdns_dict ** response) + struct getdns_dict ** response) { struct getdns_bindata *address_data; struct getdns_bindata *address_type; @@ -128,18 +128,18 @@ getdns_hostname_sync(getdns_context_t context, if ((name = reverse_address((char *) address_data)) == 0) return GETDNS_RETURN_GENERIC_ERROR; return getdns_general_sync(context, name, req_type, extensions, - response_length, response); + response); } getdns_return_t getdns_service_sync(getdns_context_t context, const char *name, struct getdns_dict * extensions, - uint32_t * response_length, struct getdns_dict ** response) + struct getdns_dict ** response) { return getdns_general_sync(context, name, GETDNS_RRTYPE_SRV, - extensions, response_length, response); + extensions, response); }