Blender  V3.3
Macros
BLI_link_utils.h File Reference

Single link-list utility macros. (header only api). More...

Go to the source code of this file.

Macros

#define BLI_LINKS_PREPEND(list, link)
 
#define BLI_LINKS_APPEND(list, link)
 
#define BLI_LINKS_INSERT_AFTER(list, node, link)
 
#define BLI_LINKS_FREE(list)
 

Detailed Description

Single link-list utility macros. (header only api).

Use this api when the structure defines its own next pointer and a double linked list such as ListBase isn't needed.

Definition in file BLI_link_utils.h.

Macro Definition Documentation

◆ BLI_LINKS_APPEND

#define BLI_LINKS_APPEND (   list,
  link 
)
Value:
{ \
(link)->next = NULL; \
if ((list)->first) { \
(list)->last->next = link; \
} \
else { \
(list)->first = link; \
} \
(list)->last = link; \
} \
(void)0
SyclQueue void void size_t num_bytes void
static ulong * next

Definition at line 22 of file BLI_link_utils.h.

◆ BLI_LINKS_FREE

#define BLI_LINKS_FREE (   list)
Value:
{ \
while (list) { \
void *next = (list)->next; \
MEM_freeN(list); \
list = next; \
} \
} \
(void)0

Definition at line 46 of file BLI_link_utils.h.

◆ BLI_LINKS_INSERT_AFTER

#define BLI_LINKS_INSERT_AFTER (   list,
  node,
  link 
)
Value:
{ \
if ((node)->next == NULL) { \
(list)->last = link; \
} \
(link)->next = (node)->next; \
(node)->next = link; \
} \
(void)0
OperationNode * node

Definition at line 36 of file BLI_link_utils.h.

◆ BLI_LINKS_PREPEND

#define BLI_LINKS_PREPEND (   list,
  link 
)
Value:
{ \
CHECK_TYPE_PAIR(list, link); \
(link)->next = list; \
list = link; \
} \
(void)0

Definition at line 13 of file BLI_link_utils.h.