Index: /trunk/utils.c
===================================================================
--- /trunk/utils.c	(revision 670)
+++ /trunk/utils.c	(revision 671)
@@ -921,2 +921,42 @@
 }
 /* }}} */
+
+#ifndef ZEND_ENGINE_2_3
+size_t zend_dirname(char *path, size_t len) /* {{{ */
+{
+	php_dirname(path, len);
+	return strlen(path);
+}
+/* }}} */
+
+long zend_atol(const char *str, int str_len) /* {{{ */
+{
+	long retval;
+
+	if (!str_len) {
+		str_len = strlen(str);
+	}
+
+	retval = strtol(str, NULL, 0);
+	if (str_len > 0) {
+		switch (str[str_len - 1]) {
+		case 'g':
+		case 'G':
+			retval *= 1024;
+			/* break intentionally missing */
+		case 'm':
+		case 'M':
+			retval *= 1024;
+			/* break intentionally missing */
+		case 'k':
+		case 'K':
+			retval *= 1024;
+			break;
+		}
+	}
+
+	return retval;
+}
+/* }}} */
+
+#endif
Index: /trunk/utils.h
===================================================================
--- /trunk/utils.h	(revision 670)
+++ /trunk/utils.h	(revision 671)
@@ -134,4 +134,9 @@
 #endif
 
+#ifndef ZEND_ENGINE_2_3
+size_t zend_dirname(char *path, size_t len);
+long zend_atol(const char *str, int len);
+#endif
+
 typedef struct {
 	zend_uint size;
Index: /trunk/xcache.c
===================================================================
--- /trunk/xcache.c	(revision 670)
+++ /trunk/xcache.c	(revision 671)
@@ -37,12 +37,4 @@
 #include "opcode_spec.h"
 #include "utils.h"
-
-#ifndef ZEND_ENGINE_2_3
-ZEND_DLEXPORT size_t zend_dirname(char *path, size_t len)
-{
-	php_dirname(path, len);
-	return strlen(path);
-}
-#endif
 
 #define VAR_ENTRY_EXPIRED(pentry) ((pentry)->ttl && XG(request_time) > pentry->ctime + (pentry)->ttl)
Index: /trunk/xcache.h
===================================================================
--- /trunk/xcache.h	(revision 670)
+++ /trunk/xcache.h	(revision 671)
@@ -62,8 +62,4 @@
 #ifndef IS_CONSTANT_TYPE_MASK
 #	define IS_CONSTANT_TYPE_MASK (~IS_CONSTANT_INDEX)
-#endif
-
-#ifndef ZEND_ENGINE_2_3
-#define zend_dirname(path, len) xc_dirname(path, len)
 #endif
 
