Back to index

php5  5.3.10
Defines | Functions
zend_variables.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define zval_copy_ctor(zvalue)   _zval_copy_ctor((zvalue) ZEND_FILE_LINE_CC)
#define zval_dtor(zvalue)   _zval_dtor((zvalue) ZEND_FILE_LINE_CC)
#define zval_ptr_dtor(zval_ptr)   _zval_ptr_dtor((zval_ptr) ZEND_FILE_LINE_CC)
#define zval_internal_dtor(zvalue)   _zval_internal_dtor((zvalue) ZEND_FILE_LINE_CC)
#define zval_internal_ptr_dtor(zvalue)   _zval_internal_ptr_dtor((zvalue) ZEND_FILE_LINE_CC)
#define zval_dtor_wrapper   _zval_dtor_wrapper
#define zval_copy_ctor_wrapper   _zval_copy_ctor_func
#define zval_ptr_dtor_wrapper   _zval_ptr_dtor
#define zval_internal_dtor_wrapper   _zval_internal_dtor
#define zval_internal_ptr_dtor_wrapper   _zval_internal_ptr_dtor
#define zval_shared_property_ctor   zval_add_ref
#define zval_copy_property_ctor(ce)   ((copy_ctor_func_t) (((ce)->type == ZEND_INTERNAL_CLASS) ? zval_shared_property_ctor : zval_add_ref))
#define ZVAL_DESTRUCTOR   (void (*)(void *)) zval_dtor_wrapper
#define ZVAL_PTR_DTOR   (void (*)(void *)) zval_ptr_dtor_wrapper
#define ZVAL_INTERNAL_DTOR   (void (*)(void *)) zval_internal_dtor_wrapper
#define ZVAL_INTERNAL_PTR_DTOR   (void (*)(void *)) zval_internal_ptr_dtor_wrapper
#define ZVAL_COPY_CTOR   (void (*)(void *)) zval_copy_ctor_wrapper

Functions

ZEND_API void _zval_dtor_func (zval *zvalue ZEND_FILE_LINE_DC)
static void _zval_dtor (zval *zvalue ZEND_FILE_LINE_DC)
ZEND_API void _zval_copy_ctor_func (zval *zvalue ZEND_FILE_LINE_DC)
static void _zval_copy_ctor (zval *zvalue ZEND_FILE_LINE_DC)
ZEND_API int zend_print_variable (zval *var)
ZEND_API void _zval_ptr_dtor (zval **zval_ptr ZEND_FILE_LINE_DC)
ZEND_API void _zval_internal_dtor (zval *zvalue ZEND_FILE_LINE_DC)
ZEND_API void _zval_internal_ptr_dtor (zval **zvalue ZEND_FILE_LINE_DC)
ZEND_API void _zval_dtor_wrapper (zval *zvalue)
ZEND_API void zval_add_ref (zval **p)
ZEND_API void zval_property_ctor (zval **)

Define Documentation

#define zval_copy_ctor (   zvalue)    _zval_copy_ctor((zvalue) ZEND_FILE_LINE_CC)

Definition at line 54 of file zend_variables.h.

#define ZVAL_COPY_CTOR   (void (*)(void *)) zval_copy_ctor_wrapper

Definition at line 96 of file zend_variables.h.

Definition at line 71 of file zend_variables.h.

Definition at line 87 of file zend_variables.h.

#define ZVAL_DESTRUCTOR   (void (*)(void *)) zval_dtor_wrapper

Definition at line 92 of file zend_variables.h.

#define zval_dtor (   zvalue)    _zval_dtor((zvalue) ZEND_FILE_LINE_CC)

Definition at line 55 of file zend_variables.h.

Definition at line 59 of file zend_variables.h.

#define zval_internal_dtor (   zvalue)    _zval_internal_dtor((zvalue) ZEND_FILE_LINE_CC)

Definition at line 57 of file zend_variables.h.

#define ZVAL_INTERNAL_DTOR   (void (*)(void *)) zval_internal_dtor_wrapper

Definition at line 94 of file zend_variables.h.

Definition at line 73 of file zend_variables.h.

Definition at line 58 of file zend_variables.h.

#define ZVAL_INTERNAL_PTR_DTOR   (void (*)(void *)) zval_internal_ptr_dtor_wrapper

Definition at line 95 of file zend_variables.h.

Definition at line 74 of file zend_variables.h.

#define zval_ptr_dtor (   zval_ptr)    _zval_ptr_dtor((zval_ptr) ZEND_FILE_LINE_CC)

Definition at line 56 of file zend_variables.h.

#define ZVAL_PTR_DTOR   (void (*)(void *)) zval_ptr_dtor_wrapper

Definition at line 93 of file zend_variables.h.

Definition at line 72 of file zend_variables.h.

Definition at line 84 of file zend_variables.h.


Function Documentation

static void _zval_copy_ctor ( zval *zvalue  ZEND_FILE_LINE_DC) [inline, static]

Definition at line 40 of file zend_variables.h.

{
       if (zvalue->type <= IS_BOOL) {
              return;
       }
       _zval_copy_ctor_func(zvalue ZEND_FILE_LINE_RELAY_CC);
}

Here is the call graph for this function:

ZEND_API void _zval_copy_ctor_func ( zval *zvalue  ZEND_FILE_LINE_DC)

Definition at line 104 of file zend_variables.c.

