It's been many years since working with XS, so I apologize for my
ignorance. :)

I have a C++ constructor with a signature like this:

family( int count, char* names[], int ages[], char* family_name );

My question is what is the easiest way to interface with methods with this
kind of signature?


I'd be very happy to have typemaps handle those (and thus make my XS simply
declare the constructor), but seems like I need to malloc the new arrays.
 And that would mean I'd need to free those which I assume I could do right
after the constructor above returns.[1]  Or, if I have some reasonable
bounds on the total number of elements can I just a fixed size array on the
stack?

Could someone please provide an example -- or maybe point me to existing
code on CPAN?

Thanks,



[1] I guess I'd better see if family() holds on to the addresses of names[]
and ages[] after returning.   Hum, if I don't know that maybe I need to
malloc my own "object" so I can free those on DESTROY.   Is that right?

-- 
Bill Moseley
mose...@hank.org

Reply via email to