Index: /branches/1.0/xcache.c
===================================================================
--- /branches/1.0/xcache.c	(revision 73)
+++ /branches/1.0/xcache.c	(revision 74)
@@ -1738,10 +1738,4 @@
 
 /* {{{ PHP_INI */
-static PHP_INI_MH(xc_OnUpdateLong)
-{
-	long *p = (long *)mh_arg1;
-	*p = zend_atoi(new_value, new_value_length);
-	return SUCCESS;
-}
 
 static PHP_INI_MH(xc_OnUpdateBool)
@@ -1755,20 +1749,4 @@
 		*p = (zend_bool) 1;
 	}
-	return SUCCESS;
-}
-
-static PHP_INI_MH(xc_OnUpdateHashInfo)
-{
-	xc_hash_t *p = (xc_hash_t *)mh_arg1;
-	int bits, size;
-
-	p->size = zend_atoi(new_value, new_value_length);
-	for (size = 1, bits = 1; size < p->size; bits ++, size <<= 1) {
-		/* empty body */
-	}
-	p->size = size;
-	p->bits = bits;
-	p->mask = size - 1;
-
 	return SUCCESS;
 }
@@ -1784,4 +1762,5 @@
 	return SUCCESS;
 }
+
 #ifdef ZEND_ENGINE_2
 #define OnUpdateInt OnUpdateLong
@@ -1794,12 +1773,4 @@
 #endif
 PHP_INI_BEGIN()
-	PHP_INI_ENTRY1     ("xcache.size",                   "0", PHP_INI_SYSTEM, xc_OnUpdateLong,     &xc_php_size)
-	PHP_INI_ENTRY1     ("xcache.count",                  "1", PHP_INI_SYSTEM, xc_OnUpdateHashInfo, &xc_php_hcache)
-	PHP_INI_ENTRY1     ("xcache.slots",                 "8K", PHP_INI_SYSTEM, xc_OnUpdateHashInfo, &xc_php_hentry)
-
-	PHP_INI_ENTRY1     ("xcache.var_size",               "0", PHP_INI_SYSTEM, xc_OnUpdateLong,     &xc_var_size)
-	PHP_INI_ENTRY1     ("xcache.var_count",              "1", PHP_INI_SYSTEM, xc_OnUpdateHashInfo, &xc_var_hcache)
-	PHP_INI_ENTRY1     ("xcache.var_slots",             "8K", PHP_INI_SYSTEM, xc_OnUpdateHashInfo, &xc_var_hentry)
-
 	PHP_INI_ENTRY1     ("xcache.mmap_path",     DEFAULT_PATH, PHP_INI_SYSTEM, xc_OnUpdateString,   &xc_mmap_path)
 	PHP_INI_ENTRY1     ("xcache.coredump_directory",      "", PHP_INI_SYSTEM, xc_OnUpdateString,   &xc_coredump_dir)
@@ -1867,4 +1838,35 @@
 }
 /* }}} */
+static int xc_config_hash(xc_hash_t *p, char *name, char *default_value) /* {{{ */
+{
+	int bits, size;
+	char *value;
+
+	if (cfg_get_string(name, &value) != SUCCESS) {
+		value = default_value;
+	}
+
+	p->size = zend_atoi(value, strlen(value));
+	for (size = 1, bits = 1; size < p->size; bits ++, size <<= 1) {
+		/* empty body */
+	}
+	p->size = size;
+	p->bits = bits;
+	p->mask = size - 1;
+
+	return SUCCESS;
+}
+static int xc_config_long(long *p, char *name, char *default_value) /* {{{ */
+{
+	char *value;
+
+	if (cfg_get_string(name, &value) != SUCCESS) {
+		value = default_value;
+	}
+
+	*p = zend_atoi(value, strlen(value));
+	return SUCCESS;
+}
+/* }}} */
 /* {{{ PHP_MINIT_FUNCTION(xcache) */
 static PHP_MINIT_FUNCTION(xcache)
@@ -1892,4 +1894,12 @@
 		}
 	}
+
+	xc_config_long(&xc_php_size,   "xcache.size",       "0");
+	xc_config_hash(&xc_php_hcache, "xcache.count",      "1");
+	xc_config_hash(&xc_php_hentry, "xcache.slots",     "8K");
+
+	xc_config_long(&xc_var_size,   "xcache.var_size",   "0");
+	xc_config_hash(&xc_var_hcache, "xcache.var_count",  "1");
+	xc_config_hash(&xc_var_hentry, "xcache.var_slots", "8K");
 
 	if (xc_php_size <= 0) {
