cvs: ZendEngine2 / zend_API.c zend_API.h

From: Date: Wed, 15 Oct 2003 06:24:17 +0000
Subject: cvs: ZendEngine2 / zend_API.c zend_API.h
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-1906@lists.php.net to get a copy of this message
helly Wed Oct 15 02:24:17 2003 EDT Modified files: /ZendEngine2 zend_API.c zend_API.h Log: Add oo support function zend_class_implements() Index: ZendEngine2/zend_API.c diff -u ZendEngine2/zend_API.c:1.219 ZendEngine2/zend_API.c:1.220 --- ZendEngine2/zend_API.c:1.219 Fri Oct 3 18:41:42 2003 +++ ZendEngine2/zend_API.c Wed Oct 15 02:24:17 2003 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.c,v 1.219 2003/10/03 22:41:42 moriyoshi Exp $ */ +/* $Id: zend_API.c,v 1.220 2003/10/15 06:24:17 helly Exp $ */ #include "zend.h" #include "zend_execute.h" @@ -1443,6 +1443,26 @@ zend_do_inheritance(register_class, parent_ce); } return register_class; +} + +ZEND_API void zend_class_implements(zend_class_entry *class_entry TSRMLS_DC, int num_interfaces, ...) +{ + zend_class_entry *interface_entry; + va_list interface_list; + + if (class_entry->type & ZEND_INTERNAL_CLASS) { + class_entry->interfaces = realloc(class_entry->interfaces, sizeof(zend_class_entry*) * (class_entry->num_interfaces+num_interfaces)); + } else { + class_entry->interfaces = erealloc(class_entry->interfaces, sizeof(zend_class_entry*) * (class_entry->num_interfaces+num_interfaces)); + } + + va_start(interface_list, num_interfaces); + while (num_interfaces--) { + interface_entry = va_arg(interface_list, zend_class_entry *); + class_entry->interfaces[class_entry->num_interfaces++] = interface_entry; + zend_do_implement_interface(class_entry, interface_entry); + } + va_end(interface_list); } ZEND_API zend_class_entry *zend_register_internal_class(zend_class_entry *orig_class_entry TSRMLS_DC) Index: ZendEngine2/zend_API.h diff -u ZendEngine2/zend_API.h:1.163 ZendEngine2/zend_API.h:1.164 --- ZendEngine2/zend_API.h:1.163 Sat Oct 4 21:54:46 2003 +++ ZendEngine2/zend_API.h Wed Oct 15 02:24:17 2003 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.h,v 1.163 2003/10/05 01:54:46 shane Exp $ */ +/* $Id: zend_API.h,v 1.164 2003/10/15 06:24:17 helly Exp $ */ #ifndef ZEND_API_H #define ZEND_API_H @@ -158,6 +158,7 @@ ZEND_API zend_class_entry *zend_register_internal_class(zend_class_entry *class_entry TSRMLS_DC); ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *class_entry, zend_class_entry *parent_ce, char *parent_name TSRMLS_DC); +ZEND_API void zend_class_implements(zend_class_entry *class_entry TSRMLS_DC, int num_interfaces, ...); ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC); ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC);

« previous php.zend-engine.cvs (#1906) next »