| [1] | 1 | #include "php.h" |
|---|
| 2 | |
|---|
| 3 | typedef struct { |
|---|
| 4 | int alloc; |
|---|
| 5 | zend_op_array *op_array; |
|---|
| 6 | HashTable *function_table; |
|---|
| 7 | HashTable *class_table; |
|---|
| 8 | } xc_compile_result_t; |
|---|
| 9 | |
|---|
| 10 | xc_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); |
|---|
| 14 | void xc_compile_result_free(xc_compile_result_t *cr); |
|---|
| 15 | xc_compile_result_t *xc_compile_result_init_cur(xc_compile_result_t *cr, zend_op_array *op_array TSRMLS_DC); |
|---|
| 16 | /* apply func */ |
|---|
| 17 | int xc_apply_function(zend_function *zf, apply_func_t applyer TSRMLS_DC); |
|---|
| 18 | int xc_apply_class(zend_class_entry *ce, apply_func_t applyer TSRMLS_DC); |
|---|
| 19 | int xc_apply_op_array(xc_compile_result_t *cr, apply_func_t applyer TSRMLS_DC); |
|---|
| 20 | |
|---|
| 21 | int xc_undo_pass_two(zend_op_array *op_array TSRMLS_DC); |
|---|
| 22 | int xc_redo_pass_two(zend_op_array *op_array TSRMLS_DC); |
|---|
| 23 | int xc_fix_opcode(zend_op_array *op_array TSRMLS_DC); |
|---|
| 24 | int xc_undo_fix_opcode(zend_op_array *op_array TSRMLS_DC); |
|---|
| 25 | zend_uchar xc_get_fixed_opcode(zend_uchar opcode, int line); |
|---|
| 26 | |
|---|
| [212] | 27 | int xc_foreach_early_binding_class(zend_op_array *op_array, void (*callback)(zend_op *opline, int oplineno, void *data TSRMLS_DC), void *data TSRMLS_DC); |
|---|
| 28 | |
|---|
| [1] | 29 | /* installer */ |
|---|
| [95] | 30 | #ifdef HAVE_XCACHE_CONSTANT |
|---|
| [103] | 31 | void xc_install_constant(char *filename, zend_constant *constant, zend_uchar type, zstr key, uint len TSRMLS_DC); |
|---|
| [95] | 32 | #endif |
|---|
| [103] | 33 | void xc_install_function(char *filename, zend_function *func, zend_uchar type, zstr key, uint len TSRMLS_DC); |
|---|
| [212] | 34 | ZESW(xc_cest_t *, void) xc_install_class(char *filename, xc_cest_t *cest, int oplineno, zend_uchar type, zstr key, uint len TSRMLS_DC); |
|---|
| [1] | 35 | |
|---|
| 36 | /* sandbox */ |
|---|
| 37 | typedef struct { |
|---|
| 38 | int alloc; |
|---|
| [209] | 39 | int orig_user_error_handler_error_reporting; |
|---|
| [1] | 40 | char *filename; |
|---|
| 41 | |
|---|
| 42 | HashTable orig_included_files; |
|---|
| 43 | HashTable *tmp_included_files; |
|---|
| 44 | |
|---|
| [95] | 45 | #ifdef HAVE_XCACHE_CONSTANT |
|---|
| 46 | HashTable *orig_zend_constants; |
|---|
| 47 | HashTable tmp_zend_constants; |
|---|
| 48 | #endif |
|---|
| [1] | 49 | HashTable *orig_function_table; |
|---|
| 50 | HashTable *orig_class_table; |
|---|
| 51 | HashTable tmp_function_table; |
|---|
| 52 | HashTable tmp_class_table; |
|---|
| 53 | } xc_sandbox_t; |
|---|
| 54 | |
|---|
| 55 | xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, char *filename TSRMLS_DC); |
|---|
| 56 | void xc_sandbox_free(xc_sandbox_t *sandbox, int install TSRMLS_DC); |
|---|