Lines Matching refs:stack

28 ZEND_API void zend_ptr_stack_init_ex(zend_ptr_stack *stack, zend_bool persistent)  in zend_ptr_stack_init_ex()  argument
30 stack->top_element = stack->elements = NULL; in zend_ptr_stack_init_ex()
31 stack->top = stack->max = 0; in zend_ptr_stack_init_ex()
32 stack->persistent = persistent; in zend_ptr_stack_init_ex()
35 ZEND_API void zend_ptr_stack_init(zend_ptr_stack *stack) in zend_ptr_stack_init() argument
37 zend_ptr_stack_init_ex(stack, 0); in zend_ptr_stack_init()
41 ZEND_API void zend_ptr_stack_n_push(zend_ptr_stack *stack, int count, ...) in zend_ptr_stack_n_push() argument
46 ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, count) in zend_ptr_stack_n_push()
51 stack->top++; in zend_ptr_stack_n_push()
52 *(stack->top_element++) = elem; in zend_ptr_stack_n_push()
59 ZEND_API void zend_ptr_stack_n_pop(zend_ptr_stack *stack, int count, ...) in zend_ptr_stack_n_pop() argument
67 *elem = *(--stack->top_element); in zend_ptr_stack_n_pop()
68 stack->top--; in zend_ptr_stack_n_pop()
76 ZEND_API void zend_ptr_stack_destroy(zend_ptr_stack *stack) in zend_ptr_stack_destroy() argument
78 if (stack->elements) { in zend_ptr_stack_destroy()
79 pefree(stack->elements, stack->persistent); in zend_ptr_stack_destroy()
84 ZEND_API void zend_ptr_stack_apply(zend_ptr_stack *stack, void (*func)(void *)) in zend_ptr_stack_apply() argument
86 int i = stack->top; in zend_ptr_stack_apply()
89 func(stack->elements[i]); in zend_ptr_stack_apply()
94 ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *), zend_bool free_elem… in zend_ptr_stack_clean() argument
96 zend_ptr_stack_apply(stack, func); in zend_ptr_stack_clean()
98 int i = stack->top; in zend_ptr_stack_clean()
101 pefree(stack->elements[i], stack->persistent); in zend_ptr_stack_clean()
104 stack->top = 0; in zend_ptr_stack_clean()
105 stack->top_element = stack->elements; in zend_ptr_stack_clean()
109 ZEND_API int zend_ptr_stack_num_elements(zend_ptr_stack *stack) in zend_ptr_stack_num_elements() argument
111 return stack->top; in zend_ptr_stack_num_elements()