source: trunk/utils.h @ 95

Last change on this file since 95 was 95, checked in by moo, 8 years ago

fixed #20, default: --enable-xcache-constant=yes

File size: 1.9 KB
RevLine 
[1]1#include "php.h"
2
3typedef struct {
4    int alloc;
5    zend_op_array *op_array;
6    HashTable *function_table;
7    HashTable *class_table;
8} xc_compile_result_t;
9
10xc_compile_result_t *xc_compile_result_init(xc_compile_result_t *cr,
11        zend_op_array *op_array,
12        HashTable *function_table,
13        HashTable *class_table);
14void xc_compile_result_free(xc_compile_result_t *cr);
15xc_compile_result_t *xc_compile_result_init_cur(xc_compile_result_t *cr, zend_op_array *op_array TSRMLS_DC);
16/* apply func */
17int xc_apply_function(zend_function *zf, apply_func_t applyer TSRMLS_DC);
18int xc_apply_class(zend_class_entry *ce, apply_func_t applyer TSRMLS_DC);
19int xc_apply_op_array(xc_compile_result_t *cr, apply_func_t applyer TSRMLS_DC);
20
21int xc_undo_pass_two(zend_op_array *op_array TSRMLS_DC);
22int xc_redo_pass_two(zend_op_array *op_array TSRMLS_DC);
23int xc_fix_opcode(zend_op_array *op_array TSRMLS_DC);
24int xc_undo_fix_opcode(zend_op_array *op_array TSRMLS_DC);
25zend_uchar xc_get_fixed_opcode(zend_uchar opcode, int line);
26
27/* installer */
[95]28#ifdef HAVE_XCACHE_CONSTANT
29void xc_install_constant(char *filename, zend_constant *constant, zend_uchar type, void *key, uint len TSRMLS_DC);
30#endif
[88]31void xc_install_function(char *filename, zend_function *func, zend_uchar type, void *key, uint len TSRMLS_DC);
[1]32ZESW(xc_cest_t *, void) xc_install_class(char *filename, xc_cest_t *cest, zend_uchar type, void *key, uint len TSRMLS_DC);
33
34/* sandbox */
35typedef struct {
36    int alloc;
37    char *filename;
38
39    HashTable orig_included_files;
40    zend_llist orig_open_files;
41    HashTable *tmp_included_files;
42    zend_llist *tmp_open_files;
43
[95]44#ifdef HAVE_XCACHE_CONSTANT
45    HashTable *orig_zend_constants;
46    HashTable tmp_zend_constants;
47#endif
[1]48    HashTable *orig_function_table;
49    HashTable *orig_class_table;
50    HashTable tmp_function_table;
51    HashTable tmp_class_table;
52} xc_sandbox_t;
53
54xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, char *filename TSRMLS_DC);
55void xc_sandbox_free(xc_sandbox_t *sandbox, int install TSRMLS_DC);
Note: See TracBrowser for help on using the repository browser.