Back to index

php5  5.3.10
zend_stack.h
Go to the documentation of this file.
00001 /*
00002    +----------------------------------------------------------------------+
00003    | Zend Engine                                                          |
00004    +----------------------------------------------------------------------+
00005    | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
00006    +----------------------------------------------------------------------+
00007    | This source file is subject to version 2.00 of the Zend license,     |
00008    | that is bundled with this package in the file LICENSE, and is        | 
00009    | available through the world-wide-web at the following url:           |
00010    | http://www.zend.com/license/2_00.txt.                                |
00011    | If you did not receive a copy of the Zend license and are unable to  |
00012    | obtain it through the world-wide-web, please send a note to          |
00013    | license@zend.com so we can mail you a copy immediately.              |
00014    +----------------------------------------------------------------------+
00015    | Authors: Andi Gutmans <andi@zend.com>                                |
00016    |          Zeev Suraski <zeev@zend.com>                                |
00017    +----------------------------------------------------------------------+
00018 */
00019 
00020 /* $Id: zend_stack.h 321634 2012-01-01 13:15:04Z felipe $ */
00021 
00022 #ifndef ZEND_STACK_H
00023 #define ZEND_STACK_H
00024 
00025 typedef struct _zend_stack {
00026        int top, max;
00027        void **elements;
00028 } zend_stack;
00029 
00030 
00031 #define STACK_BLOCK_SIZE 64
00032 
00033 BEGIN_EXTERN_C()
00034 ZEND_API int zend_stack_init(zend_stack *stack);
00035 ZEND_API int zend_stack_push(zend_stack *stack, const void *element, int size);
00036 ZEND_API int zend_stack_top(const zend_stack *stack, void **element);
00037 ZEND_API int zend_stack_del_top(zend_stack *stack);
00038 ZEND_API int zend_stack_int_top(const zend_stack *stack);
00039 ZEND_API int zend_stack_is_empty(const zend_stack *stack);
00040 ZEND_API int zend_stack_destroy(zend_stack *stack);
00041 ZEND_API void **zend_stack_base(const zend_stack *stack);
00042 ZEND_API int zend_stack_count(const zend_stack *stack);
00043 ZEND_API void zend_stack_apply(zend_stack *stack, int type, int (*apply_function)(void *element));
00044 ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, int type, int (*apply_function)(void *element, void *arg), void *arg);
00045 END_EXTERN_C()
00046 
00047 #define ZEND_STACK_APPLY_TOPDOWN   1
00048 #define ZEND_STACK_APPLY_BOTTOMUP  2
00049 
00050 #endif /* ZEND_STACK_H */
00051 
00052 /*
00053  * Local variables:
00054  * tab-width: 4
00055  * c-basic-offset: 4
00056  * indent-tabs-mode: t
00057  * End:
00058  */