| 1796 | | PHP_INI_ENTRY1 ("xcache.size", "0", PHP_INI_SYSTEM, xc_OnUpdateLong, &xc_php_size) |
| 1797 | | PHP_INI_ENTRY1 ("xcache.count", "1", PHP_INI_SYSTEM, xc_OnUpdateHashInfo, &xc_php_hcache) |
| 1798 | | PHP_INI_ENTRY1 ("xcache.slots", "8K", PHP_INI_SYSTEM, xc_OnUpdateHashInfo, &xc_php_hentry) |
| 1799 | | |
| 1800 | | PHP_INI_ENTRY1 ("xcache.var_size", "0", PHP_INI_SYSTEM, xc_OnUpdateLong, &xc_var_size) |
| 1801 | | PHP_INI_ENTRY1 ("xcache.var_count", "1", PHP_INI_SYSTEM, xc_OnUpdateHashInfo, &xc_var_hcache) |
| 1802 | | PHP_INI_ENTRY1 ("xcache.var_slots", "8K", PHP_INI_SYSTEM, xc_OnUpdateHashInfo, &xc_var_hentry) |
| 1803 | | |
| | 1840 | static int xc_config_hash(xc_hash_t *p, char *name, char *default_value) /* {{{ */ |
| | 1841 | { |
| | 1842 | int bits, size; |
| | 1843 | char *value; |
| | 1844 | |
| | 1845 | if (cfg_get_string(name, &value) != SUCCESS) { |
| | 1846 | value = default_value; |
| | 1847 | } |
| | 1848 | |
| | 1849 | p->size = zend_atoi(value, strlen(value)); |
| | 1850 | for (size = 1, bits = 1; size < p->size; bits ++, size <<= 1) { |
| | 1851 | /* empty body */ |
| | 1852 | } |
| | 1853 | p->size = size; |
| | 1854 | p->bits = bits; |
| | 1855 | p->mask = size - 1; |
| | 1856 | |
| | 1857 | return SUCCESS; |
| | 1858 | } |
| | 1859 | static int xc_config_long(long *p, char *name, char *default_value) /* {{{ */ |
| | 1860 | { |
| | 1861 | char *value; |
| | 1862 | |
| | 1863 | if (cfg_get_string(name, &value) != SUCCESS) { |
| | 1864 | value = default_value; |
| | 1865 | } |
| | 1866 | |
| | 1867 | *p = zend_atoi(value, strlen(value)); |
| | 1868 | return SUCCESS; |
| | 1869 | } |
| | 1870 | /* }}} */ |
| | 1896 | |
| | 1897 | xc_config_long(&xc_php_size, "xcache.size", "0"); |
| | 1898 | xc_config_hash(&xc_php_hcache, "xcache.count", "1"); |
| | 1899 | xc_config_hash(&xc_php_hentry, "xcache.slots", "8K"); |
| | 1900 | |
| | 1901 | xc_config_long(&xc_var_size, "xcache.var_size", "0"); |
| | 1902 | xc_config_hash(&xc_var_hcache, "xcache.var_count", "1"); |
| | 1903 | xc_config_hash(&xc_var_hentry, "xcache.var_slots", "8K"); |