Changeset 57ad328
- Timestamp:
- Sep 30, 2011, 8:22:50 AM (13 years ago)
- Children:
- 6df57d4
- Parents:
- 0c71c58
- git-author:
- Jason Gross <jgross@mit.edu> (06/20/11 15:03:22)
- git-committer:
- Jason Gross <jgross@mit.edu> (09/30/11 08:22:50)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perlconfig.c
r0c71c58 r57ad328 424 424 } 425 425 426 /* caller must free the result */ 427 CALLER_OWN char *owl_perlconfig_perlcmd(const owl_cmd *cmd, int argc, const char *const *argv) 428 { 429 int i; 430 SV* rv; 426 CALLER_OWN char *owl_perlconfig_perl_call(const char *method, int argc, const char *const *argv) 427 { 428 SV *rv; 431 429 char *out = NULL; 432 433 OWL_PERL_CALL(call_ sv(cmd->cmd_perl, G_SCALAR|G_EVAL)430 int i; 431 OWL_PERL_CALL(call_pv(method, G_SCALAR|G_EVAL) 434 432 , 435 433 OWL_PERL_PUSH_ARGS(i, argc, argv); … … 448 446 } 449 447 448 int owl_perlconfig_perl_call_int(const char *method, int argc, const char *const *argv) 449 { 450 SV *rv; 451 int ret = -1; 452 int i; 453 OWL_PERL_CALL(call_pv(method, G_SCALAR|G_EVAL) 454 , 455 OWL_PERL_PUSH_ARGS(i, argc, argv); 456 , 457 "Perl Error: '%s'" 458 , 459 false 460 , 461 false 462 , 463 rv = POPs; 464 if (rv && SvIOK(rv)) 465 ret = SvIV(rv); 466 ); 467 return ret; 468 } 469 470 bool owl_perlconfig_perl_call_bool(const char *method, int argc, const char *const *argv) 471 { 472 SV *rv; 473 bool ret = false; 474 int i; 475 OWL_PERL_CALL(call_pv(method, G_SCALAR|G_EVAL) 476 , 477 OWL_PERL_PUSH_ARGS(i, argc, argv); 478 , 479 "Perl Error: '%s'" 480 , 481 false 482 , 483 false 484 , 485 rv = POPs; 486 if (rv) 487 ret = SvTRUE(rv); 488 ); 489 return ret; 490 } 491 492 void owl_perlconfig_perl_call_norv(const char *method, int argc, const char *const *argv) 493 { 494 int i; 495 OWL_PERL_CALL(call_pv(method, G_DISCARD|G_EVAL) 496 , 497 OWL_PERL_PUSH_ARGS(i, argc, argv); 498 , 499 "Perl Error: '%s'" 500 , 501 false 502 , 503 true 504 , 505 ); 506 } 507 508 /* caller must free the result */ 509 CALLER_OWN char *owl_perlconfig_perlcmd(const owl_cmd *cmd, int argc, const char *const *argv) 510 { 511 int i; 512 SV* rv; 513 char *out = NULL; 514 515 OWL_PERL_CALL(call_sv(cmd->cmd_perl, G_SCALAR|G_EVAL) 516 , 517 OWL_PERL_PUSH_ARGS(i, argc, argv); 518 , 519 "Perl Error: '%s'" 520 , 521 false 522 , 523 false 524 , 525 rv = POPs; 526 if (rv && SvPOK(rv)) 527 out = g_strdup(SvPV_nolen(rv)); 528 ); 529 return out; 530 } 531 450 532 void owl_perlconfig_cmd_cleanup(owl_cmd *cmd) 451 533 {
Note: See TracChangeset
for help on using the changeset viewer.