I'll ask it in the simplest most lame terms I can, since I am missing something very fundamental in perl
I have a C function:this is what it does:double do_nothing(double x[], int sizeOfX)
double do_nothing(double x[], int sizeOfX) { int index; for(index=0; index<sizeOfX; index++) { x[index]=1; } return x[0]; }
what should be my XS function??? How do I write it so the XS function takes array and a number, pass it to the C function, return the array so I can read its cell through perl?
I know it should start with this:
double do_nothing(x, sizeOFX) AV * x int sizeOfX
Please, long answers - I'm dumb. I couldn't find a single example on the internet which explains it and no reference to perlXS or perlguts documentation (I'm already reading them - all 34 pages of perlXS and 45 pages of perlguts, but I learn better from examples)
In reply to perl XS - passing array to C and getting it back by kopolov
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |