Changeset 917 for trunk/processor/struct.m4
- Timestamp:
- 06/23/2012 06:49:59 AM (11 months ago)
- Files:
-
- 1 modified
-
trunk/processor/struct.m4 (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/processor/struct.m4
r879 r917 172 172 ') 173 173 dnl }}} 174 dnl {{{ STRUCT_ARRAY(1:count , 2:type, 3:elm, 4:name=type, 5:loopcounter)174 dnl {{{ STRUCT_ARRAY(1:count_type, 2:count, 3:type, 4:elm, 5:name=type, 6:loopcounter) 175 175 define(`STRUCT_ARRAY', ` 176 if (SRC(`$ 3')) {176 if (SRC(`$4')) { 177 177 ifelse( 178 `$ 5', `', `inti; pushdef(`LOOPCOUNTER', `i')',179 `', `', `pushdef(`LOOPCOUNTER', `$ 5')')180 pushdefFUNC_NAME(`$ 2', `$4')178 `$6', `', `ifelse(`$1', `', `size_t', `$1') i; pushdef(`LOOPCOUNTER', `i')', 179 `', `', `pushdef(`LOOPCOUNTER', `$6')') 180 pushdefFUNC_NAME(`$3', `$5') 181 181 IFDASM(` 182 182 zval *arr; … … 185 185 186 186 for (LOOPCOUNTER = 0; 187 ifelse(`$ 1', `', `SRC(`$3[LOOPCOUNTER]')',188 `', `', `LOOPCOUNTER < SRC(`$ 1')');187 ifelse(`$2', `', `SRC(`$4[LOOPCOUNTER]')', 188 `', `', `LOOPCOUNTER < SRC(`$2')'); 189 189 ++LOOPCOUNTER) { 190 190 zval *zv; … … 192 192 ALLOC_INIT_ZVAL(zv); 193 193 array_init(zv); 194 FUNC_NAME (zv, &(SRC(`$ 3[LOOPCOUNTER]')) TSRMLS_CC);194 FUNC_NAME (zv, &(SRC(`$4[LOOPCOUNTER]')) TSRMLS_CC); 195 195 add_next_index_zval(arr, zv); 196 196 } 197 add_assoc_zval_ex(dst, ZEND_STRS("$ 3"), arr);197 add_assoc_zval_ex(dst, ZEND_STRS("$4"), arr); 198 198 ', ` 199 199 dnl find count with NULL 200 ifelse(`$ 1', `', `200 ifelse(`$2', `', ` 201 201 size_t count = 0; 202 while (SRC(`$ 3[count]')) {202 while (SRC(`$4[count]')) { 203 203 ++count; 204 204 } … … 206 206 pushdef(`ARRAY_ELEMENT_COUNT', `count') 207 207 ', 208 `', `', `pushdef(`ARRAY_ELEMENT_COUNT', `SRC(`$ 1')')')209 ALLOC(`dst->$ 3', `$2', `ARRAY_ELEMENT_COUNT')208 `', `', `pushdef(`ARRAY_ELEMENT_COUNT', `SRC(`$2')')') 209 ALLOC(`dst->$4', `$3', `ARRAY_ELEMENT_COUNT') 210 210 popdef(`ARRAY_ELEMENT_COUNT') 211 211 212 212 for (LOOPCOUNTER = 0; 213 ifelse(`$ 1', `', `SRC(`$3[LOOPCOUNTER]')',214 `', `', `LOOPCOUNTER < SRC(`$ 1')');213 ifelse(`$2', `', `SRC(`$4[LOOPCOUNTER]')', 214 `', `', `LOOPCOUNTER < SRC(`$2')'); 215 215 ++LOOPCOUNTER) { 216 216 DISABLECHECK(` 217 STRUCT(`$ 2', `$3[LOOPCOUNTER]', `$4')217 STRUCT(`$3', `$4[LOOPCOUNTER]', `$5') 218 218 ') 219 219 } 220 220 dnl the end marker 221 ifelse(`$ 1', `', `IFCOPY(`DST(`$3[LOOPCOUNTER]') = NULL;')')221 ifelse(`$2', `', `IFCOPY(`DST(`$4[LOOPCOUNTER]') = NULL;')') 222 222 ')dnl IFDASM 223 DONE(`$ 3')223 DONE(`$4') 224 224 popdef(`FUNC_NAME') 225 225 popdef(`LOOPCOUNTER') 226 226 } 227 227 else { 228 COPYNULL(`$ 3')229 } 230 ') 231 dnl }}} 228 COPYNULL(`$4') 229 } 230 ') 231 dnl }}}

