From 74fcc3c81b05350ccd92c5bdef211984506a4193 Mon Sep 17 00:00:00 2001 From: Neel Goyal Date: Wed, 6 Nov 2013 13:32:05 -0500 Subject: [PATCH] Updating coding style for context.c/h --- src/context.c | 38 +++++++++++++++++++++++++++----------- src/context.h | 13 ++++++------- 2 files changed, 33 insertions(+), 18 deletions(-) diff --git a/src/context.c b/src/context.c index 242278d9..10827863 100644 --- a/src/context.c +++ b/src/context.c @@ -28,19 +28,35 @@ * THE SOFTWARE. */ +#include + +#include +#include #include #include #include -#include "context.h" -#include "util-internal.h" -#include "types-internal.h" -#include -#include -#include #include -#include +#include -/* stuff to make it compile pedantically */ +#include "context.h" +#include "types-internal.h" +#include "util-internal.h" + +/* Private functions */ +static uint16_t *create_default_namespaces(); +static struct getdns_list *create_default_root_servers(); +static getdns_return_t add_ip_str(getdns_dict *); +static struct getdns_dict *create_ipaddr_dict_from_rdf(ldns_rdf *); +static struct getdns_list *create_from_ldns_list(ldns_rdf **, size_t); +static getdns_return_t set_os_defaults(getdns_context_t); +static int transaction_id_cmp(const void *, const void *); +static void set_ub_string_opt(getdns_context_t, char *, char *); +static void set_ub_number_opt(getdns_context_t, char *, uint16_t); +static inline void clear_resolution_type_set_flag(getdns_context_t, uint16_t); +static void dispatch_updated(getdns_context_t, uint16_t); +static void cancel_dns_req(getdns_dns_req *); + +/* Stuff to make it compile pedantically */ #define UNUSED_PARAM(x) ((void)(x)) /** @@ -210,7 +226,7 @@ transaction_id_cmp(const void *id1, const void *id2) /* * getdns_context_create * - * call this to initialize the context that is used in other getdns calls + * Call this to initialize the context that is used in other getdns calls. */ getdns_return_t getdns_context_create(getdns_context_t * context, int set_from_os) @@ -279,8 +295,8 @@ getdns_context_create(getdns_context_t * context, int set_from_os) /* * getdns_context_destroy * - * call this to dispose of resources associated with a context once you - * are done with it + * Call this to dispose of resources associated with a context once you + * are done with it. */ void getdns_context_destroy(getdns_context_t context) diff --git a/src/context.h b/src/context.h index a2ebf112..a131516b 100644 --- a/src/context.h +++ b/src/context.h @@ -33,16 +33,15 @@ #include struct event_base; -struct ub_ctx; -struct ldns_rbtree_t; struct getdns_dns_req; +struct ldns_rbtree_t; +struct ub_ctx; /** function pointer typedefs */ -typedef void (*getdns_update_callback) (getdns_context_t context, - uint16_t changed_item); -typedef void *(*getdns_memory_allocator) (size_t size); +typedef void (*getdns_update_callback) (getdns_context_t, uint16_t); +typedef void *(*getdns_memory_allocator) (size_t); typedef void (*getdns_memory_deallocator) (void *); -typedef void *(*getdns_memory_reallocator) (void *ptr, size_t size); +typedef void *(*getdns_memory_reallocator) (void *, size_t); struct getdns_context_t { @@ -106,4 +105,4 @@ getdns_return_t getdns_context_clear_outbound_request(struct getdns_dns_req getdns_return_t getdns_context_cancel_request(getdns_context_t context, getdns_transaction_t transaction_id, int fire_callback); -#endif +#endif /* _GETDNS_CONTEXT_H_ */