2000-06-24 00:46:04 +08:00
|
|
|
/*
|
|
|
|
+----------------------------------------------------------------------+
|
2004-01-09 01:33:29 +08:00
|
|
|
| PHP Version 5 |
|
2000-06-24 00:46:04 +08:00
|
|
|
+----------------------------------------------------------------------+
|
2010-01-03 17:23:27 +08:00
|
|
|
| Copyright (c) 1997-2010 The PHP Group |
|
2000-06-24 00:46:04 +08:00
|
|
|
+----------------------------------------------------------------------+
|
2006-01-01 20:51:34 +08:00
|
|
|
| This source file is subject to version 3.01 of the PHP license, |
|
2000-06-24 00:46:04 +08:00
|
|
|
| that is bundled with this package in the file LICENSE, and is |
|
2003-06-11 04:04:29 +08:00
|
|
|
| available through the world-wide-web at the following url: |
|
2006-01-01 20:51:34 +08:00
|
|
|
| http://www.php.net/license/3_01.txt |
|
2000-06-24 00:46:04 +08:00
|
|
|
| If you did not receive a copy of the PHP license and are unable to |
|
|
|
|
| obtain it through the world-wide-web, please send a note to |
|
|
|
|
| license@php.net so we can mail you a copy immediately. |
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| Author: Sascha Schumann <sascha@schumann.cx> |
|
|
|
|
+----------------------------------------------------------------------+
|
2000-07-24 09:40:02 +08:00
|
|
|
*/
|
2000-06-24 00:46:04 +08:00
|
|
|
|
2000-07-24 09:40:02 +08:00
|
|
|
/* $Id$ */
|
2000-06-24 00:46:04 +08:00
|
|
|
|
|
|
|
#ifndef PHP_INCOMPLETE_CLASS_H
|
|
|
|
#define PHP_INCOMPLETE_CLASS_H
|
|
|
|
|
2000-06-24 00:58:30 +08:00
|
|
|
#include "ext/standard/basic_functions.h"
|
|
|
|
|
2000-06-24 00:46:04 +08:00
|
|
|
#define PHP_IC_ENTRY \
|
|
|
|
BG(incomplete_class)
|
|
|
|
|
2005-06-28 17:46:30 +08:00
|
|
|
#define PHP_SET_CLASS_ATTRIBUTES(struc) \
|
|
|
|
/* 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); \
|
2008-09-16 22:36:27 +08:00
|
|
|
if (!class_name) { \
|
|
|
|
name_len = sizeof(INCOMPLETE_CLASS) - 1; \
|
|
|
|
class_name = estrndup(INCOMPLETE_CLASS, name_len); \
|
|
|
|
} \
|
2005-06-28 17:46:30 +08:00
|
|
|
free_class_name = 1; \
|
2004-03-19 00:54:36 +08:00
|
|
|
incomplete_class = 1; \
|
2005-06-28 17:46:30 +08:00
|
|
|
} else { \
|
2005-06-29 17:28:44 +08:00
|
|
|
free_class_name = !zend_get_object_classname(struc, &class_name, &name_len TSRMLS_CC);\
|
2000-06-24 00:46:04 +08:00
|
|
|
}
|
|
|
|
|
2005-06-28 17:46:30 +08:00
|
|
|
#define PHP_CLEANUP_CLASS_ATTRIBUTES() \
|
2000-06-24 00:46:04 +08:00
|
|
|
if (free_class_name) efree(class_name)
|
|
|
|
|
|
|
|
#define PHP_CLASS_ATTRIBUTES \
|
|
|
|
char *class_name; \
|
2005-07-06 07:48:44 +08:00
|
|
|
zend_uint name_len; \
|
2004-03-19 00:54:36 +08:00
|
|
|
zend_bool free_class_name = 0; \
|
|
|
|
zend_bool incomplete_class = 0
|
2000-06-24 00:46:04 +08:00
|
|
|
|
2002-07-24 17:55:11 +08:00
|
|
|
#define INCOMPLETE_CLASS "__PHP_Incomplete_Class"
|
|
|
|
#define MAGIC_MEMBER "__PHP_Incomplete_Class_Name"
|
2000-06-24 00:46:04 +08:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2007-11-06 18:53:01 +08:00
|
|
|
PHPAPI zend_class_entry *php_create_incomplete_class(TSRMLS_D);
|
2006-01-28 14:18:01 +08:00
|
|
|
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);
|
2000-06-24 00:46:04 +08:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|