in reply to Calling c functions from perl...

My suggestion would be to jettison SWIG. Of course I dont have any experience with SWIG but I do have experience with Inline::C so this isn't coming from an unbiased viewpoint. :-)

Anyway, Inline::C will automatically wrap most C functions with the appropriate XS glue. Occasionally it needs help with special typemaps but not often. Besides that constructing an SV with the appropriate properties is quite easy, but you will need to know the length of the buffer and the utilized part of the buffer for it to work. IMO you should immediately go an download Inline::C and play with it. It is not difficult to use at all, and probably will help you design a Perl/C interface layer for your code much easier than SWIG will.

---
$world=~s/war/peace/g

Replies are listed 'Best First'.
Re^2: Calling c functions from perl...
by salva (Canon) on May 18, 2005 at 16:01 UTC
    I know both Inline::C and SWIG (and BTW, XS) and using SWIG is not more difficult than Inline::C.

    The real problem with SWIG is that the Perl module is not very well maintained :-(

      Well, Inline::C is well maintained. And given how totally easy it is to use and the questions the OP was giving in the CB it seems to me to be a better starting place for understanding how the whole C/Perl interfacing thing works. To me I::C is a just a tool to produce XS with minimal pain. Pain it seems that the OP is encountering with SWIG. :-)

      ---
      $world=~s/war/peace/g