summaryrefslogtreecommitdiff
path: root/src/ipcpd
diff options
context:
space:
mode:
authordimitri staessens <[email protected]>2017-01-09 15:37:49 +0100
committerdimitri staessens <[email protected]>2017-01-09 15:37:49 +0100
commitba46a8b5c5717cdff25b39a2cd03a461998921c5 (patch)
treedc5a1a48c70977d1c5b0abe90f068b17fd262f9c /src/ipcpd
parente56d24010287127fc6b9c9da8d1f7cf160c50253 (diff)
downloadouroboros-ba46a8b5c5717cdff25b39a2cd03a461998921c5.tar.gz
ouroboros-ba46a8b5c5717cdff25b39a2cd03a461998921c5.zip
lib: Revise implementation of list
Adds LGPL license to the ouroboros lists.
Diffstat (limited to 'src/ipcpd')
-rw-r--r--src/ipcpd/ipcp-data.c8
-rw-r--r--src/ipcpd/normal/ribmgr.c14
-rw-r--r--src/ipcpd/timerwheel.c4
3 files changed, 13 insertions, 13 deletions
diff --git a/src/ipcpd/ipcp-data.c b/src/ipcpd/ipcp-data.c
index 132684c2..2d1d2752 100644
--- a/src/ipcpd/ipcp-data.c
+++ b/src/ipcpd/ipcp-data.c
@@ -119,9 +119,9 @@ struct ipcp_data * ipcp_data_init(struct ipcp_data * dst,
dst->dif_name = NULL;
/* init the lists */
- INIT_LIST_HEAD(&dst->registry);
- INIT_LIST_HEAD(&dst->directory);
- INIT_LIST_HEAD(&dst->dir_queries);
+ list_head_init(&dst->registry);
+ list_head_init(&dst->directory);
+ list_head_init(&dst->dir_queries);
/* init the locks */
pthread_rwlock_init(&dst->reg_lock, NULL);
@@ -437,7 +437,7 @@ struct dir_query * ipcp_data_dir_query_create(char * name)
pthread_cond_init(&query->cond, &cattr);
pthread_mutex_init(&query->lock, NULL);
- INIT_LIST_HEAD(&query->next);
+ list_head_init(&query->next);
return query;
}
diff --git a/src/ipcpd/normal/ribmgr.c b/src/ipcpd/normal/ribmgr.c
index e52db08a..6356d48c 100644
--- a/src/ipcpd/normal/ribmgr.c
+++ b/src/ipcpd/normal/ribmgr.c
@@ -471,9 +471,9 @@ static int write_ro_msg(struct cdap * neighbor,
int ribmgr_init()
{
- INIT_LIST_HEAD(&rib.flows);
- INIT_LIST_HEAD(&rib.subs);
- INIT_LIST_HEAD(&rib.ro_ids);
+ list_head_init(&rib.flows);
+ list_head_init(&rib.subs);
+ list_head_init(&rib.ro_ids);
rib.root = malloc(sizeof(*(rib.root)));
if (rib.root == NULL)
@@ -993,7 +993,7 @@ static int ro_id_create(char * name, ro_msg_t * msg)
tmp->seqno = msg->seqno;
tmp->full_name = strdup(name);
- INIT_LIST_HEAD(&tmp->next);
+ list_head_init(&tmp->next);
if (tmp->full_name == NULL) {
free(tmp);
@@ -1154,7 +1154,7 @@ static int ribmgr_add_flow(int fd)
return -1;
}
- INIT_LIST_HEAD(&flow->next);
+ list_head_init(&flow->next);
flow->instance = instance;
flow->fd = fd;
@@ -1310,7 +1310,7 @@ int ribmgr_enrol()
pthread_rwlock_wrlock(&rib.flows_lock);
- assert(!list_empty(&rib.flows));
+ assert(!list_is_empty(&rib.flows));
flow = list_first_entry((&rib.flows), struct mgmt_flow, next);
instance = flow->instance;
@@ -1631,7 +1631,7 @@ int ro_subscribe(const char * name, struct ro_sub_ops * ops)
if (sub == NULL)
return -ENOMEM;
- INIT_LIST_HEAD(&sub->next);
+ list_head_init(&sub->next);
sub->name = strdup(name);
if (sub->name == NULL) {
diff --git a/src/ipcpd/timerwheel.c b/src/ipcpd/timerwheel.c
index 4ef7ce2f..1d842c8f 100644
--- a/src/ipcpd/timerwheel.c
+++ b/src/ipcpd/timerwheel.c
@@ -232,7 +232,7 @@ struct timerwheel * timerwheel_create(unsigned int resolution,
tw->intv.tv_sec = (tw->resolution / FRAC) / 1000;
tw->intv.tv_nsec = ((tw->resolution / FRAC) % 1000) * MILLION;
- INIT_LIST_HEAD(&tw->wq);
+ list_head_init(&tw->wq);
if (pthread_mutex_init(&tw->lock, NULL)) {
LOG_DBG("Could not init mutex.");
@@ -265,7 +265,7 @@ struct timerwheel * timerwheel_create(unsigned int resolution,
now.tv_nsec -= (now.tv_nsec % MILLION);
for (i = 0; i < tw->elements; ++i) {
- INIT_LIST_HEAD(&tw->wheel[i].funcs);
+ list_head_init(&tw->wheel[i].funcs);
tw->wheel[i].expiry = now;
ts_add(&now, &res_ts, &now);
}