Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: My XS pointer problem...

by MarkM (Curate)
on Apr 08, 2003 at 02:21 UTC ( [id://248782]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://248782]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-03-29 08:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found