Exemplo n.º 1
0
void
weechat_tcl_reload_name (const char *name)
{
    struct t_plugin_script *ptr_script;
    char *filename;

    ptr_script = plugin_script_search (weechat_tcl_plugin, tcl_scripts, name);
    if (ptr_script)
    {
        filename = strdup (ptr_script->filename);
        if (filename)
        {
            weechat_tcl_unload (ptr_script);
            if (!tcl_quiet)
            {
                weechat_printf (NULL,
                                weechat_gettext ("%s: script \"%s\" unloaded"),
                                TCL_PLUGIN_NAME, name);
            }
            weechat_tcl_load (filename);
            free (filename);
        }
    }
    else
    {
        weechat_printf (NULL,
                        weechat_gettext ("%s%s: script \"%s\" not loaded"),
                        weechat_prefix ("error"), TCL_PLUGIN_NAME, name);
    }
}
Exemplo n.º 2
0
int
weechat_plugin_end (struct t_weechat_plugin *plugin)
{
    /* unload all scripts */
    tcl_quiet = 1;
    plugin_script_end (plugin, &tcl_data);
    if (tcl_script_eval)
    {
        weechat_tcl_unload (tcl_script_eval);
        tcl_script_eval = NULL;
    }
    tcl_quiet = 0;

    /* free some data */
    if (tcl_action_install_list)
        free (tcl_action_install_list);
    if (tcl_action_remove_list)
        free (tcl_action_remove_list);
    if (tcl_action_autoload_list)
        free (tcl_action_autoload_list);
    /* weechat_string_dyn_free (tcl_buffer_output, 1); */
    if (tcl_eval_output)
        free (tcl_eval_output);

    return WEECHAT_RC_OK;
}
Exemplo n.º 3
0
void
weechat_tcl_unload_all ()
{
    while (tcl_scripts)
    {
        weechat_tcl_unload (tcl_scripts);
    }
}
Exemplo n.º 4
0
void
weechat_tcl_unload_name (const char *name)
{
    struct t_plugin_script *ptr_script;

    ptr_script = script_search (weechat_tcl_plugin, tcl_scripts, name);
    if (ptr_script)
    {
        weechat_tcl_unload (ptr_script);
        weechat_printf (NULL,
                        weechat_gettext ("%s: script \"%s\" unloaded"),
                        TCL_PLUGIN_NAME, name);
    }
    else
    {
        weechat_printf (NULL,
                        weechat_gettext ("%s%s: script \"%s\" not loaded"),
                        weechat_prefix ("error"), TCL_PLUGIN_NAME, name);
    }
}