cvs: ZendEngine2 / zend_execute.c zend_interfaces.c zend_iterators.h php-src/ext/simplexml simplexml.c php-src/ext/spl spl_directory.c
spl_iterators.c spl_iterators.h php-src/ext/sqlite php_sqlite.h sqlite.c php-src/ext/sqlite/tests sqlite_010.phpt sqlite_013.phpt sqlite_016.phpt
sqlite_023.phpt sqlite_024.phpt

From: Date: Mon, 08 Mar 2004 18:05:42 +0000
Subject: cvs: ZendEngine2 / zend_execute.c zend_interfaces.c zend_iterators.h php-src/ext/simplexml simplexml.c php-src/ext/spl spl_directory.c
spl_iterators.c spl_iterators.h php-src/ext/sqlite php_sqlite.h sqlite.c php-src/ext/sqlite/tests sqlite_010.phpt sqlite_013.phpt sqlite_016.phpt
sqlite_023.phpt sqlite_024.phpt
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-2455@lists.php.net to get a copy of this message
helly Mon Mar 8 13:05:42 2004 EDT Modified files: /php-src/ext/sqlite php_sqlite.h sqlite.c /php-src/ext/sqlite/tests sqlite_010.phpt sqlite_013.phpt sqlite_016.phpt sqlite_023.phpt sqlite_024.phpt /php-src/ext/simplexml simplexml.c /php-src/ext/spl spl_directory.c spl_iterators.c spl_iterators.h /ZendEngine2 zend_execute.c zend_interfaces.c zend_iterators.h Log: Rename hasMore() to valid() as discussed. (Part II)

