Legend:
- Unmodified
- Added
- Removed
-
trunk/xc_shm.c
r153 r163 11 11 #include "xc_shm.h" 12 12 13 typedef struct {13 struct _xc_shm_scheme_t { 14 14 const char *name; 15 15 const xc_shm_handlers_t *handlers; 16 } xc_shm_scheme_t;16 }; 17 17 static xc_shm_scheme_t xc_shm_schemes[10]; 18 18 … … 53 53 } 54 54 /* }}} */ 55 xc_shm_scheme_t *xc_shm_scheme_first() /* {{{ */ 56 { 57 return xc_shm_schemes; 58 } 59 /* }}} */ 60 xc_shm_scheme_t *xc_shm_scheme_next(xc_shm_scheme_t *scheme) /* {{{ */ 61 { 62 scheme ++; 63 return scheme->name ? scheme : NULL; 64 } 65 /* }}} */ 66 const char *xc_shm_scheme_name(xc_shm_scheme_t *scheme) /* {{{ */ 67 { 68 assert(scheme); 69 return scheme->name; 70 } 71 /* }}} */ 55 72 xc_shm_t *xc_shm_init(const char *type, xc_shmsize_t size, int readonly_protection, const void *arg1, const void *arg2) /* {{{ */ 56 73 { -
trunk/xc_shm.h
r148 r163 52 52 }; 53 53 #endif 54 typedef struct _xc_shm_scheme_t xc_shm_scheme_t; 54 55 55 56 void xc_shm_init_modules(); 56 57 int xc_shm_scheme_register(const char *name, const xc_shm_handlers_t *handlers); 57 58 const xc_shm_handlers_t *xc_shm_scheme_find(const char *name); 59 xc_shm_scheme_t *xc_shm_scheme_first(); 60 xc_shm_scheme_t *xc_shm_scheme_next(xc_shm_scheme_t *scheme); 61 const char *xc_shm_scheme_name(xc_shm_scheme_t *scheme); 58 62 59 63 xc_shm_t *xc_shm_init(const char *type, xc_shmsize_t size, int readonly_protection, const void *arg1, const void *arg2); -
trunk/xcache.c
r154 r163 2123 2123 char buf[100]; 2124 2124 char *ptr; 2125 int left, len; 2126 xc_shm_scheme_t *scheme; 2125 2127 2126 2128 php_info_print_table_start(); … … 2132 2134 if (xc_php_size) { 2133 2135 ptr = _php_math_number_format(xc_php_size, 0, '.', ','); 2134 s printf(buf, "enabled, %s bytes, %d split(s), with %d slots each", ptr, xc_php_hcache.size, xc_php_hentry.size);2136 snprintf(buf, sizeof(buf), "enabled, %s bytes, %d split(s), with %d slots each", ptr, xc_php_hcache.size, xc_php_hentry.size); 2135 2137 php_info_print_table_row(2, "Opcode Cache", buf); 2136 2138 efree(ptr); … … 2141 2143 if (xc_var_size) { 2142 2144 ptr = _php_math_number_format(xc_var_size, 0, '.', ','); 2143 s printf(buf, "enabled, %s bytes, %d split(s), with %d slots each", ptr, xc_var_hcache.size, xc_var_hentry.size);2145 snprintf(buf, sizeof(buf), "enabled, %s bytes, %d split(s), with %d slots each", ptr, xc_var_hcache.size, xc_var_hentry.size); 2144 2146 php_info_print_table_row(2, "Variable Cache", buf); 2145 2147 efree(ptr); … … 2148 2150 php_info_print_table_row(2, "Variable Cache", "disabled"); 2149 2151 } 2152 2153 left = sizeof(buf); 2154 ptr = buf; 2155 buf[0] = '\0'; 2156 for (scheme = xc_shm_scheme_first(); scheme; scheme = xc_shm_scheme_next(scheme)) { 2157 len = snprintf(ptr, left, ptr == buf ? "%s" : ", %s", xc_shm_scheme_name(scheme)); 2158 left -= len; 2159 ptr += len; 2160 } 2161 php_info_print_table_row(2, "Shared Memory Schemes", buf); 2162 2150 2163 #ifdef HAVE_XCACHE_COVERAGER 2151 2164 php_info_print_table_row(2, "Coverage Dumper", XG(coveragedumper) && xc_coveragedump_dir && xc_coveragedump_dir[0] ? "enabled" : "disabled");
Note: See TracChangeset
for help on using the changeset viewer.

