Author: jasons Date: Mon Nov 3 21:26:18 2003 New Revision: 84 Modified: xml/xerces-p/trunk/Handler/PerlCallbackHandler.cpp xml/xerces-p/trunk/Handler/PerlCallbackHandler.hpp xml/xerces-p/trunk/Handler/PerlCallbackHandler.swig.hpp xml/xerces-p/trunk/Handler/PerlEntityResolverHandler.hpp xml/xerces-p/trunk/Handler/PerlEntityResolverHandler.i xml/xerces-p/trunk/Handler/PerlNodeFilterCallbackHandler.hpp xml/xerces-p/trunk/Handler/PerlNodeFilterCallbackHandler.i Log: multiple inheritance now works with PerlCallbackHandler (fixes 24373)
Modified: xml/xerces-p/trunk/Handler/PerlCallbackHandler.cpp ============================================================================== --- xml/xerces-p/trunk/Handler/PerlCallbackHandler.cpp (original) +++ xml/xerces-p/trunk/Handler/PerlCallbackHandler.cpp Mon Nov 3 21:26:18 2003 @@ -19,15 +19,15 @@ callbackObj = object; } -// SV* -// PerlCallbackHandler::set_callback_obj(SV* object) { -// SV *oldRef = &PL_sv_undef; // default to 'undef' -// if (callbackObj != NULL) { -// oldRef = callbackObj; -// SvREFCNT_dec(oldRef); -// } -// SvREFCNT_inc(object); -// callbackObj = object; -// return oldRef; -// } +SV* +PerlCallbackHandler::set_callback_obj(SV* object) { + SV *oldRef = &PL_sv_undef; // default to 'undef' + if (callbackObj != NULL) { + oldRef = callbackObj; +// SvREFCNT_dec(oldRef); + } + SvREFCNT_inc(object); + callbackObj = object; + return oldRef; +} Modified: xml/xerces-p/trunk/Handler/PerlCallbackHandler.hpp ============================================================================== --- xml/xerces-p/trunk/Handler/PerlCallbackHandler.hpp (original) +++ xml/xerces-p/trunk/Handler/PerlCallbackHandler.hpp Mon Nov 3 21:26:18 2003 @@ -45,7 +45,7 @@ PerlCallbackHandler(SV*); virtual ~PerlCallbackHandler(); -// SV* set_callback_obj(SV*); + SV* set_callback_obj(SV*); }; #endif /* __PERLCALLBACKHANDLER */ Modified: xml/xerces-p/trunk/Handler/PerlCallbackHandler.swig.hpp ============================================================================== --- xml/xerces-p/trunk/Handler/PerlCallbackHandler.swig.hpp (original) +++ xml/xerces-p/trunk/Handler/PerlCallbackHandler.swig.hpp Mon Nov 3 21:26:18 2003 @@ -2,18 +2,18 @@ public: -// PerlCallbackHandler(); -// PerlCallbackHandler(SV*); -// void set_callback_obj(SV*); + PerlCallbackHandler(); + PerlCallbackHandler(SV*); + void set_callback_obj(SV*); }; -class PerlNodeFilterCallbackHandler : public IDOM_NodeFilter, public PerlCallbackHandler { +class PerlNodeFilterCallbackHandler : public DOMNodeFilter, public PerlCallbackHandler { public: PerlNodeFilterCallbackHandler(); PerlNodeFilterCallbackHandler(SV*); - void set_callback_obj(SV*); +// void set_callback_obj(SV*); }; @@ -23,7 +23,7 @@ PerlDocumentCallbackHandler(); PerlDocumentCallbackHandler(SV*); - void set_callback_obj(SV*); +// void set_callback_obj(SV*); }; @@ -33,7 +33,7 @@ PerlContentCallbackHandler(); PerlContentCallbackHandler(SV*); - void set_callback_obj(SV*); +// void set_callback_obj(SV*); }; @@ -43,7 +43,7 @@ PerlEntityResolverHandler(); PerlEntityResolverHandler(SV*); - void set_callback_obj(SV*); +// void set_callback_obj(SV*); }; @@ -53,7 +53,7 @@ PerlErrorCallbackHandler(); PerlErrorCallbackHandler(SV*); - void set_callback_obj(SV*); +// void set_callback_obj(SV*); }; Modified: xml/xerces-p/trunk/Handler/PerlEntityResolverHandler.hpp ============================================================================== --- xml/xerces-p/trunk/Handler/PerlEntityResolverHandler.hpp (original) +++ xml/xerces-p/trunk/Handler/PerlEntityResolverHandler.hpp Mon Nov 3 21:26:18 2003 @@ -9,11 +9,11 @@ XERCES_CPP_NAMESPACE_USE class PerlEntityResolverHandler: public EntityResolver -// , public PerlCallbackHandler + , public PerlCallbackHandler { protected: - SV *callbackObj; +// SV *callbackObj; public: @@ -21,7 +21,7 @@ PerlEntityResolverHandler(SV *obj); ~PerlEntityResolverHandler(); - SV* set_callback_obj(SV*); +// SV* set_callback_obj(SV*); // The EntityResolver interface InputSource* resolveEntity (const XMLCh* const publicId, Modified: xml/xerces-p/trunk/Handler/PerlEntityResolverHandler.i ============================================================================== --- xml/xerces-p/trunk/Handler/PerlEntityResolverHandler.i (original) +++ xml/xerces-p/trunk/Handler/PerlEntityResolverHandler.i Mon Nov 3 21:26:18 2003 @@ -25,19 +25,19 @@ set_callback_obj(obj); } -SV* -PerlEntityResolverHandler::set_callback_obj(SV* object) { - SV *oldRef = &PL_sv_undef; // default to 'undef' - if (callbackObj != NULL) { - oldRef = callbackObj; -#if defined(PERL_VERSION) && PERL_VERSION >= 8 -// SvREFCNT_dec(oldRef); -#endif - } - SvREFCNT_inc(object); - callbackObj = object; - return oldRef; -} +// SV* +// PerlEntityResolverHandler::set_callback_obj(SV* object) { +// SV *oldRef = &PL_sv_undef; // default to 'undef' +// if (callbackObj != NULL) { +// oldRef = callbackObj; +// #if defined(PERL_VERSION) && PERL_VERSION >= 8 +// // SvREFCNT_dec(oldRef); +// #endif +// } +// SvREFCNT_inc(object); +// callbackObj = object; +// return oldRef; +// } InputSource * PerlEntityResolverHandler::resolveEntity (const XMLCh* const publicId, @@ -58,12 +58,18 @@ XPUSHs(callbackObj); // the next argument is the publicId - char *cptr1 = XMLString::transcode(publicId); + + // this transcode has two problems 1) it will leak if not deleted + // and 2) why are we getting a char*, doesn't this screw up Unicode? + char *cptr1 = XMLString::transcode(publicId); SV *string1 = sv_newmortal(); sv_setpv(string1, (char *)cptr1); XPUSHs(string1); // the next argument is the systemId + + // this transcode has two problems 1) it will leak if not deleted + // and 2) why are we getting a char*, doesn't this screw up Unicode? char *cptr2 = XMLString::transcode(systemId); SV *string2 = sv_newmortal(); sv_setpv(string2, (char *)cptr2); Modified: xml/xerces-p/trunk/Handler/PerlNodeFilterCallbackHandler.hpp ============================================================================== --- xml/xerces-p/trunk/Handler/PerlNodeFilterCallbackHandler.hpp (original) +++ xml/xerces-p/trunk/Handler/PerlNodeFilterCallbackHandler.hpp Mon Nov 3 21:26:18 2003 @@ -7,11 +7,11 @@ XERCES_CPP_NAMESPACE_USE class PerlNodeFilterCallbackHandler : public DOMNodeFilter -// , public PerlCallbackHandler + , public PerlCallbackHandler { protected: - SV *callbackObj; +// SV *callbackObj; public: @@ -19,10 +19,10 @@ PerlNodeFilterCallbackHandler(SV *obj); ~PerlNodeFilterCallbackHandler(); - SV* set_callback_obj(SV*); +// SV* set_callback_obj(SV*); // The NodeFilter interface short acceptNode (const DOMNode* node) const; }; -#endif __PERLNODEFILTERCALLBACKHANDLER +#endif /* __PERLNODEFILTERCALLBACKHANDLER */ Modified: xml/xerces-p/trunk/Handler/PerlNodeFilterCallbackHandler.i ============================================================================== --- xml/xerces-p/trunk/Handler/PerlNodeFilterCallbackHandler.i (original) +++ xml/xerces-p/trunk/Handler/PerlNodeFilterCallbackHandler.i Mon Nov 3 21:26:18 2003 @@ -18,19 +18,19 @@ set_callback_obj(obj); } -SV* -PerlNodeFilterCallbackHandler::set_callback_obj(SV* object) { - SV *oldRef = &PL_sv_undef; // default to 'undef' - if (callbackObj != NULL) { - oldRef = callbackObj; -#if defined(PERL_VERSION) && PERL_VERSION >= 8 -// SvREFCNT_dec(oldRef); -#endif - } - SvREFCNT_inc(object); - callbackObj = object; - return oldRef; -} +// SV* +// PerlNodeFilterCallbackHandler::set_callback_obj(SV* object) { +// SV *oldRef = &PL_sv_undef; // default to 'undef' +// if (callbackObj != NULL) { +// oldRef = callbackObj; +// #if defined(PERL_VERSION) && PERL_VERSION >= 8 +// // SvREFCNT_dec(oldRef); +// #endif +// } +// SvREFCNT_inc(object); +// callbackObj = object; +// return oldRef; +// } short PerlNodeFilterCallbackHandler::acceptNode (const DOMNode* node) const --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]