in reply to (tye)Re: PerlXS type problem
in thread PerlXS type problem

Thanks tye, that was an excellent help, got me going again ;-))
Now I have another problem though, one of the C functions calls another C function which returns a ULONG value. The ULONG returning function is declared as static in a .C file and takes a structure as a parameter (The structure is typedef'd in a C file aswell).
Here's what I've got so far:
testmain.XS File: This is the declaration for the ULONG returning function-
unsigned long GetHandle(row,entry) unsigned long row CACHE *entry OUTPUT: RETVAL
Typemap:
const char * T_PV unsigned char * T_PV CACHE * T_PTROBJ
When I compile this I get the following error (First of many!)
Error C2065: 'CACHE': Undeclared identifier.
I have included all headers and added all .obj files to the makefile.pl.
Is there any way around these problems?? I can't modify the c code BTW!
Again, thanks,
Paul

Replies are listed 'Best First'.
(tye)Re2: PerlXS type problem
by tye (Sage) on Jun 01, 2001 at 18:23 UTC

    Sounds exactly like you aren't managing to include the definition of the CACHE struct successfully. You'll need to look at the *.c file and perhaps preprocessed output of that and dig around in the headers to figure out why.

    I don't think your simple typemap will work either, though. I suppose it might if there is some other function you call to initialize "entry". BTW, I'm not a big fan of T_PTROBJ. I usually prefer to stuff my C structs into Perl strings. But that is a whole 'nother topic. (:

            - tye (but my friends call me "Tye")