Changeset 148 for trunk/xc_shm.h
- Timestamp:
- 2006-09-09T02:56:44+02:00 (7 years ago)
- File:
-
- 1 moved
-
trunk/xc_shm.h (moved) (moved from trunk/myshm.h) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/xc_shm.h
r137 r148 2 2 typedef size_t xc_shmsize_t; 3 3 4 int xc_shm_can_readonly(xc_shm_t *shm); 5 int xc_shm_is_readwrite(xc_shm_t *shm, const void *p); 6 int xc_shm_is_readonly(xc_shm_t *shm, const void *p); 7 void *xc_shm_to_readwrite(xc_shm_t *shm, void *p); 8 void *xc_shm_to_readonly(xc_shm_t *shm, void *p); 4 #include "mem.h" 9 5 10 void *xc_shm_ptr(xc_shm_t *shm); 6 /* shm */ 7 #define XC_SHM_CAN_READONLY(func) int func(xc_shm_t *shm) 8 #define XC_SHM_IS_READWRITE(func) int func(xc_shm_t *shm, const void *p) 9 #define XC_SHM_IS_READONLY(func) int func(xc_shm_t *shm, const void *p) 10 #define XC_SHM_TO_READWRITE(func) void *func(xc_shm_t *shm, void *p) 11 #define XC_SHM_TO_READONLY(func) void *func(xc_shm_t *shm, void *p) 11 12 12 xc_shm_t *xc_shm_init(const char *path, xc_shmsize_t size, zend_bool readonly_protection); 13 #define XC_SHM_INIT(func) xc_shm_t *func(xc_shmsize_t size, int readonly_protection, const void *arg1, const void *arg2) 14 #define XC_SHM_DESTROY(func) void func(xc_shm_t *shm) 15 16 #define XC_SHM_MEMINIT(func) xc_mem_t *func(xc_shm_t *shm, xc_memsize_t size) 17 #define XC_SHM_MEMDESTROY(func) void func(xc_mem_t *mem) 18 19 #define XC_SHM_HANDLERS(name) { \ 20 NULL \ 21 , xc_##name##_can_readonly \ 22 , xc_##name##_is_readwrite \ 23 , xc_##name##_is_readonly \ 24 , xc_##name##_to_readwrite \ 25 , xc_##name##_to_readonly \ 26 \ 27 , xc_##name##_init \ 28 , xc_##name##_destroy \ 29 \ 30 , xc_##name##_meminit \ 31 , xc_##name##_memdestroy \ 32 } 33 34 typedef struct { 35 const xc_mem_handlers_t *memhandlers; 36 XC_SHM_CAN_READONLY((*can_readonly)); 37 XC_SHM_IS_READWRITE((*is_readwrite)); 38 XC_SHM_IS_READONLY((*is_readonly)); 39 XC_SHM_TO_READWRITE((*to_readwrite)); 40 XC_SHM_TO_READONLY((*to_readonly)); 41 XC_SHM_INIT((*init)); 42 XC_SHM_DESTROY((*destroy)); 43 44 XC_SHM_MEMINIT((*meminit)); 45 XC_SHM_MEMDESTROY((*memdestroy)); 46 } xc_shm_handlers_t; 47 48 49 #ifndef XC_SHM_IMPL 50 struct _xc_shm_t { 51 const xc_shm_handlers_t *handlers; 52 }; 53 #endif 54 55 void xc_shm_init_modules(); 56 int xc_shm_scheme_register(const char *name, const xc_shm_handlers_t *handlers); 57 const xc_shm_handlers_t *xc_shm_scheme_find(const char *name); 58 59 xc_shm_t *xc_shm_init(const char *type, xc_shmsize_t size, int readonly_protection, const void *arg1, const void *arg2); 13 60 void xc_shm_destroy(xc_shm_t *shm);
Note: See TracChangeset
for help on using the changeset viewer.

