How do all?
I'm calling some C code from perl by using XS. I've declared all the code in myprog.xs but I'm not sure how to tell perl about my C struct.
Do I edit ExtUtils/typemap? and if I do what do I add where?
Perl also doesn't know about long*.
This is a discussion on C structure in perl typemap within the Linux Programming forums, part of the Platform Specific Boards category; How do all? I'm calling some C code from perl by using XS. I've declared all the code in myprog.xs ...
How do all?
I'm calling some C code from perl by using XS. I've declared all the code in myprog.xs but I'm not sure how to tell perl about my C struct.
Do I edit ExtUtils/typemap? and if I do what do I add where?
Perl also doesn't know about long*.
Well, I got it working without using structs - it was more of a design issue.
long * can be used by using void * in the XS declaration and a cast to long * in the C.
This is pretty cool stuff though. Means I can call C library functions from Perl and maintain data (eg. persistent database connections)without using exec et al.
Good chapter in Programming Perl (Wall et al) on this: 21 Internals and Externals.