Inline@
perl.org
Please help.
Here's what I want to do.
From a Perl routine, I want to call a Perl Inline callable "C" subroutine that is essentially at the head of a rather large set of "C" routines [ way over 10,000 lines] that do a rather sophisticated task that I do not wish to attempt to describe here.
I need the "C" "engine" that I've already built to do what it does without having to screw with it any more. It is vulnerable to further development and maintenance errors that I wish to avoid. It was written in Visual C++, but much of it is regular C.
I want Perl to do the front end and back end work of handling strings and other matters to get the data together to call the above described "C" subroutine "engine" through the use of Inline C.
I want to pass a small set of variables - about 10 or so - to the Perl callable "C" routines.
foo (var1, var2, var3, var4, var5, var6, var7, var8, var9, var10 );
[I could pass another blank variable that sends back an array of real numbers, if that could be made to work. ie.
foo (var1, var2, var3, var4, var5, var6, var7, var8, var9, var10, var11 );]
The goal is that I want to get an indefinitely large array of real number results back from the called routine.
That's it.
It seems simple, but it has become a nightmare.
I am running version Perl 5.10.0, the latest and greatest version I could find. Also the latest version of Inline, version 0.44.
I am on a PC running Windows 2000, and using active state .
The following line "works" when tested in a very small routine.
@results = map {$_} foo (var1, var2, var3, var4, var5, var6, var7, var8, var9, var10 );
In this example, I use the following stack method in the "C" routine to pass back what I want as this array:
Inline_Stack_Reset;
Inline_Stack_Push(sv_2mortal(newSViv(arg))); ...