Lines Matching refs:stack

26 ZEND_API void zend_ptr_stack_init_ex(zend_ptr_stack *stack, zend_bool persistent)  in zend_ptr_stack_init_ex()  argument
28 stack->top_element = stack->elements = NULL; in zend_ptr_stack_init_ex()
29 stack->top = stack->max = 0; in zend_ptr_stack_init_ex()
30 stack->persistent = persistent; in zend_ptr_stack_init_ex()
33 ZEND_API void zend_ptr_stack_init(zend_ptr_stack *stack) in zend_ptr_stack_init() argument
35 zend_ptr_stack_init_ex(stack, 0); in zend_ptr_stack_init()
39 ZEND_API void zend_ptr_stack_n_push(zend_ptr_stack *stack, int count, ...) in zend_ptr_stack_n_push() argument
44 ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, count) in zend_ptr_stack_n_push()
49 stack->top++; in zend_ptr_stack_n_push()
50 *(stack->top_element++) = elem; in zend_ptr_stack_n_push()
57 ZEND_API void zend_ptr_stack_n_pop(zend_ptr_stack *stack, int count, ...) in zend_ptr_stack_n_pop() argument
65 *elem = *(--stack->top_element); in zend_ptr_stack_n_pop()
66 stack->top--; in zend_ptr_stack_n_pop()
74 ZEND_API void zend_ptr_stack_destroy(zend_ptr_stack *stack) in zend_ptr_stack_destroy() argument
76 if (stack->elements) { in zend_ptr_stack_destroy()
77 pefree(stack->elements, stack->persistent); in zend_ptr_stack_destroy()
82 ZEND_API void zend_ptr_stack_apply(zend_ptr_stack *stack, void (*func)(void *)) in zend_ptr_stack_apply() argument
84 int i = stack->top; in zend_ptr_stack_apply()
87 func(stack->elements[i]); in zend_ptr_stack_apply()
91 ZEND_API void zend_ptr_stack_reverse_apply(zend_ptr_stack *stack, void (*func)(void *)) in zend_ptr_stack_reverse_apply() argument
95 while (i < stack->top) { in zend_ptr_stack_reverse_apply()
96 func(stack->elements[i++]); in zend_ptr_stack_reverse_apply()
101 ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *), zend_bool free_elem… in zend_ptr_stack_clean() argument
103 zend_ptr_stack_apply(stack, func); in zend_ptr_stack_clean()
105 int i = stack->top; in zend_ptr_stack_clean()
108 pefree(stack->elements[i], stack->persistent); in zend_ptr_stack_clean()
111 stack->top = 0; in zend_ptr_stack_clean()
112 stack->top_element = stack->elements; in zend_ptr_stack_clean()
116 ZEND_API int zend_ptr_stack_num_elements(zend_ptr_stack *stack) in zend_ptr_stack_num_elements() argument
118 return stack->top; in zend_ptr_stack_num_elements()