cvs: php-gtk / TODO /src php_gtk.h php_gtk_util.c
| From: | Andrei Zmievski | Date: | Wed, 28 Feb 2001 04:48:23 +0000 |
| Subject: | cvs: php-gtk / TODO /src php_gtk.h php_gtk_util.c | ||
| Groups: | php.gtk | ||
| Request: | Send a blank email to php-gtk+get-61@lists.php.net to get a copy of this message | ||
andrei Tue Feb 27 20:48:23 2001 EDT
Modified files:
/php-gtk TODO
/php-gtk/src php_gtk.h php_gtk_util.c
Log:
* Fix inline functions declarations
* Fix php_gtk_check_callable() to allow array('Class', 'method') call
Index: php-gtk/TODO
diff -u php-gtk/TODO:1.15 php-gtk/TODO:1.16
--- php-gtk/TODO:1.15 Tue Feb 27 08:54:22 2001
+++ php-gtk/TODO Tue Feb 27 20:48:23 2001
@@ -5,6 +5,7 @@
objects (GdkColormap, etc.)
* Figure out what's up with getting/setting gc background/foreground colors and
how to get RGB values from pixels.
+* Provide access to GTK version number.
In PHP
------
Index: php-gtk/src/php_gtk.h
diff -u php-gtk/src/php_gtk.h:1.15 php-gtk/src/php_gtk.h:1.16
--- php-gtk/src/php_gtk.h:1.15 Tue Feb 27 09:44:42 2001
+++ php-gtk/src/php_gtk.h Tue Feb 27 20:48:23 2001
@@ -18,7 +18,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: php_gtk.h,v 1.15 2001/02/27 17:44:42 fmk Exp $: */
+/* $Id: php_gtk.h,v 1.16 2001/02/28 04:48:23 andrei Exp $: */
#ifndef _PHP_GTK_H
#define _PHP_GTK_H
@@ -106,17 +106,13 @@
zval php_gtk_get_property(zend_property_reference *property_reference);
int php_gtk_set_property(zend_property_reference *property_reference, zval *value);
-/*
-void php_gtk_register_prop_getter(zend_class_entry *ce, prop_getter_t getter);
-void php_gtk_register_prop_setter(zend_class_entry *ce, prop_setter_t setter);
-*/
-inline void php_gtk_register_prop_getter(zend_class_entry *ce, prop_getter_t getter)
+static inline void php_gtk_register_prop_getter(zend_class_entry *ce, prop_getter_t getter)
{
zend_hash_index_update(&php_gtk_prop_getters, (long)ce, (void*)&getter,
sizeof(prop_getter_t), NULL);
}
-inline void php_gtk_register_prop_setter(zend_class_entry *ce, prop_setter_t setter)
+static inline void php_gtk_register_prop_setter(zend_class_entry *ce, prop_setter_t setter)
{
zend_hash_index_update(&php_gtk_prop_setters, (long)ce, (void*)&setter,
sizeof(prop_setter_t), NULL);
Index: php-gtk/src/php_gtk_util.c
diff -u php-gtk/src/php_gtk_util.c:1.6 php-gtk/src/php_gtk_util.c:1.7
--- php-gtk/src/php_gtk_util.c:1.6 Mon Feb 19 17:55:03 2001
+++ php-gtk/src/php_gtk_util.c Tue Feb 27 20:48:23 2001
@@ -18,7 +18,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: php_gtk_util.c,v 1.6 2001/02/20 01:55:03 andrei Exp $ */
+/* $Id: php_gtk_util.c,v 1.7 2001/02/28 04:48:23 andrei Exp $ */
#include "php_gtk.h"
@@ -389,14 +389,26 @@
{
zval **method;
zval **obj;
+ zend_class_entry *ce;
if (zend_hash_index_find(Z_ARRVAL_P(function), 0, (void **) &obj) == SUCCESS &&
zend_hash_index_find(Z_ARRVAL_P(function), 1, (void **) &method) == SUCCESS &&
- Z_TYPE_PP(obj) == IS_OBJECT &&
+ (Z_TYPE_PP(obj) == IS_OBJECT || Z_TYPE_PP(obj) == IS_STRING) &&
Z_TYPE_PP(method) == IS_STRING) {
+ if (Z_TYPE_PP(obj) == IS_STRING) {
+ int found;
+
+ lcname = estrndup(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj));
+ zend_str_tolower(lcname, Z_STRLEN_PP(obj));
+ found = zend_hash_find(EG(class_table), lcname, Z_STRLEN_PP(obj) + 1, (void**)&ce);
+ efree(lcname);
+ if (found == FAILURE)
+ break;
+ } else
+ ce = Z_OBJCE_PP(obj);
lcname = estrndup(Z_STRVAL_PP(method), Z_STRLEN_PP(method));
zend_str_tolower(lcname, Z_STRLEN_PP(method));
- if (zend_hash_exists(&Z_OBJCE_PP(obj)->function_table, lcname, Z_STRLEN_PP(method)+1))
+ if (zend_hash_exists(&ce->function_table, lcname, Z_STRLEN_PP(method)+1))
retval = 1;
efree(lcname);
}