plugins/perl/perl-common.c

changeset 11290
136722ebf145
parent 11170
d8941580d87f
child 11318
13fa1d5134f3
equal deleted inserted replaced
11289:90e0133137e7 11290:136722ebf145
176 execute_perl(const char *function, int argc, char **args) 176 execute_perl(const char *function, int argc, char **args)
177 { 177 {
178 int count = 0, i, ret_value = 1; 178 int count = 0, i, ret_value = 1;
179 SV *sv_args[argc]; 179 SV *sv_args[argc];
180 STRLEN na; 180 STRLEN na;
181 181 PERL_SET_CONTEXT(my_perl);
182 /* 182 /*
183 * Set up the perl environment, push arguments onto the 183 * Set up the perl environment, push arguments onto the
184 * perl stack, then call the given function 184 * perl stack, then call the given function
185 */ 185 */
186 dSP; 186 dSP;
194 XPUSHs(sv_args[i]); 194 XPUSHs(sv_args[i]);
195 } 195 }
196 } 196 }
197 197
198 PUTBACK; 198 PUTBACK;
199 PERL_SET_CONTEXT(my_perl);
199 count = call_pv(function, G_EVAL | G_SCALAR); 200 count = call_pv(function, G_EVAL | G_SCALAR);
200 SPAGAIN; 201 SPAGAIN;
201 202
202 /* 203 /*
203 * Check for "die," make sure we have 1 argument, and set our 204 * Check for "die," make sure we have 1 argument, and set our

mercurial