system: Linux mars.sprixweb.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
cmd: 

Direktori : /usr/local/src/xcache-3.2.0/xcache/
Upload File :
Current File : //usr/local/src/xcache-3.2.0/xcache/xc_compatibility.c

#include "xc_compatibility.h"

#ifndef ZEND_ENGINE_2_3
#include "ext/standard/php_string.h"
size_t xc_dirname(char *path, size_t len) /* {{{ */
{
#ifdef ZEND_ENGINE_2
	return php_dirname(path, len);
#else
	php_dirname(path, len);
	return strlen(path);
#endif
}
/* }}} */

long xc_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