Re: [ab] SWIG -external-all questions

Hello all,
Luke J Crook <luke@...> wrote:
>I just downloaded and compiled the latest SWIG from CVS and I have a
>question regarding the new functionality that you added this month.
>
>* -extern-all ; This does not seem to work. No symbols are exported.
I need to remove this option from being shown. It is not present and there
is no plan to add it, because it is unnecessary.
>
>* -lispify? What -cffi option do I use to test this?
>
OK. I will give some examples and show how to use the new features. Also,
I will suggest reading the section
11.3 Features and the %feature directive in the SWIG docs.
SWIG/Doc/Manual/Customization.html
Say, file: test.i
%module test
%feature("inline") sleep; //this will inline the sleep function
%feature("export"); //start exporting symbols
%feature("intern_function"); //start lispifying symbols
%include "test.cpp"
%feature("intern_function",""); //start lispifying symbols
%feature("intern_function","lispify"); //start lispifying symbols

PHP5 OO Wrapping

Olly Betts <olly <at> survex.com>
2006-05-02 23:27:51 GMT

Currently SWIG's PHP support can wrap C++ to produce either a flat function
interface (so Class::method_name -> Class_method_name) or to produce an
OO interface, but the OO interface only works for PHP4.
Kevin suggested the best way to fix this was to get SWIG to output PHP
code to wrap the existing flat function interface (the PHP4 OO interface
is implemented using C).
I've been working on fixing this, and I now have a patch for SWIG which
is good enough to generate wrappers for Xapian. It still needs a bit
of work - for example Xapian doesn't need getters or setters so I've
not done those yet. I've also not updated the documentation yet.
Here's the latest patch - it's not ready to be applied yet, but I'd
welcome any comments, especially on things I'm doing the wrong way:
http://www.oligarchy.co.uk/xapian/patches/swig-php-gen-oo-wrappers9.patch
And here's an example of the PHP wrapper generated:
http://www.oligarchy.co.uk/xapian/patches/xapian9.phps
In the process of working on this, I've fixed a few problems in SWIG's
PHP backend, which really should be submitted as separate patches first.
I'd like to start pulling those out and getting them applied.
However, SourceForge's anoncvs mirroring has been offline for ages (this
applies to all projects using SourceForge's CVS I believe). I don't
know exactly when it failed, but the latest update to SWIG's anoncvs
tree seems to have happened just after the 1.3.29 release (2006-03-21).

Re: PHP5 OO Wrapping

Kevin Ruland <kruland <at> sunflower.com>
2006-05-03 01:55:43 GMT

Olly,
Wow! That's great. Glad to hear this is proving to be so good. I
certainly welcome any help with the php generator -- especially since
I've been laying low in a new job for over 2 months now.
Towards that end, I do have the UTL patches lying about, but they need
to be merged back to head and committed. Then I'm not very certain
exactly what will break.
I'll try to merge your patches in first, then get the UTL patches in
there. Then hopefully there will be enough time to shake it out before
the next release.
Kevin.
Olly Betts wrote:
> Currently SWIG's PHP support can wrap C++ to produce either a flat function
> interface (so Class::method_name -> Class_method_name) or to produce an
> OO interface, but the OO interface only works for PHP4.
>
> Kevin suggested the best way to fix this was to get SWIG to output PHP
> code to wrap the existing flat function interface (the PHP4 OO interface
> is implemented using C).
>
> I've been working on fixing this, and I now have a patch for SWIG which
> is good enough to generate wrappers for Xapian. It still needs a bit
> of work - for example Xapian doesn't need getters or setters so I've
> not done those yet. I've also not updated the documentation yet.

Automatically disowning objects?

Hi,
How do I go about automatically disowning newly created objects? So far
I've tried a couple of alternatives::
%feature("self:disown") Object::Object;
%delobject Object::Object;
But none of them work. What's the easiest way to insert this without
having to manually process SWIG's output shadow classes? (I'm working
in Python)
Regards,
-- Mikael
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

Re: PHP5 OO Wrapping

Olly Betts <olly <at> survex.com>
2006-05-03 16:55:21 GMT

On 2006-05-03, Kevin Ruland <kruland <at> sunflower.com> wrote:
> Wow! That's great. Glad to hear this is proving to be so good. I
> certainly welcome any help with the php generator -- especially since
> I've been laying low in a new job for over 2 months now.
I've also implemented setters and getters for member variables now
(though they're barely tested currently). I've not done static
member variables or global variables yet, but I can use the same
approach I think.
> Towards that end, I do have the UTL patches lying about, but they need
> to be merged back to head and committed. Then I'm not very certain
> exactly what will break.
Overload resolution is pretty broken already, though you can fix it
up with a few custom typemaps at least.
> I'll try to merge your patches in first, then get the UTL patches in
> there. Then hopefully there will be enough time to shake it out before
> the next release.
OK, shall we start with unrelated (and tangentially related) patches?
I believe I sent a patch which cleans up legacy code to handle "string
pointers" in PHP4 (which can't ever be used because the corresponding
code to create them is no longer there!) Has that been applied?
Cheers,
Olly