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

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

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

revision 1.20 by flashcode, Sat Mar 12 03:16:30 2005 UTC revision 1.21 by flashcode, Thu May 5 16:26:34 2005 UTC
# Line 45  t_plugin_script *last_perl_script = NULL Line 45  t_plugin_script *last_perl_script = NULL
45  extern void boot_DynaLoader (pTHX_ CV* cv);  extern void boot_DynaLoader (pTHX_ CV* cv);
46    
47    
48    /******************************* Old interface ********************************/
49    
50  /*  /*
51   * IRC::register: startup function for all WeeChat Perl scripts   * IRC::register: startup function for all WeeChat Perl scripts
52   */   */
53    
54    /*** DEPRECATED function, kept for compatibility only, please don't update! ***/
55    
56  static XS (XS_IRC_register)  static XS (XS_IRC_register)
57  {  {
58      char *name, *version, *shutdown_func, *description;      char *name, *version, *shutdown_func, *description;
# Line 78  static XS (XS_IRC_register) Line 82  static XS (XS_IRC_register)
82            
83      if (perl_script_found)      if (perl_script_found)
84      {      {
85          /* error: another scripts already exists with this name! */          /* error: another script already exists with this name! */
86          irc_display_prefix (NULL, PREFIX_ERROR);          irc_display_prefix (NULL, PREFIX_ERROR);
87          gui_printf (NULL,          gui_printf (NULL,
88                      _("Perl error: unable to register Perl script \"%s\" (another script "                      _("%s error: unable to register \"%s\" script (another script "
89                      "already exists with this name)\n"),                      "already exists with this name)\n"),
90                      name);                      "Perl", name);
91      }      }
92      else      else
93      {      {
# Line 105  static XS (XS_IRC_register) Line 109  static XS (XS_IRC_register)
109                  perl_scripts = new_perl_script;                  perl_scripts = new_perl_script;
110              last_perl_script = new_perl_script;              last_perl_script = new_perl_script;
111                            
112              wee_log_printf (_("registered Perl script: \"%s\", version %s (%s)\n"),              wee_log_printf (_("Registered %s script: \"%s\", version %s (%s)\n"),
113                              name, version, description);                              "Perl", name, version, description);
114          }          }
115          else          else
116          {          {
117              irc_display_prefix (NULL, PREFIX_ERROR);              irc_display_prefix (NULL, PREFIX_ERROR);
118              gui_printf (NULL,              gui_printf (NULL,
119                          _("%s unable to load Perl script \"%s\" (not enough memory)\n"),                          _("%s error: unable to load script \"%s\" (not enough memory)\n"),
120                          WEECHAT_ERROR, name);                          "Perl", name);
121          }          }
122      }      }
123      XST_mPV (0, VERSION);      XST_mPV (0, VERSION);
# Line 124  static XS (XS_IRC_register) Line 128  static XS (XS_IRC_register)
128   * IRC::print: print message to current buffer   * IRC::print: print message to current buffer
129   */   */
130    
131    /*** DEPRECATED function, kept for compatibility only, please don't update! ***/
132    
133  static XS (XS_IRC_print)  static XS (XS_IRC_print)
134  {  {
135      int i, integer;      int i, integer;
# Line 148  static XS (XS_IRC_print) Line 154  static XS (XS_IRC_print)
154   *                          (server is optional)   *                          (server is optional)
155   */   */
156    
157    /*** DEPRECATED function, kept for compatibility only, please don't update! ***/
158    
159  static XS (XS_IRC_print_with_channel)  static XS (XS_IRC_print_with_channel)
160  {  {
161      int integer;      int integer;
# Line 207  static XS (XS_IRC_print_with_channel) Line 215  static XS (XS_IRC_print_with_channel)
215   * IRC::print_infobar: print message to infobar   * IRC::print_infobar: print message to infobar
216   */   */
217    
218    /*** DEPRECATED function, kept for compatibility only, please don't update! ***/
219    
220  static XS (XS_IRC_print_infobar)  static XS (XS_IRC_print_infobar)
221  {  {
222      int integer;      int integer;
# Line 221  static XS (XS_IRC_print_infobar) Line 231  static XS (XS_IRC_print_infobar)
231      {      {
232          irc_display_prefix (NULL, PREFIX_ERROR);          irc_display_prefix (NULL, PREFIX_ERROR);
233          gui_printf (NULL,          gui_printf (NULL,
234                      _("Perl error: wrong parameters for IRC::print_infobar Perl function\n"));                      _("%s error: wrong parameters for \"%s\" function\n"),
235                        "Perl", "print_infobar");
236      }      }
237            
238      XSRETURN_EMPTY;      XSRETURN_EMPTY;
# Line 231  static XS (XS_IRC_print_infobar) Line 242  static XS (XS_IRC_print_infobar)
242   * IRC::command: send command to server   * IRC::command: send command to server
243   */   */
244    
245    /*** DEPRECATED function, kept for compatibility only, please don't update! ***/
246    
247  static XS (XS_IRC_command)  static XS (XS_IRC_command)
248  {  {
249      int integer;      int integer;
# Line 254  static XS (XS_IRC_command) Line 267  static XS (XS_IRC_command)
267          {          {
268              irc_display_prefix (NULL, PREFIX_ERROR);              irc_display_prefix (NULL, PREFIX_ERROR);
269              gui_printf (NULL,              gui_printf (NULL,
270                          _("Perl error: server not found for IRC::command Perl function\n"));                          _("%s error: server not found for \"%s\" function\n"),
271                            "Perl", "command");
272          }          }
273      }      }
274      else      else
# Line 280  static XS (XS_IRC_command) Line 294  static XS (XS_IRC_command)
294   * IRC::add_message_handler: add handler for messages (privmsg, ...)   * IRC::add_message_handler: add handler for messages (privmsg, ...)
295   */   */
296    
297    /*** DEPRECATED function, kept for compatibility only, please don't update! ***/
298    
299  static XS (XS_IRC_add_message_handler)  static XS (XS_IRC_add_message_handler)
300  {  {
301      char *name, *function;      char *name, *function;
# Line 301  static XS (XS_IRC_add_message_handler) Line 317  static XS (XS_IRC_add_message_handler)
317   * IRC::add_command_handler: add command handler (define/redefine commands)   * IRC::add_command_handler: add command handler (define/redefine commands)
318   */   */
319    
320    /*** DEPRECATED function, kept for compatibility only, please don't update! ***/
321    
322  static XS (XS_IRC_add_command_handler)  static XS (XS_IRC_add_command_handler)
323  {  {
324      char *name, *function;      char *name, *function;
# Line 332  static XS (XS_IRC_add_command_handler) Line 350  static XS (XS_IRC_add_command_handler)
350   * IRC::get_info: get various infos   * IRC::get_info: get various infos
351   */   */
352    
353    /*** DEPRECATED function, kept for compatibility only, please don't update! ***/
354    
355  static XS (XS_IRC_get_info)  static XS (XS_IRC_get_info)
356  {  {
357      char *arg, *info = NULL, *server;      char *arg, *info = NULL, *server;
# Line 355  static XS (XS_IRC_get_info) Line 375  static XS (XS_IRC_get_info)
375          {          {
376              irc_display_prefix (NULL, PREFIX_ERROR);              irc_display_prefix (NULL, PREFIX_ERROR);
377              gui_printf (NULL,              gui_printf (NULL,
378                          _("Perl error: server not found for IRC::get_info Perl function\n"));                          _("%s error: server not found for \"%s\" function\n"),
379                            "Perl", "get_info");
380          }          }
381      }      }
382      else      else
# Line 406  static XS (XS_IRC_get_info) Line 427  static XS (XS_IRC_get_info)
427      XSRETURN (1);      XSRETURN (1);
428  }  }
429    
430    /******************************* New interface ********************************/
431    
432    /*
433     * weechat::register: startup function for all WeeChat Perl scripts
434     */
435    
436    static XS (XS_weechat_register)
437    {
438        char *name, *version, *shutdown_func, *description;
439        int integer;
440        t_plugin_script *ptr_perl_script, *perl_script_found, *new_perl_script;
441        dXSARGS;
442        
443        /* make gcc happy */
444        (void) items;
445        (void) cv;
446        
447        name = SvPV (ST (0), integer);
448        version = SvPV (ST (1), integer);
449        shutdown_func = SvPV (ST (2), integer);
450        description = SvPV (ST (3), integer);
451        
452        perl_script_found = NULL;
453        for (ptr_perl_script = perl_scripts; ptr_perl_script;
454             ptr_perl_script = ptr_perl_script->next_script)
455        {
456            if (strcasecmp (ptr_perl_script->name, name) == 0)
457            {
458                perl_script_found = ptr_perl_script;
459                break;
460            }
461        }
462        
463        if (perl_script_found)
464        {
465            /* error: another script already exists with this name! */
466            irc_display_prefix (NULL, PREFIX_ERROR);
467            gui_printf (NULL,
468                        _("%s error: unable to register \"%s\" script (another script "
469                        "already exists with this name)\n"),
470                        "Perl", name);
471        }
472        else
473        {
474            /* registering script */
475            new_perl_script = (t_plugin_script *)malloc (sizeof (t_plugin_script));
476            if (new_perl_script)
477            {
478                new_perl_script->name = strdup (name);
479                new_perl_script->version = strdup (version);
480                new_perl_script->shutdown_func = strdup (shutdown_func);
481                new_perl_script->description = strdup (description);
482                
483                /* add new script to list */
484                new_perl_script->prev_script = last_perl_script;
485                new_perl_script->next_script = NULL;
486                if (perl_scripts)
487                    last_perl_script->next_script = new_perl_script;
488                else
489                    perl_scripts = new_perl_script;
490                last_perl_script = new_perl_script;
491                
492                wee_log_printf (_("Registered %s script: \"%s\", version %s (%s)\n"),
493                                "Perl", name, version, description);
494            }
495            else
496            {
497                irc_display_prefix (NULL, PREFIX_ERROR);
498                gui_printf (NULL,
499                            _("%s error: unable to load script \"%s\" (not enough memory)\n"),
500                            "Perl", name);
501            }
502        }
503        XST_mPV (0, VERSION);
504        XSRETURN (1);
505    }
506    
507    /*
508     * weechat::print: print message into a buffer (current or specified one)
509     */
510    
511    static XS (XS_weechat_print)
512    {
513        int integer;
514        char *message, *channel_name, *server_name;
515        t_gui_buffer *ptr_buffer;
516        dXSARGS;
517        
518        /* make gcc happy */
519        (void) cv;
520        
521        if ((items < 1) || (items > 3))
522        {
523            irc_display_prefix (NULL, PREFIX_ERROR);
524            gui_printf (NULL,
525                        _("%s error: wrong parameters for \"%s\" function\n"),
526                        "Perl", "print");
527            XSRETURN_NO;
528            return;
529        }
530        
531        channel_name = NULL;
532        server_name = NULL;
533        
534        if (items > 1)
535        {
536            channel_name = SvPV (ST (1), integer);
537            if (items > 2)
538                server_name = SvPV (ST (2), integer);
539        }
540        
541        ptr_buffer = plugin_find_buffer (server_name, channel_name);
542        if (ptr_buffer)
543        {
544            message = SvPV (ST (0), integer);
545            irc_display_prefix (ptr_buffer, PREFIX_PLUGIN);
546            gui_printf (ptr_buffer, "%s%s",
547                        message,
548                        ((strlen (message) == 0) || (message[strlen (message) - 1] != '\n')) ? "\n" : "");
549                        
550            XSRETURN_YES;
551        }
552        
553        /* buffer not found */
554        XSRETURN_NO;
555    }
556    
557    /*
558     * weechat::print_infobar: print message to infobar
559     */
560    
561    static XS (XS_weechat_print_infobar)
562    {
563        int integer;
564        dXSARGS;
565        
566        /* make gcc happy */
567        (void) cv;
568        
569        if (items != 2)
570        {
571            irc_display_prefix (NULL, PREFIX_ERROR);
572            gui_printf (NULL,
573                        _("%s error: wrong parameters for \"%s\" function\n"),
574                        "Perl", "print_infobar");
575            XSRETURN_NO;
576        }
577        
578        gui_infobar_printf (SvIV (ST (0)), COLOR_WIN_INFOBAR, SvPV (ST (1), integer));
579        XSRETURN_YES;
580    }
581    
582    /*
583     * weechat::command: send command to server
584     */
585    
586    static XS (XS_weechat_command)
587    {
588        int integer;
589        char *command, *channel_name, *server_name;
590        t_gui_buffer *ptr_buffer;
591        dXSARGS;
592        
593        /* make gcc happy */
594        (void) cv;
595        
596        if ((items < 1) || (items > 3))
597        {
598            irc_display_prefix (NULL, PREFIX_ERROR);
599            gui_printf (NULL,
600                        _("%s error: wrong parameters for \"%s\" function\n"),
601                        "Perl", "command");
602            XSRETURN_NO;
603            return;
604        }
605        
606        channel_name = NULL;
607        server_name = NULL;
608        
609        if (items > 1)
610        {
611            channel_name = SvPV (ST (1), integer);
612            if (items > 2)
613                server_name = SvPV (ST (2), integer);
614        }
615        
616        ptr_buffer = plugin_find_buffer (server_name, channel_name);
617        if (ptr_buffer)
618        {
619            command = SvPV (ST (0), integer);
620            user_command (SERVER(ptr_buffer), ptr_buffer, command);
621            XSRETURN_YES;
622        }
623        
624        /* buffer not found */
625        XSRETURN_NO;
626    }
627    
628    /*
629     * weechat::add_message_handler: add handler for messages (privmsg, ...)
630     */
631    
632    static XS (XS_weechat_add_message_handler)
633    {
634        char *name, *function;
635        int integer;
636        dXSARGS;
637        
638        /* make gcc happy */
639        (void) cv;
640        
641        if (items != 2)
642        {
643            irc_display_prefix (NULL, PREFIX_ERROR);
644            gui_printf (NULL,
645                        _("%s error: wrong parameters for \"%s\" function\n"),
646                        "Perl", "add_message_handler");
647            XSRETURN_NO;
648        }
649        
650        name = SvPV (ST (0), integer);
651        function = SvPV (ST (1), integer);
652        plugin_handler_add (&plugin_msg_handlers, &last_plugin_msg_handler,
653                            PLUGIN_TYPE_PERL, name, function);
654        XSRETURN_YES;
655    }
656    
657    /*
658     * weechat::add_command_handler: add command handler (define/redefine commands)
659     */
660    
661    static XS (XS_weechat_add_command_handler)
662    {
663        char *name, *function;
664        int integer;
665        t_plugin_handler *ptr_plugin_handler;
666        dXSARGS;
667        
668        /* make gcc happy */
669        (void) cv;
670        
671        if (items != 2)
672        {
673            irc_display_prefix (NULL, PREFIX_ERROR);
674            gui_printf (NULL,
675                        _("%s error: wrong parameters for \"%s\" function\n"),
676                        "Perl", "add_command_handler");
677            XSRETURN_NO;
678        }
679        
680        name = SvPV (ST (0), integer);
681        function = SvPV (ST (1), integer);
682        if (!weelist_search (index_commands, name))
683            weelist_add (&index_commands, &last_index_command, name);
684        ptr_plugin_handler = plugin_handler_search (plugin_cmd_handlers, name);
685        if (ptr_plugin_handler)
686        {
687            free (ptr_plugin_handler->function_name);
688            ptr_plugin_handler->function_name = strdup (function);
689        }
690        else
691            plugin_handler_add (&plugin_cmd_handlers, &last_plugin_cmd_handler,
692                                PLUGIN_TYPE_PERL, name, function);
693        
694        XSRETURN_YES;
695    }
696    
697    /*
698     * weechat::get_info: get various infos
699     */
700    
701    static XS (XS_weechat_get_info)
702    {
703        char *arg, *info = NULL, *server_name;
704        t_irc_server *ptr_server;
705        int integer;
706        dXSARGS;
707        
708        /* make gcc happy */
709        (void) cv;
710        
711        if ((items < 1) || (items > 2))
712        {
713            irc_display_prefix (NULL, PREFIX_ERROR);
714            gui_printf (NULL,
715                        _("%s error: wrong parameters for \"%s\" function\n"),
716                        "Perl", "get_info");
717            XSRETURN_NO;
718        }
719        
720        if (items == 2)
721        {
722            server_name = SvPV (ST (1), integer);
723            ptr_server = server_search (server_name);
724        }
725        else
726            ptr_server = SERVER(gui_current_window->buffer);
727        
728        if (!ptr_server)
729        {
730            irc_display_prefix (NULL, PREFIX_ERROR);
731            gui_printf (NULL,
732                        _("%s error: server not found for \"%s\" function\n"),
733                        "Perl", "get_info");
734            XSRETURN_NO;
735        }
736        
737        arg = SvPV (ST (0), integer);
738        if (arg)
739        {
740            if ( (strcasecmp (arg, "0") == 0) || (strcasecmp (arg, "version") == 0) )
741            {
742                info = PACKAGE_STRING;
743            }
744            else if ( (strcasecmp (arg, "1") == 0) || (strcasecmp (arg, "nick") == 0) )
745            {
746                if (ptr_server->nick)
747                    info = ptr_server->nick;
748            }
749            else if ( (strcasecmp (arg, "2") == 0) || (strcasecmp (arg, "channel") == 0) )
750            {
751                if (BUFFER_IS_CHANNEL (gui_current_window->buffer))
752                    info = CHANNEL (gui_current_window->buffer)->name;
753            }
754            else if ( (strcasecmp (arg, "3") == 0) || (strcasecmp (arg, "server") == 0) )
755            {
756                if (ptr_server->name)
757                    info = ptr_server->name;
758            }
759            else if ( (strcasecmp (arg, "4") == 0) || (strcasecmp (arg, "weechatdir") == 0) )
760            {
761                info = weechat_home;
762            }
763            else if ( (strcasecmp (arg, "5") == 0) || (strcasecmp (arg, "away") == 0) )
764            {
765                XST_mIV (0, SERVER(gui_current_window->buffer)->is_away);
766                XSRETURN (1);
767                return;
768            }
769            
770            if (info)
771                XST_mPV (0, info);
772            else
773                XST_mPV (0, "");
774        }
775        
776        XSRETURN (1);
777    }
778    
779  /*  /*
780   * xs_init: initialize subroutines   * xs_init: initialize subroutines
781   */   */
# Line 414  void Line 784  void
784  xs_init (pTHX)  xs_init (pTHX)
785  {  {
786      newXS ("DynaLoader::boot_DynaLoader", boot_DynaLoader, __FILE__);      newXS ("DynaLoader::boot_DynaLoader", boot_DynaLoader, __FILE__);
787        
788        /* DEPRECATED & old interface (WeeChat <= 0.1.1), kept for compatibility */
789      newXS ("IRC::register", XS_IRC_register, "IRC");      newXS ("IRC::register", XS_IRC_register, "IRC");
790      newXS ("IRC::print", XS_IRC_print, "IRC");      newXS ("IRC::print", XS_IRC_print, "IRC");
791      newXS ("IRC::print_with_channel", XS_IRC_print_with_channel, "IRC");      newXS ("IRC::print_with_channel", XS_IRC_print_with_channel, "IRC");
# Line 422  xs_init (pTHX) Line 794  xs_init (pTHX)
794      newXS ("IRC::add_message_handler", XS_IRC_add_message_handler, "IRC");      newXS ("IRC::add_message_handler", XS_IRC_add_message_handler, "IRC");
795      newXS ("IRC::add_command_handler", XS_IRC_add_command_handler, "IRC");      newXS ("IRC::add_command_handler", XS_IRC_add_command_handler, "IRC");
796      newXS ("IRC::get_info", XS_IRC_get_info, "IRC");      newXS ("IRC::get_info", XS_IRC_get_info, "IRC");
797        
798        /* new interface (WeeChat >= 0.1.2) */
799        newXS ("weechat::register", XS_weechat_register, "weechat");
800        newXS ("weechat::print", XS_weechat_print, "weechat");
801        newXS ("weechat::print_infobar", XS_weechat_print_infobar, "weechat");
802        newXS ("weechat::command", XS_weechat_command, "weechat");
803        newXS ("weechat::add_message_handler", XS_weechat_add_message_handler, "weechat");
804        newXS ("weechat::add_command_handler", XS_weechat_add_command_handler, "weechat");
805        newXS ("weechat::get_info", XS_weechat_get_info, "weechat");
806  }  }
807    
808  /*  /*
# Line 433  wee_perl_init () Line 814  wee_perl_init ()
814  {  {
815      char *perl_args[] = { "", "-e", "0" };      char *perl_args[] = { "", "-e", "0" };
816      /* Following Perl code is extracted/modified from X-Chat IRC client */      /* Following Perl code is extracted/modified from X-Chat IRC client */
817      /* X-Chat is (c) 1998-2002 Peter Zelezny */      /* X-Chat is (c) 1998-2005 Peter Zelezny */
818      char *weechat_perl_func =      char *weechat_perl_func =
819      {      {
820          "sub wee_perl_load_file"          "sub wee_perl_load_file"
# Line 451  wee_perl_init () Line 832  wee_perl_init ()
832          "    my $content = wee_perl_load_file ($filename);"          "    my $content = wee_perl_load_file ($filename);"
833          "    if ($content eq \"__WEECHAT_ERROR__\")"          "    if ($content eq \"__WEECHAT_ERROR__\")"
834          "    {"          "    {"
835          "        IRC::print \"WeeChat Error: Perl script '$filename' not found.\\n\";"          "        weechat::print \"WeeChat Error: Perl script '$filename' not found.\\n\";"
836          "        return 1;"          "        return 1;"
837          "    }"          "    }"
838          "    eval $content;"          "    eval $content;"
839          "    if ($@)"          "    if ($@)"
840          "    {"          "    {"
841          "        IRC::print \"WeeChat error: unable to load Perl script '$filename':\\n\";"          "        weechat::print \"WeeChat error: unable to load Perl script '$filename':\\n\";"
842          "        IRC::print \"$@\\n\";"          "        weechat::print \"$@\\n\";"
843          "        return 2;"          "        return 2;"
844          "    }"          "    }"
845          "    return 0;"          "    return 0;"
846          "}"          "}"
847          "$SIG{__WARN__} = sub { IRC::print \"$_[0]\n\"; };"          "$SIG{__WARN__} = sub { weechat::print \"$_[0]\n\"; };"
848      };      };
849            
850        wee_log_printf (_("Loading %s module \"weechat\"\n"), "Perl");
851      my_perl = perl_alloc ();      my_perl = perl_alloc ();
852      perl_construct (my_perl);      perl_construct (my_perl);
853      perl_parse (my_perl, xs_init, 3, perl_args, NULL);      perl_parse (my_perl, xs_init, 3, perl_args, NULL);
# Line 524  wee_perl_exec (char *function, char *ser Line 906  wee_perl_exec (char *function, char *ser
906      {      {
907          irc_display_prefix (NULL, PREFIX_ERROR);          irc_display_prefix (NULL, PREFIX_ERROR);
908          gui_printf (NULL,          gui_printf (NULL,
909                      _("Perl error: %s\n"),                      _("Perl error: %s"),
910                      SvPV (sv, count));                      SvPV (sv, count));
911          POPs;          POPs;
912      }      }
# Line 534  wee_perl_exec (char *function, char *ser Line 916  wee_perl_exec (char *function, char *ser
916          {          {
917              irc_display_prefix (NULL, PREFIX_ERROR);              irc_display_prefix (NULL, PREFIX_ERROR);
918              gui_printf (NULL,              gui_printf (NULL,
919                          _("Perl error: too much values from \"%s\" (%d). Expected: 1.\n"),                          _("%s error: too much values from \"%s\" (%d). Expected: 1.\n"),
920                          function, count);                          "Perl", function, count);
921          }          }
922          else          else
923              return_code = POPi;              return_code = POPi;
# Line 556  int Line 938  int
938  wee_perl_load (char *filename)  wee_perl_load (char *filename)
939  {  {
940      /* execute Perl script */      /* execute Perl script */
941      wee_log_printf (_("loading Perl script \"%s\"\n"), filename);      wee_log_printf (_("Loading %s script \"%s\"\n"), "Perl", filename);
942      irc_display_prefix (NULL, PREFIX_PLUGIN);      irc_display_prefix (NULL, PREFIX_PLUGIN);
943      gui_printf (NULL, _("Loading Perl script \"%s\"\n"), filename);      gui_printf (NULL, _("Loading %s script \"%s\"\n"), "Perl", filename);
944      return wee_perl_exec ("wee_perl_load_eval_file", filename, "");      return wee_perl_exec ("wee_perl_load_eval_file", filename, "");
945  }  }
946    
# Line 607  wee_perl_unload (t_plugin_script *ptr_pe Line 989  wee_perl_unload (t_plugin_script *ptr_pe
989  {  {
990      if (ptr_perl_script)      if (ptr_perl_script)
991      {      {
992          wee_log_printf (_("unloading Perl script \"%s\"\n"),          wee_log_printf (_("Unloading %s script \"%s\"\n"),
993                          ptr_perl_script->name);                          "Perl", ptr_perl_script->name);
994                    
995          /* call shutdown callback function */          /* call shutdown callback function */
996          if (ptr_perl_script->shutdown_func[0])          if (ptr_perl_script->shutdown_func[0])
# Line 624  wee_perl_unload (t_plugin_script *ptr_pe Line 1006  wee_perl_unload (t_plugin_script *ptr_pe
1006  void  void
1007  wee_perl_unload_all ()  wee_perl_unload_all ()
1008  {  {
1009      wee_log_printf (_("unloading all Perl scripts...\n"));      wee_log_printf (_("Unloading all %s scripts...\n"), "Perl");
1010      while (perl_scripts)      while (perl_scripts)
1011          wee_perl_unload (perl_scripts);          wee_perl_unload (perl_scripts);
1012        
1013        irc_display_prefix (NULL, PREFIX_PLUGIN);
1014        gui_printf (NULL, _("%s scripts unloaded\n"), "Perl");
1015  }  }
1016    
1017  /*  /*

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

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