Changeset 993 for trunk/xcache.c


Ignore:
Timestamp:
2012-07-18T10:27:29+02:00 (3 years ago)
Author:
moo
Message:

refactor: move functions to module

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xcache.c

    r992 r993  
    2727#include "ext/date/php_date.h"
    2828#endif
    29 #include "submodules/xc_optimizer.h"
    30 #include "submodules/xc_coverager.h"
    31 #include "submodules/xc_disassembler.h"
     29
     30#ifdef HAVE_XCACHE_OPTIMIZER
     31#   include "submodules/xc_optimizer.h"
     32#else
     33#   define XCACHE_OPTIMIZER_FUNCTIONS()
     34#endif
     35#ifdef HAVE_XCACHE_COVERAGER
     36#   include "submodules/xc_coverager.h"
     37#else
     38#   define XCACHE_COVERAGER_FUNCTIONS()
     39#endif
     40#ifdef HAVE_XCACHE_DISASSEMBLER
     41#   include "submodules/xc_disassembler.h"
     42#else
     43#   define XCACHE_DISASSEMBLER_FUNCTIONS()
     44#endif
     45
    3246#include "xcache_globals.h"
    3347#include "xc_processor.h"
     
    31733187#endif
    31743188/* }}} */
    3175 #ifdef HAVE_XCACHE_DISASSEMBLER
    3176 /* {{{ proto array  xcache_dasm_file(string filename)
    3177    Disassemble file into opcode array by filename */
    3178 PHP_FUNCTION(xcache_dasm_file)
    3179 {
    3180     char *filename;
    3181     int filename_len;
    3182 
    3183     if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
    3184         return;
    3185     }
    3186     if (!filename_len) RETURN_FALSE;
    3187 
    3188     xc_dasm_file(return_value, filename TSRMLS_CC);
    3189 }
    3190 /* }}} */
    3191 /* {{{ proto array  xcache_dasm_string(string code)
    3192    Disassemble php code into opcode array */
    3193 PHP_FUNCTION(xcache_dasm_string)
    3194 {
    3195     zval *code;
    3196 
    3197     if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &code) == FAILURE) {
    3198         return;
    3199     }
    3200     xc_dasm_string(return_value, code TSRMLS_CC);
    3201 }
    3202 /* }}} */
    3203 #endif
    32043189/* {{{ proto string xcache_encode(string filename)
    32053190   Encode php file into XCache opcode encoded format */
     
    33743359    PHP_FE(xcache_clear_cache,       NULL)
    33753360    PHP_FE(xcache_coredump,          NULL)
     3361    XCACHE_OPTIMIZER_FUNCTIONS()
    33763362#ifdef HAVE_XCACHE_ASSEMBLER
    33773363    PHP_FE(xcache_asm,               NULL)
    33783364#endif
    3379 #ifdef HAVE_XCACHE_DISASSEMBLER
    3380     PHP_FE(xcache_dasm_file,         NULL)
    3381     PHP_FE(xcache_dasm_string,       NULL)
    3382 #endif
     3365    XCACHE_DISASSEMBLER_FUNCTIONS()
    33833366#ifdef HAVE_XCACHE_ENCODER
    33843367    PHP_FE(xcache_encode,            NULL)
     
    33883371    PHP_FE(xcache_decode_string,     NULL)
    33893372#endif
    3390 #ifdef HAVE_XCACHE_COVERAGER
    3391     PHP_FE(xcache_coverager_decode,  NULL)
    3392     PHP_FE(xcache_coverager_start,   NULL)
    3393     PHP_FE(xcache_coverager_stop,    NULL)
    3394     PHP_FE(xcache_coverager_get,     NULL)
    3395 #endif
     3373    XCACHE_COVERAGER_FUNCTIONS()
    33963374    PHP_FE(xcache_get_special_value, NULL)
    33973375    PHP_FE(xcache_get_type,          NULL)
Note: See TracChangeset for help on using the changeset viewer.