I need to call a perl routine in my C program. The perl routine takes the following arguments: $a, $b, $c
, where $a
and $b
are integers, $c
is a string (may contain binary characters). According to perlcall, here are the means of making the call.
I32 call_sv(SV* sv, I32 flags);
I32 call_pv(char *subname, I32 flags);
I32 call_method(char *methname, I32 flags);
I32 call_argv(char *subname, I32 flags, char **argv);
Seems that I can only use call_argv(...), but there are two questions
- how do I pass an integer to the perl routine
- how do I pass a (binary) string to perl?
Wish there is a function like
I32 call_argv(char *subname, I32 flags, int numOfArgs, SV* a, SV* b, SV *c ...);