in reply to Re: Typemap in Perl XS (no)
in thread Typemap in Perl XS

Thanks for the reply. My perl script is passing the address of a variable which will holds the string. The Perl XS program will populate the string and that string should then be available to perl script.

Replies are listed 'Best First'.
Re^3: Typemap in Perl XS (no)
by bulk88 (Priest) on Aug 15, 2012 at 03:07 UTC
    Is your C API really using a char **? That would mean that library has its own memory allocator. There is no way to do a "char **" with the default perl typemap. You will have to write real C/XS code (CODE:/PPCODE:) section, or write real C code in your supplementary typemap in your module. ANSI prototype mode with default perl typemap wont work for "char **"s.

    Please read How do I post a question effectively? and post more background on what you are trying to do, and code or C header examples of what you have done so far.
Re^3: Typemap in Perl XS (no)
by tye (Sage) on Aug 14, 2012 at 14:26 UTC

    That sounds like 'char *' not 'void **'.

    You need to be clearer on how "the string" should be allocated, at least.

    - tye        

      Yes..Thats fine. What i want to know is that how should i pass pointer to a pointer to a Perl XS subroutine? Even if i use char**, it breaks at run time saying "undefined symbol: XS_unpack_charPtrPtr".

        Yes. That's fine. Good luck working that out with somebody who you care to actually share some details so that they can help you.

        - tye