Changeset 1443


Ignore:
Timestamp:
2013-11-06T18:29:26+01:00 (5 months ago)
Author:
moo
Message:

simplify export code

Location:
trunk/processor
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/head.m4

    r1442 r1443  
    1010#include "zend_ini.h" 
    1111 
    12 /* export: #include "xcache.h" :export */ 
     12EXPORT(`#include "xcache.h"') 
    1313#include "xcache.h" 
    14 /* export: #include "mod_cacher/xc_cache.h" :export */ 
     14EXPORT(`#include "mod_cacher/xc_cache.h"') 
    1515#include "mod_cacher/xc_cache.h" 
    16 /* export: #include "xcache/xc_shm.h" :export */ 
     16EXPORT(`#include "xcache/xc_shm.h"') 
    1717#include "xcache/xc_shm.h" 
    18 /* export: #include "xcache/xc_allocator.h" :export */ 
     18EXPORT(`#include "xcache/xc_allocator.h"') 
    1919#include "xcache/xc_allocator.h" 
    2020#include "xcache/xc_const_string.h" 
     
    8686#define MAX_DUP_STR_LEN 256 
    8787dnl }}} 
    88 /* export: typedef struct _xc_processor_t xc_processor_t; :export {{{ */ 
     88dnl {{{ _xc_processor_t 
     89EXPORT(`typedef struct _xc_processor_t xc_processor_t;') 
    8990struct _xc_processor_t { 
    9091    char *p; 
     
    114115IFAUTOCHECK(xc_stack_t allocsizes;) 
    115116}; 
    116 /* }}} */ 
    117 /* export: typedef struct _xc_relocate_t { ptrdiff_t src; ptrdiff_t dst; ptrdiff_t ptrdiff; } xc_relocate_t; :export {{{ */ 
    118 /* }}} */ 
    119 /* export: typedef struct _xc_dasm_t { const zend_op_array *active_op_array_src; } xc_dasm_t; :export {{{ */ 
    120 /* }}} */ 
     117dnl }}} 
     118EXPORT(`typedef struct _xc_relocate_t { ptrdiff_t src; ptrdiff_t dst; ptrdiff_t ptrdiff; } xc_relocate_t;') 
     119EXPORT(`typedef struct _xc_dasm_t { const zend_op_array *active_op_array_src; } xc_dasm_t;') 
    121120/* {{{ memsetptr */ 
    122121IFAUTOCHECK(`dnl 
     
    397396dnl ================ export API 
    398397define(`DEFINE_STORE_API', ` 
    399 /* export: $1 *xc_processor_store_$1(xc_shm_t *shm, xc_allocator_t *allocator, $1 *src TSRMLS_DC); :export {{{ */ 
    400 $1 *xc_processor_store_$1(xc_shm_t *shm, xc_allocator_t *allocator, $1 *src TSRMLS_DC) { 
     398EXPORTED(`$1 *xc_processor_store_$1(xc_shm_t *shm, xc_allocator_t *allocator, $1 *src TSRMLS_DC)') dnl {{{ 
     399{ 
    401400    $1 *dst; 
    402401    xc_processor_t processor; 
     
    476475    return dst; 
    477476} 
    478 /* }}} */ 
     477dnl }}} 
    479478') 
    480479DEFINE_STORE_API(`xc_entry_var_t') 
    481480DEFINE_STORE_API(`xc_entry_php_t') 
    482481DEFINE_STORE_API(`xc_entry_data_php_t') 
    483 /* export: xc_entry_php_t *xc_processor_restore_xc_entry_php_t(xc_entry_php_t *dst, const xc_entry_php_t *src TSRMLS_DC); :export {{{ */ 
    484 xc_entry_php_t *xc_processor_restore_xc_entry_php_t(xc_entry_php_t *dst, const xc_entry_php_t *src TSRMLS_DC) { 
     482EXPORTED(`xc_entry_php_t *xc_processor_restore_xc_entry_php_t(xc_entry_php_t *dst, const xc_entry_php_t *src TSRMLS_DC)') dnl {{{ 
     483{ 
    485484    xc_processor_t processor; 
    486485 
     
    490489    return dst; 
    491490} 
    492 /* }}} */ 
    493 /* export: xc_entry_data_php_t *xc_processor_restore_xc_entry_data_php_t(const xc_entry_php_t *entry_php, xc_entry_data_php_t *dst, const xc_entry_data_php_t *src, zend_bool readonly_protection TSRMLS_DC); :export {{{ */ 
    494 xc_entry_data_php_t *xc_processor_restore_xc_entry_data_php_t(const xc_entry_php_t *entry_php, xc_entry_data_php_t *dst, const xc_entry_data_php_t *src, zend_bool readonly_protection TSRMLS_DC) { 
     491dnl }}} 
     492EXPORTED(`xc_entry_data_php_t *xc_processor_restore_xc_entry_data_php_t(const xc_entry_php_t *entry_php, xc_entry_data_php_t *dst, const xc_entry_data_php_t *src, zend_bool readonly_protection TSRMLS_DC)') dnl {{{ 
     493{ 
    495494    xc_processor_t processor; 
    496495 
     
    512511    return dst; 
    513512} 
    514 /* }}} */ 
    515 /* export: zval *xc_processor_restore_zval(zval *dst, const zval *src, zend_bool have_references TSRMLS_DC); :export {{{ */ 
    516 zval *xc_processor_restore_zval(zval *dst, const zval *src, zend_bool have_references TSRMLS_DC) { 
     513dnl }}} 
     514EXPORTED(`zval *xc_processor_restore_zval(zval *dst, const zval *src, zend_bool have_references TSRMLS_DC)') dnl {{{ 
     515{ 
    517516    xc_processor_t processor; 
    518517 
     
    532531    return dst; 
    533532} 
    534 /* }}} */ 
     533dnl }}} 
    535534define(`DEFINE_RELOCATE_API', ` 
    536 /* export: void xc_processor_relocate_$1(int a TSRMLS_DC); :export {{{ */ 
    537 void xc_processor_relocate_$1(int a TSRMLS_DC) { 
    538 } 
    539 /* }}} */ 
     535EXPORTED(`void xc_processor_relocate_$1(int a TSRMLS_DC)') dnl {{{ 
     536{ 
     537} 
     538dnl }}} 
    540539') 
    541540DEFINE_RELOCATE_API(`xc_entry_var_t') 
    542541DEFINE_RELOCATE_API(`xc_entry_php_t') 
    543542DEFINE_RELOCATE_API(`xc_entry_data_php_t') 
    544 /* export: void xc_dprint(xc_entry_php_t *src, int indent TSRMLS_DC); :export {{{ */ 
    545543#ifdef HAVE_XCACHE_DPRINT 
    546 void xc_dprint(xc_entry_php_t *src, int indent TSRMLS_DC) { 
     544EXPORTED(`void xc_dprint(xc_entry_php_t *src, int indent TSRMLS_DC)') dnl {{{ 
     545{ 
    547546    IFDPRINT(`INDENT()`'fprintf(stderr, "xc_entry_php_t:src");') 
    548547    xc_dprint_xc_entry_php_t(src, indent TSRMLS_CC); 
    549548} 
    550549#endif 
    551 /* }}} */ 
     550dnl }}} 
  • trunk/processor/main.m4

    r1442 r1443  
    128128')') 
    129129dnl }}} 
    130 dnl {{{ EXPORT(1:type, 2:processor) 
    131 define(`EXPORT', `define(`EXPORT_$1_$2', 1)') 
     130dnl {{{ EXPORT(1:code) 
     131define(`EXPORT', `/* export: $1 :export */') 
     132define(`EXPORTED', `EXPORT(`$1;') 
     133$1') 
     134dnl }}} 
     135dnl {{{ EXPORT_PROCESSOR(1:type, 2:processor) 
     136define(`EXPORT_PROCESSOR', `define(`EXPORT_$1_$2', 1)') 
    132137dnl }}} 
    133138dnl {{{ FIXPOINTER(1:type, 2:ele) 
     
    244249dnl }}} 
    245250 
    246 EXPORT(`dasm', `zend_op_array') 
    247 EXPORT(`dasm', `zend_function') 
    248 EXPORT(`dasm', `zend_class_entry') 
    249  
    250 EXPORT(`calc',    `xc_entry_data_php_t') 
    251 EXPORT(`calc',    `xc_entry_php_t') 
    252 EXPORT(`calc',    `xc_entry_var_t') 
    253 EXPORT(`store',   `xc_entry_data_php_t') 
    254 EXPORT(`store',   `xc_entry_php_t') 
    255 EXPORT(`store',   `xc_entry_var_t') 
    256 EXPORT(`restore', `xc_entry_data_php_t') 
    257 EXPORT(`restore', `xc_entry_php_t') 
    258 EXPORT(`dasm',    `xc_entry_data_php_t') 
    259 EXPORT(`dprint',  `xc_entry_php_t') 
    260  
    261 EXPORT(`restore', `zval') 
    262 EXPORT(`dprint',  `zval') 
     251EXPORT_PROCESSOR(`dasm', `zend_op_array') 
     252EXPORT_PROCESSOR(`dasm', `zend_function') 
     253EXPORT_PROCESSOR(`dasm', `zend_class_entry') 
     254 
     255EXPORT_PROCESSOR(`calc',    `xc_entry_data_php_t') 
     256EXPORT_PROCESSOR(`calc',    `xc_entry_php_t') 
     257EXPORT_PROCESSOR(`calc',    `xc_entry_var_t') 
     258EXPORT_PROCESSOR(`store',   `xc_entry_data_php_t') 
     259EXPORT_PROCESSOR(`store',   `xc_entry_php_t') 
     260EXPORT_PROCESSOR(`store',   `xc_entry_var_t') 
     261EXPORT_PROCESSOR(`restore', `xc_entry_data_php_t') 
     262EXPORT_PROCESSOR(`restore', `xc_entry_php_t') 
     263EXPORT_PROCESSOR(`dasm',    `xc_entry_data_php_t') 
     264EXPORT_PROCESSOR(`dprint',  `xc_entry_php_t') 
     265 
     266EXPORT_PROCESSOR(`restore', `zval') 
     267EXPORT_PROCESSOR(`dprint',  `zval') 
    263268 
    264269include(srcdir`/processor/hashtable.m4') 
  • trunk/processor/struct.m4

    r1442 r1443  
    3030    define(`DEFINED_'type, `') 
    3131    ifelse(ifdef(`EXPORT_'PROCESSOR_TYPE`_'type,1)ifdef(`EXPORT_'PROCESSOR_TYPE`_',1)ifdef(`EXPORT__'type,1), `', `', 
    32         `', `', `/* export: DECL_STRUCT_P_FUNC(`$1', `$2') :export */') 
     32        `', `', `EXPORT(`DECL_STRUCT_P_FUNC(`$1', `$2')')') 
    3333    popdef(`type') 
    3434DECL_STRUCT_P_FUNC(`$1', `$2', ` ') 
Note: See TracChangeset for help on using the changeset viewer.