| 1 | #include "php.h" |
|---|
| 2 | #include "xcache.h" |
|---|
| 3 | |
|---|
| 4 | int xc_util_init(int module_number TSRMLS_DC); |
|---|
| 5 | void xc_util_destroy(); |
|---|
| 6 | |
|---|
| 7 | typedef struct { |
|---|
| 8 | zend_op_array *op_array; |
|---|
| 9 | HashTable *function_table; |
|---|
| 10 | HashTable *class_table; |
|---|
| 11 | } xc_compile_result_t; |
|---|
| 12 | |
|---|
| 13 | xc_compile_result_t *xc_compile_result_init(xc_compile_result_t *cr, |
|---|
| 14 | zend_op_array *op_array, |
|---|
| 15 | HashTable *function_table, |
|---|
| 16 | HashTable *class_table); |
|---|
| 17 | void xc_compile_result_free(xc_compile_result_t *cr); |
|---|
| 18 | xc_compile_result_t *xc_compile_result_init_cur(xc_compile_result_t *cr, zend_op_array *op_array TSRMLS_DC); |
|---|
| 19 | /* apply func */ |
|---|
| 20 | int xc_apply_function(zend_function *zf, apply_func_t applyer TSRMLS_DC); |
|---|
| 21 | int xc_apply_class(zend_class_entry *ce, apply_func_t applyer TSRMLS_DC); |
|---|
| 22 | int xc_apply_op_array(xc_compile_result_t *cr, apply_func_t applyer TSRMLS_DC); |
|---|
| 23 | |
|---|
| 24 | int xc_undo_pass_two(zend_op_array *op_array TSRMLS_DC); |
|---|
| 25 | int xc_redo_pass_two(zend_op_array *op_array TSRMLS_DC); |
|---|
| 26 | int xc_fix_opcode(zend_op_array *op_array TSRMLS_DC); |
|---|
| 27 | int xc_undo_fix_opcode(zend_op_array *op_array TSRMLS_DC); |
|---|
| 28 | zend_uchar xc_get_fixed_opcode(zend_uchar opcode, int line); |
|---|
| 29 | |
|---|
| 30 | 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); |
|---|
| 31 | |
|---|
| 32 | /* installer */ |
|---|
| 33 | #ifdef HAVE_XCACHE_CONSTANT |
|---|
| 34 | void xc_install_constant(ZEND_24(NOTHING, const) char *filename, zend_constant *constant, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC); |
|---|
| 35 | #endif |
|---|
| 36 | void xc_install_function(ZEND_24(NOTHING, const) char *filename, zend_function *func, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC); |
|---|
| 37 | ZESW(xc_cest_t *, void) xc_install_class(ZEND_24(NOTHING, const) char *filename, xc_cest_t *cest, int oplineno, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC); |
|---|
| 38 | |
|---|
| 39 | #if defined(E_STRICT) || defined(E_DEPRECATED) |
|---|
| 40 | #define XCACHE_ERROR_CACHING |
|---|
| 41 | #endif |
|---|
| 42 | |
|---|
| 43 | void xc_zend_class_add_ref(zend_class_entry ZESW(*ce, **ce)); |
|---|
| 44 | |
|---|
| 45 | typedef zend_bool (*xc_if_func_t)(void *data); |
|---|
| 46 | |
|---|
| 47 | void xc_hash_copy_if(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size, xc_if_func_t checker); |
|---|
| 48 | #ifdef HAVE_XCACHE_CONSTANT |
|---|
| 49 | void xc_zend_constant_ctor(zend_constant *c); |
|---|
| 50 | void xc_zend_constant_dtor(zend_constant *c); |
|---|
| 51 | void xc_copy_internal_zend_constants(HashTable *target, HashTable *source); |
|---|
| 52 | #endif |
|---|
| 53 | |
|---|
| 54 | #ifndef ZEND_ENGINE_2_3 |
|---|
| 55 | size_t xc_dirname(char *path, size_t len); |
|---|
| 56 | #define zend_dirname xc_dirname |
|---|
| 57 | long xc_atol(const char *str, int len); |
|---|
| 58 | #define zend_atol xc_atol |
|---|
| 59 | #endif |
|---|