Lines Matching refs:iter
54 static void php_sxe_iterator_dtor(zend_object_iterator *iter);
55 static int php_sxe_iterator_valid(zend_object_iterator *iter);
56 static zval *php_sxe_iterator_current_data(zend_object_iterator *iter);
57 static void php_sxe_iterator_current_key(zend_object_iterator *iter, zval *key);
58 static void php_sxe_iterator_move_forward(zend_object_iterator *iter);
59 static void php_sxe_iterator_rewind(zend_object_iterator *iter);
70 subnode->iter.type = itertype; in _node_as_zval()
72 subnode->iter.name = (xmlChar*)estrdup(name); in _node_as_zval()
75 subnode->iter.nsprefix = (xmlChar*)estrdup((char*)nsprefix); in _node_as_zval()
76 subnode->iter.isprefix = isprefix; in _node_as_zval()
99 if (sxe && sxe->iter.type != SXE_ITER_NONE) { in php_sxe_get_first_node()
101 if (!Z_ISUNDEF(sxe->iter.data)) { in php_sxe_get_first_node()
102 intern = Z_SXEOBJ_P(&sxe->iter.data); in php_sxe_get_first_node()
130 if (sxe->iter.type == SXE_ITER_NONE) { in sxe_get_element_by_offset()
142 …if (node->type == XML_ELEMENT_NODE && match_ns(sxe, node, sxe->iter.nsprefix, sxe->iter.isprefix))… in sxe_get_element_by_offset()
143 if (sxe->iter.type == SXE_ITER_CHILD || ( in sxe_get_element_by_offset()
144 sxe->iter.type == SXE_ITER_ELEMENT && !xmlStrcmp(node->name, sxe->iter.name))) { in sxe_get_element_by_offset()
167 …if (node->type == XML_ELEMENT_NODE && match_ns(sxe, node, sxe->iter.nsprefix, sxe->iter.isprefix))… in sxe_find_element_by_name()
184 if (sxe->iter.type != SXE_ITER_ATTRLIST) in sxe_get_element_by_name()
186 orgtype = sxe->iter.type; in sxe_get_element_by_name()
187 if (sxe->iter.type == SXE_ITER_NONE) { in sxe_get_element_by_name()
188 sxe->iter.type = SXE_ITER_CHILD; in sxe_get_element_by_name()
191 sxe->iter.type = orgtype; in sxe_get_element_by_name()
194 if (sxe->iter.type == SXE_ITER_ELEMENT) { in sxe_get_element_by_name()
195 orgnode = sxe_find_element_by_name(sxe, node, sxe->iter.name); in sxe_get_element_by_name()
204 …if (node->type == XML_ELEMENT_NODE && match_ns(sxe, node, sxe->iter.nsprefix, sxe->iter.isprefix))… in sxe_get_element_by_name()
244 if (sxe->iter.type == SXE_ITER_ATTRLIST) { in sxe_prop_dim_read()
253 if (sxe->iter.type != SXE_ITER_ATTRLIST) { in sxe_prop_dim_read()
270 if (sxe->iter.type == SXE_ITER_ATTRLIST) { in sxe_prop_dim_read()
275 test = sxe->iter.name != NULL; in sxe_prop_dim_read()
276 } else if (sxe->iter.type != SXE_ITER_CHILD) { in sxe_prop_dim_read()
292 if (Z_TYPE_P(member) != IS_LONG || sxe->iter.type == SXE_ITER_ATTRLIST) { in sxe_prop_dim_read()
295 …(!test || !xmlStrcmp(attr->name, sxe->iter.name)) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.ns… in sxe_prop_dim_read()
297 …e_as_zval(sxe, (xmlNodePtr) attr, rv, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.isprefix); in sxe_prop_dim_read()
306 …ttr->name, sxe->iter.name)) && !xmlStrcmp(attr->name, (xmlChar *)name) && match_ns(sxe, (xmlNodePt… in sxe_prop_dim_read()
307 …_node_as_zval(sxe, (xmlNodePtr) attr, rv, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.ispre… in sxe_prop_dim_read()
324 if (sxe->iter.type == SXE_ITER_CHILD) { in sxe_prop_dim_read()
327 if (sxe->iter.type == SXE_ITER_NONE) { in sxe_prop_dim_read()
337 _node_as_zval(sxe, node, rv, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.isprefix); in sxe_prop_dim_read()
343 _node_as_zval(sxe, node, rv, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.isprefix); in sxe_prop_dim_read()
348 _node_as_zval(sxe, node, rv, SXE_ITER_ELEMENT, name, sxe->iter.nsprefix, sxe->iter.isprefix); in sxe_prop_dim_read()
439 if (sxe->iter.type == SXE_ITER_ATTRLIST) { in sxe_prop_dim_write()
451 if (sxe->iter.type != SXE_ITER_ATTRLIST) { in sxe_prop_dim_write()
476 if (sxe->iter.type == SXE_ITER_ATTRLIST) { in sxe_prop_dim_write()
481 test = sxe->iter.name != NULL; in sxe_prop_dim_write()
482 } else if (sxe->iter.type != SXE_ITER_CHILD) { in sxe_prop_dim_write()
496 if (attribs && !node && sxe->iter.type == SXE_ITER_ELEMENT) { in sxe_prop_dim_write()
497 node = xmlNewChild(mynode, mynode->ns, sxe->iter.name, NULL); in sxe_prop_dim_write()
539 …(!test || !xmlStrcmp(attr->name, sxe->iter.name)) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.ns… in sxe_prop_dim_write()
551 …me, sxe->iter.name)) && !xmlStrcmp(attr->name, (xmlChar *)Z_STRVAL_P(member)) && match_ns(sxe, (xm… in sxe_prop_dim_write()
572 if (sxe->iter.type == SXE_ITER_NONE) { in sxe_prop_dim_write()
590 …ame, (xmlChar *)Z_STRVAL_P(member)) && match_ns(sxe, node, sxe->iter.nsprefix, sxe->iter.isprefix)… in sxe_prop_dim_write()
691 _node_as_zval(sxe, node, &ret, type, name, sxe->iter.nsprefix, sxe->iter.isprefix); in sxe_property_get_adr()
724 if (sxe->iter.type != SXE_ITER_ATTRLIST) { in sxe_prop_dim_exists()
727 if (sxe->iter.type == SXE_ITER_CHILD) { in sxe_prop_dim_exists()
733 if (sxe->iter.type == SXE_ITER_ATTRLIST) { in sxe_prop_dim_exists()
738 test = sxe->iter.name != NULL; in sxe_prop_dim_exists()
739 } else if (sxe->iter.type != SXE_ITER_CHILD) { in sxe_prop_dim_exists()
751 …(!test || !xmlStrcmp(attr->name, sxe->iter.name)) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.ns… in sxe_prop_dim_exists()
762 …me, sxe->iter.name)) && !xmlStrcmp(attr->name, (xmlChar *)Z_STRVAL_P(member)) && match_ns(sxe, (xm… in sxe_prop_dim_exists()
779 if (sxe->iter.type == SXE_ITER_CHILD) { in sxe_prop_dim_exists()
843 if (sxe->iter.type != SXE_ITER_ATTRLIST) { in sxe_prop_dim_delete()
846 if (sxe->iter.type == SXE_ITER_CHILD) { in sxe_prop_dim_delete()
852 if (sxe->iter.type == SXE_ITER_ATTRLIST) { in sxe_prop_dim_delete()
857 test = sxe->iter.name != NULL; in sxe_prop_dim_delete()
858 } else if (sxe->iter.type != SXE_ITER_CHILD) { in sxe_prop_dim_delete()
870 …(!test || !xmlStrcmp(attr->name, sxe->iter.name)) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.ns… in sxe_prop_dim_delete()
883 …me, sxe->iter.name)) && !xmlStrcmp(attr->name, (xmlChar *)Z_STRVAL_P(member)) && match_ns(sxe, (xm… in sxe_prop_dim_delete()
895 if (sxe->iter.type == SXE_ITER_CHILD) { in sxe_prop_dim_delete()
910 …ame, (xmlChar *)Z_STRVAL_P(member)) && match_ns(sxe, node, sxe->iter.nsprefix, sxe->iter.isprefix)… in sxe_prop_dim_delete()
978 subnode->iter.nsprefix = (xmlChar*)estrdup((char *)nsprefix); in _get_base_node_value()
979 subnode->iter.isprefix = isprefix; in _get_base_node_value()
1028 if (sxe->iter.type == SXE_ITER_ELEMENT) { in sxe_prop_is_empty()
1033 test = sxe->iter.name && sxe->iter.type == SXE_ITER_ATTRLIST; in sxe_prop_is_empty()
1035 …(!test || !xmlStrcmp(attr->name, sxe->iter.name)) && match_ns(sxe, (xmlNodePtr)attr, sxe->iter.nsp… in sxe_prop_is_empty()
1046 if (node && sxe->iter.type != SXE_ITER_ATTRLIST) { in sxe_prop_is_empty()
1049 } else if (sxe->iter.type != SXE_ITER_CHILD) { in sxe_prop_is_empty()
1050 …if (sxe->iter.type == SXE_ITER_NONE || !node->children || !node->parent || node->children->next ||… in sxe_prop_is_empty()
1053 ZVAL_COPY_VALUE(&iter_data, &sxe->iter.data); in sxe_prop_is_empty()
1054 ZVAL_UNDEF(&sxe->iter.data); in sxe_prop_is_empty()
1073 …if (node->type == XML_ELEMENT_NODE && (! match_ns(sxe, node, sxe->iter.nsprefix, sxe->iter.isprefi… in sxe_prop_is_empty()
1093 if (!Z_ISUNDEF(sxe->iter.data)) { in sxe_prop_is_empty()
1094 zval_ptr_dtor(&sxe->iter.data); in sxe_prop_is_empty()
1096 ZVAL_COPY_VALUE(&sxe->iter.data, &iter_data); in sxe_prop_is_empty()
1135 if (is_debug || sxe->iter.type != SXE_ITER_CHILD) { in sxe_get_prop_hash()
1136 if (sxe->iter.type == SXE_ITER_ELEMENT) { in sxe_get_prop_hash()
1142 test = sxe->iter.name && sxe->iter.type == SXE_ITER_ATTRLIST; in sxe_get_prop_hash()
1144 …(!test || !xmlStrcmp(attr->name, sxe->iter.name)) && match_ns(sxe, (xmlNodePtr)attr, sxe->iter.nsp… in sxe_get_prop_hash()
1161 if (node && sxe->iter.type != SXE_ITER_ATTRLIST) { in sxe_get_prop_hash()
1166 } else if (sxe->iter.type != SXE_ITER_CHILD) { in sxe_get_prop_hash()
1168 …if ( sxe->iter.type == SXE_ITER_NONE || !node->children || !node->parent || !node->next || node->c… in sxe_get_prop_hash()
1171 ZVAL_COPY_VALUE(&iter_data, &sxe->iter.data); in sxe_get_prop_hash()
1172 ZVAL_UNDEF(&sxe->iter.data); in sxe_get_prop_hash()
1195 …if (node->type == XML_ELEMENT_NODE && (! match_ns(sxe, node, sxe->iter.nsprefix, sxe->iter.isprefi… in sxe_get_prop_hash()
1206 _get_base_node_value(sxe, node, &value, sxe->iter.nsprefix, sxe->iter.isprefix); in sxe_get_prop_hash()
1223 if (!Z_ISUNDEF(sxe->iter.data)) { in sxe_get_prop_hash()
1224 zval_ptr_dtor(&sxe->iter.data); in sxe_get_prop_hash()
1226 ZVAL_COPY_VALUE(&sxe->iter.data, &iter_data); in sxe_get_prop_hash()
1298 if (sxe->iter.type == SXE_ITER_ATTRLIST) { in SXE_METHOD()
1625 if (sxe->iter.type == SXE_ITER_ATTRLIST) { in SXE_METHOD()
1675 if (sxe->iter.type == SXE_ITER_ATTRLIST) { in SXE_METHOD()
1709 if (sxe->iter.type == SXE_ITER_ATTRLIST) { in SXE_METHOD()
1878 if (sxe->iter.type != SXE_ITER_NONE) { in sxe_object_cast_ex()
1938 ZVAL_COPY_VALUE(&data, &sxe->iter.data); in php_sxe_count_elements_helper()
1939 ZVAL_UNDEF(&sxe->iter.data); in php_sxe_count_elements_helper()
1949 if (!Z_ISUNDEF(sxe->iter.data)) { in php_sxe_count_elements_helper()
1950 zval_ptr_dtor(&sxe->iter.data); in php_sxe_count_elements_helper()
1952 ZVAL_COPY_VALUE(&sxe->iter.data, &data); in php_sxe_count_elements_helper()
2023 clone->iter.isprefix = sxe->iter.isprefix; in sxe_object_clone()
2024 if (sxe->iter.name != NULL) { in sxe_object_clone()
2025 clone->iter.name = (xmlChar*)estrdup((char*)sxe->iter.name); in sxe_object_clone()
2027 if (sxe->iter.nsprefix != NULL) { in sxe_object_clone()
2028 clone->iter.nsprefix = (xmlChar*)estrdup((char*)sxe->iter.nsprefix); in sxe_object_clone()
2030 clone->iter.type = sxe->iter.type; in sxe_object_clone()
2051 if (!Z_ISUNDEF(sxe->iter.data)) { in sxe_object_dtor()
2052 zval_ptr_dtor(&sxe->iter.data); in sxe_object_dtor()
2053 ZVAL_UNDEF(&sxe->iter.data); in sxe_object_dtor()
2056 if (sxe->iter.name) { in sxe_object_dtor()
2057 efree(sxe->iter.name); in sxe_object_dtor()
2058 sxe->iter.name = NULL; in sxe_object_dtor()
2060 if (sxe->iter.nsprefix) { in sxe_object_dtor()
2061 efree(sxe->iter.nsprefix); in sxe_object_dtor()
2062 sxe->iter.nsprefix = NULL; in sxe_object_dtor()
2129 intern->iter.type = SXE_ITER_NONE; in php_sxe_object_new()
2130 intern->iter.nsprefix = NULL; in php_sxe_object_new()
2131 intern->iter.name = NULL; in php_sxe_object_new()
2191 sxe->iter.nsprefix = ns_len ? (xmlChar*)estrdup(ns) : NULL; in PHP_FUNCTION()
2192 sxe->iter.isprefix = isprefix; in PHP_FUNCTION()
2245 sxe->iter.nsprefix = ns_len ? (xmlChar*)estrdup(ns) : NULL; in PHP_FUNCTION()
2246 sxe->iter.isprefix = isprefix; in PHP_FUNCTION()
2290 sxe->iter.nsprefix = ns_len ? (xmlChar*)estrdup(ns) : NULL; in SXE_METHOD()
2291 sxe->iter.isprefix = isprefix; in SXE_METHOD()
2310 xmlChar *prefix = sxe->iter.nsprefix; in php_sxe_iterator_fetch()
2311 int isprefix = sxe->iter.isprefix; in php_sxe_iterator_fetch()
2313 if (sxe->iter.type == SXE_ITER_ATTRLIST) { in php_sxe_iterator_fetch()
2314 if (sxe->iter.name) { in php_sxe_iterator_fetch()
2317 if (!xmlStrcmp(node->name, sxe->iter.name) && match_ns(sxe, node, prefix, isprefix)) { in php_sxe_iterator_fetch()
2333 } else if (sxe->iter.type == SXE_ITER_ELEMENT && sxe->iter.name) { in php_sxe_iterator_fetch()
2336 if (!xmlStrcmp(node->name, sxe->iter.name) && match_ns(sxe, node, prefix, isprefix)) { in php_sxe_iterator_fetch()
2354 _node_as_zval(sxe, node, &sxe->iter.data, SXE_ITER_NONE, NULL, prefix, isprefix); in php_sxe_iterator_fetch()
2365 if (!Z_ISUNDEF(sxe->iter.data)) { in php_sxe_reset_iterator()
2366 zval_ptr_dtor(&sxe->iter.data); in php_sxe_reset_iterator()
2367 ZVAL_UNDEF(&sxe->iter.data); in php_sxe_reset_iterator()
2373 switch (sxe->iter.type) { in php_sxe_reset_iterator()
2407 static void php_sxe_iterator_dtor(zend_object_iterator *iter) /* {{{ */ in php_sxe_iterator_dtor() argument
2409 php_sxe_iterator *iterator = (php_sxe_iterator *)iter; in php_sxe_iterator_dtor()
2418 static int php_sxe_iterator_valid(zend_object_iterator *iter) /* {{{ */ in php_sxe_iterator_valid() argument
2420 php_sxe_iterator *iterator = (php_sxe_iterator *)iter; in php_sxe_iterator_valid()
2422 return Z_ISUNDEF(iterator->sxe->iter.data) ? FAILURE : SUCCESS; in php_sxe_iterator_valid()
2426 static zval *php_sxe_iterator_current_data(zend_object_iterator *iter) /* {{{ */ in php_sxe_iterator_current_data() argument
2428 php_sxe_iterator *iterator = (php_sxe_iterator *)iter; in php_sxe_iterator_current_data()
2430 return &iterator->sxe->iter.data; in php_sxe_iterator_current_data()
2434 static void php_sxe_iterator_current_key(zend_object_iterator *iter, zval *key) /* {{{ */ in php_sxe_iterator_current_key() argument
2436 php_sxe_iterator *iterator = (php_sxe_iterator *)iter; in php_sxe_iterator_current_key()
2437 zval *curobj = &iterator->sxe->iter.data; in php_sxe_iterator_current_key()
2458 if (!Z_ISUNDEF(sxe->iter.data)) { in php_sxe_move_forward_iterator()
2459 intern = Z_SXEOBJ_P(&sxe->iter.data); in php_sxe_move_forward_iterator()
2461 zval_ptr_dtor(&sxe->iter.data); in php_sxe_move_forward_iterator()
2462 ZVAL_UNDEF(&sxe->iter.data); in php_sxe_move_forward_iterator()
2471 static void php_sxe_iterator_move_forward(zend_object_iterator *iter) /* {{{ */ in php_sxe_iterator_move_forward() argument
2473 php_sxe_iterator *iterator = (php_sxe_iterator *)iter; in php_sxe_iterator_move_forward()
2484 static void php_sxe_iterator_rewind(zend_object_iterator *iter) /* {{{ */ in php_sxe_iterator_rewind() argument
2488 php_sxe_iterator *iterator = (php_sxe_iterator *)iter; in php_sxe_iterator_rewind()