in reply to My XS pointer problem...

It looks like you have a few problems, the first of which being that "CODE:" XS sections, although defining RETVAL, do not use RETVAL as the default OUTPUT argument. An explicit "OUTPUT: RETVAL" is necessary.

The next problem that you will hit is that you are returning a 'char', casting a malloc()'d pointer to an 'int', and assuming that you can dereference this from Perl. You should be returning a 'char *' or 'SV *' instead.

I recommend a little more reading up on the XS interface. It is very complicated stuff. Cheers, and good luck.

Replies are listed 'Best First'.
Re: Re: My XS pointer problem...
by doneill (Initiate) on Apr 08, 2003 at 15:55 UTC
    Well, the idea was to follow tye's advice I found in some other articles on using as much perl/c to wrap the function, and less XS for reasons of cleanliness, simplicity, and debugging which constitutes the former two ideals.