source: trunk/xcache/xc_utils.h @ 1313

Last change on this file since 1313 was 1313, checked in by moo, 13 months ago

ZEND_STRS ZEND_STRL is inconsist between PHP5.0- and PHP5.0+

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