XCache is a fast, stable PHP opcode cacher that has been proven and is now running on production servers under high load. https://xcache.lighttpd.net/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
2.3 KiB

  1. #include "xcache.h"
  2. #include "xc_compatibility.h"
  3. typedef zend_op_array *(zend_compile_file_t)(zend_file_handle *h, int type TSRMLS_DC);
  4. typedef struct _xc_compilererror_t {
  5. int type;
  6. uint lineno;
  7. int error_len;
  8. char *error;
  9. } xc_compilererror_t;
  10. typedef struct _xc_compile_result_t {
  11. zend_op_array *op_array;
  12. HashTable *function_table;
  13. HashTable *class_table;
  14. } xc_compile_result_t;
  15. xc_compile_result_t *xc_compile_result_init(xc_compile_result_t *cr,
  16. zend_op_array *op_array,
  17. HashTable *function_table,
  18. HashTable *class_table);
  19. void xc_compile_result_free(xc_compile_result_t *cr);
  20. xc_compile_result_t *xc_compile_result_init_cur(xc_compile_result_t *cr, zend_op_array *op_array TSRMLS_DC);
  21. /* apply func */
  22. int xc_apply_op_array(xc_compile_result_t *cr, apply_func_t applyer TSRMLS_DC);
  23. int xc_undo_pass_two(zend_op_array *op_array TSRMLS_DC);
  24. int xc_redo_pass_two(zend_op_array *op_array TSRMLS_DC);
  25. int xc_fix_opcode(zend_op_array *op_array TSRMLS_DC);
  26. int xc_undo_fix_opcode(zend_op_array *op_array TSRMLS_DC);
  27. zend_uchar xc_get_fixed_opcode(zend_uchar opcode, int line);
  28. typedef void (*xc_foreach_early_binding_class_cb)(zend_op *opline, int oplineno, void *data TSRMLS_DC);
  29. int xc_foreach_early_binding_class(zend_op_array *op_array, xc_foreach_early_binding_class_cb callback, void *data TSRMLS_DC);
  30. /* installer */
  32. 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);
  33. #endif
  34. 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);
  35. 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);
  36. typedef zend_bool (*xc_if_func_t)(void *data);
  37. void xc_hash_copy_if(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size, xc_if_func_t checker);
  39. void xc_zend_constant_ctor(zend_constant *c);
  40. void xc_zend_constant_dtor(zend_constant *c);
  41. void xc_copy_internal_zend_constants(HashTable *target, HashTable *source);
  42. #endif
  44. int xc_do_early_binding(zend_op_array *op_array, HashTable *class_table, int oplineno TSRMLS_DC);
  45. #endif