Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Just another Perl shrine
 
PerlMonks  

Re: (Ovid) Re: Inline::C code doesn't work, but the C code does

by mikfire (Deacon)
on Dec 28, 2001 at 19:35 UTC ( [id://134971]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to (Ovid) Re: Inline::C code doesn't work, but the C code does
in thread Inline::C code doesn't work, but the C code does

I know the call to ivadmin_context_createdefault() isn't working because ivadmin_response_getok is saying so. And, since the identical code works as a C program, I know it isn't my call to the library.

The PREFIX option on the use Inline C line causes perl to "strip" that prefix from the function as defined in the C code. Thus, I define it as my_create_context in the C code, and use it as create_context in the perl code.

Upon reading the docs a bit closer, if Inline didn't like the return type from my_context_create, it would simply ignore the function. As I can call it from perl, I assume this isn't the problem. Again, if I read the docs right, I don't need a typemap unless I intend on using one of those structs as a return type.

I tried your suggestion on the update, and it is saying the function has been bound to perl. I have also browsed the generated XS code and it looks correct to me, although I think I indicated previously that my XS skills are nonexistent.

I am using the same make.

Thanks for the suggestions, Ovid. I am back to hitting the docs and trying ( once again ) to work my way through perlapi.

mikfire

  • Comment on Re: (Ovid) Re: Inline::C code doesn't work, but the C code does

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://134971]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.