void printit() {
int i;
printf(buf,"%d ",perm);
for(i = 0; i < talks; i++)
printf("%d ",res_a[i]);
printf("\n");
}
####
$perl test.pl | wc
46 2859 8192
####
$ perl test.pl | wc
113 7164 20480
####
void printit() {
Inline_Stack_Vars;
Inline_Stack_Reset;
int i;
int howmuch;
char buf[1000];
howmuch = sprintf(buf,"%d ",perm);
for(i = 0; i < talks; i++) {
howmuch+=sprintf(buf+howmuch,"%d ",res_a[i]);
}
buf[howmuch-1] = '\n';
Inline_Stack_Push(newSVpvf("%s",buf));
Inline_Stack_Done;
perl_call_pv("main::printme",0);
Inline_Stack_Void;
}
In Perl:
sub printme {
print for $_[0];
}