]> granicus.if.org Git - php/commitdiff
Rename RegExIterator -> RegexIterator.
authorAndrei Zmievski <andrei@php.net>
Wed, 10 May 2006 16:50:57 +0000 (16:50 +0000)
committerAndrei Zmievski <andrei@php.net>
Wed, 10 May 2006 16:50:57 +0000 (16:50 +0000)
Also rename recursive one.

ext/spl/spl_iterators.c
ext/spl/spl_iterators.h
ext/spl/tests/iterator_029.phpt

index 22e087ff25f6b0e31dd0b9d000c5e14961ac83a3..0280a32c33600ebe66248e27b0bada4528a7db28 100755 (executable)
@@ -55,8 +55,8 @@ PHPAPI zend_class_entry *spl_ce_NoRewindIterator;
 PHPAPI zend_class_entry *spl_ce_InfiniteIterator;
 PHPAPI zend_class_entry *spl_ce_EmptyIterator;
 PHPAPI zend_class_entry *spl_ce_AppendIterator;
-PHPAPI zend_class_entry *spl_ce_RegExIterator;
-PHPAPI zend_class_entry *spl_ce_RecursiveRegExIterator;
+PHPAPI zend_class_entry *spl_ce_RegexIterator;
+PHPAPI zend_class_entry *spl_ce_RecursiveRegexIterator;
 
 zend_function_entry spl_funcs_RecursiveIterator[] = {
        SPL_ABSTRACT_ME(RecursiveIterator, hasChildren,  NULL)
@@ -933,8 +933,8 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
                        php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
                        return intern;
 #if HAVE_PCRE || HAVE_BUNDLED_PCRE
-               case DIT_RegExIterator:
-               case DIT_RecursiveRegExIterator: {
+               case DIT_RegexIterator:
+               case DIT_RecursiveRegexIterator: {
                        char *regex;
                        int len, poptions, coptions;
                        pcre_extra *extra = NULL;
@@ -1280,16 +1280,16 @@ SPL_METHOD(ParentIterator, getChildren)
 } /* }}} */
 
 #if HAVE_PCRE || HAVE_BUNDLED_PCRE
-/* {{{ proto void RegExIterator::__construct(Iterator it, string $regex [, int $flags]) 
-   Create an RegExIterator from another iterator and a regular expression */
-SPL_METHOD(RegExIterator, __construct)
+/* {{{ proto void RegexIterator::__construct(Iterator it, string $regex [, int $flags]) 
+   Create an RegexIterator from another iterator and a regular expression */
+SPL_METHOD(RegexIterator, __construct)
 {
-       spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, spl_ce_RegExIterator, zend_ce_iterator, DIT_RegExIterator);
+       spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, spl_ce_RegexIterator, zend_ce_iterator, DIT_RegexIterator);
 } /* }}} */
 
-/* {{{ proto bool RegExIterator::accept()
+/* {{{ proto bool RegexIterator::accept()
    Match (string)current() against regular expression */
-SPL_METHOD(RegExIterator, accept)
+SPL_METHOD(RegexIterator, accept)
 {
        spl_dual_it_object   *intern;
        int count;
@@ -1330,11 +1330,11 @@ SPL_METHOD(RegExIterator, accept)
        RETURN_BOOL(count >= 0);
 } /* }}} */
 
-/* {{{ proto void RecursiveRegExIterator::__construct(RecursiveIterator it, string $regex [, int $flags]) 
-   Create an RecursiveRegExIterator from another recursive iterator and a regular expression */
-SPL_METHOD(RecursiveRegExIterator, __construct)
+/* {{{ proto void RecursiveRegexIterator::__construct(RecursiveIterator it, string $regex [, int $flags]) 
+   Create an RecursiveRegexIterator from another recursive iterator and a regular expression */
+SPL_METHOD(RecursiveRegexIterator, __construct)
 {
-       spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, spl_ce_RecursiveRegExIterator, spl_ce_RecursiveIterator, DIT_RecursiveRegExIterator);
+       spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, spl_ce_RecursiveRegexIterator, spl_ce_RecursiveIterator, DIT_RecursiveRegexIterator);
 } /* }}} */
 #endif
 
@@ -1368,7 +1368,7 @@ static inline void spl_dual_it_free_storage(void *_object TSRMLS_DC)
        }
 
 #if HAVE_PCRE || HAVE_BUNDLED_PCRE
