|
From: Rob M. <Rob...@ig...> - 2010-05-05 05:05:19
|
Hi,
I want to have a C function that uses the XSUB stuff
from Perl's API. So I define a function something
along the lines of:
XS(my_func) {
...
}
But I'm having a hard time trying to figure out how
to add this function to my .i file so that it will
end up being accessible via the package I'm creating.
But if I do:
extern XS(my_func);
I get an error because it sets up a wrapper that tries
to call my_func with an arg of type XS, e.g. the wrapped
function has:
(XS *)arg1;
which fails because XS isn't defined. If I try to define
the function as:
extern void my_func();
I get an error because the number of arguments don't
match...
I guess my question is: How do I add a method to the
swig_commands[] array so that it is visible via the
package but tell swig to NOT create a wrapper for the
function?
What I've been doing is editing the *_wrap.c with sed
to add it to the array, but I was hoping that there
was a Swig directive or something I could use instead.
Thanks,
Rob
|