Changeset 991 in svn for trunk/xcache/xc_sandbox.c


Ignore:
Timestamp:
2012-07-18T07:52:35Z (3 years ago)
Author:
Xuefer
Message:

refactor: split compatibility

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xcache/xc_sandbox.c

    r990 r991  
    434434#endif
    435435
    436 #ifndef ZEND_ENGINE_2_3
    437 #include "ext/standard/php_string.h"
    438 size_t xc_dirname(char *path, size_t len) /* {{{ */
    439 {
    440 #ifdef ZEND_ENGINE_2
    441     return php_dirname(path, len);
    442 #else
    443     php_dirname(path, len);
    444     return strlen(path);
    445 #endif
    446 }
    447 /* }}} */
    448 
    449 long xc_atol(const char *str, int str_len) /* {{{ */
    450 {
    451     long retval;
    452 
    453     if (!str_len) {
    454         str_len = strlen(str);
    455     }
    456 
    457     retval = strtol(str, NULL, 0);
    458     if (str_len > 0) {
    459         switch (str[str_len - 1]) {
    460         case 'g':
    461         case 'G':
    462             retval *= 1024;
    463             /* break intentionally missing */
    464         case 'm':
    465         case 'M':
    466             retval *= 1024;
    467             /* break intentionally missing */
    468         case 'k':
    469         case 'K':
    470             retval *= 1024;
    471             break;
    472         }
    473     }
    474 
    475     return retval;
    476 }
    477 /* }}} */
    478 
    479 #endif
    480 
    481436/* init/destroy */
    482437int xc_util_init(int module_number TSRMLS_DC) /* {{{ */
Note: See TracChangeset for help on using the changeset viewer.