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.

71 lines
2.9 KiB

  1. #include "php.h"
  2. #include "xcache.h"
  3. int xc_util_init(int module_number TSRMLS_DC);
  4. void xc_util_destroy();
  5. typedef struct {
  6. zend_op_array *op_array;
  7. HashTable *function_table;
  8. HashTable *class_table;
  9. } xc_compile_result_t;
  10. xc_compile_result_t *xc_compile_result_init(xc_compile_result_t *cr,
  11. zend_op_array *op_array,
  12. HashTable *function_table,
  13. HashTable *class_table);
  14. void xc_compile_result_free(xc_compile_result_t *cr);
  15. xc_compile_result_t *xc_compile_result_init_cur(xc_compile_result_t *cr, zend_op_array *op_array TSRMLS_DC);
  16. /* apply func */
  17. int xc_apply_function(zend_function *zf, apply_func_t applyer TSRMLS_DC);
  18. int xc_apply_class(zend_class_entry *ce, apply_func_t applyer TSRMLS_DC);
  19. int xc_apply_op_array(xc_compile_result_t *cr, apply_func_t applyer TSRMLS_DC);
  20. int xc_undo_pass_two(zend_op_array *op_array TSRMLS_DC);
  21. int xc_redo_pass_two(zend_op_array *op_array TSRMLS_DC);
  22. int xc_fix_opcode(zend_op_array *op_array TSRMLS_DC);
  23. int xc_undo_fix_opcode(zend_op_array *op_array TSRMLS_DC);
  24. zend_uchar xc_get_fixed_opcode(zend_uchar opcode, int line);
  25. 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);
  26. /* installer */
  28. 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);
  29. #endif
  30. 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);
  31. 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);
  32. #if defined(E_STRICT) || defined(E_DEPRECATED)
  34. #endif
  35. /* return op_array to install */
  36. typedef zend_op_array *(*xc_sandboxed_func_t)(void *data TSRMLS_DC);
  37. zend_op_array *xc_sandbox(xc_sandboxed_func_t sandboxed_func, void *data, ZEND_24(NOTHING, const) char *filename TSRMLS_DC);
  38. const Bucket *xc_sandbox_user_function_begin(TSRMLS_D);
  39. const Bucket *xc_sandbox_user_class_begin(TSRMLS_D);
  40. zend_uint xc_sandbox_compilererror_cnt(TSRMLS_D);
  42. xc_compilererror_t *xc_sandbox_compilererrors(TSRMLS_D);
  43. zend_uint xc_sandbox_compilererror_cnt(TSRMLS_D);
  44. #endif
  45. void xc_zend_class_add_ref(zend_class_entry ZESW(*ce, **ce));
  46. typedef zend_bool (*xc_if_func_t)(void *data);
  47. void xc_hash_copy_if(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size, xc_if_func_t checker);
  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. #ifndef ZEND_ENGINE_2_3
  54. size_t xc_dirname(char *path, size_t len);
  55. #define zend_dirname xc_dirname
  56. long xc_atol(const char *str, int len);
  57. #define zend_atol xc_atol
  58. #endif