/[weechat]/weechat/src/plugins/scripts/perl/weechat-perl.c
ViewVC logotype

Diff of /weechat/src/plugins/scripts/perl/weechat-perl.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by flashcode, Sun Oct 16 15:39:20 2005 UTC revision 1.3 by flashcode, Mon Oct 17 14:30:04 2005 UTC
# Line 452  static XS (XS_weechat_get_dcc_info) Line 452  static XS (XS_weechat_get_dcc_info)
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    
# Line 468  weechat_perl_xs_init (pTHX) Line 506  weechat_perl_xs_init (pTHX)
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  /*  /*

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26