Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
linkedlist.qh File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  LinkedList
class  LinkedListNode

Macros

#define EVAL_LL_CLEAR(...)
#define EVAL_LL_DELETE(...)
#define LL_CLEAR(...)
#define LL_CLEAR_1(this)
#define LL_CLEAR_2(this, dtor)
#define LL_DELETE(...)
#define LL_DELETE_1(this)
#define LL_DELETE_2(this, dtor)
#define LL_EACH(list, cond, body)
#define LL_EMPTY(ll)
#define LL_NEW()

Functions

entity LL_POP (LinkedList this)
 Pop from tail.
entity LL_PUSH (LinkedList this, entity e)
 Push to tail.

Macro Definition Documentation

◆ EVAL_LL_CLEAR

#define EVAL_LL_CLEAR ( ...)
Value:
__VA_ARGS__

Definition at line 48 of file linkedlist.qh.

◆ EVAL_LL_DELETE

#define EVAL_LL_DELETE ( ...)
Value:
__VA_ARGS__

Definition at line 64 of file linkedlist.qh.

◆ LL_CLEAR

#define LL_CLEAR ( ...)
Value:
#define LL_CLEAR(...)
Definition linkedlist.qh:47
#define EVAL_LL_CLEAR(...)
Definition linkedlist.qh:48
#define OVERLOAD(F,...)
Definition misc.qh:12

Definition at line 47 of file linkedlist.qh.

◆ LL_CLEAR_1

#define LL_CLEAR_1 ( this)
Value:
#define LL_CLEAR_2(this, dtor)
Definition linkedlist.qh:50
#define LAMBDA(...)
Definition misc.qh:34

Definition at line 49 of file linkedlist.qh.

◆ LL_CLEAR_2

#define LL_CLEAR_2 ( this,
dtor )
Value:
MACRO_BEGIN \
LinkedList _ll = this; \
assert(_ll); \
while (_ll.ll_tail) \
{ \
entity it = LL_POP(_ll); \
if (!it) continue; \
dtor \
delete(it); \
} \
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
entity LL_POP(LinkedList this)
Pop from tail.
Definition linkedlist.qh:34
#define MACRO_END
Definition macro.qh:7

Definition at line 50 of file linkedlist.qh.

50#define LL_CLEAR_2(this, dtor) \
51 MACRO_BEGIN \
52 LinkedList _ll = this; \
53 assert(_ll); \
54 while (_ll.ll_tail) \
55 { \
56 entity it = LL_POP(_ll); \
57 if (!it) continue; \
58 dtor \
59 delete(it); \
60 } \
61 MACRO_END

◆ LL_DELETE

#define LL_DELETE ( ...)
Value:
#define LL_DELETE(...)
Definition linkedlist.qh:63
#define EVAL_LL_DELETE(...)
Definition linkedlist.qh:64

Definition at line 63 of file linkedlist.qh.

Referenced by cl_notice_run().

◆ LL_DELETE_1

#define LL_DELETE_1 ( this)
Value:
#define LL_DELETE_2(this, dtor)
Definition linkedlist.qh:66

Definition at line 65 of file linkedlist.qh.

◆ LL_DELETE_2

#define LL_DELETE_2 ( this,
dtor )
Value:
MACRO_BEGIN \
LL_CLEAR_2(this, dtor); \
delete(this); \
this = NULL; \
#define NULL
Definition post.qh:14

Definition at line 66 of file linkedlist.qh.

66#define LL_DELETE_2(this, dtor) \
67 MACRO_BEGIN \
68 LL_CLEAR_2(this, dtor); \
69 delete(this); \
70 this = NULL; \
71 MACRO_END

◆ LL_EACH

#define LL_EACH ( list,
cond,
body )
Value:
MACRO_BEGIN \
noref int i = 0; \
for (entity _it = list.ll_head; _it; (_it = _it.ll_next, ++i)) \
{ \
ITER_CONST noref entity it = _it.ll_data; \
if (cond) { body } \
} \
#define ITER_CONST
Definition iter.qh:4

Definition at line 73 of file linkedlist.qh.

73#define LL_EACH(list, cond, body) \
74 MACRO_BEGIN \
75 noref int i = 0; \
76 for (entity _it = list.ll_head; _it; (_it = _it.ll_next, ++i)) \
77 { \
78 ITER_CONST noref entity it = _it.ll_data; \
79 if (cond) { body } \
80 } \
81 MACRO_END

Referenced by cl_notice_run(), Draw_ShowNames(), and Draw_ShowNames_All().

◆ LL_EMPTY

#define LL_EMPTY ( ll)
Value:
(ll.ll_head == NULL)

Definition at line 16 of file linkedlist.qh.

◆ LL_NEW

#define LL_NEW ( )
Value:
#define NEW(cname,...)
Definition oo.qh:117

Definition at line 14 of file linkedlist.qh.

Referenced by cl_notice_read(), and STATIC_INIT().

Function Documentation

◆ LL_POP()

entity LL_POP ( LinkedList this)

Pop from tail.

Definition at line 34 of file linkedlist.qh.

35{
36 assert(this);
37 if (!this.ll_tail) return NULL;
38 LinkedListNode n = this.ll_tail;
39 entity e = n.ll_data;
40 LinkedListNode prev = n.ll_prev;
41 if (prev) (this.ll_tail = prev).ll_next = NULL;
42 else this.ll_head = this.ll_tail = NULL;
43 delete(n);
44 return e;
45}
prev
Definition all.qh:71
#define assert(expr,...)
Definition log.qh:8

References assert, entity(), NULL, and prev.

◆ LL_PUSH()

entity LL_PUSH ( LinkedList this,
entity e )

Push to tail.

Definition at line 21 of file linkedlist.qh.

22{
23 assert(this);
25 n.ll_data = e;
26 LinkedListNode tail = n.ll_prev = this.ll_tail;
27 this.ll_tail = (tail) ? tail.ll_next = n : this.ll_head = n;
28 return e;
29}
entity this
Definition self.qh:72

References assert, entity(), and NEW.

Referenced by cl_notice_read(), and STATIC_INIT().