The wrapper function filtering should only happen for -php4 without -noproxy.

Further simplify the property getter/setter code.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9407 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Olly Betts 2006-10-04 13:54:39 +00:00
commit 122b0cbd04

View file

@ -878,21 +878,20 @@ public:
return SWIG_OK; return SWIG_OK;
} }
/* Just need to append function names to function table to register with /* Just need to append function names to function table to register with PHP. */
PHP
*/
void create_command(String *cname, String *iname) { void create_command(String *cname, String *iname) {
// This is for the single main function_entry record // This is for the single main function_entry record
if (wrapperType == standard) { if (shadow && php_version == 4) {
Printf(f_h, "ZEND_NAMED_FUNCTION(%s);\n", iname); if (wrapperType != standard) return;
if (cs_entry) { }
Printf(cs_entry," ZEND_NAMED_FE(%(lower)s,%s,NULL)\n", cname, iname); Printf(f_h, "ZEND_NAMED_FUNCTION(%s);\n", iname);
} else { if (cs_entry) {
Printf(s_entry," ZEND_NAMED_FE(%(lower)s,%s,NULL)\n", cname, iname); Printf(cs_entry," ZEND_NAMED_FE(%(lower)s,%s,NULL)\n", cname, iname);
} } else {
Printf(s_entry," ZEND_NAMED_FE(%(lower)s,%s,NULL)\n", cname, iname);
} }
} }
/* ------------------------------------------------------------ /* ------------------------------------------------------------
* dispatchFunction() * dispatchFunction()
* ------------------------------------------------------------ */ * ------------------------------------------------------------ */
@ -2141,19 +2140,18 @@ public:
while (ki.key) { while (ki.key) {
key = ki.key; key = ki.key;
Printf(s_propset," if (strcmp(propname,\"%s\")==0) {\n", ki.item); Printf(s_propset," if (strcmp(propname,\"%s\")==0) return _wrap_%s(property_reference, value);\n", ki.item, key);
Printf(s_propset," return _wrap_%s(property_reference, value);\n",key);
Printf(s_propset," }\n");
ki=Next(ki); ki=Next(ki);
} }
// If there is a base class then chain its handler else set directly // If the property wasn't in this class, try the handlers of each base
// try each base class handler, else set directly... // class (if any) in turn until we succeed in setting the property or
// have tried all base classes.
if (base.item) { if (base.item) {
Printf(s_propset, " {\n /* chain to base class */\n"); Printf(s_propset, " /* Try base class(es) */\n");
while(base.item) { while (base.item) {
Printf(s_propset," if (_propset_%s(property_reference, value)==SUCCESS) return SUCCESS;\n", Printf(s_propset," if (_propset_%s(property_reference, value)==SUCCESS) return SUCCESS;\n",
GetChar(base.item, "sym:name")); GetChar(base.item, "sym:name"));
base=Next(base); base=Next(base);
@ -2161,7 +2159,6 @@ public:
base=Next(base); base=Next(base);
} }
} }
Printf(s_propset," }\n");
} }
Printf(s_propset," return FAILURE;\n}\n\n"); Printf(s_propset," return FAILURE;\n}\n\n");
@ -2231,19 +2228,20 @@ public:
ki=Next(ki); ki=Next(ki);
} }
// If there is a base class then chain its handler else return FAILURE. // If the property wasn't in this class, try the handlers of each base
// class (if any) in turn until we succeed in setting the property or
// have tried all base classes.
if (base.item) { if (base.item) {
Printf(s_propget, " {\n /* chain to base class */\n"); Printf(s_propget, " /* Try base class(es). */\n");
while(base.item) { while (base.item) {
Printf(s_propget," if (_propget_%s(property_reference, value)==SUCCESS) return SUCCESS;\n", Printf(s_propget," if (_propget_%s(property_reference, value)==SUCCESS) return SUCCESS;\n",
GetChar(base.item, "sym:name")); GetChar(base.item, "sym:name"));
base=Next(base); base=Next(base);
while (base.item && GetFlag(base.item,"feature:ignore")) { while (base.item && GetFlag(base.item,"feature:ignore")) {
base=Next(base); base=Next(base);
} }
} }
Printf(s_propget," }\n");
} }
Printf(s_propget," return FAILURE;\n}\n\n"); Printf(s_propget," return FAILURE;\n}\n\n");