Changeset 4 for trunk/processor/main.m4
- Timestamp:
- 05/13/2006 01:54:55 AM (3 years ago)
- Files:
-
- 1 modified
-
trunk/processor/main.m4 (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/processor/main.m4
r1 r4 87 87 ') 88 88 dnl }}} 89 dnl {{{ PROC_CLASS_ENTRY_P 90 define(`PROC_CLASS_ENTRY_P', `PROC_CLASS_ENTRY_P_EX(`dst->$1', `src->$1')`'DONE(`$1')') 89 dnl {{{ PROC_CLASS_ENTRY_P(1:elm) 90 define(`PROC_CLASS_ENTRY_P', `PROC_CLASS_ENTRY_P_EX(`dst->$1', `src->$1', `$1')`'DONE(`$1')') 91 dnl PROC_CLASS_ENTRY_P_EX(1:dst, 2:src, 3:elm-name) 91 92 define(`PROC_CLASS_ENTRY_P_EX', ` 92 93 if ($2) { 93 94 IFSTORE(`$1 = (zend_class_entry *) xc_get_class_num(processor, $2);') 94 95 IFRESTORE(`$1 = xc_get_class(processor, (zend_uint) $2);') 95 IFDASM(`add_assoc_stringl_ex(dst, ZEND_STRS(" patsubst(`$1', `dst->')"), $2->name, strlen($2->name), 1);')96 IFDASM(`add_assoc_stringl_ex(dst, ZEND_STRS("$3"), $2->name, strlen($2->name), 1);') 96 97 } 97 98 else { 98 COPYNULL_EX( $1)99 COPYNULL_EX(`$1', `$3') 99 100 } 100 101 ') … … 132 133 define(`SETNULL', `SETNULL_EX(`dst->$1')DONE(`$1')') 133 134 dnl }}} 134 dnl {{{ COPYNULL_EX 135 dnl {{{ COPYNULL_EX(1:dst, 2:elm-name) 135 136 define(`COPYNULL_EX', ` 136 IFDASM(`add_assoc_null_ex(dst, ZEND_STRS(" patsubst(`$1', `dst->')"));')137 IFDASM(`add_assoc_null_ex(dst, ZEND_STRS("$2"));') 137 138 IFNOTMEMCPY(`IFCOPY(`$1 = NULL;')') 138 139 ') 140 dnl }}} 141 dnl {{{ COPYNULL(1:elm) 142 # foreach(VAR, (LIST), STMT) 143 m4_define([foreach], 144 [m4_pushdef([$1])_foreach([$1], [$2], [$3])m4_popdef([$1])]) 145 m4_define([_arg1], [$1]) 146 m4_define([_foreach], 147 [ifelse([$2], [()], , 148 [m4_define([$1], _arg1$2)$3[]_foreach([$1], 149 (shift$2), 150 [$3])])]) 139 151 define(`COPYNULL', ` 140 COPYNULL_EX(`dst->$1')DONE(`$1') 152 COPYNULL_EX(`dst->$1', `$2')DONE(`$1') 153 ') 154 dnl }}} 155 dnl {{{ LIST_DIFF(1:left-list, 2:right-list) 156 define(`foreach', 157 `pushdef(`$1')_foreach(`$1', `$2', `$3')popdef(`$1')') 158 define(`_arg1', `$1') 159 define(`_foreach', 160 `ifelse(`$2', `()', , 161 `define(`$1', _arg1$2)$3`'_foreach(`$1', 162 (shift$2), 163 `$3')')') 164 define(`LIST_DIFF', `dnl 165 foreach(`i', `($1)', `pushdef(`item_'defn(`i'))')dnl allocate variable for items in $1 166 foreach(`i', `($2)', `pushdef(`item_'defn(`i'))undefine(`item_'defn(`i'))')dnl allocate variable for items in $2, and undefine it 167 foreach(`i', `($1)', `ifdef(`item_'defn(`i'), `defn(`i') ')')dnl see what is still defined 168 foreach(`i', `($2)', `popdef(`item_'defn(`i'))')dnl 169 foreach(`i', `($1)', `popdef(`item_'defn(`i'))')dnl 141 170 ') 142 171 dnl }}} … … 147 176 ')') 148 177 define(`DONE', ` 149 dnl ifelse(regexp(defn(`ELEMENTS'), ` $1'), -1, m4_errprint(`Unknown $1') m4exit(1)) 150 define(`ELEMENTS', patsubst(defn(`ELEMENTS'), ` $1\>')) 178 define(`ELEMENTS_DONE', defn(`ELEMENTS_DONE')`,$1') 151 179 DONE_SIZE(`sizeof(src->$1)') 152 180 ') … … 186 214 EXPORT(`zval') 187 215 188 include( hashtable.m4)189 include(s tring.m4)190 include(s truct.m4)191 include( dispatch.m4)192 include( head.m4)216 include(srcdir`/processor/hashtable.m4') 217 include(srcdir`/processor/string.m4') 218 include(srcdir`/processor/struct.m4') 219 include(srcdir`/processor/dispatch.m4') 220 include(srcdir`/processor/head.m4') 193 221 194 222 define(`IFNOTMEMCPY', `ifdef(`USEMEMCPY', `', `$1')') 195 REDEF(`KIND', `calc') include( processor.m4)196 REDEF(`KIND', `store') include( processor.m4)197 REDEF(`KIND', `restore') include( processor.m4)223 REDEF(`KIND', `calc') include(srcdir`/processor/processor.m4') 224 REDEF(`KIND', `store') include(srcdir`/processor/processor.m4') 225 REDEF(`KIND', `restore') include(srcdir`/processor/processor.m4') 198 226 199 227 REDEF(`IFNOTMEMCPY', `$1') 200 228 #ifdef HAVE_XCACHE_DPRINT 201 REDEF(`KIND', `dprint') include( processor.m4)229 REDEF(`KIND', `dprint') include(srcdir`/processor/processor.m4') 202 230 #endif /* HAVE_XCACHE_DPRINT */ 203 231 #ifdef HAVE_XCACHE_DISASSEMBLER 204 REDEF(`KIND', `dasm') include( processor.m4)232 REDEF(`KIND', `dasm') include(srcdir`/processor/processor.m4') 205 233 #endif /* HAVE_XCACHE_DISASSEMBLER */ 206 234 #ifdef HAVE_XCACHE_ASSEMBLER 207 REDEF(`KIND', `asm') include( processor.m4)235 REDEF(`KIND', `asm') include(srcdir`/processor/processor.m4') 208 236 #endif /* HAVE_XCACHE_ASSEMBLER */ 209 237

