php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
zend_stack.h
Go to the documentation of this file.
1/*
2 +----------------------------------------------------------------------+
3 | Zend Engine |
4 +----------------------------------------------------------------------+
5 | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 2.00 of the Zend license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.zend.com/license/2_00.txt. |
11 | If you did not receive a copy of the Zend license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@zend.com so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
15 | Authors: Andi Gutmans <andi@php.net> |
16 | Zeev Suraski <zeev@php.net> |
17 +----------------------------------------------------------------------+
18*/
19
20#ifndef ZEND_STACK_H
21#define ZEND_STACK_H
22
23#include "zend_portability.h"
24
25typedef struct _zend_stack {
26 int size, top, max;
27 void *elements;
29
30
31#define STACK_BLOCK_SIZE 16
32
37
39ZEND_API void zend_stack_init(zend_stack *stack, int size);
40ZEND_API int zend_stack_push(zend_stack *stack, const void *element);
41ZEND_API void *zend_stack_top(const zend_stack *stack);
43ZEND_API int zend_stack_int_top(const zend_stack *stack);
44ZEND_API bool zend_stack_is_empty(const zend_stack *stack);
46ZEND_API void *zend_stack_base(const zend_stack *stack);
47ZEND_API int zend_stack_count(const zend_stack *stack);
48ZEND_API void zend_stack_apply(zend_stack *stack, int type, int (*apply_function)(void *element));
49ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, zend_stack_apply_direction type, int (*apply_function)(void *element, void *arg), void *arg);
50ZEND_API void zend_stack_clean(zend_stack *stack, void (*func)(void *), bool free_elements);
52
53#endif /* ZEND_STACK_H */
zend_ffi_type * type
Definition ffi.c:3812
new_type size
Definition ffi.c:4365
zval * arg
Definition ffi.c:3975
void * elements
Definition zend_stack.h:27
execute_data func
#define ZEND_API
#define END_EXTERN_C()
#define BEGIN_EXTERN_C()
ZEND_API int zend_stack_push(zend_stack *stack, const void *element)
Definition zend_stack.c:33
ZEND_API void * zend_stack_base(const zend_stack *stack)
Definition zend_stack.c:87
ZEND_API void * zend_stack_top(const zend_stack *stack)
Definition zend_stack.c:45
ZEND_API int zend_stack_count(const zend_stack *stack)
Definition zend_stack.c:93
ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, zend_stack_apply_direction type, int(*apply_function)(void *element, void *arg), void *arg)
Definition zend_stack.c:122
ZEND_API void zend_stack_destroy(zend_stack *stack)
Definition zend_stack.c:78
ZEND_API int zend_stack_int_top(const zend_stack *stack)
Definition zend_stack.c:61
ZEND_API void zend_stack_init(zend_stack *stack, int size)
Definition zend_stack.c:25
ZEND_API bool zend_stack_is_empty(const zend_stack *stack)
Definition zend_stack.c:72
ZEND_API void zend_stack_del_top(zend_stack *stack)
Definition zend_stack.c:55
ZEND_API void zend_stack_clean(zend_stack *stack, void(*func)(void *), bool free_elements)
Definition zend_stack.c:144
ZEND_API void zend_stack_apply(zend_stack *stack, int type, int(*apply_function)(void *element))
Definition zend_stack.c:99
struct _zend_stack zend_stack
zend_stack_apply_direction
Definition zend_stack.h:33
@ ZEND_STACK_APPLY_BOTTOMUP
Definition zend_stack.h:35
@ ZEND_STACK_APPLY_TOPDOWN
Definition zend_stack.h:34