summaryrefslogtreecommitdiff
path: root/libunbound
diff options
context:
space:
mode:
Diffstat (limited to 'libunbound')
-rw-r--r--libunbound/context.c2
-rw-r--r--libunbound/context.h16
-rw-r--r--libunbound/libunbound.c15
-rw-r--r--libunbound/libworker.c2
-rw-r--r--libunbound/unbound-event.h5
-rw-r--r--libunbound/unbound.h4
6 files changed, 23 insertions, 21 deletions
diff --git a/libunbound/context.c b/libunbound/context.c
index 94a2472ae531..e203111b70d8 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 d32c0b00aa03..1761c4d87216 100644
--- a/libunbound/context.h
+++ b/libunbound/context.h
@@ -61,17 +61,17 @@ struct ub_event_base;
struct ub_ctx {
/* --- pipes --- */
/** mutex on query write pipe */
- lock_basic_t qqpipe_lock;
+ lock_basic_type qqpipe_lock;
/** the query write pipe */
struct tube* qq_pipe;
/** mutex on result read pipe */
- lock_basic_t rrpipe_lock;
+ lock_basic_type rrpipe_lock;
/** the result read pipe */
struct tube* rr_pipe;
/* --- shared data --- */
/** mutex for access to env.cfg, finalized and dothread */
- lock_basic_t cfglock;
+ lock_basic_type cfglock;
/**
* The context has been finalized
* This is after config when the first resolve is done.
@@ -84,7 +84,7 @@ struct ub_ctx {
/** pid of bg worker process */
pid_t bg_pid;
/** tid of bg worker thread */
- ub_thread_t bg_tid;
+ ub_thread_type bg_tid;
/** do threading (instead of forking) for async resolution */
int dothread;
@@ -129,7 +129,7 @@ struct ub_ctx {
* Used to see if querynum is free for use.
* Content of type ctx_query.
*/
- rbtree_t queries;
+ rbtree_type queries;
};
/**
@@ -140,7 +140,7 @@ struct ub_ctx {
*/
struct ctx_query {
/** node in rbtree, must be first entry, key is ptr to the querynum */
- struct rbnode_t node;
+ struct rbnode_type node;
/** query id number, key for node */
int querynum;
/** was this an async query? */
@@ -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 aaaaec08ce9e..727b27522019 100644
--- a/libunbound/libunbound.c
+++ b/libunbound/libunbound.c
@@ -215,7 +215,7 @@ ub_ctx_create_event(struct event_base* eb)
/** delete q */
static void
-delq(rbnode_t* n, void* ATTR_UNUSED(arg))
+delq(rbnode_type* n, void* ATTR_UNUSED(arg))
{
struct ctx_query* q = (struct ctx_query*)n;
context_query_delete(q);
@@ -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;
@@ -706,7 +706,8 @@ ub_resolve(struct ub_ctx* ctx, const char* name, int rrtype,
int
ub_resolve_event(struct ub_ctx* ctx, const char* name, int rrtype,
- int rrclass, void* mydata, ub_event_callback_t callback, int* async_id)
+ int rrclass, void* mydata, ub_event_callback_type callback,
+ int* async_id)
{
struct ctx_query* q;
int r;
@@ -734,7 +735,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 +749,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/libworker.c b/libunbound/libworker.c
index c90101956d51..b42ba0bd8e78 100644
--- a/libunbound/libworker.c
+++ b/libunbound/libworker.c
@@ -639,7 +639,7 @@ libworker_event_done_cb(void* arg, int rcode, sldns_buffer* buf,
enum sec_status s, char* why_bogus)
{
struct ctx_query* q = (struct ctx_query*)arg;
- ub_event_callback_t cb = (ub_event_callback_t)q->cb;
+ ub_event_callback_type cb = (ub_event_callback_type)q->cb;
void* cb_arg = q->cb_arg;
int cancelled = q->cancelled;
diff --git a/libunbound/unbound-event.h b/libunbound/unbound-event.h
index 432750d77495..d5f0b1a36fe7 100644
--- a/libunbound/unbound-event.h
+++ b/libunbound/unbound-event.h
@@ -170,7 +170,7 @@ struct ub_event {
struct ub_event_vmt* vmt;
};
-typedef void (*ub_event_callback_t)(void*, int, void*, int, int, char*);
+typedef void (*ub_event_callback_type)(void*, int, void*, int, int, char*);
/**
* Create a resolving and validation context.
@@ -254,7 +254,8 @@ int ub_ctx_set_event(struct ub_ctx* ctx, struct event_base* base);
* @return 0 if OK, else error.
*/
int ub_resolve_event(struct ub_ctx* ctx, const char* name, int rrtype,
- int rrclass, void* mydata, ub_event_callback_t callback, int* async_id);
+ int rrclass, void* mydata, ub_event_callback_type callback,
+ int* async_id);
#ifdef __cplusplus
}
diff --git a/libunbound/unbound.h b/libunbound/unbound.h
index 9c828fc292bc..9a076927f9a6 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.