http://cvs.php.net/diff.php/php-src/ext/sqlite/php_sqlite.h?r1=1.28&r2=1.29&ty=u Index: php-src/ext/sqlite/php_sqlite.h diff -u php-src/ext/sqlite/php_sqlite.h:1.28 php-src/ext/sqlite/php_sqlite.h:1.29 --- php-src/ext/sqlite/php_sqlite.h:1.28 Thu Jan 8 12:32:50 2004 +++ php-src/ext/sqlite/php_sqlite.h Mon Mar 8 13:05:38 2004 @@ -17,7 +17,7 @@ | Marcus Boerger <helly@php.net> | +----------------------------------------------------------------------+ - $Id: php_sqlite.h,v 1.28 2004/01/08 17:32:50 sniper Exp $ + $Id: php_sqlite.h,v 1.29 2004/03/08 18:05:38 helly Exp $ */ #ifndef PHP_SQLITE_H @@ -65,7 +65,7 @@ PHP_FUNCTION(sqlite_next); PHP_FUNCTION(sqlite_prev); -PHP_FUNCTION(sqlite_has_more); +PHP_FUNCTION(sqlite_valid); PHP_FUNCTION(sqlite_has_prev); PHP_FUNCTION(sqlite_libversion); http://cvs.php.net/diff.php/php-src/ext/sqlite/sqlite.c?r1=1.130&r2=1.131&ty=u Index: php-src/ext/sqlite/sqlite.c diff -u php-src/ext/sqlite/sqlite.c:1.130 php-src/ext/sqlite/sqlite.c:1.131 --- php-src/ext/sqlite/sqlite.c:1.130 Mon Mar 8 12:33:28 2004 +++ php-src/ext/sqlite/sqlite.c Mon Mar 8 13:05:38 2004 @@ -17,7 +17,7 @@ | Marcus Boerger <helly@php.net> | +----------------------------------------------------------------------+ - $Id: sqlite.c,v 1.130 2004/03/08 17:33:28 helly Exp $ + $Id: sqlite.c,v 1.131 2004/03/08 18:05:38 helly Exp $ */ #ifdef HAVE_CONFIG_H @@ -171,7 +171,8 @@ PHP_FE(sqlite_rewind, NULL) PHP_FE(sqlite_next, NULL) PHP_FE(sqlite_prev, NULL) - PHP_FE(sqlite_has_more, NULL) + PHP_FE(sqlite_valid, NULL) + PHP_FALIAS(sqlite_has_more, sqlite_valid, NULL) PHP_FE(sqlite_has_prev, NULL) PHP_FE(sqlite_escape_string, NULL) PHP_FE(sqlite_busy_timeout, NULL) @@ -217,7 +218,7 @@ /* spl_forward */ PHP_ME_MAPPING(current, sqlite_current, NULL) PHP_ME_MAPPING(next, sqlite_next, NULL) - PHP_ME_MAPPING(valid, sqlite_has_more, NULL) + PHP_ME_MAPPING(valid, sqlite_valid, NULL) /* spl_sequence */ PHP_ME_MAPPING(rewind, sqlite_rewind, NULL) /* additional */ @@ -239,7 +240,7 @@ /* spl_forward */ PHP_ME_MAPPING(current, sqlite_current, NULL) PHP_ME_MAPPING(next, sqlite_next, NULL) - PHP_ME_MAPPING(valid, sqlite_has_more, NULL) + PHP_ME_MAPPING(valid, sqlite_valid, NULL) {NULL, NULL, NULL} }; @@ -888,7 +889,7 @@ } } -int sqlite_iterator_has_more(zend_object_iterator *iter TSRMLS_DC) +int sqlite_iterator_valid(zend_object_iterator *iter TSRMLS_DC) { struct php_sqlite_result *res = ((sqlite_object_iterator*)iter)->res; @@ -944,7 +945,7 @@ zend_object_iterator_funcs sqlite_ub_query_iterator_funcs = { sqlite_iterator_dtor, - sqlite_iterator_has_more, + sqlite_iterator_valid, sqlite_iterator_get_current_data, sqlite_iterator_get_current_key, sqlite_iterator_move_forward, @@ -953,7 +954,7 @@ zend_object_iterator_funcs sqlite_query_iterator_funcs = { sqlite_iterator_dtor, - sqlite_iterator_has_more, + sqlite_iterator_valid, sqlite_iterator_get_current_data, sqlite_iterator_get_current_key, sqlite_iterator_move_forward, @@ -1054,7 +1055,7 @@ { php_info_print_table_start(); php_info_print_table_header(2, "SQLite support", "enabled"); - php_info_print_table_row(2, "PECL Module version", PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.130 2004/03/08 17:33:28 helly Exp $"); + php_info_print_table_row(2, "PECL Module version", PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.131 2004/03/08 18:05:38 helly Exp $"); php_info_print_table_row(2, "SQLite Library", sqlite_libversion()); php_info_print_table_row(2, "SQLite Encoding", sqlite_libencoding()); php_info_print_table_end(); @@ -2346,9 +2347,9 @@ } /* }}} */ -/* {{{ proto bool sqlite_has_more(resource result) +/* {{{ proto bool sqlite_valid(resource result) Returns whether more rows are available. */ -PHP_FUNCTION(sqlite_has_more) +PHP_FUNCTION(sqlite_valid) { zval *zres; struct php_sqlite_result *res; http://cvs.php.net/diff.php/php-src/ext/sqlite/tests/sqlite_010.phpt?r1=1.4&r2=1.5&ty=u Index: php-src/ext/sqlite/tests/sqlite_010.phpt diff -u php-src/ext/sqlite/tests/sqlite_010.phpt:1.4 php-src/ext/sqlite/tests/sqlite_010.phpt:1.5 --- php-src/ext/sqlite/tests/sqlite_010.phpt:1.4 Thu Dec 4 21:12:21 2003 +++ php-src/ext/sqlite/tests/sqlite_010.phpt Mon Mar 8 13:05:39 2004 @@ -22,17 +22,17 @@ } $r = sqlite_unbuffered_query("SELECT a from strings", $db); -while (sqlite_has_more($r)) { +while (sqlite_valid($r)) { var_dump(sqlite_current($r, SQLITE_NUM)); sqlite_next($r); } $r = sqlite_query("SELECT a from strings", $db); -while (sqlite_has_more($r)) { +while (sqlite_valid($r)) { var_dump(sqlite_current($r, SQLITE_NUM)); sqlite_next($r); } sqlite_rewind($r); -while (sqlite_has_more($r)) { +while (sqlite_valid($r)) { var_dump(sqlite_current($r, SQLITE_NUM)); sqlite_next($r); } http://cvs.php.net/diff.php/php-src/ext/sqlite/tests/sqlite_013.phpt?r1=1.3&r2=1.4&ty=u Index: php-src/ext/sqlite/tests/sqlite_013.phpt diff -u php-src/ext/sqlite/tests/sqlite_013.phpt:1.3 php-src/ext/sqlite/tests/sqlite_013.phpt:1.4 --- php-src/ext/sqlite/tests/sqlite_013.phpt:1.3 Thu Dec 4 21:12:21 2003 +++ php-src/ext/sqlite/tests/sqlite_013.phpt Mon Mar 8 13:05:39 2004 @@ -22,7 +22,7 @@ echo "====BUFFERED====\n"; $r = sqlite_query("SELECT a, b from strings", $db); -while (sqlite_has_more($r)) { +while (sqlite_valid($r)) { var_dump(sqlite_current($r, SQLITE_NUM)); var_dump(sqlite_column($r, 0)); var_dump(sqlite_column($r, 1)); @@ -32,7 +32,7 @@ } echo "====UNBUFFERED====\n"; $r = sqlite_unbuffered_query("SELECT a, b from strings", $db); -while (sqlite_has_more($r)) { +while (sqlite_valid($r)) { var_dump(sqlite_column($r, 0)); var_dump(sqlite_column($r, 'b')); var_dump(sqlite_column($r, 1)); http://cvs.php.net/diff.php/php-src/ext/sqlite/tests/sqlite_016.phpt?r1=1.4&r2=1.5&ty=u Index: php-src/ext/sqlite/tests/sqlite_016.phpt diff -u php-src/ext/sqlite/tests/sqlite_016.phpt:1.4 php-src/ext/sqlite/tests/sqlite_016.phpt:1.5 --- php-src/ext/sqlite/tests/sqlite_016.phpt:1.4 Thu Dec 4 21:12:21 2003 +++ php-src/ext/sqlite/tests/sqlite_016.phpt Mon Mar 8 13:05:39 2004 @@ -22,12 +22,12 @@ echo "====BUFFERED====\n"; $r = sqlite_query("SELECT a, b from strings", $db); -while (sqlite_has_more($r)) { +while (sqlite_valid($r)) { var_dump(sqlite_fetch_single($r)); } echo "====UNBUFFERED====\n"; $r = sqlite_unbuffered_query("SELECT a, b from strings", $db); -while (sqlite_has_more($r)) { +while (sqlite_valid($r)) { var_dump(sqlite_fetch_single($r)); } http://cvs.php.net/diff.php/php-src/ext/sqlite/tests/sqlite_023.phpt?r1=1.2&r2=1.3&ty=u Index: php-src/ext/sqlite/tests/sqlite_023.phpt diff -u php-src/ext/sqlite/tests/sqlite_023.phpt:1.2 php-src/ext/sqlite/tests/sqlite_023.phpt:1.3 --- php-src/ext/sqlite/tests/sqlite_023.phpt:1.2 Thu Dec 4 21:12:21 2003 +++ php-src/ext/sqlite/tests/sqlite_023.phpt Mon Mar 8 13:05:39 2004 @@ -24,7 +24,7 @@ $r = sqlite_query("SELECT a FROM strings", $db, SQLITE_NUM); echo "====TRAVERSE====\n"; -for(sqlite_rewind($r); sqlite_has_more($r); sqlite_next($r)) { +for(sqlite_rewind($r); sqlite_valid($r); sqlite_next($r)) { var_dump(sqlite_current($r)); } @@ -39,7 +39,7 @@ $r = sqlite_unbuffered_query("SELECT a FROM strings", $db, SQLITE_NUM); echo "====TRAVERSE====\n"; -for(sqlite_rewind($r); sqlite_has_more($r); sqlite_next($r)) { +for(sqlite_rewind($r); sqlite_valid($r); sqlite_next($r)) { var_dump(sqlite_current($r)); } http://cvs.php.net/diff.php/php-src/ext/sqlite/tests/sqlite_024.phpt?r1=1.4&r2=1.5&ty=u Index: php-src/ext/sqlite/tests/sqlite_024.phpt diff -u php-src/ext/sqlite/tests/sqlite_024.phpt:1.4 php-src/ext/sqlite/tests/sqlite_024.phpt:1.5 --- php-src/ext/sqlite/tests/sqlite_024.phpt:1.4 Thu Dec 4 21:12:21 2003 +++ php-src/ext/sqlite/tests/sqlite_024.phpt Mon Mar 8 13:05:39 2004 @@ -29,13 +29,13 @@ echo "====class24====\n"; $res = sqlite_query($db, "SELECT a FROM strings", SQLITE_ASSOC); -while (sqlite_has_more($res)) { +while (sqlite_valid($res)) { var_dump(sqlite_fetch_object($res, 'class24')); } echo "====stdclass====\n"; $res = sqlite_query($db, "SELECT a FROM strings", SQLITE_ASSOC); -while (sqlite_has_more($res)) { +while (sqlite_valid($res)) { var_dump(sqlite_fetch_object($res)); } http://cvs.php.net/diff.php/php-src/ext/simplexml/simplexml.c?r1=1.132&r2=1.133&ty=u Index: php-src/ext/simplexml/simplexml.c diff -u php-src/ext/simplexml/simplexml.c:1.132 php-src/ext/simplexml/simplexml.c:1.133 --- php-src/ext/simplexml/simplexml.c:1.132 Mon Mar 1 07:09:23 2004 +++ php-src/ext/simplexml/simplexml.c Mon Mar 8 13:05:40 2004 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: simplexml.c,v 1.132 2004/03/01 12:09:23 rrichards Exp $ */ +/* $Id: simplexml.c,v 1.133 2004/03/08 18:05:40 helly Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1294,7 +1294,7 @@ } php_sxe_iterator; static void php_sxe_iterator_dtor(zend_object_iterator *iter TSRMLS_DC); -static int php_sxe_iterator_has_more(zend_object_iterator *iter TSRMLS_DC); +static int php_sxe_iterator_valid(zend_object_iterator *iter TSRMLS_DC); static void php_sxe_iterator_current_data(zend_object_iterator *iter, zval ***data TSRMLS_DC); static int php_sxe_iterator_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC); static void php_sxe_iterator_move_forward(zend_object_iterator *iter TSRMLS_DC); @@ -1302,7 +1302,7 @@ zend_object_iterator_funcs php_sxe_iterator_funcs = { php_sxe_iterator_dtor, - php_sxe_iterator_has_more, + php_sxe_iterator_valid, php_sxe_iterator_current_data, php_sxe_iterator_current_key, php_sxe_iterator_move_forward, @@ -1388,7 +1388,7 @@ efree(iterator); } -static int php_sxe_iterator_has_more(zend_object_iterator *iter TSRMLS_DC) +static int php_sxe_iterator_valid(zend_object_iterator *iter TSRMLS_DC) { php_sxe_iterator *iterator = (php_sxe_iterator *)iter; @@ -1634,7 +1634,7 @@ { php_info_print_table_start(); php_info_print_table_header(2, "Simplexml support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision: 1.132 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.133 $"); php_info_print_table_row(2, "Schema support", #ifdef LIBXML_SCHEMAS_ENABLED "enabled"); http://cvs.php.net/diff.php/php-src/ext/spl/spl_directory.c?r1=1.24&r2=1.25&ty=u Index: php-src/ext/spl/spl_directory.c diff -u php-src/ext/spl/spl_directory.c:1.24 php-src/ext/spl/spl_directory.c:1.25 --- php-src/ext/spl/spl_directory.c:1.24 Mon Mar 8 12:33:29 2004 +++ php-src/ext/spl/spl_directory.c Mon Mar 8 13:05:41 2004 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: spl_directory.c,v 1.24 2004/03/08 17:33:29 helly Exp $ */ +/* $Id: spl_directory.c,v 1.25 2004/03/08 18:05:41 helly Exp $ */ #ifdef HAVE_CONFIG_H # include "config.h" @@ -506,7 +506,7 @@ /* forward declarations to the iterator handlers */ static void spl_ce_dir_it_dtor(zend_object_iterator *iter TSRMLS_DC); -static int spl_ce_dir_it_has_more(zend_object_iterator *iter TSRMLS_DC); +static int spl_ce_dir_it_valid(zend_object_iterator *iter TSRMLS_DC); static void spl_ce_dir_it_current_data(zend_object_iterator *iter, zval ***data TSRMLS_DC); static int spl_ce_dir_it_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC); static void spl_ce_dir_it_move_forward(zend_object_iterator *iter TSRMLS_DC); @@ -516,7 +516,7 @@ /* iterator handler table */ zend_object_iterator_funcs spl_ce_dir_it_funcs = { spl_ce_dir_it_dtor, - spl_ce_dir_it_has_more, + spl_ce_dir_it_valid, spl_ce_dir_it_current_data, spl_ce_dir_it_current_key, spl_ce_dir_it_move_forward, @@ -555,8 +555,8 @@ /* }}} */ -/* {{{ spl_ce_dir_it_has_more */ -static int spl_ce_dir_it_has_more(zend_object_iterator *iter TSRMLS_DC) +/* {{{ spl_ce_dir_it_valid */ +static int spl_ce_dir_it_valid(zend_object_iterator *iter TSRMLS_DC) { spl_ce_dir_it *iterator = (spl_ce_dir_it *)iter; spl_ce_dir_object *object = iterator->object; @@ -677,7 +677,7 @@ /* iterator handler table */ zend_object_iterator_funcs spl_ce_dir_tree_it_funcs = { spl_ce_dir_it_dtor, - spl_ce_dir_it_has_more, + spl_ce_dir_it_valid, spl_ce_dir_it_current_data, spl_ce_dir_tree_it_current_key, spl_ce_dir_tree_it_move_forward, http://cvs.php.net/diff.php/php-src/ext/spl/spl_iterators.c?r1=1.23&r2=1.24&ty=u Index: php-src/ext/spl/spl_iterators.c diff -u php-src/ext/spl/spl_iterators.c:1.23 php-src/ext/spl/spl_iterators.c:1.24 --- php-src/ext/spl/spl_iterators.c:1.23 Mon Mar 8 12:33:29 2004 +++ php-src/ext/spl/spl_iterators.c Mon Mar 8 13:05:41 2004 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: spl_iterators.c,v 1.23 2004/03/08 17:33:29 helly Exp $ */ +/* $Id: spl_iterators.c,v 1.24 2004/03/08 18:05:41 helly Exp $ */ #ifdef HAVE_CONFIG_H # include "config.h" @@ -137,14 +137,14 @@ efree(iter); } -static int spl_recursive_it_has_more_ex(spl_recursive_it_object *object TSRMLS_DC) +static int spl_recursive_it_valid_ex(spl_recursive_it_object *object TSRMLS_DC) { zend_object_iterator *sub_iter; int level = object->level; while (level >=0) { sub_iter = object->iterators[level].iterator; - if (sub_iter->funcs->has_more(sub_iter TSRMLS_CC) == SUCCESS) { + if (sub_iter->funcs->valid(sub_iter TSRMLS_CC) == SUCCESS) { return SUCCESS; } level--; @@ -152,11 +152,11 @@ return FAILURE; } -static int spl_recursive_it_has_more(zend_object_iterator *iter TSRMLS_DC) +static int spl_recursive_it_valid(zend_object_iterator *iter TSRMLS_DC) { spl_recursive_it_object *object = (spl_recursive_it_object*)iter->data; - return spl_recursive_it_has_more_ex(object TSRMLS_CC); + return spl_recursive_it_valid_ex(object TSRMLS_CC); } static void spl_recursive_it_get_current_data(zend_object_iterator *iter, zval ***data TSRMLS_DC) @@ -195,7 +195,7 @@ case RS_NEXT: iterator->funcs->move_forward(iterator TSRMLS_CC); case RS_START: - if (iterator->funcs->has_more(iterator TSRMLS_CC) == FAILURE) { + if (iterator->funcs->valid(iterator TSRMLS_CC) == FAILURE) { break; } object->iterators[object->level].state = RS_TEST; @@ -305,7 +305,7 @@ zend_object_iterator_funcs spl_recursive_it_iterator_funcs = { spl_recursive_it_dtor, - spl_recursive_it_has_more, + spl_recursive_it_valid, spl_recursive_it_get_current_data, spl_recursive_it_get_current_key, spl_recursive_it_move_forward, @@ -352,7 +352,7 @@ { spl_recursive_it_object *object = (spl_recursive_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - RETURN_BOOL(spl_recursive_it_has_more_ex(object TSRMLS_CC) == SUCCESS); + RETURN_BOOL(spl_recursive_it_valid_ex(object TSRMLS_CC) == SUCCESS); } SPL_METHOD(RecursiveIteratorIterator, key) @@ -458,7 +458,7 @@ #if MBO_0 static int spl_dual_it_gets_implemented(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC) { - class_type->iterator_funcs.zf_has_more = NULL; + class_type->iterator_funcs.zf_valid = NULL; class_type->iterator_funcs.zf_current = NULL; class_type->iterator_funcs.zf_key = NULL; class_type->iterator_funcs.zf_next = NULL; @@ -626,10 +626,10 @@ } } -static INLINE int spl_dual_it_has_more(spl_dual_it_object *intern TSRMLS_DC) +static INLINE int spl_dual_it_valid(spl_dual_it_object *intern TSRMLS_DC) { /* FAILURE / SUCCESS */ - return intern->inner.iterator->funcs->has_more(intern->inner.iterator TSRMLS_CC); + return intern->inner.iterator->funcs->valid(intern->inner.iterator TSRMLS_CC); } static INLINE int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more TSRMLS_DC) @@ -637,7 +637,7 @@ zval **data; spl_dual_it_free(intern TSRMLS_CC); - if (!check_more || spl_dual_it_has_more(intern TSRMLS_CC) == SUCCESS) { + if (!check_more || spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) { intern->inner.iterator->funcs->get_current_data(intern->inner.iterator, &data TSRMLS_CC); intern->current.data = *data; intern->current.data->refcount++; @@ -863,13 +863,13 @@ {NULL, NULL, NULL} }; -static INLINE int spl_limit_it_has_more(spl_dual_it_object *intern TSRMLS_DC) +static INLINE int spl_limit_it_valid(spl_dual_it_object *intern TSRMLS_DC) { /* FAILURE / SUCCESS */ if (intern->u.limit.count != -1 && intern->current.pos >= intern->u.limit.offset + intern->u.limit.count) { return FAILURE; } else { - return spl_dual_it_has_more(intern TSRMLS_CC); + return spl_dual_it_valid(intern TSRMLS_CC); } } @@ -894,7 +894,7 @@ spl_dual_it_free(intern TSRMLS_CC); zend_user_it_free_current(intern->inner.iterator TSRMLS_CC); intern->current.pos = pos; - if (spl_limit_it_has_more(intern TSRMLS_CC) == SUCCESS) { + if (spl_limit_it_valid(intern TSRMLS_CC) == SUCCESS) { spl_dual_it_fetch(intern, 0 TSRMLS_CC); } } else { @@ -903,10 +903,10 @@ if (pos < intern->current.pos) { spl_dual_it_rewind(intern TSRMLS_CC); } - while (pos > intern->current.pos && spl_dual_it_has_more(intern TSRMLS_CC) == SUCCESS) { + while (pos > intern->current.pos && spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) { spl_dual_it_next(intern, 1 TSRMLS_CC); } - if (spl_dual_it_has_more(intern TSRMLS_CC) == SUCCESS) { + if (spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) { spl_dual_it_fetch(intern, 1 TSRMLS_CC); } } @@ -932,7 +932,7 @@ intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); -/* RETURN_BOOL(spl_limit_it_has_more(intern TSRMLS_CC) == SUCCESS);*/ +/* RETURN_BOOL(spl_limit_it_valid(intern TSRMLS_CC) == SUCCESS);*/ RETURN_BOOL((intern->u.limit.count == -1 || intern->current.pos < intern->u.limit.offset + intern->u.limit.count) && intern->current.data); } @@ -1003,20 +1003,20 @@ {NULL, NULL, NULL} }; -static INLINE int spl_caching_it_has_more(spl_dual_it_object *intern TSRMLS_DC) +static INLINE int spl_caching_it_valid(spl_dual_it_object *intern TSRMLS_DC) { - return intern->u.caching.flags & CIT_HAS_MORE ? SUCCESS : FAILURE; + return intern->u.caching.flags & CIT_VALID ? SUCCESS : FAILURE; } static INLINE int spl_caching_it_has_next(spl_dual_it_object *intern TSRMLS_DC) { - return spl_dual_it_has_more(intern TSRMLS_CC); + return spl_dual_it_valid(intern TSRMLS_CC); } static INLINE void spl_caching_it_next(spl_dual_it_object *intern TSRMLS_DC) { if (spl_dual_it_fetch(intern, 1 TSRMLS_CC) == SUCCESS) { - intern->u.caching.flags |= CIT_HAS_MORE; + intern->u.caching.flags |= CIT_VALID; if (intern->dit_type == DIT_CachingRecursiveIterator) { zval *retval, *zchildren, zflags; zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "haschildren", &retval); @@ -1051,7 +1051,7 @@ } spl_dual_it_next(intern, 0 TSRMLS_CC); } else { - intern->u.caching.flags &= ~CIT_HAS_MORE; + intern->u.caching.flags &= ~CIT_VALID; } } @@ -1081,7 +1081,7 @@ intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - RETURN_BOOL(spl_caching_it_has_more(intern TSRMLS_CC) == SUCCESS); + RETURN_BOOL(spl_caching_it_valid(intern TSRMLS_CC) == SUCCESS); } SPL_METHOD(CachingIterator, next) http://cvs.php.net/diff.php/php-src/ext/spl/spl_iterators.h?r1=1.8&r2=1.9&ty=u Index: php-src/ext/spl/spl_iterators.h diff -u php-src/ext/spl/spl_iterators.h:1.8 php-src/ext/spl/spl_iterators.h:1.9 --- php-src/ext/spl/spl_iterators.h:1.8 Sun Feb 22 20:53:39 2004 +++ php-src/ext/spl/spl_iterators.h Mon Mar 8 13:05:41 2004 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: spl_iterators.h,v 1.8 2004/02/23 01:53:39 abies Exp $ */ +/* $Id: spl_iterators.h,v 1.9 2004/03/08 18:05:41 helly Exp $ */ #ifndef SPL_ITERATORS_H #define SPL_ITERATORS_H @@ -48,7 +48,7 @@ CIT_CATCH_GET_CHILD = 2, CIT_PUBLIC = CIT_CALL_TOSTRING|CIT_CATCH_GET_CHILD, /* private */ - CIT_HAS_MORE = 4, + CIT_VALID = 4, CIT_HAS_CHILDREN = 8 }; @@ -75,7 +75,7 @@ long count; } limit; struct { - int flags; /* CIT_HAS_MORE, CIT_CALL_TOSTRING, CIT_CATCH_GET_CHILD */ + int flags; /* CIT_VALID, CIT_CALL_TOSTRING, CIT_CATCH_GET_CHILD */ zval *zstr; zval *zchildren; } caching; http://cvs.php.net/diff.php/ZendEngine2/zend_execute.c?r1=1.619&r2=1.620&ty=u Index: ZendEngine2/zend_execute.c diff -u ZendEngine2/zend_execute.c:1.619 ZendEngine2/zend_execute.c:1.620 --- ZendEngine2/zend_execute.c:1.619 Tue Mar 2 05:13:43 2004 +++ ZendEngine2/zend_execute.c Mon Mar 8 13:05:41 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute.c,v 1.619 2004/03/02 10:13:43 andi Exp $ */ +/* $Id: zend_execute.c,v 1.620 2004/03/08 18:05:41 helly Exp $ */ #define ZEND_INTENSIVE_DEBUGGING 0 @@ -3756,7 +3756,7 @@ * In case that ever happens we need an additional flag. */ iter->funcs->move_forward(iter TSRMLS_CC); } - if (!iter || iter->funcs->has_more(iter TSRMLS_CC) == FAILURE) { + if (!iter || iter->funcs->valid(iter TSRMLS_CC) == FAILURE) { /* reached end of iteration */ SET_OPCODE(op_array->opcodes+opline->op2.u.opline_num); return 0; /* CHECK_ME */ http://cvs.php.net/diff.php/ZendEngine2/zend_interfaces.c?r1=1.15&r2=1.16&ty=u Index: ZendEngine2/zend_interfaces.c diff -u ZendEngine2/zend_interfaces.c:1.15 ZendEngine2/zend_interfaces.c:1.16 --- ZendEngine2/zend_interfaces.c:1.15 Mon Mar 8 12:33:31 2004 +++ ZendEngine2/zend_interfaces.c Mon Mar 8 13:05:41 2004 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_interfaces.c,v 1.15 2004/03/08 17:33:31 helly Exp $ */ +/* $Id: zend_interfaces.c,v 1.16 2004/03/08 18:05:41 helly Exp $ */ #include "zend.h" #include "zend_API.h" @@ -134,8 +134,8 @@ } /* }}} */ -/* {{{ zend_user_it_has_more */ -static int zend_user_it_has_more(zend_object_iterator *_iter TSRMLS_DC) +/* {{{ zend_user_it_valid */ +static int zend_user_it_valid(zend_object_iterator *_iter TSRMLS_DC) { if (_iter) { zend_user_iterator *iter = (zend_user_iterator*)_iter; @@ -143,7 +143,7 @@ zval *more; int result; - zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_has_more, "valid", &more); + zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_valid, "valid", &more); if (more) { result = i_zend_is_true(more); zval_ptr_dtor(&more); @@ -245,7 +245,7 @@ zend_object_iterator_funcs zend_interface_iterator_funcs_iterator = { zend_user_it_dtor, - zend_user_it_has_more, + zend_user_it_valid, zend_user_it_get_current_data, zend_user_it_get_current_key, zend_user_it_move_forward, @@ -339,7 +339,7 @@ } } class_type->get_iterator = zend_user_it_get_iterator; - class_type->iterator_funcs.zf_has_more = NULL; + class_type->iterator_funcs.zf_valid = NULL; class_type->iterator_funcs.zf_current = NULL; class_type->iterator_funcs.zf_key = NULL; class_type->iterator_funcs.zf_next = NULL; http://cvs.php.net/diff.php/ZendEngine2/zend_iterators.h?r1=1.7&r2=1.8&ty=u Index: ZendEngine2/zend_iterators.h diff -u ZendEngine2/zend_iterators.h:1.7 ZendEngine2/zend_iterators.h:1.8 --- ZendEngine2/zend_iterators.h:1.7 Fri Feb 20 03:03:27 2004 +++ ZendEngine2/zend_iterators.h Mon Mar 8 13:05:41 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_iterators.h,v 1.7 2004/02/20 08:03:27 hholzgra Exp $ */ +/* $Id: zend_iterators.h,v 1.8 2004/03/08 18:05:41 helly Exp $ */ /* These iterators were designed to operate within the foreach() * structures provided by the engine, but could be extended for use @@ -32,8 +32,8 @@ /* release all resources associated with this iterator instance */ void (*dtor)(zend_object_iterator *iter TSRMLS_DC); - /* check for end of iteration (FAILURE or SUCCESS for more data) */ - int (*has_more)(zend_object_iterator *iter TSRMLS_DC); + /* check for end of iteration (FAILURE or SUCCESS if data is valid) */ + int (*valid)(zend_object_iterator *iter TSRMLS_DC); /* fetch the item data for the current element */ void (*get_current_data)(zend_object_iterator *iter, zval ***data TSRMLS_DC); @@ -60,7 +60,7 @@ zend_object_iterator_funcs *funcs; zend_object_new_iterator_t new_iterator; union _zend_function *zf_new_iterator; - union _zend_function *zf_has_more; + union _zend_function *zf_valid; union _zend_function *zf_current; union _zend_function *zf_key; union _zend_function *zf_next;
« previous php.zend-engine.cvs (#2455) next »