Blender
V3.3
|
Go to the source code of this file.
Macros | |
#define | STACK_DECLARE(stack) unsigned int _##stack##_index |
#define | STACK_INIT(stack, stack_num) ((void)stack, (void)((_##stack##_index) = 0), (void)(0 ? (stack_num) : 0)) |
#define | _STACK_SIZETEST(stack, off) (void)(stack), (void)(off) |
#define | _STACK_SWAP_TOTALLOC(stack_a, stack_b) (void)(stack_a), (void)(stack_b) |
#define | _STACK_BOUNDSTEST(stack, index) ((void)stack, BLI_assert((unsigned int)(index) < _##stack##_index)) |
#define | STACK_SIZE(stack) ((void)stack, (_##stack##_index)) |
#define | STACK_CLEAR(stack) |
#define | STACK_PUSH(stack, val) ((void)stack, _STACK_SIZETEST(stack, 1), ((stack)[(_##stack##_index)++] = (val))) |
#define | STACK_PUSH_RET(stack) ((void)stack, _STACK_SIZETEST(stack, 1), ((stack)[(_##stack##_index)++])) |
#define | STACK_PUSH_RET_PTR(stack) ((void)stack, _STACK_SIZETEST(stack, 1), &((stack)[(_##stack##_index)++])) |
#define | STACK_POP(stack) ((_##stack##_index) ? ((stack)[--(_##stack##_index)]) : NULL) |
#define | STACK_POP_PTR(stack) ((_##stack##_index) ? &((stack)[--(_##stack##_index)]) : NULL) |
#define | STACK_POP_DEFAULT(stack, r) ((_##stack##_index) ? ((stack)[--(_##stack##_index)]) : (r)) |
#define | STACK_PEEK(stack) (BLI_assert(_##stack##_index), ((stack)[_##stack##_index - 1])) |
#define | STACK_PEEK_PTR(stack) (BLI_assert(_##stack##_index), &((stack)[_##stack##_index - 1])) |
#define | STACK_REMOVE(stack, i) |
#define | STACK_DISCARD(stack, n) |
#define | STACK_SWAP(stack_a, stack_b) |
Macro's for a simple array based stack
Definition in file BLI_utildefines_stack.h.
#define _STACK_BOUNDSTEST | ( | stack, | |
index | |||
) | ((void)stack, BLI_assert((unsigned int)(index) < _##stack##_index)) |
Definition at line 28 of file BLI_utildefines_stack.h.
Definition at line 25 of file BLI_utildefines_stack.h.
Definition at line 26 of file BLI_utildefines_stack.h.
#define STACK_CLEAR | ( | stack | ) |
Definition at line 32 of file BLI_utildefines_stack.h.
#define STACK_DECLARE | ( | stack | ) | unsigned int _##stack##_index |
Definition at line 22 of file BLI_utildefines_stack.h.
#define STACK_DISCARD | ( | stack, | |
n | |||
) |
Definition at line 62 of file BLI_utildefines_stack.h.
#define STACK_INIT | ( | stack, | |
stack_num | |||
) | ((void)stack, (void)((_##stack##_index) = 0), (void)(0 ? (stack_num) : 0)) |
Definition at line 23 of file BLI_utildefines_stack.h.
#define STACK_PEEK | ( | stack | ) | (BLI_assert(_##stack##_index), ((stack)[_##stack##_index - 1])) |
look at last item (assumes non-empty stack)
Definition at line 50 of file BLI_utildefines_stack.h.
#define STACK_PEEK_PTR | ( | stack | ) | (BLI_assert(_##stack##_index), &((stack)[_##stack##_index - 1])) |
Definition at line 51 of file BLI_utildefines_stack.h.
take last item from stack
Definition at line 46 of file BLI_utildefines_stack.h.
Definition at line 48 of file BLI_utildefines_stack.h.
Definition at line 47 of file BLI_utildefines_stack.h.
#define STACK_PUSH | ( | stack, | |
val | |||
) | ((void)stack, _STACK_SIZETEST(stack, 1), ((stack)[(_##stack##_index)++] = (val))) |
add item to stack
Definition at line 39 of file BLI_utildefines_stack.h.
#define STACK_PUSH_RET | ( | stack | ) | ((void)stack, _STACK_SIZETEST(stack, 1), ((stack)[(_##stack##_index)++])) |
Definition at line 41 of file BLI_utildefines_stack.h.
#define STACK_PUSH_RET_PTR | ( | stack | ) | ((void)stack, _STACK_SIZETEST(stack, 1), &((stack)[(_##stack##_index)++])) |
Definition at line 43 of file BLI_utildefines_stack.h.
#define STACK_REMOVE | ( | stack, | |
i | |||
) |
remove any item from the stack, take care, re-orders
Definition at line 53 of file BLI_utildefines_stack.h.
Definition at line 31 of file BLI_utildefines_stack.h.
#define STACK_SWAP | ( | stack_a, | |
stack_b | |||
) |
Definition at line 79 of file BLI_utildefines_stack.h.