452 |
} |
} |
453 |
|
|
454 |
/* |
/* |
455 |
|
* weechat::get_config: get value of a config option |
456 |
|
*/ |
457 |
|
|
458 |
|
static XS (XS_weechat_get_config) |
459 |
|
{ |
460 |
|
char *option, *value; |
461 |
|
unsigned int integer; |
462 |
|
dXSARGS; |
463 |
|
|
464 |
|
/* make gcc happy */ |
465 |
|
(void) cv; |
466 |
|
|
467 |
|
if (items != 1) |
468 |
|
{ |
469 |
|
perl_plugin->printf_server (perl_plugin, |
470 |
|
"Perl error: wrong parameters for " |
471 |
|
"\"get_config\" function"); |
472 |
|
XSRETURN_NO; |
473 |
|
} |
474 |
|
|
475 |
|
option = SvPV (ST (0), integer); |
476 |
|
if (option) |
477 |
|
{ |
478 |
|
value = perl_plugin->get_config (perl_plugin, option); |
479 |
|
|
480 |
|
if (value) |
481 |
|
{ |
482 |
|
XST_mPV (0, value); |
483 |
|
free (value); |
484 |
|
} |
485 |
|
else |
486 |
|
XST_mPV (0, ""); |
487 |
|
} |
488 |
|
|
489 |
|
XSRETURN (1); |
490 |
|
} |
491 |
|
|
492 |
|
/* |
493 |
* weechat_perl_xs_init: initialize subroutines |
* weechat_perl_xs_init: initialize subroutines |
494 |
*/ |
*/ |
495 |
|
|
506 |
newXS ("weechat::add_command_handler", XS_weechat_add_command_handler, "weechat"); |
newXS ("weechat::add_command_handler", XS_weechat_add_command_handler, "weechat"); |
507 |
newXS ("weechat::get_info", XS_weechat_get_info, "weechat"); |
newXS ("weechat::get_info", XS_weechat_get_info, "weechat"); |
508 |
newXS ("weechat::get_dcc_info", XS_weechat_get_dcc_info, "weechat"); |
newXS ("weechat::get_dcc_info", XS_weechat_get_dcc_info, "weechat"); |
509 |
|
newXS ("weechat::get_config", XS_weechat_get_config, "weechat"); |
510 |
} |
} |
511 |
|
|
512 |
/* |
/* |