]> granicus.if.org Git - php/commitdiff
Update documentation in source, reflection and docu itself, part II
authorMarcus Boerger <helly@php.net>
Mon, 4 Aug 2003 23:15:56 +0000 (23:15 +0000)
committerMarcus Boerger <helly@php.net>
Mon, 4 Aug 2003 23:15:56 +0000 (23:15 +0000)
ext/spl/spl.php
ext/spl/spl_directory.c
ext/spl/spl_functions.h

index 42380bcbda2a2aafaaa4d5faf85b289ad638ab54..53a2d0d429ed569345e3c9125f9df584101f3458 100755 (executable)
@@ -284,27 +284,57 @@ class spl_array_it implements spl_sequence_assoc {
         *
         * \param $array the array to use.
         */
-       private function __construct($array)
+       private function __construct($array);
 
        /*! \copydoc spl_sequence::rewind
         */
-       function rewind()
+       function rewind();
 
        /*! \copydoc spl_forward::current
         */
-       function current()
+       function current();
 
        /*! \copydoc spl_assoc::key
         */
-       function key()
+       function key();
 
        /*! \copydoc spl_forward::next
         */
-       function next()
+       function next();
 
        /*! \copydoc spl_forward::has_more
         */
-       function has_more()
+       function has_more();
 }
 
+/*! \brief Directory iterator
+ */
+class spl_array_it implements spl_sequence {
+
+       /*! Construct a directory iterator from a path-string.
+        *
+        * \param $path directory to iterate.
+        */
+       private function __construct($path);
+
+       /*! \copydoc spl_sequence::rewind
+        */
+       function rewind();
+
+       /*! \copydoc spl_forward::current
+        */
+       function current();
+
+       /*! \copydoc spl_forward::next
+        */
+       function next();
+
+       /*! \copydoc spl_forward::has_more
+        */
+       function has_more();
+       
+       /*! \return The opened path.
+        */
+       function get_path();    
+}
 ?>
\ No newline at end of file
index 2024ca05c5ee126945ebd458838361c05dec9b60..c487cf205725de457b2487db5ed0738e8e84ffd7 100755 (executable)
@@ -44,13 +44,18 @@ SPL_CLASS_FUNCTION(dir, next);
 SPL_CLASS_FUNCTION(dir, has_more);
 SPL_CLASS_FUNCTION(dir, get_path);
 
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dir___construct, 0)
+       ZEND_ARG_INFO(0, path)
+ZEND_END_ARG_INFO();
+
 static zend_function_entry spl_dir_class_functions[] = {
-       SPL_CLASS_FE(dir, __construct,   NULL)
-       SPL_CLASS_FE(dir, rewind,        NULL)
-       SPL_CLASS_FE(dir, current,       NULL)
-       SPL_CLASS_FE(dir, next,          NULL)
-       SPL_CLASS_FE(dir, has_more,      NULL)
-       SPL_CLASS_FE(dir, get_path,      NULL)
+       SPL_CLASS_FE(dir, __construct,   arginfo_dir___construct, ZEND_ACC_PUBLIC)
+       SPL_CLASS_FE(dir, rewind,        NULL, ZEND_ACC_PUBLIC)
+       SPL_CLASS_FE(dir, current,       NULL, ZEND_ACC_PUBLIC)
+       SPL_CLASS_FE(dir, next,          NULL, ZEND_ACC_PUBLIC)
+       SPL_CLASS_FE(dir, has_more,      NULL, ZEND_ACC_PUBLIC)
+       SPL_CLASS_FE(dir, get_path,      NULL, ZEND_ACC_PUBLIC)
        {NULL, NULL, NULL}
 };
 
index 215345d59413e7639cd7d08a93cfc0ee5b431315..1a2aa1503755bf733cf5a5a0de3a7f87903cba84 100755 (executable)
@@ -60,10 +60,10 @@ void spl_add_interfaces(zval * list, zend_class_entry * pce TSRMLS_DC);
 int spl_add_classes(zend_class_entry ** ppce, zval *list TSRMLS_DC);
 
 #define SPL_CLASS_FE(class_name, function_name, arg_info, flags) \
-       { #function_name, spl_ ## class_name ## _ ## function_name, arg_info, sizeof(arg_info)/sizeof(struct _zend_arg_info)-1, flags },
+       PHP_ME( spl_ ## class_name, function_name, arg_info, flags)
 
 #define SPL_CLASS_FUNCTION(class_name, function_name) \
-       PHP_NAMED_FUNCTION(spl_ ## class_name ## _ ## function_name)
+       PHP_METHOD(spl_ ## class_name, function_name)
 
 #endif /* PHP_FUNCTIONS_H */