Here is how to wrap foo.c's foo() function and link libprefoo.so. Adapted from Inline:C-Cookbook.
You really only need a wrapper if the desired perl syntax differs from that of the C call.package First; use Inline C => Config => LIBS => ' -lprefoo '; use Inline C; # (Added) foo_wrapper(); _DATA_ _C_ #include <foo/prefoo.h> #include "foo.c" void foo_wrapper { foo(); }
After Compline,
Zaxo
In reply to Re: Inline::C better than XS?
by Zaxo
in thread Inline::C better than XS?
by ginttu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |