Back to index

php5  5.3.10
Defines | Functions
php_incomplete_class.h File Reference
#include "ext/standard/basic_functions.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define PHP_IC_ENTRY   BG(incomplete_class)
#define PHP_SET_CLASS_ATTRIBUTES(struc)
#define PHP_CLEANUP_CLASS_ATTRIBUTES()   if (free_class_name) efree(class_name)
#define PHP_CLASS_ATTRIBUTES
#define INCOMPLETE_CLASS   "__PHP_Incomplete_Class"
#define MAGIC_MEMBER   "__PHP_Incomplete_Class_Name"

Functions

PHPAPI zend_class_entry * php_create_incomplete_class (TSRMLS_D)
PHPAPI char * php_lookup_class_name (zval *object, zend_uint *nlen)
PHPAPI void php_store_class_name (zval *object, const char *name, zend_uint len)

Define Documentation

#define INCOMPLETE_CLASS   "__PHP_Incomplete_Class"

Definition at line 53 of file php_incomplete_class.h.

#define MAGIC_MEMBER   "__PHP_Incomplete_Class_Name"

Definition at line 54 of file php_incomplete_class.h.

Value:
char *class_name;                                                                                        \
	zend_uint name_len;                                                                                     \
	zend_bool free_class_name = 0;                                                                   \
	zend_bool incomplete_class = 0

Definition at line 47 of file php_incomplete_class.h.

#define PHP_CLEANUP_CLASS_ATTRIBUTES ( )    if (free_class_name) efree(class_name)

Definition at line 44 of file php_incomplete_class.h.

#define PHP_IC_ENTRY   BG(incomplete_class)

Definition at line 26 of file php_incomplete_class.h.

#define PHP_SET_CLASS_ATTRIBUTES (   struc)
Value:
/* OBJECTS_FIXME: Fix for new object model */    \
       if (Z_OBJ_HT_P(struc)->get_class_entry && \
            Z_OBJCE_P(struc) == BG(incomplete_class)) { \
              class_name = php_lookup_class_name(struc, &name_len); \
              if (!class_name) { \
                     name_len = sizeof(INCOMPLETE_CLASS) - 1; \
                     class_name = estrndup(INCOMPLETE_CLASS, name_len); \
              } \
              free_class_name = 1; \
              incomplete_class = 1; \
       } else { \
              free_class_name = !zend_get_object_classname(struc, &class_name, &name_len TSRMLS_CC);\
       }

Definition at line 29 of file php_incomplete_class.h.


Function Documentation

PHPAPI zend_class_entry* php_create_incomplete_class ( TSRMLS_D  )

Definition at line 117 of file incomplete_class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

PHPAPI char* php_lookup_class_name ( zval *  object,
zend_uint nlen 
)

Definition at line 138 of file incomplete_class.c.

{
       zval **val;
       char *retval = NULL;
       HashTable *object_properties;
       TSRMLS_FETCH();

       object_properties = Z_OBJPROP_P(object);

       if (zend_hash_find(object_properties, MAGIC_MEMBER, sizeof(MAGIC_MEMBER), (void **) &val) == SUCCESS) {
              retval = estrndup(Z_STRVAL_PP(val), Z_STRLEN_PP(val));

              if (nlen) {
                     *nlen = Z_STRLEN_PP(val);
              }
       }

       return retval;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PHPAPI void php_store_class_name ( zval *  object,
const char *  name,
zend_uint  len 
)

Definition at line 161 of file incomplete_class.c.

{
       zval *val;
       TSRMLS_FETCH();

       MAKE_STD_ZVAL(val);

       Z_TYPE_P(val)   = IS_STRING;
       Z_STRVAL_P(val) = estrndup(name, len);
       Z_STRLEN_P(val) = len;

       zend_hash_update(Z_OBJPROP_P(object), MAGIC_MEMBER, sizeof(MAGIC_MEMBER), &val, sizeof(val), NULL);
}

Here is the caller graph for this function: