14#define LL_NEW() NEW(LinkedList)
16#define LL_EMPTY(ll) (ll.ll_head == NULL)
27 this.ll_tail = (tail) ? tail.ll_next = n : this.ll_head = n;
37 if (!this.ll_tail)
return NULL;
42 else this.ll_head = this.ll_tail =
NULL;
47#define LL_CLEAR(...) EVAL_LL_CLEAR(OVERLOAD(LL_CLEAR, __VA_ARGS__))
48#define EVAL_LL_CLEAR(...) __VA_ARGS__
49#define LL_CLEAR_1(this) LL_CLEAR_2(this, LAMBDA())
50#define LL_CLEAR_2(this, dtor) \
52 LinkedList _ll = this; \
56 entity it = LL_POP(_ll); \
63#define LL_DELETE(...) EVAL_LL_DELETE(OVERLOAD(LL_DELETE, __VA_ARGS__))
64#define EVAL_LL_DELETE(...) __VA_ARGS__
65#define LL_DELETE_1(this) LL_DELETE_2(this, LAMBDA())
66#define LL_DELETE_2(this, dtor) \
68 LL_CLEAR_2(this, dtor); \
73#define LL_EACH(list, cond, body) \
76 for (entity _it = list.ll_head; _it; (_it = _it.ll_next, ++i)) \
78 ITER_CONST noref entity it = _it.ll_data; \
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
ATTRIB(LinkedListNode, ll_data, entity)
ATTRIB(LinkedList, ll_head, LinkedListNode)
entity LL_POP(LinkedList this)
Pop from tail.
entity LL_PUSH(LinkedList this, entity e)
Push to tail.