Changeset 6922edd for perlconfig.c
- Timestamp:
- Oct 26, 2006, 11:14:41 AM (18 years ago)
- Branches:
- master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 4c46dfd
- Parents:
- bc220b2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perlconfig.c
r216c734 r6922edd 7 7 #define OWL_PERL 8 8 #include "owl.h" 9 #include <perl.h>10 #include "XSUB.h"11 9 12 10 static const char fileIdent[] = "$Id$"; … … 16 14 extern XS(boot_owl); 17 15 extern XS(boot_DynaLoader); 18 extern XS(boot_DBI);16 // extern XS(boot_DBI); 19 17 20 18 static void owl_perl_xs_init(pTHX) … … 337 335 } 338 336 } 337 338 char *owl_perlconfig_perlcmd(owl_cmd *cmd, int argc, char **argv) 339 { 340 int i, count; 341 char * ret = NULL; 342 STRLEN n_a; 343 dSP; 344 345 ENTER; 346 SAVETMPS; 347 348 PUSHMARK(SP); 349 for(i=0;i<argc;i++) { 350 XPUSHs(sv_2mortal(newSVpv(argv[i], 0))); 351 } 352 PUTBACK; 353 354 count = call_sv(cmd->cmd_perl, G_SCALAR|G_EVAL); 355 356 SPAGAIN; 357 358 if(SvTRUE(ERRSV)) { 359 owl_function_error("Error: %s", SvPV(ERRSV, n_a)); 360 POPs; 361 } else { 362 if(count != 1) 363 croak("Perl command %s returned more than one value!", cmd->name); 364 SV * rv = POPs; 365 if(SvTRUE(rv)) { 366 ret = owl_strdup(SvPV(rv, n_a)); 367 } 368 } 369 370 FREETMPS; 371 LEAVE; 372 373 return ret; 374 } 375 376 void owl_perlconfig_cmd_free(owl_cmd *cmd) 377 { 378 SvREFCNT_dec(cmd); 379 }
Note: See TracChangeset
for help on using the changeset viewer.