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.
 
 
 
 
 
 

72 lines
2.3 KiB

  1. #ifndef XC_SHM_H
  2. #define XC_SHM_H
  3. typedef struct _xc_shm_handlers_t xc_shm_handlers_t;
  4. #ifndef XC_SHM_IMPL
  5. struct _xc_shm_t {
  6. const xc_shm_handlers_t *handlers;
  7. zend_bool disabled;
  8. };
  9. #define XC_SHM_IMPL _xc_shm_t
  10. #endif
  11. typedef struct XC_SHM_IMPL xc_shm_t;
  12. typedef size_t xc_shmsize_t;
  13. #include "xc_mem.h"
  14. /* shm */
  15. #define XC_SHM_CAN_READONLY(func) int func(xc_shm_t *shm)
  16. #define XC_SHM_IS_READWRITE(func) int func(xc_shm_t *shm, const void *p)
  17. #define XC_SHM_IS_READONLY(func) int func(xc_shm_t *shm, const void *p)
  18. #define XC_SHM_TO_READWRITE(func) void *func(xc_shm_t *shm, void *p)
  19. #define XC_SHM_TO_READONLY(func) void *func(xc_shm_t *shm, void *p)
  20. #define XC_SHM_INIT(func) xc_shm_t *func(xc_shmsize_t size, int readonly_protection, const void *arg1, const void *arg2)
  21. #define XC_SHM_DESTROY(func) void func(xc_shm_t *shm)
  22. #define XC_SHM_MEMINIT(func) xc_mem_t *func(xc_shm_t *shm, xc_memsize_t size)
  23. #define XC_SHM_MEMDESTROY(func) void func(xc_mem_t *mem)
  24. #define XC_SHM_HANDLERS(name) { \
  25. NULL \
  26. , xc_##name##_can_readonly \
  27. , xc_##name##_is_readwrite \
  28. , xc_##name##_is_readonly \
  29. , xc_##name##_to_readwrite \
  30. , xc_##name##_to_readonly \
  31. \
  32. , xc_##name##_init \
  33. , xc_##name##_destroy \
  34. \
  35. , xc_##name##_meminit \
  36. , xc_##name##_memdestroy \
  37. }
  38. struct _xc_shm_handlers_t {
  39. const xc_mem_handlers_t *memhandlers;
  40. XC_SHM_CAN_READONLY((*can_readonly));
  41. XC_SHM_IS_READWRITE((*is_readwrite));
  42. XC_SHM_IS_READONLY((*is_readonly));
  43. XC_SHM_TO_READWRITE((*to_readwrite));
  44. XC_SHM_TO_READONLY((*to_readonly));
  45. XC_SHM_INIT((*init));
  46. XC_SHM_DESTROY((*destroy));
  47. XC_SHM_MEMINIT((*meminit));
  48. XC_SHM_MEMDESTROY((*memdestroy));
  49. };
  50. typedef struct _xc_shm_scheme_t xc_shm_scheme_t;
  51. void xc_shm_init_modules();
  52. int xc_shm_scheme_register(const char *name, const xc_shm_handlers_t *handlers);
  53. const xc_shm_handlers_t *xc_shm_scheme_find(const char *name);
  54. xc_shm_scheme_t *xc_shm_scheme_first();
  55. xc_shm_scheme_t *xc_shm_scheme_next(xc_shm_scheme_t *scheme);
  56. const char *xc_shm_scheme_name(xc_shm_scheme_t *scheme);
  57. xc_shm_t *xc_shm_init(const char *type, xc_shmsize_t size, int readonly_protection, const void *arg1, const void *arg2);
  58. void xc_shm_destroy(xc_shm_t *shm);
  59. #endif