Changeset 96d80e9 for perlconfig.c
- Timestamp:
- Jun 22, 2013, 12:36:17 PM (11 years ago)
- Branches:
- master, release-1.10
- Children:
- 749916e, 4ae24dd, 88e7b2e, 963f0e3, 4f6097e, ea43085, 825953e, 2323e49, f248113
- Parents:
- 92ffd89
- git-author:
- Jason Gross <jgross@mit.edu> (06/20/11 15:03:22)
- git-committer:
- Jason Gross <jgross@mit.edu> (06/22/13 12:36:17)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perlconfig.c
r92ffd89 r96d80e9 439 439 } 440 440 441 /* caller must free the result */ 442 CALLER_OWN char *owl_perlconfig_perlcmd(const owl_cmd *cmd, int argc, const char *const *argv) 443 { 444 int i; 445 SV* rv; 441 CALLER_OWN char *owl_perlconfig_perl_call(const char *method, int argc, const char *const *argv) 442 { 443 SV *rv; 446 444 char *out = NULL; 447 448 OWL_PERL_CALL(call_ sv(cmd->cmd_perl, G_SCALAR|G_EVAL)445 int i; 446 OWL_PERL_CALL(call_pv(method, G_SCALAR|G_EVAL) 449 447 , 450 448 OWL_PERL_PUSH_ARGS(i, argc, argv); … … 463 461 } 464 462 463 int owl_perlconfig_perl_call_int(const char *method, int argc, const char *const *argv) 464 { 465 SV *rv; 466 int ret = -1; 467 int i; 468 OWL_PERL_CALL(call_pv(method, G_SCALAR|G_EVAL) 469 , 470 OWL_PERL_PUSH_ARGS(i, argc, argv); 471 , 472 "Perl Error: '%s'" 473 , 474 false 475 , 476 false 477 , 478 rv = POPs; 479 if (rv && SvIOK(rv)) 480 ret = SvIV(rv); 481 ); 482 return ret; 483 } 484 485 bool owl_perlconfig_perl_call_bool(const char *method, int argc, const char *const *argv) 486 { 487 SV *rv; 488 bool ret = false; 489 int i; 490 OWL_PERL_CALL(call_pv(method, G_SCALAR|G_EVAL) 491 , 492 OWL_PERL_PUSH_ARGS(i, argc, argv); 493 , 494 "Perl Error: '%s'" 495 , 496 false 497 , 498 false 499 , 500 rv = POPs; 501 if (rv) 502 ret = SvTRUE(rv); 503 ); 504 return ret; 505 } 506 507 void owl_perlconfig_perl_call_norv(const char *method, int argc, const char *const *argv) 508 { 509 int i; 510 OWL_PERL_CALL(call_pv(method, G_DISCARD|G_EVAL) 511 , 512 OWL_PERL_PUSH_ARGS(i, argc, argv); 513 , 514 "Perl Error: '%s'" 515 , 516 false 517 , 518 true 519 , 520 ); 521 } 522 523 /* caller must free the result */ 524 CALLER_OWN char *owl_perlconfig_perlcmd(const owl_cmd *cmd, int argc, const char *const *argv) 525 { 526 int i; 527 SV* rv; 528 char *out = NULL; 529 530 OWL_PERL_CALL(call_sv(cmd->cmd_perl, G_SCALAR|G_EVAL) 531 , 532 OWL_PERL_PUSH_ARGS(i, argc, argv); 533 , 534 "Perl Error: '%s'" 535 , 536 false 537 , 538 false 539 , 540 rv = POPs; 541 if (rv && SvPOK(rv)) 542 out = g_strdup(SvPV_nolen(rv)); 543 ); 544 return out; 545 } 546 465 547 void owl_perlconfig_cmd_cleanup(owl_cmd *cmd) 466 548 {
Note: See TracChangeset
for help on using the changeset viewer.