-       if (object->dit_type == DIT_RegExIterator || object->dit_type == DIT_RecursiveRegExIterator) {
+       if (object->dit_type == DIT_RegexIterator || object->dit_type == DIT_RecursiveRegexIterator) {
                if (object->u.regex.pce) {
                        object->u.regex.pce->refcount--;
                }
@@ -1448,9 +1448,9 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_regex_it___construct, 0, 0, 2)
        ZEND_ARG_INFO(0, flags)
 ZEND_END_ARG_INFO();
 
-static zend_function_entry spl_funcs_RegExIterator[] = {
-       SPL_ME(RegExIterator,   __construct,      arginfo_regex_it___construct, ZEND_ACC_PUBLIC)
-       SPL_ME(RegExIterator,   accept,           NULL, ZEND_ACC_PUBLIC)
+static zend_function_entry spl_funcs_RegexIterator[] = {
+       SPL_ME(RegexIterator,   __construct,      arginfo_regex_it___construct, ZEND_ACC_PUBLIC)
+       SPL_ME(RegexIterator,   accept,           NULL, ZEND_ACC_PUBLIC)
        {NULL, NULL, NULL}
 };
 
@@ -1461,8 +1461,8 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_rec_regex_it___construct, 0, 0, 2)
        ZEND_ARG_INFO(0, flags)
 ZEND_END_ARG_INFO();
 
-static zend_function_entry spl_funcs_RecursiveRegExIterator[] = {
-       SPL_ME(RecursiveRegExIterator, __construct,      arginfo_rec_regex_it___construct, ZEND_ACC_PUBLIC)
+static zend_function_entry spl_funcs_RecursiveRegexIterator[] = {
+       SPL_ME(RecursiveRegexIterator, __construct,      arginfo_rec_regex_it___construct, ZEND_ACC_PUBLIC)
        SPL_ME(ParentIterator,         hasChildren,      NULL, ZEND_ACC_PUBLIC)
        SPL_ME(ParentIterator,         getChildren,      NULL, ZEND_ACC_PUBLIC)
        {NULL, NULL, NULL}
@@ -2516,13 +2516,13 @@ PHP_MINIT_FUNCTION(spl_iterators)
 
        REGISTER_SPL_SUB_CLASS_EX(InfiniteIterator, IteratorIterator, spl_dual_it_new, spl_funcs_InfiniteIterator);
 #if HAVE_PCRE || HAVE_BUNDLED_PCRE
-       REGISTER_SPL_SUB_CLASS_EX(RegExIterator, FilterIterator, spl_dual_it_new, spl_funcs_RegExIterator);
-       REGISTER_SPL_CLASS_CONST_LONG(RegExIterator, "USE_KEY", REGIT_USE_KEY);
-       REGISTER_SPL_SUB_CLASS_EX(RecursiveRegExIterator, RegExIterator, spl_dual_it_new, spl_funcs_RecursiveRegExIterator);
-       REGISTER_SPL_IMPLEMENTS(RecursiveRegExIterator, RecursiveIterator);
+       REGISTER_SPL_SUB_CLASS_EX(RegexIterator, FilterIterator, spl_dual_it_new, spl_funcs_RegexIterator);
+       REGISTER_SPL_CLASS_CONST_LONG(RegexIterator, "USE_KEY", REGIT_USE_KEY);
+       REGISTER_SPL_SUB_CLASS_EX(RecursiveRegexIterator, RegexIterator, spl_dual_it_new, spl_funcs_RecursiveRegexIterator);
+       REGISTER_SPL_IMPLEMENTS(RecursiveRegexIterator, RecursiveIterator);
 #else
-       spl_ce_RegExIterator = NULL;
-       spl_ce_RecursiveRegExIterator = NULL;
+       spl_ce_RegexIterator = NULL;
+       spl_ce_RecursiveRegexIterator = NULL;
 #endif
 
        REGISTER_SPL_STD_CLASS_EX(EmptyIterator, NULL, spl_funcs_EmptyIterator);
index dae8395b36846636d6697d8e4ecaadfa70f936e2..a4884fb067e01f1a06c8688fe5fa405463d1116a 100755 (executable)
@@ -48,8 +48,8 @@ extern PHPAPI zend_class_entry *spl_ce_NoRewindIterator;
 extern PHPAPI zend_class_entry *spl_ce_InfiniteIterator;
 extern PHPAPI zend_class_entry *spl_ce_EmptyIterator;
 extern PHPAPI zend_class_entry *spl_ce_AppendIterator;
-extern PHPAPI zend_class_entry *spl_ce_RegExIterator;
-extern PHPAPI zend_class_entry *spl_ce_RecursiveRegExIterator;
+extern PHPAPI zend_class_entry *spl_ce_RegexIterator;
+extern PHPAPI zend_class_entry *spl_ce_RecursiveRegexIterator;
 
 PHP_MINIT_FUNCTION(spl_iterators);
 
@@ -69,8 +69,8 @@ typedef enum {
        DIT_InfiniteIterator,
        DIT_AppendIterator,
 #if HAVE_PCRE || HAVE_BUNDLED_PCRE
-       DIT_RegExIterator,
-       DIT_RecursiveRegExIterator,
+       DIT_RegexIterator,
+       DIT_RecursiveRegexIterator,
 #endif
        DIT_Unknown = ~0
 } dual_it_type;
index 6ca53eff15ed25256461bde6221ca5ca41dde1d1..00e27d47be78a4ddbdb83d5a9e52389d60499df5 100755 (executable)
@@ -1,5 +1,5 @@
 --TEST--
-SPL: RegExIterator
+SPL: RegexIterator
 --SKIPIF--
 <?php if (!extension_loaded("spl")) print "skip"; ?>
 --FILE--
@@ -7,7 +7,7 @@ SPL: RegExIterator
 
 $ar = array(0, "123", 123, 22 => "abc", "a2b", 22, "a2d" => 7, 42);
 
-foreach(new RegExIterator(new ArrayIterator($ar), "/2/") as $k => $v)
+foreach(new RegexIterator(new ArrayIterator($ar), "/2/") as $k => $v)
 {
        echo "$k=>$v\n";
 }
@@ -16,7 +16,7 @@ foreach(new RegExIterator(new ArrayIterator($ar), "/2/") as $k => $v)
 ===KEY===
 <?php
 
-foreach(new RegExIterator(new ArrayIterator($ar), "/2/", RegExIterator::USE_KEY) as $k => $v)
+foreach(new RegexIterator(new ArrayIterator($ar), "/2/", RegexIterator::USE_KEY) as $k => $v)
 {
        echo "$k=>$v\n";
 }