Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Rename list_* to elist_*, to avoid conflicting with mysql (grumble)

  • Loading branch information...
commit 8e7fffde1ad3567a205f79d9e772fed3b7c45825 1 parent 2817e1d
Jeff Garzik authored Jeff Garzik committed
View
18 anet.c
@@ -35,7 +35,7 @@ void tcp_read_init(struct tcp_read_state *rst, int fd, void *priv)
rst->fd = fd;
rst->priv = priv;
- INIT_LIST_HEAD(&rst->q);
+ INIT_ELIST_HEAD(&rst->q);
}
void tcp_read_free(struct tcp_read_state *rst)
@@ -43,8 +43,8 @@ void tcp_read_free(struct tcp_read_state *rst)
struct tcp_read *rd, *tmp;
bool ok = true;
- list_for_each_entry_safe(rd, tmp, &rst->q, node) {
- list_del(&rd->node);
+ elist_for_each_entry_safe(rd, tmp, &rst->q, node) {
+ elist_del(&rd->node);
if (rd->cb)
ok = rd->cb(rst->priv, rd->priv, 0, false);
@@ -73,9 +73,9 @@ bool tcp_read(struct tcp_read_state *rst,
rd->len = buflen;
rd->cb = cb;
rd->priv = priv;
- INIT_LIST_HEAD(&rd->node);
+ INIT_ELIST_HEAD(&rd->node);
- list_add_tail(&rd->node, &rst->q);
+ elist_add_tail(&rd->node, &rst->q);
return true;
}
@@ -99,9 +99,9 @@ bool tcp_read_inf(struct tcp_read_state *rst,
rd->check_compl_cb = check_compl_cb;
rd->cb = cb;
rd->priv = priv;
- INIT_LIST_HEAD(&rd->node);
+ INIT_ELIST_HEAD(&rd->node);
- list_add_tail(&rd->node, &rst->q);
+ elist_add_tail(&rd->node, &rst->q);
return true;
}
@@ -208,7 +208,7 @@ static int tcp_read_exec(struct tcp_read_state *rst, struct tcp_read *rd)
if (rd->cb)
ok = rd->cb(rst->priv, rd->priv, rd->curlen, true);
- list_del(&rd->node);
+ elist_del(&rd->node);
memset(rd, 0, sizeof(*rd)); /* poison */
free(rd);
@@ -221,7 +221,7 @@ bool tcp_read_runq(struct tcp_read_state *rst)
struct tcp_read *rd, *tmp;
bool ok = true;
- list_for_each_entry_safe(rd, tmp, &rst->q, node) {
+ elist_for_each_entry_safe(rd, tmp, &rst->q, node) {
int rc;
rc = tcp_read_exec(rst, rd);
View
4 anet.h
@@ -14,11 +14,11 @@ struct tcp_read {
bool (*cb)(void *, void *,
unsigned int, bool); /* callback*/
void *priv; /* app-private callback arg */
- struct list_head node;
+ struct elist_head node;
};
struct tcp_read_state {
- struct list_head q; /* read queue */
+ struct elist_head q; /* read queue */
int fd; /* network socket fd */
void *priv; /* app-specific data */
View
6 config.c
@@ -144,13 +144,13 @@ static void parse_listen(const json_t *listeners)
lc->proto = LP_BC_BINARY;
}
- INIT_LIST_HEAD(&lc->listeners_node);
+ INIT_ELIST_HEAD(&lc->listeners_node);
if (host_str)
lc->host = strdup(host_str);
lc->port = port;
- list_add_tail(&lc->listeners_node, &srv.listeners);
+ elist_add_tail(&lc->listeners_node, &srv.listeners);
}
}
@@ -234,7 +234,7 @@ void read_config(void)
parse_listen(json_object_get(jcfg, "listen"));
parse_database(json_object_get(jcfg, "database"));
- if (list_empty(&srv.listeners)) {
+ if (elist_empty(&srv.listeners)) {
applog(LOG_ERR, "error: no listen addresses specified");
exit(1);
}
View
116 elist.h
@@ -11,16 +11,16 @@
* using the generic single-entry routines.
*/
-struct list_head {
- struct list_head *next, *prev;
+struct elist_head {
+ struct elist_head *next, *prev;
};
-#define LIST_HEAD_INIT(name) { &(name), &(name) }
+#define ELIST_HEAD_INIT(name) { &(name), &(name) }
-#define LIST_HEAD(name) \
- struct list_head name = LIST_HEAD_INIT(name)
+#define ELIST_HEAD(name) \
+ struct elist_head name = ELIST_HEAD_INIT(name)
-#define INIT_LIST_HEAD(ptr) do { \
+#define INIT_ELIST_HEAD(ptr) do { \
(ptr)->next = (ptr); (ptr)->prev = (ptr); \
} while (0)
@@ -30,9 +30,9 @@ struct list_head {
* This is only for internal list manipulation where we know
* the prev/next entries already!
*/
-static inline void __list_add(struct list_head *new,
- struct list_head *prev,
- struct list_head *next)
+static inline void __list_add(struct elist_head *new,
+ struct elist_head *prev,
+ struct elist_head *next)
{
next->prev = new;
new->next = next;
@@ -41,27 +41,27 @@ static inline void __list_add(struct list_head *new,
}
/**
- * list_add - add a new entry
+ * elist_add - add a new entry
* @new: new entry to be added
* @head: list head to add it after
*
* Insert a new entry after the specified head.
* This is good for implementing stacks.
*/
-static inline void list_add(struct list_head *new, struct list_head *head)
+static inline void elist_add(struct elist_head *new, struct elist_head *head)
{
__list_add(new, head, head->next);
}
/**
- * list_add_tail - add a new entry
+ * elist_add_tail - add a new entry
* @new: new entry to be added
* @head: list head to add it before
*
* Insert a new entry before the specified head.
* This is useful for implementing queues.
*/
-static inline void list_add_tail(struct list_head *new, struct list_head *head)
+static inline void elist_add_tail(struct elist_head *new, struct elist_head *head)
{
__list_add(new, head->prev, head);
}
@@ -73,18 +73,18 @@ static inline void list_add_tail(struct list_head *new, struct list_head *head)
* This is only for internal list manipulation where we know
* the prev/next entries already!
*/
-static inline void __list_del(struct list_head *prev, struct list_head *next)
+static inline void __list_del(struct elist_head *prev, struct elist_head *next)
{
next->prev = prev;
prev->next = next;
}
/**
- * list_del - deletes entry from list.
+ * elist_del - deletes entry from list.
* @entry: the element to delete from the list.
- * Note: list_empty on entry does not return true after this, the entry is in an undefined state.
+ * Note: elist_empty on entry does not return true after this, the entry is in an undefined state.
*/
-static inline void list_del(struct list_head *entry)
+static inline void elist_del(struct elist_head *entry)
{
__list_del(entry->prev, entry->next);
entry->next = (void *) 0;
@@ -92,13 +92,13 @@ static inline void list_del(struct list_head *entry)
}
/**
- * list_del_init - deletes entry from list and reinitialize it.
+ * elist_del_init - deletes entry from list and reinitialize it.
* @entry: the element to delete from the list.
*/
-static inline void list_del_init(struct list_head *entry)
+static inline void elist_del_init(struct elist_head *entry)
{
__list_del(entry->prev, entry->next);
- INIT_LIST_HEAD(entry);
+ INIT_ELIST_HEAD(entry);
}
/**
@@ -106,10 +106,10 @@ static inline void list_del_init(struct list_head *entry)
* @list: the entry to move
* @head: the head that will precede our entry
*/
-static inline void list_move(struct list_head *list, struct list_head *head)
+static inline void list_move(struct elist_head *list, struct elist_head *head)
{
__list_del(list->prev, list->next);
- list_add(list, head);
+ elist_add(list, head);
}
/**
@@ -117,28 +117,28 @@ static inline void list_move(struct list_head *list, struct list_head *head)
* @list: the entry to move
* @head: the head that will follow our entry
*/
-static inline void list_move_tail(struct list_head *list,
- struct list_head *head)
+static inline void list_move_tail(struct elist_head *list,
+ struct elist_head *head)
{
__list_del(list->prev, list->next);
- list_add_tail(list, head);
+ elist_add_tail(list, head);
}
/**
- * list_empty - tests whether a list is empty
+ * elist_empty - tests whether a list is empty
* @head: the list to test.
*/
-static inline int list_empty(struct list_head *head)
+static inline int elist_empty(struct elist_head *head)
{
return head->next == head;
}
-static inline void __list_splice(struct list_head *list,
- struct list_head *head)
+static inline void __list_splice(struct elist_head *list,
+ struct elist_head *head)
{
- struct list_head *first = list->next;
- struct list_head *last = list->prev;
- struct list_head *at = head->next;
+ struct elist_head *first = list->next;
+ struct elist_head *last = list->prev;
+ struct elist_head *at = head->next;
first->prev = head;
head->next = first;
@@ -152,9 +152,9 @@ static inline void __list_splice(struct list_head *list,
* @list: the new list to add.
* @head: the place to add it in the first list.
*/
-static inline void list_splice(struct list_head *list, struct list_head *head)
+static inline void list_splice(struct elist_head *list, struct elist_head *head)
{
- if (!list_empty(list))
+ if (!elist_empty(list))
__list_splice(list, head);
}
@@ -165,35 +165,35 @@ static inline void list_splice(struct list_head *list, struct list_head *head)
*
* The list at @list is reinitialised
*/
-static inline void list_splice_init(struct list_head *list,
- struct list_head *head)
+static inline void list_splice_init(struct elist_head *list,
+ struct elist_head *head)
{
- if (!list_empty(list)) {
+ if (!elist_empty(list)) {
__list_splice(list, head);
- INIT_LIST_HEAD(list);
+ INIT_ELIST_HEAD(list);
}
}
/**
- * list_entry - get the struct for this entry
- * @ptr: the &struct list_head pointer.
+ * elist_entry - get the struct for this entry
+ * @ptr: the &struct elist_head pointer.
* @type: the type of the struct this is embedded in.
* @member: the name of the list_struct within the struct.
*/
-#define list_entry(ptr, type, member) \
+#define elist_entry(ptr, type, member) \
((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
/**
- * list_for_each - iterate over a list
- * @pos: the &struct list_head to use as a loop counter.
+ * elist_for_each - iterate over a list
+ * @pos: the &struct elist_head to use as a loop counter.
* @head: the head for your list.
*/
-#define list_for_each(pos, head) \
+#define elist_for_each(pos, head) \
for (pos = (head)->next; pos != (head); \
pos = pos->next)
/**
* list_for_each_prev - iterate over a list backwards
- * @pos: the &struct list_head to use as a loop counter.
+ * @pos: the &struct elist_head to use as a loop counter.
* @head: the head for your list.
*/
#define list_for_each_prev(pos, head) \
@@ -202,8 +202,8 @@ static inline void list_splice_init(struct list_head *list,
/**
* list_for_each_safe - iterate over a list safe against removal of list entry
- * @pos: the &struct list_head to use as a loop counter.
- * @n: another &struct list_head to use as temporary storage
+ * @pos: the &struct elist_head to use as a loop counter.
+ * @n: another &struct elist_head to use as temporary storage
* @head: the head for your list.
*/
#define list_for_each_safe(pos, n, head) \
@@ -211,28 +211,28 @@ static inline void list_splice_init(struct list_head *list,
pos = n, n = pos->next)
/**
- * list_for_each_entry - iterate over list of given type
+ * elist_for_each_entry - iterate over list of given type
* @pos: the type * to use as a loop counter.
* @head: the head for your list.
* @member: the name of the list_struct within the struct.
*/
-#define list_for_each_entry(pos, head, member) \
- for (pos = list_entry((head)->next, typeof(*pos), member); \
+#define elist_for_each_entry(pos, head, member) \
+ for (pos = elist_entry((head)->next, typeof(*pos), member); \
&pos->member != (head); \
- pos = list_entry(pos->member.next, typeof(*pos), member))
+ pos = elist_entry(pos->member.next, typeof(*pos), member))
/**
- * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
+ * elist_for_each_entry_safe - iterate over list of given type safe against removal of list entry
* @pos: the type * to use as a loop counter.
* @n: another type * to use as temporary storage
* @head: the head for your list.
* @member: the name of the list_struct within the struct.
*/
-#define list_for_each_entry_safe(pos, n, head, member) \
- for (pos = list_entry((head)->next, typeof(*pos), member), \
- n = list_entry(pos->member.next, typeof(*pos), member); \
+#define elist_for_each_entry_safe(pos, n, head, member) \
+ for (pos = elist_entry((head)->next, typeof(*pos), member), \
+ n = elist_entry(pos->member.next, typeof(*pos), member); \
&pos->member != (head); \
- pos = n, n = list_entry(n->member.next, typeof(*n), member))
+ pos = n, n = elist_entry(n->member.next, typeof(*n), member))
/**
* list_for_each_entry_continue - iterate over list of given type
@@ -242,10 +242,10 @@ static inline void list_splice_init(struct list_head *list,
* @member: the name of the list_struct within the struct.
*/
#define list_for_each_entry_continue(pos, head, member) \
- for (pos = list_entry(pos->member.next, typeof(*pos), member), \
+ for (pos = elist_entry(pos->member.next, typeof(*pos), member), \
prefetch(pos->member.next); \
&pos->member != (head); \
- pos = list_entry(pos->member.next, typeof(*pos), member), \
+ pos = elist_entry(pos->member.next, typeof(*pos), member), \
prefetch(pos->member.next))
#endif
View
28 hist.c
@@ -14,17 +14,17 @@ enum {
struct hist_entry {
unsigned char hash[SHA256_DIGEST_LENGTH];
- struct list_head log_node;
- struct list_head tbl_node;
+ struct elist_head log_node;
+ struct elist_head tbl_node;
};
struct hist_bucket {
- struct list_head chain;
+ struct elist_head chain;
};
struct hist {
struct hist_bucket tbl[HIST_TBL_SZ];
- struct list_head log;
+ struct elist_head log;
unsigned int log_sz;
};
@@ -32,10 +32,10 @@ static void hist_expire(struct hist *hist)
{
struct hist_entry *ent;
- ent = list_entry(hist->log.next, struct hist_entry, log_node);
+ ent = elist_entry(hist->log.next, struct hist_entry, log_node);
- list_del_init(&ent->log_node);
- list_del_init(&ent->tbl_node);
+ elist_del_init(&ent->log_node);
+ elist_del_init(&ent->tbl_node);
hist->log_sz--;
@@ -54,15 +54,15 @@ bool hist_add(struct hist *hist, const unsigned char *hash)
return false;
memcpy(ent->hash, hash, SHA256_DIGEST_LENGTH);
- INIT_LIST_HEAD(&ent->log_node);
- INIT_LIST_HEAD(&ent->tbl_node);
+ INIT_ELIST_HEAD(&ent->log_node);
+ INIT_ELIST_HEAD(&ent->tbl_node);
/* add to log */
- list_add_tail(&ent->log_node, &hist->log);
+ elist_add_tail(&ent->log_node, &hist->log);
hist->log_sz++;
/* add to hash table */
- list_add_tail(&ent->tbl_node, &hist->tbl[bucket].chain);
+ elist_add_tail(&ent->tbl_node, &hist->tbl[bucket].chain);
/* expire old entries */
while (hist->log_sz > HIST_LOG_SZ)
@@ -77,7 +77,7 @@ bool hist_lookup(struct hist *hist, const unsigned char *hash)
uint32_t hash32 = *((const uint32_t *) hash);
int bucket = hash32 % HIST_TBL_SZ;
- list_for_each_entry(ent, &hist->tbl[bucket].chain, tbl_node) {
+ elist_for_each_entry(ent, &hist->tbl[bucket].chain, tbl_node) {
if (!memcmp(hash, ent->hash, SHA256_DIGEST_LENGTH))
return true;
}
@@ -107,9 +107,9 @@ struct hist *hist_alloc(void)
return NULL;
for (i = 0; i < HIST_TBL_SZ; i++)
- INIT_LIST_HEAD(&hist->tbl[i].chain);
+ INIT_ELIST_HEAD(&hist->tbl[i].chain);
- INIT_LIST_HEAD(&hist->log);
+ INIT_ELIST_HEAD(&hist->log);
return hist;
}
View
26 htab.c
@@ -14,11 +14,11 @@ struct htab_entry {
void *key;
void *value;
unsigned long hash;
- struct list_head chain_node;
+ struct elist_head chain_node;
};
struct htab_bucket {
- struct list_head chain;
+ struct elist_head chain;
};
struct htab {
@@ -54,7 +54,7 @@ static void htab_init_buckets(struct htab_bucket *buckets, int sz)
int i;
for (i = 0; i < sz; i++) {
- INIT_LIST_HEAD(&buckets[i].chain);
+ INIT_ELIST_HEAD(&buckets[i].chain);
}
}
@@ -114,7 +114,7 @@ static void htab_free_ent(struct htab *htab, struct htab_entry *ent)
htab->free_value_fn(ent->value);
/* remove ourselves from the hash chain */
- list_del(&ent->chain_node);
+ elist_del(&ent->chain_node);
/* delete hash entry */
free(ent);
@@ -130,7 +130,7 @@ static void htab_clear(struct htab *htab)
/* remove each hash entry from each hash chain in each bucket */
for (bucket = 0; bucket < htab_sz(htab); bucket++) {
- list_for_each_entry_safe(ent, iter,
+ elist_for_each_entry_safe(ent, iter,
&htab->buckets[bucket].chain, chain_node) {
htab_free_ent(htab, ent);
}
@@ -180,16 +180,16 @@ static bool htab_resize(struct htab *htab)
for (bucket = 0; bucket < old_sz; bucket++) {
struct htab_entry *ent, *iter;
- list_for_each_entry_safe(ent, iter,
+ elist_for_each_entry_safe(ent, iter,
&htab->buckets[bucket].chain,
chain_node) {
unsigned int new_bucket;
- list_del_init(&ent->chain_node);
+ elist_del_init(&ent->chain_node);
new_bucket = ent->hash % new_sz;
- list_add_tail(&ent->chain_node,
+ elist_add_tail(&ent->chain_node,
&new_buckets[new_bucket].chain);
}
}
@@ -220,10 +220,10 @@ bool htab_put(struct htab *htab, void *key, void *value)
ent->key = key;
ent->value = value;
ent->hash = hash;
- INIT_LIST_HEAD(&ent->chain_node);
+ INIT_ELIST_HEAD(&ent->chain_node);
/* add hash entry to bucket's chain */
- list_add(&ent->chain_node, &htab->buckets[bucket].chain);
+ elist_add(&ent->chain_node, &htab->buckets[bucket].chain);
/* account for additional hash entry */
htab->n_ent++;
@@ -238,7 +238,7 @@ void *htab_get(struct htab *htab, const void *key)
unsigned int bucket = hash % htab_sz(htab);
/* search bucket's chain for key, returning first value found */
- list_for_each_entry(ent, &htab->buckets[bucket].chain, chain_node) {
+ elist_for_each_entry(ent, &htab->buckets[bucket].chain, chain_node) {
if ((ent->hash == hash) &&
(htab->cmp_fn(ent->key, key) == 0))
return ent->value;
@@ -255,7 +255,7 @@ bool htab_del(struct htab *htab, const void *key)
bool found = false;
/* search bucket's chain for key, deleting all matching entries */
- list_for_each_entry_safe(ent, iter,
+ elist_for_each_entry_safe(ent, iter,
&htab->buckets[bucket].chain, chain_node) {
if ((ent->hash == hash) &&
(htab->cmp_fn(ent->key, key) == 0)) {
@@ -274,7 +274,7 @@ void htab_foreach(struct htab *htab, htab_iter_fn iter_fn, void *userdata)
for (i = 0; i < htab_sz(htab); i++) {
struct htab_entry *ent, *iter;
- list_for_each_entry_safe(ent, iter,
+ elist_for_each_entry_safe(ent, iter,
&htab->buckets[i].chain, chain_node) {
iter_fn(ent->key, ent->value, userdata);
}
View
24 msg.c
@@ -36,7 +36,7 @@
struct worker {
char username[64 + 1];
- struct list_head log;
+ struct elist_head log;
};
struct work_ent {
@@ -44,8 +44,8 @@ struct work_ent {
time_t timestamp;
- struct list_head log_node;
- struct list_head srv_log_node;
+ struct elist_head log_node;
+ struct elist_head srv_log_node;
};
enum {
@@ -105,12 +105,12 @@ void worker_log_expire(time_t expire_time)
{
struct work_ent *ent, *iter;
- list_for_each_entry_safe(ent, iter, &srv.work_log, srv_log_node) {
+ elist_for_each_entry_safe(ent, iter, &srv.work_log, srv_log_node) {
if (ent->timestamp > expire_time)
break;
- list_del(&ent->srv_log_node);
- list_del(&ent->log_node);
+ elist_del(&ent->srv_log_node);
+ elist_del(&ent->log_node);
free(ent);
}
}
@@ -128,7 +128,7 @@ static void worker_log(const char *username, const unsigned char *data)
return;
strncpy(worker->username, username, sizeof(worker->username));
- INIT_LIST_HEAD(&worker->log);
+ INIT_ELIST_HEAD(&worker->log);
if (!htab_put(srv.workers, worker->username, worker))
return;
@@ -140,11 +140,11 @@ static void worker_log(const char *username, const unsigned char *data)
memcpy(ent->data, data, sizeof(ent->data));
ent->timestamp = now;
- INIT_LIST_HEAD(&ent->log_node);
- INIT_LIST_HEAD(&ent->srv_log_node);
+ INIT_ELIST_HEAD(&ent->log_node);
+ INIT_ELIST_HEAD(&ent->srv_log_node);
- list_add_tail(&ent->log_node, &worker->log);
- list_add_tail(&ent->srv_log_node, &srv.work_log);
+ elist_add_tail(&ent->log_node, &worker->log);
+ elist_add_tail(&ent->srv_log_node, &srv.work_log);
worker_log_expire(now - WORK_EXPIRE_INT);
}
@@ -158,7 +158,7 @@ static bool work_in_log(const char *username, const unsigned char *data)
if (!worker)
return false;
- list_for_each_entry(ent, &worker->log, log_node) {
+ elist_for_each_entry(ent, &worker->log, log_node) {
/* check submitted block matches sent block,
* excluding final 4 bytes (nonce)
*/
View
34 server.c
@@ -767,13 +767,13 @@ static void flush_lp_waiters(void)
{
struct genlist *tmp, *iter;
- list_for_each_entry_safe(tmp, iter, &srv.lp_waiters, node) {
+ elist_for_each_entry_safe(tmp, iter, &srv.lp_waiters, node) {
struct evhttp_request *req;
req = tmp->data;
http_handle_req(req, true);
- list_del(&tmp->node);
+ elist_del(&tmp->node);
memset(tmp, 0, sizeof(*tmp));
free(tmp);
}
@@ -808,9 +808,9 @@ static void __http_srv_event(struct evhttp_request *req, void *arg,
return;
gl->data = req;
- INIT_LIST_HEAD(&gl->node);
+ INIT_ELIST_HEAD(&gl->node);
- list_add_tail(&gl->node, &srv.lp_waiters);
+ elist_add_tail(&gl->node, &srv.lp_waiters);
}
/* otherwise, handle immediately */
@@ -850,7 +850,7 @@ static void net_sock_free(struct server_socket *sock)
if (!sock)
return;
- list_del_init(&sock->sockets_node);
+ elist_del_init(&sock->sockets_node);
if (sock->http)
evhttp_free(sock->http);
@@ -869,12 +869,12 @@ static void net_close(void)
struct server_socket *sock, *iter;
struct listen_cfg *cfg, *citer;
- list_for_each_entry_safe(sock, iter, &srv.sockets, sockets_node) {
+ elist_for_each_entry_safe(sock, iter, &srv.sockets, sockets_node) {
net_sock_free(sock);
}
- list_for_each_entry_safe(cfg, citer, &srv.listeners, listeners_node) {
- list_del_init(&cfg->listeners_node);
+ elist_for_each_entry_safe(cfg, citer, &srv.listeners, listeners_node) {
+ elist_del_init(&cfg->listeners_node);
free(cfg->host);
free(cfg->port_file);
memset(cfg, 0, sizeof(*cfg)); /* poison */
@@ -927,7 +927,7 @@ static int net_open_socket(const struct listen_cfg *cfg,
goto err_out_fd;
}
- INIT_LIST_HEAD(&sock->sockets_node);
+ INIT_ELIST_HEAD(&sock->sockets_node);
sock->fd = fd;
sock->cfg = cfg;
@@ -955,7 +955,7 @@ static int net_open_socket(const struct listen_cfg *cfg,
goto err_out_sock;
}
- list_add_tail(&sock->sockets_node, &srv.sockets);
+ elist_add_tail(&sock->sockets_node, &srv.sockets);
return fd;
@@ -1149,12 +1149,12 @@ int main (int argc, char *argv[])
{
error_t aprc;
int rc = 1;
- struct list_head *tmpl;
+ struct elist_head *tmpl;
- INIT_LIST_HEAD(&srv.listeners);
- INIT_LIST_HEAD(&srv.sockets);
- INIT_LIST_HEAD(&srv.work_log);
- INIT_LIST_HEAD(&srv.lp_waiters);
+ INIT_ELIST_HEAD(&srv.listeners);
+ INIT_ELIST_HEAD(&srv.sockets);
+ INIT_ELIST_HEAD(&srv.work_log);
+ INIT_ELIST_HEAD(&srv.lp_waiters);
/* isspace() and strcasecmp() consistency requires this */
setlocale(LC_ALL, "C");
@@ -1237,10 +1237,10 @@ int main (int argc, char *argv[])
}
/* set up server networking */
- list_for_each(tmpl, &srv.listeners) {
+ elist_for_each(tmpl, &srv.listeners) {
struct listen_cfg *tmpcfg;
- tmpcfg = list_entry(tmpl, struct listen_cfg, listeners_node);
+ tmpcfg = elist_entry(tmpl, struct listen_cfg, listeners_node);
rc = net_open_known(tmpcfg);
if (rc)
goto err_out_listen;
View
14 server.h
@@ -76,7 +76,7 @@ struct server_socket {
const struct listen_cfg *cfg;
struct event ev;
struct evhttp *http;
- struct list_head sockets_node;
+ struct elist_head sockets_node;
};
enum listen_protocol {
@@ -89,13 +89,13 @@ struct listen_cfg {
int port;
char *port_file;
enum listen_protocol proto;
- struct list_head listeners_node;
+ struct elist_head listeners_node;
};
struct genlist {
void *data;
size_t data_len;
- struct list_head node;
+ struct elist_head node;
};
struct server_db_ops {
@@ -147,16 +147,16 @@ struct server {
unsigned char cur_prevhash[32];
struct htab *workers;
- struct list_head work_log;
+ struct elist_head work_log;
struct htab *cred_cache;
unsigned int cred_expire;
- struct list_head lp_waiters;
+ struct elist_head lp_waiters;
bool disable_lp;
- struct list_head listeners;
- struct list_head sockets; /* points into listeners */
+ struct elist_head listeners;
+ struct elist_head sockets; /* points into listeners */
struct server_stats stats; /* global statistics */
};
Please sign in to comment.
Something went wrong with that request. Please try again.