stuff2
This commit is contained in:
@@ -1,30 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#define TAILQ_HEAD(type) \
|
||||
#define tailq_head(type) \
|
||||
struct { \
|
||||
type* tqh_first; \
|
||||
type** tqh_last; \
|
||||
}
|
||||
|
||||
#define TAILQ_LINK(type) \
|
||||
#define tailq_link(type) \
|
||||
struct { \
|
||||
type* tqe_next; \
|
||||
type** tqe_prev; \
|
||||
}
|
||||
|
||||
#define TAILQ_INIT(head) \
|
||||
#define tailq_init(head) \
|
||||
do { \
|
||||
(head)->tqh_first = nullptr; \
|
||||
(head)->tqh_last = &(head)->tqh_first; \
|
||||
} while (0)
|
||||
|
||||
#define TAILQ_FIRST(head) ((head)->tqh_first)
|
||||
#define tailq_first(head) ((head)->tqh_first)
|
||||
|
||||
#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
|
||||
#define tailq_next(elm, field) ((elm)->field.tqe_next)
|
||||
|
||||
#define TAILQ_EMPTY(head) (TAILQ_FIRST(head) == nullptr)
|
||||
#define tailq_empty(head) (tailq_first(head) == nullptr)
|
||||
|
||||
#define TAILQ_INSERT_TAIL(head, elm, field) \
|
||||
#define tailq_insert_tail(head, elm, field) \
|
||||
do { \
|
||||
(elm)->field.tqe_next = nullptr; \
|
||||
(elm)->field.tqe_prev = (head)->tqh_last; \
|
||||
@@ -32,7 +32,7 @@
|
||||
(head)->tqh_last = &(elm)->field.tqe_next; \
|
||||
} while (0)
|
||||
|
||||
#define TAILQ_INSERT_HEAD(head, elm, field) \
|
||||
#define tailq_insert_head(head, elm, field) \
|
||||
do { \
|
||||
if (((elm)->field.tqe_next = (head)->tqh_first) != nullptr) \
|
||||
(head)->tqh_first->field.tqe_prev = &(elm)->field.tqe_next; \
|
||||
@@ -42,7 +42,7 @@
|
||||
(elm)->field.tqe_prev = &(head)->tqh_first; \
|
||||
} while (0)
|
||||
|
||||
#define TAILQ_REMOVE(head, elm, field) \
|
||||
#define tailq_remove(head, elm, field) \
|
||||
do { \
|
||||
if (((elm)->field.tqe_next) != nullptr) \
|
||||
(elm)->field.tqe_next->field.tqe_prev = (elm)->field.tqe_prev; \
|
||||
|
||||
Reference in New Issue
Block a user