Back to index

php5  5.3.10
Classes | Typedefs | Enumerations | Functions
zend_iterators.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _zend_object_iterator_funcs
struct  _zend_object_iterator
struct  _zend_class_iterator_funcs

Typedefs

typedef struct _zend_object_iterator
typedef struct
_zend_object_iterator_funcs 
zend_object_iterator_funcs
typedef struct
_zend_class_iterator_funcs 
zend_class_iterator_funcs

Enumerations

enum  zend_object_iterator_kind { ZEND_ITER_INVALID, ZEND_ITER_PLAIN_ARRAY, ZEND_ITER_PLAIN_OBJECT, ZEND_ITER_OBJECT }

Functions

ZEND_API enum
zend_object_iterator_kind 
zend_iterator_unwrap (zval *array_ptr, zend_object_iterator **iter TSRMLS_DC)
ZEND_API zval * zend_iterator_wrap (zend_object_iterator *iter TSRMLS_DC)
ZEND_API void zend_register_iterator_wrapper (TSRMLS_D)

Class Documentation

struct _zend_object_iterator

Definition at line 54 of file zend_iterators.h.

Collaboration diagram for _zend_object_iterator:
Class Members
void * data
zend_object_iterator_funcs * funcs
ulong index
struct _zend_class_iterator_funcs

Definition at line 60 of file zend_iterators.h.

Collaboration diagram for _zend_class_iterator_funcs:
Class Members
zend_object_iterator_funcs * funcs
union _zend_function * zf_current
union _zend_function * zf_key
union _zend_function * zf_new_iterator
union _zend_function * zf_next
union _zend_function * zf_rewind
union _zend_function * zf_valid

Typedef Documentation

typedef struct _zend_object_iterator

Definition at line 29 of file zend_iterators.h.


Enumeration Type Documentation

Enumerator:
ZEND_ITER_INVALID 
ZEND_ITER_PLAIN_ARRAY 
ZEND_ITER_PLAIN_OBJECT 
ZEND_ITER_OBJECT 

Definition at line 70 of file zend_iterators.h.


Function Documentation

ZEND_API enum zend_object_iterator_kind zend_iterator_unwrap ( zval *  array_ptr,
zend_object_iterator **iter  TSRMLS_DC 
)

Definition at line 76 of file zend_iterators.c.

{
       switch (Z_TYPE_P(array_ptr)) {
              case IS_OBJECT:
                     if (Z_OBJ_HT_P(array_ptr) == &iterator_object_handlers) {
                            *iter = (zend_object_iterator *)zend_object_store_get_object(array_ptr TSRMLS_CC);
                            return ZEND_ITER_OBJECT;
                     }
                     if (HASH_OF(array_ptr)) {
                            return ZEND_ITER_PLAIN_OBJECT;
                     }
                     return ZEND_ITER_INVALID;

              case IS_ARRAY:
                     if (HASH_OF(array_ptr)) {
                            return ZEND_ITER_PLAIN_ARRAY;
                     }
                     return ZEND_ITER_INVALID;

              default:
                     return ZEND_ITER_INVALID;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

ZEND_API zval* zend_iterator_wrap ( zend_object_iterator *iter  TSRMLS_DC)

Definition at line 64 of file zend_iterators.c.

{
       zval *wrapped;

       MAKE_STD_ZVAL(wrapped);
       Z_TYPE_P(wrapped) = IS_OBJECT;
       Z_OBJ_HANDLE_P(wrapped) = zend_objects_store_put(iter, iter_wrapper_dtor, NULL, NULL TSRMLS_CC);
       Z_OBJ_HT_P(wrapped) = &iterator_object_handlers;

       return wrapped;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 51 of file zend_iterators.c.

{
       INIT_CLASS_ENTRY(zend_iterator_class_entry, "__iterator_wrapper", NULL);
       free(zend_iterator_class_entry.name);
       zend_iterator_class_entry.name = "__iterator_wrapper";
}

Here is the caller graph for this function: