![]() |
|
Perl: the Markov chain saw | |
PerlMonks |
Re: XS Library - Embedding C code in Perlby Zaxo (Archbishop) |
on Nov 14, 2002 at 00:11 UTC ( #212728=note: print w/replies, xml ) | Need Help?? |
Inline is fine, but it is perhaps not as well integrated into ExtUtils and module building as the standard XS interface. To answer your question directly, you should #include the perl headers before your C code, unless there is good reason not to. That gives you macros and functions to ease writing your functions . This example is adapted from perlxstut, which I recommend to you:
I'd parse the command line in perl before calling library functions with the arguments. To link to an external lib, #include <foo.h> (its header) in the xs file, and put the linker directive '-lfoo' in Makefile.PL's LIB parameter. After Compline,
In Section
Seekers of Perl Wisdom
|
|