/[weechat]/weechat/src/plugins/plugins.c
ViewVC logotype

Diff of /weechat/src/plugins/plugins.c

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

revision 1.5 by flashcode, Sat Nov 22 16:55:57 2003 UTC revision 1.6 by flashcode, Sun Nov 23 17:40:19 2003 UTC
# Line 82  plugin_load (int plugin_type, char *file Line 82  plugin_load (int plugin_type, char *file
82  }  }
83    
84  /*  /*
  * plugin_unload: unload a plugin  
  */  
   
 void  
 plugin_unload (int plugin_type, char *scriptname)  
 {  
     #ifdef PLUGINS  
     switch (plugin_type)  
     {  
         case PLUGIN_TYPE_PERL:  
             #ifdef PLUGIN_PERL  
             wee_perl_unload (wee_perl_search (scriptname));  
             #endif  
             break;  
         case PLUGIN_TYPE_PYTHON:  
             /* TODO: load Python script */  
             break;  
         case PLUGIN_TYPE_RUBY:  
             /* TODO: load Ruby script */  
             break;  
     }  
     #endif  
 }  
   
 /*  
85   * plugin_handler_search: look for message/command handler   * plugin_handler_search: look for message/command handler
86   */   */
87    
# Line 205  plugin_handler_free_all (t_plugin_handle Line 180  plugin_handler_free_all (t_plugin_handle
180  }  }
181    
182  /*  /*
183     * plugin_handler_free_all_type: remove all message/command handlers for one type
184     */
185    
186    void
187    plugin_handler_free_all_type (t_plugin_handler **plugin_handlers,
188                                  t_plugin_handler **last_plugin_handler,
189                                  int plugin_type)
190    {
191        t_plugin_handler *ptr_plugin_handler, *new_plugin_handler;
192        
193        ptr_plugin_handler = *plugin_handlers;
194        while (ptr_plugin_handler)
195        {
196            if (ptr_plugin_handler->plugin_type == plugin_type)
197            {
198                new_plugin_handler = ptr_plugin_handler->next_handler;
199                plugin_handler_free (plugin_handlers, last_plugin_handler,
200                                     ptr_plugin_handler);
201                ptr_plugin_handler = new_plugin_handler;
202            }
203            else
204                ptr_plugin_handler = ptr_plugin_handler->next_handler;
205        }
206    }
207    
208    /*
209   * plugin_event_msg: IRC message received => call all handlers for this message   * plugin_event_msg: IRC message received => call all handlers for this message
210   */   */
211    
# Line 267  plugin_exec_command (char *user_command, Line 268  plugin_exec_command (char *user_command,
268  }  }
269    
270  /*  /*
271     * plugin_unload: unload all scripts for a plugin type
272     */
273    
274    void
275    plugin_unload (int plugin_type, char *scriptname)
276    {
277        #ifdef PLUGINS
278        switch (plugin_type)
279        {
280            case PLUGIN_TYPE_PERL:
281                #ifdef PLUGIN_PERL
282                wee_perl_unload_all ();
283                /* impossible to unload only one Perl script */
284                plugin_handler_free_all_type (&plugin_msg_handlers,
285                                              &last_plugin_msg_handler,
286                                              PLUGIN_TYPE_PERL);
287                plugin_handler_free_all_type (&plugin_cmd_handlers,
288                                              &last_plugin_cmd_handler,
289                                              PLUGIN_TYPE_PERL);
290                #endif
291                break;
292            case PLUGIN_TYPE_PYTHON:
293                /* TODO: unload Python scripts */
294                break;
295            case PLUGIN_TYPE_RUBY:
296                /* TODO: unload Ruby scripts */
297                break;
298        }
299        #endif
300    }
301    
302    /*
303   * plugin_end: shutdown plugin interface   * plugin_end: shutdown plugin interface
304   */   */
305    

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

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