I need to use a special C-function with Perl. I discovered that Inline is
great for doing that! I only have basic C-knowledge... I have more Perl
knowledge, but I hardly ever use arrays of references... :(
 
This is the definition of my C-function
 
error_t GetData( const char *string, data_t **data, int *nr_elements);
 
So I have to call this function in Perl while supplying pointers... how do I
do that?
 
something like this?
 
=======perl-script============
my $error;
 
my $string;
 
my @data_t = [];
 
my $nr_elements;
 
$error = GetData (\$string, \@data_t, \$nr_elements);
 
if ($error eq 'OK')
{
    print "string is: $string\n";
    print "array element 1: $->$data_t[0]\n";
    print "array element 2: ${$data_t[1]}\n";
    print "array element 3: $->$data_t[2]\n";
    etc.
}
else
{
    print "an error occured!\n";
}
===========================
 
Will this work? I can't test it now, because someone else is programming the
C-function and it is not finished yet...
 
I hope somebody can give me some tips. :)
 
Regards,
 
Marco
 
BTW Happy Eastern!


Reply via email to