source: trunk/xcache/xc_utils.h @ 1051

Last change on this file since 1051 was 1051, checked in by moo, 2 years ago

refactor: move more cache stuffs to mod_cacher

  • Property svn:eol-style set to native
File size: 2.3 KB
Line 
1#include "xcache.h"
2#include "xc_compatibility.h"
3
4typedef zend_op_array *(zend_compile_file_t)(zend_file_handle *h, int type TSRMLS_DC);
5
6typedef struct _xc_compilererror_t {
7    int type;
8    uint lineno;
9    int error_len;
10    char *error;
11} xc_compilererror_t;
12
13typedef struct _xc_compile_result_t {
14    zend_op_array *op_array;
15    HashTable *function_table;
16    HashTable *class_table;
17} xc_compile_result_t;
18
19xc_compile_result_t *xc_compile_result_init(xc_compile_result_t *cr,
20        zend_op_array *op_array,
21        HashTable *function_table,
22        HashTable *class_table);
23void xc_compile_result_free(xc_compile_result_t *cr);
24xc_compile_result_t *xc_compile_result_init_cur(xc_compile_result_t *cr, zend_op_array *op_array TSRMLS_DC);
25/* apply func */
26int xc_apply_op_array(xc_compile_result_t *cr, apply_func_t applyer TSRMLS_DC);
27
28int xc_undo_pass_two(zend_op_array *op_array TSRMLS_DC);
29int xc_redo_pass_two(zend_op_array *op_array TSRMLS_DC);
30int xc_fix_opcode(zend_op_array *op_array TSRMLS_DC);
31int xc_undo_fix_opcode(zend_op_array *op_array TSRMLS_DC);
32zend_uchar xc_get_fixed_opcode(zend_uchar opcode, int line);
33
34typedef void (*xc_foreach_early_binding_class_cb)(zend_op *opline, int oplineno, void *data TSRMLS_DC);
35int xc_foreach_early_binding_class(zend_op_array *op_array, xc_foreach_early_binding_class_cb callback, void *data TSRMLS_DC);
36
37/* installer */
38#ifdef HAVE_XCACHE_CONSTANT
39void xc_install_constant(ZEND_24(NOTHING, const) char *filename, zend_constant *constant, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC);
40#endif
41void xc_install_function(ZEND_24(NOTHING, const) char *filename, zend_function *func, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC);
42ZESW(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);
43
44typedef zend_bool (*xc_if_func_t)(void *data);
45
46void xc_hash_copy_if(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size, xc_if_func_t checker);
47#ifdef HAVE_XCACHE_CONSTANT
48void xc_zend_constant_ctor(zend_constant *c);
49void xc_zend_constant_dtor(zend_constant *c);
50void xc_copy_internal_zend_constants(HashTable *target, HashTable *source);
51#endif
52
53#ifndef ZEND_COMPILE_DELAYED_BINDING
54int xc_do_early_binding(zend_op_array *op_array, HashTable *class_table, int oplineno TSRMLS_DC);
55#endif
Note: See TracBrowser for help on using the repository browser.