{
       switch (Z_TYPE_P(zvalue) & IS_CONSTANT_TYPE_MASK) {
              case IS_RESOURCE: {
                            TSRMLS_FETCH();

                            zend_list_addref(zvalue->value.lval);
                     }
                     break;
              case IS_BOOL:
              case IS_LONG:
              case IS_NULL:
                     break;
              case IS_CONSTANT:
              case IS_STRING:
                     CHECK_ZVAL_STRING_REL(zvalue);
                     zvalue->value.str.val = (char *) estrndup_rel(zvalue->value.str.val, zvalue->value.str.len);
                     break;
              case IS_ARRAY:
              case IS_CONSTANT_ARRAY: {
                            zval *tmp;
                            HashTable *original_ht = zvalue->value.ht;
                            HashTable *tmp_ht = NULL;
                            TSRMLS_FETCH();

                            if (zvalue->value.ht == &EG(symbol_table)) {
                                   return; /* do nothing */
                            }
                            ALLOC_HASHTABLE_REL(tmp_ht);
                            zend_hash_init(tmp_ht, zend_hash_num_elements(original_ht), NULL, ZVAL_PTR_DTOR, 0);
                            zend_hash_copy(tmp_ht, original_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
                            zvalue->value.ht = tmp_ht;
                     }
                     break;
              case IS_OBJECT:
                     {
                            TSRMLS_FETCH();
                            Z_OBJ_HT_P(zvalue)->add_ref(zvalue TSRMLS_CC);
                     }
                     break;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void _zval_dtor ( zval *zvalue  ZEND_FILE_LINE_DC) [inline, static]

Definition at line 30 of file zend_variables.h.

{
       if (zvalue->type <= IS_BOOL) {
              return;
       }
       _zval_dtor_func(zvalue ZEND_FILE_LINE_RELAY_CC);
}

Here is the call graph for this function:

ZEND_API void _zval_dtor_func ( zval *zvalue  ZEND_FILE_LINE_DC)

Definition at line 30 of file zend_variables.c.

{
       switch (Z_TYPE_P(zvalue) & IS_CONSTANT_TYPE_MASK) {
              case IS_STRING:
              case IS_CONSTANT:
                     CHECK_ZVAL_STRING_REL(zvalue);
                     STR_FREE_REL(zvalue->value.str.val);
                     break;
              case IS_ARRAY:
              case IS_CONSTANT_ARRAY: {
                            TSRMLS_FETCH();

                            if (zvalue->value.ht && (zvalue->value.ht != &EG(symbol_table))) {
                                   zend_hash_destroy(zvalue->value.ht);
                                   FREE_HASHTABLE(zvalue->value.ht);
                            }
                     }
                     break;
              case IS_OBJECT:
                     {
                            TSRMLS_FETCH();

                            Z_OBJ_HT_P(zvalue)->del_ref(zvalue TSRMLS_CC);
                     }
                     break;
              case IS_RESOURCE:
                     {
                            TSRMLS_FETCH();

                            /* destroy resource */
                            zend_list_delete(zvalue->value.lval);
                     }
                     break;
              case IS_LONG:
              case IS_DOUBLE:
              case IS_BOOL:
              case IS_NULL:
              default:
                     return;
                     break;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

ZEND_API void _zval_dtor_wrapper ( zval *  zvalue)

Definition at line 154 of file zend_variables.c.

ZEND_API void _zval_internal_dtor ( zval *zvalue  ZEND_FILE_LINE_DC)

Definition at line 74 of file zend_variables.c.

{
       switch (Z_TYPE_P(zvalue) & IS_CONSTANT_TYPE_MASK) {
              case IS_STRING:
              case IS_CONSTANT:
                     CHECK_ZVAL_STRING_REL(zvalue);
                     free(zvalue->value.str.val);
                     break;
              case IS_ARRAY:
              case IS_CONSTANT_ARRAY:
              case IS_OBJECT:
              case IS_RESOURCE:
                     zend_error(E_CORE_ERROR, "Internal zval's can't be arrays, objects or resources");
                     break;
              case IS_LONG:
              case IS_DOUBLE:
              case IS_BOOL:
              case IS_NULL:
              default:
                     break;
       }
}

Here is the call graph for this function:

ZEND_API void _zval_internal_ptr_dtor ( zval **zvalue  ZEND_FILE_LINE_DC)
ZEND_API void _zval_ptr_dtor ( zval **zval_ptr  ZEND_FILE_LINE_DC)

Definition at line 434 of file zend_execute_API.c.

{
       zval *zv = *zval_ptr;

#if DEBUG_ZEND>=2
       printf("Reducing refcount for %x (%x): %d->%d\n", *zval_ptr, zval_ptr, Z_REFCOUNT_PP(zval_ptr), Z_REFCOUNT_PP(zval_ptr) - 1);
#endif
       Z_DELREF_P(zv);
       if (Z_REFCOUNT_P(zv) == 0) {
              TSRMLS_FETCH();

              if (zv != &EG(uninitialized_zval)) {
                     GC_REMOVE_ZVAL_FROM_BUFFER(zv);
                     zval_dtor(zv);
                     efree_rel(zv);
              }
       } else {
              TSRMLS_FETCH();

              if (Z_REFCOUNT_P(zv) == 1) {
                     Z_UNSET_ISREF_P(zv);
              }

              GC_ZVAL_CHECK_POSSIBLE_ROOT(zv);
       }
}
ZEND_API int zend_print_variable ( zval *  var)

Definition at line 148 of file zend_variables.c.

{
       return zend_print_zval(var, 0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

ZEND_API void zval_add_ref ( zval **  p)

Definition at line 98 of file zend_variables.c.

{
       Z_ADDREF_PP(p);
}
ZEND_API void zval_property_ctor ( zval **  )

Definition at line 162 of file zend_variables.c.

{
       zval *orig_ptr = *p;

       ALLOC_ZVAL(*p);
       **p = *orig_ptr;
       zval_copy_ctor(*p);
       Z_SET_REFCOUNT_PP(p, 1);
       Z_UNSET_ISREF_PP(p);
}