From 5d522b00177eb88ba2795adc67417ac81bb446c0 Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Thu, 19 Jan 2017 09:08:15 +0000 Subject: [PATCH] - Fix to Rename ub_callback_t to ub_callback_type, because POSIX reserves _t typedefs. git-svn-id: file:///svn/unbound/trunk@3988 be551aaa-1e26-0410-a405-d3ace91eadb9 --- configure | 2 +- configure.ac | 2 +- doc/Changelog | 4 ++++ doc/libunbound.3.in | 4 ++-- libunbound/context.c | 2 +- libunbound/context.h | 4 ++-- libunbound/libunbound.c | 10 +++++----- libunbound/unbound.h | 4 ++-- 8 files changed, 18 insertions(+), 14 deletions(-) diff --git a/configure b/configure index 97b32e6af..be12baaef 100755 --- a/configure +++ b/configure @@ -2805,7 +2805,7 @@ LIBUNBOUND_AGE=4 # 1.5.9 had 6:1:4 # 1.5.10 had 6:2:4 # 1.6.0 had 6:3:4 -# 1.6.1 had 6:4:4 +# 1.6.1 had 7:0:5 # ub_callback_t typedef renamed to ub_callback_type # Current -- the number of the binary API that we're implementing # Revision -- which iteration of the implementation of the binary diff --git a/configure.ac b/configure.ac index abb37360c..fd1c2771d 100644 --- a/configure.ac +++ b/configure.ac @@ -68,7 +68,7 @@ LIBUNBOUND_AGE=4 # 1.5.9 had 6:1:4 # 1.5.10 had 6:2:4 # 1.6.0 had 6:3:4 -# 1.6.1 had 6:4:4 +# 1.6.1 had 7:0:5 # ub_callback_t typedef renamed to ub_callback_type # Current -- the number of the binary API that we're implementing # Revision -- which iteration of the implementation of the binary diff --git a/doc/Changelog b/doc/Changelog index e6c5768ec..1f9d3460f 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,7 @@ +19 January 2017: Wouter + - Fix to Rename ub_callback_t to ub_callback_type, because POSIX + reserves _t typedefs. + 12 January 2017: Wouter - Fix to also block meta types 128 through to 248 with formerr. - Fix #1206: Some view-related commands are missing from 'unbound-control -h' diff --git a/doc/libunbound.3.in b/doc/libunbound.3.in index 4bdf7fd86..ac6939646 100644 --- a/doc/libunbound.3.in +++ b/doc/libunbound.3.in @@ -12,7 +12,7 @@ .B unbound.h, .B ub_ctx, .B ub_result, -.B ub_callback_t, +.B ub_callback_type, .B ub_ctx_create, .B ub_ctx_delete, .B ub_ctx_set_option, @@ -120,7 +120,7 @@ .br \fIint\fR rrtype, \fIint\fR rrclass, \fIvoid*\fR mydata, .br - \fIub_callback_t\fR callback, \fIint*\fR async_id); + \fIub_callback_type\fR callback, \fIint*\fR async_id); .LP \fIint\fR \fBub_cancel\fR(\fIstruct ub_ctx*\fR ctx, \fIint\fR async_id); diff --git a/libunbound/context.c b/libunbound/context.c index 94a2472ae..e203111b7 100644 --- a/libunbound/context.c +++ b/libunbound/context.c @@ -127,7 +127,7 @@ find_id(struct ub_ctx* ctx, int* id) struct ctx_query* context_new(struct ub_ctx* ctx, const char* name, int rrtype, int rrclass, - ub_callback_t cb, void* cbarg) + ub_callback_type cb, void* cbarg) { struct ctx_query* q = (struct ctx_query*)calloc(1, sizeof(*q)); if(!q) return NULL; diff --git a/libunbound/context.h b/libunbound/context.h index d32c0b00a..0e363ebc3 100644 --- a/libunbound/context.h +++ b/libunbound/context.h @@ -149,7 +149,7 @@ struct ctx_query { int cancelled; /** for async query, the callback function */ - ub_callback_t cb; + ub_callback_type cb; /** for async query, the callback user arg */ void* cb_arg; @@ -242,7 +242,7 @@ void context_query_delete(struct ctx_query* q); * @return new ctx_query or NULL for malloc failure. */ struct ctx_query* context_new(struct ub_ctx* ctx, const char* name, int rrtype, - int rrclass, ub_callback_t cb, void* cbarg); + int rrclass, ub_callback_type cb, void* cbarg); /** * Get a new alloc. Creates a new one or uses a cached one. diff --git a/libunbound/libunbound.c b/libunbound/libunbound.c index aaaaec08c..7992b671e 100644 --- a/libunbound/libunbound.c +++ b/libunbound/libunbound.c @@ -500,7 +500,7 @@ ub_fd(struct ub_ctx* ctx) /** process answer from bg worker */ static int process_answer_detail(struct ub_ctx* ctx, uint8_t* msg, uint32_t len, - ub_callback_t* cb, void** cbarg, int* err, + ub_callback_type* cb, void** cbarg, int* err, struct ub_result** res) { struct ctx_query* q; @@ -567,7 +567,7 @@ static int process_answer(struct ub_ctx* ctx, uint8_t* msg, uint32_t len) { int err; - ub_callback_t cb; + ub_callback_type cb; void* cbarg; struct ub_result* res; int r; @@ -610,7 +610,7 @@ int ub_wait(struct ub_ctx* ctx) { int err; - ub_callback_t cb; + ub_callback_type cb; void* cbarg; struct ub_result* res; int r; @@ -734,7 +734,7 @@ ub_resolve_event(struct ub_ctx* ctx, const char* name, int rrtype, ub_comm_base_now(ctx->event_worker->base); /* create new ctx_query and attempt to add to the list */ - q = context_new(ctx, name, rrtype, rrclass, (ub_callback_t)callback, + q = context_new(ctx, name, rrtype, rrclass, (ub_callback_type)callback, mydata); if(!q) return UB_NOMEM; @@ -748,7 +748,7 @@ ub_resolve_event(struct ub_ctx* ctx, const char* name, int rrtype, int ub_resolve_async(struct ub_ctx* ctx, const char* name, int rrtype, - int rrclass, void* mydata, ub_callback_t callback, int* async_id) + int rrclass, void* mydata, ub_callback_type callback, int* async_id) { struct ctx_query* q; uint8_t* msg = NULL; diff --git a/libunbound/unbound.h b/libunbound/unbound.h index 9c828fc29..9a076927f 100644 --- a/libunbound/unbound.h +++ b/libunbound/unbound.h @@ -223,7 +223,7 @@ struct ub_result { * This structure is allocated on the heap and needs to be * freed with ub_resolve_free(result); */ -typedef void (*ub_callback_t)(void*, int, struct ub_result*); +typedef void (*ub_callback_type)(void*, int, struct ub_result*); /** * Create a resolving and validation context. @@ -519,7 +519,7 @@ int ub_resolve(struct ub_ctx* ctx, const char* name, int rrtype, * @return 0 if OK, else error. */ int ub_resolve_async(struct ub_ctx* ctx, const char* name, int rrtype, - int rrclass, void* mydata, ub_callback_t callback, int* async_id); + int rrclass, void* mydata, ub_callback_type callback, int* async_id); /** * Cancel an async query in progress.