226 |
} |
} |
227 |
else |
else |
228 |
{ |
{ |
229 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
230 |
gui_printf (NULL, |
gui_printf (NULL, |
231 |
_("%s plugin %s: unable to add handler for IRC command \"%s\" (not enough memory)\n"), |
_("%s plugin %s: unable to add handler for IRC command \"%s\" (not enough memory)\n"), |
232 |
WEECHAT_ERROR, plugin->name, irc_command); |
WEECHAT_ERROR, plugin->name, irc_command); |
261 |
|
|
262 |
if (plugin_cmd_handler_search (command)) |
if (plugin_cmd_handler_search (command)) |
263 |
{ |
{ |
264 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
265 |
gui_printf (NULL, |
gui_printf (NULL, |
266 |
_("%s plugin %s: unable to add handler for \"%s\" command " |
_("%s plugin %s: unable to add handler for \"%s\" command " |
267 |
"(already exists)\n"), |
"(already exists)\n"), |
298 |
} |
} |
299 |
else |
else |
300 |
{ |
{ |
301 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
302 |
gui_printf (NULL, |
gui_printf (NULL, |
303 |
_("%s plugin %s: unable to add handler for \"%s\" command (not enough memory)\n"), |
_("%s plugin %s: unable to add handler for \"%s\" command (not enough memory)\n"), |
304 |
WEECHAT_ERROR, plugin->name, command); |
WEECHAT_ERROR, plugin->name, command); |
546 |
handle = dlopen (full_name, RTLD_GLOBAL | RTLD_NOW); |
handle = dlopen (full_name, RTLD_GLOBAL | RTLD_NOW); |
547 |
if (!handle) |
if (!handle) |
548 |
{ |
{ |
549 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
550 |
gui_printf (NULL, _("%s unable to load plugin \"%s\": %s\n"), |
gui_printf (NULL, _("%s unable to load plugin \"%s\": %s\n"), |
551 |
WEECHAT_ERROR, full_name, dlerror()); |
WEECHAT_ERROR, full_name, dlerror()); |
552 |
free (full_name); |
free (full_name); |
557 |
if (!name) |
if (!name) |
558 |
{ |
{ |
559 |
dlclose (handle); |
dlclose (handle); |
560 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
561 |
gui_printf (NULL, _("%s symbol \"plugin_name\" not found in plugin \"%s\", failed to load\n"), |
gui_printf (NULL, _("%s symbol \"plugin_name\" not found in plugin \"%s\", failed to load\n"), |
562 |
WEECHAT_ERROR, full_name); |
WEECHAT_ERROR, full_name); |
563 |
free (full_name); |
free (full_name); |
567 |
if (plugin_search (name)) |
if (plugin_search (name)) |
568 |
{ |
{ |
569 |
dlclose (handle); |
dlclose (handle); |
570 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
571 |
gui_printf (NULL, |
gui_printf (NULL, |
572 |
_("%s unable to load plugin \"%s\": a plugin with " |
_("%s unable to load plugin \"%s\": a plugin with " |
573 |
"same name already exists\n"), |
"same name already exists\n"), |
580 |
if (!description) |
if (!description) |
581 |
{ |
{ |
582 |
dlclose (handle); |
dlclose (handle); |
583 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
584 |
gui_printf (NULL, _("%s symbol \"plugin_description\" not found in plugin \"%s\", failed to load\n"), |
gui_printf (NULL, _("%s symbol \"plugin_description\" not found in plugin \"%s\", failed to load\n"), |
585 |
WEECHAT_ERROR, full_name); |
WEECHAT_ERROR, full_name); |
586 |
free (full_name); |
free (full_name); |
591 |
if (!version) |
if (!version) |
592 |
{ |
{ |
593 |
dlclose (handle); |
dlclose (handle); |
594 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
595 |
gui_printf (NULL, _("%s symbol \"plugin_version\" not found in plugin \"%s\", failed to load\n"), |
gui_printf (NULL, _("%s symbol \"plugin_version\" not found in plugin \"%s\", failed to load\n"), |
596 |
WEECHAT_ERROR, full_name); |
WEECHAT_ERROR, full_name); |
597 |
free (full_name); |
free (full_name); |
602 |
if (!init_func) |
if (!init_func) |
603 |
{ |
{ |
604 |
dlclose (handle); |
dlclose (handle); |
605 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
606 |
gui_printf (NULL, _("%s function \"weechat_plugin_init\" not found in plugin \"%s\", failed to load\n"), |
gui_printf (NULL, _("%s function \"weechat_plugin_init\" not found in plugin \"%s\", failed to load\n"), |
607 |
WEECHAT_ERROR, full_name); |
WEECHAT_ERROR, full_name); |
608 |
free (full_name); |
free (full_name); |
655 |
weechat_plugins = new_plugin; |
weechat_plugins = new_plugin; |
656 |
last_weechat_plugin = new_plugin; |
last_weechat_plugin = new_plugin; |
657 |
|
|
658 |
irc_display_prefix (NULL, PREFIX_PLUGIN); |
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN); |
659 |
gui_printf (NULL, |
gui_printf (NULL, |
660 |
_("Initializing plugin \"%s\" %s\n"), |
_("Initializing plugin \"%s\" %s\n"), |
661 |
new_plugin->name, new_plugin->version); |
new_plugin->name, new_plugin->version); |
663 |
/* init plugin */ |
/* init plugin */ |
664 |
if (((t_weechat_init_func *)init_func) (new_plugin) < 0) |
if (((t_weechat_init_func *)init_func) (new_plugin) < 0) |
665 |
{ |
{ |
666 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
667 |
gui_printf (NULL, |
gui_printf (NULL, |
668 |
_("%s unable to initialize plugin \"%s\"\n"), |
_("%s unable to initialize plugin \"%s\"\n"), |
669 |
WEECHAT_ERROR, full_name); |
WEECHAT_ERROR, full_name); |
674 |
} |
} |
675 |
else |
else |
676 |
{ |
{ |
677 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
678 |
gui_printf (NULL, |
gui_printf (NULL, |
679 |
_("%s unable to load plugin \"%s\" (not enough memory)\n"), |
_("%s unable to load plugin \"%s\" (not enough memory)\n"), |
680 |
WEECHAT_ERROR, full_name); |
WEECHAT_ERROR, full_name); |
682 |
return NULL; |
return NULL; |
683 |
} |
} |
684 |
|
|
685 |
irc_display_prefix (NULL, PREFIX_PLUGIN); |
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN); |
686 |
gui_printf (NULL, |
gui_printf (NULL, |
687 |
_("Plugin \"%s\" (%s) loaded.\n"), |
_("Plugin \"%s\" (%s) loaded.\n"), |
688 |
name, full_name); |
name, full_name); |
823 |
if (ptr_plugin) |
if (ptr_plugin) |
824 |
{ |
{ |
825 |
plugin_unload (ptr_plugin); |
plugin_unload (ptr_plugin); |
826 |
irc_display_prefix (NULL, PREFIX_PLUGIN); |
irc_display_prefix (NULL, NULL, PREFIX_PLUGIN); |
827 |
gui_printf (NULL, _("Plugin \"%s\" unloaded.\n"), name); |
gui_printf (NULL, _("Plugin \"%s\" unloaded.\n"), name); |
828 |
} |
} |
829 |
else |
else |
830 |
{ |
{ |
831 |
irc_display_prefix (NULL, PREFIX_ERROR); |
irc_display_prefix (NULL, NULL, PREFIX_ERROR); |
832 |
gui_printf (NULL, |
gui_printf (NULL, |
833 |
_("%s plugin \"%s\" not found\n"), |
_("%s plugin \"%s\" not found\n"), |
834 |
WEECHAT_ERROR, name); |
WEECHAT_ERROR, name); |