source: trunk/main/xc_utils.h @ 982

Last change on this file since 982 was 982, checked in by moo, 21 months ago

move files to subdirs

  • Property svn:eol-style set to native
File size: 2.9 KB
RevLine 
[1]1#include "php.h"
[305]2#include "xcache.h"
[1]3
[903]4int xc_util_init(int module_number TSRMLS_DC);
5void xc_util_destroy();
6
[1]7typedef struct {
8    zend_op_array *op_array;
9    HashTable *function_table;
10    HashTable *class_table;
11} xc_compile_result_t;
12
13xc_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);
17void xc_compile_result_free(xc_compile_result_t *cr);
18xc_compile_result_t *xc_compile_result_init_cur(xc_compile_result_t *cr, zend_op_array *op_array TSRMLS_DC);
19/* apply func */
20int xc_apply_function(zend_function *zf, apply_func_t applyer TSRMLS_DC);
21int xc_apply_class(zend_class_entry *ce, apply_func_t applyer TSRMLS_DC);
22int xc_apply_op_array(xc_compile_result_t *cr, apply_func_t applyer TSRMLS_DC);
23
24int xc_undo_pass_two(zend_op_array *op_array TSRMLS_DC);
25int xc_redo_pass_two(zend_op_array *op_array TSRMLS_DC);
26int xc_fix_opcode(zend_op_array *op_array TSRMLS_DC);
27int xc_undo_fix_opcode(zend_op_array *op_array TSRMLS_DC);
28zend_uchar xc_get_fixed_opcode(zend_uchar opcode, int line);
29
[212]30int 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
[1]32/* installer */
[95]33#ifdef HAVE_XCACHE_CONSTANT
[860]34void xc_install_constant(ZEND_24(NOTHING, const) char *filename, zend_constant *constant, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC);
[95]35#endif
[860]36void xc_install_function(ZEND_24(NOTHING, const) char *filename, zend_function *func, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC);
37ZESW(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);
[1]38
[669]39#if defined(E_STRICT) || defined(E_DEPRECATED)
40#define XCACHE_ERROR_CACHING
41#endif
42
[937]43/* return op_array to install */
44typedef zend_op_array *(*xc_sandboxed_func_t)(void *data TSRMLS_DC);
45zend_op_array *xc_sandbox(xc_sandboxed_func_t sandboxed_func, void *data, ZEND_24(NOTHING, const) char *filename TSRMLS_DC);
[938]46const Bucket *xc_sandbox_user_function_begin(TSRMLS_D);
47const Bucket *xc_sandbox_user_class_begin(TSRMLS_D);
48zend_uint xc_sandbox_compilererror_cnt(TSRMLS_D);
[669]49#ifdef XCACHE_ERROR_CACHING
[938]50xc_compilererror_t *xc_sandbox_compilererrors(TSRMLS_D);
51zend_uint xc_sandbox_compilererror_cnt(TSRMLS_D);
[496]52#endif
[548]53
[345]54void xc_zend_class_add_ref(zend_class_entry ZESW(*ce, **ce));
[640]55
56typedef zend_bool (*xc_if_func_t)(void *data);
57
58void xc_hash_copy_if(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size, xc_if_func_t checker);
59#ifdef HAVE_XCACHE_CONSTANT
60void xc_zend_constant_ctor(zend_constant *c);
61void xc_zend_constant_dtor(zend_constant *c);
62void xc_copy_internal_zend_constants(HashTable *target, HashTable *source);
63#endif
[662]64
[671]65#ifndef ZEND_ENGINE_2_3
[847]66size_t xc_dirname(char *path, size_t len);
67#define zend_dirname xc_dirname
68long xc_atol(const char *str, int len);
69#define zend_atol xc_atol
[671]70#endif
Note: See TracBrowser for help on using the repository browser.