in reply to perldoc for InlineX

wapoorI have installed Inline and InlineX on a Windows box.

What do you want to accomplish by using InlineX?

(I ask this because I "Inline" some stuff occasionally, but never
needed InlineX.)

Regards

mwa

Replies are listed 'Best First'.
Re^2: perldoc for InlineX
by wapoor (Novice) on Oct 08, 2007 at 18:03 UTC
    Excellent question. To make the long story short, all test code in our labs (including my perl code) is required to use some machine-generated C code at specified points -- no substitutions or translations are allowed. I will use anything that allows me to do so, and have looked at the options of Inline(X), XS, SWIG, and others. The tight schedule and high risk do not allow me to go in and learn everything the way I should (and would like to), so Inline sounded like the way to go. Alternative suggestions will be gratefully accepted.
      wapoorall test code in our labs (including my perl code) is required to use some machine-generated C code at specified points -- no substitutions or translations are allowed.

      OK, is this *C source* or a lib? If it's C source without much
      dependencies, you may use plain Inline C, like (this will reverse your nickname in C):
      my $name = 'wapoor'; my $eman = reverse_by_c($name); print "$name, $eman\n"; use Inline C => qq[ SV* reverse_by_c(SV *pname) { SV* retval; STRLEN len, i; char *eman, *name = SvPV(pname, len); New(0, eman, len, char); for(i=0; i<len; i++) eman[i] = name[len-i-1]; eman[len] = '\\0'; retval = newSVpv(eman, len); Safefree(eman); return retval; } ];
      This looks fairly simple and might be solvable for
      a C programmer within a short time ... ;-)
      You can include a lot of source this way, even
      Win32 inline assembly will work fine.

      (Or didn't I understand you correct and you
      don't like plain Inline-C for some reason?)

      Regards

      mwa